<!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/vue/page.js?v=20220615"></script>
|
<script src="../../js/myelement.js?v=20220615"></script>
|
<!-- <script src="../../data/data.js?v=20220425"></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_mkoo966o0uo.css" rel="stylesheet">
|
</head>
|
|
<body>
|
<div id="vbody">
|
<div id="page_root">
|
<div class="el-dialog_header">
|
<div class="dialog-title">
|
<i class="iconfont icon-customermanagement"></i>
|
<span>审批记录</span>
|
</div>
|
</div>
|
<div ref="elbody" class="el-dialog_body" style="height: 430px;">
|
<div style="float: right; margin-right: 20px;">
|
<el-button-group>
|
<el-button :disabled="isexport_pdf" @click="export_pdf" :loading="export_loading">导出</el-button>
|
<el-button @click="onShowApproval">查看流程图</el-button>
|
<el-button type="default" @click="closeDialog">关 闭</el-button>
|
</el-button-group>
|
<!-- <el-button-group>
|
<el-button @click="closeDialog">关 闭</el-button>
|
</el-button-group> -->
|
</div>
|
<div class="versionNo">
|
<h-table
|
v-if="isRefresh"
|
ref="table1"
|
:table-fields="tableFields"
|
:table-data="tableData"
|
:table-height="tableHeight2"
|
:is-pagination="false"
|
:is-highlight-row="true"
|
v-on:row-click="rowClick"
|
v-on:cell-click="cellClick"
|
>
|
</h-table>
|
|
</div>
|
<el-input
|
type="textarea"
|
:autosize="{ minRows: 2, maxRows: 10}"
|
placeholder="请输入原因"
|
v-model="textarea2">
|
</el-input>
|
</div>
|
<div class="el-dialog_footer" style="position: absolute; bottom: 0px;text-align: right;">
|
<el-button type="default" @click="closeDialog">取 消</el-button>
|
<el-button type="primary" @click="saveReason" :loading="loading_approval">确 定</el-button>
|
</div>
|
|
</div>
|
<div id="page_loading" style="position: absolute; top:0px; width: 100vw; height: 100vh;">
|
<el-button type="default" @click="closeDialog">关 闭</el-button>
|
<div class="spinner">
|
<div class="cube1"></div>
|
<div class="cube2"></div>
|
</div>
|
</div>
|
</div>
|
|
<script type="text/javascript">
|
new ListVue({
|
el: "#vbody",
|
data: {
|
title: "",
|
pageAttr: {
|
heightType: "page"
|
},
|
|
tabaleFieldsName: "ApprovalList_",
|
isRefresh: true,
|
tableFields: [],
|
tableHeight2:350,
|
tableData: [],
|
flow_id: "",
|
textarea2:"",
|
isexport_pdf: true,
|
loading_approval:false,
|
export_loading: false,
|
},
|
created() {
|
this.popupParames = clone(Root.popupParames);
|
if(this.popupParames.delta) {
|
this.flow_id = clone(this.popupParames.delta.flow_id);
|
}
|
|
document.getElementById('page_root').classList.add("z_popup-page");
|
},
|
|
mounted() {
|
this.getApprovalList();
|
// if (this.popupParames.data) {
|
// this.tableData = this.popupParames.data.entityset
|
// };
|
|
this.$nextTick(() => { // 以服务的方式调用的 Loading 需要异步关闭
|
if(this.popupParames.hide_close) {
|
window.parent.document.getElementById('win_btn_close').style.display = "none";
|
}
|
document.getElementById('page_root').style.display = "block";
|
document.getElementById('page_loading').style.display = "none";
|
});
|
/* if (this.popupParames.disabled) {
|
//重新设置弹窗宽高
|
this.$nextTick(function(){
|
let w_ = this.$refs.popup_body.offsetWidth + "px";
|
let h_ = this.$refs.popup_body.offsetHeight + "px";
|
Root.setPopupWH(w_, h_);
|
})
|
}; */
|
},
|
|
methods:{
|
//表格
|
closeDialog() {
|
Root.hidePopup();
|
},
|
onServerInitData(data) {
|
var me = this.data;
|
|
me.tableFields = data.tableFields;
|
if(me.tableFields.length > 0) {
|
for(var i=0; i < me.tableFields.length; i++) {
|
let fieldObj_ = me.tableFields[i];
|
|
me.tableFieldsObj[fieldObj_.field] = fieldObj_;
|
}
|
}
|
},
|
|
getApprovalList() {
|
var me = this;
|
let param = {
|
isClientMode: false,
|
flowId: this.flow_id
|
}
|
this.tableData = [];
|
Server.call("root/order/getHistoryTask/", param, function(result) {
|
console.log(result);
|
if (result && result.data) {
|
me.tableData = result.data.entityset;
|
}
|
|
if(me.tableData.length) {
|
me.isexport_pdf = false
|
}
|
me.tableDataAfter();
|
});
|
|
},
|
saveReason() {
|
let me = this;
|
this.loading_approval = true;
|
if(!this.selectedrow.node_id) {
|
Root.message({
|
type:"warning",
|
message:"请选择节点"
|
})
|
this.loading_approval = false;
|
return;
|
}
|
if(!this.textarea2) {
|
Root.message({
|
type:"warning",
|
message:"请填写退回原因"
|
})
|
this.loading_approval = false;
|
return;
|
}
|
let user_code = this.tableData[this.tableData.length-1].user_code;
|
let node_id = this.tableData[this.tableData.length-1].node_id;
|
|
let code_arr = [];
|
for (var i = this.tableData.length - 2; i > 0; i--) {
|
// if(this.tableData[i].user_code && this.tableData[i].user_code != user_code) {
|
// if(code_arr.indexOf(this.tableData[i].user_code) == -1) {
|
// code_arr.push(this.tableData[i].user_code);
|
// }
|
// }else {
|
// break;
|
// }
|
|
if(this.tableData[i].node_id && this.tableData[i].node_id != node_id) {
|
if(code_arr.indexOf(this.tableData[i].node_id) == -1) {
|
code_arr.push(this.tableData[i].node_id);
|
}
|
}else {
|
break;
|
}
|
}
|
code_arr.push(node_id);
|
if(code_arr.indexOf(this.selectedrow.node_id) > -1 && code_arr.length < this.tableData.length - 1) {
|
Root.message({
|
type:"warning",
|
message:"请选择当前节点前面的节点退回"
|
})
|
this.loading_approval = false;
|
return;
|
}
|
if(this.selectedrow.node_type == "userTask" && this.selectedrow.node_id != this.tableData[this.tableData.length-1].node_id) {
|
let data = {
|
flowId: this.popupParames.delta.flow_id,
|
destinationTaskId:this.selectedrow.h_task_id,
|
reason:this.textarea2
|
}
|
if(this.popupParames.callback) {
|
this.popupParames.callback(data,me.closeDialog)
|
}else {
|
|
}
|
}else {
|
Root.message({
|
type:"warning",
|
message:"请选择其他节点"
|
})
|
this.loading_approval = false;
|
}
|
|
},
|
export_pdf() {
|
var me = this;
|
//var url = baseUrl + "api/downloadFlowRecordForPDF?flow_id="+ this.flow_id +"&userId=" + localStorage.getItem("id")+"&name=" + this.title + ";
|
//dealExportByPath(url, "发货主体及资质.xlsx");
|
let param = {
|
isClientMode: false,
|
flow_id: this.flow_id,
|
name: this.title + "审批记录"
|
}
|
this.export_loading = true;
|
Server.call("root/api/downloadFlowRecordForPDF/", param, function(result) {
|
console.log(result);
|
me.export_loading = false;
|
if (result && result.data && result.data.flieId) {
|
//me.tableData = result.data.entityset;
|
handleDownload(result.data.flieId);
|
}
|
|
|
});
|
},
|
|
onShowApproval() {
|
var me = this;
|
let param = {
|
isClientMode: false,
|
flowId: this.flow_id
|
}
|
|
var config = {
|
hide_close: true,
|
width: "85vw",
|
height: "95vh",
|
url: "../approval/Approval_flowid.html",
|
data: {},
|
delta: {
|
flow_id: this.flow_id,
|
title: this.title
|
},
|
};
|
this.doPopupByPublic(config);
|
|
},
|
|
onCellClick(config, obj) {
|
var clickContext = this.selectCellField.clickContext;
|
var row = obj.row ? obj.row : {};
|
if(this.selectCellField.field == "attachment_name" && obj.row.attachment){//
|
var fileid = obj.row.attachment;
|
let arr = obj.row.attachment_name.split(".");
|
let flix = arr[arr.length-1];
|
if(flix == 'pdf' || flix == 'png' || flix == 'jpg') {
|
let url = "../tool/popup_file_pdf.html";
|
let row = {
|
filename:obj.row.attachment_name,
|
fileid:fileid
|
}
|
var config = {
|
totab: false,
|
icon: "icon-product",
|
text: "附件预览",
|
url: url,
|
data: row,
|
width:1100,
|
delta: null,
|
callback: function(obj, callback) {
|
me.doQuery()
|
if (callback) {
|
callback();
|
}
|
}
|
};
|
this.doPopupByPublic(config);
|
}else
|
handleDownload(fileid);
|
}
|
if (this.selectCellField.field == "user_name" && obj.row.user_name == "查询") {
|
let param = {
|
isClientMode: false,
|
filter: " flow_id ='" + this.flow_id +"'",
|
dataname: "flowNodeEmpAndName"
|
}
|
Server.call("root/data/getEntitySet", param, function(result) {
|
if (result && result.data.entityset) {
|
var name = "";
|
for(var i=0;i<result.data.entityset.length;i++){
|
if(i < result.data.entityset.length -1){
|
name +=result.data.entityset[i].employee_name+","
|
}else{
|
name +=result.data.entityset[i].employee_name
|
}
|
}
|
obj.row.user_name = name;
|
}
|
});
|
|
|
|
}
|
|
return false;
|
},
|
|
}
|
});
|
</script>
|
<style>
|
.el-tooltip__popper{
|
max-width: 95%;
|
}
|
</style>
|
</body>
|
</html>
|