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.

progress-query-business.vue 7.2KB

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