Commit 2dd009d1 authored by 21471731's avatar 21471731

租赁物导入调整

parent a4496f0d
<?xml version="1.0" encoding="UTF-8"?>
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" needAccessControl="false">
<bm:operations>
<bm:operation name="query">
<bm:query-sql><![CDATA[
select prj_project_check_pkg.get_prj_record(${/parameter/@project_id}) as residual_value from dual
]]>
</bm:query-sql>
</bm:operation>
</bm:operations>
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: SC
$Date: 2022年11月23日20:40:09
$Revision: 1.0
$Purpose:
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" needAccessControl="false">
<bm:operations>
<bm:operation name="insert">
<bm:update-sql><![CDATA[
begin
prj_project_lease_import_pkg.insert_lease_temp(p_header_id =>${@header_id},
p_session_id=>${/session/@session_id},
p_set_number=>${@set_number},
p_lease_item_id=>${@lease_item_id},
p_user_id=>${/session/@user_id},
p_project_lease_item_id=>${@project_lease_item_id});
end;
]]></bm:update-sql>
</bm:operation>
<bm:operation name="update">
<bm:update-sql><![CDATA[
begin
prj_project_lease_import_pkg.insert_lease_item_list(
p_session_id=>${/session/@session_id},
p_user_id=>${/session/@user_id},
p_project_lease_item_id=>${@project_lease_item_id});
end;
]]></bm:update-sql>
</bm:operation>
</bm:operations>
</bm:model>
......@@ -326,5 +326,7 @@ var enableLayoutConfig = {
'modules/hsbc/HSBC110/hsbc_paying_batch_modify.lview':true,
'modules/hsbc/HSBC110/hsbc_paying_batch_detail.lview':true,
'modules/hsbc/HSBC120/hsbc_paying_batch_query.lview':true,
'modules/hsbc/HSBC130/pingan_account_hisbalance_query.lview':true
'modules/hsbc/HSBC130/pingan_account_hisbalance_query.lview':true,
'modules/prj/PRJ501N/prj_project_lease_import_details.lview':true,
'modules/prj/PRJ501N/prj_project_lease_import.lview:':true
};
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: SC
$Date: 2022年11月23日15:14:31
$Revision: 1.0
$Purpose:
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application">
<a:init-procedure>
<a:model-query model="acr.acr_get_sys_import_head_id" rootPath="header"/>
<a:import-excel header_id="${/model/header/record/@header_id}" separator="," status_field="/parameter/@ImportSuccess" template_code="PRJ_LEASE" user_id="${/session/@user_id}"/>
<a:model-query defaultWhereClause="header_id=${/model/header/record/@header_id} and TEMPLATE_CODE = &apos;PRJ_LEASE&apos;" model="acp.ACP518.acp_import_get_status" rootPath="status"/>
</a:init-procedure>
<a:view>
<a:link id="get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code"
modelaction="update"/>
<a:link id="prj501N_lease_import_link" url="${/request/@context_path}/modules/prj/PRJ501N/prj_project_lease_import_details.lview"/>
<a:link id="prj501N_lease_import_save_data_link" model="prj.PRJ500N.prj_project_lease_import_temp" modelaction="insert"/>
<script><![CDATA[
function loadComplete() {
if ('${/model/status/record/@status}' == 'NEW') {
var param = {};
param['header_id'] = '${/model/header/record/@header_id}';
param['user_id'] = '${/session/@user_id}';
param['set_number'] = '${/parameter/@set_number}';
param['lease_item_id'] = '${/parameter/@lease_item_id}';
param['project_lease_item_id'] = '${/parameter/@project_lease_item_id}';
param['function_code'] = 'PRJ501INC';
param['function_usage'] = 'QUERY';
param['winid'] = '501N_lease_prj_win_id';
Leaf.request({
url: $('prj501N_lease_import_save_data_link').getUrl(),
para: param,
success: function() {
Leaf.SideBar.show({
msg: '操作成功',
duration: 2000
});
hls_doc_get_layout_code('get_layout_code_link_id',param,'prj501N_lease_import_link', null,null,'${/parameter/@winid}','Y');
},
error: function() {
},
failure: function() {},
scope: this
});
} else {
Ext.get('success_form').setStyle('display', 'none');
Ext.get('failure_form').setStyle('visibility', 'visible');
}
}
]]></script>
<a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/>
<a:dataSets>
<a:dataSet id="error_ds">
<a:fields>
<a:field name="import_field_1" prompt="import_field_1"/>
<a:field name="import_field_2" prompt="import_field_2"/>
<a:field name="import_field_3" prompt="import_field_3"/>
</a:fields>
</a:dataSet>
</a:dataSets>
<a:screenBody>
<a:form id="failure_form" height="400" style="visibility:hidden" title="ERROR_MESSAGE" width="980">
<a:grid bindTarget="error_ds" height="340" navBar="true" width="980">
<a:columns>
<a:column name="import_field_1"/>
<a:column name="import_field_2"/>
<a:column name="import_field_3"/>
</a:columns>
</a:grid>
</a:form>
</a:screenBody>
<script><![CDATA[
loadComplete();
]]></script>
</a:view>
</a:screen>
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: SC
$Date: 2022年11月22日14:22:38
$Revision: 1.0
$Purpose:
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" customizationEnabled="true" dynamiccreateenabled="true" trace="true">
<a:view>
<a:link id="con_contract_get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code" modelaction="update"/>
<a:link id="prj501N_lease_item_list_save_link" model="prj.PRJ500N.prj_project_lease_import_temp" modelaction="update"/>
<a:link id="prj501N_lease_import_upload_link" url="${/request/@context_path}/modules/prj/PRJ501N/prj_project_lease_import_upload.lview"/>
<script><![CDATA[
//导入
window['${/parameter/@layout_code}_user_button1_layout_dynamic_click'] = function() {
var win = new Leaf.Window({
id: 'cf_fee_payment_import_upload_winid',
url: $('prj501N_lease_import_upload_link').getUrl(),
title: '租赁物信息导入',
params: {
set_number: '${/parameter/@set_number}',
lease_item_id:'${/parameter/@lease_item_id}',
project_lease_item_id:'${/parameter/@project_lease_item_id}'
},
width: 430,
height: 350
});
};
window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_grid_load'] = function (ds, record, config_records, bp_seq) {
if(record!=''){
record.getField('asset_num').setReadOnly(false);
record.getField('asset_type').setReadOnly(false);
record.getField('asset_name').setReadOnly(false);
record.getField('specification').setReadOnly(false);
record.getField('posted_date').setReadOnly(false);
record.getField('price').setReadOnly(false);
record.getField('manufacturer').setReadOnly(false);
}
}
//加载时调用(grid,table,gridBox)
window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_grid_query'] = function(ds, qpara, bp_seq) {
var gridId= ds.bindname+'_ds';
$(gridId).setQueryParameter('project_lease_item_id', '${/parameter/@project_lease_item_id}');
};
//删除
window['${/parameter/@layout_code}_user_button2_layout_dynamic_click'] = function() {
var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'prj_project_lease_data_temp');
var record = $(ds_id);
var records = record.getSelected();
var len = records.length;
if (len == 0) {
Leaf.showMessage('${l:PROMPT}','请选择一条记录!');
return;
}
Leaf.showConfirm('提示', '您确认提交吗', function() {
for (var i = 0;i < records.length;i++) {
$(ds_id).remove(records[i]);
}
});
};
//保存
window['${/parameter/@layout_code}_user_button3_layout_dynamic_click'] = function() {
debugger;
var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'],'prj_project_lease_data_temp');
var record=$(ds_id).getAt(0);
var records = $(ds_id).getAll();
debugger;
var set_number='${/parameter/@set_number}';
var lease_num=record.get('lease_num');
if (set_number!=lease_num){
Leaf.showMessage('${l:PROMPT}','保存数量与台数不一致!');
return;
}
//设备编号不能重复
for (var a = 0; a < records.length; a++) {
var record_a = records[a];
var num = 0;
for (var b = 0; b < records.length; b++) {
var record_b = records[b];
if (record_a.get('asset_num') == record_b.get('asset_num') ) {
num = num + 1;
}
if (num > 1) {
Leaf.showMessage('提示信息', '设备编号不能重复,请检查!');
return false;
}
}
}
var param = {};
param['session_id'] = '${/session/@session_id}';
param['user_id'] = '${/session/@user_id}';
param['project_lease_item_id']='${/parameter/@project_lease_item_id}';
if($(ds_id).validate()){
Leaf.request({
url: $('prj501N_lease_item_list_save_link').getUrl(),
para:param,
success: function() {
Leaf.SideBar.show({
msg: '操作成功',
duration: 2000
});
},
error: function() {
},
failure: function() {},
scope: this
});
}
};
]]></script>
<a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/>
</a:view>
</a:screen>
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: SC
$Date: 2022年11月23日15:14:31
$Revision: 1.0
$Purpose:
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application">
<a:view>
<script type="text/javascript"><![CDATA[
function saveClick(){
if (document.getElementById('importFile').value){
var fileName = document.getElementById('importFile').value;
var fileType = fileName.substr(fileName.lastIndexOf("."));
if (fileType != '.xls' && fileType != '.xlsx' && fileType != '.xlsm') {
alert('请选择正确的导入文件!');
} else {
document.getElementById('importForm').submit();
}
}
}
]]></script>
<a:dataSets>
<a:dataSet id="label_ds" autoCreate="true">
<a:fields>
<a:field name="label2" defaultValue="1、 严格按照导入模板整理数据,检查必输事项是否缺少数据。"/>
<a:field name="label3" defaultValue="2、 关闭Excel文件后,方可进行产品主数据导入。"/>
<a:field name="label4" defaultValue="3、 本导入程序只支持Office Excel。"/>
<a:field name="label5" defaultValue="仔细阅读上述事项,并检查确认无误。"/>
<a:field name="label6" defaultValue="导入完毕后,请在系统内核实数据是否导入成功。"/>
</a:fields>
</a:dataSet>
</a:dataSets>
<a:fieldSet style="margin-left:10px;margin-top:10px;" title="导入注意事项" width="400">
<a:label name="label2" bindTarget="label_ds" style="margin-left:10px;" width="380"/>
<a:label name="label3" bindTarget="label_ds" style="margin-left:10px;" width="380"/>
<a:label name="label4" bindTarget="label_ds" style="margin-left:10px;" width="380"/>
<a:label name="label5" bindTarget="label_ds" style="color:#055A78;font-weight:bold;margin-left:10px;" width="380"/>
<a:label name="label6" bindTarget="label_ds" style="color:#055A78;font-weight:bold;margin-left:10px;" width="380"/>
</a:fieldSet>
<a:fieldSet style="margin-left:10px;margin-top:10px;" title="导入文件" width="400">
<form name="upload" id="importForm" action="prj_project_lease_import.lview?set_number=${/parameter/@set_number}&amp;project_lease_item_id=${/parameter/@project_lease_item_id}&amp;lease_item_id=${/parameter/@lease_item_id}&amp;_csrf=${/session/@_csrf.token}" enctype="multipart/form-data" method="post">
<label style="margin-left:10px;margin-top:10px;"><![CDATA[请选择文件:]]></label>
<input name="CONTENT" id="importFile" style="margin-bottom:4px;width:160px;height:22px;" type="file"/>
<input onclick="saveClick()" style="margin-left:50px;margin-top:10px;width:60px;" type="button" value="导入"/>
</form>
</a:fieldSet>
</a:view>
</a:screen>
......@@ -15,6 +15,7 @@
model="zjwfl.sys_role_flag" rootPath="role_flag_path"/>
<a:model-query fetchAll="true" model="prj.PRJ500D.user_agent_description" rootPath="user_agent_description"/>
<a:model-query fetchAll="true" model="prj.PRJ500D.prj_project_get_description" rootPath="description"/>
<a:model-query fetchAll="true" model="prj.PRJ500D.prj_project_residual_value" rootPath="residual_value"/>
<s:server-script import="contract_print_path.js"><![CDATA[
$ctx.parameter.file_path = con_print_path['con_print_path'];
$ctx.parameter.tomcat_source = con_print_path['tomcat_source'];
......@@ -52,6 +53,9 @@
<a:link id="${/parameter/@layout_code}_get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code"
modelaction="update"/>
<a:link id="${/parameter/@layout_code}lease_number_query_link"
url="${/request/@context_path}/modules/prj/PRJ501N/prj_project_lease_import_details.lview"/>
<!-- <script src="${/request/@context_path}/modules/prj/PRJ500N/javascripts/check_org_code.js" type="text/javascript"/> -->
<!-- <a:link id="prj_project_create_con_id" model="prj.PRJ513N.prj_peoject_create_con" modelaction="update"/> -->
<a:link id="${/parameter/@layout_code}_prj_project_create_contract_link_id"
......@@ -437,6 +441,19 @@
}
function prj501n_lease_number_renderer(record_id, ds_id){
var record = $(ds_id).findById(record_id);
var param = {};
param['project_lease_item_id'] = record.get('project_lease_item_id');
param['lease_item_id'] = record.get('lease_item_id');
param['set_number'] = record.get('set_number');
param['function_code'] = 'PRJ501INC';
param['function_usage'] = 'UPDATE';
param['winid'] = '${/parameter/@layout_code}_project_number_win_id';
param['url_title'] = '租赁物清单';
hls_doc_get_layout_code('${/parameter/@layout_code}_get_layout_code_link_id', param, '${/parameter/@layout_code}lease_number_query_link', record.ds.id, '${/parameter/@layout_code}');
}
//超链接渲染
window['${/parameter/@layout_code}_dynamic_link_renderer'] = function (value, record, name, config_record) {
var link_function = '';
......@@ -509,6 +526,9 @@
} else if (name == 'contract_number') {
link_function = 'prj501n_contract_number_renderer';
return '<a href="javascript:window[\'' + link_function + '\'](\'' + record.id + '\',\'' + name + '\',\'' + config_record.get('query_only') + '\');">' + value + '</a>';
}else if(name=='machine_number_n'){
link_function = 'prj501n_lease_number_renderer';
return '<a href="javascript:window[\'' + link_function + '\'](\'' + record.id + '\',\'' + record.ds.id + '\')">' + '查看明细' + '</a>';
}
};
......@@ -611,7 +631,6 @@
var tenant_ds_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'F_BASIC_INFO_1', 'prj_project');
if(tenant_ds_id == ds.id&&tenant_ds_id){
if(name == 'send_message_n'){
if(value=='是'){
record.getField('cell_phone').setRequired(true);
......@@ -619,11 +638,9 @@
record.getField('cell_phone').setRequired(false);
}
}
}
if (lease_item_ds_id == ds.id && lease_item_ds_id) {
if(division=='70'){
record.getField('lease_name_n').setRequired(true);
......@@ -896,16 +913,17 @@
//加载时调用(grid,table,gridBox)
window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_grid_load'] = function (ds, record, config_records, bp_seq) {
var bp_ds_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'G_BP', 'prj_project_bp');
var lease_item_ds_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'G_LEASE_HEAD_CAR', 'prj_project_lease_item');
/* var bp_ds_ids = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'],'F_HISTORY_INFO_1', 'prj_project_bp');
$(bp_ds_ids).setQueryParameter('bp_id','${/parameter/@bp_id_tenant}');
$(bp_ds_ids).query(); */
if(lease_item_ds_id == ds.id &&lease_item_ds_id){
var gridId= ds.bindname+'_layout_grid_id';
if(division!='30' && division!='50'){
$(gridId).hideColumn('machine_number_n');
}
if(division=='70'&&division!=''){
//debugger;
if(record!=''){
......@@ -1555,6 +1573,23 @@
}
if ($(ds_id).validate()) {
Leaf.showConfirm('${HLS.PROMPT}', '确认要提交工作流吗?', function () {
var lease_ds_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'F_QUOTATION_N', 'prj_quotation');
var ds_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'G_LEASE_HEAD_CAR', 'prj_project_lease_item');
if(division=='30'||division=='50'){
var record=$(lease_ds_id).getCurrentRecord();
var records=$(ds_id).getCurrentRecord();
var total_price=records.get('total_price');
var lease_item_amount=record.get('lease_item_amount');
var residual_value=record.get('residual_value');
var q_value='${/model/residual_value/record/@residual_value}';
if(total_price!=lease_item_amount){
Leaf.showMessage('${l:PROMPT}', '支付计划页面“设备价格”字段值与租赁物明细“设备单价(总)”合计不相等,无法进行提交!');
return;
}else if(q_value!=residual_value){
Leaf.showMessage('${l:PROMPT}', '支付计划中留购价与报价计算不一致,无法提交审批!');
return;
}
}
window['${/parameter/@layout_code}_lock_layout_dynamic_window']();
Leaf.request({
url: $('prj_approval_link_id').getUrl(),
......@@ -1591,6 +1626,24 @@
} else {
if ($(ds_id).validate()) {
Leaf.showConfirm('${HLS.PROMPT}', '确认要提交工作流吗?', function () {
var lease_ds_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'F_QUOTATION_N', 'prj_quotation');
var ds_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'G_LEASE_HEAD_CAR', 'prj_project_lease_item');
if(division=='30'||division=='50'){
var record=$(lease_ds_id).getCurrentRecord();
var records=$(ds_id).getCurrentRecord();
var total_price=records.get('total_price');
var lease_item_amount=record.get('lease_item_amount');
var residual_value=record.get('residual_value');
var q_value='${/model/residual_value/record/@residual_value}';
if(total_price!=lease_item_amount){
Leaf.showMessage('${l:PROMPT}', '支付计划页面“设备价格”字段值与租赁物明细“设备单价(总)”合计不相等,无法进行提交!');
return;
}else if(q_value!=residual_value){
Leaf.showMessage('${l:PROMPT}', '支付计划中留购价与报价计算不一致,无法提交审批!');
return;
}
}
window['${/parameter/@layout_code}_lock_layout_dynamic_window']();
Leaf.request({
url: $('prj_approval_link_id').getUrl(),
......
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