作者 shenhailong

公寓 查询

@@ -41,7 +41,7 @@ @@ -41,7 +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 v-if="scope.row.type=='3'" disabled type="primary" size="small" @click="handleAdd(scope.row)">新增</el-button> 42 <el-button v-if="scope.row.type=='3'" disabled type="primary" size="small" @click="handleAdd(scope.row)">新增</el-button>
43 <el-button v-else type="primary" size="small" @click="handleAdd(scope.row)">新增</el-button> 43 <el-button v-else type="primary" size="small" @click="handleAdd(scope.row)">新增</el-button>
44 - 44 + <el-button size="mini" type="primary" @click="handleEdit(scope.$index, scope.row)">编辑</el-button>
45 <el-button size="mini" type="danger" @click="handleDel(scope.row)">删除</el-button> 45 <el-button size="mini" type="danger" @click="handleDel(scope.row)">删除</el-button>
46 46
47 <!--<el-button v-if="scope.row.type=='3'" type="primary" size="small" @click="pay(scope.row)">缴费</el-button>--> 47 <!--<el-button v-if="scope.row.type=='3'" type="primary" size="small" @click="pay(scope.row)">缴费</el-button>-->
@@ -265,6 +265,22 @@ @@ -265,6 +265,22 @@
265 </div> 265 </div>
266 </el-dialog> 266 </el-dialog>
267 267
  268 + <!--location编辑界面-->
  269 + <el-dialog title="编辑" :visible.sync="editFormLocationVisible" :close-on-click-modal="false">
  270 + <el-form :model="editLocationForm" label-width="80px" :rules="editLocationFormRules" ref="editLocationForm">
  271 +
  272 + <el-input type="hidden" v-model="editLocationForm.id"></el-input>
  273 +
  274 + <el-form-item label="公寓名称" prop="adrName">
  275 + <el-input v-model="editLocationForm.adrname" auto-complete="off" placeholder="请输入名称"></el-input>
  276 + </el-form-item>
  277 + </el-form>
  278 + <div slot="footer" class="dialog-footer">
  279 + <el-button @click.native="editFormLocationVisible = false">取消</el-button>
  280 + <el-button type="primary" @click.native="editLocationAdrName" :loading="addLoading">提交</el-button>
  281 + </div>
  282 + </el-dialog>
  283 +
268 </section> 284 </section>
269 </template> 285 </template>
270 <style> 286 <style>
@@ -281,14 +297,16 @@ @@ -281,14 +297,16 @@
281 } 297 }
282 </style> 298 </style>
283 <script> 299 <script>
284 - import { getList,add, remove} from '@/api/empt/location_api'; 300 + import { getList,add, remove, edit as editLocation} from '@/api/empt/location_api';
285 import {add as electicity, getEEModel, edit} from '@/api/empt/electricityParams'; 301 import {add as electicity, getEEModel, edit} from '@/api/empt/electricityParams';
286 import {findRealTime } from '@/api/empt/waterMeter'; 302 import {findRealTime } from '@/api/empt/waterMeter';
287 import moment from 'moment' 303 import moment from 'moment'
288 import parseTime from '@/utils' 304 import parseTime from '@/utils'
289 import loginUserInfo from '@/api/base' 305 import loginUserInfo from '@/api/base'
  306 + import ElInput from "../../../node_modules/element-ui/packages/input/src/input.vue";
290 307
291 export default { 308 export default {
  309 + components: {ElInput},
292 data() { 310 data() {
293 return { 311 return {
294 filters: { 312 filters: {
@@ -309,12 +327,21 @@ @@ -309,12 +327,21 @@
309 waterMeterVisible:false, 327 waterMeterVisible:false,
310 328
311 addFormLocationVisible: false, 329 addFormLocationVisible: false,
  330 +
  331 + editFormLocationVisible: false,
  332 +
312 addLocationFormRules:{ 333 addLocationFormRules:{
313 adrName: [ 334 adrName: [
314 {required: true, message: '请输入公寓名称', trigger: 'blur'} 335 {required: true, message: '请输入公寓名称', trigger: 'blur'}
315 ] 336 ]
316 }, 337 },
317 338
  339 + editLocationFormRules:{
  340 + adrName: [
  341 + {required: false, message: '请输入公寓名称', trigger: 'blur'}
  342 + ]
  343 + },
  344 +
318 editLoading: false, 345 editLoading: false,
319 editFormRules: { 346 editFormRules: {
320 roleName: [ 347 roleName: [
@@ -395,6 +422,12 @@ @@ -395,6 +422,12 @@
395 parent: '', 422 parent: '',
396 type:'' 423 type:''
397 }, 424 },
  425 + // 公寓编辑
  426 + editLocationForm:{
  427 + adrname: '',
  428 + parent: '',
  429 + type:''
  430 + },
398 centerDialogVisible: false, 431 centerDialogVisible: false,
399 dialogData:{ 432 dialogData:{
400 process:{ 433 process:{
@@ -496,7 +529,7 @@ @@ -496,7 +529,7 @@
496 let para = { 529 let para = {
497 pageNum: this.pageNum, 530 pageNum: this.pageNum,
498 pageSize: this.pageSize, 531 pageSize: this.pageSize,
499 - processName: this.processName 532 + processName: this.filters.processName
500 }; 533 };
501 this.listLoading = true; 534 this.listLoading = true;
502 //NProgress.start(); 535 //NProgress.start();
@@ -616,7 +649,48 @@ @@ -616,7 +649,48 @@
616 }); 649 });
617 }, 650 },
618 651
619 - // 楼层新增 652 + // 楼层编辑
  653 + /**
  654 + * 显示编辑界面
  655 + * @param index
  656 + * @param row 为这行的数据对象
  657 + */
  658 + handleEdit: function (index, row) {
  659 + this.editFormLocationVisible = true;
  660 + this.editLocationForm = row;
  661 + },
  662 +
  663 +
  664 + //编辑
  665 + editLocationAdrName: function () {
  666 + this.$refs.editLocationForm.validate((valid) => {
  667 + if (valid) {
  668 + this.$confirm('确认提交吗?', '提示', {}).then(() => {
  669 + this.addLoading = true;
  670 + let para = Object.assign({}, this.editLocationForm);
  671 + this.addLoading = false;
  672 + editLocation(para).then((res) => {
  673 + if(res.data.code == 200){
  674 + //NProgress.done();
  675 + this.$message({
  676 + message: '提交成功',
  677 + type: 'success'
  678 + });
  679 + this.$refs['editLocationForm'].resetFields();
  680 + this.editFormLocationVisible = false;
  681 + this.getList();
  682 + }else {
  683 + this.$message({
  684 + message: '编辑失败',
  685 + type: 'error'
  686 + });
  687 + }
  688 +
  689 + }).catch(error => alert(error));
  690 + });
  691 + }
  692 + });
  693 + },
620 694
621 //电表参数配置新增界面,每次点开初始化数据 695 //电表参数配置新增界面,每次点开初始化数据
622 electrixityMeterConfiguration: function (row) { 696 electrixityMeterConfiguration: function (row) {