diff --git a/public/img/bx/gx_blue.png b/public/img/bx/gx_blue.png new file mode 100644 index 00000000..6e77f73f Binary files /dev/null and b/public/img/bx/gx_blue.png differ diff --git a/public/img/bx/gx_green.png b/public/img/bx/gx_green.png new file mode 100644 index 00000000..c00fe0c9 Binary files /dev/null and b/public/img/bx/gx_green.png differ diff --git a/public/img/bx/gx_purple.png b/public/img/bx/gx_purple.png new file mode 100644 index 00000000..c2c0ee8b Binary files /dev/null and b/public/img/bx/gx_purple.png differ diff --git a/public/img/bx/gx_yellow.png b/public/img/bx/gx_yellow.png new file mode 100644 index 00000000..9b6aee03 Binary files /dev/null and b/public/img/bx/gx_yellow.png differ diff --git a/src/views/home/widgets/index_bx.vue b/src/views/home/widgets/index_bx.vue index e9592dec..acaa5e08 100644 --- a/src/views/home/widgets/index_bx.vue +++ b/src/views/home/widgets/index_bx.vue @@ -1,116 +1,82 @@ @@ -119,12 +85,13 @@ import * as echarts from "echarts"; export default { data() { return { - tableData: [], - tableDataIn: [], - tableDataEq: [], - tableDataOut: [], - materialType: 20, - option: { + number_tasktodo: 0, + number_mlogtoSubmit: 0, + number_materialRecive: 0, + number_materialTodo: 0, + xAxisData: [], + option1: { + color: ['rgb(128, 255, 165)', 'rgb(0, 221, 255)'], tooltip: { trigger: "axis", axisPointer: { @@ -135,18 +102,24 @@ export default { }, }, grid: { - top: "5%", + top: "10%", left: "1%", right: "1%", bottom: "5%", containLabel: true, }, + legend: { + top: 0, + right: 5, + data: ["生产数","合格数"], + }, xAxis: { type: "category", axisLabel: { // show: false, // X 轴标签文字旋转角度 }, - data: [], + boundaryGap: false, + data: [1,2,3,4,5,6,7,8,9,10], }, yAxis: { type: "value", @@ -154,103 +127,324 @@ export default { show: false, // X 轴标签文字旋转角度 }, }, - series: { - data: [], - type: "bar", - barMaxWidth: 30, - emphasis: { - focus: "series", + series: [ + { + name: "生产数", + type: "line", + smooth: true, + showSymbol: false,//节点 + lineStyle: { + color: "rgb(128, 255, 165)", + }, + areaStyle: { + opacity: 0.5, + color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [ + {offset: 0,color: "rgb(128, 255, 165)",}, + {offset: 1,color: "rgb(1, 191, 236)",}]), + }, + emphasis: { + focus: "series", + }, + data: [], }, - label: { - show: true, - position: "top", - color: "#000", - }, - itemStyle: { - borderRadius: [5, 5, 0, 0], - normal: { color: "rgb(20, 141, 255)" }, + { + name: "合格数", + type: "line", + smooth: true, + showSymbol: false,//节点 + lineStyle: { + color:"rgb(0, 221, 255)" + }, + areaStyle: { + opacity: 0.5, + color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [ + {offset: 0,color: "rgb(0, 221, 255)",}, + {offset: 1,color: "rgb(77, 119, 255)",}]), + }, + emphasis: { + focus: "series", + }, + data: [], + } + ], + }, + option2: { + color: [ 'rgb(116, 21, 219)', 'rgb(255, 0, 135)'], + tooltip: { + trigger: "axis", + axisPointer: { + type: "cross", + label: { + backgroundColor: "#6a7985", + }, }, }, + grid: { + top: "10%", + left: "1%", + right: "1%", + bottom: "5%", + containLabel: true, + }, + legend: { + top: 0, + right: 5, + data: ["计划数", "生产数"], + }, + xAxis: { + type: "category", + boundaryGap: false, + data: [], + }, + yAxis: { + type: "value", + axisLabel: { + show: false, // X 轴标签文字旋转角度 + }, + }, + series: [ + { + name: "计划数", + type: "line", + smooth: true, + showSymbol: false,//节点 + lineStyle: { + color: "rgb(116, 21, 219)", + }, + areaStyle: { + opacity: 0.5, + color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [ + {offset: 0,color: "rgb(55, 162, 255)",}, + {offset: 1,color: "rgb(116, 21, 219)",}]), + }, + emphasis: { + focus: "series", + }, + data: [], + }, + { + name: "生产数", + type: "line", + smooth: true, + showSymbol: false,//节点 + lineStyle: { + color:"rgb(255, 0, 135)" + }, + areaStyle: { + opacity: 0.5, + color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [ + {offset: 0,color: "rgb(255, 0, 135)",}, + {offset: 1,color: "rgb(135, 0, 157)",}]), + }, + emphasis: { + focus: "series", + }, + data: [], + } + ], }, + mgroups:[], + mgroupsId:'', + start_date:'', + end_date:'', + mgroupName:'', + chart0Visible: true, + chart1Visible: true, }; }, mounted() { - this.$emit("on-mounted"); - //生产设备 - this.getEquipmentList(); - //车间物料 - this.getMaterialInList(); - //成品库车间库存 - this.getMaterialOutList(); - //半成品库车间库存 - this.getMaterialList(); - //任务列表 - // this.getMtaskLists(); + let that = this; + var myDate = new Date(); + let year = myDate.getFullYear(); + let month = myDate.getMonth() + 1; + let day = myDate.getDate(); + that.year_s = year; + that.month_s = month; + that.day_s = day; + let days = day>10?day:'0'+day; + let months = month>10?month:'0'+month; + that.start_date = year + '-' + months + '-01'; + that.end_date = year + '-' + months + '-' + days; + let xAxisData = []; + for (let i = 0; i < 31; i++) { + let dindex = i + 1; + xAxisData.push(dindex + "日"); + } + that.option1.xAxis.data = xAxisData; + that.option2.xAxis.data = xAxisData; + that.xAxisData = xAxisData; + let userInfo = this.$TOOL.data.get("USER_INFO"); + this.deptId = userInfo.belong_dept; + this.deptName = userInfo.belong_dept_name; + that.getMgroups(); + //未完成的任务 + that.taskToDo(); + //未提交的日志 + that.mlogToSubmit(); + //未接收的物料 + that.materialRecive(); + //未完成的物料 + // that.materialTodo(); }, methods: { - // 动态绑定Class - bindClass(rate) { - let classInfo = { - socketDom: true, - redColor: false, - greenColor: true, + getMgroups(){ + let that = this; + that.number_materialTodo = 0; + that.$API.mtm.mgroup.list.req({belong_dept:that.deptId,page:0}).then(res=>{ + that.mgroupName = res[0].name; + that.mgroups = res; + that.mlogComplete(); + if(res.length > 0){ + res.forEach(item=>{ + that.mgroupsId += item.id + ','; + //未完成的物料 + that.materialTodo(item.id); + }) + } + }) + }, + taskToDo() { + let that = this; + let params = {state: 20,mgroup__belong_dept: that.deptId,page_size:1}; + that.$API.pm.mtask.list.req(params).then((res) => { + that.number_tasktodo =res.count; + }); + }, + mlogToSubmit(){ + let that = this; + let params = {submit_time__isnull: true,mgroup__belong_dept__name__in: that.deptName,page_size:1}; + that.$API.wpm.mlog.list.req(params).then((res) => { + that.number_mlogtoSubmit =res.count; + }); + }, + materialRecive(){ + let that = this; + that.number_materialRecive = 0; + let params = {submit_time__isnull: true,recive_dept: that.deptId,page_size:1}; + that.$API.wpm.handover.list.req(params).then((res) => { + that.number_materialRecive=res.count; + }); + }, + materialTodo(mgroupId){ + let that = this; + let params = {tag: 'todo',page_size:1,mgroup: mgroupId}; + that.$API.wpm.wmaterial.list.req(params).then((res) => { + that.number_materialTodo+=res.count; + }); + }, + mlogComplete(){ + let that = this; + let params = { + // query:{start_date:that.start_date,end_date:that.end_date,mgroup_name:that.mgroupName}, + query:{start_date:'2025-05-01',end_date:'2025-05-31',mgroup_name:that.mgroupName}, }; - if (rate > 0) { - classInfo.greenColor = true; - } else if (rate < 0) { - classInfo.redColor = true; - } - return classInfo; - }, - //生产设备 - getEquipmentList(){ - let that = this; - that.$API.em.equipment.list.req({ page: 0, type: 10 }).then((res) => { - that.tableDataEq = res; + let data0 = [],data1 = []; + this.$API.bi.dataset.exec.req("lineDay_m2", params).then((res) => { + that.chart0Visible=false; + if(res.data2.ds0&&res.data2.ds0.length>0){ + res.data2.ds0.forEach(item=>{ + let index = item.日-1; + data0[index] = item.生产数; + data1[index] = item.合格数; + }) + } + that.option1.series[0].data = data0; + that.option1.series[1].data = data1; + that.chart0Visible=true; }); }, - //车间物料 - getMaterialInList(){ + mgroupChange(){ let that = this; - that.$API.wpm.wmaterial.list.req({ page: 0, material__type: '20',count__gte:1 }).then((res) => { - that.tableDataIn = res; + that.mlogComplete(); + }, + //工序综合统计 + mgroupStatistics(){ + let that = this; + let params = { + query:{start_date:that.start_date,end_date:that.end_date,mgroup_name:that.mgroupName}, + }; + let data0 = [],data1 = []; + this.$API.bi.dataset.exec.req("lineDay_m2", params).then((res) => { + if(res.data2.ds0&&res.data2.ds0.length>0){ + + } + that.option2.series[0].data = data0; + that.option2.series[1].data = data1; }); }, - //半成品库存统计 - getMaterialOutList(){ - let that = this; - that.$API.mtm.material.list.req({ page: 0, material__type: 20,count__gt:0 }).then((res) => { - that.tableDataOut = res; - }); - }, - //成品库车间库存 - getMaterialList() { - let that = this; - that.$API.mtm.material.list.req({ page: 0, material__type: 10,count__gt:0 }).then((res) => { - that.tableData = res; - }); - }, - //任务列表 - getMtaskLists(){}, }, }; diff --git a/src/views/wpm_bx/mlogbw_check.vue b/src/views/wpm_bx/mlogbw_check.vue index f5313a25..f7ba2708 100644 --- a/src/views/wpm_bx/mlogbw_check.vue +++ b/src/views/wpm_bx/mlogbw_check.vue @@ -516,7 +516,7 @@ export default { } that.hideAdd = that.isSubmit; if(that.mgroupName=='排一次棒'||that.mgroupName=='排板'){ - that.getNewNumber(); + // that.getNewNumber(); } that.params.mlogb = that.addTemplate.mlogb = that.mlogb; that.currentDate = this.$TOOL.dateFormat2(new Date());