fix:mlogbw
This commit is contained in:
parent
f1c363ed23
commit
f01b1a6c9d
|
@ -105,76 +105,6 @@
|
||||||
></el-switch>
|
></el-switch>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<!-- <el-table-column prop="note" :label="item.testitem_name" v-for="item in scope.row.ftest.ftestitems" :key="item.id">
|
|
||||||
<template #default="scope">
|
|
||||||
<el-input-number
|
|
||||||
v-if="item.testitem_field_type=='input-number'"
|
|
||||||
v-model="item.test_val_json"
|
|
||||||
:min="0"
|
|
||||||
class="width-100"
|
|
||||||
controls-position="right"
|
|
||||||
@change="defectCountSun(scope.row)"
|
|
||||||
>
|
|
||||||
</el-input-number>
|
|
||||||
<el-input-number
|
|
||||||
v-if="item.testitem_field_type=='input-int'"
|
|
||||||
v-model="item.test_val_json"
|
|
||||||
: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'"
|
|
||||||
v-model="item.test_val_json"
|
|
||||||
class="width-100"
|
|
||||||
@change="defectCountSun(scope.row)"
|
|
||||||
>
|
|
||||||
</el-input>
|
|
||||||
<el-select
|
|
||||||
v-if="item.testitem_field_type=='select-text'"
|
|
||||||
v-model="item.test_val_json"
|
|
||||||
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'"
|
|
||||||
v-model="item.test_val_json"
|
|
||||||
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>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column :label="item1.defect_name" v-for="item1 in scope.row.ftest.ftestdefects" :key="item1.id">
|
|
||||||
<template #default="scope">
|
|
||||||
<el-switch
|
|
||||||
:disabled="!scope.row.isEdit"
|
|
||||||
v-model="item1.has"
|
|
||||||
style="--el-switch-on-color: red"
|
|
||||||
@change="switchChange(scope.row, item)"
|
|
||||||
></el-switch>
|
|
||||||
</template>
|
|
||||||
</el-table-column> -->
|
|
||||||
<el-table-column prop="note" label="备注">
|
<el-table-column prop="note" label="备注">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<span v-if="!scope.row.isEdit">{{ scope.row.note }}</span>
|
<span v-if="!scope.row.isEdit">{{ scope.row.note }}</span>
|
||||||
|
@ -280,25 +210,27 @@ export default {
|
||||||
},
|
},
|
||||||
getdefects(){
|
getdefects(){
|
||||||
let that = this;
|
let that = this;
|
||||||
that.$API.qm.qct.item.req(that.qct).then((res) => {
|
if(that.qct!==null&&that.qct!==''){
|
||||||
that.qct_defects = [];
|
that.$API.qm.qct.item.req(that.qct).then((res) => {
|
||||||
res.qct_defects.forEach((item) => {
|
that.qct_defects = [];
|
||||||
that.addTemplate[item.defect_name] = false;
|
res.qct_defects.forEach((item) => {
|
||||||
|
that.addTemplate[item.defect_name] = false;
|
||||||
|
})
|
||||||
|
that.qct_defects = res.qct_defects;
|
||||||
|
that.qct_testitems = [];
|
||||||
|
res.qct_testitems.forEach((item2) => {
|
||||||
|
that.addTemplate[item2.testitem_name] = '';
|
||||||
|
let obj2 = Object.assign({}, item2);
|
||||||
|
obj2.value = '';
|
||||||
|
if(obj2.testitem_field_type=='select-text'||obj2.testitem_field_type=='selects-text'){
|
||||||
|
let str = obj2.testitem_choices.replace(/'/g, '"');
|
||||||
|
let arr = JSON.parse(str);
|
||||||
|
obj2.testitem_choices = arr;
|
||||||
|
}
|
||||||
|
that.qct_testitems.push(obj2);
|
||||||
|
})
|
||||||
})
|
})
|
||||||
that.qct_defects = res.qct_defects;
|
}
|
||||||
that.qct_testitems = [];
|
|
||||||
res.qct_testitems.forEach((item2) => {
|
|
||||||
that.addTemplate[item2.testitem_name] = '';
|
|
||||||
let obj2 = Object.assign({}, item2);
|
|
||||||
obj2.value = '';
|
|
||||||
if(obj2.testitem_field_type=='select-text'||obj2.testitem_field_type=='selects-text'){
|
|
||||||
let str = obj2.testitem_choices.replace(/'/g, '"');
|
|
||||||
let arr = JSON.parse(str);
|
|
||||||
obj2.testitem_choices = arr;
|
|
||||||
}
|
|
||||||
that.qct_testitems.push(obj2);
|
|
||||||
})
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
getOptions(){
|
getOptions(){
|
||||||
let that = this;
|
let that = this;
|
||||||
|
@ -324,15 +256,26 @@ export default {
|
||||||
res.forEach((item) => {
|
res.forEach((item) => {
|
||||||
let obj = Object.assign({},item);
|
let obj = Object.assign({},item);
|
||||||
obj.isEdit = false;
|
obj.isEdit = false;
|
||||||
if(item.ftest.ftestdefects.length>0){
|
if(that.qct!==null&&that.qct!==''){
|
||||||
item.ftest.ftestdefects.forEach((item1) => {
|
if(item.ftest&&item.ftest.ftestdefects&&item.ftest.ftestdefects.length>0){
|
||||||
obj[item1.defect_name] = item1.has;
|
item.ftest.ftestdefects.forEach((item1) => {
|
||||||
})
|
obj[item1.defect_name] = item1.has;
|
||||||
}
|
})
|
||||||
if(item.ftest.ftestitems.length>0){
|
}else{
|
||||||
item.ftest.ftestitems.forEach((item2) => {
|
that.qct_defects.forEach((item1) => {
|
||||||
obj[item2.testitem_name] = item2.test_val_json;
|
obj[item1.defect_name] = false;
|
||||||
})
|
})
|
||||||
|
}
|
||||||
|
if(item.ftest&&item.ftest.ftestitems&&item.ftest.ftestitems.length>0){
|
||||||
|
item.ftest.ftestitems.forEach((item2) => {
|
||||||
|
obj[item2.testitem_name] = item2.test_val_json;
|
||||||
|
})
|
||||||
|
}else{
|
||||||
|
that.qct_testitems.forEach((item2) => {
|
||||||
|
obj[item2.testitem_name] = "";
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
that.mlogbwlist.push(obj);
|
that.mlogbwlist.push(obj);
|
||||||
})
|
})
|
||||||
|
@ -346,51 +289,56 @@ export default {
|
||||||
obj.number = row.number;
|
obj.number = row.number;
|
||||||
obj.mlogb = row.mlogb;
|
obj.mlogb = row.mlogb;
|
||||||
obj.note = row.note;
|
obj.note = row.note;
|
||||||
obj.ftest = {};
|
if(that.qct!==null&&that.qct!==''){
|
||||||
obj.ftest.ftestitems = [];
|
obj.ftest = {};
|
||||||
obj.ftest.ftestdefects = [];
|
obj.ftest.ftestitems = [];
|
||||||
if(row.id!=''&&row.id!==undefined&&row.id!==null){
|
obj.ftest.ftestdefects = [];
|
||||||
obj.id = row.id;
|
if(row.ftest&&row.ftest.id){
|
||||||
obj.ftest.qct = row.ftest.qct;
|
obj.ftest.id =row.ftest.id;
|
||||||
obj.ftest.test_date = row.ftest.test_date;
|
}
|
||||||
obj.ftest.test_user = row.ftest.test_user;
|
// obj.ftest.id = (row.ftest&&row.ftest.id)?row.ftest.id:'';
|
||||||
row.ftest.ftestdefects.forEach((item) => {
|
if(row.id!=''&&row.id!==undefined&&row.id!==null&&row.ftest&&row.ftest.ftestdefects){
|
||||||
let itemObj = {};
|
obj.ftest.qct = row.ftest.qct;
|
||||||
itemObj.id = item.id;
|
obj.ftest.test_date = row.ftest.test_date;
|
||||||
itemObj.defect = item.defect;
|
obj.ftest.test_user = row.ftest.test_user;
|
||||||
itemObj.test_user = item.test_user;
|
row.ftest.ftestdefects.forEach((item) => {
|
||||||
itemObj.has = row[item.defect_name]?row[item.defect_name]:false;
|
let itemObj = {};
|
||||||
obj.ftest.ftestdefects.push(itemObj);
|
itemObj.id = item.id;
|
||||||
})
|
itemObj.defect = item.defect;
|
||||||
row.ftest.ftestitems.forEach((item1) => {
|
itemObj.test_user = item.test_user;
|
||||||
let itemObj1 = {};
|
itemObj.has = row[item.defect_name]?row[item.defect_name]:false;
|
||||||
itemObj1.id = item1.id;
|
obj.ftest.ftestdefects.push(itemObj);
|
||||||
itemObj1.testitem = item1.testitem;
|
})
|
||||||
itemObj1.test_user = item1.test_user;
|
row.ftest.ftestitems.forEach((item1) => {
|
||||||
itemObj1.test_val_json = row[item1.testitem_name];
|
let itemObj1 = {};
|
||||||
obj.ftest.ftestitems.push(itemObj1);
|
itemObj1.id = item1.id;
|
||||||
})
|
itemObj1.testitem = item1.testitem;
|
||||||
}else{
|
itemObj1.test_user = item1.test_user;
|
||||||
obj.ftest.qct = that.qct;
|
itemObj1.test_val_json = row[item1.testitem_name];
|
||||||
obj.ftest.test_date = that.handle_date;
|
obj.ftest.ftestitems.push(itemObj1);
|
||||||
obj.ftest.test_user = that.handle_user;
|
})
|
||||||
that.qct_defects.forEach((item) => {
|
}else{
|
||||||
let itemObj = {};
|
obj.ftest.qct = that.qct;
|
||||||
itemObj.defect = item.defect;
|
obj.ftest.test_date = that.handle_date;
|
||||||
itemObj.test_user = that.handle_user;
|
obj.ftest.test_user = that.handle_user;
|
||||||
itemObj.has = row[item.defect_name]?row[item.defect_name]:false;
|
that.qct_defects.forEach((item) => {
|
||||||
obj.ftest.ftestdefects.push(itemObj);
|
let itemObj = {};
|
||||||
})
|
itemObj.defect = item.defect;
|
||||||
that.qct_testitems.forEach((item1) => {
|
itemObj.test_user = that.handle_user;
|
||||||
let itemObj1 = {};
|
itemObj.has = row[item.defect_name]?row[item.defect_name]:false;
|
||||||
itemObj1.testitem = item1.testitem;
|
obj.ftest.ftestdefects.push(itemObj);
|
||||||
itemObj1.test_user = that.handle_user;
|
})
|
||||||
itemObj1.test_val_json = row[item1.testitem_name];
|
that.qct_testitems.forEach((item1) => {
|
||||||
obj.ftest.ftestitems.push(itemObj1);
|
let itemObj1 = {};
|
||||||
})
|
itemObj1.testitem = item1.testitem;
|
||||||
|
itemObj1.test_user = that.handle_user;
|
||||||
|
itemObj1.test_val_json = row[item1.testitem_name];
|
||||||
|
obj.ftest.ftestitems.push(itemObj1);
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if(row.id!==''&&row.id!==undefined&&row.id!==null){
|
if(row.id!==''&&row.id!==undefined&&row.id!==null){
|
||||||
obj.ftest.id = row.ftest.id;
|
obj.id = row.id;
|
||||||
that.$API.wpm.mlogbw.update.req(row.id,obj).then((res) => {
|
that.$API.wpm.mlogbw.update.req(row.id,obj).then((res) => {
|
||||||
that.$message.success("保存成功");
|
that.$message.success("保存成功");
|
||||||
that.getList();
|
that.getList();
|
||||||
|
|
Loading…
Reference in New Issue