Commit c3befb39 authored by TIANZHI.HU's avatar TIANZHI.HU

凭证导入工作流开发1 add by 39135 HuTianzhi

parent 0aa092a2
......@@ -28,8 +28,8 @@
FROM hls_journal_detail_imp t
WHERE t.journal_header_id = t1.journal_header_id) je_detail_count,
t1.wfl_status,
(select v.code_value_name value_name from sys_code_values_v v where v.code = 'HLS536_WFL_STATUS' and v.code_value = t1.wfl_status) wfl_status_n
(select v.code_value_name value_name from sys_code_values_v v where v.code = 'HLS536_WFL_STATUS' and v.code_value = t1.wfl_status) wfl_status_n,
t1.journal_type
FROM hls_journal_header_imp t1 order by t1.journal_header_id desc
]]></bm:query-sql>
</bm:operation>
......
<?xml version="1.0" encoding="UTF-8"?>
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
<bm:operations>
<bm:operation name="execute">
<bm:update-sql>
<![CDATA[
begin
hls_journal_import_pkg.submit_hls_journal_tmp(
p_journal_header_id => ${@journal_header_id});
end;
]]>
</bm:update-sql>
<!--<bm:parameters>
<bm:parameter inputPath="/session/@session_id"/>
</bm:parameters>-->
</bm:operation>
</bm:operations>
</bm:model>
......@@ -13,6 +13,12 @@
<a:link id="get_new_journal_num_link_id" model="hls.HLS530.get_new_journal_number" modelaction="update"/>
<a:link id="get_document_type_id" model="csh.CSH511.get_document_type" modelaction="update"/>
<script><![CDATA[
Leaf.onReady(function() {
if ('${/parameter/@maintain_type}' == 'READONLY') {
const btn_dom = document.getElementById('${/parameter/@layout_code}' + '_save');
btn_dom.remove();
}
});
window['${/parameter/@layout_code}_on_layout_dynamic_before_submit'] = function(ds, record) {
var journal_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'hls_journal_header');
......
......@@ -16,7 +16,7 @@
<a:screen-include screen="modules/hls/hls_common_javascript.lview"/>
<!--<a:link id="hls_journal_import_link" url="${/request/@context_path}/modules/hls/HLS536/hls_journal_import_handle.lview"/>-->
<a:link id="hls_journal_import_link" url="${/request/@context_path}/modules/hls/HLS536/hls_journal_import_upload.lview"/>
<a:link id="hls_journal_submit_link_id" model="hls.HLS536.submit_hls_journal_tmp" modelaction="execute"/>
<script><![CDATA[
//查询按钮
......@@ -56,6 +56,64 @@
});
}
// 提交审批
// 可以批量提交,批量提交审批的数据在一个工作流里面,有一个批次表 存 batch_id,这里要把批量提交的数据 update batch_id
function hls536_journal_send() {
debugger;
var ds_id = 'hls_journal_header_result_ds';
var records = $(ds_id).getSelected();
if(records.length == 0){
Leaf.showMessage('${l:PROMPT}', '未选择!');
return ;
}
var journal_header_id_list = [];
var journal_type_list = [];
//同一个模板的凭证才能批量提交
for (let i = 0; i < records.length; i++) {
var record = records[i];
//凭证模板类型
var journal_type = record.get('journal_type');
//单据主键
var journal_header_id = record.get('journal_header_id');
journal_header_id_list.push(journal_header_id);
journal_type_list.push(journal_type);
}
var check_flag = journal_type_list.every(val => val === journal_type_list[0]);
if (check_flag){
Leaf.showMessage('${l:PROMPT}', '同一个模板的凭证才能批量提交!');
return ;
}
/*if ($(ds_id).validate()) {
if (record.dirty != true) {
Leaf.showConfirm('${HLS.PROMPT}', '是否确认提交?', function () {
window['${/parameter/@layout_code}_lock_layout_dynamic_window']();
Leaf.request({
url: $('hls_journal_submit_link_id').getUrl(),
para: {
journal_header_id: journal_header_id
},
success: function (res) {
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
Leaf.showMessage('提示', '提交审批成功!');
},
failure: function () {
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
},
error: function () {
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
},
scope: this
});
}, null);
}
else {
Leaf.showMessage('提示', '请先保存再提交审批!', null, 350);
}
}*/
}
function hls536_link_dynamic(reocrd_id, journal_header_id) {
var maintain_type = 'UPDATE';
var record = $('hls_journal_header_result_ds').findById(reocrd_id);
......@@ -159,7 +217,7 @@
<a:toolbarButton click="hls536_journal_reset" text="HLS.RESET"/>
<a:toolbarButton click="hls536_journal_query" text="HLS.QUERY"/>
<a:toolbarButton click="hls536_journal_import" text="导入凭证模板"/>
<!--<a:toolbarButton click="hls536_journal_send" text="提交审批"/>-->
<a:toolbarButton click="hls536_journal_send" text="提交审批"/>
</a:screenTopToolbar>
<a:form column="5" labelSeparator=" " labelWidth="100" marginWidth="40" title="HAP_QUERY_TITLE">
......
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: trd
$Date: 2012-12-6 上午11:18:39
$Revision: 1.0
$Purpose:
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" trace="true">
<a:init-procedure>
</a:init-procedure>
<a:view>
<a:link id="hls_journal_import_create_link_id" url="${/request/@context_path}/modules/hls/HLS536/hls_journal_import_create.lview"/>
<a:link id="con_contract_get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code" modelaction="update"/>
<a:screen-include screen="modules/hls/hls_common_javascript.lview"/>
<script><![CDATA[
//查询按钮
function hls536_journal_query() {
$('hls_journal_header_result_ds').query();
}
//重置按钮
function hls536_journal_reset() {
$('hls_journal_header_query').reset();
}
// 审批流程中,叶唯吟节点可编辑页面
function hls536_link_dynamic(reocrd_id, journal_header_id) {
var record = $('hls_journal_header_result_ds').findById(reocrd_id);
var param = record.data;
// param['currency'] = param['currency_code'];
param['function_code'] = 'HLS536';
param['document_id'] = journal_header_id;
// param['document_category'] = 'JE';
var isEditable = '${/parameter/@isEditable}';
if(isEditable == 'Y' ){
param['function_usage'] = 'MODIFY';
param['maintain_type'] = 'UPDATE';
}else {
param['function_usage'] = 'QUERY';
param['maintain_type'] = 'READONLY';
}
param['url_title'] = '${l:HLS530.JOURNAL_LINE_MODIFY}';
hls_doc_get_layout_code('con_contract_get_layout_code_link_id', param, 'hls_journal_import_create_link_id');
}
function hls536_journal_num_render(value, record, name) {
return '<a href="javascript:hls536_link_dynamic(' + record.id + ',' + record.get('journal_header_id') + ');">' + value + '</a>';
}
]]></script>
<a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/>
<a:dataSets>
<a:dataSet id="hls301_yes_no_ds" lookupCode="YES_NO"/>
<a:dataSet id="hls_document_type_ds">
<a:datas dataSource="/model/hls_document_type_path"/>
</a:dataSet>
<a:dataSet id="hls_journal_header_query">
<a:fields>
<a:field name="contract_number"/>
<a:field name="journal_num"/>
<!--<a:field name="category_code_desc" displayField="description" options="hls_document_type_ds" returnField="category_code" valueField="document_type"/>-->
<a:field name="journal_date_from"/>
<a:field name="journal_date_to"/>
<a:field name="total_amount_dr_from"/>
<a:field name="total_amount_dr_to"/>
<a:field name="period_name"/>
<a:field name="external_journal_num"/>
<a:field name="bp_id_tenant"/>
<a:field name="bp_id_tenant_desc" lovGridHeight="400" lovHeight="550" lovService="hls.HLS301.hls_bp_master_v_for_lov" lovWidth="500">
<a:mapping>
<a:map from="bp_name" to="bp_id_tenant_desc"/>
<a:map from="bp_id" to="bp_id_tenant"/>
</a:mapping>
</a:field>
<a:field name="source_table"/>
<a:field name="reference1"/>
<a:field name="je_transaction_code"/>
<a:field name="je_transaction_desc" lovGridHeight="420" lovHeight="550" lovPageSize="20" lovService="gld.GLD104.gld_je_transaction_for_lov" lovWidth="500">
<a:mapping>
<a:map from="je_transaction_code" to="je_transaction_code"/>
<a:map from="je_transaction_desc" to="je_transaction_desc"/>
</a:mapping>
</a:field>
<a:field name="responsibility_center_name_from" lovHeight="500" lovLabelWidth="100" lovService="fnd.FND2110.fnd_responsibility_centers_lov" lovWidth="550" title="HLS.RESPONSIBILITY_CENTER_NAME">
<a:mapping>
<a:map from="responsibility_center_id" to="responsibility_center_id"/>
<a:map from="responsibility_center_code" to="responsibility_center_code_from"/>
<a:map from="responsibility_center_name" to="responsibility_center_name_from"/>
</a:mapping>
</a:field>
<a:field name="responsibility_center_name_to" lovHeight="500" lovLabelWidth="100" lovService="fnd.FND2110.fnd_responsibility_centers_lov" lovWidth="550" title="HLS.RESPONSIBILITY_CENTER_NAME">
<a:mapping>
<a:map from="responsibility_center_code" to="responsibility_center_code_to"/>
<a:map from="responsibility_center_name" to="responsibility_center_name_to"/>
</a:mapping>
</a:field>
<a:field name="account_code_from" autoComplete="true" lovHeight="500" lovLabelWidth="100" lovService="hls.HLS301.hls_journal_account_for_lov" lovWidth="500" title="HLS530.ACCOUNT_NAME">
<a:mapping>
<a:map from="account_code" to="account_code_from"/>
<a:map from="description" to="account_name_from"/>
</a:mapping>
</a:field>
<a:field name="account_code_to" autoComplete="true" lovHeight="600" lovLabelWidth="100" lovUrl="${/request/@context_path}/modules/hls/HLS530/gld_company_account_tree.lview" lovWidth="550" title="HLS530.ACCOUNT_NAME">
<a:mapping>
<a:map from="account_code" to="account_code_to"/>
<a:map from="description" to="account_name_to"/>
</a:mapping>
</a:field>
<a:field name="company_short_name" lovHeight="500" lovLabelWidth="100" lovService="fnd.fnd_companies_lov" lovWidth="550" title="HLS530.JOURNAL_COMPANY">
<a:mapping>
<a:map from="company_id" to="je_company_id"/>
<a:map from="company_short_name" to="company_short_name"/>
</a:mapping>
</a:field>
<a:field name="currency_code" lovHeight="500" lovLabelWidth="100" lovService="basic.gld_currency_v_lov" lovWidth="550">
<a:mapping>
<a:map from="currency_code" to="currency_code"/>
<a:map from="currency_name" to="currency_name"/>
</a:mapping>
</a:field>
<a:field name="merge_parent_flag_desc" defaultValue="否" displayField="code_value_name" options="hls301_yes_no_ds" returnField="merge_parent_flag" valueField="code_value"/>
<a:field name="merge_parent_flag" defaultValue="N"/>
</a:fields>
</a:dataSet>
<a:dataSet id="hls_journal_header_result_ds" autoPageSize="true" autoQuery="true" model="hls.HLS536.hls_journal_import_header" queryDataSet="hls_journal_header_query" selectable="true">
</a:dataSet>
</a:dataSets>
<a:screenBody>
<a:screenTopToolbar>
<a:screenTitle/>
<a:toolbarButton click="hls536_journal_query" text="HLS.QUERY"/>
<a:toolbarButton click="hls536_journal_reset" text="HLS.RESET"/>
</a:screenTopToolbar>
<a:form column="5" labelSeparator=" " labelWidth="100" marginWidth="40" title="HAP_QUERY_TITLE">
<a:textField name="journal_num" bindTarget="hls_journal_header_query" prompt="凭证编号"/>
<a:comboBox name="merge_parent_flag_desc" bindTarget="hls_journal_header_query" prompt="合并凭证"/>
<a:datePicker name="journal_date_from" bindTarget="hls_journal_header_query" prompt="凭证日期从"/>
<a:datePicker name="journal_date_to" bindTarget="hls_journal_header_query" prompt="凭证日期到"/>
<a:lov name="company_short_name" bindTarget="hls_journal_header_query" prompt="记账公司"/>
<a:numberField name="total_amount_dr_from" allowFormat="true" bindTarget="hls_journal_header_query" prompt="金额从"/>
<a:numberField name="total_amount_dr_to" allowFormat="true" bindTarget="hls_journal_header_query" prompt="金额到"/>
<a:lov name="je_transaction_desc" bindTarget="hls_journal_header_query" prompt="凭证来源"/>
<!-- <a:lov name="bp_id_tenant_desc" bindTarget="hls_journal_header_query" prompt="商业伙伴"/>
<a:textField name="contract_number" bindTarget="hls_journal_header_query" prompt="合同编号"/>-->
</a:form>
<a:grid id="hls_journal_headers_grid" bindTarget="hls_journal_header_result_ds" marginHeight="250" marginWidth="40" navBar="true">
<a:columns>
<a:column name="journal_num" lock="true" prompt="凭证编号" renderer="hls536_journal_num_render" width="120"/>
<a:column name="js_company_short_name" prompt="记账公司" width="90"/>
<a:column name="period_name" align="center" prompt="期间" width="80"/>
<a:column name="journal_date" align="center" prompt="凭证日期" renderer="Leaf.formatDate" width="90"/>
<a:column name="currency_desc" align="center" prompt="币种" width="80"/>
<a:column name="total_amount_fuc_dr" align="right" prompt="金额" renderer="Leaf.formatMoney" width="120"/>
<a:column name="je_transaction_desc" prompt="凭证来源" width="150"/>
<a:column name="description" prompt="凭证摘要" width="220"/>
<a:column name="je_detail_count" prompt="凭证行数量" width="50"/>
<a:column name="wfl_status_n" prompt="凭证导入状态" width="100"/>
</a:columns>
</a:grid>
</a:screenBody>
</a:view>
</a:screen>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment