sys_sms_query.lview 8.3 KB
Newer Older
Spencer Chang's avatar
Spencer Chang committed
1 2 3 4 5 6 7
<?xml version="1.0" encoding="UTF-8"?>
<!--
	&author:DJ
	$date:2013/11/12
	$purpose:短信发送
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application">
lizhe's avatar
lizhe committed
8 9 10
    <a:init-procedure>
        <a:model-query model="cont.CON620.get_sys_role" rootPath="role_info"/>
    </a:init-procedure>
Spencer Chang's avatar
Spencer Chang committed
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
    <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"/>-->
        <a:link id="bmLink_re_submit_sms" url="${/request/@context_path}/modules/sys/SYS404/ds_sys_sms_send.lsc"/>
        <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
	                    });
                        smsQueryPage_query();
	                },
	                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()
        	{
        	    $('smsQueryDs').query();
        	    $('smsHistoryQueryDs').query();
        	}

        	function smsQueryPage_reset(){
            $('sys402_query_ds').reset();
            }
lizhe's avatar
lizhe committed
86 87 88 89 90 91 92 93 94

        //债权担当,隐藏重发列
        Leaf.onReady(function () {
            var role_code = "${/model/role_info/record/@role_code}";
            if (role_code =='0008') {
                var grid=$('smsQueryDs_grid');
                grid.hideColumn('re_submit');
            }
        });
Spencer Chang's avatar
Spencer Chang committed
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 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179
		]]></script>
        <a:dataSets>
            <a:dataSet id="sys402_query_ds" autoCreate="true">
                <a:fields>
                    <a:field name="phone_number"/>
                    <a:field name="sms_date_f"/>
                    <a:field name="sms_date_t"/>
                    <a:field name="sent_date_f"/>
                    <a:field name="sent_date_t"/>
                </a:fields>
            </a:dataSet>
            <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" readOnly="true" required="true"/>
                    <a:field name="phone_number" required="true"/>
                </a:fields>
            </a:dataSet>
            <a:dataSet id="smsHistoryQueryDs" autoPageSize="true" autoQuery="false" 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:gridButton click="smsQueryPage_reset" text="HLS.RESET"/>
            </a:screenTopToolbar>
            <a:form column="6" title="查询">
                <a:textField name="phone_number" bindTarget="sys402_query_ds" prompt="手机号"/>
                <a:datePicker name="sms_date_f" bindTarget="sys402_query_ds" dayRenderer="" 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:textField name="contract_number" 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="230" 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="contract_number" prompt="合同编号" width="130"/>
                                <a:column name="text" editor="sys402_texted" prompt="短信内容" showTitle="true" width="400"/>
                                <a:column name="ref_v01" prompt="备注" width="170"/>
                                <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="contract_number" prompt="合同编号" width="130"/>
                                <a:column name="text" prompt="短信内容" showTitle="true" width="400"/>
                                <a:column name="ref_v01" prompt="备注" width="170"/>
                                <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>