Elements-SY

Merge branch 'test' into uat

export const inputBlurValidate = {
data(){
return {
queryForm: {
minWeight: "",
maxWeight: "",
minNumOfPieces: "",
maxNumOfPieces: "",
},
};
},
methods: {
// 最小件数失焦事件
inputBlurMinPieces({ target }) {
this.validateNumOfPieces(target.value, "minNumOfPieces");
},
// 最大件数失焦事件
inputBlurMaxPieces({ target }) {
this.validateNumOfPieces(target.value, "maxNumOfPieces");
},
// 最小重量失焦事件
inputBlurMinWeight({ target }) {
this.validateWeight(target.value, "minWeight");
},
// 最大重量失焦事件
inputBlurMaxWeight({ target }) {
this.validateWeight(target.value, "maxWeight");
},
// 最小申报价值
inputBlurMin({ target }, customVal) {
this.validateCustomVal(target.value, customVal);
},
// 最大申报价值
inputBlurMax({ target }, customVal) {
this.validateCustomVal(target.value, customVal);
},
// 校验件数方法 【件数可以为空但件数不得为0】只能输入正整数
validateNumOfPieces(value, pieces) {
if (value.length) {
this.queryForm[pieces] = Number(value);
let markPieces = false;
if (pieces == "minNumOfPieces" || pieces == "maxNumOfPieces") {
if (this.queryForm.minNumOfPieces && this.queryForm.maxNumOfPieces) {
markPieces = Number(this.queryForm.maxNumOfPieces) < Number(this.queryForm.minNumOfPieces);
}
}
if (/^\d+$/.test(this.queryForm[pieces])) {
if (markPieces) {
if (this.queryForm.maxNumOfPieces < this.queryForm.minNumOfPieces) {
if (Array.isArray(this.$refs.minNumOfPieces)) {
this.msgError("最小件数不得大于最大件数");
} else {
this.$refs.minNumOfPieces.innerHTML = "";
this.$refs.minNumOfPieces.innerHTML = "最小件数不得大于最大件数";
}
} else if (
this.queryForm.minNumOfPieces < 1 || this.queryForm.maxNumOfPieces < 1
) {
if (Array.isArray(this.$refs.minNumOfPieces)) {
this.msgError("最小件数和最大件数不能小于1");
} else {
this.$refs.minNumOfPieces.innerHTML = "";
this.$refs.minNumOfPieces.innerHTML = "最小件数和最大件数不能小于1";
}
} else {
if (!Array.isArray(this.$refs.minNumOfPieces)) {
this.$refs.minNumOfPieces.innerHTML = "";
}
}
} else {
if (value.length) {
if (Number(value) < 1) {
if (Array.isArray(this.$refs.minNumOfPieces)) {
this.msgError("件数不得小于1");
} else {
this.$refs.minNumOfPieces.innerHTML = "";
this.$refs.minNumOfPieces.innerHTML = "件数不得小于1";
}
} else {
if (!Array.isArray(this.$refs.minNumOfPieces)) {
this.$refs.minNumOfPieces.innerHTML = "";
}
}
}
}
} else {
if (Array.isArray(this.$refs.minNumOfPieces)) {
this.msgError("请输入有效件数");
} else {
this.$refs.minNumOfPieces.innerHTML = "";
this.$refs.minNumOfPieces.innerHTML = "请输入有效件数";
}
return false;
}
}
},
// 校验重量方法 【重量可以为空为0 && 最小/大重量的范围0~34KG】允许保留1~5位小数。
validateWeight(value, weight) {
if (value.length) {
this.queryForm[weight] = Number(value);
let markWeight = false;
if (weight == "minWeight" || weight == "maxWeight") {
if (this.queryForm.minWeight && this.queryForm.maxWeight) {
markWeight = Number(this.queryForm.maxWeight) < Number(this.queryForm.minWeight);
}
}
if (/^(0|[1-9]\d*)(.\d{1,5})?$/.test(this.queryForm[weight])) {
if (this.queryForm[weight] >= 0) {
if (markWeight) {
if (Array.isArray(this.$refs.minWeight)) {
this.msgError("最小重量不得大于最大重量");
} else {
this.$refs.minWeight.innerHTML = "";
this.$refs.minWeight.innerHTML = "最小重量不得大于最大重量";
}
} else if (this.queryForm[weight] > 34) {
if (Array.isArray(this.$refs.minWeight)) {
this.msgError("最大重量不能大于34KG");
} else {
this.$refs.minWeight.innerHTML = "";
this.$refs.minWeight.innerHTML = "最大重量不能大于34KG";
}
} else {
if (!Array.isArray(this.$refs.minWeight)) {
this.$refs.minWeight.innerHTML = "";
}
}
} else {
if (value.length) {
if (Number(value) > 34) {
if (Array.isArray(this.$refs.minWeight)) {
this.msgError("最大重量不能大于34KG");
} else {
this.$refs.minWeight.innerHTML = "";
this.$refs.minWeight.innerHTML = "最大重量不能大于34KG";
}
} else {
if (!Array.isArray(this.$refs.minWeight)) {
this.$refs.minWeight.innerHTML = "";
}
}
}
}
} else {
if (Array.isArray(this.$refs.minWeight)) {
this.msgError("请输入正整数,小数保留5位");
} else {
this.$refs.minWeight.innerHTML = "";
this.$refs.minWeight.innerHTML = "请输入正整数,小数保留5位";
}
return false;
}
}
},
// 报价值【申报价值可以为空为0】
validateCustomVal(value, customVal) {
if (value.length) {
this.queryForm[customVal] = Number(value);
let coin = {
minCNYCustomVal: "minCNYCustomVal",
maxCNYCustomVal: "minCNYCustomVal",
minSUDCustomVal: "minSUDCustomVal",
maxSUDCustomVal: "minSUDCustomVal",
};
let currency = {
minCNYCustomVal: 2000,
maxCNYCustomVal: 2000,
minSUDCustomVal: 600,
maxSUDCustomVal: 600,
};
let markCoin = false;
if (customVal == "minCNYCustomVal" || customVal == "maxCNYCustomVal") {
if (this.queryForm.minCNYCustomVal && this.queryForm.maxCNYCustomVal) {
markCoin = Number(this.queryForm.maxCNYCustomVal) < Number(this.queryForm.minCNYCustomVal);
}
} else {
if (this.queryForm.minSUDCustomVal && this.queryForm.maxSUDCustomVal) {
markCoin = Number(this.queryForm.maxSUDCustomVal) < Number(this.queryForm.minSUDCustomVal);
}
}
if (/^(0|[1-9]\d*)(.\d{1,2})?$/.test(this.queryForm[customVal])) {
if (this.queryForm[customVal] >= 0) {
if (markCoin) {
this.$refs[coin[customVal]].innerHTML = "";
this.$refs[coin[customVal]].innerHTML = "最小申报价值不得大于最大申报价值";
} else if (this.queryForm[customVal] > currency[customVal]) {
this.$refs[coin[customVal]].innerHTML = "";
this.$refs[coin[customVal]].innerHTML = `最大申报值不得大于${currency[customVal]}`;
} else {
this.$refs[coin[customVal]].innerHTML = "";
}
} else {
if (value.length) {
if (Number(value) > currency[customVal]) {
this.$refs[coin[customVal]].innerHTML = "";
this.$refs[coin[customVal]].innerHTML = `最大申报值不得大于${currency[customVal]}`;
} else {
this.$refs[coin[customVal]].innerHTML = "";
}
}
}
} else {
this.$refs[coin[customVal]].innerHTML = "";
this.$refs[coin[customVal]].innerHTML = "请输入正确申报价值";
return false;
}
}
},
},
};
......@@ -303,7 +303,7 @@ export default {
this.shiftKey = false;
}
});
// this.tableHeight = window.innerHeight - this.$refs.form.$el.offsetHeight - 60;
this.tableHeight = window.innerHeight - this.$refs.form.$el.offsetHeight - 60;
},
methods: {
//查询条件
......
......@@ -71,7 +71,11 @@
align="center"
>
<template slot-scope="scope">
<el-select v-model="scope.row.fltRoute" placeholder="请选择" size="small">
<el-select
v-model="scope.row.fltRoute"
placeholder="请选择"
size="small"
>
<el-option
v-for="item in scope.row.routeList"
:key="item.id"
......@@ -231,7 +235,7 @@
v-model.trim="queryForm.minWeight"
clearable
placeholder="最小重量"
@blur="inputBlur('minWeight')"
@blur="inputBlurMinWeight($event)"
></el-input>
<span ref="minWeight" class="el-form-item__error"></span>
</el-col>
......@@ -241,7 +245,7 @@
v-model.trim="queryForm.maxWeight"
clearable
placeholder="最大重量"
@blur="inputBlur('maxWeight')"
@blur="inputBlurMaxWeight($event)"
></el-input>
</el-col>
</el-form-item>
......@@ -254,7 +258,7 @@
v-model.trim="queryForm.minNumOfPieces"
clearable
placeholder="最少件数"
@blur="inputBlur('minNumOfPieces')"
@blur="inputBlurMinPieces($event)"
></el-input>
<span ref="minNumOfPieces" class="el-form-item__error"></span>
</el-col>
......@@ -264,7 +268,7 @@
v-model.trim="queryForm.maxNumOfPieces"
clearable
placeholder="最多件数"
@blur="inputBlur('maxNumOfPieces')"
@blur="inputBlurMaxPieces($event)"
></el-input>
</el-col>
</el-form-item>
......@@ -283,7 +287,7 @@
v-model.trim="queryForm.minCNYCustomVal"
clearable
placeholder="最小申报价值"
@blur="inputBlur('minCNYCustomVal')"
@blur="inputBlurMin($event, 'minCNYCustomVal')"
></el-input>
<span
ref="minCNYCustomVal"
......@@ -296,7 +300,7 @@
v-model.trim="queryForm.maxCNYCustomVal"
clearable
placeholder="最大申报价值"
@blur="inputBlur('maxCNYCustomVal')"
@blur="inputBlurMax($event, 'maxCNYCustomVal')"
></el-input>
</el-col>
</el-form-item>
......@@ -308,7 +312,7 @@
v-model.trim="queryForm.minSUDCustomVal"
clearable
placeholder="最小申报价值"
@blur="inputBlur('minSUDCustomVal')"
@blur="inputBlurMin($event, 'minSUDCustomVal')"
></el-input>
<span
ref="minSUDCustomVal"
......@@ -321,7 +325,7 @@
v-model.trim="queryForm.maxSUDCustomVal"
clearable
placeholder="最大申报价值"
@blur="inputBlur('maxSUDCustomVal')"
@blur="inputBlurMax($event, 'maxSUDCustomVal')"
></el-input>
</el-col>
</el-form-item>
......@@ -345,6 +349,7 @@ import YlForm from "@/components/YlForm";
import YlTable from "@/components/YlTable";
import { formConfig } from "./formConfig";
import { debounce } from "@/utils";
import { inputBlurValidate } from "@/utils/mixins";
import { tableAttr } from "./tableConfig";
import {
allDictData, // 获取全部字典
......@@ -358,7 +363,7 @@ export default {
YlForm,
YlTable,
},
mixins: [indexMixins],
mixins: [indexMixins, inputBlurValidate],
data() {
return {
formConfig: formConfig, // 表单配置项
......@@ -372,10 +377,10 @@ export default {
cargoType: [], // 申报类别调用接口获取所有的申报类别
checkboxCargoType: [], // 已勾选申报类别的数据
singleName: false, // 单品名
minWeight: null,
maxWeight: null,
minNumOfPieces: null,
maxNumOfPieces: null,
minWeight: "",
maxWeight: "",
minNumOfPieces: "",
maxNumOfPieces: "",
minCNYCustomVal: "", //
maxCNYCustomVal: "", //
minSUDCustomVal: "", //
......@@ -556,45 +561,6 @@ export default {
this.queryForm.checkboxCargoType = include; //已勾选申报类别的数据
// console.log(arr, include);
},
// 重量、件数、申报值input失焦事件
inputBlur(name) {
let coin = {
minCNYCustomVal: "CNY",
maxCNYCustomVal: "CNY",
minSUDCustomVal: "USD",
maxSUDCustomVal: "USD",
};
if (name == "minWeight") {
// 最小重量
this.validateMaxWeight("maxWeight");
this.validateMinWeight(name);
}
if (name == "maxWeight") {
// 最大重量
this.validateMinWeight("minWeight");
this.validateMaxWeight(name);
}
if (name == "minNumOfPieces") {
// 最小件数
this.validateMaxPieces("maxNumOfPieces");
this.validateMinPieces(name);
}
if (name == "maxNumOfPieces") {
// 最大件数
this.validateMinPieces("minNumOfPieces");
this.validateMaxPieces(name);
}
if (name == "minCNYCustomVal" || name == "minSUDCustomVal") {
// 最小申报值(CNY/USD)
this.validateMaxCustomVal(coin[name]);
this.validateMinCustomVal(coin[name]);
}
if (name == "maxCNYCustomVal" || name == "maxSUDCustomVal") {
// 最大申报值(CNY/USD)
this.validateMinCustomVal(coin[name]);
this.validateMaxCustomVal(coin[name]);
}
},
// 表单提交
submitForm(formName) {
this.$refs[formName].validate((valid) => {
......@@ -602,8 +568,8 @@ export default {
let parmas = {
fltInfoList: this.tableData,
...this.queryForm,
}
parmas.singleName = this.queryForm.singleName ? 'Y' : 'N'; // N为单品名,Y为多品名
};
parmas.singleName = this.queryForm.singleName ? "Y" : "N"; // N为单品名,Y为多品名
console.log(parmas);
} else {
console.log("error submit!!");
......
......@@ -56,303 +56,5 @@ export default {
}
}
},
// 最小重量 【重量可以为空为0 && 最小/大重量的范围0~34KG】允许保留1~5位小数。
validateMinWeight(name) {
if (/^(0|[1-9]\d*)(.\d{1,5})?$/.test(Number(this.queryForm[name]))) {
if (this.queryForm[name] && this.queryForm.maxWeight) {
if (Number(this.queryForm[name]) > Number(this.queryForm.maxWeight)) {
this.$refs.minWeight.innerHTML = "";
this.$refs.minWeight.innerHTML = "最小重量不得大于最大重量";
return false;
} else if (Number(this.queryForm[name]) > 34) {
this.$refs.minWeight.innerHTML = "";
this.$refs.minWeight.innerHTML = "最大重量34KG";
return false;
} else {
this.$refs.minWeight.innerHTML = "";
}
}
else if (Number(this.queryForm[name]) > 34) {
this.$refs.minWeight.innerHTML = "";
this.$refs.minWeight.innerHTML =
"最小重量大于0~34,并且最小重量不得大于最大重量";
return false;
} else {
this.$refs.minWeight.innerHTML = "";
}
} else {
this.$refs.minWeight.innerHTML = "";
this.$refs.minWeight.innerHTML = "请输入正整数,小数保留5位";
return false;
}
},
// 最大重量 【重量可以为空为0 && 最小/大重量的范围0~34KG】允许保留1~5位小数。
validateMaxWeight(name) {
if (/^(0|[1-9]\d*)(.\d{1,5})?$/.test(Number(this.queryForm[name]))) {
if (this.queryForm[name] && this.queryForm.minWeight) {
if (Number(this.queryForm[name]) < Number(this.queryForm.minWeight)) {
this.$refs.minWeight.innerHTML = "";
this.$refs.minWeight.innerHTML =
"最大重量大于0~34,并且最大重量不得小于最小重量";
return false;
} else {
this.$refs.minWeight.innerHTML = "";
}
if (Number(this.queryForm[name]) > 34) {
this.$refs.minWeight.innerHTML = "";
this.$refs.minWeight.innerHTML = "最大重量34KG";
return false;
}
}
else if (Number(this.queryForm[name]) > 34) {
this.$refs.minWeight.innerHTML = "";
this.$refs.minWeight.innerHTML =
"最大重量大于0~34,并且最大重量不得小于最小重量";
return false;
}
else {
this.$refs.minWeight.innerHTML = "";
}
} else {
this.$refs.minWeight.innerHTML = "";
this.$refs.minWeight.innerHTML = "请输入正整数,小数保留5位";
return false;
}
},
// 最小件数 【件数可以为空但件数不得为0】只能输入正整数
validateMinPieces(name) {
if (/^\d+$/.test(Number(this.queryForm[name]))) {
if (this.queryForm[name] && this.queryForm.maxNumOfPieces) {
if (
Number(this.queryForm[name]) > Number(this.queryForm.maxNumOfPieces)
) {
this.$refs.minNumOfPieces.innerHTML = "";
this.$refs.minNumOfPieces.innerHTML = "最小件数不得大于最大件数";
} else if (
Number(this.queryForm[name]) < 1 ||
Number(this.queryForm.maxNumOfPieces) < 1
) {
this.$refs.minNumOfPieces.innerHTML = "";
this.$refs.minNumOfPieces.innerHTML = "最小件数和最大件数不能小于1";
} else {
this.$refs.minNumOfPieces.innerHTML = "";
return true;
}
} else if (
this.queryForm[name] !== null &&
this.queryForm[name] !== ""
) {
if (Number(this.queryForm[name]) < 1) {
this.$refs.minNumOfPieces.innerHTML = "";
this.$refs.minNumOfPieces.innerHTML = "最小件数和最大件数不能小于1";
} else if (Number(this.queryForm[name]) > 100) {
this.$refs.minNumOfPieces.innerHTML = "";
this.$refs.minNumOfPieces.innerHTML =
"最小件数和最大件数不能大于100";
} else {
this.$refs.minNumOfPieces.innerHTML = "";
return true;
}
} else {
this.$refs.minNumOfPieces.innerHTML = "";
}
} else {
this.$refs.minNumOfPieces.innerHTML = "";
this.$refs.minNumOfPieces.innerHTML = "请输入有效件数";
return false;
}
},
// 最大件数【件数可以为空但件数不得为0】只能输入正整数
validateMaxPieces(name) {
if (/^\d+$/.test(Number(this.queryForm[name]))) {
if (this.queryForm[name] && this.queryForm.minNumOfPieces) {
if (
Number(this.queryForm[name]) < Number(this.queryForm.minNumOfPieces)
) {
this.$refs.minNumOfPieces.innerHTML = "";
this.$refs.minNumOfPieces.innerHTML = "最大件数不得小于最小件数";
} else if (
Number(this.queryForm[name]) < 1 ||
Number(this.queryForm.minNumOfPieces) < 1
) {
this.$refs.minNumOfPieces.innerHTML = "";
this.$refs.minNumOfPieces.innerHTML = "最小件数和最大件数不能小于1";
return false;
} else {
this.$refs.minNumOfPieces.innerHTML = "";
return true;
}
} else if (
this.queryForm[name] !== null &&
this.queryForm[name] !== ""
) {
if (Number(this.queryForm[name]) < 1) {
this.$refs.minNumOfPieces.innerHTML = "";
this.$refs.minNumOfPieces.innerHTML = "最小件数和最大件数不能小于1";
} else if (Number(this.queryForm[name]) > 100) {
this.$refs.minNumOfPieces.innerHTML = "";
this.$refs.minNumOfPieces.innerHTML =
"最小件数和最大件数不能大于100";
} else {
this.$refs.minNumOfPieces.innerHTML = "";
return true;
}
} else {
this.$refs.minNumOfPieces.innerHTML = "";
}
} else {
this.$refs.minNumOfPieces.innerHTML = "";
this.$refs.minNumOfPieces.innerHTML = "请输入有效件数";
return false;
}
},
// 最小申报价值【申报价值可以为空为0】
validateMinCustomVal(name) {
// 申报价值
let value =
this.queryForm.minCNYCustomVal || this.queryForm.minSUDCustomVal;
let regexp = /^(0|[1-9]\d*)(.\d{1,2})?$/.test(Number(value));
if (regexp) {
if (name == "USD" || name == "美元") {
// 申报价值(美元)0~600
if (
this.queryForm.minSUDCustomVal &&
this.queryForm.maxSUDCustomVal
) {
if (
Number(this.queryForm.minSUDCustomVal) >
Number(this.queryForm.maxSUDCustomVal)
) {
this.$refs.minSUDCustomVal.innerHTML =
"最小申报价值不得大于最大申报价值";
return false;
} else {
this.$refs.minSUDCustomVal.innerHTML = "";
}
if (Number(this.queryForm.minSUDCustomVal) > 600) {
this.$refs.minSUDCustomVal.innerHTML = "";
this.$refs.minSUDCustomVal.innerHTML = "最大申报值不得大于600";
return false;
}
}
else if (Number(this.queryForm.minSUDCustomVal) > 600) {
this.$refs.minSUDCustomVal.innerHTML = "";
this.$refs.minSUDCustomVal.innerHTML = "最大申报值不得大于600";
return false;
} else {
this.$refs.minSUDCustomVal.innerHTML = "";
return true;
}
} else {
// 申报价值(人民币)0~2000
if (
this.queryForm.minCNYCustomVal &&
this.queryForm.maxCNYCustomVal
) {
if (
Number(this.queryForm.minCNYCustomVal) >
Number(this.queryForm.maxCNYCustomVal)
) {
this.$refs.minCNYCustomVal.innerHTML =
"最小申报价值不得大于最大申报价值";
return false;
} else {
this.$refs.minCNYCustomVal.innerHTML = "";
}
if (Number(this.queryForm.minCNYCustomVal) > 2000) {
this.$refs.minCNYCustomVal.innerHTML = "";
this.$refs.minCNYCustomVal.innerHTML = "最大申报值不得大于2000";
return false;
}
}
else if (Number(this.queryForm.minCNYCustomVal) > 2000) {
this.$refs.minCNYCustomVal.innerHTML = "";
this.$refs.minCNYCustomVal.innerHTML = "最大申报值不得大于2000";
return false;
} else {
this.$refs.minCNYCustomVal.innerHTML = "";
return true;
}
}
} else {
this.$refs.minCNYCustomVal.innerHTML = "";
this.$refs.minCNYCustomVal.innerHTML = "请输入正确申报价值";
return false;
}
},
// 最大申报价值【申报价值可以为空为0】
validateMaxCustomVal(name) {
let value =
this.queryForm.maxCNYCustomVal || this.queryForm.maxSUDCustomVal;
let regexp = /^(0|[1-9]\d*)(.\d{1,2})?$/.test(Number(value));
if (regexp) {
if (name == "USD" || name == "美元") { // 申报价值(美元)0~600
if (
this.queryForm.minSUDCustomVal &&
this.queryForm.maxSUDCustomVal
) {
if (
Number(this.queryForm.minSUDCustomVal) >
Number(this.queryForm.maxSUDCustomVal)
) {
this.$refs.minSUDCustomVal.innerHTML =
"最小申报价值不得大于最大申报价值";
return false;
} else {
this.$refs.minSUDCustomVal.innerHTML = "";
}
if (Number(this.queryForm.maxSUDCustomVal) > 600) {
this.$refs.minSUDCustomVal.innerHTML = "";
this.$refs.minSUDCustomVal.innerHTML = "最大申报值不得大于600";
return false;
}
}
else if (Number(this.queryForm.maxSUDCustomVal) > 600) {
this.$refs.minSUDCustomVal.innerHTML = "";
this.$refs.minSUDCustomVal.innerHTML = "最大申报值不得大于600";
return false;
} else {
this.$refs.minSUDCustomVal.innerHTML = "";
return true;
}
} else {
// 申报价值(人民币)0~2000
if (
this.queryForm.minCNYCustomVal &&
this.queryForm.maxCNYCustomVal
) {
if (
Number(this.queryForm.minCNYCustomVal) >
Number(this.queryForm.maxCNYCustomVal)
) {
this.$refs.minCNYCustomVal.innerHTML =
"最小申报价值不得大于最大申报价值";
return false;
} else {
this.$refs.minCNYCustomVal.innerHTML = "";
}
if (Number(this.queryForm.maxCNYCustomVal) > 2000) {
this.$refs.minCNYCustomVal.innerHTML = "";
this.$refs.minCNYCustomVal.innerHTML = "最大申报值不得大于2000";
return false;
}
}
else if (Number(this.queryForm.maxCNYCustomVal) > 2000) {
this.$refs.minCNYCustomVal.innerHTML = "";
this.$refs.minCNYCustomVal.innerHTML = "最大申报值不得大于2000";
return false;
} else {
this.$refs.minCNYCustomVal.innerHTML = "";
return true;
}
}
} else {
this.$refs.minCNYCustomVal.innerHTML = "";
this.$refs.maxCNYCustomVal.innerHTML = "请输入正确申报价值";
return false;
}
},
},
};
......
......@@ -106,7 +106,7 @@ export default {
}
},
mounted() {
// this.tableHeight = window.innerHeight - this.$refs.flightAllocForm.$el.offsetHeight - 200;
this.tableHeight = window.innerHeight - this.$refs.flightAllocForm.$el.offsetHeight - 200;
},
activated() {
this.getList()
......
......@@ -150,14 +150,19 @@
<el-col :span="10">
<el-input class="numberInput" v-model.trim="val.minNumOfPieces"
oninput="value=value.replace(/[^\d\.\-]/g,'')" @change="change"
@input="change($event)">
@input="change($event)"
@blur="inputBlurMinPieces($event)"
>
</el-input>
<span ref="minNumOfPieces" class="el-form-item__error"></span>
</el-col>
<el-col style="text-align: center" :span="1">-</el-col>
<el-col :span="10">
<el-input class="numberInput" v-model.trim="val.maxNumOfPieces"
oninput="value=value.replace(/[^\d\.\-]/g,'')" @change="change"
@input="change($event)">
@input="change($event)"
@blur="inputBlurMaxPieces($event)"
>
</el-input>
</el-col>
</el-form-item>
......@@ -167,14 +172,19 @@
<el-col :span="10">
<el-input class="numberInput" v-model.trim="val.minWeight"
oninput="value=value.replace(/[^\d\.\-]/g,'')" @change="change"
@input="change($event)">
@input="change($event)"
@blur="inputBlurMinWeight($event)"
>
</el-input>
<span ref="minWeight" class="el-form-item__error"></span>
</el-col>
<el-col style="text-align: center" :span="1">-</el-col>
<el-col :span="10">
<el-input class="numberInput" v-model.trim="val.maxWeight"
oninput="value=value.replace(/[^\d\.\-]/g,'')" @change="change"
@input="change($event)">
@input="change($event)"
@blur="inputBlurMaxWeight($event)"
>
</el-input>
</el-col>
</el-form-item>
......@@ -409,14 +419,19 @@
<el-col :span="10">
<el-input class="numberInput" v-model.trim="val.minNumOfPieces"
oninput="value=value.replace(/[^\d\.\-]/g,'')" @change="change"
@input="change($event)">
@input="change($event)"
@blur="inputBlurMinPieces($event)"
>
</el-input>
<span ref="minNumOfPieces" class="el-form-item__error"></span>
</el-col>
<el-col style="text-align: center" :span="1">-</el-col>
<el-col :span="10">
<el-input class="numberInput" v-model.trim="val.maxNumOfPieces"
oninput="value=value.replace(/[^\d\.\-]/g,'')" @change="change"
@input="change($event)">
@input="change($event)"
@blur="inputBlurMaxPieces($event)"
>
</el-input>
</el-col>
</el-form-item>
......@@ -426,14 +441,19 @@
<el-col :span="10">
<el-input class="numberInput" v-model.trim="val.minWeight"
oninput="value=value.replace(/[^\d\.\-]/g,'')" @change="change"
@input="change($event)">
@input="change($event)"
@blur="inputBlurMinWeight($event)"
>
</el-input>
<span ref="minWeight" class="el-form-item__error"></span>
</el-col>
<el-col style="text-align: center" :span="1">-</el-col>
<el-col :span="10">
<el-input class="numberInput" v-model.trim="val.maxWeight"
oninput="value=value.replace(/[^\d\.\-]/g,'')" @change="change"
@input="change($event)">
@input="change($event)"
@blur="inputBlurMaxWeight($event)"
>
</el-input>
</el-col>
</el-form-item>
......@@ -584,9 +604,10 @@ import {
findByFlightId,
queryRouteByFltNo
} from "@/api/destinationFlight";
import { inputBlurValidate } from "@/utils/mixins";
export default {
name: 'FlightAllocConfigInfo',
mixins: [inputBlurValidate],
data() {
return {
infoForm: {
......@@ -623,7 +644,6 @@ export default {
}
},
created() {
// console.log(this.$route.params)
this.dictData()
this.status = this.$route.params.handle
this.$route.params.handle === 'detail' ? this.disabled = true : this.disabled = false
......@@ -738,7 +758,6 @@ export default {
this.infoForm.fltDate = res.data.list.ruleDate
this.infoForm.route = res.data.list.flightRoute
this.infoForm.list.push(this.dataHandle(res.data.list))
console.log('A:', this.infoForm.list)
} else {
this.isEmpty = true
}
......@@ -778,7 +797,6 @@ export default {
res.data.list.forEach(item => {
this.infoForm.list.push(this.dataHandle(item))
})
console.log('B:', this.infoForm.list)
} else {
//航班类型为Purple Tail则显示所有航线维度
this.routeList.forEach(route => {
......@@ -800,7 +818,6 @@ export default {
})
}
})
console.log('C:', this.infoForm.list)
}
} else {
//航线为空,对应航班或航班+日期下的全部维度(需补全未创建维度)
......@@ -823,7 +840,6 @@ export default {
})
}
})
console.log('D:', this.infoForm.list)
}
} else {
//未请求到数据
......@@ -851,7 +867,6 @@ export default {
})
this.infoForm.list.push(this.dataHandle(item))
})
console.log('E:', this.infoForm.list)
} else {
//航班类型Purple Tail展示全部航线维度
let routesStatus = 1
......@@ -875,7 +890,6 @@ export default {
})
}
})
console.log('F:', this.infoForm.list)
}
} else {
//未查询到,插入占位基础数据使用户新建
......@@ -891,7 +905,6 @@ export default {
})
}
})
console.log('G:', this.infoForm.list)
} else {
//航班类型Purple Tail展示全部航线维度
// this.isEmpty = true
......@@ -903,7 +916,6 @@ export default {
routePriority: route.routePriority,
})
})
console.log('H:', this.infoForm.list)
}
}
}).catch(err => {
......@@ -946,7 +958,6 @@ export default {
})
}
})
console.log('I:', this.infoForm.list)
} else {
this.routeList.forEach((route) => {
this.infoForm.list.push({
......@@ -956,7 +967,6 @@ export default {
routePriority: route.routePriority,
})
})
console.log('J:', this.infoForm.list)
}
}).catch(err => {
this.isEmpty = true
......@@ -971,7 +981,6 @@ export default {
routePriority: route.routePriority,
})
})
console.log('K:', this.infoForm.list)
}
}
}
......@@ -1003,7 +1012,6 @@ export default {
routePriority: item.ordinal
})
})
console.log('L:', this.infoForm.list)
} else {
this.msgWarning('未查询到航线信息!')
this.routeList = []
......@@ -1026,7 +1034,7 @@ export default {
this.msgWarning('件数前区间不能大于后区间')
} else if (new Number(data.minWeight) > new Number(data.maxWeight)) {
this.msgWarning('重量前区间不能大于后区间')
} else if (data.handlingCode == '' && data.serviceCode == '' && data.subCategory == '' && data.typeOfGoods == '' && data.puporpuxCode == '' && (!data.location || data.location == '') && data.notLocation == '' && (data.includeUrsa == null || data.includeUrsa == '') && (data.notIncludeUrsa == null || data.notIncludeUrsa == '') && (!data.minNumOfPieces || data.minNumOfPieces == '') && (!data.maxNumOfPieces || data.maxNumOfPieces == '') && (!data.minWeight || data.minWeight == '') && (!data.maxWeight || data.maxWeight == '') && (data.destinationSite == null || destinationSite == '') && (data.notDestinationSite == null || data.notDestinationSite == '')) {
} else if (data.handlingCode == '' && data.serviceCode == '' && data.subCategory == '' && data.typeOfGoods == '' && data.puporpuxCode == '' && (!data.location || data.location == '') && data.notLocation == '' && (!data.destinationSite || data.destinationSite == '') && data.notDestinationSite && (data.includeUrsa == null || data.includeUrsa == '') && (data.notIncludeUrsa == null || data.notIncludeUrsa == '') && (!data.minNumOfPieces || data.minNumOfPieces == '') && (!data.maxNumOfPieces || data.maxNumOfPieces == '') && (!data.minWeight || data.minWeight == '') && (!data.maxWeight || data.maxWeight == '')) {
this.msgWarning('未添加规则信息,请添加后再保存!')
} else {
// this.loading = true
......
......@@ -249,7 +249,7 @@ export default {
}
},
mounted() {
// this.tableHeight = window.innerHeight - this.$refs.queryForm.$el.offsetHeight - 200;
this.tableHeight = window.innerHeight - this.$refs.queryForm.$el.offsetHeight - 200;
},
activated() {
this.findSourceFlightRules();
......
......@@ -113,7 +113,7 @@ export default {
}
},
mounted() {
// this.tableHeight = window.innerHeight - this.$refs.preReviewOptions.offsetHeight - 300;
this.tableHeight = window.innerHeight - this.$refs.preReviewOptions.offsetHeight - 300;
},
methods: {
//搜索
......
......@@ -502,7 +502,7 @@ export default {
this.shiftKey = false;
}
});
// this.tableHeight = window.innerHeight - this.$refs.queryForm.$el.offsetHeight - 120;
this.tableHeight = window.innerHeight - this.$refs.queryForm.$el.offsetHeight - 120;
},
methods: {
//输入航班号后
......
......@@ -92,7 +92,7 @@ export default {
},
mounted() {
// this.tableHeight = window.innerHeight - this.$refs.goodsStation.$el.offsetHeight - 200;
this.tableHeight = window.innerHeight - this.$refs.goodsStation.$el.offsetHeight - 200;
this.selection(1)
},
watch: {
......
......@@ -92,7 +92,7 @@ export default {
},
mounted() {
// this.tableHeight = window.innerHeight - this.$refs.goodsStation.$el.offsetHeight - 200;
this.tableHeight = window.innerHeight - this.$refs.goodsStation.$el.offsetHeight - 200;
this.selection(1)
},
watch: {
......
......@@ -73,7 +73,7 @@ export default {
created() {
},
mounted() {
// this.tableHeight = window.innerHeight - this.$refs.goodsStationFlight.$el.offsetHeight - 200;
this.tableHeight = window.innerHeight - this.$refs.goodsStationFlight.$el.offsetHeight - 200;
this.selection(1)
},
watch: {
......
......@@ -441,7 +441,7 @@ export default {
this.shiftKey = false;
}
});
// this.tableHeight = window.innerHeight - this.$refs.cargoForm.$el.offsetHeight - 50
this.tableHeight = window.innerHeight - this.$refs.cargoForm.$el.offsetHeight - 50
},
watch: {
$route: {
......@@ -489,7 +489,7 @@ export default {
}
},
formShow(val, oldVal) {
// this.tableHeight = window.innerHeight - this.$refs.cargoForm.$el.offsetHeight - 120
this.tableHeight = window.innerHeight - this.$refs.cargoForm.$el.offsetHeight - 120
},
},
methods: {
......
......@@ -109,7 +109,7 @@ export default {
// this.getFlight()
// },
mounted() {
// this.tableHeight = window.innerHeight - this.$refs.card1.$el.offsetHeight - this.$refs.indexForm.$el.offsetHeight - 350
this.tableHeight = window.innerHeight - this.$refs.card1.$el.offsetHeight - this.$refs.indexForm.$el.offsetHeight - 350
this.getFlight()
},
methods: {
......
......@@ -99,7 +99,7 @@ export default {
created() {
},
mounted() {
// this.tableHeight = window.innerHeight - this.$refs.selectForm.$el.offsetHeight - 170;
this.tableHeight = window.innerHeight - this.$refs.selectForm.$el.offsetHeight - 170;
this.selection(1)
},
activated() {
......
......@@ -139,7 +139,7 @@ export default {
this.selectOptionData()
},
mounted() {
// this.tableHeight = window.innerHeight - this.$refs.preMdeSelectForm.$el.offsetHeight - 150;
this.tableHeight = window.innerHeight - this.$refs.preMdeSelectForm.$el.offsetHeight - 150;
this.select(0)
},
watch: {
......
......@@ -100,7 +100,7 @@ export default {
created() {
},
mounted() {
// this.tableHeight = window.innerHeight - this.$refs.selectForm.$el.offsetHeight - 170;
this.tableHeight = window.innerHeight - this.$refs.selectForm.$el.offsetHeight - 170;
this.selection(1)
},
activated() {
......
......@@ -3,7 +3,7 @@
<el-card style="margin-bottom:10px">
<!-- cardHeader -->
<div slot="header" class="clearfix">
<span style="font-size:16px;font-weight:700">{{ (tableName == '航线' ? '航线' : tableName == 'Site' ? '始发站' :
<span style="font-size:16px;font-weight:700">{{ (tableName == '航线' ? '航线' : tableName == 'Site' ? '站点' :
tableName ==
'虚拟航班' ? '虚拟航班' : tableName.replace(/( |^)[a-z]/g, L => L.toUpperCase())) + "表"
}}</span>
......@@ -220,7 +220,7 @@ export default {
// }
},
mounted() {
// this.tableHeight = window.innerHeight - this.$refs.dictForm.$el.offsetHeight - 270
this.tableHeight = window.innerHeight - this.$refs.dictForm.$el.offsetHeight - 270
},
filters: {
// 是否为ET86航线
......
......@@ -86,7 +86,7 @@ export default {
}
},
mounted() {
// this.tableHeight = window.innerHeight - this.$refs.selectionRoleForm.$el.offsetHeight - 250
this.tableHeight = window.innerHeight - this.$refs.selectionRoleForm.$el.offsetHeight - 250
},
activated() {
this.selectRoleList();
......
......@@ -80,7 +80,7 @@ export default {
created() {
},
mounted() {
// this.tableHeight = window.innerHeight - this.$refs.supserAllocation.$el.offsetHeight - 250
this.tableHeight = window.innerHeight - this.$refs.supserAllocation.$el.offsetHeight - 250
this.selection(1)
},
methods: {
......
......@@ -113,7 +113,7 @@ export default {
}
},
mounted() {
// this.tableHeight = window.innerHeight - this.$refs.selectionUserForm.$el.offsetHeight - 250;
this.tableHeight = window.innerHeight - this.$refs.selectionUserForm.$el.offsetHeight - 250;
},
activated() {
this.selectUser();
......
......@@ -64,7 +64,7 @@ export default {
this.selectLog()
},
mounted() {
// this.tableHeight = window.innerHeight - this.$refs.archiveDataForm.$el.offsetHeight - 200
this.tableHeight = window.innerHeight - this.$refs.archiveDataForm.$el.offsetHeight - 200
},
methods: {
selectLog(val) {
......
......@@ -130,7 +130,7 @@ export default {
this.data = [];
},
mounted() {
// this.tableHeight = window.innerHeight - this.$refs.dmLogForm.$el.offsetHeight - 130;
this.tableHeight = window.innerHeight - this.$refs.dmLogForm.$el.offsetHeight - 130;
},
methods: {
//数据查询
......
......@@ -109,7 +109,7 @@ export default {
this.selectLog();
},
mounted() {
// this.tableHeight = window.innerHeight - this.$refs.operationLogForm.$el.offsetHeight - 240
this.tableHeight = window.innerHeight - this.$refs.operationLogForm.$el.offsetHeight - 240
},
methods: {
getModule() {
......