Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
梁建民
/
wmsApp
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
de3ab8c6
authored
Apr 26, 2023
by
LJM
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
打印快递单
parent
79b1e387
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
91 additions
and
78 deletions
pages/repairPrint/index.vue
pages/stockRecheck/print.vue
util/api.js
util/util.js
pages/repairPrint/index.vue
View file @
de3ab8c6
...
...
@@ -16,13 +16,13 @@
</view>
<text
class=
"iconfont icon-a-juxing11"
></text>
</view>
<view
class=
"search-bar row bothSide verCenter"
>
<view
class=
"row verCenter"
>
<text
class=
"iconfont icon-juxing1"
></text>
<input
class=
"uni-input"
v-model=
"formParams.print_num"
placeholder=
"数量"
placeholder-style=
"color:#919399"
/>
</view>
<text
class=
"iconfont icon-a-juxing11"
></text>
</view>
<view
class=
"search-bar row bothSide verCenter"
>
<view
class=
"row verCenter"
>
<text
class=
"iconfont icon-juxing1"
></text>
<input
class=
"uni-input"
v-model=
"formParams.print_num"
placeholder=
"数量"
placeholder-style=
"color:#919399"
/>
</view>
<text
class=
"iconfont icon-a-juxing11"
></text>
</view>
</view>
<view
class=
"fix-btn row rowCenter verCenter"
@
click=
"latePrint()"
>
打印
</view>
</view>
...
...
@@ -36,69 +36,67 @@ export default {
data
()
{
return
{
index
:
0
,
labelStyles
:
[
{
'id'
:
5
,
'name'
:
'入库标签'
,
},
{
'id'
:
1
,
'name'
:
'库位标签'
,
},
{
'id'
:
2
,
'name'
:
'库区标签'
,
},
{
'id'
:
3
,
'name'
:
'区域标签'
,
},
{
'id'
:
4
,
'name'
:
'容器标签'
,
},
],
formParams
:
{
sn
:
''
,
origin_device_ip
:
''
,
print_num
:
''
,
type
:
''
}
labelStyles
:
[
{
id
:
5
,
name
:
'入库标签'
},
{
id
:
1
,
name
:
'库位标签'
},
{
id
:
2
,
name
:
'库区标签'
},
{
id
:
3
,
name
:
'区域标签'
},
{
id
:
4
,
name
:
'容器标签'
}
],
formParams
:
{
sn
:
''
,
origin_device_ip
:
''
,
print_num
:
''
,
type
:
''
}
};
},
onLoad
(
options
)
{
this
.
formParams
.
type
=
this
.
labelStyles
[
0
].
id
;
},
onLoad
(
options
)
{
this
.
formParams
.
type
=
this
.
labelStyles
[
0
].
id
;
},
methods
:
{
bindPickerChange
:
function
(
e
)
{
console
.
log
(
'picker发送选择改变,携带值为'
,
e
.
detail
.
value
);
console
.
log
(
'picker发送选择改变,id为'
,
this
.
labelStyles
[
e
.
detail
.
value
].
id
);
this
.
index
=
e
.
detail
.
value
;
this
.
formParams
.
type
=
this
.
labelStyles
[
e
.
detail
.
value
].
id
;
this
.
formParams
.
type
=
this
.
labelStyles
[
e
.
detail
.
value
].
id
;
},
/**
* 打印
*/
latePrint
()
{
this
.
formParams
.
origin_device_ip
=
getLocalIpAddress
()
??
''
;
console
.
log
(
'origin_device_ip'
,
this
.
formParams
.
origin_device_ip
)
this
.
request
(
API
.
latePrint
,
'POST'
,
this
.
formParams
,
true
).
then
(
res
=>
{
if
(
res
.
code
===
0
)
{
uni
.
showToast
({
title
:
'正在补打...'
,
icon
:
'success'
});
}
else
{
uni
.
showToast
({
title
:
res
.
msg
,
icon
:
'error'
});
}
});
},
/**
* 打印
*/
latePrint
()
{
this
.
formParams
.
origin_device_ip
=
getLocalIpAddress
()
||
''
;
console
.
log
(
'origin_device_ip'
,
this
.
formParams
.
origin_device_ip
);
this
.
request
(
API
.
latePrint
,
'POST'
,
this
.
formParams
,
true
).
then
(
res
=>
{
if
(
res
.
code
===
0
)
{
uni
.
showToast
({
title
:
'正在补打...'
,
icon
:
'success'
});
}
else
{
uni
.
showToast
({
title
:
res
.
msg
,
icon
:
'error'
});
}
});
}
}
};
</
script
>
...
...
pages/stockRecheck/print.vue
View file @
de3ab8c6
This diff is collapsed.
Click to expand it.
util/api.js
View file @
de3ab8c6
...
...
@@ -144,13 +144,21 @@ const API = {
* */
getStockOutDetail
:
API_BASE
+
'/api/stockOut/getStockOutDetail'
,
/**
* 保存交货信息
* */
updateDeliveryInfo
:
API_BASE
+
'/api/stockRecheck/updateDeliveryInfo'
,
/**
* 打印快递单
* */
printExpress
:
API_BASE
+
'/api/stockRecheck/printExpress'
,
/**
* 上传文件
* */
upload
:
API_BASE_LIEXIN
+
'/oss/upload'
,
/**
* 标签补打
* */
latePrint
:
API_BASE
+
'/api/label/latePrint'
,
/**
* 标签补打
* */
latePrint
:
API_BASE
+
'/api/label/latePrint'
,
}
...
...
util/util.js
View file @
de3ab8c6
...
...
@@ -36,6 +36,12 @@ const request = (url = '', type = 'GET', param = {}, Loading) => {
uni
.
hideLoading
();
}
let
[
error
,
res
]
=
response
;
if
(
res
.
data
.
code
==
101
)
{
uni
.
navigateTo
({
url
:
'/pages/mine/login'
})
return
false
;
}
resolve
(
res
.
data
);
}).
catch
(
error
=>
{
uni
.
showToast
({
...
...
@@ -53,17 +59,17 @@ const request = (url = '', type = 'GET', param = {}, Loading) => {
*/
const
getLocalIpAddress
=
()
=>
{
uni
.
getConnectedWifi
({
success
:
res
=>
{
console
.
log
(
'获取到 WiFi 信息:'
,
res
)
const
ipRegex
=
/
\d
+
\.\d
+
\.\d
+
\.\d
+/
const
ipAddress
=
res
.
ipAddress
.
match
(
ipRegex
)[
0
]
console
.
log
(
'当前 WiFi ip 地址:'
,
ipAddress
)
return
ipAddress
},
fail
:
err
=>
{
console
.
log
(
'获取 WiFi 信息失败:'
,
err
)
return
''
}
success
:
res
=>
{
console
.
log
(
'获取到 WiFi 信息:'
,
res
)
const
ipRegex
=
/
\d
+
\.\d
+
\.\d
+
\.\d
+/
const
ipAddress
=
res
.
ipAddress
.
match
(
ipRegex
)[
0
]
console
.
log
(
'当前 WiFi ip 地址:'
,
ipAddress
)
return
ipAddress
},
fail
:
err
=>
{
console
.
log
(
'获取 WiFi 信息失败:'
,
err
)
return
''
}
})
}
...
...
@@ -97,5 +103,5 @@ module.exports = {
request
,
getPlatform
,
createArray
,
getLocalIpAddress
,
getLocalIpAddress
,
}
\ No newline at end of file
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