feedbackList.vue 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  1. <template>
  2. <div class="feedbackList flex-display">
  3. <div class="head">
  4. <div class="text">
  5. <div class="head-item">
  6. <el-select v-model="params.gameId" placeholder="请选择游戏" filterable clearable>
  7. <el-option
  8. v-for="item in feedGameList"
  9. :key="item.gameId"
  10. :label="item.gameId + '_' +item.gameAlias"
  11. :value="item.gameId"
  12. ></el-option>
  13. </el-select>
  14. </div>
  15. <div class="head-item" placeholder="请选择创建时间">
  16. <el-date-picker
  17. v-model="createTime"
  18. @change="handelCreateTimeChange"
  19. type="datetimerange"
  20. :value-format="'yyyy-MM-dd HH:mm:ss'"
  21. start-placeholder="反馈日期"
  22. end-placeholder="反馈日期"
  23. :default-time="['00:00:00', '23:59:59']"
  24. ></el-date-picker>
  25. </div>
  26. <div class="head-item">
  27. <el-select v-model="params.state" placeholder="请选择完成状态">
  28. <el-option
  29. v-for="item in stateList"
  30. :key="item.text"
  31. :label="item.text"
  32. :value="item.value"
  33. ></el-option>
  34. </el-select>
  35. </div>
  36. </div>
  37. <div class="action">
  38. <el-button plain type="primary" icon="el-icon-search" @click="getFeedbackList">搜索</el-button>
  39. </div>
  40. </div>
  41. <div class="list">
  42. <el-table :data="feedbackList" border stripe :fit="false" height="100%" @sort-change="handelSortChange">
  43. <el-table-column label="反馈编号" prop="id" width="150" show-overflow-tooltip/>
  44. <el-table-column label="游戏名称" prop="gameAlias" width="150" show-overflow-tooltip/>
  45. <el-table-column label="联系类型" width="150" show-overflow-tooltip>
  46. <template slot-scope="scope">
  47. <el-tag>{{contactType(scope.row.userContactType)}}
  48. </el-tag>
  49. </template>
  50. </el-table-column>
  51. <el-table-column label="联系方式" prop="userContact" width="150" show-overflow-tooltip/>
  52. <el-table-column label="问题描述" prop="content" width="150" show-overflow-tooltip/>
  53. <el-table-column label="反馈时间" prop="createTime" width="150" show-overflow-tooltip sortable="custom"/>
  54. <el-table-column label="操作" width="120">
  55. <template slot-scope="scope">
  56. <div class="headrow">
  57. <el-button size="mini" @click="handelSelectFeedback(scope.row.id)">查看</el-button>
  58. <!--<el-button size="mini" type="success">完成</el-button>-->
  59. </div>
  60. </template>
  61. </el-table-column>
  62. </el-table>
  63. </div>
  64. <div class="page">
  65. <el-pagination
  66. @size-change="handleSizeChange"
  67. @current-change="handleCurrentChange"
  68. layout="total, sizes, prev, pager, next, jumper"
  69. :page-size="page.size"
  70. :pager-count="11"
  71. :total="page.total"
  72. ></el-pagination>
  73. </div>
  74. <el-dialog :title="dialog.title" :visible.sync="dialog.visible" center>
  75. <div class="content">
  76. </div>
  77. <span slot="footer" class="dialog-footer">
  78. <el-button @click="dialog.visible = false">关闭</el-button>
  79. </span>
  80. </el-dialog>
  81. </div>
  82. </template>
  83. <script>
  84. import feedbackApi from '@/api/feedback'
  85. import {getLastDay, formatTime} from '@/utils/util'
  86. export default {
  87. name: "feedbackList",
  88. data() {
  89. return {
  90. createTime: '',
  91. params: {
  92. state: 0
  93. },
  94. feedbackList: [],
  95. gameList: [],
  96. state: 0,
  97. feedGameList: [],
  98. contactOption: [
  99. {text: '微信', value: 0, inputType: 'text'},
  100. {text: 'QQ', value: 1, inputType: 'number'},
  101. {text: '手机号', value: 2, inputType: 'tel'},
  102. {text: '邮箱', value: 3, inputType: 'email'}
  103. ],
  104. stateList: [
  105. {value: 0, text: '未完成'},
  106. {value: 1, text: '已完成'},
  107. {value: null, text: '全部'}
  108. ],
  109. dialog: {
  110. title: '反馈详情',
  111. visible: false
  112. },
  113. feedbackInfo: {},
  114. page: {},
  115. }
  116. },
  117. mounted() {
  118. this.init();
  119. },
  120. methods: {
  121. init() {
  122. if (this.$route.params.params) {
  123. this.params = this.$route.params.params;
  124. }
  125. if (this.$route.params.page) {
  126. this.page = this.$route.params.page;
  127. }
  128. let lastDay = getLastDay(3);
  129. this.createTime = lastDay;
  130. this.params.createStartTime = lastDay ? formatTime(lastDay[0]) : null;
  131. this.params.createEndTime = lastDay ? formatTime(lastDay[1]) : null;
  132. feedbackApi.getFeedbackGameList().then(res => {
  133. this.feedGameList = res;
  134. this.getFeedbackList()
  135. })
  136. },
  137. getFeedbackList() {
  138. feedbackApi.getFeedbackList(this.params).then(res => {
  139. this.feedbackList = res.rows;
  140. this.page = res.page
  141. })
  142. },
  143. /**
  144. * 获取反馈游戏列表
  145. */
  146. getFeedbackGameList() {
  147. feedbackApi.getFeedbackGameList().then(res => {
  148. this.feedGameList = res;
  149. })
  150. },
  151. contactType(type) {
  152. return this.contactOption.find(f => f.value == type).text
  153. },
  154. handelSelectFeedback(id) {
  155. this.$router.push({
  156. name: 'feedbackDetail',
  157. params: {
  158. id: id,
  159. params: this.params,
  160. page:this.page
  161. }
  162. })
  163. },
  164. handelCreateTimeChange(val) {
  165. this.params.createStartTime = val ? val[0] : null;
  166. this.params.createEndTime = val ? val[1] : null;
  167. this.$log.debug(this.params)
  168. },
  169. handelSortChange({order}) {
  170. console.log(order)
  171. if (order == 'descending') {
  172. this.params.orderBy = 1
  173. } else if (order == 'ascending') {
  174. this.params.orderBy = 0
  175. } else {
  176. this.params.orderBy = null
  177. }
  178. this.getFeedbackList()
  179. },
  180. handleSizeChange(val) {
  181. this.$log.debug(val);
  182. this.params.size = val;
  183. this.getFeedbackList()
  184. },
  185. handleCurrentChange(val) {
  186. this.params.cur = val;
  187. this.getFeedbackList()
  188. },
  189. }
  190. }
  191. </script>
  192. <style lang="less" scoped>
  193. .feedbackList {
  194. .head {
  195. .el-input {
  196. width: 300px;
  197. }
  198. }
  199. }
  200. </style>