|
@@ -14,7 +14,17 @@
|
|
</data-table>
|
|
</data-table>
|
|
</el-tab-pane>
|
|
</el-tab-pane>
|
|
<el-tab-pane label="证书发放" name="second">
|
|
<el-tab-pane label="证书发放" name="second">
|
|
- <data-table :fields="fields" :opera="opera" :data="certList" :total="certTotal" @query="search" @file="toFile" @load="toLoad" @cert="toCert">
|
|
|
|
|
|
+ <data-table
|
|
|
|
+ :fields="fields"
|
|
|
|
+ :opera="opera"
|
|
|
|
+ :data="certList"
|
|
|
|
+ :total="certTotal"
|
|
|
|
+ @query="search"
|
|
|
|
+ @file="toFile"
|
|
|
|
+ @load="toLoad"
|
|
|
|
+ @cert="toCert"
|
|
|
|
+ @upfile="toUpfile"
|
|
|
|
+ >
|
|
<template #custom="{item,row}">
|
|
<template #custom="{item,row}">
|
|
<template v-if="item.prop === 'basic.achieve_num'">
|
|
<template v-if="item.prop === 'basic.achieve_num'">
|
|
<el-link size="mini" type="primary" @click="toApply(row)">{{ getProps(row, item.prop) }}</el-link>
|
|
<el-link size="mini" type="primary" @click="toApply(row)">{{ getProps(row, item.prop) }}</el-link>
|
|
@@ -60,16 +70,23 @@
|
|
<el-dialog title="成果详情" center width="80%" :close-on-click-modal="false" :visible.sync="applyDialog" destroy-on-close @closed="applyClose">
|
|
<el-dialog title="成果详情" center width="80%" :close-on-click-modal="false" :visible.sync="applyDialog" destroy-on-close @closed="applyClose">
|
|
<detail :form="apply"></detail>
|
|
<detail :form="apply"></detail>
|
|
</el-dialog>
|
|
</el-dialog>
|
|
|
|
+ <el-dialog title="证书资料" center width="30%" :close-on-click-modal="false" :visible.sync="certShow" destroy-on-close @closed="certClose">
|
|
|
|
+ <certform-1 :form="certForm" @onSubmit="certSubmit"></certform-1>
|
|
|
|
+ </el-dialog>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
const _ = require('lodash');
|
|
const _ = require('lodash');
|
|
import detail from '../parts/detail.vue';
|
|
import detail from '../parts/detail.vue';
|
|
|
|
+import certform1 from '../parts/certform-1.vue';
|
|
import dataTable from '@common/src/components/frame/filter-page-table.vue';
|
|
import dataTable from '@common/src/components/frame/filter-page-table.vue';
|
|
import { mapState, createNamespacedHelpers } from 'vuex';
|
|
import { mapState, createNamespacedHelpers } from 'vuex';
|
|
const { mapActions: achieveApply } = createNamespacedHelpers('achieveApply');
|
|
const { mapActions: achieveApply } = createNamespacedHelpers('achieveApply');
|
|
const { mapActions: verifyRecord } = createNamespacedHelpers('verifyRecord');
|
|
const { mapActions: verifyRecord } = createNamespacedHelpers('verifyRecord');
|
|
|
|
+const { mapActions: personal } = createNamespacedHelpers('personal');
|
|
|
|
+const { mapActions: achieve_cert } = createNamespacedHelpers('achieve_cert');
|
|
|
|
+
|
|
export default {
|
|
export default {
|
|
metaInfo() {
|
|
metaInfo() {
|
|
return { title: this.$route.meta.title };
|
|
return { title: this.$route.meta.title };
|
|
@@ -79,6 +96,7 @@ export default {
|
|
components: {
|
|
components: {
|
|
dataTable,
|
|
dataTable,
|
|
detail,
|
|
detail,
|
|
|
|
+ certform1,
|
|
},
|
|
},
|
|
data: function() {
|
|
data: function() {
|
|
return {
|
|
return {
|
|
@@ -98,6 +116,11 @@ export default {
|
|
method: 'cert',
|
|
method: 'cert',
|
|
display: i => i.status === '6',
|
|
display: i => i.status === '6',
|
|
},
|
|
},
|
|
|
|
+ {
|
|
|
|
+ label: '上传证书资料',
|
|
|
|
+ method: 'upfile',
|
|
|
|
+ display: i => i.status === '6',
|
|
|
|
+ },
|
|
],
|
|
],
|
|
fields: [
|
|
fields: [
|
|
{ label: '成果编号', prop: 'basic.achieve_num', filter: 'input', showTip: true, custom: true },
|
|
{ label: '成果编号', prop: 'basic.achieve_num', filter: 'input', showTip: true, custom: true },
|
|
@@ -116,6 +139,9 @@ export default {
|
|
// 证书发放
|
|
// 证书发放
|
|
certList: [],
|
|
certList: [],
|
|
certTotal: 0,
|
|
certTotal: 0,
|
|
|
|
+ // 证书资料
|
|
|
|
+ certShow: false,
|
|
|
|
+ certForm: {},
|
|
};
|
|
};
|
|
},
|
|
},
|
|
async created() {
|
|
async created() {
|
|
@@ -124,6 +150,8 @@ export default {
|
|
methods: {
|
|
methods: {
|
|
...achieveApply(['query']),
|
|
...achieveApply(['query']),
|
|
...verifyRecord({ create: 'create', getRecord: 'query' }),
|
|
...verifyRecord({ create: 'create', getRecord: 'query' }),
|
|
|
|
+ ...personal({ personalFetch: 'fetch' }),
|
|
|
|
+ ...achieve_cert({ certQuery: 'query', certCreate: 'create', certUpdate: 'update' }),
|
|
// 查询列表
|
|
// 查询列表
|
|
async search({ skip = 0, limit = 10, ...info } = {}) {
|
|
async search({ skip = 0, limit = 10, ...info } = {}) {
|
|
let res = await this.query({ skip, limit, ...info, status: '5' });
|
|
let res = await this.query({ skip, limit, ...info, status: '5' });
|
|
@@ -200,6 +228,41 @@ export default {
|
|
this.applyDialog = false;
|
|
this.applyDialog = false;
|
|
this.apply = {};
|
|
this.apply = {};
|
|
},
|
|
},
|
|
|
|
+ // 上传证书资料
|
|
|
|
+ async toUpfile({ data }) {
|
|
|
|
+ let arr = {};
|
|
|
|
+ let res = await this.certQuery({ apply_id: data._id, user_id: data.user_id });
|
|
|
|
+ if (this.$checkRes(res)) {
|
|
|
|
+ if (res.total > 0) {
|
|
|
|
+ arr = res.data[0];
|
|
|
|
+ } else {
|
|
|
|
+ let wer = await this.personalFetch(data.user_id);
|
|
|
|
+ if (this.$checkRes(wer)) {
|
|
|
|
+ arr = {
|
|
|
|
+ user_id: wer.data._id,
|
|
|
|
+ user_name: wer.data.name,
|
|
|
|
+ apply_id: data._id,
|
|
|
|
+ apply_name: data.basic.achieve_name,
|
|
|
|
+ };
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ this.$set(this, `certForm`, arr);
|
|
|
|
+ this.certShow = true;
|
|
|
|
+ },
|
|
|
|
+ // 提交上传证书资料
|
|
|
|
+ async certSubmit({ data }) {
|
|
|
|
+ let res;
|
|
|
|
+ if (data.id) await this.certUpdate(data);
|
|
|
|
+ else await this.certCreate(data);
|
|
|
|
+ if (this.$checkRes(res, '保存成功', '保存失败')) this.certClose();
|
|
|
|
+ },
|
|
|
|
+ // 关闭
|
|
|
|
+ certClose() {
|
|
|
|
+ this.certForm = {};
|
|
|
|
+ this.certShow = false;
|
|
|
|
+ this.search();
|
|
|
|
+ },
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
...mapState(['user']),
|
|
...mapState(['user']),
|