98 lines
3.0 KiB
Vue

<template>
<el-form ref="formRef" :model="formData" label-width="110px" :rules="formRules">
<el-row>
<el-col :span="8">
<el-form-item label="文件名称" prop="wjmc">
<el-input v-model="formData.wjmc" clearable placeholder="请输入文件名称" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="紧急程度" prop="jjcd">
<el-select v-model="formData.jjcd" placeholder="请选择紧急程度" class="flex-1">
<el-option :label="item" :value="item" v-for="(item, index) in qjlxList" :key="index">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="来文单位">
<el-input v-model="formData.lwdw" clearable placeholder="请输入来文单位" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="来文日期" prop="lwrq">
<el-date-picker class="flex-1 !flex" v-model="formData.lwrq" clearable type="datetime"
value-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择来文日期">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="文件摘要" prop="wjzy">
<el-input v-model="formData.wjzy" clearable placeholder="请输入文件摘要" type="textarea" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="备注">
<el-input v-model="formData.bz" clearable placeholder="请输入备注" type="textarea" />
</el-form-item>
</el-col>
</el-row>
</el-form>
</template>
<script setup>
const qjlxList = reactive(['普通', '紧急', '特急'])
let props = defineProps({
formData: Object,
})
const formRef = ref(null)
// 表单验证
const formRules = reactive({
wjmc: [{
required: true,
message: '不可为空',
trigger: ['blur']
}],
lwdw: [{
required: true,
message: '不可为空',
trigger: ['blur']
}],
lwrq: [{
required: true,
message: '不可为空',
trigger: ['blur']
}],
wjzy: [{
required: true,
message: '不可为空',
trigger: ['blur']
}],
kssj: [{
required: true,
message: '不可为空',
trigger: ['blur']
}],
jssj: [{
required: true,
message: '不可为空',
trigger: ['blur']
}],
jjcd: [{
required: true,
message: '不可为空',
trigger: ['blur']
}],
})
const check = async () => {
await formRef.value?.validate();
}
defineExpose({
check
});
</script>