billingRules.vue 10 KB

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