Browse Source

Merge branch 'master' of http://192.168.2.241:3000/hdc/java-collect-fees-front

shudong 1 year ago
parent
commit
10dc61bfac
1 changed files with 41 additions and 39 deletions
  1. 41 39
      src/views/mis/customerManagement/customer-index.vue

+ 41 - 39
src/views/mis/customerManagement/customer-index.vue

@@ -52,7 +52,7 @@
                     :multiple="false" :fixed="true" :isdelete="false" :is-select="false" :stripe="true"
                     @handleCurrentChange="handleCurrentChange" @handleSizeChange="handleSizeChange"
                     @handleSelectionChange="handleSelectionChange" @rowDblclick="showDetail" @detail="showDetail"
-                    @sortChange="onCustomerSortChange" />
+                    @sortChange="onCustomerSortChange" @rowClick="handleRowClick" />
             </el-main>
         </el-container>
         <!-- 详情页 -->
@@ -357,8 +357,8 @@ export default {
         }
     },
     watch: {
-        selectionsData(value) {
-            this.disabledModify = this.selectionsData.length !== 1;
+        selectedRow(value) {
+            this.disabledModify = value == null;
             this.disabledDelete = this.selectionsData.length == 0;
         },
         dialogVisible(newVal, oldVal) {
@@ -391,6 +391,7 @@ export default {
             }
 
             this.dataList = []
+            this.selectedRow = null;
             Customer.query(params).then((res) => {
                 if (res.code !== 1) {
                     this.$message.error('查询失败!')
@@ -557,47 +558,45 @@ export default {
          * @description 修改
          */
         clickModify() {
-            if (this.selectionsData.length > 0) {
-                this.selectedRow = this.selectionsData[0];
-                if (this.selectedRow.customerState == '作废用户') {
-                    this.$message({
-                        message: '作废用户不能修改!',
-                        type: 'warning'
-                    });
-                    return;
-                }
+            //this.selectedRow = this.selectionsData[0];
+            if (this.selectedRow.customerState == '作废用户') {
+                this.$message({
+                    message: '作废用户不能修改!',
+                    type: 'warning'
+                });
+                return;
+            }
 
-                var cbkhList = this.selectedRow.cbkhList.split(',')
-                if (cbkhList.length == 1) {
-                    //查询用户
-                    Customer.queryCustomer(this.selectedRow.customerNo).then((res) => {
-                        if (res.code == 1) {
-                            this.detailData.daCustomer = res.result
-                            this.detailData.daCustomer.mrArea = this.detailData.daCustomer.mrArea.toString();
-                            this.detailData.daCustomer.mrBook = this.detailData.daCustomer.mrBook.toString();
+            var cbkhList = this.selectedRow.cbkhList.split(',')
+            if (cbkhList.length == 1) {
+                //查询用户
+                Customer.queryCustomer(this.selectedRow.customerNo).then((res) => {
+                    if (res.code == 1) {
+                        this.detailData.daCustomer = res.result
+                        this.detailData.daCustomer.mrArea = this.detailData.daCustomer.mrArea.toString();
+                        this.detailData.daCustomer.mrBook = this.detailData.daCustomer.mrBook.toString();
 
-                            //查询表具
-                            Customer.queryMeter(this.selectedRow.customerNo, this.selectedRow.customerNo + cbkhList[0]).then((res) => {
-                                if (res.code == 1) {
-                                    this.detailData.daMeter = res.result
+                        //查询表具
+                        Customer.queryMeter(this.selectedRow.customerNo, this.selectedRow.customerNo + cbkhList[0]).then((res) => {
+                            if (res.code == 1) {
+                                this.detailData.daMeter = res.result
 
-                                    this.operationType = 'saveUpdate';
-                                    this.dialogTitle = "修改";
-                                    this.editState = false;
-                                    this.dialogVisible = true;// 显示弹窗
-                                }
+                                this.operationType = 'saveUpdate';
+                                this.dialogTitle = "修改";
+                                this.editState = false;
+                                this.dialogVisible = true;// 显示弹窗
+                            }
 
-                            }).catch((ex) => {
-                                this.$message.error("查询表具信息失败!");
-                            });
-                        }
+                        }).catch((ex) => {
+                            this.$message.error("查询表具信息失败!");
+                        });
+                    }
 
-                    }).catch((ex) => {
-                        this.$message.error("查询用户信息失败!");
-                    });
-                } else if (cbkhList.length > 1) {
-                    this.$message('该用户存在多表,请在“水表档案管理”中进行修改。');
-                }
+                }).catch((ex) => {
+                    this.$message.error("查询用户信息失败!");
+                });
+            } else if (cbkhList.length > 1) {
+                this.$message('该用户存在多表,请在“水表档案管理”中进行修改。');
             }
         },
         /**
@@ -655,6 +654,9 @@ export default {
             this.pageInfo['orders[0].column'] = arrOrder[1];
             this.bindList();
         },
+        handleRowClick(row) {
+            this.selectedRow = row
+        },
 
         /* ----- 高级搜索 ----- */
         advancedQuery(e) {