zhaoxiaoqiang1
2026-01-04 f1d30d03186c79ca2cbcfe60d6d2ce7d73fba97b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
<template>
  <div
    class="loanApprovalApply"
    v-loading.fullscreen.lock="waiting"
    element-loading-background="transparent"
  >
    <el-form
      ref="loanApprovalApply"
      :model="loanApprovalApply"
      inline
      label-width="95px"
      size="small"
    >
      <el-form-item label="客户姓名" prop="customerName">
        <el-input v-model="loanApprovalApply.customerName" placeholder="请输入"></el-input>
      </el-form-item>
      <el-form-item label="证件号码" prop="certId">
        <el-input v-model="loanApprovalApply.certId" placeholder="请输入"></el-input>
      </el-form-item>
      <el-form-item label="产品名称" prop="productIdArray">
        <el-select
          v-model="loanApprovalApply.productIdArray"
          clearable
          multiple
          filterable
          placeholder="请选择"
          collapse-tags
          :title="title"
          @mouseenter.native="mouseEnter(loanApprovalApply.productIdArray,productList,'productCode','productName')"
        >
          <el-option
            v-for="item in productList"
            :key="item.productCode"
            :label="item.productName"
            :value="item.productCode"
          ></el-option>
        </el-select>
      </el-form-item>
     
      <el-form-item label="审批状态" prop="phasenoArray" v-show="isshow">
        <el-select
          v-model="loanApprovalApply.phasenoArray"
          clearable
          multiple
          filterable
          placeholder="请选择"
          collapse-tags
          :title="title"
          @mouseenter.native="mouseEnter(loanApprovalApply.phasenoArray,phasechoiceList,'code','name')"
        >
          <el-option
            v-for="item in qryFlowPhaseList"
            :key="item.code"
            :label="item.taskName"
            :value="item.taskKey"
          ></el-option>
        </el-select>
      </el-form-item>
 
      <el-form-item size="small">
        <el-button style="padding:8px 15px;" plain @click="resetForm('loanApprovalApply')">重置</el-button>
        <el-button style="margin-left: 22px;padding:8px 15px;" type="primary" @click="handleSearch(loanApprovalApply)">搜索</el-button>
        <el-button type="text" v-show="!isshow" @click="show()">
          展开
          <i class="el-icon-arrow-down el-icon--right"></i>
        </el-button>
        <el-button type="text" v-show="isshow" @click="show()">
          收起
          <i class="el-icon-arrow-up el-icon--right"></i>
        </el-button>
      </el-form-item>
    </el-form>
    <div class="table">
      <el-table
        :data="loanApplyFlowList"
        :cell-class-name="cellClass"
        :header-cell-class-name="headerCellClass"
        v-loading="loading"
        highlight-current-row
        stripe
      >
        <el-table-column type="index" width="40" label=" "></el-table-column>
        <el-table-column prop="customerName" label="客户姓名" width="170" />
        <el-table-column prop="phone" label="手机号码" width="170" />
        <el-table-column prop="certId" label="证件号码" width="170" />
        <el-table-column prop="productName" label="产品名称" width="170" />
        <el-table-column prop="shopName" label="门店名称" width="300" />
        <el-table-column prop="marriageDesc" label="婚姻状态" width="170" />
        <el-table-column prop="creditAmt" label="授信额度" width="170" >
          <template slot-scope="scope">
            <span>{{ scope.row.creditAmt?scope.row.creditAmt = formatMoney(scope.row.creditAmt):'--' }}</span>
          </template>
        </el-table-column>
        <el-table-column prop="phasename" label="审批状态" width="170" />
        <el-table-column prop="operationUserName" label="操作人员"  />
 
        <el-table-column label="操作管理" fixed="right" width="130">
          <template slot-scope="scope">
           <div style=" margin: 2px 0">
                 <el-button
                  type="text"
                  @click="detail(scope.row)"
                >详情</el-button>
                 <el-button
                  type="text"
                  v-if="type != '0'"
                  :disabled="!(scope.row.phaseno=='0060' || scope.row.phaseno=='0070' || scope.row.phaseno=='0080')"
                  @click="edit(scope.row)"
                >修改</el-button>
              </div>
          </template>
        </el-table-column>
      </el-table>
      <el-pagination
        background
        @size-change="handleSizeChange"
        @current-change="handleCurrentChange"
        :current-page.sync="currentPage"
        :page-sizes="[10, 20, 50, 100]"
        :page-size="10"
        layout="prev, pager, next, jumper, total, sizes"
        :total="total"
      ></el-pagination>
    </div>
  </div>
</template>
<script>
import "./index.styl";
import {
  qryProdList,
  qryCustomerInfoListnew,
  customerQryFlowPhaseList
} from "@/api/product";
export default {
  data() {
    return {
      isshow: false,
      qryFlowPhaseList:[],
      phasechoiceList:[
        {
          name:'待处理',
          code:'00'
        },
        {
          name:'通过',
          code:'01'
        },
        {
          name:'拒绝',
          code:'02'
        },
        {
          name:'驳回',
          code:'03'
        },
      ],
      loanApprovalApply: {
        currentPage: "1",
        pageSize: "10"
      },
      loanApplyFlowList: [],
      productList: "",
      type:'',
      title: "",
      total: 0,
      currentPage: 1,
      waiting: false,
      loading: false,
      isSwitch: true,
    };
  },
  mounted() {
    var _this = this;
    window.onresize = function() {
      // 定义窗口大小变更通知事件
      _this.clientWidth = window.parent.document.body.clientWidth;
    };
  },
  activated() {
    //获取产品列表
    qryProdList({}).then(res => {
      this.productList = res.result;
    });
    this.customerQryFlowPhaseList()
    //调用查询贷款申请列表方法
    this.getApplyFlowList(this.loanApprovalApply);
  },
  methods: {
    // 获取下拉值
    customerQryFlowPhaseList(){
      customerQryFlowPhaseList({}).then(res=>{
        this.qryFlowPhaseList = res.result
      })
    },
    // 金额格式化
    formatMoney(value) {
      if (value) {
        value =
          parseFloat((value + "").replace(/[^\d\.-]/g, "")).toFixed(2) + "";
        if (value == "NaN") return;
        let l = value
          .split(".")[0]
          .split("")
          .reverse();
        let r = value.split(".")[1];
        let t = "";
        for (let i = 0; i < l.length; i++) {
          t += l[i] + ((i + 1) % 3 === 0 && i + 1 !== l.length ? "," : "");
        }
        return (
          t
            .split("")
            .reverse()
            .join("") +
          "." +
          r
        );
      }
    },
    // 鼠标悬浮获取选中的name
    mouseEnter(valArr, array, key, name) {
      this.title = "";
      if (valArr.length) {
        for (let i = 0; i < valArr.length; i++) {
          for (let j = 0; j < array.length; j++) {
            if (valArr[i] == array[j][key]) {
              this.title += this.title ? "," + array[j][name] : array[j][name];
              break;
            }
          }
        }
      }
    },
    headerCellClass() {
      return "headerCellClass";
    },
    cellClass() {
      return "cellClass";
    },
    //查询贷款申请列表
    getApplyFlowList(form) {
      // const obj = {};
      // for (const key in form) {
      //   if (form[key] instanceof Array) {
      //     if (form[key].length) {
      //       obj[key] = form[key].join(",");
      //     }
      //   } else {
      //     obj[key] = form[key];
      //   }
      // }
      if(!form.productIdArray || form.productIdArray.length <1){
        delete form.productIdArray 
      }
      this.loading = true;
      let type = this.$route.query.type || ''
      this.type = type
      let phasenoArray = []
      if(type==1){
        phasenoArray = ["0060"]
      }
      if(type==2){
        phasenoArray = ["0070"]
      }
      if(type==3){
        phasenoArray = ["0080"]
      }
      if(form.phasenoArray){
        if(form.phasenoArray.length < 1){
          delete form.phasenoArray
        }
      }
      
      qryCustomerInfoListnew({phasenoArray,...form}).then(res => {
        this.loading = false;
        if (res.result.records.length) {
          this.loanApplyFlowList = res.result.records;
          this.total = res.result.total;
        } else {
          // 判断当前页没数据的页码如果是1就不用刷新
          if (form.currentPage > 1) {
            form.currentPage--;
            this.getApplyFlowList(form);
          } else {
            this.loanApplyFlowList = res.result.records;
            this.total = res.result.total;
          }
        }
      });
    },
    // 详情
    detail(row) {
      this.$router.push({
        path: `/comprehensiveTransaction/ClientsDetail/${row.customerId}`,
        query: {
          occurType: row.occurtype,
          indInfoPreSerialno:row.indInfoPreSerialno,
          isEdit:false,
          hidemenu:true
        }
      });
    },
 
    //点击修改
    edit(row) {
      const hidemenu = this.$route.path === '/clientsNewManage'
      this.$store.commit("SET_applyInfo", row);
      this.$router.push({
        path: `/comprehensiveTransaction/ClientsDetail/${row.customerId}`,
        query: {
          occurType: row.occurtype,
          indInfoPreSerialno:row.indInfoPreSerialno,
          isEdit:true,
          hidemenu:hidemenu
        }
      });
    },
    //设置每页多少条
    handleSizeChange(val) {
      this.loanApprovalApply.pageSize = val;
      this.getApplyFlowList(this.loanApprovalApply);
    },
    //查询当前页
    handleCurrentChange(val) {
      this.loanApprovalApply.currentPage = val;
      this.getApplyFlowList(this.loanApprovalApply);
    },
    // 点击展开或收起
    show() {
      this.isshow = !this.isshow;
    },
    // 搜索
    handleSearch(form) {
      if (form.inputDate) {
        form.beginDate = form.inputDate[0];
        form.endDate = form.inputDate[1];
      }
      form.currentPage = 1;
      this.currentPage = 1;
      this.getApplyFlowList(form);
    },
    // 重置搜索表单
    resetForm(formName) {
      this.$refs[formName].resetFields();
    },
  }
};
</script>