Inspectionrecord.vue 10 KB

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