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
2f87ba70
authored
Apr 28, 2023
by
LJM
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
css
parent
3559ec05
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
375 additions
and
86 deletions
assets/css/putaway/record.scss
pages/putaway/index.vue
pages/putaway/record.vue
pages/putaway/single.vue
util/api.js
assets/css/putaway/record.scss
View file @
2f87ba70
...
...
@@ -40,6 +40,17 @@
}
}
}
.radio-wrap
{
padding
:
22rpx
0
;
label
{
margin-right
:
10rpx
;
}
text
{
font-size
:
18rpx
;
color
:
#292b33
;
margin-left
:
5rpx
;
}
}
.list
{
margin-top
:
15rpx
;
padding-bottom
:
150rpx
;
...
...
@@ -54,6 +65,7 @@
border-radius
:
10rpx
;
margin-right
:
15rpx
;
margin-bottom
:
15rpx
;
border
:
1px
solid
transparent
;
.check-box-icon
{
position
:
absolute
;
right
:
18rpx
;
...
...
pages/putaway/index.vue
View file @
2f87ba70
...
...
@@ -30,7 +30,7 @@
</view>
<view
class=
"text-item row verCenter"
>
<text
class=
"label"
>
仓库:
</text>
<text
class=
"t
t
"
>
{{
item
.
warehouse_name
}}
</text>
<text
class=
"t
1
"
>
{{
item
.
warehouse_name
}}
</text>
</view>
<view
class=
"bor row"
></view>
<view
class=
"text-item row verCenter"
>
...
...
@@ -101,11 +101,6 @@
</picker>
</view>
</view>
<view
class=
"tip-box row verCenter"
>
<text
class=
"iconfont icon-a-juxing4"
></text>
<text
class=
"t1"
>
按数量推荐库位:
</text>
<text
class=
"t2"
>
A001、A002、A003
</text>
</view>
</view>
<view
class=
"btn row verCenter bothSide"
>
<view
class=
"btn1 row rowCenter verCenter"
@
click=
"closeDrawer()"
>
取 消
</view>
...
...
@@ -171,12 +166,23 @@ export default {
});
return
false
;
}
//筛选出所选的仓库
let
filter_arr
=
this
.
findIndex
(
this
.
filter_list
,
true
);
var
warehouse_id
=
filter_arr
.
map
(
i
=>
this
.
list
[
i
].
warehouse_id
);
var
stock_in_type
=
filter_arr
.
map
(
i
=>
this
.
list
[
i
].
stock_in_type
);
let
warehouse_id
=
filter_arr
.
map
(
i
=>
this
.
list
[
i
].
warehouse_id
);
let
stock_in_type
=
filter_arr
.
map
(
i
=>
this
.
list
[
i
].
stock_in_type
);
let
isAllElementsEqual
=
warehouse_id
.
every
(
val
=>
val
===
warehouse_id
[
0
]);
this
.
getWhPositionList
(
7
,
stock_in_type
[
0
]);
this
.
$refs
.
showRight
.
open
();
if
(
isAllElementsEqual
)
{
this
.
$refs
.
showRight
.
open
();
this
.
getWhPositionList
(
warehouse_id
[
0
],
stock_in_type
[
0
]);
}
else
{
uni
.
showToast
({
title
:
'请勾选相同仓库'
,
icon
:
'error'
});
return
false
;
}
},
closeDrawer
()
{
this
.
$refs
.
showRight
.
close
();
...
...
@@ -275,10 +281,6 @@ export default {
});
},
/**
* 查询可用的上架规则
*/
getWorkingRuleList
()
{},
/**
* 一键上架
*/
oneKeyPutawayAction
()
{
...
...
pages/putaway/record.vue
View file @
2f87ba70
...
...
@@ -12,93 +12,128 @@
<view
class=
"search-bar row bothSide verCenter"
>
<view
class=
"row verCenter"
>
<text
class=
"iconfont icon-juxing1"
></text>
<input
class=
"uni-input"
placeholder=
"请扫描或输入号码"
placeholder-style=
"color:#919399"
/>
<template
v-if=
"index == 0"
>
<input
class=
"uni-input"
placeholder=
"请扫描或输入入库单号"
placeholder-style=
"color:#919399"
v-model=
"searchParams.search_keyword"
@
input=
"handleInput"
/>
</
template
>
<
template
v-else-if=
"index == 1"
>
<input
class=
"uni-input"
placeholder=
"请扫描或输入入库批次 "
placeholder-style=
"color:#919399"
v-model=
"searchParams.search_keyword"
@
input=
"handleInput"
/>
</
template
>
<
template
v-else-if=
"index == 2"
>
<input
class=
"uni-input"
placeholder=
"请扫描或输入销售员名"
placeholder-style=
"color:#919399"
v-model=
"searchParams.search_keyword"
@
input=
"handleInput"
/>
</
template
>
<
template
v-else-if=
"index == 3"
>
<input
class=
"uni-input"
placeholder=
"请扫描或输入入仓号"
placeholder-style=
"color:#919399"
v-model=
"searchParams.search_keyword"
@
input=
"handleInput"
/>
</
template
>
<
template
v-else-if=
"index == 4"
>
<input
class=
"uni-input"
placeholder=
"请扫描或输入理货容器编码"
placeholder-style=
"color:#919399"
v-model=
"searchParams.search_keyword"
@
input=
"handleInput"
/>
</
template
>
</view>
<text
class=
"iconfont icon-a-juxing11"
></text>
<text
class=
"iconfont icon-a-juxing11"
@
click=
"clearInput()"
v-if=
"input_flag"
></text>
</view>
</view>
<view
class=
"list row bothSide"
>
<view
class=
"box"
v-for=
"(item, index) in 10"
>
<view
class=
"check-box-icon"
></view>
<view
class=
"radio-wrap row verCenter"
>
<radio-group
name=
"radio"
@
change=
"radioChange"
>
<label>
<radio
value=
"0"
style=
"transform:scale(0.7)"
checked=
"true"
color=
"#1969f9"
/>
<text>
全部
</text>
</label>
<label>
<radio
value=
"1"
style=
"transform:scale(0.7)"
color=
"#1969f9"
/>
<text>
暂存
</text>
</label>
<label>
<radio
value=
"2"
style=
"transform:scale(0.7)"
color=
"#1969f9"
/>
<text>
提交
</text>
</label>
</radio-group>
</view>
<view
class=
"list row bothSide"
v-if=
"list.length > 0"
>
<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"
>
入库批次号:
</text>
<text
class=
"t1"
>
A00001
</text>
<text
class=
"t1"
>
{{ item.stock_in_batch_sn }}
</text>
</view>
<view
class=
"text-item row verCenter"
>
<text
class=
"label"
>
入库单号:
</text>
<text
class=
"t1"
>
ASN201010001
</text>
<text
class=
"t1"
>
{{ item.stock_in_sn }}
</text>
</view>
<view
class=
"text-item row verCenter"
>
<text
class=
"label"
>
入仓号:
</text>
<text
class=
"t1"
>
A12345
</text>
<text
class=
"t1"
>
{{ item.inhouse }}
</text>
</view>
<view
class=
"bor row"
></view>
<view
class=
"text-item row verCenter"
>
<text
class=
"label"
>
货品名称:
</text>
<text
class=
"tt"
>
ASD3DAADS22
</text>
<text
class=
"tt"
>
{{ item.goods_name }}
</text>
</view>
<view
class=
"text-item row verCenter"
>
<text
class=
"label"
>
标准品牌:
</text>
<text
class=
"tt"
>
ASD3DAADS22
</text>
<text
class=
"tt"
>
{{ item.goods_sn }}
</text>
</view>
<view
class=
"text-item row verCenter"
>
<text
class=
"label"
>
上架数量:
</text>
<text
class=
"tt"
>
1000
</text>
<text
class=
"tt"
>
{{ item.qty_on_shelf }}
</text>
</view>
<view
class=
"text-item row verCenter"
>
<text
class=
"label"
>
当前状态:
</text>
<text
class=
"t1"
>
ASD3DAADS22
</text>
<text
class=
"t1"
>
{{ item.shelf_status }}
</text>
</view>
<view
class=
"text-item row verCenter"
>
<text
class=
"label"
>
库 位:
</text>
<text
class=
"tt"
>
21212
</text>
<text
class=
"tt"
>
{{ item.position_name }}
</text>
</view>
<view
class=
"text-item row verCenter"
>
<text
class=
"label"
>
容 器:
</text>
<text
class=
"tt"
>
21212
</text>
<text
class=
"tt"
>
{{ item.container_name }}
</text>
</view>
<view
class=
"text-item row verCenter"
>
<text
class=
"label"
>
销 售 员:
</text>
<text
class=
"tt"
>
冯琰民
</text>
<text
class=
"tt"
>
{{ item.sale_user }}
</text>
</view>
<view
class=
"text-item row verCenter"
>
<text
class=
"label"
>
采 购 员:
</text>
<text
class=
"tt"
>
青彪
</text>
<text
class=
"tt"
>
{{ item.purchase_user }}
</text>
</view>
<view
class=
"btn-box row"
><view
class=
"btn row rowCenter verCenter"
@
click=
"showDrawer()"
>
详情
</view></view>
<view
class=
"btn-box row"
><view
class=
"btn row rowCenter verCenter"
@
click=
"showDrawer(
item.id
)"
>
详情
</view></view>
</view>
</view>
<!-- 无数据展示 -->
<view
class=
"no-date column rowCenter verCenter"
v-else
>
<text
class=
"iconfont icon-a-juxing21"
></text>
<text
class=
"text"
>
查不到当前数据
</text>
</view>
<view
class=
"fix-btn row verCenter"
>
<view
class=
"btn1 row rowCenter verCenter"
style=
"width: 127rpx;"
>
<text
class=
"check-box-icon
curr
"
></text>
<view
class=
"btn1 row rowCenter verCenter"
style=
"width: 127rpx;"
@
click=
"allChnage()"
>
<text
class=
"check-box-icon
"
:class=
"{ curr: filter_list.length > 0 && filter_list.length == filter_id.length }
"
></text>
<text
class=
"text"
>
全选
</text>
</view>
<view
class=
"btn3 row rowCenter verCenter"
>
取消上架
</view>
<view
class=
"btn2 row rowCenter verCenter"
style=
"width: calc(100% - 308rpx);"
@
click=
"submit
(
)"
>
提 交
</view>
<view
class=
"btn3 row rowCenter verCenter"
@
click=
"cancelShelfRecord(1)"
>
取消上架
</view>
<view
class=
"btn2 row rowCenter verCenter"
style=
"width: calc(100% - 308rpx);"
@
click=
"submit
OnShelf(1
)"
>
提 交
</view>
</view>
<!-- 上架记录详情弹窗 -->
<uni-drawer
ref=
"showRight"
mode=
"right"
>
<view
class=
"uni-drawer-tally-receive-detail"
>
<view
class=
"uni-drawer-tally-receive-detail"
v-if=
"detail"
>
<view
class=
"title row rowCenter verCenter"
>
<text
class=
"iconfont icon-juxing2"
@
click=
"closeDrawer()"
></text>
<text
class=
"text"
>
上架记录
详情
</text>
<text
class=
"text"
>
{{ detail.stock_in_batch_sn }}-
详情
</text>
</view>
<view
class=
"field-item row"
style=
"margin-top: 39rpx;"
>
<view
class=
"item row verCenter"
>
<text
class=
"label"
>
入库批次号:
</text>
<text
class=
"text"
>
ASN2201010001
</text>
<text
class=
"text"
>
{{ detail.stock_in_batch_sn }}
</text>
</view>
<view
class=
"item row verCenter"
>
<text
class=
"label"
>
入 仓 号:
</text>
<text
class=
"text"
>
A65512
</text>
<text
class=
"text"
>
{{ detail.inhouse }}
</text>
</view>
<view
class=
"item row verCenter"
>
<text
class=
"label"
>
入库单号:
</text>
<text
class=
"text"
>
SF2135661465161
</text>
<text
class=
"text"
>
{{ detail.stock_in_sn }}
</text>
</view>
<view
class=
"item row verCenter"
>
<text
class=
"label"
>
当前状态:
</text>
<text
class=
"tt"
>
上架
</text>
<text
class=
"tt"
>
{{ detail.shelf_status_cn }}
</text>
</view>
</view>
<view
class=
"bor"
></view>
...
...
@@ -106,97 +141,89 @@
<view
class=
"field-item row"
>
<view
class=
"item row verCenter"
style=
"flex: 0 0 100%;"
>
<text
class=
"label"
>
货品编码:
</text>
<text
class=
"tt"
style=
"max-width: 100%;"
>
6546546416541654665
</text>
<text
class=
"tt"
style=
"max-width: 100%;"
>
{{ detail.goods_sn }}
</text>
</view>
<view
class=
"item row verCenter"
style=
"flex: 0 0 100%;"
>
<text
class=
"label"
>
货品名称:
</text>
<text
class=
"tt"
style=
"max-width: 100%;"
>
ASD3DAADS22
</text>
<text
class=
"tt"
style=
"max-width: 100%;"
>
{{ detail.goods_name }}
</text>
</view>
<view
class=
"item row verCenter"
style=
"flex: 0 0 100%;"
>
<text
class=
"label"
>
标准品牌:
</text>
<text
class=
"tt"
style=
"max-width: 100%;"
>
Nexperia
</text>
<text
class=
"tt"
style=
"max-width: 100%;"
>
{{ detail.brand_name }}
</text>
</view>
<view
class=
"item row verCenter"
>
<text
class=
"label"
>
D / C:
</text>
<text
class=
"tt"
>
22+
</text>
<text
class=
"tt"
>
{{ detail.date_code }}
</text>
</view>
<view
class=
"item row verCenter"
>
<text
class=
"label"
>
产 地:
</text>
<text
class=
"tt"
>
美国
</text>
<text
class=
"tt"
>
{{ detail.coo }}
</text>
</view>
<view
class=
"item row verCenter"
style=
"flex: 0 0 100%;"
>
<text
class=
"label"
>
货品品质:
</text>
<text
class=
"tt"
>
良品
</text>
<text
class=
"tt"
>
{{ detail.quality_cn }}
</text>
</view>
<view
class=
"item row verCenter"
style=
"flex: 0 0 100%;margin-bottom: 17rpx;"
>
<text
class=
"label"
>
其他批次属性:
</text>
<text
class=
"tt"
>
-
</text>
<text
class=
"tt"
>
{{ detail.other_batch_attr }}
</text>
</view>
</view>
<view
class=
"bor"
></view>
<view
class=
"field-item row"
>
<view
class=
"item row verCenter"
>
<text
class=
"label"
>
上架数量:
</text>
<text
class=
"tt"
>
100000
</text>
<text
class=
"tt"
>
{{ detail.qty_on_shelf }}
</text>
</view>
<view
class=
"item row verCenter"
>
<text
class=
"label"
>
单 位:
</text>
<text
class=
"tt"
>
PCS
</text>
<text
class=
"tt"
>
{{ detail.goods_unit }}
</text>
</view>
<view
class=
"item row verCenter"
>
<text
class=
"label"
>
库 位:
</text>
<text
class=
"tt"
>
A0001
</text>
<text
class=
"tt"
>
{{ detail.position_name }}
</text>
</view>
<view
class=
"item row verCenter"
>
<text
class=
"label"
>
容 器:
</text>
<text
class=
"tt"
>
RQ001
</text>
<text
class=
"tt"
>
{{ detail.container_name }}
</text>
</view>
</view>
<view
class=
"bor"
></view>
<view
class=
"field-item row"
>
<view
class=
"item row verCenter"
>
<text
class=
"label"
>
销 售 员:
</text>
<text
class=
"tt"
>
100000
</text>
<text
class=
"tt"
>
{{ detail.sale_user }}
</text>
</view>
<view
class=
"item row verCenter"
>
<text
class=
"label"
>
采 购 员:
</text>
<text
class=
"tt"
>
PCS
</text>
<text
class=
"tt"
>
{{ detail.purchase_user }}
</text>
</view>
<view
class=
"item row verCenter"
style=
"flex: 0 0 100%;"
>
<text
class=
"label"
>
客 户:
</text>
<text
class=
"tt"
>
深圳市猎芯科技有限公司
</text>
<text
class=
"tt"
>
{{ detail.customer_name }}
</text>
</view>
</view>
<view
class=
"bor"
></view>
<view
class=
"field-item row"
>
<view
class=
"item row verCenter"
>
<text
class=
"label"
>
上架时间:
</text>
<text
class=
"tt"
>
2023-04-01 11:28:59
</text>
<text
class=
"tt"
>
{{ detail.create_time }}
</text>
</view>
<view
class=
"item row verCenter"
>
<text
class=
"label"
>
上架人:
</text>
<text
class=
"tt"
>
拾贰
</text>
</view>
<view
class=
"item row verCenter"
>
<text
class=
"label"
>
质检时间:
</text>
<text
class=
"tt"
>
2023-04-01 11:28:59
</text>
</view>
<view
class=
"item row verCenter"
>
<text
class=
"label"
>
质 检 人:
</text>
<text
class=
"tt"
>
拾贰
</text>
<text
class=
"tt"
>
{{ detail.create_name }}
</text>
</view>
<view
class=
"item row verCenter"
>
<text
class=
"label"
>
理货时间:
</text>
<text
class=
"tt"
>
2023-04-01 11:28:59
</text>
<text
class=
"tt"
>
{{ detail.stock_tally_time }}
</text>
</view>
<view
class=
"item row verCenter"
>
<text
class=
"label"
>
理 货 人:
</text>
<text
class=
"tt"
>
拾贰
</text>
<text
class=
"tt"
>
{{ detail.stock_tally_user }}
</text>
</view>
</view>
<view
class=
"btn row verCenter bothSide"
>
<view
class=
"btn1 row rowCenter verCenter"
>
取消上架
</view>
<view
class=
"btn2 row rowCenter verCenter"
>
提交
</view>
<view
class=
"btn1 row rowCenter verCenter"
@
click=
"cancelShelfRecord(2, detail.id)"
>
取消上架
</view>
<view
class=
"btn2 row rowCenter verCenter"
@
click=
"submitOnShelf(2, detail.id)"
>
提交
</view>
</view>
</view>
</uni-drawer>
...
...
@@ -205,36 +232,260 @@
<
script
>
import
{
API
}
from
'@/util/api.js'
;
import
{
createArray
}
from
'@/util/util.js'
;
import
debounce
from
'lodash/debounce'
;
export
default
{
data
()
{
return
{
input_flag
:
false
,
page
:
1
,
limit
:
1000
,
index
:
0
,
array
:
[
'入库单号'
,
'入库批次号'
,
'销售员'
,
'入仓号'
,
'理货容器'
]
array
:
[
'入库单号'
,
'入库批次号'
,
'销售员'
,
'入仓号'
,
'理货容器'
],
list
:
[],
filter_list
:
[],
//筛选已选中的列表
filter_id
:
[],
//过滤处理的id
detail
:
{},
searchParams
:
{
search_type
:
1
,
search_keyword
:
''
,
shelf_status
:
0
}
};
},
onLoad
()
{},
onShow
()
{
this
.
getData
();
},
methods
:
{
radioChange
(
e
)
{
this
.
searchParams
.
shelf_status
=
e
.
detail
.
value
;
this
.
getData
();
},
bindPickerChange
:
function
(
e
)
{
console
.
log
(
'picker发送选择改变,携带值为'
,
e
.
detail
.
value
);
this
.
index
=
e
.
detail
.
value
;
this
.
searchParams
.
search_type
=
parseInt
(
this
.
index
)
+
1
;
},
showDrawer
()
{
this
.
$refs
.
showRight
.
open
(
);
showDrawer
(
id
)
{
this
.
onShelfRecordInfo
(
id
);
},
closeDrawer
()
{
this
.
$refs
.
showRight
.
close
();
},
submit
()
{
/**
* 找出false对应的下标
* @param {Object} arr
* @param {Object} target
*/
findIndex
(
arr
,
target
)
{
const
result
=
[];
arr
.
map
((
item
,
index
)
=>
{
if
(
item
===
target
)
{
result
.
push
(
index
);
}
});
return
result
;
},
/**
* 筛选过滤出选中的元素
*/
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
].
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
.
id
;
});
}
else
{
this
.
filter_id
=
[];
}
},
/**
* 清空数据
*/
clearInput
()
{
this
.
input_flag
=
false
;
this
.
searchParams
.
search_keyword
=
''
;
this
.
getData
();
},
/**
* 单号搜索
* @param {Object} event
*/
handleInput
:
debounce
(
function
(
event
)
{
var
val
=
event
.
target
.
value
;
if
(
val
)
{
this
.
input_flag
=
true
;
}
else
{
this
.
input_flag
=
false
;
}
this
.
getData
();
},
500
),
/**
* 获取列表数据
*/
getData
()
{
this
.
request
(
API
.
onShelfRecordList
,
'GET'
,
{
page
:
this
.
page
,
limit
:
this
.
limit
,
...
this
.
searchParams
},
true
).
then
(
res
=>
{
if
(
res
.
code
===
0
)
{
this
.
list
=
res
.
data
.
list
;
this
.
filter_list
=
createArray
(
this
.
list
.
length
,
false
);
}
else
{
uni
.
showToast
({
title
:
res
.
msg
,
icon
:
'error'
});
}
});
},
/**
* 获取详情数据
*/
onShelfRecordInfo
(
id
)
{
this
.
request
(
API
.
onShelfRecordInfo
,
'GET'
,
{
id
:
id
},
true
).
then
(
res
=>
{
if
(
res
.
code
===
0
)
{
this
.
$refs
.
showRight
.
open
();
this
.
detail
=
res
.
data
;
}
else
{
uni
.
showToast
({
title
:
res
.
msg
,
icon
:
'error'
});
}
});
},
/**
* 取消上架记录
*/
cancelShelfRecord
(
type
,
stock_shelf_id
)
{
if
(
type
==
1
)
{
if
(
this
.
filter_id
.
length
==
0
)
{
uni
.
showToast
({
title
:
'请选择货品'
,
icon
:
'error'
});
return
false
;
}
var
stock_shelf_ids
=
this
.
filter_id
.
join
(
','
);
}
else
{
var
stock_shelf_ids
=
stock_shelf_id
;
}
uni
.
showModal
({
content
:
'该物料上架数量小于入库单预期数量,确认上架将自动更新入库单的预期数量为本次上架数量。'
,
success
:
function
(
res
)
{
title
:
'提示'
,
content
:
'确定要取消上架吗?'
,
showCancel
:
true
,
success
:
res
=>
{
if
(
res
.
confirm
)
{
console
.
log
(
'用户点击确定'
);
this
.
request
(
API
.
cancelShelfRecord
,
'POST'
,
{
stock_shelf_ids
:
stock_shelf_ids
},
true
).
then
(
res
=>
{
if
(
res
.
code
===
0
)
{
uni
.
showToast
({
title
:
'取消上架成功'
,
icon
:
'success'
});
setTimeout
(()
=>
{
this
.
getData
();
this
.
filter_id
=
[];
if
(
type
==
2
)
{
this
.
closeDrawer
();
}
},
2000
);
}
else
{
uni
.
showModal
({
title
:
'提示'
,
content
:
res
.
msg
,
showCancel
:
false
});
}
});
}
else
if
(
res
.
cancel
)
{
// 用户点击取消操作
console
.
log
(
'用户点击取消'
);
}
}
});
},
/**
* @param {Object} type 1 首页 2弹出的提交
* @param {Object} stock_shelf_id
*/
submitOnShelf
(
type
,
stock_shelf_id
)
{
if
(
type
==
1
)
{
if
(
this
.
filter_id
.
length
==
0
)
{
uni
.
showToast
({
title
:
'请选择货品'
,
icon
:
'error'
});
return
false
;
}
var
stock_shelf_ids
=
this
.
filter_id
.
join
(
','
);
}
else
{
var
stock_shelf_ids
=
stock_shelf_id
;
}
/**
* 当code返回值为2的时候需要弹出框提醒是否继续,并携带参数is_support_part_shelf=1继续提交操作
*/
this
.
request
(
API
.
submitOnShelf
,
'POST'
,
{
stock_shelf_ids
:
stock_shelf_ids
},
true
).
then
(
res
=>
{
if
(
res
.
code
===
0
)
{
uni
.
showToast
({
title
:
'提交成功'
,
icon
:
'success'
});
setTimeout
(()
=>
{
this
.
getData
();
this
.
filter_id
=
[];
if
(
type
==
2
)
{
this
.
closeDrawer
();
}
},
2000
);
}
else
if
(
res
.
code
==
2
)
{
uni
.
showModal
({
content
:
res
.
msg
,
showCancel
:
false
,
success
:
function
(
res
)
{
if
(
res
.
confirm
)
{
this
.
request
(
API
.
submitOnShelf
,
'POST'
,
{
stock_shelf_ids
:
stock_shelf_ids
,
is_support_part_shelf
:
1
},
true
).
then
(
res
=>
{
if
(
res
.
code
===
0
)
{
uni
.
showToast
({
title
:
'提交成功'
,
icon
:
'success'
});
setTimeout
(()
=>
{
this
.
getData
();
this
.
filter_id
=
[];
if
(
type
==
2
)
{
this
.
closeDrawer
();
}
},
2000
);
}
else
{
uni
.
showModal
({
title
:
'提示'
,
content
:
res
.
msg
,
showCancel
:
false
});
}
});
}
else
if
(
res
.
cancel
)
{
console
.
log
(
'用户点击取消'
);
}
}
});
}
else
{
uni
.
showModal
({
title
:
'提示'
,
content
:
res
.
msg
,
showCancel
:
false
});
}
});
}
}
};
...
...
pages/putaway/single.vue
View file @
2f87ba70
...
...
@@ -123,10 +123,10 @@
</view>
</view>
<view
class=
"bor"
></view>
<view
class=
"tip-box row verCenter"
>
<view
class=
"tip-box row verCenter"
v-if=
"workingRule"
>
<text
class=
"iconfont icon-a-juxing4"
></text>
<text
class=
"t1"
>
按数量
推荐库位:
</text>
<text
class=
"t2"
>
--
</text>
<text
class=
"t1"
>
{{
workingRuleList
.
prefix
}}
推荐库位:
</text>
<text
class=
"t2"
>
{{
workingRule
}}
</text>
</view>
<view
class=
"field-item row"
>
<view
class=
"item row verCenter"
>
...
...
@@ -156,7 +156,8 @@ export default {
detail
:
{},
indexPosition
:
-
1
,
position
:
[],
//库位
workingRuleList
:
[],
//推荐库位
workingRuleList
:
{},
//,//推荐库位
workingRule
:
''
,
//推荐库位
searchParams
:
{
stock_in_batch_sn
:
''
//入库批次
},
...
...
@@ -193,7 +194,7 @@ export default {
*/
clearInput
()
{
this
.
input_flag
=
false
;
this
.
searchParams
.
stock_in_batch_sn
=
this
.
detail
.
stock_in_batch_sn
;
this
.
searchParams
.
stock_in_batch_sn
=
''
;
this
.
getData
();
},
/**
...
...
@@ -237,7 +238,7 @@ export default {
* 获取库位
*/
getWhPositionList
()
{
this
.
request
(
API
.
getWhPositionList
,
'POST'
,
{
warehouse_id
:
7
,
stock_in_type
:
this
.
detail
.
stock_in_type
},
false
).
then
(
res
=>
{
this
.
request
(
API
.
getWhPositionList
,
'POST'
,
{
warehouse_id
:
this
.
detail
.
warehouse_id
,
stock_in_type
:
this
.
detail
.
stock_in_type
},
false
).
then
(
res
=>
{
if
(
res
.
code
===
0
)
{
this
.
position
=
res
.
data
.
list
.
map
(
function
(
item
)
{
return
{
...
...
@@ -259,12 +260,19 @@ export default {
getWorkingRuleList
()
{
var
params
=
{
num
:
this
.
formParams
.
qty_on_shelf
,
warehouse_id
:
7
,
com_name
:
''
,
supplier_name
:
''
warehouse_id
:
this
.
detail
.
warehouse_id
,
com_name
:
this
.
detail
.
com_name
,
supplier_name
:
this
.
detail
.
supplier_name
};
this
.
request
(
API
.
getWorkingRuleList
,
'POST'
,
params
,
false
).
then
(
res
=>
{
if
(
res
.
code
===
0
)
{
if
(
res
.
data
.
list
.
length
>
0
)
{
this
.
workingRuleList
=
res
.
data
;
this
.
workingRule
=
res
.
data
.
list
.
map
(
item
=>
item
.
position_name
).
join
(
','
);
}
else
{
this
.
workingRuleList
=
''
;
this
.
workingRule
=
''
;
}
}
else
{
uni
.
showToast
({
title
:
res
.
msg
,
...
...
util/api.js
View file @
2f87ba70
...
...
@@ -187,6 +187,22 @@ const API = {
* 查询可用上架规则
* */
getWorkingRuleList
:
API_BASE
+
'/api/shelf/getWorkingRuleList'
,
/**
* 上架记录
* */
onShelfRecordList
:
API_BASE
+
'/api/h5/stockIn/onShelfRecordList'
,
/**
* 上架记录详情
* */
onShelfRecordInfo
:
API_BASE
+
'/api/h5/stockIn/onShelfRecordInfo'
,
/**
* 取消上架记录
* */
cancelShelfRecord
:
API_BASE
+
'/api/h5/stockIn/cancelShelfRecord'
,
/**
* 提交上架
* */
submitOnShelf
:
API_BASE
+
'/api/h5/stockIn/submitOnShelf'
}
...
...
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