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
d9e7b1c6
authored
Sep 25, 2023
by
LJM
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
移动端--盘点单增加标签补打、查询等
parent
171130e2
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
356 additions
and
10 deletions
assets/css/stocktake/operate.scss
pages/stocktake/operate.vue
pages/stocktake/record.vue
util/api.js
assets/css/stocktake/operate.scss
View file @
d9e7b1c6
...
...
@@ -51,9 +51,27 @@
width
:
345rpx
;
background
:
#ffffff
;
box-shadow
:
0px
3rpx
3rpx
0px
rgba
(
198
,
199
,
204
,
0
.3
);
border
:
1px
solid
transparent
;
border-radius
:
10rpx
;
margin-right
:
15rpx
;
margin-bottom
:
15rpx
;
.check-box-icon
{
position
:
absolute
;
right
:
18rpx
;
top
:
17rpx
;
width
:
20rpx
;
height
:
20rpx
;
background
:
url('https://img.ichunt.com/images/ichunt/202304/11/0bf30da3e8ce6c476c210173b5f13d51.png')
no-repeat
center
;
background-size
:
contain
;
display
:
block
;
}
&
.curr
{
border
:
1px
solid
#1969f9
;
.check-box-icon
{
background
:
url('https://img.ichunt.com/images/ichunt/202304/11/71a74e52e94bcf2e89f8df9817d494c6.png')
no-repeat
center
;
background-size
:
contain
;
}
}
&
:nth-of-type
(
2n
)
{
margin-right
:
0
;
}
...
...
@@ -112,6 +130,51 @@
}
}
}
.fix-btn
{
position
:
fixed
;
bottom
:
0
;
width
:
100%
;
left
:
0
;
z-index
:
999
;
.btn1
{
width
:
128rpx
;
height
:
75rpx
;
background
:
#ffffff
;
.check-box-icon
{
width
:
20rpx
;
height
:
20rpx
;
background
:
url('https://img.ichunt.com/images/ichunt/202304/11/0bf30da3e8ce6c476c210173b5f13d51.png')
no-repeat
center
;
background-size
:
contain
;
display
:
block
;
&
.curr
{
background
:
url('https://img.ichunt.com/images/ichunt/202304/11/71a74e52e94bcf2e89f8df9817d494c6.png')
no-repeat
center
;
background-size
:
contain
;
}
}
.text
{
margin-left
:
10rpx
;
font-size
:
20rpx
;
color
:
#484b59
;
}
}
.btn2
{
width
:
calc
(
100%
-
128rpx
);
height
:
75rpx
;
background
:
#1969f9
;
font-size
:
23rpx
;
color
:
#ffffff
;
}
.btn3
{
width
:
180rpx
;
height
:
75rpx
;
background
:
#ffffff
;
font-size
:
23rpx
;
color
:
#ff3700
;
border-left
:
1px
solid
#f0f0f2
;
font-weight
:
bold
;
}
}
.positionListCountText
{
position
:
absolute
;
top
:
30rpx
;
...
...
@@ -155,6 +218,19 @@
font-weight
:
bold
;
}
}
.p-text
{
margin-top
:
38rpx
;
margin-bottom
:
25rpx
;
.tt
{
font-size
:
20rpx
;
color
:
#484b59
;
}
.ed
{
font-weight
:
bold
;
font-size
:
20rpx
;
color
:
#1969f9
;
}
}
.field-item
{
flex-wrap
:
wrap
;
.item
{
...
...
@@ -196,6 +272,9 @@
}
.form-input
{
margin-bottom
:
18rpx
;
.mb0
{
margin-bottom
:
0
!
important
;
}
.input-title
{
margin-bottom
:
10rpx
;
.input-title-t1
{
...
...
@@ -203,6 +282,11 @@
color
:
#484b59
;
font-weight
:
bold
;
}
.input-title-t2
{
font-size
:
16rpx
;
color
:
#484b59
;
font-weight
:
bold
;
}
}
.input-box
{
.uni-input
{
...
...
@@ -213,13 +297,43 @@
text-indent
:
15rpx
;
font-size
:
16rpx
;
}
.uni-list-cell
{
margin-right
:
24rpx
;
.text
{
font-size
:
16rpx
;
color
:
#484b59
;
font-weight
:
bold
;
}
}
}
}
.select-box
{
height
:
55rpx
;
background
:
#ffffff
;
border-radius
:
10rpx
;
border
:
1px
solid
#1969f9
;
margin-bottom
:
18rpx
;
.wrap
{
padding-left
:
15rpx
;
padding-right
:
25rpx
;
height
:
55rpx
;
}
.uni-input
{
font-size
:
17rpx
;
color
:
#484b59
;
}
.uni-arrow
{
width
:
14rpx
;
height
:
9rpx
;
background
:
url('https://img.ichunt.com/images/ichunt/202304/10/e4c72319ad41ce1425f71cc6ec35f111.png')
no-repeat
center
;
background-size
:
contain
;
margin-left
:
12rpx
;
}
}
.item-tit
{
font-size
:
20rpx
;
color
:
#292b33
;
font-weight
:
bold
;
margin-bottom
:
18rpx
;
}
.bor
{
height
:
1px
;
...
...
pages/stocktake/operate.vue
View file @
d9e7b1c6
<
template
>
<view
class=
"stocktake-operate"
>
<view
class=
"positionListCountText"
@
click=
"getPositionListCount()"
>
库位列表
</view>
<!-- 库位 -->
<!-- 库位
搜索
-->
<view
class=
"search-box row bothSide verCenter"
style=
"margin-bottom: 13rpx;width: 85%;"
>
<view
class=
"sn row rowCenter verCenter"
>
<picker
@
change=
"bindPickerChange($event, 1)"
:value=
"index"
:range=
"array"
>
...
...
@@ -19,7 +19,7 @@
<text
class=
"iconfont icon-a-juxing11"
@
click=
"clearInput(1)"
v-if=
"input_flag"
></text>
</view>
</view>
<!-- 入库批次号 -->
<!-- 入库批次号
搜索
-->
<view
class=
"search-box row bothSide verCenter"
style=
"width: 85%;"
>
<view
class=
"sn row rowCenter verCenter"
>
<picker
@
change=
"bindPickerChange($event, 2)"
:value=
"index_batch_sn"
:range=
"array_batch_sn"
>
...
...
@@ -32,17 +32,25 @@
<view
class=
"search-bar row bothSide verCenter"
>
<view
class=
"row verCenter"
>
<text
class=
"iconfont icon-juxing1"
></text>
<template
v-if=
"index_batch_sn == 0"
>
<input
class=
"uni-input"
placeholder=
"请扫描或输入入库批次号"
placeholder-style=
"color:#919399"
v-model=
"searchParams.stock_in_batch_sn"
@
input=
"handleInput($event, 2)"
/>
</
template
>
<
template
v-else-if=
"index_batch_sn == 1"
>
<input
class=
"uni-input"
placeholder=
"请输入货品名称"
placeholder-style=
"color:#919399"
v-model=
"searchParams.goods_name"
@
input=
"handleInput($event, 2)"
/>
</
template
>
</view>
<text
class=
"iconfont icon-a-juxing11"
@
click=
"clearInput(2)"
v-if=
"input_stock_in_batch_sn"
></text>
</view>
</view>
<!-- 待盘点任务数 -->
<view
class=
"total row verCenter"
style=
"margin-top: 15rpx;"
>
<text
class=
"t1"
>
待盘点任务数:
</text>
<text
class=
"t2"
>
{{ list.length }}
</text>
</view>
<!-- 列表 -->
<view
class=
"list row bothSide"
v-if=
"list.length > 0"
>
<view
class=
"box"
v-for=
"(item, index) in list"
:key=
"index"
>
<view
class=
"box"
v-for=
"(item, index) in list"
:key=
"index"
:class=
"{ curr: filter_list[index] }"
>
<view
class=
"check-box-icon"
@
click=
"filterChange(index)"
></view>
<view
class=
"text-item row verCenter"
>
<text
class=
"label"
>
任务ID:
</text>
<text
class=
"t1"
>
{{ item.stocktake_items_id }}
</text>
...
...
@@ -104,7 +112,7 @@
<text
class=
"label"
>
库存总数量:
</text>
<text
class=
"t1"
>
{{ item.stock_qty }}
</text>
</view>
<view
class=
"btn-box row verCenter"
><view
class=
"btn3 row rowCenter verCenter"
@
click=
"showDrawer(item)"
>
选择
</view></view>
<view
class=
"btn-box row verCenter"
><view
class=
"btn3 row rowCenter verCenter"
@
click=
"showDrawer(item
, 1
)"
>
选择
</view></view>
</view>
</view>
<!-- 无数据展示 -->
...
...
@@ -112,6 +120,13 @@
<text
class=
"iconfont icon-a-juxing21"
></text>
<text
class=
"text"
>
查不到当前数据
</text>
</view>
<view
class=
"fix-btn row verCenter"
>
<view
class=
"btn1 row rowCenter verCenter"
@
click=
"allChnage()"
>
<text
class=
"check-box-icon"
:class=
"{ curr: filter_list.length > 0 && filter_list.length == filter_id.length }"
></text>
<text
class=
"text"
>
{{ filter_id.length == 0 ? '全选' : filter_id.length }}
</text>
</view>
<view
class=
"btn2 row rowCenter verCenter"
@
click=
"showDrawer('', 2)"
>
补打入库标签
</view>
</view>
<!-- 详情 -->
<uni-drawer
ref=
"showRight"
mode=
"right"
>
<view
class=
"uni-drawer-detail"
v-if=
"detail"
>
...
...
@@ -192,7 +207,7 @@
<view
class=
"btn row rowCenter verCenter"
><view
class=
"row btn1 row rowCenter verCenter"
style=
"width:100%"
@
click=
"updateStocktakeItemQty()"
>
确认
</view></view>
</view>
</uni-drawer>
<!-- 库位列表 -->
<!-- 库位列表
弹窗
-->
<uni-drawer
ref=
"showRightPosition"
mode=
"right"
>
<view
class=
"uni-drawer-detail"
>
<view
class=
"title row rowCenter verCenter"
>
...
...
@@ -224,11 +239,65 @@
<view
class=
"btn row rowCenter verCenter"
><view
class=
"row btn2 row rowCenter verCenter"
style=
"width:100%"
@
click=
"closeDrawer()"
>
关闭
</view></view>
</view>
</uni-drawer>
<!-- 补打入库标签 -->
<uni-drawer
ref=
"showRightPrintLabel"
mode=
"right"
>
<view
class=
"uni-drawer-detail"
>
<view
class=
"title row rowCenter verCenter"
>
<text
class=
"iconfont icon-juxing2"
@
click=
"closeDrawer()"
></text>
<text
class=
"text"
>
补打入库标签
</text>
</view>
<view
class=
"p-text"
>
<text
class=
"tt"
>
您已选中
</text>
<text
class=
"ed"
>
{{ filter_id.length }}
</text>
<text
class=
"tt"
>
条数据
</text>
</view>
<view
class=
"form-input"
>
<view
class=
"input-title"
:class=
"{ mb0: filter_id.length > 1 }"
><text
class=
"input-title-t2"
>
标签货品数量:
</text></view>
<view
class=
"input-box"
>
<
template
v-if=
"filter_id.length == 1"
>
<input
type=
"number"
inputmode=
"numeric"
class=
"uni-input"
placeholder-style=
"color:#919399"
placeholder=
"请输入"
v-model=
"formParams.label_num"
/>
</
template
>
<
template
v-else
>
<radio-group
@
change=
"radioChange"
class=
"row verCenter"
>
<label
class=
"uni-list-cell row verCenter"
>
<view><radio
value=
"1"
checked=
"checked"
style=
"transform:scale(0.7)"
color=
"#1969f9"
/></view>
<text
class=
"text"
>
按库存数量
</text>
</label>
<label
class=
"uni-list-cell row verCenter"
>
<view><radio
value=
"2"
style=
"transform:scale(0.7)"
color=
"#1969f9"
/></view>
<text
class=
"text"
>
按盘点数量
</text>
</label>
</radio-group>
</
template
>
</view>
</view>
<view
class=
"form-input"
>
<view
class=
"input-title"
><text
class=
"input-title-t2"
>
目标打印机:
</text></view>
<view
class=
"input-box"
><input
type=
"text"
class=
"uni-input"
placeholder-style=
"color:#919399"
placeholder=
"请输入"
v-model=
"formParams.ip"
/></view>
</view>
<view
class=
"form-input"
>
<view
class=
"input-title"
>
<text
class=
"input-title-t1"
>
*
</text>
<text
class=
"input-title-t2"
>
标签版本:
</text>
</view>
<view
class=
"select-box row"
>
<picker
@
change=
"bindPickerChange($event, 4)"
:value=
"tag_version_index"
:range=
"tag_version"
style=
"width: 100%;"
>
<view
class=
"row verCenter bothSide wrap"
>
<view
class=
"uni-input"
>
{{ tag_version_index == -1 ? '请选择' : tag_version[tag_version_index] }}
</view>
<view
class=
"uni-arrow"
></view>
</view>
</picker>
</view>
</view>
<view
class=
"btn row rowCenter verCenter"
><view
class=
"row btn1 row rowCenter verCenter"
style=
"width:100%"
@
click=
"printLabelChange()"
>
打印
</view></view>
</view>
</uni-drawer>
</view>
</template>
<
script
>
import
{
API
}
from
'@/util/api.js'
;
import
{
createArray
}
from
'@/util/util.js'
;
import
debounce
from
'lodash/debounce'
;
export
default
{
data
()
{
...
...
@@ -238,8 +307,10 @@ export default {
index
:
0
,
array
:
[
'库位'
],
filterArr
:
[
'全部'
,
'已盘完'
,
'未盘完'
],
filter_list
:
[],
//筛选已选中的列表
filter_id
:
[],
//过滤处理的id
indexFilter
:
0
,
array_batch_sn
:
[
'入库批次号'
],
array_batch_sn
:
[
'入库批次号'
,
'货品名称'
],
index_batch_sn
:
0
,
stocktake_qty
:
''
,
list
:
[],
...
...
@@ -249,10 +320,21 @@ export default {
stocktake_sn
:
''
,
detail
:
{},
positionListCount
:
[],
tag_version
:
[
'中文标签'
,
'英文标签'
],
tag_version_index
:
0
,
searchParams
:
{
stocktake_id
:
''
,
//盘点单主键id
position_code
:
''
,
//库位编码
stock_in_batch_sn
:
''
//入库批次号
stock_in_batch_sn
:
''
,
//入库批次号
goods_name
:
''
//货品名称
},
formParams
:
{
stocktake_id
:
''
,
stocktake_items_ids
:
''
,
label_num
:
''
,
//标签货品数量
label_num_type
:
1
,
//标签类型
ip
:
''
,
//目标打印机
print_language
:
1
//标签版本
}
};
},
...
...
@@ -278,24 +360,103 @@ export default {
this
.
getData
();
},
methods
:
{
showDrawer
(
data
)
{
/**
* 找出false对应的下标
* @param {Object} arr
* @param {Object} target
*/
findIndex
(
arr
,
target
)
{
const
result
=
[];
arr
.
map
((
item
,
index
)
=>
{
if
(
item
===
target
)
{
result
.
push
(
index
);
}
});
return
result
;
},
/**
* @param {Object} data
* @param {Object} type 1 选择详情 2 补打入库标签
*/
showDrawer
(
data
,
type
)
{
if
(
type
==
1
)
{
//详情
this
.
$refs
.
showRight
.
open
();
this
.
detail
=
data
;
if
(
data
.
is_stocktake
==
0
)
{
this
.
stocktake_qty
=
''
;
}
else
{
this
.
stocktake_qty
=
data
.
stocktake_qty
;
}
}
else
if
(
type
==
2
)
{
//补打入库标签
if
(
this
.
filter_id
.
length
==
0
)
{
uni
.
showToast
({
title
:
'请勾选盘点任务'
,
icon
:
'none'
});
return
false
;
}
if
(
this
.
filter_id
.
length
>
1
)
{
this
.
formParams
.
label_num
=
this
.
filter_id
.
length
;
}
this
.
$refs
.
showRightPrintLabel
.
open
();
}
},
closeDrawer
()
{
this
.
$refs
.
showRight
.
close
();
this
.
$refs
.
showRightPosition
.
close
();
this
.
$refs
.
showRightPrintLabel
.
close
();
},
bindPickerChange
:
function
(
e
,
type
)
{
console
.
log
(
'picker发送选择改变,携带值为'
,
e
.
detail
.
value
);
if
(
type
==
1
)
{
//库位
this
.
index
=
e
.
detail
.
value
;
}
else
if
(
type
==
2
)
{
//入库批次号 && 货品名称
this
.
index_batch_sn
=
e
.
detail
.
value
;
if
(
this
.
index_batch_sn
==
0
)
{
//入库批次号
this
.
searchParams
.
goods_name
=
''
;
}
else
if
(
this
.
index_batch_sn
==
1
)
{
//货品名称
this
.
searchParams
.
stock_in_batch_sn
=
''
;
}
}
else
if
(
type
==
3
)
{
//库位编码筛选
this
.
indexFilter
=
e
.
detail
.
value
;
this
.
getPositionListCount
(
parseInt
(
e
.
detail
.
value
)
+
1
);
}
else
if
(
type
==
4
)
{
//补打入库标签
this
.
tag_version_index
=
e
.
detail
.
value
;
this
.
formParams
.
print_language
=
Number
(
e
.
detail
.
value
)
+
1
;
}
},
radioChange
(
e
)
{
console
.
log
(
'picker发送选择改变,携带值为'
,
e
.
detail
.
value
);
this
.
formParams
.
label_num_type
=
e
.
detail
.
value
;
},
/**
* 筛选过滤出选中的元素
*/
filterChange
(
index
)
{
this
.
$set
(
this
.
filter_list
,
index
,
(
this
.
filter_list
[
index
]
=
!
this
.
filter_list
[
index
]));
let
filter_arr
=
this
.
findIndex
(
this
.
filter_list
,
true
);
this
.
filter_id
=
filter_arr
.
map
(
i
=>
this
.
list
[
i
].
stocktake_items_id
);
},
/**
* 全选
*/
allChnage
()
{
this
.
all_flag
=
!
this
.
all_flag
;
this
.
filter_list
=
createArray
(
this
.
list
.
length
,
this
.
all_flag
);
if
(
this
.
all_flag
)
{
this
.
filter_id
=
this
.
list
.
map
(
function
(
item
)
{
return
item
.
stocktake_items_id
;
});
}
else
{
this
.
filter_id
=
[];
}
},
/**
...
...
@@ -307,7 +468,13 @@ export default {
this
.
searchParams
.
position_code
=
''
;
}
else
if
(
type
==
2
)
{
this
.
input_stock_in_batch_sn
=
false
;
if
(
this
.
index_batch_sn
==
0
)
{
//入库批次号
this
.
searchParams
.
stock_in_batch_sn
=
''
;
}
else
if
(
this
.
index_batch_sn
==
1
)
{
//货品名称
this
.
searchParams
.
goods_name
=
''
;
}
}
this
.
getData
();
},
...
...
@@ -328,9 +495,19 @@ export default {
}
}
else
if
(
type
==
2
)
{
this
.
searchParams
.
stock_in_batch_sn
=
''
;
this
.
searchParams
.
goods_name
=
''
;
if
(
val
)
{
this
.
input_stock_in_batch_sn
=
true
;
if
(
this
.
index_batch_sn
==
0
)
{
//入库批次号
this
.
searchParams
.
stock_in_batch_sn
=
val
;
setTimeout
(()
=>
{
this
.
showDrawer
(
this
.
list
[
0
],
1
);
},
500
);
}
else
if
(
this
.
index_batch_sn
==
1
)
{
//货品名称
this
.
searchParams
.
goods_name
=
val
;
}
}
else
{
this
.
input_stock_in_batch_sn
=
false
;
}
...
...
@@ -345,6 +522,7 @@ export default {
this
.
request
(
API
.
positionListCount
,
'POST'
,
{
stocktake_id
:
this
.
searchParams
.
stocktake_id
,
type
:
type
||
1
},
true
).
then
(
res
=>
{
if
(
res
.
code
===
0
)
{
this
.
positionListCount
=
res
.
data
.
list
;
this
.
filter_list
=
createArray
(
this
.
list
.
length
,
false
);
}
else
{
uni
.
showToast
({
title
:
res
.
msg
,
...
...
@@ -365,6 +543,7 @@ export default {
if
(
res
.
data
.
list
.
length
>
0
)
{
this
.
hasMoreData
=
true
;
this
.
list
=
this
.
list
.
concat
(
res
.
data
.
list
);
this
.
filter_list
=
createArray
(
this
.
list
.
length
,
false
);
}
else
{
this
.
hasMoreData
=
false
;
}
...
...
@@ -376,6 +555,51 @@ export default {
}
});
},
/**
* 盘点标签补打
*/
printLabelChange
()
{
if
(
this
.
filter_id
.
length
==
1
)
{
if
(
!
this
.
formParams
.
label_num
)
{
uni
.
showToast
({
title
:
'请填写标签货品数量'
,
icon
:
'none'
});
return
false
;
}
}
if
(
!
this
.
formParams
.
ip
)
{
uni
.
showToast
({
title
:
'请填写目标打印机'
,
icon
:
'none'
});
return
false
;
}
this
.
request
(
API
.
printLabel
,
'POST'
,
this
.
formParams
,
true
).
then
(
res
=>
{
if
(
res
.
code
===
0
)
{
uni
.
showToast
({
title
:
'操作成功'
,
icon
:
'success'
});
setTimeout
(()
=>
{
this
.
resetChange
();
this
.
getData
();
this
.
closeDrawer
();
},
2000
);
}
else
{
uni
.
showModal
({
itle
:
'提示'
,
content
:
res
.
msg
,
showCancel
:
false
});
}
});
},
/**
* 更新操作
*/
updateStocktakeItemQty
()
{
this
.
request
(
API
.
updateStocktakeItemQty
,
'POST'
,
{
stocktake_items_id
:
this
.
detail
.
stocktake_items_id
,
stocktake_qty
:
this
.
stocktake_qty
},
true
).
then
(
res
=>
{
if
(
res
.
code
===
0
)
{
...
...
pages/stocktake/record.vue
View file @
d9e7b1c6
...
...
@@ -239,7 +239,11 @@ export default {
showDrawer
(
data
)
{
this
.
$refs
.
showRight
.
open
();
this
.
detail
=
data
;
if
(
data
.
is_stocktake
==
0
)
{
this
.
stocktake_qty
=
''
;
}
else
{
this
.
stocktake_qty
=
data
.
stocktake_qty
;
}
},
closeDrawer
()
{
this
.
$refs
.
showRight
.
close
();
...
...
util/api.js
View file @
d9e7b1c6
...
...
@@ -302,7 +302,11 @@ const API = {
/**
* H5盘点库位列表统计
* */
positionListCount
:
API_BASE
+
'/api/h5/stocktake/positionListCount'
positionListCount
:
API_BASE
+
'/api/h5/stocktake/positionListCount'
,
/**
* 盘点标签补打
* */
printLabel
:
API_BASE
+
'/api/h5/stocktake/printLabel'
}
...
...
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