guhongwei 3 éve
szülő
commit
e7b65fbf53

+ 66 - 2
src/views/service/patent/admin/examine/analysis.vue

@@ -2,7 +2,7 @@
   <div id="analysis">
   <div id="analysis">
     <admin-frame @search="search" :limit="limit" :total="total" topType="2" @back="back" :rightArrow="false" :useNav="false">
     <admin-frame @search="search" :limit="limit" :total="total" topType="2" @back="back" :rightArrow="false" :useNav="false">
       <template v-slot:info>
       <template v-slot:info>
-        <list-1 :list="list" @view="view" @examine="toExamine"></list-1>
+        <list-1 :list="list" @view="view" @examine="toExamine" @toFile="toFile"></list-1>
       </template>
       </template>
     </admin-frame>
     </admin-frame>
     <van-dialog class="dialog" v-model="show" title="详细信息" :show-confirm-button="false" show-cancel-button>
     <van-dialog class="dialog" v-model="show" title="详细信息" :show-confirm-button="false" show-cancel-button>
@@ -11,6 +11,25 @@
     <van-dialog class="twoDialog" v-model="twoShow" title="审核信息" :show-confirm-button="false" :show-cancel-button="false" :closeOnClickOverlay="true">
     <van-dialog class="twoDialog" v-model="twoShow" title="审核信息" :show-confirm-button="false" :show-cancel-button="false" :closeOnClickOverlay="true">
       <check-form :form="form" @onSubmit="onSubmit"></check-form>
       <check-form :form="form" @onSubmit="onSubmit"></check-form>
     </van-dialog>
     </van-dialog>
+    <van-dialog class="thrDialog" v-model="thrShow" title="报告文件" :show-confirm-button="false" :show-cancel-button="false" :closeOnClickOverlay="true">
+      <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="thrClose">取消发送</van-button>
+          <van-button type="info" size="small" @click="thrSend">提交发送</van-button>
+        </div>
+      </van-form>
+    </van-dialog>
   </div>
   </div>
 </template>
 </template>
 
 
@@ -21,6 +40,7 @@ import checkForm from './analysis/checkForm.vue';
 import adminFrame from '@frame/src/components/mobile-frame/mobile-main.vue';
 import adminFrame from '@frame/src/components/mobile-frame/mobile-main.vue';
 import { mapState, createNamespacedHelpers } from 'vuex';
 import { mapState, createNamespacedHelpers } from 'vuex';
 const { mapActions: patentanalysis } = createNamespacedHelpers('patentanalysis');
 const { mapActions: patentanalysis } = createNamespacedHelpers('patentanalysis');
+const { mapActions: upload } = createNamespacedHelpers('upload');
 export default {
 export default {
   name: 'analysis',
   name: 'analysis',
   props: {},
   props: {},
@@ -41,13 +61,17 @@ export default {
       // 专利申请审核信息
       // 专利申请审核信息
       twoShow: false,
       twoShow: false,
       form: {},
       form: {},
+      // 报告文件
+      thrShow: false,
+      fileForm: {},
     };
     };
   },
   },
   async created() {
   async created() {
     await this.search();
     await this.search();
   },
   },
   methods: {
   methods: {
-    ...patentanalysis(['query', 'check']),
+    ...upload(['upload']),
+    ...patentanalysis(['query', 'check', 'update']),
     async search({ skip = 0, limit = this.limit, ...info } = {}) {
     async search({ skip = 0, limit = this.limit, ...info } = {}) {
       info.admin_id = this.user._id;
       info.admin_id = this.user._id;
       let res = await this.query({ skip, limit, ...info });
       let res = await this.query({ skip, limit, ...info });
@@ -80,6 +104,38 @@ export default {
         this.$toast({ type: `fail`, message: `${res.errmsg}` });
         this.$toast({ type: `fail`, message: `${res.errmsg}` });
       }
       }
     },
     },
+    // 发送文件
+    toFile(data) {
+      this.$set(this, `fileForm`, data);
+      this.thrShow = true;
+    },
+    // 提交发送
+    async thrSend() {
+      let data = this.fileForm;
+      data.status = '2';
+      let res = await this.update(data);
+      if (this.$checkRes(res)) {
+        this.$toast({ type: `success`, message: `发送文件成功` });
+        this.thrClose();
+      } else {
+        this.$toast({ type: `fail`, message: `${res.errmsg}` });
+      }
+    },
+    // 取消发送
+    thrClose() {
+      this.thrShow = false;
+    },
+    async toUpload({ file }, model) {
+      // 上传,赋值
+      const res = await this.upload({ file, dir: 'analysis' });
+      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);
+    },
     // 返回
     // 返回
     back() {
     back() {
       this.$router.push({ path: '/service/patent/index' });
       this.$router.push({ path: '/service/patent/index' });
@@ -108,4 +164,12 @@ export default {
     overflow-y: auto;
     overflow-y: auto;
   }
   }
 }
 }
+.thrDialog {
+  .btn {
+    text-align: center;
+    .van-button {
+      margin: 8px;
+    }
+  }
+}
 </style>
 </style>

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

@@ -20,6 +20,7 @@
           <van-col span="24" class="btn">
           <van-col span="24" class="btn">
             <van-button size="small" type="info" @click="view(item)">查看信息</van-button>
             <van-button size="small" type="info" @click="view(item)">查看信息</van-button>
             <van-button size="small" type="info" @click="examine(item)" v-if="item.status == '0'">审核申请</van-button>
             <van-button size="small" type="info" @click="examine(item)" v-if="item.status == '0'">审核申请</van-button>
+            <van-button size="small" type="info" @click="toFile(item)" v-if="item.status == '1' || item.status == '2'">报告文件</van-button>
           </van-col>
           </van-col>
         </van-col>
         </van-col>
       </van-col>
       </van-col>
@@ -46,11 +47,15 @@ export default {
     examine(data) {
     examine(data) {
       this.$emit('examine', data);
       this.$emit('examine', data);
     },
     },
+    toFile(data) {
+      this.$emit('toFile', data);
+    },
     // 整理状态
     // 整理状态
     getStu(status) {
     getStu(status) {
       if (status == '0') return '已提交给相应机构,请等待审核';
       if (status == '0') return '已提交给相应机构,请等待审核';
-      else if (status == '1') return '管理员审核通过!';
+      else if (status == '1') return '管理员审核通过,请及时发送相应文件!';
       else if (status == '-1') return '管理员审核未通过,请查看审核意见,并重新提交申请';
       else if (status == '-1') return '管理员审核未通过,请查看审核意见,并重新提交申请';
+      else if (status == '2') return '文件已发送';
     },
     },
   },
   },
   computed: {
   computed: {

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

@@ -179,7 +179,6 @@ export default {
     // 确认选择
     // 确认选择
     conFirm(data) {
     conFirm(data) {
       let user = { user_id: data.id, name: data.name };
       let user = { user_id: data.id, name: data.name };
-      console.log(this.type);
       if (this.type == 'inventor') this.form.inventor.push(user);
       if (this.type == 'inventor') this.form.inventor.push(user);
       this.show = false;
       this.show = false;
     },
     },

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

@@ -19,6 +19,7 @@
           </van-col>
           </van-col>
           <van-col span="24" class="btn">
           <van-col span="24" class="btn">
             <van-button size="small" type="info" @click="result(item)">查看审核结果</van-button>
             <van-button size="small" type="info" @click="result(item)">查看审核结果</van-button>
+            <van-button size="small" type="info" @click="downFile(item.file)" v-if="item.status == '2'">报告文件</van-button>
           </van-col>
           </van-col>
         </van-col>
         </van-col>
       </van-col>
       </van-col>
@@ -42,12 +43,21 @@ export default {
     // 整理状态
     // 整理状态
     getStu(status) {
     getStu(status) {
       if (status == '0') return '已提交给管理员,请等待审核';
       if (status == '0') return '已提交给管理员,请等待审核';
-      else if (status == '1') return '管理员审核通过!';
+      else if (status == '1') return '管理员审核通过,等待系统管理员发送报告文件!';
       else if (status == '-1') return '管理员审核未通过,请查看审核意见,并重新提交申请';
       else if (status == '-1') return '管理员审核未通过,请查看审核意见,并重新提交申请';
+      else if (status == '2') return '文件已发送,请及时下载查看!';
     },
     },
     result(data) {
     result(data) {
       this.$emit('result', data);
       this.$emit('result', data);
     },
     },
+    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: `非正常文件,无法下载` });
+      }
+    },
   },
   },
   computed: {
   computed: {
     ...mapState(['user']),
     ...mapState(['user']),

+ 3 - 3
src/views/service/patent/user/patent/information/index.vue

@@ -80,11 +80,11 @@ export default {
     },
     },
     // 查询总数
     // 查询总数
     async searchTotal({ skip = 0, limit = this.limit, ...info } = {}) {
     async searchTotal({ skip = 0, limit = this.limit, ...info } = {}) {
-      let res = await this.query({ skip, limit, term: '有效', user_id: this.user.id, ...info });
+      let res = await this.query({ skip, limit, term: '有效', user_id: this.user._id, ...info });
       if (this.$checkRes(res)) this.$set(this, `oneTotal`, res.total);
       if (this.$checkRes(res)) this.$set(this, `oneTotal`, res.total);
-      res = await this.query({ skip, limit, term: '审中', user_id: this.user.id, ...info });
+      res = await this.query({ skip, limit, term: '审中', user_id: this.user._id, ...info });
       if (this.$checkRes(res)) this.$set(this, `twoTotal`, res.total);
       if (this.$checkRes(res)) this.$set(this, `twoTotal`, res.total);
-      res = await this.query({ skip, limit, term: '失效', user_id: this.user.id, ...info });
+      res = await this.query({ skip, limit, term: '失效', user_id: this.user._id, ...info });
       if (this.$checkRes(res)) this.$set(this, `thrTotal`, res.total);
       if (this.$checkRes(res)) this.$set(this, `thrTotal`, res.total);
     },
     },
     // 详情
     // 详情