<!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">
|
var pageVue = null;
|
function loadJsCss(callback) {
|
var jscss_urls = [];
|
window.top.initJsCss(document, jscss_urls, callback);
|
};
|
|
function initVue() {
|
new ListVue({
|
el: "#vbody",
|
data: {
|
dataname: "",
|
isRefresh: true,
|
pagesize: 10,
|
pagenum: 1,
|
total: 0,
|
|
title: "列表",
|
codeAndOrg: "",
|
|
tableAttr: {},
|
tableFields: [
|
{isshow: "T", field: "node_name", name: "节点名称", align: "left", iscellclick: true, clickContext: {type: "popup", width: 900, url: "../order/sorder/img.html", sceneCode: "browse", delta: null}},
|
{isshow: "T", field: "user_name", name: "审批人", width: "150"},
|
{isshow: "T", field: "reason", name: "审批意见", width: "200", align: "left"},
|
{isshow: "T", field: "end_time", name: "审批时间", formatter: "formatter_dateH", width: "150"},
|
],
|
tableFieldsObj: {},
|
|
selectedrow: {},
|
|
tableData: [],
|
tableHeight1: 430,
|
selectcusrow: {},
|
|
formInline_gh: {},
|
popupParames: {},
|
|
//查询功能
|
filterFields:[],
|
filterFieldsObj: {},
|
filterObj: {},
|
filterList:[],
|
filterAttr: {
|
columnnumber: 3,
|
labelwidth: "90px",
|
labelposition: "right",
|
size: "medium",
|
border: "0px solid #c6c6c600"
|
},
|
hideForm: false,
|
|
userId: "",
|
taskId: "",
|
adName: "",
|
|
formData: {},
|
tablefieldClick: {},
|
},
|
created() {
|
this.userId = localStorage.getItem("id");
|
this.adName = localStorage.getItem("ad_name");
|
this.popupParames = clone(Root.popupParames);
|
},
|
|
mounted() {
|
if (Root.popupParames.data) {
|
this.formData = clone(Root.popupParames.data);
|
|
this.codeAndOrg = this.formData.code ? this.formData.code : ""
|
if (!this.formData.code && this.formData.doc_code) {
|
this.codeAndOrg = this.formData.doc_code
|
}
|
if (this.formData.customer_name) {
|
this.codeAndOrg += "-" + this.formData.customer_name
|
}
|
else if (this.formData.supplyer_name) {
|
this.codeAndOrg += "-" + this.formData.supplyer_name
|
}
|
else if (this.formData.org_name) {
|
this.codeAndOrg += "-" + this.formData.org_name
|
}
|
}
|
if (this.popupParames.sceneCode) {}
|
|
this.$nextTick(() => { // 以服务的方式调用的 Loading 需要异步关闭
|
document.getElementById('page_root').style.display = "block";
|
document.getElementById('page_loading').style.display = "none";
|
|
//重新设置弹窗宽高
|
this.$nextTick(function(){
|
let w_ = this.$refs.popup_body.offsetWidth + "px";
|
let h_ = this.$refs.popup_body.offsetHeight + "px";
|
Root.setPopupWH(w_, h_);
|
})
|
});
|
this.getList();
|
},
|
|
methods:{
|
// 初始字段
|
onServerInitData(data) {
|
var me = this.data;
|
|
if(me.tableFields.length > 0) {
|
for(var i=0; i < me.tableFields.length; i++) {
|
let fieldObj_ = me.tableFields[i];
|
|
me.tableFieldsObj[fieldObj_.field] = fieldObj_;
|
}
|
}
|
|
},
|
// 查询审批历史
|
getList() {
|
let me = this;
|
//按键
|
|
var params = {
|
flowId: this.popupParames.data.flow_id,
|
orderby: "end_time desc"
|
}
|
|
Server.call("root/workFlow/getHistoryTask", params, function(result) {
|
console.log(result);
|
if (result && result.data && result.data.entityset) {
|
let data = result.data.entityset
|
|
for (let i = 0; i < data.length; i++) {
|
if (!data[data.length-1].user_name) {
|
me.getUserName();
|
}
|
}
|
|
me.tableData = result.data.entityset
|
}
|
});
|
},
|
|
getUserName() {
|
let me = this
|
|
var params = {
|
dataname: "flowNodeEmpAndName",
|
filter: " flow_id = '" + this.formData.flow_id + "'"
|
}
|
|
Server.call("root/data/getEntitySet", params, function(result) {
|
if (result && result.data && result.data.entityset && result.data.entityset.length > 0) {
|
let user_name_str = "";
|
result.data.entityset.map(e => {
|
if (!user_name_str) {
|
if (e.raw_employee_name) {
|
user_name_str = e.employee_name + "," + e.raw_employee_name
|
}
|
else {
|
user_name_str = e.employee_name
|
}
|
}
|
else {
|
if (e.raw_employee_name) {
|
user_name_str += "," + e.employee_name + "," + e.raw_employee_name
|
}
|
else {
|
user_name_str += "," + e.employee_name
|
}
|
}
|
})
|
|
let arr = user_name_str.split(",")
|
|
for (let i = 0; i < arr.length; i++) {
|
for (let j = i+1; j < arr.length; j++) {
|
if (arr[i] == arr[j]) {
|
arr.splice(j, 1)
|
j--
|
}
|
}
|
}
|
|
let resultStr = ""
|
arr.map(e => {
|
if (!resultStr) {
|
resultStr = e
|
}
|
else {
|
resultStr += "," + e
|
}
|
})
|
|
let tableData = clone(me.tableData)
|
|
for (let i = 0; i < tableData.length; i++) {
|
if (!tableData[tableData.length-1].user_name) {
|
tableData[tableData.length-1].user_name = resultStr
|
}
|
}
|
|
me.tableData = clone(tableData)
|
}
|
});
|
},
|
|
// 退回指定节点
|
approvalBack() {
|
var me = this;
|
|
this.$prompt('请输入评论', '提示', {
|
confirmButtonText: '确定',
|
cancelButtonText: '取消',
|
}).then(({ value }) => {
|
let comment = ""
|
if (value) {
|
comment += value
|
}
|
let type = "salesOrder"
|
if (this.formData && this.formData.doc_type && this.formData.doc_type == "electrophy") {
|
type = "cmp_complaint_2300"
|
}
|
if (this.formData && this.formData.doc_type && this.formData.doc_type == "ort") {
|
type = "cmp_complaint"
|
}
|
if (this.formData && this.formData.doc_type && this.formData.doc_type == "heart") {
|
type = "cmp_complaint_2400"
|
}
|
if (this.formData && this.formData.doc_type && this.formData.doc_type == "theurgy") {
|
type = "cmp_complaint_2600"
|
}
|
var params1 = {
|
isClientMode: false,
|
type: type,
|
business_id: this.popupParames.data.id,
|
back_flow: {
|
current_user_id: this.adName,
|
target_task_key: this.selectedrow.taskKey,
|
task_id: this.taskId,
|
comment: comment
|
}
|
}
|
|
Server.call("root/flowable/back", params1, function(result) {
|
console.log(result);
|
me.getList();
|
});
|
}).catch(() => {
|
this.$message({
|
type: 'info',
|
message: '取消输入'
|
});
|
});
|
},
|
// 关闭页面
|
closeDialog() {
|
Root.hidePopup();
|
},
|
// 关闭页面 执行回调
|
saveAfter() {
|
var me = this;
|
if(this.popupParames.callback) {
|
let obj = {
|
//row: this.formData
|
}
|
this.popupParames.callback(obj, function() {
|
me.closeDialog();
|
});
|
}
|
else {
|
me.closeDialog();
|
}
|
},
|
|
// 行点击
|
rowClick(event) {
|
this.selectedrow = event.row;
|
},
|
// 单元格点击
|
onCellClick(config, obj) {
|
this.selectrow = obj.row;
|
let me = this;
|
var clickContext = this.selectCellField.clickContext;
|
if(this.selectCellField.field == "taskName" ){
|
config.combine({
|
url: clickContext.url,
|
sceneCode: clickContext.sceneCode,
|
data: me.popupParames.data,
|
delta: clickContext.delta ? clickContext.delta : {},
|
width: clickContext.width,
|
height: clickContext.height,
|
})
|
}
|
return true;
|
},
|
close: function() {
|
Root.hidePopup();
|
},
|
getData: function(page) {
|
this.pagesize = page.pagesize;
|
this.pagenum = page.pagenum;
|
this.doQuery();
|
},
|
|
//表单
|
showPopup(obj) {
|
this.selectFormField = obj.obj;
|
this.popupByFieldsDialog = true;
|
},
|
}
|
});
|
}
|
|
loadJsCss(function () {
|
initVue();
|
});
|
</script>
|
</head>
|
|
<body>
|
<div id="vbody">
|
<div id="page_root">
|
<div ref="popup_body" style="padding-right: 20px;">
|
<div class="el-dialog__header" style="margin-left: 1em;">
|
<div class="dialog-title">
|
<span><i class="iconfont icon-shuxian"></i>{{ title }} </span>
|
</div>
|
</div>
|
<div style="height: 550px; overflow-y: auto;">
|
<div v-if="!popupParames.data.flow_id" style="margin-top: 1em; margin-left: 2em; font-size: 18px;">当前无流程节点!</div>
|
|
<div v-else class="el-dialog__body">
|
<h-table
|
v-if="isRefresh"
|
ref="table1"
|
:table-fields="tableFields"
|
:table-data="tableData"
|
:pagesize="pagesize"
|
:pagenum="pagenum"
|
:total="total"
|
:table-height="tableHeight1"
|
:is-highlight-row="true"
|
:table-field-click="tablefieldClick"
|
|
v-on:get-data="getData"
|
v-on:row-click="rowClick"
|
v-on:cell-click="cellClick"
|
>
|
</h-table>
|
</div>
|
</div>
|
<div class="el-dialog__footer">
|
<!-- <el-button v-if="(!formData.activeName) || formData.activeName !== 'Finished'" :disabled="!selectedrow.endTime" @click="approvalBack">回退到此节点</el-button> -->
|
<el-button type="default" @click="saveAfter">取 消</el-button>
|
</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>
|
.el-collapse {
|
border: 0;
|
}
|
.el-collapse-item__content {
|
padding-bottom: 5px;
|
}
|
.el-collapse-item__header {
|
height: 30px;
|
line-height: 30px;
|
}
|
.el-collapse-item__header.is-active {
|
border-bottom-color: #e9f5f2;
|
}
|
.el-collapse-item__wrap {
|
border: 0;
|
}
|
.h_seal {
|
color: red;
|
font-weight: bold;
|
font-size: 14px;
|
border: 3px solid red;
|
border-radius: 50%;
|
padding: 5px;
|
height: 50px;
|
line-height: 50px;
|
width: 50px;
|
|
position: absolute;
|
top:30px;
|
right: 150px;
|
z-index: 1000;
|
transform:rotate(-45deg);
|
-ms-transform:rotate(-45deg);
|
-moz-transform:rotate(-45deg);
|
-webkit-transform:rotate(-45deg);
|
-o-transform:rotate(-45deg);
|
}
|
|
.code-and-org {
|
display: inline-block;
|
font-size: 16px !important;
|
color: #042A72;
|
font-weight: bold;
|
font-family: 微软雅黑;
|
}
|
</style>
|
</body>
|
</html>
|