info.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830
  1. <template>
  2. <view>
  3. <u-navbar title="提现申请" v-if="step!=2" title-color="#101010"></u-navbar>
  4. <u-navbar title="提现申请" v-else :custom-back="step0Fn" title-color="#101010"></u-navbar>
  5. <u-tabs :list="list" v-if="step!=2" class="jputabs" style="border-bottom: 1px solid #E5E7EA;" :is-scroll="false"
  6. :current="current" @change="change"></u-tabs>
  7. <view class="step step0" v-show="step==0">
  8. <view class="withdraw">
  9. <view class="withdraw-head ">
  10. <view class="bclass">申请方</view>
  11. <view class="spanclass" >{{info.application.sharingCompanyName}}</view>
  12. </view>
  13. <view class="withdraw-head border-n">
  14. <view class="bclass">申请园区
  15. </view>
  16. <view class="spanclass" >{{info.application.ownerCompanyName}}</view>
  17. </view>
  18. <view class="withdraw-head ">
  19. <view class="bclass">提现状态</view>
  20. <view class="spanclass" :class="' statusN status'+info.application.status">
  21. {{info.application.statusText}}</view>
  22. </view>
  23. <view class="withdraw-head border-n">
  24. <view class="bclass">提现月份
  25. </view>
  26. <view class="spanclass" >{{info.application.applicationMonth}}</view>
  27. </view>
  28. <view class="withdraw-head ">
  29. <view class="bclass">抄表开始日期
  30. </view>
  31. <view class="spanclass" >{{info.application.startTime}}</view>
  32. </view>
  33. <view class="withdraw-head ">
  34. <view class="bclass">抄表截止日期
  35. </view>
  36. <view class="spanclass" >{{info.application.endTime}}</view>
  37. </view>
  38. </view>
  39. <view class="withdraw">
  40. <view class="withdraw-head ">
  41. <view class="bclass">本期代收费金额<br/>
  42. <b style="font-size: 24rpx;">(房租、物业、保洁)</b>
  43. </view>
  44. <view class="spanclass" >{{info.application.proxyFee}}元</view>
  45. </view>
  46. <view class="withdraw-head border-n">
  47. <view class="bclass">本期水电金额
  48. </view>
  49. <view class="spanclass" >{{info.application.electricityWaterFee}}元</view>
  50. </view>
  51. <view class="withdraw-head border-n">
  52. <view class="bclass">本期节能金额
  53. </view>
  54. <view class="spanclass" >{{info.application.energySavingFee}}元</view>
  55. </view>
  56. <view class="withdraw-head border-n">
  57. <view class="bclass">总金额
  58. </view>
  59. <view class="spanclass" >{{info.application.totalAmount}}元</view>
  60. </view>
  61. <view class="withdraw-head ">
  62. <view class="bclass">平台手续费率
  63. </view>
  64. <view class="spanclass" >{{info.application. transactionRatio*100}}%</view>
  65. </view>
  66. <view class="withdraw-head ">
  67. <view class="bclass">平台手续费
  68. </view>
  69. <view class="spanclass" >{{info.application. transactionFee}}元</view>
  70. </view>
  71. <view class="withdraw-head ">
  72. <view class="bclass">平台代收费分润比率
  73. </view>
  74. <view class="spanclass" >{{info.application. proxyFeeSharingRatio * 100}}%</view>
  75. </view>
  76. <view class="withdraw-head ">
  77. <view class="bclass">平台水电分润比率
  78. </view>
  79. <view class="spanclass" >{{info.application.electricityWaterFeeSharingRatio * 100}}%
  80. </view>
  81. </view>
  82. <view class="withdraw-head ">
  83. <view class="bclass">节能分润比率
  84. </view>
  85. <view class="spanclass" >{{info.application.energySavingFeeSharingRatio* 100}}%
  86. </view>
  87. </view>
  88. </view>
  89. <view class="withdraw">
  90. <view class="withdraw-head ">
  91. <view class="bclass">代收费分润金额 </view>
  92. <view class="spanclass" >{{info.application.proxyFeeSharingAmount}}元</view>
  93. </view>
  94. <view class="withdraw-head border-n">
  95. <view class="bclass">水电分润金额 </view>
  96. <view class="spanclass" >{{info.application. electricityWaterFeeSharingAmount}}元
  97. </view>
  98. </view>
  99. <view class="withdraw-head border-n">
  100. <view class="bclass">节能分润金额 </view>
  101. <view class="spanclass" >{{info.application.energySavingFeeSharingAmount}}元</view>
  102. </view>
  103. <view class="withdraw-head border-n">
  104. <view class="bclass">总分润金额 </view>
  105. <view class="spanclass" >{{info.application. platformSharingAmount}}元</view>
  106. </view>
  107. </view>
  108. <view class="withdraw">
  109. <view class="withdraw-head ">
  110. <view class="bclass">申请提现金额 </view>
  111. <view class="spanclass" >{{info.application.withdrawalAmount}}元</view>
  112. </view>
  113. <view class="withdraw-head border-n">
  114. <view class="bclass">大写 </view>
  115. <view class="spanclass" >{{applicationAmountDX()}}元</view>
  116. </view>
  117. </view>
  118. <view class="withdraw">
  119. <view class="withdraw-head withdraw-head2 ">
  120. <b class="asterisk"><text>*</text>收款户名
  121. </b>
  122. <u-input class="textarea" type="textarea" v-model="data.accountName" placeholder="请填写收款户名" height="96"
  123. cursor-spacing="8" />
  124. </view>
  125. <view class=" withdraw-head withdraw-head2 ">
  126. <view class="asterisk"><text>*</text>收款银行
  127. </view>
  128. <u-input class="textarea" type="textarea" v-model="data.bankName" placeholder="请填写收款银行全称" height="96"
  129. cursor-spacing="8" />
  130. </view>
  131. <view class="withdraw-head withdraw-head2 border-n">
  132. <view class="asterisk"><text>*</text>收款账号
  133. </view>
  134. <u-input class="textarea" v-model="data.accountNo" type="textarea" placeholder="提现人收款账号" height="96"
  135. cursor-spacing="8" />
  136. </view>
  137. </view>
  138. <view class="applyBtn" v-if="info.application.status==0">
  139. <u-button class="save" type="primary" @click="submit0()">申请提现</u-button>
  140. </view>
  141. </view>
  142. <view class="step step1" v-show="step==1">
  143. <scroll-view :scroll-x="true" :scroll-y="true" style="width: 750rpx;">
  144. <view class="applyBtn">
  145. <u-button class="save" type="success" @click="down()">下载对账单</u-button>
  146. </view>
  147. <table class="border-table " style="width: 1800px;" id="my-table-id">
  148. <tr>
  149. <td colspan=""></td>
  150. <td colspan="12">e家能源月度账单明细表</td>
  151. </tr>
  152. <tr>
  153. <td colspan=""></td>
  154. <td colspan="3">园区:{{info.parkName}}</td>
  155. <td colspan="9">抄表时间:{{info.startTime}}至{{info.endTime}}</td>
  156. </tr>
  157. <tr>
  158. <td width="50px">序号</td>
  159. <td width="250px">单位名称</td>
  160. <td width="220px">本期代收费金额<br />
  161. (房租、物业、保洁)</td>
  162. <td width="150px">本期使用电量(度)</td>
  163. <td width="150px">分摊线损(度)</td>
  164. <td width="150px">分摊公摊(度)</td>
  165. <td width="150px">电单价/度</td>
  166. <td width="150px">电费</td>
  167. <td width="150px">水单价/吨</td>
  168. <td width="150px">本期使用水量(吨)</td>
  169. <!-- <td width="150px">电单价/度</td> -->
  170. <td width="150px">水费</td>
  171. <!-- <td width="150px">分摊线损(度)</td>
  172. <td width="150px">分摊公摊(度)</td> -->
  173. <td width="150px">节能收益</td>
  174. <td width="150px">总收入</td>
  175. </tr>
  176. <tr v-for="(item,i) in info.monthList" :key="i">
  177. <td>{{item.index}}</td>
  178. <td>{{item.name}}</td>
  179. <td>{{item.proxyFee?item.proxyFee:'/'}}</td>
  180. <td>{{item.electricityConsumption?item.electricityConsumption:'/'}}</td>
  181. <td>{{item.lineLoss?item.lineLoss:'/'}}</td>
  182. <td>{{item.shareElectricityConsumption?item.shareElectricityConsumption:'/'}}</td>
  183. <td>{{item.electricityPrice?item.electricityPrice:'/'}}</td>
  184. <td>{{item.electricityFee?item.electricityFee:'/'}}</td>
  185. <td>{{item.waterPrice?item.waterPrice:'/'}}</td>
  186. <td>{{item.waterConsumption?item.waterConsumption:'/'}}</td>
  187. <td>{{item.waterFee?item.waterFee:'/'}}</td>
  188. <td>{{item.saveEnergyIncome?item.saveEnergyIncome:'/'}}</td>
  189. <td>{{item.totalAmount?item.totalAmount:'/'}}</td>
  190. </tr>
  191. <tr>
  192. <td></td>
  193. <td>合计</td>
  194. <td>{{sumKey('proxyFee')}}</td>
  195. <td>{{sumKey('electricityConsumption')}}</td>
  196. <td></td>
  197. <td></td>
  198. <td></td>
  199. <td>{{sumKey('electricityFee')}}</td>
  200. <td></td>
  201. <td>{{sumKey('waterConsumption')}}</td>
  202. <td>{{sumKey('waterFee')}}</td>
  203. <td>{{sumKey('saveEnergyIncome')}}</td>
  204. <td>{{sumKey('totalAmount')}}</td>
  205. </tr>
  206. </table>
  207. </scroll-view>
  208. </view>
  209. <view class="step step2" v-show="step==2">
  210. <view class="sign">
  211. <p>请在下方空白区域使用正楷字体进行电子签名</p>
  212. <view class="signature">
  213. <l-signature disableScroll ref="signatureRef" :penColor="penColor" :penSize="penSize"
  214. :openSmooth="openSmooth"></l-signature>
  215. </view>
  216. <view class="clean-save">
  217. <view class="clean" @click="onClick('clear')">
  218. <img src="@/assets/img/riLine-eraser-line.svg" alt="">
  219. <view class="">
  220. 清除
  221. </view>
  222. </view>
  223. <view class="save" @click="onClick('save')">
  224. <img src="@/assets/img/riLine-eraser-line.svg" alt="">
  225. <view class="">
  226. 保存并提交
  227. </view>
  228. </view>
  229. </view>
  230. <view v-if="info&&info.application&&info.application.signUrl" style="margin-top: 20px;">使用上一次签字</view>
  231. <img :src="data.signUrl" v-if="info&&info.application&&info.application.signUrl" style="width: 100%;border: 1px solid;">
  232. <button v-if="info.application.signUrl" class="submit" @click="submit()">提交确认单</button>
  233. </view>
  234. </view>
  235. </view>
  236. </template>
  237. <script>
  238. import * as API from '@/apis/pagejs/withdrawal.js'
  239. import LSignature from '@/components/l-signature/l-signature.vue'
  240. //import * as API_Common from '@/apis/common.js'
  241. // import XLSX from 'xlsx';
  242. //import * as XLSX from 'xlsx/xlsx.mjs';
  243. // var XLSX = require("xlsx");
  244. import {
  245. DX
  246. } from '@/apis/utils'
  247. export default {
  248. data() {
  249. return {
  250. step: 0,
  251. list: [{
  252. name: '提现申请单'
  253. }, {
  254. name: '收入明细'
  255. }],
  256. id: "",
  257. current: 0,
  258. info: {
  259. application: {},
  260. endTime: "",
  261. monthList: [],
  262. parkName: "",
  263. startTime: ""
  264. },
  265. data: {},
  266. penColor: '',
  267. penSize: 5,
  268. openSmooth: true,
  269. url: '',
  270. suburl: '',
  271. nowTime: "",
  272. serverUrl: "",
  273. token: "",
  274. };
  275. },
  276. onLoad(op) {
  277. if (op.id) {
  278. this.id = op.id
  279. this.getInfo()
  280. }
  281. },
  282. methods: {
  283. down() {
  284. uni.showLoading({
  285. title: "提交中...",
  286. mask: true,
  287. })
  288. this.data.recordId = this.id
  289. API.exportMonthReport(this.data).then((res) => {
  290. var url=res.data
  291. window.location.href = url
  292. uni.hideLoading()
  293. }).catch(error => {
  294. uni.hideLoading()
  295. uni.showModal({
  296. title: "提示",
  297. content: error,
  298. showCancel: false
  299. })
  300. })
  301. },
  302. submit() {
  303. if (this.data.signUrl) {
  304. this.data.status = 0;
  305. this.submitFrom()
  306. } else {
  307. uni.showToast({
  308. title: "请签字后提交"
  309. })
  310. }
  311. },
  312. submitFrom() {
  313. uni.showLoading({
  314. title: "提交中...",
  315. mask: true,
  316. })
  317. //this.info.status=5;
  318. //var str=JSON.stringify();
  319. this.data.recordId = this.id
  320. API.apply(this.data).then((res) => {
  321. const eventChannel = this.getOpenerEventChannel();
  322. eventChannel.emit('refreshData');
  323. uni.hideLoading()
  324. uni.showModal({
  325. title: '提示',
  326. content: '提交成功,等待财务审核!',
  327. showCancel: false,
  328. success: function(res) {
  329. if (res.confirm) {
  330. uni.navigateBack()
  331. } else if (res.cancel) {
  332. //.log('用户点击取消');
  333. }
  334. }
  335. });
  336. }).catch(error => {
  337. uni.hideLoading()
  338. uni.showModal({
  339. title: "提示",
  340. content: error,
  341. showCancel: false
  342. })
  343. })
  344. },
  345. uploadpic() {
  346. uni.showLoading({
  347. title: '上传中'
  348. });
  349. this.token = this.carhelp.getToken();
  350. this.serverUrl = process.car.BASE_URL;
  351. var time = ""; //parseUnixTime(new Date(), '{y}{m}{d}-{h}-{i}');
  352. uni.request({
  353. url: this.serverUrl + "/uploadBase64Json",
  354. method: "POST",
  355. header: {
  356. Authorization: this.token
  357. },
  358. data: {
  359. "photoName": "signature" + time + ".png",
  360. "photoBase64Data": this.url
  361. },
  362. success: (res) => {
  363. uni.hideLoading();
  364. console.log(res)
  365. if (res.data.result) {
  366. uni.showToast({
  367. title: '签名保存成功!',
  368. duration: 2000
  369. });
  370. //this.info.status=0;
  371. this.data.signUrl = res.data.data;
  372. //this.$emit("signsubmit",0,this.suburl)
  373. this.submitFrom()
  374. } else {
  375. uni.showToast({
  376. title: '签名保存失败!' + JSON.stringify(res),
  377. duration: 2000
  378. });
  379. }
  380. }
  381. })
  382. },
  383. onClick(type) {
  384. this.url = ""
  385. if (type == 'openSmooth') {
  386. this.openSmooth = !this.openSmooth
  387. return
  388. }
  389. if (type == 'save') {
  390. this.$refs.signatureRef.canvasToTempFilePath({
  391. success: (res) => {
  392. // 是否为空画板 无签名
  393. if (res.isEmpty) {
  394. this.url = "";
  395. } else {
  396. this.url = res.tempFilePath
  397. console.log(this.url)
  398. // 生成图片的临时路径
  399. // app | H5 | 微信小程序 生成的是base64
  400. this.uploadpic()
  401. //this.data.signUrl=this.url
  402. // this.submitFrom()
  403. }
  404. }
  405. })
  406. return
  407. }
  408. if (this.$refs.signatureRef)
  409. this.$refs.signatureRef[type]()
  410. },
  411. applicationAmountDX() {
  412. if (this.info.application.withdrawalAmount) {
  413. var c = DX(this.info.application.withdrawalAmount)
  414. return c
  415. } else {
  416. return ''
  417. }
  418. },
  419. sumKey(key) {
  420. var num = 0
  421. this.info.monthList.forEach(item => {
  422. var n = item[key]
  423. if (n) {
  424. num += n
  425. }
  426. })
  427. return num.toFixed(2)
  428. },
  429. getInfo() {
  430. uni.showLoading({
  431. title: "加载中",
  432. mask: true,
  433. })
  434. API.recordDetails({
  435. recordId: this.id
  436. }).then((res) => {
  437. uni.hideLoading();
  438. this.info = res.data
  439. this.data.accountName = this.info.application.accountName
  440. this.data.bankName = this.info.application.bankName
  441. this.data.accountNo = this.info.application.accountNo
  442. this.data.signUrl = this.info.application.signUrl
  443. }).catch(error => {
  444. uni.showToast({
  445. title: error,
  446. icon: "none"
  447. })
  448. })
  449. },
  450. change(index) {
  451. this.current = index;
  452. this.step = index
  453. },
  454. submit0() {
  455. if (!this.data.accountName) {
  456. uni.showToast({
  457. title: "请输入收款户名"
  458. })
  459. return
  460. }
  461. if (!this.data.bankName) {
  462. uni.showToast({
  463. title: "请输入收款银行"
  464. })
  465. return
  466. }
  467. if (!this.data.accountNo) {
  468. uni.showToast({
  469. title: "请输入收款账号"
  470. })
  471. return
  472. }
  473. this.step = 2
  474. this.$forceUpdate()
  475. console.log(this.step)
  476. },
  477. step0Fn() {
  478. this.step = 0
  479. }
  480. }
  481. }
  482. </script>
  483. <style lang="scss" scoped>
  484. .sign {
  485. margin: 32rpx 16rpx;
  486. font-weight: bold;
  487. line-height: 20px;
  488. p {
  489. color: rgba(16, 16, 16, 1);
  490. }
  491. .signature {
  492. background-color: #fff;
  493. margin-top: 8px;
  494. height: 160px;
  495. border: #c2c2c2 1px solid;
  496. }
  497. .clean-save {
  498. background-color: #fff;
  499. display: flex;
  500. .clean,
  501. .save {
  502. width: 50%;
  503. text-align: center;
  504. color: #252525;
  505. line-height: 40px;
  506. }
  507. .clean,
  508. .save {
  509. border: #c2c2c2 1px solid;
  510. display: flex;
  511. justify-content: center;
  512. img {
  513. margin-right: 4px;
  514. }
  515. }
  516. }
  517. }
  518. .submit {
  519. border-radius: 8px;
  520. background-color: rgba(24, 90, 198, 1);
  521. color: rgba(255, 255, 255, 1);
  522. font-size: 16px;
  523. line-height: 44px;
  524. margin: 0 16px;
  525. position: fixed;
  526. bottom: 12px;
  527. left: 0;
  528. right: 0;
  529. }
  530. .submitNo {
  531. border-radius: 8px;
  532. background-color: #185ac6a8;
  533. color: rgba(255, 255, 255, 1);
  534. font-size: 16px;
  535. line-height: 44px;
  536. margin: 0 16px;
  537. position: fixed;
  538. bottom: 12px;
  539. left: 0;
  540. right: 0;
  541. }
  542. .jputabs {
  543. //position: absolute;
  544. position: fixed;
  545. background-color: #FFF;
  546. width: 100%;
  547. top: 40px;
  548. z-index: 99;
  549. }
  550. .withdraw {
  551. margin-bottom: 16rpx;
  552. background-color: #fff;
  553. padding: 0px 32rpx 0 32rpx;
  554. .withdraw-head {
  555. padding: 24rpx 0;
  556. border-bottom: 1px solid #E5E7EA;
  557. align-items: center;
  558. position: relative;
  559. display: flex;
  560. .unit {
  561. position: absolute;
  562. top: 34rpx;
  563. right: 0;
  564. }
  565. .whthdraw-price {
  566. font-size: 36px;
  567. color: #101010;
  568. font-weight: 600;
  569. }
  570. .bclass {
  571. color: rgba(119, 119, 119, 100);
  572. font-size: 32rpx;
  573. width: 320rpx;
  574. min-width: 320rpx;
  575. }
  576. .spanclass {
  577. text-align: left;
  578. font-size: 32rpx;
  579. color: #333333;
  580. }
  581. .status0 {
  582. color: #FF9800;
  583. }
  584. .status1 {
  585. color: #4CAF50;
  586. }
  587. .statusN {}
  588. }
  589. .withdraw-head2{
  590. display: inline;
  591. }
  592. .withdraw-main {
  593. border-top: 1px solid #f7f7f7;
  594. border-bottom: 1px solid #f7f7f7;
  595. margin: 32rpx 0;
  596. padding: 32rpx 0;
  597. .withdraw-input {
  598. margin-top: 64rpx;
  599. display: flex;
  600. align-items: center;
  601. font-size: 56rpx;
  602. ::v-deep.uni-input-input {
  603. font-size: 28rpx;
  604. }
  605. }
  606. }
  607. .withdraw-foot {
  608. display: flex;
  609. align-items: center;
  610. p {
  611. color: #999
  612. }
  613. span {
  614. color: #2979FF;
  615. margin-left: 32rpx;
  616. }
  617. }
  618. }
  619. .asterisk {
  620. position: relative;
  621. text {
  622. position: absolute;
  623. top: 0px;
  624. left: -14rpx;
  625. color: #EE3138;
  626. }
  627. }
  628. .textarea {
  629. background-color: rgba(242, 242, 242, 100);
  630. margin-top: 12px;
  631. line-height: 20px;
  632. border-radius: 4px;
  633. color: rgba(136, 136, 136, 100);
  634. .uni-textarea-placeholder {
  635. padding: 0 16rpx;
  636. }
  637. ::v-deep.uni-textarea-textarea {
  638. width: 90%;
  639. padding: 0 16rpx;
  640. }
  641. }
  642. .applyBtn {
  643. padding: 0 48rpx;
  644. font-size: 32rpx;
  645. line-height: 88rpx;
  646. height: 120rpx;
  647. position: fixed;
  648. bottom: 0;
  649. left: 0;
  650. right: 0;
  651. }
  652. .step {
  653. padding-bottom: 120rpx;
  654. }
  655. .step0,
  656. .step1 {
  657. padding-top: 90rpx;
  658. }
  659. .step1 {
  660. width: 300%;
  661. }
  662. .table1,
  663. .border-table {
  664. margin: 8rpx 0;
  665. width: 100%;
  666. border-collapse: collapse;
  667. td {
  668. border: 1px solid #e7e7e7;
  669. padding: 16rpx 16rpx;
  670. }
  671. tr {
  672. background-color: #f5f5f6
  673. }
  674. tr {
  675. td:first-child {
  676. //text-align: center;
  677. }
  678. td:last-child {
  679. white-space: pre;
  680. }
  681. }
  682. .tr1 {
  683. text-align: end;
  684. font-weight: bold;
  685. }
  686. tr:nth-child(even) {
  687. background-color: #fff;
  688. }
  689. }
  690. </style>