|
@@ -0,0 +1,83 @@
|
|
|
+<template>
|
|
|
+ <div id="list" class="main">
|
|
|
+ <el-row v-if="view==='list'">
|
|
|
+ <el-col :span="24">
|
|
|
+ <data-table
|
|
|
+ :fields="fields"
|
|
|
+ :opera="opera"
|
|
|
+ :total="total"
|
|
|
+ :data="list"
|
|
|
+ @query="search"
|
|
|
+ @toView="toView"
|
|
|
+ />
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row v-else>
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-button type="primary" plain icon="el-icon-back" size="mini" @click="toBack">返回</el-button>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24">
|
|
|
+ <achieve-view :info="viewData" />
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import achieveView from '@/components/free/achieve-view.vue'
|
|
|
+import dataTable from '@/components/free/filter-page-table.vue'
|
|
|
+const _ = require('lodash')
|
|
|
+import { createNamespacedHelpers } from 'vuex'
|
|
|
+const { mapActions } = createNamespacedHelpers('duplicate')
|
|
|
+export default {
|
|
|
+ name: 'List',
|
|
|
+ components: { dataTable, achieveView },
|
|
|
+ props: {},
|
|
|
+ data: function() {
|
|
|
+ return {
|
|
|
+ view: 'list',
|
|
|
+ list: [],
|
|
|
+ total: 0,
|
|
|
+ fields: [
|
|
|
+ { label: '申请人', prop: 'user_name', filter: true },
|
|
|
+ { label: '申请年度', prop: 'apply_year' }
|
|
|
+ ],
|
|
|
+ opera: [
|
|
|
+ { label: '查看', method: 'toView' }
|
|
|
+ ],
|
|
|
+ viewData: {}
|
|
|
+ }
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ this.search()
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ ...mapActions(['query']),
|
|
|
+ async search({ skip = 0, limit = 10, ...info } = {}) {
|
|
|
+ const res = await this.query({ skip, limit, ...info })
|
|
|
+ if (this.$checkRes(res)) {
|
|
|
+ this.$set(this, `list`, res.data)
|
|
|
+ this.$set(this, `total`, res.total)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ async toView({ data }) {
|
|
|
+ this.$set(this, `viewData`, _.cloneDeep(data))
|
|
|
+ this.view = 'detail'
|
|
|
+ },
|
|
|
+ async toBack() {
|
|
|
+ this.view = 'list'
|
|
|
+ this.viewData = {}
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="scss" scoped>
|
|
|
+.main {
|
|
|
+ padding: 25px 30px 30px;
|
|
|
+}
|
|
|
+</style>
|