Withholdingrecord.vue 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327
  1. <template>
  2. <view class="billall">
  3. <u-cell-group class="toptemplate">
  4. <u-cell :title="mytitle" @click="floorchange">
  5. <u-icon slot="icon" size="40" color="#fff" name="map"></u-icon>
  6. <u-icon slot="right-icon" size="40" color="#fff" name="search"></u-icon>
  7. </u-cell>
  8. </u-cell-group>
  9. <view class="topbill">
  10. <view class="topbilledit" @click="typechange">
  11. <view class="changetime1">
  12. {{mytype}}
  13. </view>
  14. <view class="changetime2">
  15. <u-icon name="arrow-down-fill" color="#999" size="20"></u-icon>
  16. </view>
  17. </view>
  18. </view>
  19. <view class="u-listdata">
  20. <view style="padding:16rpx 0 16rpx 32rpx">
  21. 共有 <span style="color: red">{{totalnumber}}</span>条记录
  22. </view>
  23. <u-list @scrolltolower="scrolltolower" :pagingEnabled='true'>
  24. <u-list-item v-for="(item, index) in indexList" :key="index">
  25. <view class="companylist" @click="seedetail(item)">
  26. <view class="outstanding">
  27. {{item.type}}
  28. </view>
  29. <h3>{{item.tenantInfo.name}}</h3>
  30. <view class="Currentamount">
  31. 扣缴金额: <span>¥{{item.amount}}</span>
  32. </view>
  33. <view class="Currentamount">
  34. 租户电话: {{item.tenantInfo.tel}}
  35. </view>
  36. <view class="Currentamount">
  37. 操作人:{{item.createName}}
  38. </view>
  39. <view class="Currentamount">
  40. 扣缴时间: {{item.createDate}}
  41. </view>
  42. </view>
  43. </u-list-item>
  44. </u-list>
  45. </view>
  46. <u-picker :show="showtype" :itemHeight="80" :columns="columnstype" keyName="dictLabel" @confirm="confirmtype"
  47. @cancel='canceltype'></u-picker>
  48. <u-picker :show="showfloor" :itemHeight="80" ref="uPicker" :loading="loading" @confirm="confirmfloor" @cancel='cancelfloor'
  49. :columns="columns" keyName="orgName" @change="changeHandler"></u-picker>
  50. <u-notify ref="uNotify" :show="showdct" message="服务器请求失败"></u-notify>
  51. </view>
  52. </template>
  53. <script>
  54. //import { isEmpty, getDictDataList } from "@/utils/index";
  55. export default {
  56. components: {
  57. },
  58. data() {
  59. return {
  60. totalnumber: 0,
  61. setyesno: true,
  62. indexList: [],
  63. dataList: [],
  64. dataForm: {
  65. projectId: "",
  66. buildingId: "",
  67. storeyId: "",
  68. type: "",
  69. tenantId: "",
  70. page: 1,
  71. limit: 10,
  72. },
  73. pd: true,
  74. showtype: false,
  75. showdct: false,
  76. mytitle: '',
  77. alldata: [],
  78. showfloor: false,
  79. loading: false,
  80. columns: [],
  81. columnData: [],
  82. myday: '',
  83. mytype: '全部',
  84. showPicker: false,
  85. //myday: currentDate,
  86. columnstype: [
  87. ],
  88. feiyongtype:[],
  89. }
  90. },
  91. //监听页面加载,其参数为上个页面传递的数据,参数类型为 Object(用于页面传参
  92. onLoad() {
  93. let getDictDataList = uni.getStorageSync('getDictDataList');
  94. for (let i = 0; i < getDictDataList.length; i++) {
  95. if (getDictDataList[i].dictType == 'PayType') {
  96. this.columnstype = [getDictDataList[i].dataList]
  97. this.feiyongtype=getDictDataList[i].dataList;
  98. }
  99. }
  100. this.getfloor();
  101. // this.loadmore();
  102. },
  103. //监听页面初次渲染完成。注意如果渲染速度快,会在页面进入动画完成前触发
  104. onReady() {
  105. // 微信小程序需要用此写法
  106. },
  107. //监听页面隐藏
  108. onHide() {},
  109. //监听窗口尺寸变化
  110. onResize() {},
  111. //监听页面卸载
  112. onUnload() {},
  113. //监听用户下拉动作,一般用于下拉刷新
  114. onPullDownRefresh() {},
  115. methods: {
  116. scrolltolower() {
  117. if (this.pd) {
  118. this.getalldata();
  119. } else {
  120. return
  121. }
  122. },
  123. getalldata() {
  124. this.$api.get('/payrecord/page', this.dataForm)
  125. .then(res => {
  126. this.totalnumber = res.data.data.total;
  127. function transform(a, b) {
  128. loop: for (let i = 0; i < a.length; i++) {
  129. for (let j = 0; j < b.length; j++) {
  130. if (a[i].type == b[j].dictValue) {
  131. a[i].type = b[j].dictLabel;
  132. continue loop;
  133. }
  134. }
  135. a[i].type = a[i].type;
  136. }
  137. return a;
  138. }
  139. let chulidata=transform(res.data.data.list, this.feiyongtype)
  140. if (res.data.data.list.length != 0) {
  141. this.indexList.push(...chulidata);
  142. this.dataForm.page = this.dataForm.page + 1;
  143. this.pd = true;
  144. } else {
  145. uni.showToast({
  146. title: '暂无更多数据了',
  147. icon: 'none',
  148. duration: 1500
  149. })
  150. this.pd = false;
  151. }
  152. })
  153. },
  154. canceltype() {
  155. this.showtype = false;
  156. },
  157. confirmtype(e) {
  158. this.showtype = false;
  159. if (e.value[0].dictValue == 'all') {
  160. this.mytype = e.value[0].dictLabel;
  161. this.indexList=[];
  162. this.dataForm.type = '';
  163. this.dataForm.page = 1;
  164. this.getalldata();
  165. } else {
  166. this.mytype = e.value[0].dictLabel;
  167. this.dataForm.type = e.value[0].dictValue;
  168. this.indexList=[];
  169. this.dataForm.page = 1;
  170. this.getalldata();
  171. }
  172. },
  173. typechange() {
  174. this.showtype = true;
  175. },
  176. getfloor() {
  177. this.$api.get('/control/getOrgStructureTree/', {})
  178. .then(res => {
  179. if (res.data.code == 0) {
  180. this.dataForm.projectId = res.data.data[0].orgId;
  181. this.mytitle = res.data.data[0].orgName;
  182. this.alldata = res.data.data[0].childrenList;
  183. //console.log('111111111111111111', res.data.data[0].childrenList)
  184. this.columns = [
  185. res.data.data[0].childrenList,
  186. res.data.data[0].childrenList[0].childrenList
  187. ]
  188. let allfloor = [];
  189. for (let i = 0; i < res.data.data[0].childrenList.length; i++) {
  190. allfloor.push(res.data.data[0].childrenList[i].childrenList)
  191. }
  192. // console.log('111111111111111111',allfloor)
  193. this.columnData = allfloor;
  194. this.indexList=[];
  195. this.dataForm.page = 1;
  196. this.getalldata();
  197. } else {
  198. this.showdct = true
  199. }
  200. })
  201. },
  202. floorchange() {
  203. this.showfloor = true;
  204. },
  205. changeHandler(e) {
  206. const {
  207. columnIndex,
  208. index,
  209. // 微信小程序无法将picker实例传出来,只能通过ref操作
  210. picker = this.$refs.uPicker
  211. } = e
  212. if (columnIndex === 0) {
  213. this.loading = true
  214. picker.setColumnValues(1, this.columnData[index])
  215. this.loading = false
  216. }
  217. // this.getalldata();
  218. },
  219. confirmfloor(e) {
  220. console.log('222222', e.value)
  221. this.mytitle = e.value[0].orgName + e.value[1].orgName;
  222. this.dataForm.buildingId = e.value[0].orgId;
  223. this.dataForm.storeyId = e.value[1].orgId;
  224. this.showfloor = false;
  225. this.indexList=[];
  226. this.dataForm.page = 1;
  227. this.getalldata();
  228. },
  229. cancelfloor() {
  230. this.showfloor = false;
  231. },
  232. }
  233. }
  234. </script>
  235. <style lang="scss">
  236. .companylist {
  237. margin: 24rpx 32rpx 0;
  238. background: #fff;
  239. padding: 24rpx 32rpx;
  240. border-radius: 8rpx;
  241. position: relative;
  242. h3 {
  243. margin-bottom: 24rpx;
  244. }
  245. .Currentamount {
  246. margin-bottom: 4rpx;
  247. color: #999;
  248. span {
  249. color: #FA5555;
  250. padding-left: 9rpx;
  251. }
  252. }
  253. .outstanding{
  254. position: absolute;
  255. width:96rpx;
  256. height: 48rpx;
  257. border-radius: 0 8rpx 0 20rpx;
  258. right:0;
  259. line-height: 48rpx;
  260. text-align: center;
  261. top:0;
  262. z-index: 1;
  263. font-size: 22rpx;
  264. background-color:#30D3A2 ;
  265. color: #fff;
  266. &.PropertyFee{
  267. background-color:#30D3A2 ;
  268. }
  269. }
  270. }
  271. .topbill {
  272. display: flex;
  273. justify-content:center;
  274. align-items: center;
  275. height: 100rpx;
  276. background-color: #fff;
  277. .topbilledit {
  278. display: flex;
  279. justify-content: space-around;
  280. align-items: center;
  281. .changetime1 {
  282. padding-right: 10rpx;
  283. }
  284. }
  285. }
  286. </style>