Commit 8f87ce01 authored by renjintao's avatar renjintao

datagrid

parent 47b9c631
...@@ -102,6 +102,7 @@ export default { ...@@ -102,6 +102,7 @@ export default {
treeData: [], //物料数据 treeData: [], //物料数据
codeRuleData: [], //物料编码 codeRuleData: [], //物料编码
routingHeaderData: [], //工艺规程 routingHeaderData: [], //工艺规程
allUser: [] //所有user
}; };
}, },
props: { props: {
...@@ -277,6 +278,7 @@ export default { ...@@ -277,6 +278,7 @@ export default {
this.getTreeData(); this.getTreeData();
this.getcodeRuleData(); this.getcodeRuleData();
this.getRoutingHeaderData(); this.getRoutingHeaderData();
this.getAllUser(); //获取所有用户
}, },
methods: { methods: {
//数据加载 //数据加载
...@@ -472,6 +474,36 @@ export default { ...@@ -472,6 +474,36 @@ export default {
selectAll(status) { selectAll(status) {
this.$refs.table.selectAll(status); this.$refs.table.selectAll(status);
}, },
//获取所有用户信息
getAllUser() {
this.$api.post(`${systemUrl}/user/paged`, {
conditions: [],
pageIndex: 1,
pageSize: 1000,
})
.then((r) => {
if (r.success) {
let tempUserInfo = r.result.items
tempUserInfo.forEach(ele => {
let temObj = {
userId: ele.id,
name: ele.userName
}
this.allUser.push(temObj)
})
}
})
},
getUserName(id) {
let name = ''
this.allUser.forEach(ele => {
if (id == ele.userId) {
name = ele.name
}
})
return name
},
//批量取消 //批量取消
cancelBatch() { cancelBatch() {
this.footerToolbar = false; this.footerToolbar = false;
...@@ -522,6 +554,7 @@ export default { ...@@ -522,6 +554,7 @@ export default {
var tempCol = []; var tempCol = [];
var tempCol1 = []; //存放物料相关表头 var tempCol1 = []; //存放物料相关表头
var tempCol2 = []; //存放工艺规程相关表头 var tempCol2 = []; //存放工艺规程相关表头
var tempColUser = []; //存放type=user的表头
var columnsCur = this.$u.clone(this.columnsCur); //导出列标题信息griddata this.$refs.grid.columnsCur var columnsCur = this.$u.clone(this.columnsCur); //导出列标题信息griddata this.$refs.grid.columnsCur
columnsCur.forEach((el) => { columnsCur.forEach((el) => {
if ( if (
...@@ -549,6 +582,12 @@ export default { ...@@ -549,6 +582,12 @@ export default {
code: el.techKey, code: el.techKey,
}); //临时存放工艺规程相关转换 }); //临时存放工艺规程相关转换
} }
if (el.type && el.type == "user") {
tempColUser.push({
key: el.key,
code: el.type,
}); //临时存放user列
}
tHeader.push(el.title); tHeader.push(el.title);
filterVal.push(el.key); filterVal.push(el.key);
...@@ -609,6 +648,16 @@ export default { ...@@ -609,6 +648,16 @@ export default {
e[elcol2.key] = this.getRoutingHeaderName(e[elcol2.key]); e[elcol2.key] = this.getRoutingHeaderName(e[elcol2.key]);
} }
}); });
//导出username相关信息
tempColUser.forEach(eluser => {
if (
e[eluser.key] &&
e[eluser.key] != "" &&
e[eluser.key] != null
) {
e[eluser.key] = this.getUserName(e[eluser.key])
}
})
}); });
let nowDate = this.$u.getNowTime(); //年月日时分秒yyyyMMddhhmmss let nowDate = this.$u.getNowTime(); //年月日时分秒yyyyMMddhhmmss
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment