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.

list.vue 11KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441
  1. <template>
  2. <navBar title="黑名单查询" :scrollTop="scrollTop" navbgClass="nav-bgXin" fontColor='#fff'></navBar>
  3. <view class="guding">
  4. <view class="bg-img">
  5. <image :src="`${$imgUrl}order/bg-order.png`" mode="scaleToFill" class="icon"></image>
  6. </view>
  7. <view class="content">
  8. <view class="title">填写查询条件</view>
  9. <uni-datetime-picker ref="filterDate" v-model="state.range" type="daterange" />
  10. <u-form label-width="230" ref="uForm" :label-style='labelStyle'>
  11. <u-form-item label="黑名单">
  12. <u-input v-model="state.blackTypeStr" type="select" @click="showType = true" input-align='right' />
  13. </u-form-item>
  14. <u-form-item label="黑名单类型">
  15. <u-input v-model="state.typeStr" type="select" @click="show1 = true" input-align='right' />
  16. </u-form-item>
  17. </u-form>
  18. <view class="search-btns">
  19. <button type="default" class="ui-btn search-btn" @click="list(1)" style="width: auto;">
  20. 查询
  21. </button>
  22. <view class="clear-form search-btn" @click="clearFilter">清空</view>
  23. </view>
  24. </view>
  25. </view>
  26. <view class="list-title">查询结果列表</view>
  27. <view style="margin-top: 674rpx;">
  28. <view class="list" v-for="(item,index) in state.tableData" :key="index">
  29. <view class="title" :style="{'--bgimg':`url(${$imgUrl}etcbg.png)`}">
  30. <view class="title_left" v-if="item.status==1">
  31. <image :src="`${$imgUrl}type.png`" mode=""></image>
  32. <text class="question">类型:{{getBlackType(item)}}</text>
  33. </view>
  34. <view class="title_left" v-else>
  35. <image :src="`${$imgUrl}typefb.png`" mode=""></image>
  36. <text class="questionfb">类型:{{getBlackType(item)}}</text>
  37. </view>
  38. <text class="statuszh" v-if="item.status==1">{{ getStatus(item) }}</text>
  39. <text class="statusdbc" v-else>{{ getStatus(item) }}</text>
  40. </view>
  41. <view class="bot">
  42. <view class="details">
  43. <view><text>卡号:</text><view :class="item.status==1?'hei':'fb'">{{item.cardId}}</view></view>
  44. <view><text>下黑时间:</text><view :class="item.status==1?'hei':'fb'">{{item.createTime}}</view></view>
  45. <view><text>下黑原因:</text><view :class="item.status==1?'hei':'fb'">{{item.reasonIn}}</view></view>
  46. <view v-if="item.releaseTime"><text>反白时间:</text><view :class="item.status==1?'hei':'fb'">{{item.releaseTime}}</view></view>
  47. <view v-if="item.reasonOut"><text>反白原因:</text><view :class="item.status==1?'hei':'fb'">{{item.reasonOut}}</view></view>
  48. <view><text>解决方案:</text><view :class="item.status==1?'hei':'fb'">{{item.solution}}</view></view>
  49. </view>
  50. <view style="display: flex;justify-content: flex-end;align-items: flex-end;">
  51. <!-- <text class="button" @click="goInfo(item)">车辆信息变更</text> -->
  52. </view>
  53. </view>
  54. </view>
  55. <view style="text-align: center;margin: 20rpx;font-size: 30rpx;" v-if="state.flags">我是有底线的~</view>
  56. <NoDataView text="暂无黑名单" v-if="state.tableData.length==0"/>
  57. </view>
  58. <!-- 选择车牌状态 -->
  59. <u-select v-model="show1" :list="state.blackStatus" @confirm="changeBlackStatus"></u-select>
  60. <u-select v-model="showType" :list="state.blackTypeMap" @confirm="changeBlackTypeStatus"></u-select>
  61. </template>
  62. <script setup lang="ts">
  63. import { reactive,ref } from "vue";
  64. import { onLoad,onPageScroll,onReachBottom} from "@dcloudio/uni-app";
  65. import { cardBlackListQueryNew } from "@/utils/network/api.js";
  66. import {requestNew } from "@/utils/network/request.js";
  67. import {getItem } from "@/utils/storage";
  68. import navBar from "@/components/nav-bar/nav-bar2.vue";
  69. import {msg} from "@/utils/utils";
  70. import NoDataView from "@/components/no-data-view/no-data-view.vue";
  71. const state = reactive({
  72. tableData: [],
  73. blackStatus: [],
  74. range: ['', ''],
  75. type:"",
  76. typeStr:"",
  77. blackType: "",
  78. blackTypeStr: "",
  79. colorRange:[],
  80. vehicleId:"",
  81. pageNo:1,
  82. pageSize:10,
  83. totalCount:"",
  84. flags: false,
  85. cardblackType: [],
  86. obuBlackType: [],
  87. blackTypeMap: [
  88. {value: 0, label: '卡黑名单'},
  89. {value: 1, label: '签黑名单'},
  90. ]
  91. });
  92. const labelStyle = {
  93. color: "#004576",
  94. fontSize: "28rpx",
  95. }
  96. const show1 = ref(false)
  97. const showType = ref(false)
  98. const scrollTop = ref(0); //滚动距离
  99. const filterDate = ref()
  100. //监听页面滚动
  101. onPageScroll((e) => {
  102. scrollTop.value = e.scrollTop;
  103. });
  104. onLoad((option : any) => {
  105. console.log("option", option)
  106. getBlackStatus() // 获取黑名单那类型
  107. state.vehicleId=option.vehicleId
  108. list(2)
  109. console.log("state.blackStatus",state.blackStatus)
  110. })
  111. const changeBlackStatus = (item) => {
  112. state.type = item[0].value
  113. state.typeStr = item[0].label
  114. console.log(item)
  115. }
  116. const changeBlackTypeStatus = (item) => {
  117. let blackType = state.blackType = item[0].value
  118. state.blackTypeStr = item[0].label
  119. state.type = item[0].value
  120. state.typeStr = ''
  121. if (blackType === 1) {
  122. state.blackStatus = state.obuBlackType
  123. } else {
  124. state.blackStatus = state.cardblackType
  125. }
  126. }
  127. const list = (params) => {
  128. if (params == 1) {
  129. state.pageNo = 1
  130. state.flags=false
  131. }
  132. if (state.pageNo == 1 && state.tableData.length > 0) {
  133. state.tableData = []
  134. }
  135. let blackType = state.blackType
  136. const options = {
  137. type: 2,
  138. data: {
  139. "startTime":state.range[0]?state.range[0]+" 00:00:00":"",
  140. "endTime":state.range[1]?state.range[1]+" 23:59:59":"",
  141. "vehicleId":state.vehicleId,
  142. },
  143. method: 'POST',
  144. showLoading: true,
  145. }
  146. if (blackType == '1') {
  147. options.data['obuBlackType'] = state.type
  148. } else if (blackType == '0') {
  149. options.data['cardBlackType'] = state.type
  150. }
  151. requestNew(cardBlackListQueryNew, options).then((res) => {
  152. console.log("res==",res)
  153. let result = res.results
  154. if (blackType || blackType == '0') {
  155. if (blackType == '1') {
  156. result = result.filter(item => {
  157. return item.obuId
  158. })
  159. } else if (blackType == '0') {
  160. result = result.filter(item => {
  161. return item.cardId
  162. })
  163. }
  164. }
  165. const data =[...state.tableData,...result] ;
  166. state.totalCount = res.totalCount
  167. // status 1 下黑 2反白
  168. for (var i = 0; i < data.length; i++) {
  169. for (var m = 0; m < state.blackStatus.length; m++) {
  170. if (data[i]['type'] == state.blackStatus[m]['value']) {
  171. data[i]['typeC'] = state.blackStatus[m]['label']
  172. break;
  173. }
  174. }
  175. }
  176. state.tableData = data
  177. console.log("圈存金额查询2", state.tableData)
  178. })
  179. }
  180. // 解决问题
  181. const goInfo = (item) => {
  182. }
  183. // 清控筛选
  184. const clearFilter = () => {
  185. state.range = ["", ""]
  186. filterDate.value.clear()
  187. state.type = ""
  188. state.typeStr = ""
  189. state.blackType = ""
  190. state.blackTypeStr = ""
  191. list(1)
  192. }
  193. // 获取卡签的两种黑名单类型
  194. const getBlackStatus = () => {
  195. // 卡黑名单类型
  196. let black = getItem('key')['CARD_BLACK_TYPE'];
  197. for (var k = 0; k < black.length; k++) {
  198. let obj = {};
  199. obj['value'] = black[k]['code']
  200. obj['label'] = black[k]['name']
  201. state.cardblackType.push(obj)
  202. }
  203. // obu黑名单类型
  204. let obu = getItem('key')['OBU_BLACK_TYPE'];
  205. for (var k = 0; k < obu.length; k++) {
  206. let obj = {};
  207. obj['value'] = obu[k]['code']
  208. obj['label'] = obu[k]['name']
  209. state.obuBlackType.push(obj)
  210. }
  211. }
  212. // 获取状态
  213. const getStatus = (item) => {
  214. if (item.cardId) {
  215. if (item.status == 1) {
  216. return '卡下黑'
  217. } else if (item.status == 2) {
  218. return '卡反白'
  219. }
  220. } else if (item.obuId) {
  221. if (item.status == 1) {
  222. return '签下黑'
  223. } else if (item.status == 2) {
  224. return '签反白'
  225. }
  226. }
  227. }
  228. // 获取黑名单类型
  229. const getBlackType = (info) => {
  230. if (info.cardId) {
  231. let type = state.cardblackType.find(item => item.value === info.cardBlackType)
  232. return type ? type.label : ''
  233. } else if (info.obuId) {
  234. let type = state.obuBlackType.find(item => item.value === info.obuBlackType)
  235. return type ? type.label : ''
  236. }
  237. }
  238. onReachBottom(() => {
  239. console.log("触底了", state.pageNo * 10)
  240. if (Number(state.totalCount) == state.tableData.length) return state.flags = true
  241. if (state.tableData.length < state.pageNo * 10) return state.flags = true
  242. console.log("触底了")
  243. state.pageNo++
  244. list(2)
  245. })
  246. </script>
  247. <style>
  248. page {
  249. position: absolute;
  250. }
  251. </style>
  252. <style scoped lang="scss">
  253. .list{
  254. background: #FFFFFF;
  255. border-radius: 12rpx;
  256. border: 1px solid #FFFFFF;
  257. width: 90%;
  258. margin: 0 auto;
  259. font-weight: 400;
  260. margin-bottom: 30rpx;
  261. .title{
  262. padding: 0 20rpx;
  263. display: flex;
  264. justify-content: space-between;
  265. align-items: center;
  266. height: 80rpx;
  267. background-image: var(--bgimg);
  268. background-size: 100% 100%;
  269. background-repeat: no-repeat;
  270. .title_left{
  271. display: flex;
  272. align-items: center;
  273. }
  274. image{
  275. width: 40rpx;
  276. height: 40rpx;
  277. }
  278. .question{
  279. font-size: 30rpx;
  280. color: #01243A;
  281. margin-left: 16rpx;
  282. }
  283. .questionfb{
  284. font-size: 30rpx;
  285. color: #666666;
  286. margin-left: 10rpx;
  287. }
  288. // 在黑
  289. .statuszh{
  290. font-size: 26rpx;
  291. color: #CCB375;
  292. }
  293. // 已反白
  294. .statusdbc{
  295. font-size: 26rpx;
  296. color: #999999;
  297. }
  298. }
  299. .bot{
  300. padding: 0 20rpx;
  301. .details{
  302. font-size: 26rpx;
  303. padding: 10rpx 0;
  304. border-bottom: 1rpx solid #DCDCDC;
  305. view{
  306. display: flex;
  307. margin-bottom: 8rpx;
  308. text{
  309. color: #999999;
  310. width: 21%;
  311. }
  312. .hei{
  313. color: #002025;
  314. width: 79%;
  315. }
  316. .fb{
  317. color: #666666;
  318. width: 79%;
  319. }
  320. }
  321. }
  322. .time{
  323. font-size: 24rpx;
  324. color: #999999;
  325. padding:20rpx 0;
  326. border-top: 1rpx solid #DCDCDC;
  327. }
  328. }
  329. }
  330. </style>
  331. <style scoped>
  332. .bg-img {
  333. width: 100%;
  334. position: absolute;
  335. z-index:0;
  336. }
  337. .icon {
  338. width: 100%;
  339. height: 534rpx;
  340. }
  341. .content {
  342. position: relative;
  343. color: white;
  344. padding:30rpx ;
  345. background-color: white;
  346. width: 90%;
  347. margin: 0 auto;
  348. margin-top: 200rpx;
  349. border-radius: 12rpx;
  350. box-sizing: border-box;
  351. }
  352. .title {
  353. font-weight: 400;
  354. font-size: 30rpx;
  355. color: #01243A;
  356. margin-bottom: 20rpx;
  357. }
  358. .no {
  359. text-align: center;
  360. padding-top: 100rpx;
  361. }
  362. /deep/.uni-date-editor--x{
  363. background: #ECF1F4;
  364. }
  365. /deep/.uni-date-x {
  366. background: #ECF1F4 ;
  367. height: 68rpx !important;
  368. }
  369. /deep/.uni-date__x-input {
  370. font-size: 12px;
  371. }
  372. /deep/.u-form-item--right{
  373. background: #ECF1F4;
  374. padding: 4rpx 10rpx;
  375. border-radius: 10rpx;
  376. }
  377. .list-title{
  378. font-weight: bold;
  379. margin: 30rpx 40rpx;
  380. }
  381. .button{
  382. background: linear-gradient(90deg, #CCB375 0%, #E7D398 100%);
  383. border-radius: 40rpx;
  384. font-size: 30rpx;
  385. font-weight: 400;
  386. color: #fff !important;
  387. padding: 15rpx 25rpx;
  388. margin: 10rpx 0;
  389. }
  390. .guding{
  391. position: fixed;
  392. width: 100%;
  393. }
  394. .search-btns{
  395. display: flex;
  396. justify-content: space-between;
  397. }
  398. .search-btns .search-btn{
  399. flex: 1;
  400. margin: 0 12rpx;
  401. }
  402. .clear-form{
  403. color: #004576;
  404. line-height: 80rpx;
  405. text-align: center;
  406. font-size: 30rpx;
  407. border: 1px #004576 solid;
  408. border-radius: 80rpx;
  409. padding: 0 28rpx;
  410. }
  411. </style>