Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
factory_front
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
qinjianhui
factory_front
Commits
94c98ec1
Commit
94c98ec1
authored
Aug 07, 2025
by
wusiyi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 添加获取物流面单工具
parent
2cd8e045
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
90 additions
and
13 deletions
+90
-13
src/api/common.ts
+15
-3
src/assets/images/package.png
+0
-0
src/components/NavMenu.vue
+75
-10
No files found.
src/api/common.ts
View file @
94c98ec1
...
...
@@ -12,9 +12,7 @@ export function getLogisticsCompanyList() {
}
// 获取客户
export
function
getUserMarkList
()
{
return
axios
.
get
<
never
,
BaseRespData
<
string
[]
>>
(
'dbDiyUser/getUserMarkList'
,
)
return
axios
.
get
<
never
,
BaseRespData
<
string
[]
>>
(
'dbDiyUser/getUserMarkList'
)
}
// 获取用户
...
...
@@ -35,3 +33,17 @@ export function uploadFileApi(data: FormData) {
data
,
)
}
// 获取物流面单 US
export
function
getLogisticUSApi
(
content
:
string
)
{
return
axios
.
get
<
never
,
BaseRespData
<
{
documentUrl
:
string
}
>>
(
`factory/podJomallOrderUs/getDocument?content=
${
content
}
`
,
)
}
// 获取物流面单 CN
export
function
getLogisticCNApi
(
content
:
string
)
{
return
axios
.
get
<
never
,
BaseRespData
<
{
documentUrl
:
string
}
>>
(
`factory/podJomallOrder/getDocument?content=
${
content
}
`
,
)
}
src/assets/images/package.png
0 → 100644
View file @
94c98ec1
23.6 KB
src/components/NavMenu.vue
View file @
94c98ec1
...
...
@@ -113,12 +113,15 @@
</div>
<!-- 右侧工具栏 -->
<div
class=
"tool_warper"
>
<div
title=
"格式工具"
class=
"tool-item"
@
click=
"formatDrawer = true"
>
<img
src=
"../assets/images/brush-no.png"
width=
"24"
height=
"24"
/>
</div>
<div
title=
"
格式工具
"
style=
"cursor: pointer
"
@
click=
"
format
Drawer = true"
title=
"
获取物流面单
"
class=
"tool-item
"
@
click=
"
getLogistic
Drawer = true"
>
<img
src=
"../assets/images/
brush-no
.png"
width=
"24"
height=
"24"
/>
<img
src=
"../assets/images/
package
.png"
width=
"24"
height=
"24"
/>
</div>
</div>
</div>
...
...
@@ -196,12 +199,22 @@
</div>
<
template
#
footer
>
<span
style=
"display: flex; justify-content: center"
>
<el-button
size=
"medium"
@
click=
"formatDrawer = false"
>
取 消
</el-button>
<el-button
size=
"medium"
type=
"primary"
@
click=
"copy"
>
拷 贝
</el-button>
<el-button
@
click=
"formatDrawer = false"
>
取 消
</el-button>
<el-button
type=
"primary"
@
click=
"copy"
>
拷 贝
</el-button>
</span>
</
template
>
</el-drawer>
<el-drawer
v-model=
"getLogisticDrawer"
class=
"get-logistic-drawer"
title=
"获取物流面单"
@
close=
"content = ''"
>
<el-input
v-model=
"content"
placeholder=
"请输入单号"
clearable
/>
<
template
#
footer
>
<span
style=
"display: flex; justify-content: center"
>
<el-button
@
click=
"getLogisticDrawer = false"
>
取 消
</el-button>
<el-button
type=
"primary"
@
click=
"getLogistic"
>
查 询
</el-button>
</span>
</
template
>
</el-drawer>
...
...
@@ -230,6 +243,9 @@ import userUserStore from '@/store/user'
import
type
{
FormRules
}
from
'element-plus'
import
{
useValue
}
from
'@/utils/hooks/useValue'
import
{
changePasswordApi
}
from
'@/api/auth'
import
{
getLogisticUSApi
,
getLogisticCNApi
}
from
'@/api/common'
import
{
filePath
}
from
'@/api/axios'
import
{
ElMessage
}
from
'element-plus'
interface
MenuItem
{
index
:
string
id
:
number
...
...
@@ -255,8 +271,10 @@ const userStore = userUserStore()
const
userInfo
=
userStore
.
user
const
dialogVisible
=
ref
(
false
)
const
formatDrawer
=
ref
(
false
)
const
getLogisticDrawer
=
ref
(
false
)
const
textareaT
=
ref
(
''
)
const
newTextareaT
=
ref
(
''
)
const
content
=
ref
(
''
)
// 密码form
const
[
passwordForm
,
resetPasswordForm
]
=
useValue
<
PasswordForm
>
(
{}
as
PasswordForm
,
...
...
@@ -470,6 +488,7 @@ const confimTools = (v: string) => {
}
}
// 复制
const
copy
=
()
=>
{
const
oInput
=
document
.
createElement
(
'input'
)
oInput
.
value
=
newTextareaT
.
value
...
...
@@ -485,6 +504,40 @@ const copy = () => {
})
}
// 获取物流面单
const
getLogistic
=
()
=>
{
if
(
!
content
.
value
)
{
ElMessage
.
warning
(
'请输入单号'
)
return
}
// 按_分割字符串
const
parts
=
content
.
value
.
split
(
'_'
)
// 检查是否有足够的_分隔符
if
(
parts
.
length
<
4
)
{
ElMessage
.
error
(
'单号格式错误,请检查输入'
)
return
}
// 获取第三个_后面的内容
const
thirdPart
=
parts
[
3
]
if
(
thirdPart
.
startsWith
(
'USPSC'
))
{
// 美国物流
getLogisticUSApi
(
content
.
value
).
then
((
res
)
=>
{
if
(
res
.
code
===
200
)
{
window
.
open
(
filePath
+
res
.
data
.
documentUrl
,
'_blank'
)
}
})
}
else
if
(
thirdPart
.
startsWith
(
'JMPSC'
))
{
// 中国物流
getLogisticCNApi
(
content
.
value
).
then
((
res
)
=>
{
if
(
res
.
code
===
200
)
{
window
.
open
(
filePath
+
res
.
data
.
documentUrl
,
'_blank'
)
}
})
}
else
{
ElMessage
.
error
(
'单号格式错误,请检查输入'
)
}
}
// 监听路由变化,自动添加标签
watch
(
()
=>
route
.
path
,
...
...
@@ -646,4 +699,16 @@ onUnmounted(() => {
top
:
15%
;
right
:
40px
;
}
::v-deep
(
.get-logistic-drawer.el-drawer.rtl
)
{
height
:
20%
!important
;
top
:
35%
!important
;
}
.tool-item
{
width
:
24px
;
height
:
24px
;
cursor
:
pointer
;
margin-bottom
:
10px
;
}
</
style
>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment