apply_see_reimbursement.vue 11 KB

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