diff --git a/src/views/statistics/statistics_bang.vue b/src/views/statistics/statistics_bang.vue index 81dcfc56..8eecf8de 100644 --- a/src/views/statistics/statistics_bang.vue +++ b/src/views/statistics/statistics_bang.vue @@ -47,980 +47,472 @@ id="exportDiv" stripe > - + - - + + - + + - + - + - + - + - + - + - + + + + - + - + - + - + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + + + + - - - - - - - - - - - - - - - + - + @@ -1038,7 +530,7 @@ export default { return { params: { ordering:'-last_time', - batch__startswith__in:'ZJ2,G05', + batch__startswith__in:'ZJ2,G05,J2C,A55', }, query:{ batch__contains:'', @@ -1054,9 +546,125 @@ export default { handleQuery(){ this.$refs.table.queryData(this.query); }, + getCountQt(data,type){ + let count_qt = 0,count = 0; + if(type=='7车间'){ + if(data.棒料成型_count_notok){ + if (data.棒料成型_count_n_zw !== undefined) { + count += data.棒料成型_count_n_zw ; + } + if (data.棒料成型_count_n_zt !== undefined) { + count += data.棒料成型_count_n_zt ; + } + if (data.棒料成型_count_n_tw !== undefined) { + count += data.棒料成型_count_n_tw ; + } + if (data.棒料成型_count_n_qp !== undefined) { + count += data.棒料成型_count_n_qp ; + } + if (data.棒料成型_count_n_zz !== undefined) { + count += data.棒料成型_count_n_zz ; + } + if (data.棒料成型_count_n_b !== undefined) { + count += data.棒料成型_count_n_b ; + } + count_qt = data.棒料成型_count_notok - count; + return count_qt; + } + }else if(type=='8车间'){ + if(data.七车间入库_count_notok){ + if (data.七车间入库_count_n_zw !== undefined) { + count += data.七车间入库_count_n_zw ; + } + if (data.七车间入库_count_n_zt !== undefined) { + count += data.七车间入库_count_n_zt ; + } + if (data.七车间入库_count_n_tw !== undefined) { + count += data.七车间入库_count_n_tw ; + } + if (data.七车间入库_count_n_qp !== undefined) { + count += data.七车间入库_count_n_qp ; + } + if (data.七车间入库_count_n_b !== undefined) { + count += data.七车间入库_count_n_b ; + } + count_qt = data.七车间入库_count_notok - count; + return count_qt; + } + }else if(type=='粗中细磨'){ + if(data.六车间_粗中细磨_count_notok){ + if (data.六车间_粗中细磨_count_n_d !== undefined) { + count += data.六车间_粗中细磨_count_n_d ; + } + if (data.六车间_粗中细磨_count_n_w !== undefined) { + count += data.六车间_粗中细磨_count_n_w ; + } + if (data.六车间_粗中细磨_count_n_yp !== undefined) { + count += data.六车间_粗中细磨_count_n_yp ; + } + if (data.六车间_粗中细磨_count_n_dl !== undefined) { + count += data.六车间_粗中细磨_count_n_dl ; + } + count_qt = data.六车间_粗中细磨_count_notok - count; + return count_qt; + } + }else if(type=='抛光'){ + if(data.六车间_抛光_count_notok){ + if (data.六车间_抛光_count_n_hs !== undefined) { + count += data.六车间_抛光_count_n_hs ; + } + if (data.六车间_抛光_count_n_dl !== undefined) { + count += data.六车间_抛光_count_n_dl ; + } + if (data.六车间_抛光_count_n_qp !== undefined) { + count += data.六车间_抛光_count_n_qp ; + } + count_qt = data.六车间_抛光_count_notok - count; + return count_qt; + } + }else if(type=='六车间中检'){ + if(data.六车间中检_count_notok){ + if (data.六车间中检_count_n_hs !== undefined) { + count += data.六车间中检_count_n_hs ; + } + if (data.六车间中检_count_n_zw !== undefined) { + count += data.六车间中检_count_n_zw ; + } + if (data.六车间中检_count_n_zdd !== undefined) { + count += data.六车间中检_count_n_zdd ; + } + if (data.六车间中检_count_n_qp !== undefined) { + count += data.六车间中检_count_n_qp ; + } + if (data.六车间中检_count_n_bl !== undefined) { + count += data.六车间中检_count_n_bl ; + } + if (data.六车间中检_count_n_qx !== undefined) { + count += data.六车间中检_count_n_qx ; + } + count_qt = data.六车间中检_count_notok - count; + return count_qt; + } + }else if(type=='六车间生产入库'){ + if(data.六车间生产入库_count_notok){ + if (data.六车间生产入库_count_n_yp !== undefined) { + count += data.六车间生产入库_count_n_yp ; + } + if (data.六车间生产入库_count_n_d !== undefined) { + count += data.六车间生产入库_count_n_d ; + } + if (data.六车间生产入库_count_n_hs !== undefined) { + count += data.六车间生产入库_count_n_hs ; + } + if (data.六车间生产入库_count_n_zw !== undefined) { + count += data.六车间生产入库_count_n_zw ; + } + count_qt = data.六车间生产入库_count_notok - count; + return count_qt; + } + } + } }, }; - diff --git a/src/views/statistics/statistics_guan.vue b/src/views/statistics/statistics_guan.vue index 69ef4a40..8ccc0bac 100644 --- a/src/views/statistics/statistics_guan.vue +++ b/src/views/statistics/statistics_guan.vue @@ -47,721 +47,515 @@ id="exportDiv" stripe > - + - - + + - + - + - + - + + + + - + - + - + - + - + - + - + - + - - + + - + - + - + + + + - + - + - + - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - + - + - + - + + + + - + - + - + - + - + - + - - + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - + - + + + + - - - - + - - - - + - - - - + - - - - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + - - + + - + - + - + + + + + + + + + + + + + @@ -776,7 +570,7 @@ export default { return { params: { ordering:'-last_time', - batch__startswith__in:'ZB2', + batch__startswith__in:'ZB2,B1', }, query:{ batch__contains:'', @@ -793,6 +587,164 @@ export default { handleQuery(){ this.$refs.table.queryData(this.query); }, + getCountQt(data,type){ + let count_qt = 0,count = 0; + if(type=='管料成型'){ + if(data.管料成型_count_notok){ + if (data.管料成型_count_n_wq !== undefined) { + count += data.管料成型_count_n_wq ; + } + if (data.管料成型_count_n_tw !== undefined) { + count += data.管料成型_count_n_tw ; + } + if (data.管料成型_count_n_dl !== undefined) { + count += data.管料成型_count_n_dl ; + } + if (data.管料成型_count_n_pb !== undefined) { + count += data.管料成型_count_n_pb ; + } + if (data.管料成型_count_n_dxt !== undefined) { + count += data.管料成型_count_n_dxt ; + } + if (data.管料成型_count_n_js !== undefined) { + count += data.管料成型_count_n_js ; + } + if (data.管料成型_count_n_qx !== undefined) { + count += data.管料成型_count_n_qx ; + } + count_qt = data.管料成型_count_notok - count; + return count_qt; + } + }else if(type=='十车间入库'){ + if(data.十车间入库_count_notok){ + if (data.十车间入库_count_n_wq !== undefined) { + count += data.十车间入库_count_n_wq ; + } + if (data.十车间入库_count_n_tw !== undefined) { + count += data.十车间入库_count_n_tw ; + } + if (data.十车间入库_count_n_dl !== undefined) { + count += data.十车间入库_count_n_dl ; + } + if (data.十车间入库_count_n_pb !== undefined) { + count += data.十车间入库_count_n_pb ; + } + if (data.十车间入库_count_n_dxt !== undefined) { + count += data.十车间入库_count_n_dxt ; + } + if (data.十车间入库_count_n_js !== undefined) { + count += data.十车间入库_count_n_js ; + } + if (data.十车间入库_count_n_qx !== undefined) { + count += data.十车间入库_count_n_qx ; + } + count_qt = data.十车间入库_count_notok - count; + return count_qt; + } + }else if(type=='十车间入库'){ + if(data.十车间入库_count_notok){ + if (data.十车间入库_count_n_wq !== undefined) { + count += data.十车间入库_count_n_wq ; + } + if (data.十车间入库_count_n_tw !== undefined) { + count += data.十车间入库_count_n_tw ; + } + if (data.十车间入库_count_n_dl !== undefined) { + count += data.十车间入库_count_n_dl ; + } + if (data.十车间入库_count_n_pb !== undefined) { + count += data.十车间入库_count_n_pb ; + } + if (data.十车间入库_count_n_dxt !== undefined) { + count += data.十车间入库_count_n_dxt ; + } + if (data.十车间入库_count_n_js !== undefined) { + count += data.十车间入库_count_n_js ; + } + if (data.十车间入库_count_n_qx !== undefined) { + count += data.十车间入库_count_n_qx ; + } + count_qt = data.十车间入库_count_notok - count; + return count_qt; + } + }else if(type=='管料退火'){ + if(data.管料退火_count_notok){ + if (data.管料退火_count_n_xzp !== undefined) { + count += data.管料退火_count_n_xzp ; + } + if (data.管料退火_count_n_thhs !== undefined) { + count += data.管料退火_count_n_thhs ; + } + if (data.管料退火_count_n_hs !== undefined) { + count += data.管料退火_count_n_hs ; + } + if (data.管料退火_count_n_js !== undefined) { + count += data.管料退火_count_n_js ; + } + if (data.管料退火_count_n_qx !== undefined) { + count += data.管料退火_count_n_qx ; + } + count_qt = data.管料退火_count_notok - count; + return count_qt; + } + }else if(type=='开槽'){ + if(data.六车间_开槽_count_notok){ + if (data.六车间_开槽_count_n_dl !== undefined) { + count += data.六车间_开槽_count_n_dl ; + } + count_qt = data.六车间_开槽_count_notok - count; + return count_qt; + } + }else if(type=='倒角'){ + if(data.六车间_倒角_count_notok){ + if (data.六车间_倒角_count_n_dl !== undefined) { + count += data.六车间_倒角_count_n_dl ; + } + count_qt = data.六车间_倒角_count_notok - count; + return count_qt; + } + }else if(type=='六车间中检'){ + if(data.六车间中检_count_notok){ + if (data.六车间中检_count_n_hs !== undefined) { + count += data.六车间中检_count_n_hs ; + } + if (data.六车间中检_count_n_zz !== undefined) { + count += data.六车间中检_count_n_zz ; + } + if (data.六车间中检_count_n_zdd !== undefined) { + count += data.六车间中检_count_n_zdd ; + } + if (data.六车间中检_count_n_zw !== undefined) { + count += data.六车间中检_count_n_zw ; + } + if (data.六车间中检_count_n_qp !== undefined) { + count += data.六车间中检_count_n_qp ; + } + if (data.六车间中检_count_n_bl !== undefined) { + count += data.六车间中检_count_n_bl ; + } + if (data.六车间中检_count_n_hw !== undefined) { + count += data.六车间中检_count_n_hw ; + } + if (data.六车间中检_count_n_yp !== undefined) { + count += data.六车间中检_count_n_yp ; + } + count_qt = data.六车间中检_count_notok - count; + return count_qt; + } + }else if(type=='六车间生产入库'){ + if(data.六车间生产入库_count_notok){ + if (data.六车间生产入库_count_n_hs !== undefined) { + count += data.六车间生产入库_count_n_hs ; + } + if (data.六车间生产入库_count_n_zw !== undefined) { + count += data.六车间生产入库_count_n_zw ; + } + count_qt = data.六车间生产入库_count_notok - count; + return count_qt; + } + } + } }, }; diff --git a/src/views/statistics/total_statistics.vue b/src/views/statistics/total_statistics.vue index 55c5dab3..1c9f9ebe 100644 --- a/src/views/statistics/total_statistics.vue +++ b/src/views/statistics/total_statistics.vue @@ -67,11 +67,11 @@ + - - - + @@ -122,11 +122,11 @@ + - - - + @@ -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 !== "") {