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-09-15 17:17:31 +0800
Browse Files
Options
Browse Files
Download
Plain Diff
Commit
b67eb766d84fc2973db1d91b431853e5cf431e4c
b67eb766
2 parents
0b9a49e7
5afd4bf5
Merge branch 'test' into et86
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
69 additions
and
71 deletions
src/utils/index.js
src/utils/mixins.js
src/views/et86Config/et86RuleConfig/edit/index.vue
src/views/et86Config/et86RuleConfig/edit/mixins/index.js
src/utils/index.js
View file @
b67eb76
...
...
@@ -223,7 +223,7 @@ export function getTime(type) {
* @return {*}
*/
export
function
debounce
(
func
,
wait
,
immediate
)
{
let
timeout
,
args
,
context
,
timestamp
,
result
;
let
timeout
,
args
,
context
,
timestamp
,
result
,
data
;
const
later
=
function
()
{
// 据上一次触发时间间隔
...
...
@@ -236,7 +236,7 @@ export function debounce(func, wait, immediate) {
timeout
=
null
;
// 如果设定为immediate===true,因为开始边界已经调用过了此处无需调用
if
(
!
immediate
)
{
result
=
func
.
apply
(
context
,
args
);
result
=
func
.
apply
(
context
,
data
);
if
(
!
timeout
)
context
=
args
=
null
;
}
}
...
...
@@ -245,6 +245,7 @@ export function debounce(func, wait, immediate) {
return
function
(...
args
)
{
context
=
this
;
timestamp
=
+
new
Date
();
data
=
args
;
const
callNow
=
immediate
&&
!
timeout
;
// 如果延时不存在,重新设定延时
if
(
!
timeout
)
timeout
=
setTimeout
(
later
,
wait
);
...
...
src/utils/mixins.js
View file @
b67eb76
...
...
@@ -240,7 +240,7 @@ export const inputBlurValidate = {
let
markCoin
=
false
;
if
(
value
.
length
)
{
this
[
customVal
]
=
Number
(
value
);
// 其中一个有值的情况下
// 其中一个有值的情况下
人民币
if
(
customVal
==
"minCNYCustomVal"
||
customVal
==
"maxCNYCustomVal"
)
{
if
(
this
.
minCNYCustomVal
&&
this
.
maxCNYCustomVal
)
{
this
.
validateForm
=
false
;
...
...
@@ -251,7 +251,7 @@ export const inputBlurValidate = {
this
.
$refs
[
coin
[
customVal
]].
innerHTML
=
""
;
}
}
// 都有值的情况下
// 都有值的情况下
美元
else
{
if
(
this
.
minSUDCustomVal
&&
this
.
maxSUDCustomVal
)
{
this
.
validateForm
=
false
;
...
...
@@ -278,20 +278,6 @@ export const inputBlurValidate = {
// this.validateForm = true;
// this.$refs[coin[customVal]].innerHTML = "";
// }
}
else
{
if
(
value
.
length
)
{
// 判断申报价值不得大于上限
// if (Number(value) > currency[customVal]) {
// this.validateForm = false;
// this.$refs[coin[customVal]].innerHTML = "";
// this.$refs[
// coin[customVal]
// ].innerHTML = `最大申报值不得大于${currency[customVal]}`;
// } else {
// this.validateForm = true;
// this.$refs[coin[customVal]].innerHTML = "";
// }
}
}
}
else
{
this
.
validateForm
=
false
;
...
...
src/views/et86Config/et86RuleConfig/edit/index.vue
View file @
b67eb76
...
...
@@ -56,23 +56,24 @@
<el-table-column
label="加减天数"
prop="calculateDay"
width="1
0
0"
width="1
4
0"
align="center"
>
<template slot-scope="scope">
<el-input
type="text"
<el-input-number
v-model="scope.row.calculateDay"
:disabled="scope.row.edit"
min="-7"
max="7"
:min="-7"
:max="7"
:precision="0"
v-input-filter
clearable
placeholder=""
size="small"
style="width: 100%"
/>
<!-- <el-input
type="
number
"
type="
text
"
v-model="scope.row.calculateDay"
:disabled="scope.row.edit"
min="-7"
...
...
@@ -497,40 +498,6 @@ export default {
];
}
},
mounted() {},
directives: {
// 处理加减天数
"input-filter": {
bind: function (el, binding, { context }) {
el.handler = function (event) {
if (event.data == "E" || event.data == "e") {
// 无理数时
event.target.value = "";
}
if (event.target.value) {
if (Number(event.target.value) < -7) {
event.target.value = "";
context.msgError("加减天数最小不能低于7天");
} else if (Number(event.target.value) > 7) {
event.target.value = "";
context.msgError("加减天数最小不能大于7天");
} else if (/[\.]/.test(Number(event.target.value))) {
// 浮点数时
event.target.value = "";
} else {
}
event.target.dispatchEvent(new Event("input"));
}
};
el.addEventListener("input", el.handler);
},
unbind: function (el) {
el.removeEventListener("input", el.handler);
},
},
},
filters: {},
methods: {
// ET86新增
postAdd(params) {
...
...
@@ -553,7 +520,7 @@ export default {
const { code, data, msg } = res;
if (code == 200) {
data.list.flightRankDtoList.map((item) => {
if (name == "view") {
if (name == "view") {
// 跳转页面传过来的字段值等于view展示查看
item.edit = true;
} else {
item.edit = false;
...
...
@@ -565,13 +532,10 @@ export default {
item.permitOverweight = true;
}
});
data.list.flightRankDtoList.map((item) => {
item.calculateDay = item.calculateDay;
});
// ET86配舱航班顺位
// ET86配舱航班顺位列表
this.tableData = data.list.flightRankDtoList;
Object.keys(data.list.fltRuleDto).map((key) => {
if (key == "multiHs") {
if (key == "multiHs") {
// N为单品名,Y为多品名
if (data.list.fltRuleDto[key] == "N") {
data.list.fltRuleDto[key] = true;
} else {
...
...
@@ -583,6 +547,7 @@ export default {
data.list.fltRuleDto[key] = "";
}
});
// 申报类别详情转化成数组赋值给申报类别勾选框作为回显展示数据
if (data.list.fltRuleDto.declarationCategory) {
this.checkboxClassType =
data.list.fltRuleDto.declarationCategory.split(";");
...
...
@@ -660,24 +625,28 @@ export default {
},
// 失焦查询
blurSearch() {
// 转大写字母
this.tableData[this.currentIndex].flightNo = this.upCase(
this.tableData[this.currentIndex].flightNo
); // 转大写字母
let params = {
fltNo: this.tableData[this.currentIndex].flightNo,
};
);
// 筛选重复的航班:【重复规则】航班号 + 加减天数 + 航线有同样的就认为是重复
let repeat = this.tableData.filter(
(item) =>
item.flightNo == this.tableData[this.currentIndex].flightNo &&
item.calculateDay == this.tableData[this.currentIndex].calculateDay &&
item.flightRoute == this.tableData[this.currentIndex].flightRoute
); // 筛选重复的航班
);
// 出现重复的返回
if (repeat.length > 1) {
this.msgError("航班顺位已重复");
return;
}
let params = {
fltNo: this.tableData[this.currentIndex].flightNo,
};
// 航班号输入框失焦时判断有没有航班号,有航班号调用航线查询
if (params.fltNo) {
this.getQueryRouteByFltNo(params);
this.getQueryRouteByFltNo(params);
// 航线查询
} else {
this.tableData[this.currentIndex].flightRoute = "";
this.tableData[this.currentIndex].routeList = [];
...
...
@@ -715,7 +684,7 @@ export default {
let include = this.cargoType.filter((item) =>
arr.some((val) => val == item.chineseName)
); // 查询已被勾选的类别
this.checkboxCargoType = include; //已勾选申报类别的数据
this.checkboxCargoType = include; //
已勾选申报类别的数据
this.queryForm.declarationCategory = arr.join(";");
},
// 失焦事件
...
...
src/views/et86Config/et86RuleConfig/edit/mixins/index.js
View file @
b67eb76
import
{
debounce
}
from
"@/utils"
;
export
default
{
directives
:
{
// 处理加减天数
"input-filter"
:
{
bind
:
function
(
el
,
binding
,
{
context
})
{
el
.
handler
=
function
(
event
)
{
context
.
calculateDay
(
event
);
};
el
.
addEventListener
(
"input"
,
el
.
handler
);
},
unbind
:
function
(
el
)
{
el
.
removeEventListener
(
"input"
,
el
.
handler
);
},
},
},
methods
:
{
// 防抖函数处理加减天数校验
calculateDay
:
debounce
(
function
(...
args
)
{
// 判断有没有值
if
(
args
.
length
)
{
// 判断传过来的是不是一个对象
const
{
target
}
=
args
[
0
];
// 是不是一个数字
if
(
isNaN
(
Number
(
target
.
value
)))
{
this
.
msgError
(
"请输入有效数字"
);
target
.
value
=
""
;
}
else
{
// 非数字时
if
(
Number
(
target
.
value
)
<
-
7
)
{
this
.
msgError
(
"加减天数最小不能大于7天"
);
target
.
value
=
""
;
}
else
if
(
Number
(
target
.
value
)
>
7
)
{
this
.
msgError
(
"加减天数最大不能大于7天"
);
target
.
value
=
""
;
}
else
if
(
/
[\.]
/
.
test
(
Number
(
target
.
value
)))
{
// 浮点数时
this
.
msgError
(
"加减天数只能为整数"
);
target
.
value
=
""
;
}
}
target
.
dispatchEvent
(
new
Event
(
"input"
));
}
},
800
),
// 获取字典
getObj
({
serviceCode
})
{
let
service_Code
=
[];
...
...
Please
register
or
login
to post a comment