添加工序配置
修改入库页面,任务完成,库存页面等
This commit is contained in:
1 parent
c2b039ea47
commit
5a04ca9d59
41 files changed
+1151
-84
No files matched your search
@@ -39,6 +39,21 @@
|
||||
<a-input v-model="form.processName" />
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item field="sourceCode" label="单号">
|
||||
<a-input v-model="form.sourceCode" style="width: 100%" ref="sourceCodeRef" @@keydown.enter="focusNext('numInput')"/>
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item field="type" label="小托盘类型" >
|
||||
<a-radio-group v-model="form.type" type="button">
|
||||
<a-radio
|
||||
v-for="item in trayTypeOptions"
|
||||
:key="item.value"
|
||||
:value="item.value">
|
||||
{{ item.label }}
|
||||
</a-radio>
|
||||
</a-radio-group>
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item field="qty" label="小托盘数量">
|
||||
<a-input-number v-model="form.qty" :min="0" style="width: 100%" ref="numInput" @@keydown.enter="focusNext('operatorIdRef')"/>
|
||||
</a-form-item>
|
||||
@@ -57,9 +72,10 @@
|
||||
|
||||
<a-form-item>
|
||||
<a-space>
|
||||
<a-button type="primary" @@click="submitForm" :loading="loading">上架入库</a-button>
|
||||
<a-button type="success" @@click="submitEmptyPallet" :loading="loading">空托盘入库</a-button>
|
||||
<a-button @@click="resetForm">重置</a-button>
|
||||
<a-button type="primary" status="success" @@click="submitForm" :loading="loading">上架入库</a-button>
|
||||
<a-button type="primary" status="warning" @@click="submitEmptyPallet" :loading="loading">空托盘入库</a-button>
|
||||
<a-button type="primary" status="danger" @@click="emptyPalletOut" :loading="loading">空托盘出库</a-button>
|
||||
<a-button type="outline" @@click="resetForm">重置</a-button>
|
||||
</a-space>
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
@@ -79,13 +95,16 @@
|
||||
|
||||
const palletCodeRef = ref(null);
|
||||
const materialCodeRef = ref(null);
|
||||
const sourceCodeRef = ref(null);
|
||||
const numInput = ref(null);
|
||||
const operatorIdRef = ref(null);
|
||||
const operatorInfoRef = ref(null);
|
||||
const trayTypeOptions = ref([]);
|
||||
|
||||
const inputRefs = {
|
||||
palletCodeRef,
|
||||
materialCodeRef,
|
||||
sourceCodeRef,
|
||||
numInput,
|
||||
operatorIdRef,
|
||||
operatorInfoRef
|
||||
@@ -101,11 +120,13 @@
|
||||
const form = reactive({
|
||||
palletCode: '',
|
||||
materialCode: '',
|
||||
sourceCode:'',
|
||||
orderId: '',
|
||||
operatorId: '',
|
||||
processId: '',
|
||||
processName:'',
|
||||
name:'',
|
||||
type:'',
|
||||
qty:null,
|
||||
isQualified: true,
|
||||
operatorInfo: ''
|
||||
@@ -157,7 +178,7 @@
|
||||
|
||||
const processSelect = (value) => {
|
||||
form.processName = processOptions.value.find(item => item.value === value).processName;
|
||||
focusNext('numInput');
|
||||
focusNext('sourceCodeRef');
|
||||
}
|
||||
|
||||
// 加载工序列表
|
||||
@@ -358,6 +379,35 @@
|
||||
});
|
||||
};
|
||||
|
||||
// 呼叫空托盘出库
|
||||
const emptyPalletOut = () => {
|
||||
loading.value = true;
|
||||
|
||||
$.ajax({
|
||||
type: "post",
|
||||
dataType: "json",
|
||||
contentType: "application/json",
|
||||
url: "/receipt/ReceiptIn/EmptyPalletOut",
|
||||
success: (json) => {
|
||||
if (json.Code == 200) {
|
||||
Message.success('空托盘出库任务创建成功!');
|
||||
resetForm();
|
||||
} else {
|
||||
Message.error({
|
||||
content: json.Msg || '空托盘出库任务创建失败!',
|
||||
duration: 5000
|
||||
});
|
||||
}
|
||||
},
|
||||
error: (xhr, status, error) => {
|
||||
Message.error('提交失败:' + error);
|
||||
},
|
||||
complete: () => {
|
||||
loading.value = false;
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
// 重置表单
|
||||
const resetForm = () => {
|
||||
formRef.value.resetFields();
|
||||
@@ -369,6 +419,29 @@
|
||||
}, 100);
|
||||
};
|
||||
|
||||
// 从后端获取托盘类型列表
|
||||
const loadTrayTypes = () => {
|
||||
// 调用后端接口获取数据
|
||||
axios.get('/receipt/ReceiptIn/GetTrayTypes')
|
||||
.then(response => {
|
||||
const result = response.data;
|
||||
console.log(result)
|
||||
if (result.Code == 200) {
|
||||
// 假设后端返回格式:[{value: 'mini', label: 'Mini'}, ...]
|
||||
trayTypeOptions.value = result.Data;
|
||||
|
||||
// 可选:设置默认值(取第一个选项)
|
||||
if (trayTypeOptions.value.length > 0) {
|
||||
form.type = trayTypeOptions.value[0].value;
|
||||
}
|
||||
} else {
|
||||
Message.error('获取托盘类型失败:' + result.Msg);
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
Message.error('请求失败:' + error.message);
|
||||
});
|
||||
};
|
||||
|
||||
// 生命周期钩子
|
||||
onMounted(() => {
|
||||
@@ -378,6 +451,8 @@
|
||||
palletCodeRef.value.focus();
|
||||
}
|
||||
}, 100);
|
||||
|
||||
loadTrayTypes();
|
||||
});
|
||||
|
||||
return {
|
||||
@@ -391,19 +466,22 @@
|
||||
scanMaterial,
|
||||
submitForm,
|
||||
submitEmptyPallet,
|
||||
emptyPalletOut,
|
||||
resetForm,
|
||||
materialOptions,
|
||||
handleMaterialSearch,
|
||||
handleMaterialSelect,
|
||||
palletCodeRef,
|
||||
materialCodeRef,
|
||||
sourceCodeRef,
|
||||
numInput,
|
||||
operatorIdRef,
|
||||
operatorInfoRef,
|
||||
focusNext,
|
||||
loadProcesses,
|
||||
loadProcessesByMaterial,
|
||||
processSelect
|
||||
processSelect,
|
||||
trayTypeOptions
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user