作者 朱兆平

装载bug修复

@@ -99,3 +99,14 @@ export function validatorNum(value) { @@ -99,3 +99,14 @@ export function validatorNum(value) {
99 const reg = /^(\d*)+(\.[0-9]{1,2})?$/ 99 const reg = /^(\d*)+(\.[0-9]{1,2})?$/
100 return reg.test(value) 100 return reg.test(value)
101 } 101 }
  102 +
  103 +
  104 +/**
  105 + * 关区校验 4位数字
  106 + * @param value
  107 + * @returns {boolean}
  108 + */
  109 +export function validatorCustomsNum(value) {
  110 + const reg = /^(\d{4})$/
  111 + return reg.test(value)
  112 +}
@@ -31,13 +31,14 @@ @@ -31,13 +31,14 @@
31 :loading="listLoading" 31 :loading="listLoading"
32 v-model="flight.originstation" 32 v-model="flight.originstation"
33 allow-create 33 allow-create
  34 + default-first-option
34 filterable 35 filterable
35 remote 36 remote
36 placeholder="请选择起始站" clearable> 37 placeholder="请选择起始站" clearable>
37 <el-option 38 <el-option
38 v-for="item in airportCode" 39 v-for="item in airportCode"
39 :key="item.airportid" 40 :key="item.airportid"
40 - :label="item.airportid" 41 + :label="item.airportdescchn"
41 :value="item.airportid"> 42 :value="item.airportid">
42 <span style="float: left">{{ item.airportdescchn }}</span> 43 <span style="float: left">{{ item.airportdescchn }}</span>
43 <span style="float: right; color: #8492a6; font-size: 13px">{{ item.airportid }}</span> 44 <span style="float: right; color: #8492a6; font-size: 13px">{{ item.airportid }}</span>
@@ -49,7 +50,9 @@ @@ -49,7 +50,9 @@
49 :remote-method="remoteMethodAirport" 50 :remote-method="remoteMethodAirport"
50 :loading="listLoading" 51 :loading="listLoading"
51 v-model="flight.destinationstation" 52 v-model="flight.destinationstation"
  53 + @blur = "elblur"
52 allow-create 54 allow-create
  55 + default-first-option
53 filterable 56 filterable
54 remote 57 remote
55 placeholder="请选择目的站" clearable> 58 placeholder="请选择目的站" clearable>
@@ -217,6 +220,10 @@ @@ -217,6 +220,10 @@
217 this.airportCode = [] 220 this.airportCode = []
218 } 221 }
219 }, 222 },
  223 + elblur: e => {
  224 + // this.destinationstation = "CGO"
  225 + console.log(e)
  226 + }
220 } 227 }
221 }; 228 };
222 </script> 229 </script>
@@ -229,7 +236,7 @@ @@ -229,7 +236,7 @@
229 margin: 0 auto; 236 margin: 0 auto;
230 height: 400px; 237 height: 400px;
231 } 238 }
232 - 239 + flight
233 p { 240 p {
234 font-size: 25px; 241 font-size: 25px;
235 font-weight: bold; 242 font-weight: bold;
@@ -49,7 +49,7 @@ @@ -49,7 +49,7 @@
49 <div class="grid-content content" style="margin-top: 6px">出港装载明细</div> 49 <div class="grid-content content" style="margin-top: 6px">出港装载明细</div>
50 </el-col> 50 </el-col>
51 </el-row> 51 </el-row>
52 - <el-table v-loading="listLoading" :data="loadingData"stripe style="font-size: 12px" 52 + <el-table v-loading="listLoading" :data="loadingData" stripe style="font-size: 12px"
53 border @selection-change="handleSelectionChange"> 53 border @selection-change="handleSelectionChange">
54 <el-table-column type="selection" width="60"></el-table-column> 54 <el-table-column type="selection" width="60"></el-table-column>
55 <el-table-column label="主单号" width="160" align="center"> 55 <el-table-column label="主单号" width="160" align="center">
@@ -179,7 +179,7 @@ @@ -179,7 +179,7 @@
179 </el-form-item> 179 </el-form-item>
180 </el-col> 180 </el-col>
181 <el-col :span="7.5"> 181 <el-col :span="7.5">
182 - <el-form-item label="目的站" prop="originstation"> 182 + <el-form-item label="目的站" prop="destinationstation">
183 <el-select filterable clearable placeholder="请选择起始站" :remote-method="remoteMethodAirport" 183 <el-select filterable clearable placeholder="请选择起始站" :remote-method="remoteMethodAirport"
184 allow-create v-model="destinationstation" remote :disabled="dialogStatus ==='update'"> 184 allow-create v-model="destinationstation" remote :disabled="dialogStatus ==='update'">
185 <el-option v-for="item in airportCode" 185 <el-option v-for="item in airportCode"
@@ -203,13 +203,13 @@ @@ -203,13 +203,13 @@
203 </div> 203 </div>
204 <el-row> 204 <el-row>
205 <el-col :span="7.5"> 205 <el-col :span="7.5">
206 - <el-form-item label="装载件数" prop="piece"> 206 + <el-form-item label="装载件数" prop="lodingpiece">
207 <el-input v-model.number="loadingModel.lodingpiece"></el-input> 207 <el-input v-model.number="loadingModel.lodingpiece"></el-input>
208 </el-form-item> 208 </el-form-item>
209 </el-col> 209 </el-col>
210 <el-col :span="7.5"> 210 <el-col :span="7.5">
211 - <el-form-item label="装载重量" prop="weight">  
212 - <el-input v-model.number="loadingModel.lodingweight"></el-input> 211 + <el-form-item label="装载重量" prop="lodingweight">
  212 + <el-input v-model="loadingModel.lodingweight"></el-input>
213 </el-form-item> 213 </el-form-item>
214 </el-col> 214 </el-col>
215 <el-col :span="7.5"> 215 <el-col :span="7.5">
@@ -222,12 +222,12 @@ @@ -222,12 +222,12 @@
222 </el-row> 222 </el-row>
223 <el-row> 223 <el-row>
224 <el-col :span="7.5"> 224 <el-col :span="7.5">
225 - <el-form-item label="运单件数" prop="price">  
226 - <el-input v-model="loadingModel.awbprice"></el-input> 225 + <el-form-item label="运单件数" prop="awbprice">
  226 + <el-input v-model.number="loadingModel.awbprice"></el-input>
227 </el-form-item> 227 </el-form-item>
228 </el-col> 228 </el-col>
229 <el-col :span="7.5"> 229 <el-col :span="7.5">
230 - <el-form-item label="运单重量" prop="weight"> 230 + <el-form-item label="运单重量" prop="awbweight">
231 <el-input v-model="loadingModel.awbweight"></el-input> 231 <el-input v-model="loadingModel.awbweight"></el-input>
232 </el-form-item> 232 </el-form-item>
233 </el-col> 233 </el-col>
@@ -235,7 +235,9 @@ @@ -235,7 +235,9 @@
235 <el-form-item label="海关关区" prop="customcode"> 235 <el-form-item label="海关关区" prop="customcode">
236 <el-select v-model="loadingModel.customcode" placeholder="请选择关区代码" 236 <el-select v-model="loadingModel.customcode" placeholder="请选择关区代码"
237 filterable clearable remote :remote-method="remoteMethodCustomCode" :loading="customLoading" 237 filterable clearable remote :remote-method="remoteMethodCustomCode" :loading="customLoading"
238 - :disabled="dialogStatus === 'addAwbh'"> 238 + allow-create
  239 + default-first-option
  240 + >
239 <el-option v-for="item in customCodeList" :key="item.customcode" :label="item.customcode" 241 <el-option v-for="item in customCodeList" :key="item.customcode" :label="item.customcode"
240 :value="item.customcode"> 242 :value="item.customcode">
241 <span style="float: left">{{ item.customcode }}</span> 243 <span style="float: left">{{ item.customcode }}</span>
@@ -247,7 +249,7 @@ @@ -247,7 +249,7 @@
247 </el-row> 249 </el-row>
248 <el-row> 250 <el-row>
249 <el-col :span="7.5"> 251 <el-col :span="7.5">
250 - <el-form-item label="特货代码" prop="awbh"> 252 + <el-form-item label="特货代码" prop="specialgoods">
251 <el-input v-model="loadingModel.specialgoods"></el-input> 253 <el-input v-model="loadingModel.specialgoods"></el-input>
252 </el-form-item> 254 </el-form-item>
253 </el-col> 255 </el-col>
@@ -339,7 +341,8 @@ @@ -339,7 +341,8 @@
339 validAlphabets, 341 validAlphabets,
340 validAlphabetsAndNum, 342 validAlphabetsAndNum,
341 validAlphabetsAndSpanceKey, 343 validAlphabetsAndSpanceKey,
342 - validatorNum 344 + validatorNum,
  345 + validatorCustomsNum
343 } from "@/utils/validate" 346 } from "@/utils/validate"
344 import {getResponseForParam} from '@/api/responseDetail' 347 import {getResponseForParam} from '@/api/responseDetail'
345 export default { 348 export default {
@@ -349,7 +352,7 @@ @@ -349,7 +352,7 @@
349 data() { 352 data() {
350 const validatorAwb = (rule, value, callback) => { 353 const validatorAwb = (rule, value, callback) => {
351 if (!validAwb(value)) { 354 if (!validAwb(value)) {
352 - callback("请正确书写主单号") 355 + callback("请正确书写主单号格式为xxx-xxxxxxxx")
353 } 356 }
354 callback() 357 callback()
355 } 358 }
@@ -377,6 +380,12 @@ @@ -377,6 +380,12 @@
377 } 380 }
378 callback() 381 callback()
379 } 382 }
  383 + const validatorCustomsNums = (rule, value, callback) => {
  384 + if (!validatorCustomsNum(value)) {
  385 + callback(new Error("只能输入4位数字"))
  386 + }
  387 + callback()
  388 + }
380 return { 389 return {
381 total: 1, 390 total: 1,
382 isAdmin: false, 391 isAdmin: false,
@@ -410,11 +419,16 @@ @@ -410,11 +419,16 @@
410 goodsname: [{required: true, trigger: 'blur', validator: validAlphabetsSpanceKey}], 419 goodsname: [{required: true, trigger: 'blur', validator: validAlphabetsSpanceKey}],
411 carrier: [{required: true, trigger: 'blur', validator: validatorAwbh}], 420 carrier: [{required: true, trigger: 'blur', validator: validatorAwbh}],
412 flightno: [{required: true, trigger: 'blur', validator: validatorAwbh}], 421 flightno: [{required: true, trigger: 'blur', validator: validatorAwbh}],
  422 + flightdate: [{required: true, trigger: 'blur'}],
  423 + loadingtime: [{required: true, trigger: 'blur'}],
413 originstation: [{required: true, trigger: 'blur', validator: validatorAlphabets}], 424 originstation: [{required: true, trigger: 'blur', validator: validatorAlphabets}],
414 destinationstation: [{required: true, trigger: 'blur', validator: validatorAlphabets}], 425 destinationstation: [{required: true, trigger: 'blur', validator: validatorAlphabets}],
415 - piece: [{type: 'number', required: true, trigger: 'change', message: '只能输入数字'}],  
416 - weight: [{type: 'number', required: true, trigger: 'change', message: '只能输入数字'}],  
417 - customcode: [{required: true, trigger: 'change', message: '不能为空'}] 426 + lodingpiece: [{type: 'number',required: true, trigger: 'change', message: '只能输入数字'}],
  427 + lodingweight: [{required: true, trigger: 'change', message: '只能输入数字,并且小数位最多两位',validator: validatorNums}],
  428 + customcode: [
  429 + {required: true, message: '关区号不能为空'},
  430 + {validator: validatorCustomsNums,trigger: 'change',message: '关区号为4位整数'}
  431 + ]
418 }, 432 },
419 loadingData: [], 433 loadingData: [],
420 detailData: [], 434 detailData: [],
@@ -435,7 +435,7 @@ @@ -435,7 +435,7 @@
435 filterable 435 filterable
436 allow-create 436 allow-create
437 remote 437 remote
438 - placeholder="请选择" clearable> 438 + placeholder="请选择" clearable>目的站
439 <el-option 439 <el-option
440 v-for="item in countryOption" 440 v-for="item in countryOption"
441 :key="item.value" 441 :key="item.value"
@@ -1050,10 +1050,10 @@ @@ -1050,10 +1050,10 @@
1050 }, 1050 },
1051 by1: { 1051 by1: {
1052 get: function () { 1052 get: function () {
1053 - return util.checkNull(this.preModel.awbinfo.by1)?'':this.preModel.awbinfo.by1 1053 + return util.checkNull(this.preModel.awbinfo.by1)?this.preModel.awbinfo.by1:''
1054 }, 1054 },
1055 set: function (val) { 1055 set: function (val) {
1056 - this.preModel.awbinfo.by1 = util.checkNull(val)?'':val.toUpperCase().trim() 1056 + this.preModel.awbinfo.by1 = util.checkNull(val)?val.toUpperCase().trim():''
1057 } 1057 }
1058 }, 1058 },
1059 dest1: { 1059 dest1: {
@@ -1196,7 +1196,7 @@ @@ -1196,7 +1196,7 @@
1196 this.preModel.flightno = this.preQuery.flightno 1196 this.preModel.flightno = this.preQuery.flightno
1197 this.preModel.flightdate = this.preQuery.flightdate 1197 this.preModel.flightdate = this.preQuery.flightdate
1198 this.preModel.originstation = this.preQuery.originstation 1198 this.preModel.originstation = this.preQuery.originstation
1199 - this.preModel.destinationstation = this.preQuery.carrier 1199 + this.preModel.destinationstation = this.preQuery.destinationstation
1200 this.preModel.customcode = this.preQuery.customcode 1200 this.preModel.customcode = this.preQuery.customcode
1201 this.dialogStatus = 'create' 1201 this.dialogStatus = 'create'
1202 this.dialogFormVisible = true 1202 this.dialogFormVisible = true