Files
2026-01-04 19:08:31 +08:00

142 lines
4.6 KiB
HTML
Raw Permalink 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.
-->
<div class="tableform" id="tableform">
<h3><{t}>第一步:新建对账任务<{/t}></h3>
<div class="division">
<form method="post" id='statements_form' action='index.php?app=logisticsaccounts&ctl=admin_actual_task&act=save'>
<table border="0" cellpadding="0" cellspacing="0" class="girdlist">
<tr >
<th><t>仓库:</t></th>
<td >
<select id='branch_id' name='branch_id' vtype="required">
<option value="">请选择</option>
<{foreach from=$branch_list item=branch_list}>
<option value="<{$branch_list.branch_id}>"><{$branch_list.name}></option>
<{/foreach}>
</select></td>
</tr>
<tr >
<th><t>物流公司:</t></th>
<td >
<select id='logi_id' name='logi_id'>
<option value="请选择"></option>
</select></td>
</tr>
<tr >
<th><t>任务名称:</t></th>
<td >
<input type="text" id="task_bn" name="task_bn" vtype="required" size="50"><{help}>建议使用系统默认任务名称,任务名称可自定义<{/help}>
</td>
</tr>
</table>
<input type="hidden" name="finder_id" value="<{$finder_id}>">
<div id="cc" class="noprint table-action"> <{button type="button" class="btn" id="save-btn" label="下一步"}> &nbsp; <{button type="button" class="btn" id="return-btn" label="关 闭" onclick="javascript:void(this.getParent('.dialog').retrieve('instance').close());"}></div>
</form>
<h3><font color="red">提示:</font></h3>
<h4><font color="red">1、 请先将物流公司提供的电子账单按照模板格式编辑csv文件以备导入。</font></h4>
<h4><font color="red">2、 每次上传的csv文件大小不超过5000条记录每个对账任务内可分多次文件上传。</font></h4>
</div>
</div>
<script>
var d = new Date();
var year = d.getFullYear();
var month = d.getMonth();
if(month==0){
month = 12;
year = year-1;
}
$('branch_id').addEvent('change',function(){
var branch_id = $('branch_id');
branch_name = branch_id.options[branch_id.selectedIndex].text;
//var logi_id = $('logi_id');
logi_name = '请选择';
if(logi_name!=''){
$('task_bn').value=branch_name+'_'+logi_name+'_'+year+month;
}
//获取对应物流公司
new Request({
url:'index.php?app=logisticsaccounts&ctl=admin_actual_task&act=get_corps',
method:'post',
data:'branch_id='+branch_id.value,
onComplete: function(json) {
if(!json)
return;
json = JSON.decode(json);
var s = '<option value="">请选择</option>'
json.each( function(j,i) {
s += '<option value="'+j.corp_id+'">'+j.name+'</option>';
});
$('logi_id').set('html',s);
$('logi_id').options[0].selected = true;
}
}).send();
});
$('logi_id').addEvent('change',function(){
var d = new Date();
var branch_id = $('branch_id');
branch_name = branch_id.options[branch_id.selectedIndex].text;
var logi_id = $('logi_id');
logi_name = logi_id.options[logi_id.selectedIndex].text;
if(branch_name!=''){
$('task_bn').value=branch_name+'_'+logi_name+'_'+year+month;
}
});
$('save-btn').addEvent('click',function(e){
var _this=this;
var form=this.getParent('form');
var branch_id = $('branch_id').value;
var logi_id = $('logi_id').value;
if(branch_id==""){
return MessageBox.error('请选择仓库!');
}
if(logi_id==""){
return MessageBox.error('请选择物流公司!');
}
var querystring = $('statements_form').toQueryString();
new Request({url:'index.php?app=logisticsaccounts&ctl=admin_actual_task&act=save',data:querystring,
onComplete:function(rs){
var rs = Json.evaluate(rs);
if (typeof(rs.error) != 'undefined'){
return MessageBox.error(rs.error);
}else{
_this.getParent('.dialog').retrieve('instance').close();
new Dialog(rs.redirect,{width:460,height:400,title:'上传对账文件'});
}
}}).send();
});
</script>