Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
factory_front
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
qinjianhui
factory_front
Commits
bf27a69d
Commit
bf27a69d
authored
Sep 04, 2025
by
wusiyi
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev'
parents
c1fbf91c
c17bd18e
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
1817 additions
and
218 deletions
+1817
-218
src/api/podCnOrder.ts
+62
-0
src/store/cnSuperOrder.ts
+92
-0
src/types/api/auth.ts
+1
-0
src/types/api/billOrder.ts
+150
-132
src/types/api/deliveryNote.ts
+62
-42
src/utils/cnSuperWebsocket.ts
+233
-0
src/views/order/podCN/SuperPodMakeOrder.vue
+1069
-0
src/views/order/podCN/index.vue
+32
-1
src/views/podUsBillOrder/index.vue
+116
-43
No files found.
src/api/podCnOrder.ts
View file @
bf27a69d
...
@@ -33,6 +33,8 @@ export function syncReceiverAddress(data: number[]) {
...
@@ -33,6 +33,8 @@ export function syncReceiverAddress(data: number[]) {
data
,
data
,
)
)
}
}
// 播种墙配货 扫码放入箱子
export
function
getPackingCnDataApi
(
export
function
getPackingCnDataApi
(
code
:
string
,
code
:
string
,
factoryNo
:
number
,
factoryNo
:
number
,
...
@@ -51,6 +53,25 @@ export function getPackingCnDataApi(
...
@@ -51,6 +53,25 @@ export function getPackingCnDataApi(
},
},
)
)
}
}
// 超级播种墙配货 扫码放入箱子
export
function
getSuperPackingCnDataApi
(
code
:
string
,
factoryNo
:
number
,
box
:
number
|
null
,
)
{
return
axios
.
get
<
never
,
BaseRespData
<
PodMakeOrderData
>>
(
'super/factory/podJomallOrderCn/getPodBoxDetailsBySkuOrNo'
,
{
params
:
{
podJomallCnNo
:
code
,
box
,
factoryNo
,
},
},
)
}
export
function
refreshAddressApi
(
idList
:
number
[])
{
export
function
refreshAddressApi
(
idList
:
number
[])
{
return
axios
.
post
<
never
,
BaseRespData
<
never
>>
(
return
axios
.
post
<
never
,
BaseRespData
<
never
>>
(
'factory/podJomallOrderCn/syncReceiverAddress'
,
'factory/podJomallOrderCn/syncReceiverAddress'
,
...
@@ -237,6 +258,7 @@ export function getPackingDataApi(
...
@@ -237,6 +258,7 @@ export function getPackingDataApi(
},
},
)
)
}
}
// 播种墙配货 获取pod订单拣货箱子详情
export
function
getPodBoxListApi
(
export
function
getPodBoxListApi
(
factoryNo
:
number
|
string
,
factoryNo
:
number
|
string
,
warehouseId
:
number
|
string
,
warehouseId
:
number
|
string
,
...
@@ -249,6 +271,15 @@ export function getPodBoxListApi(
...
@@ -249,6 +271,15 @@ export function getPodBoxListApi(
)
)
}
}
// 超级播种墙配货 获取pod订单拣货箱子详情
export
function
getSuperPodBoxListApi
(
factoryNo
:
number
|
string
)
{
return
axios
.
get
<
never
,
BaseRespData
<
PodMakeOrderData
[]
>>
(
'super/factory/podJomallOrderCn/getPodBoxOrderDetails'
,
{
params
:
{
factoryNo
}
},
)
}
// 播种墙配货 打单完成
export
function
submitInspectionApi
(
export
function
submitInspectionApi
(
data
:
{
id
:
number
;
version
?:
number
}[],
data
:
{
id
:
number
;
version
?:
number
}[],
boxIndex
:
number
|
null
,
boxIndex
:
number
|
null
,
...
@@ -261,6 +292,20 @@ export function submitInspectionApi(
...
@@ -261,6 +292,20 @@ export function submitInspectionApi(
},
},
)
)
}
}
// 超级播种墙配货 打单完成
export
function
submitSuperInspectionApi
(
data
:
{
id
:
number
;
version
?:
number
}[],
boxIndex
:
number
|
null
,
)
{
return
axios
.
post
<
never
,
BaseRespData
<
never
>>
(
`super/factory/podJomallOrderCn/podPrintOrderComplete?box=
${
boxIndex
}
`
,
{
orderParamList
:
data
,
},
)
}
// 播种墙配货 根据箱子删除pod订单拣货箱子详情
export
function
clearBoxApi
(
export
function
clearBoxApi
(
factoryNo
:
number
,
factoryNo
:
number
,
box
:
number
|
null
,
box
:
number
|
null
,
...
@@ -273,11 +318,28 @@ export function clearBoxApi(
...
@@ -273,11 +318,28 @@ export function clearBoxApi(
},
},
)
)
}
}
// 超级播种墙配货 根据箱子删除pod订单拣货箱子详情
export
function
clearSuperBoxApi
(
factoryNo
:
number
,
box
:
number
|
null
)
{
return
axios
.
get
<
never
,
BaseRespData
<
never
>>
(
'super/factory/podJomallOrderCn/delPodBoxOrderDetailsByBox'
,
{
params
:
{
factoryNo
,
box
},
},
)
}
// 播种墙配货 删除pod订单拣货箱子详情
export
function
clearAllBoxApi
()
{
export
function
clearAllBoxApi
()
{
return
axios
.
get
<
never
,
BaseRespData
<
never
>>
(
return
axios
.
get
<
never
,
BaseRespData
<
never
>>
(
'factory/podJomallOrderCn/delPodBoxOrderDetails'
,
'factory/podJomallOrderCn/delPodBoxOrderDetails'
,
)
)
}
}
// 超级播种墙配货 删除pod订单拣货箱子详情
export
function
clearSuperAllBoxApi
()
{
return
axios
.
get
<
never
,
BaseRespData
<
never
>>
(
'super/factory/podJomallOrderCn/delPodBoxOrderDetails'
,
)
}
export
function
updateRemarkApi
(
id
:
number
,
content
:
string
)
{
export
function
updateRemarkApi
(
id
:
number
,
content
:
string
)
{
return
axios
.
post
<
never
,
BaseRespData
<
never
>>
(
return
axios
.
post
<
never
,
BaseRespData
<
never
>>
(
'factory/podJomallOrderCn/addRemark'
,
'factory/podJomallOrderCn/addRemark'
,
...
...
src/store/cnSuperOrder.ts
0 → 100644
View file @
bf27a69d
import
{
defineStore
}
from
'pinia'
import
{
OrderData
,
PodMakeOrderData
,
ProductList
,
}
from
'@/types/api/podMakeOrder'
import
{
getSuperPodBoxListApi
}
from
'@/api/podCnOrder'
export
interface
OrderStoreState
{
podBoxList
?:
PodMakeOrderData
[]
podBoxIndex
?:
number
|
null
socketConnect
?:
string
}
const
useOrderStore
=
defineStore
(
'cnSuperOrder'
,
{
state
:
()
=>
{
return
{
podBoxList
:
[],
podBoxIndex
:
null
,
socketConnect
:
''
,
}
as
OrderStoreState
},
actions
:
{
async
setPodBoxList
(
content
:
{
boxList
:
PodMakeOrderData
[]
|
OrderData
|
null
factoryNo
:
number
|
string
box
?:
number
data
?:
OrderData
})
{
const
{
factoryNo
,
boxList
,
box
,
data
}
=
content
if
(
Array
.
isArray
(
boxList
))
{
this
.
podBoxList
=
boxList
}
else
{
const
index
=
this
.
podBoxList
?.
findIndex
((
item
)
=>
item
.
box
===
box
)
if
(
index
===
-
1
)
{
try
{
const
res
=
await
getSuperPodBoxListApi
(
factoryNo
)
const
boxList
=
res
.
data
.
map
((
item
)
=>
{
if
(
res
.
data
)
{
const
productList
=
item
?.
data
?.
productList
||
[]
const
pickingNumber
=
productList
.
reduce
(
(
prev
:
number
,
item1
:
ProductList
)
=>
{
if
(
item1
.
count
)
{
return
prev
+
item1
.
count
}
return
prev
},
0
,
)
if
(
item
.
data
)
{
item
.
data
.
pickingNumber
=
pickingNumber
}
}
return
item
})
this
.
podBoxList
=
boxList
this
.
podBoxIndex
=
box
}
catch
(
error
)
{
console
.
error
(
error
)
}
}
else
if
(
box
!==
0
&&
box
!==
undefined
)
{
const
arr
=
this
.
podBoxList
if
(
arr
)
{
arr
[
box
-
1
]
=
{
box
,
data
:
data
||
boxList
||
null
,
}
}
this
.
podBoxList
=
arr
this
.
podBoxIndex
=
box
}
}
},
// 清空所有箱子
clearPodBoxList
()
{
this
.
podBoxList
=
[]
},
// 设置当前箱子
setPodBox
(
box
:
number
)
{
this
.
podBoxIndex
=
box
},
// 清空当前箱子
clearPodBox
()
{
this
.
podBoxIndex
=
null
},
setSocketConnect
(
connect
:
string
)
{
this
.
socketConnect
=
connect
},
},
})
export
default
useOrderStore
src/types/api/auth.ts
View file @
bf27a69d
...
@@ -37,4 +37,5 @@ export interface Factory {
...
@@ -37,4 +37,5 @@ export interface Factory {
goodsNumber
:
number
goodsNumber
:
number
authorizeNumber
:
number
authorizeNumber
:
number
status
:
number
status
:
number
dropShipping
?:
boolean
}
}
src/types/api/billOrder.ts
View file @
bf27a69d
...
@@ -22,6 +22,23 @@ export interface AccountStatementNoteSearchForm {
...
@@ -22,6 +22,23 @@ export interface AccountStatementNoteSearchForm {
end_time
?:
string
end_time
?:
string
}
}
export
interface
AccountStatementNoteSearchFormUS
{
user_mark
?:
string
status
?:
number
|
string
|
null
dateRange
?:
string
[]
billNumber
?:
string
subOrderNumber
?:
string
shipmentNumber
?:
string
rec_number
?:
string
order_number
?:
string
factory_status
?:
string
erp_status
?:
string
startTime
?:
string
start_time
?:
string
endTime
?:
string
end_time
?:
string
}
export
interface
AccountStatementNote
{
export
interface
AccountStatementNote
{
create_time
?:
string
create_time
?:
string
product_total_amount
?:
number
product_total_amount
?:
number
...
@@ -29,6 +46,7 @@ export interface AccountStatementNote {
...
@@ -29,6 +46,7 @@ export interface AccountStatementNote {
pass_num
?:
number
pass_num
?:
number
factory_code
?:
string
factory_code
?:
string
total_amount
?:
string
|
number
total_amount
?:
string
|
number
totalAmount
?:
string
|
number
actual_amount
?:
string
|
number
actual_amount
?:
string
|
number
num
?:
number
num
?:
number
end_time
?:
string
end_time
?:
string
...
@@ -96,143 +114,143 @@ export interface ItemList {
...
@@ -96,143 +114,143 @@ export interface ItemList {
factory_order_number
?:
string
factory_order_number
?:
string
}
}
export
interface
OrderDetails
{
export
interface
OrderDetails
{
pass_num
:
number
;
pass_num
:
number
num
:
number
;
num
:
number
not_pass_num
:
number
;
not_pass_num
:
number
erp_order_number
:
string
|
null
;
erp_order_number
:
string
|
null
product_total_amount
:
number
;
product_total_amount
:
number
carriage_total_amount
:
number
;
carriage_total_amount
:
number
craft_total_price
:
number
;
craft_total_price
:
number
info_id
:
number
;
info_id
:
number
template_total_price
:
number
;
template_total_price
:
number
id
:
number
;
id
:
number
order_id
:
string
;
order_id
:
string
factory_order_number
:
string
;
factory_order_number
:
string
order
:
{
order
:
{
receiver_post_code
:
string
;
receiver_post_code
:
string
payment_time
:
string
|
null
;
payment_time
:
string
|
null
actual_amount
:
number
;
actual_amount
:
number
adjusted_amount
:
number
;
adjusted_amount
:
number
factory_no
:
number
;
factory_no
:
number
factory_online_id
:
string
|
null
;
factory_online_id
:
string
|
null
total_product_amount
:
number
|
null
;
total_product_amount
:
number
|
null
process_number
:
string
;
process_number
:
string
track_status
:
number
;
track_status
:
number
id
:
string
;
id
:
string
receiver_country
:
string
;
receiver_country
:
string
factory_order_number
:
string
;
factory_order_number
:
string
prepaid_amount
:
number
;
prepaid_amount
:
number
receiver_province
:
string
;
receiver_province
:
string
create_time
:
string
;
create_time
:
string
weight
:
number
;
weight
:
number
product_num
:
number
;
product_num
:
number
version
:
number
;
version
:
number
finish_time
:
string
;
finish_time
:
string
start_stocking_time
:
string
;
start_stocking_time
:
string
payment_type
:
string
|
null
;
payment_type
:
string
|
null
warehouse_name
:
string
;
warehouse_name
:
string
total_amount
:
number
;
total_amount
:
number
logistics_way_code
:
string
;
logistics_way_code
:
string
third_order_number
:
string
;
third_order_number
:
string
shop_number
:
string
;
shop_number
:
string
express_sheet
:
string
;
express_sheet
:
string
status
:
string
;
status
:
string
production_client
:
string
;
production_client
:
string
statusStr
:
string
;
statusStr
:
string
receiver_city
:
string
;
receiver_city
:
string
remark
:
string
|
null
;
remark
:
string
|
null
exception_reason
:
string
|
null
;
exception_reason
:
string
|
null
platform
:
string
;
platform
:
string
update_time
:
string
;
update_time
:
string
receiver_address2
:
string
;
receiver_address2
:
string
receiver_address1
:
string
;
receiver_address1
:
string
receiver_name
:
string
;
receiver_name
:
string
tracking_number
:
string
;
tracking_number
:
string
product_amount
:
number
;
product_amount
:
number
carriage_amount
:
number
|
null
;
carriage_amount
:
number
|
null
pay_freight
:
number
;
pay_freight
:
number
logistics_way_name
:
string
;
logistics_way_name
:
string
factory_code
:
string
;
factory_code
:
string
receiver_district
:
string
|
null
;
receiver_district
:
string
|
null
temu_logistics_way_id
:
string
|
null
;
temu_logistics_way_id
:
string
|
null
logistics_way_id
:
number
;
logistics_way_id
:
number
user_mark
:
string
;
user_mark
:
string
namespace
:
string
;
namespace
:
string
receiver_phone
:
string
;
receiver_phone
:
string
exception_handling
:
number
;
exception_handling
:
number
shipment_type
:
number
;
shipment_type
:
number
warehouse_id
:
number
;
warehouse_id
:
number
}
;
}
}
}
export
interface
ProductDetails
{
export
interface
ProductDetails
{
diy_id
:
string
;
diy_id
:
string
diy_bianma
:
string
;
diy_bianma
:
string
base_sku
:
string
;
base_sku
:
string
sub_order_number
:
string
;
sub_order_number
:
string
price_update_remark
:
string
|
null
;
price_update_remark
:
string
|
null
price_status
:
boolean
;
price_status
:
boolean
template_item_sku
:
string
|
null
;
template_item_sku
:
string
|
null
product_id
:
string
;
product_id
:
string
id
:
number
;
id
:
number
shipment_num
:
number
;
shipment_num
:
number
product_item_id
:
string
|
null
;
product_item_id
:
string
|
null
template_price
:
number
;
template_price
:
number
product
:
{
product
:
{
diy_id
:
string
;
diy_id
:
string
end_product_id
:
string
;
end_product_id
:
string
category_name
:
string
;
category_name
:
string
craft_name
:
string
;
craft_name
:
string
base_sku
:
string
;
base_sku
:
string
num
:
number
;
num
:
number
is_production
:
boolean
;
is_production
:
boolean
pick_finish
:
number
;
pick_finish
:
number
remark
:
string
|
null
;
remark
:
string
|
null
product_price
:
number
;
product_price
:
number
third_stock_sku
:
string
|
null
;
third_stock_sku
:
string
|
null
customized_quantity
:
number
;
customized_quantity
:
number
template_price
:
number
;
template_price
:
number
tag_ids
:
string
|
null
;
tag_ids
:
string
|
null
create_time
:
string
;
create_time
:
string
third_sub_order_number
:
string
;
third_sub_order_number
:
string
factory_sub_order_number
:
string
;
factory_sub_order_number
:
string
variant_image
:
string
;
variant_image
:
string
craft_code
:
string
;
craft_code
:
string
pass_num
:
number
;
pass_num
:
number
factory_code
:
string
;
factory_code
:
string
pay_amount
:
number
;
pay_amount
:
number
weight
:
number
;
weight
:
number
is_replenishment
:
number
;
is_replenishment
:
number
image_ary
:
Array
<
{
title
:
string
;
url
:
string
}
>
;
image_ary
:
Array
<
{
title
:
string
;
url
:
string
}
>
design_images
:
Array
<
{
design_images
:
Array
<
{
imageUrl
:
string
;
imageUrl
:
string
fileUrl
:
string
;
fileUrl
:
string
id
:
string
;
id
:
string
title
:
string
;
title
:
string
materialId
:
string
;
materialId
:
string
materialImage
:
string
;
materialImage
:
string
}
>
;
}
>
not_pass_num
:
number
;
not_pass_num
:
number
version
:
number
;
version
:
number
supplier_product_no
:
string
|
null
;
supplier_product_no
:
string
|
null
pod_jomall_order_us_id
:
string
;
pod_jomall_order_us_id
:
string
craft_price
:
number
;
craft_price
:
number
customs_value
:
number
;
customs_value
:
number
variant_sku
:
string
;
variant_sku
:
string
batch_arrange_number
:
string
;
batch_arrange_number
:
string
trim_design_images
:
string
|
null
;
trim_design_images
:
string
|
null
}
;
}
product_item_sku
:
string
|
null
;
product_item_sku
:
string
|
null
item_id
:
number
;
item_id
:
number
variant_image
:
string
;
variant_image
:
string
pass_num
:
number
;
pass_num
:
number
not_pass_num
:
number
|
null
;
not_pass_num
:
number
|
null
craft_price
:
number
;
craft_price
:
number
price_update_time
:
string
|
null
;
price_update_time
:
string
|
null
variant_sku
:
string
;
variant_sku
:
string
info_id
:
number
;
info_id
:
number
shop_number
:
string
;
shop_number
:
string
template_item_id
:
string
|
null
;
template_item_id
:
string
|
null
order_id
:
string
;
order_id
:
string
}
}
export
interface
ConfirmOrderForm
{
export
interface
ConfirmOrderForm
{
...
...
src/types/api/deliveryNote.ts
View file @
bf27a69d
...
@@ -189,55 +189,55 @@ export interface DbFactory {
...
@@ -189,55 +189,55 @@ export interface DbFactory {
}
}
export
interface
IDetailData
{
export
interface
IDetailData
{
statusStr
?:
string
;
statusStr
?:
string
id
:
string
;
id
:
string
erp_id
?:
string
;
erp_id
?:
string
namespace
?:
string
;
namespace
?:
string
dbFactory
?:
DbFactory
|
null
;
dbFactory
?:
DbFactory
|
null
factory
?:
DbFactory
|
null
;
factory
?:
DbFactory
|
null
productList
?:
Product
[]
;
productList
?:
Product
[]
order_number
?:
string
;
order_number
?:
string
factory_order_number
?:
string
;
factory_order_number
?:
string
erp_order_number
?:
string
;
erp_order_number
?:
string
third_order_number
?:
string
;
third_order_number
?:
string
shop_number
?:
string
;
shop_number
?:
string
product_num
?:
string
|
number
;
product_num
?:
string
|
number
start_stocking_time
?:
string
;
start_stocking_time
?:
string
finish_time
?:
string
;
finish_time
?:
string
delivery_type
?:
string
;
delivery_type
?:
string
logistics_way_name
?:
string
;
logistics_way_name
?:
string
lanshou_name
?:
string
;
lanshou_name
?:
string
receiver_name
?:
string
;
receiver_name
?:
string
lanshou_phone
?:
string
;
lanshou_phone
?:
string
receiver_phone
?:
string
;
receiver_phone
?:
string
lanshou_region
?:
string
;
lanshou_region
?:
string
receiver_province
?:
string
;
receiver_province
?:
string
lanshou_address
?:
string
;
lanshou_address
?:
string
receiver_city
?:
string
;
receiver_city
?:
string
receiver_district
?:
string
;
receiver_district
?:
string
receiver_address1
?:
string
;
receiver_address1
?:
string
lanshou_post
?:
string
;
lanshou_post
?:
string
receiver_post_code
?:
string
;
receiver_post_code
?:
string
user_mark
?:
string
;
user_mark
?:
string
price
?:
number
price
?:
number
customized_quantityStr
?:
string
customized_quantityStr
?:
string
product_price
?:
string
product_price
?:
string
customized_quantity
:
number
customized_quantity
:
number
image_ary
?:
string
|
null
image_ary
?:
string
|
null
[
propName
:
string
]:
string
|
number
|
boolean
|
undefined
|
unknown
;
[
propName
:
string
]:
string
|
number
|
boolean
|
undefined
|
unknown
}
}
export
interface
PodUsDetailData
{
export
interface
PodUsDetailData
{
id
:
number
id
:
number
erp_id
?:
string
;
erp_id
?:
string
price
?:
number
;
price
?:
number
customized_quantityStr
?:
string
;
customized_quantityStr
?:
string
product_price
?:
number
;
product_price
?:
number
// 其他已有属性...
// 其他已有属性...
customized_quantity
:
number
;
// 添加缺失属性
customized_quantity
:
number
// 添加缺失属性
image_ary
?:
string
|
null
;
// 添加缺失属性
image_ary
?:
string
|
null
// 添加缺失属性
productList
:
IDetailData
[]
productList
:
IDetailData
[]
[
propName
:
string
]:
string
|
number
|
boolean
|
undefined
|
unknown
;
[
propName
:
string
]:
string
|
number
|
boolean
|
undefined
|
unknown
}
}
export
interface
LogListsData
{
export
interface
LogListsData
{
id
:
number
id
:
number
...
@@ -276,6 +276,26 @@ export interface DetailForm {
...
@@ -276,6 +276,26 @@ export interface DetailForm {
pageSize
?:
number
pageSize
?:
number
infoId
?:
number
infoId
?:
number
}
}
export
interface
DetailFormUS
{
shop_number
?:
string
billNumber
?:
string
order_number
?:
string
craft_code
?:
string
base_sku
?:
string
shipment_number
?:
string
process
?:
string
supplierItemNo
?:
string
dateRange
?:
string
[]
endTime
?:
string
startTime
?:
string
sub_order_number
?:
string
rows
?:
number
page
?:
number
currentPage
?:
number
pageSize
?:
number
infoId
?:
number
}
export
interface
BillForm
{
export
interface
BillForm
{
timeRange
:
[
string
,
string
]
|
[]
timeRange
:
[
string
,
string
]
|
[]
}
}
...
...
src/utils/cnSuperWebsocket.ts
0 → 100644
View file @
bf27a69d
import
{
getWsUrl
}
from
'../api/axios'
import
useOrderStore
from
'../store/cnSuperOrder'
interface
NotificationOptions
{
body
:
string
icon
:
string
data
:
string
requireInteraction
:
boolean
}
export
interface
WebSocketMessage
{
code
?:
string
content
?:
string
type
?:
string
data
?:
unknown
[
key
:
string
]:
string
|
unknown
|
undefined
}
interface
InitOptions
{
account
:
string
factoryNo
:
string
}
type
MessageCallback
=
(
data
:
WebSocketMessage
,
sendSystemMessage
:
(
msg
:
string
)
=>
void
,
)
=>
void
type
OpenCallback
=
()
=>
void
function
sendSystemMessage
(
msg
:
string
):
void
{
if
(
window
.
Notification
&&
Notification
.
permission
===
'granted'
)
{
const
notificationOptions
:
NotificationOptions
=
{
body
:
msg
,
icon
:
'./favicon.ico'
,
data
:
'I like peas.'
,
requireInteraction
:
true
,
}
const
n
=
new
Notification
(
'消息通知'
,
notificationOptions
)
n
.
onclick
=
(
event
:
Event
)
=>
{
event
.
preventDefault
()
window
.
open
(
'/home'
,
'_blank'
)
}
setTimeout
(()
=>
{
n
.
close
()
},
10000
)
}
}
const
showReconnectingMsg
=
():
void
=>
{
ElMessageBox
.
alert
(
'消息服务已断开,正在重新连接,请稍候'
,
{
showClose
:
true
,
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
,
})
}
class
Im
{
private
socket
:
WebSocket
|
null
=
null
private
_wsUrl
:
string
=
''
// private userId: string = ''
private
_onMessageCallback
?:
MessageCallback
private
_onOpenCallback
?:
OpenCallback
private
_heartbeatTimer
:
number
|
null
=
null
private
_heartbeatTimeoutTimer
:
number
|
null
=
null
private
_reconnectingTimer
:
number
|
null
=
null
private
num
:
number
=
0
constructor
()
{
this
.
_onWsOpen
=
this
.
_onWsOpen
.
bind
(
this
)
this
.
_onWsMessage
=
this
.
_onWsMessage
.
bind
(
this
)
this
.
_onWsClose
=
this
.
_onWsClose
.
bind
(
this
)
this
.
_onWsError
=
this
.
_onWsError
.
bind
(
this
)
}
private
_onWsOpen
():
void
{
console
.
log
(
'服务器连接成功'
)
localStorage
.
setItem
(
'socket_connect'
,
'online'
)
this
.
_onOpenCallback
?.()
this
.
_startHeartbeat
()
}
private
_onWsMessage
(
event
:
MessageEvent
):
void
{
let
data
:
WebSocketMessage
=
{}
if
(
typeof
event
.
data
===
'string'
)
{
try
{
data
=
JSON
.
parse
(
event
.
data
)
}
catch
(
error
)
{
data
=
{}
}
}
this
.
_onHeartbeatMessage
()
this
.
_onMessageCallback
?.(
data
,
sendSystemMessage
)
}
private
_onWsClose
():
void
{
console
.
log
(
'服务器关闭'
)
this
.
_destroyWebSocket
(
true
)
}
private
_onWsError
():
void
{
console
.
log
(
'连接出错'
)
this
.
_destroyWebSocket
(
true
)
}
private
_sendHeartbeat
():
void
{
if
(
!
this
.
socket
)
return
this
.
send
({
code
:
'HEALTH'
})
if
(
this
.
_heartbeatTimeoutTimer
)
{
window
.
clearTimeout
(
this
.
_heartbeatTimeoutTimer
)
}
this
.
_heartbeatTimeoutTimer
=
window
.
setTimeout
(()
=>
{
this
.
_destroyWebSocket
(
true
)
},
5
*
1000
)
}
private
_onHeartbeatMessage
():
void
{
console
.
log
(
'心跳'
)
useOrderStore
().
setSocketConnect
(
'online'
)
if
(
this
.
_heartbeatTimeoutTimer
)
{
window
.
clearTimeout
(
this
.
_heartbeatTimeoutTimer
)
}
}
private
_startHeartbeat
():
void
{
this
.
_stopHeartbeat
()
this
.
_sendHeartbeat
()
this
.
_heartbeatTimer
=
window
.
setInterval
(
()
=>
this
.
_sendHeartbeat
(),
10
*
1000
,
)
}
private
_stopHeartbeat
():
void
{
if
(
this
.
_heartbeatTimer
)
{
window
.
clearInterval
(
this
.
_heartbeatTimer
)
}
if
(
this
.
_heartbeatTimeoutTimer
)
{
window
.
clearTimeout
(
this
.
_heartbeatTimeoutTimer
)
}
}
private
_scheduleReconnect
():
void
{
if
(
!
this
.
num
)
this
.
num
=
0
this
.
num
++
if
(
this
.
num
>
5
)
{
ElMessageBox
.
alert
(
'尝试重连消息服务失败,请刷新重试'
)
return
}
showReconnectingMsg
()
this
.
_reconnectingTimer
=
window
.
setTimeout
(()
=>
{
this
.
_createWebSocket
()
},
2000
)
}
private
_destroyWebSocket
(
reconnect
?:
boolean
):
void
{
if
(
!
this
.
socket
)
return
this
.
_stopHeartbeat
()
if
(
this
.
_reconnectingTimer
)
{
window
.
clearTimeout
(
this
.
_reconnectingTimer
)
}
this
.
socket
.
removeEventListener
(
'open'
,
this
.
_onWsOpen
)
this
.
socket
.
removeEventListener
(
'message'
,
this
.
_onWsMessage
)
this
.
socket
.
removeEventListener
(
'close'
,
this
.
_onWsClose
)
this
.
socket
.
removeEventListener
(
'error'
,
this
.
_onWsError
)
this
.
socket
.
close
(
1000
)
this
.
socket
=
null
localStorage
.
removeItem
(
'socket_connect'
)
useOrderStore
().
setSocketConnect
(
'offline'
)
if
(
reconnect
)
this
.
_scheduleReconnect
()
}
private
_createWebSocket
():
void
{
if
(
!
this
.
_wsUrl
)
return
const
socket
=
new
WebSocket
(
this
.
_wsUrl
)
socket
.
addEventListener
(
'open'
,
this
.
_onWsOpen
)
socket
.
addEventListener
(
'message'
,
this
.
_onWsMessage
)
socket
.
addEventListener
(
'close'
,
this
.
_onWsClose
)
socket
.
addEventListener
(
'error'
,
this
.
_onWsError
)
this
.
socket
=
socket
}
init
(
options
:
InitOptions
,
msgfunc
?:
MessageCallback
,
openfunc
?:
OpenCallback
,
):
Promise
<
void
>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
const
{
account
,
factoryNo
}
=
options
const
socket_connect
=
localStorage
.
getItem
(
'socket_connect'
)
if
(
socket_connect
===
'online'
)
{
resolve
()
return
}
if
(
!
window
.
WebSocket
)
{
reject
(
new
Error
(
'WebSocket is not supported'
))
return
}
this
.
_onMessageCallback
=
msgfunc
this
.
_onOpenCallback
=
()
=>
{
openfunc
?.()
resolve
()
}
this
.
_destroyWebSocket
()
this
.
_wsUrl
=
`
${
getWsUrl
()}
/ws/websocket/
${
factoryNo
}
/
${
account
}
`
this
.
_createWebSocket
()
})
}
send
(
options
:
WebSocketMessage
):
void
{
this
.
socket
?.
send
(
JSON
.
stringify
(
options
))
}
close
():
void
{
this
.
_destroyWebSocket
()
}
}
export
default
new
Im
()
src/views/order/podCN/SuperPodMakeOrder.vue
0 → 100644
View file @
bf27a69d
<
template
>
<ElDialog
v-model=
"visible"
title=
"超级播种墙配货"
fullscreen
:close-on-click-modal=
"false"
:close-on-press-escape=
"false"
:before-close=
"handleClose"
style=
"top: 60px"
modal-class=
"pod-make-order-dialog"
@
opened=
"handleOpened"
@
close=
"onClose"
>
<template
#
header
>
<div
class=
"title"
>
<span>
超级播种墙配货
</span>
<span
v-if=
"socketConnect === 'online'"
class=
"online"
>
[在线]
</span>
<span
v-else
class=
"offline"
>
[离线]
</span>
</div>
</
template
>
<div
class=
"pod-make-order-content"
>
<div
class=
"left-content"
>
<div
class=
"head-form"
>
<div
class=
"form-item"
>
<ElSelect
v-model=
"sheetPrinter"
placeholder=
"请选择打印机"
style=
"width: 200px"
@
change=
"handlePrinterChange"
>
<ElOption
v-for=
"item in printDeviceList"
:key=
"item"
:label=
"item"
:value=
"item"
/>
</ElSelect>
</div>
<div
class=
"form-item"
style=
"flex: 1"
>
<ElInput
ref=
"productionOrderRef"
v-model=
"productionOrder"
placeholder=
"请输入生产单号"
clearable
style=
"width: 100%"
@
keyup
.
enter=
"handleSearch"
/>
</div>
<div
class=
"form-item"
>
<ElButton
type=
"primary"
@
click=
"handleSearch"
>
查询
</ElButton>
</div>
<div
class=
"form-item"
>
<ElButton
type=
"danger"
@
click=
"clearAllBox"
>
清空所有箱子
</ElButton>
</div>
</div>
<div
class=
"basic-info"
>
<div
class=
"basic-info-item"
>
<span>
物流跟踪号:
</span>
<span>
{{ podOrderDetailsData?.trackingNumber }}
</span>
</div>
<div
class=
"basic-info-item"
>
<span>
店铺单号:
</span>
<span>
{{ podOrderDetailsData?.shopNumber }}
</span>
</div>
<div
class=
"basic-info-item"
>
<span>
商品总数量:
</span>
<span>
{{ podOrderDetailsData?.purchaseNumber }}
</span>
</div>
<div
class=
"basic-info-item"
>
<span>
拣货数量:
</span>
<span>
{{ podOrderDetailsData?.pickingNumber }}
</span>
</div>
<!-- <div class="basic-info-item">
<span>物流公司:</span>
<span></span>
</div>
<div class="basic-info-item">
<span>物流方式:</span>
<span></span>
</div> -->
<div
class=
"basic-info-item"
>
<span>
发货备注:
</span>
<span>
{{ podOrderDetailsData?.remark }}
</span>
</div>
<div
class=
"basic-info-item"
>
<span>
订单号:
</span>
<span>
{{ podOrderDetailsData?.factoryOrderNumber }}
</span>
</div>
</div>
<div
class=
"table-content"
>
<TableView
ref=
"tableRef"
:paginated-data=
"podOrderDetailsData?.productList || []"
:columns=
"podOrderDetailsColumns"
highlight-current-row
@
row-click=
"handleRowClick"
>
<
template
#
image=
"{ row }"
>
<div
style=
"display: flex; flex-wrap: nowrap"
v-if=
"row.previewImgs?.length"
>
<div
v-for=
"img in row.previewImgs"
:key=
"img"
@
click
.
stop=
"handleCurrentChange(img.url)"
style=
"cursor: pointer; margin-right: 5px; flex: 1"
>
<img
v-if=
"img.url"
:src=
"img.url"
alt=
""
/>
</div>
</div>
</
template
>
<
template
#
verifyResult=
"{ row }"
>
<el-icon
v-if=
"row.power"
style=
"color: #00cc00; font-size: 24px; font-weight: 900"
><Check
/></el-icon>
</
template
>
</TableView>
</div>
</div>
<div
class=
"middle-content"
>
<div
class=
"box-top"
>
<div
class=
"box-top-item"
>
<span
class=
"box-top-item-box-index"
>
{{ boxIndex }}
</span>
<span
class=
"box-top-item-box-index-text"
>
号箱
</span>
<span
style=
"font-size: 30px"
>
放入第
</span>
<div
class=
"box-top-item-box-index-number"
>
{{ podOrderDetailsData?.pickingNumber }}
</div>
<span
style=
"font-size: 30px"
>
件商品
</span>
</div>
<div
class=
"box-top-item-status"
>
<span
v-if=
"
podOrderDetailsData?.pickingNumber &&
podOrderDetailsData?.purchaseNumber &&
podOrderDetailsData?.pickingNumber ===
podOrderDetailsData?.purchaseNumber
"
>
<span
v-if=
"podOrderDetailsData?.printResult"
>
面单{{ renderPrintResult(podOrderDetailsData?.printResult) }}
</span>
<span
v-else
>
面单打印中。。。
</span>
</span>
<span
v-else
>
验货中。。。
</span>
</div>
<div
class=
"box-top-item-btn"
>
<ElButton
type=
"primary"
@
click=
"podOrderDetailsData && print(podOrderDetailsData, true)"
>
手动打印
</ElButton
>
<ElButton
type=
"success"
@
click=
"handlePrintFinish"
>
打单完成
</ElButton
>
<ElButton
type=
"danger"
@
click=
"handleClearBox"
>
清空箱子
</ElButton>
</div>
<div
v-if=
"
podOrderDetailsData?.productList?.length &&
podOrderDetailsData?.productList?.length > 1
"
class=
"multiple-title"
>
<span
class=
"multiple-title-text"
>
多
</span>
</div>
</div>
<div
class=
"order-image"
>
<img
:src=
"coverImage"
alt=
""
/>
</div>
</div>
<div
class=
"right-content"
>
<div
class=
"box-list"
>
<div
v-for=
"(item, index) in podBoxList"
:key=
"item.box"
class=
"box-list-item"
:class=
"{
active: item.box && boxIndex == item.box,
isNull: !item.data,
badge: handleProduct(item.data || {}),
}"
@
click=
"handleBoxClick(item)"
>
<span
style=
"font-weight: bold"
:title=
"index + 1 + '号箱'"
>
{{ index + 1 }}
</span>
<span
v-if=
"item.data"
class=
"number"
>
{{ item.data.pickingNumber }}/{{ item.data.purchaseNumber }}
</span>
</div>
</div>
</div>
</div>
</ElDialog>
</template>
<
script
setup
lang=
"ts"
>
import
{
computed
,
nextTick
,
ref
,
watch
}
from
'vue'
import
useLodop
from
'@/utils/hooks/useLodop'
import
TableView
from
'@/components/TableView.vue'
import
type
{
WebSocketMessage
}
from
'@/utils/cnSuperWebsocket'
import
{
OrderData
,
PodMakeOrderData
,
ProductList
,
}
from
'@/types/api/podMakeOrder'
import
useOrderStore
from
'@/store/cnSuperOrder'
import
{
getSuperPackingCnDataApi
,
clearSuperBoxApi
,
clearSuperAllBoxApi
,
getSuperPodBoxListApi
,
submitSuperInspectionApi
,
}
from
'@/api/podCnOrder'
import
useUserStore
from
'@/store/user'
import
{
Check
}
from
'@element-plus/icons-vue'
import
socket
from
'@/utils/cnSuperWebsocket'
const
{
getCLodop
}
=
useLodop
()
const
userStore
=
useUserStore
()
const
props
=
defineProps
<
{
modelValue
:
boolean
printOrder
:
(
data
:
OrderData
,
callback
:
(
status
:
boolean
)
=>
void
)
=>
void
}
>
()
const
emit
=
defineEmits
([
'update:modelValue'
,
'set-printer'
,
'refresh'
])
const
visible
=
computed
({
get
()
{
return
props
.
modelValue
},
set
(
value
)
{
emit
(
'update:modelValue'
,
value
)
},
})
const
printDeviceList
=
ref
<
string
[]
>
([])
const
sheetPrinter
=
ref
<
string
>
(
''
)
const
productionOrder
=
ref
<
string
>
(
''
)
const
podOrderDetailsData
=
ref
<
OrderData
>
()
const
podOrderDetailsColumns
=
computed
(()
=>
[
{
label
:
'图片'
,
prop
:
'image'
,
width
:
250
,
slot
:
'image'
,
align
:
'center'
,
fixed
:
'left'
,
},
{
label
:
'生产单号'
,
prop
:
'podJomallCnNo'
,
width
:
150
,
align
:
'center'
,
},
// {
// label: 'base SKU',
// prop: 'baseSku',
// width: 140,
// align: 'center',
// },
{
label
:
'variant SKU'
,
prop
:
'variantSku'
,
width
:
140
,
align
:
'center'
,
},
{
label
:
'商品名称'
,
prop
:
'productName'
,
},
{
label
:
'购买数量'
,
prop
:
'purchaseNumber'
,
width
:
90
,
align
:
'center'
,
},
{
label
:
'拣货数量'
,
prop
:
'count'
,
width
:
90
,
align
:
'center'
,
},
{
label
:
'验证结果'
,
slot
:
'verifyResult'
,
width
:
90
,
align
:
'center'
,
},
])
const
boxChange
=
ref
<
boolean
>
(
false
)
const
boxIndex
=
ref
<
number
|
null
>
(
null
)
const
orderStore
=
useOrderStore
()
const
isLock
=
ref
<
boolean
>
(
false
)
const
productionOrderRef
=
ref
()
const
socketConnect
=
computed
(()
=>
orderStore
.
socketConnect
)
const
podBoxList
=
computed
(()
=>
orderStore
.
podBoxList
)
const
coverImage
=
ref
<
string
>
(
''
)
let
currentCode
=
''
const
tableRef
=
ref
()
watch
(
visible
,
async
(
value
:
boolean
)
=>
{
if
(
value
)
{
podOrderDetailsData
.
value
=
{}
currentCode
=
''
if
(
userStore
.
user
?.
factory
.
id
)
{
try
{
await
socket
.
init
(
{
account
:
userStore
.
user
?.
account
.
toString
(),
factoryNo
:
userStore
.
user
?.
factory
.
id
.
toString
(),
},
messageChange
,
)
socket
.
send
({
code
:
'SUPERFACTORYSTARTORDER'
,
factoryNo
:
userStore
.
user
?.
factory
.
id
,
})
}
catch
(
error
)
{
console
.
error
(
error
)
}
}
initOrderDetailBox
()
initPrintDevice
()
const
locaclPrinter
=
localStorage
.
getItem
(
'sheetPrinter'
)
if
(
locaclPrinter
)
sheetPrinter
.
value
=
JSON
.
parse
(
locaclPrinter
)
}
else
{
if
(
userStore
.
user
?.
factory
.
id
)
{
socket
.
send
({
code
:
'SUPERFACTORYENDORDER'
,
factoryNo
:
userStore
.
user
?.
factory
.
id
,
})
socket
.
close
()
}
}
})
watch
(
boxIndex
,
(
value
:
number
|
null
)
=>
{
if
(
value
)
{
const
bool
=
!
boxChange
.
value
boxChange
.
value
=
false
console
.
log
(
'boxChange'
,
bool
,
value
)
renderItemBox
(
bool
)
}
})
watch
(
podBoxList
,
(
value
)
=>
{
if
(
value
)
{
const
item
=
value
.
find
((
item
)
=>
item
.
box
===
podBoxIndex
.
value
)
console
.
log
(
'podBoxList'
,
value
,
podBoxIndex
.
value
,
item
)
if
(
item
?.
data
)
{
renderItemBox
(
true
)
}
else
{
if
(
boxIndex
.
value
===
podBoxIndex
.
value
)
{
podOrderDetailsData
.
value
=
{}
boxIndex
.
value
=
null
}
}
}
},
{
deep
:
true
},
)
watch
(
()
=>
podOrderDetailsData
.
value
,
(
val
)
=>
{
if
(
val
&&
val
.
productList
?.
length
)
val
.
productList
.
forEach
((
el
)
=>
{
if
(
!
el
.
previewImgs
)
el
.
previewImgs
=
JSON
.
parse
(
el
.
imageAry
)
})
},
{
deep
:
true
},
)
const
podBoxIndex
=
computed
(()
=>
orderStore
.
podBoxIndex
)
let
renderLock
=
false
const
renderItemBox
=
(
bool
:
boolean
)
=>
{
if
(
!
podBoxList
.
value
||
podBoxList
.
value
.
length
===
0
||
!
boxIndex
.
value
||
(
bool
&&
boxIndex
.
value
!==
podBoxIndex
.
value
)
)
return
if
(
renderLock
)
return
renderLock
=
true
let
boxItem
=
podBoxList
.
value
.
find
((
item
)
=>
item
.
box
===
boxIndex
.
value
)
if
(
!
boxItem
)
boxItem
=
{
data
:
{
productList
:
[]
}
}
const
{
data
}
=
boxItem
data
?.
productList
?.
forEach
((
el
)
=>
{
if
(
!
el
.
previewImgs
)
el
.
previewImgs
=
JSON
.
parse
(
el
.
imageAry
)
})
if
(
!
data
)
{
renderLock
=
false
currentCode
=
''
podOrderDetailsData
.
value
=
{}
return
}
const
{
productList
=
[]
}
=
data
const
pickingNumber
=
productList
.
reduce
((
prev
,
product
)
=>
{
return
prev
+
(
product
.
count
||
0
)
},
0
)
data
.
pickingNumber
=
pickingNumber
// coverImage.value = productList[0].previewImgs?.[0]?.url || ''
for
(
const
product
of
productList
)
{
if
(
product
.
count
===
product
.
purchaseNumber
)
{
product
.
power
=
true
}
}
if
(
currentCode
)
{
const
parts
=
currentCode
.
split
(
'_'
)
currentCode
=
parts
.
length
>
3
&&
parts
[
3
].
startsWith
(
'CNPSC'
)
?
parts
[
3
]
:
parts
.
length
>
1
?
parts
[
1
]
:
parts
[
0
]
for
(
const
product
of
productList
)
{
if
(
product
.
podJomallCnNo
===
currentCode
)
{
coverImage
.
value
=
product
.
previewImgs
?.[
0
]?.
url
||
''
nextTick
(()
=>
{
tableRef
.
value
?.
setCurrentRow
(
product
)
})
break
}
}
currentCode
=
''
}
podOrderDetailsData
.
value
=
data
if
(
productList
.
every
((
item
)
=>
item
.
power
))
{
print
(
data
,
false
,
()
=>
{
renderLock
=
false
})
}
else
{
renderLock
=
false
}
}
const
messageChange
=
(
data
:
WebSocketMessage
)
=>
{
if
(
!
data
)
return
const
{
code
,
...
more
}
=
data
if
(
code
===
'SUPER_FACTORY_POD_CN_PRINT_ORDER'
)
{
try
{
if
(
typeof
more
.
txt
===
'string'
)
{
console
.
log
(
'%conWebSocketMessage'
,
'font-size: 20px; color: red;'
,
JSON
.
parse
(
more
.
txt
),
)
}
}
catch
(
e
)
{
console
.
error
(
e
)
}
setPodBoxList
(
more
)
}
}
const
setPodBoxList
=
(
data
:
WebSocketMessage
)
=>
{
const
obj
=
data
.
txt
if
(
obj
&&
typeof
obj
===
'string'
)
{
const
parsedData
=
JSON
.
parse
(
obj
)
orderStore
.
setPodBoxList
(
parsedData
)
}
}
const
initPrintDevice
=
()
=>
{
const
lodop
=
getCLodop
(
null
,
null
)
if
(
!
lodop
)
return
const
arr
=
[]
// 获取打印机数量
const
length
=
lodop
.
GET_PRINTER_COUNT
()
for
(
let
i
=
0
;
i
<
length
;
i
++
)
{
// 根据设备序号获取设备名
const
name
=
lodop
.
GET_PRINTER_NAME
(
i
)
arr
.
push
(
name
)
}
console
.
log
(
'arr'
,
arr
,
lodop
.
GET_PRINTER_NAME
(
1
))
// 获取默认打印机
sheetPrinter
.
value
=
lodop
.
GET_PRINTER_NAME
(
0
)
printDeviceList
.
value
=
arr
}
const
handleProduct
=
(
val
:
OrderData
)
=>
{
if
(
val
&&
val
.
productList
&&
val
.
productList
.
length
>
0
)
{
return
val
.
productList
?.
some
((
item
)
=>
{
return
item
.
productMark
==
'normal'
})
}
else
{
return
false
}
}
const
handleSearch
=
()
=>
{
const
code
=
productionOrder
.
value
if
(
!
code
)
{
ElMessage
.
warning
(
'请输入生产单号'
)
productionOrderRef
.
value
.
focus
()
return
}
if
(
isLock
.
value
)
{
ElMessage
.
warning
(
'请稍后再试'
)
productionOrderRef
.
value
.
focus
()
return
}
productionOrder
.
value
=
''
isLock
.
value
=
true
const
everyPower
=
podOrderDetailsData
.
value
?.
productList
?.
every
(
(
item
)
=>
item
.
power
,
)
if
(
everyPower
)
{
/**
* printSuccess 打印成功
* printFail 打印失败
* printIng 打印中
* notPrintSuccess 未能获取打印状态
*/
if
(
podOrderDetailsData
.
value
?.
printResult
===
'printSuccess'
)
{
submitInspection
(()
=>
{
getPackingData
(
code
)
})
}
else
{
ElMessage
.
warning
(
'未获取到打印结果'
)
isLock
.
value
=
false
}
}
else
{
getPackingData
(
code
)
}
}
const
getPackingData
=
async
(
code
:
string
)
=>
{
const
loading
=
ElLoading
.
service
({
fullscreen
:
true
,
text
:
'加载中...'
,
background
:
'rgba(0, 0, 0, 0.3)'
,
})
currentCode
=
code
try
{
const
factoryNo
=
userStore
.
user
?.
factory
.
id
if
(
!
factoryNo
)
{
isLock
.
value
=
false
productionOrder
.
value
=
''
return
}
const
res
=
await
getSuperPackingCnDataApi
(
code
,
factoryNo
,
boxIndex
.
value
)
if
(
res
.
code
!==
200
)
{
ElMessage
.
warning
(
res
.
message
)
isLock
.
value
=
false
productionOrder
.
value
=
''
return
}
const
{
box
}
=
res
.
data
if
(
box
)
{
boxIndex
.
value
=
box
}
}
catch
(
error
)
{
console
.
log
(
error
)
}
finally
{
isLock
.
value
=
false
productionOrder
.
value
=
''
loading
.
close
()
productionOrderRef
.
value
.
focus
()
}
}
// 提交打单
const
submitInspection
=
async
(
callback
:
()
=>
void
)
=>
{
const
factoryNo
=
userStore
.
user
?.
factory
.
id
if
(
!
factoryNo
)
{
return
}
const
data
=
podOrderDetailsData
.
value
?.
id
?
[
{
id
:
podOrderDetailsData
.
value
.
id
,
version
:
podOrderDetailsData
.
value
?.
version
,
},
]
:
[]
try
{
const
res
=
await
submitSuperInspectionApi
(
data
,
boxIndex
.
value
)
if
(
res
.
code
!==
200
)
return
ElMessage
.
warning
(
res
.
message
)
isLock
.
value
=
false
coverImage
.
value
=
''
podOrderDetailsData
.
value
=
{}
productionOrderRef
.
value
.
focus
()
callback
&&
callback
()
}
catch
(
error
)
{
isLock
.
value
=
false
productionOrderRef
.
value
.
focus
()
console
.
error
(
error
)
}
}
const
isBillLading
=
ref
<
boolean
>
(
false
)
const
initOrderDetailBox
=
async
()
=>
{
const
factoryNo
=
userStore
.
user
?.
factory
.
id
if
(
!
factoryNo
)
{
return
}
const
loading
=
ElLoading
.
service
({
fullscreen
:
true
,
text
:
'加载中...'
,
background
:
'rgba(0, 0, 0, 0.3)'
,
})
try
{
const
res
=
await
getSuperPodBoxListApi
(
factoryNo
)
if
(
res
.
code
!==
200
)
{
ElMessage
.
warning
(
res
.
message
)
return
}
orderStore
.
setPodBoxList
({
boxList
:
res
.
data
,
factoryNo
,
})
const
boxList
=
res
.
data
.
map
((
item
)
=>
{
if
(
item
.
data
)
{
if
(
!
item
.
data
.
filePath
)
{
isBillLading
.
value
=
true
}
else
{
isBillLading
.
value
=
false
}
const
productList
=
item
?.
data
?.
productList
||
[]
const
pickingNumber
=
productList
.
reduce
((
prev
,
product
)
=>
{
if
(
product
.
count
===
product
.
purchaseNumber
)
{
product
.
power
=
true
}
if
(
product
.
count
)
{
return
prev
+
product
.
count
}
return
prev
},
0
)
item
.
data
.
pickingNumber
=
pickingNumber
}
return
item
})
podOrderDetailsData
.
value
=
boxList
.
find
((
item
)
=>
item
.
data
)?.
data
||
undefined
boxIndex
.
value
=
boxList
.
find
((
item
)
=>
item
.
data
)?.
box
||
null
podOrderDetailsData
.
value
?.
productList
?.
forEach
((
el
)
=>
{
if
(
!
el
.
previewImgs
)
el
.
previewImgs
=
JSON
.
parse
(
el
.
imageAry
)
})
coverImage
.
value
=
podOrderDetailsData
.
value
?.
productList
?.[
0
]?.
previewImgs
?.[
0
].
url
||
''
if
(
podOrderDetailsData
.
value
&&
podOrderDetailsData
.
value
.
pickingNumber
===
podOrderDetailsData
.
value
.
purchaseNumber
)
{
podOrderDetailsData
.
value
.
printResult
=
'notPrintSuccess'
}
const
pickFinished
=
boxList
.
filter
((
item
)
=>
{
return
item
.
data
?.
productList
?.
every
((
product
)
=>
product
.
power
)
})
const
boxs
=
pickFinished
.
map
((
item
)
=>
item
.
box
)
if
(
boxs
.
length
>
0
)
{
nextTick
(
async
()
=>
{
try
{
await
ElMessageBox
.
alert
(
`检测到
${
boxs
.
join
(
','
)}
号箱验货完成,请及时处理`
,
'提示'
,
{
confirmButtonText
:
'确定'
,
},
)
productionOrderRef
.
value
.
focus
()
}
catch
(
error
)
{
productionOrderRef
.
value
.
focus
()
console
.
error
(
error
)
}
})
}
renderLock
=
false
productionOrder
.
value
=
''
isLock
.
value
=
false
productionOrderRef
.
value
.
focus
()
}
catch
(
error
)
{
console
.
error
(
error
)
}
finally
{
loading
.
close
()
}
}
const
renderPrintResult
=
(
printResult
:
string
)
=>
{
switch
(
printResult
)
{
case
'printSuccess'
:
return
'打印成功'
case
'printFail'
:
return
'打印失败'
case
'printIng'
:
return
'打印中'
case
'notPrintSuccess'
:
return
'未能获取打印状态'
default
:
return
'未知'
}
}
const
handleOpened
=
()
=>
{
productionOrderRef
.
value
.
focus
()
}
const
handleClose
=
(
done
:
()
=>
void
)
=>
{
nextStep
(()
=>
{
done
()
})
}
const
onClose
=
()
=>
{
// orderStore.clearPodBox()
emit
(
'refresh'
)
}
// 下一步
const
nextStep
=
async
(
callback
:
()
=>
void
)
=>
{
const
everyPicked
=
podOrderDetailsData
.
value
?.
productList
?.
every
(
(
item
)
=>
item
.
count
===
item
.
purchaseNumber
,
)
if
(
everyPicked
&&
(
podOrderDetailsData
.
value
?.
printResult
===
'printSuccess'
||
podOrderDetailsData
.
value
?.
printResult
===
'notPrintSuccess'
)
)
{
try
{
await
ElMessageBox
.
alert
(
'当前订单验货完成并打印面单成功,是否转至已完成'
,
'提示'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
},
)
submitInspection
(()
=>
{
callback
&&
callback
()
})
}
catch
(
error
)
{
productionOrderRef
.
value
.
focus
()
console
.
error
(
error
)
}
}
else
{
callback
&&
callback
()
}
}
const
handleBoxClick
=
(
item
:
PodMakeOrderData
)
=>
{
const
{
box
,
data
}
=
item
isBillLading
.
value
=
!
data
?.
filePath
nextStep
(()
=>
{
if
(
!
data
)
{
ElMessage
.
warning
(
'暂无数据'
)
return
}
boxIndex
.
value
=
box
||
null
boxChange
.
value
=
true
productionOrderRef
.
value
.
focus
()
})
}
const
handleClearBox
=
async
()
=>
{
try
{
await
ElMessageBox
.
alert
(
'确定清空当前箱子吗?'
,
'提示'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
})
}
catch
{
return
}
const
factoryNo
=
userStore
.
user
?.
factory
.
id
if
(
!
factoryNo
)
{
return
}
try
{
const
res
=
await
clearSuperBoxApi
(
factoryNo
,
boxIndex
.
value
||
null
)
if
(
res
.
code
!==
200
)
{
ElMessage
.
warning
(
res
.
message
)
return
}
ElMessage
.
success
(
'清空成功'
)
orderStore
.
setPodBoxList
({
boxList
:
null
,
factoryNo
,
box
:
boxIndex
.
value
||
undefined
,
})
boxIndex
.
value
=
null
podOrderDetailsData
.
value
=
{}
coverImage
.
value
=
''
productionOrderRef
.
value
.
focus
()
}
catch
(
error
)
{
productionOrderRef
.
value
.
focus
()
console
.
error
(
error
)
}
}
const
handlePrintFinish
=
async
()
=>
{
try
{
await
ElMessageBox
.
alert
(
'确定打单完成吗?'
,
'提示'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
})
submitInspection
(()
=>
{
productionOrderRef
.
value
.
focus
()
})
}
catch
{
productionOrderRef
.
value
.
focus
()
return
}
}
const
handlePrinterChange
=
(
value
:
string
)
=>
{
emit
(
'set-printer'
,
value
)
}
const
print
=
(
data
:
OrderData
,
forcePrint
=
false
,
callback
?:
()
=>
void
)
=>
{
const
_boxIndex
=
boxIndex
.
value
if
(
!
forcePrint
&&
data
.
printResult
)
{
callback
&&
callback
()
return
}
props
.
printOrder
(
data
,
(
status
:
boolean
)
=>
{
callback
&&
callback
()
const
item
=
podBoxList
.
value
?.
find
((
item
)
=>
item
.
box
===
_boxIndex
)
if
(
item
&&
item
.
data
)
{
if
(
status
)
{
item
.
data
.
printResult
=
'printSuccess'
}
else
{
item
.
data
.
printResult
=
'printFail'
}
}
const
factoryNo
=
userStore
.
user
?.
factory
.
id
if
(
!
factoryNo
)
return
orderStore
.
setPodBoxList
({
boxList
:
item
?
item
.
data
:
null
,
factoryNo
,
box
:
_boxIndex
||
undefined
,
})
})
}
const
clearAllBox
=
async
()
=>
{
try
{
await
ElMessageBox
.
alert
(
'确定清空所有箱子吗?'
,
'提示'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
})
}
catch
{
productionOrderRef
.
value
.
focus
()
return
}
try
{
const
res
=
await
clearSuperAllBoxApi
()
if
(
res
.
code
!==
200
)
return
orderStore
.
setPodBoxList
({
boxList
:
res
.
data
,
factoryNo
:
userStore
.
user
?.
factory
.
id
||
''
,
})
productionOrderRef
.
value
.
focus
()
podOrderDetailsData
.
value
=
{}
coverImage
.
value
=
''
boxIndex
.
value
=
null
}
catch
(
error
)
{
productionOrderRef
.
value
.
focus
()
console
.
error
(
error
)
}
}
const
handleRowClick
=
(
row
:
ProductList
)
=>
{
console
.
log
(
907
,
row
)
coverImage
.
value
=
row
.
previewImgs
?.[
0
]?.
url
||
''
productionOrderRef
.
value
.
focus
()
}
const
handleCurrentChange
=
(
url
:
string
)
=>
{
if
(
url
)
{
coverImage
.
value
=
url
||
''
}
}
</
script
>
<
style
scoped
lang=
"scss"
>
.title
{
display
:
flex
;
align-items
:
center
;
gap
:
10px
;
}
.online
{
color
:
green
;
font-size
:
14px
;
font-weight
:
600
;
}
.offline
{
color
:
red
;
font-size
:
14px
;
font-weight
:
600
;
}
.pod-make-order-content
{
display
:
flex
;
height
:
100%
;
overflow
:
hidden
;
gap
:
10px
;
}
.left-content
{
display
:
flex
;
flex-direction
:
column
;
gap
:
10px
;
width
:
calc
(
100%
-
900px
-
20px
);
}
.head-form
{
display
:
flex
;
align-items
:
center
;
gap
:
10px
;
}
.table-content
{
flex
:
1
;
overflow
:
hidden
;
}
.middle-content
{
width
:
500px
;
display
:
flex
;
flex-direction
:
column
;
gap
:
5px
;
}
.right-content
{
width
:
400px
;
}
.basic-info
{
display
:
grid
;
grid-template-columns
:
repeat
(
2
,
1
fr
);
gap
:
10px
;
.basic-info-item
{
display
:
flex
;
align-items
:
center
;
span
:
last-child
{
flex
:
1
;
overflow
:
hidden
;
text-overflow
:
ellipsis
;
white-space
:
nowrap
;
}
}
}
.box-top
{
position
:
relative
;
border
:
1px
solid
#ddd
;
background
:
rgb
(
50
50
50
);
border-radius
:
5px
;
padding
:
10px
15px
;
box-sizing
:
border-box
;
font-size
:
16px
;
color
:
#fff
;
overflow
:
hidden
;
}
.multiple-title
{
position
:
absolute
;
top
:
0
;
right
:
0
;
&::after
{
position
:
absolute
;
top
:
-31px
;
right
:
-30px
;
content
:
''
;
border-width
:
30px
;
border-style
:
solid
;
border-color
:
transparent
transparent
red
transparent
;
transform
:
rotate
(
45deg
);
}
.multiple-title-text
{
position
:
absolute
;
z-index
:
2
;
color
:
#fff
;
left
:
-20px
;
}
}
.box-top-item
{
display
:
flex
;
height
:
80px
;
align-items
:
center
;
margin-bottom
:
10px
;
}
.box-top-item-box-index
{
font-size
:
60px
;
color
:
red
;
text-align
:
center
;
width
:
120px
;
font-weight
:
600
;
}
.box-top-item-box-index-text
{
margin-right
:
15px
;
font-size
:
30px
;
}
.box-top-item-box-index-number
{
font-size
:
60px
;
color
:
red
;
display
:
inline-block
;
text-align
:
center
;
width
:
90px
;
font-weight
:
600
;
}
.box-top-item-status
{
margin-bottom
:
15px
;
}
.order-image
{
flex
:
1
;
overflow
:
hidden
;
border
:
1px
solid
#ddd
;
background
:
#eee
;
}
.box-list
{
display
:
grid
;
grid-template-columns
:
repeat
(
7
,
50px
);
gap
:
8px
;
position
:
relative
;
}
.box-list-item
{
position
:
relative
;
border
:
1px
solid
#ddd
;
cursor
:
pointer
;
font-size
:
18px
;
line-height
:
30px
;
height
:
46px
;
text-align
:
center
;
box-sizing
:
border-box
;
border-radius
:
5px
;
&:not(.isNull)
{
background
:
#819aff
;
color
:
#fff
;
}
&
.active
{
background
:
#ff9900
;
color
:
#fff
;
}
&
.badge
::after
{
position
:
absolute
;
content
:
''
;
right
:
4px
;
top
:
4px
;
width
:
7px
;
height
:
7px
;
border-radius
:
50%
;
background-color
:
red
;
}
.number
{
position
:
absolute
;
bottom
:
3px
;
right
:
0
;
left
:
0
;
text-align
:
center
;
font-size
:
12px
;
line-height
:
14px
;
color
:
#ddd
;
}
}
</
style
>
<
style
lang=
"scss"
>
.pod-make-order-dialog
{
.el-dialog
{
display
:
flex
;
flex-direction
:
column
;
height
:
calc
(
100%
-
60px
);
}
.el-dialog__body
{
flex
:
1
;
overflow
:
hidden
;
}
}
</
style
>
src/views/order/podCN/index.vue
View file @
bf27a69d
...
@@ -456,6 +456,14 @@
...
@@ -456,6 +456,14 @@
播种墙配货
播种墙配货
</ElButton>
</ElButton>
</span>
</span>
<span
v-if=
"status === 'WAIT_SHIPMENT' && isSuperFactory"
class=
"item"
>
<ElButton
type=
"danger"
@
click=
"printSuperPodOrder"
>
超级播种墙配货
</ElButton>
</span>
<span
v-if=
"status === 'CREATE_LOGISTICS'"
class=
"item"
>
<span
v-if=
"status === 'CREATE_LOGISTICS'"
class=
"item"
>
<ElButton
type=
"warning"
@
click=
"logisticsToPicking"
>
<ElButton
type=
"warning"
@
click=
"logisticsToPicking"
>
转至待排单
转至待排单
...
@@ -1992,7 +2000,14 @@
...
@@ -1992,7 +2000,14 @@
:
print
-
order
=
"printOrder"
:
print
-
order
=
"printOrder"
:
warehouse
-
list
=
"warehouseList"
:
warehouse
-
list
=
"warehouseList"
@
set
-
printer
=
"handlePrinterChange"
@
set
-
printer
=
"handlePrinterChange"
@
set
-
warehouseId
=
"handleWarehouseIdChange"
@
set
-
warehouse
-
id
=
"handleWarehouseIdChange"
@
refresh
=
"onFastRefresh"
/>
<
SuperPodMakeOrder
v
-
model
=
"superPodOrderVisible"
:
print
-
order
=
"printOrder"
:
warehouse
-
list
=
"warehouseList"
@
set
-
printer
=
"handlePrinterChange"
@
refresh
=
"onFastRefresh"
@
refresh
=
"onFastRefresh"
/>
/>
<
ElDialog
<
ElDialog
...
@@ -2328,6 +2343,7 @@ import { computed, onMounted, ref, nextTick, reactive } from 'vue'
...
@@ -2328,6 +2343,7 @@ import { computed, onMounted, ref, nextTick, reactive } from 'vue'
import
FastProduction
from
'./FastProduction.vue'
import
FastProduction
from
'./FastProduction.vue'
import
{
filePath
}
from
'@/api/axios'
import
{
filePath
}
from
'@/api/axios'
import
PodMakeOrder
from
'./PodMakeOrder.vue'
import
PodMakeOrder
from
'./PodMakeOrder.vue'
import
SuperPodMakeOrder
from
'./SuperPodMakeOrder.vue'
import
{
OrderData
}
from
'@/types/api/podMakeOrder'
import
{
OrderData
}
from
'@/types/api/podMakeOrder'
import
useLodop
,
{
LODOPObject
}
from
'@/utils/hooks/useLodop'
import
useLodop
,
{
LODOPObject
}
from
'@/utils/hooks/useLodop'
import
dayjs
from
'dayjs'
import
dayjs
from
'dayjs'
...
@@ -2335,6 +2351,7 @@ import RightClickMenu from '@/components/RightClickMenu.vue'
...
@@ -2335,6 +2351,7 @@ import RightClickMenu from '@/components/RightClickMenu.vue'
import
ResultInfo
from
'./components/ResultInfo.vue'
import
ResultInfo
from
'./components/ResultInfo.vue'
import
{
isArray
,
isString
}
from
'@/utils/validate'
import
{
isArray
,
isString
}
from
'@/utils/validate'
import
platformJson
from
'../../../json/platform.json'
import
platformJson
from
'../../../json/platform.json'
import
useUserStore
from
'@/store/user'
import
BigNumber
from
'bignumber.js'
import
BigNumber
from
'bignumber.js'
import
{
import
{
useRouter
,
useRouter
,
...
@@ -2355,6 +2372,11 @@ declare global {
...
@@ -2355,6 +2372,11 @@ declare global {
responseBody
?:
unknown
responseBody
?:
unknown
}
}
}
}
const
userStore
=
useUserStore
()
const
isSuperFactory
:
boolean
=
userStore
.
user
?.
factory
.
dropShipping
||
false
const
tabsNav
=
ref
<
Tab
[]
>
()
const
tabsNav
=
ref
<
Tab
[]
>
()
const
isAuto
=
ref
(
true
)
const
isAuto
=
ref
(
true
)
...
@@ -4139,6 +4161,15 @@ const printPodOrder = async () => {
...
@@ -4139,6 +4161,15 @@ const printPodOrder = async () => {
podOrderVisible
.
value
=
true
podOrderVisible
.
value
=
true
}
}
const
superPodOrderVisible
=
ref
(
false
)
const
printSuperPodOrder
=
async
()
=>
{
const
lodop
=
getCLodop
(
null
,
null
)
if
(
!
lodop
)
return
sheetPrinter
.
value
=
lodop
.
GET_PRINTER_NAME
(
0
)
superPodOrderVisible
.
value
=
true
}
/**
/**
* @description: 创建物流、获取跟踪号、获取打印面单、更改物流、取消物流订单
* @description: 创建物流、获取跟踪号、获取打印面单、更改物流、取消物流订单
*/
*/
...
...
src/views/podUsBillOrder/index.vue
View file @
bf27a69d
...
@@ -50,7 +50,7 @@
...
@@ -50,7 +50,7 @@
<
/ElFormItem
>
<
/ElFormItem
>
<
ElFormItem
style
=
"margin-right: 10px"
label
=
"对账单号"
>
<
ElFormItem
style
=
"margin-right: 10px"
label
=
"对账单号"
>
<
ElInput
<
ElInput
v
-
model
=
"searchForm.rec
N
umber"
v
-
model
=
"searchForm.rec
_n
umber"
clearable
clearable
placeholder
=
"对账单号"
placeholder
=
"对账单号"
style
=
"width: 160px"
style
=
"width: 160px"
...
@@ -58,7 +58,7 @@
...
@@ -58,7 +58,7 @@
<
/ElFormItem
>
<
/ElFormItem
>
<
ElFormItem
style
=
"margin-right: 10px"
label
=
"订单号"
>
<
ElFormItem
style
=
"margin-right: 10px"
label
=
"订单号"
>
<
ElInput
<
ElInput
v
-
model
=
"searchForm.order
N
umber"
v
-
model
=
"searchForm.order
_n
umber"
clearable
clearable
placeholder
=
"订单号"
placeholder
=
"订单号"
style
=
"width: 160px"
style
=
"width: 160px"
...
@@ -139,6 +139,14 @@
...
@@ -139,6 +139,14 @@
<
/template
>
<
/template
>
<
/el-table-column
>
<
/el-table-column
>
<
el
-
table
-
column
<
el
-
table
-
column
:
label
=
"'工厂编码'"
prop
=
"name"
header
-
align
=
"center"
align
=
"center"
width
=
"100"
show
-
overflow
-
tooltip
><
/el-table-column
>
<!--
<
el
-
table
-
column
label
=
"底胚总价($)"
label
=
"底胚总价($)"
header
-
align
=
"center"
header
-
align
=
"center"
prop
=
"product_total_amount"
prop
=
"product_total_amount"
...
@@ -146,7 +154,7 @@
...
@@ -146,7 +154,7 @@
align
=
"center"
align
=
"center"
show
-
overflow
-
tooltip
show
-
overflow
-
tooltip
>
>
<
/el-table-column
>
<
/el-table-column>
--
>
<
el
-
table
-
column
<
el
-
table
-
column
label
=
"总发货(件)"
label
=
"总发货(件)"
header
-
align
=
"center"
header
-
align
=
"center"
...
@@ -156,6 +164,15 @@
...
@@ -156,6 +164,15 @@
show
-
overflow
-
tooltip
show
-
overflow
-
tooltip
>
>
<
/el-table-column
>
<
/el-table-column
>
<!--
<
el
-
table
-
column
label
=
"成本总价($)"
header
-
align
=
"center"
prop
=
"template_total_price"
width
=
"110"
align
=
"center"
show
-
overflow
-
tooltip
>
<
/el-table-column> --
>
<
el
-
table
-
column
<
el
-
table
-
column
label
=
"工艺总价($)"
label
=
"工艺总价($)"
header
-
align
=
"center"
header
-
align
=
"center"
...
@@ -183,9 +200,19 @@
...
@@ -183,9 +200,19 @@
show
-
overflow
-
tooltip
show
-
overflow
-
tooltip
><
/el-table-column
>
><
/el-table-column
>
<
el
-
table
-
column
<
el
-
table
-
column
label
=
"付款类型"
header
-
align
=
"center"
prop
=
"actual_amount"
width
=
"110"
align
=
"center"
show
-
overflow
-
tooltip
>
<
template
#
default
>
US
账户
<
/template
>
<
/el-table-column
>
<
el
-
table
-
column
label
=
"应付金额($)"
label
=
"应付金额($)"
header
-
align
=
"center"
header
-
align
=
"center"
prop
=
"total
_a
mount"
prop
=
"total
A
mount"
width
=
"130"
width
=
"130"
align
=
"center"
align
=
"center"
show
-
overflow
-
tooltip
show
-
overflow
-
tooltip
...
@@ -199,14 +226,14 @@
...
@@ -199,14 +226,14 @@
align
=
"center"
align
=
"center"
show
-
overflow
-
tooltip
show
-
overflow
-
tooltip
><
/el-table-column
>
><
/el-table-column
>
<
el
-
table
-
column
<
!--
<
el
-
table
-
column
label
=
"已付金额($)"
label
=
"已付金额($)"
header
-
align
=
"center"
header
-
align
=
"center"
prop
=
"total_amount_str"
prop
=
"total_amount_str"
width
=
"130"
width
=
"130"
align
=
"center"
align
=
"center"
show
-
overflow
-
tooltip
show
-
overflow
-
tooltip
><
/el-table-column
>
><
/el-table-column>
--
>
<
el
-
table
-
column
<
el
-
table
-
column
label
=
"水单"
label
=
"水单"
header
-
align
=
"center"
header
-
align
=
"center"
...
@@ -220,10 +247,7 @@
...
@@ -220,10 +247,7 @@
style
=
"display: flex; gap: 2px; align-items: center"
style
=
"display: flex; gap: 2px; align-items: center"
>
>
<
div
<
div
v
-
for
=
"item in (typeof row.water_list === 'string'
v
-
for
=
"item in row.water_list.split(',')"
? row.water_list
: ''
).split(',')"
:
key
=
"item"
:
key
=
"item"
style
=
"width: 30px"
style
=
"width: 30px"
>
>
...
@@ -281,31 +305,34 @@
...
@@ -281,31 +305,34 @@
<
el
-
form
:
model
=
"detailForm"
inline
>
<
el
-
form
:
model
=
"detailForm"
inline
>
<
el
-
form
-
item
label
=
"生产单号"
>
<
el
-
form
-
item
label
=
"生产单号"
>
<
el
-
input
<
el
-
input
v
-
model
=
"detailForm.sub
OrderN
umber"
v
-
model
=
"detailForm.sub
_order_n
umber"
placeholder
=
"请输入
订
单号"
placeholder
=
"请输入
生产
单号"
clearable
clearable
style
=
"width: 130px"
style
=
"width: 130px"
/>
/>
<
/el-form-item
>
<
/el-form-item
>
<
el
-
form
-
item
label
=
"
底胚Sku
"
>
<
el
-
form
-
item
label
=
"
工艺编码
"
>
<
el
-
input
<
el
-
input
v
-
model
=
"detailForm.
baseSku
"
v
-
model
=
"detailForm.
craft_code
"
placeholder
=
"请输入
底胚Sku
"
placeholder
=
"请输入
工艺编码
"
clearable
clearable
style
=
"width: 130px"
style
=
"width: 130px"
/>
/>
<
/el-form-item
>
<
/el-form-item
>
<
el
-
form
-
item
label
=
"
工艺编码
"
>
<
el
-
form
-
item
label
=
"
底胚Sku
"
>
<
el
-
input
<
el
-
input
v
-
model
=
"detailForm.
craftCode
"
v
-
model
=
"detailForm.
base_sku
"
placeholder
=
"请输入
工艺编码
"
placeholder
=
"请输入
底胚Sku
"
clearable
clearable
style
=
"width: 130px"
style
=
"width: 130px"
/>
/>
<
/el-form-item
>
<
/el-form-item
>
<
el
-
form
-
item
>
<
el
-
form
-
item
>
<
el
-
button
type
=
"primary"
@
click
=
"searchDetail"
<
el
-
button
:
disabled
=
"!currentRow?.id"
type
=
"primary"
@
click
=
"searchDetail"
>
查询
>
查询
<
/el-button
>
<
/el-button
>
<
/el-form-item
>
<
/el-form-item
>
...
@@ -421,7 +448,7 @@
...
@@ -421,7 +448,7 @@
<
el
-
table
-
column
<
el
-
table
-
column
show
-
overflow
-
tooltip
show
-
overflow
-
tooltip
label
=
"产品价格($)"
label
=
"产品价格($)"
width
=
"1
0
0"
width
=
"1
3
0"
align
=
"center"
align
=
"center"
prop
=
"product_price"
prop
=
"product_price"
>
>
...
@@ -434,14 +461,14 @@
...
@@ -434,14 +461,14 @@
<
el
-
table
-
column
<
el
-
table
-
column
show
-
overflow
-
tooltip
show
-
overflow
-
tooltip
label
=
"底胚价格($)"
label
=
"底胚价格($)"
width
=
"1
0
0"
width
=
"1
3
0"
align
=
"center"
align
=
"center"
prop
=
"template_price"
prop
=
"template_price"
><
/el-table-column
>
><
/el-table-column
>
<
el
-
table
-
column
<
el
-
table
-
column
show
-
overflow
-
tooltip
show
-
overflow
-
tooltip
label
=
"工艺价格($)"
label
=
"工艺价格($)"
width
=
"1
0
0"
width
=
"1
3
0"
align
=
"center"
align
=
"center"
prop
=
"craft_price"
prop
=
"craft_price"
><
/el-table-column
>
><
/el-table-column
>
...
@@ -507,25 +534,27 @@
...
@@ -507,25 +534,27 @@
<
/el-tab-pane
>
<
/el-tab-pane
>
<
el
-
tab
-
pane
name
=
"1"
label
=
"订单详情"
>
<
el
-
tab
-
pane
name
=
"1"
label
=
"订单详情"
>
<
el
-
form
:
model
=
"orderForm"
inline
>
<
el
-
form
:
model
=
"orderForm"
inline
>
<
el
-
form
-
item
label
=
"
订单号
"
>
<
el
-
form
-
item
label
=
"
店铺单号"
label
-
width
=
"80px
"
>
<
el
-
input
<
el
-
input
v
-
model
=
"orderForm.
orderN
umber"
v
-
model
=
"orderForm.
shop_n
umber"
placeholder
=
"请输入
订
单号"
placeholder
=
"请输入
店铺
单号"
clearable
clearable
style
=
"width:
13
0px"
style
=
"width:
20
0px"
/>
/>
<
/el-form-item
>
<
/el-form-item
>
<
el
-
form
-
item
label
=
"
生产单号
"
>
<
el
-
form
-
item
label
=
"
订单号"
label
-
width
=
"60px
"
>
<
el
-
input
<
el
-
input
v
-
model
=
"orderForm.
subOrderN
umber"
v
-
model
=
"orderForm.
order_n
umber"
placeholder
=
"请输入订单号"
placeholder
=
"请输入订单号"
clearable
clearable
style
=
"width:
13
0px"
style
=
"width:
20
0px"
/>
/>
<
/el-form-item
>
<
/el-form-item
>
<
el
-
form
-
item
>
<
el
-
form
-
item
>
<
el
-
button
type
=
"primary"
@
click
=
"getUsOrderList"
<
el
-
button
:
disabled
=
"!currentRow?.id"
type
=
"primary"
@
click
=
"getUsOrderList"
>
查询
>
查询
<
/el-button
>
<
/el-button
>
<
/el-form-item
>
<
/el-form-item
>
...
@@ -642,29 +671,61 @@
...
@@ -642,29 +671,61 @@
show
-
overflow
-
tooltip
show
-
overflow
-
tooltip
/>
/>
<
el
-
table
-
column
<
el
-
table
-
column
label
=
"预收运费($)"
prop
=
"order.prepaid_amount"
header
-
align
=
"center"
align
=
"center"
min
-
width
=
"120"
show
-
overflow
-
tooltip
/>
<
el
-
table
-
column
label
=
"实际运费($)"
prop
=
"order.actual_amount"
header
-
align
=
"center"
align
=
"center"
min
-
width
=
"120"
show
-
overflow
-
tooltip
/>
<
el
-
table
-
column
label
=
"调整运费($)"
prop
=
"order.adjusted_amount"
header
-
align
=
"center"
align
=
"center"
min
-
width
=
"120"
show
-
overflow
-
tooltip
/>
<
el
-
table
-
column
label
=
"运费总价($)"
prop
=
"carriage_total_amount"
header
-
align
=
"center"
align
=
"center"
min
-
width
=
"120"
show
-
overflow
-
tooltip
/>
<!--
<
el
-
table
-
column
label
=
"运费($)"
label
=
"运费($)"
prop
=
"order.pay_freight"
prop
=
"order.pay_freight"
header
-
align
=
"center"
header
-
align
=
"center"
align
=
"center"
align
=
"center"
min
-
width
=
"120"
min
-
width
=
"120"
show
-
overflow
-
tooltip
show
-
overflow
-
tooltip
><
/el-table-column
>
><
/el-table-column>
--
>
<
el
-
table
-
column
<
!--
<
el
-
table
-
column
label
=
"物流总价($)"
label
=
"物流总价($)"
prop
=
"carriage_total_amount"
prop
=
"carriage_total_amount"
header
-
align
=
"center"
header
-
align
=
"center"
align
=
"center"
align
=
"center"
min
-
width
=
"120"
min
-
width
=
"120"
show
-
overflow
-
tooltip
show
-
overflow
-
tooltip
/>
/>
-->
<
el
-
table
-
column
<
!--
<
el
-
table
-
column
label
=
"实付金额($)"
label
=
"实付金额($)"
prop
=
"order.actual_amount"
prop
=
"order.actual_amount"
header
-
align
=
"center"
header
-
align
=
"center"
align
=
"center"
align
=
"center"
min
-
width
=
"120"
min
-
width
=
"120"
show
-
overflow
-
tooltip
show
-
overflow
-
tooltip
/>
/>
-->
<
el
-
table
-
column
<
el
-
table
-
column
label
=
"完成时间"
label
=
"完成时间"
prop
=
"order.finish_time"
prop
=
"order.finish_time"
...
@@ -1000,12 +1061,16 @@ import { nextTick, onMounted, ref, watch } from 'vue'
...
@@ -1000,12 +1061,16 @@ import { nextTick, onMounted, ref, watch } from 'vue'
import
'element-plus/dist/index.css'
import
'element-plus/dist/index.css'
import
{
import
{
AccountStatementNote
,
AccountStatementNote
,
AccountStatementNoteSearchForm
,
AccountStatementNoteSearchForm
US
,
CountStatus
,
CountStatus
,
OrderDetails
,
OrderDetails
,
ProductDetails
,
ProductDetails
,
}
from
'@/types/api/billOrder'
}
from
'@/types/api/billOrder'
import
{
DetailForm
,
LogListData
,
IUpdatePrice
}
from
'@/types/api/deliveryNote'
import
{
DetailFormUS
,
LogListData
,
IUpdatePrice
,
}
from
'@/types/api/deliveryNote'
import
ImageView
from
'@/components/ImageView.vue'
import
ImageView
from
'@/components/ImageView.vue'
interface
Tree
{
interface
Tree
{
...
@@ -1027,9 +1092,8 @@ const safeOrderId = ref()
...
@@ -1027,9 +1092,8 @@ const safeOrderId = ref()
const
logList
=
ref
<
LogListData
[]
>
([])
const
logList
=
ref
<
LogListData
[]
>
([])
// const nameSpaceList = ref<string[]>([])
// const nameSpaceList = ref<string[]>([])
const
treeData
=
ref
<
CountStatus
[]
>
()
const
treeData
=
ref
<
CountStatus
[]
>
()
const
[
searchForm
,
resetSearchForm
]
=
useValue
<
AccountStatementNoteSearchForm
>
(
const
[
searchForm
,
resetSearchForm
]
=
{
}
,
useValue
<
AccountStatementNoteSearchFormUS
>
({
}
)
)
const
dateRange
=
ref
<
string
[]
>
([])
const
dateRange
=
ref
<
string
[]
>
([])
const
selections
=
ref
<
AccountStatementNote
[]
>
([])
const
selections
=
ref
<
AccountStatementNote
[]
>
([])
const
detailSelections
=
ref
<
ProductDetails
[]
>
([])
const
detailSelections
=
ref
<
ProductDetails
[]
>
([])
...
@@ -1136,11 +1200,20 @@ watch(
...
@@ -1136,11 +1200,20 @@ watch(
()
=>
tableData
.
value
,
()
=>
tableData
.
value
,
()
=>
{
()
=>
{
;(
tableData
.
value
as
AccountStatementNote
[]).
forEach
((
item
)
=>
{
;(
tableData
.
value
as
AccountStatementNote
[]).
forEach
((
item
)
=>
{
item
.
totalAmount
=
amountPayable
(
item
)
item
.
total_amount
=
computedPrice
(
item
)
item
.
total_amount
=
computedPrice
(
item
)
}
)
}
)
}
,
}
,
{
immediate
:
true
,
deep
:
true
}
,
{
immediate
:
true
,
deep
:
true
}
,
)
)
const
amountPayable
=
(
row
:
AccountStatementNote
)
=>
{
const
totalAmount
=
new
BigNumber
(
row
.
product_total_amount
as
number
).
plus
(
new
BigNumber
(
row
.
carriage_total_amount
||
0
),
)
return
totalAmount
.
toString
()
}
const
reset
=
()
=>
{
const
reset
=
()
=>
{
dateRange
.
value
=
[]
dateRange
.
value
=
[]
resetSearchForm
()
resetSearchForm
()
...
@@ -1418,8 +1491,8 @@ const nodeClick = (data: Tree) => {
...
@@ -1418,8 +1491,8 @@ const nodeClick = (data: Tree) => {
search
()
search
()
//
}
//
}
}
}
const
detailForm
=
ref
({
}
as
DetailForm
)
const
detailForm
=
ref
({
}
as
DetailForm
US
)
const
orderForm
=
ref
({
}
as
DetailForm
)
const
orderForm
=
ref
({
}
as
DetailForm
US
)
const
detailPager
=
ref
({
const
detailPager
=
ref
({
page
:
1
,
page
:
1
,
rows
:
100
,
rows
:
100
,
...
...
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