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
<template>
  <div>
    <SectionTitle :title="'影像资料信息'"></SectionTitle>
    <div class="imageData">
      <div class="imageList">
        <div
          class="images"
          v-for="(item, index) in imageMenuList"
          :key="index"
          ref="images"
        >
          <p>
            {{ item.imageCodeName }}
            <span>{{ item.imageNum ? `(${item.imageNum}张)` : "" }}</span>
          </p>
          <div
            ref="imagesFloat"
            :class="[
              'imagesList',
              { danger: activeIndex == index },
              { search: searchIndex == index },
            ]"
          >
            <div
              v-for="(child, i) in item.images"
              :key="i"
            >
            <!-- 
              缩略,只展示2张图
              v-show="
                fullScreen > 1460
                  ? i > 2
                    ? false
                    : true
                  : i > 1
                  ? false
                  : true
              " -->
              <span
                class="el-icon-error"
                @click="handleRemove(child, index)"
                v-if="canEdit"
              ></span>
              <div>
                <img
                  class="svg"
                  src="@assets/PDF.svg"
                  v-if="child.imageType == 'pdf' || child.imageType == 'PDF'"
                  alt
                  @click="previewImage(child, item.isedit)"
                />
                <img
                  class="svg"
                  src="@assets/excel.svg"
                  v-else-if="
                    child.imageType == 'XLSX' || child.imageType == 'XLS' || child.imageType == 'xlsx' || child.imageType == 'xls'
                  "
                  alt
                  @click="previewImage(child, item.isedit)"
                />
                <img
                  class="svg"
                  src="@assets/word.svg"
                  v-else-if="
                    child.imageType == 'DOCX' || child.imageType == 'DOC' || child.imageType == 'docx' || child.imageType == 'doc'
                  "
                  alt
                  @click="previewImage(child, item.isedit)"
                />
                <img
                  class="svg"
                  src="@assets/TXT.svg"
                  v-else-if="child.imageType == 'TXT' || child.imageType == 'txt'"
                  alt
                  @click="previewImage(child, item.isedit)"
                />
                <img
                  class="svg"
                  src="@assets/mp4.svg"
                  v-else-if="child.imageType == 'MP4' || child.imageType == 'mp4'"
                  alt
                  @click="previewImage(child, item.isedit)"
                />
                <img
                  class="svg"
                  src="@assets/rar.svg"
                  v-else-if="
                    child.imageType == 'ZIP' ||
                    child.imageType == 'RAR' ||
                    child.imageType == '7Z'  ||
                    child.imageType == 'zip' ||
                    child.imageType == 'rar' ||
                    child.imageType == '7z'
                  "
                  alt
                  @click="previewImage(child, item.isedit)"
                />
                <img
                  v-else
                  :src="
                    child.resizeUrl ? `${child.resizeUrl}/60/90` : child.url
                  "
                  alt
                  @click="previewImage(child, item.isedit)"
                />
              </div>
              <p
                :title="child.imageName"
              >
                {{ child.imageName }}
              </p>
            </div>
            <img src="@assets/images/show.png" alt @click.stop="show(item)" />
            <el-upload
              :ref="index"
              multiple
              drag
              name="files"
              :limit="50"
              :action="url"
              :data="{
                imageCode: item.imageCode,
                loanId: promissoryNoteNo,
                phaseNo:isDataQuery?'':enterType
              }"
              accept=".pdf, image/*, .doc, .docx, .xlsx, .xls,.zip,.rar,.7z"
              list-type="picture-card"
              v-if="canEdit"
              :on-success="function (res, file) {return handleAvatarSuccess(res, file, index);}"
              :before-upload="beforeAvatarUpload"
              v-loading="imageUploadLoading"
            >
              <i class="el-icon-plus"></i>
              <div class="el-upload__text">本地上传</div>
            </el-upload>
          </div>
        </div>
      </div>
      <div class="default" v-if="!imageMenuList.length">
        <img src="@assets/images/default.png" alt />
      </div>
      <Success :visible="success" v-on:closeDialog="closeDialog"></Success>
      <Fail
        :visible="fail"
        :reason="reason"
        v-on:closeDialog="closeDialog"
      ></Fail>
    </div>
  </div>
</template>
<script>
// 影像资料信息
// 目前定位具体图片有问题,可能需要接口配合修改
import {
  queryAcctLoan, //查询借据ID
  overdueQryCaseImageMenuList, //催收影像资料信息类型请求
  overdueQryCaseImageList, //查询案件影像
  overdueUploadCaseImage, //上传逾期案件影像
  overdueDeleteCaseImage, //删除逾期案件影像
} from "@comprehensive/serve/public";
import SectionTitle from "../SectionTitle";
import common from "@/utils/common";
import "../../../product/public/clientsImageData/index.styl";
import Success from "../../../product/components/Success";
import Fail from "../../../product/components/Fail";
export default {
  components: {
    SectionTitle,
    Success,
    Fail,
  },
  props: {
    // 申请编号
    serialNo: {
      type: String,
      required: true,
    },
    canEdit: {
      type: Boolean,
    },
    // 案件ID
    caseId: {
      type: String,
    },
    //案件阶段编号 5040 逾期入池 5050 委外催收 5060 案件起诉 5070 诉前调解 5080 法院立案 5090 法院判决
    enterType: {
      type: String,
    },
    objectType: {
      type: String,
      default: "",
    },
    flowno: {
      type: String,
      // 默认为案场
      default: "CreditFlowCase",
    },
    alterobjectno: {
      type: String,
      // 默认为案场
      default: "",
    },
    customerID: {
      type: String,
      default: "",
    },
    isDataQuery: {
      type: Boolean
    }
  },
  data() {
    return {
      url: "/rlc-cts/server/collection-case/uploadCaseImage",
      imageMenuList: [],
      success: false,
      fail: false,
      reason: "",
      activeIndex: null,
      searchIndex: null,
      newWindow: null,
      isAddEvent: false,
      fullScreen: document.documentElement.clientWidth,
      search: "",
      promissoryNoteNo: '',//借据编号
      imageUploadLoading: false,
    };
  },
  created() {
    this.init();
  },
  methods: {
    init() {
      this.requestQueryAcctLoan();
    },
    //查询借据ID
    async requestQueryAcctLoan() {
      this.loading = true;
      const res = await queryAcctLoan({
        serialno: this.serialNo,
      });
      this.loading = false;
      const { result } = res;
      this.promissoryNoteNo = result.serialNo.value
      this.requestOverdueQryCaseImageMenuList();
    },
    //逾期管理影像菜单列表
    async requestOverdueQryCaseImageMenuList() {
      this.loading = true;
      const resp = await overdueQryCaseImageMenuList({
        objectNo: this.promissoryNoteNo,
        phaseNo: this.isDataQuery?'':this.enterType,
      });
      this.loading = false;
      const { result } = resp;
      this.imageMenuList = result;
      this.requestOverdueQryCaseImageList();
    },
    //逾期管理影像资料信息
    async requestOverdueQryCaseImageList() {
      this.loading = true;
      const resp = await overdueQryCaseImageList({
        loanId: this.promissoryNoteNo,
        phaseNo: this.isDataQuery?'':this.enterType,
      });
      this.loading = false;
      const { result } = resp;
      // let tempImageMenuList = this.imageMenuList
      let tempFormValues = this.imageMenuList.reduce((pre, curr) => {
        const { imageCode } = curr;
        let tempImgList = []
        result.map(imageItem => {
          if (imageCode == imageItem.imageCode) {
            tempImgList.push(imageItem)
          }
        })
        pre.push({ ...curr,images: tempImgList })
        return pre;
      }, []);
      console.log('tempFormValues',tempFormValues,this.canEdit)
      this.imageMenuList = tempFormValues
    },
 
    // 查询影像件信息
    async getImageMenuList(i) {
      this.requestOverdueQryCaseImageList();
    },
 
    // 删除图片
    handleRemove(row, index) {
      const { serialNo } = row;
      common.comfirm("提示", "请确认是否需要删除?", async () => {
        this.$parent._data.loading = true;
        const res = await overdueDeleteCaseImage({
          serialno: serialNo,
        });
        this.$parent._data.loading = false;
        if (res.code == "00") {
          this.$message.success("删除成功");
          this.requestOverdueQryCaseImageMenuList();
        }
      });
    },
    //预览图片
    previewImage(row, isEdit) {
      window.open(row.url, "_blank")
      // let { newWindow } = this;
      // if (newWindow) {
      //   newWindow.close();
      // }
      // newWindow = window.open(
      //   row.url,
      //   "newwindow",
      //   "height=700px, width=800px, top=100px,left=400px, toolbar=no, menubar=no, scrollbars=yes, resizable=no,location=no, status=no"
      // )
      // this.newWindow = newWindow;
    },
 
    //上传之前
    beforeAvatarUpload(file) {
      let isfile;
      if (file.type && file.type.split("/")[0] == "image") {
        isfile = true;
      } else {
        const fileType = file.name.substring(file.name.lastIndexOf(".") + 1);
        isfile =
          fileType === "pdf" ||
          fileType === "docx" ||
          fileType === "xls" ||
          fileType === "xlsx" ||
          fileType === "txt" ||
          fileType === "doc" ||
          fileType === "zip"||
          fileType === "rar"||
          fileType === "7z" ||
          fileType === "PDF"
          ;
      }
      if (!isfile) {
        this.$message.warning("该上传文件类型暂不支持,请重新上传!");
        return isfile;
      }
      this.imageUploadLoading = true;
    },
 
    // 上传成功
    handleAvatarSuccess(res, file, index) {
      // this.$message.success('上传成功')
      // this.getImageMenuList(index);
      this.imageUploadLoading = false;
      this.requestOverdueQryCaseImageMenuList();
    },
 
    // 展开图片
    show(row) {
      this.imageMenuList.forEach((item) => {
        this.$set(item, "isShow", false);
      });
      row.isShow = true;
    },
 
    closeDialog(data) {
      this.fail = data;
      this.success = data;
    },
  },
};
</script>
<!-- 
<style lang="postcss" scoped>
.text-list {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  font-size: 14px;
  line-height: 20px;
  color: #333333;
  & li {
    width: 50%;
    display: flex;
    justify-content: space-between;
    box-sizing: border-box;
    border-bottom: 1px solid #eeeeee;
    padding: 12px 49px 12px 20px;
    & p {
      margin: 0;
      flex: 1;
    }
    & a {
      color: #0081f0;
      margin-left: 10px;
      cursor: pointer;
      width: 4em;
      text-align: right;
    }
    &:nth-child(odd) {
      border-right: 1px solid #eeeeee;
    }
  }
}
.image-list {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  list-style: none;
  text-align: center;
  font-size: 14px;
  margin: 30px 0 0 0;
  & li {
    width: 200px;
    height: 160px;
    overflow: hidden;
    margin: 30px 30px 0 0;
    & img {
      width: 150px;
      height: 100px;
      transition: all 0.2s ease;
      &:hover {
        width: 180px;
        height: 120px;
      }
    }
    & .img-item {
      text-align: center;
    }
  }
}
.img-text {
  height: 3em;
  overflow: hidden;
  text-align: center;
}
.show-all {
  margin-bottom: 16px;
  & >>> .el-button {
    padding: 5px 9px;
  }
}
 
</style> -->