feat:发票查看一下数据
This commit is contained in:
1 parent
48b7c4d19a
commit
cd86f299d7
5 files changed
+60
-50
No files matched your search
+2
-2
@@ -12,7 +12,7 @@ ENV = 'development'
|
|||||||
# VITE_ADMIN_PROXY_PATH = http://123.156.230.15:8089/api/ # 测试线上-过期
|
# VITE_ADMIN_PROXY_PATH = http://123.156.230.15:8089/api/ # 测试线上-过期
|
||||||
# VITE_ADMIN_PROXY_PATH = http://pjcloud.center.takin.cc/
|
# VITE_ADMIN_PROXY_PATH = http://pjcloud.center.takin.cc/
|
||||||
# VITE_ADMIN_PROXY_PATH = http://localhost:9999/
|
# VITE_ADMIN_PROXY_PATH = http://localhost:9999/
|
||||||
VITE_ADMIN_PROXY_PATH = http://192.168.101.150:9999/ # 邓-本地
|
VITE_ADMIN_PROXY_PATH = http://192.168.101.159:9999/ # 邓-本地
|
||||||
# VITE_ADMIN_PROXY_PATH = http://59.202.170.152:81/api # 正式环境线上
|
# VITE_ADMIN_PROXY_PATH = http://59.202.170.152:81/api # 正式环境线上
|
||||||
|
|
||||||
# 图片访问基础地址
|
# 图片访问基础地址
|
||||||
@@ -20,7 +20,7 @@ VITE_ADMIN_PROXY_PATH = http://192.168.101.150:9999/ # 邓-本地
|
|||||||
# VITE_IMAGE_BASE_PATH = http://123.156.230.15:8089/api/ # 测试线上-过期
|
# VITE_IMAGE_BASE_PATH = http://123.156.230.15:8089/api/ # 测试线上-过期
|
||||||
# VITE_IMAGE_BASE_PATH = http://pjcloud.center.takin.cc
|
# VITE_IMAGE_BASE_PATH = http://pjcloud.center.takin.cc
|
||||||
# VITE_IMAGE_BASE_PATH = http://localhost:9999
|
# VITE_IMAGE_BASE_PATH = http://localhost:9999
|
||||||
VITE_IMAGE_BASE_PATH = http://192.168.101.150:9999 # 邓-本地
|
VITE_IMAGE_BASE_PATH = http://192.168.101.159:9999 # 邓-本地
|
||||||
# VITE_IMAGE_BASE_PATH = http://59.202.170.152:81/api/ # 正式环境线上
|
# VITE_IMAGE_BASE_PATH = http://59.202.170.152:81/api/ # 正式环境线上
|
||||||
|
|
||||||
# 代码生成服务地址
|
# 代码生成服务地址
|
||||||
|
|||||||
@@ -24,6 +24,14 @@ export function comparePageJoin(obj?: Object) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function compareInvoicePageJoin(obj?: Object) {
|
||||||
|
return request({
|
||||||
|
url: "/wallet/wallet-recharge-apply/compare-invoice-page-join",
|
||||||
|
method: "get",
|
||||||
|
params: obj,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
export function pageJoin(query?: Object) {
|
export function pageJoin(query?: Object) {
|
||||||
return request({
|
return request({
|
||||||
url: "/wallet/wallet-recharge-apply/page-join",
|
url: "/wallet/wallet-recharge-apply/page-join",
|
||||||
|
|||||||
@@ -52,7 +52,9 @@ const { query } = useRoute()
|
|||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
const id = query.id as unknown as any
|
const id = query.id as unknown as any
|
||||||
|
const invoiceId = query.invoiceId as unknown as any
|
||||||
state.queryForm.id = id
|
state.queryForm.id = id
|
||||||
|
state.queryForm.invoiceId = invoiceId
|
||||||
getList()
|
getList()
|
||||||
getDetail()
|
getDetail()
|
||||||
})
|
})
|
||||||
@@ -66,7 +68,7 @@ const state = reactive<any>({
|
|||||||
total: 0,
|
total: 0,
|
||||||
pageSizes: [10, 20, 50, 100, 200, 500],
|
pageSizes: [10, 20, 50, 100, 200, 500],
|
||||||
},
|
},
|
||||||
pageList: walletRechargeApplyApi.comparePageJoin,
|
pageList: walletRechargeApplyApi.compareInvoicePageJoin,
|
||||||
})
|
})
|
||||||
|
|
||||||
const { downBlobFile, tableStyle } = useTable(state)
|
const { downBlobFile, tableStyle } = useTable(state)
|
||||||
@@ -107,13 +109,27 @@ const getList = async () => {
|
|||||||
...state.pagination,
|
...state.pagination,
|
||||||
...state.queryForm,
|
...state.queryForm,
|
||||||
}
|
}
|
||||||
const { data: pageData } = await walletRechargeApplyApi.comparePageJoin(_pa)
|
const { data: pageData } = await walletRechargeApplyApi.compareInvoicePageJoin(_pa)
|
||||||
data.list = pageData.page.records
|
console.log(pageData, "pageData");
|
||||||
data.total = pageData.page.total
|
|
||||||
|
if (pageData.records && pageData.records.length) {
|
||||||
|
pageData.records = pageData.records.map((v: any) => {
|
||||||
|
return {
|
||||||
|
...v,
|
||||||
|
currentImport_price: v.price
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log(pageData.records, "pageData.records");
|
||||||
|
|
||||||
|
|
||||||
|
data.list = pageData.records
|
||||||
|
data.total = pageData.total
|
||||||
data.tableList = pageData.tableList
|
data.tableList = pageData.tableList
|
||||||
console.log(pageData.tableList)
|
|
||||||
data.tableListStr = pageData.tableListStr
|
data.tableListStr = pageData.tableListStr
|
||||||
state.pagination.total = pageData.page.total
|
|
||||||
|
state.pagination.total = pageData.total
|
||||||
} finally {
|
} finally {
|
||||||
state.loading = false
|
state.loading = false
|
||||||
}
|
}
|
||||||
@@ -151,47 +167,8 @@ const getSummaries = (param: SummaryMethodProps) => {
|
|||||||
} else {
|
} else {
|
||||||
sums[index] = "NaN"
|
sums[index] = "NaN"
|
||||||
}
|
}
|
||||||
} else if (column.property === "afterBalance") {
|
|
||||||
const values = data1.map((item) => Number(item[column.property]))
|
|
||||||
if (!values.every((value) => Number.isNaN(value))) {
|
|
||||||
sums[index] = h("span", { style: {} }, [
|
|
||||||
displayPrice(
|
|
||||||
values.reduce((prev, curr) => {
|
|
||||||
const value = Number(curr)
|
|
||||||
if (!Number.isNaN(value)) {
|
|
||||||
return prev + curr
|
|
||||||
} else {
|
|
||||||
return prev
|
|
||||||
}
|
|
||||||
}, 0),
|
|
||||||
),
|
|
||||||
])
|
|
||||||
} else {
|
|
||||||
sums[index] = "NaN"
|
|
||||||
}
|
|
||||||
} else if (column.property === data.tableList[0]) {
|
|
||||||
sums[index] = displayPrice(
|
|
||||||
data.list.reduce((prev: any, curr: any) => {
|
|
||||||
return prev + curr[data.tableList[0] + "_price"]
|
|
||||||
}, 0),
|
|
||||||
)
|
|
||||||
} else if (column.property === data.tableList[1]) {
|
|
||||||
sums[index] = displayPrice(
|
|
||||||
data.list.reduce((prev: any, curr: any) => {
|
|
||||||
return prev + curr[data.tableList[1] + "_price"]
|
|
||||||
}, 0),
|
|
||||||
)
|
|
||||||
} else if (column.property === data.tableList[2]) {
|
|
||||||
sums[index] = displayPrice(
|
|
||||||
data.list.reduce((prev: any, curr: any) => {
|
|
||||||
return prev + curr[data.tableList[2] + "_price"]
|
|
||||||
}, 0),
|
|
||||||
)
|
|
||||||
} else {
|
|
||||||
sums[index] = ""
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
return sums
|
return sums
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
@@ -102,6 +102,10 @@
|
|||||||
<el-table-column label="操作" min-width="260" fixed="right">
|
<el-table-column label="操作" min-width="260" fixed="right">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<div class="flex">
|
<div class="flex">
|
||||||
|
<el-button icon="Document" text type="primary" v-auth="'wallet_walletRechargeApply_view'"
|
||||||
|
@click="doInfo(row)">
|
||||||
|
数据
|
||||||
|
</el-button>
|
||||||
<el-button v-auth="'wallet_walletRechargeApply_print'" icon="printer" text type="primary"
|
<el-button v-auth="'wallet_walletRechargeApply_print'" icon="printer" text type="primary"
|
||||||
:disabled="loading" @click="previewInvoice(row)">
|
:disabled="loading" @click="previewInvoice(row)">
|
||||||
查看发票
|
查看发票
|
||||||
@@ -153,6 +157,8 @@ const PrintDialog = defineAsyncComponent(() => import("./print-dialog.vue"))
|
|||||||
|
|
||||||
const { recharge_invoice_status, check_status } = useDict("recharge_invoice_status", "check_status")
|
const { recharge_invoice_status, check_status } = useDict("recharge_invoice_status", "check_status")
|
||||||
|
|
||||||
|
const { push } = useRouter()
|
||||||
|
|
||||||
// 定义变量内容
|
// 定义变量内容
|
||||||
const formDialogRef = ref()
|
const formDialogRef = ref()
|
||||||
const uploadExcelRef = ref()
|
const uploadExcelRef = ref()
|
||||||
@@ -186,6 +192,15 @@ const resetQuery = () => {
|
|||||||
getDataList()
|
getDataList()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const doInfo = (row: any) => {
|
||||||
|
push({
|
||||||
|
path: "/wallet/wallet-recharge-apply/preview-excel", query: {
|
||||||
|
id: null,
|
||||||
|
invoiceId: row.id
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
// 导出excel
|
// 导出excel
|
||||||
const exportExcel = () => {
|
const exportExcel = () => {
|
||||||
downBlobFile("/wallet/walletRechargeInvoice/export", Object.assign(state.queryForm, { ids: selectObjs }), "walletRechargeInvoice.xlsx")
|
downBlobFile("/wallet/walletRechargeInvoice/export", Object.assign(state.queryForm, { ids: selectObjs }), "walletRechargeInvoice.xlsx")
|
||||||
|
|||||||
@@ -261,13 +261,23 @@ const saveReceipt = async (): Promise<void> => {
|
|||||||
const applyStamp = async () => {
|
const applyStamp = async () => {
|
||||||
await useMessage().delConfirm("是否提交审批")
|
await useMessage().delConfirm("是否提交审批")
|
||||||
if (receiptData.value.processStatus == "1") return useMessage().warning("你已提交过申请,请勿重复提交")
|
if (receiptData.value.processStatus == "1") return useMessage().warning("你已提交过申请,请勿重复提交")
|
||||||
|
|
||||||
loading.value = true
|
loading.value = true
|
||||||
try {
|
try {
|
||||||
|
// 先保存
|
||||||
|
const res = await bindInvoice({
|
||||||
|
...receiptData.value,
|
||||||
|
deptOrUser: receiptData.value.deptOrUser,
|
||||||
|
applyId: receiptData.value.id,
|
||||||
|
})
|
||||||
|
if (res.code != 0) {
|
||||||
|
useMessage().error("保存失败")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
// 申请审批
|
||||||
const blob = await genImage()
|
const blob = await genImage()
|
||||||
if (!blob) return useMessage().success("图片生成失败")
|
if (!blob) return useMessage().error("图片生成失败")
|
||||||
const picUrl = await uploadImage(blob)
|
const picUrl = await uploadImage(blob)
|
||||||
if (!picUrl) return useMessage().success("图片上传失败")
|
if (!picUrl) return useMessage().error("图片上传失败")
|
||||||
|
|
||||||
const { code, msg } = await apply({ id: receiptData.value.id, picUrl })
|
const { code, msg } = await apply({ id: receiptData.value.id, picUrl })
|
||||||
if (code == 0) {
|
if (code == 0) {
|
||||||
|
|||||||
Reference in new issue
Block a user