bug fixed
This commit is contained in:
@ -148,8 +148,8 @@
|
||||
import CityOptions from "@/views/components/CityOptions";
|
||||
import FieldOptions from "@/views/components/FieldOptions";
|
||||
import InputBoxAdd from "@/views/components/InputBoxAdd";
|
||||
import { researchSelect } from "@/api/dataList/research";
|
||||
import { laboratorySelect } from "@/api/dataList/laboratory";
|
||||
// import { researchSelect } from "@/api/dataList/research";
|
||||
// import { laboratorySelect } from "@/api/dataList/laboratory";
|
||||
export default {
|
||||
components: {
|
||||
CityOptions,
|
||||
|
||||
@ -98,6 +98,7 @@
|
||||
</template>
|
||||
<script setup>
|
||||
import Editor from "@/components/WangEditor";
|
||||
import { demandCategoryList } from "@/utils/parameter";
|
||||
import { ref, toRefs } from "vue";
|
||||
const props = defineProps({
|
||||
isShow: {
|
||||
@ -110,23 +111,6 @@ const props = defineProps({
|
||||
},
|
||||
});
|
||||
const { isShow, modelValue } = toRefs(props);
|
||||
const checkList = reactive([
|
||||
{
|
||||
id: 1,
|
||||
name: "成果推广",
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
name: "关键成果解决",
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
name: "对接专家院士",
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
name: "上市辅导",
|
||||
},
|
||||
]);
|
||||
const checkList = reactive(demandCategoryList);
|
||||
</script>
|
||||
<style></style>
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<!-- 企业需求弹框 -->
|
||||
<template>
|
||||
<el-dialog title="基本信息" v-model="isShow">
|
||||
<el-dialog title="基本信息" :model-value="isShow" @close="close">
|
||||
<el-form
|
||||
ref="formRef"
|
||||
:model="modelValue"
|
||||
@ -10,13 +10,13 @@
|
||||
<p><b>基本信息</b></p>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="成果需求名称:" prop="title">
|
||||
<el-form-item label="技术需求名称:" prop="title">
|
||||
<el-input v-model="modelValue.title"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-row v-if="false">
|
||||
<el-col :span="24">
|
||||
<!-- <el-checkbox label="0" @change="handleCheck">其他</el-checkbox> -->
|
||||
<el-form-item label="需求类别:">
|
||||
@ -46,11 +46,6 @@
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<!-- <CityOptions
|
||||
v-model="form"
|
||||
:labelWidth="labelWidth"
|
||||
ref="cityForm"
|
||||
/> -->
|
||||
<FieldOptions
|
||||
v-model="modelValue"
|
||||
:labelWidth="labelWidth"
|
||||
@ -58,10 +53,17 @@
|
||||
ref="fieldFormRef"
|
||||
/>
|
||||
|
||||
<CityOptions
|
||||
disabled
|
||||
v-model="modelValue"
|
||||
:labelWidth="labelWidth"
|
||||
ref="cityFormRef"
|
||||
/>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item
|
||||
label="成果需求预算:"
|
||||
label="技术需求预算:"
|
||||
:prop="modelValue.budgetMode == 1 ? 'budget' : ''"
|
||||
>
|
||||
<el-input
|
||||
@ -160,7 +162,9 @@
|
||||
</template>
|
||||
<script setup>
|
||||
import { updateTechnologyDemand } from "@/api/dataApproval/enterpriseTechnologyDemand";
|
||||
import { demandCategoryList } from "@/utils/parameter";
|
||||
import WangEditor from "@/components/WangEditor";
|
||||
import CityOptions from "@/views/components/CityOptions";
|
||||
import FieldOptions from "@/views/components/FieldOptions";
|
||||
import InputBoxAdd from "@/views/components/InputBoxAdd";
|
||||
import { ElMessage } from "element-plus";
|
||||
@ -178,30 +182,16 @@ const props = defineProps({
|
||||
});
|
||||
const { isShow, modelValue } = toRefs(props);
|
||||
const labelWidth = 160;
|
||||
const checkList = reactive([
|
||||
{
|
||||
id: 1,
|
||||
name: "成果推广",
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
name: "关键成果解决",
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
name: "对接专家院士",
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
name: "上市辅导",
|
||||
},
|
||||
]);
|
||||
const checkList = reactive(demandCategoryList);
|
||||
const approve = async (status) => {
|
||||
let title = status == 1 ? "通过" : "驳回";
|
||||
await updateTechnologyDemand({ id: modelValue.value.id, status });
|
||||
ElMessage.success(`已${title}需求`);
|
||||
emit("update:is-show", false);
|
||||
emit("update:isShow", false);
|
||||
emit("update-list");
|
||||
};
|
||||
const close = () => {
|
||||
emit("update:isShow", false);
|
||||
};
|
||||
</script>
|
||||
<style></style>
|
||||
|
||||
@ -158,19 +158,41 @@ const validateForm = async () => {
|
||||
};
|
||||
|
||||
getProvinceList();
|
||||
|
||||
watch(
|
||||
modelValue,
|
||||
() => modelValue.value.province,
|
||||
(val) => {
|
||||
if (val.province) {
|
||||
getCityListByProvinceId(val.province);
|
||||
}
|
||||
if (val.city) {
|
||||
getAreaListByCityId(val.city);
|
||||
}
|
||||
console.log("changed province");
|
||||
val && getCityListByProvinceId(val);
|
||||
},
|
||||
{ deep: true }
|
||||
{
|
||||
immediate: true,
|
||||
}
|
||||
);
|
||||
|
||||
watch(
|
||||
() => modelValue.value.city,
|
||||
(val) => {
|
||||
console.log("changed city");
|
||||
val && getAreaListByCityId(val);
|
||||
},
|
||||
{
|
||||
immediate: true,
|
||||
}
|
||||
);
|
||||
// watch(
|
||||
// modelValue,
|
||||
// (val) => {
|
||||
// if (val.province) {
|
||||
// getCityListByProvinceId(val.province);
|
||||
// }
|
||||
// if (val.city) {
|
||||
// getAreaListByCityId(val.city);
|
||||
// }
|
||||
// },
|
||||
// { deep: true }
|
||||
// );
|
||||
|
||||
defineExpose({
|
||||
validateForm,
|
||||
});
|
||||
|
||||
@ -153,6 +153,7 @@
|
||||
<script>
|
||||
import FieldOptions from "@/views/components/FieldOptions";
|
||||
import InputBoxAdd from "@/views/components/InputBoxAdd";
|
||||
import { demandCategoryList } from "@/utils/parameter";
|
||||
export default {
|
||||
components: {
|
||||
FieldOptions,
|
||||
@ -183,24 +184,7 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
checkList: [
|
||||
{
|
||||
id: 1,
|
||||
name: "成果推广",
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
name: "关键成果解决",
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
name: "对接专家院士",
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
name: "上市辅导",
|
||||
},
|
||||
],
|
||||
checkList: demandCategoryList,
|
||||
checkInput: "",
|
||||
rules: {
|
||||
title: [
|
||||
@ -250,4 +234,4 @@ export default {
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
</script>
|
||||
|
||||
@ -124,13 +124,13 @@
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<!-- <el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="所属站点:" prop="tenantId">
|
||||
<SiteOptions v-model="modelValue.tenantId" :site-list="siteList" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-row> -->
|
||||
|
||||
<!-- <el-row v-if="formType == 1">
|
||||
<el-col :span="12">
|
||||
@ -318,15 +318,15 @@
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item :label="introduceName" prop="introduce">
|
||||
<el-input
|
||||
<!-- <el-input
|
||||
v-if="formType == 1"
|
||||
v-model="modelValue.introduce"
|
||||
type="textarea"
|
||||
:autosize="{ minRows: 2, maxRows: 6 }"
|
||||
/>
|
||||
/> -->
|
||||
<!-- v-else -->
|
||||
<WangEditor
|
||||
:readOnly="!isAdd"
|
||||
v-else
|
||||
v-model="modelValue.introduce"
|
||||
minHeight="150px"
|
||||
/>
|
||||
@ -346,13 +346,13 @@
|
||||
import CityOptions from "@/views/components/CityOptions";
|
||||
// import FieldOptions from "@/views/components/FieldOptions";
|
||||
import InputBoxAdd from "@/views/components/InputBoxAdd";
|
||||
import { researchSelect } from "@/api/dataList/research";
|
||||
import { laboratorySelect } from "@/api/dataList/laboratory";
|
||||
// import { researchSelect } from "@/api/dataList/research";
|
||||
// import { laboratorySelect } from "@/api/dataList/laboratory";
|
||||
import { tenantSelect } from "@/api/subPlatform/tenant";
|
||||
import { enterpriseOptions } from "@/utils/parameter";
|
||||
import { reactive, ref, toRefs } from "vue";
|
||||
import WangEditor from "../../../components/WangEditor/index.vue";
|
||||
import SiteOptions from "@/views/components/SiteOptions";
|
||||
import WangEditor from "@/components/WangEditor/index.vue";
|
||||
// import SiteOptions from "@/views/components/SiteOptions";
|
||||
import FieldOptions from "@/views/components/FieldOptions";
|
||||
|
||||
const props = defineProps({
|
||||
|
||||
@ -292,8 +292,8 @@
|
||||
import CityOptions from "@/views/components/CityOptions";
|
||||
// import FieldOptions from "@/views/components/FieldOptions";
|
||||
import InputBoxAdd from "@/views/components/InputBoxAdd";
|
||||
import { researchSelect } from "@/api/dataList/research";
|
||||
import { laboratorySelect } from "@/api/dataList/laboratory";
|
||||
// import { researchSelect } from "@/api/dataList/research";
|
||||
// import { laboratorySelect } from "@/api/dataList/laboratory";
|
||||
import { tenantSelect } from "@/api/subPlatform/tenant";
|
||||
import { enterpriseOptions } from "@/utils/parameter";
|
||||
import { reactive, ref, toRefs } from "vue";
|
||||
|
||||
@ -70,7 +70,7 @@
|
||||
<el-tag
|
||||
v-for="(tag, index) in industrysTags"
|
||||
:key="index"
|
||||
closable
|
||||
:closable="!disabled"
|
||||
@close="handleFieldClose(index)"
|
||||
>
|
||||
{{ getFieldNameById(tag) }}
|
||||
@ -216,7 +216,7 @@ watch(
|
||||
modelValue,
|
||||
(newVal) => {
|
||||
modelValue.value.industrys = [];
|
||||
console.log(modelValue.value.industry ? 1 : 0);
|
||||
// console.log(modelValue.value.industry ? 1 : 0);
|
||||
let industrysList = modelValue.value.industry
|
||||
? modelValue.value.industry.split(",")
|
||||
: [];
|
||||
|
||||
@ -31,7 +31,7 @@
|
||||
<el-tag
|
||||
v-for="(tag, index) in modelValue[fieldKey]"
|
||||
:key="index"
|
||||
closable
|
||||
:closable="!disabled"
|
||||
@close="handleFieldClose(fieldKey, index)"
|
||||
>
|
||||
{{ tag }}
|
||||
@ -77,8 +77,8 @@ const dataVal = ref("");
|
||||
const formRef = ref(null);
|
||||
const keyWordAdd = () => {
|
||||
if (!dataVal.value.length) return ElMessage.error(`请输入${title.value}`);
|
||||
if(!modelValue.value[fieldKey.value]){
|
||||
modelValue.value[fieldKey.value]=[]
|
||||
if (!modelValue.value[fieldKey.value]) {
|
||||
modelValue.value[fieldKey.value] = [];
|
||||
}
|
||||
modelValue.value[fieldKey.value].push(dataVal.value);
|
||||
dataVal.value = "";
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<el-form
|
||||
ref="form"
|
||||
:model="value"
|
||||
ref="formRef"
|
||||
:model="modelValue"
|
||||
:rules="rules"
|
||||
:label-width="labelWidth + 'px'"
|
||||
>
|
||||
@ -9,84 +9,65 @@
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="实验室名称" prop="name">
|
||||
<el-input v-model="value.name" :disabled="!isAdd"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="组织机构代码:" prop="code">
|
||||
<el-row type="flex" justify="space-between">
|
||||
<el-col :span="20">
|
||||
<el-input v-model="value.code" :disabled="!isAdd"></el-input>
|
||||
</el-col>
|
||||
<el-col :span="3">
|
||||
<el-button type="primary" @click="" :disabled="!isAdd"
|
||||
>查找</el-button
|
||||
>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="所属站点:" prop="tenant_id">
|
||||
<SiteOptions :size="''" :limitWidth="false" v-model="value" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="所属单位:" prop="research_id">
|
||||
<el-select
|
||||
v-model="value.research_id"
|
||||
filterable
|
||||
placeholder="请选择"
|
||||
>
|
||||
<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-row>
|
||||
|
||||
<CityOptions v-model="value" :labelWidth="labelWidth" ref="cityForm" />
|
||||
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="详细地址:">
|
||||
<el-input
|
||||
v-model="value.address"
|
||||
placeholder="请输入详细地址"
|
||||
v-model="modelValue.name"
|
||||
placeholder="请输入实验室全称"
|
||||
:disabled="!isAdd"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="所属单院所或高校:" prop="school">
|
||||
<el-input
|
||||
v-model="modelValue.school"
|
||||
placeholder="请输入所属单院所或高校"
|
||||
></el-input>
|
||||
<!-- <el-option
|
||||
v-for="item in researchOptions"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
>
|
||||
</el-option> -->
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<!-- <CityOptions v-model="modelValue" :labelWidth="labelWidth" ref="cityForm" /> -->
|
||||
|
||||
<!-- <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="value.url"
|
||||
v-model="modelValue.url"
|
||||
placeholder="请输入实验室网站"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<FieldOptions v-model="value" :labelWidth="labelWidth" ref="fieldForm" />
|
||||
<FieldOptions
|
||||
v-model="modelValue"
|
||||
:labelWidth="labelWidth"
|
||||
ref="fieldFormRef"
|
||||
/>
|
||||
|
||||
<!-- <FieldSingle
|
||||
v-model="value"
|
||||
v-model="modelValue"
|
||||
:isAdd="isAdd"
|
||||
:labelWidth="labelWidth"
|
||||
ref="fieldForm"
|
||||
@ -94,42 +75,231 @@
|
||||
|
||||
<InputBoxAdd
|
||||
:labelWidth="labelWidth"
|
||||
v-model="value"
|
||||
v-model="modelValue"
|
||||
title="关键词"
|
||||
placeholder="应用场景关键词+技术产品关键词"
|
||||
fieldKey="keywords"
|
||||
ref="keywordsForm"
|
||||
ref="keywordsFormRef"
|
||||
/>
|
||||
|
||||
<InputBoxAdd
|
||||
<!-- <InputBoxAdd
|
||||
:labelWidth="labelWidth"
|
||||
v-model="value"
|
||||
v-model="modelValue"
|
||||
title="研究方向"
|
||||
placeholder="请输入研究方向"
|
||||
fieldKey="researchs"
|
||||
ref="directionsForm"
|
||||
/>
|
||||
|
||||
|
||||
/> -->
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="实验室简介" prop="introduce">
|
||||
<Editor
|
||||
v-model="value.introduce"
|
||||
:minHeight="150"
|
||||
ref="introduceRef"
|
||||
@click.native="handleEditAble"
|
||||
<el-form-item label="研究方向" prop="researchDirection">
|
||||
<el-input
|
||||
v-model="modelValue.researchDirection"
|
||||
type="textarea"
|
||||
:autosize="{ minRows: 4 }"
|
||||
placeholder="请输入研究方向"
|
||||
></el-input> </el-form-item></el-col
|
||||
></el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="主要技术应用场景" prop="primaryTechnology">
|
||||
<el-input
|
||||
v-model="modelValue.primaryTechnology"
|
||||
type="textarea"
|
||||
:autosize="{ minRows: 4 }"
|
||||
placeholder="请输入主要技术应用场景"
|
||||
></el-input> </el-form-item></el-col
|
||||
></el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="承担科研项目情况" prop="researchProject">
|
||||
<el-input
|
||||
v-model="modelValue.researchProject"
|
||||
type="textarea"
|
||||
:autosize="{ minRows: 4 }"
|
||||
placeholder="请输入承担科研项目情况"
|
||||
></el-input> </el-form-item></el-col
|
||||
></el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="代表性科技成果" prop="achievement">
|
||||
<el-input
|
||||
v-model="modelValue.achievement"
|
||||
type="textarea"
|
||||
:autosize="{ minRows: 4 }"
|
||||
placeholder="请输入代表性科技成果"
|
||||
></el-input> </el-form-item></el-col
|
||||
></el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="联系电话" prop="phone">
|
||||
<el-input
|
||||
v-model="modelValue.phone"
|
||||
maxlength="11"
|
||||
oninput="value = value.replace(/[\D]+/, '')"
|
||||
placeholder="请输入联系电话"
|
||||
></el-input> </el-form-item></el-col
|
||||
></el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="网址" prop="url">
|
||||
<el-input
|
||||
placeholder="请输入网址"
|
||||
v-model="modelValue.url"
|
||||
></el-input> </el-form-item></el-col
|
||||
></el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="实验室简介" prop="introduction">
|
||||
<WangEditor
|
||||
v-model="modelValue.introduction"
|
||||
minHeight="320px"
|
||||
ref="introductionRef"
|
||||
@blur="formRef.validateField(`introduction`)"
|
||||
/>
|
||||
<!-- @click.native="handleEditAble" -->
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="核心成员及简介" prop="member">
|
||||
<WangEditor
|
||||
v-model="modelValue.member"
|
||||
minHeight="320px"
|
||||
ref="memberRef"
|
||||
@blur="formRef.validateField(`member`)"
|
||||
/>
|
||||
<!-- @click.native="handleEditAble" -->
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</template>
|
||||
<script>
|
||||
|
||||
<script setup>
|
||||
import CityOptions from "@/views/components/CityOptions";
|
||||
import FieldSingle from "@/views/components/FieldSingle";
|
||||
import FieldOptions from "@/views/components/FieldOptions";
|
||||
import InputBoxAdd from "@/views/components/InputBoxAdd";
|
||||
import { researchSelect } from "@/api/dataList/research";
|
||||
import { reactive, ref, toRefs, watch } from "vue";
|
||||
|
||||
const props = defineProps({
|
||||
modelValue: Object,
|
||||
isAdd: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
showTitle: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
labelWidth: {
|
||||
type: Number,
|
||||
default: 120,
|
||||
},
|
||||
});
|
||||
const { modelValue, isAdd, showTitle, labelWidth } = toRefs(props);
|
||||
|
||||
const researchOptions = ref([]);
|
||||
const options = 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" }],
|
||||
phone: [
|
||||
// { 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" }],
|
||||
workAt: [
|
||||
{
|
||||
required: true,
|
||||
message: "从业时间不能为空",
|
||||
trigger: ["change", "blur"],
|
||||
},
|
||||
],
|
||||
license: [
|
||||
{
|
||||
required: true,
|
||||
message: "请上传",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
],
|
||||
introduce: [
|
||||
{ required: true, message: "请输入实验室简介", trigger: "blur" },
|
||||
],
|
||||
},
|
||||
});
|
||||
|
||||
const { rules } = toRefs(data);
|
||||
|
||||
const formRef = ref();
|
||||
const fieldFormRef = ref();
|
||||
const keywordsFormRef = ref();
|
||||
// watch(modelValue.tenantId, (val) => {
|
||||
// console.log(val);
|
||||
// if (val) {
|
||||
// researchSelect({ tenantId: val }).then(({ data }) => {
|
||||
// researchOptions.value = data;
|
||||
// });
|
||||
// } else {
|
||||
// researchOptions.value = [];
|
||||
// if (modelValue.researchId) modelValue.researchId = undefined;
|
||||
// }
|
||||
// });
|
||||
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();
|
||||
return formValid && fieldFormValid && keywordsFormValid;
|
||||
// if (formType.value == 1) {
|
||||
// //个人
|
||||
// // const researchsFormValid = await researchsFormRef.value.validateForm(); //研究方向验证
|
||||
// } else if (formType.value == 2) {
|
||||
// //企业
|
||||
// // const directionsFormValid = await directionsFormRef.value.validateForm(); //生产方向验证
|
||||
// return (
|
||||
// formValid && fieldFormValid && fieldFormValid
|
||||
// // keywordsFormValid &&
|
||||
// // directionsFormValid
|
||||
// );
|
||||
// } else {
|
||||
// throw "未知的formType";
|
||||
// }
|
||||
};
|
||||
defineExpose({
|
||||
validateForm,
|
||||
});
|
||||
</script>
|
||||
|
||||
<!-- <script>
|
||||
export default {
|
||||
components: {
|
||||
CityOptions,
|
||||
@ -137,82 +307,14 @@ export default {
|
||||
FieldOptions,
|
||||
InputBoxAdd,
|
||||
},
|
||||
props: {
|
||||
value: Object,
|
||||
isAdd: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
showTitle: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
labelWidth: {
|
||||
type: Number,
|
||||
default: 120,
|
||||
},
|
||||
},
|
||||
|
||||
watch: {
|
||||
"value.tenant_id"(newOld) {
|
||||
console.log(newOld);
|
||||
if (newOld) {
|
||||
researchSelect({ tenant_id: newOld }).then(({ data }) => {
|
||||
this.researchOptions = data;
|
||||
});
|
||||
} else {
|
||||
this.researchOptions = [];
|
||||
if (this.value.research_id) this.value.research_id = undefined;
|
||||
}
|
||||
},
|
||||
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
researchOptions: [],
|
||||
options: [
|
||||
// { value: "", label: "" }
|
||||
],
|
||||
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: "blur" }],
|
||||
},
|
||||
|
||||
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
@ -239,7 +341,7 @@ export default {
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
</script> -->
|
||||
<style lang="scss" scoped>
|
||||
.form_title {
|
||||
font-weight: 700;
|
||||
@ -256,4 +358,4 @@ export default {
|
||||
display: block;
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user