Withholdingrecord.vue 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316
  1. <template>
  2. <view class="billall">
  3. <u-cell-group class="toptemplate" v-if="role=='Admin'">
  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. role:'',
  89. feiyongtype:[],
  90. }
  91. },
  92. //监听页面加载,其参数为上个页面传递的数据,参数类型为 Object(用于页面传参
  93. onLoad() {
  94. this.role=uni.getStorageSync('role');
  95. let getDictDataList = uni.getStorageSync('getDictDataList');
  96. for (let i = 0; i < getDictDataList.length; i++) {
  97. if (getDictDataList[i].dictType == 'PayType') {
  98. this.columnstype = [getDictDataList[i].dataList]
  99. this.feiyongtype=getDictDataList[i].dataList;
  100. }
  101. }
  102. this.getfloor();
  103. // this.loadmore();
  104. },
  105. //监听页面初次渲染完成。注意如果渲染速度快,会在页面进入动画完成前触发
  106. onReady() {
  107. // 微信小程序需要用此写法
  108. },
  109. //监听页面隐藏
  110. onHide() {},
  111. //监听窗口尺寸变化
  112. onResize() {},
  113. //监听页面卸载
  114. onUnload() {},
  115. //监听用户下拉动作,一般用于下拉刷新
  116. onPullDownRefresh() {},
  117. methods: {
  118. scrolltolower() {
  119. if (this.pd) {
  120. this.getalldata();
  121. } else {
  122. return
  123. }
  124. },
  125. getalldata() {
  126. this.$api.get('/payrecord/page', this.dataForm)
  127. .then(res => {
  128. this.totalnumber = res.data.data.total;
  129. function transform(a, b) {
  130. loop: for (let i = 0; i < a.length; i++) {
  131. for (let j = 0; j < b.length; j++) {
  132. if (a[i].type == b[j].dictValue) {
  133. a[i].type = b[j].dictLabel;
  134. continue loop;
  135. }
  136. }
  137. a[i].type = a[i].type;
  138. }
  139. return a;
  140. }
  141. let chulidata=transform(res.data.data.list, this.feiyongtype)
  142. if (res.data.data.list.length != 0) {
  143. this.indexList.push(...chulidata);
  144. this.dataForm.page = this.dataForm.page + 1;
  145. this.pd = true;
  146. } else {
  147. uni.showToast({
  148. title: '暂无更多数据了',
  149. icon: 'none',
  150. duration: 1500
  151. })
  152. this.pd = false;
  153. }
  154. })
  155. },
  156. canceltype() {
  157. this.showtype = false;
  158. },
  159. confirmtype(e) {
  160. this.showtype = false;
  161. if (e.value[0].dictValue == 'all') {
  162. this.mytype = e.value[0].dictLabel;
  163. this.indexList=[];
  164. this.dataForm.type = '';
  165. this.dataForm.page = 1;
  166. this.getalldata();
  167. } else {
  168. this.mytype = e.value[0].dictLabel;
  169. this.dataForm.type = e.value[0].dictValue;
  170. this.indexList=[];
  171. this.dataForm.page = 1;
  172. this.getalldata();
  173. }
  174. },
  175. typechange() {
  176. this.showtype = true;
  177. },
  178. getfloor() {
  179. this.$api.get('/control/getOrgStructureTree/', {})
  180. .then(res => {
  181. if (res.data.code == 0) {
  182. this.dataForm.projectId = res.data.data[0].orgId;
  183. this.mytitle = res.data.data[0].orgName;
  184. this.alldata = res.data.data[0].childrenList;
  185. //console.log('111111111111111111', res.data.data[0].childrenList)
  186. this.columns = [
  187. res.data.data[0].childrenList,
  188. res.data.data[0].childrenList[0].childrenList
  189. ]
  190. let allfloor = [];
  191. for (let i = 0; i < res.data.data[0].childrenList.length; i++) {
  192. allfloor.push(res.data.data[0].childrenList[i].childrenList)
  193. }
  194. // console.log('111111111111111111',allfloor)
  195. this.columnData = allfloor;
  196. this.indexList=[];
  197. this.dataForm.page = 1;
  198. this.getalldata();
  199. } else {
  200. this.showdct = true
  201. }
  202. })
  203. },
  204. floorchange() {
  205. this.showfloor = true;
  206. },
  207. changeHandler(e) {
  208. const {
  209. columnIndex,
  210. index,
  211. // 微信小程序无法将picker实例传出来,只能通过ref操作
  212. picker = this.$refs.uPicker
  213. } = e
  214. if (columnIndex === 0) {
  215. this.loading = true
  216. picker.setColumnValues(1, this.columnData[index])
  217. this.loading = false
  218. }
  219. // this.getalldata();
  220. },
  221. confirmfloor(e) {
  222. console.log('222222', e.value)
  223. this.mytitle = e.value[0].orgName + e.value[1].orgName;
  224. this.dataForm.buildingId = e.value[0].orgId;
  225. this.dataForm.storeyId = e.value[1].orgId;
  226. this.showfloor = false;
  227. this.indexList=[];
  228. this.dataForm.page = 1;
  229. this.getalldata();
  230. },
  231. cancelfloor() {
  232. this.showfloor = false;
  233. },
  234. }
  235. }
  236. </script>
  237. <style lang="scss">
  238. .companylist {
  239. margin: 24rpx 32rpx 0;
  240. background: #fff;
  241. padding: 24rpx 32rpx;
  242. border-radius: 8rpx;
  243. position: relative;
  244. h3 {
  245. margin-bottom: 24rpx;
  246. }
  247. .Currentamount {
  248. margin-bottom: 4rpx;
  249. color: #999;
  250. span {
  251. color: #FA5555;
  252. padding-left: 9rpx;
  253. }
  254. }
  255. .outstanding{
  256. position: absolute;
  257. width:96rpx;
  258. height: 48rpx;
  259. border-radius: 0 8rpx 0 20rpx;
  260. right:0;
  261. line-height: 48rpx;
  262. text-align: center;
  263. top:0;
  264. z-index: 1;
  265. font-size: 22rpx;
  266. background-color:#30D3A2 ;
  267. color: #fff;
  268. &.PropertyFee{
  269. background-color:#30D3A2 ;
  270. }
  271. }
  272. }
  273. .topbill {
  274. display: flex;
  275. justify-content:center;
  276. align-items: center;
  277. height: 100rpx;
  278. background-color: #fff;
  279. .topbilledit {
  280. display: flex;
  281. justify-content: space-around;
  282. align-items: center;
  283. .changetime1 {
  284. padding-right: 10rpx;
  285. }
  286. }
  287. }
  288. </style>