Commit 84112fce authored by 38823's avatar 38823

销项发票维护调整

parent af0bf72c
......@@ -111,6 +111,26 @@
});
}
$('acr512_invoice_result_ds').query();
for (var j = 0; j < record_op.length; i++) {
var record_op = record_op[j];
var invoice_hd_id = record_op.get('invoice_hd_id');
Leaf.request({
url: $('get_document_number_link').getUrl(),
para: {
invoice_hd_id: invoice_hd_id
},
success: function (res) {
var document_number = record_op[i].get('document_number');
if (res.result.record['isreturn'] > 0) {
return '<font color="red">' + document_number + '</font> ';
} else {
return value;
}
}
});
}
$('acr512_invoice_op_result_ds').query();
}
function acr512_invoice_reset() {
......@@ -138,8 +158,29 @@
}
}
function acr512_op_grid_update(record_id, invoice_hd_id) {
var maintain_type = 'UPDATE';
var currency_reocrd = $('acr512_invoice_op_result_ds').findById(record_id);
var param = currency_reocrd.data;
param['function_code'] = 'ACR512';
param['winid'] = 'confirm_invoice_win';
param['document_id'] = invoice_hd_id;
param['function_usage'] = 'MODIFY';
param['maintain_type'] = maintain_type;
param['url_title'] = '${l:ACR.INVOICE_DETAIL}';
if (param['invoice_status'] == 'CONFIRMING') {
param['function_code'] = 'ACR512R';
param['function_usage'] = 'QUERY';
param['maintain_type'] = 'READONLY';
hls_doc_get_layout_code('con_contract_get_layout_code_link_id', param, 'acr512_invoice_update_page', 'acr512_invoice_op_result_ds');
} else {
hls_doc_get_layout_code('con_contract_get_layout_code_link_id', param, 'acr512_invoice_update_page', 'acr512_invoice_op_result_ds');
}
}
function acr512_document_number_render(value, record, name) {
if (name == 'document_number') {
if (name == 'document_number' && record.get('division')!='95') {
if (record.get('compare_date_flag') == 'Y') {
return '<a style="color:red" href="javascript:acr512_grid_update(\'' + record.id + '\',\'' + record.get('invoice_hd_id') + '\');">' + value + '</a>';
} else {
......@@ -147,6 +188,14 @@
}
}
if (name == 'document_number' && record.get('division')=='95') {
if (record.get('compare_date_flag') == 'Y') {
return '<a style="color:red" href="javascript:acr512_op_grid_update(\'' + record.id + '\',\'' + record.get('invoice_hd_id') + '\');">' + value + '</a>';
} else {
return '<a href="javascript:acr512_op_grid_update(\'' + record.id + '\',\'' + record.get('invoice_hd_id') + '\');">' + value + '</a>';
}
}
// return '<a href="javascript:acr512_grid_update(' + record.id + ',' + record.get('invoice_hd_id') + ',\'' + record.get('invoice_status') + '\');">' + value + '</a>';
}
......@@ -194,7 +243,15 @@
}
function acr512_invoice_delete() {
debugger;
var records = $('acr512_invoice_result_ds').getSelected();
var records_op = $('acr512_invoice_op_result_ds').getSelected();
if(records_op == ''){
$('acr512_invoice_update_grid_ds').remove();
}else {
$('acr512_invoice_op_grid_ds').remove();
}
}
//发票提交
......@@ -327,6 +384,89 @@
});
}
function acr512_op_invoice_insert() {
var records = $('acr512_invoice_op_result_ds').getSelected();
if (records.length < 1) {
Leaf.showMessage('${l:HLS.PROMPT}', '请选择需要审批的发票!');
return;
}
var datas = {};
var saveData = [];
var invoice_hd_ids = '';
var invoice_kind = records[0].get('invoice_kind');
var invoice_type = records[0].get('invoice_type');
var invoice_kind_type = records[0].get('invoice_kind_type');
var full_elec_invoice_flag = records[0].get('full_elec_invoice_flag');
for (var i = 0; i < records.length; i++) {
var invoice_status = records[i].get('invoice_status');
if (invoice_status != 'NEW' && invoice_status != 'REJECT') {
$L.showErrorMessage("提示", '发票状态有误!');
return;
}
if(invoice_kind != records[i].get('invoice_kind')){
$L.showErrorMessage("提示", '普票和专票不能同时勾选!');
return;
}
if(invoice_kind_type != records[i].get('invoice_kind_type')){
$L.showErrorMessage("提示", '纸质发票与电子发票不能同时勾选!');
return;
}
if(full_elec_invoice_flag != records[i].get('full_elec_invoice_flag')){
$L.showErrorMessage("提示", '全电发票与非全电发票不能同时勾选!');
return;
}
if (invoice_hd_ids == '') {
invoice_hd_ids = records[i].get('invoice_hd_id');
} else {
invoice_hd_ids = invoice_hd_ids + ',' + records[i].get('invoice_hd_id');
}
records[i].set('_status', 'update');
saveData.push(records[i].data);
}
saveData.sort(function (a, b) {
return a.invoice_hd_id - b.invoice_hd_id;
});
datas['invoice_hd_ids'] = invoice_hd_ids;
datas['apply_mode'] = 'APPLY';
datas['details'] = saveData;
Leaf.showConfirm('提示', '<span style="color: #ff0000; ">发票在申请期间将无法进行修改操作!如需要取消发票申请,请点击取消申请!</span>', function () {
lock_current_window();
Leaf.request({
url: $('acr512_update_for_submit_id').getUrl(),
para: datas,
success: function (res) {
Leaf.SideBar.show({
msg: '申请成功',
duration: 3000
});
unlock_current_window();
//$('acr512_invoice_result_ds').query();
var win = new Leaf.Window({
id: 'acr_invoice_apply_detail_link_winid',
params: {
invoice_apply_id: res.result.invoice_apply_id,
winId: 'acr_invoice_apply_detail_link_winid'
},
url: $('acr_invoice_apply_detail_link').getUrl(),
title: '申请明细',
fullScreen: true
});
win.on('close',function(){
$('acr512_invoice_op_result_ds').query();
});
},
failure: function () {
unlock_current_window();
},
error: function () {
unlock_current_window();
},
scope: this
});
});
}
]]></script>
<a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/>
<a:dataSets>
......@@ -429,7 +569,8 @@
<a:toolbarButton click="acr512_invoice_reset" text="HLS.RESET"/>
<a:toolbarButton click="acr512_invoice_delete" text="HLS.REMOVE"/>
<!--<a:toolbarButton click="acr512_invoice_submit_selected" text="提交复核"/>-->
<a:toolbarButton click="acr512_invoice_insert" text="新建申请"/>
<a:toolbarButton click="acr512_invoice_insert" text="融租新建申请"/>
<a:toolbarButton click="acr512_op_invoice_insert" text="经租新建申请"/>
<!--
<a:toolbarButton click="acr512_invoice_submit" text="HLS.SUBMIT"/>
-->
......
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