Commit 48a830ef authored by Darming's avatar Darming

[feat]租赁物GPS信息管理

parent 0018e840
...@@ -13,42 +13,33 @@ ...@@ -13,42 +13,33 @@
hd.created_by, hd.created_by,
li.source_table, li.source_table,
li.attribute_1, li.attribute_1,
(select cc.contract_name
from con_contract cc
where cc.contract_number = li.attribute_1) contract_name,
li.attribute_2, li.attribute_2,
li.attribute_3, li.attribute_3,
li.attribute_4, li.attribute_4,
li.attribute_5, li.attribute_5,
(select cc.lease_start_date
from con_contract cc
where cc.contract_number = li.attribute_1) lease_start_date,
li.attribute_6, li.attribute_6,
li.attribute_7, round(li.attribute_7,2) attribute_7,
trim(to_char(round(li.attribute_8,1),'999999999999990.99')) attribute_8, round(li.attribute_8,2) attribute_8,
trim(to_char(round(li.attribute_8 /
to_char(last_day(sysdate), 'dd'),
1),
'999999999999990.99')) average_hour,
li.attribute_9, li.attribute_9,
li.attribute_10, li.attribute_10,
li.attribute_11, li.attribute_11,
li.attribute_12 li.attribute_12,
nvl((select 'Y' from dual where exists(select 1 from con_lease_item_gps cli,con_contract cc where period = to_char(to_date(li.ATTRIBUTE_6,'yyyy-mm'),'yyyy-mm')
and cli.contract_id = cc.contract_id and cc.contract_number = li.ATTRIBUTE_1)),'N') exists_flag
FROM fnd_interface_headers hd, fnd_interface_lines li FROM fnd_interface_headers hd, fnd_interface_lines li
WHERE hd.header_id = li.header_id WHERE hd.header_id = li.header_id
AND hd.template_code = 'HLS_LEASE_ITEM_GPS_IMPORT' AND hd.template_code = 'HLS_LEASE_ITEM_GPS_IMPORT'
AND li.line_number > 0 AND li.line_number > 0
AND li.source_table = 'GPS'
AND HD.CREATED_BY = ${/session/@user_id} AND HD.CREATED_BY = ${/session/@user_id}
AND hd.header_id=${/parameter/@header_id}) t1 AND hd.header_id=${/parameter/@header_id}) t1
order by t1.line_number order by t1.line_number
]]> ]]>
</bm:query-sql> </bm:query-sql>
</bm:operation> </bm:operation>
<bm:operation name="update"> <bm:operation name="execute">
<bm:update-sql><![CDATA[ <bm:update-sql><![CDATA[
begin begin
hls_lease_item_gps_import_pkg.gps_import_check(p_header_id => ${@header_id}, con_lease_item_gps_pkg.gps_import_check(p_header_id => ${/model/header/record/@header_id},
p_user_id => ${/session/@user_id}); p_user_id => ${/session/@user_id});
end; end;
]]> ]]>
...@@ -57,22 +48,31 @@ ...@@ -57,22 +48,31 @@
<bm:operation name="insert"> <bm:operation name="insert">
<bm:update-sql><![CDATA[ <bm:update-sql><![CDATA[
BEGIN BEGIN
hls_lease_item_gps_import_pkg.gps_import( con_lease_item_gps_pkg.gps_import(
p_contract_number => ${@contract_number}, p_header_id => ${@header_id},
p_machine_model => ${@machine_model},
p_machine_number => ${@machine_number},
p_interval_date => ${@interval_date},
p_working_hours_latest=> ${@working_hours_latest},
p_working_hours_new_m => ${@working_hours_new_m},
p_working_hours_ave_m => ${@working_hours_ave_m},
p_machine_location => ${@machine_location},
p_note => ${@note},
p_attention => ${@attention},
p_machine_number_full=> ${@machine_number_full},
p_user_id => ${/session/@user_id}); p_user_id => ${/session/@user_id});
END; END;
]]> ]]>
</bm:update-sql> </bm:update-sql>
</bm:operation> </bm:operation>
</bm:operations> </bm:operations>
<bm:fields>
<bm:field name="error_message"/>
<bm:field name="status"/>
<bm:field name="header_id"/>
<bm:field name="line_number"/>
<bm:field name="attribute_1"/>
<bm:field name="attribute_2"/>
<bm:field name="attribute_3"/>
<bm:field name="attribute_4"/>
<bm:field name="attribute_5"/>
<bm:field name="attribute_6"/>
<bm:field name="attribute_7"/>
<bm:field name="attribute_8"/>
<bm:field name="attribute_9"/>
<bm:field name="attribute_10"/>
<bm:field name="attribute_11"/>
<bm:field name="attribute_12"/>
<bm:field name="exists_flag"/>
</bm:fields>
</bm:model> </bm:model>
var override_queryfields = [
{
name: 'period_from',
queryexpression: "t1.period >= ${@period_from} "
},
{
name: 'period_to',
queryexpression: "t1.period <= ${@period_to} "
}
];
var add_datafilters = [];
override();
add_datafilter();
var override_queryfields = [
{
name: 'period_from',
queryexpression: "t1.period >= ${@period_from} "
},
{
name: 'period_to',
queryexpression: "t1.period <= ${@period_to} "
}
];
var add_datafilters = [];
override();
add_datafilter();
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
var fileName = document.getElementById('importFile').value; var fileName = document.getElementById('importFile').value;
var fileType = fileName.substr(fileName.lastIndexOf(".")); var fileType = fileName.substr(fileName.lastIndexOf("."));
if (fileType != '.xls' && fileType != '.xlsx' && fileType != '.xlsm') { if (fileType != '.xls' && fileType != '.xlsx' && fileType != '.xlsm') {
alert('${l:SELECT_CORRECT_IMPORT_FILE}'); Leaf.showInfoMessage('提示', '${l:SELECT_CORRECT_IMPORT_FILE}');
} else { } else {
doSubmit(); doSubmit();
} }
...@@ -19,16 +19,16 @@ ...@@ -19,16 +19,16 @@
var _input_window; var _input_window;
function doSubmit() {debugger; function doSubmit() {
_input_window = new $L.Window({ _input_window = new $L.Window({
title: '${l:HLS.IMPORT}', title: '${l:HLS.IMPORT}',
width: 1100, width: 1100,
height: 400 height: 600
}); });
new Ext.Template('<iframe id ="_input_window" name="_input_window" border="0" frameborder="0" height="100%" width="100%" style="border:none;padding:0px;margin:0px;"></iframe>').insertFirst(_input_window.body.dom, {}, true); new Ext.Template('<iframe id ="_input_window" name="_input_window" border="0" frameborder="0" height="100%" width="100%" style="border:none;padding:0px;margin:0px;"></iframe>').insertFirst(_input_window.body.dom, {}, true);
var form = document.getElementById('importForm'); var form = document.getElementById('importForm');
var url = '${/request/@context_path}/modules/hls/HLS204N/hls_lease_item_gps_excel_import.lview?session_id=${/parameter/@session_id}&winid=${/parameter/@winid}&batch_id=${/parameter/@batch_id}&_csrf=${/session/@_csrf.token}'; //var url = '${/request/@context_path}/modules/hls/HLS204N/hls_lease_item_gps_excel_import.lview?session_id=${/parameter/@session_id}&winid=${/parameter/@winid}&batch_id=${/parameter/@batch_id}&_csrf=${/session/@_csrf.token}';
form.action = url; //form.action = url;
form.submit(); form.submit();
$('${/parameter/@winid}').close(); $('${/parameter/@winid}').close();
_input_window.on('close', function () { _input_window.on('close', function () {
...@@ -62,7 +62,7 @@ ...@@ -62,7 +62,7 @@
</a:fieldSet> </a:fieldSet>
<a:fieldSet style="margin-left:10px;margin-top:10px;" title="TMPLT_IMPORT_FILE" width="400"> <a:fieldSet style="margin-left:10px;margin-top:10px;" title="TMPLT_IMPORT_FILE" width="400">
<form name="upload" id="importForm" <form name="upload" id="importForm"
action="modules/hls/HLS204N/hls_lease_item_gps_excel_import.lview?session_id=${/parameter/@session_id}&amp;project_id=${/parameter/@project_id}&amp;parent_ds_id=${/parameter/@parent_ds_id}&amp;type=${/parameter/@type}&amp;_csrf=${/session/@_csrf.token}" action="${/request/@context_path}/modules/hls/HLS204N/hls_lease_item_gps_excel_import.lview?session_id=${/parameter/@session_id}&amp;parent_ds_id=${/parameter/@parent_ds_id}&amp;_csrf=${/session/@_csrf.token}"
enctype="multipart/form-data" method="post" target="_input_window"> enctype="multipart/form-data" method="post" target="_input_window">
<label style="margin-left:10px;margin-top:10px;font-size:13px"><![CDATA[${l:PLEASE_SELECT_A_FILE}]]></label> <label style="margin-left:10px;margin-top:10px;font-size:13px"><![CDATA[${l:PLEASE_SELECT_A_FILE}]]></label>
<input name="CONTENT" id="importFile" style="font-size:15px" type="file"/> <input name="CONTENT" id="importFile" style="font-size:15px" type="file"/>
......
...@@ -9,12 +9,13 @@ ...@@ -9,12 +9,13 @@
<a:init-procedure/> <a:init-procedure/>
<a:view> <a:view>
<a:link id="BmLink_MainScreen_functionHit" model="sys.sys_page_function_visit" modelaction="update"/> <a:link id="BmLink_MainScreen_functionHit" model="sys.sys_page_function_visit" modelaction="update"/>
<a:link id="hls_lease_item_gps_import_link" url="${/request/@context_path}/modules/hls/HLS204N/hls_lease_item_gps_import.lview"/> <a:link id="hls_lease_item_gps_import_link"
url="${/request/@context_path}/modules/hls/HLS204N/hls_lease_item_gps_import.lview"/>
<script><![CDATA[ <script><![CDATA[
//导入按钮 //导入按钮
window['${/parameter/@layout_code}_user_button1_layout_dynamic_click'] = function () {debugger; window['${/parameter/@layout_code}_user_button1_layout_dynamic_click'] = function () {
var url_l = $('hls_lease_item_gps_import_link').getUrl(); var url_l = $('hls_lease_item_gps_import_link').getUrl();
var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract_lease_item'); var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_lease_item_gps');
var win = new Leaf.Window({ var win = new Leaf.Window({
id: 'hls_lease_item_gps_import_link_win', id: 'hls_lease_item_gps_import_link_win',
url: url_l, url: url_l,
...@@ -25,12 +26,23 @@ ...@@ -25,12 +26,23 @@
}, },
title: '导入', title: '导入',
width: 420, width: 420,
height: 390 height: 320
}); });
win.on('close', function () { win.on('close', function () {
$(ds_id).query(); $(ds_id).query();
}); });
} };
//加载事件
window['${/parameter/@layout_code}_on_layout_dynamic_form_add_and_load'] = function(ds, record, config_records, bp_seq) {
var ds_id = '${/parameter/@layout_code}_F_QUERY__ds';
debugger;
var r = $(ds_id).getAt(0);
r.set('period_from',new Date().format('yyyy-mm').toString());
r.set('period_from_n',new Date().format('yyyy-mm').toString());
r.set('period_to',new Date().format('yyyy-mm').toString());
r.set('period_to_n',new Date().format('yyyy-mm').toString());
};
]]></script> ]]></script>
<a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/> <a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/>
......
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