the_fuel_filling.vue 9.8 KB

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