short_distance_record.vue 12 KB

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