feat(发货单): 增加发货单钢卷选择范围限制功能
- 在CoilSelector组件中新增rangeMode和rangeData属性,支持传入可选钢卷列表 - 发货单明细表增加对可选钢卷列表的支持,并在增删改时刷新列表 - 发货单打印时自动填充取货地点为实际库位前三位 - 调整操作列固定显示在表格右侧
This commit is contained in:
@@ -143,7 +143,9 @@ export function listCoilByIds(coilIds) {
|
|||||||
url: '/wms/materialCoil/list',
|
url: '/wms/materialCoil/list',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: {
|
params: {
|
||||||
coilIds
|
coilIds,
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 1000
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -57,3 +57,16 @@ export function getDeliveryReport(query) {
|
|||||||
params: query
|
params: query
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取当前可用的钢卷列表
|
||||||
|
*/
|
||||||
|
export function listSelectableCoils(planId) {
|
||||||
|
return request({
|
||||||
|
url: '/wms/deliveryPlan/selectableCoils',
|
||||||
|
method: 'get',
|
||||||
|
params: {
|
||||||
|
planId: planId
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
<el-dialog title="选择钢卷" :visible.sync="dialogVisible" width="900px" :close-on-click-modal="false"
|
<el-dialog title="选择钢卷" :visible.sync="dialogVisible" width="900px" :close-on-click-modal="false"
|
||||||
@close="handleClose" append-to-body>
|
@close="handleClose" append-to-body>
|
||||||
<!-- 搜索区域 -->
|
<!-- 搜索区域 -->
|
||||||
<el-form :inline="true" :model="queryParams" class="search-form">
|
<el-form v-if="!rangeMode" :inline="true" :model="queryParams" class="search-form">
|
||||||
<el-form-item label="卷号">
|
<el-form-item label="卷号">
|
||||||
<el-input v-model="queryParams.currentCoilNo" placeholder="请输入卷号" clearable size="small"
|
<el-input v-model="queryParams.currentCoilNo" placeholder="请输入卷号" clearable size="small"
|
||||||
@keyup.enter.native="handleQuery" />
|
@keyup.enter.native="handleQuery" />
|
||||||
@@ -47,7 +47,7 @@
|
|||||||
</el-table>
|
</el-table>
|
||||||
|
|
||||||
<!-- 分页 -->
|
<!-- 分页 -->
|
||||||
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
|
<pagination v-if="!rangeMode" v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
|
||||||
@pagination="getList" />
|
@pagination="getList" />
|
||||||
|
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
@@ -91,6 +91,15 @@ export default {
|
|||||||
type: Object,
|
type: Object,
|
||||||
default: null
|
default: null
|
||||||
},
|
},
|
||||||
|
rangeMode: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
},
|
||||||
|
// 返回选择模式,不再通过list借口获取,而是传入可以选择的钢卷数据
|
||||||
|
rangeData: {
|
||||||
|
type: Array,
|
||||||
|
default: () => []
|
||||||
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@@ -178,6 +187,12 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
// 获取钢卷列表
|
// 获取钢卷列表
|
||||||
async getList() {
|
async getList() {
|
||||||
|
// 如果是范围模式,直接使用传入数据
|
||||||
|
if (this.rangeMode) {
|
||||||
|
this.coilList = this.rangeData || [];
|
||||||
|
this.total = this.coilList.length;
|
||||||
|
return;
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
const params = { ...this.queryParams, ...this.filters };
|
const params = { ...this.queryParams, ...this.filters };
|
||||||
|
|||||||
@@ -49,7 +49,7 @@
|
|||||||
<el-form ref="form" :model="form" label-width="80px">
|
<el-form ref="form" :model="form" label-width="80px">
|
||||||
<el-form-item label="发货钢卷" prop="coilId">
|
<el-form-item label="发货钢卷" prop="coilId">
|
||||||
<div style="display: flex; gap: 10px;">
|
<div style="display: flex; gap: 10px;">
|
||||||
<coil-selector v-model="form.coilId" :use-trigger="true" @select="handleSelect" />
|
<coil-selector v-model="form.coilId" :use-trigger="true" @select="handleSelect" :rangeMode="true" :rangeData="coilList" />
|
||||||
<el-checkbox v-model="autoFillForm" label="自动填写表单信息" />
|
<el-checkbox v-model="autoFillForm" label="自动填写表单信息" />
|
||||||
</div>
|
</div>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@@ -108,6 +108,10 @@ export default {
|
|||||||
waybillId: {
|
waybillId: {
|
||||||
type: String,
|
type: String,
|
||||||
default: '',
|
default: '',
|
||||||
|
},
|
||||||
|
coilList: {
|
||||||
|
type: Array,
|
||||||
|
default: () => []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
@@ -273,12 +277,14 @@ export default {
|
|||||||
this.getList();
|
this.getList();
|
||||||
}).finally(() => {
|
}).finally(() => {
|
||||||
this.buttonLoading = false;
|
this.buttonLoading = false;
|
||||||
|
this.$emit('update');
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
addDeliveryWaybillDetail(this.form).then(response => {
|
addDeliveryWaybillDetail(this.form).then(response => {
|
||||||
this.$modal.msgSuccess("新增成功");
|
this.$modal.msgSuccess("新增成功");
|
||||||
this.open = false;
|
this.open = false;
|
||||||
this.getList();
|
this.getList();
|
||||||
|
this.$emit('add');
|
||||||
}).finally(() => {
|
}).finally(() => {
|
||||||
this.buttonLoading = false;
|
this.buttonLoading = false;
|
||||||
});
|
});
|
||||||
@@ -296,6 +302,7 @@ export default {
|
|||||||
this.loading = false;
|
this.loading = false;
|
||||||
this.getList();
|
this.getList();
|
||||||
this.$modal.msgSuccess("删除成功");
|
this.$modal.msgSuccess("删除成功");
|
||||||
|
this.$emit('delete');
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
}).finally(() => {
|
}).finally(() => {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
|
|||||||
@@ -104,7 +104,7 @@
|
|||||||
<div class="waybill-pickup-location">
|
<div class="waybill-pickup-location">
|
||||||
<!-- <div class="pickup-location-item inline"> -->
|
<!-- <div class="pickup-location-item inline"> -->
|
||||||
<span class="label">取货地点:</span>
|
<span class="label">取货地点:</span>
|
||||||
<input type="text" class="editable-input full-input transparent-input" />
|
<input type="text" class="editable-input full-input transparent-input" v-model="localWaybill.pickupLocation" />
|
||||||
<!-- </div> -->
|
<!-- </div> -->
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -159,7 +159,8 @@ export default {
|
|||||||
deliveryDay: '',
|
deliveryDay: '',
|
||||||
principal: '',
|
principal: '',
|
||||||
principalPhone: '',
|
principalPhone: '',
|
||||||
licensePlate: ''
|
licensePlate: '',
|
||||||
|
pickupLocation: ''
|
||||||
},
|
},
|
||||||
// 本地可编辑的发货单明细
|
// 本地可编辑的发货单明细
|
||||||
localWaybillDetails: []
|
localWaybillDetails: []
|
||||||
@@ -178,7 +179,8 @@ export default {
|
|||||||
deliveryDay: this.getDayFromDate(newVal.deliveryTime) || '',
|
deliveryDay: this.getDayFromDate(newVal.deliveryTime) || '',
|
||||||
principal: newVal.principal || '',
|
principal: newVal.principal || '',
|
||||||
principalPhone: newVal.principalPhone || '',
|
principalPhone: newVal.principalPhone || '',
|
||||||
licensePlate: newVal.licensePlate || ''
|
licensePlate: newVal.licensePlate || '',
|
||||||
|
pickupLocation: newVal.pickupLocation || ''
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -187,6 +189,7 @@ export default {
|
|||||||
},
|
},
|
||||||
waybillDetails: {
|
waybillDetails: {
|
||||||
handler(newVal) {
|
handler(newVal) {
|
||||||
|
console.log('waybillDetails', newVal);
|
||||||
if (newVal && Array.isArray(newVal)) {
|
if (newVal && Array.isArray(newVal)) {
|
||||||
this.localWaybillDetails = [...newVal];
|
this.localWaybillDetails = [...newVal];
|
||||||
} else {
|
} else {
|
||||||
@@ -222,27 +225,6 @@ export default {
|
|||||||
}
|
}
|
||||||
return '';
|
return '';
|
||||||
},
|
},
|
||||||
// 添加明细
|
|
||||||
addDetail() {
|
|
||||||
this.localWaybillDetails.push({
|
|
||||||
productName: '',
|
|
||||||
edgeType: '',
|
|
||||||
packageType: '',
|
|
||||||
settlementType: '',
|
|
||||||
rawMaterialFactory: '',
|
|
||||||
coilNumber: '',
|
|
||||||
specification: '',
|
|
||||||
material: '',
|
|
||||||
quantity: 0,
|
|
||||||
weight: 0,
|
|
||||||
unitPrice: 0,
|
|
||||||
remark: ''
|
|
||||||
});
|
|
||||||
},
|
|
||||||
// 删除明细
|
|
||||||
deleteDetail(index) {
|
|
||||||
this.localWaybillDetails.splice(index, 1);
|
|
||||||
},
|
|
||||||
// 保存为图片
|
// 保存为图片
|
||||||
saveAsImage() {
|
saveAsImage() {
|
||||||
const node = this.$refs.waybillRef;
|
const node = this.$refs.waybillRef;
|
||||||
|
|||||||
@@ -92,7 +92,7 @@
|
|||||||
<el-table-column label="厂家" align="center" prop="manufacturer" />
|
<el-table-column label="厂家" align="center" prop="manufacturer" />
|
||||||
<el-table-column label="重量(t)" align="center" prop="netWeight" width="100" />
|
<el-table-column label="重量(t)" align="center" prop="netWeight" width="100" />
|
||||||
<el-table-column label="库区" align="center" prop="warehouseName" :show-overflow-tooltip="true" />
|
<el-table-column label="库区" align="center" prop="warehouseName" :show-overflow-tooltip="true" />
|
||||||
<el-table-column label="操作" align="center" width="100">
|
<el-table-column label="操作" align="center" width="100" fixed="right">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button type="danger" size="small" @click.stop="handleDeleteCoil(scope.row)">删除</el-button>
|
<el-button type="danger" size="small" @click.stop="handleDeleteCoil(scope.row)">删除</el-button>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -80,7 +80,7 @@
|
|||||||
|
|
||||||
<el-divider style="margin: 20px 0;" />
|
<el-divider style="margin: 20px 0;" />
|
||||||
|
|
||||||
<DeliveryWaybillDetail ref="detailTable" :waybillId="waybillId" />
|
<DeliveryWaybillDetail ref="detailTable" :waybillId="waybillId" :coilList="coilList" @add="refreshCoilList" @update="refreshCoilList" @delete="refreshCoilList" />
|
||||||
</el-card>
|
</el-card>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
@@ -138,7 +138,8 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { listDeliveryWaybill, getDeliveryWaybill, delDeliveryWaybill, addDeliveryWaybill, updateDeliveryWaybill } from "@/api/wms/deliveryWaybill";
|
import { listDeliveryWaybill, getDeliveryWaybill, delDeliveryWaybill, addDeliveryWaybill, updateDeliveryWaybill } from "@/api/wms/deliveryWaybill";
|
||||||
import { listDeliveryPlan } from "@/api/wms/deliveryPlan"; // 导入发货计划API
|
import { listDeliveryPlan, listSelectableCoils } from "@/api/wms/deliveryPlan"; // 导入发货计划API
|
||||||
|
import { listCoilByIds } from "@/api/wms/coil";
|
||||||
import { listDeliveryWaybillDetail } from "@/api/wms/deliveryWaybillDetail";
|
import { listDeliveryWaybillDetail } from "@/api/wms/deliveryWaybillDetail";
|
||||||
import MemoInput from "@/components/MemoInput";
|
import MemoInput from "@/components/MemoInput";
|
||||||
import DeliveryWaybillDetail from "../components/detailTable.vue";
|
import DeliveryWaybillDetail from "../components/detailTable.vue";
|
||||||
@@ -215,7 +216,8 @@ export default {
|
|||||||
planName: undefined,
|
planName: undefined,
|
||||||
planType: 0,
|
planType: 0,
|
||||||
auditStatus: 1,
|
auditStatus: 1,
|
||||||
}
|
},
|
||||||
|
coilList: []
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
@@ -238,6 +240,13 @@ export default {
|
|||||||
this.loading = false;
|
this.loading = false;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
refreshCoilList() {
|
||||||
|
if (this.selectedPlan && this.selectedPlan.planId) {
|
||||||
|
listSelectableCoils(this.selectedPlan.planId).then(response => {
|
||||||
|
this.coilList = response.data;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
/** 完成状态改变时的处理 */
|
/** 完成状态改变时的处理 */
|
||||||
handleStatusChange(row) {
|
handleStatusChange(row) {
|
||||||
// 确保在更新状态时包含waybillId
|
// 确保在更新状态时包含waybillId
|
||||||
@@ -314,6 +323,7 @@ export default {
|
|||||||
},
|
},
|
||||||
handlePlanSelect(row) {
|
handlePlanSelect(row) {
|
||||||
this.selectedPlan = row;
|
this.selectedPlan = row;
|
||||||
|
this.refreshCoilList();
|
||||||
// 更新查询参数,根据选中的planId筛选发货单
|
// 更新查询参数,根据选中的planId筛选发货单
|
||||||
this.queryParams.planId = row.planId;
|
this.queryParams.planId = row.planId;
|
||||||
this.waybillId = null;
|
this.waybillId = null;
|
||||||
@@ -398,8 +408,6 @@ export default {
|
|||||||
/** 打印发货单 */
|
/** 打印发货单 */
|
||||||
handlePrint(row) {
|
handlePrint(row) {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
// 设置当前发货单
|
|
||||||
this.currentWaybill = row;
|
|
||||||
// 获取发货单明细
|
// 获取发货单明细
|
||||||
listDeliveryWaybillDetail({
|
listDeliveryWaybillDetail({
|
||||||
waybillId: row.waybillId,
|
waybillId: row.waybillId,
|
||||||
@@ -408,6 +416,7 @@ export default {
|
|||||||
}).then(response => {
|
}).then(response => {
|
||||||
// 处理字段映射,确保与wayBill组件使用的字段名一致
|
// 处理字段映射,确保与wayBill组件使用的字段名一致
|
||||||
this.currentWaybillDetails = response.rows.map(item => ({
|
this.currentWaybillDetails = response.rows.map(item => ({
|
||||||
|
coilId: item.coilId,
|
||||||
productName: item.productName,
|
productName: item.productName,
|
||||||
edgeType: item.edgeType,
|
edgeType: item.edgeType,
|
||||||
packageType: item.packaging, // 映射packaging到packageType
|
packageType: item.packaging, // 映射packaging到packageType
|
||||||
@@ -421,6 +430,17 @@ export default {
|
|||||||
unitPrice: item.unitPrice,
|
unitPrice: item.unitPrice,
|
||||||
remark: item.remark
|
remark: item.remark
|
||||||
}));
|
}));
|
||||||
|
const coils = this.currentWaybillDetails.map(item => item.coilId).join(',');
|
||||||
|
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.printDialogVisible = true;
|
this.printDialogVisible = true;
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
|
|||||||
Reference in New Issue
Block a user