short_distance_record.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770
  1. <template>
  2. <view class="content">
  3. <view class="content1-top">
  4. <view class="top2">
  5. <!-- <view class="left top-content"> -->
  6. <view @click='tabcarchange(0)' class='line' :class='searchType==0?"active":""'>全部</view>
  7. <view @click='tabcarchange(1)' class='line' :class='searchType==1?"active":""'>未完成</view>
  8. <view @click='tabcarchange(3)' class='line' :class='searchType==3?"active":""'>已完成</view>
  9. <!-- </view> -->
  10. </view>
  11. </view>
  12. <mescroll-body ref="mescrollRef" :down="downOption" @down="downCallback" @up="upCallback">
  13. <checkbox-group>
  14. <view v-for="(item,index) in shortDetail.shortFillingList" :key="index" @click="getInfo(item)"
  15. class="list-content">
  16. <view class="fuxuankuang" @click.stop="checkedChange(item)" v-if="isShowCheck">
  17. <checkbox value="cb" style="transform:scale(0.7)" :disabled="item.travelStatus == '已报销'"
  18. :checked="item.check" />
  19. </view>
  20. <view class="good-list">
  21. <view style="padding: 0 35rpx 20rpx 35rpx;position: relative;">
  22. <view class="flex top">
  23. <view class="flex left">
  24. <view class="item1">
  25. <view class="ssx">{{$helper.getProvinceAbbreviation(item.originProvince)}}
  26. </view>
  27. <view class="level2-title" style="font-size: 14px;">
  28. {{$helper.filterUrban(item.originCity)}}
  29. {{$helper.filterArea(item.originArea)}}
  30. </view>
  31. </view>
  32. <image class="jt-icon item2" src="@/static/images/fuel/jt.png" mode='widthFix'>
  33. </image>
  34. <view class="item3">
  35. <view class="ssx">{{$helper.getProvinceAbbreviation(item.destinationProvince)}}
  36. </view>
  37. <view class="level2-title">{{$helper.filterUrban(item.destinationCity)}}
  38. {{$helper.filterArea(item.destinationArea)}}
  39. </view>
  40. </view>
  41. </view>
  42. <view class="flex">
  43. <view class="audit1" v-if="item.travelStatus == '已开始'">已开始</view>
  44. <view class="audit2" v-if="item.travelStatus == '已结束'">已结束</view>
  45. <view class="audit3" v-if="item.travelStatus == '已报销'">已报销</view>
  46. </view>
  47. </view>
  48. <view class="car-info">
  49. <view style="display: flex;">
  50. <view class="car-num">车牌号 : {{item.carNo}}</view>
  51. <view style="margin-left: 20rpx;" v-if="item.travelStatus != '已开始'">
  52. {{item.mileage}}km
  53. </view>
  54. </view>
  55. <view class="car-date">{{item.createDate.split(" ")[0]}}</view>
  56. </view>
  57. <view class="qk" v-if="item.travelStatus == '已结束'">
  58. <view class="qkbtn" @click="qkClick(item)">请款</view>
  59. </view>
  60. </view>
  61. </view>
  62. </view>
  63. </checkbox-group>
  64. </mescroll-body>
  65. <view v-if='show1' class="shade">
  66. <view class="wrap1">
  67. <view class="alert-top">
  68. <view class="title1">
  69. 请款
  70. </view>
  71. <u-icon name="close" class="close" color="#8890B1" @click="close()"></u-icon>
  72. </view>
  73. <view class="c-row">
  74. <view class="title2">请款金额</view>
  75. <view class="con-list">
  76. <input type="digit" v-model='shortDetail.amountRequested' placeholder="请输入请款金额(元)">
  77. <view style="width: 0px;margin-left: 162px;margin-top: -20px;"></view></input>
  78. </view>
  79. </view>
  80. <view class="c-row">
  81. <view class="title2">仓库名称</view>
  82. <view class="con-list">
  83. <view @click='show=true'>{{shortDetail.warehouseName?shortDetail.warehouseName:"请选择仓库"}}</view>
  84. <u-picker :range="warehouseBaseInfoList" range-key="warehouseName"
  85. @confirm='targetLPicker($event)' v-model="show" mode="selector">
  86. </u-picker>
  87. </view>
  88. </view>
  89. <view class="c-row">
  90. <view class="title2">备注</view>
  91. </view>
  92. <view class="con-list">
  93. <u-input class='textarea' v-model="shortDetail.remark" :type="type" :border="border"
  94. :height="height" :auto-height="autoHeight" />
  95. <!-- <view style='right:10px;bottom:20px;color:#AFB3BF;'>
  96. {{shortDetail.remark.length}}/150个字
  97. </view> -->
  98. </view>
  99. <view @click="close()" class="cancel">取消</view>
  100. <view @click='requestFundsSubmit()' class="confirm">确定</view>
  101. </view>
  102. </view>
  103. <view class="bottom-view">
  104. <!-- <button v-if="searchType==3" style="line-height: 28px;margin-right: 5px;"
  105. class="right-contrent1" @click="requestFunds">请款</button> -->
  106. <view class="bottom-btn" @click="trackAddition" v-if="!isShowCheck">添加</view>
  107. <view class="row2" v-if="isShowCheck">
  108. <view class="left" v-if="!isSelectChecked">
  109. 请选择要请款的记录
  110. </view>
  111. <view class="left" v-if="isSelectChecked">
  112. 已选择{{selectTotal}}个
  113. </view>
  114. <view class="right" v-if="!isSelectChecked">
  115. 一键请款
  116. </view>
  117. <view class="right green" @click="yjqkClick" v-if="isSelectChecked">
  118. 一键请款
  119. </view>
  120. </view>
  121. </view>
  122. </view>
  123. </template>
  124. <script>
  125. import MescrollMixin from "@/components/mescroll-uni/mescroll-mixins.js";
  126. export default {
  127. mixins: [MescrollMixin], // 使用mixin (在main.js注册全局组件)
  128. data() {
  129. return {
  130. downOption: {
  131. auto: false //是否在初始化后,自动执行downCallback; 默认true
  132. },
  133. selectTotal: 0,
  134. isSelectChecked: false,
  135. isShowCheck: false,
  136. show2: false,
  137. searchType: 0,
  138. pageSize: 10,
  139. show1: false,
  140. show: false,
  141. currentPage: 1,
  142. shortDetail: {
  143. shortFillingList: []
  144. },
  145. // shortDetail: {
  146. // shortFillingList: [{
  147. // destinationProvince: "辽宁省",
  148. // destinationCity: "营口市",
  149. // destinationArea: "鲅鱼圈区",
  150. // destinationAddress: '鲅鱼圈5号门',
  151. // carNo: "辽H11111",
  152. // originProvince: "辽宁省",
  153. // originCity: "营口",
  154. // originArea: "鲅鱼圈区",
  155. // originAddress: '中天昊元',
  156. // createDate: "2022-01-01 15:30:20",
  157. // travelStatus: "已开始",
  158. // totalCost: "233.20",
  159. // tfc: "60L",
  160. // check: false
  161. // }],
  162. // amountRequested: '',
  163. // warehouseName: '请选择仓库名称',
  164. // remark: '',
  165. // },
  166. warehouseType: '1',
  167. warehouseBaseInfoList: [],
  168. type: 'textarea',
  169. border: true,
  170. height: 150,
  171. autoHeight: true,
  172. // infoList:[],
  173. }
  174. },
  175. onLoad() {},
  176. onShow() {
  177. // this.getList()
  178. },
  179. onNavigationBarButtonTap(e) {
  180. console.log(e)
  181. this.isShowCheck = !this.isShowCheck
  182. // this.isSelectChecked = false
  183. // const index = e.index;
  184. // if (index == 1) {
  185. // uni.navigateBack()
  186. // } else {
  187. // this.naviageToPage("/pages/user/depotAcquisition/grainDeliveryRecord")
  188. // }
  189. },
  190. methods: {
  191. // 单条请款
  192. qkClick(item) {
  193. this.infoList = []
  194. this.infoList.push(item)
  195. this.show1 = true
  196. },
  197. // 一键请款
  198. yjqkClick() {
  199. // this.requestFundsSubmit()
  200. this.show1 = true
  201. },
  202. /*下拉刷新的回调 */
  203. downCallback() {
  204. this.getList(10, 1, 'down')
  205. },
  206. /*上拉加载的回调: 其中page.num:当前页 从1开始, page.size:每页数据条数,默认10 */
  207. upCallback(page) {
  208. //联网加载数据
  209. this.getList(page.size, page.num, 'up')
  210. },
  211. checkedChange(item) {
  212. item.check = !item.check
  213. this.isSelectChecked = false
  214. this.selectTotal = 0
  215. for (let i = 0; i < this.shortDetail.shortFillingList.length; i++) {
  216. if (this.shortDetail.shortFillingList[i].check) {
  217. this.isSelectChecked = true
  218. this.selectTotal++
  219. }
  220. }
  221. if (item.travelStatus == '已报销') {
  222. this.show2 = false
  223. this.$api.msg('已报销的不可再选')
  224. return
  225. } else {
  226. this.infoList.push(item)
  227. }
  228. },
  229. tabcarchange(searchType) {
  230. this.searchType = searchType
  231. this.getList()
  232. },
  233. trackAddition() {
  234. uni.navigateTo({
  235. url: '/pages/shortDistance/short_track_addition'
  236. })
  237. },
  238. getList(size, page, type) {
  239. this.$api.doRequest('get', '/shortFillingInfo/selectShortFilling', {
  240. pageSize: size,
  241. currentPage: page,
  242. // pcFlag: 0,
  243. searchType: this.searchType,
  244. compId: uni.getStorageSync('pcUserInfo').compId,
  245. commonId: uni.getStorageSync('pcUserInfo').userId,
  246. }).then(res => {
  247. if (res.data.code == 200) {
  248. uni.showLoading({
  249. mask: true,
  250. title: '加载中'
  251. })
  252. this.getWarehouse()
  253. if (type == 'down') {
  254. this.mescroll.endSuccess();
  255. this.shortDetail.shortFillingList = []
  256. } else {
  257. console.log(res.data)
  258. this.mescroll.endBySize(res.data.data.records.length, res.data.data.total
  259. .length); //必传参数(当前页的数据个数, 总数据量)
  260. }
  261. this.shortDetail.shortFillingList = this.shortDetail.shortFillingList.concat(res.data.data
  262. .records)
  263. for (let i = 0; i < this.shortDetail.shortFillingList.length; i++) {
  264. this.shortDetail.shortFillingList[i].check = false
  265. }
  266. }
  267. })
  268. },
  269. getWarehouse() {
  270. this.$api.doRequest('get', '/warehouseBaseInfo/selectWarehouse', {
  271. compId: uni.getStorageSync("pcUserInfo").compId,
  272. warehouseType: '1'
  273. }).then(res => {
  274. if (res.data.data.length != 0) {
  275. uni.hideLoading()
  276. this.warehouseBaseInfoList = res.data.data
  277. }
  278. })
  279. },
  280. targetLPicker(e) {
  281. this.shortDetail.warehouseName = this.warehouseBaseInfoList[e[0]].warehouseName
  282. },
  283. requestFunds() {
  284. this.show1 = true
  285. },
  286. close() {
  287. this.show1 = false
  288. },
  289. getInfo(item) {
  290. if (item.travelStatus == '已结束') {
  291. return
  292. } else {
  293. uni.navigateTo({
  294. url: '/pages/shortDistance/short_track_addition?id=' + item.id
  295. })
  296. }
  297. },
  298. requestFundsSubmit() {
  299. var that = this
  300. uni.showModal({
  301. content: "确定提交请款信息?",
  302. showCancel: true,
  303. confirmText: '提交',
  304. success: function(res) {
  305. if (res.confirm) {
  306. // that.shortDetail.remark = that.remark
  307. // that.shortDetail.amountRequested = that.amountRequested
  308. // that.shortDetail.warehouseName = that.warehouseName
  309. let dataInfo = {}
  310. dataInfo.amountRequested = that.shortDetail.amountRequested
  311. dataInfo.warehouseName = that.shortDetail.warehouseName
  312. dataInfo.remark = that.shortDetail.remark
  313. // dataInfo.compId = uni.getStorageSync('pcUserInfo').compId
  314. // dataInfo.commonId = uni.getStorageSync('pcUserInfo').userId
  315. // dataInfo.empName = uni.getStorageSync('userInfo').userName
  316. dataInfo.shortFillingInfoList = that.infoList
  317. that.$api.doRequest('post', '/shortFillingInfo/api/shortRequestFunds',
  318. dataInfo
  319. )
  320. .then(res => {
  321. if (res.data.code == 200) {
  322. that.$api.msg('提交成功')
  323. that.infoList = []
  324. } else {
  325. that.$api.msg('提交失败')
  326. }
  327. })
  328. }
  329. }
  330. })
  331. },
  332. }
  333. }
  334. </script>
  335. <style lang="scss" scoped>
  336. .content {
  337. padding-bottom: 180rpx;
  338. }
  339. .tag {
  340. background: #F5F6F9;
  341. padding: 5px;
  342. color: #333333;
  343. display: inline-flex;
  344. font-size: 22rpx;
  345. border-radius: 3px;
  346. margin: 3px;
  347. }
  348. .introduce-section .title {
  349. justify-content: space-between;
  350. align-items: flex-start;
  351. }
  352. .introduce-section .title text {
  353. font-size: 28rpx;
  354. }
  355. .introduce-section .title .title-tip {
  356. flex: 1;
  357. font-size: 28rpx;
  358. color: #FE6430;
  359. font-weight: 500;
  360. height: 50px;
  361. line-height: 50px;
  362. border-bottom: 1px solid #EEEEEE;
  363. }
  364. .introduce-section .title .title-tip-a {
  365. flex: 1;
  366. font-size: 15px;
  367. color: #AFB3BF;
  368. font-weight: 500;
  369. height: 50px;
  370. line-height: 50px;
  371. border-bottom: 1px solid #EEEEEE;
  372. }
  373. .line {
  374. display: inline-block;
  375. padding: 5px;
  376. position: relative;
  377. font-size: 17px;
  378. }
  379. .line.active {
  380. font-size: 19px;
  381. font-weight: 900;
  382. }
  383. .line.active:after {
  384. content: '';
  385. display: block;
  386. position: absolute;
  387. width: 18px;
  388. left: 50%;
  389. transform: translateX(-50%);
  390. bottom: 0;
  391. border-bottom: 3px solid #22C572;
  392. }
  393. /deep/.u-action-active {
  394. margin-right: 6px;
  395. }
  396. .content1-top {
  397. background: white;
  398. padding: 10px 16px 0 10px;
  399. border-radius: 0 0 15px 15px;
  400. padding-bottom: 10px;
  401. margin-bottom: 20rpx;
  402. }
  403. .top2 {
  404. display: flex;
  405. align-items: center;
  406. justify-content: space-between;
  407. .right.uni-button {
  408. display: flex;
  409. align-items: center;
  410. font-weight: normal;
  411. .right-contrent1 {
  412. background: #22C572;
  413. height: 25px;
  414. font-size: 14px;
  415. color: #fff;
  416. }
  417. }
  418. }
  419. .good-list {
  420. background-color: white;
  421. // margin: -10px 10px 20px 10px;
  422. padding: 20px 0px;
  423. width: 100%;
  424. margin: 10rpx 20rpx;
  425. border-radius: 30rpx;
  426. box-shadow: 0px 5rpx 20rpx #E3E3E3;
  427. .item1,
  428. .item3 {
  429. // width: 40%;
  430. display: flex;
  431. .text {
  432. text-overflow: ellipsis;
  433. overflow: hidden;
  434. white-space: nowrap;
  435. }
  436. }
  437. .item1 .text {
  438. text-align: left;
  439. }
  440. .item3 .text {
  441. text-align: right;
  442. }
  443. .top {
  444. align-items: center;
  445. justify-content: space-between;
  446. .left {
  447. align-items: center;
  448. }
  449. }
  450. .car-info {
  451. background: #F9F9FA;
  452. padding: 20rpx;
  453. display: flex;
  454. border-radius: 20rpx;
  455. flex-direction: column;
  456. .car-num {
  457. font-size: 26rpx;
  458. // font-weight: 700;
  459. }
  460. .car-date {
  461. margin-top: 10rpx;
  462. color: #878C9C;
  463. }
  464. }
  465. .qk {
  466. display: flex;
  467. justify-content: flex-end;
  468. }
  469. .qkbtn {
  470. display: flex;
  471. justify-content: center;
  472. align-items: center;
  473. background: #FFFFFF;
  474. border-radius: 33px;
  475. border: 1px solid #CDCDCD;
  476. padding: 15rpx 40rpx;
  477. box-sizing: border-box;
  478. margin-top: 20rpx;
  479. }
  480. }
  481. .fuxuankuang {
  482. margin-top: 10px;
  483. }
  484. .xf-iamge {
  485. width: 74rpx;
  486. height: 43rpx;
  487. position: absolute;
  488. top: -20rpx;
  489. right: 0;
  490. }
  491. .level2-title {
  492. font-size: 28rpx;
  493. width: 84px;
  494. }
  495. .jt-icon {
  496. position: relative;
  497. top: 6rpx;
  498. width: 60rpx;
  499. margin: 0 20rpx;
  500. }
  501. .ssx {
  502. width: 20px;
  503. height: 20px;
  504. background: linear-gradient(180deg, #C8D7E5 0%, #AFC1D6 100%);
  505. font-size: 13px;
  506. font-family: PingFangSC-Medium, PingFang SC;
  507. font-weight: 500;
  508. color: #FFFFFF;
  509. border-radius: 50%;
  510. display: flex;
  511. justify-content: center;
  512. align-items: center;
  513. margin-right: 5px;
  514. }
  515. .level2-title {
  516. font-weight: 700;
  517. color: #000000;
  518. }
  519. .wenzi {
  520. margin-top: -65px;
  521. text-align: right;
  522. border-radius: 5px;
  523. height: 5px;
  524. }
  525. .audit1 {
  526. color: #22C572;
  527. }
  528. .audit2 {
  529. color: #ff0000;
  530. }
  531. .audit3 {
  532. color: #AFB3BF;
  533. }
  534. .c-row {
  535. display: flex;
  536. -webkit-box-align: center;
  537. align-items: center;
  538. // padding: 0px 15px;
  539. position: relative;
  540. }
  541. .shade {
  542. position: fixed;
  543. top: 0;
  544. left: 0;
  545. height: 100%;
  546. width: 100%;
  547. background: rgba(0, 0, 0, 0.4);
  548. z-index: 3;
  549. .wrap1 {
  550. position: absolute;
  551. left: 0;
  552. top: 0;
  553. right: 0;
  554. bottom: 0;
  555. margin: auto;
  556. background: #fff;
  557. width: calc(100% - 198rpx);
  558. height: 340px;
  559. border-radius: 20rpx;
  560. input {
  561. font-size: 14px;
  562. }
  563. .alert-top {
  564. padding: 33rpx;
  565. display: flex;
  566. justify-content: center;
  567. align-items: center;
  568. position: relative;
  569. }
  570. .title1 {
  571. font-size: 32rpx;
  572. font-weight: 600;
  573. color: #333333;
  574. }
  575. .close {
  576. position: absolute;
  577. right: 33rpx;
  578. }
  579. }
  580. .title2 {
  581. padding: 10px 16px;
  582. }
  583. .con-list {
  584. -webkit-box-flex: 1;
  585. flex: 1;
  586. display: flex;
  587. -webkit-box-orient: vertical;
  588. -webkit-box-direction: normal;
  589. flex-direction: column;
  590. color: #303133;
  591. line-height: 20px;
  592. text-align: right;
  593. padding-right: 10px;
  594. }
  595. .cancel {
  596. position: absolute;
  597. display: inline-block;
  598. width: 50%;
  599. text-align: center;
  600. bottom: 0;
  601. padding: 10px;
  602. border-top: 1px solid #eee;
  603. font-size: 34rpx;
  604. }
  605. .confirm {
  606. position: absolute;
  607. display: inline-block;
  608. width: 50%;
  609. text-align: center;
  610. bottom: 0;
  611. padding: 10px;
  612. border-top: 1px solid #eee;
  613. font-size: 34rpx;
  614. }
  615. .cancel {
  616. left: 0;
  617. border-right: 1px solid #eee;
  618. color: #ff0000;
  619. }
  620. .confirm {
  621. right: 0;
  622. color: #22C572;
  623. }
  624. .bottom-btn {
  625. width: 100%;
  626. position: fixed;
  627. bottom: 0;
  628. display: flex;
  629. z-index: 2;
  630. left: 0;
  631. background-color: #f8f8f8;
  632. flex-direction: column;
  633. .btn1,
  634. .btn2 {
  635. width: 100%;
  636. margin-bottom: 26rpx;
  637. border-radius: 90rpx;
  638. }
  639. .btn1 {
  640. background: white;
  641. color: #00C265;
  642. }
  643. }
  644. }
  645. .textarea {
  646. background: #F9F9FA;
  647. border: 1px solid #EEEEEE;
  648. margin: 20rpx;
  649. }
  650. // .top-content{
  651. // display: flex;
  652. // // justify-content: ;
  653. // }
  654. .list-content {
  655. display: flex;
  656. align-items: center;
  657. }
  658. .bottom-view {
  659. position: fixed;
  660. bottom: 0;
  661. width: 100%;
  662. padding: 40rpx;
  663. background-color: #fff;
  664. .bottom-btn {
  665. background-color: #22C572;
  666. width: 100%;
  667. display: flex;
  668. align-items: center;
  669. justify-content: center;
  670. color: #fff;
  671. font-size: 32rpx;
  672. padding: 20rpx;
  673. border-radius: 50rpx;
  674. }
  675. .row2 {
  676. display: flex;
  677. justify-content: space-around;
  678. align-items: center;
  679. color: #ACAFB6;
  680. .right {
  681. background-color: #F7F8FA;
  682. padding: 20rpx 60rpx;
  683. border-radius: 50rpx;
  684. }
  685. .green {
  686. background: #22C572;
  687. color: #fff;
  688. }
  689. }
  690. }
  691. </style>