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.7KB

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