2022-07-22 17:32:45 +08:00
|
|
|
<template>
|
|
|
|
<el-form
|
2022-07-25 17:32:16 +08:00
|
|
|
ref="formRef"
|
|
|
|
:model="modelValue"
|
2022-07-22 17:32:45 +08:00
|
|
|
:rules="rules"
|
2022-10-31 17:45:39 +08:00
|
|
|
:disabled="!isAdd"
|
2022-07-22 17:32:45 +08:00
|
|
|
:label-width="labelWidth + 'px'"
|
|
|
|
>
|
|
|
|
<div class="form_title" v-if="showTitle">基本信息</div>
|
|
|
|
<el-row>
|
|
|
|
<el-col :span="24">
|
|
|
|
<el-form-item :label="imageName" prop="image">
|
2022-10-31 17:45:39 +08:00
|
|
|
<ImageUpload
|
|
|
|
:disabled="!isAdd"
|
|
|
|
v-model="modelValue.image"
|
|
|
|
:fileSize="2"
|
|
|
|
:limit="1"
|
|
|
|
/>
|
2022-07-22 17:32:45 +08:00
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
</el-row>
|
|
|
|
|
|
|
|
<el-row v-if="formType == 2">
|
|
|
|
<el-col :span="24">
|
|
|
|
<el-form-item :label="nameName" prop="name">
|
|
|
|
<el-input
|
2022-07-25 17:32:16 +08:00
|
|
|
v-model="modelValue.name"
|
2022-07-22 17:32:45 +08:00
|
|
|
:disabled="isAdd ? false : true"
|
|
|
|
></el-input>
|
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
</el-row>
|
|
|
|
|
2022-11-17 17:30:20 +08:00
|
|
|
<!-- <el-row v-if="formType == 2">
|
2022-07-22 17:32:45 +08:00
|
|
|
<el-col :span="24">
|
|
|
|
<el-form-item label="组织机构代码:" prop="code">
|
|
|
|
<el-row type="flex" justify="space-between">
|
|
|
|
<el-col :span="20">
|
2022-07-25 17:32:16 +08:00
|
|
|
<el-input v-model="modelValue.code" :disabled="!isAdd"></el-input>
|
2022-07-22 17:32:45 +08:00
|
|
|
</el-col>
|
|
|
|
<el-col :span="3">
|
|
|
|
<el-button type="primary" @click="" :disabled="!isAdd"
|
|
|
|
>查找</el-button
|
|
|
|
>
|
|
|
|
</el-col>
|
|
|
|
</el-row>
|
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
2022-11-17 17:30:20 +08:00
|
|
|
</el-row> -->
|
2022-07-22 17:32:45 +08:00
|
|
|
|
2022-11-21 16:40:21 +08:00
|
|
|
<el-row v-if="formType == 2">
|
|
|
|
<el-col :span="24">
|
|
|
|
<el-form-item label="联系人" prop="contact">
|
|
|
|
<el-input v-model="modelValue.contact"></el-input>
|
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
</el-row>
|
|
|
|
<el-row v-if="formType == 2">
|
|
|
|
<el-col :span="24">
|
|
|
|
<el-form-item label="联系方式" prop="mobilephone">
|
|
|
|
<el-input
|
|
|
|
v-model="modelValue.mobilephone"
|
|
|
|
:maxlength="11"
|
|
|
|
oninput="
|
|
|
|
value = value
|
|
|
|
.replace(/[^\d.]/g, '')
|
|
|
|
.replace(/\.{2,}/g, '.')
|
|
|
|
.replace('.', '$#$')
|
|
|
|
.replace(/\./g, '')
|
|
|
|
.replace('$#$', '.')
|
|
|
|
.replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3')
|
|
|
|
.replace(/^\./g, '')
|
|
|
|
"
|
|
|
|
></el-input>
|
|
|
|
<!-- v-number -->
|
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
</el-row>
|
|
|
|
<el-row v-if="formType == 2">
|
|
|
|
<el-col :span="24">
|
|
|
|
<el-form-item label="邮箱" prop="email">
|
|
|
|
<el-input v-model="modelValue.email"></el-input>
|
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
</el-row>
|
|
|
|
|
2022-07-22 17:32:45 +08:00
|
|
|
<el-row v-if="formType == 2">
|
|
|
|
<el-col :span="24">
|
|
|
|
<el-form-item label="企业类型:" prop="kind">
|
2022-07-25 17:32:16 +08:00
|
|
|
<el-select v-model="modelValue.kind" placeholder="请选择">
|
2022-07-22 17:32:45 +08:00
|
|
|
<el-option
|
|
|
|
v-for="item in enterpriseOptions"
|
|
|
|
:key="item.key"
|
|
|
|
:label="item.value"
|
|
|
|
:value="item.key"
|
|
|
|
>
|
|
|
|
</el-option>
|
|
|
|
</el-select>
|
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
<el-col :span="24">
|
|
|
|
<el-form-item label="核心成果核心产品:" prop="product">
|
2022-07-25 17:32:16 +08:00
|
|
|
<el-input v-model="modelValue.product"></el-input>
|
2022-07-22 17:32:45 +08:00
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
</el-row>
|
|
|
|
|
|
|
|
<el-row v-if="formType == 1">
|
|
|
|
<el-col :span="12">
|
|
|
|
<el-form-item label="姓名:" prop="name">
|
|
|
|
<el-input
|
2022-07-25 17:32:16 +08:00
|
|
|
v-model="modelValue.name"
|
2022-07-22 17:32:45 +08:00
|
|
|
:disabled="isAdd ? false : true"
|
|
|
|
></el-input>
|
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
<el-col :span="12">
|
|
|
|
<el-form-item label="手机号:" prop="mobile">
|
|
|
|
<el-input
|
2022-07-25 17:32:16 +08:00
|
|
|
v-model="modelValue.mobile"
|
2022-07-22 17:32:45 +08:00
|
|
|
:disabled="isAdd ? false : true"
|
|
|
|
></el-input>
|
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
</el-row>
|
|
|
|
|
|
|
|
<el-row>
|
|
|
|
<el-col :span="24">
|
2022-07-25 17:32:16 +08:00
|
|
|
<el-form-item label="所属站点:" prop="tenantId">
|
2022-09-07 14:24:55 +08:00
|
|
|
<SiteOptions v-model="modelValue.tenantId" :site-list="siteList" />
|
2022-07-22 17:32:45 +08:00
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
</el-row>
|
|
|
|
|
2022-09-09 14:40:05 +08:00
|
|
|
<!-- <el-row v-if="formType == 1">
|
2022-07-22 17:32:45 +08:00
|
|
|
<el-col :span="12">
|
2022-07-25 17:32:16 +08:00
|
|
|
<el-form-item label="所属单位:" prop="researchId">
|
2022-07-22 17:32:45 +08:00
|
|
|
<el-select
|
2022-07-25 17:32:16 +08:00
|
|
|
v-model="modelValue.researchId"
|
2022-07-22 17:32:45 +08:00
|
|
|
filterable
|
|
|
|
placeholder="请选择"
|
|
|
|
@change="setLaboratory"
|
|
|
|
>
|
|
|
|
<el-option
|
|
|
|
v-for="item in researchOptions"
|
|
|
|
:key="item.id"
|
|
|
|
:label="item.name"
|
|
|
|
:value="item.id"
|
|
|
|
>
|
|
|
|
</el-option>
|
|
|
|
</el-select>
|
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
<el-col :span="12">
|
|
|
|
<el-form-item label="所属实验室:">
|
|
|
|
<el-select
|
2022-07-25 17:32:16 +08:00
|
|
|
v-model="modelValue.laboratory_id"
|
2022-07-22 17:32:45 +08:00
|
|
|
filterable
|
|
|
|
placeholder="请选择"
|
|
|
|
>
|
|
|
|
<el-option
|
|
|
|
v-for="item in options"
|
|
|
|
:key="item.value"
|
|
|
|
:label="item.label"
|
|
|
|
:value="item.value"
|
|
|
|
>
|
|
|
|
</el-option>
|
|
|
|
</el-select>
|
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
2022-09-09 14:40:05 +08:00
|
|
|
</el-row> -->
|
2022-07-22 17:32:45 +08:00
|
|
|
|
2022-07-25 17:32:16 +08:00
|
|
|
<CityOptions
|
2022-10-31 17:45:39 +08:00
|
|
|
:disabled="!isAdd"
|
2022-07-25 17:32:16 +08:00
|
|
|
v-model="modelValue"
|
|
|
|
:labelWidth="labelWidth"
|
|
|
|
ref="cityFormRef"
|
|
|
|
/>
|
2022-07-22 17:32:45 +08:00
|
|
|
|
|
|
|
<el-row>
|
|
|
|
<el-col :span="24">
|
|
|
|
<el-form-item label="详细地址:">
|
2022-07-25 17:32:16 +08:00
|
|
|
<el-input v-model="modelValue.address"></el-input>
|
2022-07-22 17:32:45 +08:00
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
</el-row>
|
|
|
|
|
|
|
|
<el-row v-if="formType == 1">
|
2022-11-21 09:45:17 +08:00
|
|
|
<el-col :span="12">
|
2022-07-22 17:32:45 +08:00
|
|
|
<el-form-item label="毕业院校:" prop="school">
|
2022-07-25 17:32:16 +08:00
|
|
|
<el-input v-model="modelValue.school"></el-input>
|
2022-07-22 17:32:45 +08:00
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
2022-11-21 09:45:17 +08:00
|
|
|
<el-col :span="12">
|
|
|
|
<el-form-item label="所属研究机构:" prop="organization">
|
|
|
|
<el-input v-model="modelValue.organization"></el-input>
|
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
2022-07-22 17:32:45 +08:00
|
|
|
</el-row>
|
|
|
|
|
|
|
|
<el-row v-if="formType == 1">
|
|
|
|
<el-col :span="12">
|
|
|
|
<el-form-item label="最高学历:" prop="education">
|
2022-07-25 17:32:16 +08:00
|
|
|
<el-select v-model="modelValue.education" placeholder="请选择">
|
2022-10-01 09:11:23 +08:00
|
|
|
<el-option value="博士" label="博士"> </el-option>
|
|
|
|
<el-option value="硕士" label="硕士"> </el-option>
|
|
|
|
<el-option value="本科" label="本科"> </el-option>
|
|
|
|
<el-option value="专科" label="专科"> </el-option>
|
2022-07-22 17:32:45 +08:00
|
|
|
</el-select>
|
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
<el-col :span="12">
|
|
|
|
<el-form-item label="主修专业:" prop="major">
|
2022-07-25 17:32:16 +08:00
|
|
|
<el-input v-model="modelValue.major"></el-input>
|
2022-07-22 17:32:45 +08:00
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
</el-row>
|
|
|
|
|
|
|
|
<el-row v-if="formType == 1">
|
|
|
|
<el-col :span="12">
|
|
|
|
<el-form-item label="职务:" prop="job">
|
2022-07-25 17:32:16 +08:00
|
|
|
<el-input v-model="modelValue.job"></el-input>
|
2022-07-22 17:32:45 +08:00
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
<el-col :span="12">
|
|
|
|
<el-form-item label="职称:" prop="title">
|
2022-07-25 17:32:16 +08:00
|
|
|
<el-input v-model="modelValue.title"></el-input>
|
2022-07-22 17:32:45 +08:00
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
</el-row>
|
|
|
|
|
|
|
|
<el-row v-if="formType == 1">
|
|
|
|
<el-col :span="12">
|
2022-09-21 10:34:50 +08:00
|
|
|
<el-form-item label="从业时间:" prop="workTime">
|
2022-07-22 17:32:45 +08:00
|
|
|
<el-date-picker
|
2022-09-21 10:34:50 +08:00
|
|
|
v-model="modelValue.workTime"
|
2022-10-01 09:11:23 +08:00
|
|
|
type="month"
|
|
|
|
format="YYYY-MM"
|
|
|
|
value-format="YYYY-MM"
|
2022-07-22 17:32:45 +08:00
|
|
|
placeholder="选择日期"
|
|
|
|
>
|
|
|
|
</el-date-picker>
|
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
<el-col :span="12">
|
|
|
|
<el-form-item label="性别:" prop="gender">
|
2022-10-01 09:11:23 +08:00
|
|
|
<el-radio v-model="modelValue.gender" label="1">男</el-radio>
|
|
|
|
<el-radio v-model="modelValue.gender" label="2">女</el-radio>
|
2022-07-22 17:32:45 +08:00
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
</el-row>
|
|
|
|
|
2022-07-27 16:56:23 +08:00
|
|
|
<FieldOptions
|
2022-10-31 17:45:39 +08:00
|
|
|
:disabled="!isAdd"
|
2022-07-27 16:56:23 +08:00
|
|
|
v-model="modelValue"
|
|
|
|
:labelWidth="labelWidth"
|
|
|
|
ref="fieldFormRef"
|
|
|
|
/>
|
2022-07-22 17:32:45 +08:00
|
|
|
|
2022-07-26 14:35:21 +08:00
|
|
|
<InputBoxAdd
|
2022-10-31 17:45:39 +08:00
|
|
|
:disabled="!isAdd"
|
2022-07-22 17:32:45 +08:00
|
|
|
:labelWidth="labelWidth"
|
2022-07-26 14:35:21 +08:00
|
|
|
v-model="modelValue"
|
2022-07-22 17:32:45 +08:00
|
|
|
title="关键词"
|
|
|
|
placeholder="应用场景关键词+技术产品关键词"
|
|
|
|
fieldKey="keywords"
|
2022-07-26 14:35:21 +08:00
|
|
|
ref="keywordsFormRef"
|
2022-07-22 17:32:45 +08:00
|
|
|
/>
|
|
|
|
|
2022-09-09 14:40:05 +08:00
|
|
|
<!-- <InputBoxAdd
|
2022-07-22 17:32:45 +08:00
|
|
|
v-if="formType != 2"
|
|
|
|
:labelWidth="labelWidth"
|
2022-07-26 14:35:21 +08:00
|
|
|
v-model="modelValue"
|
2022-07-22 17:32:45 +08:00
|
|
|
title="研究方向"
|
|
|
|
placeholder="请输入研究方向"
|
|
|
|
fieldKey="researchs"
|
2022-07-26 14:35:21 +08:00
|
|
|
ref="researchsFormRef"
|
2022-09-09 14:40:05 +08:00
|
|
|
/> -->
|
2022-07-22 17:32:45 +08:00
|
|
|
|
2022-11-21 16:40:21 +08:00
|
|
|
<!-- <InputBoxAdd
|
2022-07-22 17:32:45 +08:00
|
|
|
v-if="formType == 2"
|
|
|
|
:labelWidth="labelWidth"
|
2022-07-26 14:35:21 +08:00
|
|
|
v-model="modelValue"
|
2022-07-22 17:32:45 +08:00
|
|
|
title="生产方向"
|
2022-10-31 17:45:39 +08:00
|
|
|
:disabled="!isAdd"
|
2022-07-22 17:32:45 +08:00
|
|
|
placeholder="请输入生产方向"
|
|
|
|
fieldKey="directions"
|
2022-07-26 14:35:21 +08:00
|
|
|
ref="directionsFormRef"
|
2022-11-21 16:40:21 +08:00
|
|
|
/> -->
|
2022-07-22 17:32:45 +08:00
|
|
|
|
|
|
|
<el-row v-if="formType == 2">
|
2022-11-21 16:40:21 +08:00
|
|
|
<!-- <el-col :span="24">
|
2022-07-22 17:32:45 +08:00
|
|
|
<el-form-item label="邀请码:">
|
2022-07-25 17:32:16 +08:00
|
|
|
<el-input
|
2022-07-26 14:35:21 +08:00
|
|
|
v-model="modelValue.inviterCode"
|
2022-07-25 17:32:16 +08:00
|
|
|
:disabled="!isAdd"
|
|
|
|
></el-input>
|
2022-07-22 17:32:45 +08:00
|
|
|
</el-form-item>
|
2022-11-21 16:40:21 +08:00
|
|
|
</el-col> -->
|
2022-07-22 17:32:45 +08:00
|
|
|
<el-col :span="24">
|
|
|
|
<el-form-item label="企业网站:">
|
2022-07-25 17:32:16 +08:00
|
|
|
<el-input v-model="modelValue.url"></el-input>
|
2022-07-22 17:32:45 +08:00
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
</el-row>
|
|
|
|
|
|
|
|
<el-row v-if="formType == 2">
|
|
|
|
<el-col :span="24">
|
|
|
|
<el-form-item label="营业执照:" prop="license">
|
2022-07-25 17:32:16 +08:00
|
|
|
<ImageUpload
|
|
|
|
v-model="modelValue.license"
|
|
|
|
:isShowTip="false"
|
|
|
|
:limit="1"
|
|
|
|
/>
|
2022-07-22 17:32:45 +08:00
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
</el-row>
|
|
|
|
<el-row>
|
|
|
|
<el-col :span="24">
|
|
|
|
<el-form-item :label="introduceName" prop="introduce">
|
|
|
|
<el-input
|
|
|
|
v-if="formType == 1"
|
2022-07-25 17:32:16 +08:00
|
|
|
v-model="modelValue.introduce"
|
2022-07-22 17:32:45 +08:00
|
|
|
type="textarea"
|
|
|
|
:autosize="{ minRows: 2, maxRows: 6 }"
|
|
|
|
/>
|
2022-10-31 17:45:39 +08:00
|
|
|
<WangEditor
|
|
|
|
:readOnly="!isAdd"
|
|
|
|
v-else
|
|
|
|
v-model="modelValue.introduce"
|
|
|
|
minHeight="150px"
|
|
|
|
/>
|
2022-07-25 17:32:16 +08:00
|
|
|
<!-- <Editor
|
2022-07-22 17:32:45 +08:00
|
|
|
v-else
|
2022-07-25 17:32:16 +08:00
|
|
|
v-model="modelValue.introduce"
|
2022-07-22 17:32:45 +08:00
|
|
|
:minHeight="150"
|
|
|
|
ref="introduceRef"
|
|
|
|
@click.native="handleEditAble"
|
2022-07-25 17:32:16 +08:00
|
|
|
/> -->
|
2022-07-22 17:32:45 +08:00
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
</el-row>
|
|
|
|
</el-form>
|
|
|
|
</template>
|
2022-07-25 17:32:16 +08:00
|
|
|
<script setup name="ExpertForm">
|
2022-07-22 17:32:45 +08:00
|
|
|
import CityOptions from "@/views/components/CityOptions";
|
2022-07-25 17:32:16 +08:00
|
|
|
// import FieldOptions from "@/views/components/FieldOptions";
|
2022-07-26 14:35:21 +08:00
|
|
|
import InputBoxAdd from "@/views/components/InputBoxAdd";
|
2022-07-22 17:32:45 +08:00
|
|
|
import { researchSelect } from "@/api/dataList/research";
|
|
|
|
import { laboratorySelect } from "@/api/dataList/laboratory";
|
2022-09-07 14:27:09 +08:00
|
|
|
import { tenantSelect } from "@/api/subPlatform/tenant";
|
2022-07-25 17:32:16 +08:00
|
|
|
import { enterpriseOptions } from "@/utils/parameter";
|
|
|
|
import { reactive, ref, toRefs } from "vue";
|
|
|
|
import WangEditor from "../../../components/WangEditor/index.vue";
|
2022-07-27 16:56:23 +08:00
|
|
|
import SiteOptions from "@/views/components/SiteOptions";
|
|
|
|
import FieldOptions from "@/views/components/FieldOptions";
|
2022-07-25 17:32:16 +08:00
|
|
|
|
|
|
|
const props = defineProps({
|
|
|
|
modelValue: { type: Object },
|
|
|
|
isAdd: {
|
|
|
|
type: Boolean,
|
|
|
|
default: true,
|
2022-07-22 17:32:45 +08:00
|
|
|
},
|
2022-07-25 17:32:16 +08:00
|
|
|
showTitle: {
|
|
|
|
type: Boolean,
|
|
|
|
default: false,
|
2022-07-22 17:32:45 +08:00
|
|
|
},
|
2022-07-25 17:32:16 +08:00
|
|
|
formType: {
|
|
|
|
type: Number,
|
|
|
|
default: 1,
|
|
|
|
},
|
|
|
|
labelWidth: {
|
|
|
|
type: Number,
|
|
|
|
default: 120,
|
|
|
|
},
|
|
|
|
});
|
2022-07-26 14:35:21 +08:00
|
|
|
const { formType, modelValue, labelWidth, showTitle, isAdd } = toRefs(props);
|
2022-07-25 17:32:16 +08:00
|
|
|
const cityFormRef = ref(null);
|
2022-07-26 14:35:21 +08:00
|
|
|
const formRef = ref(null);
|
|
|
|
const keywordsFormRef = ref(null);
|
|
|
|
const researchsFormRef = ref(null);
|
2022-07-27 16:56:23 +08:00
|
|
|
const fieldFormRef = ref(null);
|
2022-07-26 14:35:21 +08:00
|
|
|
const directionsFormRef = ref([]);
|
2022-07-25 17:32:16 +08:00
|
|
|
const researchOptions = ref([]);
|
|
|
|
const options = ref([]);
|
|
|
|
const siteList = 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" }],
|
2022-10-01 09:11:23 +08:00
|
|
|
// mobile: [
|
|
|
|
// { required: true, message: "请输入", trigger: "blur" },
|
|
|
|
// {
|
|
|
|
// pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
|
|
|
|
// message: "请输入正确的手机号码",
|
|
|
|
// trigger: "blur",
|
|
|
|
// },
|
|
|
|
// ],
|
2022-09-08 10:41:27 +08:00
|
|
|
researchId: [{ message: "请选择", trigger: "change" }],
|
2022-07-25 17:32:16 +08:00
|
|
|
tenantId: [
|
|
|
|
{
|
|
|
|
required: true,
|
|
|
|
message: "请选择",
|
|
|
|
trigger: ["blur", "change"],
|
|
|
|
},
|
|
|
|
],
|
|
|
|
school: [{ required: true, message: "请输入", trigger: "blur" }],
|
2022-11-21 09:45:17 +08:00
|
|
|
organization: [{ required: true, message: "请输入", trigger: "blur" }],
|
2022-09-08 10:41:27 +08:00
|
|
|
education: [{ message: "请选择", trigger: "change" }],
|
2022-10-01 09:11:23 +08:00
|
|
|
// major: [{ required: true, message: "请输入", trigger: "blur" }],
|
|
|
|
// job: [{ required: true, message: "请输入", trigger: "blur" }],
|
2022-07-25 17:32:16 +08:00
|
|
|
title: [{ required: true, message: "请输入", trigger: "blur" }],
|
2022-09-21 10:34:50 +08:00
|
|
|
workTime: [
|
2022-07-25 17:32:16 +08:00
|
|
|
{
|
|
|
|
required: true,
|
|
|
|
message: "从业时间不能为空",
|
|
|
|
trigger: ["change", "blur"],
|
|
|
|
},
|
|
|
|
],
|
|
|
|
license: [
|
|
|
|
{
|
|
|
|
required: true,
|
|
|
|
message: "请上传",
|
|
|
|
trigger: ["blur", "change"],
|
|
|
|
},
|
|
|
|
],
|
|
|
|
introduce: [{ required: true, message: "请输入", trigger: "blur" }],
|
|
|
|
},
|
|
|
|
});
|
|
|
|
const { rules } = toRefs(data);
|
|
|
|
const introduceName = computed(() => {
|
|
|
|
if (formType.value === 1) {
|
|
|
|
return "个人简介:";
|
|
|
|
} else if (formType.value === 2) {
|
|
|
|
return "单位简介:";
|
|
|
|
} else {
|
|
|
|
return "";
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
const imageName = computed(() => {
|
|
|
|
if (formType.value === 1) {
|
|
|
|
return "专家头像:";
|
|
|
|
} else if (formType.value === 2) {
|
|
|
|
return "企业logo:";
|
|
|
|
} else {
|
|
|
|
return "";
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
const nameName = computed(() => {
|
|
|
|
if (formType.value === 2) {
|
|
|
|
return "单位名称:";
|
|
|
|
} else {
|
|
|
|
return "";
|
|
|
|
}
|
|
|
|
});
|
2022-07-27 17:30:27 +08:00
|
|
|
|
2022-07-26 14:35:21 +08:00
|
|
|
const validateForm = async () => {
|
|
|
|
let formValid;
|
|
|
|
try {
|
|
|
|
formValid = await formRef.value.validate();
|
|
|
|
} catch (error) {
|
|
|
|
formValid = false;
|
|
|
|
}
|
|
|
|
const cityFormValid = await cityFormRef.value.validateForm();
|
2022-07-27 16:56:23 +08:00
|
|
|
const fieldFormValid = await fieldFormRef.value.validateForm();
|
2022-09-21 10:34:50 +08:00
|
|
|
// const keywordsFormValid = await keywordsFormRef.value.validateForm();
|
2022-07-26 14:35:21 +08:00
|
|
|
if (formType.value == 1) {
|
2022-07-27 16:56:23 +08:00
|
|
|
//个人
|
2022-09-21 10:34:50 +08:00
|
|
|
// const researchsFormValid = await researchsFormRef.value.validateForm(); //研究方向验证
|
2022-07-26 14:35:21 +08:00
|
|
|
return (
|
2022-10-01 09:11:23 +08:00
|
|
|
formValid && cityFormValid && fieldFormValid
|
2022-09-21 10:34:50 +08:00
|
|
|
// researchsFormValid
|
2022-07-26 14:35:21 +08:00
|
|
|
);
|
|
|
|
} else if (formType.value == 2) {
|
2022-07-27 16:56:23 +08:00
|
|
|
//企业
|
2022-11-21 16:40:21 +08:00
|
|
|
// const directionsFormValid = await directionsFormRef.value.validateForm(); //生产方向验证
|
2022-07-26 14:35:21 +08:00
|
|
|
return (
|
2022-11-21 16:40:21 +08:00
|
|
|
formValid && cityFormValid && fieldFormValid
|
2022-09-21 10:34:50 +08:00
|
|
|
// keywordsFormValid &&
|
2022-11-21 16:40:21 +08:00
|
|
|
// directionsFormValid
|
2022-07-26 14:35:21 +08:00
|
|
|
);
|
|
|
|
} else {
|
|
|
|
throw "未知的formType";
|
2022-07-25 17:32:16 +08:00
|
|
|
}
|
|
|
|
};
|
2022-09-07 14:24:55 +08:00
|
|
|
|
|
|
|
// 获取站点列表
|
|
|
|
const getSiteList = async () => {
|
|
|
|
const resp = await tenantSelect();
|
|
|
|
siteList.value = resp.rows;
|
|
|
|
};
|
|
|
|
getSiteList();
|
2022-07-26 14:35:21 +08:00
|
|
|
defineExpose({
|
|
|
|
validateForm,
|
|
|
|
});
|
2022-07-25 17:32:16 +08:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<!-- <script>
|
|
|
|
export default {
|
2022-07-22 17:32:45 +08:00
|
|
|
data() {
|
2022-07-25 17:32:16 +08:00
|
|
|
return {};
|
2022-07-22 17:32:45 +08:00
|
|
|
},
|
|
|
|
watch: {
|
2022-07-25 17:32:16 +08:00
|
|
|
"modelmodelValue.tenantId"(newOld) {
|
2022-07-22 17:32:45 +08:00
|
|
|
console.log(newOld);
|
|
|
|
if (newOld) {
|
|
|
|
if (this.formType == 1) {
|
|
|
|
// this.formType == 1 专家表单
|
|
|
|
// 获取所属单位-研究机构options
|
2022-07-25 17:32:16 +08:00
|
|
|
researchSelect({ tenantId: newOld }).then(({ data }) => {
|
2022-07-22 17:32:45 +08:00
|
|
|
this.researchOptions = data;
|
|
|
|
});
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
this.researchOptions = [];
|
2022-07-25 17:32:16 +08:00
|
|
|
if (this.modelmodelValue.researchId) this.modelmodelValue.researchId = undefined;
|
2022-07-22 17:32:45 +08:00
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
mounted() {
|
|
|
|
console.log(this.formType);
|
|
|
|
if (this.formType != 1) {
|
|
|
|
// 取消富文本自动聚焦
|
|
|
|
this.$nextTick(() => {
|
|
|
|
this.$refs.introduceRef.Quill.enable(false);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
// 富文本聚焦
|
|
|
|
handleEditAble() {
|
|
|
|
this.$refs.introduceRef.Quill.enable(true);
|
|
|
|
this.$refs.introduceRef.Quill.focus();
|
|
|
|
},
|
|
|
|
setLaboratory(e) {
|
2022-07-25 17:32:16 +08:00
|
|
|
laboratorySelect({ researchId: e }).then((res) => {
|
2022-07-22 17:32:45 +08:00
|
|
|
console.log(res);
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
2022-07-26 14:35:21 +08:00
|
|
|
</script> -->
|
2022-07-22 17:32:45 +08:00
|
|
|
<style lang="scss" scoped>
|
|
|
|
.form_title {
|
|
|
|
font-weight: 700;
|
|
|
|
margin-bottom: 30px;
|
|
|
|
}
|
2022-07-26 14:35:21 +08:00
|
|
|
</style>
|