billingRules.vue 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471
  1. <template>
  2. <view>
  3. <u-navbar title="计费规则" title-color="#101010"></u-navbar>
  4. <view class="tabs-box" v-if="!popShow" >
  5. <view class="tabs1" v-show="tenantList.length>1" :style="{width: tenantList.length>4 ? '' : '100%'}" >
  6. <u-tabs :list="tenantList1" inactive-color="#777777" active-color="#333333 "
  7. bg-color="#fff" :is-scroll="false" :current="current" @change="change"></u-tabs>
  8. </view>
  9. <view class="icon" @click="popShow=true" v-if="tenantList.length >= 4" >
  10. <u-icon name="arrow-down" color="#777777" size="28"></u-icon>
  11. </view>
  12. </view>
  13. <!-- 标签弹出层 -->
  14. <u-popup v-model="popShow" length="80%" duration="10" mode="top" :negative-top="188" border-radius="32">
  15. <u-navbar title="计费规则" title-color="#101010" >
  16. </u-navbar>
  17. <view class="popup-tabs" v-if="false">
  18. <view class="tabs1">
  19. <!-- <u-tabs :list="tenantList1" inactive-color="#777777" active-color="#333333 "
  20. bg-color="#fff" :is-scroll="false" :current="current" @change="change"></u-tabs> -->
  21. <u-tabs :list="tenantList1" :is-scroll="false" :current="current" @change="change"></u-tabs >
  22. </view>
  23. <view class="more">
  24. <u-icon name="arrow-up" color="#777777" size="40" @click="popShow=false"></u-icon>
  25. </view>
  26. </view>
  27. <view class="tabs-options">
  28. <view class="item" v-for="(item, index) in tenantList"
  29. :class="{
  30. 'item-index' : item.id==formData.tenantId
  31. }"
  32. :key="index"
  33. @click="merchantChange(item,index)">
  34. {{item.name}}
  35. </view>
  36. <u-divider nonetext="没有找到相关内容"
  37. border-color="#CFD2D5">已经到底了</u-divider>
  38. </view>
  39. </u-popup>
  40. <view class="background">
  41. <!-- 单位 -->
  42. <view class="unit" v-if="queryList.length" >
  43. <view class="title">
  44. 物业方:
  45. </view>
  46. <view class="value">
  47. {{queryList[0].propertyManagement}}
  48. </view>
  49. </view>
  50. <view class="rules" v-if="queryList.length">
  51. <view class="tabs" v-if="false">
  52. <u-tabs font-size="24" :gutter="30" :item-width="100" :list="list" :is-scroll="false" :current="current"
  53. @change="change"></u-tabs>
  54. </view>
  55. <view class="content" v-for="(item,i) in queryList" :key="i">
  56. <view class="name-title">
  57. 承租方:
  58. </view>
  59. <view class="name">
  60. {{item.tenantName}}
  61. </view>
  62. <view class="address">
  63. </view>
  64. <view class="contentRule1">
  65. <view>收费标准</view>
  66. <u-table>
  67. <u-th style="padding:0">
  68. <u-tr >
  69. <u-td>名称</u-td>
  70. <!-- -->
  71. <u-td>价格</u-td>
  72. <u-td>单位</u-td>
  73. </u-tr>
  74. </u-th>
  75. <template v-for="(it,j) in item.contractItemList" >
  76. <u-tr :key="j" v-if="!it.periodPriceList">
  77. <u-td>{{it.name}}</u-td>
  78. <!-- <u-td>{{it.paymentMethodN}}</u-td> -->
  79. <u-td>{{it.price}}</u-td>
  80. <u-td>{{it.unit}}</u-td>
  81. </u-tr>
  82. </template>
  83. </u-table>
  84. </view>
  85. <view class="contentRule1" style="margin-top: 20rpx;" v-for="(it,j) in item.contractItemList" v-if="it.periodPriceList">
  86. <template >
  87. <view>收费标准-{{it.name}} ({{it.unit}})</view>
  88. <u-table>
  89. <u-th style="padding:0">
  90. <u-tr >
  91. <u-td>类型 </u-td>
  92. <u-td>时段</u-td>
  93. <!-- -->
  94. <u-td>价格</u-td>
  95. </u-tr>
  96. </u-th>
  97. <u-tr :key="k" v-for="(ito,k) in it.periodPriceList" >
  98. <u-td>{{ito.periodN}}</u-td>
  99. <u-td>{{ito.startTime}}-{{ito.endTime}}</u-td>
  100. <u-td>{{ito.price}}</u-td>
  101. </u-tr>
  102. </u-table>
  103. </template>
  104. </view>
  105. <!-- 备注 -->
  106. <view class="remark" >
  107. <view class="title" v-if="false&&item.remark">
  108. 备注说明:
  109. </view>
  110. <view class="value">
  111. <view class="item" v-if="false&&item.remark">
  112. {{item.remark}}
  113. </view>
  114. <view class="item" v-if="item.address">
  115. 租住地址:{{item.address}}
  116. </view>
  117. <view class="item">
  118. 租赁期:{{thisparseUnixTime(item.contractStartTime)}} 至 {{thisparseUnixTime(item.contractEndTime)}}
  119. </view>
  120. </view>
  121. </view>
  122. </view>
  123. </view>
  124. <view class="rules" v-else>
  125. <view class="content" >
  126. <view class="address">
  127. {{queryBl?'未签订合同,请联系物业方':'加载中...'}}
  128. </view>
  129. <!-- 备注 -->
  130. </view>
  131. </view>
  132. <u-divider nonetext="没有找到相关内容"
  133. border-color="#CFD2D5">已经到底了</u-divider>
  134. </view>
  135. </view>
  136. </template>
  137. <script>
  138. import * as API from '@/apis/pagejs/tenantList.js'
  139. import {
  140. parseUnixTime,newDate
  141. } from '@/apis/utils'
  142. export default {
  143. data() {
  144. return {
  145. tenantList:[],
  146. tenantList1:[],
  147. popShow:false,
  148. current:0,
  149. current1:0,
  150. current2: 0,
  151. formData:{
  152. },
  153. queryList: [],
  154. companyInfo:{},
  155. tenantInfo:{},
  156. queryBl:false,
  157. }
  158. },
  159. onLoad(op) {
  160. if(op.id){
  161. }
  162. },
  163. onReady() {
  164. this.getTenantList()
  165. },
  166. methods: {
  167. merchantChangeApi(){
  168. this.getContractList()
  169. },
  170. thisparseUnixTime(time){
  171. return parseUnixTime(newDate(time),'{y}年{m}月{d}日')
  172. },
  173. change(index) {
  174. this.current = index;
  175. this.formData.tenantId = this.tenantList1[index].id;
  176. this.popShow = false;
  177. this.merchantChangeApi()
  178. },
  179. merchantChange(item, index) {
  180. // if(this.current==0){
  181. // this.current=1;
  182. // }
  183. this.formData.tenantId= item.id;
  184. //this.$forceUpdate()
  185. this.getTenantListSort(this.tenantList)
  186. this.merchantChangeApi()
  187. this.popShow = false;
  188. },
  189. getTenantListSort(list){
  190. for(var i in list){
  191. var obj=list[i]
  192. if(this.formData.tenantId==obj.id){
  193. var obj1=list[this.current];
  194. list[this.current]=obj;
  195. list[i]=obj1;
  196. }
  197. }
  198. this.tenantList=list;
  199. var mList1 = [];
  200. for (var i = 0; i < list.length; i++) {
  201. if (i >= 4) {
  202. } else {
  203. mList1.push(list[i]);
  204. }
  205. }
  206. this.tenantList1 = mList1;
  207. },
  208. getTenantList(){
  209. uni.showLoading({
  210. title: "加载中",
  211. mask: true,
  212. })
  213. API.tenantList().then((response) => {
  214. uni.hideLoading();
  215. var list=response.data.tenantInfoList;
  216. this.formData.tenantId=list[0].id
  217. this.merchantChangeApi()
  218. this.getTenantListSort(list)
  219. }).catch(error => {
  220. uni.showToast({
  221. title: error,
  222. icon: "none"
  223. })
  224. })
  225. },
  226. getContractList(){
  227. uni.showLoading({
  228. mask:true,title:'加载中...'
  229. })
  230. API.contractList(this.formData).then((response) => {
  231. uni.hideLoading();
  232. //this.list=response.data.data;
  233. this.queryList = response.data.contractList;
  234. console.log(this.queryList )
  235. this.queryBl=true
  236. }).catch(error => {
  237. uni.hideLoading();
  238. uni.showToast({
  239. icon: "none",
  240. title: error
  241. })
  242. })
  243. },
  244. change1(index) {
  245. this.current1 = index;
  246. },
  247. change2(index) {
  248. this.current2 = index;
  249. }
  250. }
  251. }
  252. </script>
  253. <style lang="scss" scoped>
  254. // 标签
  255. .tabs-box{
  256. display: flex;
  257. align-items: center;
  258. justify-content: space-between;
  259. padding: 16rpx 32rpx 16rpx 0;
  260. .tabs{
  261. width: 92%;
  262. }
  263. }
  264. .background {
  265. background: linear-gradient(180deg, rgba(22,119,255,1) 0%,rgba(22,119,255,0) 100%);
  266. padding: 32rpx 0;
  267. height: 720rpx;
  268. .unit {
  269. background-color: #fff;
  270. margin: 0 32rpx;
  271. border-radius: 8px;
  272. padding: 32rpx;
  273. .title {
  274. color: rgba(153, 153, 153, 1);
  275. }
  276. .value {
  277. color: rgba(51, 51, 51, 1);
  278. font-size: 40rpx;
  279. margin-top: 16rpx;
  280. }
  281. }
  282. }
  283. // 规则
  284. .rules {
  285. margin: 24rpx 32rpx;
  286. background-color: #fff;
  287. padding-bottom: 24rpx;
  288. border-radius: 8px;
  289. /deep/.u-tabs {
  290. border-radius: 8px;
  291. }
  292. .content {
  293. padding: 24rpx;
  294. .name-title {
  295. color: #999999;
  296. }
  297. .name {
  298. margin: 16rpx 0;
  299. color: rgba(16, 16, 16, 1);
  300. font-size: 38rpx;
  301. }
  302. .address {
  303. margin: 8rpx 0;
  304. }
  305. .contentRule1 {
  306. .rule1 {
  307. //width: 298rpx;
  308. display: flex;
  309. .title {
  310. line-height: 96rpx;
  311. color: rgba(51, 51, 51, 1);
  312. font-size: 32rpx;
  313. }
  314. .value {
  315. color: rgba(51, 51, 51, 1);
  316. line-height: 96rpx;
  317. }
  318. }
  319. }
  320. }
  321. // 备注
  322. .remark {
  323. padding: 40rpx 32rpx;
  324. margin-top: 24rpx;
  325. border-radius: 8px;
  326. background-color: rgba(242, 244, 246, 1);
  327. color: rgba(16, 16, 16, 1);
  328. font-size: 24rpx;
  329. line-height: 34rpx;
  330. .value {
  331. margin-top: 16rpx;
  332. }
  333. .item {
  334. margin-bottom: 8rpx;
  335. }
  336. }
  337. }
  338. .tabs-box{
  339. background-color: #fff;
  340. display: flex;
  341. align-items: center;
  342. justify-content: space-between;
  343. padding: 16rpx 32rpx 16rpx 32rpx;
  344. .tabs1{
  345. width: 92%;
  346. }
  347. }
  348. .popup-tabs {
  349. background-color: #fff;
  350. display: flex;
  351. align-items: center;
  352. justify-content: space-between;
  353. padding-top: 32rpx;
  354. padding-right: 32rpx;
  355. color: rgba(51, 51, 51, 1);
  356. font-size: 32rpx;
  357. .tabs1 {
  358. width: 88%;
  359. }
  360. }
  361. /deep/.u-tab-item {
  362. width: 25% !important;
  363. flex: none !important;
  364. }
  365. .tabs-options {
  366. //display: flex;
  367. padding: 24rpx 32rpx ;
  368. flex-wrap: wrap;
  369. .item {
  370. //width: 25%;
  371. color:rgb(119, 119, 119);
  372. margin-bottom: 24rpx;
  373. font-size: 32rpx;
  374. }
  375. .item-index{
  376. color: rgb(51, 51, 51);
  377. font-weight: bold;
  378. }
  379. }
  380. </style>