|
@@ -56,15 +56,18 @@
|
|
|
@pagination="getList" />
|
|
|
<el-dialog :title="fillTitle" :visible.sync="fillFormOpen" width="500px" append-to-body>
|
|
|
<el-form ref="fillForm" :model="fillForm" label-width="150px">
|
|
|
+ <el-form-item label="设备编码">
|
|
|
+ <el-input disabled :value="fillForm.deviceCode" />
|
|
|
+ </el-form-item>
|
|
|
<el-form-item label="上次抄表日期">
|
|
|
<el-input disabled :value="fillForm.lastTime" />
|
|
|
</el-form-item>
|
|
|
<el-form-item label="上次抄表示数">
|
|
|
<el-input disabled :value="fillForm.lastReading" />
|
|
|
</el-form-item>
|
|
|
-
|
|
|
- <el-form-item label="抄表日期">
|
|
|
- <el-input :value="currentMonth" />
|
|
|
+ <hr>
|
|
|
+ <el-form-item label="本次抄表月份">
|
|
|
+ <el-input disabled :value="currentMonth" />
|
|
|
</el-form-item>
|
|
|
<el-form-item required :rules="[{required:true,message:'请输入本次抄表示数'}]" label="本次抄表示数" prop="meterReading">
|
|
|
<el-input v-model="fillForm.meterReading" oninput="value=value.replace(/[^\d]/g,'')" placeholder="请输入本次抄表示数" />
|
|
@@ -75,8 +78,8 @@
|
|
|
<el-form-item :label="`参考增量(${activeTab==='first'?'度':'吨'})`">
|
|
|
<el-input disabled :value="increase" />
|
|
|
</el-form-item>
|
|
|
-
|
|
|
</el-form>
|
|
|
+
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
<el-button type="primary" @click="submitFillForm">确 定</el-button>
|
|
|
<el-button @click="fillCancel">取 消</el-button>
|
|
@@ -90,18 +93,31 @@
|
|
|
placeholder="选择年份">
|
|
|
</el-date-picker>
|
|
|
</el-form-item>
|
|
|
+ <el-form-item label="计量设备" prop="year">
|
|
|
+ <el-input disabled :value="recListForm.deviceCode" />
|
|
|
+ </el-form-item>
|
|
|
<el-form-item label="抄表历史" prop="recList">
|
|
|
<el-table v-loading="loading" :data="recListForm.recList" max-height="280px">
|
|
|
- <el-table-column label="设备代码" align="center" prop="deviceCode" />
|
|
|
<el-table-column label="年份" align="center" prop="year" />
|
|
|
- <el-table-column label="月份" align="center" prop="meterMonth" />
|
|
|
- <el-table-column label="抄表日期" align="center" prop="meterTime" />
|
|
|
+ <el-table-column label="月份" align="center" prop="meterMonth" >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <!-- 使用 JavaScript 字符串方法截取月份部分 -->
|
|
|
+ {{ scope.row.meterMonth.slice(-2) }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
<el-table-column label="抄表示数" align="center" prop="meterReading" />
|
|
|
<el-table-column label="用量" align="center" prop="increase" />
|
|
|
+ <el-table-column label="抄表日期" align="center" prop="meterTime" />
|
|
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
|
<template slot-scope="scope">
|
|
|
- <el-button size="mini" type="text" v-if="scope.row.meterMonth===currentMonth" @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>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
@@ -166,6 +182,7 @@ export default {
|
|
|
// 电表表单参数
|
|
|
recListForm: {
|
|
|
year: '',
|
|
|
+ deviceCode: '',
|
|
|
recList: []
|
|
|
},
|
|
|
fillTitle: '',
|
|
@@ -272,9 +289,10 @@ export default {
|
|
|
handleViewRec(row) {
|
|
|
this.recListForm = this.$options.data().recListForm
|
|
|
this.resetForm('recListForm')
|
|
|
- this.title = row.objName
|
|
|
+ this.title = "(" + this.getObjTypeName(row.objType) + ")"+ row.objName
|
|
|
this.curRow = row
|
|
|
this.recListForm.year = dateFormat(new Date(), 'yyyy')
|
|
|
+ this.recListForm.deviceCode = row.deviceCode
|
|
|
this.getHistoryList()
|
|
|
this.recListOpen = true
|
|
|
},
|
|
@@ -292,7 +310,7 @@ export default {
|
|
|
async handleRecord(row) {
|
|
|
this.fillForm = this.$options.data().fillForm
|
|
|
this.resetForm('fillForm')
|
|
|
- this.fillTitle = row.objName
|
|
|
+ this.fillTitle = "(" + this.getObjTypeName(row.objType) + ")"+ row.objName
|
|
|
this.fillForm.deviceCode = row.deviceCode
|
|
|
this.fillForm.areaCode = row.areaCode
|
|
|
this.fillForm.magnification = row.magnification
|
|
@@ -315,6 +333,9 @@ export default {
|
|
|
this.$modal.msgError('当前月份已填报')
|
|
|
}
|
|
|
},
|
|
|
+ canEdit(meterMonth) {
|
|
|
+ return meterMonth === this.currentMonth;
|
|
|
+ },
|
|
|
updateRecord(row) {
|
|
|
this.ifAdd = false
|
|
|
this.fillFormOpen = true
|