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

修复计数单位显示,货主搜索失效,审核未刷新,承运商长度定义

Zhouzhendong 6 лет назад
Родитель
Сommit
3020c98d02

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

@@ -67,7 +67,7 @@ class CarriersController extends Controller
 
     protected function validatorCarrier(Request $request){
         $validator=Validator::make($request->input(),[
-            'Carrier.name'=>'digits_between:1,50|required|unique:carriers,name',
+            'Carrier.name'=>'max:50|required|unique:carriers,name',
             'Carrier.mobile'=>['required','regex:/^(\d{7,11})|(1[3|4|5|7|8][0-9]\d{4,8})$/','unique:carriers,name'],
             'Carrier.delivery_fee'=>'nullable|min:0|numeric|max:999999',
         ],[

+ 15 - 6
app/Http/Controllers/WaybillsController.php

@@ -597,14 +597,18 @@ class WaybillsController extends Controller
         }else if ($request->input('type')=='专线'){
             $validator=Validator::make($request->input(),[
                 'carrier_bill'=>"nullable|max:50|unique:waybills,carrier_bill,$id",
-                'warehouse_weight'=>'nullable|min:0|numeric|max:999999',
-                'carrier_weight'=>'nullable|min:0|numeric|max:999999',
                 'pick_up_fee'=>'nullable|min:0|numeric|max:999999',
                 'other_fee'=>'nullable|min:0|numeric|max:999999',
                 'carrier_id'=>'required|integer',
                 'destination_city_id'=>'required|integer',
-                'warehouse_weight_unit_id'=>'nullable|integer',
-                'carrier_weight_unit_id'=>'nullable|integer',
+                'warehouse_weight'=>'nullable|min:0|numeric|max:999999',
+                'carrier_weight'=>'nullable|min:0|numeric|max:999999',
+                'warehouse_weight_unit_id'=>'required_with:warehouse_weight|integer',
+                'carrier_weight_unit_id'=>'required_with:carrier_weight|integer',
+                'warehouse_weight_other'=>'nullable|min:0|numeric|max:999999',
+                'carrier_weight_other'=>'nullable|min:0|numeric|max:999999',
+                'warehouse_weight_unit_id_other'=>'required_with:warehouse_weight_other|integer',
+                'carrier_weight_unit_id_other'=>'required_with:carrier_weight_other|integer',
                 'charge'=>'nullable|min:0|numeric|max:999999',
             ],[
                 'required'=>':attribute 为必填项',
@@ -613,6 +617,7 @@ class WaybillsController extends Controller
                 'min'=>':attribute 不得为负',
                 'numeric'=>':attribute 应为数字',
                 'unique'=>':attribute 已存在',
+                'required_with'=>':attribute 未填',
             ],[
                 'carrier_bill'=>'承运商单号',
                 'warehouse_weight'=>'仓库计数(抛)',
@@ -621,9 +626,13 @@ class WaybillsController extends Controller
                 'other_fee'=>'其他费用',
                 'carrier_id'=>'承运商',
                 'destination_city_id'=>'目的市',
-                'carrier_weight_unit_id'=>'承运商计单位',
+                'carrier_weight_unit_id'=>'承运商计单位',
                 'charge'=>'收费',
-                'warehouse_weight_unit_id'=>'仓库计重单位',
+                'warehouse_weight_unit_id'=>'仓库计数单位',
+                'warehouse_weight_other'=>'仓库计数二',
+                'carrier_weight_other'=>'承运商计数二',
+                'warehouse_weight_unit_id_other'=>'仓库技数单位二',
+                'carrier_weight_unit_id_other'=>'承运商计数单位二',
             ]);
             return $validator;
         }else{

+ 3 - 1
package-lock.json

@@ -1,6 +1,8 @@
 {
-    "requires": true,
+    "name": "bswas",
+    "version": "1.0.0",
     "lockfileVersion": 1,
+    "requires": true,
     "dependencies": {
         "@babel/code-frame": {
             "version": "7.0.0",

+ 44 - 31
package.json

@@ -1,33 +1,46 @@
 {
-    "private": true,
-    "scripts": {
-        "dev": "npm run development",
-        "development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
-        "watch": "npm run development -- --watch",
-        "watch-poll": "npm run watch -- --watch-poll",
-        "hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js",
-        "prod": "npm run production",
-        "production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
-    },
-    "devDependencies": {
-        "axios": "^0.19",
-        "bootstrap": "^4.1.0",
-        "cross-env": "^5.1",
-        "jquery": "^3.2",
-        "laravel-mix": "^4.0.7",
-        "lodash": "^4.17.5",
-        "popper.js": "^1.12",
-        "resolve-url-loader": "^2.3.1",
-        "sass": "^1.15.2",
-        "sass-loader": "^7.1.0",
-        "vue": "^2.5.17",
-        "vue-template-compiler": "^2.6.10"
-    },
-    "dependencies": {
-        "font-awesome": "^4.7.0",
-        "js-cookie": "^2.2.0",
-        "laravel-echo": "^1.6.0",
-        "pusher-js": "^5.0.2",
-        "socket.io-client": "^2.3.0"
-    }
+  "private": true,
+  "scripts": {
+    "dev": "npm run development",
+    "development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
+    "watch": "npm run development -- --watch",
+    "watch-poll": "npm run watch -- --watch-poll",
+    "hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js",
+    "prod": "npm run production",
+    "production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
+  },
+  "devDependencies": {
+    "axios": "^0.19",
+    "bootstrap": "^4.1.0",
+    "cross-env": "^5.1",
+    "jquery": "^3.2",
+    "laravel-mix": "^4.0.7",
+    "lodash": "^4.17.5",
+    "popper.js": "^1.12",
+    "resolve-url-loader": "^2.3.1",
+    "sass": "^1.15.2",
+    "sass-loader": "^7.1.0",
+    "vue": "^2.5.17",
+    "vue-template-compiler": "^2.6.10"
+  },
+  "dependencies": {
+    "font-awesome": "^4.7.0",
+    "js-cookie": "^2.2.0",
+    "laravel-echo": "^1.6.0",
+    "pusher-js": "^5.0.2",
+    "socket.io-client": "^2.3.0"
+  },
+  "name": "bswas",
+  "version": "1.0.0",
+  "main": "webpack.mix.js",
+  "directories": {
+    "test": "tests"
+  },
+  "repository": {
+    "type": "git",
+    "url": "ssh://zhouzhendong@47.103.131.176:10022/var/git/bswas"
+  },
+  "author": "",
+  "license": "ISC",
+  "description": ""
 }

+ 2 - 2
resources/views/waybill/create.blade.php

@@ -30,7 +30,7 @@
                             <select name="owner_id" class="form-control @error('owner_id') is-invalid @enderror" v-model="owner_id"  style="width: 30%">
                                 <option v-for="owner in owners" :value="owner.id">@{{owner.name}}</option>
                             </select>
-                            <input class="form-control-sm ml-2" placeholder="输入关键字定位" @input="owner_id">
+                            <input class="form-control-sm ml-2" placeholder="输入关键字定位" @input="owner_seek">
                         </div>
                         <div class="col-sm-5">
                             <p class="form-control-static text-danger small font-weight-bold" style="margin-left: 50%">{{ $errors->first('owner_id') }}</p>
@@ -162,7 +162,7 @@
                 origination:'{{old('origination')}}',
             },
             methods:{
-                owner_id:function (e) {
+                owner_seek:function (e) {
                     let _this=this;
                     let $val=e.target.value;
                     if($val==='')_this.owner_id='';

+ 19 - 4
resources/views/waybill/edit.blade.php

@@ -147,12 +147,13 @@
                         </div>
                         <label for="warehouse_weight_unit_id" class=" col-form-label text-right ">单位:</label>
                         <div class="col-1.5">
-                            <select class="form-control" name="warehouse_weight_unit_id" v-model="waybillPriceModel.warehouse_weight_unit_id">
+                            <select class="form-control @error('warehouse_weight_unit_id') is-invalid @enderror" name="warehouse_weight_unit_id" v-model="waybillPriceModel.warehouse_weight_unit_id">
                                 @foreach($units as $unit)
                                     <option value="{{$unit->id}}">{{$unit->name}}</option>
                                 @endforeach
                             </select>
                         </div>
+
                         &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                         <label for="warehouse_weight_other" class="col-form-label text-right ">&nbsp;&nbsp;&nbsp;仓库计数二</label>
                         <div class="col-2">
@@ -166,13 +167,17 @@
                         </div>
                         <label for="warehouse_weight_unit_id_other" class=" col-form-label text-right ">单位:</label>
                         <div class="col-1.5">
-                            <select class="form-control" name="warehouse_weight_unit_id_other" v-model="waybillPriceModel.warehouse_weight_unit_id_other" >
+                            <select class="form-control @error('warehouse_weight_unit_id_other') is-invalid @enderror" name="warehouse_weight_unit_id_other" v-model="waybillPriceModel.warehouse_weight_unit_id_other" >
                                 @foreach($units as $unit)
                                     <option value="{{$unit->id}}">{{$unit->name}}</option>
                                 @endforeach
                             </select>
                         </div>
                     </div>
+{{--                    <div class="form-group row">
+                            <p class="form-control-static text-danger small font-weight-bold" style="margin-left: 50%">{{ $errors->first('warehouse_weight_unit_id') }}</p>
+                            <p class="form-control-static text-danger small font-weight-bold" style="margin-left: 50%">{{ $errors->first('warehouse_weight_unit_id_other') }}</p>
+                    </div>--}}
                     @endif
                     {{--计费模型阶段保留--}}
                     <div class="form-group row">
@@ -188,12 +193,13 @@
                         </div>
                         <label for="carrier_weight_unit_id" class=" col-form-label text-right ">单位:</label>
                         <div class="col-1.5">
-                            <select class="form-control" name="carrier_weight_unit_id" v-model="waybillPriceModel.carrier_weight_unit_id">
+                            <select class="form-control @error('carrier_weight_unit_id') is-invalid @enderror" name="carrier_weight_unit_id" v-model="waybillPriceModel.carrier_weight_unit_id">
                                 @foreach($units as $unit)
                                     <option value="{{$unit->id}}">{{$unit->name}}</option>
                                 @endforeach
                             </select>
                         </div>
+
                         &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                         <label for="carrier_weight_other" class="col-form-label text-right ">承运商计数二</label>
                         <div class="col-2">
@@ -207,13 +213,22 @@
                         </div>
                         <label for="carrier_weight_unit_id_other" class=" col-form-label text-right ">单位:</label>
                         <div class="col-1.5">
-                            <select class="form-control" name="carrier_weight_unit_id_other" v-model="waybillPriceModel.carrier_weight_unit_id_other" >
+                            <select class="form-control @error('carrier_weight_unit_id_other') is-invalid @enderror" name="carrier_weight_unit_id_other" v-model="waybillPriceModel.carrier_weight_unit_id_other" >
                                 @foreach($units as $unit)
                                     <option value="{{$unit->id}}">{{$unit->name}}</option>
                                 @endforeach
                             </select>
                         </div>
+
                     </div>
+{{--                    <div class="form-group row">
+                        <div class="col-sm-5">
+                            <p class="form-control-static text-danger small font-weight-bold" style="margin-left: 50%">{{ $errors->first('carrier_weight_unit_id') }}</p>
+                        </div>
+                        <div class="col-sm-5">
+                            <p class="form-control-static text-danger small font-weight-bold" style="margin-left: 50%">{{ $errors->first('carrier_weight_unit_id_other') }}</p>
+                        </div>
+                    </div>--}}
                     @if($waybill->type=="直发车")
                     <div class="form-group row">
                         <label for="carType_id" class="col-2 col-form-label text-right text-primary">车型 *</label>