需求列表 产品列表
This commit is contained in:
306
src/views/components/ExpertForm/index.vue
Normal file
306
src/views/components/ExpertForm/index.vue
Normal file
@ -0,0 +1,306 @@
|
||||
<template>
|
||||
<el-form
|
||||
ref="formRef"
|
||||
:model="modelValue"
|
||||
:rules="rules"
|
||||
:label-width="labelWidth + 'px'"
|
||||
>
|
||||
<div class="form_title" v-if="showTitle">基本信息</div>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="专家头像:">
|
||||
<ImageUpload v-model="modelValue.image" :limit="1" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="姓名:" prop="name">
|
||||
<el-input v-model="modelValue.name"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<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="12">
|
||||
<el-form-item label="所属单位:" prop="research_id">
|
||||
<el-select
|
||||
v-model="modelValue.research_id"
|
||||
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
|
||||
v-model="modelValue.laboratory_id"
|
||||
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>
|
||||
</el-row>
|
||||
|
||||
<CityOptions
|
||||
v-model="modelValue"
|
||||
:labelWidth="labelWidth"
|
||||
ref="cityFormRef"
|
||||
/>
|
||||
|
||||
<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>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="毕业院校:" prop="school">
|
||||
<el-input v-model="modelValue.school"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="最高学历:" prop="education">
|
||||
<el-select v-model="modelValue.education" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in educationOptions"
|
||||
:key="item.text"
|
||||
:label="item.text"
|
||||
:value="item.text"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="主修专业:" prop="major">
|
||||
<el-input v-model="modelValue.major"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="职务:" prop="job">
|
||||
<el-input v-model="modelValue.job"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="职称:" prop="title">
|
||||
<el-input v-model="modelValue.title"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="从业时间:" prop="work_at">
|
||||
<el-date-picker
|
||||
v-model="modelValue.work_at"
|
||||
type="date"
|
||||
value-format="YYYY-MM-DD"
|
||||
placeholder="选择日期"
|
||||
>
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="性别:" prop="gender">
|
||||
<el-radio v-model="modelValue.gender" :label="1">男</el-radio>
|
||||
<el-radio v-model="modelValue.gender" :label="2">女</el-radio>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<FieldOptions
|
||||
v-model="modelValue"
|
||||
:labelWidth="labelWidth"
|
||||
ref="fieldFormRef"
|
||||
/>
|
||||
|
||||
<InputBoxAdd
|
||||
:labelWidth="labelWidth"
|
||||
v-model="modelValue"
|
||||
title="关键词"
|
||||
placeholder="应用场景关键词+技术产品关键词"
|
||||
fieldKey="keywords"
|
||||
ref="keywordsFormRef"
|
||||
/>
|
||||
<InputBoxAdd
|
||||
:labelWidth="labelWidth"
|
||||
v-model="modelValue"
|
||||
title="研究方向"
|
||||
placeholder="请输入研究方向"
|
||||
fieldKey="researchs"
|
||||
ref="researchsFormRef"
|
||||
/>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="个人简介:" prop="introduce">
|
||||
<el-input
|
||||
v-model="modelValue.introduce"
|
||||
type="textarea"
|
||||
:autosize="{ minRows: 2, maxRows: 8 }"
|
||||
maxlength="400"
|
||||
show-word-limit
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</template>
|
||||
|
||||
<script setup name="ExpertForm">
|
||||
import CityOptions from "@/views/components/CityOptions";
|
||||
import FieldOptions from "@/views/components/FieldOptions";
|
||||
import InputBoxAdd from "@/views/components/InputBoxAdd";
|
||||
import { educationOptions } from "@/utils/parameter";
|
||||
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 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",
|
||||
},
|
||||
],
|
||||
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 { rules } = toRefs(data);
|
||||
const researchOptions = ref([]);
|
||||
const options = ref([]);
|
||||
const formRef = ref();
|
||||
const cityFormRef = ref();
|
||||
const fieldFormRef = ref();
|
||||
const keywordsFormRef = ref();
|
||||
const researchsFormRef = ref();
|
||||
|
||||
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 researchsFormValid = await researchsFormRef.value.validateForm();
|
||||
return (
|
||||
formValid &&
|
||||
cityFormValid &&
|
||||
fieldFormValid &&
|
||||
keywordsFormValid &&
|
||||
researchsFormValid
|
||||
);
|
||||
// if (isAdd.value) {
|
||||
// // const directionsFormValid = await directionsFormRef.value.validateForm();
|
||||
// return formValid && cityFormValid && fieldFormValid && researchsFormValid;
|
||||
// } else {
|
||||
// return formValid && cityFormValid && fieldFormValid && keywordsFormValid;
|
||||
// }
|
||||
};
|
||||
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>
|
307
src/views/components/ReleaseForm/index.vue
Normal file
307
src/views/components/ReleaseForm/index.vue
Normal file
@ -0,0 +1,307 @@
|
||||
<template>
|
||||
<el-form
|
||||
ref="formRef"
|
||||
:model="modelValue"
|
||||
:rules="rules"
|
||||
:label-width="labelWidth + 'px'"
|
||||
>
|
||||
<div class="form_title">
|
||||
<p><b>基本信息</b></p>
|
||||
</div>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="产品名称:" prop="title">
|
||||
<el-input
|
||||
v-model="modelValue.title"
|
||||
placeholder="请输入产品名称"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<FieldOptions
|
||||
v-model="modelValue"
|
||||
:labelWidth="labelWidth"
|
||||
ref="fieldFormRef"
|
||||
/>
|
||||
|
||||
<InputBoxAdd
|
||||
:labelWidth="labelWidth"
|
||||
v-model="modelValue"
|
||||
title="应用客户"
|
||||
placeholder="请输入应用客户"
|
||||
fieldKey="customers"
|
||||
ref="customerFormRef"
|
||||
/>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="产品成熟度:" prop="maturity">
|
||||
<el-select
|
||||
v-model="modelValue.maturity"
|
||||
clearable
|
||||
placeholder="请选择"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in maturityOptions"
|
||||
:key="item.key"
|
||||
:label="item.value"
|
||||
:value="item.key"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="成果领先性:" prop="leadStandard">
|
||||
<el-select
|
||||
v-model="modelValue.leadStandard"
|
||||
clearable
|
||||
placeholder="请选择"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in leadOptions"
|
||||
:key="item.key"
|
||||
:label="item.value"
|
||||
:value="item.key"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="合作模式:">
|
||||
<el-select
|
||||
v-model="modelValue.cooperationMode"
|
||||
clearable
|
||||
placeholder="请选择"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in cooperationOptions"
|
||||
:key="item.key"
|
||||
:label="item.value"
|
||||
:value="item.key"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<InputBoxAdd
|
||||
:labelWidth="labelWidth"
|
||||
v-model="modelValue"
|
||||
title="关键词"
|
||||
placeholder="请输入关键词"
|
||||
fieldKey="keywords"
|
||||
ref="keywordsForm"
|
||||
/>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="产品简介:" prop="introduce">
|
||||
<wangEditor
|
||||
v-model="modelValue.introduce"
|
||||
min-height="150px"
|
||||
width="100%"
|
||||
ref="introduceRef"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="产品图片:" prop="image">
|
||||
<ImageUpload v-model="modelValue.image" :limit="1" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="产品视频:">
|
||||
<VideoUpload
|
||||
v-model="modelValue.video"
|
||||
:limit="1"
|
||||
:fileType="['mp4']"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<p>
|
||||
<b>图片材料上传</b>
|
||||
</p>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="证明材料:" prop="material">
|
||||
<FileUpload
|
||||
v-model="modelValue.material"
|
||||
:limit="1"
|
||||
:fileType="['doc', 'xls', 'pdf', 'jpg', 'png', 'zip']"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</template>
|
||||
<script setup>
|
||||
import CityOptions from "@/views/components/CityOptions";
|
||||
import FieldOptions from "@/views/components/FieldOptions";
|
||||
import InputBoxAdd from "@/views/components/InputBoxAdd";
|
||||
import {
|
||||
maturityOptions,
|
||||
leadOptions,
|
||||
cooperationOptions,
|
||||
} from "@/utils/parameter";
|
||||
import { reactive, toRefs } from "vue";
|
||||
import VideoUpload from "@/components/VideoUpload";
|
||||
// import { researchSelect, laboratorySelect } from "@/api/identity/index";
|
||||
|
||||
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 data = reactive({
|
||||
rules: {
|
||||
// product: [{ required: true, message: "请输入", trigger: "blur" }],
|
||||
title: [{ 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" }],
|
||||
maturity: [{ 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"],
|
||||
},
|
||||
],
|
||||
leadStandard: [
|
||||
{
|
||||
required: true,
|
||||
message: "请上传",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
],
|
||||
introduce: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入",
|
||||
trigger: ["change", "blur"],
|
||||
},
|
||||
],
|
||||
image: [
|
||||
{
|
||||
required: true,
|
||||
message: "请上传",
|
||||
trigger: ["change", "blur"],
|
||||
},
|
||||
],
|
||||
video: [
|
||||
{
|
||||
required: true,
|
||||
message: "请上传",
|
||||
trigger: ["change", "blur"],
|
||||
},
|
||||
],
|
||||
},
|
||||
});
|
||||
const { rules } = toRefs(data);
|
||||
const formRef = ref(null);
|
||||
const fieldFormRef = ref(null);
|
||||
const customerFormRef = ref(null);
|
||||
const validateForm = async () => {
|
||||
// await formRef.value.validate();
|
||||
let formValid;
|
||||
try {
|
||||
formValid = await formRef.value.validate();
|
||||
} catch (error) {
|
||||
formValid = false;
|
||||
}
|
||||
const fieldFormValid = await fieldFormRef.value.validateForm(); // 城市选择表单验证
|
||||
const customerValid = await customerFormRef.value.validateForm(); // 领域选择表单验证
|
||||
console.log(formValid, fieldFormValid, customerValid);
|
||||
return formValid && fieldFormValid && customerValid;
|
||||
// const keywordsFormValid = await keywordsFormRef.value.validateForm(); // 关键词表单验证
|
||||
// console.log(cityFormValid);
|
||||
// if (isAdd.value) {
|
||||
// const directionsFormValid = await directionsFormRef.value.validateForm();
|
||||
// return (
|
||||
// formValid &&
|
||||
// cityFormValid &&
|
||||
// fieldFormValid &&
|
||||
// keywordsFormValid &&
|
||||
// directionsFormValid
|
||||
// );
|
||||
// } else {
|
||||
// return formValid && cityFormValid && fieldFormValid && keywordsFormValid;
|
||||
// }
|
||||
};
|
||||
defineExpose({
|
||||
validateForm,
|
||||
});
|
||||
// const submitForm = () => {
|
||||
// let flag = false;
|
||||
// this.$refs["formRef"].validate((valid) => {
|
||||
// const fieldForm = this.$refs.fieldForm.submitForm();
|
||||
// const customerForm = this.$refs.customerForm.submitForm();
|
||||
// const keywordsForm = this.$refs.keywordsForm.submitForm();
|
||||
// if (valid && fieldForm && customerForm && keywordsForm) {
|
||||
// flag = !flag;
|
||||
// }
|
||||
// });
|
||||
// return flag;
|
||||
// };
|
||||
</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>
|
Reference in New Issue
Block a user