|
@@ -0,0 +1,251 @@
|
|
|
+<template>
|
|
|
+ <div id="detail">
|
|
|
+ <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="formFields" :form="form" :rules="rules" @save="toSave" label-width="auto" @dataChange="dataChange">
|
|
|
+ <template #patent_id>
|
|
|
+ <el-option v-for="(i, index) in patentList" :key="index" :label="i.name" :value="i._id"></el-option>
|
|
|
+ </template>
|
|
|
+ <template #type>
|
|
|
+ <el-option v-for="(i, index) in typeList" :key="index" :label="i.label" :value="i.value"></el-option>
|
|
|
+ </template>
|
|
|
+ <template #promise_file>
|
|
|
+ <el-row class="cPromise">
|
|
|
+ <el-col :span="24" class="cPromise_1">免费许可承诺书</el-col>
|
|
|
+ <el-col :span="24" class="cPromise_2">
|
|
|
+ <span>公开声明:[{{ form.patent_name }}]专利权人许可本专利在[</span>
|
|
|
+ <span>
|
|
|
+ <el-select v-model="form.promise_file.province" placeholder="请选择省份" @change="proChange">
|
|
|
+ <el-option v-for="i in provinceList" :key="i.value" :label="i.label" :value="i.value" />
|
|
|
+ </el-select>
|
|
|
+ </span>
|
|
|
+ <span>][</span>
|
|
|
+ <span>
|
|
|
+ <el-select v-model="form.promise_file.city" placeholder="请选择市区">
|
|
|
+ <el-option v-for="i in cityList" :key="i.value" :label="i.label" :value="i.value" />
|
|
|
+ </el-select>
|
|
|
+ </span>
|
|
|
+ <span>]范围内免费使用,期限至[</span>
|
|
|
+ <span>
|
|
|
+ <el-date-picker v-model="form.promise_file.end_date" type="date" placeholder="请选择时间" format="YYYY-MM-DD" value-format="YYYY-MM-DD" />
|
|
|
+ </span>
|
|
|
+ <span>]止,被许可人需与许可人签订许可合同后方可使用。</span>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </template>
|
|
|
+ <template #is_report>
|
|
|
+ <el-option v-for="(i, index) in isnoList" :key="index" :label="i.label" :value="i.value"></el-option>
|
|
|
+ </template>
|
|
|
+ <template #report>
|
|
|
+ <cUpload :model="`${'report'}`" :limit="1" url="/files/zkzx/patent/upload" :list="form.report" @change="onUpload"></cUpload>
|
|
|
+ </template>
|
|
|
+ </cForm>
|
|
|
+ </el-col>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script setup lang="ts">
|
|
|
+// 基础
|
|
|
+import type { Ref } from 'vue';
|
|
|
+import { ref, reactive, onMounted } from 'vue';
|
|
|
+import { useRoute, useRouter } from 'vue-router';
|
|
|
+import { ElMessage } from 'element-plus';
|
|
|
+import type { FormRules } from 'element-plus';
|
|
|
+
|
|
|
+// 接口
|
|
|
+import { TranstionStore } from '@common/src/stores/patent/transtion';
|
|
|
+import { PatentStore } from '@common/src/stores/patent/patent';
|
|
|
+import { AdminStore } from '@common/src/stores/admins/admin';
|
|
|
+import { AssessmentStore } from '@common/src/stores/patent/assessment';
|
|
|
+import { DictDataStore } from '@common/src/stores/system/dictData'; // 字典表
|
|
|
+import type { IQueryResult } from '@/util/types.util';
|
|
|
+import store from '@/stores/counter';
|
|
|
+const transAxios = TranstionStore();
|
|
|
+const patentAxios = PatentStore();
|
|
|
+const adminAxios = AdminStore();
|
|
|
+const assessAxios = AssessmentStore();
|
|
|
+const dictAxios = DictDataStore();
|
|
|
+
|
|
|
+// 路由
|
|
|
+const route = useRoute();
|
|
|
+const router = useRouter();
|
|
|
+
|
|
|
+// 加载中
|
|
|
+const loading: Ref<any> = ref(false);
|
|
|
+
|
|
|
+// 表单
|
|
|
+let form: Ref<any> = ref({ promise_file: {}, report: [], is_report: '1' });
|
|
|
+let formFields: Ref<any[]> = ref([
|
|
|
+ // { label: '机构id', model: 'mech_id', options: { disabled: true } },
|
|
|
+ // { label: '机构名称', model: 'mech_name', options: { disabled: true } },
|
|
|
+ // { label: '用户id', model: 'user_id', options: { disabled: true } },
|
|
|
+ // { label: '用户姓名', model: 'user_name', options: { disabled: true } },
|
|
|
+ { label: '专利名称', model: 'patent_id', type: 'select' },
|
|
|
+ // { label: '专利名称', model: 'patent_name' },
|
|
|
+ { label: '申请号', model: 'create_number', options: { disabled: true } },
|
|
|
+ { label: '当前权利人', model: 'on_obligee', options: { disabled: true } },
|
|
|
+ { label: '联系人', model: 'contact' },
|
|
|
+ { label: '手机号', model: 'phone' },
|
|
|
+ { label: '电子邮箱', model: 'email' },
|
|
|
+ { label: '投资预算(万元)', model: 'budget' },
|
|
|
+ { label: '交易类型', model: 'type', type: 'select' },
|
|
|
+ { label: '是否有评估报告', model: 'is_report', type: 'select' },
|
|
|
+ { label: '评估报告', model: 'report', custom: true },
|
|
|
+ { label: '技术说明', model: 'requirementdesc', type: 'textarea' },
|
|
|
+ { label: '商业预期', model: 'expect', type: 'textarea' },
|
|
|
+ { label: '合作条件及要求', model: 'condition', type: 'textarea' },
|
|
|
+ { label: '摘要', model: 'abstract', type: 'textarea' },
|
|
|
+ { label: '变更后专利权人', model: 'on_afterobligee' },
|
|
|
+ { label: '专利权转移日期', model: 'transfer_date', type: 'date' }
|
|
|
+]);
|
|
|
+const rules = reactive<FormRules>({});
|
|
|
+
|
|
|
+// 字典表
|
|
|
+let patentList: Ref<any> = ref([]);
|
|
|
+let typeList: Ref<any> = ref([]);
|
|
|
+let provinceList: Ref<any> = ref([]);
|
|
|
+let cityList: Ref<any> = ref([]);
|
|
|
+let isnoList: Ref<any> = ref([]);
|
|
|
+
|
|
|
+// 请求
|
|
|
+onMounted(async () => {
|
|
|
+ loading.value = true;
|
|
|
+ await searchOther();
|
|
|
+ await search();
|
|
|
+ loading.value = false;
|
|
|
+});
|
|
|
+const search = async () => {
|
|
|
+ let id = route.query.id;
|
|
|
+ let patent_id = route.query.patent_id;
|
|
|
+ let res: IQueryResult;
|
|
|
+ let info: any = { status: '0', promise_file: {}, report: [], is_report: '1' };
|
|
|
+ if (id) {
|
|
|
+ res = await transAxios.fetch(route.query.id);
|
|
|
+ if (res.errcode == '0') info = res.data;
|
|
|
+ } else {
|
|
|
+ let user = store.state.user;
|
|
|
+ // 个人用户
|
|
|
+ info.user_id = user._id;
|
|
|
+ info.user_name = user.name;
|
|
|
+ info.contact = user.name;
|
|
|
+ info.phone = user.phone;
|
|
|
+ info.email = user.email;
|
|
|
+ // 机构用户
|
|
|
+ res = await adminAxios.query({ code: user.code });
|
|
|
+ if (res.errcode == '0') {
|
|
|
+ if (res.total > 0) {
|
|
|
+ let mechInfo: any = res.data[0];
|
|
|
+ info.mech_id = mechInfo._id;
|
|
|
+ info.mech_name = mechInfo.name;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ form.value = info;
|
|
|
+ // 如果有专利id,可默认插入一个专利信息
|
|
|
+ // 查询该专利有没有评估报告
|
|
|
+ if (patent_id) {
|
|
|
+ dataChange({ value: patent_id, model: 'patent_id' });
|
|
|
+ getAssess(patent_id);
|
|
|
+ }
|
|
|
+};
|
|
|
+// 评估报告
|
|
|
+const getAssess = async (patent_id) => {
|
|
|
+ let res: IQueryResult = await assessAxios.query({ status: '4', patent_id: patent_id });
|
|
|
+ if (res.errcode == '0') {
|
|
|
+ if (res.total > 0) {
|
|
|
+ let info: any = res.data[0] as {};
|
|
|
+ if (info && info.report_file && info.report_file.length > 0) {
|
|
|
+ form.value['is_report'] = '0';
|
|
|
+ form.value['report'] = info.report_file;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+};
|
|
|
+// 选择
|
|
|
+const dataChange = (e: { value; model }) => {
|
|
|
+ if (e.model == 'patent_id') {
|
|
|
+ let data = patentList.value.find((i: any) => i._id == e.value);
|
|
|
+ form.value['patent_id'] = data._id;
|
|
|
+ form.value['patent_name'] = data.name;
|
|
|
+ form.value['create_number'] = data.create_number;
|
|
|
+ form.value['on_obligee'] = data.on_obligee;
|
|
|
+ form.value['abstract'] = data.abstract || '';
|
|
|
+ } else if (e.model == 'type') {
|
|
|
+ if (e.value == '2') {
|
|
|
+ formFields.value.splice(8, 0, { label: '免费许可承诺书', model: 'promise_file', custom: true });
|
|
|
+ } else {
|
|
|
+ formFields.value = formFields.value.filter((i) => i.model != 'promise_file');
|
|
|
+ }
|
|
|
+ }
|
|
|
+};
|
|
|
+// 省份
|
|
|
+const proChange = (value) => {
|
|
|
+ let data = provinceList.value.find((i) => (i.value = value));
|
|
|
+ if (data) {
|
|
|
+ cityList.value = data.children;
|
|
|
+ }
|
|
|
+};
|
|
|
+const onUpload = (e: { model: string; value: Array<[]> }) => {
|
|
|
+ const { model, value } = e;
|
|
|
+ form.value[model] = value;
|
|
|
+};
|
|
|
+// 提交
|
|
|
+const toSave = async (data) => {
|
|
|
+ let res: IQueryResult;
|
|
|
+ if (data._id) {
|
|
|
+ if (data.status == '1') data.status = '0';
|
|
|
+ res = await transAxios.update(data);
|
|
|
+ } else {
|
|
|
+ res = await transAxios.create(data);
|
|
|
+ }
|
|
|
+ if (res.errcode == 0) {
|
|
|
+ ElMessage({ type: `success`, message: `维护信息成功` });
|
|
|
+ router.push({ path: '/ptrans' });
|
|
|
+ }
|
|
|
+};
|
|
|
+const searchOther = async () => {
|
|
|
+ let res: IQueryResult;
|
|
|
+ // 专利
|
|
|
+ res = await patentAxios.query();
|
|
|
+ if (res.errcode == '0') patentList.value = res.data;
|
|
|
+ // 交易类型
|
|
|
+ res = await dictAxios.query({ type: 'patent_trans_type' });
|
|
|
+ if (res.errcode == '0') typeList.value = res.data;
|
|
|
+ // 城市
|
|
|
+ res = await dictAxios.query({ type: 'common_city' });
|
|
|
+ if (res.errcode == '0') {
|
|
|
+ provinceList.value = res.data;
|
|
|
+ }
|
|
|
+ res = await dictAxios.query({ type: 'common_isno' });
|
|
|
+ if (res.errcode == '0') {
|
|
|
+ isnoList.value = res.data;
|
|
|
+ }
|
|
|
+};
|
|
|
+// 返回上一页
|
|
|
+const toBack = () => {
|
|
|
+ window.history.go(-1);
|
|
|
+};
|
|
|
+</script>
|
|
|
+<style scoped lang="scss">
|
|
|
+.cPromise {
|
|
|
+ .cPromise_1 {
|
|
|
+ text-align: center;
|
|
|
+ font-size: 25px;
|
|
|
+ font-family: monospace;
|
|
|
+ font-weight: bold;
|
|
|
+ margin: 0 0 10px 0;
|
|
|
+ }
|
|
|
+ .cPromise_2 {
|
|
|
+ text-align: center;
|
|
|
+ font-size: 16px;
|
|
|
+ font-family: monospace;
|
|
|
+ font-weight: bold;
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|