Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
T
topsun-baoshen-excel
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
何远江
topsun-baoshen-excel
Commits
f2b9c528
Commit
f2b9c528
authored
Apr 19, 2025
by
tanghao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
订单转换分段走
parent
22b96f0c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
92 additions
and
4 deletions
+92
-4
order.ts
src/api/order.ts
+9
-0
OrderChange.vue
src/views/order/orderChange/OrderChange.vue
+83
-4
No files found.
src/api/order.ts
View file @
f2b9c528
...
...
@@ -107,6 +107,15 @@ export const getConfByExcelOrderId = (excelOrderId: string) => {
})
}
/** 根据订单文件获取订单字段配置 */
export
const
listSaleOrdersByExcelId
=
(
excelOrderId
:
string
)
=>
{
return
axios
.
get
(
'/api/excelFileOrder/listSaleOrdersByExcelId'
,
{
params
:
{
excelOrderId
},
headers
:
formHeader
})
}
/** 转换订单记录 */
export
const
convertOrderPage
=
(
params
:
any
)
=>
{
return
axios
.
get
(
'/api/convertOrder/page'
,
{
...
...
src/views/order/orderChange/OrderChange.vue
View file @
f2b9c528
...
...
@@ -93,7 +93,7 @@
<vxe-column
field=
"status_dictText"
title=
"订单状态"
width=
"120"
></vxe-column>
<vxe-column
field=
"createTime"
title=
"创建时间"
width=
"180"
></vxe-column>
<vxe-column
field=
"createBy_dictText"
title=
"创建人"
width=
"180"
></vxe-column>
<vxe-column
field=
"action"
title=
"操作"
width=
"
14
0"
>
<vxe-column
field=
"action"
title=
"操作"
width=
"
28
0"
>
<
template
#
default=
"{ row }"
>
<el-link
style=
"font-size: 12px"
type=
"primary"
@
click=
"toDetail(row)"
>
查看
</el-link>
<el-link
...
...
@@ -115,6 +115,11 @@
<el-link
class=
"ml-1"
style=
"font-size: 12px"
type=
"primary"
@
click=
"exportTmp(row)"
>
导出
</el-link
>
<el-link
class=
"ml-1"
style=
"font-size: 12px"
type=
"primary"
@
click=
"toSaleOrderDetail(row)"
>
转换后
</el-link
>
</
template
>
</vxe-column>
</vxe-table>
...
...
@@ -252,6 +257,33 @@
</
template
>
</vxe-modal>
<vxe-modal
esc-closable
v-model=
"convertVisible"
title=
"解析后的订单"
width=
"80%"
show-footer
>
<vxe-table
border
size=
"mini"
height=
"500"
show-overflow=
"tooltip"
show-header-overflow=
"tooltip"
:data=
"convertData"
>
<vxe-column
width=
"160"
v-for=
"item in convertTableTitle"
:title=
"item"
:key=
"item"
:field=
"item"
/>
</vxe-table>
<
template
#
footer
>
<el-button
@
click=
"convertVisible = false"
>
关闭
</el-button>
</
template
>
</vxe-modal>
<CustomerModal
v-model:visible=
"visible"
@
confirm=
"confirmCustomer"
/>
<UserModal
v-model:visible=
"visibleUserModal"
@
confirm=
"confirmUser"
/>
</template>
...
...
@@ -267,6 +299,7 @@ import {
getExcelFileOrderPage
,
unconvertExcelFileOrder
,
getConfByExcelOrderId
,
listSaleOrdersByExcelId
,
saveConfExcelFileOrderPage
,
excelFileOrderExportExcel
,
excelFileOrderImportExcel
...
...
@@ -300,6 +333,11 @@ const importVisible = ref(false)
const
excelChangeStore
=
useExcelChangeStore
()
const
{
getAllMapConfigs
}
=
storeToRefs
(
excelChangeStore
)
const
{
copyInfo
,
isCopying
,
handleCopy
}
=
useOrderChangeCopy
()
const
convertTableTitle
=
ref
([])
const
convertData
=
ref
([])
/**查询参数 */
const
queryParams
=
reactive
({
status
:
''
,
...
...
@@ -342,6 +380,8 @@ const detailTable = ref<Recordable[]>([])
/**表格title */
const
tableTitle
=
ref
<
string
[]
>
([])
const
convertVisible
=
ref
(
false
)
const
statusOptions
=
ref
([])
const
queryDict
=
async
(
code
:
string
)
=>
{
...
...
@@ -481,10 +521,11 @@ const confirmChange = async (row) => {
const
toDetail
=
async
(
row
:
any
)
=>
{
Object
.
assign
(
currentRow
,
row
)
const
{
res
,
titles
,
configs
}
=
filterRunData
(
row
.
orders
,
true
)
const
{
data
}
=
await
getConfByExcelOrderId
(
row
.
excelOrderId
)
data
.
result
?.
forEach
((
item
:
any
)
=>
{
const
{
res
,
titles
,
configs
}
=
filterRunData
(
data
.
result
.
orders
,
true
)
data
.
result
.
confs
?.
forEach
((
item
:
any
)
=>
{
configs
[
item
.
title
]
=
item
})
// 排除通过循环不显示的column
...
...
@@ -504,6 +545,44 @@ const toDetail = async (row: any) => {
excelChangeStore
.
setAllMapConfigs
(
configs
)
}
const
toSaleOrderDetail
=
async
(
row
:
any
)
=>
{
const
titles
:
string
[]
=
[]
const
{
data
}
=
await
listSaleOrdersByExcelId
(
row
.
excelOrderId
)
let
flatdatas
:
any
=
null
const
record
=
data
.
result
[
0
]
// 获取表头
for
(
const
key
in
record
)
{
if
(
key
==
'productProperties'
)
{
if
(
record
[
key
].
length
)
{
flatdatas
=
{}
record
[
key
].
forEach
((
v
)
=>
{
titles
.
push
(
v
.
productPropertiesTitle
)
flatdatas
[
v
.
productPropertiesTitle
]
=
v
.
productPropertiesValue
})
}
}
else
{
titles
.
push
(
key
)
}
}
convertTableTitle
.
value
=
titles
convertData
.
value
=
data
.
result
?.
map
((
item
)
=>
{
return
{
...
item
,
...
flatdatas
}
})
// 打开弹窗
convertVisible
.
value
=
true
}
/**批量删除行 */
const
removeRows
=
async
()
=>
{
const
list
=
xTable
.
value
?.
getCheckboxRecords
()
...
...
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