feat(wms/delivery): 新增多类型发货单打印组件及适配逻辑
1. 新增WayBillPrinter包装组件,根据商品类型和printType自动切换打印模板 2. 新增锌层、铬料专用的发货单打印模板ZincWayBill1/2、DugeWayBill1/2 3. 优化发货单页面,替换原有固定打印组件为动态匹配的打印组件 4. 补充获取zincLayer和temperGrade字段的逻辑
This commit is contained in:
1153
klp-ui/src/views/wms/delivery/components/DugeWayBill1.vue
Normal file
1153
klp-ui/src/views/wms/delivery/components/DugeWayBill1.vue
Normal file
File diff suppressed because it is too large
Load Diff
1151
klp-ui/src/views/wms/delivery/components/DugeWayBill2.vue
Normal file
1151
klp-ui/src/views/wms/delivery/components/DugeWayBill2.vue
Normal file
File diff suppressed because it is too large
Load Diff
72
klp-ui/src/views/wms/delivery/components/WayBillPrinter.vue
Normal file
72
klp-ui/src/views/wms/delivery/components/WayBillPrinter.vue
Normal 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>
|
||||
1153
klp-ui/src/views/wms/delivery/components/ZincWayBill1.vue
Normal file
1153
klp-ui/src/views/wms/delivery/components/ZincWayBill1.vue
Normal file
File diff suppressed because it is too large
Load Diff
1151
klp-ui/src/views/wms/delivery/components/ZincWayBill2.vue
Normal file
1151
klp-ui/src/views/wms/delivery/components/ZincWayBill2.vue
Normal file
File diff suppressed because it is too large
Load Diff
@@ -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 || '',
|
||||
};
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user