index.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254
  1. <template>
  2. <view class="container">
  3. <view style="background-color: #fff;">
  4. <uni-search-bar bgColor="#F6F6F6 " v-model="searchValue" placeholder="请输入保单信息" @confirm="searchChange"
  5. cancelButton="none" @clear="searchChange">
  6. </uni-search-bar>
  7. </view>
  8. <z-paging ref="paging" v-model="dataList" @query="getList" :fixed="false" :auto-show-back-to-top="true"
  9. :empty-view-text="'暂无数据'" :hide-empty-view="false" :auto-show-system-loading="true"
  10. class="z-paging-container">
  11. <view class="list" v-for="(item, index) in dataList" :key="index">
  12. <uni-swipe-action style="margin-top: 30rpx;">
  13. <uni-swipe-action-item>
  14. <view class="tab-bar-item" @click="inEdit(item)">
  15. <view class="list-item">
  16. <view style="font-weight: 800;">
  17. {{item.claimNo}}
  18. </view>
  19. <view style="color: #B5B4B4;">
  20. {{item.submitTime}}
  21. </view>
  22. </view>
  23. <view class="list-item">
  24. <view style="font-weight: 800;color: #03803B;">
  25. {{item.vehicleNumber||'暂无车牌'}}
  26. </view>
  27. <view class="">
  28. 轮胎规格: {{item.tyreSpecs||'-'}}
  29. </view>
  30. </view>
  31. <view class="list-item-end">
  32. <view class="">
  33. 轮胎:{{item.tireQuantity||0}}条
  34. </view>
  35. <view style="display: flex;align-items: center;color: #03803B;">
  36. <image style="width: 32rpx;height: 32rpx;margin-right: 18rpx;"
  37. src="@/static/images/home/insurance/ap.png" />
  38. <text v-if="item.auditStatus==0" style="color:#e6a23c">
  39. 待审核
  40. </text>
  41. <text v-if="item.auditStatus==1" style="color:#409EFF">
  42. 审核中
  43. </text>
  44. <text v-if="item.auditStatus==2" style="color:#67c23a">
  45. 已通过
  46. </text>
  47. <text v-if="item.auditStatus==3" style="color:#f56c6c">
  48. 已拒绝
  49. </text>
  50. </view>
  51. </view>
  52. </view>
  53. <template v-slot:right>
  54. <view @click.stop="onClick(item)"
  55. style="width: 120rpx;background-color:#e43d33;display: flex;justify-content: center;align-items: center;color: #fff;">
  56. <text>删除</text>
  57. </view>
  58. </template>
  59. </uni-swipe-action-item>
  60. </uni-swipe-action>
  61. </view>
  62. </z-paging>
  63. </view>
  64. </template>
  65. <script>
  66. import {
  67. getList,
  68. revokeApproval
  69. } from '@/api/home/claim.js'
  70. export default {
  71. data() {
  72. return {
  73. searchValue: "",
  74. dataList: [],
  75. }
  76. },
  77. onLoad() {},
  78. onShow() {
  79. if (uni.getStorageSync('isUpdate')) {
  80. this.$nextTick(() => {
  81. if (this.$refs.paging) {
  82. this.$refs.paging.reload();
  83. }
  84. });
  85. uni.removeStorageSync('isUpdate')
  86. }
  87. },
  88. filters: {
  89. statusMap(value) {
  90. const statusList = ['待审核', '审核中', '已通过', '已拒绝']
  91. return statusList[value] || '未知状态'
  92. }
  93. },
  94. methods: {
  95. onClick(row) {
  96. if(row.auditStatus!=0){
  97. uni.showToast({
  98. title: '非待审核状态不允许删除',
  99. icon: 'none',
  100. duration: 2000
  101. });
  102. return
  103. }
  104. let _this = this
  105. uni.showModal({
  106. title: '提示',
  107. content: '是否确认删除?',
  108. success: function(res) {
  109. if (res.confirm) {
  110. let obj = {
  111. id: row.id
  112. }
  113. uni.showLoading({
  114. title: '加载中',
  115. mask: true
  116. });
  117. revokeApproval(obj).then(res => {
  118. uni.showToast({
  119. title: '操作成功',
  120. icon: 'none',
  121. duration: 2000
  122. });
  123. _this.$refs.paging.reload();
  124. })
  125. .finally(() => {
  126. uni.hideLoading()
  127. });
  128. }
  129. }
  130. });
  131. },
  132. addDetails() {
  133. uni.navigateTo({
  134. url: '/pages/home/claim/details'
  135. });
  136. },
  137. inEdit(row) {
  138. uni.navigateTo({
  139. url: '/pages/home/claim/details?id=' + row.id,
  140. });
  141. },
  142. searchChange() {
  143. this.$refs.paging.reload()
  144. },
  145. async getList(pageNo, pageSize) {
  146. try {
  147. const obj = {
  148. current: pageNo,
  149. size: pageSize,
  150. claimType: 2,
  151. searchCriteria: this.searchValue
  152. }
  153. const res = await getList(obj)
  154. this.$refs.paging.complete(res.data.records)
  155. } catch (e) {
  156. this.$refs.paging.complete(false)
  157. uni.showToast({
  158. title: '加载失败',
  159. icon: 'none'
  160. })
  161. }
  162. },
  163. goBack() {
  164. uni.navigateBack({
  165. delta: 1,
  166. });
  167. }
  168. }
  169. }
  170. </script>
  171. <style lang="scss" scoped>
  172. .z-paging-container {
  173. width: 100%;
  174. height: 100vh;
  175. background: transparent;
  176. }
  177. .scroll-view {
  178. flex: 1;
  179. height: 100%;
  180. /* 关键样式:防止内容被裁剪 */
  181. overflow-anchor: none;
  182. }
  183. .container {
  184. height: 100vh;
  185. display: flex;
  186. flex-direction: column;
  187. }
  188. .loading,
  189. .no-more {
  190. text-align: center;
  191. padding: 20px;
  192. color: #999;
  193. }
  194. .uni-lastmsg {
  195. width: 80rpx;
  196. white-space: nowrap;
  197. overflow: hidden;
  198. text-overflow: ellipsis;
  199. display: block;
  200. /* 需明确设置display */
  201. }
  202. .uni-lastmsg2 {
  203. width: 140rpx;
  204. white-space: nowrap;
  205. overflow: hidden;
  206. text-overflow: ellipsis;
  207. display: block;
  208. /* 需明确设置display */
  209. }
  210. .nav-right {
  211. width: 37rpx;
  212. height: 42rpx;
  213. }
  214. .list {
  215. width: 100%;
  216. .tab-bar-item {
  217. background-color: #fff;
  218. margin-top: 30rpx;
  219. padding: 0rpx 62rpx;
  220. font-size: 28rpx;
  221. line-height: 32rpx;
  222. color: #5F5F5F;
  223. font-weight: 400;
  224. .list-item {
  225. display: flex;
  226. justify-content: space-between;
  227. align-items: center;
  228. width: 100%;
  229. height: 100rpx;
  230. border-bottom: 2px solid #F6F6F6;
  231. }
  232. .list-item-end {
  233. display: flex;
  234. justify-content: space-between;
  235. align-items: center;
  236. width: 100%;
  237. height: 100rpx;
  238. }
  239. }
  240. }
  241. </style>