Inspectionrecord.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458
  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. <u-list @scrolltolower="scrolltolower" :pagingEnabled='true'>
  45. <u-list-item v-for="(item, index) in indexList" :key="index">
  46. <!-- <u-cell :title="`列表长度-${index + 1}`">
  47. <u-avatar slot="icon" shape="square" size="35" :src="item.url"
  48. customStyle="margin: -3px 5px -3px 0"></u-avatar>
  49. </u-cell> -->
  50. <view class="companylist" @click="seedetail(item)">
  51. <view class="settled" v-if="item.status==1">
  52. 已结清
  53. </view>
  54. <view class="outstanding" v-if="item.status==0">
  55. 未结清
  56. </view>
  57. <h3>{{item.name}}</h3>
  58. <view class="Currentamount">
  59. 本期金额: <span>¥{{item.feeTotal}}</span>
  60. </view>
  61. <view class="Currentamount">
  62. 欠费天数: {{item.elecAmount}}
  63. </view>
  64. <view class="Currentamount">
  65. 账户余额:¥{{item.balance}}
  66. </view>
  67. <view class="Currentamount">
  68. 联系电话: {{item.tel}}
  69. </view>
  70. <view class="Callfee" v-if="item.status==0" @click.stop="handleClick(item.id)">
  71. 催费
  72. </view>
  73. </view>
  74. </u-list-item>
  75. </u-list>
  76. </view>
  77. <u-picker :show="showtypexunjian" :columns="columnstypexunjian" keyName="label" @confirm="confirmxunjian"
  78. @cancel='cancelxunjian'>
  79. </u-picker>
  80. <u-picker :show="showtype" :columns="columnstype" keyName="label" @confirm="confirmtype" @cancel='canceltype'>
  81. </u-picker>
  82. <u-picker :show="showfloor" ref="uPicker" :loading="loading" @confirm="confirmfloor" @cancel='cancelfloor'
  83. :columns="columns" keyName="orgName" @change="changeHandler"></u-picker>
  84. <u-notify ref="uNotify" :show="showdct" message="服务器请求失败"></u-notify>
  85. </view>
  86. </template>
  87. <script>
  88. // import tTable from '@/components/t-table/t-table.vue';
  89. // import tTh from '@/components/t-table/t-th.vue';
  90. // import tTr from '@/components/t-table/t-tr.vue';
  91. // import tTd from '@/components/t-table/t-td.vue';
  92. export default {
  93. components: {
  94. // tTable,
  95. // tTh,
  96. // tTr,
  97. // tTd
  98. },
  99. data() {
  100. const currentDate = this.getDate({
  101. format: 'yyyy-mm'
  102. })
  103. return {
  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.indexList = [];
  235. this.indexList = res.data.data.list;
  236. })
  237. },
  238. // edit(item) {
  239. // console.log('111111111111111111', item)
  240. // },
  241. canceltype() {
  242. this.showtype = false;
  243. },
  244. confirmtype(e) {
  245. // console.log('111111111111111111', e.value[0])
  246. this.showtype = false;
  247. this.xjry = e.value[0].label;
  248. this.dataForm.cycle = e.value[0].id;
  249. this.dataForm.page = 1;
  250. this.getalldata();
  251. },
  252. typechange() {
  253. this.showtype = true;
  254. },
  255. dateChange(e) {
  256. this.myday = e.target.value;
  257. this.dataForm.cycle = e.target.value;
  258. this.dataForm.page = 1;
  259. this.getalldata();
  260. },
  261. getDate(type) {
  262. const date = new Date();
  263. let year = date.getFullYear();
  264. let month = date.getMonth() + 1;
  265. if (type === 'start') {
  266. year = year - 60;
  267. } else if (type === 'end') {
  268. year = year + 2;
  269. }
  270. month = month > 9 ? month : '0' + month;
  271. // day = day > 9 ? day : '0' + day;
  272. return `${year}-${month}`;
  273. },
  274. getfloor() {
  275. this.$api.get('/control/getOrgStructureTree/', {})
  276. .then(res => {
  277. if (res.data.code == 0) {
  278. this.dataForm.projectId = res.data.data[0].orgId;
  279. this.mytitle = res.data.data[0].orgName;
  280. this.alldata = res.data.data[0].childrenList;
  281. //console.log('111111111111111111', res.data.data[0].childrenList)
  282. this.columns = [
  283. res.data.data[0].childrenList,
  284. res.data.data[0].childrenList[0].childrenList
  285. ]
  286. let allfloor = [];
  287. for (let i = 0; i < res.data.data[0].childrenList.length; i++) {
  288. allfloor.push(res.data.data[0].childrenList[i].childrenList)
  289. }
  290. // console.log('111111111111111111',allfloor)
  291. this.columnData = allfloor;
  292. this.dataForm.page = 1;
  293. this.getalldata();
  294. } else {
  295. this.showdct = true
  296. }
  297. })
  298. },
  299. floorchange() {
  300. this.showfloor = true;
  301. },
  302. changeHandler(e) {
  303. const {
  304. columnIndex,
  305. index,
  306. // 微信小程序无法将picker实例传出来,只能通过ref操作
  307. picker = this.$refs.uPicker
  308. } = e
  309. if (columnIndex === 0) {
  310. this.loading = true
  311. picker.setColumnValues(1, this.columnData[index])
  312. this.loading = false
  313. }
  314. this.getalldata();
  315. },
  316. confirmfloor(e) {
  317. console.log('222222', e.value)
  318. this.mytitle = e.value[0].orgName + e.value[1].orgName;
  319. this.dataForm.buildingId = e.value[0].orgId;
  320. this.dataForm.storeyId = e.value[1].orgId;
  321. this.showfloor = false;
  322. this.getalldata();
  323. },
  324. cancelfloor() {
  325. this.showfloor = false;
  326. },
  327. }
  328. }
  329. </script>
  330. <style lang="scss">
  331. .Currentamount {
  332. padding-left: 30rpx;
  333. height: 50rpx;
  334. line-height: 50rpx;
  335. color: #BCB3A7;
  336. span {
  337. color: #FA5555;
  338. padding-left: 9rpx;
  339. }
  340. }
  341. .Callfee {
  342. width: 100rpx;
  343. height: 45rpx;
  344. text-align: center;
  345. line-height: 45rpx;
  346. color: #5C8FFF;
  347. border: 1px solid #5C8FFF;
  348. font-size: 22rpx;
  349. position: absolute;
  350. bottom: 10rpx;
  351. right: 10px;
  352. font-weight: bold;
  353. }
  354. .companylist {
  355. margin: 20rpx 30rpx;
  356. background: #fff;
  357. height: 280rpx;
  358. border-radius: 10px;
  359. position: relative;
  360. h3 {
  361. height: 70rpx;
  362. line-height: 70rpx;
  363. padding-left: 30rpx;
  364. }
  365. }
  366. .settled {
  367. background-color: #09C700;
  368. width: 100rpx;
  369. height: 40rpx;
  370. text-align: center;
  371. line-height: 40rpx;
  372. color: #fff;
  373. font-size: 14rpx;
  374. position: absolute;
  375. top: 0px;
  376. right: 0px;
  377. border-top-right-radius: 10rpx;
  378. border-bottom-left-radius: 10rpx;
  379. }
  380. .outstanding {
  381. background-color: #FA5555;
  382. width: 100rpx;
  383. height: 40rpx;
  384. text-align: center;
  385. line-height: 40rpx;
  386. color: #fff;
  387. font-size: 14rpx;
  388. position: absolute;
  389. top: 0px;
  390. right: 0px;
  391. border-top-right-radius: 10rpx;
  392. border-bottom-left-radius: 10rpx;
  393. }
  394. .billall {}
  395. .topbill {
  396. display: flex;
  397. justify-content: space-around;
  398. align-items: center;
  399. height: 100rpx;
  400. background-color: #e6e6e6;
  401. }
  402. .topbilledit {
  403. display: flex;
  404. justify-content: space-around;
  405. align-items: center;
  406. }
  407. .changetime1 {
  408. padding-right: 10rpx;
  409. }
  410. </style>