入场卷号输入优化
This commit is contained in:
@@ -74,7 +74,15 @@
|
||||
</el-form>
|
||||
<el-form :model="form" ref="taskForm" label-width="80px" size="small">
|
||||
<el-form-item label="入场卷号" prop="enterCoilNos" :rules="[{ required: true, message: '请输入入场卷号', trigger: 'blur' }]">
|
||||
<el-input v-model="form.enterCoilNos" placeholder="请输入入场卷号" style="width: 280px;" />
|
||||
<el-autocomplete
|
||||
v-model="form.enterCoilNos"
|
||||
:fetch-suggestions="queryCoilNo"
|
||||
placeholder="请输入入场卷号(输入2个字符以上自动搜索)"
|
||||
:loading="coilNoLoading"
|
||||
:trigger-on-focus="false"
|
||||
clearable
|
||||
style="width: 280px;"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<!-- <div style="margin-bottom: 8px;">
|
||||
@@ -132,7 +140,8 @@ import { listInspectionItemTemplate, addInspectionItemTemplate } from "@/api/mes
|
||||
import { getInfoByInspectionItem } from "@/api/mes/qc/inspectionItemTemplate";
|
||||
import CoilSelector from "@/components/CoilSelector/index.vue";
|
||||
import CurrentCoilNo from "@/components/KLPService/Renderer/CurrentCoilNo.vue";
|
||||
import CheckItemTransfer from '@/components/KLPService/CheckItemSelect/index'
|
||||
import CheckItemTransfer from '@/components/KLPService/CheckItemSelect/index';
|
||||
import { listMaterialCoil } from "@/api/wms/coil";
|
||||
|
||||
export default {
|
||||
name: "SchemeSelect",
|
||||
@@ -178,7 +187,9 @@ export default {
|
||||
templateName: [
|
||||
{ required: true, message: '请输入方案名称', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
},
|
||||
coilNoOptions: [],
|
||||
coilNoLoading: false,
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
@@ -277,6 +288,26 @@ export default {
|
||||
this.dialogVisible = false;
|
||||
this.$emit("update:visible", false);
|
||||
this.$emit("close");
|
||||
},
|
||||
queryCoilNo(queryString, cb) {
|
||||
if (!queryString || queryString.length < 2) {
|
||||
cb([]);
|
||||
return;
|
||||
}
|
||||
this.coilNoLoading = true;
|
||||
listMaterialCoil({
|
||||
enterCoilNo: queryString,
|
||||
pageNum: 1,
|
||||
pageSize: 20
|
||||
}).then(response => {
|
||||
const options = (response.rows || []).map(item => ({
|
||||
value: item.enterCoilNo,
|
||||
label: item.enterCoilNo
|
||||
}));
|
||||
cb(options);
|
||||
}).finally(() => {
|
||||
this.coilNoLoading = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user