|
@@ -79,20 +79,14 @@
|
|
|
:needPage="false"
|
|
:needPage="false"
|
|
|
>
|
|
>
|
|
|
<template v-slot:toolkit>
|
|
<template v-slot:toolkit>
|
|
|
- <el-select
|
|
|
|
|
- v-model="activeProductTaskName"
|
|
|
|
|
- placeholder="请选择"
|
|
|
|
|
- style="margin-right: 20px"
|
|
|
|
|
- >
|
|
|
|
|
- <el-option
|
|
|
|
|
- v-for="item in productTaskNameList"
|
|
|
|
|
- :key="item"
|
|
|
|
|
- :label="item"
|
|
|
|
|
- :value="item"
|
|
|
|
|
- >
|
|
|
|
|
- </el-option>
|
|
|
|
|
- </el-select>
|
|
|
|
|
|
|
+ <div>
|
|
|
|
|
+ <el-input
|
|
|
|
|
+ v-model="keyword"
|
|
|
|
|
+ placeholder="请输入物料名称或编码"
|
|
|
|
|
+ ></el-input>
|
|
|
|
|
+ </div>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
+
|
|
|
<template
|
|
<template
|
|
|
v-for="(item, index) in localDetails[1].statisticsValue[0]"
|
|
v-for="(item, index) in localDetails[1].statisticsValue[0]"
|
|
|
v-slot:[`column_${index}`]="{ row }"
|
|
v-slot:[`column_${index}`]="{ row }"
|
|
@@ -135,10 +129,26 @@
|
|
|
"
|
|
"
|
|
|
ref="table"
|
|
ref="table"
|
|
|
:columns="typeThreeColumns"
|
|
:columns="typeThreeColumns"
|
|
|
- :datasource="localDetails[2].statisticsValue"
|
|
|
|
|
|
|
+ :datasource="typeThreeDataSource"
|
|
|
cacheKey="mes-statistics-type-3-2511051037"
|
|
cacheKey="mes-statistics-type-3-2511051037"
|
|
|
:needPage="false"
|
|
:needPage="false"
|
|
|
>
|
|
>
|
|
|
|
|
+ <template v-slot:toolkit>
|
|
|
|
|
+ <el-select
|
|
|
|
|
+ v-model="activeProductTaskName"
|
|
|
|
|
+ placeholder="请选择"
|
|
|
|
|
+ style="margin-right: 20px"
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-option
|
|
|
|
|
+ v-for="item in productTaskNameList"
|
|
|
|
|
+ :key="item"
|
|
|
|
|
+ :label="item"
|
|
|
|
|
+ :value="item"
|
|
|
|
|
+ >
|
|
|
|
|
+ </el-option>
|
|
|
|
|
+ </el-select>
|
|
|
|
|
+ </template>
|
|
|
|
|
+
|
|
|
<template
|
|
<template
|
|
|
v-for="(item, index) in localDetails[2].statisticsValue[0]"
|
|
v-for="(item, index) in localDetails[2].statisticsValue[0]"
|
|
|
v-slot:[`column_${index}`]="{ row }"
|
|
v-slot:[`column_${index}`]="{ row }"
|
|
@@ -228,7 +238,6 @@
|
|
|
val[0].statisticsValue &&
|
|
val[0].statisticsValue &&
|
|
|
val[0].statisticsValue.length > 0
|
|
val[0].statisticsValue.length > 0
|
|
|
) {
|
|
) {
|
|
|
- console.log('直接赋值');
|
|
|
|
|
this.localDetails = JSON.parse(JSON.stringify(val));
|
|
this.localDetails = JSON.parse(JSON.stringify(val));
|
|
|
} else {
|
|
} else {
|
|
|
this.buildDetials(val);
|
|
this.buildDetials(val);
|
|
@@ -338,17 +347,28 @@
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
typeTwoDataSource() {
|
|
typeTwoDataSource() {
|
|
|
- if (this.activeProductTaskName === '全部') {
|
|
|
|
|
|
|
+ if (this.keyword.trim() === '') {
|
|
|
return this.localDetails[1].statisticsValue;
|
|
return this.localDetails[1].statisticsValue;
|
|
|
} else {
|
|
} else {
|
|
|
return this.localDetails[1].statisticsValue.filter((rows) => {
|
|
return this.localDetails[1].statisticsValue.filter((rows) => {
|
|
|
const nameItem = rows.find((i) => i.title === '物料名称');
|
|
const nameItem = rows.find((i) => i.title === '物料名称');
|
|
|
|
|
+ const codeItem = rows.find((i) => i.title === '物料编码');
|
|
|
return (
|
|
return (
|
|
|
- nameItem &&
|
|
|
|
|
- nameItem.produceTaskName === this.activeProductTaskName
|
|
|
|
|
|
|
+ (nameItem && nameItem.value.includes(this.keyword)) ||
|
|
|
|
|
+ (codeItem && codeItem.value.includes(this.keyword))
|
|
|
);
|
|
);
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
|
|
+ },
|
|
|
|
|
+ typeThreeDataSource() {
|
|
|
|
|
+ if (this.activeProductTaskName === '全部') {
|
|
|
|
|
+ return this.localDetails[2].statisticsValue;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ return this.localDetails[2].statisticsValue.filter((rows) => {
|
|
|
|
|
+ const nameItem = rows.find((i) => i.title === '工序名称');
|
|
|
|
|
+ return nameItem && nameItem.value === this.activeProductTaskName;
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
data() {
|
|
data() {
|
|
@@ -370,7 +390,8 @@
|
|
|
statisticsValue: []
|
|
statisticsValue: []
|
|
|
}
|
|
}
|
|
|
],
|
|
],
|
|
|
- activeProductTaskName: '全部'
|
|
|
|
|
|
|
+ activeProductTaskName: '全部',
|
|
|
|
|
+ keyword: ''
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
|
|
|
|
@@ -383,9 +404,27 @@
|
|
|
// 构建统计数据
|
|
// 构建统计数据
|
|
|
async buildDetials(detials) {
|
|
async buildDetials(detials) {
|
|
|
if (detials.length === 0) {
|
|
if (detials.length === 0) {
|
|
|
|
|
+ console.log('重置了');
|
|
|
|
|
+ this.localDetails = [
|
|
|
|
|
+ {
|
|
|
|
|
+ ruleId: this.ruleId,
|
|
|
|
|
+ statisticsType: 1,
|
|
|
|
|
+ statisticsValue: []
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ ruleId: this.ruleId,
|
|
|
|
|
+ statisticsType: 2,
|
|
|
|
|
+ statisticsValue: []
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ ruleId: this.ruleId,
|
|
|
|
|
+ statisticsType: 3,
|
|
|
|
|
+ statisticsValue: []
|
|
|
|
|
+ }
|
|
|
|
|
+ ];
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
- console.log('this.localDetails', this.localDetails);
|
|
|
|
|
|
|
+ console.log('this.localDetails -- 开始构建', this.localDetails);
|
|
|
|
|
|
|
|
if (
|
|
if (
|
|
|
(this.localDetails[0].statisticsValue &&
|
|
(this.localDetails[0].statisticsValue &&
|