apply_see_reimbursement.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503
  1. <template>
  2. <view>
  3. <view class="center u-skeleton">
  4. <view class='wrap'>
  5. <view class="c-row">
  6. <view class="title u-skeleton-rect">车牌号</view>
  7. <view class="con-list u-skeleton-rect">
  8. {{detailData.carNo}}
  9. </view>
  10. </view>
  11. <view class="c-row u-skeleton-rect">
  12. <view class="title">行程轨迹</view>
  13. <view class="con-list">
  14. <view class="flex align-center">
  15. <view class="item1">
  16. <view class="ssx ">{{$helper.getProvinceAbbreviation(detailData.originProvince)}}</view>
  17. <view class="level2-title ">
  18. {{$helper.filterUrban(detailData.originCity)}}
  19. {{$helper.filterArea(detailData.originArea)}}
  20. </view>
  21. </view>
  22. <image class="jt-icon item2" src="@/static/images/fuel/jt.png" mode='widthFix'>
  23. </image>
  24. <view class="item3">
  25. <view class="ssx ">{{$helper.getProvinceAbbreviation(detailData.destinationProvince)}}
  26. </view>
  27. <view class="level2-title ">{{$helper.filterUrban(detailData.destinationCity)}}
  28. {{$helper.filterArea(detailData.destinationArea)}}
  29. </view>
  30. </view>
  31. </view>
  32. </view>
  33. </view>
  34. <view class="c-row">
  35. <view class="left">备注</view>
  36. </view>
  37. <view style='position:relative;' class="wrap1 no-boder">
  38. <u-input disabled ref='textarea' class='textarea' v-model="detailData.remark" :type="typeRemark" :border="border"
  39. placeholder="选填,不超过150字" :height="height" :auto-height="autoHeight" maxlength="150" />
  40. <view class="remark">
  41. {{detailData.remark?detailData.remark.length:'0'}}/150个字
  42. </view>
  43. </view>
  44. </view>
  45. <view class='wrap1' v-for="(item , index) in detailData.fillingDetailInfoList" :Key="index">
  46. <view class="tit">加油-{{index+1}}</view>
  47. <view class="c-row">
  48. <view class="title">油耗(升)</view>
  49. <view class="con-list ">
  50. {{item.oilConsumption}}
  51. </view>
  52. </view>
  53. <view class="c-row">
  54. <view class="title">当前油价(元/升)</view>
  55. <view class="con-list ">
  56. {{item.currentOilPrice}}
  57. </view>
  58. </view>
  59. <view class="c-row">
  60. <view class="title">计算金额(元)</view>
  61. <view class="con-list">
  62. {{item.currentConsumption}}
  63. </view>
  64. </view>
  65. <view class="c-row" style="justify-content: space-between;">
  66. <view class="title">加油凭证</view>
  67. <!-- <image :src="item.addressUrl" mode="widthFix" style="width: 200rpx;" v-if='item.addressUrl'
  68. @click="previewImage(item.addressUrl)"></image> -->
  69. </view>
  70. <view class="voucher">
  71. <u-upload :action="action" imageMode='aspectFill' :file-list="item.urlList" max-count="1" :deletable="false" :show-progress="false"></u-upload>
  72. </view>
  73. </view>
  74. <view class="footer">
  75. <view class="c-row">
  76. <view class="title">总油耗(升)</view>
  77. <view class="con-list u-skeleton-rect">
  78. <input :disabled="true" v-model='detailData.tfc' placeholder="不可编辑,自动计算" type="digit"></input>
  79. </view>
  80. </view>
  81. <view class="c-row">
  82. <view class="title">合计金额(元)</view>
  83. <view class="con-list u-skeleton-rect">
  84. <input :disabled="true" v-model='detailData.totalCost' placeholder="不可编辑,自动计算"
  85. type="digit"></input>
  86. </view>
  87. </view>
  88. <!-- <view @click='submitApply' class="button">提交申请</view> -->
  89. </view>
  90. </view>
  91. <!-- <u-skeleton class='skeletonwrap' :loading="loading" :animation="true" bgColor="#FFF"></u-skeleton> -->
  92. </view>
  93. </template>
  94. <script>
  95. import upload from '@/components/upload.vue';
  96. export default {
  97. components: {
  98. upload,
  99. },
  100. data() {
  101. return {
  102. detailData: {},
  103. action: this.$uploadUrl,
  104. maxSize: 50 * 1024 * 1024, //限制文件大小 50M
  105. btnLoading: false, //防止重复点击
  106. isAdd: true,
  107. tfc: "",
  108. totalCost: "",
  109. loading: true,
  110. height: 150,
  111. autoHeight: true,
  112. typeRemark: 'textarea',
  113. border: true,
  114. }
  115. },
  116. onLoad(options) {
  117. this.id = options.id
  118. // this.fillingDetail.fillingDetailInfoList[0].fillingId = this.id
  119. },
  120. onShow() {
  121. var that = this
  122. if (this.id) {
  123. this.seeInfo()
  124. }
  125. },
  126. methods: {
  127. previewImage(src) {
  128. uni.previewImage({
  129. urls: [src],
  130. longPressActions: {
  131. itemList: ['发送给朋友', '保存图片', '收藏'],
  132. success: function(data) {
  133. console.log('选中了第' + (data.tapIndex + 1) + '个按钮,第' + (data.index + 1) + '张图片');
  134. },
  135. fail: function(err) {
  136. console.log(err.errMsg);
  137. }
  138. }
  139. });
  140. },
  141. seeInfo() {
  142. var that = this
  143. this.$api.doRequest('get', '/fuelFillingInfo/getFilling', {
  144. id: this.id
  145. }).then(res => {
  146. if (res.data.code == 200) {
  147. this.detailData = res.data.data
  148. if(this.detailData.fillingDetailInfoList){
  149. for (let i = 0; i < this.detailData.fillingDetailInfoList.length; i++) {
  150. let urlList = []
  151. if (this.detailData.fillingDetailInfoList[i].addressUrl) {
  152. let datalist = this.detailData.fillingDetailInfoList[i].addressUrl.split(",")
  153. for (let j = 0; j < datalist.length; j++) {
  154. urlList.push({
  155. url: datalist[j]
  156. })
  157. }
  158. this.detailData.fillingDetailInfoList[i].urlList = urlList
  159. }
  160. }
  161. }
  162. // setTimeout(()=>{
  163. // that.loading=false
  164. // },1000)
  165. }
  166. })
  167. },
  168. onError(error) {
  169. alert(error)
  170. console.log('------------error-----------')
  171. console.log(error)
  172. },
  173. onProgress(e) {
  174. console.log(e)
  175. },
  176. onRemove(index, num) {
  177. this.fillingDetail.fillingDetailInfoList[num].addressUrl.splice(index, 1)
  178. },
  179. filterFileType(index, lists) {
  180. if (lists[index].fileType != 'jpg' && lists[index].fileType != 'png' && lists[index].fileType != 'gif') {
  181. lists.splice(index, 1);
  182. // 当前文件不支持
  183. uni.showModal({
  184. title: '暂不支持当前图片类型',
  185. showCancel: false
  186. });
  187. } else {
  188. this.isAdd = false;
  189. }
  190. },
  191. calculate(index) {
  192. this.fillingDetail.fillingDetailInfoList[index].currentConsumption = (this.fillingDetail
  193. .fillingDetailInfoList[index].oilConsumption * this.fillingDetail.fillingDetailInfoList[index]
  194. .currentOilPrice)
  195. .toFixed(2)
  196. this.tfc = ""
  197. this.totalCost = ""
  198. for (let i = 0; i < this.fillingDetail.fillingDetailInfoList.length; i++) {
  199. this.tfc = (Number(this.tfc) + Number(this.fillingDetail.fillingDetailInfoList[i].oilConsumption))
  200. .toFixed(2)
  201. this.totalCost = (Number(this.totalCost) + Number(this.fillingDetail.fillingDetailInfoList[i]
  202. .currentConsumption)).toFixed(2)
  203. this.$forceUpdate()
  204. }
  205. },
  206. delApply(index) {
  207. this.fillingDetail.fillingDetailInfoList.splice(index, 1)
  208. },
  209. addApply() {
  210. this.fillingDetail.fillingDetailInfoList.push({
  211. oilConsumption: "",
  212. currentOilPrice: "",
  213. currentConsumption: "",
  214. addressUrl: [],
  215. compId: uni.getStorageSync('pcUserInfo').compId,
  216. commonId: uni.getStorageSync('pcUserInfo').userId,
  217. fillingId: this.id
  218. })
  219. },
  220. submitApply() {
  221. var that = this
  222. uni.showModal({
  223. content: "确定提交申请信息?",
  224. showCancel: true,
  225. confirmText: '提交',
  226. success: function(res) {
  227. if (res.confirm) {
  228. that.fillingDetail.tfc = that.tfc
  229. that.fillingDetail.totalCost = that.totalCost
  230. for (let i = 0; i < that.fillingDetail.fillingDetailInfoList.length; i++) {
  231. that.fillingDetail.fillingDetailInfoList[i].addressUrl = that.fillingDetail
  232. .fillingDetailInfoList[i].addressUrl.toString()
  233. }
  234. that.$api.doRequest('post', '/fillingDetailInfo/api/addFillingDetail',
  235. that.fillingDetail
  236. )
  237. .then(res => {
  238. if (res.data.code == 200) {
  239. that.$api.msg('提交成功')
  240. uni.navigateBack({
  241. delta: 1
  242. });
  243. } else {
  244. that.$api.msg('提交失败')
  245. }
  246. })
  247. }
  248. }
  249. })
  250. },
  251. }
  252. }
  253. </script>
  254. <style lang='scss' scoped>
  255. .center {
  256. padding-bottom: 220rpx;
  257. }
  258. page {
  259. background: #F5F6FA;
  260. }
  261. .title_b {
  262. margin: 20rpx 20rpx 0rpx 20rpx;
  263. padding: 20rpx 10rpx 20rpx 10rpx;
  264. font-weight: 550;
  265. }
  266. .c-row {
  267. display: -webkit-box;
  268. display: -webkit-flex;
  269. display: flex;
  270. -webkit-box-align: center;
  271. -webkit-align-items: center;
  272. align-items: center;
  273. padding: 10rpx 30rpx;
  274. position: relative;
  275. }
  276. .level2-title {}
  277. .level2-title {
  278. font-weight: 700;
  279. color: #000000;
  280. }
  281. .jt-icon {
  282. position: relative;
  283. top: 6rpx;
  284. width: 60rpx;
  285. margin: 0 20rpx;
  286. }
  287. .xf-iamge {
  288. width: 74rpx;
  289. height: 43rpx;
  290. position: absolute;
  291. top: -20rpx;
  292. right: 0;
  293. }
  294. .ssx {
  295. width: 20px;
  296. height: 20px;
  297. background: linear-gradient(180deg, #C8D7E5 0%, #AFC1D6 100%);
  298. font-family: PingFangSC-Medium, PingFang SC;
  299. font-weight: 500;
  300. color: #FFFFFF;
  301. border-radius: 50%;
  302. display: flex;
  303. justify-content: center;
  304. align-items: center;
  305. margin-right: 5px;
  306. }
  307. .con-list {
  308. -webkit-box-flex: 1;
  309. -webkit-flex: 1;
  310. flex: 1;
  311. display: -webkit-box;
  312. display: -webkit-flex;
  313. display: flex;
  314. -webkit-box-orient: vertical;
  315. -webkit-box-direction: normal;
  316. -webkit-flex-direction: column;
  317. flex-direction: column;
  318. color: #303133;
  319. line-height: 40rpx;
  320. text-align: right;
  321. .item1,
  322. .item3 {
  323. // width: 40%;
  324. display: flex;
  325. .text {
  326. text-overflow: ellipsis;
  327. overflow: hidden;
  328. white-space: nowrap;
  329. }
  330. }
  331. .item1 .text {
  332. text-align: left;
  333. }
  334. .item3 .text {
  335. text-align: right;
  336. }
  337. }
  338. .align-center {
  339. align-items: center;
  340. justify-content: flex-end;
  341. }
  342. .wrap1 {
  343. background: #fff;
  344. margin: 10px;
  345. border-radius: 15px 10px;
  346. margin-top: 18px;
  347. input {}
  348. .tit {
  349. margin-left: 14px;
  350. width: 47px;
  351. padding-top: 10px;
  352. }
  353. .eliminate1 {
  354. max-width: 50%;
  355. width: 20px;
  356. height: 20px;
  357. font-family: PingFangSC-Medium, PingFang SC;
  358. font-weight: 500;
  359. border-radius: 50%;
  360. display: flex;
  361. justify-content: center;
  362. align-items: center;
  363. margin-right: 5px;
  364. margin-top: -20px;
  365. margin-left: 73px;
  366. }
  367. .eliminate2 {
  368. max-width: 50%;
  369. width: 20px;
  370. height: 20px;
  371. font-family: PingFangSC-Medium, PingFang SC;
  372. font-weight: 500;
  373. border-radius: 50%;
  374. display: flex;
  375. justify-content: center;
  376. align-items: center;
  377. margin-right: 5px;
  378. margin-top: -20px;
  379. margin-left: 100px;
  380. }
  381. .upload {
  382. margin-left: 157px;
  383. }
  384. }
  385. .wrap {
  386. background: #fff;
  387. margin: 10px;
  388. border-radius: 15px 10px;
  389. margin-top: 18px;
  390. input {}
  391. >.title {
  392. padding: 10px 16px;
  393. }
  394. }
  395. .footer {
  396. background: #fff;
  397. position: fixed;
  398. bottom: 0;
  399. width: 100%;
  400. padding: 20px 10px;
  401. z-index: 10;
  402. .button {
  403. background: #4089ff;
  404. width: 90%;
  405. margin: 250px auto;
  406. padding: 10px;
  407. color: #fff;
  408. text-align: center;
  409. border-radius: 30px;
  410. margin-top: 10px;
  411. }
  412. }
  413. .buns_item {
  414. display: flex;
  415. padding: 80rpx 0 50rpx 0;
  416. justify-content: space-around;
  417. }
  418. .but_css {
  419. background: #22C572;
  420. width: 40%;
  421. padding: 20rpx;
  422. color: #fff;
  423. text-align: center;
  424. border-radius: 20rpx;
  425. }
  426. /deep/.u-radio-group {
  427. flex-direction: row-reverse;
  428. }
  429. .no-boder {
  430. border: 0;
  431. }
  432. .textarea {
  433. background: #F9F9FA;
  434. border: 1px solid #EEEEEE;
  435. }
  436. .remark {
  437. position: absolute;
  438. right: 10px;
  439. bottom: 20px;
  440. color: #AFB3BF;
  441. }
  442. .voucher{
  443. margin-left: 20rpx;
  444. }
  445. .wrap1 {
  446. padding-bottom: 10px;
  447. font-size: 14px;
  448. background: #fff;
  449. margin: 10px;
  450. border-radius: 10px;
  451. input {
  452. font-size: 14px;
  453. }
  454. >.title {
  455. padding: 10px 16px;
  456. }
  457. }
  458. /deep/.skeletonwrap{
  459. height:100vh !important;
  460. top:-18px !important;
  461. }
  462. </style>