Files
OMS/app/finance/view/settlement/verificate_detail.html
2025-12-28 23:13:25 +08:00

252 lines
11 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!--
Copyright © ShopeX http://www.shopex.cn. All rights reserved.
See LICENSE file for license details.
-->
<{capture name="header"}>
<{css app="ome" src="ome.css"}>
<{css app="ome" src="style.css"}>
<{script src="coms/autocompleter.js" app="desktop"}>
<{script src="coms/modedialog.js" app="desktop"}>
<{/capture}>
<{if !$replace}><div id="replace_main"><{/if}>
<form action='index.php?app=finance&ctl=settlement&act=doVerificate' method="post" id="do_form">
<input type="hidden" name="finder_id" value="<{$finder_id}>" />
<input type="hidden" id="replace" value="<{$replace}>" />
<div class="tableform">
<table cellspacing="0" cellpadding="0" border="0" class="orderdetails_basic">
<tbody>
<tr>
<td >
<h4>待核销账务流水</h4>
<div class="division">
<div id="replace_bill">
<table cellspacing="0" cellpadding="0" border="0" class='gridlist'>
<thead>
<tr>
<th>财务流水号</th>
<th>流水类别</th>
<th>业务订单号</th>
<th>对方名称</th>
<th>资金流向</th>
<th>收支类型</th>
<th>金额</th>
<th>到账时间</th>
<th>备注</th>
</tr>
</thead>
<tbody>
<{foreach from=$bill_data item=item key=key}>
<input name="bill_id[]" type="hidden" value="<{$item.bill_id}>" />
<tr id="replace_bill_<{$item.bill_id}>" >
<td><{$item.credential_number}></td>
<td><{$item.fee_item}></td>
<td><{$item.order_bn}></td>
<td><{$item.member}></td>
<td><{if $item.fee_type_id}>支出<{else}>收入<{/if}></td>
<td><{$item.fee_type}></td>
<td><{$item.money|cur}></td>
<td><{$item.trade_time}></td>
<td><{$item.remarks}></td>
</tr>
<{/foreach}>
</tbody>
</table>
</div>
</div>
</td>
</tr>
<tr>
<td >
<h4>关联应收/应退</h4>
<div class="division">
<div style='height:25px'><{button id="select_ar" label="选择应收/应退单" /}></div>
<div id="replace_ar">
<table cellspacing="0" cellpadding="0" border="0" class='gridlist'>
<thead>
<tr>
<th>选项</th>
<th>业务单据号</th>
<th>单据类型</th>
<th>业务订单号</th>
<th>客户/会员</th>
<th>资金流向</th>
<th>金额</th>
<th>单据创建时间</th>
<th>操作</th>
</tr>
</thead>
<tbody id="ar-section">
<{foreach from=$ar_data item=item key=key}>
<tr id="replace_ar_<{$item.ar_id}>" >
<td><input id="ar_id" name="ar_id[]" type="checkbox" value="<{$item.ar_id}>" /></td>
<td><{$item.ar_bn}></td>
<td><{$item.type}></td>
<td><{$item.order_bn}></td>
<td><{$item.member}></td>
<td><{if $item.money > 0}> 收入 <{else}> 支出 <{/if}> </td>
<td><{$item.money|cur}></td>
<td><{$item.trade_time}></td>
<td onclick="ar_delete(this);">删除</td>
</tr>
<{/foreach}>
</tbody>
</table>
</div>
</div>
</td>
</tr>
<tr>
<td >
<div align="center">
</div>
是否强制核销:<input type="radio" name="is_verification" value="1">&nbsp;&nbsp; <input type="radio" name="is_verification" value="0" checked>
</td>
</tr>
<tr>
<td >
强制核销备注:<br>
<textarea style="width:500px;height:60px;" name="verification_memo"></textarea>
</td>
</tr>
</tbody>
</table>
</div>
<div align="center">
<{button label="确认核销" class="btn btn-primary" id="btn-submit" onclick="do_submit();" }>
<{button label="关闭" class="btn btn-primary" onclick="javascript:void(window.close());" }>
</div>
</form>
<{if !$replace}></div><{/if}>
<script>
// $$('input[name=is_verification]').addEvent('click',function(){
// var disabled = false;
// if($(this).get('value') == '1') disabled = true;
// $$('input[name=ar_id[]]').each(function(item){
// console.log(item);
// item.set('disabled',disabled);
// });
// });
function do_submit(){
var is_verification = $$('input[name=is_verification]:checked').get('value');
var verification_memo = $$('textarea[name=verification_memo]').get('value');
var ar_sel = new Array();
$$('input[name=ar_id[]]').each(function(item){
if(item.checked==true)
{
ar_sel.push(item.get('value'));
}
});
if(is_verification == '1')
{
if(verification_memo == '')
{
MessageBox.error("填写核销备注!");
return;
}
}
else
{
if(ar_sel == 0)
{
MessageBox.error("请选择应收应退单!");
return;
}
}
$('btn-submit').set('disabled',true);
new Request({
url:'index.php?app=finance&ctl=settlement&act=checkVerificate',
data:$('do_form'),
method:'post',
onSuccess:function(json){
$('btn-submit').set('disabled',false);
rs = JSON.decode(json);
if(rs.status == 'fail'){
MessageBox.error(rs.msg);
}else{
var url = 'index.php?app=finance&ctl=settlement&act=confirmVerification';
new Dialog(url,{title:rs.title,width:500,height:200});
}
}
}).send();
}
function ar_delete (e) {
$(e).getParent('tr').remove();
}
function verificate_callback()
{
$('do_form').fireEvent('submit',{stop:function(){
setTimeout("opener.finderGroup['<{$env.get.finder_id}>'].refresh.delay(400,opener.finderGroup['<{$env.get.finder_id}>']);window.close();",1000);
}});
}
$('select_ar').addEvent('click',function(e){
var is_verification = $$('input[name=is_verification]:checked').get('value');
if(is_verification == '1')
{
MessageBox.error("已选择强制核销,不允许选择应收应退单!");
return;
}
var url='index.php?app=desktop&act=alertpages&goto='+encodeURIComponent('index.php?app=finance&ctl=bill&act=findar');
new finderDialog(url,{params:{url:'index.php?app=finance&ctl=bill&act=getar',name:'ar_id[]'},width:1000,height:660,
onCallback:function(rs){
if(!rs)return;
ar=JSON.decode(rs);
var td='';
var money_type = '';
for(var v=0,lena=ar.length;v<lena;v++) {
if($('replace_ar_'+ar[v]['ar_id'])) continue;
if(ar[v]['money'] > 0){
money_type = '收入';
}else{
money_type = '支出';
}
var tr=document.createElement("tr");
tr.id = 'replace_ar_'+ar[v]['ar_id'];
tr.innerHTML = '<td><input id="ar_id" name="ar_id[]" type="checkbox" value="'+ar[v]['ar_id']+'" /></td><td>'+ar[v]['ar_bn']+'</td><td>'+ar[v]['type']+'</td><td>'+ar[v]['order_bn']+'</td><td>'+ar[v]['member']+'</td><td>'+money_type+'</td><td>'+ar[v]['money']+'</td><td>'+ar[v]['trade_time']+'</td><td onclick="ar_delete(this);">删除</td>';
$('ar-section').append(tr);
}
/*var left = '<table cellspacing="0" cellpadding="0" border="0" class="gridlist"><thead><tr><th>选项</th><th>业务单据号</th><th>单据类型</th><th>业务订单号</th><th>客户/会员</th><th>资金流向</th><th>金额</th><th>单据创建时间</th></tr></thead><tbody>';
var right = '</tobody></table>';
var html = left + td + right;
$('replace_ar').set('html',html);*/
}
});
});
</script>