doctor-admin-components 1.0.14-beta.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.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "doctor-admin-components",
3
3
  "version1": "1.0.11",
4
- "version": "1.0.14-beta.1",
4
+ "version": "1.0.14-beta.2",
5
5
  "private": false,
6
6
  "main1": "lib/index.umd.min.js",
7
7
  "main": "packages/index.js",
@@ -136,3 +136,23 @@ export function haveVoidShipment(contractId) {
136
136
  params: {}
137
137
  })
138
138
  }
139
+
140
+ // 保存草稿
141
+ export function saveDraft(data) {
142
+ return request({
143
+ url: '/biz/shipment/saveDraft',
144
+ method: 'post',
145
+ data
146
+ })
147
+ }
148
+
149
+ // 保存草稿
150
+ export function getDraft(contractId) {
151
+ return request({
152
+ url: '/biz/shipment/getDraft',
153
+ method: 'get',
154
+ params: {
155
+ contractId
156
+ }
157
+ })
158
+ }
@@ -0,0 +1,12 @@
1
+ export function CommonFormatNumber(input, bit) {
2
+ const num = Number(input);
3
+ if (isNaN(num)) {
4
+ return 'Invalid input'; // 输入不是有效数字时返回错误信息
5
+ }
6
+ if (!bit) {
7
+ bit = 3;
8
+ }
9
+ return parseFloat(num.toFixed(bit));
10
+ }
11
+
12
+
@@ -1,9 +1,8 @@
1
1
  <template>
2
2
  <div class="app-container">
3
3
  <!-- 添加或修改装运对话框 -->
4
- <el-dialog :visible.sync="open" z-index="1000" width="80%" :before-close="handleClose">
4
+ <el-dialog :visible.sync="open" z-index="1000" width="80%" :before-close="handleClose" :title="title">
5
5
  <slot name="">
6
- <span>{{ title }}</span>
7
6
  <span v-if="voidInvoiceList" style="color: red">【快捷转卖】:系统检测到此销售合同关联的采购合同存在【已作废】的装运,</span>
8
7
  <el-button v-if="voidInvoiceList" @click="handleReference" size="mini" type="text">点击这里直接复制并引用</el-button>
9
8
  </slot>
@@ -17,13 +16,11 @@
17
16
  </el-select>
18
17
  </el-form-item>
19
18
  </el-col>
20
-
21
19
  <el-col :span="6">
22
20
  <el-form-item label="订舱号" prop="bookingNo">
23
21
  <el-input v-model="form.bookingNo" placeholder="请输入订舱号" size="small" />
24
22
  </el-form-item>
25
23
  </el-col>
26
-
27
24
  <el-col :span="6">
28
25
  <el-form-item label="提单号" prop="billOfLadingNo">
29
26
  <el-input v-model="form.billOfLadingNo" placeholder="请输入提单号" size="small" />
@@ -214,7 +211,7 @@
214
211
  placeholder="请输入毛重"
215
212
  size="mini"
216
213
  type="number"
217
- @input="changePackageGrossWeight(index, scope1.$index, scope2.$index)"
214
+ @input="limitDecimalPlaces(index, scope1.$index, scope2.$index, scope2.row, 'packageGrossWeight')"
218
215
  ></el-input>
219
216
  </el-form-item>
220
217
  </template>
@@ -233,7 +230,7 @@
233
230
  placeholder="请输入皮重"
234
231
  size="mini"
235
232
  type="number"
236
- @input="changePackageTareWeight(index, scope1.$index, scope2.$index)"
233
+ @input="limitDecimalPlaces(index, scope1.$index, scope2.$index, scope2.row, 'packageTareWeight')"
237
234
  ></el-input>
238
235
  </el-form-item>
239
236
  </template>
@@ -247,7 +244,7 @@
247
244
  :rules="rules.packageNetWeight"
248
245
  :prop="'containerList.' + index + '.containerDetailList.' + scope1.$index + '.packageList.' + scope2.$index + '.packageNetWeight'"
249
246
  >
250
- <el-input v-model="scope2.row.packageNetWeight" placeholder="请输入净重" size="mini" type="number"></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>
251
248
  </el-form-item>
252
249
  </template>
253
250
  </el-table-column>
@@ -387,6 +384,7 @@
387
384
  </el-row>
388
385
  </el-form>
389
386
  <div slot="footer" class="dialog-footer">
387
+ <el-button type="warning" @click="onSaveDraft" style="margin-right: 10px">保存草稿</el-button>
390
388
  <el-button type="primary" @click="submitShipment" style="margin-right: 10px">{{ title == '生成装运' ? '仅生成装运' : '保存草稿' }}</el-button>
391
389
  <el-dropdown @command="(command) => handleTemplate(command)" trigger="click" v-if="title == '生成装运'" style="margin-right: 10px">
392
390
  <el-button type="primary">{{ '装运并下载' }}</el-button>
@@ -448,7 +446,9 @@ import {
448
446
  addWithContainer,
449
447
  addContainerCheck,
450
448
  updateWithContainer,
451
- updateWithContainerAndInvoice
449
+ updateWithContainerAndInvoice,
450
+ saveDraft,
451
+ getDraft
452
452
  } from '../../../api/biz/bizShipment'
453
453
  import { generateFinalInvoiceByShipmentId } from '../../../api/biz/bizInvoice'
454
454
  import { updateBizContractDetail } from '../../../api/biz/bizContractDetail'
@@ -672,6 +672,23 @@ export default {
672
672
  return total + Number(item.goodsNumber)
673
673
  }, 0)
674
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
+
675
692
  changePackageGrossWeight(index, k, yindex) {
676
693
  this.form.containerList[index].containerDetailList[k].goodsGrossWeight = this.form.containerList[index].containerDetailList[k].packageList.reduce((total, item) => {
677
694
  return total + Number(item.packageGrossWeight)
@@ -890,7 +907,6 @@ export default {
890
907
  /** 新增按钮操作 */
891
908
  handleAdd(contractDetailList, destinationPort, contract) {
892
909
  this.reset()
893
- console.log(contract)
894
910
  if (contract.contractType == 'purchase') {
895
911
  this.$modal.msgError('请选择销售合同')
896
912
  return
@@ -946,6 +962,7 @@ export default {
946
962
  haveVoidShipment(contract.contractId).then((res) => {
947
963
  this.voidInvoiceList = res.rows && res.rows.length > 0 ? res.rows : null
948
964
  })
965
+ this.onGetDraft()
949
966
  // 测试数据
950
967
  // this.voidInvoiceList = [{'contractId': '1', 'contractNo':'合同号1'}]
951
968
  },
@@ -1269,6 +1286,26 @@ export default {
1269
1286
  },
1270
1287
  `bizShipment_${new Date().getTime()}.xlsx`
1271
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
+ }
1272
1309
  }
1273
1310
  }
1274
1311
  }
@@ -42,7 +42,7 @@
42
42
  >
43
43
  <el-table-column label="Description" align="center" prop="askName"></el-table-column>
44
44
  <el-table-column label="Quantity" align="center" prop="weight">
45
- <template slot-scope="scope">{{ scope.row.weight }}MT</template>
45
+ <template slot-scope="scope">{{ CommonFormatNumber(scope.row.weight) }}MT</template>
46
46
  </el-table-column>
47
47
  <el-table-column label="Unit Price/MT" align="center" width="200">
48
48
  <template slot-scope="{ row }">
@@ -193,6 +193,7 @@
193
193
 
194
194
  <script>
195
195
  import { exportPdf } from '../../../utils/pdf'
196
+ import { CommonFormatNumber } from '../../../utils/MycommonUtil'
196
197
 
197
198
  export default {
198
199
  name: 'ContractPdf',
@@ -262,6 +263,7 @@ export default {
262
263
  },
263
264
  created() {},
264
265
  methods: {
266
+ CommonFormatNumber,
265
267
  //设置打印model为true
266
268
  setPrintModel(val) {
267
269
  this.printModel = val
@@ -168,7 +168,11 @@
168
168
  <el-table-column v-if="channel !== 'official-website'" :label="$t('contractDetail.subCategory')" prop="subCategoryName" width="110"></el-table-column>
169
169
  <el-table-column :label="$t('contractDetail.packaging')" prop="packingMethod" width="90" />
170
170
  <el-table-column prop="descriptions" :label="$t('contractDetail.description')" :width="channel === 'official-website' ? 200 : 160"></el-table-column>
171
- <el-table-column prop="weight" :label="$t('contractDetail.weight')" width="120px"></el-table-column>
171
+ <el-table-column prop="weight" :label="$t('contractDetail.weight')" width="120px">
172
+ <template slot-scope="scope">
173
+ {{ CommonFormatNumber(scope.row.weight) }}
174
+ </template>
175
+ </el-table-column>
172
176
  <el-table-column v-if="channel !== 'official-website'" prop="sllerPrice" :label="$t('contractDetail.sellerPrice')" width="120">
173
177
  <template slot-scope="scope">
174
178
  <span v-if="dealRecord.quoteType == 'FIXED'">{{ '$' + scope.row.sllerPrice }}</span>
@@ -372,6 +376,7 @@ import { listBizInvoice, getInfoWithShipment } from '../../../api/biz/bizInvoice
372
376
  import { listBizShipment, getGeekYumToken, updateAllShipmentStatus } from '../../../api/biz/bizShipment'
373
377
  import { listContainerWithInvoice } from '../../../api/biz/bizContainer'
374
378
  import ShipmentDetail from '../bizShipment/detail.vue'
379
+ import { CommonFormatNumber } from '../../../utils/MycommonUtil'
375
380
 
376
381
  export default {
377
382
  name: 'ContractSummary',
@@ -490,6 +495,7 @@ export default {
490
495
  }
491
496
  },
492
497
  methods: {
498
+ CommonFormatNumber,
493
499
  /**
494
500
  * @description: 索赔类别
495
501
  * @param {*} type