Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tianjin
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
徐来柯
tianjin
Commits
224d0500
Commit
224d0500
authored
Jan 08, 2021
by
徐来柯
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
2e215bdd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
93 additions
and
0 deletions
+93
-0
MaterialWarehousingMoudle.vue
src/views/education/MaterialWarehousingMoudle.vue
+93
-0
No files found.
src/views/education/MaterialWarehousingMoudle.vue
View file @
224d0500
...
@@ -102,6 +102,9 @@ export default {
...
@@ -102,6 +102,9 @@ export default {
typeV
:
''
,
typeV
:
''
,
}
}
},
},
mounted
()
{
this
.
scanGunCode
()
},
methods
:
{
methods
:
{
handleSelectionChange
(
val
)
{
handleSelectionChange
(
val
)
{
this
.
checkList
=
val
this
.
checkList
=
val
...
@@ -114,6 +117,96 @@ export default {
...
@@ -114,6 +117,96 @@ export default {
this
.
tableData
=
this
.
AllTableData
.
slice
((
num
-
1
)
*
this
.
pageSize
+
1
,
this
.
pageSize
*
num
)
this
.
tableData
=
this
.
AllTableData
.
slice
((
num
-
1
)
*
this
.
pageSize
+
1
,
this
.
pageSize
*
num
)
}
}
},
},
// 扫码枪扫码
scanGunCode
()
{
let
barCode
=
''
let
lastTime
,
nextTime
let
lastCode
,
nextCode
window
.
document
.
onkeypress
=
e
=>
{
if
(
this
.
loading
)
{
// 防止高频率扫码,只能扫一次
return
}
if
(
window
.
event
)
{
// IE
nextCode
=
e
.
keyCode
}
else
if
(
e
.
which
)
{
// Netscape/Firefox/Opera
nextCode
=
e
.
which
}
if
(
e
.
which
===
13
)
{
if
(
barCode
.
length
<
3
)
return
// 手动输入的时间不会让code的长度大于2,所以这里只会对扫码枪有
console
.
log
(
barCode
)
console
.
log
(
'扫码结束'
)
// this.loading = true
const
cacheCode
=
barCode
// request({
// url: `/returnOrder/scanCodeForReturnOrder/${this.$route.query.id}`,
// method: 'put',
// data: {
// barcode: cacheCode
// }
// })
// .then(res => {
// this.loading = false
// if (res.data.code === 200) {
// if (res.data.data.returnInfo.length === 1) {
// // 只有一个商品直接更新数量
// const data = res.data.data.returnInfo[0]
// request({
// url: `/returnOrder/returnOrderGoods/${data.id}`,
// method: 'put',
// data: {
// ...data,
// realNum: data.realNum + 1,
// code: cacheCode
// }
// }).then(res => {
// if (res.data.code === 200) {
// this.$message.success('扫描成功')
// this.print(data.id)
// this.getDetails(true)
// }
// })
// } else if (res.data.data.returnInfo.length >= 2) {
// // 多个商品弹窗
// this.editModal = {
// loading: false,
// type: 12,
// show: true,
// editData: res.data.data,
// code: cacheCode
// }
// }
// }
// })
// .catch(() => {
// this.loading = false
// })
barCode
=
''
lastCode
=
''
lastTime
=
''
return
}
nextTime
=
new
Date
().
getTime
()
if
(
!
lastTime
&&
!
lastCode
)
{
console
.
log
(
'扫码开始。。。'
)
barCode
+=
e
.
key
}
if
(
lastCode
&&
lastTime
&&
nextTime
-
lastTime
>
500
)
{
// 当扫码前有keypress事件时,防止首字缺失
console
.
log
(
'防止首字缺失。。。'
)
barCode
=
e
.
key
}
else
if
(
lastCode
&&
lastTime
)
{
console
.
log
(
'扫码中。。。'
)
barCode
+=
e
.
key
}
lastCode
=
nextCode
lastTime
=
nextTime
console
.
log
(
lastCode
)
}
},
delData
()
{
delData
()
{
if
(
this
.
checkList
.
length
===
0
)
{
if
(
this
.
checkList
.
length
===
0
)
{
this
.
deleteShow
=
true
this
.
deleteShow
=
true
...
...
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