diff --git a/src/views/statistics/total_statistics.vue b/src/views/statistics/total_statistics.vue
index 55c5dab3..d42623e3 100644
--- a/src/views/statistics/total_statistics.vue
+++ b/src/views/statistics/total_statistics.vue
@@ -67,10 +67,10 @@
-
-
+
+
@@ -122,10 +122,10 @@
-
-
+
+
@@ -167,10 +167,8 @@ export default {
this.day = day;
this.query.date = this.currentDate = `${year}-${month}-${day}`;
this.getSourceData();
- this.bangHeight =
- document.getElementById("bangTable").offsetHeight - 20;
- this.guanHeight =
- document.getElementById("guanTable").offsetHeight - 20;
+ this.bangHeight = document.getElementById("bangTable").offsetHeight - 20;
+ this.guanHeight = document.getElementById("guanTable").offsetHeight - 20;
},
created() {},
methods: {
@@ -180,6 +178,7 @@ export default {
query: {
start_date: that.query.date,
end_date: that.query.date,
+ fw_type: "process",
},
};
that.$API.bi.dataset.exec.req("count_ok_day", params).then((res) => {
@@ -191,17 +190,25 @@ export default {
if (item.型号.indexOf("+") > -1) {
b_model = item.型号.split("+")[0];
} else {
- b_model = guan_model = item.型号;
+ b_model = item.型号;
}
let index = models.indexOf(b_model);
if(index>-1){
- if(item.检验类型=='prod'){
- that.tableData11[index].中检合格数 += item.合格数;
- }else if(item.检验类型=='process'){
- that.tableData11[index].检验合格数 += item.合格数;
- }
+ that.tableData11[index].中检合格数 += item.合格数量;
}
});
+ that.saleDatas.forEach((item1) => {
+ let b_model = "";
+ if (item1.型号.indexOf("+") > -1) {
+ b_model = item1.型号.split("+")[0];
+ } else {
+ b_model = item1.型号;
+ }
+ let index = models.indexOf(b_model);
+ if(index>-1){
+ that.tableData11[index].检验合格数 += item1.数量;
+ }
+ })
}else if(type=="g"){
datas.forEach((item) => {
let g_model = "",g_spec = "";
@@ -218,13 +225,27 @@ export default {
let msitem = g_model+g_spec;
let index = models.indexOf(msitem);
if(index>-1){
- if(item.检验类型=='prod'){
- that.tableData22[index].中检合格数 += item.合格数;
- }else if(item.检验类型=='process'){
- that.tableData22[index].检验合格数 += item.合格数;
- }
+ that.tableData22[index].中检合格数 += item.合格数量;
}
});
+ that.saleDatas.forEach((item1) => {
+ let g_model = "",g_spec = "";
+ if (item1.型号.indexOf("+") > -1) {
+ g_model = item1.型号.split("+")[1];
+ } else {
+ g_model = item1.型号;
+ }
+ if (item1.规格.indexOf("+") > -1) {
+ g_spec = item1.规格.split("+")[1];
+ } else {
+ g_spec = item1.规格;
+ }
+ let msitem = g_model+g_spec;
+ let index = models.indexOf(msitem);
+ if(index>-1){
+ that.tableData22[index].检验合格数 += item1.数量;
+ }
+ })
}
}
});
@@ -243,12 +264,11 @@ export default {
let data_g = [...datas.ds1, ...datas.ds3];
that.data_b = data_b;
that.data_g = data_g;
- that.getDataB(data_b);
- that.getDataG(data_g);
+ that.getSaleOutData(data_b, data_g);
});
},
//棒数据
- getDataB(data) {
+ getDataB(data,saleData) {
let that = this;
let models = [],dataArr = [];
//按版型(型号)分组
@@ -308,8 +328,8 @@ export default {
key = "开槽";
}
if (item1.车间==null||item1.车间==undefined) {
- console.log( '仓库库存',item1);
- console.log( item1.工序 !== "配管"&&item1.类型==10);
+ // console.log( '仓库库存',item1);
+ // console.log( item1.工序 !== "配管"&&item1.类型==10);
if (item1.工序 == "配管") {
key = "配管";
}else if(item1.工序 !== "配管"&&item1.类型==10){
@@ -333,11 +353,23 @@ export default {
obj.成品库;
that.tableData11[index] = obj;
});
+ // saleData.forEach((item) => {
+ // let index = 0;
+ // if (item.型号.indexOf("+") > -1) {
+ // let model = item.型号.split("+")[0];
+ // index = models.indexOf(model);
+ // } else {
+ // index = models.indexOf(item.型号);
+ // }
+ // if (index > -1) {
+ // that.tableData11[index].检验合格数=item.数量;
+ // }
+ // })
that.models_b = models;
that.getCountOk('b',models);
},
//管数据
- getDataG(data) {
+ getDataG(data,saleData) {
let that = this;
let models = [],
modelArr = [];
@@ -428,8 +460,8 @@ export default {
key = "倒角";
}
if (item5.车间==null||item5.车间==undefined) {
- console.log( '仓库库存',item5);
- console.log( item5.工序 !== "配管"&&item5.类型==10);
+ // console.log( '仓库库存',item5);
+ // console.log( item5.工序 !== "配管"&&item5.类型==10);
if (item5.工序 == "配管") {
key = "配棒";
}else if(item5.工序 !== "配管"&&item5.类型==10){
@@ -454,9 +486,37 @@ export default {
modelsspec.push(modelsspecitem);
});
});
+ saleData.forEach((item) => {
+ let index = 0;
+ if (item.型号.indexOf("+") > -1) {
+ let model = item.型号.split("+")[1];
+ index = models.indexOf(model);
+ } else {
+ index = models.indexOf(item.型号);
+ }
+ if (index > -1) {
+ that.tableData22[index].检验合格数=item.数量;
+ }
+ })
that.models_g = models;
that.getCountOk('g',models);
},
+ getSaleOutData(data_b, data_g){
+ let that = this;
+ let obj = {
+ query: {
+ start_date: that.query.date,
+ end_date: that.query.date,
+ mio_type: "sale_out",
+ material_id: "",
+ },
+ };
+ that.$API.bi.dataset.exec.req("saleOutDay", obj).then((res) => {
+ let saleData = that.saleDatas = res.data2.ds0;
+ that.getDataB(data_b,saleData);
+ that.getDataG(data_g,saleData);
+ })
+ },
handleQuery() {
let that = this;
if (that.query.date !== null && that.query.date !== "") {