short_distance_record.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575
  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(1)' class='line' :class='searchType==1?"active":""'>未完成</view>
  8. <view @click='tabcarchange(3)' class='line' :class='searchType==3?"active":""'>已完成</view>
  9. </view>
  10. <view class="right uni-button">
  11. <button v-if="searchType==3" style="line-height: 28px;margin-right: 5px;"
  12. class="right-contrent1" @click="requestFunds">请款</button>
  13. <button style="line-height: 28px;" class="right-contrent1" @click="trackAddition">添加</button>
  14. </view>
  15. </view>
  16. </view>
  17. </view>
  18. <view v-for="(item,index) in shortDetail.shortFillingList" :key="index" @click="getInfo(item)">
  19. <view class="good-list flex">
  20. <view style="margin-top: 20px;width: 30px;">
  21. <label v-model="show2" class="fuxuankuang" @click.stop="checkedChange(item)" v-if="searchType==3">
  22. <checkbox value="cb" style="transform:scale(0.7)" :disabled="item.travelStatus == '已申请'" />
  23. </label>
  24. </view>
  25. <view style="padding: 0 35rpx 20rpx 0rpx;">
  26. <view class="flex align-center" style="width: 103%;margin-left: 12px;">
  27. <view class="item1">
  28. <view class="ssx">{{$helper.getProvinceAbbreviation(item.originProvince)}}</view>
  29. <view class="level2-title" style="font-size: 14px;">{{$helper.filterUrban(item.originCity)}}
  30. {{$helper.filterArea(item.originArea)}}
  31. </view>
  32. </view>
  33. <image class="jt-icon item2" src="@/static/images/fuel/jt.png" mode='widthFix'>
  34. </image>
  35. <view class="item3">
  36. <view class="ssx">{{$helper.getProvinceAbbreviation(item.destinationProvince)}}</view>
  37. <view class="level2-title">{{$helper.filterUrban(item.destinationCity)}}
  38. {{$helper.filterArea(item.destinationArea)}}
  39. </view>
  40. </view>
  41. <view class="wenzi audit1" v-if="item.travelStatus">{{item.travelStatus}}</view>
  42. </view>
  43. <view class="yf-style">
  44. <view class="left">
  45. <view style='justify-content:space-between;' class="flex">
  46. <view style="min-width: 130px;margin-top: 10px;">车牌号 : {{item.carNo}}</view>
  47. <view style="width: 90px;margin-top: 12px;">{{item.createDate.split(" ")[0]}}
  48. </view>
  49. </view>
  50. </view>
  51. </view>
  52. </view>
  53. </view>
  54. </view>
  55. <view v-if='show1' class="shade">
  56. <view class="wrap1">
  57. <view class="alert-top">
  58. <view class="title1">
  59. 请款
  60. </view>
  61. <u-icon name="close" class="close" color="#8890B1" @click="close()"></u-icon>
  62. </view>
  63. <view class="c-row">
  64. <view class="title2">请款金额</view>
  65. <view class="con-list">
  66. <input type="digit" style="width: 100px;margin-left: 60px;"
  67. v-model='shortDetail.amountRequested' placeholder="请输入请款金额">
  68. <view style="width: 0px;margin-left: 162px;margin-top: -20px;">元</view></input>
  69. </view>
  70. </view>
  71. <view class="c-row">
  72. <view class="title2">仓库名称</view>
  73. <view class="con-list">
  74. <view @click='show=true'>{{shortDetail.warehouseName}}</view>
  75. <u-picker :range="warehouseBaseInfoList" range-key="warehouseName"
  76. @confirm='targetLPicker($event)' v-model="show" mode="selector">
  77. </u-picker>
  78. </view>
  79. </view>
  80. <view class="c-row">
  81. <view class="title2">备注</view>
  82. </view>
  83. <view class="con-list">
  84. <u-input class='textarea' v-model="shortDetail.remark" :type="type" :border="border"
  85. :height="height" :auto-height="autoHeight" />
  86. <view style='right:10px;bottom:20px;color:#AFB3BF;'>
  87. {{shortDetail.remark.length}}/150个字
  88. </view>
  89. </view>
  90. <view @click="close()" class="cancel">取消</view>
  91. <view @click='requestFundsSubmit()' class="confirm">确定</view>
  92. </view>
  93. </view>
  94. </view>
  95. </template>
  96. <script>
  97. export default {
  98. data() {
  99. return {
  100. show2: false,
  101. searchType: 1,
  102. pageSize: 10,
  103. show1: false,
  104. show: false,
  105. currentPage: 1,
  106. shortDetail: {
  107. shortFillingList: [{
  108. destinationProvince: "",
  109. carNo: "",
  110. originProvince: "",
  111. createDate: "",
  112. travelStatus: "",
  113. mileage: "",
  114. sendWarehouse: "",
  115. receiveWarehouse: "",
  116. }],
  117. amountRequested: '',
  118. warehouseName: '请选择仓库名称',
  119. remark: '',
  120. },
  121. warehouseType: '1',
  122. warehouseBaseInfoList: [],
  123. type: 'textarea',
  124. border: true,
  125. height: 150,
  126. autoHeight: true,
  127. infoList:[],
  128. }
  129. },
  130. onLoad() {
  131. this.getWarehouse()
  132. },
  133. onShow() {
  134. this.getList()
  135. },
  136. methods: {
  137. checkedChange(item) {
  138. if (item.travelStatus == '已报销') {
  139. this.show2 = false
  140. this.$api.msg('已报销的不可再选')
  141. return
  142. }else{
  143. this.infoList.push(item)
  144. }
  145. },
  146. tabcarchange(searchType) {
  147. this.searchType = searchType
  148. this.pageSize = 10
  149. this.getList()
  150. },
  151. trackAddition() {
  152. uni.navigateTo({
  153. url: '/pages/shortDistance/short_track_addition'
  154. })
  155. },
  156. getList() {
  157. this.$api.doRequest('get', '/shortFillingInfo/selectShortFilling', {
  158. pageSize: this.pageSize,
  159. currentPage: this.currentPage,
  160. // pcFlag: 0,
  161. searchType: this.searchType,
  162. compId: uni.getStorageSync('pcUserInfo').compId,
  163. commonId: uni.getStorageSync('pcUserInfo').userId,
  164. }).then(res => {
  165. if (res.data.code == 200) {
  166. this.shortDetail.shortFillingList = res.data.data.records
  167. }
  168. })
  169. },
  170. getWarehouse() {
  171. this.$api.doRequest('get', '/warehouseBaseInfo/selectWarehouse', {
  172. compId: uni.getStorageSync("pcUserInfo").compId,
  173. warehouseType: '1'
  174. }).then(res => {
  175. if (res.data.data.length != 0) {
  176. this.warehouseBaseInfoList = res.data.data
  177. }
  178. })
  179. },
  180. targetLPicker(e) {
  181. this.shortDetail.warehouseName = this.warehouseBaseInfoList[e[0]].warehouseName
  182. },
  183. requestFunds() {
  184. if(this.infoList.length==0){
  185. this.$api.msg('请选择一条要请款的条目')
  186. return
  187. }
  188. this.show1 = true
  189. },
  190. close() {
  191. this.show1 = false
  192. },
  193. getInfo(item) {
  194. if (item.travelStatus == '已结束') {
  195. return
  196. } else {
  197. uni.navigateTo({
  198. url: '/pages/shortDistance/short_track_addition?id=' + item.id
  199. })
  200. }
  201. },
  202. requestFundsSubmit() {
  203. var that = this
  204. uni.showModal({
  205. content: "确定提交请款信息?",
  206. showCancel: true,
  207. confirmText: '提交',
  208. success: function(res) {
  209. if (res.confirm) {
  210. // that.shortDetail.remark = that.remark
  211. // that.shortDetail.amountRequested = that.amountRequested
  212. // that.shortDetail.warehouseName = that.warehouseName
  213. let dataInfo={}
  214. dataInfo.amountRequested = that.shortDetail.amountRequested
  215. dataInfo.warehouseName = that.shortDetail.warehouseName
  216. dataInfo.remark = that.shortDetail.remark
  217. // dataInfo.compId = uni.getStorageSync('pcUserInfo').compId
  218. // dataInfo.commonId = uni.getStorageSync('pcUserInfo').userId
  219. // dataInfo.empName = uni.getStorageSync('userInfo').userName
  220. dataInfo.shortFillingInfoList = that.infoList
  221. that.$api.doRequest('post', '/shortFillingInfo/api/shortRequestFunds',
  222. dataInfo
  223. )
  224. .then(res => {
  225. if (res.data.code == 200) {
  226. that.$api.msg('提交成功')
  227. that.infoList = []
  228. } else {
  229. that.$api.msg('提交失败')
  230. }
  231. })
  232. }
  233. }
  234. })
  235. },
  236. }
  237. }
  238. </script>
  239. <style lang="scss" scoped>
  240. .content {
  241. padding-bottom: 50rpx;
  242. }
  243. .tag {
  244. background: #F5F6F9;
  245. padding: 5px;
  246. color: #333333;
  247. display: inline-flex;
  248. font-size: 22rpx;
  249. border-radius: 3px;
  250. margin: 3px;
  251. }
  252. .introduce-section .title {
  253. justify-content: space-between;
  254. align-items: flex-start;
  255. }
  256. .introduce-section .title text {
  257. font-size: 28rpx;
  258. }
  259. .introduce-section .title .title-tip {
  260. flex: 1;
  261. font-size: 28rpx;
  262. color: #FE6430;
  263. font-weight: 500;
  264. height: 50px;
  265. line-height: 50px;
  266. border-bottom: 1px solid #EEEEEE;
  267. }
  268. .introduce-section .title .title-tip-a {
  269. flex: 1;
  270. font-size: 15px;
  271. color: #AFB3BF;
  272. font-weight: 500;
  273. height: 50px;
  274. line-height: 50px;
  275. border-bottom: 1px solid #EEEEEE;
  276. }
  277. .line {
  278. display: inline-block;
  279. padding: 5px;
  280. position: relative;
  281. font-size: 17px;
  282. }
  283. .line.active {
  284. font-size: 19px;
  285. font-weight: 900;
  286. }
  287. .line.active:after {
  288. content: '';
  289. display: block;
  290. position: absolute;
  291. width: 18px;
  292. left: 50%;
  293. transform: translateX(-50%);
  294. bottom: 0;
  295. border-bottom: 3px solid #22C572;
  296. }
  297. /deep/.u-action-active {
  298. margin-right: 6px;
  299. }
  300. .content1-top {
  301. background: white;
  302. padding: 10px 16px 0 10px;
  303. border-radius: 0 0 15px 15px;
  304. padding-bottom: 10px;
  305. }
  306. .top2 {
  307. display: flex;
  308. align-items: center;
  309. justify-content: space-between;
  310. .right.uni-button {
  311. display: flex;
  312. align-items: center;
  313. font-weight: normal;
  314. .right-contrent1 {
  315. background: #22C572;
  316. height: 25px;
  317. font-size: 14px;
  318. color: #fff;
  319. }
  320. }
  321. }
  322. .good-list {
  323. width: 95%;
  324. margin: 0 auto;
  325. background-color: white;
  326. padding: 33px 0px 25px 0px;
  327. border-radius: 30rpx;
  328. box-shadow: 0px 5rpx 20rpx #E3E3E3;
  329. margin-bottom: 10px;
  330. .item1,
  331. .item3 {
  332. // width: 40%;
  333. display: flex;
  334. .text {
  335. text-overflow: ellipsis;
  336. overflow: hidden;
  337. white-space: nowrap;
  338. }
  339. }
  340. .item1 .text {
  341. text-align: left;
  342. }
  343. .item3 .text {
  344. text-align: right;
  345. }
  346. }
  347. .fuxuankuang {
  348. margin-top: 10px;
  349. }
  350. .xf-iamge {
  351. width: 74rpx;
  352. height: 43rpx;
  353. position: absolute;
  354. top: -20rpx;
  355. right: 0;
  356. }
  357. .level2-title {
  358. font-size: 28rpx;
  359. width: 84px;
  360. }
  361. .jt-icon {
  362. position: relative;
  363. top: 6rpx;
  364. width: 60rpx;
  365. margin: 0 20rpx;
  366. }
  367. .ssx {
  368. width: 20px;
  369. height: 20px;
  370. background: linear-gradient(180deg, #C8D7E5 0%, #AFC1D6 100%);
  371. font-size: 13px;
  372. font-family: PingFangSC-Medium, PingFang SC;
  373. font-weight: 500;
  374. color: #FFFFFF;
  375. border-radius: 50%;
  376. display: flex;
  377. justify-content: center;
  378. align-items: center;
  379. margin-right: 5px;
  380. }
  381. .level2-title {
  382. font-weight: 700;
  383. color: #000000;
  384. }
  385. .wenzi {
  386. margin-top: -65px;
  387. text-align: right;
  388. border-radius: 5px;
  389. height: 5px;
  390. }
  391. .audit1 {
  392. color: #22C572;
  393. }
  394. .audit2 {
  395. color: #22C572;
  396. }
  397. .audit3 {
  398. color: #AFB3BF;
  399. }
  400. .c-row {
  401. display: flex;
  402. -webkit-box-align: center;
  403. align-items: center;
  404. // padding: 0px 15px;
  405. position: relative;
  406. }
  407. .shade {
  408. position: fixed;
  409. top: 0;
  410. left: 0;
  411. height: 100%;
  412. width: 100%;
  413. background: rgba(0, 0, 0, 0.4);
  414. z-index: 3;
  415. .wrap1 {
  416. position: absolute;
  417. left: 0;
  418. top: 0;
  419. right: 0;
  420. bottom: 0;
  421. margin: auto;
  422. background: #fff;
  423. width: calc(100% - 198rpx);
  424. height: 320px;
  425. border-radius: 20rpx;
  426. input {
  427. font-size: 14px;
  428. }
  429. .alert-top {
  430. padding: 33rpx;
  431. display: flex;
  432. justify-content: center;
  433. align-items: center;
  434. position: relative;
  435. }
  436. .title1 {
  437. font-size: 32rpx;
  438. font-weight: 600;
  439. color: #333333;
  440. }
  441. .close {
  442. position: absolute;
  443. right: 33rpx;
  444. }
  445. }
  446. .title2 {
  447. padding: 10px 16px;
  448. }
  449. .con-list {
  450. -webkit-box-flex: 1;
  451. flex: 1;
  452. display: flex;
  453. -webkit-box-orient: vertical;
  454. -webkit-box-direction: normal;
  455. flex-direction: column;
  456. color: #303133;
  457. line-height: 20px;
  458. text-align: right;
  459. padding-right: 10px;
  460. }
  461. .cancel {
  462. position: absolute;
  463. display: inline-block;
  464. width: 50%;
  465. text-align: center;
  466. bottom: 0;
  467. padding: 10px;
  468. border-top: 1px solid #eee;
  469. font-size: 34rpx;
  470. }
  471. .confirm {
  472. position: absolute;
  473. display: inline-block;
  474. width: 50%;
  475. text-align: center;
  476. bottom: 0;
  477. padding: 10px;
  478. border-top: 1px solid #eee;
  479. font-size: 34rpx;
  480. }
  481. .cancel {
  482. left: 0;
  483. border-right: 1px solid #eee;
  484. color: #ff0000;
  485. }
  486. .confirm {
  487. right: 0;
  488. color: #22C572;
  489. }
  490. .bottom-btn {
  491. width: 100%;
  492. position: fixed;
  493. bottom: 0;
  494. display: flex;
  495. z-index: 2;
  496. left: 0;
  497. background-color: #f8f8f8;
  498. flex-direction: column;
  499. .btn1,
  500. .btn2 {
  501. width: 100%;
  502. margin-bottom: 26rpx;
  503. border-radius: 90rpx;
  504. }
  505. .btn1 {
  506. background: white;
  507. color: #00C265;
  508. }
  509. }
  510. }
  511. .textarea {
  512. background: #F9F9FA;
  513. border: 1px solid #EEEEEE;
  514. margin-left: 10px;
  515. }
  516. </style>