Merge branch 'hcy_pcb_20181221-r' into development

parents ddbb1b94 e54ff51f
......@@ -80,6 +80,6 @@ class ApiController extends Controller
}
//pcb后台点击采购确认
private function ApiConfirmOrder($request){
echo (new PcbServerModel())->confirmOrder($request->user->userId,$request->input("purchase_id"));
echo (new PcbServerModel())->confirmOrder($request->user->userId,$request->input("purchase_id"),$request->input("status"));
}
}
......@@ -29,10 +29,12 @@ class PcbServerModel
*
* @param int $admin_id 管理员id
* @param int $order_id 订单id
* @param int $status 状态
*/
public function confirmOrder($admin_id,$purchase_id){
public function confirmOrder($admin_id,$purchase_id,$status){
$param = [
'purchase_id'=> $purchase_id ,
'status'=> $status ,
];
$res = curlApi($this->PcbUrl.'/pcb/adminapi/confirmOrder',$param,'POST');
$json = json_decode($res);
......
......@@ -119,26 +119,32 @@ layui.use(['table','form','element','layer', 'laydate'], function() {
,isInitValue: false
});
})
//确定发货
function SurePurchase(purchase_id) {
alert_confirm("采购已完成,请确认是否通过审核?",function () {
$.ajax({
url:'/api/ApiConfirmOrder',
type:'post',
data:{"purchase_id":purchase_id},
async: false,
dataType:'json',
timeout:10000,
success:function (res) {
if(res.err_code == 0){
alert_succ(res.errmsg,function () {
window.location.href='/web/Abnormal';
})
}else{
alert_err(res.errmsg)
}
//采购确认
function confirmOrder(purchase_id) {
layer.confirm('采购已完成,请确认是否通过审核?', {
btn: ['通过','不通过'] //按钮
}, function(){
confirmOrder2(purchase_id,1); //通过
}, function(){
confirmOrder2(purchase_id,-1); //不通过
});
}
function confirmOrder2(purchase_id,status) {
$.ajax({
url:'/api/ApiConfirmOrder',
type:'post',
data:{"purchase_id":purchase_id,'status':status},
async: false,
dataType:'json',
timeout:10000,
success:function (res) {
if(res.err_code == 0){
alert_succ(res.errmsg,function () {
window.location.reload()
})
}else{
alert_err(res.errmsg)
}
})
}
})
}
}
\ No newline at end of file
......@@ -89,7 +89,7 @@
<script type="text/html" id="cahe">
<a href="/web/PcbPurchaseDetail?purchase_id=@{{ d.purchase_id }}&order_id=@{{ d.order_id }}" class="btn btn-xs btn-outline btn-success"><strong>详情</strong></a>
@{{# if(d.status==3){ }}
<button class="btn btn-xs btn-outline btn-danger" lay-submit="" order_id="@{{ d.purchase_id }}" order_sn="@{{ d.purchase_sn }}" onclick="SurePurchase(@{{ d.purchase_id }})">采购确认</button>
<button class="btn btn-xs btn-outline btn-danger" lay-submit="" order_id="@{{ d.purchase_id }}" order_sn="@{{ d.purchase_sn }}" onclick="confirmOrder(@{{ d.purchase_id }})">采购确认</button>
@{{# } }}
</script>
......
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