|
@@ -0,0 +1,179 @@
|
|
|
+<template>
|
|
|
+ <div id="index">
|
|
|
+ <data-table :fields="fields" :opera="opera" :data="list" :total="total" @query="search" @view="toView" @check="toCheck" @up="toUp"> </data-table>
|
|
|
+ <el-dialog :title="dtitle" width="80vw" center :visible.sync="dialog" :close-on-click-modal="dspan === 24" :destroy-on-close="true">
|
|
|
+ <el-row :gutter="20">
|
|
|
+ <el-col :span="dspan">
|
|
|
+ <info v-model="form"></info>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12" v-if="dspan === 12">
|
|
|
+ <el-input v-model="form.remark" placeholder="请输入您的意见" type="textarea" :autosize="{ minRows: 5, maxRows: 10 }"></el-input>
|
|
|
+ <div style="width: 100%; margin: 16px; text-align: center">
|
|
|
+ <el-button type="success" style="width: 25%" @click="toReport('3')">通过</el-button>
|
|
|
+ <el-button type="danger" style="width: 25%" @click="toReport('-2')">拒绝</el-button>
|
|
|
+ <el-button style="width: 25%" @click="dialog = false">返回</el-button>
|
|
|
+ </div>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-dialog>
|
|
|
+ <el-dialog title="评估报告" center :visible.sync="d2" :close-on-click-modal="true" :destroy-on-close="true">
|
|
|
+ <el-input v-model="report.content" placeholder="请输入评估报告内容" type="textarea" :autosize="{ minRows: 5, maxRows: 10 }"></el-input>
|
|
|
+ <div style="width: 100%; margin: 16px; text-align: center">
|
|
|
+ <el-button type="success" style="width: 80%" @click="makeReport()">评估</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+const _ = require('lodash');
|
|
|
+import info from './detail.vue';
|
|
|
+import { mapState, createNamespacedHelpers } from 'vuex';
|
|
|
+const { mapActions: disclosure } = createNamespacedHelpers('disclosure');
|
|
|
+const { mapActions: report } = createNamespacedHelpers('report');
|
|
|
+export default {
|
|
|
+ name: 'index',
|
|
|
+ props: {},
|
|
|
+ components: { info },
|
|
|
+ data: function () {
|
|
|
+ return {
|
|
|
+ list: [{ status: '2' }],
|
|
|
+ total: 0,
|
|
|
+ dialog: false,
|
|
|
+ d2: false,
|
|
|
+ dtitle: '查看',
|
|
|
+ dspan: 24,
|
|
|
+ form: {},
|
|
|
+ report: {},
|
|
|
+ fields: [
|
|
|
+ { label: '发明名称', model: 'name', filter: true },
|
|
|
+ { label: '申请人', model: 'apply_name' },
|
|
|
+ { label: '申请类型', model: 'type' },
|
|
|
+ { label: '技术联系人', model: 'contact' },
|
|
|
+ { label: '联系人电话', model: 'phone' },
|
|
|
+ { label: '联系人邮箱', model: 'email' },
|
|
|
+ { label: '申请进度', model: 'status', format: (i) => this.statusWord(i) },
|
|
|
+ ],
|
|
|
+ opera: [
|
|
|
+ { label: '查看', method: 'view' },
|
|
|
+ { label: '评估', method: 'check', display: (i) => i.status === '2' },
|
|
|
+ { label: '上传', method: 'up', display: (i) => i.status === '3' },
|
|
|
+ ],
|
|
|
+ };
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ this.search();
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ ...disclosure(['query', 'check']),
|
|
|
+ ...report(['create']),
|
|
|
+ async search({ skip = 0, limit = 10, ...info } = {}) {
|
|
|
+ const res = await this.query({ skip, limit, ...info, admin_id: this.user._id });
|
|
|
+ if (this.$checkRes(res)) {
|
|
|
+ this.$set(this, `list`, res.data);
|
|
|
+ this.$set(this, `total`, res.total);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //查看
|
|
|
+ async toView({ data }) {
|
|
|
+ this.$set(this, `form`, data);
|
|
|
+ this.dtitle = '查看';
|
|
|
+ this.dspan = 24;
|
|
|
+ this.dialog = true;
|
|
|
+ },
|
|
|
+ //去评估
|
|
|
+ async toCheck({ data }) {
|
|
|
+ this.$set(this, `form`, data);
|
|
|
+ this.dtitle = '评估';
|
|
|
+ this.dspan = 12;
|
|
|
+ this.dialog = true;
|
|
|
+ },
|
|
|
+ //去上传
|
|
|
+ async toUp({ data }) {
|
|
|
+ this.$confirm(`${data.name} 已经上传到国家专利库中?`, '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning',
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ this.$set(this, `form`, data);
|
|
|
+ this.toStatus('4');
|
|
|
+ })
|
|
|
+ .catch(() => {});
|
|
|
+ },
|
|
|
+ // 评估
|
|
|
+ async toReport(status) {
|
|
|
+ const { _id: disclosure_id } = _.cloneDeep(this.form);
|
|
|
+ this.report.disclosure_id = disclosure_id;
|
|
|
+ await this.toStatus(status);
|
|
|
+ this.$confirm(`是否生成评估报告`, '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning',
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ this.d2 = true;
|
|
|
+ })
|
|
|
+ .catch(() => {});
|
|
|
+ },
|
|
|
+ // 申请状态修改
|
|
|
+ async toStatus(status) {
|
|
|
+ const { id, remark } = this.form;
|
|
|
+ const obj = { id, status, remark };
|
|
|
+ const res = await this.check(obj);
|
|
|
+ if (this.$checkRes(res, '操作成功', res.errmsg || '操作失败')) {
|
|
|
+ this.dialog = false;
|
|
|
+ this.search();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ async makeReport() {
|
|
|
+ const res = await this.create(this.report);
|
|
|
+ if (this.$checkRes(res, '评估报告已生成', res.errmsg || '评估报告生成失败')) {
|
|
|
+ this.d2 = false;
|
|
|
+ this.report = {};
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 状态词
|
|
|
+ statusWord(status) {
|
|
|
+ let word = '';
|
|
|
+ switch (status) {
|
|
|
+ case '0':
|
|
|
+ word = '已申请';
|
|
|
+ break;
|
|
|
+ case '1':
|
|
|
+ word = '机构审核';
|
|
|
+ break;
|
|
|
+ case '-1':
|
|
|
+ word = '机构审核未通过';
|
|
|
+ break;
|
|
|
+ case '2':
|
|
|
+ word = '管理员评估';
|
|
|
+ break;
|
|
|
+ case '-2':
|
|
|
+ word = '管理员评估未通过';
|
|
|
+ break;
|
|
|
+ case '3':
|
|
|
+ word = '管理员评估通过,等待上传至国家库';
|
|
|
+ break;
|
|
|
+ case '4':
|
|
|
+ word = '上传完成';
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ return word;
|
|
|
+ },
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ ...mapState(['user']),
|
|
|
+ pageTitle() {
|
|
|
+ return `${this.$route.meta.title}`;
|
|
|
+ },
|
|
|
+ },
|
|
|
+ metaInfo() {
|
|
|
+ return { title: this.$route.meta.title };
|
|
|
+ },
|
|
|
+};
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="less" scoped></style>
|