diff --git a/src/views/statistics/hunliao.vue b/src/views/statistics/hunliao.vue
index 5714cad8..07c7a730 100644
--- a/src/views/statistics/hunliao.vue
+++ b/src/views/statistics/hunliao.vue
@@ -28,15 +28,34 @@
导出
-
+
-
+
-
+
-
+
-
+
@@ -105,6 +124,11 @@ export default {
tableData10: [],
firstWeekNum: 1,
endWeekNum: 4,
+ nameFilters: [],
+ dateFilters:[],
+ specsFilters:[],
+ modelFilters:[],
+ monthFilters:[1,2,3,4,5,,6,7,8,9,10,11,12],
monthList: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月']
}
},
@@ -164,6 +188,11 @@ export default {
},
getDataHL() {
let that = this;
+ let dateList = [],specsList=[],modelList=[];
+ that.dateFilters = [];
+ that.nameFilters = [];
+ that.modelFilters = [];
+ that.specsFilters = [];
let obj = {
query: { start_date: that.start_date, end_date: that.end_date, mgroup_name: "混料", is_count_utask: -1 },
};
@@ -181,14 +210,40 @@ export default {
if (nameList.indexOf(ite.物料名) > -1) { } else {
nameList.push(ite.物料名);
seriesData.push([0,0,0,0,0,0,0,0,0,0,0,0])
+ let obj = {};
+ obj.text = ite.物料名;
+ obj.value = ite.物料名;
+ that.nameFilters.push(obj);
+ }
+ if(modelList.indexOf(ite.型号)>-1){}else{
+ modelList.push(ite.型号);
+ let obj2 = {};
+ obj2.text = ite.型号;
+ obj2.value = ite.型号;
+ that.modelFilters.push(obj2);
+ }
+ if(specsList.indexOf(ite.规格)>-1){}else{
+ specsList.push(ite.规格);
+ let obj3 = {};
+ obj3.text = ite.规格;
+ obj3.value = ite.规格;
+ that.specsFilters.push(obj3);
}
})
dataList.forEach(item => {
let indexX = 0, indexY = 0;
if (that.queryType == '月') {
indexX = nameList.indexOf(item.物料名);
- indexY = item.周 - that.firstWeekNum;
+ indexY = item.周 - that.firstWeekNum;
+ if(dateList.indexOf(item.周)>-1){}else{
+ dateList.push(item.周);
+ let obj = {};
+ obj.text = item.周;
+ obj.value = item.周;
+ that.dateFilters.push(obj);
+ }
} else {
+ that.dateFilters = [1,2,3,4,5,6,7,8,9,10,11,12];
indexX = nameList.indexOf(item.物料名);
indexY = item.月 - 1;
}
@@ -209,54 +264,6 @@ export default {
}
});
},
- getDataHLXH() {
- let that = this;
- let option = deepCopy(that.basicOption);
- option.xAxis.data = that.xAxisData;
- option.title.text = '混料消耗统计';
- let obj = {
- query: { start_date: that.start_date, end_date: that.end_date, mio_type: "do_in", material_type: 30, material_id: "" },
- };
- let exec = that.queryType == '月' ? 'saleOutWeek' : 'saleOutMonth';
- that.$API.bi.dataset.exec.req(exec, obj).then((res) => {
- // console.log('10生产车间统计:',res);
- let tableData10 = res.data2.ds0 ? res.data2.ds0 : [];
- that.tableData10 = tableData10;
- if (tableData10.length > 0) {
- option.series = [];
- let seriesData = [], nameList = [];
- tableData10.forEach(ite => {
- if (nameList.indexOf(ite.物料名) > -1) { } else {
- nameList.push(ite.物料名);
- seriesData.push([])
- }
- })
- tableData10.forEach(item => {
- let indexX = 0, indexY = 0;
- if (that.queryType == '月') {
- indexX = nameList.indexOf(item.物料名);
- indexY = item.周 - that.firstWeekNum;
- } else {
- indexX = nameList.indexOf(item.物料名);
- indexY = item.月 - 1;
- }
- seriesData[indexX][indexY] = item.合格数;
- });
- for (let n = 0; n < seriesData.length; n++) {
- let obj = {};
- obj.name = nameList[n];
- obj.stack = 'Ad';
- obj.type = 'bar';
- obj.barWidth = '15px';
- obj.data = seriesData[n];
- option.series.push(obj)
- }
- that.setChart("bachart2", option);
- } else {
- that.setChart("bachart2", option);
- }
- });
- },
handleQuery() {
let that = this;
if (that.queryType == '月') {
@@ -321,6 +328,21 @@ export default {
});
return sums;
},
+ filterName(value, row) {
+ return row.物料名 === value;
+ },
+ filterMonth(value, row) {
+ return row.月 === value;
+ },
+ filterWeek(value, row) {
+ return row.周 === value;
+ },
+ filterSpecs(value, row) {
+ return row.规格 === value;
+ },
+ filterModel(value, row) {
+ return row.型号 === value;
+ },
handleExport(val) {
this.exportLoading = true;
let id = '#exportDiv' + val;
diff --git a/src/views/statistics/inm_statistics.vue b/src/views/statistics/inm_statistics.vue
index 9ba3c151..ae22510c 100644
--- a/src/views/statistics/inm_statistics.vue
+++ b/src/views/statistics/inm_statistics.vue
@@ -99,13 +99,28 @@
>
-
-
-
+
+
+
-
+
-
+
@@ -140,13 +155,28 @@
>
-
-
-
+
+
+
-
+
-
+
@@ -215,6 +245,14 @@ export default {
rightHeight: 0,
tableData1: [],
tableData2: [],
+ nameFilters: [],
+ dateFilters: [],
+ modelFilters: [],
+ specsFilters: [],
+ nameFilters2: [],
+ dateFilters2: [],
+ modelFilters2: [],
+ specsFilters2: [],
firstWeekNum: 1,
endWeekNum: 4,
monthList: ["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],
@@ -295,6 +333,12 @@ export default {
//交付物料
getSaleData() {
let that = this;
+ that.tableData1 = [];
+ that.nameFilters = [];
+ that.dateFilters = [];
+ that.modelFilters = [];
+ that.specsFilters = [];
+ let nameList=[],dateList = [],specsList=[],modelList=[];
let exec = that.queryType == "月" ? "saleOutWeek" : "saleOutMonth";
let obj = {
query: {
@@ -306,8 +350,44 @@ export default {
};
that.$API.bi.dataset.exec.req(exec, obj).then((res) => {
if (res.data2.ds0&&res.data2.ds0.length>0) {
- that.tableData1 = res.data2.ds0;
- that.setChartData(res.data2.ds0);
+ let data = res.data2.ds0;
+ that.tableData1 = data;
+ data.forEach((ite) => {
+ if (nameList.indexOf(ite.物料名) > -1) {
+ } else {
+ nameList.push(ite.物料名);
+ let obj = {};
+ obj.text = ite.物料名;
+ obj.value = ite.物料名;
+ that.nameFilters.push(obj);
+ }
+ if(modelList.indexOf(ite.型号)>-1){}else{
+ modelList.push(ite.型号);
+ let obj2 = {};
+ obj2.text = ite.型号;
+ obj2.value = ite.型号;
+ that.modelFilters.push(obj2);
+ }
+ if(specsList.indexOf(ite.规格)>-1){}else{
+ specsList.push(ite.规格);
+ let obj3 = {};
+ obj3.text = ite.规格;
+ obj3.value = ite.规格;
+ that.specsFilters.push(obj3);
+ }
+ if(that.queryType == "月"){
+ if(dateList.indexOf(ite.周)>-1){}else{
+ dateList.push(ite.周);
+ let obj4 = {};
+ obj4.text = ite.周;
+ obj4.value = ite.周;
+ that.dateFilters.push(obj4);
+ }
+ }else{
+ that.dateFilters = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];
+ }
+ })
+ that.setChartData(data);
}else{
let option = deepCopy(that.basicOption);
option.xAxis.data = that.xAxisData;
@@ -317,6 +397,15 @@ export default {
},
getTable() {
let that = this;
+ that.nameFilters = [];
+ that.dateFilters = [];
+ that.modelFilters = [];
+ that.specsFilters = [];
+ that.nameFilters2 = [];
+ that.dateFilters2 = [];
+ that.modelFilters2 = [];
+ that.specsFilters2 = [];
+ let nameList=[],dateList = [],specsList=[],modelList=[];
let obj = {
query: {
start_date: that.start_date,
@@ -331,6 +420,47 @@ export default {
let data = res.data2.ds0;
that.tableData1 = data;
that.tableData2 = data;
+ if(data.length>0){
+ data.forEach((ite) => {
+ if (nameList.indexOf(ite.物料名) > -1) {
+ } else {
+ nameList.push(ite.物料名);
+ let obj = {};
+ obj.text = ite.物料名;
+ obj.value = ite.物料名;
+ that.nameFilters.push(obj);
+ }
+ if(modelList.indexOf(ite.型号)>-1){}else{
+ modelList.push(ite.型号);
+ let obj2 = {};
+ obj2.text = ite.型号;
+ obj2.value = ite.型号;
+ that.modelFilters.push(obj2);
+ }
+ if(specsList.indexOf(ite.规格)>-1){}else{
+ specsList.push(ite.规格);
+ let obj3 = {};
+ obj3.text = ite.规格;
+ obj3.value = ite.规格;
+ that.specsFilters.push(obj3);
+ }
+ if(that.queryType == "月"){
+ if(dateList.indexOf(ite.周)>-1){}else{
+ dateList.push(ite.周);
+ let obj4 = {};
+ obj4.text = ite.周;
+ obj4.value = ite.周;
+ that.dateFilters.push(obj4);
+ }
+ }else{
+ that.dateFilters = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];
+ }
+ that.nameFilters2 = that.nameFilters;
+ that.modelFilters2 = that.modelFilters;
+ that.specsFilters2 = that.specsFilters;
+ that.dateFilters2 = that.dateFilters;
+ })
+ }
that.setChartData(data);
}
});
@@ -435,6 +565,38 @@ export default {
option.series = seriesData;
that.setChart("bachart1", option);
},
+ filterName(value, row) {
+ return row.物料名 === value;
+ },
+ filterDate(value, row) {
+ if (this.queryType == "月") {
+ return row.周 === value;
+ }else{
+ return row.月 === value;
+ }
+ },
+ filterSpecs(value, row) {
+ return row.规格 === value;
+ },
+ filterModel(value, row) {
+ return row.型号 === value;
+ },
+ filterName2(value, row) {
+ return row.物料名 === value;
+ },
+ filterDate2(value, row) {
+ if (this.queryType == "月") {
+ return row.周 === value;
+ }else{
+ return row.月 === value;
+ }
+ },
+ filterSpecs2(value, row) {
+ return row.规格 === value;
+ },
+ filterModel2(value, row) {
+ return row.型号 === value;
+ },
handleExport(val) {
this.exportLoading = true;
let id = "#exportDiv" + val;
diff --git a/src/views/statistics/material_statistics.vue b/src/views/statistics/material_statistics.vue
index aeccecf4..45b56840 100644
--- a/src/views/statistics/material_statistics.vue
+++ b/src/views/statistics/material_statistics.vue
@@ -50,7 +50,6 @@
@change="materialInChange"
>
-
@@ -78,13 +77,28 @@
>
-
-
-
+
+
+
-
+
-
+
@@ -108,7 +122,6 @@
type="primary"
>导出
-
-
-
-
+
+
+
-
+
-
+
@@ -203,6 +231,14 @@ export default {
outData: [],
inmOption: [],
outOption: [],
+ nameFilters: [],
+ dateFilters: [],
+ modelFilters: [],
+ specsFilters: [],
+ nameFilters2: [],
+ dateFilters2: [],
+ modelFilters2: [],
+ specsFilters2: [],
monthList: ["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],
materialItem:{},
apiObjMaterial:this.$API.mtm.material.list,
@@ -233,7 +269,6 @@ export default {
that.rightHeight = height - 115;
that.tableHeight = height - 140 - chartheight;
that.setChart("bachart1", that.basicOption);
- // that.getInmOption();
that.getTable();
},
methods: {
@@ -266,12 +301,9 @@ export default {
},
materialInChange(data) {
let that = this;
- console.log(that.materialItem);
- console.log(that.materialItem.id);
that.materialIn = that.materialItem.id;
let option = deepCopy(that.basicOption);
option.xAxis.data = that.xAxisData;
- console.log(option);
that.setChart("bachart1",option);
this.getInmData();
},
@@ -289,6 +321,11 @@ export default {
getInmData() {
let that = this;
that.tableData1 = [];
+ that.nameFilters = [];
+ that.dateFilters = [];
+ that.modelFilters = [];
+ that.specsFilters = [];
+ let nameList=[],dateList = [],specsList=[],modelList=[];
let exec = that.queryType == "月" ? "saleOutWeek" : "saleOutMonth";
let obj = {
query: {
@@ -300,8 +337,44 @@ export default {
};
that.$API.bi.dataset.exec.req(exec, obj).then((res) => {
if (res.data2.ds0&&res.data2.ds0.length>0) {
- that.tableData1 = res.data2.ds0;
- that.setChartData(res.data2.ds0);
+ let data = res.data2.ds0;
+ that.tableData1 = data;
+ data.forEach((ite) => {
+ if (nameList.indexOf(ite.物料名) > -1) {
+ } else {
+ nameList.push(ite.物料名);
+ let obj = {};
+ obj.text = ite.物料名;
+ obj.value = ite.物料名;
+ that.nameFilters.push(obj);
+ }
+ if(modelList.indexOf(ite.型号)>-1){}else{
+ modelList.push(ite.型号);
+ let obj2 = {};
+ obj2.text = ite.型号;
+ obj2.value = ite.型号;
+ that.modelFilters.push(obj2);
+ }
+ if(specsList.indexOf(ite.规格)>-1){}else{
+ specsList.push(ite.规格);
+ let obj3 = {};
+ obj3.text = ite.规格;
+ obj3.value = ite.规格;
+ that.specsFilters.push(obj3);
+ }
+ if(that.queryType == "月"){
+ if(dateList.indexOf(ite.周)>-1){}else{
+ dateList.push(ite.周);
+ let obj4 = {};
+ obj4.text = ite.周;
+ obj4.value = ite.周;
+ that.dateFilters.push(obj4);
+ }
+ }else{
+ that.dateFilters = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];
+ }
+ })
+ that.setChartData(data);
}else{
let option = deepCopy(that.basicOption);
option.xAxis.data = that.xAxisData;
@@ -318,13 +391,64 @@ export default {
mio_type: "pur_in",
},
};
+ that.nameFilters = [];
+ that.dateFilters = [];
+ that.modelFilters = [];
+ that.specsFilters = [];
+ that.nameFilters2 = [];
+ that.dateFilters2 = [];
+ that.modelFilters2 = [];
+ that.specsFilters2 = [];
+ let nameList=[],dateList = [],specsList=[],modelList=[];
let exec = that.queryType == "月" ? "saleOutWeek" : "saleOutMonth";
that.$API.bi.dataset.exec.req(exec, obj).then((res) => {
that.tableData2 = [];
+ that.tableData1 = [];
if (res.data2.ds0) {
let data = res.data2.ds0;
that.tableData1 = data;
that.tableData2 = data;
+ if(data.length>0){
+ data.forEach((ite) => {
+ if (nameList.indexOf(ite.物料名) > -1) {
+ } else {
+ nameList.push(ite.物料名);
+ let obj = {};
+ obj.text = ite.物料名;
+ obj.value = ite.物料名;
+ that.nameFilters.push(obj);
+ }
+ if(modelList.indexOf(ite.型号)>-1){}else{
+ modelList.push(ite.型号);
+ let obj2 = {};
+ obj2.text = ite.型号;
+ obj2.value = ite.型号;
+ that.modelFilters.push(obj2);
+ }
+ if(specsList.indexOf(ite.规格)>-1){}else{
+ specsList.push(ite.规格);
+ let obj3 = {};
+ obj3.text = ite.规格;
+ obj3.value = ite.规格;
+ that.specsFilters.push(obj3);
+ }
+ if(that.queryType == "月"){
+ if(dateList.indexOf(ite.周)>-1){}else{
+ dateList.push(ite.周);
+ let obj4 = {};
+ obj4.text = ite.周;
+ obj4.value = ite.周;
+ that.dateFilters.push(obj4);
+ }
+ }else{
+ that.dateFilters = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];
+ }
+ that.nameFilters2 = that.nameFilters;
+ that.modelFilters2 = that.modelFilters;
+ that.specsFilters2 = that.specsFilters;
+ that.dateFilters2 = that.dateFilters;
+ })
+ }
that.setChartData(data);
}
});
@@ -429,6 +553,38 @@ export default {
});
return sums;
},
+ filterName(value, row) {
+ return row.物料名 === value;
+ },
+ filterDate(value, row) {
+ if (this.queryType == "月") {
+ return row.周 === value;
+ }else{
+ return row.月 === value;
+ }
+ },
+ filterSpecs(value, row) {
+ return row.规格 === value;
+ },
+ filterModel(value, row) {
+ return row.型号 === value;
+ },
+ filterName2(value, row) {
+ return row.物料名 === value;
+ },
+ filterDate2(value, row) {
+ if (this.queryType == "月") {
+ return row.周 === value;
+ }else{
+ return row.月 === value;
+ }
+ },
+ filterSpecs2(value, row) {
+ return row.规格 === value;
+ },
+ filterModel2(value, row) {
+ return row.型号 === value;
+ },
handleExport(val) {
this.exportLoading = true;
let id = "#exportDiv" + val;
diff --git a/src/views/statistics/pass_num.vue b/src/views/statistics/pass_num.vue
index b1e1202c..34c89c79 100644
--- a/src/views/statistics/pass_num.vue
+++ b/src/views/statistics/pass_num.vue
@@ -60,15 +60,30 @@
show-summary
>
-
+
-
+
-
+
-
+
-
+
@@ -111,15 +126,30 @@
show-summary
>
-
+
-
+
-
+
-
+
-
+
@@ -162,17 +192,35 @@
show-summary
>
-
+
-
+
-
+
-
+
-
+
-
+
@@ -250,7 +298,19 @@ export default {
tableData6: [],
tableData7: [],
tableData10: [],
- tableDataAVG: [],
+ nameFilters: [],
+ dateFilters: [],
+ modelFilters: [],
+ specsFilters: [],
+ nameFilters6: [],
+ xilieFilters6: [],
+ dateFilters6: [],
+ modelFilters6: [],
+ specsFilters6: [],
+ nameFilters7: [],
+ dateFilters7: [],
+ modelFilters7: [],
+ specsFilters7: [],
firstWeekNum: 1,
endWeekNum: 4,
monthList: [
@@ -324,6 +384,12 @@ export default {
},
getData6() {
let that = this;
+ let dateList = [],specsList=[],modelList=[],xilieList=[];
+ that.nameFilters6 = [];
+ that.dateFilters6 = [];
+ that.xilieFilters6 = [];
+ that.modelFilters6 = [];
+ that.specsFilters6 = [];
let option = deepCopy(that.basicOption);
option.xAxis.data = that.xAxisData;
option.title.text = "6车间";
@@ -340,14 +406,38 @@ export default {
that.tableData6 = tableData6;
if (tableData6.length > 0) {
option.series = [];
- let seriesData = [],
- nameList = [];
+ let seriesData = [],nameList = [];
tableData6.forEach((ite) => {
if (nameList.indexOf(ite.物料名) > -1) {
- } else {
+ }else {
nameList.push(ite.物料名);
seriesData.push([]);
+ let obj = {};
+ obj.text = ite.物料名;
+ obj.value = ite.物料名;
+ that.nameFilters6.push(obj);
}
+ if(xilieList.indexOf(ite.物料系列)>-1){}else{
+ xilieList.push(ite.物料系列);
+ let obj2 = {};
+ obj2.text = ite.物料系列;
+ obj2.value = ite.物料系列;
+ that.xilieFilters6.push(obj2);
+ }
+ if(specsList.indexOf(ite.规格)>-1){}else{
+ specsList.push(ite.规格);
+ let obj3 = {};
+ obj3.text = ite.规格;
+ obj3.value = ite.规格;
+ that.specsFilters6.push(obj3);
+ }
+ if(modelList.indexOf(ite.型号)>-1){}else{
+ modelList.push(ite.型号);
+ let obj4 = {};
+ obj4.text = ite.型号;
+ obj4.value = ite.型号;
+ that.modelFilters6.push(obj4);
+ }
});
if (that.queryType == "月") {
tableData6.forEach((item) => {
@@ -359,8 +449,16 @@ export default {
seriesData[indexX][indexY] =0;
seriesData[indexX][indexY] += item.合格数;
}
+ if(dateList.indexOf(item.周)>-1){}else{
+ dateList.push(item.周);
+ let obj = {};
+ obj.text = item.周;
+ obj.value = item.周;
+ that.dateFilters6.push(obj);
+ }
});
} else {
+ that.dateFilters6 = [1,2,3,4,5,6,7,8,9,10,11,12];
tableData6.forEach((item) => {
let indexX = nameList.indexOf(item.物料名);
let indexY = item.month - 1;
@@ -389,6 +487,11 @@ export default {
},
getData7() {
let that = this;
+ let dateList = [],specsList=[],modelList=[];
+ that.nameFilters7 = [];
+ that.dateFilters7 = [];
+ that.modelFilters7 = [];
+ that.specsFilters7 = [];
let obj = {
query: {
start_date: that.start_date,
@@ -404,9 +507,7 @@ export default {
console.log("7生产车间统计:", res);
let tableData7 = res.data2.ds0 ? res.data2.ds0 : [];
that.tableData7 = tableData7;
- debugger;
if (tableData7.length > 0) {
- debugger;
option.series = [];
let seriesData = [],
nameList = [];
@@ -415,7 +516,25 @@ export default {
} else {
nameList.push(ite.物料名);
seriesData.push([]);
+ let obj = {};
+ obj.text = ite.物料名;
+ obj.value = ite.物料名;
+ that.nameFilters7.push(obj);
}
+ if(modelList.indexOf(ite.型号)>-1){}else{
+ modelList.push(ite.型号);
+ let obj2 = {};
+ obj2.text = ite.型号;
+ obj2.value = ite.型号;
+ that.modelFilters7.push(obj2);
+ }
+ if(specsList.indexOf(ite.规格)>-1){}else{
+ specsList.push(ite.规格);
+ let obj3 = {};
+ obj3.text = ite.规格;
+ obj3.value = ite.规格;
+ that.specsFilters7.push(obj3);
+ }
});
tableData7.forEach((item) => {
let indexX = 0,
@@ -423,7 +542,15 @@ export default {
if (that.queryType == "月") {
indexX = nameList.indexOf(item.物料名);
indexY = item.周 - that.firstWeekNum;
+ if(dateList.indexOf(item.周)>-1){}else{
+ dateList.push(item.周);
+ let obj = {};
+ obj.text = item.周;
+ obj.value = item.周;
+ that.dateFilters7.push(obj);
+ }
} else {
+ that.dateFilters7 = [1,2,3,4,5,6,7,8,9,10,11,12];
indexX = nameList.indexOf(item.物料名);
indexY = item.月 - 1;
}
@@ -451,6 +578,11 @@ export default {
},
getData10() {
let that = this;
+ let dateList = [],specsList=[],modelList=[];
+ that.nameFilters = [];
+ that.dateFilters = [];
+ that.modelFilters = [];
+ that.specsFilters = [];
let option = deepCopy(that.basicOption);
option.xAxis.data = that.xAxisData;
option.title.text = "预制管(10车间)";
@@ -463,7 +595,6 @@ export default {
};
let exec = that.queryType == "月" ? "lineWeek" : "lineMonth";
that.$API.bi.dataset.exec.req(exec, obj).then((res) => {
- // console.log('10生产车间统计:',res);
let tableData10 = res.data2.ds0 ? res.data2.ds0 : [];
that.tableData10 = tableData10;
if (tableData10.length > 0) {
@@ -475,7 +606,25 @@ export default {
} else {
nameList.push(ite.物料名);
seriesData.push([]);
+ let obj = {};
+ obj.text = ite.物料名;
+ obj.value = ite.物料名;
+ that.nameFilters.push(obj);
}
+ if(modelList.indexOf(ite.型号)>-1){}else{
+ modelList.push(ite.型号);
+ let obj2 = {};
+ obj2.text = ite.型号;
+ obj2.value = ite.型号;
+ that.modelFilters.push(obj2);
+ }
+ if(specsList.indexOf(ite.规格)>-1){}else{
+ specsList.push(ite.规格);
+ let obj3 = {};
+ obj3.text = ite.规格;
+ obj3.value = ite.规格;
+ that.specsFilters.push(obj3);
+ }
});
tableData10.forEach((item) => {
let indexX = 0,
@@ -483,7 +632,15 @@ export default {
if (that.queryType == "月") {
indexX = nameList.indexOf(item.物料名);
indexY = item.周 - that.firstWeekNum;
+ if(dateList.indexOf(item.周)>-1){}else{
+ dateList.push(item.周);
+ let obj = {};
+ obj.text = item.周;
+ obj.value = item.周;
+ that.dateFilters.push(obj);
+ }
} else {
+ that.dateFilters = [1,2,3,4,5,6,7,8,9,10,11,12];
indexX = nameList.indexOf(item.物料名);
indexY = item.月 - 1;
}
@@ -604,6 +761,60 @@ export default {
that.getData10();
// that.getDataDAVG();
},
+ //6
+ filterName6(value, row) {
+ return row.物料名 === value;
+ },
+ filterXilie6(value, row) {
+ return row.物料系列 === value;
+ },
+ filterDate6(value, row) {
+ if (this.queryType == "月") {
+ return row.周 === value;
+ }else{
+ return row.月 === value;
+ }
+ },
+ filterSpecs6(value, row) {
+ return row.规格 === value;
+ },
+ filterModel6(value, row) {
+ return row.型号 === value;
+ },
+ //7
+ filterName7(value, row) {
+ return row.物料名 === value;
+ },
+ filterDate7(value, row) {
+ if (this.queryType == "月") {
+ return row.周 === value;
+ }else{
+ return row.月 === value;
+ }
+ },
+ filterSpecs7(value, row) {
+ return row.规格 === value;
+ },
+ filterModel7(value, row) {
+ return row.型号 === value;
+ },
+ //10
+ filterName(value, row) {
+ return row.物料名 === value;
+ },
+ filterDate(value, row) {
+ if (this.queryType == "月") {
+ return row.周 === value;
+ }else{
+ return row.月 === value;
+ }
+ },
+ filterSpecs(value, row) {
+ return row.规格 === value;
+ },
+ filterModel(value, row) {
+ return row.型号 === value;
+ },
handleExport(val) {
this.exportLoading = true;
let id = "#exportDiv" + val;
diff --git a/src/views/statistics/ppass_num.vue b/src/views/statistics/ppass_num.vue
index ca71a6cc..6771b5ed 100644
--- a/src/views/statistics/ppass_num.vue
+++ b/src/views/statistics/ppass_num.vue
@@ -59,9 +59,15 @@
show-summary
>
-
+
-
+
@@ -127,6 +133,8 @@ export default {
},
series: [],
},
+ nameFilters: [],
+ mgroupFilters: [],
processData: [],
xAxisData: [],
tableData: [],
@@ -156,6 +164,8 @@ export default {
},
getData6() {
let that = this;
+ that.nameFilters = [];
+ that.mgroupFilters = [];
let obj = {
query: {
start_date: this.start_date,
@@ -186,9 +196,17 @@ export default {
if (xAxisData.indexOf(item.工段) > -1) {
} else {
xAxisData.push(item.工段);
+ let obj = {};
+ obj.text = item.工段;
+ obj.value = item.工段;
+ that.mgroupFilters.push(obj);
}
if (nameData.indexOf(item.物料名) > -1) {
} else {
+ let obj0 = {};
+ obj0.text = item.物料名;
+ obj0.value = item.物料名;
+ that.nameFilters.push(obj0);
nameData.push(item.物料名);
let obj = {
name:'',
@@ -205,8 +223,6 @@ export default {
obj.name=item.物料名,
seriesData.push(obj);
}
- console.log("xAxisData:", xAxisData);
- console.log("nameData:", nameData);
let index = xAxisData.indexOf(item.工段);
let indexY = nameData.indexOf(item.物料名);
seriesData[indexY].data[index] += item.合格数;
@@ -275,6 +291,12 @@ export default {
});
return sums;
},
+ filterName(value, row) {
+ return row.物料名 === value;
+ },
+ filterMgroup(value, row) {
+ return row.工段 === value;
+ },
handleExport() {
this.exportLoading = true;
this.$XLSX("#exportDiv", "工序合格数");
diff --git a/src/views/statistics/product_check.vue b/src/views/statistics/product_check.vue
index 03e8ebbb..e233ab6e 100644
--- a/src/views/statistics/product_check.vue
+++ b/src/views/statistics/product_check.vue
@@ -58,11 +58,20 @@
-
+
-
+
-
+
@@ -114,11 +123,20 @@
-
+
-
+
-
+
@@ -174,11 +192,20 @@
-
+
-
+
-
+
@@ -338,6 +365,15 @@ export default {
tableData7: [],
tableData10: [],
tableData8: [],
+ nameFilters: [],
+ specsFilters:[],
+ modelFilters:[],
+ nameFilters7: [],
+ specsFilters7:[],
+ modelFilters7:[],
+ nameFilters10: [],
+ specsFilters10:[],
+ modelFilters10:[],
};
},
mounted() {
@@ -351,7 +387,7 @@ export default {
this.queryDate = year + "-" + month;
this.start_date = year + "-" + month + "-01";
this.end_date =
- year + "-" + month + "-" + new Date(year, month, 0).getDate();
+ year + "-" + month + "-" + days;
this.getData();
this.getData7();
this.getData10();
@@ -364,6 +400,10 @@ export default {
getData() {
let that = this;
that.tableData8 = [];
+ that.nameFilters = [];
+ that.modelFilters = [];
+ that.specsFilters = [];
+ let nameList=[],specsList=[],modelList=[];
let exec = that.queryType == "月" ? "lineMonth" : "lineYear";
let obj = {
query: {
@@ -374,10 +414,32 @@ export default {
},
};
that.$API.bi.dataset.exec.req(exec, obj).then((res) => {
- console.log("退火车间统计:", res);
if (res.data2.ds0) {
let data = res.data2.ds0;
that.tableData8 = data;
+ data.forEach((item) => {
+ if(nameList.indexOf(item.物料名)>-1){}else{
+ nameList.push(item.物料名);
+ let obj = {};
+ obj.text = item.物料名;
+ obj.value = item.物料名;
+ that.nameFilters.push(obj);
+ }
+ if(modelList.indexOf(item.型号)>-1){}else{
+ modelList.push(item.型号);
+ let obj2 = {};
+ obj2.text = item.型号;
+ obj2.value = item.型号;
+ that.modelFilters.push(obj2);
+ }
+ if(specsList.indexOf(item.规格)>-1){}else{
+ specsList.push(item.规格);
+ let obj3 = {};
+ obj3.text = item.规格;
+ obj3.value = item.规格;
+ that.specsFilters.push(obj3);
+ }
+ })
} else {
that.tableData8 = [];
}
@@ -426,6 +488,10 @@ export default {
getData7() {
let that = this;
that.tableData7 = [];
+ that.nameFilters7 = [];
+ that.modelFilters7 = [];
+ that.specsFilters7 = [];
+ let nameList=[],specsList=[],modelList=[];
let obj = {
query: {
start_date: this.start_date,
@@ -435,10 +501,32 @@ export default {
};
let exec = that.queryType == "月" ? "lineMonth" : "lineYear";
that.$API.bi.dataset.exec.req(exec, obj).then((res) => {
- console.log("7生产车间统计:", res);
if (res.data2.ds0) {
let data = res.data2.ds0;
that.tableData7 = data;
+ data.forEach((item) => {
+ if(nameList.indexOf(item.物料名)>-1){}else{
+ nameList.push(item.物料名);
+ let obj = {};
+ obj.text = item.物料名;
+ obj.value = item.物料名;
+ that.nameFilters7.push(obj);
+ }
+ if(modelList.indexOf(item.型号)>-1){}else{
+ modelList.push(item.型号);
+ let obj2 = {};
+ obj2.text = item.型号;
+ obj2.value = item.型号;
+ that.modelFilters7.push(obj2);
+ }
+ if(specsList.indexOf(item.规格)>-1){}else{
+ specsList.push(item.规格);
+ let obj3 = {};
+ obj3.text = item.规格;
+ obj3.value = item.规格;
+ that.specsFilters7.push(obj3);
+ }
+ })
} else {
that.tableData7 = [];
}
@@ -480,6 +568,10 @@ export default {
getData10() {
let that = this;
that.tableData10 = [];
+ that.nameFilters10 = [];
+ that.modelFilters10 = [];
+ that.specsFilters10 = [];
+ let nameList=[],specsList=[],modelList=[];
let obj = {
query: {
start_date: this.start_date,
@@ -489,10 +581,32 @@ export default {
};
let exec = that.queryType == "月" ? "lineMonth" : "lineYear";
that.$API.bi.dataset.exec.req(exec, obj).then((res) => {
- console.log("10生产车间统计:", res);
if (res.data2.ds0) {
let data = res.data2.ds0;
that.tableData10 = data;
+ data.forEach((item) => {
+ if(nameList.indexOf(item.物料名)>-1){}else{
+ nameList.push(item.物料名);
+ let obj = {};
+ obj.text = item.物料名;
+ obj.value = item.物料名;
+ that.nameFilters10.push(obj);
+ }
+ if(modelList.indexOf(item.型号)>-1){}else{
+ modelList.push(item.型号);
+ let obj2 = {};
+ obj2.text = item.型号;
+ obj2.value = item.型号;
+ that.modelFilters10.push(obj2);
+ }
+ if(specsList.indexOf(item.规格)>-1){}else{
+ specsList.push(item.规格);
+ let obj3 = {};
+ obj3.text = item.规格;
+ obj3.value = item.规格;
+ that.specsFilters10.push(obj3);
+ }
+ })
} else {
that.tableData10 = [];
}
@@ -509,7 +623,6 @@ export default {
},
};
that.$API.bi.dataset.exec.req(exec, obj2).then((res2) => {
- console.log("10生产车间统计:", res2);
if (res2.data2.ds0) {
let data = res2.data2.ds0;
that.option2.series.data[0].value=0;
@@ -598,6 +711,33 @@ export default {
});
return sums;
},
+ filterName(value, row) {
+ return row.物料名 === value;
+ },
+ filterSpecs(value, row) {
+ return row.规格 === value;
+ },
+ filterModel(value, row) {
+ return row.型号 === value;
+ },
+ filterName7(value, row) {
+ return row.物料名 === value;
+ },
+ filterSpecs7(value, row) {
+ return row.规格 === value;
+ },
+ filterModel7(value, row) {
+ return row.型号 === value;
+ },
+ filterName10(value, row) {
+ return row.物料名 === value;
+ },
+ filterSpecs10(value, row) {
+ return row.规格 === value;
+ },
+ filterModel10(value, row) {
+ return row.型号 === value;
+ },
handleExport(val) {
this.exportLoading = true;
let id = "#exportDiv" + val;
diff --git a/src/views/statistics/product_check2.vue b/src/views/statistics/product_check2.vue
index 4bd45a05..875bd9c2 100644
--- a/src/views/statistics/product_check2.vue
+++ b/src/views/statistics/product_check2.vue
@@ -54,15 +54,24 @@
导出
-
+
{{ scope.row.年 }}
-{{ scope.row.月 }}
-
+
-
+
@@ -129,6 +138,9 @@
mgroupName:'',
mgroupOption:[],
tableData:[],
+ dateFilters:[],
+ specsFilters:[],
+ modelFilters:[],
}
},
mounted(){
@@ -164,6 +176,10 @@
},
getData(){
let that = this;
+ that.dateFilters = [];
+ that.modelFilters = [];
+ that.specsFilters = [];
+ let dateList=[],specsList=[],modelList=[];
let exec = that.queryType=='月'?'lineMonth':'lineYear';
let obj = {
query: {
@@ -213,8 +229,35 @@
};
//获取table数据
that.$API.bi.dataset.exec.req(exec, obj2).then((res2) => {
- console.log('获取table数据:', res2.data2.ds0);
that.tableData = res2.data2.ds0;
+ let data = res2.data2.ds0;
+ data.forEach((item) => {
+ let date =item.年;
+ if(that.queryType=='月'){
+ date =item.年+'-'+item.月;
+ }
+ if(dateList.indexOf(date)>-1){}else{
+ dateList.push(date);
+ let obj = {};
+ obj.text = date;
+ obj.value = date;
+ that.dateFilters.push(obj);
+ }
+ if(modelList.indexOf(item.型号)>-1){}else{
+ modelList.push(item.型号);
+ let obj2 = {};
+ obj2.text = item.型号;
+ obj2.value = item.型号;
+ that.modelFilters.push(obj2);
+ }
+ if(specsList.indexOf(item.规格)>-1){}else{
+ specsList.push(item.规格);
+ let obj3 = {};
+ obj3.text = item.规格;
+ obj3.value = item.规格;
+ that.specsFilters.push(obj3);
+ }
+ })
});
},
handleQuery(){
@@ -266,6 +309,19 @@
});
return sums;
},
+ filterDate(value, row) {
+ let date = row.年;
+ if(this.queryType=='月'){
+ date =row.年+'-'+row.月;
+ }
+ return date === value;
+ },
+ filterSpecs(value, row) {
+ return row.规格 === value;
+ },
+ filterModel(value, row) {
+ return row.型号 === value;
+ },
handleExport(val) {
this.exportLoading = true;
let id = '#exportDiv' + val;
diff --git a/src/views/statistics/stock_statistics.vue b/src/views/statistics/stock_statistics.vue
index 24794471..5b4ac93d 100644
--- a/src/views/statistics/stock_statistics.vue
+++ b/src/views/statistics/stock_statistics.vue
@@ -32,7 +32,7 @@
-
-
-
-
+
+
+
+
-
-
-
+
+
+
@@ -158,13 +172,29 @@
:summary-method="getSummaries"
show-summary
>
-
-
-
+
+
+
+
{{ mio_type_name }}
-
+
+
@@ -210,6 +240,18 @@ export default {
currentLastDay: "",
tableData: [],
tableData1: [],
+ tableData11: [],
+ nameFilters1: [],
+ deptFilters1: [],
+ modelFilters1: [],
+ specsFilters1: [],
+ nameFilters11: [],
+ modelFilters11: [],
+ specsFilters11: [],
+ nameFilters2: [],
+ deptFilters2: [],
+ modelFilters2: [],
+ specsFilters2: [],
typeOptions: ["月", "年"],
materialTypeOptions: [
{ id: 10, name: "成品" },
@@ -231,51 +273,125 @@ export default {
that.currentLastDay = lastDay;
that.queryDate = that.currentYear + "-" + that.currentMonth;
that.start_date = that.currentYear + "-" + that.currentMonth + "-01";
- that.end_date =
- that.currentYear + "-" + that.currentMonth + "-" + lastDay;
+ that.end_date = that.currentYear + "-" + that.currentMonth + "-" + lastDay;
that.getTableData();
- console.log(that.mio_type_name);
- this.materialTypeChange();
+ that.getTableData1();
},
methods: {
queryTypeChnge() {
this.query.queryDate = "";
},
- materialTypeChange() {
+ getTableData1() {
let that = this;
that.tableData1 = [];
- if (that.params.type == 10 || that.params.type == 20) {
- let obj = {
- query: {
- material_types: that.params.type,
- },
- };
- that.$API.bi.dataset.exec
- .req("materialCount", obj)
- .then((res) => {
- if (res.data2.ds0) {
- that.tableData1 = res.data2.ds0;
+ that.nameFilters1 = [];
+ that.deptFilters1 = [];
+ that.modelFilters1 = [];
+ that.specsFilters1 = [];
+ let nameList=[],deptList = [],specsList=[],modelList=[];
+ let obj = {
+ query: {
+ material_types: that.params.type,
+ },
+ };
+ that.$API.bi.dataset.exec.req("materialCount", obj).then((res) => {
+ if (res.data2.ds0) {
+ let data = res.data2.ds0;
+ that.tableData1 = data;
+ if(data.length>0){
+ data.forEach((ite) => {
+ if (nameList.indexOf(ite.material_name) > -1) {} else {
+ nameList.push(ite.material_name);
+ let obj = {};
+ obj.text = ite.material_name;
+ obj.value = ite.material_name;
+ that.nameFilters1.push(obj);
+ }
+ if(modelList.indexOf(ite.material_model)>-1){}else{
+ modelList.push(ite.material_model);
+ let obj2 = {};
+ obj2.text = ite.material_model;
+ obj2.value = ite.material_model;
+ that.modelFilters1.push(obj2);
+ }
+ if(specsList.indexOf(ite.material_specification)>-1){}else{
+ specsList.push(ite.material_specification);
+ let obj3 = {};
+ obj3.text = ite.material_specificationv;
+ obj3.value = ite.material_specification;
+ that.specsFilters1.push(obj3);
+ }
+ if(deptList.indexOf(ite.dept_name)>-1){}else{
+ deptList.push(ite.dept_name);
+ let obj4 = {};
+ obj4.text = ite.dept_name;
+ obj4.value = ite.dept_name;
+ that.deptFilters1.push(obj4);
+ }
+ })
+ }
+ }
+ });
+ },
+ getTableData11(){
+ let that = this;
+ that.tableData11 = [];
+ that.nameFilters11 = [];
+ that.modelFilters11 = [];
+ that.specsFilters11 = [];
+ let nameList=[],specsList=[],modelList=[];
+ this.$API.mtm.material.list.req(that.params).then((res) => {
+ that.tableData11 = res.results;
+ if(res.results.length>0){
+ res.results.forEach((ite) =>{
+ if (nameList.indexOf(ite.name) > -1) {} else {
+ nameList.push(ite.name);
+ let obj = {};
+ obj.text = ite.name;
+ obj.value = ite.name;
+ that.nameFilters11.push(obj);
+ }
+ if(modelList.indexOf(ite.model)>-1){}else{
+ modelList.push(ite.model);
+ let obj2 = {};
+ obj2.text = ite.model;
+ obj2.value = ite.model;
+ that.modelFilters11.push(obj2);
+ }
+ if(specsList.indexOf(ite.specification)>-1){}else{
+ specsList.push(ite.specification);
+ let obj3 = {};
+ obj3.text = ite.specification;
+ obj3.value = ite.specification;
+ that.specsFilters11.push(obj3);
}
});
- } else {
- that.$refs.tables1.refresh();
+ }
+ });
+ },
+ materialTypeChange(){
+ let that = this;
+ if(that.params.type == 10 || that.params.type == 20){
+ that.getTableData1();
+ }else{
+ that.getTableData11();
}
},
//更改周预估用量
weekcountChange(row) {
- let obj = {
- week_esitimate_consume: row.week_esitimate_consume,
- };
- this.$API.mtm.material.setWeekConsume
- .req(row.id, obj)
- .then((res) => {
- console.log(res);
- this.$refs.tables1.refresh();
- });
+ let obj = {week_esitimate_consume: row.week_esitimate_consume};
+ this.$API.mtm.material.setWeekConsume.req(row.id, obj).then((res) => {
+ this.$refs.tables1.refresh();
+ });
},
//获取表格数据
getTableData() {
let that = this;
+ that.nameFilters2 = [];
+ that.deptFilters2 = [];
+ that.modelFilters2 = [];
+ that.specsFilters2 = [];
+ let nameList=[],deptList = [],specsList=[],modelList=[];
let exec = that.queryType == "月" ? "saleOutMonth" : "saleOutYear";
let obj = {
query: {
@@ -288,6 +404,38 @@ export default {
if (res.data2.ds0) {
let data = res.data2.ds0;
that.tableData = data;
+ if(data.length>0){
+ data.forEach((ite) => {
+ if (nameList.indexOf(ite.物料名) > -1) {} else {
+ nameList.push(ite.物料名);
+ let obj = {};
+ obj.text = ite.物料名;
+ obj.value = ite.物料名;
+ that.nameFilters2.push(obj);
+ }
+ if(modelList.indexOf(ite.型号)>-1){}else{
+ modelList.push(ite.型号);
+ let obj2 = {};
+ obj2.text = ite.型号;
+ obj2.value = ite.型号;
+ that.modelFilters2.push(obj2);
+ }
+ if(specsList.indexOf(ite.规格)>-1){}else{
+ specsList.push(ite.规格);
+ let obj3 = {};
+ obj3.text = ite.规格;
+ obj3.value = ite.规格;
+ that.specsFilters2.push(obj3);
+ }
+ if(deptList.indexOf(ite.执行车间)>-1){}else{
+ deptList.push(ite.执行车间);
+ let obj4 = {};
+ obj4.text = ite.执行车间;
+ obj4.value = ite.执行车间;
+ that.deptFilters2.push(obj4);
+ }
+ })
+ }
}
});
},
@@ -297,7 +445,6 @@ export default {
this.mio_type_name = this.mioTypeEnum.values[key].text;
}
}
- console.log(this.mio_type_name);
this.getTableData();
},
handleQuery() {
@@ -383,6 +530,40 @@ export default {
});
return sums;
},
+
+ filterName1(value, row) {
+ return row.物料名 == value;
+ },
+ filterSpecs1(value, row) {
+ return row.规格 == value;
+ },
+ filterModel1(value, row) {
+ return row.型号 == value;
+ },
+ filterDept1(value, row) {
+ return row.完成车间 == value;
+ },
+ filterName11(value, row) {
+ return row.物料名 == value;
+ },
+ filterSpecs11(value, row) {
+ return row.规格 == value;
+ },
+ filterModel11(value, row) {
+ return row.型号 == value;
+ },
+ filterName2(value, row) {
+ return row.物料名 == value;
+ },
+ filterSpecs2(value, row) {
+ return row.规格 == value;
+ },
+ filterModel2(value, row) {
+ return row.型号 == value;
+ },
+ filterDept2(value, row) {
+ return row.执行车间 == value;
+ },
handleExport(val) {
this.exportLoading = true;
let id = "#exportDiv" + val;
diff --git a/src/views/statistics/user_statistics.vue b/src/views/statistics/user_statistics.vue
index da100526..2aac99e6 100644
--- a/src/views/statistics/user_statistics.vue
+++ b/src/views/statistics/user_statistics.vue
@@ -59,14 +59,20 @@
show-summary
>
-
+
{{ scope.row.年 }}-{{ scope.row.月 }}
-
+
-
+
{{ queryBelongDept }}
@@ -107,6 +113,9 @@ export default {
currentMonth: "",
deptData: [],
tableData: [],
+ dateFilters:[],
+ userFilters:[],
+ mgroupFilters:[],
option: {
title: {
text: "人员统计",
@@ -167,6 +176,9 @@ export default {
},
getData() {
let that = this;
+ that.userFilters = [];
+ that.mgroupFilters = [];
+ let userList=[],mgroupList=[];
let obj = {
query: {
start_date: this.start_date,
@@ -175,17 +187,27 @@ export default {
},
};
that.$API.bi.dataset.exec.req("performance", obj).then((res) => {
- console.log("绩效统计:", res);
let data = res.data2.ds0;
let seriesData = [],
yAxisData = [];
data.forEach((item) => {
seriesData.push(item.合格数);
yAxisData.push(item.操作人 + "∙" + item.工段);
+ if(userList.indexOf(item.操作人)>-1){}else{
+ userList.push(item.操作人);
+ let obj2 = {};
+ obj2.text = item.操作人;
+ obj2.value = item.操作人;
+ that.userFilters.push(obj2);
+ }
+ if(mgroupList.indexOf(item.工段)>-1){}else{
+ mgroupList.push(item.工段);
+ let obj3 = {};
+ obj3.text = item.工段;
+ obj3.value = item.工段;
+ that.mgroupFilters.push(obj3);
+ }
});
- console.log(yAxisData);
- console.log(seriesData);
- console.log(data);
that.tableData = data;
that.option.yAxis.data = yAxisData;
that.option.series.data = seriesData;
@@ -240,6 +262,12 @@ export default {
});
return sums;
},
+ filterUser(value, row) {
+ return row.操作人 === value;
+ },
+ filterMgroup(value, row) {
+ return row.工段 === value;
+ },
handleExport() {
this.exportLoading = true;
this.$XLSX("#exportDiv", "人员统计");