Commit aed566f8 authored by Spencer Chang's avatar Spencer Chang

[fix] 审批页面显示问题

parent e0469d5c
create or replace function F_DAYS2STR(P_DAYS in number default 0)
return varchar2 is
--将天数转换成天时分秒格式
V_DAYS number := NVL(P_DAYS, 0);
V_D number; --天
V_H number; --小时
V_M number; --分
V_S number; --秒
result varchar2(200);
begin
V_D := TRUNC(V_DAYS);
V_H := TRUNC((V_DAYS - V_D) * 24);
V_M := TRUNC((V_DAYS - V_D - V_H / 24) * 24 * 60);
V_S := TRUNC((V_DAYS - V_D - V_H / 24 - V_M / 24 / 60) * 24 * 60 * 60);
select DECODE(V_D, 0, '', V_D || '天') || DECODE(V_H, 0, '', V_H || '小时') ||
DECODE(V_M, 0, '', V_M || '分') || DECODE(V_S, 0, '', V_S || '秒')
into result
from DUAL;
return(result);
end;
/
WHENEVER SQLERROR EXIT FAILURE ROLLBACK;
WHENEVER OSERROR EXIT FAILURE ROLLBACK;
spool REGISTER_ZJWFL5110.log
set feedback off
set define off
begin
sys_function_assign_pkg.func_bm_load('ZJWFL5110','zjwfl.ZJWFL5110.cus_zj_wfl_instance_node_recipient');
end;
/
commit;
set feedback on
set define on
spool off
exit
<?xml version="1.0" encoding="UTF-8"?>
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" xmlns:f="leaf.database.features" alias="t1" baseTable="ZJ_WFL_INSTANCE_NODE_RECIPIENT">
<bm:fields>
<bm:field name="instance_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="INSTANCE_ID" prompt="ZJ_WFL_INSTANCE_NODE_RECIPIENT.INSTANCE_ID"/>
<bm:field name="approve_count" databaseType="NUMBER" datatype="java.lang.Long" physicalName="APPROVE_COUNT" prompt="ZJ_WFL_INSTANCE_NODE_RECIPIENT.APPROVE_COUNT"/>
<bm:field name="node_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="NODE_ID" prompt="ZJ_WFL_INSTANCE_NODE_RECIPIENT.NODE_ID"/>
<bm:field name="submitted_by" databaseType="NUMBER" datatype="java.lang.Long" physicalName="SUBMITTED_BY" prompt="ZJ_WFL_INSTANCE_NODE_RECIPIENT.NODE_ID"/>
<bm:field name="submitted_by_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="SUBMITTED_BY_NAME"/>
<bm:field name="seq_number" databaseType="NUMBER" datatype="java.lang.Long" physicalName="SEQ_NUMBER" prompt="ZJ_WFL_INSTANCE_NODE_RECIPIENT.SEQ_NUMBER"/>
<bm:field name="user_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="USER_ID" prompt="ZJ_WFL_INSTANCE_NODE_RECIPIENT.USER_ID"/>
<bm:field name="date_limit" databaseType="DATE" datatype="java.util.Date" physicalName="DATE_LIMIT" prompt="ZJ_WFL_INSTANCE_NODE_RECIPIENT.DATE_LIMIT"/>
<bm:field name="record_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="RECORD_ID" prompt="ZJ_WFL_INSTANCE_NODE_RECIPIENT.RECORD_ID"/>
<bm:field name="commision_by" databaseType="NUMBER" datatype="java.lang.Long" physicalName="COMMISION_BY" prompt="ZJ_WFL_INSTANCE_NODE_RECIPIENT.COMMISION_BY"/>
<bm:field name="commision_desc" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="COMMISION_DESC" prompt="ZJ_WFL_INSTANCE_NODE_RECIPIENT.COMMISION_DESC"/>
<bm:field name="last_notify_date" databaseType="DATE" datatype="java.util.Date" physicalName="LAST_NOTIFY_DATE" prompt="ZJ_WFL_INSTANCE_NODE_RECIPIENT.LAST_NOTIFY_DATE"/>
<bm:field name="hierarchy_record_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="HIERARCHY_RECORD_ID" prompt="ZJ_WFL_INSTANCE_NODE_RECIPIENT.HIERARCHY_RECORD_ID"/>
<bm:field name="workflow_id" databaseType="NUMBER" datatype="java.lang.Long" forInsert="false" forUpdate="false"/>
<bm:field name="workflow_code" databaseType="VARCHAR2" datatype="java.lang.String" forInsert="false" forUpdate="false"/>
<bm:field name="document_info" databaseType="VARCHAR2" datatype="java.lang.String" forInsert="false" forUpdate="false"/>
<bm:field name="workflow_info" databaseType="VARCHAR2" datatype="java.lang.String" forInsert="false" forUpdate="false"/>
<bm:field name="node_desc" databaseType="VARCHAR2" datatype="java.lang.String" forInsert="false" forUpdate="false"/>
<bm:field name="workflow_desc" databaseType="VARCHAR2" datatype="java.lang.String" forInsert="false" forUpdate="false"/>
<bm:field name="creation_date_format" databaseType="VARCHAR2" datatype="java.lang.String" forInsert="false" forUpdate="false"/>
<bm:field name="residence_date_format" databaseType="VARCHAR2" datatype="java.lang.String" forInsert="false" forUpdate="false"/>
<bm:field name="urgent_type"/>
<bm:field name="position_code"/>
<bm:field name="node_sequence_num"/>
<bm:field name="record_type"/>
<bm:field name="isreturn"/>
<bm:field name="finance_amount"/>
<bm:field name="down_payment_ratio"/>
<bm:field name="price_list_n"/>
<bm:field name="division"/>
<bm:field name="expand_flag"/>
<bm:field name="child_workflow_desc"/>
<bm:field name="color_flag"/>
<bm:field name="credit_flag"/>
<bm:field name="return_flag"/>
<bm:field name="times"/>
<bm:field name="fin_manager_name"/>
</bm:fields>
<bm:operations>
<bm:operation name="query">
<bm:query-sql><![CDATA[
SELECT
t1.instance_id,
t1.approve_count,
t1.submitted_by,
t1.submitted_by_name,
t1.node_id,
t1.node_desc,
t1.hierarchy_record_id,
t1.seq_number,
t1.sequence_num,
t1.user_id,
t1.date_limit,
t1.record_id,
t1.commision_by,
t1.commision_desc,
t1.last_notify_date,
t1.workflow_id,
t1.workflow_code,
t1.workflow_desc,
t1.serial_number,
NULL child_workflow_desc,
t1.workflow_desc
|| '-'||t1.node_desc workflow_info,
t1.document_info,
0 isreturn,
TO_CHAR(t1.creation_date, 'yyyy-mm-dd hh24:mi:ss') AS creation_date_format,
F_DAYS2STR(SYSDATE-t1.creation_date) residence_date_format,
t1.urgent_type,
null position_code,
null node_sequence_num,
t1.record_type,
null finance_amount, --申请融资总额
NVL(TO_CHAR(t1.down_payment_ratio*100 ,'fm999,999,999,999,999,990.009'),0)||'%' down_payment_ratio, --首付款比例
t1.times, --期数
null price_list_n, --产品方案
null division,
'Y' expand_flag,
'N' color_flag,
t1.return_flag,
(SELECT pc.credit_flag
FROM
prj_project pp,prj_project_credit pc
WHERE
pp.wfl_instance_id = t1.instance_id
and pp.project_id = pc.project_id) credit_flag, --征信标志
(select ee.name
from exp_employees ee,prj_project pp
where pp.fin_manager = ee.employee_id
and pp.wfl_instance_id = t1.instance_id) fin_manager_name
FROM
zj_wfl_instance_node_rcpt_v t1 #WHERE_CLAUSE#
]]></bm:query-sql>
</bm:operation>
</bm:operations>
<bm:features>
<f:standard-who/>
</bm:features>
<bm:primary-key>
<bm:pk-field name="record_id"/>
</bm:primary-key>
<bm:data-filters>
<bm:data-filter enforceOperations="query" expression="t1.user_id = ${/session/@user_id}"/>
</bm:data-filters>
<bm:query-fields>
<bm:query-field name="any_info" queryExpression="(t1.workflow_desc like &apos;%&apos;|| ${@any_info} || &apos;%&apos; or t1.node_desc like &apos;%&apos;|| ${@any_info} || &apos;%&apos; or t1.document_info like &apos;%&apos;|| ${@any_info} || &apos;%&apos; or to_char(t1.creation_date, &apos;yyyy-mm-dd hh24:mi:ss&apos;) like &apos;%&apos;|| ${@any_info} || &apos;%&apos; or t1.submitted_by_name like &apos;%&apos;|| ${@any_info} || &apos;%&apos; )"/>
<bm:query-field name="workflow_info" queryExpression="(t1.workflow_desc like &apos;%&apos;|| ${@workflow_info} || &apos;%&apos; or t1.node_desc like &apos;%&apos;|| ${@workflow_info} || &apos;%&apos;)"/>
<bm:query-field name="document_info" queryExpression="t1.document_info like &apos;%&apos;|| ${@document_info} || &apos;%&apos;"/>
</bm:query-fields>
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author$
$Date$
$Revision$
$Purpose: 皮肤选择
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" trace="true">
<a:init-procedure><![CDATA[
]]></a:init-procedure>
<a:view>
<style>
iframe{
width:100%;
height:100%;
}
</style>
<iframe id="wfl_common_iframe" src="${/parameter/@url}?instance_id=${/parameter/@instance_id}&amp;node_id=${/parameter/@node_id}&amp;record_id=${/parameter/@record_id}&amp;workflow_id=${/parameter/@workflow_id}&amp;record_type=${/parameter/@record_type}&amp;url_type=${/parameter/@url_type}"></iframe>
</a:view>
</a:screen>
<?xml version="1.0" encoding="UTF-8"?>
<a:screen xmlns:t="leaf.application.action" xmlns:s="leaf.plugin.script" xmlns:a="http://www.leaf-framework.org/application" xmlns:p="uncertain.proc" trace="true">
<a:init-procedure>
<!--
权限控制
-->
<s:server-script><![CDATA[
var bm = $bm('zjwfl.ZJWFL5110.zj_wfl_check_approve_privilege');
var result = bm.queryAsMap().getChildren();
if (result[0].HAS_PRIVILEGE != 'Y') {
var config = $config();
var view = CompositeUtil.findChild(config, 'view');
var list = view.getChilds();
list.clear();
var script = view.createChild('script');
script.setText("wflCmp('zj_wfl_approve_win').close();alert('您没有权限查看');");
}
]]></s:server-script>
<a:model-query defaultWhereClause="t1.node_id = ${/parameter/@node_id}" model="zjwfl.zj_wfl_workflow_node_filter_node_id" rootPath="node_record"/>
<a:model-query autocount="true" fetchall="true" model="zjwfl.sdic_wfl_workflow_node_action" rootpath="node_action"/>
<a:model-query autocount="true" fetchall="true" model="zjwfl.zj_wfl_workflow_node_action_group" rootpath="node_action_group"/>
<a:model-query autoCount="true" defaultWhereClause="t1.record_id = ${/parameter/@record_id}" fetchAll="true" model="zjwfl.ZJWFL5110.cus_zj_wfl_instance_node_recipient" rootPath="instance_one"/>
<a:model-query defaultWhereClause="t1.record_id = ${/parameter/@record_id}" model="zjwfl.zj_wfl_node_service_wait_to_do" rootPath="node_service_record" trace="true"/>
<s:server-script import="zjwfl_user_define.js"/>
</a:init-procedure>
<a:view>
<style><![CDATA[
.buttongroup .item-btn-tl,.buttongroup .item-btn-tc,.buttongroup .item-btn-tr,.buttongroup .item-btn-bl,.buttongroup .item-btn-bc,.buttongroup .item-btn-br,.buttongroup .item-btn-mr{
display:none;
}
.buttongroup .item-btn{
height:30px;
border:none;
}
.buttongroup .item-btn-ml{
background:url(${/request/@context_path}/images/button2.gif)
}
.buttongroup .item-btn-mc{
background:url(${/request/@context_path}/images/button2.gif) right 0;
padding:9px 8px 5px 0;
}
.buttongroup .item-btn-mc button div{
color:#ffffff;
}
.buttongroup .item-btn-over .item-btn-mc{
background:url(${/request/@context_path}/images/button2.gif) right -30px;
}
.buttongroup .item-btn-over .item-btn-ml{
background:url(${/request/@context_path}/images/button2.gif) left -30px;
}
.buttongroup .item-btn-over button div{
color:#000000;
}
.fixed {
position:fixed;
left:10px;
bottom:10px;
height:100px;
width:150px;
background:green;
_position: absolute;/*IE6 用absolute模拟fixed*/
_top: expression(documentElement.scrollTop + 50 + "px");
_left:-152px ;
}
]]></style>
<a:link id="svcLink_agree" url="${/request/@context_path}/modules/zjwfl/ZJWFL5110/zj_wfl_approve_agree.lsc"/>
<a:link id="svcLink_refuse" url="${/request/@context_path}/modules/zjwfl/ZJWFL5110/zj_wfl_approve_refuse.lsc"/>
<a:link id="svcLink_skip" url="${/request/@context_path}/modules/zjwfl/ZJWFL5110/zj_wfl_approve_skip.lsc"/>
<a:link id="svcLink_do_proc" url="${/request/@context_path}/modules/zjwfl/ZJWFL5110/zj_wfl_approve_do_procedure.lsc"/>
<a:link id="svcLink_view_page" url="${/request/@context_path}/modules/zjwfl/ZJWFL5110/zj_wfl_approve_view_page.lsc"/>
<a:link id="pageLink_transfer" url="${/request/@context_path}/modules/zjwfl/ZJWFL5110/zj_wfl_approve_transfer.lview"/>
<a:link id="pageLink_add_approver" url="${/request/@context_path}/modules/zjwfl/ZJWFL5110/zj_wfl_approve_add_approver.lview"/>
<a:link id="pageLink_view_graphics" url="${/request/@context_path}/modules/zjwfl/zj_wfl_graphics.lview"/>
<a:link id="zj_wfl_approve_upload_link_id" url="${/request/@context_path}/atm_upload.lview"/>
<a:link id="zjwfl5110_notice_link" model="zjwfl.ZJWFL5110.zj_wfl_approve_agree" modelaction="execute"/>
<script><![CDATA[
function wflCmp(id) {
var cmp = $L.CmpManager.get(id);
if(cmp == null){
cmp = top.$L.CmpManager.get(id);
}
if (cmp == null) {
alert('未找到组件:' + id)
window.console && console.error('未找到组件:' + id);
}
return cmp;
}
function zjwfl_before_approve_procedure(out_type){
var params ={out_object:'out_object',
out_type:'no_win'};
return params;
}
function zjwfl5110_approveCheck_type(type) {
if (type == 'agree') {
return true;
} else if (type == 'refuse') {
return true;
} else if (type == 'do_proc') {
return true;
} else if (type == 'jump') {
return true;
} else if (type == 'view_page') {
return true;
} else if (type == 'transfer_approver') {
return true;
} else if (type == 'add_approver') {
return true;
} else {
return false;
}
}
(function() {
var checker_list = {};
zjwfl5110_ApproveChecker_add = function(name, fun) {
checker_list[name] = fun;
};
zjwfl5110_ApproveChecker_remove = function(name) {
delete checker_list[name];
};
zjwfl5110_ApproveChecker_check = function(type) {
for (var key in checker_list) {
if (checker_list[key](type) == true) {
} else {
return false;
}
}
return true;
};
})();
function zjwfl5110_approveCheckNew(type) {
if (zjwfl5110_approveCheck_type(type) && zjwfl5110_ApproveChecker_check(type)) {
return true;
} else {
return false;
}
}
function zjwfl5110_uploadAttach() {
/* var rcpt_record_id = '${/parameter/@record_id}'; */
var rcpt_record_id = '${/parameter/@instance_id}';
new Leaf.Window({
id: 'zj_wfl_approve_history_downloadfile_win',
//url: $('zj_wfl_approve_upload_link_id').getUrl() + '?table_name=ZJ_WFL_APPROVE_RECORD&header_id=' + rcpt_record_id,
url: $('zj_wfl_approve_upload_link_id').getUrl() + '?document_table=ZJ_WFL_APPROVE_RECORD&document_id=' + rcpt_record_id + '&showflag=N',
title: '附件查看',
width: 1250,
height: 350
});
}
function zjwfl5110_approvePage_close() {
wflCmp('zj_wfl_approve_win').close();
}
function zjwfl5110_approvePage_mask() {
if(parent.$jq("iframe[id='wfl_common_iframe']").length > 0) {
Leaf.Masker.mask(document.documentElement, '正在提交');
}else{
Leaf.Masker.mask($('zj_wfl_approve_win').wrap);
}
}
function zjwfl5110_approvePage_noMask() {
if(parent.$jq("iframe[id='wfl_common_iframe']").length > 0) {
Leaf.Masker.unmask(document.documentElement);
}else{
Leaf.Masker.unmask($('zj_wfl_approve_win').wrap);
}
}
function zjwfl5110_actionTypeRenderer(value, record, name) {
var action_type = record.get('action_type');
var action_type_desc = record.get('action_type_desc');
if (action_type == '1') {
return "<div style='background-color:rgb(127,255,0)'>" + action_type_desc + "</div>"; //同意,绿色
} else if (action_type == '2') {
return "<div style='background-color:rgb(255,69,0)'>" + action_type_desc + "</div>"; //拒绝,红色
} else if (action_type == '3') {
return "<div style='background-color:rgb(255,255,0)'>" + action_type_desc + "</div>"; //跳转,黄色
} else {
return "";
}
}
function zjwfl5110_viewGraphics() {
new Leaf.Window({
id: 'zj_wfl_graphics',
url: $('pageLink_view_graphics').getUrl(),
params: {
instance_id: '${/parameter/@instance_id}',
workflow_id: '${/parameter/@workflow_id}'
},
title: '流程图',
fullScreen: true
});
}
//初始化意见框内容
function comment_text_ds_add(ds,record,index) {
var comment_text = '';
var position_code = '${/model/instance_one/record/@position_code}';
var node_sequence_num = '${/model/instance_one/record/@node_sequence_num}';
var workflow_code = '${/model/instance_one/record/@workflow_code}';
if (position_code == '07' && workflow_code == 'PROJECT_APPLY' && node_sequence_num == '30') {
comment_text = "项目结构:\n\n担保方式:\n\n资金来源:";
} else if (position_code == '03' && workflow_code == 'PROJECT_APPLY' && node_sequence_num == '30') {
comment_text = "项目结构:\n\n税收筹划:\n\n财务分析:";
}
record.set('comment_text',comment_text);
}
function zjwfl5110_notice(){
var comment_text = $('comment_text_ds').getAt(0).get('comment_text');
var record_id = '${/parameter/@record_id}';
Leaf.showConfirm('提示','是否关闭通知',function(){
Leaf.request({
url: $('zjwfl5110_notice_link').getUrl(),
para: {
record_id: record_id,
comment_text: comment_text
},
success: function(response) {
//解锁
zjwfl5110_approvePage_noMask();
if (response.result.result_num == 0) {
Leaf.SideBar.show({
msg: '提交成功',
duration: 2000
});
zjwfl5110_approvePage_close();
}
},
failure: function() {
zjwfl5110_approvePage_noMask();
},
error: function() {
zjwfl5110_approvePage_noMask();
},
scope: this
});
});
}
]]></script>
<a:dataSets id="zjwfl_approve_datasets_id">
<a:dataSet id="nodeActionDs">
<a:datas dataSource="/model/node_action"/>
</a:dataSet>
<a:dataSet id="comment_text_ds" autoCreate="true">
<a:fields>
<a:field name="comment_text"/>
</a:fields>
<a:events>
<a:event name="add" handler="comment_text_ds_add"/>
</a:events>
</a:dataSet>
</a:dataSets>
<a:screenBody>
<a:fieldSet marginWidth="30" title="工作流信息">
<table border="0" cellpadding="0" cellspacing="0" class="item-table" style="outline:none;width:100%;">
<tr>
<td atype="table-cell" class="table-hc" style="width:16%"><![CDATA[节点描述]]></td>
<td atype="table-cell" style="width:16%"><![CDATA[${/model/instance_one/record/@node_desc}]]></td>
<td atype="table-cell" class="table-hc" style="width:16%"><![CDATA[到达时间]]></td>
<td atype="table-cell" style="width:16%"><![CDATA[${/model/instance_one/record/@creation_date_format}]]></td>
<td atype="table-cell" class="table-hc" style="width:16%"><![CDATA[停留时间]]></td>
<td atype="table-cell" style="width:16%"><![CDATA[${/model/instance_one/record/@residence_date_format}]]></td>
</tr>
<tr>
<td atype="table-cell" class="table-hc"><![CDATA[工作流代码]]></td>
<td atype="table-cell"><![CDATA[${/model/instance_one/record/@workflow_code}]]></td>
<td atype="table-cell" class="table-hc"><![CDATA[工作流描述]]></td>
<td atype="table-cell"><![CDATA[${/model/instance_one/record/@workflow_desc}]]></td>
<td atype="table-cell" class="table-hc" style="width:16%"><![CDATA[流程图]]></td>
<td atype="table-cell" style="width:16%">
<a href="javascript:zjwfl5110_viewGraphics();"><![CDATA[查看]]></a>
</td>
</tr>
</table>
</a:fieldSet>
</a:screenBody>
<!-- <a:vBox>-->
<!-- <a:hBox>-->
<!-- <a:box>-->
<!-- <div style="color:red ;font-size:24px"><![CDATA[${/model/instance_one/record/@workflow_desc}]]></div>-->
<!-- </a:box>-->
<!-- </a:hBox>-->
<!-- </a:vBox>-->
<a:switch test="/model/node_service_record/record/@service_url">
<a:case value="DEFAULT">
<a:screen-include screen="modules/zjwfl/zj_wfl_default_document_info.lview?instance_id=${/parameter/@instance_id}&amp;approve_count=${/model/instance_one/record/@approve_count}"/>
</a:case>
<a:case value="ERROR">
<div style="color:red;"><![CDATA[自定义页面获取失败]]></div>
</a:case>
<a:case value="*">
<a:screen-include screen="${/model/node_service_record/record/@service_url}&amp;winid=zj_wfl_approve_win&amp;instance_id=${/parameter/@instance_id}"/>
</a:case>
</a:switch>
<a:switch test="/model/node_record/record/@show_approve_history_flag">
<a:case value="Y">
<a:screen-include screen="modules/zjwfl/zj_wfl_approve_history.lview?instance_id=${/parameter/@instance_id}&amp;reader_type=APPROVER&amp;node_id=${/parameter/@node_id}"/>
</a:case>
</a:switch>
<a:screenBody>
<a:vBox>
<a:hBox>
<a:box>
<div><![CDATA[审批意见]]></div>
<a:textArea name="comment_text" id="comment_text_id" bindTarget="comment_text_ds" height="90" prompt="" width="550"/>
</a:box>
<table id="showbutton">
<tr>
<td id="showbuttongroup"/>
<a:switch test="/model/node_record/record/@can_transfer_approver_flag">
<a:case value="Y">
<script><![CDATA[
function zjwfl5110_winOpen_transfer_approve() {
if(!zjwfl5110_approveCheckNew('transfer_approver'))
{
return;
}
var win = new Leaf.Window({
id: 'zj_wfl_approve_transfer_win',
url: $('pageLink_transfer').getUrl(),
params: {
record_id : '${/parameter/@record_id}'
},
title: '转交',
width:500,
height:200
});
win.on('close',function (){
zjwfl5110_approvePage_close();
});
}
]]></script>
<td style="padding-right: 15px;">
<a:gridButton click="zjwfl5110_winOpen_transfer_approve" text="转交"/>
</td>
</a:case>
</a:switch>
<a:switch test="/model/node_record/record/@can_add_approver_flag">
<a:case value="Y">
<script><![CDATA[
function zjwfl5110_winOpen_add_approver() {
if(!zjwfl5110_approveCheckNew('add_approver'))
{
return;
}
var win = new Leaf.Window({
id: 'zj_wfl_approve_add_approver_win',
url: $('pageLink_add_approver').getUrl(),
params: {
record_id : '${/parameter/@record_id}'
},
title: '添加审批人',
width:650,
height:500
});
win.on('close',function (){
zjwfl5110_approvePage_close();
});
}
]]></script>
<td style="padding-right: 15px;">
<a:gridButton click="zjwfl5110_winOpen_add_approver" text="添加审批人"/>
</td>
</a:case>
</a:switch>
<!-- <td style="padding-right: 15px;">
<a:gridButton click="zjwfl5110_uploadAttach" text="附件"/>
</td> -->
<td style="padding-right: 15px;">
<a:gridButton click="zjwfl5110_approvePage_close" text="返回"/>
</td>
</tr>
</table>
</a:hBox>
</a:vBox>
</a:screenBody>
<script><![CDATA[
function zjwfl_approve_step(record_id, comment_text, node_action_id) {
//设置请求的时间
Ext.Ajax.timeout = 20 * 60 * 1000;
Leaf.request({
url: $('svcLink_agree').getUrl(),
para: {
record_id: record_id,
comment_text: comment_text,
node_action_id: node_action_id
},
success: function(response) {
//解锁
zjwfl5110_approvePage_noMask();
if (response.result.result_num == 0) {
Leaf.SideBar.show({
msg: '提交成功',
duration: 2000
});
zjwfl5110_approvePage_close();
}
},
failure: function() {
zjwfl5110_approvePage_noMask();
},
error: function() {
zjwfl5110_approvePage_noMask();
},
scope: this
});
}
function zjwfl5110_onButtonGroup(record, combobox_ds_id, wfl_node_action_id, wfl_node_action_prompt, wfl_action_type) {
//在提交请求的过程中锁屏
zjwfl5110_approvePage_mask();
var node_action_id = '';
var node_action_prompt = '';
var action_type = '';
if (record) {
node_action_id = record.get('node_action_id');
node_action_prompt = record.get('node_action_prompt');
action_type = record.get('action_type');
} else {
if (combobox_ds_id) {
if ($(combobox_ds_id).validate()) {
var current_record = $(combobox_ds_id).getCurrentRecord();
node_action_id = current_record.get('node_action_id');
node_action_prompt = current_record.get('node_action_prompt');
action_type = current_record.get('action_type');
} else {
zjwfl5110_approvePage_noMask();
return;
}
} else {
if (wfl_node_action_id) {
node_action_id = wfl_node_action_id;
node_action_prompt = wfl_node_action_prompt;
action_type = wfl_action_type;
} else {
zjwfl5110_approvePage_noMask();
return;
}
}
}
var checkActionType = '';
if (action_type == 1) {
checkActionType = 'agree';
} else if (action_type == 2) {
checkActionType = 'refuse';
} else if (action_type == 3) {
checkActionType = 'jump';
} else if (action_type == 4) {
checkActionType = 'do_proc';
} else if (action_type == 5) {
checkActionType = 'view_page';
zjwfl5110_onViewPage(record, combobox_ds_id, wfl_node_action_id, wfl_node_action_prompt, action_type);
} else {
zjwfl5110_approvePage_noMask();
return;
}
if (!zjwfl5110_approveCheckNew(checkActionType)) {
zjwfl5110_approvePage_noMask();
return;
}
if (!$('comment_text_ds').validate()) {
zjwfl5110_approvePage_noMask();
return;
}
var record_id = '${/parameter/@record_id}';
var comment_text = $('comment_text_id').getValue();
var confirm_execute_flag = 'N';
var out_type;
var out_object;
var params;
//add by wangwei5743
//查看页面类型,不需要弹出提示
if (action_type != 5) {
var win = Leaf.showConfirm('是否确认', node_action_prompt, function() {
confirm_execute_flag = 'Y';
if (action_type == 1) {
params = zjwfl_before_approve_procedure(out_type);
out_object = params.out_object;
out_type = params.out_type;
if (out_type == 'win') {
out_object.addListener('close', function() {
zjwfl_approve_step(record_id, comment_text, node_action_id);
});
} else {
zjwfl_approve_step(record_id, comment_text, node_action_id);
}
} else {
zjwfl_approve_step(record_id, comment_text, node_action_id);
}
}, function() {
zjwfl5110_approvePage_noMask();
});
win.on('close', function() {
if (confirm_execute_flag == 'N') {
zjwfl5110_approvePage_noMask();
}
});
}
}
function zjwfl5110_onAgree(record) {
//在提交请求的过程中锁屏
zjwfl5110_approvePage_mask();
if (!zjwfl5110_approveCheckNew('agree')) {
zjwfl5110_approvePage_noMask();
return;
}
if (!$('comment_text_ds').validate()) {
zjwfl5110_approvePage_noMask();
return;
}
var record_id = '${/parameter/@record_id}';
var comment_text = $('comment_text_id').getValue();
var node_action_id = record.get('node_action_id');
var out_type;
var out_object;
var params;
Leaf.showConfirm('是否确认', record.get('node_action_prompt'), function() {
params = zjwfl_before_approve_procedure(out_type);
out_object = params.out_object;
out_type = params.out_type;
if (out_type == 'win') {
out_object.addListener('close', function() {
zjwfl_approve_step(record_id, comment_text, node_action_id);
});
} else {
zjwfl_approve_step(record_id, comment_text, node_action_id);
}
}, function() {
zjwfl5110_approvePage_noMask();
});
}
function zjwfl5110_onRefuse(record) {
//在提交请求的过程中锁屏
zjwfl5110_approvePage_mask();
if (!zjwfl5110_approveCheckNew('refuse')) {
zjwfl5110_approvePage_noMask();
return;
}
if (!$('comment_text_ds').validate()) {
zjwfl5110_approvePage_noMask();
return;
}
var record_id = '${/parameter/@record_id}';
var comment_text = $('comment_text_id').getValue();
var node_action_id = record.get('node_action_id');
Leaf.showConfirm('是否确认', record.get('node_action_prompt'), function() {
//设置请求的时间
Ext.Ajax.timeout = 20 * 60 * 1000;
Leaf.request({
url: $('svcLink_refuse').getUrl(),
para: {
record_id: record_id,
comment_text: comment_text,
node_action_id: node_action_id
},
success: function(response) {
//解锁
zjwfl5110_approvePage_noMask();
if (response.result.result_num == 0) {
Leaf.SideBar.show({
msg: '提交成功',
duration: 2000
});
zjwfl5110_approvePage_close();
}
},
failure: function() {
zjwfl5110_approvePage_noMask();
},
error: function() {
zjwfl5110_approvePage_noMask();
},
scope: this
});
}, function() {
zjwfl5110_approvePage_noMask();
});
}
function zjwfl5110_onSkip(record) {
//在提交请求的过程中锁屏
zjwfl5110_approvePage_mask();
if (!zjwfl5110_approveCheckNew('jump')) {
zjwfl5110_approvePage_noMask();
return;
}
if (!$('comment_text_ds').validate()) {
zjwfl5110_approvePage_noMask();
return;
}
var record_id = '${/parameter/@record_id}';
var comment_text = $('comment_text_id').getValue();
var node_action_id = record.get('node_action_id');
Leaf.showConfirm('是否确认', record.get('node_action_prompt'), function() {
//设置请求的时间
Ext.Ajax.timeout = 20 * 60 * 1000;
Leaf.request({
url: $('svcLink_skip').getUrl(),
para: {
record_id: record_id,
comment_text: comment_text,
node_action_id: node_action_id
},
success: function(response) {
//解锁
zjwfl5110_approvePage_noMask();
if (response.result.result_num == 0) {
Leaf.SideBar.show({
msg: '提交成功',
duration: 2000
});
zjwfl5110_approvePage_close();
}
},
failure: function() {
zjwfl5110_approvePage_noMask();
},
error: function() {
zjwfl5110_approvePage_noMask();
},
scope: this
});
}, function() {
zjwfl5110_approvePage_noMask();
});
}
function zjwfl5110_onProcedure(record) {
//在提交请求的过程中锁屏
zjwfl5110_approvePage_mask();
if (!zjwfl5110_approveCheckNew('do_proc')) {
zjwfl5110_approvePage_noMask();
return;
}
var record_id = '${/parameter/@record_id}';
var node_action_id = record.get('node_action_id');
Leaf.showConfirm('是否确认', record.get('node_action_prompt'), function() {
//设置请求的时间
Ext.Ajax.timeout = 20 * 60 * 1000;
Leaf.request({
url: $('svcLink_do_proc').getUrl(),
para: {
record_id: record_id,
node_action_id: node_action_id
},
success: function(response) {
//解锁
zjwfl5110_approvePage_noMask();
if (response.result.result_num == 0) {
Leaf.SideBar.show({
msg: '提交成功',
duration: 2000
});
zjwfl5110_approvePage_close();
}
},
failure: function() {
zjwfl5110_approvePage_noMask();
},
error: function() {
zjwfl5110_approvePage_noMask();
},
scope: this
});
}, function() {
zjwfl5110_approvePage_noMask();
});
}
/* //上传附件
function zjwfl5110_uploadAttach() {
var rcpt_record_id = '${/parameter/@record_id}';
new Leaf.Window({
id: 'zj_wfl_approve_history_downloadfile_win',
//url: $('zj_wfl_approve_upload_link_id').getUrl() + '?table_name=ZJ_WFL_APPROVE_RECORD&header_id=' + rcpt_record_id,
url: $('zj_wfl_approve_upload_link_id').getUrl() + '?document_table=ZJ_WFL_APPROVE_RECORD&document_id=' + rcpt_record_id,
title: '附件查看',
width: 850,
height: 400
});
} */
function zjwfl5110_onViewPage(record, combobox_ds_id, wfl_node_action_id, wfl_node_action_prompt, action_type) {
//在提交请求的过程中锁屏
zjwfl5110_approvePage_mask();
if (!zjwfl5110_approveCheckNew('view_page')) {
zjwfl5110_approvePage_noMask();
return;
}
var record_id = '${/parameter/@record_id}';
var node_action_id = '';
if (record) {
node_action_id = record.get('node_action_id');
} else {
if (combobox_ds_id) {
if ($(combobox_ds_id).validate()) {
var current_record = $(combobox_ds_id).getCurrentRecord();
node_action_id = current_record.get('node_action_id');
} else {
zjwfl5110_approvePage_noMask();
return;
}
} else {
if (wfl_node_action_id) {
node_action_id = wfl_node_action_id;
} else {
zjwfl5110_approvePage_noMask();
return;
}
}
}
//Leaf.showConfirm('是否确认', '是否确认?', function() {
//设置请求的时间
Ext.Ajax.timeout = 20 * 60 * 1000;
Leaf.request({
url: $('svcLink_view_page').getUrl(),
para: {
record_id: record_id,
node_action_id: node_action_id
},
success: function(response) {
//解锁
zjwfl5110_approvePage_noMask();
var result = response.result;
if (result.result_num == 0) {
// add by wangwei
//指派页面不为全屏
var w = result.service_url.indexOf('?');
var service_name = result.service_url.substring(0, w);
if (service_name.trim() != 'modules/wfl_screen/sdic_workflow_assigned.lview'&&service_name.trim() != 'modules/wfl_screen/hn_wfl_unit_assigned.lview'&&service_name.trim() != 'modules/wfl_screen/sdic_workflow_assigned_unit.lview') {
new Leaf.Window({
id: 'zj_wfl_workflow_service_window',
url: '${/request/@context_path}/' + result.service_url,
title: '',
fullScreen: true
});
} else if (service_name.trim() == 'modules/wfl_screen/sdic_workflow_assigned.lview') {
var comment_text = $('comment_text_id').getValue();
new Leaf.Window({
id: 'zj_wfl_workflow_service_window',
url: '${/request/@context_path}/' + result.service_url,
params:{
comment_text:comment_text
},
title: '',
width: 650,
height: 530
});
} else if (service_name.trim() == 'modules/wfl_screen/hn_wfl_unit_assigned.lview') {
new Leaf.Window({
id: 'zj_wfl_workflow_service_window',
url: '${/request/@context_path}/' + result.service_url,
title: '',
width: 650,
height: 530
});
}else if (service_name.trim() == 'modules/wfl_screen/sdic_workflow_assigned_unit.lview') {
new Leaf.Window({
id: 'zj_wfl_workflow_service_window',
url: '${/request/@context_path}/' + result.service_url,
title: '',
width: 650,
height: 530
});
}
}
},
failure: function() {
zjwfl5110_approvePage_noMask();
},
error: function() {
zjwfl5110_approvePage_noMask();
},
scope: this
});
/* }, function() {
zjwfl5110_approvePage_noMask();
}); */
}
function initButton() {
var node_action_ds = $('nodeActionDs');
var datalist = node_action_ds.getAll();
var record_type = '${/parameter/@record_type}';
if (record_type == 'APPROVER') {
for (var n = datalist.length;n > 0;n--) {
var i = n - 1;
var node_action = datalist[i];
var table = document.getElementById("showbutton");
// var newTD = table.rows[0].insertCell(0);
// newTD.style.cssText = 'padding-right:15px';
// var buttonTpl = "<TABLE action_id='{action_id}' class='item-btn' style=';width:60px;' id='{id}' cellSpacing='0'><TBODY><TR><TD class='item-btn-tl'><I></I></TD><TD class='item-btn-tc'></TD><TD class='item-btn-tr'><I></I></TD></TR><TR><TD class='item-btn-ml'><I></I></TD><TD class='item-btn-mc'><BUTTON type='button' hidefocus='true' atype='btn' title='' style='height:16px;' class=''><div style='line-height:16px;height:16px;'>{action_desc}</div></BUTTON></TD><TD class='item-btn-mr'><I></I></TD></TR><TR><TD class='item-btn-bl'><I></I></TD><TD class='item-btn-bc'></TD><TD class='item-btn-br'><I></I></TD></TR></TBODY></TABLE>";
// var btnid = 'btn_' + i;
// var bindaction_id = node_action.get('node_action_id');
// var bindaction_desc = node_action.get('node_action_desc');
// new Ext.Template(buttonTpl).insertFirst(newTD, {
// id: btnid,
// action_desc: bindaction_desc,
// action_id: bindaction_id
// });
//根据动作类型,动态设置按钮的执行事件
// var action_type = node_action.get('action_type');
// function create_sigle_button(action_type) {
// switch (action_type) {
// case '1':
// new Leaf.Button({
// "id": btnid,
// "listeners": {
// "click": zjwfl5110_onAgree.createDelegate(this, [node_action])
// },
// "height": 16,
// "width": 60,
// "required": false,
// "readonly": false
// });
// break;
// case '2':
// new Leaf.Button({
// "id": btnid,
// "listeners": {
// "click": zjwfl5110_onRefuse.createDelegate(this, [node_action])
// },
// "height": 16,
// "width": 60,
// "required": false,
// "readonly": false
// });
// break;
// case '3':
// new Leaf.Button({
// "id": btnid,
// "listeners": {
// "click": zjwfl5110_onSkip.createDelegate(this, [node_action])
// },
// "height": 16,
// "width": 60,
// "required": false,
// "readonly": false
// });
// break;
// case '4':
// new Leaf.Button({
// "id": btnid,
// "listeners": {
// "click": zjwfl5110_onProcedure.createDelegate(this, [node_action])
// },
// "height": 16,
// "width": 60,
// "required": false,
// "readonly": false
// });
// break;
// case '6':
// new Leaf.Button({
// "id": btnid,
// "listeners": {
// "click": zjwfl5110_uploadAttach.createDelegate(this, [node_action])
// },
// "height": 16,
// "width": 60,
// "required": false,
// "readonly": false
// });
// break;
// default:
// new Leaf.Button({
// "id": btnid,
// "listeners": {
// "click": zjwfl5110_onViewPage.createDelegate(this, [node_action])
// },
// "height": 16,
// "width": 60,
// "required": false,
// "readonly": false
// });
// }
// }
// function create_button_group(action_type) {
// switch (action_type) {
// case '1':
// new Leaf.Button({
// "id": btnid,
// "listeners": {
// "click": zjwfl5110_onAgree.createDelegate(this, [node_action])
// },
// "height": 16,
// "width": 60,
// "required": false,
// "readonly": false
// });
// break;
// case '2':
// new Leaf.Button({
// "id": btnid,
// "listeners": {
// "click": zjwfl5110_onRefuse.createDelegate(this, [node_action])
// },
// "height": 16,
// "width": 60,
// "required": false,
// "readonly": false
// });
// break;
// case '3':
// new Leaf.Button({
// "id": btnid,
// "listeners": {
// "click": zjwfl5110_onSkip.createDelegate(this, [node_action])
// },
// "height": 16,
// "width": 60,
// "required": false,
// "readonly": false
// });
// break;
// case '4':
// new Leaf.Button({
// "id": btnid,
// "listeners": {
// "click": zjwfl5110_onProcedure.createDelegate(this, [node_action])
// },
// "height": 16,
// "width": 60,
// "required": false,
// "readonly": false
// });
// break;
// case '6':
// new Leaf.Button({
// "id": btnid,
// "listeners": {
// "click": zjwfl5110_uploadAttach.createDelegate(this, [node_action])
// },
// "height": 16,
// "width": 60,
// "required": false,
// "readonly": false
// });
// break;
// default:
// new Leaf.Button({
// "id": btnid,
// "listeners": {
// "click": zjwfl5110_onViewPage.createDelegate(this, [node_action])
// },
// "height": 16,
// "width": 60,
// "required": false,
// "readonly": false
// });
// }
// }
}
} else if (record_type == 'NOTICE') {
var table = document.getElementById("showbutton");
var newTD = table.rows[0].insertCell(0);
newTD.style.cssText = 'padding-right:15px';
var buttonTpl = "<TABLE action_id='{action_id}' class='item-btn' style=';width:60px;' id='{id}' cellSpacing='0'><TBODY><TR><TD class='item-btn-tl'><I></I></TD><TD class='item-btn-tc'></TD><TD class='item-btn-tr'><I></I></TD></TR><TR><TD class='item-btn-ml'><I></I></TD><TD class='item-btn-mc'><BUTTON type='button' hidefocus='true' atype='btn' title='' style='height:16px;' class=''><div style='line-height:16px;height:16px;'>{action_desc}</div></BUTTON></TD><TD class='item-btn-mr'><I></I></TD></TR><TR><TD class='item-btn-bl'><I></I></TD><TD class='item-btn-bc'></TD><TD class='item-btn-br'><I></I></TD></TR></TBODY></TABLE>";
var btnid = 'btn_notice';
new Ext.Template(buttonTpl).insertFirst(newTD, {
id: btnid,
action_desc: '关闭',
action_id: 'btn_notice_action'
});
new Leaf.Button({
"id": btnid,
"listeners": {
"click": zjwfl5110_notice
},
"height": 16,
"width": 60,
"required": false,
"readonly": false
});
}
}
initButton();
]]></script>
</a:view>
</a:screen>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment