Przeglądaj źródła

需求ID161 项目管理部分BUG修复

Zhouzhendong 5 lat temu
rodzic
commit
e4aa0514c9

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

@@ -1119,7 +1119,7 @@ class PriceModelController extends Controller
 
     public function apiStoreStorage()
     {
-        $this->gate("项目管理-项目-录入");
+        $this->gate("项目管理-仓储-录入");
         $errors = $this->storageValidator(request()->input())->errors();
         if (count($errors)>0)$this->success(["errors"=>$errors]);
 
@@ -1153,7 +1153,7 @@ class PriceModelController extends Controller
 
     public function apiStoreOperation()
     {
-        $this->gate("计费模型-仓储-录入");
+        $this->gate("计费模型-作业-录入");
         $params = request()->input();
         $params["owner_id"] = [$params["owner_id"]];
         $errors = $this->operationValidator($params,request("id"))->errors();

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

@@ -178,13 +178,39 @@ class TestController extends Controller
 
         return array(null,null);
     }
-    public function restoreWaybill()
+    public function restoreAreaReport()
     {
         ini_set('max_execution_time', 2500);
-        $waybills = Waybill::query()->whereNotNull("wms_bill_number")->whereNull("order_id")->get();
-        foreach ($waybills as $waybill){
-            $order = Order::query()->where("code",$waybill->wms_bill_number)->first();
-            if ($order)$waybill->update(["order_id"=>$order->id]);
+        foreach (Owner::query()->get() as $owner) {
+            if (!$owner->ownerStoragePriceModels) continue;
+            foreach ($owner->ownerStoragePriceModels as $model) {
+                $report = OwnerAreaReport::query()
+                    ->where("counting_month", ">=", date("Y-m") . "-01")
+                    ->where("owner_id", $owner->id)
+                    ->where("owner_storage_price_model_id", $model->id)->first();
+                if (!$report) {
+                    OwnerAreaReport::query()->create([
+                        "owner_id" => $owner->id,
+                        "counting_month" => date('Y-m-d'),
+                        "user_owner_group_id" => $owner->user_owner_group_id,
+                        "created_at" => date('Y-m-d H:i:s'),
+                        "owner_storage_price_model_id" => $model->id,
+                    ]);
+                }
+                $report = OwnerAreaReport::query()
+                    ->where("counting_month", ">=", "2021-03-01")
+                    ->where("owner_id", $owner->id)
+                    ->where("owner_storage_price_model_id", $model->id)->first();
+                if (!$report) {
+                    OwnerAreaReport::query()->create([
+                        "owner_id" => $owner->id,
+                        "counting_month" => "2021-03-01",
+                        "user_owner_group_id" => $owner->user_owner_group_id,
+                        "created_at" => date('Y-m-d H:i:s'),
+                        "owner_storage_price_model_id" => $model->id,
+                    ]);
+                }
+            }
         }
     }
     public function restoreBatch()

+ 5 - 7
app/Jobs/ResetInstantBill.php

@@ -114,7 +114,7 @@ class ResetInstantBill implements ShouldQueue
                 $service = app("OwnerPriceOperationService");
                 list($id,$money,$workTaxFee) = $service->matching($order,Feature::MAPPING["order"],$order->owner_id,"出库");
 
-                $detail = $this->detail->update([
+                $this->detail->update([
                     "owner_id"          => $order->owner_id,
                     "worked_at"         => $order->wms_edittime ?? $order->updated_at,
                     "shop_id"           => $order->shop_id,
@@ -132,12 +132,10 @@ class ResetInstantBill implements ShouldQueue
                     "work_tax_fee"      => $workTaxFee,
                     "logistic_tax_fee"  => $logistic_fee ? $logisticTaxFee : null,
                 ]);
-                if ($detail){
-                    OwnerFeeDetailLogistic::query()->where("owner_fee_detail_id",$detail->id)->delete();
-                    foreach ($items as &$item)$item["owner_fee_detail_id"] = $detail->id;
-                    if (count($items)>1)OwnerFeeDetailLogistic::query()->insert($items);
-                    app("OrderService")->setOrderQuantity($order->owner_id,$order->logistic_id);
-                }
+                OwnerFeeDetailLogistic::query()->where("owner_fee_detail_id",$this->detail->id)->delete();
+                foreach ($items as &$item)$item["owner_fee_detail_id"] = $this->detail->id;
+                if (count($items)>1)OwnerFeeDetailLogistic::query()->insert($items);
+                app("OrderService")->setOrderQuantity($order->owner_id,$order->logistic_id);
                 break;
             case "processes":
                 /** @var \stdClass $process */

+ 5 - 3
resources/views/customer/project/area.blade.php

@@ -29,12 +29,14 @@
                     </td>
                     <td><span>@{{ i+1 }}</span></td>
                     <td>
-                        <span v-if="area.status=='编辑中'">
+                        <span>
+                            <span v-if="area.status=='编辑中'">
                             <button class="btn btn-sm btn-outline-info" @click="edit(area,i)">编辑</button>
                             @can("项目管理-项目-用仓盘点-审核")<button class="btn btn-sm btn-outline-success" v-if="area.accountingArea" @click="audit(i)">审核</button>@endcan
+                            </span>
+                            <span v-if="area.status=='已完成'" class="text-success font-weight-bold">@{{ area.status }}</span>
+                            <span v-if="area.status=='已审核'" class="text-primary font-weight-bold">@{{ area.status }}</span>
                         </span>
-                        <span v-if="area.status=='已完成'" class="text-success font-weight-bold">@{{ area.status }}</span>
-                        <span v-if="area.status=='已审核'" class="text-primary font-weight-bold">@{{ area.status }}</span>
                     </td>
                     <td style="min-width: 50px"><span>@{{ area.userOwnerGroupName }}</span></td>
                     <td style="min-width: 50px"><span>@{{ area.customerName }}</span></td>

+ 6 - 1
resources/views/customer/project/create.blade.php

@@ -816,6 +816,7 @@
                         };
                         this.errors = {};
                         this.audit.storage = true;
+                        return "保存成功";
                     });
                 },
                 _verifyOperation() {
@@ -917,6 +918,7 @@
                         this._resetOperation();
                         this.errors = {};
                         this.audit.operation = true;
+                        return "保存成功";
                     });
                 },
                 _verifyOperationItem(itemIndex){//验证作业费子项信息完整
@@ -1037,6 +1039,7 @@
                         this.importError = [];
                         $(".selectpicker").filter('.express').selectpicker('val',[]);
                         this.audit.express = true;
+                        return "保存成功";
                     });
                 },
                 _verifyLogistic(){
@@ -1079,6 +1082,7 @@
                         this.importError = [];
                         $(".selectpicker").filter('.logistic').selectpicker('val',[]);
                         this.audit.logistic = true;
+                        return "保存成功";
                     });
                 },
                 _verifyDirectLogistic(){
@@ -1108,6 +1112,7 @@
                         this.errors = {};
                         this.importError = [];
                         this.audit.directLogistic = true;
+                        return "保存成功";
                     });
                 },
                 //增加作业费特征子项
@@ -2255,7 +2260,7 @@
                         data.operation = this._reverseAuditComparison(data.operation);
                     }
                     data.tax_rate_id = this.poolMapping.taxRates ? this.poolMapping.taxRates[data.tax_rate_id] : '';
-                    switch (res[i].operation) {
+                    switch (data.operation) {
                         case "C":
                             this.auditList.system.C = data;
                             this.showAuditPiece.C = true;

+ 1 - 0
resources/views/customer/project/part/_directLogistic.blade.php

@@ -17,6 +17,7 @@
 <div class="row mt-3">
     <label for="tax_rate_id" class="col-3 text-muted">税率</label>
     <select id="tax_rate_id" class="col-3 form-control ml-3" v-model="model.directLogistic.tax_rate_id">
+        <option> </option>
         <option v-for="tax in pool.taxRates" :value="tax.id">@{{ tax.value }}%</option>
     </select>
 </div>

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

@@ -23,6 +23,7 @@
 <div class="row mt-3">
     <label for="tax_rate_id" class="col-3 text-muted">税率</label>
     <select id="tax_rate_id" class="col-3 form-control ml-3" v-model="model.express.tax_rate_id">
+        <option> </option>
         <option v-for="tax in pool.taxRates" :value="tax.id">@{{ tax.value }}%</option>
     </select>
 </div>

+ 1 - 0
resources/views/customer/project/part/_logistic.blade.php

@@ -78,6 +78,7 @@
 <div class="row mt-3">
     <label for="tax_rate_id" class="col-2 text-muted">税率</label>
     <select id="tax_rate_id" class="col-3 form-control" v-model="model.logistic.tax_rate_id">
+        <option> </option>
         <option v-for="tax in pool.taxRates" :value="tax.id">@{{ tax.value }}%</option>
     </select>
 </div>

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

@@ -185,6 +185,7 @@
 <div class="row mt-3">
     <label for="tax_rate_id" class="col-2 text-muted">税率</label>
     <select id="tax_rate_id" class="col-3 form-control" v-model="model.operation.tax_rate_id">
+        <option> </option>
         <option v-for="tax in pool.taxRates" :value="tax.id">@{{ tax.value }}%</option>
     </select>
 </div>

+ 1 - 0
resources/views/customer/project/part/_storage.blade.php

@@ -127,6 +127,7 @@
 <div class="row mt-3">
     <label for="tax_rate_id" class="col-2 text-muted">税率</label>
     <select id="tax_rate_id" class="col-3 form-control" v-model="model.storage.tax_rate_id">
+        <option> </option>
         <option v-for="tax in pool.taxRates" :value="tax.id">@{{ tax.value }}%</option>
     </select>
 </div>

+ 1 - 0
resources/views/customer/project/part/_system.blade.php

@@ -8,6 +8,7 @@
 <div class="row mt-3">
     <label for="tax_rate_id" class="col-2 text-muted">税率</label>
     <select id="tax_rate_id" class="col-3 form-control" v-model="model.system.tax_rate_id">
+        <option> </option>
         <option v-for="tax in pool.taxRates" :value="tax.id">@{{ tax.value }}%</option>
     </select>
 </div>