fix:添加输入输出的检验物料
This commit is contained in:
parent
cf5bcc69b7
commit
40d31912e7
|
|
@ -83,42 +83,106 @@
|
||||||
<span v-else>{{ scope.row.equip_name }}</span>
|
<span v-else>{{ scope.row.equip_name }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="开始时间" min-width="80px" v-if="mode == 'ins'&&route_code=='niuzhuan'">
|
<el-table-column label="扭转日期" min-width="80px" v-if="mode == 'ins'&&route_code=='niuzhuan'">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
v-if="scope.row.isEdit"
|
v-if="scope.row.isEdit"
|
||||||
v-model="scope.row.work_start_time"
|
v-model="scope.row.work_start_time"
|
||||||
type="datetime"
|
type="datetime"
|
||||||
value-format="YYYY-MM-DD HH:mm:ss"
|
value-format="YYYY-MM-DD HH:mm:ss"
|
||||||
|
formatter="YYYY-MM-DD"
|
||||||
style="width: 100%;"
|
style="width: 100%;"
|
||||||
popper-append-to-body
|
popper-append-to-body
|
||||||
/>
|
/>
|
||||||
<span v-else>{{ scope.row.work_start_time }}</span>
|
<div v-else>
|
||||||
|
<span v-if="scope.row.work_start_time!==null">{{ scope.row.work_start_time.split(' ')[0]}}</span>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="扭转时间" min-width="80px" v-if="mode == 'ins'&&route_code=='niuzhuan'">
|
<el-table-column label="波数" min-width="80px" v-if="mode == 'ins'&&route_code=='niuzhuan'">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-select
|
||||||
|
v-if="scope.row.isEdit"
|
||||||
|
v-model="scope.row.wave_number"
|
||||||
|
placeholder="波数"
|
||||||
|
clearable
|
||||||
|
style="width: 100%"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in 10"
|
||||||
|
:key="item"
|
||||||
|
:label="item"
|
||||||
|
:value="item"
|
||||||
|
></el-option>
|
||||||
|
</el-select>
|
||||||
|
<span v-else>{{ scope.row.wave_number }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<!-- <el-table-column label="扭转角设定值" min-width="80px" v-if="mode == 'ins'&&route_code=='niuzhuan'">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-input-number
|
<el-input-number
|
||||||
v-if="scope.row.isEdit"
|
v-if="scope.row.isEdit"
|
||||||
v-model="scope.row.work_time"
|
v-model="scope.row.work_time"
|
||||||
style="width: 100%;"
|
style="width: 100%;"
|
||||||
controls-position="right"
|
controls-position="right"
|
||||||
@change="workTimeCountSun(scope.row)"
|
:precision="3"
|
||||||
></el-input-number>
|
></el-input-number>
|
||||||
<span v-else>{{ scope.row.work_time }}</span>
|
<span v-else>{{ scope.row.work_time }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column> -->
|
||||||
<el-table-column label="结束时间" min-width="80px" v-if="mode == 'ins'&&route_code=='niuzhuan'">
|
<el-table-column prop="note" :label="item.testitem_name" v-for="item in testitems" :key="item.id" width="150px">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-date-picker
|
<span v-if="!scope.row.isEdit||!item.canEdit">{{ scope.row[item.testitem_name] }}</span>
|
||||||
v-if="scope.row.isEdit"
|
<el-input-number
|
||||||
v-model="scope.row.work_end_time"
|
v-if="item.testitem_field_type=='input-number'&&scope.row.isEdit&&item.canEdit"
|
||||||
type="datetime"
|
v-model="scope.row[item.testitem_name]"
|
||||||
value-format="YYYY-MM-DD HH:mm:ss"
|
class="width-100"
|
||||||
style="width: 100%;"
|
controls-position="right"
|
||||||
popper-append-to-body
|
@change="defectCountSun(scope.row)"
|
||||||
/>
|
></el-input-number>
|
||||||
<span v-else>{{ scope.row.work_end_time }}</span>
|
<el-input-number
|
||||||
|
v-if="item.testitem_field_type=='input-int'&&scope.row.isEdit&&item.canEdit"
|
||||||
|
v-model="scope.row[item.testitem_name]"
|
||||||
|
:min="0"
|
||||||
|
class="width-100"
|
||||||
|
controls-position="right"
|
||||||
|
@change="defectCountSun(scope.row)"
|
||||||
|
></el-input-number>
|
||||||
|
<el-input
|
||||||
|
v-if="item.testitem_field_type=='input-text'&&scope.row.isEdit&&item.canEdit"
|
||||||
|
v-model="scope.row[item.testitem_name]"
|
||||||
|
class="width-100"
|
||||||
|
@change="defectCountSun(scope.row)"
|
||||||
|
></el-input>
|
||||||
|
<el-select
|
||||||
|
v-if="item.testitem_field_type=='select-text'&&scope.row.isEdit&&item.canEdit"
|
||||||
|
v-model="scope.row[item.testitem_name]"
|
||||||
|
clearable
|
||||||
|
class="width-100"
|
||||||
|
@change="defectCountSun(scope.row)"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item0 in item.testitem_choices"
|
||||||
|
:key="item0"
|
||||||
|
:label="item0"
|
||||||
|
:value="item0"
|
||||||
|
></el-option>
|
||||||
|
</el-select>
|
||||||
|
<el-select
|
||||||
|
v-if="item.testitem_field_type=='selects-text'&&scope.row.isEdit&&item.canEdit"
|
||||||
|
v-model="scope.row[item.testitem_name]"
|
||||||
|
clearable
|
||||||
|
multiple
|
||||||
|
class="width-100"
|
||||||
|
@change="defectCountSun(scope.row)"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item1 in item.testitem_choices"
|
||||||
|
:key="item1"
|
||||||
|
:label="item1"
|
||||||
|
:value="item1"
|
||||||
|
></el-option>
|
||||||
|
</el-select>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="note" :label="item.testitem_name" v-for="item in qct_testitems" :key="item.id" width="150px">
|
<el-table-column prop="note" :label="item.testitem_name" v-for="item in qct_testitems" :key="item.id" width="150px">
|
||||||
|
|
@ -430,6 +494,10 @@ export default {
|
||||||
type:String,
|
type:String,
|
||||||
default:"",
|
default:"",
|
||||||
},
|
},
|
||||||
|
material_in:{
|
||||||
|
type:String,
|
||||||
|
default:"",
|
||||||
|
},
|
||||||
processType:{
|
processType:{
|
||||||
type:String,
|
type:String,
|
||||||
default:"",
|
default:"",
|
||||||
|
|
@ -477,6 +545,7 @@ export default {
|
||||||
qct_defects:[],
|
qct_defects:[],
|
||||||
qct_testitems:[],
|
qct_testitems:[],
|
||||||
mlogbwlist:[],
|
mlogbwlist:[],
|
||||||
|
testitems:[],
|
||||||
equipmentOptions:[],
|
equipmentOptions:[],
|
||||||
addTemplate:{
|
addTemplate:{
|
||||||
mlogb: "",
|
mlogb: "",
|
||||||
|
|
@ -519,9 +588,9 @@ export default {
|
||||||
mounted() {
|
mounted() {
|
||||||
let that = this;
|
let that = this;
|
||||||
this.route_code = this.$route.path.split("/")[2];
|
this.route_code = this.$route.path.split("/")[2];
|
||||||
// if(this.route_code=='niuzhuan'){
|
if(this.route_code=='niuzhuan'&&that.mode == 'ins'){
|
||||||
// this.getEquipment4();
|
// that.gettestitem();
|
||||||
// }
|
}
|
||||||
that.hideAdd = that.isSubmit;
|
that.hideAdd = that.isSubmit;
|
||||||
if(that.mgroupName=='排一次棒'||that.mgroupName=='排板'){
|
if(that.mgroupName=='排一次棒'||that.mgroupName=='排板'){
|
||||||
// that.getNewNumber();
|
// that.getNewNumber();
|
||||||
|
|
@ -549,6 +618,23 @@ export default {
|
||||||
that.tableHeight = document.getElementById('mlogbwMain').clientHeight-20;
|
that.tableHeight = document.getElementById('mlogbwMain').clientHeight-20;
|
||||||
},500)
|
},500)
|
||||||
},
|
},
|
||||||
|
//获取输入的testItem
|
||||||
|
gettestitem(){
|
||||||
|
let that = this;
|
||||||
|
that.$API.qm.qct.getQct.req({ material: that.material_in,type:'in',tag:'process' }).then((res) => {
|
||||||
|
console.log('gettestitem',res);
|
||||||
|
// that.qct = res[0].id;
|
||||||
|
that.testitems = [];
|
||||||
|
// let list = res[0].qct_testitems;
|
||||||
|
// list.forEach(item=>{
|
||||||
|
// let obj = Object.assign({}, item);
|
||||||
|
// obj.value = null;
|
||||||
|
// obj.canEdit = true;
|
||||||
|
// obj.addto_wpr = item.addto_wpr;
|
||||||
|
// that.testitems.push(obj)
|
||||||
|
// })
|
||||||
|
});
|
||||||
|
},
|
||||||
getNewNumber(){
|
getNewNumber(){
|
||||||
let that = this;
|
let that = this;
|
||||||
let date = new Date();
|
let date = new Date();
|
||||||
|
|
@ -590,8 +676,6 @@ export default {
|
||||||
}else if(num<1000){
|
}else if(num<1000){
|
||||||
num = "0"+num;
|
num = "0"+num;
|
||||||
}
|
}
|
||||||
console.log('num',num);
|
|
||||||
console.log('data.number:',data.number);
|
|
||||||
if(that.mgroupName=='排一次棒'){
|
if(that.mgroupName=='排一次棒'){
|
||||||
that.addTemplate.number = years+months+num;
|
that.addTemplate.number = years+months+num;
|
||||||
}
|
}
|
||||||
|
|
@ -599,18 +683,10 @@ export default {
|
||||||
that.addTemplate.number = years+ months + that.material_model+num;
|
that.addTemplate.number = years+ months + that.material_model+num;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
workTimeCountSun(row){
|
|
||||||
let that = this;
|
|
||||||
let time = row.work_time*60*1000;
|
|
||||||
let index = that.mlogbwlist.indexOf(row);
|
|
||||||
let end = new Date(row.work_start_time).getTime()+time;
|
|
||||||
let end_time = that.$TOOL.dateFormat(new Date(end), 'yyyy-MM-dd hh:mm:ss');
|
|
||||||
that.mlogbwlist[index].work_end_time = end_time;
|
|
||||||
},
|
|
||||||
getEquipment4() {
|
getEquipment4() {
|
||||||
let that = this;
|
let that = this;
|
||||||
that.$API.em.equipment.list.req({page:0,cate__code:"4",query:"{id,name,number}"}).then((res) => {
|
that.$API.em.equipment.list.req({page:0,cate__code:"4",query:"{id,name,number}"}).then((res) => {
|
||||||
that.optionsEq = res;
|
that.optionsEq = res.reverse();
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
getEquipments(){
|
getEquipments(){
|
||||||
|
|
@ -681,12 +757,6 @@ export default {
|
||||||
let obj = {};
|
let obj = {};
|
||||||
obj = Object.assign({},item);
|
obj = Object.assign({},item);
|
||||||
obj.isEdit = false;
|
obj.isEdit = false;
|
||||||
if(obj.work_start_time!==null&&obj.work_start_time!==''&&obj.work_end_time!==null&&obj.work_end_time!==''){
|
|
||||||
let start = new Date(obj.work_start_time).getTime();
|
|
||||||
let end = new Date(obj.work_end_time).getTime();
|
|
||||||
let time = (end-start)/60000;
|
|
||||||
obj.work_time = time;
|
|
||||||
}
|
|
||||||
if(that.qct!=''){
|
if(that.qct!=''){
|
||||||
if(item.ftest!=null){
|
if(item.ftest!=null){
|
||||||
if(item.ftest.ftestdefects!==undefined&&item.ftest.ftestdefects!==''&&item.ftest.ftestdefects!==null&&item.ftest.ftestdefects.length>0){
|
if(item.ftest.ftestdefects!==undefined&&item.ftest.ftestdefects!==''&&item.ftest.ftestdefects!==null&&item.ftest.ftestdefects.length>0){
|
||||||
|
|
@ -722,7 +792,7 @@ export default {
|
||||||
obj.wpr = row.wpr;
|
obj.wpr = row.wpr;
|
||||||
obj.note = row.note;
|
obj.note = row.note;
|
||||||
//qct不为空,有检验表
|
//qct不为空,有检验表
|
||||||
if(that.qct!==''){
|
if(that.qct!==''&&that.qct!==null){
|
||||||
that.qct_defects_origin.forEach(item => {
|
that.qct_defects_origin.forEach(item => {
|
||||||
if(item.rule_expression!==''&&item.rule_expression!==undefined&&item.rule_expression!==null){
|
if(item.rule_expression!==''&&item.rule_expression!==undefined&&item.rule_expression!==null){
|
||||||
let str = item.rule_expression.replace(/`/g, '');
|
let str = item.rule_expression.replace(/`/g, '');
|
||||||
|
|
@ -765,13 +835,14 @@ export default {
|
||||||
obj.ftest.ftestitems.push(itemObj1);
|
obj.ftest.ftestitems.push(itemObj1);
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
}else{
|
||||||
|
obj.ftest = null;
|
||||||
}
|
}
|
||||||
// console.log('obj',obj);
|
|
||||||
if(that.mode == 'ins'&&that.route_code=='niuzhuan'){
|
if(that.mode == 'ins'&&that.route_code=='niuzhuan'){
|
||||||
obj.equip = row.equip;
|
obj.equip = row.equip;
|
||||||
obj.work_start_time = row.work_start_time;
|
obj.work_start_time = row.work_start_time;
|
||||||
obj.work_end_time = row.work_end_time;
|
|
||||||
obj.work_time = row.work_time;
|
obj.work_time = row.work_time;
|
||||||
|
obj.wave_number = row.wave_number;
|
||||||
}
|
}
|
||||||
if(row.id!==''&&row.id!==undefined&&row.id!==null){
|
if(row.id!==''&&row.id!==undefined&&row.id!==null){
|
||||||
obj.id = row.id;
|
obj.id = row.id;
|
||||||
|
|
@ -807,8 +878,6 @@ export default {
|
||||||
that.mlogbwlist.forEach((item, index) => {
|
that.mlogbwlist.forEach((item, index) => {
|
||||||
if (item.id == row.id) {
|
if (item.id == row.id) {
|
||||||
that.mlogbwlist[index].isEdit = true;
|
that.mlogbwlist[index].isEdit = true;
|
||||||
console.log('row',row);
|
|
||||||
console.log('that.qct_testitems',that.qct_testitems);
|
|
||||||
let date = new Date();
|
let date = new Date();
|
||||||
if(that.mlogbwlist[index].work_start_time==''||that.mlogbwlist[index].work_start_time==null){
|
if(that.mlogbwlist[index].work_start_time==''||that.mlogbwlist[index].work_start_time==null){
|
||||||
that.mlogbwlist[index].work_start_time = that.$TOOL.dateFormat(date, 'yyyy-MM-dd hh:mm:ss');
|
that.mlogbwlist[index].work_start_time = that.$TOOL.dateFormat(date, 'yyyy-MM-dd hh:mm:ss');
|
||||||
|
|
@ -855,7 +924,6 @@ export default {
|
||||||
let that = this;
|
let that = this;
|
||||||
let index = that.mlogbwlist.indexOf(row);
|
let index = that.mlogbwlist.indexOf(row);
|
||||||
that.qct_defects_origin.forEach(item => {
|
that.qct_defects_origin.forEach(item => {
|
||||||
// console.log('item.rule_expression',item.rule_expression);
|
|
||||||
if(item.rule_expression!==''&&item.rule_expression!==undefined&&item.rule_expression!==null){
|
if(item.rule_expression!==''&&item.rule_expression!==undefined&&item.rule_expression!==null){
|
||||||
let str = item.rule_expression.replace(/`/g, '');
|
let str = item.rule_expression.replace(/`/g, '');
|
||||||
str = str.replace(/\${(.*?)}/g, 'row.\$1')
|
str = str.replace(/\${(.*?)}/g, 'row.\$1')
|
||||||
|
|
@ -960,6 +1028,7 @@ export default {
|
||||||
},
|
},
|
||||||
checkSetting(){
|
checkSetting(){
|
||||||
let that = this;
|
let that = this;
|
||||||
|
that.isSaveing = true;
|
||||||
that.$refs.dialogForm.validate((valid) => {
|
that.$refs.dialogForm.validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
Object.assign(that.setForm,that.form);
|
Object.assign(that.setForm,that.form);
|
||||||
|
|
@ -1020,8 +1089,10 @@ export default {
|
||||||
that.qct_testitems = [];
|
that.qct_testitems = [];
|
||||||
that.qct_testitems = that.testitemlists;
|
that.qct_testitems = that.testitemlists;
|
||||||
that.tableHeight = document.getElementById('mlogbwMain').clientHeight-80;
|
that.tableHeight = document.getElementById('mlogbwMain').clientHeight-80;
|
||||||
|
that.isSaveing = false;
|
||||||
that.getList();
|
that.getList();
|
||||||
}).catch((err) => {
|
}).catch((err) => {
|
||||||
|
that.isSaveing = false;
|
||||||
return err;
|
return err;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
@ -1046,7 +1117,6 @@ export default {
|
||||||
that.mlogbwlist.forEach((item,index) => {
|
that.mlogbwlist.forEach((item,index) => {
|
||||||
let indexs = item.number.indexOf(that.wprInputText)
|
let indexs = item.number.indexOf(that.wprInputText)
|
||||||
if(indexs>-1&&that.wprInputText !== ""){
|
if(indexs>-1&&that.wprInputText !== ""){
|
||||||
// console.log(item.number,that.wprInputText,indexs,indexs>-1);
|
|
||||||
// if(item.number == that.wprInputText){
|
// if(item.number == that.wprInputText){
|
||||||
let obj = Object.assign({},item);
|
let obj = Object.assign({},item);
|
||||||
obj.isEdit = true;
|
obj.isEdit = true;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue