|
@@ -1,8 +1,24 @@
|
|
<template>
|
|
<template>
|
|
<div id="index">
|
|
<div id="index">
|
|
- <admin-frame @search="search" :limit="limit" :total="total" topType="2" @back="back" @add="add" :useNav="false">
|
|
|
|
|
|
+ <admin-frame
|
|
|
|
+ @search="search"
|
|
|
|
+ :limit="limit"
|
|
|
|
+ :total="total"
|
|
|
|
+ topType="2"
|
|
|
|
+ :usePage="active == '0' ? false : true"
|
|
|
|
+ @back="back"
|
|
|
|
+ :rightArrow="false"
|
|
|
|
+ :useNav="false"
|
|
|
|
+ >
|
|
<template v-slot:info>
|
|
<template v-slot:info>
|
|
- <list-1 :list="list" @toView="toView" @toResult="toResult" @toAgain="toAgain" @toAgent="toAgent" @toGzj="toGzj"></list-1>
|
|
|
|
|
|
+ <van-tabs v-model="active">
|
|
|
|
+ <van-tab title="审批单">
|
|
|
|
+ <form-1 :form="form" @onSubmit="onSubmit"></form-1>
|
|
|
|
+ </van-tab>
|
|
|
|
+ <van-tab title="已申请">
|
|
|
|
+ <list-1 :list="list" @toView="toView" @toResult="toResult" @toGzj="toGzj" @toAgain="toAgain" @toAgent="toAgent"></list-1>
|
|
|
|
+ </van-tab>
|
|
|
|
+ </van-tabs>
|
|
</template>
|
|
</template>
|
|
</admin-frame>
|
|
</admin-frame>
|
|
<van-dialog class="dialog" v-model="dialog.show" :title="dialog.title" :show-confirm-button="false" show-cancel-button>
|
|
<van-dialog class="dialog" v-model="dialog.show" :title="dialog.title" :show-confirm-button="false" show-cancel-button>
|
|
@@ -14,6 +30,7 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
|
+import form1 from '@/layout/apply/form-1.vue';
|
|
import list1 from '@/layout/apply/list-1.vue';
|
|
import list1 from '@/layout/apply/list-1.vue';
|
|
import info1 from '@/layout/apply/info-1.vue';
|
|
import info1 from '@/layout/apply/info-1.vue';
|
|
import result1 from '@/layout/apply/result-1.vue';
|
|
import result1 from '@/layout/apply/result-1.vue';
|
|
@@ -26,6 +43,7 @@ export default {
|
|
props: {},
|
|
props: {},
|
|
components: {
|
|
components: {
|
|
adminFrame,
|
|
adminFrame,
|
|
|
|
+ form1,
|
|
list1,
|
|
list1,
|
|
info1,
|
|
info1,
|
|
result1,
|
|
result1,
|
|
@@ -33,22 +51,27 @@ export default {
|
|
},
|
|
},
|
|
data: function () {
|
|
data: function () {
|
|
return {
|
|
return {
|
|
|
|
+ active: 0,
|
|
|
|
+ // 列表
|
|
list: [],
|
|
list: [],
|
|
- limit: 5,
|
|
|
|
|
|
+ limit: 4,
|
|
total: 0,
|
|
total: 0,
|
|
|
|
+ // 专利申请
|
|
|
|
+ form: {
|
|
|
|
+ questions: {},
|
|
|
|
+ },
|
|
// 弹框
|
|
// 弹框
|
|
dialog: { show: false, title: '详细信息', type: '1' },
|
|
dialog: { show: false, title: '详细信息', type: '1' },
|
|
// 详细信息
|
|
// 详细信息
|
|
info: {},
|
|
info: {},
|
|
- // 申请文件
|
|
|
|
- form: {},
|
|
|
|
};
|
|
};
|
|
},
|
|
},
|
|
async created() {
|
|
async created() {
|
|
|
|
+ await this.searchOther();
|
|
await this.search();
|
|
await this.search();
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
- ...patentapply(['query', 'update']),
|
|
|
|
|
|
+ ...patentapply(['query', 'fetch', 'create', 'update']),
|
|
async search({ skip = 0, limit = this.limit, ...info } = {}) {
|
|
async search({ skip = 0, limit = this.limit, ...info } = {}) {
|
|
let res = await this.query({ skip, limit, user_id: this.user._id, ...info });
|
|
let res = await this.query({ skip, limit, user_id: this.user._id, ...info });
|
|
if (this.$checkRes(res)) {
|
|
if (this.$checkRes(res)) {
|
|
@@ -56,6 +79,47 @@ export default {
|
|
this.$set(this, `total`, res.total);
|
|
this.$set(this, `total`, res.total);
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ // 提交申请
|
|
|
|
+ async onSubmit({ data }) {
|
|
|
|
+ if (data.id) {
|
|
|
|
+ if (data.status == '-1') data.status = '0';
|
|
|
|
+ else if (data.status == '-2') data.status = '1';
|
|
|
|
+ let res = await this.update(data);
|
|
|
|
+ if (this.$checkRes(res)) {
|
|
|
|
+ this.$toast({ type: `success`, message: `重新申请成功` });
|
|
|
|
+ this.searchOther();
|
|
|
|
+ this.search();
|
|
|
|
+ } else {
|
|
|
|
+ this.$toast({ type: `success`, message: `${res.errmsg}` });
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ // 是否需要机构,0:不需要,1:需要
|
|
|
|
+ if (data.is_mech == '0') data.status = '1';
|
|
|
|
+ else if (data.is_mech == '1') data.status = '0';
|
|
|
|
+ let res = await this.create(data);
|
|
|
|
+ if (this.$checkRes(res)) {
|
|
|
|
+ this.$toast({ type: `success`, message: `专利申请成功` });
|
|
|
|
+ this.searchOther();
|
|
|
|
+ this.search();
|
|
|
|
+ } else {
|
|
|
|
+ this.$toast({ type: `success`, message: `${res.errmsg}` });
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ // 查询form表单信息
|
|
|
|
+ searchOther() {
|
|
|
|
+ let data = {
|
|
|
|
+ user_id: this.user._id,
|
|
|
|
+ is_mech: '0',
|
|
|
|
+ apply_name: this.user.name,
|
|
|
|
+ inventor: [{ user_id: this.user._id, name: this.user.name }],
|
|
|
|
+ contact: [{ user_id: this.user._id, name: this.user.name }],
|
|
|
|
+ phone: this.user.phone,
|
|
|
|
+ email: this.user.email,
|
|
|
|
+ questions: {},
|
|
|
|
+ };
|
|
|
|
+ this.$set(this, `form`, data);
|
|
|
|
+ },
|
|
// 查看信息
|
|
// 查看信息
|
|
toView(data) {
|
|
toView(data) {
|
|
data.inventor = JSON.stringify(data.inventor.map((i) => i.name));
|
|
data.inventor = JSON.stringify(data.inventor.map((i) => i.name));
|
|
@@ -72,7 +136,9 @@ export default {
|
|
},
|
|
},
|
|
// 重新申请
|
|
// 重新申请
|
|
toAgain(data) {
|
|
toAgain(data) {
|
|
- this.$router.push({ path: '/patent/user/apply/apply/detail', query: { id: data.id } });
|
|
|
|
|
|
+ this.$set(this, `form`, data);
|
|
|
|
+ this.active = 0;
|
|
|
|
+ // this.$router.push({ path: '/patent/user/apply/apply/detail', query: { id: data.id } });
|
|
},
|
|
},
|
|
// 申请文件
|
|
// 申请文件
|
|
toAgent(data) {
|
|
toAgent(data) {
|
|
@@ -82,6 +148,8 @@ export default {
|
|
},
|
|
},
|
|
// 提交申请文件
|
|
// 提交申请文件
|
|
async agentSubmit(data) {
|
|
async agentSubmit(data) {
|
|
|
|
+ if (data.status == '2') data.status = '3';
|
|
|
|
+ else if (data.status == '-3') data.status = '3';
|
|
let res = await this.update(data);
|
|
let res = await this.update(data);
|
|
if (this.$checkRes(res)) {
|
|
if (this.$checkRes(res)) {
|
|
this.$toast({ type: `success`, message: `操作成功` });
|
|
this.$toast({ type: `success`, message: `操作成功` });
|
|
@@ -96,10 +164,6 @@ export default {
|
|
toGzj(data) {
|
|
toGzj(data) {
|
|
this.$router.push({ path: '/patent/user/apply/apply/gzjDetail', query: { name: data.name, create_number: data.create_number } });
|
|
this.$router.push({ path: '/patent/user/apply/apply/gzjDetail', query: { name: data.name, create_number: data.create_number } });
|
|
},
|
|
},
|
|
- // 添加
|
|
|
|
- add() {
|
|
|
|
- this.$router.push({ path: '/patent/user/apply/apply/detail' });
|
|
|
|
- },
|
|
|
|
// 返回
|
|
// 返回
|
|
back() {
|
|
back() {
|
|
this.$router.push({ path: '/patent/index' });
|
|
this.$router.push({ path: '/patent/index' });
|