Merge branch 'hcy_pcb_20181221-r' into development

parents ddbb1b94 e54ff51f
...@@ -80,6 +80,6 @@ class ApiController extends Controller ...@@ -80,6 +80,6 @@ class ApiController extends Controller
} }
//pcb后台点击采购确认 //pcb后台点击采购确认
private function ApiConfirmOrder($request){ 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 ...@@ -29,10 +29,12 @@ class PcbServerModel
* *
* @param int $admin_id 管理员id * @param int $admin_id 管理员id
* @param int $order_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 = [ $param = [
'purchase_id'=> $purchase_id , 'purchase_id'=> $purchase_id ,
'status'=> $status ,
]; ];
$res = curlApi($this->PcbUrl.'/pcb/adminapi/confirmOrder',$param,'POST'); $res = curlApi($this->PcbUrl.'/pcb/adminapi/confirmOrder',$param,'POST');
$json = json_decode($res); $json = json_decode($res);
......
...@@ -119,26 +119,32 @@ layui.use(['table','form','element','layer', 'laydate'], function() { ...@@ -119,26 +119,32 @@ layui.use(['table','form','element','layer', 'laydate'], function() {
,isInitValue: false ,isInitValue: false
}); });
}) })
//确定发货 //采购确认
function SurePurchase(purchase_id) { function confirmOrder(purchase_id) {
alert_confirm("采购已完成,请确认是否通过审核?",function () { layer.confirm('采购已完成,请确认是否通过审核?', {
$.ajax({ btn: ['通过','不通过'] //按钮
url:'/api/ApiConfirmOrder', }, function(){
type:'post', confirmOrder2(purchase_id,1); //通过
data:{"purchase_id":purchase_id}, }, function(){
async: false, confirmOrder2(purchase_id,-1); //不通过
dataType:'json', });
timeout:10000, }
success:function (res) { function confirmOrder2(purchase_id,status) {
if(res.err_code == 0){ $.ajax({
alert_succ(res.errmsg,function () { url:'/api/ApiConfirmOrder',
window.location.href='/web/Abnormal'; type:'post',
}) data:{"purchase_id":purchase_id,'status':status},
}else{ async: false,
alert_err(res.errmsg) 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 @@ ...@@ -89,7 +89,7 @@
<script type="text/html" id="cahe"> <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> <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){ }} @{{# 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> </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