|
@@ -51,19 +51,34 @@
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
</template>
|
|
</template>
|
|
|
- <el-table-column label="重量" prop="weight" align="center" width="100" fixed="right">
|
|
|
|
|
|
|
+ <el-table-column label="重量" prop="weight" align="center" width="100" fixed="right" :show-overflow-tooltip="true">
|
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
|
<el-input type="number" v-model="scope.row.weight" :min="0"></el-input>
|
|
<el-input type="number" v-model="scope.row.weight" :min="0"></el-input>
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
- <el-table-column label="重量单位" prop="weightUnit" align="center" width="80" fixed="right"></el-table-column>
|
|
|
|
|
- <el-table-column label="质检状态" prop="qualityStatus" align="center" width="120" fixed="right">
|
|
|
|
|
|
|
+ <el-table-column label="重量单位" prop="weightUnit" align="center" width="80" fixed="right" :show-overflow-tooltip="true"></el-table-column>
|
|
|
|
|
+ <el-table-column label="处置状态" prop="disposalStatus" align="center" width="80" fixed="right" :show-overflow-tooltip="true">
|
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
|
- <span v-if="scope.row.qualityStatus == 0 ">未质检</span>
|
|
|
|
|
- <span v-if="scope.row.qualityStatus == 1 ">已质检</span>
|
|
|
|
|
|
|
+ <span v-if="scope.row.disposalStatus == 1 ">返工</span>
|
|
|
|
|
+ <span v-if="scope.row.disposalStatus == 2 ">返修</span>
|
|
|
|
|
+ <span v-if="scope.row.disposalStatus == 3 ">报废</span>
|
|
|
|
|
+ <span v-if="scope.row.disposalStatus == 4 ">降级使用</span>
|
|
|
|
|
+ <span v-if="scope.row.disposalStatus == 5 ">让步接收</span>
|
|
|
|
|
+ <span v-if="scope.row.disposalStatus == 6 ">留样</span>
|
|
|
|
|
+ <span v-if="scope.row.disposalStatus == 7 ">消耗</span>
|
|
|
|
|
+ <span v-if="scope.row.disposalStatus == 8 ">回用</span>
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
- <el-table-column label="质检结果" prop="qualityResults" align="center" width="120" fixed="right">
|
|
|
|
|
|
|
+ <el-table-column label="处置时间" prop="disposeTime" align="center" width="100" fixed="right" :show-overflow-tooltip="true">
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ <el-table-column label="质检状态" prop="qualityStatus" align="center" width="120" fixed="right" :show-overflow-tooltip="true">
|
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
|
+ <span v-if="scope.row.qualityStatus == 0 ">未检</span>
|
|
|
|
|
+ <span v-if="scope.row.qualityStatus == 1 ">已检</span>
|
|
|
|
|
+ <span v-if="scope.row.qualityStatus == 2 ">待检</span>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ <el-table-column label="质检结果" prop="qualityResults" align="center" width="110" fixed="right" :show-overflow-tooltip="true">
|
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
|
<el-select v-model="scope.row.qualityResults" placeholder="请选择" style="width: 100%;"
|
|
<el-select v-model="scope.row.qualityResults" placeholder="请选择" style="width: 100%;"
|
|
|
:disabled="type == 'detail'" size="mini">
|
|
:disabled="type == 'detail'" size="mini">
|
|
@@ -334,11 +349,8 @@ export default {
|
|
|
},
|
|
},
|
|
|
async queryQualitySamplContent() {
|
|
async queryQualitySamplContent() {
|
|
|
const res = await queryQualitySamplContent({ qualityWorkerId: this.$route.query.id })
|
|
const res = await queryQualitySamplContent({ qualityWorkerId: this.$route.query.id })
|
|
|
-
|
|
|
|
|
let addStatus = res.map((item) => {
|
|
let addStatus = res.map((item) => {
|
|
|
item.isValid = true;
|
|
item.isValid = true;
|
|
|
- item.qualityResults = 1;
|
|
|
|
|
- item.qualityStatus = 0;
|
|
|
|
|
return {
|
|
return {
|
|
|
...item
|
|
...item
|
|
|
}
|
|
}
|
|
@@ -468,7 +480,7 @@ export default {
|
|
|
|
|
|
|
|
// 检查有效性
|
|
// 检查有效性
|
|
|
for (const item of list) {
|
|
for (const item of list) {
|
|
|
- for (const child of item.children) {
|
|
|
|
|
|
|
+ for (const child of item.qualitySampleTemplateList) {
|
|
|
|
|
|
|
|
console.log(child, 'child')
|
|
console.log(child, 'child')
|
|
|
if (!child.qualityResultContent || !child.qualityResults) {
|
|
if (!child.qualityResultContent || !child.qualityResults) {
|
|
@@ -480,18 +492,18 @@ export default {
|
|
|
|
|
|
|
|
// 处理数据
|
|
// 处理数据
|
|
|
const hasInvalidItem = list.some(item =>
|
|
const hasInvalidItem = list.some(item =>
|
|
|
- item.children.some(child => child.qualityResults === 2)
|
|
|
|
|
|
|
+ item.qualitySampleTemplateList.some(child => child.qualityResults === 2)
|
|
|
);
|
|
);
|
|
|
console.log('是否有不合格数据', hasInvalidItem)
|
|
console.log('是否有不合格数据', hasInvalidItem)
|
|
|
|
|
|
|
|
for (const item of list) {
|
|
for (const item of list) {
|
|
|
- const filteredData = item.children.filter((item) =>
|
|
|
|
|
|
|
+ const filteredData = item.qualitySampleTemplateList.filter((item) =>
|
|
|
item.qualityResults == 2
|
|
item.qualityResults == 2
|
|
|
);
|
|
);
|
|
|
console.log(filteredData, '不合格数据')
|
|
console.log(filteredData, '不合格数据')
|
|
|
if (filteredData.length > -1) {
|
|
if (filteredData.length > -1) {
|
|
|
this.form.noQualifiedNumber = filteredData.length;
|
|
this.form.noQualifiedNumber = filteredData.length;
|
|
|
- this.form.qualifiedNumber = item.children.length - filteredData.length;
|
|
|
|
|
|
|
+ this.form.qualifiedNumber = this.form.total - filteredData.length;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
console.log(list, 'listlistlistlist')
|
|
console.log(list, 'listlistlistlist')
|
|
@@ -499,14 +511,13 @@ export default {
|
|
|
const processedList = list.map(item => {
|
|
const processedList = list.map(item => {
|
|
|
item.qualityResults = hasInvalidItem ? 2 : 1;
|
|
item.qualityResults = hasInvalidItem ? 2 : 1;
|
|
|
item.qualityStatus = 1;
|
|
item.qualityStatus = 1;
|
|
|
- item.qualitySampleTemplateList = item.children;
|
|
|
|
|
|
|
+ // item.qualitySampleTemplateList = item.children;
|
|
|
item.isValid = !hasInvalidItem
|
|
item.isValid = !hasInvalidItem
|
|
|
- delete item.children;
|
|
|
|
|
|
|
+ // delete item.children;
|
|
|
return {
|
|
return {
|
|
|
...item,
|
|
...item,
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
-
|
|
|
|
|
this.$set(this.sampleList, index, processedList[0]);
|
|
this.$set(this.sampleList, index, processedList[0]);
|
|
|
|
|
|
|
|
console.log(this.sampleList, processedList, '222表')
|
|
console.log(this.sampleList, processedList, '222表')
|