Commit 3165dfee authored by 18083's avatar 18083

手工凭证导入-添加刪除按鈕及审批中不可编辑页面

parent 7c8aacc3
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: trd
$Date: 2022-12-22 下午1:05:40
$Revision: 1.0
$Purpose: 批量刪除
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
<bm:operations>
<bm:operation name="delete">
<bm:update-sql><![CDATA[
BEGIN
hls_journal_import_pkg.delete_hls_journal_import( p_journal_header_id =>${@journal_header_id}, p_user_id =>${/session/@user_id} );
END;
]]></bm:update-sql>
</bm:operation>
</bm:operations>
</bm:model>
......@@ -30,8 +30,17 @@
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,
t1.journal_type
FROM hls_journal_header_imp t1 order by t1.journal_header_id desc
FROM hls_journal_header_imp t1
#WHERE_CLAUSE#
order by t1.journal_header_id desc
]]></bm:query-sql>
</bm:operation>
</bm:operations>
<bm:query-fields>
<bm:query-field name="journal_num" queryExpression="t1.journal_num like ${@journal_num}"/>
<bm:query-field name="journal_date_from" queryExpression="t1.journal_date &gt;= to_date(${@journal_date_from},'yyyy-mm-dd')"/>
<bm:query-field name="journal_date_to" queryExpression="t1.journal_date &lt;= to_date(${@journal_date_to},'yyyy-mm-dd')"/>
<bm:query-field name="total_amount_dr_from" datatype="java.lang.Double" queryExpression="nvl(t1.total_amount_dr,t1.total_amount_cr) &gt;= ${@total_amount_dr_from}"/>
<bm:query-field name="total_amount_dr_to" datatype="java.lang.Double" queryExpression="nvl(t1.total_amount_dr,t1.total_amount_cr) &lt;= ${@total_amount_dr_to}"/>
</bm:query-fields>
</bm:model>
......@@ -7,13 +7,15 @@
BEGIN
hls_journal_import_pkg.insert_hls_journal_tmp(p_user_id => ${/session/@user_id},
p_header_id => ${/session/@session_id},
p_company_id => ${/session/@company_id}
p_company_id => ${/session/@company_id},
p_template_type=>${/parameter/@template_type}
);
END;
]]></bm:update-sql>
<bm:parameters>
<bm:parameter inputPath="/session/@user_id"/>
<bm:parameter inputPath="/session/@session_id"/>
<bm:parameter inputPath="/session/@template_type"/>
</bm:parameters>
</bm:operation>
</bm:operations>
......
......@@ -17,7 +17,8 @@
<!--<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" url="${/request/@context_path}/modules/hls/HLS536/batch_hls_journal_tmp.lsc"/>
<a:link id="hls_journal_import_delete_link" model="hls.HLS536.hls_journal_import_delete"
modelaction="batch_update"/>
<script><![CDATA[
//查询按钮
......@@ -46,7 +47,6 @@
//}
function hls536_journal_import(){
debugger;
new Leaf.Window({
id: 'hls_journal_import_handle_winid',
url: $('hls_journal_import_link').getUrl(),
......@@ -56,6 +56,39 @@
});
}
//删除凭证
function hls536_journal_delete(){
debugger;
var records = $('hls_journal_header_result_ds').getSelected();
if(records.length == 0){
Leaf.showMessage('${l:PROMPT}', '请至少选择一条记录!');
return ;
}
var datas = [];
for (var i = 0; i < records.length; i++) {
if (records[i].get('wfl_status') == 'APPROVING' || records[i].get('wfl_status') == 'APPROVED') {
Leaf.showMessage('提示', '只有新建和拒绝状态的单据才能刪除!');
return;
}
var obj = {};
obj['journal_header_id'] = records[i].get('journal_header_id');
obj['_status'] = 'delete';
datas[i] = obj;
}
Leaf.request({
url: $('hls_journal_import_delete_link').getUrl(),
para: datas,
success: function () {
Leaf.SideBar.show({
msg: '操作成功',
duration: 2000
});
$('hls_journal_header_result_ds').query();
},
scope: this
});
}
// 提交审批
// 可以批量提交,批量提交审批的数据在一个工作流里面,有一个批次表 存 batch_id,这里要把批量提交的数据 update batch_id
function hls536_journal_send() {
......@@ -123,8 +156,11 @@
}
function hls536_link_dynamic(reocrd_id, journal_header_id) {
//增加逻辑:审批中、审批通过的只读;新建、审批拒绝的可编辑
debugger;
var record = $('hls_journal_header_result_ds').findById(reocrd_id);
if(record.get('wfl_status') == 'NEW' || record.get('wfl_status') == 'REJECT'){
var maintain_type = 'UPDATE';
var record = $('hls_journal_header_result_ds').findById(reocrd_id);
var param = record.data;
param['currency'] = param['currency_code'];
param['function_code'] = 'HLS536';
......@@ -134,10 +170,24 @@
param['maintain_type'] = maintain_type;
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');
}else if (record.get('wfl_status') == 'APPROVING' || record.get('wfl_status') == 'APPROVED'){
//var maintain_type = 'UPDATE';
var param = record.data;
param['currency'] = param['currency_code'];
param['function_code'] = 'HLS536';
param['document_id'] = journal_header_id;
param['document_category'] = 'JE';
param['function_usage'] = 'QUERY';
param['query_only'] = 'Y';
//param['maintain_type'] = maintain_type;
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>';
return '<a href="javascript:hls536_link_dynamic(' + record.id + ',' + record.get('journal_header_id') + ');">' + value + '</a>';
}
]]></script>
......@@ -225,18 +275,19 @@
<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_delete" text="删除凭证"/>
<a:toolbarButton click="hls536_journal_send" text="提交审批"/>
</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: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: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="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>
......
......@@ -7,7 +7,7 @@
if (!$('template_ds').validate()) {
return;
}
var template_type = $('template_ds').getAt(0);
var template_type = $('template_ds').getAt(0).get('template_type');
if (document.getElementById('importFile').value) {
var fileName = document.getElementById('importFile').value;
var fileType = fileName.substr(fileName.lastIndexOf("."));
......@@ -15,6 +15,9 @@
if (fileType != '.xls'&&fileType != '.xlsx') {
alert('请选择正确的导入文件!请使用xls或者xlsx后缀的文件');
} else {
document.getElementById('template_type').value=template_type;
var ds = $('template_ds');
ds.setSubmitParameter('template_type', template_type);
document.getElementById('importForm').submit();
}
}
......@@ -25,6 +28,7 @@
<a:fields>
<a:field name="template_type_desc" displayField="code_value_name" options="template_type_desc_ds"
returnField="template_type" valueField="code_value" required="true"/>
<a:field name="template_type"/>
</a:fields>
</a:dataSet>
<a:dataSet id="label_ds" autoCreate="true">
......@@ -43,6 +47,7 @@
<a:record code_value="COST_IMPORT" code_value_name="成本导入模板"/>
<a:record code_value="FUND_POOL" code_value_name="资金池导入模板"/>
<a:record code_value="GLOBAL_TEMPLATE" code_value_name="通用模板"/>
<a:record code_value="FINANCIAL_TEMPLATE" code_value_name="财务模板"/>
</a:datas>
</a:dataSet>
</a:dataSets>
......@@ -60,6 +65,7 @@
<a:fieldSet style="margin-left:10px;margin-top:10px;" title="导入文件" width="400">
<form name="upload" id="importForm" action="hls_journal_import_trans_upload.lview?session_id=${/parameter/@session_id}&amp;template_type=${/parameter/@template_type}&amp;parent_ds_id=${/parameter/@parent_ds_id}&amp;type=${/parameter/@type}&amp;_csrf=${/session/@_csrf.token}" enctype="multipart/form-data" method="post">
<label style="margin-left:10px;margin-top:10px;"><![CDATA[请选择文件:]]></label>
<input name="template_type" id="template_type" type="hidden"/>
<input name="CONTENT" id="importFile" style="margin-bottom:4px;width:160px;height:22px;" type="file"/>
<input onclick="saveClick()" style="margin-left:10px;margin-top:10px;width:60px;" type="button" value="导入"/>
</form>
......
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