This commit is contained in:
zlwu committed 2026-06-18 11:05:53 +08:00
1 parent 58a47b96a5
commit 482d6bbe5d
70 files changed
+28702 -25810

No files matched your search

@@ -193,6 +193,18 @@
style="width: 100%"
/>
</el-form-item>
<el-form-item>
<template #label
>样本编码过滤<span class="form-label-tip"
>留空则协议单添加样本时不过滤编码</span
></template
>
<el-input
v-model="formData.sampleCodeFilter"
placeholder="如 ZKZX,匹配样本编码包含该文本"
clearable
/>
</el-form-item>
<el-form-item prop="orderNum">
<template #label>排序<span class="form-label-tip">数值越小越靠前</span></template>
<el-input-number
@@ -359,6 +371,7 @@
{ label: '类型名称', value: row.typeName },
{ label: '存储年限(年)', value: row.storageYears },
{ label: '存储价格(元)', value: row.storagePrice },
{ label: '样本编码过滤', value: row.sampleCodeFilter || '—' },
{ label: '排序', value: row.orderNum },
{ label: '创建时间', value: row.createTime },
{ label: '备注', value: row.remark, span: true }
@@ -398,6 +411,7 @@
typeLogo: '',
storageYears: null as number | null,
storagePrice: null as number | null,
sampleCodeFilter: '',
orderNum: 0,
remark: ''
})
@@ -438,6 +452,7 @@
formData.typeLogo = ''
formData.storageYears = null
formData.storagePrice = null
formData.sampleCodeFilter = ''
formData.orderNum = 0
formData.remark = ''
editingId.value = null
@@ -460,6 +475,7 @@
formData.typeLogo = row.typeLogo || ''
formData.storageYears = row.storageYears ?? null
formData.storagePrice = row.storagePrice ?? null
formData.sampleCodeFilter = row.sampleCodeFilter || ''
formData.orderNum = row.orderNum ?? 0
formData.remark = row.remark || ''
dialogVisible.value = true
@@ -476,6 +492,7 @@
typeLogo: formData.typeLogo?.trim() ?? '',
storageYears: formData.storageYears,
storagePrice: formData.storagePrice,
sampleCodeFilter: formData.sampleCodeFilter?.trim() || undefined,
orderNum: formData.orderNum,
remark: formData.remark?.trim() || undefined
}
@@ -485,6 +502,7 @@
typeLogo: payload.typeLogo,
storageYears: payload.storageYears,
storagePrice: payload.storagePrice,
sampleCodeFilter: payload.sampleCodeFilter,
orderNum: payload.orderNum,
remark: payload.remark
})
@@ -422,7 +422,17 @@
<el-icon><Close /></el-icon>
取消
</el-button>
<el-button class="btn-main" type="primary" :loading="submitLoading" @click="submitConfirm">
<el-button :loading="rejectLoading" :disabled="submitLoading" @click="submitReject">
<el-icon><RefreshLeft /></el-icon>
退回
</el-button>
<el-button
class="btn-main"
type="primary"
:loading="submitLoading"
:disabled="rejectLoading"
@click="submitConfirm"
>
<el-icon><Check /></el-icon>
确认
</el-button>
@@ -457,12 +467,13 @@
<script setup lang="ts">
import { ref, reactive, onMounted } from 'vue'
import { ElMessage } from 'element-plus'
import { ElMessage, ElMessageBox } from 'element-plus'
import { Close, Check, RefreshLeft, Search, View } from '@element-plus/icons-vue'
import {
fetchRefundConfirmList,
fetchRefundConfirmedList,
fetchRefundConfirmSubmit
fetchRefundConfirmSubmit,
fetchRefundConfirmReject
} from '@/api/collection-protocol'
import ProtocolFinanceConfirmFields from '@/components/business/protocol-finance-confirm-fields/index.vue'
import ClinicalPaymentConfirmTimeline from '@/components/business/clinical-payment-confirm-timeline/index.vue'
@@ -508,6 +519,7 @@
const dialogVisible = ref(false)
const viewDialogVisible = ref(false)
const submitLoading = ref(false)
const rejectLoading = ref(false)
const financeRemark = ref('')
const attachments = ref<FinanceAttachmentItem[]>([])
const currentDetailId = ref<string | null>(null)
@@ -636,6 +648,26 @@
}
}
async function submitReject() {
if (!currentDetailId.value) return
try {
await ElMessageBox.confirm('确定退回?退回后状态将变为「已缴费」。', '退回确认', {
type: 'warning'
})
} catch {
return
}
rejectLoading.value = true
try {
await fetchRefundConfirmReject(currentDetailId.value)
dialogVisible.value = false
await loadAll()
emit('actionDone')
} finally {
rejectLoading.value = false
}
}
watchDebounced(
[pendingSearchForm, pendingInstallmentDueDateRange],
() => {
@@ -458,10 +458,19 @@
<el-icon><Close /></el-icon>
取消
</el-button>
<el-button
:loading="rejectLoading"
:disabled="submitLoading"
@click="submitReject"
>
<el-icon><RefreshLeft /></el-icon>
退回
</el-button>
<el-button
class="btn-main"
type="primary"
:loading="submitLoading"
:disabled="rejectLoading"
@click="submitConfirm"
>
<el-icon><Check /></el-icon>
@@ -503,12 +512,13 @@
<script setup lang="ts">
import { ref, reactive, onMounted } from 'vue'
import { ElMessage } from 'element-plus'
import { ElMessage, ElMessageBox } from 'element-plus'
import { Close, Check, RefreshLeft, Search, View } from '@element-plus/icons-vue'
import {
fetchReceiptConfirmList,
fetchReceiptConfirmedList,
fetchReceiptConfirmSubmit,
fetchReceiptConfirmReject,
fetchRefundConfirmList,
fetchProtocolInvoicePendingCount
} from '@/api/collection-protocol'
@@ -565,6 +575,7 @@
const dialogVisible = ref(false)
const viewDialogVisible = ref(false)
const submitLoading = ref(false)
const rejectLoading = ref(false)
const financeRemark = ref('')
const attachments = ref<FinanceAttachmentItem[]>([])
const currentDetailId = ref<string | null>(null)
@@ -707,6 +718,26 @@
}
}
async function submitReject() {
if (!currentDetailId.value) return
try {
await ElMessageBox.confirm('确定退回?退回后状态将变为「待缴费」。', '退回确认', {
type: 'warning'
})
} catch {
return
}
rejectLoading.value = true
try {
await fetchReceiptConfirmReject(currentDetailId.value)
dialogVisible.value = false
await loadAll()
await loadTabPendingCounts()
} finally {
rejectLoading.value = false
}
}
watchDebounced(
[pendingSearchForm, pendingInstallmentDueDateRange],
() => {
@@ -155,7 +155,7 @@
<el-button
v-if="col.key === 'dfj'"
class="btn-op-item primary"
@click.stop="handleSubmitReceiptFinance(row)"
@click.stop="openReceiptFinanceDialog(row)"
>
<el-icon><Check /></el-icon>缴费确认
</el-button>
@@ -192,6 +192,149 @@
</div>
</div>
<el-dialog
v-model="receiptDialogVisible"
title="缴费确认"
width="720px"
class="dialog-form-layout"
align-center
append-to-body
modal-class="protocol-dialog-mask"
destroy-on-close
:close-on-click-modal="false"
>
<el-form
ref="receiptFormRef"
:model="receiptForm"
:rules="receiptFormRules"
label-position="top"
class="biz-dialog-form"
>
<div class="form-grid-2">
<el-form-item label="客户姓名">
<span class="view-field-text">{{ receiptPreviewRow?.motherName || '—' }}</span>
</el-form-item>
<el-form-item label="缴费方式">
<span class="view-field-text">{{
receiptPreviewRow ? formatPayModeSummary(receiptPreviewRow) : '—'
}}</span>
</el-form-item>
<el-form-item label="应缴金额(元)">
<span class="view-field-text amount-readonly">{{
formatAmount(receiptPreviewRow?.dueAmount)
}}</span>
</el-form-item>
<el-form-item label="应缴费时间">
<span class="view-field-text">{{
formatDate(String(receiptPreviewRow?.installmentDueDate || ''))
}}</span>
</el-form-item>
<el-form-item label="转账方式" prop="transferType">
<el-select
v-model="receiptForm.transferType"
placeholder="请选择转账方式"
style="width: 100%"
>
<el-option label="微信" value="wxzz" />
<el-option label="支付宝" value="zzbzz" />
<el-option label="银行卡" value="yhkzz" />
<el-option label="现金" value="xj" />
</el-select>
</el-form-item>
<el-form-item label="转账金额(元)" prop="transferAmount">
<AmountInput
v-model="receiptForm.transferAmount"
:min="0"
placeholder="请输入转账金额"
/>
</el-form-item>
<el-form-item label="转账时间" prop="transferTime" class="form-col-span-2">
<el-date-picker
v-model="receiptForm.transferTime"
type="datetime"
value-format="YYYY-MM-DD HH:mm:ss"
placeholder="选择转账时间"
clearable
style="width: 100%"
/>
</el-form-item>
<el-form-item label="备注" class="form-col-span-2">
<el-input
v-model="receiptForm.remark"
type="textarea"
:rows="3"
placeholder="选填"
/>
</el-form-item>
<el-form-item label="上传凭证" class="form-col-span-2">
<div class="attachment-upload">
<div class="attachment-list">
<el-upload
:auto-upload="false"
:show-file-list="false"
:multiple="true"
accept="image/*,video/*,.pdf,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.txt,.zip,.rar"
@change="handleReceiptAttachmentChange"
>
<div class="upload-card">
<el-icon :size="22" color="#047857"><Plus /></el-icon>
<span class="upload-card-text">上传凭证</span>
</div>
</el-upload>
<div
v-for="(file, fIdx) in receiptForm.attachments"
:key="file.id || fIdx"
class="attachment-item"
:class="{ 'is-uploading': file._uploading }"
>
<div class="attachment-preview">
<template v-if="file.fileUrl && isImageUrl(file.fileUrl)">
<img :src="fullFileUrl(file.fileUrl)" :alt="file.fileName" />
</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>
<el-icon
class="action-btn"
title="删除"
@click="removeReceiptAttachment(fIdx)"
>
<Delete />
</el-icon>
</div>
</div>
</div>
<p class="form-tip">支持图片、文档等,多个附件将一并保存或提交。</p>
</div>
</el-form-item>
</div>
</el-form>
<template #footer>
<el-button class="btn-ghost" @click="receiptDialogVisible = false">
<el-icon><Close /></el-icon>
取消
</el-button>
<el-button class="btn-ghost" :loading="receiptSaveLoading" @click="saveReceiptDraft">
<el-icon><DocumentCopy /></el-icon>
仅保存
</el-button>
<el-button
class="btn-main"
type="primary"
:loading="receiptSubmitLoading"
@click="submitReceiptFinance"
>
<el-icon><Check /></el-icon>
提交缴费确认
</el-button>
</template>
</el-dialog>
<el-dialog
v-model="refundDialogVisible"
title="退费确认"
@@ -332,6 +475,7 @@
View,
Plus,
Document,
DocumentCopy,
Delete,
Close,
Check,
@@ -343,9 +487,11 @@
import { downloadAttachmentFile } from '@/utils/download-attachment'
import {
fetchPaymentDetailList,
fetchUpdatePaymentDetailDraft,
fetchSubmitReceiptFinance,
fetchSubmitRefundFinance,
type CollectionProtocolRow
type CollectionProtocolRow,
type PaymentDetailDraftPayload
} from '@/api/collection-protocol'
import { fetchUploadAttachment } from '@/api/business'
import { maskIdCard } from '@/utils/mask-sensitive'
@@ -403,6 +549,31 @@
const viewRow = ref<CollectionProtocolRow | null>(null)
const paymentDetailVisible = ref(false)
const paymentDetailRow = ref<Record<string, unknown> | null>(null)
type AttachmentItem = {
id: string
fileName: string
fileUrl: string
_uploading?: boolean
}
const receiptDialogVisible = ref(false)
const receiptSaveLoading = ref(false)
const receiptSubmitLoading = ref(false)
const receiptTargetId = ref('')
const receiptPreviewRow = ref<Record<string, unknown> | null>(null)
const receiptFormRef = ref<FormInstance>()
const receiptForm = reactive({
transferType: '',
transferAmount: null as number | null,
transferTime: '',
remark: '',
attachments: [] as AttachmentItem[]
})
const receiptFormRules: FormRules = {
transferType: [{ required: true, message: '请选择转账方式', trigger: 'change' }],
transferAmount: [{ required: true, message: '请填写转账金额', trigger: 'blur' }]
}
const refundDialogVisible = ref(false)
const refundSubmitLoading = ref(false)
const refundTargetIds = ref<string[]>([])
@@ -547,23 +718,138 @@
loadColumn(key)
}
async function handleSubmitReceiptFinance(row: Record<string, unknown>) {
async function openReceiptFinanceDialog(row: Record<string, unknown>) {
const id = String(row.id || '')
if (!id) return
receiptTargetId.value = id
receiptPreviewRow.value = row
receiptForm.transferType = String(row.transferType || '')
receiptForm.transferAmount =
row.transferAmount != null && row.transferAmount !== ''
? Number(row.transferAmount)
: null
receiptForm.transferTime = row.transferTime ? String(row.transferTime) : ''
receiptForm.remark = String(row.remark || '')
receiptForm.attachments = mapRowAttachments(row.attachments, row.transferAttachments)
receiptFormRef.value?.clearValidate()
receiptDialogVisible.value = true
}
function mapRowAttachments(raw: unknown, transferAttachments?: unknown): AttachmentItem[] {
if (Array.isArray(raw) && raw.length) {
return raw.map((file, idx) => ({
id: String((file as Record<string, unknown>).id || `existing_${idx}`),
fileName: String((file as Record<string, unknown>).fileName || ''),
fileUrl: String((file as Record<string, unknown>).fileUrl || '')
}))
}
const urls =
typeof transferAttachments === 'string'
? transferAttachments
.split(',')
.map((u) => u.trim())
.filter(Boolean)
: []
return urls.map((url, idx) => ({
id: `existing_${idx}`,
fileName: url.split('/').pop() || `附件${idx + 1}`,
fileUrl: url
}))
}
function buildReceiptPayload(): PaymentDetailDraftPayload {
return {
transferType: receiptForm.transferType || undefined,
transferAmount: receiptForm.transferAmount ?? undefined,
transferTime: receiptForm.transferTime || null,
transferAttachments: receiptAttachmentsToUrls(),
remark: receiptForm.remark?.trim() || null
}
}
function receiptAttachmentsToUrls() {
return receiptForm.attachments
.filter((f) => f.fileUrl && !f._uploading)
.map((f) => f.fileUrl)
.join(',')
}
async function handleReceiptAttachmentChange(uploadFile: { raw?: File }) {
const file = uploadFile.raw
if (!file) return
const tempId = `temp_${Date.now()}`
receiptForm.attachments.push({
id: tempId,
fileName: file.name,
fileUrl: '',
_uploading: true
})
const idx = receiptForm.attachments.length - 1
try {
const fd = new FormData()
fd.append('folder', 'protocol-payment')
fd.append('file', file)
const res = await fetchUploadAttachment(fd)
receiptForm.attachments[idx] = {
id: res.id || tempId,
fileName: file.name || res.fileName,
fileUrl: res.fileUrl,
_uploading: false
}
} catch {
ElMessage.error('文件上传失败')
receiptForm.attachments.splice(idx, 1)
}
}
function removeReceiptAttachment(index: number) {
receiptForm.attachments.splice(index, 1)
}
async function saveReceiptDraft() {
if (!receiptTargetId.value) return
if (receiptForm.attachments.some((f) => f._uploading)) {
ElMessage.warning('附件上传中,请稍候')
return
}
receiptSaveLoading.value = true
try {
await fetchUpdatePaymentDetailDraft(receiptTargetId.value, buildReceiptPayload())
receiptDialogVisible.value = false
loadAllColumns()
} finally {
receiptSaveLoading.value = false
}
}
async function submitReceiptFinance() {
if (!receiptTargetId.value) return
const valid = await receiptFormRef.value?.validate().catch(() => false)
if (!valid) return
if (receiptForm.attachments.some((f) => f._uploading)) {
ElMessage.warning('附件上传中,请稍候')
return
}
try {
await ElMessageBox.confirm(
'确认对该缴费明细进行缴费确认?提交后状态变为「缴费确认中」。',
'缴费确认',
'确认提交缴费确认?提交后状态变为「缴费确认中」。',
'提交缴费确认',
{
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}
)
await fetchSubmitReceiptFinance(id)
loadAllColumns()
} catch {
/* cancel */
return
}
receiptSubmitLoading.value = true
try {
await fetchSubmitReceiptFinance(receiptTargetId.value, buildReceiptPayload())
receiptDialogVisible.value = false
loadAllColumns()
} finally {
receiptSubmitLoading.value = false
}
}
@@ -708,6 +994,18 @@
width: 100%;
}
.view-field-text {
display: inline-block;
min-height: 36px;
line-height: 36px;
color: var(--mint-text, #334155);
}
.amount-readonly {
font-weight: 600;
color: var(--primary-dark, #059669);
}
.attachment-list {
display: flex;
flex-wrap: wrap;
@@ -712,17 +712,20 @@
/>
</el-form-item>
<el-form-item label="缴费状态">
<el-tag
v-if="isPayDetailLocked(detail)"
:type="payStatusTagType(String(detail.payStatus))"
size="small"
>
{{ payStatusLabel(String(detail.payStatus)) }}
</el-tag>
<el-select
v-else
v-model="detail.payStatus"
placeholder="状态"
:disabled="isPayDetailLocked(detail)"
style="width: 100%"
>
<el-option label="待缴费" value="dfj" />
<el-option label="缴费确认中" value="jfqrz" />
<el-option label="已缴费" value="yjf" />
<el-option label="退费确认中" value="tfqrz" />
<el-option label="已退费" value="ytf" />
</el-select>
</el-form-item>
<el-form-item label="应缴费时间">
@@ -935,7 +938,8 @@
deliveryModeLabel,
sampleStatusLabel,
transferTypeLabel,
payStatusLabel
payStatusLabel,
payStatusTagType
} from '@/utils/status-tag-registry'
/** 金额只读展示:千分位 + ¥ 前缀 */
@@ -2348,13 +2352,14 @@
formData.salesUserId = u.id
}
async function remoteSearchSampleCodes(query: string) {
async function remoteSearchSampleCodes(query: string, codeFilter?: string) {
sampleCodeLoading.value = true
try {
const res = await fetchSampleCodeList({
page: 1,
pageSize: 100,
keyword: query?.trim() || undefined
keyword: query?.trim() || undefined,
codeFilter: codeFilter?.trim() || undefined
})
sampleCodeOptions.value = (res.list || []) as Api.BizSampleCode.SampleCodeItem[]
ensureSampleCodesInOptions(formData.samples)
@@ -483,10 +483,15 @@
<el-icon><Close /></el-icon>
取消
</el-button>
<el-button :loading="rejectLoading" :disabled="submitLoading" @click="submitReject">
<el-icon><RefreshLeft /></el-icon>
退回
</el-button>
<el-button
class="btn-main"
type="primary"
:loading="submitLoading"
:disabled="rejectLoading"
@click="submitConfirm"
>
<el-icon><Check /></el-icon>
@@ -554,7 +559,7 @@
<script setup lang="ts">
import { ref, reactive, onMounted, computed } from 'vue'
import { ElMessage } from 'element-plus'
import { ElMessage, ElMessageBox } from 'element-plus'
import {
Close,
Check,
@@ -567,6 +572,7 @@
} from '@element-plus/icons-vue'
import {
confirmClinicalRefund,
rejectClinicalRefund,
fetchClinicalRefundPending,
fetchClinicalRefundConfirmed
} from '@/api/business'
@@ -608,6 +614,7 @@
const dialogVisible = ref(false)
const viewDialogVisible = ref(false)
const submitLoading = ref(false)
const rejectLoading = ref(false)
const currentDetailId = ref<string | null>(null)
const confirmRow = ref<Record<string, unknown> | null>(null)
const viewRow = ref<Record<string, unknown> | null>(null)
@@ -807,6 +814,26 @@
}
}
async function submitReject() {
if (!currentDetailId.value) return
try {
await ElMessageBox.confirm('确定退回?退回后状态将变为「已缴费」。', '退回确认', {
type: 'warning'
})
} catch {
return
}
rejectLoading.value = true
try {
await rejectClinicalRefund(currentDetailId.value)
dialogVisible.value = false
await loadAll()
emit('actionDone')
} finally {
rejectLoading.value = false
}
}
watchDebounced(
[pendingSearchForm],
() => {
@@ -513,10 +513,19 @@
<el-icon><Close /></el-icon>
取消
</el-button>
<el-button
:loading="rejectLoading"
:disabled="submitLoading"
@click="submitReject"
>
<el-icon><RefreshLeft /></el-icon>
退回
</el-button>
<el-button
class="btn-main"
type="primary"
:loading="submitLoading"
:disabled="rejectLoading"
@click="submitConfirm"
>
<el-icon><Check /></el-icon>
@@ -591,7 +600,7 @@
<script setup lang="ts">
import { ref, reactive, onMounted, computed } from 'vue'
import { ElMessage } from 'element-plus'
import { ElMessage, ElMessageBox } from 'element-plus'
import {
Close,
Check,
@@ -608,6 +617,7 @@
import ProtocolAttachmentReadonly from '@/views/cell-storage/protocol/ProtocolAttachmentReadonly.vue'
import {
confirmClinicalReceipt,
rejectClinicalReceipt,
fetchClinicalReceiptPending,
fetchClinicalReceiptConfirmed,
fetchClinicalRefundPending
@@ -654,6 +664,7 @@
const dialogVisible = ref(false)
const viewDialogVisible = ref(false)
const submitLoading = ref(false)
const rejectLoading = ref(false)
const currentDetailId = ref<string | null>(null)
const confirmRow = ref<Record<string, unknown> | null>(null)
const viewRow = ref<Record<string, unknown> | null>(null)
@@ -868,6 +879,26 @@
}
}
async function submitReject() {
if (!currentDetailId.value) return
try {
await ElMessageBox.confirm('确定退回?退回后状态将变为「待缴费」。', '退回确认', {
type: 'warning'
})
} catch {
return
}
rejectLoading.value = true
try {
await rejectClinicalReceipt(currentDetailId.value)
dialogVisible.value = false
await loadAll()
await loadTabPendingCounts()
} finally {
rejectLoading.value = false
}
}
watchDebounced(
[pendingSearchForm],
() => {
@@ -1563,13 +1563,14 @@
formData.salesUserId = u.id
}
async function remoteSearchSampleCodes(query: string) {
async function remoteSearchSampleCodes(query: string, codeFilter?: string) {
sampleCodeLoading.value = true
try {
const res = await fetchSampleCodeList({
page: 1,
pageSize: 100,
keyword: query?.trim() || undefined
keyword: query?.trim() || undefined,
codeFilter: codeFilter?.trim() || undefined
})
sampleCodeOptions.value = (res.list || []) as Api.BizSampleCode.SampleCodeItem[]
ensureSampleCodesInOptions(formData.samples)