Intelligentdoorlock.vue 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381
  1. <template>
  2. <view class="billall">
  3. <!-- 列表 -->
  4. <!-- <t-table>
  5. <t-tr>
  6. <t-th>序号</t-th>
  7. <t-th>姓名</t-th>
  8. <t-th>年龄</t-th>
  9. <t-th>爱好</t-th>
  10. <t-th>操作</t-th>
  11. </t-tr>
  12. <t-tr v-for="item in tableList" :key="item.id">
  13. <t-td>{{ item.id + 1 }}</t-td>
  14. <t-td>{{ item.name }}</t-td>
  15. <t-td>{{ item.age }}</t-td>
  16. <t-td>{{ item.hobby }}</t-td>
  17. <t-td align="left"> <u-button @click="edit(item)" size="small" type="primary" :plain="true" text="编辑"></u-button></t-td>
  18. </t-tr>
  19. </t-table> -->
  20. <view class="u-listdata">
  21. <view style="padding:10rpx 0 0 30rpx">
  22. 共有 <span style="color: red">{{totalnumber}}</span>条记录
  23. </view>
  24. <u-list @scrolltolower="scrolltolower" :pagingEnabled='true'>
  25. <u-list-item v-for="(item, index) in indexList" :key="index">
  26. <view class="companylist">
  27. <view class="settled" @click="kaimen(item)">
  28. 开门记录
  29. </view>
  30. <view class="outstanding" @click="Remotedooropening(item)">
  31. 远程开门
  32. </view>
  33. <view class="outstanding1" @click="setPwd(item.deviceId)">
  34. 临时密码
  35. </view>
  36. <view class="outstanding2" @click="seedetail(item)">
  37. 查看租户
  38. </view>
  39. <h3>{{item.name}}</h3>
  40. <view class="Currentamount">
  41. 房间编号:{{item.roomid}}
  42. </view>
  43. <view class="Currentamount">
  44. 用户总数量: {{item.usernum}}
  45. </view>
  46. <view class="Currentamount">
  47. 设备编号:{{item.deviceId}}
  48. </view>
  49. <view class="Currentamount">
  50. 网关编号: {{item.deviceno}}
  51. </view>
  52. <!-- <view class="Currentamount">
  53. 安装时间: {{item.installationtime}}
  54. </view> -->
  55. </view>
  56. </u-list-item>
  57. </u-list>
  58. </view>
  59. <!-- 门锁信息 -->
  60. <u-modal :show="showms" @confirm="confirmPwd" title="临时密码设置" :showCancelButton="true" @cancel="showms=false">
  61. <view class="slot-content">
  62. <u--input
  63. placeholder="请输入临时密码"
  64. v-model="lsmima"
  65. ></u--input>
  66. </view>
  67. </u-modal>
  68. <u-notify ref="uNotify" message=""></u-notify>
  69. </view>
  70. </template>
  71. <script>
  72. // import tTable from '@/components/t-table/t-table.vue';
  73. // import tTh from '@/components/t-table/t-th.vue';
  74. // import tTr from '@/components/t-table/t-tr.vue';
  75. // import tTd from '@/components/t-table/t-td.vue';
  76. export default {
  77. components: {
  78. // tTable,
  79. // tTh,
  80. // tTr,
  81. // tTd
  82. },
  83. data() {
  84. return {
  85. showms: false,
  86. totalnumber: 0,
  87. setyesno: true,
  88. lsmima: '',
  89. indexList: [],
  90. dataList: [],
  91. dataForm: {
  92. "currentPage":1,
  93. "deviceId": "",
  94. "pageSize": 10,
  95. "roomId": "",
  96. "tempPwd": "",
  97. "tenantsId": "",
  98. "userName": ""
  99. },
  100. showtype: false,
  101. showdct: false,
  102. mytitle: '',
  103. alldata: [],
  104. showfloor: false,
  105. loading: false,
  106. columns: [],
  107. pd: true,
  108. columnData: [],
  109. myday: '',
  110. mytype: '全部',
  111. showPicker: false,
  112. }
  113. },
  114. //监听页面加载,其参数为上个页面传递的数据,参数类型为 Object(用于页面传参
  115. onLoad() {
  116. this.getalldata();
  117. },
  118. //监听页面初次渲染完成。注意如果渲染速度快,会在页面进入动画完成前触发
  119. onReady() {
  120. // 微信小程序需要用此写法
  121. },
  122. //监听页面隐藏
  123. onHide() {},
  124. //监听窗口尺寸变化
  125. onResize() {},
  126. //监听页面卸载
  127. onUnload() {},
  128. //监听用户下拉动作,一般用于下拉刷新
  129. onPullDownRefresh() {},
  130. methods: {
  131. Remotedooropening(e) {
  132. let postdata = {
  133. cmdType: 'RemoteOpenDoor',
  134. roomId: e.roomid
  135. };
  136. this.$api.post('/lock/issuedCmd', postdata)
  137. .then(res => {
  138. if (res.data.code == 0) {
  139. this.$refs.uNotify.success(res.data.data)
  140. } else {
  141. this.$refs.uNotify.error(res.data.msg)
  142. }
  143. })
  144. },
  145. seedetail(e) {
  146. uni.navigateTo({
  147. url: `/pages/Workorder/Intelligentdoorlock/Tenantdetails/Tenantdetails?companyOrgId=${e.roomid}`
  148. });
  149. },
  150. kaimen(e) {
  151. uni.navigateTo({
  152. url: `/pages/Workorder/Intelligentdoorlock/Dooropeningrecord/Dooropeningrecord?companyOrgId=${e.roomid}`
  153. });
  154. },
  155. setPwd(deviceId){
  156. this.showms=true;
  157. this.dataForm.deviceId=deviceId
  158. },
  159. confirmPwd() {
  160. this.$api.post('/lock/getTempPwd',{
  161. tempPwd:this.lsmima,
  162. deviceId:this.dataForm.deviceId
  163. }).then(res => {
  164. if (res.data.code == 0) {
  165. this.showms = false;
  166. //this.lsmima = res.data.data;
  167. this.$refs.uNotify.success(res.data.msg)
  168. } else {
  169. this.$refs.uNotify.error(res.data.msg)
  170. }
  171. })
  172. },
  173. closems() {
  174. this.showms = false
  175. // console.log('close');
  176. },
  177. scrolltolower() {
  178. if (this.pd) {
  179. this.getalldata();
  180. } else {
  181. return
  182. }
  183. },
  184. getalldata() {
  185. this.$api.post('/lock/page', this.dataForm)
  186. .then(res => {
  187. this.totalnumber = res.data.data.total;
  188. if (res.data.data.list.length != 0) {
  189. this.indexList.push(...res.data.data.list);
  190. this.dataForm.currentPage = this.dataForm.currentPage + 1;
  191. this.pd = true;
  192. } else {
  193. uni.showToast({
  194. title: '暂无更多数据了',
  195. icon: 'none',
  196. duration: 1500
  197. })
  198. this.pd = false;
  199. }
  200. })
  201. },
  202. }
  203. }
  204. </script>
  205. <style lang="scss">
  206. .mensuoxx {
  207. width: 750rpx;
  208. height: 300rpx;
  209. h3 {
  210. width: 100%;
  211. height: 80rpx;
  212. text-align: center;
  213. line-height: 80rpx;
  214. margin-bottom: 50rpx;
  215. }
  216. }
  217. .Currentamount {
  218. padding-left: 30rpx;
  219. min-height: 50rpx;
  220. line-height: 50rpx;
  221. color: #BCB3A7;
  222. span {
  223. color: #FA5555;
  224. padding-left: 9rpx;
  225. }
  226. }
  227. .Callfee {
  228. width: 100rpx;
  229. height: 45rpx;
  230. text-align: center;
  231. line-height: 45rpx;
  232. color: #5C8FFF;
  233. border: 1px solid #5C8FFF;
  234. font-size: 22rpx;
  235. position: absolute;
  236. bottom: 10rpx;
  237. right: 10px;
  238. font-weight: bold;
  239. }
  240. .companylist {
  241. margin: 20rpx 30rpx;
  242. background: #fff;
  243. min-height: 380rpx;
  244. border-radius: 10px;
  245. position: relative;
  246. h3 {
  247. height: 70rpx;
  248. line-height: 70rpx;
  249. padding-left: 30rpx;
  250. }
  251. }
  252. .settled {
  253. background-color: #2B60DE;
  254. width: 120rpx;
  255. height: 60rpx;
  256. text-align: center;
  257. line-height: 60rpx;
  258. color: #fff;
  259. font-size: 14rpx;
  260. position: absolute;
  261. top: 0px;
  262. right: 0px;
  263. border-top-right-radius: 10rpx;
  264. border-bottom-left-radius: 10rpx;
  265. }
  266. .outstanding {
  267. background-color: #09C700;
  268. width: 120rpx;
  269. height: 60rpx;
  270. text-align: center;
  271. line-height: 60rpx;
  272. color: #fff;
  273. font-size: 14rpx;
  274. position: absolute;
  275. top: 110rpx;
  276. right: 0px;
  277. border-top-left-radius: 10rpx;
  278. border-bottom-left-radius: 10rpx;
  279. }
  280. .outstanding1 {
  281. background-color: #3090C7;
  282. width: 120rpx;
  283. height: 60rpx;
  284. text-align: center;
  285. line-height: 60rpx;
  286. color: #fff;
  287. font-size: 14rpx;
  288. position: absolute;
  289. top: 56%;
  290. right: 0px;
  291. border-top-left-radius: 10rpx;
  292. border-bottom-left-radius: 10rpx;
  293. }
  294. .outstanding2 {
  295. background-color: #4E8975;
  296. width: 120rpx;
  297. height: 60rpx;
  298. text-align: center;
  299. line-height: 60rpx;
  300. color: #fff;
  301. font-size: 14rpx;
  302. position: absolute;
  303. bottom: 0px;
  304. right: 0px;
  305. border-top-left-radius: 10rpx;
  306. border-bottom-right-radius: 10rpx;
  307. }
  308. .billall {}
  309. .topbill {
  310. display: flex;
  311. justify-content: space-around;
  312. align-items: center;
  313. height: 100rpx;
  314. background-color: #e6e6e6;
  315. }
  316. .topbilledit {
  317. display: flex;
  318. justify-content: space-around;
  319. align-items: center;
  320. }
  321. .changetime1 {
  322. padding-right: 10rpx;
  323. }
  324. </style>