提交
This commit is contained in:
1 parent
28f233c922
commit
038a60b09e
478 files changed
+67530
-51951
No files matched your search
@@ -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 {
|
||||
|
||||
Reference in new issue
Block a user