feat(wms/delivery): 新增多类型发货单打印组件及适配逻辑

1. 新增WayBillPrinter包装组件,根据商品类型和printType自动切换打印模板
2. 新增锌层、铬料专用的发货单打印模板ZincWayBill1/2、DugeWayBill1/2
3. 优化发货单页面,替换原有固定打印组件为动态匹配的打印组件
4. 补充获取zincLayer和temperGrade字段的逻辑
This commit is contained in:
2026-05-22 10:46:45 +08:00
parent efc6a9f0df
commit 35e4e4bbb0
6 changed files with 4694 additions and 6 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,72 @@
<template>
<component :is="printComponent" :waybill="wayBill" :waybillDetails="wayBillDetails" />
</template>
<script>
import wayBill from './wayBill.vue';
import wayBill2 from './wayBill2.vue';
import ZincWayBill1 from './ZincWayBill1.vue';
import ZincWayBill2 from './ZincWayBill2.vue';
import DugeWayBill1 from './DugeWayBill1.vue';
import DugeWayBill2 from './DugeWayBill2.vue';
export default {
name: 'WayBillPrinter',
components: {
wayBill,
wayBill2,
ZincWayBill1,
ZincWayBill2,
DugeWayBill1,
DugeWayBill2,
},
props: {
wayBill: {
type: Object,
default: () => {},
},
wayBillDetails: {
type: Array,
default: () => [],
},
// 0 表示含单价的单据1 表示不含单价的单据
printType: {
type: Number,
default: 0,
},
},
computed: {
printComponent() {
if (this.wayBillDetails.length == 0) {
if (this.printType == 0) {
return 'wayBill';
} else {
return 'wayBill2';
}
} else {
const productName = this.wayBillDetails[0].productName;
if (productName.includes('锌')) {
if (this.printType == 0) {
return 'ZincWayBill1';
} else {
return 'ZincWayBill2';
}
} else if (productName.includes('铬')) {
if (this.printType == 0) {
return 'DugeWayBill1';
} else {
return 'DugeWayBill2';
}
} else {
// 其他商品根据printType判断使用哪个组件
if (this.printType == 0) {
return 'wayBill';
} else {
return 'wayBill2';
}
}
}
}
}
}
</script>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -230,8 +230,9 @@
<!-- 打印发货单对话框 -->
<el-dialog title="打印发货单" :visible.sync="printDialogVisible" width="1000px" append-to-body center>
<WayBill v-if="printType === 0" :waybill="currentWaybill" :waybillDetails="currentWaybillDetails" />
<WayBill2 v-else :waybill="currentWaybill" :waybillDetails="currentWaybillDetails" />
<!-- <WayBill v-if="printType === 0" :waybill="currentWaybill" :waybillDetails="currentWaybillDetails" />
<WayBill2 v-else :waybill="currentWaybill" :waybillDetails="currentWaybillDetails" /> -->
<WayBillPrinter :wayBill="currentWaybill" :wayBillDetails="currentWaybillDetails" :printType="printType" />
</el-dialog>
</div>
</template>
@@ -245,20 +246,22 @@ import { listDeliveryWaybillDetail } from "@/api/wms/deliveryWaybillDetail";
import { listOrder } from "@/api/crm/order";
import MemoInput from "@/components/MemoInput";
import DeliveryWaybillDetail from "../components/detailTable.vue";
import WayBill from "../components/wayBill.vue";
// import WayBill from "../components/wayBill.vue";
import PlanList from "../components/planList.vue";
import WayBill2 from "../components/wayBill2.vue";
// import WayBill2 from "../components/wayBill2.vue";
import PlanSelector from "../components/planSelector.vue";
import DragResizePanel from "@/components/DragResizePanel";
import WayBillPrinter from "../components/WayBillPrinter.vue";
export default {
name: "Exp-Waybill",
components: {
MemoInput,
DeliveryWaybillDetail,
WayBill,
WayBillPrinter,
// WayBill,
PlanList,
WayBill2,
// WayBill2,
PlanSelector,
DragResizePanel
},
@@ -693,9 +696,14 @@ export default {
};
this.currentWaybillDetails = this.currentWaybillDetails.map(item => {
const actualWarehouseName = response.rows.find(detail => detail.coilId === item.coilId)?.actualWarehouseName || '';
const zincLayer = response.rows.find(detail => detail.coilId === item.coilId)?.zincLayer || '';
const temperGrade = response.rows.find(detail => detail.coilId === item.coilId)?.temperGrade || '';
console.log(zincLayer, temperGrade, actualWahouseNames);
return {
...item,
actualWarehouseName: actualWarehouseName,
zincLayer: zincLayer || '',
temperGrade: temperGrade || '',
};
});
});