apply_see_reimbursement.vue 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457
  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. var that = this
  101. this.$api.doRequest('get', '/fuelFillingInfo/getFilling', {
  102. id: this.id
  103. }).then(res => {
  104. if (res.data.code == 200) {
  105. this.detailData = res.data.data
  106. let urlList = []
  107. if (this.detailData.fillingDetailInfo.addressUrl) {
  108. let datalist = this.detailData.fillingDetailInfo.addressUrl.split(",")
  109. for (let j = 0; j < datalist.length; j++) {
  110. urlList.push({
  111. url: datalist[j]
  112. })
  113. }
  114. this.detailData.fillingDetailInfo.urlList = urlList
  115. }
  116. // setTimeout(()=>{
  117. // that.loading=false
  118. // },1000)
  119. }
  120. })
  121. },
  122. onError(error) {
  123. alert(error)
  124. console.log('------------error-----------')
  125. console.log(error)
  126. },
  127. onProgress(e) {
  128. console.log(e)
  129. },
  130. onRemove(index, num) {
  131. this.fillingDetail.fillingDetailInfoList[num].addressUrl.splice(index, 1)
  132. },
  133. filterFileType(index, lists) {
  134. if (lists[index].fileType != 'jpg' && lists[index].fileType != 'png' && lists[index].fileType != 'gif') {
  135. lists.splice(index, 1);
  136. // 当前文件不支持
  137. uni.showModal({
  138. title: '暂不支持当前图片类型',
  139. showCancel: false
  140. });
  141. } else {
  142. this.isAdd = false;
  143. }
  144. },
  145. calculate(index) {
  146. this.fillingDetail.fillingDetailInfoList[index].currentConsumption = (this.fillingDetail
  147. .fillingDetailInfoList[index].oilConsumption * this.fillingDetail.fillingDetailInfoList[index]
  148. .currentOilPrice)
  149. .toFixed(2)
  150. this.tfc = ""
  151. this.totalCost = ""
  152. for (let i = 0; i < this.fillingDetail.fillingDetailInfoList.length; i++) {
  153. this.tfc = (Number(this.tfc) + Number(this.fillingDetail.fillingDetailInfoList[i].oilConsumption))
  154. .toFixed(2)
  155. this.totalCost = (Number(this.totalCost) + Number(this.fillingDetail.fillingDetailInfoList[i]
  156. .currentConsumption)).toFixed(2)
  157. this.$forceUpdate()
  158. }
  159. },
  160. delApply(index) {
  161. this.fillingDetail.fillingDetailInfoList.splice(index, 1)
  162. },
  163. addApply() {
  164. this.fillingDetail.fillingDetailInfoList.push({
  165. oilConsumption: "",
  166. currentOilPrice: "",
  167. currentConsumption: "",
  168. addressUrl: [],
  169. compId: uni.getStorageSync('pcUserInfo').compId,
  170. commonId: uni.getStorageSync('pcUserInfo').userId,
  171. fillingId: this.id
  172. })
  173. },
  174. submitApply() {
  175. var that = this
  176. uni.showModal({
  177. content: "确定提交申请信息?",
  178. showCancel: true,
  179. confirmText: '提交',
  180. success: function(res) {
  181. if (res.confirm) {
  182. that.fillingDetail.tfc = that.tfc
  183. that.fillingDetail.totalCost = that.totalCost
  184. for (let i = 0; i < that.fillingDetail.fillingDetailInfoList.length; i++) {
  185. that.fillingDetail.fillingDetailInfoList[i].addressUrl = that.fillingDetail
  186. .fillingDetailInfoList[i].addressUrl.toString()
  187. }
  188. that.$api.doRequest('post', '/fillingDetailInfo/api/addFillingDetail',
  189. that.fillingDetail
  190. )
  191. .then(res => {
  192. if (res.data.code == 200) {
  193. that.$api.msg('提交成功')
  194. uni.navigateBack({
  195. delta: 1
  196. });
  197. } else {
  198. that.$api.msg('提交失败')
  199. }
  200. })
  201. }
  202. }
  203. })
  204. },
  205. }
  206. }
  207. </script>
  208. <style lang='scss' scoped>
  209. .center {
  210. padding-bottom: 220rpx;
  211. }
  212. page {
  213. background: #F5F6FA;
  214. }
  215. .title_b {
  216. margin: 20rpx 20rpx 0rpx 20rpx;
  217. padding: 20rpx 10rpx 20rpx 10rpx;
  218. font-weight: 550;
  219. }
  220. .c-row {
  221. display: -webkit-box;
  222. display: -webkit-flex;
  223. display: flex;
  224. -webkit-box-align: center;
  225. -webkit-align-items: center;
  226. align-items: center;
  227. padding: 10rpx 30rpx;
  228. position: relative;
  229. }
  230. .level2-title {}
  231. .level2-title {
  232. font-weight: 700;
  233. color: #000000;
  234. }
  235. .jt-icon {
  236. position: relative;
  237. top: 6rpx;
  238. width: 60rpx;
  239. margin: 0 20rpx;
  240. }
  241. .xf-iamge {
  242. width: 74rpx;
  243. height: 43rpx;
  244. position: absolute;
  245. top: -20rpx;
  246. right: 0;
  247. }
  248. .ssx {
  249. width: 20px;
  250. height: 20px;
  251. background: linear-gradient(180deg, #C8D7E5 0%, #AFC1D6 100%);
  252. font-family: PingFangSC-Medium, PingFang SC;
  253. font-weight: 500;
  254. color: #FFFFFF;
  255. border-radius: 50%;
  256. display: flex;
  257. justify-content: center;
  258. align-items: center;
  259. margin-right: 5px;
  260. }
  261. .con-list {
  262. -webkit-box-flex: 1;
  263. -webkit-flex: 1;
  264. flex: 1;
  265. display: -webkit-box;
  266. display: -webkit-flex;
  267. display: flex;
  268. -webkit-box-orient: vertical;
  269. -webkit-box-direction: normal;
  270. -webkit-flex-direction: column;
  271. flex-direction: column;
  272. color: #303133;
  273. line-height: 40rpx;
  274. text-align: right;
  275. .item1,
  276. .item3 {
  277. // width: 40%;
  278. display: flex;
  279. .text {
  280. text-overflow: ellipsis;
  281. overflow: hidden;
  282. white-space: nowrap;
  283. }
  284. }
  285. .item1 .text {
  286. text-align: left;
  287. }
  288. .item3 .text {
  289. text-align: right;
  290. }
  291. }
  292. .align-center {
  293. align-items: center;
  294. justify-content: flex-end;
  295. }
  296. .wrap1 {
  297. margin: 10px;
  298. border-radius: 15px 10px;
  299. margin-top: 18px;
  300. .tit {
  301. margin-left: 14px;
  302. width: 47px;
  303. padding-top: 10px;
  304. }
  305. .eliminate1 {
  306. max-width: 50%;
  307. width: 20px;
  308. height: 20px;
  309. font-family: PingFangSC-Medium, PingFang SC;
  310. font-weight: 500;
  311. border-radius: 50%;
  312. display: flex;
  313. justify-content: center;
  314. align-items: center;
  315. margin-right: 5px;
  316. margin-top: -20px;
  317. margin-left: 73px;
  318. }
  319. .eliminate2 {
  320. max-width: 50%;
  321. width: 20px;
  322. height: 20px;
  323. font-family: PingFangSC-Medium, PingFang SC;
  324. font-weight: 500;
  325. border-radius: 50%;
  326. display: flex;
  327. justify-content: center;
  328. align-items: center;
  329. margin-right: 5px;
  330. margin-top: -20px;
  331. margin-left: 100px;
  332. }
  333. .upload {
  334. margin-left: 157px;
  335. }
  336. }
  337. .wrap {
  338. background: #fff;
  339. margin: 10px;
  340. border-radius: 15px 10px;
  341. margin-top: 18px;
  342. input {}
  343. >.title {
  344. padding: 10px 16px;
  345. }
  346. }
  347. .footer {
  348. background: #fff;
  349. position: fixed;
  350. bottom: 0;
  351. width: 100%;
  352. padding: 20px 10px;
  353. z-index: 10;
  354. .button {
  355. background: #4089ff;
  356. width: 90%;
  357. margin: 250px auto;
  358. padding: 10px;
  359. color: #fff;
  360. text-align: center;
  361. border-radius: 30px;
  362. margin-top: 10px;
  363. }
  364. }
  365. .buns_item {
  366. display: flex;
  367. padding: 80rpx 0 50rpx 0;
  368. justify-content: space-around;
  369. }
  370. .but_css {
  371. background: #22C572;
  372. width: 40%;
  373. padding: 20rpx;
  374. color: #fff;
  375. text-align: center;
  376. border-radius: 20rpx;
  377. }
  378. /deep/.u-radio-group {
  379. flex-direction: row-reverse;
  380. }
  381. .no-boder {
  382. border: 0;
  383. }
  384. .textarea {
  385. background: #F9F9FA;
  386. border: 1px solid #EEEEEE;
  387. }
  388. .remark {
  389. position: absolute;
  390. right: 10px;
  391. bottom: 20px;
  392. color: #AFB3BF;
  393. }
  394. .voucher {
  395. margin-left: 20rpx;
  396. }
  397. .wrap1 {
  398. /* padding-bottom: 10px; */
  399. font-size: 14px;
  400. background: #fff;
  401. margin: 10px;
  402. border-radius: 10px;
  403. input {
  404. font-size: 14px;
  405. }
  406. >.title {
  407. padding: 10px 16px;
  408. }
  409. }
  410. /deep/.skeletonwrap {
  411. height: 100vh !important;
  412. top: -18px !important;
  413. }
  414. </style>