From 04e3a2e18d7ef429f9a7058a9edfe4714e036149 Mon Sep 17 00:00:00 2001 From: shijing Date: Mon, 20 Jul 2026 09:50:14 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E7=A6=85=E9=81=93446=E6=B7=B1=E5=8A=A0?= =?UTF-8?q?=E5=B7=A5=E7=BB=9F=E8=AE=A1=E9=87=8C=E5=8A=A0=E5=B7=A5=E8=A3=85?= =?UTF-8?q?tab=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/statistics/bxerp/workerTimes.vue | 269 +++++++++++++++------ 1 file changed, 198 insertions(+), 71 deletions(-) diff --git a/src/views/statistics/bxerp/workerTimes.vue b/src/views/statistics/bxerp/workerTimes.vue index c6282a31..0e6f8a3e 100644 --- a/src/views/statistics/bxerp/workerTimes.vue +++ b/src/views/statistics/bxerp/workerTimes.vue @@ -4,6 +4,7 @@
- - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ {{ index+1 }} + {{ item }} +
+
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
@@ -93,6 +172,14 @@ export default { lists:[], mgruops:[], tableData:[], + userFilters:[], + filterUsers:[], + nameFilters:[], + filterNames:[], + visible:false, + userName:'', + code:'lineDay_p', + activeName:'shengchan', apiObj: this.$API.system.user.list, }; }, @@ -104,6 +191,12 @@ export default { that.getData(); }, methods: { + tabsClick(){ + let that = this; + that.$nextTick(()=>{ + that.getData(); + }) + }, getData(){ let that = this; that.lists = []; @@ -113,51 +206,85 @@ export default { that.coefficient = []; let params = {}; params.query = that.query; - that.$API.bi.dataset.exec.req('lineDay_p', params).then((res) => { + let code = that.activeName=='shengchan'?'lineDay_p':that.activeName=='gongzhuang'?'product_toolings':'product_kaitairen'; + that.$API.bi.dataset.exec.req(code, params).then((res) => { let data = res.data2.ds0; let coefficient = []; if(data.length>0){ - data.forEach(item=>{ - let obj = item.工序物料生产数?JSON.parse(item.工序物料生产数):{}; - for(let key in obj){ - if(coefficient.indexOf(key)<0){ - coefficient.push(key); - } - let mgroup = key.split('_')[0]; - let pname = key.split('_')[1]; - if(that.mgruops.indexOf(mgroup)<0){ - that.mgruops.push(mgroup); - that.lists.push({text:mgroup,value:[pname]}); - }else{ - var index = that.mgruops.indexOf(mgroup); - if(that.lists[index].value.indexOf(pname)<0){ - that.lists[index].value.push(pname); + if(that.activeName=='shengchan'){ + data.forEach(item=>{ + let obj = item.工序物料生产数?JSON.parse(item.工序物料生产数):{}; + for(let key in obj){ + if(coefficient.indexOf(key)<0){ + coefficient.push(key); } - } - item[key]= obj[key]; - item[pname]= obj[key]; - } - }) - that.coefficient = coefficient; - let item0 = {日期:'系数',操作人:'',indexs:0}; - coefficient.forEach(cof=>{ - item0[cof]= 1; - }) - data.unshift(item0); - data.forEach(item1 => { - item1.time_other=0; - let all = 0; - coefficient.forEach(item2 => { - if(item1[item2]){ - all = all+ Number(item1[item2]) + let mgroup = key.split('_')[0]; + let pname = key.split('_')[1]; + if(that.mgruops.indexOf(mgroup)<0){ + that.mgruops.push(mgroup); + that.lists.push({text:mgroup,value:[pname]}); + }else{ + var index = that.mgruops.indexOf(mgroup); + if(that.lists[index].value.indexOf(pname)<0){ + that.lists[index].value.push(pname); + } + } + item[key]= obj[key]; + item[pname]= obj[key]; } }) - item1.time_all = all; + that.coefficient = coefficient; + let item0 = {日期:'系数',操作人:'',indexs:0}; + coefficient.forEach(cof=>{ + item0[cof]= 1; + }) + data.unshift(item0); + data.forEach(item1 => { + item1.time_other=0; + let all = 0; + coefficient.forEach(item2 => { + if(item1[item2]){ + all = all+ Number(item1[item2]) + } + }) + item1.time_all = all; + }) + } + let userList = [],users = []; + let nameList = [],names = []; + data.forEach(item=>{ + if(that.activeName=='gongzhuang'){ + if(users.indexOf(item.工装编号)>-1){}else{ + users.push(item.工装编号); + userList.push({text:item.工装编号,value:item.工装编号}) + } + }else if(that.activeName=='renyuan'){ + if(users.indexOf(item.开台人员姓名)>-1){}else{ + users.push(item.开台人员姓名); + userList.push({text:item.开台人员姓名,value:item.开台人员姓名}) + } + } + if(names.indexOf(item.物料名)>-1){}else{ + names.push(item.物料名); + nameList.push({text:item.物料名,value:item.物料名}) + } + that.userFilters = userList; + that.nameFilters = nameList; }) } that.tableData = data; }); }, + filterUser(value, row) { + return row.工装编号 == value; + }, + filterUser3(value, row) { + return row.开台人员姓名 == value; + }, + filterName(value, row) { + return row.物料名 == value; + }, + xishuChange(){ let that = this; that.tableData.forEach((item1,index1) => {