sys_sms_query.lview 6.81 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 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 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
<?xml version="1.0" encoding="UTF-8"?>
<!--
	&author:DJ
	$date:2013/11/12
	$purpose:短信发送
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application">
    <a:init-procedure><![CDATA[
    ]]></a:init-procedure>
    <a:view>
        <a:link id="pageLink_view_log" url="${/request/@context_path}/modules/sys/SYS402/sys_sms_log.lview"/>
        <a:link id="bmLink_re_submit_sms" model="sys.SYS401.sys_sms_list" modelaction="update"/>
        <script type="text/javascript"><![CDATA[
	        
	        function reSubmitSms(sms_id) {
                Leaf.request({
	                url: $('bmLink_re_submit_sms').getUrl(),
	                para: {
	                    'sms_id' : sms_id
	                },
	                success: function(res) {
	                    Leaf.SideBar.show({
	                        msg: '提交成功',
	                        duration: 2000
	                    });
	                },
	                failure: function() {
	                },
	                error: function() {
	                },
	                scope: this
	            });
	        }
        	
        	function winOpen_view_log(sms_id) {
                new Leaf.Window({
                    id: 'sys_sms_log',
                    url: $('pageLink_view_log').getUrl(),
                    params:{
                    	sms_id : sms_id
                    },
                    title: '错误日志',
                    height: 380,
                    width: 800
                });
            }
        	
        	function render_smsQueryDs_grid(value,record,name)
        	{
        	    if(name=='view_log')
                {
                    if(record.get('status')=='FAIL')
                    {
                        return '<a href="javascript:winOpen_view_log(' + record.get('sms_id') + ')">查看</a>';
                    }
                    return '';
                }
                else if(name=='re_submit')
                {
                    if(record.get('status')=='FAIL')
                    {
                        return '<a href="javascript:reSubmitSms(' + record.get('sms_id') + ')">重发</a>';
                    }
                    return '';
                }
        	}
        	
        	function smsQueryPage_refresh()
        	{
        	    $('smsQueryDs').query();
        	    $('smsHistoryQueryDs').query();
        	}
        	
        	function smsQueryPage_query()
        	{
        	    $('smsHistoryQueryDs').query();
        	}
		]]></script>
        <a:dataSets>
            <a:dataSet id="sys402_query_ds" autoCreate="true"/>
            <a:dataSet id="smsQueryDs" autoPageSize="true" autoQuery="true" model="sys.SYS401.sys_sms_list" queryDataSet="sys402_query_ds" selectable="true">
                <a:fields>
                    <a:field name="text" required="true" validator="validate_smsCreateDs"/>
                    <a:field name="all_phone_number" required="true" validator="validate_smsCreateDs"/>
                </a:fields>
            </a:dataSet>
            <a:dataSet id="smsHistoryQueryDs" autoPageSize="true" autoQuery="true" model="sys.SYS402.sys_sms_history" queryDataSet="sys402_query_ds">
                <a:fields><![CDATA[
                ]]></a:fields>
            </a:dataSet>
        </a:dataSets>
        <a:screenBody>
            <a:screenTopToolbar>
                <a:screenTitle/>
                <a:gridButton click="smsQueryPage_refresh" text="HLS.REFRESH"/>
                <a:gridButton click="smsQueryPage_query" text="HLS.QUERY"/>
            </a:screenTopToolbar>
            <a:form column="5" title="查询">
                <a:textField name="phone_number" bindTarget="sys402_query_ds" prompt="手机号"/>
                <a:datePicker name="sms_date_f" bindTarget="sys402_query_ds" prompt="提交时间从"/>
                <a:datePicker name="sms_date_t" bindTarget="sys402_query_ds" prompt="提交时间到"/>
                <a:datePicker name="sent_date_f" bindTarget="sys402_query_ds" prompt="发送时间从"/>
                <a:datePicker name="sent_date_t" bindTarget="sys402_query_ds" prompt="发送时间到"/>
            </a:form>
            <a:tabPanel marginHeight="100" marginWidth="30">
                <a:tabs>
                    <a:tab prompt="待发送" width="100">
                        <a:grid id="smsQueryDs_grid" bindTarget="smsQueryDs" marginHeight="130" marginWidth="60" navBar="true">
                            <a:toolBar>
                                <a:button type="save"/>
                                <a:button type="delete"/>
                                <a:button type="excel"/>
                            </a:toolBar>
                            <a:columns>
                                <a:column name="sms_date_str" prompt="提交日期" width="130"/>
                                <a:column name="status_desc" align="center" prompt="状态" width="100"/>
                                <a:column name="phone_number" align="right" prompt="手机号" width="100"/>
                                <a:column name="text" editor="sys402_texted" prompt="短信内容" showTitle="true" width="400"/>
                                <a:column name="priority_desc" prompt="优先级"/>
                                <a:column name="view_log" prompt="错误日志" renderer="render_smsQueryDs_grid"/>
                                <a:column name="re_submit" align="center" prompt="重发" renderer="render_smsQueryDs_grid"/>
                            </a:columns>
                            <a:editors>
                                <a:textField id="sys402_texted"/>
                            </a:editors>
                        </a:grid>
                    </a:tab>
                    <a:tab prompt="已发送" width="100">
                        <a:grid id="smsHistoryQueryDs_grid" bindTarget="smsHistoryQueryDs" marginHeight="130" marginWidth="60" navBar="true">
                            <a:toolBar>
                                <a:button type="excel"/>
                            </a:toolBar>
                            <a:columns>
                                <a:column name="sms_date_str" prompt="提交日期" width="130"/>
                                <a:column name="sent_date_str" prompt="发送日期" width="130"/>
                                <a:column name="phone_number" align="right" prompt="手机号" width="100"/>
                                <a:column name="text" prompt="短信内容" showTitle="true" width="400"/>
                                <a:column name="priority_desc" prompt="优先级"/>
                                <a:column name="msg_id" prompt="移动消息ID" width="200"/>
                            </a:columns>
                            <a:editors/>
                        </a:grid>
                    </a:tab>
                </a:tabs>
            </a:tabPanel>
        </a:screenBody>
    </a:view>
</a:screen>