guhongwei 3 年 前
コミット
71e40f23ee
26 ファイル変更605 行追加100 行削除
  1. 121 9
      src/layout/chatCommon/chat.vue
  2. 24 14
      src/router/index.js
  3. 2 2
      src/store/index.js
  4. 1 2
      src/views/index.vue
  5. 2 2
      src/views/service/patent/admin/adminBtn.vue
  6. 1 1
      src/views/service/patent/admin/examine/analysis/info-1.vue
  7. 17 9
      src/views/service/patent/admin/examine/hairmess.vue
  8. 98 0
      src/views/service/patent/admin/examine/hairmess_autoCreate.vue
  9. 1 1
      src/views/service/patent/admin/examine/patent/info-1.vue
  10. 1 1
      src/views/service/patent/admin/message/parts/list-1.vue
  11. 108 4
      src/views/service/patent/admin/message/service_detail.vue
  12. 2 12
      src/views/service/patent/admin/patent/assessment/examine-1.vue
  13. 2 2
      src/views/service/patent/admin/patent/info.vue
  14. 134 5
      src/views/service/patent/admin/patent/info/detail-1.vue
  15. 1 1
      src/views/service/patent/admin/patent/info_create.vue
  16. 1 1
      src/views/service/patent/mech/examine/patent/info-1.vue
  17. 1 1
      src/views/service/patent/mech/mechBtn.vue
  18. 5 5
      src/views/service/patent/user/apply/analysis/detail.vue
  19. 1 1
      src/views/service/patent/user/apply/analysis/parts/detail-2.vue
  20. 1 1
      src/views/service/patent/user/apply/analysis/parts/result-2.vue
  21. 1 1
      src/views/service/patent/user/apply/apply/detail.vue
  22. 19 19
      src/views/service/patent/user/apply/apply/parts/detail-1.vue
  23. 1 1
      src/views/service/patent/user/apply/apply/parts/result-1.vue
  24. 2 2
      src/views/service/patent/user/apply/assessment/detail.vue
  25. 54 0
      src/views/service/patent/user/chat/index.vue
  26. 4 3
      src/views/service/patent/user/userBtn.vue

+ 121 - 9
src/layout/chatCommon/chat.vue

@@ -2,38 +2,65 @@
   <div id="chat">
     <van-row>
       <van-col span="24" class="main">
-        <van-col span="24" class="one">
+        <van-col span="24" class="one" :style="{ height: client.height - 87 + 'px' }">
           <template v-for="(i, index) in list">
             <template v-if="isSender(i, index)">
               <van-col span="24" class="senderTime" :key="`div${i.id}${index}`">
                 <span :key="`senderTime${i.id}${index}`">[{{ i.send_time }}] {{ i.sender_name }}</span>
-                <span v-html="i.content" :key="`senderContent${i.id}${index}`"></span>
+                <span v-if="i.type == '1'" v-html="i.content" :key="`senderContent${i.id}${index}`"></span>
+                <span v-else-if="i.type == '2'">
+                  {{ getFile(i.file) }}<van-button type="info" size="mini" class="downBtn" @click="downFile(i.file)">下载</van-button>
+                </span>
               </van-col>
             </template>
             <template v-else>
               <van-col span="24" class="receverTime" :key="`div${i.id}${index}`">
                 <span :key="`receverTime${i.id}${index}`"> {{ i.sender_name }} [{{ i.send_time }}]</span>
-                <span v-html="i.content" :key="`receverContent${i.id}${index}`"></span>
+                <span v-if="i.type == '1'" v-html="i.content" :key="`receverContent${i.id}${index}`"></span>
+                <span v-else-if="i.type == '2'">
+                  {{ getFile(i.file) }}<van-button type="info" size="mini" class="downBtn" @click="downFile(i.file)">下载</van-button>
+                </span>
               </van-col>
             </template>
           </template>
         </van-col>
         <van-col span="24" class="two">
-          <van-col span="20" class="cont">
+          <van-col span="17" class="cont">
             <van-field v-model="content" placeholder="请输入内容" />
           </van-col>
-          <van-col span="4" class="btn">
+          <van-col span="7" class="btn">
             <van-button type="info" size="small" @click="send">发送</van-button>
+            <van-button type="info" size="small" @click="other">其它</van-button>
           </van-col>
         </van-col>
       </van-col>
     </van-row>
+    <van-dialog v-model="show" class="dialog" title="文件" :showConfirmButton="false" :showCancelButton="false" :closeOnClickOverlay="false">
+      <van-form>
+        <van-field name="file" label="文件">
+          <template #input>
+            <van-uploader
+              :fileList="fileForm.file"
+              :max-count="1"
+              :after-read="(file) => toUpload(file, 'file')"
+              @delete="(file) => toDelete(file, 'file')"
+              accept="file"
+            />
+          </template>
+        </van-field>
+        <div class="btn">
+          <van-button type="danger" size="small" @click="twoClose">取消发送</van-button>
+          <van-button type="info" size="small" @click="twoSend">提交发送</van-button>
+        </div>
+      </van-form>
+    </van-dialog>
   </div>
 </template>
 
 <script>
 import { Toast } from 'vant';
 import { mapState, createNamespacedHelpers } from 'vuex';
+const { mapActions: upload } = createNamespacedHelpers('upload');
 const { mapActions: adminLogin } = createNamespacedHelpers('adminLogin');
 const { mapActions: patentchat } = createNamespacedHelpers('patentchat');
 const _ = require('lodash');
@@ -47,6 +74,11 @@ export default {
       content: '',
       // 消息列表
       list: [],
+      // 浏览器高度
+      client: {},
+      // 发送其他内容
+      show: false,
+      fileForm: {},
     };
   },
   created() {
@@ -54,6 +86,7 @@ export default {
     this.search();
   },
   methods: {
+    ...upload(['upload']),
     ...adminLogin({ adminQuery: 'query' }),
     ...patentchat(['create', 'query']),
     // 查询
@@ -63,17 +96,18 @@ export default {
         this.$set(this, `list`, res.data);
       }
     },
-    // 发言
+    // 发言,正常内容
     async send() {
       if (this.content) {
-        let data = {
+        let arr = {
+          type: '1',
           content: this.content,
           sender_id: this.user._id,
           sender_name: this.user.name,
           receiver_id: this.adminInfo._id,
           receiver_name: this.adminInfo.name,
         };
-        let res = await this.create(data);
+        let res = await this.create(arr);
         if (this.$checkRes(res)) {
           this.$toast({ type: `success`, message: `发言成功` });
           this.content = '';
@@ -83,6 +117,64 @@ export default {
         this.$toast({ type: `fail`, message: `缺少必要信息` });
       }
     },
+    // 发言,发送文件
+    other() {
+      this.show = true;
+    },
+    // 提交发送
+    async twoSend() {
+      let data = this.fileForm;
+      if (data.file) {
+        let data = {
+          type: '2',
+          file: data.file,
+          sender_id: this.user._id,
+          sender_name: this.user.name,
+          receiver_id: this.adminInfo._id,
+          receiver_name: this.adminInfo.name,
+        };
+        let res = await this.create(data);
+        if (this.$checkRes(res)) {
+          this.$toast({ type: `success`, message: `发言成功` });
+          this.fileForm = { file: [] };
+          this.twoClose();
+          this.search();
+        }
+      } else {
+        this.$toast({ type: `fail`, message: `缺少必要信息` });
+      }
+    },
+    // 取消发送
+    twoClose() {
+      this.show = false;
+    },
+
+    async toUpload({ file }, model) {
+      // 上传,赋值
+      const res = await this.upload({ file, dir: 'chat' });
+      if (this.$checkRes(res)) {
+        this.$set(this.fileForm, model, [{ name: res.name, url: res.uri }]);
+      }
+    },
+    toDelete(file, model) {
+      const index = this.fileForm[model].findIndex((f) => _.isEqual(f, file));
+      this.fileForm[model].splice(index, 1);
+    },
+    // 处理文件
+    getFile(data) {
+      if (data.length > 0) {
+        return data[0].name;
+      }
+    },
+    // 下载文件
+    downFile(data) {
+      if (data.length > 0) {
+        let url = data.map((i) => i.url);
+        window.location.href = `${process.env.VUE_APP_HOST}/${url[0]}`;
+      } else {
+        this.$toast({ type: `fail`, message: `非正常文件,无法下载` });
+      }
+    },
     // 判断发言人
     isSender(data) {
       return this.user.id !== data.sender_id;
@@ -95,6 +187,13 @@ export default {
       }
     },
   },
+  mounted() {
+    let client = {
+      height: document.documentElement.clientHeight || document.body.clientHeight,
+      width: document.documentElement.clientWidth || document.body.clientWidth,
+    };
+    this.$set(this, `client`, client);
+  },
   computed: {
     ...mapState(['user']),
   },
@@ -114,7 +213,6 @@ export default {
 <style lang="less" scoped>
 .main {
   .one {
-    height: 350px;
     overflow-x: hidden;
     overflow-y: auto;
     padding: 10px 5px;
@@ -170,4 +268,18 @@ export default {
     }
   }
 }
+.dialog {
+  .btn {
+    text-align: center;
+    .van-button {
+      margin: 8px;
+    }
+  }
+}
+.downBtn {
+  margin: 0 0 0 8px;
+  /deep/.van-button__text {
+    color: #ffffff !important;
+  }
+}
 </style>

+ 24 - 14
src/router/index.js

@@ -225,9 +225,14 @@ const zlyy = [
     meta: { title: '分发消息-添加消息' },
     component: () => import('../views/service/patent/admin/examine/hairmess_create.vue'),
   },
+  {
+    path: '/service/patent/admin/examine/hairmess_autoCreate',
+    meta: { title: '分发消息-自动分发消息' },
+    component: () => import('../views/service/patent/admin/examine/hairmess_autoCreate.vue'),
+  },
   {
     path: '/service/patent/admin/examine/analysis',
-    meta: { title: '专利分析' },
+    meta: { title: '查新检索' },
     component: () => import('../views/service/patent/admin/examine/analysis.vue'),
   },
   // 管理员-专利申请管理
@@ -251,15 +256,15 @@ const zlyy = [
     meta: { title: '专利信息-导出结果' },
     component: () => import('../views/service/patent/admin/patent/info_result.vue'),
   },
-  // 管理员-专利评估管理
+  // 管理员-价值评估管理
   {
     path: '/service/patent/admin/patent/assessment',
-    meta: { title: '专利评估' },
+    meta: { title: '价值评估' },
     component: () => import('../views/service/patent/admin/patent/assessment.vue'),
   },
   {
     path: '/service/patent/admin/patent/assessment_examine',
-    meta: { title: '专利评估-审核信息' },
+    meta: { title: '价值评估-审核信息' },
     component: () => import('../views/service/patent/admin/patent/assessment_examine.vue'),
   },
   // 管理员-专利交易管理
@@ -329,12 +334,12 @@ const zlyy = [
   },
   {
     path: '/service/patent/mech/patent/navigation',
-    meta: { title: '专利分析' },
+    meta: { title: '查新检索' },
     component: () => import('../views/service/patent/mech/patent/navigation/index.vue'),
   },
   {
     path: '/service/patent/mech/patent/navigation/info',
-    meta: { title: '专利分析-详细信息' },
+    meta: { title: '查新检索-详细信息' },
     component: () => import('../views/service/patent/mech/patent/navigation/info.vue'),
   },
   {
@@ -375,6 +380,11 @@ const zlyy = [
     meta: { title: '聊天' },
     component: () => import('../views/service/patent/user/message/read_chat.vue'),
   },
+  {
+    path: '/service/patent/user/chat/index',
+    meta: { title: '咨詢服务' },
+    component: () => import('../views/service/patent/user/chat/index.vue'),
+  },
   // 用户-我的申请
   // 用户-专利申请
   {
@@ -398,36 +408,36 @@ const zlyy = [
     component: () => import('../views/service/patent/user/apply/apply/gzjDetail.vue'),
   },
 
-  // 用户-专利分析
+  // 用户-查新检索
   {
     path: '/service/patent/user/apply/analysis',
-    meta: { title: '专利分析' },
+    meta: { title: '查新检索' },
     component: () => import('../views/service/patent/user/apply/analysis/index.vue'),
   },
   {
     path: '/service/patent/user/apply/analysis/detail',
-    meta: { title: '专利分析-交底书' },
+    meta: { title: '查新检索-交底书' },
     component: () => import('../views/service/patent/user/apply/analysis/detail.vue'),
   },
   {
     path: '/service/patent/user/apply/analysis/result',
-    meta: { title: '专利分析-审核结果' },
+    meta: { title: '查新检索-审核结果' },
     component: () => import('../views/service/patent/user/apply/analysis/result.vue'),
   },
-  // 用户-专利评估
+  // 用户-价值评估
   {
     path: '/service/patent/user/apply/assessment',
-    meta: { title: '专利评估' },
+    meta: { title: '价值评估' },
     component: () => import('../views/service/patent/user/apply/assessment/index.vue'),
   },
   {
     path: '/service/patent/user/apply/assessment/detail',
-    meta: { title: '专利评估-申请评估' },
+    meta: { title: '价值评估-申请评估' },
     component: () => import('../views/service/patent/user/apply/assessment/detail.vue'),
   },
   {
     path: '/service/patent/user/apply/assessment/result',
-    meta: { title: '专利评估-审核结果' },
+    meta: { title: '价值评估-审核结果' },
     component: () => import('../views/service/patent/user/apply/assessment/result.vue'),
   },
   // 用户-我的专利

+ 2 - 2
src/store/index.js

@@ -47,9 +47,9 @@ import patentnotice from '@common/src/store/patent/patentnotice';
 import patentapply from '@common/src/store/patent/patentapply';
 // 专利申请预警表
 import patentwarning from '@common/src/store/patent/patentwarning';
-// 专利分析
+// 查新检索
 import patentanalysis from '@common/src/store/patent/patentanalysis';
-// 专利评估
+// 价值评估
 import patentassess from '@common/src/store/patent/patentassess';
 // 专利信息
 import patentinfo from '@common/src/store/patent/patentinfo';

+ 1 - 2
src/views/index.vue

@@ -87,9 +87,8 @@ export default {
     await this.search();
   },
   methods: {
-        ...personal({ personalCreate: 'create' }),
+    ...personal({ personalCreate: 'create' }),
     search({ skip = 0, limit = this.limit, ...info } = {}) {},
-   
   },
   computed: {
     ...mapState(['user']),

+ 2 - 2
src/views/service/patent/admin/adminBtn.vue

@@ -16,14 +16,14 @@
           <van-col span="24" class="one_1">
             <van-cell title="专利申请" @click="pathBtn('admin/examine', 'patent')" is-link />
             <van-cell title="国知局反馈消息" @click="pathBtn('admin/examine', 'hairmess')" is-link />
-            <van-cell title="专利分析" @click="pathBtn('admin/examine', 'analysis')" is-link />
+            <van-cell title="查新检索" @click="pathBtn('admin/examine', 'analysis')" is-link />
           </van-col>
         </van-col>
         <van-col span="24" class="one">
           <van-divider content-position="left" :style="{ color: '#1989fa', borderColor: '#1989fa' }">专利管理</van-divider>
           <van-col span="24" class="one_1">
             <van-cell title="专利信息" @click="pathBtn('admin/patent', 'info')" is-link />
-            <van-cell title="专利评估" @click="pathBtn('admin/patent', 'assessment')" is-link />
+            <van-cell title="价值评估" @click="pathBtn('admin/patent', 'assessment')" is-link />
             <van-cell title="专利交易" @click="pathBtn('admin/patent', 'trans')" is-link />
           </van-col>
         </van-col>

+ 1 - 1
src/views/service/patent/admin/examine/analysis/info-1.vue

@@ -6,7 +6,7 @@
           <van-field v-model="info.name" name="发明名称" label="发明名称" readonly />
           <van-field v-model="info.apply_name" name="申请人" label="申请人" readonly />
           <van-field v-model="info.type" name="专利类型" label="专利类型" readonly />
-          <van-field v-model="info.inventer" name="发明人" label="发明人" readonly />
+          <van-field v-model="info.inventor" name="发明人" label="发明人" readonly />
           <van-field v-model="info.contact" name="技术联系人" label="技术联系人" readonly />
           <van-field v-model="info.phone" name="联系人电话" label="联系人电话" readonly />
           <van-field v-model="info.email" name="联系人邮箱" label="联系人邮箱" readonly />

+ 17 - 9
src/views/service/patent/admin/examine/hairmess.vue

@@ -1,8 +1,14 @@
 <template>
   <div id="hairmess">
-    <admin-frame @search="search" :limit="limit" :total="total" topType="2" @back="back" @add="add" :useNav="false">
+    <admin-frame @search="search" :limit="limit" :total="total" topType="2" @back="back" :rightArrow="false" :useNav="false">
       <template v-slot:info>
-        <list-1 :list="list"></list-1>
+        <van-col span="24" class="btn">
+          <van-button type="info" size="small" @click="add">手动分发</van-button>
+          <van-button type="info" size="small" @click="twoAdd">自动分发</van-button>
+        </van-col>
+        <van-col span="24">
+          <list-1 :list="list"></list-1>
+        </van-col>
       </template>
     </admin-frame>
   </div>
@@ -43,6 +49,10 @@ export default {
     add() {
       this.$router.push({ path: '/service/patent/admin/examine/hairmess_create' });
     },
+    // 自动分发消息
+    twoAdd() {
+      this.$router.push({ path: '/service/patent/admin/examine/hairmess_autoCreate' });
+    },
     // 返回
     back() {
       this.$router.push({ path: '/service/patent/index' });
@@ -65,13 +75,11 @@ export default {
 </script>
 
 <style lang="less" scoped>
-.dialog {
-  .btn {
-    margin: 10px 0;
-    text-align: center;
-    .van-button {
-      margin: 0 10px;
-    }
+.btn {
+  margin: 10px 0;
+  text-align: center;
+  .van-button {
+    margin: 0 10px;
   }
 }
 </style>

+ 98 - 0
src/views/service/patent/admin/examine/hairmess_autoCreate.vue

@@ -0,0 +1,98 @@
+<template>
+  <div id="hairmess">
+    <admin-frame topType="2" @back="back" :rightArrow="false" :usePage="false" :useNav="false">
+      <template v-slot:info>
+        <van-form label-width="4em">
+          <van-field name="uri" label="文件">
+            <template #input>
+              <van-uploader
+                :fileList="form.uri"
+                :max-count="1"
+                :after-read="(file) => toUpload(file, 'uri')"
+                @delete="(file) => toDelete(file, 'uri')"
+                accept="file"
+              />
+            </template>
+          </van-field>
+          <van-col span="24" class="btn">
+            <van-button type="danger" size="small" @click="back">取消发送</van-button>
+            <van-button type="info" size="small" @click="onSubmit">确认发送</van-button>
+          </van-col>
+        </van-form>
+      </template>
+    </admin-frame>
+  </div>
+</template>
+
+<script>
+import adminFrame from '@frame/src/components/mobile-frame/mobile-main.vue';
+import { mapState, createNamespacedHelpers } from 'vuex';
+const { mapActions: upload } = createNamespacedHelpers('upload');
+const { mapActions: patentwarning } = createNamespacedHelpers('patentwarning');
+
+export default {
+  name: 'hairmess',
+  props: {},
+  components: {
+    adminFrame,
+  },
+  data: function () {
+    return {
+      form: {},
+      uri: '',
+    };
+  },
+  async created() {},
+  methods: {
+    ...upload(['upload']),
+    ...patentwarning(['import']),
+    // 提交
+    async onSubmit() {
+      let data = { uri: this.uri };
+      let res = await this.import(data);
+      if (this.$checkRes(res)) {
+        console.log(res);
+      }
+    },
+    async toUpload({ file }, model) {
+      // 上传,赋值
+      const res = await this.upload({ file, dir: 'warning' });
+      if (this.$checkRes(res)) {
+        this.$set(this.form, model, [{ name: res.name, url: res.uri }]);
+        this.$set(this, `uri`, res.uri);
+      }
+    },
+    toDelete(file, model) {
+      const index = this.form[model].findIndex((f) => _.isEqual(f, file));
+      this.form[model].splice(index, 1);
+      this.$set(this, `uri`, '');
+    },
+    // 返回
+    back() {
+      this.$router.push({ path: '/service/patent/admin/examine/hairmess' });
+    },
+  },
+  computed: {
+    ...mapState(['user']),
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+  watch: {
+    test: {
+      deep: true,
+      immediate: true,
+      handler(val) {},
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.btn {
+  text-align: center;
+  .van-button {
+    margin: 10px;
+  }
+}
+</style>

+ 1 - 1
src/views/service/patent/admin/examine/patent/info-1.vue

@@ -7,7 +7,7 @@
           <van-field v-model="info.apply_name" name="申请人" label="申请人" readonly />
           <van-field v-model="info.type" name="专利类型" label="专利类型" readonly />
           <van-col span="24" class="other">
-            <span>发明人:</span><span v-for="(item, index) in info.inventer" :key="index">{{ item.name }};</span>
+            <span>发明人:</span><span v-for="(item, index) in info.inventor" :key="index">{{ item.name }};</span>
           </van-col>
           <van-col span="24" class="other">
             <span>技术联系人:</span><span v-for="(item, index) in info.contact" :key="index">{{ item.name }};</span>

+ 1 - 1
src/views/service/patent/admin/message/parts/list-1.vue

@@ -8,7 +8,7 @@
           </van-col>
           <van-col span="24" class="other">
             <van-col span="24" class="otherInfo"> 发送时间:{{ item.send_time || '暂无' }} </van-col>
-            <van-col span="24" class="otherInfo textOver"> 发送内容:{{ item.content || '暂无' }} </van-col>
+            <van-col span="24" class="otherInfo textOver"> 发送内容:{{ item.type == '1' ? item.content : '文件' }} </van-col>
           </van-col>
           <van-col span="24" class="btn">
             <van-button type="info" size="small" @click="detail(item)">查看消息</van-button>

+ 108 - 4
src/views/service/patent/admin/message/service_detail.vue

@@ -7,33 +7,60 @@
             <template v-if="isSender(i, index)">
               <van-col span="24" class="senderTime" :key="`div${i.id}${index}`">
                 <span :key="`senderTime${i.id}${index}`">[{{ i.send_time }}] {{ i.sender_name }}</span>
-                <span v-html="i.content" :key="`senderContent${i.id}${index}`"></span>
+                <span v-if="i.type == '1'" v-html="i.content" :key="`senderContent${i.id}${index}`"></span>
+                <span v-else-if="i.type == '2'">
+                  {{ getFile(i.file) }}<van-button type="info" size="mini" class="downBtn" @click="downFile(i.file)">下载</van-button>
+                </span>
               </van-col>
             </template>
             <template v-else>
               <van-col span="24" class="receverTime" :key="`div${i.id}${index}`">
                 <span :key="`receverTime${i.id}${index}`"> {{ i.sender_name }} [{{ i.send_time }}]</span>
-                <span v-html="i.content" :key="`receverContent${i.id}${index}`"></span>
+                <span v-if="i.type == '1'" v-html="i.content" :key="`receverContent${i.id}${index}`"></span>
+                <span v-else-if="i.type == '2'">
+                  {{ getFile(i.file) }}<van-button type="info" size="mini" class="downBtn" @click="downFile(i.file)">下载</van-button>
+                </span>
               </van-col>
             </template>
           </template>
         </van-col>
         <van-col span="24" class="two">
-          <van-col span="20" class="cont">
+          <van-col span="17" class="cont">
             <van-field v-model="content" placeholder="请输入内容" />
           </van-col>
-          <van-col span="4" class="btn">
+          <van-col span="7" class="btn">
             <van-button type="info" size="small" @click="send">发送</van-button>
+            <van-button type="info" size="small" @click="other">其它</van-button>
           </van-col>
         </van-col>
       </template>
     </admin-frame>
+    <van-dialog v-model="show" class="dialog" title="文件" :showConfirmButton="false" :showCancelButton="false" :closeOnClickOverlay="false">
+      <van-form>
+        <van-field name="file" label="文件">
+          <template #input>
+            <van-uploader
+              :fileList="fileForm.file"
+              :max-count="1"
+              :after-read="(file) => toUpload(file, 'file')"
+              @delete="(file) => toDelete(file, 'file')"
+              accept="file"
+            />
+          </template>
+        </van-field>
+        <div class="btn">
+          <van-button type="danger" size="small" @click="twoClose">取消发送</van-button>
+          <van-button type="info" size="small" @click="twoSend">提交发送</van-button>
+        </div>
+      </van-form>
+    </van-dialog>
   </div>
 </template>
 
 <script>
 import adminFrame from '@frame/src/components/mobile-frame/mobile-main.vue';
 import { mapState, createNamespacedHelpers } from 'vuex';
+const { mapActions: upload } = createNamespacedHelpers('upload');
 const { mapActions: patentchat } = createNamespacedHelpers('patentchat');
 export default {
   name: 'service_detail',
@@ -46,12 +73,16 @@ export default {
       client: {},
       list: [],
       content: '',
+      // 发送其他内容
+      show: false,
+      fileForm: {},
     };
   },
   async created() {
     await this.search();
   },
   methods: {
+    ...upload(['upload']),
     ...patentchat(['adminChatQuery', 'create']),
     async search() {
       let res = await this.adminChatQuery({ sender_id: this.sender_id, receiver_id: this.user._id });
@@ -63,6 +94,7 @@ export default {
     async send() {
       if (this.content) {
         let data = {
+          type: '1',
           content: this.content,
           sender_id: this.user._id,
           sender_name: this.user.name,
@@ -79,6 +111,64 @@ export default {
         this.$toast({ type: `fail`, message: `缺少必要信息` });
       }
     },
+    // 发言,发送文件
+    other() {
+      this.show = true;
+    },
+    // 提交发送
+    async twoSend() {
+      let data = this.fileForm;
+      if (data.file) {
+        let arr = {
+          type: '2',
+          file: data.file,
+          sender_id: this.user._id,
+          sender_name: this.user.name,
+          receiver_id: this.sender_id,
+          receiver_name: this.sender_name,
+        };
+        let res = await this.create(arr);
+        if (this.$checkRes(res)) {
+          this.$toast({ type: `success`, message: `发言成功` });
+          this.fileForm = { file: [] };
+          this.twoClose();
+          this.search();
+        }
+      } else {
+        this.$toast({ type: `fail`, message: `缺少必要信息` });
+      }
+    },
+    // 取消发送
+    twoClose() {
+      this.show = false;
+    },
+
+    async toUpload({ file }, model) {
+      // 上传,赋值
+      const res = await this.upload({ file, dir: 'chat' });
+      if (this.$checkRes(res)) {
+        this.$set(this.fileForm, model, [{ name: res.name, url: res.uri }]);
+      }
+    },
+    toDelete(file, model) {
+      const index = this.fileForm[model].findIndex((f) => _.isEqual(f, file));
+      this.fileForm[model].splice(index, 1);
+    },
+    // 处理文件
+    getFile(data) {
+      if (data.length > 0) {
+        return data[0].name;
+      }
+    },
+    // 下载文件
+    downFile(data) {
+      if (data.length > 0) {
+        let url = data.map((i) => i.url);
+        window.location.href = `${process.env.VUE_APP_HOST}/${url[0]}`;
+      } else {
+        this.$toast({ type: `fail`, message: `非正常文件,无法下载` });
+      }
+    },
     // 判断发言人
     isSender(data) {
       return this.user.id !== data.sender_id;
@@ -180,4 +270,18 @@ export default {
     }
   }
 }
+.dialog {
+  .btn {
+    text-align: center;
+    .van-button {
+      margin: 8px;
+    }
+  }
+}
+.downBtn {
+  margin: 0 0 0 8px;
+  /deep/.van-button__text {
+    color: #ffffff !important;
+  }
+}
 </style>

+ 2 - 12
src/views/service/patent/admin/patent/assessment/examine-1.vue

@@ -4,9 +4,9 @@
       <van-col span="24" class="main">
         <van-form @submit="onSubmit">
           <van-field v-model="form.patent_name" name="patent_name" label="专利名称" center clearable readonly>
-            <template #button>
+            <!-- <template #button>
               <van-button size="small" type="info" @click="view(form.patent_id)">专利信息</van-button>
-            </template>
+            </template> -->
           </van-field>
           <van-field name="is_money" label="是否缴费">
             <template #input>
@@ -25,16 +25,6 @@
               </van-radio-group>
             </template>
           </van-field>
-          <van-field name="report" label="评估报告" v-if="form.status == '1'">
-            <template #input>
-              <van-uploader
-                :fileList="form.report"
-                :max-count="1"
-                :after-read="(file) => toUpload(file, 'report')"
-                @delete="(file) => toDelete(file, 'report')"
-              />
-            </template>
-          </van-field>
           <van-field
             v-model="form.remark"
             name="remark"

+ 2 - 2
src/views/service/patent/admin/patent/info.vue

@@ -2,12 +2,12 @@
   <div id="index">
     <admin-frame @search="search" :limit="limit" :total="total" topType="2" @back="back" @add="add" :useNav="false">
       <template v-slot:info>
-        <!-- <van-col span="24" class="one">
+        <van-col span="24" class="one">
           <van-button type="info" size="small" @click="getTemplate">下载导入模板</van-button>
           <van-button type="info" size="small" @click="toContinue">导入</van-button>
           <van-button type="info" size="small" @click="exportView">导出</van-button>
           <van-button type="info" size="small" @click="toResult">导出结果</van-button>
-        </van-col> -->
+        </van-col>
         <van-col span="24" class="two">
           <list-1 :list="list" @detail="detail" @deletes="deletes"></list-1>
         </van-col>

+ 134 - 5
src/views/service/patent/admin/patent/info/detail-1.vue

@@ -18,10 +18,27 @@
               </van-radio-group>
             </template>
           </van-field>
-          <van-field v-model="form.term" name="term" label="专利有效性" :rules="[{ required: true, message: '专利有效性' }]" />
-          <van-field v-model="form.inventor" name="inventor" label="发明人" :rules="[{ required: true, message: '发明人' }]" />
+          <van-field name="term" label="专利有效性" :rules="[{ required: true, message: '专利有效性' }]">
+            <template #input>
+              <van-radio-group v-model="form.term" direction="horizontal">
+                <van-radio name="审中">审中</van-radio>
+                <van-radio name="有效">有效</van-radio>
+              </van-radio-group>
+            </template>
+          </van-field>
+          <van-col span="24" class="inventor">
+            <van-col span="24" class="inventor_btn">
+              <van-button size="mini" type="info" @click="selectinventor('inventor')">选择发明人</van-button>
+              <!-- <van-button size="mini" type="info" @click="addinventor('inventor')">添加发明人</van-button> -->
+            </van-col>
+            <van-col span="24" class="inventor_list">
+              <span>发明人:</span>
+              <span v-for="(item, index) in form.inventor" :key="index">
+                {{ index + 1 }}-{{ item.name }}- <span style="color: #ff0000" @click="delInv(item)">删除</span>;
+              </span>
+            </van-col>
+          </van-col>
           <van-field v-model="form.address" name="address" label="发明人地址" />
-          <van-field v-model="form.origin" name="origin" label="数据来源" />
           <van-field v-model="form.agent_personal" name="agent_personal" label="代理人" />
           <van-field v-model="form.agent" name="agent" label="代理机构" />
           <van-field v-model="form.abstract" name="abstract" label="摘要" rows="4" autosize type="textarea" />
@@ -66,12 +83,40 @@
         </van-form>
       </van-col>
     </van-row>
+    <van-dialog class="dialog" v-model="show" title="查询用户" :show-cancel-button="false" :show-confirm-button="false" :closeOnClickOverlay="true">
+      <van-col span="24" class="two">
+        <van-col span="24" class="two_1">
+          <van-search v-model="searchName" show-action placeholder="请输入联系电话" @search="searchUser">
+            <template #action>
+              <div @click="searchUser">搜索</div>
+            </template>
+          </van-search>
+        </van-col>
+        <van-col span="24" class="two_2">
+          <van-col span="24" class="list" v-for="(item, index) in list" :key="index">
+            <van-col span="24" class="name"> {{ item.name }} </van-col>
+            <van-col span="24" class="other">
+              <van-col span="24" class="otherInfo">
+                联系电话:<span>{{ item.phone }}</span>
+              </van-col>
+            </van-col>
+            <van-col span="24" class="btn">
+              <van-button type="info" size="mini" @click="conFirm(item)">确认选择</van-button>
+            </van-col>
+          </van-col>
+          <van-col span="24" class="page">
+            <page @search="searchUser" :limit="limit" :total="total"></page>
+          </van-col>
+        </van-col>
+      </van-col>
+    </van-dialog>
   </div>
 </template>
 
 <script>
 import { mapState, createNamespacedHelpers } from 'vuex';
 const { mapActions: upload } = createNamespacedHelpers('upload');
+const { mapActions: personal } = createNamespacedHelpers('personal');
 var moment = require('moment');
 export default {
   name: 'detail-1',
@@ -85,11 +130,22 @@ export default {
       maxDate: new Date(2050, 10, 1),
       calendarShow: false,
       calendar_type: '',
+      // 选择发明人&&技术联系人
+      show: false,
+      type: '',
+      // 属于手机号查询用户
+      searchName: '',
+      list: [],
+      limit: 4,
+      total: 0,
     };
   },
-  created() {},
+  created() {
+    this.searchUser();
+  },
   methods: {
     ...upload(['upload']),
+    ...personal({ perQuery: 'query' }),
     onSubmit(values) {
       this.$emit('onSubmit', values);
     },
@@ -114,6 +170,33 @@ export default {
       const index = this.form[model].findIndex((f) => _.isEqual(f, file));
       this.form[model].splice(index, 1);
     },
+    // 发明人
+    // 选择发明人&&技术联系人
+    selectinventor(type) {
+      this.$set(this, `type`, type);
+      this.show = true;
+    },
+    // 确认选择
+    conFirm(data) {
+      let user = { user_id: data.id, name: data.name };
+      console.log(this.type);
+      if (this.type == 'inventor') this.form.inventor.push(user);
+      this.show = false;
+    },
+    // 查询用户
+    async searchUser({ skip = 0, limit = 5, ...info } = {}) {
+      info.code = 'JLKJQYCGD';
+      if (this.searchName) info.phone = this.searchName;
+      let res = await this.perQuery({ skip, limit, ...info });
+      if (this.$checkRes(res)) {
+        this.$set(this, `list`, res.data);
+        this.$set(this, `total`, res.total);
+      }
+    },
+    // 删除发明用户
+    delInv(data) {
+      this.form.inventor.splice(this.form.inventor.indexOf(data), 1);
+    },
   },
   computed: {
     ...mapState(['user']),
@@ -131,4 +214,50 @@ export default {
 };
 </script>
 
-<style lang="less" scoped></style>
+<style lang="less" scoped>
+.dialog {
+  /deep/.van-dialog__content {
+    height: 400px;
+    overflow-y: auto;
+  }
+  .two {
+    .list {
+      border-bottom: 1px dashed #ccc;
+      margin: 0 0 8px 0;
+      padding: 8px;
+      .name {
+        font-size: 16px;
+        margin: 0 0 5px 0;
+      }
+      .other {
+        margin: 0 0 5px 0;
+        .otherInfo {
+          font-size: 14px;
+          color: #666;
+          span {
+            color: #000;
+          }
+        }
+      }
+      .btn {
+        text-align: center;
+      }
+    }
+  }
+}
+/deep/.van-dialog {
+  width: 95%;
+}
+.inventor {
+  padding: 8px 18px;
+  background-color: #fff;
+  .inventor_btn {
+    text-align: center;
+    margin: 0 0 5px 0;
+  }
+  .inventor_list {
+    font-size: 15px;
+    color: #666;
+  }
+}
+</style>

+ 1 - 1
src/views/service/patent/admin/patent/info_create.vue

@@ -22,7 +22,7 @@ export default {
   },
   data: function () {
     return {
-      form: {},
+      form: { inventor: [] },
     };
   },
   async created() {

+ 1 - 1
src/views/service/patent/mech/examine/patent/info-1.vue

@@ -8,7 +8,7 @@
           <van-field v-model="info.water_number" name="专利用户码" label="专利用户码" readonly />
           <van-field v-model="info.type" name="专利类型" label="专利类型" readonly />
           <van-col span="24" class="other">
-            <span>发明人:</span><span v-for="(item, index) in info.inventer" :key="index">{{ item.name }};</span>
+            <span>发明人:</span><span v-for="(item, index) in info.inventor" :key="index">{{ item.name }};</span>
           </van-col>
           <van-col span="24" class="other">
             <span>技术联系人:</span><span v-for="(item, index) in info.contact" :key="index">{{ item.name }};</span>

+ 1 - 1
src/views/service/patent/mech/mechBtn.vue

@@ -51,7 +51,7 @@
               </van-goods-action-icon>
             </van-col>
             <van-col span="8" class="one_1action" @click.native="pathBtn('mech/patent', 'navigation')">
-              <van-goods-action-icon text="专利分析">
+              <van-goods-action-icon text="查新检索">
                 <template #icon><i class="iconfont icon-pinggu"></i></template>
               </van-goods-action-icon>
             </van-col>

+ 5 - 5
src/views/service/patent/user/apply/analysis/detail.vue

@@ -44,7 +44,7 @@ export default {
         data.user_id = this.user._id;
         data.apply_name = this.user.name;
         data.status = '0';
-        data.inventer = this.user.name;
+        data.inventor = this.user.name;
         data.contact = this.user.name;
         data.questions = {};
         this.$set(this, `form`, data);
@@ -55,7 +55,7 @@ export default {
         data.status = '0';
         let res = await this.update(data);
         if (this.$checkRes(res)) {
-          this.$toast({ type: `success`, message: `修改专利分析申请成功` });
+          this.$toast({ type: `success`, message: `修改查新检索申请成功` });
           this.back();
         } else {
           this.$toast({ type: `success`, message: `${res.errmsg}` });
@@ -63,7 +63,7 @@ export default {
       } else {
         let res = await this.create(data);
         if (this.$checkRes(res)) {
-          this.$toast({ type: `success`, message: `专利分析申请成功` });
+          this.$toast({ type: `success`, message: `查新检索申请成功` });
           this.back();
         } else {
           this.$toast({ type: `success`, message: `${res.errmsg}` });
@@ -74,7 +74,7 @@ export default {
       //   else if (data.status == '-2') data.status = '1';
       //   let res = await this.update(data);
       //   if (this.$checkRes(res)) {
-      //     this.$toast({ type: `success`, message: `修改专利分析申请成功` });
+      //     this.$toast({ type: `success`, message: `修改查新检索申请成功` });
       //     this.back();
       //   } else {
       //     this.$toast({ type: `success`, message: `${res.errmsg}` });
@@ -85,7 +85,7 @@ export default {
       //   else if (data.is_mech == '1') data.status = '0';
       //   let res = await this.create(data);
       //   if (this.$checkRes(res)) {
-      //     this.$toast({ type: `success`, message: `专利分析申请成功` });
+      //     this.$toast({ type: `success`, message: `查新检索申请成功` });
       //     this.back();
       //   } else {
       //     this.$toast({ type: `success`, message: `${res.errmsg}` });

+ 1 - 1
src/views/service/patent/user/apply/analysis/parts/detail-2.vue

@@ -9,7 +9,7 @@
           <van-popup v-model="typePicker" position="bottom">
             <van-picker show-toolbar :columns="typeList" @confirm="typeCon" @cancel="typePicker = false" />
           </van-popup>
-          <van-field v-model="form.inventer" name="发明人" label="发明人" placeholder="发明人" :rules="[{ required: false, message: '发明人' }]" />
+          <van-field v-model="form.inventor" name="发明人" label="发明人" placeholder="发明人" :rules="[{ required: false, message: '发明人' }]" />
           <van-field
             v-model="form.contact"
             name="技术联系人"

+ 1 - 1
src/views/service/patent/user/apply/analysis/parts/result-2.vue

@@ -7,7 +7,7 @@
             <van-field v-model="form.name" name="发明名称" label="发明名称" readonly />
             <van-field v-model="form.apply_name" name="申请人" label="申请人" readonly />
             <van-field v-model="form.type" name="专利类型" label="专利类型" readonly />
-            <van-field v-model="form.inventer" name="发明人" label="发明人" readonly />
+            <van-field v-model="form.inventor" name="发明人" label="发明人" readonly />
             <van-field v-model="form.contact" name="技术联系人" label="技术联系人" readonly />
             <van-field v-model="form.phone" name="联系人电话" label="联系人电话" readonly />
             <van-field v-model="form.email" name="联系人邮箱" label="联系人邮箱" readonly />

+ 1 - 1
src/views/service/patent/user/apply/apply/detail.vue

@@ -40,7 +40,7 @@ export default {
         }
       } else {
         let data = {
-          inventer: [{ user_id: this.user._id, name: this.user.name }],
+          inventor: [{ user_id: this.user._id, name: this.user.name }],
           contact: [{ user_id: this.user._id, name: this.user.name }],
           questions: {},
           // water_number: moment(new Date()).valueOf(),

+ 19 - 19
src/views/service/patent/user/apply/apply/parts/detail-1.vue

@@ -32,24 +32,24 @@
           <van-popup v-model="typePicker" position="bottom">
             <van-picker show-toolbar :columns="typeList" @confirm="typeCon" @cancel="typePicker = false" />
           </van-popup>
-          <van-col span="24" class="inventer">
-            <van-col span="24" class="inventer_btn">
-              <van-button size="mini" type="info" @click="selectInventer('inventer')">选择发明人</van-button>
-              <van-button size="mini" type="info" @click="addInventer('inventer')">添加发明人</van-button>
+          <van-col span="24" class="inventor">
+            <van-col span="24" class="inventor_btn">
+              <van-button size="mini" type="info" @click="selectinventor('inventor')">选择发明人</van-button>
+              <van-button size="mini" type="info" @click="addinventor('inventor')">添加发明人</van-button>
             </van-col>
-            <van-col span="24" class="inventer_list">
+            <van-col span="24" class="inventor_list">
               <span>发明人:</span>
-              <span v-for="(item, index) in form.inventer" :key="index">
+              <span v-for="(item, index) in form.inventor" :key="index">
                 {{ index + 1 }}-{{ item.name }}- <span style="color: #ff0000" @click="delInv(item)">删除</span>;
               </span>
             </van-col>
           </van-col>
-          <van-col span="24" class="inventer">
-            <van-col span="24" class="inventer_btn">
-              <van-button size="mini" type="info" @click="selectInventer('contact')">选择技术联系人</van-button>
-              <van-button size="mini" type="info" @click="addInventer('contact')">添加技术联系人</van-button>
+          <van-col span="24" class="inventor">
+            <van-col span="24" class="inventor_btn">
+              <van-button size="mini" type="info" @click="selectinventor('contact')">选择技术联系人</van-button>
+              <van-button size="mini" type="info" @click="addinventor('contact')">添加技术联系人</van-button>
             </van-col>
-            <van-col span="24" class="inventer_list">
+            <van-col span="24" class="inventor_list">
               <span>技术联系人:</span>
               <span v-for="(item, index) in form.contact" :key="index">
                 {{ index + 1 }}-{{ item.name }}- <span style="color: #ff0000" @click="delCon(item)">删除</span>;
@@ -268,14 +268,14 @@ export default {
       this.typePicker = false;
     },
     // 选择发明人&&技术联系人
-    selectInventer(type) {
+    selectinventor(type) {
       this.$set(this, `type`, type);
       this.show = true;
     },
     // 确认选择
     conFirm(data) {
       let user = { user_id: data.id, name: data.name };
-      if (this.type == 'inventer') this.form.inventer.push(user);
+      if (this.type == 'inventor') this.form.inventor.push(user);
       else if (this.type == 'contact') this.form.contact.push(user);
       this.show = false;
     },
@@ -290,7 +290,7 @@ export default {
       }
     },
     // 添加发明人&&技术联系人
-    addInventer(type) {
+    addinventor(type) {
       this.$set(this, `type`, type);
       this.addShow = true;
     },
@@ -302,13 +302,13 @@ export default {
     // 确认添加
     submitAdd() {
       let data = this.addForm;
-      if (this.type == 'inventer') this.form.inventer.push(data);
+      if (this.type == 'inventor') this.form.inventor.push(data);
       else if (this.type == 'contact') this.form.contact.push(data);
       this.addShow = false;
     },
     // 删除发明用户
     delInv(data) {
-      this.form.inventer.splice(this.form.inventer.indexOf(data), 1);
+      this.form.inventor.splice(this.form.inventor.indexOf(data), 1);
     },
     // 删除技术联系人
     delCon(data) {
@@ -376,14 +376,14 @@ export default {
 /deep/.van-dialog {
   width: 95%;
 }
-.inventer {
+.inventor {
   padding: 8px 18px;
   background-color: #fff;
-  .inventer_btn {
+  .inventor_btn {
     text-align: center;
     margin: 0 0 5px 0;
   }
-  .inventer_list {
+  .inventor_list {
     font-size: 15px;
     color: #666;
   }

+ 1 - 1
src/views/service/patent/user/apply/apply/parts/result-1.vue

@@ -8,7 +8,7 @@
             <van-field v-model="form.apply_name" name="申请人" label="申请人" readonly />
             <van-field v-model="form.type" name="专利类型" label="专利类型" readonly />
             <van-col span="24" class="other">
-              <span>发明人:</span><span v-for="(item, index) in form.inventer" :key="index">{{ item.name }};</span>
+              <span>发明人:</span><span v-for="(item, index) in form.inventor" :key="index">{{ item.name }};</span>
             </van-col>
             <van-col span="24" class="other">
               <span>技术联系人:</span><span v-for="(item, index) in form.contact" :key="index">{{ item.name }};</span>

+ 2 - 2
src/views/service/patent/user/apply/assessment/detail.vue

@@ -47,7 +47,7 @@ export default {
         data.status = '0';
         let res = await this.update(data);
         if (this.$checkRes(res)) {
-          this.$toast({ type: `success`, message: `专利评估重申成功` });
+          this.$toast({ type: `success`, message: `价值评估重申成功` });
           this.back();
         } else {
           this.$toast({ type: `success`, message: `${res.errmsg}` });
@@ -58,7 +58,7 @@ export default {
         data.status = '0';
         let res = await this.create(data);
         if (this.$checkRes(res)) {
-          this.$toast({ type: `success`, message: `专利评估申请成功` });
+          this.$toast({ type: `success`, message: `价值评估申请成功` });
           this.back();
         } else {
           this.$toast({ type: `success`, message: `${res.errmsg}` });

+ 54 - 0
src/views/service/patent/user/chat/index.vue

@@ -0,0 +1,54 @@
+<template>
+  <div id="index">
+    <admin-frame topType="2" @back="back" :rightArrow="false" :usePage="false" :useNav="false">
+      <template v-slot:info>
+        <frame-chat></frame-chat>
+      </template>
+    </admin-frame>
+  </div>
+</template>
+
+<script>
+import frameChat from '@/layout/chatCommon/chat.vue';
+import adminFrame from '@frame/src/components/mobile-frame/mobile-main.vue';
+import { mapState, createNamespacedHelpers } from 'vuex';
+export default {
+  name: 'index',
+  props: {},
+  components: {
+    adminFrame,
+    frameChat,
+  },
+  data: function () {
+    return {
+      limit: 5,
+      total: 0,
+    };
+  },
+  async created() {
+    await this.search();
+  },
+  methods: {
+    async search({ skip = 0, limit = 10, ...info } = {}) {},
+    // 返回
+    back() {
+      this.$router.push({ path: '/service/patent/index' });
+    },
+  },
+  computed: {
+    ...mapState(['user']),
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+  watch: {
+    test: {
+      deep: true,
+      immediate: true,
+      handler(val) {},
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped></style>

+ 4 - 3
src/views/service/patent/user/userBtn.vue

@@ -31,12 +31,12 @@
               </van-goods-action-icon>
             </van-col>
             <van-col span="8" class="one_1action" @click.native="pathBtn('user/apply', 'analysis')">
-              <van-goods-action-icon text="专利分析" :badge="numData.apply ? numData.apply.analysis : '0'">
+              <van-goods-action-icon text="查新检索" :badge="numData.apply ? numData.apply.analysis : '0'">
                 <template #icon><i class="iconfont icon-pinggu"></i></template>
               </van-goods-action-icon>
             </van-col>
             <van-col span="8" class="one_1action" @click.native="pathBtn('user/apply', 'assessment')">
-              <van-goods-action-icon text="专利评估" :badge="numData.apply ? numData.apply.access : '0'">
+              <van-goods-action-icon text="价值评估" :badge="numData.apply ? numData.apply.access : '0'">
                 <template #icon><i class="iconfont icon-pinggu"></i></template>
               </van-goods-action-icon>
             </van-col>
@@ -151,7 +151,8 @@ export default {
       }
     },
     chat() {
-      this.chatShow = true;
+      // this.chatShow = true;
+      this.$router.push({ path: '/service/patent/user/chat/index' });
     },
     // 更多
     more() {