the_fuel_filling.vue 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418
  1. <template>
  2. <view>
  3. <view class="content">
  4. <view class="content1-top">
  5. <view class="top2">
  6. <view class="left">
  7. <view @click='tabcarchange(0)' class='line' :class='searchType==0?"active":""'>全部</view>
  8. <view @click='tabcarchange(1)' class='line' :class='searchType==1?"active":""'>未完成</view>
  9. <view @click='tabcarchange(3)' class='line' :class='searchType==3?"active":""'>已完成</view>
  10. </view>
  11. <view class="right uni-button">
  12. <button style="line-height: 28px;" class="right-contrent1" @click="trackAddition">添加</button>
  13. </view>
  14. </view>
  15. </view>
  16. </view>
  17. <mescroll-body ref="mescrollRef" :down="downOption" @down="downCallback" @up="upCallback">
  18. <view v-for="(item,index) in fuelFilling" :key="index" @click.stop="getInfo(item)">
  19. <view class="good-list">
  20. <view style="padding: 0 35rpx 20rpx 35rpx;position: relative;">
  21. <view class="flex top">
  22. <view class="flex left">
  23. <view class="item1">
  24. <view class="ssx">{{$helper.getProvinceAbbreviation(item.originProvince)}}</view>
  25. <view class="level2-title" style="font-size: 14px;">
  26. {{$helper.filterUrban(item.originCity)}}
  27. {{$helper.filterArea(item.originArea)}}
  28. </view>
  29. </view>
  30. <image class="jt-icon item2" src="@/static/images/fuel/jt.png" mode='widthFix'>
  31. </image>
  32. <view class="item3">
  33. <view class="ssx">{{$helper.getProvinceAbbreviation(item.destinationProvince)}}
  34. </view>
  35. <view class="level2-title">{{$helper.filterUrban(item.destinationCity)}}
  36. {{$helper.filterArea(item.destinationArea)}}
  37. </view>
  38. </view>
  39. </view>
  40. <view class="flex">
  41. <view class="audit1" v-if="item.travelStatus == '已开始'">已开始</view>
  42. <view class="audit2" v-if="item.travelStatus == '已结束'">{{item.status?item.status:'已结束'}}
  43. </view>
  44. <view class="audit3" v-if="item.travelStatus == '已报销'">已报销</view>
  45. </view>
  46. </view>
  47. <view class="car-info">
  48. <view class="car-num">车牌号 : {{item.carNo}}</view>
  49. <view class="car-date">{{item.createDate.split(" ")[0]}}</view>
  50. </view>
  51. <view v-if='item.tfc&&item.totalCost' class="car-yh">
  52. <view class="row">
  53. 总油耗
  54. <view class="text">
  55. {{item.tfc}}L
  56. </view>
  57. </view>
  58. <view class="row">
  59. 总价
  60. <view class="text">
  61. {{item.totalCost}}元
  62. </view>
  63. </view>
  64. </view>
  65. <view class="see" v-if="item.status=='已申请'" @click.stop="seeInfo(item.id)">
  66. <view class="btn">
  67. 查看
  68. </view>
  69. </view>
  70. </view>
  71. </view>
  72. </view>
  73. </mescroll-body>
  74. </view>
  75. </template>
  76. <script>
  77. import MescrollMixin from "@/components/mescroll-uni/mescroll-mixins.js";
  78. export default {
  79. mixins: [MescrollMixin],
  80. data() {
  81. return {
  82. downOption: {
  83. auto: false //是否在初始化后,自动执行downCallback; 默认true
  84. },
  85. searchType: 0,
  86. // fuelFilling: [{
  87. // destinationProvince: "辽宁省",
  88. // destinationCity: "营口市",
  89. // destinationArea: "鲅鱼圈区",
  90. // destinationAddress: '鲅鱼圈5号门',
  91. // carNo: "辽H11111",
  92. // originProvince: "辽宁省",
  93. // originCity: "营口",
  94. // originArea: "鲅鱼圈区",
  95. // originAddress: '中天昊元',
  96. // createDate: "2022-01-01 15:30:20",
  97. // travelStatus: "已开始",
  98. // totalCost: "233.20",
  99. // tfc: "60L"
  100. // }],
  101. fuelFilling: [],
  102. }
  103. },
  104. onShow() {
  105. // this.getList()
  106. },
  107. methods: {
  108. seeInfo(id) {
  109. uni.navigateTo({
  110. url: '/pages/fuelfilling/apply_see_reimbursement?id=' + id
  111. })
  112. },
  113. /*下拉刷新的回调 */
  114. downCallback() {
  115. this.getList(10, 1, 'down')
  116. },
  117. /*上拉加载的回调: 其中page.num:当前页 从1开始, page.size:每页数据条数,默认10 */
  118. upCallback(page) {
  119. //联网加载数据
  120. this.getList(page.size, page.num, 'up')
  121. },
  122. tabcarchange(searchType) {
  123. this.searchType = searchType
  124. this.getList(10, 1, 'down')
  125. },
  126. trackAddition() {
  127. uni.navigateTo({
  128. url: '/pages/fuelfilling/track_addition'
  129. })
  130. },
  131. getList(size, page, type) {
  132. this.$api.doRequest('get', '/fuelFillingInfo/selectFilling', {
  133. pageSize: size,
  134. currentPage: page,
  135. // pcFlag: 0,
  136. searchType: this.searchType,
  137. compId: uni.getStorageSync('pcUserInfo').compId,
  138. commonId: uni.getStorageSync('pcUserInfo').userId,
  139. }).then(res => {
  140. debugger
  141. if (res.data.code == 200) {
  142. if (type == 'down') {
  143. this.mescroll.endSuccess();
  144. this.fuelFilling = []
  145. } else {
  146. this.mescroll.endBySize(res.data.data.records.length, res.data.data.records
  147. .length); //必传参数(当前页的数据个数, 总数据量)
  148. }
  149. this.fuelFilling = this.fuelFilling.concat(res.data.data.records)
  150. }
  151. })
  152. },
  153. getInfo(item) {
  154. if (item.travelStatus == '已报销') {
  155. return
  156. } else {
  157. uni.navigateTo({
  158. url: '/pages/fuelfilling/track_addition?id=' + item.id
  159. })
  160. }
  161. },
  162. }
  163. }
  164. </script>
  165. <style lang="scss" scoped>
  166. .content {
  167. padding-bottom: 50rpx;
  168. }
  169. .tag {
  170. background: #F5F6F9;
  171. padding: 5px;
  172. color: #333333;
  173. display: inline-flex;
  174. font-size: 22rpx;
  175. border-radius: 3px;
  176. margin: 3px;
  177. }
  178. .introduce-section .title {
  179. justify-content: space-between;
  180. align-items: flex-start;
  181. }
  182. .introduce-section .title text {
  183. font-size: 28rpx;
  184. }
  185. .introduce-section .title .title-tip {
  186. flex: 1;
  187. font-size: 28rpx;
  188. color: #FE6430;
  189. font-weight: 500;
  190. height: 50px;
  191. line-height: 50px;
  192. border-bottom: 1px solid #EEEEEE;
  193. }
  194. .introduce-section .title .title-tip-a {
  195. flex: 1;
  196. font-size: 15px;
  197. color: #AFB3BF;
  198. font-weight: 500;
  199. height: 50px;
  200. line-height: 50px;
  201. border-bottom: 1px solid #EEEEEE;
  202. }
  203. .line {
  204. display: inline-block;
  205. padding: 5px;
  206. position: relative;
  207. font-size: 17px;
  208. }
  209. .line.active {
  210. font-size: 19px;
  211. font-weight: 900;
  212. }
  213. .line.active:after {
  214. content: '';
  215. display: block;
  216. position: absolute;
  217. width: 18px;
  218. left: 50%;
  219. transform: translateX(-50%);
  220. bottom: 0;
  221. border-bottom: 3px solid #22C572;
  222. }
  223. /deep/.u-action-active {
  224. margin-right: 6px;
  225. }
  226. .content1-top {
  227. background: white;
  228. padding: 10px 16px 0 10px;
  229. border-radius: 0 0 15px 15px;
  230. padding-bottom: 10px;
  231. }
  232. .top2 {
  233. display: flex;
  234. align-items: center;
  235. justify-content: space-between;
  236. .right.uni-button {
  237. display: flex;
  238. align-items: center;
  239. font-weight: normal;
  240. .right-contrent1 {
  241. background: #22C572;
  242. height: 25px;
  243. font-size: 14px;
  244. color: #fff;
  245. }
  246. }
  247. }
  248. .good-list {
  249. background-color: white;
  250. margin: -10px 10px 20px 10px;
  251. padding: 20px 0px 8px 0px;
  252. border-radius: 30rpx;
  253. box-shadow: 0px 5rpx 20rpx #E3E3E3;
  254. .item1,
  255. .item3 {
  256. // width: 40%;
  257. display: flex;
  258. .text {
  259. text-overflow: ellipsis;
  260. overflow: hidden;
  261. white-space: nowrap;
  262. }
  263. }
  264. .item1 .text {
  265. text-align: left;
  266. }
  267. .item3 .text {
  268. text-align: right;
  269. }
  270. }
  271. .xf-iamge {
  272. width: 74rpx;
  273. height: 43rpx;
  274. position: absolute;
  275. top: -20rpx;
  276. right: 0;
  277. }
  278. .level2-title {
  279. font-size: 28rpx;
  280. }
  281. .jt-icon {
  282. position: relative;
  283. top: 6rpx;
  284. width: 60rpx;
  285. margin: 0 20rpx;
  286. }
  287. .ssx {
  288. width: 20px;
  289. height: 20px;
  290. background: linear-gradient(180deg, #C8D7E5 0%, #AFC1D6 100%);
  291. font-size: 13px;
  292. font-family: PingFangSC-Medium, PingFang SC;
  293. font-weight: 500;
  294. color: #FFFFFF;
  295. border-radius: 50%;
  296. display: flex;
  297. justify-content: center;
  298. align-items: center;
  299. margin-right: 5px;
  300. }
  301. .level2-title {
  302. font-weight: 700;
  303. color: #000000;
  304. }
  305. .wenzi {
  306. text-align: right;
  307. border-radius: 10rpx;
  308. // margin-right: 30rpx;
  309. height: 10rpx;
  310. padding: 10px 0px 5px 128px;
  311. }
  312. .audit1 {
  313. color: #22C572;
  314. }
  315. .audit2 {
  316. color: #22C572;
  317. }
  318. .audit3 {
  319. color: #AFB3BF;
  320. }
  321. .top {
  322. justify-content: space-between;
  323. align-items: center;
  324. .left {
  325. align-items: center;
  326. }
  327. }
  328. .car-info {
  329. background: #F9F9FA;
  330. padding: 20rpx;
  331. display: flex;
  332. border-radius: 20rpx;
  333. flex-direction: column;
  334. .car-num {
  335. font-size: 26rpx;
  336. font-weight: 700;
  337. }
  338. .car-date {
  339. margin-top: 10rpx;
  340. color: #878C9C;
  341. }
  342. }
  343. .car-yh {
  344. display: flex;
  345. justify-content: flex-end;
  346. margin-top: 20rpx;
  347. .row {
  348. display: flex;
  349. align-items: center;
  350. .text {
  351. font-weight: 700;
  352. margin: 0 20rpx;
  353. }
  354. }
  355. }
  356. .see {
  357. display: flex;
  358. justify-content: flex-end;
  359. .btn {
  360. display: flex;
  361. justify-content: center;
  362. align-items: center;
  363. background: #FFFFFF;
  364. border-radius: 33px;
  365. border: 1px solid #CDCDCD;
  366. padding: 15rpx 40rpx;
  367. box-sizing: border-box;
  368. margin-top: 20rpx;
  369. }
  370. }
  371. </style>