Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

progress-query-business.vue 7.5KB

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