Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
梁建民
/
wmsMin
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
32d448e5
authored
May 20, 2024
by
LJM
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
add
parent
6a121254
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
109 additions
and
14 deletions
pages/tally/fixBox.vue
pages/tally/fixBox.vue
View file @
32d448e5
...
...
@@ -19,6 +19,10 @@
</scroll-view>
</view>
<view
class=
"fix-btn row rowCenter verCenter"
@
click=
"fixBox()"
>
合 箱
</view>
<!-- 关单封箱弹窗 -->
<uni-popup
ref=
"inputDialog"
type=
"dialog"
:mask-click=
"true"
@
maskClick=
"maskClick"
>
<uni-popup-dialog
ref=
"inputClose"
mode=
"input"
:title=
"title"
value=
""
confirmText=
"确定"
cancelText=
"取消"
placeholder=
"请输入毛重"
@
close=
"dialogInputClose"
@
confirm=
"dialogInputConfirm"
:before-close=
"true"
></uni-popup-dialog>
</uni-popup>
</view>
</
template
>
...
...
@@ -29,10 +33,14 @@
export
default
{
data
()
{
return
{
email
:
uni
.
getStorageSync
(
'email'
)
||
''
,
//操作人邮箱
is_focus
:
true
,
//获取焦点动态化
keyword
:
''
,
old_box_sn_str
:
''
,
list
:
[]
list
:
[],
title
:
''
,
box_sn
:
''
,
wsty_id
:
''
};
},
watch
:
{
...
...
@@ -106,20 +114,16 @@
}
this
.
request
(
API
.
fixBox
,
'POST'
,
{
old_box_sn_str
:
this
.
old_box_sn_str
},
true
).
then
(
res
=>
{
if
(
res
.
err_code
===
0
)
{
uni
.
showModal
({
title
:
''
,
content
:
'合箱成功'
,
showCancel
:
false
,
success
:
(
res
)
=>
{
if
(
res
.
confirm
)
{
this
.
list
=
[];
// 再次获取焦点
this
.
clearInputAndFocus
();
}
else
if
(
res
.
cancel
)
{
console
.
log
(
'用户点击取消'
);
}
}
uni
.
showToast
({
title
:
'合箱成功'
,
icon
:
'success'
,
duration
:
2000
});
setTimeout
(()
=>
{
this
.
box_sn
=
res
.
data
.
box_sn
;
this
.
wsty_id
=
res
.
data
.
wsty_id
;
this
.
print
();
},
2000
);
}
else
{
uni
.
showToast
({
title
:
res
.
err_msg
,
...
...
@@ -129,6 +133,27 @@
});
},
/**
* 打印箱号
*/
print
()
{
var
params
=
{
type
:
1
,
email
:
this
.
email
,
print_json
:
JSON
.
stringify
([{
box_sn
:
this
.
box_sn
}])
}
this
.
request
(
API
.
addSCTallyData
,
'POST'
,
params
,
true
).
then
(
res
=>
{
if
(
res
.
code
===
0
)
{
this
.
title
=
`箱号
${
this
.
box_sn
}
打印成功`
;
this
.
$refs
.
inputDialog
.
open
();
}
else
{
uni
.
showToast
({
title
:
res
.
msg
,
icon
:
'none'
});
}
});
},
/**
* 删除
*/
deleteFix
(
index
)
{
...
...
@@ -142,6 +167,57 @@
setTimeout
(()
=>
{
this
.
is_focus
=
true
;
},
200
);
},
/**
* 点击遮罩层触发
*/
maskClick
()
{
this
.
$refs
.
inputDialog
.
close
();
},
/**
* 确定
*/
dialogInputConfirm
(
val
)
{
if
(
!
val
)
{
uni
.
showToast
({
title
:
'请输入毛重'
,
icon
:
'error'
});
return
false
;
}
// 判断 val 是否为数字
if
(
isNaN
(
val
))
{
uni
.
showToast
({
title
:
'请输入合法数字'
,
icon
:
'error'
});
return
false
;
}
this
.
request
(
API
.
closeBox
,
'POST'
,
{
wsty_id
:
this
.
wsty_id
,
gross_weight
:
val
,
box_sn
:
this
.
box_sn
},
true
).
then
(
res
=>
{
if
(
res
.
err_code
===
0
)
{
uni
.
showToast
({
title
:
'操作成功'
,
icon
:
'success'
,
duration
:
2000
});
setTimeout
(()
=>
{
this
.
list
=
[];
// 再次获取焦点
this
.
clearInputAndFocus
();
},
2000
);
}
else
{
uni
.
showToast
({
title
:
res
.
err_msg
,
icon
:
'none'
});
}
});
},
/**
* 不需要换箱
*/
dialogInputClose
()
{
this
.
$refs
.
inputDialog
.
close
();
}
}
};
...
...
@@ -149,4 +225,22 @@
<
style
scoped
lang=
"scss"
>
@import
'@/assets/css/tally/fixBox.scss'
;
::v-deep
{
.uni-dialog-input
{
font-size
:
24
rpx
!important
;
}
.uni-dialog-title-text
{
padding
:
10px
;
text-align
:
center
;
color
:
#404547
;
font-size
:
26
rpx
!important
;
font-weight
:
bold
!important
;
}
.uni-dialog-button-group
.uni-dialog-button
:first-child
{
display
:
none
;
}
}
</
style
>
\ 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