|
@@ -0,0 +1,204 @@
|
|
|
+<template>
|
|
|
+ <div id="info">
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="24" class="main animate__animated animate__backInRight" v-loading="loading">
|
|
|
+ <el-col :span="24" class="one">
|
|
|
+ <cSearch :is_title="false" :is_back="true" @toBack="toBack"></cSearch>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24" class="two">
|
|
|
+ <cForm :span="24" :fields="fields" :form="form" :isSave="false" :disabled="true">
|
|
|
+ <template #type>
|
|
|
+ <el-option v-for="(i, index) in typeList" :key="index" :label="i.label" :value="i.value"></el-option>
|
|
|
+ </template>
|
|
|
+ <template #demand>
|
|
|
+ <el-option v-for="(i, index) in demandList" :key="index" :label="i.label" :value="i.value"></el-option>
|
|
|
+ </template>
|
|
|
+ <template #field>
|
|
|
+ <el-option v-for="(i, index) in fieldList" :key="index" :label="i.label" :value="i.value"></el-option>
|
|
|
+ </template>
|
|
|
+ <template #cooperation>
|
|
|
+ <el-option v-for="(i, index) in cooperationList" :key="index" :label="i.label" :value="i.value"></el-option>
|
|
|
+ </template>
|
|
|
+ <template #achievestatus>
|
|
|
+ <el-option v-for="(i, index) in achievestatusList" :key="index" :label="i.label" :value="i.value"></el-option>
|
|
|
+ </template>
|
|
|
+ <template #achievesource>
|
|
|
+ <el-option v-for="(i, index) in achievesourceList" :key="index" :label="i.label" :value="i.value"></el-option>
|
|
|
+ </template>
|
|
|
+ <template #file>
|
|
|
+ <el-image class="image" v-for="i in form.file" :key="i.url" :src="i.url" @click="imgView(i.url)"></el-image>
|
|
|
+ </template>
|
|
|
+ <template #patent>
|
|
|
+ <cTable :fields="patentFields" :opera="[]" :list="form.patent" :usePage="false"> </cTable>
|
|
|
+ </template>
|
|
|
+ <template #roadshow>
|
|
|
+ <el-link :underline="false" v-for="i in form.roadshow" :key="i.url" :href="i.url" blank="_target">{{ i.name }}</el-link>
|
|
|
+ </template>
|
|
|
+ <template #messattribute>
|
|
|
+ <el-option v-for="(i, index) in messattributeList" :key="index" :label="i.label" :value="i.value"></el-option>
|
|
|
+ </template>
|
|
|
+ </cForm>
|
|
|
+ </el-col>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script setup lang="ts">
|
|
|
+// 基础
|
|
|
+import type { Ref } from 'vue';
|
|
|
+import { onMounted, ref } from 'vue';
|
|
|
+import { useRoute } from 'vue-router';
|
|
|
+
|
|
|
+// 接口
|
|
|
+import { ProductStore } from '@common/src/stores/allAdmin/product';
|
|
|
+import { DictDataStore } from '@common/src/stores/system/dictData'; // 字典表
|
|
|
+import type { IQueryResult } from '@/util/types.util';
|
|
|
+const productAxios = ProductStore();
|
|
|
+const dictAxios = DictDataStore();
|
|
|
+// 路由
|
|
|
+const route = useRoute();
|
|
|
+
|
|
|
+// 加载中
|
|
|
+const loading: Ref<any> = ref(false);
|
|
|
+
|
|
|
+const form: Ref<any> = ref({ patent: [] });
|
|
|
+const fields: Ref<any> = ref([
|
|
|
+ { label: '类型', model: 'type', type: 'select' },
|
|
|
+ { label: '企业名称', model: 'company' },
|
|
|
+ { label: '联系人', model: 'contact' },
|
|
|
+ { label: '手机号', model: 'phone' },
|
|
|
+ { label: '电子邮箱', model: 'email' },
|
|
|
+ { label: 'qq&微信', model: 'qqwx' },
|
|
|
+ { label: '名称', model: 'name' }
|
|
|
+]);
|
|
|
+// 专利信息
|
|
|
+const patentFields: Ref<any> = ref([
|
|
|
+ { label: '名称', model: 'name' },
|
|
|
+ { label: '状态', model: 'status', format: (i: any) => getDict(i, 'status') }
|
|
|
+]);
|
|
|
+
|
|
|
+// 字典表
|
|
|
+const typeList: Ref<any> = ref([]);
|
|
|
+const demandList: Ref<any> = ref([]);
|
|
|
+const fieldList: Ref<any> = ref([]);
|
|
|
+const cooperationList: Ref<any> = ref([]);
|
|
|
+const achievestatusList: Ref<any> = ref([]);
|
|
|
+const achievesourceList: Ref<any> = ref([]);
|
|
|
+const patent_statusList: Ref<any> = ref([]);
|
|
|
+const messattributeList: Ref<any> = ref([]);
|
|
|
+// 请求
|
|
|
+onMounted(async () => {
|
|
|
+ loading.value = true;
|
|
|
+ await searchOther();
|
|
|
+ await search();
|
|
|
+ loading.value = false;
|
|
|
+});
|
|
|
+const search = async () => {
|
|
|
+ let id = route.query.id;
|
|
|
+ if (id) {
|
|
|
+ let res: IQueryResult = await productAxios.fetch(id);
|
|
|
+ if (res.errcode == '0') {
|
|
|
+ let data = res.data as any;
|
|
|
+ if (data && data.patent.length <= 0) data.patent = [];
|
|
|
+ form.value = data;
|
|
|
+ // 辨识信息类型
|
|
|
+ getFields(data.type);
|
|
|
+ }
|
|
|
+ }
|
|
|
+};
|
|
|
+const getDict = (e, model) => {
|
|
|
+ if (model == 'status') {
|
|
|
+ let data: any = patent_statusList.value.find((i: any) => i.value == e);
|
|
|
+ if (data) return data.label;
|
|
|
+ else return '暂无';
|
|
|
+ }
|
|
|
+};
|
|
|
+const getFields = (type) => {
|
|
|
+ let list: any = [];
|
|
|
+ if (type == '0') {
|
|
|
+ list = [
|
|
|
+ { label: '需求紧急程度', model: 'demand', type: 'select' },
|
|
|
+ { label: '所属领域', model: 'field', type: 'select' },
|
|
|
+ { label: '投资预算', model: 'budget' },
|
|
|
+ { label: '合作方式', model: 'cooperation', type: 'select' },
|
|
|
+ { label: '技术说明', model: 'requirementdesc', type: 'textarea' },
|
|
|
+ { label: '预期目标', model: 'expect', type: 'textarea' },
|
|
|
+ { label: '需求现状', model: 'present', type: 'textarea' },
|
|
|
+ { label: '合作条件及要求', model: 'condition', type: 'textarea' },
|
|
|
+ { label: '产品图片(6)', model: 'file', custom: true }
|
|
|
+ ];
|
|
|
+ } else if (type == '1') {
|
|
|
+ list = [
|
|
|
+ { label: '所属领域', model: 'field', type: 'select' },
|
|
|
+ { label: '合作方式', model: 'cooperation', type: 'select' },
|
|
|
+ { label: '成果状态', model: 'achievestatus', type: 'select' },
|
|
|
+ { label: '成果权属', model: 'achieveown' },
|
|
|
+ { label: '成果来源', model: 'achievesource', type: 'select' },
|
|
|
+ { label: '意向价格', model: 'intentionprice' },
|
|
|
+ { label: '专利信息', model: 'patent', custom: true },
|
|
|
+ { label: '项目路演', model: 'roadshow', custom: true },
|
|
|
+ { label: '成果简介', model: 'achievebrief', type: 'textarea' },
|
|
|
+ { label: '技术特点', model: 'features', type: 'textarea' },
|
|
|
+ { label: '技术团队', model: 'team', type: 'textarea' },
|
|
|
+ { label: '商业预期', model: 'expect', type: 'textarea' },
|
|
|
+ { label: '合作条件及要求', model: 'condition', type: 'textarea' },
|
|
|
+ { label: '产品图片(6)', model: 'file', custom: true }
|
|
|
+ ];
|
|
|
+ } else if (type == '2') {
|
|
|
+ list = [
|
|
|
+ { label: '信息属性', model: 'messattribute', type: 'select' },
|
|
|
+ { label: '需求程度', model: 'demand', type: 'select' },
|
|
|
+ { label: '信息描述', model: 'informationdesc', type: 'textarea' },
|
|
|
+ { label: '核心要素', model: 'coreelements', type: 'textarea' },
|
|
|
+ { label: '价格信息', model: 'priceinfo', type: 'textarea' },
|
|
|
+ { label: '商业预期', model: 'expect', type: 'textarea' }
|
|
|
+ ];
|
|
|
+ }
|
|
|
+ fields.value = [...fields.value, ...list];
|
|
|
+};
|
|
|
+// 查询其他信息
|
|
|
+const searchOther = async () => {
|
|
|
+ let res: IQueryResult;
|
|
|
+ // 信息类型
|
|
|
+ res = await dictAxios.query({ type: 'product_type' });
|
|
|
+ if (res.errcode == '0') typeList.value = res.data;
|
|
|
+ // 需求紧急程度/需求程度
|
|
|
+ res = await dictAxios.query({ type: 'product_demand' });
|
|
|
+ if (res.errcode == 0) demandList.value = res.data;
|
|
|
+ // 所属领域
|
|
|
+ res = await dictAxios.query({ type: 'product_field' });
|
|
|
+ if (res.errcode == 0) fieldList.value = res.data;
|
|
|
+ // 合作方式
|
|
|
+ res = await dictAxios.query({ type: 'product_cooperation' });
|
|
|
+ if (res.errcode == 0) cooperationList.value = res.data;
|
|
|
+ // 成果状态
|
|
|
+ res = await dictAxios.query({ type: 'product_achievestatus' });
|
|
|
+ if (res.errcode == 0) achievestatusList.value = res.data;
|
|
|
+ // 成果来源
|
|
|
+ res = await dictAxios.query({ type: 'product_achievesource' });
|
|
|
+ if (res.errcode == 0) achievesourceList.value = res.data;
|
|
|
+ // 专利信息状态
|
|
|
+ res = await dictAxios.query({ type: 'product_patent_status' });
|
|
|
+ if (res.errcode == 0) patent_statusList.value = res.data;
|
|
|
+ // 信息属性
|
|
|
+ res = await dictAxios.query({ type: 'product_messattribute' });
|
|
|
+ if (res.errcode == 0) messattributeList.value = res.data;
|
|
|
+};
|
|
|
+// 预览图片
|
|
|
+const imgView = (e) => {
|
|
|
+ window.open(e);
|
|
|
+};
|
|
|
+// 返回上一页
|
|
|
+const toBack = () => {
|
|
|
+ window.history.go(-1);
|
|
|
+};
|
|
|
+</script>
|
|
|
+<style scoped lang="scss">
|
|
|
+.image {
|
|
|
+ width: 120px;
|
|
|
+ height: 120px;
|
|
|
+ overflow: hidden;
|
|
|
+ margin: 0 10px 0 0;
|
|
|
+}
|
|
|
+</style>
|