auditRecords.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. <template>
  2. <!-- 任务审核记录 -->
  3. <div class="auditRecords">
  4. <el-dialog title="查看审核记录" :visible.sync="dialogVisible" width="1000px" :before-close="handleClose"
  5. :close-on-click-modal="false">
  6. <el-table :data="tableData" style="width: 100%;" border header-row-class-name="custom-table-header"
  7. @sort-change="sortChange">
  8. <el-table-column label="#" align="center" width="60px">
  9. <template slot-scope="scope">
  10. <div>
  11. {{ (queryParams.current - 1) * queryParams.size + scope.$index + 1 }}
  12. </div>
  13. </template>
  14. </el-table-column>
  15. <el-table-column v-for="item in columnList" :key="item.value" :prop="item.value"
  16. :render-header="$commonJS.renderHeaderMethods" :label="item.name" sortable="custom" align="center">
  17. <template slot-scope="scope">
  18. <div v-if="['name'].includes(item.value)">
  19. <el-link @click="handleItem(scope.row, item.value)">
  20. <span v-html="$commonJS.getColumnData(scope.row, item)"></span>
  21. </el-link>
  22. </div>
  23. <div v-else-if="['taskType'].includes(item.value)"
  24. v-html="$commonJS.getColumnData(scope.row, item, null, { data: taskType })"></div>
  25. <div v-else v-html="$commonJS.getColumnData(scope.row, item)"></div>
  26. </template>
  27. </el-table-column>
  28. </el-table>
  29. <div style="text-align: center;padding-top: 20px;">
  30. <el-pagination background layout="total, prev, pager, next, jumper" :current-page.sync="queryParams.current"
  31. :page-size.sync="queryParams.size" @current-change="handleCurrentChange" :total="queryParams.total">
  32. </el-pagination>
  33. </div>
  34. <span slot="footer" class="dialog-footer">
  35. <el-button type="primary" @click="handleClose">关 闭</el-button>
  36. </span>
  37. </el-dialog>
  38. </div>
  39. </template>
  40. <script>
  41. import { column } from '../mixins/index2'
  42. export default {
  43. mixins: [column],
  44. data() {
  45. return {
  46. // 审核记录数据
  47. tableData: [],
  48. dialogVisible: false,
  49. // 审核记录分页信息
  50. queryParams: {
  51. current: 1,
  52. size: 10,
  53. total: 0,
  54. },
  55. // 排序
  56. sort:[{ "orderBy": "createTime", "orderType": 1 }],
  57. }
  58. },
  59. mounted() {
  60. },
  61. methods: {
  62. //排序
  63. sortChange({ column, prop, order }) {
  64. //如需要多个字段排序,则不需要清空
  65. var params = {
  66. sort: this.sort,
  67. column,
  68. prop,
  69. order,
  70. }
  71. this.sort = this.$commonJS.getSortData(params)
  72. this.queryParams.current = 1
  73. this.getList()
  74. },
  75. getList(id) {
  76. let params = {
  77. ...this.queryParams,//分页信息
  78. // searchQuery: this.$commonJS.objectToString(this.searchOption),//检索条件
  79. orderDTOList: this.sort,//排序信息
  80. id: id,
  81. }
  82. this.$api.query(params).then(response => {
  83. if (response.code == 200) {
  84. this.tableData = response.data.data
  85. this.queryParams.current = response.data.current
  86. this.queryParams.size = response.data.size
  87. this.queryParams.total = response.data.total
  88. }
  89. })
  90. },
  91. // 打开弹窗
  92. open(id) {
  93. // this.getList(id)
  94. this.dialogVisible = true
  95. },
  96. handleClose() {
  97. this.dialogVisible = false
  98. },
  99. // 分页查询
  100. handleCurrentChange(val) {
  101. this.queryParams.current = val
  102. this.getList()
  103. },
  104. },
  105. }
  106. </script>
  107. <style lang="scss" scoped></style>