itemDetails.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226
  1. <template>
  2. <view>
  3. <!-- <uni-notice-bar v-if='dataList.length' text="左滑删除单据,删除后可返回注册页重新生成" /> -->
  4. <view class="list" style="margin-bottom: 30rpx;" v-for="(item, index) in dataList" :key="index">
  5. <u-empty v-if='dataList.length==0' mode="data">
  6. </u-empty>
  7. <view class="tab-bar-item" style="margin-top: 30rpx;" @click="inEdit(item)">
  8. <view class="list-item">
  9. <view style="font-weight: 800;">
  10. {{item.insuranceNo}}
  11. </view>
  12. <view style="color: #B5B4B4;display:flex;align-items:center;">
  13. {{formatCustom(item.claimDate,'YYYY-MM-DD')}}
  14. </view>
  15. </view>
  16. <view class="list-item">
  17. <view class="">
  18. {{item.tireDescription||'暂无描述'}}
  19. </view>
  20. <view class="">
  21. 保单号:{{item.claimNo||'暂无保单号'}}
  22. </view>
  23. </view>
  24. <view class="list-item-end">
  25. <view class="">
  26. 理赔原因:{{item.claimReason||'暂无原因'}}
  27. </view>
  28. <view style="display: flex;align-items: center;color: #03803B;">
  29. <image style="width: 32rpx;height: 32rpx;margin-right: 18rpx;"
  30. src="@/static/images/home/insurance/ap.png" />
  31. <text v-if="item.auditStatus==0" style="color:#e6a23c">
  32. 待审核
  33. </text>
  34. <text v-if="item.auditStatus==1" style="color:#409EFF">
  35. 审核中
  36. </text>
  37. <text v-if="item.auditStatus==2" style="color:#67c23a">
  38. 已通过
  39. </text>
  40. <text v-if="item.auditStatus==3" style="color:#f56c6c">
  41. 已拒绝
  42. </text>
  43. </view>
  44. </view>
  45. </view>
  46. </view>
  47. </view>
  48. </template>
  49. <script>
  50. import {
  51. formatDate,
  52. relativeTime
  53. } from '@/utils/formatDate.js'
  54. import {
  55. itemList,
  56. revokeApproval
  57. } from '@/api/home/insurance.js'
  58. export default {
  59. data() {
  60. return {
  61. dataList: [],
  62. optionId: null
  63. }
  64. },
  65. onLoad(option) {
  66. console.log(option)
  67. if (option && option.id) {
  68. this.optionId = option.id
  69. this.itemList()
  70. }
  71. },
  72. onPullDownRefresh() {
  73. this.itemList()
  74. setTimeout(function() {
  75. uni.stopPullDownRefresh();
  76. }, 500);
  77. },
  78. methods: {
  79. onClick(e) {
  80. console.log(e)
  81. },
  82. inEdit(row) {
  83. uni.navigateTo({
  84. url: '/pages/home/claim/details?id=' + row.claimId,
  85. });
  86. },
  87. inDel(row) {
  88. if (row.auditStatus == 1) {
  89. uni.showToast({
  90. title: '审核中状态不允许删除',
  91. icon: 'none',
  92. duration: 2000
  93. });
  94. return
  95. }
  96. if (row.auditStatus == 2) {
  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. setTimeout(() => {
  119. uni.showToast({
  120. title: '操作成功',
  121. icon: 'none',
  122. duration: 2000
  123. });
  124. }, 10);
  125. _this.itemList(row.insuranceId)
  126. })
  127. .finally(() => {
  128. uni.hideLoading()
  129. });
  130. }
  131. }
  132. });
  133. },
  134. formatCustom(date, format) {
  135. return formatDate(date, format)
  136. },
  137. itemList() {
  138. const obj = {
  139. insuranceId: this.optionId
  140. }
  141. this.loading = true
  142. uni.showLoading({
  143. title: '加载中',
  144. mask: true
  145. });
  146. itemList(obj).then(res => {
  147. this.dataList = res.data
  148. })
  149. .finally(() => {
  150. uni.hideLoading()
  151. });
  152. }
  153. }
  154. }
  155. </script>
  156. <style lang="scss" scoped>
  157. ::v-deep .uni-noticebar__content-text{
  158. font-size: 24rpx !important;
  159. }
  160. ::v-deep .uni-noticebar {
  161. padding: 10rpx 62rpx !important;
  162. text-align: right;
  163. }
  164. .loading,
  165. .no-more {
  166. text-align: center;
  167. padding: 20px;
  168. color: #999;
  169. }
  170. .uni-lastmsg {
  171. width: 80rpx;
  172. white-space: nowrap;
  173. overflow: hidden;
  174. text-overflow: ellipsis;
  175. display: block;
  176. /* 需明确设置display */
  177. }
  178. .uni-lastmsg2 {
  179. width: 140rpx;
  180. white-space: nowrap;
  181. overflow: hidden;
  182. text-overflow: ellipsis;
  183. display: block;
  184. /* 需明确设置display */
  185. }
  186. .nav-right {
  187. width: 37rpx;
  188. height: 42rpx;
  189. }
  190. .list {
  191. width: 100%;
  192. .tab-bar-item {
  193. background-color: #fff;
  194. padding: 0rpx 62rpx;
  195. font-size: 28rpx;
  196. line-height: 32rpx;
  197. color: #5F5F5F;
  198. font-weight: 400;
  199. .list-item {
  200. display: flex;
  201. justify-content: space-between;
  202. align-items: center;
  203. width: 100%;
  204. height: 100rpx;
  205. border-bottom: 2px solid #F6F6F6;
  206. }
  207. .list-item-end {
  208. display: flex;
  209. justify-content: space-between;
  210. align-items: center;
  211. width: 100%;
  212. height: 100rpx;
  213. }
  214. }
  215. }
  216. </style>