Withholdingrecord.vue 8.1 KB

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