fix:mlogb_check数据回显

This commit is contained in:
shijing 2025-04-22 17:07:47 +08:00
parent fd5ab5b2fd
commit 6ea0f6f378
1 changed files with 13 additions and 8 deletions

View File

@ -2,7 +2,7 @@
<el-dialog <el-dialog
title="过程检验" title="过程检验"
v-model="visible" v-model="visible"
:size="1000" style="width: 80%;"
destroy-on-close destroy-on-close
@closed="$emit('closed')" @closed="$emit('closed')"
> >
@ -13,7 +13,7 @@
:model="form" :model="form"
:rules="rules" :rules="rules"
label-position="right" label-position="right"
label-width="100px" label-width="110px"
style="padding: 0 10px" style="padding: 0 10px"
> >
<el-row> <el-row>
@ -108,7 +108,7 @@
</el-col> </el-col>
<el-col :md="12" :sm="24"> <el-col :md="12" :sm="24">
<el-form-item label="是否可入库"> <el-form-item label="是否可入库">
<el-switch v-model="count_json_wx.count_canInm"></el-switch> <el-switch v-model="count_json_wx.need_inout"></el-switch>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-divider></el-divider> <el-divider></el-divider>
@ -178,13 +178,13 @@
</el-col> </el-col>
<el-col :md="12" :sm="24" v-if="mgroupName=='外观检验'"> <el-col :md="12" :sm="24" v-if="mgroupName=='外观检验'">
<el-form-item label="抽检人" prop="test_user"> <el-form-item label="抽检人" prop="test_user">
<span v-if="form.test_user_name!==''" style="margin-right: 6px;">{{form.test_user_name}}</span>
<ehsSelect <ehsSelect
filterable filterable
v-model="form.test_user" v-model="form.test_user"
:showName="form.test_user_name" :showName="form.test_user_name"
:apiObj="this.$API.system.user.list" :apiObj="this.$API.system.user.list"
:params="{ depts: deptId }" :params="{ depts: deptId }"
style="width: 100%;"
></ehsSelect> ></ehsSelect>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -295,6 +295,7 @@ export default {
count_notok: 0, count_notok: 0,
mlogbdefect:[], mlogbdefect:[],
mlogbindefect:[], mlogbindefect:[],
test_user_name:""
}, },
// //
rules: { rules: {
@ -341,7 +342,7 @@ export default {
count_ok_s:null, count_ok_s:null,
count_ok_not:null, count_ok_not:null,
count_ok_rate:null, count_ok_rate:null,
count_canInm:true, need_inout:true,
count_n_ok:null, count_n_ok:null,
count_n_not:null, count_n_not:null,
}, },
@ -389,6 +390,8 @@ export default {
}) })
that.form.batch = data.batch; that.form.batch = data.batch;
if(data.mlogbdefect.length>0){ if(data.mlogbdefect.length>0){
that.form.test_user_name = data.test_user_name;
console.log('data.mlogbdefect有数据',data.mlogbdefect);
data.mlogbdefect.forEach((item2) => { data.mlogbdefect.forEach((item2) => {
that.defectform[item2.defect_name] = Number(item2.count); that.defectform[item2.defect_name] = Number(item2.count);
}) })
@ -400,7 +403,7 @@ export default {
if(that.mgroupMtype==20){ if(that.mgroupMtype==20){
if(data.count_json_wx.ok_num&&data.count_json_wx.ok_num!==null){ if(data.count_json_wx.ok_num&&data.count_json_wx.ok_num!==null){
that.count_json_wx = data.count_json_wx; that.count_json_wx = data.count_json_wx;
that.count_json_wx.count_canInm = true; // that.count_json_wx.need_inout = data.need_inout;
if(data.count_json_wx.ok_num!==null){ if(data.count_json_wx.ok_num!==null){
that.form.count_ok = data.count_json_wx.ok_num; that.form.count_ok = data.count_json_wx.ok_num;
that.form.count_notok = data.count_json_wx.notok_num; that.form.count_notok = data.count_json_wx.notok_num;
@ -420,7 +423,7 @@ export default {
if(that.mlogbItem.qct!==null){ if(that.mlogbItem.qct!==null){
that.$API.qm.qct.item.req(that.mlogbItem.qct).then((res) => { that.$API.qm.qct.item.req(that.mlogbItem.qct).then((res) => {
res.qct_defects.forEach((item) => { res.qct_defects.forEach((item) => {
that.defectform[item.defect_name] = 0; that.defectform[item.defect_name] = that.defectform[item.defect_name]?that.defectform[item.defect_name]:0;
}) })
that.max_defect_rate =Number(res.max_defect_rate); that.max_defect_rate =Number(res.max_defect_rate);
that.qct_defects=res.qct_defects; that.qct_defects=res.qct_defects;
@ -474,7 +477,7 @@ export default {
that.form.count_notok = that.count_json_wx.notok_num-that.count_json_wx.count_n_ok; that.form.count_notok = that.count_json_wx.notok_num-that.count_json_wx.count_n_ok;
}else{ }else{
that.form.count_notok = that.count_json_wx.count_n_not; that.form.count_notok = that.count_json_wx.count_n_not;
ok_n = that.count_json_wx.notok_num-that.count_json_wx.count_n_not; let ok_n = that.count_json_wx.notok_num-that.count_json_wx.count_n_not;
that.form.count_ok = that.count_json_wx.ok_num + ok_n; that.form.count_ok = that.count_json_wx.ok_num + ok_n;
} }
}, },
@ -499,9 +502,11 @@ export default {
let obj_form = {}; let obj_form = {};
if(that.mgroupMtype==20){ if(that.mgroupMtype==20){
obj_form.count_json_wx = that.count_json_wx; obj_form.count_json_wx = that.count_json_wx;
obj_form.need_inout = that.count_json_wx.need_inout;
if(that.canWrite){ if(that.canWrite){
obj_form.count_ok = that.count_json_wx.ok_num; obj_form.count_ok = that.count_json_wx.ok_num;
obj_form.count_notok = that.count_json_wx.notok_num; obj_form.count_notok = that.count_json_wx.notok_num;
obj_form.need_inout = that.count_json_wx.need_inout;
}else{ }else{
that.qct_defects.forEach(item => { that.qct_defects.forEach(item => {
if(item.defect_name=='其他'){ if(item.defect_name=='其他'){