Elements-SY

modify

......@@ -33,6 +33,9 @@ export const inputBlurValidate = {
) {
this.validateForm = true;
this.$refs.minWeight.innerHTML = "";
} else {
this.validateForm = false;
this.$refs.minWeight.innerHTML = "请输入有效重量,小数保留5位";
}
}
// 最小重量有值的情况下
......@@ -62,6 +65,15 @@ export const inputBlurValidate = {
this.validateForm = false;
this.$refs.minWeight.innerHTML = "请输入有效重量,小数保留5位";
}
} else {
if (target.value && isNaN(target.value)) {
this.validateForm = false;
this.$refs.minWeight.innerHTML = "请输入有效重量,小数保留5位";
}
if (Number(target.value) < 0) {
this.validateForm = false;
this.$refs.minWeight.innerHTML = "请输入有效重量,小数保留5位";
}
}
},
// 最大重量失焦事件
......@@ -110,8 +122,31 @@ export const inputBlurValidate = {
this.validateForm = false;
this.$refs.minWeight.innerHTML = "请输入有效重量,小数保留5位";
}
} else {
if (target.value && isNaN(target.value)) {
this.validateForm = false;
this.$refs.minWeight.innerHTML = "请输入有效重量,小数保留5位";
}
if (Number(target.value) < 0) {
this.validateForm = false;
this.$refs.minWeight.innerHTML = "请输入有效重量,小数保留5位";
}
}
},
validateNumber(number) {
// 首先检查是否为合法数字
if (isNaN(number)) {
return "请输入有效数字";
}
// 然后检查是否大于0
if (number <= 0) {
return "请输入大于0的数字";
}
// 如果通过了以上两个条件,则表示数字合法
return "数字合法";
},
// 人民币最小申报价值
inputCNYBlurMin({ target }, customVal) {
// 申报价值最小值和最大值都为空的情况下
......@@ -163,6 +198,17 @@ export const inputBlurValidate = {
this.$refs.minCNYCustomVal.innerHTML =
"请输入有效申报价值,小数保留2位";
}
} else {
if (target.value && isNaN(target.value)) {
this.validateForm = false;
this.$refs.minCNYCustomVal.innerHTML =
"请输入有效申报价值,小数保留2位";
}
if (Number(target.value) < 0) {
this.validateForm = false;
this.$refs.minCNYCustomVal.innerHTML =
"请输入有效申报价值,小数保留2位";
}
}
},
// 人民币最大申报价值
......@@ -217,6 +263,17 @@ export const inputBlurValidate = {
this.$refs.minCNYCustomVal.innerHTML =
"请输入有效申报价值,小数保留2位";
}
} else {
if (target.value && isNaN(target.value)) {
this.validateForm = false;
this.$refs.minCNYCustomVal.innerHTML =
"请输入有效申报价值,小数保留2位";
}
if (Number(target.value) < 0) {
this.validateForm = false;
this.$refs.minCNYCustomVal.innerHTML =
"请输入有效申报价值,小数保留2位";
}
}
},
// 美元最小申报价值
......@@ -272,6 +329,17 @@ export const inputBlurValidate = {
this.$refs.minSUDCustomVal.innerHTML =
"请输入有效申报价值,小数保留2位";
}
} else {
if (target.value && isNaN(target.value)) {
this.validateForm = false;
this.$refs.minSUDCustomVal.innerHTML =
"请输入有效申报价值,小数保留2位";
}
if (Number(target.value) < 0) {
this.validateForm = false;
this.$refs.minSUDCustomVal.innerHTML =
"请输入有效申报价值,小数保留2位";
}
}
},
// 美元最大申报价值
......@@ -328,6 +396,17 @@ export const inputBlurValidate = {
this.$refs.minSUDCustomVal.innerHTML =
"请输入有效申报价值,小数保留2位";
}
} else {
if (target.value && isNaN(target.value)) {
this.validateForm = false;
this.$refs.minSUDCustomVal.innerHTML =
"请输入有效申报价值,小数保留2位";
}
if (Number(target.value) < 0) {
this.validateForm = false;
this.$refs.minSUDCustomVal.innerHTML =
"请输入有效申报价值,小数保留2位";
}
}
},
// 校验件数方法 【件数可以为空但件数不得为0】只能输入正整数
......
......@@ -139,7 +139,7 @@
type="textarea"
v-model="item.includeUrsa"
:rows="4"
placeholder="URSA之间用分号分隔,例:F1_;F2_;F3_;P_"
placeholder="URSA之间用分号分隔,例:F1_;F2_;F3_"
>
</el-input>
</el-form-item>
......@@ -151,7 +151,7 @@
type="textarea"
v-model="item.notIncludeUrsa"
:rows="4"
placeholder="URSA之间用分号分隔,例:F1;F2;F3;P"
placeholder="URSA之间用分号分隔,例:F1;F2;F3"
>
</el-input>
</el-form-item>
......
......@@ -164,7 +164,6 @@ export default {
// 保存 【新增/修改航线规则设置】
saveSubmit(item, index) {
item.flightRoute = item.route || item.flightRoute;
item.ruleDate = item.ruleDate || this.queryForm.flightDate;
let parmas = JSON.parse(JSON.stringify(item));
this.returnString(parmas, "cargoType");
this.returnString(parmas, "typeOfGoods");
......@@ -204,6 +203,7 @@ export default {
let validate = validateForm.some((key) => parmas[key]);
if (validate) {
this.loading = true;
parmas.ruleDate = item.ruleDate || this.queryForm.flightDate;
updateOrAddFlight(parmas)
.then((res) => {
const { code, msg, data } = res;
......
......@@ -2,7 +2,7 @@ export const tableAttr = {
border: true,
loadingTable: false,
isDragSort: false, // 拖拽tableData数据一定要加id字段
maxHeight: 300,
maxHeight: 800,
btnCofig: {
isBtn: false,
btnGroup: [],
......
......@@ -225,7 +225,7 @@
maxlength="1000"
show-word-limit
:rows="4"
placeholder="URSA之间用分号分隔,例:F1_;F2_;F3_;P_"
placeholder="URSA之间用分号分隔,例:P_;W_;A_"
:disabled="!getRouter"
@blur="includeUrsa"
></el-input>
......@@ -254,7 +254,7 @@
maxlength="1000"
show-word-limit
:rows="4"
placeholder="URSA之间用分号分隔,例:F1;F2;F3;P"
placeholder="URSA之间用分号分隔,例:F1;F2;F3"
:disabled="!getRouter"
@blur="notIncludeUrsa"
></el-input>
......@@ -307,7 +307,7 @@
<el-col :span="10">
<el-input
v-model.trim="queryForm.minNumOfPieces"
placeholder="最件数"
placeholder="最件数"
@blur="inputBlurMinPieces($event)"
:disabled="!getRouter"
></el-input>
......@@ -317,7 +317,7 @@
<el-col :span="10">
<el-input
v-model.trim="queryForm.maxNumOfPieces"
placeholder="最件数"
placeholder="最件数"
@blur="inputBlurMaxPieces($event)"
:disabled="!getRouter"
></el-input>
......@@ -422,7 +422,7 @@
<script>
import YlForm from "@/components/YlForm";
import YlTable from "@/components/YlTable";
import YlElInputNumber from "../components/input-number"
import YlElInputNumber from "../components/input-number";
import { inputBlurValidate } from "@/utils/mixins";
import { tableAttr } from "./tableConfig";
import {
......@@ -440,7 +440,7 @@ export default {
components: {
YlForm,
YlTable,
YlElInputNumber
YlElInputNumber,
},
mixins: [indexMixins, inputBlurValidate],
data() {
......@@ -486,11 +486,9 @@ export default {
computed: {
// 获取路由参数
getRouter() {
if (this.$route.query.name == "add") {
if (this.$route.query.name == "add" || this.$route.query.name == "edit") {
return "保存";
} else if (this.$route.query.name == "edit") {
return "修改";
} else {
}else {
return false;
}
},
......@@ -646,6 +644,7 @@ export default {
this.tableData[this.currentIndex].flightRoute = "";
}
}
this.tableData[this.currentIndex].flightRoute = "";
})
.catch(() => {});
},
......
......@@ -132,7 +132,7 @@ export default {
this.ursaError = "填写的URSA已重复";
}
if (ursaMark && !ursaInfo.inUrsa) {
this.ursaError = "URSA包含之间用分号分隔,例:P2_;P3_;P_";
this.ursaError = "URSA包含之间用分号分隔,例:P_;W_;A_";
}
if (ursaMark && !ursaInfo.repeat && ursaInfo.inUrsa) {
this.ursaError = "";
......@@ -142,7 +142,7 @@ export default {
this.notUrsaError = "填写的URSA已重复";
}
if (!ursaMark && !ursaInfo.inUrsa) {
this.notUrsaError = "URSA不包含之间用分号分隔,例:P2;P3;P";
this.notUrsaError = "URSA不包含之间用分号分隔,例:F1;F2;F3";
}
if (!ursaMark && !ursaInfo.repeat && ursaInfo.inUrsa) {
this.notUrsaError = "";
......