Intelligentdoorlock.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  1. <template>
  2. <view class="billall">
  3. <view class="u-listdata">
  4. <view style="padding: 16rpx 0 16rpx 32rpx">
  5. 共有 <span style="color: red">{{ totalnumber }}</span>条记录
  6. </view>
  7. <u-list @scrolltolower="scrolltolower" :pagingEnabled="true">
  8. <u-list-item v-for="(item, index) in indexList" :key="index">
  9. <view class="companylist">
  10. <h3>{{ item.name }}</h3>
  11. <view class="Currentamount"> 设备编号:{{ item.deviceId }} </view>
  12. <view class="Callfee">
  13. <span @click="kaimen(item)">开门记录</span>
  14. <span @click="Remotedooropening(item)">远程开门</span>
  15. <span @click="confirmPwd(item.deviceId)">临时密码</span>
  16. <span @click="seedetail(item)">查看租户</span>
  17. </view>
  18. </view>
  19. </u-list-item>
  20. </u-list>
  21. </view>
  22. <!-- 门锁信息 -->
  23. <!-- <u-modal :show="showms" @confirm="confirmPwd" title="临时密码设置" :showCancelButton="true" @cancel="showms = false">
  24. <view class="slot-content">
  25. <u--input placeholder="请输入临时密码" v-model="lsmima"></u--input>
  26. </view>
  27. </u-modal> -->
  28. <u-notify ref="uNotify" message=""></u-notify>
  29. </view>
  30. </template>
  31. <script>
  32. export default {
  33. components: {},
  34. data() {
  35. return {
  36. showms: false,
  37. totalnumber: 0,
  38. setyesno: true,
  39. lsmima: "",
  40. indexList: [],
  41. dataList: [],
  42. dataForm: {
  43. currentPage: 1,
  44. deviceId: "",
  45. pageSize: 10,
  46. roomId: "",
  47. tempPwd: "",
  48. tenantsId: "",
  49. userName: "",
  50. },
  51. showtype: false,
  52. showdct: false,
  53. mytitle: "",
  54. alldata: [],
  55. showfloor: false,
  56. loading: false,
  57. columns: [],
  58. pd: true,
  59. columnData: [],
  60. myday: "",
  61. mytype: "全部",
  62. showPicker: false,
  63. };
  64. },
  65. //监听页面加载,其参数为上个页面传递的数据,参数类型为 Object(用于页面传参
  66. onLoad() {
  67. this.getalldata();
  68. },
  69. //监听页面初次渲染完成。注意如果渲染速度快,会在页面进入动画完成前触发
  70. onReady() {
  71. // 微信小程序需要用此写法
  72. },
  73. //监听页面隐藏
  74. onHide() {},
  75. //监听窗口尺寸变化
  76. onResize() {},
  77. //监听页面卸载
  78. onUnload() {},
  79. //监听用户下拉动作,一般用于下拉刷新
  80. onPullDownRefresh() {},
  81. methods: {
  82. Remotedooropening(e) {
  83. let postdata = {
  84. cmdType: "RemoteOpenDoor",
  85. roomId: e.roomid,
  86. };
  87. this.$api.post("/lock/issuedCmd", postdata).then((res) => {
  88. if (res.data.code == 0) {
  89. this.$refs.uNotify.success(res.data.data);
  90. } else {
  91. this.$refs.uNotify.error(res.data.msg);
  92. }
  93. });
  94. },
  95. seedetail(e) {
  96. uni.navigateTo({
  97. url: `/pages/Workorder/Intelligentdoorlock/Tenantdetails/Tenantdetails?companyOrgId=${e.roomid}`,
  98. });
  99. },
  100. kaimen(e) {
  101. uni.navigateTo({
  102. url: `/pages/Workorder/Intelligentdoorlock/Dooropeningrecord/Dooropeningrecord?companyOrgId=${e.roomid}`,
  103. });
  104. },
  105. // setPwd(deviceId) {
  106. // this.showms = true;
  107. // this.dataForm.deviceId = deviceId;
  108. // },
  109. confirmPwd(deviceId) {
  110. this.$api
  111. .post("/lock/getTempPwd", {
  112. tempPwd: '123456',
  113. deviceId: deviceId,
  114. })
  115. .then((res) => {
  116. if (res.data.code == 0) {
  117. this.showms = false;
  118. uni.showModal({
  119. title: '提示',
  120. showCancel:false,
  121. content:'临时密码是:'+res.data.data,
  122. success: function (res) {
  123. }
  124. });
  125. } else {
  126. this.$refs.uNotify.error(res.data.msg);
  127. }
  128. });
  129. },
  130. closems() {
  131. this.showms = false;
  132. },
  133. scrolltolower() {
  134. if (this.pd) {
  135. this.getalldata();
  136. } else {
  137. return;
  138. }
  139. },
  140. getalldata() {
  141. this.$api.post("/lock/page", this.dataForm).then((res) => {
  142. this.totalnumber = res.data.data.total;
  143. if (res.data.data.list.length != 0) {
  144. this.indexList.push(...res.data.data.list);
  145. this.dataForm.currentPage = this.dataForm.currentPage + 1;
  146. this.pd = true;
  147. } else {
  148. uni.showToast({
  149. title: "暂无更多数据了",
  150. icon: "none",
  151. duration: 1500,
  152. });
  153. this.pd = false;
  154. }
  155. });
  156. },
  157. },
  158. };
  159. </script>
  160. <style lang="scss">
  161. .Callfee{
  162. width: 100%;
  163. border-top: 1px solid #eee;
  164. padding: 20rpx 0;
  165. margin-top: 24rpx;
  166. display: flex;
  167. justify-content: flex-end;
  168. span{
  169. padding: 10rpx 16rpx;
  170. border: 1px solid #2E69EB;
  171. border-radius: 8rpx;
  172. font-size: 24rpx;
  173. color: #2E69EB;
  174. margin-right: 24rpx;
  175. }
  176. }
  177. .companylist {
  178. margin: 24rpx 32rpx 0;
  179. background: #fff;
  180. padding: 24rpx 32rpx 0;
  181. border-radius: 8rpx;
  182. position: relative;
  183. h3 {
  184. margin-bottom: 24rpx;
  185. }
  186. .Currentamount {
  187. margin-bottom: 4rpx;
  188. color: #999;
  189. span {
  190. color: #FA5555;
  191. padding-left: 9rpx;
  192. }
  193. }
  194. }
  195. </style>