bugfix
This commit is contained in:
239
src/views/components/AgentForm/index.vue
Normal file
239
src/views/components/AgentForm/index.vue
Normal file
@ -0,0 +1,239 @@
|
||||
<template>
|
||||
<el-form
|
||||
ref="formRef"
|
||||
:label-width="labelWidth + 'px'"
|
||||
:model="modelValue"
|
||||
:rules="rules"
|
||||
>
|
||||
<div v-if="showTitle" class="form_title">基本信息</div>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="姓名:" prop="name">
|
||||
<el-input v-model="modelValue.name"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="手机号:" prop="mobile">
|
||||
<el-input v-model="modelValue.mobile"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="身份证号:" prop="id_card">
|
||||
<el-input v-model="modelValue.id_card"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="工作所在地:" prop="work_place">
|
||||
<el-input v-model="modelValue.work_place"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="工作经历:" prop="work_experience">
|
||||
<el-input
|
||||
v-model="modelValue.work_experience"
|
||||
:autosize="{ minRows: 2, maxRows: 10 }"
|
||||
type="textarea"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<InputBoxAdd
|
||||
ref="researchsFormRef"
|
||||
v-model="modelValue"
|
||||
:labelWidth="labelWidth"
|
||||
fieldKey="researchs"
|
||||
placeholder="请输入擅长领域"
|
||||
title="擅长领域"
|
||||
/>
|
||||
|
||||
<InputBoxAdd
|
||||
ref="keywordsFormRef"
|
||||
v-model="modelValue"
|
||||
:labelWidth="labelWidth"
|
||||
fieldKey="keywords"
|
||||
placeholder="应用场景关键词+技术产品关键词"
|
||||
title="关键词"
|
||||
/>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="身份证:" required>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-form-item prop="id_image.front">
|
||||
<ImageUpload
|
||||
v-model="modelValue.id_image.front"
|
||||
:isShowTip="false"
|
||||
:limit="1"
|
||||
/>
|
||||
</el-form-item>
|
||||
<div style="text-align: center">身份证人像面</div>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item prop="id_image.behind">
|
||||
<ImageUpload
|
||||
v-model="modelValue.id_image.behind"
|
||||
:isShowTip="false"
|
||||
:limit="1"
|
||||
/>
|
||||
</el-form-item>
|
||||
<div style="text-align: center">身份证国徽面</div>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item prop="id_image.hold">
|
||||
<ImageUpload
|
||||
v-model="modelValue.id_image.hold"
|
||||
:isShowTip="false"
|
||||
:limit="1"
|
||||
/>
|
||||
</el-form-item>
|
||||
<div style="text-align: center">手持身份证人像面</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="成果经纪资格证书:" prop="credential_image">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<ImageUpload
|
||||
v-model="modelValue.credential_image"
|
||||
:isShowTip="false"
|
||||
:limit="1"
|
||||
/>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</template>
|
||||
<script setup>
|
||||
import InputBoxAdd from "../InputBoxAdd";
|
||||
import {ref} from "vue";
|
||||
|
||||
const formRef = ref()
|
||||
const researchsFormRef = ref()
|
||||
const keywordsFormRef = ref()
|
||||
const props = defineProps({
|
||||
modelValue: Object,
|
||||
isAdd: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
showTitle: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
labelWidth: {
|
||||
type: Number,
|
||||
default: 120,
|
||||
},
|
||||
})
|
||||
const rules = {
|
||||
product: [{required: true, message: "请输入", trigger: "blur"}],
|
||||
name: [{required: true, message: "请输入", trigger: "blur"}],
|
||||
kind: [{required: true, message: "请选择", trigger: "change"}],
|
||||
code: [{required: true, message: "请输入", trigger: "blur"}],
|
||||
mobile: [
|
||||
{required: true, message: "请输入", trigger: "blur"},
|
||||
{
|
||||
pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
|
||||
message: "请输入正确的手机号码",
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
id_card: [{required: true, message: "请输入", trigger: "blur"}],
|
||||
work_place: [{required: true, message: "请输入", trigger: "blur"}],
|
||||
work_experience: [
|
||||
{required: true, message: "请输入", trigger: "blur"},
|
||||
],
|
||||
"id_image.front": [
|
||||
{
|
||||
required: true,
|
||||
message: "请上传",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
],
|
||||
"id_image.behind": [
|
||||
{
|
||||
required: true,
|
||||
message: "请上传",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
],
|
||||
"id_image.hold": [
|
||||
{
|
||||
required: true,
|
||||
message: "请上传",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
],
|
||||
}
|
||||
|
||||
|
||||
const validateForm = async () => {
|
||||
let formValid;
|
||||
try {
|
||||
formValid = await formRef.value.validate();
|
||||
} catch (error) {
|
||||
formValid = false;
|
||||
}
|
||||
const researchsFormValid = await researchsFormRef.value.validateForm();
|
||||
const keywordsFormValid = await keywordsFormRef.value.validateForm();
|
||||
return (
|
||||
formValid &&
|
||||
researchsFormValid &&
|
||||
keywordsFormValid
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
defineExpose({
|
||||
validateForm
|
||||
})
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.form_title {
|
||||
font-weight: 700;
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
|
||||
|
||||
:deep(.hide) {
|
||||
height: 148px;
|
||||
}
|
||||
|
||||
|
||||
// 上传图片框限制
|
||||
// ::v-deep .el-upload--picture-card {
|
||||
// width: 120px;
|
||||
// height: 120px;
|
||||
// line-height: 120px;
|
||||
// }
|
||||
.el-select,
|
||||
.el-date-editor {
|
||||
display: block;
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
@ -287,13 +287,7 @@ const data = reactive({
|
||||
trigger: ["change", "blur"],
|
||||
},
|
||||
],
|
||||
license: [
|
||||
{
|
||||
required: true,
|
||||
message: "请上传",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
],
|
||||
|
||||
},
|
||||
});
|
||||
const { rules } = toRefs(data);
|
||||
|
@ -1,28 +1,28 @@
|
||||
<template>
|
||||
<el-form
|
||||
ref="formRef"
|
||||
:model="modelValue"
|
||||
:rules="rules"
|
||||
:label-width="labelWidth + 'px'"
|
||||
:disabled="disabled"
|
||||
ref="formRef"
|
||||
:disabled="disabled"
|
||||
:label-width="labelWidth + 'px'"
|
||||
:model="modelValue"
|
||||
:rules="rules"
|
||||
>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="所属领域:" required :show-message="false">
|
||||
<el-row type="flex" justify="space-between">
|
||||
<el-form-item :show-message="false" label="所属领域:" required>
|
||||
<el-row justify="space-between" type="flex">
|
||||
<el-col :span="6">
|
||||
<el-form-item prop="industrys">
|
||||
<el-select
|
||||
v-model="fields[0]"
|
||||
value-key="id"
|
||||
placeholder="请选择"
|
||||
@change="levelIChange"
|
||||
v-model="fields[0]"
|
||||
placeholder="请选择"
|
||||
value-key="id"
|
||||
@change="levelIChange"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in levelI"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
v-for="item in levelI"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
@ -30,33 +30,33 @@
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-select
|
||||
v-model="fields[1]"
|
||||
value-key="id"
|
||||
placeholder="请选择"
|
||||
:disabled="levelII.length === 0"
|
||||
@change="levelIIChange"
|
||||
v-model="fields[1]"
|
||||
:disabled="levelII.length === 0"
|
||||
placeholder="请选择"
|
||||
value-key="id"
|
||||
@change="levelIIChange"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in levelII"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
v-for="item in levelII"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-select
|
||||
v-model="fields[2]"
|
||||
value-key="id"
|
||||
:disabled="levelIII.length === 0"
|
||||
placeholder="请选择"
|
||||
v-model="fields[2]"
|
||||
:disabled="levelIII.length === 0"
|
||||
placeholder="请选择"
|
||||
value-key="id"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in levelIII"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
v-for="item in levelIII"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
@ -66,12 +66,13 @@
|
||||
<!-- <el-button type="primary" @click="check">验证</el-button> -->
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div style="width: 100%"></div>
|
||||
<div class="e_tag">
|
||||
<el-tag
|
||||
v-for="(tag, index) in industrysTags"
|
||||
:key="index"
|
||||
closable
|
||||
@close="handleFieldClose(index)"
|
||||
v-for="(tag, index) in industrysTags"
|
||||
:key="index"
|
||||
closable
|
||||
@close="handleFieldClose(index)"
|
||||
>
|
||||
{{ getFieldNameById(tag) }}
|
||||
<!-- <template v-if="Array.isArray(tag)">
|
||||
@ -90,11 +91,11 @@
|
||||
</el-row>
|
||||
</el-form>
|
||||
</template>
|
||||
<script setup name="FieldOptions">
|
||||
<script name="FieldOptions" setup>
|
||||
// import { industry } from "@/api/config";
|
||||
import { listSysIndustry } from "@/api/config";
|
||||
import { ElMessage } from "element-plus";
|
||||
import { toRefs, watch } from "vue";
|
||||
import {listSysIndustry} from "@/api/config";
|
||||
import {ElMessage} from "element-plus";
|
||||
import {toRefs, watch} from "vue";
|
||||
|
||||
const props = defineProps({
|
||||
modelValue: Object,
|
||||
@ -107,7 +108,7 @@ const props = defineProps({
|
||||
default: false,
|
||||
},
|
||||
});
|
||||
const { modelValue, labelWidth, disabled } = toRefs(props);
|
||||
const {modelValue, labelWidth, disabled} = toRefs(props);
|
||||
const formRef = ref(null);
|
||||
const levelI = ref([]); // I级数据
|
||||
const levelII = ref([]); // II级数据
|
||||
@ -126,11 +127,11 @@ const data = reactive({
|
||||
],
|
||||
},
|
||||
});
|
||||
const { rules } = toRefs(data);
|
||||
const {rules} = toRefs(data);
|
||||
|
||||
// 获取领域树形列表
|
||||
const getIndustryTreeData = async () => {
|
||||
const { data } = await listSysIndustry();
|
||||
const {data} = await listSysIndustry();
|
||||
levelI.value = data;
|
||||
};
|
||||
|
||||
|
251
src/views/components/LaboratoryForm/index.vue
Normal file
251
src/views/components/LaboratoryForm/index.vue
Normal file
@ -0,0 +1,251 @@
|
||||
<template>
|
||||
<el-form
|
||||
ref="formRef"
|
||||
:label-width="labelWidth + 'px'"
|
||||
:model="modelValue"
|
||||
:rules="rules"
|
||||
>
|
||||
<div v-if="showTitle" class="form_title">基本信息</div>
|
||||
|
||||
<el-row v-if="isAdd">
|
||||
<el-col :span="24">
|
||||
<el-form-item label="实验室名称" prop="name">
|
||||
<!--:disabled="isAdd"-->
|
||||
<el-input v-model="modelValue.name"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
|
||||
<el-row v-if="isAdd">
|
||||
<el-col :span="24">
|
||||
<el-form-item label="组织机构代码:" prop="code">
|
||||
<el-row justify="space-between" type="flex">
|
||||
<el-col :span="20">
|
||||
<!--:disabled="isAdd"-->
|
||||
<el-input v-model="modelValue.code"></el-input>
|
||||
</el-col>
|
||||
<el-col :span="3">
|
||||
<!-- :disabled="isAdd"-->
|
||||
<el-button type="primary" @click=""
|
||||
>查找
|
||||
</el-button
|
||||
>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row v-if="isAdd">
|
||||
<el-col :span="24">
|
||||
<el-form-item label="所属院所或单位" prop="school">
|
||||
<el-input v-model="modelValue.school" placeholder="请输入所属院所或单位"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<CityOptions ref="cityFormRef" v-model="modelValue" :labelWidth="labelWidth"/>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="详细地址:">
|
||||
<el-input
|
||||
v-model="modelValue.address"
|
||||
placeholder="请输入详细地址"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="实验室网站:">
|
||||
<el-input
|
||||
v-model="modelValue.url"
|
||||
placeholder="请输入实验室网站"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<FieldOptions
|
||||
ref="fieldFormRef"
|
||||
v-model="modelValue"
|
||||
:labelWidth="labelWidth"
|
||||
/>
|
||||
|
||||
<InputBoxAdd
|
||||
ref="keywordsFormRef"
|
||||
v-model="modelValue"
|
||||
:labelWidth="labelWidth"
|
||||
fieldKey="keywords"
|
||||
placeholder="应用场景关键词+技术产品关键词"
|
||||
title="关键词"
|
||||
/>
|
||||
|
||||
<InputBoxAdd
|
||||
ref="directionsFormRef"
|
||||
v-model="modelValue"
|
||||
:labelWidth="labelWidth"
|
||||
fieldKey="researchs"
|
||||
placeholder="请输入研究方向"
|
||||
title="研究方向"
|
||||
/>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="实验室简介" prop="introduction">
|
||||
<editor
|
||||
ref="introduceRef"
|
||||
v-model="modelValue.introduction"
|
||||
:minHeight="150"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</template>
|
||||
<script setup>
|
||||
import Editor from '@/components/WangEditor'
|
||||
import CityOptions from "@/views/components/CityOptions";
|
||||
import FieldOptions from "@/views/components/FieldOptions";
|
||||
import InputBoxAdd from "@/views/components/InputBoxAdd";
|
||||
import {reactive, ref, toRefs} from "vue";
|
||||
|
||||
const props = defineProps({
|
||||
modelValue: Object,
|
||||
isAdd: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
showTitle: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
labelWidth: {
|
||||
type: Number,
|
||||
default: 120,
|
||||
},
|
||||
})
|
||||
|
||||
const formRef = ref()
|
||||
const cityFormRef = ref()
|
||||
const fieldFormRef = ref()
|
||||
const keywordsFormRef = ref()
|
||||
const directionsFormRef = ref()
|
||||
const introduceRef = ref()
|
||||
|
||||
const data = reactive({
|
||||
rules: {
|
||||
product: [{required: true, message: "请输入", trigger: "blur"}],
|
||||
name: [{required: true, message: "请输入", trigger: "blur"}],
|
||||
kind: [{required: true, message: "请选择", trigger: "change"}],
|
||||
code: [{required: true, message: "请输入", trigger: "blur"}],
|
||||
mobile: [
|
||||
{required: true, message: "请输入", trigger: "blur"},
|
||||
{
|
||||
pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
|
||||
message: "请输入正确的手机号码",
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
researchId: [{required: true, message: "请选择", trigger: "change"}],
|
||||
tenantId: [
|
||||
{
|
||||
required: true,
|
||||
message: "请选择",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
],
|
||||
school: [{required: true, message: "请输入", trigger: "blur"}],
|
||||
education: [{required: true, message: "请选择", trigger: "change"}],
|
||||
major: [{required: true, message: "请输入", trigger: "blur"}],
|
||||
job: [{required: true, message: "请输入", trigger: "blur"}],
|
||||
title: [{required: true, message: "请输入", trigger: "blur"}],
|
||||
work_at: [
|
||||
{
|
||||
required: true,
|
||||
message: "从业时间不能为空",
|
||||
trigger: ["change", "blur"],
|
||||
},
|
||||
],
|
||||
license: [
|
||||
{
|
||||
required: true,
|
||||
message: "请上传",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
],
|
||||
introduction: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入",
|
||||
trigger: ["change", "blur"],
|
||||
},
|
||||
],
|
||||
}
|
||||
});
|
||||
const {rules} = toRefs(data)
|
||||
const submitForm = () => {
|
||||
let flag = false;
|
||||
this.$refs["formRef"].validate((valid) => {
|
||||
const cityForm = this.$refs.cityForm.submitForm(); // 城市
|
||||
const fieldForm = this.$refs.fieldForm.submitForm();
|
||||
const keywordsForm = this.$refs.keywordsForm.submitForm();
|
||||
const directionsForm = this.$refs.directionsForm.submitForm();
|
||||
if (valid && cityForm && fieldForm && keywordsForm && directionsForm) {
|
||||
flag = !flag;
|
||||
}
|
||||
});
|
||||
return flag;
|
||||
}
|
||||
|
||||
const validateForm = async () => {
|
||||
let formValid;
|
||||
try {
|
||||
formValid = await formRef.value.validate();
|
||||
} catch (error) {
|
||||
formValid = false;
|
||||
}
|
||||
const cityFormValid = await cityFormRef.value.validateForm(); // 城市选择表单验证
|
||||
const fieldFormValid = await fieldFormRef.value.validateForm(); // 领域选择表单验证
|
||||
const keywordsFormValid = await keywordsFormRef.value.validateForm(); // 关键词表单验证
|
||||
const directionsFormValid = await directionsFormRef.value.validateForm(); // 研究方向表单验证
|
||||
return (
|
||||
formValid &&
|
||||
cityFormValid &&
|
||||
fieldFormValid &&
|
||||
keywordsFormValid &&
|
||||
directionsFormValid
|
||||
);
|
||||
|
||||
};
|
||||
|
||||
defineExpose({
|
||||
validateForm
|
||||
})
|
||||
|
||||
// researchSelect().then(({data}) => {
|
||||
// researchOptions.value = data;
|
||||
// });
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.form_title {
|
||||
font-weight: 700;
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
|
||||
// 上传图片框限制
|
||||
// ::v-deep .el-upload--picture-card {
|
||||
// width: 120px;
|
||||
// height: 120px;
|
||||
// line-height: 120px;
|
||||
// }
|
||||
.el-select,
|
||||
.el-date-editor {
|
||||
display: block;
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
@ -237,7 +237,6 @@ const data = reactive({
|
||||
// education: [{ required: true, message: "请选择", trigger: "change" }],
|
||||
// major: [{ required: true, message: "请输入", trigger: "blur" }],
|
||||
// job: [{ required: true, message: "请输入", trigger: "blur" }],
|
||||
title: [{ required: true, message: "请输入", trigger: "blur" }],
|
||||
work_at: [
|
||||
{
|
||||
required: true,
|
||||
|
203
src/views/components/ResearchForm/index.vue
Normal file
203
src/views/components/ResearchForm/index.vue
Normal file
@ -0,0 +1,203 @@
|
||||
<template>
|
||||
<el-form
|
||||
ref="formRef"
|
||||
:label-width="labelWidth + 'px'"
|
||||
:model="modelValue"
|
||||
:rules="rules"
|
||||
>
|
||||
<div v-if="showTitle" class="form_title">基本信息</div>
|
||||
|
||||
<el-row v-if="isAdd">
|
||||
<el-col :span="24">
|
||||
<el-form-item label="机构logo:">
|
||||
<ImageUpload v-model="modelValue.image" :limit="1"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row v-if="isAdd">
|
||||
<el-col :span="24">
|
||||
<el-form-item label="机构名称" prop="name">
|
||||
<el-input v-model="modelValue.name"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row v-if="isAdd">
|
||||
<el-col :span="24">
|
||||
<el-form-item label="组织机构代码:" prop="code">
|
||||
<el-row justify="space-between" type="flex">
|
||||
<el-col :span="20">
|
||||
<el-input v-model="modelValue.code"></el-input>
|
||||
</el-col>
|
||||
<el-col :span="3">
|
||||
<el-button type="primary" @click="">查找</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<CityOptions ref="cityFormRef" v-model="modelValue" :labelWidth="labelWidth"/>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="详细地址:">
|
||||
<el-input v-model="modelValue.address"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<FieldSingle
|
||||
ref="fieldFormRef"
|
||||
v-model="modelValue"
|
||||
:labelWidth="labelWidth"
|
||||
/>
|
||||
|
||||
<InputBoxAdd
|
||||
ref="directionsFormRef"
|
||||
v-model="modelValue"
|
||||
:labelWidth="labelWidth"
|
||||
fieldKey="researchs"
|
||||
placeholder="请输入研究方向"
|
||||
title="研究方向"
|
||||
/>
|
||||
|
||||
<el-row v-if="isAdd">
|
||||
<el-col :span="24">
|
||||
<el-form-item label="营业执照:" prop="license">
|
||||
<ImageUpload
|
||||
v-model="modelValue.license"
|
||||
:isShowTip="false"
|
||||
:limit="1"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="机构简介" prop="introduce">
|
||||
<editor
|
||||
ref="introduceRef"
|
||||
v-model="modelValue.introduce"
|
||||
:minHeight="150"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</template>
|
||||
<script setup>
|
||||
import Editor from '@/components/WangEditor'
|
||||
import CityOptions from "../CityOptions";
|
||||
import FieldSingle from "../FieldSingle";
|
||||
import InputBoxAdd from "../InputBoxAdd";
|
||||
import {ref} from "vue";
|
||||
|
||||
const formRef = ref()
|
||||
const cityFormRef = ref()
|
||||
const fieldFormRef = ref()
|
||||
const directionsFormRef = ref()
|
||||
const introduceRef = ref()
|
||||
|
||||
const props = defineProps({
|
||||
modelValue: Object,
|
||||
isAdd: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
showTitle: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
labelWidth: {
|
||||
type: Number,
|
||||
default: 120,
|
||||
},
|
||||
})
|
||||
const rules = {
|
||||
product: [{required: true, message: "请输入", trigger: "blur"}],
|
||||
name: [{required: true, message: "请输入", trigger: "blur"}],
|
||||
kind: [{required: true, message: "请选择", trigger: "change"}],
|
||||
code: [{required: true, message: "请输入", trigger: "blur"}],
|
||||
mobile: [
|
||||
{required: true, message: "请输入", trigger: "blur"},
|
||||
{
|
||||
pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
|
||||
message: "请输入正确的手机号码",
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
research_id: [{required: true, message: "请选择", trigger: "change"}],
|
||||
tenant_id: [
|
||||
{
|
||||
required: true,
|
||||
message: "请选择",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
],
|
||||
school: [{required: true, message: "请输入", trigger: "blur"}],
|
||||
education: [{required: true, message: "请选择", trigger: "change"}],
|
||||
major: [{required: true, message: "请输入", trigger: "blur"}],
|
||||
job: [{required: true, message: "请输入", trigger: "blur"}],
|
||||
title: [{required: true, message: "请输入", trigger: "blur"}],
|
||||
work_at: [
|
||||
{
|
||||
required: true,
|
||||
message: "从业时间不能为空",
|
||||
trigger: ["change", "blur"],
|
||||
},
|
||||
],
|
||||
license: [
|
||||
{
|
||||
required: true,
|
||||
message: "请上传",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
],
|
||||
introduce: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入",
|
||||
trigger: ["change", "blur"],
|
||||
},
|
||||
],
|
||||
}
|
||||
|
||||
const validateForm = async () => {
|
||||
let formValid;
|
||||
try {
|
||||
formValid = await formRef.value.validate();
|
||||
} catch (error) {
|
||||
formValid = false;
|
||||
}
|
||||
const cityFormValid = await cityFormRef.value.validateForm();
|
||||
const fieldFormValid = await fieldFormRef.value.validateForm();
|
||||
const directionsFormValid = await directionsFormRef.value.validateForm();
|
||||
const introduceValid = await introduceRef.value.validateForm();
|
||||
return (
|
||||
formValid &&
|
||||
cityFormValid &&
|
||||
fieldFormValid &&
|
||||
directionsFormValid &&
|
||||
introduceValid
|
||||
);
|
||||
}
|
||||
defineExpose({
|
||||
validateForm
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.form_title {
|
||||
font-weight: 700;
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
|
||||
.el-select,
|
||||
.el-date-editor {
|
||||
display: block;
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
Reference in New Issue
Block a user