<!doctype html>
|
<html>
|
<head>
|
<meta charset="utf-8"><meta http-equiv="Expires" content="0"><meta http-equiv="Pragma" content="no-cache"><meta http-equiv="Cache-control" content="no-cache"><meta http-equiv="Cache" content="no-cache">
|
<title>商务辖区</title>
|
<script src="../../../js/vue/vue.js"></script>
|
<script src="../../../js/vue/element-ui/lib/index.js"></script>
|
<script src="../../../js/myelement.js?v=20220615"></script>
|
<script src="../../../js/vue/page.js?v=20220615"></script>
|
<script src="../setting.js"></script>
|
|
<link href="../../../js/vue/element-ui/lib/theme-chalk/index.css" rel="stylesheet">
|
<link href="../../../css/myelement.css?v=20220425" rel="stylesheet">
|
<link href="../../../css/iconfont.css" rel="stylesheet">
|
<link href="../../../css/page.css?v=20220425" rel="stylesheet">
|
<link href="//at.alicdn.com/t/font_2374495_13ltsxm2eor.css" rel="stylesheet">
|
</head>
|
|
<body style="margin: 10px;">
|
<div id="vbody">
|
<div id="page_root">
|
<div class="total-container">
|
<div class="left-container" style="height: 90vh;">
|
<div style="height: 32px; border-bottom: 1px solid #E4E7ED;">
|
<div style="float: left; line-height: 32px;">
|
<span style="font-size: 14px;margin-left: 20px;">{{title}}</span>
|
</div>
|
<div style="float: right; margin: 10px;">
|
<el-button-group>
|
</el-button-group>
|
<el-button-group style="margin-left: 3px; ">
|
</el-button-group>
|
</div>
|
</div>
|
<div style=" padding: 20px;">
|
<el-input
|
placeholder="输入搜索字"
|
v-model="filterText">
|
</el-input>
|
</div>
|
<div :style="{height: tableHeight2 - 68 +'px', padding: '0px 20px 20px 20px', 'box-sizing': 'border-box'}">
|
<div style="height: 70vh; min-width: 180px; overflow: auto; font-size: 14px">
|
<!-- <el-tree
|
ref="tree"
|
node-key="id"
|
default-expand-all
|
highlight-current
|
:props="defaultProps"
|
:data="treeData"
|
:default-expanded-keys="defaultExpandedKeys"
|
:filter-node-method="filterNode"
|
@node-click="clickNode"
|
>
|
</el-tree> -->
|
<el-tree
|
ref="tree"
|
:data="treeData"
|
node-key="id"
|
default-expand-all
|
:expand-on-click-node="false"
|
:filter-node-method="filterNode"
|
@node-click="clickNode"
|
>
|
<span class="custom-tree-node" slot-scope="{ node, data }">
|
<!-- 如果是编辑状态 -->
|
<template v-if="data.isEdit==1">
|
<el-input ref="input"
|
@blur="() => submitEdit(node,data)"
|
v-model="newName"
|
style="height:20px line-height:20px">
|
</el-input>
|
</template>
|
<!-- 如果不是编辑状态 -->
|
<span v-else
|
v-text="data.name">
|
</span>
|
<span>
|
<!-- <el-button v-if="data.id!=1"
|
type="text"
|
size="mini"
|
@click="() => edit(node,data)">
|
修改
|
</el-button> -->
|
<el-button type="text"
|
size="mini"
|
@click="append(node,data)">
|
增加
|
</el-button>
|
<el-button v-if="data.id!=1"
|
type="text"
|
size="mini"
|
@click="remove(node, data)">
|
删除
|
</el-button>
|
</span>
|
</span>
|
</el-tree>
|
</div>
|
</div>
|
</div>
|
|
<div style="width: 68%; height: 90vh; float: right; border: 1px solid #E4E7ED">
|
<div style="height: 32px; border-bottom: 1px solid #E4E7ED;">
|
<div style="float: left; width: 100%;">
|
<el-tabs v-model="activeName" style="width: 100%;">
|
<!-- 按钮 -->
|
<el-button v-if="activeName == 'basicInformation'" icon="el-icon-check" style="float: right; margin: 1em" @click="savePositionInfo">保存</el-button>
|
|
<el-tab-pane label="岗位信息" name="basicInformation">
|
<div style="padding: 1em; padding-right: 2em; overflow: auto;">
|
<h-form
|
ref="form2"
|
:form-attr="formAttr"
|
:table-fields="formFields"
|
:form-data="formData"
|
|
v-on:select-change="selectChange"
|
>
|
</h-form>
|
</div>
|
</el-tab-pane>
|
<el-tab-pane label="辖区商业" name="jurisdictionBusiness">
|
<div style="width: 100%;">
|
<div class="topbar-line">
|
<div class="query-icon">
|
<i class="iconfont icon-query"></i>
|
</div>
|
<div class="query-bar">
|
<h-form-filter
|
ref="form1"
|
:form-attr="filterAttr"
|
:table-fields="filterFields"
|
:form-data="filterObj"
|
|
v-on:show-popup="showFilterPopup"
|
v-on:on-query="getCustomerList"
|
v-on:on-init-query="onInitFilter"
|
>
|
</h-form-filter>
|
</div>
|
</div>
|
|
<h-table
|
:table-fields="tableFields"
|
:table-data="tableData"
|
:is-edit-table-data="isEditTableData"
|
:pagenum="pagenum"
|
:total="total"
|
:table-height="380"
|
:is-highlight-row="true"
|
:is-pagination="true"
|
|
v-on:get-data="getData"
|
>
|
</h-table>
|
</div>
|
</el-tab-pane>
|
</el-tabs>
|
</div>
|
</div>
|
</div>
|
</div>
|
</div>
|
|
<div id="page_loading" style="position: absolute; top:0px; width: 100vw; height: 100vh;">
|
<div class="spinner">
|
<div class="cube1"></div>
|
<div class="cube2"></div>
|
</div>
|
</div>
|
</div>
|
|
<script type="text/javascript">
|
var setting = getSetting("territory_list");
|
var initlized = false;
|
let id = 1000;
|
let me;
|
new ListVue({
|
el: "#vbody",
|
data: {
|
dataname: "md_hierarchy_business",
|
|
title: "商务辖区",
|
|
page: setting.page,
|
buttons: setting.buttons,
|
|
tableData_employee:[],
|
tableHeight2: 400,
|
isEditData:false,
|
isEditTreeData: false,
|
|
selectFormField:{},
|
|
formAttr: {
|
istitle: false,
|
disabled: false,
|
title: "辖区节点",
|
columnnumber: 1,
|
labelwidth: "100px",
|
labelposition: "right",
|
align: "left",
|
border: "10px solid #c6c6c600"
|
},
|
|
filterAttr: {
|
columnnumber: 2,
|
labelwidth: "130px",
|
labelposition: "right",
|
size: "medium",
|
border: "0px solid #c6c6c600",
|
},
|
|
treeFields: [],
|
|
formFields: [
|
{field: "code", name: "岗位编码", isshow: "T", required: true},
|
{field: "name", name: "岗位名称", isshow: "T", required: true},
|
{field: "employee", name: "岗位员工", isshow: "T", type: "select", ismultiple: true, isrefresh: true, isfilterable: true, options: [], props:{value: "md_code", label: "md_description", checkStrictly: true}},
|
{field: "type_code", name: "岗位情况", isshow: "T", type: "select", options: [
|
{label: "正常岗位", value: "Normal"},
|
{label: "代岗", value: "Agent"},
|
{label: "空岗", value: "Absent"}
|
], required: true},
|
{field: "province", name: "所属省份", isshow: "T", type: "select", ismultiple: true, isrefresh: true, isfilterable: true, options: [], required: true},
|
],
|
formData: {},
|
|
filterFields: [
|
{isshow: "T", field: "position", name: "辖区", disabled: true},
|
{isshow: "T", field: "province", name: "省份", type: "select", fieldtype: "in", options: []},
|
{isshow: "T", field: "md_description", name: "商业", type: "popup"},
|
],
|
|
tableFields: [
|
{isshow: "T", field: "province_name", name: "省份", align: "center", width: "100"},
|
{isshow: "T", field: "md_code", name: "商业编码", type: "popup", align: "center", width: "100"},
|
{isshow: "T", field: "md_description", name: "商业名称", align: "left"},
|
{isshow: "T", field: "business_type", name: "商业属性", align: "center", width: "100", formatter: "formatter_businessType"},
|
{isshow: "T", field: "delivery_part_name", name: "发货主体", align: "left"},
|
],
|
|
tableData: [],
|
|
activeName: "basicInformation",
|
|
istree: false,
|
treeDataObj: {},
|
treeCodeDataObj: {},
|
treeData: [],
|
postTreeData: {},
|
defaultExpandedKeys: [],
|
defaultProps: {
|
children: 'children',
|
label: 'name',
|
},
|
|
filterText: '',
|
|
pagesize: 10,
|
pagenum: 1,
|
total: 0,
|
|
newName: ""
|
},
|
created() {
|
me = this;
|
},
|
|
mounted() {
|
me.initData();
|
this.getProvinceOptions();
|
this.getEmployeeOptions();
|
this.$nextTick(() => { // 以服务的方式调用的 Loading 需要异步关闭
|
hideLoading();
|
});
|
},
|
watch: {
|
filterText(val) {
|
this.$refs.tree.filter(val);
|
},
|
},
|
methods:{
|
append(node, data) {
|
let timestamp = new Date().getTime()
|
let newChild = {
|
id: timestamp,
|
isEdit: 0,
|
name: 'T' + timestamp,
|
children: []
|
}
|
if (!data.children) {
|
this.$set(data, 'children', [])
|
}
|
data.children.push(newChild)
|
//this.updateApiGroup(this.data)
|
},
|
|
remove(node, data) {
|
Root.confirm('确定删除 [ ' + data.name + ' ] 吗?', '删除提示', {
|
confirmButtonText: '删除',
|
cancelButtonText: '取消',
|
type: 'warning'
|
}).then(() => {
|
let param = {
|
isClientMode: false,
|
dataname: "md_position_new",
|
id: data.id,
|
}
|
Server.call("root/data/deleteEntity", param, function(result) {
|
console.log(result);
|
Root.message({
|
type: 'success',
|
message: '删除成功!'
|
});
|
|
let parent = node.parent
|
let children = parent.data.children || parent.data
|
let index = children.findIndex(d => d.id === data.id)
|
children.splice(index, 1)
|
});
|
}).catch(() => {
|
|
});
|
},
|
|
edit(node, data) {
|
console.log(
|
'before:',
|
data.id,
|
// data.parentApiGroupId,
|
data.name,
|
data.isEdit
|
)
|
this.$set(data, 'isEdit', 1)
|
this.newName = data.name
|
this.$nextTick(() => {
|
this.$refs.input.focus()
|
})
|
console.log('after:', data.id, data.name, data.isEdit)
|
},
|
|
submitEdit(node, data) {
|
// console.log('点击了保存按钮')
|
if (data.name == this.newName) {
|
console.log('没有修改')
|
this.newName = ''
|
this.$set(data, 'isEdit', 0)
|
} else {
|
this.$set(data, 'name', this.newName)
|
this.newName = ''
|
this.$set(data, 'isEdit', 0)
|
// console.log('after:', data.id, data.apiGroupName)
|
// console.log(this.data)
|
// this.updateApiGroup(this.data)
|
}
|
},
|
|
onServerInitData(data) {
|
var me = this.data;
|
|
},
|
getDataByVersion() {
|
var me = this;
|
|
//获取该版本的数据this.versionObj;
|
this.getTreeData()
|
},
|
|
getData: function(page) {
|
this.pagesize = page.pagesize;
|
this.pagenum = page.pagenum;
|
this.getCustomerList();
|
},
|
|
selectChange(obj){
|
let me = this
|
|
if(obj.fieldobj.field == "type_code") {
|
let formFields = clone(me.formFields)
|
|
if (obj.data.type_code == "Absent") {
|
me.$set(me.formData, "employee", [])
|
formFields.map(e => {
|
if (e.field == "employee") {
|
e.disabled = true
|
}
|
})
|
}
|
else {
|
formFields.map(e => {
|
if (e.field == "employee") {
|
e.disabled = false
|
}
|
})
|
}
|
|
me.formFields = formFields
|
}
|
},
|
|
// node filter
|
filterNode(value, data) {
|
if (!value) return true;
|
return data.name.indexOf(value) !== -1;
|
},
|
|
// init data
|
initData() {
|
if (initlized) { return; }
|
initlized = true;
|
|
this.getTreeData();
|
},
|
|
// get tree data
|
getTreeData(type) {
|
let params = {
|
dataname: this.dataname,
|
}
|
|
Server.call("root/popedom/showTree", params, function(result) {
|
console.log(result)
|
|
if (!result || !result.data || !result.data.entityset) {
|
return
|
}
|
|
let data = result.data.entityset
|
|
let defualtClickNodeId;
|
|
let arr = []
|
arr.push(data)
|
|
if (arr.length > 0) {
|
me.treeData = arr.map(e => me.setTreeData(e))
|
|
defualtClickNodeId = me.defualtClickNodeId(me.treeData)
|
}
|
|
me.treeData = arr
|
|
if (type && type == "save") {
|
defualtClickNodeId = me.selectNode.data.id
|
|
me.clickNode(me.selectNode.data, me.selectNode.node, me.selectNode.tree)
|
}
|
else {
|
//me.clickNode({id: defualtClickNodeId}, {isLeaf: true})
|
}
|
|
me.$nextTick(() => {
|
me.$refs.tree.setCurrentKey(defualtClickNodeId)
|
})
|
})
|
},
|
|
// 重设树label值
|
setTreeData(e) {
|
let haveChildren = Array.isArray(e.children) && e.children.length > 0
|
|
let type_name = e.type_name && e.type_name != "正常岗位" ? " (" + e.type_name + ")" : ""
|
|
e.name = e.name + type_name
|
e.children = haveChildren? e.children.map(i => this.setTreeData(i)) : []
|
|
return e
|
},
|
|
// get 默认选中节点id
|
defualtClickNodeId(treeData) {
|
let defualtClickNodeId = ""
|
|
let forFn = function (arr) {
|
if (arr && arr.length > 0) {
|
defualtClickNodeId = arr[0].id
|
|
if (arr[0].children) {
|
forFn(arr[0].children)
|
}
|
}
|
}
|
forFn(treeData)
|
|
return defualtClickNodeId
|
},
|
|
// 查询省份
|
getProvinceOptions(callbcak) {
|
let params = {
|
dataname: "division",
|
orderby: "name",
|
filter: "level = 1"
|
}
|
|
Server.call("root/data/getEntitySet", params, function(result) {
|
console.log(result)
|
|
if (!result || !result.data || !result.data.entityset) {
|
return
|
}
|
|
let data = result.data.entityset
|
|
me.allProvince = data
|
|
let options = []
|
data.map(e => {
|
let list = {}
|
list.label = e.province_name
|
list.value = e.province_code
|
options.push(list)
|
})
|
|
let formFields = clone(me.formFields)
|
formFields.map(e => {
|
if (e.field == "province") {
|
e.options = options
|
}
|
})
|
me.formFields = clone(formFields)
|
|
if (callbcak) {
|
callbcak(data)
|
}
|
})
|
},
|
|
// 查询员工
|
getEmployeeOptions(callbcak) {
|
let params = {
|
dataname: "vemployee",
|
}
|
|
Server.call("root/data/getEntitySet", params, function(result) {
|
console.log(result)
|
|
if (!result || !result.data || !result.data.entityset) {
|
return
|
}
|
|
let data = result.data.entityset
|
|
let formFields = clone(me.formFields)
|
formFields.map(e => {
|
if (e.field == "employee") {
|
e.options = data
|
}
|
})
|
me.formFields = clone(formFields)
|
|
me.allEmployee = data
|
|
if (callbcak) {
|
callbcak(data)
|
}
|
})
|
},
|
|
// 树节点点击
|
clickNode(data, node, tree) {
|
this.filterObj.province = ""
|
this.filterObj.code = ""
|
this.filterObj.name = ""
|
if (node && node.parent && node.parent.data && node.parent.data.id) {
|
this.newNodeParentId = node.parent.data.id
|
}
|
this.newNodeId = data.id
|
|
let formFields = clone(this.formFields)
|
if (node.isLeaf) {
|
formFields.map(e => {
|
if (e.field == "province") {
|
e.disabled = false
|
}
|
})
|
}
|
else {
|
formFields.map(e => {
|
if (e.field == "province") {
|
e.disabled = true
|
}
|
})
|
}
|
|
this.formFields = clone(formFields)
|
|
this.selectNode = {
|
data: data,
|
node: node,
|
tree, tree
|
};
|
|
this.getEmployeeInfo(data, node, tree);
|
},
|
|
// 获取岗位信息
|
getEmployeeInfo(data, node, tree) {
|
let parames = {
|
dataname: this.dataname,
|
id: data.id
|
}
|
Server.call("root/popedom/showTreeInfo", parames, function(result) {
|
console.log(result);
|
if (!result || !result.data) {
|
return
|
}
|
|
me.businessInfo = result.data.md_hierarchy_business
|
me.employeeInfo = result.data.md_position_employee
|
me.provinceInfo = result.data.md_position_province
|
|
let formData = clone(me.formData)
|
let filterObj = clone(me.filterObj)
|
|
formData = {}
|
|
if (me.businessInfo) {
|
formData.code = me.businessInfo.code
|
formData.name = me.businessInfo.name
|
formData.type_code = me.businessInfo.type_code
|
formData.type_name = me.businessInfo.type_name
|
|
filterObj.position = me.businessInfo.name
|
}
|
|
let formFields = clone(me.formFields)
|
if (!me.employeeInfo || me.employeeInfo.length == 0) {
|
formData.employee = []
|
|
formFields.map(e => {
|
if (e.field == "employee") {
|
if ((me.businessInfo && me.businessInfo.type_code && me.businessInfo.type_code == "Absent")) {
|
e.disabled = true
|
}
|
else {
|
e.disabled = false
|
}
|
}
|
})
|
}
|
else {
|
let employee_ = []
|
if (me.employeeInfo && me.employeeInfo.length > 0) {
|
me.employeeInfo.map(e => {
|
employee_.push(e.md_code)
|
})
|
|
formData.employee = employee_
|
}
|
else {
|
formData.employee = []
|
}
|
|
formFields.map(e => {
|
if (e.field == "employee") {
|
e.disabled = false
|
}
|
})
|
}
|
me.formFields = formFields
|
|
let arr = []
|
let arr2 = []
|
if (me.provinceInfo && me.provinceInfo.length > 0) {
|
me.provinceInfo.map(e => {
|
arr.push(e.province)
|
|
let list = {}
|
list.label = e.name
|
list.value = e.province
|
arr2.push(list)
|
})
|
|
formData.province = arr
|
}
|
else {
|
formData.province = []
|
}
|
|
let filterFields = clone(me.filterFields)
|
filterFields.map(e => {
|
if (e.field == "province") {
|
e.options = arr2
|
}
|
})
|
me.filterFields = filterFields
|
|
me.formData = formData
|
me.filterObj = filterObj
|
|
me.getCustomerList();
|
});
|
},
|
|
// 获取查询经销商列表filter
|
getQueryCustomerFilter() {
|
let filterStr = ""
|
if (me.formData.province && me.formData.province.length > 0) {
|
me.formData.province.map(e => {
|
if (!filterStr) {
|
filterStr = "'" + e + "'"
|
}
|
else {
|
filterStr += ",'" + e + "'"
|
}
|
})
|
}
|
|
if (filterStr) {
|
return "1=1 and province in (" + filterStr + ")"
|
}
|
else if (me.formData.name && me.formData.name == "全国") {
|
return "1=1"
|
}
|
else {
|
return null
|
}
|
},
|
|
// 获取经销商列表
|
getCustomerList() {
|
let filter = me.getQueryCustomerFilter()
|
|
if (!filter) {
|
me.tableData = []
|
|
return
|
}
|
|
if (me.filterObj.province) {
|
filter += " and province = '" + me.filterObj.province + "'"
|
}
|
if (me.filterObj.md_description) {
|
filter += " and md_description = '" + me.filterObj.md_description + "'"
|
}
|
|
let parames = {
|
dataname: "v_agreement_customer_delivery",
|
filter: filter,
|
page: {
|
no: this.pagenum,
|
pagesize: this.pagesize
|
},
|
}
|
Server.call("root/data/getEntitySet", parames, function(result) {
|
console.log(result);
|
me.total = 0;
|
if (!result || !result.data || !result.data.entityset) {
|
return
|
}
|
me.total = result.data.page.recordcount;
|
me.tableData = result.data.entityset
|
});
|
},
|
|
// 清空经销商列表查询条件
|
onInitFilter: function() {
|
this.filterObj.province = ""
|
this.filterObj.md_description = ""
|
this.filterObj.name = ""
|
this.getCustomerList()
|
},
|
|
onshowFilterPopup(filter) {
|
var me = this;
|
var fieldObj_ = filter.obj;
|
var filterValue = clone(me.filterObj);
|
var field_ = fieldObj_.field;
|
|
if (field_ == "md_description") {
|
let filter = me.getQueryCustomerFilter() + " and "
|
|
Root.showPopup({
|
url: "../md/customer/popup/customer_list.html",
|
delta: {filter: filter},
|
width: 800,
|
height: 550,
|
callback: function(result, callback) {
|
filterValue[field_] = result.row.md_description;
|
if (fieldObj_.valfield) {
|
filterValue[fieldObj_.valfield] = result.row.md_code;
|
}
|
me.filterObj = filterValue;
|
if (callback) {
|
callback();
|
}
|
}
|
});
|
}
|
},
|
|
// 弹出经销商选择页面
|
openCustomerList(obj) {
|
let filter = me.getQueryCustomerFilter()
|
|
var config = {
|
totab: false,
|
width: "900px",
|
height: "600px",
|
icon: "icon-product",
|
text: "经销商列表",
|
id: "test_page",
|
url: "../md/customer/popup/customer_list.html",
|
data: me.formData,
|
delta: {},
|
filter: filter,
|
sceneCode: "add",
|
callback: function(obj, callback) {
|
me.$set(me.filterObj, "code", obj.row.code);
|
me.$set(me.filterObj, "name", obj.row.code + "-" + obj.row.name);
|
if (callback) {
|
callback();
|
}
|
}
|
};
|
|
me.doPopupByPublic(config);
|
},
|
|
// 弹出产品列表页面
|
openProductList(obj) {
|
var config = {
|
totab: false,
|
width: "900px",
|
height: "650px",
|
icon: "icon-product",
|
text: "产品列表",
|
id: "test_page",
|
url: "module/md/page/framework/page/popup_product_list.html",
|
data: me.formData,
|
delta: {},
|
filter: "",
|
sceneCode: "browse",
|
callback: function(obj, callback) {
|
if (callback) {
|
callback();
|
}
|
}
|
};
|
|
me.doPopupByPublic(config);
|
},
|
|
// 保存岗位信息
|
savePositionInfo() {
|
let checkResult = this.$refs.form2.checkForm()
|
if (!checkResult) {
|
Root.message({
|
type: "warning",
|
message: "请填写必填项",
|
showClose: true
|
})
|
|
return
|
}
|
|
let province_ = ""
|
if (this.formData.province && this.formData.province.length > 0) {
|
this.formData.province.map(e => {
|
if (!province_) {
|
province_ = e
|
}
|
else {
|
province_ += "、" + e
|
}
|
})
|
}
|
|
if (this.formData.type_code == "Absent") {
|
this.formData.type_name = "空岗"
|
}
|
else if (this.formData.type_code == "Agent") {
|
this.formData.type_name = "代岗"
|
}
|
else if (this.formData.type_code == "Normal") {
|
this.formData.type_name = "正常岗位"
|
}
|
|
let department_id = null
|
let org_id = null
|
let id = null
|
|
if (this.businessInfo && this.businessInfo.department_id) {
|
department_id = this.businessInfo.department_id
|
}
|
if (this.businessInfo && this.businessInfo.org_id) {
|
org_id = this.businessInfo.org_id
|
}
|
if (this.businessInfo && this.businessInfo.id) {
|
id = this.businessInfo.id
|
}
|
// 基本信息
|
let md_hierarchy_business = {
|
code: this.formData.code,
|
department_id: department_id,
|
id: id,
|
name: this.formData.name,
|
org_id: id,
|
type_code: this.formData.type_code,
|
type_name: this.formData.type_name,
|
remark: province_
|
}
|
|
if (!id) {
|
md_hierarchy_business.id = this.newNodeId
|
md_hierarchy_business.parent_id = this.newNodeParentId
|
}
|
|
// 员工信息
|
let md_position_employee = []
|
|
let allEmployee = []
|
me.formFields.map(e => {
|
if (e.field == "employee") {
|
allEmployee = e.options
|
}
|
})
|
|
if (me.formData.employee && me.formData.employee.length > 0) {
|
me.formData.employee.map(e => {
|
allEmployee.map(s => {
|
if (e == s.md_code) {
|
s.employee_id = s.md_code
|
s.remark = s.md_description
|
s.position_id = md_hierarchy_business.id
|
md_position_employee.push(s)
|
}
|
})
|
})
|
}
|
|
|
if (this.formData.employee.length == 0) {
|
md_hierarchy_business.type_code = "Absent"
|
md_hierarchy_business.type_name = "空岗"
|
}
|
|
// 省份信息
|
let md_position_province = []
|
|
if (me.formData.province && me.formData.province.length > 0) {
|
me.formData.province.map(e => {
|
me.allProvince.map(s => {
|
if (e == s.province_code) {
|
s.province = s.province_code
|
s.remark = s.province_name
|
s.position_id = md_hierarchy_business.id
|
md_position_province.push(s)
|
}
|
})
|
})
|
}
|
|
let params = {
|
md_hierarchy_business: md_hierarchy_business,
|
md_position_employee: md_position_employee,
|
md_position_province: md_position_province
|
}
|
|
Server.call("root/popedom/savePosition", params, function(result) {
|
console.log(result);
|
|
Root.message({
|
type: "success",
|
message: "保存成功",
|
showClose: true
|
})
|
|
me.getTreeData("save")
|
});
|
},
|
}
|
});
|
</script>
|
<style>
|
/deep/ .el-input__inner {
|
height: 15px;
|
}
|
|
.total-container {
|
width: 100%;
|
height: 100%;
|
padding: 0px;
|
box-sizing: border-box;
|
}
|
.left-container {
|
width: 31%;
|
float: left;
|
border: 1px solid #E4E7ED;
|
}
|
[v-cloak] {
|
display: none !important;
|
}
|
.el-dialog__body{
|
border-top: 1px solid #E4E7ED;
|
border-bottom: 1px solid #E4E7ED;
|
padding: 20px;
|
}
|
.custom-tree-node {
|
flex: 1;
|
display: flex;
|
align-items: center;
|
justify-content: space-between;
|
font-size: 14px;
|
padding-right: 8px;
|
}
|
.el-tabs__nav {
|
margin-left: 2.5em;
|
}
|
|
.el-tag + .el-tag {
|
margin-left: 10px;
|
}
|
.button-new-tag {
|
margin-left: 10px;
|
height: 32px;
|
line-height: 30px;
|
padding-top: 0;
|
padding-bottom: 0;
|
}
|
.input-new-tag {
|
width: 90px;
|
margin-left: 10px;
|
vertical-align: bottom;
|
}
|
.el-tabs__nav-scroll {
|
height: 33px;
|
}
|
</style>
|
</body>
|
</html>
|