guhongwei 2 years ago
parent
commit
005669948b

+ 5 - 0
src/router/module/personal.ts

@@ -68,5 +68,10 @@ export default [
     path: '/ptrans',
     meta: { title: '我的交易' },
     component: () => import('@/views/ptrans/index.vue')
+  },
+  {
+    path: '/ptrans/detail',
+    meta: { title: '信息管理' },
+    component: () => import('@/views/ptrans/detail.vue')
   }
 ];

+ 1 - 1
src/views/ppatent/info/index.vue

@@ -114,7 +114,7 @@ const toAsses = (data) => {
 };
 // 专利交易
 const toTrans = (data) => {
-  console.log(data);
+  router.push({ path: '/ptrans/detail', query: { patent_id: data._id } });
 };
 const searchOther = async () => {
   let res: IQueryResult;

+ 251 - 0
src/views/ptrans/detail.vue

@@ -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>

+ 132 - 22
src/views/ptrans/index.vue

@@ -2,37 +2,147 @@
   <div id="index">
     <el-row>
       <el-col :span="24" class="main animate__animated animate__backInRight" v-loading="loading">
-        <el-col :span="24" class="one">系统首页</el-col>
+        <el-col :span="24" class="one">
+          <cSearch :is_title="false" :is_search="true" :fields="fields" @search="toSearch">
+            <template #type>
+              <el-option v-for="(i, index) in typeList" :key="index" :label="i.label" :value="i.value"></el-option>
+            </template>
+            <template #status>
+              <el-option v-for="(i, index) in statusList" :key="index" :label="i.label" :value="i.value"></el-option>
+            </template>
+          </cSearch>
+        </el-col>
+        <el-col :span="24" class="thr">
+          <cTable :fields="fields" :opera="opera" :list="list" @query="search" :total="total" @view="toView" @edit="toEdit" @tract="toTract" @del="toDel">
+          </cTable>
+        </el-col>
       </el-col>
     </el-row>
   </div>
 </template>
-
-<script setup lang="ts">
-// 基础
+<script lang="ts" setup>
+import _ from 'lodash';
 import type { Ref } from 'vue';
-// reactive,
-import { onMounted, ref, getCurrentInstance } from 'vue';
+import { ref, onMounted, getCurrentInstance } from 'vue';
+import { ElMessage } from 'element-plus';
+import { useRouter } from 'vue-router';
+
 // 接口
-//import { TestStore } from '@common/src/stores/test';
-//import type { IQueryResult } from '@/util/types.util';
-//const testAxios = TestStore();
+import { TranstionStore } from '@common/src/stores/patent/transtion';
+import { DictDataStore } from '@common/src/stores/system/dictData'; // 字典表
+import type { IQueryResult } from '@/util/types.util';
+import store from '@/stores/counter';
+const transAxios = TranstionStore();
+const dictAxios = DictDataStore();
+
+// 路由
+const router = useRouter();
+
 const { proxy } = getCurrentInstance() as any;
+
 // 加载中
-const loading: Ref<any> = ref(false);
-// 分页数据
-//  const skip = 0;
-//  const limit = proxy.limit;;
-// 请求
+const loading = ref(false);
+// 列表数据
+let list: Ref<any> = ref([]);
+let total: Ref<number> = ref(0);
+let skip = 0;
+let limit: number = proxy.$limit;
+let fields: Ref<any[]> = ref([
+  { label: '申请号', model: 'create_number' },
+  { label: '专利名称', model: 'patent_name', isSearch: true },
+  { label: '交易类型', model: 'type', format: (i: any) => getDict(i, 'type'), isSearch: true, type: 'select' },
+  { label: '联系人', model: 'contact' },
+  { label: '手机号', model: 'phone' },
+  { label: '状态', model: 'status', format: (i: any) => getDict(i, 'status'), isSearch: true, type: 'select' }
+]);
+// 操作
+let opera: Ref<any[]> = ref([
+  { label: '查看', method: 'view' },
+  { label: '修改', method: 'edit', display: (i) => i.status == '1' },
+  { label: '合同填写', method: 'tract', display: (i) => i.status == '2' },
+
+  { label: '删除', method: 'del', confirm: true, type: 'danger', display: (i: any) => i.status == '0' }
+]);
+
+// 查询数据
+let searchForm: Ref<any> = ref({});
+
+// 字典表
+const typeList: Ref<any> = ref([]);
+const statusList: Ref<any> = ref([]);
+
 onMounted(async () => {
-  loading.value = true;
-  //  await search({ skip, limit });
+  loading.value = false;
+  await searchOther();
+  await search({ skip, limit });
   loading.value = false;
 });
-//const search = async (e: { skip: number; limit: number }) => {
-//  const info = { skip: e.skip, limit: e.limit, ...searchInfo.value  };
-//  const res: IQueryResult = await testAxios.query(info);
-//  console.log(res);
-//};
+// 查询
+const search = async (e: { skip: number; limit: number }) => {
+  let user = store.state.user;
+  const { skip, limit } = e;
+  const condition = _.cloneDeep(searchForm.value);
+  let info = { limit: limit, skip: skip, ...condition, user_id: user._id };
+  let res: IQueryResult = await transAxios.query(info);
+  if (res.errcode == 0) {
+    list.value = res.data;
+    total.value = res.total;
+  }
+};
+const toSearch = (query) => {
+  searchForm.value = query;
+  search({ skip, limit });
+};
+const getDict = (value, model) => {
+  if (model == 'type') {
+    let data = typeList.value.find((i: any) => i.value == value);
+    if (data) return data.label;
+    else return '暂无';
+  } else if (model == 'status') {
+    let data = statusList.value.find((i: any) => i.value == value);
+    if (data) return data.label;
+    else return '暂无';
+  }
+};
+// 查看
+const toView = (data) => {
+  router.push({ path: '/common/trans/info', query: { id: data._id } });
+};
+// 修改
+const toEdit = (data) => {
+  router.push({ path: '/ptrans/detail', query: { id: data._id } });
+};
+// 合同填写
+const toTract = (data) => {
+  console.log(data);
+};
+// 删除
+const toDel = async (data) => {
+  let res: IQueryResult = await transAxios.del(data._id);
+  if (res.errcode == 0) {
+    ElMessage({ type: `success`, message: `刪除信息成功` });
+    search({ skip, limit });
+  }
+};
+
+// 查询其他信息
+const searchOther = async () => {
+  let res: IQueryResult;
+  // 类型
+  res = await dictAxios.query({ type: 'patent_trans_type' });
+  if (res.errcode == '0') typeList.value = res.data;
+  // 状态
+  res = await dictAxios.query({ type: 'patent_trans_status' });
+  if (res.errcode == '0') statusList.value = res.data;
+};
 </script>
-<style scoped lang="scss"></style>
+<style lang="scss" scoped>
+.main {
+  .one {
+    margin: 0 0 10px 0;
+  }
+  .two {
+    margin: 0 0 10px 0;
+  }
+}
+</style>

+ 111 - 22
src/views/spatentadmin/trans/index.vue

@@ -2,37 +2,126 @@
   <div id="index">
     <el-row>
       <el-col :span="24" class="main animate__animated animate__backInRight" v-loading="loading">
-        <el-col :span="24" class="one">系统首页</el-col>
+        <el-col :span="24" class="one">
+          <cSearch :is_title="false" :is_search="true" :fields="fields" @search="toSearch">
+            <template #type>
+              <el-option v-for="(i, index) in typeList" :key="index" :label="i.label" :value="i.value"></el-option>
+            </template>
+            <template #status>
+              <el-option v-for="(i, index) in statusList" :key="index" :label="i.label" :value="i.value"></el-option>
+            </template>
+          </cSearch>
+        </el-col>
+        <el-col :span="24" class="thr">
+          <cTable :fields="fields" :opera="opera" :list="list" @query="search" :total="total" @view="toView"> </cTable>
+        </el-col>
       </el-col>
     </el-row>
   </div>
 </template>
-
-<script setup lang="ts">
-// 基础
+<script lang="ts" setup>
+import _ from 'lodash';
 import type { Ref } from 'vue';
-// reactive,
-import { onMounted, ref, getCurrentInstance } from 'vue';
+import { ref, onMounted, getCurrentInstance } from 'vue';
+import { useRouter } from 'vue-router';
+
 // 接口
-//import { TestStore } from '@common/src/stores/test';
-//import type { IQueryResult } from '@/util/types.util';
-//const testAxios = TestStore();
+import { TranstionStore } from '@common/src/stores/patent/transtion';
+import { DictDataStore } from '@common/src/stores/system/dictData'; // 字典表
+import type { IQueryResult } from '@/util/types.util';
+const transAxios = TranstionStore();
+const dictAxios = DictDataStore();
+
+// 路由
+const router = useRouter();
+
 const { proxy } = getCurrentInstance() as any;
+
 // 加载中
-const loading: Ref<any> = ref(false);
-// 分页数据
-//  const skip = 0;
-//  const limit = proxy.limit;;
-// 请求
+const loading = ref(false);
+// 列表数据
+let list: Ref<any> = ref([]);
+let total: Ref<number> = ref(0);
+let skip = 0;
+let limit: number = proxy.$limit;
+let fields: Ref<any[]> = ref([
+  { label: '申请号', model: 'create_number' },
+  { label: '专利名称', model: 'patent_name', isSearch: true },
+  { label: '交易类型', model: 'type', format: (i: any) => getDict(i, 'type'), isSearch: true, type: 'select' },
+  { label: '联系人', model: 'contact' },
+  { label: '手机号', model: 'phone' },
+  { label: '状态', model: 'status', format: (i: any) => getDict(i, 'status'), isSearch: true, type: 'select' }
+]);
+// 操作
+let opera: Ref<any[]> = ref([{ label: '查看', method: 'view' }]);
+
+// 查询数据
+let searchForm: Ref<any> = ref({});
+
+// 字典表
+const typeList: Ref<any> = ref([]);
+const statusList: Ref<any> = ref([]);
+const examstatusList: Ref<any> = ref([]);
+
 onMounted(async () => {
-  loading.value = true;
-  //  await search({ skip, limit });
+  loading.value = false;
+  await searchOther();
+  await search({ skip, limit });
   loading.value = false;
 });
-//const search = async (e: { skip: number; limit: number }) => {
-//  const info = { skip: e.skip, limit: e.limit, ...searchInfo.value  };
-//  const res: IQueryResult = await testAxios.query(info);
-//  console.log(res);
-//};
+// 查询
+const search = async (e: { skip: number; limit: number }) => {
+  const { skip, limit } = e;
+  const condition = _.cloneDeep(searchForm.value);
+  let info = { limit: limit, skip: skip, ...condition };
+  let res: IQueryResult = await transAxios.query(info);
+  if (res.errcode == 0) {
+    list.value = res.data;
+    total.value = res.total;
+  }
+};
+const toSearch = (query) => {
+  searchForm.value = query;
+  search({ skip, limit });
+};
+const getDict = (value, model) => {
+  if (model == 'type') {
+    let data = typeList.value.find((i) => i.value == value);
+    if (data) return data.label;
+    else return '暂无';
+  } else if (model == 'status') {
+    let data = statusList.value.find((i) => i.value == value);
+    if (data) return data.label;
+    else return '暂无';
+  }
+};
+// 查看
+const toView = (data) => {
+  router.push({ path: '/common/trans/info', query: { id: data._id } });
+};
+
+// 查询其他信息
+const searchOther = async () => {
+  let res: IQueryResult;
+  // 类型
+  res = await dictAxios.query({ type: 'patent_trans_type' });
+  if (res.errcode == '0') typeList.value = res.data;
+  // 状态
+  res = await dictAxios.query({ type: 'patent_trans_status' });
+  if (res.errcode == '0') {
+    let list: any = res.data as [];
+    statusList.value = list;
+    examstatusList.value = list.filter((i) => i.value == '0' || i.value == '1' || i.value == '2');
+  }
+};
 </script>
-<style scoped lang="scss"></style>
+<style lang="scss" scoped>
+.main {
+  .one {
+    margin: 0 0 10px 0;
+  }
+  .two {
+    margin: 0 0 10px 0;
+  }
+}
+</style>

+ 160 - 22
src/views/uexam/trans/index.vue

@@ -2,37 +2,175 @@
   <div id="index">
     <el-row>
       <el-col :span="24" class="main animate__animated animate__backInRight" v-loading="loading">
-        <el-col :span="24" class="one">系统首页</el-col>
+        <el-col :span="24" class="one">
+          <cSearch :is_title="false" :is_search="true" :fields="fields" @search="toSearch">
+            <template #type>
+              <el-option v-for="(i, index) in typeList" :key="index" :label="i.label" :value="i.value"></el-option>
+            </template>
+            <template #status>
+              <el-option v-for="(i, index) in statusList" :key="index" :label="i.label" :value="i.value"></el-option>
+            </template>
+          </cSearch>
+        </el-col>
+        <el-col :span="24" class="thr">
+          <cTable :fields="fields" :opera="opera" :list="list" @query="search" :total="total" @view="toView" @exam="toExam"> </cTable>
+        </el-col>
       </el-col>
     </el-row>
+    <cDialog :dialog="dialog" @toClose="toClose">
+      <template v-slot:info>
+        <el-col :span="24" class="dialog_one" v-if="dialog.type == '1'">
+          <cForm :span="24" :fields="formFields" :form="form" :rules="{}" @save="toSave" label-width="auto">
+            <template #status>
+              <el-option v-for="(i, index) in examstatusList" :key="index" :label="i.label" :value="i.value"></el-option>
+            </template>
+          </cForm>
+        </el-col>
+      </template>
+    </cDialog>
   </div>
 </template>
-
-<script setup lang="ts">
-// 基础
+<script lang="ts" setup>
+import _ from 'lodash';
 import type { Ref } from 'vue';
-// reactive,
-import { onMounted, ref, getCurrentInstance } from 'vue';
+import { ref, onMounted, getCurrentInstance } from 'vue';
+import { ElMessage } from 'element-plus';
+import { useRouter } from 'vue-router';
+
 // 接口
-//import { TestStore } from '@common/src/stores/test';
-//import type { IQueryResult } from '@/util/types.util';
-//const testAxios = TestStore();
+import { TranstionStore } from '@common/src/stores/patent/transtion';
+import { DictDataStore } from '@common/src/stores/system/dictData'; // 字典表
+import type { IQueryResult } from '@/util/types.util';
+import store from '@/stores/counter';
+const transAxios = TranstionStore();
+const dictAxios = DictDataStore();
+
+// 路由
+const router = useRouter();
+
 const { proxy } = getCurrentInstance() as any;
+
 // 加载中
-const loading: Ref<any> = ref(false);
-// 分页数据
-//  const skip = 0;
-//  const limit = proxy.limit;;
-// 请求
+const loading = ref(false);
+// 列表数据
+let list: Ref<any> = ref([]);
+let total: Ref<number> = ref(0);
+let skip = 0;
+let limit: number = proxy.$limit;
+let fields: Ref<any[]> = ref([
+  { label: '申请号', model: 'create_number' },
+  { label: '专利名称', model: 'patent_name', isSearch: true },
+  { label: '交易类型', model: 'type', format: (i: any) => getDict(i, 'type'), isSearch: true, type: 'select' },
+  { label: '联系人', model: 'contact' },
+  { label: '手机号', model: 'phone' },
+  { label: '状态', model: 'status', format: (i: any) => getDict(i, 'status'), isSearch: true, type: 'select' }
+]);
+// 操作
+let opera: Ref<any[]> = ref([
+  { label: '查看', method: 'view' },
+  { label: '审核', method: 'exam', type: 'warning', display: (i: any) => i.status == '0' }
+]);
+
+// 查询数据
+let searchForm: Ref<any> = ref({});
+
+// 字典表
+const typeList: Ref<any> = ref([]);
+const statusList: Ref<any> = ref([]);
+const examstatusList: Ref<any> = ref([]);
+// 弹框
+const dialog: Ref<any> = ref({ title: '审核管理', show: false, type: '1' });
+const form: Ref<any> = ref({});
+const formFields: Ref<any> = ref([]);
+
 onMounted(async () => {
-  loading.value = true;
-  //  await search({ skip, limit });
+  loading.value = false;
+  await searchOther();
+  await search({ skip, limit });
   loading.value = false;
 });
-//const search = async (e: { skip: number; limit: number }) => {
-//  const info = { skip: e.skip, limit: e.limit, ...searchInfo.value  };
-//  const res: IQueryResult = await testAxios.query(info);
-//  console.log(res);
-//};
+// 查询
+const search = async (e: { skip: number; limit: number }) => {
+  let user = store.state.user;
+  const { skip, limit } = e;
+  const condition = _.cloneDeep(searchForm.value);
+  let info = { limit: limit, skip: skip, ...condition, mech_id: user._id };
+  let res: IQueryResult = await transAxios.query(info);
+  if (res.errcode == 0) {
+    list.value = res.data;
+    total.value = res.total;
+  }
+};
+const toSearch = (query) => {
+  searchForm.value = query;
+  search({ skip, limit });
+};
+const getDict = (value, model) => {
+  if (model == 'type') {
+    let data = typeList.value.find((i) => i.value == value);
+    if (data) return data.label;
+    else return '暂无';
+  } else if (model == 'status') {
+    let data = statusList.value.find((i) => i.value == value);
+    if (data) return data.label;
+    else return '暂无';
+  }
+};
+// 查看
+const toView = (data) => {
+  router.push({ path: '/common/trans/info', query: { id: data._id } });
+};
+// 审核
+const toExam = async (data) => {
+  let res: IQueryResult = await transAxios.fetch(data._id);
+  if (res.errcode == '0') {
+    form.value = res.data;
+    let list: any = [
+      { label: '审核状态', model: 'status', type: 'select' },
+      { label: '审核意见', model: 'desc', type: 'textarea' }
+    ];
+    formFields.value = list;
+    dialog.value = { title: '审核管理', show: true, type: '1' };
+  }
+};
+const toSave = async (data) => {
+  let res: IQueryResult = await transAxios.update(data);
+  if (res.errcode == '0') {
+    ElMessage({ message: '信息维护成功', type: 'success' });
+    toClose();
+  } else {
+    ElMessage({ message: `${res.errmsg}`, type: 'error' });
+  }
+};
+
+// 关闭弹框
+const toClose = () => {
+  dialog.value = { title: '审核管理', show: false, type: '1' };
+  search({ skip, limit });
+};
+
+// 查询其他信息
+const searchOther = async () => {
+  let res: IQueryResult;
+  // 类型
+  res = await dictAxios.query({ type: 'patent_trans_type' });
+  if (res.errcode == '0') typeList.value = res.data;
+  // 状态
+  res = await dictAxios.query({ type: 'patent_trans_status' });
+  if (res.errcode == '0') {
+    let list: any = res.data as [];
+    statusList.value = list;
+    examstatusList.value = list.filter((i) => i.value == '0' || i.value == '1' || i.value == '2');
+  }
+};
 </script>
-<style scoped lang="scss"></style>
+<style lang="scss" scoped>
+.main {
+  .one {
+    margin: 0 0 10px 0;
+  }
+  .two {
+    margin: 0 0 10px 0;
+  }
+}
+</style>