线边操作添加ERP关联
This commit is contained in:
1 parent
713c3528ad
commit
0e5d0247bf
19 files changed
+1467
-139
No files matched your search
@@ -0,0 +1,13 @@
|
||||
@model HHWMS.Web.ReceiptHeaderVM
|
||||
@inject IStringLocalizer<Program> Localizer;
|
||||
|
||||
<wt:form vm="@Model">
|
||||
<wt:row items-per-row="ItemsPerRowEnum.One">
|
||||
<wt:textbox field="Entity.SourceCode" />
|
||||
</wt:row>
|
||||
<wt:hidden field="Entity.ID" />
|
||||
<wt:row align="AlignEnum.Right">
|
||||
<wt:submitbutton />
|
||||
<wt:closebutton />
|
||||
</wt:row>
|
||||
</wt:form>
|
||||
@@ -22,7 +22,7 @@
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item label="图号" field="name">
|
||||
<a-input v-model="form.name" />
|
||||
<a-input v-model="form.name" disabled="true"/>
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item label="当前工序" field="processId">
|
||||
@@ -40,7 +40,13 @@
|
||||
</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-select v-model="form.sourceCode" placeholder="请选择单号" ref="sourceCodeRef" @@change="orderSelect">
|
||||
<a-option v-for="item in orderOptions"
|
||||
:key="item.value"
|
||||
:value="item.value">
|
||||
{{ item.label }}
|
||||
</a-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item field="type" label="小托盘类型" >
|
||||
@@ -132,6 +138,7 @@
|
||||
operatorInfo: ''
|
||||
});
|
||||
const processOptions = ref([]);
|
||||
const orderOptions = ref([]);
|
||||
const materialOptions = ref([]);
|
||||
let searchTimer = null;
|
||||
|
||||
@@ -178,27 +185,46 @@
|
||||
|
||||
const processSelect = (value) => {
|
||||
form.processName = processOptions.value.find(item => item.value === value).processName;
|
||||
// 选择工序后,加载订单列表
|
||||
loadOrdersByMaterial(form.materialCode);
|
||||
focusNext('sourceCodeRef');
|
||||
}
|
||||
|
||||
// 加载工序列表
|
||||
const loadProcesses = () => {
|
||||
|
||||
const orderSelect = (value) => {
|
||||
form.orderId = orderOptions.value.find(item => item.value === value).label;
|
||||
focusNext('numInput');
|
||||
}
|
||||
|
||||
// 根据物料加载订单列表
|
||||
const loadOrdersByMaterial = (materialCode) => {
|
||||
if (!materialCode) {
|
||||
form.sourceCode = '';
|
||||
orderOptions.value = [];
|
||||
return;
|
||||
}
|
||||
orderOptions.value = [];
|
||||
$.ajax({
|
||||
type: "post",
|
||||
dataType: "json",
|
||||
url: "/receipt/ReceiptIn/GetProcesses",
|
||||
data: { materialCode: materialCode },
|
||||
url: "/receipt/ReceiptIn/GetOrdersByMaterial",
|
||||
success: (json) => {
|
||||
if (json.Code == 200) {
|
||||
processOptions.value = json.Data;
|
||||
orderOptions.value = json.Data || [];
|
||||
if (orderOptions.value.length === 0) {
|
||||
Message.warning('该物料暂无关联订单');
|
||||
}
|
||||
console.log(orderOptions.value);
|
||||
} else {
|
||||
Message.error(json.Msg || '加载工序列表失败');
|
||||
Message.error(json.Msg || "获取订单列表失败");
|
||||
}
|
||||
},
|
||||
error: (xhr, status, error) => {
|
||||
Message.error('加载工序列表失败:' + error);
|
||||
error: (error) => {
|
||||
console.error("获取订单列表失败", error);
|
||||
Message.error("获取订单列表失败");
|
||||
}
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
// 根据物料加载工序列表
|
||||
const loadProcessesByMaterial = (materialCode) => {
|
||||
@@ -236,12 +262,6 @@
|
||||
});
|
||||
};
|
||||
|
||||
// 扫描托盘码
|
||||
const scanPallet = () => {
|
||||
if (!form.palletCode) return;
|
||||
// TODO: 实现托盘码验证逻辑
|
||||
};
|
||||
|
||||
// 处理物料搜索
|
||||
const handleMaterialSearch = (value) => {
|
||||
if (searchTimer) {
|
||||
@@ -253,13 +273,13 @@
|
||||
} else {
|
||||
materialOptions.value = [];
|
||||
}
|
||||
}, 300);
|
||||
}, 1000);
|
||||
};
|
||||
|
||||
// 搜索物料
|
||||
|
||||
const searchMaterials = (keyword) => {
|
||||
axios.get(`/receipt/SimpleReceiptIn/SearchMaterials?keyword=${encodeURIComponent(keyword)}`)
|
||||
axios.get(`/receipt/ReceiptIn/SearchMaterials?keyword=${encodeURIComponent(keyword)}`)
|
||||
.then(function (json) {
|
||||
if (json.data.Code == 200) {
|
||||
materialOptions.value = json.data.Data.map(item => ({
|
||||
@@ -412,6 +432,7 @@
|
||||
const resetForm = () => {
|
||||
formRef.value.resetFields();
|
||||
processOptions.value = [];
|
||||
orderOptions.value = [];
|
||||
setTimeout(() => {
|
||||
if (palletCodeRef.value) {
|
||||
palletCodeRef.value.focus();
|
||||
@@ -460,8 +481,8 @@
|
||||
form,
|
||||
loading,
|
||||
processOptions,
|
||||
orderOptions,
|
||||
rules,
|
||||
scanPallet,
|
||||
validateContainer,
|
||||
scanMaterial,
|
||||
submitForm,
|
||||
@@ -478,9 +499,9 @@
|
||||
operatorIdRef,
|
||||
operatorInfoRef,
|
||||
focusNext,
|
||||
loadProcesses,
|
||||
loadProcessesByMaterial,
|
||||
processSelect,
|
||||
orderSelect,
|
||||
trayTypeOptions
|
||||
};
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user