Intelligentdoorlock.vue 6.7 KB

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