fix:永丰售后修复BUG,
1,物料库存获取不到ERP:重新调整触发查询逻辑 2,工序变更导致物料无法出库:配置旧工序 3,测试出库订单ERP推送,任务下发
This commit is contained in:
1 parent
b2a9a38f38
commit
c76e7bb681
69 files changed
+5510
-157
No files matched your search
@@ -168,9 +168,9 @@
|
||||
type: [
|
||||
{ required: true, message: '请选择托盘类型', trigger: ['change', 'blur'] }
|
||||
],
|
||||
//sourceCode: [
|
||||
//{ required: true, message: '请选择生产单据', trigger: ['change', 'blur'] }
|
||||
//],
|
||||
sourceCode: [
|
||||
{ required: true, message: '请选择生产单号', trigger: ['change', 'blur'] }
|
||||
],
|
||||
//billCode: [
|
||||
//{ required: true, message: '请输入客户单据', trigger: ['change', 'blur'] }
|
||||
//],
|
||||
@@ -246,37 +246,27 @@
|
||||
});
|
||||
}
|
||||
|
||||
// 根据物料加载工序列表
|
||||
const loadProcessesByMaterial = (materialCode) => {
|
||||
if (!materialCode) {
|
||||
form.processId = '';
|
||||
processOptions.value = [];
|
||||
return;
|
||||
}
|
||||
// 加载工序列表:默认展示全部工序,选完工序再由生产订单决定用哪道
|
||||
const loadProcesses = () => {
|
||||
processOptions.value = [];
|
||||
$.ajax({
|
||||
type: "post",
|
||||
dataType: "json",
|
||||
data: { materialCode: materialCode },
|
||||
url: "/receipt/ReceiptIn/GetProcessesByMaterial",
|
||||
success: (json) => {
|
||||
if (json.Code == 200) {
|
||||
|
||||
const newOptions = json.Data.map(item => ({
|
||||
processOptions.value = (json.Data || []).map(item => ({
|
||||
...item,
|
||||
value: item.value,
|
||||
label: `${item.processCode} - ${item.processName}`
|
||||
}));
|
||||
// 使用新数组赋值,强制组件重新渲染
|
||||
processOptions.value = [...newOptions];
|
||||
|
||||
} else {
|
||||
Message.error(json.Msg || '加载物料工序失败');
|
||||
Message.error(json.Msg || '加载工序列表失败');
|
||||
processOptions.value = [];
|
||||
}
|
||||
},
|
||||
error: (xhr, status, error) => {
|
||||
Message.error('加载物料工序失败:' + error);
|
||||
Message.error('加载工序列表失败:' + error);
|
||||
processOptions.value = [];
|
||||
}
|
||||
});
|
||||
@@ -300,15 +290,24 @@
|
||||
|
||||
const searchMaterials = (keyword) => {
|
||||
axios.get(`/receipt/ReceiptIn/SearchMaterials?keyword=${encodeURIComponent(keyword)}`)
|
||||
.then(function (json) {
|
||||
if (json.data.Code == 200) {
|
||||
materialOptions.value = json.data.Data.map(item => ({
|
||||
.then(function (response) {
|
||||
// axios 返回的是响应对象,接口数据在 response.data 里
|
||||
const json = response.data;
|
||||
if (json.Code == 200) {
|
||||
materialOptions.value = (json.Data || []).map(item => ({
|
||||
...item,
|
||||
value: item.MaterialCode,
|
||||
label: `${item.MaterialCode} - ${item.MaterialType} - ${item.MaterialName}`
|
||||
}));
|
||||
|
||||
// 扫描/输入完整物料编码时,自动带出图号并加载工序
|
||||
const exactCode = (form.materialCode || '').trim();
|
||||
const exactItem = materialOptions.value.find(item => item.MaterialCode === exactCode);
|
||||
if (exactItem) {
|
||||
handleMaterialSelect(exactItem.value, null);
|
||||
}
|
||||
} else {
|
||||
Message.error(json.data.Msg);
|
||||
Message.error(json.Msg || '获取物料列表失败');
|
||||
materialOptions.value = [];
|
||||
}
|
||||
})
|
||||
@@ -324,7 +323,7 @@
|
||||
if (selectedMaterial) {
|
||||
form.materialCode = selectedMaterial.MaterialCode;
|
||||
form.name = selectedMaterial.MaterialType;
|
||||
// 选择物料后加载相关工序
|
||||
// 选择物料后重新加载全部工序(工序由后续的生产订单决定)
|
||||
// 先清空当前工序选择,避免显示旧数据
|
||||
form.processId = '';
|
||||
form.processName = '';
|
||||
@@ -335,9 +334,9 @@
|
||||
processOptions.value = [];
|
||||
orderOptions.value = [];
|
||||
|
||||
// 延迟加载新工序,确保先清空再加载
|
||||
// 延迟加载工序,确保先清空再加载
|
||||
nextTick(() => {
|
||||
loadProcessesByMaterial(selectedMaterial.MaterialCode);
|
||||
loadProcesses();
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -345,7 +344,7 @@
|
||||
// 扫描物料码
|
||||
const scanMaterial = () => {
|
||||
if (!form.materialCode) return;
|
||||
loadProcessesByMaterial(form.materialCode);
|
||||
loadProcesses();
|
||||
};
|
||||
|
||||
// 提交表单
|
||||
@@ -498,6 +497,8 @@
|
||||
|
||||
loadTrayTypes();
|
||||
loadOperators();
|
||||
// 页面加载即展示全部工序,不依赖物料工序配置
|
||||
loadProcesses();
|
||||
});
|
||||
|
||||
const operatorOptions = ref([]);
|
||||
@@ -543,7 +544,7 @@
|
||||
operatorIdRef,
|
||||
operatorInfoRef,
|
||||
focusNext,
|
||||
loadProcessesByMaterial,
|
||||
loadProcesses,
|
||||
processSelect,
|
||||
orderSelect,
|
||||
trayTypeOptions,
|
||||
|
||||
Reference in new issue
Block a user