Files
OMS/app/console/view/admin/purchase/purchase_cancel.html
2026-01-04 19:08:31 +08:00

109 lines
3.9 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 2012-2026 ShopeX (https://www.shopex.cn)
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<form name="form1" id="purchase_cancel" method="POST" action="index.php?app=console&ctl=admin_purchase&act=doRefund">
<script>
$('t1').set('html', '');
$('t1').set({'styles':{'color':'red','font-weight':'bold'}});
var click=0;
function once(){
if (click > 0){
return false;
}else {
click++;
}
$('t1').set('text', '');
$('memo_flag').set('value','1');
$('t1').set({'styles':{'color':'black','font-weight':'normal'}});
}
var _form = $('purchase_cancel');
var btn = $('btn-cancel');
var finder = finderGroup['<{$env.get.finder_id}>'];
_form.store('target',{
onComplete:function(e){
try{
var _dialogIns = btn.getParent('.dialog').retrieve('instance');
}catch(e){}
if(_dialogIns){
_dialogIns.close();
finder.refresh.delay(400,finder);
}
}
});
$('btn-cancel').addEvent('click',function(e){
new Request({url:'index.php?app=console&ctl=admin_purchase&act=checkCancel&p[0]='+<{$id}>,method:'POST',
onRequest:function(){
$('btn-cancel').set('disabled', 'true');
$('btn-cancel').getElements('span')[1].set('text','正在取消...');
},
onComplete:function(json){
if (json != ''){
json = JSON.decode(json);
if(json.rsp == 'fail'){
if (json.msg_code=='w402')
{
if (window.confirm('仓储物流系统无法进行撤销采购单操作,是否继续取消?\n注确定继续拒绝将强制撤销本系统未处理的采购单,否则请线下联系仓储服务商取消的采购单'))
{
$('purchase_cancel').fireEvent('submit',{stop:function(){}});
}else{
$('btn-cancel').set('disabled', '');
$('btn-cancel').getElements('span')[1].set('text','确定');
}
}else{
alert('取消失败:'+json.err_msg);
$('btn-cancel').set('disabled', '');
$('btn-cancel').getElements('span')[1].set('text','确定');
return;
}
}else{
$('purchase_cancel').fireEvent('submit',{stop:function(){}});
}
}
},
}).send();
});
</script>
<div class="division">
<table width="100%">
<tr>
<td><b>注意:此操作会取消采购,请慎重操作</b></td>
</tr>
<tr>
<td align="left"><textarea id="t1" name="memo" cols="40" rows="5"></textarea></td>
</tr>
<tr>
<td align="left">经办人:<{input type="text" name="operator" vtype="required" size="8" id="operator" value="{$operator}" }></td>
</tr>
</table>
</div><table cellspacing="0" cellpadding="0" border="0" align="center" class="tableAction">
<tr>
<td align="center"><b class="submitBtn"><{button type='button' label='终止' id="btn-cancel" class="btn btn-primary" }></b></td>
</tr>
</table>
<input type='hidden' name='memo_flag' id='memo_flag' value=''>
<input type='hidden' name='po_id' value='<{$id}>'>
<input type='hidden' name='type' value='<{$type}>'>
</form>