feat(发货单): 增加发货单钢卷选择范围限制功能

- 在CoilSelector组件中新增rangeMode和rangeData属性,支持传入可选钢卷列表
- 发货单明细表增加对可选钢卷列表的支持,并在增删改时刷新列表
- 发货单打印时自动填充取货地点为实际库位前三位
- 调整操作列固定显示在表格右侧
This commit is contained in:
砂糖
2025-12-09 14:37:46 +08:00
parent d4e882610b
commit 2d30a2f3fb
7 changed files with 74 additions and 35 deletions

View File

@@ -49,7 +49,7 @@
<el-form ref="form" :model="form" label-width="80px">
<el-form-item label="发货钢卷" prop="coilId">
<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="自动填写表单信息" />
</div>
</el-form-item>
@@ -108,6 +108,10 @@ export default {
waybillId: {
type: String,
default: '',
},
coilList: {
type: Array,
default: () => []
}
},
components: {
@@ -273,12 +277,14 @@ export default {
this.getList();
}).finally(() => {
this.buttonLoading = false;
this.$emit('update');
});
} else {
addDeliveryWaybillDetail(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
this.$emit('add');
}).finally(() => {
this.buttonLoading = false;
});
@@ -296,6 +302,7 @@ export default {
this.loading = false;
this.getList();
this.$modal.msgSuccess("删除成功");
this.$emit('delete');
}).catch(() => {
}).finally(() => {
this.loading = false;

View File

@@ -104,7 +104,7 @@
<div class="waybill-pickup-location">
<!-- <div class="pickup-location-item inline"> -->
<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>
@@ -159,7 +159,8 @@ export default {
deliveryDay: '',
principal: '',
principalPhone: '',
licensePlate: ''
licensePlate: '',
pickupLocation: ''
},
// 本地可编辑的发货单明细
localWaybillDetails: []
@@ -178,7 +179,8 @@ export default {
deliveryDay: this.getDayFromDate(newVal.deliveryTime) || '',
principal: newVal.principal || '',
principalPhone: newVal.principalPhone || '',
licensePlate: newVal.licensePlate || ''
licensePlate: newVal.licensePlate || '',
pickupLocation: newVal.pickupLocation || ''
};
}
},
@@ -187,6 +189,7 @@ export default {
},
waybillDetails: {
handler(newVal) {
console.log('waybillDetails', newVal);
if (newVal && Array.isArray(newVal)) {
this.localWaybillDetails = [...newVal];
} else {
@@ -222,27 +225,6 @@ export default {
}
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() {
const node = this.$refs.waybillRef;