index.vue 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224
  1. <template>
  2. <div class="enterPriseBill">
  3. <van-tabs :active="active" @change="onChange">
  4. <!-- <van-tab title="租赁费" :name="1"></van-tab>-->
  5. <!-- <van-tab title="水费" :name="2"></van-tab>-->
  6. <!-- <van-tab title="电费" :name="3"></van-tab>-->
  7. <!-- <van-tab title="物业费" :name="4"></van-tab>-->
  8. <!-- <van-tab title="场地费" :name="6"></van-tab>-->
  9. <!-- <van-tab title="停车费" :name="7"></van-tab>-->
  10. <!-- <van-tab title="房源修复费" :name="8"></van-tab>-->
  11. <van-tab :title="item.label" :name="item.value" v-for="item in billTypeList"></van-tab>
  12. </van-tabs>
  13. <div class="enterPriseBillList">
  14. <div class="listItem" v-for="(item,index) in enterList" :key="index" @click="toDetail(item)">
  15. <div :style="{backgroundImage: 'url(' + (item.isDq ? dqBg : wdqBg) + ')'}" class="itemCard">
  16. 到期:{{item.expirationDate}}
  17. </div>
  18. <div class="itemFirstRow">
  19. <span class="billName">{{item.billName}}</span>
  20. </div>
  21. <div class="itemSecondRow">
  22. <span>发票号:{{item.invoiceNo}}</span>
  23. <span>生成日期:{{item.createdAt}}</span>
  24. </div>
  25. <div class="itemLastRow">
  26. <div class="lastRowBox">
  27. <span class="rowNumber">{{item.invoiceAmount}}</span>
  28. <span class="rowUnit">账单总金额(元)</span>
  29. </div>
  30. <div class="columLine"></div>
  31. <div class="lastRowBox">
  32. <span class="rowNumber">{{item.restMoney}}</span>
  33. <span class="rowUnit">欠款金额(元)</span>
  34. </div>
  35. </div>
  36. </div>
  37. </div>
  38. </div>
  39. </template>
  40. <script>
  41. import { findBillManagementMoreForCollect,getUserLocalStorageInfo,getByCodes } from "@/js_sdk/http";
  42. import dayjs from "dayjs";
  43. export default {
  44. name: "index",
  45. data(){
  46. return{
  47. dc_key: ['BILL_TYPE'],
  48. getUserLocalStorageInfo: getUserLocalStorageInfo(),
  49. active: 1,
  50. dqBg: "https://www.idea-co-sf.com/gardenProduct/image/dqBg.png",
  51. wdqBg: "https://www.idea-co-sf.com/gardenProduct/image/wdqBg.png",
  52. enterList: [
  53. // {billName:'入驻款(房租费)',dqDate:'2024.5.30',isDq:true},
  54. // {billName:'入驻款(房租费)aaaaaaaaaaaaaaa',dqDate:'2024.5.30',isDq:false},
  55. // {billName:'入驻款(房租费)',dqDate:'2024.5.30',isDq:false},
  56. ],
  57. billTypeList: [],
  58. dic_SelectList:[],
  59. currentDate: ''
  60. }
  61. },
  62. onLoad(type){
  63. },
  64. created(){
  65. this.getByCodes()
  66. this.getList()
  67. const dayjs = require('dayjs')
  68. this.currentDate = dayjs().format('YYYY-MM-DD')
  69. },
  70. onPullDownRefresh() {
  71. this.getList()
  72. setTimeout(function () {
  73. uni.stopPullDownRefresh();
  74. }, 1000);
  75. },
  76. methods:{
  77. async getByCodes() {
  78. let data = await getByCodes(JSON.stringify(this.dc_key));
  79. this.dic_SelectList = this.$common.handleDicList(data);
  80. this.billTypeList = this.dic_SelectList.BILL_TYPE
  81. },
  82. onChange(e) {
  83. console.log('e',e)
  84. this.active = e.detail.name
  85. this.getList()
  86. },
  87. toDetail(item){
  88. let reqData = {
  89. companyName: item.companyName,
  90. billName: item.billName,
  91. buildName: item.buildName,
  92. invoiceAmount: item.invoiceAmount,
  93. restMoney: item.restMoney,
  94. invoiceNo: item.invoiceNo,
  95. eInvoiceUrl: encodeURIComponent(item.eInvoiceUrl),
  96. overdueDays: item.overdueDays
  97. }
  98. console.log("数据——:", item)
  99. uni.navigateTo({
  100. url: "/pages/subPackages/enterPriseBill/detail?item=" + JSON.stringify(reqData),
  101. });
  102. },
  103. getList(){
  104. const _this = this
  105. _this.enterList = []
  106. const data = {
  107. pageNum: '1',
  108. pageSize: '10',
  109. billCompanyId:this.getUserLocalStorageInfo.userId,
  110. billType:this.active,
  111. invoiceStatus:'1,3,4'
  112. }
  113. findBillManagementMoreForCollect(data).then(res=>{
  114. console.log('res',res)
  115. if (res.rows) {
  116. res.rows.forEach(function(item) {
  117. const jsonMap = _this.getItemJson(item)
  118. _this.enterList.push(jsonMap)
  119. })
  120. }
  121. })
  122. },
  123. getItemJson: function(item) {
  124. item.isDq = false
  125. if(item.restMoney > 0 && this.currentDate < item.expirationDate){
  126. item.isDq = true
  127. }
  128. return item
  129. }
  130. }
  131. }
  132. </script>
  133. <style lang="scss">
  134. .enterPriseBill{
  135. .enterPriseBillList{
  136. display: flex;
  137. flex-direction: column;
  138. align-items: center;
  139. .listItem{
  140. width: 686rpx;
  141. height: 304rpx;
  142. background: rgba(255, 255, 255, 1);
  143. display: flex;
  144. flex-direction: column;
  145. padding: 24rpx 32rpx 32rpx 32rpx;
  146. box-sizing: border-box;
  147. margin-top: 24rpx;
  148. border-radius: 16rpx;
  149. position: relative;
  150. .itemCard{
  151. position: absolute;
  152. background-size: 100%;
  153. background-repeat: no-repeat;
  154. width: 220rpx;
  155. height: 56rpx;
  156. font-size: 24rpx;
  157. color: white;
  158. display: flex;
  159. align-items: center;
  160. justify-content: center;
  161. right: 0;
  162. top: 0;
  163. padding-left: 10rpx;
  164. box-sizing: border-box;
  165. }
  166. .itemFirstRow{
  167. color: rgba(34, 34, 34, 1);
  168. font-size: 32rpx;
  169. font-weight: 600;
  170. .billName{
  171. display: inline-block;
  172. max-width: 394rpx;
  173. overflow: hidden;
  174. white-space: nowrap;
  175. text-overflow: ellipsis;
  176. }
  177. }
  178. .itemSecondRow{
  179. display: flex;
  180. justify-content: space-between;
  181. font-size: 28rpx;
  182. color: rgba(102, 102, 102, 1);
  183. margin: 16rpx 0;
  184. }
  185. .itemLastRow{
  186. display: flex;
  187. justify-content: space-between;
  188. align-items: center;
  189. width: 622rpx;
  190. height: 134rpx;
  191. padding: 20rpx 32rpx;
  192. background: rgba(245, 247, 250, 1);
  193. box-sizing: border-box;
  194. .lastRowBox{
  195. display: flex;
  196. flex-direction: column;
  197. .rowNumber{
  198. font-size: 40rpx;
  199. color: rgba(51, 51, 51, 1);
  200. font-weight: 600;
  201. }
  202. .rowUnit{
  203. font-size: 28rpx;
  204. color: rgba(136, 136, 136, 1);
  205. margin-top: 8rpx;
  206. }
  207. }
  208. .columLine{
  209. width: 2rpx;
  210. height: 72rpx;
  211. background: rgba(217, 219, 226, 1);
  212. }
  213. }
  214. }
  215. }
  216. }
  217. </style>