diff --git a/.env.development b/.env.development index 58b17e13..fccc0642 100644 --- a/.env.development +++ b/.env.development @@ -6,7 +6,7 @@ NODE_ENV = development VUE_APP_TITLE = '托克逊能源管理平台' # VUE_APP_TITLE = '中建材光子科技有限公司' # VUE_APP_TITLE = '超低排放系统' -VUE_APP_PJ = 'pf' +VUE_APP_PJ = '' # 接口地址 #VUE_APP_API_BASEURL = http://1.203.161.103:2800/api @@ -16,14 +16,17 @@ VUE_APP_PJ = 'pf' # VUE_APP_API_BASEURL = http://127.0.0.1:2226/api #测试环境 - VUE_APP_API_BASEURL = http://49.232.14.174:2226/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://49.232.14.174:2226 + + 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/package.json b/package.json index 71788f1c..1a17ce14 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,8 @@ "babylonjs-gui": "^6.46.0", "babylonjs-loaders": "^6.46.0", "cesium": "1.75", - "codemirror": "5.65.5", + "codemirror": "^5.65.17", + "codemirror-editor-vue3": "^2.7.0", "core-js": "3.29.0", "cropperjs": "1.5.13", "crypto-browserify": "^3.12.0", diff --git a/src/App.vue b/src/App.vue index 2f29a496..545c4771 100644 --- a/src/App.vue +++ b/src/App.vue @@ -301,5 +301,18 @@ export default { width: 9vh !important; height: 9vh !important; } +#progressbwlq .el-progress-bar__innerText{ + width: 100%; + position: absolute; + top: 4px; + left: 50%; + color: #cccccc; +} +.el-select-dropdown__item{ + height:auto!important; +} +.el-select-dropdown__item div{ + margin-left:15px!important; +} //排放系统 diff --git a/src/api/model/enm.js b/src/api/model/enm.js index d562fadd..44ef9bae 100644 --- a/src/api/model/enm.js +++ b/src/api/model/enm.js @@ -3,6 +3,64 @@ import http from "@/utils/request" /*EM接口*/ export default { // 测点 + xscript: { + list: { + name: "脚本", + req: async function(data){ + return await http.get( + `${config.API_URL}/enm/xscript/`, + data + ); + } + }, + item: { + name: "获取详情", + req: async function(id){ + return await http.get( + `${config.API_URL}/enm/xscript/${id}/` + ); + } + }, + update: { + name: "更新", + req: async function(id, data){ + return await http.put( + `${config.API_URL}/enm/xscript/${id}/`, + data); + } + }, + create: { + name: "创建", + req: async function(data){ + return await http.post( + `${config.API_URL}/enm/xscript/`, + data); + } + }, + delete: { + name: "删除", + req: async function(id){ + return await http.delete( + `${config.API_URL}/enm/xscript/${id}/`); + } + }, + toggle: { + name: "启用/禁用", + req: async function(id, data){ + return await http.put( + `${config.API_URL}/enm/xscript/${id}/toggle/`, + data); + } + }, + change_data: { + name: "变更数据", + req: async function(id, data){ + return await http.put( + `${config.API_URL}/enm/xscript/${id}/change_data/`, + data); + } + } + }, mpoint: { mplog: { name: "测点原始记录", diff --git a/src/api/model/pm.js b/src/api/model/pm.js index 894aa937..f7fd7f5a 100644 --- a/src/api/model/pm.js +++ b/src/api/model/pm.js @@ -94,6 +94,64 @@ export default { } }, }, + mtaskbAdd: { + name: "创建", + req: async function(id,data){ + return await http.post( + `${config.API_URL}/pm/mtask/${id}/add_mtaskb/`, + data); + } + }, + mtaskb:{ + list: { + name: "生产任务列表", + req: async function(data){ + return await http.get( + `${config.API_URL}/pm/mtaskb/`, + data + ); + } + }, + create: { + name: "创建", + req: async function(data){ + return await http.post( + `${config.API_URL}/pm/mtaskb/`, + data); + } + }, + cquery: { + name: "复杂查询", + req: async function(data){ + return await http.post( + `${config.API_URL}/pm/mtaskb/cquery/`, + data); + } + }, + item: { + name: "获取详情", + req: async function(id){ + return await http.get( + `${config.API_URL}/pm/mtaskb/${id}/` + ); + } + }, + update: { + name: "更新", + req: async function(id, data){ + return await http.put( + `${config.API_URL}/pm/mtaskb/${id}/`, + data); + } + }, + delete: { + name: "删除", + req: async function(id){ + return await http.delete( + `${config.API_URL}/pm/mtaskb/${id}/`); + } + }, + }, // 生产大任务 utask: { list: { diff --git a/src/api/model/wpm.js b/src/api/model/wpm.js index 56f64454..fe465d05 100644 --- a/src/api/model/wpm.js +++ b/src/api/model/wpm.js @@ -126,9 +126,53 @@ export default { }, }, }, + fmlog: { + list: { + name: "列表", + req: async function (data) { + return await http.get(`${config.API_URL}/wpm/fmlog/`, data); + }, + }, + item: { + name: "获取详情", + req: async function (id) { + return await http.get(`${config.API_URL}/wpm/fmlog/${id}/`); + }, + }, + cquery: { + name: "复杂查询", + req: async function (data) { + return await http.post( + `${config.API_URL}/wpm/fmlog/cquery/`, + data + ); + }, + }, + update: { + name: "更新", + req: async function (id, data) { + return await http.put( + `${config.API_URL}/wpm/fmlog/${id}/`, + data + ); + }, + }, + create: { + name: "创建", + req: async function (data) { + return await http.post(`${config.API_URL}/wpm/fmlog/`, data); + }, + }, + delete: { + name: "删除", + req: async function (id) { + return await http.delete(`${config.API_URL}/wpm/fmlog/${id}/`); + }, + }, + }, mlog: { list: { - name: "值班记录列表", + name: "列表", req: async function (data) { return await http.get(`${config.API_URL}/wpm/mlog/`, data); }, @@ -373,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/assets/icons/Jcpz.vue b/src/assets/icons/Jcpz.vue new file mode 100644 index 00000000..f7f9d4d2 --- /dev/null +++ b/src/assets/icons/Jcpz.vue @@ -0,0 +1,5 @@ + diff --git a/src/assets/icons/index.js b/src/assets/icons/index.js index fe8a6acb..f51c6b06 100644 --- a/src/assets/icons/index.js +++ b/src/assets/icons/index.js @@ -23,4 +23,5 @@ export { default as Xiaoshou } from './Xiaoshou.vue' export { default as Zhixing } from './Zhixing.vue' export { default as Zhizao } from './Zhizao.vue' export { default as Env } from './Env.vue' -export { default as Elec } from './Elec.vue' \ No newline at end of file +export { default as Elec } from './Elec.vue' +export { default as Jcpz } from './Jcpz.vue' \ No newline at end of file diff --git a/src/components/scEnm/lineChartsdialog.vue b/src/components/scEnm/lineChartsdialog.vue index ae6a01f4..d3ba9b8c 100644 --- a/src/components/scEnm/lineChartsdialog.vue +++ b/src/components/scEnm/lineChartsdialog.vue @@ -304,8 +304,9 @@ export default { this.visible = this.modelValue; this.option.legend.data.push(that.cate); this.option.series[0].name = that.cate; + console.log(that.mgroup) if (that.mgroup) { - if (that.cate == "总产量(t)") { + if (that.cate == "总产量(t)"|| that.cate =="熟料(t)" ||that.cate == "出厂水泥合计(t)") { that.cateName = "total_production"; } else if ( that.cate == "单位产品分布电耗(KW·h/t)" || diff --git a/src/config/route.js b/src/config/route.js index 6d75f24a..d75d8817 100644 --- a/src/config/route.js +++ b/src/config/route.js @@ -264,7 +264,7 @@ const routes = [ name: "slag_power", path: "/enm_slag/power", meta: { - title: "单位产品电耗", + title: "主要设备单耗", // icon: "el-icon-odometer", perms: ["enm_slag"], }, @@ -370,7 +370,7 @@ const routes = [ name: "power", path: "/enm_rm/power", meta: { - title: "单位产品电耗", + title: "主要设备单耗", // icon: "el-icon-odometer", perms: ["enm_rm"], }, @@ -496,7 +496,7 @@ const routes = [ name: "coal_power", path: "/enm_coal/power", meta: { - title: "单位产品电耗", + title: "主要设备单耗", // icon: "el-icon-odometer", perms: ["enm_coal"], }, @@ -622,7 +622,7 @@ const routes = [ name: "kiln_power", path: "/enm_kiln/power", meta: { - title: "单位产品电耗", + title: "主要设备单耗", // icon: "el-icon-odometer", perms: ["enm_kiln"], }, @@ -811,7 +811,7 @@ const routes = [ name: "mill_power", path: "/enm_mill/power", meta: { - title: "单位产品电耗", + title: "主要设备单耗", // icon: "el-icon-odometer", perms: ["enm_mill"], }, @@ -930,7 +930,7 @@ const routes = [ name: "enm_energy", path: "/enm_energy", meta: { - title: "电量报表", + title: "能源消耗报表", icon: "sc-icon-elec", type: "menu", perms: ["enm_energy"], @@ -1000,7 +1000,7 @@ const routes = [ name: "hourBase", path: "/enm_energy/hourBase", meta: { - title: "电量消耗小时报表", + title: "电量消耗逐时报表", // icon: "el-icon-grid", perms: ["hour_base"], }, @@ -1088,6 +1088,15 @@ const routes = [ perms: ["enm_report"], }, component: "enm_report/reportMonth", + },{ + name: "exception", + path: "/enm_report/exception", + meta: { + title: "异常动态表", + // icon: "el-icon-grid", + perms: ["enm_report"], + }, + component: "enm_report/exception", }, ], }, @@ -1696,68 +1705,6 @@ const routes = [ }, component: "inm/warehouse", }, - { - name: "good", - path: "/inm/good", - meta: { - title: "成品库", - // icon: "el-icon-cellphone", - perms: ["good"], - }, - children: [ - { - name: "good", - path: "/inm/good", - meta: { - title: "成品库", - // icon: "el-icon-cellphone", - perms: ["good"], - }, - component: "inm/good", - }, - { - name: "good_mio", - path: "/inm/good_mio", - meta: { - title: "出入库记录", - // icon: "el-icon-cellphone", - perms: ["good_mio"], - }, - component: "inm/good_mio", - }, - ], - }, - { - name: "halfgood", - path: "/inm/halfgood", - meta: { - title: "半成品库", - // icon: "el-icon-cellphone", - perms: ["halfgood"], - }, - children: [ - { - name: "halfgood", - path: "/inm/halfgood", - meta: { - title: "半成品库", - // icon: "el-icon-cellphone", - perms: ["halfgood"], - }, - component: "inm/halfgood", - }, - { - name: "halfgood_mio", - path: "/inm/halfgood_mio", - meta: { - title: "出入库记录", - // icon: "el-icon-cellphone", - perms: ["halfgood_mio"], - }, - component: "inm/halfgood_mio", - }, - ], - }, { name: "mainso", path: "/inm/mainso", @@ -1820,6 +1767,77 @@ const routes = [ }, ], }, + { + name: "halfgood", + path: "/inm/halfgood", + meta: { + title: "半成品库", + // icon: "el-icon-cellphone", + perms: ["halfgood"], + }, + children: [ + { + name: "halfgood", + path: "/inm/halfgood", + meta: { + title: "半成品库", + // icon: "el-icon-cellphone", + perms: ["halfgood"], + }, + component: "inm/halfgood", + }, + { + name: "halfgood_mio", + path: "/inm/halfgood_mio", + meta: { + title: "出入库记录", + // icon: "el-icon-cellphone", + perms: ["halfgood_mio"], + }, + component: "inm/halfgood_mio", + }, + ], + }, + { + name: "good", + path: "/inm/good", + meta: { + title: "成品库", + // icon: "el-icon-cellphone", + perms: ["good"], + }, + children: [ + { + name: "good", + path: "/inm/good", + meta: { + title: "成品库", + // icon: "el-icon-cellphone", + perms: ["good"], + }, + component: "inm/good", + }, + { + name: "good_mio", + path: "/inm/good_mio", + meta: { + title: "出入库记录", + // icon: "el-icon-cellphone", + perms: ["good_mio"], + }, + component: "inm/good_mio", + }, + ], + }, + { + name: "inmScrap", + path: "/inm/inmScrap", + meta: { + title: "废品库", + perms: ["inmScrap"], + }, + component: "inm/inmScrap", + }, // { // "name": "materialbatch", // "path": "/inm/materialbatch", @@ -1851,6 +1869,24 @@ const routes = [ }, component: "inm/mioitem", }, + { + name: "workshop", + path: "/inm/workshop", + meta: { + title: "车间库存", + hidden: true, + }, + component: "inm/workshop", + }, + { + name: "workshop_mio", + path: "/inm/workshop_mio", + meta: { + title: "车间出入库记录", + hidden: true, + }, + component: "inm/workshop_mio", + }, ], }, //采购 pum @@ -2721,7 +2757,7 @@ const routes = [ { path: "/fac_cal/mpointstat", meta: { - title: "计算数据", + title: "计算结果", // icon: "el-icon-postcard", type: "menu", perms: ["mpointstat"], @@ -2746,7 +2782,7 @@ const routes = [ path: "/enm_base", meta: { title: "基础配置", - icon: "el-icon-management", + icon: "sc-icon-jcpz", type: "menu", perms: ["enm_base"], }, @@ -3025,7 +3061,7 @@ const routes = [ meta: { title: "黑化车间", icon: "el-icon-trend-charts", - perms: ["bigScreenP_dept10"], + perms: ["bigScreenP_dept_hh"], fullpage: true, }, component: "bigScreen/index_heihuadept.vue", @@ -3267,6 +3303,17 @@ const routes = [ }, component: "statistics/task_rate_gx.vue", }, + //人员绩效统计——光芯 + { + path: "/work_statistics", + name: "work_statistics", + meta: { + title: "人员生产统计", + icon: "el-icon-trend-charts", + perms: ["work_statistics"], + }, + component: "statistics/work_statistics.vue", + }, //库存统计——光芯 { path: "/statistic_inm", diff --git a/src/layout/index.vue b/src/layout/index.vue index 28153bff..298d3346 100644 --- a/src/layout/index.vue +++ b/src/layout/index.vue @@ -355,7 +355,7 @@ export default { // let baseInFo = data[data.current]; let base_logo = this.$TOOL.data.get("BASE_INFO") !== null - ? this.$TOOL.data.get("BASE_INFO").base.base_logo + ? this.$TOOL.data.get("BASE_INFO").base.base_logo_i : "img/logo.png"; // let base_logo = baseInFo!==null?baseInFo.base.base_logo:'img/logo.png'; return base_logo; 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/em/equipment_form.vue b/src/views/em/equipment_form.vue index 2ab4be25..28cf02ad 100644 --- a/src/views/em/equipment_form.vue +++ b/src/views/em/equipment_form.vue @@ -3,7 +3,7 @@ - + - + + + + + + + @@ -22,7 +28,27 @@ - + + + + + + + + @@ -35,15 +61,16 @@ - + - - + + + @@ -54,8 +81,6 @@ - - @@ -66,9 +91,9 @@ - - - + + + @@ -121,7 +146,70 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 添加 + + + + + + + + + + + + + + + + 删除 + + diff --git a/src/views/em/mpoint_form.vue b/src/views/em/mpoint_form.vue index 2a999594..ea3b5f15 100644 --- a/src/views/em/mpoint_form.vue +++ b/src/views/em/mpoint_form.vue @@ -161,6 +161,8 @@
diff --git a/src/views/enm_base/mgroup_form.vue b/src/views/enm_base/mgroup_form.vue index 8245cc67..b6984122 100644 --- a/src/views/enm_base/mgroup_form.vue +++ b/src/views/enm_base/mgroup_form.vue @@ -246,21 +246,32 @@ export default { that.$emit("success", that.form, that.mode); that.visible = false; that.$message.success("操作成功"); + }) + .catch((error) => { + that.isSaveing = false; + that.$message.error("操作失败,请稍后重试"); + console.error("Error creating mgroup:", error); }); } else { - res = that.$API.mtm.mgroup.update + that.$API.mtm.mgroup.update .req(that.form.id, that.form) .then((res) => { that.isSaveing = false; that.$emit("success", that.form, that.mode); that.visible = false; that.$message.success("操作成功"); + }) + .catch((error) => { + that.isSaveing = false; + that.$message.error("操作失败,请稍后重试"); + console.error("Error updating mgroup:", error); }); - } - } - }); + } + } + }); }, + //设置过滤项 setFilters(filters) { this.selectionFilters = filters; diff --git a/src/views/enm_coal/handoverLog.vue b/src/views/enm_coal/handoverLog.vue index 88edf3e3..bf7527ae 100644 --- a/src/views/enm_coal/handoverLog.vue +++ b/src/views/enm_coal/handoverLog.vue @@ -246,7 +246,7 @@ 处置人 - {{ item.happen_time }} + {{ item.stlog_.start_time }} {{ item.stlog_.cate }} {{ item.stlog_.reason }} {{ item.stlog_.measure }} diff --git a/src/views/enm_coal/power.vue b/src/views/enm_coal/power.vue index 4d54df7c..c4027f73 100644 --- a/src/views/enm_coal/power.vue +++ b/src/views/enm_coal/power.vue @@ -530,6 +530,9 @@ export default { let data = response; data.forEach((item) => { let index = that.mpoints.indexOf(item.mpoint_name); //第几个mpoint + if(index==-1){ + return; + } let ind = item.hour; //xAxis seriesData[index][ind] = item.elec_consume_unit; }); @@ -571,6 +574,9 @@ export default { let data = response; data.forEach((item) => { let index = that.mpoints.indexOf(item.mpoint_name); //第几个mpoint + if(index==-1){ + return; + } let ind = item.day_s - 1; seriesData[index][ind] = item.elec_consume_unit; }); @@ -613,6 +619,9 @@ export default { data.forEach((item) => { let ind = item.month_s - 1; let index = that.mpoints.indexOf(item.mpoint_name); //第几个mpoint + if(index==-1){ + return; + } seriesData[index][ind] = item.elec_consume_unit; }); let options = { ...that.option3 }; diff --git a/src/views/enm_coal/teamAnalysis.vue b/src/views/enm_coal/teamAnalysis.vue index 25947250..7529f30e 100644 --- a/src/views/enm_coal/teamAnalysis.vue +++ b/src/views/enm_coal/teamAnalysis.vue @@ -89,6 +89,7 @@ export default { mgroup: "", }, tableDatas: [], + goalDatas: [], }; }, mounted() { @@ -108,12 +109,11 @@ export default { params.year = year; params.mgroup = that.query.mgroup; this.$API.mtm.goal.list.req(params).then((res) => { - let data = []; + // let data = []; if (res.length > 0) { - data = res[0]; + this.goalDatas = res[0]; } - console.log(data); - that.getData(data); + that.getData(this.goalDatas); }); }); }, @@ -127,43 +127,32 @@ export default { query0.mgroup = that.query.mgroup; let wrapArr = [], wrapArr0 = [], + compareArr0 = [], wrapArrs = []; this.$API.enm.enstat.req(query0).then((res0) => { let data0 = res0; if (data0.length > 0) { data0.forEach((item0) => { //先按月份排序,再按班组排序 - let n0 = item0.month_s; - let ind0 = 0; - if (team_name0.indexOf("甲") > -1) { - ind0 = (n0 - 1) * 3; - } else if (team_name0.indexOf("乙") > -1) { - ind0 = (n0 - 1) * 3 + 1; - } else if (team_name0.indexOf("丙") > -1) { - ind0 = (n0 - 1) * 3 + 2; - } wrapArr0[ind0] = item0; }); - console.log(wrapArr0); } else { } this.$API.enm.enstat.req(that.query).then((res) => { //今年的值 let data = res; if (data.length > 0) { + data.forEach((item) => { + //先按月份排序,再按班组排序 + let compareArr = []; + compareArr.push(item.month_s); + compareArr.push(item.team_name); + compareArr.push(item.elec_consume_unit); + compareArr0.push(compareArr); + }); data.forEach((item) => { //先按月份排序,再按班组排序 let n = item.month_s; - let team_name = item.team_name; - let ind = 0; - if (team_name.indexOf("甲") > -1) { - ind = (n - 1) * 3; - } else if (team_name.indexOf("乙") > -1) { - ind = (n - 1) * 3 + 1; - } else if (team_name.indexOf("丙") > -1) { - ind = (n - 1) * 3 + 2; - } - wrapArrs[ind] = item; let arr = []; let time = "" + item.year_s + "." + item.month_s; arr.push(time); @@ -201,12 +190,12 @@ export default { ? wrapArr0[ind_pre].elec_consume_unit : "/"; } else { - ind_pre = n - 1; - huanqi = wrapArr[ind_pre] - ? wrapArr[ind_pre].elec_consume_unit>=0 - ? wrapArr[ind_pre].elec_consume_unit - : "/" - : "/"; + // 如果 wrapArr数组长度大于0,那么循环遍历wrapArr数组,找到与item.month_s相差1的元素 而 item.name相同,并赋值给huanbi + compareArr0.forEach((item0) => { + if (item0[0] == item.month_s - 1 && item0[1] == item.team_name) { + huanqi = item0[2]; + } + }) } arr[11] = huanqi; //环期值(KW·h/t)上个月的值 if (huanqi !== "/") { @@ -215,22 +204,16 @@ export default { huanqicha = item.celec_consume_unit; } arr[12] = huanqicha; //当期与环期差值(KW·h/t) - arr[13] = - huanqi != "/" ? (huanqicha / huanqi) * 100 : 0; //环比增长率(%) - if (wrapArr0[n]) { - tongqicha = - item.celec_consume_unit - - wrapArr0[n].celec_consume_unit; - tongqi = tongqicha / tongqi; - } else { - tongqicha = item.celec_consume_unit; - tongqi = 0; + // arr[13] = + if (arr[11] !=="/" && arr[11]!==0 && arr[11] !==0 && arr[12] !== "undefined"){ + arr[13] = ((arr[11]/arr[12])*100).toFixed(2); + }else{ + arr[13] = "/"; //环比增长率(%)= 当期与环期差值(KW·h/t)/环期值(KW·h/t)*100% } arr[14] = tongqi; //同比增长率(%) arr[15] = 0.0; //得分 - wrapArr[ind] = arr; + wrapArr.push(arr); }); - console.log(wrapArr); that.tableDatas = wrapArr; } else { } @@ -239,7 +222,7 @@ export default { }, handleQuery() { this.tableDatas = []; - this.getData(); + this.getData(this.goalDatas); }, itemClick(type, item) { this.type = type; diff --git a/src/views/enm_energy/energy.vue b/src/views/enm_energy/energy.vue index 5e2d7e94..61781362 100644 --- a/src/views/enm_energy/energy.vue +++ b/src/views/enm_energy/energy.vue @@ -88,37 +88,41 @@ 电石渣 - 原料磨 + 原料磨 压缩空气(m3) + 车间用水(t) 回转窑 - 煤磨 + 煤磨 压缩空气(m3) + 车间用水(t) - 水泥磨 + 水泥磨 包装 压缩空气(m3) + 车间用水(t) 电量(KW.h) 电量折标煤(tce) 煤粉(t) 煤粉折标煤(tce) - 水(t) + 柴油(t) 柴油折标煤(tce) 余热锅炉外送蒸汽(t) 余热锅炉外送蒸汽折标煤(tce) 产品产量(t) - 单位产品综合能耗(tce/t) + 单位产品综合能耗(tce/t) + 单位产品能耗(tce/t) 电量(KW.h) 电量折标煤(tce) - 水(t) - 窑尾余热利用(tce) + + 产品产量(t) - 单位产品综合能耗(tce/t) + 单位产品能耗(tce/t) @@ -234,27 +238,34 @@ wrapArr[ind][1]=item }else if(item.mgroup_name=='原料压缩空气'){ wrapArr[ind][2]=item + }else if(item.mgroup_name=='原料车间用水'){ + wrapArr[ind][3]=item } }else if(that.deptName=='烧成车间'){ if(item.mgroup_name=='回转窑'){ - wrapArr[ind][1]=item + wrapArr[ind][0]=item }else if (item.mgroup_name=='烧成压缩空气') { wrapArr[ind][2]=item + } + else if (item.mgroup_name=='烧成车间用水') { + wrapArr[ind][3]=item }else{ - wrapArr[ind][0]=item + wrapArr[ind][1]=item } }else{ if(item.mgroup_name=='水泥磨'){ - wrapArr[ind][1]=item + wrapArr[ind][0]=item }else if(item.mgroup_name=='水泥压缩空气'){ wrapArr[ind][2]=item - }else{ - wrapArr[ind][0]=item + }else if(item.mgroup_name=='水泥车间用水'){ + wrapArr[ind][3]=item + }else if(item.mgroup_name=='水泥包装'){ + wrapArr[ind][1]=item } } }); // debugger; - console.log(wrapArr); + // console.log(wrapArr); wrapArr.forEach((item1)=>{ //item1------一天的数据 if(item1!=undefined){ @@ -270,16 +281,25 @@ if(that.deptName=='烧成车间'){ itemArr.push( item1[0].pcoal_consume)//煤粉(t) itemArr.push( item1[0].pcoal_coal_consume)//煤粉折标煤(tce) - itemArr.push( item1[0].water_consume)//水(t) - itemArr.push( item1[0].pcoal_consume)//柴油(t) - itemArr.push( item1[0].pcoal_coal_consume)//柴油折标煤(tce) + // itemArr.push( item1[0].water_consume)//水(t) + // console.log(item1[0].imaterial_data_dict) + if (item1[0].imaterial_data_dict.length>0 || item1[0].imaterial_data_dict.柴油){ + // console.log(item1[0].imaterial_data_dict.柴油.amount_consume) + itemArr.push( item1[0].imaterial_data_dict.柴油.amount_consume)//柴油(t) + itemArr.push( (item1[0].imaterial_data_dict.柴油.amount_consume*1.4571).toFixed(2))//柴油折标煤(tce) + }else{ + itemArr.push(0)//柴油(t) + itemArr.push(0)//柴油折标煤(tce) + } itemArr.push( item1[0].out_steam)//余热锅炉外送蒸汽(t) itemArr.push( item1[0].out_steam_coal)//余热锅炉外送蒸汽折标煤(tce) - }else if(that.deptName=='水泥车间'){ - itemArr.push( item1[0].water_consume)//水 } itemArr.push( item1[0].total_production) //总产量 - itemArr.push( item1[0].cen_consume_unit) // 单位产品综合能耗 + if(item1[1].mgroup_name == '回转窑'){ + itemArr.push( item1[0].cen_consume_unit) + }else{ + itemArr.push( item1[0].en_consume_unit) // 单位产品综合能耗 + } if (item1[1]){ itemArr.push( item1[1].elec_consume) itemArr.push( item1[1].elec_coal_consume) @@ -287,17 +307,22 @@ itemArr.push( 0) itemArr.push( 0) } - if(that.deptName=='原料车间'){ - itemArr.push( item1[1].water_consume)//水 - itemArr.push( item1[1].kiln_end_heat)//窑尾余热 - } + // if(that.deptName=='原料车间'){ + // // itemArr.push( item1[1].water_consume)//水 + // // itemArr.push( item1[1].kiln_end_heat)//窑尾余热 + // } itemArr.push( item1[1].total_production) - itemArr.push( item1[1].cen_consume_unit) + itemArr.push( item1[1].en_consume_unit) if(item1 &&item1[2]){ itemArr.push(item1[2].cair_consume)//压缩空气 }else{ itemArr.push( 0) - } + } + if(item1 &&item1[3]){ + itemArr.push(item1[3].water_consume)//水 + }else{ + itemArr.push(0) + } innerArr.push(itemArr) } }) diff --git a/src/views/enm_kiln/handoverLog.vue b/src/views/enm_kiln/handoverLog.vue index 055de72e..d01bb63e 100644 --- a/src/views/enm_kiln/handoverLog.vue +++ b/src/views/enm_kiln/handoverLog.vue @@ -203,7 +203,7 @@ {{ reportItem.run_rate }} - 停机时长(h) + 停机时长(s) {{ reportItem.shut_sec }} diff --git a/src/views/enm_kiln/teamAnalysis.vue b/src/views/enm_kiln/teamAnalysis.vue index 0ee2adcf..2a801ce9 100644 --- a/src/views/enm_kiln/teamAnalysis.vue +++ b/src/views/enm_kiln/teamAnalysis.vue @@ -152,7 +152,9 @@ export default { query0.mgroup = that.query.mgroup; let wrapArr = [], wrapArr0 = [], - wrapArrs = []; + wrapArrs = [], + comparEarr = [], //班组对比 + compareArr0 = []; this.$API.enm.enstat.req(query0).then((res0) => { let data0 = res0; debugger; @@ -168,35 +170,30 @@ export default { arr0[2] = item0.total_output_unit; arr0[3] = item0.total_output_unit; arr0[4] = item0.run_rate_unit; - if (team_name0.indexOf("甲") > -1) { - ind0 = (n0 - 1) * 3; - } else if (team_name0.indexOf("乙") > -1) { - ind0 = (n0 - 1) * 3 + 1; - } else if (team_name0.indexOf("丙") > -1) { - ind0 = (n0 - 1) * 3 + 2; - } wrapArr0[ind0] = item0; }); - debugger; - console.log(wrapArr0); } else { } this.$API.enm.enstat.req(that.query).then((res) => { let data = res; if (data.length > 0) { + data.forEach((item) => { + //先按月份排序,再按班组排序 + let compareArr = []; + let elecArr = []; + compareArr.push(item.month_s); + elecArr.push(item.month_s); + compareArr.push(item.team_name); + elecArr.push(item.team_name); + compareArr.push(item.coal_consume_unit); + elecArr.push(item.elec_consume_unit); + compareArr0.push(compareArr); + comparEarr.push(elecArr); + }); data.forEach((item) => { //先按月份排序,再按班组排序 let n = item.month_s; - let team_name = item.team_name; let ind = 0; - if (team_name.indexOf("甲") > -1) { - ind = (n - 1) * 3; - } else if (team_name.indexOf("乙") > -1) { - ind = (n - 1) * 3 + 1; - } else if (team_name.indexOf("丙") > -1) { - ind = (n - 1) * 3 + 2; - } - wrapArrs[ind] = item; let arr = []; let time = "" + item.year_s + "." + item.month_s; arr.push(time); @@ -245,7 +242,7 @@ export default { }; let dq = 0 if (arr[13] !== null && arr[13] !== undefined){ - dq = arr[12] - arr[13]; //当期与目标差值(KW·h/t) + dq = (arr[12] - arr[13]).toFixed(2); //当期与目标差值(KW·h/t) }else{ dq == "/" }; @@ -258,21 +255,21 @@ export default { ? wrapArr0[ind_pre].coal_consume_unit : "/"; } else { - ind_pre = ind - 1; - huanbi = wrapArr[ind_pre] - ? wrapArr[ind_pre].coal_consume_unit - ? wrapArr[ind_pre].coal_consume_unit - : "/" - : "/"; + // 如果 wrapArr数组长度大于0,那么循环遍历wrapArr数组,找到与item.month_s相差1的元素 而 item.name相同,并赋值给huanbi + compareArr0.forEach((item0) => { + if (item0[0] == item.month_s - 1 && item0[1] == item.team_name) { + huanbi = item0[2]; + } + }) } arr[15] = huanbi; //环期值(KW·h/t)上个月的值 if(huanbi !=="/"){ - arr[16] = arr[12] - huanbi; //当期与环期差值(KW·h/t) + arr[16] = (arr[12] - arr[15]).toFixed(2); //当期与环期差值(KW·h/t) }else{ arr[16] = "/" }; if (arr[15] !== "/"&& arr[15]!== 0 && arr[16]!=="/") { - arr[17] = (arr[16] / arr[15]) * 100; //环比增长率(%) + arr[17] = ((arr[16] / arr[15]) * 100).toFixed(2); //环比增长率(%) } else{ arr[17] = "/" }; @@ -297,53 +294,52 @@ export default { ? item.高温风机_consume_unit : "/"; arr[20] = - item.篦冷机一室风机_consume_unit != null - ? item.篦冷机一室风机_consume_unit + item.篦冷机一室风机电机_consume_unit != null + ? item.篦冷机一室风机电机_consume_unit : "/"; arr[21] = - item.篦冷机三室风机_consume_unit != null - ? item.篦冷机三室风机_consume_unit + item.篦冷机三室风机电机_consume_unit != null + ? item.篦冷机三室风机电机_consume_unit : "/"; arr[22] = - item.篦冷机二室风机_consume_unit != null - ? item.篦冷机二室风机_consume_unit + item.篦冷机二室风机电机_consume_unit != null + ? item.篦冷机二室风机电机_consume_unit : "/"; arr[23] = - item.窑头排风机_consume_unit != null - ? item.窑头排风机_consume_unit + item.窑头排风机主电机_consume_unit != null + ? item.窑头排风机主电机_consume_unit : "/"; arr[24] = item.elec_consume_unit; //当期值(KW·h/t) // arr[25] = item.celec_consume_unit; //目标值(KW·h/t)//需要接口获取 if (item.elec_consume_unit != null &&item.elec_consume_unit !== "/"){ - arr[26] = arr[24]-arr[25] //当期与目标差值(KW·h/t) + arr[26] = (arr[24]-arr[25]).toFixed(2); //当期与目标差值(KW·h/t) } - let ind_pre1 = 0, - huanbi1 = 0; + let huanbiec = 0; if (item.month_s == 1) { ind_pre1 = 12; - huanbi1 = wrapArr0[ind_pre] + huanbiec = wrapArr0[ind_pre] ? wrapArr0[ind_pre].elec_consume_unit : "/"; } else { - ind_pre1 = ind - 1; - huanbi1 = wrapArr[ind_pre] - ? wrapArr[ind_pre].elec_consume_unit - ? wrapArr[ind_pre].elec_consume_unit - : "/" - : "/"; + // 如果 wrapArr数组长度大于0,那么循环遍历wrapArr数组,找到与item.month_s相差1的元素 而 item.name相同,并赋值给huanbi + comparEarr.forEach((item0) => { + if (item0[0] == item.month_s - 1 && item0[1] == item.team_name) { + huanbiec = item0[2]; + } + }) } - arr[27] = huanbi; //环期值(KW·h/t)上个月的值 - if(arr[27]!=="/" && huanbi1!=="/"){ - arr[28] = arr[24] - huanbi1; //当期与环期差值(KW·h/t) + arr[27] = huanbiec; //环期值(KW·h/t)上个月的值 + if(arr[27]!=="/" && huanbiec!=="/"){ + arr[28] = (arr[24] - huanbiec).toFixed(2); //当期与环期差值(KW·h/t) }else{ arr[28] = "/" } - if(arr[28]!=="/" && huanbi1!=="/"){ - arr[29] = (arr[28] / huanbi1) * 100; //环比增长率(%) + if(arr[28]!=="/" && huanbiec!=="/"&&huanbiec!==0){ + arr[29] = ((arr[28] / huanbiec) * 100).toFixed(2); //环比增长率(%) }else{ - arr[29] = "/"}; //环比增长率(%) + arr[29] = 0}; //环比增长率(%) arr[30] = item.celec_consume_unit; //同比增长率(%) - wrapArr[ind] = arr; + wrapArr.push(arr); }); that.tableDatas = wrapArr; } else { diff --git a/src/views/enm_kiln/workshopAnalysis.vue b/src/views/enm_kiln/workshopAnalysis.vue index b231088f..c13f34af 100644 --- a/src/views/enm_kiln/workshopAnalysis.vue +++ b/src/views/enm_kiln/workshopAnalysis.vue @@ -516,11 +516,11 @@ export default { //环比增长率(%) let lastRate = 0; if ( - lastDiff == "/" && + lastDiff !== "/" && lastNum !== "/" && lastNum !== 0 ) { - lastRate = ((lastDiff / lastNum) * 100).toFixed(2); + lastRate = ((lastDiff / arrs[4]) * 100).toFixed(2); } else { lastRate = "/"; } @@ -568,7 +568,7 @@ export default { : "/"; } if (arrs2[1] !== "/" && lastNum2 !== "/") { - lastDiff2 = arrs2[1] - lastNum2; + lastDiff2 = (arrs2[1] - lastNum2).toFixed(2); } else { lastDiff2 = "/"; } @@ -576,11 +576,11 @@ export default { //环比增长率(%) let lastRate2 = 0; if ( - lastDiff2 == "/" && + lastDiff2 !== "/" && lastNum2 !== "/" && lastNum2 !== 0 ) { - lastRate2 = (lastDiff2 / lastNum2) * 100; + lastRate2 = ((lastDiff2 / lastNum2) * 100).toFixed(2); } else { lastRate2 = "/"; } @@ -637,11 +637,11 @@ export default { //环比增长率(%) let lastRate3 = 0; if ( - lastDiff3 == "/" && + lastDiff3 !== "/" && lastNum3 !== "/" && lastNum3 !== 0 ) { - lastRate3 = (lastDiff3 / lastNum3) * 100; + lastRate3 = ((lastDiff3 / lastNum3) * 100).toFixed(2); } else { lastRate3 = "/"; } @@ -698,11 +698,11 @@ export default { //环比增长率(%) let lastRate4 = 0; if ( - lastDiff4 == "/" && + lastDiff4 !== "/" && lastNum4 !== "/" && lastNum4 !== 0 ) { - lastRate4 = (lastDiff4 / lastNum4) * 100; + lastRate4 = ((lastDiff4 / lastNum4) * 100).toFixed(2); } else { lastRate4 = "/"; } diff --git a/src/views/enm_kilnbase/handoverLog.vue b/src/views/enm_kilnbase/handoverLog.vue index 99db6a2f..15ecb5eb 100644 --- a/src/views/enm_kilnbase/handoverLog.vue +++ b/src/views/enm_kilnbase/handoverLog.vue @@ -191,7 +191,7 @@ {{ reportItem.run_rate }} - 停机时长(h) + 停机时长(s) {{ reportItem.shut_hour }} @@ -239,7 +239,7 @@ 处置人 - {{ item.happen_time }} + {{ item.create_time }} {{ item.cate }} {{ item.reason }} {{ item.measure }} diff --git a/src/views/enm_limestone/handoverLog.vue b/src/views/enm_limestone/handoverLog.vue index fa7f4bd9..15ad9a11 100644 --- a/src/views/enm_limestone/handoverLog.vue +++ b/src/views/enm_limestone/handoverLog.vue @@ -193,7 +193,7 @@ 处置人 - {{ item.happen_time }} + {{ item.stlog_.start_time }} {{ item.cate }} {{ item.reason }} {{ item.measure }} diff --git a/src/views/enm_mill/handoverLog.vue b/src/views/enm_mill/handoverLog.vue index 86b3ab49..3e47949f 100644 --- a/src/views/enm_mill/handoverLog.vue +++ b/src/views/enm_mill/handoverLog.vue @@ -204,7 +204,7 @@ {{ reportItem.run_rate }} - 停机时长(h) + 停机时长(s) {{ reportItem.shut_sec }} @@ -263,7 +263,7 @@ 处置人 - {{ item.happen_time }} + {{ item.stlog_.start_time }} {{ item.stlog_.cate }} {{ item.stlog_.reason }} {{ item.stlog_.measure }} diff --git a/src/views/enm_mill/power.vue b/src/views/enm_mill/power.vue index 6c75c870..3368b63b 100644 --- a/src/views/enm_mill/power.vue +++ b/src/views/enm_mill/power.vue @@ -602,6 +602,9 @@ export default { let data = response; data.forEach((item) => { let index = that.mpoints.indexOf(item.mpoint_name); //第几个mpoint + if(index==-1){ + return; + } let ind = item.hour; //xAxis seriesData[index][ind] = item.elec_consume_unit; }); @@ -644,6 +647,9 @@ export default { data.forEach((item) => { let index = that.mpoints.indexOf(item.mpoint_name); //第几个mpoint let ind = item.day_s - 1; + if(index==-1){ + return; + } seriesData[index][ind] = item.elec_consume_unit; }); let options = { ...that.option2 }; diff --git a/src/views/enm_mill/report.vue b/src/views/enm_mill/report.vue index a49aba20..a214b2f0 100644 --- a/src/views/enm_mill/report.vue +++ b/src/views/enm_mill/report.vue @@ -814,7 +814,6 @@ export default { }, dateChange(val) { let that = this; - console.log(val); if (val !== null) { if (this.typeRadio == "day") { let year = val.split("-")[0]; diff --git a/src/views/enm_mill/teamAnalysis.vue b/src/views/enm_mill/teamAnalysis.vue index c119b06c..606c7122 100644 --- a/src/views/enm_mill/teamAnalysis.vue +++ b/src/views/enm_mill/teamAnalysis.vue @@ -119,11 +119,21 @@ export default { if (res.length > 0) { data = res[0]; } - that.getData(data); + that.getGoalData(); }); }); }, methods: { + getGoalData() { + let that = this; + let params = {}; + params.page = 0; + params.year = that.query.year_s; + params.mgroup = that.query.mgroup; + this.$API.mtm.goal.list.req(params).then((res) => { + that.getData(res); + }); + }, getData(goalData) { let that = this; let query0 = {}; @@ -133,6 +143,7 @@ export default { query0.mgroup = that.query.mgroup; let wrapArr = [], wrapArr0 = [], + compareArr0 = [], wrapArrs = []; this.$API.enm.enstat.req(query0).then((res0) => { let data0 = []; //去年的值 @@ -140,38 +151,27 @@ export default { if (data0.length > 0) { data0.forEach((item0) => { //先按月份排序,再按班组排序 - let n0 = item0.month_s; let ind0 = 0; - let team_name0 = item0.team_name; - if (team_name0.indexOf("甲") > -1) { - ind0 = (n0 - 1) * 3; - } else if (team_name0.indexOf("乙") > -1) { - ind0 = (n0 - 1) * 3 + 1; - } else if (team_name0.indexOf("丙") > -1) { - ind0 = (n0 - 1) * 3 + 2; - } wrapArr0[ind0] = item0; }); - console.log(wrapArr0); } else { } this.$API.enm.enstat.req(that.query).then((res) => { //今年的值 let data = res; if (data.length > 0) { + data.forEach((item) => { + //先按月份排序,再按班组排序 + let compareArr = []; + compareArr.push(item.month_s); + compareArr.push(item.team_name); + compareArr.push(item.elec_consume_unit); + compareArr0.push(compareArr); + }); data.forEach((item) => { //先按月份排序,再按班组排序 let n = item.month_s; - let team_name = item.team_name; let ind = 0; - if (team_name.indexOf("甲") > -1) { - ind = (n - 1) * 3; - } else if (team_name.indexOf("乙") > -1) { - ind = (n - 1) * 3 + 1; - } else if (team_name.indexOf("丙") > -1) { - ind = (n - 1) * 3 + 2; - } - wrapArrs[ind] = item; let arr = []; let time = "" + item.year_s + "." + item.month_s; arr.push(time); @@ -195,8 +195,8 @@ export default { : "/"; //设备 arr[9] = - item.循环风机1906_consume_unit != null - ? item.循环风机1906_consume_unit + item.循环风机_consume_unit != null + ? item.循环风机_consume_unit : "/"; arr[10] = item.系统风机_consume_unit != null @@ -223,12 +223,12 @@ export default { ? wrapArr0[ind_pre].elec_consume_unit : "/"; } else { - ind_pre = n - 1; - huanqi = wrapArr[ind_pre] - ? wrapArr[ind_pre].elec_consume_unit - ? wrapArr[ind_pre].elec_consume_unit - : "/" - : "/"; + // 如果 wrapArr数组长度大于0,那么循环遍历wrapArr数组,找到与item.month_s相差1的元素 而 item.name相同,并赋值给huanbi + compareArr0.forEach((item0) => { + if (item0[0] == item.month_s - 1 && item0[1] == item.team_name) { + huanqi = item0[2]; + } + }) } arr[14] = huanqi; //环期值(KW·h/t)上个月的值 if (huanqi !== "/") { @@ -251,7 +251,7 @@ export default { arr[17] = tongqi; //同比增长率(%):本月-去年本月/去年 arr[18] = 0.0; //同比增长率(%) - wrapArr[ind] = arr; + wrapArr.push(arr); }); let newArr = []; for (let i = 0; i < wrapArr.length; i++) { @@ -270,7 +270,7 @@ export default { }, handleQuery() { this.tableDatas = []; - this.getData(); + this.getGoalData(); }, itemClick(type, item) { this.type = type; diff --git a/src/views/enm_monthSet/feeset.vue b/src/views/enm_monthSet/feeset.vue index 29791d32..42be3615 100644 --- a/src/views/enm_monthSet/feeset.vue +++ b/src/views/enm_monthSet/feeset.vue @@ -50,17 +50,17 @@ @click="handleQuery" > -
+ - + { + this.$API.mtm.mgroup.list.req({ page: 0, cate:"section"}).then((res) => { this.options = res; }); }, diff --git a/src/views/enm_monthSet/goalSetting.vue b/src/views/enm_monthSet/goalSetting.vue index fd287157..aa025d89 100644 --- a/src/views/enm_monthSet/goalSetting.vue +++ b/src/views/enm_monthSet/goalSetting.vue @@ -42,14 +42,14 @@ @click="handleQuery" >
-
+
-
+ diff --git a/src/views/enm_pack/handoverLog.vue b/src/views/enm_pack/handoverLog.vue index a614992f..a6ebd564 100644 --- a/src/views/enm_pack/handoverLog.vue +++ b/src/views/enm_pack/handoverLog.vue @@ -213,7 +213,7 @@ 处置人 - {{ item.happen_time }} + {{ item.stlog_.start_time }} {{ item.stlog_.cate }} {{ item.stlog_.reason }} {{ item.stlog_.measure }} diff --git a/src/views/enm_pack/report.vue b/src/views/enm_pack/report.vue index 625bd68c..c49129a0 100644 --- a/src/views/enm_pack/report.vue +++ b/src/views/enm_pack/report.vue @@ -117,7 +117,7 @@
- +
{ - console.log("水泥包装", res); that.query.mgroup = res[0].id; //年 let params1 = {}; @@ -569,7 +567,7 @@ export default { }else if (item.mpoint_name == "出厂熟料"){ that.tableDatas[8][4] = item.val; }else if (item.mpoint_name == "包装进线") { - that.tableDatas[9][4] = item.val; + that.tableDatas[9][4] = item.elec_consume_unit; } } )} @@ -603,7 +601,7 @@ export default { }else if (item.mpoint_name == "出厂熟料"){ that.tableDatas[8][3] = item.val; }else if (item.mpoint_name == "包装进线") { - that.tableDatas[9][3] = item.val; + that.tableDatas[9][3] = item.elec_consume_unit; } } ) @@ -684,7 +682,7 @@ export default { }else if (item.mpoint_name == "出厂熟料"){ that.tableDatas[8][2] = item.val; }else if (item.mpoint_name == "包装进线") { - that.tableDatas[9][2] = item.val; + that.tableDatas[9][2] = item.elec_consume_unit; } } ) @@ -746,7 +744,6 @@ export default { }, dateChange(val) { let that = this; - console.log(val); if (val !== null) { if (this.typeRadio == "month") { let year = val.split("-")[0]; @@ -805,7 +802,7 @@ export default { }else if (item.mpoint_name == "出厂熟料"){ seriesData8[ind] = item.val; }else if (item.mpoint_name == "包装进线") { - seriesData9[ind] = item.val; + seriesData9[ind] = item.elec_consume_unit; } }); let options = { ...that.option1 }; @@ -869,7 +866,7 @@ export default { }else if (item.mpoint_name == "出厂熟料"){ seriesData8[ind] = item.val; }else if (item.mpoint_name == "包装进线") { - seriesData9[ind] = item.val; + seriesData9[ind] = item.elec_consume_unit; } }); let options = { ...that.option2 }; @@ -897,6 +894,14 @@ export default { this.cate = item[1]; this.asynDialog = true; }, + itemClick1(type, item) { + this.chartShow = false; + this.$API.bi.dataset.exec.req("3322567213885833216").then((res) => { + this.myOption = JSON.parse(res.echart_options); + debugger; + this.chartShow = true; + }); + }, handlePrint() { this.$PRINT("#myReport"); }, diff --git a/src/views/enm_pack/teamAnalysis.vue b/src/views/enm_pack/teamAnalysis.vue index 19e40fd5..d9fd9b88 100644 --- a/src/views/enm_pack/teamAnalysis.vue +++ b/src/views/enm_pack/teamAnalysis.vue @@ -97,22 +97,29 @@ export default { this.$API.mtm.mgroup.list .req({ page: 0, search: "水泥包装" }) .then((res) => { - console.log("水泥包装", res); that.query.mgroup = res[0].id; - let params = {}; - params.page = 0; - params.year = year; - params.mgroup = that.query.mgroup; - this.$API.mtm.goal.list.req(params).then((res) => { - let data = []; - if (res.length > 0) { - data = res[0]; - } - that.getData(data); - }); + that.getGoalData(); }); }, methods: { + getGoalData() { + const self = this; + let params = {}; + params.page = 0; + params.year = self.query.year_s; + params.mgroup = self.query.mgroup; + this.$API.mtm.goal.list.req(params).then((res) => { + // let data = []; + // if (res.length > 0) { + // self.data = res[1]; + // console.log("目标数据", self.data); + // } + self.getData(res[1]); + }) + .catch((error) => { + console.error('获取目标数据失败:', error); + }); + }, getData(goalData) { let that = this; let query0 = {}; @@ -121,7 +128,7 @@ export default { query0.year_s = that.query.year_s - 1; let wrapArr = [], wrapArr0 = [], - wrapArrs = []; + compareArr0 = []; this.$API.enm.enstat.req(query0).then((res0) => { let data0 = res0; if (data0.length > 0) { @@ -129,44 +136,39 @@ export default { //先按月份排序,再按班组排序 let n0 = item0.month_s; let ind0 = 0; - let team_name0 = item0.team_name; - if (team_name0.indexOf("甲") > -1) { - ind0 = (n0 - 1) * 3; - } else if (team_name0.indexOf("乙") > -1) { - ind0 = (n0 - 1) * 3 + 1; - } else if (team_name0.indexOf("丙") > -1) { - ind0 = (n0 - 1) * 3 + 2; - } wrapArr0[ind0] = item0; }); - console.log(wrapArr0); - } else { - } - this.$API.enm.enstat.req(that.query).then((res) => { + } else {} + + }); + this.$API.enm.enstat.req(that.query).then((res) => { let data = res; if (data.length > 0) { + data.forEach((item) => { + //先按月份排序,再按班组排序 + let compareArr = []; + compareArr.push(item.month_s); + compareArr.push(item.team_name); + compareArr.push(item.elec_consume_unit); + compareArr0.push(compareArr); + }); + data.forEach((item) => { //先按月份排序,再按班组排序 let n = item.month_s; - let team_name = item.team_name; - let ind = 0; - if (team_name.indexOf("甲") > -1) { - ind = (n - 1) * 3; - } else if (team_name.indexOf("乙") > -1) { - ind = (n - 1) * 3 + 1; - } else if (team_name.indexOf("丙") > -1) { - ind = (n - 1) * 3 + 2; - } - wrapArrs[ind] = item; let arr = []; + let ind = 0; let time = "" + item.year_s + "." + item.month_s; arr.push(time); + arr.push(item.team_name); + arr.push(item.total_production); arr[3] = item.elec_consume_unit; //当期值(KW·h/t) + let keyVale = "goal_val_" + n; arr[4] = goalData[keyVale]; //目标值(KW·h/t)//需要接口获取 - arr[5] = arr[3] - arr[4]; //当期与目标差值(KW·h/t) + arr[5] = (arr[3] - arr[4]).toFixed(2); //当期与目标差值(KW·h/t) let ind_pre = 0, huanbi = 0; if (item.month_s == 1) { @@ -175,25 +177,24 @@ export default { ? wrapArr0[ind_pre].elec_consume_unit : "/"; } else { - ind_pre = ind - 1; - huanbi = wrapArr[ind_pre] - ? wrapArr[ind_pre].elec_consume_unit - ? wrapArr[ind_pre].elec_consume_unit - : "/" - : "/"; + // 如果 wrapArr数组长度大于0,那么循环遍历wrapArr数组,找到与item.month_s相差1的元素 而 item.name相同,并赋值给huanbi + compareArr0.forEach((item0) => { + if (item0[0] == item.month_s - 1 && item0[1] == item.team_name) { + huanbi = item0[2]; + } + }) } arr[6] = huanbi; //环期值(KW·h/t)上个月的值\ - let diff = 0; - if (arr[6] == "/"){ - diff == "/"; + if (arr[6] !== "/"){ + arr[7] = (arr[3] - arr[6]).toFixed(2); //当期与环期差值(KW·h/t) }else{ - diff = arr[3] - arr[6]; //当期与环期差值(KW·h/t) + arr[7] = "/"; //当期与环期差值(KW·h/t) } - arr[7] = diff; - if (arr[7]=="/" || arr[6]=="/" || arr[6]==0){ - arr[8] == "/"; + // console.log(arr[7], arr[6]) + if (arr[7] !=="/" && arr[6] !==0 && arr[7] !== "undefined"){ + arr[8] = ((arr[7]/arr[6])*100).toFixed(2); }else{ - arr[8] = (arr[7]/arr[6])*100 //环比增长率(%)= 当期与环期差值(KW·h/t)/环期值(KW·h/t)*100% + arr[8] = "/"; //环比增长率(%)= 当期与环期差值(KW·h/t)/环期值(KW·h/t)*100% } let sameRate = 0; if ( @@ -201,7 +202,7 @@ export default { wrapArr0[ind].elec_consume_unit ) { sameRate = - ((arrs[1] - + ((arr[3] - wrapArr0[ind].elec_consume_unit) / wrapArr0[ind].elec_consume_unit) * 100; @@ -210,17 +211,17 @@ export default { } arr[9] = sameRate; ///同比增长率(%)需要当前值/ 上一年同一个月的值即wrapArr0[ind].elec_consume_unit // arr[10] = item.celec_consume_unit; //同比增长率(%)需要当前值-上一年同一个月的值即wrapArr0[ind].elec_consume_unit - wrapArr[ind] = arr; + wrapArr.push(arr); + // console.log(wrapArr); }); that.tableDatas = wrapArr; } else { } }); - }); }, handleQuery() { this.tableDatas = []; - this.getData(); + this.getGoalData(); }, itemClick(type, item) { this.type = type; @@ -231,7 +232,6 @@ export default { this.$API.bi.dataset.exec.req("3322567213885833216").then((res) => { this.myOption = JSON.parse(res.echart_options); debugger; - console.log(this.myOption); this.chartShow = true; }); }, diff --git a/src/views/enm_pack/workshopAnalysis.vue b/src/views/enm_pack/workshopAnalysis.vue index d2e65acb..f64d794e 100644 --- a/src/views/enm_pack/workshopAnalysis.vue +++ b/src/views/enm_pack/workshopAnalysis.vue @@ -264,11 +264,11 @@ export default { //环比增长率(%) let lastRate = 0; if ( - lastDiff == "/" && + lastDiff !== "/" && lastNum !== "/" && lastNum !== 0 ) { - lastRate = (lastDiff / lastNum) * 100; + lastRate = ((lastDiff / lastNum) * 100).toFixed(2); } else { lastRate = "/"; } diff --git a/src/views/enm_report/costing.vue b/src/views/enm_report/costing.vue index 53b7cece..70bb133b 100644 --- a/src/views/enm_report/costing.vue +++ b/src/views/enm_report/costing.vue @@ -38,7 +38,7 @@ 班次 班组 实际产量(t) - 总成本(元) + 单位成本(元/吨) 直接材料 直接人工 @@ -101,7 +101,7 @@ export default { mgroupOptions: [], tableName: '班组成本计算', options: [ - { id: 0, name: '班统计' }, + // { id: 0, name: '班统计' }, { id: 1, name: '日统计' }, { id: 2, name: '月统计' }, ], @@ -174,6 +174,7 @@ export default { }, getData() { let that = this; + that.tableData1 = []; that.data1 = 0; that.data2 = 0; that.data3 = 0; @@ -200,27 +201,53 @@ export default { } that.$API.enm.enstat.req(params).then(res => { if (res.length > 0) { - let materials = res[0].imaterial_data; + let materials = res[res.length - 1].imaterial_data; let arr = []; + let dataArr = []; materials.forEach(item => { - if (item.material_type == 0) {//电水 - that.data2 = that.data2 + 4; - } else if (item.material_type == 30 || item.material_type == 20) {//原材料 + if (item.material_name == "湿电石渣进厂"||item.material_name == "工业水"||item.material_name == "动力电") { + // Skip adding item details to arr for "湿电石渣进厂" + return; + } + if (item.material_type == 30 || item.material_type == 20) {//原材料 that.data1 = that.data1 + 4; } else if (item.material_type == 40) {//辅助材料 that.data3 = that.data3 + 4; } - arr.push(item.material_name) + let materialName = item.material_name + if (materialName === "入窑生料") { + materialName = "生料"; + } else if (materialName === "入窑煤粉") { + materialName = "原煤"; + } + arr.push(materialName) arr.push('单价(元/吨)') arr.push('总成本(元)') arr.push('单位成本(元/吨)') }) + materials.forEach(item => { + if(item.material_name == "动力电"){ + that.data2 = that.data2 + 4 + arr.push(item.material_name) + arr.push('单价(元/度)') + arr.push('总成本(元)') + arr.push('单位成本(元/吨)') + } + }) + materials.forEach(item => { + if(item.material_name == "工业水"){ + that.data2 = that.data2 + 4 + arr.push(item.material_name) + arr.push('单价(元/吨)') + arr.push('总成本(元)') + arr.push('单位成本(元/吨)') + } + }) that.allCol = arr.length + 16 that.materialList = arr; - let dataArr = []; + res.forEach(itemData => { let time = ''; - dataArr = []; if (that.query.type == 0) { time = itemData.year_s + '.' + itemData.month_s + '.' + itemData.day_s; } else if (that.query.type == 1) { @@ -234,20 +261,42 @@ export default { dataArr.push(itemData.team_name); } dataArr.push(itemData.total_production); - dataArr.push(itemData.coal_consume_unit); - dataArr.push(itemData.cen_consume_unit); + // dataArr.push(itemData.coal_consume_unit); + dataArr.push(itemData.production_cost_unit); let sub1data = itemData.imaterial_data; for (let i = 0; i < sub1data.length; i++) { - dataArr.push(sub1data[i].cost) - dataArr.push(sub1data[i].price_unit) - dataArr.push(sub1data[i].amount_consume) - dataArr.push(sub1data[i].cost_unit) + if (sub1data[i].material_name === '湿电石渣进厂'|| sub1data[i].material_name === '动力电'|| sub1data[i].material_name === '工业水'){ + continue; + } + dataArr.push((sub1data[i].amount_consume).toFixed(2)) + dataArr.push((sub1data[i].price_unit).toFixed(2)) + dataArr.push((sub1data[i].cost).toFixed(2)) + dataArr.push((sub1data[i].cost_unit).toFixed(2)) + } + for (let i = 0; i < sub1data.length; i++) { + if (sub1data[i].material_name == '动力电') { + dataArr.push((sub1data[i].amount_consume).toFixed(2)); + dataArr.push((sub1data[i].price_unit).toFixed(2)) + dataArr.push((sub1data[i].cost).toFixed(2)); + dataArr.push((sub1data[i].cost_unit).toFixed(2)); + } + } + for (let i = 0; i < sub1data.length; i++) { + if (sub1data[i].material_name == '工业水') { + dataArr.push((sub1data[i].amount_consume).toFixed(2)); + dataArr.push((sub1data[i].price_unit).toFixed(2)); + dataArr.push((sub1data[i].cost).toFixed(2)); + dataArr.push((sub1data[i].cost_unit).toFixed(2)); + } } let otherdata = itemData.other_cost_data; for (let j = 0; j < otherdata.length; j++) { - dataArr.push(otherdata[j].cost_unit) + dataArr.push((otherdata[j].cost_unit).toFixed(2)) } that.tableData1.push(dataArr) + dataArr = []; + arr = []; + }) } }) diff --git a/src/views/enm_report/exception.vue b/src/views/enm_report/exception.vue new file mode 100644 index 00000000..396c1351 --- /dev/null +++ b/src/views/enm_report/exception.vue @@ -0,0 +1,224 @@ + + + + \ No newline at end of file diff --git a/src/views/enm_report/quality.vue b/src/views/enm_report/quality.vue index 0c05bb67..3cfa68fb 100644 --- a/src/views/enm_report/quality.vue +++ b/src/views/enm_report/quality.vue @@ -204,22 +204,22 @@ that.header2Obj=[{name:'辅料',lengths:3},{name:'干混生料',lengths:4}]; that.header2 = ['辅料','干混生料'];//物料 // that.header3 = ['细度','Fe2O3','水分','细度','Fe2O3','水分','CaO'];//检测项 - that.header4 = ['平均值','检次','合次','及格率','平均值','检次','合次','及格率','平均值','检次','合次','及格率','平均值','检次','合次','及格率','平均值','检次','合次','及格率','平均值','检次','合次','及格率','平均值','检次','合次','及格率'];//检测项 + that.header4 = ['平均值','检次','合次','合格率','平均值','检次','合次','合格率','平均值','检次','合次','合格率','平均值','检次','合次','合格率','平均值','检次','合次','合格率','平均值','检次','合次','合格率','平均值','检次','合次','合格率'];//检测项 }else if(that.deptName=='烧成车间'){ that.header2Obj=[{name:'入窑生料',lengths:4},{name:'熟料',lengths:4}]; that.header2 = ['入窑生料','熟料'];//物料 // that.header3 = ['CaO','Fe2O3','细度','水分','立升重','f-CaO','细度','水分'];//检测项 - that.header4 = ['平均值','检次','合次','及格率','平均值','检次','合次','及格率','平均值','检次','合次','及格率','平均值','检次','合次','及格率','平均值','检次','合次','及格率','平均值','检次','合次','及格率','平均值','检次','合次','及格率','平均值','检次','合次','及格率'];//检测项 + that.header4 = ['平均值','检次','合次','合格率','平均值','检次','合次','合格率','平均值','检次','合次','合格率','平均值','检次','合次','合格率','平均值','检次','合次','合格率','平均值','检次','合次','合格率','平均值','检次','合次','合格率','平均值','检次','合次','合格率'];//检测项 }else{ that.header2Obj=[{name:'出磨水泥',lengths:3}]; that.header2 = ['出磨水泥'];//物料 // that.header3 = ['比表面积','SO3','掺量'];//检测项 - that.header4 = ['平均值','检次','合次','及格率','平均值','检次','合次','及格率','平均值','检次','合次','及格率'];//检测项 + that.header4 = ['平均值','检次','合次','合格率','平均值','检次','合次','合格率','平均值','检次','合次','合格率'];//检测项 } let params = {page: 0}; let arr = []; - if(that.query.type==0){//日 + console.log(that.query.month) arr = that.query.month.split('-'); params.year_s = arr[0]; params.month_s = arr[1]; @@ -248,6 +248,7 @@ } if(that.deptName=='原料车间'){ wrapArr[ind].push(item) + }else if(that.deptName=='烧成车间'){ if(item.mgroup_name=='回转窑'){ wrapArr[ind][1]=item @@ -258,7 +259,6 @@ wrapArr[ind].push(item) } }); - wrapArr = wrapArr.filter(item=>{ return item }) @@ -269,6 +269,7 @@ let time =item1[0].day_s!=null? item1[0].year_s+'.'+item1[0].month_s+'.'+item1[0].day_s:item1[0].year_s+'.'+item1[0].month_s; itemArr.push(time) //遍历每个工段 + console.log(item1) item1.forEach(item2=>{ let data2 =item2.qua_data; //遍历一个工段的物料检验数据 @@ -285,22 +286,22 @@ header4tem.push('平均值') header4tem.push('检次') header4tem.push('合次') - header4tem.push('及格率') + header4tem.push('合格率') let indexObj = header2tem.indexOf(item3.material_name); if(indexObj>0&&index3==0){ let inde = indexObj-1; let ind =header2Objtem[inde].lengths*4+1; - itemArr[ind] = item3.val_avg.toFixed(2); + itemArr[ind] = (item3.val_avg).toFixed(2); itemArr.push(item3.num_test) itemArr.push(item3.num_ok) let pass = (item3.rate_pass).toFixed(2); pass= pass+'%'; itemArr.push(pass) }else{ - itemArr.push(item3.val_avg.toFixed(2)) - itemArr.push(item3.num_test) + itemArr.push(Number(item3.val_avg).toFixed(2)); + itemArr.push(item3.num_test); itemArr.push(item3.num_ok) - let pass = (item3.rate_pass).toFixed(2); + let pass = Number(item3.rate_pass).toFixed(2); pass= pass+'%'; itemArr.push(pass) } @@ -332,7 +333,6 @@ if(header4.length>0){ that.header4 = header4; } - console.log(innerArr) this.$forceUpdate(); innerArr.forEach(item=>{ if(item.length>1){ diff --git a/src/views/enm_report/reportDay.vue b/src/views/enm_report/reportDay.vue index 7749a016..47976517 100644 --- a/src/views/enm_report/reportDay.vue +++ b/src/views/enm_report/reportDay.vue @@ -63,8 +63,8 @@ {{item[1]}} {{item[1]}} {{item[1]}} - {{item[1]}} - {{item[1]}} + {{item[1]}} + {{item[1]}} {{item[1]}} {{item[2]}} {{item[3]}} @@ -129,23 +129,16 @@ [30,'成本','日生料成本(元/吨)'], [31,'成本','日熟料成本(元/吨)'], [32,'成本','日水泥粉磨成本(元/吨)'], - [33,'成本','日水泥包装成本(元/吨)'], + // [33,'成本','日水泥包装成本(元/吨)'], - [34,'耗电量','日电石渣耗电量(kw.h)'], - [35,'耗电量','日生料耗电量(kw.h)'], - [36,'耗电量','日熟料耗电量(kw.h)'], - [37,'耗电量','日水泥粉磨耗电量(kw.h)'], - [38,'耗电量','日水泥包装耗电量(kw.h)'], - [39,'耗电量','日生活区耗电量(kw.h)'], + [33,'耗电量','日电石渣耗电量(kw.h)'], + [34,'耗电量','日生料耗电量(kw.h)'], + [35,'耗电量','日熟料耗电量(kw.h)'], + [36,'耗电量','日水泥粉磨耗电量(kw.h)'], + [37,'耗电量','日水泥包装耗电量(kw.h)'], + [38,'耗电量','日生活区耗电量(kw.h)'], - - ['生产异常动态','工段','类别','原因','处置措施','处置人'], - ['生产异常动态','电石渣'], - ['生产异常动态','原料磨'], - ['生产异常动态','回转窑'], - ['生产异常动态','煤磨'], - ['生产异常动态','水泥磨'], ], year:'', month:'', @@ -223,23 +216,23 @@ that.tableDatas[12][3] = dataList.水泥磨.elec_consume_unit; that.tableDatas[13][3] = dataList.水泥包装.elec_consume_unit; //产量(t) - that.tableDatas[14][3] = dataList.电石渣.production_hour; - that.tableDatas[16][3] = dataList.原料磨.production_hour; - that.tableDatas[18][3] = dataList.回转窑.production_hour; - that.tableDatas[20][3] = dataList.水泥磨.production_hour; + that.tableDatas[14][3] = dataList.电石渣.total_production; + that.tableDatas[16][3] = dataList.原料磨.total_production; + that.tableDatas[18][3] = dataList.回转窑.total_production; + that.tableDatas[20][3] = dataList.水泥磨.total_production; //成本(元/吨) that.tableDatas[28][3] = dataList.电石渣.production_cost_unit; that.tableDatas[29][3] = dataList.原料磨.production_cost_unit; that.tableDatas[30][3] = dataList.回转窑.production_cost_unit; that.tableDatas[31][3] = dataList.水泥磨.production_cost_unit; - that.tableDatas[32][3] = dataList.水泥包装.production_cost_unit; + // that.tableDatas[32][3] = dataList.水泥包装.production_cost_unit; //耗电量(kw.h) - that.tableDatas[33][3] = dataList.电石渣.elec_consume; - that.tableDatas[34][3] = dataList.原料磨.elec_consume; - that.tableDatas[35][3] = dataList.回转窑.elec_consume; - that.tableDatas[36][3] = dataList.煤磨.elec_consume; - that.tableDatas[37][3] = dataList.水泥磨.elec_consume; - that.tableDatas[38][3] = dataList.水泥包装.elec_consume; + that.tableDatas[32][3] = dataList.电石渣.elec_consume; + that.tableDatas[33][3] = dataList.原料磨.elec_consume; + that.tableDatas[34][3] = dataList.回转窑.elec_consume; + that.tableDatas[35][3] = dataList.煤磨.elec_consume; + that.tableDatas[36][3] = dataList.水泥磨.elec_consume; + that.tableDatas[37][3] = dataList.水泥包装.elec_consume; // that.tableDatas[39][3] = dataList.生活区.elec_consume; }).then(res=>{ //获取月和年目标 @@ -257,10 +250,10 @@ if(this.type=='day'){ ind = 'goal_val_'+that.month; } - that.tableDatas[15][3] = dataList1.电石渣&&dataList1.电石渣[ind]!==0&&dataList1.电石渣[ind]!==''&&that.tableDatas[14][3]!==''?(that.tableDatas[14][3] /dataList1.电石渣[ind])*100:'/'; - that.tableDatas[17][3] = dataList1.原料磨&&dataList1.原料磨[ind]!==0&&dataList1.原料磨[ind]!==''&&that.tableDatas[14][3]!==''?(that.tableDatas[16][3] /dataList1.原料磨[ind])*100:'/'; - that.tableDatas[19][3] = dataList1.回转窑&&dataList1.回转窑[ind]!==0&&dataList1.回转窑[ind]!==''&&that.tableDatas[14][3]!==''?(that.tableDatas[18][3] /dataList1.回转窑[ind])*100:'/'; - that.tableDatas[21][3] = dataList1.水泥磨&&dataList1.水泥磨[ind]!==0&&dataList1.水泥磨[ind]!==''&&that.tableDatas[14][3]!==''?(that.tableDatas[20][3] /dataList1.水泥磨[ind])*100:'/'; + that.tableDatas[15][3] = dataList1.电石渣&&dataList1.电石渣[ind]!==0&&dataList1.电石渣[ind]!==''&&that.tableDatas[14][3]!==''?((that.tableDatas[14][3] /dataList1.电石渣[ind])*100).toFixed(2):'/'; + that.tableDatas[17][3] = dataList1.原料磨&&dataList1.原料磨[ind]!==0&&dataList1.原料磨[ind]!==''&&that.tableDatas[14][3]!==''?((that.tableDatas[16][3] /dataList1.原料磨[ind])*100).toFixed(2):'/'; + that.tableDatas[19][3] = dataList1.回转窑&&dataList1.回转窑[ind]!==0&&dataList1.回转窑[ind]!==''&&that.tableDatas[14][3]!==''?((that.tableDatas[18][3] /dataList1.回转窑[ind])*100).toFixed(2):'/'; + that.tableDatas[21][3] = dataList1.水泥磨&&dataList1.水泥磨[ind]!==0&&dataList1.水泥磨[ind]!==''&&that.tableDatas[14][3]!==''?((that.tableDatas[20][3] /dataList1.水泥磨[ind])*100).toFixed(2):'/'; }) }).then(res=>{ let obj1 = {}; @@ -271,7 +264,7 @@ obj1.day_s = this.day; that.$API.enm.enstat2.req(obj1).then((res1) => { if(res1.length>0){ - that.tableDatas[22][3]=res1[0].clinker_val; + that.tableDatas[22][3]=res1[0].bulk_clinker_val; that.tableDatas[24][3] = res1[0].bulk_cement_val; that.tableDatas[26][3] = res1[0].bag_cement_val; } @@ -283,7 +276,7 @@ obj2.page = 0; that.$API.enm.enstat2.req(obj2).then((res2) => { if(res2.length>0){ - that.tableDatas[23][3] = res2[0].clinker_val; + that.tableDatas[23][3] = res2[0].bulk_clinker_val; that.tableDatas[25][3] = res2[0].bulk_cement_val; that.tableDatas[27][3] = res2[0].bag_cement_val; } diff --git a/src/views/enm_report/reportMonth.vue b/src/views/enm_report/reportMonth.vue index 3b0e4933..9dcad74c 100644 --- a/src/views/enm_report/reportMonth.vue +++ b/src/views/enm_report/reportMonth.vue @@ -35,13 +35,14 @@ - + - - + + + @@ -53,10 +54,9 @@ - - + - +
生产月报生产月报
序号 项目环比增长同比增长月数据环比增长同比增长
{{item[1]}} {{item[1]}} {{item[2]}}{{item[3]}}{{item[3]}}{{item[3]}} {{item[4]}}{{item[5]}}{{item[5]}}
@@ -103,27 +103,19 @@ - [29,'成本','日电石渣成本(元/吨)'], - [30,'成本','日生料成本(元/吨)'], - [31,'成本','日熟料成本(元/吨)'], - [32,'成本','日水泥粉磨成本(元/吨)'], - [33,'成本','日水泥包装成本(元/吨)'], + [29,'成本','月电石渣成本(元/吨)'], + [30,'成本','月生料成本(元/吨)'], + [31,'成本','月熟料成本(元/吨)'], + [32,'成本','月水泥粉磨成本(元/吨)'], + [33,'成本','月水泥包装成本(元/吨)'], - [34,'耗电量','日电石渣耗电量(kw.h)'], - [35,'耗电量','日生料耗电量(kw.h)'], - [36,'耗电量','日熟料耗电量(kw.h)'], - [37,'耗电量','日水泥粉磨耗电量(kw.h)'], - [38,'耗电量','日水泥包装耗电量(kw.h)'], - [39,'耗电量','日生活区耗电量(kw.h)'], - - - ['生产异常动态','工段','类别','原因','处置措施','处置人'], - ['生产异常动态','电石渣'], - ['生产异常动态','原料磨'], - ['生产异常动态','回转窑'], - ['生产异常动态','煤磨'], - ['生产异常动态','水泥磨'], + [34,'耗电量','月电石渣耗电量(kw.h)'], + [35,'耗电量','月生料耗电量(kw.h)'], + [36,'耗电量','月熟料耗电量(kw.h)'], + [37,'耗电量','月水泥粉磨耗电量(kw.h)'], + [38,'耗电量','月水泥包装耗电量(kw.h)'], + [39,'耗电量','月生活区耗电量(kw.h)'], ], year:'', month:'', @@ -176,40 +168,71 @@ dataList[label] = item; }); //台产 - that.nowData[0] = dataList.原料磨.production_hour; - that.nowData[1] = dataList.电石渣.production_hour; - that.nowData[2] = dataList.煤磨.production_hour; - that.nowData[3] = dataList.回转窑.production_hour; + that.nowData[0] = dataList.原料磨.production_hour; + that.tableDatas[0][3] = dataList.原料磨.production_hour; + that.nowData[1] = dataList.电石渣.production_hour; + that.tableDatas[1][3] = dataList.电石渣.production_hour; + that.nowData[2] = dataList.煤磨.production_hour; + that.tableDatas[2][3] = dataList.煤磨.production_hour; + that.nowData[3] = dataList.回转窑.production_hour; + that.tableDatas[3][3] = dataList.回转窑.production_hour; that.nowData[4] = dataList.水泥磨.production_hour; + that.tableDatas[4][3] = dataList.水泥磨.production_hour; //能耗(kw.h/t) that.nowData[5] = dataList.回转窑.celec_consume_unit; + that.tableDatas[5][3] = dataList.回转窑.celec_consume_unit; that.nowData[6] = dataList.回转窑.coal_consume_unit; + that.tableDatas[6][3] = dataList.回转窑.coal_consume_unit; that.nowData[7] = dataList.回转窑.cen_consume_unit; + that.tableDatas[7][3] = dataList.回转窑.cen_consume_unit; that.nowData[8] = dataList.水泥磨.cen_consume_unit; + that.tableDatas[8][3] = dataList.水泥磨.cen_consume_unit; that.nowData[9] = dataList.电石渣.elec_consume_unit; + that.tableDatas[9][3] = dataList.电石渣.elec_consume_unit; that.nowData[10] = dataList.原料磨.elec_consume_unit; + that.tableDatas[10][3] = dataList.原料磨.elec_consume_unit; that.nowData[11] = dataList.回转窑.elec_consume_unit; + that.tableDatas[11][3] = dataList.回转窑.elec_consume_unit; that.nowData[12] = dataList.水泥磨.elec_consume_unit; + that.tableDatas[12][3] = dataList.水泥磨.elec_consume_unit; that.nowData[13] = dataList.水泥包装.elec_consume_unit; + that.tableDatas[13][3] = dataList.水泥磨.elec_consume_unit; //产量(t) that.nowData[14] = dataList.电石渣.production_hour; + that.tableDatas[14][3] = dataList.电石渣.production_hour; that.nowData[16] = dataList.原料磨.production_hour; + that.tableDatas[16][3] = dataList.原料磨.production_hour; that.nowData[18] = dataList.回转窑.production_hour; + that.tableDatas[18][3] = dataList.回转窑.production_hour; that.nowData[20] = dataList.水泥磨.production_hour; + that.tableDatas[20][3] = dataList.水泥磨.production_hour; + //成本(元/吨) that.nowData[28] = dataList.电石渣.production_cost_unit; + that.tableDatas[28][3] = dataList.电石渣.production_cost_unit; that.nowData[29] = dataList.原料磨.production_cost_unit; + that.tableDatas[29][3] = dataList.原料磨.production_cost_unit; that.nowData[30] = dataList.回转窑.production_cost_unit; + that.tableDatas[30][3] = dataList.回转窑.production_cost_unit; that.nowData[31] = dataList.水泥磨.production_cost_unit; + that.tableDatas[31][3] = dataList.水泥磨.production_cost_unit; that.nowData[32] = dataList.水泥包装.production_cost_unit; + that.tableDatas[32][3] = dataList.水泥包装.production_cost_unit; //耗电量(kw.h) that.nowData[33] = dataList.电石渣.elec_consume; + that.tableDatas[33][3] = dataList.电石渣.elec_consume; that.nowData[34] = dataList.原料磨.elec_consume; + that.tableDatas[34][3] = dataList.原料磨.elec_consume; that.nowData[35] = dataList.回转窑.elec_consume; - that.nowData[36] = dataList.煤磨.elec_consume; - that.nowData[37] = dataList.水泥磨.elec_consume; - that.nowData[38] = dataList.水泥包装.elec_consume; - // that.nowData[39] = dataList.生活区.elec_consume; + that.tableDatas[35][3] = dataList.回转窑.elec_consume; + // that.nowData[36] = dataList.煤磨.elec_consume; + // that.tableDatas[36][3] = dataList.煤磨.elec_consume; + that.nowData[36] = dataList.水泥磨.elec_consume; + that.tableDatas[36][3] = dataList.水泥磨.elec_consume; + that.nowData[37] = dataList.水泥包装.elec_consume; + that.tableDatas[37][3] = dataList.水泥包装.elec_consume; + that.nowData[38] = dataList.生活区.elec_consume; + that.tableDatas[38][3] = dataList.生活区.elec_consume; }).then(res=>{ //获取月和年目标 let params1 = {}; @@ -223,9 +246,13 @@ dataList1[label] = item1; }); that.nowData[15] = dataList1.电石渣&&dataList1.电石渣.goal_val!==0&&dataList1.电石渣.goal_val!==''&&that.nowData[14]!==''?(that.nowData[14] /dataList1.电石渣.goal_val)*100:'/'; + that.tableDatas[15][3] = dataList1.电石渣&&dataList1.电石渣.goal_val!==0&&dataList1.电石渣.goal_val!==''&&that.nowData[14]!==''?((that.nowData[14] /dataList1.电石渣.goal_val)*100).toFixed(2):'/'; that.nowData[17] = dataList1.原料磨&&dataList1.原料磨.goal_val!==0&&dataList1.原料磨.goal_val!==''&&that.nowData[14]!==''?(that.nowData[16] /dataList1.原料磨.goal_val)*100:'/'; + that.tableDatas[17][3] = dataList1.原料磨&&dataList1.原料磨.goal_val!==0&&dataList1.原料磨.goal_val!==''&&that.nowData[14]!==''?((that.nowData[16] /dataList1.原料磨.goal_val)*100).toFixed(2):'/'; that.nowData[19] = dataList1.回转窑&&dataList1.回转窑.goal_val!==0&&dataList1.回转窑.goal_val!==''&&that.nowData[14]!==''?(that.nowData[18] /dataList1.回转窑.goal_val)*100:'/'; + that.tableDatas[19][3] = dataList1.回转窑&&dataList1.回转窑.goal_val!==0&&dataList1.回转窑.goal_val!==''&&that.nowData[14]!==''?((that.nowData[18] /dataList1.回转窑.goal_val)*100).toFixed(2):'/'; that.nowData[21] = dataList1.水泥磨&&dataList1.水泥磨.goal_val!==0&&dataList1.水泥磨.goal_val!==''&&that.nowData[14]!==''?(that.nowData[20] /dataList1.水泥磨.goal_val)*100:'/'; + that.tableDatas[21][3] = dataList1.水泥磨&&dataList1.水泥磨.goal_val!==0&&dataList1.水泥磨.goal_val!==''&&that.nowData[14]!==''?((that.nowData[20] /dataList1.水泥磨.goal_val)*100).toFixed(2):'/'; }) }).then(res=>{ let obj1 = {}; @@ -236,8 +263,11 @@ that.$API.enm.enstat2.req(obj1).then((res1) => { if(res1.length>0){ that.nowData[22]=res1[0].clinker_val; + that.tableDatas[22][3]=res1[0].clinker_val; that.nowData[24] = res1[0].bulk_cement_val; + that.tableDatas[24][3] = res1[0].bulk_cement_val; that.nowData[26] = res1[0].bag_cement_val; + that.tableDatas[26][3] = res1[0].bag_cement_val; } }) let obj2 = {}; @@ -247,14 +277,30 @@ that.$API.enm.enstat2.req(obj2).then((res2) => { if(res2.length>0){ that.nowData[23] = res2[0].clinker_val; + that.tableDatas[23][3] = res2[0].clinker_val; that.nowData[25] = res2[0].bulk_cement_val; + that.tableDatas[25][3] = res2[0].bulk_cement_val; that.nowData[27] = res2[0].bag_cement_val; + that.tableDatas[27][3] = res2[0].bag_cement_val; } }) }).then(res=>{ this.getHuanbiData(); }); }, + canCompute(a,b){ + debugger; + if(b!=0&&b!=='/'&&b!==''&&b!==null){ + if(a!=='/'&&a!==''&&a!==null){ + a= Number(a) + b= Number(b) + let num =((a-b)/b*100).toFixed(2) + return num + } + }else{ + return 0 + } + }, getHuanbiData(){ let that = this; let params = {}; @@ -268,53 +314,41 @@ let label = item.mgroup_name; dataList[label] = item; }); - function canCompute(a,b){ - debugger; - if(b!=0&&b!=='/'&&b!==''&&b!==null){ - if(a!=='/'&&a!==''&&a!==null){ - a= Number(a) - b= Number(b) - let num =(a-b)/b*100 - return num - } - }else{ - return 0 - } - } + //台产 - that.tableDatas[0][3] = canCompute(that.nowData[0],dataList.原料磨.production_hour); - that.tableDatas[1][3] = canCompute(that.nowData[1],dataList.电石渣.production_hour); - that.tableDatas[2][3] = canCompute(that.nowData[2],dataList.煤磨.production_hour); - that.tableDatas[3][3] = canCompute(that.nowData[3],dataList.回转窑.production_hour); - that.tableDatas[4][3] = canCompute(that.nowData[4],dataList.水泥磨.production_hour); + that.tableDatas[0][4] = this.canCompute(that.nowData[0],dataList.原料磨.production_hour); + that.tableDatas[1][4] = this.canCompute(that.nowData[1],dataList.电石渣.production_hour); + that.tableDatas[2][4] = this.canCompute(that.nowData[2],dataList.煤磨.production_hour); + that.tableDatas[3][4] = this.canCompute(that.nowData[3],dataList.回转窑.production_hour); + that.tableDatas[4][4] = this.canCompute(that.nowData[4],dataList.水泥磨.production_hour); //能耗(kw.h/t) - that.tableDatas[5][3] = canCompute(that.nowData[5],dataList.回转窑.celec_consume_unit); - that.tableDatas[6][3] = canCompute(that.nowData[6],dataList.回转窑.coal_consume_unit); - that.tableDatas[7][3] = canCompute(that.nowData[7],dataList.回转窑.cen_consume_unit); - that.tableDatas[8][3] = canCompute(that.nowData[8],dataList.水泥磨.cen_consume_unit); - that.tableDatas[9][3] = canCompute(that.nowData[9],dataList.电石渣.elec_consume_unit); - that.tableDatas[10][3] = canCompute(that.nowData[10],dataList.原料磨.elec_consume_unit); - that.tableDatas[11][3] = canCompute(that.nowData[11],dataList.回转窑.elec_consume_unit); - that.tableDatas[12][3] = canCompute(that.nowData[12],dataList.水泥磨.elec_consume_unit); - that.tableDatas[13][3] = canCompute(that.nowData[13], dataList.水泥包装.elec_consume_unit); + that.tableDatas[5][4] = this.canCompute(that.nowData[5],dataList.回转窑.celec_consume_unit); + that.tableDatas[6][4] = this.canCompute(that.nowData[6],dataList.回转窑.coal_consume_unit); + that.tableDatas[7][4] = this.canCompute(that.nowData[7],dataList.回转窑.cen_consume_unit); + that.tableDatas[8][4] = this.canCompute(that.nowData[8],dataList.水泥磨.cen_consume_unit); + that.tableDatas[9][4] = this.canCompute(that.nowData[9],dataList.电石渣.elec_consume_unit); + that.tableDatas[10][4] = this.canCompute(that.nowData[10],dataList.原料磨.elec_consume_unit); + that.tableDatas[11][4] = this.canCompute(that.nowData[11],dataList.回转窑.elec_consume_unit); + that.tableDatas[12][4] = this.canCompute(that.nowData[12],dataList.水泥磨.elec_consume_unit); + that.tableDatas[13][4] = this.canCompute(that.nowData[13], dataList.水泥包装.elec_consume_unit); //产量(t) - that.tableDatas[14][3] = canCompute(that.nowData[14],dataList.电石渣.production_hour); - that.tableDatas[16][3] = canCompute(that.nowData[16],dataList.原料磨.production_hour); - that.tableDatas[18][3] = canCompute(that.nowData[18],dataList.回转窑.production_hour); - that.tableDatas[20][3] = canCompute(that.nowData[20],dataList.水泥磨.production_hour); + that.tableDatas[14][4] = this.canCompute(that.nowData[14],dataList.电石渣.production_hour); + that.tableDatas[16][4] = this.canCompute(that.nowData[16],dataList.原料磨.production_hour); + that.tableDatas[18][4] = this.canCompute(that.nowData[18],dataList.回转窑.production_hour); + that.tableDatas[20][4] = this.canCompute(that.nowData[20],dataList.水泥磨.production_hour); //成本(元/吨) - that.tableDatas[28][3] = canCompute(that.nowData[28],dataList.电石渣.production_cost_unit); - that.tableDatas[29][3] = canCompute(that.nowData[29],dataList.原料磨.production_cost_unit); - that.tableDatas[30][3] = canCompute(that.nowData[30],dataList.回转窑.production_cost_unit); - that.tableDatas[31][3] = canCompute(that.nowData[31],dataList.水泥磨.production_cost_unit); - that.tableDatas[32][3] = canCompute(that.nowData[32],dataList.水泥包装.production_cost_unit); + that.tableDatas[28][4] = this.canCompute(that.nowData[28],dataList.电石渣.production_cost_unit); + that.tableDatas[29][4] = this.canCompute(that.nowData[29],dataList.原料磨.production_cost_unit); + that.tableDatas[30][4] = this.canCompute(that.nowData[30],dataList.回转窑.production_cost_unit); + that.tableDatas[31][4] = this.canCompute(that.nowData[31],dataList.水泥磨.production_cost_unit); + that.tableDatas[32][4] = this.canCompute(that.nowData[32],dataList.水泥包装.production_cost_unit); //耗电量(kw.h) - that.tableDatas[33][3] = canCompute(that.nowData[33],dataList.电石渣.elec_consume); - that.tableDatas[34][3] = canCompute(that.nowData[34],dataList.原料磨.elec_consume); - that.tableDatas[35][3] = canCompute(that.nowData[35],dataList.回转窑.elec_consume); - that.tableDatas[36][3] = canCompute(that.nowData[36],dataList.煤磨.elec_consume); - that.tableDatas[37][3] = canCompute(that.nowData[37],dataList.水泥磨.elec_consume); - that.tableDatas[38][3] = canCompute(that.nowData[38],dataList.水泥包装.elec_consume); + that.tableDatas[33][4] = this.canCompute(that.nowData[33],dataList.电石渣.elec_consume); + that.tableDatas[34][4] = this.canCompute(that.nowData[34],dataList.原料磨.elec_consume); + that.tableDatas[35][4] = this.canCompute(that.nowData[35],dataList.回转窑.elec_consume); + that.tableDatas[36][4] = this.canCompute(that.nowData[36],dataList.煤磨.elec_consume); + that.tableDatas[37][4] = this.canCompute(that.nowData[37],dataList.水泥磨.elec_consume); + that.tableDatas[38][4] = this.canCompute(that.nowData[38],dataList.水泥包装.elec_consume); // that.tableDatas[39][3] = dataList.生活区.elec_consume; }).then(res=>{ //获取月和年目标 @@ -328,10 +362,10 @@ let label = item1.mgroup_name; dataList1[label] = item1; }); - that.tableDatas[15][3] = dataList1.电石渣&&dataList1.电石渣.goal_val!==0&&dataList1.电石渣.goal_val!==''&&that.tableDatas[14][3]!==''?(that.tableDatas[14][3] /dataList1.电石渣.goal_val)*100:'/'; - that.tableDatas[17][3] = dataList1.原料磨&&dataList1.原料磨.goal_val!==0&&dataList1.原料磨.goal_val!==''&&that.tableDatas[14][3]!==''?(that.tableDatas[16][3] /dataList1.原料磨.goal_val)*100:'/'; - that.tableDatas[19][3] = dataList1.回转窑&&dataList1.回转窑.goal_val!==0&&dataList1.回转窑.goal_val!==''&&that.tableDatas[14][3]!==''?(that.tableDatas[18][3] /dataList1.回转窑.goal_val)*100:'/'; - that.tableDatas[21][3] = dataList1.水泥磨&&dataList1.水泥磨.goal_val!==0&&dataList1.水泥磨.goal_val!==''&&that.tableDatas[14][3]!==''?(that.tableDatas[20][3] /dataList1.水泥磨.goal_val)*100:'/'; + that.tableDatas[15][4] = dataList1.电石渣&&dataList1.电石渣.goal_val!==0&&dataList1.电石渣.goal_val!==''&&that.tableDatas[14][4]!==''?((that.tableDatas[14][4] /dataList1.电石渣.goal_val)*100).toFixed(2):'/'; + that.tableDatas[17][4] = dataList1.原料磨&&dataList1.原料磨.goal_val!==0&&dataList1.原料磨.goal_val!==''&&that.tableDatas[14][4]!==''?((that.tableDatas[16][4] /dataList1.原料磨.goal_val)*100).toFixed(5):'/'; + that.tableDatas[19][4] = dataList1.回转窑&&dataList1.回转窑.goal_val!==0&&dataList1.回转窑.goal_val!==''&&that.tableDatas[14][4]!==''?((that.tableDatas[18][4] /dataList1.回转窑.goal_val)*100).toFixed(2):'/'; + that.tableDatas[21][4] = dataList1.水泥磨&&dataList1.水泥磨.goal_val!==0&&dataList1.水泥磨.goal_val!==''&&that.tableDatas[14][4]!==''?((that.tableDatas[20][4] /dataList1.水泥磨.goal_val)*100).toFixed(2):'/'; }) }).then(res=>{ let obj1 = {}; @@ -341,9 +375,9 @@ obj1.type = 'month_s'; that.$API.enm.enstat2.req(obj1).then((res1) => { if(res1.length>0){ - that.tableDatas[22][3]= canCompute(that.nowData[22],res1[0].clinker_val); - that.tableDatas[24][3] = canCompute(that.nowData[24],res1[0].bulk_cement_val); - that.tableDatas[26][3] = canCompute(that.nowData[26],res1[0].bag_cement_val); + that.tableDatas[22][4]= this.canCompute(that.nowData[22],res1[0].clinker_val); + that.tableDatas[24][4] = this.canCompute(that.nowData[24],res1[0].bulk_cement_val); + that.tableDatas[26][4] = this.canCompute(that.nowData[26],res1[0].bag_cement_val); } }) let obj2 = {}; @@ -352,9 +386,9 @@ obj2.year_s = this.year; that.$API.enm.enstat2.req(obj2).then((res2) => { if(res2.length>0){ - that.tableDatas[23][3] = canCompute(that.nowData[23],res2[0].clinker_val); - that.tableDatas[25][3] = canCompute(that.nowData[25],res2[0].bulk_cement_val); - that.tableDatas[27][3] = canCompute(that.nowData[27],res2[0].bag_cement_val); + that.tableDatas[23][4] = this.canCompute(that.nowData[23],res2[0].clinker_val); + that.tableDatas[25][4] = this.canCompute(that.nowData[25],res2[0].bulk_cement_val); + that.tableDatas[27][4] = this.canCompute(that.nowData[27],res2[0].bag_cement_val); } }) }).then(res=>{ @@ -369,45 +403,47 @@ params.month_s = that.month_t; params.type = 'month_s'; this.$API.enm.enstat.req(params).then((res) => { - let dataList = {}; - res.forEach(item => { - let label = item.mgroup_name; - dataList[label] = item; - }); + if (res.length>0){ + let dataList = {}; + res.forEach(item => { + let label = item.mgroup_name; + dataList[label] = item; + }); //台产 - that.tableDatas[0][4] = canCompute(that.nowData[0],dataList.原料磨.production_hour); - that.tableDatas[1][4] = canCompute(that.nowData[1],dataList.电石渣.production_hour); - that.tableDatas[2][4] = canCompute(that.nowData[2],dataList.煤磨.production_hour); - that.tableDatas[3][4] = canCompute(that.nowData[3],dataList.回转窑.production_hour); - that.tableDatas[4][4] = canCompute(that.nowData[4],dataList.水泥磨.production_hour); + that.tableDatas[0][5] = this.canCompute(that.nowData[0],dataList.原料磨.production_hour); + that.tableDatas[1][5] = this.canCompute(that.nowData[1],dataList.电石渣.production_hour); + that.tableDatas[2][5] = this.canCompute(that.nowData[2],dataList.煤磨.production_hour); + that.tableDatas[3][5] = this.canCompute(that.nowData[3],dataList.回转窑.production_hour); + that.tableDatas[4][5] = this.canCompute(that.nowData[4],dataList.水泥磨.production_hour); //能耗(kw.h/t) - that.tableDatas[5][4] = canCompute(that.nowData[5],dataList.回转窑.celec_consume_unit); - that.tableDatas[6][4] = canCompute(that.nowData[6],dataList.回转窑.coal_consume_unit); - that.tableDatas[7][4] = canCompute(that.nowData[7],dataList.回转窑.cen_consume_unit); - that.tableDatas[8][4] = canCompute(that.nowData[8],dataList.水泥磨.cen_consume_unit); - that.tableDatas[9][4] = canCompute(that.nowData[9],dataList.电石渣.elec_consume_unit); - that.tableDatas[10][4] = canCompute(that.nowData[10],dataList.原料磨.elec_consume_unit); - that.tableDatas[11][4] = canCompute(that.nowData[11],dataList.回转窑.elec_consume_unit); - that.tableDatas[12][4] = canCompute(that.nowData[12],dataList.水泥磨.elec_consume_unit); - that.tableDatas[13][4] = canCompute(that.nowData[13], dataList.水泥包装.elec_consume_unit); + that.tableDatas[5][5] = this.canCompute(that.nowData[5],dataList.回转窑.celec_consume_unit); + that.tableDatas[6][5] = this.canCompute(that.nowData[6],dataList.回转窑.coal_consume_unit); + that.tableDatas[7][5] = this.canCompute(that.nowData[7],dataList.回转窑.cen_consume_unit); + that.tableDatas[8][5] = this.canCompute(that.nowData[8],dataList.水泥磨.cen_consume_unit); + that.tableDatas[9][5] = this.canCompute(that.nowData[9],dataList.电石渣.elec_consume_unit); + that.tableDatas[10][5] = this.canCompute(that.nowData[10],dataList.原料磨.elec_consume_unit); + that.tableDatas[11][5] = this.canCompute(that.nowData[11],dataList.回转窑.elec_consume_unit); + that.tableDatas[12][5] = this.canCompute(that.nowData[12],dataList.水泥磨.elec_consume_unit); + that.tableDatas[13][5] = this.canCompute(that.nowData[13], dataList.水泥包装.elec_consume_unit); //产量(t) - that.tableDatas[14][4] = canCompute(that.nowData[14],dataList.电石渣.production_hour); - that.tableDatas[16][4] = canCompute(that.nowData[16],dataList.原料磨.production_hour); - that.tableDatas[18][4] = canCompute(that.nowData[18],dataList.回转窑.production_hour); - that.tableDatas[20][4] = canCompute(that.nowData[20],dataList.水泥磨.production_hour); + that.tableDatas[14][5] = this.canCompute(that.nowData[14],dataList.电石渣.production_hour); + that.tableDatas[16][5] = this.canCompute(that.nowData[16],dataList.原料磨.production_hour); + that.tableDatas[18][5] = this.canCompute(that.nowData[18],dataList.回转窑.production_hour); + that.tableDatas[20][5] = this.canCompute(that.nowData[20],dataList.水泥磨.production_hour); //成本(元/吨) - that.tableDatas[28][4] = canCompute(that.nowData[28],dataList.电石渣.production_cost_unit); - that.tableDatas[29][4] = canCompute(that.nowData[29],dataList.原料磨.production_cost_unit); - that.tableDatas[30][4] = canCompute(that.nowData[30],dataList.回转窑.production_cost_unit); - that.tableDatas[31][4] = canCompute(that.nowData[31],dataList.水泥磨.production_cost_unit); - that.tableDatas[32][4] = canCompute(that.nowData[32],dataList.水泥包装.production_cost_unit); + that.tableDatas[28][5] = this.canCompute(that.nowData[28],dataList.电石渣.production_cost_unit); + that.tableDatas[29][5] = this.canCompute(that.nowData[29],dataList.原料磨.production_cost_unit); + that.tableDatas[30][5] = this.canCompute(that.nowData[30],dataList.回转窑.production_cost_unit); + that.tableDatas[31][5] = this.canCompute(that.nowData[31],dataList.水泥磨.production_cost_unit); + that.tableDatas[32][5] = this.canCompute(that.nowData[32],dataList.水泥包装.production_cost_unit); //耗电量(kw.h) - that.tableDatas[33][4] = canCompute(that.nowData[33],dataList.电石渣.elec_consume); - that.tableDatas[34][4] = canCompute(that.nowData[34],dataList.原料磨.elec_consume); - that.tableDatas[35][4] = canCompute(that.nowData[35],dataList.回转窑.elec_consume); - that.tableDatas[36][4] = canCompute(that.nowData[36],dataList.煤磨.elec_consume); - that.tableDatas[37][4] = canCompute(that.nowData[37],dataList.水泥磨.elec_consume); - that.tableDatas[38][4] = canCompute(that.nowData[38],dataList.水泥包装.elec_consume); + that.tableDatas[33][5] = this.canCompute(that.nowData[33],dataList.电石渣.elec_consume); + that.tableDatas[34][5] = this.canCompute(that.nowData[34],dataList.原料磨.elec_consume); + that.tableDatas[35][5] = this.canCompute(that.nowData[35],dataList.回转窑.elec_consume); + that.tableDatas[36][5] = this.canCompute(that.nowData[36],dataList.煤磨.elec_consume); + that.tableDatas[37][5] = this.canCompute(that.nowData[37],dataList.水泥磨.elec_consume); + that.tableDatas[38][5] = this.canCompute(that.nowData[38],dataList.水泥包装.elec_consume); + } // that.tableDatas[39][4] = dataList.生活区.elec_consume; }).then(res=>{ //获取月和年目标 @@ -421,22 +457,22 @@ let label = item1.mgroup_name; dataList1[label] = item1; }); - that.tableDatas[15][4] = dataList1.电石渣&&dataList1.电石渣.goal_val!==0&&dataList1.电石渣.goal_val!==''&&that.tableDatas[14][4]!==''?(that.tableDatas[14][4] /dataList1.电石渣.goal_val)*100:'/'; - that.tableDatas[17][4] = dataList1.原料磨&&dataList1.原料磨.goal_val!==0&&dataList1.原料磨.goal_val!==''&&that.tableDatas[14][4]!==''?(that.tableDatas[16][4] /dataList1.原料磨.goal_val)*100:'/'; - that.tableDatas[19][4] = dataList1.回转窑&&dataList1.回转窑.goal_val!==0&&dataList1.回转窑.goal_val!==''&&that.tableDatas[14][4]!==''?(that.tableDatas[18][4] /dataList1.回转窑.goal_val)*100:'/'; - that.tableDatas[21][4] = dataList1.水泥磨&&dataList1.水泥磨.goal_val!==0&&dataList1.水泥磨.goal_val!==''&&that.tableDatas[14][4]!==''?(that.tableDatas[20][4] /dataList1.水泥磨.goal_val)*100:'/'; + that.tableDatas[15][5] = dataList1.电石渣&&dataList1.电石渣.goal_val!==0&&dataList1.电石渣.goal_val!==''&&that.tableDatas[14][5]!==''&&that.tableDatas[14][5]!==undefined?(that.tableDatas[14][5] /dataList1.电石渣.goal_val)*100:''; + that.tableDatas[17][5] = dataList1.原料磨&&dataList1.原料磨.goal_val!==0&&dataList1.原料磨.goal_val!==''&&that.tableDatas[14][5]!==''&&that.tableDatas[14][5]!==undefined?(that.tableDatas[16][5] /dataList1.原料磨.goal_val)*100:''; + that.tableDatas[19][5] = dataList1.回转窑&&dataList1.回转窑.goal_val!==0&&dataList1.回转窑.goal_val!==''&&that.tableDatas[14][5]!==''&&that.tableDatas[14][5]!==undefined?(that.tableDatas[18][5] /dataList1.回转窑.goal_val)*100:''; + that.tableDatas[21][5] = dataList1.水泥磨&&dataList1.水泥磨.goal_val!==0&&dataList1.水泥磨.goal_val!==''&&that.tableDatas[14][5]!==''&&that.tableDatas[14][5]!==undefined?(that.tableDatas[20][5] /dataList1.水泥磨.goal_val)*100:''; }) }).then(res=>{ let obj1 = {}; obj1.page = 0; - obj1.year_s = this.year_h; + obj1.year_s = this.year_t; obj1.month_s = this.month_h; obj1.type = 'month_s'; that.$API.enm.enstat2.req(obj1).then((res1) => { if(res1.length>0){ - that.tableDatas[22][4]= canCompute(that.nowData[22],res1[0].clinker_val); - that.tableDatas[24][4] = canCompute(that.nowData[24],res1[0].bulk_cement_val); - that.tableDatas[26][4] = canCompute(that.nowData[26],res1[0].bag_cement_val); + that.tableDatas[22][5]= this.canCompute(that.nowData[22],res1[0].clinker_val); + that.tableDatas[24][5] = this.canCompute(that.nowData[24],res1[0].bulk_cement_val); + that.tableDatas[26][5] = this.canCompute(that.nowData[26],res1[0].bag_cement_val); } }) let obj2 = {}; @@ -445,9 +481,9 @@ obj2.year_s = this.year; that.$API.enm.enstat2.req(obj2).then((res2) => { if(res2.length>0){ - that.tableDatas[23][4] = canCompute(that.nowData[23],res2[0].clinker_val); - that.tableDatas[25][4] = canCompute(that.nowData[25],res2[0].bulk_cement_val); - that.tableDatas[27][4] = canCompute(that.nowData[27],res2[0].bag_cement_val); + that.tableDatas[23][5] = this.canCompute(that.nowData[23],res2[0].clinker_val); + that.tableDatas[25][5] = this.canCompute(that.nowData[25],res2[0].bulk_cement_val); + that.tableDatas[27][5] = this.canCompute(that.nowData[27],res2[0].bag_cement_val); } }) }) @@ -457,7 +493,7 @@ this.tableDatas[i][3] = ''; this.tableDatas[i][4] = ''; } - this.getData(); + this.getNowData(); }, handlePrint() { this.$PRINT('#myReport'); diff --git a/src/views/enm_rm/handoverLog.vue b/src/views/enm_rm/handoverLog.vue index 625d9fee..9d1b68fc 100644 --- a/src/views/enm_rm/handoverLog.vue +++ b/src/views/enm_rm/handoverLog.vue @@ -202,7 +202,7 @@ {{ reportItem.run_rate }} - 停机时长(h) + 停机时长(s) {{ reportItem.shut_sec }} @@ -306,7 +306,7 @@ 处置人 - {{ item.happen_time }} + {{ item.stlog_.start_time }} {{ item.stlog_.cate }} {{ item.stlog_.reason }} {{ item.stlog_.measure }} @@ -415,6 +415,7 @@ export default { that.$API.wpm.sflogexp.list .req({ page: 0, sflog: id }) .then((res) => { + console.log("sflogexp", res); that.sflogexpList = res; }); }, diff --git a/src/views/enm_rm/logDetail.vue b/src/views/enm_rm/logDetail.vue index 5f9ae29d..b9d66ffe 100644 --- a/src/views/enm_rm/logDetail.vue +++ b/src/views/enm_rm/logDetail.vue @@ -467,7 +467,7 @@ 编辑 @@ -494,6 +494,7 @@ :height="heightTable" hidePagination highlightCurrentRow + hideDo > @@ -589,7 +590,7 @@ ref="stlogDialog" :current_sflog="current_sflog" :mgroupId="mgroupId" - @success="sflogExpSuccess" + @success="stLogSuccess" @closed="stlogVisiable = false" > @@ -686,7 +687,6 @@ export default { this.form = JSON.parse(form); this.getMpoint(); this.getTeam(); - this.getStlog(); let height = document.getElementById("elMain").clientHeight; let heightdetail = document.getElementById("logDetail").clientHeight; let heightTabs = height - heightdetail - 40; @@ -842,14 +842,14 @@ export default { }); }, //***** fourth 异常 ****** */ - //获取异常列表 - getStlog() { - let obj = {}; - obj.page = 0; - obj.mgroup = this.mgroupId; - this.$API.wpm.stlog.list.req(obj).then((res) => { - this.stlogList = res; - }); + stLogSuccess(stlogid){ + this.$refs.stlogTable.refresh(); + if(stlogid != undefined || stlogid != null){ + this.getSflogexp(stlogid); + }else{ + this.sflogexpList = []; + } + }, //异常添加 @@ -897,11 +897,8 @@ export default { .req(row.id) .then((res) => { this.$message.success("删除成功"); - this.getStlog(); + this.stLogSuccess(); }) - .catch((err) => { - this.$message.success(err); - }); }); }, //点击stlog,展示sflogexp diff --git a/src/views/enm_rm/power.vue b/src/views/enm_rm/power.vue index c49671c9..c4a3ca51 100644 --- a/src/views/enm_rm/power.vue +++ b/src/views/enm_rm/power.vue @@ -423,7 +423,6 @@ export default { obj.ordering = "report_sortstr"; obj.material__code__in = "elec,elec_0"; this.$API.enm.mpoint.list.req(obj).then((res) => { - console.log("mpoints", res); let arr = []; res.forEach((item) => { arr.push(item.name); @@ -581,6 +580,9 @@ export default { let data = response; data.forEach((item) => { let index = that.mpoints.indexOf(item.mpoint_name); //第几个mpoint + if(index==-1){ + return; + } let ind = item.hour; //xAxis seriesData[index][ind] = item.elec_consume_unit; }); @@ -622,6 +624,9 @@ export default { let data = response; data.forEach((item) => { let index = that.mpoints.indexOf(item.mpoint_name); //第几个mpoint + if(index==-1){ + return; + } let ind = item.day_s - 1; seriesData[index][ind] = item.elec_consume_unit; }); @@ -664,6 +669,9 @@ export default { data.forEach((item) => { let ind = item.month_s - 1; let index = that.mpoints.indexOf(item.mpoint_name); //第几个mpoint + if(index==-1){ + return; + } seriesData[index][ind] = item.elec_consume_unit; }); let options = { ...that.option3 }; diff --git a/src/views/enm_rm/stlog_form.vue b/src/views/enm_rm/stlog_form.vue index ffc5d0ba..3fa56571 100644 --- a/src/views/enm_rm/stlog_form.vue +++ b/src/views/enm_rm/stlog_form.vue @@ -61,7 +61,6 @@ @@ -178,7 +177,7 @@ export default { }, ], start_time: [{ required: true, message: "请选择发生时间" }], - end_time: [{ required: true, message: "请选择结束时间" }], + // end_time: [{ required: true, message: "请选择结束时间" }], current_note: [ { required: true, message: "请填写值班异常处理备注" }, ], @@ -189,7 +188,9 @@ export default { setFiltersVisible: false, }; }, - mounted() {}, + mounted() { + console.log(this.current_sflog) + }, methods: { //显示 open(mode = "add") { @@ -203,14 +204,15 @@ export default { that.$refs.dialogForm.validate(async (valid) => { if (valid) { that.isSaveing = true; + that.form.current_sflog = that.current_sflog; if (that.mode == "add") { that.form.mgroup = that.mgroupId; - that.form.current_sflog = that.current_sflog; + that.$API.wpm.stlog.create .req(that.form) .then((res) => { that.isSaveing = false; - that.$emit("success", that.form, that.mode); + that.$emit("success", res.id); that.visible = false; that.$message.success("操作成功"); }) @@ -222,7 +224,7 @@ export default { .req(that.form.id, that.form) .then((res) => { that.isSaveing = false; - that.$emit("success", that.form, that.mode); + that.$emit("success", res.id); that.visible = false; that.$message.success("操作成功"); }) diff --git a/src/views/enm_rm/teamAnalysis.vue b/src/views/enm_rm/teamAnalysis.vue index 9095d9e6..8d88ef81 100644 --- a/src/views/enm_rm/teamAnalysis.vue +++ b/src/views/enm_rm/teamAnalysis.vue @@ -101,6 +101,7 @@ export default { mgroup: "", }, tableDatas: [], + goalDatas: [], exportLoading: false, }; }, @@ -119,11 +120,10 @@ export default { params.year = year; params.mgroup = that.query.mgroup; this.$API.mtm.goal.list.req(params).then((res) => { - let data = []; if (res.length > 0) { - data = res[0]; + that.goalDatas = res[0]; } - that.getData(data); + that.getData(that.goalDatas); }); }); }, @@ -137,23 +137,13 @@ export default { query0.mgroup = that.query.mgroup; let wrapArr = [], wrapArr0 = [], - wrapArrs = []; + wrapArrs = [], + compareArr0 = []; this.$API.enm.enstat.req(query0).then((res0) => { let data0 = res0; - debugger; if (data0.length > 0) { data0.forEach((item0) => { //先按月份排序,再按班组排序 - let n0 = item0.month_s; - let ind0 = 0; - let team_name0 = item0.team_name; - if (team_name0.indexOf("甲") > -1) { - ind0 = (n0 - 1) * 3; - } else if (team_name0.indexOf("乙") > -1) { - ind0 = (n0 - 1) * 3 + 1; - } else if (team_name0.indexOf("丙") > -1) { - ind0 = (n0 - 1) * 3 + 2; - } wrapArr0[ind0] = item0; }); } else { @@ -161,19 +151,18 @@ export default { this.$API.enm.enstat.req(that.query).then((res) => { let data = res; if (data.length > 0) { + data.forEach((item) => { + //先按月份排序,再按班组排序 + let compareArr = []; + compareArr.push(item.month_s); + compareArr.push(item.team_name); + compareArr.push(item.elec_consume_unit); + compareArr0.push(compareArr); + }); data.forEach((item) => { //先按月份排序,再按班组排序 let n = item.month_s; - let team_name = item.team_name; let ind = 0; - if (team_name.indexOf("甲") > -1) { - ind = (n - 1) * 3; - } else if (team_name.indexOf("乙") > -1) { - ind = (n - 1) * 3 + 1; - } else if (team_name.indexOf("丙") > -1) { - ind = (n - 1) * 3 + 2; - } - wrapArrs[ind] = item; let arr = []; let time = "" + item.year_s + "." + item.month_s; arr.push(time); @@ -237,21 +226,30 @@ export default { ? wrapArr0[ind_pre].elec_consume_unit : "/"; } else { - ind_pre = ind - 1; - huanbi = wrapArr[ind_pre] - ? wrapArr[ind_pre].elec_consume_unit - ? wrapArr[ind_pre].elec_consume_unit - : "/" - : "/"; + // 如果 wrapArr数组长度大于0,那么循环遍历wrapArr数组,找到与item.month_s相差1的元素 而 item.name相同,并赋值给huanbi + compareArr0.forEach((item0) => { + if (item0[0] == item.month_s - 1 && item0[1] == item.team_name) { + huanbi = item0[2]; + } + }) } arr[19] = huanbi; //环期值(KW·h/t)上个月的值 - arr[20] = item.celec_consume_unit; //当期与环期差值(KW·h/t) + //当期与环期差值(KW·h/t) + if (arr[19] !== "/"){ + arr[20] = (arr[16] - arr[19]).toFixed(2); //当期与环期差值(KW·h/t) + }else{ + arr[20] = "/"; //当期与环期差值(KW·h/t) + } arr[21] = item.celec_consume_unit; //环比增长率(%) + if (arr[19] !=="/" && arr[20] !==0 && arr[20] !== "undefined"){ + arr[21] = ((arr[19]/arr[20])*100).toFixed(2); + }else{ + arr[21] = "/"; //环比增长率(%)= 当期与环期差值(KW·h/t)/环期值(KW·h/t)*100% + } arr[22] = item.celec_consume_unit; //同比增长率(%) arr[23] = item.celec_consume_unit; //同比增长率(%) - wrapArr[ind] = arr; + wrapArr.push(arr); }); - console.log(wrapArr); that.tableDatas = wrapArr; } else { } @@ -260,7 +258,7 @@ export default { }, handleQuery() { this.tableDatas = []; - this.getData(); + this.getData(this.goalDatas); }, itemClick(type, item) { this.type = type; diff --git a/src/views/enm_rm/workshopAnalysis.vue b/src/views/enm_rm/workshopAnalysis.vue index 472d9595..39859936 100644 --- a/src/views/enm_rm/workshopAnalysis.vue +++ b/src/views/enm_rm/workshopAnalysis.vue @@ -229,7 +229,7 @@ export default { //当期与目标差值(KW·h/t) let diff = 0; if (item[2] !== "/") { - diff = item[1] - item[2]; + diff = (item[1] - item[2]).toFixed(2); } else { diff = "/"; } @@ -264,11 +264,11 @@ export default { //环比增长率(%) let lastRate = 0; if ( - lastDiff == "/" && + lastDiff !== "/" && lastNum !== "/" && lastNum !== 0 ) { - lastRate = (lastDiff / lastNum) * 100; + lastRate = ((lastDiff / lastNum) * 100).toFixed(2); } else { lastRate = "/"; } diff --git a/src/views/enm_rmbase/handoverLog.vue b/src/views/enm_rmbase/handoverLog.vue index 8394f8e9..064d7510 100644 --- a/src/views/enm_rmbase/handoverLog.vue +++ b/src/views/enm_rmbase/handoverLog.vue @@ -231,7 +231,7 @@ 处置人 - {{ item.happen_time }} + {{ item.stlog_.start_time }} {{ item.cate }} {{ item.reason }} {{ item.measure }} diff --git a/src/views/enm_slag/handoverLog.vue b/src/views/enm_slag/handoverLog.vue index 009fb214..14dbf2e8 100644 --- a/src/views/enm_slag/handoverLog.vue +++ b/src/views/enm_slag/handoverLog.vue @@ -211,7 +211,7 @@ 处置人 - {{ item.happen_time }} + {{ item.stlog_.start_time }} {{ item.stlog_.cate }} {{ item.stlog_.reason }} {{ item.stlog_.measure }} diff --git a/src/views/enm_slag/report.vue b/src/views/enm_slag/report.vue index 931440e3..6955cd2a 100644 --- a/src/views/enm_slag/report.vue +++ b/src/views/enm_slag/report.vue @@ -39,7 +39,10 @@ - {{ item[0] }} + + {{ item[0] }} + {{ item[1] }} import scEcharts from "@/components/scEcharts"; import { defineAsyncComponent } from "vue"; -const colors = ["#647bfe", "#cbd3fe", "#91CC75", "#EE6666"]; +const colors = ["#647bfe", "#cbd3fe", "#91CC75", "#EE6666", "#CC00CC"]; let tooltip = { show: true, trigger: "axis", @@ -263,7 +266,7 @@ let toolbox = { }; let legend = { top: "2%", - data: ["总产量", "分布电耗", "成本"], + data: ["总产量", "分布电耗", "成本", "消耗", "进厂"], }; let yAxis = [ { @@ -312,6 +315,38 @@ let yAxis = [ formatter: "{value}", }, }, + { + type: "value", + name: "消耗(t)", + position: "right", + alignTicks: true, + offset: 130, + axisLine: { + show: true, + lineStyle: { + color: colors[3], + }, + }, + axisLabel: { + formatter: "{value}", + }, + }, + { + type: "value", + name: "进厂(t)", + position: "right", + alignTicks: true, + offset: 180, + axisLine: { + show: true, + lineStyle: { + color: colors[4], + }, + }, + axisLabel: { + formatter: "{value}", + }, + }, ]; export default { components: { @@ -340,6 +375,8 @@ export default { ["产量", "总产量(t)", 0, 0, 0, 0, 0, 0, 0, 0], ["能耗", "单位产品分布电耗(KW·h/t)", 0, 0, 0, 0, 0, 0, 0, 0], ["成本", "电石渣成本(元/吨)", 0, 0, 0, 0, 0, 0, 0, 0], + ["湿电石渣", "消耗", 0, 0, 0, 0, 0, 0, 0, 0], + ["湿电石渣", "进厂", 0, 0, 0, 0, 0, 0, 0, 0], ], cate: "", apiObj: this.$API.enm.enstat, @@ -384,6 +421,18 @@ export default { yAxisIndex: 2, data: [], }, + { + name: "消耗", + type: "bar", + yAxisIndex: 3, + data: [], + }, + { + name: "进厂", + type: "bar", + yAxisIndex: 4, + data: [], + }, ], }, option2: { @@ -420,6 +469,18 @@ export default { yAxisIndex: 2, data: [], }, + { + name: "消耗", + type: "bar", + yAxisIndex: 3, + data: [], + }, + { + name: "进厂", + type: "bar", + yAxisIndex: 4, + data: [], + }, ], }, }; @@ -473,7 +534,16 @@ export default { that.tableDatas[0][2] = data3.total_production; that.tableDatas[1][2] = data3.elec_consume_unit; that.tableDatas[2][2] = data3.production_cost_unit; + if (data3.imaterial_data.length > 0) { + data3.imaterial_data.forEach((item) => { + if (item.material_name == "湿电石渣消耗") { + that.tableDatas[3][2] = item.amount_consume; + }else if(item.material_name == "湿电石渣进厂"){ + that.tableDatas[4][2] = item.amount_consume; + } + }); } + } }); //月目标 let params5 = {}; @@ -531,6 +601,15 @@ export default { that.tableDatas[2][4], that.tableDatas[2][7] ); + if (data1.imaterial_data.length > 0) { + data1.imaterial_data.forEach((item) => { + if (item.material_name == "湿电石渣消耗") { + that.tableDatas[3][4] = item.amount_consume; + }else if(item.material_name == "湿电石渣进厂"){ + that.tableDatas[4][4] = item.amount_consume; + } + }); + } } else { } }); @@ -560,6 +639,15 @@ export default { that.tableDatas[2][3], that.tableDatas[2][5] ); + if (data2.imaterial_data.length > 0) { + data2.imaterial_data.forEach((item) => { + if (item.material_name == "湿电石渣消耗") { + that.tableDatas[3][3] = item.amount_consume; + }else if(item.material_name == "湿电石渣进厂"){ + that.tableDatas[4][3] = item.amount_consume; + } + }); + } } }); }); @@ -573,7 +661,6 @@ export default { }, dateChange(val) { let that = this; - console.log(val); if (val !== null) { if (this.typeRadio == "month") { let year = val.split("-")[0]; @@ -603,18 +690,31 @@ export default { this.$API.enm.enstat.req(query1).then((response) => { let seriesData0 = [], seriesData1 = [], - seriesData2 = []; + seriesData2 = [], + seriesData3 = [], + seriesData4 = []; let data = response; data.forEach((item) => { let ind = item.day_s - 1; seriesData0[ind] = item.total_production; seriesData1[ind] = item.production_cost_unit; seriesData2[ind] = item.elec_consume_unit; + if (item.imaterial_data.length > 0) { + item.imaterial_data.forEach((items_n) => { + if (items_n.material_name == "湿电石渣消耗") { + seriesData3[ind] = items_n.amount_consume; + }else if(items_n.material_name == "湿电石渣进厂"){ + seriesData4[ind] = items_n.amount_consume; + } + }); + } }); let options = { ...that.option1 }; options.series[0].data = seriesData0; options.series[1].data = seriesData1; options.series[2].data = seriesData2; + options.series[3].data = seriesData3; + options.series[4].data = seriesData4; let dayXAxis = []; for (let i = 1; i <= that.days; i++) { let item = i + "日"; @@ -635,18 +735,31 @@ export default { this.$API.enm.enstat.req(query2).then((response) => { let seriesData0 = [], seriesData1 = [], - seriesData2 = []; + seriesData2 = [], + seriesData3 = [], + seriesData4 = []; let data = response; data.forEach((item) => { let ind = item.month_s - 1; seriesData0[ind] = item.total_production; seriesData1[ind] = item.production_cost_unit; seriesData2[ind] = item.elec_consume_unit; + if (item.imaterial_data.length > 0) { + item.imaterial_data.forEach((items_n) => { + if (items_n.material_name == "湿电石渣消耗") { + seriesData3[ind] = items_n.amount_consume; + }else if(items_n.material_name == "湿电石渣进厂"){ + seriesData4[ind] = items_n.amount_consume; + } + }); + } }); let options = { ...that.option2 }; options.series[0].data = seriesData0; options.series[1].data = seriesData1; options.series[2].data = seriesData2; + options.series[3].data = seriesData3; + options.series[4].data = seriesData4; let monthXAxis = []; for (let i = 1; i <= that.month; i++) { let item = i + "月"; diff --git a/src/views/enm_slag/teamAnalysis.vue b/src/views/enm_slag/teamAnalysis.vue index c2fc46cf..eb6fcf6e 100644 --- a/src/views/enm_slag/teamAnalysis.vue +++ b/src/views/enm_slag/teamAnalysis.vue @@ -85,6 +85,7 @@ export default { timeStamp: null, exportLoading: false, tableDatas: [], + goalDatas: [], }; }, mounted() { @@ -105,9 +106,9 @@ export default { this.$API.mtm.goal.list.req(params).then((res) => { let data = []; if (res.length > 0) { - data = res[0]; + this.goalDatas = res[0]; } - that.getData(data); + that.getData(this.goalDatas); }); }); }, @@ -121,42 +122,31 @@ export default { query0.mgroup = that.query.mgroup; let wrapArr = [], wrapArr0 = [], + compareArr0 = [], wrapArrs = []; this.$API.enm.enstat.req(query0).then((res0) => { let data0 = res0; if (data0.length > 0) { data0.forEach((item0) => { //先按月份排序,再按班组排序 - let n0 = item0.month_s; - let ind0 = 0; - if (item0.team_name.indexOf("甲") > -1) { - ind0 = (n0 - 1) * 3; - } else if (item0.team_name.indexOf("乙") > -1) { - ind0 = (n0 - 1) * 3 + 1; - } else if (item0.team_name.indexOf("丙") > -1) { - ind0 = (n0 - 1) * 3 + 2; - } wrapArr0[ind0] = item0; }); - console.log(wrapArr0); } else { } this.$API.enm.enstat.req(that.query).then((res) => { let data = res; if (data.length > 0) { + data.forEach((item) => { + //先按月份排序,再按班组排序 + let compareArr = []; + compareArr.push(item.month_s); + compareArr.push(item.team_name); + compareArr.push(item.elec_consume_unit); + compareArr0.push(compareArr); + }); data.forEach((item) => { //先按月份排序,再按班组排序 let n = item.month_s; - let team_name = item.team_name; - let ind = 0; - if (team_name.indexOf("甲") > -1) { - ind = (n - 1) * 3; - } else if (team_name.indexOf("乙") > -1) { - ind = (n - 1) * 3 + 1; - } else if (team_name.indexOf("丙") > -1) { - ind = (n - 1) * 3 + 2; - } - wrapArrs[ind] = item; let arr = []; let time = "" + item.year_s + "." + item.month_s; arr.push(time); @@ -179,22 +169,21 @@ export default { ? wrapArr0[ind_pre].elec_consume_unit : "/"; } else { - ind_pre = n - 1; - huanqi = wrapArr[ind_pre] - ? wrapArr[ind_pre].elec_consume_unit - ? wrapArr[ind_pre].elec_consume_unit - : "/" - : "/"; + // 如果 wrapArr数组长度大于0,那么循环遍历wrapArr数组,找到与item.month_s相差1的元素 而 item.name相同,并赋值给huanbi + compareArr0.forEach((item0) => { + if (item0[0] == item.month_s - 1 && item0[1] == item.team_name) { + huanqi = item0[2]; + } + }) } arr[7] = huanqi; //环期值(KW·h/t)上个月的值 - if (huanqi !== "/") { - huanqicha = item.celec_consume_unit - huanqi; - } else { - huanqicha = item.celec_consume_unit; + if (arr[6] !== "/"){ + arr[8] = (arr[4] - arr[7]).toFixed(2); //当期与环期差值(KW·h/t) + }else{ + arr[8] = "/"; //当期与环期差值(KW·h/t) } - arr[8] = huanqicha; //当期与环期差值(KW·h/t) - arr[9] = - huanqi != "/" ? (huanqicha / huanqi) * 100 : 0; //环比增长率(%) + // arr[8] = huanqicha; //当期与环期差值(KW·h/t) + arr[9] = arr[8] != "/" ? ((arr[7] / arr[8]) * 100).toFixed(2) : 0; //环比增长率(%) if (wrapArr0[n]) { tongqicha = item.celec_consume_unit - @@ -206,8 +195,10 @@ export default { } arr[10] = tongqi; //同比增长率(%) arr[11] = 0; //得分 - wrapArr[ind] = arr; + wrapArr.push(arr); + }); + console.log(wrapArr); that.tableDatas = wrapArr; } else { } @@ -216,7 +207,7 @@ export default { }, handleQuery() { this.tableDatas = []; - this.getData(); + this.getData(this.goalDatas); }, itemClick(type, item) { this.type = type; diff --git a/src/views/home/blank.vue b/src/views/home/blank.vue new file mode 100644 index 00000000..d4b7d494 --- /dev/null +++ b/src/views/home/blank.vue @@ -0,0 +1,5 @@ + diff --git a/src/views/inm/inmScrap.vue b/src/views/inm/inmScrap.vue new file mode 100644 index 00000000..5edb3cbb --- /dev/null +++ b/src/views/inm/inmScrap.vue @@ -0,0 +1,214 @@ + + + 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" > + + diff --git a/src/views/wpm_gx/pingmo.vue b/src/views/wpm_gx/pingmo.vue index 1b2a0547..1ef49570 100644 --- a/src/views/wpm_gx/pingmo.vue +++ b/src/views/wpm_gx/pingmo.vue @@ -32,7 +32,7 @@