fmt
This commit is contained in:
@ -1,9 +1,9 @@
|
||||
<template>
|
||||
<el-form
|
||||
ref="formRef"
|
||||
:label-width="labelWidth + 'px'"
|
||||
:model="modelValue"
|
||||
:rules="rules"
|
||||
ref="formRef"
|
||||
:label-width="labelWidth + 'px'"
|
||||
:model="modelValue"
|
||||
:rules="rules"
|
||||
>
|
||||
<div v-if="showTitle" class="form_title">基本信息</div>
|
||||
|
||||
@ -34,7 +34,7 @@
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="工作所在地:" prop="workPlace">
|
||||
<el-input v-model="modelValue.workPlace"/>
|
||||
<el-input v-model="modelValue.workPlace" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@ -43,30 +43,30 @@
|
||||
<el-col :span="24">
|
||||
<el-form-item label="工作经历:" prop="workExperience">
|
||||
<el-input
|
||||
v-model="modelValue.workExperience"
|
||||
:autosize="{ minRows: 2, maxRows: 10 }"
|
||||
type="textarea"
|
||||
v-model="modelValue.workExperience"
|
||||
: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="擅长领域"
|
||||
ref="researchsFormRef"
|
||||
v-model="modelValue"
|
||||
:labelWidth="labelWidth"
|
||||
fieldKey="researchs"
|
||||
placeholder="请输入擅长领域"
|
||||
title="擅长领域"
|
||||
/>
|
||||
|
||||
<InputBoxAdd
|
||||
ref="keywordsFormRef"
|
||||
v-model="modelValue"
|
||||
:labelWidth="labelWidth"
|
||||
fieldKey="keywords"
|
||||
placeholder="应用场景关键词+技术产品关键词"
|
||||
title="关键词"
|
||||
ref="keywordsFormRef"
|
||||
v-model="modelValue"
|
||||
:labelWidth="labelWidth"
|
||||
fieldKey="keywords"
|
||||
placeholder="应用场景关键词+技术产品关键词"
|
||||
title="关键词"
|
||||
/>
|
||||
|
||||
<el-row v-if="isAdd">
|
||||
@ -76,9 +76,9 @@
|
||||
<el-col :span="8">
|
||||
<el-form-item prop="idImage.front">
|
||||
<ImageUpload
|
||||
v-model="modelValue.idImage.front"
|
||||
:isShowTip="false"
|
||||
:limit="1"
|
||||
v-model="modelValue.idImage.front"
|
||||
:isShowTip="false"
|
||||
:limit="1"
|
||||
/>
|
||||
</el-form-item>
|
||||
<div style="text-align: center">身份证人像面</div>
|
||||
@ -86,9 +86,9 @@
|
||||
<el-col :span="8">
|
||||
<el-form-item prop="idImage.behind">
|
||||
<ImageUpload
|
||||
v-model="modelValue.idImage.behind"
|
||||
:isShowTip="false"
|
||||
:limit="1"
|
||||
v-model="modelValue.idImage.behind"
|
||||
:isShowTip="false"
|
||||
:limit="1"
|
||||
/>
|
||||
</el-form-item>
|
||||
<div style="text-align: center">身份证国徽面</div>
|
||||
@ -96,9 +96,9 @@
|
||||
<el-col :span="8">
|
||||
<el-form-item prop="idImage.hold">
|
||||
<ImageUpload
|
||||
v-model="modelValue.idImage.hold"
|
||||
:isShowTip="false"
|
||||
:limit="1"
|
||||
v-model="modelValue.idImage.hold"
|
||||
:isShowTip="false"
|
||||
:limit="1"
|
||||
/>
|
||||
</el-form-item>
|
||||
<div style="text-align: center">手持身份证人像面</div>
|
||||
@ -114,9 +114,9 @@
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<image-upload
|
||||
v-model="modelValue.credentialImage"
|
||||
:isShowTip="false"
|
||||
:limit="1"
|
||||
v-model="modelValue.credentialImage"
|
||||
:isShowTip="false"
|
||||
:limit="1"
|
||||
/>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@ -127,11 +127,11 @@
|
||||
</template>
|
||||
<script setup>
|
||||
import InputBoxAdd from "../InputBoxAdd";
|
||||
import {ref} from "vue";
|
||||
import { ref } from "vue";
|
||||
|
||||
const formRef = ref()
|
||||
const researchsFormRef = ref()
|
||||
const keywordsFormRef = ref()
|
||||
const formRef = ref();
|
||||
const researchsFormRef = ref();
|
||||
const keywordsFormRef = ref();
|
||||
const props = defineProps({
|
||||
modelValue: Object,
|
||||
isAdd: {
|
||||
@ -146,25 +146,23 @@ const props = defineProps({
|
||||
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"}],
|
||||
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"},
|
||||
{ required: true, message: "请输入手机号码", trigger: "blur" },
|
||||
{
|
||||
pattern: /^1[3-9]\d{9}$/,
|
||||
message: "请输入正确的手机号码",
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
idCard: [{required: true, message: "请输入", trigger: "blur"}],
|
||||
workPlace: [{required: true, message: "请输入", trigger: "blur"}],
|
||||
workExperience: [
|
||||
{required: true, message: "请输入", trigger: "blur"},
|
||||
],
|
||||
idCard: [{ required: true, message: "请输入", trigger: "blur" }],
|
||||
workPlace: [{ required: true, message: "请输入", trigger: "blur" }],
|
||||
workExperience: [{ required: true, message: "请输入", trigger: "blur" }],
|
||||
"idImage.front": [
|
||||
{
|
||||
required: true,
|
||||
@ -186,8 +184,7 @@ const rules = {
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
],
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
const validateForm = async () => {
|
||||
let formValid;
|
||||
@ -198,17 +195,12 @@ const validateForm = async () => {
|
||||
}
|
||||
const researchsFormValid = await researchsFormRef.value.validateForm();
|
||||
const keywordsFormValid = await keywordsFormRef.value.validateForm();
|
||||
return (
|
||||
formValid &&
|
||||
researchsFormValid &&
|
||||
keywordsFormValid
|
||||
);
|
||||
}
|
||||
|
||||
return formValid && researchsFormValid && keywordsFormValid;
|
||||
};
|
||||
|
||||
defineExpose({
|
||||
validateForm
|
||||
})
|
||||
validateForm,
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@ -217,12 +209,10 @@ defineExpose({
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
|
||||
|
||||
:deep(.hide) {
|
||||
height: 148px;
|
||||
}
|
||||
|
||||
|
||||
// 上传图片框限制
|
||||
// ::v-deep .el-upload--picture-card {
|
||||
// width: 120px;
|
||||
@ -234,4 +224,4 @@ defineExpose({
|
||||
display: block;
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
@ -1,11 +1,11 @@
|
||||
<template>
|
||||
<el-form
|
||||
ref="formRef"
|
||||
:label-width="labelWidth + 'px'"
|
||||
:model="modelValue"
|
||||
:rules="rules"
|
||||
:label-width="labelWidth + 'px'"
|
||||
>
|
||||
<div class="form_title" v-if="showTitle">基本信息</div>
|
||||
<div v-if="showTitle" class="form_title">基本信息</div>
|
||||
|
||||
<!-- <el-row v-if="isAdd"> -->
|
||||
<el-row>
|
||||
@ -94,9 +94,9 @@
|
||||
</el-row>
|
||||
|
||||
<CityOptions
|
||||
ref="cityFormRef"
|
||||
v-model="modelValue"
|
||||
:labelWidth="labelWidth"
|
||||
ref="cityFormRef"
|
||||
/>
|
||||
|
||||
<el-row>
|
||||
@ -108,27 +108,27 @@
|
||||
</el-row>
|
||||
|
||||
<FieldOptions
|
||||
ref="fieldFormRef"
|
||||
v-model="modelValue"
|
||||
:labelWidth="labelWidth"
|
||||
ref="fieldFormRef"
|
||||
/>
|
||||
|
||||
<InputBoxAdd
|
||||
:labelWidth="labelWidth"
|
||||
v-model="modelValue"
|
||||
title="关键词"
|
||||
placeholder="应用场景关键词+技术产品关键词"
|
||||
fieldKey="keywords"
|
||||
ref="keywordsFormRef"
|
||||
v-model="modelValue"
|
||||
:labelWidth="labelWidth"
|
||||
fieldKey="keywords"
|
||||
placeholder="应用场景关键词+技术产品关键词"
|
||||
title="关键词"
|
||||
/>
|
||||
<InputBoxAdd
|
||||
v-if="isAdd"
|
||||
:labelWidth="labelWidth"
|
||||
v-model="modelValue"
|
||||
title="生产方向"
|
||||
placeholder="请输入生产方向"
|
||||
fieldKey="directions"
|
||||
ref="directionsFormRef"
|
||||
v-model="modelValue"
|
||||
:labelWidth="labelWidth"
|
||||
fieldKey="directions"
|
||||
placeholder="请输入生产方向"
|
||||
title="生产方向"
|
||||
/>
|
||||
|
||||
<el-row>
|
||||
@ -146,7 +146,7 @@
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="营业执照:" prop="license">
|
||||
<ImageUpload
|
||||
<image-upload
|
||||
v-model="modelValue.license"
|
||||
:isShowTip="false"
|
||||
:limit="1"
|
||||
@ -180,14 +180,15 @@
|
||||
</el-form>
|
||||
</template>
|
||||
|
||||
<script setup name="EnterpriseForm">
|
||||
<script name="EnterpriseForm" setup>
|
||||
import CityOptions from "../CityOptions";
|
||||
import FieldOptions from "../FieldOptions";
|
||||
import InputBoxAdd from "../InputBoxAdd";
|
||||
// import { researchSelect, laboratorySelect } from "@/api/identity/index";
|
||||
import WangEditor from "@/components/WangEditor";
|
||||
import { enterpriseOptions } from "@/utils/parameter";
|
||||
import { nextTick, toRefs } from "vue";
|
||||
import { reactive, ref, toRefs } from "vue";
|
||||
import ImageUpload from "@/components/ImageUpload/index.vue";
|
||||
|
||||
const props = defineProps({
|
||||
modelValue: Object,
|
||||
@ -211,7 +212,7 @@ const vNumber = {
|
||||
console.log(vnode);
|
||||
el.children[0].addEventListener("keypress", (e) => {
|
||||
// console.log(e);
|
||||
if (/[\D]/.test(e.key)) {
|
||||
if (/\D/.test(e.key)) {
|
||||
e.preventDefault();
|
||||
}
|
||||
});
|
||||
@ -287,7 +288,6 @@ const data = reactive({
|
||||
trigger: ["change", "blur"],
|
||||
},
|
||||
],
|
||||
|
||||
},
|
||||
});
|
||||
const { rules } = toRefs(data);
|
||||
@ -298,6 +298,10 @@ const fieldFormRef = ref();
|
||||
const keywordsFormRef = ref();
|
||||
const directionsFormRef = ref();
|
||||
|
||||
/**
|
||||
* validate form COMPLETE
|
||||
* @return {Promise<false|*>}
|
||||
*/
|
||||
const validateForm = async () => {
|
||||
let formValid;
|
||||
try {
|
||||
@ -308,7 +312,6 @@ const validateForm = async () => {
|
||||
const cityFormValid = await cityFormRef.value.validateForm(); // 城市选择表单验证
|
||||
const fieldFormValid = await fieldFormRef.value.validateForm(); // 领域选择表单验证
|
||||
const keywordsFormValid = await keywordsFormRef.value.validateForm(); // 关键词表单验证
|
||||
// console.log(cityFormValid);
|
||||
if (isAdd.value) {
|
||||
const directionsFormValid = await directionsFormRef.value.validateForm();
|
||||
return (
|
||||
@ -332,6 +335,7 @@ defineExpose({
|
||||
font-weight: 700;
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
|
||||
// 上传图片框限制
|
||||
// ::v-deep .el-upload--picture-card {
|
||||
// width: 120px;
|
||||
|
@ -1,10 +1,10 @@
|
||||
<template>
|
||||
<el-form
|
||||
ref="formRef"
|
||||
:disabled="disabled"
|
||||
:label-width="labelWidth + 'px'"
|
||||
:model="modelValue"
|
||||
:rules="rules"
|
||||
ref="formRef"
|
||||
:disabled="disabled"
|
||||
:label-width="labelWidth + 'px'"
|
||||
:model="modelValue"
|
||||
:rules="rules"
|
||||
>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
@ -13,16 +13,16 @@
|
||||
<el-col :span="6">
|
||||
<el-form-item prop="industrys">
|
||||
<el-select
|
||||
v-model="fields[0]"
|
||||
placeholder="请选择"
|
||||
value-key="id"
|
||||
@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]"
|
||||
:disabled="levelII.length === 0"
|
||||
placeholder="请选择"
|
||||
value-key="id"
|
||||
@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]"
|
||||
:disabled="levelIII.length === 0"
|
||||
placeholder="请选择"
|
||||
value-key="id"
|
||||
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>
|
||||
@ -69,10 +69,10 @@
|
||||
<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)">
|
||||
@ -93,9 +93,9 @@
|
||||
</template>
|
||||
<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,
|
||||
@ -108,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级数据
|
||||
@ -127,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;
|
||||
};
|
||||
|
||||
|
@ -68,7 +68,7 @@
|
||||
<script setup>
|
||||
import { listSysIndustry } from "@/api/config";
|
||||
// import { watch } from "fs";
|
||||
import {reactive, ref, toRefs, watch} from "vue";
|
||||
import { reactive, ref, toRefs, watch } from "vue";
|
||||
const props = defineProps({
|
||||
modelValue: Object,
|
||||
labelWidth: {
|
||||
|
@ -1,36 +1,28 @@
|
||||
<template>
|
||||
<!--COMPLETE-->
|
||||
<el-form
|
||||
ref="formRef"
|
||||
:label-width="labelWidth + 'px'"
|
||||
:model="modelValue"
|
||||
:rules="rules"
|
||||
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">
|
||||
<el-button type="primary" @click=""
|
||||
>查找
|
||||
</el-button
|
||||
>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@ -39,66 +31,70 @@
|
||||
<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>
|
||||
v-model="modelValue.school"
|
||||
placeholder="请输入所属院所或单位"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<FieldOptions
|
||||
ref="fieldFormRef"
|
||||
v-model="modelValue"
|
||||
:labelWidth="labelWidth"
|
||||
ref="fieldFormRef"
|
||||
v-model="modelValue"
|
||||
:labelWidth="labelWidth"
|
||||
/>
|
||||
|
||||
<InputBoxAdd
|
||||
ref="keywordsFormRef"
|
||||
v-model="modelValue"
|
||||
:labelWidth="labelWidth"
|
||||
fieldKey="keywords"
|
||||
placeholder="应用场景关键词+技术产品关键词"
|
||||
title="关键词"
|
||||
ref="keywordsFormRef"
|
||||
v-model="modelValue"
|
||||
:labelWidth="labelWidth"
|
||||
fieldKey="keywords"
|
||||
placeholder="应用场景关键词+技术产品关键词"
|
||||
title="关键词"
|
||||
/>
|
||||
<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>
|
||||
|
||||
<InputBoxAdd
|
||||
ref="directionsFormRef"
|
||||
v-model="modelValue"
|
||||
:labelWidth="labelWidth"
|
||||
fieldKey="researchs"
|
||||
placeholder="请输入研究方向"
|
||||
title="研究方向"
|
||||
<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>
|
||||
<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"
|
||||
ref="introduceRef"
|
||||
v-model="modelValue.introduction"
|
||||
:minHeight="150"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@ -106,11 +102,11 @@
|
||||
</el-form>
|
||||
</template>
|
||||
<script setup>
|
||||
import Editor from '@/components/WangEditor'
|
||||
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";
|
||||
import { reactive, ref, toRefs } from "vue";
|
||||
|
||||
const props = defineProps({
|
||||
modelValue: Object,
|
||||
@ -126,30 +122,41 @@ const props = defineProps({
|
||||
type: Number,
|
||||
default: 120,
|
||||
},
|
||||
})
|
||||
});
|
||||
|
||||
const formRef = ref()
|
||||
const cityFormRef = ref()
|
||||
const fieldFormRef = ref()
|
||||
const keywordsFormRef = ref()
|
||||
const directionsFormRef = ref()
|
||||
const introduceRef = ref()
|
||||
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"},
|
||||
name: [{ required: true, message: "请输入实验室名称", trigger: "blur" }],
|
||||
code: [{ required: true, message: "请输入组织机构代码", trigger: "blur" }],
|
||||
school: [
|
||||
{ required: true, message: "请输入所属院所或单位", trigger: "blur" },
|
||||
],
|
||||
introduction: [
|
||||
{
|
||||
pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
|
||||
required: true,
|
||||
message: "请输入实验室简介",
|
||||
trigger: ["change", "blur"],
|
||||
},
|
||||
],
|
||||
/*-----*/
|
||||
kind: [{ required: true, message: "请选择", trigger: "change" }],
|
||||
product: [{ required: true, message: "请输入", trigger: "blur" }],
|
||||
mobile: [
|
||||
{ required: true, message: "请输入", trigger: "blur" },
|
||||
{
|
||||
pattern: /^1[3-9]\d{9}$/,
|
||||
message: "请输入正确的手机号码",
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
researchId: [{required: true, message: "请选择", trigger: "change"}],
|
||||
researchId: [{ required: true, message: "请选择", trigger: "change" }],
|
||||
tenantId: [
|
||||
{
|
||||
required: true,
|
||||
@ -157,11 +164,10 @@ const data = reactive({
|
||||
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"}],
|
||||
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,
|
||||
@ -176,29 +182,9 @@ const data = reactive({
|
||||
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 { rules } = toRefs(data);
|
||||
|
||||
const validateForm = async () => {
|
||||
let formValid;
|
||||
@ -212,22 +198,17 @@ const validateForm = async () => {
|
||||
const keywordsFormValid = await keywordsFormRef.value.validateForm(); // 关键词表单验证
|
||||
const directionsFormValid = await directionsFormRef.value.validateForm(); // 研究方向表单验证
|
||||
return (
|
||||
formValid &&
|
||||
cityFormValid &&
|
||||
fieldFormValid &&
|
||||
keywordsFormValid &&
|
||||
directionsFormValid
|
||||
formValid &&
|
||||
cityFormValid &&
|
||||
fieldFormValid &&
|
||||
keywordsFormValid &&
|
||||
directionsFormValid
|
||||
);
|
||||
|
||||
};
|
||||
|
||||
defineExpose({
|
||||
validateForm
|
||||
})
|
||||
|
||||
// researchSelect().then(({data}) => {
|
||||
// researchOptions.value = data;
|
||||
// });
|
||||
validateForm,
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@ -236,15 +217,9 @@ defineExpose({
|
||||
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>
|
||||
</style>
|
||||
|
@ -1,16 +1,16 @@
|
||||
<template>
|
||||
<el-form
|
||||
ref="formRef"
|
||||
:label-width="labelWidth + 'px'"
|
||||
:model="modelValue"
|
||||
:rules="rules"
|
||||
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"/>
|
||||
<ImageUpload v-model="modelValue.image" :limit="1" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@ -30,46 +30,46 @@
|
||||
<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"/>
|
||||
<CityOptions
|
||||
ref="cityFormRef"
|
||||
v-model="modelValue"
|
||||
:labelWidth="labelWidth"
|
||||
/>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-col :span="12">
|
||||
<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"
|
||||
<field-options
|
||||
ref="fieldFormRef"
|
||||
v-model="modelValue"
|
||||
:labelWidth="labelWidth"
|
||||
/>
|
||||
|
||||
<InputBoxAdd
|
||||
ref="directionsFormRef"
|
||||
v-model="modelValue"
|
||||
:labelWidth="labelWidth"
|
||||
fieldKey="researchs"
|
||||
placeholder="请输入研究方向"
|
||||
title="研究方向"
|
||||
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"
|
||||
v-model="modelValue.license"
|
||||
:isShowTip="false"
|
||||
:limit="1"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@ -79,9 +79,10 @@
|
||||
<el-col :span="24">
|
||||
<el-form-item label="机构简介" prop="introduce">
|
||||
<editor
|
||||
ref="introduceRef"
|
||||
v-model="modelValue.introduce"
|
||||
:minHeight="150"
|
||||
ref="introduceRef"
|
||||
v-model="modelValue.introduce"
|
||||
:minHeight="150"
|
||||
@blur="handleBlur"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@ -89,18 +90,21 @@
|
||||
</el-form>
|
||||
</template>
|
||||
<script setup>
|
||||
import Editor from '@/components/WangEditor'
|
||||
import { ref } from "vue";
|
||||
import Editor from "@/components/WangEditor";
|
||||
import CityOptions from "../CityOptions";
|
||||
import FieldSingle from "../FieldSingle";
|
||||
import FieldOptions from "../FieldOptions";
|
||||
import InputBoxAdd from "../InputBoxAdd";
|
||||
import {ref} from "vue";
|
||||
|
||||
const formRef = ref()
|
||||
const cityFormRef = ref()
|
||||
const fieldFormRef = ref()
|
||||
const directionsFormRef = ref()
|
||||
const introduceRef = ref()
|
||||
const formRef = ref();
|
||||
const cityFormRef = ref();
|
||||
const fieldFormRef = ref();
|
||||
const directionsFormRef = ref();
|
||||
const introduceRef = ref();
|
||||
|
||||
const handleBlur = (value) => {
|
||||
console.log(value);
|
||||
};
|
||||
const props = defineProps({
|
||||
modelValue: Object,
|
||||
isAdd: {
|
||||
@ -115,21 +119,21 @@ const props = defineProps({
|
||||
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"}],
|
||||
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"},
|
||||
{ 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"}],
|
||||
research_id: [{ required: true, message: "请选择", trigger: "change" }],
|
||||
tenant_id: [
|
||||
{
|
||||
required: true,
|
||||
@ -137,11 +141,11 @@ const rules = {
|
||||
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"}],
|
||||
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" }],
|
||||
workAt: [
|
||||
{
|
||||
required: true,
|
||||
@ -163,7 +167,7 @@ const rules = {
|
||||
trigger: ["change", "blur"],
|
||||
},
|
||||
],
|
||||
}
|
||||
};
|
||||
|
||||
const validateForm = async () => {
|
||||
let formValid;
|
||||
@ -175,18 +179,15 @@ const validateForm = async () => {
|
||||
const cityFormValid = await cityFormRef.value.validateForm();
|
||||
const fieldFormValid = await fieldFormRef.value.validateForm();
|
||||
const directionsFormValid = await directionsFormRef.value.validateForm();
|
||||
const introduceValid = await introduceRef.value.validateForm();
|
||||
// const introduceValid = await introduceRef.value.validateForm();
|
||||
return (
|
||||
formValid &&
|
||||
cityFormValid &&
|
||||
fieldFormValid &&
|
||||
directionsFormValid &&
|
||||
introduceValid
|
||||
formValid && cityFormValid && fieldFormValid && directionsFormValid
|
||||
// introduceValid
|
||||
);
|
||||
}
|
||||
};
|
||||
defineExpose({
|
||||
validateForm
|
||||
})
|
||||
validateForm,
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@ -200,4 +201,4 @@ defineExpose({
|
||||
display: block;
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
Reference in New Issue
Block a user