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
aea99c25
authored
Feb 26, 2025
by
LJM
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
add
parent
3dec1adb
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
810 additions
and
8 deletions
pages.json
pages/index/index.vue
pages/stockRecheck/shipOut.vue
util/api.js
pages.json
View file @
aea99c25
...
...
@@ -445,6 +445,11 @@
"style"
:
{
"navigationBarTitleText"
:
"预检单"
}
},
{
"path"
:
"pages/stockRecheck/shipOut"
,
"style"
:
{
"navigationBarTitleText"
:
"出库发货"
}
}],
"globalStyle"
:
{
"navigationBarTextStyle"
:
"black"
,
...
...
pages/index/index.vue
View file @
aea99c25
...
...
@@ -56,6 +56,12 @@
</view>
<text
class=
"text"
>
复核
</text>
</navigator>
<navigator
class=
"box-li column rowCenter verCenter"
url=
"/pages/stockRecheck/shipOut"
hover-class=
"none"
>
<view
class=
"box row rowCenter verCenter"
>
<image
src=
"/static/home/@2x(5).png"
></image>
</view>
<text
class=
"text"
>
出库发货
</text>
</navigator>
<navigator
class=
"box-li column rowCenter verCenter"
url=
"/pages/transfer/index"
hover-class=
"none"
>
<view
class=
"box row rowCenter verCenter"
>
<image
src=
"/static/home/@2x(3).png"
></image>
...
...
pages/stockRecheck/shipOut.vue
0 → 100644
View file @
aea99c25
<
template
>
<view
class=
"stockRecheck-print"
>
<!-- 时间筛选 -->
<view
class=
"time-interval row bothSide verCenter"
style=
"margin-bottom: 15rpx;"
>
<view
class=
"time-interval-box row verCenter bothSide"
>
<view
class=
"row verCenter"
>
<text
class=
"iconfont icon-juxing4"
></text>
<picker
mode=
"date"
@
change=
"bindTimeChange(1, $event)"
>
<input
type=
"text"
class=
"uni-input"
placeholder=
"请选择起始时间"
placeholder-style=
"color:#919399"
v-model=
"searchParams.create_start_time"
/>
</picker>
</view>
<text
class=
"iconfont icon-a-juxing11"
@
click=
"clearInput('start')"
v-if=
"searchParams.create_start_time != ''"
></text>
</view>
<view
class=
"time-interval-box row verCenter bothSide"
>
<view
class=
"row verCenter"
>
<text
class=
"iconfont icon-juxing4"
></text>
<picker
mode=
"date"
@
change=
"bindTimeChange(2, $event)"
>
<input
type=
"text"
class=
"uni-input"
placeholder=
"请选择结束时间"
placeholder-style=
"color:#919399"
v-model=
"searchParams.create_end_time"
/>
</picker>
</view>
<text
class=
"iconfont icon-a-juxing11"
@
click=
"clearInput('end')"
v-if=
"searchParams.create_end_time != ''"
></text>
</view>
</view>
<!-- 搜索 -->
<view
class=
"search-box row bothSide verCenter"
>
<view
class=
"sn row rowCenter verCenter"
>
<picker
:value=
"index"
:range=
"array"
>
<view
class=
"row verCenter"
>
<view
class=
"uni-input"
>
{{
array
[
index
]
}}
</view>
<view
class=
"uni-arrow"
></view>
</view>
</picker>
</view>
<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"
v-model=
"searchParams.stock_out_sn"
@
input=
"handleInput"
:focus=
"is_focus"
/>
</view>
<text
class=
"iconfont icon-a-juxing11"
@
click=
"clearInput()"
v-if=
"input_flag"
></text>
</view>
</view>
<!-- 列表 -->
<view
class=
"list"
v-if=
"list.length > 0"
>
<view
class=
"box row"
v-for=
"(item, index) in list"
:key=
"index"
>
<view
class=
"input-box row verCenter"
>
<text
class=
"label"
>
出库单号:
</text>
<text
class=
"tt"
>
{{
item
.
stock_out_sn
}}
</text>
</view>
<view
class=
"input-box row verCenter"
>
<text
class=
"label"
>
状态:
</text>
<text
class=
"tt"
>
{{
item
.
stock_out_status_val
}}
</text>
</view>
<view
class=
"bor"
style=
"flex: 0 0 100%;"
></view>
<view
class=
"input-box row verCenter"
>
<text
class=
"label"
>
总 数 量:
</text>
<text
class=
"text"
>
{{
item
.
total_qty
}}
</text>
</view>
<view
class=
"input-box row verCenter"
>
<text
class=
"label"
>
打包箱数:
</text>
<text
class=
"text"
>
{{
item
.
box_num
}}
</text>
</view>
<view
class=
"input-box row"
style=
"flex: 0 0 100%;"
>
<text
class=
"label"
>
主单仓库备注:
</text>
<text
class=
"text"
style=
"color: #f00;"
>
{{
item
.
upstream_remark
}}
</text>
</view>
<view
class=
"input-box row verCenter"
>
<text
class=
"label"
>
销 售 员:
</text>
<text
class=
"text"
>
{{
item
.
sale_name
}}
</text>
</view>
<view
class=
"input-box row verCenter"
>
<text
class=
"label"
>
采 购 员:
</text>
<text
class=
"text"
>
{{
item
.
pur_user_name
}}
</text>
</view>
<view
class=
"input-box row verCenter"
style=
"flex: 0 0 100%;"
>
<text
class=
"label"
>
收货客户:
</text>
<text
class=
"text"
>
{{
item
.
customer_name
}}
</text>
</view>
<view
class=
"input-box row verCenter"
style=
"flex: 0 0 100%;"
>
<text
class=
"label"
>
操 作 人:
</text>
<text
class=
"text"
>
{{
item
.
create_name
}}
</text>
</view>
<view
class=
"input-box row verCenter"
style=
"flex: 0 0 100%;"
>
<text
class=
"label"
>
完成时间:
</text>
<text
class=
"text"
>
{{
item
.
finish_time
}}
</text>
</view>
<view
class=
"btn row rowCenter verCenter"
@
click=
"showDrawer(item.stock_out_sn)"
>
选择
</view>
</view>
</view>
<!-- 无数据展示 -->
<view
class=
"no-date column rowCenter verCenter"
v-else
>
<text
class=
"iconfont icon-a-juxing21"
></text>
<text
class=
"text"
>
查不到当前数据
</text>
</view>
<!-- 打快递单弹窗 -->
<uni-drawer
ref=
"showRight"
mode=
"right"
>
<view
class=
"uni-drawer-picking"
v-if=
"detail.stock_out_info"
style=
"height: 100%;"
>
<scroll-view
scroll-y=
"true"
style=
"height: 100%;overflow-y: scroll;"
>
<view
class=
"title row rowCenter verCenter"
>
<text
class=
"iconfont icon-juxing2"
@
click=
"closeDrawer(1)"
></text>
<text
class=
"text"
>
打快递单
</text>
</view>
<view
class=
"field-item row"
style=
"margin-top: 39rpx;"
>
<view
class=
"item row verCenter"
>
<text
class=
"label"
>
出库单号:
</text>
<text
class=
"text"
>
{{
detail
.
stock_out_info
.
stock_out_sn
}}
</text>
</view>
<view
class=
"item row verCenter"
>
<text
class=
"label"
>
状态:
</text>
<text
class=
"text"
>
{{
detail
.
stock_out_info
.
stock_out_status_val
}}
</text>
</view>
</view>
<view
class=
"bor"
></view>
<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%;color: #f00;"
>
{{
detail
.
stock_out_info
.
upstream_remark
}}
</text>
</view>
<view
class=
"item row verCenter"
style=
"flex: 0 0 100%;"
>
<text
class=
"label"
>
收货客户:
</text>
<text
class=
"tt"
style=
"max-width: 100%;"
>
{{
detail
.
stock_out_info
.
customer_name
}}
</text>
</view>
<view
class=
"item row verCenter"
>
<text
class=
"label"
>
操 作 人:
</text>
<text
class=
"tt"
>
{{
detail
.
stock_out_info
.
create_name
}}
</text>
</view>
</view>
<view
class=
"bor"
></view>
<view
class=
"item-tit row verCenter bothSide"
style=
"margin-bottom: 0;"
>
<text>
交货信息
</text>
<view
class=
"text"
>
<text
class=
"label"
>
包 裹 数:
</text>
<text
class=
"tt"
>
{{
detail
.
stock_out_info
.
box_num
}}
</text>
</view>
</view>
<!-- 交货信息start -->
<view
class=
"row bothSide verCenter"
>
<view
class=
"form-input"
style=
"width: 48%;"
>
<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(1, $event)"
:value=
"real_shipping_type_index"
:range=
"real_shipping_type_data"
:range-key=
"'name'"
style=
"width: 100%;"
>
<view
class=
"row verCenter bothSide wrap"
>
<view
class=
"uni-input"
>
{{
real_shipping_type_index
===
-
1
?
'请选择'
:
(
real_shipping_type_data
[
real_shipping_type_index
]
?
real_shipping_type_data
[
real_shipping_type_index
].
name
:
'请选择'
)
}}
</view>
<view
class=
"uni-arrow"
></view>
</view>
</picker>
</view>
</view>
<view
class=
"form-input"
style=
"width: 48%;"
>
<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(2, $event)"
:value=
"real_shipping_id_index"
:range=
"real_shipping_id_data"
:range-key=
"'name'"
style=
"width: 100%;"
>
<view
class=
"row verCenter bothSide wrap"
>
<view
class=
"uni-input"
>
{{
real_shipping_id_index
===
-
1
?
'请选择'
:
(
real_shipping_id_data
[
real_shipping_id_index
]
?
real_shipping_id_data
[
real_shipping_id_index
].
name
:
'请选择'
)
}}
</view>
<view
class=
"uni-arrow"
></view>
</view>
</picker>
</view>
</view>
</view>
<view
class=
"row bothSide verCenter"
>
<view
class=
"form-input"
style=
"width: 48%;"
>
<view
class=
"input-title"
><text
class=
"input-title-t2"
>
物流模式:
</text></view>
<view
class=
"select-box row"
>
<picker
@
change=
"bindPickerChange(3, $event)"
:value=
"real_shipping_mode_index"
:range=
"real_shipping_mode_data"
:range-key=
"'name'"
style=
"width: 100%;"
>
<view
class=
"row verCenter bothSide wrap"
>
<view
class=
"uni-input"
>
{{
real_shipping_mode_index
===
-
1
?
'请选择'
:
(
real_shipping_mode_data
[
real_shipping_mode_index
]
?
real_shipping_mode_data
[
real_shipping_mode_index
].
name
:
'请选择'
)
}}
</view>
<view
class=
"uni-arrow"
></view>
</view>
</picker>
</view>
</view>
<view
class=
"form-input"
style=
"width: 48%;"
>
<view
class=
"input-title"
><text
class=
"input-title-t2"
>
物流单号:
</text></view>
<view
class=
"input-box"
>
<template
v-if=
"formParams.real_shipping_type == 1 && formParams.real_shipping_id == 1 && company_id == 1"
>
<input
type=
"text"
disabled
style=
"background-color: #f6f6f6;border: 1px solid #eee;"
class=
"uni-input"
placeholder-style=
"color:#919399"
placeholder=
""
v-model=
"formParams.shipping_code"
/>
</
template
>
<
template
v-else
>
<input
type=
"text"
class=
"uni-input"
placeholder-style=
"color:#919399"
placeholder=
"请输入"
v-model=
"formParams.shipping_code"
/>
</
template
>
</view>
</view>
</view>
<view
class=
"row bothSide verCenter"
>
<view
class=
"form-input"
style=
"width: 48%;"
>
<view
class=
"input-title"
><text
class=
"input-title-t2"
>
物流付费:
</text></view>
<view
class=
"select-box row"
>
<picker
@
change=
"bindPickerChange(4, $event)"
:value=
"shipping_payment_type_index"
:range=
"shipping_payment_type_data"
:range-key=
"'name'"
style=
"width: 100%;"
>
<view
class=
"row verCenter bothSide wrap"
>
<view
class=
"uni-input"
>
{{ shipping_payment_type_index === -1 ? '请选择' : (shipping_payment_type_data[shipping_payment_type_index] ? shipping_payment_type_data[shipping_payment_type_index].name : '请选择') }}
</view>
<view
class=
"uni-arrow"
></view>
</view>
</picker>
</view>
</view>
<view
class=
"form-input"
style=
"width: 48%;"
>
<view
class=
"input-title"
><text
class=
"input-title-t2"
>
客户快递账号:
</text></view>
<view
class=
"input-box"
>
<input
type=
"text"
disabled
style=
"background-color: #f6f6f6;border: 1px solid #eee;"
class=
"uni-input"
placeholder-style=
"color:#919399"
placeholder=
"请输入客户快递账号"
v-model=
"formParams.client_express_account"
/>
</view>
</view>
</view>
<view
class=
"print row verCenter"
v-if=
"detail.stock_out_info"
>
<text
class=
"check-box-icon"
:class=
"{ curr: detail.stock_out_info.is_receipt == 1 }"
></text>
<text
class=
"tt"
>
签回单
</text>
</view>
<!-- 交货信息end -->
<view
class=
"bor"
></view>
<view
class=
"item-tit"
>
地址信息
</view>
<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%;"
>
{{ detail.stock_out_info.customer_name }}
</text>
</view>
</view>
<!-- 地址信息start -->
<view
class=
"row bothSide verCenter"
>
<view
class=
"form-input"
style=
"width: 48%;"
>
<view
class=
"input-title"
>
<text
class=
"input-title-t1"
>
*
</text>
<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.consignee"
/></view>
</view>
<view
class=
"form-input"
style=
"width: 48%;"
>
<view
class=
"input-title"
>
<text
class=
"input-title-t1"
>
*
</text>
<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.mobile"
/></view>
</view>
</view>
<view
class=
"row bothSide verCenter"
>
<view
class=
"form-input"
style=
"width: 48%;"
>
<view
class=
"input-title"
>
<text
class=
"input-title-t1"
>
*
</text>
<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.country"
/></view>
</view>
<view
class=
"form-input"
style=
"width: 48%;"
>
<view
class=
"input-title"
>
<text
class=
"input-title-t1"
v-if=
"company_id == 1"
>
*
</text>
<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.province"
/></view>
</view>
</view>
<view
class=
"row bothSide verCenter"
>
<view
class=
"form-input"
style=
"width: 48%;"
>
<view
class=
"input-title"
>
<text
class=
"input-title-t1"
v-if=
"company_id == 1"
>
*
</text>
<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.city"
/></view>
</view>
<view
class=
"form-input"
style=
"width: 48%;"
>
<view
class=
"input-title"
>
<text
class=
"input-title-t1"
v-if=
"company_id == 1"
>
*
</text>
<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.district"
/></view>
</view>
</view>
<view
class=
"row bothSide verCenter"
>
<view
class=
"form-input"
style=
"width: 48%;"
>
<view
class=
"input-title"
>
<text
class=
"input-title-t1"
>
*
</text>
<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.address"
/></view>
</view>
</view>
<!-- 地址信息end -->
<view
class=
"btn row verCenter bothSide"
>
<view
class=
"btn1 row rowCenter verCenter"
style=
"width: 100%;"
@
click=
"updateDeliveryInfo(detail.stock_out_info.stock_out_id)"
>
保存
</view>
</view>
</scroll-view>
</view>
</uni-drawer>
</view>
</template>
<
script
>
import
{
API
}
from
'@/util/api.js'
;
import
debounce
from
'lodash/debounce'
;
// 获取当前日期
const
currentDate
=
new
Date
();
// 获取前一个月的日期
const
lastMonthDate
=
new
Date
(
currentDate
);
lastMonthDate
.
setMonth
(
currentDate
.
getMonth
()
-
1
);
// 格式化日期为 YYYY-MM-DD
const
formatDate
=
(
date
)
=>
{
const
year
=
date
.
getFullYear
();
const
month
=
(
date
.
getMonth
()
+
1
).
toString
().
padStart
(
2
,
'0'
);
const
day
=
date
.
getDate
().
toString
().
padStart
(
2
,
'0'
);
return
`
${
year
}
-
${
month
}
-
${
day
}
`
;
};
export
default
{
data
()
{
return
{
is_focus
:
true
,
//获取焦点动态化
company_id
:
uni
.
getStorageSync
(
'company_id'
)
||
1
,
input_flag
:
false
,
flag
:
false
,
page
:
1
,
limit
:
30
,
list
:
[],
index
:
0
,
array
:
[
'出库单号'
],
detail
:
{},
real_shipping_type_index
:
-
1
,
real_shipping_id_index
:
-
1
,
real_shipping_mode_index
:
-
1
,
real_shipping_type_data
:
[],
//交货方式数据
real_shipping_id_data
:
[],
//物流公司数据
real_shipping_mode_data
:
[],
//物流模式数据
searchParams
:
{
stock_out_sn
:
''
,
create_start_time
:
formatDate
(
lastMonthDate
),
//开始时间
create_end_time
:
formatDate
(
currentDate
)
//结束时间
},
shipping_payment_type_data
:
[{
name
:
'寄件月结'
,
value
:
1
},
{
name
:
'寄件到付'
,
value
:
2
}],
shipping_payment_type_index
:
-
1
,
hasMoreData
:
true
,
//是否分页加载
shippingListParams
:
{
warehouse_id
:
''
,
warehouse_name
:
''
,
shipping_type
:
''
,
shipping_id
:
''
},
formParams
:
{
real_shipping_type
:
''
,
//交货方式
real_shipping_id
:
''
,
//物流公司
real_shipping_mode
:
''
,
//物流模式
shipping_code
:
''
,
//物流单号
is_receipt
:
''
,
//是否签回单
shipping_payment_type
:
''
,
//物流付费
client_express_account
:
''
,
//客户快递账号
consignee
:
''
,
country
:
''
,
mobile
:
''
,
province
:
''
,
city
:
''
,
district
:
''
,
address
:
''
}
};
},
onReachBottom
()
{
if
(
!
this
.
hasMoreData
)
{
return
;
}
this
.
page
++
;
this
.
getData
();
},
onNavigationBarButtonTap
(
e
)
{
if
(
e
.
index
==
0
)
{
uni
.
reLaunch
({
url
:
'/pages/index/index'
});
}
},
onShow
()
{
this
.
getData
();
},
methods
:
{
/**
* @param {Object} type 1:交货方式 2:物流公司 3:物流模式 4:物流付费
* @param {Object} e
*/
bindPickerChange
:
function
(
type
,
e
)
{
console
.
log
(
'picker发送选择改变,携带值为'
,
e
.
detail
.
value
);
if
(
type
==
1
)
{
this
.
real_shipping_type_index
=
e
.
detail
.
value
;
this
.
formParams
.
real_shipping_type
=
this
.
real_shipping_type_data
[
e
.
detail
.
value
].
value
;
this
.
shippingListParams
.
shipping_type
=
this
.
formParams
.
real_shipping_type
;
this
.
shippingListParams
.
shipping_id
=
''
;
this
.
getShippingList
();
}
else
if
(
type
==
2
)
{
this
.
real_shipping_id_index
=
e
.
detail
.
value
;
this
.
formParams
.
real_shipping_id
=
this
.
real_shipping_id_data
[
e
.
detail
.
value
].
value
;
this
.
shippingListParams
.
shipping_id
=
this
.
formParams
.
real_shipping_id
;
this
.
getShippingList
();
}
else
if
(
type
==
3
)
{
this
.
real_shipping_mode_index
=
e
.
detail
.
value
;
this
.
formParams
.
real_shipping_mode
=
this
.
real_shipping_mode_data
[
e
.
detail
.
value
].
value
;
}
else
if
(
type
==
4
)
{
this
.
shipping_payment_type_index
=
e
.
detail
.
value
;
this
.
formParams
.
shipping_payment_type
=
this
.
shipping_payment_type_data
[
e
.
detail
.
value
].
value
;
}
},
/**
* 时间选择
*/
bindTimeChange
(
type
,
e
)
{
this
.
resetChange
();
if
(
type
==
1
)
{
this
.
searchParams
.
create_end_time
=
e
.
detail
.
value
;
}
else
if
(
type
==
2
)
{
this
.
searchParams
.
create_end_time
=
e
.
detail
.
value
;
}
var
timeA
=
new
Date
(
this
.
searchParams
.
create_start_time
).
getTime
();
var
timeB
=
new
Date
(
this
.
searchParams
.
create_end_time
).
getTime
();
if
(
timeB
<
timeA
)
{
uni
.
showToast
({
title
:
'不能小于开始时间'
,
icon
:
'none'
});
this
.
searchParams
.
create_start_time
=
this
.
searchParams
.
create_end_time
;
return
false
;
}
this
.
getData
();
},
/**
* 根据所选的交货方式,显示对应的物流公司
* @param {Object} value
*/
realShippChage
(
callback
)
{
let
value
=
this
.
formParams
.
real_shipping_type
;
//交货方式
this
.
real_shipping_id_data
=
[];
//物流公司
if
(
this
.
company_id
==
1
||
this
.
company_id
==
3
)
{
//猎芯和华云的逻辑
if
(
value
==
1
)
{
this
.
real_shipping_id_data
.
push
({
name
:
'顺丰'
,
value
:
1
},
{
name
:
'京东'
,
value
:
11
},
{
name
:
'中通'
,
value
:
18
},
{
name
:
'韵达'
,
value
:
5
});
}
else
if
(
value
==
2
)
{
this
.
real_shipping_id_data
=
[];
}
else
if
(
value
==
3
)
{
this
.
real_shipping_id_data
.
push
({
name
:
'自提'
,
value
:
10
});
}
else
if
(
value
==
4
)
{
this
.
real_shipping_id_data
.
push
({
name
:
'顺丰同城'
,
value
:
19
},
{
name
:
'货拉拉'
,
value
:
20
},
{
name
:
'跨越速运'
,
value
:
21
});
}
}
else
{
//深贸的逻辑
if
(
value
==
1
)
{
this
.
real_shipping_id_data
.
push
({
name
:
'顺丰'
,
value
:
1
},
{
name
:
'UPS'
,
value
:
17
},
{
name
:
'Fedex'
,
value
:
13
},
{
name
:
'TNT'
,
value
:
9
},
{
name
:
'DHL'
,
value
:
12
});
}
else
if
(
value
==
2
)
{
this
.
real_shipping_id_data
=
[];
}
else
if
(
value
==
3
)
{
this
.
real_shipping_id_data
=
[];
}
else
if
(
value
==
4
)
{
this
.
real_shipping_id_data
.
push
({
name
:
'顺丰'
,
value
:
1
},
{
name
:
'UPS'
,
value
:
17
},
{
name
:
'Fedex'
,
value
:
13
},
{
name
:
'TNT'
,
value
:
9
},
{
name
:
'DHL'
,
value
:
12
},
{
name
:
'司机送货'
,
value
:
14
});
}
}
typeof
callback
==
'function'
&&
callback
();
},
/**
* 更新物流模式
*/
updateRealShippingId
(
real_shipping_id
,
callback
)
{
//物流公司为跨越速运
if
(
real_shipping_id
==
21
)
{
this
.
real_shipping_mode_data
=
[];
this
.
real_shipping_mode_data
.
push
({
name
:
'当天达'
,
value
:
10
},
{
name
:
'次日达'
,
value
:
20
},
{
name
:
'隔日达'
,
value
:
30
},
{
name
:
'陆运件'
,
value
:
40
},
{
name
:
'同城次日'
,
value
:
50
},
{
name
:
'同城即日'
,
value
:
70
},
{
name
:
'省内次日'
,
value
:
160
},
{
name
:
'省内即日'
,
value
:
170
},
{
name
:
'空运'
,
value
:
210
},
{
name
:
'专运'
,
value
:
220
});
}
else
{
this
.
real_shipping_mode_data
=
[];
this
.
real_shipping_mode_data
.
push
({
name
:
'空运'
,
value
:
1
},
{
name
:
'陆运'
,
value
:
2
},
{
name
:
'半日达'
,
value
:
263
});
}
this
.
$forceUpdate
();
typeof
callback
==
'function'
&&
callback
(
data
);
},
showDrawer
(
stock_out_sn
)
{
this
.
$refs
.
showRight
.
open
();
this
.
getStockOutDetail
(
stock_out_sn
);
},
closeDrawer
()
{
this
.
$refs
.
showRight
.
close
();
},
/**
* 清空数据
*/
clearInput
(
type
)
{
this
.
resetChange
();
if
(
type
==
'start'
)
{
//清除起始时间
this
.
searchParams
.
exec_start_time
=
''
;
}
else
if
(
type
==
'end'
)
{
//清除结束时间
this
.
searchParams
.
exec_end_time
=
''
;
}
else
{
this
.
input_flag
=
false
;
this
.
searchParams
.
stock_out_sn
=
''
;
this
.
clearInputAndFocus
();
}
this
.
getData
();
},
/**
* 找出false对应的下标
* @param {Object} arr
* @param {Object} target
*/
findIndex
(
arr
,
target
)
{
const
result
=
[];
arr
.
map
((
item
,
index
)
=>
{
if
(
item
.
value
===
target
)
{
result
.
push
(
index
);
}
});
return
result
;
},
/**
* 单号搜索
* @param {Object} event
*/
handleInput
:
debounce
(
function
(
event
)
{
this
.
resetChange
();
var
val
=
event
.
target
.
value
;
if
(
val
)
{
this
.
input_flag
=
true
;
}
else
{
this
.
input_flag
=
false
;
}
this
.
getData
();
},
500
),
/**
* 物流联动信息获取
*/
getShippingList
(
selected_shipping_type
,
selected_shipping_id
,
selected_shipping_mode
)
{
this
.
request
(
API
.
getShippingList
,
'POST'
,
this
.
shippingListParams
,
true
).
then
(
res
=>
{
if
(
res
.
code
===
0
)
{
// 第一步:获取交货方式列表
if
(
this
.
shippingListParams
.
warehouse_id
&&
!
this
.
shippingListParams
.
shipping_type
&&
!
this
.
shippingListParams
.
shipping_id
)
{
const
shippingTypeList
=
res
.
data
.
shipping_type_list
||
{};
this
.
real_shipping_type_data
=
Object
.
entries
(
shippingTypeList
).
map
(([
value
,
name
])
=>
({
name
,
value
:
parseInt
(
value
)
}));
// 如果有传入交货方式,则选中对应的值
if
(
selected_shipping_type
)
{
this
.
shippingListParams
.
shipping_type
=
selected_shipping_type
;
const
index
=
this
.
real_shipping_type_data
.
findIndex
(
item
=>
item
.
value
===
selected_shipping_type
);
if
(
index
>
-
1
)
{
this
.
real_shipping_type_index
=
index
;
this
.
formParams
.
real_shipping_type
=
selected_shipping_type
;
}
}
else
{
// 如果没有传入交货方式,则选择第一个作为默认值
this
.
real_shipping_type_index
=
0
;
this
.
shippingListParams
.
shipping_type
=
this
.
real_shipping_type_data
[
0
].
value
;
this
.
formParams
.
real_shipping_type
=
this
.
real_shipping_type_data
[
0
].
value
;
}
this
.
getShippingList
(
selected_shipping_type
,
selected_shipping_id
,
selected_shipping_mode
);
return
;
}
// 第二步:获取物流公司列表
if
(
this
.
shippingListParams
.
warehouse_id
&&
this
.
shippingListParams
.
shipping_type
&&
!
this
.
shippingListParams
.
shipping_id
)
{
const
shippingList
=
res
.
data
.
shipping_list
||
[];
this
.
real_shipping_id_data
=
shippingList
.
map
(
item
=>
({
name
:
item
.
name
,
value
:
item
.
id
}));
// 如果有传入物流公司,则选中对应的值
if
(
selected_shipping_id
)
{
this
.
shippingListParams
.
shipping_id
=
selected_shipping_id
;
const
index
=
this
.
real_shipping_id_data
.
findIndex
(
item
=>
item
.
value
===
selected_shipping_id
);
if
(
index
>
-
1
)
{
this
.
real_shipping_id_index
=
index
;
this
.
formParams
.
real_shipping_id
=
selected_shipping_id
;
}
}
else
{
// 如果没有传入物流公司,则选择第一个作为默认值
this
.
real_shipping_id_index
=
0
;
this
.
shippingListParams
.
shipping_id
=
this
.
real_shipping_id_data
[
0
].
value
;
this
.
formParams
.
real_shipping_id
=
this
.
real_shipping_id_data
[
0
].
value
;
}
this
.
getShippingList
(
selected_shipping_type
,
selected_shipping_id
,
selected_shipping_mode
);
return
;
}
// 第三步:获取物流模式列表
if
(
this
.
shippingListParams
.
warehouse_id
&&
this
.
shippingListParams
.
shipping_type
&&
this
.
shippingListParams
.
shipping_id
)
{
const
shippingMode
=
res
.
data
.
shipping_mode
||
[];
this
.
real_shipping_mode_data
=
shippingMode
.
map
(
item
=>
({
name
:
item
.
shipping_mode_name
,
value
:
item
.
id
,
is_default
:
item
.
is_default
}));
// 如果有传入物流模式,则选中对应的值
if
(
selected_shipping_mode
)
{
const
index
=
this
.
real_shipping_mode_data
.
findIndex
(
item
=>
item
.
value
===
selected_shipping_mode
);
if
(
index
>
-
1
)
{
this
.
real_shipping_mode_index
=
index
;
this
.
formParams
.
real_shipping_mode
=
selected_shipping_mode
;
}
}
else
{
// 如果没有传入物流模式,则选择第一个作为默认值
// 查找默认物流模式(is_default=1)
const
defaultMode
=
this
.
real_shipping_mode_data
.
find
(
item
=>
item
.
is_default
===
1
);
if
(
defaultMode
)
{
// 如果存在默认物流模式则使用默认值
this
.
real_shipping_mode_index
=
this
.
real_shipping_mode_data
.
findIndex
(
item
=>
item
.
value
===
defaultMode
.
value
);
this
.
shippingListParams
.
shipping_mode
=
defaultMode
.
value
;
this
.
formParams
.
real_shipping_mode
=
defaultMode
.
value
;
}
else
{
// 如果没有默认值则使用第一个
this
.
real_shipping_mode_index
=
0
;
this
.
shippingListParams
.
shipping_mode
=
this
.
real_shipping_mode_data
[
0
].
value
;
this
.
formParams
.
real_shipping_mode
=
this
.
real_shipping_mode_data
[
0
].
value
;
}
}
}
}
else
{
uni
.
showToast
({
title
:
res
.
msg
,
icon
:
'error'
});
}
});
},
/**
* 获取列表数据
*/
getData
()
{
this
.
request
(
API
.
getToPrintList
,
'POST'
,
{
page
:
this
.
page
,
limit
:
this
.
limit
,
...
this
.
searchParams
},
true
).
then
(
res
=>
{
if
(
res
.
code
===
0
)
{
if
(
res
.
data
.
list
.
length
>
0
)
{
this
.
hasMoreData
=
true
;
this
.
list
=
this
.
list
.
concat
(
res
.
data
.
list
);
}
else
{
this
.
hasMoreData
=
false
;
}
}
else
{
uni
.
showToast
({
title
:
res
.
msg
,
icon
:
'error'
});
}
});
},
/**
* 详情
*/
getStockOutDetail
(
stock_out_sn
)
{
this
.
request
(
API
.
getStockOutDetail
,
'POST'
,
{
stock_out_sn
:
stock_out_sn
},
true
).
then
(
res
=>
{
if
(
res
.
code
===
0
)
{
this
.
detail
=
res
.
data
;
this
.
formParams
.
client_express_account
=
res
.
data
.
stock_out_address
.
client_express_account
||
''
;
//客户快递账号
this
.
shippingListParams
.
warehouse_id
=
res
.
data
.
stock_out_info
.
warehouse_id
;
this
.
getShippingList
(
res
.
data
.
stock_out_address
.
real_shipping_type
,
res
.
data
.
stock_out_address
.
real_shipping_id
,
res
.
data
.
stock_out_address
.
real_shipping_mode
);
//物流联动信息获取
setTimeout
(()
=>
{
//显示对应index的物流付费
this
.
formParams
.
shipping_payment_type
=
res
.
data
.
stock_out_address
.
shipping_payment_type
;
//物流付费
let
shipping_payment_type_index
=
this
.
findIndex
(
this
.
shipping_payment_type_data
,
this
.
formParams
.
shipping_payment_type
);
this
.
shipping_payment_type_index
=
shipping_payment_type_index
[
0
];
this
.
formParams
.
shipping_code
=
res
.
data
.
stock_out_address
.
shipping_code
;
//物流单号
//显示对应的地址栏信息
this
.
formParams
.
country
=
res
.
data
.
stock_out_address
.
country
;
this
.
formParams
.
consignee
=
res
.
data
.
stock_out_address
.
consignee
;
this
.
formParams
.
mobile
=
res
.
data
.
stock_out_address
.
mobile
;
this
.
formParams
.
province
=
res
.
data
.
stock_out_address
.
province
;
this
.
formParams
.
city
=
res
.
data
.
stock_out_address
.
city
;
this
.
formParams
.
district
=
res
.
data
.
stock_out_address
.
district
;
this
.
formParams
.
address
=
res
.
data
.
stock_out_address
.
address
;
},
500
)
}
else
{
uni
.
showToast
({
title
:
res
.
msg
,
icon
:
'error'
});
}
});
},
/**
* 更新交货信息
*/
updateDeliveryInfo
(
stock_out_id
)
{
if
(
this
.
company_id
==
1
)
{
if
(
!
this
.
formParams
.
province
)
{
uni
.
showToast
({
title
:
'请填写省'
,
icon
:
'none'
});
return
false
;
}
if
(
!
this
.
formParams
.
city
)
{
uni
.
showToast
({
title
:
'请填写市'
,
icon
:
'none'
});
return
false
;
}
if
(
!
this
.
formParams
.
district
)
{
uni
.
showToast
({
title
:
'请填写区'
,
icon
:
'none'
});
return
false
;
}
}
this
.
request
(
API
.
updateDeliveryInfo
,
'POST'
,
{
stock_out_id
:
stock_out_id
,
real_shipping_type
:
this
.
formParams
.
real_shipping_type
,
real_shipping_id
:
this
.
formParams
.
real_shipping_id
,
real_shipping_mode
:
this
.
formParams
.
real_shipping_mode
,
shipping_code
:
this
.
formParams
.
shipping_code
,
shipping_payment_type
:
this
.
formParams
.
shipping_payment_type
,
consignee
:
this
.
formParams
.
consignee
,
mobile
:
this
.
formParams
.
mobile
,
province
:
this
.
formParams
.
province
,
city
:
this
.
formParams
.
city
,
district
:
this
.
formParams
.
district
,
address
:
this
.
formParams
.
address
},
true
).
then
(
res
=>
{
if
(
res
.
code
===
0
)
{
uni
.
showToast
({
title
:
'保存成功'
,
icon
:
'success'
});
setTimeout
(()
=>
{
this
.
closeDrawer
();
},
2000
);
}
else
{
uni
.
showModal
({
itle
:
'提示'
,
content
:
res
.
msg
,
showCancel
:
false
});
}
});
},
/**
* 打印快递单
*/
printExpress
(
stock_out_id
)
{
this
.
request
(
API
.
printExpress
,
'POST'
,
{
stock_out_id
:
stock_out_id
},
true
).
then
(
res
=>
{
if
(
res
.
code
===
0
)
{
uni
.
showLoading
({
title
:
'正在打印中,请查看打印机'
});
}
else
{
uni
.
showModal
({
title
:
'提示'
,
content
:
res
.
msg
,
showCancel
:
false
});
}
});
},
/**
* 重置
*/
resetChange
()
{
this
.
list
=
[];
this
.
page
=
1
;
},
/**
* 再次获取焦点
*/
clearInputAndFocus
()
{
this
.
input_flag
=
false
;
//关闭叉叉
this
.
is_focus
=
false
;
setTimeout
(()
=>
{
this
.
is_focus
=
true
;
},
200
);
}
}
};
</
script
>
<
style
scoped
lang=
"scss"
>
@import
'@/assets/css/stockRecheck/print.scss'
;
</
style
>
\ No newline at end of file
util/api.js
View file @
aea99c25
//
const API_BASE_USER = 'http://user.liexindev.net'; //用户系统
//
const API_BASE_PUR = 'http://pur.liexindev.net'; //采购系统
//
const API_BASE = 'http://wms.liexindev.net'; //WMS系统
//
const API_BASE_OSS = 'http://image.liexindev.net'; //oss系统
const
API_BASE_USER
=
'http://user.liexindev.net'
;
//用户系统
const
API_BASE_PUR
=
'http://pur.liexindev.net'
;
//采购系统
const
API_BASE
=
'http://wms.liexindev.net'
;
//WMS系统
const
API_BASE_OSS
=
'http://image.liexindev.net'
;
//oss系统
const
API_BASE_USER
=
'https://user.ichunt.net'
;
//用户系统
const
API_BASE_PUR
=
'https://purchase.ichunt.net'
;
//采购系统
const
API_BASE
=
'https://wms.ichunt.net'
;
//WMS系统
const
API_BASE_OSS
=
'https://image.ichunt.net'
;
//oss系统
//
const API_BASE_USER = 'https://user.ichunt.net'; //用户系统
//
const API_BASE_PUR = 'https://purchase.ichunt.net'; //采购系统
//
const API_BASE = 'https://wms.ichunt.net'; //WMS系统
//
const API_BASE_OSS = 'https://image.ichunt.net'; //oss系统
const
API
=
{
...
...
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