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

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

@@ -2,12 +2,31 @@
   <div id="assessment">
     <admin-frame @search="search" :limit="limit" :total="total" topType="2" @back="back" :rightArrow="false" :useNav="false">
       <template v-slot:info>
-        <list-1 :list="list" @examine="toExamine" @view="toView"></list-1>
+        <list-1 :list="list" @examine="toExamine" @view="toView" @toFile="toFile"></list-1>
       </template>
     </admin-frame>
     <van-dialog class="dialog" v-model="show" title="详细信息" :show-confirm-button="false" show-cancel-button>
       <info-1 :info="info"></info-1>
     </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="report" label="文件">
+          <template #input>
+            <van-uploader
+              :fileList="fileForm.report"
+              :max-count="1"
+              :after-read="(file) => toUpload(file, 'report')"
+              @delete="(file) => toDelete(file, 'report')"
+              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>
 </template>
 
@@ -18,6 +37,7 @@ import adminFrame from '@frame/src/components/mobile-frame/mobile-main.vue';
 import { mapState, createNamespacedHelpers } from 'vuex';
 const { mapActions: patentassess } = createNamespacedHelpers('patentassess');
 const { mapActions: patentinfo } = createNamespacedHelpers('patentinfo');
+const { mapActions: upload } = createNamespacedHelpers('upload');
 export default {
   name: 'assessment',
   props: {},
@@ -34,13 +54,17 @@ export default {
       // 专利详情
       show: false,
       info: {},
+      // 报告文件
+      thrShow: false,
+      fileForm: {},
     };
   },
   async created() {
     await this.search();
   },
   methods: {
-    ...patentassess(['query']),
+    ...upload(['upload']),
+    ...patentassess(['query', 'update']),
     ...patentinfo(['fetch']),
     async search({ skip = 0, limit = this.limit, ...info } = {}) {
       let res = await this.query({ skip, limit, ...info });
@@ -61,6 +85,38 @@ export default {
         this.show = true;
       }
     },
+    // 发送文件
+    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: 'assess' });
+      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() {
       this.$router.push({ path: '/service/patent/index' });
@@ -89,4 +145,12 @@ export default {
     overflow-y: auto;
   }
 }
+.thrDialog {
+  .btn {
+    text-align: center;
+    .van-button {
+      margin: 8px;
+    }
+  }
+}
 </style>

+ 5 - 0
src/views/service/patent/admin/patent/assessment/list-1.vue

@@ -21,6 +21,7 @@
             <van-button size="small" type="info" @click="view(item.patent_id)">查看信息</van-button>
             <!-- <van-button size="small" type="info">分配专家</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>
@@ -57,6 +58,10 @@ export default {
       if (status == '0') return '待审核';
       if (status == '1') return '审核通过';
       if (status == '-1') return '审核拒绝';
+      if (status == '2') return '报告文件已发送';
+    },
+    toFile(data) {
+      this.$emit('toFile', data);
     },
   },
   computed: {

+ 1 - 1
src/views/service/patent/user/apply/assessment/parts/list-3.vue

@@ -17,7 +17,7 @@
           <van-col span="24" class="btn">
             <van-button size="small" type="info" @click="view(item.patent_id)">查看信息</van-button>
             <van-button size="small" type="info" @click="result(item)">查看审核结果</van-button>
-            <van-button size="small" type="info" @click="download(item.report)" v-if="item.status == '1'">下载报告</van-button>
+            <van-button size="small" type="info" @click="download(item.report)" v-if="item.status == '2'">下载报告</van-button>
           </van-col>
         </van-col>
       </van-col>