Commit 518e4a52 authored by gzj34291's avatar gzj34291 Committed by 王炜

付款第三方

(cherry picked from commit 32ab2c84)
parent 03e9d3b5
......@@ -7,6 +7,7 @@
<a:view>
<a:link id="csh_payment_req_create_link" url="${/request/@context_path}/modules/csh/CSH501/csh_payment_req_selected.lview"/>
<a:link id="csh_payment_req_history_print_link_id" url="${/request/@context_path}/modules/csh/CSH501/csh_payment_req_history_pdf_print.lsc"/>
<a:link id="csh_payment_req_history_word_link_id" url="${/request/@context_path}/modules/csh/CSH501/csh_payment_req_history_word_print.lsc"/>
<a:link id="get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code" modelaction="update"/>
<a:link id="tre_loan_contact_cancel_change_link_id" model="lon.LON120.tre_loan_change_cancel"
modelaction="update"/>
......@@ -16,7 +17,7 @@
<script type="text/javascript"><![CDATA[
Leaf.onReady(function () {
//付款打印按钮只有会计担当和会计部长可见
if ("${/model/role_info/record/@role_code}" != "0013" && "${/model/role_info/record/@role_code}" != "0014" && "${/model/role_info/record/@role_code}" != "0010") {
if ("${/model/role_info/record/@role_code}" != "0013" && "${/model/role_info/record/@role_code}" != "0014" && "${/model/role_info/record/@role_code}" != "0010"&& "${/model/role_info/record/@role_code}" != "0006") {
//$('${/parameter/@layout_code}_user_button5').style.display='none';
Ext.fly('${/parameter/@layout_code}_user_button5').dom.style.display = "none";
} else {
......@@ -35,11 +36,22 @@
//获取该付款申请的头id
var payment_req_id = records[0].get('payment_req_id');
var payment_status = records[0].get('approval_status');
var division = records[0].get('con_division');
if (payment_status != "APPROVED") {
$L.showInfoMessage("提示", '只有审批通过的付款申请才能打印,且一次只能打印一个付款申请!');
return;
}
var url_l = $('csh_payment_req_history_print_link_id').getUrl() + '?document_id=' + payment_req_id + '&document_table=CSH_PAYMENT_APPROVE&file_path=${/parameter/@file_path}&batch_flag=Y&source_type=COMMON';
// var url_l = $('csh_payment_req_history_print_link_id').getUrl() + '?document_id=' + payment_req_id + '&document_table=CSH_PAYMENT_APPROVE&file_path=${/parameter/@file_path}&batch_flag=Y&source_type=COMMON';
// window.open(href = url_l, target = "_self");
if(division == '30' || division == '50'){
var url_l = $('csh_payment_req_history_word_link_id').getUrl() + '?document_id=' + payment_req_id + '&document_table=CSH_PAYMENT_APPROVE&file_path=${/parameter/@file_path}&batch_flag=Y&source_type=COMMON';
}else{
var url_l = $('csh_payment_req_history_print_link_id').getUrl() + '?document_id=' + payment_req_id + '&document_table=CSH_PAYMENT_APPROVE&file_path=${/parameter/@file_path}&batch_flag=Y&source_type=COMMON';
}
window.open(href = url_l, target = "_self");
};
......
......@@ -101,10 +101,36 @@
dirty_flag = 'Y';
var hdds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'csh_payment_req_hd');
var lnds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'csh_payment_req_ln');
hd_ds = $(hdds_id);
var hdrecord = hd_ds.getCurrentRecord();
var bank_account_name = hdrecord.get('third_bp_id_n');
var vender_bank_account_id = hdrecord.get('t_bank_account_id');
var bank_account_num = hdrecord.get('t_bank_account_num');
var hd_ds, ln_ds, lineRecords, currency_code, currency_name;
if (hdds_id) {
hd_ds = $(hdds_id);
hdrecord = hd_ds.getCurrentRecord();
if((name == 't_bank_account_name'||name == 't_bank_account_name_n') && !Ext.isEmpty(hdrecord.get('t_bank_account_name_n')) && !Ext.isEmpty(hdrecord.get('third_bp_id_n'))){
var records = $(lnds_id).getAll();
for (var i = 0; i < records.length; i++) {
records[i].set('vender_bank_account_number', bank_account_num);
records[i].set('vender_bank_account_number_n', bank_account_num);
records[i].set('vender_bank_account_name', bank_account_name);
records[i].set('vender_bank_account_id', vender_bank_account_id);
records[i].getField('vender_bank_account_number').setReadOnly(true);
records[i].getField('vender_bank_account_number_n').setReadOnly(true);
}
}
if((name == 'third_bp_id'||name == 'third_bp_id_n') && (Leaf.isEmpty(record.get('document_number_t')) || bank_account_name=='')){
var records = $(lnds_id).getAll();
hdrecord.set('t_bank_account_num',null);
hdrecord.set('t_bank_branch_name',null);
hdrecord.set('t_bank_full_name',null);
hdrecord.set('t_bank_account_id',null);
for (var i = 0; i < records.length; i++) {
records[i].getField('vender_bank_account_number').setReadOnly(false);
records[i].getField('vender_bank_account_number_n').setReadOnly(false);
}
}
}
if (lnds_id && $L.CmpManager.get(lnds_id)) {
ln_ds = $(lnds_id);
......@@ -156,6 +182,21 @@
hd_ds = $(hdds_id);
hdrecord = hd_ds.getCurrentRecord();
}
if (ds.id == ds_id) {
var handrecord = $(hdds_id).getCurrentRecord();
if (!Ext.isEmpty(handrecord)) {
var bank_account_name = handrecord.get('third_bp_id_n');
if (!Ext.isEmpty(hdrecord.get('third_bp_id_n'))) {
var records = $(ds_id).getAll();
for (var i = 0; i < records.length; i++) {
records[i].getField('vender_bank_account_number').setReadOnly(true);
records[i].getField('vender_bank_account_number_n').setReadOnly(true);
}
}
}
}
if (record) {
if ('${/parameter/@function_code}' == 'CSH502D') {
record.getField('pay_amount').setReadOnly(false);
......@@ -182,7 +223,6 @@
}
}
if (con_business_type == 'LEASEBACK'){
debugger
if ('${/parameter/@division}' ==91||'${/parameter/@division}' =='神钢建机'){
var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'csh_payment_req_ln');
var records = $(ds_id).getAll();
......@@ -222,13 +262,9 @@
ln_record.getField('tenant_bank_account_number').setRequired(false);
ln_record.getField('tenant_bank_account_number_n').setRequired(false);
}
}
}
if ('${/parameter/@division}' ==91||'${/parameter/@division}' =='神钢建机'||'${/parameter/@division}' ==92||'${/parameter/@division}' =='北京卡家' ){
debugger
if (con_business_type == 'LEASEBACK'){
var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'csh_payment_req_ln');
var records = $(ds_id).getAll();
......@@ -294,7 +330,6 @@
//打印
function csh501_print() {
debugger
var hdds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'csh_payment_req_hd');
var hd_record = $(hdds_id).getCurrentRecord();
......@@ -343,6 +378,13 @@
var head_record = $(ds_id).getAt(0);
//高空作业车个数
var gk_contract_num = 0;
if(!Ext.isEmpty(head_record.get('t_bank_account_id'))){
for (var i = 0; i < line_datas.length; i++) {
var line_data = line_datas[i];
line_data.set('vender_bank_account_id',head_record.get('t_bank_account_id'));
}
}
for (var i = 0; i < line_datas.length; i++) {
var line_data = line_datas[i];
//应付我司金额
......@@ -480,6 +522,7 @@
record.set('contract_id', '${/parameter/@contract_id}');
}
}
var head_record = $(hdds_id).getAt(0);
if (hdds_id == ds.id) {
if ('${/parameter/@function_usage}' == 'READONLY') {
......@@ -491,6 +534,26 @@
record.getField('las_compensatory_amount').setReadOnly(true);
}
}
if(head_record.get('con_division') == '30' || head_record.get('con_division') == '50'||'${/parameter/@division}' == '50' || '${/parameter/@division}' == '30'){
// record.getField('third_bp_id').setRequired(true);
// record.getField('third_bp_id_n').setRequired(true);
// record.getField('t_bank_account_name').setRequired(true);
//record.getField('t_bank_account_name_n').setRequired(true);
}else{
document.getElementById('CSH501D_PAYMENT_REQ_HD_CSH_PAYMENT_REQ_HD_THIRD_BP_ID_prompt').style.display = 'none';
document.getElementById('CSH501D_PAYMENT_REQ_HD_CSH_PAYMENT_REQ_HD_THIRD_BP_ID').style.display = 'none';
document.getElementById('CSH501D_PAYMENT_REQ_HD_CSH_PAYMENT_REQ_HD_T_BANK_ACCOUNT_NAME_prompt').style.display = 'none';
document.getElementById('CSH501D_PAYMENT_REQ_HD_CSH_PAYMENT_REQ_HD_T_BANK_ACCOUNT_NAME').style.display = 'none';
document.getElementById('CSH501D_PAYMENT_REQ_HD_CSH_PAYMENT_REQ_HD_T_BANK_ACCOUNT_NUM_prompt').style.display = 'none';
document.getElementById('CSH501D_PAYMENT_REQ_HD_CSH_PAYMENT_REQ_HD_T_BANK_ACCOUNT_NUM').style.display = 'none';
document.getElementById('CSH501D_PAYMENT_REQ_HD_CSH_PAYMENT_REQ_HD_T_BANK_FULL_NAME_prompt').style.display = 'none';
document.getElementById('CSH501D_PAYMENT_REQ_HD_CSH_PAYMENT_REQ_HD_T_BANK_FULL_NAME').style.display = 'none';
document.getElementById('CSH501D_PAYMENT_REQ_HD_CSH_PAYMENT_REQ_HD_T_BANK_BRANCH_NAME_prompt').style.display = 'none';
document.getElementById('CSH501D_PAYMENT_REQ_HD_CSH_PAYMENT_REQ_HD_T_BANK_BRANCH_NAME').style.display = 'none';
}
}
};
//保存submitsuccess调用
......
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