the_fuel_filling.vue 10.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467
  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" @init="mescrollInit">
  18. <view v-for="(item,index) in fuelFilling" :key="index">
  19. <view class="good-list">
  20. <view style="padding: 0 35rpx 20rpx 35rpx;position: relative;">
  21. <view class="flex top">
  22. <view class="flex">
  23. <view class="audit1">{{item.approveStatus?item.approveStatus:item.status}}</view>
  24. </view>
  25. </view>
  26. <view class="car-info">
  27. <view class="car-num">车牌号 : {{item.carNo}}</view>
  28. <view class="car-date">{{item.createDate}}</view>
  29. </view>
  30. <view class="car-yh">
  31. <view class="row">
  32. 油耗
  33. <view class="text">
  34. {{item.fillingDetailInfo?item.fillingDetailInfo.oilConsumption:''}}L
  35. </view>
  36. </view>
  37. <!-- <view class="row">
  38. 油价
  39. <view class="text">
  40. {{item.fillingDetailInfo.currentOilPrice}}元
  41. </view>
  42. </view> -->
  43. <view class="row">
  44. 申请费用
  45. <view class="text">
  46. {{item.fillingDetailInfo?item.fillingDetailInfo.currentConsumption:''}}元
  47. </view>
  48. </view>
  49. </view>
  50. <view class="see">
  51. <view class="btn" @click.stop="seeInfo(item.id)"
  52. v-if="item.approveStatus=='待加油审批'||item.status=='已通过'||item.status=='已驳回'">
  53. 查看
  54. </view>
  55. <view class="btn" @click.stop="backInfo(item)" v-if="item.approveStatus=='待加油审批'">
  56. 撤回
  57. </view>
  58. <view class="btn" @click.stop="editInfo(item.id)"
  59. v-if="item.approveStatus=='发起人撤回'||item.status=='已驳回'">
  60. 编辑
  61. </view>
  62. <view class="btn" @click.stop="delInfo(item.id)"
  63. v-if="item.approveStatus=='发起人撤回'||item.status=='已驳回'">
  64. 删除
  65. </view>
  66. </view>
  67. </view>
  68. </view>
  69. </view>
  70. </mescroll-body>
  71. </view>
  72. </template>
  73. <script>
  74. import MescrollMixin from "@/components/mescroll-uni/mescroll-mixins.js";
  75. export default {
  76. mixins: [MescrollMixin],
  77. data() {
  78. return {
  79. canReset: "",
  80. mescroll: null,
  81. downOption: {
  82. auto: false //是否在初始化后,自动执行downCallback; 默认true
  83. },
  84. searchType: 0,
  85. fuelFilling: [],
  86. }
  87. },
  88. onShow() {
  89. // this.mescroll.endSuccess()
  90. // this.mescroll.resetUpScroll()
  91. // this.fuelFilling = []
  92. // this.getList(10, 1, 'down')
  93. this.$nextTick(function() {
  94. this.canReset && this.mescroll.resetUpScroll() // 重置列表数据为第一页
  95. this.canReset && this.mescroll.scrollTo(0, 0) // 重置列表数据为第一页时,建议把滚动条也重置到顶部,避免无法再次翻页的问题
  96. this.canReset = true // 过滤第一次的onShow事件,避免初始化界面时重复触发upCallback, 无需配置auto:false
  97. });
  98. },
  99. methods: {
  100. mescrollInit(mescroll) {
  101. console.log("mescroll", mescroll)
  102. this.mescroll = mescroll;
  103. },
  104. seeInfo(id) {
  105. uni.navigateTo({
  106. url: '/pages/fuelfilling/apply_see_reimbursement?id=' + id
  107. })
  108. },
  109. backInfo(row) {
  110. uni.showLoading({
  111. mask: true,
  112. title: "撤回中..."
  113. })
  114. console.log(row)
  115. this.$api.doRequest('post', '/newWorkflow/api/stopInstance', {
  116. workflowId: row.workflowId,
  117. businessKey: row.id,
  118. }).then(res => {
  119. uni.hideLoading()
  120. console.log(res)
  121. if (res.data.code == 200) {
  122. this.mescroll.resetUpScroll()
  123. }
  124. })
  125. },
  126. editInfo(id) {
  127. uni.navigateTo({
  128. url: '/pages/fuelfilling/apply_for_edit_reimbursement?id=' + id
  129. })
  130. },
  131. delInfo(id) {
  132. uni.showLoading({
  133. title: "加载中",
  134. mask: true
  135. })
  136. this.$api.doRequest('post', '/fuelFillingInfo/api/deleteFilling', {
  137. id: id,
  138. }).then(res => {
  139. uni.hideLoading()
  140. console.log(res)
  141. if (res.data.code == 200) {
  142. this.mescroll.resetUpScroll()
  143. }
  144. })
  145. },
  146. /*下拉刷新的回调 */
  147. downCallback() {
  148. this.mescroll.resetUpScroll();
  149. },
  150. /*上拉加载的回调: 其中page.num:当前页 从1开始, page.size:每页数据条数,默认10 */
  151. upCallback(page) {
  152. console.log(page)
  153. // if(page.num==1) this.fuelFilling = []
  154. this.$api.doRequest('get', '/fuelFillingInfo/selectFilling', {
  155. pageSize: page.size,
  156. currentPage: page.num,
  157. // pcFlag: 0,
  158. searchType: this.searchType,
  159. compId: uni.getStorageSync('pcUserInfo').compId,
  160. commonId: uni.getStorageSync('pcUserInfo').userId,
  161. }).then(res => {
  162. if (res.data.code == 200) {
  163. let curPageData = res.data.data.records;
  164. let curPageLen = curPageData.length;
  165. let totalPage = res.data.data.total;
  166. if (page.num == 1) this.fuelFilling = [];
  167. this.fuelFilling = this.fuelFilling.concat(curPageData);
  168. console.log(curPageLen, totalPage)
  169. this.mescroll.endByPage(curPageLen, totalPage);
  170. }
  171. })
  172. //联网加载数据
  173. // this.getList(page.size, page.num, 'up')
  174. },
  175. tabcarchange(searchType) {
  176. this.searchType = searchType
  177. this.mescroll.resetUpScroll()
  178. },
  179. trackAddition() {
  180. uni.navigateTo({
  181. url: '/pages/fuelfilling/apply_for_reimbursement'
  182. })
  183. },
  184. getList(size, page, type) {
  185. },
  186. getInfo(item) {
  187. if (item.travelStatus == '已报销') {
  188. return
  189. } else if (item.travelStatus == '已开始' && !item.status || item.travelStatus == '已结束' && !item.status || item
  190. .status == '已驳回') {
  191. uni.navigateTo({
  192. url: '/pages/fuelfilling/track_addition?id=' + item.id
  193. })
  194. } else {
  195. uni.navigateTo({
  196. url: '/pages/fuelfilling/apply_see_reimbursement?id=' + item.id
  197. })
  198. }
  199. },
  200. }
  201. }
  202. </script>
  203. <style lang="scss" scoped>
  204. .content {
  205. padding-bottom: 50rpx;
  206. }
  207. .tag {
  208. background: #F5F6F9;
  209. padding: 5px;
  210. color: #333333;
  211. display: inline-flex;
  212. font-size: 22rpx;
  213. border-radius: 3px;
  214. margin: 3px;
  215. }
  216. .introduce-section .title {
  217. justify-content: space-between;
  218. align-items: flex-start;
  219. }
  220. .introduce-section .title text {
  221. font-size: 28rpx;
  222. }
  223. .introduce-section .title .title-tip {
  224. flex: 1;
  225. font-size: 28rpx;
  226. color: #FE6430;
  227. font-weight: 500;
  228. height: 50px;
  229. line-height: 50px;
  230. border-bottom: 1px solid #EEEEEE;
  231. }
  232. .introduce-section .title .title-tip-a {
  233. flex: 1;
  234. font-size: 15px;
  235. color: #AFB3BF;
  236. font-weight: 500;
  237. height: 50px;
  238. line-height: 50px;
  239. border-bottom: 1px solid #EEEEEE;
  240. }
  241. .line {
  242. display: inline-block;
  243. padding: 5px;
  244. position: relative;
  245. font-size: 17px;
  246. }
  247. .line.active {
  248. font-size: 19px;
  249. font-weight: 900;
  250. }
  251. .line.active:after {
  252. content: '';
  253. display: block;
  254. position: absolute;
  255. width: 18px;
  256. left: 50%;
  257. transform: translateX(-50%);
  258. bottom: 0;
  259. border-bottom: 3px solid #22C572;
  260. }
  261. /deep/.u-action-active {
  262. margin-right: 6px;
  263. }
  264. .content1-top {
  265. background: white;
  266. padding: 10px 16px 0 10px;
  267. border-radius: 0 0 15px 15px;
  268. padding-bottom: 10px;
  269. position: fixed;
  270. width: 100%;
  271. z-index: 10;
  272. }
  273. .top2 {
  274. display: flex;
  275. align-items: center;
  276. justify-content: space-between;
  277. .right.uni-button {
  278. display: flex;
  279. align-items: center;
  280. font-weight: normal;
  281. .right-contrent1 {
  282. background: #22C572;
  283. height: 27px;
  284. font-size: 14px;
  285. color: #fff;
  286. }
  287. uni-button.right-contrent1:after {
  288. border: 1px solid #22C572;
  289. }
  290. }
  291. }
  292. .good-list {
  293. background-color: white;
  294. margin: 0px 10px 20px 10px;
  295. padding: 20rpx 0px 8px 0px;
  296. border-radius: 30rpx;
  297. box-shadow: 0px 5rpx 20rpx #E3E3E3;
  298. .item1,
  299. .item3 {
  300. // width: 40%;
  301. display: flex;
  302. .text {
  303. text-overflow: ellipsis;
  304. overflow: hidden;
  305. white-space: nowrap;
  306. }
  307. }
  308. .item1 .text {
  309. text-align: left;
  310. }
  311. .item3 .text {
  312. text-align: right;
  313. }
  314. }
  315. .xf-iamge {
  316. width: 74rpx;
  317. height: 43rpx;
  318. position: absolute;
  319. top: -20rpx;
  320. right: 0;
  321. }
  322. .level2-title {
  323. font-size: 28rpx;
  324. }
  325. .jt-icon {
  326. position: relative;
  327. top: 6rpx;
  328. width: 60rpx;
  329. margin: 0 20rpx;
  330. }
  331. .ssx {
  332. width: 20px;
  333. height: 20px;
  334. background: linear-gradient(180deg, #C8D7E5 0%, #AFC1D6 100%);
  335. font-size: 13px;
  336. font-family: PingFangSC-Medium, PingFang SC;
  337. font-weight: 500;
  338. color: #FFFFFF;
  339. border-radius: 50%;
  340. display: flex;
  341. justify-content: center;
  342. align-items: center;
  343. margin-right: 5px;
  344. }
  345. .level2-title {
  346. font-weight: 700;
  347. color: #000000;
  348. }
  349. .wenzi {
  350. text-align: right;
  351. border-radius: 10rpx;
  352. // margin-right: 30rpx;
  353. height: 10rpx;
  354. padding: 10px 0px 5px 128px;
  355. }
  356. .audit1 {
  357. color: #22C572;
  358. }
  359. .audit2 {
  360. color: #22C572;
  361. }
  362. .audit3 {
  363. color: #AFB3BF;
  364. }
  365. .top {
  366. justify-content: flex-end;
  367. align-items: center;
  368. margin-bottom: 10rpx;
  369. .left {
  370. align-items: center;
  371. }
  372. }
  373. .car-info {
  374. background: #F9F9FA;
  375. padding: 20rpx;
  376. display: flex;
  377. border-radius: 20rpx;
  378. flex-direction: column;
  379. .car-num {
  380. font-size: 26rpx;
  381. font-weight: 700;
  382. }
  383. .car-date {
  384. margin-top: 10rpx;
  385. color: #878C9C;
  386. }
  387. }
  388. .car-yh {
  389. display: flex;
  390. justify-content: flex-end;
  391. margin-top: 20rpx;
  392. .row {
  393. display: flex;
  394. align-items: center;
  395. .text {
  396. font-weight: 700;
  397. margin: 0 20rpx;
  398. }
  399. }
  400. }
  401. .see {
  402. display: flex;
  403. justify-content: flex-end;
  404. .btn {
  405. display: flex;
  406. justify-content: center;
  407. align-items: center;
  408. background: #FFFFFF;
  409. border-radius: 33px;
  410. border: 1px solid #CDCDCD;
  411. padding: 15rpx 40rpx;
  412. box-sizing: border-box;
  413. margin: 20rpx 0 0 20rpx;
  414. }
  415. }
  416. /deep/.mescroll-body {
  417. margin-top: 50px;
  418. }
  419. </style>