This commit is contained in:
zlwu committed 2026-07-01 16:37:33 +08:00
1 parent 28f233c922
commit 038a60b09e
478 files changed
+67530 -51951

No files matched your search

@@ -51,6 +51,7 @@
<el-option label="生效中" value="sxz" />
<el-option label="已过期" value="ygq" />
<el-option label="已作废" value="yzf" />
<el-option label="属地废弃" value="sdfq" />
<el-option label="转科研" value="zky" />
</el-select>
</el-form-item>
@@ -92,7 +93,11 @@
</div>
<div class="form-grid form-grid--attachment">
<el-form-item label="协议附件">
<div class="attachment-upload">
<div
class="attachment-upload"
:class="{ 'is-dragover': isProtocolAttachDragover }"
v-bind="protocolAttachDropHandlers"
>
<div class="attachment-list">
<el-upload
ref="attachmentUploadRef"
@@ -159,7 +164,9 @@
</div>
</div>
</div>
<span class="upload-hint">支持图片、视频、PDF、Word、Excel等文件</span>
<span class="upload-hint"
>支持拖拽或点击上传图片、视频、PDF、Word、Excel等文件,单文件不超过 20MB</span
>
</div>
</el-form-item>
</div>
@@ -740,7 +747,11 @@
</div>
<!-- 每条明细的附件上传区 -->
<div v-if="!isPayDetailLocked(detail)" class="payment-detail-card__attachments">
<div class="attachment-upload">
<div
class="attachment-upload"
:class="{ 'is-dragover': isPaymentDetailDragover(dIdx) }"
v-bind="paymentDetailDropHandlers(dIdx)"
>
<div class="attachment-list">
<el-upload
:auto-upload="false"
@@ -808,7 +819,10 @@
</div>
</div>
</div>
<span class="upload-hint">支持图片、视频、PDF、Word、Excel等文件</span>
<span class="upload-hint"
>支持拖拽或点击上传图片、视频、PDF、Word、Excel等文件,单文件不超过
20MB</span
>
</div>
</div>
</div>
@@ -887,6 +901,10 @@
} from '@/api/collection-protocol'
import { fetchUploadAttachment } from '@/api/business'
import { downloadAttachmentFile } from '@/utils/download-attachment'
import {
useAttachmentDropZone,
useIndexedAttachmentDropZone
} from '@/composables/useAttachmentDropZone'
import { formatDatetimeToMinute } from '@/utils/chinese-datetime-parse'
import {
fetchCustomerList,
@@ -1600,6 +1618,7 @@
isEdit.value = false
dialogTitle.value = '新增协议单'
resetForm()
formData.protocolStatus = 'sxz'
formData.motherEthnic = DEFAULT_MOTHER_ETHNIC
formData.registerDate = new Date().toISOString().slice(0, 10).replace(/-/g, '')
void loadEthnicOptions()
@@ -2702,6 +2721,28 @@
formData.attachments.splice(index, 1)
}
const { isDragover: isProtocolAttachDragover, dropZoneHandlers: protocolAttachDropHandlers } =
useAttachmentDropZone({
onFiles: (files) => {
for (const file of files) {
void handleAttachmentChange({ raw: file })
}
}
})
const { isDragover: isPaymentDetailDragover, handlersFor: paymentDetailDropHandlers } =
useIndexedAttachmentDropZone({
onFiles: (detailIndex, files) => {
for (const file of files) {
void handleDetailAttachmentChange(detailIndex, { raw: file })
}
},
disabled: (detailIndex) => {
const detail = formData.paymentDetails[detailIndex]
return !detail || isPayDetailLocked(detail)
}
})
/* ====== 缴费明细附件上传 ====== */
async function handleDetailAttachmentChange(detailIndex: number, uploadFile: any) {
const file = uploadFile.raw || uploadFile
@@ -39,6 +39,16 @@
value-format="YYYY-MM-DD HH:mm:ss"
/>
</el-form-item>
<el-form-item v-if="actionType === 'void'" label="作废类型" prop="voidType">
<el-select v-model="form.voidType" placeholder="请选择作废类型" style="width: 100%">
<el-option
v-for="opt in voidTypeOptionsRef"
:key="opt.value"
:label="opt.label"
:value="opt.value"
/>
</el-select>
</el-form-item>
<el-form-item :label="descLabel">
<el-input
v-model="form.changeDesc"
@@ -72,6 +82,7 @@
import { fetchConvertFromStorage } from '@/api/research-donation'
import { withFullscreenLoading, fullscreenLoadingText } from '@/utils/fullscreen-loading'
import { formatProtocolDocSubject } from '@/utils/protocol-doc-label'
import { loadVoidTypeDict, voidTypeOptionsRef } from '@/utils/void-type-dict'
export type StatusChangeAction = 'activate' | 'expire' | 'void' | 'toResearch'
export type StatusChangeTarget = {
@@ -151,16 +162,31 @@
const submitting = ref(false)
const form = reactive({
changeTime: '',
changeDesc: ''
changeDesc: '',
voidType: ''
})
const rules: FormRules = {
changeTime: [{ required: true, message: '请选择时间', trigger: 'change' }]
}
const rules = computed<FormRules>(() => {
const base: FormRules = {
changeTime: [{ required: true, message: '请选择时间', trigger: 'change' }]
}
if (props.actionType === 'void') {
base.voidType = [{ required: true, message: '请选择作废类型', trigger: 'change' }]
}
return base
})
watch(
() => props.modelValue,
(visible) => {
if (visible && props.actionType === 'void') void loadVoidTypeDict()
}
)
function resetForm() {
form.changeTime = ''
form.changeDesc = ''
form.voidType = ''
formRef.value?.clearValidate()
}
@@ -222,6 +248,9 @@
[cfg.timeKey]: form.changeTime,
[cfg.descKey]: form.changeDesc.trim() || undefined
}
if (props.actionType === 'void') {
payload.voidType = form.voidType
}
submitting.value = true
try {
@@ -43,7 +43,7 @@
><el-tag
:type="protocolStatusTagType(String(protocol?.protocolStatus || ''))"
size="small"
>{{ protocolStatusLabel(String(protocol?.protocolStatus || '')) }}</el-tag
>{{ protocolStatusDisplayLabel(String(protocol?.protocolStatus || ''), String(protocol?.voidType || '')) }}</el-tag
></div
></div
>
@@ -89,6 +89,10 @@
>
</template>
<template v-if="protocol?.voidTime">
<div class="data-item"
><div class="data-label">作废类型</div
><div class="data-value">{{ voidTypeLabel(String(protocol?.voidType || '')) || '—' }}</div></div
>
<div class="data-item"
><div class="data-label">协议作废时间</div
><div class="data-value">{{ dash(protocol.voidTime) }}</div></div
@@ -200,6 +204,10 @@
>
</template>
<template v-if="protocol?.voidTime">
<div class="data-item"
><div class="data-label">作废类型</div
><div class="data-value">{{ voidTypeLabel(String(protocol?.voidType || '')) || '—' }}</div></div
>
<div class="data-item"
><div class="data-label">协议作废时间</div
><div class="data-value">{{ dash(protocol.voidTime) }}</div></div
@@ -283,7 +291,14 @@
<div class="data-grid data-grid--4">
<div class="data-item">
<div class="data-label">样本编码</div>
<div class="data-value data-value--code">{{ dash(row.sampleCode) }}</div>
<div class="data-value data-value--code">
<SampleCodeWithSpecialDisplay
:sample-code="row.sampleCode"
:is-special="!!row.isSpecial"
:special-remark="row.specialRemark"
monospace
/>
</div>
</div>
<div class="data-item">
<div class="data-label">原价格(元)</div>
@@ -1059,6 +1074,7 @@
import ProtocolAttachmentReadonly from './ProtocolAttachmentReadonly.vue'
import SampleQcInfoGroupedPanel from '@/components/business/sample-qc-info-grouped-panel/index.vue'
import SampleReceptionDualReadonlyPanel from '@/components/business/sample-reception-dual-readonly-panel/index.vue'
import SampleCodeWithSpecialDisplay from '@/components/business/sample-code-with-special-display/index.vue'
import SampleProductionInfoCards from '@/components/business/sample-production-info-cards/index.vue'
import SampleStorageReleaseInfo from '@/components/business/sample-storage-release-info/index.vue'
import {
@@ -1078,7 +1094,7 @@
import { downloadAttachmentFile } from '@/utils/download-attachment'
import { formatMoneyDisplay } from '@/utils/money-format'
import {
protocolStatusLabel,
protocolStatusDisplayLabel,
protocolStatusTagType,
auditStatusLabel,
payModeLabel,
@@ -1093,6 +1109,7 @@
acceptConclusionTagType
} from '@/utils/status-tag-registry'
import { loadTransferTypeDict, transferTypeLabel } from '@/utils/protocol-payment-labels'
import { loadVoidTypeDict, voidTypeLabel } from '@/utils/void-type-dict'
import { formatProtocolDocSubject } from '@/utils/protocol-doc-label'
const props = withDefaults(
@@ -1827,7 +1844,10 @@
watch(
() => [props.modelValue, props.protocolId] as const,
([visible, id]) => {
if (visible) void loadTransferTypeDict()
if (visible) {
void loadTransferTypeDict()
void loadVoidTypeDict()
}
if (visible && id) loadDetail()
}
)
@@ -3005,10 +3025,6 @@
grid-template-columns: 1fr;
}
.data-grid--4 {
grid-template-columns: repeat(2, minmax(0, 1fr));
}
.storage-cert-info-row.data-grid--3 {
grid-template-columns: repeat(2, minmax(0, 1fr));
@@ -28,6 +28,7 @@
<el-option label="生效中" value="sxz" />
<el-option label="已过期" value="ygq" />
<el-option label="已作废" value="yzf" />
<el-option label="属地废弃" value="sdfq" />
<el-option label="转科研" value="zky" />
</el-select>
</el-form-item>