能源&bug
This commit is contained in:
@@ -45,7 +45,8 @@
|
||||
<el-date-picker
|
||||
v-model="form.recordTime"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
format="yyyy-MM-dd"
|
||||
value-format="timestamp"
|
||||
placeholder="选择日期"
|
||||
style="width: 100%;">
|
||||
</el-date-picker>
|
||||
@@ -89,20 +90,17 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
init(params) {
|
||||
console.log(params)
|
||||
this.form.recordTime = moment().format('YYYY-MM-DD')
|
||||
console.log(this.form.recordTime)
|
||||
this.form.recordTime = moment().valueOf()
|
||||
if (params.type === 'add') {
|
||||
this.isEdit = false
|
||||
} else if (params.type === 'meterReading') {
|
||||
this.isEdit = false
|
||||
this.form.energyTypeId = params.energyType
|
||||
this.form.energyTypeId = params.energyTypeId
|
||||
this.form.tableName = params.tableName + ''
|
||||
}else {
|
||||
this.isEdit = true
|
||||
this.form.id = params.id
|
||||
energyQuantityManualGet({id: this.form.id}).then(res => {
|
||||
console.log(res)
|
||||
if (res.code === 0) {
|
||||
this.form.energyTypeId = res.data.energyTypeId
|
||||
this.form.tableName = res.data.tableName ? res.data.tableName+'' : ''
|
||||
@@ -118,6 +116,7 @@ export default {
|
||||
if (valid) {
|
||||
if (!this.form.unit) {
|
||||
this.$modal.msgError("抄表数单位不能为空");
|
||||
return false
|
||||
}
|
||||
if (this.isEdit) {
|
||||
// 编辑
|
||||
|
||||
@@ -48,26 +48,29 @@
|
||||
import { energyQuantityManualPage, energyQuantityManualDelete, energyQuantityManualExport } from "@/api/base/energyQuantityManual"
|
||||
import { getEnergyTypeListAll } from "@/api/base/energyType"
|
||||
import { publicFormatter } from '@/utils/dict'
|
||||
import { parseTime } from '@/utils/ruoyi'
|
||||
import { parseTime, parseTimeTable } from '@/utils/ruoyi'
|
||||
// import FileSaver from "file-saver"
|
||||
// import * as XLSX from 'xlsx/xlsx.mjs'
|
||||
import EnergyQuantityManualAdd from './components/energyQuantityManualAdd.vue'
|
||||
import EnergyQuantityManualAdd from './components/energyQuantityManualAdd'
|
||||
import moment from 'moment'
|
||||
const tableProps = [
|
||||
{
|
||||
prop: 'energyType',
|
||||
label: '能源类型'
|
||||
label: '能源类型',
|
||||
minWidth: 110,
|
||||
showOverflowtooltip: true
|
||||
},
|
||||
{
|
||||
prop: 'tableName',
|
||||
label: '水/气表名',
|
||||
filter: publicFormatter('table_name')
|
||||
filter: publicFormatter('table_name'),
|
||||
minWidth: 110
|
||||
},
|
||||
{
|
||||
prop: 'recordTime',
|
||||
label: '抄表日期',
|
||||
filter: parseTime,
|
||||
minWidth: 160
|
||||
filter: parseTimeTable('{y}-{m}-{d}'),
|
||||
minWidth: 110
|
||||
},
|
||||
{
|
||||
prop: 'readingQuantity',
|
||||
@@ -76,12 +79,13 @@ const tableProps = [
|
||||
{
|
||||
prop: 'recordTimeLast',
|
||||
label: '上期抄表日期',
|
||||
filter: parseTime,
|
||||
minWidth: 160
|
||||
filter: parseTimeTable('{y}-{m}-{d}'),
|
||||
minWidth: 110
|
||||
},
|
||||
{
|
||||
prop: 'readingQuantityLast',
|
||||
label: '上期抄表值'
|
||||
label: '上期抄表值',
|
||||
minWidth: 110
|
||||
},
|
||||
{
|
||||
prop: 'diff',
|
||||
@@ -191,42 +195,15 @@ export default {
|
||||
window.addEventListener('resize', () => {
|
||||
this.tableH = this.tableHeight(260)
|
||||
})
|
||||
if (location.href.indexOf('?') > 0) {
|
||||
let arr = location.href.split('?')[1].split('&')
|
||||
this.formConfig[1].defaultSelect = [arr[0].split('=')[1], arr[1].split('=')[1]]
|
||||
this.queryParams.recordTime[0] = arr[0].split('=')[1]
|
||||
this.queryParams.recordTime[1] = arr[1].split('=')[1]
|
||||
} else {
|
||||
let end = moment(moment().format('YYYY-MM-DD 23:59:59')).valueOf()
|
||||
let start = moment(moment().subtract(7, 'days').format('YYYY-MM-DD 00:00:00')).valueOf()
|
||||
this.formConfig[1].defaultSelect = [start, end]
|
||||
this.queryParams.recordTime[0] = start
|
||||
this.queryParams.recordTime[1] = end
|
||||
}
|
||||
let end = moment(moment().format('YYYY-MM-DD 23:59:59')).valueOf()
|
||||
let start = moment(moment().subtract(7, 'days').format('YYYY-MM-DD 00:00:00')).valueOf()
|
||||
this.formConfig[1].defaultSelect = [start, end]
|
||||
this.queryParams.recordTime[0] = start
|
||||
this.queryParams.recordTime[1] = end
|
||||
this.getList();
|
||||
this.getTypeList()
|
||||
},
|
||||
watch: {
|
||||
$route: 'initData'
|
||||
},
|
||||
methods: {
|
||||
initData(to) {
|
||||
if (to.name === 'EnergyQuantityManual') {
|
||||
if (location.href.indexOf('?') > 0) {
|
||||
let arr = location.href.split('?')[1].split('&')
|
||||
this.formConfig[1].defaultSelect = [arr[0].split('=')[1], arr[1].split('=')[1]]
|
||||
this.queryParams.recordTime[0] = arr[0].split('=')[1]
|
||||
this.queryParams.recordTime[1] = arr[1].split('=')[1]
|
||||
} else {
|
||||
let end = moment(moment().format('YYYY-MM-DD 23:59:59')).valueOf()
|
||||
let start = moment(moment().subtract(7, 'days').format('YYYY-MM-DD 00:00:00')).valueOf()
|
||||
this.formConfig[1].defaultSelect = [start, end]
|
||||
this.queryParams.recordTime[0] = start
|
||||
this.queryParams.recordTime[1] = end
|
||||
}
|
||||
this.getList()
|
||||
}
|
||||
},
|
||||
buttonClick(val) {
|
||||
this.queryParams.pageNo = 1;
|
||||
this.queryParams.energyTypeId = val.energyTypeId
|
||||
@@ -293,7 +270,7 @@ export default {
|
||||
this.centervisible = true
|
||||
let paramB = {}
|
||||
paramB.type = 'meterReading'
|
||||
paramB.energyType = val.data.energyType
|
||||
paramB.energyTypeId = val.data.energyTypeId
|
||||
paramB.tableName = val.data.tableName
|
||||
this.$nextTick(() => {
|
||||
this.$refs.energyQuantityManualAdd.init(paramB)
|
||||
|
||||
@@ -80,7 +80,6 @@ export default {
|
||||
let id = data.id
|
||||
getEnergyType(id).then((res) => {
|
||||
if (res.code === 0) {
|
||||
console.log(res)
|
||||
if (res.data.pricingMethod === 0) {
|
||||
this.tableProps = this.temp1
|
||||
this.singlePrice = ''
|
||||
|
||||
@@ -22,7 +22,6 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
changeInput() {
|
||||
console.log(this.list)
|
||||
this.$emit('emitData', this.list)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,7 +28,6 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
changeInput() {
|
||||
console.log(this.list)
|
||||
this.$emit('emitData', this.list)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -221,10 +221,10 @@ export default {
|
||||
// 增加
|
||||
emitButtonClick1() {
|
||||
let n = this.tableData1.length
|
||||
if (n >=3) {
|
||||
this.$modal.msgWarning('最多可添加3档计价')
|
||||
return false
|
||||
}
|
||||
// if (n >=3) {
|
||||
// this.$modal.msgWarning('最多可添加3档计价')
|
||||
// return false
|
||||
// }
|
||||
let obj = {}
|
||||
obj.startTime = n === 0 ? '' : this.tableData1[n-1].endTime
|
||||
obj.endTime = ''
|
||||
|
||||
@@ -43,6 +43,7 @@
|
||||
import { getEnergyOverlimitLogPage } from "@/api/monitoring/energyOverlimitLog";
|
||||
import { getEnergyTypeListAll } from "@/api/base/energyType";
|
||||
import { publicFormatter } from '@/utils/dict'
|
||||
import { parseTime } from '@/utils/ruoyi'
|
||||
const tableProps = [
|
||||
{
|
||||
prop: 'objName',
|
||||
|
||||
Reference in New Issue
Block a user