zj_wfl_approve_history.lview 11.4 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
<?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"/>
29 30
        <a:link id="prj_attach_uploadfile_link" url="${/request/@context_path}/uploadFile.lview"/>
        <a:link id="prj_attach_uploadonlyfile_link" url="${/request/@context_path}/uploadonlyFile.lview"/>
Spencer Chang's avatar
Spencer Chang committed
31 32
        <!-- <a:link id="check_agent_link" model="zjwfl.ZJWFL1060.zj_wfl_check_agent_re" modelaction="update"/> -->
        <style><![CDATA[
33 34 35
    	.cell_n{
            white-space:normal;
        }
Spencer Chang's avatar
Spencer Chang committed
36 37 38
    	]]></style>
        <a:screen-include screen="modules/zjwfl/zj_wfl_common_javascript.lview"/>
        <script type="text/javascript"><![CDATA[
39 40 41
            if(document.getElementById('zj_wfl_approve_history_table_id_tb')){
                document.getElementById('zj_wfl_approve_history_table_id_tb').style.display = 'none';
            }
Spencer Chang's avatar
Spencer Chang committed
42 43 44 45 46 47 48 49 50 51 52 53 54
            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
                });
            }
55

56 57 58
        function open_downloadfile_win_acr_reverse(instance_id) {
            new Leaf.Window({
                id: 'zj_wfl_approve_history_downloadfile_win',
59
                url: $('prj_attach_uploadfile_link').getUrl() + '?table_name=ZJ_WFL_INSTANCE_ACR_REVERSE&header_id=' + instance_id,
60 61 62 63 64 65
                title: '附件查看',
                width: 850,
                height: 400
            });
        }

66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85
        function open_uploadfile_win(rcpt_record_id) {
            new Leaf.Window({
                id: 'zj_wfl_approve_history_downloadfile_win',
                url: $('prj_attach_uploadfile_link').getUrl() + '?table_name=ZJ_WFL_INSTANCE_NODE_RECIPIENT&header_id=' + rcpt_record_id,
                title: '附件查看',
                width: 850,
                height: 400
            });
        }

        function open_uploadonlyfile_win(rcpt_record_id) {
            new Leaf.Window({
                id: 'zj_wfl_approve_history_downloadfile_win',
                url: $('prj_attach_uploadonlyfile_link').getUrl() + '?table_name=ZJ_WFL_INSTANCE_NODE_RECIPIENT&header_id=' + rcpt_record_id,
                title: '附件查看',
                width: 850,
                height: 400
            });
        }

86 87 88 89 90
        function attachement_renderer(value, record, name) {
            if (record.get('rcpt_record_id')) {
                if(record.get('workflow_code') == 'DCFL_CSH_PAYMENT_REQ' &&
                    record.get('instance_status') == '10' &&
                    record.get('node_sequence_num') == '10'){
91

92 93 94 95 96 97 98 99
                    if(record.get('role_code') == '0014' && record.get('attach_count') == 0){
                        return '<a href="javascript:open_uploadonlyfile_win(' + record.get('rcpt_record_id') + ')">附件查看</a>';
                    }else if(record.get('role_code') == '0014' && record.get('attach_count') >0){
                        return '<a style="color:red" href="javascript:open_uploadonlyfile_win(' + record.get('rcpt_record_id') + ')">附件查看</a>';
                    }else if((record.get('role_code') == 'HAND'||record.get('role_code') =='0017') && record.get('attach_count') == 0) {
                        return '<a href="javascript:open_uploadfile_win(' + record.get('rcpt_record_id') + ')">附件查看</a>';
                    }else if((record.get('role_code') == 'HAND'||record.get('role_code') =='0017')&& record.get('attach_count') > 0){
                        return '<a style="color:red" href="javascript:open_uploadfile_win(' + record.get('rcpt_record_id') + ')">附件查看</a>';
100 101
                    }

102 103 104
                }
                if(record.get('workflow_code') == 'ACR_INVOICE_REVERSE_WFL'){
                        return '<a style="color:red" href="javascript:open_downloadfile_win_acr_reverse(' + record.get('instance_id') + ')">附件查看</a>';
Spencer Chang's avatar
Spencer Chang committed
105
                }
106 107 108 109 110

                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>';
Spencer Chang's avatar
Spencer Chang committed
111
            }
112
        }
Spencer Chang's avatar
Spencer Chang committed
113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 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 164 165 166 167 168 169 170 171
            
            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">
niminmin's avatar
niminmin committed
172
                <a:grid id="zj_wfl_approve_history_table_id" bindTarget="approveHistoryDs" marginWidth="30" marginHeight="300">
Spencer Chang's avatar
Spencer Chang committed
173 174
                    <a:columns>
                        <a:column name="create_date_fmt" prompt="审批时间" width="150"/>
175 176
                        <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"/>
177
                        <!--<a:column name="comment_text_out" prompt="审批意见" width="400"/>-->
Spencer Chang's avatar
Spencer Chang committed
178
                        <a:column name="node_desc" prompt="审批节点" width="200"/>
179
                        <a:column name="approver" prompt="审批人" renderer="check_agent_renderer" width="140" />
Spencer Chang's avatar
Spencer Chang committed
180
                        <a:placeHolder id="dynamicLineColumn_id"/>
niminmin's avatar
niminmin committed
181
                        <a:column name="attachement" align="center" prompt="附件查看" renderer="attachement_renderer" width="80"/>
Spencer Chang's avatar
Spencer Chang committed
182
                    </a:columns>
183 184 185 186
                    <a:editors>
                        <a:textArea id="textArea_e" readOnly="true" height="100"/>
                    </a:editors>
                </a:grid>
Spencer Chang's avatar
Spencer Chang committed
187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216
            </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>