31 lines
1.3 KiB
JavaScript
31 lines
1.3 KiB
JavaScript
export default {
|
|
key: 'sample',
|
|
resource: 'samples',
|
|
readOnlySources: ['research_donation'],
|
|
actions: { specialist: ['view', 'storage-cert', 'insurance'], manager: ['view', 'storage-cert', 'insurance'] },
|
|
listParams: ({ status } = {}) => ({ status: status || '' }),
|
|
statusOptions: [{ text: '全部状态', value: '' }],
|
|
formOptionsParams(sampleId) {
|
|
return { sampleId: String(sampleId || '').trim() }
|
|
},
|
|
initialForm(detail, action) {
|
|
const handles = (detail?.sections || []).find((section) => section.key === 'market-handles') || {}
|
|
const handle = action === 'insurance' ? handles.insurance || {} : handles.storageCert || {}
|
|
const fields = ['handleTime', 'handlerUserId', 'attachments', 'remark']
|
|
return {
|
|
handle: Object.fromEntries(fields
|
|
.filter((key) => Object.prototype.hasOwnProperty.call(handle, key))
|
|
.map((key) => [key, handle[key]]))
|
|
}
|
|
},
|
|
detailSections(detail) {
|
|
return Array.isArray(detail?.sections) ? detail.sections : []
|
|
},
|
|
handleFields: [
|
|
{ key: 'handleTime', label: '办理时间', type: 'datetime' },
|
|
{ key: 'handlerUserId', label: '办理人员', type: 'select', optionKey: 'users' },
|
|
{ key: 'attachments', label: '附件', type: 'upload' },
|
|
{ key: 'remark', label: '备注', type: 'textarea' }
|
|
]
|
|
}
|