diff --git a/src/views/statistics/bxerp/workerTimes.vue b/src/views/statistics/bxerp/workerTimes.vue
index 22fbc71e..c2eab7e7 100644
--- a/src/views/statistics/bxerp/workerTimes.vue
+++ b/src/views/statistics/bxerp/workerTimes.vue
@@ -51,11 +51,26 @@
-
+
{{ scope.row[item.text+'_'+item1] }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -87,45 +102,83 @@ export default {
methods: {
getData(){
let that = this;
+ that.lists = [];
that.mgruops = [];
that.tableData = [];
+ that.titleList = [];
+ that.coefficient = [];
let params = {};
params.query = that.query;
that.$API.bi.dataset.exec.req('lineDay_p', params).then((res) => {
- let data = res.data2.ds0;
- that.lists = [];
- let coefficient = [];
- 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);
+ 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);
+ }
+ }
+ item[key]= obj[key];
+ item[pname]= obj[key];
}
- item[key]= obj[key];
- item[pname]= obj[key];
- }
- })
- let item0 = {日期:'系数',操作人:'',indexs:0};
- coefficient.forEach(cof=>{
- item0[cof]= 1;
- })
- if(data.length>0){
+ })
+ that.coefficient = coefficient;
+ let item0 = {日期:'系数',操作人:'',indexs:0};
+ coefficient.forEach(cof=>{
+ item0[cof]= 1;
+ })
data.unshift(item0);
- }
- that.tableData = data;
+ 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;
+ })
+ }
+ that.tableData = data;
});
},
+ xishuChange(){
+ let that = this;
+ that.tableData.forEach((item1,index1) => {
+ if(index1>0){
+ let all = 0;
+ that.coefficient.forEach(item2 => {
+ if(item1[item2]){
+ all = all+ Number(item1[item2])*Number(that.tableData[0][item2])
+ }
+ })
+ item1.time_all = all+Number(item1.time_other);
+ }
+ })
+ },
+ otherChange(index){
+ let that = this;
+ let all = 0;
+ console.log('index',index)
+ that.coefficient.forEach(item2 => {
+ if(that.tableData[index][item2]){
+ all = all+ Number(that.tableData[index][item2])*Number(that.tableData[0][item2])
+ }
+ that.tableData[index].time_all = all+Number(that.tableData[index].time_other);
+ })
+ },
deptChange(){
this.getData();
},