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
jinhui.wang
2022-06-01 18:05:15 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
238b8b32add53058b1bae8be8a01c3c1a782db1c
238b8b32
1 parent
ad5086ee
样式更新,字段修改
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
259 additions
and
253 deletions
src/assets/languages/dictLabels.js
src/utils/FedEx.js
src/views/basicInformation/caPreReviewImport/index.vue
src/views/basicInformation/flightInformationImport/index.vue
src/views/basicInformation/flightInformationMaintenance/index.vue
src/views/basicInformation/queryCargo/index.vue
src/assets/languages/dictLabels.js
View file @
238b8b3
...
...
@@ -7,16 +7,16 @@ let ductLabels = {
"releasing"
:
{
"1"
:
"正在释放"
},
"cargoAllocationDataStatus"
:
{
"已推送"
:
"已推送"
,
"不推送"
:
"不推送"
,
"已配"
:
" "
,
"待推送"
:
"待推送"
,
"手动配舱"
:
' '
,
"已释放"
:
' '
,
"原航班配舱"
:
' '
,
"顺位配舱"
:
' '
,
},
//
"cargoAllocationDataStatus": {
//
"已推送": "已推送",
//
"不推送": "不推送",
//
"已配": " ",
//
"待推送": "待推送",
//
"手动配舱": ' ',
//
"已释放": ' ',
//
"原航班配舱": ' ',
//
"顺位配舱": ' ',
//
},
},
"menu"
:
{
//菜单设置
"menuType"
:
{
...
...
src/utils/FedEx.js
View file @
238b8b3
...
...
@@ -3,180 +3,186 @@
* Copyright (c) 2019 FedEx
*/
const
baseURL
=
process
.
env
.
VUE_APP_BASE_API
// 日期格式化
export
function
parseTime
(
time
,
pattern
)
{
//debugger
if
(
arguments
.
length
===
0
||
!
time
)
{
return
null
}
const
format
=
pattern
||
'{y}-{m}-{d} {h}:{i}:{s}'
let
date
if
(
typeof
time
===
'object'
)
{
date
=
time
}
else
{
if
((
typeof
time
===
'string'
)
&&
(
/^
[
0-9
]
+$/
.
test
(
time
)))
{
time
=
parseInt
(
time
)
}
else
if
(
typeof
time
===
'string'
)
{
time
=
time
.
replace
(
new
RegExp
(
/-/gm
),
'/'
);
}
if
((
typeof
time
===
'number'
)
&&
(
time
.
toString
().
length
===
10
))
{
time
=
time
*
1000
}
date
=
new
Date
(
time
)
}
const
formatObj
=
{
y
:
date
.
getFullYear
(),
m
:
date
.
getMonth
()
+
1
,
d
:
date
.
getDate
(),
h
:
date
.
getHours
(),
i
:
date
.
getMinutes
(),
s
:
date
.
getSeconds
(),
a
:
date
.
getDay
()
}
const
time_str
=
format
.
replace
(
/{
(
y|m|d|h|i|s|a
)
+}/g
,
(
result
,
key
)
=>
{
let
value
=
formatObj
[
key
]
// Note: getDay() returns 0 on Sunday
if
(
key
===
'a'
)
{
return
[
'日'
,
'一'
,
'二'
,
'三'
,
'四'
,
'五'
,
'六'
][
value
]
}
if
(
result
.
length
>
0
&&
value
<
10
)
{
value
=
'0'
+
value
}
return
value
||
0
})
return
time_str
}
// 表单重置
export
function
resetForm
(
refName
)
{
if
(
this
.
$refs
[
refName
])
{
this
.
$refs
[
refName
].
resetFields
();
}
}
// 添加日期范围
export
function
addDateRange
(
params
,
dateRange
,
propName
)
{
var
search
=
params
;
search
.
params
=
{};
if
(
null
!=
dateRange
&&
''
!=
dateRange
)
{
if
(
typeof
(
propName
)
===
"undefined"
)
{
search
.
params
[
"beginTime"
]
=
dateRange
[
0
];
search
.
params
[
"endTime"
]
=
dateRange
[
1
];
}
else
{
search
.
params
[
"begin"
+
propName
]
=
dateRange
[
0
];
search
.
params
[
"end"
+
propName
]
=
dateRange
[
1
];
}
}
return
search
;
}
// 回显数据字典
export
function
selectDictLabel
(
datas
,
value
)
{
var
actions
=
[];
Object
.
keys
(
datas
).
some
((
key
)
=>
{
if
(
datas
[
key
].
dictValue
==
(
''
+
value
))
{
actions
.
push
(
datas
[
key
].
dictLabel
);
return
true
;
}
})
return
actions
.
join
(
''
);
}
// 回显数据字典(字符串数组)
export
function
selectDictLabels
(
datas
,
value
,
separator
)
{
var
actions
=
[];
var
currentSeparator
=
undefined
===
separator
?
","
:
separator
;
var
temp
=
value
.
split
(
currentSeparator
);
Object
.
keys
(
value
.
split
(
currentSeparator
)).
some
((
val
)
=>
{
Object
.
keys
(
datas
).
some
((
key
)
=>
{
if
(
datas
[
key
].
dictValue
==
(
''
+
temp
[
val
]))
{
actions
.
push
(
datas
[
key
].
dictLabel
+
currentSeparator
);
}
})
})
return
actions
.
join
(
''
).
substring
(
0
,
actions
.
join
(
''
).
length
-
1
);
}
// 通用下载方法
export
function
download
(
fileName
)
{
window
.
location
.
href
=
baseURL
+
"/common/download?fileName="
+
encodeURI
(
fileName
)
+
"&delete="
+
true
;
}
// 字符串格式化(%s )
export
function
sprintf
(
str
)
{
var
args
=
arguments
,
flag
=
true
,
i
=
1
;
str
=
str
.
replace
(
/%s/g
,
function
()
{
var
arg
=
args
[
i
++
];
if
(
typeof
arg
===
'undefined'
)
{
flag
=
false
;
return
''
;
}
return
arg
;
});
return
flag
?
str
:
''
;
}
// 转换字符串,undefined,null等转化为""
export
function
praseStrEmpty
(
str
)
{
if
(
!
str
||
str
==
"undefined"
||
str
==
"null"
)
{
return
""
;
}
return
str
;
}
/**
* 构造树型结构数据
* @param {*} data 数据源
* @param {*} id id字段 默认 'id'
* @param {*} parentId 父节点字段 默认 'parentId'
* @param {*} children 孩子节点字段 默认 'children'
*/
export
function
handleTree
(
data
,
id
,
parentId
,
children
)
{
let
config
=
{
id
:
id
||
'id'
,
parentId
:
parentId
||
'parentId'
,
childrenList
:
children
||
'children'
};
var
childrenListMap
=
{};
var
nodeIds
=
{};
var
tree
=
[];
for
(
let
d
of
data
)
{
let
parentId
=
d
[
config
.
parentId
];
if
(
childrenListMap
[
parentId
]
==
null
)
{
childrenListMap
[
parentId
]
=
[];
}
nodeIds
[
d
[
config
.
id
]]
=
d
;
childrenListMap
[
parentId
].
push
(
d
);
}
for
(
let
d
of
data
)
{
let
parentId
=
d
[
config
.
parentId
];
if
(
nodeIds
[
parentId
]
==
null
)
{
tree
.
push
(
d
);
}
}
for
(
let
t
of
tree
)
{
adaptToChildrenList
(
t
);
}
function
adaptToChildrenList
(
o
)
{
if
(
childrenListMap
[
o
[
config
.
id
]]
!==
null
)
{
o
[
config
.
childrenList
]
=
childrenListMap
[
o
[
config
.
id
]];
}
if
(
o
[
config
.
childrenList
])
{
for
(
let
c
of
o
[
config
.
childrenList
])
{
adaptToChildrenList
(
c
);
}
}
}
return
tree
;
}
//字符串英文转大写,;转英文;
export
function
upCase
(
str
){
let
newStr
=
str
.
replace
(
/;/g
,
";"
).
toUpperCase
();
return
newStr
;
}
\ No newline at end of file
const
baseURL
=
process
.
env
.
VUE_APP_BASE_API
// 日期格式化
export
function
parseTime
(
time
,
pattern
)
{
//debugger
if
(
arguments
.
length
===
0
||
!
time
)
{
return
null
}
const
format
=
pattern
||
'{y}-{m}-{d} {h}:{i}:{s}'
let
date
if
(
typeof
time
===
'object'
)
{
date
=
time
}
else
{
if
((
typeof
time
===
'string'
)
&&
(
/^
[
0-9
]
+$/
.
test
(
time
)))
{
time
=
parseInt
(
time
)
}
else
if
(
typeof
time
===
'string'
)
{
time
=
time
.
replace
(
new
RegExp
(
/-/gm
),
'/'
);
}
if
((
typeof
time
===
'number'
)
&&
(
time
.
toString
().
length
===
10
))
{
time
=
time
*
1000
}
date
=
new
Date
(
time
)
}
const
formatObj
=
{
y
:
date
.
getFullYear
(),
m
:
date
.
getMonth
()
+
1
,
d
:
date
.
getDate
(),
h
:
date
.
getHours
(),
i
:
date
.
getMinutes
(),
s
:
date
.
getSeconds
(),
a
:
date
.
getDay
()
}
const
time_str
=
format
.
replace
(
/{
(
y|m|d|h|i|s|a
)
+}/g
,
(
result
,
key
)
=>
{
let
value
=
formatObj
[
key
]
// Note: getDay() returns 0 on Sunday
if
(
key
===
'a'
)
{
return
[
'日'
,
'一'
,
'二'
,
'三'
,
'四'
,
'五'
,
'六'
][
value
]
}
if
(
result
.
length
>
0
&&
value
<
10
)
{
value
=
'0'
+
value
}
return
value
||
0
})
return
time_str
}
// 表单重置
export
function
resetForm
(
refName
)
{
if
(
this
.
$refs
[
refName
])
{
this
.
$refs
[
refName
].
resetFields
();
}
}
// 添加日期范围
export
function
addDateRange
(
params
,
dateRange
,
propName
)
{
var
search
=
params
;
search
.
params
=
{};
if
(
null
!=
dateRange
&&
''
!=
dateRange
)
{
if
(
typeof
(
propName
)
===
"undefined"
)
{
search
.
params
[
"beginTime"
]
=
dateRange
[
0
];
search
.
params
[
"endTime"
]
=
dateRange
[
1
];
}
else
{
search
.
params
[
"begin"
+
propName
]
=
dateRange
[
0
];
search
.
params
[
"end"
+
propName
]
=
dateRange
[
1
];
}
}
return
search
;
}
// 回显数据字典
export
function
selectDictLabel
(
datas
,
value
)
{
var
actions
=
[];
Object
.
keys
(
datas
).
some
((
key
)
=>
{
if
(
datas
[
key
].
dictValue
==
(
''
+
value
))
{
actions
.
push
(
datas
[
key
].
dictLabel
);
return
true
;
}
})
return
actions
.
join
(
''
);
}
// 回显数据字典(字符串数组)
export
function
selectDictLabels
(
datas
,
value
,
separator
)
{
var
actions
=
[];
var
currentSeparator
=
undefined
===
separator
?
","
:
separator
;
var
temp
=
value
.
split
(
currentSeparator
);
Object
.
keys
(
value
.
split
(
currentSeparator
)).
some
((
val
)
=>
{
Object
.
keys
(
datas
).
some
((
key
)
=>
{
if
(
datas
[
key
].
dictValue
==
(
''
+
temp
[
val
]))
{
actions
.
push
(
datas
[
key
].
dictLabel
+
currentSeparator
);
}
})
})
return
actions
.
join
(
''
).
substring
(
0
,
actions
.
join
(
''
).
length
-
1
);
}
// 通用下载方法
export
function
download
(
fileName
)
{
window
.
location
.
href
=
baseURL
+
"/common/download?fileName="
+
encodeURI
(
fileName
)
+
"&delete="
+
true
;
}
// 字符串格式化(%s )
export
function
sprintf
(
str
)
{
var
args
=
arguments
,
flag
=
true
,
i
=
1
;
str
=
str
.
replace
(
/%s/g
,
function
()
{
var
arg
=
args
[
i
++
];
if
(
typeof
arg
===
'undefined'
)
{
flag
=
false
;
return
''
;
}
return
arg
;
});
return
flag
?
str
:
''
;
}
// 转换字符串,undefined,null等转化为""
export
function
praseStrEmpty
(
str
)
{
if
(
!
str
||
str
==
"undefined"
||
str
==
"null"
)
{
return
""
;
}
return
str
;
}
/**
* 构造树型结构数据
* @param {*} data 数据源
* @param {*} id id字段 默认 'id'
* @param {*} parentId 父节点字段 默认 'parentId'
* @param {*} children 孩子节点字段 默认 'children'
*/
export
function
handleTree
(
data
,
id
,
parentId
,
children
)
{
let
config
=
{
id
:
id
||
'id'
,
parentId
:
parentId
||
'parentId'
,
childrenList
:
children
||
'children'
};
var
childrenListMap
=
{};
var
nodeIds
=
{};
var
tree
=
[];
for
(
let
d
of
data
)
{
let
parentId
=
d
[
config
.
parentId
];
if
(
childrenListMap
[
parentId
]
==
null
)
{
childrenListMap
[
parentId
]
=
[];
}
nodeIds
[
d
[
config
.
id
]]
=
d
;
childrenListMap
[
parentId
].
push
(
d
);
}
for
(
let
d
of
data
)
{
let
parentId
=
d
[
config
.
parentId
];
if
(
nodeIds
[
parentId
]
==
null
)
{
tree
.
push
(
d
);
}
}
for
(
let
t
of
tree
)
{
adaptToChildrenList
(
t
);
}
function
adaptToChildrenList
(
o
)
{
if
(
childrenListMap
[
o
[
config
.
id
]]
!==
null
)
{
o
[
config
.
childrenList
]
=
childrenListMap
[
o
[
config
.
id
]];
}
if
(
o
[
config
.
childrenList
])
{
for
(
let
c
of
o
[
config
.
childrenList
])
{
adaptToChildrenList
(
c
);
}
}
}
return
tree
;
}
//字符串英文转大写,;转英文;
export
function
upCase
(
str
)
{
let
newStr
=
str
.
replace
(
/;/g
,
";"
).
toUpperCase
();
return
newStr
;
}
//当前日期
export
function
nowDate
()
{
let
date
=
new
Date
()
return
`
${
date
.
getFullYear
()}
-
${(
date
.
getMonth
()
+
1
)
>
9
?
(
date
.
getMonth
()
+
1
)
:
'0'
+
(
date
.
getMonth
()
+
1
)}
-
${(
date
.
getDate
())
>
9
?
date
.
getDate
()
:
'0'
+
(
date
.
getDate
())}
`
}
\ No newline at end of file
...
...
src/views/basicInformation/caPreReviewImport/index.vue
View file @
238b8b3
...
...
@@ -16,9 +16,9 @@
提示:<span style="color: #1890ff">以下为所提交的数据或出错信息</span>
</div>
<el-table ref="filterTable" :data="tableData" v-loading="loading" style="width: 100%; margin-top: 20px" size="small" border>
<el-table-column label="行号" prop="line"
fixed
width="50" align="center">
<el-table-column label="行号" prop="line" width="50" align="center">
</el-table-column>
<el-table-column label="错误信息" prop="errorMessage"
fixed
width="300">
<el-table-column label="错误信息" prop="errorMessage" width="300">
<template slot-scope="scope">
<div v-for="(m, key) in scope.row.errorMessage" :key="key">
{{ m }}
...
...
src/views/basicInformation/flightInformationImport/index.vue
View file @
238b8b3
...
...
@@ -3,50 +3,30 @@
<el-form :inline="true" :model="form" class="demo-form-inline" size="small">
<el-form-item label="航班种类">
<el-select v-model="form.type" placeholder="航班种类">
<el-option
v-for="item in flightType"
:key="item.id"
:label="item.englishName"
:value="item.code"
>{{ item.englishName }}</el-option
>
<el-option v-for="item in flightType" :key="item.id" :label="item.englishName" :value="item.code">{{
item.englishName
}}</el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-upload
action="/flightInfoImport/importFlight"
name="file"
:http-request="uploadExcel"
:on-remove="handleRemove"
:limit="1"
:on-exceed="handleExceed"
:file-list="fileList"
accept=".xlsx"
class="upload-demo"
v-hasPermi="['base:flightImport:importFlight']"
>
<el-upload action="/flightInfoImport/importFlight" name="file" :http-request="uploadExcel"
:on-remove="handleRemove" :limit="1" :on-exceed="handleExceed" :file-list="fileList" accept=".xlsx"
class="upload-demo" v-hasPermi="['base:flightImport:importFlight']">
<el-button type="primary">点击上传</el-button>
</el-upload>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="downloadTempleate" v-hasPermi="['base:flightImport:exportExcel']"
>下载模板</el-button
>
<el-button type="primary" @click="downloadTempleate" v-hasPermi="['base:flightImport:exportExcel']">下载模板
</el-button>
</el-form-item>
</el-form>
<div style="font-size: 12px; font-weight: 700">
提示:<span style="color: #1890ff">以下为所提交的数据或出错信息</span>
</div>
<el-table
ref="filterTable"
:data="tableData"
style="margin-top: 20px"
size="small"
border
>
<el-table-column label="行号" prop="line" fixed width="50" align="center">
<el-table ref="filterTable" :data="tableData" style="margin-top: 20px" size="small" border>
<el-table-column label="行号" prop="line" width="50" align="center">
</el-table-column>
<el-table-column label="错误信息" prop="errorMessage"
fixed
width="200">
<el-table-column label="错误信息" prop="errorMessage" width="200">
<template slot-scope="scope">
<div v-for="(m, key) in scope.row.errorMessage" :key="key">
{{ m }}
...
...
@@ -54,13 +34,8 @@
</template>
</el-table-column>
<el-table-column v-if="tableData.length == 0"></el-table-column>
<el-table-column
v-for="(value, key) in this.tableData[0]"
:key="key"
v-if="key != 'errorMessage' && key != 'line'"
:label="key"
:prop="key"
></el-table-column>
<el-table-column v-for="(value, key) in this.tableData[0]" :key="key"
v-if="key != 'errorMessage' && key != 'line'" :label="key" :prop="key"></el-table-column>
</el-table>
</div>
</template>
...
...
@@ -72,7 +47,7 @@ import {
importFlight,
} from "@/api/flightInfoImport";
export default {
name:"FlightInformationImport",
name:
"FlightInformationImport",
data() {
return {
flightType: [],
...
...
@@ -128,11 +103,11 @@ export default {
importFlight(file, this.form.type).then((res) => {
if (res.code != 200) {
if (res.code == 603) {
this.$alert(res.msg
, "提示", {
this.$alert(res.msg, "提示", {
confirmButtonText: "确定",
type: "warning",
});
}else {
}
else {
this.$message.error(res.msg);
this.tableData = res.data;
}
...
...
@@ -175,6 +150,7 @@ export default {
.upload-demo {
float: right;
}
.el-upload-list {
display: inline-block;
margin-left: 10px;
...
...
src/views/basicInformation/flightInformationMaintenance/index.vue
View file @
238b8b3
...
...
@@ -99,8 +99,8 @@
<el-row>
<el-col :span="12">
<el-form-item label="CutOff时间" prop="cutOffTime">
<el-select class="wid80" v-model="form.cutOffTime" clearable placeholder="选择时间(
hh:mm:ss
)" type="string"
filterable
allow-create default-first-option
>
<el-select class="wid80" v-model="form.cutOffTime" clearable placeholder="选择时间(
可查找
)" type="string"
filterable>
<el-option v-for="item in selectOption.cutOffTime" :key="item" :label="item" :value="item">
</el-option>
</el-select>
...
...
@@ -249,6 +249,7 @@ import {
updateStatusBatch,
updateAutoPushBatch,
} from "@/api/findAllFltData";
import { nowDate } from "@/utils/FedEx.js"
export default {
name: "FlightInformationMaintenance",
data() {
...
...
@@ -411,6 +412,24 @@ export default {
disabled: true,
},
{
name: "总体积(cm³)",
value: "totalVolume",
width: "100",
align: "center",
sorTable: false,
fixed: false,
disabled: true,
},
{
name: "已配体积(cm³)",
value: "alloctedVolume",
width: "120",
align: "center",
sorTable: false,
fixed: false,
disabled: true,
},
{
name: "是否需要预审",
value: "needRequired",
width: "130",
...
...
@@ -465,24 +484,6 @@ export default {
disabled: true,
},
{
name: "总体积(cm³)",
value: "totalVolume",
width: "100",
align: "center",
sorTable: false,
fixed: false,
disabled: true,
},
{
name: "已配体积(cm³)",
value: "alloctedVolume",
width: "120",
align: "center",
sorTable: false,
fixed: false,
disabled: true,
},
{
name: "航班优先级",
value: "priorityName",
width: "100",
...
...
@@ -565,29 +566,53 @@ export default {
//cutOffTime数据
cutOffTime: [
"00:00:00",
"00:30:00",
"01:00:00",
"01:30:00",
"02:00:00",
"02:30:00",
"03:00:00",
"03:30:00",
"04:00:00",
"04:30:00",
"05:00:00",
"05:30:00",
"06:00:00",
"06:30:00",
"07:00:00",
"07:30:00",
"08:00:00",
"08:30:00",
"09:00:00",
"09:30:00",
"10:00:00",
"10:30:00",
"11:00:00",
"11:30:00",
"12:00:00",
"12:30:00",
"13:00:00",
"13:30:00",
"14:00:00",
"14:30:00",
"15:00:00",
"15:30:00",
"16:00:00",
"16:30:00",
"17:00:00",
"17:30:00",
"18:00:00",
"18:30:00",
"19:00:00",
"19:30:00",
"20:00:00",
"20:30:00",
"21:00:00",
"21:30:00",
"22:00:00",
"22:30:00",
"23:00:00",
"23:30:00",
],
},
//选中数组
...
...
@@ -618,8 +643,7 @@ export default {
},
created() {
//查询条件数据源
let date = new Date()
this.queryParams.fltDateStart = `${date.getFullYear()}-${(date.getMonth() + 1) > 9 ? (date.getMonth() + 1) : '0' + (date.getMonth() + 1)}-${(date.getDate()) > 9 ? date.getDate() : '0' + (date.getDate())}`
this.queryParams.fltDateStart = nowDate()
this.findFltConditionData();
if (this.$store.state.tagsView.cachedViews.length == 0) {
this.findAllFltData();
...
...
src/views/basicInformation/queryCargo/index.vue
View file @
238b8b3
...
...
@@ -297,7 +297,7 @@ export default {
},
{
name: "推送状态",
value: "cargo
AllocationData
Status",
value: "cargo
Push
Status",
width: "100",
align: "center",
sorTable: true,
...
...
Please
register
or
login
to post a comment