companybill.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663
  1. <template>
  2. <view class="page">
  3. <u-tabs :list="tabs" @click="sectionChange" style="background-color: #fff;" :current=current
  4. :itemStyle="{'width':'375rpx','padding':'24rpx'}" lineHeight="2px" lineWidth="30px"></u-tabs>
  5. <view class="contain" v-show="cdshow==true">
  6. <!-- 日期选择器 -->
  7. <!-- <view class="topbilledit">
  8. <view class="changetime1">
  9. <picker mode="date" :value="dataForm.costCycle" fields="month" @change="dateChange">
  10. <view class="selestDate">{{dataForm.costCycle}}</view>
  11. </picker>
  12. </view>
  13. <view class="changetime2">
  14. <u-icon name="arrow-down-fill" color="#666666" size="20"></u-icon>
  15. </view>
  16. </view> -->
  17. <view class="nodata" v-if="nodata==true">
  18. 暂无数据
  19. </view>
  20. <template v-if="nodata==false">
  21. <!-- <view style="padding:16rpx 0 16rpx 32rpx">
  22. 共有 <span style="color: red">{{totalnumber}}</span>条记录
  23. </view> -->
  24. <view class="paisong2" style="margin-top: 16rpx;">
  25. <view class="status s2">
  26. 待支付
  27. </view>
  28. <view class="subtit">
  29. 物业费: <span>¥{{zddata.amount}}</span>
  30. </view>
  31. <view class="subtit">
  32. 管理费:¥ {{zddata.glf}}
  33. </view>
  34. <view class="subtit">
  35. 中央空调使用费:¥ {{zddata.ktf}}
  36. </view>
  37. <view class="subtit">
  38. 电梯费:¥ {{zddata.dtf}}
  39. </view>
  40. </view>
  41. </template>
  42. </view>
  43. <!-- 缴费记录 -->
  44. <view class="contain" v-show="cdshow==false">
  45. <view class="topbilledit" @click="typechange">
  46. <view class="changetime1">
  47. {{expensedata}}
  48. </view>
  49. <view class="changetime2">
  50. <u-icon name="arrow-down-fill" color="#999" size="20"></u-icon>
  51. </view>
  52. </view>
  53. <!-- 列表 -->
  54. <view class="nodata" v-if="jfnodata==true">
  55. 暂无数据
  56. </view>
  57. <view class="u-listdata" v-if="jfnodata==false">
  58. <view style="padding:16rpx 0 16rpx 32rpx">
  59. 共有 <span style="color: red">{{totalnumber}}</span>条记录
  60. </view>
  61. <u-list @scrolltolower="scrolltolower" :pagingEnabled='true'
  62. style="height:400px;flex:1;padding-bottom: 49px;">
  63. <u-list-item v-for="(item, index) in indexList" :key="index">
  64. <view class="paisong2">
  65. <view class="status" v-if="item.status==1">
  66. 预存
  67. </view>
  68. <view class="title">{{item.tenantInfo.name}}</view>
  69. <view class="subtit">
  70. 扣缴金额: <span>¥{{item.amount}}</span>
  71. </view>
  72. <view class="subtit">
  73. 账户余额: {{item.surplus}}
  74. </view>
  75. <view class="subtit">
  76. 租户电话:¥{{item.tenantInfo.tel}}
  77. </view>
  78. <view class="subtit">
  79. 操作人: {{item.creator}}
  80. </view>
  81. <view class="subtit">
  82. 扣缴时间: {{item.createDate}}
  83. </view>
  84. </view>
  85. </u-list-item>
  86. </u-list>
  87. <view class="Predeposit" v-show="dibucaidan">
  88. <span @click="prestore('预存')">预存</span>
  89. <span @click="prestore('补助')">补助</span>
  90. </view>
  91. </view>
  92. </view>
  93. <u-picker :show="showtype" :itemHeight="80" :columns="columnstype" keyName="dictLabel" @confirm="confirmtype"
  94. @cancel='canceltype'> </u-picker>
  95. <u-popup :show="showpayjine" @close="closepay1" @open="openpay1" mode="bottom" :round="10" :closeable=true
  96. :closeOnClickOverlay=true>
  97. <view class="paytall1" style="padding-bottom: 20rpx;">
  98. <view class="hejitop">
  99. {{prestorename}}
  100. </view>
  101. <view class="zhifufs">
  102. <u--form labelWidth="30" labelPosition="left" :model="model1" :rules="rules" ref="uForm">
  103. <u-form-item label="¥" prop="userInfo.amount" ref="item1">
  104. <u--input v-model="model1.userInfo.amount" border="none" placeholder="点击输入金额"></u--input>
  105. </u-form-item>
  106. </u--form>
  107. </view>
  108. <view style="margin:0 32rpx">
  109. <u-button type="primary" text="确认支付" @click="Confirmationpaymentjine"></u-button>
  110. </view>
  111. </view>
  112. <!-- <view class="paytall">
  113. <view class="hejitop">
  114. {{prestorename}}
  115. </view>
  116. <view class="zhifufs">
  117. <u--form labelWidth="30" labelPosition="left" :model="model1" :rules="rules" ref="uForm">
  118. <u-form-item label="¥" prop="userInfo.amount" borderBottom ref="item1">
  119. <u--input v-model="model1.userInfo.amount" border="none" placeholder="点击输入金额"></u--input>
  120. </u-form-item>
  121. </u--form>
  122. </view>
  123. <view style="margin: 0 32rpx;">
  124. <u-button type="primary" text="确定" @click="Confirmationpaymentjine"></u-button>
  125. </view>
  126. </view> -->
  127. </u-popup>
  128. <view class="canys" v-if="zhifucanvas">
  129. <h4>请用微信扫码二维码</h4>
  130. <canvas class="zhifucanvas" canvas-id='canvas'></canvas>
  131. <view class="guanbi">
  132. <u-button type="primary" :plain="true" style="border:none" text="关闭" @click="guanbi"></u-button>
  133. </view>
  134. </view>
  135. <u-notify ref="uNotify" message=""></u-notify>
  136. </view>
  137. </template>
  138. <script>
  139. import qs from 'qs'
  140. var QRCode = require('@/utils/qrcode.js');
  141. const BaseApi = require("@/http/baseApi.js");
  142. export default {
  143. data() {
  144. return {
  145. tabs: [{
  146. name: '账单明细',
  147. }, {
  148. name: '扣缴记录'
  149. }],
  150. zhifucanvas: false,
  151. dibucaidan: true,
  152. prestorename: '',
  153. model1: {
  154. userInfo: {
  155. amount: '',
  156. },
  157. },
  158. rules: {
  159. 'userInfo.amount': {
  160. type: 'string',
  161. required: true,
  162. message: '请填写预存金额',
  163. trigger: ['blur', 'change']
  164. },
  165. },
  166. showpayjine: false,
  167. totalnumber: 0,
  168. jfnodata: false,
  169. showtype: false,
  170. cdshow: true,
  171. fatherparameter: {},
  172. expensedata: '全部',
  173. list: ['账单明细', '缴费记录', ],
  174. current: 0,
  175. dataForm: {
  176. tenantId: "",
  177. costCycle: "",
  178. type: "",
  179. page: 1,
  180. limit: 10,
  181. },
  182. indexList: [],
  183. payStatusList: [],
  184. zddata: {
  185. amount: '',
  186. dtf: '',
  187. ktf: '',
  188. glf: '',
  189. },
  190. nodata: true,
  191. pd: true,
  192. columnstype: [],
  193. jfpost: {
  194. tenantId: "",
  195. costCycle: "",
  196. type: "",
  197. page: 1,
  198. limit: 10,
  199. },
  200. }
  201. },
  202. //监听页面加载,其参数为上个页面传递的数据,参数类型为 Object(用于页面传参
  203. onLoad: function(options) {
  204. //option为object类型,会序列化上个页面传递的参数
  205. this.fatherparameter = JSON.parse(decodeURIComponent(options.para));
  206. let getDictDataList = uni.getStorageSync('getDictDataList');
  207. for (let i = 0; i < getDictDataList.length; i++) {
  208. if (getDictDataList[i].dictType == 'PayType') {
  209. this.columnstype = [getDictDataList[i].dataList]
  210. }
  211. if (getDictDataList[i].dictType == 'PayStatus') {
  212. this.payStatusList = [getDictDataList[i].dataList]
  213. }
  214. }
  215. this.dataForm.tenantId = this.fatherparameter.id;
  216. this.dataForm.costCycle = this.fatherparameter.cycle;
  217. this.dataForm.page = 1;
  218. this.jfpost.tenantId = this.fatherparameter.id;
  219. this.jfpost.costCycle = this.fatherparameter.cycle;
  220. this.jfpost.page = 1;
  221. this.getalldata();
  222. // this.getPayStatusList();
  223. //this.getPayTypeList();
  224. },
  225. //监听页面初次渲染完成。注意如果渲染速度快,会在页面进入动画完成前触发
  226. onReady() {},
  227. //监听页面隐藏
  228. onHide() {},
  229. //监听窗口尺寸变化
  230. onResize() {},
  231. //监听页面卸载
  232. onUnload() {},
  233. //监听用户下拉动作,一般用于下拉刷新
  234. onPullDownRefresh() {},
  235. methods: {
  236. prestore(e) {
  237. this.showpayjine = true;
  238. this.dibucaidan = false;
  239. this.prestorename = e;
  240. },
  241. Confirmationpaymentjine() {
  242. this.$refs.uForm.validate().then(res => {
  243. this.showpayjine = false;
  244. this.Predepositshow = false;
  245. this.dibucaidan = true;
  246. if (this.prestorename == '预存') {
  247. this.prestoredata(this.model1.userInfo.amount)
  248. } else if (this.prestorename == '补助') {
  249. this.subsidydata(this.model1.userInfo.amount)
  250. } else if (this.prestorename == '退费') {
  251. // this.refunddata(this.model1.userInfo.amount)
  252. }
  253. }).catch(errors => {
  254. uni.$u.toast('校验失败');
  255. })
  256. },
  257. //预存
  258. prestoredata(e) {
  259. this.zhifucanvas = true;
  260. let postdata = {
  261. totalFee: e,
  262. tenantId: this.dataForm.tenantId,
  263. tradeType: 'NATIVE',
  264. billIds: ''
  265. }
  266. uni.request({
  267. url: BaseApi.BaseApi + '/pay/createOrder',
  268. method: "POST",
  269. data: postdata,
  270. header: {
  271. 'content-type': 'application/x-www-form-urlencoded',
  272. "token": uni.getStorageSync('tokendata'),
  273. },
  274. success: (res) => {
  275. let qrcode = new QRCode('canvas', {
  276. text: res.data.codeUrl, // weixin://wxpay/bizpayurl?pr=sZz****
  277. width: 213,
  278. height: 213,
  279. colorDark: "black",
  280. colorLight: "white",
  281. correctLevel: QRCode.CorrectLevel.H,
  282. });
  283. // 10秒之后调取查询订单
  284. let that = this;
  285. setTimeout(function() {
  286. that.zhifucanvas = false;
  287. that.zddata = {};
  288. that.dataForm.page = 1;
  289. that.getalldata();
  290. this.jfpost.page = 1;
  291. this.indexList = [];
  292. this.getjfdata();
  293. }, 15000);
  294. }
  295. });
  296. },
  297. //补助
  298. subsidydata(e) {
  299. let postdata = {
  300. totalFee: e,
  301. tenantId: this.fatherparameter.id,
  302. tradeType: 'NATIVE',
  303. billIds: ''
  304. }
  305. this.$api.postJson('/pay/createOrder', postdata)
  306. .then(res => {
  307. this.$refs.uNotify.success('补助成功')
  308. })
  309. },
  310. closepay1() {
  311. this.showpayjine = false
  312. this.dibucaidan = true;
  313. },
  314. openpay1() {
  315. console.log('open');
  316. },
  317. guanbi() {
  318. this.zhifucanvas = false;
  319. this.Predepositshow = true;
  320. this.getalldata();
  321. this.getjfdata();
  322. },
  323. canceltype() {
  324. this.showtype = false;
  325. },
  326. confirmtype(e) {
  327. this.showtype = false;
  328. this.expensedata = e.value[0].dictLabel;
  329. if (e.value[0].dictLabel == '全部') {
  330. this.jfpost.type = '';
  331. } else {
  332. this.jfpost.type = e.value[0].dictValue;
  333. }
  334. this.indexList = [];
  335. this.jfpost.page = 1;
  336. this.getjfdata();
  337. },
  338. typechange() {
  339. this.showtype = true;
  340. },
  341. sectionChange(val) {
  342. this.current = val.index;
  343. console.log(val.index)
  344. if (val.index == 0) {
  345. this.cdshow = true;
  346. } else if (val.index == 1) {
  347. this.cdshow = false;
  348. this.indexList = [];
  349. this.jfpost.page = 1;
  350. this.getjfdata();
  351. }
  352. },
  353. scrolltolower() {
  354. if (this.pd) {
  355. this.getjfdata();
  356. } else {
  357. return
  358. }
  359. },
  360. getjfdata() {
  361. this.$api.get('/payrecord/page', this.jfpost)
  362. .then(res => {
  363. this.totalnumber = res.data.data.total;
  364. // console.log('111111111111111111',res.data.data.list)
  365. if (res.data.data.list.length != 0) {
  366. this.indexList.push(...res.data.data.list);
  367. this.jfpost.page = this.jfpost.page + 1;
  368. this.pd = true;
  369. this.jfnodata = false;
  370. } else {
  371. uni.showToast({
  372. title: '暂无更多数据了',
  373. icon: 'none',
  374. duration: 1500
  375. })
  376. this.pd = false;
  377. }
  378. })
  379. },
  380. dateChange(e) {
  381. this.myday = e.target.value;
  382. this.dataForm.costCycle = e.target.value;
  383. this.jfpost.costCycle = e.target.value;
  384. this.zddata = {};
  385. this.dataForm.page = 1;
  386. this.getalldata();
  387. },
  388. getalldata() {
  389. this.$api.post('/billinfo/billDetail', this.dataForm)
  390. .then(res => {
  391. this.totalnumber = res.data.data.total;
  392. this.zddata = {};
  393. if (res.data.data.length == 0) {
  394. this.nodata = true;
  395. } else {
  396. this.nodata = false;
  397. this.zddata.amount = res.data.data[0].amount;
  398. this.zddata.glf = res.data.data[0].billLists[0].amount;
  399. this.zddata.ktf = res.data.data[0].billLists[1].amount;
  400. this.zddata.dtf = res.data.data[0].billLists[2].amount;
  401. }
  402. })
  403. },
  404. }
  405. }
  406. </script>
  407. <style lang="scss">
  408. .Predeposit {
  409. position: fixed;
  410. bottom: 0;
  411. left: 0;
  412. right: 0;
  413. height: 98rpx;
  414. z-index: 2;
  415. line-height: 98rpx;
  416. width: 750rpx;
  417. background-color: #fff;
  418. text-align: center;
  419. color: #2E69EB;
  420. box-shadow: 0 -6px 12px 0 rgba(153, 153, 153, 0.10);
  421. display: flex;
  422. align-items: center;
  423. justify-content: space-around;
  424. }
  425. .nodata {
  426. text-align: center;
  427. padding-top: 400rpx;
  428. }
  429. .zhifucanvas {
  430. width: 400rpx;
  431. height: 400rpx;
  432. margin: 0 auto;
  433. }
  434. .canys {
  435. width: 500rpx;
  436. height: 600rpx;
  437. position: fixed;
  438. top: 30%;
  439. left: 0;
  440. right: 0;
  441. margin: 0 auto;
  442. background: #e6e6e6;
  443. h4 {
  444. width: 500rpx;
  445. text-align: center;
  446. height: 80rpx;
  447. line-height: 80rpx;
  448. }
  449. }
  450. .guanbi {
  451. margin-top: 50rpx;
  452. }
  453. .zhifufs {
  454. padding: 10rpx 60rpx 30px;
  455. ::v-deep .u-radio-label--right {
  456. margin-top: 30rpx;
  457. }
  458. ::v-deep .uni-input-placeholder {
  459. text-align: left
  460. }
  461. ::v-deep .u-radio__icon-wrap {
  462. width: 40rpx !important;
  463. height: 40rpx !important;
  464. }
  465. ::v-deep .u-radio__text {
  466. font-size: 32rpx !important;
  467. }
  468. }
  469. .hejitop {
  470. text-align: center;
  471. border-bottom: 1px solid #eee;
  472. padding: 48rpx 0 24rpx;
  473. font-size: 32rpx;
  474. }
  475. .paytall {
  476. padding: 12px 0;
  477. }
  478. .heji span {
  479. color: #ED3A25;
  480. }
  481. .likezhifu {
  482. margin-left: 20rpx;
  483. margin-right: 30rpx;
  484. }
  485. .zhifu {
  486. position: fixed;
  487. right: 0;
  488. bottom: 0;
  489. left: 0;
  490. height: 98rpx;
  491. background-color: #fff;
  492. display: flex;
  493. align-items: center;
  494. justify-content: flex-end;
  495. .zhifuright {
  496. display: flex;
  497. align-items: center;
  498. justify-content: flex-end;
  499. }
  500. }
  501. .page {
  502. height: 100%;
  503. overflow: hidden;
  504. .contain {
  505. height: calc(100% - 44px);
  506. padding: 0;
  507. display: flex;
  508. flex-direction: column;
  509. .u-listdata {
  510. height: 400px;
  511. flex: 1;
  512. display: flex;
  513. flex-direction: column;
  514. }
  515. }
  516. }
  517. .paisong,
  518. .paisong2 {
  519. display: flex;
  520. flex-direction: column;
  521. justify-content: center;
  522. background-color: #fff;
  523. margin: 0 16px 24rpx;
  524. padding: 12px 16px 12px 34px;
  525. border-radius: 4px;
  526. position: relative;
  527. .iconBtn {
  528. position: absolute;
  529. top: 32rpx;
  530. right: 32rpx;
  531. z-index: 1;
  532. }
  533. .title {
  534. font-size: 32rpx;
  535. color: #0C1935;
  536. margin-bottom: 16rpx;
  537. span {
  538. color: #FA5555;
  539. font-weight: 600;
  540. }
  541. .status {
  542. width: 100rpx;
  543. padding: 6rpx;
  544. text-align: center;
  545. font-size: 24rpx;
  546. color: #fff;
  547. background-color: #09C700;
  548. border-radius: 22rpx;
  549. position: absolute;
  550. left: 40%;
  551. top: 20rpx;
  552. transform: scale(.85);
  553. }
  554. }
  555. .subtit {
  556. color: #9DA0AC;
  557. margin-bottom: 6rpx;
  558. }
  559. .check {
  560. position: absolute;
  561. left: 20rpx;
  562. top: 32rpx;
  563. z-index: 1;
  564. font-size: 0;
  565. transform: scale(.7)
  566. }
  567. }
  568. .paisong2 {
  569. display: flex;
  570. flex-direction: column;
  571. justify-content: center;
  572. background-color: #fff;
  573. margin: 0 16px 24rpx;
  574. padding: 12px 16px;
  575. border-radius: 4px;
  576. position: relative;
  577. .status {
  578. position: absolute;
  579. width: 96rpx;
  580. height: 48rpx;
  581. border-radius: 0 8rpx 0 20rpx;
  582. right: 0;
  583. line-height: 48rpx;
  584. text-align: center;
  585. top: 0;
  586. z-index: 1;
  587. font-size: 22rpx;
  588. background-color: #30D3A2;
  589. color: #fff;
  590. &.s2 {
  591. background-color: #FA5555;
  592. }
  593. }
  594. }
  595. .topbilledit {
  596. display: flex;
  597. justify-content: center;
  598. align-items: center;
  599. background: #fff;
  600. height: 88rpx;
  601. }
  602. .changetime2 {
  603. padding-left: 10rpx;
  604. }
  605. </style>