apply_see_reimbursement.vue 9.6 KB

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