<!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 type="text/javascript">
|
function loadJsCss(callback) {
|
var jscss_urls = [
|
{id: "css_m1", type: "css", url: "root/css/tree.css"},
|
{id: "css_m2", type: "css", url: "root/module/config/css/approval_img.css"},
|
];
|
window.top.initJsCss(document, jscss_urls, callback);
|
};
|
|
function initVue() {
|
new TreeVue({
|
el: "#vbody",
|
data: {
|
dataname: "sys_state_board",
|
title: "节点人员",
|
tree_title: "审批组",
|
treeTxtFormatter: "{name}",
|
isTreeReadonly: true,
|
dataRequest: [],
|
selectednode: {},
|
initTreeData_d: [
|
{id: "C0", name: "商业审批",
|
children: [
|
{id: "C1", name: "商业创建审批", dataname: "md_org_data", filtertxt: "state_code='UnderApproval' and state_detail_code='UnderMasterApproval'", orderby: "update_time desc", pageurl: "module/md/page/customer/page/customer_edit.html"},
|
{id: "C2", name: "商业开户商务审批", dataname: "md_org_account", filtertxt: "state_code='WaitOpen' and state_detail_code in ('BusinessApproval')", orderby: "update_time desc", pageurl: "module/md/page/customer/page/customer_acct.html"},
|
{id: "C4", name: "商业开户财务审批", dataname: "md_org_account", filtertxt: "state_code='WaitOpen' and state_detail_code='FinancialApproval'", orderby: "update_time desc", pageurl: "module/md/page/customer/page/customer_acct.html"},
|
{id: "C5", name: "商业开户QA审批", dataname: "md_org_account", filtertxt: "state_code='WaitOpen' and state_detail_code='QualityAssuranceApproval'", orderby: "update_time desc", pageurl: "module/md/page/customer/page/customer_acct.html"},
|
{id: "C8", name: "商业开户审批", dataname: "md_org_account", filtertxt: "state_code='UnderApproval' and state_detail_code='UnderOpenApproval'", orderby: "update_time desc", pageurl: "module/md/page/customer/page/customer_acct.html"},
|
{id: "C3", name: "商业变更审批", dataname: "md_org_account", filtertxt: "state_code='UnderApproval' and state_detail_code='UnderChangeApproval'", orderby: "update_time desc"},
|
{id: "C7", name: "商业关户审批", dataname: "md_org_account", filtertxt: "state_code='UnderApproval' and state_detail_code='UnderCloseApproval'", orderby: "update_time desc", pageurl: "module/md/page/customer/page/customer_close.html"},
|
]
|
},
|
{id: "H0", name: "医院审批",
|
children: [
|
{id: "H2", name: "医院库变更审批", dataname: "md_terminal", filtertxt: "state_code='UnderApproval'", orderby: "update_time desc", pageurl: "module/md/page/terminal/page/hospital_list_warehouse_info.html"},
|
]
|
},
|
{id: "O0", name: "订单审批",
|
children: [
|
{id: "O1", name: "普通订单审批", dataname: "general_sales_order", filtertxt: "state_code='UnderApproval' and type_code = '30-01'", orderby: "update_time desc", pageurl: "module/order/page/porder_general_info.html"},
|
{id: "O2", name: "直销订单审批", dataname: "direct_sales_order", filtertxt: "state_code='UnderApproval' and type_code in ('30-04', '30-Cxx-03')", orderby: "update_time desc", pageurl: "module/order/page/direct_order_list_info.html"},
|
{id: "O3", name: "折扣订单审批", dataname: "discount_order", filtertxt: "state_code='UnderApproval' and type_code in ('30-Cxx-01', '30-Cxx-02', '30-Cxx-04')", orderby: "update_time desc", pageurl: "module/order/page/discount_order_list_info.html"},
|
]
|
},
|
{id: "I0", name: "库存审批",
|
children: [
|
{id: "I1", name: "库存调整审批", dataname: "wm_alter", filtertxt: "state_code='UnderApproval'", orderby: "update_time desc", pageurl: "module/inventory/page/adjustment_edit.html"},
|
]
|
},
|
],
|
dataname_p: "md_product",
|
pagesize_p: 10,
|
pagenum_p: 1,
|
total_p: 0,
|
tableData_p: [
|
],
|
tableFields_p: [
|
{isshow: "T", field: "number", name: "节点顺序", align: "center",width: "100"},
|
{isshow: "T", field: "node_name", name: "节点名称", align: "center", width: "150", isminwidth: true},
|
{isshow: "T", field: "state_name", name: "对应状态名称", align: "center", width: "150", isminwidth: true},
|
{isshow: "T", field: "", name: "动作", children: [
|
{isshow: "T", field: "approve_node", name: "通过后节点", width: "120", isminwidth: true},
|
{isshow: "T", field: "reject_node", name: "拒绝后节点", width: "120", isminwidth: true},
|
]},
|
],
|
isRefresh_p: true,
|
tableHeight_p: 100,
|
|
tableFields_s_p: [
|
{isshow: "T", field: "writer_name", name: "审批人", align: "center",width: "150", isminwidth: true},
|
],
|
tableData_s_p: [],
|
tablefieldClick: {},
|
isTreeRefresh: true,
|
isshowflow: false,
|
selectedrow: {},
|
|
},
|
created() {
|
let clientHeight = document.documentElement.clientHeight;
|
this.treeHeight = clientHeight - 120;
|
var dataRequest_ = {
|
name: "sys_state_board",
|
dataname: "sys_state_board",
|
filter: "type='ListStep'",
|
// paramsobj: {
|
// dataname: "sys_state_board",
|
// },
|
// url: "root/workflow/getOutline",
|
isnotoption: true,
|
}
|
this.tableHeight_p = this.treeHeight - 10;
|
this.dataRequest.push(dataRequest_);
|
},
|
|
mounted() {
|
var me = this;
|
//预加载数据
|
if (this.dataRequest && this.dataRequest.length) {
|
var result = {};
|
this.loadRequestData(this.dataRequest, result, function(data) {
|
console.log("预加载数据:", data);
|
me.dataRequestObj = data;
|
let md_approval_ = ArrayToTree(clone(data.sys_state_board), "name", "parent_id");
|
me.initTreeData_d = md_approval_;
|
|
var medataRequest_ = []
|
me.initData();
|
// 以服务的方式调用的 Loading 需要异步关闭
|
me.$nextTick(() => {
|
hideLoading();
|
});
|
});
|
}
|
else {
|
this.initData(); // 以服务的方式调用的 Loading 需要异步关闭
|
this.$nextTick(() => {
|
hideLoading();
|
});
|
}
|
},
|
|
methods:{
|
initData() {
|
var me = this;
|
me.treeData = me.initTreeData_d;
|
},
|
|
onNodeClick(obj) {
|
this.tableData_p = [];
|
this.isshowflow = true;
|
var data = obj.data, node = obj.node, el = obj.el;
|
var val = data.name;
|
if (data.children && data.children.length) {
|
val = "";
|
data.children.map(r=>{
|
if (val == "") {
|
val = r.name;
|
}
|
else {
|
val += "','" + r.name;
|
}
|
})
|
}
|
|
this.selectednode = data;
|
this.pagenum_p = 1;
|
if (this.selectednode.id) {
|
this.getBoardUser(this.selectednode);
|
}
|
},
|
|
|
onTableDataAfter() {
|
|
},
|
|
tableFieldClick() {
|
var me = this;
|
|
//表格字段事件设置
|
this.tablefieldClick = {
|
|
};
|
},
|
|
getBoard() {
|
var me = this;
|
this.selectedrow = {}
|
this.selectednode = {}
|
|
var param_ = {
|
dataname: "sys_state_board",
|
filter: "type='ListStep'",
|
}
|
Server.call("root/data/getEntitySet", param_, function(result) {
|
if (result) {
|
var sys_state_board_ = result.data.entityset;
|
let md_approval_ = ArrayToTree(clone(sys_state_board_), "name", "parent_id");
|
me.initTreeData_d = md_approval_;
|
me.initData();
|
}
|
})
|
},
|
|
getBoardUser(row) {
|
var me = this;
|
this.selectedrow = {}
|
var param_ = {
|
dataname: "sys_state_board_user",
|
filter: " board_id='"+row.id+"' ",
|
}
|
Server.call("root/data/getEntitySet", param_, function(result) {
|
if (result) {
|
var tableData_s_p_ = clone(me.tableData_s_p);
|
tableData_s_p_ = result.data.entityset;
|
me.tableData_s_p = tableData_s_p_;
|
}
|
})
|
},
|
|
addGroup() {
|
var me = this;
|
var config = {
|
totab: false, //true: 以Tab导航的方式打开
|
width: "500px",
|
height: "190px",
|
icon: "icon-product",
|
text: "审批组新增",
|
id: "popup_board_edit",//totab: true时需设置,用于判断是否已打开此页面
|
url: "module/config/page/popup/popup_board_edit.html",
|
data: {},
|
delta: {},
|
sceneCode: "add",
|
callback: function(obj, callback) {
|
me.getBoard();
|
if (callback) {
|
callback();
|
}
|
}
|
};
|
me.doPopupByPublic(config);
|
},
|
|
editGroup() {
|
var me = this;
|
var row = this.selectednode;
|
if (!row || !row.id) {
|
Root.message({
|
type: 'warning',
|
message: '请选择要编辑的数据'
|
});
|
return
|
}
|
var config = {
|
totab: false, //true: 以Tab导航的方式打开
|
width: "500px",
|
height: "190px",
|
icon: "icon-product",
|
text: "页面权限修改",
|
id: "popup_board_edit",//totab: true时需设置,用于判断是否已打开此页面
|
url: "module/config/page/popup/popup_board_edit.html",
|
data: row,
|
delta: {},
|
sceneCode: "edit",//"refuseedit",//"approval", //"add"//"browse",
|
callback: function(obj, callback) {
|
me.getBoard();
|
if (callback) {
|
callback();
|
}
|
}
|
};
|
me.doPopupByPublic(config);
|
},
|
delGroup() {
|
let me = this;
|
let row = this.selectednode;
|
let name_ = "该数据";
|
|
Root.confirm('确定删除审批组【' + row.name + '】吗?', '删除提示', {
|
confirmButtonText: '删除',
|
cancelButtonText: '取消',
|
type: 'warning'
|
}).then(() => {
|
let param = {
|
dataname: "sys_state_board",
|
id: row.id,
|
}
|
Server.call("root/data/deleteEntity", param, function(result) {
|
// Server.call("root/workflow/deleteOneBoard", param, function(result) {
|
console.log(result);
|
Root.message({
|
type: 'success',
|
message: '删除成功!'
|
});
|
me.getBoard();
|
});
|
}).catch(() => {
|
Root.message({
|
type: 'info',
|
message: '已取消删除'
|
});
|
});
|
},
|
|
rowClick(obj) {
|
var me = this;
|
this.selectedrow = obj.row;
|
},
|
// 用户,md_employee
|
addGroupUser() {
|
var me = this;
|
var filter_temp = "";
|
Root.showPopup({
|
url: "module/config/page/user_list.html",
|
width: 800,
|
height: 550,
|
filter: "employee_id is not null and is_active='T'",
|
callback: function(obj, callback) {
|
var row = {
|
id: uuid_short(),
|
board_id: me.selectednode.id,
|
writer_name: obj.row.remark,
|
user_id: obj.row.id
|
}
|
if (callback) {
|
callback();
|
}
|
me.saveGroupUser(row, function() {
|
me.getBoardUser(me.selectednode);
|
});
|
}
|
});
|
},
|
delGroupUser() {
|
let me = this;
|
let row = this.selectedrow;
|
|
Root.confirm('确定删除' + this.selectednode.name + '中的【' + row.writer_name + '】吗?', '删除提示', {
|
confirmButtonText: '删除',
|
cancelButtonText: '取消',
|
type: 'warning'
|
}).then(() => {
|
let param = {
|
dataname: "sys_state_board_user",
|
id: row.id,
|
}
|
// Server.call("root/data/deleteEntity", param, function(result) {
|
Server.call("root/approve/deleteOneBoardUser", param, function(result) {
|
console.log(result);
|
Root.message({
|
type: 'success',
|
message: '删除成功!'
|
});
|
me.getBoardUser(me.selectednode);
|
});
|
}).catch(() => {
|
Root.message({
|
type: 'info',
|
message: '已取消删除'
|
});
|
});
|
},
|
|
saveGroupUser(row, callback) {
|
var me = this;
|
let param = {
|
dataname: "sys_state_board_user",
|
data: {
|
sys_state_board_user: row
|
},
|
}
|
|
// Server.call("root/data/saveEntity", param, function(result) {
|
Server.call("root/approve/saveOneBoardUser", param, function(result) {
|
console.log(result);
|
if (result.success) {
|
callback();
|
}
|
});
|
},
|
|
|
|
}
|
});
|
};
|
|
loadJsCss(function () {
|
initVue();
|
});
|
</script>
|
<style>
|
/* 在vue.js中 v-cloak 这个指令是防止页面加载时出现 vuejs 的变量名而设计的 */
|
[v-cloak] {
|
display: none !important;
|
}
|
.el-tabs__nav-scroll {
|
overflow: hidden;
|
position: relative;
|
padding-left: 20px;
|
}
|
|
.nodeLabel {
|
max-width: 200px !important;
|
}
|
</style>
|
|
</head>
|
|
<body style="margin: 0px;">
|
<div v-cloak id="vbody">
|
<div id="page_root">
|
<div class="topbar">
|
<span>{{title}}</span>
|
|
<div style="float: right; margin-right: 18px;">
|
<el-button-group style="margin-left: 3px;">
|
</el-button-group>
|
</div>
|
</div>
|
|
<div class="h_dialog__body">
|
<div style="position: absolute;left: 10px; top:45px;width: 320px; bottom: 10px;border: 1px solid #ccc;">
|
<div style="height: 32px; border-bottom: 1px solid #ccc;display: flex;justify-content: space-between;align-items: center;">
|
<div class="table_title" style="line-height: 32px;">
|
<span>{{tree_title}}</span>
|
</div>
|
<!-- <div style="margin-right: 5px">
|
<el-button-group style="margin-left: 3px">
|
<el-button @click="addGroup" :icon="buttonsconfig.add.icon">{{buttonsconfig.add.name}}</el-button>
|
<el-button @click="editGroup" :disabled="!(selectednode && selectednode.id)" :icon="buttonsconfig.alter.icon">{{buttonsconfig.alter.name}}</el-button>
|
<el-button @click="delGroup" :disabled="!(selectednode && selectednode.id)" type="danger" :icon="buttonsconfig.delete.icon">{{buttonsconfig.delete.name}}</el-button>
|
</el-button-group>
|
</div> -->
|
</div>
|
<div :style="{padding: '10px 0', height: treeHeight + 'px', overflow: 'auto'}">
|
<h-tree v-if="isTreeRefresh"
|
:tree-data="treeData"
|
:tree-txt-formatter="treeTxtFormatter"
|
:is-readonly="isTreeReadonly"
|
:default-expanded-keys="defaultexpandedkeys"
|
:currentnodekey="currentnodekey"
|
:default-expand-all="true"
|
|
@node-click="onNodeClick"
|
>
|
</h-tree>
|
|
</div>
|
</div>
|
<div style="position: absolute;left: 340px; top:45px; right: 10px; bottom: 10px;border: 1px solid #ccc;">
|
<div>
|
<div style="height: 32px; border-bottom: 1px solid #ccc;display: flex;justify-content: space-between;align-items: center;">
|
<div class="table_title" style="line-height: 32px;">
|
<span>组成员</span>
|
</div>
|
<div style="margin-right: 5px">
|
<el-button-group style="margin-left: 3px">
|
<el-button @click="addGroupUser" :icon="buttonsconfig.add.icon">{{buttonsconfig.add.name}}</el-button>
|
<el-button @click="delGroupUser" :disabled="!(selectedrow && selectedrow.id)" type="danger" :icon="buttonsconfig.delete.icon">{{buttonsconfig.delete.name}}</el-button>
|
</el-button-group>
|
</div>
|
</div>
|
<div :style="{height: (tableHeight_p) + 'px'}">
|
<h-table
|
v-if="isshowflow"
|
ref="table_p"
|
:table-fields="tableFields_s_p"
|
:table-data="tableData_s_p"
|
:table-height="tableHeight_p"
|
:is-highlight-row="true"
|
:table-field-click="tablefieldClick"
|
:is-pagination="false"
|
|
:isdraggableorder="false"
|
:isbasicfilterfields="false"
|
:isfilterfield="false"
|
:istablebuttons="false"
|
|
|
v-on:row-click="rowClick"
|
>
|
</h-table>
|
</div>
|
</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>
|
|
</body>
|
</html>
|