You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

cancell-refund.vue 6.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297
  1. <template>
  2. <view class="content">
  3. <view class="top-content">
  4. <view class="input">
  5. <text>车牌号:</text>
  6. <input placeholder="请输入车牌号" v-model="state.vehiclePlate" />
  7. </view>
  8. <view class="item last">
  9. <text>车牌颜色:</text>
  10. <uni-data-select v-model="state.vehiclePlateColor" :localdata="state.colorRange" @change="changeColor"
  11. :clear="false"></uni-data-select>
  12. <button size="mini" style="color: #ffffff;
  13. background-color: rgb(118, 200, 77);
  14. border-color: rgb(118, 200, 77);
  15. font-size: 26rpx;
  16. flex-shrink: 0;margin-left: 30rpx;" @click="search(1)">搜索</button>
  17. </view>
  18. </view>
  19. <view class="uni-container">
  20. <view class="list-item" v-for="(item,index) in state.listData">
  21. <view>
  22. <view><text>车牌号:</text><text>{{item.vehiclePlate}}</text></view>
  23. <view><text>金额:</text><text>{{item.amount/100}}元</text></view>
  24. <view v-if="item.cardId"><text>卡号:</text><text>{{item.cardId}}</text></view>
  25. <view><text>单号:</text><text>{{item.orderNo}}</text></view>
  26. <view><text>状态:</text><text>{{item.statusC}}</text></view>
  27. <view><text>退费类型:</text><text>{{item.businessPortC}}</text></view>
  28. <view><text>创建时间:</text><text>{{item.insertTime}}</text></view>
  29. <view><text>审核时间:</text><text>{{item.updateTime}}</text></view>
  30. </view>
  31. </view>
  32. <view style="text-align: center;" v-if="state.noData">暂无数据</view>
  33. </view>
  34. <view class="bottom-line" v-if="state.flags">我是有底线的~~~</view>
  35. </view>
  36. </template>
  37. <script setup lang="ts">
  38. import { reactive } from "vue";
  39. import {
  40. msg
  41. } from "@/utils/utils";
  42. import {
  43. businessType
  44. } from "@/subpackage/after-sale/js/businessType.js"
  45. import { onLoad, onReachBottom } from "@dcloudio/uni-app";
  46. import { cancellRefoundApi } from "@/utils/network/api.js";
  47. import { stringToJson } from "@/utils/network/encryption";
  48. import { request } from "@/utils/network/request.js";
  49. import { getItem, StorageKeys } from "@/utils/storage";
  50. const state = reactive({
  51. startTime: Date.now(), //日期
  52. colorRange: [],
  53. listData: [],
  54. range: ['', ''],
  55. pageSize: 10, //每页数据量
  56. pageNo: 1, // 当前页
  57. total: 0, // 数据总量
  58. flags: false,
  59. vehiclePlate: "",
  60. vehiclePlateColor: "",
  61. statusArr: [],//状态
  62. refundBusinessArr: [],
  63. noData: false //是否有数据
  64. })
  65. onLoad((option) => {
  66. let getColor = getItem('key')['VEHICLE_COLOR_TYPE'];
  67. for (var k = 0; k < getColor.length; k++) {
  68. let obj = {};
  69. obj['value'] = getColor[k]['code']
  70. obj['text'] = getColor[k]['name']
  71. state.colorRange.push(obj)
  72. }
  73. // REFUND_STATUS 退费管理-退费状
  74. let getStatus = getItem('key')['REFUND_STATUS'];
  75. for (var k = 0; k < getStatus.length; k++) {
  76. let obj = {};
  77. obj['value'] = getStatus[k]['code']
  78. obj['text'] = getStatus[k]['name']
  79. state.statusArr.push(obj)
  80. }
  81. console.log("state.statusArr", state.statusArr)
  82. // REFUND_BUSINESS 退费管理-退费业务类型
  83. let refundBusiness = getItem('key')['REFUND_BUSINESS'];
  84. for (var k = 0; k < refundBusiness.length; k++) {
  85. let obj = {};
  86. obj['value'] = refundBusiness[k]['code']
  87. obj['text'] = refundBusiness[k]['name']
  88. state.refundBusinessArr.push(obj)
  89. }
  90. })
  91. const changeColor = (e) => {
  92. state.vehiclePlateColor = e
  93. console.log(e)
  94. }
  95. //业务完成日志
  96. const search = (val) => {
  97. if (!state.vehiclePlate) {
  98. msg("请输入车牌号")
  99. return;
  100. }
  101. if (!state.vehiclePlateColor) {
  102. msg("请选择车牌颜色")
  103. return;
  104. }
  105. if (val == 1) {
  106. state.pageNo = 1
  107. }
  108. if (state.pageNo == 1 && state.listData.length > 0) {
  109. state.listData = []
  110. }
  111. var data = {
  112. vehicleId: state.vehiclePlate + "_" + state.vehiclePlateColor,
  113. pageNo: state.pageNo,
  114. pageSize: state.pageSize,
  115. };
  116. const options = {
  117. type: 2,
  118. data: data,
  119. method: "POST",
  120. showLoading: true,
  121. };
  122. request(cancellRefoundApi, options).then((res) => {
  123. const data = stringToJson(res.bizContent);
  124. console.log("getData", data)
  125. if (data.totalCount == 0) {
  126. state.noData = true
  127. } else {
  128. state.noData = false
  129. }
  130. if (data.data) {
  131. var getData = [...stringToJson(res.bizContent).data, ...state.listData]
  132. for (var i = 0; i < getData.length; i++) {
  133. for (var m = 0; m < state.statusArr.length; m++) {
  134. if (getData[i]['status'] == state.statusArr[m]['value']) {
  135. getData[i]['statusC'] = state.statusArr[m]['text']
  136. break;
  137. }
  138. }
  139. for (var m = 0; m < state.refundBusinessArr.length; m++) {
  140. if (getData[i]['businessPort'] == state.refundBusinessArr[m]['value']) {
  141. getData[i]['businessPortC'] = state.refundBusinessArr[m]['text']
  142. break;
  143. }
  144. }
  145. }
  146. state.listData = getData
  147. state.total = state.listData.length
  148. }
  149. });
  150. }
  151. // 触底加载
  152. onReachBottom(() => {
  153. if (state.listData.length < state.pageNo * 10) return state.flags = true
  154. console.log("触底了")
  155. state.pageNo++
  156. search(2)
  157. })
  158. </script>
  159. <style scoped>
  160. .top-content {
  161. position: fixed;
  162. left: 0;
  163. top: 0;
  164. background-color: white;
  165. width: 100%;
  166. padding: 0 20rpx 20rpx 20rpx;
  167. box-sizing: border-box;
  168. z-index: 999999;
  169. }
  170. .content {
  171. font-size: 32rpx;
  172. padding: 20rpx 30rpx;
  173. background-color: #EEF7F7;
  174. min-height: 100vh;
  175. }
  176. .card {
  177. display: flex;
  178. margin: 0 20rpx;
  179. align-items: center;
  180. }
  181. .title {
  182. margin-bottom: 20rpx;
  183. }
  184. .uni-container {
  185. margin: 50rpx 0;
  186. margin-top: 180rpx;
  187. }
  188. /deep/.uni-table-th,
  189. /deep/.uni-table-td {
  190. padding: 0 !important;
  191. font-size: 12px !important;
  192. }
  193. /deep/.uni-date__x-input,
  194. /deep/.uni-select {
  195. font-size: 13px;
  196. height: 24px;
  197. line-height: 24px;
  198. }
  199. /deep/.last .uni-stat__select {
  200. width: 360rpx;
  201. }
  202. /deep/.uni-select__selector-empty,
  203. /deep/.uni-select__selector-item {
  204. font-size: 13px !important;
  205. }
  206. /deep/.uni-date {
  207. width: 73% !important;
  208. }
  209. .example-body {
  210. display: flex;
  211. align-items: center;
  212. margin-top: 20rpx;
  213. }
  214. /deep/.uni-date-x {
  215. height: 56rpx !important;
  216. }
  217. .list-item {
  218. width: 95%;
  219. border-radius: 10rpx;
  220. margin: 30rpx auto;
  221. font-size: 28rpx;
  222. border: 1rpx solid #ccc;
  223. padding: 12rpx;
  224. box-sizing: border-box;
  225. background-color: white;
  226. display: flex;
  227. align-items: center;
  228. }
  229. .list-item>view {
  230. margin-bottom: 10rpx;
  231. width: 90%;
  232. }
  233. .list-item>view>view>text:first-child {
  234. width: 25%;
  235. display: inline-block;
  236. }
  237. .list-item>view>view>text:last-child {
  238. width: 75%;
  239. display: inline-block;
  240. }
  241. .bottom-line {
  242. text-align: center;
  243. margin: 30rpx 0;
  244. }
  245. .item {
  246. display: flex;
  247. font-size: 30rpx;
  248. margin-top: 20rpx;
  249. align-items: center;
  250. }
  251. input,
  252. .uni-input {
  253. border: 1rpx solid #ccc;
  254. padding: 0 10rpx;
  255. height: 28rpx;
  256. line-height: 28rpx;
  257. }
  258. .input {
  259. display: flex;
  260. align-items: center;
  261. }
  262. .input>input {
  263. width: 47%;
  264. margin-top: 10rpx;
  265. font-size: 30rpx;
  266. margin-left: 20rpx;
  267. }
  268. </style>