guhongwei 3 سال پیش
والد
کامیت
33df98b269

+ 6 - 1
src/router/index.js

@@ -204,12 +204,17 @@ const zlyy = [
     meta: { title: '专利申请' },
     component: () => import('../views/service/patent/admin/examine/patent.vue'),
   },
-  // 国知局分发消息
+  // 国知局反馈消息
   {
     path: '/service/patent/admin/examine/hairmess',
     meta: { title: '分发消息' },
     component: () => import('../views/service/patent/admin/examine/hairmess.vue'),
   },
+  {
+    path: '/service/patent/admin/examine/hairmess_create',
+    meta: { title: '分发消息-添加消息' },
+    component: () => import('../views/service/patent/admin/examine/hairmess_create.vue'),
+  },
   {
     path: '/service/patent/admin/examine/analysis',
     meta: { title: '专利分析' },

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

@@ -15,7 +15,7 @@
           <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/examine', 'patent')" is-link />
-            <van-cell title="国知局分发消息" @click="pathBtn('admin/examine', 'hairmess')" is-link />
+            <van-cell title="国知局反馈消息" @click="pathBtn('admin/examine', 'hairmess')" is-link />
             <van-cell title="专利分析" @click="pathBtn('admin/examine', 'analysis')" is-link />
           </van-col>
         </van-col>

+ 2 - 76
src/views/service/patent/admin/examine/hairmess.vue

@@ -5,32 +5,6 @@
         <list-1 :list="list"></list-1>
       </template>
     </admin-frame>
-    <van-dialog class="dialog" v-model="show" title="分发消息" :show-confirm-button="false" :show-cancel-button="false">
-      <van-form>
-        <van-field v-model="form.create_number" center clearable label="专利申请号" placeholder="请输入专利申请号">
-          <template #button>
-            <van-button size="small" type="primary" @click="searchPatent">查询</van-button>
-          </template>
-        </van-field>
-        <van-field v-model="form.patent_name" name="专利名称" label="专利名称" />
-        <van-field v-model="form.to_name" name="接收人" label="接收人" />
-        <van-field name="file_url" label="预警文件">
-          <template #input>
-            <van-uploader
-              :fileList="form.file_url"
-              :max-count="1"
-              :after-read="(file) => toUpload(file, 'file_url')"
-              @delete="(file) => toDelete(file, 'file_url')"
-              accept="file"
-            />
-          </template>
-        </van-field>
-        <van-col span="24" class="btn">
-          <van-button type="danger" size="small" @click="show = false">取消发送</van-button>
-          <van-button type="info" size="small" @click="onSubmit">确认发送</van-button>
-        </van-col>
-      </van-form>
-    </van-dialog>
   </div>
 </template>
 
@@ -39,8 +13,6 @@ import list1 from './hairmess/list-1.vue';
 import adminFrame from '@frame/src/components/mobile-frame/mobile-main.vue';
 import { mapState, createNamespacedHelpers } from 'vuex';
 const { mapActions: patentwarning } = createNamespacedHelpers('patentwarning');
-const { mapActions: patentapply } = createNamespacedHelpers('patentapply');
-const { mapActions: upload } = createNamespacedHelpers('upload');
 export default {
   name: 'hairmess',
   props: {},
@@ -53,18 +25,13 @@ export default {
       limit: 5,
       total: 0,
       list: [],
-      // 添加预警信息
-      show: false,
-      form: {},
     };
   },
   async created() {
     this.search();
   },
   methods: {
-    ...upload(['upload']),
-    ...patentwarning(['query', 'create']),
-    ...patentapply({ patentapplyQuery: 'query' }),
+    ...patentwarning(['query']),
     async search({ skip = 0, limit = this.limit, searchName, ...info } = {}) {
       let res = await this.query({ skip, limit, ...info });
       if (this.$checkRes(res)) {
@@ -74,53 +41,12 @@ export default {
     },
     // 分发消息创建
     add() {
-      this.show = true;
-    },
-    async onSubmit() {
-      let data = this.form;
-      let res = await this.create(data);
-      if (this.$checkRes(res)) {
-        this.$toast({ type: `success`, message: `操作成功` });
-        this.show = false;
-      } else {
-        this.$toast({ type: `success`, message: `${res.errmsg}` });
-      }
-    },
-    async searchPatent() {
-      let data = this.form;
-      if (data.create_number) {
-        let res = await this.patentapplyQuery({ create_number: data.create_number });
-        if (this.$checkRes(res)) {
-          for (const val of res.data) {
-            let data = {
-              create_number: val.create_number,
-              patent_id: val.id,
-              patent_name: val.name,
-              to_id: val.user_id,
-              to_name: val.apply_name,
-            };
-            this.$set(this, `form`, data);
-          }
-        }
-      } else {
-        this.$toast({ type: `fail`, message: `缺少关键信息` });
-      }
+      this.$router.push({ path: '/service/patent/admin/examine/hairmess_create' });
     },
     // 返回
     back() {
       this.$router.push({ path: '/service/patent/index' });
     },
-    async toUpload({ file }, model) {
-      // 上传,赋值
-      const res = await this.upload({ file, dir: 'file' });
-      if (this.$checkRes(res)) {
-        this.$set(this.form, model, [{ name: res.name, url: res.uri }]);
-      }
-    },
-    toDelete(file, model) {
-      const index = this.form[model].findIndex((f) => _.isEqual(f, file));
-      this.form[model].splice(index, 1);
-    },
   },
   computed: {
     ...mapState(['user']),

+ 126 - 0
src/views/service/patent/admin/examine/hairmess_create.vue

@@ -0,0 +1,126 @@
+<template>
+  <div id="hairmess">
+    <admin-frame topType="2" @back="back" :rightArrow="false" :usePage="false" :useNav="false">
+      <template v-slot:info>
+        <van-form>
+          <van-field name="file_url" label="文件">
+            <template #input>
+              <van-uploader
+                :fileList="form.file_url"
+                :max-count="1"
+                :after-read="(file) => toUpload(file, 'file_url')"
+                @delete="(file) => toDelete(file, 'file_url')"
+                accept="file"
+              />
+            </template>
+          </van-field>
+          <van-field v-model="form.create_number" center clearable label="专利申请号" placeholder="请输入专利申请号">
+            <template #button>
+              <van-button size="small" type="primary" @click="searchPatent">查询</van-button>
+            </template>
+          </van-field>
+          <van-field v-model="form.patent_name" name="专利名称" label="专利名称" readonly />
+          <van-field v-model="form.to_name" name="接收人" label="接收人" readonly />
+          <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: patentwarning } = createNamespacedHelpers('patentwarning');
+const { mapActions: patentapply } = createNamespacedHelpers('patentapply');
+const { mapActions: upload } = createNamespacedHelpers('upload');
+export default {
+  name: 'hairmess',
+  props: {},
+  components: {
+    adminFrame,
+  },
+  data: function () {
+    return {
+      form: {},
+    };
+  },
+  async created() {},
+  methods: {
+    ...upload(['upload']),
+    ...patentwarning(['query', 'create']),
+    ...patentapply({ patentapplyQuery: 'query' }),
+    // 确认发送
+    async onSubmit() {
+      let data = this.form;
+      let res = await this.create(data);
+      if (this.$checkRes(res)) {
+        this.$toast({ type: `success`, message: `操作成功` });
+        this.back();
+      } else {
+        this.$toast({ type: `success`, message: `${res.errmsg}` });
+      }
+    },
+    // 查询专利申请
+    async searchPatent(create_number) {
+      let info = { create_number: this.form.create_number ? this.form.create_number : create_number };
+      let res = await this.patentapplyQuery({ ...info });
+      if (this.$checkRes(res)) {
+        let data = { file_url: this.form.file_url };
+        if (res.total > 0) {
+          for (const val of res.data) {
+            data.create_number = val.create_number;
+            data.patent_id = val.id;
+            data.patent_name = val.name;
+            data.to_id = val.user_id;
+            data.to_name = val.apply_name;
+          }
+        }
+        this.$set(this, `form`, data);
+      }
+    },
+    async toUpload({ file }, model) {
+      // 上传,赋值
+      const res = await this.upload({ file, dir: 'file' });
+      if (this.$checkRes(res)) {
+        this.$set(this.form, model, [{ name: res.name, url: res.uri }]);
+        let create_number = file.name.substring(0, file.name.lastIndexOf('.'));
+        this.searchPatent(create_number);
+      }
+    },
+    toDelete(file, model) {
+      const index = this.form[model].findIndex((f) => _.isEqual(f, file));
+      this.form[model].splice(index, 1);
+    },
+    // 返回
+    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>