作者 刘朕
1 个管道 的构建 通过 耗费 27 秒

后台平台订单发货调整,前台展示信息调整

@@ -71,9 +71,89 @@ class OrderscourierController extends AdminBaseController{ @@ -71,9 +71,89 @@ class OrderscourierController extends AdminBaseController{
71 71
72 } 72 }
73 73
  74 + /**
  75 + * 发货
  76 + * @adminMenu(
  77 + * 'name' => '发货',
  78 + * 'parent' => 'index',
  79 + * 'display'=> false,
  80 + * 'hasView'=> false,
  81 + * 'order' => 10000,
  82 + * 'icon' => '',
  83 + * 'remark' => '发货',
  84 + * 'param' => ''
  85 + * )
  86 + */
  87 + public function fahuo()
  88 + {
  89 + $id = $this->request->param('id', 0, 'intval');
  90 + if($this->request->isPost()) {
  91 + $param = $this->request->param();
  92 + $url = $param['url'];
  93 + unset($param['url']);
  94 + // 判断订单是否可发货
  95 + $info = Db::name('indent')->where('id',$param['id'])->find();
  96 + if (!$info) {
  97 + $this->error("订单不存在!");
  98 + }
  99 + if ($info['state'] != 2) {
  100 + $this->error("订单无法发货!");
  101 + }
  102 + // 修改发货状态
  103 + $param['state'] = 5;
  104 + $result = Db::name('indent')->update($param);
  105 + if ($result) {
  106 + $this->success("发货成功!",$url);
  107 + } else {
  108 + $this->error('发货失败!');
  109 + }
  110 + } else {
  111 + if ($id) {
  112 + $info = Db::name('indent')->where('id',$id)->find();
  113 + $this->assign('info',$info);
  114 + $this->assign('url',$_SERVER['HTTP_REFERER']);
  115 + return $this->fetch();
  116 + } else {
  117 + $this->error('数据传入失败!');
  118 + }
  119 + }
  120 + }
74 121
75 122
76 123
  124 + /**
  125 + * 完成
  126 + * @adminMenu(
  127 + * 'name' => '完成',
  128 + * 'parent' => 'index',
  129 + * 'display'=> false,
  130 + * 'hasView'=> false,
  131 + * 'order' => 10000,
  132 + * 'icon' => '',
  133 + * 'remark' => '完成',
  134 + * 'param' => ''
  135 + * )
  136 + */
  137 + public function complete()
  138 + {
  139 + $param = $this->request->param();
  140 + // 判断订单是否可发货
  141 + $info = Db::name('indent')->where('id',$param['id'])->find();
  142 + if (!$info) {
  143 + $this->error("订单不存在!");
  144 + }
  145 + if ($info['state'] != 5) {
  146 + $this->error("订单无法完成!");
  147 + }
  148 + // 修改发货状态
  149 + $param['state'] = 3;
  150 + $result = Db::name('indent')->update($param);
  151 + if ($result) {
  152 + $this->success("操作成功!");
  153 + } else {
  154 + $this->error('操作失败!');
  155 + }
  156 + }
77 157
78 158
79 159
@@ -27,22 +27,22 @@ class LogisticsController extends WeChatBaseController @@ -27,22 +27,22 @@ class LogisticsController extends WeChatBaseController
27 if(empty($data)){ 27 if(empty($data)){
28 $this->error('查询为空','','',''); 28 $this->error('查询为空','','','');
29 } 29 }
30 - if($data['is_courier'] == 1){  
31 - $result['data'] = $data['start_time'];  
32 - }else{  
33 - $result = $birdController->getOrder($indent_id);  
34 - if(empty($result)){  
35 - $this->error('未知错误','','');  
36 - }  
37 - if($result['code'] != 20000){  
38 - $this->error($result['msg'],'','','');  
39 - }  
40 - } 30 +// if($data['is_courier'] == 1){
  31 +// $result['data'] = $data['start_time'];
  32 +// }else{
  33 +// $result = $birdController->getOrder($indent_id);
  34 +// if(empty($result)){
  35 +// $this->error('未知错误','','');
  36 +// }
  37 +// if($result['code'] != 20000){
  38 +// $this->error($result['msg'],'','','');
  39 +// }
  40 +// }
41 $indent = $indentModel->findData(['id'=>$indent_id])->toArray(); 41 $indent = $indentModel->findData(['id'=>$indent_id])->toArray();
42 $indentGoodsModel = new IndentGoodsModel(); 42 $indentGoodsModel = new IndentGoodsModel();
43 $indent_goods = $indentGoodsModel->selectData(['indent_id'=>$indent_id]); 43 $indent_goods = $indentGoodsModel->selectData(['indent_id'=>$indent_id]);
44 $indent['indent_goods'] = $indent_goods; 44 $indent['indent_goods'] = $indent_goods;
45 - $this->assign('data',$result['data']); 45 +// $this->assign('data',$result['data']);
46 $this->assign('data2',$data->toArray()); 46 $this->assign('data2',$data->toArray());
47 $this->assign('indent',$indent); 47 $this->assign('indent',$indent);
48 return $this->fetch(); 48 return $this->fetch();
  1 +<include file="public@header"/>
  2 +</head>
  3 +<body>
  4 +<div class="wrap js-check-wrap">
  5 + <ul class="nav nav-tabs">
  6 + <li><a href="{$url}">平台订单列表</a></li>
  7 + <li class="active"><a href="javascript:;">发货</a></li>
  8 + </ul>
  9 + <form action="{:url('Orderscourier/fahuo')}" method="post" class="form-horizontal js-ajax-form margin-top-20">
  10 + <div class="row">
  11 + <div class="col-md-9">
  12 + <table class="table table-bordered">
  13 + <tr>
  14 + <th>快递单号<span class="form-required">*</span></th>
  15 + <td>
  16 + <input class="form-control" type="text" style="width:400px;" name="logistic_code" id="logistic_code"
  17 + required value="" placeholder="请输入快递单号"/>
  18 + </td>
  19 + </tr>
  20 + <tr>
  21 + <th>信息来源<span class="form-required">*</span></th>
  22 + <td>
  23 + <input class="form-control" type="text" name="logistic_name" id="logistic_name" value=""
  24 + required style="width: 400px" placeholder="请输入信息来源">
  25 + </td>
  26 + </tr>
  27 + </table>
  28 + </div>
  29 + </div>
  30 + <div class="form-group">
  31 + <div class="col-sm-offset-2 col-sm-10">
  32 + <input type="hidden" name="id" value="{$info.id}">
  33 + <input type="hidden" name="url" value="{$url}">
  34 + <button type="submit" class="btn btn-primary js-ajax-submit">{:lang('SAVE')}</button>
  35 + <a class="btn btn-default" href="{$url}">{:lang('BACK')}</a>
  36 + </div>
  37 + </div>
  38 + </form>
  39 +</div>
  40 +<script type="text/javascript" src="__STATIC__/js/admin.js"></script>
  41 +</body>
  42 +</html>
@@ -26,6 +26,7 @@ @@ -26,6 +26,7 @@
26 <select name="state" class="form-control"> 26 <select name="state" class="form-control">
27 <option value="">全部</option> 27 <option value="">全部</option>
28 <option value="3" <eq name="state" value="3">selected</eq> >已完成</option> 28 <option value="3" <eq name="state" value="3">selected</eq> >已完成</option>
  29 + <option value="5" <eq name="state" value="5">selected</eq> >已发货</option>
29 <option value="2" <eq name="state" value="2">selected</eq> >未完成</option> 30 <option value="2" <eq name="state" value="2">selected</eq> >未完成</option>
30 </select> 31 </select>
31 <input type="submit" class="btn btn-primary" value="搜索"/> 32 <input type="submit" class="btn btn-primary" value="搜索"/>
@@ -58,20 +59,25 @@ @@ -58,20 +59,25 @@
58 <td>未完成</td> 59 <td>未完成</td>
59 <elseif condition="$vo.state eq 3"/> 60 <elseif condition="$vo.state eq 3"/>
60 <td>已完成</td> 61 <td>已完成</td>
  62 + <elseif condition="$vo.state eq 5"/>
  63 + <td>已发货</td>
61 </if> 64 </if>
62 <td>{$vo.create_time|date="Y-m-d H:i:s",###}</td> 65 <td>{$vo.create_time|date="Y-m-d H:i:s",###}</td>
63 <td style="width: 230px;" class="fahuo{$vo.id}"> 66 <td style="width: 230px;" class="fahuo{$vo.id}">
64 <a href="{:url('Platformorders/plat_view',array('id'=>$vo.id))}"><button type="button" class="btn btn-default">查看</button></a> 67 <a href="{:url('Platformorders/plat_view',array('id'=>$vo.id))}"><button type="button" class="btn btn-default">查看</button></a>
65 - <if condition="$vo.state eq 2">  
66 - <button type="button" class="btn btn-default">物流信息</button>  
67 - <else/>  
68 - <a href="{:url('Orderscourier/logistics_information',array('id'=>$vo.id))}"><button type="button" class="btn btn-default">物流信息</button></a>  
69 - </if> 68 +<!-- <if condition="$vo.state eq 2">-->
  69 +<!-- <button type="button" class="btn btn-default">物流信息</button>-->
  70 +<!-- <else/>-->
  71 +<!-- <a href="{:url('Orderscourier/logistics_information',array('id'=>$vo.id))}"><button type="button" class="btn btn-default">物流信息</button></a>-->
  72 +<!-- </if>-->
70 73
71 <if condition="$vo.state eq 2"> 74 <if condition="$vo.state eq 2">
72 - <button type="button" class="btn btn-default daifa{$vo.id}" onclick="deliver_goods({$vo.id})" >待发货</button>  
73 - <else/>  
74 - <button type="button" class="btn btn-default">已发货</button> 75 + <a href="{:url('Orderscourier/fahuo',array('id'=>$vo['id']))}"><button type="button" class="btn btn-default">发货</button></a>
  76 + <elseif condition="$vo.state eq 5">
  77 + <a class="js-ajax-delete" href="{:url('Orderscourier/complete',array('id'=>$vo['id']))}" data-msg="您确定该订单已完成吗?">
  78 + <button type="button" class="btn btn-default">完成</button>
  79 + </a>
  80 + </elseif>
75 </if> 81 </if>
76 82
77 </td> 83 </td>
@@ -29,6 +29,8 @@ @@ -29,6 +29,8 @@
29 <p>运单号:<notempty name="$indent.logistic_code">{$indent.logistic_code}<else />暂无</notempty></p> 29 <p>运单号:<notempty name="$indent.logistic_code">{$indent.logistic_code}<else />暂无</notempty></p>
30 <p> 30 <p>
31 信息来源: 31 信息来源:
  32 + {$indent.logistic_name}
  33 + <!--
32 <if condition="$indent.logistic_name eq 'SF'"> 34 <if condition="$indent.logistic_name eq 'SF'">
33 顺丰快递 35 顺丰快递
34 <elseif condition="$indent.logistic_name eq 'YTO'"/> 36 <elseif condition="$indent.logistic_name eq 'YTO'"/>
@@ -60,12 +62,14 @@ @@ -60,12 +62,14 @@
60 暂无 62 暂无
61 </if> 63 </if>
62 </if> 64 </if>
  65 + -->
63 </p> 66 </p>
64 </div> 67 </div>
65 </div> 68 </div>
66 69
67 70
68 <!-- 物流信息 --> 71 <!-- 物流信息 -->
  72 + <!--
69 <div class="logistics_process"> 73 <div class="logistics_process">
70 <div class="logistics_left"> 74 <div class="logistics_left">
71 <if condition="$data2.is_courier eq 1"> 75 <if condition="$data2.is_courier eq 1">
@@ -110,6 +114,7 @@ @@ -110,6 +114,7 @@
110 </if> 114 </if>
111 </div> 115 </div>
112 </div> 116 </div>
  117 + -->
113 </div> 118 </div>
114 <script src="__TMPL__/public/assets/js/base.js"></script> 119 <script src="__TMPL__/public/assets/js/base.js"></script>
115 <script src="__TMPL__/public/assets/js/jquery.js"></script> 120 <script src="__TMPL__/public/assets/js/jquery.js"></script>