提交
This commit is contained in:
1 parent
771f010a39
commit
ee4abd361e
102 files changed
+8021
-4094
No files matched your search
@@ -200,7 +200,7 @@
|
||||
<el-table-column type="index" label="序号" min-width="68" align="center" header-align="center" />
|
||||
<el-table-column prop="projectName" label="险种名称" min-width="160" align="center" header-align="center" />
|
||||
<el-table-column prop="projectFee" label="险种费用(元)" min-width="120" align="center" header-align="center">
|
||||
<template #default="{ row }">{{ row.projectFee != null ? `¥${row.projectFee}` : '—' }}</template>
|
||||
<template #default="{ row }">{{ row.projectFee != null ? '¥' + formatMoneyDisplay(row.projectFee) : '—' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="status" label="状态" min-width="90" align="center" header-align="center">
|
||||
<template #default="{ row }">
|
||||
@@ -245,7 +245,7 @@
|
||||
<el-input v-model="itemForm.projectName" placeholder="请输入险种名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="险种费用(元)" prop="projectFee">
|
||||
<el-input-number v-model="itemForm.projectFee" :min="0" :precision="2" style="width: 100%" />
|
||||
<AmountInput v-model="itemForm.projectFee" :min="0" placeholder="请输入项目费用" />
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-radio-group v-model="itemForm.status">
|
||||
@@ -305,6 +305,8 @@
|
||||
fetchDeleteInsuranceProjectPrice
|
||||
} from '@/api/admin'
|
||||
import { withFullscreenLoading, fullscreenLoadingText } from '@/utils/fullscreen-loading'
|
||||
import AmountInput from '@/components/common/amount-input/index.vue'
|
||||
import { formatMoneyDisplay } from '@/utils/money-format'
|
||||
|
||||
defineOptions({ name: 'BasicInfoInsuranceCompany' })
|
||||
|
||||
|
||||
@@ -297,11 +297,10 @@
|
||||
<el-input v-model="formData.insurancePolicyNo" placeholder="请输入保险单号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="保单费用(元)">
|
||||
<el-input-number
|
||||
<AmountInput
|
||||
v-model="formData.insuranceFee"
|
||||
:precision="2"
|
||||
:min="0"
|
||||
style="width: 100%"
|
||||
placeholder="请输入保单费用"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="保险单生效时间">
|
||||
@@ -415,7 +414,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<span class="upload-hint"
|
||||
>支持图片、视频、PDF、Word、Excel等文件,单文件不超过 20MB</span
|
||||
>支持图片、视频、PDF、Word、Excel等文件</span
|
||||
>
|
||||
</div>
|
||||
</el-form-item>
|
||||
@@ -474,6 +473,7 @@
|
||||
Delete
|
||||
} from '@element-plus/icons-vue'
|
||||
import ProtocolViewDialog from '../protocol/ProtocolViewDialog.vue'
|
||||
import AmountInput from '@/components/common/amount-input/index.vue'
|
||||
import {
|
||||
fetchCollectionProtocolDetail,
|
||||
type CollectionProtocolRow
|
||||
@@ -1062,13 +1062,6 @@
|
||||
const file = uploadFile.raw || uploadFile
|
||||
if (!file) return
|
||||
|
||||
const maxSizeMb = 20
|
||||
if (file.size / 1024 / 1024 > maxSizeMb) {
|
||||
ElMessage.error(`文件大小不能超过 ${maxSizeMb}MB`)
|
||||
attachmentUploadRef.value?.clearFiles()
|
||||
return
|
||||
}
|
||||
|
||||
const tempId = `temp_${Date.now()}_${Math.random().toString(36).slice(2, 8)}`
|
||||
formData.attachments.push({
|
||||
id: tempId,
|
||||
|
||||
@@ -285,16 +285,21 @@
|
||||
import { maskIdCard } from '@/utils/mask-sensitive'
|
||||
import { downloadAttachmentFile } from '@/utils/download-attachment'
|
||||
import {
|
||||
formatPaymentAmount,
|
||||
formatPaymentDueDate,
|
||||
payModeLabel,
|
||||
protocolStatusLabel,
|
||||
protocolStatusTagType,
|
||||
transferTypeLabel
|
||||
} from '@/utils/protocol-payment-labels'
|
||||
import { formatMoneyDisplay } from '@/utils/money-format'
|
||||
|
||||
defineOptions({ name: 'CellStoragePaymentConfirm' })
|
||||
|
||||
function formatPaymentAmount(v: unknown): string {
|
||||
if (v == null || v === '') return '-'
|
||||
return '¥' + formatMoneyDisplay(v)
|
||||
}
|
||||
|
||||
function formatLocalDate(d: Date): string {
|
||||
const y = d.getFullYear()
|
||||
const m = String(d.getMonth() + 1).padStart(2, '0')
|
||||
|
||||
@@ -332,13 +332,11 @@
|
||||
>
|
||||
<div class="form-grid-2">
|
||||
<el-form-item label="退费金额(元)" prop="refundAmount" class="form-col-span-2">
|
||||
<el-input-number
|
||||
<AmountInput
|
||||
v-model="refundForm.refundAmount"
|
||||
:min="0.01"
|
||||
:precision="2"
|
||||
:step="100"
|
||||
controls-position="right"
|
||||
style="width: 100%"
|
||||
placeholder="请输入退费金额"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="退费备注" prop="refundRemark" class="form-col-span-2">
|
||||
@@ -447,6 +445,8 @@
|
||||
import { fetchUploadAttachment } from '@/api/business'
|
||||
import { maskIdCard } from '@/utils/mask-sensitive'
|
||||
import { isPaymentDueWithinWarnWindow } from '@/utils/protocol-payment-labels'
|
||||
import AmountInput from '@/components/common/amount-input/index.vue'
|
||||
import { formatMoneyDisplay } from '@/utils/money-format'
|
||||
import {
|
||||
protocolStatusLabel,
|
||||
protocolStatusTagType,
|
||||
@@ -544,11 +544,9 @@
|
||||
return isPaymentDueWithinWarnWindow(row.installmentDueDate) ? 'row-due-soon' : ''
|
||||
}
|
||||
|
||||
function formatAmount(v: unknown) {
|
||||
function formatAmount(v: unknown): string {
|
||||
if (v == null || v === '') return '-'
|
||||
const n = Number(v)
|
||||
if (Number.isNaN(n)) return String(v)
|
||||
return '¥' + n.toLocaleString('zh-CN', { minimumFractionDigits: 2, maximumFractionDigits: 2 })
|
||||
return '¥' + formatMoneyDisplay(v)
|
||||
}
|
||||
|
||||
async function loadData() {
|
||||
@@ -668,11 +666,6 @@
|
||||
async function handleRefundAttachmentChange(uploadFile: { raw?: File }) {
|
||||
const file = uploadFile.raw
|
||||
if (!file) return
|
||||
const maxSizeMb = 20
|
||||
if (file.size / 1024 / 1024 > maxSizeMb) {
|
||||
ElMessage.error(`文件大小不能超过 ${maxSizeMb}MB`)
|
||||
return
|
||||
}
|
||||
const tempId = `temp_${Date.now()}`
|
||||
refundForm.attachments.push({
|
||||
id: tempId,
|
||||
|
||||
@@ -188,7 +188,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<span class="upload-hint"
|
||||
>支持图片、视频、PDF、Word、Excel等文件,单文件不超过 20MB</span
|
||||
>支持图片、视频、PDF、Word、Excel等文件</span
|
||||
>
|
||||
</div>
|
||||
</el-form-item>
|
||||
@@ -585,12 +585,10 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="价格(元)">
|
||||
<el-input
|
||||
<AmountInput
|
||||
v-model="row.price"
|
||||
type="number"
|
||||
step="any"
|
||||
:min="0"
|
||||
style="width: 100%"
|
||||
placeholder="请输入价格"
|
||||
@change="onSamplePriceChange"
|
||||
/>
|
||||
</el-form-item>
|
||||
@@ -844,7 +842,7 @@
|
||||
class="detail-amount"
|
||||
:class="detail.payStatus === 'yjf' ? 'green' : 'amber'"
|
||||
>
|
||||
¥{{ detail.dueAmount }}
|
||||
{{ fmtMoney(detail.dueAmount) }}
|
||||
</span>
|
||||
<span
|
||||
v-if="detail.payStatus"
|
||||
@@ -896,12 +894,10 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="转账金额(元)">
|
||||
<el-input
|
||||
<AmountInput
|
||||
v-model="detail.transferAmount"
|
||||
type="number"
|
||||
step="any"
|
||||
:min="0"
|
||||
style="width: 100%"
|
||||
placeholder="请输入转账金额"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="转账时间">
|
||||
@@ -1010,7 +1006,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<span class="upload-hint"
|
||||
>支持图片、视频、PDF、Word、Excel等文件,单文件不超过 20MB</span
|
||||
>支持图片、视频、PDF、Word、Excel等文件</span
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1215,6 +1211,8 @@
|
||||
import { fetchEthnicList, type EthnicOption } from '@/api/ethnic'
|
||||
import { useUserStore } from '@/store/modules/user'
|
||||
import { syncFqPaymentDetailRowCount } from '@/utils/protocol-payment-installment'
|
||||
import AmountInput from '@/components/common/amount-input/index.vue'
|
||||
import { formatMoneyDisplay } from '@/utils/money-format'
|
||||
import {
|
||||
payModeLabel,
|
||||
newbornSexLabel,
|
||||
@@ -1225,6 +1223,12 @@
|
||||
payStatusLabel
|
||||
} from '@/utils/status-tag-registry'
|
||||
|
||||
/** 金额只读展示:千分位 + ¥ 前缀 */
|
||||
function fmtMoney(v: unknown): string {
|
||||
if (v == null || v === '') return '—'
|
||||
return '¥' + formatMoneyDisplay(v)
|
||||
}
|
||||
|
||||
const userStore = useUserStore()
|
||||
|
||||
const customerId = ref<string | null>(null)
|
||||
@@ -2738,13 +2742,6 @@
|
||||
const file = uploadFile.raw || uploadFile
|
||||
if (!file) return
|
||||
|
||||
const maxSizeMb = 20
|
||||
if (file.size / 1024 / 1024 > maxSizeMb) {
|
||||
ElMessage.error(`文件大小不能超过 ${maxSizeMb}MB`)
|
||||
attachmentUploadRef.value?.clearFiles()
|
||||
return
|
||||
}
|
||||
|
||||
const tempId = `temp_${Date.now()}_${Math.random().toString(36).slice(2, 8)}`
|
||||
formData.attachments.push({
|
||||
id: tempId,
|
||||
@@ -2789,11 +2786,6 @@
|
||||
const file = uploadFile.raw || uploadFile
|
||||
if (!file) return
|
||||
|
||||
const maxSizeMb = 20
|
||||
if (file.size / 1024 / 1024 > maxSizeMb) {
|
||||
ElMessage.error(`文件大小不能超过 ${maxSizeMb}MB`)
|
||||
return
|
||||
}
|
||||
|
||||
const detail = formData.paymentDetails[detailIndex]
|
||||
if (!detail) return
|
||||
|
||||
@@ -454,7 +454,7 @@
|
||||
<div class="data-item"
|
||||
><div class="data-label">保单费用(元)</div
|
||||
><div class="data-value">{{
|
||||
formatMoney(fullmoonInsuranceInfo?.insuranceFee)
|
||||
fmtMoney(fullmoonInsuranceInfo?.insuranceFee)
|
||||
}}</div></div
|
||||
>
|
||||
<div class="data-item"
|
||||
@@ -722,13 +722,13 @@
|
||||
<div class="payment-metric"
|
||||
><div class="pm-label">合同金额(元)</div
|
||||
><div class="pm-value pm-value--amount">{{
|
||||
payment?.contractAmount ? `¥${payment.contractAmount}` : '—'
|
||||
fmtMoney(payment?.contractAmount)
|
||||
}}</div></div
|
||||
>
|
||||
<div class="payment-metric"
|
||||
><div class="pm-label">已收金额(元)</div
|
||||
><div class="pm-value pm-value--amount pm-value--received">{{
|
||||
receivedAmount ? `¥${receivedAmount}` : '—'
|
||||
fmtMoney(receivedAmount)
|
||||
}}</div></div
|
||||
>
|
||||
<template v-if="payment?.payMode === 'dj'">
|
||||
@@ -775,7 +775,7 @@
|
||||
class="pdc-header-amount"
|
||||
:class="payDetailColorClass(String(detail.payStatus || ''))"
|
||||
>
|
||||
{{ detail.dueAmount ? `¥${detail.dueAmount}` : '—' }}
|
||||
{{ fmtMoney(detail.dueAmount) }}
|
||||
</span>
|
||||
</div>
|
||||
<el-tag :type="payStatusTagType(String(detail.payStatus || ''))" size="small">
|
||||
@@ -788,7 +788,7 @@
|
||||
<div class="pdc-info-item">
|
||||
<span class="info-label">应缴费金额(元)</span>
|
||||
<span class="info-value">{{
|
||||
detail.dueAmount ? `¥${detail.dueAmount}` : '—'
|
||||
fmtMoney(detail.dueAmount)
|
||||
}}</span>
|
||||
</div>
|
||||
<div class="pdc-info-item">
|
||||
@@ -800,7 +800,7 @@
|
||||
<div class="pdc-info-item">
|
||||
<span class="info-label">转账金额(元)</span>
|
||||
<span class="info-value">{{
|
||||
detail.transferAmount ? `¥${detail.transferAmount}` : '—'
|
||||
fmtMoney(detail.transferAmount)
|
||||
}}</span>
|
||||
</div>
|
||||
<div class="pdc-info-item">
|
||||
@@ -951,7 +951,7 @@
|
||||
<span
|
||||
class="flow-detail-card__value"
|
||||
:class="payDetailColorClass(String(detail.payStatus || ''))"
|
||||
>{{ detail.refundAmount ? `¥${detail.refundAmount}` : '—' }}</span
|
||||
>{{ fmtMoney(detail.refundAmount) }}</span
|
||||
>
|
||||
</div>
|
||||
<div
|
||||
@@ -1172,6 +1172,7 @@
|
||||
fetchUserList
|
||||
} from '@/api/admin'
|
||||
import { downloadAttachmentFile } from '@/utils/download-attachment'
|
||||
import { formatMoneyDisplay } from '@/utils/money-format'
|
||||
import {
|
||||
protocolStatusLabel,
|
||||
protocolStatusTagType,
|
||||
@@ -1358,11 +1359,10 @@
|
||||
return val === '1' ? 'success' : 'info'
|
||||
}
|
||||
|
||||
function formatMoney(val: unknown) {
|
||||
if (val === null || val === undefined || val === '') return '—'
|
||||
const n = Number(val)
|
||||
if (Number.isNaN(n)) return String(val)
|
||||
return `¥${n.toLocaleString('zh-CN', { minimumFractionDigits: 2, maximumFractionDigits: 2 })}`
|
||||
/** 金额只读展示:千分位 + ¥ 前缀,null 显示 — */
|
||||
function fmtMoney(v: unknown): string {
|
||||
if (v == null || v === '') return '—'
|
||||
return '¥' + formatMoneyDisplay(v)
|
||||
}
|
||||
|
||||
function storageCertMakeStatusLabel(makeStatus: string) {
|
||||
|
||||
@@ -302,16 +302,21 @@
|
||||
import { maskIdCard } from '@/utils/mask-sensitive'
|
||||
import { downloadAttachmentFile } from '@/utils/download-attachment'
|
||||
import {
|
||||
formatPaymentAmount,
|
||||
formatPaymentDueDate,
|
||||
payModeLabel,
|
||||
protocolStatusLabel,
|
||||
protocolStatusTagType,
|
||||
transferTypeLabel
|
||||
} from '@/utils/protocol-payment-labels'
|
||||
import { formatMoneyDisplay } from '@/utils/money-format'
|
||||
|
||||
defineOptions({ name: 'CellStorageRefundConfirm' })
|
||||
|
||||
function formatPaymentAmount(v: unknown): string {
|
||||
if (v == null || v === '') return '-'
|
||||
return '¥' + formatMoneyDisplay(v)
|
||||
}
|
||||
|
||||
function formatLocalDate(d: Date): string {
|
||||
const y = d.getFullYear()
|
||||
const m = String(d.getMonth() + 1).padStart(2, '0')
|
||||
|
||||
@@ -221,7 +221,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<span class="upload-hint">支持图片、视频、PDF、Word、Excel等文件,单文件不超过 20MB</span>
|
||||
<span class="upload-hint">支持图片、视频、PDF、Word、Excel等文件</span>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<div class="form-grid-2">
|
||||
@@ -504,13 +504,6 @@
|
||||
const file = uploadFile.raw || uploadFile
|
||||
if (!file) return
|
||||
|
||||
const maxSizeMb = 20
|
||||
if (file.size / 1024 / 1024 > maxSizeMb) {
|
||||
ElMessage.error(`文件大小不能超过 ${maxSizeMb}MB`)
|
||||
certAttachmentUploadRef.value?.clearFiles()
|
||||
return
|
||||
}
|
||||
|
||||
const tempId = `temp_${Date.now()}_${Math.random().toString(36).slice(2, 8)}`
|
||||
certAttachments.value.push({
|
||||
id: tempId,
|
||||
|
||||
@@ -74,7 +74,7 @@
|
||||
<el-table-column prop="specText" label="规格" min-width="120" align="center" header-align="center" />
|
||||
<el-table-column prop="unitPrice" label="单价" min-width="100" align="center" header-align="center">
|
||||
<template #default="{ row }">
|
||||
{{ row.unitPrice != null ? `${row.unitPrice} 元` : '-' }}
|
||||
{{ row.unitPrice != null ? `${formatMoneyDisplay(row.unitPrice)} 元` : '-' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="remark" label="备注" min-width="150" align="center" header-align="center" />
|
||||
@@ -164,13 +164,10 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="单价(元)" prop="unitPrice">
|
||||
<el-input-number
|
||||
<AmountInput
|
||||
v-model="formData.unitPrice"
|
||||
:precision="2"
|
||||
:min="0"
|
||||
:controls="false"
|
||||
placeholder="请输入单价"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注">
|
||||
@@ -207,6 +204,8 @@
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import { Plus, Close, Check, View, Edit, Delete, ScaleToOriginal, RefreshLeft, Search } from '@element-plus/icons-vue'
|
||||
import SystemViewDialog from '@/components/business/system-view-dialog/index.vue'
|
||||
import AmountInput from '@/components/common/amount-input/index.vue'
|
||||
import { formatMoneyDisplay } from '@/utils/money-format'
|
||||
import { withFullscreenLoading, fullscreenLoadingText } from '@/utils/fullscreen-loading'
|
||||
import {
|
||||
fetchCellProductPriceList,
|
||||
@@ -279,7 +278,7 @@
|
||||
{ label: '项目编码', value: row.projectCode },
|
||||
{ label: '细胞类型名称', value: row.cellTypeName },
|
||||
{ label: '规格', value: row.specText },
|
||||
{ label: '单价(元)', value: row.unitPrice != null ? row.unitPrice : '-' },
|
||||
{ label: '单价(元)', value: row.unitPrice != null ? `${formatMoneyDisplay(row.unitPrice)} 元` : '-' },
|
||||
{ label: '备注', value: row.remark, span: true }
|
||||
]
|
||||
}
|
||||
|
||||
@@ -19,7 +19,11 @@
|
||||
<div class="filter-block">
|
||||
<el-form :model="searchForm" class="filter-form" label-position="top" @submit.prevent>
|
||||
<p class="filter-hint">
|
||||
{{ activeTab === 'pending' ? '展示待确认的流水记录。' : '展示已确认的流水记录。' }}
|
||||
{{
|
||||
activeTab === 'pending'
|
||||
? '展示待确认的流水记录。'
|
||||
: '展示财务已确认或财务作废的流水记录。'
|
||||
}}
|
||||
</p>
|
||||
<div class="filter-grid">
|
||||
<el-form-item label="渠道名称">
|
||||
@@ -99,21 +103,61 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="channelName" label="渠道名称" min-width="160" show-overflow-tooltip />
|
||||
<el-table-column prop="remark" label="备注" min-width="180" show-overflow-tooltip />
|
||||
<el-table-column prop="remark" label="备注" min-width="160" show-overflow-tooltip />
|
||||
<el-table-column prop="createTime" label="创建时间" min-width="170" align="center" />
|
||||
<el-table-column label="操作" min-width="200" fixed="right" align="center" header-align="center">
|
||||
<template v-if="activeTab === 'done'">
|
||||
<el-table-column label="财务操作" min-width="110" align="center">
|
||||
<template #default="{ row }">
|
||||
<el-tag
|
||||
v-if="row.financeOperateTypeLabel"
|
||||
:type="row.financeOperateType === 'void' ? 'info' : 'success'"
|
||||
size="small"
|
||||
>
|
||||
{{ row.financeOperateTypeLabel }}
|
||||
</el-tag>
|
||||
<span v-else class="text-muted">—</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作人" min-width="120" show-overflow-tooltip>
|
||||
<template #default="{ row }">
|
||||
{{ row.financeOperateByName || '—' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作时间" min-width="170" align="center">
|
||||
<template #default="{ row }">
|
||||
{{ row.financeOperateTime || '—' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</template>
|
||||
<el-table-column label="操作" min-width="300" fixed="right" align="center" header-align="center">
|
||||
<template #default="{ row }">
|
||||
<el-button class="btn-op-item" @click="handleView(row)">
|
||||
<el-icon><View /></el-icon>查看
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="row.txnStatus === 'dqr'"
|
||||
class="btn-op-item primary"
|
||||
type="primary"
|
||||
@click="openConfirmDialog(row)"
|
||||
>
|
||||
确认
|
||||
</el-button>
|
||||
<template v-if="row.txnStatus === 'dqr'">
|
||||
<el-button
|
||||
class="btn-op-item primary"
|
||||
type="primary"
|
||||
@click="openConfirmDialog(row)"
|
||||
>
|
||||
<el-icon><Check /></el-icon>确认
|
||||
</el-button>
|
||||
<el-popconfirm
|
||||
title="确定作废该流水吗?作废后不可恢复,业务需重新发起。"
|
||||
confirm-button-text="确定"
|
||||
cancel-button-text="取消"
|
||||
@confirm="handleVoidTxn(row)"
|
||||
>
|
||||
<template #reference>
|
||||
<el-button
|
||||
class="btn-op-item op-warn"
|
||||
:loading="voidTxnId === row.id"
|
||||
>
|
||||
<el-icon><Delete /></el-icon>作废
|
||||
</el-button>
|
||||
</template>
|
||||
</el-popconfirm>
|
||||
</template>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@@ -215,7 +259,7 @@
|
||||
</el-tag>
|
||||
</div>
|
||||
<div class="view-field-row">
|
||||
<span class="view-field-label">金额:</span>
|
||||
<span class="view-field-label">{{ txnAmountLabel(currentRow.txnType) }}:</span>
|
||||
<span class="amount-text">¥{{ formatAmount(currentRow.amount) }}</span>
|
||||
</div>
|
||||
<div class="view-field-row" v-if="currentRow.financeSubmitByName || currentRow.financeSubmitBy">
|
||||
@@ -226,9 +270,9 @@
|
||||
<span class="view-field-label">提交时间:</span>
|
||||
<span class="view-field-text">{{ currentRow.financeSubmitTime }}</span>
|
||||
</div>
|
||||
<div class="view-field-row" v-if="currentRow.financeSubmitRemark">
|
||||
<div class="view-field-row" v-if="financeSubmitRemarkDisplay(currentRow)">
|
||||
<span class="view-field-label">备注:</span>
|
||||
<span class="view-field-text">{{ currentRow.financeSubmitRemark }}</span>
|
||||
<span class="view-field-text">{{ financeSubmitRemarkDisplay(currentRow) }}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -240,61 +284,124 @@
|
||||
<el-form-item label="财务备注">
|
||||
<el-input v-model="confirmForm.remark" type="textarea" :rows="3" placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
<el-form-item label="确认凭证">
|
||||
<el-form-item label="确认凭证" class="form-col-span-2">
|
||||
<div class="attachment-upload">
|
||||
<div class="upload-cards-row">
|
||||
<div
|
||||
v-for="(file, index) in confirmForm.attachments"
|
||||
:key="file.id"
|
||||
class="upload-card uploaded"
|
||||
>
|
||||
<img
|
||||
v-if="isImageFile(file) && file.fileUrl"
|
||||
:src="fullFileUrl(file.fileUrl)"
|
||||
class="upload-card-preview"
|
||||
@click="handlePreviewAttachment(file)"
|
||||
/>
|
||||
<div v-else class="upload-card-file">
|
||||
<el-icon size="24"><Document /></el-icon>
|
||||
<span class="upload-card-filename">{{ file.fileName }}</span>
|
||||
</div>
|
||||
<div class="upload-card-actions">
|
||||
<el-button size="small" link @click="handlePreviewAttachment(file)">
|
||||
<el-icon><View /></el-icon>
|
||||
</el-button>
|
||||
<el-button size="small" link @click="handleDownloadAttachment(file)">
|
||||
<el-icon><Download /></el-icon>
|
||||
</el-button>
|
||||
<el-button
|
||||
size="small"
|
||||
link
|
||||
type="danger"
|
||||
@click="confirmForm.attachments.splice(index, 1)"
|
||||
>
|
||||
<el-icon><Delete /></el-icon>
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="attachment-list">
|
||||
<el-upload
|
||||
ref="confirmUploadRef"
|
||||
:auto-upload="false"
|
||||
:show-file-list="false"
|
||||
accept="image/*,.pdf,.doc,.docx"
|
||||
:multiple="true"
|
||||
accept="image/*,video/*,.pdf,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.txt,.zip,.rar"
|
||||
@change="handleConfirmAttachmentChange"
|
||||
>
|
||||
<div class="upload-card trigger">
|
||||
<el-icon size="24" color="#10b981"><Plus /></el-icon>
|
||||
<span>上传凭证</span>
|
||||
<div class="upload-card">
|
||||
<el-icon :size="28" color="#10b981"><Plus /></el-icon>
|
||||
<span class="upload-card-text">上传附件</span>
|
||||
</div>
|
||||
</el-upload>
|
||||
<div
|
||||
v-for="(file, index) in confirmForm.attachments"
|
||||
:key="file.id || index"
|
||||
class="attachment-item"
|
||||
:class="{ 'is-uploading': file._uploading }"
|
||||
>
|
||||
<div
|
||||
class="attachment-preview"
|
||||
@click="
|
||||
isImageFile(file) && file.fileUrl ? handlePreviewAttachment(file) : undefined
|
||||
"
|
||||
>
|
||||
<template v-if="isImageFile(file) && file.fileUrl">
|
||||
<img :src="fullFileUrl(file.fileUrl)" :alt="file.fileName" />
|
||||
</template>
|
||||
<template v-else-if="isImageFile(file) && !file.fileUrl">
|
||||
<el-icon :size="24" color="#94a3b8"><Loading /></el-icon>
|
||||
</template>
|
||||
<template v-else-if="isVideoFile(file)">
|
||||
<div class="attachment-preview__icon attachment-preview__icon--video">
|
||||
<el-icon :size="28"><VideoPlay /></el-icon>
|
||||
</div>
|
||||
</template>
|
||||
<template v-else>
|
||||
<div class="attachment-preview__icon attachment-preview__icon--doc">
|
||||
<el-icon :size="28"><Document /></el-icon>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
<div class="attachment-footer">
|
||||
<span class="attachment-name" :title="file.fileName">{{ file.fileName }}</span>
|
||||
<div class="attachment-actions">
|
||||
<el-icon
|
||||
v-if="isImageFile(file) || isVideoFile(file)"
|
||||
class="action-btn"
|
||||
title="预览"
|
||||
@click="handlePreviewAttachment(file)"
|
||||
><View
|
||||
/></el-icon>
|
||||
<el-icon class="action-btn" title="下载" @click="handleDownloadAttachment(file)"
|
||||
><Download
|
||||
/></el-icon>
|
||||
<el-icon
|
||||
class="action-btn action-btn--danger"
|
||||
title="删除"
|
||||
@click="confirmForm.attachments.splice(index, 1)"
|
||||
><Delete
|
||||
/></el-icon>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<span class="upload-hint">支持图片、视频、PDF、Word、Excel等文件</span>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<template #footer>
|
||||
<el-button @click="confirmVisible = false">取消</el-button>
|
||||
<el-button type="primary" :loading="submitLoading" @click="submitConfirm">确认</el-button>
|
||||
<el-button class="btn-ghost" @click="confirmVisible = false">
|
||||
<el-icon><Close /></el-icon>取消
|
||||
</el-button>
|
||||
<el-popconfirm
|
||||
v-if="currentRow?.txnStatus === 'dqr'"
|
||||
title="确定作废该流水吗?作废后不可恢复,业务需重新发起。"
|
||||
confirm-button-text="确定"
|
||||
cancel-button-text="取消"
|
||||
@confirm="handleVoidTxn(currentRow)"
|
||||
>
|
||||
<template #reference>
|
||||
<el-button class="btn-op-item op-warn" :loading="voidTxnId === currentRow?.id">
|
||||
<el-icon><Delete /></el-icon>作废
|
||||
</el-button>
|
||||
</template>
|
||||
</el-popconfirm>
|
||||
<el-button class="btn-main" type="primary" :loading="submitLoading" @click="submitConfirm">
|
||||
<el-icon><Check /></el-icon>确认
|
||||
</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 提交前金额二次确认 -->
|
||||
<el-dialog
|
||||
v-model="amountConfirmVisible"
|
||||
title="确认操作"
|
||||
width="480px"
|
||||
destroy-on-close
|
||||
append-to-body
|
||||
align-center
|
||||
:close-on-click-modal="false"
|
||||
class="finance-amount-confirm-dialog"
|
||||
style="backdrop-filter: none"
|
||||
>
|
||||
<p v-if="currentRow" class="amount-confirm-text">
|
||||
确认该笔操作 ¥{{ formatAmount(currentRow.amount) }}?
|
||||
</p>
|
||||
<template #footer>
|
||||
<el-button class="btn-ghost" @click="amountConfirmVisible = false">
|
||||
<el-icon><Close /></el-icon>取消
|
||||
</el-button>
|
||||
<el-button class="btn-main" type="primary" :loading="submitLoading" @click="executeSubmitConfirm">
|
||||
<el-icon><Check /></el-icon>确认
|
||||
</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
@@ -320,7 +427,7 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive, computed, onMounted } from 'vue'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import {
|
||||
Plus,
|
||||
Search,
|
||||
@@ -328,7 +435,11 @@
|
||||
RefreshLeft,
|
||||
Download,
|
||||
Delete,
|
||||
Document
|
||||
Document,
|
||||
Loading,
|
||||
VideoPlay,
|
||||
Close,
|
||||
Check
|
||||
} from '@element-plus/icons-vue'
|
||||
import SystemViewDialog, {
|
||||
type ViewField,
|
||||
@@ -338,10 +449,12 @@
|
||||
import {
|
||||
fetchServiceOrderTxnList,
|
||||
fetchServiceOrderTxnDetail,
|
||||
fetchConfirmTxn
|
||||
fetchConfirmTxn,
|
||||
fetchVoidTxn
|
||||
} from '@/api/admin'
|
||||
import { fetchUploadAttachment } from '@/api/business'
|
||||
import { downloadAttachmentFile } from '@/utils/download-attachment'
|
||||
import { formatMoneyDisplay } from '@/utils/money-format'
|
||||
import {
|
||||
txnTypeLabel,
|
||||
txnTypeTagType,
|
||||
@@ -356,11 +469,18 @@
|
||||
return val ?? '-'
|
||||
}
|
||||
|
||||
function formatAmount(val: any): string {
|
||||
if (val == null || val === '') return '0.00'
|
||||
const num = Number(val)
|
||||
if (isNaN(num)) return '0.00'
|
||||
return num.toLocaleString('zh-CN', { minimumFractionDigits: 2, maximumFractionDigits: 2 })
|
||||
const formatAmount = (v: any): string => formatMoneyDisplay(v, 2)
|
||||
|
||||
function txnAmountLabel(txnType?: string) {
|
||||
if (txnType === 'recharge') return '充值金额(元)'
|
||||
if (txnType === 'refund') return '退款金额(元)'
|
||||
if (txnType === 'purchase') return '购买金额(元)'
|
||||
if (txnType === 'unsubscribe') return '退订金额(元)'
|
||||
return '金额(元)'
|
||||
}
|
||||
|
||||
function financeSubmitRemarkDisplay(d: Record<string, any>) {
|
||||
return (d.financeSubmitRemark || d.remark || '').trim()
|
||||
}
|
||||
|
||||
const minioBaseUrl = (import.meta.env.VITE_MINIO_BASE_URL || '').replace(/\/$/, '')
|
||||
@@ -396,10 +516,10 @@
|
||||
// 搜索与列表
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
/** Tab 对应的流水状态列表 */
|
||||
/** Tab 对应的流水状态列表(已处理 Tab 走后端 financeDoneOnly) */
|
||||
const TAB_STATUS_MAP: Record<string, string[]> = {
|
||||
pending: ['dqr'],
|
||||
done: ['yqr']
|
||||
done: []
|
||||
}
|
||||
|
||||
function formatLocalDate(d: Date): string {
|
||||
@@ -426,6 +546,7 @@
|
||||
|
||||
const tableData = ref<any[]>([])
|
||||
const loading = ref(false)
|
||||
const voidTxnId = ref('')
|
||||
const pagination = reactive({
|
||||
page: 1,
|
||||
pageSize: 20,
|
||||
@@ -440,7 +561,9 @@
|
||||
pageSize: pagination.pageSize
|
||||
}
|
||||
if (searchForm.txnType) params.txnType = searchForm.txnType
|
||||
if (searchForm.txnStatus.length > 0) {
|
||||
if (activeTab.value === 'done') {
|
||||
params.financeDoneOnly = true
|
||||
} else if (searchForm.txnStatus.length > 0) {
|
||||
params.txnStatus = searchForm.txnStatus.join(',')
|
||||
}
|
||||
if (searchForm.keyword.trim()) params.keyword = searchForm.keyword.trim()
|
||||
@@ -514,8 +637,12 @@
|
||||
}
|
||||
]
|
||||
|
||||
// 余额变动
|
||||
if (d.balanceBefore != null || d.balanceAfter != null) {
|
||||
// 余额变动(待处理不展示;已处理中已作废的充值不展示)
|
||||
const showBalanceSection =
|
||||
activeTab.value !== 'pending' &&
|
||||
!(d.txnStatus === 'yzf' && d.txnType === 'recharge') &&
|
||||
(d.balanceBefore != null || d.balanceAfter != null)
|
||||
if (showBalanceSection) {
|
||||
sections.push({
|
||||
title: '余额变动',
|
||||
fields: [
|
||||
@@ -539,9 +666,10 @@
|
||||
const submitSection: ViewSection = {
|
||||
title: '发起确认',
|
||||
fields: [
|
||||
{ label: txnAmountLabel(d.txnType), value: `¥${formatAmount(d.amount)}` },
|
||||
{ label: '提交人', value: d.financeSubmitByName || d.financeSubmitBy },
|
||||
{ label: '提交时间', value: d.financeSubmitTime },
|
||||
{ label: '备注', value: d.financeSubmitRemark, span: true }
|
||||
{ label: '备注', value: financeSubmitRemarkDisplay(d), span: true }
|
||||
]
|
||||
}
|
||||
if (d.financeSubmitAttachmentFiles?.length) {
|
||||
@@ -552,11 +680,31 @@
|
||||
sections.push(submitSection)
|
||||
}
|
||||
|
||||
// 财务作废信息
|
||||
if (d.txnStatus === 'yzf' && (d.voidTime || d.voidByName)) {
|
||||
sections.push({
|
||||
title: '财务作废',
|
||||
fields: [
|
||||
{
|
||||
label: '作废人',
|
||||
value: d.voidByName || d.voidBy,
|
||||
tagType: 'info'
|
||||
},
|
||||
{ label: '作废时间', value: d.voidTime }
|
||||
]
|
||||
})
|
||||
}
|
||||
|
||||
// 确认信息
|
||||
if (d.financeConfirmTime) {
|
||||
const confirmSection: ViewSection = {
|
||||
title: '确认信息',
|
||||
title: '财务确认',
|
||||
fields: [
|
||||
{
|
||||
label: '确认人',
|
||||
value: d.financeConfirmByName || d.financeConfirmBy,
|
||||
tagType: 'success'
|
||||
},
|
||||
{ label: '确认时间', value: d.financeConfirmTime },
|
||||
{ label: '财务备注', value: d.financeRemark, span: true }
|
||||
]
|
||||
@@ -594,6 +742,7 @@
|
||||
// 统一确认弹窗
|
||||
// ---------------------------------------------------------------------------
|
||||
const confirmVisible = ref(false)
|
||||
const amountConfirmVisible = ref(false)
|
||||
const confirmUploadRef = ref()
|
||||
const confirmForm = reactive({
|
||||
remark: '',
|
||||
@@ -607,22 +756,35 @@
|
||||
confirmVisible.value = true
|
||||
}
|
||||
|
||||
async function submitConfirm() {
|
||||
async function handleVoidTxn(row: any) {
|
||||
voidTxnId.value = row.id
|
||||
try {
|
||||
await fetchVoidTxn(row.id)
|
||||
ElMessage.success('流水已作废')
|
||||
if (currentRow.value?.id === row.id) {
|
||||
confirmVisible.value = false
|
||||
amountConfirmVisible.value = false
|
||||
currentRow.value = null
|
||||
}
|
||||
await loadData()
|
||||
} catch (e: any) {
|
||||
ElMessage.error(e?.message || '作废失败')
|
||||
} finally {
|
||||
voidTxnId.value = ''
|
||||
}
|
||||
}
|
||||
|
||||
function submitConfirm() {
|
||||
if (!currentRow.value) return
|
||||
if (hasUploadingAttachments(confirmForm.attachments)) {
|
||||
ElMessage.warning('附件上传中,请稍候')
|
||||
return
|
||||
}
|
||||
try {
|
||||
await ElMessageBox.confirm(
|
||||
`确认该笔操作 ¥${formatAmount(currentRow.value.amount)}?`,
|
||||
'确认操作',
|
||||
{ confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning' }
|
||||
)
|
||||
} catch {
|
||||
return
|
||||
}
|
||||
amountConfirmVisible.value = true
|
||||
}
|
||||
|
||||
async function executeSubmitConfirm() {
|
||||
if (!currentRow.value) return
|
||||
submitLoading.value = true
|
||||
try {
|
||||
const data: Record<string, any> = {
|
||||
@@ -634,6 +796,7 @@
|
||||
}
|
||||
await fetchConfirmTxn(currentRow.value.id, data)
|
||||
ElMessage.success('确认成功')
|
||||
amountConfirmVisible.value = false
|
||||
confirmVisible.value = false
|
||||
loadData()
|
||||
} catch {
|
||||
@@ -647,12 +810,6 @@
|
||||
const file = uploadFile.raw || uploadFile
|
||||
if (!file) return
|
||||
|
||||
const maxSizeMb = 20
|
||||
if (file.size / 1024 / 1024 > maxSizeMb) {
|
||||
ElMessage.error(`文件大小不能超过 ${maxSizeMb}MB`)
|
||||
return
|
||||
}
|
||||
|
||||
const tempId = `temp_${Date.now()}_${Math.random().toString(36).slice(2, 8)}`
|
||||
confirmForm.attachments.push({
|
||||
id: tempId,
|
||||
@@ -746,6 +903,13 @@
|
||||
}
|
||||
}
|
||||
|
||||
.amount-confirm-text {
|
||||
margin: 0;
|
||||
font-size: 14px;
|
||||
line-height: 1.5;
|
||||
color: var(--mint-text, #334155);
|
||||
}
|
||||
|
||||
.form-section-divider {
|
||||
height: 1px;
|
||||
margin: 20px 0;
|
||||
@@ -800,236 +964,180 @@
|
||||
min-width: 80px;
|
||||
}
|
||||
|
||||
/* 附件上传卡片化布局 */
|
||||
|
||||
.attachment-upload {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.upload-cards-row {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.upload-card {
|
||||
width: 140px;
|
||||
height: 96px;
|
||||
border: 1px dashed #a7f3d0;
|
||||
border-radius: 8px;
|
||||
background: #f0fdf4;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 6px;
|
||||
cursor: pointer;
|
||||
transition:
|
||||
border-color 0.15s,
|
||||
background 0.15s;
|
||||
|
||||
&:hover {
|
||||
border-color: #10b981;
|
||||
border-style: solid;
|
||||
background: #ecfdf5;
|
||||
/* 附件上传卡片化布局(对齐 ProtocolFormDialog / OpenSpec) */
|
||||
.attachment-upload {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
&.uploaded {
|
||||
border-style: solid;
|
||||
border-color: #e2e8f0;
|
||||
.attachment-list {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.upload-card {
|
||||
width: 140px;
|
||||
height: 96px;
|
||||
border: 1px dashed #a7f3d0;
|
||||
border-radius: 8px;
|
||||
background: #f0fdf4;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 6px;
|
||||
cursor: pointer;
|
||||
transition:
|
||||
border-color 0.15s,
|
||||
background 0.15s;
|
||||
|
||||
&:hover {
|
||||
border-color: #10b981;
|
||||
border-style: solid;
|
||||
background: #ecfdf5;
|
||||
}
|
||||
}
|
||||
|
||||
.upload-card-text {
|
||||
font-size: 12px;
|
||||
color: #10b981;
|
||||
font-weight: 500;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.upload-hint {
|
||||
display: block;
|
||||
font-size: 11px;
|
||||
color: #94a3b8;
|
||||
line-height: 1;
|
||||
margin-top: 8px;
|
||||
}
|
||||
|
||||
.attachment-item {
|
||||
width: 140px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
border: 1px solid #e2e8f0;
|
||||
border-radius: 8px;
|
||||
background: #fff;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
transition:
|
||||
border-color 0.15s,
|
||||
box-shadow 0.15s;
|
||||
|
||||
&:hover {
|
||||
border-color: #10b981;
|
||||
box-shadow: 0 2px 8px rgba(16, 185, 129, 0.1);
|
||||
}
|
||||
}
|
||||
|
||||
&.trigger {
|
||||
span {
|
||||
font-size: 12px;
|
||||
color: #10b981;
|
||||
font-weight: 500;
|
||||
line-height: 1;
|
||||
&.is-uploading {
|
||||
opacity: 0.6;
|
||||
pointer-events: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.upload-card-preview {
|
||||
width: 100%;
|
||||
height: 60px;
|
||||
object-fit: cover;
|
||||
border-radius: 6px 6px 0 0;
|
||||
}
|
||||
|
||||
.upload-card-file {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 60px;
|
||||
gap: 4px;
|
||||
color: #64748b;
|
||||
}
|
||||
|
||||
.upload-card-filename {
|
||||
font-size: 11px;
|
||||
color: #334155;
|
||||
max-width: 120px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.upload-card-actions {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
gap: 4px;
|
||||
height: 28px;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.upload-card-text {
|
||||
font-size: 12px;
|
||||
color: #10b981;
|
||||
font-weight: 500;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.upload-hint {
|
||||
display: block;
|
||||
font-size: 11px;
|
||||
color: #94a3b8;
|
||||
line-height: 1;
|
||||
margin-top: 8px;
|
||||
}
|
||||
|
||||
.attachment-list {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.attachment-item {
|
||||
width: 140px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
border: 1px solid #e2e8f0;
|
||||
border-radius: 8px;
|
||||
background: #fff;
|
||||
overflow: hidden;
|
||||
transition:
|
||||
border-color 0.15s,
|
||||
box-shadow 0.15s;
|
||||
|
||||
&:hover {
|
||||
border-color: #10b981;
|
||||
box-shadow: 0 2px 8px rgba(16, 185, 129, 0.1);
|
||||
}
|
||||
|
||||
&.is-uploading {
|
||||
opacity: 0.6;
|
||||
pointer-events: none;
|
||||
}
|
||||
}
|
||||
|
||||
.attachment-preview {
|
||||
width: 100%;
|
||||
height: 96px;
|
||||
flex-shrink: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: #f8fafc;
|
||||
overflow: hidden;
|
||||
cursor: pointer;
|
||||
|
||||
img {
|
||||
.attachment-preview {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
height: 96px;
|
||||
flex-shrink: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: #f8fafc;
|
||||
overflow: hidden;
|
||||
cursor: pointer;
|
||||
|
||||
.attachment-preview__icon {
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
border-radius: 10px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
&--video {
|
||||
background: #ede9fe;
|
||||
color: #7c3aed;
|
||||
img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
|
||||
&--doc {
|
||||
background: #e0f2fe;
|
||||
color: #0284c7;
|
||||
}
|
||||
}
|
||||
.attachment-preview__icon {
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
border-radius: 10px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
.attachment-footer {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
flex: 1;
|
||||
padding: 6px 8px;
|
||||
}
|
||||
&--video {
|
||||
background: #ede9fe;
|
||||
color: #7c3aed;
|
||||
}
|
||||
|
||||
.attachment-name {
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 2;
|
||||
-webkit-box-orient: vertical;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
font-size: 11px;
|
||||
color: #334155;
|
||||
line-height: 1.4;
|
||||
word-break: break-all;
|
||||
min-height: calc(11px * 1.4 * 2);
|
||||
}
|
||||
|
||||
.attachment-actions {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
margin-top: 4px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.action-btn {
|
||||
width: 22px;
|
||||
height: 22px;
|
||||
border-radius: 4px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 12px;
|
||||
color: #64748b;
|
||||
cursor: pointer;
|
||||
background: #f1f5f9;
|
||||
transition:
|
||||
background 0.15s,
|
||||
color 0.15s;
|
||||
|
||||
&:hover {
|
||||
background: #10b981;
|
||||
color: #fff;
|
||||
&--doc {
|
||||
background: #e0f2fe;
|
||||
color: #0284c7;
|
||||
}
|
||||
}
|
||||
|
||||
&--danger:hover {
|
||||
background: #ef4444;
|
||||
color: #fff;
|
||||
.attachment-footer {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
flex: 1;
|
||||
padding: 6px 8px;
|
||||
}
|
||||
}
|
||||
|
||||
.preview-container {
|
||||
text-align: center;
|
||||
}
|
||||
.attachment-name {
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 2;
|
||||
line-clamp: 2;
|
||||
-webkit-box-orient: vertical;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
font-size: 11px;
|
||||
color: #334155;
|
||||
line-height: 1.4;
|
||||
word-break: break-all;
|
||||
min-height: calc(11px * 1.4 * 2);
|
||||
}
|
||||
|
||||
.attachment-actions {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
margin-top: 4px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.action-btn {
|
||||
width: 22px;
|
||||
height: 22px;
|
||||
border-radius: 4px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 12px;
|
||||
color: #64748b;
|
||||
cursor: pointer;
|
||||
background: #f1f5f9;
|
||||
transition:
|
||||
background 0.15s,
|
||||
color 0.15s;
|
||||
|
||||
&:hover {
|
||||
background: #10b981;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
&--danger:hover {
|
||||
background: #ef4444;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
|
||||
.preview-container {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.text-muted {
|
||||
color: var(--mint-text-muted, #94a3b8);
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
/* 查看详情键值对 */
|
||||
.view-section {
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,94 @@
|
||||
<!-- 渠道服务订单 — 操作流水标准表格(查看弹窗等只读场景) -->
|
||||
<template>
|
||||
<div class="list-body list-wrap service-order-txn-table-wrap">
|
||||
<el-table
|
||||
v-if="rows.length"
|
||||
:data="rows"
|
||||
stripe
|
||||
class="list-table inner-table"
|
||||
:max-height="maxHeight"
|
||||
>
|
||||
<el-table-column type="index" label="序号" min-width="68" align="center" header-align="center" />
|
||||
<el-table-column label="类型" min-width="120" align="center" header-align="center">
|
||||
<template #default="{ row }">
|
||||
<el-tag :type="txnTypeTagType(row.txnType)" size="small">
|
||||
{{ txnTypeLabel(row.txnType) }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="金额(元)" min-width="130" align="right" header-align="center">
|
||||
<template #default="{ row }">
|
||||
<span class="amount-text">¥{{ formatAmount(row.amount) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" min-width="120" align="center" header-align="center">
|
||||
<template #default="{ row }">
|
||||
<el-tag :type="txnStatusTagType(row.txnStatus)" size="small">
|
||||
{{ txnStatusLabel(row.txnStatus) }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="remark" label="备注" min-width="160" show-overflow-tooltip />
|
||||
<el-table-column prop="createTime" label="创建时间" min-width="170" align="center" header-align="center" />
|
||||
<el-table-column label="作废信息" min-width="200" show-overflow-tooltip>
|
||||
<template #default="{ row }">
|
||||
<span v-if="row.txnStatus === 'yzf'" class="void-info">
|
||||
{{ row.voidByName || '—' }} · {{ row.voidTime || '—' }}
|
||||
</span>
|
||||
<span v-else class="void-info muted">—</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-empty v-else description="暂无操作流水" :image-size="48" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import {
|
||||
txnTypeLabel,
|
||||
txnTypeTagType,
|
||||
txnStatusLabel,
|
||||
txnStatusTagType
|
||||
} from '@/utils/status-tag-registry'
|
||||
import { formatMoneyDisplay } from '@/utils/money-format'
|
||||
|
||||
defineOptions({ name: 'ServiceOrderTxnTable' })
|
||||
|
||||
withDefaults(
|
||||
defineProps<{
|
||||
rows: Record<string, any>[]
|
||||
maxHeight?: number | string
|
||||
}>(),
|
||||
{
|
||||
rows: () => [],
|
||||
maxHeight: 360
|
||||
}
|
||||
)
|
||||
|
||||
const formatAmount = (v: unknown): string => {
|
||||
if (v == null || v === '') return '0.00'
|
||||
return formatMoneyDisplay(v)
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.service-order-txn-table-wrap {
|
||||
margin-top: 0;
|
||||
padding: 0;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.amount-text {
|
||||
font-weight: 600;
|
||||
color: var(--mint-primary, #10b981);
|
||||
}
|
||||
|
||||
.void-info {
|
||||
font-size: 13px;
|
||||
color: var(--mint-text-muted, #64748b);
|
||||
|
||||
&.muted {
|
||||
color: #cbd5e1;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -139,15 +139,24 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="createTime" label="创建时间" min-width="170" align="center" />
|
||||
<el-table-column label="操作" min-width="440" fixed="right" align="center" header-align="center">
|
||||
<el-table-column label="操作" min-width="520" fixed="right" align="center" header-align="center">
|
||||
<template #default="{ row }">
|
||||
<el-button class="btn-op-item primary" @click="handleView(row)">查看</el-button>
|
||||
<el-button class="btn-op-item primary" @click="handleView(row)">
|
||||
<el-icon><View /></el-icon>查看
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="row.orderType === 'yfk' || row.orderType === 'gmcp'"
|
||||
class="btn-op-item"
|
||||
@click="openTxnDialog(row)"
|
||||
>
|
||||
<el-icon><List /></el-icon>操作流水
|
||||
</el-button>
|
||||
<el-button
|
||||
class="btn-op-item"
|
||||
v-if="(row.orderType === 'yfk' || row.orderType === 'gmcp') && row.orderStatus === 'dsx'"
|
||||
@click="handleEdit(row)"
|
||||
>
|
||||
编辑
|
||||
<el-icon><Edit /></el-icon>编辑
|
||||
</el-button>
|
||||
<el-popconfirm
|
||||
v-if="(row.orderType === 'yfk' || row.orderType === 'gmcp') && row.orderStatus === 'dsx'"
|
||||
@@ -157,7 +166,9 @@
|
||||
@confirm="handleDelete(row)"
|
||||
>
|
||||
<template #reference>
|
||||
<el-button class="btn-op-item op-warn">删除</el-button>
|
||||
<el-button class="btn-op-item op-warn">
|
||||
<el-icon><Delete /></el-icon>删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-popconfirm>
|
||||
<!-- yfk 充值型:发起充值 -->
|
||||
@@ -167,7 +178,7 @@
|
||||
type="primary"
|
||||
@click="openRechargeDialog(row)"
|
||||
>
|
||||
发起充值
|
||||
<el-icon><Wallet /></el-icon>发起充值
|
||||
</el-button>
|
||||
<!-- yfk 充值型:申请退款 -->
|
||||
<el-button
|
||||
@@ -175,7 +186,7 @@
|
||||
class="btn-op-item"
|
||||
@click="openRefundDialog(row)"
|
||||
>
|
||||
申请退款
|
||||
<el-icon><Sell /></el-icon>申请退款
|
||||
</el-button>
|
||||
<!-- gmcp 购买型:购买产品 -->
|
||||
<el-button
|
||||
@@ -184,7 +195,7 @@
|
||||
type="primary"
|
||||
@click="openPurchaseDialog(row)"
|
||||
>
|
||||
购买产品
|
||||
<el-icon><ShoppingCart /></el-icon>购买产品
|
||||
</el-button>
|
||||
<!-- gmcp 购买型:退订产品 -->
|
||||
<el-button
|
||||
@@ -192,7 +203,7 @@
|
||||
class="btn-op-item"
|
||||
@click="openUnsubscribeDialog(row)"
|
||||
>
|
||||
退订产品
|
||||
<el-icon><Remove /></el-icon>退订产品
|
||||
</el-button>
|
||||
<!-- 作废 -->
|
||||
<el-button
|
||||
@@ -201,7 +212,7 @@
|
||||
type="danger"
|
||||
@click="handleVoid(row)"
|
||||
>
|
||||
作废
|
||||
<el-icon><Delete /></el-icon>作废
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@@ -235,58 +246,46 @@
|
||||
>
|
||||
<!-- Product holdings for gmcp -->
|
||||
<template v-if="viewData.orderType === 'gmcp'" #order-products>
|
||||
<el-table
|
||||
v-if="viewData.products?.length"
|
||||
:data="viewData.products"
|
||||
stripe
|
||||
class="list-table inner-table"
|
||||
size="small"
|
||||
>
|
||||
<el-table-column type="index" label="序号" min-width="60" align="center" />
|
||||
<el-table-column prop="projectName" label="项目名称" min-width="150" show-overflow-tooltip />
|
||||
<el-table-column prop="cellType" label="细胞类型" min-width="120" show-overflow-tooltip />
|
||||
<el-table-column prop="specText" label="规格文本" min-width="150" show-overflow-tooltip />
|
||||
<el-table-column label="协议单价(元)" min-width="120" align="right">
|
||||
<template #default="{ row }">¥{{ formatAmount(row.agreementUnitPrice) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="currentQty" label="当前持有" min-width="100" align="center" />
|
||||
<el-table-column prop="totalBuyQty" label="累计购买" min-width="100" align="center" />
|
||||
<el-table-column prop="totalUnsubscribeQty" label="累计退订" min-width="100" align="center" />
|
||||
</el-table>
|
||||
<el-empty v-else description="暂无产品持仓" :image-size="48" />
|
||||
<div class="list-body list-wrap view-inner-table-wrap">
|
||||
<el-table
|
||||
v-if="viewData.products?.length"
|
||||
:data="viewData.products"
|
||||
stripe
|
||||
class="list-table inner-table"
|
||||
max-height="360"
|
||||
>
|
||||
<el-table-column type="index" label="序号" min-width="68" align="center" header-align="center" />
|
||||
<el-table-column prop="projectName" label="项目名称" min-width="150" show-overflow-tooltip />
|
||||
<el-table-column prop="cellType" label="细胞类型" min-width="120" show-overflow-tooltip />
|
||||
<el-table-column prop="specText" label="规格文本" min-width="150" show-overflow-tooltip />
|
||||
<el-table-column label="协议单价(元)" min-width="130" align="right" header-align="center">
|
||||
<template #default="{ row }">¥{{ formatAmount(row.agreementUnitPrice) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="currentQty" label="当前持有" min-width="100" align="center" header-align="center" />
|
||||
<el-table-column prop="totalBuyQty" label="累计购买" min-width="100" align="center" header-align="center" />
|
||||
<el-table-column
|
||||
prop="totalUnsubscribeQty"
|
||||
label="累计退订"
|
||||
min-width="100"
|
||||
align="center"
|
||||
header-align="center"
|
||||
/>
|
||||
</el-table>
|
||||
<el-empty v-else description="暂无产品持仓" :image-size="48" />
|
||||
</div>
|
||||
</template>
|
||||
<!-- Transaction timeline -->
|
||||
<template v-if="viewData.transactions?.length" #txn-timeline>
|
||||
<el-table
|
||||
:data="viewData.transactions"
|
||||
stripe
|
||||
class="list-table inner-table"
|
||||
size="small"
|
||||
>
|
||||
<el-table-column type="index" label="序号" min-width="60" align="center" />
|
||||
<el-table-column label="类型" min-width="100" align="center">
|
||||
<template #default="{ row }">
|
||||
<el-tag :type="txnTypeTagType(row.txnType)" size="small">
|
||||
{{ txnTypeLabel(row.txnType) }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="金额(元)" min-width="120" align="right">
|
||||
<template #default="{ row }">¥{{ formatAmount(row.amount) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" min-width="100" align="center">
|
||||
<template #default="{ row }">
|
||||
<el-tag :type="txnStatusTagType(row.txnStatus)" size="small">
|
||||
{{ txnStatusLabel(row.txnStatus) }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="remark" label="备注" min-width="150" show-overflow-tooltip />
|
||||
<el-table-column prop="createTime" label="创建时间" min-width="170" align="center" />
|
||||
</el-table>
|
||||
<template #txn-timeline>
|
||||
<ServiceOrderTxnTable :rows="viewData.transactions || []" />
|
||||
</template>
|
||||
</SystemViewDialog>
|
||||
|
||||
<ServiceOrderTxnDialog
|
||||
ref="txnDialogRef"
|
||||
v-model:visible="txnDialogVisible"
|
||||
:order="txnDialogOrder"
|
||||
@refreshed="onTxnDialogRefreshed"
|
||||
/>
|
||||
|
||||
<!-- ═══════════════════════════════════════════════════════════════════ -->
|
||||
<!-- 新增/编辑弹窗 -->
|
||||
<!-- ═══════════════════════════════════════════════════════════════════ -->
|
||||
@@ -338,17 +337,6 @@
|
||||
<el-form-item label="部门名称" prop="deptName">
|
||||
<el-input v-model="formData.deptName" placeholder="请输入部门名称" />
|
||||
</el-form-item>
|
||||
<!-- 预付款充值 - 充值金额 -->
|
||||
<el-form-item v-if="formData.orderType === 'yfk'" label="充值金额(元)" prop="prepayAmount">
|
||||
<el-input-number
|
||||
v-model="formData.prepayAmount"
|
||||
:min="0.01"
|
||||
:precision="2"
|
||||
:step="100"
|
||||
controls-position="right"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- 渠道协议(预付款充值 / 购买产品均必填,后续按协议价指导中试服务单) -->
|
||||
<el-form-item label="渠道协议" prop="channelAgreementId">
|
||||
<el-select
|
||||
@@ -415,13 +403,10 @@
|
||||
</el-table-column>
|
||||
<el-table-column label="单价(元)" min-width="120" align="right">
|
||||
<template #default="{ row }">
|
||||
<el-input-number
|
||||
<AmountInput
|
||||
v-model="row.unitPrice"
|
||||
class="product-detail-cell-control"
|
||||
:min="0"
|
||||
:precision="2"
|
||||
:step="1"
|
||||
controls-position="right"
|
||||
class="product-detail-cell-control"
|
||||
@change="calcItemAmount(row)"
|
||||
/>
|
||||
</template>
|
||||
@@ -445,7 +430,9 @@
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" min-width="70" align="center">
|
||||
<template #default="{ $index }">
|
||||
<el-button link type="danger" @click="removeFormItem($index)">删除</el-button>
|
||||
<el-button link type="danger" @click="removeFormItem($index)">
|
||||
<el-icon><Delete /></el-icon>删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@@ -491,18 +478,93 @@
|
||||
</el-dialog>
|
||||
|
||||
<!-- 发起充值弹窗 -->
|
||||
<el-dialog v-model="rechargeVisible" title="发起充值" width="480px" destroy-on-close :close-on-click-modal="false">
|
||||
<el-dialog v-model="rechargeVisible" title="发起充值" width="560px" destroy-on-close :close-on-click-modal="false">
|
||||
<el-form label-position="top">
|
||||
<el-form-item label="充值金额(元)">
|
||||
<el-input-number v-model="rechargeForm.amount" :min="0.01" :precision="2" :step="100" controls-position="right" style="width: 100%" />
|
||||
<AmountInput
|
||||
v-model="rechargeForm.amount"
|
||||
:min="0.01"
|
||||
placeholder="请输入充值金额"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注">
|
||||
<el-input v-model="rechargeForm.remark" type="textarea" :rows="3" placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
<el-form-item label="附件">
|
||||
<div class="attachment-upload">
|
||||
<div class="attachment-list">
|
||||
<el-upload
|
||||
ref="rechargeUploadRef"
|
||||
:auto-upload="false"
|
||||
:show-file-list="false"
|
||||
:multiple="true"
|
||||
accept="image/*,video/*,.pdf,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.txt,.zip,.rar"
|
||||
@change="handleRechargeAttachmentChange"
|
||||
>
|
||||
<div class="upload-card">
|
||||
<el-icon :size="28" color="#10b981"><Plus /></el-icon>
|
||||
<span class="upload-card-text">上传附件</span>
|
||||
</div>
|
||||
</el-upload>
|
||||
<div
|
||||
v-for="(file, index) in rechargeForm.attachments"
|
||||
:key="file.id || index"
|
||||
class="attachment-item"
|
||||
:class="{ 'is-uploading': file._uploading }"
|
||||
>
|
||||
<div
|
||||
class="attachment-preview"
|
||||
@click="
|
||||
isImageFile(file) && file.fileUrl ? handlePreviewAttachment(file) : undefined
|
||||
"
|
||||
>
|
||||
<template v-if="isImageFile(file) && file.fileUrl">
|
||||
<img :src="fullFileUrl(file.fileUrl)" :alt="file.fileName" />
|
||||
</template>
|
||||
<template v-else-if="isImageFile(file) && !file.fileUrl">
|
||||
<el-icon :size="24" color="#94a3b8"><Loading /></el-icon>
|
||||
</template>
|
||||
<template v-else-if="isVideoFile(file)">
|
||||
<div class="attachment-preview__icon attachment-preview__icon--video">
|
||||
<el-icon :size="28"><VideoPlay /></el-icon>
|
||||
</div>
|
||||
</template>
|
||||
<template v-else>
|
||||
<div class="attachment-preview__icon attachment-preview__icon--doc">
|
||||
<el-icon :size="28"><Document /></el-icon>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
<div class="attachment-footer">
|
||||
<span class="attachment-name" :title="file.fileName">{{ file.fileName }}</span>
|
||||
<div class="attachment-actions">
|
||||
<el-icon class="action-btn" title="预览" @click="handlePreviewAttachment(file)"
|
||||
><View
|
||||
/></el-icon>
|
||||
<el-icon class="action-btn" title="下载" @click="handleDownloadAttachment(file)"
|
||||
><Download
|
||||
/></el-icon>
|
||||
<el-icon
|
||||
class="action-btn action-btn--danger"
|
||||
title="删除"
|
||||
@click="removeRechargeAttachment(index)"
|
||||
><Delete
|
||||
/></el-icon>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<span class="upload-hint">支持图片、视频、PDF、Word、Excel 等,可上传多个</span>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-button @click="rechargeVisible = false">取消</el-button>
|
||||
<el-button type="primary" :loading="rechargeLoading" @click="submitRecharge">确认</el-button>
|
||||
<el-button class="btn-ghost" @click="rechargeVisible = false">
|
||||
<el-icon><Close /></el-icon>取消
|
||||
</el-button>
|
||||
<el-button class="btn-main" type="primary" :loading="rechargeLoading" @click="submitRecharge">
|
||||
<el-icon><Check /></el-icon>确认
|
||||
</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
@@ -511,15 +573,24 @@
|
||||
<el-form label-position="top">
|
||||
<el-form-item>
|
||||
<template #label>退款金额(元)<span class="form-label-tip">当前余额:¥{{ formatAmount(currentOrderForTxn?.currentBalance) }}</span></template>
|
||||
<el-input-number v-model="refundTxnForm.amount" :min="0.01" :max="Number(currentOrderForTxn?.currentBalance || 0)" :precision="2" :step="100" controls-position="right" style="width: 100%" />
|
||||
<AmountInput
|
||||
v-model="refundTxnForm.amount"
|
||||
:min="0.01"
|
||||
:max="Number(currentOrderForTxn?.currentBalance || 0)"
|
||||
placeholder="请输入退款金额"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注">
|
||||
<el-input v-model="refundTxnForm.remark" type="textarea" :rows="3" placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-button @click="refundTxnVisible = false">取消</el-button>
|
||||
<el-button type="primary" :loading="refundTxnLoading" @click="submitRefundTxn">确认</el-button>
|
||||
<el-button class="btn-ghost" @click="refundTxnVisible = false">
|
||||
<el-icon><Close /></el-icon>取消
|
||||
</el-button>
|
||||
<el-button class="btn-main" type="primary" :loading="refundTxnLoading" @click="submitRefundTxn">
|
||||
<el-icon><Check /></el-icon>确认
|
||||
</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
@@ -549,7 +620,9 @@
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" min-width="60" align="center">
|
||||
<template #default="{ $index }">
|
||||
<el-button type="danger" link size="small" @click="removePurchaseItem($index)">删除</el-button>
|
||||
<el-button type="danger" link size="small" @click="removePurchaseItem($index)">
|
||||
<el-icon><Delete /></el-icon>删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@@ -563,8 +636,12 @@
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-button @click="purchaseVisible = false">取消</el-button>
|
||||
<el-button type="primary" :loading="purchaseLoading" @click="submitPurchase">确认</el-button>
|
||||
<el-button class="btn-ghost" @click="purchaseVisible = false">
|
||||
<el-icon><Close /></el-icon>取消
|
||||
</el-button>
|
||||
<el-button class="btn-main" type="primary" :loading="purchaseLoading" @click="submitPurchase">
|
||||
<el-icon><Check /></el-icon>确认
|
||||
</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
@@ -597,8 +674,12 @@
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-button @click="unsubscribeVisible = false">取消</el-button>
|
||||
<el-button type="primary" :loading="unsubscribeLoading" @click="submitUnsubscribe">确认退订</el-button>
|
||||
<el-button class="btn-ghost" @click="unsubscribeVisible = false">
|
||||
<el-icon><Close /></el-icon>取消
|
||||
</el-button>
|
||||
<el-button class="btn-main" type="primary" :loading="unsubscribeLoading" @click="submitUnsubscribe">
|
||||
<el-icon><Check /></el-icon>确认退订
|
||||
</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
@@ -641,9 +722,18 @@ import {
|
||||
Loading,
|
||||
Download,
|
||||
Delete,
|
||||
VideoPlay
|
||||
VideoPlay,
|
||||
View,
|
||||
List,
|
||||
Edit,
|
||||
Wallet,
|
||||
Sell,
|
||||
ShoppingCart,
|
||||
Remove
|
||||
} from '@element-plus/icons-vue'
|
||||
import SystemViewDialog, { type ViewSection } from '@/components/business/system-view-dialog/index.vue'
|
||||
import ServiceOrderTxnTable from './ServiceOrderTxnTable.vue'
|
||||
import ServiceOrderTxnDialog from './ServiceOrderTxnDialog.vue'
|
||||
import {
|
||||
fetchChannelServiceOrderList,
|
||||
fetchChannelServiceOrderDetail,
|
||||
@@ -662,27 +752,20 @@ import {
|
||||
} from '@/api/admin'
|
||||
import { fetchUploadAttachment } from '@/api/business'
|
||||
import { downloadAttachmentFile } from '@/utils/download-attachment'
|
||||
import AmountInput from '@/components/common/amount-input/index.vue'
|
||||
import { formatMoneyDisplay } from '@/utils/money-format'
|
||||
import {
|
||||
channelServiceOrderTypeLabel,
|
||||
channelServiceOrderTypeTagType,
|
||||
channelServiceOrderStatusLabel,
|
||||
channelServiceOrderStatusTagType,
|
||||
agreementTypeLabel,
|
||||
txnTypeLabel,
|
||||
txnTypeTagType,
|
||||
txnStatusLabel,
|
||||
txnStatusTagType
|
||||
agreementTypeLabel
|
||||
} from '@/utils/status-tag-registry'
|
||||
|
||||
defineOptions({ name: 'ChannelServiceOrderManagement' })
|
||||
|
||||
// ── 工具函数 ──────────────────────────────────────────────────────────
|
||||
const formatAmount = (v: any): string => {
|
||||
if (v == null || v === '') return '0.00'
|
||||
const n = Number(v)
|
||||
if (Number.isNaN(n)) return '0.00'
|
||||
return n.toFixed(2)
|
||||
}
|
||||
const formatAmount = (v: any): string => formatMoneyDisplay(v, 2)
|
||||
|
||||
const displayValue = (v: any): string => {
|
||||
if (v == null || v === '' || v === undefined) return '-'
|
||||
@@ -881,14 +964,11 @@ const viewSections = computed((): ViewSection[] => {
|
||||
})
|
||||
}
|
||||
|
||||
// Transaction timeline
|
||||
if (d.transactions?.length) {
|
||||
sections.push({
|
||||
title: '操作记录',
|
||||
fields: [],
|
||||
slot: 'txn-timeline'
|
||||
})
|
||||
}
|
||||
sections.push({
|
||||
title: '操作记录',
|
||||
fields: [],
|
||||
slot: 'txn-timeline'
|
||||
})
|
||||
|
||||
return sections
|
||||
})
|
||||
@@ -939,7 +1019,6 @@ const initFormData = () => ({
|
||||
orderType: 'yfk',
|
||||
channelId: '',
|
||||
deptName: '',
|
||||
prepayAmount: null as number | null,
|
||||
channelAgreementId: '',
|
||||
items: [] as any[],
|
||||
remark: ''
|
||||
@@ -950,22 +1029,6 @@ const formData = reactive(initFormData())
|
||||
const formRules: FormRules = {
|
||||
orderType: [{ required: true, message: '请选择订单类型', trigger: 'change' }],
|
||||
channelId: [{ required: true, message: '请选择渠道', trigger: 'change' }],
|
||||
prepayAmount: [
|
||||
{
|
||||
validator: (_rule, value, callback) => {
|
||||
if (formData.orderType !== 'yfk') {
|
||||
callback()
|
||||
return
|
||||
}
|
||||
if (value == null || Number(value) <= 0) {
|
||||
callback(new Error('请输入充值金额'))
|
||||
return
|
||||
}
|
||||
callback()
|
||||
},
|
||||
trigger: 'blur'
|
||||
}
|
||||
],
|
||||
channelAgreementId: [
|
||||
{
|
||||
validator: (_rule, value, callback) => {
|
||||
@@ -1158,7 +1221,6 @@ const formTotalAmount = computed(() =>
|
||||
)
|
||||
|
||||
const handleOrderTypeChange = () => {
|
||||
formData.prepayAmount = null
|
||||
formData.channelAgreementId = ''
|
||||
formData.items = []
|
||||
agreementOptions.value = []
|
||||
@@ -1189,7 +1251,6 @@ const handleEdit = async (row: any) => {
|
||||
formData.orderType = detail.orderType || 'yfk'
|
||||
formData.channelId = detail.channelId || ''
|
||||
formData.deptName = detail.deptName || ''
|
||||
formData.prepayAmount = detail.prepayAmount ?? null
|
||||
formData.channelAgreementId = detail.channelAgreementId || ''
|
||||
formData.remark = detail.remark || ''
|
||||
|
||||
@@ -1267,7 +1328,6 @@ const handleFormSubmit = async () => {
|
||||
}
|
||||
|
||||
if (formData.orderType === 'yfk') {
|
||||
payload.prepayAmount = formData.prepayAmount
|
||||
payload.channelAgreementId = formData.channelAgreementId
|
||||
} else {
|
||||
payload.channelAgreementId = formData.channelAgreementId
|
||||
@@ -1322,32 +1382,67 @@ const handleDelete = async (row: any) => {
|
||||
|
||||
// ── 流水操作 ──────────────────────────────────────────────────────────
|
||||
const currentOrderForTxn = ref<any>(null)
|
||||
const txnDialogVisible = ref(false)
|
||||
const txnDialogOrder = ref<Record<string, any> | null>(null)
|
||||
const txnDialogRef = ref<InstanceType<typeof ServiceOrderTxnDialog> | null>(null)
|
||||
|
||||
const openTxnDialog = (row: any) => {
|
||||
txnDialogOrder.value = row
|
||||
txnDialogVisible.value = true
|
||||
}
|
||||
|
||||
const onTxnDialogRefreshed = () => {
|
||||
loadData()
|
||||
if (viewVisible.value && viewData.value?.id === txnDialogOrder.value?.id) {
|
||||
handleView(txnDialogOrder.value)
|
||||
}
|
||||
}
|
||||
|
||||
// ── 发起充值 ──────────────────────────────────────────────────────────
|
||||
const rechargeVisible = ref(false)
|
||||
const rechargeLoading = ref(false)
|
||||
const rechargeUploadRef = ref<{ clearFiles?: () => void }>()
|
||||
const rechargeForm = reactive({
|
||||
amount: null as number | null,
|
||||
remark: ''
|
||||
remark: '',
|
||||
attachments: [] as any[]
|
||||
})
|
||||
|
||||
const openRechargeDialog = (row: any) => {
|
||||
currentOrderForTxn.value = row
|
||||
rechargeForm.amount = null
|
||||
rechargeForm.remark = ''
|
||||
rechargeForm.attachments = []
|
||||
rechargeVisible.value = true
|
||||
}
|
||||
|
||||
const handleRechargeAttachmentChange = (uploadFile: any) => {
|
||||
const file = uploadFile.raw || uploadFile
|
||||
if (!file) return
|
||||
uploadAttachmentItem(file, rechargeForm.attachments, rechargeUploadRef, 'channel-service-order')
|
||||
}
|
||||
|
||||
const removeRechargeAttachment = (index: number) => {
|
||||
rechargeForm.attachments.splice(index, 1)
|
||||
}
|
||||
|
||||
const submitRecharge = async () => {
|
||||
if (!rechargeForm.amount || rechargeForm.amount <= 0) {
|
||||
ElMessage.warning('请输入充值金额')
|
||||
return
|
||||
}
|
||||
if (hasUploadingAttachments(rechargeForm.attachments)) {
|
||||
ElMessage.warning('附件正在上传,请稍候')
|
||||
return
|
||||
}
|
||||
const attachmentUrls = joinAttachmentUrls(rechargeForm.attachments)
|
||||
const attachmentPayload = attachmentUrls ? { financeSubmitAttachments: attachmentUrls } : {}
|
||||
rechargeLoading.value = true
|
||||
try {
|
||||
const res: any = await fetchCreateRechargeTxn(currentOrderForTxn.value.id, {
|
||||
amount: rechargeForm.amount,
|
||||
remark: rechargeForm.remark
|
||||
remark: rechargeForm.remark,
|
||||
...attachmentPayload
|
||||
})
|
||||
const txn = res?.data ?? res
|
||||
rechargeVisible.value = false
|
||||
@@ -1358,12 +1453,13 @@ const submitRecharge = async () => {
|
||||
cancelButtonText: '稍后再说',
|
||||
type: 'info'
|
||||
})
|
||||
await fetchSubmitTxnFinance(txn.id, {})
|
||||
await fetchSubmitTxnFinance(txn.id, attachmentPayload)
|
||||
ElMessage.success('充值成功,已发起财务确认')
|
||||
} catch {
|
||||
ElMessage.success('充值流水已创建')
|
||||
}
|
||||
loadData()
|
||||
onTxnDialogRefreshed()
|
||||
txnDialogRef.value?.reload()
|
||||
} catch (e: any) {
|
||||
ElMessage.error(e?.message || '操作失败')
|
||||
} finally {
|
||||
@@ -1410,7 +1506,8 @@ const submitRefundTxn = async () => {
|
||||
} catch {
|
||||
ElMessage.success('退款流水已创建')
|
||||
}
|
||||
loadData()
|
||||
onTxnDialogRefreshed()
|
||||
txnDialogRef.value?.reload()
|
||||
} catch (e: any) {
|
||||
ElMessage.error(e?.message || '操作失败')
|
||||
} finally {
|
||||
@@ -1533,7 +1630,8 @@ const submitPurchase = async () => {
|
||||
} catch {
|
||||
ElMessage.success('购买流水已创建')
|
||||
}
|
||||
loadData()
|
||||
onTxnDialogRefreshed()
|
||||
txnDialogRef.value?.reload()
|
||||
} catch (e: any) {
|
||||
ElMessage.error(e?.message || '操作失败')
|
||||
} finally {
|
||||
@@ -1619,7 +1717,8 @@ const submitUnsubscribe = async () => {
|
||||
} catch {
|
||||
ElMessage.success('退订流水已创建')
|
||||
}
|
||||
loadData()
|
||||
onTxnDialogRefreshed()
|
||||
txnDialogRef.value?.reload()
|
||||
} catch (e: any) {
|
||||
ElMessage.error(e?.message || '操作失败')
|
||||
} finally {
|
||||
@@ -1693,13 +1792,6 @@ async function uploadAttachmentItem(
|
||||
uploadRef: { value?: { clearFiles?: () => void } },
|
||||
folder: string
|
||||
) {
|
||||
const maxSizeMb = 20
|
||||
if (file.size / 1024 / 1024 > maxSizeMb) {
|
||||
ElMessage.error(`文件大小不能超过 ${maxSizeMb}MB`)
|
||||
uploadRef.value?.clearFiles?.()
|
||||
return
|
||||
}
|
||||
|
||||
const tempId = `temp_${Date.now()}_${Math.random().toString(36).slice(2, 8)}`
|
||||
list.push({
|
||||
id: tempId,
|
||||
@@ -1812,6 +1904,12 @@ onMounted(() => {
|
||||
}
|
||||
}
|
||||
|
||||
.view-inner-table-wrap {
|
||||
margin-top: 0;
|
||||
padding: 0;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.product-detail-table-wrap {
|
||||
width: 100%;
|
||||
|
||||
|
||||
@@ -414,6 +414,7 @@
|
||||
import { Calendar, Close, CollectionTag, OfficeBuilding, User } from '@element-plus/icons-vue'
|
||||
import ProtocolAttachmentReadonly from '@/views/cell-storage/protocol/ProtocolAttachmentReadonly.vue'
|
||||
import { downloadAttachmentFile } from '@/utils/download-attachment'
|
||||
import { formatMoneyDisplay } from '@/utils/money-format'
|
||||
import {
|
||||
channelTypeLabel,
|
||||
channelTypeTagType,
|
||||
@@ -542,12 +543,7 @@
|
||||
downloadAttachmentFile(file, { fullFileUrl })
|
||||
}
|
||||
|
||||
function formatAmount(val: unknown) {
|
||||
if (val === null || val === undefined || val === '') return '0.00'
|
||||
const num = Number(val)
|
||||
if (isNaN(num)) return '0.00'
|
||||
return num.toFixed(2)
|
||||
}
|
||||
const formatAmount = (v: unknown): string => formatMoneyDisplay(v as any, 2)
|
||||
|
||||
async function loadAccountData() {
|
||||
if (!props.channelId || accountLoaded.value) return
|
||||
|
||||
@@ -283,7 +283,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<span class="upload-hint"
|
||||
>支持图片、视频、PDF、Word、Excel等文件,单文件不超过 20MB</span
|
||||
>支持图片、视频、PDF、Word、Excel等文件</span
|
||||
>
|
||||
</div>
|
||||
</el-form-item>
|
||||
@@ -632,7 +632,7 @@
|
||||
</div>
|
||||
<div v-if="agr.creditLimit != null" class="sub-card-field">
|
||||
<span class="field-label">授信额度(元)</span>
|
||||
<span class="field-value">{{ agr.creditLimit }}</span>
|
||||
<span class="field-value">{{ agr.creditLimit != null ? formatMoneyDisplay(agr.creditLimit) : '-' }}</span>
|
||||
</div>
|
||||
<div v-if="agr.effectiveDate" class="sub-card-field">
|
||||
<span class="field-label">生效日期</span>
|
||||
@@ -728,7 +728,7 @@
|
||||
header-align="center"
|
||||
>
|
||||
<template #default="{ row: priceRow }">
|
||||
{{ priceRow.originalPrice != null ? `${priceRow.originalPrice}` : '-' }}
|
||||
{{ priceRow.originalPrice != null ? formatMoneyDisplay(priceRow.originalPrice) : '-' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
@@ -738,15 +738,12 @@
|
||||
header-align="center"
|
||||
>
|
||||
<template #default="{ row: priceRow }">
|
||||
<el-input-number
|
||||
<AmountInput
|
||||
v-model="priceRow.agreementPrice"
|
||||
class="protocol-price-input"
|
||||
:precision="2"
|
||||
:min="0"
|
||||
:controls="false"
|
||||
style="width: 100%"
|
||||
class="protocol-price-input"
|
||||
placeholder="请输入"
|
||||
@blur="handleUpdatePrice(priceRow)"
|
||||
@change="handleUpdatePrice(priceRow)"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@@ -852,12 +849,9 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="授信额度(元)" prop="creditLimit">
|
||||
<el-input-number
|
||||
<AmountInput
|
||||
v-model="agreementFormData.creditLimit"
|
||||
:precision="2"
|
||||
:min="0"
|
||||
:controls="false"
|
||||
style="width: 100%"
|
||||
placeholder="请输入授信额度(元)"
|
||||
/>
|
||||
</el-form-item>
|
||||
@@ -965,7 +959,7 @@
|
||||
<el-table-column prop="specText" label="规格" min-width="100" align="center" header-align="center" />
|
||||
<el-table-column label="单价(元)" min-width="90" align="center" header-align="center">
|
||||
<template #default="{ row }">
|
||||
{{ row.unitPrice != null ? `${row.unitPrice}` : '-' }}
|
||||
{{ row.unitPrice != null ? formatMoneyDisplay(row.unitPrice) : '-' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="remark" label="备注" min-width="120" align="center" header-align="center" show-overflow-tooltip />
|
||||
@@ -1034,6 +1028,8 @@
|
||||
import { withFullscreenLoading, fullscreenLoadingText } from '@/utils/fullscreen-loading'
|
||||
import { fetchUploadAttachment } from '@/api/business'
|
||||
import { downloadAttachmentFile } from '@/utils/download-attachment'
|
||||
import AmountInput from '@/components/common/amount-input/index.vue'
|
||||
import { formatMoneyDisplay } from '@/utils/money-format'
|
||||
import {
|
||||
channelType as channelTypeRegistry,
|
||||
channelTypeLabel,
|
||||
@@ -2239,13 +2235,6 @@
|
||||
const file = uploadFile.raw || uploadFile
|
||||
if (!file) return
|
||||
|
||||
const maxSizeMb = 20
|
||||
if (file.size / 1024 / 1024 > maxSizeMb) {
|
||||
ElMessage.error(`文件大小不能超过 ${maxSizeMb}MB`)
|
||||
attachmentUploadRef.value?.clearFiles()
|
||||
return
|
||||
}
|
||||
|
||||
const tempId = `temp_${Date.now()}_${Math.random().toString(36).slice(2, 8)}`
|
||||
formData.attachments.push({
|
||||
id: tempId,
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
<el-table-column prop="itemCount" label="项目数" min-width="80" align="center" header-align="center" />
|
||||
<el-table-column label="合计费用(元)" min-width="120" align="center" header-align="center">
|
||||
<template #default="{ row }">{{
|
||||
row.totalFee != null ? `¥${row.totalFee}` : '—'
|
||||
row.totalFee != null ? `¥${formatMoneyDisplay(row.totalFee)}` : '—'
|
||||
}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="status" label="状态" min-width="90" align="center">
|
||||
@@ -129,12 +129,9 @@
|
||||
</el-table-column>
|
||||
<el-table-column label="项目费用(元)" min-width="120" align="center" header-align="center">
|
||||
<template #default="{ row }">
|
||||
<el-input-number
|
||||
<AmountInput
|
||||
v-model="row.projectFee"
|
||||
:precision="2"
|
||||
:min="0"
|
||||
:controls="false"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@@ -216,7 +213,7 @@
|
||||
/>
|
||||
<el-table-column label="项目费用(元)" min-width="120" align="center" header-align="center">
|
||||
<template #default="{ row }">{{
|
||||
row.projectFee != null ? `¥${row.projectFee}` : '—'
|
||||
row.projectFee != null ? `¥${formatMoneyDisplay(row.projectFee)}` : '—'
|
||||
}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="status" label="状态" min-width="90" align="center" header-align="center">
|
||||
@@ -266,6 +263,8 @@
|
||||
fetchCheckupInstitutionProjects
|
||||
} from '@/api/admin'
|
||||
import { withFullscreenLoading, fullscreenLoadingText } from '@/utils/fullscreen-loading'
|
||||
import AmountInput from '@/components/common/amount-input/index.vue'
|
||||
import { formatMoneyDisplay } from '@/utils/money-format'
|
||||
|
||||
const props = defineProps<{
|
||||
institutionId: string
|
||||
|
||||
@@ -201,7 +201,7 @@
|
||||
<el-table-column type="index" label="序号" min-width="68" align="center" header-align="center" />
|
||||
<el-table-column prop="projectName" label="项目名称" min-width="160" align="center" header-align="center" />
|
||||
<el-table-column prop="projectFee" label="项目费用(元)" min-width="120" align="center" header-align="center">
|
||||
<template #default="{ row }">{{ row.projectFee != null ? `¥${row.projectFee}` : '—' }}</template>
|
||||
<template #default="{ row }">{{ row.projectFee != null ? `¥${formatMoneyDisplay(row.projectFee)}` : '—' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="status" label="状态" min-width="90" align="center" header-align="center">
|
||||
<template #default="{ row }">
|
||||
@@ -255,7 +255,7 @@
|
||||
<el-input v-model="itemForm.projectName" />
|
||||
</el-form-item>
|
||||
<el-form-item label="项目费用(元)" prop="projectFee">
|
||||
<el-input-number v-model="itemForm.projectFee" :min="0" :precision="2" style="width: 100%" />
|
||||
<AmountInput v-model="itemForm.projectFee" :min="0" placeholder="请输入项目费用" />
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-radio-group v-model="itemForm.status">
|
||||
@@ -313,6 +313,8 @@
|
||||
} from '@element-plus/icons-vue'
|
||||
import SystemViewDialog from '@/components/business/system-view-dialog/index.vue'
|
||||
import CheckupPackagePanel from './CheckupPackagePanel.vue'
|
||||
import AmountInput from '@/components/common/amount-input/index.vue'
|
||||
import { formatMoneyDisplay } from '@/utils/money-format'
|
||||
import type { ViewSection } from '@/components/business/system-view-dialog/index.vue'
|
||||
import {
|
||||
fetchCheckupInstitutionList,
|
||||
|
||||
@@ -179,13 +179,9 @@
|
||||
<el-table-column prop="specText" label="规格" min-width="100" align="center" header-align="center" />
|
||||
<el-table-column label="单价(元)" min-width="100" align="center" header-align="center">
|
||||
<template #default="{ row }">
|
||||
<el-input-number
|
||||
<AmountInput
|
||||
v-model="row.unitPrice"
|
||||
:precision="2"
|
||||
:min="0"
|
||||
:controls="false"
|
||||
size="default"
|
||||
style="width: 100%"
|
||||
placeholder="请输入单价"
|
||||
/>
|
||||
</template>
|
||||
@@ -249,7 +245,7 @@
|
||||
<el-table-column prop="specText" label="规格" min-width="100" align="center" header-align="center" />
|
||||
<el-table-column label="单价" min-width="80" align="center" header-align="center">
|
||||
<template #default="{ row }">
|
||||
{{ row.unitPrice != null ? `${row.unitPrice} 元` : '-' }}
|
||||
{{ row.unitPrice != null ? `${formatMoneyDisplay(row.unitPrice)} 元` : '-' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="remark" label="备注" min-width="120" align="center" header-align="center" />
|
||||
@@ -283,8 +279,10 @@
|
||||
import { ref, reactive, onMounted, computed, nextTick } from 'vue'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import { Plus, Close, Check, View, Edit, Delete, ScaleToOriginal, RefreshLeft, Search } from '@element-plus/icons-vue'
|
||||
import SystemViewDialog from '@/components/business/system-view-dialog/index.vue'
|
||||
import { withFullscreenLoading, fullscreenLoadingText } from '@/utils/fullscreen-loading'
|
||||
import SystemViewDialog from '@/components/business/system-view-dialog/index.vue'
|
||||
import AmountInput from '@/components/common/amount-input/index.vue'
|
||||
import { formatMoneyDisplay } from '@/utils/money-format'
|
||||
import { withFullscreenLoading, fullscreenLoadingText } from '@/utils/fullscreen-loading'
|
||||
import {
|
||||
fetchProjectSystemList,
|
||||
fetchCreateProjectSystem,
|
||||
@@ -394,7 +392,7 @@
|
||||
title: '价格明细',
|
||||
fields: items.map((item: any, idx: number) => ({
|
||||
label: `明细 ${idx + 1}`,
|
||||
value: `${item.projectName || '-'} / ${item.cellTypeName || '-'} / ${item.specText || '-'} / ${item.unitPrice != null ? item.unitPrice + ' 元' : '-'} / ${item.remark || '-'}`,
|
||||
value: `${item.projectName || '-'} / ${item.cellTypeName || '-'} / ${item.specText || '-'} / ${item.unitPrice != null ? formatMoneyDisplay(item.unitPrice) + ' 元' : '-'} / ${item.remark || '-'}`,
|
||||
span: true
|
||||
}))
|
||||
}
|
||||
|
||||
@@ -533,7 +533,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<span class="upload-hint">支持图片上传,单文件不超过 10MB</span>
|
||||
<span class="upload-hint">支持图片上传</span>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" class="form-col-span-2">
|
||||
@@ -1105,12 +1105,7 @@
|
||||
const file = uploadFile.raw || uploadFile
|
||||
if (!file) return
|
||||
|
||||
const maxSizeMb = 10
|
||||
if (file.size / 1024 / 1024 > maxSizeMb) {
|
||||
ElMessage.error(`图片大小不能超过 ${maxSizeMb}MB`)
|
||||
productImageUploadRef.value?.clearFiles()
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
const tempId = `temp_${Date.now()}_${Math.random().toString(36).slice(2, 8)}`
|
||||
productImageFiles.value.push({
|
||||
|
||||
@@ -244,7 +244,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<span class="upload-hint">支持图片上传,单文件不超过 10MB</span>
|
||||
<span class="upload-hint">支持图片上传</span>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<!-- 备注 (full width) -->
|
||||
@@ -625,12 +625,7 @@
|
||||
async function handleProductImageChange(uploadFile: any) {
|
||||
const file = uploadFile.raw || uploadFile
|
||||
if (!file) return
|
||||
const maxSizeMb = 10
|
||||
if (file.size / 1024 / 1024 > maxSizeMb) {
|
||||
ElMessage.error(`图片大小不能超过 ${maxSizeMb}MB`)
|
||||
productImageUploadRef.value?.clearFiles()
|
||||
return
|
||||
}
|
||||
|
||||
const tempId = `temp_${Date.now()}_${Math.random().toString(36).slice(2, 8)}`
|
||||
productImageFiles.value.push({
|
||||
id: tempId,
|
||||
|
||||
@@ -196,7 +196,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<span class="upload-hint"
|
||||
>支持图片、视频、PDF、Word、Excel等文件,单文件不超过 20MB</span
|
||||
>支持图片、视频、PDF、Word、Excel等文件</span
|
||||
>
|
||||
</div>
|
||||
</el-form-item>
|
||||
@@ -460,12 +460,7 @@
|
||||
const file = uploadFile?.raw || uploadFile
|
||||
if (!file) return
|
||||
|
||||
const maxSizeMb = 20
|
||||
if (file.size / 1024 / 1024 > maxSizeMb) {
|
||||
ElMessage.error(`文件大小不能超过 ${maxSizeMb}MB`)
|
||||
attachmentUploadRef.value?.clearFiles()
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
const tempId = `temp_${Date.now()}_${Math.random().toString(36).slice(2, 8)}`
|
||||
formData.attachments.push({
|
||||
|
||||
@@ -382,6 +382,7 @@
|
||||
import { ref, reactive, computed, onMounted } from 'vue'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import { Close, Check, Search, RefreshLeft, VideoPlay, View, Tickets, EditPen, Plus } from '@element-plus/icons-vue'
|
||||
import { formatMoneyDisplay } from '@/utils/money-format'
|
||||
import ProtocolFinanceConfirmFields from '@/components/business/protocol-finance-confirm-fields/index.vue'
|
||||
import ProtocolAttachmentReadonly from '@/views/cell-storage/protocol/ProtocolAttachmentReadonly.vue'
|
||||
import DialogFormBody from '@/components/business/dialog-form-body/index.vue'
|
||||
@@ -884,7 +885,7 @@
|
||||
{ label: '检测项目', value: d.itemName },
|
||||
{ label: '项目编码', value: d.itemCode || '—' },
|
||||
{ label: '第三方公司', value: d.companyName || '—' },
|
||||
{ label: '检测费用', value: d.feeAmount != null ? `¥${d.feeAmount}` : '—' },
|
||||
{ label: '检测费用', value: d.feeAmount != null ? '¥' + formatMoneyDisplay(d.feeAmount) : '—' },
|
||||
{ label: '任务状态', value: taskStatusLabel(d.taskStatus), tagType: d.taskStatus === 'ywc' ? 'success' : d.taskStatus === 'jxz' ? 'warning' : 'info' },
|
||||
{
|
||||
label: '检测结论',
|
||||
|
||||
@@ -214,7 +214,7 @@
|
||||
<div class="qc-company-group-title">{{ group.companyName }}</div>
|
||||
<div class="qc-company-group-items">
|
||||
<el-checkbox v-for="item in group.items" :key="item.id" :value="item.id">
|
||||
{{ item.itemName }}({{ item.itemCode }})¥{{ item.feeAmount }}
|
||||
{{ item.itemName }}({{ item.itemCode }})¥{{ formatMoneyDisplay(item.feeAmount) }}
|
||||
</el-checkbox>
|
||||
</div>
|
||||
</div>
|
||||
@@ -348,6 +348,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { formatMoneyDisplay } from '@/utils/money-format'
|
||||
import { ref, reactive, computed, onMounted } from 'vue'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import { Close, Check, Search, RefreshLeft, View, Setting, Document, Plus, EditPen } from '@element-plus/icons-vue'
|
||||
@@ -718,7 +719,7 @@
|
||||
function formatConfiguredThirdItems(d: QcWorkOrderDetail) {
|
||||
return (
|
||||
d.thirdPartyItems
|
||||
?.map((li) => `${li.companyName || ''} — ${li.itemName || ''}(¥${li.feeAmount ?? '—'})`)
|
||||
?.map((li) => `${li.companyName || ''} — ${li.itemName || ''}(${li.feeAmount != null ? '¥' + formatMoneyDisplay(li.feeAmount) : '—'})`)
|
||||
.join('、') || '无'
|
||||
)
|
||||
}
|
||||
|
||||
+2
-6
@@ -97,7 +97,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<p class="upload-hint">支持图片、文档等,单文件不超过 20MB。</p>
|
||||
<p class="upload-hint">支持图片、文档等。</p>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
@@ -196,11 +196,7 @@
|
||||
async function handleAttachmentChange(uploadFile: { raw?: File }) {
|
||||
const file = uploadFile.raw
|
||||
if (!file) return
|
||||
const maxSizeMb = 20
|
||||
if (file.size / 1024 / 1024 > maxSizeMb) {
|
||||
ElMessage.error(`文件大小不能超过 ${maxSizeMb}MB`)
|
||||
return
|
||||
}
|
||||
|
||||
const tempId = `temp_${Date.now()}_${Math.random().toString(36).slice(2, 8)}`
|
||||
const uploading: AttachmentItem = {
|
||||
id: tempId,
|
||||
|
||||
@@ -204,7 +204,7 @@
|
||||
<el-table-column prop="itemCode" label="项目编码" min-width="120" align="center" />
|
||||
<el-table-column prop="itemName" label="项目名称" min-width="160" align="center" />
|
||||
<el-table-column prop="feeAmount" label="费用(元)" min-width="110" align="center">
|
||||
<template #default="{ row }">{{ row.feeAmount != null ? `¥${row.feeAmount}` : '—' }}</template>
|
||||
<template #default="{ row }">{{ row.feeAmount != null ? '¥' + formatMoneyDisplay(row.feeAmount) : '—' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="status" label="状态" min-width="90" align="center">
|
||||
<template #default="{ row }">
|
||||
@@ -263,7 +263,7 @@
|
||||
<el-input v-model="itemForm.itemName" />
|
||||
</el-form-item>
|
||||
<el-form-item label="费用(元)" prop="feeAmount">
|
||||
<el-input-number v-model="itemForm.feeAmount" :min="0" :precision="2" style="width: 100%" />
|
||||
<AmountInput v-model="itemForm.feeAmount" :min="0" placeholder="请输入检测费用" />
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-radio-group v-model="itemForm.status">
|
||||
@@ -409,6 +409,8 @@
|
||||
} from '@/api/qc-third-party-item'
|
||||
import { fetchQcItemParams, fetchSaveQcItemParams, type QcItemParam } from '@/api/qc-item-param'
|
||||
import { fetchItemUnitList } from '@/api/admin'
|
||||
import AmountInput from '@/components/common/amount-input/index.vue'
|
||||
import { formatMoneyDisplay } from '@/utils/money-format'
|
||||
|
||||
defineOptions({ name: 'QualityInspectionThirdPartyCompany' })
|
||||
|
||||
|
||||
@@ -711,7 +711,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<span class="upload-hint">支持图片和 PDF 格式,可稍后补充,单文件不超过 20MB</span>
|
||||
<span class="upload-hint">支持图片和 PDF 格式,可稍后补充</span>
|
||||
</div>
|
||||
|
||||
<!-- 其他附件 -->
|
||||
@@ -783,7 +783,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<span class="upload-hint">支持图片、PDF、Word 格式,单文件不超过 20MB</span>
|
||||
<span class="upload-hint">支持图片、PDF、Word 格式</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -2147,12 +2147,6 @@
|
||||
async function handleConsentAttachmentChange(uploadFile: any) {
|
||||
const file = uploadFile.raw || uploadFile
|
||||
if (!file) return
|
||||
const maxSizeMb = 20
|
||||
if (file.size / 1024 / 1024 > maxSizeMb) {
|
||||
ElMessage.error(`文件大小不能超过 ${maxSizeMb}MB`)
|
||||
consentUploadRef.value?.clearFiles()
|
||||
return
|
||||
}
|
||||
const tempId = `temp_${Date.now()}_${Math.random().toString(36).slice(2, 8)}`
|
||||
formData.consentAttachments.push({
|
||||
id: tempId,
|
||||
@@ -2197,12 +2191,6 @@
|
||||
async function handleOtherAttachmentChange(uploadFile: any) {
|
||||
const file = uploadFile.raw || uploadFile
|
||||
if (!file) return
|
||||
const maxSizeMb = 20
|
||||
if (file.size / 1024 / 1024 > maxSizeMb) {
|
||||
ElMessage.error(`文件大小不能超过 ${maxSizeMb}MB`)
|
||||
otherUploadRef.value?.clearFiles()
|
||||
return
|
||||
}
|
||||
const tempId = `temp_${Date.now()}_${Math.random().toString(36).slice(2, 8)}`
|
||||
formData.otherAttachments.push({
|
||||
id: tempId,
|
||||
|
||||
@@ -581,6 +581,7 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import { computed, nextTick, ref, watch } from 'vue'
|
||||
import { formatMoneyDisplay } from '@/utils/money-format'
|
||||
import { Calendar, CircleCheck, Close, Document, User } from '@element-plus/icons-vue'
|
||||
import ProtocolAttachmentReadonly from '@/views/cell-storage/protocol/ProtocolAttachmentReadonly.vue'
|
||||
import SampleQcInfoCards from '@/components/business/sample-qc-info-cards/index.vue'
|
||||
@@ -830,7 +831,7 @@
|
||||
if (ec !== '—') parts.push(ec)
|
||||
if (transport.waybillNo) parts.push(String(transport.waybillNo))
|
||||
if (transport.expressFee != null && transport.expressFee !== '') {
|
||||
parts.push(`¥${transport.expressFee}`)
|
||||
parts.push('¥' + formatMoneyDisplay(transport.expressFee))
|
||||
}
|
||||
return parts.length ? parts.join(' · ') : '—'
|
||||
}
|
||||
|
||||
@@ -802,12 +802,7 @@
|
||||
}
|
||||
|
||||
const uploadCategoryImageFile = async (file: File) => {
|
||||
const maxSizeMb = 10
|
||||
if (file.size / 1024 / 1024 > maxSizeMb) {
|
||||
ElMessage.error(`图片大小不能超过 ${maxSizeMb}MB`)
|
||||
categoryImageUploadRef.value?.clearFiles()
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
try {
|
||||
ElMessage.info('图片正在上传...')
|
||||
|
||||
@@ -1474,7 +1474,7 @@
|
||||
<el-table-column label="供货价" min-width="110" align="center">
|
||||
<template #default="{ row }">
|
||||
<span v-if="!orderPriceVersionDetail?.quotationId">-</span>
|
||||
<span v-else>¥{{ (Number(row.supplierPrice || 0) || 0).toFixed(2) }}</span>
|
||||
<span v-else>¥{{ formatAmount(row.supplierPrice || 0) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="供货金额" min-width="110" align="center">
|
||||
@@ -1482,7 +1482,7 @@
|
||||
</el-table-column>
|
||||
<el-table-column label="商品售价" min-width="110" align="center">
|
||||
<template #default="{ row }"
|
||||
>¥{{ (Number(row.finalPrice ?? row.price) || 0).toFixed(2) }}</template
|
||||
>¥{{ formatAmount(row.finalPrice ?? row.price) }}</template
|
||||
>
|
||||
</el-table-column>
|
||||
<el-table-column label="商品金额" min-width="110" align="center">
|
||||
@@ -1548,6 +1548,7 @@
|
||||
import { useUserStore } from '@/store/modules/user'
|
||||
import { fetchAllPagedRecords } from '@/utils/fetch-paged-list'
|
||||
import { ensureCategoryPathDataLoaded, formatCategoryPathLabel } from '@/utils/category-path-display'
|
||||
import { formatMoneyDisplay } from '@/utils/money-format'
|
||||
|
||||
defineOptions({ name: 'OrderManagement' })
|
||||
|
||||
@@ -2061,8 +2062,8 @@
|
||||
}
|
||||
|
||||
const formatAmount = (amount: number | string) => {
|
||||
const num = typeof amount === 'string' ? parseFloat(amount) : amount
|
||||
return isNaN(num) ? '0.00' : num.toFixed(2)
|
||||
if (amount == null || amount === '') return '0.00'
|
||||
return formatMoneyDisplay(amount)
|
||||
}
|
||||
|
||||
const displayValue = (value: any) => {
|
||||
|
||||
@@ -318,7 +318,7 @@
|
||||
</el-upload>
|
||||
</div>
|
||||
<div class="media-spec-hint">
|
||||
尺寸要求:请上传 1:1 正方形主图(推荐 800×800 至 2000×2000 像素,JPG/PNG/WebP);小程序商品卡片会按固定方图展示,非 1:1 图片将被自动居中裁切;单张不超过 10MB。
|
||||
尺寸要求:请上传 1:1 正方形主图(推荐 800×800 至 2000×2000 像素,JPG/PNG/WebP);小程序商品卡片会按固定方图展示,非 1:1 图片将被自动居中裁切。
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@@ -356,7 +356,7 @@
|
||||
<span class="section-tip">支持拖拽排序,最多上传9张图片/视频</span>
|
||||
</div>
|
||||
<p class="media-spec-hint">
|
||||
尺寸要求:轮播图建议按 4:3(宽:高)上传(推荐宽度约 750px,例如 750×562);小程序端详情页顶部轮播区域按 4:3 展示,非 4:3 图片会以「居中裁切填充」方式展示;图片单张不超过 10MB,视频单文件不超过 100MB。
|
||||
尺寸要求:轮播图建议按 4:3(宽:高)上传(推荐宽度约 750px,例如 750×562);小程序端详情页顶部轮播区域按 4:3 展示,非 4:3 图片会以「居中裁切填充」方式展示。
|
||||
</p>
|
||||
<div class="banner-upload-section">
|
||||
<div v-if="bannerList.length > 0" class="banner-list">
|
||||
@@ -1989,13 +1989,6 @@
|
||||
const status = (uploadFile as any).status
|
||||
if (status && status !== 'ready') return
|
||||
|
||||
const maxSizeMb = 10
|
||||
if (file.size / 1024 / 1024 > maxSizeMb) {
|
||||
ElMessage.error(`图片大小不能超过 ${maxSizeMb}MB`)
|
||||
mainImageUploadRef.value?.clearFiles()
|
||||
return
|
||||
}
|
||||
|
||||
mainImageUploading.value = true
|
||||
revokeMainImageLocalPreview()
|
||||
mainImageLocalPreview.value = URL.createObjectURL(file)
|
||||
@@ -2094,12 +2087,6 @@
|
||||
return
|
||||
}
|
||||
|
||||
const maxSizeMb = isVideo ? 100 : 10
|
||||
if (file.size / 1024 / 1024 > maxSizeMb) {
|
||||
ElMessage.error(`${isVideo ? '视频' : '图片'}大小不能超过 ${maxSizeMb}MB`)
|
||||
return
|
||||
}
|
||||
|
||||
if (bannerList.value.length >= 9) {
|
||||
ElMessage.warning('最多上传9张轮播图')
|
||||
return
|
||||
@@ -2183,12 +2170,6 @@
|
||||
return
|
||||
}
|
||||
|
||||
const maxSizeMb = isVideo ? 100 : 10
|
||||
if (file.size / 1024 / 1024 > maxSizeMb) {
|
||||
ElMessage.error(`${isVideo ? '视频' : '图片'}大小不能超过 ${maxSizeMb}MB`)
|
||||
return
|
||||
}
|
||||
|
||||
if (detailMediaList.value.length >= 30) {
|
||||
ElMessage.warning('最多上传30个详情媒体')
|
||||
return
|
||||
|
||||
@@ -257,6 +257,7 @@ import { withFullscreenLoading, fullscreenLoadingText } from '@/utils/fullscreen
|
||||
import { ArrowLeft, Close, Check } from '@element-plus/icons-vue'
|
||||
import { fetchUserDetail, fetchUpdateUser, fetchActiveRegions } from '@/api/admin'
|
||||
import { resolveUserAvatarUrl } from '@/utils/user-avatar'
|
||||
import { formatMoneyDisplay } from '@/utils/money-format'
|
||||
import type { FormInstance, FormRules } from 'element-plus'
|
||||
|
||||
defineOptions({ name: 'UserDetail' })
|
||||
@@ -375,8 +376,8 @@ const getRoleText = (role: string) => {
|
||||
|
||||
// 格式化金额
|
||||
const formatAmount = (amount: number | string) => {
|
||||
const num = typeof amount === 'string' ? parseFloat(amount) : amount
|
||||
return isNaN(num) ? '0.00' : num.toLocaleString('zh-CN', { minimumFractionDigits: 2, maximumFractionDigits: 2 })
|
||||
if (amount == null || amount === '') return '0.00'
|
||||
return formatMoneyDisplay(amount)
|
||||
}
|
||||
|
||||
// 返回列表
|
||||
|
||||
Reference in new issue
Block a user