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

100 lines
3.1 KiB
HTML

<!--
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.
-->
<div class="tableform">
<form id="frm_submit" name="frm_submit" method="post" action="index.php?app=console&ctl=admin_replenish_task&act=doConfirm">
<div class="division">
<table width="100%" cellspacing="0" cellpadding="0" border="0" align="center" >
<tbody>
<tr>
<td >补货任务名称:<span style="font-weight:bold;"><{$data.task_name}></span></td>
</tr>
<tr>
<td >&nbsp;</td>
</tr>
<tr>
<td align="center">
<input type="hidden" name="task_id" value="<{$data.task_id}>" />
<input type="hidden" name="task_bn" value="<{$data.task_bn}>" />
<{button label="确定补货任务" type="button" id="btn-submit" class="btn-primary"}>
</td>
</tr>
</tbody>
</table>
</div>
</form>
</div>
<script>
var task_id = "<{$data.task_id}>";
var finder = finderGroup['<{$env.get.finder_id}>'];
$('frm_submit').store('target',{
onComplete:function(json){
try{
var json = Json.evaluate(json);
if (typeof(json.error) != 'undefined'){
_this.disabled=false;
var msg = '取消失败';
if(json.msg) {
msg += ':'+json.msg;
}
alert(msg);
}else{
var _dialogIns = $('btn-submit').getParent('.dialog').retrieve('instance');
_dialogIns.close();
alert('确认成功');
finder.refresh.delay(400,finder);
}
}catch(e){}
}
});
$('btn-submit').addEvent('click',function(e){
var operator_name = '<{$title}>';
var _this=this;
new Request({url:'index.php?app=console&ctl=admin_replenish_task&act=doConfirm&p[0]='+ task_id,method:'POST',
onRequest:function(){
$('btn-submit').set('disabled', 'true');
$('btn-submit').getElements('span')[1].set('text','正在执行...');
},
onComplete:function(json){
if (json != ''){
json = JSON.decode(json);
if(json.rsp == 'fail'){
if(json.msg == ''){
json.msg = '确认补货任务失败';
}
alert(json.msg);
$('btn-submit').set('disabled', '');
$('btn-submit').getElements('span')[1].set('text','确定补货任务');
_this.getParent('.dialog').retrieve('instance').close();
window.finderGroup['<{$env.get.finder_id}>'].refresh(true);
return;
}else{
$('frm_submit').fireEvent('submit',{stop:function(){}});
}
}
},
}).send();
});
</script>