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 18:33:13 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
3041f72a77dcc667493dda3eecbedf47ca923788
3041f72a
1 parent
39b71ffa
modify
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
278 additions
and
82 deletions
src/utils/mixins.js
src/views/allocationConfig/flightAllocConfig/components/RouteInfo.vue
src/views/allocationConfig/flightAllocConfig/flightRouteInfo/index.vue
src/views/allocationConfig/flightAllocConfig/mixins/index.js
src/views/et86Config/et86RuleConfig/edit/index.vue
src/utils/mixins.js
View file @
3041f72
...
...
@@ -12,15 +12,17 @@ export const inputBlurValidate = {
},
methods
:
{
// 最小件数失焦事件
inputBlurMinPieces
({
target
})
{
this
.
validateNumOfPieces
(
target
.
value
,
"minNumOfPieces"
);
inputBlurMinPieces
({
index
,
queryForm
})
{
console
.
log
(
index
,
queryForm
);
// this.validateNumOfPieces(target.value, "minNumOfPieces");
},
// 最大件数失焦事件
inputBlurMaxPieces
({
target
})
{
this
.
validateNumOfPieces
(
target
.
value
,
"maxNumOfPieces"
);
inputBlurMaxPieces
({
index
,
item
=
queryForm
})
{
//
this.validateNumOfPieces(target.value, "maxNumOfPieces");
},
// 最小重量失焦事件
inputBlurMinWeight
({
target
})
{
inputBlurMinWeight
({
index
,
item
=
queryForm
})
{
return
;
// 重量最小值和最大值都为空的情况下
if
(
this
.
queryForm
.
minWeight
==
""
&&
this
.
queryForm
.
maxWeight
==
""
)
{
this
.
validateForm
=
true
;
...
...
@@ -77,7 +79,8 @@ export const inputBlurValidate = {
}
},
// 最大重量失焦事件
inputBlurMaxWeight
({
target
})
{
inputBlurMaxWeight
({
index
,
item
=
queryForm
})
{
return
;
// 重量最小值和最大值都为空的情况下
if
(
this
.
queryForm
.
minWeight
==
""
&&
this
.
queryForm
.
maxWeight
==
""
)
{
this
.
validateForm
=
true
;
...
...
@@ -148,7 +151,8 @@ export const inputBlurValidate = {
return
"数字合法"
;
},
// 人民币最小申报价值
inputCNYBlurMin
({
target
},
customVal
)
{
inputCNYBlurMin
({
index
,
item
=
queryForm
},
customVal
)
{
return
;
// 申报价值最小值和最大值都为空的情况下
if
(
this
.
queryForm
.
minCustomVal
==
""
&&
...
...
@@ -212,7 +216,8 @@ export const inputBlurValidate = {
}
},
// 人民币最大申报价值
inputCNYBlurMax
({
target
},
customVal
)
{
inputCNYBlurMax
({
index
,
item
=
queryForm
},
customVal
)
{
return
;
// 申报价值最小值和最大值都为空的情况下
if
(
this
.
queryForm
.
minCustomVal
==
""
&&
...
...
@@ -277,7 +282,8 @@ export const inputBlurValidate = {
}
},
// 美元最小申报价值
inputSUDBlurMin
({
target
},
customVal
)
{
inputSUDBlurMin
({
index
,
item
=
queryForm
},
customVal
)
{
return
;
// 申报价值最小值和最大值都为空的情况下
if
(
this
.
queryForm
.
minUsdCustomVal
==
""
&&
...
...
@@ -343,7 +349,8 @@ export const inputBlurValidate = {
}
},
// 美元最大申报价值
inputSUDBlurMax
({
target
},
customVal
)
{
inputSUDBlurMax
({
index
,
item
=
queryForm
},
customVal
)
{
return
;
// 申报价值最小值和最大值都为空的情况下
if
(
this
.
queryForm
.
minUsdCustomVal
==
""
&&
...
...
@@ -410,7 +417,8 @@ export const inputBlurValidate = {
}
},
// 校验件数方法 【件数可以为空但件数不得为0】只能输入正整数
validateNumOfPieces
(
value
,
pieces
)
{
validateNumOfPieces
({
index
,
item
})
{
return
;
if
(
value
.
toString
().
length
)
{
// 获取当前输入框有值的情况下
this
.
queryForm
[
pieces
]
=
Number
(
value
);
...
...
@@ -525,5 +533,48 @@ export const inputBlurValidate = {
}
return
this
.
validateForm
;
},
validate
()
{
const
validateData1
=
{
reg
:
/^
\d
+$/
,
index
:
index
,
minNumOfPieces
:
item
.
minNumOfPieces
,
maxNumOfPieces
:
item
.
maxNumOfPieces
,
errorMsgAttr
:
"piecesMsg"
,
validateForm
:
false
,
// form表单节流阀
errorMsg
:
{
empty
:
"不能为空"
,
valid
:
"请输入有效件数"
,
range
:
"件数不得小于1"
,
interval
:
"最小件数和最大件数不能小于1"
,
},
};
const
validateData2
=
{
reg
:
/^
(
0|
[
1-9
]\d
*
)(
.
\d{1,2})?
$/
,
index
:
index
,
minWeight
:
item
.
minWeight
,
maxWeight
:
item
.
maxWeight
,
errorMsgAttr
:
"weightMsg"
,
validateForm
:
false
,
// form表单节流阀
errorMsg
:
{
empty
:
"不能为空"
,
valid
:
"请输入有效重量,小数保留5位"
,
interval
:
"最小重量不得大于最大重量"
,
},
};
const
validateData3
=
{
reg
:
/^
(
0|
[
1-9
]\d
*
)(
.
\d{1,2})?
$/
,
index
:
index
,
minUsdCustomVal
:
item
.
minUsdCustomVal
,
maxUsdCustomVal
:
item
.
maxUsdCustomVal
,
errorMsgAttr
:
"currencyCdMsg"
,
// currencyCdUsdMsg
validateForm
:
false
,
// form表单节流阀
errorMsg
:
{
empty
:
"不能为空"
,
valid
:
"请输入有效申报价值,小数保留2位"
,
interval
:
"最小申报价值不得大于最大申报价值"
,
},
};
},
},
};
...
...
src/views/allocationConfig/flightAllocConfig/components/RouteInfo.vue
View file @
3041f72
...
...
@@ -64,7 +64,7 @@
<el-col :span="2">
<el-radio-group
v-model="item.isLocation"
@change="changeLocation"
@change="changeLocation
({ index, item, $event })
"
:disabled="pageName || status"
>
<el-radio label="1">包含始发站</el-radio>
...
...
@@ -109,7 +109,9 @@
<el-radio-group
:disabled="pageName || status"
v-model="item.isDestinationSite"
@change="changeDestinationSite"
@change="
changeDestinationSite({ index, item, $event })
"
>
<el-radio label="1">包含目的站</el-radio>
<el-radio label="2">不包含目的站</el-radio>
...
...
@@ -143,7 +145,7 @@
<div class="form-item-error-block">
<span
class="el-form-item__error"
v-text="destinationSiteError"
v-text="
item.
destinationSiteError"
></span>
</div>
</el-col>
...
...
@@ -163,7 +165,7 @@
</el-input>
<span
class="el-form-item__error"
v-text="ursaError"
v-text="
item.
ursaError"
></span>
</el-form-item>
</el-col>
...
...
@@ -178,10 +180,10 @@
@blur="notIncludeUrsa({ index, item, $event })"
>
</el-input>
<div class="form-item-error-block">
<div class="form-item-error-block">
<span
class="el-form-item__error"
v-text="notUrsaError"
v-text="
item.
notUrsaError"
></span>
</div>
</el-form-item>
...
...
@@ -200,7 +202,6 @@
>
</el-input>
<span
ref="minNumOfPieces"
class="el-form-item__error"
></span>
</el-col>
...
...
@@ -231,7 +232,6 @@
>
</el-input>
<span
ref="minWeight"
class="el-form-item__error"
></span>
</el-col>
...
...
@@ -593,12 +593,12 @@ export default {
this.$emit("collapse", name);
},
// 始发站
changeLocation(
val
) {
this.$emit("loc
ation", val
);
changeLocation(
item
) {
this.$emit("loc
Radio", item
);
},
// 目的站
changeDestinationSite(
val
) {
this.$emit("des
tinationSite", val
);
changeDestinationSite(
item
) {
this.$emit("des
siteRadio", item
);
},
// 申报类别
changeCargoType(arr) {
...
...
src/views/allocationConfig/flightAllocConfig/flightRouteInfo/index.vue
View file @
3041f72
...
...
@@ -40,6 +40,8 @@
@save="saveSubmit"
@onOff="onOffSubmit"
@delete="deleteSubmit"
@locRadio="locRadio"
@dessiteRadio="dessiteRadio"
@locationBur="locationBur"
@notLocationBur="notLocationBur"
@destinationSiteBur="destinationSiteBur"
...
...
src/views/allocationConfig/flightAllocConfig/mixins/index.js
View file @
3041f72
...
...
@@ -12,10 +12,6 @@ export default {
queryForm
:
{
// 表单参数
},
locationError
:
"URSA包含"
,
// 始发站
destinationSiteError
:
""
,
// 目的站
ursaError
:
""
,
// URSA包含
notUrsaError
:
""
,
// URSA不包含
};
},
computed
:
{
...
...
@@ -770,82 +766,229 @@ export default {
blurEvent
({
originOfFlightNo
})
{
this
.
queryForm
.
originOfFlightNo
=
this
.
upCase
(
originOfFlightNo
);
},
// 始发地
locRadio
({
index
,
item
})
{
const
validateData
=
{
reg
:
/^
[
a-zA-Z0-9
]
*$/
,
index
:
index
,
radio
:
item
.
isLocation
,
include
:
item
.
location
,
notInclude
:
item
.
notLocation
,
errorMsgAttr
:
"locationError"
,
validateForm
:
false
,
// form表单节流阀
errorMsg
:
{
repeat
:
"填写的始发站已重复"
,
empty
:
"不能为空"
,
error
:
"始发站之间用分号分隔,例:P1;P2;P3"
,
},
};
this
.
validateParmas
(
validateData
);
},
// 目的站
dessiteRadio
({
index
,
item
})
{
const
validateData
=
{
reg
:
/^
[
a-zA-Z0-9
]
*$/
,
index
:
index
,
radio
:
item
.
isLocation
,
include
:
item
.
location
,
notInclude
:
item
.
notLocation
,
errorMsgAttr
:
"destinationSiteError"
,
validateForm
:
false
,
// form表单节流阀
errorMsg
:
{
repeat
:
"填写的目的站已重复"
,
empty
:
"不能为空"
,
error
:
"目的站之间用分号分隔,例:P1;P2;P3"
,
},
};
this
.
validateParmas
(
validateData
);
},
// 校验目的地
validateLocation
(
validateParmas
({
reg
,
index
,
{
isLocation
,
location
,
notLocation
,
isDestinationSite
,
destinationSite
,
notDestinationSite
,
}
)
{
let
locationVal
,
notLocationVal
,
locationRepeat
,
validateLocation
,
destinationSiteRepeat
;
if
(
isLocation
==
"1"
)
{
// 分隔字符串并且转数组&去除数组空字符串
locationVal
=
location
.
split
(
";"
).
filter
((
str
)
=>
str
!==
""
);
// 是否有重复的
locationRepeat
=
new
Set
(
locationVal
).
size
!==
locationVal
.
length
;
// 校验校验开头以字母或者数字开头的/^[a-zA-Z0-9]*$/
validateLocation
=
locationVal
.
every
((
item
)
=>
/^
[
a-zA-Z0-9
]
*$/
.
test
(
item
)
);
radio
,
include
,
notInclude
,
errorMsgAttr
,
errorMsg
,
ursaMark
,
})
{
let
includeVal
,
notIncludeVal
,
repeat
=
false
,
validate
=
true
;
if
(
radio
==
"1"
)
{
if
(
include
)
{
// 分隔字符串并且转数组&去除数组空字符串
includeVal
=
include
.
split
(
";"
).
filter
((
str
)
=>
str
!==
""
);
// 是否有重复的
repeat
=
new
Set
(
includeVal
).
size
!==
includeVal
.
length
;
// 校验校验开头以字母或者数字开头的/^[a-zA-Z0-9]*$/
validate
=
includeVal
.
every
((
item
)
=>
reg
.
test
(
item
));
}
}
else
{
notLocationVal
=
notLocation
.
split
(
";"
).
filter
((
str
)
=>
str
!==
""
);
locationRepeat
=
new
Set
(
notLocationVal
).
size
!==
notLocationVal
.
length
;
validateLocation
=
locationVal
.
every
((
item
)
=>
/^
[
a-zA-Z0-9
]
*$/
.
test
(
item
)
);
if
(
notInclude
)
{
notIncludeVal
=
notInclude
.
split
(
";"
).
filter
((
str
)
=>
str
!==
""
);
repeat
=
new
Set
(
notIncludeVal
).
size
!==
notIncludeVal
.
length
;
validate
=
notIncludeVal
.
every
((
item
)
=>
reg
.
test
(
item
));
}
}
if
(
ursaMark
)
{
if
(
include
)
{
includeVal
=
include
.
split
(
";"
).
filter
((
str
)
=>
str
!==
""
);
repeat
=
new
Set
(
includeVal
).
size
!==
includeVal
.
length
;
validate
=
includeVal
.
every
((
item
)
=>
reg
.
test
(
item
));
}
else
{
this
.
routesInfo
[
index
].
validateForm
=
true
;
// form表单节流阀
this
.
routesInfo
[
index
][
errorMsgAttr
]
=
""
;
this
.
$set
(
this
.
routesInfo
,
index
,
this
.
routesInfo
[
index
]);
}
}
if
(
ursaMark
==
false
)
{
if
(
notInclude
)
{
notIncludeVal
=
notInclude
.
split
(
";"
).
filter
((
str
)
=>
str
!==
""
);
repeat
=
new
Set
(
notIncludeVal
).
size
!==
notIncludeVal
.
length
;
validate
=
notIncludeVal
.
every
((
item
)
=>
reg
.
test
(
item
));
}
else
{
this
.
routesInfo
[
index
].
validateForm
=
true
;
// form表单节流阀
this
.
routesInfo
[
index
][
errorMsgAttr
]
=
""
;
this
.
$set
(
this
.
routesInfo
,
index
,
this
.
routesInfo
[
index
]);
}
}
if
(
repeat
)
{
this
.
routesInfo
[
index
].
validateForm
=
false
;
// form表单节流阀
this
.
routesInfo
[
index
][
errorMsgAttr
]
=
errorMsg
.
repeat
;
this
.
$set
(
this
.
routesInfo
,
index
,
this
.
routesInfo
[
index
]);
}
if
(
!
validate
)
{
this
.
routesInfo
[
index
].
validateForm
=
false
;
// form表单节流阀
this
.
routesInfo
[
index
][
errorMsgAttr
]
=
errorMsg
.
error
;
this
.
$set
(
this
.
routesInfo
,
index
,
this
.
routesInfo
[
index
]);
}
if
(
locationRepeat
)
{
this
.
routesInfo
[
index
].
locationError
=
"填写的目的地已重复"
;
if
(
!
repeat
&&
validate
)
{
this
.
routesInfo
[
index
].
validateForm
=
true
;
// form表单节流阀
this
.
routesInfo
[
index
][
errorMsgAttr
]
=
""
;
this
.
$set
(
this
.
routesInfo
,
index
,
this
.
routesInfo
[
index
]);
}
if
(
!
validateLocation
)
{
this
.
routesInfo
[
index
].
locationError
=
"目的地之间用分号分隔,例:P1;P2;P3
"
;
if
(
radio
==
"1"
&&
!
include
)
{
this
.
routesInfo
[
index
].
validateForm
=
true
;
// form表单节流阀
this
.
routesInfo
[
index
][
errorMsgAttr
]
=
"
"
;
this
.
$set
(
this
.
routesInfo
,
index
,
this
.
routesInfo
[
index
]);
}
if
(
!
locationRepeat
&&
validateLocation
)
{
this
.
routesInfo
[
index
].
locationError
=
""
;
if
(
radio
==
"2"
&&
!
notInclude
)
{
this
.
routesInfo
[
index
].
validateForm
=
true
;
// form表单节流阀
this
.
routesInfo
[
index
][
errorMsgAttr
]
=
""
;
this
.
$set
(
this
.
routesInfo
,
index
,
this
.
routesInfo
[
index
]);
}
},
// 包含始发站失焦事件
locationBur
({
index
,
item
})
{
// 不为空的时候做校验
if
(
item
.
location
)
{
this
.
validateLocation
(
index
,
item
);
}
const
validateData
=
{
reg
:
/^
[
a-zA-Z0-9
]
*$/
,
index
:
index
,
radio
:
item
.
isLocation
,
include
:
item
.
location
,
notInclude
:
item
.
notLocation
,
errorMsgAttr
:
"locationError"
,
validateForm
:
false
,
// form表单节流阀
errorMsg
:
{
repeat
:
"填写的始发站已重复"
,
empty
:
"不能为空"
,
error
:
"始发站之间用分号分隔,例:P1;P2;P3"
,
},
};
this
.
validateParmas
(
validateData
);
},
// 不包含始发站失焦事件
notLocationBur
({
index
,
item
})
{
// console.log("notLocationBur", index, item);
if
(
item
.
notLocation
)
{
this
.
validateLocation
(
index
,
item
);
}
const
validateData
=
{
reg
:
/^
[
a-zA-Z0-9
]
*$/
,
index
:
index
,
radio
:
item
.
isLocation
,
include
:
item
.
location
,
notInclude
:
item
.
notLocation
,
errorMsgAttr
:
"locationError"
,
validateForm
:
false
,
// form表单节流阀
errorMsg
:
{
repeat
:
"填写的始发站已重复"
,
empty
:
"不能为空"
,
error
:
"始发站之间用分号分隔,例:P1;P2;P3"
,
},
};
this
.
validateParmas
(
validateData
);
},
// 包含目的站失焦事件
destinationSiteBur
({
index
,
item
})
{
// console.log("destinationSiteBur", index, item);
const
validateData
=
{
reg
:
/^
[
a-zA-Z0-9
]
*$/
,
index
:
index
,
radio
:
item
.
isLocation
,
include
:
item
.
location
,
notInclude
:
item
.
notLocation
,
errorMsgAttr
:
"destinationSiteError"
,
validateForm
:
false
,
// form表单节流阀
errorMsg
:
{
repeat
:
"填写的目的站已重复"
,
empty
:
"不能为空"
,
error
:
"目的站之间用分号分隔,例:P1;P2;P3"
,
},
};
this
.
validateParmas
(
validateData
);
},
// 不包含目的站失焦事件
notDestinationSiteBur
({
index
,
item
})
{
// console.log("notDestinationSiteBur", index, item);
const
validateData
=
{
reg
:
/^
[
a-zA-Z0-9
]
*$/
,
index
:
index
,
radio
:
item
.
isLocation
,
include
:
item
.
location
,
notInclude
:
item
.
notLocation
,
errorMsgAttr
:
"destinationSiteError"
,
validateForm
:
false
,
// form表单节流阀
errorMsg
:
{
repeat
:
"填写的目的站已重复"
,
empty
:
"不能为空"
,
error
:
"目的站之间用分号分隔,例:P1;P2;P3"
,
},
};
this
.
validateParmas
(
validateData
);
},
// URSA包含失焦事件
includeUrsaBur
({
index
,
item
})
{
// console.log("includeUrsaBur", index, item);
const
validateData
=
{
reg
:
/^
[
a-zA-Z0-9
]
*_$/
,
index
:
index
,
ursaMark
:
true
,
include
:
item
.
includeUrsa
,
notInclude
:
item
.
notIncludeUrsa
,
errorMsgAttr
:
"ursaError"
,
validateForm
:
false
,
// form表单节流阀
errorMsg
:
{
repeat
:
"填写的URSA已重复"
,
empty
:
"不能为空"
,
error
:
"URSA包含之间用分号分隔,例:P1_;F2_;F3_"
,
},
};
this
.
validateParmas
(
validateData
);
},
// URSA不包含失焦事件
notIncludeUrsaBur
({
index
,
item
})
{
// console.log("notIncludeUrsaBur", index, item);
const
validateData
=
{
reg
:
/^
[
a-zA-Z0-9
]
*$/
,
index
:
index
,
ursaMark
:
false
,
include
:
item
.
includeUrsa
,
notInclude
:
item
.
notIncludeUrsa
,
errorMsgAttr
:
"notUrsaError"
,
validateForm
:
false
,
// form表单节流阀
errorMsg
:
{
repeat
:
"填写的URSA已重复"
,
empty
:
"不能为空"
,
error
:
"URSA包含之间用分号分隔,例:P1;F2;F3"
,
},
};
this
.
validateParmas
(
validateData
);
},
// 最少件数失焦事件
minNumOfPiecesBur
({
index
,
item
})
{
...
...
src/views/et86Config/et86RuleConfig/edit/index.vue
View file @
3041f72
...
...
@@ -309,7 +309,7 @@
<el-input
v-model.trim="queryForm.minNumOfPieces"
placeholder="最小件数"
@blur="inputBlurMinPieces(
$event
)"
@blur="inputBlurMinPieces(
{ index: 0, queryForm, $event }
)"
:disabled="!getRouter"
></el-input>
<span ref="minNumOfPieces" class="el-form-item__error"></span>
...
...
@@ -319,7 +319,7 @@
<el-input
v-model.trim="queryForm.maxNumOfPieces"
placeholder="最大件数"
@blur="inputBlurMaxPieces(
$event
)"
@blur="inputBlurMaxPieces(
{ index: 0, queryForm, $event }
)"
:disabled="!getRouter"
></el-input>
</el-col>
...
...
@@ -332,7 +332,7 @@
<el-input
v-model.trim="queryForm.minWeight"
placeholder="最小重量"
@blur="inputBlurMinWeight(
$event
)"
@blur="inputBlurMinWeight(
{ index: 0, queryForm, $event }
)"
:disabled="!getRouter"
></el-input>
<span ref="minWeight" class="el-form-item__error"></span>
...
...
@@ -342,7 +342,7 @@
<el-input
v-model.trim="queryForm.maxWeight"
placeholder="最大重量"
@blur="inputBlurMaxWeight(
$event
)"
@blur="inputBlurMaxWeight(
{ index: 0, queryForm, $event }
)"
:disabled="!getRouter"
></el-input>
</el-col>
...
...
@@ -361,7 +361,7 @@
<el-input
v-model.trim="queryForm.minCustomVal"
placeholder="最小申报价值"
@blur="inputCNYBlurMin(
$event, 'minCNYCustomVal'
)"
@blur="inputCNYBlurMin(
{ index: 0, queryForm, $event }
)"
:disabled="!getRouter"
></el-input>
<span
...
...
@@ -374,7 +374,7 @@
<el-input
v-model.trim="queryForm.maxCustomVal"
placeholder="最大申报价值"
@blur="inputCNYBlurMax(
$event, 'maxCNYCustomVal'
)"
@blur="inputCNYBlurMax(
{ index: 0, queryForm, $event }
)"
:disabled="!getRouter"
></el-input>
</el-col>
...
...
@@ -387,7 +387,7 @@
<el-input
v-model.trim="queryForm.minUsdCustomVal"
placeholder="最小申报价值"
@blur="inputSUDBlurMin(
$event, 'minSUDCustomVal'
)"
@blur="inputSUDBlurMin(
{ index: 0, queryForm, $event }
)"
:disabled="!getRouter"
></el-input>
<span
...
...
@@ -400,7 +400,7 @@
<el-input
v-model.trim="queryForm.maxUsdCustomVal"
placeholder="最大申报价值"
@blur="inputSUDBlurMax(
$event, 'maxSUDCustomVal'
)"
@blur="inputSUDBlurMax(
{ index: 0, queryForm, $event }
)"
:disabled="!getRouter"
></el-input>
</el-col>
...
...
Please
register
or
login
to post a comment