|
@@ -44,6 +44,8 @@
|
|
<span>{{ getColCycleName(scope.row.colCycle) }}</span>
|
|
<span>{{ getColCycleName(scope.row.colCycle) }}</span>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
|
+ <el-table-column label="上次抄表日期" align="center" prop="lastTime" />
|
|
|
|
+ <el-table-column label="上次抄表示数" align="center" prop="lastReading" />
|
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
<el-button size="mini" type="text" icon="el-icon-info" @click="handleRecord(scope.row)">
|
|
<el-button size="mini" type="text" icon="el-icon-info" @click="handleRecord(scope.row)">
|
|
@@ -113,14 +115,8 @@
|
|
<el-table-column label="抄表日期" align="center" prop="meterTime" />
|
|
<el-table-column label="抄表日期" align="center" prop="meterTime" />
|
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
- <el-button
|
|
|
|
- type="success"
|
|
|
|
- plain
|
|
|
|
- icon="el-icon-edit"
|
|
|
|
- size="mini"
|
|
|
|
- :disabled= "!canEdit(scope.row.meterMonth)"
|
|
|
|
- @click="updateRecord(scope.row)"
|
|
|
|
- >修改</el-button>
|
|
|
|
|
|
+ <el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="!canEdit(scope.row.meterMonth)"
|
|
|
|
+ @click="updateRecord(scope.row)">修改</el-button>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
</el-table>
|
|
</el-table>
|
|
@@ -223,9 +219,23 @@ export default {
|
|
getList() {
|
|
getList() {
|
|
this.loading = true
|
|
this.loading = true
|
|
listDevice(this.queryParams).then(response => {
|
|
listDevice(this.queryParams).then(response => {
|
|
- this.deviceList = response.rows
|
|
|
|
|
|
+ this.deviceList = response.rows.map(item=>({
|
|
|
|
+ ...item,
|
|
|
|
+ meterMonth:'',
|
|
|
|
+ lastTime:'',
|
|
|
|
+ lastReading:'',
|
|
|
|
+ }))
|
|
this.total = response.total
|
|
this.total = response.total
|
|
this.loading = false
|
|
this.loading = false
|
|
|
|
+ this.deviceList.forEach(async item => {
|
|
|
|
+ await getLastRecord(item.areaCode, item.deviceCode).then(({ data }) => {
|
|
|
|
+ if (data) {
|
|
|
|
+ item.lastTime = data.meterTime
|
|
|
|
+ item.meterMonth = data.meterMonth
|
|
|
|
+ item.lastReading = data.meterReading
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ })
|
|
})
|
|
})
|
|
},
|
|
},
|
|
/** 搜索按钮操作 */
|
|
/** 搜索按钮操作 */
|
|
@@ -292,7 +302,7 @@ export default {
|
|
handleViewRec(row) {
|
|
handleViewRec(row) {
|
|
this.recListForm = this.$options.data().recListForm
|
|
this.recListForm = this.$options.data().recListForm
|
|
this.resetForm('recListForm')
|
|
this.resetForm('recListForm')
|
|
- this.title = "(" + this.getObjTypeName(row.objType) + ")"+ row.objName
|
|
|
|
|
|
+ this.title = '(' + this.getObjTypeName(row.objType) + ')' + row.objName
|
|
this.curRow = row
|
|
this.curRow = row
|
|
this.recListForm.year = dateFormat(new Date(), 'yyyy')
|
|
this.recListForm.year = dateFormat(new Date(), 'yyyy')
|
|
this.recListForm.deviceCode = row.deviceCode
|
|
this.recListForm.deviceCode = row.deviceCode
|
|
@@ -305,7 +315,7 @@ export default {
|
|
areaCode,
|
|
areaCode,
|
|
deviceCode,
|
|
deviceCode,
|
|
year: this.recListForm.year,
|
|
year: this.recListForm.year,
|
|
- orderFlag:'desc'
|
|
|
|
|
|
+ orderFlag: 'desc'
|
|
}).then(response => {
|
|
}).then(response => {
|
|
this.recListForm.recList = response.data || []
|
|
this.recListForm.recList = response.data || []
|
|
})
|
|
})
|
|
@@ -313,31 +323,33 @@ export default {
|
|
async handleRecord(row) {
|
|
async handleRecord(row) {
|
|
this.fillForm = this.$options.data().fillForm
|
|
this.fillForm = this.$options.data().fillForm
|
|
this.resetForm('fillForm')
|
|
this.resetForm('fillForm')
|
|
- this.fillTitle = "(" + this.getObjTypeName(row.objType) + ")"+ row.objName
|
|
|
|
|
|
+ this.fillTitle = '(' + this.getObjTypeName(row.objType) + ')' + row.objName
|
|
this.fillForm.deviceCode = row.deviceCode
|
|
this.fillForm.deviceCode = row.deviceCode
|
|
this.fillForm.areaCode = row.areaCode
|
|
this.fillForm.areaCode = row.areaCode
|
|
this.fillForm.magnification = row.magnification
|
|
this.fillForm.magnification = row.magnification
|
|
|
|
+ this.fillForm.lastTime = row.lastTime
|
|
|
|
+ this.fillForm.lastReading = row.lastReading
|
|
this.ifAdd = true
|
|
this.ifAdd = true
|
|
- let existFlag = false
|
|
|
|
- // 获取上次填报记录
|
|
|
|
- await getLastRecord(row.areaCode, row.deviceCode).then(({ data }) => {
|
|
|
|
- if (data) {
|
|
|
|
- if (data.meterMonth === this.currentMonth) {
|
|
|
|
- existFlag = true
|
|
|
|
- } else {
|
|
|
|
- this.fillForm.lastTime = data.meterTime
|
|
|
|
- this.fillForm.lastReading = data.meterReading
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- if (!existFlag) {
|
|
|
|
|
|
+ // let existFlag = false
|
|
|
|
+ // // 获取上次填报记录
|
|
|
|
+ // await getLastRecord(row.areaCode, row.deviceCode).then(({ data }) => {
|
|
|
|
+ // if (data) {
|
|
|
|
+ // if (data.meterMonth === this.currentMonth) {
|
|
|
|
+ // existFlag = true
|
|
|
|
+ // } else {
|
|
|
|
+ // this.fillForm.lastTime = data.meterTime
|
|
|
|
+ // this.fillForm.lastReading = data.meterReading
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
+ // })
|
|
|
|
+ // if (row.meterMonth===this.currentMonth) {
|
|
|
|
+ // this.$modal.msgError('当前月份已填报')
|
|
|
|
+ // } else {
|
|
this.fillFormOpen = true
|
|
this.fillFormOpen = true
|
|
- } else {
|
|
|
|
- this.$modal.msgError('当前月份已填报')
|
|
|
|
- }
|
|
|
|
|
|
+ // }
|
|
},
|
|
},
|
|
canEdit(meterMonth) {
|
|
canEdit(meterMonth) {
|
|
- return meterMonth === this.currentMonth;
|
|
|
|
|
|
+ return meterMonth === this.currentMonth
|
|
},
|
|
},
|
|
updateRecord(row) {
|
|
updateRecord(row) {
|
|
this.ifAdd = false
|
|
this.ifAdd = false
|