Merge remote-tracking branch 'origin/0.8.X' into 0.8.X
This commit is contained in:
1389
klp-ui/src/views/wms/delivery/components/wayBill2.vue
Normal file
1389
klp-ui/src/views/wms/delivery/components/wayBill2.vue
Normal file
File diff suppressed because it is too large
Load Diff
@@ -72,6 +72,8 @@
|
|||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button size="mini" type="text" icon="el-icon-view"
|
<el-button size="mini" type="text" icon="el-icon-view"
|
||||||
@click.stop="handlePrint(scope.row)">打印发货单</el-button>
|
@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"
|
<el-button size="mini" type="text" icon="el-icon-copy"
|
||||||
@click.stop="handleCopy(scope.row)">复制新增</el-button>
|
@click.stop="handleCopy(scope.row)">复制新增</el-button>
|
||||||
<el-button size="mini" type="text" icon="el-icon-edit" :disabled="scope.row.status === 1"
|
<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>
|
<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>
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -148,6 +151,8 @@ import MemoInput from "@/components/MemoInput";
|
|||||||
import DeliveryWaybillDetail from "../components/detailTable.vue";
|
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 PlanList from "../components/planList.vue";
|
||||||
|
import WayBill2 from "../components/wayBill2.vue";
|
||||||
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "DeliveryWaybill",
|
name: "DeliveryWaybill",
|
||||||
@@ -155,7 +160,8 @@ export default {
|
|||||||
MemoInput,
|
MemoInput,
|
||||||
DeliveryWaybillDetail,
|
DeliveryWaybillDetail,
|
||||||
WayBill,
|
WayBill,
|
||||||
PlanList
|
PlanList,
|
||||||
|
WayBill2
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@@ -182,6 +188,8 @@ export default {
|
|||||||
currentWaybillDetails: [],
|
currentWaybillDetails: [],
|
||||||
// 弹出层标题
|
// 弹出层标题
|
||||||
title: "",
|
title: "",
|
||||||
|
// 打印类型
|
||||||
|
printType: 0,
|
||||||
// 是否显示弹出层
|
// 是否显示弹出层
|
||||||
open: false,
|
open: false,
|
||||||
// 查询参数
|
// 查询参数
|
||||||
@@ -422,6 +430,65 @@ export default {
|
|||||||
/** 打印发货单 */
|
/** 打印发货单 */
|
||||||
handlePrint(row) {
|
handlePrint(row) {
|
||||||
this.loading = true;
|
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({
|
listDeliveryWaybillDetail({
|
||||||
waybillId: row.waybillId,
|
waybillId: row.waybillId,
|
||||||
|
|||||||
Reference in New Issue
Block a user