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-19 13:50:06 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
8653715c156159b657b7900c2b46576af3ea3e14
8653715c
1 parent
831f7e9d
modify
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
68 additions
and
31 deletions
src/views/allocationConfig/flightAllocConfig/components/RouteInfo.vue
src/views/allocationConfig/flightAllocConfig/mixins/index.js
src/views/allocationConfig/flightAllocConfig/components/RouteInfo.vue
View file @
8653715
...
...
@@ -72,28 +72,34 @@
</el-radio-group>
</el-col>
<el-col :span="10">
<span style="width: 500px; display: block">
<el-input
v-if
="item.isLocation == '1'"
v-show
="item.isLocation == '1'"
:disabled="pageName || status"
type="textarea"
v-model="item.location"
:rows="4"
placeholder="始发站之间用回车符分隔"
style="width: 500px"
@blur="location({ index, item, $event })"
>
</el-input>
<el-input
v-else
v-show="item.isLocation == '2'"
:disabled="pageName || status"
type="textarea"
v-model="item.notLocation"
:rows="4"
placeholder="始发站之间用回车符分隔"
style="width: 500px"
@blur="notLocation({ index, item, $event })"
>
</el-input>
</span>
<div class="form-item-error-block">
<span
class="el-form-item__error"
v-text="item.locationError"
></span>
</div>
</el-col>
</el-form-item>
</el-col>
...
...
@@ -110,30 +116,36 @@
</el-radio-group>
</el-col>
<el-col :span="10">
<span style="width: 500px; display: block">
<el-input
v-if
="item.isDestinationSite == '1'"
v-show
="item.isDestinationSite == '1'"
:disabled="pageName || status"
type="textarea"
v-model="item.destinationSite"
:rows="4"
placeholder="目的站之间用回车符分隔"
style="width: 500px"
@blur="destinationSite({ index, item, $event })"
>
</el-input>
<el-input
v-else
v-show="item.isDestinationSite == '2'"
:disabled="pageName || status"
type="textarea"
v-model="item.notDestinationSite"
:rows="4"
placeholder="目的站之间用回车符分隔"
style="width: 500px"
@blur="
notDestinationSite({ index, item, $event })
"
>
</el-input>
</span>
<div class="form-item-error-block">
<span
class="el-form-item__error"
v-text="destinationSiteError"
></span>
</div>
</el-col>
</el-form-item>
</el-col>
...
...
@@ -149,6 +161,10 @@
@blur="includeUrsa({ index, item, $event })"
>
</el-input>
<span
class="el-form-item__error"
v-text="ursaError"
></span>
</el-form-item>
</el-col>
<el-col :span="10">
...
...
@@ -162,6 +178,12 @@
@blur="notIncludeUrsa({ index, item, $event })"
>
</el-input>
<div class="form-item-error-block">
<span
class="el-form-item__error"
v-text="notUrsaError"
></span>
</div>
</el-form-item>
</el-col>
</el-col>
...
...
src/views/allocationConfig/flightAllocConfig/mixins/index.js
View file @
8653715
...
...
@@ -12,6 +12,10 @@ export default {
queryForm
:
{
// 表单参数
},
locationError
:
"URSA包含"
,
// 始发站
destinationSiteError
:
""
,
// 目的站
ursaError
:
""
,
// URSA包含
notUrsaError
:
""
,
// URSA不包含
};
},
computed
:
{
...
...
@@ -766,47 +770,58 @@ export default {
blurEvent
({
originOfFlightNo
})
{
this
.
queryForm
.
originOfFlightNo
=
this
.
upCase
(
originOfFlightNo
);
},
validateLocation
({
isLocation
,
location
,
notLocation
})
{
let
locationVal
,
notLocationVal
,
repeat
,
validateLocation
,
validateNotlocation
;
// 校验目的地
validateLocation
(
index
,
{
isLocation
,
location
,
notLocation
,
isDestinationSite
,
destinationSite
,
notDestinationSite
,
}
)
{
let
locationVal
,
notLocationVal
,
repeat
,
validate
;
if
(
isLocation
==
"1"
)
{
// 分隔字符串并且转数组&去除数组空字符串
locationVal
=
location
.
split
(
";"
).
filter
((
str
)
=>
str
!==
""
);
// 是否有重复的
repeat
=
new
Set
(
locationVal
).
size
!==
locationVal
.
length
;
// 校验校验开头以字母或者数字开头的/^[a-zA-Z0-9]*$/
validateLocation
=
locationVal
.
every
((
item
)
=>
/^
[
a-zA-Z0-9
]
*$/
.
test
(
item
)
);
validate
=
locationVal
.
every
((
item
)
=>
/^
[
a-zA-Z0-9
]
*$/
.
test
(
item
));
}
else
{
notLocationVal
=
notLocation
.
split
(
";"
).
filter
((
str
)
=>
str
!==
""
);
repeat
=
new
Set
(
notLocationVal
).
size
!==
notLocationVal
.
length
;
validateNotlocation
=
locationVal
.
every
((
item
)
=>
/^
[
a-zA-Z0-9
]
*$/
.
test
(
item
)
);
validate
=
locationVal
.
every
((
item
)
=>
/^
[
a-zA-Z0-9
]
*$/
.
test
(
item
));
}
if
(
repeat
)
{
this
.
routesInfo
[
index
].
locationError
=
"填写的目的地已重复"
;
this
.
$set
(
this
.
routesInfo
,
index
,
this
.
routesInfo
[
index
]);
}
if
(
!
validate
)
{
this
.
routesInfo
[
index
].
locationError
=
"目的地之间用分号分隔,例:P1;P2;P3"
;
this
.
$set
(
this
.
routesInfo
,
index
,
this
.
routesInfo
[
index
]);
}
if
(
!
repeat
&&
validate
)
{
this
.
routesInfo
[
index
].
locationError
=
""
;
this
.
$set
(
this
.
routesInfo
,
index
,
this
.
routesInfo
[
index
]);
}
},
// 包含始发站失焦事件
locationBur
({
index
,
item
})
{
/*
对于单选框这种,不论是勾选哪一个两则都使用一个布尔值;
// 校验:只能字母和数组组合,不能有重复的,包含中不能有包含的
*/
// console.log(this.routesInfo);
// console.log("locationBur", index, item);
// 不为空的时候做校验
// if (item.location || item.notL
ocation) {
// this.validateLocation(
item);
//
}
if
(
item
.
l
ocation
)
{
this
.
validateLocation
(
index
,
item
);
}
},
// 不包含始发站失焦事件
notLocationBur
({
index
,
item
})
{
// console.log("notLocationBur", index, item);
if
(
item
.
notLocation
)
{
this
.
validateLocation
(
index
,
item
);
}
},
// 包含目的站失焦事件
destinationSiteBur
({
index
,
item
})
{
...
...
Please
register
or
login
to post a comment