zj_wfl_approve_transfer.lview 3.96 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 31 32 33 34 35 36 37 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
<?xml version="1.0" encoding="UTF-8"?>
<a:screen xmlns:c="leaf.application.action" xmlns:a="http://www.leaf-framework.org/application" xmlns:p="uncertain.proc" trace="true">
    <a:init-procedure><![CDATA[
    ]]></a:init-procedure>
    <a:view>
        <a:link id="bmLink_transfer_approve" model="zjwfl.ZJWFL5110.zj_wfl_approve_transfer" modelaction="execute"/>
        <a:screen-include screen="modules/zjwfl/zj_wfl_common_javascript.lview"/>
        <script type="text/javascript"><![CDATA[
        	
        	function close_approve_transfer()
        	{
        	    var win = $('zj_wfl_approve_transfer_win');
        	    win.close();
        	}
        	
            function transfer()
            {
                var win = $('zj_wfl_approve_transfer_win');
                
                f_zjwfl.winMask(win);
                
                var ds = $('transferApproveDs');
                if(!ds.validate)
                {
                    f_zjwfl.winNoMask(win);
                    return;
                }
                var record = ds.getAt(0);
                
                Leaf.showConfirm('是否确认', '转交', function() {
                
	                Leaf.request({
	                    url: $('bmLink_transfer_approve').getUrl(),
	                    para: {
	                        record_id: '${/parameter/@record_id}',
	                        transfer_to_user_id: record.get('transfer_to_user_id'),
	                        transfer_comment:record.get('transfer_comment')
	                    },
	                    success: function(response) {
	                        
	                        f_zjwfl.winNoMask(win);
	                        
	            			Leaf.SideBar.show({
	                            msg: '${l:HLS.SUBMIT_SUCCESS}',
	                            duration: 2000
	                        });
	                        
	                        close_approve_transfer();
	                    },
	                    failure: function() {
	                        f_zjwfl.winNoMask(win);
	                    },
	                    error: function() {
	                        f_zjwfl.winNoMask(win);
	                    },
	                    scope: this
	                });
                
                }, function() {
                    f_zjwfl.winNoMask(win);
                });
            }
        ]]></script>
        <a:dataSets>
            <a:dataSet id="transferApproveDs" autoCreate="true">
                <a:fields>
                    <a:field name="transfer_to_user_id"/>
                    <a:field name="transfer_to_employee_name" readOnly="true"/>
                    <a:field name="transfer_to_user_name" lovGridHeight="300" lovHeight="450" lovService="zjwfl.zj_wfl_users_v_lov" lovWidth="500" required="true" title="转交人">
                        <a:mapping>
                            <a:map from="user_id" to="transfer_to_user_id"/>
                            <a:map from="user_name" to="transfer_to_user_name"/>
                            <a:map from="employee_name" to="transfer_to_employee_name"/>
                        </a:mapping>
                    </a:field>
                    <a:field name="transfer_comment" required="true"/>
                </a:fields>
            </a:dataSet>
        </a:dataSets>
        <a:screenBody>
            <a:form>
                <a:hBox padding="0">
                    <a:lov name="transfer_to_user_name" bindTarget="transferApproveDs" prompt="转交用户"/>
                    <a:textField name="transfer_to_employee_name" bindTarget="transferApproveDs" prompt="转交人姓名"/>
                </a:hBox>
                <a:hBox padding="0">
                    <a:textArea name="transfer_comment" bindTarget="transferApproveDs" prompt="转交原因" width="373"/>
                </a:hBox>
            </a:form>
            <a:hBox style="float:right;">
                <a:button click="transfer" text="确定"/>
            </a:hBox>
        </a:screenBody>
    </a:view>
</a:screen>