Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Fedex
/
imac-vue
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
Elements-SY
2023-10-09 11:25:11 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
c9c5d02b7f5162e87b12abb0376621e9747d9850
c9c5d02b
1 parent
27d72cb5
modify
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
66 additions
and
32 deletions
src/utils/mixins.js
src/views/et86Config/et86RuleConfig/edit/index.vue
src/views/et86Config/et86RuleConfig/edit/mixins/index.js
src/utils/mixins.js
View file @
c9c5d02
...
...
@@ -7,7 +7,7 @@ export const inputBlurValidate = {
minNumOfPieces
:
""
,
maxNumOfPieces
:
""
,
},
validateForm
:
true
,
validateForm
:
true
,
// form表单节流阀
};
},
methods
:
{
...
...
src/views/et86Config/et86RuleConfig/edit/index.vue
View file @
c9c5d02
...
...
@@ -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,9 +501,9 @@ export default {
},
created() {
this.getAllDictData(); // 获取全部字典
if (this.$route.query.name == "view"){
if (this.$route.query.name == "view")
{
tableAttr.isDragSort = false;
}
else
{
}
else
{
tableAttr.isDragSort = true;
}
if (this.$route.query.name == "view" || this.$route.query.name == "edit") {
...
...
@@ -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 = {
...
...
src/views/et86Config/et86RuleConfig/edit/mixins/index.js
View file @
c9c5d02
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
;
}
},
},
};
...
...
Please
register
or
login
to post a comment