Merge branch 'hcy_pcb_20181221-r' into development

parents 8845a473 98a5b7ef
......@@ -82,4 +82,8 @@ class ApiController extends Controller
private function ApiConfirmOrder($request){
echo (new PcbServerModel())->confirmOrder($request->user->userId,$request->input("purchase_id"),$request->input("status"));
}
//pcb后台点击采购确认
private function ApiOfflinePay($request){
echo (new PcbServerModel())->offlinePay($request->user->userId,$request->input("order_id"),$request->input("pay_money"));
}
}
......@@ -43,4 +43,21 @@ class PcbServerModel
}
return $res;
}
/*
*
* @param int $order_id 订单id
* @param int $status 状态
*/
public function offlinePay($admin_id,$order_id,$pay_money){
$param = [
'order_id'=> $order_id ,
'pay_money'=> $pay_money ,
];
$res = curlApi($this->PcbUrl.'/pcb/adminapi/offline_payment',$param,'POST');
$json = json_decode($res,true);
if ($json['err_code'] == 0){
PcbActionLogModel::log(1,'offline_payment',"线下支付",$order_id,$admin_id);
}
return $res;
}
}
\ No newline at end of file
......@@ -101,7 +101,18 @@ layui.use(['table','form','element','layer', 'laydate'], function() {
content: $("#sendPurchase")
});
}))
//线下支付
form.on('submit(OfflinePay)',(function (data) {
$("#offline_order_id").val($(this).attr("order_id"))
$("#offline_order_sn").val($(this).attr("order_sn"))
layer.open({
type: 1,
title:"线下支付",
skin: 'layui-layer-rim', //加上边框
area: ['420px', '260px'], //宽高
content: $("#OfflinePay")
});
}))
//关闭订单
form.on('submit(ClosePurchase)',(function () {
var picking_id = $(this).attr('picking_id')
......@@ -185,3 +196,30 @@ function AddPurchase(order_id) {
})
return false;
}
//线下支付
function OfflinePay() {
layer.msg('加载中', {
icon: 16
,shade: 0.01
});
$.ajax({
url:'/api/ApiOfflinePay',
type:'post',
data:{"order_id":$("#offline_order_id").val(),"pay_money":$("#pay_money").val()},
async: false,
dataType:'json',
timeout:10000,
success:function (res) {
if(res.err_code == 0){
alert_succ(res.err_msg,function () {
window.location.href='/web/PcbOrderList';
})
}else{
alert_err(res.err_msg)
}
},
done:function () {
layer.closeAll();
}
})
}
\ No newline at end of file
......@@ -128,6 +128,8 @@
<button class="btn btn-xs btn-outline btn-danger" lay-submit="" order_id="<?= $v['order_id'] ?>" order_sn="<?= $v['order_sn'] ?>" onclick="AddPurchase(<?= $v['order_id'] ?>)">发起采购</button> &nbsp;&nbsp;
<?php } if($v['status'] == 14 && $v['shipping_time'] == 0) { ?>
<button class="btn btn-xs btn-outline btn-danger" lay-submit="" order_id="<?= $v['order_id'] ?>" order_sn="<?= $v['order_sn'] ?>" lay-filter="SendPurchase">发货</button>
<?php } if($v['status'] == 10) { //待支付 ?>
<button class="btn btn-xs btn-outline btn-danger" lay-submit="" order_id="<?= $v['order_id'] ?>" order_sn="<?= $v['order_sn'] ?>" lay-filter="OfflinePay">线下支付</button>
<?php } ?>
</div>
</td>
......@@ -171,7 +173,7 @@
<?php echo $page; ?>
</div>
<!--弹出层-->
<!--弹出层填写快递单号-->
<div id="sendPurchase" style="display: none">
<br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;配送快递:&nbsp;&nbsp;
<select type='text' style='width: 200px;height: 30px;' id="shipping_id">
......@@ -181,6 +183,14 @@
</select><br/><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;快递单号:&nbsp;&nbsp;<input type='text' id="shipping_no" style='width: 200px;height: 30px;' ><br/><br/>
<input type='hidden' id='sure_order_id'> <input type='hidden' id='sure_order_sn'>
&nbsp;&nbsp;&nbsp;&nbsp;<button class='layui-btn' onclick='SendStock()' style="margin-left: 130px;">确定发货</button>
&nbsp;&nbsp;&nbsp;&nbsp;<button class='layui-btn' onclick='SendStock()' style="margin-left: 130px;">确定</button>
</div>
<!--弹出层线下支付-->
<div id="OfflinePay" style="display: none">
<br/><br/>
&nbsp;&nbsp;&nbsp;付款金额:&nbsp;&nbsp;<input type='text' id="pay_money" style='width: 200px;height: 30px;' ><br/><br/>
<input type='hidden' id='offline_order_id'> <input type='hidden' id='offline_order_sn'>
&nbsp;&nbsp;&nbsp;&nbsp;<button class='layui-btn' onclick='OfflinePay()' style="margin-left: 130px;">确定</button>
</div>
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