the_fuel_filling.vue 10 KB

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