Przeglądaj źródła

基础处上报查看

lrf 3 lat temu
rodzic
commit
4e9f0d5411

+ 44 - 0
java代码/ruoyi-ui/src/store/duplicate.js

@@ -0,0 +1,44 @@
+import Vue from 'vue'
+import Vuex from 'vuex'
+import _ from 'lodash'
+Vue.use(Vuex)
+const api = {
+  interface: `/labelAchievement/api/duplicate`
+};
+const state = () => ({})
+const mutations = {}
+
+const actions = {
+  async query({ commit }, { skip = 0, limit = null, ...info } = {}) {
+    const res = await this.$axios.$get(api.interface, { skip, limit, ...info })
+    return res
+  },
+  async create({ commit }, payload) {
+    const res = await this.$axios.$post(`${api.interface}`, payload)
+    return res
+  },
+  async fetch({ commit }, payload) {
+    const res = await this.$axios.$get(`${api.interface}/${payload}`)
+    return res
+  },
+  async update({ commit }, { id, ...info } = {}) {
+    const res = await this.$axios.$post(`${api.interface}/${id}`, {
+      ...info
+    })
+    return res
+  },
+  async delete({ commit }, payload) {
+    const res = await this.$axios.$delete(`${api.interface}/${payload}`)
+    return res
+  },
+  async toUse({ commit }, payload) {
+    const res = await this.$axios.$post(`${api.interface}/toUse/${payload}`)
+    return res
+  }
+}
+export default {
+  namespaced: true,
+  state,
+  mutations,
+  actions
+}

+ 4 - 3
java代码/ruoyi-ui/src/store/index.js

@@ -9,9 +9,9 @@ import getters from './getters'
 import role_relation from './role_relation'
 import role_relation from './role_relation'
 import merits_user from './merits_user'
 import merits_user from './merits_user'
 import template from './template'
 import template from './template'
-import merits_apply from "./merits_apply"
+import merits_apply from './merits_apply'
+import duplicate from './duplicate'
 
 
-;
 Vue.use(Vuex)
 Vue.use(Vuex)
 
 
 const store = new Vuex.Store({
 const store = new Vuex.Store({
@@ -24,7 +24,8 @@ const store = new Vuex.Store({
     role_relation,
     role_relation,
     merits_user,
     merits_user,
     template,
     template,
-    merits_apply
+    merits_apply,
+    duplicate
   },
   },
   getters,
   getters,
   name: false
   name: false

+ 1 - 1
java代码/ruoyi-ui/src/views/merits/template/parts/list.vue

@@ -1,6 +1,6 @@
 <template>
 <template>
   <div id="list">
   <div id="list">
-    <el-row>
+    <el-row  class="main">
       <el-col :span="24">
       <el-col :span="24">
         <data-table
         <data-table
           :fields="fields"
           :fields="fields"

+ 83 - 0
java代码/ruoyi-ui/src/views/merits/view/index.vue

@@ -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>