feedback.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. <template>
  2. <van-nav-bar
  3. title="我的反馈"
  4. left-text=""
  5. left-arrow
  6. @click-left="onClickLeft"
  7. @click-right="onClickRight"
  8. >
  9. <template #right>
  10. 反馈
  11. </template>
  12. </van-nav-bar>
  13. <van-search v-model="req.keyword" placeholder="请输入关键词" @search="onRefresh" />
  14. <van-pull-refresh v-model="loading" @refresh="onRefresh" class="feedback">
  15. <van-tabs v-model:active="req.status" @click-tab="onRefresh">
  16. <van-tab title="全部" name="">
  17. </van-tab>
  18. <van-tab title="待回复" name='0'>
  19. </van-tab>
  20. <van-tab title="已回复" name='1'>
  21. </van-tab>
  22. </van-tabs>
  23. <div class="list">
  24. <van-list
  25. v-model:loading="loading"
  26. :finished="finished"
  27. finished-text="没有更多了"
  28. @load="onLoad"
  29. style="margin-bottom:60px"
  30. >
  31. <ul>
  32. <li v-for="i in listData" :key="i.id" @click="toDtl(i)">
  33. <div class="title">
  34. {{i.problemStatement}}
  35. </div>
  36. <div class="time">
  37. {{i.createTime}}
  38. </div>
  39. <div class="status">
  40. {{i.status == 1 ? '已回复' : '待回复'}}
  41. </div>
  42. </li>
  43. </ul>
  44. </van-list>
  45. </div>
  46. </van-pull-refresh>
  47. </template>
  48. <script setup>
  49. import { ref, getCurrentInstance, onMounted } from 'vue'
  50. import commonList from '@/components/common-list.vue'
  51. import { useRoute } from 'vue-router'
  52. import { getUserInfo } from '@/utils/auth';
  53. const loading = ref(false)
  54. const router = useRoute()
  55. const req = ref({
  56. pageNum:1,
  57. keyword:null,
  58. status:'',
  59. })
  60. const finished = ref(false);
  61. const proxy = getCurrentInstance().proxy
  62. const listData = ref([])
  63. const listConfig = ref([
  64. {
  65. label: '姓名',
  66. prop: 'name',
  67. },
  68. {
  69. label: '公司名称',
  70. prop: 'companyName',
  71. },
  72. {
  73. prop:'contactInformation',
  74. label:'联系方式'
  75. }
  76. ])
  77. const onRefresh = () => {
  78. req.value.pageNum = 1
  79. finished.value = false
  80. getList('refresh')
  81. }
  82. const onLoad = () => {
  83. getList()
  84. }
  85. const onClickLeft = () => proxy.$router.push('/main/working')
  86. const onClickRight = () => {
  87. proxy.$router.push('/main/feedbackSubmit')
  88. }
  89. proxy.uploadDdRightBtn(onClickRight,'反馈')
  90. const toDtl = (row) => {
  91. console.log(row)
  92. proxy.$router.push({
  93. path: 'feedbackDtl',
  94. query: row
  95. })
  96. }
  97. const warehouseType = ref([])
  98. const getDict = () => {
  99. proxy.post('/dictTenantData/page',{
  100. pageNum: 1,
  101. pageSize: 999,
  102. tenantId:getUserInfo().tenantId,
  103. dictCode: "warehouse_type",
  104. }).then(res => {
  105. warehouseType.value = res.data.rows.map(item => {
  106. return {
  107. text: item.dictValue,
  108. value: item.dictKey
  109. }
  110. })
  111. getList()
  112. })
  113. }
  114. const getList = (type) => {
  115. loading.value = true
  116. proxy.post('/problemFeedback/page',req.value).then(res => {
  117. res.data.rows.map(item => {
  118. warehouseType.value.map(type => {
  119. if(item.type == type.value) {
  120. item.typeName = type.text
  121. }
  122. })
  123. })
  124. listData.value = type === 'refresh' ? res.data.rows : listData.value.concat(res.data.rows)
  125. if(req.value.pageNum * 10 >= res.data.total) {
  126. finished.value = true
  127. }
  128. req.value.pageNum++
  129. loading.value = false
  130. }).catch(err => {
  131. loading.value = false
  132. })
  133. }
  134. getDict()
  135. </script>
  136. <style lang="scss" scoped>
  137. .list {
  138. min-height: 70vh;
  139. ul{
  140. li{
  141. padding: 12px 20px;
  142. background: #fff;
  143. margin: 16px 12px 0;
  144. border-radius: 8px;
  145. line-height: 28px;
  146. position: relative;
  147. .status{
  148. position: absolute;
  149. right: 0;;
  150. top: 0;
  151. width: 60px;
  152. height: 20px;
  153. line-height: 20px;
  154. text-align: center;
  155. border-radius: 0px 8px 0px 8px;
  156. font-size: 12px;
  157. background: #A0BBFB;
  158. color: #fff;
  159. }
  160. }
  161. }
  162. }
  163. </style>