diff --git a/src/api/model/wpm.js b/src/api/model/wpm.js index 6d13d792..56b4e1f6 100644 --- a/src/api/model/wpm.js +++ b/src/api/model/wpm.js @@ -383,6 +383,26 @@ export default { }, }, }, + mloguser: { + list: { + name: "列表", + req: async function (data) { + return await http.get(`${config.API_URL}/wpm/mloguser/`, data); + }, + }, + create: { + name: "创建", + req: async function (data) { + return await http.post(`${config.API_URL}/wpm/mloguser/`, data); + }, + }, + delete: { + name: "删除", + req: async function (id) { + return await http.delete(`${config.API_URL}/wpm/mloguser/${id}/`); + }, + }, + }, handover: { list: { name: "值班记录列表", @@ -559,6 +579,38 @@ export default { // return await http.get(`${config.API_URL}/wpm/batchlog/`, data); // }, // }, + batchlog: { + list: { + name: "批次列表", + req: async function (data) { + return await http.get(`${config.API_URL}/wpm/batchlog/`, data); + }, + }, + dag: { + name: "获取批次的DAG图数据", + req: async function (data) { + return await http.post(`${config.API_URL}/wpm/batchlog/dag/`, data); + }, + }, + batchesTo:{ + name: "获取已指向的批次号", + req: async function (data) { + return await http.post(`${config.API_URL}/wpm/batchlog/batches_to/`, data); + }, + }, + batchwork:{ + name: "工段批次加工进度", + req: async function (data) { + return await http.post(`${config.API_URL}/wpm/ana/batchwork/`, data); + }, + }, + }, + // batchlog: { + // name: "批次列表", + // req: async function (data) { + // return await http.get(`${config.API_URL}/wpm/batchlog/`, data); + // }, + // }, batchlog: { list: { name: "批次列表", @@ -591,6 +643,12 @@ export default { return await http.post(`${config.API_URL}/wpm/batchst/cquery/`, data); }, }, + batchstquery: { + name: "批次统计数据", + req: async function (data) { + return await http.post(`${config.API_URL}/wpm/batchst/cquery/`, data); + }, + }, wpr:{ list: { name: "动态产品", diff --git a/src/components/scTable/index.vue b/src/components/scTable/index.vue index 7d9feff0..b10ca015 100644 --- a/src/components/scTable/index.vue +++ b/src/components/scTable/index.vue @@ -333,14 +333,21 @@ export default { dataToExcel(this.hExportCols, this.tableData, this.hExportName?this.hExportName:'表格数据') }else if (type === 2) { const extractHeaderKeys = (columns) =>{ - const keys = columns.map(item => { - // 如果key中包含点号,只取点号前面的部分 - return item.key.split('.')[0]; - }); - - // 去重并转回字符串 - return [...new Set(keys)].join(','); - } + const keys = []; + columns.map(item => { + if(item.is_notquery){ + let key = item.key.split('.')[0]; + if(key.indexOf('mio')>-1){ + keys.push('mio'); + } + }else{ + let key = item.key.split('.')[0];// 如果key中包含点号,只取点号前面的部分 + keys.push(key); + } + }); + // 去重并转回字符串 + return [...new Set(keys)].join(','); + } var c = Object.assign({}, this.query, this.tableParams, {[this.orderStr]: this.order}, {page: 0}, {query: "{" + extractHeaderKeys(this.hExportCols) + "}"} ) diff --git a/src/components/xtSelect/index.vue b/src/components/xtSelect/index.vue index 23e88e31..a6924eb9 100644 --- a/src/components/xtSelect/index.vue +++ b/src/components/xtSelect/index.vue @@ -1,6 +1,6 @@ - - - + + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + @@ -469,7 +395,7 @@ @@ -536,12 +462,12 @@ @@ -577,9 +503,19 @@ + + + + + + @@ -591,9 +527,8 @@ export default { data() { return { params: { - ordering:'-last_time', - material_start__cate:'管', - last_time_isnull:false, + ordering:'-data__管料成型_小日期', + querys : [[{field:"data__has_key",compare:"",value:"管料成型_日期"}],[{field:"data__has_key",compare:"",value:"管料退火_日期"}]] }, query:{ batch__contains:'', @@ -601,7 +536,7 @@ export default { last_time__lte:'', }, - apiObj: this.$API.wpm.batchst, + apiObj: this.$API.wpm.batchstquery, options:[], tableData:[], }; @@ -609,33 +544,28 @@ export default { methods: { handleQuery(){ let that = this; - let querys = [],arr1=[],arr2=[]; + let querys = [[{field:"data__has_key",compare:"",value:"管料成型_日期"}],[{field:"data__has_key",compare:"",value:"管料退火_日期"}]]; let obj = {},obj1 = {},obj2 = {}; obj.field = 'batch__contains'; obj.value = that.query.batch__contains; obj.compare = ''; - obj1.field = 'last_time__gte'; + obj1.field = 'last_time'; obj1.value = that.query.last_time__gte; obj1.compare = 'gte'; - obj2.field = 'last_time__lte'; + obj2.field = 'last_time'; obj2.value = that.query.last_time__lte; obj2.compare = 'lte'; - if((that.query.last_time__gte==''||that.query.last_time__gte==null)&&(that.query.last_time__lte==''||that.query.last_time__lte==null)&&that.query.batch__contains!==''&&that.query.batch__contains!==null){ - querys.push(obj); + if(that.query.batch__contains!==''&&that.query.batch__contains!==null){ + querys[0].push(obj); + querys[1].push(obj); } if(that.query.last_time__gte!==''&&that.query.last_time__gte!==null){ - arr1.push(obj1); - if(that.query.batch__contains!==''&&that.query.batch__contains!==null){ - arr1.push(obj); - } - querys.push(arr1) + querys[0].push(obj1); + querys[1].push(obj1); } if(that.query.last_time__lte!==''&&that.query.last_time__lte!==null){ - arr2.push(obj2); - if(that.query.batch__contains!==''&&that.query.batch__contains!==null){ - arr2.push(obj); - } - querys.push(arr2) + querys[0].push(obj2); + querys[1].push(obj2); } let params = {}; params.querys = querys; diff --git a/src/views/statistics/total_statistics.vue b/src/views/statistics/total_statistics.vue index 1c9f9ebe..a033658e 100644 --- a/src/views/statistics/total_statistics.vue +++ b/src/views/statistics/total_statistics.vue @@ -80,7 +80,7 @@

管数据

- + { + let datas = res.data2; + let data_b = [...datas.ds0, ...datas.ds2]; + let data_g = [...datas.ds1, ...datas.ds3]; + that.data_b = data_b; + that.data_g = data_g; + that.getSaleOutData(data_b, data_g); + }); + }, //获取表格原始数据 getSourceData() { let that = this; @@ -328,8 +339,6 @@ export default { key = "开槽"; } if (item1.车间==null||item1.车间==undefined) { - // console.log( '仓库库存',item1); - // console.log( item1.工序 !== "配管"&&item1.类型==10); if (item1.工序 == "配管") { key = "配管"; }else if(item1.工序 !== "配管"&&item1.类型==10){ @@ -353,18 +362,6 @@ export default { obj.成品库; that.tableData11[index] = obj; }); - // saleData.forEach((item) => { - // let index = 0; - // if (item.型号.indexOf("+") > -1) { - // let model = item.型号.split("+")[0]; - // index = models.indexOf(model); - // } else { - // index = models.indexOf(item.型号); - // } - // if (index > -1) { - // that.tableData11[index].检验合格数=item.数量; - // } - // }) that.models_b = models; that.getCountOk('b',models); }, @@ -460,8 +457,6 @@ export default { key = "倒角"; } if (item5.车间==null||item5.车间==undefined) { - // console.log( '仓库库存',item5); - // console.log( item5.工序 !== "配管"&&item5.类型==10); if (item5.工序 == "配管") { key = "配棒"; }else if(item5.工序 !== "配管"&&item5.类型==10){ @@ -531,7 +526,12 @@ export default { that.query.date = that.currentDate; } } - that.getSourceData(); + if(that.query.date == that.currentDate){ + that.getSourceDataNow(); + }else{ + that.getSourceData(); + } + }, }, }; diff --git a/src/views/wpm/mlog6_form.vue b/src/views/wpm/mlog6_form.vue index 16aa1941..5b93a337 100644 --- a/src/views/wpm/mlog6_form.vue +++ b/src/views/wpm/mlog6_form.vue @@ -21,20 +21,22 @@ v-if="mode == 'edit'" v-model="form.batch" > - - - + + + + @@ -482,6 +484,21 @@ + + + + + + + + + + + + + + + + + +