Commit dfc37e17 by 张恒

Merge remote-tracking branch 'origin/weiqiao-vue3' into weiqiao-vue3

parents d4c05731 6f360236
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
v-bind="$attrs" v-bind="$attrs"
@register="registerModal" @register="registerModal"
title="生成领料单" title="生成领料单"
width="700px" width="1000px"
:confirmLoading="loading" :confirmLoading="loading"
@ok="handleOk" @ok="handleOk"
@cancel="handleCancel" @cancel="handleCancel"
...@@ -42,19 +42,21 @@ ...@@ -42,19 +42,21 @@
const columns: BasicColumn[] = [ const columns: BasicColumn[] = [
{ title: '物料编码', dataIndex: 'wlbh', width: 120 }, { title: '物料编码', dataIndex: 'wlbh', width: 120 },
{ title: '物料名称', dataIndex: 'wlmc', width: 200 }, { title: '物料名称', dataIndex: 'wlmc', width: 200 },
{ title: '备料数量', dataIndex: 'blsl', width: 200 },
{ title: '库存数量', dataIndex: 'kcl', width: 200 },
{ {
title: '领料数量', title: '领料数量',
dataIndex: 'blsl', dataIndex: 'sl',
width: 130, width: 130,
// 常驻输入框 // 常驻输入框
customRender: ({ record }) => customRender: ({ record }) =>
h(InputNumber, { h(InputNumber, {
value: record.blsl, value: 0,
min: 0, min: 0,
max: 999999, max: 999999,
size: 'small', size: 'small',
style: { width: '100%' }, style: { width: '100%' },
onChange: (val) => (record.blsl = val), // onChange: (val) => (record.sl = val),
}), }),
}, },
]; ];
...@@ -77,11 +79,20 @@ ...@@ -77,11 +79,20 @@
return; return;
} }
// 校验库存数量是否足够
const insufficientItem = tableData.value.find((r) => (r.kcl || 0) < (r.blsl || 0));
if (insufficientItem) {
createMessage.warning(`${insufficientItem.wlmc}库存数量不足`);
return;
}
// 构建请求参数 // 构建请求参数
const requestData = tableData.value.map(item => ({ const requestData = tableData.value.map((item) => ({
wlbm: item.wlbh, // 物料编码 wlbm: item.wlbh, // 物料编码
wlmc: item.wlmc, // 物料名称 wlmc: item.wlmc, // 物料名称
sl: item.blsl || 0 // 领料数量 blsl: item.blsl || 0, // 备料数量
kcl: item.kcl || 0, // 库存数量
sl: item.sl || 0, // 领料数量
})); }));
loading.value = true; loading.value = true;
...@@ -94,7 +105,7 @@ ...@@ -94,7 +105,7 @@
}, },
{ {
errorMessageMode: 'message', errorMessageMode: 'message',
} },
); );
// 接口调用成功 // 接口调用成功
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment