Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

progress-query-business.vue 7.7KB

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