فهرست منبع

客户管理-作业计费 满减多阶段匹配

Zhouzhendong 5 سال پیش
والد
کامیت
223fa9b698

+ 3 - 3
app/Http/Controllers/PriceModelController.php

@@ -1059,9 +1059,9 @@ class PriceModelController extends Controller
             "strategy"          => request("strategy"),
             "feature"           => request("feature"),
             "remark"            => request("remark"),
-            "discount_count"    => request("discount_count"),
+            "discount_count"    => implode(",",request("discount_count")),
             "total_price"       => request("total_price"),
-            "total_discount_price"=> request("total_discount_price"),
+            "total_discount_price"=> implode(",",request("total_discount_price")),
         ];
         if (request("id")){
             $model = app('OwnerPriceOperationService')->find(request("id"),["items"]);
@@ -1076,7 +1076,7 @@ class PriceModelController extends Controller
                     "unit_id"   => $item["unit_id"],
                     "unit_price"=> $item["unit_price"],
                     "feature"   => $item["feature"] ?? null,
-                    "discount_price"   => $item["discount_price"] ?? null,
+                    "discount_price"   => implode(",",$item["discount_price"] ?? []),
                 ];
                 if (isset($item["id"])){
                     $obj["id"] = $item["id"];

+ 5 - 2
app/Http/Controllers/TestController.php

@@ -133,9 +133,12 @@ class TestController extends Controller
     {
         return call_user_func([$this, $method], $request);
     }
-
     public function zzd(){
-
+        $str = "1,2,3,4,5";
+        foreach (array_reverse(explode(",",$str),true) as $index=>$discount){
+            dump($index,$discount);
+        }
+        dd();
     }
 
     public function syncWeight()

+ 1 - 1
app/RejectedBill.php

@@ -167,7 +167,7 @@ class RejectedBill extends Model
             $orderIssue->update(['is_new_rejecting'=>'无']);
             $orderIssue->syncRejectingStatus();
         }
-        return parent::delete(); // TODO: Change the autogenerated stub
+        return parent::delete();
     }
 
     public function joinOrderIssue()

+ 20 - 8
app/Services/OwnerPriceOperationService.php

@@ -105,6 +105,8 @@ class OwnerPriceOperationService
      * 三. 2021-01-28 zzd
      *      增加满减策略:子策略匹配时不再考虑单,仅件箱换算,满减满足后标记模型修改历史对账单
      *      增加按订单计价策略:主匹配模型增加字段量价,该字段存在时视为按单计价,价格为该值
+     * 四. 2021-02-18 zzd
+     *      满减多阶段匹配 满减字段由单值改为字符串多值 匹配时转数组寻找最相近
      */
     public function matching($matchObject, $columnMapping, $owner_id, $type = '出库')
     {
@@ -126,7 +128,16 @@ class OwnerPriceOperationService
         foreach ($rules as $rule){
             if (!$rule->items)continue; //不存在子规则跳出
             $isDiscount = false;    //是否存在满减
-            if ($type=='出库' && $rule->discount_count > 0 && $total >= $rule->discount_count)$isDiscount = true;//满足满减条件
+            $discountIndex = 0;
+            if ($type=='出库' && $rule->discount_count){
+                foreach (array_reverse(explode(",",$rule->discount_count),true) as $index=>$discount){
+                    if ($total >= $rule->discount_count){
+                        $isDiscount = true; //第一个满足满减条件
+                        $discountIndex = $index;
+                        break;
+                    }
+                }
+            }
             //满减存在且未被标记过处理时间或处理时间不为本月,处理历史即时账单
             if ($isDiscount && (!$rule->discount_date || substr($rule->discount_date,0,7)!=date("Y-m"))){
                 try{
@@ -159,7 +170,7 @@ class OwnerPriceOperationService
                         $mapping = ["packages"=>"commodities","商品名称"=>"commodity_name",
                             "承运商"=>"logistic_name", "店铺类型"=>"shop_name",
                             "订单类型"=>"order_type","波次类型"=>"batch_type"];
-                        $money = $this->matchItem($rule->items,$mapping,$object,$units,$owner_id,'出库',$isDiscount);
+                        $money = $this->matchItem($rule->items,$mapping,$object,$units,$owner_id,false,$isDiscount,$discountIndex);
                         if ($money>0)$detail->update(["work_fee"=>$money]);
                         else LogService::log(__CLASS__,"处理历史即时账单时发生匹配错误","账单主键:".$detail->id."; 错误代码".$money);
                     };
@@ -173,13 +184,13 @@ class OwnerPriceOperationService
             if ($rule->strategy == '特征'){//特征策略匹配
                 $bool = app("FeatureService")->matchFeature($rule->feature,$columnMapping,$matchObject);
                 if ($bool === true){
-                    if ($rule->total_price)return ["id"=>$rule->id,"money"=>$isDiscount ? $rule->total_discount_price : $rule->total_price]; //按单计价存在,直接返回单总价或减免总价
-                    $money = $this->matchItem($rule->items,$columnMapping,$matchObject,$units,$owner_id,$type=='入库' ? true : false,$isDiscount);
+                    if ($rule->total_price)return ["id"=>$rule->id,"money"=>$isDiscount ? explode(",",$rule->total_discount_price)[$discountIndex] : $rule->total_price]; //按单计价存在,直接返回单总价或减免总价
+                    $money = $this->matchItem($rule->items,$columnMapping,$matchObject,$units,$owner_id,$type=='入库' ? true : false,$isDiscount,$discountIndex);
                     if ($money>0)return ["id"=>$rule->id,"money"=>$money];
                 };
             }else{//默认策略匹配
-                if ($rule->total_price)return ["id"=>$rule->id,"money"=>$isDiscount ? $rule->total_discount_price : $rule->total_price]; //按单计价存在,直接返回单总价或减免总价
-                $money = $this->matchItem($rule->items,$columnMapping,$matchObject,$units,$owner_id,$type=='入库' ? true : false,$isDiscount);
+                if ($rule->total_price)return ["id"=>$rule->id,"money"=>$isDiscount ? explode(",",$rule->total_discount_price)[$discountIndex] : $rule->total_price]; //按单计价存在,直接返回单总价或减免总价
+                $money = $this->matchItem($rule->items,$columnMapping,$matchObject,$units,$owner_id,$type=='入库' ? true : false,$isDiscount,$discountIndex);
                 if ($money>0)return ["id"=>$rule->id,"money"=>$money];
             };
         }
@@ -213,10 +224,11 @@ class OwnerPriceOperationService
      * @param integer $owner_id 货主ID
      * @param bool $isIn 是否为入库单
      * @param bool $isDiscount 是否为满减单
+     * @param int $discountIndex 阶梯满减所处下标  满减价格此处应为 1,2,3 解析为数组后根据此下标寻找对应值
      *
      * @return double
      */
-    private function matchItem($rules, $columnMapping, $matchObject, $units, $owner_id, $isIn, $isDiscount)
+    private function matchItem($rules, $columnMapping, $matchObject, $units, $owner_id, $isIn, $isDiscount, $discountIndex)
     {
         $amountColumn = $columnMapping["amount"] ?? "amount";
         $packageColumn = $columnMapping["packages"] ?? "packages";
@@ -226,7 +238,7 @@ class OwnerPriceOperationService
 
         $unitName = "";
         foreach ($rules as $rule){
-            if ($isDiscount)$rule->unit_price = $rule->discount_price; //满足满减条件,单价调整为满减单价
+            if ($isDiscount)$rule->unit_price = explode(",",$rule->discount_price)[$discountIndex]; //满足满减条件,单价调整为满减单价
             switch ($rule->strategy){
                 case "特征":
                     $inMoney = 0;

+ 16 - 11
app/Services/OwnerStoragePriceModelService.php

@@ -63,23 +63,28 @@ class OwnerStoragePriceModelService
                             ->where("owner_id",$owner_id)
                             ->where("counting_month","like",$month."%")->first();
                         $money -= $report ? ($report->total)*($model->discount_value) : 0;
+                    }else{
+                        $days = date('t', strtotime($month."-01"));
+                        $money *= $days;
+                        for($i=1;$i<=$days;$i++){
+                            $d = $i<10 ? "0".$i : $i;
+                            $query = DB::raw("SELECT COUNT(1) c FROM orders WHERE wms_status = ? and updated_at between ? and ?");
+                            $count = DB::selectOne($query,['订单完成',$month."-".$d." 00:00:00",$month."-".$d." 23:59:59"]);
+                            $money -= $count ? ($count->c)*($model->discount_value) : 0;
+                        }
                     }
                 }
                 break;
             case "固定减免":
-                $money -= $model->discount_value;
+                if ($model->timeUnit->name == '月'){
+                    $money -= $model->discount_value;
+                }else{
+                    $days = date('t', strtotime($month."-01"));
+                    $money *= $days;
+                    $money -= $days*$model->discount_value;
+                }
                 break;
         }
-        if ($model->timeUnit->name == '日'){
-            $days = date('t', strtotime($month."-01"));
-            $money *= $days;
-            for($i=1;$i<=$days;$i++){
-                $d = $i<10 ? "0".$i : $i;
-                $query = DB::raw("SELECT COUNT(1) c FROM orders WHERE wms_status = ? and updated_at between ? and ?");
-                $count = DB::selectOne($query,['订单完成',$month."-".$d." 00:00:00",$month."-".$d." 23:59:59"]);
-                $money -= $count ? ($count->c)*($model->discount_value) : 0;
-            }
-        }
         return $money;
     }
 }

+ 41 - 0
database/migrations/2021_02_18_105955_change_owner_operation_table.php

@@ -0,0 +1,41 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class ChangeOwnerOperationTable extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::table('owner_price_operations', function (Blueprint $table) {
+            $table->string("discount_count")->nullable()->comment("减免数")->change();
+            $table->string("total_discount_price")->nullable()->comment("减免总价")->change();
+        });
+        Schema::table('owner_price_operation_items', function (Blueprint $table) {
+            $table->string("discount_price")->nullable()->comment("减免单价")->change();
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::table('owner_price_operations', function (Blueprint $table) {
+            $table->integer("discount_count")->nullable()->comment("减免数")->change();
+            $table->decimal("total_discount_price")->nullable()->comment("减免总价")->change();
+        });
+        Schema::table('owner_price_operation_items', function (Blueprint $table) {
+            $table->integer("discount_price")->nullable()->comment("减免单价")->change();
+        });
+    }
+}
+

+ 1 - 1
resources/views/customer/finance/instantBill.blade.php

@@ -47,7 +47,7 @@
                     <td :rowspan="bill.rowspan">@{{ bill.consigneePhone }}</td>
                     <td>@{{ bill.commodityAmount }}</td>
                     <td>
-                        <span v-if="bill.rowspan < 1">@{{ bill.logisticBill }}</span>
+                        <span v-if="bill.rowspan <= 1">@{{ bill.logisticBill }}</span>
                         <span v-else class="font-weight-bold text-secondary">分箱:</span>
                     </td>
                     <td>@{{ bill.volume }}</td>

+ 56 - 18
resources/views/customer/project/create.blade.php

@@ -141,12 +141,14 @@
                     operation:{
                         operation_type:"入库",
                         strategy:"默认",
+                        discount_count:[''],
                         name:"",
                         feature:"",
+                        total_discount_price:[''],
                         items : [
-                            {strategy:"起步",type:"0"},
-                            {strategy:"默认"},
-                            {strategy:"特征"},
+                            {strategy:"起步",type:"0",discount_price:['']},
+                            {strategy:"默认",discount_price:['']},
+                            {strategy:"特征",discount_price:['']},
                         ],
                     },
                     express:{
@@ -203,7 +205,7 @@
                 hover:{},
             },
             mounted(){
-                let type = "{{$type}}";
+                let type = "{{$type ?? ''}}";
                 if (type){
                     this.base = "three";
                     setTimeout(()=>{
@@ -421,8 +423,15 @@
                         if (res.owner_storage_price_models.length>0)this.selectedModel.storage = res.owner_storage_price_models;
                         if (res.owner_price_operations.length>0){
                             this._loadOperation();
-                            res.owner_price_operations.forEach((operation)=>{
-                                if (operation.discount_count)operation.isDiscount = true;
+                            res.owner_price_operations.forEach((operation,i)=>{
+                                if (operation.discount_count){
+                                    res.owner_price_operations[i].discount_count = operation.discount_count.split(",");
+                                    res.owner_price_operations[i].total_discount_price = operation.total_discount_price.split(",");
+                                    operation.isDiscount = true;
+                                }
+                                operation.items.forEach((item,i)=>{
+                                    res.owner_price_operations[i].items[i].discount_price = item.discount_price.split(",");
+                                });
                                 if (operation.total_price)operation.isSingle = true;
                             });
                             this.selectedModel.operation = res.owner_price_operations;
@@ -617,20 +626,33 @@
                         this.$forceUpdate();
                         return;
                     }
-                    if (this.model.operation.isDiscount && !this.model.operation.discount_count){
-                        this.errors["discount_count"] = ["满减值不存在"];
-                        this.$forceUpdate();
-                        return;
+                    if (this.model.operation.isDiscount){
+                        let sign = false;
+                        this.model.operation.discount_count.forEach((item,i)=>{
+                            if (!item || (i!==0 && item<=this.model.operation.discount_count[i-1])){
+                                this.errors["discount_count_"+i] = ["非法满减值"];
+                                sign = true;
+                            }
+                        });
+                        if (sign){
+                            this.$forceUpdate();
+                            return;
+                        }
                     }
                     if (this.model.operation.isSingle && !this.model.operation.total_price){
                         this.errors["total_price"] = ["按单价格不存在"];
                         this.$forceUpdate();
                         return;
                     }
-                    if (this.model.operation.isDiscount && this.model.operation.isSingle && !this.model.operation.total_discount_price){
-                        this.errors["total_discount_price"] = ["满减价格不存在"];
-                        this.$forceUpdate();
-                        return;
+                    if (this.model.operation.isDiscount && this.model.operation.isSingle){
+                        if (!this.model.operation.total_discount_price[0]){
+                            this.errors["total_discount_price"] = ["满减价格不存在"];
+                            this.$forceUpdate();
+                            return;
+                        }
+                        this.model.operation.total_discount_price.forEach((item,i)=>{
+                            if (i!==0 && !item)this.model.operation.total_discount_price[i] =  this.model.operation.total_discount_price[i-1];
+                        })
                     }
                     if (!this.model.operation.isSingle){
                         if ((this.model.operation.operation_type === '出库' && this._verifyOperationItem(0)) || this._verifyOperationItem(1))return;
@@ -642,8 +664,8 @@
                         this.model.operation.total_price = "";
                     }else this.$set(this.model.operation,"items",[]);
                     if (!this.model.operation.isDiscount) {
-                        this.model.operation.discount_count = "";
-                        this.model.operation.total_discount_price = "";
+                        this.model.operation.discount_count = [""];
+                        this.model.operation.total_discount_price = [""];
                     }
                     let url = "{{url('maintenance/priceModel/apiStoreOperation')}}";
                     let params = this.model.operation;
@@ -706,9 +728,17 @@
                     }else if (!obj.unit_id) obj.unit_id = 0;
                     if (!obj.unit_price){
                         this.errors['items.'+itemIndex+'.unit_price'] = ["单价不得为空"];
+                        sign = true;
                     }
-                    if (this.model.operation.isDiscount && !obj.discount_price){
-                        this.errors['items.'+itemIndex+'.discount_price'] = ["满减单价不得为空"];
+                    if (this.model.operation.isDiscount){
+                        if (!obj.discount_price[0]){
+                            this.errors['items.'+itemIndex+'.discount_price'] = ["满减单价不得为空"];
+                            sign = true;
+                        }else{
+                            obj.discount_price.forEach((item,i)=>{
+                                if (i!==0&&!item) obj.discount_price[i]=obj.discount_price[i-1];
+                            })
+                        }
                     }
                     if (sign)this.$forceUpdate();
                     return sign;
@@ -1517,6 +1547,14 @@
                     });
                     this.$set(this.searchItem,'logistic',items);
                 },
+                //增加阶梯满减阈值
+                addDiscount(arr){
+                    this.model.operation.items.forEach(item=>{
+                        item.discount_price.push('');
+                    });
+                    this.model.operation.total_discount_price.push("");
+                    arr.push('');
+                },
             },
         });
     </script>

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

@@ -38,9 +38,18 @@
         <input type="checkbox" id="isDiscount" class="rounded mt-1" v-model="model.operation.isDiscount">
     </div>
     <div class="col-8 row" v-if="model.operation.isDiscount">
-        <label class="col-3" for="discount">满减值</label>
-        <input id="discount" v-model="model.operation.discount_count"
-               class="form-control form-control-sm col-6" :class="errors.discount_count ? 'is-invalid' : ''" step="1" type="number" min="0">
+        <div class="col-1 cursor-pointer"><span class="fa fa-plus" @click="addDiscount(model.operation.discount_count)"></span></div>
+        <label class="col-3" for="discount">满减阈值</label>
+        <input id="discount" v-model="model.operation.discount_count[0]"
+               class="form-control form-control-sm col-6" step="1" type="number" min="0">
+    </div>
+</div>
+<div class="row mt-1" v-for="(value,i) in model.operation.discount_count" v-if="model.operation.discount_count.length>1 && i!=0">
+    <label class="col-2"></label><div class="col-2"></div>
+    <div class="col-8 row">
+        <label class="offset-1 col-3">满减阈值@{{ i+1 }}</label>
+        <input v-model="model.operation.discount_count[i]" :placeholder="Number(model.operation.discount_count[i-1])+1"
+               class="form-control form-control-sm col-6" step="1" type="number" :min="Number(model.operation.discount_count[i-1])+1">
     </div>
 </div>
 <div class="row mt-3">
@@ -54,11 +63,11 @@
                class="form-control form-control-sm col-6" :class="errors.total_price ? 'is-invalid' : ''" step="0.001" type="number" min="0">
     </div>
 </div>
-<div class="row mt-1" v-if="model.operation.isSingle && model.operation.isDiscount">
+<div class="row mt-1" v-if="model.operation.isSingle && model.operation.isDiscount" v-for="(value,i) in model.operation.discount_count">
     <label class="col-2"></label><div class="col-2"></div>
     <div class="col-8 row">
-        <label class="col-3" for="total_discount_price">满减价</label>
-        <input id="total_discount_price" v-model="model.operation.total_discount_price"
+        <label class="col-3" for="total_discount_price">满减价(@{{ value }}单)</label>
+        <input id="total_discount_price" v-model="model.operation.total_discount_price[i]"
                class="form-control form-control-sm col-6" :class="errors.total_discount_price ? 'is-invalid' : ''" step="0.001" type="number" min="0">
     </div>
 </div>
@@ -106,14 +115,11 @@
                     <div class="row mt-0" v-if="errors['items.0.unit_price']">
                         <div class="offset-3"><small class="text-danger font-weight-bold ml-3">起步费为必填项</small></div>
                     </div>
-                    <div class="row mt-2" v-if="model.operation.isDiscount">
-                        <label class="col-3">满减起步费</label>
-                        <label class="col-5 mb-0"><input type="number" min="0" step="0.001" class="form-control" v-model="model.operation.items[0].discount_price"
+                    <div class="row mt-2" v-if="model.operation.isDiscount" v-for="(value,i) in model.operation.discount_count">
+                        <label class="col-3">满减起步费(@{{ value }}单)</label>
+                        <label class="col-5 mb-0"><input type="number" min="0" step="0.001" class="form-control" v-model="model.operation.items[0].discount_price[i]"
                                                          :class="errors['items.0.discount_price'] ? 'is-invalid' : ''"></label>
                     </div>
-                    <div class="row mt-0" v-if="errors['items.0.discount_price']">
-                        <div class="offset-3"><small class="text-danger font-weight-bold ml-3">满减起步费为必填项</small></div>
-                    </div>
                 </div>
             </div>
         </div>
@@ -159,14 +165,11 @@
             <div class="row mt-0" v-if="errors['items.1.unit_price']">
                 <div class="offset-3"><small class="text-danger font-weight-bold ml-3">单价为必填项</small></div>
             </div>
-            <div class="row mt-2" v-if="model.operation.isDiscount">
-                <label class="col-3">满减价</label>
-                <label class="col-5 mb-0"><input type="number" min="0" step="0.001" class="form-control" v-model="model.operation.items[1].discount_price"
+            <div class="row mt-2" v-if="model.operation.isDiscount" v-for="(value,i) in model.operation.discount_count">
+                <label class="col-3">满减价(@{{ value }}单)</label>
+                <label class="col-5 mb-0"><input type="number" min="0" step="0.001" class="form-control" v-model="model.operation.items[1].discount_price[i]"
                                                  :class="errors['items.1.discount_price'] ? 'is-invalid' : ''"></label>
             </div>
-            <div class="row mt-0" v-if="errors['items.1.discount_price']">
-                <div class="offset-3"><small class="text-danger font-weight-bold ml-3">满减单价为必填项</small></div>
-            </div>
         </div>
     </div>
 
@@ -210,14 +213,11 @@
             <div class="row mt-0" v-if="errors['items.'+i+'.unit_price']">
                 <div class="offset-3"><small class="text-danger font-weight-bold ml-3">单价为必填项</small></div>
             </div>
-            <div class="row mt-2" v-if="model.operation.isDiscount">
-                <label class="col-3">满减价</label>
-                <label class="col-5 mb-0"><input type="number" min="0" step="0.001" class="form-control" v-model="item.discount_price"
+            <div class="row mt-2" v-if="model.operation.isDiscount" v-for="(value,i) in model.operation.discount_count">
+                <label class="col-3">满减价(@{{ value }}单)</label>
+                <label class="col-5 mb-0"><input type="number" min="0" step="0.001" class="form-control" v-model="item.discount_price[i]"
                                                  :class="errors['items.'+i+'.discount_price'] ? 'is-invalid' : ''"></label>
             </div>
-            <div class="row mt-0" v-if="errors['items.'+i+'.discount_price']">
-                <div class="offset-3"><small class="text-danger font-weight-bold ml-3">满减单价为必填项</small></div>
-            </div>
             <div class="row mt-2">
                 <label class="col-3">特征:</label>
                 <label class="col-5">

+ 17 - 14
resources/views/customer/project/part/_three.blade.php

@@ -3,7 +3,7 @@
         <div class="card" id="storage-card">
             <div class="card-header bg-light-info">
                 <span class="pull-left font-weight-bold cursor-pointer text-secondary" @click="show('storage')"><span class="fa fa-align-justify"></span>&nbsp;仓储</span>
-                <span class="pull-right small mb-0 text-secondary">双击下方已添加内容可编辑</span>
+                <span class="pull-right small mb-0 text-secondary" v-if="selectedModel.storage.length>0">双击下方已添加内容可编辑</span>
             </div>
             <div class="card-body" id="storage">
                 <table class="table table-sm">
@@ -37,7 +37,7 @@
         <div class="card" id="operation-card">
             <div class="card-header bg-light-info">
                 <span class="pull-left font-weight-bold cursor-pointer text-secondary" @click="show('operation')"><span class="fa fa-align-justify"></span>&nbsp;作业</span>
-                <span class="pull-right small mb-0 text-secondary">双击下方已添加内容可编辑</span>
+                <span class="pull-right small mb-0 text-secondary" v-if="selectedModel.operation.length>0">双击下方已添加内容可编辑</span>
             </div>
             <div class="card-body" id="operation">
                 <div class="container-fluid">
@@ -61,14 +61,11 @@
                                           v-if="operation.strategy == '特征'" @click.stop="delOperation(operation,i)">&times;</span>
                                 </div>
                             </div>
-                            <div class="row offset-1 small mt-0" style="background-color: RGB(248,248,248)" v-if="operation.discount_count">
-                                <span class="text-secondary">满减阈值:</span><b>@{{ operation.discount_count }}</b>
-                            </div>
                             <div class="row offset-1 small mt-0" style="background-color: RGB(248,248,248)" v-if="operation.strategy === '特征'">
                                 <span class="text-secondary">特征:</span>@{{ operation.featureFormat }}
                             </div>
                             <div class="container-fluid offset-2" v-if="operation.isSingle">
-                                按单计费:<b>@{{ operation.total_price }}</b>&nbsp;元/单<span v-if="operation.isDiscount">&nbsp;(满减价格:<b>@{{ operation.total_discount_price }}</b>&nbsp;元/单)</span>
+                                按单计费:<b>@{{ operation.total_price }}</b>&nbsp;元/单
                             </div>
                             <div class="container-fluid offset-2" :id="'operation-item-'+i">
                                 <div v-for="(item,j) in operation.items" class="container-fluid">
@@ -110,14 +107,15 @@
                                           v-if="operation.strategy == '特征'" @click.stop="delOperation(operation,i)">&times;</span>
                                 </div>
                             </div>
-                            <div class="row offset-1 small mt-0" style="background-color: RGB(248,248,248)" v-if="operation.discount_count">
-                                <span class="text-secondary">满减阈值:</span><b>@{{ operation.discount_count }}</b>
-                            </div>
                             <div class="row offset-1 small mt-0" style="background-color: RGB(248,248,248)" v-if="operation.strategy === '特征'">
                                 <span class="text-secondary">特征:</span>@{{ operation.featureFormat }}
                             </div>
                             <div class="container-fluid offset-2" v-if="operation.isSingle">
-                                按单计费:<b>@{{ operation.total_price }}</b>&nbsp;元/单<span v-if="operation.isDiscount">&nbsp;(满减价格:<b>@{{ operation.total_discount_price }}</b>&nbsp;元/单)</span>
+                                按单计费:<b>@{{ operation.total_price }}</b>&nbsp;元/单<span v-if="operation.isDiscount">&nbsp;(满减价:
+                                    <span v-for="(value,i) in operation.total_discount_price">
+                                        <span v-if="i!=0">,</span>
+                                        <b>@{{ operation.discount_count[i] }}</b>&nbsp;单(<b>@{{ value }}</b>元)
+                                    </span>)</span>
                             </div>
                             <div class="container-fluid offset-2" :id="'operation-item-'+i">
                                 <div v-for="(item,j) in operation.items" class="container-fluid">
@@ -125,7 +123,12 @@
                                         <div class="col-10">
                                             <label>@{{ item.strategy }}</label>:
                                             <span v-if="item.amount > 0"><b>@{{ item.amount }}</b>&nbsp;@{{ poolMapping.units ? poolMapping.units[item.unit_id] : '' }} /</span><b>&nbsp;@{{ item.unit_price }}</b>元
-                                            <span v-if="operation.isDiscount">&nbsp;(满减单价:<b>@{{ item.discount_price }}元</b>)</span>
+                                            <span v-if="operation.isDiscount">&nbsp;(满减单价:
+                                                <span v-for="(value,i) in item.discount_price">
+                                                    <span v-if="i!=0">,</span>
+                                                    <b>@{{ operation.discount_count[i] }}</b>&nbsp;单(<b>@{{ value }}</b>元)
+                                                </span>
+                                                )</span>
                                         </div>
                                         <div class="col-1">
                                             <span class="cursor-pointer text-danger font-weight-bold"
@@ -145,7 +148,7 @@
         <div class="card" id="express-card">
             <div class="card-header bg-light-info">
                 <span class="pull-left font-weight-bold cursor-pointer text-secondary" @click="show('express')"><span class="fa fa-align-justify"></span>&nbsp;快递</span>
-                <span class="pull-right small mb-0 text-secondary">双击下方已添加内容可编辑</span>
+                <span class="pull-right small mb-0 text-secondary" v-if="selectedModel.express.length>0">双击下方已添加内容可编辑</span>
             </div>
             <div class="card-body" id="express">
                 <table class="table table-sm">
@@ -203,7 +206,7 @@
         <div class="card" id="logistic-card">
             <div class="card-header bg-light-info">
                 <span class="pull-left font-weight-bold cursor-pointer text-secondary" @click="show('logistic')"><span class="fa fa-align-justify"></span>&nbsp;物流</span>
-                <span class="pull-right small mb-0 text-secondary">双击下方已添加内容可编辑</span>
+                <span class="pull-right small mb-0 text-secondary" v-if="selectedModel.logistic.length>0">双击下方已添加内容可编辑</span>
             </div>
             <div class="card-body" id="logistic">
                 <table class="table table-sm">
@@ -284,7 +287,7 @@
         <div class="card" id="directLogistic-card">
             <div class="card-header bg-light-info">
                 <span class="pull-left font-weight-bold cursor-pointer text-secondary" @click="show('directLogistic')"><span class="fa fa-align-justify"></span>&nbsp;直发</span>
-                <span class="pull-right small mb-0 text-secondary">双击下方已添加内容可编辑</span>
+                <span class="pull-right small mb-0 text-secondary" v-if="selectedModel.directLogistic.name">双击下方已添加内容可编辑</span>
             </div>
             <div class="card-body" id="directLogistic" @dblclick="editDirectLogistic()" style="cursor: pointer">
                 <div class="row">

+ 1 - 1
resources/views/process/index.blade.php

@@ -1134,7 +1134,7 @@
                     })
                 },
                 //同名临时工选择
-                selectedUser(userLabor) { // TODO:此处如返回开始与结束时间 计时工时并不会发生改变
+                selectedUser(userLabor) { // 此处如返回开始与结束时间 计时工时并不会发生改变
                     $("#myModal").modal('hide');
                     this.errors['user_id'] = "";
                     this.processDailyParticipantOne['user_id'] = userLabor.user_id;