diff --git a/src/views/statistics/pass_num_gx.vue b/src/views/statistics/pass_num_gx.vue index e531aac8..218b3ddb 100644 --- a/src/views/statistics/pass_num_gx.vue +++ b/src/views/statistics/pass_num_gx.vue @@ -40,36 +40,24 @@ :height="300" > - - - - - - - + - - - - - - - - - - - - - + + + + + + + @@ -97,39 +85,39 @@ :height="300" > - - - - - - - - + - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + @@ -153,43 +141,27 @@ > - - - - - - - - + - - - - - - - - - - - - - + + + + + + @@ -217,39 +189,23 @@ :height="300" > - - - - - - - - + - - - - - - - - - - - - - + + + + + + @@ -277,39 +233,33 @@ :height="300" > - - - - - - - - + - - - - - - - - - - - - - + + + + + + + + + + + + + + + + @@ -337,39 +287,24 @@ :height="300" > - - - - - - - - + - - - - - - - - - - - - - + + + + + + + @@ -397,39 +332,32 @@ :height="300" > - - - - - - - - + - - - - - - - - - - - - - + + + + + + + + + + + + + + + @@ -457,39 +385,32 @@ :height="300" > - - - - - - - - + - - - - - - - - - - - - - + + + + + + + + + + + + + + + @@ -517,39 +438,32 @@ :height="300" > - - - - - - - - + - - - - - - - - - - - - - + + + + + + + + + + + + + + + @@ -577,39 +491,37 @@ :height="300" > - - - - - - - - + - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + @@ -637,39 +549,36 @@ :height="300" > - - - - - - - - + - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + @@ -697,39 +606,39 @@ :height="300" > - - - - - - - - + - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + @@ -757,39 +666,33 @@ :height="300" > - - - - - - - - + - - - - - - - - - - - - - + + + + + + + + + + + + + + + + @@ -817,39 +720,32 @@ :height="300" > - - - - - - - - + - - - - - - - - - - - - - + + + + + + + + + + + + + + + @@ -877,39 +773,32 @@ :height="300" > - - - - - - - - + - - - - - - - - - - - - - + + + + + + + + + + + + + + + @@ -937,39 +826,34 @@ :height="300" > - - - - - - - - + - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + @@ -997,39 +881,32 @@ :height="300" > - - - - - - - - + - - - - - - - - - - - - - + + + + + + + + + + + + + + + @@ -1057,39 +934,42 @@ :height="300" > - - - - - - - - + - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1117,39 +997,32 @@ :height="300" > - - - - - - - - + - - - - - - - - - - - - - + + + + + + + + + + + + + + + @@ -1178,9 +1051,6 @@ export default { mgroup_name:'', start_date:'', end_date:'', - group_bys_material: "", - order_bys_material: "", - select_cols_material: "" }, queryDate:'', currentYear: "", @@ -1191,19 +1061,19 @@ export default { title: { text: "合格数统计", }, + tooltip: { + trigger: "item", + }, + legend: { + top: "3", + right: "3%", + }, grid: { top: "80px", }, tooltip: { trigger: "axis", }, - xAxis: { - type: "category", - data: ["周一","周二","周三","周四","周五","周六","周日"], - }, - yAxis: { - type: "value", - }, lenged: [], series: [], }, @@ -1284,6 +1154,7 @@ export default { res.forEach(item=>{ let indexes = that.mgroupList.indexOf(item.name); if(indexes>-1){ + // that.getDefect(item.id,indexes); arr[indexes] = item.name; } }) @@ -1293,6 +1164,16 @@ export default { that.getWeekDate(nowDate); }); }, + // getDefect(id,index){ + // let that = this; + // that.$API.mtm.defect.list.req({ page: 0, mgroup_id: id}).then((res) => { + // let arr = []; + // res.forEach(item=>{ + // arr.push(item.name); + // }) + // that["tableData"+index] = arr; + // }); + // }, getData(mgroup_name,mgroup_index) { let that = this; let option = deepCopy(that.basicOption); @@ -1301,54 +1182,70 @@ export default { option.title.text = mgroup_name+"合格数统计"; let obj = {}; obj.query = query; - that.$API.bi.dataset.exec.req('lineDay_m', obj).then((res) => { + that.$API.bi.dataset.exec.req('lineDay_m3', obj).then((res) => { let tableData = res.data2.ds0 ? res.data2.ds0 : []; let names = 'tableData'+mgroup_index; - that[names] = tableData; + let defectList = []; + let defectObject = {}; + let countOk = 0; if (tableData.length > 0) { - let dataList = [],nameList = [],datas = []; + let chartObj = { + name:mgroup_name, + data: [{name: "合格数",value: 0}], + type: "pie", + radius: ["30%", "65%"], + center: ["40%", "55%"], + label: { + show: true, + position: "outside", + formatter: "{b} : {c} ({d}%)", + }, + }; + //将数据分类 tableData.forEach((ite) => { - if (nameList.indexOf(ite.物料名) > -1) {} else { - nameList.push(ite.物料名); - dataList.push([]) - datas.push([0,0,0,0,0,0,0]); - let obj = { - name:ite.物料名, - data: [], - stack: "Ad", - type: "bar", - barWidth: "15px", - }; - option.series.push(obj) + countOk += ite.合格数; + if(ite.缺陷统计!==null){ + ite.缺陷统计 = JSON.parse(ite.缺陷统计); + for(let key in ite.缺陷统计){ + ite[key] = ite.缺陷统计[key]; + if(defectList.indexOf(key)<0){ + defectList.push(key); + defectObject[key] = ite.缺陷统计[key]; + }else{ + defectObject[key] += ite.缺陷统计[key]; + } + } } }); - tableData.forEach((item) => { - let indexX = nameList.indexOf(item.物料名); - dataList[indexX].push(item); - }); - for(let i = 0;i