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
<!-- 风控报告存量资产逾期明细 -->
<template>
  <div>
    <div class="form-content">
      <FormList
        :info="formInfo"
        :isShowDetail="isShowDetail"
        @handleClick="isShowDetail = !isShowDetail"
        @updateValue="updateValue"
        @onSubmit="onSubmit"
        @setValueInfo="setValueInfo"
        :isChangeArray="false"
        @resetValue="resetValue"
      ></FormList>
    </div>
    <p class="export-excle">
      <span>
        <el-button
          size="small"
          type="primary"
          :loading="excelLoading"
          @click="batchEntrustExternal"
          >导出excel</el-button
        >
      </span>
    </p>
    <div class="list-content">
      <TableList
        :pageInfo="pageInfo"
        @doAction="doAction"
        @handleCurrentChange="handleCurrentChange"
        @handleSizeChange="handleSizeChange"
        @handleSelectionChange="handleSelectionChange"
        :isMultipleSelect="false"
        :activeIndex="activeIndex"
        :isAutoIndex="true"
        :isPaddingRight="false"
        ref="tableRef"
        :list="records"
        :header="tableHeader"
        :height="tableHeight"
        :loading="loading"
      ></TableList>
    </div>
  </div>
</template>
 
<script>
import FormList from "./components/FormList";
import TableList from "./components/TableList";
import { riskReportExistAssetsDepartmentOverdueSearch } from "@comprehensive/utils/formItems";
import {
  riskReportOverdueAssetDetailsHeader,
} from "@comprehensive/utils/tableHeaders";
import {
  queryOverdueLoanList,
  createExportOverdueLoan,
  qryCodeListByCode,
} from "@comprehensive/serve/public";
 
// 逾期入池
export default {
  name: "riskReportOverdueAssetDetails",
  components: {
    FormList,
    TableList,
  },
  computed: {
    activeIndex() {
      const arr = [];
      this.records.forEach((item, i) => {
        this.checkInfoList.forEach((val) => {
          if (item.applySerialNo == val.applySerialNo) {
            arr.push(i);
          }
        });
      });
      return arr;
    },
  },
  data() {
    return {
      formInfo: [],
      formInfoFilter: ["deadline", "applySerialNo","customerName","expectlenddate","loanStatusDesc","overduedays",""],
      // 是否显示所有表单项
      isShowDetail: false,
      // 表单结果数据
      valueInfo: {},
      //批量委外loading
      excelLoading: false,
      //表单数据
      records: [],
      //页码
      pageInfo: {
        currentPage: 1,
        pageSize: 10,
        total: 0,
      },
      tableHeader: [...riskReportOverdueAssetDetailsHeader],
      tableHeaderFilter: [
        "orgName",
        "indictCourtName",
        "conciliateStatusDesc",
        "filingTime",
        "judgmentTime",
      ],
      tableHeight: "560px",
      //数据列表loading
      loading: false,
      checkInfoList: [],
    };
  },
  created() {
    this.init();
  },
  destroyed() {
    // window.removeEventListener("message")
  },
  methods: {
    init() {
      const { formInfoFilter, tableHeaderFilter } = this;
      this.formInfo = riskReportExistAssetsDepartmentOverdueSearch.filter(
        ({ name }) => !formInfoFilter.includes(name)
      );
      this.tableHeader = riskReportOverdueAssetDetailsHeader.filter(
        ({ prop }) => !tableHeaderFilter.includes(prop)
      );
      this.getQueryOverdueLoanList();
      this.getQryCodeListByCode();
    },
    async getQueryOverdueLoanList() {
      this.loading = true;
      let { valueInfo, pageInfo } = this;
      const res = await queryOverdueLoanList({
        ...valueInfo,
        ...pageInfo,
      });
      this.loading = false;
      const { list = [], total } = res.result;
      //逻辑处理
      this.records = list.reduce((pre, curr) => {
        const {
          termUnit,
          repaymentTypeDesc,
          businessTermMonth,
          businessTermDay,
        } = curr;
        pre.push({
          ...curr,
          repaymentType: repaymentTypeDesc,
          businessTermDay:
            termUnit == "M"
              ? `${businessTermMonth}个月`
              : `${businessTermDay}天`,
        });
        return pre;
      }, []);
 
      this.pageInfo = {
        ...pageInfo,
        total: total,
      };
    },
    // 更新表单数据或查找某项数据
    setOrGetFormInfo(nameKey, newInfo) {
      let { formInfo } = this;
      let index = formInfo.findIndex(({ name }) => name === nameKey);
      let result = {};
      if (!isNaN(index)) {
        this.$set(this.formInfo, index, { ...formInfo[index], ...newInfo });
        result = this.formInfo[index];
      }
      if (typeof newInfo === "undefined") {
        return result;
      }
    },
    // 更新数据
    updateValue(value, item) {
      let { name } = item;
      this.setOrGetFormInfo(name, { value });
    },
    // 查询操作
    onSubmit(val) {
      this.pageInfo.currentPage = 1;
      if (val == "reset") {
        this.formInfo = loanMarginManagementSearch.filter(
          ({ name }) => !this.formInfoFilter.includes(name)
        );
        this.valueInfo = {};
      }
      this.getQueryOverdueLoanList();
      // this.getQryCodeListByCode();
    },
    // 设置表单结果数据
    setValueInfo(info = {}) {
      this.valueInfo = info;
    },
    // 重置表单
    resetValue() {
      // this.pageInfo.currentPage = 1;
    },
    //导出excel
    async batchEntrustExternal() {
      this.loading = true;
      let { valueInfo } = this;
      const resp = await createExportOverdueLoan({
        ...valueInfo,
      });
      this.loading = false;
      if (resp.code == "00") {
        this.$message({
          type: "success",
          message: resp.msg,
        });
      }
    },
    // 表单事件回调
    async doAction(name, item, { label }) {
      console.log("name", name, "item", item, "label", label);
      const { applySerialNo, phaseNo, serialNo, ftSerialNo } = item;
      // this.isShowList = false;
      //当点击订单号时触发
      if (label === "详情") {
        this.$router.push({
          path: `/comprehensiveTransaction/overdueProductDetail/${applySerialNo}`,
          query: {
            enterType: phaseNo,
            type: "detail",
            serialNo: serialNo,
            ftSerialNo: ftSerialNo,
          },
        });
      } else {
        this.$router.push({
          path: `/comprehensiveTransaction/overdueProductDetail/${applySerialNo}`,
          query: {
            enterType: phaseNo,
            type: "edit",
            serialNo: serialNo,
            ftSerialNo: ftSerialNo,
          },
        });
      }
    },
    //选中
    handleSelectionChange(array) {
      this.checkInfoList = array;
    },
    // 修改翻页数
    handleCurrentChange(val) {
      this.pageInfo.currentPage = val;
      this.getQueryOverdueLoanList();
    },
    // 修改翻页条数
    handleSizeChange(val) {
      this.pageInfo.pageSize = val;
      this.getQueryOverdueLoanList();
    },
    // 产品名称下拉列表
    async getQryCodeListByCode() {
      const productRes = await qryCodeListByCode({
        codeNos: ["ProductCodeType", "BussDepartName", "FundUnit"],
      });
      const { BussDepartName, FundUnit, ProductCodeType } = productRes.result.codeMap;
      
      this.setOrGetFormInfo("loanMains", { options: FundUnit });
      this.setOrGetFormInfo("productIds", { options: ProductCodeType });
      this.setOrGetFormInfo("businessTeams", { options: BussDepartName });
    },
  },
  watch: {},
};
</script>
 
<style lang="postcss" scoped>
.list-content {
  font-size: 14px;
}
.export-excle {
  margin: 0 0 20px 0;
}
.message {
  font-size: 12px;
  color: #666666;
  padding: 10px 20px;
  background-color: #fafafa;
}
>>> .el-table__header {
  width: 100% !important;
}
>>> .el-table__body {
  width: 100% !important;
}
</style>