billingRules.vue 11 KB

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