Procházet zdrojové kódy

处理用户管理银行卡改为点击时触发

hxl13994548489 před 1 rokem
rodič
revize
2ccc652176
2 změnil soubory, kde provedl 44 přidání a 2 odebrání
  1. 10 1
      src/http/moudules/dept.js
  2. 34 1
      src/views/Core/KtCommonTable.vue

+ 10 - 1
src/http/moudules/dept.js

@@ -394,4 +394,13 @@ export const saveLeadId = (data) => {
         method: 'post',
         data
     })
-}
+}
+
+
+// 查询用户下的银行卡信息
+export const queryCardListByUserId = (userId) => {
+  return axios({
+    url: '/sysUserAccount/queryCardListByUserId?userId='+userId,
+    method: 'get',
+  })
+}

+ 34 - 1
src/views/Core/KtCommonTable.vue

@@ -45,6 +45,7 @@
       >
         <template slot-scope="scope">
           <el-table
+            v-if="scope.row.sysUserAccountCardList.length>0"
             :data="scope.row.sysUserAccountCardList"
             size="small"
             :header-cell-style="{
@@ -855,10 +856,42 @@ export default {
     },
   },
   methods: {
+    //获取银行卡信息
+    getSysUserAccountCardList(row) {
+      if (typeof row.expanded === "undefined"){
+        row.expanded = true;
+      }
+      if(row.expanded){
+        if (this.expandRows.includes(row.id)) {
+          this.expandRows= this.expandRows.filter(item => item !== row.id);
+        } else {
+          this.expandRows.push(row.id);
+        }
+      }else{
+        this.expandRows= this.expandRows.filter(item => item !== row.id);
+      }
+      row.expanded = !row.expanded;
+      if (row.sysUserAccountCardList.length===0){
+        this.$api.dept.queryCardListByUserId(row.userId).then((res) => {
+          if (res.code == 200) {
+            if(res.data) {
+              row.sysUserAccountCardList=res.data;
+              this.$set(this.data.content,row.index,row)
+            }
+          }
+        });
+      }
+      //this.$refs.doLayout.toggleRowExpansion(row, row.expanded);
+    },
     // 点击展开行
     handleExpandChange(row,rows) {
+      if(this.showSysUserAccountCardList){
+        this.getSysUserAccountCardList(row)
+      }
       if(rows.length>0) {
-        this.underwritingRulesHistoryDetails(row)
+         if(this.agreementUnderwritingRuleShow){
+           this.underwritingRulesHistoryDetails(row)
+         }
       }
     },
     getDicType(type) {