detail.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. <template>
  2. <div id="detail">
  3. <el-row>
  4. <el-col :span="24" class="main">
  5. <el-col :span="24" class="top">
  6. <el-button type="primary" size="mini" @click="back">返回</el-button>
  7. </el-col>
  8. <el-col :span="24" class="down">
  9. <data-table :fields="fields" :opera="opera" :data="list" :total="total" @query="search" @view="toView"></data-table>
  10. </el-col>
  11. </el-col>
  12. </el-row>
  13. <el-dialog class="dialog" title="意见详情" width="40%" :visible.sync="dialog" @closed="handleClose" :destroy-on-close="true">
  14. <el-col :span="24" class="one">
  15. <el-col :span="24" class="info">
  16. {{ form.desc }}
  17. </el-col>
  18. </el-col>
  19. </el-dialog>
  20. </div>
  21. </template>
  22. <script>
  23. import dataTable from '@common/src/components/frame/filter-page-table.vue';
  24. import { mapState, createNamespacedHelpers } from 'vuex';
  25. const { mapActions: verifyRecord } = createNamespacedHelpers('verifyRecord');
  26. export default {
  27. name: 'detail',
  28. props: {},
  29. components: {
  30. dataTable,
  31. },
  32. data: function() {
  33. return {
  34. opera: [
  35. {
  36. label: '意见查看',
  37. method: 'view',
  38. },
  39. ],
  40. fields: [
  41. { label: '审核类型', prop: 'step', showTip: true },
  42. { label: '审核人', prop: 'verify', showTip: true },
  43. { label: '审核电话', prop: 'verify_phone', showTip: true },
  44. { label: '审核时间', prop: 'create_time', showTip: true },
  45. {
  46. label: '状态',
  47. prop: 'status',
  48. format: item => {
  49. return item === '1' ? '审核通过' : item === '-1' ? '审核未通过' : '未识别';
  50. },
  51. },
  52. ],
  53. list: [],
  54. total: 0,
  55. // 意见详情
  56. dialog: false,
  57. form: {},
  58. };
  59. },
  60. async created() {
  61. await this.search();
  62. },
  63. methods: {
  64. ...verifyRecord(['query']),
  65. // 查询列表
  66. async search({ skip = 0, limit = 10, ...info } = {}) {
  67. const res = await this.query({ skip, limit, apply_id: this.id, ...info });
  68. if (this.$checkRes(res)) {
  69. this.$set(this, 'list', res.data);
  70. this.$set(this, `total`, res.total);
  71. }
  72. },
  73. // 意见查看
  74. toView({ data }) {
  75. this.$set(this, `form`, data);
  76. this.dialog = true;
  77. },
  78. // 取消查看
  79. handleClose() {
  80. this.form = {};
  81. this.dialog = false;
  82. },
  83. // 返回
  84. back() {
  85. this.$router.push({ path: '/updateApply' });
  86. },
  87. },
  88. computed: {
  89. ...mapState(['user']),
  90. id() {
  91. return this.$route.query.id;
  92. },
  93. },
  94. metaInfo() {
  95. return { title: this.$route.meta.title };
  96. },
  97. };
  98. </script>
  99. <style lang="less" scoped>
  100. .main {
  101. .top {
  102. text-align: right;
  103. margin: 0 0 10px 0;
  104. }
  105. }
  106. .dialog {
  107. /deep/.el-dialog__body {
  108. min-height: 330px;
  109. padding: 0px 0px 10px 20px;
  110. }
  111. .one {
  112. .text {
  113. font-size: 18px;
  114. font-weight: bold;
  115. margin: 0 0 5px 0;
  116. }
  117. .info {
  118. font-size: 16px;
  119. height: 325px;
  120. overflow-y: auto;
  121. line-height: 30px;
  122. }
  123. }
  124. }
  125. </style>