approval_list.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  1. <template>
  2. <div>
  3. <div class="all padding-20">
  4. <el-form ref="formData" :inline="true" :model="formData" label-width="80px">
  5. <el-form-item label="工作类型">
  6. <el-select v-model="formData.source_type" placeholder="请选择排序">
  7. <el-option v-for="item in sourceList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  8. </el-select>
  9. </el-form-item>
  10. <el-form-item label="积分类型">
  11. <el-select v-model="formData.pt_id" placeholder="请选择排序">
  12. <el-option v-for="item in point_types" :key="item.id" :label="item.name" :value="item.id"></el-option>
  13. </el-select>
  14. </el-form-item>
  15. <el-select v-model="formData.target_id" filterable clearable placeholder="请输入或选择人员">
  16. <el-option v-for="item in employee_map" :key="item.id" :label="item.name" :value="item.id"></el-option>
  17. </el-select>
  18. <el-form-item style="margin-left: 10px;"><el-input v-model="formData.keyword" placeholder="请输入审批内容" clearable></el-input></el-form-item>
  19. </el-form>
  20. <div>
  21. <el-table :data="list" style="cursor: pointer;" v-loading="loading" class="listTable" @row-click="openDetail">
  22. <el-table-column label="审批标题" prop="task_name">
  23. <template slot-scope="scope">
  24. <div class="flex-box flex-v-ce">
  25. <userImage width="50px" height="50px" :id="scope.row.employee_id" :user_name="scope.row.employee_name"></userImage>
  26. <div style="margin-left: 5px;">
  27. <span class="tableTitle" v-show="scope.row.source_type == 1">{{ scope.row.employee_name }}的积分任务</span>
  28. <span class="tableTitle" v-show="scope.row.source_type == 2">{{ scope.row.employee_name }}的积分申请</span>
  29. <span class="tableTitle" v-show="scope.row.source_type == 3">{{ scope.row.employee_name }}的积分录入</span>
  30. <span class="tableTitle" v-show="scope.row.source_type == 4">{{ scope.row.employee_name }}的绩效工作</span>
  31. </div>
  32. </div>
  33. </template>
  34. </el-table-column>
  35. <el-table-column label="审批内容" prop="remark.rule">
  36. <template slot-scope="scope">
  37. <span class="font-flex-word" style="max-width: 200px;">{{ scope.row.remark.customize || scope.row.remark.rule }}</span>
  38. </template>
  39. </el-table-column>
  40. <el-table-column label="时间" prop="event_time" width="150"></el-table-column>
  41. <el-table-column label="操作" prop="owner_id" width="80">
  42. <template slot-scope="scope">
  43. <el-button type="text">审批</el-button>
  44. </template>
  45. </el-table-column>
  46. <template slot="empty">
  47. <div class="nopoint_box">
  48. <div class="noimg noperson"></div>
  49. <span class="title">没有对应的数据</span>
  50. </div>
  51. </template>
  52. </el-table>
  53. </div>
  54. <center style="padding: 20px 0;">
  55. <el-pagination
  56. background
  57. @size-change="handleSizeChange"
  58. @current-change="handleCurrentChange"
  59. :current-page="formData.page"
  60. :page-sizes="[10, 20, 30, 40, 50, 100]"
  61. layout="total, sizes, prev, pager, next"
  62. :page-size="formData.page_size"
  63. :total="total"
  64. ></el-pagination>
  65. </center>
  66. </div>
  67. <examinePopup :title="'审核详情'" :id="detail_id" :show.sync="detailShow"></examinePopup>
  68. </div>
  69. </template>
  70. <script>
  71. import examinePopup from '@/components/examinePopup.vue';
  72. import { _debounce, getToken } from '@/api/auth';
  73. export default {
  74. data() {
  75. return {
  76. formData: {
  77. type: 'waiting',
  78. source_type: '0',
  79. target_id:null,
  80. pt_id: 0,
  81. page_size: 10,
  82. page: 1,
  83. keyword:'',
  84. },
  85. total: null,
  86. list: null,
  87. loading: false,
  88. point_types: null,
  89. detailShow: false,
  90. detail_id: null,
  91. employee_map: this.$getCache("userList"),
  92. sourceList: [{ name: '全部', id: '0' }, { name: '积分任务', id: '1' }, { name: '积分申请', id: '2' }, { name: '积分录入', id: '3' }]
  93. };
  94. },
  95. watch: {
  96. 'formData.keyword': {
  97. deep: true,
  98. handler: _debounce(function(val) {
  99. this.formData.page = 1;
  100. this.getSpList();
  101. }, 1000)
  102. },
  103. 'formData.pt_id'() {
  104. this.formData.page = 1;
  105. this.getSpList();
  106. },
  107. 'formData.source_type'() {
  108. this.formData.page = 1;
  109. this.getSpList();
  110. },
  111. 'formData.target_id'(val) {
  112. if(!val){
  113. this.formData.target_id = null;
  114. }
  115. this.formData.page = 1;
  116. this.getSpList();
  117. }
  118. },
  119. components: { examinePopup },
  120. mounted() {
  121. this.getSpList();
  122. this.point_types = this.getPointTypes();
  123. },
  124. methods: {
  125. openDetail(item) {
  126. this.detail_id = item.id;
  127. this.detailShow = true;
  128. },
  129. getTypes() {
  130. var arr = this.$getTyps();
  131. return arr.filter(function(item) {
  132. return item.code != 'JX';
  133. });
  134. },
  135. // 获取积分类型
  136. getPointTypes() {
  137. let point = this.getTypes();
  138. point.unshift({ code: 'all', id: 0, name: '全部' });
  139. return point;
  140. },
  141. // 页码变更
  142. handleCurrentChange(val) {
  143. this.formData.page = val;
  144. this.getSpList();
  145. },
  146. handleSizeChange(val) {
  147. this.formData.page_size = val;
  148. this.getSpList();
  149. },
  150. getSpList() {
  151. let self = this;
  152. self.loading = true;
  153. let params = JSON.parse(JSON.stringify(this.formData));
  154. self.$axios('get', '/api/integral/review/list', params)
  155. .then(res => {
  156. if (res.data.code == 1) {
  157. self.list = res.data.data.list;
  158. self.total = res.data.data.total;
  159. }
  160. })
  161. .finally(e => {
  162. self.loading = false;
  163. });
  164. }
  165. }
  166. };
  167. </script>
  168. <style lang="scss">
  169. .box {
  170. min-height: calc(100vh - 140px);
  171. width: 100%;
  172. background-color: #fff;
  173. padding: 20px;
  174. & .listTable {
  175. & .tableTitle {
  176. line-height: 50px;
  177. padding-left: 10px;
  178. }
  179. }
  180. }
  181. .popperSPBOX {
  182. max-width: calc(100vh - 400px);
  183. background-color: #fff;
  184. }
  185. </style>