Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
06722c15
authored
Sep 19, 2025
by
Jony.L
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix算力订单发票预览,删除无用的弹窗
parent
66e4f2ed
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
133 deletions
+20
-133
src/views/apihub/apiorder/OrderViewInvoiceForm.vue
+0
-59
src/views/apihub/apiorder/index.vue
+1
-9
src/views/mall/trade/order/form/OrderViewInvoiceForm.vue
+0
-61
src/views/mall/trade/order/index.vue
+19
-4
No files found.
src/views/apihub/apiorder/OrderViewInvoiceForm.vue
deleted
100644 → 0
View file @
66e4f2ed
<
template
>
<!-- 图片查看弹窗 -->
<el-dialog
v-model=
"dialogVisible"
title=
"查看发票图片"
:width=
"`600px`"
:close-on-click-modal=
"false"
>
<div
class=
"flex justify-center p-4"
>
<img
:src=
"formData.invoiceUrl"
alt=
"发票图片"
class=
"max-w-full max-h-[500px] object-contain"
@
error=
"handleImageError"
/>
</div>
</el-dialog>
</
template
>
<
script
setup
lang=
"ts"
>
const
dialogVisible
=
ref
(
false
)
// 弹窗是否展示
const
formData
=
ref
({
id
:
undefined
,
// 订单编号
invoiceStatus
:
undefined
,
invoiceUrl
:
''
})
const
open
=
async
(
row
)
=>
{
resetForm
()
// 设置数据
formData
.
value
.
id
=
row
.
id
formData
.
value
.
invoiceStatus
=
row
.
invoiceStatus
formData
.
value
.
invoiceUrl
=
row
.
invoiceUrl
dialogVisible
.
value
=
true
}
defineExpose
({
open
})
// 提供 open 方法,用于打开弹窗
/** 重置表单 */
const
resetForm
=
()
=>
{
formData
.
value
=
{
id
:
undefined
,
// 订单编号
invoiceStatus
:
undefined
,
invoiceUrl
:
''
}
}
const
handleImageError
=
(
e
)
=>
{
e
.
target
.
src
=
'https://picsum.photos/600/400?grayscale&blur=2'
;
// 占位图
e
.
target
.
alt
=
'图片加载失败'
;
};
</
script
>
<
style
scoped
lang=
"scss"
>
</
style
>
src/views/apihub/apiorder/index.vue
View file @
06722c15
...
...
@@ -254,7 +254,6 @@ scope.row.invoiceStatus === InvoiceRequestEnum.INVOICING.type"
<!-- 表单弹窗:添加/修改 -->
<ApiOrderForm
ref=
"formRef"
@
success=
"getList"
/>
<OrderIssueInvoiceForm
ref=
"issueInvoiceFormRef"
@
success=
"getList"
/>
<OrderViewInvoiceForm
ref=
"OrderViewInvoiceFormRef"
@
success=
"getList"
/>
</template>
...
...
@@ -265,7 +264,6 @@ import download from '@/utils/download'
import
{
ApiOrder
,
ApiOrderApi
}
from
'@/api/apihub/apiorder'
import
ApiOrderForm
from
'./ApiOrderForm.vue'
import
OrderIssueInvoiceForm
from
"@/views/apihub/apiorder/OrderIssueInvoiceForm.vue"
;
import
OrderViewInvoiceForm
from
"@/views/apihub/apiorder/OrderViewInvoiceForm.vue"
import
{
InvoiceRequestEnum
}
from
"@/utils/constants"
;
/** api订单 列表 */
...
...
@@ -331,17 +329,11 @@ const issueInvoice = (row) => {
issueInvoiceFormRef
.
value
.
open
(
row
);
}
// const OrderViewInvoiceFormRef = ref()
// const viewInvoice = (row) => {
// // OrderViewInvoiceFormRef.value.open(row)
//
// }
const
pdfDialogVisible
=
ref
(
false
)
const
invoiceUrl
=
ref
(
''
)
function
viewInvoice
(
row
)
{
invoiceUrl
.
value
=
import
.
meta
.
env
.
VITE_BASE_URL
+
'/admin-api/infra/file/preview?url='
+
row
.
invoiceUrl
// 从接口带回的 pdf 地址
invoiceUrl
.
value
=
import
.
meta
.
env
.
VITE_BASE_URL
+
'/admin-api/infra/file/preview?url='
+
row
.
invoiceUrl
// 从接口带回的 pdf 地址
pdfDialogVisible
.
value
=
true
}
...
...
src/views/mall/trade/order/form/OrderViewInvoiceForm.vue
deleted
100644 → 0
View file @
66e4f2ed
<
template
>
<!-- 图片查看弹窗 -->
<el-dialog
v-model=
"dialogVisible"
title=
"查看发票图片"
:width=
"`600px`"
:close-on-click-modal=
"false"
>
<div
class=
"flex justify-center p-4"
>
<img
:src=
"formData.invoiceUrl"
alt=
"发票图片"
class=
"max-w-full max-h-[500px] object-contain"
@
error=
"handleImageError"
/>
</div>
</el-dialog>
</
template
>
<
script
setup
lang=
"ts"
>
import
*
as
TradeOrderApi
from
"@/api/mall/trade/order"
;
const
dialogVisible
=
ref
(
false
)
// 弹窗是否展示
const
formData
=
ref
({
id
:
undefined
,
// 订单编号
invoiceStatus
:
undefined
,
invoiceUrl
:
''
})
const
open
=
async
(
row
:
TradeOrderApi
.
OrderVO
)
=>
{
resetForm
()
// 设置数据
formData
.
value
.
id
=
row
.
id
formData
.
value
.
invoiceStatus
=
row
.
invoiceStatus
formData
.
value
.
invoiceUrl
=
row
.
invoiceUrl
dialogVisible
.
value
=
true
}
defineExpose
({
open
})
// 提供 open 方法,用于打开弹窗
/** 重置表单 */
const
resetForm
=
()
=>
{
formData
.
value
=
{
id
:
undefined
,
// 订单编号
invoiceStatus
:
undefined
,
invoiceUrl
:
''
}
}
const
handleImageError
=
(
e
)
=>
{
e
.
target
.
src
=
'https://picsum.photos/600/400?grayscale&blur=2'
;
// 占位图
e
.
target
.
alt
=
'图片加载失败'
;
};
</
script
>
<
style
scoped
lang=
"scss"
>
</
style
>
src/views/mall/trade/order/index.vue
View file @
06722c15
...
...
@@ -236,13 +236,25 @@
:total=
"total"
@
pagination=
"getList"
/>
<!-- 发票预览弹窗 -->
<el-dialog
v-model=
"pdfDialogVisible"
title=
"发票预览"
width=
"80%"
top=
"5vh"
>
<iframe
v-if=
"invoiceUrl"
:src=
"invoiceUrl"
style=
"width: 100%; height: 80vh; border: none;"
></iframe>
</el-dialog>
</ContentWrap>
<!-- 各种操作的弹窗 -->
<OrderDeliveryForm
ref=
"deliveryFormRef"
@
success=
"getList"
/>
<OrderUpdateRemarkForm
ref=
"updateRemarkForm"
@
success=
"getList"
/>
<OrderIssueInvoiceForm
ref=
"issueInvoiceFormRef"
@
success=
"getList"
/>
<OrderViewInvoiceForm
ref=
"viewInvoiceFormRef"
@
success=
"getList"
/>
</template>
<
script
lang=
"ts"
setup
>
...
...
@@ -250,7 +262,6 @@ import type { FormInstance } from 'element-plus'
import
OrderDeliveryForm
from
'@/views/mall/trade/order/form/OrderDeliveryForm.vue'
import
OrderUpdateRemarkForm
from
'@/views/mall/trade/order/form/OrderUpdateRemarkForm.vue'
import
OrderIssueInvoiceForm
from
"@/views/mall/trade/order/form/OrderIssueInvoiceForm.vue"
;
import
OrderViewInvoiceForm
from
"@/views/mall/trade/order/form/OrderViewInvoiceForm.vue"
;
import
*
as
TradeOrderApi
from
'@/api/mall/trade/order'
import
*
as
PickUpStoreApi
from
'@/api/mall/trade/delivery/pickUpStore'
import
{
DICT_TYPE
,
getIntDictOptions
,
getStrDictOptions
}
from
'@/utils/dict'
...
...
@@ -349,7 +360,10 @@ const openDetail = (id: number) => {
const
deliveryFormRef
=
ref
()
const
updateRemarkForm
=
ref
()
const
issueInvoiceFormRef
=
ref
()
const
viewInvoiceFormRef
=
ref
()
const
pdfDialogVisible
=
ref
(
false
)
const
invoiceUrl
=
ref
(
''
)
const
handleCommand
=
(
command
:
string
,
row
:
TradeOrderApi
.
OrderVO
)
=>
{
switch
(
command
)
{
case
'remark'
:
...
...
@@ -362,7 +376,8 @@ const handleCommand = (command: string, row: TradeOrderApi.OrderVO) => {
issueInvoiceFormRef
.
value
?.
open
(
row
)
break
case
'viewInvoice'
:
viewInvoiceFormRef
.
value
?.
open
(
row
)
invoiceUrl
.
value
=
import
.
meta
.
env
.
VITE_BASE_URL
+
'/admin-api/infra/file/preview?url='
+
row
.
invoiceUrl
// 从接口带回的 pdf 地址
pdfDialogVisible
.
value
=
true
break
}
}
...
...
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