提交
This commit is contained in:
1 parent
0e60b88cba
commit
87f7f6bf38
34 files changed
+18326
-6165
No files matched your search
@@ -311,6 +311,7 @@
|
||||
upload-folder="pl/personnel-cert"
|
||||
:cert-name-options="certNameOptions"
|
||||
:required-cert-names="requiredPersonnelCertNames"
|
||||
:strip-managed-cert-names="PL_PERSONNEL_BOTH_REQUIRED_CERT_NAMES"
|
||||
layout="table"
|
||||
/>
|
||||
</el-form>
|
||||
@@ -388,6 +389,7 @@ import {
|
||||
getPersonnelAffiliationLabel,
|
||||
getPersonnelAffiliationTagType,
|
||||
PL_PERSONNEL_AFFILIATION_OPTIONS,
|
||||
PL_PERSONNEL_BOTH_REQUIRED_CERT_NAMES,
|
||||
PL_PERSONNEL_TYPE_OPTIONS
|
||||
} from '@/utils/pl-personnel-cert'
|
||||
|
||||
@@ -431,8 +433,8 @@ const viewDetail = ref<PersonnelDetail | null>(null)
|
||||
const certNameOptions = [
|
||||
'身份证',
|
||||
'驾驶证',
|
||||
'从业资格证',
|
||||
'危化品从业资格证',
|
||||
'驾驶员从业资格证',
|
||||
'押运员从业资格证',
|
||||
'押运员证',
|
||||
'健康证'
|
||||
]
|
||||
@@ -462,9 +464,20 @@ const formData = reactive({
|
||||
})
|
||||
|
||||
const requiredPersonnelCertNames = computed(() =>
|
||||
getRequiredPersonnelCertNamesByType(formData.personnelType)
|
||||
formData.personnelType
|
||||
? getRequiredPersonnelCertNamesByType(formData.personnelType)
|
||||
: []
|
||||
)
|
||||
|
||||
function mergePersonnelCertSlots(list: CertListItem[]) {
|
||||
if (!formData.personnelType) return list
|
||||
return mergeCertListWithRequiredSlots(
|
||||
list,
|
||||
getRequiredPersonnelCertNamesByType(formData.personnelType),
|
||||
{ stripManagedNames: PL_PERSONNEL_BOTH_REQUIRED_CERT_NAMES }
|
||||
)
|
||||
}
|
||||
|
||||
const formRules = {
|
||||
personnelName: [{ required: true, message: '请输入姓名', trigger: 'blur' }],
|
||||
personnelAffiliation: [{ required: true, message: '请选择人员归属', trigger: 'change' }],
|
||||
@@ -575,10 +588,7 @@ watch(
|
||||
() => formData.personnelType,
|
||||
() => {
|
||||
if (!formData.personnelType) return
|
||||
certList.value = mergeCertListWithRequiredSlots(
|
||||
certList.value,
|
||||
getRequiredPersonnelCertNamesByType(formData.personnelType)
|
||||
)
|
||||
certList.value = mergePersonnelCertSlots(certList.value)
|
||||
certFormListRef.value?.refreshRequiredSlots?.()
|
||||
}
|
||||
)
|
||||
@@ -715,7 +725,7 @@ async function handleEdit(row: Personnel) {
|
||||
status: detail.status,
|
||||
remark: detail.remark || ''
|
||||
})
|
||||
certList.value = mergeCertListWithRequiredSlots(
|
||||
certList.value = mergePersonnelCertSlots(
|
||||
(detail.certList || []).map(c => ({
|
||||
_key: c.id || c.certId || `cert-${Math.random().toString(36).slice(2, 10)}`,
|
||||
certId: c.id || c.certId,
|
||||
@@ -724,8 +734,7 @@ async function handleEdit(row: Personnel) {
|
||||
expireDate: c.expireDate,
|
||||
remindDays: c.remindDays ?? 30,
|
||||
attachmentUrls: c.attachmentUrls || ''
|
||||
})),
|
||||
getRequiredPersonnelCertNamesByType(detail.personnelType || 'both')
|
||||
}))
|
||||
)
|
||||
certFormListRef.value?.refreshRequiredSlots?.()
|
||||
} catch {
|
||||
|
||||
@@ -19,6 +19,14 @@
|
||||
@keyup.enter="handleSearch"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="产品名称">
|
||||
<el-input
|
||||
v-model="searchForm.productName"
|
||||
placeholder="搜索产品名称"
|
||||
clearable
|
||||
@keyup.enter="handleSearch"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="跟进状态">
|
||||
<el-select v-model="searchForm.followStatus" placeholder="全部" clearable>
|
||||
<el-option label="草稿" value="draft" />
|
||||
@@ -398,8 +406,9 @@ const activePlanTypeTab = ref<PlPlanTypeTab>('all')
|
||||
const searchForm = reactive({
|
||||
planNo: '',
|
||||
planType: '',
|
||||
productName: '',
|
||||
followStatus: '',
|
||||
transportStatus: '',
|
||||
transportStatus: 'arranged',
|
||||
customerName: '',
|
||||
archiveStatus: ''
|
||||
})
|
||||
@@ -451,6 +460,7 @@ async function fetchData() {
|
||||
followStatus: searchForm.followStatus || undefined,
|
||||
transportStatus: searchForm.transportStatus || undefined,
|
||||
customerName: keyword ? undefined : searchForm.customerName || undefined,
|
||||
productName: keyword ? undefined : searchForm.productName || undefined,
|
||||
archiveStatus: searchForm.archiveStatus || undefined,
|
||||
planDateFrom: dateRange.value?.[0] || undefined,
|
||||
planDateTo: dateRange.value?.[1] || undefined,
|
||||
@@ -480,8 +490,9 @@ function handleReset() {
|
||||
activePlanTypeTab.value = 'all'
|
||||
searchForm.planNo = ''
|
||||
searchForm.planType = ''
|
||||
searchForm.productName = ''
|
||||
searchForm.followStatus = ''
|
||||
searchForm.transportStatus = ''
|
||||
searchForm.transportStatus = 'arranged'
|
||||
searchForm.customerName = ''
|
||||
searchForm.archiveStatus = ''
|
||||
quickSearch.value = ''
|
||||
@@ -581,6 +592,7 @@ useDbInstantSearch(
|
||||
() => ({
|
||||
planNo: searchForm.planNo,
|
||||
planType: searchForm.planType,
|
||||
productName: searchForm.productName,
|
||||
followStatus: searchForm.followStatus,
|
||||
transportStatus: searchForm.transportStatus,
|
||||
customerName: searchForm.customerName,
|
||||
|
||||
Reference in new issue
Block a user