fix:过程检验关联检验表

This commit is contained in:
shijing 2025-03-11 17:09:43 +08:00
parent 43e5dff859
commit fc10c2eee0
2 changed files with 204 additions and 724 deletions

View File

@ -135,388 +135,17 @@
</el-col>
</el-row>
<el-divider style="margin-top:0"></el-divider>
<!-- 尺寸检验 -->
<el-row v-if="mgroupName=='size'">
<el-col :md="12" :sm="24">
<el-form-item label="黑圈内径">
<el-input-number
controls-position="right"
v-model="count_notok_json.count_n_hqnj"
style="width: 100%"
:precision="0"
@change="handleCountChange"
></el-input-number>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="黑圈内径圆度">
<el-input-number
controls-position="right"
v-model="count_notok_json.count_n_hqnjyd"
style="width: 100%"
:precision="0"
@change="handleCountChange"
></el-input-number>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="黑圈外径">
<el-input-number
controls-position="right"
v-model="count_notok_json.count_n_hqwj"
style="width: 100%"
:precision="0"
@change="handleCountChange"
></el-input-number>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="黑圈外径圆度">
<el-input-number
controls-position="right"
v-model="count_notok_json.count_n_hqwjyd"
style="width: 100%"
:precision="0"
@change="handleCountChange"
></el-input-number>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="产品外径">
<el-input-number
controls-position="right"
v-model="count_notok_json.count_n_wj"
style="width: 100%"
:precision="0"
@change="handleCountChange"
></el-input-number>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="产品圆度">
<el-input-number
controls-position="right"
v-model="count_notok_json.count_n_yd"
style="width: 100%"
:precision="0"
@change="handleCountChange"
></el-input-number>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="产品同心度">
<el-input-number
controls-position="right"
v-model="count_notok_json.count_n_txd"
style="width: 100%"
:precision="0"
@change="handleCountChange"
></el-input-number>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="厚度">
<el-input-number
controls-position="right"
v-model="count_notok_json.count_n_hd"
style="width: 100%"
:precision="0"
@change="handleCountChange"
></el-input-number>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="准合格">
<el-input-number
controls-position="right"
v-model="count_notok_json.count_n_zhg"
style="width: 100%"
:precision="0"
@change="handleCountChange"
></el-input-number>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="圆准">
<el-input-number
controls-position="right"
v-model="count_notok_json.count_n_yz"
style="width: 100%"
:precision="0"
@change="handleCountChange"
></el-input-number>
</el-form-item>
</el-col>
</el-row>
<!-- 外观检验 -->
<el-row v-else-if="mgroupName=='facade'">
<el-col :md="12" :sm="24">
<el-form-item label="脏">
<el-input-number
controls-position="right"
v-model="count_notok_json.count_n_z"
style="width: 100%"
:precision="0"
@change="handleCountChange"
></el-input-number>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="气泡">
<el-input-number
controls-position="right"
v-model="count_notok_json.count_n_qp"
style="width: 100%"
:precision="0"
@change="handleCountChange"
></el-input-number>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="水纹">
<el-input-number
controls-position="right"
v-model="count_notok_json.count_n_swen"
style="width: 100%"
:precision="0"
@change="handleCountChange"
></el-input-number>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="崩边">
<el-input-number
controls-position="right"
v-model="count_notok_json.count_n_bb"
style="width: 100%"
:precision="0"
@change="handleCountChange"
></el-input-number>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="棕边">
<el-input-number
controls-position="right"
v-model="count_notok_json.count_n_zb"
style="width: 100%"
:precision="0"
@change="handleCountChange"
></el-input-number>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="棕圈">
<el-input-number
controls-position="right"
v-model="count_notok_json.count_n_zq"
style="width: 100%"
:precision="0"
@change="handleCountChange"
></el-input-number>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="划伤">
<el-input-number
controls-position="right"
v-model="count_notok_json.count_n_hs"
style="width: 100%"
:precision="0"
@change="handleCountChange"
></el-input-number>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="麻点">
<el-input-number
controls-position="right"
v-model="count_notok_json.count_n_md"
style="width: 100%"
:precision="0"
@change="handleCountChange"
></el-input-number>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="黑圈变形">
<el-input-number
controls-position="right"
v-model="count_notok_json.count_n_hqbx"
style="width: 100%"
:precision="0"
@change="handleCountChange"
></el-input-number>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="倒角">
<el-input-number
controls-position="right"
v-model="count_notok_json.count_n_dj"
style="width: 100%"
:precision="0"
@change="handleCountChange"
></el-input-number>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="破损">
<el-input-number
controls-position="right"
v-model="count_notok_json.count_n_ps"
style="width: 100%"
:precision="0"
@change="handleCountChange"
></el-input-number>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="蓝圈">
<el-input-number
controls-position="right"
v-model="count_notok_json.count_n_lq"
style="width: 100%"
:precision="0"
@change="handleCountChange"
></el-input-number>
</el-form-item>
</el-col>
</el-row>
<!-- 过程检验 -->
<el-row v-else>
<el-col :md="12" :sm="24">
<el-form-item label="厚度">
<el-row>
<el-col :md="12" :sm="24" v-for="item in qct_defects" :key="item.id">
<el-form-item :label="item.defect_name">
<el-input-number
v-model="form[item.defect_name]"
:min="0"
style="width: 100%;"
controls-position="right"
v-model="count_notok_json.count_n_hd"
style="width: 100%"
:precision="0"
@change="handleCountChange"
></el-input-number>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="产品外径">
<el-input-number
controls-position="right"
v-model="count_notok_json.count_n_wj"
style="width: 100%"
:precision="0"
@change="handleCountChange"
></el-input-number>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="产品圆度">
<el-input-number
controls-position="right"
v-model="count_notok_json.count_n_yd"
style="width: 100%"
:precision="0"
@change="handleCountChange"
></el-input-number>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="产品同心度">
<el-input-number
controls-position="right"
v-model="count_notok_json.count_n_txd"
style="width: 100%"
:precision="0"
@change="handleCountChange"
></el-input-number>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="气泡">
<el-input-number
controls-position="right"
v-model="count_notok_json.count_n_qp"
style="width: 100%"
:precision="0"
@change="handleCountChange"
></el-input-number>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="水纹">
<el-input-number
controls-position="right"
v-model="count_notok_json.count_n_swen"
style="width: 100%"
:precision="0"
@change="handleCountChange"
></el-input-number>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="崩边">
<el-input-number
controls-position="right"
v-model="count_notok_json.count_n_bb"
style="width: 100%"
:precision="0"
@change="handleCountChange"
></el-input-number>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="小崩边">
<el-input-number
controls-position="right"
v-model="count_notok_json.count_n_xbb"
style="width: 100%"
:precision="0"
@change="handleCountChange"
></el-input-number>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="划伤">
<el-input-number
controls-position="right"
v-model="count_notok_json.count_n_hs"
style="width: 100%"
:precision="0"
@change="handleCountChange"
></el-input-number>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="麻点">
<el-input-number
controls-position="right"
v-model="count_notok_json.count_n_md"
style="width: 100%"
:precision="0"
@change="handleCountChange"
></el-input-number>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="破损">
<el-input-number
controls-position="right"
v-model="count_notok_json.count_n_ps"
style="width: 100%"
:precision="0"
@change="handleCountChange"
></el-input-number>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="其他">
<el-input-number
controls-position="right"
v-model="count_notok_json.count_n_qt"
style="width: 100%"
:precision="0"
@change="handleCountChange"
></el-input-number>
/>
</el-form-item>
</el-col>
</el-row>
@ -577,36 +206,22 @@ export default {
count_sampling_ok:0,
count_sampling:0,
count_notok: 0,
count_notok_json:{}
ftestworkdefect:[]
},
count_ok_rate:100,
count_notok_json:{
//
count_n_wj: 0,
count_n_yd: 0,
count_n_txd: 0,
count_n_hd: 0,
//
count_n_qp: 0,
count_n_swen: 0,
count_n_hs: 0,
count_n_md: 0,
count_n_bb:0,
count_n_xbb:0,
count_n_ps: 0,
count_n_qt:0,
},
rules: {
test_date: [{required: true,message: "请选择检验日期",trigger: "blur"}],
batch: [{required: true,message: "请选择物料批次",trigger: "blur"}],
test_user: [{required: true,message: "请选择物料批次",trigger: "blur"}],
},
qct_defects:[],
options: [],
userList : [],
typeOption:[
{name:'全检',value:20},
{name:'抽检',value:10},
],
qct:null,
initForm: {},
selectionFilters: [],
batchCount:null,
@ -618,11 +233,10 @@ export default {
};
},
mounted() {
console.log('mgroupName',this.mgroupName);
this.batchCount = this.itemObj.count_cando;
this.form.batch = this.itemObj.batch;
this.form.wm = this.itemObj.id;
this.form.count = this.itemObj.count_cando;
this.form.count_sampling = this.form.count_sampling_ok = this.form.count = this.itemObj.count_cando;
this.form.supplier = this.itemObj.supplier;
this.deptID = this.$TOOL.data.get('gx_deptID');
this.getUsers();
@ -630,10 +244,11 @@ export default {
},
methods: {
//
open(mode = "抽检") {
open(mode = "") {
this.mode = mode;
this.modeTitle = mode+'抽检';
this.visible = true;
this.getdefects();
return this;
},
getUsers(){
@ -652,6 +267,20 @@ export default {
});
});
},
getdefects(){
let that = this;
that.$API.qm.qct.list.req({page: 0, qctmat__material: that.itemObj.material,tags:'inm'}).then((res) => {
if(res.length>0){
that.qct = res[0].id;
that.$API.qm.qct.item.req(res[0].id).then((res) => {
res.qct_defects.forEach((item) => {
that.form[item.defect_name] = 0;
})
that.qct_defects=res.qct_defects;
})
}
})
},
//
getInit() {
let that = this;
@ -661,19 +290,10 @@ export default {
});
},
handleCountChange(type){
this.form.count_notok =
this.count_notok_json.count_n_wj+
this.count_notok_json.count_n_yd+
this.count_notok_json.count_n_txd+
this.count_notok_json.count_n_hd+
this.count_notok_json.count_n_qp+
this.count_notok_json.count_n_swen+
this.count_notok_json.count_n_hs+
this.count_notok_json.count_n_bb+
this.count_notok_json.count_n_xbb+
this.count_notok_json.count_n_md+
this.count_notok_json.count_n_ps+
this.count_notok_json.count_n_qt;
this.form.count_notok = 0;
this.qct_defects.forEach(item => {
this.form.count_notok += this.form[item.defect_name]
})
this.handleCountNotokChange();
},
handleCountNotokChange(){
@ -699,21 +319,6 @@ export default {
submitTicketCreate(id) {
this.transition = id;
this.submit();
// let that = this;
// let ticket = {};
// that.isSaveing = true;
// ticket.title = '';
// ticket.workflow = that.initForm.workflow;
// ticket.ticket_data = {t_id: that.mlogItem.id};
// ticket.transition = id;
// that.$API.wf.ticket.create.req(ticket).then((res) => {
// that.isSaveing = false;
// that.ticketDialog = false;
// that.visible = false;
// that.$message.success("");
// }).catch((e) => {
// that.isSaveing = false;
// });
},
//
submit() {
@ -721,67 +326,52 @@ export default {
this.$refs.dialogForm.validate(async (valid) => {
if (valid) {
that.isSaveing = true;
let count_notok =
this.count_notok_json.count_n_wj+
this.count_notok_json.count_n_yd+
this.count_notok_json.count_n_txd+
this.count_notok_json.count_n_hd+
this.count_notok_json.count_n_qp+
this.count_notok_json.count_n_swen+
this.count_notok_json.count_n_hs+
this.count_notok_json.count_n_bb+
this.count_notok_json.count_n_xbb+
this.count_notok_json.count_n_md+
this.count_notok_json.count_n_ps+
this.count_notok_json.count_n_qt;
if(count_notok>that.form.count_notok){
that.$notify.error("不合格数量有问题");
that.isSaveing = false;
}else{
if(count_notok<that.form.count_notok){
that.count_notok_json.count_n_qt = that.form.count_notok-count_notok;
}
if(that.supplier!== null&&that.form.type2==10){
that.form.need_update_wm = false;
}
// that.form.count_ok = that.form.count-that.form.count_notok;
if(that.form.type2==10){//
that.form.count_sampling_ok = that.form.count_sampling - that.form.count_notok;
}else{//
that.form.count_ok = that.form.count - that.form.count_notok;
}
that.form.count_notok_json = that.count_notok_json;
console.log('that.form',that.form)
that.$API.qm.ftestwork.create.req(that.form).then((res) => {
if(that.mgroupName=='白片抛'){
let ticket = {};
that.isSaveing = true;
ticket.title = '白片抛抽检审批单';
ticket.workflow = that.initForm.workflow;
ticket.ticket_data = {t_id: res.id};
ticket.transition = that.transition;
that.$API.wf.ticket.create.req(ticket).then((res) => {
that.isSaveing = false;
that.ticketDialog = false;
that.visible = false;
that.$message.success("提交成功");
}).catch((e) => {
that.isSaveing = false;
});
}else{
that.$API.qm.ftestwork.submit.req(res.id).then((res) => {
that.isSaveing = false;
that.visible = false;
that.$emit("success");
that.$message.success("操作成功");
})
}
}).catch( err=>{
//
that.isSaveing = false;
})
let count_notok = 0;
that.qct_defects.forEach(item => {
let obj = {};
obj.defect = item.defect;
obj.count = that.form[item.defect_name];
that.form.ftestworkdefect.push(obj);
count_notok += that.form[item.defect_name];
})
that.form.count_notok = count_notok;
if(that.supplier!== null&&that.form.type2==10){
that.form.need_update_wm = false;
}
if(that.form.type2==10){//
that.form.count_sampling_ok = that.form.count_sampling - that.form.count_notok;
}else{//
that.form.count_ok = that.form.count - that.form.count_notok;
}
that.form.qct = that.qct;
that.$API.qm.ftestwork.create.req(that.form).then((res) => {
if(that.mgroupName=='白片抛'){
let ticket = {};
that.isSaveing = true;
ticket.title = '白片抛抽检审批单';
ticket.workflow = that.initForm.workflow;
ticket.ticket_data = {t_id: res.id};
ticket.transition = that.transition;
that.$API.wf.ticket.create.req(ticket).then((res) => {
that.isSaveing = false;
that.ticketDialog = false;
that.visible = false;
that.$message.success("提交成功");
}).catch((e) => {
that.isSaveing = false;
});
}else{
that.$API.qm.ftestwork.submit.req(res.id).then((res) => {
that.isSaveing = false;
that.visible = false;
that.$emit("success");
that.$message.success("操作成功");
})
}
}).catch( err=>{
//
that.isSaveing = false;
})
}
});
},

View File

@ -32,7 +32,7 @@
:min="0"
class="width-100"
controls-position="right"
@change="countChanges"
@change="countChange"
/>
</el-form-item>
</el-col>
@ -41,6 +41,7 @@
<el-input-number
v-model="form.count_ok"
:min="0"
:disabled="true"
class="width-100"
controls-position="right"
/>
@ -52,7 +53,29 @@
v-model="form.count_notok"
:min="0"
class="width-100"
@change="countChanges"
:disabled="true"
controls-position="right"
/>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24" v-if="mgroupName=='黑化'||mgroupName=='退火'">
<el-form-item label="每层数量">
<el-input-number
v-model="count_cell"
:min="0"
class="width-100"
@change="countCellChanges"
controls-position="right"
/>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24" v-if="mgroupName=='黑化'||mgroupName=='退火'">
<el-form-item label="开始层数">
<el-input-number
v-model="cell_start"
:min="0"
class="width-100"
@change="cellStartChanges"
controls-position="right"
/>
</el-form-item>
@ -71,7 +94,12 @@
</el-col>
</el-row>
<template v-if="mgroupName=='黑化'||mgroupName=='退火'">
<el-row style="margin-bottom:10px" v-for="(item, $index) in count_notok_json" :key="item">
<el-row>
<el-col :span="7">层数:</el-col>
<el-col :span="7">抽检数:</el-col>
<el-col :span="7">不合格数:</el-col>
</el-row>
<el-row style="margin-bottom:10px" v-for="(item, $index) in mlogbdefect_h" :key="item">
<el-col :span="7">
<el-input-number
style="width:90%"
@ -85,7 +113,7 @@
<el-col :span="7">
<el-input-number
style="width:90%"
v-model="item.count_sampling"
v-model="item.count_test"
:min="0"
class="width-100"
placeholder="抽检数"
@ -98,7 +126,7 @@
v-model="item.count"
:min="0"
class="width-100"
placeholder="数"
placeholder="不合格数"
controls-position="right"
/>
</el-col>
@ -111,121 +139,12 @@
</el-col>
</el-row>
</template>
<el-row v-else>
<el-col :md="12" :sm="24">
<el-form-item label="划伤">
<el-row v-if="mgroupName!=='黑化'&&mgroupName!=='退火'&&qct_defects.length>0">
<el-col>不良统计</el-col>
<el-col :md="12" :sm="24" v-for="item in qct_defects" :key="item.id">
<el-form-item :label="item.defect_name">
<el-input-number
v-model="form.count_n_hs"
:min="0"
class="width-100"
controls-position="right"
@change="countChange"
/>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="气泡">
<el-input-number
v-model="form.count_n_qp"
:min="0"
class="width-100"
controls-position="right"
@change="countChange"
/>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="水纹">
<el-input-number
v-model="form.count_n_swen"
:min="0"
class="width-100"
controls-position="right"
@change="countChange"
/>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="崩边">
<el-input-number
v-model="form.count_n_bb"
:min="0"
class="width-100"
controls-position="right"
@change="countChange"
/>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="雾面">
<el-input-number
v-model="form.count_n_wm"
:min="0"
class="width-100"
controls-position="right"
@change="countChange"
/>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="小崩边">
<el-input-number
v-model="form.count_n_xbb"
:min="0"
class="width-100"
controls-position="right"
@change="countChange"
/>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="麻点">
<el-input-number
v-model="form.count_n_md"
:min="0"
class="width-100"
controls-position="right"
@change="countChange"
/>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="线痕">
<el-input-number
v-model="form.count_n_xh"
:min="0"
class="width-100"
controls-position="right"
@change="countChange"
/>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="破损">
<el-input-number
v-model="form.count_n_ps"
:min="0"
class="width-100"
controls-position="right"
@change="countChange"
/>
</el-form-item>
</el-col>
<!-- <el-col :md="12" :sm="24">
<el-form-item label="棕圈">
<el-input-number
v-model="form.count_n_zq"
:min="0"
class="width-100"
controls-position="right"
@change="countChange"
/>
</el-form-item>
</el-col> -->
<el-col :md="12" :sm="24">
<el-form-item label="其他">
<el-input-number
v-model="form.count_n_qt"
v-model="defectform[item.defect_name]"
:min="0"
class="width-100"
controls-position="right"
@ -234,50 +153,6 @@
</el-form-item>
</el-col>
</el-row>
<!-- <el-row>
<el-col :span="24">
<el-form-item label="前道不良">
<el-button
type="primary"
icon="el-icon-plus"
@click="notok_add"
></el-button>
</el-form-item>
</el-col>
</el-row>
<el-row style="margin-bottom:10px" v-for="(item, $index) in notokList" :key="item">
<el-col :span="10">
<el-select v-model="item.file"
style="width:90%"
placeholder="请选择不合格项">
<el-option
v-for="notok in notokOptions"
:key="notok.value"
:label="notok.name"
:value="notok.value"
>
</el-option>
</el-select>
</el-col>
<el-col :span="12">
<el-input-number
style="width:90%"
v-model="item.value"
:min="0"
class="width-100"
controls-position="right"
@change="countChange"
/>
</el-col>
<el-col :span="2">
<el-button
type="danger"
icon="el-icon-delete"
@click="notok_del( $index)"
></el-button>
</el-col>
</el-row> -->
</el-form>
</el-main>
<el-footer>
@ -294,37 +169,16 @@ export default {
data() {
return {
loading: false,
mlogbItem:{},
//
form: {
batch: null,
count_real: 0,
count_ok: 0,
count_notok: 0,
count_n_hs: 0,
count_n_qp: 0,
count_n_swen: 0,
count_n_bb: 0,
count_n_xbb:0,
count_n_md: 0,
count_n_xh: 0,
count_n_ps: 0,
count_n_qt: 0,
count_n_wm: 0,
count_n_zq:0
mlogbdefect:[],
mlogbindefect:[],
},
notokOptions:[
{name:"划伤",value:'count_n_hs'},
{name:"气泡",value:'count_n_qp'},
{name:"水纹",value:'count_n_swen'},
{name:"崩边",value:'count_n_bb'},
{name:"小崩边",value:'count_n_xbb'},
{name:"麻点",value:'count_n_md'},
{name:"划伤",value:'count_n_xh'},
{name:"破损",value:'count_n_ps'},
{name:"其他",value:'count_n_qt'},
{name:"雾面",value:'count_n_wm'},
{name:"棕圈",value:'count_n_zq'},
],
//
rules: {
batch: [
@ -342,8 +196,14 @@ export default {
},
],
},
defectform:{},
cells:0,
cell_start:1,
count_cell:50,
options: [],
count_notok_json:[],
material_out:'',
qct_defects:[],
mlogbdefect_h:[],
materialOptions: [],
visible: false,
isSaveing: false,
@ -358,33 +218,58 @@ export default {
methods: {
open(data) {
this.visible = true;
Object.assign(this.form, data);
this.mlogbItem = data;
this.form.batch = data.batch;
this.form.count_real =this.form.count_ok= data.count_real;
this.material_out = data.material_out;
this.mgroupName = data.mgroup_name;
console.log(this.form);
this.cells = data.count_real/this.count_cell;
this.cellStartChanges();
this.getdefects();
},
getdefects(){
let that = this;
if(that.mlogbItem.qct!==null){
that.$API.qm.qct.item.req(that.mlogbItem.qct).then((res) => {
res.qct_defects.forEach((item) => {
that.defectform[item.defect_name] = 0;
})
that.qct_defects=res.qct_defects;
})
}
},
notok_add(){
this.count_notok_json.push({notok:'qt',count:null,floor:null,count_sampling:null});
this.mlogbdefect_h.push({defect:'',count:null,floor:null,count_test:null});
},
notok_del(index){
this.count_notok_json.splice(index, 1)
this.mlogbdefect_h.splice(index, 1)
},
countChange() {
this.form.count_notok =
this.form.count_n_hs +
this.form.count_n_qp +
this.form.count_n_swen +
this.form.count_n_bb +
this.form.count_n_xbb +
this.form.count_n_md +
this.form.count_n_xh +
this.form.count_n_ps +
this.form.count_n_zq +
this.form.count_n_qt +
this.form.count_n_wm;
this.form.count_ok = this.form.count_real - this.form.count_notok;
console.log('change');
let that = this;
that.form.count_notok = 0;
that.qct_defects.forEach(item => {
if(item.defect_okcate==30){
that.form.count_notok += that.defectform[item.defect_name];
}
})
that.form.count_ok = that.form.count_real - that.form.count_notok;
},
countChanges(){
this.form.count_ok = this.form.count_real - this.form.count_notok;
cellStartChanges(){
this.mlogbdefect_h = [];
for(let i=0;i<this.cells;i++){
let obj = {};
obj.floor=this.cell_start+i;
obj.count_test = this.count_cell;
obj.count = 0;
obj.defect="";
this.mlogbdefect_h.push(obj)
}
console.log(this.mlogbdefect_h)
},
countCellChanges(){
this.cells = this.form.count_real/this.count_cell;
this.cellStartChanges();
},
//
submit() {
@ -395,41 +280,46 @@ export default {
that.form.mlog = that.mlog;
let sum = 0;
if(that.mgroupName=='黑化'||that.mgroupName=='退火'){
let total = 0;
that.count_notok_json.forEach(item => {
total+=item.count;
that.form.count_notok = 0;
that.mlogbdefect_h.forEach(item => {
item.defect = that.qct_defects[0].defect;
that.form.count_notok =item.count;
});
this.form.count_notok = total;
this.form.count_notok_json = this.count_notok_json;
that.form.count_ok = that.form.count_real -that.form.count_notok;
that.form.mlogbdefect = that.mlogbdefect_h;
}else{
this.form.count_notok =
this.form.count_n_hs +
this.form.count_n_qp +
this.form.count_n_swen +
this.form.count_n_bb +
this.form.count_n_xbb +
this.form.count_n_md +
this.form.count_n_xh +
this.form.count_n_ps +
this.form.count_n_zq +
this.form.count_n_qt +
this.form.count_n_wm;
that.form.count_notok = 0;
that.qct_defects.forEach(item => {
if(item.defect_okcate==30){
that.form.count_notok += that.defectform[item.defect_name] ;
}
let obj = {};
obj.defect = item.defect;
obj.count = that.defectform[item.defect_name];
obj.mlogb = that.mlogbItem.id;
this.form.mlogbdefect.push(obj);
})
that.form.count_ok = that.form.count_real -that.form.count_notok;
}
sum = this.form.count_ok + this.form.count_notok;
if (sum - this.form.count_real == 0) {
that.$API.wpm.mlogb.updateOut
.req(that.form.id, that.form)
.then((res) => {
that.isSaveing = false;
that.$emit("success");
that.visible = false;
that.$message.success("操作成功");
})
.catch((err) => {
that.isSaveing = false;
});
sum = that.form.count_ok + that.form.count_notok;
let obj_form = {};
obj_form.count_real = that.form.count_real;
obj_form.mlogbdefect = that.form.mlogbdefect;
if (sum - that.form.count_real == 0) {
that.$API.wpm.mlogb.updateOut.req(that.mlogbItem.id, obj_form).then((res) => {
that.isSaveing = false;
that.$emit("success");
that.visible = false;
that.$message.success("操作成功");
})
.catch((err) => {
that.isSaveing = false;
});
} else {
this.$message.error("使用数量与合格数不合格数数量不对等");
that.isSaveing = false;
that.$message.error("使用数量与合格数不合格数数量不对等");
}
}
});