Jelajahi Sumber

逾期收货 页面颜色区分 接近绿色
入库预约与收货联动 需要设定规则指定客户

Zhouzhendong 4 tahun lalu
induk
melakukan
53444deda7

+ 9 - 1
app/DeliveryAppointment.php

@@ -3,6 +3,7 @@
 namespace App;
 
 use App\Traits\ModelTimeFormat;
+use Carbon\Carbon;
 use Illuminate\Database\Eloquent\Model;
 
 use App\Traits\ModelLogChanging;
@@ -31,7 +32,6 @@ class DeliveryAppointment extends Model
         "remark",
     ];
     //时段 映射date_period字段 必须有序 否则展示数据错乱
-    //2021-08-04 在此之前所有 period为1的时间都为13-17
     const PERIOD=[
         0 => "09-11",
         1 => "12-14",
@@ -88,7 +88,15 @@ class DeliveryAppointment extends Model
         return $this->belongsTo(Logistic::class);
     }
 
+    /**
+     * 2021-08-05 在此之前所有 period为1的时间都为13-17
+     *
+     * @return string
+     */
     public function getPeriodAttribute(){
+        /** @var Carbon $create */
+        $create = $this["created_at"];
+        if ($create->lt(Carbon::parse("2021-08-05")) && $this["date_period"]==1)return '13-17';
         return self::PERIOD[$this["date_period"]];
     }
 }

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

@@ -11,6 +11,7 @@ use App\Owner;
 use App\OwnerFeeDetail;
 use App\OwnerPriceOperation;
 use App\RejectedBill;
+use App\Unit;
 use Illuminate\Http\Request;
 use Illuminate\Support\Facades\DB;
 use Illuminate\Support\Facades\Http;
@@ -46,7 +47,7 @@ class TestController extends Controller
     }
     public function test()
     {
-        dd(RejectedBill::query()->where("is_finished",false)->count());
+        dd(!!Unit::query()->first());
     }
 
 }

+ 7 - 3
app/Services/DeliveryAppointmentService.php

@@ -4,6 +4,7 @@ namespace App\Services;
 
 use App\CommodityBarcode;
 use App\DeliveryAppointmentDetail;
+use App\Owner;
 use App\Services\common\QueryService;
 use App\Traits\ServiceAppAop;
 use App\DeliveryAppointment;
@@ -211,11 +212,14 @@ class DeliveryAppointmentService
      * 检查可操作ASN
      *
      * @param string $asn
-     * @param string $customerid
+     * @param string $ownerCode
      * @return bool
      */
-    public function checkOperableAsn(string $asn,string $customerid):bool
+    public function checkOperableAsn(string $asn,string $ownerCode):bool
     {
-        return true;
+        if (!Owner::query()->where("code",$ownerCode)->where("is_check_asn",1)->first())return true;
+        return !!DeliveryAppointment::query()->selectRaw("1")->where("status",'!=',1)
+            ->where("appointment_date",date("Y-m-d"))
+            ->where("asn_number",'like',"%{$asn}%")->first();
     }
 }

+ 5 - 0
resources/sass/text.scss

@@ -296,3 +296,8 @@
     box-shadow: 0px 0px 0px 1px #ddd;
     color: inherit;
 }
+
+//文本颜色
+.text-greed{
+    color: #27864f !important;
+}

+ 2 - 2
resources/views/store/deliveryAppointment/list.blade.php

@@ -98,7 +98,7 @@
                                 <span class="fa fa-circle text-secondary">未知</span>
                             </label>
                             <label v-else>
-                                <small><span class="fa fa-circle" :class="info.status==0 ? 'text-info' : (info.status==2 ? 'text-success' : 'text-danger')"></span></small>
+                                <small><span class="fa fa-circle" :class="info.status==0 ? 'text-info' : (info.status==2 ? 'text-success' : (info.status==4 ? 'text-greed' : 'text-danger'))"></span></small>
                                 @{{ poolMapping.status[info.status] }}
                                 <span v-if="info.type_mark==0" class="badge badge-primary">质检单</span>
                             </label>
@@ -544,7 +544,7 @@
                 },
                 warpText(code){
                     if (!code)return code;
-                    code = code.split(/[,, ]+/is);
+                    code = code.split(/[,\/, ]+/is);
                     let str = "";
                     for (let i=0;i<code.length;i++){
                         str += code[i]+"<br>";