fix:光芯黑化、退火日志中层数存储;不合格判定
This commit is contained in:
parent
85eb644e43
commit
a25e70c0a0
|
|
@ -158,7 +158,7 @@
|
||||||
ref="saveInForm"
|
ref="saveInForm"
|
||||||
>
|
>
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="23">
|
<el-col :md="12" :sm="24">
|
||||||
<el-form-item label="领取数量" prop="count_use">
|
<el-form-item label="领取数量" prop="count_use">
|
||||||
<el-input-number
|
<el-input-number
|
||||||
v-model="saveInForm.count_use"
|
v-model="saveInForm.count_use"
|
||||||
|
|
@ -168,11 +168,12 @@
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="23">
|
<el-col :md="12" :sm="24">
|
||||||
<el-form-item label="加工前不良" prop="count_pn_jgqbl">
|
<el-form-item label="加工前不良" prop="count_pn_jgqbl">
|
||||||
<el-input-number
|
<el-input-number
|
||||||
v-model="saveInForm.count_pn_jgqbl"
|
v-model="saveInForm.count_pn_jgqbl"
|
||||||
:min="0"
|
:min="0"
|
||||||
|
:disabled="true"
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
controls-position="right"
|
controls-position="right"
|
||||||
/>
|
/>
|
||||||
|
|
@ -328,6 +329,7 @@
|
||||||
ref="saveDialog"
|
ref="saveDialog"
|
||||||
:mlog="mlogId"
|
:mlog="mlogId"
|
||||||
:mgroup="mgroup"
|
:mgroup="mgroup"
|
||||||
|
:mgroupName = "mlogItem.mgroup_name"
|
||||||
:codeText = "codeText"
|
:codeText = "codeText"
|
||||||
:materialIn="materialIn"
|
:materialIn="materialIn"
|
||||||
@success="handleSaveSuccess"
|
@success="handleSaveSuccess"
|
||||||
|
|
@ -496,6 +498,7 @@ export default {
|
||||||
mlog: "",
|
mlog: "",
|
||||||
material_out__isnull: 0,
|
material_out__isnull: 0,
|
||||||
},
|
},
|
||||||
|
cells:0,
|
||||||
mgroup: "",
|
mgroup: "",
|
||||||
mlogItem: {},
|
mlogItem: {},
|
||||||
saveInForm: {
|
saveInForm: {
|
||||||
|
|
@ -520,6 +523,7 @@ export default {
|
||||||
},
|
},
|
||||||
defectform:{},
|
defectform:{},
|
||||||
fileList:[],
|
fileList:[],
|
||||||
|
cellsList:[],
|
||||||
qct_defects:[],
|
qct_defects:[],
|
||||||
tableDataWm:[],
|
tableDataWm:[],
|
||||||
test_file:'',
|
test_file:'',
|
||||||
|
|
@ -560,7 +564,6 @@ export default {
|
||||||
that.tableData = res;
|
that.tableData = res;
|
||||||
})
|
})
|
||||||
that.getMlogItem();
|
that.getMlogItem();
|
||||||
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
open() {
|
open() {
|
||||||
|
|
@ -600,6 +603,12 @@ export default {
|
||||||
that.defectform[item.defect_name] = 0;
|
that.defectform[item.defect_name] = 0;
|
||||||
})
|
})
|
||||||
that.qct_defects=res.qct_defects;
|
that.qct_defects=res.qct_defects;
|
||||||
|
console.log('that.saveInForm.mlogbdefect',that.saveInForm.mlogbdefect);
|
||||||
|
if(that.saveInForm.mlogbdefect&&that.saveInForm.mlogbdefect.length>0){
|
||||||
|
that.saveInForm.mlogbdefect.forEach((item) => {
|
||||||
|
that.defectform[item.defect_name] = Number(item.count);
|
||||||
|
})
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
@ -613,6 +622,7 @@ export default {
|
||||||
that.saveInForm.count_pn_jgqbl += that.defectform[item.defect_name];
|
that.saveInForm.count_pn_jgqbl += that.defectform[item.defect_name];
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
// that.countCellChanges();
|
||||||
},
|
},
|
||||||
//表单注入数据
|
//表单注入数据
|
||||||
setData(data) {
|
setData(data) {
|
||||||
|
|
@ -660,18 +670,15 @@ export default {
|
||||||
obj.count_use = that.saveInForm.count_use;
|
obj.count_use = that.saveInForm.count_use;
|
||||||
obj.mlogbdefect = mlogbdefect;
|
obj.mlogbdefect = mlogbdefect;
|
||||||
obj.count_pn_jgqbl = count_pn_jgqbl;
|
obj.count_pn_jgqbl = count_pn_jgqbl;
|
||||||
that.$API.wpm.mlogb.updateIn
|
that.$API.wpm.mlogb.updateIn.req(that.saveInForm.id, obj).then((res) => {
|
||||||
.req(that.saveInForm.id, obj)
|
that.isSaveing = false;
|
||||||
.then((res) => {
|
that.$message.success("操作成功");
|
||||||
that.isSaveing = false;
|
that.saveInDialog = false;
|
||||||
that.$message.success("操作成功");
|
that.$refs.tableIn.refresh();
|
||||||
that.saveInDialog = false;
|
that.$refs.tableOut.refresh();
|
||||||
that.$refs.tableIn.refresh();
|
}).catch(() => {
|
||||||
that.$refs.tableOut.refresh();
|
that.isSaveing = false;
|
||||||
})
|
});
|
||||||
.catch(() => {
|
|
||||||
that.isSaveing = false;
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
@ -763,8 +770,6 @@ export default {
|
||||||
this.$refs.tableOut.refresh();
|
this.$refs.tableOut.refresh();
|
||||||
},
|
},
|
||||||
fileUPSuccess(res) {
|
fileUPSuccess(res) {
|
||||||
let that = this;
|
|
||||||
console.log('res',res);
|
|
||||||
this.test_file = res.path;
|
this.test_file = res.path;
|
||||||
},
|
},
|
||||||
//编辑成功后的方法调用
|
//编辑成功后的方法调用
|
||||||
|
|
|
||||||
|
|
@ -58,89 +58,9 @@
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</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>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-divider></el-divider>
|
<el-row v-if="qct_defects.length>0">
|
||||||
<el-row v-if="mgroupName=='黑化'||mgroupName=='退火'">
|
<el-col>不良统计(最大不合格数:<span style="color:red">{{max_defect_rate}}</span>,超过0.5则整层不合格)</el-col>
|
||||||
<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>
|
|
||||||
<template v-if="mgroupName=='黑化'||mgroupName=='退火'">
|
|
||||||
<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%"
|
|
||||||
v-model="item.floor"
|
|
||||||
:min="0"
|
|
||||||
class="width-100"
|
|
||||||
placeholder="层数"
|
|
||||||
controls-position="right"
|
|
||||||
/>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="7">
|
|
||||||
<el-input-number
|
|
||||||
style="width:90%"
|
|
||||||
v-model="item.count_test"
|
|
||||||
:min="0"
|
|
||||||
class="width-100"
|
|
||||||
placeholder="抽检数"
|
|
||||||
controls-position="right"
|
|
||||||
/>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="7">
|
|
||||||
<el-input-number
|
|
||||||
style="width:90%"
|
|
||||||
v-model="item.count"
|
|
||||||
:min="0"
|
|
||||||
class="width-100"
|
|
||||||
placeholder="不合格数"
|
|
||||||
controls-position="right"
|
|
||||||
/>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="2">
|
|
||||||
<el-button
|
|
||||||
type="danger"
|
|
||||||
icon="el-icon-delete"
|
|
||||||
@click="notok_del( $index)"
|
|
||||||
></el-button>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
</template>
|
|
||||||
<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-col :md="12" :sm="24" v-for="item in qct_defects" :key="item.id">
|
||||||
<el-form-item :label="item.defect_name">
|
<el-form-item :label="item.defect_name">
|
||||||
<el-input-number
|
<el-input-number
|
||||||
|
|
@ -152,7 +72,71 @@
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
<el-col :md="12" :sm="24" v-if="mgroupName=='黑化'||mgroupName=='退火'">
|
||||||
|
<el-form-item label="层抽检数" required>
|
||||||
|
<el-input-number
|
||||||
|
v-model="count_cell"
|
||||||
|
:min="0"
|
||||||
|
class="width-100"
|
||||||
|
@change="countCellChanges"
|
||||||
|
controls-position="right"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
<el-divider></el-divider>
|
||||||
|
<template v-if="mgroupName=='黑化'||mgroupName=='退火'">
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="6">所在层数</el-col>
|
||||||
|
<el-col :span="6">本层总数</el-col>
|
||||||
|
<el-col :span="6">抽检数</el-col>
|
||||||
|
<el-col :span="6">不合格数</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row style="margin-bottom:10px" v-for="item in count_json" :key="item">
|
||||||
|
<el-col :span="6">
|
||||||
|
<el-input-number
|
||||||
|
style="width:90%"
|
||||||
|
v-model="item.floor"
|
||||||
|
:disabled="true"
|
||||||
|
class="width-100"
|
||||||
|
placeholder="层数"
|
||||||
|
controls-position="right"
|
||||||
|
/>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="6">
|
||||||
|
<el-input-number
|
||||||
|
style="width:90%"
|
||||||
|
v-model="item.count_use"
|
||||||
|
:disabled="true"
|
||||||
|
class="width-100"
|
||||||
|
placeholder="本层总数"
|
||||||
|
controls-position="right"
|
||||||
|
/>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="6">
|
||||||
|
<el-input-number
|
||||||
|
style="width:90%"
|
||||||
|
v-model="item.count_test"
|
||||||
|
:disabled="true"
|
||||||
|
class="width-100"
|
||||||
|
placeholder="抽检数"
|
||||||
|
controls-position="right"
|
||||||
|
/>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="6">
|
||||||
|
<el-input-number
|
||||||
|
style="width:90%"
|
||||||
|
v-model="item.count_notok"
|
||||||
|
:min="0"
|
||||||
|
class="width-100"
|
||||||
|
placeholder="不合格数"
|
||||||
|
controls-position="right"
|
||||||
|
@change="notokChanges"
|
||||||
|
/>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</template>
|
||||||
|
|
||||||
</el-form>
|
</el-form>
|
||||||
</el-main>
|
</el-main>
|
||||||
<el-footer>
|
<el-footer>
|
||||||
|
|
@ -195,15 +179,23 @@ export default {
|
||||||
trigger: "blur",
|
trigger: "blur",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
count_cell:[
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: "请填写层抽检数量",
|
||||||
|
trigger: "blur",
|
||||||
|
}
|
||||||
|
]
|
||||||
},
|
},
|
||||||
defectform:{},
|
defectform:{},
|
||||||
cells:0,
|
cells:0,
|
||||||
cell_start:1,
|
cell_start:1,
|
||||||
count_cell:50,
|
count_cell:20,
|
||||||
options: [],
|
options: [],
|
||||||
material_out:'',
|
material_out:'',
|
||||||
qct_defects:[],
|
qct_defects:[],
|
||||||
mlogbdefect_h:[],
|
count_json:[],
|
||||||
|
max_defect_rate:null,
|
||||||
materialOptions: [],
|
materialOptions: [],
|
||||||
visible: false,
|
visible: false,
|
||||||
isSaveing: false,
|
isSaveing: false,
|
||||||
|
|
@ -219,12 +211,16 @@ export default {
|
||||||
open(data) {
|
open(data) {
|
||||||
this.visible = true;
|
this.visible = true;
|
||||||
this.mlogbItem = data;
|
this.mlogbItem = data;
|
||||||
|
this.count_json = []
|
||||||
|
data.count_json.forEach((item) => {
|
||||||
|
item.count_notok = 0;
|
||||||
|
item.count_test = this.count_cell;
|
||||||
|
this.count_json.push(item);
|
||||||
|
})
|
||||||
this.form.batch = data.batch;
|
this.form.batch = data.batch;
|
||||||
this.form.count_real =this.form.count_ok= data.count_real;
|
this.form.count_real =this.form.count_ok= data.count_real;
|
||||||
this.material_out = data.material_out;
|
this.material_out = data.material_out;
|
||||||
this.mgroupName = data.mgroup_name;
|
this.mgroupName = data.mgroup_name;
|
||||||
this.cells = data.count_real/this.count_cell;
|
|
||||||
this.cellStartChanges();
|
|
||||||
this.getdefects();
|
this.getdefects();
|
||||||
},
|
},
|
||||||
getdefects(){
|
getdefects(){
|
||||||
|
|
@ -234,16 +230,11 @@ export default {
|
||||||
res.qct_defects.forEach((item) => {
|
res.qct_defects.forEach((item) => {
|
||||||
that.defectform[item.defect_name] = 0;
|
that.defectform[item.defect_name] = 0;
|
||||||
})
|
})
|
||||||
|
that.max_defect_rate =Number(res.max_defect_rate);
|
||||||
that.qct_defects=res.qct_defects;
|
that.qct_defects=res.qct_defects;
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
notok_add(){
|
|
||||||
this.mlogbdefect_h.push({defect:'',count:null,floor:null,count_test:null});
|
|
||||||
},
|
|
||||||
notok_del(index){
|
|
||||||
this.mlogbdefect_h.splice(index, 1)
|
|
||||||
},
|
|
||||||
countChange() {
|
countChange() {
|
||||||
console.log('change');
|
console.log('change');
|
||||||
let that = this;
|
let that = this;
|
||||||
|
|
@ -255,21 +246,30 @@ export default {
|
||||||
})
|
})
|
||||||
that.form.count_ok = that.form.count_real - that.form.count_notok;
|
that.form.count_ok = that.form.count_real - that.form.count_notok;
|
||||||
},
|
},
|
||||||
cellStartChanges(){
|
notokChanges(){
|
||||||
this.mlogbdefect_h = [];
|
let that = this;
|
||||||
for(let i=0;i<this.cells;i++){
|
let count_notok = 0;
|
||||||
let obj = {};
|
that.count_json.forEach(item=>{
|
||||||
obj.floor=this.cell_start+i;
|
console.log('item',item);
|
||||||
obj.count_test = this.count_cell;
|
if(that.max_defect_rate!==null&&that.count_cell>0){
|
||||||
obj.count = 0;
|
let notrate = item.count_notok / that.count_cell;
|
||||||
obj.defect="";
|
if(notrate>that.max_defect_rate){
|
||||||
this.mlogbdefect_h.push(obj)
|
count_notok += item.count_use;
|
||||||
}
|
}else{
|
||||||
console.log(this.mlogbdefect_h)
|
count_notok += item.count_notok;
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
count_notok += item.count_notok;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
that.form.count_notok = count_notok;
|
||||||
|
that.form.count_ok = that.form.count_real -that.form.count_notok;
|
||||||
|
that.defectform[that.qct_defects[0].defect_name] = count_notok;
|
||||||
},
|
},
|
||||||
countCellChanges(){
|
countCellChanges(){
|
||||||
this.cells = this.form.count_real/this.count_cell;
|
this.count_json.forEach(item=>{
|
||||||
this.cellStartChanges();
|
item.count_test = this.count_cell;
|
||||||
|
})
|
||||||
},
|
},
|
||||||
//表单提交方法
|
//表单提交方法
|
||||||
submit() {
|
submit() {
|
||||||
|
|
@ -279,34 +279,28 @@ export default {
|
||||||
that.isSaveing = true;
|
that.isSaveing = true;
|
||||||
that.form.mlog = that.mlog;
|
that.form.mlog = that.mlog;
|
||||||
let sum = 0;
|
let sum = 0;
|
||||||
if(that.mgroupName=='黑化'||that.mgroupName=='退火'){
|
that.form.count_notok = 0;
|
||||||
that.form.count_notok = 0;
|
that.qct_defects.forEach(item => {
|
||||||
that.mlogbdefect_h.forEach(item => {
|
if(item.defect_okcate==30){
|
||||||
item.defect = that.qct_defects[0].defect;
|
that.form.count_notok += that.defectform[item.defect_name] ;
|
||||||
that.form.count_notok =item.count;
|
}
|
||||||
});
|
let obj = {};
|
||||||
that.form.count_ok = that.form.count_real -that.form.count_notok;
|
obj.defect = item.defect;
|
||||||
that.form.mlogbdefect = that.mlogbdefect_h;
|
obj.count = that.defectform[item.defect_name];
|
||||||
|
obj.mlogb = that.mlogbItem.id;
|
||||||
|
this.form.mlogbdefect.push(obj);
|
||||||
|
|
||||||
}else{
|
})
|
||||||
that.form.count_notok = 0;
|
that.form.count_ok = that.form.count_real -that.form.count_notok;
|
||||||
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 = that.form.count_ok + that.form.count_notok;
|
sum = that.form.count_ok + that.form.count_notok;
|
||||||
let obj_form = {};
|
let obj_form = {};
|
||||||
|
obj_form.count_ok = that.form.count_ok;
|
||||||
obj_form.count_real = that.form.count_real;
|
obj_form.count_real = that.form.count_real;
|
||||||
|
obj_form.count_notok = that.form.count_notok;
|
||||||
obj_form.mlogbdefect = that.form.mlogbdefect;
|
obj_form.mlogbdefect = that.form.mlogbdefect;
|
||||||
|
if(that.mgroupName=='黑化'||that.mgroupName=='退火'){
|
||||||
|
obj_form.count_json = that.count_json;
|
||||||
|
}
|
||||||
if (sum - that.form.count_real == 0) {
|
if (sum - that.form.count_real == 0) {
|
||||||
that.$API.wpm.mlogb.updateOut.req(that.mlogbItem.id, obj_form).then((res) => {
|
that.$API.wpm.mlogb.updateOut.req(that.mlogbItem.id, obj_form).then((res) => {
|
||||||
that.isSaveing = false;
|
that.isSaveing = false;
|
||||||
|
|
|
||||||
|
|
@ -7,73 +7,158 @@
|
||||||
@closed="$emit('closed')"
|
@closed="$emit('closed')"
|
||||||
>
|
>
|
||||||
<el-container v-loading="loading">
|
<el-container v-loading="loading">
|
||||||
<el-main style="padding: 0 20px 20px 20px">
|
<el-main style="padding: 0 0 20px 0">
|
||||||
<el-form
|
<el-form
|
||||||
ref="dialogForm"
|
ref="dialogForm"
|
||||||
:model="form"
|
:model="form"
|
||||||
:rules="rules"
|
:rules="rules"
|
||||||
label-position="right"
|
label-position="right"
|
||||||
label-width="80px"
|
label-width="100px"
|
||||||
style="padding: 0 10px"
|
|
||||||
>
|
>
|
||||||
<el-form-item label="关联任务">
|
<el-row>
|
||||||
<el-select
|
<el-col :md="12" :sm="24">
|
||||||
v-model="form.mtask"
|
<el-form-item label="关联任务">
|
||||||
placeholder="关联任务"
|
<el-select
|
||||||
clearable
|
v-model="form.mtask"
|
||||||
style="width: 100%"
|
placeholder="关联任务"
|
||||||
@change="getMaterial"
|
clearable
|
||||||
>
|
style="width: 100%"
|
||||||
<el-option
|
@change="getMaterial"
|
||||||
v-for="item in options"
|
|
||||||
:key="item.id"
|
|
||||||
:label="item.number"
|
|
||||||
:value="item.id"
|
|
||||||
>
|
>
|
||||||
</el-option>
|
<el-option
|
||||||
</el-select>
|
v-for="item in options"
|
||||||
</el-form-item>
|
:key="item.id"
|
||||||
<el-form-item label="批次号" prop="wm_in">
|
:label="item.number"
|
||||||
<el-select
|
:value="item.id"
|
||||||
v-model="form.wm_in"
|
|
||||||
placeholder="物料"
|
|
||||||
clearable
|
|
||||||
style="width: 100%"
|
|
||||||
>
|
|
||||||
<el-option
|
|
||||||
v-for="item in materialOptions"
|
|
||||||
:key="item.id"
|
|
||||||
:label="item.batch"
|
|
||||||
:value="item.id"
|
|
||||||
>
|
|
||||||
<div
|
|
||||||
style="
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
"
|
|
||||||
>
|
>
|
||||||
<span>{{ item.batch }}</span
|
</el-option>
|
||||||
><span>{{ item.count }}</span>
|
</el-select>
|
||||||
</div>
|
</el-form-item>
|
||||||
</el-option>
|
</el-col>
|
||||||
</el-select>
|
<el-col :md="12" :sm="24">
|
||||||
</el-form-item>
|
<el-form-item label="批次号" prop="wm_in">
|
||||||
<el-form-item label="领用数量">
|
<el-select
|
||||||
<el-input-number
|
v-model="form.wm_in"
|
||||||
v-model="form.count_use"
|
placeholder="物料"
|
||||||
:min="0"
|
clearable
|
||||||
controls-position="right"
|
class="width-100"
|
||||||
/>
|
@change="materialBatchChange"
|
||||||
</el-form-item>
|
>
|
||||||
<el-form-item label="备注">
|
<el-option
|
||||||
<el-input v-model="form.note"/>
|
v-for="item in materialOptions"
|
||||||
</el-form-item>
|
:key="item.id"
|
||||||
|
:label="item.batch"
|
||||||
|
:value="item.id"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
style="
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
"
|
||||||
|
>
|
||||||
|
<span>{{ item.batch }}</span
|
||||||
|
><span>{{ item.count }}</span>
|
||||||
|
</div>
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :md="12" :sm="24">
|
||||||
|
<el-form-item label="领用数量">
|
||||||
|
<el-input-number
|
||||||
|
v-model="form.count_use"
|
||||||
|
:min="0"
|
||||||
|
class="width-100"
|
||||||
|
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>
|
||||||
|
</el-col>
|
||||||
|
<el-col :md="12" :sm="24">
|
||||||
|
<el-form-item label="加工前不良" prop="count_pn_jgqbl">
|
||||||
|
<el-input-number
|
||||||
|
v-model="form.count_pn_jgqbl"
|
||||||
|
:min="0"
|
||||||
|
:disabled="true"
|
||||||
|
style="width: 100%"
|
||||||
|
controls-position="right"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :md="12" :sm="24">
|
||||||
|
<el-form-item label="备注">
|
||||||
|
<el-input v-model="form.note"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-divider v-if="(mgroupName=='黑化'||mgroupName=='退火')&&cellsList.length>0"></el-divider>
|
||||||
|
<template v-if="mgroupName=='黑化'||mgroupName=='退火'">
|
||||||
|
<el-row v-for="(item) in cellsList" :key="item">
|
||||||
|
<el-col :md="12" :sm="24">
|
||||||
|
<el-form-item label="所在层数">
|
||||||
|
<el-input-number
|
||||||
|
style="width:90%"
|
||||||
|
v-model="item.floor"
|
||||||
|
:min="0"
|
||||||
|
class="width-100"
|
||||||
|
placeholder="层数"
|
||||||
|
controls-position="right"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :md="12" :sm="24">
|
||||||
|
<el-form-item label="本层数量">
|
||||||
|
<el-input-number
|
||||||
|
style="width:90%"
|
||||||
|
v-model="item.count_use"
|
||||||
|
:min="0"
|
||||||
|
class="width-100"
|
||||||
|
placeholder="本层数量"
|
||||||
|
controls-position="right"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-divider v-if="qct_defects.length>0"></el-divider>
|
||||||
|
<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="defectform[item.defect_name]"
|
||||||
|
:min="0"
|
||||||
|
style="width: 100%"
|
||||||
|
controls-position="right"
|
||||||
|
@change="countChange"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</template>
|
||||||
|
</el-row>
|
||||||
</el-form>
|
</el-form>
|
||||||
</el-main>
|
</el-main>
|
||||||
<el-footer>
|
<el-footer>
|
||||||
<el-button type="primary" :loading="isSaveing" @click="submit"
|
<el-button type="primary" :loading="isSaveing" @click="submit">保存</el-button>
|
||||||
>保存</el-button
|
|
||||||
>
|
|
||||||
<el-button @click="visible = false">取消</el-button>
|
<el-button @click="visible = false">取消</el-button>
|
||||||
</el-footer>
|
</el-footer>
|
||||||
</el-container>
|
</el-container>
|
||||||
|
|
@ -85,6 +170,7 @@ const defaultForm = {
|
||||||
mlog: "",
|
mlog: "",
|
||||||
mtask: "",
|
mtask: "",
|
||||||
batch: "",
|
batch: "",
|
||||||
|
count_pn_jgqbl:0,
|
||||||
count_use: 0,
|
count_use: 0,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -98,6 +184,10 @@ export default {
|
||||||
type: String,
|
type: String,
|
||||||
default: "",
|
default: "",
|
||||||
},
|
},
|
||||||
|
mgroupName:{
|
||||||
|
type: String,
|
||||||
|
default: "",
|
||||||
|
},
|
||||||
materialIn: {
|
materialIn: {
|
||||||
type: String,
|
type: String,
|
||||||
default: "",
|
default: "",
|
||||||
|
|
@ -135,9 +225,15 @@ export default {
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
cells:0,//层数
|
||||||
|
count_cell:0,//每层数量
|
||||||
|
cell_start:0,//开始层数
|
||||||
codeBatch:"",
|
codeBatch:"",
|
||||||
options: [],
|
options: [],
|
||||||
|
cellsList:[],
|
||||||
|
qct_defects:[],
|
||||||
materialOptions: [],
|
materialOptions: [],
|
||||||
|
defectform:{},
|
||||||
visible: false,
|
visible: false,
|
||||||
isSaveing: false,
|
isSaveing: false,
|
||||||
setFiltersVisible: false,
|
setFiltersVisible: false,
|
||||||
|
|
@ -157,6 +253,7 @@ export default {
|
||||||
that.getMaterial();
|
that.getMaterial();
|
||||||
}
|
}
|
||||||
this.getMtask();
|
this.getMtask();
|
||||||
|
this.getdefects();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
open() {
|
open() {
|
||||||
|
|
@ -193,6 +290,58 @@ export default {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
getdefects(){
|
||||||
|
let that = this;
|
||||||
|
that.$API.qm.qct.list.req({qctmat__material:that.materialIn,page:0,tags:'process'}).then((res) => {
|
||||||
|
if(res.length>0){
|
||||||
|
that.$API.qm.qct.item.req(res[0].id).then((res) => {
|
||||||
|
res.qct_defects.forEach((item) => {
|
||||||
|
that.defectform[item.defect_name] = 0;
|
||||||
|
})
|
||||||
|
that.qct_defects=res.qct_defects;
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
materialBatchChange(){
|
||||||
|
let that = this;
|
||||||
|
that.materialOptions.forEach(item => {
|
||||||
|
if(item.id==that.form.wm_in){
|
||||||
|
that.form.count_use = item.count_cando;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
cellStartChanges(){
|
||||||
|
let that = this;
|
||||||
|
let remaind = (that.form.count_use-that.form.count_pn_jgqbl)%that.count_cell;
|
||||||
|
that.cellsList = [];
|
||||||
|
for(let i=0;i<that.cells;i++){
|
||||||
|
console.log('i',i)
|
||||||
|
console.log((that.cells-i)==1)
|
||||||
|
let obj = {};
|
||||||
|
obj.floor=that.cell_start+i;
|
||||||
|
if((that.cells-i)==1&&remaind>0){
|
||||||
|
obj.count_use = remaind;
|
||||||
|
}else{
|
||||||
|
obj.count_use = that.count_cell;
|
||||||
|
}
|
||||||
|
that.cellsList.push(obj)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
countCellChanges(){
|
||||||
|
this.cells =Math.ceil((this.form.count_use-this.form.count_pn_jgqbl)/this.count_cell);
|
||||||
|
this.cellStartChanges();
|
||||||
|
},
|
||||||
|
countChange() {
|
||||||
|
let that = this;
|
||||||
|
that.form.count_pn_jgqbl = 0;
|
||||||
|
that.qct_defects.forEach(item => {
|
||||||
|
if(item.defect_okcate==30){
|
||||||
|
that.form.count_pn_jgqbl += that.defectform[item.defect_name];
|
||||||
|
}
|
||||||
|
})
|
||||||
|
that.countCellChanges();
|
||||||
|
},
|
||||||
//表单提交方法
|
//表单提交方法
|
||||||
submit() {
|
submit() {
|
||||||
let that = this;
|
let that = this;
|
||||||
|
|
@ -200,17 +349,26 @@ export default {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
that.isSaveing = true;
|
that.isSaveing = true;
|
||||||
that.form.mlog = that.mlog;
|
that.form.mlog = that.mlog;
|
||||||
that.$API.wpm.mlogb.in
|
that.form.count_json = that.cellsList;
|
||||||
.req(that.form)
|
let count_pn_jgqbl = 0,mlogbdefect=[];
|
||||||
.then((res) => {
|
that.qct_defects.forEach(item => {
|
||||||
that.isSaveing = false;
|
count_pn_jgqbl += that.defectform[item.defect_name] ;
|
||||||
that.$emit("success");
|
let obj = {};
|
||||||
that.visible = false;
|
obj.defect = item.defect;
|
||||||
that.$message.success("操作成功");
|
obj.count = that.defectform[item.defect_name];
|
||||||
})
|
mlogbdefect.push(obj);
|
||||||
.catch((err) => {
|
})
|
||||||
that.isSaveing = false;
|
// that.form.count_use = that.count_use;
|
||||||
});
|
that.form.mlogbdefect = mlogbdefect;
|
||||||
|
that.form.count_pn_jgqbl = count_pn_jgqbl;
|
||||||
|
that.$API.wpm.mlogb.in.req(that.form).then((res) => {
|
||||||
|
that.isSaveing = false;
|
||||||
|
that.$emit("success");
|
||||||
|
that.visible = false;
|
||||||
|
that.$message.success("操作成功");
|
||||||
|
}).catch((err) => {
|
||||||
|
that.isSaveing = false;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue