|
@@ -1,187 +1,211 @@
|
|
-<template>
|
|
|
|
- <div id="index">
|
|
|
|
- <el-row>
|
|
|
|
- <el-col :span="24" class="main">
|
|
|
|
- <el-col :span="24" class="down">
|
|
|
|
- <data-table :fields="fields" :opera="opera" :data="list" :total="total" @query="search" @file="toFile" @load="toLoad" @cert="toCert">
|
|
|
|
- <template #custom="{item,row}">
|
|
|
|
- <template v-if="item.prop === 'basic.achieve_num'">
|
|
|
|
- <el-link size="mini" type="primary" @click="toApply(row)">{{ getProps(row, item.prop) }}</el-link>
|
|
|
|
- </template>
|
|
|
|
- </template>
|
|
|
|
- </data-table>
|
|
|
|
- </el-col>
|
|
|
|
- </el-col>
|
|
|
|
- </el-row>
|
|
|
|
- <el-dialog title="发放证书" width="40%" :visible.sync="dialog" @closed="handleClose" :destroy-on-close="true">
|
|
|
|
- <el-form>
|
|
|
|
- <el-form-item label="成果名称">{{ getProp('basic.achieve_name') }}</el-form-item>
|
|
|
|
- <el-timeline>
|
|
|
|
- <el-timeline-item
|
|
|
|
- v-for="(i, index) in line"
|
|
|
|
- :key="`line${index}`"
|
|
|
|
- :icon="i.status <= 0 ? 'el-icon-close ' : 'el-icon-check'"
|
|
|
|
- :type="i.status <= 0 ? 'danger ' : 'success'"
|
|
|
|
- size="large"
|
|
|
|
- :timestamp="i.status <= 0 ? '' : i.create_time"
|
|
|
|
- >
|
|
|
|
- {{ i.step }}
|
|
|
|
- <el-collapse v-if="i.status <= 0">
|
|
|
|
- <el-collapse-item title="点击展开" name="1">
|
|
|
|
- <el-table :data="i.list">
|
|
|
|
- <el-table-column align="center" label="时间" prop="create_time" show-overflow-tooltip></el-table-column>
|
|
|
|
- <el-table-column align="center" label="建议" prop="desc" show-overflow-tooltip></el-table-column>
|
|
|
|
- </el-table>
|
|
|
|
- </el-collapse-item>
|
|
|
|
- </el-collapse>
|
|
|
|
- </el-timeline-item>
|
|
|
|
- </el-timeline>
|
|
|
|
- <el-form-item label="是否缴费">
|
|
|
|
- <el-checkbox v-model="cost" :label="true">已缴费</el-checkbox>
|
|
|
|
- </el-form-item>
|
|
|
|
- <el-form-item label="">
|
|
|
|
- <el-button type="primary" :disabled="!cost" @click="haveCert">发放证书</el-button>
|
|
|
|
- </el-form-item>
|
|
|
|
- </el-form>
|
|
|
|
- </el-dialog>
|
|
|
|
- <el-dialog title="成果详情" center width="80%" :close-on-click-modal="false" :visible.sync="applyDialog" destroy-on-close @closed="applyClose">
|
|
|
|
- <detail :form="apply"></detail>
|
|
|
|
- </el-dialog>
|
|
|
|
- </div>
|
|
|
|
-</template>
|
|
|
|
-
|
|
|
|
-<script>
|
|
|
|
-const _ = require('lodash');
|
|
|
|
-import detail from '../parts/detail.vue';
|
|
|
|
-import dataTable from '@common/src/components/frame/filter-page-table.vue';
|
|
|
|
-import { mapState, createNamespacedHelpers } from 'vuex';
|
|
|
|
-const { mapActions: achieveApply } = createNamespacedHelpers('achieveApply');
|
|
|
|
-const { mapActions: verifyRecord } = createNamespacedHelpers('verifyRecord');
|
|
|
|
-export default {
|
|
|
|
- metaInfo() {
|
|
|
|
- return { title: this.$route.meta.title };
|
|
|
|
- },
|
|
|
|
- name: 'index',
|
|
|
|
- props: {},
|
|
|
|
- components: {
|
|
|
|
- dataTable,
|
|
|
|
- detail,
|
|
|
|
- },
|
|
|
|
- data: function() {
|
|
|
|
- return {
|
|
|
|
- opera: [
|
|
|
|
- {
|
|
|
|
- label: '资料归档',
|
|
|
|
- method: 'file',
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- label: '资料预览',
|
|
|
|
- method: 'load',
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- label: '发放证书',
|
|
|
|
- method: 'cert',
|
|
|
|
- },
|
|
|
|
- ],
|
|
|
|
- fields: [
|
|
|
|
- { label: '成果编号', prop: 'basic.achieve_num', filter: 'input', showTip: true, custom: true },
|
|
|
|
- { label: '成果名称', prop: 'basic.achieve_name', showTip: true },
|
|
|
|
- { label: '成果类别', prop: 'basic.achieve_type', showTip: true },
|
|
|
|
- ],
|
|
|
|
- list: [],
|
|
|
|
- total: 0,
|
|
|
|
- dialog: false,
|
|
|
|
- info: {},
|
|
|
|
- test: true,
|
|
|
|
- cost: false,
|
|
|
|
- line: [],
|
|
|
|
- applyDialog: false,
|
|
|
|
- apply: {},
|
|
|
|
- };
|
|
|
|
- },
|
|
|
|
- async created() {
|
|
|
|
- await this.search();
|
|
|
|
- },
|
|
|
|
- methods: {
|
|
|
|
- ...achieveApply(['query']),
|
|
|
|
- ...verifyRecord({ create: 'create', getRecord: 'query' }),
|
|
|
|
- // 查询列表
|
|
|
|
- async search({ skip = 0, limit = 10, ...info } = {}) {
|
|
|
|
- const res = await this.query({ skip, limit, ...info, status: '5' });
|
|
|
|
- if (this.$checkRes(res)) {
|
|
|
|
- this.$set(this, 'list', res.data);
|
|
|
|
- this.$set(this, `total`, res.total);
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- async toCert({ data }) {
|
|
|
|
- this.$set(this, `info`, data);
|
|
|
|
- const records = await this.getRecord({ apply_id: data._id });
|
|
|
|
- const order = [-1, 1, -2, 2, -3, 3, 4, -5, 5, 6]; //时间轴的顺序,如果有修改,请注意这里的逗号,少写了只会让顺序出错,不会报错,被识别成减法了(实际体验的结果)
|
|
|
|
- if (this.$checkRes(records)) {
|
|
|
|
- let data = _.get(records, 'data', []);
|
|
|
|
- data = _.groupBy(data, 'status');
|
|
|
|
- const arr = [];
|
|
|
|
- for (const n of order) {
|
|
|
|
- const obj = _.get(data, n);
|
|
|
|
- if (obj) {
|
|
|
|
- const head = _.head(obj);
|
|
|
|
- if (!head) continue;
|
|
|
|
- const aobj = { step: _.get(head, 'step'), create_time: _.get(head, 'create_time'), list: obj, status: _.get(head, 'status') };
|
|
|
|
- arr.push(aobj);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- this.$set(this, `line`, arr);
|
|
|
|
- }
|
|
|
|
- this.dialog = true;
|
|
|
|
- },
|
|
|
|
- getProp(prop) {
|
|
|
|
- return _.get(this.info, prop, '');
|
|
|
|
- },
|
|
|
|
- async haveCert() {
|
|
|
|
- const data = _.cloneDeep(this.info);
|
|
|
|
- // 发证书
|
|
|
|
- let dup = { status: '6' };
|
|
|
|
- dup.apply_id = _.get(data, '_id');
|
|
|
|
- dup.verify = _.get(this.user, 'name');
|
|
|
|
- dup.verify_phone = _.get(this.user, 'phone');
|
|
|
|
- dup.verify_id = _.get(this.user, '_id');
|
|
|
|
- dup.step = '发证书';
|
|
|
|
- const res = await this.create(dup);
|
|
|
|
- if (this.$checkRes(res, '已确定发放证书', res.errmsg || '确定发放失败')) {
|
|
|
|
- this.handleClose();
|
|
|
|
- this.search();
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- handleClose() {
|
|
|
|
- this.info = {};
|
|
|
|
- this.line = [];
|
|
|
|
- this.dialog = false;
|
|
|
|
- },
|
|
|
|
- // 资料归档
|
|
|
|
- toFile({ data }) {
|
|
|
|
- this.$router.push({ path: '/adminCate/detail', query: { id: data.id } });
|
|
|
|
- },
|
|
|
|
- // 资料预览
|
|
|
|
- toLoad({ data }) {
|
|
|
|
- this.$router.push({ path: '/adminCate/dataInfo', query: { id: data.id, type: '5' } });
|
|
|
|
- },
|
|
|
|
- async toApply(data) {
|
|
|
|
- this.$set(this, 'apply', data);
|
|
|
|
- this.applyDialog = true;
|
|
|
|
- },
|
|
|
|
- getProps(data, prop) {
|
|
|
|
- return _.get(data, prop);
|
|
|
|
- },
|
|
|
|
- applyClose() {
|
|
|
|
- this.applyDialog = false;
|
|
|
|
- this.apply = {};
|
|
|
|
- },
|
|
|
|
- },
|
|
|
|
- computed: {
|
|
|
|
- ...mapState(['user']),
|
|
|
|
- },
|
|
|
|
- watch: {},
|
|
|
|
-};
|
|
|
|
-</script>
|
|
|
|
-
|
|
|
|
-<style lang="less" scoped></style>
|
|
|
|
|
|
+<template>
|
|
|
|
+ <div id="index">
|
|
|
|
+ <el-row>
|
|
|
|
+ <el-col :span="24" class="main">
|
|
|
|
+ <el-col :span="24" class="down">
|
|
|
|
+ <el-tabs v-model="activeName" type="card">
|
|
|
|
+ <el-tab-pane label="资料归档" name="first">
|
|
|
|
+ <data-table :fields="fields" :opera="opera" :data="list" :total="total" @query="search" @file="toFile" @load="toLoad" @cert="toCert">
|
|
|
|
+ <template #custom="{item,row}">
|
|
|
|
+ <template v-if="item.prop === 'basic.achieve_num'">
|
|
|
|
+ <el-link size="mini" type="primary" @click="toApply(row)">{{ getProps(row, item.prop) }}</el-link>
|
|
|
|
+ </template>
|
|
|
|
+ </template>
|
|
|
|
+ </data-table>
|
|
|
|
+ </el-tab-pane>
|
|
|
|
+ <el-tab-pane label="证书发放" name="second">
|
|
|
|
+ <data-table :fields="fields" :opera="opera" :data="certList" :total="certTotal" @query="search" @file="toFile" @load="toLoad" @cert="toCert">
|
|
|
|
+ <template #custom="{item,row}">
|
|
|
|
+ <template v-if="item.prop === 'basic.achieve_num'">
|
|
|
|
+ <el-link size="mini" type="primary" @click="toApply(row)">{{ getProps(row, item.prop) }}</el-link>
|
|
|
|
+ </template>
|
|
|
|
+ </template>
|
|
|
|
+ </data-table>
|
|
|
|
+ </el-tab-pane>
|
|
|
|
+ </el-tabs>
|
|
|
|
+ </el-col>
|
|
|
|
+ </el-col>
|
|
|
|
+ </el-row>
|
|
|
|
+ <el-dialog title="发放证书" width="40%" :visible.sync="dialog" @closed="handleClose" :destroy-on-close="true">
|
|
|
|
+ <el-form>
|
|
|
|
+ <el-form-item label="成果名称">{{ getProp('basic.achieve_name') }}</el-form-item>
|
|
|
|
+ <el-timeline>
|
|
|
|
+ <el-timeline-item
|
|
|
|
+ v-for="(i, index) in line"
|
|
|
|
+ :key="`line${index}`"
|
|
|
|
+ :icon="i.status <= 0 ? 'el-icon-close ' : 'el-icon-check'"
|
|
|
|
+ :type="i.status <= 0 ? 'danger ' : 'success'"
|
|
|
|
+ size="large"
|
|
|
|
+ :timestamp="i.status <= 0 ? '' : i.create_time"
|
|
|
|
+ >
|
|
|
|
+ {{ i.step }}
|
|
|
|
+ <el-collapse v-if="i.status <= 0">
|
|
|
|
+ <el-collapse-item title="点击展开" name="1">
|
|
|
|
+ <el-table :data="i.list">
|
|
|
|
+ <el-table-column align="center" label="时间" prop="create_time" show-overflow-tooltip></el-table-column>
|
|
|
|
+ <el-table-column align="center" label="建议" prop="desc" show-overflow-tooltip></el-table-column>
|
|
|
|
+ </el-table>
|
|
|
|
+ </el-collapse-item>
|
|
|
|
+ </el-collapse>
|
|
|
|
+ </el-timeline-item>
|
|
|
|
+ </el-timeline>
|
|
|
|
+ <el-form-item label="是否缴费">
|
|
|
|
+ <el-checkbox v-model="cost" :label="true">已缴费</el-checkbox>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="">
|
|
|
|
+ <el-button type="primary" :disabled="!cost" @click="haveCert">发放证书</el-button>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-form>
|
|
|
|
+ </el-dialog>
|
|
|
|
+ <el-dialog title="成果详情" center width="80%" :close-on-click-modal="false" :visible.sync="applyDialog" destroy-on-close @closed="applyClose">
|
|
|
|
+ <detail :form="apply"></detail>
|
|
|
|
+ </el-dialog>
|
|
|
|
+ </div>
|
|
|
|
+</template>
|
|
|
|
+
|
|
|
|
+<script>
|
|
|
|
+const _ = require('lodash');
|
|
|
|
+import detail from '../parts/detail.vue';
|
|
|
|
+import dataTable from '@common/src/components/frame/filter-page-table.vue';
|
|
|
|
+import { mapState, createNamespacedHelpers } from 'vuex';
|
|
|
|
+const { mapActions: achieveApply } = createNamespacedHelpers('achieveApply');
|
|
|
|
+const { mapActions: verifyRecord } = createNamespacedHelpers('verifyRecord');
|
|
|
|
+export default {
|
|
|
|
+ metaInfo() {
|
|
|
|
+ return { title: this.$route.meta.title };
|
|
|
|
+ },
|
|
|
|
+ name: 'index',
|
|
|
|
+ props: {},
|
|
|
|
+ components: {
|
|
|
|
+ dataTable,
|
|
|
|
+ detail,
|
|
|
|
+ },
|
|
|
|
+ data: function() {
|
|
|
|
+ return {
|
|
|
|
+ activeName: 'first',
|
|
|
|
+ opera: [
|
|
|
|
+ {
|
|
|
|
+ label: '资料归档',
|
|
|
|
+ method: 'file',
|
|
|
|
+ display: i => i.status === '5',
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ label: '资料预览',
|
|
|
|
+ method: 'load',
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ label: '发放证书',
|
|
|
|
+ method: 'cert',
|
|
|
|
+ display: i => i.status === '6',
|
|
|
|
+ },
|
|
|
|
+ ],
|
|
|
|
+ fields: [
|
|
|
|
+ { label: '成果编号', prop: 'basic.achieve_num', filter: 'input', showTip: true, custom: true },
|
|
|
|
+ { label: '成果名称', prop: 'basic.achieve_name', showTip: true },
|
|
|
|
+ { label: '成果类别', prop: 'basic.achieve_type', showTip: true },
|
|
|
|
+ ],
|
|
|
|
+ list: [],
|
|
|
|
+ total: 0,
|
|
|
|
+ dialog: false,
|
|
|
|
+ info: {},
|
|
|
|
+ test: true,
|
|
|
|
+ cost: false,
|
|
|
|
+ line: [],
|
|
|
|
+ applyDialog: false,
|
|
|
|
+ apply: {},
|
|
|
|
+ // 证书发放
|
|
|
|
+ certList: [],
|
|
|
|
+ certTotal: 0,
|
|
|
|
+ };
|
|
|
|
+ },
|
|
|
|
+ async created() {
|
|
|
|
+ await this.search();
|
|
|
|
+ },
|
|
|
|
+ methods: {
|
|
|
|
+ ...achieveApply(['query']),
|
|
|
|
+ ...verifyRecord({ create: 'create', getRecord: 'query' }),
|
|
|
|
+ // 查询列表
|
|
|
|
+ async search({ skip = 0, limit = 10, ...info } = {}) {
|
|
|
|
+ let res = await this.query({ skip, limit, ...info, status: '5' });
|
|
|
|
+ if (this.$checkRes(res)) {
|
|
|
|
+ this.$set(this, 'list', res.data);
|
|
|
|
+ this.$set(this, `total`, res.total);
|
|
|
|
+ }
|
|
|
|
+ res = await this.query({ skip, limit, ...info, status: '6' });
|
|
|
|
+ if (this.$checkRes(res)) {
|
|
|
|
+ this.$set(this, 'certList', res.data);
|
|
|
|
+ this.$set(this, `certTotal`, res.total);
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ async toCert({ data }) {
|
|
|
|
+ this.$set(this, `info`, data);
|
|
|
|
+ const records = await this.getRecord({ apply_id: data._id });
|
|
|
|
+ const order = [-1, 1, -2, 2, -3, 3, 4, -5, 5, 6]; //时间轴的顺序,如果有修改,请注意这里的逗号,少写了只会让顺序出错,不会报错,被识别成减法了(实际体验的结果)
|
|
|
|
+ if (this.$checkRes(records)) {
|
|
|
|
+ let data = _.get(records, 'data', []);
|
|
|
|
+ data = _.groupBy(data, 'status');
|
|
|
|
+ const arr = [];
|
|
|
|
+ for (const n of order) {
|
|
|
|
+ const obj = _.get(data, n);
|
|
|
|
+ if (obj) {
|
|
|
|
+ const head = _.head(obj);
|
|
|
|
+ if (!head) continue;
|
|
|
|
+ const aobj = { step: _.get(head, 'step'), create_time: _.get(head, 'create_time'), list: obj, status: _.get(head, 'status') };
|
|
|
|
+ arr.push(aobj);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ this.$set(this, `line`, arr);
|
|
|
|
+ }
|
|
|
|
+ this.dialog = true;
|
|
|
|
+ },
|
|
|
|
+ getProp(prop) {
|
|
|
|
+ return _.get(this.info, prop, '');
|
|
|
|
+ },
|
|
|
|
+ async haveCert() {
|
|
|
|
+ const data = _.cloneDeep(this.info);
|
|
|
|
+ // 发证书
|
|
|
|
+ let dup = { status: '7' };
|
|
|
|
+ dup.apply_id = _.get(data, '_id');
|
|
|
|
+ dup.verify = _.get(this.user, 'name');
|
|
|
|
+ dup.verify_phone = _.get(this.user, 'phone');
|
|
|
|
+ dup.verify_id = _.get(this.user, '_id');
|
|
|
|
+ dup.step = '发证书';
|
|
|
|
+ const res = await this.create(dup);
|
|
|
|
+ if (this.$checkRes(res, '已确定发放证书', res.errmsg || '确定发放失败')) {
|
|
|
|
+ this.handleClose();
|
|
|
|
+ this.search();
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ handleClose() {
|
|
|
|
+ this.info = {};
|
|
|
|
+ this.line = [];
|
|
|
|
+ this.dialog = false;
|
|
|
|
+ },
|
|
|
|
+ // 资料归档
|
|
|
|
+ toFile({ data }) {
|
|
|
|
+ this.$router.push({ path: '/adminCate/detail', query: { id: data.id } });
|
|
|
|
+ },
|
|
|
|
+ // 资料预览
|
|
|
|
+ toLoad({ data }) {
|
|
|
|
+ this.$router.push({ path: '/adminCate/dataInfo', query: { id: data.id, type: '5' } });
|
|
|
|
+ },
|
|
|
|
+ async toApply(data) {
|
|
|
|
+ this.$set(this, 'apply', data);
|
|
|
|
+ this.applyDialog = true;
|
|
|
|
+ },
|
|
|
|
+ getProps(data, prop) {
|
|
|
|
+ return _.get(data, prop);
|
|
|
|
+ },
|
|
|
|
+ applyClose() {
|
|
|
|
+ this.applyDialog = false;
|
|
|
|
+ this.apply = {};
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ computed: {
|
|
|
|
+ ...mapState(['user']),
|
|
|
|
+ },
|
|
|
|
+ watch: {},
|
|
|
|
+};
|
|
|
|
+</script>
|
|
|
|
+
|
|
|
|
+<style lang="less" scoped></style>
|