Browse Source

打印添加新的字段

master
shenzhouyu 2 weeks ago
parent
commit
e38595d3e6
  1. 6
      src/i18n/locales/shipment/cnShipment.js
  2. 6
      src/i18n/locales/shipment/enShipment.js
  3. 33
      src/views/modules/shipment/shipmentNotification.vue

6
src/i18n/locales/shipment/cnShipment.js

@ -176,6 +176,12 @@ export default {
inputInnerPackQty: '请输入内箱数量',
boxPackCount: '每箱内包数',
inputBoxPackCount: '请输入每箱内包数',
cartonWeight: '箱重',
inputCartonWeight: '请输入箱重',
netWeight: '净重',
inputNetWeight: '请输入净重',
productionDate: '生产日期',
selectProductionDate: '请选择生产日期',
printHint: '每张外箱标签数量 = 每箱内包数 × 内箱数量;外箱/内箱余数均单独成张标签',
calcResult: '计算结果(不可修改)',
outerBoxLabel: '外箱标签',

6
src/i18n/locales/shipment/enShipment.js

@ -175,6 +175,12 @@ export default {
inputInnerPackQty: 'Please enter inner-box qty',
boxPackCount: 'Inner packs per box',
inputBoxPackCount: 'Please enter inner packs per box',
cartonWeight: 'Carton weight',
inputCartonWeight: 'Please enter carton weight',
netWeight: 'Net weight',
inputNetWeight: 'Please enter net weight',
productionDate: 'Production date',
selectProductionDate: 'Please select production date',
printHint: 'Qty per outer-box label = inner packs per box × inner-box qty; remainders print as separate labels',
calcResult: 'Calculation result (read-only)',
outerBoxLabel: 'Outer-box label',

33
src/views/modules/shipment/shipmentNotification.vue

@ -722,6 +722,24 @@
<span class="print-qty-label">{{ $t('shipment.print.boxPackCount') }}</span>
<el-input v-model="printForm.boxPackCount" :placeholder="$t('shipment.print.inputBoxPackCount')" />
</div>
<div class="print-input-field">
<span class="print-qty-label">{{ $t('shipment.print.cartonWeight') }}</span>
<el-input v-model="printForm.specialCartonWeight" :placeholder="$t('shipment.print.inputCartonWeight')" />
</div>
<div class="print-input-field">
<span class="print-qty-label">{{ $t('shipment.print.netWeight') }}</span>
<el-input v-model="printForm.specialNetWeight" :placeholder="$t('shipment.print.inputNetWeight')" />
</div>
<div class="print-input-field">
<span class="print-qty-label">{{ $t('shipment.print.productionDate') }}</span>
<el-date-picker
v-model="printForm.specialProductionDate"
type="date"
value-format="yyyy-MM-dd"
:placeholder="$t('shipment.print.selectProductionDate')"
style="width: 100%;"
/>
</div>
</div>
<div class="form-hint">
{{ $t('shipment.print.printHint') }}
@ -2057,6 +2075,9 @@ export default {
outerTotal: '',
innerPackQty: '',
boxPackCount: '',
specialCartonWeight: '0',
specialNetWeight: '0',
specialProductionDate: '',
labelType: '外箱标签',
reportId: '',
printerName: '',
@ -3456,6 +3477,9 @@ export default {
outerTotal: '',
innerPackQty: '',
boxPackCount: '',
specialCartonWeight: '0',
specialNetWeight: '0',
specialProductionDate: '',
labelType: '外箱标签',
reportId: '',
printerName: '',
@ -3467,6 +3491,11 @@ export default {
return Math.round(Number(a) * Number(b) * precision) / precision
},
parsePrintWeight(value) {
const num = Number(value)
return Number.isFinite(num) ? num : 0
},
formatQtyValue(value) {
const num = Number(value)
if (Number.isNaN(num)) {
@ -3524,6 +3553,10 @@ export default {
QTY: this.calculatedOuterQtyList.slice(),
// 与 QTY 一一对应:每个外箱对应的内包数,末箱不满则按实际包数
boxPackCount: this.calculatedOuterBoxPackCountList.slice(),
// 非数组字段由本次所有外箱标签共用,模板用 #{specialCartonWeight} 等替换
specialCartonWeight: this.parsePrintWeight(this.printForm.specialCartonWeight),
specialNetWeight: this.parsePrintWeight(this.printForm.specialNetWeight),
specialProductionDate: this.printForm.specialProductionDate || '',
}
if (row.inventoryPartNo) {
customFields.partNo = row.inventoryPartNo

Loading…
Cancel
Save