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
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
<template>
  <div class="preApprovalApply" v-loading.fullscreen.lock="waiting" element-loading-background="transparent">
    <el-form
      ref="preApprovalApply"
      :model="preApprovalApply"
      inline
      label-width="95px"
      size="small"
    >
      <el-form-item label="申请编号" prop="serialNo">
        <el-input v-model="preApprovalApply.serialNo" placeholder="请输入"></el-input>
      </el-form-item>
      <el-form-item label="客户名称" prop="customerName">
        <el-input v-model="preApprovalApply.customerName" placeholder="请输入"></el-input>
      </el-form-item>
      <el-form-item label="处理标识" prop="isHandle">
        <el-select v-model="preApprovalApply.isHandle" placeholder="请选择">
          <el-option label="待处理" value="00"></el-option>
          <el-option label="已处理" value="01"></el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="当前流程阶段" v-show="isshow" prop="phaseNo">
        <el-select
          v-model="preApprovalApply.phaseNo"
          clearable
          multiple
          filterable
          placeholder="请选择"
          collapse-tags
          :title="title"
          @mouseenter.native="mouseEnter(preApprovalApply.phaseNo,flowPhaseList,'taskKey','taskName')"
        >
          <el-option
            v-for="item in flowPhaseList"
            :key="item.taskKey"
            :label="item.taskName"
            :value="item.taskKey"
          ></el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="产品名称" v-show="isshow" prop="productid">
        <el-select
          v-model="preApprovalApply.productid"
          clearable
          multiple
          filterable
          placeholder="请选择"
          collapse-tags
          :title="title"
          @mouseenter.native="mouseEnter(preApprovalApply.productid,productList,'productCode','productName')"
          @change="selectproduct(preApprovalApply.productid)"
        >
          <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="产品维度" v-show="isshow" prop="productDimension">
        <el-select
          v-model="preApprovalApply.productDimension"
          clearable
          multiple
          filterable
          placeholder="请选择"
          collapse-tags
          :title="title"
          @mouseenter.native="mouseEnter(preApprovalApply.productDimension,dimensionList,'dimensionCode','dimensionsName')"
        >
          <el-option
            v-for="(item,index) in dimensionList"
            :key="index"
            :label="item.dimensionsName"
            :value="item.dimensionCode"
          ></el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="业务城市" v-show="isshow" prop="businessCity">
        <el-select
          v-model="preApprovalApply.businessCity"
          clearable
          multiple
          filterable
          placeholder="请选择"
          collapse-tags
          :title="title"
          @mouseenter.native="mouseEnter(preApprovalApply.businessCity,cityList,'itemno','itemname')"
        >
          <el-option
            v-for="(item,index) in cityList"
            :key="index"
            :label="item.itemname"
            :value="item.itemno"
          ></el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="项目名称" v-show="isshow" prop="projectname">
        <el-input v-model="preApprovalApply.projectname" placeholder="请输入"></el-input>
      </el-form-item>
      <el-form-item label="报单日期" v-show="isshow" prop="inputDate">
        <el-date-picker
          v-model="preApprovalApply.inputDate"
          type="daterange"
          value-format="yyyy-MM-dd"
          range-separator="-"
          start-placeholder="开始日期"
          end-placeholder="结束日期"
          @change="selDate"
        ></el-date-picker>
      </el-form-item>
      <el-form-item size="small">
        <el-button style="padding:8px 15px;" plain @click="resetForm('preApprovalApply')">重置</el-button>
        <el-button style="margin-left: 22px;padding:8px 15px;" type="primary" @click="handleSearch(preApprovalApply)">搜索</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>
    <el-button
      class="addPreApprovalApply"
      type="primary"
      icon="el-icon-circle-plus-outline"
      size="small"
      @click="addPreApprovalApply"
    >新增预审批申请</el-button>
    <div class="table">
      <el-table
        :data="loanApplyFlowList"
        :cell-class-name="cellClass"
        :header-cell-class-name="headerCellClass"
        v-loading="loading"
        highlight-current-row
      >
        <el-table-column
          type="index"
          width="40"
          label=" "
        >
        </el-table-column>
        <el-table-column prop="serialNo" label="申请编号" width="160"></el-table-column>
        <el-table-column prop="productName" label="产品名称" width="150"></el-table-column>
        <el-table-column prop="customerName" label="客户名称" width="150">
          <template slot-scope="scope">
            <span>{{ scope.row.customerName?scope.row.customerName:'--' }}</span>
          </template>
        </el-table-column>
        <el-table-column prop="occurtypeDesc" label="业务类型" width="100">
          <template slot-scope="scope">
            <span>{{ scope.row.occurtypeDesc?scope.row.occurtypeDesc:'--' }}</span>
          </template>
        </el-table-column>
        <el-table-column prop="projectname" label="项目名称" width="120">
          <template slot-scope="scope">
            <span>{{ scope.row.projectname?scope.row.projectname:'--' }}</span>
          </template>
        </el-table-column>
        <el-table-column prop="businessCityDesc" label="业务城市" width="95">
          <template slot-scope="scope">
            <span>{{ scope.row.businessCityDesc?scope.row.businessCityDesc:'--' }}</span>
          </template>
        </el-table-column>
        <el-table-column prop="productdimensionname" label="产品维度" width="180">
          <template slot-scope="scope">
            <span>{{ scope.row.productdimensionname?scope.row.productdimensionname:'--' }}</span>
          </template>
        </el-table-column>
        <el-table-column prop="currentphasename" label="当前流程阶段" width="160">
          <template slot-scope="scope">
            <span>{{ scope.row.currentphasename?scope.row.currentphasename:'--' }}</span>
          </template>
        </el-table-column>
        <el-table-column prop="inputdate" label="报单日期" width="100">
          <template slot-scope="scope">
            <span>{{ scope.row.inputdate?scope.row.inputdate:'--' }}</span>
          </template>
        </el-table-column>
        <el-table-column prop="inputtime" label="报单时间" width="100">
          <template slot-scope="scope">
            <span>{{ scope.row.inputtime?scope.row.inputtime:'--' }}</span>
          </template>
        </el-table-column>
        <el-table-column prop="operateusername" label="报单人" width="95">
          <template slot-scope="scope">
            <span>{{ scope.row.operateusername?scope.row.operateusername:'--' }}</span>
          </template>
        </el-table-column>
        <el-table-column prop="operateorgname" label="报单人直属机构" width="240">
          <template slot-scope="scope">
            <span>{{ scope.row.operateorgname?scope.row.operateorgname:'--' }}</span>
          </template>
        </el-table-column>
        <el-table-column prop="currentusername" label="当前处理人" width="100">
          <template slot-scope="scope">
            <span>{{ scope.row.currentusername?scope.row.currentusername:'--' }}</span>
          </template>
        </el-table-column>
        <el-table-column prop="curoperateorgname" label="当前处理人直属机构" width="240">
          <template slot-scope="scope">
            <span>{{ scope.row.curoperateorgname?scope.row.curoperateorgname:'--' }}</span>
          </template>
        </el-table-column>
        <el-table-column label="操作管理" fixed="right" width="130">
          <template slot-scope="scope">
            <el-button
              type="text"
              style="margin:0 20px 0 0"
              @click="handler(scope.row,scope.row.btns[0])"
            >{{scope.row.btns[0]}}</el-button>
            <el-popover
              :ref="scope.$index"
              @show="scope.row.isSwitch=true;$set(loanApplyFlowList,scope.$index,scope.row)"
              @hide="scope.row.isSwitch=false;$set(loanApplyFlowList,scope.$index,scope.row)"
              placement="bottom"
              trigger="hover"
              popper-class="custom_popper"
            >
              <div style="text-align: center; margin: 2px 0">
                <el-button
                  type="text"
                  v-for="(item,index) in scope.row.btns"
                  :key="index"
                  v-show="index!=0"
                  @click="scope._self.$refs[scope.$index].doClose();handler(scope.row,item)"
                >{{item}}</el-button>
              </div>
              <el-button style="margin:0 10px 0 0" type="text" slot="reference" :disabled="scope.row.btns.length<2">
                更多
                <i
                  v-show="scope.row.btns.length>=2"
                  :class="[{'el-icon-arrow-down':!scope.row.isSwitch},{'el-icon-arrow-up':scope.row.isSwitch}]"
                ></i>
              </el-button>
            </el-popover>
          </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>
    <AddApply v-if="isAddApply" v-on:closeApply="closeApply" :visible="isAddApply" title="预审批申请信息"></AddApply>
  </div>
</template>
 
<script>
import "./index.styl";
import { setStorage } from "@/utils/storage";
import {
  qryFlowPhaseList,
  qryProdList,
  qryDimensionList,
  getAllCityAreaList,
  qryApplyFlowList,
  cancelApplyLoan,
  resetApply
} from "@/api/product";
import AddApply from "../../components/AddApply";
import common from '@/utils/common'
export default {
  data() {
    return {
      isshow: false,
      flowPhaseList: "",
      productList: "",
      dimensionList: "",
      cityList: "",
      title: "",
      total: 0,
      currentPage: 1,
      loanApplyFlowList: [],
      preApprovalApply: {
        isHandle: "00",
        phaseFlag: "01",
        projectname: "",
        serialNo: "",
        currentPage: 1,
        pageSize: "10"
      },
      isAddApply: false,
      waiting: false,
      loading: false,
    };
  },
  activated() {
    //获取当前流程阶段列表
    qryFlowPhaseList({}).then(res => {
      this.flowPhaseList = res.result;
    });
    //获取产品列表
    qryProdList({}).then(res => {
      this.productList = res.result;
    });
    //获取业务城市列表
    getAllCityAreaList({ queryFlag: "02" }).then(res => {
      this.cityList = res.result;
    });
    //调用产品维度下拉方法
    this.getDimensionList({});
    //调用查询预审批申请列表方法
    this.getApplyFlowList(this.preApprovalApply);
  },
  components: {
    AddApply,
  },
  methods: {
    // 金额格式化
    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;
            }
          }
        }
      }
    },
    selDate(val){
      if(!val){
        this.preApprovalApply.beginDate = '';
        this.preApprovalApply.endDate = '';
      }
    },
    headerCellClass() {
      return "headerCellClass";
    },
    cellClass() {
      return "cellClass";
    },
    //展开搜索列表
    show() {
      this.isshow = !this.isshow;
    },
    //根据产品获取产品维度列表
    selectproduct(params) {
      this.getDimensionList({ productid: params.join(",") });
    },
    //获取产品维度列表
    getDimensionList(params) {
      qryDimensionList(params).then(res => {
        this.dimensionList = res.result;
      });
    },
    //点击搜索
    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();
    },
    // 处理列表各种操作管理
    handler(row,key){
      switch (key) {
        case '修改':
          this.edit(row)
          break;
        case '详情':
          this.detail(row)
          break;
        case '取消申请':
          this.withdraw(row)
          break;
        case '重新申请':
          this.resetApply(row)
          break;
        default:
          break;
      }
    },
    // 排序展示列表需要的按钮
    showBtn(array){
      array.forEach(val => {
        val.btns = []
        val.updateFlag==1?val.btns.push('修改'):''
        val.detailFlag==1?val.btns.push('详情'):''
        val.cancelFlag==1?val.btns.push('取消申请'):''
        val.resetFlag==1?val.btns.push('重新申请'):''
      });
    },
    //查询预审批申请列表
    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];
        }
      }
      this.loading = true;
      qryApplyFlowList(obj).then(res => {
        this.loading = false;
        if(res.result.records.length){
          this.loanApplyFlowList = res.result.records;
          this.showBtn(this.loanApplyFlowList)
          this.total = res.result.total;
        }else{
          // 判断当前页没数据的页码如果是1就不用刷新
          if(form.currentPage>1){
            form.currentPage--;
            this.getApplyFlowList(form);
          }else{
            this.loanApplyFlowList = res.result.records;
            this.showBtn(this.loanApplyFlowList)
            this.total = res.result.total;
          }
        }
      });
    },
    //设置每页多少条
    handleSizeChange(val) {
      this.preApprovalApply.pageSize = val;
      this.getApplyFlowList(this.preApprovalApply);
    },
    //查询当前页
    handleCurrentChange(val) {
      this.preApprovalApply.currentPage = val;
      this.getApplyFlowList(this.preApprovalApply);
    },
    // 详情
    detail(row) {
      this.$router.push({
        path: `/comprehensiveTransaction/loanDetail/${row.serialNo}`,
        query: { occurType:row.occurtype, flowno:row.flowno, objectType:row.objectType, customerID:row.customerid }
      });
    },
    //点击修改
    edit(row) {
      this.$store.commit('SET_applyInfo',row)
      this.$router.push({ path: "/loanApplyEdit" });
    },
    // 取消申请
    withdraw(row) {
      common.comfirm("取消申请确认",`请确认是否需要取消申请单:${row.serialNo}(单号)?`,()=>{
        cancelApplyLoan({
          objectNo: row.serialNo,
          taskNo: row.ftSerialNo
        }).then(res => {
          if (res.code == "00") {
            this.$message({
              message: "取消申请成功",
              type: "success"
            });
            this.getApplyFlowList(this.preApprovalApply);
          }
        });
      })
    },
    //重新申请
    resetApply(row) {
      common.comfirm("重置申请确认",`请确认是否需要重新激活申请单:${row.serialNo}(单号)?`,()=>{
        resetApply({
          objectNo: row.serialNo,
          taskNo: row.ftSerialNo,
          phaseFlag: "1"
        }).then(res => {
          this.waiting = false;
          if (res.code == "00") {
            this.$store.commit("SET_applyInfo", row);
            this.$router.push({ path: "/loanApplyEdit" });
          }
        });
      })
    },
    // 新增预审批申请
    addPreApprovalApply() {
      this.isAddApply = true;
    },
    // 关闭弹窗
    closeApply(data) {
      this.isAddApply = data;
    }
  }
};
</script>