<!doctype html>
|
<html>
|
<head>
|
<meta charset="utf-8">
|
<title>商务辖区</title>
|
|
<script type="text/javascript">
|
let me;
|
|
var pageVue = null;
|
function loadJsCss(callback) {
|
var jscss_urls = []
|
|
window.top.initJsCss(document, jscss_urls, callback);
|
};
|
var initlized = false;
|
let id = 1000;
|
|
function initVue() {
|
new ListVue({
|
el: "#vbody",
|
data: {
|
versionObj: {//版本信息
|
//dataname: 数据对象
|
//codeid: 唯一码
|
//versionno: 版本号
|
//isactive: 是否激活
|
//status: input草稿、active激活、locked封版
|
},
|
dataname: "md_hierarchy_business",
|
title: "商务辖区",
|
dataRequest: [
|
{
|
name: "md_employee",
|
//url: "root/front/getOneDictionary",
|
//paramsobj: { code: "OrgType", },
|
filter: "",
|
orderby: "name",
|
isnotoption: false, //true:不是选项
|
code:"id",//是下拉选项时设置
|
label:"name",//是下拉选项时设置
|
},
|
],
|
dataRequestObj: {},
|
tableHeight2: 400,
|
|
formAttr: {
|
istitle: false,
|
disabled: false,
|
title: "辖区节点",
|
columnnumber: 1,
|
labelwidth: "100px",
|
labelposition: "right",
|
align: "left",
|
border: "10px solid #c6c6c600"
|
},
|
|
filterAttr: {
|
columnnumber: 2,
|
labelwidth: "70px",
|
labelposition: "right",
|
size: "medium",
|
border: "3px solid #c6c6c600"
|
},
|
|
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: "id", label: "name", 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},
|
{field: "city", name: "所属城市", isshow: "T", type: "select", ismultiple: true, isrefresh: true, isfilterable: true, options: [],},
|
],
|
formData: {},
|
|
treeData: [],
|
defaultExpandedKeys: [],
|
defaultProps: {
|
children: 'children',
|
label: 'name',
|
},
|
filterText: '',
|
selectNode: {},
|
|
filterFields: [
|
{isshow: "T", field: "position", name: "辖区", disabled: true},
|
{isshow: "T", field: "province", name: "省份", type: "select", fieldtype: "in", options: []},
|
// {isshow: "T", field: "name", name: "经销商", type: "popup"},
|
],
|
|
tableFields: [
|
{isshow: "T", field: "province", name: "省份", align: "center", width: "150"},
|
{isshow: "T", field: "city", name: "城市", align: "center", width: "150"},
|
{isshow: "T", field: "code", name: "经销商编码", type: "popup", align: "center", width: "150"},
|
{isshow: "T", field: "name", name: "经销商名称", align: "left", width: "200", isminwidth: true},
|
{isshow: "T", field: "product", name: "授权产品", align: "center",},
|
{isshow: "T", field: "customer_target", name: "商业指标", align: "center",},
|
],
|
|
// tableData: [
|
// {"province": "重庆市", "city": "重庆市", "code": "CH01024G", "name": "重庆鹏泰医药有限公司"},
|
// ],
|
|
activeName: "basicInformation",
|
|
formfieldClick: {},
|
filterfieldClick: {},
|
|
businessInfo: {},
|
employeeInfo: [],
|
provinceInfo: [],
|
|
allEmployee: []
|
},
|
|
created() {
|
me = this
|
var url = window.location.href;
|
this.urlParam = getGetParamsByUrl(url);
|
if (this.urlParam && this.urlParam.status && this.urlParam.status == "locked") {
|
me.versionObj.status = "locked"
|
me.formAttr.disabled = true
|
let formFields = clone(me.formFields)
|
formFields.map(e => {
|
if (e.field == "type_code" && (e.disabled == false || !e.disabled)) {
|
e.disabled = true
|
}
|
})
|
|
me.formFields = formFields
|
}
|
if (this.urlParam && this.urlParam.height) {
|
this.tableHeight2 = this.urlParam.height * 1 - 100;
|
console.log(me.urlParam.height);
|
}
|
|
this.fieldsToFieldsObj();
|
this.tableFieldClick();
|
},
|
mounted() {
|
var me = this;
|
//预加载数据
|
if (this.dataRequest.length) {
|
var result = {};
|
this.loadRequestData(this.dataRequest, result, function(data) {
|
me.dataRequestObj = data;
|
//预加载数据后给哪些字段设置options或formatterjson
|
if (me.formFields.length) {
|
var formFields_ = clone(me.formFields);
|
formFields_.map(e=>{
|
if(e.field == "employee") {
|
e.options = me.dataRequestObj.md_employee;
|
}
|
});
|
|
me.formFields = formFields_;
|
}
|
|
me.initData();
|
me.initmessage();
|
me.$nextTick(() => {
|
hideLoading();
|
});
|
});
|
}
|
else {
|
this.initData();
|
this.initmessage();
|
this.$nextTick(() => {
|
hideLoading();
|
});
|
}
|
},
|
watch: {
|
filterText(val) {
|
this.$refs.tree.filter(val);
|
},
|
versionObj(newVal, oldVal){
|
this.getDataByVersion();
|
},
|
},
|
methods:{
|
initmessage() {
|
window.addEventListener('message', function (e) { // 监听 message 事件
|
if (window.top.config.url_page.indexOf(e.origin) == -1) { // 验证消息来源地址。这个地址是父页面的地址
|
return;
|
}
|
console.log(e.data)
|
me.versionObj = e.data;
|
me.filterText = "";
|
//根据状态设置是否可编辑
|
let formFields = clone(me.formFields)
|
if (me.versionObj.status == "locked") {//封版状态不可编辑
|
me.formAttr.disabled = true
|
|
formFields.map(e => {
|
if (e.field == "type_code" && (e.disabled == false || !e.disabled)) {
|
e.disabled = true
|
}
|
})
|
}
|
else {
|
me.formAttr.disabled = false
|
|
formFields.map(e => {
|
if (e.field == "type_code") {
|
e.disabled = false
|
}
|
})
|
}
|
me.formFields = formFields
|
|
me.initData();
|
});
|
},
|
getDataByVersion() {
|
var me = this;
|
|
//获取该版本的数据this.versionObj;
|
this.getTreeData()
|
},
|
// set field function
|
tableFieldClick() {
|
//表单字段事件设置
|
this.formfieldClick = {
|
province: {
|
visible: {
|
onchange: function(fieldObj, row, callback) {
|
//设置选择项
|
me.getProvinceOptions(function(result) {
|
if (callback) {
|
let options = []
|
result.map(e => {
|
let list = {}
|
list.code = e.province
|
list.value = e.province
|
options.push(list)
|
})
|
|
var obj_ = {
|
options: options
|
};
|
|
callback(obj_);
|
}
|
});
|
}
|
},
|
|
select: {
|
onchange: function(obj){
|
var formData_ = clone(me.formData);
|
var formFields_ = clone(me.formFields);
|
|
if(formData_.province.length == 1){
|
let param_ = {
|
isClientMode: false,
|
dataname: "md_city",
|
filter:[
|
{"field": "province", "value":formData_.province[0]}
|
]
|
}
|
Server.call("root/data/getEntitySet", param_, function(result) {
|
if (result && result.data) {
|
var options_ = result.data.entityset;
|
for(var i=0; i<options_.length;i++) {
|
options_[i].code = options_[i].name;
|
options_[i].value = options_[i].name;
|
}
|
formFields_.map(e=>{
|
if(e.field == "city") {
|
e.options = options_;
|
}
|
})
|
}
|
me.formFields = formFields_;
|
});
|
}
|
|
else {
|
var formFields_ = clone(me.formFields);
|
var formData_ = clone(me.formData);
|
|
formFields_.map(e=>{
|
if(e.field == "city") {
|
e.options = [];
|
}
|
})
|
|
formData_.city = [];
|
|
me.formFields = formFields_;
|
me.formData = formData_;
|
}
|
}
|
}
|
},
|
|
city: {
|
visible: {
|
onchange: function(obj) {//下拉展开事件
|
var formData_ = clone(me.formData);
|
var formFields_ = clone(me.formFields);
|
|
if(formData_.province.length == 1){
|
let param_ = {
|
isClientMode: false,
|
dataname: "md_city",
|
filter:[
|
{"field": "province", "value":formData_.province[0]}
|
]
|
}
|
Server.call("root/data/getEntitySet", param_, function(result) {
|
if (result && result.data) {
|
var options_ = result.data.entityset;
|
for(var i=0; i<options_.length;i++) {
|
options_[i].code = options_[i].name;
|
options_[i].value = options_[i].name;
|
}
|
formFields_.map(e=>{
|
if(e.field == "city") {
|
e.options = options_;
|
}
|
})
|
}
|
me.formFields = formFields_;
|
});
|
}
|
|
else {
|
var formFields_ = clone(me.formFields);
|
var formData_ = clone(me.formData);
|
|
formFields_.map(e=>{
|
if(e.field == "city") {
|
e.options = [];
|
}
|
})
|
|
formData_.city = [];
|
|
me.formFields = formFields_;
|
me.formData = formData_;
|
}
|
},
|
},
|
},
|
|
// employee: {
|
// visible: {
|
// onchange: function(fieldObj, row, callback) {
|
// //设置选择项
|
// me.getEmployeeOptions(function(result) {
|
// if (callback) {
|
// let options = []
|
// result.map(e => {
|
// let list = {}
|
// list.label = e.name
|
// list.value = e.name
|
// options.push(list)
|
// })
|
|
// var obj_ = {
|
// options: options
|
// };
|
|
// callback(obj_);
|
// }
|
// });
|
// }
|
// },
|
// },
|
type_code: {
|
select: {
|
onchange: function(obj) {
|
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" && me.versionObj.status != "locked") {
|
e.disabled = false
|
}
|
})
|
}
|
|
me.formFields = formFields
|
}
|
}
|
}
|
};
|
|
//筛选字段事件设置
|
this.filterfieldClick = {
|
name: {//字段事件设置
|
popup: {
|
onclick: function(obj) {//弹窗点击事件
|
me.openCustomerList()
|
}
|
}
|
}
|
};
|
|
this.tablefieldClick = {
|
product: {//字段事件设置
|
defaultval: {
|
val: "查看产品",//空值时的显示值
|
onclick: function(obj) {//默认值点击事件,此事件需要设置val才有效
|
me.openProductList(obj);
|
}
|
},
|
},
|
|
customer_target: {//字段事件设置
|
defaultval: {
|
val: "查看指标",//空值时的显示值
|
onclick: function(obj) {//默认值点击事件,此事件需要设置val才有效
|
me.openCustomerTarget(obj);
|
}
|
},
|
},
|
};
|
},
|
|
// node filter
|
filterNode(value, data) {
|
if (!value) return true;
|
return data.name.indexOf(value) !== -1;
|
},
|
|
// init data
|
initData() {
|
if (initlized) { return; }
|
initlized = true;
|
|
//字段数组转字段obj,目的为了筛选时获取字段属性
|
// me.fieldsToFieldsObj();
|
|
//设置字段事件
|
// me.tableFieldClick();
|
|
this.getTreeData();
|
},
|
|
// get tree data
|
getTreeData(type) {
|
let params = {
|
dataname: this.dataname,
|
}
|
|
Server.call("root/data/getEntitySet", params, function(result) {
|
console.log(result)
|
|
if (!result || !result.data || !result.data.entityset) {
|
return
|
}
|
|
let data = result.data.entityset;
|
|
console.log(data);
|
|
let defualtClickNodeId;
|
|
if (data.length > 0) {
|
// me.treeData = data.map(e => me.setTreeData(e))
|
me.treeData = ArrayToTree(clone(data), "name", "parent_id");
|
defualtClickNodeId = me.defualtClickNodeId(me.treeData)
|
}
|
|
// me.treeData = data
|
me.treeData = ArrayToTree(clone(data), "name", "parent_id");
|
|
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: "md_province",
|
orderby: "name"
|
}
|
|
Server.call("root/data/getEntitySet", params, function(result) {
|
console.log(result)
|
|
if (!result || !result.data || !result.data.entityset) {
|
return
|
}
|
|
let data = result.data.entityset
|
|
if (callbcak) {
|
callbcak(data)
|
}
|
})
|
},
|
|
// 查询员工
|
getEmployeeOptions(callbcak) {
|
let params = {
|
dataname: "md_employee",
|
orderby: "name"
|
}
|
|
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.allEmployee = data
|
|
if (callbcak) {
|
callbcak(data)
|
}
|
})
|
},
|
|
// 树节点点击
|
clickNode(data, node, tree) {
|
this.filterObj.province = ""
|
this.filterObj.code = ""
|
this.filterObj.name = ""
|
|
let formFields = clone(this.formFields)
|
if (node.isLeaf && this.versionObj.status != "locked") {
|
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/data/getEntity", 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)
|
|
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.type_code && me.businessInfo.type_code == "Absent") || me.versionObj.status == "locked") {
|
e.disabled = true
|
}
|
else {
|
e.disabled = false
|
}
|
}
|
})
|
}
|
else {
|
let employee_ = []
|
if (me.employeeInfo && me.employeeInfo.length > 0) {
|
me.employeeInfo.map(e => {
|
employee_.push(e.employee_id)
|
})
|
|
formData.employee = employee_
|
}
|
else {
|
formData.employee = []
|
}
|
|
formFields.map(e => {
|
if (e.field == "employee") {
|
if (me.versionObj.status != "locked") {
|
e.disabled = false
|
}
|
else {
|
e.disabled = true
|
}
|
}
|
})
|
}
|
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.code = e.province
|
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 " 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.code) {
|
filter += " and code = '" + me.filterObj.code + "'"
|
}
|
|
let parames = {
|
dataname: "md_org_customer",
|
filter: filter
|
}
|
Server.call("root/data/getEntitySet", parames, function(result) {
|
console.log(result);
|
if (!result || !result.data || !result.data.entityset) {
|
return
|
}
|
|
me.tableData = result.data.entityset
|
});
|
},
|
|
// 清空经销商列表查询条件
|
onInitFilter: function() {
|
this.filterObj.province = ""
|
this.filterObj.code = ""
|
this.filterObj.name = ""
|
this.getCustomerList()
|
},
|
|
// 弹出经销商选择页面
|
openCustomerList(obj) {
|
let filter = me.getQueryCustomerFilter()
|
|
var config = {
|
totab: false,
|
width: "900px",
|
height: "600px",
|
icon: "icon-product",
|
text: "经销商列表",
|
id: "test_page",
|
url: "module/md/page/framework/page/popup_customer_list.html",
|
data: me.formData,
|
delta: {},
|
filter: filter + "and state_code = 'Open'",
|
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);
|
},
|
|
//弹出商业指标页面
|
openCustomerTarget(obj){
|
console.log(obj);
|
var config = {
|
totab: false,
|
width: "900px",
|
height: "650px",
|
icon: "icon-product",
|
text: "指标信息",
|
id: "test_page",
|
url: "module/md/page/framework/page/popup_customer_target_list.html",
|
data: me.formData,
|
delta: {},
|
filter: "customer_code = '" + obj.row.code + "'" ,
|
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 md_hierarchy_business = {
|
code: this.formData.code,
|
department_id: this.businessInfo.department_id,
|
id: this.businessInfo.id,
|
name: this.formData.name,
|
org_id: this.businessInfo.org_id,
|
type_code: this.formData.type_code,
|
type_name: this.formData.type_name,
|
remark: province_
|
}
|
|
// 员工信息
|
let md_position_employee = this.setPositionEmployeeInfo(province_)
|
|
if (this.formData.employee.length == 0) {
|
md_hierarchy_business.type_code = "Absent"
|
md_hierarchy_business.type_name = "空岗"
|
}
|
|
// 省份信息
|
let md_position_province = this.setPositionProvinceInfo()
|
|
let params = {
|
dataname: this.dataname,
|
data: {
|
md_hierarchy_business: md_hierarchy_business,
|
md_position_employee: md_position_employee,
|
md_position_province: md_position_province
|
}
|
}
|
|
Server.call("root/data/saveEntity", params, function(result) {
|
console.log(result);
|
|
Root.message({
|
type: "success",
|
message: "保存成功",
|
showClose: true
|
})
|
|
me.getTreeData("save")
|
});
|
},
|
|
// 设置岗位员工信息
|
setPositionEmployeeInfo(province_) {
|
let md_position_employee = []
|
|
if (this.employeeInfo.length == 0) {
|
if (this.formData.employee.length > 0) {
|
this.formData.employee.map(e => {
|
let list = {}
|
list.position_id = this.businessInfo.id
|
list.org_id = this.businessInfo.org_id
|
list.department_id = this.businessInfo.department_id
|
list.employee_id = e
|
list.remark = province_
|
|
md_position_employee.push(list)
|
})
|
}
|
}
|
else if (this.formData.employee.length == 0) {
|
if (this.employeeInfo.length > 0) {
|
this.employeeInfo.map(e => {
|
let list = {}
|
list.id = e.id
|
list._operator = "delete"
|
|
md_position_employee.push(list)
|
})
|
}
|
}
|
else {
|
this.employeeInfo.map(e => {
|
let list = {}
|
let find = false
|
this.formData.employee.map(s => {
|
if (e.employee_id == s) {
|
find = true
|
}
|
})
|
|
if (!find) {
|
list.id = e.id
|
list._operator = "delete"
|
|
md_position_employee.push(list)
|
}
|
})
|
|
this.formData.employee.map(e => {
|
let list = {}
|
let find = false
|
this.employeeInfo.map(s => {
|
if (e == s.employee_id) {
|
find = true
|
}
|
})
|
|
if (!find) {
|
let list = {}
|
list.position_id = this.businessInfo.id
|
list.org_id = this.businessInfo.org_id
|
list.department_id = this.businessInfo.department_id
|
list.employee_id = e
|
list.remark = province_
|
|
md_position_employee.push(list)
|
}
|
})
|
}
|
|
// if (md_position_employee.length > 0) {
|
// md_position_employee.map(e => {
|
// this.allEmployee.map(s => {
|
// if (e.employee_id == s.id) {
|
// e.employee_id = s.id
|
// }
|
// })
|
// })
|
// }
|
|
return md_position_employee
|
},
|
|
// 设置岗位省份信息
|
setPositionProvinceInfo() {
|
let md_position_province = []
|
|
if (this.provinceInfo.length == 0) {
|
if (this.formData.province.length > 0) {
|
this.formData.province.map(e => {
|
let list = {}
|
list.position_id = this.businessInfo.id
|
list.org_id = this.businessInfo.org_id
|
list.department_id = this.businessInfo.department_id
|
list.province = e
|
|
md_position_province.push(list)
|
})
|
}
|
}
|
else if (this.formData.province.length == 0) {
|
if (this.provinceInfo.length > 0) {
|
this.provinceInfo.map(e => {
|
let list = {}
|
list.id = e.id
|
list._operator = "delete"
|
|
md_position_province.push(list)
|
})
|
}
|
}
|
else {
|
this.provinceInfo.map(e => {
|
let list = {}
|
let find = false
|
this.formData.province.map(s => {
|
if (e.province == s) {
|
find = true
|
}
|
})
|
|
if (!find) {
|
list.id = e.id
|
list._operator = "delete"
|
|
md_position_province.push(list)
|
}
|
})
|
|
this.formData.province.map(e => {
|
let list = {}
|
let find = false
|
this.provinceInfo.map(s => {
|
if (e == s.province) {
|
find = true
|
}
|
})
|
|
if (!find) {
|
let list = {}
|
list.position_id = this.businessInfo.id
|
list.org_id = this.businessInfo.org_id
|
list.department_id = this.businessInfo.department_id
|
list.province = e
|
|
md_position_province.push(list)
|
}
|
})
|
}
|
|
return md_position_province
|
}
|
}
|
});
|
};
|
|
loadJsCss(function () {
|
initVue();
|
});
|
</script>
|
</head>
|
|
<body style="margin: 0px;">
|
<div v-cloak id="vbody">
|
<div id="page_root">
|
<div class="total-container">
|
<div class="left-container" :style="{height: tableHeight2 + 50+'px'}">
|
<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=" position: relative; height: 52px; box-sizing: border-box;">
|
<el-input
|
placeholder="输入搜索字"
|
v-model="filterText"
|
style="position: absolute; top:10px; left: 20px; right: 80px; width: auto;">
|
</el-input>
|
<div style="position: absolute; top:10px; right: 20px;">
|
<el-button @click="filterText = ''">清空</el-button>
|
</div>
|
</div>
|
<div :style="{height: tableHeight2 - 68 +'px', padding: '0px 20px 20px 20px', 'box-sizing': 'border-box'}">
|
<div :style="{height: tableHeight2 - 80 +'px', '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>
|
</div>
|
</div>
|
</div>
|
|
<div :style="{width: '68%', height: tableHeight2 + 50+'px', 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' && versionObj.status !== 'locked'" icon="el-icon-check" style="float: right; margin: 1em" @click="savePositionInfo":icon="buttonsconfig.save.icon">{{buttonsconfig.save.name}}</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"
|
:table-field-click="formfieldClick"
|
>
|
</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"
|
:table-field-click="filterfieldClick"
|
|
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="tableHeight2 - 110"
|
:is-highlight-row="true"
|
:is-pagination="false"
|
:table-field-click="tablefieldClick"
|
|
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: 50vh;">
|
<div class="spinner">
|
<div class="cube1"></div>
|
<div class="cube2"></div>
|
</div>
|
</div>
|
</div>
|
|
<style>
|
.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-tree-node__label {
|
font-size: 12px;
|
}
|
</style>
|
</body>
|
</html>
|