feat:人员工时统计-冷加工统计,添加第一行系数
This commit is contained in:
parent
77806aa776
commit
9a727978ad
|
|
@ -49,7 +49,8 @@
|
||||||
<el-table-column v-for="item in lists" :key="item" :label="item.text">
|
<el-table-column v-for="item in lists" :key="item" :label="item.text">
|
||||||
<el-table-column v-for="item1 in item.value" :key="item1" :label="item1">
|
<el-table-column v-for="item1 in item.value" :key="item1" :label="item1">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<span v-if="scope.row[item1]">{{ scope.row[item.text+'_'+item1] }}</span>
|
<el-input v-if="scope.row.indexs==0&&scope.row" v-model="scope.row[item.text+'_'+item1]"></el-input>
|
||||||
|
<span v-if="scope.row.indexs!==0&&scope.row">{{ scope.row[item.text+'_'+item1] }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
@ -85,17 +86,21 @@ export default {
|
||||||
getData(){
|
getData(){
|
||||||
let that = this;
|
let that = this;
|
||||||
that.mgruops = [];
|
that.mgruops = [];
|
||||||
|
that.tableData = [];
|
||||||
let params = {};
|
let params = {};
|
||||||
params.query = that.query;
|
params.query = that.query;
|
||||||
that.$API.bi.dataset.exec.req('lineDay_p', params).then((res) => {
|
that.$API.bi.dataset.exec.req('lineDay_p', params).then((res) => {
|
||||||
let data = res.data2.ds0;
|
let data = res.data2.ds0;
|
||||||
that.lists = [];
|
that.lists = [];
|
||||||
|
let coefficient = [];
|
||||||
data.forEach(item=>{
|
data.forEach(item=>{
|
||||||
let obj = JSON.parse(item.工段物料生产数);
|
let obj = JSON.parse(item.工段物料生产数);
|
||||||
for(let key in obj){
|
for(let key in obj){
|
||||||
|
if(coefficient.indexOf(key)<0){
|
||||||
|
coefficient.push(key);
|
||||||
|
}
|
||||||
let mgroup = key.split('_')[0];
|
let mgroup = key.split('_')[0];
|
||||||
let pname = key.split('_')[1];
|
let pname = key.split('_')[1];
|
||||||
|
|
||||||
if(that.mgruops.indexOf(mgroup)<0){
|
if(that.mgruops.indexOf(mgroup)<0){
|
||||||
that.mgruops.push(mgroup);
|
that.mgruops.push(mgroup);
|
||||||
that.lists.push({text:mgroup,value:[pname]});
|
that.lists.push({text:mgroup,value:[pname]});
|
||||||
|
|
@ -109,6 +114,11 @@ export default {
|
||||||
item[pname]= obj[key];
|
item[pname]= obj[key];
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
let item0 = {日期:'系数',操作人:'',indexs:0};
|
||||||
|
coefficient.forEach(cof=>{
|
||||||
|
item0[cof]= 1;
|
||||||
|
})
|
||||||
|
data.unshift(item0);
|
||||||
that.tableData = data;
|
that.tableData = data;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue