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 @@
-
-
-
-
-
-
-
-
-
- {{ scope.row[item.text+'_'+item1] }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ scope.row[item.text+'_'+item1] }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ index+1 }}
+ {{ item }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ scope.row.总切片数 }}
+ {{ scope.row.总生产数 }}
+
+
+
+
+ {{((scope.row.总切片合格数/scope.row.总切片数)*100).toFixed(2) }}%
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{((scope.row.总切片合格数/scope.row.总切片数)*100).toFixed(2) }}%
+ 0%
+
+
+
+
+
+
+
@@ -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) => {