doctor-admin-components 1.0.13-pro.1 → 1.0.14-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/README.md +10 -2
  2. package/package.json +1 -1
  3. package/packages/index.js +16 -0
  4. package/packages/src/api/biz/bizContract.js +1005 -0
  5. package/packages/src/api/biz/bizFileInfo.js +16 -0
  6. package/packages/src/api/biz/bizInvoice.js +1 -1
  7. package/packages/src/api/biz/bizShipment.js +38 -0
  8. package/packages/src/assets/images/click-show-table.png +0 -0
  9. package/packages/src/assets/images/more.png +0 -0
  10. package/packages/src/assets/images/pdf-new.png +0 -0
  11. package/packages/src/components/DictTag/index.vue +12 -2
  12. package/packages/src/components/FileUpload/contract-drag-new.vue +100 -11
  13. package/packages/src/i18n/en/message.json +305 -0
  14. package/packages/src/i18n/index.js +38 -0
  15. package/packages/src/i18n/zh-CN/message.json +305 -0
  16. package/packages/src/index.js +24 -1
  17. package/packages/src/utils/MycommonUtil.js +12 -0
  18. package/packages/src/utils/index.js +35 -0
  19. package/packages/src/views/biz/bizFileInfo/PAYMENT_VOUCHER(/"payment_voucher/", /"/344/273/230/346/254/276/345/207/255/350/257/201.ini" +222 -0
  20. package/packages/src/views/biz/bizFileInfo/contract copy.vue +1711 -0
  21. package/packages/src/views/biz/bizFileInfo/contract.vue +1783 -986
  22. package/packages/src/views/biz/bizFileInfo/contractFile/BillOfLadingNoTab.vue +114 -0
  23. package/packages/src/views/biz/bizFileInfo/contractFile/ContentTitle.vue +102 -0
  24. package/packages/src/views/biz/bizFileInfo/contractFile/IMGPreviewCheckBox.vue +308 -0
  25. package/packages/src/views/biz/bizFileInfo/contractFile/Progress.vue +85 -0
  26. package/packages/src/views/biz/bizFileInfo/contractFile/ProgressDetail.vue +123 -0
  27. package/packages/src/views/biz/bizFileInfo/contractFile/SectionSlot.vue +83 -0
  28. package/packages/src/views/biz/bizFileInfo/contractFile/ShowAndHide.vue +178 -0
  29. package/packages/src/views/biz/bizFileInfo/fileShow copy.vue +321 -0
  30. package/packages/src/views/biz/bizFileInfo/fileShow.vue +143 -47
  31. package/packages/src/views/biz/bizFileInfo/fileShowClaim.vue +1 -1
  32. package/packages/src/views/biz/bizShipment/add.vue +166 -28
  33. package/packages/src/views/biz/bizShipment/referenceAlert.vue +168 -0
  34. package/packages/src/views/biz/contractTracing/billInfo.vue +64 -40
  35. package/packages/src/views/biz/contractTracing/companyBanks.vue +228 -0
  36. package/packages/src/views/biz/contractTracing/contractInfo.vue +1 -1
  37. package/packages/src/views/biz/contractTracing/contractPdf.vue +10 -5
  38. package/packages/src/views/biz/contractTracing/contractSummary.vue +31 -19
  39. package/packages/src/views/biz/contractTracing/contractTracingDetail copy.vue +107 -0
  40. package/packages/src/views/biz/contractTracing/contractTracingDetail.vue +281 -31
  41. package/packages/src/views/biz/contractTracing/editBill.vue +22 -9
  42. package/packages/src/views/biz/contractTracing/purchaseInvoiceUpload.vue +153 -7
  43. package/packages/src/views/biz/contractTracing/shipmentPurchaseAmount.vue +14 -0
  44. package/packages/src/views/biz/contractTracing/subCompanyDialog.vue +8 -2
  45. package/packages/src/views/components/RegionPicker/Distpicker.vue +459 -0
  46. package/packages/src/views/components/RegionPicker/districts.js +4641 -0
  47. package/packages/src/views/test.vue +3 -3
@@ -1,7 +1,12 @@
1
1
  <template>
2
2
  <div class="app-container">
3
3
  <!-- 添加或修改装运对话框 -->
4
- <el-dialog :title="title" :visible.sync="open" width="80%" :before-close="handleClose">
4
+ <el-dialog :visible.sync="open" z-index="1000" width="80%" :before-close="handleClose" :title="title">
5
+ <slot name="">
6
+ <span v-if="voidInvoiceList" style="color: red">【快捷转卖】:系统检测到此销售合同关联的采购合同存在【已作废】的装运,</span>
7
+ <el-button v-if="voidInvoiceList" @click="handleReference" size="mini" type="text">点击这里直接复制并引用</el-button>
8
+ </slot>
9
+ <div v-if="reason" style="color: #f00; padding-left: 60px; margin-bottom: 10px">{{ reason }}</div>
5
10
  <el-form ref="form" :model="form" :rules="rules" label-position="right" label-width="80px">
6
11
  <el-row>
7
12
  <el-col :span="6">
@@ -11,13 +16,11 @@
11
16
  </el-select>
12
17
  </el-form-item>
13
18
  </el-col>
14
-
15
19
  <el-col :span="6">
16
20
  <el-form-item label="订舱号" prop="bookingNo">
17
21
  <el-input v-model="form.bookingNo" placeholder="请输入订舱号" size="small" />
18
22
  </el-form-item>
19
23
  </el-col>
20
-
21
24
  <el-col :span="6">
22
25
  <el-form-item label="提单号" prop="billOfLadingNo">
23
26
  <el-input v-model="form.billOfLadingNo" placeholder="请输入提单号" size="small" />
@@ -88,11 +91,16 @@
88
91
  <el-row>
89
92
  <el-col :span="8">
90
93
  <el-form-item label="对应采购合同" prop="purchaseContractNo" label-width="100">
91
- <el-select v-model="form.purchaseContractNo" size="small">
94
+ <el-select v-model="form.purchaseContractNo" size="small" clearable="">
92
95
  <el-option v-for="item in contract.purchaseContractNos" :key="item" :label="item" :value="item" />
93
96
  </el-select>
94
97
  </el-form-item>
95
98
  </el-col>
99
+ <el-col :span="8">
100
+ <el-form-item label="ETA更新" prop="etaUpdateOn" label-width="100">
101
+ <el-switch v-model="form.etaUpdateOn" active-text="自动" inactive-text="手动"> </el-switch>
102
+ </el-form-item>
103
+ </el-col>
96
104
  </el-row>
97
105
  <el-table stripe :data="contractDetailList" border>
98
106
  <el-table-column label="序号" type="index" align="center"></el-table-column>
@@ -147,14 +155,14 @@
147
155
  </el-col>
148
156
  <el-col :span="8">
149
157
  <el-form-item label="集装箱皮重(kg)" :prop="'containerList.' + index + '.containerTareWeight'" :rules="subrules.containerTareWeight" label-width="120px">
150
- <el-input v-model="dt.containerTareWeight" placeholder="请输入" size="mini"></el-input>
158
+ <el-input v-model="dt.containerTareWeight" placeholder="请输入" size="mini" type="number"></el-input>
151
159
  </el-form-item>
152
160
  </el-col>
153
161
  </el-row>
154
162
  <el-row>
155
163
  <el-col :span="6">
156
164
  <el-form-item label="总货物毛重(t)" :prop="'containerList.' + index + '.totalGoodsGrossWeight'" :rules="subrules.totalGoodsGrossWeight" label-width="105px">
157
- <el-input v-if="editSwitch" size="mini" v-model="dt.totalGoodsGrossWeight"></el-input>
165
+ <el-input v-if="editSwitch" size="mini" v-model="dt.totalGoodsGrossWeight" type="number"></el-input>
158
166
  <div v-else>
159
167
  {{ dt.totalGoodsGrossWeight ? dt.totalGoodsGrossWeight : '自动计算' }}
160
168
  </div>
@@ -162,7 +170,7 @@
162
170
  </el-col>
163
171
  <el-col :span="6">
164
172
  <el-form-item label="总货物皮重(t)" :prop="'containerList.' + index + '.totalGoodsTareWeight'" :rules="subrules.totalGoodsTareWeight" label-width="105px">
165
- <el-input v-if="editSwitch" size="mini" v-model="dt.totalGoodsTareWeight"></el-input>
173
+ <el-input v-if="editSwitch" size="mini" v-model="dt.totalGoodsTareWeight" type="number"></el-input>
166
174
  <div v-else>
167
175
  {{ dt.totalGoodsTareWeight ? dt.totalGoodsTareWeight : '自动计算' }}
168
176
  </div>
@@ -170,7 +178,7 @@
170
178
  </el-col>
171
179
  <el-col :span="6">
172
180
  <el-form-item label="总货物净重(t)" :prop="'containerList.' + index + '.totalGoodsNetWeight'" :rules="subrules.totalGoodsNetWeight" label-width="105px">
173
- <el-input v-if="editSwitch" size="mini" v-model="dt.totalGoodsNetWeight"></el-input>
181
+ <el-input v-if="editSwitch" size="mini" v-model="dt.totalGoodsNetWeight" type="number"></el-input>
174
182
  <div v-else>
175
183
  {{ dt.totalGoodsNetWeight ? dt.totalGoodsNetWeight : '自动计算' }}
176
184
  </div>
@@ -202,7 +210,8 @@
202
210
  v-model="scope2.row.packageGrossWeight"
203
211
  placeholder="请输入毛重"
204
212
  size="mini"
205
- @input="changePackageGrossWeight(index, scope1.$index, scope2.$index)"
213
+ type="number"
214
+ @input="limitDecimalPlaces(index, scope1.$index, scope2.$index, scope2.row, 'packageGrossWeight')"
206
215
  ></el-input>
207
216
  </el-form-item>
208
217
  </template>
@@ -220,7 +229,8 @@
220
229
  v-model="scope2.row.packageTareWeight"
221
230
  placeholder="请输入皮重"
222
231
  size="mini"
223
- @input="changePackageTareWeight(index, scope1.$index, scope2.$index)"
232
+ type="number"
233
+ @input="limitDecimalPlaces(index, scope1.$index, scope2.$index, scope2.row, 'packageTareWeight')"
224
234
  ></el-input>
225
235
  </el-form-item>
226
236
  </template>
@@ -234,7 +244,7 @@
234
244
  :rules="rules.packageNetWeight"
235
245
  :prop="'containerList.' + index + '.containerDetailList.' + scope1.$index + '.packageList.' + scope2.$index + '.packageNetWeight'"
236
246
  >
237
- <el-input v-model="scope2.row.packageNetWeight" placeholder="请输入净重" size="mini"></el-input>
247
+ <el-input v-model="scope2.row.packageNetWeight" placeholder="请输入净重" size="mini" type="number" @input="limitDecimalPlaces(index, scope1.$index, scope2.$index, scope2.row,'packageNetWeight')"></el-input>
238
248
  </el-form-item>
239
249
  </template>
240
250
  </el-table-column>
@@ -348,7 +358,7 @@
348
358
  :prop="'containerList.' + index + '.containerDetailList.' + scope.$index + '.goodsNumber'"
349
359
  :rules="subrules.goodsNumber"
350
360
  >
351
- <el-input v-model="scope.row.goodsNumber" size="small" @change="changeTotalGoodsNumber(index)"></el-input>
361
+ <el-input v-model="scope.row.goodsNumber" size="small" @change="changeTotalGoodsNumber(index)" type="number"></el-input>
352
362
  </el-form-item>
353
363
  </template>
354
364
  </el-table-column>
@@ -374,6 +384,7 @@
374
384
  </el-row>
375
385
  </el-form>
376
386
  <div slot="footer" class="dialog-footer">
387
+ <el-button type="warning" @click="onSaveDraft" style="margin-right: 10px">保存草稿</el-button>
377
388
  <el-button type="primary" @click="submitShipment" style="margin-right: 10px">{{ title == '生成装运' ? '仅生成装运' : '保存草稿' }}</el-button>
378
389
  <el-dropdown @command="(command) => handleTemplate(command)" trigger="click" v-if="title == '生成装运'" style="margin-right: 10px">
379
390
  <el-button type="primary">{{ '装运并下载' }}</el-button>
@@ -421,26 +432,46 @@
421
432
  </el-dialog>
422
433
 
423
434
  <select-booking ref="selectBooking" @submit="setBooking" @unSubmit="unSetBooking" />
435
+ <!-- 引用装运 -->
436
+ <reference-alert @referenced="handleReferenced" ref="referenceAlert" />
424
437
  </div>
425
438
  </template>
426
439
 
427
440
  <script>
428
- import { listBizShipment, getBizShipment, delBizShipment, addWithContainer, updateWithContainer, updateWithContainerAndInvoice } from '../../../api/biz/bizShipment'
441
+ import {
442
+ haveVoidShipment,
443
+ listBizShipment,
444
+ getBizShipment,
445
+ delBizShipment,
446
+ addWithContainer,
447
+ addContainerCheck,
448
+ updateWithContainer,
449
+ updateWithContainerAndInvoice,
450
+ saveDraft,
451
+ getDraft
452
+ } from '../../../api/biz/bizShipment'
429
453
  import { generateFinalInvoiceByShipmentId } from '../../../api/biz/bizInvoice'
430
454
  import { updateBizContractDetail } from '../../../api/biz/bizContractDetail'
455
+ import { queryPurchaseContracts } from '../../../api/biz/bizContract'
456
+
431
457
  import { Loading } from 'element-ui'
432
458
  import { listDictData } from '../../../api/biz/dictData'
433
459
  import selectBooking from './selectBooking.vue'
434
460
  import { listBizBooking } from '../../../api/biz/bizBooking'
461
+ import ReferenceAlert from './referenceAlert.vue'
462
+ import { MessageBox } from 'element-ui'
435
463
 
436
464
  export default {
437
465
  name: 'AddShipment',
438
466
  dicts: ['shipping_company'],
439
467
  components: {
440
- selectBooking
468
+ selectBooking,
469
+ ReferenceAlert
441
470
  },
442
471
  data() {
443
472
  return {
473
+ // 已作废的装运合同
474
+ voidInvoiceList: null,
444
475
  //目的地港口列表
445
476
  destinationPortList: [],
446
477
  //折叠面板
@@ -488,7 +519,9 @@ export default {
488
519
  actualArrivalDate: null
489
520
  },
490
521
  // 表单参数
491
- form: {},
522
+ form: {
523
+ etaUpdateOn: true
524
+ },
492
525
  // 表单校验
493
526
  rules: {
494
527
  billOfLadingNo: [{ required: true, message: '提单号不能为空', trigger: 'blur' }],
@@ -523,6 +556,10 @@ export default {
523
556
  default: () => {
524
557
  return null
525
558
  }
559
+ },
560
+ reason: {
561
+ type: String,
562
+ default: ''
526
563
  }
527
564
  },
528
565
  created() {
@@ -563,6 +600,21 @@ export default {
563
600
  }
564
601
  },
565
602
  methods: {
603
+ // 已用的数据,赋值给form
604
+ handleReferenced(data) {
605
+ //shipment, copyFileTypeList
606
+ let contractIds = this.form.contractIds // 保持不变
607
+ this.form = { ...this.form, ...data.shipment, contractIds: contractIds }
608
+ // 需要去掉shipmentId
609
+ this.form.shipmentId = null
610
+ this.form.citeShipmentId = data.shipment.shipmentId
611
+ this.form.copyFileTypeList = data.copyFileTypeList
612
+ console.log('form:', this.form)
613
+ },
614
+ //引用已作废的装运
615
+ handleReference() {
616
+ this.$refs.referenceAlert.handleOpen(this.voidInvoiceList)
617
+ },
566
618
  //编辑开关
567
619
  openEditSwitch() {
568
620
  this.editSwitch = this.editSwitch = true
@@ -620,6 +672,23 @@ export default {
620
672
  return total + Number(item.goodsNumber)
621
673
  }, 0)
622
674
  },
675
+
676
+ limitDecimalPlaces(index, scope1Index, scope2Index, data, type) {
677
+ let value = data[type];
678
+ const decimalPlaces = 3;
679
+ if (!isNaN(value)) {
680
+ value = parseFloat(value).toFixed(decimalPlaces);
681
+ value = parseFloat(value).toString();
682
+ data[type] = value;
683
+ }
684
+ if (type == 'packageGrossWeight') {
685
+ this.changePackageGrossWeight(index, scope1Index, scope2Index);
686
+ } else if (type == 'packageTareWeight') {
687
+ this.changePackageTareWeight(index, scope1Index, scope2Index)
688
+ } else if (type == 'packageNetWeight') {
689
+ }
690
+ },
691
+
623
692
  changePackageGrossWeight(index, k, yindex) {
624
693
  this.form.containerList[index].containerDetailList[k].goodsGrossWeight = this.form.containerList[index].containerDetailList[k].packageList.reduce((total, item) => {
625
694
  return total + Number(item.packageGrossWeight)
@@ -774,6 +843,7 @@ export default {
774
843
  bookingNo: null,
775
844
  billOfLadingNo: null,
776
845
  destinationPort: null,
846
+ purchaseContractNo: null,
777
847
  etd: null,
778
848
  eta: null,
779
849
  actualArrivalDate: null,
@@ -781,6 +851,7 @@ export default {
781
851
  createTime: null,
782
852
  updateTime: null,
783
853
  containerList: [],
854
+ etaUpdateOn: true,
784
855
  loadingTime: this.utc2local(new Date(), 'yyyy-MM-DD HH:mm:ss')
785
856
  }
786
857
  this.contract = {
@@ -836,7 +907,6 @@ export default {
836
907
  /** 新增按钮操作 */
837
908
  handleAdd(contractDetailList, destinationPort, contract) {
838
909
  this.reset()
839
- console.log(contract)
840
910
  if (contract.contractType == 'purchase') {
841
911
  this.$modal.msgError('请选择销售合同')
842
912
  return
@@ -849,19 +919,28 @@ export default {
849
919
  this.contractDetailList = contractDetailList.map((v) => {
850
920
  return { ...v, selected: false }
851
921
  })
852
- var purchaseContractNos = contract?.purchaseContractNos
853
- if (typeof purchaseContractNos == 'string') {
854
- purchaseContractNos = purchaseContractNos?.split(',')
855
- this.contract.purchaseContractNos = purchaseContractNos
856
- if (purchaseContractNos && purchaseContractNos.length == 1) {
857
- this.form.purchaseContractNo = purchaseContractNos[0]
858
- }
859
- } else {
922
+ // 过滤作废的采购合同
923
+ queryPurchaseContracts(contract.contractId).then((res) => {
924
+ let purchaseContractNos = res.rows
860
925
  this.contract.purchaseContractNos = purchaseContractNos
861
926
  if (purchaseContractNos && purchaseContractNos.length == 1) {
862
927
  this.form.purchaseContractNo = purchaseContractNos[0]
863
928
  }
864
- }
929
+ })
930
+ // var purchaseContractNos = contract?.purchaseContractNos
931
+ // if (typeof purchaseContractNos == 'string') {
932
+ // purchaseContractNos = purchaseContractNos?.split(',')
933
+ // this.contract.purchaseContractNos = purchaseContractNos
934
+ // if (purchaseContractNos && purchaseContractNos.length == 1) {
935
+ // this.form.purchaseContractNo = purchaseContractNos[0]
936
+ // }
937
+ // } else {
938
+ // this.contract.purchaseContractNos = purchaseContractNos
939
+ // if (purchaseContractNos && purchaseContractNos.length == 1) {
940
+ // this.form.purchaseContractNo = purchaseContractNos[0]
941
+ // }
942
+ // }
943
+
865
944
  let containerNum = 1
866
945
  this.form.destinationPort = destinationPort
867
946
  this.form.contractIds = Array.from(new Set(contractDetailList.map((i) => i.contractId)))
@@ -879,6 +958,13 @@ export default {
879
958
  .catch((error) => {
880
959
  console.error(error)
881
960
  })
961
+ // 查询是否有可引用的
962
+ haveVoidShipment(contract.contractId).then((res) => {
963
+ this.voidInvoiceList = res.rows && res.rows.length > 0 ? res.rows : null
964
+ })
965
+ this.onGetDraft()
966
+ // 测试数据
967
+ // this.voidInvoiceList = [{'contractId': '1', 'contractNo':'合同号1'}]
882
968
  },
883
969
  /** 修改按钮操作 */
884
970
  handleUpdate(row) {
@@ -993,7 +1079,12 @@ export default {
993
1079
  })
994
1080
  },
995
1081
  //仅生成装运
996
- submitShipment() {
1082
+ async submitShipment() {
1083
+ // 装运前校验
1084
+ let resOK = await this.checkPreShipment()
1085
+ if (!resOK) {
1086
+ return
1087
+ }
997
1088
  this.$refs['form'].validate((valid) => {
998
1089
  if (valid) {
999
1090
  let loadingInstance = Loading.service({
@@ -1036,7 +1127,12 @@ export default {
1036
1127
  })
1037
1128
  },
1038
1129
  //装运并下载
1039
- handleTemplate(command) {
1130
+ async handleTemplate() {
1131
+ // 装运前校验
1132
+ let resOK = await this.checkPreShipment()
1133
+ if (!resOK) {
1134
+ return
1135
+ }
1040
1136
  this.submitAndDownload(command)
1041
1137
  },
1042
1138
  //提交并下载
@@ -1092,8 +1188,30 @@ export default {
1092
1188
  fileName
1093
1189
  )
1094
1190
  },
1191
+ // 装运前校验
1192
+ async checkPreShipment() {
1193
+ let res = await addContainerCheck({
1194
+ billOfLadingNo: this.form.billOfLadingNo,
1195
+ bookingNo: this.form.bookingNo,
1196
+ shipmentId: this.form.shipmentId
1197
+ })
1198
+ if (!res.data.checkShipmentTip) {
1199
+ return true
1200
+ }
1201
+ let result = await MessageBox.confirm(res.data.checkShipmentTip, '提示', {
1202
+ confirmButtonText: '确定',
1203
+ cancelButtonText: '取消',
1204
+ type: 'warning'
1205
+ }).catch((err) => err)
1206
+ return result === 'confirm'
1207
+ },
1095
1208
  /** 提交按钮 */
1096
- submitForm() {
1209
+ async submitForm() {
1210
+ // 装运前校验
1211
+ let resOK = await this.checkPreShipment()
1212
+ if (!resOK) {
1213
+ return
1214
+ }
1097
1215
  this.$refs['form'].validate((valid) => {
1098
1216
  if (valid) {
1099
1217
  let loadingInstance = Loading.service({
@@ -1168,6 +1286,26 @@ export default {
1168
1286
  },
1169
1287
  `bizShipment_${new Date().getTime()}.xlsx`
1170
1288
  )
1289
+ },
1290
+ async onSaveDraft() {
1291
+ if (this.form.contractIds) {
1292
+ this.form.contractId = this.form.contractIds[0]
1293
+ }
1294
+ const res = await saveDraft(this.form)
1295
+ if (res.code === 200) {
1296
+ this.$message.success('保存成功')
1297
+ } else {
1298
+ this.$message.error(res.message)
1299
+ }
1300
+ },
1301
+ async onGetDraft() {
1302
+ if(this.form.contractIds) {
1303
+ const contractId = this.form.contractIds[0]
1304
+ const res = await getDraft(contractId)
1305
+ if (res.data) {
1306
+ this.form = res.data
1307
+ }
1308
+ }
1171
1309
  }
1172
1310
  }
1173
1311
  }
@@ -0,0 +1,168 @@
1
+ <template>
2
+ <div class>
3
+ <el-dialog :title="title" :visible.sync="open" width="75%" append-to-body>
4
+ <el-form ref="form" :model="form" label-width="100%">
5
+ <el-form-item class="vertical-form-item" :required="true" label="请选择您需要复制的装运:">
6
+ <el-row> 合同号 </el-row>
7
+ <el-row>
8
+ <el-select @change="selectContract" v-model="contractId" placeholder="请选择合同号">
9
+ <el-option v-for="(item, i) in shipmentList" :key="i" :label="item.contractNo" :value="item.contractId"></el-option>
10
+ </el-select>
11
+ </el-row>
12
+ <el-row v-if="contractId" style="padding-top: 15px"> 提单号 </el-row>
13
+ <el-row v-if="contractId">
14
+ <el-radio-group v-model="form.citeShipmentId">
15
+ <div v-for="(item, i) in blList" :key="i">
16
+ <el-radio :label="item.shipmentId">
17
+ <span>{{ item.billOfLadingNo }}</span>
18
+ <span v-if="item.citeNumber">(</span>
19
+ <span v-if="item.citeNumber" style="color: red">已被引用过{{ item.citeNumber }}次</span>
20
+ <span v-if="item.citeNumber">)</span>
21
+ </el-radio>
22
+ </div>
23
+ </el-radio-group>
24
+ </el-row>
25
+ </el-form-item>
26
+
27
+ <el-form-item v-if="contractId" class="vertical-form-item" :required="true" label="请选择您需要复制的数据或文件:">
28
+ <el-row> 可复用的文件如下: </el-row>
29
+ <el-row>
30
+ <el-checkbox v-model="isSelectAll" @change="selectAll" label="0">选择全部</el-checkbox>
31
+ </el-row>
32
+ <el-row>
33
+ <el-checkbox-group @change="selectChange" v-model="form.copyFileTypeList">
34
+ <el-checkbox v-for="(item, i) in fileList" :key="i" :label="item.key">{{ item.value }}</el-checkbox>
35
+ </el-checkbox-group>
36
+ </el-row>
37
+ </el-form-item>
38
+ </el-form>
39
+ <div slot="footer" class="dialog-footer">
40
+ <el-button @click="cancel">取 消</el-button>
41
+ <el-button type="primary" @click="submitForm">确 定</el-button>
42
+ </div>
43
+ </el-dialog>
44
+ </div>
45
+ </template>
46
+
47
+ <script>
48
+ import { listBizShipment, getBizShipment } from '../../../api/biz/bizShipment'
49
+
50
+ export default {
51
+ name: 'ReferenceAlert',
52
+ props: {},
53
+ components: {},
54
+ data() {
55
+ return {
56
+ // 弹出层标题
57
+ title: '请确认:',
58
+ // 是否显示弹出层
59
+ open: false,
60
+ // 表单参数
61
+ form: {
62
+ citeShipmentId: null,
63
+ copyFileTypeList: [] // 可复用的文件
64
+ },
65
+ // 选择的合同
66
+ contractId: null,
67
+ // 可引用的数据(销售合同列表)
68
+ shipmentList: null,
69
+ // 合同对应的提单列表
70
+ blList: null,
71
+ isSelectAll: false,
72
+ fileList: [
73
+ { key: 'booking_data', value: '订舱资料' },
74
+ { key: 'packingPhoto', value: '装箱照片' },
75
+ { key: 'draft_bill_of_lading', value: '草稿提单' },
76
+ { key: 'shipment_delivery_receipt', value: '正式提单' }
77
+ ]
78
+ }
79
+ },
80
+ computed: {},
81
+ watch: {},
82
+ methods: {
83
+ selectAll(val) {
84
+ if (val) {
85
+ this.form.copyFileTypeList = this.fileList.map((res) => res.key)
86
+ } else {
87
+ this.form.copyFileTypeList = []
88
+ }
89
+ },
90
+ selectChange(val) {
91
+ this.isSelectAll = this.form.copyFileTypeList.length == 4
92
+ },
93
+ selectContract(val) {
94
+ this.blList = null
95
+ // 获取提单
96
+ listBizShipment({ 'saleContractId': val, 'voidStatus': 1 }).then((res) => {
97
+ this.blList = res.rows
98
+ })
99
+ },
100
+
101
+ /** 提交按钮 */
102
+ submitForm() {
103
+ // 数据校验
104
+ if (!this.contractId) {
105
+ return this.$modal.msgError('请选择合同号')
106
+ }
107
+ if (!this.form.citeShipmentId) {
108
+ return this.$modal.msgError('请选择提单号')
109
+ }
110
+ if (this.form.copyFileTypeList.length == 0) {
111
+ return this.$modal.msgError('请选择您需要复制的数据或文件')
112
+ }
113
+ console.log('form', this.form)
114
+ // 获取详情数据
115
+ const loading = this.openLoading()
116
+ getBizShipment(this.form.citeShipmentId).then((res) => {
117
+ loading.close()
118
+ if (res.code == 200) {
119
+ // 回传数据
120
+ let shipment = res.data
121
+ this.$emit('referenced', { shipment: shipment, copyFileTypeList: this.form.copyFileTypeList })
122
+ this.open = false
123
+ }
124
+ })
125
+ },
126
+ /** 展示按钮操作 */
127
+ handleOpen(shipmentList) {
128
+ this.reset()
129
+ this.shipmentList = shipmentList
130
+ this.open = true
131
+ console.log('shipmentList', shipmentList)
132
+ },
133
+ // 取消按钮
134
+ cancel() {
135
+ this.open = false
136
+ this.reset()
137
+ },
138
+ // 表单重置
139
+ reset() {
140
+ this.shipmentList = null
141
+ this.form = {
142
+ citeShipmentId: null,
143
+ copyFileTypeList: this.fileList.map((res) => res.key) // 可复用的文件
144
+ }
145
+ this.contractId = null
146
+ this.isSelectAll = true
147
+ this.blList = null
148
+ }
149
+ },
150
+ computed: {}
151
+ }
152
+ </script>
153
+ <style lang="scss" scoped>
154
+ // 修改为上下布局
155
+ .vertical-form-item {
156
+ display: block;
157
+ }
158
+ ::v-deep .vertical-form-item .el-form-item__label {
159
+ text-align: left;
160
+ display: block;
161
+ margin-bottom: 5px !important; /* 根据需要调整间距 */
162
+ }
163
+
164
+ ::v-deep .vertical-form-item .el-form-item__content {
165
+ display: block;
166
+ margin-left: 5px !important; /* 重置默认的margin-left,因为标签和输入控件不再水平排列 */
167
+ }
168
+ </style>