Merge remote-tracking branch 'origin/0.8.X' into 0.8.X

This commit is contained in:
2026-03-11 14:18:19 +08:00
2 changed files with 1458 additions and 2 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -72,6 +72,8 @@
<template slot-scope="scope">
<el-button size="mini" type="text" icon="el-icon-view"
@click.stop="handlePrint(scope.row)">打印发货单</el-button>
<el-button size="mini" type="text" icon="el-icon-view"
@click.stop="handlePrintSimple(scope.row)">简单打印</el-button>
<el-button size="mini" type="text" icon="el-icon-copy"
@click.stop="handleCopy(scope.row)">复制新增</el-button>
<el-button size="mini" type="text" icon="el-icon-edit" :disabled="scope.row.status === 1"
@@ -134,7 +136,8 @@
<!-- 打印发货单对话框 -->
<el-dialog title="打印发货单" :visible.sync="printDialogVisible" width="1000px" append-to-body center>
<WayBill :waybill="currentWaybill" :waybillDetails="currentWaybillDetails" />
<WayBill v-if="printType === 0" :waybill="currentWaybill" :waybillDetails="currentWaybillDetails" />
<WayBill2 v-else :waybill="currentWaybill" :waybillDetails="currentWaybillDetails" />
</el-dialog>
</div>
</template>
@@ -148,6 +151,8 @@ import MemoInput from "@/components/MemoInput";
import DeliveryWaybillDetail from "../components/detailTable.vue";
import WayBill from "../components/wayBill.vue";
import PlanList from "../components/planList.vue";
import WayBill2 from "../components/wayBill2.vue";
export default {
name: "DeliveryWaybill",
@@ -155,7 +160,8 @@ export default {
MemoInput,
DeliveryWaybillDetail,
WayBill,
PlanList
PlanList,
WayBill2
},
data() {
return {
@@ -182,6 +188,8 @@ export default {
currentWaybillDetails: [],
// 弹出层标题
title: "",
// 打印类型
printType: 0,
// 是否显示弹出层
open: false,
// 查询参数
@@ -422,6 +430,65 @@ export default {
/** 打印发货单 */
handlePrint(row) {
this.loading = true;
this.printType = 0;
// 获取发货单明细
listDeliveryWaybillDetail({
waybillId: row.waybillId,
pageNum: 1,
pageSize: 1000 // 获取所有明细
}).then(response => {
// 处理字段映射确保与wayBill组件使用的字段名一致
this.currentWaybillDetails = response.rows.map(item => ({
coilId: item.coilId,
productName: item.productName,
edgeType: item.edgeType,
packageType: item.packaging, // 映射packaging到packageType
settlementType: item.settlementType,
rawMaterialFactory: item.rawMaterialFactory,
coilNumber: item.coilNo, // 映射coilNo到coilNumber
specification: item.specification,
material: item.material,
quantity: item.quantity,
weight: item.weight,
unitPrice: item.unitPrice || '',
// 单价为空时,显示为空字符串
remark: item.remark
}));
const coils = this.currentWaybillDetails.map(item => item.coilId).join(',');
if (coils) {
listCoilByIds(coils).then(response => {
// 取前三位, 然后去抽后用;连接
// 设置当前发货单
const actualWahouseNames = [...new Set(response.rows.filter(item => Boolean(item.actualWarehouseName)).map(item => item.actualWarehouseName.slice(0, 3)))].join(';');
this.currentWaybill = {
...row,
pickupLocation: actualWahouseNames || '',
};
this.currentWaybillDetails = this.currentWaybillDetails.map(item => {
const actualWarehouseName = response.rows.find(detail => detail.coilId === item.coilId)?.actualWarehouseName || '';
return {
...item,
actualWarehouseName: actualWarehouseName,
};
});
});
}
this.currentWaybill = {
...row,
};
this.printDialogVisible = true;
this.loading = false;
}).catch(error => {
console.error('获取发货单明细失败:', error);
this.$modal.msgError('获取发货单明细失败');
this.loading = false;
});
},
/** 打印发货单 */
handlePrintSimple(row) {
this.loading = true;
this.printType = 1;
// 获取发货单明细
listDeliveryWaybillDetail({
waybillId: row.waybillId,