|
|
|
@ -246,7 +246,7 @@ |
|
|
|
</el-form-item> |
|
|
|
<el-form-item :label="'不合格项目数量'"> |
|
|
|
<el-input-number :controls="false" :step="0" v-if="detailData.submitFlag === 'Y'" v-model="detailData.unqualifiedQty" disabled style="width: 81px" @change="noBatchQualifiedQtyChange"></el-input-number> |
|
|
|
<el-input-number :controls="false" :step="0" v-else v-model="detailData.unqualifiedQty" style="width: 81px" @change="noUnqualifiedQtyChange"></el-input-number> |
|
|
|
<el-input-number :controls="false" :step="0" v-else v-model="detailData.unqualifiedQty" disabled style="width: 81px" @change="noUnqualifiedQtyChange"></el-input-number> |
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
<el-form-item :label="'批次不合格数'"> |
|
|
|
@ -413,7 +413,7 @@ |
|
|
|
<el-option label="合格" value="Y" style="color: green"></el-option> |
|
|
|
<el-option label="不合格" value="N" style="color: red"></el-option> |
|
|
|
</el-select> |
|
|
|
<el-select :class="{redElSelect:scope.row.itemResult === 'N', greenElSelect:scope.row.itemResult === 'Y'}" v-else v-model="scope.row.itemResult" style="height: 11px;padding: 0px" placeholder="合格"> |
|
|
|
<el-select :class="{redElSelect:scope.row.itemResult === 'N', greenElSelect:scope.row.itemResult === 'Y'}" v-else v-model="scope.row.itemResult" style="height: 11px;padding: 0px" placeholder="合格" @change="handleItemResultChange($event, scope.row)"> |
|
|
|
<el-option label="合格" value="Y" style="color: green"></el-option> |
|
|
|
<el-option label="不合格" value="N" style="color: red"></el-option> |
|
|
|
</el-select> |
|
|
|
@ -827,13 +827,7 @@ |
|
|
|
detailList: { |
|
|
|
deep: true, |
|
|
|
handler: function (newV, oldV) { |
|
|
|
let num2 = 0 |
|
|
|
for (let i = 0; i < this.detailList.length; i++) { |
|
|
|
if (this.detailList[i].itemResult === 'N') { |
|
|
|
num2++ |
|
|
|
} |
|
|
|
} |
|
|
|
this.detailData.unqualifiedQty = num2 |
|
|
|
this.refreshUnqualifiedQty() |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
@ -2838,9 +2832,15 @@ |
|
|
|
getInspectionFormData () { |
|
|
|
iqcDetailSearch(this.detailData).then(({data}) => { |
|
|
|
if (data && data.code === 0) { |
|
|
|
this.detailList = data.rows |
|
|
|
const rows = Array.isArray(data.rows) ? data.rows : [] |
|
|
|
this.detailList = rows.map(item => ({ |
|
|
|
...item, |
|
|
|
itemResult: item.itemResult == null ? '' : item.itemResult |
|
|
|
})) |
|
|
|
this.refreshUnqualifiedQty() |
|
|
|
} else { |
|
|
|
this.detailList = [] |
|
|
|
this.refreshUnqualifiedQty() |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
@ -3284,32 +3284,48 @@ |
|
|
|
}) |
|
|
|
}, |
|
|
|
updateItemResult(row){ |
|
|
|
if (row.maxValue == null && row.minValue == null&&row.defaultValue==null) { |
|
|
|
return; |
|
|
|
if (row.maxValue == null && row.minValue == null && row.defaultValue == null) { |
|
|
|
return |
|
|
|
} |
|
|
|
let nextItemResult = row.itemResult |
|
|
|
if (row.maxValue == null && row.minValue == null) { |
|
|
|
if (row.numberValue!=row.defaultValue){ |
|
|
|
row.itemResult = 'N' |
|
|
|
if (row.numberValue != row.defaultValue) { |
|
|
|
nextItemResult = 'N' |
|
|
|
} |
|
|
|
}else if (row.maxValue != null && row.minValue != null){ |
|
|
|
if (row.numberValue>row.maxValue ||row.numberValue<row.minValue){ |
|
|
|
row.itemResult = 'N' |
|
|
|
}else { |
|
|
|
row.itemResult = 'Y' |
|
|
|
} else if (row.maxValue != null && row.minValue != null) { |
|
|
|
if (row.numberValue > row.maxValue || row.numberValue < row.minValue) { |
|
|
|
nextItemResult = 'N' |
|
|
|
} else { |
|
|
|
nextItemResult = 'Y' |
|
|
|
} |
|
|
|
}else if(row.maxValue != null){ |
|
|
|
if ( row.numberValue>row.maxValue) { |
|
|
|
row.itemResult = 'N' |
|
|
|
}else { |
|
|
|
row.itemResult = 'Y' |
|
|
|
} else if (row.maxValue != null) { |
|
|
|
if (row.numberValue > row.maxValue) { |
|
|
|
nextItemResult = 'N' |
|
|
|
} else { |
|
|
|
nextItemResult = 'Y' |
|
|
|
} |
|
|
|
}else if(row.minValue != null){ |
|
|
|
if ( row.numberValue<row.minValue) { |
|
|
|
row.itemResult = 'N' |
|
|
|
}else { |
|
|
|
row.itemResult = 'Y' |
|
|
|
} else if (row.minValue != null) { |
|
|
|
if (row.numberValue < row.minValue) { |
|
|
|
nextItemResult = 'N' |
|
|
|
} else { |
|
|
|
nextItemResult = 'Y' |
|
|
|
} |
|
|
|
} |
|
|
|
this.$set(row, 'itemResult', nextItemResult) |
|
|
|
this.refreshUnqualifiedQty() |
|
|
|
}, |
|
|
|
handleItemResultChange (value, row) { |
|
|
|
this.$set(row, 'itemResult', value) |
|
|
|
this.refreshUnqualifiedQty() |
|
|
|
}, |
|
|
|
refreshUnqualifiedQty () { |
|
|
|
let num2 = 0 |
|
|
|
for (let i = 0; i < this.detailList.length; i++) { |
|
|
|
if (this.detailList[i] && this.detailList[i].itemResult === 'N') { |
|
|
|
num2++ |
|
|
|
} |
|
|
|
} |
|
|
|
this.$set(this.detailData, 'unqualifiedQty', num2) |
|
|
|
}, |
|
|
|
|
|
|
|
//删除 |
|
|
|
@ -3370,16 +3386,17 @@ |
|
|
|
saveIQCSubDetailed(this.subDetailData).then(({data}) => { |
|
|
|
if (data && data.code === 0) { |
|
|
|
if (data.count > 0) { |
|
|
|
this.subDetailData.itemResult = 'N' |
|
|
|
this.subDetailData.unqualifiedQuantity = data.count |
|
|
|
this.$set(this.subDetailData, 'itemResult', 'N') |
|
|
|
this.$set(this.subDetailData, 'unqualifiedQuantity', data.count) |
|
|
|
} |
|
|
|
if (this.subDetailData.subDetailValues.length > 0) { |
|
|
|
this.subDetailData.subDetailRecordNum = 1 |
|
|
|
this.$set(this.subDetailData, 'subDetailRecordNum', 1) |
|
|
|
} else { |
|
|
|
this.subDetailData.subDetailRecordNum = -1 |
|
|
|
this.subDetailData.unqualifiedQuantity = 0 |
|
|
|
this.subDetailData.itemResult = 'Y' |
|
|
|
this.$set(this.subDetailData, 'subDetailRecordNum', -1) |
|
|
|
this.$set(this.subDetailData, 'unqualifiedQuantity', 0) |
|
|
|
this.$set(this.subDetailData, 'itemResult', 'Y') |
|
|
|
} |
|
|
|
this.refreshUnqualifiedQty() |
|
|
|
this.subDetailFlag = false |
|
|
|
this.tableData = [] |
|
|
|
this.$message({ |
|
|
|
@ -3540,15 +3557,16 @@ |
|
|
|
changeMyString (val) { |
|
|
|
for (let i = 0; i < this.detailList.length; i++) { |
|
|
|
if (val[this.detailList[i].itemNo] !== undefined) { |
|
|
|
this.detailList[i].unqualifiedQuantity = val[this.detailList[i].itemNo] |
|
|
|
this.$set(this.detailList[i], 'unqualifiedQuantity', val[this.detailList[i].itemNo]) |
|
|
|
if (val[this.detailList[i].itemNo] != null) { |
|
|
|
this.detailList[i].subDetailRecordNum = 1 |
|
|
|
this.$set(this.detailList[i], 'subDetailRecordNum', 1) |
|
|
|
} |
|
|
|
if (val[this.detailList[i].itemNo] > 0) { |
|
|
|
this.detailList[i].itemResult = 'N' |
|
|
|
this.$set(this.detailList[i], 'itemResult', 'N') |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
this.refreshUnqualifiedQty() |
|
|
|
}, |
|
|
|
|
|
|
|
//获取按钮的权限数据 |
|
|
|
|