|
@@ -12,7 +12,7 @@
|
|
|
<el-input type="textarea" :rows="3" v-model="formData.ApplyRemark" />
|
|
<el-input type="textarea" :rows="3" v-model="formData.ApplyRemark" />
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<el-form-item label="附件" prop="Attachment">
|
|
<el-form-item label="附件" prop="Attachment">
|
|
|
- <app-upload />
|
|
|
|
|
|
|
+ <app-upload :file-types="['image']" type-message="请选择正确的图片类型" @change="onUploadChange" />
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-form>
|
|
</el-form>
|
|
|
<template #footer>
|
|
<template #footer>
|
|
@@ -44,7 +44,21 @@ const refresh = ref(false)
|
|
|
const formRef = ref<FormInstance>()
|
|
const formRef = ref<FormInstance>()
|
|
|
|
|
|
|
|
const formRules: FormRules = {
|
|
const formRules: FormRules = {
|
|
|
- ApplyRemark: [{ required: true, message: '请输入备注', trigger: 'blur' }],
|
|
|
|
|
|
|
+ Attachment: [{
|
|
|
|
|
+ required: true,
|
|
|
|
|
+ validator: (rule, value, callback) => {
|
|
|
|
|
+ if (formData.Attachment) {
|
|
|
|
|
+ callback()
|
|
|
|
|
+ } else {
|
|
|
|
|
+ callback(new Error('请上传附件'))
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }],
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+const onUploadChange = (file: { filePath: string }) => {
|
|
|
|
|
+ formData.Attachment = file.filePath
|
|
|
|
|
+ formRef.value?.validateField('Attachment')
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
const onCancel = (isRefresh = false) => {
|
|
const onCancel = (isRefresh = false) => {
|