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
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
<template>
  <div class="screenage_doc_main">
    <SearchCondition
      :info="conItems"
      ref="condRef"
      :conForm="conForm"
      :screenWidth="screenWidth"
      :isShowDetail="isShowDetail"
      @handleOnSeach="handleOnSeach"
      @handleOnRest="handleOnRest"
      @handleClick="isShowDetail = !isShowDetail"
    />
    <div v-if="!isView" class="add-button">
      <el-button
        type="primary"
        size="small"
        icon="el-icon-circle-plus-outline"
        @click="handleAddPage"
        class="add-btn"
        >新增配置</el-button
      >
      <el-button
        type="primary"
        size="small"
        icon="el-icon-document-copy"
        @click="handleCopyPage"
        class="add-btn"
      >
        批量复制
      </el-button>
      <el-button
        type="primary"
        size="small"
        icon="el-icon-minus"
        @click="handleDeleteList"
        class="add-btn"
        >批量删除</el-button
      >
    </div>
    <ProTable
      :pageInfo="pageInfo"
      @doAction="doAction"
      @handleCurrentChange="handleCurrentChange"
      :isMultipleSelect="!isView"
      @handleSizeChange="handleSizeChange"
      @handleSelectionChange="handleSelectionChange"
      :noHistory="noHistory"
      :isAutoIndex="true"
      :list="docImgsList"
      :header="tableHeader"
      :loading="loading"
    />
    <el-dialog
      :title="dialogTitle"
      :visible.sync="dialogVisible"
      :close-on-click-modal="false"
      :close-on-press-escape="false"
      :destroy-on-close="true"
      width="1000"
      center
      custom-class="pricing_dialog"
    >
      <CreateForms
        ref="imagelist"
        v-if="dialogVisible"
        :isReset="true"
        :isShowOld="showOld"
        :oldVal="oldVal"
        :isView="isView"
        :isShowBorder="isShowBorder"
        :screenWidth="1000"
        :formItems="formItems"
        :defValues="defValues"
        :formRules="formRules"
        @beforeFormAvatarUpload="beforeAvatarUpload"
        @handleFormUpload="handleUpload"
        @handleFormDelete="handleDelete"
        @handleSelOnChange="handleSelOnChange"
      />
      <span slot="footer" class="dialog-footer">
        <el-button @click="handleDialogCancel">{{
          isView ? "关 闭" : "取 消"
        }}</el-button>
        <el-button
          type="primary"
          v-if="!isView"
          @click="saveImagelistConfiguration"
          >确 定</el-button
        >
      </span>
    </el-dialog>
    <el-dialog
      :title="delteTitle"
      :visible.sync="dialogDelVisible"
      :close-on-click-modal="false"
      :close-on-press-escape="false"
      :destroy-on-close="true"
      width="1000"
      center
      custom-class="pricing_dialog del_dialog"
    >
      <div style="text-align: justify;">{{ tipContent }}</div>
      <span slot="footer" class="dialog-footer">
        <el-button @click="dialogDelVisible = false">取 消</el-button>
        <el-button type="primary" @click="deleteListSure">确 定</el-button>
      </span>
    </el-dialog>
    <el-dialog
      :title="dialogTitle"
      :visible.sync="dialogCopyVisible"
      :close-on-click-modal="false"
      :close-on-press-escape="false"
      :destroy-on-close="true"
      width="400"
      center
      custom-class="pricing_dialog copy_dialog"
    >
      <CreateForms
        ref="copyImglist"
        v-if="dialogCopyVisible"
        :screenWidth="1000"
        :formItems="copyFormItems"
        :defValues="copyDefValues"
        :formRules="copyFormRules"
      />
      <span slot="footer" class="dialog-footer">
        <el-button @click="dialogCopyVisible = false">取 消</el-button>
        <el-button type="primary" @click="CopyImagelistConfig">确 定</el-button>
      </span>
    </el-dialog>
  </div>
</template>
<script>
import { Message } from "element-ui";
import { SCREENAGEDOCSETTINGCOLUMN } from "./config/tableConfig.js";
import {
  addOrUpdateImagelistConfiguration,
  qryImagelistConfigurationList,
  addExampleFileForImgConfig,
  delFileForProductInfo,
  delImagelistConfiguration,
  delImagelistConfigurationBatch,
  qryImagelistConfigurationDetail,
  qryImageListConfigImageInfo,
  copyImagelistConfigurationBatch,
  selectImageCode,
  downloadFile,
  selectFlowModelConfig,
  getOccurTypeList
} from "../../../../api/productManage.api";
import { DIMENSIONENUM } from "../../../../utils/optionsQueryConfig.js";
import {
  SCREENAGEDOCSETTINGCON,
  SCREENAGEDOCSETTINGDEF
} from "../../../../utils/condtionConfig.js";
import ProTable from "../../../../components/ProTable.vue";
import SearchCondition from "../../../../components/SearchCondition.vue";
import CreateForms from "../../../../components/CreateForms.vue";
import {
  SCREENAGEDOCSETTINGFORMS,
  COPYIMGLISTFORM
} from "../../../../utils/formsConfig.js";
import {
  SCREENAGEDOCSETTINGDEFVALUE,
  COPYIMGLISTDEFVALUE
} from "../../../../utils/defValueConfig.js";
import {
  SCREENAGEDOCSETTINGRULES,
  COPYIMGLISTRULES
} from "../../../../utils/formRulesConfig.js";
import { setTimeout } from "timers";
export default {
  props: {
    edit: {
      type: Boolean,
      default: () => {
        return false;
      }
    },
    isView: {
      type: Boolean,
      default: () => {
        return false;
      }
    },
    noHistory: {
      type: Boolean,
      default: () => {
        return false;
      }
    },
    isShowBorder: {
      type: Boolean,
      default: () => {
        return true;
      }
    },
    options: {
      type: Object,
      default: () => {
        return {};
      }
    }
  },
  watch: {
    options: {
      handler(val, oldVal) {
        this.optionsData = val;
        this.getOptionItems(val);
      },
      deep: true
    },
    isView: {
      handler(val) {
        this.isView = val;
      },
      deep: true
    }
  },
  data() {
    return {
      docImgsList: [],
      tableHeader: [...SCREENAGEDOCSETTINGCOLUMN],
      formItems: [...SCREENAGEDOCSETTINGFORMS],
      conForm: { ...SCREENAGEDOCSETTINGDEF },
      defValues: { ...SCREENAGEDOCSETTINGDEFVALUE },
      formRules: { ...SCREENAGEDOCSETTINGRULES(!this.isView) },
      copyFormItems: [...COPYIMGLISTFORM],
      copyDefValues: { ...COPYIMGLISTDEFVALUE },
      copyFormRules: { ...COPYIMGLISTRULES },
      isSave: false,
      showOld:
        this.$parent._data.objecttype === "jbo.app.BUSINESS_TYPE_CHANGE" &&
        this.isView,
      oldVal: {},
      dialogTitle: "影像资料配置新增",
      delteTitle: "影像资料配置删除确认",
      tipContent: "",
      serialno: "",
      listSerialno: "",
      dialogDelVisible: false,
      dialogCopyVisible: false,
      fileInfos: {},
      selClounms: [],
      screenWidth: document.body.offsetWidth,
      optionsData: {},
      imageCode: [],
      flowValues: [],
      loading: false,
      dialogVisible: false,
      pageInfo: {
        currentPage: 1,
        pageSize: 10,
        total: 0
      },
      conItems: [...SCREENAGEDOCSETTINGCON],
      restFormItems: [...SCREENAGEDOCSETTINGCON],
      condtionValue: {}, // 表单value集合
      isShowDetail: false // 是否显示所有表单项
    };
  },
  components: {
    SearchCondition,
    ProTable,
    CreateForms
  },
  mounted() {
    this.initColumns();
    (this.isView || this.edit) && this.getImagelistConfigurationList();
    window.addEventListener("resize", this.getScreenWidth);
    setTimeout(async () => {
      await this.getSelectFlowModelConfig();
      await this.getSelectImageCode();
      await this.getOccurTypeList();
    }, 1000);
  },
  destroyed() {
    window.removeEventListener("resize", this.getScreenWidth);
  },
  methods: {
    // 处理变更标志显示
    initColumns() {
      const { objecttype } = this.$parent._data;
      const { tableHeader, noHistory } = this;
      const isModify = objecttype === "jbo.app.BUSINESS_TYPE_CHANGE";
      const newTableHeader =
        isModify && !noHistory
          ? tableHeader
          : tableHeader.filter(col => col.prop !== "changeflag");
      this.$set(this, "tableHeader", newTableHeader);
    },
    // 重置表单配置项
    setFormsItemConfig() {
      const { showData } = this.$parent._data;
      const newFormItems = [...this.formItems].map(form => {
        const newForm = { ...form };
        if (
          newForm.name === "minmcreditterm" ||
          newForm.name === "maxmcreditterm"
        ) {
          newForm.show = showData.attribute3 === "M";
        }
        if (
          newForm.name === "mindcreditterm" ||
          newForm.name === "maxdcreditterm"
        ) {
          newForm.show = showData.attribute3 === "D";
        }
        return newForm;
      });
      this.formItems = newFormItems;
    },
    getScreenWidth() {
      this.$set(this, "screenWidth", document.body.offsetWidth);
    },
    async doAction(name, item, { key, label }) {
      if (key === "edit") {
        this.dialogTitle = "影像资料配置修改";
        this.listSerialno = item.serialNo;
        this.serialno = item.serialNo;
        await this.getEditImageListConfigImageInfo(item.serialNo);
        await this.getSelectFlowModelConfig();
        await this.getSelectImageCode();
        await this.getOccurTypeList();
        await this.getOptionItems(this.options);
        this.dialogVisible = true;
        const infos = await this.getImagelistConfigurationDetail(item.serialNo);
        let editData = {};
        Object.getOwnPropertyNames(infos).forEach(key => {
          editData[key] = infos[key].value;
        });
        setTimeout(() => {
          this.defValues = { ...editData };
          this.setFormItems(this.fileInfos);
        }, 0);
      }
      if (key === "details") {
        this.dialogTitle = "影像资料配置详情";
        this.listSerialno = item.serialNo;
        this.serialno = item.serialNo;
        await this.getEditImageListConfigImageInfo(item.serialNo);
        await this.getSelectFlowModelConfig();
        await this.getSelectImageCode();
        await this.getOccurTypeList();
        await this.getOptionItems(this.options);
        this.dialogVisible = true;
        const infos = await this.getImagelistConfigurationDetail(item.serialNo);
        let editData = {};
        let oldValue = {};
        Object.getOwnPropertyNames(infos).forEach(key => {
          editData[key] = infos[key].value;
          oldValue[key] = infos[key].oldValue;
        });
        setTimeout(() => {
          const newFormItems = [...this.formItems].map(forms => {
            const newForms = { ...forms };
            newForms.placeholder = "";
            newForms.readonly = true;
            return newForms;
          });
          this.defValues = { ...editData };
          this.formItems = newFormItems;
          this.oldVal = oldValue;
          this.setFormItems(this.fileInfos);
        }, 0);
      }
      if (key === "delete") {
        this.listSerialno = item.serialNo;
        this.serialno = item.serialNo;
        this.delteTitle = "影像资料配置删除确认";
        this.tipContent = `请确认是否需要删除影像资料配置(流程阶:${item.phaseName},影像资料类型:${item.docNo}-${item.docName}`;
        this.dialogDelVisible = true;
      }
      if (key === "download") {
        await downloadFile({
          serialno: item.serialNo,
          fileName: item.theTemple
        });
        Message.closeAll();
      }
    },
    handleOnSeach() {
      const conRef = this.$refs.condRef;
      this.$set(this, "condtionValue", conRef.$refs["conform"].model);
      this.$set(this, "pageInfo", { currentPage: 1, pageSize: 10, total: 0 });
      this.getImagelistConfigurationList();
    },
    handleOnRest() {
      this.$set(this, "condtionValue", {});
      // this.$set(this, 'pageInfo', { currentPage: 1, pageSize: 10, total: 0 })
      // this.getImagelistConfigurationList()
    },
    // 获取下拉选择项
    getOptionItems(optionsMap) {
      const newFormItems = [...this.formItems].map(item => {
        const newItems = { ...item };
        if (newItems.name === "docNo") {
          newItems.options = this.imageCode;
        }
        if (newItems.name === "phaseNo") {
          newItems.options = this.flowValues;
        }
        if (newItems.name === "occurType") {
          newItems.options = this.occurTypeList;
        }
        if (newItems.type === "file") {
          newItems.fileInfo = {};
        }
        if (
          newItems.type === "select" &&
          newItems.name !== "docNo" &&
          newItems.name !== "phaseNo" &&
          newItems.name !== "occurType"
        ) {
          newItems.options = optionsMap[DIMENSIONENUM[newItems.name]];
        }
        return newItems;
      });
      this.$set(this, "formItems", newFormItems);
    },
    // 下拉选择事件处理
    handleSelOnChange(formName, selValue) {
      if (formName === "docNo") {
        const selItems = this.imageCode.filter(
          ({ value }) => value === selValue
        );
        const imagelistForm = this.$refs.imagelist;
        imagelistForm.formValues.docName = selItems[0].label.split(",")[1];
      }
    },
    // 获取影像资料类型编码
    async getSelectImageCode() {
      const { objectno, dimensionno } = this.$parent._data;
      const params = { dimensionno, objectno };
      const imgCodeRes = await selectImageCode(params);
      if (imgCodeRes && imgCodeRes.code === "00") {
        this.imageCode = imgCodeRes.result;
      }
    },
    // 获取流程阶段名称
    async getSelectFlowModelConfig() {
      const { objectno } = this.$parent._data;
      const params = { objectno };
      const flowValRes = await selectFlowModelConfig(params);
      if (flowValRes && flowValRes.code === "00") {
        this.flowValues = flowValRes.result;
      }
    },
    // 获取业务类型
    async getOccurTypeList() {
      const { productid } = this.$parent._data;
      const params = { productid };
      const occurTypeRes = await getOccurTypeList(params);
      if (occurTypeRes && occurTypeRes.code === "00") {
        this.occurTypeList = occurTypeRes.result.map(res => {
          return {
            value: res.itemno,
            label: res.itemname
          };
        });
      }
    },
    // 查询产品影像资料配置列表
    async getImagelistConfigurationList() {
      const { currentPage, pageSize } = this.pageInfo;
      const { dimensionno, objectno, productid } = this.$parent._data;
      const { phaseNo, docNo, docName, isMandatory } = this.condtionValue;
      const params = {
        docname: docName,
        docno: docNo,
        ismandatory: isMandatory,
        phasename: phaseNo,
        currentPage,
        pageSize,
        dimensionno,
        objectno,
        productid
      };
      const listRes = await qryImagelistConfigurationList(params);
      if (!listRes || listRes.code !== "00") {
        return;
      }
      const list =
        listRes.result &&
        listRes.result.records.map(item => {
          const newitem = { ...item };
          newitem.operationOption = this.isView
            ? [
                { key: "details", label: "详情", value: true },
                { key: "download", label: "下载", value: !!item.theTemple }
              ]
            : [
                { key: "edit", label: "修改", value: true },
                { key: "delete", label: "删除", value: true },
                { key: "download", label: "下载", value: !!item.theTemple }
              ];
          return newitem;
        });
      this.$set(this, "docImgsList", list);
      this.pageInfo.total = listRes.result.total;
    },
    // 新增
    handleAddPage() {
      this.dialogVisible = false;
      this.dialogTitle = "影像资料配置新增";
      this.isSave = false;
      this.serialno = "";
      this.formItems = [...SCREENAGEDOCSETTINGFORMS];
      this.defValues = { ...SCREENAGEDOCSETTINGDEFVALUE };
      this.setFormsItemConfig();
      this.getOptionItems(this.options);
      this.dialogVisible = true;
    },
    handleDelPage() {
      this.dialogVisible = false;
      this.serialno && this.delImagelistConf([this.serialno], "init");
    },
    // 删除影像配置
    delImagelistConf(list, isInit) {
      this.setFormItems({});
      setTimeout(async () => {
        const params = { serialno: list };
        const delRes = await delImagelistConfiguration(params);
        if (!delRes || delRes.code !== "00") {
          return;
        }
        this.serialno = "";
        this.isSave = false;
        isInit !== "init" && this.$message.success("删除成功!");
      }, 0);
    },
    // 校验基本信息
    validateForms() {
      const imagelistForm = this.$refs.imagelist;
      imagelistForm.$refs["createForm"].validate(async valid => {
        if (valid) {
          this.isValidate = true;
        } else {
          this.isValidate = false;
          this.$message.error("请完必填项!");
          return false;
        }
      });
    },
    // 获取显示表单对应的value值
    getFormItemsValue(forms, values, defvalue) {
      const showForms = forms.filter(form => form.show !== false);
      let formsValue = {};
      showForms.forEach(form => {
        formsValue[form.name] = values[form.name];
      });
      return { ...defvalue, ...formsValue };
    },
    handleDialogCancel() {
      const imagelistForm = this.$refs.imagelist;
      imagelistForm.$refs["createForm"].resetFields();
      this.dialogVisible = false;
    },
    // 保存影像资料配置新增
    async saveImagelistConfiguration(type, file, key) {
      await this.validateForms();
      const { isValidate } = this;
      if (!isValidate) {
        return false;
      }
      const imagelistForm = this.$refs.imagelist;
      const { dimensionno, objectno, productid } = this.$parent._data;
      const params = {
        ...this.getFormItemsValue(
          imagelistForm.formItems,
          imagelistForm.formValues,
          SCREENAGEDOCSETTINGDEFVALUE
        ),
        dimensionNo: dimensionno,
        objectNo: objectno,
        productId: productid,
        serialNo: this.serialno
      };
      const res = await addOrUpdateImagelistConfiguration(params);
      if (!res || res.code !== "00") {
        return false;
      }
      if (type !== "init") {
        this.$message({
          message: "保存成功!",
          type: "success"
        });
      }
      this.serialno = res.result.serialno;
      this.isSave = true;
      type !== "init" && this.getImagelistConfigurationList();
      this.dialogVisible = type === "init";
      !this.dialogVisible && imagelistForm.$refs["createForm"].resetFields();
      type === "init" && this.getImageListConfigImageInfo(type, file, key);
    },
    // 上传前事件
    beforeAvatarUpload(file, key) {
      const { isSave } = this;
      if (!isSave) {
        this.saveImagelistConfiguration("init", file, key);
        return false;
      }
      return isSave;
    },
    // 获取影像配置模板信息
    async getImageListConfigImageInfo(isInit, filedata, key) {
      const imageRes = await qryImageListConfigImageInfo({
        objectno: this.serialno || this.listSerialno
      });
      if (imageRes.code !== "00") {
        return "";
      }
      this.fileInfos = imageRes.result[0];
      this.setFormItems(imageRes.result[0]);
      if (isInit === "init") {
        this.handleUpload(filedata, key);
      }
    },
    // 编辑时获取影像配置模板信息
    async getEditImageListConfigImageInfo(serialno) {
      const imageRes = await qryImageListConfigImageInfo({
        objectno: serialno
      });
      if (imageRes.code !== "00") {
        return "";
      }
      this.fileInfos = imageRes.result[0];
    },
    // 给form表单赋值
    setFormItems(fileInfo) {
      const imageFormItems = [...this.formItems].map(item => {
        const forms = { ...item };
        if (forms.type === "file") {
          forms.fileInfo = fileInfo;
        }
        return forms;
      });
      this.$set(this, "formItems", imageFormItems);
    },
    //  上传文件
    handleUpload(fileData, key) {
      if (!fileData || !this.isSave) {
        return false;
      }
      const { docNo = "", docType = "" } = this.fileInfos;
      const { serialno } = this;
      const formData = new FormData();
      formData.append("file", fileData);
      formData.append("docNo", docNo);
      formData.append("docType", docType);
      formData.append("objectNo", serialno);
      formData.append("objectType", "");
      addExampleFileForImgConfig(formData).then(res => {
        if (res.code === "00") {
          this.$message.success("上传成功!");
          this.getImageListConfigImageInfo();
        }
      });
    },
    // 删除文件
    async handleDelete(attachmentno) {
      this.$confirm("此操作将永久删除该文件, 是否继续?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning"
      })
        .then(() => {
          let params = {
            attachmentno
          };
          delFileForProductInfo(params).then(res => {
            if (res.code === "00") {
              this.$message.success("删除成功!");
              this.getImageListConfigImageInfo();
            }
          });
        })
        .catch(() => {});
    },
    // 查询影像资料配置信息
    async getImagelistConfigurationDetail(serialno) {
      const {
        dimensionno,
        objectno,
        productid,
        objecttype
      } = this.$parent._data;
      const params = {
        dimensionno,
        objectno,
        productid,
        serialno,
        showoldvalue: objecttype === "jbo.app.BUSINESS_TYPE_CHANGE"
      };
      const detailRes = await qryImagelistConfigurationDetail(params);
      if (!detailRes || detailRes.code !== "00") {
        return;
      }
      return detailRes.result;
    },
    // 删除影像资料配置信息
    async deleteImagelistConfiguration() {
      const deleteRes = await delImagelistConfiguration({
        serialno: this.listSerialno
      });
      if (!deleteRes || deleteRes.code !== "00") {
        return;
      }
      this.dialogDelVisible = false;
      this.$message.success("删除成功");
      this.getImagelistConfigurationList();
      return deleteRes.result;
    },
    // 修改翻页条数
    handleSizeChange(val) {
      this.pageInfo.pageSize = val;
      this.getImagelistConfigurationList();
    },
    // 修改翻页数
    handleCurrentChange(val) {
      this.pageInfo.currentPage = val;
      this.getImagelistConfigurationList();
    },
    //
    handleSelectionChange(val) {
      this.selClounms = val;
    },
    // 批量复制
    handleCopyPage() {
      if (this.selClounms.length < 1) {
        this.$message.info("请至少选择一条需要复制的影像资料配置");
        return;
      }
      this.copyFormItems.forEach(item => {
        item.options = this.flowValues;
      });
      this.dialogCopyVisible = true;
    },
    // 删除列表确认
    deleteListSure() {
      if (this.delteTitle === "影像资料配置删除确认") {
        this.deleteImagelistConfiguration();
      } else {
        this.deleteImagelistConfigurationBatch();
      }
    },
    // 批量删除
    async handleDeleteList() {
      if (this.selClounms.length < 1) {
        this.$message.info("请至少选择一条需要删除的影像资料配置");
        return;
      }
      this.delteTitle = "影像资料批量删除确认";
      this.tipContent = `请确认是否需要删除已选中的影像资料配置`;
      this.dialogDelVisible = true;
    },
    async deleteImagelistConfigurationBatch() {
      const params = {
        serialno: this.selClounms.map(({ serialNo }) => {
          return serialNo;
        })
      };
      const delListsRes = await delImagelistConfigurationBatch(params);
      if (delListsRes && delListsRes.code === "00") {
        this.$message.success("删除成功");
        this.dialogDelVisible = false;
        this.getImagelistConfigurationList();
      }
    },
    CopyImagelistConfig() {
      const copyImglistForm = this.$refs.copyImglist;
      copyImglistForm.$refs["createForm"].validate(async valid => {
        if (valid) {
          const { flowno } = copyImglistForm.formValues;
          const params = {
            flowno,
            oldids: this.selClounms.map(({ serialNo }) => {
              return serialNo;
            })
          };
          const copyRes = await copyImagelistConfigurationBatch(params);
          this.dialogCopyVisible = false;
          if (!copyRes || copyRes.code !== "00") {
            return false;
          }
          this.$message.success("复制成功");
          this.getImagelistConfigurationList();
        }
      });
    }
  }
};
</script>
<style lang="stylus" scoped>
.screenage_doc_main {
  padding: 20px 0 0 20px;
  margin-bottom: 70px;
  & .add-button {
    padding: 10px 0 30px 0;
  }
  & >>> .form-content {
    /* min-height: 90px!important; */
  }
  & >>> .pricing_dialog {
    width: 1000px;
    & .el-dialog__body {
      & .form_main {
        & .el-form {
          & .el-form-item {
            & .el-form-item__label {
              line-height: 32px;
            }
          }
        }
      }
    }
    & .el-dialog__footer {
      & .dialog-footer {
        & .el-button--default {
          width: 120px;
          height: 30px;
          line-height: 7px;
          border-radius: 4px;
          border: 1px solid rgba(204, 204, 204, 1);
        }
        & .el-button--primary {
          width: 120px;
          height: 30px;
          line-height: 7px;
          background: #0081f0;
          border-color: #0081f0;
          border-radius: 4px;
          margin-left: 40px;
        }
      }
    }
  }
  & >>> .del_dialog {
    width: 500px !important;
  }
  & >>> .copy_dialog {
    width: 480px !important;
  }
}
</style>