Tenantbill.vue 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427
  1. <template>
  2. <view class="billall">
  3. <u-cell-group>
  4. <u-cell :title="mytitle" value="修改" :isLink="true" @click="floorchange">
  5. <u-icon slot="icon" size="40" name="map"></u-icon>
  6. </u-cell>
  7. </u-cell-group>
  8. <view class="topbill">
  9. <view class="topbilledit">
  10. <view class="changetime1">
  11. <picker mode="date" :value="myday" fields="month" @change="dateChange">
  12. <view class="selestDate">{{myday}}</view>
  13. </picker>
  14. </view>
  15. <view class="changetime2">
  16. <u-icon name="arrow-down-fill" color="#666666" size="20"></u-icon>
  17. </view>
  18. </view>
  19. <view class="topbilledit" @click="typechange">
  20. <view class="changetime1">
  21. {{mytype}}
  22. </view>
  23. <view class="changetime2">
  24. <u-icon name="arrow-down-fill" color="#666666" size="20"></u-icon>
  25. </view>
  26. </view>
  27. </view>
  28. <!-- 列表 -->
  29. <!-- <t-table>
  30. <t-tr>
  31. <t-th>序号</t-th>
  32. <t-th>姓名</t-th>
  33. <t-th>年龄</t-th>
  34. <t-th>爱好</t-th>
  35. <t-th>操作</t-th>
  36. </t-tr>
  37. <t-tr v-for="item in tableList" :key="item.id">
  38. <t-td>{{ item.id + 1 }}</t-td>
  39. <t-td>{{ item.name }}</t-td>
  40. <t-td>{{ item.age }}</t-td>
  41. <t-td>{{ item.hobby }}</t-td>
  42. <t-td align="left"> <u-button @click="edit(item)" size="small" type="primary" :plain="true" text="编辑"></u-button></t-td>
  43. </t-tr>
  44. </t-table> -->
  45. <view class="u-listdata">
  46. <u-list @scrolltolower="scrolltolower" :pagingEnabled='true'>
  47. <u-list-item v-for="(item, index) in indexList" :key="index">
  48. <view class="companylist" @click="seedetail(item)">
  49. <view class="settled" v-if="item.status==1">
  50. 已结清
  51. </view>
  52. <view class="outstanding" v-if="item.status==0">
  53. 未结清
  54. </view>
  55. <h3>{{item.name}}</h3>
  56. <view class="Currentamount">
  57. 本期金额: <span>¥{{item.feeTotal}}</span>
  58. </view>
  59. <view class="Currentamount">
  60. 欠费天数: {{item.elecAmount}}
  61. </view>
  62. <view class="Currentamount">
  63. 账户余额:¥{{item.balance}}
  64. </view>
  65. <view class="Currentamount">
  66. 联系电话: {{item.tel}}
  67. </view>
  68. <view class="Callfee" v-if="item.status==0" @click.stop="handleClick(item.id)">
  69. 催费
  70. </view>
  71. </view>
  72. </u-list-item>
  73. </u-list>
  74. </view>
  75. <u-picker :show="showtype" :columns="columnstype" keyName="label" @confirm="confirmtype" @cancel='canceltype'>
  76. </u-picker>
  77. <u-picker :show="showfloor" ref="uPicker" :loading="loading" @confirm="confirmfloor" @cancel='cancelfloor'
  78. :columns="columns" keyName="orgName" @change="changeHandler"></u-picker>
  79. <u-notify ref="uNotify" :show="showdct" message="服务器请求失败"></u-notify>
  80. </view>
  81. </template>
  82. <script>
  83. // import tTable from '@/components/t-table/t-table.vue';
  84. // import tTh from '@/components/t-table/t-th.vue';
  85. // import tTr from '@/components/t-table/t-tr.vue';
  86. // import tTd from '@/components/t-table/t-td.vue';
  87. export default {
  88. components: {
  89. // tTable,
  90. // tTh,
  91. // tTr,
  92. // tTd
  93. },
  94. data() {
  95. const currentDate = this.getDate({
  96. format: 'yyyy-mm'
  97. })
  98. return {
  99. setyesno: true,
  100. // tableList: [{
  101. // id: 0,
  102. // name: '张三',
  103. // age: '19',
  104. // hobby: '游泳'
  105. // },
  106. // {
  107. // id: 1,
  108. // name: '李四',
  109. // age: '21',
  110. // hobby: '绘画'
  111. // },
  112. // ],
  113. indexList: [],
  114. dataList: [],
  115. dataForm: {
  116. projectId: "",
  117. buildingId: "",
  118. storeyId: "",
  119. cycle: "",
  120. status: "",
  121. page: 1,
  122. limit: 10,
  123. },
  124. showtype: false,
  125. showdct: false,
  126. mytitle: '',
  127. alldata: [],
  128. showfloor: false,
  129. loading: false,
  130. columns: [],
  131. pd:true,
  132. columnData: [],
  133. myday: '',
  134. mytype: '全部',
  135. showPicker: false,
  136. myday: currentDate,
  137. columnstype: [
  138. [{
  139. label: '全部',
  140. id: ''
  141. }, {
  142. label: '未结清',
  143. id: 0
  144. },
  145. {
  146. label: '已结清',
  147. id: 1
  148. }
  149. ]
  150. ],
  151. }
  152. },
  153. //监听页面加载,其参数为上个页面传递的数据,参数类型为 Object(用于页面传参
  154. onLoad() {
  155. this.getfloor();
  156. // this.loadmore();
  157. },
  158. //监听页面初次渲染完成。注意如果渲染速度快,会在页面进入动画完成前触发
  159. onReady() {
  160. // 微信小程序需要用此写法
  161. },
  162. //监听页面隐藏
  163. onHide() {},
  164. //监听窗口尺寸变化
  165. onResize() {},
  166. //监听页面卸载
  167. onUnload() {},
  168. //监听用户下拉动作,一般用于下拉刷新
  169. onPullDownRefresh() {},
  170. methods: {
  171. seedetail(e){
  172. // console.log('222',e)
  173. uni.navigateTo({
  174. url: "/pages/Workorder/Tenantbill/companybill/companybill?para=" + encodeURIComponent(JSON.stringify(e))
  175. })
  176. },
  177. handleClick(e){
  178. console.log('111111111111111111',e)
  179. },
  180. scrolltolower() {
  181. if(this.pd){
  182. this.getalldata();
  183. }else{
  184. return
  185. }
  186. },
  187. getalldata() {
  188. this.$api.get('/billinfo/paypage', this.dataForm)
  189. .then(res => {
  190. if (res.data.data.list.length != 0) {
  191. this.indexList.push(...res.data.data.list);
  192. this.dataForm.page = this.dataForm.page + 1;
  193. this.pd=true;
  194. } else {
  195. uni.showToast({
  196. title:'暂无更多数据了',
  197. icon: 'none',
  198. duration: 1500
  199. })
  200. this.pd=false;
  201. }
  202. })
  203. },
  204. loadmore() {
  205. // for (let i = 0; i < 30; i++) {
  206. // this.indexList.push({
  207. // url: this.urls[uni.$u.random(0, this.urls.length - 1)]
  208. // })
  209. // }
  210. },
  211. // edit(item) {
  212. // console.log('111111111111111111', item)
  213. // },
  214. canceltype() {
  215. this.showtype = false;
  216. },
  217. confirmtype(e) {
  218. // console.log('111111111111111111', e.value[0])
  219. this.showtype = false;
  220. this.mytype = e.value[0].label;
  221. this.dataForm.cycle = e.value[0].id;
  222. this.dataForm.page=1;
  223. this.getalldata();
  224. },
  225. typechange() {
  226. this.showtype = true;
  227. },
  228. dateChange(e) {
  229. this.myday = e.target.value;
  230. this.dataForm.cycle = e.target.value;
  231. this.dataForm.page=1;
  232. this.getalldata();
  233. },
  234. getDate(type) {
  235. const date = new Date();
  236. let year = date.getFullYear();
  237. let month = date.getMonth() + 1;
  238. if (type === 'start') {
  239. year = year - 60;
  240. } else if (type === 'end') {
  241. year = year + 2;
  242. }
  243. month = month > 9 ? month : '0' + month;
  244. // day = day > 9 ? day : '0' + day;
  245. return `${year}-${month}`;
  246. },
  247. getfloor() {
  248. this.$api.get('/control/getOrgStructureTree/', {})
  249. .then(res => {
  250. if (res.data.code == 0) {
  251. this.dataForm.projectId = res.data.data[0].orgId;
  252. this.mytitle = res.data.data[0].orgName;
  253. this.alldata = res.data.data[0].childrenList;
  254. //console.log('111111111111111111', res.data.data[0].childrenList)
  255. this.columns = [
  256. res.data.data[0].childrenList,
  257. res.data.data[0].childrenList[0].childrenList
  258. ]
  259. let allfloor = [];
  260. for (let i = 0; i < res.data.data[0].childrenList.length; i++) {
  261. allfloor.push(res.data.data[0].childrenList[i].childrenList)
  262. }
  263. // console.log('111111111111111111',allfloor)
  264. this.columnData = allfloor;
  265. this.dataForm.page=1;
  266. this.getalldata();
  267. } else {
  268. this.showdct = true
  269. }
  270. })
  271. },
  272. floorchange() {
  273. this.showfloor = true;
  274. },
  275. changeHandler(e) {
  276. const {
  277. columnIndex,
  278. index,
  279. // 微信小程序无法将picker实例传出来,只能通过ref操作
  280. picker = this.$refs.uPicker
  281. } = e
  282. if (columnIndex === 0) {
  283. this.loading = true
  284. picker.setColumnValues(1, this.columnData[index])
  285. this.loading = false
  286. }
  287. this.getalldata();
  288. },
  289. confirmfloor(e) {
  290. console.log('222222', e.value)
  291. this.mytitle = e.value[0].orgName + e.value[1].orgName;
  292. this.dataForm.buildingId = e.value[0].orgId;
  293. this.dataForm.storeyId = e.value[1].orgId;
  294. this.showfloor = false;
  295. this.getalldata();
  296. },
  297. cancelfloor() {
  298. this.showfloor = false;
  299. },
  300. }
  301. }
  302. </script>
  303. <style lang="scss">
  304. .Currentamount {
  305. padding-left: 30rpx;
  306. height: 50rpx;
  307. line-height: 50rpx;
  308. color: #BCB3A7;
  309. span {
  310. color: #FA5555;
  311. padding-left: 9rpx;
  312. }
  313. }
  314. .Callfee{
  315. width: 100rpx;
  316. height: 45rpx;
  317. text-align: center;
  318. line-height:45rpx;
  319. color: #5C8FFF;
  320. border: 1px solid #5C8FFF;
  321. font-size: 22rpx;
  322. position: absolute;
  323. bottom: 10rpx;
  324. right: 10px;
  325. font-weight: bold;
  326. }
  327. .companylist {
  328. margin: 20rpx 30rpx;
  329. background: #fff;
  330. height: 280rpx;
  331. border-radius: 10px;
  332. position: relative;
  333. h3 {
  334. height: 70rpx;
  335. line-height: 70rpx;
  336. padding-left: 30rpx;
  337. }
  338. }
  339. .settled {
  340. background-color: #09C700;
  341. width: 100rpx;
  342. height: 40rpx;
  343. text-align: center;
  344. line-height: 40rpx;
  345. color: #fff;
  346. font-size: 14rpx;
  347. position: absolute;
  348. top: 0px;
  349. right: 0px;
  350. border-top-right-radius: 10rpx;
  351. border-bottom-left-radius: 10rpx;
  352. }
  353. .outstanding {
  354. background-color: #FA5555;
  355. width: 100rpx;
  356. height: 40rpx;
  357. text-align: center;
  358. line-height: 40rpx;
  359. color: #fff;
  360. font-size: 14rpx;
  361. position: absolute;
  362. top: 0px;
  363. right: 0px;
  364. border-top-right-radius: 10rpx;
  365. border-bottom-left-radius: 10rpx;
  366. }
  367. .billall {}
  368. .topbill {
  369. display: flex;
  370. justify-content: space-around;
  371. align-items: center;
  372. height: 100rpx;
  373. background-color: #e6e6e6;
  374. }
  375. .topbilledit {
  376. display: flex;
  377. justify-content: space-around;
  378. align-items: center;
  379. }
  380. .changetime1 {
  381. padding-right: 10rpx;
  382. }
  383. </style>