Commit d87fcd76 authored by renjintao's avatar renjintao

部门导入page

parent b8520f72
This diff is collapsed.
......@@ -152,12 +152,23 @@ export default {
//重新处理colum
loadColum(columns) {
let tempCol = this.$u.clone(columns);
let doCol = []
tempCol.forEach((ele, index) => {
if (ele.key == "action" || ele.type == "selection" || ele.key == "ico") {
ele.hide = true;
}
if (ele.import) {
ele.hide = false
}
let temColObj = {
key: ele.key,
title: ele.title,
align: ele.align ? ele.align : 'left',
hide: ele.hide ? ele.hide : false,
}
doCol.push(temColObj)
});
this.colsIm = tempCol;
this.colsIm = doCol;
this.colsIm.unshift({
type: 'index',
width: 80,
......@@ -350,6 +361,9 @@ export default {
let imData = [];
let imDataError = []
this.dataIm.forEach(ele => {
if (ele.parent_Id && ele.parentTitle) { //部门管理导入暂时处置
ele.parent_Id = null
}
if (!ele.ico) {
imData.push(ele)
} else {
......
......@@ -432,6 +432,7 @@ export default {
location:'省市县',
parent_Id:'上级部门',
property:'属性',
parentTitle:'上级部门'
},
instance: {
id: '主键',
......
......@@ -164,7 +164,7 @@ henq.getDepartAllName = (list,id) => {
list.map(u => {
if(id==u.id)
{
names=u.name+"-"+names
names=u.name+"/"+names
if (u.parent_Id>0) {
getDepartAllName(list, u.parent_Id)
}
......
......@@ -71,6 +71,11 @@ export default {
aId: 0,
rowData: null,
columns: [{
key: "name",
title: this.l("name"),
align: "left",
},
{
key: "parent_Id",
title: this.l("parent_Id"),
align: "left",
......@@ -83,11 +88,6 @@ export default {
)
}
},
{
key: "name",
title: this.l("name"),
align: "left",
},
{
key: "code",
title: this.l("code"),
......@@ -101,7 +101,7 @@ export default {
import: true,
render: (h, params) => {
return h("span", {},
this.getCity(params.row.location ? params.row.location : 0))
this.getCityName(params.row.location ? params.row.location : 0))
}
},
{
......@@ -277,7 +277,7 @@ export default {
})
},
//根据value获取当前cityname
getCity(val) {
getCityName(val) {
let cities = this.$u.clone(this.cityDatas)
let label = "";
cities.forEach(ele => {
......@@ -287,12 +287,32 @@ export default {
})
return label
},
//根据Id获取上级到本级的部门名称
getCityValue(val) {
let cities = this.$u.clone(this.cityDatas)
let value = "";
cities.forEach(ele => {
if (val == ele.label) {
value = ele.value
}
})
return value
},
//根据Id获取上级的部门名称
getParentDepart(val) {
let departList = this.$u.clone(this.treeList)
return this.$u.getDepartAllName(departList, val)
},
//根据名称获取上级部门的ID
getParentDepartName(val) {
let departList = this.$u.clone(this.treeList)
let value = null
departList.forEach(ele => {
if (val == ele.name) {
value = ele.id
}
})
return value
},
ok() {
this.init();
this.modal = false;
......@@ -340,7 +360,7 @@ export default {
);
});
tempCol1.forEach((ele1) => {
e[ele1.key] = this.getCity(e[ele1.key]);
e[ele1.key] = this.getCityName(e[ele1.key]);
});
tempCol2.forEach((ele2) => {
e[ele2.key] = this.getParentDepart(e[ele2.key]);
......@@ -374,12 +394,12 @@ export default {
let tempList = [];
tempData.forEach((ele) => {
let obj = {
parentTitle: ele.parentTitle ? ele.parentTitle : '',
parentTitle: ele.parent_Id ? ele.parent_Id : '',
name: ele.name ? ele.name : '', //部门名称
parent_Id: ele.parent_Id ? ele.parent_Id : 0, //上级部门 [id]
parent_Id: ele.parent_Id ? ele.parent_Id : '', //上级部门 [id]
code: ele.code ? ele.code : '', //部门编号
location: ele.location ? ele.location : '', //省市县
isProduction: 1, //是否生产班组:1是,0否
location: ele.location ? this.getCityValue(ele.location) : '', //省市县
isProduction: 0, //是否生产班组:1是,0否
property: ele.property ? ele.property : '' //属性
};
if (ele.name && ele.name != '') {
......
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