<!doctype html>
|
<html>
|
<head>
|
<meta charset="utf-8">
|
<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"></script>
|
<script src="../../js/myelement.js"></script>
|
<!-- <script src="../../data/data.js"></script> -->
|
|
<link href="../../js/vue/element-ui/lib/theme-chalk/index.css" rel="stylesheet">
|
<link href="../../css/myelement.css" rel="stylesheet">
|
<link href="../../css/iconfont.css" rel="stylesheet">
|
<link href="../../css/page.css" 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="topbar">
|
<span>审批记录 {{title}}</span>
|
|
<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-group>
|
<!-- <el-button-group>
|
<el-button @click="closeDialog">关 闭</el-button>
|
</el-button-group> -->
|
</div>
|
</div>
|
<div class="versionNo">
|
<h-table
|
v-if="isRefresh"
|
ref="table1"
|
:table-fields="tableFields"
|
:table-data="tableData"
|
:table-height="tableHeight"
|
:is-pagination="false"
|
|
v-on:cell-click="cellClick"
|
>
|
</h-table>
|
|
</div>
|
|
<!-- <div class="el-dialog__footer" style="position: absolute; bottom: 0px; width: 100%; text-align: right;">
|
<el-button type="default" @click="closeDialog">关 闭</el-button>
|
</div> -->
|
<div class="el-dialog__footer" style="position: absolute; bottom: 0px; width: 100%; text-align: right;">
|
|
</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">
|
new ListVue({
|
el: "#vbody",
|
data: {
|
title: "",
|
pageAttr: {
|
heightType: "page"
|
},
|
|
tabaleFieldsName: "ApprovalList_",
|
isRefresh: true,
|
tableFields: [],
|
tableData: [],
|
flow_id: "",
|
isexport_pdf: true,
|
export_loading: false,
|
},
|
created() {
|
/* this.popupParames = clone(Root.popupParames);
|
|
if(this.popupParames.delta) {
|
this.flow_id = clone(this.popupParames.delta.flow_id);
|
this.title = clone(this.popupParames.delta.title);
|
} */
|
var url = window.location.href;
|
var urlParam = getGetParams(url);
|
|
this.flow_id = urlParam.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 需要异步关闭
|
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.tableHeight = null;
|
me.tableDataAfter();
|
});
|
|
},
|
|
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>
|
|
</style>
|
</body>
|
</html>
|