diff --git a/src/components/scScrollTable.vue b/src/components/scScrollTable.vue index 0795e67b..8e49da2f 100644 --- a/src/components/scScrollTable.vue +++ b/src/components/scScrollTable.vue @@ -2,229 +2,239 @@
-
- +
+
- + -
{{ itemx }}{{ itemx }}
-
-
- - - +
{{ index+1 }}
+
+
+ + + - -
{{ index + 1 }} - - {{ stateOption[itemz.value] }} + + {{ + stateOption[itemz.value] }} {{ itemz.value }} -
- - - + + +
{{ index+1 }}
+ + + - -
{{ index + 1 }} - - {{itemz.value}} - - {{ stateOption[itemz.value] }} + + {{ itemz.value }} + + {{ + stateOption[itemz.value] }} {{ itemz.value }} -
-
-
+ + + +
+
\ No newline at end of file diff --git a/src/views/bigScreen/index_10dept.vue b/src/views/bigScreen/index_10dept.vue index c98cd4c0..5da64550 100644 --- a/src/views/bigScreen/index_10dept.vue +++ b/src/views/bigScreen/index_10dept.vue @@ -2,7 +2,7 @@
10车间生产数据看板
-
{{currentDay}} {{ currentTime }}
+
{{ currentDay }} {{ currentTime }}
@@ -15,10 +15,12 @@
-
- {{item.material_out_.name}}|{{ item.material_out_.specification }}|{{ item.material_out_.model }} - - {{item.count}} +
+ {{ item.material_out_name }} + + {{ item.count }}
@@ -31,8 +33,10 @@
- {{yesterdayObjet.物料名}} - {{yesterdayObjet.合格数}} + {{ yesterdayObjet.物料名 }} + {{ + yesterdayObjet.合格数 }}
@@ -44,9 +48,10 @@
- {{item.物料名}} - - {{item.合格数}} + {{ item.物料名 }} + + {{ item.合格数 }}
@@ -56,17 +61,16 @@
-
-
人员到岗 -
-
-
-
- +
+
人员到岗
+
+
+ +
+
@@ -76,8 +80,8 @@
- +
@@ -119,12 +123,12 @@ \ No newline at end of file diff --git a/src/views/bigScreen/index_6dept.vue b/src/views/bigScreen/index_6dept.vue index 4a8863d1..490f9b1b 100644 --- a/src/views/bigScreen/index_6dept.vue +++ b/src/views/bigScreen/index_6dept.vue @@ -2,7 +2,7 @@
6车间生产数据大看板
-
{{currentDay}} {{ currentTime }}
+
{{ currentDay }} {{ currentTime }}
@@ -14,11 +14,17 @@
-
- {{item.number}} - - {{item.count}} - +
+
+ {{ item.material_out_name }} + + {{ item.count }} + +
+
@@ -32,9 +38,8 @@
- +
@@ -47,9 +52,8 @@
- +
@@ -85,7 +89,7 @@ function deepCopy(obj) { return JSON.parse(JSON.stringify(obj)); } export default { - components: {scScrollTavle}, + components: { scScrollTavle }, data() { return { basicOption: { @@ -153,7 +157,7 @@ export default { xAxis: { type: 'category', boundaryGap: true, - data: ['1日','2日', '3日', '4日', '5日', '6日', '7日', '8日','9日','10日', '11日', '12日', '13日', '14日', '15日', '16日', '17日', '18日','19日','20日', '21日', '22日', '23日', '24日', '25日', '26日', '27日', '28日', '29日', '30日'], + data: ['1日', '2日', '3日', '4日', '5日', '6日', '7日', '8日', '9日', '10日', '11日', '12日', '13日', '14日', '15日', '16日', '17日', '18日', '19日', '20日', '21日', '22日', '23日', '24日', '25日', '26日', '27日', '28日', '29日', '30日'], nameTextStyle: { color: '#ffffff' }, @@ -222,7 +226,7 @@ export default { label: { show: true, position: 'insideTop', - color:'#666' + color: '#666' }, data: [] }, @@ -267,35 +271,40 @@ export default { label: { show: true, position: 'insideTop', - color:'#666', - font:'10' + color: '#666', + font: '10' }, - data:[] + data: [] }, ] }, - containerHeight1:100, - containerHeight2:100, - table1Visible:false, - table2Visible:false, - refValue1:'moocBox1', - refValue2:'moocBox2', - liData1: ['序号','日期','名称', '型号', '规格', '发货数量'], - liData2: ['序号','工序','产品名称', '型号', '计划数量', '合格数量', '完成进度', '合格率'], - todayUtask:[], - saleOutData:[], - processData:[], - time: null, - start_date:'', - end_date:'', - scrollVivible:true, - dayInterval:null, - chartInterval1:null, - chartInterval2:null, - currentTime:'', - currentDay:'', - weekFirst:'', - weekLast:'', + containerHeight1: 100, + containerHeight2: 100, + table1Visible: false, + table2Visible: false, + refValue1: 'moocBox1', + refValue2: 'moocBox2', + liData1: ['序号', '日期', '名称', '型号', '规格', '发货数量'], + liData2: ['序号', '工序', '产品名称', '型号', '计划数量', '合格数量', '完成进度', '合格率'], + todayMtask: [ + { material_out_name: '光纤预制棒|33*470|ZJ2|棒料成型', count: 300 }, + { material_out_name: '光纤预制棒|33*470|ZJ2|棒料成型', count: 300 }, + { material_out_name: '光纤预制棒|33*470|ZJ2|棒料成型', count: 300 }, + { material_out_name: '光纤预制棒|33*470|ZJ2|棒料成型', count: 300 }, + ], + saleOutData: [], + processData: [], + time: null, + start_date: '', + end_date: '', + scrollVivible: true, + dayInterval: null, + chartInterval1: null, + chartInterval2: null, + currentTime: '', + currentDay: '', + weekFirst: '', + weekLast: '', } }, mounted() { @@ -305,42 +314,50 @@ export default { //表格table2的显示 this.containerHeight2 = document.getElementById('scrollContainer2').clientHeight; this.table2Visible = true; - + const ondDayTime = 86400000; let date = new Date(); let year = date.getFullYear(); - let month = date.getMonth()+1; + let month = date.getMonth() + 1; let day = date.getDate(); let days = new Date(year, month, 0).getDate(); this.days = days; - let start_date = year+'-'+month+'-01'; + let start_date = year + '-' + month + '-01'; let lastDay = new Date(year, month, 0).getDate(); - let end_date = year+'-'+month+'-'+lastDay; + let end_date = year + '-' + month + '-' + lastDay; this.start_date = start_date; this.end_date = end_date; - this.today = year+'-'+month+'-'+day; - // let yesterday = new Date(date.getTime()-24*60*60*1000); - // this.yesterday = yesterday.getFullYear()+"-" + (yesterday.getMonth()+1) + "-" + yesterday.getDate(); - let week = date.getDay();//当前时间的week数 + this.today = year + '-' + month + '-' + day; + let yesterday = new Date(date.getTime() - 24 * 60 * 60 * 1000); + this.yesterday = yesterday.getFullYear() + "-" + (yesterday.getMonth() + 1) + "-" + yesterday.getDate(); + let week = yesterday.getDay();//当前时间的week数 + console.log(week); let weekFirst = week - 1;//第一天对应的天数 let weekLast = 7 - week;//最后一天对应的天数 + if (week == 0) { + weekFirst = 6; + weekLast = 0;//周日特殊处理 + } else { + weekFirst = week - 1; + weekLast = 7 - week; + } let first = new Date(new Date(date.getTime() - (weekFirst * ondDayTime)));//本周周一 let last = new Date(new Date(date.getTime() + (weekLast * ondDayTime)));//本周周日 this.weekFirst = first.getFullYear() + '-' + (first.getMonth() + 1) + '-' + first.getDate(); this.weekLast = last.getFullYear() + '-' + (last.getMonth() + 1) + '-' + last.getDate(); this.getsaleOut(); this.getMioItem();//发货情况 - this.getTodayUtask();//今日任务 + // this.getTodayMtask();//今日任务 //昨日工序进度 this.getMtask(); //时间 this.showTime() - this.dayInterval = setInterval(()=>{ + this.dayInterval = setInterval(() => { this.showTime() - },1000) + }, 1000) }, methods: { - showTime(){ + showTime() { this.currentTime = this.$TOOL.dateFormat(new Date(), 'hh:mm:ss') this.currentDay = this.$TOOL.dateFormat(new Date(), 'yyyy年MM月dd日') }, @@ -360,31 +377,37 @@ export default { }, 500) }, //今日任务 - getTodayUtask(){ + getTodayMtask() { let that = this; - let obj ={}; + let obj = {}; obj.start_date = this.today; obj.end_date = this.today; - obj.belong_dept__name='6车间'; - obj.page=0; - that.$API.pm.utask.list.req(obj).then((res) => { - that.todayUtask=res; - console.log('今日任务:',res); + obj.is_count_utask = true; + obj.mgroup__belong_dept__name = '6车间'; + obj.page = 0; + that.$API.pm.mtask.list.req(obj).then((res) => { + that.todayMtask = res; + console.log('今日任务:', res); }); + + // that.$API.pm.utask.list.req(obj).then((res) => { + // that.todayMtask = res; + // console.log('今日任务:', res); + // }); }, //发货情况 - getMioItem(){ + getMioItem() { let that = this; - let obj ={}; + let obj = {}; obj.mio__type = 'sale_out'; obj.mio__inout_date__gte = that.start_date; obj.mio__inout_date__lte = that.end_date; - obj.page=0; + obj.page = 0; that.$API.inm.mioitem.list.req(obj).then((res) => { console.log(res); let saleOutData = []; res.forEach(item => { - let arr = [],obj1 = {},obj2 = {},obj3 = {},obj4 = {},obj5 = {}; + let arr = [], obj1 = {}, obj2 = {}, obj3 = {}, obj4 = {}, obj5 = {}; obj1.elType = 'primary'; obj1.value = item.inout_date; obj2.elType = 'primary'; @@ -406,39 +429,33 @@ export default { }); }, //本周工序进展 - getMtask(){ + getMtask() { let that = this; - let obj ={}; - obj.start_date = this.weekFirst; - obj.end_date = this.weekLast; - obj.mgroup__belong_dept__name='6车间'; - obj.page=0; - that.$API.pm.mtask.list.req(obj).then((res) => { - console.log(res); - if(res.length>0){ + let obj = { + query: { start_date: this.start_date, end_date: this.end_date, dept_name: "6车间" }, + }; + //生产车间按日统计 + that.$API.bi.dataset.exec.req('mgroupWeek', obj).then((res) => { + let data = res.data2.ds0; + if (data.length > 0) { let processData = []; - res.forEach(item => { - let arr = [],obj1 = {},obj2 = {},obj3 = {},obj4 = {},obj5 = {},obj6 = {},obj7 = {},obj8 = {}; + data.forEach(item => { + let arr = [], obj1 = {}, obj2 = {}, obj3 = {}, obj4 = {}, obj5 = {}, obj6 = {}, obj7 = {}, obj8 = {}; obj1.elType = 'primary'; - obj1.value = item.mgroup_name;//工序 + obj1.value = item.工段;//工序 obj2.elType = 'primary'; - obj2.value = item.material_out_.name; + obj2.value = item.物料名称; obj3.elType = 'primary'; - obj3.value = item.material_out_.specification; + obj3.value = item.型号; obj4.elType = 'primary'; - obj4.value = item.count; + obj4.value = item.计划数; obj5.elType = 'primary'; - obj5.value = item.count_ok; + obj5.value = item.合格数; obj6.elType = 'progress'; - let jindu = Math.round((item.count_ok/item.count)*100); + let jindu = Math.round((item.完成进度) * 100); obj6.value = jindu; obj7.elType = 'primary'; - let rate = 0; - if(item.count_real!=0){ - rate = Math.round((item.count_ok/item.count_real)*100); - }else{ - rate = 0; - } + let rate = Math.round((item.合格率) * 100); obj7.value = rate; arr.push(obj1); arr.push(obj2); @@ -448,105 +465,140 @@ export default { arr.push(obj6); arr.push(obj7); processData.push(arr); - }); - console.log('processData',processData) + console.log('processData', processData) this.processData = processData; } - debugger; - }); + + }) + + // let obj = {}; + // obj.start_date = this.weekFirst; + // obj.end_date = this.weekLast; + // obj.mgroup__belong_dept__name = '6车间'; + // obj.page = 0; + // that.$API.pm.mtask.list.req(obj).then((res) => { + // console.log(res); + // if (res.length > 0) { + // let processData = []; + // res.forEach(item => { + // let arr = [], obj1 = {}, obj2 = {}, obj3 = {}, obj4 = {}, obj5 = {}, obj6 = {}, obj7 = {}, obj8 = {}; + // obj1.elType = 'primary'; + // obj1.value = item.mgroup_name;//工序 + // obj2.elType = 'primary'; + // obj2.value = item.material_out_.name; + // obj3.elType = 'primary'; + // obj3.value = item.material_out_.specification; + // obj4.elType = 'primary'; + // obj4.value = item.count; + // obj5.elType = 'primary'; + // obj5.value = item.count_ok; + // obj6.elType = 'progress'; + // let jindu = Math.round((item.count_ok / item.count) * 100); + // obj6.value = jindu; + // obj7.elType = 'primary'; + // let rate = 0; + // if (item.count_real != 0) { + // rate = Math.round((item.count_ok / item.count_real) * 100); + // } else { + // rate = 0; + // } + // obj7.value = rate; + // arr.push(obj1); + // arr.push(obj2); + // arr.push(obj3); + // arr.push(obj4); + // arr.push(obj5); + // arr.push(obj6); + // arr.push(obj7); + // processData.push(arr); + + // }); + // console.log('processData', processData) + // this.processData = processData; + // } + // debugger; + // }); }, //本月生产统计&本月交付统计 - getsaleOut(){ + getsaleOut() { let that = this; - let obj ={ - query: {start_date:this.start_date,end_date:this.end_date,dept_name: "6车间"}, + let obj = { + query: { start_date: this.start_date, end_date: this.end_date, dept_name: "6车间" }, }; - let obj2 ={ - query: {start_date:this.start_date,end_date:this.end_date,mio_type: 'sale_out',material_id:''}, + let obj2 = { + query: { start_date: this.start_date, end_date: this.end_date, mio_type: 'sale_out', material_id: '' }, }; //生产车间按日统计 that.$API.bi.dataset.exec.req('productStatistic', obj).then((res1) => { - console.log('生产车间按日统计:',res1); + console.log('生产车间按日统计:', res1); let list1 = res1.data2.ds0; - let seriesData11 = [],seriesData12 = [],xAxisData1=[],bangArr=[],guanArr=[]; + let seriesData11 = [], seriesData12 = [], xAxisData1 = [], bangArr = [], guanArr = []; for (let i = 0; i < that.days; i++) { - let day = i+1; - let text = day+'日'; - xAxisData1[i]=text; + let day = i + 1; + let text = day + '日'; + xAxisData1[i] = text; seriesData11.push(0); seriesData12.push(0); } - if(list1.length>0){ - list1.forEach(item1=>{ - if(item1.name=='光纤预制管'){ + if (list1.length > 0) { + list1.forEach(item1 => { + if (item1.name == '光纤预制管') { guanArr.push(item1) - }else{ + } else { bangArr.push(item1) } - }) + }) } - if(bangArr.length>0){ - bangArr.forEach(item11=>{ - let index11 = item11.日-1; + if (bangArr.length > 0) { + bangArr.forEach(item11 => { + let index11 = item11.日 - 1; seriesData11[index11] = item11.生产数; }) } - if(guanArr.length>0){ - guanArr.forEach(item12=>{ - let index12 = item12.日-1; + if (guanArr.length > 0) { + guanArr.forEach(item12 => { + let index12 = item12.日 - 1; seriesData12[index12] = item12.生产数; }) } let chart1Option = deepCopy(this.basicOption) chart1Option.xAxis.data = xAxisData1; - chart1Option.series[0].data=seriesData11; - chart1Option.series[1].data=seriesData12; - let chart1 = this.setChart("chart1", chart1Option); - // let index1 = 0 - // this.chartInterval1 = setInterval(function () { - // if (index1 < chart1Option.series[0].data.length) { - // chart1.dispatchAction({ type: 'downplay', seriesIndex: 0 }); - // chart1.dispatchAction({ type: 'highlight', seriesIndex: 0, dataIndex: index2 }); - // chart1.dispatchAction({ type: 'showTip', seriesIndex: 0, dataIndex: index2 }); - // index1++; - // } else { - // index1 = 0; - // } - // }, 3000); - // debugger; + chart1Option.series[0].data = seriesData11; + chart1Option.series[1].data = seriesData12; + this.setChart("chart1", chart1Option); }); //本月交付统计 that.$API.bi.dataset.exec.req('saleOutDay', obj2).then((saleOutRes) => { - console.log('本月交付统计:',saleOutRes); - let seriesData21 = [],seriesData22 = [],xAxisData2=[],bangArr2=[],guanArr2=[]; + console.log('本月交付统计:', saleOutRes); + let seriesData21 = [], seriesData22 = [], xAxisData2 = [], bangArr2 = [], guanArr2 = []; let list2 = saleOutRes.data2.ds0; for (let i = 0; i < that.days; i++) { - let day = i+1; - let text = day+'日'; - xAxisData2[i]=text; + let day = i + 1; + let text = day + '日'; + xAxisData2[i] = text; seriesData21.push(0); seriesData22.push(0); } - if(list2.length>0){ - list2.forEach(item2=>{ - if(item2.name=='光纤预制管'){ + if (list2.length > 0) { + list2.forEach(item2 => { + if (item2.name == '光纤预制管') { guanArr2.push(item2) - }else{ + } else { bangArr2.push(item2) } - }) + }) } - if(bangArr2.length>0){ - bangArr2.forEach(item21=>{ - let index21 = item21.日-1; + if (bangArr2.length > 0) { + bangArr2.forEach(item21 => { + let index21 = item21.日 - 1; seriesData21[index21] = item21.生产数; }) } - if(guanArr2.length>0){ - guanArr2.forEach(item22=>{ - let index22 = item22.日-1; + if (guanArr2.length > 0) { + guanArr2.forEach(item22 => { + let index22 = item22.日 - 1; seriesData22[index22] = item22.生产数; }) } @@ -554,120 +606,127 @@ export default { chart2Option.series[0].type = 'line'; chart2Option.series[1].type = 'line'; chart2Option.xAxis.data = xAxisData2; - - chart2Option.series[0].data=seriesData21; - chart2Option.series[0].label.position='top'; - chart2Option.series[1].data=seriesData22; - chart2Option.series[1].label.position='top'; - let chart2 = this.setChart("chart2", chart2Option); - // let index2 = 0 - // this.chartInterval2 = setInterval(function () { - // if (index2 < chart2Option.series[0].data.length) { - // chart2.dispatchAction({ type: 'downplay', seriesIndex: 0 }); - // chart2.dispatchAction({ type: 'highlight', seriesIndex: 0, dataIndex: index2 }); - // chart2.dispatchAction({ type: 'showTip', seriesIndex: 0, dataIndex: index2 }); - // index2++; - // } else { - // index2 = 0; - // } - // }, 3000); - // debugger; + chart2Option.series[0].data = seriesData21; + chart2Option.series[0].label.position = 'top'; + chart2Option.series[1].data = seriesData22; + chart2Option.series[1].label.position = 'top'; + + this.setChart("chart2", chart2Option); }); }, - + }, - + } \ No newline at end of file diff --git a/src/views/bigScreen/index_7dept.vue b/src/views/bigScreen/index_7dept.vue index 066aeb37..3a1281e0 100644 --- a/src/views/bigScreen/index_7dept.vue +++ b/src/views/bigScreen/index_7dept.vue @@ -2,24 +2,28 @@
7车间生产数据大看板
-
{{currentDay}}{{ currentTime }}
+
{{ currentDay }}{{ currentTime }}
-
+
今日任务
-
-
- {{item.material_out_name}} - - {{item.count}} - +
+
+
+ {{ item.material_out_name }} + + {{ item.count }} + +
+
-
@@ -31,7 +35,7 @@
-
@@ -45,8 +49,8 @@
- +
@@ -92,12 +96,12 @@ function deepCopy(obj) { return JSON.parse(JSON.stringify(obj)); } export default { - components: {scScrollTavle}, + components: { scScrollTavle }, data() { return { basicOption: { backgroundColor: '', - + tooltip: { trigger: 'axis', axisPointer: { @@ -118,7 +122,7 @@ export default { color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [ { offset: 0, - color: 'rgb(250,205,0)' + color: 'rgb(250,205,0)' }, { offset: 1, @@ -139,7 +143,7 @@ export default { xAxis: { type: 'category', boundaryGap: true, - data: ['1号炉','2号炉', '3号炉', '4号炉', '5号炉', '6号炉', '7号炉', '8号炉'], + data: ['1号炉', '2号炉', '3号炉', '4号炉', '5号炉', '6号炉', '7号炉', '8号炉'], nameTextStyle: { color: '#ffffff' }, @@ -169,7 +173,7 @@ export default { lineStyle: { width: 1, color: 'rgb(1,235,239)' }, - barWidth:30, + barWidth: 30, showSymbol: false, areaStyle: { opacity: 0.8, @@ -190,7 +194,7 @@ export default { label: { show: true, position: 'top', - color:'#fff' + color: '#fff' }, itemStyle: { borderRadius: [2, 2, 0, 0], @@ -205,16 +209,16 @@ export default { } ]) }, - data: [140, 232, 101, 264, 90, 340, 250,140, 232, 101, 264, 90, 340, 250,140, 232, 101, 264, 90, 340, 250,140, 232, 101, 264, 90, 340, 250, 340, 250] + data: [140, 232, 101, 264, 90, 340, 250, 140, 232, 101, 264, 90, 340, 250, 140, 232, 101, 264, 90, 340, 250, 140, 232, 101, 264, 90, 340, 250, 340, 250] }] }, - chart3Option:{ + chart3Option: { backgroundColor: '', tooltip: { trigger: 'item' }, legend: { - top:'bottom', + top: 'bottom', }, series: { name: '完成率', @@ -234,34 +238,34 @@ export default { ], emphasis: { itemStyle: { - shadowBlur: 10, - shadowOffsetX: 0, - shadowColor: 'rgba(0, 0, 0, 0.5)' + shadowBlur: 10, + shadowOffsetX: 0, + shadowColor: 'rgba(0, 0, 0, 0.5)' } } } }, - containerHeight1:100, - containerHeight2:100, - table1Visible:false, - table2Visible:false, - refValue1:'moocBox1', - refValue2:'moocBox2', - liData1: ['序号', '型号', '完成进度', '产量', '状态'], - processData:[], - liData2: ['序号', '炉号','产品名称', '型号', '规格', '最近产量','锅数','设备状态'], - lineData:[], - todayMtask:[], - time: null, + containerHeight1: 100, + containerHeight2: 100, + table1Visible: false, + table2Visible: false, + refValue1: 'moocBox1', + refValue2: 'moocBox2', + liData1: ['序号', '型号', '完成进度', '产量', '状态'], + processData: [], + liData2: ['序号', '炉号', '产品名称', '型号', '规格', '最近产量', '锅数', '设备状态'], + lineData: [], + todayMtask: [], + time: null, delay: 20, - dayInterval:null, - days:30, - today:'', - start_date:'', - end_date:'', - currentTime:'', - currentDay:'', - yesterday:'', + dayInterval: null, + days: 30, + today: '', + start_date: '', + end_date: '', + currentTime: '', + currentDay: '', + yesterday: '', chartInterval1: null, chartInterval2: null, chartInterval3: null, @@ -276,30 +280,30 @@ export default { this.table2Visible = true; let date = new Date(); let year = date.getFullYear(); - let month = date.getMonth()+1; + let month = date.getMonth() + 1; let day = date.getDate(); let days = new Date(year, month, 0).getDate(); this.days = days; - let start_date = year+'-'+month+'-01'; + let start_date = year + '-' + month + '-01'; let lastDay = new Date(year, month, 0).getDate(); - let end_date = year+'-'+month+'-'+lastDay; + let end_date = year + '-' + month + '-' + lastDay; this.start_date = start_date; this.end_date = end_date; - this.today = year+'-'+month+'-'+day; - let yesterday = new Date(date.getTime()-24*60*60*1000); - this.yesterday = yesterday.getFullYear()+"-" + (yesterday.getMonth()+1) + "-" + yesterday.getDate(); + this.today = year + '-' + month + '-' + day; + let yesterday = new Date(date.getTime() - 24 * 60 * 60 * 1000); + this.yesterday = yesterday.getFullYear() + "-" + (yesterday.getMonth() + 1) + "-" + yesterday.getDate(); this.getProductLine(); this.getUtask(); this.getTodayMtask(); this.getLineData(); //时间 this.showTime() - this.dayInterval = setInterval(()=>{ + this.dayInterval = setInterval(() => { this.showTime() - },1000) + }, 1000) }, methods: { - showTime(){ + showTime() { this.currentTime = this.$TOOL.dateFormat(new Date(), 'hh:mm:ss') this.currentDay = this.$TOOL.dateFormat(new Date(), 'yyyy年MM月dd日') }, @@ -319,22 +323,22 @@ export default { }, 500) }, //任务进度 - getUtask(){ + getUtask() { let that = this; - let obj ={}; + let obj = {}; obj.start_date__gte = this.start_date; obj.end_date__lte = this.end_date; - obj.belong_dept__name='7车间'; - obj.page=0; + obj.belong_dept__name = '7车间'; + obj.page = 0; that.$API.pm.utask.list.req(obj).then((res) => { - console.log('任务进度:',res); + console.log('任务进度:', res); let processData = []; res.forEach(item => { - let arr = [],obj1 = {},obj2 = {},obj3 = {},obj4 = {}; + let arr = [], obj1 = {}, obj2 = {}, obj3 = {}, obj4 = {}; obj1.elType = 'primary'; obj1.value = item.material_.specification; obj2.elType = 'progress'; - let process = Math.round((item.count_ok/item.count)*100) + let process = Math.round((item.count_ok / item.count) * 100) obj2.value = process; obj3.elType = 'primary'; obj3.value = item.count_ok; @@ -350,17 +354,17 @@ export default { }); }, //7车间生产按炉进度 - getLineData(){ + getLineData() { let that = this; that.$API.bi.dataset.exec.req('linedept7', {}).then((res) => { - console.log('7车间生产线:',res); + console.log('7车间生产线:', res); let list = res.data2.ds0; - if(list.length>0){ + if (list.length > 0) { let lineData = []; list.forEach(item => { - let arr = [],obj1 = {},obj2 = {},obj3 = {},obj4 = {},obj5 = {},obj6 = {},obj7 = {}; + let arr = [], obj1 = {}, obj2 = {}, obj3 = {}, obj4 = {}, obj5 = {}, obj6 = {}, obj7 = {}; obj1.elType = 'primary'; - obj1.value = item.equip_name;//炉号 + obj1.value = item.equip_name + '|' + item.equip_number;//炉号 obj2.elType = 'primary'; obj2.value = item.material_name; obj3.elType = 'primary'; @@ -388,62 +392,50 @@ export default { }); }, //生产线 - getProductLine(){ + getProductLine() { let that = this; //本月生产统计 - let obj1 ={ - query: {start_date:that.start_date,end_date:that.end_date}, + let obj1 = { + query: { start_date: that.start_date, end_date: that.end_date }, }; that.$API.bi.dataset.exec.req('stoveStatics', obj1).then((res1) => { - console.log('本月生产统计:',res1); + console.log('本月生产统计:', res1); let list1 = res1.data2.ds0; - let seriesData1 = [],xAxisData1=[]; - if(list1.length>0){ - list1.forEach(item1=>{ - xAxisData1.push(item1.equip_name); + let seriesData1 = [], xAxisData1 = []; + if (list1.length > 0) { + list1.forEach(item1 => { + xAxisData1.push(item1.equip_number); seriesData1.push(item1.count_real); - }) + }) } let chart1Option = deepCopy(this.basicOption) chart1Option.xAxis.data = xAxisData1; chart1Option.series[0].data = seriesData1; - // chart1Option.yAxis.name='生产数'; let chart1 = that.setChart("chart1", chart1Option); - // let index1 = 0 - // this.chartInterval1 = setInterval(function () { - // if (index1 < seriesData1.length) { - // chart1.dispatchAction({ type: 'downplay', seriesIndex: 0 }); - // chart1.dispatchAction({ type: 'highlight', seriesIndex: 0, dataIndex: index1 }); - // chart1.dispatchAction({ type: 'showTip', seriesIndex: 0, dataIndex: index1 }); - // index1++; - // } else { - // index1 = 0; - // } - // }, 3000); }); //本月合格率统计 - let obj2 ={ - query: {start_date:that.start_date,end_date:that.end_date,dept_name: "7车间"}, + let obj2 = { + query: { start_date: that.start_date, end_date: that.end_date, dept_name: "7车间" }, }; that.$API.bi.dataset.exec.req('lineDay', obj2).then((res2) => { - console.log('本月合格率统计:',res2); + console.log('本月合格率统计:', res2); let list2 = res2.data2.ds0; - let seriesData2 = [],xAxisData2=[]; + let seriesData2 = [], xAxisData2 = []; for (let i = 0; i < that.days; i++) { - let day = i+1; - let text = day+'日'; - xAxisData2[i]=text; - seriesData2[i]=0; + let day = i + 1; + let text = day + '日'; + xAxisData2[i] = text; + seriesData2[i] = 0; } - if(list2.length>0){ - list2.forEach(item2=>{ - let index2 = item2.日-1; - seriesData2[index2] =Math.round(item2.合格率); - }) + if (list2.length > 0) { + list2.forEach(item2 => { + let index2 = item2.日 - 1; + seriesData2[index2] = Math.round(item2.合格率); + }) } let chart2Option = deepCopy(this.basicOption); chart2Option.xAxis.data = xAxisData2; - chart2Option.yAxis.name='合格率'; + chart2Option.yAxis.name = '合格率'; chart2Option.legend = { icon: "stack", right: 0, @@ -467,7 +459,7 @@ export default { } }], }; - let series2=[{ + let series2 = [{ name: '合格率', type: 'line', smooth: true, @@ -494,183 +486,180 @@ export default { label: { show: true, position: 'top', - color:'#fff' + color: '#fff' }, itemStyle: { - borderRadius: [2, 2, 0, 0], - color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [ - { - offset: 0, - color: 'rgb(250,205,0)' - }, - { - offset: 1, - color: 'rgb(254,129,0)' - } - ]) - }, - data: seriesData2 + borderRadius: [2, 2, 0, 0], + color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [ + { + offset: 0, + color: 'rgb(250,205,0)' + }, + { + offset: 1, + color: 'rgb(254,129,0)' + } + ]) + }, + data: seriesData2 }]; - chart2Option.series=series2; + chart2Option.series = series2; let chart2 = that.setChart("chart2", chart2Option); - // let index2 = 0 - // this.chartInterval2 = setInterval(function () { - // if (index2 < seriesData2.length) { - // chart2.dispatchAction({ type: 'downplay', seriesIndex: 0 }); - // chart2.dispatchAction({ type: 'highlight', seriesIndex: 0, dataIndex: index2 }); - // chart2.dispatchAction({ type: 'showTip', seriesIndex: 0, dataIndex: index2 }); - // index2++; - // } else { - // index2 = 0; - // } - // }, 3000); }); - + //车间生产昨日统计 12月1号 - let obj3 ={ - query: {start_date:that.yesterday,end_date:that.yesterday,dept_name: "7车间"}, + let obj3 = { + query: { start_date: that.yesterday, end_date: that.yesterday, dept_name: "7车间" }, }; that.$API.bi.dataset.exec.req('lineDay', obj3).then((res3) => { - console.log('车间生产昨日统计:',res3); + console.log('车间生产昨日统计:', res3); let seriesData3 = [ - { value: 0, name: '炸纹' }, - { value: 0, name: '条纹' }, - { value: 0, name: '气泡' }, - { value: 0, name: '弯曲' }, - { value: 0, name: '其他' }, - { value: 0, name: '合格' }, - ] - if(res3.data2.ds0.length>0){ + { value: 0, name: '炸纹' }, + { value: 0, name: '条纹' }, + { value: 0, name: '气泡' }, + { value: 0, name: '弯曲' }, + { value: 0, name: '其他' }, + { value: 0, name: '合格' }, + ] + if (res3.data2.ds0.length > 0) { let item3 = res3.data2.ds0[0]; that.yesterdayObjet = item3; - seriesData3[0].value=item3.炸纹; - seriesData3[1].value=item3.条纹; - seriesData3[2].value=item3.气泡; - seriesData3[3].value=item3.弯曲; - seriesData3[4].value=item3.其他; - seriesData3[5].value=item3.合格数; + seriesData3[0].value = item3.炸纹; + seriesData3[1].value = item3.条纹; + seriesData3[2].value = item3.气泡; + seriesData3[3].value = item3.弯曲; + seriesData3[4].value = item3.其他; + seriesData3[5].value = item3.合格数; } - that.chart3Option.series.data = seriesData3; + that.chart3Option.series.data = seriesData3; let chart3 = that.setChart("chart3", that.chart3Option); - // let index3 = 0 - // this.chartInterval3 = setInterval(function () { - // if (index3 < seriesData3.length) { - // chart3.dispatchAction({ type: 'downplay', seriesIndex: 0 }); - // chart3.dispatchAction({ type: 'highlight', seriesIndex: 0, dataIndex: index3 }); - // chart3.dispatchAction({ type: 'showTip', seriesIndex: 0, dataIndex: index3 }); - // index3++; - // } else { - // index3 = 0; - // } - // }, 3000); }); }, //今日任务 - getTodayMtask(){ + getTodayMtask() { let that = this; - let obj ={}; + let obj = {}; obj.start_date = this.today; obj.end_date = this.today; - obj.belong_dept__name='7车间'; - obj.page=0; + obj.mgroup__belong_dept__name = '7车间'; + obj.page = 0; that.$API.pm.mtask.list.req(obj).then((res) => { - that.todayMtask=res; - console.log('今日任务:',res); + that.todayMtask = res; + console.log('今日任务:', res); }); }, }, - + } \ No newline at end of file diff --git a/src/views/bigScreen/index_photon.vue b/src/views/bigScreen/index_photon.vue index bc9fe8ee..3174e795 100644 --- a/src/views/bigScreen/index_photon.vue +++ b/src/views/bigScreen/index_photon.vue @@ -120,7 +120,10 @@

{{ dialogData.deptName }}

-
+
+ +
+
{{ dialogData.percentage }}% @@ -129,8 +132,7 @@
-

昨日产量

- +

昨日产量

@@ -148,6 +150,10 @@

{{ dialogData.count }}kg

+
+

+ 公司秉承“善用资源,服务建设”的核心理念,践行“材料创造美好世界”的企业使命,坚持“创新、绩效、和谐、责任”的核心价值观,努力成长为具有创新精神和全球视野的光子材料领先企业。

+
@@ -160,7 +166,10 @@

{{ currentData.deptName }}

-
+
+ +
+
{{ currentData.percentage }}% @@ -169,8 +178,7 @@
-

昨日产量

- +

昨日产量

@@ -190,6 +198,9 @@

{{ currentData.count }}kg

+
+

公司秉承“善用资源,服务建设”的核心理念,践行“材料创造美好世界”的企业使命,坚持“创新、绩效、和谐、责任”的核心价值观,努力成长为具有创新精神和全球视野的光子材料领先企业。

+
@@ -416,7 +427,7 @@ export default { let cDate = new Date(); let yesterday = new Date(cDate.getTime() - ondDayTime); let week = yesterday.getDay();//当前时间的week数 - console.log(week); + // console.log(week); let weekFirst = week - 1;//第一天对应的天数 let weekLast = 7 - week;//最后一天对应的天数 if (week == 0) { @@ -686,7 +697,7 @@ export default { let countOkDept10 = [0, 0, 0, 0, 0, 0, 0], countRateDept10 = [0, 0, 0, 0, 0, 0, 0]; let countOk_dept10 = 0; if (list.length > 0) { - console.log(this.weekDateList) + // console.log(this.weekDateList) list.forEach(item => { let index = that.weekDateList.indexOf(item.日); countOkDept10[index] = item.合格数; @@ -861,7 +872,7 @@ export default { }); } that.taskBoard.data = data; - console.log('getMaterialList', data) + // console.log('getMaterialList', data) }) }, showTime() { @@ -1074,7 +1085,7 @@ export default { const pickResult = scene.pick(scene.pointerX, scene.pointerY); if (pickResult.hit) { const mesh = pickResult.pickedMesh; - console.log('mesh', mesh) + // console.log('mesh', mesh) if (that.nodesLists[mesh.name]) { that.getDeptClickData(that.nodesLists[mesh.name]) hl1Click.removeAllMeshes(); @@ -1119,7 +1130,7 @@ export default { }, getDeptData(name) { this.infoVisibel = true; - console.log('hoverName', name) + // console.log('hoverName', name) if (name == '光学精密加工车间') { //6 this.dialogData = this.dept6Obj; } else if (name == '光纤预制棒生产车间') {//7 @@ -1131,7 +1142,7 @@ export default { } }, getDeptClickData(name) { - console.log('clickName', name) + // console.log('clickName', name) if (name == '光学精密加工车间') { //6 this.currentData = this.dept6Obj; } else if (name == '光纤预制棒生产车间') {//7 @@ -1849,7 +1860,7 @@ export default { .inforBlock.clickBlock { left: 50%; - width: 630px; + width: 520px; height: 225px; padding: 40px; font-size: 16px;