diff --git a/.env.development b/.env.development index 83d707b6..fccc0642 100644 --- a/.env.development +++ b/.env.development @@ -16,14 +16,17 @@ VUE_APP_PJ = '' # VUE_APP_API_BASEURL = http://127.0.0.1:2226/api #测试环境 - VUE_APP_API_BASEURL = http://10.50.211.228:2250/api +# VUE_APP_API_BASEURL = http://10.50.211.228:2250/api #VUE_APP_API_BASEURL = http://127.0.0.1:2226/api + VUE_APP_BASEURL = http://10.50.211.228:2250/ + +# VUE_APP_BASEURL = http://10.50.211.228:2250 #VUE_APP_BASEURL = http://127.0.0.1:2226 # #光子 -# VUE_APP_API_BASEURL = http://49.232.14.174:2250/api -# VUE_APP_BASEURL = http://49.232.14.174:2250 +VUE_APP_API_BASEURL = http://49.232.14.174:2226/api +VUE_APP_BASEURL = http://49.232.14.174:2226 # 本地端口 VUE_APP_PORT = 2800 diff --git a/src/api/model/wpm.js b/src/api/model/wpm.js index bbb0c48a..fe465d05 100644 --- a/src/api/model/wpm.js +++ b/src/api/model/wpm.js @@ -417,4 +417,18 @@ export default { return await http.post("http://localhost:8080/prints/", data); }, }, + ana:{ + equipLastMlog:{ + name: "设备状态列表", + req: async function (data) { + return await http.post(`${config.API_URL}/wpm/ana/equip_last_mlog/`, data); + }, + }, + put_prod:{ + name: "统计值", + req: async function (data) { + return await http.post(`${config.API_URL}/wpm/ana/put_prod/`, data); + }, + }, + }, }; diff --git a/src/views/bigScreen/index_heihuadept.vue b/src/views/bigScreen/index_heihuadept.vue index a6be8cfd..e37a867b 100644 --- a/src/views/bigScreen/index_heihuadept.vue +++ b/src/views/bigScreen/index_heihuadept.vue @@ -7,44 +7,47 @@ - - - - 昨日黑化合格统计 - - - - - {{ item.物料名 }} - {{item.合格数}} - - - - - + - 昨日黑化不合格统计 + 黑化设备 + + + + 保温中 + {{hh.bw}}台 + + + + 冷却中 + {{hh.lq}}台 + + + + 未运行 + {{hh.wyx}}台 + + + + 故障 + {{hh.gz}}台 - + + + + - + 黑化任务进度 - + @@ -52,67 +55,106 @@ - - - - 昨日退火合格统计 - - - - - - {{ item.物料名 }} - {{item.合格数}} - - - - - + - 昨日退火不合格统计 + 退火设备 + + + + 保温中 + {{th.bw}}台 + + + + 冷却中 + {{th.lq}}台 + + + + 未运行 + {{th.wyx}}台 + + + + 故障 + {{th.gz}}台 - + + + + - + 退火任务进度 - + - - + - + - 黑化车间本月合格数统计 + 投产分析(2:00 — 次日2:00) - + + 昨日退火投产统计 + 今日退火投产预测 + 明日退火投产预测 + + + {{ tcfx.yesterday }} + {{ tcfx.today }} + {{ tcfx.tomorrow }} + + - + - 黑化车间本月合格率统计 + 生产分析(8:00 — 次日8:00) - + + 昨日黑化进炉统计 + 昨日退火进炉统计 + + + {{ sctj_ysetday.hh }} + {{ sctj_ysetday.th }} + + + + + + + + 库存统计 + + + 待黑化片 + 黑化中 + 退火中 + 退火合格数 + + + {{ kctj.dhh }} + {{ kctj.hhz }} + {{ kctj.thz }} + {{ kctj.thok }} + + @@ -239,7 +281,7 @@ export default { }, series: [ { - name: "黑化", + name: "今日统计", type: "bar", // stack: "Ad", barWidth: 10, @@ -270,34 +312,11 @@ export default { ] ), }, - areaStyle: { - opacity: 0.8, - color: new echarts.graphic.LinearGradient( - 0, - 0, - 0, - 1, - [ - { - offset: 0, - color: "rgb(250,205,0)", - }, - { - offset: 1, - color: "rgb(254,129,0)", - }, - ] - ), - }, - smooth: true, - // lineStyle: { - // width: 1, - // color: "rgb(1,235,239)", - // }, + data: [], }, { - name: "退火", + name: "", type: "bar", // stack: "Ad", barWidth: 10, @@ -328,144 +347,136 @@ export default { ] ), }, - areaStyle: { - opacity: 0.8, - color: new echarts.graphic.LinearGradient( - 0, - 0, - 0, - 1, - [ - { - offset: 0, - color: "rgb(1,235,239)", - }, - { - offset: 1, - color: "rgb(5, 158, 163)", - }, - ] - ), - }, - smooth: true, - // lineStyle: { - // width: 1, - // color: "rgb(1,235,239)", - // }, - data: [10,50,80,60,65,58,70,80,90,100,110,120], + data: [], }, ], }, - pieOption: { - backgroundColor: "", - tooltip: { - trigger: "item", - }, - legend: { - top: "bottom", - }, - series: { - name: "不合格统计", - type: "pie", - radius: "50%", - itemStyle: { - borderRadius: 2, - }, - center: ["50%", "45%"], - data: [ - { value: 0, name: "划伤" }, - { value: 0, name: "气泡" }, - { value: 0, name: "水纹" }, - { value: 0, name: "崩边" }, - { value: 0, name: "雾面" }, - { value: 0, name: "麻点" }, - { value: 0, name: "线痕" }, - { value: 0, name: "破损" }, - { value: 0, name: "其他" }, - ], - emphasis: { - itemStyle: { - shadowBlur: 10, - shadowOffsetX: 0, - shadowColor: "rgba(0, 0, 0, 0.5)", - }, - }, - }, - }, tableHeight: 100, - table1Visible: false, - table2Visible: false, - refValue1: "moocBox1", - refValue2: "moocBox2", - liData: ["序号","产出名称","规格","型号","开始时间","结束时间","完成进度","产量","状态"], - processData1: [], - processData2: [], - todayMtask: [], speed: 2000, - myScroll: null, - iliHeight: 30, time: null, - delay: 20, - start_date: "", - end_date: "", - yesterday: "", + hh:{ + bw:0, + lq:0, + wyx:0, + gz:0, + }, + th:{ + bw:0, + lq:0, + wyx:0, + gz:0, + }, + sctj_ysetday:{ + hh:0, + th:0 + }, + tcfx:{ + yesterday:0, + today:0, + tomorrow:0, + + }, + kctj:{ + dhh:0, + hhz:0, + thz:0, + thok:0, + }, dayInterval: null, - chartInterval1: null, chartInterval2: null, - chartInterval3: null, - stateOption: { - 30: "生产中", - 40: "已完成", + configData:{ + header:['物料名称','批次号','数量'], + headerBGC:'#0a3f44', + headerHeight:40, + align:'center', + data:[], + // carousel:'page', + waitTime:1000, + // columnWidth: [,,50] + }, + configData1:{ + headerBGC:'#0a3f44', + header:['产出名称','规格','型号','开始时间','结束时间','完成进度','产量','状态'], + headerHeight:40, + data:[] + }, + configData2:{ + headerBGC:'#0a3f44', + header:['产出名称','规格','型号','开始时间','结束时间','完成进度','产量','状态'], + headerHeight:40, + data:[] + }, + configData01:{ + headerBGC:'#0a3f44', + header:['设备名称','设备编号','设备状态','生产进度','物料数量','保温剩余时间'], + headerHeight:40, + data:[] + }, + configData02:{ + headerBGC:'#0a3f44', + header:['设备名称','设备编号','设备状态','生产进度','物料数量','保温剩余时间'], + headerHeight:40, + data:[] }, currentTime: "", currentDay: "", today: "", - yesterdayObjet: {}, - yesHeihuaData:[ - {年: 2024, 月: 7, 日: 5, 物料名: "CNC_黑化", 生产数: 260, 合格数: 240, 不合格数: 0, 划伤: 0, 气泡: 0, 水纹: 0, 崩边: 0, 雾面: 0,麻点:0}, - ], - yesTuihuoData:[ - {年: 2024, 月: 7, 日: 5, 物料名: "CNC_退火", 生产数: 250, 合格数: 240, 不合格数: 0, 划伤: 0, 气泡: 0, 水纹: 0, 崩边: 0, 雾面: 0,麻点:0}, - ], + end_time:'', + start_time:'', }; }, mounted() { //表格table的高度 this.tableHeight = document.getElementById("scrollContainer").clientHeight; - this.table1Visible = true; - this.table2Visible = true; - this.showTime(); this.dayInterval = setInterval(() => { this.showTime(); }, 1000); - let date = new Date(); - let year = date.getFullYear(); - let month = date.getMonth() + 1; - let day = date.getDate(); - let days = new Date(year, month, 0).getDate(); - this.days = days; - this.currentYear = year; - this.currentMonth = month; - this.currentDay = day; - month = month < 10 ? "0" + month : month; - this.start_date = year + "-" + month + "-01"; - this.end_date = - year + "-" + month + "-" + new Date(year, month, 0).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.getProductLine1(); - // this.getProductLine2(); - this.getMtask1(); - this.getMtask2(); + //近七天的日期数组 + let daysArr = this.getMondayOfCurrentWeek(); + this.daysArr = daysArr; + let xAxisData = []; + daysArr.forEach((item)=>{ + let dates = item.split('-'); + let obj = dates[1]+'-'+dates[2]; + xAxisData.push(obj); + }) + this.xAxisData = xAxisData; + let startDate = new Date(daysArr[0]).getTime()-(1000*60*60*24); + let endDate = new Date(daysArr[6]).getTime()+(1000*60*60*24); + let start_time = this.$TOOL.dateFormat(new Date(startDate), "yyyy-MM-dd hh:mm:ss"); + let end_time = this.$TOOL.dateFormat(new Date(endDate), "yyyy-MM-dd hh:mm:ss"); + this.start_time = start_time; + this.end_time = end_time; + this.$nextTick(() => { + //设备数据 + this.getEqState1(); + this.getEqState2(); + //任务进度 + this.getMtask1(); + this.getMtask2(); + //投产/生产分析 + this.getProductLine1(); + this.getProductLine2(); + //库存统计 + this.getMaterials(); + //投产分析统计数 + this.getLeftBottomNum(); + //工段生产数量 + this.getMgroupCount(); + }) }, methods: { + getMondayOfCurrentWeek() { + let today = new Date(); + let days = []; + for (let i = 6; i >= 0; i--) { + let date = new Date(today); + date.setDate(today.getDate() - i); + days.push(date.toISOString().split('T')[0]); // 格式化为 YYYY-MM-DD + } + return days; + }, //时间 showTime() { this.currentTime = this.$TOOL.dateFormat(new Date(), "hh:mm:ss"); @@ -475,10 +486,7 @@ export default { ); }, setChart(name, option = null) { - // 根据name 渲染数据, option需填写,否则option为模拟数据 - var myChart = echarts.getInstanceByDom( - document.getElementById(name) - ); + var myChart = echarts.getInstanceByDom(document.getElementById(name)); if (myChart == undefined) { myChart = echarts.init(document.getElementById(name), "dark", { renderer: "svg", @@ -494,96 +502,43 @@ export default { }, 500); return myChart; }, - //黑化合格数统计 + //投产分析 getProductLine1() { let that = this; let obj = { - query: { - start_date: that.start_date, - end_date: that.end_date, - mgroup_name: "黑化", - "group_bys_material": "", - "order_bys_material": "", - "select_cols_material": "", - }, + query: {start_time: that.start_time,end_time: that.end_time}, }; - that.$API.bi.dataset.exec.req("lineDay_m", obj).then((res) => { - console.log("本月黑化生产统计:", res); - let list2 = res.data2.ds0; - let seriesData1 = [], - seriesData2 = [], - seriesData3 = []; - for (let i = 0; i < that.days; i++) { + that.$API.bi.dataset.exec.req("thslrk", obj).then((res) => { + let list = res.data2.ds0; + let seriesData1 = []; + for (let i = 0; i < that.xAxisData.length; i++) { seriesData1[i] = 0; - seriesData2[i] = 0; } - if (list2.length > 0) { - list2.forEach((item2) => { - let index2 = item2.日 - 1; - //合格率=当天的合格数/当天的总生产数 - seriesData1[index2] += item2.合格数; - seriesData2[index2] += item2.生产数; + if (list.length > 0) { + list.forEach((item) => { + let date = item.日期.split("-")[1]+'-'+item.日期.split("-")[2]; + let index = that.xAxisData.indexOf(date); + seriesData1[index] = item.送料数+item.入库数; }); } - for (let i = 0; i < that.days; i++) { - if(seriesData2[i]>0&&seriesData1[i] >=0){ - seriesData3[i] = Math.round(seriesData1[i]/seriesData2[i])*100 ; - }else{ - seriesData3[i]=0; - } - } + that.tcfx.yesterday = seriesData1[5]; let chart1Option = deepCopy(this.basicOption); - let chart2Option = deepCopy(this.basicOption); - - + chart1Option.xAxis.data = that.xAxisData; chart1Option.series[0].data = seriesData1; - chart2Option.series[0].type = 'line'; - chart2Option.series[0].data = seriesData3; - that.getProductLine2(chart1Option,chart2Option); - }); - - //黑化生产昨日统计 - let obj2 = { - query: { - start_date: that.yesterday, - end_date: that.yesterday, - mgroup_name: "黑化", - "group_bys_material": "", - "order_bys_material": "", - "select_cols_material": "", - }, - }; - that.$API.bi.dataset.exec.req("lineDay_m", obj2).then((res2) => { - // console.log("黑化生产昨日统计:", res2); - that.yesHeihuaData = res2.data2.ds0; - let pieOption = deepCopy(that.pieOption); - if (res2.data2.ds0.length > 0) { - res2.data2.ds0.forEach((item) => { - pieOption.series.data[0].value += item.划伤; - pieOption.series.data[1].value += item.气泡; - pieOption.series.data[2].value = item.水纹; - pieOption.series.data[3].value = item.崩边; - pieOption.series.data[4].value = item.雾面; - pieOption.series.data[5].value = item.麻点; - pieOption.series.data[5].value = item.线痕; - pieOption.series.data[5].value = item.破损; - pieOption.series.data[5].value = item.其他; - }); - } - let pieChart1 = this.setChart("pieChart1", pieOption); + let chart1 = this.setChart("chart1", chart1Option); let index1 = 0; - this.chartInterval3 = setInterval(function () { - if (index1 < that.pieOption.series.data.length) { - pieChart1.dispatchAction({ + this.chartInterval2 = setInterval(function () { + if (index1 < chart1Option.series[0].data.length) { + chart1.dispatchAction({ type: "downplay", seriesIndex: 0, }); - pieChart1.dispatchAction({ + chart1.dispatchAction({ type: "highlight", seriesIndex: 0, dataIndex: index1, }); - pieChart1.dispatchAction({ + chart1.dispatchAction({ type: "showTip", seriesIndex: 0, dataIndex: index1, @@ -593,64 +548,41 @@ export default { index1 = 0; } }, 3000); - debugger; }); }, - //退火合格数统计 - getProductLine2(chart1Option,chart2Option) { + //生产分析 + getProductLine2() { let that = this; let obj = { - query: { - start_date: that.start_date, - end_date: that.end_date, - mgroup_name: "退火", - "group_bys_material": "", - "order_bys_material": "", - "select_cols_material": "", - }, + query: {start_time: that.start_time,end_time: that.end_time}, }; - that.$API.bi.dataset.exec.req("lineDay_m", obj).then((res) => { - // console.log("本月退火生产统计:", res); + that.$API.bi.dataset.exec.req("jltj", obj).then((res) => { let list = res.data2.ds0; - let seriesData1 = [], - seriesData2 = [], - seriesData3 = [], - xAxisData = []; - for (let i = 0; i < that.days; i++) { - let day = i + 1; - let text = day + "日"; - xAxisData[i] = text; + let seriesData1 = [],seriesData2 = []; + for (let i = 0; i < that.xAxisData.length; i++) { seriesData1[i] = 0; seriesData2[i] = 0; } if (list.length > 0) { - list.forEach((item2) => { - let index2 = item2.日 - 1; - seriesData1[index2] += item2.合格数; - seriesData2[index2] += item2.生产数; + list.forEach((item) => { + let date = item.日期.split("-")[1]+'-'+item.日期.split("-")[2]; + let index = that.xAxisData.indexOf(date); + seriesData1[index] = item.黑化数; + seriesData2[index] = item.退火数; }); } - for (let i = 0; i < that.days; i++) { - if(seriesData2[i]>0&&seriesData1[i] >=0){ - seriesData3[i] = Math.round(seriesData1[i]/seriesData2[i])*100 ; - }else{ - seriesData3[i]=0; - } - } - chart1Option.xAxis.data = xAxisData; - chart2Option.xAxis.data = xAxisData; - - - chart1Option.series[1].data = seriesData1; - chart2Option.series[1].type = 'line'; - chart2Option.series[1].data = seriesData3; - - let chart1 = this.setChart("chart1", chart1Option); + that.sctj_ysetday.hh = seriesData1[5]; + that.sctj_ysetday.th = seriesData2[5]; + let chart2Option = deepCopy(this.basicOption); + chart2Option.xAxis.data = that.xAxisData; + chart2Option.series[0].name = '黑化数'; + chart2Option.series[1].name = '退火数'; + chart2Option.series[0].data = seriesData1; + chart2Option.series[1].data = seriesData2; let chart2 = this.setChart("chart2", chart2Option); - let index2 = 0; this.chartInterval2 = setInterval(function () { - if (index2 < chart1Option.series[0].data.length) { + if (index2 < chart2Option.series[0].data.length) { chart2.dispatchAction({ type: "downplay", seriesIndex: 0, @@ -665,201 +597,267 @@ export default { seriesIndex: 0, dataIndex: index2, }); - chart1.dispatchAction({ - type: "downplay", - seriesIndex: 0, - }); - chart1.dispatchAction({ - type: "highlight", - seriesIndex: 0, - dataIndex: index2, - }); - chart1.dispatchAction({ - type: "showTip", - seriesIndex: 0, - dataIndex: index2, - }); index2++; } else { index2 = 0; } }, 3000); }); - - //车间生产昨日统计 - let obj2 = { - query: { - start_date: that.yesterday, - end_date: that.yesterday, - mgroup_name: "退火", - "group_bys_material": "", - "order_bys_material": "", - "select_cols_material": "", - }, - }; - that.$API.bi.dataset.exec.req("lineDay_m", obj2).then((res2) => { - // console.log("车间生产昨日统计:", res2); - that.yesTuihuoData = res2.data2.ds0; - let pieOption = deepCopy(that.pieOption); - if (res2.data2.ds0.length > 0) { - res2.data2.ds0.forEach((item) => { - pieOption.series.data[0].value += item.划伤; - pieOption.series.data[1].value += item.气泡; - pieOption.series.data[2].value = item.水纹; - pieOption.series.data[3].value = item.崩边; - pieOption.series.data[4].value = item.雾面; - pieOption.series.data[5].value = item.麻点; - pieOption.series.data[5].value = item.线痕; - pieOption.series.data[5].value = item.破损; - pieOption.series.data[5].value = item.其他; + }, + //黑化设备运行状态0 + getEqState10() { + let that = this; + that.$API.wpm.ana.equipLastMlog.req({mgroup_name: '黑化'}).then((res) => { + console.log('黑化设备运行状态',res); + that.hh.bw = res.保温; + that.hh.lq = res.冷却; + that.hh.wyx = res.未运行; + that.hh.gz = res.故障; + let processData = []; + let now = new Date(res.now).getTime(); + if(res.rows.length>0){ + res.rows.forEach((item) => { + let arr = [],obj1 = {},obj2 = {},obj3 = {},obj4 = {},obj5 = {}; + obj1.elType = "primary"; + obj1.value = item.name; + obj2.elType = "primary"; + obj2.value = item.number; + obj3.elType = "elicon"; + obj3.value = item.mstate; + obj4.elType = "progress"; + let process = 0; + let startTime = new Date(item.work_start_time).getTime(); + let endTime = new Date(item.work_end_time).getTime(); + let sumTime =0; + if(item.reminder_interval_list&&item.reminder_interval_list>0){ + sumTime = item.reminder_interval_list[0]+item.reminder_interval_list[1]; + }else{ + sumTime = endTime - startTime; + } + if(now>startTime&&nowendTime){ + process = 100; + } + obj4.value = process; + obj5.elType = "primary"; + obj5.value = item.t_count_use; + arr.push(obj1); + arr.push(obj2); + arr.push(obj3); + arr.push(obj4); + arr.push(obj5); + processData.push(arr); }); + this.processData01 = processData; } - let pieChart2 = this.setChart("pieChart2", pieOption); - let index2 = 0; - this.chartInterval3 = setInterval(function () { - if (index2 < pieOption.series.data.length) { - pieChart2.dispatchAction({ - type: "downplay", - seriesIndex: 0, - }); - pieChart2.dispatchAction({ - type: "highlight", - seriesIndex: 0, - dataIndex: index2, - }); - pieChart2.dispatchAction({ - type: "showTip", - seriesIndex: 0, - dataIndex: index2, - }); - index2++; - } else { - index2 = 0; - } - }, 3000); - debugger; + + }); + }, + //黑化设备运行状态 + getEqState1() { + let that = this; + that.$API.wpm.ana.equipLastMlog.req({mgroup_name: '黑化'}).then((res) => { + console.log('黑化设备运行状态',res); + that.hh.bw = res.保温; + that.hh.lq = res.冷却; + that.hh.wyx = res.未运行; + that.hh.gz = res.故障; + that.configData01.data = []; + let nowTime = new Date(res.now).getTime(); + if(res.rows.length>0){ + res.rows.forEach((item) => { + let arr = []; + arr[0] = item.name; + arr[1] = item.number; + if(item.mstate=='保温'){ + arr[2] = '保温'; + }else if(item.mstate=='冷却'){ + arr[2] = '冷却'; + }else if(item.mstate=='未运行'){ + arr[2] = '未运行'; + }else if(item.mstate=='故障'){ + arr[2] = '故障'; + } + let process = null, workTime =0,saveTime=null,sumTime=0; + if(item.reminder_interval_list&&item.reminder_interval_list.length>0){ + item.reminder_interval_list.forEach(item=>{ + sumTime += item; + }) + let startTime = new Date(item.work_start_time).getTime(); + workTime = (nowTime-startTime)/60000;//已工作时间 + process = Math.round((workTime/sumTime)*100); + process = process>100?'100%':process+'%'; + let bwSaveTime = Math.round(item.reminder_interval_list[0]-workTime); + if(bwSaveTime>0){ + saveTime = bwSaveTime; + }else{ + saveTime = 0; + } + }else{ + process = ''; + saveTime = ''; + } + arr[3] = process; + arr[4] = item.t_count_use?item.t_count_use:0; + arr[5] = saveTime; + that.configData01.data.push(arr); + }); + } }); }, //黑化任务进度 getMtask1() { let that = this; - that.$API.mtm.mgroup.list.req({ page: 0, search: '黑化'}) - .then((res) => { - if(res.length != 1){ - that.$message.error("获取工段错误"); - return; - } - let mgroup = res[0].id; - let obj = {}; - // obj.start_date__gte = this.start_date; - // obj.end_date__lte = this.end_date; - obj.mgroup = mgroup; - obj.page = 0; - that.$API.pm.mtask.list.req(obj).then((res) => { - let processData = []; - res.forEach((item) => { - let arr = [], - obj1 = {}, - obj2 = {}, - obj3 = {}, - obj4 = {}, - obj5 = {}, - obj6 = {}, - obj7 = {}, - obj8 = {}; - obj1.elType = "primary"; - obj1.value = item.material_out_.name; - obj2.elType = "primary"; - obj2.value = item.material_out_.specification; - obj8.elType = "primary"; - obj8.value = item.material_out_.model; - obj3.elType = "primary"; - obj3.value = item.start_date; - obj4.elType = "primary"; - obj4.value = item.end_date; - obj5.elType = "progress"; - let process = Math.round( - (item.count_ok / item.count) * 100 - ); - obj5.value = process; - obj6.elType = "primary"; - obj6.value = item.count_ok; - obj7.elType = "tag"; - obj7.value = item.state; - arr.push(obj1); - arr.push(obj2); - arr.push(obj8); - arr.push(obj3); - arr.push(obj4); - arr.push(obj5); - arr.push(obj6); - arr.push(obj7); - processData.push(arr); - }); - this.processData1 = processData; + let obj = {}; + obj.mgroup__name = '黑化'; + obj.page = 0; + that.$API.pm.mtask.list.req(obj).then((res) => { + that.configData1.data = []; + res.forEach((item) => { + let arr = []; + arr[0] = item.material_out_.name; + arr[1] = item.material_out_.specification; + arr[2] = item.material_out_.model; + arr[3] = item.start_date; + arr[4] = item.end_date; + let process = Math.round((item.count_ok / item.count) * 100)+'%'; + arr[5] = process; + arr[6] = item.count_ok; + if(item.state==20){ + arr[7]='已下达'; + }else if(item.state==34){ + arr[7]='已停止'; + }else if(item.state==40){ + arr[7]='已提交'; + } + that.configData1.data.push(arr); }); }); }, + //退火设备运行状态 + getEqState2() { + let that = this; + that.$API.wpm.ana.equipLastMlog.req({mgroup_name: '退火'}).then((res) => { + console.log('退火设备运行状态',res); + that.th.bw = res.保温; + that.th.lq = res.冷却; + that.th.wyx = res.未运行; + that.th.gz = res.故障; + that.configData02.data = []; + let nowTime = new Date(res.now).getTime(); + if(res.rows.length>0){ + res.rows.forEach((item) => { + let arr = []; + arr[0] = item.name; + arr[1] = item.number; + if(item.mstate=='保温'){ + arr[2] = '保温'; + }else if(item.mstate=='冷却'){ + arr[2] = '冷却'; + }else if(item.mstate=='未运行'){ + arr[2] = '未运行'; + }else if(item.mstate=='故障'){ + arr[2] = '故障'; + } + let process = null, workTime =0,saveTime=null,sumTime=0; + if(item.reminder_interval_list&&item.reminder_interval_list.length>0){ + item.reminder_interval_list.forEach(item=>{ + sumTime += item; + }) + let startTime = new Date(item.work_start_time).getTime(); + workTime = (nowTime-startTime)/60000;//已工作时间 + process = Math.round((workTime/sumTime)*100); + process = process>100?'100%':process+'%'; + let bwSaveTime = Math.round(item.reminder_interval_list[0]-workTime); + if(bwSaveTime>0){ + saveTime = bwSaveTime; + }else{ + saveTime = 0; + } + }else{ + process = ''; + saveTime = ''; + } + arr[3] = process; + arr[4] = item.t_count_use?item.t_count_use:0; + arr[5] = saveTime; + that.configData02.data.push(arr); + }); + } + }); + }, //退火任务进度 getMtask2() { let that = this; - that.$API.mtm.mgroup.list.req({ page: 0, search: '退火'}) - .then((res) => { - if(res.length != 1){ - that.$message.error("获取工段错误"); - return; - } - let mgroup = res[0].id; - let obj = {}; - // obj.start_date__gte = this.start_date; - // obj.end_date__lte = this.end_date; - obj.mgroup = mgroup; - obj.page = 0; - that.$API.pm.mtask.list.req(obj).then((res) => { - let processData = []; - res.forEach((item) => { - let arr = [], - obj1 = {}, - obj2 = {}, - obj3 = {}, - obj4 = {}, - obj5 = {}, - obj6 = {}, - obj7 = {}, - obj8 = {}; - obj1.elType = "primary"; - obj1.value = item.material_out_.name; - obj2.elType = "primary"; - obj2.value = item.material_out_.specification; - obj8.elType = "primary"; - obj8.value = item.material_out_.model; - obj3.elType = "primary"; - obj3.value = item.start_date; - obj4.elType = "primary"; - obj4.value = item.end_date; - obj5.elType = "progress"; - let process = Math.round( - (item.count_ok / item.count) * 100 - ); - obj5.value = process; - obj6.elType = "primary"; - obj6.value = item.count_ok; - obj7.elType = "tag"; - obj7.value = item.state; - arr.push(obj1); - arr.push(obj2); - arr.push(obj8); - arr.push(obj3); - arr.push(obj4); - arr.push(obj5); - arr.push(obj6); - arr.push(obj7); - processData.push(arr); - }); - this.processData2 = processData; + let obj = {}; + obj.mgroup__name = '退火'; + obj.page = 0; + that.$API.pm.mtask.list.req(obj).then((res) => { + that.configData2.data = []; + res.forEach((item) => { + let arr = []; + arr[0] = item.material_out_.name; + arr[1] = item.material_out_.specification; + arr[2] = item.material_out_.model; + arr[3] = item.start_date; + arr[4] = item.end_date; + let process = Math.round((item.count_ok / item.count) * 100)+'%'; + arr[5] = process; + arr[6] = item.count_ok; + if(item.state==20){ + arr[7]='已下达'; + }else if(item.state==34){ + arr[7]='已停止'; + }else if(item.state==40){ + arr[7]='已提交'; + } + that.configData2.data.push(arr); }); }); }, + getLeftBottomNum(){ + let that = this; + this.$API.wpm.ana.put_prod.req().then((res) => { + that.tcfx.today = res.今日退火投产预测; + that.tcfx.tomorrow = res.明日退火投产预测; + }) + }, + //库存统计列表 + getMaterials() { + let that = this; + that.$API.wpm.wmaterial.list.req({ page: 0,mgroup__name__in:'退火,黑化' }).then((res) => { + that.configData.data = []; + if(res.length>0){ + res.forEach((item) => { + let arr = []; + arr[0] = item.material_name; + arr[1] = item.batch; + arr[2] = item.count; + that.configData.data .push(arr); + }) + } + }) + }, + //工段生产数量 + getMgroupCount(){ + let that = this; + that.$API.bi.dataset.exec.req(" gdscs").then((res) => { + let arr = res.data2.ds0; + console.log('工段生产数量',arr) + arr.forEach((item) => { + if(item.工段=='退火'){ + that.kctj.thz = item.生产中数; + that.kctj.thok = item.合格品数; + }else if(item.工段=='黑化'){ + that.kctj.dhh = item.待生产数; + that.kctj.hhz = item.生产中数; + } + }) + }) + }, }, }; @@ -909,6 +907,7 @@ export default { font-size: 16px; display: flex; height: 36px; + line-height: 36px; background: linear-gradient( 40deg, rgba(11, 101, 140, 0.451), @@ -925,11 +924,35 @@ export default { .boxlabel { margin-left: 6px; font-size: 18px; - margin-top: 6px; + /* margin-top: 6px; */ +} +.stateIcon{ + width:16px; + height: 16px; + margin: 0 5px; + border-radius: 8px; + display: inline-block; +} +.bwIcon{ + background-color: rgb(245, 196, 0); +} +.lqIcon{ + background-color: rgb(0,163,245); +} +.wyxIcon{ + background-color: rgb(69,176,118); +} +.gzIcon{ + background-color: rgb(222,60,54); +} +.eqNum{ + margin: 0 10px; } - .boxmain { - height: calc(100% - 40px); + height: calc(100% - 50px); +} +.boxmain.boxmainbottom{ + height: calc(100% - 120px); } .lineDiv { height: 40px; @@ -989,4 +1012,25 @@ export default { .halfBox { height: 50%; } + +.totalStatic{ + display: flex; +} +.totalStaticItem{ + flex: 1; + height: 25px; + text-align: center; + line-height: 25px; + font-size: 14px; + margin-top: 5px; +} +.totalStaticItemNum{ + font-size: 24px; + height: 40px; + line-height: 40px; + font-family: "myfont"; + text-align: center; + margin-top: 0; + color: rgb(149, 255, 255); +} diff --git a/src/views/inm/mio.vue b/src/views/inm/mio.vue index f7f02517..1bbd9266 100644 --- a/src/views/inm/mio.vue +++ b/src/views/inm/mio.vue @@ -94,6 +94,14 @@ width="150px" > + + 编辑 + 提交 @@ -211,9 +215,10 @@ export default { table_edit(row) { this.dialog.save = true; this.$nextTick(() => { - this.$refs.saveDialog.open("edit", type).setData(row); + this.$refs.saveDialog.open("edit", row.type).setData(row); }); }, + //查看 table_detail(row) { this.type = row.type; diff --git a/src/views/qm/products_form.vue b/src/views/qm/products_form.vue index 6daa1c6e..e78535c8 100644 --- a/src/views/qm/products_form.vue +++ b/src/views/qm/products_form.vue @@ -106,6 +106,25 @@ + + + + + + + + @@ -458,12 +477,14 @@ export default { isSaveing: false, options: [], userList:[], + shiftOtions:[], selectionFilters: [], setFiltersVisible: false, }; }, mounted() { this.getUsers(); + this.getShift(); }, methods: { //显示 @@ -473,6 +494,12 @@ export default { this.getMaterialBatch(); return this; }, + getShift(){ + let that = this; + that.$API.mtm.shift.list.req({ page: 0 }).then((res) => { + that.shiftOtions = res; + }); + }, getUsers(){ let that = this; let userList = []; diff --git a/src/views/statistics/pass_num_gx.vue b/src/views/statistics/pass_num_gx.vue index 61daef0a..a30fe78d 100644 --- a/src/views/statistics/pass_num_gx.vue +++ b/src/views/statistics/pass_num_gx.vue @@ -31,12 +31,12 @@ - + - + + + {{ scope.row.年 }}-{{ scope.row.月 }}-{{ scope.row.日 }} @@ -63,11 +65,22 @@ - + + + + + + + + + + + + - {{ Math.round(scope.row.合格率) }}% + {{ (scope.row.合格率).toFixed(2) }}% @@ -78,12 +91,12 @@ - + - + + + {{ scope.row.年 }}-{{ scope.row.月 }}-{{ scope.row.日 }} @@ -110,11 +125,20 @@ - + + + + + + + + + + - {{ Math.round(scope.row.合格率) }}% + {{ (scope.row.合格率).toFixed(2) }}% @@ -125,12 +149,12 @@ - + - + + + {{ scope.row.年 }}-{{ scope.row.月 }}-{{ scope.row.日 }} @@ -157,11 +183,20 @@ - + + + + + + + + + + - {{ Math.round(scope.row.合格率) }}% + {{ (scope.row.合格率).toFixed(2) }}% @@ -172,12 +207,12 @@ - + - + + + {{ scope.row.年 }}-{{ scope.row.月 }}-{{ scope.row.日 }} @@ -204,11 +241,20 @@ - + + + + + + + + + + - {{ Math.round(scope.row.合格率) }}% + {{ (scope.row.合格率).toFixed(2) }}% @@ -219,12 +265,12 @@ - + - + + + {{ scope.row.年 }}-{{ scope.row.月 }}-{{ scope.row.日 }} @@ -251,11 +299,20 @@ - + + + + + + + + + + - {{ Math.round(scope.row.合格率) }}% + {{ (scope.row.合格率).toFixed(2) }}% @@ -266,12 +323,12 @@ - + - + + + {{ scope.row.年 }}-{{ scope.row.月 }}-{{ scope.row.日 }} @@ -298,11 +357,20 @@ - + + + + + + + + + + - {{ Math.round(scope.row.合格率) }}% + {{ (scope.row.合格率).toFixed(2) }}% @@ -313,12 +381,12 @@ - + - + + + {{ scope.row.年 }}-{{ scope.row.月 }}-{{ scope.row.日 }} @@ -345,11 +415,20 @@ - + + + + + + + + + + - {{ Math.round(scope.row.合格率) }}% + {{ (scope.row.合格率).toFixed(2) }}% @@ -360,12 +439,12 @@ - + - + + + {{ scope.row.年 }}-{{ scope.row.月 }}-{{ scope.row.日 }} @@ -392,11 +473,20 @@ - + + + + + + + + + + - {{ Math.round(scope.row.合格率) }}% + {{ (scope.row.合格率).toFixed(2) }}% @@ -407,12 +497,12 @@ - + - + + + {{ scope.row.年 }}-{{ scope.row.月 }}-{{ scope.row.日 }} @@ -439,11 +531,20 @@ - + + + + + + + + + + - {{ Math.round(scope.row.合格率) }}% + {{ (scope.row.合格率).toFixed(2) }}% @@ -454,12 +555,12 @@ - + - + + + {{ scope.row.年 }}-{{ scope.row.月 }}-{{ scope.row.日 }} @@ -486,11 +589,20 @@ - + + + + + + + + + + - {{ Math.round(scope.row.合格率) }}% + {{ (scope.row.合格率).toFixed(2) }}% @@ -501,12 +613,12 @@ - + - + + + {{ scope.row.年 }}-{{ scope.row.月 }}-{{ scope.row.日 }} @@ -533,11 +647,20 @@ - + + + + + + + + + + - {{ Math.round(scope.row.合格率) }}% + {{ (scope.row.合格率).toFixed(2) }}% @@ -548,12 +671,12 @@ - + - + + + {{ scope.row.年 }}-{{ scope.row.月 }}-{{ scope.row.日 }} @@ -580,11 +705,20 @@ - + + + + + + + + + + - {{ Math.round(scope.row.合格率) }}% + {{ (scope.row.合格率).toFixed(2) }}% @@ -595,12 +729,12 @@ - + - + + + {{ scope.row.年 }}-{{ scope.row.月 }}-{{ scope.row.日 }} @@ -627,11 +763,20 @@ - + + + + + + + + + + - {{ Math.round(scope.row.合格率) }}% + {{ (scope.row.合格率).toFixed(2) }}% @@ -642,12 +787,12 @@ - + - + + + {{ scope.row.年 }}-{{ scope.row.月 }}-{{ scope.row.日 }} @@ -674,11 +821,20 @@ - + + + + + + + + + + - {{ Math.round(scope.row.合格率) }}% + {{ (scope.row.合格率).toFixed(2) }}% @@ -689,12 +845,12 @@ - + - + + + {{ scope.row.年 }}-{{ scope.row.月 }}-{{ scope.row.日 }} @@ -721,11 +879,20 @@ - + + + + + + + + + + - {{ Math.round(scope.row.合格率) }}% + {{ (scope.row.合格率).toFixed(2) }}% @@ -736,12 +903,12 @@ - + - + + + {{ scope.row.年 }}-{{ scope.row.月 }}-{{ scope.row.日 }} @@ -768,11 +937,20 @@ - + + + + + + + + + + - {{ Math.round(scope.row.合格率) }}% + {{ (scope.row.合格率).toFixed(2) }}% @@ -780,7 +958,6 @@ - @@ -923,6 +1100,7 @@ export default { let option = deepCopy(that.basicOption); let query = deepCopy(that.query); query.mgroup_name = mgroup_name; + option.title.text = mgroup_name+"合格数统计"; let obj = {}; obj.query = query; that.$API.bi.dataset.exec.req('lineDay_m', obj).then((res) => { @@ -934,7 +1112,6 @@ export default { 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 = { @@ -947,24 +1124,20 @@ export default { option.series.push(obj) } }); - console.log('nameList',nameList); that.nameList = nameList; tableData.forEach((item) => { let indexX = nameList.indexOf(item.物料名); dataList[indexX].push(item); }); - console.log('dataList',dataList) for(let i = 0;i - - + --> - - - - - - - - + + + + + + + + + + 导出 - + - + @@ -63,13 +57,490 @@ - - + + + + + + + + + + + + + + 导出 + + + + + + + + + + + + + + + + + + + + + + + + + + 导出 + + + + + + + + + + + + + + + + + + + + + + + + + + 导出 + + + + + + + + + + + + + + + + + + + + + + + + + + 导出 + + + + + + + + + + + + + + + + + + + + + + + + + + 导出 + + + + + + + + + + + + + + + + + + + + + + + + + + 导出 + + + + + + + + + + + + + + + + + + + + + + + + + + 导出 + + + + + + + + + + + + + + + + + + + + + + + + + + 导出 + + + + + + + + + + + + + + + + + + + + + + + + + + 导出 + + + + + + + + + + + + + + + + + + + + + + + + + + 导出 + + + + + + + + + + + + + + + + + + + + + + + + + + 导出 + + + + + + + + + + + + + + + + + + + + + + + + + + 导出 + + + + + + + + + + + + + + + + + + + + + + + + + + 导出 + + + + + + + + + + + + + + + + + + + + + + + + + + 导出 + + + + + + + + + + + + + + + + + + + + + + + + + + 导出 + + + + + + + + + + + + + + +