Просмотр исходного кода

Merge branch 'zzd'

# Conflicts:
#	app/OrderPackage.php
LD 5 лет назад
Родитель
Сommit
041e058dee

+ 1 - 1
app/Http/Controllers/MeasureMonitorController.php

@@ -23,7 +23,7 @@ class MeasureMonitorController extends Controller
     public function data(Request $request){
         $measuring_machine_id=$request->input('id');
         if ($measuring_machine_id){
-            $package=OrderPackage::with('owner','paperBox','measuringMachine')->where('measuring_machine_id',$measuring_machine_id)->orderBy('id','DESC')->first();
+            $package=OrderPackage::with('order','paperBox','measuringMachine')->where('measuring_machine_id',$measuring_machine_id)->orderBy('id','DESC')->first();
             if (!$package){
                 $measuringMachine=MeasuringMachine::query()->where('id',$measuring_machine_id)->first();
                 $package=new OrderPackage();

+ 3 - 2
app/Http/Controllers/ProcessController.php

@@ -222,6 +222,7 @@ class ProcessController extends Controller
         $total_cost=0;              //合计成本
         foreach ($processDailies as $processDailyOne){
             foreach ($processDailyOne->processDailyParticipants as $processDailyParticipant){
+                if (!$processDailyParticipant->unit_price && !$processDailyParticipant->hour_price) continue;
                 $duration_man_hours += $processDailyParticipant->hour_count;
                 if ($processDailyParticipant->unit_count){
                     $total_cost += ($processDailyParticipant->unit_count)*($processDailyParticipant->unit_price);
@@ -1118,8 +1119,8 @@ class ProcessController extends Controller
             'user_id'=>'required',
             'started_at'=>'required|date_format:H:i',
             'ended_at'=>'required|date_format:H:i',
-            'hour_price'=>'required_without:unit_price|min:0|max:999999|nullable|numeric',
-            'unit_price'=>'required_without:hour_price|min:0|max:999999|nullable|numeric',
+            'hour_price'=>'nullable|min:0|max:999999|nullable|numeric',
+            'unit_price'=>'nullable|min:0|max:999999|nullable|numeric',
             'dinner_duration'=>'nullable|integer',
             'hour_count'=>'required_with:hour_price|min:0|max:999999|nullable|numeric',
             'unit_count'=>'required_with:unit_price|min:0|max:999999|nullable|numeric',

+ 0 - 1
resources/views/process/statistic.blade.php

@@ -33,7 +33,6 @@
                 <th>单价</th>
                 <th>预期数量</th>
                 <th>完成数量</th>
-                <th>完成时间</th>
                 <th>收入合计</th>
                 <th>完成时间(天)</th>
                 <th>总工时</th>

+ 4 - 4
resources/views/weight/measureMonitor/index.blade.php

@@ -162,12 +162,12 @@
             methods:{
                 clickMeasuringMachine(e){
                     let _this=this;
-                    axios.post('/package/measureMonitor/data',{id:e})
+                    axios.post('{{url('package/measureMonitor/data')}}',{id:e})
                         .then(function (response) {
                             if (response.data.id){
-                                let package=response.data;
-                                _this.updateData(_this,package);
-                                _this.package.measuringMachine=package.measuringMachine ? package.measuringMachine.name : '';                            }else {
+                                let orderPackage=response.data;
+                                _this.updateData(_this,orderPackage);
+                                _this.package.measuringMachine=orderPackage.measuringMachine ? orderPackage.measuringMachine.name : '';                            }else {
                                 tempTip.setDuration(4000);
                                 tempTip.showSuccess('暂无数据!');
                             }

+ 4 - 3
resources/views/weight/package/index.blade.php

@@ -35,7 +35,7 @@
                         <td>@{{package.ownerName}}</td>
                         <td>@{{package.logisticNumber}}</td>
                         <td class="text-muted">@{{package.batchNumber}}</td>
-                        <td>@{{package.order_code}}</td>
+                        <td>@{{package.orderCode}}</td>
                         <td class="text-muted">@{{package.logisticName}}</td>
                         <td class="text-muted">@{{package.measuringMachineName}}</td>
                         <td>@{{package.weight}}</td>
@@ -70,9 +70,10 @@
                 packages:[
                         @foreach($packages as $package)
                     {id:'{{$package->id}}',ownerName:'{{$package->order ? ($package->order->owner ? $package->order->owner->name : '') : ''}}',
+                        orderCode:'{{$package->order ? $package->order->code : ''}}',
                         logisticName:'{{$package->order ? ($package->order->logistic ? $package->order->logistic->name : '') : ''}}'
-                        ,batchNumber:'{{$package->batch_number}}',batchRule:'{{$package->batch_rule}}'
-                        ,recipient:'{{$package->order ? $package->order->recipient : ''}}',recipientMobile:'{{$package->order ? $package->order->recipient_mobile : ''}}'
+                        ,batchNumber:'{{$package->batch_number}}',batchRule:'{{$package->batch_rule}}',
+                        recipient:'{{$package->order ? $package->order->consignee_name : ''}}',recipientMobile:'{{$package->order ? $package->order->consignee_phone : ''}}'
                         ,logisticNumber:'{{$package->logistic_number}}'
                         ,measuringMachineName:'{{$package->measuring_machine ? $package->measuring_machine->name : ''}}',
                         weight:'{{$package->weight}}', length:'{{$package->length}}',width:'{{$package->width}}',height:'{{$package->height}}',

+ 6 - 0
tests/route.http

@@ -0,0 +1,6 @@
+# For a quick start check out our HTTP Requests collection (Tools|HTTP Client|Open HTTP Requests Collection).
+#
+# Following HTTP Request Live Templates are available:
+# * 'gtrp' and 'gtr' create a GET request with or without query parameters;
+# * 'ptr' and 'ptrp' create a POST request with a simple or parameter-like body;
+# * 'mptr' and 'fptr' create a POST request to submit a form with a text or file field (multipart/form-data);

+ 1 - 1
tests/webApi/test.http

@@ -8,7 +8,7 @@
 POST http://bswas/api/thirdPart/weight/new
 Content-Type: application/json
 
-{"barcode":"t5","weight":"5","id":"test","key":"test","time":"2020-2-26 14:17:07"}
+{"id": "abc6","barcode": "233170028951","weight": "13","length": 3,"width": 1,"height": 2}
 
 ###
 POST http://bswas/api/thirdPart/weight/new