Showing
3 changed files
with
110 additions
and
116 deletions
| ... | @@ -5,14 +5,17 @@ | ... | @@ -5,14 +5,17 @@ |
| 5 | <el-divider content-position="left">ET86配舱航班顺位</el-divider> | 5 | <el-divider content-position="left">ET86配舱航班顺位</el-divider> |
| 6 | </el-col> | 6 | </el-col> |
| 7 | </el-row> | 7 | </el-row> |
| 8 | + <!-- ET86配舱航班顺位 --> | ||
| 8 | <el-row :gutter="24" justify="center"> | 9 | <el-row :gutter="24" justify="center"> |
| 9 | <el-col :span="18"> | 10 | <el-col :span="18"> |
| 10 | <yl-table | 11 | <yl-table |
| 11 | - :emptyText="tableEmptyText" | 12 | + emptyText="请添加配舱航班" |
| 12 | :attrs="tableAttr" | 13 | :attrs="tableAttr" |
| 13 | :loadingTable="tableAttr.loadingTable" | 14 | :loadingTable="tableAttr.loadingTable" |
| 14 | :tableData="tableData" | 15 | :tableData="tableData" |
| 15 | - :pageConfig="pageConfig" | 16 | + :pageConfig="{ |
| 17 | + isPagination: false, | ||
| 18 | + }" | ||
| 16 | @add="addBtn" | 19 | @add="addBtn" |
| 17 | > | 20 | > |
| 18 | <template #column> | 21 | <template #column> |
| ... | @@ -36,8 +39,6 @@ | ... | @@ -36,8 +39,6 @@ |
| 36 | @focus="inputFocus(scope)" | 39 | @focus="inputFocus(scope)" |
| 37 | @input="inputEvent" | 40 | @input="inputEvent" |
| 38 | placeholder="请输入航班号" | 41 | placeholder="请输入航班号" |
| 39 | - class="demo-edit" | ||
| 40 | - ref="demo" | ||
| 41 | /> | 42 | /> |
| 42 | </template> | 43 | </template> |
| 43 | </el-table-column> | 44 | </el-table-column> |
| ... | @@ -108,6 +109,7 @@ | ... | @@ -108,6 +109,7 @@ |
| 108 | </yl-table> | 109 | </yl-table> |
| 109 | </el-col> | 110 | </el-col> |
| 110 | </el-row> | 111 | </el-row> |
| 112 | + <!-- 航线维度设置 --> | ||
| 111 | <el-row style="padding: 20px 0"> | 113 | <el-row style="padding: 20px 0"> |
| 112 | <el-col> | 114 | <el-col> |
| 113 | <el-divider content-position="left">航线维度设置</el-divider> | 115 | <el-divider content-position="left">航线维度设置</el-divider> |
| ... | @@ -137,7 +139,6 @@ | ... | @@ -137,7 +139,6 @@ |
| 137 | </el-col> | 139 | </el-col> |
| 138 | <el-col :span="24"> | 140 | <el-col :span="24"> |
| 139 | <el-form-item label="服务种类"> | 141 | <el-form-item label="服务种类"> |
| 140 | - <!-- <div class="label-title label-service-type">服务类型</div> --> | ||
| 141 | <el-col :span="4"> | 142 | <el-col :span="4"> |
| 142 | <el-radio-group | 143 | <el-radio-group |
| 143 | v-model="queryForm.isServiceCode" | 144 | v-model="queryForm.isServiceCode" |
| ... | @@ -195,7 +196,7 @@ | ... | @@ -195,7 +196,7 @@ |
| 195 | <el-form-item label="申报类别"> | 196 | <el-form-item label="申报类别"> |
| 196 | <el-card shadow="never"> | 197 | <el-card shadow="never"> |
| 197 | <el-checkbox-group | 198 | <el-checkbox-group |
| 198 | - v-model="queryForm.checkboxClsssType" | 199 | + v-model="checkboxClsssType" |
| 199 | @change="checkboxSingleName" | 200 | @change="checkboxSingleName" |
| 200 | style="display: flex" | 201 | style="display: flex" |
| 201 | v-if="queryForm.cargoType.length" | 202 | v-if="queryForm.cargoType.length" |
| ... | @@ -240,7 +241,6 @@ | ... | @@ -240,7 +241,6 @@ |
| 240 | placeholder="最大重量" | 241 | placeholder="最大重量" |
| 241 | @blur="inputBlur('maxWeight')" | 242 | @blur="inputBlur('maxWeight')" |
| 242 | ></el-input> | 243 | ></el-input> |
| 243 | - <span ref="maxWeight" class="el-form-item__error"></span> | ||
| 244 | </el-col> | 244 | </el-col> |
| 245 | </el-form-item> | 245 | </el-form-item> |
| 246 | </el-col> | 246 | </el-col> |
| ... | @@ -264,7 +264,6 @@ | ... | @@ -264,7 +264,6 @@ |
| 264 | placeholder="最多件数" | 264 | placeholder="最多件数" |
| 265 | @blur="inputBlur('maxNumOfPieces')" | 265 | @blur="inputBlur('maxNumOfPieces')" |
| 266 | ></el-input> | 266 | ></el-input> |
| 267 | - <span ref="maxNumOfPieces" class="el-form-item__error"></span> | ||
| 268 | </el-col> | 267 | </el-col> |
| 269 | </el-form-item> | 268 | </el-form-item> |
| 270 | </el-col> | 269 | </el-col> |
| ... | @@ -297,10 +296,6 @@ | ... | @@ -297,10 +296,6 @@ |
| 297 | placeholder="最大申报价值" | 296 | placeholder="最大申报价值" |
| 298 | @blur="inputBlur('maxCNYCustomVal')" | 297 | @blur="inputBlur('maxCNYCustomVal')" |
| 299 | ></el-input> | 298 | ></el-input> |
| 300 | - <span | ||
| 301 | - ref="maxCNYCustomVal" | ||
| 302 | - class="el-form-item__error" | ||
| 303 | - ></span> | ||
| 304 | </el-col> | 299 | </el-col> |
| 305 | </el-form-item> | 300 | </el-form-item> |
| 306 | </el-col> | 301 | </el-col> |
| ... | @@ -326,10 +321,6 @@ | ... | @@ -326,10 +321,6 @@ |
| 326 | placeholder="最大申报价值" | 321 | placeholder="最大申报价值" |
| 327 | @blur="inputBlur('maxSUDCustomVal')" | 322 | @blur="inputBlur('maxSUDCustomVal')" |
| 328 | ></el-input> | 323 | ></el-input> |
| 329 | - <span | ||
| 330 | - ref="maxSUDCustomVal" | ||
| 331 | - class="el-form-item__error" | ||
| 332 | - ></span> | ||
| 333 | </el-col> | 324 | </el-col> |
| 334 | </el-form-item> | 325 | </el-form-item> |
| 335 | </el-col> | 326 | </el-col> |
| ... | @@ -368,37 +359,31 @@ export default { | ... | @@ -368,37 +359,31 @@ export default { |
| 368 | mixins: [indexMixins], | 359 | mixins: [indexMixins], |
| 369 | data() { | 360 | data() { |
| 370 | return { | 361 | return { |
| 371 | - test: "测试", | ||
| 372 | formConfig: formConfig, // 表单配置项 | 362 | formConfig: formConfig, // 表单配置项 |
| 373 | queryForm: { | 363 | queryForm: { |
| 374 | // 表单参数 | 364 | // 表单参数 |
| 375 | fltNo: "", // 原航班号 | 365 | fltNo: "", // 原航班号 |
| 376 | isServiceCode: "1", // 服务种类 | 366 | isServiceCode: "1", // 服务种类 |
| 377 | serviceCode: "", | 367 | serviceCode: "", |
| 368 | + includeUrsa: "", // URSA包含 | ||
| 369 | + notIncludeUrsa: "", // URSA不包含 | ||
| 370 | + cargoType: [], // 申报类别调用接口获取所有的申报类别 | ||
| 378 | singleName: false, // 单品名 | 371 | singleName: false, // 单品名 |
| 379 | minWeight: null, | 372 | minWeight: null, |
| 380 | maxWeight: null, | 373 | maxWeight: null, |
| 381 | minNumOfPieces: null, | 374 | minNumOfPieces: null, |
| 382 | maxNumOfPieces: null, | 375 | maxNumOfPieces: null, |
| 383 | - includeUrsa: "", // URSA包含 | ||
| 384 | - notIncludeUrsa: "", // URSA不包含 | ||
| 385 | - checkboxClsssType: [], // 申报类别 | ||
| 386 | minCNYCustomVal: "", // | 376 | minCNYCustomVal: "", // |
| 387 | maxCNYCustomVal: "", // | 377 | maxCNYCustomVal: "", // |
| 388 | minSUDCustomVal: "", // | 378 | minSUDCustomVal: "", // |
| 389 | maxSUDCustomVal: "", // | 379 | maxSUDCustomVal: "", // |
| 390 | - serviceCodeData: [], // 【服务种类】调用接口获取服务种类所有的serviceCode | ||
| 391 | - cargoType: [], // 申报类别 | ||
| 392 | - }, | ||
| 393 | - pageConfig: { | ||
| 394 | - // 分页配置项 | ||
| 395 | - isPagination: false, | ||
| 396 | }, | 380 | }, |
| 397 | tableAttr: tableAttr, // table配置项 | 381 | tableAttr: tableAttr, // table配置项 |
| 398 | - tableEmptyText: "请添加配舱航班", | ||
| 399 | tableData: [], | 382 | tableData: [], |
| 400 | currentIndex: 0, // 记录当前table 列的索引位置 | 383 | currentIndex: 0, // 记录当前table 列的索引位置 |
| 401 | id: 0, | 384 | id: 0, |
| 385 | + checkboxClsssType: [], // 申报类别 | ||
| 386 | + serviceCodeData: [], // 【服务种类】调用接口获取服务种类所有的serviceCode | ||
| 402 | }; | 387 | }; |
| 403 | }, | 388 | }, |
| 404 | computed: {}, | 389 | computed: {}, |
| ... | @@ -418,22 +403,26 @@ export default { | ... | @@ -418,22 +403,26 @@ export default { |
| 418 | this.getEdit(); | 403 | this.getEdit(); |
| 419 | this.PostFindDestinationFltRuleByFlightNo(); | 404 | this.PostFindDestinationFltRuleByFlightNo(); |
| 420 | }, | 405 | }, |
| 421 | - mounted() { | 406 | + mounted() {}, |
| 422 | - this.$nextTick(() => { | ||
| 423 | - let el = document.querySelector(".demo-edit"); | ||
| 424 | - console.log(el); | ||
| 425 | - console.log(this.$refs.demo); | ||
| 426 | - }); | ||
| 427 | - }, | ||
| 428 | directives: { | 407 | directives: { |
| 408 | + // 处理加减天数 | ||
| 429 | "input-filter": { | 409 | "input-filter": { |
| 430 | bind: function (el, binding) { | 410 | bind: function (el, binding) { |
| 431 | el.handler = function (event) { | 411 | el.handler = function (event) { |
| 432 | - console.log(el); | 412 | + if (event.data == "E" || event.data == "e") { |
| 433 | - let regExp = /[^0-9a-zA-Z_]/g; | 413 | + // 无理数时 |
| 434 | - let newValue = event.target.value.replace(regExp, ""); | 414 | + event.target.value = ""; |
| 435 | - if (newValue !== event.target.value) { | 415 | + } |
| 436 | - event.target.value = newValue; | 416 | + if (event.target.value) { |
| 417 | + if (Number(event.target.value) < -7) { | ||
| 418 | + event.target.value = ""; | ||
| 419 | + } else if (Number(event.target.value) > 7) { | ||
| 420 | + event.target.value = ""; | ||
| 421 | + } else if (/[\.]/.test(Number(event.target.value))) { | ||
| 422 | + // 浮点数时 | ||
| 423 | + event.target.value = ""; | ||
| 424 | + } else { | ||
| 425 | + } | ||
| 437 | event.target.dispatchEvent(new Event("input")); | 426 | event.target.dispatchEvent(new Event("input")); |
| 438 | } | 427 | } |
| 439 | }; | 428 | }; |
| ... | @@ -515,11 +504,11 @@ export default { | ... | @@ -515,11 +504,11 @@ export default { |
| 515 | console.log(res); | 504 | console.log(res); |
| 516 | }); | 505 | }); |
| 517 | }, | 506 | }, |
| 518 | - // input 聚焦事件 | 507 | + // 航班号input 聚焦事件 |
| 519 | - inputFocus(scope) { | 508 | + inputFocus({ $index }) { |
| 520 | - this.currentIndex = scope.$index; | 509 | + this.currentIndex = $index; |
| 521 | }, | 510 | }, |
| 522 | - // input事件 | 511 | + // 航班号input搜索事件 |
| 523 | inputEvent: debounce(function () { | 512 | inputEvent: debounce(function () { |
| 524 | let params = { | 513 | let params = { |
| 525 | fltNo: this.tableData[this.currentIndex].fltNo, | 514 | fltNo: this.tableData[this.currentIndex].fltNo, |
| ... | @@ -532,7 +521,7 @@ export default { | ... | @@ -532,7 +521,7 @@ export default { |
| 532 | this.msgError("请输入航班号"); | 521 | this.msgError("请输入航班号"); |
| 533 | } | 522 | } |
| 534 | }, 1000), | 523 | }, 1000), |
| 535 | - // 添加 | 524 | + // 添加ET86配舱航班顺位 |
| 536 | addBtn(item) { | 525 | addBtn(item) { |
| 537 | this.tableData.unshift({ | 526 | this.tableData.unshift({ |
| 538 | id: this.id++, | 527 | id: this.id++, |
| ... | @@ -543,7 +532,6 @@ export default { | ... | @@ -543,7 +532,6 @@ export default { |
| 543 | isOn: "0" ? false : true, | 532 | isOn: "0" ? false : true, |
| 544 | sort: "0", // 排序字段 | 533 | sort: "0", // 排序字段 |
| 545 | }); | 534 | }); |
| 546 | - console.log("add:", this.tableData); | ||
| 547 | }, | 535 | }, |
| 548 | // 是否爆仓 | 536 | // 是否爆仓 |
| 549 | changeCheck({ $index, row }) { | 537 | changeCheck({ $index, row }) { |
| ... | @@ -558,36 +546,47 @@ export default { | ... | @@ -558,36 +546,47 @@ export default { |
| 558 | this.tableData.splice($index, 1); | 546 | this.tableData.splice($index, 1); |
| 559 | }, | 547 | }, |
| 560 | // 类别 | 548 | // 类别 |
| 561 | - checkboxSingleName(val) { | 549 | + checkboxSingleName(arr) { |
| 562 | - console.log(val); | 550 | + let include = this.queryForm.cargoType.filter((item) => |
| 551 | + arr.some((val) => val == item.chineseName) | ||
| 552 | + ); | ||
| 553 | + console.log(arr, include); | ||
| 563 | }, | 554 | }, |
| 564 | - // input失焦事件 | 555 | + // 重量、件数、申报值input失焦事件 |
| 565 | inputBlur(name) { | 556 | inputBlur(name) { |
| 566 | let coin = { | 557 | let coin = { |
| 567 | minCNYCustomVal: "CNY", | 558 | minCNYCustomVal: "CNY", |
| 559 | + maxCNYCustomVal: "CNY", | ||
| 568 | minSUDCustomVal: "USD", | 560 | minSUDCustomVal: "USD", |
| 561 | + maxSUDCustomVal: "USD", | ||
| 569 | }; | 562 | }; |
| 570 | if (name == "minWeight") { | 563 | if (name == "minWeight") { |
| 564 | + // 最小重量 | ||
| 571 | this.validateMaxWeight("maxWeight"); | 565 | this.validateMaxWeight("maxWeight"); |
| 572 | this.validateMinWeight(name); | 566 | this.validateMinWeight(name); |
| 573 | } | 567 | } |
| 574 | if (name == "maxWeight") { | 568 | if (name == "maxWeight") { |
| 569 | + // 最大重量 | ||
| 575 | this.validateMinWeight("minWeight"); | 570 | this.validateMinWeight("minWeight"); |
| 576 | this.validateMaxWeight(name); | 571 | this.validateMaxWeight(name); |
| 577 | } | 572 | } |
| 578 | if (name == "minNumOfPieces") { | 573 | if (name == "minNumOfPieces") { |
| 574 | + // 最小件数 | ||
| 579 | this.validateMaxPieces("maxNumOfPieces"); | 575 | this.validateMaxPieces("maxNumOfPieces"); |
| 580 | this.validateMinPieces(name); | 576 | this.validateMinPieces(name); |
| 581 | } | 577 | } |
| 582 | if (name == "maxNumOfPieces") { | 578 | if (name == "maxNumOfPieces") { |
| 579 | + // 最大件数 | ||
| 583 | this.validateMinPieces("minNumOfPieces"); | 580 | this.validateMinPieces("minNumOfPieces"); |
| 584 | this.validateMaxPieces(name); | 581 | this.validateMaxPieces(name); |
| 585 | } | 582 | } |
| 586 | if (name == "minCNYCustomVal" || name == "minSUDCustomVal") { | 583 | if (name == "minCNYCustomVal" || name == "minSUDCustomVal") { |
| 584 | + // 最小申报值(CNY/USD) | ||
| 587 | this.validateMaxCustomVal(coin[name]); | 585 | this.validateMaxCustomVal(coin[name]); |
| 588 | this.validateMinCustomVal(coin[name]); | 586 | this.validateMinCustomVal(coin[name]); |
| 589 | } | 587 | } |
| 590 | if (name == "maxCNYCustomVal" || name == "maxSUDCustomVal") { | 588 | if (name == "maxCNYCustomVal" || name == "maxSUDCustomVal") { |
| 589 | + // 最大申报值(CNY/USD) | ||
| 591 | this.validateMinCustomVal(coin[name]); | 590 | this.validateMinCustomVal(coin[name]); |
| 592 | this.validateMaxCustomVal(coin[name]); | 591 | this.validateMaxCustomVal(coin[name]); |
| 593 | } | 592 | } |
| ... | @@ -595,8 +594,8 @@ export default { | ... | @@ -595,8 +594,8 @@ export default { |
| 595 | // 表单提交 | 594 | // 表单提交 |
| 596 | submitForm(formName) { | 595 | submitForm(formName) { |
| 597 | this.$refs[formName].validate((valid) => { | 596 | this.$refs[formName].validate((valid) => { |
| 598 | - console.log(valid); | ||
| 599 | if (valid) { | 597 | if (valid) { |
| 598 | + console.log(this.tableData); | ||
| 600 | } else { | 599 | } else { |
| 601 | console.log("error submit!!"); | 600 | console.log("error submit!!"); |
| 602 | return false; | 601 | return false; |
| ... | @@ -607,49 +606,44 @@ export default { | ... | @@ -607,49 +606,44 @@ export default { |
| 607 | }, | 606 | }, |
| 608 | }; | 607 | }; |
| 609 | </script> | 608 | </script> |
| 610 | -<style lang='scss' scoped> | 609 | +<style lang="scss" scoped> |
| 611 | .rowPadding { | 610 | .rowPadding { |
| 612 | padding: 10px 0; | 611 | padding: 10px 0; |
| 613 | font-size: 12px; | 612 | font-size: 12px; |
| 614 | } | 613 | } |
| 615 | -.label-title{ | ||
| 616 | - font-size: 14px; | ||
| 617 | - color: #606266; | ||
| 618 | - font-weight: 700; | ||
| 619 | -} | ||
| 620 | ::v-deep .custom-label { | 614 | ::v-deep .custom-label { |
| 621 | - .el-form-item__content{ | 615 | + .el-form-item__content { |
| 622 | - display: flex; | 616 | + display: flex; |
| 623 | - margin-left: 0 !important; | 617 | + margin-left: 0 !important; |
| 624 | - span{ | 618 | + span { |
| 625 | - font-size: 14px; | 619 | + font-size: 14px; |
| 626 | - color: #606266; | 620 | + color: #606266; |
| 627 | - font-weight: 700; | 621 | + font-weight: 700; |
| 628 | - float: right; | 622 | + float: right; |
| 629 | - margin-right: 10px; | 623 | + margin-right: 10px; |
| 630 | - text-align: end; | 624 | + text-align: end; |
| 631 | } | 625 | } |
| 632 | - .custom-label-title{ | 626 | + .custom-label-title { |
| 633 | -width: 120px; | 627 | + width: 120px; |
| 634 | } | 628 | } |
| 635 | - .el-input__suffix{ | 629 | + .el-input__suffix { |
| 636 | right: -15px !important; | 630 | right: -15px !important; |
| 637 | } | 631 | } |
| 638 | - .el-form-item__error{ | 632 | + .el-form-item__error { |
| 639 | - color: #ff4949; | 633 | + color: #ff4949; |
| 640 | - font-size: 12px; | 634 | + font-size: 12px; |
| 641 | - line-height: 1; | 635 | + line-height: 1; |
| 642 | - padding-top: 4px; | 636 | + padding-top: 4px; |
| 643 | - position: absolute; | 637 | + position: absolute; |
| 644 | - top: 100%; | 638 | + top: 100%; |
| 645 | - left: 0; | 639 | + left: 0; |
| 646 | - font-weight: 500; | 640 | + font-weight: 500; |
| 647 | - width: 100% !important; | 641 | + width: 100% !important; |
| 648 | } | 642 | } |
| 649 | } | 643 | } |
| 650 | } | 644 | } |
| 651 | ::v-deep .custom-label-pieces { | 645 | ::v-deep .custom-label-pieces { |
| 652 | - .el-form-item__content{ | 646 | + .el-form-item__content { |
| 653 | width: 80%; | 647 | width: 80%; |
| 654 | } | 648 | } |
| 655 | } | 649 | } | ... | ... |
| ... | @@ -29,7 +29,6 @@ export default { | ... | @@ -29,7 +29,6 @@ export default { |
| 29 | }, | 29 | }, |
| 30 | // radio包含不包含serviceCode | 30 | // radio包含不包含serviceCode |
| 31 | isServiceCode(val) { | 31 | isServiceCode(val) { |
| 32 | - // 包含 | ||
| 33 | // 勾选的时候去校验 || 输入的时候去校验 | 32 | // 勾选的时候去校验 || 输入的时候去校验 |
| 34 | if (val == 1) { | 33 | if (val == 1) { |
| 35 | if (this.serviceCodeCofig().noInclude.length) { | 34 | if (this.serviceCodeCofig().noInclude.length) { |
| ... | @@ -58,7 +57,7 @@ export default { | ... | @@ -58,7 +57,7 @@ export default { |
| 58 | } | 57 | } |
| 59 | }, | 58 | }, |
| 60 | 59 | ||
| 61 | - // 最小重量 | 60 | + // 最小重量 【重量可以为空为0】 |
| 62 | validateMinWeight(name) { | 61 | validateMinWeight(name) { |
| 63 | if (/^(0|[1-9]\d*)(.\d{1,5})?$/.test(Number(this.queryForm[name]))) { | 62 | if (/^(0|[1-9]\d*)(.\d{1,5})?$/.test(Number(this.queryForm[name]))) { |
| 64 | // 最小重量大于0~34,并且最小重量不得大于最大重量 | 63 | // 最小重量大于0~34,并且最小重量不得大于最大重量 |
| ... | @@ -97,9 +96,8 @@ export default { | ... | @@ -97,9 +96,8 @@ export default { |
| 97 | }, | 96 | }, |
| 98 | // 最大重量 | 97 | // 最大重量 |
| 99 | validateMaxWeight(name) { | 98 | validateMaxWeight(name) { |
| 100 | - // 最大重量 | 99 | + // 校验输入的规则(保留两位小数) |
| 101 | if (/^(0|[1-9]\d*)(.\d{1,2})?$/.test(Number(this.queryForm[name]))) { | 100 | if (/^(0|[1-9]\d*)(.\d{1,2})?$/.test(Number(this.queryForm[name]))) { |
| 102 | - // 最大重量大于0~34,并且最大重量不得小于最小重量 | ||
| 103 | if (this.queryForm[name] && this.queryForm.minWeight) { | 101 | if (this.queryForm[name] && this.queryForm.minWeight) { |
| 104 | if (Number(this.queryForm[name]) < Number(this.queryForm.minWeight)) { | 102 | if (Number(this.queryForm[name]) < Number(this.queryForm.minWeight)) { |
| 105 | this.$refs.minWeight.innerHTML = ""; | 103 | this.$refs.minWeight.innerHTML = ""; |
| ... | @@ -133,7 +131,7 @@ export default { | ... | @@ -133,7 +131,7 @@ export default { |
| 133 | return false; | 131 | return false; |
| 134 | } | 132 | } |
| 135 | }, | 133 | }, |
| 136 | - // 最少件数 | 134 | + // 最小件数 【件数可以为空但件数不得为0】 |
| 137 | validateMinPieces(name) { | 135 | validateMinPieces(name) { |
| 138 | // 校验输入的规则(只能输入正整数) | 136 | // 校验输入的规则(只能输入正整数) |
| 139 | if (/^\d+$/.test(Number(this.queryForm[name]))) { | 137 | if (/^\d+$/.test(Number(this.queryForm[name]))) { |
| ... | @@ -142,13 +140,13 @@ export default { | ... | @@ -142,13 +140,13 @@ export default { |
| 142 | Number(this.queryForm[name]) > Number(this.queryForm.maxNumOfPieces) | 140 | Number(this.queryForm[name]) > Number(this.queryForm.maxNumOfPieces) |
| 143 | ) { | 141 | ) { |
| 144 | this.$refs.minNumOfPieces.innerHTML = ""; | 142 | this.$refs.minNumOfPieces.innerHTML = ""; |
| 145 | - this.$refs.minNumOfPieces.innerHTML = "最少件数不得大于最多件数"; | 143 | + this.$refs.minNumOfPieces.innerHTML = "最小件数不得大于最大件数"; |
| 146 | } else if ( | 144 | } else if ( |
| 147 | Number(this.queryForm[name]) < 1 || | 145 | Number(this.queryForm[name]) < 1 || |
| 148 | Number(this.queryForm.maxNumOfPieces) < 1 | 146 | Number(this.queryForm.maxNumOfPieces) < 1 |
| 149 | ) { | 147 | ) { |
| 150 | this.$refs.minNumOfPieces.innerHTML = ""; | 148 | this.$refs.minNumOfPieces.innerHTML = ""; |
| 151 | - this.$refs.minNumOfPieces.innerHTML = "最少件数和最多件数不能小于1"; | 149 | + this.$refs.minNumOfPieces.innerHTML = "最小件数和最大件数不能小于1"; |
| 152 | } else { | 150 | } else { |
| 153 | this.$refs.minNumOfPieces.innerHTML = ""; | 151 | this.$refs.minNumOfPieces.innerHTML = ""; |
| 154 | return true; | 152 | return true; |
| ... | @@ -159,10 +157,11 @@ export default { | ... | @@ -159,10 +157,11 @@ export default { |
| 159 | ) { | 157 | ) { |
| 160 | if (Number(this.queryForm[name]) < 1) { | 158 | if (Number(this.queryForm[name]) < 1) { |
| 161 | this.$refs.minNumOfPieces.innerHTML = ""; | 159 | this.$refs.minNumOfPieces.innerHTML = ""; |
| 162 | - this.$refs.minNumOfPieces.innerHTML = "最少件数和最多件数不能小于1"; | 160 | + this.$refs.minNumOfPieces.innerHTML = "最小件数和最大件数不能小于1"; |
| 163 | } else if (Number(this.queryForm[name]) > 100) { | 161 | } else if (Number(this.queryForm[name]) > 100) { |
| 164 | this.$refs.minNumOfPieces.innerHTML = ""; | 162 | this.$refs.minNumOfPieces.innerHTML = ""; |
| 165 | - this.$refs.minNumOfPieces.innerHTML = "最少件数和最多件数不能大于100"; | 163 | + this.$refs.minNumOfPieces.innerHTML = |
| 164 | + "最小件数和最大件数不能大于100"; | ||
| 166 | } else { | 165 | } else { |
| 167 | this.$refs.minNumOfPieces.innerHTML = ""; | 166 | this.$refs.minNumOfPieces.innerHTML = ""; |
| 168 | return true; | 167 | return true; |
| ... | @@ -176,7 +175,7 @@ export default { | ... | @@ -176,7 +175,7 @@ export default { |
| 176 | return false; | 175 | return false; |
| 177 | } | 176 | } |
| 178 | }, | 177 | }, |
| 179 | - // 最多件数 | 178 | + // 最大件数 |
| 180 | validateMaxPieces(name) { | 179 | validateMaxPieces(name) { |
| 181 | // 校验输入的规则(只能输入正整数) | 180 | // 校验输入的规则(只能输入正整数) |
| 182 | if (/^\d+$/.test(Number(this.queryForm[name]))) { | 181 | if (/^\d+$/.test(Number(this.queryForm[name]))) { |
| ... | @@ -185,13 +184,13 @@ export default { | ... | @@ -185,13 +184,13 @@ export default { |
| 185 | Number(this.queryForm[name]) < Number(this.queryForm.minNumOfPieces) | 184 | Number(this.queryForm[name]) < Number(this.queryForm.minNumOfPieces) |
| 186 | ) { | 185 | ) { |
| 187 | this.$refs.minNumOfPieces.innerHTML = ""; | 186 | this.$refs.minNumOfPieces.innerHTML = ""; |
| 188 | - this.$refs.minNumOfPieces.innerHTML = "最大件数不得小于最少件数"; | 187 | + this.$refs.minNumOfPieces.innerHTML = "最大件数不得小于最小件数"; |
| 189 | } else if ( | 188 | } else if ( |
| 190 | Number(this.queryForm[name]) < 1 || | 189 | Number(this.queryForm[name]) < 1 || |
| 191 | Number(this.queryForm.minNumOfPieces) < 1 | 190 | Number(this.queryForm.minNumOfPieces) < 1 |
| 192 | ) { | 191 | ) { |
| 193 | this.$refs.minNumOfPieces.innerHTML = ""; | 192 | this.$refs.minNumOfPieces.innerHTML = ""; |
| 194 | - this.$refs.minNumOfPieces.innerHTML = "最少件数和最多件数不能小于1"; | 193 | + this.$refs.minNumOfPieces.innerHTML = "最小件数和最大件数不能小于1"; |
| 195 | return false; | 194 | return false; |
| 196 | } else { | 195 | } else { |
| 197 | this.$refs.minNumOfPieces.innerHTML = ""; | 196 | this.$refs.minNumOfPieces.innerHTML = ""; |
| ... | @@ -203,10 +202,11 @@ export default { | ... | @@ -203,10 +202,11 @@ export default { |
| 203 | ) { | 202 | ) { |
| 204 | if (Number(this.queryForm[name]) < 1) { | 203 | if (Number(this.queryForm[name]) < 1) { |
| 205 | this.$refs.minNumOfPieces.innerHTML = ""; | 204 | this.$refs.minNumOfPieces.innerHTML = ""; |
| 206 | - this.$refs.minNumOfPieces.innerHTML = "最少件数和最多件数不能小于1"; | 205 | + this.$refs.minNumOfPieces.innerHTML = "最小件数和最大件数不能小于1"; |
| 207 | } else if (Number(this.queryForm[name]) > 100) { | 206 | } else if (Number(this.queryForm[name]) > 100) { |
| 208 | this.$refs.minNumOfPieces.innerHTML = ""; | 207 | this.$refs.minNumOfPieces.innerHTML = ""; |
| 209 | - this.$refs.minNumOfPieces.innerHTML = "最少件数和最多件数不能大于100"; | 208 | + this.$refs.minNumOfPieces.innerHTML = |
| 209 | + "最小件数和最大件数不能大于100"; | ||
| 210 | } else { | 210 | } else { |
| 211 | this.$refs.minNumOfPieces.innerHTML = ""; | 211 | this.$refs.minNumOfPieces.innerHTML = ""; |
| 212 | return true; | 212 | return true; |
| ... | @@ -221,16 +221,13 @@ export default { | ... | @@ -221,16 +221,13 @@ export default { |
| 221 | } | 221 | } |
| 222 | }, | 222 | }, |
| 223 | 223 | ||
| 224 | - // 最小申报价值 | 224 | + // 最小申报价值 【申报价值可以为空为0】 |
| 225 | validateMinCustomVal(name) { | 225 | validateMinCustomVal(name) { |
| 226 | // 申报价值 | 226 | // 申报价值 |
| 227 | - if ( | 227 | + let value = |
| 228 | - /^(0|[1-9]\d*)(.\d{1,2})?$/.test( | 228 | + this.queryForm.minCNYCustomVal || this.queryForm.minSUDCustomVal; |
| 229 | - Number( | 229 | + let regexp = /^(0|[1-9]\d*)(.\d{1,2})?$/.test(Number(value)); |
| 230 | - this.queryForm.minCNYCustomVal || this.queryForm.minSUDCustomVal | 230 | + if (regexp) { |
| 231 | - ) | ||
| 232 | - ) | ||
| 233 | - ) { | ||
| 234 | if (name == "USD" || name == "美元") { | 231 | if (name == "USD" || name == "美元") { |
| 235 | // 申报价值(美元)0~600 | 232 | // 申报价值(美元)0~600 |
| 236 | if ( | 233 | if ( |
| ... | @@ -307,13 +304,10 @@ export default { | ... | @@ -307,13 +304,10 @@ export default { |
| 307 | // 最大申报价值 | 304 | // 最大申报价值 |
| 308 | validateMaxCustomVal(name) { | 305 | validateMaxCustomVal(name) { |
| 309 | // 申报价值 | 306 | // 申报价值 |
| 310 | - if ( | 307 | + let value = |
| 311 | - /^(0|[1-9]\d*)(.\d{1,2})?$/.test( | 308 | + this.queryForm.maxCNYCustomVal || this.queryForm.maxSUDCustomVal; |
| 312 | - Number( | 309 | + let regexp = /^(0|[1-9]\d*)(.\d{1,2})?$/.test(Number(value)); |
| 313 | - this.queryForm.maxCNYCustomVal || this.queryForm.maxSUDCustomVal | 310 | + if (regexp) { |
| 314 | - ) | ||
| 315 | - ) | ||
| 316 | - ) { | ||
| 317 | if (name == "USD" || name == "美元") { | 311 | if (name == "USD" || name == "美元") { |
| 318 | // 申报价值(美元)0~600 | 312 | // 申报价值(美元)0~600 |
| 319 | if ( | 313 | if ( |
| ... | @@ -330,16 +324,16 @@ export default { | ... | @@ -330,16 +324,16 @@ export default { |
| 330 | } else { | 324 | } else { |
| 331 | this.$refs.minSUDCustomVal.innerHTML = ""; | 325 | this.$refs.minSUDCustomVal.innerHTML = ""; |
| 332 | } | 326 | } |
| 333 | - if (Number(this.queryForm.maxCNYCustomVal) > 600) { | 327 | + if (Number(this.queryForm.maxSUDCustomVal) > 600) { |
| 334 | this.$refs.minSUDCustomVal.innerHTML = ""; | 328 | this.$refs.minSUDCustomVal.innerHTML = ""; |
| 335 | this.$refs.minSUDCustomVal.innerHTML = "最大申报值不得大于600"; | 329 | this.$refs.minSUDCustomVal.innerHTML = "最大申报值不得大于600"; |
| 336 | return false; | 330 | return false; |
| 337 | } | 331 | } |
| 338 | - } else if (Number(this.queryForm.maxCNYCustomVal) < 0) { | 332 | + } else if (Number(this.queryForm.maxSUDCustomVal) < 0) { |
| 339 | this.$refs.minSUDCustomVal.innerHTML = ""; | 333 | this.$refs.minSUDCustomVal.innerHTML = ""; |
| 340 | this.$refs.minSUDCustomVal.innerHTML = "申报价值(美元)0~600"; | 334 | this.$refs.minSUDCustomVal.innerHTML = "申报价值(美元)0~600"; |
| 341 | return false; | 335 | return false; |
| 342 | - } else if (Number(this.queryForm.maxCNYCustomVal) > 600) { | 336 | + } else if (Number(this.queryForm.maxSUDCustomVal) > 600) { |
| 343 | this.$refs.minSUDCustomVal.innerHTML = ""; | 337 | this.$refs.minSUDCustomVal.innerHTML = ""; |
| 344 | this.$refs.minSUDCustomVal.innerHTML = "最大申报值不得大于600"; | 338 | this.$refs.minSUDCustomVal.innerHTML = "最大申报值不得大于600"; |
| 345 | return false; | 339 | return false; | ... | ... |
| ... | @@ -44,8 +44,9 @@ export default { | ... | @@ -44,8 +44,9 @@ export default { |
| 44 | data() { | 44 | data() { |
| 45 | return { | 45 | return { |
| 46 | formConfig: formConfig, // 表单配置项 | 46 | formConfig: formConfig, // 表单配置项 |
| 47 | - queryForm: { // 表单参数 | 47 | + queryForm: { |
| 48 | - status: "有效" | 48 | + // 表单参数 |
| 49 | + status: "有效", | ||
| 49 | }, | 50 | }, |
| 50 | pageConfig: { | 51 | pageConfig: { |
| 51 | // 分页配置项 | 52 | // 分页配置项 |
| ... | @@ -115,10 +116,15 @@ export default { | ... | @@ -115,10 +116,15 @@ export default { |
| 115 | }, | 116 | }, |
| 116 | // 搜索 | 117 | // 搜索 |
| 117 | searchBtn(row) { | 118 | searchBtn(row) { |
| 119 | + let params = { | ||
| 120 | + ...this.queryForm, | ||
| 121 | + }; | ||
| 122 | + if (this.queryForm.status == "有效") { | ||
| 123 | + params.status = '1'; | ||
| 124 | + } | ||
| 118 | this.$refs.ruleForm.handleSearch("ruleForm", (val) => { | 125 | this.$refs.ruleForm.handleSearch("ruleForm", (val) => { |
| 119 | - console.log(val); | 126 | + console.log(params); |
| 120 | }); | 127 | }); |
| 121 | - console.log(this.queryForm); | ||
| 122 | }, | 128 | }, |
| 123 | // 重置表单 | 129 | // 重置表单 |
| 124 | restForm() { | 130 | restForm() { |
| ... | @@ -154,7 +160,7 @@ export default { | ... | @@ -154,7 +160,7 @@ export default { |
| 154 | }) | 160 | }) |
| 155 | .then(() => { | 161 | .then(() => { |
| 156 | console.log("删除:", item); | 162 | console.log("删除:", item); |
| 157 | - this.msgSuccess("删除成功!") | 163 | + this.msgSuccess("删除成功!"); |
| 158 | }) | 164 | }) |
| 159 | .catch(() => {}); | 165 | .catch(() => {}); |
| 160 | }, | 166 | }, | ... | ... |
-
Please register or login to post a comment