organization.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. <template>
  2. <div class="hui-flex hui-content">
  3. <div class="hui-flex">
  4. <div class="hui-content-title">
  5. <div class="hui-title-item active">公司会议</div>
  6. </div>
  7. <div class="hui-flex-box hui-flex hui-table">
  8. <div class="hui-content-insert">
  9. <el-button type="primary" size="medium" @click="insert">新增会议</el-button>
  10. </div>
  11. <div class="hui-flex-box">
  12. <el-table :data="tableData" row-key="id" border height="100%">
  13. <el-table-column label="序号" width="50">
  14. <template slot-scope="scope">
  15. <div style="text-align: center;">{{scope.$index + 1}}</div>
  16. </template>
  17. </el-table-column>
  18. <el-table-column label="会议名称" prop="name"></el-table-column>
  19. <el-table-column label="会议时间" prop="date"></el-table-column>
  20. <el-table-column label="会议类型" prop="typeName"></el-table-column>
  21. <el-table-column label="发起人" prop="userName"></el-table-column>
  22. <el-table-column label="会议地点" prop="placeName"></el-table-column>
  23. <el-table-column label="会议纪要" prop="meetingMinutes"></el-table-column>
  24. <el-table-column label="操作" width="150">
  25. <template slot-scope="scope">
  26. <div class="hui-table-operation">
  27. <span class="table-operation" @click="detailItem(scope.row)">
  28. 详情
  29. </span>
  30. <span class="table-operation" @click="updateItem(scope.row)">
  31. 编辑
  32. </span>
  33. <span class="table-operation" @click="deleteItem(scope.row)">
  34. 删除
  35. </span>
  36. </div>
  37. </template>
  38. </el-table-column>
  39. <template slot="empty">
  40. <empty description="暂无数据"></empty>
  41. </template>
  42. </el-table>
  43. </div>
  44. <div class="hui-content-pagination">
  45. <el-pagination :page-size="pageSize" :pager-count="9" layout="prev, pager, next" :total="totalCount"
  46. @current-change="currentChange">
  47. </el-pagination>
  48. </div>
  49. </div>
  50. </div>
  51. <el-dialog :close-on-click-modal="false" :title="isUpdate?'编辑':'新增'" :visible.sync="visible" width="900px" :append-to-body="true">
  52. <edit v-if="visible" @callback="callback" :isUpdate="isUpdate" :detailId="detailId" :type="type"></edit>
  53. </el-dialog>
  54. <el-drawer title="会议详情" :visible.sync="drawer" :size="400" :append-to-body="true">
  55. <detail v-if="drawer" :detailId="detailId" @callback="callback"></detail>
  56. </el-drawer>
  57. </div>
  58. </template>
  59. <script>
  60. import {
  61. getMeetingListByQuery,
  62. deleteMeetingById
  63. } from '@/httpApi/operation'
  64. import edit from '@/components/work/operation/meeting/edit'
  65. import detail from '@/components/work/operation/meeting/detail'
  66. export default {
  67. data() {
  68. return {
  69. tableData: [],
  70. currPage: 1,
  71. pageSize: 10,
  72. totalCount: 0,
  73. filterOption: {},
  74. type: 2,
  75. isUpdate: false,
  76. visible: false,
  77. detailId: '',
  78. drawer: false
  79. }
  80. },
  81. created() {
  82. this.init();
  83. },
  84. methods: {
  85. init() {
  86. let postData = {
  87. currPage: this.currPage,
  88. pageSize: this.pageSize,
  89. organizationId: this.$store.getters.organization.id,
  90. type: this.type
  91. }
  92. postData = Object.assign(postData, this.filterOption);
  93. getMeetingListByQuery(postData).then(res => {
  94. if (res.state) {
  95. this.tableData = res.data.dataList;
  96. this.totalCount = res.data.totalCount;
  97. }
  98. })
  99. },
  100. filterInit(option) {
  101. this.filterOption = option;
  102. this.currPage = 1;
  103. this.init();
  104. },
  105. insert() {
  106. this.detailId = '';
  107. this.isUpdate = false;
  108. this.visible = true;
  109. },
  110. updateItem(item) {
  111. this.detailId = item.id;
  112. this.isUpdate = true;
  113. this.visible = true;
  114. },
  115. detailItem(item) {
  116. this.detailId = item.id;
  117. this.drawer = true;
  118. },
  119. currentChange(currPage) {
  120. this.currPage = currPage;
  121. this.init();
  122. },
  123. deleteItem(item) {
  124. this.$confirm('确定要删除该会议记录?', () => {
  125. deleteMeetingById(item.id).then(res => {
  126. if (res.state) {
  127. this.$message({
  128. type: 'success',
  129. message: '操作成功'
  130. })
  131. this.init();
  132. }
  133. })
  134. });
  135. },
  136. callback(type) {
  137. if (type === 'init') this.init();
  138. this.visible = false;
  139. }
  140. },
  141. components: {
  142. edit,
  143. detail
  144. },
  145. }
  146. </script>
  147. <style>
  148. </style>