zj_wfl_approve_history.lview 8.45 KB
Newer Older
Spencer Chang's avatar
Spencer Chang committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
<?xml version="1.0" encoding="UTF-8"?>
<a:screen xmlns:c="leaf.application.action" xmlns:p="uncertain.proc" xmlns:a="http://www.leaf-framework.org/application" trace="true">
    <a:init-procedure>
        <p:switch test="/parameter/@reader_type">
            <!--
    			$Author:DJ
    			读者类型:
    			提交人
    			审批人
    			系统管理员 
    		-->
            <p:case value="SUBMITTER">
                <a:model-query defaultWhereClause="t1.workflow_id = ${/parameter/@workflow_id}" model="zjwfl.zj_wfl_workflow" rootPath="approve_ht_workflow"/>
                <a:model-query defaultWhereClause="t1.node_hide_approve_record = &apos;N&apos; and ${/model/approve_ht_workflow/record/@show_approve_history_flag} = &apos;Y&apos; and (${/model/approve_ht_workflow/record/@show_all_approve_ht_flag} = &apos;Y&apos; or t1.record_approve_count = t1.instance_approve_count)" fetchAll="true" model="zjwfl.ZJWFL1060.zj_wfl_approve_history_v" rootPath="approve_history_list"/>
            </p:case>
            <p:case value="APPROVER">
                <a:model-query defaultWhereClause="t1.node_id = ${/parameter/@node_id}" model="zjwfl.zj_wfl_workflow_node_filter_node_id" rootPath="approve_ht_node"/>
                <a:model-query defaultWhereClause="t1.node_hide_approve_record = &apos;N&apos; and ${/model/approve_ht_node/record/@show_approve_history_flag} = &apos;Y&apos; and (${/model/approve_ht_node/record/@show_all_approve_ht_flag} = &apos;Y&apos; or t1.record_approve_count = t1.instance_approve_count)" fetchAll="true" model="zjwfl.ZJWFL1060.zj_wfl_approve_history_v" rootPath="approve_history_list"/>
            </p:case>
            <p:case value="ADMIN">
                <a:model-query fetchAll="true" model="zjwfl.ZJWFL1060.zj_wfl_approve_history_v" rootPath="approve_history_list"/>
            </p:case>
        </p:switch>
        <a:model-query model="prj.PRJ600.is_prj_workflow" rootPath="is_prj_workflow"/>
        <a:model-query fetchAll="true" model="zjwfl.zj_wfl_get_bp_category" rootPath="zjwfl_bp_category_history"/>
    </a:init-procedure>
    <a:view>
        <a:link id="prj_attach_downloadfile_link" url="${/request/@context_path}/downloadFile.lview"/>
        <!-- <a:link id="check_agent_link" model="zjwfl.ZJWFL1060.zj_wfl_check_agent_re" modelaction="update"/> -->
        <style><![CDATA[
31 32 33
    	.cell_n{
            white-space:normal;
        }
Spencer Chang's avatar
Spencer Chang committed
34 35 36
    	]]></style>
        <a:screen-include screen="modules/zjwfl/zj_wfl_common_javascript.lview"/>
        <script type="text/javascript"><![CDATA[
37
        document.getElementById('zj_wfl_approve_history_table_id_tb').style.display = 'none';
Spencer Chang's avatar
Spencer Chang committed
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118
            function render_action_type_desc(value, record, name) {
                return f_zjwfl.getApproveImg(record.get('record_type'), value);
            }
            
            function open_downloadfile_win(rcpt_record_id) {
                new Leaf.Window({
                    id: 'zj_wfl_approve_history_downloadfile_win',
                    url: $('prj_attach_downloadfile_link').getUrl() + '?table_name=ZJ_WFL_INSTANCE_NODE_RECIPIENT&header_id=' + rcpt_record_id,
                    title: '附件查看',
                    width: 850,
                    height: 400
                });
            }
            
            function attachement_renderer(value, record, name) {
                if (record.get('rcpt_record_id')) {
                    if (record.get('attach_count') > 0) {
                        return '<a style="color:red" href="javascript:open_downloadfile_win(' + record.get('rcpt_record_id') + ')">附件查看</a>';
                    }
                    return '<a href="javascript:open_downloadfile_win(' + record.get('rcpt_record_id') + ')">附件查看</a>';
                }
            }
            
            function prj_atm_renderer(value, record, name) {
                if (record.get('rcpt_record_id')) {
                    return '<a href="javascript:open_prj_atm()">附件查看</a>';
                }
            }
            
            function open_prj_atm() {
                var url = $('prj_attach_downloadfile_link').getUrl() + '?table_name=ZJ_WFL_APPROVE_RECORD&header_id=' + ${/parameter/@instance_id};
                new Leaf.Window({
                    url: url,
                    title: '${l:HLS.SUPPORTING_DOCUMENT}',
                    id: 'con504_attach_downloadfile_win',
                    width: 850,
                    height: 400
                });
            
            
            }
            
            function check_agent_renderer(value, record, name) {
                //
                var agent_flag = record.get('agent_flag');
                if(agent_flag == 'Y'){
                    return '<a>' + '<font color="#FF9900">' + value + '</font>' + '</a>';
                }else{
                    return value;
                }
                
                
                
                
                //alert(rcpt_record_id);
                // Leaf.request({
                    // url: $('check_agent_link').getUrl(),
                    // para: {
                        // rcpt_record_id: rcpt_record_id
                    // },
                    // success: function(res) { // 
                        // var agent_flag = res.result.agent_flag;
                        // //alert(agent_flag);
                        // if (agent_flag == 'AGENT') {
                            // return '<a>' + '<font color="#FF9900">' + value + '</font>' + '</a>';
                        // }
                    // },
                    // scope: this
                // });
            }
        ]]></script>
        <a:dataSets>
            <a:dataSet id="approveHistoryDs">
                <a:datas dataSource="/model/approve_history_list"/>
            </a:dataSet>
            <a:dataSet id="zjwfl_bp_category_history_ds">
                <a:datas dataSource="/model/zjwfl_bp_category_history"/>
            </a:dataSet>
        </a:dataSets>
        <a:screenBody>
            <a:form marginWidth="30" padding="0">
119
                <a:grid id="zj_wfl_approve_history_table_id" bindTarget="approveHistoryDs" marginWidth="30" marginHeight="250">
Spencer Chang's avatar
Spencer Chang committed
120 121
                    <a:columns>
                        <a:column name="create_date_fmt" prompt="审批时间" width="150"/>
122 123
                        <a:column name="action_type_desc" prompt="审批操作" renderer="render_action_type_desc" width="150"/>
                         <a:column name="comment_text" prompt="审批意见" width="600" editor="textArea_e"/>
124
                        <!--<a:column name="comment_text_out" prompt="审批意见" width="400"/>-->
Spencer Chang's avatar
Spencer Chang committed
125
                        <a:column name="node_desc" prompt="审批节点" width="200"/>
126
                        <a:column name="approver" prompt="审批人" renderer="check_agent_renderer" width="140" />
Spencer Chang's avatar
Spencer Chang committed
127
                        <a:placeHolder id="dynamicLineColumn_id"/>
niminmin's avatar
niminmin committed
128
                        <!--<a:column name="attachement" align="center" prompt="附件查看" renderer="attachement_renderer" width="80"/>-->
Spencer Chang's avatar
Spencer Chang committed
129
                    </a:columns>
130 131 132 133
                    <a:editors>
                        <a:textArea id="textArea_e" readOnly="true" height="100"/>
                    </a:editors>
                </a:grid>
Spencer Chang's avatar
Spencer Chang committed
134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163
            </a:form>
        </a:screenBody>
        <script type="text/javascript"><![CDATA[
            var record = $('zjwfl_bp_category_history_ds').getCurrentRecord();
            if (record.get('bp_category') != 'EMPLOYEE') {
                $('zj_wfl_approve_history_table_id').hideColumn('comment_text');
                $('zj_wfl_approve_history_table_id').hideColumn('attachement');
            }
            
            if (record.get('role_code_name') == 'JF') {
                $('zj_wfl_approve_history_table_id').hideColumn('comment_text');
                $('zj_wfl_approve_history_table_id').hideColumn('comment_text_out');
                $('zj_wfl_approve_history_table_id').hideColumn('attachement');
            }
        ]]></script>
    </a:view>
    <a:view-config>
        <c:create-config targetId="dynamicLineColumn_id">
            <p:loop source="/model/is_prj_workflow">
                <p:switch test="@prj_workflow">
                    <p:case value="Y">
                        <c:process-config>
                            <a:column name="attachement" align="center" prompt="附件查看" renderer="attachement_renderer" width="80"/>
                        </c:process-config>
                    </p:case>
                </p:switch>
            </p:loop>
        </c:create-config>
    </a:view-config>
</a:screen>