Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

progress-query-business.vue 8.0KB

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