Browse Source

Merge branch 'zzd' of ssh://was.baoshi56.com:10022/var/git/bswas

LD 5 years ago
parent
commit
4d4485e60a

+ 6 - 7
app/Http/Controllers/LogisticController.php

@@ -92,13 +92,6 @@ class LogisticController extends Controller
         return view('maintenance.logistic.edit',['logistic'=>$logistic]);
     }
 
-    /**
-     * Update the specified resource in storage.
-     *
-     * @param Request $request
-     * @param Logistic $logistic
-     * @return Response
-     */
     public function update(Request $request, Logistic $logistic)
     {
         if(!Gate::allows('物流公司-编辑')){ return redirect(url('/'));  }
@@ -123,4 +116,10 @@ class LogisticController extends Controller
         $re=$logistic->delete();
         return ['success'=>$re];
     }
+
+    public function get()
+    {
+        $logistics = app("LogisticService")->getSelection();
+        return ["success"=>true,"data"=>$logistics];
+    }
 }

+ 11 - 1
app/Services/OrderService.php

@@ -345,13 +345,23 @@ class OrderService
             $commodities[$key]=[["sku"=>$order->sku,"alternate_sku1"=>$order->alternate_sku1,
                 "descr_c"=>$order->descr_c,"qtyordered"=>$order->qtyordered,"lotnum"=>$order->lotnum,"checktime"=>$order->checktime,"orderdetailcodename"=>$order->orderdetailcodename]];
             $orderNos .= ",'".$order->orderno."'";
-            if ($count % 500 == 0 || $index == count($orders)-1){
+            if ($count % 500 == 0){
                 $orderNos .= ")";
                 $allocations = DB::connection("oracle")->select(DB::raw("SELECT DROPID,ORDERNO FROM ACT_ALLOCATION_DETAILS WHERE orderno IN ".$orderNos." GROUP BY (DROPID,ORDERNO)"));
                 foreach ($allocations as $allocation){
                     if (isset($picktotraceids[$allocation->orderno])) $picktotraceids[$allocation->orderno][] = $allocation->dropid;
                     else $picktotraceids[$allocation->orderno] = [$allocation->dropid];
                 }
+                $orderNos = "(''";
+            }
+            $count++;
+        }
+        if ($orderNos !== "(''"){
+            $orderNos .= ")";
+            $allocations = DB::connection("oracle")->select(DB::raw("SELECT DROPID,ORDERNO FROM ACT_ALLOCATION_DETAILS WHERE orderno IN ".$orderNos." GROUP BY (DROPID,ORDERNO)"));
+            foreach ($allocations as $allocation){
+                if (isset($picktotraceids[$allocation->orderno])) $picktotraceids[$allocation->orderno][] = $allocation->dropid;
+                else $picktotraceids[$allocation->orderno] = [$allocation->dropid];
             }
         }
         $picktotraceids=json_encode($picktotraceids);

+ 26 - 7
resources/views/customer/project/create.blade.php

@@ -170,6 +170,7 @@
                         initial_weight:"",
                         additional_weight:"",
                         items:[],
+                        logistics:[],
                     },
                     logistic:{
                         items:[],
@@ -196,7 +197,7 @@
                 selectedModel:{//已选定的计费模型
                     storage:[],
                     operation:[],
-                    express:{},
+                    express:[],
                     logistic:{},
                 },
                 thisOperationItemIndex:-1,//当前选中的作业费子项下标,用以唤起特征模态框
@@ -216,6 +217,7 @@
                     if (this.upList[id])$("#"+id).slideDown();
                     else $("#"+id).slideUp();
                     this.upList[id] = !this.upList[id];
+                    this.$forceUpdate();
                 },
                 //切换选项
                 switchBase(base){
@@ -321,6 +323,10 @@
                 //加载快递
                 _loadExpress(){
                     if (!this.pool.provinces)this._getProvinces();
+                    if (!this.pool.logistics){
+                        this._getLogistics();
+
+                    }
                 },
                 //加载物流
                 _loadLogistic(){
@@ -367,6 +373,22 @@
                         this.$forceUpdate();
                     });
                 },
+                //获取承运商
+                _getLogistics(){
+                    let url = "{{url('maintenance/logistic/get')}}";
+                    window.tempTip.postBasicRequest(url,{},res=>{
+                        this.pool.logistics = res;
+                        let mapping = [];
+                        res.forEach(logistic=>{
+                            mapping[logistic.id] = logistic.name;
+                        });
+                        this.poolMapping.logistics = mapping;
+                        setTimeout(()=>{
+                            $(".selectpicker").selectpicker('render');
+                        },500);
+                        this.$forceUpdate();
+                    });
+                },
                 //保存模型
                 saveModel(){
                     switch (this.type) {
@@ -437,9 +459,6 @@
                     }
                     if (this.model.operation.operation_type === '入库')this.$delete(this.model.operation.items,0);//入库时干掉起步子项
                     this.selectedModel.operation.push(this.model.operation);
-                    setTimeout(()=>{
-                        this._renderingOperationItem(this.selectedModel.operation.length-1);
-                    },100);
                     this.model.operation = {
                         operation_type:"入库",
                         strategy:"默认",
@@ -487,7 +506,7 @@
                         this.$forceUpdate();
                         return;
                     }
-                    this.selectedModel.express = this.model.express;
+                    this.selectedModel.express.unshift(this.model.express);
                     this.model.express = {
                         name:"",
                         initial_weight:"",
@@ -596,7 +615,7 @@
                         return "已更新特征";
                     },true);
                 },
-                //渲染作业费子项
+                /*//渲染作业费子项
                 _renderingOperationItem(index){
                     let domId = "operation-"+index;
                     let trId = "operation-tr-"+index;
@@ -614,7 +633,7 @@
                 _createOperationItemList(html,strategy,amount,unit,unit_price,feature){
                     html += "<tr><td>"+strategy+"</td><td>"+amount+"</td><td>"+unit+"</td><td>"+unit_price+"</td><td><div class='text-overflow-warp-100'>"+feature+"</div></td></tr>";
                     return html;
-                },
+                },*/
                 //移入移出时更改长文本显示效果
                 textClass(event,isOver){
                     event = event.target.children[0];

+ 7 - 0
resources/views/customer/project/part/_express.blade.php

@@ -3,6 +3,13 @@
     <label class="col-7"><input type="text" class="form-control"
            v-model="model.express.name" :class="errors.name ? 'is-invalid' : ''"></label>
 </div>
+<div class="row mt-3">
+    <label class="col-3">承运商</label>
+    <label class="col-5"><select class="selectpicker" multiple data-live-search="true" title="承运商(多选)"
+            v-model="model.express.logistics" :class="errors.logistics ? 'is-invalid' : ''">
+        <option v-for="logistic in pool.logistics" :value="logistic.id">@{{ logistic.name }}</option>
+    </select></label>
+</div>
 <div class="row mt-3">
     <label class="col-3"><b class="text-danger">* </b>首重值(KG)</label>
     <label class="col-7"><input type="number" min="0" step="0.01" class="form-control"

+ 2 - 2
resources/views/customer/project/part/_operation.blade.php

@@ -27,7 +27,7 @@
 </div>
 <div class="row mt-3">
     <label class="col-2">特征:</label>
-    <label v-if="model.operation.feature">@{{ model.operation.feature }}</label>
+    <label v-if="model.operation.feature">@{{ model.operation.featureFormat }}</label><br>
     <button type="button" class="btn btn-dark col-2 ml-2" @click="showAddFeatureModal(-1,model.operation.feature)">调整特征</button>
 </div>
 <div class="row mt-3">
@@ -150,7 +150,7 @@
             <div class="row mt-2">
                 <label class="col-3">特征:</label>
                 <label class="col-5">
-                    <label v-if="item.feature">@{{ item.feature }}</label><br>
+                    <label v-if="item.feature">@{{ item.featureFormat }}</label><br>
                     <button type="button" class="btn btn-dark ml-2" @click="showAddFeatureModal(i)">调整特征</button>
                 </label>
             </div>

+ 98 - 26
resources/views/customer/project/part/_three.blade.php

@@ -33,31 +33,59 @@
             </div>
             <div class="card-body" id="operation">
                 <div class="container-fluid">
-                    <div class="row">
-                        <div>入库</div>
+                    <div class="row font-weight-bold">
+                        <div class="cursor-pointer" @click="show('operation-list-in')"><span class="fa" :class="upList['operation-list-in'] ? 'fa-caret-right' : 'fa-caret-down'"></span> 入库</div>
                     </div>
-                    <div class="row">
-                        <div>入库</div>
+                    <div class="container-fluid" v-for="(operation,i) in selectedModel.operation" v-if="operation.operation_type === '入库'" id="operation-list-in">
+                        <div class="row offset-1">
+                            <label class="font-weight-bold cursor-pointer" @click="show('operation-item-'+i)">
+                                <span class="fa" :class="upList['operation-item-'+i] ? 'fa-caret-right' : 'fa-caret-down'"></span>
+                                &nbsp;@{{ operation.strategy }}:
+                            </label>
+                            <label>@{{ operation.name }}</label>
+                            <label v-if="operation.remark" class="text-secondary">&nbsp;&nbsp;(@{{ operation.remark }})</label>
+                        </div>
+                        <div class="row offset-1 small mt-0" style="background-color: RGB(248,248,248)" v-if="operation.strategy === '特征'">
+                            @{{ operation.featureFormat }}
+                        </div>
+                        <div class="container-fluid offset-2" :id="'operation-item-'+i">
+                            <div v-for="item in operation.items" class="container-fluid">
+                                <div class="row"><label>@{{ item.strategy }}</label>:
+                                    <b>@{{ item.amount }}</b>/@{{ poolMapping.units[item.unit_id] }} (<b>@{{ item.unit_price }}</b>元)
+                                </div>
+                                <div class="row small mt-0" style="background-color: RGB(248,248,248)">
+                                    @{{ item.featureFormat }}
+                                </div>
+                            </div>
+                        </div>
+                    </div>
+                    <div class="row font-weight-bold">
+                        <div class="cursor-pointer" @click="show('operation-list-out')"><span class="fa" :class="upList['operation-list-out'] ? 'fa-caret-right' : 'fa-caret-down'"></span> 出库</div>
+                    </div>
+                    <div class="container-fluid" v-for="(operation,i) in selectedModel.operation" v-if="operation.operation_type === '出库'" id="operation-list-out">
+                        <div class="row offset-1">
+                            <label class="font-weight-bold cursor-pointer" @click="show('operation-item-'+i)">
+                                <span class="fa" :class="upList['operation-item-'+i] ? 'fa-caret-right' : 'fa-caret-down'"></span>
+                                &nbsp;@{{ operation.strategy }}:
+                            </label>
+                            <label>@{{ operation.name }}</label>
+                            <label v-if="operation.remark" class="text-secondary">&nbsp;&nbsp;(@{{ operation.remark }})</label>
+                        </div>
+                        <div class="row offset-1 small mt-0" style="background-color: RGB(248,248,248)" v-if="operation.strategy === '特征'">
+                            @{{ operation.featureFormat }}
+                        </div>
+                        <div class="container-fluid offset-2" :id="'operation-item-'+i">
+                            <div v-for="item in operation.items" class="container-fluid">
+                                <div class="row"><label>@{{ item.strategy }}</label>:
+                                    <b>@{{ item.amount }}</b>/@{{ poolMapping.units[item.unit_id] }} (<b>@{{ item.unit_price }}</b>元)
+                                </div>
+                                <div class="row small mt-0" style="background-color: RGB(248,248,248)">
+                                    @{{ item.featureFormat }}
+                                </div>
+                            </div>
+                        </div>
                     </div>
                 </div>
-                <table class="table table-sm">
-                    <tr>
-                        <th>操作类型</th>
-                        <th>计费策略</th>
-                        <th>名称</th>
-                        <th>子策略</th>
-                        <th>特征</th>
-                        <th>备注</th>
-                    </tr>
-                    <tr v-for="(operation,i) in selectedModel.operation" :id="'operation-'+i">
-                        <td>@{{ operation.operation_type }}</td>
-                        <td>@{{ operation.strategy }}</td>
-                        <td>@{{ operation.name }}</td>
-                        <td class="cursor-pointer" @click="showOperationItem(i)"><span class="fa" :class="operationItems['_'+i] === true ? 'fa-angle-double-down' : 'fa-angle-double-right'"></span>@{{ operation.items.length }}条策略</td>
-                        <td @mouseenter="textClass($event,true)" @mouseleave="textClass($event,false)"><div class="cursor-pointer text-overflow-replace-100">@{{ operation.featureFormat }}</div></td>
-                        <td @mouseenter="textClass($event,true)" @mouseleave="textClass($event,false)"><div class="cursor-pointer text-overflow-replace-100">@{{ operation.remark }}</div></td>
-                    </tr>
-                </table>
             </div>
         </div>
         <div class="card" id="express-card">
@@ -65,12 +93,56 @@
                 <span class="pull-left font-weight-bold cursor-pointer" @click="show('express')"><span class="fa fa-cube"></span>&nbsp;快递</span>
             </div>
             <div class="card-body" id="express">
-                <div class="row">
+                <table class="table table-sm">
+                    <tr>
+                        <th>承运商</th>
+                        <th>名称</th>
+                        <th>首重值(KG)</th>
+                        <th>续重值(KG)</th>
+                        <th>详情</th>
+                    </tr>
+                    <tbody v-for="(express,i) in selectedModel.express">
+                        <tr>
+                            <td>
+                                <div class="text-overflow-warp-100">
+                                    <label v-for="(logistic,j) in express.logistics">
+                                        @{{ poolMapping.provinces[logistic] }}<label v-if="express.logistics && j<(express.logistics.length-1)">,</label>
+                                    </label>
+                                </div>
+                            </td>
+                            <td>@{{ express.name }}</td>
+                            <td>@{{ express.initial_weight }}</td>
+                            <td>@{{ express.additional_weight }}</td>
+                            <td @click="show('express-item-'+i)">
+                                <span class="fa" :class="upList['express-item-'+i] ? 'fa-angle-double-right' : 'fa-angle-double-down'"></span>
+                                &nbsp;@{{ express.items.length }} 省份</td>
+                        </tr>
+                        <tr>
+                            <td colspan="5">
+                                <div :id="'express-item-'+i">
+                                    <table class="table table-sm col-10">
+                                        <tr>
+                                            <th>省份</th>
+                                            <th>首重价格</th>
+                                            <th>续重价格</th>
+                                        </tr>
+                                        <tr v-for="(item,i) in express.items">
+                                            <td>@{{ poolMapping.provinces[item.province_id] }}</td>
+                                            <td>@{{ item.initial_weight_price }}</td>
+                                            <td>@{{ item.additional_weight_price }}</td>
+                                        </tr>
+                                    </table>
+                                </div>
+                            </td>
+                        </tr>
+                    </tbody>
+                </table>
+               {{-- <div class="row">
                     <label class="col-4">名称:<b>@{{ selectedModel.express.name }}</b></label>
                     <label class="col-4">首重值(KG):<b>@{{ selectedModel.express.initial_weight }}</b></label>
                     <label class="col-4">续重值(KG):<b>@{{ selectedModel.express.additional_weight }}</b></label>
-                </div>
-                <div class="row">
+                </div>--}}
+                {{--<div class="row">
                     <label class="text-primary col-2">详情</label>
                     <table class="table table-sm col-10">
                         <tr>
@@ -84,7 +156,7 @@
                             <td>@{{ item.additional_weight_price }}</td>
                         </tr>
                     </table>
-                </div>
+                </div>--}}
             </div>
         </div>
         <div class="card" id="logistic-card">

+ 3 - 0
routes/web.php

@@ -166,6 +166,9 @@ Route::group(['prefix'=>'maintenance'],function(){
     Route::group(['prefix'=>"log"],function (){
         Route::get("exception",'LogController@exception');
     });
+    Route::group(['prefix'=>"logistic"],function (){
+        Route::post("get",'LogisticController@get');
+    });
 
     Route::get('syncRedisLogs','LogController@syncRedisLogs');
     Route::resource('log', 'LogController');