guhongwei 1 سال پیش
والد
کامیت
5a745597f3
6فایلهای تغییر یافته به همراه340 افزوده شده و 25 حذف شده
  1. 1 1
      .env.development
  2. 1 1
      .env.production
  3. 5 0
      src/router/module/admin.ts
  4. 164 0
      src/views/spatentexam/cpc/detail.vue
  5. 168 22
      src/views/spatentexam/cpc/index.vue
  6. 1 1
      vite.config.ts

+ 1 - 1
.env.development

@@ -1,7 +1,7 @@
 VITE_BASE_URL = "/zkzxpatent"
 VITE_OUT_DIR = "zkzxpatent"
 VITE_REQUEST_BASE = ''
-VITE_APP_HOST="http://broadcast.waityou24.cn"
+VITE_APP_HOST="https://broadcast.waityou24.cn"
 VITE_APP_PAGE_SIZE=10
 VITE_APP_ROUTER="patent"
 VITE_APP_ENV = 'development'

+ 1 - 1
.env.production

@@ -1,7 +1,7 @@
 VITE_BASE_URL = "/zkzxpatent"
 VITE_OUT_DIR = "zkzxpatent"
 VITE_REQUEST_BASE = ''
-VITE_APP_HOST="http://broadcast.waityou24.cn"
+VITE_APP_HOST="https://broadcast.waityou24.cn"
 VITE_APP_PAGE_SIZE=10
 VITE_APP_ROUTER="patent"
 VITE_APP_ENV = 'production'

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

@@ -49,6 +49,11 @@ export default [
     meta: { title: '国知局反馈信息' },
     component: () => import('@/views/spatentexam/cpc/index.vue')
   },
+  {
+    path: '/spatentexam/cpc/detail',
+    meta: { title: '信息管理' },
+    component: () => import('@/views/spatentexam/cpc/detail.vue')
+  },
   {
     path: '/spatentexam/retrieval',
     meta: { title: '查新检索' },

+ 164 - 0
src/views/spatentexam/cpc/detail.vue

@@ -0,0 +1,164 @@
+<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" :remark="remark"></cSearch>
+        </el-col>
+        <el-col :span="24" class="two">
+          <cForm :span="24" :fields="formFields" :form="form" :rules="rules" @save="toSave" label-width="auto">
+            <template #receive_id>
+              <el-select
+                v-model="form.receive_id"
+                filterable
+                remote
+                :remote-method="userSearch"
+                placeholder="请输入姓名"
+                style="width: 100%"
+                @change="userChange"
+              >
+                <el-option v-for="item in userList" :key="item._id" :label="item.name" :value="item._id" />
+              </el-select>
+            </template>
+            <template #patent_id>
+              <el-select
+                v-model="form.patent_id"
+                filterable
+                remote
+                :remote-method="patentSearch"
+                placeholder="请输入专利名称"
+                style="width: 100%"
+                @change="patentChange"
+              >
+                <el-option v-for="item in patentList" :key="item._id" :label="item.name" :value="item._id" />
+              </el-select>
+            </template>
+            <template #warn_file>
+              <cUpload :model="`${'warn_file'}`" :limit="6" url="/files/zkzx/patent/upload" :list="form.warn_file" @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 } from 'vue-router';
+import { ElMessage } from 'element-plus';
+import type { FormRules } from 'element-plus';
+
+// 接口
+import { CpcMessageStore } from '@common/src/stores/patent/cpcMessage';
+import { PersonalStore } from '@common/src/stores/admins/personal';
+import { PatentStore } from '@common/src/stores/patent/patent';
+import type { IQueryResult } from '@/util/types.util';
+const cpcmessageAxios = CpcMessageStore();
+const personal = PersonalStore();
+const patentAxios = PatentStore();
+
+// 路由
+const route = useRoute();
+
+// 加载中
+const loading = ref(false);
+
+const remark: Ref<any> = ref('如在系统中没有查询到专利信息,可手动输入专利申请号和专利名称');
+
+// 表单
+let form: Ref<any> = ref({ warn_file: [] });
+let formFields: Ref<any[]> = ref([
+  { label: '接收人', model: 'receive_id', custom: true },
+  { label: '接收人姓名', model: 'receive_name', options: { disabled: true } },
+  { label: '专利', model: 'patent_id', custom: true },
+  { label: '申请号', model: 'create_number' },
+  { label: '专利名称', model: 'patent_name' },
+  { label: '通知内容', model: 'content', type: 'textarea' },
+  { label: '通知文件', model: 'warn_file', custom: true },
+  { label: '发送时间', model: 'send_date', type: 'date' }
+]);
+const rules = reactive<FormRules>({});
+
+// 字典表
+const userList: Ref<any> = ref([]);
+const patentList: Ref<any> = ref([]);
+
+onMounted(async () => {
+  loading.value = true;
+  await search();
+  loading.value = false;
+});
+const search = async () => {
+  let id = route.query.id;
+  let res: IQueryResult;
+  let info: any = {};
+  if (id) {
+    res = await cpcmessageAxios.fetch(route.query.id);
+    if (res.errcode == '0') info = res.data;
+  }
+  form.value = info;
+};
+const onUpload = (e: { model: string; value: Array<[]> }) => {
+  const { model, value } = e;
+  form.value[model] = value;
+};
+// 查询用户
+const userSearch = async (value) => {
+  if (value) {
+    let res: IQueryResult = await personal.query({ name: value });
+    if (res.errcode == '0') {
+      userList.value = res.data;
+    }
+  }
+};
+// 选择用户
+const userChange = (value) => {
+  let data: any = userList.value.find((i) => i._id == value);
+  if (data) {
+    form.value['receive_id'] = data._id;
+    form.value['receive_name'] = data.name;
+  }
+};
+// 查询专利
+const patentSearch = async (value) => {
+  if (value) {
+    let user_id = form.value['receive_id'];
+    // user_id: user_id
+    let res: IQueryResult = await patentAxios.query({ name: value });
+    if (res.errcode == '0') {
+      patentList.value = res.data;
+    }
+  }
+};
+// 选择专利
+const patentChange = (value) => {
+  let data: any = patentList.value.find((i) => i._id == value);
+  if (data) {
+    form.value['patent_id'] = data._id;
+    form.value['create_number'] = data.create_number;
+    form.value['patent_name'] = data.name;
+  }
+};
+
+// 提交
+const toSave = async (data) => {
+  let res: IQueryResult;
+  if (data._id) {
+    res = await cpcmessageAxios.update(data);
+  } else {
+    res = await cpcmessageAxios.create(data);
+  }
+  if (res.errcode == 0) {
+    ElMessage({ type: `success`, message: `维护信息成功` });
+    toBack();
+  }
+};
+
+// 返回上一页
+const toBack = () => {
+  window.history.go(-1);
+};
+</script>
+<style scoped lang="scss"></style>

+ 168 - 22
src/views/spatentexam/cpc/index.vue

@@ -2,37 +2,183 @@
   <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"> </cSearch>
+        </el-col>
+        <el-col :span="24" class="two">
+          <cButton @toAdd="toAdd()">
+            <template v-slot:custom>
+              <el-button type="primary" @click="toAuto">自动分发</el-button>
+              <el-button type="danger" @click="toError">错误信息</el-button>
+            </template>
+          </cButton>
+        </el-col>
+        <el-col :span="24" class="thr">
+          <cTable :fields="fields" :opera="opera" :list="list" @query="search" :total="total" @view="toView" @del="toDel"> </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'">
+          <cTable :fields="filefields" :opera="fileopera" :list="form.warn_file" :usePage="false" @down="toDown"> </cTable>
+        </el-col>
+        <el-col :span="24" class="dialog_two" v-else-if="dialog.type == '2'">
+          <cTable :fields="errorfields" :opera="[]" :list="errorList" :usePage="false"> </cTable>
+        </el-col>
+        <el-col :span="24" class="dialog_thr" v-else-if="dialog.type == '3'">
+          <cForm :span="24" :fields="autofields" :form="autoForm" @save="autoSave" label-width="auto">
+            <template #file>
+              <cUpload :model="`${'file'}`" :limit="6" url="/files/zkzx/patent/upload" accept="*" :list="form.file" @change="onUpload"></cUpload>
+            </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 { CpcMessageStore } from '@common/src/stores/patent/cpcMessage';
+import { CpcMessageerrorStore } from '@common/src/stores/patent/cpcMessageerror';
+
+import type { IQueryResult } from '@/util/types.util';
+const cpcmessageAxios = CpcMessageStore();
+const cpcmessageerrorAxios = CpcMessageerrorStore();
+
+// 路由
+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', isSearch: true },
+  { label: '专利名称', model: 'patent_name', isSearch: true },
+  { label: '接收人', model: 'receive_name', isSearch: true },
+  { label: '发送时间', model: 'send_date' }
+]);
+// 操作
+let opera: Ref<any[]> = ref([
+  { label: '文件', method: 'view' },
+  { label: '删除', method: 'del', confirm: true, type: 'danger' }
+]);
+
+// 查询数据
+let searchForm: Ref<any> = ref({});
+
+// 弹框
+const dialog: Ref<any> = ref({ title: '反馈文件', show: false, type: '1' });
+const form: Ref<any> = ref({});
+let filefields: Ref<any[]> = ref([
+  { label: '文件名称', model: 'name' },
+  { label: '文件路径', model: 'uri' },
+  { label: '文件完成路径', model: 'url' }
+]);
+// 操作
+let fileopera: Ref<any[]> = ref([{ label: '下载', method: 'down' }]);
+
+// 错误信息
+const errorList: Ref<any> = ref([]);
+const errorfields: Ref<any> = ref([
+  { label: '申请号', model: 'create_number' },
+  { label: '专利名称', model: 'patent_name' },
+  { label: '专利信息key', model: 'patent_key' },
+  { label: '错误信息', model: 'content' },
+  { label: '导入的zip包', model: 'zip_url' },
+  { label: '导入时间', model: 'create_date' }
+]);
+// 自动分发
+const autoForm: Ref<any> = ref({});
+const autofields: Ref<any> = ref([{ label: '文件', model: 'file', custom: true }]);
+
 onMounted(async () => {
-  loading.value = true;
-  //  await search({ skip, limit });
+  loading.value = false;
+  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 cpcmessageAxios.query(info);
+  if (res.errcode == 0) {
+    list.value = res.data;
+    total.value = res.total;
+  }
+};
+const toSearch = (query) => {
+  searchForm.value = query;
+  search({ skip, limit });
+};
+// 查看
+const toView = (data) => {
+  form.value = data;
+  dialog.value = { title: '反馈文件', show: true, type: '1' };
+};
+const toDown = (data) => {
+  window.open(data.url);
+};
+// 错误信息
+const toError = async () => {
+  let res: IQueryResult = await cpcmessageerrorAxios.query({});
+  if (res.errcode == '0') {
+    errorList.value = res.data;
+  }
+  dialog.value = { title: '错误信息', show: true, type: '2' };
+};
+// 自动分发
+const toAuto = () => {
+  dialog.value = { title: '自动分发', show: true, type: '3' };
+};
+const onUpload = (e: { model: string; value: Array<[]> }) => {
+  const { model, value } = e;
+  autoForm.value[model] = value;
+};
+// 提交保存
+const autoSave = async (data) => {
+  console.log(data);
+};
+// 关闭弹框
+const toClose = () => {
+  autoForm.value = {};
+  form.value = {};
+  dialog.value = { show: false };
+  search({ skip, limit });
+};
+// 添加
+const toAdd = () => {
+  router.push({ path: '/spatentexam/cpc/detail' });
+};
+// 删除
+const toDel = async (data) => {
+  let res: IQueryResult = await cpcmessageAxios.del(data._id);
+  if (res.errcode == 0) {
+    ElMessage({ type: `success`, message: `刪除信息成功` });
+    search({ skip, limit });
+  }
+};
 </script>
-<style scoped lang="scss"></style>
+<style lang="scss" scoped>
+.main {
+  .one {
+    margin: 0 0 10px 0;
+  }
+  .two {
+    margin: 0 0 10px 0;
+  }
+}
+</style>

+ 1 - 1
vite.config.ts

@@ -17,7 +17,7 @@ export default defineConfig(({ mode }) => {
       port: 8007,
       proxy: {
         '/files': {
-          target: 'http://broadcast.waityou24.cn'
+          target: 'https://broadcast.waityou24.cn'
         },
         '/zkzx/v2/api': {
           target: 'http://192.168.1.113:12001', //169.254.16.148