|
@@ -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>
|