Explorar el Código

Merge remote-tracking branch 'origin/master'

eric2h hace 3 años
padre
commit
f8b9d1bd68

+ 5 - 0
app/Http/Controllers/OrderIssueController.php

@@ -864,6 +864,11 @@ class OrderIssueController extends Controller
         if (!Gate::allows('订单管理-问题件-编辑')) return ['success' => false, 'error' => '没有对应权限'];
         try {
             $service->batchUpdateIssueType($request->input('ids', []), $request->input('order_issue_type_id'));
+            $orderIssues = OrderIssue::query()->whereIn('id',$request->input('ids', []))->get();
+            foreach($orderIssues as $orderIssue){
+                SyncOrderIssueOrWorkOrderBySWMS::dispatch($orderIssue,SyncOrderIssueOrWorkOrderBySWMS::$ORDER_ISSUE_TYPE);
+            }
+
             return ['success' => true];
         } catch (Exception $e) {
             return ['success' => false, 'message' => '批量修改异常'];

+ 4 - 3
app/Jobs/SyncOrderIssueOrWorkOrderBySWMS.php

@@ -48,10 +48,11 @@ class SyncOrderIssueOrWorkOrderBySWMS implements ShouldQueue
         /** @var SyncSWMSOrderIssueAndWorkOrderService  $service */
         $service = app(SyncSWMSOrderIssueAndWorkOrderService::class);
         if($this->type ==  $this::$ORDER_ISSUE_TYPE){
-            if($this->orderIssue instanceof WorkOrder){
-                $service->sendWorkOrder($this->workOrder);
-            } else if($this->orderIssue instanceof OrderIssue){
+            $class = $this->orderIssue->getMorphClass();
+            if(str_contains($class,'OrderIssue')){
                 $service->sendOrderIssue($this->orderIssue);
+            } else {
+                $service->sendWorkOrder($this->orderIssue);
             }
         } else if($this->type ==  $this::$WORK_ORDER_TYPE){
             $service->sendWorkOrder($this->workOrder);

+ 2 - 2
app/Services/WorkOrderProcessLogService.php

@@ -50,7 +50,7 @@ class WorkOrderProcessLogService
             $detail->workOrder()->whereIn('status', [2, 6])->update(['owner_tag' => 1]);
         }
         $process_log->setAttribute('user', $user);
-        SyncOrderIssueOrWorkOrderBySWMS::dispatch($work_order,SyncOrderIssueOrWorkOrderBySWMS::$ORDER_ISSUE_TYPE);
+        SyncOrderIssueOrWorkOrderBySWMS::dispatch($work_order,SyncOrderIssueOrWorkOrderBySWMS::$WORK_ORDER_TYPE);
         return $process_log;
     }
 
@@ -70,7 +70,7 @@ class WorkOrderProcessLogService
             $detail = $workOrder->details()->where('order_issue_type_id',$workOrder->order_issue_type_id)->orderByDesc('created_at')->first();
             if (!$detail) continue;
             $process_logs[] = $this->createProcessLog($detail, $params, $user);
-            SyncOrderIssueOrWorkOrderBySWMS::dispatch($workOrder,SyncOrderIssueOrWorkOrderBySWMS::$ORDER_ISSUE_TYPE);
+            SyncOrderIssueOrWorkOrderBySWMS::dispatch($workOrder,SyncOrderIssueOrWorkOrderBySWMS::$WORK_ORDER_TYPE);
         }
         return $process_logs;
     }

+ 2 - 0
resources/views/equipment/_buildGroup.blade.php

@@ -10,6 +10,8 @@
                     <label for="buildCount" class="offset-3">附加构建数量:</label>
                     <input class="form-control ml-1" placeholder="构建数" type="number" step="1" min="1" id="buildCount"
                            @keydown.enter="buildGroup()" v-model="buildEqInfo.count"></input>
+
+                    <input class="switch" type="checkbox" v-model="increment"/>
                 </div>
                 <div class="row mt-3">
                     <div class="col-6">

+ 25 - 18
resources/views/equipment/index.blade.php

@@ -420,7 +420,7 @@
             _loadEquipmentCategory() {
                 return new Promise((resolve, reject)=>{
                     $.ajax({
-                        url : this.baseUrl+"api/equipment/category",
+                        url : this.baseUrl+"api/base/equipment/category",
                         type : "GET",
                         success : (res,status)=>{
                             if(res.code != 200 || !res.data) {
@@ -474,7 +474,7 @@
                     this.container = {width:warehouse.length*this.ratio,height:warehouse.width*this.ratio};
                     localStorage.setItem("equipment:warehouse", warehouse.id);
                     $.ajax({
-                        url : this.baseUrl+"api/warehouse/detail/getCoordsInfo",
+                        url : this.baseUrl+"api/base/warehouse/detail/getCoordsInfo",
                         type : "post",
                         dataType : "JSON",
                         data : {id:warehouse.id},
@@ -484,7 +484,7 @@
                                 let equipmentElements = [];
                                 res.data[1].forEach(eq=>{
                                     let coords = JSON.parse(eq.info);
-                                    let selfInfo = this.equipments[coords.id-1];
+                                    let selfInfo = this.getCategory(coords.id);
                                     equipmentElements.push(Object.assign({
                                         eqId:eq.id,
                                         exist:eq.exist,
@@ -508,12 +508,20 @@
                     })
                 },200);
             },
+            getCategory(id) {
+                for (let i = 0; i < this.equipments.length; i++) {
+                    if(Number(id) === Number(this.equipments[i].id)) {
+                        return this.equipments[i];
+                    }
+                }
+                return {}
+            },
             /**
              * 初始页加载
              */
             initPage(){
                 $.ajax({
-                    url : this.baseUrl+"api/warehouse/detail",
+                    url : this.baseUrl+"api/base/warehouse/detail",
                     type : "GET",
                     success : (res,status)=>{
                         this.warehouses = res.data;
@@ -563,7 +571,7 @@
                     return;
                 }
                 $.ajax({
-                    url : this.baseUrl+"api/location/getAttr",
+                    url : this.baseUrl+"api/base/location/getAttr",
                     type : "post",
                     dataType : "JSON",
                     success : (res,status)=>{
@@ -821,7 +829,7 @@
                     }
                 });
                 $.ajax({
-                    url : this.baseUrl+"api/warehouse/saveScene",
+                    url : this.baseUrl+"api/base/warehouse/saveScene",
                     type : "POST",
                     headers:{'Content-Type':'application/json;charset=utf8'},
                     data:JSON.stringify({id:this.selected,warehouse:JSON.stringify(elements),equipment:equipments,delEquipments:delEquipments}),
@@ -1040,7 +1048,7 @@
                     item.column = Number(item.column);
                 });
                 $.ajax({
-                    url : this.baseUrl+"api/location/get",
+                    url : this.baseUrl+"api/base/location/get",
                     type : "post",
                     dataType : "JSON",
                     data : {id:children.id},
@@ -1077,7 +1085,7 @@
                     return;
                 }
                 $.ajax({
-                    url : this.baseUrl+"api/equipment/getChildren",
+                    url : this.baseUrl+"api/base/equipment/getChildren",
                     type : "post",
                     dataType : "JSON",
                     data : {id:equipment.eqId},
@@ -1115,7 +1123,7 @@
                 let params = this._formatEquipmentData(equipment);
                 params.warehouseDetailId = this.selected;
                 $.ajax({
-                    url : this.baseUrl+"api/equipment/saveOrUpdate",
+                    url : this.baseUrl+"api/base/equipment/saveOrUpdate",
                     type : "post",
                     dataType : "JSON",
                     headers:{'Content-Type':'application/json;charset=utf8'},
@@ -1160,9 +1168,8 @@
                 if (!equipment.code)error.code = "设备编号未填写";
                 if (equipment.layer !== equipment.children.length)error.children = "设备绑定错误";
                 for (let i=0;i<equipment.layer;i++){
-                    console.log(equipment.children[i])
                     if (!equipment.children[i].height)error["children["+i+"].height"] = "设备高度不得为空"
-                    if (!equipment.children[i].area)error["children["+i+"].area"] = "设备折算面积不得为空"
+                    //if (!equipment.children[i].area)error["children["+i+"].area"] = "设备折算面积不得为空"
                     if (!equipment.children[i].column && equipment.children[i].column!=0)error["children["+i+"].column"] = "库位列数不得为空"
                     if (!equipment.children[i].row && equipment.children[i].row!=0)error["children["+i+"].row"] = "库位行数不得为空"
                 }
@@ -1183,7 +1190,7 @@
                 if (this.isLoadLocation)return;
                 this.isLoadLocation = true;
                 $.ajax({
-                    url : this.baseUrl+"api/location/removeLocationBind",
+                    url : this.baseUrl+"api/base/location/removeLocationBind",
                     type : "post",
                     dataType : "JSON",
                     data : {id:this.current.children[this.currentEqChildIndex].id},
@@ -1228,7 +1235,7 @@
                     }
                 });
                 $.ajax({
-                    url : this.baseUrl+"api/location/locationBatchBound",
+                    url : this.baseUrl+"api/base/location/locationBatchBound",
                     type : "post",
                     dataType : "JSON",
                     data : JSON.stringify(request),
@@ -1272,7 +1279,7 @@
                 let code = this.current.code+'-'+(this.currentEqChildIndex+1);
                 this.isLoadLocation = true;
                 $.ajax({
-                    url : this.baseUrl+"api/location/locationBind",
+                    url : this.baseUrl+"api/base/location/locationBind",
                     type : "post",
                     dataType : "JSON",
                     headers:{'Content-Type':'application/json;charset=utf8'},
@@ -1311,7 +1318,7 @@
                     return;
                 }
                 $.ajax({
-                    url : this.baseUrl+"api/warehouse/getList",
+                    url : this.baseUrl+"api/base/warehouse/getList",
                     type : "get",
                     dataType : "JSON",
                     success : (res)=>{
@@ -1339,7 +1346,7 @@
             },
             addWarehouseDetail(){
                 $.ajax({
-                    url : this.baseUrl+"api/warehouse/detail",
+                    url : this.baseUrl+"api/base/warehouse/detail",
                     type : "post",
                     dataType : "JSON",
                     headers:{'Content-Type':'application/json;charset=utf8'},
@@ -1364,7 +1371,7 @@
             },
             openRepository(){
                 $.ajax({
-                    url : this.baseUrl+"api/repository/group",
+                    url : this.baseUrl+"api/base/repository/group",
                     type : "get",
                     dataType : "JSON",
                     data:{id:this.selected},
@@ -1394,7 +1401,7 @@
             addRepository(){
                 this.repository.warehouseDetailId = this.selected;
                 $.ajax({
-                    url : this.baseUrl+"api/repository/addRepository",
+                    url : this.baseUrl+"api/base/repository/addRepository",
                     type : "post",
                     dataType : "JSON",
                     headers:{'Content-Type':'application/json;charset=utf8'},