Inspectionrecord.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462
  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="xunjianchange">
  11. <view class="changetime1">
  12. {{xjlx}}
  13. </view>
  14. <view class="changetime2">
  15. <u-icon name="arrow-down-fill" color="#666666" size="20"></u-icon>
  16. </view>
  17. </view>
  18. <view class="topbilledit" @click="typechange">
  19. <view class="changetime1">
  20. {{xjry}}
  21. </view>
  22. <view class="changetime2">
  23. <u-icon name="arrow-down-fill" color="#666666" size="20"></u-icon>
  24. </view>
  25. </view>
  26. </view>
  27. <!-- 列表 -->
  28. <!-- <t-table>
  29. <t-tr>
  30. <t-th>序号</t-th>
  31. <t-th>姓名</t-th>
  32. <t-th>年龄</t-th>
  33. <t-th>爱好</t-th>
  34. <t-th>操作</t-th>
  35. </t-tr>
  36. <t-tr v-for="item in tableList" :key="item.id">
  37. <t-td>{{ item.id + 1 }}</t-td>
  38. <t-td>{{ item.name }}</t-td>
  39. <t-td>{{ item.age }}</t-td>
  40. <t-td>{{ item.hobby }}</t-td>
  41. <t-td align="left"> <u-button @click="edit(item)" size="small" type="primary" :plain="true" text="编辑"></u-button></t-td>
  42. </t-tr>
  43. </t-table> -->
  44. <view class="u-listdata">
  45. <view style="padding:10rpx 0 0 30rpx">
  46. 共有 <span style="color: red">{{totalnumber}}</span>条记录
  47. </view>
  48. <u-list @scrolltolower="scrolltolower" :pagingEnabled='true'>
  49. <u-list-item v-for="(item, index) in indexList" :key="index">
  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="dictLabel" @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. totalnumber: 0,
  105. showtypexunjian: false,
  106. setyesno: true,
  107. // tableList: [{
  108. // id: 0,
  109. // name: '张三',
  110. // age: '19',
  111. // hobby: '游泳'
  112. // },
  113. // {
  114. // id: 1,
  115. // name: '李四',
  116. // age: '21',
  117. // hobby: '绘画'
  118. // },
  119. // ],
  120. indexList: [],
  121. xjlx: '巡检类型',
  122. dataList: [],
  123. dataForm: {
  124. projectId: "",
  125. buildingId: "",
  126. storeyId: "",
  127. cycle: "",
  128. status: "",
  129. page: 1,
  130. limit: 10,
  131. },
  132. showtype: false,
  133. showdct: false,
  134. mytitle: '',
  135. alldata: [],
  136. showfloor: false,
  137. loading: false,
  138. columns: [],
  139. columnData: [],
  140. pd: true,
  141. myday: '',
  142. xjry: '巡检人员',
  143. showPicker: false,
  144. myday: currentDate,
  145. columnstypexunjian: [],
  146. columnstype: [
  147. [{
  148. label: '张三',
  149. id: ''
  150. }, {
  151. label: '李四',
  152. id: 0
  153. },
  154. {
  155. label: '王五',
  156. id: 1
  157. }
  158. ]
  159. ],
  160. }
  161. },
  162. //监听页面加载,其参数为上个页面传递的数据,参数类型为 Object(用于页面传参
  163. onLoad() {
  164. let getDictDataList = uni.getStorageSync('getDictDataList');
  165. for (let i = 0; i < getDictDataList.length; i++) {
  166. if (getDictDataList[i].dictType == 'ReviewType') {
  167. this.columnstypexunjian = [getDictDataList[i].dataList]
  168. }
  169. }
  170. this.getfloor();
  171. // this.loadmore();
  172. },
  173. //监听页面初次渲染完成。注意如果渲染速度快,会在页面进入动画完成前触发
  174. onReady() {
  175. // 微信小程序需要用此写法
  176. },
  177. //监听页面隐藏
  178. onHide() {},
  179. //监听窗口尺寸变化
  180. onResize() {},
  181. //监听页面卸载
  182. onUnload() {},
  183. //监听用户下拉动作,一般用于下拉刷新
  184. onPullDownRefresh() {},
  185. methods: {
  186. seedetail(e) {
  187. console.log('222', e)
  188. },
  189. handleClick(e) {
  190. console.log('111111111111111111', e)
  191. },
  192. scrolltolower() {
  193. if(this.pd){
  194. this.getalldata();
  195. }else{
  196. return
  197. }
  198. },
  199. loadmore() {
  200. // for (let i = 0; i < 30; i++) {
  201. // this.indexList.push({
  202. // url: this.urls[uni.$u.random(0, this.urls.length - 1)]
  203. // })
  204. // }
  205. },
  206. xunjianchange() {
  207. this.showtypexunjian = true;
  208. },
  209. cancelxunjian() {
  210. this.showtypexunjian = false;
  211. },
  212. confirmxunjian(e) {
  213. this.xjlx = e.value[0].dictLabel;
  214. // this.dataForm.cycle = e.value[0].id;
  215. // this.dataForm.page = 1;
  216. // this.getalldata();
  217. this.showtypexunjian = false;
  218. },
  219. getalldata() {
  220. this.$api.get('/circuitrecord/page', this.dataForm)
  221. .then(res => {
  222. this.totalnumber = res.data.data.total;
  223. // console.log('111111111111111111',res.data.data.list)
  224. if (res.data.data.list.length != 0) {
  225. this.indexList.push(...res.data.data.list);
  226. this.dataForm.page = this.dataForm.page + 1;
  227. this.pd = true;
  228. } else {
  229. uni.showToast({
  230. title: '暂无更多数据了',
  231. icon: 'none',
  232. duration: 1500
  233. })
  234. this.pd = false;
  235. //this.jfnodata=true
  236. }
  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>