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
f7899557
Commit
f7899557
authored
Mar 19, 2026
by
qinjianhui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 代码优化
parent
d70f0b3f
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
262 additions
and
160 deletions
+262
-160
src/types/api/factoryOrderNew.ts
+22
-8
src/views/order/factoryOrderNew/component/BatchManageTable.vue
+199
-91
src/views/order/factoryOrderNew/component/WaitingRestockTable.vue
+38
-57
src/views/order/factoryOrderNew/index.vue
+3
-4
src/views/order/factoryOrderNew/newOrder.md
+0
-0
No files found.
src/types/api/factoryOrderNew.ts
View file @
f7899557
...
...
@@ -33,7 +33,7 @@ export interface SearchForm {
size
?:
string
logisticsCompanyCode
?:
string
blocking
?:
boolean
standardDesignImage
?:
boolean
standardDesignImage
?:
number
}
export
interface
FactoryOrderNewListData
{
...
...
@@ -91,15 +91,29 @@ export interface LogListData {
export
interface
BatchManageData
{
id
:
number
batchNo
?:
string
downloadStatus
?:
string
orderCount
?:
number
totalCount
?:
number
creator
?:
string
factoryId
?:
number
batchArrangeNum
?:
string
billType
?:
string
url
?:
string
tiffUrl
?:
string
syntheticStatus
?:
boolean
downloadStatus
?:
boolean
productNum
?:
number
materialNum
?:
number
craftType
?:
string
timesRange
?:
string
employeeAccount
?:
string
employeeId
?:
number
createTime
?:
string
extractTimes
?:
number
failReason
?:
string
failTime
?:
string
automaticComposing
?:
boolean
composingParam
?:
string
printProductOrder
?:
boolean
printPickOrder
?:
boolean
prnUrl
?:
string
prnDownloadStatus
?:
string
enableArrange
?:
boolean
standardDesignImage
?:
number
}
export
interface
RestockData
{
...
...
src/views/order/factoryOrderNew/component/BatchManageTable.vue
View file @
f7899557
...
...
@@ -35,12 +35,12 @@
clearable
style=
"width: 120px"
>
<ElOption
label=
"烫画"
value=
"TH"
/>
<ElOption
label=
"直喷"
value=
"ZP"
/>
<ElOption
label=
"刺绣"
value=
"CX"
/>
<ElOption
label=
"雕刻"
value=
"DK"
/>
<ElOption
label=
"白胚"
value=
"BP"
/>
<ElOption
label=
"其他"
value=
"QT"
/
>
<ElOption
v-for=
"(item, index) in processType"
:key=
"index"
:value=
"item.value"
:label=
"item.label"
></ElOption
>
</ElSelect>
</ElFormItem>
<ElFormItem
label=
"下载状态"
>
...
...
@@ -95,6 +95,7 @@
<div
class=
"batch-manage-table"
>
<TableView
v-loading=
"loading"
:paginated-data=
"tableData"
:columns=
"columns"
selectionable
...
...
@@ -109,12 +110,7 @@
</el-tag>
</
template
>
<
template
#
operation=
"{ row }"
>
<ElButton
type=
"primary"
link
size=
"small"
@
click=
"handleDownload()"
>
<ElButton
type=
"primary"
link
size=
"small"
@
click=
"handleDownload()"
>
下载
</ElButton>
<ElButton
type=
"primary"
link
size=
"small"
@
click=
"handlePrintPick()"
>
...
...
@@ -128,7 +124,12 @@
>
生产单
</ElButton>
<ElButton
type=
"warning"
link
size=
"small"
@
click=
"handleReArrange(row)"
>
<ElButton
type=
"warning"
link
size=
"small"
@
click=
"handleReArrange(row)"
>
重排
</ElButton>
<ElButton
type=
"danger"
link
size=
"small"
@
click=
"handleDelete()"
>
...
...
@@ -138,7 +139,7 @@
</TableView>
</div>
<ArrangeDialog
ref=
"arrangeDialogRef"
@
success=
"
loadData
"
/>
<ArrangeDialog
ref=
"arrangeDialogRef"
@
success=
"
refresh
"
/>
<ElPagination
v-model:current-page=
"currentPage"
...
...
@@ -148,87 +149,208 @@
layout=
"total, sizes, prev, pager, next, jumper"
:total=
"total"
style=
"margin: 10px auto 0"
@
size-change=
"
handle
PageSizeChange"
@
current-change=
"
handle
CurrentPageChange"
@
size-change=
"
on
PageSizeChange"
@
current-change=
"
on
CurrentPageChange"
/>
</div>
</template>
<
script
setup
lang=
"ts"
>
<
script
setup
lang=
"ts
x
"
>
import
{
ref
,
reactive
,
onMounted
}
from
'vue'
import
{
ElMessage
,
ElMessageBox
}
from
'element-plus'
import
{
getBatchManageListApi
,
batchDeleteApi
}
from
'@/api/factoryOrderNew'
import
type
{
BatchManageData
}
from
'@/types/api/factoryOrderNew'
import
type
{
PaginationData
}
from
'@/types/api'
import
type
{
CustomColumn
}
from
'@/types/table'
import
TableView
from
'@/components/TableView.vue'
import
ArrangeDialog
from
'./ArrangeDialog.vue'
import
{
getEmployeeListApi
}
from
'@/api/common'
import
type
{
userData
}
from
'@/types/api/user'
import
usePageList
from
'@/utils/hooks/usePageList'
const
loading
=
ref
(
false
)
const
tableData
=
ref
<
BatchManageData
[]
>
([])
const
selectedRows
=
ref
<
BatchManageData
[]
>
([])
const
currentPage
=
ref
(
1
)
const
pageSize
=
ref
(
50
)
const
total
=
ref
(
0
)
const
employeeList
=
ref
<
userData
[]
>
([])
const
arrangeDialogRef
=
ref
<
InstanceType
<
typeof
ArrangeDialog
>>
()
interface
ProcessTypeData
{
label
:
string
value
:
string
}
const
processType
=
ref
<
ProcessTypeData
[]
>
([
{
label
:
'烫画'
,
value
:
'TH'
,
},
{
label
:
'直喷'
,
value
:
'ZP'
,
},
{
label
:
'刺绣'
,
value
:
'CX'
,
},
{
label
:
'雕刻'
,
value
:
'DK'
,
},
{
label
:
'白胚'
,
value
:
'BP'
,
},
{
label
:
'其他'
,
value
:
'QT'
,
},
])
const
getStandardDesignImageText
=
(
value
:
number
):
string
=>
{
const
map
:
Record
<
number
,
string
>
=
{
0
:
'否'
,
1
:
'是'
,
2
:
'混合'
}
return
map
[
value
]
??
'-'
}
const
columns
:
CustomColumn
<
BatchManageData
>
[]
=
[
{
key
:
'batchNo'
,
prop
:
'batchNo'
,
label
:
'批次号'
,
minWidth
:
120
},
[
{
key
:
'downloadStatus'
,
prop
:
'downloadStatus'
,
label
:
'下载状态'
,
minWidth
:
90
,
label
:
'批次号'
,
prop
:
'batchArrangeNum'
,
width
:
120
,
align
:
'center'
,
},
{
label
:
'下载状态'
,
slot
:
'downloadStatus'
,
width
:
90
,
align
:
'center'
,
render
:
(
item
:
BatchManageData
)
=>
{
return
(
<
div
>
<
el
-
tag
type
=
{
item
.
downloadStatus
?
'success'
:
'danger'
}
>
{
item
.
downloadStatus
?
'已下载'
:
'未下载'
}
<
/el-tag
>
<
/div
>
)
},
},
{
key
:
'orderCount'
,
prop
:
'orderCount'
,
label
:
'订单数量'
,
minWidth
:
90
,
prop
:
'productNum'
,
width
:
85
,
align
:
'center'
,
},
{
key
:
'totalCount'
,
prop
:
'totalCount'
,
label
:
'全部数量'
,
minWidth
:
90
,
label
:
'素材数量'
,
width
:
85
,
prop
:
'materialNum'
,
align
:
'center'
,
},
{
key
:
'creator'
,
prop
:
'creator'
,
label
:
'创建人'
,
minWidth
:
80
},
{
key
:
'craftType'
,
prop
:
'craftType'
,
label
:
'工艺类型'
,
minWidth
:
90
},
{
key
:
'timesRange'
,
prop
:
'timesRange'
,
label
:
'次数范围'
,
minWidth
:
90
},
{
key
:
'createTime'
,
prop
:
'createTime'
,
label
:
'创建时间'
,
minWidth
:
160
,
sortable
:
true
,
label
:
'创建人'
,
width
:
85
,
prop
:
'employeeAccount'
,
align
:
'center'
,
},
{
key
:
'createTimeSort'
,
label
:
'工艺类型'
,
width
:
150
,
prop
:
'craftType'
,
align
:
'center'
,
render
:
(
item
:
BatchManageData
)
=>
{
if
(
!
item
.
craftType
)
{
return
(
<
div
>
<
span
>-<
/span
>
<
/div
>
)
}
const
labels
=
item
.
craftType
.
split
(
','
)
.
map
((
type
)
=>
type
.
trim
())
.
map
(
(
type
)
=>
processType
.
value
.
find
((
e
:
ProcessTypeData
)
=>
e
.
value
===
type
)
?.
label
||
type
,
)
.
filter
(
Boolean
)
return
(
<
div
>
<
span
>
{
labels
.
join
(
','
)}
<
/span
>
<
/div
>
)
},
},
{
label
:
'规范素材'
,
minWidth
:
180
,
prop
:
'standardDesignImage'
,
align
:
'center'
,
render
:
(
item
:
BatchManageData
)
=>
{
return
(
<
div
>
<
span
>
{
getStandardDesignImageText
(
item
.
standardDesignImage
??
0
)}
<
/span
>
<
/div
>
)
},
},
{
label
:
'失败原因'
,
minWidth
:
250
,
prop
:
'failReason'
,
align
:
'left'
,
render
:
(
item
:
BatchManageData
)
=>
{
return
(
<
div
>
<
span
v
-
html
=
{
item
.
failReason
}
><
/span
>
<
/div
>
)
},
},
{
label
:
'创建时间'
,
width
:
180
,
prop
:
'createTime'
,
label
:
'创建时间排序'
,
minWidth
:
110
,
sortable
:
true
,
align
:
'center'
,
},
{
label
:
'完成时间'
,
width
:
180
,
prop
:
'finishTime'
,
align
:
'center'
,
},
{
label
:
'自动排版'
,
width
:
85
,
prop
:
'automaticComposing'
,
align
:
'center'
,
render
:
(
item
:
BatchManageData
)
=>
{
return
(
<
div
>
<
span
>
{
item
.
automaticComposing
?
'是'
:
'否'
}
<
/span
>
<
/div
>
)
},
},
{
key
:
'extractTimes'
,
prop
:
'extractTimes'
,
label
:
'提取次数排序'
,
minWidth
:
110
,
sortable
:
true
,
label
:
'排版参数'
,
width
:
140
,
prop
:
'composingParam'
,
align
:
'center'
,
render
:
(
item
:
BatchManageData
)
=>
{
return
(
<
div
>
<
span
>
{
item
.
composingParam
?.
split
(
';'
).
join
(
'
\
n'
)}
<
/span
>
<
/div
>
)
},
},
{
key
:
'operation'
,
label
:
'操作'
,
minWidth
:
120
,
slot
:
'operate'
,
width
:
260
,
align
:
'center'
,
fixed
:
'right'
,
slot
:
'operation
'
,
prop
:
'operate
'
,
},
],
]
const
filterForm
=
reactive
({
...
...
@@ -244,23 +366,27 @@ const filterForm = reactive({
batchNo
:
''
,
})
const
loadData
=
async
()
=>
{
loading
.
value
=
true
try
{
const
res
=
await
getBatchManageListApi
(
{
...
filterForm
},
currentPage
.
value
,
pageSize
.
value
,
)
const
page
=
res
.
data
tableData
.
value
=
page
?.
records
||
[]
total
.
value
=
page
?.
total
||
0
}
catch
(
_e
)
{
tableData
.
value
=
[]
}
finally
{
loading
.
value
=
false
}
}
const
{
loading
,
currentPage
,
pageSize
,
total
,
data
:
tableData
,
onCurrentPageChange
,
onPageSizeChange
,
refresh
,
}
=
usePageList
<
BatchManageData
>
({
initPageSize
:
50
,
query
:
async
(
current
,
size
)
=>
{
const
res
=
await
getBatchManageListApi
({
...
filterForm
},
current
,
size
)
return
(
res
.
data
||
{
total
:
0
,
size
,
current
,
records
:
[],
})
as
PaginationData
<
BatchManageData
>
},
})
const
loadEmployeeList
=
async
()
=>
{
try
{
...
...
@@ -287,14 +413,13 @@ const handleBatchDelete = async () => {
try
{
await
batchDeleteApi
(
selectedRows
.
value
.
map
((
r
)
=>
r
.
id
))
ElMessage
.
success
(
'删除成功'
)
loadData
()
refresh
()
}
catch
(
e
)
{
const
err
=
e
as
Error
&
{
message
?:
string
}
ElMessage
.
error
(
err
?.
message
||
'删除失败'
)
}
}
const
handleDownload
=
()
=>
{
ElMessage
.
info
(
'接口待提供'
)
}
...
...
@@ -319,25 +444,8 @@ const handleReArrange = (row: BatchManageData) => {
})
}
const
handlePageSizeChange
=
(
size
:
number
)
=>
{
pageSize
.
value
=
size
currentPage
.
value
=
1
loadData
()
}
const
handleCurrentPageChange
=
(
page
:
number
)
=>
{
currentPage
.
value
=
page
loadData
()
}
const
refresh
=
()
=>
{
currentPage
.
value
=
1
loadData
()
}
onMounted
(()
=>
{
loadEmployeeList
()
loadData
()
})
defineExpose
({
refresh
})
...
...
src/views/order/factoryOrderNew/component/WaitingRestockTable.vue
View file @
f7899557
...
...
@@ -28,7 +28,7 @@
<div
class=
"restock-table"
>
<TableView
v-loading=
"loading"
:paginated-data=
"
pageD
ata"
:paginated-data=
"
d
ata"
:columns=
"columns"
serial-numberable
>
...
...
@@ -66,29 +66,52 @@
layout=
"total, sizes, prev, pager, next, jumper"
:total=
"total"
style=
"margin: 10px auto 0;"
@
size-change=
"
handle
PageSizeChange"
@
current-change=
"
handle
CurrentPageChange"
@
size-change=
"
on
PageSizeChange"
@
current-change=
"
on
CurrentPageChange"
/>
</div>
</template>
<
script
setup
lang=
"ts"
>
import
{
computed
,
ref
,
reactive
,
onMounted
}
from
'vue'
import
{
reactive
}
from
'vue'
import
{
ElMessage
}
from
'element-plus'
import
{
getRestockListApi
,
restockCheckApi
}
from
'@/api/factoryOrderNew'
import
type
{
RestockData
}
from
'@/types/api/factoryOrderNew'
import
type
{
PaginationData
}
from
'@/types/api'
import
type
{
CustomColumn
}
from
'@/types/table'
import
TableView
from
'@/components/TableView.vue'
import
usePageList
from
'@/utils/hooks/usePageList'
const
loading
=
ref
(
false
)
const
allData
=
ref
<
RestockData
[]
>
([])
const
currentPage
=
ref
(
1
)
const
pageSize
=
ref
(
50
)
const
total
=
ref
(
0
)
const
filterForm
=
reactive
({
stockSku
:
''
,
styleNo
:
''
,
})
const
pageData
=
computed
(()
=>
{
const
start
=
(
currentPage
.
value
-
1
)
*
pageSize
.
value
return
allData
.
value
.
slice
(
start
,
start
+
pageSize
.
value
)
const
{
loading
,
currentPage
,
pageSize
,
total
,
data
,
onCurrentPageChange
,
onPageSizeChange
,
refresh
,
}
=
usePageList
<
RestockData
>
({
initPageSize
:
50
,
query
:
async
(
current
,
size
)
=>
{
const
res
=
await
getRestockListApi
({
stockSku
:
filterForm
.
stockSku
||
undefined
,
styleNo
:
filterForm
.
styleNo
||
undefined
,
})
const
records
=
res
.
data
||
[]
const
start
=
(
current
-
1
)
*
size
return
{
total
:
records
.
length
,
size
,
current
,
records
:
records
.
slice
(
start
,
start
+
size
),
}
as
PaginationData
<
RestockData
>
},
})
const
columns
:
CustomColumn
<
RestockData
>
[]
=
[
...
...
@@ -154,69 +177,27 @@ const columns: CustomColumn<RestockData>[] = [
},
]
const
filterForm
=
reactive
({
stockSku
:
''
,
styleNo
:
''
,
})
const
loadData
=
async
()
=>
{
loading
.
value
=
true
try
{
const
res
=
await
getRestockListApi
({
stockSku
:
filterForm
.
stockSku
||
undefined
,
styleNo
:
filterForm
.
styleNo
||
undefined
,
})
allData
.
value
=
res
.
data
||
[]
total
.
value
=
allData
.
value
.
length
}
catch
(
_e
)
{
allData
.
value
=
[]
total
.
value
=
0
}
finally
{
loading
.
value
=
false
}
}
const
handleSearch
=
()
=>
{
currentPage
.
value
=
1
loadData
()
refresh
()
}
const
handleReset
=
()
=>
{
filterForm
.
stockSku
=
''
filterForm
.
styleNo
=
''
currentPage
.
value
=
1
loadData
()
}
const
handlePageSizeChange
=
(
size
:
number
)
=>
{
pageSize
.
value
=
size
currentPage
.
value
=
1
}
const
handleCurrentPageChange
=
(
page
:
number
)
=>
{
currentPage
.
value
=
page
refresh
()
}
const
handleRestockCheck
=
async
(
row
:
RestockData
)
=>
{
try
{
await
restockCheckApi
(
row
.
id
)
ElMessage
.
success
(
'补货校验成功'
)
loadData
()
refresh
()
}
catch
(
e
)
{
const
err
=
e
as
Error
&
{
message
?:
string
}
ElMessage
.
error
(
err
?.
message
||
'补货校验失败'
)
}
}
const
refresh
=
()
=>
{
currentPage
.
value
=
1
loadData
()
}
onMounted
(()
=>
{
loadData
()
})
defineExpose
({
refresh
})
</
script
>
...
...
src/views/order/factoryOrderNew/index.vue
View file @
f7899557
...
...
@@ -1310,10 +1310,9 @@ const handleStatusNodeClick = (node: StatusTreeNode) => {
currentRow
.
value
=
null
productList
.
value
=
[]
logList
.
value
=
[]
// if (!isSpecialLayout.value)
{
// onCurrentPageChange(1)
// refresh()
//
}
if
(
!
isSpecialLayout
.
value
)
{
refresh
()
}
}
const
toggleExpand
=
(
node
:
{
expanded
?:
boolean
}
)
=>
{
node
.
expanded
=
!
node
.
expanded
...
...
src/views/order/factoryOrderNew/newOrder.md
View file @
f7899557
This diff is collapsed.
Click to expand it.
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