作者 shenhailong

电表参数配置按钮 页面

@@ -41,6 +41,7 @@ @@ -41,6 +41,7 @@
41 <el-button type="primary" size="small" @click="handleUpdate(scope.row)">快速编辑</el-button> 41 <el-button type="primary" size="small" @click="handleUpdate(scope.row)">快速编辑</el-button>
42 <el-button type="primary" size="small" @click="handleUpdate(scope.row)">新增</el-button> 42 <el-button type="primary" size="small" @click="handleUpdate(scope.row)">新增</el-button>
43 <el-button size="mini" type="danger" @click="handleModifyStatus(scope.row,'deleted')">{{ $t('table.delete') }}</el-button> 43 <el-button size="mini" type="danger" @click="handleModifyStatus(scope.row,'deleted')">{{ $t('table.delete') }}</el-button>
  44 + <el-button type="primary" size="small" @click="electrixityMeterConfiguration(scope.row)">电表参数配置</el-button>
44 </template> 45 </template>
45 </el-table-column> 46 </el-table-column>
46 </el-table> 47 </el-table>
@@ -51,6 +52,78 @@ @@ -51,6 +52,78 @@
51 <el-pagination layout="prev, pager, next" @current-change="handleCurrentChange" :page-size="5" :total="total" style="float:right;"> 52 <el-pagination layout="prev, pager, next" @current-change="handleCurrentChange" :page-size="5" :total="total" style="float:right;">
52 </el-pagination> 53 </el-pagination>
53 </el-col> 54 </el-col>
  55 +
  56 + <!--水表新增-->
  57 + <el-dialog title="电表参数配置新增" :visible.sync="electrixityAddFormVisible" :close-on-click-modal="false">
  58 + <el-form :model="electrixityAddForm" label-width="110px" :rules="addFormRules" ref="electrixityAddForm">
  59 + <el-form-item label="水电预付费" prop="prepaid">
  60 + <el-switch
  61 + v-model="electrixityAddForm.prepaid"
  62 + active-color="#00A854"
  63 + active-text="是"
  64 + active-value="0"
  65 + inactive-color="#F04134"
  66 + inactive-text="否"
  67 + inactive-value="1">
  68 + </el-switch>
  69 + </el-form-item>
  70 + <el-form-item label="电警告跳闸" prop="warningtrip">
  71 + <el-switch
  72 + v-model="electrixityAddForm.warningtrip"
  73 + active-color="#00A854"
  74 + active-text="是"
  75 + active-value="0"
  76 + inactive-color="#F04134"
  77 + inactive-text="否"
  78 + inactive-value="1">
  79 + </el-switch>
  80 + &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span>告警阀值</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<el-input v-model="electrixityAddForm.warningthreshold" style="width: 100px;" auto-complete="off"></el-input>&nbsp;&nbsp;&nbsp;<span>元</span>
  81 + </el-form-item>
  82 + <el-form-item label="透支使能" prop="overdraft">
  83 + <el-switch
  84 + v-model="electrixityAddForm.overdraft"
  85 + active-color="#00A854"
  86 + active-text="是"
  87 + active-value="0"
  88 + inactive-color="#F04134"
  89 + inactive-text="否"
  90 + inactive-value="1">
  91 + </el-switch>
  92 + &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span>可透支额度</span>&nbsp;&nbsp;<el-input v-model="electrixityAddForm.overdraftthreshold" style="width: 100px;" auto-complete="off"></el-input>&nbsp;&nbsp;&nbsp;<span>元</span>
  93 + </el-form-item>
  94 + <el-form-item label="过负荷跳闸使能" prop="overdraft">
  95 + <el-switch
  96 + v-model="electrixityAddForm.load"
  97 + active-color="#00A854"
  98 + active-text="是"
  99 + active-value="0"
  100 + inactive-color="#F04134"
  101 + inactive-text="否"
  102 + inactive-value="1">
  103 + </el-switch>
  104 + &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span>功率</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<el-input v-model="electrixityAddForm.power" style="width: 100px;" auto-complete="off"></el-input>&nbsp;&nbsp;&nbsp;<span>KW</span>
  105 + <br/>
  106 + <br/>
  107 + &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span>功率因数</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<el-input v-model="electrixityAddForm.powerfactor" style="width: 100px;" auto-complete="off"></el-input>
  108 + </el-form-item>
  109 + <el-form-item label="免费电度使能" prop="overdraft">
  110 + <el-switch
  111 + v-model="electrixityAddForm.free"
  112 + active-color="#00A854"
  113 + active-text="是"
  114 + active-value="0"
  115 + inactive-color="#F04134"
  116 + inactive-text="否"
  117 + inactive-value="1">
  118 + </el-switch>
  119 + &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span>免费电度</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<el-input v-model="electrixityAddForm.overdraftthreshold" style="width: 100px;" auto-complete="off"></el-input>&nbsp;&nbsp;&nbsp;<span>度</span>
  120 + </el-form-item>
  121 + </el-form>
  122 + <div slot="footer" class="dialog-footer">
  123 + <el-button @click.native="electrixityAddFormVisible = false">取消</el-button>
  124 + <el-button type="primary" @click.native="addSubmit" :loading="addLoading">提交</el-button>
  125 + </div>
  126 + </el-dialog>
54 </section> 127 </section>
55 </template> 128 </template>
56 <style> 129 <style>
@@ -79,6 +152,9 @@ @@ -79,6 +152,9 @@
79 processName: '', 152 processName: '',
80 parseTime: parseTime 153 parseTime: parseTime
81 }, 154 },
  155 + userId: '',
  156 + realName: '',
  157 + wmId:'',
82 locationList:[], 158 locationList:[],
83 total: 0, 159 total: 0,
84 pageNum: 1, 160 pageNum: 1,
@@ -103,7 +179,7 @@ @@ -103,7 +179,7 @@
103 }, 179 },
104 //用户ID 180 //用户ID
105 //新增界面是否显示 181 //新增界面是否显示
106 - addFormVisible: false, 182 + electrixityAddFormVisible: false,
107 //设置权限界面是否显示 183 //设置权限界面是否显示
108 addLoading: false, 184 addLoading: false,
109 addFormRules: { 185 addFormRules: {
@@ -114,14 +190,18 @@ @@ -114,14 +190,18 @@
114 { required: true, message: '请输入岗位/角色描述', trigger: 'blur' } 190 { required: true, message: '请输入岗位/角色描述', trigger: 'blur' }
115 ] 191 ]
116 }, 192 },
117 - //新增界面数据  
118 - addForm: {  
119 - processname: '',  
120 - begindate: '',  
121 - enddate: '',  
122 - vacationtype:'',  
123 - reason: '',  
124 - userId: '' 193 + //水表参数配置、界面数据
  194 + electrixityAddForm: {
  195 + prepaid: '',
  196 + warningtrip: '',
  197 + warningthreshold: '',
  198 + overdraft:'',
  199 + overdraftthreshold: '',
  200 + load: '',
  201 + power: '',
  202 + powerfactor: '',
  203 + freeelectricitylimit: '',
  204 + eeId: ''
125 }, 205 },
126 permForm: { 206 permForm: {
127 roleId: 1, 207 roleId: 1,
@@ -278,18 +358,48 @@ @@ -278,18 +358,48 @@
278 this.editForm = Object.assign({}, row); 358 this.editForm = Object.assign({}, row);
279 this.getdepartmentNames(); 359 this.getdepartmentNames();
280 }, 360 },
281 - //显示新增界面,每次点开初始化数据  
282 - handleAdd: function () {  
283 - this.addFormVisible = true;  
284 - this.addForm = {  
285 - processname: '',  
286 - begindate: '',  
287 - enddate: '',  
288 - vacationtype:'',  
289 - reason: '',  
290 - userid: loginUserInfo.userId 361 + //水表参数配置新增界面,每次点开初始化数据
  362 + electrixityMeterConfiguration: function (row) {
  363 + this.electrixityAddFormVisible = true;
  364 + this.electrixityAddForm = {
  365 + prepaid: '',
  366 + warningtrip: '',
  367 + warningthreshold: '',
  368 + overdraft:'',
  369 + overdraftthreshold: '',
  370 + load: '',
  371 + water: '',
  372 + free: '',
  373 + freeWater: '',
  374 + eeId: row.eeId
291 } 375 }
292 }, 376 },
  377 +
  378 + //新增
  379 + addSubmit: function () {
  380 + this.$refs.electrixityAddForm.validate((valid) => {
  381 + if (valid) {
  382 + this.$confirm('确认提交吗?', '提示', {}).then(() => {
  383 + this.addLoading = true;
  384 + //NProgress.start();
  385 + let para = Object.assign({}, this.electrixityAddForm);
  386 + add(para).then((res) => {
  387 + this.addLoading = false;
  388 + if (res.status ===200) {
  389 + this.$message({
  390 + message: '提交成功',
  391 + type: 'success'
  392 + });
  393 + this.$refs['permForm'].resetFields();
  394 + this.electrixityAddFormVisible = false;
  395 + this.getList();
  396 + }
  397 + }).catch(error => alert(error));
  398 + });
  399 + }
  400 + });
  401 + },
  402 +
293 //编辑 403 //编辑
294 editSubmit: function () { 404 editSubmit: function () {
295 this.$refs.editForm.validate((valid) => { 405 this.$refs.editForm.validate((valid) => {
@@ -326,30 +436,6 @@ @@ -326,30 +436,6 @@
326 } 436 }
327 }); 437 });
328 }, 438 },
329 - //新增  
330 - addSubmit: function () {  
331 - this.$refs.addForm.validate((valid) => {  
332 - if (valid) {  
333 - this.$confirm('确认提交吗?', '提示', {}).then(() => {  
334 - this.addLoading = true;  
335 - //NProgress.start();  
336 - let para = Object.assign({}, this.addForm);  
337 - add(para).then((res) => {  
338 - this.addLoading = false;  
339 - if (res.status ===200) {  
340 - this.$message({  
341 - message: '提交成功',  
342 - type: 'success'  
343 - });  
344 - this.$refs['permForm'].resetFields();  
345 - this.addFormVisible = false;  
346 - this.getProcessList();  
347 - }  
348 - }).catch(error => alert(error));  
349 - });  
350 - }  
351 - });  
352 - },  
353 selsChange: function (sels) { 439 selsChange: function (sels) {
354 this.sels = sels; 440 this.sels = sels;
355 }, 441 },
@@ -387,9 +473,11 @@ @@ -387,9 +473,11 @@
387 }, 473 },
388 handleSelectionChange(val) { 474 handleSelectionChange(val) {
389 this.multipleSelection = val 475 this.multipleSelection = val
390 - } 476 + },
391 }, 477 },
392 mounted() { 478 mounted() {
  479 + this.userId = loginUserInfo.userId;
  480 + this.realName = loginUserInfo.realname;
393 this.getList(); 481 this.getList();
394 } 482 }
395 } 483 }