Intelligentdoorlock.vue 6.8 KB

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