Commit 9650c7a1 authored by gzj34291's avatar gzj34291

租赁物导入

parent 300a06d6
...@@ -6,6 +6,9 @@ ...@@ -6,6 +6,9 @@
$Purpose: $Purpose:
--> -->
<a:screen xmlns:a="http://www.leaf-framework.org/application" customizationEnabled="true" dynamiccreateenabled="true" trace="true"> <a:screen xmlns:a="http://www.leaf-framework.org/application" customizationEnabled="true" dynamiccreateenabled="true" trace="true">
<a:init-procedure>
<a:model-query model="cont.CON620.get_sys_role" rootPath="role_info"/>
</a:init-procedure>
<a:view> <a:view>
<a:link id="prj501N_lease_item_list_delete_link" model="prj.PRJ500N.prj_project_lease_item_delete" modelaction="update"/> <a:link id="prj501N_lease_item_list_delete_link" model="prj.PRJ500N.prj_project_lease_item_delete" modelaction="update"/>
<a:link id="prj501N_lease_item_list_update_link" model="prj.PRJ500N.prj_project_lease_import_temp" modelaction="batch_update"/> <a:link id="prj501N_lease_item_list_update_link" model="prj.PRJ500N.prj_project_lease_import_temp" modelaction="batch_update"/>
...@@ -16,7 +19,7 @@ ...@@ -16,7 +19,7 @@
Leaf.onReady(function() { Leaf.onReady(function() {
var status='${/parameter/@project_status}'; var status='${/parameter/@project_status}';
if ('${/parameter/@hide_flag}' == 'Y' || status=='APPROVING' || status=='CLOSED' || status=='CONTRACT_CREATED') { if (('${/parameter/@hide_flag}' == 'Y' || status=='APPROVING' || status=='CLOSED' || status=='CONTRACT_CREATED') && ("${/model/role_info/record/@role_code}"!="0019")) {
$('PROJECT_LEASE_IMPORT_user_button1').hide(); $('PROJECT_LEASE_IMPORT_user_button1').hide();
$('PROJECT_LEASE_IMPORT_user_button2').hide(); $('PROJECT_LEASE_IMPORT_user_button2').hide();
$('PROJECT_LEASE_IMPORT_user_button4').hide(); $('PROJECT_LEASE_IMPORT_user_button4').hide();
...@@ -45,21 +48,32 @@ ...@@ -45,21 +48,32 @@
window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_grid_load'] = function (ds, record, config_records, bp_seq) { window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_grid_load'] = function (ds, record, config_records, bp_seq) {
if('${/parameter/@project_status}'!='NEW' && record!=''){ if('${/parameter/@project_status}'!='NEW' && record!='' && "${/model/role_info/record/@role_code}"!="0019"){
record.getField('seq').setReadOnly(true); record.getField('seq').setReadOnly(true);
record.getField('asset_num').setReadOnly(true); record.getField('asset_num').setReadOnly(true);
record.getField('asset_type').setReadOnly(true); record.getField('asset_type').setReadOnly(true);
record.getField('asset_type_n').setReadOnly(true); record.getField('asset_type_n').setReadOnly(true);
record.getField('asset_name').setReadOnly(true);
record.getField('asset_name').setReadOnly(true);
record.getField('asset_name_n').setReadOnly(true); record.getField('asset_name_n').setReadOnly(true);
record.getField('specification').setReadOnly(true); record.getField('specification').setReadOnly(true);
record.getField('posted_date').setReadOnly(true); record.getField('posted_date').setReadOnly(true);
record.getField('price').setReadOnly(true); record.getField('price').setReadOnly(true);
record.getField('manufacturer').setReadOnly(true); record.getField('manufacturer').setReadOnly(true);
}else if('${/parameter/@project_status}'=='NEW' && record!=''){ }else if('${/parameter/@project_status}'=='NEW' && record!='' ){
record.getField('asset_num').setRequired(true);
record.getField('asset_type').setRequired(true);
record.getField('asset_name').setRequired(true);
record.getField('specification').setRequired(true);
record.getField('posted_date').setRequired(true);
record.getField('price').setRequired(true);
record.getField('manufacturer').setRequired(true);
}else if(record!='' && "${/model/role_info/record/@role_code}"=="0019"){
record.getField('asset_num').setRequired(true); record.getField('asset_num').setRequired(true);
record.getField('asset_type').setRequired(true);
record.getField('asset_name').setRequired(true); record.getField('asset_type').setRequired(true);
record.getField('asset_name').setRequired(true);
record.getField('specification').setRequired(true); record.getField('specification').setRequired(true);
record.getField('posted_date').setRequired(true); record.getField('posted_date').setRequired(true);
record.getField('price').setRequired(true); record.getField('price').setRequired(true);
...@@ -75,7 +89,7 @@ ...@@ -75,7 +89,7 @@
//删除 //删除
window['${/parameter/@layout_code}_user_button2_layout_dynamic_click'] = function() { 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_item_list'); var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'prj_project_lease_item_list');
var record = $(ds_id); var record = $(ds_id);
var records = record.getSelected(); var records = record.getSelected();
var datas= record.getAll(); var datas= record.getAll();
...@@ -85,53 +99,53 @@ ...@@ -85,53 +99,53 @@
Leaf.showMessage('${l:PROMPT}','请选择一条记录!'); Leaf.showMessage('${l:PROMPT}','请选择一条记录!');
return; return;
} }
Leaf.showConfirm('提示', '您确认删除吗', function() { Leaf.showConfirm('提示', '您确认删除吗', function() {
var param_list = []; var param_list = [];
var param = {}; var param = {};
for (var i = 0; i < records.length; i++) { for (var i = 0; i < records.length; i++) {
param = records[i].data; param = records[i].data;
param['_status'] = 'update'; param['_status'] = 'update';
param_list.push(param); param_list.push(param);
} }
Leaf.request({
url: $('prj501N_lease_item_temp_batch_update_link').getUrl(),
para:param_list,
success: function() {
Leaf.SideBar.show({
msg: '操作成功',
duration: 2000
});
var count=(lens-len);
if(count==0){
success_delete_after(count);
}else{
success_delete_after(count);
}
},
error: function() {
},
failure: function() {},
scope: this
});
});
};
function success_delete_after(count){
var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'prj_project_lease_item_list');
Leaf.request({ Leaf.request({
url: $('prj501N_lease_item_temp_batch_update_link').getUrl(), url: $('prj501N_lease_item_list_delete_link').getUrl(),
para:param_list, para:{
project_lease_item_id:'${/parameter/@project_lease_item_id}',
count:count
},
success: function() { success: function() {
Leaf.SideBar.show({ $(ds_id).query();
msg: '操作成功',
duration: 2000
});
var count=(lens-len);
if(count==0){
success_delete_after(count);
}else{
success_delete_after(count);
}
}, },
error: function() { error: function() {
}, },
failure: function() {}, failure: function() {},
scope: this scope: this
}); });
});
};
function success_delete_after(count){
var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'prj_project_lease_item_list');
Leaf.request({
url: $('prj501N_lease_item_list_delete_link').getUrl(),
para:{
project_lease_item_id:'${/parameter/@project_lease_item_id}',
count:count
},
success: function() {
$(ds_id).query();
},
error: function() {
},
failure: function() {},
scope: this
});
} }
...@@ -170,22 +184,22 @@ ...@@ -170,22 +184,22 @@
param['_status'] = 'update'; param['_status'] = 'update';
param_list.push(param); param_list.push(param);
} }
Leaf.request({ Leaf.request({
url: $('prj501N_lease_item_list_update_link').getUrl(), url: $('prj501N_lease_item_list_update_link').getUrl(),
para: param_list, para: param_list,
success: function () { success: function () {
Leaf.SideBar.show({ Leaf.SideBar.show({
msg: '操作成功', msg: '操作成功',
duration: 2000 duration: 2000
}); });
submit_success_lease(); submit_success_lease();
}, },
error: function () { error: function () {
}, },
failure: function () { failure: function () {
}, },
scope: this scope: this
}); });
} }
}; };
......
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