diff --git a/src/api/model/mtm.js b/src/api/model/mtm.js index 899656b5..1912c4c8 100644 --- a/src/api/model/mtm.js +++ b/src/api/model/mtm.js @@ -96,6 +96,14 @@ export default { data); } }, + setWeekConsume: { + name: "更新周预估值", + req: async function(id, data){ + return await http.put( + `${config.API_URL}/mtm/material/${id}/set_week_esitimate_consume/`, + data); + } + }, update: { name: "更新", req: async function(id, data){ diff --git a/src/config/route.js b/src/config/route.js index 5ab4a9aa..c59c60c4 100644 --- a/src/config/route.js +++ b/src/config/route.js @@ -2416,7 +2416,7 @@ const routes = [ "path": "/material_statistics", "name": "material_statistics", "meta": { - "title": "物料统计", + "title": "采购统计", "icon": "el-icon-trend-charts", "perms": ["statistic_material"], }, @@ -2444,6 +2444,17 @@ const routes = [ }, "component": "statistics/inm_statistics.vue" }, + //库存统计 + { + "path": "/stock_statistics", + "name": "stock_statistics", + "meta": { + "title": "库存统计", + "icon": "el-icon-trend-charts", + "perms": ["statistic_stock"], + }, + "component": "statistics/stock_statistics.vue" + }, ], // children:[ // { diff --git a/src/utils/enum.js b/src/utils/enum.js index df90f8ab..ebb6dc50 100644 --- a/src/utils/enum.js +++ b/src/utils/enum.js @@ -62,7 +62,23 @@ export const drainTypeEnum = new EnumFactory({ 'mtrans': '物料输送', 'mstore':'物料储存' }) - +export const mioTypeEnum = new EnumFactory({ + 'do_out': '生产领料', + 'sale_out': '销售发货', + 'pur_in': '采购入库', + 'do_in': '生产入库', + 'other_in': '其他入库', + 'other_out': '其他出库' +}) +export const productTypeEnum = new EnumFactory({ + 10: '成品', + 20: '半成品', + 30: '主要原料', + 40: '辅助材料', + 50: '加工工具', + 60: '辅助工装', + 70: '办公用品', +}) export const eqTypeEnum = new EnumFactory({ 10: { text: '生产设备', type: 'success' }, 20: { text: '计量设备', type: 'primary' }, diff --git a/src/views/statistics/inm_check.vue b/src/views/statistics/inm_check.vue index 156109a9..d2c60f72 100644 --- a/src/views/statistics/inm_check.vue +++ b/src/views/statistics/inm_check.vue @@ -42,7 +42,7 @@ 导出 - + @@ -81,7 +81,7 @@ 导出 - + @@ -142,22 +142,21 @@ tooltip: { trigger: 'item' }, - series: [ - { - name: '访问来源', - type: 'pie', - radius: ['40%', '70%'], - center: ['50%', '60%'], - label: false, - data: [ - {value: 1048, name: '搜索引擎'}, - {value: 735, name: '直接访问'}, - {value: 580, name: '邮件营销'}, - {value: 484, name: '联盟广告'}, - {value: 300, name: '视频广告'} - ] - } - ] + series: { + name: '预制棒', + type: 'pie', + radius: ['40%', '70%'], + center: ['50%', '60%'], + label: false, + data: [ + { value: 0, name: '炸纹' }, + { value: 0, name: '条纹' }, + { value: 0, name: '气泡' }, + { value: 0, name: '弯曲' }, + { value: 0, name: '其他' }, + { value: 0, name: '合格' }, + ] + } }, option2: { title: { @@ -167,22 +166,21 @@ tooltip: { trigger: 'item' }, - series: [ - { - name: '访问来源', - type: 'pie', - radius: ['40%', '70%'], - center: ['50%', '60%'], - label: false, - data: [ - {value: 1048, name: '搜索引擎'}, - {value: 735, name: '直接访问'}, - {value: 580, name: '邮件营销'}, - {value: 484, name: '联盟广告'}, - {value: 300, name: '视频广告'} - ] - } - ] + series: { + name: '预制管', + type: 'pie', + radius: ['40%', '70%'], + center: ['50%', '60%'], + label: false, + data: [ + { value: 0, name: '椭圆弯曲' }, + { value: 0, name: '大小头' }, + { value: 0, name: '偏壁' }, + { value: 0, name: '结石' }, + { value: 0, name: '气线' }, + { value: 0, name: '合格' }, + ] + } } } }, @@ -208,7 +206,7 @@ }else{ this.xAxisData = ['一月','二月','三月','四月','五月','六月','七月','八月','九月','十月','十一月','十二月'] } - this.option.xAxis.data = this.xAxisData; + this.option1.xAxis.data = this.xAxisData; this.option2.xAxis.data = this.xAxisData; }, //预制棒检验统计 @@ -218,9 +216,25 @@ query: { start_date: this.start_date, end_date: this.end_date, dept_name: "7车间" }, }; let exec = that.queryType=='月'?'lineWeek':'lineMonth'; - that.$API.bi.dataset.exec.req(exec, obj).then((doInRes) => { - console.log('7生产车间统计:',doInRes); - debugger; + that.$API.bi.dataset.exec.req(exec, obj).then((res) => { + console.log('7生产车间统计:', res); + if (res.data2.ds0 && res.data2.ds0.length > 0) { + let item = res.data2.ds0[0]; + that.yesterdayObjet = item; + that.option1.series.data[0].value = item.炸纹; + that.option1.series.data[1].value = item.条纹; + that.option1.series.data[2].value = item.气泡; + that.option1.series.data[3].value = item.弯曲; + that.option1.series.data[4].value = item.其他; + that.option1.series.data[5].value = item.合格数; + } else { + that.option1.series.data[0].value = 0; + that.option1.series.data[1].value = 0; + that.option1.series.data[2].value = 0; + that.option1.series.data[3].value = 0; + that.option1.series.data[4].value = 0; + that.option1.series.data[5].value = 0; + } }); }, //预制管检验统计 @@ -230,15 +244,30 @@ query: { start_date: this.start_date, end_date: this.end_date, dept_name: "10·车间" }, }; let exec = that.queryType=='月'?'lineWeek':'lineMonth'; - that.$API.bi.dataset.exec.req(exec, obj).then((doInRes) => { - console.log('10生产车间统计:',doInRes); - debugger; + that.$API.bi.dataset.exec.req(exec, obj).then((res) => { + console.log('10生产车间统计:',res); + if (res.data2.ds0 && res.data2.ds0.length > 0) { + let item = res.data2.ds0[0]; + that.yesterdayObjet = item; + that.option2.series.data[0].value = item.弯曲; + that.option2.series.data[1].value = item.大小头; + that.option2.series.data[2].value = item.偏壁; + that.option2.series.data[3].value = item.结石; + that.option2.series.data[4].value = item.气线; + that.option2.series.data[5].value = item.合格数; + } else { + that.option2.series.data[0].value = 0; + that.option2.series.data[1].value = 0; + that.option2.series.data[2].value = 0; + that.option2.series.data[3].value = 0; + that.option2.series.data[4].value = 0; + that.option2.series.data[5].value = 0; + } }); }, handleQuery(){ if(this.queryDate!==''){ if(this.queryType=='月'){ - this.start_date =this.queryDate+'-01'; let arr = this.queryDate.split('-'); this.end_date = this.queryDate+'-'+new Date(arr[0], arr[1], 0).getDate(); diff --git a/src/views/statistics/material_statistics.vue b/src/views/statistics/material_statistics.vue index dcb05521..8bfa54b6 100644 --- a/src/views/statistics/material_statistics.vue +++ b/src/views/statistics/material_statistics.vue @@ -51,7 +51,6 @@
-
导出 @@ -75,27 +74,16 @@
- -
-

消耗统计

- - - - -
-
- - -
- -
- + + +
+

采购统计总表

+
+
+ 导出 - + +