fix:光芯输入物料表单优化

This commit is contained in:
shijing 2025-06-19 15:46:23 +08:00
parent 125c9759b8
commit cc17dde1dc
2 changed files with 53 additions and 5 deletions

View File

@ -804,6 +804,7 @@ export default {
this.dialog.save = true;
this.$nextTick(() => {
this.$refs.saveDialog.open();
this.codeText = '';
});
},
handleSaveSuccess() {

View File

@ -18,6 +18,27 @@
<el-row>
<el-col>
<el-form-item label="批次号" prop="wm_in">
<xtSelect
:apiObj="apiObjM"
v-model="form.wm_in"
v-model:obj="selectObj"
:labelField="'batch'"
style="width: 100%;"
:params = "paramsM"
>
<!-- :params = "{type__in: '10,20',is_hidden: false}" -->
<el-table-column label="物料" prop="full_name">
<template #default="scope">
<span v-if="scope.row.state==20" style="color: red;border: 1px solid red;border-radius: 3px;">不合格</span>
<span v-if="scope.row.state==30" style="color: orange;border: 1px solid orange;border-radius: 3px;">返工</span>
<span>{{ scope.row.batch }}({{ scope.row.material_name }})</span>
<span v-if="scope.row.defect_name !== null" style="color: orangered">{{ scope.row.defect_name }}</span>
</template>
</el-table-column>
<el-table-column label="数量" prop="count" width="110px"></el-table-column>
</xtSelect>
</el-form-item>
<!-- <el-form-item label="批次号" prop="wm_in">
<el-select
v-model="form.wm_in"
placeholder="物料"
@ -34,6 +55,8 @@
>
<div style="display: flex;justify-content: space-between;">
<div>
<span v-if="item.state==20" style="color: red;border: 1px solid red;border-radius: 3px;">不合格</span>
<span v-if="item.state==30" style="color: orange;border: 1px solid orange;border-radius: 3px;">返工</span>
<span>{{ item.batch }}({{ item.material_name }})</span>
<span v-if="item.defect_name !== null" style="color: orangered">{{ item.defect_name }}</span>
</div>
@ -41,7 +64,7 @@
</div>
</el-option>
</el-select>
</el-form-item>
</el-form-item> -->
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="关联任务">
@ -76,7 +99,7 @@
<el-col :md="12" :sm="24">
<el-form-item :label="mgroupMtype==10?'领用数量':'批次总数'">
<el-input-number
v-model="form.count_use"
v-model="selectObj.count_cando"
:min="0"
class="width-100"
controls-position="right"
@ -238,6 +261,7 @@ export default {
},
],
},
selectObj:{count:0},
batch_count:null,
codeBatch:"",
materialFix:"",
@ -249,20 +273,37 @@ export default {
visible: false,
isSaveing: false,
setFiltersVisible: false,
apiObjM:this.$API.wpm.wmaterial.list,
paramsM:{},
};
},
mounted() {
let that = this;
that.paramsM.mtaskx =that.form.mtask;
that.paramsM.mgroup = that.mgroup;
// that.paramsM.query = "{id,batch,count,material,material_name,defect_name}";
that.paramsM.page =0;
if(that.is_fix){//&&
that.paramsM.tag = 'canfix';
}else{
that.paramsM.material =that.materialIn;
that.paramsM.state =10;
that.paramsM.tag = 'todo';
}
if(that.codeText!==''){
let id = that.codeText.split('#')[1];
this.$API.cm.labelmat.item.req(id).then((res) => {
that.codeBatch = res.batch;
this.getMaterial();
that.paramsM.search = that.codeBatch;
that.apiObjM = that.$API.wpm.wmaterial.list;
// this.getMaterial();
}).catch((err) => {
that.getMaterial();
that.apiObjM = that.$API.wpm.wmaterial.list;
// that.getMaterial();
})
}else{
that.getMaterial();
that.apiObjM = that.$API.wpm.wmaterial.list;
// that.getMaterial();
}
if(that.is_fix){}else{
this.getdefects();
@ -292,6 +333,8 @@ export default {
let obj = {};
obj.mtaskx =that.form.mtask;
obj.mgroup = that.mgroup;
obj.search = that.codeBatch;
// obj.query = "{id,batch,count,material,material_name,defect_name}";
obj.page =0;
if(that.is_fix){//&&
obj.tag = 'canfix';
@ -413,6 +456,8 @@ export default {
if (valid) {
that.isSaveing = true;
that.form.mlog = that.mlog;
that.form.batch = that.selectObj.batch;
that.form.count_use = that.selectObj.count_cando;
if(that.mgroupMtype==10&&that.cellsList.length>0){
that.form.count_json_from = that.cellsList;
}
@ -428,6 +473,8 @@ export default {
})
that.form.mlogbdefect = mlogbdefect;
that.form.count_pn_jgqbl = count_pn_jgqbl;
console.log(that.form);
console.log(that.selectObj);
that.$API.wpm.mlogb.in.req(that.form).then((res) => {
that.isSaveing = false;
that.$emit("success");