|
@@ -2,14 +2,14 @@
|
|
|
<div class="ele-body">
|
|
<div class="ele-body">
|
|
|
<el-card shadow="never">
|
|
<el-card shadow="never">
|
|
|
<header-title title="基本信息">
|
|
<header-title title="基本信息">
|
|
|
- <el-button @click="cancel">返回</el-button>
|
|
|
|
|
- <el-button type="primary" @click="save" :loading="loading">保存</el-button>
|
|
|
|
|
- <el-button type="primary" @click="handleReporting" :loading="loading">报工完成</el-button>
|
|
|
|
|
|
|
+ <el-button @click="cancel" >返回</el-button>
|
|
|
|
|
+ <el-button type="primary" @click="save" :loading="loading" v-if="type != 'detail'">保存</el-button>
|
|
|
|
|
+ <el-button type="primary" @click="handleReporting" :loading="loading" v-if="type != 'detail'">报工完成</el-button>
|
|
|
</header-title>
|
|
</header-title>
|
|
|
<base-info ref="baseInfoRefs" v-if="form" :form="form" :btnType="type"></base-info>
|
|
<base-info ref="baseInfoRefs" v-if="form" :form="form" :btnType="type"></base-info>
|
|
|
<el-row>
|
|
<el-row>
|
|
|
<header-title title="质检内容">
|
|
<header-title title="质检内容">
|
|
|
- <el-button type="primary" :loading="loading" @click="batchQuality(null,null,'report')">批量质检</el-button>
|
|
|
|
|
|
|
+ <el-button type="primary" :loading="loading" v-if="type != 'detail'" @click="batchQuality(null,null,'report')">批量质检</el-button>
|
|
|
</header-title>
|
|
</header-title>
|
|
|
<el-tabs v-model="activeName" @tab-click="handleClick">
|
|
<el-tabs v-model="activeName" @tab-click="handleClick">
|
|
|
<el-tab-pane label="来源清单" name="1"></el-tab-pane>
|
|
<el-tab-pane label="来源清单" name="1"></el-tab-pane>
|
|
@@ -87,7 +87,7 @@
|
|
|
</el-select>
|
|
</el-select>
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
- <el-table-column label="操作" align="center" width="120" fixed="right">
|
|
|
|
|
|
|
+ <el-table-column label="操作" align="center" width="120" fixed="right" v-if="type != 'detail'">
|
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
|
<el-link :type="scope.row.isValid ? 'primary' : 'danger'" :underline="false"
|
|
<el-link :type="scope.row.isValid ? 'primary' : 'danger'" :underline="false"
|
|
|
@click="handleDetail(scope.$index, scope.row, 'report')">
|
|
@click="handleDetail(scope.$index, scope.row, 'report')">
|
|
@@ -229,8 +229,8 @@ export default {
|
|
|
{ label: '物料代号', prop: 'materielDesignation', align: 'center' },
|
|
{ label: '物料代号', prop: 'materielDesignation', align: 'center' },
|
|
|
{ label: '客户代号', prop: 'clientCode', align: 'center' },
|
|
{ label: '客户代号', prop: 'clientCode', align: 'center' },
|
|
|
{ label: '刻码', prop: 'engrave', align: 'center' },
|
|
{ label: '刻码', prop: 'engrave', align: 'center' },
|
|
|
- // { label: '重量', prop: 'weight', align: 'center' },
|
|
|
|
|
- // { label: '重量单位', prop: 'weightUnit', align: 'center' },
|
|
|
|
|
|
|
+ { label: '重量', prop: 'weight', align: 'center' },
|
|
|
|
|
+ { label: '重量单位', prop: 'weightUnit', align: 'center' },
|
|
|
{ label: '仓库', prop: 'warehouseName', align: 'center' },
|
|
{ label: '仓库', prop: 'warehouseName', align: 'center' },
|
|
|
{ label: '货区', prop: 'areaName', align: 'center' },
|
|
{ label: '货区', prop: 'areaName', align: 'center' },
|
|
|
{ label: '货架', prop: 'goodsShelfName', align: 'center' },
|
|
{ label: '货架', prop: 'goodsShelfName', align: 'center' },
|
|
@@ -395,11 +395,19 @@ export default {
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
|
this.loading = true;
|
|
this.loading = true;
|
|
|
- save(this.form)
|
|
|
|
|
|
|
+ let URL =
|
|
|
|
|
+ this.type == 'add' ? save : this.type == 'edit' ? update : '';
|
|
|
|
|
+ let params = {
|
|
|
|
|
+ ...this.form,
|
|
|
|
|
+ sampleList: this.sampleList,
|
|
|
|
|
+ planTemplateList: this.schemeList,
|
|
|
|
|
+ qualityInventoryList: this.packingList
|
|
|
|
|
+ }
|
|
|
|
|
+ URL(params)
|
|
|
.then((msg) => {
|
|
.then((msg) => {
|
|
|
this.loading = false;
|
|
this.loading = false;
|
|
|
this.$message.success(msg);
|
|
this.$message.success(msg);
|
|
|
- this.handleClose();
|
|
|
|
|
|
|
+ this.cancel();
|
|
|
this.$emit('done');
|
|
this.$emit('done');
|
|
|
})
|
|
})
|
|
|
.catch((e) => {
|
|
.catch((e) => {
|
|
@@ -431,22 +439,14 @@ export default {
|
|
|
this.$router.go(-1);
|
|
this.$router.go(-1);
|
|
|
},
|
|
},
|
|
|
handleDetail(index, row, type) {
|
|
handleDetail(index, row, type) {
|
|
|
- if (row.isStatus == undefined) {
|
|
|
|
|
- row.isStatus = true;
|
|
|
|
|
- }else {
|
|
|
|
|
- row.isStatus = false;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ debugger
|
|
|
if (!this.sampleList[index] || !this.schemeList) {
|
|
if (!this.sampleList[index] || !this.schemeList) {
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- const selectedData = this.sampleList[index];
|
|
|
|
|
- const mergedData = [{
|
|
|
|
|
- ...selectedData,
|
|
|
|
|
- children: [...this.schemeList]
|
|
|
|
|
- }];
|
|
|
|
|
- console.log(index, row, type, mergedData, 'index, row, type, mergedData')
|
|
|
|
|
- this.$refs.detailRef.openDia(index, row, type, mergedData,null);
|
|
|
|
|
|
|
+ const selectedData = [];
|
|
|
|
|
+ selectedData.push(this.sampleList[index])
|
|
|
|
|
+ console.log(index, row, type, selectedData, 'index, row, type, mergedData')
|
|
|
|
|
+ this.$refs.detailRef.openDia(index, row, type, selectedData,null);
|
|
|
},
|
|
},
|
|
|
// 报工
|
|
// 报工
|
|
|
handleReporting(index, row) {
|
|
handleReporting(index, row) {
|
|
@@ -466,7 +466,7 @@ export default {
|
|
|
.then((msg) => {
|
|
.then((msg) => {
|
|
|
this.loading = false;
|
|
this.loading = false;
|
|
|
this.$message.success(msg);
|
|
this.$message.success(msg);
|
|
|
- this.handleClose();
|
|
|
|
|
|
|
+ this.cancel();
|
|
|
this.$emit('done');
|
|
this.$emit('done');
|
|
|
})
|
|
})
|
|
|
.catch((e) => {
|
|
.catch((e) => {
|
|
@@ -489,51 +489,28 @@ export default {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- // 处理数据
|
|
|
|
|
- const hasInvalidItem = list.some(item =>
|
|
|
|
|
- item.qualitySampleTemplateList.some(child => child.qualityResults === 2)
|
|
|
|
|
- );
|
|
|
|
|
- console.log('是否有不合格数据', hasInvalidItem)
|
|
|
|
|
-
|
|
|
|
|
- for (const item of list) {
|
|
|
|
|
- const filteredData = item.qualitySampleTemplateList.filter((item) =>
|
|
|
|
|
- item.qualityResults == 2
|
|
|
|
|
- );
|
|
|
|
|
- console.log(filteredData, '不合格数据')
|
|
|
|
|
- if (filteredData.length > -1) {
|
|
|
|
|
- this.form.noQualifiedNumber = filteredData.length;
|
|
|
|
|
- this.form.qualifiedNumber = this.form.total - filteredData.length;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
console.log(list, 'listlistlistlist')
|
|
console.log(list, 'listlistlistlist')
|
|
|
-
|
|
|
|
|
- const processedList = list.map(item => {
|
|
|
|
|
- item.qualityResults = hasInvalidItem ? 2 : 1;
|
|
|
|
|
- item.qualityStatus = 1;
|
|
|
|
|
- // item.qualitySampleTemplateList = item.children;
|
|
|
|
|
- item.isValid = !hasInvalidItem
|
|
|
|
|
- // delete item.children;
|
|
|
|
|
- return {
|
|
|
|
|
- ...item,
|
|
|
|
|
|
|
+ list.forEach((item) => {
|
|
|
|
|
+ if (item.qualitySampleTemplateList.some(child => child.qualityResults === 2)) {
|
|
|
|
|
+ item.isValid = false;
|
|
|
|
|
+ item.qualityResults = 2;
|
|
|
|
|
+ }else{
|
|
|
|
|
+ item.isValid = true;
|
|
|
|
|
+ item.qualityResults = 1;
|
|
|
}
|
|
}
|
|
|
- });
|
|
|
|
|
- this.$set(this.sampleList, index, processedList[0]);
|
|
|
|
|
-
|
|
|
|
|
- console.log(this.sampleList, processedList, '222表')
|
|
|
|
|
-
|
|
|
|
|
- // this.SampleListbyReportList = processedList;
|
|
|
|
|
|
|
+ item.qualityStatus = 1;
|
|
|
|
|
+ })
|
|
|
|
|
+ if (index != null){
|
|
|
|
|
+ this.$set(this.sampleList, index, list[0]);
|
|
|
|
|
+ }else{
|
|
|
|
|
+ this.$set(this.sampleList, null, list);
|
|
|
|
|
+ }
|
|
|
|
|
+ console.log(this.sampleList, '222表')
|
|
|
|
|
|
|
|
},
|
|
},
|
|
|
// 批量质检
|
|
// 批量质检
|
|
|
batchQuality(index, row,type){
|
|
batchQuality(index, row,type){
|
|
|
- if (!this.isStatus){
|
|
|
|
|
- this.isStatus = false;
|
|
|
|
|
- }
|
|
|
|
|
- this.sampleList.forEach((item) => {
|
|
|
|
|
- item.children=this.schemeList;
|
|
|
|
|
- });
|
|
|
|
|
- this.$refs.detailRef.openDia(null, null,type, this.sampleList, this.isStatus)
|
|
|
|
|
|
|
+ this.$refs.detailRef.openDia(null, null,type, this.sampleList, null)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|