prj_project_create_content.lview 12.4 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 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 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212
<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: wangwei  
    $Date: 2015-11-4 上午8:43:50  
    $Revision: 1.0  
    $Purpose: 虚拟合同生成合同文本
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application">
    <a:view>
        <a:link id="prj_project_get_layout_code_link_id_1" model="cont.CON500.con_contract_get_layout_code" modelaction="update"/>
        <a:link id="prj_project_update_link_id" url="${/request/@context_path}/modules/prj/PRJ501N/prj_project_create_tree_n.lview"/>
        <a:link id="prj506_virtual_contract_modify_link_id" url="${/request/@context_path}/modules/prj/PRJ506/virtual_contract_modify.lview"/>
        <a:link id="prj506_virtual_contract_query_link_id" url="${/request/@context_path}/modules/prj/PRJ506/virtual_contract_query.lview"/>
        <script type="text/javascript"><![CDATA[
            function render_formatDate(value, record, name) {
                if (!Ext.isEmpty(value)) {
                    return value.parseDate('yyyy-mm-dd').format('yyyy-mm-dd');
                }
                return '';
            
            }
            
            function projectQueryScreen_query() {
                $('projectQueryScreen_mainDs').query();
            }
            
            function prj501_grid_update(reocrd_id, project_id, status) {
                var maintain_type = 'READONLY';
                var record = $('projectQueryScreen_mainDs').findById(reocrd_id);
                var param = record.data;
                param['function_code'] = 'PRJ505';
                param['document_id'] = project_id;
                param['function_usage'] = 'QUERY';
                param['maintain_type'] = maintain_type;
                param['prj_report_read_flag'] = 'Y'; /* param['cond_para2'] = record.get('bp_tenant_type'); */
                /* param['cond_para3'] = record.get('bp_vender_type'); */
                param['cond_para2'] = record.get('hn_industry_classification');
            
                param['url_title'] = '${l:PRJ505.PROJECT_DETAIL}';
                hls_doc_get_layout_code('prj_project_get_layout_code_link_id_1', param, 'prj_project_update_link_id', 'projectQueryScreen_mainDs');
            }
            
            function prj506_grid_virtual_con(reocrd_id, project_id) {
                var maintain_type = 'MODIFY';
                var url_link_id;
                var record = $('projectQueryScreen_mainDs').findById(reocrd_id);
                if (record.length == 0) {
                    Leaf.showMessage('提示!', '请选择一条记录!');
                    return;
                }
                var param = record.data;
                var content_wfl_status = record.get('content_wfl_status');
                if (content_wfl_status == 'APPROVING') {
                    param['function_code'] = 'C0N301D_CON';
                    param['function_usage'] = 'QUERY';
                    param['maintain_type'] = 'READONLY';
                    url_link_id='prj506_virtual_contract_query_link_id';
                } else {
                    param['function_code'] = 'PRJ506D';
                    param['function_usage'] = 'UPDATE';
                    param['maintain_type'] = maintain_type;
                    url_link_id='prj506_virtual_contract_modify_link_id';
                }
                //param['document_id'] = record.get('project_id');
                param['cond_para2'] = record.get('hn_industry_classification');
                param['url_title'] = '合同明细';
                // param['layout_debugger_flag'] = 'Y';
                param['winid'] = 'prj506_virtual_contract_modify_detail_link_id';
                hls_doc_get_layout_code('prj_project_get_layout_code_link_id_1', param, url_link_id, 'projectQueryScreen_mainDs');
            }
            
            function prj501_project_number_render(value, record, name) {
            
                return '<a href="javascript:prj501_grid_update(' + record.id + ',' + record.get('project_id') + ',\'' + record.get('invoice_status') + '\');">' + value + '</a>';
            }
            
            
            function prj506_virtual_con_number_render(value, record, name) {
                return '<a href="javascript:prj506_grid_virtual_con(' + record.id + ',' + record.get('project_id') + ');">' + value + '</a>';
            }
            
            function project_Create_Content() {
                var record = $('projectQueryScreen_mainDs').getSelected()[0];
                var url = $('prj_project_update_print_detail_link_id').getUrl();
                var win = new Leaf.Window({
                    url: url,
                    title: '合同文本',
                    params: {
                        project_id: record.get('project_id'),
                        winid: 'prj_project_create_content_print_win_id'
                    },
                    id: 'prj_project_create_content_print_win_id',
                    width: 970,
                    height: 500
                });
                win.on('close', function() {
                    $('projectQueryScreen_mainDs').query();
                });
            }
            
            function virtual_contract_submit() {
                var record = $('projectQueryScreen_mainDs').getSelected()[0];
                Leaf.showConfirm('${l:HLS.PROMPT}', '确认已完成合同文本并提交?', function() {
                    Leaf.Masker.mask(Ext.getBody(), '${l:HLS.EXECUTING}');
                    Leaf.request({
                        url: $('prj_project_virtual_con_submit_link_id').getUrl(),
                        para: {
                            project_id: record.get('project_id')
                        },
                        scope: this,
                        success: function() {
                            Leaf.Masker.unmask(Ext.getBody());
                            $('projectQueryScreen_mainDs').query();
                        },
                        failure: function() {
                            Leaf.Masker.unmask(Ext.getBody());
                        },
                        error: function() {
                            Leaf.Masker.unmask(Ext.getBody());
                        }
                    });
                });
            }
            
            function virtual_contract_detail() {
                var maintain_type = 'MODIFY';
                var url_link_id;
                var record = $('projectQueryScreen_mainDs').getSelected()[0];
                if (record.length == 0) {
                    Leaf.showMessage('提示!', '请选择一条记录!');
                    return;
                }
                var param = record.data;
                var content_wfl_status = record.get('content_wfl_status');
                if (content_wfl_status == 'APPROVING') {
                    param['function_code'] = 'C0N301D_CON';
                    param['function_usage'] = 'QUERY';
                    param['maintain_type'] = 'READONLY';
                    url_link_id='prj506_virtual_contract_query_link_id';
                } else {
                    param['function_code'] = 'PRJ506D';
                    param['function_usage'] = 'UPDATE';
                    param['maintain_type'] = maintain_type;
                    url_link_id='prj506_virtual_contract_modify_link_id';
                }
                //param['function_code'] = 'PRJ506D';
                //param['document_id'] = record.get('project_id');
                //param['function_usage'] = 'UPDATE';
                //param['maintain_type'] = maintain_type;
                param['cond_para2'] = record.get('hn_industry_classification');
                param['url_title'] = '合同明细';
                param['winid'] = 'prj506_virtual_contract_modify_detail_link';
                hls_doc_get_layout_code('prj_project_get_layout_code_link_id_1', param, url_link_id, 'projectQueryScreen_mainDs');
            }
        ]]></script>
        <a:screen-include screen="modules/cont/CON500/con_contract_authority_list_validate.lview?document_category=PROJECT&amp;function_code=PRJ504"/>
        <a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/>
        <a:dataSets>
            <a:dataSet id="projectQueryScreen_organizationDs" loadData="true" model="basic.hls_lease_organization_for_lov"/>
            <a:dataSet id="projectQueryScreen_channelDs" loadData="true" model="basic.hls_lease_channel_for_lov"/>
            <a:dataSet id="projectQueryScreen_divisionDs" loadData="true" model="basic.hls_division_for_lov"/>
            <a:dataSet id="query_ds" autoCreate="true">
                <a:fields>
                    <a:field name="content_finish_flag" defaultValue="N"/>
                    <a:field name="status_check" defaultValue="Y"/>
                    <a:field name="virtual_con_number"/>
                    <a:field name="lease_organization_n" displayField="description" options="projectQueryScreen_organizationDs" returnField="lease_organization" valueField="lease_organization"/>
                    <a:field name="lease_channel_n" displayField="description" options="projectQueryScreen_channelDs" returnField="lease_channel" valueField="lease_channel"/>
                    <a:field name="division_n" displayField="description" options="projectQueryScreen_divisionDs" returnField="division" valueField="division"/>
                </a:fields>
            </a:dataSet>
            <a:dataSet id="projectQueryScreen_mainDs" autoPageSize="true" autoQuery="true" model="prj.PRJ506.prj_project_create_content" queryDataSet="query_ds" selectable="true" selectionModel="single">
                <a:events>
                    <a:event name="query" handler="aut_authority_list_validate_query"/>
                </a:events>
            </a:dataSet>
        </a:dataSets>
        <a:screenBody>
            <a:screenTopToolbar>
                <a:screenTitle/>
                <!--   <a:gridButton click="projectQueryScreen_quit" text="HLS.EXIT"/> -->
                <a:gridButton click="projectQueryScreen_query" text="HLS.QUERY"/>
                <!-- <a:gridButton click="project_Create_Content" text="创建合同文本"/> -->
                <a:gridButton click="virtual_contract_detail" text="合同明细"/>
                <!--                 <a:gridButton click="virtual_contract_submit" text="提交"/> -->
            </a:screenTopToolbar>
            <a:form column="4" labelSeparator=" " labelWidth="100" marginWidth="30" title="HLS.QUERY_TITLE">
                <a:textField name="virtual_con_number" bindTarget="query_ds" prompt="合同编号"/>
                <a:comboBox name="lease_organization_n" bindTarget="query_ds" prompt="HLS.LEASE_ORGANIZATION"/>
                <a:comboBox name="division_n" bindTarget="query_ds" prompt="HLS.DIVISION_NAME"/>
                <!-- <a:comboBox name="lease_channel_n" bindTarget="query_ds" prompt="HLS.LEASE_CHANNEL_NAME"/> -->
            </a:form>
            <a:grid id="projectQueryScreen_mainDs_grid" bindTarget="projectQueryScreen_mainDs" marginHeight="235" marginWidth="30" navBar="true">
                <a:columns>
                    <a:column name="virtual_con_number" prompt="合同号" renderer="prj506_virtual_con_number_render" width="120"/>
                    <a:column name="virtual_con_name" prompt="合同名称" width="300"/>
                    <a:column name="project_number" prompt="HLS.PROJECT_NUMBER" renderer="prj501_project_number_render" width="120"/>
                    <!-- <a:column name="project_name" prompt="HLS.PROJECT_NAME" width="230"/> -->
                    <a:column name="bp_name" prompt="HLS.TENANT_NAME" width="250"/>
                    <!--  <a:column name="chance_number" prompt="HLS.LEASE_CHANCE_CODE" width="120"/> -->
                    <a:column name="document_type_desc" prompt="HLS.PROJECT_TYPE" width="100"/>
                    <a:column name="division_desc" prompt="产品线" width="100"/>
                    <a:column name="hn_industry_classification_n" prompt="集团内行业分类" width="120"/>
                    <a:column name="employee_name" prompt="HLS.SALES_EMPLOYEE" width="80"/>
                    <a:column name="lease_organization_desc" prompt="HLS.LEASE_ORGANIZATION" width="100"/>
                    <a:column name="creation_date" prompt="HLS.CREATION_DATE" renderer="render_formatDate" width="80"/>
                    <a:column name="content_wfl_status_n" prompt="合同文本审批状态" width="120"/>
                </a:columns>
            </a:grid>
        </a:screenBody>
    </a:view>
</a:screen>