list.php 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209
  1. <com-list-page :crumbs="crumbs" id="application">
  2. <com-list-table
  3. ref="table"
  4. :api="'mall/optimize/list'"
  5. @selection-change="handleSelectionChange"
  6. :search-list="searchList"
  7. @search="handleSearch"
  8. >
  9. <el-table-column
  10. type="selection"
  11. >
  12. </el-table-column>
  13. <el-table-column prop="id" min-width="30" label="序号" align="center"></el-table-column>
  14. <el-table-column prop="member_name" min-width="80" label="类型" align="center">
  15. <template slot-scope="scope">
  16. <el-tag effect="dark">{{ categorys[scope.row.category] }}</el-tag>
  17. </template>
  18. </el-table-column>
  19. <el-table-column min-width="80" label="操作人" align="center">
  20. <template slot-scope="scope">
  21. {{ scope.row.detail.member_name }}
  22. </template>
  23. </el-table-column>
  24. <el-table-column prop="title" min-width="200" label="优化建议描述"></el-table-column>
  25. <el-table-column label="时间" align="center">
  26. <template slot-scope="scope">
  27. <div>{{ scope.row.created_at | dateTimeFormat('Y-m-d H:i:s') }}</div>
  28. </template>
  29. </el-table-column>
  30. <el-table-column label="状态" align="center">
  31. <template slot-scope="scope">
  32. <el-tag v-if="scope.row.send_status == 0" type="danger">待回复</el-tag>
  33. <el-tag v-if="scope.row.send_status == 1 && scope.row.examine_status == 1">待回复</el-tag>
  34. <el-tag v-if="scope.row.send_status == 1 && scope.row.examine_status == 2" type="success">已回复</el-tag>
  35. <el-tag v-if="scope.row.send_status == 1 && scope.row.examine_status == 3" type="success">工单结束</el-tag>
  36. </template>
  37. </el-table-column>
  38. <el-table-column label="操作" min-width="50" align="center">
  39. <template slot-scope="scope">
  40. <el-button type="text" @click="handle('detail', scope.row)">查看</el-button>
  41. <el-button
  42. v-if="scope.row.send_status == 0"
  43. type="text"
  44. @click="send(scope.row.id)"
  45. :loading="btnLoad"
  46. >推送</el-button>
  47. </template>
  48. </el-table-column>
  49. <template slot="header-left">
  50. <el-button
  51. type="primary"
  52. size="mini"
  53. @click="$navigate({r: 'mall/optimize/edit'})"
  54. icon="el-icon-plus"
  55. >添加建议</el-button>
  56. </template>
  57. <template slot="footer-button">
  58. <el-button @click="$navigate({r: 'mall/optimize/edit'})">批量删除</el-button>
  59. <el-button @click="$navigate({r: 'mall/optimize/edit'})">批量禁用</el-button>
  60. </template>
  61. </com-list-table>
  62. </com-list-page>
  63. <script>
  64. let id = 0;
  65. const application = new Vue({
  66. el: '#application',
  67. data: {
  68. crumbs: [
  69. {
  70. title: '首页',
  71. router: 'mall/overview/index',
  72. },
  73. {
  74. title: '优化建议',
  75. }
  76. ],
  77. categorys: {
  78. 'optimize': '功能优化',
  79. 'bug': 'BUG修复',
  80. 'others': '其他建议',
  81. },
  82. // searchList: [
  83. // {
  84. // key: 'nickname',
  85. // title: '昵称',
  86. // type: 'text',
  87. // },
  88. // {
  89. // key: 'time',
  90. // title: '手机',
  91. // type: 'select',
  92. // options: [
  93. // {
  94. // label: '开启',
  95. // value: 1
  96. // },
  97. // {
  98. // label: '关闭',
  99. // value: 0
  100. // }
  101. // ],
  102. // valueKey: {
  103. // label: 'label',
  104. // value: 'value',
  105. // },
  106. // },
  107. // {
  108. // key: 'realname',
  109. // title: '时间',
  110. // type: 'time-picker',
  111. // },
  112. // {
  113. // key: 'order_no',
  114. // title: '订单号',
  115. // },
  116. // {
  117. // key: 'date',
  118. // title: '日期',
  119. // type: 'date-picker',
  120. // valueFormat: 'yyyy-MM-dd',
  121. // },
  122. // {
  123. // key: 'date_time',
  124. // title: '日期',
  125. // type: 'date-time-range',
  126. // },
  127. // {
  128. // /**
  129. // * @see https://element.eleme.io/#/zh-CN/component/cascader
  130. // */
  131. // key: 'type',
  132. // title: '类型',
  133. // type: 'cascader',
  134. // // options: [],
  135. // props: {
  136. // multiple: true,
  137. // checkStrictly: true,
  138. // lazy: true,
  139. // lazyLoad (node, resolve) {
  140. // const { level } = node;
  141. // setTimeout(() => {
  142. // const nodes = Array.from({ length: level + 1 })
  143. // .map(item => ({
  144. // value: ++id,
  145. // label: `选项${id}`,
  146. // leaf: level >= 2
  147. // }));
  148. // // 通过调用resolve将子节点数据返回,通知组件数据加载完成
  149. // resolve(nodes);
  150. // }, 50);
  151. // }
  152. // }
  153. // }
  154. // ],
  155. btnLoad: false,
  156. },
  157. methods: {
  158. handleSelectionChange(val) {
  159. this.multipleSelection = val;
  160. },
  161. handleSearch(keyword) {
  162. /* this.$refs.table.getList({
  163. 'examine_status': keyword
  164. }, 1) */
  165. },
  166. handle(type, data = null) {
  167. let id = data ? parseInt(data.id) : '';
  168. switch (type) {
  169. case 'detail':
  170. params = {
  171. r: 'mall/optimize/reply'
  172. };
  173. if (id) params = Object.assign(params, {
  174. id: id
  175. });
  176. navigateTo(params);
  177. break;
  178. }
  179. },
  180. send(id) {
  181. if (this.btnLoad) return
  182. this.btnLoad = true
  183. request({
  184. params: {
  185. r: 'mall/optimize/send',
  186. id: id
  187. },
  188. method: 'get',
  189. }).then(e => {
  190. if (e.data.code == 0) {
  191. this.$message.success(e.data.msg);
  192. setTimeout(() => {
  193. this.getList()
  194. this.btnLoad = false
  195. }, 1500)
  196. } else {
  197. this.$message.error(e.data.msg);
  198. this.btnLoad = false
  199. }
  200. })
  201. },
  202. }
  203. })
  204. </script>