更新对接财务对账

parent 37b619a0
<?php
namespace App\map;
//采购对账列表枚举
class ReconcilePurMap{
/*
* 状态:-1已取消 2 对账中 3已对账 4付款中 5已付款
* 状态:
财务系统账单生成时,为对账中,
供应商处理后,为已对账。
财务付款后。为已付款。
财务系统账单取消后。为取消
*/
const STATUS_CANCEL = -1;
const STATUS_CHECKING = 2;
const STATUS_CHECKING_FINISH =3;
const STATUS_PAY_RUNNING =4;
const STATUS_PAY =5;
static $status = [
self::STATUS_CANCEL => "已取消",
self::STATUS_CHECKING => "对账中",
self::STATUS_CHECKING_FINISH => "已对账",
self::STATUS_PAY_RUNNING => "付款中",
self::STATUS_PAY => "已付款",
];
}
......@@ -65,17 +65,17 @@ class ExportModel
export_csv($out,['退货单号','创建单时间','金额','状态','币种','商品编码','型号','品牌','封装','包装方式','MPQ','数量','单价'],'退货列表导出'.time().'.csv');
}
//对账单列表导出
static function ApiReconcilePurListExport($request, $id){
static function ApiReconcilePurListExport($request){
$input = $request->input();
$input['type'] = 2; //导出类型
$res = (new ServerFinanceModel($request->appid,$request->key))->reconcilePurList($input,2);
if ($res['errcode'] > 0 ){
if ($res['code'] > 0 ){
exit("没有数据");
}
$out = [];
foreach ($res['data'] as $k=>$v){
array_push($out,[
'checking_sn'=>$v['checking_sn'],
'reconcile_pur_sn'=>$v['reconcile_pur_sn'],
'amount'=>$v['amount'],
'currency'=>$v['currency'],
'day_num'=>$v['day_num'],
......
......@@ -33,6 +33,10 @@ class ServerFinanceModel
die();
}
$p = json_decode($res,true);
if (!$p || array_key_exists('errcode',$p) === false){
print_r($res);
die();
}
$p['code'] = $p['errcode'];
unset($p['errcode']);
if ($type == 1){
......
......@@ -64,7 +64,7 @@
});
} else {
alert_err(res.msg)
alert_err(res.errmsg)
return false;
}
}
......
......@@ -24,6 +24,7 @@
tableList: function (page) {
var postData = {
'p':page,
'is_consign':$("#is_consign").val(),
'checking_sn':$("#checking_sn").val(),
'status':$("#status").val(),
'create_time1':$("#create_time1").val(),
......
......@@ -138,16 +138,20 @@
</dl>
</li>
<?php } ?>
<li >
<li class="<?php if( in_array($id,['ReconcilePurList','ReconcilePurDetail']) !== false ) echo "curr" ?>" >
<a href="javascript:;" class="bx">
<i class="iconfont icon-dingdanguanli- va-m"></i>
<span class="t1 lineBlock va-m">财务管理</span>
<b class="iconfont icon-xiala-"></b>
</a>
<dl <?php if( in_array($id,['ReconcilePurList','ReconcilePurDetail']) !== false ) echo "style='display: block;'" ?>>
<dd class="curr">
<dl >
<dd class="<?php if( in_array($id,['ReconcilePurList','ReconcilePurDetail']) !== false && @$_GET['is_consign'] == 1 ) echo "curr" ?>">
<i class="line"></i>
<a href="/web/ReconcilePurList?is_consign=1">对账列表(寄售)</a>
</dd>
<dd class="<?php if( in_array($id,['ReconcilePurList','ReconcilePurDetail']) !== false && @$_GET['is_consign'] == 2 ) echo "curr" ?>">
<i class="line"></i>
<a href="/web/ReconcilePurList">对账列表</a>
<a href="/web/ReconcilePurList?is_consign=2">对账列表(商家代发)</a>
</dd>
</dl>
</li>
......
......@@ -10,20 +10,19 @@
<div class="search-bar">
<div class="lineBlock input-inline va-m">
<label class="tag">对账单号:</label>
<input type="text" class="inp w180" name="checking_sn" id="checking_sn">
<input type="text" class="inp w180" name="reconcile_pur_sn" id="reconcile_pur_sn">
</div>
<div class="lineBlock input-inline va-m">
<label class="tag">状态:</label>
<select class="sel w180" name="status" id="status">
<option value=""></option>
<option value="-1">已取消</option>
<option value="1">对账中</option>
<option value="2">已对账</option>
<option value="3">已付款</option>
<?php foreach (\App\map\ReconcilePurMap::$status as $a=>$b) { ?>
<option value="<?= $a ?>"><?= $b ?></option>
<?php } ?>
</select>
</div>
<div class="lineBlock input-inline va-m">
<label class="tag">下单时间:</label>
<label class="tag">创建时间:</label>
<input type="text" class="inp w120 order-time-1" name="create_time1" id="create_time1" lay-key="1">
<span class="lineBlock va-m line">~</span>
<input type="text" class="inp w120 order-time-2" name="create_time2" id="create_time2" lay-key="2">
......@@ -64,3 +63,6 @@
</div>
</div>
</div>
<!--隐藏域-->
<input type="hidden" value="{{ @$_GET['is_consign'] }}" id="is_consign">
\ No newline at end of file
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 sign in to comment