<!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: "",
|
title: "待审批列表",
|
pageAttr: {
|
heightType: "popuppage"
|
},
|
orderby: "update_time desc",
|
filterfieldClick: {},
|
tablefieldClick: {},
|
formfieldClick: {},
|
filterTxt: "1<>1",
|
machine_id: "",
|
selectednode: {},
|
|
},
|
created() {
|
this.popupParames = clone(Root.popupParames);
|
this.title = this.popupParames.title || this.popupParames.text
|
// if (this.popupParames.filter) {
|
// this.filterTxt = this.popupParames.filter
|
// }
|
if (this.popupParames.data) {
|
this.selectednode = this.popupParames.data
|
}
|
if (this.popupParames.data.dataname) {
|
this.dataname = this.popupParames.data.dataname;
|
}
|
if (this.popupParames.data.machine_id) {
|
this.machine_id = this.popupParames.data.machine_id;
|
}
|
},
|
|
mounted() {
|
//获取数据
|
this.initData();
|
this.$nextTick(() => { // 以服务的方式调用的 Loading 需要异步关闭
|
hideLoading();
|
});
|
},
|
|
methods:{
|
//关闭弹窗
|
closeDialog() {
|
this.docloseDialog(true);
|
},
|
|
//关闭前调回调
|
saveAfter() {
|
var me = this;
|
if(this.popupParames.callback) {
|
let obj = {
|
row: clone(this.selectedrow)
|
}
|
this.popupParames.callback(obj, function() {
|
me.docloseDialog();
|
});
|
}
|
else {
|
me.docloseDialog();
|
}
|
},
|
|
initData() {
|
var me = this;
|
this.onQuery(function(result, callback) {//查询后的回调,用于获取字段的
|
if (result.meta && result.meta[me.dataname] && result.meta[me.dataname].fields) {
|
var metas = clone(result.meta[me.dataname].fields);
|
var filterFields_ = [];
|
var tableFields_ = [];
|
|
metas.map(f=>{
|
f.isshow = "T";
|
|
if (f.isfilter) {
|
filterFields_.push(clone(f));
|
}
|
else {
|
var filter_f = clone(f);
|
filter_f.isshow = "F";
|
filterFields_.push(filter_f);
|
}
|
|
tableFields_.push(clone(f));
|
})
|
if (!me.filterFields || (me.filterFields && me.filterFields.length == 0)) {
|
me.filterFields = clone(filterFields_);
|
me.tableFields = clone(tableFields_);
|
|
//字段数组转字段obj,目的为了筛选时获取字段属性
|
me.fieldsToFieldsObj();
|
|
//设置字段事件
|
me.tableFieldClick();
|
}
|
}
|
me.getDataByNode()
|
|
if (callback) {
|
callback();
|
}
|
});
|
},
|
|
getDataByNode() {
|
var me = this;
|
var filter_ = "1=1"
|
// if (this.selectednode.filtertxt) {
|
// filter_ = this.selectednode.filtertxt;
|
// }
|
var param_ = {
|
dataname: this.dataname,
|
machine_id: this.machine_id,
|
// filter: filter_,
|
orderby: "update_time desc",
|
// page: {
|
// pageno: this.pagenum_p,
|
// pagesize: this.pagesize_p
|
// },
|
}
|
me.tableData = [];
|
Server.call("root/workflow/getDocumentList", param_, function(result) {
|
if (result && result.data) {
|
me.tableData = result.data;
|
}
|
|
// if (result && result.data && result.data.entityset) {
|
// var data_ = result.data.entityset;
|
// me.tableData_p = data_;
|
// me.total_p = result.data.page.recordcount;
|
// }
|
// else {
|
// me.total_p = 0;
|
// }
|
})
|
},
|
|
tableFieldClick() {
|
var me = this;
|
},
|
toApproval() {
|
let me = this;
|
var row = me.selectedrow;
|
if(!row){
|
Root.message({
|
type: 'warning',
|
message: '请选择一条数据'
|
});
|
return;
|
}
|
this.closeDialog();
|
var config = {
|
totab: true, //true: 以Tab导航的方式打开
|
width: "1100px",
|
height: "520px",
|
icon: "icon-product",
|
text: me.selectednode.name + (row.name ? row.name : (row.code ? row.code : "")),
|
id: me.selectednode.id + row.id + "main",//totab: true时需设置,用于判断是否已打开此页面
|
url: me.selectednode.pageurl,
|
data: row,
|
delta: me.selectednode,
|
sceneCode: "approval",//"refuseedit",//"approval", //"add"//"browse",
|
callback: function(obj, callback) {
|
// me.treeRefresh();//刷新树并默认选中当前选中节点和刷新该树节点的待审批列表
|
// me.getDataByNode();//刷新该树节点的待审批列表
|
if (callback) {
|
callback();
|
}
|
}
|
};
|
me.doPopupByPublic(config);
|
},
|
|
onRowDblClick() {
|
if (this.isedit) {
|
this.saveAfter();
|
}
|
},
|
|
}
|
});
|
};
|
|
loadJsCss(function () {
|
initVue();
|
});
|
</script>
|
<style>
|
/* 在vue.js中 v-cloak 这个指令是防止页面加载时出现 vuejs 的变量名而设计的 */
|
[v-cloak] {
|
display: none !important;
|
}
|
</style>
|
|
</head>
|
|
<body style="margin: 0px;">
|
<div v-cloak id="vbody">
|
<div id="page_root">
|
<div ref="popup_body" style="padding: 0 20px;">
|
<!-- 标题 -->
|
<div class="popup_el-dialog__header">
|
<div class="dialog-title">
|
<i class="iconfont icon-customermanagement"></i>
|
<span>{{title}}</span>
|
|
<!-- <div style="float: right; margin-right: 30px;">
|
<el-button-group style="margin-left: 3px;">
|
<el-button :disabled="!(selectedrow && selectedrow.id)" type="primary" @click="toApproval":icon="buttonsconfig.approval.icon">{{buttonsconfig.approval.name}}</el-button>
|
</el-button-group>
|
</div> -->
|
</div>
|
</div>
|
<!-- 主体 -->
|
<!-- <div class="topbar-line">
|
<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="onQuery"
|
v-on:on-init-query="onInitFilter"
|
>
|
</h-form-filter>
|
</div>
|
</div> -->
|
|
<div class="h_dialog__body">
|
<h-table
|
v-if="isRefresh"
|
ref="table1"
|
:table-fields="tableFields"
|
:table-data="tableData"
|
:pagesize="pagesize"
|
:pagenum="pagenum"
|
:total="total"
|
:table-height="tableHeight"
|
:table-field-click="tablefieldClick"
|
:is-highlight-row="true"
|
:is-show-index="true"
|
:is-pagination="false"
|
|
v-on:get-data="getData"
|
v-on:row-click="rowClick"
|
>
|
</h-table>
|
</div>
|
|
<!-- 底部工具栏 -->
|
<div class="el-dialog__footer">
|
<el-button size="small" type="default" @click="closeDialog">取 消</el-button>
|
<el-button :disabled="!(selectedrow && selectedrow.id)" type="primary" @click="toApproval":icon="buttonsconfig.approval.icon">{{buttonsconfig.approval.name}}</el-button>
|
<el-button size="small" v-if="isedit" type="primary" @click="saveAfter">确 定</el-button>
|
</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>
|