sys_mail_query.lview 7.93 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
<?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="bmLink_re_submit_mail" model="sys.SYS405.sys_mail_list" modelaction="update"/>
        <a:link id="pageLink_view_body" url="${/request/@context_path}/modules/sys/SYS406/sys_mail_body.lview"/>
        <a:link id="downloadFile_link" url="${/request/@context_path}/downloadFile.lview"/>
        <script type="text/javascript"><![CDATA[
            function reSubmitmail(mailing_list_id) {
                Leaf.request({
                    url: $('bmLink_re_submit_mail').getUrl(),
                    para: {
                        'mailing_list_id': mailing_list_id
                    },
                    success: function(res) {
                        $('mailQueryDs').query();
                        Leaf.SideBar.show({
                            msg: '提交成功',
                            duration: 2000
                        });
            
                    },
                    failure: function() {},
                    error: function() {},
                    scope: this
                });
            }
            
            function winOpen_mail_body(mailing_list_id, source_type) {
                new Leaf.Window({
                    id: 'sys_mail_body',
                    url: $('pageLink_view_body').getUrl(),
                    params: {
                        mailing_list_id: mailing_list_id,
                        source_type: source_type
                    },
                    title: '邮件正文',
                    height: 520,
                    width: 960
                });
            }
            
            function render_mailQueryDs_grid(value, record, name) {
                if (name == 're_submit') {
                    if (record.get('sent_flag') == 'N' && record.get('error_times') > 0) {
                        return '<a href="javascript:reSubmitmail(' + record.get('mailing_list_id') + ')">重发</a>';
                    }
                    return '';
                } else if (name == 'mail_body') {
                    return '<a href="javascript:winOpen_mail_body(' + record.get('mailing_list_id') + ',\'WAIT\')">邮件正文</a>';
                }
                return '';
            }
            
            function render_mailHistoryQueryDs_grid(value, record, name) {
                if (name == 'mail_body') {
                    return '<a href="javascript:winOpen_mail_body(' + record.get('mailing_list_id') + ',\'HISTORY\')">邮件正文</a>';
                }
                return '';
            }
            
            function mailQueryPage_refresh() {
                $('mailQueryDs').query();
                $('mailHistoryQueryDs').query();
            }
            
            function openDownloadFile(record_id) {
                var record = $('mailQueryDs').findById(record_id);
                url = $('downloadFile_link').getUrl() + '?table_name=ZJ_SYS_MAILING_LIST&useSubFolder=Y&header_id=' + record.get('mailing_list_id');
                var win = new Leaf.Window({
                    url: url,
                    title: '附件查看',
                    id: 'downloadFile_win',
                    width: 850,
                    height: 400
                });
            }
            
            function openDownloadFile_hd(record_id) {
                var record = $('mailHistoryQueryDs').findById(record_id);
                url = $('downloadFile_link').getUrl() + '?table_name=ZJ_SYS_MAILING_LIST&useSubFolder=Y&header_id=' + record.get('mailing_list_id');
                var win = new Leaf.Window({
                    url: url,
                    title: '附件查看',
                    id: 'downloadFile_win',
                    width: 850,
                    height: 400
                });
            }
            
            function attach_file_renderer(value, record, name) {
                return '<a href="javascript:openDownloadFile(' + record.id + ')">附件</a>';
            }
            
            function attach_file_renderer_hd(value, record, name) {
                return '<a href="javascript:openDownloadFile_hd(' + record.id + ')">附件</a>';
            }
        ]]></script>
        <a:dataSets>
            <a:dataSet id="mailQueryDs" autoPageSize="true" autoQuery="true" model="sys.SYS406.zj_sys_mailing_list">
                <a:fields>
                    <a:field name="text" required="true" validator="validate_mailCreateDs"/>
                    <a:field name="all_phone_number" required="true" validator="validate_mailCreateDs"/>
                </a:fields>
            </a:dataSet>
            <a:dataSet id="mailHistoryQueryDs" autoPageSize="true" autoQuery="true" model="sys.SYS406.zj_sys_mailing_list_ht">
                <a:fields><![CDATA[
                ]]></a:fields>
            </a:dataSet>
        </a:dataSets>
        <a:screenBody>
            <a:screenTopToolbar>
                <a:screenTitle/>
                <a:gridButton click="mailQueryPage_refresh" text="HLS.REFRESH"/>
            </a:screenTopToolbar>
            <a:tabPanel marginHeight="100" marginWidth="30">
                <a:tabs>
                    <a:tab prompt="待发送" width="100">
                        <a:grid id="mailQueryDs_grid" bindTarget="mailQueryDs" marginHeight="130" marginWidth="60" navBar="true">
                            <a:columns>
                                <a:column name="creation_date_str" prompt="提交日期" width="130"/>
                                <a:column name="mail_to" autoAdjust="false" prompt="收件人" showTitle="true" width="200"/>
                                <a:column name="mail_cc" autoAdjust="false" prompt="抄送" showTitle="true" width="200"/>
                                <a:column name="subject" autoAdjust="false" prompt="主题" showTitle="true" width="300"/>
                                <a:column name="note" autoAdjust="false" prompt="错误信息" showTitle="true" width="150"/>
                                <a:column name="re_submit" align="center" prompt="重发" renderer="render_mailQueryDs_grid"/>
                                <a:column name="mail_body" align="center" prompt="邮件正文" renderer="render_mailQueryDs_grid" width="80"/>
134
                                <a:column name="attach_file" align="center" prompt="附件查看" renderer="attach_file_renderer" width="80"/>
Spencer Chang's avatar
Spencer Chang committed
135 136 137 138 139 140 141 142 143 144 145 146 147
                            </a:columns>
                            <a:editors/>
                        </a:grid>
                    </a:tab>
                    <a:tab prompt="已发送" width="100">
                        <a:grid id="mailHistoryQueryDs_grid" bindTarget="mailHistoryQueryDs" marginHeight="130" marginWidth="60" navBar="true">
                            <a:columns>
                                <a:column name="creation_date_str" prompt="提交日期" width="130"/>
                                <a:column name="sent_date_str" prompt="发送日期" width="130"/>
                                <a:column name="mail_to" autoAdjust="false" prompt="收件人" showTitle="true" width="250"/>
                                <a:column name="mail_cc" autoAdjust="false" prompt="抄送" showTitle="true" width="250"/>
                                <a:column name="subject" autoAdjust="false" prompt="主题" showTitle="true" width="300"/>
                                <a:column name="mail_body" align="center" prompt="邮件正文" renderer="render_mailHistoryQueryDs_grid" width="80"/>
148
                                <a:column name="attach_file" align="center" prompt="附件查看" renderer="attach_file_renderer_hd" width="50"/>
Spencer Chang's avatar
Spencer Chang committed
149 150 151 152 153 154 155 156 157
                            </a:columns>
                            <a:editors/>
                        </a:grid>
                    </a:tab>
                </a:tabs>
            </a:tabPanel>
        </a:screenBody>
    </a:view>
</a:screen>