efile_archive_pool.lview 11.5 KB
Newer Older
18083's avatar
18083 committed
1 2 3 4 5 6 7 8
<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: luochenglong
    $Date: 2023-02-10  早上10:03:31
    $Revision: 1.0
    $Purpose:电子档池定义
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application">
Luochenglong's avatar
Luochenglong committed
9 10 11 12
    <a:init-procedure>
        <!-- <a:model-query defaultWhereClause="t1.user_id=${/session/@user_id}" model="prj.PRJ500D.sys_user_lv" rootPath="user_name_path"/> -->
        <a:model-query fetchAll="true" model="efile.EFILE1030.e_archive_pool_batch_query" rootPath="pool_data"/>
    </a:init-procedure>
18083's avatar
18083 committed
13 14 15
    <a:view>
        <a:link id="att_link_id" url="${/request/@context_path}/modules/efile/EFILE1030/efile_att_json_lov.lview"/>
        <a:link id="post_stru_link_id" url="${/request/@context_path}/modules/efile/EFILE1030/efile_post_stru_json_lov.lview"/>
Luochenglong's avatar
Luochenglong committed
16 17 18 19
        <a:link id="doc_post_link" url="${/request/@context_path}/modules/efile/EFILE1040/efile_doc_import.lsc"/>
        <a:link id="efile_create_pool_temp_link" url="${/request/@context_path}/modules/efile/EFILE1030/create_pool_temp.lsc"/>
        <a:link id="elec_file_save_link" model="efile.EFILE1010.elec_file_type" modelaction="batch_update"/>
        <a:link id="elec_file_delete_link" model="efile.EFILE1010.elec_file_type" modelaction="batch_update"/>
18083's avatar
18083 committed
20 21 22 23 24 25
        <script type="text/javascript"><![CDATA[




        function efile_archive_pool_batch_trans() {
18083's avatar
18083 committed
26
             var records=$('pool_temp_ds').getAll();
Luochenglong's avatar
Luochenglong committed
27 28
            var saveData = [];
            var param = {};
18083's avatar
18083 committed
29
            Leaf.showConfirm('特别注意', '<span style="color: #ff0000; ">该操作将导致上个月满足条件的电子档案全部传输!!!如果不需要传输所有数据,请一定点击取消按钮!!!</span>', function() {
Luochenglong's avatar
Luochenglong committed
30 31 32 33 34 35 36
                var detail_mask = Ext.getBody();
                Leaf.Masker.mask(detail_mask, '${l:HLS.EXECUTING}');
                for (var i = 0;i < records.length;i++) {
                    var record = records[i];
                    saveData.push({
                        'document_id': record.get('pool_id'),
                        '_status': 'insert'
18083's avatar
18083 committed
37
                    });
Luochenglong's avatar
Luochenglong committed
38 39 40 41 42 43 44
                }
                param['details'] = saveData;
                Leaf.request({
                    url: $('efile_create_pool_temp_link').getUrl(),
                    para: param,
                    success: function() {
                        Leaf.Masker.unmask(detail_mask);
18083's avatar
18083 committed
45
                          Leaf.showMessage('提示','传输成功',function(){
Luochenglong's avatar
Luochenglong committed
46 47
                            $('efile_archive_pool_ds').query();
                        });
18083's avatar
18083 committed
48
                     },
Luochenglong's avatar
Luochenglong committed
49 50
                    failure: function() {
                        Leaf.Masker.unmask(detail_mask);
18083's avatar
18083 committed
51
                       },
Luochenglong's avatar
Luochenglong committed
52 53
                    error: function() {
                        Leaf.Masker.unmask(detail_mask);
18083's avatar
18083 committed
54
                      },
Luochenglong's avatar
Luochenglong committed
55 56
                    scope: this
                });
18083's avatar
18083 committed
57 58
            }, function () {
               }, 300, 150);
18083's avatar
18083 committed
59 60 61 62 63 64 65 66 67 68

        }

        function efile_archive_pool_manual_trans() {
            var record = $('efile_archive_pool_ds').getSelected();
            if (record.length==0){
                Leaf.showMessage('提示','请选择传输数据!');
                return;
            }
            for (var i = 0; i < record.length; i++) {
Luochenglong's avatar
Luochenglong committed
69
                if(record[i].get('monthly_closed_flag')=='0'){
18083's avatar
18083 committed
70 71 72
                    Leaf.showMessage('提示','资料期间对应的会计期间必须是关账状态!');
                    return;
                }
Luochenglong's avatar
Luochenglong committed
73 74 75 76
                if(record[i].get('post_status')=='POST_SUCCESS'){
                    Leaf.showMessage('提示','已传输成功不可重复传输!');
                    return;
                }
18083's avatar
18083 committed
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
            }

            var records = new Array();
            for (i = 0;i < record.length;i++) {
                records.push(record[i].data);
                /*  if (record[i].get('upload_ftp_flag') == 'Y') {
                      Aurora.showMessage('提示','已上传批次不能重复上传!');
                      return;
                  }*/
            }

            Leaf.Masker.mask(Ext.getBody(), '${l:HLS.EXECUTING}');
            Leaf.request({
                url: $('doc_post_link').getUrl(),
                para: records,
                success: function() {
                    Leaf.Masker.unmask(Ext.getBody());
                    Leaf.showMessage('提示','传输成功',function(){
                        $('efile_archive_pool_ds').query();
                    });
                },
                failure: function() {
                    Leaf.Masker.unmask(Ext.getBody());
                },
                error: function() {
                    Leaf.Masker.unmask(Ext.getBody());
                },
                scope: this
            });
        }

        function efile_archive_pool_reset() {
Luochenglong's avatar
Luochenglong committed
109
            $('for_query_ds').reset();
18083's avatar
18083 committed
110 111 112 113 114 115 116
        }

        function efile_archive_pool_query() {
            $('efile_archive_pool_ds').query();
        }

        function att_update_renderer(value, record, name) {
Luochenglong's avatar
Luochenglong committed
117 118 119 120

            if(name=='att'){
                return '<a href="javascript:efile_archive_att_list(\'' + record.get('pool_id') + '\')">附件</a>';
            }
18083's avatar
18083 committed
121 122 123 124 125 126 127 128 129 130 131 132 133 134 135
            if(name=='post_stru_data'){
                return '<a href="javascript:efile_archive_post_stru_data_list(\'' + record.get('pool_id') + '\')">结构化数据</a>';
            }


        }

        function efile_archive_att_list(record_id) {
            var record = $('efile_archive_pool_ds').findById(record_id);
            var url = $('att_link_id').getUrl();
            if (!Leaf.isEmpty(record_id)) {
                var win = new Leaf.Window({
                    id: 'att_id_winid',
                    url: url,
                    params: {
Luochenglong's avatar
Luochenglong committed
136
                        pool_id: record_id
18083's avatar
18083 committed
137
                    },
Luochenglong's avatar
Luochenglong committed
138
                    height: 480,
Luochenglong's avatar
Luochenglong committed
139
                    width: 1100
18083's avatar
18083 committed
140 141 142 143 144 145 146 147 148 149 150 151 152
                });
            }

        }

        function efile_archive_post_stru_data_list(record_id) {
            var record = $('efile_archive_pool_ds').findById(record_id);
            var url = $('post_stru_link_id').getUrl();
            if (!Leaf.isEmpty(record_id)) {
                var win = new Leaf.Window({
                    id: 'post_stru_id_winid',
                    url: url,
                    params: {
Luochenglong's avatar
Luochenglong committed
153
                        pool_id: record_id
18083's avatar
18083 committed
154
                    },
Luochenglong's avatar
Luochenglong committed
155 156
                    height: 550,
                    width: 800
18083's avatar
18083 committed
157 158 159 160 161 162 163 164 165 166
                });
            }

        }

        function checklength(ds, record, name, value, oldvalue) {

        }
        ]]></script>
        <a:dataSets>
Luochenglong's avatar
Luochenglong committed
167 168 169
            <a:dataSet id="pool_temp_ds">
                <a:datas dataSource="/model/pool_data"/>
            </a:dataSet>
18083's avatar
18083 committed
170 171 172 173 174
            <a:dataSet id="yes_no_ds" lookupCode="YES_NO"/>
            <a:dataSet id="data_cf_ds" lookupCode="DATA_CLASSIFICATION"/>
            <a:dataSet id="post_status_ds" lookupCode="POST_STATUS_DESC"/>
            <a:dataSet id="for_query_ds" autoCreate="true">
                <a:fields>
Luochenglong's avatar
Luochenglong committed
175 176
                    <a:field name="internal_period_num_from" />
                    <a:field name="internal_period_num_to" />
18083's avatar
18083 committed
177
                    <a:field name="internal_period_num" />
Luochenglong's avatar
Luochenglong committed
178
                    <a:field name="hly_req_number" />
18083's avatar
18083 committed
179 180 181 182
                    <a:field name="primary_field" />
                    <a:field name="document_info" />
                    <a:field name="post_status" />
                    <a:field name="archive_type" />
Luochenglong's avatar
Luochenglong committed
183
                    <a:field name="suppl_trans_flag" />
18083's avatar
18083 committed
184
                    <a:field name="archive_type_desc" displayField="code_value_name" options="data_cf_ds"  returnField="archive_type" valueField="code_value"/>
Luochenglong's avatar
Luochenglong committed
185
                    <a:field name="suppl_trans_flag_desc" displayField="code_value_name" options="yes_no_ds"  returnField="suppl_trans_flag" valueField="code_value"/>
18083's avatar
18083 committed
186 187 188 189 190 191
                    <a:field name="post_status_desc" displayField="code_value_name" options="post_status_ds"  returnField="post_status" valueField="code_value"/>
                </a:fields>
            </a:dataSet>
            <a:dataSet id="efile_archive_pool_ds"  model="efile.EFILE1030.e_archive_pool_query" queryDataSet="for_query_ds" selectable="true">
                <a:fields>
                    <a:field name="monthly_closed_flag" />
192
                    <a:field name="post_message" readOnly="true" />
Luochenglong's avatar
Luochenglong committed
193
                    <a:field name="post_status_desc" displayField="code_value_name" options="post_status_ds"  returnField="post_status" valueField="code_value"/>
18083's avatar
18083 committed
194 195 196 197 198 199 200 201
                </a:fields>
            </a:dataSet>
        </a:dataSets>
        <a:screenBody>
            <a:screenTopToolbar>
                <!--<a:screenTitle/>-->
                <a:gridButton click="efile_archive_pool_query" text="HLS.QUERY"/>
                <a:gridButton click="efile_archive_pool_reset" text="重置"/>
18083's avatar
18083 committed
202
                <a:gridButton id="efile_archive_pool_batch_id" click="efile_archive_pool_batch_trans" text="启动批量传输"/>
18083's avatar
18083 committed
203 204 205
                <a:gridButton click="efile_archive_pool_manual_trans" text="手动传输"/>
            </a:screenTopToolbar>
            <a:form column="4" marginWidth="30" title="查询条件">
Luochenglong's avatar
Luochenglong committed
206 207
                <a:textField name="internal_period_num_from"   bindTarget="for_query_ds" prompt="资料期间从"/>
                <a:textField name="internal_period_num_to"   bindTarget="for_query_ds" prompt="资料期间到"/>
18083's avatar
18083 committed
208 209
                <a:comboBox name="archive_type_desc" bindTarget="for_query_ds" prompt="资料类型"/>
                <a:textField name="primary_field" bindTarget="for_query_ds" prompt="主键"/>
Luochenglong's avatar
Luochenglong committed
210
                <a:comboBox name="suppl_trans_flag_desc" bindTarget="for_query_ds" prompt="是否补传"/>
18083's avatar
18083 committed
211 212
                <a:textField name="document_info" bindTarget="for_query_ds" prompt="原始资料号"/>
                <a:comboBox name="post_status_desc" bindTarget="for_query_ds" prompt="传输状态"/>
Luochenglong's avatar
Luochenglong committed
213
                <a:textField name="hly_req_number" bindTarget="for_query_ds" prompt="传输批次号"/>
18083's avatar
18083 committed
214 215 216 217 218 219 220 221 222
            </a:form>
            <a:grid id="efile_archive_pool_ds_id" bindTarget="efile_archive_pool_ds" marginHeight="200" marginWidth="30" navBar="true">
                <a:columns>
                    <a:column name="primary_field"  prompt="主键" width="320"/>
                    <a:column name="internal_period_num"  prompt="资料期间" width="120"/>
                    <a:column name="archive_type_desc"  prompt="资料类型" width="120"/>
                    <a:column name="document_info"  prompt="原始资料号" width="300"/>
                    <a:column name="post_stru_data"  prompt="结构化数据"  renderer="att_update_renderer" width="110"/>
                    <a:column name="att" align="center" prompt="附件" renderer="att_update_renderer"/>
Luochenglong's avatar
Luochenglong committed
223
                    <a:column name="suppl_trans_flag_desc" align="center"  width="120" prompt="是否补传"/>
Luochenglong's avatar
Luochenglong committed
224 225 226
                    <a:column name="post_status_desc" align="center"  width="120" prompt="传输状态"/>
                    <a:column name="post_message" align="center" editor="textarea_id"  width="180" prompt="传输结果"/>
                    <a:column name="hly_req_number" align="center" width="120"   prompt="传输批次号"/>
18083's avatar
18083 committed
227
                </a:columns>
228 229 230 231 232 233 234 235
                <a:editors>
                    <a:textField id="text_ed"/>
                    <a:textArea id="textarea_id"/>
                    <a:textField id="text_ed_up" typeCase="upper"/>
                    <a:checkBox id="checkbox_ed"/>
                    <a:lov id="conBasicClauseParaDs_grid_lov"/>
                    <a:comboBox id="efile_type_comed"/>
                </a:editors>
18083's avatar
18083 committed
236 237 238 239
            </a:grid>
        </a:screenBody>
    </a:view>
</a:screen>