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
59104af9
Commit
59104af9
authored
Mar 19, 2026
by
qinjianhui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 代码优化
parent
5c5b1b42
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
71 deletions
+10
-71
.cursor/rules/factory-rule.mdc
+1
-1
src/utils/hooks/useLodop.ts
+1
-1
src/views/order/factoryOrderNew/index.vue
+8
-69
No files found.
.cursor/rules/factory-rule.mdc
View file @
59104af9
...
@@ -27,4 +27,4 @@ Vue3 + Element Plus + Pinia + Axios + TypeScript + Vite
...
@@ -27,4 +27,4 @@ Vue3 + Element Plus + Pinia + Axios + TypeScript + Vite
-- 只编写解决问题所需的最少代码
-- 只编写解决问题所需的最少代码
-- 避免冗余实现和过渡设计
-- 避免冗余实现和过渡设计
-- 实现一个复杂功能时,需要合理拆分组件,使每个文件的代码更易维护
-- 实现一个复杂功能时,需要合理拆分组件,使每个文件的代码更易维护
--
疯转
组件时,要考虑组件的复用性
--
封装
组件时,要考虑组件的复用性
src/utils/hooks/useLodop.ts
View file @
59104af9
...
@@ -47,7 +47,7 @@ declare global {
...
@@ -47,7 +47,7 @@ declare global {
interface
Window
{
interface
Window
{
LODOP
:
new
()
=>
LODOPObject
LODOP
:
new
()
=>
LODOPObject
_lodop
:
LODOPObject
|
null
_lodop
:
LODOPObject
|
null
_lodopCallback
:
{
[
key
:
string
]:
Function
}
_lodopCallback
:
{
[
key
:
string
]:
(
value
:
string
)
=>
void
}
CLODOP
:
CLodopObject
CLODOP
:
CLodopObject
getCLodop
:
()
=>
LODOPObject
getCLodop
:
()
=>
LODOPObject
}
}
...
...
src/views/order/factoryOrderNew/index.vue
View file @
59104af9
...
@@ -38,7 +38,6 @@
...
@@ -38,7 +38,6 @@
<
/ElTree
>
<
/ElTree
>
<
/div
>
<
/div
>
<
div
class
=
"order-content flex-1 flex-column overflow-hidden"
>
<
div
class
=
"order-content flex-1 flex-column overflow-hidden"
>
<!--
搜索表单
:
批次管理和等待补货有自己的筛选
-->
<
div
v
-
if
=
"!isSpecialLayout"
class
=
"header"
>
<
div
v
-
if
=
"!isSpecialLayout"
class
=
"header"
>
<
div
class
=
"header-filter-form"
>
<
div
class
=
"header-filter-form"
>
<
ElForm
<
ElForm
...
@@ -657,7 +656,7 @@
...
@@ -657,7 +656,7 @@
:
class
=
"{ active: suspendedSubTab === tab.value
}
"
:
class
=
"{ active: suspendedSubTab === tab.value
}
"
@
click
=
"suspendedSubTab = tab.value"
@
click
=
"suspendedSubTab = tab.value"
>
>
{{
tab
.
label
}}
{{
tab
.
label
}}
({{
tab
.
count
||
0
}}
)
<
/div
>
<
/div
>
<
/div
>
<
/div
>
...
@@ -922,18 +921,16 @@ const pendingAcceptSubTab = ref<'PENDING_ACCEPT' | 'ACCEPT_FAIL_OUT_OF_STOCK'>(
...
@@ -922,18 +921,16 @@ const pendingAcceptSubTab = ref<'PENDING_ACCEPT' | 'ACCEPT_FAIL_OUT_OF_STOCK'>(
'PENDING_ACCEPT'
,
'PENDING_ACCEPT'
,
)
)
const
suspendedTabs
=
[
const
suspendedTabs
=
[
{
label
:
'客户拦截'
,
value
:
'CUSTOMER_INTERCEPT'
}
,
{
label
:
'客户拦截'
,
value
:
'CUSTOMER_INTERCEPT'
,
count
:
0
}
,
{
label
:
'地址异常'
,
value
:
'ADDRESS_EXCEPTION'
}
,
{
label
:
'地址异常'
,
value
:
'ADDRESS_EXCEPTION'
,
count
:
0
}
,
{
label
:
'其他'
,
value
:
'OTHER'
}
,
{
label
:
'其他'
,
value
:
'OTHER'
,
count
:
0
}
,
]
]
const
suspendedSubTab
=
ref
(
'CUSTOMER_INTERCEPT'
)
const
suspendedSubTab
=
ref
(
'CUSTOMER_INTERCEPT'
)
const
treeRef
=
ref
<
InstanceType
<
typeof
ElTree
>>
()
const
treeRef
=
ref
<
InstanceType
<
typeof
ElTree
>>
()
const
searchForm
=
ref
<
SearchForm
>
({
}
)
const
searchForm
=
ref
<
SearchForm
>
({
}
)
const
dateRange
=
ref
<
string
[]
>
([])
const
dateRange
=
ref
<
string
[]
>
([])
const
craftCode
=
ref
<
string
>
(
''
)
const
searchVisible
=
ref
(
false
)
const
searchVisible
=
ref
(
false
)
const
searchFormPopoverRef
=
ref
()
const
userMarkList
=
ref
<
string
[]
>
([])
const
userMarkList
=
ref
<
string
[]
>
([])
const
receiverCountryList
=
ref
<
{
countryCode
:
string
;
nameCn
:
string
}
[]
>
([])
const
receiverCountryList
=
ref
<
{
countryCode
:
string
;
nameCn
:
string
}
[]
>
([])
...
@@ -984,8 +981,6 @@ const productTypeGroups = ref<ProductTypeGroup[]>([
...
@@ -984,8 +981,6 @@ const productTypeGroups = ref<ProductTypeGroup[]>([
const
changeReplaceShipment
=
()
=>
{
const
changeReplaceShipment
=
()
=>
{
searchForm
.
value
.
shipmentType
=
''
searchForm
.
value
.
shipmentType
=
''
}
}
// ========== 数据加载 ==========
const
getUserMark
=
async
()
=>
{
const
getUserMark
=
async
()
=>
{
try
{
try
{
const
res
=
await
getUserMarkList
()
const
res
=
await
getUserMarkList
()
...
@@ -1086,7 +1081,6 @@ const pickerOptions = {
...
@@ -1086,7 +1081,6 @@ const pickerOptions = {
],
],
}
}
// ========== 表格数据 ==========
const
activeTab
=
ref
<
'product'
|
'log'
>
(
'product'
)
const
activeTab
=
ref
<
'product'
|
'log'
>
(
'product'
)
const
productList
=
ref
<
ProductListData
[]
>
([])
const
productList
=
ref
<
ProductListData
[]
>
([])
const
currentRow
=
ref
<
FactoryOrderNewListData
|
null
>
(
null
)
const
currentRow
=
ref
<
FactoryOrderNewListData
|
null
>
(
null
)
...
@@ -1094,7 +1088,6 @@ const selectedRowIds = ref<(number | string)[]>([])
...
@@ -1094,7 +1088,6 @@ const selectedRowIds = ref<(number | string)[]>([])
const
selectedRows
=
ref
<
FactoryOrderNewListData
[]
>
([])
const
selectedRows
=
ref
<
FactoryOrderNewListData
[]
>
([])
const
cardSelectedIds
=
ref
<
(
number
|
string
)[]
>
([])
const
cardSelectedIds
=
ref
<
(
number
|
string
)[]
>
([])
const
logList
=
ref
<
LogListData
[]
>
([])
const
logList
=
ref
<
LogListData
[]
>
([])
const
mainTableRef
=
ref
()
const
mainColumns
:
CustomColumn
<
FactoryOrderNewListData
>
[]
=
[
const
mainColumns
:
CustomColumn
<
FactoryOrderNewListData
>
[]
=
[
{
key
:
'orderNumber'
,
prop
:
'orderNumber'
,
label
:
'订单编号'
,
minWidth
:
160
}
,
{
key
:
'orderNumber'
,
prop
:
'orderNumber'
,
label
:
'订单编号'
,
minWidth
:
160
}
,
...
@@ -1255,7 +1248,6 @@ const productColumns: CustomColumn<ProductListData>[] = [
...
@@ -1255,7 +1248,6 @@ const productColumns: CustomColumn<ProductListData>[] = [
{
key
:
'remark'
,
prop
:
'remark'
,
label
:
'备注'
,
width
:
160
}
,
{
key
:
'remark'
,
prop
:
'remark'
,
label
:
'备注'
,
width
:
160
}
,
]
]
// ========== 分页数据 ==========
const
{
const
{
loading
,
loading
,
currentPage
,
currentPage
,
...
@@ -1270,7 +1262,6 @@ const {
...
@@ -1270,7 +1262,6 @@ const {
getFactoryOrderNewListApi
(
getFactoryOrderNewListApi
(
{
{
...
searchForm
.
value
,
...
searchForm
.
value
,
craftCode
:
craftCode
.
value
,
startTime
:
dateRange
.
value
?.[
0
]
||
null
,
startTime
:
dateRange
.
value
?.[
0
]
||
null
,
endTime
:
dateRange
.
value
?.[
1
]
||
null
,
endTime
:
dateRange
.
value
?.[
1
]
||
null
,
}
,
}
,
...
@@ -1295,11 +1286,9 @@ const search = () => {
...
@@ -1295,11 +1286,9 @@ const search = () => {
const
reset
=
()
=>
{
const
reset
=
()
=>
{
searchForm
.
value
=
{
}
searchForm
.
value
=
{
}
dateRange
.
value
=
[]
dateRange
.
value
=
[]
craftCode
.
value
=
''
search
()
search
()
}
}
// ========== 组件 Ref ==========
const
confirmOrderDialogRef
=
ref
<
InstanceType
<
typeof
ConfirmOrderDialog
>>
()
const
confirmOrderDialogRef
=
ref
<
InstanceType
<
typeof
ConfirmOrderDialog
>>
()
const
cancelOrderDialogRef
=
ref
<
InstanceType
<
typeof
CancelOrderDialog
>>
()
const
cancelOrderDialogRef
=
ref
<
InstanceType
<
typeof
CancelOrderDialog
>>
()
const
suspendDialogRef
=
ref
<
InstanceType
<
typeof
SuspendDialog
>>
()
const
suspendDialogRef
=
ref
<
InstanceType
<
typeof
SuspendDialog
>>
()
...
@@ -1312,13 +1301,10 @@ const arrangeDialogRef = ref<InstanceType<typeof ArrangeDialog>>()
...
@@ -1312,13 +1301,10 @@ const arrangeDialogRef = ref<InstanceType<typeof ArrangeDialog>>()
const
createLogisticDialogRef
=
ref
()
const
createLogisticDialogRef
=
ref
()
const
updateCustomsDialogVisible
=
ref
(
false
)
const
updateCustomsDialogVisible
=
ref
(
false
)
const
weightDialogRef
=
ref
()
const
weightDialogRef
=
ref
()
// ========== 通用工具 ==========
const
getSelectedIds
=
():
(
number
|
string
)[]
=>
{
const
getSelectedIds
=
():
(
number
|
string
)[]
=>
{
if
(
isCardLayout
.
value
)
return
cardSelectedIds
.
value
if
(
isCardLayout
.
value
)
return
cardSelectedIds
.
value
return
selectedRowIds
.
value
return
selectedRowIds
.
value
}
}
const
ensureSelection
=
(
msg
=
'请先选择订单'
):
boolean
=>
{
const
ensureSelection
=
(
msg
=
'请先选择订单'
):
boolean
=>
{
const
ids
=
getSelectedIds
()
const
ids
=
getSelectedIds
()
if
(
!
ids
.
length
)
{
if
(
!
ids
.
length
)
{
...
@@ -1327,7 +1313,6 @@ const ensureSelection = (msg = '请先选择订单'): boolean => {
...
@@ -1327,7 +1313,6 @@ const ensureSelection = (msg = '请先选择订单'): boolean => {
}
}
return
true
return
true
}
}
const
refreshCurrentView
=
()
=>
{
const
refreshCurrentView
=
()
=>
{
if
(
isSpecialLayout
.
value
)
{
if
(
isSpecialLayout
.
value
)
{
if
(
status
.
value
===
'BATCH_MANAGE'
)
batchManageRef
.
value
?.
refresh
()
if
(
status
.
value
===
'BATCH_MANAGE'
)
batchManageRef
.
value
?.
refresh
()
...
@@ -1337,8 +1322,6 @@ const refreshCurrentView = () => {
...
@@ -1337,8 +1322,6 @@ const refreshCurrentView = () => {
refresh
()
refresh
()
if
(
isCardLayout
.
value
)
cardLayoutRef
.
value
?.
clearSelection
()
if
(
isCardLayout
.
value
)
cardLayoutRef
.
value
?.
clearSelection
()
}
}
// ========== 状态切换 ==========
const
handleStatusNodeClick
=
(
node
:
StatusTreeNode
)
=>
{
const
handleStatusNodeClick
=
(
node
:
StatusTreeNode
)
=>
{
if
(
status
.
value
===
node
.
code
)
return
if
(
status
.
value
===
node
.
code
)
return
status
.
value
=
node
.
code
status
.
value
=
node
.
code
...
@@ -1359,28 +1342,22 @@ const handleStatusNodeClick = (node: StatusTreeNode) => {
...
@@ -1359,28 +1342,22 @@ const handleStatusNodeClick = (node: StatusTreeNode) => {
// refresh()
// refresh()
//
}
//
}
}
}
const
toggleExpand
=
(
node
:
{
expanded
?:
boolean
}
)
=>
{
const
toggleExpand
=
(
node
:
{
expanded
?:
boolean
}
)
=>
{
node
.
expanded
=
!
node
.
expanded
node
.
expanded
=
!
node
.
expanded
}
}
const
handlePageSizeChange
=
(
size
:
number
)
=>
{
const
handlePageSizeChange
=
(
size
:
number
)
=>
{
onPageSizeChange
(
size
)
onPageSizeChange
(
size
)
}
}
const
handleCurrentPageChange
=
(
page
:
number
)
=>
{
const
handleCurrentPageChange
=
(
page
:
number
)
=>
{
onCurrentPageChange
(
page
)
onCurrentPageChange
(
page
)
}
}
const
handleMainSelectionChange
=
(
rows
:
FactoryOrderNewListData
[])
=>
{
const
handleMainSelectionChange
=
(
rows
:
FactoryOrderNewListData
[])
=>
{
selectedRowIds
.
value
=
rows
.
map
((
row
)
=>
row
.
id
)
selectedRowIds
.
value
=
rows
.
map
((
row
)
=>
row
.
id
)
selectedRows
.
value
=
rows
selectedRows
.
value
=
rows
}
}
const
handleCardSelectionChange
=
(
items
:
{
id
:
number
|
string
}
[])
=>
{
const
handleCardSelectionChange
=
(
items
:
{
id
:
number
|
string
}
[])
=>
{
cardSelectedIds
.
value
=
items
.
map
((
i
)
=>
i
.
id
)
cardSelectedIds
.
value
=
items
.
map
((
i
)
=>
i
.
id
)
}
}
const
loadSubTables
=
async
()
=>
{
const
loadSubTables
=
async
()
=>
{
if
(
!
currentRow
.
value
)
{
if
(
!
currentRow
.
value
)
{
productList
.
value
=
[]
productList
.
value
=
[]
...
@@ -1398,23 +1375,18 @@ const loadSubTables = async () => {
...
@@ -1398,23 +1375,18 @@ const loadSubTables = async () => {
console
.
error
(
e
)
console
.
error
(
e
)
}
}
}
}
const
handleMainRowClick
=
(
row
:
FactoryOrderNewListData
)
=>
{
const
handleMainRowClick
=
(
row
:
FactoryOrderNewListData
)
=>
{
currentRow
.
value
=
row
currentRow
.
value
=
row
loadSubTables
()
loadSubTables
()
}
}
// ========== 待接单 操作 ==========
const
handleConfirmOrder
=
()
=>
{
const
handleConfirmOrder
=
()
=>
{
if
(
!
ensureSelection
())
return
if
(
!
ensureSelection
())
return
confirmOrderDialogRef
.
value
?.
open
(
getSelectedIds
())
confirmOrderDialogRef
.
value
?.
open
(
getSelectedIds
())
}
}
const
handleCancelOrder
=
()
=>
{
const
handleCancelOrder
=
()
=>
{
//
if (!ensureSelection()) return
if
(
!
ensureSelection
())
return
cancelOrderDialogRef
.
value
?.
open
(
getSelectedIds
())
cancelOrderDialogRef
.
value
?.
open
(
getSelectedIds
())
}
}
const
handleRefreshProductInfo
=
async
()
=>
{
const
handleRefreshProductInfo
=
async
()
=>
{
if
(
!
ensureSelection
())
return
if
(
!
ensureSelection
())
return
try
{
try
{
...
@@ -1425,7 +1397,6 @@ const handleRefreshProductInfo = async () => {
...
@@ -1425,7 +1397,6 @@ const handleRefreshProductInfo = async () => {
ElMessage
.
error
((
e
as
Error
)?.
message
||
'刷新商品信息失败'
)
ElMessage
.
error
((
e
as
Error
)?.
message
||
'刷新商品信息失败'
)
}
}
}
}
const
handleTransferOldFlow
=
async
()
=>
{
const
handleTransferOldFlow
=
async
()
=>
{
if
(
!
ensureSelection
())
return
if
(
!
ensureSelection
())
return
await
ElMessageBox
.
confirm
(
'确定转旧流程吗?'
,
'提示'
,
{
type
:
'warning'
}
)
await
ElMessageBox
.
confirm
(
'确定转旧流程吗?'
,
'提示'
,
{
type
:
'warning'
}
)
...
@@ -1437,8 +1408,6 @@ const handleTransferOldFlow = async () => {
...
@@ -1437,8 +1408,6 @@ const handleTransferOldFlow = async () => {
ElMessage
.
error
((
e
as
Error
)?.
message
||
'转旧流程失败'
)
ElMessage
.
error
((
e
as
Error
)?.
message
||
'转旧流程失败'
)
}
}
}
}
// ========== 待创建物流 操作 ==========
const
handleLogisticsCommand
=
async
(
command
:
string
)
=>
{
const
handleLogisticsCommand
=
async
(
command
:
string
)
=>
{
if
(
!
ensureSelection
())
return
if
(
!
ensureSelection
())
return
const
ids
=
getSelectedIds
()
const
ids
=
getSelectedIds
()
...
@@ -1475,17 +1444,14 @@ const handleLogisticsCommand = async (command: string) => {
...
@@ -1475,17 +1444,14 @@ const handleLogisticsCommand = async (command: string) => {
ElMessage
.
error
((
e
as
Error
)?.
message
||
`${labelMap[command]
}
失败`
)
ElMessage
.
error
((
e
as
Error
)?.
message
||
`${labelMap[command]
}
失败`
)
}
}
}
}
const
handleSuspend
=
()
=>
{
const
handleSuspend
=
()
=>
{
if
(
!
ensureSelection
())
return
if
(
!
ensureSelection
())
return
suspendDialogRef
.
value
?.
open
(
getSelectedIds
())
suspendDialogRef
.
value
?.
open
(
getSelectedIds
())
}
}
const
handleUpdateCustomsInfo
=
()
=>
{
const
handleUpdateCustomsInfo
=
()
=>
{
if
(
!
ensureSelection
())
return
if
(
!
ensureSelection
())
return
updateCustomsDialogVisible
.
value
=
true
updateCustomsDialogVisible
.
value
=
true
}
}
const
handleArrange
=
async
()
=>
{
const
handleArrange
=
async
()
=>
{
if
(
!
ensureSelection
())
return
if
(
!
ensureSelection
())
return
const
productIdList
=
getSelectedIds
()
const
productIdList
=
getSelectedIds
()
...
@@ -1493,10 +1459,8 @@ const handleArrange = async () => {
...
@@ -1493,10 +1459,8 @@ const handleArrange = async () => {
.
filter
((
n
)
=>
Number
.
isFinite
(
n
))
as
number
[]
.
filter
((
n
)
=>
Number
.
isFinite
(
n
))
as
number
[]
arrangeDialogRef
.
value
?.
open
({
productIdList
}
)
arrangeDialogRef
.
value
?.
open
({
productIdList
}
)
}
}
const
podOrderVisible
=
ref
(
false
)
const
podOrderVisible
=
ref
(
false
)
const
warehouseList
=
ref
<
WarehouseListData
[]
>
([])
const
warehouseList
=
ref
<
WarehouseListData
[]
>
([])
const
loadWarehouseList
=
async
()
=>
{
const
loadWarehouseList
=
async
()
=>
{
try
{
try
{
const
res
=
await
loadWarehouseListApi
()
const
res
=
await
loadWarehouseListApi
()
...
@@ -1506,7 +1470,6 @@ const loadWarehouseList = async () => {
...
@@ -1506,7 +1470,6 @@ const loadWarehouseList = async () => {
console
.
error
(
e
)
console
.
error
(
e
)
}
}
}
}
const
sheetPrinter
=
ref
(
''
)
const
sheetPrinter
=
ref
(
''
)
const
handlePrinterChange
=
(
value
:
string
)
=>
{
const
handlePrinterChange
=
(
value
:
string
)
=>
{
sheetPrinter
.
value
=
value
sheetPrinter
.
value
=
value
...
@@ -1515,14 +1478,13 @@ const handlePrinterChange = (value: string) => {
...
@@ -1515,14 +1478,13 @@ const handlePrinterChange = (value: string) => {
const
handleWarehouseIdChange
=
(
value
:
string
)
=>
{
const
handleWarehouseIdChange
=
(
value
:
string
)
=>
{
localStorage
.
setItem
(
'locaclWarehouseId'
,
JSON
.
stringify
(
value
))
localStorage
.
setItem
(
'locaclWarehouseId'
,
JSON
.
stringify
(
value
))
}
}
const
{
getCLodop
}
=
useLodop
()
const
handleSeedingWall
=
()
=>
{
const
handleSeedingWall
=
()
=>
{
const
lodop
=
getCLodop
(
null
,
null
)
const
lodop
=
getCLodop
(
null
,
null
)
if
(
!
lodop
)
return
if
(
!
lodop
)
return
sheetPrinter
.
value
=
lodop
.
GET_PRINTER_NAME
(
0
)
sheetPrinter
.
value
=
lodop
.
GET_PRINTER_NAME
(
0
)
podOrderVisible
.
value
=
true
podOrderVisible
.
value
=
true
}
}
const
{
getCLodop
}
=
useLodop
()
const
printOrder
=
async
(
data
:
OrderData
,
callback
:
(
status
:
boolean
)
=>
void
)
=>
{
const
printOrder
=
async
(
data
:
OrderData
,
callback
:
(
status
:
boolean
)
=>
void
)
=>
{
const
lodop
=
getCLodop
(
null
,
null
)
const
lodop
=
getCLodop
(
null
,
null
)
...
@@ -1580,7 +1542,6 @@ const printOrder = async (data: OrderData, callback: (status: boolean) => void)
...
@@ -1580,7 +1542,6 @@ const printOrder = async (data: OrderData, callback: (status: boolean) => void)
callback
(
false
)
callback
(
false
)
}
}
}
}
let
_lodop
:
LODOPObject
|
null
=
null
let
_lodop
:
LODOPObject
|
null
=
null
let
_lodopCallback
:
{
[
key
:
string
]:
(
value
:
string
)
=>
void
}
=
{
}
let
_lodopCallback
:
{
[
key
:
string
]:
(
value
:
string
)
=>
void
}
=
{
}
const
lodopCall
=
(
fn
:
(
lodop
:
LODOPObject
)
=>
string
)
=>
{
const
lodopCall
=
(
fn
:
(
lodop
:
LODOPObject
)
=>
string
)
=>
{
...
@@ -1604,7 +1565,6 @@ const lodopCall = (fn: (lodop: LODOPObject) => string) => {
...
@@ -1604,7 +1565,6 @@ const lodopCall = (fn: (lodop: LODOPObject) => string) => {
_lodopCallback
[
id
]
=
resolve
_lodopCallback
[
id
]
=
resolve
}
)
}
)
}
}
const
downloadPDF
=
(
url
:
string
)
=>
{
const
downloadPDF
=
(
url
:
string
)
=>
{
if
(
!
/^https
?
:/i
.
test
(
url
))
return
url
if
(
!
/^https
?
:/i
.
test
(
url
))
return
url
const
xhr
=
new
XMLHttpRequest
()
const
xhr
=
new
XMLHttpRequest
()
...
@@ -1644,7 +1604,6 @@ const downloadPDF = (url: string) => {
...
@@ -1644,7 +1604,6 @@ const downloadPDF = (url: string) => {
}
}
return
'data:application/pdf;base64,'
+
strData
return
'data:application/pdf;base64,'
+
strData
}
}
const
handleDownloadMaterial
=
async
()
=>
{
const
handleDownloadMaterial
=
async
()
=>
{
if
(
!
ensureSelection
())
return
if
(
!
ensureSelection
())
return
const
ids
=
getSelectedIds
()
const
ids
=
getSelectedIds
()
...
@@ -1661,8 +1620,6 @@ const handleDownloadMaterial = async () => {
...
@@ -1661,8 +1620,6 @@ const handleDownloadMaterial = async () => {
ElMessage
.
error
((
e
as
Error
)?.
message
||
'下载素材失败'
)
ElMessage
.
error
((
e
as
Error
)?.
message
||
'下载素材失败'
)
}
}
}
}
// ========== 待拣胚/待补胚 操作 ==========
const
handleDtfCommand
=
async
(
command
:
string
)
=>
{
const
handleDtfCommand
=
async
(
command
:
string
)
=>
{
if
(
!
ensureSelection
())
return
if
(
!
ensureSelection
())
return
const
ids
=
getSelectedIds
()
const
ids
=
getSelectedIds
()
...
@@ -1687,7 +1644,6 @@ const handleDtfCommand = async (command: string) => {
...
@@ -1687,7 +1644,6 @@ const handleDtfCommand = async (command: string) => {
ElMessage
.
error
((
e
as
Error
)?.
message
||
'DTF排版失败'
)
ElMessage
.
error
((
e
as
Error
)?.
message
||
'DTF排版失败'
)
}
}
}
}
const
handlePrintProductionOrder
=
async
()
=>
{
const
handlePrintProductionOrder
=
async
()
=>
{
if
(
!
ensureSelection
())
return
if
(
!
ensureSelection
())
return
const
ids
=
getSelectedIds
()
const
ids
=
getSelectedIds
()
...
@@ -1704,7 +1660,6 @@ const handlePrintProductionOrder = async () => {
...
@@ -1704,7 +1660,6 @@ const handlePrintProductionOrder = async () => {
ElMessage
.
error
((
e
as
Error
)?.
message
||
'打印生产单失败'
)
ElMessage
.
error
((
e
as
Error
)?.
message
||
'打印生产单失败'
)
}
}
}
}
const
handlePrintPickOrder
=
async
()
=>
{
const
handlePrintPickOrder
=
async
()
=>
{
if
(
!
ensureSelection
())
return
if
(
!
ensureSelection
())
return
const
ids
=
getSelectedIds
()
const
ids
=
getSelectedIds
()
...
@@ -1720,17 +1675,14 @@ const handlePrintPickOrder = async () => {
...
@@ -1720,17 +1675,14 @@ const handlePrintPickOrder = async () => {
)
)
}
}
}
}
const
handlePickComplete
=
()
=>
{
const
handlePickComplete
=
()
=>
{
if
(
!
ensureSelection
())
return
//
if (!ensureSelection()) return
pickCompleteDialogRef
.
value
?.
open
(
getSelectedIds
())
pickCompleteDialogRef
.
value
?.
open
(
getSelectedIds
())
}
}
const
handlePickFail
=
()
=>
{
const
handlePickFail
=
()
=>
{
//
if (!ensureSelection()) return
if
(
!
ensureSelection
())
return
pickFailDialogRef
.
value
?.
open
(
getSelectedIds
())
pickFailDialogRef
.
value
?.
open
(
getSelectedIds
())
}
}
const
handleApplyReplenish
=
async
()
=>
{
const
handleApplyReplenish
=
async
()
=>
{
if
(
!
ensureSelection
())
return
if
(
!
ensureSelection
())
return
await
ElMessageBox
.
confirm
(
'确定申请补胚吗?'
,
'提示'
,
{
type
:
'warning'
}
)
await
ElMessageBox
.
confirm
(
'确定申请补胚吗?'
,
'提示'
,
{
type
:
'warning'
}
)
...
@@ -1746,7 +1698,6 @@ const handleApplyReplenish = async () => {
...
@@ -1746,7 +1698,6 @@ const handleApplyReplenish = async () => {
)
)
}
}
}
}
const
handleProductionComplete
=
async
()
=>
{
const
handleProductionComplete
=
async
()
=>
{
if
(
!
ensureSelection
())
return
if
(
!
ensureSelection
())
return
await
ElMessageBox
.
confirm
(
'确定生产完成吗?'
,
'提示'
,
{
type
:
'warning'
}
)
await
ElMessageBox
.
confirm
(
'确定生产完成吗?'
,
'提示'
,
{
type
:
'warning'
}
)
...
@@ -1764,11 +1715,9 @@ const handleProductionComplete = async () => {
...
@@ -1764,11 +1715,9 @@ const handleProductionComplete = async () => {
ElMessage
.
error
((
e
as
Error
)?.
message
||
'生产完成失败'
)
ElMessage
.
error
((
e
as
Error
)?.
message
||
'生产完成失败'
)
}
}
}
}
const
handleWeightSort
=
()
=>
{
const
handleWeightSort
=
()
=>
{
weightDialogRef
.
value
?.
open
()
weightDialogRef
.
value
?.
open
()
}
}
const
handleArchiveOrder
=
async
()
=>
{
const
handleArchiveOrder
=
async
()
=>
{
if
(
!
ensureSelection
())
return
if
(
!
ensureSelection
())
return
await
ElMessageBox
.
confirm
(
'确定订单归档吗?'
,
'提示'
,
{
type
:
'warning'
}
)
await
ElMessageBox
.
confirm
(
'确定订单归档吗?'
,
'提示'
,
{
type
:
'warning'
}
)
...
@@ -1784,7 +1733,6 @@ const handleArchiveOrder = async () => {
...
@@ -1784,7 +1733,6 @@ const handleArchiveOrder = async () => {
)
)
}
}
}
}
const
handleCancelSuspend
=
async
()
=>
{
const
handleCancelSuspend
=
async
()
=>
{
if
(
!
ensureSelection
())
return
if
(
!
ensureSelection
())
return
try
{
try
{
...
@@ -1795,7 +1743,6 @@ const handleCancelSuspend = async () => {
...
@@ -1795,7 +1743,6 @@ const handleCancelSuspend = async () => {
ElMessage
.
error
((
e
as
Error
)?.
message
||
'取消挂起失败'
)
ElMessage
.
error
((
e
as
Error
)?.
message
||
'取消挂起失败'
)
}
}
}
}
const
handleSyncAddress
=
async
()
=>
{
const
handleSyncAddress
=
async
()
=>
{
if
(
!
ensureSelection
())
return
if
(
!
ensureSelection
())
return
await
ElMessageBox
.
confirm
(
'确定同步收货地址吗?'
,
'提示'
,
{
type
:
'warning'
}
)
await
ElMessageBox
.
confirm
(
'确定同步收货地址吗?'
,
'提示'
,
{
type
:
'warning'
}
)
...
@@ -1807,27 +1754,22 @@ const handleSyncAddress = async () => {
...
@@ -1807,27 +1754,22 @@ const handleSyncAddress = async () => {
ElMessage
.
error
((
e
as
Error
)?.
message
||
'同步收货地址失败'
)
ElMessage
.
error
((
e
as
Error
)?.
message
||
'同步收货地址失败'
)
}
}
}
}
const
handleReplenishComplete
=
()
=>
{
const
handleReplenishComplete
=
()
=>
{
if
(
!
ensureSelection
())
return
if
(
!
ensureSelection
())
return
ElMessage
.
info
(
'补胚完成功能待集成'
)
ElMessage
.
info
(
'补胚完成功能待集成'
)
}
}
const
handleReplenishFail
=
()
=>
{
const
handleReplenishFail
=
()
=>
{
if
(
!
ensureSelection
())
return
if
(
!
ensureSelection
())
return
ElMessage
.
info
(
'补胚失败功能待集成'
)
ElMessage
.
info
(
'补胚失败功能待集成'
)
}
}
const
handleQuickProduction
=
()
=>
{
const
handleQuickProduction
=
()
=>
{
if
(
!
ensureSelection
())
return
if
(
!
ensureSelection
())
return
ElMessage
.
info
(
'快捷生产功能待集成'
)
ElMessage
.
info
(
'快捷生产功能待集成'
)
}
}
const
handleSinglePrint
=
()
=>
{
const
handleSinglePrint
=
()
=>
{
if
(
!
ensureSelection
())
return
if
(
!
ensureSelection
())
return
ElMessage
.
info
(
'单件打单功能待集成'
)
ElMessage
.
info
(
'单件打单功能待集成'
)
}
}
const
handleGetTrackingNumber
=
async
()
=>
{
const
handleGetTrackingNumber
=
async
()
=>
{
if
(
!
ensureSelection
())
return
if
(
!
ensureSelection
())
return
await
ElMessageBox
.
confirm
(
'确定获取跟踪号吗?'
,
'提示'
,
{
type
:
'warning'
}
)
await
ElMessageBox
.
confirm
(
'确定获取跟踪号吗?'
,
'提示'
,
{
type
:
'warning'
}
)
...
@@ -1839,7 +1781,6 @@ const handleGetTrackingNumber = async () => {
...
@@ -1839,7 +1781,6 @@ const handleGetTrackingNumber = async () => {
ElMessage
.
error
((
e
as
Error
)?.
message
||
'获取跟踪号失败'
)
ElMessage
.
error
((
e
as
Error
)?.
message
||
'获取跟踪号失败'
)
}
}
}
}
const
handleStatusPush
=
()
=>
{
const
handleStatusPush
=
()
=>
{
if
(
!
ensureSelection
())
return
if
(
!
ensureSelection
())
return
ElMessage
.
info
(
'状态推送功能待集成'
)
ElMessage
.
info
(
'状态推送功能待集成'
)
...
@@ -1853,7 +1794,6 @@ watch(
...
@@ -1853,7 +1794,6 @@ watch(
}
}
}
,
}
,
)
)
watch
(
watch
(
()
=>
suspendedSubTab
.
value
,
()
=>
suspendedSubTab
.
value
,
()
=>
{
()
=>
{
...
@@ -1863,7 +1803,6 @@ watch(
...
@@ -1863,7 +1803,6 @@ watch(
}
}
}
,
}
,
)
)
watch
(
watch
(
()
=>
activeTab
.
value
,
()
=>
activeTab
.
value
,
()
=>
{
()
=>
{
...
...
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