Commit d87fcd76 authored by renjintao's avatar renjintao

部门导入page

parent b8520f72
<template> <template>
<div class="table-content myBug"> <div class="table-content">
<div class="table-tools" v-if="tool"> <div class="table-tools" v-if="tool">
<div class="table-search" v-if="easy"> <div class="table-search">
<slot name="easySearch"> <slot name="easySearch" v-if="easy">
<Input <Form inline>
search <FormItem>
enter-button <Input search enter-button :placeholder="placeholder" @on-search="easySearch" v-width="300" v-model="keys" />
:placeholder="placeholder" </FormItem>
@on-search="easySearch" <FormItem>
v-model="keys"
/>
</slot>
</div>&nbsp;
<Button v-if="high" @click="modalSearch=true" type="text"> <Button v-if="high" @click="modalSearch=true" type="text">
<Icon type="md-search" />高级 <Icon type="md-search" />高级
</Button> </Button>
</FormItem>
</Form>
</slot>
</div>
<div class="searchBack"> <div class="searchBack">
<slot name="searchBack"></slot> <slot name="searchBack"></slot>
</div> </div>
<div class="btns"> <div class="btns">
<slot name="buttons"></slot> <slot name="buttons"></slot>
<Button @click="export2Excel" v-if="exportTitle.length>0">导出</Button>
<Button v-if="set&&type=='table'" @click="config=!config"> <Button v-if="set&&type=='table'" @click="config=!config">
<Icon type="md-build" class="table-set" size="14" title="列设置" /> <Icon type="md-build" title="列设置" />
</Button> </Button>
</div> </div>
</div> </div>
<div v-if="type=='card'" class="table-card"> <div class="table-main" ref="main">
<Row> <Row v-if="type=='card'" :gutter="40">
<Col :span="span" v-for="(row,i) in list" :key="i"> <Col :span="span" v-for="(row,i) in list" :key="i">
<slot name="card" :row="row"> <slot name="card" :row="row">
<span>{{row.id}}</span> <span>{{row.id}}</span>
</slot> </slot>
</Col> </Col>
</Row> </Row>
<Table v-else :border="border" :columns="columnsNow" :data="list" :height="tableHeight" :draggable="draggable" ref="table" class="tableCommon" @on-expand="expand" @on-drag-drop="onDragDrop" @on-selection-change="selectionChange" @on-select="onSelect" @on-select-all="allChange" :row-key="rowKey" stripe></Table>
</div> </div>
<Table
v-else
:border="border"
:columns="columnsNow"
:data="list"
:height="tableHeight"
:draggable="draggable"
ref="table"
class="tableCommon"
@on-expand="expand"
@on-drag-drop="onDragDrop"
@on-selection-change="selectionChange"
@on-select="onSelect"
></Table>
<div class="table-footer"> <div class="table-footer">
<div>
<slot name="footer"></slot> <slot name="footer"></slot>
</div>&nbsp; <Page v-if="page" :total="search.total" :current="search.page" class="fr" show-total size="small" show-elevator show-sizer :page-size="search.pageSize" :page-size-opts="pageSizeOpts" @on-change="pageChange" @on-page-size-change="pageSizeChange" />
<Page
v-if="page"
:total="search.total"
:current="search.page"
class="mr15 mt5 fr"
show-total
size="small"
show-elevator
show-sizer
:page-size="search.pageSize"
:page-size-opts="pageSizeOpts"
@on-change="pageChange"
@on-page-size-change="pageSizeChange"
/>
</div> </div>
<Modal v-if="high" v-model="modalSearch" title="高级搜索" draggable width="800" ref="search"> <Modal v-if="high" v-model="modalSearch" title="高级搜索" draggable width="800" ref="search">
<slot name="searchForm"></slot> <slot name="searchForm"></slot>
...@@ -74,14 +48,7 @@ ...@@ -74,14 +48,7 @@
<Button @click="complexSearch" type="primary" style="margin-left:10px;">查询</Button> <Button @click="complexSearch" type="primary" style="margin-left:10px;">查询</Button>
</div> </div>
</Modal> </Modal>
<Drawer <Drawer title="列设置" v-if="set" v-model="config" :scrollable="true" placement="left" :mask="false">
title="列设置"
v-if="set"
v-model="config"
:scrollable="true"
placement="left"
:mask="false"
>
<div slot="header"> <div slot="header">
列设置 列设置
<a @click="undoConfig" class="ml50"> <a @click="undoConfig" class="ml50">
...@@ -89,11 +56,7 @@ ...@@ -89,11 +56,7 @@
</a> </a>
</div> </div>
<ul class="table-columns"> <ul class="table-columns">
<li <li v-for="(li,index) in columnsCur" :key="index" v-dragging="{ item: li, list: columnsCur, group: 'li' }">
v-for="(li,index) in columnsCur"
:key="index"
v-dragging="{ item: li, list: columnsCur, group: 'li' }"
>
<label @click="columnChange(li,index)" :class="{dis:li.hide}"> <label @click="columnChange(li,index)" :class="{dis:li.hide}">
<Icon :type="li.hide?'md-eye-off':'md-eye'" size="16" class="mr10" /> <Icon :type="li.hide?'md-eye-off':'md-eye'" size="16" class="mr10" />
<span>{{li.title}}</span> <span>{{li.title}}</span>
...@@ -102,15 +65,13 @@ ...@@ -102,15 +65,13 @@
</li> </li>
</ul> </ul>
</Drawer> </Drawer>
<FooterToolbar style="height:65px" v-if="batch" v-show="footerToolbar">
<div class="tip">
已选{{selectItems.length}}
<slot name="batch"></slot>
</div>
<Button @click="footerToolbar=false">取消</Button> <FooterToolbar v-if="batch" v-show="footerToolbar" class="ftball">
<div class="tip">已选{{selectItems.length}}</div>
<slot name="batch"></slot>
<Button @click="cancelBatch">取消</Button>
</FooterToolbar> </FooterToolbar>
</div> </div>
</template> </template>
<script> <script>
...@@ -127,6 +88,7 @@ export default { ...@@ -127,6 +88,7 @@ export default {
pageSize: 20, pageSize: 20,
conditions: [], conditions: [],
}, },
searchConditions: this.search,
pageSizeOpts: [20, 50, 100], pageSizeOpts: [20, 50, 100],
tableHeight: 0, tableHeight: 0,
firstY: 0, firstY: 0,
...@@ -137,6 +99,9 @@ export default { ...@@ -137,6 +99,9 @@ export default {
userConfig: null, //用户页面配置信息。, userConfig: null, //用户页面配置信息。,
// userId: 1 // userId: 1
userId: this.$store.state.userInfo.userId, userId: this.$store.state.userInfo.userId,
treeData: [], //物料数据
codeRuleData: [], //物料编码
routingHeaderData: [], //工艺规程
}; };
}, },
props: { props: {
...@@ -150,6 +115,14 @@ export default { ...@@ -150,6 +115,14 @@ export default {
type: Boolean, type: Boolean,
default: true, default: true,
}, },
format: {
type: Function,
default: null,
},
initsearch: {
type: Function,
default: null,
},
lazy: { lazy: {
//懒加载设置,设置为真时候,默认不加载数据。 //懒加载设置,设置为真时候,默认不加载数据。
type: Boolean, type: Boolean,
...@@ -215,7 +188,11 @@ export default { ...@@ -215,7 +188,11 @@ export default {
type: Object, type: Object,
default: function () { default: function () {
return { return {
keys: { op: "name", value: "", default: true }, keys: {
op: "name",
value: "",
default: true,
},
}; };
}, },
}, },
...@@ -228,9 +205,23 @@ export default { ...@@ -228,9 +205,23 @@ export default {
}, },
}, },
span: { span: {
//栅格数
type: Number, type: Number,
default: 24, default: 24,
}, },
//table控件children子数据控制功能
rowKey: {
type: [String, Number],
},
gutter: {
//间距
type: Number,
default: 40,
},
exportTitle: {
type: String,
default: "",
},
}, },
created() { created() {
this.columns.forEach((u) => { this.columns.forEach((u) => {
...@@ -250,40 +241,58 @@ export default { ...@@ -250,40 +241,58 @@ export default {
if (this.lazy == true) { if (this.lazy == true) {
return; return;
} }
if (this.set == true) { if (this.userId > 0 && this.set) {
this.loadUserConfig(); this.loadUserConfig();
} else {
this.easySearch();
} }
// else
// {
// this.columnsCur = this.$u.clone(this.columns);
// }
if (this.height === 0) { if (this.height === 0) {
this.$nextTick(() => {
this.tableHeight = this.$refs.main.offsetHeight;
if (this.tableHeight < 300) {
this.tableHeight =
window.screen.availHeight - this.$refs.main.offsetTop - 200;
}
window.onresize = () => { window.onresize = () => {
///浏览器窗口大小变化 ///浏览器窗口大小变化
return (() => { return (() => {
window.screenHeight = window.innerHeight; if (this.$refs.main && this.$refs.main.offsetHeight) {
this.tableHeight = window.screenHeight - this.firstY - 60; this.tableHeight = this.$refs.main.offsetHeight;
if (this.tableHeight < 300) {
this.tableHeight =
window.screen.availHeight - this.$refs.main.offsetTop - 150;
}
}
})(); })();
}; };
});
} else { } else {
this.tableHeight = this.height; this.tableHeight = this.height;
} }
//注册拖拽事件。 //注册拖拽事件。
this.$dragging.$on("dragend", (e) => { this.$dragging.$on("dragend", (e) => {
// console.log("dragend",e);
this.saveUserconfig(); this.saveUserconfig();
}); });
//物料加载类型数据
//this.getTreeData();
//this.getcodeRuleData();
//this.getRoutingHeaderData();
}, },
methods: { methods: {
//数据加载 //数据加载
load() { load() {
if (this.height == 0) {
this.tableHeight = window.innerHeight - this.firstY - 60;
}
if (this.action) { if (this.action) {
//条件初始化处理。
if (this.initsearch) {
this.initsearch(this.search);
}
this.$api.post(this.action, this.search).then((r) => { this.$api.post(this.action, this.search).then((r) => {
if (this.format) {
this.list = this.format(r.result.items);
} else {
this.list = r.result.items; this.list = r.result.items;
this.search.total = r.result.totalCount; }
this.search.total = r.result.totalCount || r.result.count;
}); });
} }
}, },
...@@ -291,7 +300,6 @@ export default { ...@@ -291,7 +300,6 @@ export default {
if (this.userConfig) { if (this.userConfig) {
var curColumns = []; var curColumns = [];
var config = JSON.parse(this.userConfig.content); var config = JSON.parse(this.userConfig.content);
// console.warn("2:列比对",config)
if (config.length == this.columnsCur.length) { if (config.length == this.columnsCur.length) {
config.map((u) => { config.map((u) => {
var item = this.columnsCur.filter((c) => { var item = this.columnsCur.filter((c) => {
...@@ -302,15 +310,13 @@ export default { ...@@ -302,15 +310,13 @@ export default {
curColumns.push(item[0]); curColumns.push(item[0]);
} }
}); });
// console.warn("3:初始化列")
this.columnsCur = curColumns; this.columnsCur = curColumns;
} }
} }
}, },
loadUserConfig() { loadUserConfig() {
var query = { var query = {
conditions: [ conditions: [{
{
fieldName: "creatorUserId", fieldName: "creatorUserId",
fieldValue: this.userId, fieldValue: this.userId,
conditionalType: "Equal", conditionalType: "Equal",
...@@ -332,7 +338,6 @@ export default { ...@@ -332,7 +338,6 @@ export default {
if (r.success) { if (r.success) {
if (r.result.length == 1) { if (r.result.length == 1) {
this.userConfig = r.result[0]; this.userConfig = r.result[0];
// console.warn("1:加载用户配置")
this.columnInit(); this.columnInit();
} }
if (!this.configLoad) { if (!this.configLoad) {
...@@ -376,7 +381,11 @@ export default { ...@@ -376,7 +381,11 @@ export default {
this.$emit("on-drag-drop", a, b); this.$emit("on-drag-drop", a, b);
}, },
easySearch() { easySearch() {
if (this.conditions && this.conditions.keys.default) { if (
this.conditions &&
this.conditions.keys &&
this.conditions.keys.default
) {
//判断没有传入条件的用默认的查询 //判断没有传入条件的用默认的查询
this.conditions.keys.value = this.keys; this.conditions.keys.value = this.keys;
} }
...@@ -398,12 +407,13 @@ export default { ...@@ -398,12 +407,13 @@ export default {
}, },
reload(conditions) { reload(conditions) {
var where = []; var where = [];
this.searchConditions = conditions;
if (conditions) { if (conditions) {
Object.keys(conditions).forEach((u) => { Object.keys(conditions).forEach((u) => {
let v = conditions[u].value; let v = conditions[u].value;
let op = conditions[u].op; let op = conditions[u].op;
if (!this.$u.isNull(v)) { if (!this.$u.isNull(v)) {
if (op == "Range") { if (op == "Range" && Array.isArray(v)) {
let times = []; let times = [];
v.map((u) => { v.map((u) => {
if (!this.$u.isNull(u)) { if (!this.$u.isNull(u)) {
...@@ -411,7 +421,7 @@ export default { ...@@ -411,7 +421,7 @@ export default {
} }
}); });
v = times.join(","); v = times.join(",");
} else if (op.indexOf("In") > -1) { } else if (op.indexOf("In") > -1 && Array.isArray(v)) {
v = v.join(","); v = v.join(",");
} }
if (!this.$u.isNull(v)) { if (!this.$u.isNull(v)) {
...@@ -449,7 +459,10 @@ export default { ...@@ -449,7 +459,10 @@ export default {
this.footerToolbar = items.length > 0; this.footerToolbar = items.length > 0;
}, },
onSelect(rows, row) { onSelect(rows, row) {
this.$emit("on-selection-change", rows, row); this.$emit("on-change", rows, row);
},
allChange(items) {
this.$emit("all-change", items);
}, },
intY() { intY() {
if (this.$refs.table != undefined) { if (this.$refs.table != undefined) {
...@@ -459,6 +472,95 @@ export default { ...@@ -459,6 +472,95 @@ export default {
selectAll(status) { selectAll(status) {
this.$refs.table.selectAll(status); this.$refs.table.selectAll(status);
}, },
//批量取消
cancelBatch() {
this.footerToolbar = false;
this.$refs.table.selectAll(false);
},
//导出excel
export2Excel() {
//当前显示数据
var where = [];
var conditions = this.searchConditions;
if (conditions) {
Object.keys(conditions).forEach((u) => {
let v = conditions[u].value;
let op = conditions[u].op;
if (!this.$u.isNull(v)) {
if (op == "Range") {
let times = [];
v.map((u) => {
if (!this.$u.isNull(u)) {
times.push(this.$u.toTime(u));
}
});
v = times.join(",");
} else if (op.indexOf("In") > -1 && Array.isArray(v)) {
v = v.join(",");
}
if (!this.$u.isNull(v)) {
where.push({
fieldName: u,
fieldValue: v,
conditionalType: op,
});
}
}
});
}
let searchs = {
pageIndex: 1,
conditions: where,
pageSize: 1000,
};
this.$api.post(this.action, searchs).then((r) => {
let list = [];
list = r.result.items;
const tHeader = []; // 设置Excel的表格第一行的标题
const filterVal = []; //list里对象的属性
var tempCol = [];
var columnsCur = this.$u.clone(this.columnsCur); //导出列标题信息griddata this.$refs.grid.columnsCur
columnsCur.forEach((el) => {
if (
(el.hide && el.import) ||
(!el.hide &&
el.key != "action" &&
el.type != "selection" &&
el.key != "ico")
) {
if (el.code) {
tempCol.push({
key: el.key,
code: el.code,
}); //临时存放code数据字典的字段及对应的数据字典code
}
tHeader.push(el.title);
filterVal.push(el.key);
}
});
list.forEach((e) => {
//给导出数据增加数据字典对应的name
tempCol.forEach((ele) => {
e[ele.key] = this.$u.dirName(
this.$store.getters.dictionaryByKey(ele.code),
e[ele.key]
);
});
});
let nowDate = this.$u.getNowTime(); //年月日时分秒yyyyMMddhhmmss
//获取导出数据结束
this.$u.outExcel(
this.exportTitle + "(" + nowDate + ")",
tHeader,
filterVal,
list
);
});
},
}, },
computed: { computed: {
columnsNow() { columnsNow() {
...@@ -482,11 +584,25 @@ export default { ...@@ -482,11 +584,25 @@ export default {
if (u.type == "user") { if (u.type == "user") {
u.render = (h, params) => { u.render = (h, params) => {
let values = u.key; let values = u.key;
if (params.row[values]) {
return h("User", { return h("User", {
props: { props: {
value: params.row[values], value: params.row[values],
}, },
}); });
}
};
}
if (u.type == "workShopName") {
u.render = (h, params) => {
let values = u.key;
if (params.row[values]) {
return h("WorkShopName", {
props: {
value: params.row[values],
},
});
}
}; };
} }
if (u.type == "date" || u.type == "dateTime") { if (u.type == "date" || u.type == "dateTime") {
...@@ -506,104 +622,129 @@ export default { ...@@ -506,104 +622,129 @@ export default {
}, },
}, },
watch: { watch: {
"data.length"() { data() {
this.list = this.data; this.list = this.data;
}, },
height() { height() {
this.tableHeight = this.height; this.tableHeight = this.height;
}, },
columns() {
this.columns.forEach((u) => {
if (!u.hide) {
u.hide = false;
}
});
this.columnsCur = this.$u.clone(this.columns);
},
}, },
}; };
</script> </script>
<style lang="less" scoped> <style lang="less">
.table-content { .table-content {
position: relative; position: relative;
// height: 100%; height: 100%;
.tableCommon { display: flex;
width: 100%; flex-direction: column;
}
.tip { .tip {
display: inline; display: inline;
} }
.tableCommon tr th {
line-height: 30px;
font-size: 14px;
background: #f5f6fa;
}
.tableCommon tr td { form {
line-height: 25px; display: inline-block;
font-size: 14px;
padding: 0 2px;
}
.tableCommon tr td .ivu-table-cell { .ivu-form-item {
padding: 0 5px; margin: 0;
vertical-align: middle;
}
} }
.table-card {
.table-main {
width: 100%; width: 100%;
text-align: left; text-align: left;
padding: 0; padding: 0;
display: block; display: block;
overflow-y: auto; overflow-y: auto;
flex-grow: 1;
tr td .ivu-table-cell {
padding: 0 5px;
}
overflow-x: hidden;
} }
.table-tools { .table-tools {
display: flex;
line-height: 50px;
//background: @right-header-bg;
.table-search { .table-search {
float: left; flex-grow: 1;
line-height: 40px;
} }
.btns { .btns {
float: right; min-width: 200px;
line-height: 40px; text-align: right;
} }
} }
.table-set { .table-footer {
cursor: pointer; line-height: 45px;
} }
.table-set:hover {
color: orange; .ivu-footer-toolbar {
text-align: left;
background: rgba(0, 0, 0, 0.7);
color: #fff;
} }
// .table-footer {
// line-height: 40px;
// }
} }
.table-columns { .table-columns {
max-height: calc(100% - 50px); max-height: calc(100% - 50px);
overflow: auto; overflow: auto;
li { li {
list-style: none; list-style: none;
line-height: 40px; line-height: 40px;
cursor: move; cursor: move;
border-bottom: 1px dotted #249e91; border-bottom: 1px dotted #249e91;
color: #249e91; color: #249e91;
span { span {
cursor: pointer; cursor: pointer;
} }
.mr10 { .mr10 {
cursor: pointer; cursor: pointer;
} }
.move { .move {
float: right; float: right;
margin: 10px 10px 0 0; margin: 10px 10px 0 0;
cursor: move; cursor: move;
} }
.dis { .dis {
color: #aaa; color: #aaa;
} }
} }
} }
.searchBack { .searchBack {
display: inline; display: inline;
margin-left: 20px; margin-left: 20px;
button { button {
margin-left: 10px; margin-left: 10px;
} }
a { a {
margin-left: 20px; margin-left: 20px;
color: #2680eb; color: #2680eb;
} }
a:hover { a:hover {
color: #249e91; color: #249e91;
} }
......
...@@ -152,12 +152,23 @@ export default { ...@@ -152,12 +152,23 @@ export default {
//重新处理colum //重新处理colum
loadColum(columns) { loadColum(columns) {
let tempCol = this.$u.clone(columns); let tempCol = this.$u.clone(columns);
let doCol = []
tempCol.forEach((ele, index) => { tempCol.forEach((ele, index) => {
if (ele.key == "action" || ele.type == "selection" || ele.key == "ico") { if (ele.key == "action" || ele.type == "selection" || ele.key == "ico") {
ele.hide = true; 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({ this.colsIm.unshift({
type: 'index', type: 'index',
width: 80, width: 80,
...@@ -350,6 +361,9 @@ export default { ...@@ -350,6 +361,9 @@ export default {
let imData = []; let imData = [];
let imDataError = [] let imDataError = []
this.dataIm.forEach(ele => { this.dataIm.forEach(ele => {
if (ele.parent_Id && ele.parentTitle) { //部门管理导入暂时处置
ele.parent_Id = null
}
if (!ele.ico) { if (!ele.ico) {
imData.push(ele) imData.push(ele)
} else { } else {
......
...@@ -432,6 +432,7 @@ export default { ...@@ -432,6 +432,7 @@ export default {
location:'省市县', location:'省市县',
parent_Id:'上级部门', parent_Id:'上级部门',
property:'属性', property:'属性',
parentTitle:'上级部门'
}, },
instance: { instance: {
id: '主键', id: '主键',
......
...@@ -164,7 +164,7 @@ henq.getDepartAllName = (list,id) => { ...@@ -164,7 +164,7 @@ henq.getDepartAllName = (list,id) => {
list.map(u => { list.map(u => {
if(id==u.id) if(id==u.id)
{ {
names=u.name+"-"+names names=u.name+"/"+names
if (u.parent_Id>0) { if (u.parent_Id>0) {
getDepartAllName(list, u.parent_Id) getDepartAllName(list, u.parent_Id)
} }
......
...@@ -71,6 +71,11 @@ export default { ...@@ -71,6 +71,11 @@ export default {
aId: 0, aId: 0,
rowData: null, rowData: null,
columns: [{ columns: [{
key: "name",
title: this.l("name"),
align: "left",
},
{
key: "parent_Id", key: "parent_Id",
title: this.l("parent_Id"), title: this.l("parent_Id"),
align: "left", align: "left",
...@@ -83,11 +88,6 @@ export default { ...@@ -83,11 +88,6 @@ export default {
) )
} }
}, },
{
key: "name",
title: this.l("name"),
align: "left",
},
{ {
key: "code", key: "code",
title: this.l("code"), title: this.l("code"),
...@@ -101,7 +101,7 @@ export default { ...@@ -101,7 +101,7 @@ export default {
import: true, import: true,
render: (h, params) => { render: (h, params) => {
return h("span", {}, 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 { ...@@ -277,7 +277,7 @@ export default {
}) })
}, },
//根据value获取当前cityname //根据value获取当前cityname
getCity(val) { getCityName(val) {
let cities = this.$u.clone(this.cityDatas) let cities = this.$u.clone(this.cityDatas)
let label = ""; let label = "";
cities.forEach(ele => { cities.forEach(ele => {
...@@ -287,12 +287,32 @@ export default { ...@@ -287,12 +287,32 @@ export default {
}) })
return label 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) { getParentDepart(val) {
let departList = this.$u.clone(this.treeList) let departList = this.$u.clone(this.treeList)
return this.$u.getDepartAllName(departList, val) 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() { ok() {
this.init(); this.init();
this.modal = false; this.modal = false;
...@@ -340,7 +360,7 @@ export default { ...@@ -340,7 +360,7 @@ export default {
); );
}); });
tempCol1.forEach((ele1) => { tempCol1.forEach((ele1) => {
e[ele1.key] = this.getCity(e[ele1.key]); e[ele1.key] = this.getCityName(e[ele1.key]);
}); });
tempCol2.forEach((ele2) => { tempCol2.forEach((ele2) => {
e[ele2.key] = this.getParentDepart(e[ele2.key]); e[ele2.key] = this.getParentDepart(e[ele2.key]);
...@@ -374,12 +394,12 @@ export default { ...@@ -374,12 +394,12 @@ export default {
let tempList = []; let tempList = [];
tempData.forEach((ele) => { tempData.forEach((ele) => {
let obj = { let obj = {
parentTitle: ele.parentTitle ? ele.parentTitle : '', parentTitle: ele.parent_Id ? ele.parent_Id : '',
name: ele.name ? ele.name : '', //部门名称 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 : '', //部门编号 code: ele.code ? ele.code : '', //部门编号
location: ele.location ? ele.location : '', //省市县 location: ele.location ? this.getCityValue(ele.location) : '', //省市县
isProduction: 1, //是否生产班组:1是,0否 isProduction: 0, //是否生产班组:1是,0否
property: ele.property ? ele.property : '' //属性 property: ele.property ? ele.property : '' //属性
}; };
if (ele.name && ele.name != '') { 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