feat: 细胞存储缴费催缴、统一样本信息与协议支付能力增强

汇总近期业务改动:催缴菜单与后端、样本信息快捷登记与进度、运费关联、客户档案扩展、协议优惠/期次与押金划转,并同步 SQL 迁移与管理端页面收敛。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
zlwuandCursor committed 2026-10-10 21:20:37 +08:00
1 parent 2d3472f5c4
commit db31990ebe
235 files changed
+14898 -10196

No files matched your search

@@ -7,10 +7,11 @@
v-for="(file, index) in files"
:key="file.id || file.fileUrl || index"
class="attachment-item"
:class="{ 'is-compact': size === 'compact' }"
>
<div
class="attachment-preview"
@click="isImageFile(file) && file.fileUrl ? emit('preview', file) : undefined"
@click="file.fileUrl ? emit('preview', file) : undefined"
>
<template v-if="isImageFile(file) && file.fileUrl">
<img :src="resolveFileUrl(file.fileUrl)" :alt="file.fileName" />
@@ -44,9 +45,13 @@
<script setup lang="ts">
import { Document, Download, VideoPlay } from '@element-plus/icons-vue'
defineProps<{
files: Array<Record<string, any>>
}>()
withDefaults(
defineProps<{
files: Array<Record<string, any>>
size?: 'default' | 'compact'
}>(),
{ size: 'default' }
)
const emit = defineEmits<{
(e: 'preview', file: Record<string, any>): void
@@ -205,4 +210,28 @@
color: #fff;
}
}
.attachment-item.is-compact {
width: 88px;
.attachment-preview {
height: 64px;
}
.attachment-preview__icon {
width: 32px;
height: 32px;
border-radius: 8px;
}
.attachment-footer {
padding: 4px 6px;
}
.attachment-name {
-webkit-line-clamp: 1;
min-height: 0;
font-size: 10px;
}
}
</style>
@@ -1,50 +1,64 @@
<!-- 采集协议单 · 退费登记弹窗(列表工具栏入口) -->
<template>
<div class="refund-record-block">
<div class="section-subtitle-row">
<div class="section-subtitle">退费登记</div>
<el-button type="primary" size="small" :disabled="!protocolId" @click="openCreate">
<el-icon><Plus /></el-icon>
新增登记
</el-button>
</div>
<p v-if="!protocolId" class="muted-hint">保存协议后可登记退费(不触发财务退费确认)</p>
<el-dialog
:model-value="modelValue"
:title="dialogTitle"
width="720px"
align-center
append-to-body
destroy-on-close
class="dialog-form-layout"
modal-class="protocol-dialog-mask"
@update:model-value="emit('update:modelValue', $event)"
@opened="loadRecords"
@closed="onClosed"
>
<div class="refund-record-dialog">
<div class="toolbar-row">
<p class="muted-hint">登记退费仅作记录,不触发财务退费确认流程</p>
<el-button type="primary" size="small" :disabled="!protocolId" @click="openCreate">
<el-icon><Plus /></el-icon>
新增登记
</el-button>
</div>
<el-table v-if="records.length" :data="records" class="list-table" stripe>
<el-table-column prop="refundAmount" label="退费金额(元)" min-width="120">
<template #default="{ row }">{{ fmtMoney(row.refundAmount) }}</template>
</el-table-column>
<el-table-column prop="refundTime" label="退费时间" min-width="160" />
<el-table-column prop="refundRemark" label="备注" min-width="180" show-overflow-tooltip />
<el-table-column label="附件" min-width="100">
<template #default="{ row }">
{{ (row.refundAttachmentFiles || []).length || (row.refundAttachments ? 1 : 0) }} 个
</template>
</el-table-column>
<el-table-column label="操作" min-width="140" fixed="right">
<template #default="{ row }">
<el-button link type="primary" size="small" @click="openEdit(row)">
<el-icon><Edit /></el-icon>
编辑
</el-button>
<el-button link type="danger" size="small" @click="onDelete(row)">
<el-icon><Delete /></el-icon>
删除
</el-button>
</template>
</el-table-column>
</el-table>
<el-empty v-else description="暂无退费登记" :image-size="40" />
<el-table v-if="records.length" v-loading="loading" :data="records" class="list-table" stripe>
<el-table-column prop="refundAmount" label="退费金额(元)" min-width="120">
<template #default="{ row }">{{ fmtMoney(row.refundAmount) }}</template>
</el-table-column>
<el-table-column prop="refundTime" label="退费时间" min-width="160" />
<el-table-column prop="refundRemark" label="备注" min-width="180" show-overflow-tooltip />
<el-table-column label="附件" min-width="100">
<template #default="{ row }">
{{ (row.refundAttachmentFiles || []).length || (row.refundAttachments ? 1 : 0) }} 个
</template>
</el-table-column>
<el-table-column label="操作" min-width="140" fixed="right">
<template #default="{ row }">
<el-button link type="primary" size="small" @click="openEdit(row)">
<el-icon><Edit /></el-icon>
编辑
</el-button>
<el-button link type="danger" size="small" @click="onDelete(row)">
<el-icon><Delete /></el-icon>
删除
</el-button>
</template>
</el-table-column>
</el-table>
<el-empty v-else v-loading="loading" description="暂无退费登记" :image-size="48" />
</div>
<el-dialog
v-model="dialogVisible"
v-model="formVisible"
:title="editingId ? '编辑退费登记' : '新增退费登记'"
width="560px"
align-center
append-to-body
destroy-on-close
class="dialog-form-layout"
modal-class="order-module-dialog-mask"
@closed="resetDialog"
modal-class="protocol-dialog-mask"
@closed="resetForm"
>
<el-form label-position="top" class="dialog-form-body">
<div class="form-grid-2">
@@ -104,7 +118,7 @@
</div>
</el-form>
<template #footer>
<el-button class="btn-ghost" @click="dialogVisible = false">
<el-button class="btn-ghost" @click="formVisible = false">
<el-icon><Close /></el-icon>
取消
</el-button>
@@ -114,11 +128,11 @@
</el-button>
</template>
</el-dialog>
</div>
</el-dialog>
</template>
<script setup lang="ts">
import { onMounted, reactive, ref, watch } from 'vue'
import { computed, reactive, ref } from 'vue'
import { Plus, Edit, Delete, Close, Check } from '@element-plus/icons-vue'
import AmountInput from '@/components/common/amount-input/index.vue'
import { formatMoneyDisplay } from '@/utils/money-format'
@@ -131,11 +145,19 @@
} from '@/api/protocol-sample-payment'
const props = defineProps<{
modelValue: boolean
protocolId?: string
/** 展示在标题中的协议标识,如母亲姓名 / 协议号 */
protocolLabel?: string
}>()
const emit = defineEmits<{
'update:modelValue': [boolean]
}>()
const records = ref<Array<Record<string, any>>>([])
const dialogVisible = ref(false)
const loading = ref(false)
const formVisible = ref(false)
const editingId = ref('')
const saving = ref(false)
const form = reactive({
@@ -145,6 +167,11 @@
attachments: [] as Array<Record<string, any>>
})
const dialogTitle = computed(() => {
const label = String(props.protocolLabel || '').trim()
return label ? `退费登记 · ${label}` : '退费登记'
})
function fmtMoney(v: unknown) {
if (v == null || v === '') return '—'
return formatMoneyDisplay(v)
@@ -155,14 +182,19 @@
records.value = []
return
}
const res = await fetchProtocolRefundRecords(props.protocolId)
records.value = Array.isArray(res) ? res : []
loading.value = true
try {
const res = await fetchProtocolRefundRecords(props.protocolId)
records.value = Array.isArray(res) ? res : []
} finally {
loading.value = false
}
}
function openCreate() {
editingId.value = ''
resetDialog()
dialogVisible.value = true
resetForm()
formVisible.value = true
}
function openEdit(row: Record<string, any>) {
@@ -173,16 +205,23 @@
form.attachments = Array.isArray(row.refundAttachmentFiles)
? [...row.refundAttachmentFiles]
: []
dialogVisible.value = true
formVisible.value = true
}
function resetDialog() {
function resetForm() {
form.refundAmount = null
form.refundTime = ''
form.refundRemark = ''
form.attachments = []
}
function onClosed() {
records.value = []
formVisible.value = false
editingId.value = ''
resetForm()
}
async function onFileChange(uploadFile: any) {
const raw = uploadFile?.raw as File | undefined
if (!raw) return
@@ -227,7 +266,7 @@
} else {
await fetchCreateProtocolRefundRecord(props.protocolId, payload)
}
dialogVisible.value = false
formVisible.value = false
await loadRecords()
} finally {
saving.value = false
@@ -240,47 +279,27 @@
await fetchDeleteProtocolRefundRecord(String(row.id))
await loadRecords()
}
watch(
() => props.protocolId,
() => {
loadRecords()
}
)
onMounted(loadRecords)
</script>
<style scoped lang="scss">
.section-subtitle-row {
display: flex;
align-items: center;
justify-content: space-between;
margin: 16px 0 8px;
.refund-record-dialog {
min-height: 160px;
}
.section-subtitle {
font-size: 13px;
font-weight: 600;
color: var(--mint-text-secondary, #475569);
.toolbar-row {
display: flex;
gap: 12px;
align-items: center;
justify-content: space-between;
margin-bottom: 12px;
}
.muted-hint {
margin: 0 0 8px;
margin: 0;
font-size: 12px;
color: var(--mint-text-muted, #94a3b8);
}
.form-grid-2 {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
gap: 8px 12px;
}
.form-col-span-2 {
grid-column: 1 / -1;
}
.attachment-list {
display: flex;
flex-wrap: wrap;
@@ -3,10 +3,6 @@
<template>
<div class="page-container">
<section class="panel">
<div class="panel-top">
<h2>协议单列表</h2>
</div>
<div class="filter-block">
<el-form :model="searchForm" class="filter-form" @submit.prevent>
<div class="filter-grid">
@@ -78,6 +74,14 @@
<el-icon><Plus /></el-icon>
新增
</el-button>
<el-button
class="btn-ghost"
:disabled="selectedRows.length !== 1"
@click="openRefundDialog"
>
<el-icon><Coin /></el-icon>
退费登记
</el-button>
<el-button class="btn-ghost" :disabled="!selectedRows.length" @click="handleBatchDelete">
<el-icon><Delete /></el-icon>
批量删除
@@ -211,7 +215,7 @@
/>
<el-table-column
prop="salesUserName"
label="销售人员"
label="市场专员"
min-width="100"
align="center"
header-align="center"
@@ -292,6 +296,12 @@
show-storage-cert
show-fullmoon-insurance
/>
<ProtocolRefundRecordDialog
v-model="refundDialogVisible"
:protocol-id="refundProtocolId"
:protocol-label="refundProtocolLabel"
/>
</section>
</div>
</template>
@@ -299,9 +309,10 @@
<script setup lang="ts">
import { formatDisplayOrDash } from '@/utils/datetime-display'
import { ElMessage, ElMessageBox } from 'element-plus'
import { Plus, View, Edit, Delete, Search, RefreshLeft, More } from '@element-plus/icons-vue'
import { Plus, View, Edit, Delete, Search, RefreshLeft, More, Coin } from '@element-plus/icons-vue'
import ProtocolFormDialog from './ProtocolFormDialog.vue'
import ProtocolViewDialog from './ProtocolViewDialog.vue'
import ProtocolRefundRecordDialog from './ProtocolRefundRecordDialog.vue'
import { withFullscreenLoading, fullscreenLoadingText } from '@/utils/fullscreen-loading'
import {
fetchCollectionProtocolList,
@@ -404,6 +415,24 @@
loadData()
}
/* ====== 退费登记 ====== */
const refundDialogVisible = ref(false)
const refundProtocolId = ref('')
const refundProtocolLabel = ref('')
function openRefundDialog() {
if (selectedRows.value.length !== 1) {
ElMessage.warning('请先勾选一条协议单再登记退费')
return
}
const row = selectedRows.value[0]
refundProtocolId.value = String(row.id || '')
const name = String(row.motherName || '').trim()
const no = String(row.protocolNo || '').trim()
refundProtocolLabel.value = [name, no].filter(Boolean).join(' / ')
refundDialogVisible.value = true
}
/* ====== 删除 ====== */
function handleDropdownCommand(cmd: string, row: CollectionProtocolRow) {
if (cmd === 'edit') handleEdit(row)