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

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 (46) 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 +18 -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/index.js +35 -0
  18. 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
  19. package/packages/src/views/biz/bizFileInfo/contract copy.vue +1711 -0
  20. package/packages/src/views/biz/bizFileInfo/contract.vue +1783 -986
  21. package/packages/src/views/biz/bizFileInfo/contractFile/BillOfLadingNoTab.vue +114 -0
  22. package/packages/src/views/biz/bizFileInfo/contractFile/ContentTitle.vue +102 -0
  23. package/packages/src/views/biz/bizFileInfo/contractFile/IMGPreviewCheckBox.vue +308 -0
  24. package/packages/src/views/biz/bizFileInfo/contractFile/Progress.vue +85 -0
  25. package/packages/src/views/biz/bizFileInfo/contractFile/ProgressDetail.vue +123 -0
  26. package/packages/src/views/biz/bizFileInfo/contractFile/SectionSlot.vue +83 -0
  27. package/packages/src/views/biz/bizFileInfo/contractFile/ShowAndHide.vue +178 -0
  28. package/packages/src/views/biz/bizFileInfo/fileShow copy.vue +321 -0
  29. package/packages/src/views/biz/bizFileInfo/fileShow.vue +143 -47
  30. package/packages/src/views/biz/bizFileInfo/fileShowClaim.vue +1 -1
  31. package/packages/src/views/biz/bizShipment/add.vue +124 -23
  32. package/packages/src/views/biz/bizShipment/referenceAlert.vue +168 -0
  33. package/packages/src/views/biz/contractTracing/billInfo.vue +64 -40
  34. package/packages/src/views/biz/contractTracing/companyBanks.vue +228 -0
  35. package/packages/src/views/biz/contractTracing/contractInfo.vue +1 -1
  36. package/packages/src/views/biz/contractTracing/contractPdf.vue +7 -4
  37. package/packages/src/views/biz/contractTracing/contractSummary.vue +24 -18
  38. package/packages/src/views/biz/contractTracing/contractTracingDetail copy.vue +107 -0
  39. package/packages/src/views/biz/contractTracing/contractTracingDetail.vue +281 -31
  40. package/packages/src/views/biz/contractTracing/editBill.vue +22 -9
  41. package/packages/src/views/biz/contractTracing/purchaseInvoiceUpload.vue +153 -7
  42. package/packages/src/views/biz/contractTracing/shipmentPurchaseAmount.vue +14 -0
  43. package/packages/src/views/biz/contractTracing/subCompanyDialog.vue +8 -2
  44. package/packages/src/views/components/RegionPicker/Distpicker.vue +459 -0
  45. package/packages/src/views/components/RegionPicker/districts.js +4641 -0
  46. package/packages/src/views/test.vue +3 -3
@@ -1,34 +1,55 @@
1
1
  <template>
2
2
  <div class="file-info" v-if="fileInfo.url">
3
3
  <div class="main">
4
- <el-checkbox v-if="!this.hiddenOperation" label="" @change="handleCheck"> </el-checkbox>
4
+ <el-checkbox v-if="!this.hiddenOperation" label="" class="checkbox-position" @change="handleCheck" v-model="checkFlag">
5
+ </el-checkbox>
5
6
  <div class="area">
6
7
  <div class="area-info">
7
- <div class="area-pdf" v-if="fileInfo.ext == '.pdf'"></div>
8
- <el-image style="width: 54px; height: 54px" :src="fileInfo.url" fit="contain" :preview-src-list="[fileInfo.url]" v-else-if="isImage(fileInfo.ext)"></el-image>
8
+ <div class="area-pdf" v-if="isPdf(fileInfo.url)"></div>
9
+ <el-image style="width: 38px; height: 46px" :src="fileInfo.url" fit="contain" :preview-src-list="[fileInfo.url]" v-else-if="isImage(fileInfo.url)"></el-image>
9
10
  <div class="area-file" v-else></div>
10
- <el-button type="text" size="mini" class="ml5" @click="openFile(fileInfo.url)">{{ $t('contractDetail.preview') }}</el-button>
11
- <el-button type="text" size="mini" @click="handleDownload">
12
- {{ $t('contractDetail.download') }}
13
- </el-button>
14
- </div>
15
- <div v-if="!this.hiddenOperation">
16
- <el-dropdown trigger="click" @command="handleCommand">
17
- <span class="el-dropdown-link">
11
+ <div>
12
+ <div> {{ fileInfo.fileName }}</div>
13
+ <div class="preview-download-root">
14
+ <div
15
+ v-if="!fileInfo.downloadUrl"
16
+ type="text"
17
+ size="mini"
18
+ class="preview-download"
19
+ @click="openFile(fileInfo.url)"
20
+ >{{ $t("contractDetail.preview") }}</div
21
+ >
22
+ <div class="preview-download" type="text" size="mini" @click="handleDownload">
23
+ {{ $t("contractDetail.download") }}
24
+ </div>
25
+ <div v-if="!this.hiddenOperation">
26
+ <el-dropdown trigger="click" @command="handleCommand">
27
+ <span class="el-dropdown-link">
28
+ <div class="more-icon"></div>
29
+ </span>
30
+
31
+ <el-dropdown-menu slot="dropdown" v-if="type == 'signContract'" >
32
+ <el-dropdown-item command="signContract">
33
+ {{ $t('contractDetail.withdraw_sign') }}
34
+ </el-dropdown-item>
35
+ <el-dropdown-item command="rename">{{$t('contractDetail.rename')}}</el-dropdown-item>
36
+ </el-dropdown-menu>
37
+ <el-dropdown-menu slot="dropdown" v-else >
38
+ <el-dropdown-item command="delete">{{
39
+ $t("contractDetail.delete")
40
+ }}</el-dropdown-item>
41
+ <el-dropdown-item command="rename">{{$t('contractDetail.rename')}}</el-dropdown-item>
42
+ <!-- <el-dropdown-item command="deleteAndUpload">
43
+ {{ $t("contractDetail.deleteAndUpload") }}
44
+ </el-dropdown-item> -->
45
+ </el-dropdown-menu>
46
+ </el-dropdown>
47
+ </div>
48
+ <!-- <div v-else style="width:120px;word-break:break-all">
18
49
  {{ fileInfo.fileName }}
19
- <i class="el-icon-arrow-down el-icon--right"></i>
20
- </span>
21
- <el-dropdown-menu slot="dropdown">
22
- <el-dropdown-item command="delete">{{ $t('contractDetail.delete') }}</el-dropdown-item>
23
- <el-dropdown-item command="rename">重命名</el-dropdown-item>
24
- <el-dropdown-item command="deleteAndUpload">
25
- {{ $t('contractDetail.deleteAndUpload') }}
26
- </el-dropdown-item>
27
- </el-dropdown-menu>
28
- </el-dropdown>
29
- </div>
30
- <div v-else style="width: 120px; word-break: break-all">
31
- {{ fileInfo.fileName }}
50
+ </div> -->
51
+ </div>
52
+ </div>
32
53
  </div>
33
54
  </div>
34
55
  </div>
@@ -37,7 +58,7 @@
37
58
  <el-dialog :title="title" :visible.sync="open" width="550px" append-to-body>
38
59
  <el-form ref="form" :model="form" label-width="100px">
39
60
  <el-form-item :label="$t('contractDetail.fileNmae')" prop="fileName">
40
- <el-input v-model="form.fileName" placeholder="请输入文件名" />
61
+ <el-input v-model="form.fileName" :placeholder="$t('contractDetail.Please_enter_a_file_name')" />
41
62
  </el-form-item>
42
63
  </el-form>
43
64
  <div slot="footer" class="dialog-footer">
@@ -60,7 +81,9 @@
60
81
  </template>
61
82
  <script>
62
83
  import { downloadFile } from '../../../utils/request'
63
- import { getBizFileInfo, delBizFileInfo, addBizFileInfo, updateBizFileInfo } from '../../../api/biz/bizFileInfo'
84
+ import { getBizFileInfo, delBizFileInfo, addBizFileInfo, updateBizFileInfo, shipmentWithDrawDraftBill } from '../../../api/biz/bizFileInfo'
85
+ import { isImage, isPdf } from '../../../utils/index';
86
+
64
87
  export default {
65
88
  name: 'FileShow',
66
89
  props: {
@@ -75,14 +98,26 @@ export default {
75
98
  }
76
99
  }
77
100
  },
101
+ selectFileListProp: {
102
+ type: Array,
103
+ default: () => {
104
+ return []
105
+ }
106
+ },
78
107
  //是否隐藏操作
79
108
  hiddenOperation: {
80
109
  type: Boolean,
81
- default: false
82
- }
110
+ default: false,
111
+ },
112
+ type: {
113
+ type: String,
114
+ default: '',
115
+ },
83
116
  },
84
117
  data() {
85
118
  return {
119
+ isImage,
120
+ isPdf,
86
121
  checkedIds: [],
87
122
  //是否显示上传弹出层
88
123
  uploadOpen: false,
@@ -93,9 +128,10 @@ export default {
93
128
  // 表单参数
94
129
  form: {},
95
130
  //上传表单
96
- uploadForm: {}
131
+ uploadForm: {},
132
+ checkFlag: false
97
133
  }
98
- },
134
+ },
99
135
  computed: {
100
136
  fileId() {
101
137
  return this.fileInfo.fileId
@@ -172,8 +208,15 @@ export default {
172
208
  return delBizFileInfo(fileIds)
173
209
  })
174
210
  .then(() => {
175
- this.$emit('refresh')
176
- this.$modal.msgSuccess('删除成功')
211
+ if(row.fileType == "draft_bill_of_lading") {
212
+ shipmentWithDrawDraftBill({shipmentId:row.linkId}).then(() => {
213
+ this.$emit('refresh')
214
+ this.$modal.msgSuccess('删除成功')
215
+ })
216
+ } else {
217
+ this.$emit('refresh')
218
+ this.$modal.msgSuccess('删除成功')
219
+ }
177
220
  })
178
221
  .catch(() => {})
179
222
  },
@@ -207,26 +250,36 @@ export default {
207
250
  },
208
251
  handleCommand(command) {
209
252
  switch (command) {
210
- case 'delete':
211
- this.handleDelete(this.fileInfo)
212
- break
213
- case 'rename':
214
- this.handleUpdate(this.fileInfo)
215
- break
216
- case 'deleteAndUpload':
217
- this.handleDeleteAndUpload(this.fileInfo)
218
- break
253
+ case "delete":
254
+ this.handleDelete(this.fileInfo);
255
+ break;
256
+ case "rename":
257
+ this.handleUpdate(this.fileInfo);
258
+ break;
259
+ case "signContract":
260
+ this.$emit("signContract", this.fileInfo);
261
+ break;
262
+ case "deleteAndUpload":
263
+ this.handleDeleteAndUpload(this.fileInfo);
264
+ break;
219
265
  default:
220
266
  break
221
267
  }
222
268
  },
223
- isImage(ext) {
224
- return ['.jpg', '.jpeg', '.png', '.gif'].includes(ext)
225
- },
226
269
  /** 下载文件 */
227
270
  handleDownload() {
228
271
  // this.download(this.fileInfo.url, {}, this.fileInfo.fileName);
229
- downloadFile(this.fileInfo.url, this.fileInfo.fileName)
272
+ if(this.fileInfo.downloadUrl) {
273
+ let filename
274
+ if (this.fileInfo.billType === 'receipt') {
275
+ filename = 'DebitNote ' + this.fileInfo.billNo + '.pdf'
276
+ } else {
277
+ filename = 'CreditNote ' + this.fileInfo.billNo + '.pdf'
278
+ }
279
+ this.$download.zip('/bill/download?id=' + this.fileInfo.id, filename)
280
+ } else {
281
+ downloadFile(this.fileInfo.url, this.fileInfo.fileName)
282
+ }
230
283
  },
231
284
  openFile(url) {
232
285
  window.open(url)
@@ -234,20 +287,36 @@ export default {
234
287
  handleCheck(val) {
235
288
  if (val) {
236
289
  this.$emit('checked', this.fileInfo)
290
+ this.checkFlag = true
237
291
  } else {
238
292
  this.$emit('uncheck', this.fileInfo.fileId)
293
+ this.checkFlag = false
239
294
  }
240
295
  }
296
+ },
297
+ watch: {
298
+ selectFileListProp: {
299
+ handler(val) {
300
+ if(val == 0) {
301
+ this.checkFlag = false
302
+ }
303
+ },
304
+ immediate: true,
305
+ deep: true
306
+ }
241
307
  }
242
308
  }
243
309
  </script>
244
310
  <style lang="scss" scoped>
245
311
  .file-info {
246
- width: 160px;
312
+ min-width: 450px;
247
313
  display: flex;
248
314
  // border: 1px solid red;
249
315
  .main {
250
316
  display: flex;
317
+ .checkbox-position {
318
+ margin-top: 10px;
319
+ }
251
320
  .area {
252
321
  margin-left: 5px;
253
322
  width: 100%;
@@ -258,7 +327,7 @@ export default {
258
327
  .area-pdf {
259
328
  width: 38px;
260
329
  height: 46px;
261
- background: url('../../../assets/images/pdf.png') no-repeat center;
330
+ background: url("../../../assets/images/pdf-new.png") no-repeat center;
262
331
  background-size: contain;
263
332
  }
264
333
  .area-file {
@@ -267,6 +336,33 @@ export default {
267
336
  background: url('../../../assets/images/file.png') no-repeat center;
268
337
  background-size: contain;
269
338
  }
339
+ .more-icon {
340
+ margin-left:10px;
341
+ cursor: pointer;
342
+ width: 20px;
343
+ height: 20px;
344
+ background: url("../../../assets/images/more.png") no-repeat center;
345
+ background-size: contain;
346
+ }
347
+ .preview-download-root {
348
+ display:flex;
349
+ margin-top:5px;
350
+
351
+ .preview-download {
352
+ cursor: pointer;
353
+ margin-left:8px;
354
+ min-width: 45px;
355
+ width:max-content;
356
+ padding: 0 10px;
357
+ height: 21px;
358
+ text-align: center;
359
+ line-height: 17px;
360
+ background: #FFFFFF;
361
+ border-radius: 11px;
362
+ font-size:12px;
363
+ border: 2px solid #D1D3D4;
364
+ }
365
+ }
270
366
  }
271
367
  }
272
368
  .filename {
@@ -269,7 +269,7 @@ export default {
269
269
  .area-pdf {
270
270
  width: 38px;
271
271
  height: 46px;
272
- background-image: url("../../../assets/images/pdf.png") no-repeat
272
+ background-image: url("../../../assets/images/pdf-new.png") no-repeat
273
273
  center;
274
274
  background-size: contain;
275
275
  }
@@ -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">
5
+ <slot name="">
6
+ <span>{{ title }}</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">
@@ -88,11 +94,16 @@
88
94
  <el-row>
89
95
  <el-col :span="8">
90
96
  <el-form-item label="对应采购合同" prop="purchaseContractNo" label-width="100">
91
- <el-select v-model="form.purchaseContractNo" size="small">
97
+ <el-select v-model="form.purchaseContractNo" size="small" clearable="">
92
98
  <el-option v-for="item in contract.purchaseContractNos" :key="item" :label="item" :value="item" />
93
99
  </el-select>
94
100
  </el-form-item>
95
101
  </el-col>
102
+ <el-col :span="8">
103
+ <el-form-item label="ETA更新" prop="etaUpdateOn" label-width="100">
104
+ <el-switch v-model="form.etaUpdateOn" active-text="自动" inactive-text="手动"> </el-switch>
105
+ </el-form-item>
106
+ </el-col>
96
107
  </el-row>
97
108
  <el-table stripe :data="contractDetailList" border>
98
109
  <el-table-column label="序号" type="index" align="center"></el-table-column>
@@ -147,14 +158,14 @@
147
158
  </el-col>
148
159
  <el-col :span="8">
149
160
  <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>
161
+ <el-input v-model="dt.containerTareWeight" placeholder="请输入" size="mini" type="number"></el-input>
151
162
  </el-form-item>
152
163
  </el-col>
153
164
  </el-row>
154
165
  <el-row>
155
166
  <el-col :span="6">
156
167
  <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>
168
+ <el-input v-if="editSwitch" size="mini" v-model="dt.totalGoodsGrossWeight" type="number"></el-input>
158
169
  <div v-else>
159
170
  {{ dt.totalGoodsGrossWeight ? dt.totalGoodsGrossWeight : '自动计算' }}
160
171
  </div>
@@ -162,7 +173,7 @@
162
173
  </el-col>
163
174
  <el-col :span="6">
164
175
  <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>
176
+ <el-input v-if="editSwitch" size="mini" v-model="dt.totalGoodsTareWeight" type="number"></el-input>
166
177
  <div v-else>
167
178
  {{ dt.totalGoodsTareWeight ? dt.totalGoodsTareWeight : '自动计算' }}
168
179
  </div>
@@ -170,7 +181,7 @@
170
181
  </el-col>
171
182
  <el-col :span="6">
172
183
  <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>
184
+ <el-input v-if="editSwitch" size="mini" v-model="dt.totalGoodsNetWeight" type="number"></el-input>
174
185
  <div v-else>
175
186
  {{ dt.totalGoodsNetWeight ? dt.totalGoodsNetWeight : '自动计算' }}
176
187
  </div>
@@ -202,6 +213,7 @@
202
213
  v-model="scope2.row.packageGrossWeight"
203
214
  placeholder="请输入毛重"
204
215
  size="mini"
216
+ type="number"
205
217
  @input="changePackageGrossWeight(index, scope1.$index, scope2.$index)"
206
218
  ></el-input>
207
219
  </el-form-item>
@@ -220,6 +232,7 @@
220
232
  v-model="scope2.row.packageTareWeight"
221
233
  placeholder="请输入皮重"
222
234
  size="mini"
235
+ type="number"
223
236
  @input="changePackageTareWeight(index, scope1.$index, scope2.$index)"
224
237
  ></el-input>
225
238
  </el-form-item>
@@ -234,7 +247,7 @@
234
247
  :rules="rules.packageNetWeight"
235
248
  :prop="'containerList.' + index + '.containerDetailList.' + scope1.$index + '.packageList.' + scope2.$index + '.packageNetWeight'"
236
249
  >
237
- <el-input v-model="scope2.row.packageNetWeight" placeholder="请输入净重" size="mini"></el-input>
250
+ <el-input v-model="scope2.row.packageNetWeight" placeholder="请输入净重" size="mini" type="number"></el-input>
238
251
  </el-form-item>
239
252
  </template>
240
253
  </el-table-column>
@@ -348,7 +361,7 @@
348
361
  :prop="'containerList.' + index + '.containerDetailList.' + scope.$index + '.goodsNumber'"
349
362
  :rules="subrules.goodsNumber"
350
363
  >
351
- <el-input v-model="scope.row.goodsNumber" size="small" @change="changeTotalGoodsNumber(index)"></el-input>
364
+ <el-input v-model="scope.row.goodsNumber" size="small" @change="changeTotalGoodsNumber(index)" type="number"></el-input>
352
365
  </el-form-item>
353
366
  </template>
354
367
  </el-table-column>
@@ -421,26 +434,44 @@
421
434
  </el-dialog>
422
435
 
423
436
  <select-booking ref="selectBooking" @submit="setBooking" @unSubmit="unSetBooking" />
437
+ <!-- 引用装运 -->
438
+ <reference-alert @referenced="handleReferenced" ref="referenceAlert" />
424
439
  </div>
425
440
  </template>
426
441
 
427
442
  <script>
428
- import { listBizShipment, getBizShipment, delBizShipment, addWithContainer, updateWithContainer, updateWithContainerAndInvoice } from '../../../api/biz/bizShipment'
443
+ import {
444
+ haveVoidShipment,
445
+ listBizShipment,
446
+ getBizShipment,
447
+ delBizShipment,
448
+ addWithContainer,
449
+ addContainerCheck,
450
+ updateWithContainer,
451
+ updateWithContainerAndInvoice
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
@@ -774,6 +826,7 @@ export default {
774
826
  bookingNo: null,
775
827
  billOfLadingNo: null,
776
828
  destinationPort: null,
829
+ purchaseContractNo: null,
777
830
  etd: null,
778
831
  eta: null,
779
832
  actualArrivalDate: null,
@@ -781,6 +834,7 @@ export default {
781
834
  createTime: null,
782
835
  updateTime: null,
783
836
  containerList: [],
837
+ etaUpdateOn: true,
784
838
  loadingTime: this.utc2local(new Date(), 'yyyy-MM-DD HH:mm:ss')
785
839
  }
786
840
  this.contract = {
@@ -849,19 +903,28 @@ export default {
849
903
  this.contractDetailList = contractDetailList.map((v) => {
850
904
  return { ...v, selected: false }
851
905
  })
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 {
906
+ // 过滤作废的采购合同
907
+ queryPurchaseContracts(contract.contractId).then((res) => {
908
+ let purchaseContractNos = res.rows
860
909
  this.contract.purchaseContractNos = purchaseContractNos
861
910
  if (purchaseContractNos && purchaseContractNos.length == 1) {
862
911
  this.form.purchaseContractNo = purchaseContractNos[0]
863
912
  }
864
- }
913
+ })
914
+ // var purchaseContractNos = contract?.purchaseContractNos
915
+ // if (typeof purchaseContractNos == 'string') {
916
+ // purchaseContractNos = purchaseContractNos?.split(',')
917
+ // this.contract.purchaseContractNos = purchaseContractNos
918
+ // if (purchaseContractNos && purchaseContractNos.length == 1) {
919
+ // this.form.purchaseContractNo = purchaseContractNos[0]
920
+ // }
921
+ // } else {
922
+ // this.contract.purchaseContractNos = purchaseContractNos
923
+ // if (purchaseContractNos && purchaseContractNos.length == 1) {
924
+ // this.form.purchaseContractNo = purchaseContractNos[0]
925
+ // }
926
+ // }
927
+
865
928
  let containerNum = 1
866
929
  this.form.destinationPort = destinationPort
867
930
  this.form.contractIds = Array.from(new Set(contractDetailList.map((i) => i.contractId)))
@@ -879,6 +942,12 @@ export default {
879
942
  .catch((error) => {
880
943
  console.error(error)
881
944
  })
945
+ // 查询是否有可引用的
946
+ haveVoidShipment(contract.contractId).then((res) => {
947
+ this.voidInvoiceList = res.rows && res.rows.length > 0 ? res.rows : null
948
+ })
949
+ // 测试数据
950
+ // this.voidInvoiceList = [{'contractId': '1', 'contractNo':'合同号1'}]
882
951
  },
883
952
  /** 修改按钮操作 */
884
953
  handleUpdate(row) {
@@ -993,7 +1062,12 @@ export default {
993
1062
  })
994
1063
  },
995
1064
  //仅生成装运
996
- submitShipment() {
1065
+ async submitShipment() {
1066
+ // 装运前校验
1067
+ let resOK = await this.checkPreShipment()
1068
+ if (!resOK) {
1069
+ return
1070
+ }
997
1071
  this.$refs['form'].validate((valid) => {
998
1072
  if (valid) {
999
1073
  let loadingInstance = Loading.service({
@@ -1036,7 +1110,12 @@ export default {
1036
1110
  })
1037
1111
  },
1038
1112
  //装运并下载
1039
- handleTemplate(command) {
1113
+ async handleTemplate() {
1114
+ // 装运前校验
1115
+ let resOK = await this.checkPreShipment()
1116
+ if (!resOK) {
1117
+ return
1118
+ }
1040
1119
  this.submitAndDownload(command)
1041
1120
  },
1042
1121
  //提交并下载
@@ -1092,8 +1171,30 @@ export default {
1092
1171
  fileName
1093
1172
  )
1094
1173
  },
1174
+ // 装运前校验
1175
+ async checkPreShipment() {
1176
+ let res = await addContainerCheck({
1177
+ billOfLadingNo: this.form.billOfLadingNo,
1178
+ bookingNo: this.form.bookingNo,
1179
+ shipmentId: this.form.shipmentId
1180
+ })
1181
+ if (!res.data.checkShipmentTip) {
1182
+ return true
1183
+ }
1184
+ let result = await MessageBox.confirm(res.data.checkShipmentTip, '提示', {
1185
+ confirmButtonText: '确定',
1186
+ cancelButtonText: '取消',
1187
+ type: 'warning'
1188
+ }).catch((err) => err)
1189
+ return result === 'confirm'
1190
+ },
1095
1191
  /** 提交按钮 */
1096
- submitForm() {
1192
+ async submitForm() {
1193
+ // 装运前校验
1194
+ let resOK = await this.checkPreShipment()
1195
+ if (!resOK) {
1196
+ return
1197
+ }
1097
1198
  this.$refs['form'].validate((valid) => {
1098
1199
  if (valid) {
1099
1200
  let loadingInstance = Loading.service({