apply_see_reimbursement.vue 10 KB

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