doctor-admin-components 1.0.13-beta.9 → 1.0.13-pro.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.
@@ -1,19 +1,18 @@
1
1
  <template>
2
2
  <div class="app-container">
3
- <el-dialog
4
- :title="$t('contractDetail.editBLInformation')"
5
- :visible.sync="open"
6
- width="1000px"
7
- append-to-body
8
- >
3
+ <el-dialog :title="$t('contractDetail.editBLInformation')" :visible.sync="open" width="1000px" append-to-body>
9
4
  <div class="contract">
10
5
  <div class="info" id="printPdf">
11
- <div class="title">{{ $t("contract.billTip") }}</div>
6
+ <!-- <div class="title">{{ $t("contract.billTip") }}</div> -->
7
+ <div style="padding-bottom: 20px">
8
+ <span style="font-size: 16px; font-weight: bold"> {{ $t('contractDetail.BLConfirm') + ':' }} </span>
9
+ <el-switch v-model="confirmFlag" :inactive-text="$t('contractDetail.BL_Not_Confirm')" :active-text="$t('contractDetail.BL_Confirmed')"> </el-switch>
10
+ </div>
12
11
  <el-form :model="form" ref="form" size="mini" :rules="rules" label-width="130px">
13
- <el-collapse>
14
- <el-collapse-item v-if="channel !== 'official-website'">
12
+ <el-collapse v-model="expandItems">
13
+ <el-collapse-item name="0" v-if="channel !== 'official-website'">
15
14
  <template slot="title">
16
- <el-row style="width: 75%; ">
15
+ <el-row style="width: 75%">
17
16
  <el-form-item class="mt20" :label="$t('contract.shipper') + ':'">
18
17
  <el-input v-model="form.shipperCompanyName"></el-input>
19
18
  </el-form-item>
@@ -38,69 +37,42 @@
38
37
  <el-switch v-model="form.shipperFlag" active-text="是" inactive-text="否"></el-switch>
39
38
  </el-form-item>
40
39
  </el-collapse-item>
41
- <el-collapse-item>
40
+ <el-collapse-item name="1">
42
41
  <template slot="title">
43
- <el-row style="width: 75%; ">
44
- <el-form-item
45
- class="mt20"
46
- :label="$t('contract.consignee') + ':'"
47
- prop="deliveryCompanyId"
48
- >
42
+ <el-row style="width: 75%">
43
+ <el-form-item class="mt20" :label="$t('contract.consignee') + ':'" prop="deliveryCompanyId">
49
44
  <el-select
50
- style="width: 80%;"
45
+ style="width: 80%"
51
46
  clearable
52
47
  size="mini"
53
48
  v-model="form.deliveryCompanyId"
54
49
  @change="(val) => changeSubCompany(val, 'delivery')"
55
50
  :placeholder="$t('contract.consigneeTip')"
56
51
  >
57
- <el-option
58
- v-for="(item, index) in deliveryCompanyList"
59
- :key="index"
60
- :label="item.companyEnglishName"
61
- :value="item.contractCompanyId"
62
- />
52
+ <el-option v-for="(item, index) in deliveryCompanyList" :key="index" :label="item.companyEnglishName" :value="item.contractCompanyId" />
63
53
  </el-select>
64
- <el-button
65
- style="margin-left: 20px;"
66
- type="primary"
67
- size="mini"
68
- @click.stop="handleSubCompany(form.buyerCompanyId, 'delivery')"
69
- >{{ $t('button.addOrModify') }}</el-button>
54
+ <el-button style="margin-left: 20px" type="primary" size="mini" @click.stop="handleSubCompany(form.buyerCompanyId, 'delivery')">{{
55
+ $t('button.addOrModify')
56
+ }}</el-button>
70
57
  </el-form-item>
71
58
  </el-row>
72
59
  </template>
73
60
  <el-form-item :label="$t('contract.taxId') + ':'">
74
- {{
75
- this.form.deliveryCompany
76
- ? this.form.deliveryCompany.taxNumber
77
- : $t('contract.companyTip')
78
- }}
61
+ {{ this.form.deliveryCompany ? this.form.deliveryCompany.taxNumber : $t('contract.companyTip') }}
79
62
  </el-form-item>
80
63
  <el-form-item :label="$t('contract.consigneeAddress') + ':'">
81
- {{
82
- this.form.deliveryCompany
83
- ? this.form.deliveryCompany.address
84
- : $t('contract.companyTip')
85
- }}
64
+ {{ this.form.deliveryCompany ? this.form.deliveryCompany.address : $t('contract.companyTip') }}
86
65
  </el-form-item>
87
66
  <el-form-item :label="$t('contract.contact') + ':'">
88
- {{
89
- this.form.deliveryCompany
90
- ? this.form.deliveryCompany.contact
91
- : $t('contract.companyTip')
92
- }}
67
+ {{ this.form.deliveryCompany ? this.form.deliveryCompany.contact : $t('contract.companyTip') }}
93
68
  </el-form-item>
94
69
  <el-form-item :label="$t('contract.phoneNumber') + ':'">
95
70
  {{
96
- this.form.deliveryCompany &&
97
- this.form.deliveryCompany.phoneNumber &&
98
- this.form.deliveryCompany.phoneNumber.length > 0
99
- ? this.form.deliveryCompany.phoneNumber.toString()
100
- : this.form.deliveryCompany &&
101
- this.form.deliveryCompany.phoneNumber
102
- ? ''
103
- : $t('contract.companyTip')
71
+ this.form.deliveryCompany && this.form.deliveryCompany.phoneNumber && this.form.deliveryCompany.phoneNumber.length > 0
72
+ ? this.form.deliveryCompany.phoneNumber.toString()
73
+ : this.form.deliveryCompany && this.form.deliveryCompany.phoneNumber
74
+ ? ''
75
+ : $t('contract.companyTip')
104
76
  }}
105
77
  </el-form-item>
106
78
  <el-form-item :label="$t('contract.email') + ':'">
@@ -108,36 +80,22 @@
108
80
  <el-col :span="20">
109
81
  <div style="white-space: pre-line !important">
110
82
  {{
111
- this.form.deliveryCompany &&
112
- this.form.deliveryCompany.email &&
113
- this.form.deliveryCompany.email.length > 0
114
- ? this.form.deliveryCompany.email
115
- .toString()
116
- .replace(/,/g, '\n ')
117
- : $t('contract.companyTip')
83
+ this.form.deliveryCompany && this.form.deliveryCompany.email && this.form.deliveryCompany.email.length > 0
84
+ ? this.form.deliveryCompany.email.toString().replace(/,/g, '\n ')
85
+ : $t('contract.companyTip')
118
86
  }}
119
87
  </div>
120
88
  </el-col>
121
89
  </el-row>
122
90
  </el-form-item>
123
- <el-form-item
124
- label="PAN NO"
125
- >{{ this.form.deliveryCompany ? this.form.deliveryCompany.panNo: $t('contract.companyTip')}}</el-form-item>
126
- <el-form-item
127
- label="IEC CODE"
128
- >{{ this.form.deliveryCompany ? this.form.deliveryCompany.iecCode: $t('contract.companyTip')}}</el-form-item>
129
- <el-form-item
130
- label="GST NUMBER"
131
- >{{ this.form.deliveryCompany ? this.form.deliveryCompany.gstNumber: $t('contract.companyTip')}}</el-form-item>
91
+ <el-form-item label="PAN NO">{{ this.form.deliveryCompany ? this.form.deliveryCompany.panNo : $t('contract.companyTip') }}</el-form-item>
92
+ <el-form-item label="IEC CODE">{{ this.form.deliveryCompany ? this.form.deliveryCompany.iecCode : $t('contract.companyTip') }}</el-form-item>
93
+ <el-form-item label="GST NUMBER">{{ this.form.deliveryCompany ? this.form.deliveryCompany.gstNumber : $t('contract.companyTip') }}</el-form-item>
132
94
  </el-collapse-item>
133
- <el-collapse-item>
95
+ <el-collapse-item name="2">
134
96
  <template slot="title">
135
- <el-row style="width: 75%; ">
136
- <el-form-item
137
- class="mt20"
138
- :label="$t('contract.firstNotifier') + ':'"
139
- prop="notifierCompanyId"
140
- >
97
+ <el-row style="width: 75%">
98
+ <el-form-item class="mt20" :label="$t('contract.firstNotifier') + ':'" prop="notifierCompanyId">
141
99
  <el-select
142
100
  size="mini"
143
101
  style="width: 80%"
@@ -146,53 +104,30 @@
146
104
  placeholder="Please select"
147
105
  clearable
148
106
  >
149
- <el-option
150
- v-for="(item, index) in notifierCompanyList"
151
- :key="index"
152
- :label="item.companyEnglishName"
153
- :value="item.contractCompanyId"
154
- />
107
+ <el-option v-for="(item, index) in notifierCompanyList" :key="index" :label="item.companyEnglishName" :value="item.contractCompanyId" />
155
108
  </el-select>
156
- <el-button
157
- style="margin-left: 20px;"
158
- type="primary"
159
- size="mini"
160
- @click.stop="handleSubCompany(form.buyerCompanyId, 'notifier')"
161
- >{{ $t('button.addOrModify') }}</el-button>
109
+ <el-button style="margin-left: 20px" type="primary" size="mini" @click.stop="handleSubCompany(form.buyerCompanyId, 'notifier')">{{
110
+ $t('button.addOrModify')
111
+ }}</el-button>
162
112
  </el-form-item>
163
113
  </el-row>
164
114
  </template>
165
115
  <el-form-item :label="$t('contract.taxId') + ':'">
166
- {{
167
- this.form.notifierCompany
168
- ? this.form.notifierCompany.taxNumber
169
- : $t('contract.companyTip')
170
- }}
116
+ {{ this.form.notifierCompany ? this.form.notifierCompany.taxNumber : $t('contract.companyTip') }}
171
117
  </el-form-item>
172
118
  <el-form-item :label="$t('contract.notifierAddress') + ':'">
173
- {{
174
- this.form.notifierCompany
175
- ? this.form.notifierCompany.address
176
- : $t('contract.companyTip')
177
- }}
119
+ {{ this.form.notifierCompany ? this.form.notifierCompany.address : $t('contract.companyTip') }}
178
120
  </el-form-item>
179
121
  <el-form-item :label="$t('contract.contact') + ':'">
180
- {{
181
- this.form.notifierCompany
182
- ? this.form.notifierCompany.contact
183
- : $t('contract.companyTip')
184
- }}
122
+ {{ this.form.notifierCompany ? this.form.notifierCompany.contact : $t('contract.companyTip') }}
185
123
  </el-form-item>
186
124
  <el-form-item :label="$t('contract.phoneNumber') + ':'">
187
125
  {{
188
- this.form.notifierCompany &&
189
- this.form.notifierCompany.phoneNumber &&
190
- this.form.notifierCompany.phoneNumber.length > 0
191
- ? this.form.notifierCompany.phoneNumber.toString()
192
- : this.form.notifierCompany &&
193
- this.form.notifierCompany.phoneNumber
194
- ? ''
195
- : $t('contract.companyTip')
126
+ this.form.notifierCompany && this.form.notifierCompany.phoneNumber && this.form.notifierCompany.phoneNumber.length > 0
127
+ ? this.form.notifierCompany.phoneNumber.toString()
128
+ : this.form.notifierCompany && this.form.notifierCompany.phoneNumber
129
+ ? ''
130
+ : $t('contract.companyTip')
196
131
  }}
197
132
  </el-form-item>
198
133
  <el-form-item :label="$t('contract.email') + ':'">
@@ -200,159 +135,92 @@
200
135
  <el-col :span="20">
201
136
  <div style="white-space: pre-line !important">
202
137
  {{
203
- this.form.notifierCompany &&
204
- this.form.notifierCompany.email &&
205
- this.form.notifierCompany.email.length > 0
206
- ? this.form.notifierCompany.email
207
- .toString()
208
- .replace(/,/g, '\n')
209
- : $t('contract.companyTip')
138
+ this.form.notifierCompany && this.form.notifierCompany.email && this.form.notifierCompany.email.length > 0
139
+ ? this.form.notifierCompany.email.toString().replace(/,/g, '\n')
140
+ : $t('contract.companyTip')
210
141
  }}
211
142
  </div>
212
143
  </el-col>
213
144
  </el-row>
214
145
  </el-form-item>
215
- <el-form-item
216
- label="PAN NO"
217
- >{{ this.form.notifierCompany ? this.form.notifierCompany.panNo: $t('contract.companyTip')}}</el-form-item>
218
- <el-form-item
219
- label="IEC CODE"
220
- >{{ this.form.notifierCompany ? this.form.notifierCompany.iecCode: $t('contract.companyTip')}}</el-form-item>
221
- <el-form-item
222
- label="GST NUMBER"
223
- >{{ this.form.notifierCompany ? this.form.notifierCompany.gstNumber: $t('contract.companyTip')}}</el-form-item>
146
+ <el-form-item label="PAN NO">{{ this.form.notifierCompany ? this.form.notifierCompany.panNo : $t('contract.companyTip') }}</el-form-item>
147
+ <el-form-item label="IEC CODE">{{ this.form.notifierCompany ? this.form.notifierCompany.iecCode : $t('contract.companyTip') }}</el-form-item>
148
+ <el-form-item label="GST NUMBER">{{ this.form.notifierCompany ? this.form.notifierCompany.gstNumber : $t('contract.companyTip') }}</el-form-item>
224
149
  </el-collapse-item>
225
- <el-collapse-item>
150
+ <el-collapse-item name="3">
226
151
  <template slot="title">
227
- <el-row style="width: 75%; ">
228
- <el-form-item
229
- class="mt20"
230
- :label="$t('contract.secondNotifier') + ':'"
231
- >{{ "TTYY INTERNATIONAL LIMITED" }}</el-form-item>
152
+ <el-row style="width: 75%">
153
+ <el-form-item class="mt20" :label="$t('contract.secondNotifier') + ':'">{{ 'TTYY INTERNATIONAL LIMITED' }}</el-form-item>
232
154
  </el-row>
233
155
  </template>
234
156
  <el-form-item :label="$t('contract.taxId') + ':'">
235
- {{
236
- "73855725-000-23-0"
237
- }}
157
+ {{ '73855725-000-23-0' }}
238
158
  </el-form-item>
239
159
  <el-form-item :label="$t('contract.notifierAddress') + ':'">
240
- {{
241
- "FLAT/RM 07, 12/F, CHEVALIER COMMERCIAL CENTRE, 8 WANG HOI ROAD, KOWLOON BAY"
242
- }}
160
+ {{ 'FLAT/RM 07, 12/F, CHEVALIER COMMERCIAL CENTRE, 8 WANG HOI ROAD, KOWLOON BAY' }}
243
161
  </el-form-item>
244
162
  <el-form-item :label="$t('contract.contact') + ':'">
245
- {{
246
- "Ms. Zhou"
247
- }}
163
+ {{ 'Ms. Zhou' }}
248
164
  </el-form-item>
249
165
  <el-form-item :label="$t('contract.phoneNumber') + ':'">
250
- {{
251
- "0085221267435"
252
- }}
166
+ {{ '00-852 53816912' }}
253
167
  </el-form-item>
254
- <el-form-item :label="$t('contract.email') + ':'">{{ "info@tyzltech.com" }}</el-form-item>
168
+ <el-form-item :label="$t('contract.email') + ':'">{{ 'info@tyzltech.com' }}</el-form-item>
255
169
  </el-collapse-item>
256
170
  </el-collapse>
257
171
 
258
172
  <el-form-item :label="$t('contract.destination') + ':'">
259
- {{
260
- this.contract && this.contract.destination
261
- ? this.contract.destination
262
- : ""
263
- }}
173
+ {{ this.contract && this.contract.destination ? this.contract.destination : '' }}
264
174
  </el-form-item>
265
175
  <el-form-item :label="$t('contract.terminal') + ':'" prop="terminal">
266
- <el-input
267
- v-model="form.terminal"
268
- type="textarea"
269
- autosize
270
- :placeholder="$t('contract.terminalTip')"
271
- ></el-input>
176
+ <el-input v-model="form.terminal" type="textarea" autosize :placeholder="$t('contract.terminalTip')"></el-input>
272
177
  </el-form-item>
273
178
 
274
179
  <el-row class="bl-goods">
275
- <el-row
276
- v-for="(
277
- buyCompanyBillGood, index
278
- ) in form.buyerCompanyBillGoods"
279
- :key="index"
280
- class="mt5"
281
- >
180
+ <el-row v-for="(buyCompanyBillGood, index) in form.buyerCompanyBillGoods" :key="index" class="mt5">
282
181
  <el-col :span="4">
283
- <el-form-item
284
- :label="$t('contract.option') + (index + 1)"
285
- :rules="[{ required: true }]"
286
- ></el-form-item>
182
+ <el-form-item :label="$t('contract.option') + (index + 1)" :rules="[{ required: true }]"></el-form-item>
287
183
  </el-col>
288
184
  <el-col :span="2">
289
- <div
290
- style="
291
- background-color: darkgrey;
292
- height: 26px;
293
- margin-top: 1px;
294
- text-align: center;
295
- line-height: 28px;
296
- font-size: 14px;
297
- border-radius: 3px;
298
- "
299
- >{{ $t("contract.product") }}</div>
185
+ <div style="background-color: darkgrey; height: 26px; margin-top: 1px; text-align: center; line-height: 28px; font-size: 14px; border-radius: 3px">
186
+ {{ $t('contract.product') }}
187
+ </div>
300
188
  </el-col>
301
189
  <el-col :span="9">
302
190
  <el-form-item
303
191
  label-width="0px"
304
192
  :prop="'buyerCompanyBillGoods.' + index + '.goodsName'"
305
193
  :rules="[
306
- {
307
- required: true,
308
- message: $t('bill.tip1'),
309
- trigger: 'blur',
310
- },
311
- ]"
194
+ {
195
+ required: true,
196
+ message: $t('bill.tip1'),
197
+ trigger: 'blur'
198
+ }
199
+ ]"
312
200
  >
313
201
  <el-select
314
- style="width: 100%;"
202
+ style="width: 100%"
315
203
  size="mini"
316
204
  v-model="buyCompanyBillGood.goodsName"
317
- :placeholder="
318
- $t('placeholder.select') +
319
- $t('contract.billCargoName')
320
- "
205
+ :placeholder="$t('placeholder.select') + $t('contract.billCargoName')"
321
206
  @change="(val) => changeBillGood(val, index)"
322
207
  >
323
- <el-option
324
- v-for="(i, index) in billGoodsList"
325
- :key="index"
326
- :label="i.goodsName"
327
- :value="i.goodsName"
328
- />
208
+ <el-option v-for="(i, index) in billGoodsList" :key="index" :label="i.goodsName" :value="i.goodsName" />
329
209
  </el-select>
330
210
  </el-form-item>
331
211
  </el-col>
332
212
  <el-col :span="2">
333
- <div
334
- style="
335
- background-color: darkgrey;
336
- height: 26px;
337
- margin-top: 1px;
338
- text-align: center;
339
- line-height: 28px;
340
- font-size: 14px;
341
- border-radius: 3px;
342
- "
343
- >{{ $t("contract.hsCode") }}</div>
213
+ <div style="background-color: darkgrey; height: 26px; margin-top: 1px; text-align: center; line-height: 28px; font-size: 14px; border-radius: 3px">
214
+ {{ $t('contract.hsCode') }}
215
+ </div>
344
216
  </el-col>
345
217
  <el-col :span="3">
346
218
  <el-input disabled size="mini" v-model="buyCompanyBillGood.hsCode"></el-input>
347
219
  </el-col>
348
220
  <el-col :span="2">
349
- <el-button
350
- type="text"
351
- size="mini"
352
- class="ml10"
353
- @click="handleBillGoods(form.buyerCompanyId)"
354
- v-if="index === form.buyerCompanyBillGoods.length - 1"
355
- >{{ $t("button.addOrModify") }}</el-button>
221
+ <el-button type="text" size="mini" class="ml10" @click="handleBillGoods(form.buyerCompanyId)" v-if="index === form.buyerCompanyBillGoods.length - 1">{{
222
+ $t('button.addOrModify')
223
+ }}</el-button>
356
224
  </el-col>
357
225
  <el-col :span="1">
358
226
  <el-button
@@ -366,14 +234,7 @@
366
234
  ></el-button>
367
235
  </el-col>
368
236
  <el-col :span="1">
369
- <el-button
370
- v-if="index > 0"
371
- size="mini"
372
- icon="el-icon-minus"
373
- circle
374
- class="ml5"
375
- @click="deleteBillGoods(index)"
376
- ></el-button>
237
+ <el-button v-if="index > 0" size="mini" icon="el-icon-minus" circle class="ml5" @click="deleteBillGoods(index)"></el-button>
377
238
  </el-col>
378
239
  </el-row>
379
240
  </el-row>
@@ -386,34 +247,21 @@
386
247
  <el-row>
387
248
  <el-col :span="12">
388
249
  <el-form-item :label="$t('contract.shippingMarks') + ':'" prop="shippingMark">
389
- <el-input
390
- v-model="form.shippingMark"
391
- :placeholder="$t('contract.shippingMarksTip')"
392
- ></el-input>
250
+ <el-input v-model="form.shippingMark" :placeholder="$t('contract.shippingMarksTip')"></el-input>
393
251
  </el-form-item>
394
252
  </el-col>
395
253
  </el-row>
396
254
 
397
255
  <el-form-item :label="$t('contract.remark') + ':'" prop="blRemark">
398
- <el-input
399
- v-model="form.blRemark"
400
- type="textarea"
401
- :rows="5"
402
- :placeholder="$t('contract.remarkTip')"
403
- ></el-input>
256
+ <el-input v-model="form.blRemark" type="textarea" :rows="5" :placeholder="$t('contract.remarkTip')"></el-input>
404
257
  </el-form-item>
405
258
  <el-form-item :label="$t('contract.attachments') + ':'" prop="billPictures">
406
- <file-upload
407
- v-model="form.billPictures"
408
- :limit="10"
409
- :uploadType="'bill'"
410
- :fileType="[]"
411
- ></file-upload>
259
+ <file-upload v-model="form.billPictures" :limit="10" :uploadType="'bill'" :fileType="[]"></file-upload>
412
260
  </el-form-item>
413
261
  </el-form>
414
262
  </div>
415
263
  <div class="footer" v-if="!printModel">
416
- <el-button type="primary" @click="submitForm">{{ $t("button.saveDraft") }}</el-button>
264
+ <el-button type="primary" @click="submitForm">{{ $t('button.saveDraft') }}</el-button>
417
265
  </div>
418
266
  </div>
419
267
  </el-dialog>
@@ -423,24 +271,21 @@
423
271
  <bill-goods ref="billGoods" @submit="changeBillGoods"></bill-goods>
424
272
  </div>
425
273
  </template>
426
-
427
- <script>
428
- import {
429
- getBizDealRecord,
430
- updateBizDealRecord,
431
- } from '../../../api/biz/bizDealRecord';
432
- import { listBizContractCompany } from '../../../api/biz/bizContractCompany';
433
- import SubCompanyDialog from './subCompanyDialog.vue';
434
- import BillGoods from './billGoods.vue';
435
- import { listCompanyBillGoods } from '../../../api/biz/bizCompanyBillGoods';
436
- import { getBizContract } from '../../../api/biz/bizContract';
437
- import FileUpload from '../../../components/FileUpload/s3.vue';
274
+
275
+ <script>
276
+ import { getBizDealRecord, updateBizDealRecord } from '../../../api/biz/bizDealRecord'
277
+ import { listBizContractCompany } from '../../../api/biz/bizContractCompany'
278
+ import SubCompanyDialog from './subCompanyDialog.vue'
279
+ import BillGoods from './billGoods.vue'
280
+ import { listCompanyBillGoods } from '../../../api/biz/bizCompanyBillGoods'
281
+ import { getBizContract, changeBizStatus } from '../../../api/biz/bizContract'
282
+ import FileUpload from '../../../components/FileUpload/s3.vue'
438
283
 
439
284
  export default {
440
285
  name: 'EditBill',
441
286
  components: { SubCompanyDialog, BillGoods, FileUpload },
442
287
  props: {
443
- channel: '',
288
+ channel: ''
444
289
  },
445
290
  data() {
446
291
  return {
@@ -448,17 +293,20 @@ export default {
448
293
  loading: true,
449
294
  // 弹出层标题
450
295
  title: '',
296
+ expandItems: ['0', '1', '2'], // 展开指定项
451
297
  // 是否显示弹出层
452
298
  open: false,
299
+ // 是否已确认
300
+ confirmFlag: false,
453
301
  // 表单参数
454
302
  form: {
455
303
  //买家公司提单货物名称
456
304
  buyerCompanyBillGoods: [
457
305
  {
458
306
  goodsName: '',
459
- hsCode: '',
460
- },
461
- ],
307
+ hsCode: ''
308
+ }
309
+ ]
462
310
  },
463
311
  printModel: false,
464
312
  //
@@ -472,136 +320,139 @@ export default {
472
320
  //
473
321
  dealId: null,
474
322
  rules: {
475
- deliveryCompanyId: [{ required: true, trigger: 'blur' }],
476
- notifierCompanyId: [{ required: true, trigger: 'blur' }],
477
- goodsName: [{ required: true, trigger: 'blur' }],
323
+ deliveryCompanyId: [{ required: true, trigger: 'blur', message: this.$t('bill.tip3') }],
324
+ notifierCompanyId: [{ required: true, trigger: 'blur', message: this.$t('bill.tip4') }],
325
+ goodsName: [{ required: true, trigger: 'blur' }]
478
326
  },
479
- contract: null,
480
- };
327
+ contract: null
328
+ }
481
329
  },
482
330
  watch: {
483
331
  deliveryCompanyList(newVal, oldVal) {
484
332
  if (newVal !== oldVal) {
485
- const defaultDeliveryCompany = newVal.find((item) => item.defaultFlag);
333
+ const defaultDeliveryCompany = newVal.find((item) => item.defaultFlag)
486
334
  if (!this.form.deliveryCompanyId && defaultDeliveryCompany) {
487
- this.form.deliveryCompanyId =
488
- defaultDeliveryCompany.contractCompanyId;
489
- this.form.deliveryCompany = defaultDeliveryCompany;
490
- this.form.blRemark = defaultDeliveryCompany.bliRemark;
335
+ this.form.deliveryCompanyId = defaultDeliveryCompany.contractCompanyId
336
+ this.form.deliveryCompany = defaultDeliveryCompany
337
+ this.form.blRemark = defaultDeliveryCompany.bliRemark
491
338
  } else {
492
- const deliveryCompany = newVal.find(
493
- (item) => item.contractCompanyId == this.form.deliveryCompanyId
494
- );
495
- this.form.deliveryCompany = deliveryCompany;
496
- this.form.blRemark = deliveryCompany?.bliRemark;
339
+ const deliveryCompany = newVal.find((item) => item.contractCompanyId == this.form.deliveryCompanyId)
340
+ this.form.deliveryCompany = deliveryCompany
341
+ this.form.blRemark = deliveryCompany?.bliRemark
497
342
  }
498
343
  }
499
344
  },
500
345
  notifierCompanyList(newVal, oldVal) {
501
346
  if (newVal !== oldVal) {
502
- const notifierDeliveryCompany = newVal.find((item) => item.defaultFlag);
347
+ const notifierDeliveryCompany = newVal.find((item) => item.defaultFlag)
503
348
  //成交没通知人公司取默认 否则取通知人公司信息
504
349
  if (!this.form.notifierCompanyId && notifierDeliveryCompany) {
505
- this.form.notifierCompanyId =
506
- notifierDeliveryCompany.contractCompanyId;
507
- this.form.notifierCompany = notifierDeliveryCompany;
350
+ this.form.notifierCompanyId = notifierDeliveryCompany.contractCompanyId
351
+ this.form.notifierCompany = notifierDeliveryCompany
508
352
  } else {
509
- this.form.notifierCompany = newVal.find(
510
- (item) => item.contractCompanyId == this.form.notifierCompanyId
511
- );
353
+ this.form.notifierCompany = newVal.find((item) => item.contractCompanyId == this.form.notifierCompanyId)
512
354
  }
513
355
  }
514
- },
356
+ }
515
357
  },
516
358
  created() {},
517
359
  methods: {
518
- handleEdit(contractId, dealId) {
519
- this.getDealRecord(dealId);
520
- this.getContract(contractId);
521
- this.open = true;
360
+ async handleEdit(contractId, dealId) {
361
+ const loading = this.openLoading()
362
+ try {
363
+ // 等待异步方法完成
364
+ await this.getDealRecord(dealId)
365
+ await this.getContract(contractId)
366
+ // 异步操作完成后设置open为true
367
+ this.open = true
368
+ } catch (error) {
369
+ console.error('An error occurred:', error)
370
+ // 你可以在这里处理错误
371
+ } finally {
372
+ // 无论成功或失败,关闭loading
373
+ loading.close()
374
+ }
522
375
  },
523
376
  getContract(contractId) {
524
- getBizContract(contractId).then((response) => {
525
- this.contract = response.data;
526
- });
377
+ // 将整个方法体封装在返回的Promise中
378
+ return new Promise((resolve, reject) => {
379
+ getBizContract(contractId)
380
+ .then((response) => {
381
+ this.contract = response.data
382
+ this.confirmFlag = this.contract.blConfirmFlag ?? false
383
+ resolve(response) // 异步操作成功,解决Promise
384
+ })
385
+ .catch((error) => {
386
+ reject(error) // 异步操作失败,拒绝Promise
387
+ })
388
+ })
527
389
  },
528
390
  //子公司更新
529
391
  changeSubCompanyList() {
530
- this.getContractCompanyList(this.form.buyerCompanyId);
392
+ this.getContractCompanyList(this.form.buyerCompanyId)
531
393
  },
532
394
  //子组件更新
533
395
  changeBillGoods() {
534
- this.getCompanyBillGoods(this.form.buyerCompanyId);
396
+ this.getCompanyBillGoods(this.form.buyerCompanyId)
535
397
  },
536
398
  //
537
399
  handleBillGoods(companyId) {
538
- this.$refs.billGoods.handleShow(companyId);
400
+ this.$refs.billGoods.handleShow(companyId)
539
401
  },
540
402
  //选中提单货物时
541
403
  changeBillGood(val, index) {
542
- const billGodd = this.billGoodsList.find((i) => i.goodsName == val);
543
- this.form.buyerCompanyBillGoods[index].hsCode = billGodd.hsCode;
404
+ const billGodd = this.billGoodsList.find((i) => i.goodsName == val)
405
+ this.form.buyerCompanyBillGoods[index].hsCode = billGodd.hsCode
544
406
  },
545
407
  //添加提单货物
546
408
  addBillGoods() {
547
409
  this.form.buyerCompanyBillGoods.push({
548
410
  goodsName: '',
549
- hsCode: '',
550
- });
411
+ hsCode: ''
412
+ })
551
413
  },
552
414
  //删除提单货物
553
415
  deleteBillGoods(index) {
554
- this.form.buyerCompanyBillGoods.splice(index, 1);
416
+ this.form.buyerCompanyBillGoods.splice(index, 1)
555
417
  },
556
418
  //获取公司提单货物
557
419
  getCompanyBillGoods(companyId) {
558
420
  listCompanyBillGoods({ companyId: companyId }).then((res) => {
559
- const billGoodsList = res.rows;
560
- this.billGoodsList = billGoodsList;
421
+ const billGoodsList = res.rows
422
+ this.billGoodsList = billGoodsList
561
423
  if (!this.form.buyerCompanyBillGoods) {
562
- const defaultBillGoods =
563
- billGoodsList.filter((item) => item.defaultFlag).length > 0
564
- ? billGoodsList.filter((item) => item.defaultFlag)[0]
565
- : null;
424
+ const defaultBillGoods = billGoodsList.filter((item) => item.defaultFlag).length > 0 ? billGoodsList.filter((item) => item.defaultFlag)[0] : null
566
425
  this.form.buyerCompanyBillGoods.push({
567
426
  goodsName: defaultBillGoods.goodsName,
568
- hsCode: defaultBillGoods.hsCode,
569
- });
427
+ hsCode: defaultBillGoods.hsCode
428
+ })
570
429
  }
571
- });
430
+ })
572
431
  },
573
432
  //更改收货人或者通知人公司时 相应显示变更
574
433
  changeSubCompany(val, type) {
575
434
  if (type == 'delivery') {
576
- var deliveryCompany = this.deliveryCompanyList.filter(
577
- (item) => item.contractCompanyId == val
578
- )[0];
435
+ var deliveryCompany = this.deliveryCompanyList.filter((item) => item.contractCompanyId == val)[0]
579
436
  if (this.form.deliveryCompany?.bliRemark == this.form?.blRemark) {
580
- this.form.blRemark = deliveryCompany?.bliRemark;
437
+ this.form.blRemark = deliveryCompany?.bliRemark
581
438
  }
582
- this.form.deliveryCompany = deliveryCompany;
439
+ this.form.deliveryCompany = deliveryCompany
583
440
  }
584
441
  if (type == 'notifier') {
585
- this.form.notifierCompany = this.notifierCompanyList.filter(
586
- (item) => item.contractCompanyId == val
587
- )[0];
442
+ this.form.notifierCompany = this.notifierCompanyList.filter((item) => item.contractCompanyId == val)[0]
588
443
  }
589
444
  },
590
445
  //添加或修改
591
446
  handleSubCompany(companyId, type) {
592
- this.$refs.subCompanyDialog.handleSubCompany(companyId, type);
447
+ this.$refs.subCompanyDialog.handleSubCompany(companyId, type)
593
448
  },
594
449
  //获取收货人公司与通知人公司
595
450
  getContractCompanyList(companyId) {
596
451
  listBizContractCompany({ companyId: companyId }).then((res) => {
597
- const contractCompanyList = res.rows;
598
- this.deliveryCompanyList = contractCompanyList.filter(
599
- (item) => item.companyType == 'delivery'
600
- );
601
- this.notifierCompanyList = contractCompanyList.filter(
602
- (item) => item.companyType == 'notifier'
603
- );
604
- });
452
+ const contractCompanyList = res.rows
453
+ this.deliveryCompanyList = contractCompanyList.filter((item) => item.companyType == 'delivery')
454
+ this.notifierCompanyList = contractCompanyList.filter((item) => item.companyType == 'notifier')
455
+ })
605
456
  },
606
457
  // 表单重置
607
458
  reset() {
@@ -676,58 +527,68 @@ export default {
676
527
  notifierCompanyId: null,
677
528
  shippingMark: null,
678
529
  blRemark: null,
679
- buyerCompanyBillGoods: null,
680
- };
681
- this.resetForm('form');
530
+ buyerCompanyBillGoods: null
531
+ }
532
+ this.resetForm('form')
682
533
  },
683
534
  getDealRecord(dealId) {
684
- this.reset();
685
- getBizDealRecord(dealId).then((response) => {
686
- this.form = response.data;
687
- if (this.form.buyerCompanyBillGoods) {
688
- this.form.buyerCompanyBillGoods = JSON.parse(
689
- this.form.buyerCompanyBillGoods
690
- );
691
- } else {
692
- this.form.buyerCompanyBillGoods = [];
693
- this.addBillGoods();
694
- }
535
+ // 将整个方法体封装在返回的Promise中
536
+ return new Promise((resolve, reject) => {
537
+ this.reset()
538
+ getBizDealRecord(dealId)
539
+ .then((response) => {
540
+ this.form = response.data
541
+ if (this.form.buyerCompanyBillGoods) {
542
+ this.form.buyerCompanyBillGoods = JSON.parse(this.form.buyerCompanyBillGoods)
543
+ } else {
544
+ this.form.buyerCompanyBillGoods = []
545
+ this.addBillGoods()
546
+ }
695
547
 
696
- this.getContractCompanyList(this.form.buyerCompanyId);
697
- this.getCompanyBillGoods(this.form.buyerCompanyId);
698
- this.form.dealRecordDetailList.map((item) => {
699
- if (item.imageList) {
700
- item.askCover = item.imageList.toString();
701
- }
702
- });
703
- this.form?.billPictures?.forEach((element) => {
704
- element.name = element.fileName;
705
- element.url = element.generateUrl;
706
- });
707
- });
548
+ // 注意: 这里如果 getContractCompanyList 和 getCompanyBillGoods 也是异步的,
549
+ // 你需要确保它们也被适当地等待
550
+ this.getContractCompanyList(this.form.buyerCompanyId)
551
+ this.getCompanyBillGoods(this.form.buyerCompanyId)
552
+
553
+ this.form.dealRecordDetailList.map((item) => {
554
+ if (item.imageList) {
555
+ item.askCover = item.imageList.toString()
556
+ }
557
+ })
558
+
559
+ this.form?.billPictures?.forEach((element) => {
560
+ element.name = element.fileName
561
+ element.url = element.generateUrl
562
+ })
563
+
564
+ resolve(response) // 异步操作成功,解决Promise
565
+ })
566
+ .catch((error) => {
567
+ reject(error) // 异步操作失败,拒绝Promise
568
+ })
569
+ })
708
570
  },
709
571
  /** 提交按钮 */
710
572
  submitForm() {
711
573
  this.$refs['form'].validate((valid) => {
712
574
  if (valid) {
713
575
  if (this.form.dealId != null) {
714
- var deal = JSON.parse(JSON.stringify(this.form));
715
- deal.buyerCompanyBillGoods = JSON.stringify(
716
- deal.buyerCompanyBillGoods
717
- );
576
+ var deal = JSON.parse(JSON.stringify(this.form))
577
+ deal.buyerCompanyBillGoods = JSON.stringify(deal.buyerCompanyBillGoods)
578
+ deal.blConfirmFlag = this.confirmFlag
718
579
  updateBizDealRecord(deal).then((response) => {
719
- this.open = false;
720
- this.$modal.msgSuccess('Save Success');
721
- this.$emit('edit');
722
- });
580
+ this.open = false
581
+ this.$modal.msgSuccess('Save Success')
582
+ this.$emit('edit')
583
+ })
723
584
  }
724
585
  }
725
- });
726
- },
727
- },
728
- };
586
+ })
587
+ }
588
+ }
589
+ }
729
590
  </script>
730
- <style lang="scss" scoped>
591
+ <style lang="scss" scoped>
731
592
  .app-container {
732
593
  padding: 0 20px;
733
594
 
@@ -785,4 +646,3 @@ export default {
785
646
  font-size: 25px; /* 增加箭头大小 */
786
647
  }
787
648
  </style>
788
-