添加wcs任务下发测试

修改入库功能
重新生成material页面
This commit is contained in:
zhougf committed 2025-05-26 19:06:50 +08:00
1 parent 541fb5df6e
commit 2b01cc7584
20 files changed
+518 -60

No files matched your search

@@ -8,7 +8,16 @@
</a-form-item>
<a-form-item label="物料码" field="materialCode">
<a-input v-model="form.materialCode" @@change="scanMaterial" ref="materialCodeRef" placeholder="请扫描物料码" @@keydown.enter.prevent="focusNext('quantityInput')" />
<a-auto-complete
v-model="form.materialCode"
:data="materialOptions"
placeholder="请扫描或输入物料码"
@@search="handleMaterialSearch"
@@select="handleMaterialSelect"
ref="materialCodeRef"
@@keydown.enter.prevent="focusNext('quantityInput')"
>
</a-auto-complete>
</a-form-item>
<a-form-item label="生产订单" field="orderId">
@@ -96,6 +105,9 @@
const operatorOptions = ref([]);
const processOptions = ref([]);
const materialOptions = ref([]);
let searchTimer = null;
const rules = {
palletCode: [
{ required: true, message: '请输入托盘码', trigger: ['change', 'blur'] }
@@ -162,6 +174,57 @@
// TODO: 实现托盘码验证逻辑
};
// 处理物料搜索
const handleMaterialSearch = (value) => {
if (searchTimer) {
clearTimeout(searchTimer);
}
searchTimer = setTimeout(() => {
if (value) {
searchMaterials(value);
} else {
materialOptions.value = [];
}
}, 300);
};
// 搜索物料
const searchMaterials = (keyword) => {
$.ajax({
type: "post",
dataType: "json",
data: { keyword: keyword },
url: "/receipt/ReceiptIn/SearchMaterials",
success: (json) => {
console.log(json);
if (json.Code == 200) {
materialOptions.value = json.Data.map(item => ({
...item,
value: item.MaterialCode,
label: `${item.MaterialCode} - ${item.MaterialName}`
}));console.log(materialOptions.value)
} else {
Message.error(json.Msg || '搜索失败');
materialOptions.value = [];
}
},
error: (xhr, status, error) => {
Message.error('搜索失败:' + error);
materialOptions.value = [];
}
});
};
// 处理物料选择
const handleMaterialSelect = (value, option) => {
const selectedMaterial = materialOptions.value.find(item => item.value === value);
if (selectedMaterial) {
form.materialCode = selectedMaterial.MaterialCode;
// 选择物料后加载相关订单
scanMaterial();
}
};
// 扫描物料码
const scanMaterial = () => {
if (!form.materialCode) return;
@@ -287,7 +350,10 @@
handleOrderChange,
submitForm,
resetForm,
focusNext
focusNext,
materialOptions,
handleMaterialSearch,
handleMaterialSelect
};
}
});