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

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 +15 -2
  2. package/package.json +1 -1
  3. package/packages/index.js +16 -1
  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 +1925 -1019
  22. package/packages/src/views/biz/bizFileInfo/contractFile/BillOfLadingNoTab.vue +116 -0
  23. package/packages/src/views/biz/bizFileInfo/contractFile/ContentTitle.vue +102 -0
  24. package/packages/src/views/biz/bizFileInfo/contractFile/IMGPreviewCheckBox.vue +324 -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 +91 -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 +152 -48
  31. package/packages/src/views/biz/bizFileInfo/fileShowClaim.vue +1 -1
  32. package/packages/src/views/biz/bizShipment/add.vue +178 -29
  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 +209 -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,13 @@
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="isDraft" style="color: red">提示: 当前打开了【{{ form.lastUpdateUserName }}】在【{{ form.updateTime }}】保存的装运草稿</span>
7
+ <span v-if="voidInvoiceList" style="color: red">【快捷转卖】:系统检测到此销售合同关联的采购合同存在【已作废】的装运,</span>
8
+ <el-button v-if="voidInvoiceList" @click="handleReference" size="mini" type="text">点击这里直接复制并引用</el-button>
9
+ </slot>
10
+ <div v-if="reason" style="color: #f00; padding-left: 60px; margin-bottom: 10px">{{ reason }}</div>
5
11
  <el-form ref="form" :model="form" :rules="rules" label-position="right" label-width="80px">
6
12
  <el-row>
7
13
  <el-col :span="6">
@@ -11,13 +17,11 @@
11
17
  </el-select>
12
18
  </el-form-item>
13
19
  </el-col>
14
-
15
20
  <el-col :span="6">
16
21
  <el-form-item label="订舱号" prop="bookingNo">
17
22
  <el-input v-model="form.bookingNo" placeholder="请输入订舱号" size="small" />
18
23
  </el-form-item>
19
24
  </el-col>
20
-
21
25
  <el-col :span="6">
22
26
  <el-form-item label="提单号" prop="billOfLadingNo">
23
27
  <el-input v-model="form.billOfLadingNo" placeholder="请输入提单号" size="small" />
@@ -88,11 +92,16 @@
88
92
  <el-row>
89
93
  <el-col :span="8">
90
94
  <el-form-item label="对应采购合同" prop="purchaseContractNo" label-width="100">
91
- <el-select v-model="form.purchaseContractNo" size="small">
95
+ <el-select v-model="form.purchaseContractNo" size="small" clearable="">
92
96
  <el-option v-for="item in contract.purchaseContractNos" :key="item" :label="item" :value="item" />
93
97
  </el-select>
94
98
  </el-form-item>
95
99
  </el-col>
100
+ <el-col :span="8">
101
+ <el-form-item label="ETA更新" prop="etaUpdateOn" label-width="100">
102
+ <el-switch v-model="form.etaUpdateOn" active-text="自动" inactive-text="手动"> </el-switch>
103
+ </el-form-item>
104
+ </el-col>
96
105
  </el-row>
97
106
  <el-table stripe :data="contractDetailList" border>
98
107
  <el-table-column label="序号" type="index" align="center"></el-table-column>
@@ -147,14 +156,14 @@
147
156
  </el-col>
148
157
  <el-col :span="8">
149
158
  <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>
159
+ <el-input v-model="dt.containerTareWeight" placeholder="请输入" size="mini" type="number"></el-input>
151
160
  </el-form-item>
152
161
  </el-col>
153
162
  </el-row>
154
163
  <el-row>
155
164
  <el-col :span="6">
156
165
  <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>
166
+ <el-input v-if="editSwitch" size="mini" v-model="dt.totalGoodsGrossWeight" type="number"></el-input>
158
167
  <div v-else>
159
168
  {{ dt.totalGoodsGrossWeight ? dt.totalGoodsGrossWeight : '自动计算' }}
160
169
  </div>
@@ -162,7 +171,7 @@
162
171
  </el-col>
163
172
  <el-col :span="6">
164
173
  <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>
174
+ <el-input v-if="editSwitch" size="mini" v-model="dt.totalGoodsTareWeight" type="number"></el-input>
166
175
  <div v-else>
167
176
  {{ dt.totalGoodsTareWeight ? dt.totalGoodsTareWeight : '自动计算' }}
168
177
  </div>
@@ -170,7 +179,7 @@
170
179
  </el-col>
171
180
  <el-col :span="6">
172
181
  <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>
182
+ <el-input v-if="editSwitch" size="mini" v-model="dt.totalGoodsNetWeight" type="number"></el-input>
174
183
  <div v-else>
175
184
  {{ dt.totalGoodsNetWeight ? dt.totalGoodsNetWeight : '自动计算' }}
176
185
  </div>
@@ -202,7 +211,8 @@
202
211
  v-model="scope2.row.packageGrossWeight"
203
212
  placeholder="请输入毛重"
204
213
  size="mini"
205
- @input="changePackageGrossWeight(index, scope1.$index, scope2.$index)"
214
+ type="number"
215
+ @input="limitDecimalPlaces(index, scope1.$index, scope2.$index, scope2.row, 'packageGrossWeight')"
206
216
  ></el-input>
207
217
  </el-form-item>
208
218
  </template>
@@ -220,7 +230,8 @@
220
230
  v-model="scope2.row.packageTareWeight"
221
231
  placeholder="请输入皮重"
222
232
  size="mini"
223
- @input="changePackageTareWeight(index, scope1.$index, scope2.$index)"
233
+ type="number"
234
+ @input="limitDecimalPlaces(index, scope1.$index, scope2.$index, scope2.row, 'packageTareWeight')"
224
235
  ></el-input>
225
236
  </el-form-item>
226
237
  </template>
@@ -234,7 +245,13 @@
234
245
  :rules="rules.packageNetWeight"
235
246
  :prop="'containerList.' + index + '.containerDetailList.' + scope1.$index + '.packageList.' + scope2.$index + '.packageNetWeight'"
236
247
  >
237
- <el-input v-model="scope2.row.packageNetWeight" placeholder="请输入净重" size="mini"></el-input>
248
+ <el-input
249
+ v-model="scope2.row.packageNetWeight"
250
+ placeholder="请输入净重"
251
+ size="mini"
252
+ type="number"
253
+ @input="limitDecimalPlaces(index, scope1.$index, scope2.$index, scope2.row, 'packageNetWeight')"
254
+ ></el-input>
238
255
  </el-form-item>
239
256
  </template>
240
257
  </el-table-column>
@@ -348,7 +365,7 @@
348
365
  :prop="'containerList.' + index + '.containerDetailList.' + scope.$index + '.goodsNumber'"
349
366
  :rules="subrules.goodsNumber"
350
367
  >
351
- <el-input v-model="scope.row.goodsNumber" size="small" @change="changeTotalGoodsNumber(index)"></el-input>
368
+ <el-input v-model="scope.row.goodsNumber" size="small" @change="changeTotalGoodsNumber(index)" type="number"></el-input>
352
369
  </el-form-item>
353
370
  </template>
354
371
  </el-table-column>
@@ -374,6 +391,7 @@
374
391
  </el-row>
375
392
  </el-form>
376
393
  <div slot="footer" class="dialog-footer">
394
+ <el-button type="warning" @click="onSaveDraft" style="margin-right: 10px" v-if="title === '生成装运'">保存草稿</el-button>
377
395
  <el-button type="primary" @click="submitShipment" style="margin-right: 10px">{{ title == '生成装运' ? '仅生成装运' : '保存草稿' }}</el-button>
378
396
  <el-dropdown @command="(command) => handleTemplate(command)" trigger="click" v-if="title == '生成装运'" style="margin-right: 10px">
379
397
  <el-button type="primary">{{ '装运并下载' }}</el-button>
@@ -421,26 +439,46 @@
421
439
  </el-dialog>
422
440
 
423
441
  <select-booking ref="selectBooking" @submit="setBooking" @unSubmit="unSetBooking" />
442
+ <!-- 引用装运 -->
443
+ <reference-alert @referenced="handleReferenced" ref="referenceAlert" />
424
444
  </div>
425
445
  </template>
426
446
 
427
447
  <script>
428
- import { listBizShipment, getBizShipment, delBizShipment, addWithContainer, updateWithContainer, updateWithContainerAndInvoice } from '../../../api/biz/bizShipment'
448
+ import {
449
+ haveVoidShipment,
450
+ listBizShipment,
451
+ getBizShipment,
452
+ delBizShipment,
453
+ addWithContainer,
454
+ addContainerCheck,
455
+ updateWithContainer,
456
+ updateWithContainerAndInvoice,
457
+ saveDraft,
458
+ getDraft
459
+ } from '../../../api/biz/bizShipment'
429
460
  import { generateFinalInvoiceByShipmentId } from '../../../api/biz/bizInvoice'
430
461
  import { updateBizContractDetail } from '../../../api/biz/bizContractDetail'
462
+ import { queryPurchaseContracts } from '../../../api/biz/bizContract'
463
+
431
464
  import { Loading } from 'element-ui'
432
465
  import { listDictData } from '../../../api/biz/dictData'
433
466
  import selectBooking from './selectBooking.vue'
434
467
  import { listBizBooking } from '../../../api/biz/bizBooking'
468
+ import ReferenceAlert from './referenceAlert.vue'
469
+ import { MessageBox } from 'element-ui'
435
470
 
436
471
  export default {
437
472
  name: 'AddShipment',
438
473
  dicts: ['shipping_company'],
439
474
  components: {
440
- selectBooking
475
+ selectBooking,
476
+ ReferenceAlert
441
477
  },
442
478
  data() {
443
479
  return {
480
+ // 已作废的装运合同
481
+ voidInvoiceList: null,
444
482
  //目的地港口列表
445
483
  destinationPortList: [],
446
484
  //折叠面板
@@ -488,7 +526,9 @@ export default {
488
526
  actualArrivalDate: null
489
527
  },
490
528
  // 表单参数
491
- form: {},
529
+ form: {
530
+ etaUpdateOn: true
531
+ },
492
532
  // 表单校验
493
533
  rules: {
494
534
  billOfLadingNo: [{ required: true, message: '提单号不能为空', trigger: 'blur' }],
@@ -514,7 +554,8 @@ export default {
514
554
  //编辑开关
515
555
  editSwitch: false,
516
556
  //
517
- currentRow: null
557
+ currentRow: null,
558
+ isDraft: false
518
559
  }
519
560
  },
520
561
  props: {
@@ -523,6 +564,10 @@ export default {
523
564
  default: () => {
524
565
  return null
525
566
  }
567
+ },
568
+ reason: {
569
+ type: String,
570
+ default: ''
526
571
  }
527
572
  },
528
573
  created() {
@@ -563,6 +608,21 @@ export default {
563
608
  }
564
609
  },
565
610
  methods: {
611
+ // 已用的数据,赋值给form
612
+ handleReferenced(data) {
613
+ //shipment, copyFileTypeList
614
+ let contractIds = this.form.contractIds // 保持不变
615
+ this.form = { ...this.form, ...data.shipment, contractIds: contractIds }
616
+ // 需要去掉shipmentId
617
+ this.form.shipmentId = null
618
+ this.form.citeShipmentId = data.shipment.shipmentId
619
+ this.form.copyFileTypeList = data.copyFileTypeList
620
+ console.log('form:', this.form)
621
+ },
622
+ //引用已作废的装运
623
+ handleReference() {
624
+ this.$refs.referenceAlert.handleOpen(this.voidInvoiceList)
625
+ },
566
626
  //编辑开关
567
627
  openEditSwitch() {
568
628
  this.editSwitch = this.editSwitch = true
@@ -620,6 +680,23 @@ export default {
620
680
  return total + Number(item.goodsNumber)
621
681
  }, 0)
622
682
  },
683
+
684
+ limitDecimalPlaces(index, scope1Index, scope2Index, data, type) {
685
+ let value = data[type]
686
+ const decimalPlaces = 3
687
+ if (!isNaN(value)) {
688
+ value = parseFloat(value).toFixed(decimalPlaces)
689
+ value = parseFloat(value).toString()
690
+ data[type] = value
691
+ }
692
+ if (type == 'packageGrossWeight') {
693
+ this.changePackageGrossWeight(index, scope1Index, scope2Index)
694
+ } else if (type == 'packageTareWeight') {
695
+ this.changePackageTareWeight(index, scope1Index, scope2Index)
696
+ } else if (type == 'packageNetWeight') {
697
+ }
698
+ },
699
+
623
700
  changePackageGrossWeight(index, k, yindex) {
624
701
  this.form.containerList[index].containerDetailList[k].goodsGrossWeight = this.form.containerList[index].containerDetailList[k].packageList.reduce((total, item) => {
625
702
  return total + Number(item.packageGrossWeight)
@@ -774,6 +851,7 @@ export default {
774
851
  bookingNo: null,
775
852
  billOfLadingNo: null,
776
853
  destinationPort: null,
854
+ purchaseContractNo: null,
777
855
  etd: null,
778
856
  eta: null,
779
857
  actualArrivalDate: null,
@@ -781,6 +859,7 @@ export default {
781
859
  createTime: null,
782
860
  updateTime: null,
783
861
  containerList: [],
862
+ etaUpdateOn: true,
784
863
  loadingTime: this.utc2local(new Date(), 'yyyy-MM-DD HH:mm:ss')
785
864
  }
786
865
  this.contract = {
@@ -836,7 +915,6 @@ export default {
836
915
  /** 新增按钮操作 */
837
916
  handleAdd(contractDetailList, destinationPort, contract) {
838
917
  this.reset()
839
- console.log(contract)
840
918
  if (contract.contractType == 'purchase') {
841
919
  this.$modal.msgError('请选择销售合同')
842
920
  return
@@ -849,19 +927,28 @@ export default {
849
927
  this.contractDetailList = contractDetailList.map((v) => {
850
928
  return { ...v, selected: false }
851
929
  })
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 {
930
+ // 过滤作废的采购合同
931
+ queryPurchaseContracts(contract.contractId).then((res) => {
932
+ let purchaseContractNos = res.rows
860
933
  this.contract.purchaseContractNos = purchaseContractNos
861
934
  if (purchaseContractNos && purchaseContractNos.length == 1) {
862
935
  this.form.purchaseContractNo = purchaseContractNos[0]
863
936
  }
864
- }
937
+ })
938
+ // var purchaseContractNos = contract?.purchaseContractNos
939
+ // if (typeof purchaseContractNos == 'string') {
940
+ // purchaseContractNos = purchaseContractNos?.split(',')
941
+ // this.contract.purchaseContractNos = purchaseContractNos
942
+ // if (purchaseContractNos && purchaseContractNos.length == 1) {
943
+ // this.form.purchaseContractNo = purchaseContractNos[0]
944
+ // }
945
+ // } else {
946
+ // this.contract.purchaseContractNos = purchaseContractNos
947
+ // if (purchaseContractNos && purchaseContractNos.length == 1) {
948
+ // this.form.purchaseContractNo = purchaseContractNos[0]
949
+ // }
950
+ // }
951
+
865
952
  let containerNum = 1
866
953
  this.form.destinationPort = destinationPort
867
954
  this.form.contractIds = Array.from(new Set(contractDetailList.map((i) => i.contractId)))
@@ -879,6 +966,13 @@ export default {
879
966
  .catch((error) => {
880
967
  console.error(error)
881
968
  })
969
+ // 查询是否有可引用的
970
+ haveVoidShipment(contract.contractId).then((res) => {
971
+ this.voidInvoiceList = res.rows && res.rows.length > 0 ? res.rows : null
972
+ })
973
+ this.onGetDraft()
974
+ // 测试数据
975
+ // this.voidInvoiceList = [{'contractId': '1', 'contractNo':'合同号1'}]
882
976
  },
883
977
  /** 修改按钮操作 */
884
978
  handleUpdate(row) {
@@ -993,7 +1087,12 @@ export default {
993
1087
  })
994
1088
  },
995
1089
  //仅生成装运
996
- submitShipment() {
1090
+ async submitShipment() {
1091
+ // 装运前校验
1092
+ let resOK = await this.checkPreShipment()
1093
+ if (!resOK) {
1094
+ return
1095
+ }
997
1096
  this.$refs['form'].validate((valid) => {
998
1097
  if (valid) {
999
1098
  let loadingInstance = Loading.service({
@@ -1036,7 +1135,12 @@ export default {
1036
1135
  })
1037
1136
  },
1038
1137
  //装运并下载
1039
- handleTemplate(command) {
1138
+ async handleTemplate() {
1139
+ // 装运前校验
1140
+ let resOK = await this.checkPreShipment()
1141
+ if (!resOK) {
1142
+ return
1143
+ }
1040
1144
  this.submitAndDownload(command)
1041
1145
  },
1042
1146
  //提交并下载
@@ -1092,8 +1196,30 @@ export default {
1092
1196
  fileName
1093
1197
  )
1094
1198
  },
1199
+ // 装运前校验
1200
+ async checkPreShipment() {
1201
+ let res = await addContainerCheck({
1202
+ billOfLadingNo: this.form.billOfLadingNo,
1203
+ bookingNo: this.form.bookingNo,
1204
+ shipmentId: this.form.shipmentId
1205
+ })
1206
+ if (!res.data.checkShipmentTip) {
1207
+ return true
1208
+ }
1209
+ let result = await MessageBox.confirm(res.data.checkShipmentTip, '提示', {
1210
+ confirmButtonText: '确定',
1211
+ cancelButtonText: '取消',
1212
+ type: 'warning'
1213
+ }).catch((err) => err)
1214
+ return result === 'confirm'
1215
+ },
1095
1216
  /** 提交按钮 */
1096
- submitForm() {
1217
+ async submitForm() {
1218
+ // 装运前校验
1219
+ let resOK = await this.checkPreShipment()
1220
+ if (!resOK) {
1221
+ return
1222
+ }
1097
1223
  this.$refs['form'].validate((valid) => {
1098
1224
  if (valid) {
1099
1225
  let loadingInstance = Loading.service({
@@ -1168,6 +1294,29 @@ export default {
1168
1294
  },
1169
1295
  `bizShipment_${new Date().getTime()}.xlsx`
1170
1296
  )
1297
+ },
1298
+ async onSaveDraft() {
1299
+ if (this.form.contractIds) {
1300
+ this.form.contractId = this.form.contractIds[0]
1301
+ }
1302
+ const res = await saveDraft(this.form)
1303
+ if (res.code === 200) {
1304
+ this.$message.success('保存成功')
1305
+ } else {
1306
+ this.$message.error(res.message)
1307
+ }
1308
+ },
1309
+ async onGetDraft() {
1310
+ if (this.form.contractIds) {
1311
+ const contractId = this.form.contractIds[0]
1312
+ const res = await getDraft(contractId)
1313
+ if (res.data) {
1314
+ this.isDraft = true
1315
+ this.form = res.data
1316
+ } else {
1317
+ this.isDraft = false
1318
+ }
1319
+ }
1171
1320
  }
1172
1321
  }
1173
1322
  }
@@ -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>