Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

progress-query-business.vue 7.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303
  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 "@/subpackage/after-sale/js/businessType.js"
  39. import { onLoad, onReachBottom } from "@dcloudio/uni-app";
  40. import { auditQueryApi,generalAuditQuery } from "@/utils/network/api.js";
  41. import { stringToJson } from "@/utils/network/encryption";
  42. import { request, requestNew } 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. requestNew(generalAuditQuery, options).then((res) => {
  134. const data = res;
  135. console.log("data====",data)
  136. var getData = [...data.result, ...state.listData]
  137. for (var i = 0; i < getData.length; i++) {
  138. getData[i]['vehiclePlateColorC'] = getVehiclePlateColorPai(getData[i]['vehiclePlateColor'])
  139. if (getData[i]['status'] == 'AUDIT') {
  140. getData[i]['statusC'] = "审核中"
  141. } else if (getData[i]['status'] == 'FAIL') {
  142. getData[i]['statusC'] = "未通过"
  143. } else if (getData[i]['status'] == 'COMPLETE') {
  144. getData[i]['statusC'] = "审核通过"
  145. }
  146. for (var m = 0; m < state.businessRange.length; m++) {
  147. if (getData[i]['businessType'] == state.businessRange[m]['value']) {
  148. getData[i]['businessTypeC'] = state.businessRange[m]['text']
  149. break;
  150. }
  151. }
  152. }
  153. state.listData = getData
  154. state.total = data.result.length
  155. if (state.listData.length > 0) {
  156. state.noData = false
  157. } else {
  158. state.noData = true
  159. }
  160. console.log("业务完成日志", state.listData, state.pageNo,)
  161. });
  162. }
  163. const change = (e) => {
  164. console.log("e", e)
  165. state.pageNo = e.current
  166. search(2)
  167. }
  168. // 触底加载
  169. onReachBottom(() => {
  170. if (state.listData.length < state.pageNo * 10) return state.flags = true
  171. console.log("触底了")
  172. state.pageNo++
  173. search(2)
  174. })
  175. const go = (item) => {
  176. const params = encodeURIComponent(JSON.stringify(item))
  177. uni.navigateTo({
  178. url: `/subpackage/after-sale/progress-query/progress-query-business-details?params=${params}`
  179. })
  180. }
  181. </script>
  182. <style scoped>
  183. .top-content {
  184. position: fixed;
  185. left: 0;
  186. top: 0;
  187. background-color: white;
  188. width: 100%;
  189. padding: 0 20rpx 20rpx 20rpx;
  190. box-sizing: border-box;
  191. z-index: 999999;
  192. height: 170rpx;
  193. }
  194. .content {
  195. font-size: 32rpx;
  196. padding: 20rpx 30rpx;
  197. background-color: #EEF7F7;
  198. min-height: calc(100vh - 40rpx);
  199. }
  200. .card {
  201. display: flex;
  202. margin: 0 20rpx;
  203. align-items: center;
  204. }
  205. .title {
  206. margin-bottom: 20rpx;
  207. }
  208. .uni-container {
  209. margin: 50rpx 0;
  210. margin-top: 180rpx;
  211. }
  212. /deep/.uni-table-th,
  213. /deep/.uni-table-td {
  214. padding: 0 !important;
  215. font-size: 12px !important;
  216. }
  217. /deep/.uni-date__x-input,
  218. /deep/.uni-select {
  219. font-size: 13px;
  220. height: 24px;
  221. line-height: 24px;
  222. }
  223. /deep/.last .uni-stat__select {
  224. width: 320rpx;
  225. }
  226. /deep/.uni-select__selector-empty,
  227. /deep/.uni-select__selector-item {
  228. font-size: 13px !important;
  229. }
  230. /deep/.uni-date {
  231. width: 73% !important;
  232. }
  233. .example-body {
  234. display: flex;
  235. align-items: center;
  236. margin-top: 20rpx;
  237. }
  238. /deep/.uni-date-x {
  239. height: 56rpx !important;
  240. }
  241. .list-item {
  242. width: 95%;
  243. border-radius: 10rpx;
  244. margin: 30rpx auto;
  245. font-size: 28rpx;
  246. border: 1rpx solid #ccc;
  247. padding: 12rpx;
  248. box-sizing: border-box;
  249. background-color: white;
  250. display: flex;
  251. align-items: center;
  252. }
  253. .list-item>view {
  254. margin-bottom: 10rpx;
  255. width: 90%;
  256. }
  257. .bottom-line {
  258. text-align: center;
  259. margin: 30rpx 0;
  260. }
  261. .item {
  262. display: flex;
  263. font-size: 30rpx;
  264. margin: 20rpx 0 0 20rpx;
  265. align-items: center;
  266. }
  267. input,
  268. .uni-input {
  269. border: 1rpx solid #ccc;
  270. padding: 0 10rpx;
  271. height: 28rpx;
  272. line-height: 28rpx;
  273. }
  274. .right {
  275. width: 40rpx;
  276. height: 40rpx;
  277. transform: rotateY(180deg);
  278. }
  279. </style>