项目文档培训记录培训人数添加校验
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
84b1263340
commit
81bef8abe0
|
@ -1,101 +1,45 @@
|
|||
<template>
|
||||
<base-model :config="config">
|
||||
<div slot="dialog-body">
|
||||
<el-form
|
||||
ref="trainRecordForm"
|
||||
:model="form"
|
||||
label-width="140px"
|
||||
size="small"
|
||||
:rules="rules"
|
||||
>
|
||||
<el-form ref="trainRecordForm" :model="form" label-width="140px" size="small" :rules="rules">
|
||||
<div class="base-dialog-body">
|
||||
<el-form-item
|
||||
v-if="!config.upload"
|
||||
:label="$t('trials:trialDocument:trainRecord:form:TrianingDate')"
|
||||
prop="TrianingDate"
|
||||
>
|
||||
<el-date-picker
|
||||
v-model="form.TrianingDate"
|
||||
type="date"
|
||||
placeholder=""
|
||||
format="yyyy-MM-dd"
|
||||
value-format="yyyy-MM-dd"
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-form-item v-if="!config.upload" :label="$t('trials:trialDocument:trainRecord:form:TrianingDate')"
|
||||
prop="TrianingDate">
|
||||
<el-date-picker v-model="form.TrianingDate" type="date" placeholder="" format="yyyy-MM-dd"
|
||||
value-format="yyyy-MM-dd" style="width: 100%">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
v-if="!config.upload"
|
||||
:label="$t('trials:trialDocument:trainRecord:form:TrianingCount')"
|
||||
prop="TrianingCount"
|
||||
>
|
||||
<el-input v-model="form.TrianingCount" />
|
||||
<el-form-item v-if="!config.upload" :label="$t('trials:trialDocument:trainRecord:form:TrianingCount')"
|
||||
prop="TrianingCount">
|
||||
<el-input v-model="form.TrianingCount" type="number" />
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
v-if="!config.upload"
|
||||
:label="$t('trials:trialDocument:trainRecord:form:TrianingState')"
|
||||
prop="TrianingState"
|
||||
>
|
||||
<el-form-item v-if="!config.upload" :label="$t('trials:trialDocument:trainRecord:form:TrianingState')"
|
||||
prop="TrianingState">
|
||||
<el-input v-model="form.TrianingState" />
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
v-if="!config.upload"
|
||||
:label="$t('trials:trialDocument:trainRecord:form:Note')"
|
||||
prop="Note"
|
||||
>
|
||||
<el-form-item v-if="!config.upload" :label="$t('trials:trialDocument:trainRecord:form:Note')" prop="Note">
|
||||
<el-input v-model="form.Note" />
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
v-if="!config.upload || config.upload === 'Trial'"
|
||||
:label="$t('trials:trialDocument:trainRecord:form:TrialFileRecord')"
|
||||
prop="TrialFileRecord"
|
||||
>
|
||||
<el-upload
|
||||
class="upload-demo"
|
||||
action
|
||||
:before-upload="(param) => beforeUpload(param, 'Trial', '.pdf')"
|
||||
:http-request="(param) => handleUploadFile(param, 'Trial')"
|
||||
:on-remove="() => handleRemoveFile('Trial')"
|
||||
:limit="1"
|
||||
accept=".pdf"
|
||||
:file-list="TrialFile"
|
||||
>
|
||||
<el-button
|
||||
size="small"
|
||||
type="primary"
|
||||
:disabled="
|
||||
!!form.TrialFileRecord && !!form.TrialFileRecord.FilePath
|
||||
"
|
||||
>{{ $t('common:button:upload') }}
|
||||
<el-form-item v-if="!config.upload || config.upload === 'Trial'"
|
||||
:label="$t('trials:trialDocument:trainRecord:form:TrialFileRecord')" prop="TrialFileRecord">
|
||||
<el-upload class="upload-demo" action :before-upload="(param) => beforeUpload(param, 'Trial', '.pdf')"
|
||||
:http-request="(param) => handleUploadFile(param, 'Trial')" :on-remove="() => handleRemoveFile('Trial')"
|
||||
:limit="1" accept=".pdf" :file-list="TrialFile">
|
||||
<el-button size="small" type="primary" :disabled="!!form.TrialFileRecord && !!form.TrialFileRecord.FilePath
|
||||
">{{ $t('common:button:upload') }}
|
||||
</el-button>
|
||||
<span slot="tip" class="el-upload__tip">
|
||||
{{ $t('trials:trialDocument:trainRecord:rule:mustPDF') }}
|
||||
</span>
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
v-if="!config.upload || config.upload === 'History'"
|
||||
:label="
|
||||
$t('trials:trialDocument:trainRecord:form:historyFileRecord')
|
||||
"
|
||||
>
|
||||
<el-upload
|
||||
class="upload-demo"
|
||||
action
|
||||
:before-upload="(param) => beforeUpload(param, 'History', '.zip')"
|
||||
<el-form-item v-if="!config.upload || config.upload === 'History'" :label="$t('trials:trialDocument:trainRecord:form:historyFileRecord')
|
||||
">
|
||||
<el-upload class="upload-demo" action :before-upload="(param) => beforeUpload(param, 'History', '.zip')"
|
||||
:http-request="(param) => handleUploadFile(param, 'History')"
|
||||
:on-remove="() => handleRemoveFile('History')"
|
||||
:limit="1"
|
||||
accept=".zip"
|
||||
:file-list="HistoryFile"
|
||||
>
|
||||
<el-button
|
||||
size="small"
|
||||
type="primary"
|
||||
:disabled="
|
||||
!!form.HistoryFileRecord && !!form.HistoryFileRecord.FilePath
|
||||
"
|
||||
>{{ $t('common:button:upload') }}
|
||||
:on-remove="() => handleRemoveFile('History')" :limit="1" accept=".zip" :file-list="HistoryFile">
|
||||
<el-button size="small" type="primary" :disabled="!!form.HistoryFileRecord && !!form.HistoryFileRecord.FilePath
|
||||
">{{ $t('common:button:upload') }}
|
||||
</el-button>
|
||||
<span slot="tip" class="el-upload__tip">
|
||||
{{ $t('trials:trialDocument:trainRecord:rule:mustZIP') }}
|
||||
|
@ -165,6 +109,36 @@ export default {
|
|||
trigger: ['blur', 'change'],
|
||||
},
|
||||
],
|
||||
TrianingCount: [
|
||||
{
|
||||
type: 'number',
|
||||
min: 0,
|
||||
message: this.$t(
|
||||
'trials:trialDocument:trainRecord:ruleMessage:TrianingCountPattern'
|
||||
),
|
||||
trigger: 'blur',
|
||||
},
|
||||
{
|
||||
validator: (rule, value, callback) => {
|
||||
if (
|
||||
value &&
|
||||
(String(value).includes('.') ||
|
||||
new RegExp(/\D/g).test(String(value)))
|
||||
) {
|
||||
callback(
|
||||
new Error(
|
||||
this.$t(
|
||||
'trials:trialDocument:trainRecord:ruleMessage:TrianingCountPatternS'
|
||||
)
|
||||
)
|
||||
)
|
||||
} else {
|
||||
callback()
|
||||
}
|
||||
},
|
||||
trigger: 'blur',
|
||||
},
|
||||
]
|
||||
},
|
||||
loading: false,
|
||||
TrialFile: [],
|
||||
|
|
Loading…
Reference in New Issue