Elements-SY

modify

......@@ -7,7 +7,7 @@ export const inputBlurValidate = {
minNumOfPieces: "",
maxNumOfPieces: "",
},
validateForm: true,
validateForm: true, // form表单节流阀
};
},
methods: {
......
......@@ -237,6 +237,7 @@
:disabled="!getRouter"
@blur="includeUrsa"
></el-input>
<span v-text="ursaError" class="el-form-item__error"></span>
</el-form-item>
</el-col>
<el-col :span="14">
......@@ -265,6 +266,7 @@
:disabled="!getRouter"
@blur="notIncludeUrsa"
></el-input>
<span class="el-form-item__error" v-text="notUrsaError" style="width: 50%; margin-left: 28%"></span>
</el-col>
</el-form-item>
</el-col>
......@@ -467,7 +469,7 @@ export default {
minCustomVal: "", // 人民币最小申报值
maxCustomVal: "", // 人民币最大申报值
minUsdCustomVal: "", // 美元最小申报值
maxUsdCustomVal: "" // 美元最大申报值
maxUsdCustomVal: "", // 美元最大申报值
},
tableAttr: tableAttr, // table配置项
tableData: [], // ET86配舱航班顺位
......@@ -499,10 +501,10 @@ export default {
},
created() {
this.getAllDictData(); // 获取全部字典
if (this.$route.query.name == "view"){
tableAttr.isDragSort = false;
}else{
tableAttr.isDragSort = true;
if (this.$route.query.name == "view") {
tableAttr.isDragSort = false;
} else {
tableAttr.isDragSort = true;
}
if (this.$route.query.name == "view" || this.$route.query.name == "edit") {
this.queryFindEtesRuleById(this.$route.query); // ET86详情
......@@ -581,11 +583,11 @@ export default {
this.checkboxClassType = [];
}
// 服务种类
if(data.list.fltRuleDto.includeServiceType){
if (data.list.fltRuleDto.includeServiceType) {
this.isServiceCode = "1";
}else if(data.list.fltRuleDto.notIncludeServiceType){
} else if (data.list.fltRuleDto.notIncludeServiceType) {
this.isServiceCode = "2";
}else{
} else {
this.isServiceCode = "1";
}
this.queryForm = data.list.fltRuleDto; // ET86配舱航班顺位维度
......@@ -731,9 +733,9 @@ export default {
submitForm(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
this.tableData.map((item,i)=>{
item.priority = ++i
})
this.tableData.map((item, i) => {
item.priority = ++i;
});
// 爆仓是否继续配舱
const newtTableData = JSON.parse(JSON.stringify(this.tableData));
const tableData = newtTableData;
......@@ -762,9 +764,9 @@ export default {
return;
}
// 服务种类包含不包含二选一
if(this.isServiceCode == "1"){
if (this.isServiceCode == "1") {
this.queryForm.notIncludeServiceType = "";
}else{
} else {
this.queryForm.includeServiceType = "";
}
let parmas = {
......
import { debounce } from "@/utils";
export default {
data() {
return {
ursaError: "", // URSA包含校验提示语
notUrsaError: "", // URSA包含校验提示语
validateForm: true, // form表单节流阀
};
},
directives: {
// 处理加减天数
"input-filter": {
......@@ -105,29 +112,54 @@ export default {
},
// 不包含
includeUrsa() {
let inUrsa = this.queryForm.includeUrsa.split(";");
// 校验开头以字母开头下划线结尾的
// let _inUrsa = inUrsa.every((item) => {
// if (item) {
// return /^[a-zA-Z]*_$/.test(item);
// }
// });
// console.log(_inUrsa);
// function hasDuplicate(arr) {
// return new Set(arr).size !== arr.length;
// }
/*
使用JavaScript写一个只能开头以字母开头下划线和分号结尾的正则表达式;
使用JavaScript写一个判断数组中有重复的字符返回true,
*/
// 要有下划线且不能出现重复的
// console.log(this.queryForm.includeUrsa.split(";"));
// 分隔字符串并且转数组&去除数组空字符串
let inUrsa = this.queryForm.includeUrsa
.split(";")
.filter((str) => str !== "");
let repeat = new Set(inUrsa).size !== inUrsa.length;
if (repeat) {
this.ursaError = "填写的Ursa已重复";
this.validateForm = false;
this.msgError("填写的Ursa已重复");
} else {
this.ursaError = "";
this.validateForm = true;
}
// 校验开头以字母开头下划线结尾的/^[a-zA-Z]*;$/
let _inUrsa = inUrsa.every((item) => /^[a-zA-Z][0-9]*_$/.test(item));
if (!_inUrsa) {
this.ursaError = "Ursa包含之间用分号分隔,例:P2_;P3_;P_";
this.validateForm = false;
}
if (!repeat && _inUrsa) {
this.ursaError = "";
this.validateForm = true;
}
},
// 不包含
notIncludeUrsa() {
// 不要有下划线且不能出现重复的
// 分隔字符串并且转数组&去除数组空字符串
let inUrsa = this.queryForm.notIncludeUrsa
.split(";")
.filter((str) => str !== "");
let repeat = new Set(inUrsa).size !== inUrsa.length;
if (repeat) {
this.notUrsaError = "填写的Ursa已重复";
this.validateForm = false;
} else {
this.notUrsaError = "";
this.validateForm = true;
}
// 校验开头以字母开头的/^[a-zA-Z]*;$/
let _inUrsa = inUrsa.every((item) => /^[a-zA-Z][0-9]*$/.test(item));
if (!_inUrsa) {
this.notUrsaError = "Ursa不包含之间用分号分隔,例:P2;P3;P";
this.validateForm = false;
}
if (!repeat && _inUrsa) {
this.notUrsaError = "";
this.validateForm = true;
}
},
},
};
......