doorLock.vue 136 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863
  1. <template>
  2. <div class="content-box">
  3. <div class="left">
  4. <!-- <el-icon :size="23" class="camera"><VideoCameraFilled /></el-icon> -->
  5. <span class="cameratxt">门锁管理</span>
  6. </div>
  7. <div class="middles">
  8. <div class="middle">
  9. <div class="filter">
  10. <div class="condition">
  11. <el-input
  12. :clearable="true"
  13. @clear="searchBtn"
  14. v-model.trim="searchInput.keyWord"
  15. class="w-50 m-2"
  16. placeholder="请输入关键字查询"
  17. style="width: 230px"
  18. />
  19. <el-button
  20. style="margin-left: 20px"
  21. color="rgba(41, 109, 227, 1)"
  22. type="primary"
  23. class="search"
  24. @click="searchBtn"
  25. ><el-icon>
  26. <Search />
  27. </el-icon>
  28. <span>查询</span></el-button
  29. >
  30. <el-button
  31. v-if="flagBtn.daoru==1"
  32. style="margin-left: 20px"
  33. color="rgba(41, 109, 227, 1)"
  34. type="primary"
  35. class="search"
  36. @click="bulkImportClick"
  37. >批量导入</el-button
  38. >
  39. <div class="condition" style="margin-left:30px">
  40. <span>楼栋单元</span>
  41. <el-select
  42. v-model="searchInput.buildingId"
  43. placeholder="请选择楼栋单元"
  44. style="width: 200px;margin-left:10px"
  45. @change="searchBtn"
  46. :clearable="true"
  47. >
  48. <el-option
  49. v-for="item in buildData"
  50. :key="item.id"
  51. :label="`${item.building}${item.element}`"
  52. :value="item.id"
  53. />
  54. </el-select>
  55. </div>
  56. <div class="condition" style="margin-left:30px">
  57. <span>房间类型</span>
  58. <el-select
  59. style="width: 180px;margin-left:10px"
  60. v-model="searchInput.houseType"
  61. class="m-2"
  62. placeholder="请选择类型"
  63. :clearable="true"
  64. @change="searchBtn"
  65. >
  66. <el-option label="全日房" value="1" />
  67. <el-option label="钟点房" value="2" />
  68. </el-select>
  69. </div>
  70. </div>
  71. </div>
  72. <div class="changeItems">
  73. <div
  74. class="changeItem"
  75. :class="roomTypeIndex == '全部' ? 'changeItem_active' : ''"
  76. @click="changeTypes('全部')"
  77. >
  78. 全部
  79. </div>
  80. <div
  81. v-for="i in roomTypes"
  82. class="changeItem"
  83. :class="roomTypeIndex == i ? 'changeItem_active' : ''"
  84. @click="changeTypes(i)"
  85. >
  86. {{ i }}
  87. </div>
  88. </div>
  89. <!-- <div class="changeItems">
  90. <el-button
  91. color="rgba(41, 109, 227, 1)"
  92. type="primary"
  93. class="search"
  94. @click="searchBtn"
  95. >
  96. 重置管理员密码</el-button
  97. >
  98. <el-button
  99. color="rgba(41, 109, 227, 1)"
  100. type="primary"
  101. class="search"
  102. @click="addTemporaryCard"
  103. >
  104. 添加总卡</el-button
  105. >
  106. <el-button
  107. color="rgba(41, 109, 227, 1)"
  108. type="primary"
  109. class="search"
  110. @click="searchBtn"
  111. >
  112. 批量下发开门密码</el-button
  113. >
  114. <el-button
  115. color="rgba(41, 109, 227, 1)"
  116. type="primary"
  117. class="search"
  118. @click="searchBtn"
  119. >
  120. 批量导入</el-button
  121. >
  122. </div> -->
  123. </div>
  124. <div class="footer" v-loading="loading">
  125. <div class="floor" v-for="item in roomList.list">
  126. <div class="title">
  127. <span class="t1"
  128. >{{ item.name }}
  129. <span style="color: #1e7dfb"
  130. >( {{ item.roomType == 1 ? "全" : "钟" }} )</span
  131. ></span
  132. >
  133. <span class="t2"> / 共{{ item.total }}间</span>
  134. </div>
  135. <div class="roomList">
  136. <div class="room" v-for="i in item.vos">
  137. <el-popover
  138. popper-class="roominfoPopper"
  139. placement="bottom-start"
  140. :width="460"
  141. trigger="click"
  142. effect="light"
  143. :visible="i.visible"
  144. >
  145. <template #reference>
  146. <div @click="itemClick(i)">
  147. <div class="roomNum">{{ i.roomNumber }}</div>
  148. <div class="rLock">房间锁</div>
  149. <div class="wifi">
  150. <img
  151. v-if="i.equipmentState == 1"
  152. src="@/assets/icons/wifiOpen.png"
  153. alt=""
  154. />
  155. <img v-else src="@/assets/icons/wifiClose.png" alt="" />
  156. {{ i.equipmentType }}
  157. </div>
  158. </div>
  159. </template>
  160. <div class="roomInfo">
  161. <div class="close" @click="closeRoom(i)">
  162. <img src="@/assets/icons/close.png" alt="" />
  163. </div>
  164. <div class="title">{{ i.roomNumber }} (房间锁)</div>
  165. <div class="content">
  166. <div class="lefts">
  167. <div>
  168. <span>设备型号</span>
  169. <span>{{ i.equipmentType }}</span>
  170. </div>
  171. <div>
  172. <span>网络类型</span>
  173. <span>{{ i.networkType }}</span>
  174. </div>
  175. <div>
  176. <span>WIFI MAC</span>
  177. <span>{{ i.wifiMac }}</span>
  178. </div>
  179. <div>
  180. <span>绑定时间</span>
  181. <span>{{ i.bindingTime }}</span>
  182. </div>
  183. <div>
  184. <span>电量</span>
  185. <span v-if="electricQuantity"
  186. >{{ electricQuantity }}%</span
  187. >
  188. </div>
  189. <div>
  190. <span>网络状态</span>
  191. <span v-if="i.networkState == 1">在线</span>
  192. <span v-if="i.networkState == 0">离线</span>
  193. <span v-if="i.networkState == null"></span>
  194. </div>
  195. <div>
  196. <span>设备状态</span>
  197. <span v-if="i.equipmentState == 1">在线</span>
  198. <span v-if="i.equipmentState == 0">离线</span>
  199. <span v-if="i.equipmentState == null"></span>
  200. </div>
  201. </div>
  202. <div class="rigths">
  203. <!-- <div @click="forbiddenClick">
  204. <img src="@/assets/icons/forbidden.png" alt="" />
  205. <span>禁用门锁</span>
  206. </div> -->
  207. <div @click="keyClick(i)" v-if="flagBtn.daoru==1">
  208. <img src="@/assets/icons/key.png" alt="" />
  209. <span>钥匙管理</span>
  210. </div>
  211. <div @click="newsClick(i)" v-if="flagBtn.daoru==1">
  212. <img src="@/assets/icons/news.png" alt="" />
  213. <span>消息列表</span>
  214. </div>
  215. <div @click="unlockingClick(i)" v-if="flagBtn.daoru==1">
  216. <img src="@/assets/icons/unlocking.png" alt="" />
  217. <span>远程开锁</span>
  218. </div>
  219. <!-- <div @click="resetPassClick">
  220. <img src="@/assets/icons/resetPass.png" alt="" />
  221. <span>重置管理员密码</span>
  222. </div> -->
  223. <div
  224. @click="bindingClick(i)"
  225. v-if="i.equipmentState != 1 && flagBtn.daoru==1"
  226. >
  227. <img
  228. class="deblocking"
  229. src="@/assets/icons/binding.png"
  230. alt=""
  231. />
  232. <span>绑定设备</span>
  233. </div>
  234. <div
  235. @click="deblockingClick(i)"
  236. v-if="i.equipmentState == 1 && flagBtn.daoru==1"
  237. >
  238. <img
  239. class="deblocking"
  240. src="@/assets/icons/deblocking.png"
  241. alt=""
  242. />
  243. <span>解绑设备</span>
  244. </div>
  245. <div
  246. @click="nfcClick(i,1)"
  247. v-if="nfcFunction==0 && flagBtn.daoru==1"
  248. >
  249. <img
  250. class="deblocking"
  251. src="@/assets/icons/nfc.png"
  252. alt=""
  253. />
  254. <span>NFC启用</span>
  255. </div>
  256. <div
  257. @click="nfcClick(i,0)"
  258. v-if="nfcFunction==1"
  259. >
  260. <img
  261. class="deblocking"
  262. src="@/assets/icons/nfc.png"
  263. alt=""
  264. />
  265. <span>NFC禁用</span>
  266. </div>
  267. </div>
  268. </div>
  269. </div>
  270. </el-popover>
  271. </div>
  272. </div>
  273. </div>
  274. </div>
  275. <!-- 消息列表 -->
  276. <el-dialog
  277. class="newsDialog"
  278. v-model="newsVisible"
  279. :close-on-click-modal="false"
  280. :close-on-press-escape="false"
  281. title="消息列表"
  282. align-center
  283. width="1000"
  284. :before-close="cancelNews"
  285. >
  286. <div class="middle">
  287. <div class="changeItems">
  288. <div
  289. class="changeNews"
  290. :class="newsIndex == 1 ? 'changeNews_active' : ''"
  291. @click="changeNews(1)"
  292. >
  293. 开锁记录
  294. </div>
  295. <div
  296. class="changeNews"
  297. :class="newsIndex == 2 ? 'changeNews_active' : ''"
  298. @click="changeNews(2)"
  299. >
  300. 操作记录
  301. </div>
  302. </div>
  303. </div>
  304. <div v-if="newsIndex == 1">
  305. <div class="footers" v-loading="loading">
  306. <el-table
  307. :row-class-name="tableRowClassName"
  308. :data="newTableList"
  309. @selection-change="handleSelectionChange"
  310. style="width: 100%; height: 550px"
  311. :header-cell-style="{
  312. background: 'rgba(240, 243, 247, 1)',
  313. height: '50px',
  314. border: 0,
  315. }"
  316. >
  317. <el-table-column align="center" prop="roomNumber" label="房间号">
  318. </el-table-column>
  319. <el-table-column align="center" prop="type" label="类型" />
  320. <el-table-column align="center" prop="unlockType" label="操作" />
  321. <el-table-column
  322. align="center"
  323. prop="updateTime"
  324. label="消息时间"
  325. >
  326. </el-table-column>
  327. </el-table>
  328. </div>
  329. <div class="pageSize">
  330. <span></span>
  331. <el-pagination
  332. background
  333. :current-page="newsPage"
  334. :page-size="newsSize"
  335. layout="total, prev, pager, next, jumper, slot"
  336. :total="newsTotal"
  337. @update:current-page="newsHandleCurrentChange"
  338. />
  339. </div>
  340. </div>
  341. <div v-if="newsIndex == 2">
  342. <div class="footers" v-loading="loading">
  343. <el-table
  344. :row-class-name="tableRowClassName"
  345. :data="newTableList"
  346. @selection-change="handleSelectionChange"
  347. style="width: 100%; height: 550px"
  348. :header-cell-style="{
  349. background: 'rgba(240, 243, 247, 1)',
  350. height: '50px',
  351. border: 0,
  352. }"
  353. >
  354. <el-table-column align="center" prop="roomNumber" label="房间号">
  355. </el-table-column>
  356. <el-table-column align="center" prop="type" label="类型" />
  357. <el-table-column
  358. align="center"
  359. prop="operatorName"
  360. label="操作人"
  361. />
  362. <el-table-column
  363. align="center"
  364. prop="dataTime"
  365. label="操作时间"
  366. />
  367. <el-table-column align="center" prop="content" label="操作内容">
  368. </el-table-column>
  369. </el-table>
  370. </div>
  371. <div class="pageSize">
  372. <span></span>
  373. <el-pagination
  374. background
  375. :current-page="newsPage"
  376. :page-size="newsSize"
  377. layout="total, prev, pager, next, jumper, slot"
  378. :total="newsTotal"
  379. @update:current-page="newsHandleCurrentChange"
  380. />
  381. </div>
  382. </div>
  383. </el-dialog>
  384. <!-- 远程开锁 -->
  385. <el-dialog
  386. class="unlockingDialog"
  387. v-model="unlockingVisible"
  388. :close-on-click-modal="false"
  389. :close-on-press-escape="false"
  390. title="远程开锁"
  391. align-center
  392. width="400"
  393. :before-close="cancelUnlocking"
  394. >
  395. <div class="middle">
  396. <div class="content">确定远程开锁吗?<br/><span class="marning">注: 远程开锁前,门锁需要先按“4#”进入请求远程开锁模式</span></div>
  397. <div class="options">
  398. <el-button
  399. color="rgba(41, 109, 227, 1)"
  400. class="queding"
  401. type="primary"
  402. @click="unlockingSubmit"
  403. >
  404. 确定
  405. </el-button>
  406. <el-button @click="cancelUnlocking">取消</el-button>
  407. </div>
  408. </div>
  409. </el-dialog>
  410. <!-- 绑定设备 -->
  411. <el-dialog
  412. class="BindingDialog"
  413. v-model="bindingVisible"
  414. :close-on-click-modal="false"
  415. :close-on-press-escape="false"
  416. title="绑定设备"
  417. align-center
  418. width="450"
  419. :before-close="cancelBinding"
  420. >
  421. <div class="middle">
  422. <el-form
  423. ref="bindingRef"
  424. :model="bindingList"
  425. :rules="bindingrules"
  426. label-width="100px"
  427. class="demo-ruleForm"
  428. :size="formSize"
  429. label-position="left"
  430. status-icon
  431. >
  432. <el-form-item label="绑定设备 :" prop="luid">
  433. <el-input
  434. style="width: 250px"
  435. v-model.trim="bindingList.luid"
  436. placeholder="请输入设备id"
  437. clearable
  438. />
  439. </el-form-item>
  440. <el-form-item class="options">
  441. <el-button
  442. color="rgba(0, 97, 255, 1)"
  443. class="queding"
  444. type="primary"
  445. @click="bindingSubmit(bindingRef)"
  446. >
  447. 确定
  448. </el-button>
  449. <el-button @click="cancelBinding">取消</el-button>
  450. </el-form-item>
  451. </el-form>
  452. </div>
  453. </el-dialog>
  454. <!-- 解绑设备 -->
  455. <el-dialog
  456. class="unlockingDialog"
  457. v-model="deblockingVisible"
  458. :close-on-click-modal="false"
  459. :close-on-press-escape="false"
  460. title="解绑设备"
  461. align-center
  462. width="400"
  463. :before-close="cancelDeblocking"
  464. >
  465. <div class="middle">
  466. <div class="content">确定解绑设备吗?</div>
  467. <div class="options">
  468. <el-button
  469. color="rgba(41, 109, 227, 1)"
  470. class="queding"
  471. type="primary"
  472. @click="deblockSubmit"
  473. >
  474. 确定
  475. </el-button>
  476. <el-button @click="cancelDeblocking">取消</el-button>
  477. </div>
  478. </div>
  479. </el-dialog>
  480. <!-- 批量导入 -->
  481. <el-dialog
  482. class="bulkImportDialog"
  483. v-model="bulkImportVisible"
  484. :close-on-click-modal="false"
  485. :close-on-press-escape="false"
  486. title="批量导入"
  487. align-center
  488. width="570"
  489. :before-close="cancelBulkImport"
  490. >
  491. <div class="middle">
  492. <el-upload
  493. style="width: 500px"
  494. class="upload-demo"
  495. ref="bulkImportref"
  496. drag
  497. action="#"
  498. :on-preview="handlePreview"
  499. :on-remove="handleRemove"
  500. :on-change="handleChange"
  501. :http-request="handleUpload"
  502. :before-upload="beforeAvatarUpload"
  503. :limit="1"
  504. :on-exceed="handleExceed"
  505. >
  506. <el-icon class="el-icon--upload"><upload-filled /></el-icon>
  507. <div class="el-upload__text">
  508. <span style="font-size: 20px">点击上传或拖拽文件</span><br />
  509. <em>请按照标准模板填写信息</em><br />
  510. <em>&nbsp;</em>
  511. </div>
  512. <!-- <template #tip>
  513. <div class="el-upload__tip">
  514. jpg/png files with a size less than 500kb
  515. </div>
  516. </template> -->
  517. </el-upload>
  518. <div class="startImport">
  519. <el-button
  520. v-if="bulkImportFile"
  521. type="primary"
  522. color="rgba(0, 97, 255, 1)"
  523. style="width: 200px"
  524. @click="bulkImportConfig"
  525. plain
  526. >开始导入</el-button
  527. >
  528. <span
  529. v-else
  530. type="primary"
  531. color="rgba(236, 245, 255, 1)"
  532. style="
  533. display: inline-block;
  534. width: 200px;
  535. height: 42px;
  536. text-align: center;
  537. line-height: 42px;
  538. color: rgb(160, 207, 255);
  539. border: 1px solid #dcdfe6;
  540. border-radius: 4px;
  541. "
  542. plain
  543. >开始导入</span
  544. >
  545. <span
  546. style="
  547. width: 120px;
  548. margin-left: 20px;
  549. cursor: pointer;
  550. color: rgba(0, 97, 255, 1);
  551. "
  552. @click="resetImport"
  553. >重置</span
  554. >
  555. <span class="downLoad" @click="downbulkImport">下载模板</span>
  556. </div>
  557. <!-- <div class="options">
  558. <el-button
  559. color="rgba(41, 109, 227, 1)"
  560. class="queding"
  561. type="primary"
  562. @click="bulkImportConfig"
  563. >
  564. 确定
  565. </el-button>
  566. <el-button @click="cancelBulkImport">取消</el-button>
  567. </div> -->
  568. </div>
  569. </el-dialog>
  570. <!-- 钥匙管理 -->
  571. <el-dialog
  572. class="keyDialog"
  573. v-model="keyVisible"
  574. :close-on-click-modal="false"
  575. :close-on-press-escape="false"
  576. :title="keyTitle"
  577. align-center
  578. width="1200"
  579. :before-close="cancelKey"
  580. >
  581. <div class="footers" v-loading="loading">
  582. <div class="title">
  583. <div class="keyTitle">
  584. <span class="txt">住客</span>
  585. </div>
  586. <el-collapse v-model="activeUser">
  587. <el-collapse-item name="1">
  588. <div class="table">
  589. <el-table
  590. :row-class-name="tableRowClassName"
  591. :data="userList"
  592. @selection-change="handleSelectionChange"
  593. style="width: 100%; height: 200px"
  594. :header-cell-style="{
  595. background: 'rgba(240, 243, 247, 1)',
  596. height: '50px',
  597. border: 0,
  598. }"
  599. >
  600. <el-table-column align="center" prop="name" label="姓名">
  601. </el-table-column>
  602. <el-table-column
  603. align="center"
  604. prop="phone"
  605. label="手机号"
  606. />
  607. <el-table-column
  608. align="center"
  609. prop="roomlength"
  610. label="类型"
  611. >
  612. <template #default="{ row }">
  613. <span v-if="row.lockStatus == 1">密码</span>
  614. <span v-if="row.lockStatus == 2">卡片</span>
  615. <span v-if="row.lockStatus == 3">指纹</span>
  616. <span v-if="row.lockStatus == 4">身份证</span>
  617. <span v-if="row.lockStatus == 5">钥匙</span>
  618. </template>
  619. </el-table-column>
  620. <el-table-column
  621. align="center"
  622. prop="roomlength"
  623. label="时效"
  624. >
  625. <template #default="{ row }">
  626. <span v-if="row.type == 1">管理员用户</span>
  627. <span v-if="row.type == 2">普通用户</span>
  628. <span v-if="row.type == 4">时效性用户</span>
  629. <span v-if="row.type == 5">一次性时效密码用户</span>
  630. <span v-if="row.type == 100">时效性无网络密码用户</span>
  631. </template>
  632. </el-table-column>
  633. <el-table-column
  634. align="center"
  635. prop="startTime"
  636. label="开始时间"
  637. width="120"
  638. >
  639. <template #default="{ row }">
  640. <span v-if="row.type == 4 || row.type == 100">{{
  641. row.startTime
  642. }}</span>
  643. </template>
  644. </el-table-column>
  645. <el-table-column
  646. align="center"
  647. prop="endTime"
  648. label="结束时间"
  649. width="120"
  650. >
  651. <template #default="{ row }">
  652. <span v-if="row.type == 4 || row.type == 100">{{
  653. row.endTime
  654. }}</span>
  655. </template>
  656. </el-table-column>
  657. <el-table-column
  658. align="center"
  659. prop="createTime"
  660. label="创建时间"
  661. width="120"
  662. >
  663. </el-table-column>
  664. <el-table-column align="center" label="操作" width="200">
  665. <template #default="scope">
  666. <div class="options">
  667. <div class="reset" @click="edit(scope.row)">修改</div>
  668. <el-popconfirm
  669. width="220"
  670. confirm-button-text="确认"
  671. cancel-button-text="取消"
  672. :icon="InfoFilled"
  673. icon-color="#f89626"
  674. title="是否删除此账号?"
  675. @confirm="del(scope.row)"
  676. @cancel="cancelEvent"
  677. >
  678. <template #reference>
  679. <div class="reset">删除</div>
  680. </template>
  681. </el-popconfirm>
  682. </div>
  683. </template>
  684. </el-table-column>
  685. </el-table>
  686. </div>
  687. </el-collapse-item>
  688. </el-collapse>
  689. </div>
  690. <div class="title titles">
  691. <div class="keyTitle">
  692. <span class="txt">员工</span>
  693. <div class="dropdown">
  694. <el-dropdown trigger="click" :hide-on-click="false">
  695. <el-button type="primary"> 添加电子钥匙 </el-button>
  696. <template #dropdown>
  697. <el-dropdown-menu>
  698. <el-dropdown-item @click="passManagementClick('系统')"
  699. >密码</el-dropdown-item
  700. >
  701. <el-dropdown-item @click="identityCardClick('系统','房卡')"
  702. >房卡</el-dropdown-item
  703. >
  704. <el-dropdown-item @click="fingerprintClick('系统')"
  705. >指纹</el-dropdown-item
  706. >
  707. <el-dropdown-item @click="identityCardClick('系统','身份证')"
  708. >身份证</el-dropdown-item
  709. >
  710. </el-dropdown-menu>
  711. </template>
  712. </el-dropdown>
  713. </div>
  714. </div>
  715. <el-collapse v-model="activeSystem">
  716. <el-collapse-item name="2">
  717. <div class="table">
  718. <el-table
  719. :row-class-name="tableRowClassName"
  720. :data="systemUserList"
  721. @selection-change="handleSelectionChange"
  722. style="width: 100%; height: 200px"
  723. :header-cell-style="{
  724. background: 'rgba(240, 243, 247, 1)',
  725. height: '50px',
  726. border: 0,
  727. }"
  728. >
  729. <el-table-column align="center" prop="name" label="姓名">
  730. </el-table-column>
  731. <el-table-column
  732. align="center"
  733. prop="phone"
  734. label="手机号"
  735. width="130"
  736. />
  737. <el-table-column
  738. align="center"
  739. prop="roomlength"
  740. label="类型"
  741. >
  742. <template #default="{ row }">
  743. <span v-if="row.lockStatus == 1">密码</span>
  744. <span v-if="row.lockStatus == 2">房卡</span>
  745. <span v-if="row.lockStatus == 3">指纹</span>
  746. <span v-if="row.lockStatus == 4">身份证</span>
  747. </template>
  748. </el-table-column>
  749. <el-table-column
  750. align="center"
  751. prop="passWord"
  752. label="密码"
  753. width="110"
  754. >
  755. </el-table-column>
  756. <el-table-column
  757. align="center"
  758. prop="roomlength"
  759. label="时效"
  760. width="200"
  761. >
  762. <template #default="{ row }">
  763. <div>{{ row.startTime }}</div>
  764. <div>{{ row.endTime }}</div>
  765. </template>
  766. </el-table-column>
  767. <el-table-column
  768. align="center"
  769. prop="roomlength"
  770. label="状态"
  771. >
  772. <template #default="{ row }">
  773. <span v-if="row.type == 1">管理员用户</span>
  774. <span v-if="row.type == 2">普通用户(永久)</span>
  775. <span v-if="row.type == 4">时效性用户</span>
  776. <span v-if="row.type == 5">一次性时效密码用户</span>
  777. <span v-if="row.type == 100">时效性无网络密码用户</span>
  778. </template>
  779. </el-table-column>
  780. <el-table-column
  781. align="center"
  782. prop="createTime"
  783. label="创建时间"
  784. width="200"
  785. >
  786. </el-table-column>
  787. <el-table-column align="center" label="操作" width="200">
  788. <template #default="scope">
  789. <div class="options">
  790. <!-- <div
  791. class="reset"
  792. @click="fingerprintEdit(scope.row)"
  793. >
  794. 修改
  795. </div> -->
  796. <el-popconfirm
  797. width="220"
  798. confirm-button-text="确认"
  799. cancel-button-text="取消"
  800. :icon="InfoFilled"
  801. icon-color="#f89626"
  802. title="是否删除此用户?"
  803. @confirm="fingerprintDel(scope.row)"
  804. @cancel="cancelEvent"
  805. >
  806. <template #reference>
  807. <div class="reset">删除</div>
  808. </template>
  809. </el-popconfirm>
  810. </div>
  811. </template>
  812. </el-table-column>
  813. </el-table>
  814. </div>
  815. </el-collapse-item>
  816. </el-collapse>
  817. </div>
  818. <div class="title titles">
  819. <div class="keyTitle">
  820. <span class="txt">自定义用户</span>
  821. <div class="dropdown">
  822. <el-dropdown trigger="click" :hide-on-click="false">
  823. <el-button type="primary">
  824. 添加电子钥匙
  825. <!-- <el-icon class="el-icon--right"><arrow-down /></el-icon> -->
  826. </el-button>
  827. <template #dropdown>
  828. <el-dropdown-menu>
  829. <el-dropdown-item @click="passManagementClick('自定义')"
  830. >密码</el-dropdown-item
  831. >
  832. <el-dropdown-item @click="identityCardClick('自定义','房卡')"
  833. >房卡</el-dropdown-item
  834. >
  835. <el-dropdown-item @click="fingerprintClick('自定义')"
  836. >指纹</el-dropdown-item
  837. >
  838. <el-dropdown-item @click="identityCardClick('自定义','身份证')"
  839. >身份证</el-dropdown-item
  840. >
  841. </el-dropdown-menu>
  842. </template>
  843. </el-dropdown>
  844. </div>
  845. </div>
  846. <el-collapse v-model="activeCustom">
  847. <el-collapse-item name="3">
  848. <div class="table">
  849. <el-table
  850. :row-class-name="tableRowClassName"
  851. :data="customList"
  852. @selection-change="handleSelectionChange"
  853. style="width: 100%; height: 200px"
  854. :header-cell-style="{
  855. background: 'rgba(240, 243, 247, 1)',
  856. height: '50px',
  857. border: 0,
  858. }"
  859. >
  860. <el-table-column align="center" prop="name" label="姓名">
  861. </el-table-column>
  862. <el-table-column
  863. align="center"
  864. prop="phone"
  865. label="手机号"
  866. width="130"
  867. />
  868. <el-table-column
  869. align="center"
  870. prop="roomlength"
  871. label="类型"
  872. >
  873. <template #default="{ row }">
  874. <span v-if="row.lockStatus == 1">密码</span>
  875. <span v-if="row.lockStatus == 2">房卡</span>
  876. <span v-if="row.lockStatus == 3">指纹</span>
  877. <span v-if="row.lockStatus == 4">身份证</span>
  878. </template>
  879. </el-table-column>
  880. <el-table-column
  881. align="center"
  882. prop="passWord"
  883. label="密码"
  884. width="110"
  885. >
  886. </el-table-column>
  887. <el-table-column
  888. align="center"
  889. prop="roomlength"
  890. label="时效"
  891. width="200"
  892. >
  893. <template #default="{ row }">
  894. <div>{{ row.startTime }}</div>
  895. <div>{{ row.endTime }}</div>
  896. </template>
  897. </el-table-column>
  898. <el-table-column
  899. align="center"
  900. prop="roomlength"
  901. label="状态"
  902. >
  903. <template #default="{ row }">
  904. <span v-if="row.type == 1">管理员用户</span>
  905. <span v-if="row.type == 2">普通用户(永久)</span>
  906. <span v-if="row.type == 4">时效性用户</span>
  907. <span v-if="row.type == 5">一次性时效密码用户</span>
  908. <span v-if="row.type == 100">时效性无网络密码用户</span>
  909. </template>
  910. </el-table-column>
  911. <el-table-column
  912. align="center"
  913. prop="createTime"
  914. label="创建时间"
  915. width="200"
  916. >
  917. </el-table-column>
  918. <el-table-column align="center" label="操作" width="200">
  919. <template #default="scope">
  920. <div class="options">
  921. <!-- <div class="reset" @click="edit(scope.row)">修改</div> -->
  922. <el-popconfirm
  923. width="220"
  924. confirm-button-text="确认"
  925. cancel-button-text="取消"
  926. :icon="InfoFilled"
  927. icon-color="#f89626"
  928. title="是否删除此用户?"
  929. @confirm="customDel(scope.row)"
  930. @cancel="cancelEvent"
  931. >
  932. <template #reference>
  933. <div class="reset">删除</div>
  934. </template>
  935. </el-popconfirm>
  936. </div>
  937. </template>
  938. </el-table-column>
  939. </el-table>
  940. </div>
  941. </el-collapse-item>
  942. </el-collapse>
  943. </div>
  944. </div>
  945. </el-dialog>
  946. <!-- 添加电子钥匙 密码管理 -->
  947. <el-dialog
  948. class="passManagementDialog"
  949. v-model="passManagementVisible"
  950. :close-on-click-modal="false"
  951. :close-on-press-escape="false"
  952. title="密码管理"
  953. align-center
  954. width="650"
  955. :before-close="cancelPassManagement"
  956. >
  957. <el-tabs
  958. v-model="passManagementIndex"
  959. class="demo-tabs"
  960. @tab-change="passManagementHandleClick"
  961. >
  962. <el-tab-pane label="时效密码" :name="1"> </el-tab-pane>
  963. <!-- <el-tab-pane label="无网络密码" :name="2"> </el-tab-pane>
  964. <el-tab-pane label="临时密码" :name="3"> </el-tab-pane> -->
  965. </el-tabs>
  966. <el-form
  967. ref="passManagementRef"
  968. :model="passManagementRuleForm"
  969. :rules="passManagementRules"
  970. label-width="100px"
  971. class="demo-ruleForm"
  972. :size="formSize"
  973. label-position="left"
  974. status-icon
  975. >
  976. <!-- <el-form-item
  977. label="角色 :"
  978. prop="level"
  979. v-if="keypassflag == '系统'"
  980. >
  981. <el-cascader
  982. @change="fingerprintChange"
  983. v-model="passManagementRuleForm.level"
  984. :options="fingerprintoptions"
  985. :props="fingerprintprops"
  986. :show-all-levels="false"
  987. :clearable="false"
  988. />
  989. </el-form-item> -->
  990. <el-form-item label="用户 :" prop="name">
  991. <el-select
  992. v-model="passManagementRuleForm.name"
  993. class="m-2"
  994. placeholder="请选择用户"
  995. style="width: 500px"
  996. @change="staffChange($event,'密码')"
  997. v-if="keypassflag == '系统'"
  998. >
  999. <el-option
  1000. v-for="i in staffList"
  1001. :label="`${i.userName} ( ${i.department} )`"
  1002. :value="i.id"
  1003. />
  1004. </el-select>
  1005. <el-input
  1006. v-model.trim="passManagementRuleForm.name"
  1007. placeholder="请输入用户"
  1008. style="width: 500px"
  1009. v-if="keypassflag == '自定义'"
  1010. >
  1011. </el-input>
  1012. </el-form-item>
  1013. <el-form-item
  1014. label="号码 :"
  1015. prop="phone"
  1016. v-if="keypassflag == '自定义'"
  1017. >
  1018. <el-input
  1019. v-model.trim="passManagementRuleForm.phone"
  1020. placeholder="请输入号码"
  1021. style="width: 500px"
  1022. >
  1023. </el-input>
  1024. </el-form-item>
  1025. <el-form-item label="密码 :" prop="pass">
  1026. <el-input
  1027. v-model.trim="passManagementRuleForm.pass"
  1028. placeholder="请输入6-8位数密码或者点击随机生成"
  1029. style="width: 500px"
  1030. >
  1031. <template #append>
  1032. <div @click="randomCipher">随机生成</div>
  1033. </template>
  1034. </el-input>
  1035. </el-form-item>
  1036. <el-form-item label="生效时间 :" prop="effectiveTime">
  1037. <div class="block">
  1038. <el-date-picker
  1039. v-model="passManagementRuleForm.effectiveTime"
  1040. type="datetime"
  1041. placeholder="选择生效时间"
  1042. style="width: 500px"
  1043. format="YYYY-MM-DD HH:mm:ss"
  1044. value-format="YYYY-MM-DD HH:mm:ss"
  1045. />
  1046. </div>
  1047. </el-form-item>
  1048. <el-form-item label="失效时间 :" prop="failureTime">
  1049. <div class="block">
  1050. <el-date-picker
  1051. v-model="passManagementRuleForm.failureTime"
  1052. type="datetime"
  1053. placeholder="选择失效时间"
  1054. style="width: 500px"
  1055. format="YYYY-MM-DD HH:mm:ss"
  1056. value-format="YYYY-MM-DD HH:mm:ss"
  1057. />
  1058. </div>
  1059. </el-form-item>
  1060. <el-form-item class="options">
  1061. <el-button
  1062. color="rgba(41, 109, 227, 1)"
  1063. class="queding"
  1064. type="primary"
  1065. @click="passManagementSend(passManagementRef)"
  1066. >
  1067. 确定
  1068. </el-button>
  1069. <el-button @click="cancelPassManagement(passManagementRef)"
  1070. >取消</el-button
  1071. >
  1072. </el-form-item>
  1073. </el-form>
  1074. </el-dialog>
  1075. <!-- 添加电子钥匙 添加指纹 -->
  1076. <el-dialog
  1077. class="fingerprintDialog"
  1078. v-model="fingerprintVisible"
  1079. :close-on-click-modal="false"
  1080. :close-on-press-escape="false"
  1081. title="添加指纹"
  1082. align-center
  1083. width="550"
  1084. :before-close="cancelFingerprint"
  1085. >
  1086. <el-form
  1087. ref="fingerprintRef"
  1088. :model="fingerprintRuleForm"
  1089. :rules="fingerprintRules"
  1090. label-width="100px"
  1091. class="demo-ruleForm"
  1092. :size="formSize"
  1093. label-position="left"
  1094. status-icon
  1095. >
  1096. <!-- <el-form-item
  1097. label="角色 :"
  1098. prop="level"
  1099. v-if="keypassflag == '系统'"
  1100. >
  1101. <el-cascader
  1102. @change="fingerprintChange"
  1103. v-model="fingerprintRuleForm.level"
  1104. :options="fingerprintoptions"
  1105. :props="fingerprintprops"
  1106. :show-all-levels="false"
  1107. :clearable="false"
  1108. />
  1109. </el-form-item> -->
  1110. <el-form-item label="用户 :" prop="name">
  1111. <el-select
  1112. v-model="fingerprintRuleForm.name"
  1113. class="m-2"
  1114. placeholder="请选择用户"
  1115. style="width: 214px"
  1116. @change="staffChange($event,'指纹')"
  1117. v-if="keypassflag == '系统'"
  1118. >
  1119. <el-option
  1120. v-for="i in staffList"
  1121. :label="`${i.userName} ( ${i.department} )`"
  1122. :value="i.id"
  1123. />
  1124. </el-select>
  1125. <el-input
  1126. v-model.trim="fingerprintRuleForm.name"
  1127. placeholder="请输入用户"
  1128. style="width: 214px"
  1129. v-if="keypassflag == '自定义'"
  1130. />
  1131. </el-form-item>
  1132. <el-form-item
  1133. label="号码 :"
  1134. prop="phone"
  1135. v-if="keypassflag == '自定义'"
  1136. >
  1137. <el-input
  1138. v-model.trim="fingerprintRuleForm.phone"
  1139. placeholder="请输入号码"
  1140. style="width: 214px"
  1141. >
  1142. </el-input>
  1143. </el-form-item>
  1144. <el-form-item label="指纹 :" prop="fingerprintNum">
  1145. <el-input
  1146. v-model="fingerprintRuleForm.fingerprintNum"
  1147. placeholder="请录入指纹"
  1148. style="width: 300px"
  1149. type="textarea"
  1150. rows="4"
  1151. />
  1152. <span
  1153. style="
  1154. color: rgba(0, 97, 255, 1);
  1155. margin-left: 10px;
  1156. cursor: pointer;
  1157. "
  1158. @click="fingerprintNext"
  1159. >录入</span
  1160. >
  1161. </el-form-item>
  1162. <el-form-item label="生效时间 :" prop="effectiveTime">
  1163. <div class="block">
  1164. <el-date-picker
  1165. v-model="fingerprintRuleForm.effectiveTime"
  1166. type="datetime"
  1167. placeholder="选择生效时间"
  1168. style="width: 214px"
  1169. format="YYYY-MM-DD HH:mm:ss"
  1170. value-format="YYYY-MM-DD HH:mm:ss"
  1171. />
  1172. </div>
  1173. </el-form-item>
  1174. <el-form-item label="失效时间 :" prop="failureTime">
  1175. <div class="block">
  1176. <el-date-picker
  1177. v-model="fingerprintRuleForm.failureTime"
  1178. type="datetime"
  1179. placeholder="选择失效时间"
  1180. style="width: 214px"
  1181. format="YYYY-MM-DD HH:mm:ss"
  1182. value-format="YYYY-MM-DD HH:mm:ss"
  1183. />
  1184. </div>
  1185. </el-form-item>
  1186. <el-form-item class="options">
  1187. <el-button
  1188. color="rgba(41, 109, 227, 1)"
  1189. class="queding"
  1190. type="primary"
  1191. @click="fingerprintconfig(fingerprintRef)"
  1192. >
  1193. 确定
  1194. </el-button>
  1195. </el-form-item>
  1196. </el-form>
  1197. </el-dialog>
  1198. <!-- 指纹读取弹窗 -->
  1199. <el-dialog
  1200. class="fingerprint"
  1201. v-model="addFingerprintVisible"
  1202. :close-on-click-modal="false"
  1203. :close-on-press-escape="false"
  1204. title="添加指纹"
  1205. align-center
  1206. width="550"
  1207. :before-close="cancelAddFingerprint"
  1208. >
  1209. <div class="el-footer">
  1210. <div style="height: 350px; margin: 30px auto">
  1211. <el-steps direction="vertical" :active="stepindex">
  1212. <el-step
  1213. v-for="i in step.list"
  1214. :key="i.id"
  1215. :title="`步骤 ${i.id}`"
  1216. :description="i.title"
  1217. ></el-step>
  1218. </el-steps>
  1219. </div>
  1220. </div>
  1221. </el-dialog>
  1222. <!-- 添加电子钥匙 添加身份证 -->
  1223. <el-dialog
  1224. class="identityCard"
  1225. v-model="identityCardVisible"
  1226. :close-on-click-modal="false"
  1227. :close-on-press-escape="false"
  1228. title="添加身份证"
  1229. align-center
  1230. width="550"
  1231. :before-close="cancelIdentityCard"
  1232. >
  1233. <el-form
  1234. ref="identityCardRef"
  1235. :model="identityCardRuleForm"
  1236. :rules="identityCardRules"
  1237. label-width="100px"
  1238. class="demo-ruleForm"
  1239. :size="formSize"
  1240. label-position="left"
  1241. status-icon
  1242. >
  1243. <!-- <el-form-item
  1244. label="角色 :"
  1245. prop="level"
  1246. v-if="keypassflag == '系统'"
  1247. >
  1248. <el-cascader
  1249. @change="fingerprintChange"
  1250. v-model="identityCardRuleForm.level"
  1251. :options="fingerprintoptions"
  1252. :props="fingerprintprops"
  1253. :show-all-levels="false"
  1254. :clearable="false"
  1255. />
  1256. </el-form-item> -->
  1257. <el-form-item label="用户 :" prop="name">
  1258. <el-select
  1259. v-model="identityCardRuleForm.name"
  1260. class="m-2"
  1261. placeholder="再请选择用户"
  1262. style="width: 214px"
  1263. @change="staffChange($event,'房卡')"
  1264. v-if="keypassflag == '系统'"
  1265. >
  1266. <el-option
  1267. v-for="i in staffList"
  1268. :label="`${i.userName} ( ${i.department} )`"
  1269. :value="i.id"
  1270. />
  1271. </el-select>
  1272. <el-input
  1273. v-model.trim="identityCardRuleForm.name"
  1274. placeholder="请输入用户"
  1275. style="width: 214px"
  1276. v-if="keypassflag == '自定义'"
  1277. />
  1278. </el-form-item>
  1279. <el-form-item
  1280. label="号码 :"
  1281. prop="phone"
  1282. v-if="keypassflag == '自定义'"
  1283. >
  1284. <el-input
  1285. v-model.trim="identityCardRuleForm.phone"
  1286. placeholder="请输入号码"
  1287. style="width: 214px"
  1288. />
  1289. </el-form-item>
  1290. <!-- <el-form-item label="类型 :" prop="cardType">
  1291. <el-radio-group v-model="identityCardRuleForm.cardType">
  1292. <el-radio :value="1">密码</el-radio>
  1293. <el-radio :value="2">房卡</el-radio>
  1294. <el-radio :value="3">指纹</el-radio>
  1295. <el-radio :value="4">身份证</el-radio>
  1296. <el-radio :value="5">钥匙</el-radio>
  1297. </el-radio-group>
  1298. </el-form-item> -->
  1299. <el-form-item label="卡号 :" prop="icCard">
  1300. <el-input
  1301. v-model.trim="identityCardRuleForm.icCard"
  1302. placeholder="请输入卡号"
  1303. style="width: 300px"
  1304. type="textarea"
  1305. rows="4"
  1306. >
  1307. </el-input>
  1308. <span
  1309. style="
  1310. color: rgba(0, 97, 255, 1);
  1311. margin-left: 10px;
  1312. cursor: pointer;
  1313. "
  1314. @click="identityCardNext"
  1315. >读卡</span
  1316. >
  1317. </el-form-item>
  1318. <el-form-item label="生效时间 :" prop="effectiveTime">
  1319. <div class="block">
  1320. <el-date-picker
  1321. v-model="identityCardRuleForm.effectiveTime"
  1322. type="datetime"
  1323. placeholder="选择生效时间"
  1324. style="width: 200px"
  1325. format="YYYY-MM-DD HH:mm:ss"
  1326. value-format="YYYY-MM-DD HH:mm:ss"
  1327. />
  1328. </div>
  1329. </el-form-item>
  1330. <el-form-item label="失效时间 :" prop="failureTime">
  1331. <div class="block">
  1332. <el-date-picker
  1333. v-model="identityCardRuleForm.failureTime"
  1334. type="datetime"
  1335. placeholder="选择失效时间"
  1336. style="width: 200px"
  1337. format="YYYY-MM-DD HH:mm:ss"
  1338. value-format="YYYY-MM-DD HH:mm:ss"
  1339. />
  1340. </div>
  1341. </el-form-item>
  1342. <el-form-item class="options">
  1343. <el-button
  1344. color="rgba(41, 109, 227, 1)"
  1345. class="queding"
  1346. type="primary"
  1347. @click="identityCardConfig(identityCardRef)"
  1348. >
  1349. 确定
  1350. </el-button>
  1351. </el-form-item>
  1352. </el-form>
  1353. </el-dialog>
  1354. <!-- 身份证读卡弹窗 -->
  1355. <el-dialog
  1356. class="addIdentityCard"
  1357. v-model="addIdentityCardVisible"
  1358. :close-on-click-modal="false"
  1359. :close-on-press-escape="false"
  1360. title="添加身份证"
  1361. align-center
  1362. width="650"
  1363. :before-close="cancelAddIdentityCard"
  1364. >
  1365. <!-- <div class="el-footer">
  1366. {{ identityCardTitle }}
  1367. </div>
  1368. <div class="el-footer">卡号 :{{ identityCardNum }}</div> -->
  1369. <div class="steps">
  1370. <el-steps
  1371. :space="200"
  1372. :active="identityCardIndex"
  1373. finish-status="success"
  1374. >
  1375. <el-step title="环境准备" />
  1376. <el-step title="配置" />
  1377. <el-step title="完成" />
  1378. </el-steps>
  1379. </div>
  1380. <div
  1381. class="title"
  1382. v-if="identityCardIndex == 0 || identityCardIndex == 1"
  1383. style="color: #fc2307"
  1384. >
  1385. {{ identityCardTitle }}
  1386. </div>
  1387. <div class="title" v-else style="color: #68c23c">
  1388. {{ identityCardTitle }}
  1389. </div>
  1390. <div class="icons">
  1391. <img
  1392. v-if="identityCardIndex == 0 || identityCardIndex == 1"
  1393. src="@/assets/icons/error.png"
  1394. alt=""
  1395. />
  1396. <img
  1397. v-if="identityCardIndex == 2"
  1398. class="loading"
  1399. src="@/assets/icons/loading.png"
  1400. alt=""
  1401. />
  1402. <img
  1403. v-if="identityCardIndex == 3"
  1404. src="@/assets/icons/success.png"
  1405. alt=""
  1406. />
  1407. </div>
  1408. <div class="retry">可以尝试<span @click="retry">重试</span></div>
  1409. </el-dialog>
  1410. </div>
  1411. </div>
  1412. </template>
  1413. <script setup>
  1414. import {
  1415. ref,
  1416. reactive,
  1417. nextTick,
  1418. watch,
  1419. onBeforeMount,
  1420. onUnmounted,
  1421. } from "vue";
  1422. import { useRouter } from "vue-router";
  1423. import { ElMessage, ElMessageBox,genFileId } from "element-plus";
  1424. import { Calendar } from "@element-plus/icons-vue";
  1425. import vidiconsApi from "@/api/vidicons.js";
  1426. import { dayjs } from "element-plus";
  1427. import lodash from "lodash";
  1428. import axios from "axios";
  1429. import { useStore } from "vuex";
  1430. const store = useStore();
  1431. const api = ref("");
  1432. const router = useRouter();
  1433. const flagBtn = ref(); // 按钮权限
  1434. const nowDay = ref(dayjs().format("YYYY-MM-DD HH:mm:ss"));
  1435. // 表格数据
  1436. const loading = ref(false);
  1437. const tableData = reactive({
  1438. list: [
  1439. { roomlength: "/ 共3间" },
  1440. { roomlength: "/ 共3间" },
  1441. { roomlength: "/ 共3间" },
  1442. { roomlength: "/ 共3间" },
  1443. { roomlength: "/ 共3间" },
  1444. { roomlength: "/ 共3间" },
  1445. { roomlength: "/ 共3间" },
  1446. { roomlength: "/ 共3间" },
  1447. { roomlength: "/ 共3间" },
  1448. ],
  1449. });
  1450. const searchInput = reactive({
  1451. keyWord: "",
  1452. buildingId:"",
  1453. houseType:''
  1454. }); // 搜索按钮数据
  1455. const buildData = ref(); // 楼栋数据
  1456. const roomTypes = ref(); // 房间类型数据
  1457. const roomTypeIndex = ref("全部"); // 选中的房间类型
  1458. const roomList = reactive({
  1459. list: [
  1460. {
  1461. title: "18#1单元-2层",
  1462. roomlength: "/ 共3间",
  1463. children: [
  1464. {
  1465. roomNum: "201",
  1466. shebei: "L6-VVIFI-QINGKE",
  1467. wangluo: "WIFI",
  1468. wifiMAC: "80A036AE239D",
  1469. lanyaMAC: "F3F401122AF2",
  1470. time: "2022年11月24日10:27:04",
  1471. dianliang: "75%",
  1472. statu: "在线",
  1473. shebeiStatu: "启用",
  1474. lastLock: "2023年11月02日 15:45:34",
  1475. visible: false,
  1476. },
  1477. {
  1478. roomNum: "202",
  1479. shebei: "L6-VVIFI-QINGKE",
  1480. wangluo: "WIFI",
  1481. wifiMAC: "80A036AE239D",
  1482. lanyaMAC: "F3F401122AF2",
  1483. time: "2022年11月24日10:27:04",
  1484. dianliang: "75%",
  1485. statu: "在线",
  1486. shebeiStatu: "启用",
  1487. lastLock: "2023年11月02日 15:45:34",
  1488. visible: false,
  1489. },
  1490. {
  1491. roomNum: "203",
  1492. shebei: "L6-VVIFI-QINGKE",
  1493. wangluo: "WIFI",
  1494. wifiMAC: "80A036AE239D",
  1495. lanyaMAC: "F3F401122AF2",
  1496. time: "2022年11月24日10:27:04",
  1497. dianliang: "75%",
  1498. statu: "在线",
  1499. shebeiStatu: "启用",
  1500. lastLock: "2023年11月02日 15:45:34",
  1501. visible: false,
  1502. },
  1503. ],
  1504. },
  1505. {
  1506. title: "18#1单元-3层",
  1507. roomlength: "/ 共3间",
  1508. children: [
  1509. {
  1510. roomNum: "201",
  1511. shebei: "L6-VVIFI-QINGKE",
  1512. wangluo: "WIFI",
  1513. wifiMAC: "80A036AE239D",
  1514. lanyaMAC: "F3F401122AF2",
  1515. time: "2022年11月24日10:27:04",
  1516. dianliang: "75%",
  1517. statu: "在线",
  1518. shebeiStatu: "启用",
  1519. lastLock: "2023年11月02日 15:45:34",
  1520. visible: false,
  1521. },
  1522. {
  1523. roomNum: "202",
  1524. shebei: "L6-VVIFI-QINGKE",
  1525. wangluo: "WIFI",
  1526. wifiMAC: "80A036AE239D",
  1527. lanyaMAC: "F3F401122AF2",
  1528. time: "2022年11月24日10:27:04",
  1529. dianliang: "75%",
  1530. statu: "在线",
  1531. shebeiStatu: "启用",
  1532. lastLock: "2023年11月02日 15:45:34",
  1533. visible: false,
  1534. },
  1535. {
  1536. roomNum: "203",
  1537. shebei: "L6-VVIFI-QINGKE",
  1538. wangluo: "WIFI",
  1539. wifiMAC: "80A036AE239D",
  1540. lanyaMAC: "F3F401122AF2",
  1541. time: "2022年11月24日10:27:04",
  1542. dianliang: "75%",
  1543. statu: "在线",
  1544. shebeiStatu: "启用",
  1545. lastLock: "2023年11月02日 15:45:34",
  1546. visible: false,
  1547. },
  1548. {
  1549. roomNum: "204",
  1550. shebei: "L6-VVIFI-QINGKE",
  1551. wangluo: "WIFI",
  1552. wifiMAC: "80A036AE239D",
  1553. lanyaMAC: "F3F401122AF2",
  1554. time: "2022年11月24日10:27:04",
  1555. dianliang: "75%",
  1556. statu: "在线",
  1557. shebeiStatu: "启用",
  1558. lastLock: "2023年11月02日 15:45:34",
  1559. visible: false,
  1560. },
  1561. {
  1562. roomNum: "205",
  1563. shebei: "L6-VVIFI-QINGKE",
  1564. wangluo: "WIFI",
  1565. wifiMAC: "80A036AE239D",
  1566. lanyaMAC: "F3F401122AF2",
  1567. time: "2022年11月24日10:27:04",
  1568. dianliang: "75%",
  1569. statu: "在线",
  1570. shebeiStatu: "启用",
  1571. lastLock: "2023年11月02日 15:45:34",
  1572. visible: false,
  1573. },
  1574. {
  1575. roomNum: "206",
  1576. shebei: "L6-VVIFI-QINGKE",
  1577. wangluo: "WIFI",
  1578. wifiMAC: "80A036AE239D",
  1579. lanyaMAC: "F3F401122AF2",
  1580. time: "2022年11月24日10:27:04",
  1581. dianliang: "75%",
  1582. statu: "在线",
  1583. shebeiStatu: "启用",
  1584. lastLock: "2023年11月02日 15:45:34",
  1585. visible: false,
  1586. },
  1587. {
  1588. roomNum: "207",
  1589. shebei: "L6-VVIFI-QINGKE",
  1590. wangluo: "WIFI",
  1591. wifiMAC: "80A036AE239D",
  1592. lanyaMAC: "F3F401122AF2",
  1593. time: "2022年11月24日10:27:04",
  1594. dianliang: "75%",
  1595. statu: "在线",
  1596. shebeiStatu: "启用",
  1597. lastLock: "2023年11月02日 15:45:34",
  1598. visible: false,
  1599. },
  1600. {
  1601. roomNum: "208",
  1602. shebei: "L6-VVIFI-QINGKE",
  1603. wangluo: "WIFI",
  1604. wifiMAC: "80A036AE239D",
  1605. lanyaMAC: "F3F401122AF2",
  1606. time: "2022年11月24日10:27:04",
  1607. dianliang: "75%",
  1608. statu: "在线",
  1609. shebeiStatu: "启用",
  1610. lastLock: "2023年11月02日 15:45:34",
  1611. visible: false,
  1612. },
  1613. {
  1614. roomNum: "209",
  1615. shebei: "L6-VVIFI-QINGKE",
  1616. wangluo: "WIFI",
  1617. wifiMAC: "80A036AE239D",
  1618. lanyaMAC: "F3F401122AF2",
  1619. time: "2022年11月24日10:27:04",
  1620. dianliang: "75%",
  1621. statu: "在线",
  1622. shebeiStatu: "启用",
  1623. lastLock: "2023年11月02日 15:45:34",
  1624. visible: false,
  1625. },
  1626. ],
  1627. },
  1628. {
  1629. title: "18#1单元-4层",
  1630. roomlength: "/ 共3间",
  1631. children: [
  1632. {
  1633. roomNum: "201",
  1634. shebei: "L6-VVIFI-QINGKE",
  1635. wangluo: "WIFI",
  1636. wifiMAC: "80A036AE239D",
  1637. lanyaMAC: "F3F401122AF2",
  1638. time: "2022年11月24日10:27:04",
  1639. dianliang: "75%",
  1640. statu: "在线",
  1641. shebeiStatu: "启用",
  1642. lastLock: "2023年11月02日 15:45:34",
  1643. visible: false,
  1644. },
  1645. {
  1646. roomNum: "202",
  1647. shebei: "L6-VVIFI-QINGKE",
  1648. wangluo: "WIFI",
  1649. wifiMAC: "80A036AE239D",
  1650. lanyaMAC: "F3F401122AF2",
  1651. time: "2022年11月24日10:27:04",
  1652. dianliang: "75%",
  1653. statu: "在线",
  1654. shebeiStatu: "启用",
  1655. lastLock: "2023年11月02日 15:45:34",
  1656. visible: false,
  1657. },
  1658. {
  1659. roomNum: "203",
  1660. shebei: "L6-VVIFI-QINGKE",
  1661. wangluo: "WIFI",
  1662. wifiMAC: "80A036AE239D",
  1663. lanyaMAC: "F3F401122AF2",
  1664. time: "2022年11月24日10:27:04",
  1665. dianliang: "75%",
  1666. statu: "在线",
  1667. shebeiStatu: "启用",
  1668. lastLock: "2023年11月02日 15:45:34",
  1669. visible: false,
  1670. },
  1671. {
  1672. roomNum: "204",
  1673. shebei: "L6-VVIFI-QINGKE",
  1674. wangluo: "WIFI",
  1675. wifiMAC: "80A036AE239D",
  1676. lanyaMAC: "F3F401122AF2",
  1677. time: "2022年11月24日10:27:04",
  1678. dianliang: "75%",
  1679. statu: "在线",
  1680. shebeiStatu: "启用",
  1681. lastLock: "2023年11月02日 15:45:34",
  1682. visible: false,
  1683. },
  1684. {
  1685. roomNum: "205",
  1686. shebei: "L6-VVIFI-QINGKE",
  1687. wangluo: "WIFI",
  1688. wifiMAC: "80A036AE239D",
  1689. lanyaMAC: "F3F401122AF2",
  1690. time: "2022年11月24日10:27:04",
  1691. dianliang: "75%",
  1692. statu: "在线",
  1693. shebeiStatu: "启用",
  1694. lastLock: "2023年11月02日 15:45:34",
  1695. visible: false,
  1696. },
  1697. {
  1698. roomNum: "206",
  1699. shebei: "L6-VVIFI-QINGKE",
  1700. wangluo: "WIFI",
  1701. wifiMAC: "80A036AE239D",
  1702. lanyaMAC: "F3F401122AF2",
  1703. time: "2022年11月24日10:27:04",
  1704. dianliang: "75%",
  1705. statu: "在线",
  1706. shebeiStatu: "启用",
  1707. lastLock: "2023年11月02日 15:45:34",
  1708. visible: false,
  1709. },
  1710. {
  1711. roomNum: "207",
  1712. shebei: "L6-VVIFI-QINGKE",
  1713. wangluo: "WIFI",
  1714. wifiMAC: "80A036AE239D",
  1715. lanyaMAC: "F3F401122AF2",
  1716. time: "2022年11月24日10:27:04",
  1717. dianliang: "75%",
  1718. statu: "在线",
  1719. shebeiStatu: "启用",
  1720. lastLock: "2023年11月02日 15:45:34",
  1721. visible: false,
  1722. },
  1723. {
  1724. roomNum: "208",
  1725. shebei: "L6-VVIFI-QINGKE",
  1726. wangluo: "WIFI",
  1727. wifiMAC: "80A036AE239D",
  1728. lanyaMAC: "F3F401122AF2",
  1729. time: "2022年11月24日10:27:04",
  1730. dianliang: "75%",
  1731. statu: "在线",
  1732. shebeiStatu: "启用",
  1733. lastLock: "2023年11月02日 15:45:34",
  1734. visible: false,
  1735. },
  1736. {
  1737. roomNum: "209",
  1738. shebei: "L6-VVIFI-QINGKE",
  1739. wangluo: "WIFI",
  1740. wifiMAC: "80A036AE239D",
  1741. lanyaMAC: "F3F401122AF2",
  1742. time: "2022年11月24日10:27:04",
  1743. dianliang: "75%",
  1744. statu: "在线",
  1745. shebeiStatu: "启用",
  1746. lastLock: "2023年11月02日 15:45:34",
  1747. visible: false,
  1748. },
  1749. ],
  1750. },
  1751. ],
  1752. });
  1753. const electricQuantity = ref(); // 每个房间的电量
  1754. const nfcFunction = ref(); // nfc标识
  1755. const houseLockId=ref();// 门锁表id
  1756. // 设置临时总卡 (头部按钮--------------------------------------------------------)
  1757. const temporaryCardVisible = ref(false);
  1758. const temporaryCardRef = ref();
  1759. const temporaryCardRuleForm = reactive({
  1760. level: 1,
  1761. name: "",
  1762. effectiveTime: "",
  1763. failureTime: "",
  1764. serialNumber: "",
  1765. id: "",
  1766. });
  1767. var checkFullName = (rule, value, callback) => {
  1768. if (!value) {
  1769. return callback(new Error("请输入姓名"));
  1770. }
  1771. var reg = /^[\u4e00-\u9fa5]{2,6}$/;
  1772. if (!reg.test(value)) {
  1773. callback(new Error("必须为2-6个汉字!"));
  1774. } else {
  1775. callback();
  1776. }
  1777. };
  1778. // 表单验证
  1779. const temporaryCardRules = reactive({
  1780. name: [
  1781. { required: true, message: "姓名不能为空", trigger: "blur" },
  1782. { validator: checkFullName, trigger: "blur" },
  1783. ],
  1784. level: [
  1785. {
  1786. required: true,
  1787. message: "角色不能为空",
  1788. trigger: "blur",
  1789. },
  1790. ],
  1791. effectiveTime: [
  1792. {
  1793. required: true,
  1794. message: "生效时间不能为空",
  1795. trigger: "blur",
  1796. },
  1797. ],
  1798. failureTime: [
  1799. {
  1800. required: true,
  1801. message: "失效时间不能为空",
  1802. trigger: "blur",
  1803. },
  1804. ],
  1805. serialNumber: [
  1806. {
  1807. required: true,
  1808. message: "至少选择一间房",
  1809. trigger: "blur",
  1810. },
  1811. ],
  1812. });
  1813. // 消息列表弹窗(----------------------------------------------------)
  1814. const newsVisible = ref(false);
  1815. const newsIndex = ref(1);
  1816. const newshouseNumberId = ref();
  1817. const newsPage = ref(1); // 当前页
  1818. const newsSize = ref(10);
  1819. const newsTotal = ref(20); // 当前总数
  1820. const newTableList = ref();
  1821. // 远程开锁(--------------------------------------------------------)
  1822. const unlockingVisible = ref(false);
  1823. const unlockList = reactive({ luid: "", roomNumber: "", houseNumberId: "" });
  1824. // 绑定设备 (--------------------------------------------------------)
  1825. const bindingVisible = ref(false);
  1826. const bindingRef = ref();
  1827. const bindingList = reactive({ houseNumberId: "", luid: "" });
  1828. // 表单验证
  1829. const bindingrules = reactive({
  1830. luid: [{ required: true, message: "设备id不能为空", trigger: "blur" }],
  1831. });
  1832. // 解绑设备 (--------------------------------------------------------)
  1833. const deblockingVisible = ref(false);
  1834. const dellockList = reactive({ houseNumberId: "" });
  1835. // 批量导入 (--------------------------------------------------------)
  1836. const bulkImportVisible = ref(false);
  1837. const uploadFileShow=ref(false)
  1838. const bulkImportref=ref()
  1839. const bulkImportFile=ref()
  1840. // 重置管理员密码 (--------------------------------------------------------)
  1841. const resetPassVisible = ref(false);
  1842. const resetPassRef = ref();
  1843. const resetPassRuleForm = reactive({
  1844. password: "",
  1845. againPass: "",
  1846. id: "",
  1847. });
  1848. // 表单验证
  1849. const resetPassRules = reactive({
  1850. password: [
  1851. {
  1852. required: true,
  1853. message: "密码不能为空",
  1854. trigger: "blur",
  1855. },
  1856. {
  1857. min: 8,
  1858. max: 20,
  1859. pattern:
  1860. /^(?=.*[0-9])(?=.*[A-Z])(?=.*[a-z])(?=.*[!@#$%^&*,\._\+(){}])[0-9a-zA-Z!@#$%^&*,\\._\+(){}]{8,20}$/,
  1861. message: "请输入8-20位正确密码(大小写字母·字符·数字)",
  1862. trigger: "blur",
  1863. },
  1864. ],
  1865. againPass: [
  1866. {
  1867. required: true,
  1868. message: "确认密码不能为空",
  1869. trigger: "blur",
  1870. },
  1871. {
  1872. min: 8,
  1873. max: 20,
  1874. pattern:
  1875. /^(?=.*[0-9])(?=.*[A-Z])(?=.*[a-z])(?=.*[!@#$%^&*,\._\+(){}])[0-9a-zA-Z!@#$%^&*,\\._\+(){}]{8,20}$/,
  1876. message: "请输入8-20位正确密码(大小写字母·字符·数字)",
  1877. trigger: "blur",
  1878. },
  1879. ],
  1880. // desc: [{ required: true, message: "Please input activity form", trigger: "blur" }],
  1881. });
  1882. // 钥匙管理 (--------------------------------------------------------)
  1883. const keyVisible = ref(false);
  1884. const keyData = reactive({
  1885. houseNumberId: "",
  1886. equipmentType: "",
  1887. });
  1888. const activeUser=ref('1')
  1889. const activeSystem=ref('2')
  1890. const activeCustom=ref('3')
  1891. const keyTitle = ref();
  1892. const userList = ref(); // 用户
  1893. const systemUserList = ref(); // 系统用户
  1894. const customList = ref(); // 自定义用户
  1895. const keypassflag = ref(''); // 添加系统或者自定义用户
  1896. const cardFlag = ref(''); // 判断是添加房卡还是身份证
  1897. // 钥匙管理 密码管理(--------------------------------------------------------)
  1898. const passManagementVisible = ref(false);
  1899. const passManagementIndex = ref(1); // 默认选中 时效密码
  1900. const passManagementRef = ref();
  1901. const passManagementRuleForm = reactive({
  1902. // level: '',
  1903. name: "",
  1904. phone: "",
  1905. effectiveTime: "",
  1906. failureTime: "",
  1907. pass: "",
  1908. id: "",
  1909. });
  1910. // 表单验证
  1911. const passManagementRules = reactive({
  1912. name: [
  1913. { required: true, message: "姓名不能为空", trigger: "blur" },
  1914. ],
  1915. phone: [{ required: true, message: "号码不能为空", trigger: "blur" }],
  1916. level: [
  1917. {
  1918. required: true,
  1919. message: "角色不能为空",
  1920. trigger: "blur",
  1921. },
  1922. ],
  1923. effectiveTime: [
  1924. {
  1925. required: true,
  1926. message: "生效时间不能为空",
  1927. trigger: "blur",
  1928. },
  1929. ],
  1930. failureTime: [
  1931. {
  1932. required: true,
  1933. message: "失效时间不能为空",
  1934. trigger: "blur",
  1935. },
  1936. ],
  1937. pass: [
  1938. {
  1939. required: true,
  1940. message: "密码不能为空",
  1941. trigger: "blur",
  1942. },
  1943. ],
  1944. });
  1945. const staffList=ref();// 选择的员工数据
  1946. // 钥匙管理 添加指纹(--------------------------------------------------------)
  1947. const fingerprintVisible = ref(false);
  1948. const fingerprintRef = ref();
  1949. const fingerprintprops = {
  1950. checkStrictly: true,
  1951. label: "name",
  1952. value: "id",
  1953. };
  1954. const fingerprintoptions = ref();
  1955. // const fingerprintChangeList = ref();
  1956. const fingerprintRuleForm = reactive({
  1957. level: "",
  1958. name: "",
  1959. phone: "",
  1960. fingerprintNum: "",
  1961. effectiveTime: "",
  1962. failureTime: "",
  1963. id: "",
  1964. });
  1965. var fingerprintName = (rule, value, callback) => {
  1966. if (!value) {
  1967. return callback(new Error("请输入姓名"));
  1968. }
  1969. var reg = /^[\u4e00-\u9fa5]{2,6}$/;
  1970. if (!reg.test(value)) {
  1971. callback(new Error("必须为2-6个汉字!"));
  1972. } else {
  1973. callback();
  1974. }
  1975. };
  1976. // 表单验证
  1977. const fingerprintRules = reactive({
  1978. name: [{ required: true, message: "姓名不能为空", trigger: "blur" }],
  1979. phone: [{ required: true, message: "号码不能为空", trigger: "blur" }],
  1980. level: [
  1981. {
  1982. required: true,
  1983. message: "角色不能为空",
  1984. trigger: "blur",
  1985. },
  1986. ],
  1987. fingerprintNum: [
  1988. {
  1989. required: true,
  1990. message: "指纹不能为空",
  1991. trigger: "blur",
  1992. },
  1993. ],
  1994. effectiveTime: [
  1995. {
  1996. required: true,
  1997. message: "生效时间不能为空",
  1998. trigger: "blur",
  1999. },
  2000. ],
  2001. failureTime: [
  2002. {
  2003. required: true,
  2004. message: "失效时间不能为空",
  2005. trigger: "blur",
  2006. },
  2007. ],
  2008. });
  2009. // 添加指纹弹窗
  2010. const addFingerprintVisible = ref(false);
  2011. const stepindex = ref(0); // 录取指纹步骤
  2012. const step = reactive({
  2013. list: [
  2014. { id: 1, title: "" },
  2015. { id: 2, title: "" },
  2016. { id: 3, title: "" },
  2017. { id: 4, title: "" },
  2018. ],
  2019. }); // 指纹步骤数据
  2020. const ws = ref("");
  2021. // 钥匙管理 添加身份证(--------------------------------------------------------)
  2022. const identityCardVisible = ref(false);
  2023. const identityCardRef = ref();
  2024. const identityCardRuleForm = reactive({
  2025. level: "",
  2026. name: "",
  2027. phone: "",
  2028. icCard: "",
  2029. cardType: "",
  2030. effectiveTime: "",
  2031. failureTime: "",
  2032. id: "",
  2033. });
  2034. // 表单验证
  2035. const identityCardRules = reactive({
  2036. name: [{ required: true, message: "姓名不能为空", trigger: "blur" }],
  2037. phone: [{ required: true, message: "号码不能为空", trigger: "blur" }],
  2038. level: [
  2039. {
  2040. required: true,
  2041. message: "角色不能为空",
  2042. trigger: "blur",
  2043. },
  2044. ],
  2045. cardType: [
  2046. {
  2047. required: true,
  2048. message: "类型不能为空",
  2049. trigger: "blur",
  2050. },
  2051. ],
  2052. icCard: [
  2053. {
  2054. required: true,
  2055. message: "卡号不能为空",
  2056. trigger: "blur",
  2057. },
  2058. ],
  2059. effectiveTime: [
  2060. {
  2061. required: true,
  2062. message: "生效时间不能为空",
  2063. trigger: "blur",
  2064. },
  2065. ],
  2066. failureTime: [
  2067. {
  2068. required: true,
  2069. message: "失效时间不能为空",
  2070. trigger: "blur",
  2071. },
  2072. ],
  2073. });
  2074. // 添加身份证弹窗
  2075. const addIdentityCardVisible = ref(false);
  2076. // const wsidentityCard = ref("");
  2077. const identityCardTitle = ref("");
  2078. // const identityCardNum = ref(""); // 身份证卡号
  2079. const identityCardIndex = ref(0); // 读卡步骤
  2080. // 点击房间查看面板操作 (--------------------------------------------------)
  2081. const itemClick = async (i) => {
  2082. roomList.list.forEach((item) => {
  2083. item.vos.forEach((ii) => {
  2084. ii.visible = false;
  2085. });
  2086. });
  2087. i.visible = true
  2088. let data = {
  2089. houseNumberId: i.houseNumberId,
  2090. permissionSettingId: sessionStorage.getItem("permissionSettingId"),
  2091. };
  2092. let res = await axios({
  2093. method: "get",
  2094. url: api.value + "/house-lock/particular",
  2095. headers: {
  2096. token: sessionStorage.getItem("token"),
  2097. user_head: sessionStorage.getItem("userhead"),
  2098. },
  2099. params: data,
  2100. });
  2101. console.log(res, "门锁详情");
  2102. if (res.data.code == 200) {
  2103. electricQuantity.value = res.data.data.electricQuantity;
  2104. nfcFunction.value = res.data.data.nfcFunction;
  2105. houseLockId.value = res.data.data.id;
  2106. // i.visible = true;
  2107. } else {
  2108. // i.visible = false;
  2109. electricQuantity.value = "";
  2110. ElMessage({
  2111. type: "error",
  2112. showClose: true,
  2113. message: res.data.message,
  2114. center: true,
  2115. });
  2116. }
  2117. };
  2118. // 关闭操作面板
  2119. const closeRoom = (i) => {
  2120. i.visible = false;
  2121. };
  2122. // 房型列表展示条
  2123. const roomNameTypeData = async () => {
  2124. let res = await axios({
  2125. method: "get",
  2126. url: api.value + "/house/roomNameType",
  2127. headers: {
  2128. token: sessionStorage.getItem("token"),
  2129. user_head: sessionStorage.getItem("user_head"),
  2130. },
  2131. });
  2132. console.log(res, "房型管理");
  2133. if (res.data.code == 200) {
  2134. roomTypes.value = res.data.data;
  2135. // roomTypeIndex.value=roomTypes.value[0]
  2136. loading.value = false;
  2137. // ElMessage({
  2138. // type: "success",
  2139. // showClose: true,
  2140. // message: res.data.message,
  2141. // center: true,
  2142. // });
  2143. } else {
  2144. loading.value = false;
  2145. ElMessage({
  2146. type: "error",
  2147. showClose: true,
  2148. message: res.data.message,
  2149. center: true,
  2150. });
  2151. }
  2152. };
  2153. const changeTypes = (val) => {
  2154. console.log(val);
  2155. roomTypeIndex.value = val;
  2156. getList().then(() => {
  2157. roomList.list.forEach((item) => {
  2158. item.vos.forEach((ii) => {
  2159. ii.visible = false;
  2160. });
  2161. });
  2162. });
  2163. };
  2164. // 楼栋单元数据
  2165. const schoolData = async () => {
  2166. let res = await axios({
  2167. method: "get",
  2168. url: api.value + "/building/beDisplayBar",
  2169. headers: {
  2170. token: sessionStorage.getItem("token"),
  2171. user_head: sessionStorage.getItem("user_head"),
  2172. },
  2173. });
  2174. console.log(res, "楼栋单元下拉框");
  2175. if (res.data.code == 200) {
  2176. buildData.value = res.data.data;
  2177. } else {
  2178. ElMessage({
  2179. type: "error",
  2180. showClose: true,
  2181. message: res.data.message,
  2182. center: true,
  2183. });
  2184. }
  2185. };
  2186. // 查看员工列表
  2187. const getList = async () => {
  2188. loading.value = true;
  2189. let data = {
  2190. roomNumber: searchInput.keyWord,
  2191. permissionSettingId: sessionStorage.getItem("permissionSettingId"),
  2192. roomName: roomTypeIndex.value,
  2193. buildingId:searchInput.buildingId,
  2194. houseType:searchInput.houseType
  2195. };
  2196. if (roomTypeIndex.value == "全部") {
  2197. data.roomName = "";
  2198. }
  2199. let res = await axios({
  2200. method: "get",
  2201. url: api.value + "/house-lock/list",
  2202. headers: {
  2203. token: sessionStorage.getItem("token"),
  2204. user_head: sessionStorage.getItem("userhead"),
  2205. },
  2206. params: data,
  2207. });
  2208. console.log(res, "门锁页面展示");
  2209. if (res.data.code == 200) {
  2210. loading.value = false;
  2211. let arr=[]
  2212. res.data.data.forEach((item) => {
  2213. if(item.vos){
  2214. item.total = item.vos.length;
  2215. arr.push(item)
  2216. }
  2217. });
  2218. roomList.list = arr;
  2219. } else {
  2220. loading.value = false;
  2221. ElMessage({
  2222. type: "error",
  2223. showClose: true,
  2224. message: res.data.message,
  2225. center: true,
  2226. });
  2227. }
  2228. };
  2229. // 搜索功能
  2230. const searchBtn = lodash.debounce(async () => {
  2231. getList();
  2232. }, 300);
  2233. // 消息列表 (---------------------------------------------------------------)
  2234. const newsClick = async (row) => {
  2235. newsVisible.value = true;
  2236. console.log(row, "消息列表");
  2237. newshouseNumberId.value = row.houseNumberId;
  2238. if (newsIndex.value == 1) {
  2239. let data = {
  2240. houseNumberId: newshouseNumberId.value,
  2241. permissionSettingId: sessionStorage.getItem("permissionSettingId"),
  2242. page: newsPage.value,
  2243. size: newsSize.value,
  2244. };
  2245. let res = await axios({
  2246. method: "get",
  2247. url: api.value + "/unlocking-record/pageList",
  2248. headers: {
  2249. token: sessionStorage.getItem("token"),
  2250. user_head: sessionStorage.getItem("userhead"),
  2251. },
  2252. params: data,
  2253. });
  2254. console.log(res, "开锁记录");
  2255. if (res.data.code == 200) {
  2256. newTableList.value = res.data.data.records;
  2257. newsTotal.value = res.data.data.total;
  2258. } else {
  2259. ElMessage({
  2260. type: "error",
  2261. showClose: true,
  2262. message: res.data.message,
  2263. center: true,
  2264. });
  2265. }
  2266. } else if (newsIndex.value == 2) {
  2267. let data = {
  2268. houseNumberId: newshouseNumberId.value,
  2269. permissionSettingId: sessionStorage.getItem("permissionSettingId"),
  2270. page: newsPage.value,
  2271. size: newsSize.value,
  2272. };
  2273. let res = await axios({
  2274. method: "get",
  2275. url: api.value + "/operating-record/pageList",
  2276. headers: {
  2277. token: sessionStorage.getItem("token"),
  2278. user_head: sessionStorage.getItem("userhead"),
  2279. },
  2280. params: data,
  2281. });
  2282. console.log(res, "操作记录");
  2283. if (res.data.code == 200) {
  2284. newTableList.value = res.data.data.records;
  2285. newsTotal.value = res.data.data.total;
  2286. } else {
  2287. ElMessage({
  2288. type: "error",
  2289. showClose: true,
  2290. message: res.data.message,
  2291. center: true,
  2292. });
  2293. }
  2294. }
  2295. };
  2296. // 切换消息列表
  2297. const changeNews = async (ind) => {
  2298. newsIndex.value = ind;
  2299. if (ind == 1) {
  2300. let data = {
  2301. houseNumberId: newshouseNumberId.value,
  2302. permissionSettingId: sessionStorage.getItem("permissionSettingId"),
  2303. page: newsPage.value,
  2304. size: newsSize.value,
  2305. };
  2306. let res = await axios({
  2307. method: "get",
  2308. url: api.value + "/unlocking-record/pageList",
  2309. headers: {
  2310. token: sessionStorage.getItem("token"),
  2311. user_head: sessionStorage.getItem("userhead"),
  2312. },
  2313. params: data,
  2314. });
  2315. console.log(res, "开锁记录");
  2316. if (res.data.code == 200) {
  2317. newTableList.value = res.data.data.records;
  2318. newsTotal.value = res.data.data.total;
  2319. } else {
  2320. ElMessage({
  2321. type: "error",
  2322. showClose: true,
  2323. message: res.data.message,
  2324. center: true,
  2325. });
  2326. }
  2327. } else if (ind == 2) {
  2328. let data = {
  2329. houseNumberId: newshouseNumberId.value,
  2330. permissionSettingId: sessionStorage.getItem("permissionSettingId"),
  2331. page: newsPage.value,
  2332. size: newsSize.value,
  2333. };
  2334. let res = await axios({
  2335. method: "get",
  2336. url: api.value + "/operating-record/pageList",
  2337. headers: {
  2338. token: sessionStorage.getItem("token"),
  2339. user_head: sessionStorage.getItem("userhead"),
  2340. },
  2341. params: data,
  2342. });
  2343. console.log(res, "开锁记录");
  2344. if (res.data.code == 200) {
  2345. newTableList.value = res.data.data.records;
  2346. newsTotal.value = res.data.data.total;
  2347. } else {
  2348. ElMessage({
  2349. type: "error",
  2350. showClose: true,
  2351. message: res.data.message,
  2352. center: true,
  2353. });
  2354. }
  2355. }
  2356. };
  2357. // 关闭弹窗列表
  2358. const cancelNews = () => {
  2359. newsVisible.value = false;
  2360. };
  2361. // 消息列表分页
  2362. const newsHandleCurrentChange = (value) => {
  2363. // console.log(value);
  2364. newsPage.value = value;
  2365. changeNews(newsIndex.value);
  2366. };
  2367. // 远程开锁(-----------------------------------------------------------------)
  2368. const unlockingClick = (row) => {
  2369. console.log(row, "远程开锁");
  2370. unlockingVisible.value = true;
  2371. unlockList.luid = row.equipmentType;
  2372. unlockList.roomNumber = row.roomNumber;
  2373. unlockList.houseNumberId = row.houseNumberId;
  2374. };
  2375. // 确定远程开锁
  2376. const unlockingSubmit = async () => {
  2377. let data = {
  2378. luid: unlockList.luid,
  2379. roomNumber: unlockList.roomNumber,
  2380. houseNumberId: unlockList.houseNumberId,
  2381. permissionSettingId: sessionStorage.getItem("permissionSettingId"),
  2382. };
  2383. let res = await axios({
  2384. method: "post",
  2385. url: api.value + "/house-lock/remoteUnlocking",
  2386. headers: {
  2387. token: sessionStorage.getItem("token"),
  2388. user_head: sessionStorage.getItem("userhead"),
  2389. },
  2390. data: data,
  2391. });
  2392. console.log(res, "确定远程开锁");
  2393. if (res.data.code == 200) {
  2394. unlockingVisible.value = false;
  2395. getList();
  2396. ElMessage({
  2397. type: "success",
  2398. showClose: true,
  2399. message: res.data.message,
  2400. center: true,
  2401. });
  2402. } else {
  2403. ElMessage({
  2404. type: "error",
  2405. showClose: true,
  2406. message: res.data.message,
  2407. center: true,
  2408. });
  2409. }
  2410. };
  2411. const cancelUnlocking = () => {
  2412. unlockingVisible.value = false;
  2413. };
  2414. // 绑定设备(-----------------------------------------------------------------)
  2415. const bindingClick = (row) => {
  2416. console.log(row, "绑定设备");
  2417. bindingVisible.value = true;
  2418. bindingList.houseNumberId = row.houseNumberId;
  2419. };
  2420. // 确定绑定设备
  2421. const bindingSubmit = async (formEl) => {
  2422. if (!formEl) return;
  2423. await formEl.validate(async (valid, fields) => {
  2424. if (valid) {
  2425. let data = {
  2426. permissionSettingId: sessionStorage.getItem("permissionSettingId"),
  2427. houseNumberId: bindingList.houseNumberId, //房间号id
  2428. adminId: sessionStorage.getItem("id"), //管理员id
  2429. luid: bindingList.luid, //锁设备ID
  2430. };
  2431. let res = await axios({
  2432. method: "post",
  2433. url: api.value + "/house-lock/binding",
  2434. headers: {
  2435. token: sessionStorage.getItem("token"),
  2436. user_head: sessionStorage.getItem("user_head"),
  2437. },
  2438. data: data,
  2439. });
  2440. console.log(res, "确定绑定设备");
  2441. if (res.data.code == 200) {
  2442. getList();
  2443. ElMessage({
  2444. type: "success",
  2445. showClose: true,
  2446. message: res.data.message,
  2447. center: true,
  2448. });
  2449. bindingVisible.value = false;
  2450. bindingRef.value.resetFields();
  2451. } else {
  2452. ElMessage({
  2453. type: "error",
  2454. showClose: true,
  2455. message: res.data.message,
  2456. center: true,
  2457. });
  2458. }
  2459. } else {
  2460. console.log("error submit!", fields);
  2461. }
  2462. });
  2463. }
  2464. // 取消绑定设备
  2465. const cancelBinding = () => {
  2466. bindingVisible.value = false;
  2467. bindingRef.value.resetFields()
  2468. };
  2469. // nfc操作
  2470. const nfcClick= async (row,flag)=>{
  2471. console.log(row,'nfc操作');
  2472. let data = {
  2473. houseLockId: houseLockId.value,
  2474. nfcFunction: flag,
  2475. };
  2476. let res = await axios({
  2477. method: "get",
  2478. url: api.value + "/house-lock/nfc",
  2479. headers: {
  2480. token: sessionStorage.getItem("token"),
  2481. user_head: sessionStorage.getItem("userhead"),
  2482. },
  2483. params: data,
  2484. });
  2485. console.log(res, "nfc操作");
  2486. if (res.data.code == 200) {
  2487. getList();
  2488. roomList.list.forEach((item) => {
  2489. item.vos.forEach((ii) => {
  2490. ii.visible = false;
  2491. });
  2492. });
  2493. ElMessage({
  2494. type: "success",
  2495. showClose: true,
  2496. message: res.data.message,
  2497. center: true,
  2498. });
  2499. } else {
  2500. ElMessage({
  2501. type: "error",
  2502. showClose: true,
  2503. message: res.data.message,
  2504. center: true,
  2505. });
  2506. }
  2507. }
  2508. // 解绑设备(-----------------------------------------------------------------)
  2509. const deblockingClick = (row) => {
  2510. console.log(row, "解绑设备");
  2511. deblockingVisible.value = true;
  2512. dellockList.houseNumberId = row.houseNumberId;
  2513. };
  2514. // 确定解绑设备
  2515. const deblockSubmit = async () => {
  2516. let data = {
  2517. houseNumberId: dellockList.houseNumberId,
  2518. permissionSettingId: sessionStorage.getItem("permissionSettingId"),
  2519. adminId: sessionStorage.getItem("id"),
  2520. };
  2521. let res = await axios({
  2522. method: "get",
  2523. url: api.value + "/house-lock/unbind",
  2524. headers: {
  2525. token: sessionStorage.getItem("token"),
  2526. user_head: sessionStorage.getItem("userhead"),
  2527. },
  2528. params: data,
  2529. });
  2530. console.log(res, "确定解绑设备");
  2531. if (res.data.code == 200) {
  2532. deblockingVisible.value = false;
  2533. getList();
  2534. ElMessage({
  2535. type: "success",
  2536. showClose: true,
  2537. message: res.data.message,
  2538. center: true,
  2539. });
  2540. } else {
  2541. ElMessage({
  2542. type: "error",
  2543. showClose: true,
  2544. message: res.data.message,
  2545. center: true,
  2546. });
  2547. }
  2548. };
  2549. // 取消绑定
  2550. const cancelDeblocking = () => {
  2551. deblockingVisible.value = false;
  2552. };
  2553. // 批量导入(-----------------------------------------------------------------)
  2554. const bulkImportClick = () => {
  2555. bulkImportVisible.value = true;
  2556. bulkImportFile.value = "";
  2557. nextTick(()=>{
  2558. bulkImportref.value.clearFiles();
  2559. })
  2560. };
  2561. // 移出照片
  2562. const handleRemove = (uploadFile, uploadFiles) => {
  2563. bulkImportFile.value = "";
  2564. };
  2565. // 点击图片的查看按钮
  2566. const handlePreview = (file) => {
  2567. console.log(file);
  2568. };
  2569. // 限制上传图片的大小
  2570. const beforeAvatarUpload = (rawFile) => {
  2571. console.log(rawFile.type, "文件类型");
  2572. if (
  2573. rawFile.type !==
  2574. "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
  2575. ) {
  2576. ElMessage.error("文件格式必须为xlsx格式!");
  2577. return false;
  2578. } else if (rawFile.size / 1024 / 1024 > 100) {
  2579. ElMessage.error("文件的大小不能超过100MB!");
  2580. return false;
  2581. }
  2582. return true;
  2583. };
  2584. // 添加照片时往fileList列表中添加图片信息
  2585. const handleChange = async (file, fileLists) => {
  2586. console.log(file, "1111");
  2587. // fileList.list.push(file);
  2588. bulkImportFile.value = file.raw;
  2589. uploadFileShow.value=true
  2590. };
  2591. // 可以获取图片参数
  2592. const handleUpload = async (file) => {
  2593. // if (fileList.list.length >= 6) {
  2594. // ElMessage.error("最多可上传6张图片!");
  2595. // return false;
  2596. // }
  2597. console.log(file, "22222222");
  2598. // let data = new FormData();
  2599. // data.set("files", file.file);
  2600. // let res = await axios({
  2601. // method: "post",
  2602. // url: api.value + "/file/cos/upload",
  2603. // headers: {},
  2604. // data: data,
  2605. // });
  2606. // console.log(res, "图片上传成功详情图");
  2607. // if (res.data.code == 1) {
  2608. // // res.data.data.uid = file.file.uid;
  2609. // // console.log([res.data.data]);
  2610. // let arr = {
  2611. // uid: file.file.uid,
  2612. // url: res.data.data,
  2613. // };
  2614. // fileList.list = fileList.list.concat([arr]);
  2615. // ruleForm.fileListJson = fileList.list;
  2616. // }
  2617. };
  2618. // 上传文件时覆盖上一个文件
  2619. const handleExceed = (files) => {
  2620. bulkImportref.value.clearFiles();
  2621. const file = files[0];
  2622. file.uid = genFileId();
  2623. bulkImportref.value.handleStart(file);
  2624. };
  2625. // 重置按钮 重置上传文件
  2626. const resetImport = () => {
  2627. bulkImportFile.value = "";
  2628. bulkImportref.value.clearFiles();
  2629. };
  2630. // 下载模板
  2631. const downbulkImport=async ()=>{
  2632. let res = await axios({
  2633. method: "get",
  2634. url: api.value + "/house-lock/lockExport",
  2635. headers: {
  2636. token: sessionStorage.getItem("token"),
  2637. user_head: sessionStorage.getItem("userhead"),
  2638. },
  2639. responseType: "blob",
  2640. });
  2641. console.log(
  2642. res,
  2643. "批量导入模板下载"
  2644. );
  2645. if (res.status == 200) {
  2646. let name = `门锁模板`;
  2647. var content = res.data;
  2648. var datas = new Blob([content]);
  2649. var downloadUrl = window.URL.createObjectURL(datas);
  2650. var anchor = document.createElement("a");
  2651. anchor.href = downloadUrl;
  2652. anchor.download = name + ".xlsx";
  2653. anchor.click();
  2654. window.URL.revokeObjectURL(datas);
  2655. ElMessage({
  2656. type: "success",
  2657. showClose: true,
  2658. message: "下载成功",
  2659. center: true,
  2660. });
  2661. } else {
  2662. ElMessage({
  2663. type: "error",
  2664. showClose: true,
  2665. message: res.data.message,
  2666. center: true,
  2667. });
  2668. }
  2669. }
  2670. // 确定导入
  2671. const bulkImportConfig=async () =>{
  2672. let data=new FormData();
  2673. data.append('file',bulkImportFile.value)
  2674. let res = await axios({
  2675. method: "post",
  2676. url: api.value + "/house-lock/lockImport",
  2677. headers: {
  2678. token: sessionStorage.getItem("token"),
  2679. user_head: sessionStorage.getItem("userhead"),
  2680. },
  2681. data:data
  2682. });
  2683. console.log(
  2684. res,
  2685. "确定导入"
  2686. );
  2687. if (res.status == 200) {
  2688. getList()
  2689. bulkImportVisible.value = false;
  2690. ElMessage({
  2691. type: "success",
  2692. showClose: true,
  2693. message: res.data.message,
  2694. center: true,
  2695. });
  2696. } else {
  2697. ElMessage({
  2698. type: "error",
  2699. showClose: true,
  2700. message: res.data.message,
  2701. center: true,
  2702. });
  2703. }
  2704. }
  2705. const cancelBulkImport = () => {
  2706. bulkImportVisible.value = false;
  2707. };
  2708. // 钥匙管理(-----------------------------------------------------------------)
  2709. const keyListData = async () => {
  2710. let data = {
  2711. permissionSettingId: sessionStorage.getItem("permissionSettingId"),
  2712. houseNumberId: keyData.houseNumberId,
  2713. };
  2714. let res = await axios({
  2715. method: "get",
  2716. url: api.value + "/house-lock/key",
  2717. headers: {
  2718. token: sessionStorage.getItem("token"),
  2719. user_head: sessionStorage.getItem("userhead"),
  2720. },
  2721. params: data,
  2722. });
  2723. console.log(res, "住客,系统用户");
  2724. if (res.data.code == 200) {
  2725. userList.value = res.data.data.order;
  2726. systemUserList.value = res.data.data.employee;
  2727. customList.value = res.data.data.custom;
  2728. } else {
  2729. ElMessage({
  2730. type: "error",
  2731. showClose: true,
  2732. message: res.data.message,
  2733. center: true,
  2734. });
  2735. }
  2736. };
  2737. // 员工数据
  2738. const staffData=async ()=>{
  2739. // let data = {
  2740. // permissionSettingId: sessionStorage.getItem("permissionSettingId"),
  2741. // houseNumberId: keyData.houseNumberId,
  2742. // };
  2743. let res = await axios({
  2744. method: "get",
  2745. url: api.value + "/employeeUsers/getAllUser",
  2746. headers: {
  2747. token: sessionStorage.getItem("token"),
  2748. user_head: sessionStorage.getItem("userhead"),
  2749. },
  2750. });
  2751. console.log(res, "员工数据");
  2752. if (res.data.code == 200) {
  2753. staffList.value=res.data.data;
  2754. } else {
  2755. ElMessage({
  2756. type: "error",
  2757. showClose: true,
  2758. message: res.data.message,
  2759. center: true,
  2760. });
  2761. }
  2762. }
  2763. // 改变用户选择
  2764. const staffChange=(val,flag)=>{
  2765. console.log(val,flag,'改变用户选择');
  2766. if(flag=='房卡'){
  2767. staffList.value.forEach(i=>{
  2768. if(i.id==val){
  2769. // console.log(i,'房卡 用户数据');
  2770. if(cardFlag.value=='房卡'){
  2771. identityCardRuleForm.icCard=""
  2772. }else if(cardFlag.value=='身份证'){
  2773. identityCardRuleForm.icCard=i.idCardInformation
  2774. }
  2775. }
  2776. })
  2777. }else if(flag=='指纹'){
  2778. staffList.value.forEach(i=>{
  2779. if(i.id==val){
  2780. console.log(i,'指纹 用户数据');
  2781. fingerprintRuleForm.fingerprintNum=i.fingerprint
  2782. }
  2783. })
  2784. }
  2785. }
  2786. const keyClick = async (row) => {
  2787. console.log(row, "钥匙管理");
  2788. keyTitle.value = row.roomNumber;
  2789. keyData.houseNumberId = row.houseNumberId;
  2790. keyData.equipmentType = row.equipmentType;
  2791. keyVisible.value = true;
  2792. keyListData();// 住客,员工 自定义用户
  2793. staffData();// 员工筛选数据
  2794. };
  2795. const cancelKey = () => {
  2796. keyVisible.value = false;
  2797. };
  2798. // 钥匙管理 密码管理(-----------------------------------------------------------------)
  2799. const passManagementClick = (val) => {
  2800. keypassflag.value=val
  2801. // rolesList();
  2802. // fingerprintChangeList.value=""
  2803. passManagementVisible.value = true;
  2804. // passManagementRuleForm.level = "";
  2805. passManagementRuleForm.name = "";
  2806. passManagementRuleForm.phone = "";
  2807. passManagementRuleForm.effectiveTime = "";
  2808. passManagementRuleForm.failureTime = "";
  2809. passManagementRuleForm.pass = "";
  2810. nextTick(()=>{
  2811. passManagementRef.value.resetFields()
  2812. })
  2813. };
  2814. const cancelPassManagement = () => {
  2815. passManagementVisible.value = false;
  2816. passManagementRef.value.resetFields()
  2817. };
  2818. // 判断切换 时效密码 无网络密码 临时密码
  2819. const passManagementHandleClick = (value) => {
  2820. console.log(value);
  2821. passManagementRef.value.resetFields();
  2822. };
  2823. // 确定密码
  2824. const passManagementSend = (formEl) => {
  2825. if (!formEl) return;
  2826. formEl.validate(async (valid, fields) => {
  2827. if (valid) {
  2828. if(keypassflag.value=='系统'){
  2829. let data = {
  2830. permissionSettingId: sessionStorage.getItem("permissionSettingId"), //权限表id
  2831. adminId: sessionStorage.getItem("id"), //管理员id
  2832. houseNumberId: keyData.houseNumberId, //房间号id
  2833. startTime: passManagementRuleForm.effectiveTime, // 开始时间
  2834. endTime: passManagementRuleForm.failureTime, //结束时间
  2835. usersId: passManagementRuleForm.name, //用户id
  2836. equipmentType: keyData.equipmentType, //设备id
  2837. passWord: passManagementRuleForm.pass, // 密码
  2838. type: "4", //1:管理员用户,2:普通用户(永久),4:时效性用户,5:一次性时效密码用户,100:时效性无网络密码用户
  2839. };
  2840. let res = await axios({
  2841. method: "post",
  2842. url: api.value + "/unlocking-employee/savePassWord",
  2843. headers: {
  2844. token: sessionStorage.getItem("token"),
  2845. user_head: sessionStorage.getItem("userhead"),
  2846. },
  2847. data: data,
  2848. });
  2849. console.log(res, "系统添加密码");
  2850. if (res.data.code == 200) {
  2851. passManagementVisible.value = false;
  2852. keyListData();
  2853. ElMessage({
  2854. type: "success",
  2855. showClose: true,
  2856. message: res.data.message,
  2857. center: true,
  2858. });
  2859. } else {
  2860. ElMessage({
  2861. type: "error",
  2862. showClose: true,
  2863. message: res.data.message,
  2864. center: true,
  2865. });
  2866. }
  2867. }else if(keypassflag.value=='自定义'){
  2868. let data = {
  2869. permissionSettingId: sessionStorage.getItem("permissionSettingId"), //权限表id
  2870. adminId: sessionStorage.getItem("id"), //管理员id
  2871. houseNumberId: keyData.houseNumberId, //房间号id
  2872. startTime: passManagementRuleForm.effectiveTime, // 开始时间
  2873. endTime: passManagementRuleForm.failureTime, //结束时间
  2874. userName: passManagementRuleForm.name, //用户id
  2875. phone: passManagementRuleForm.phone, //用户id
  2876. equipmentType: keyData.equipmentType, //设备id
  2877. passWord: passManagementRuleForm.pass, // 密码
  2878. type: "4", //1:管理员用户,2:普通用户(永久),4:时效性用户,5:一次性时效密码用户,100:时效性无网络密码用户
  2879. };
  2880. let res = await axios({
  2881. method: "post",
  2882. url: api.value + "/unlocking-custom/savePassWord",
  2883. headers: {
  2884. token: sessionStorage.getItem("token"),
  2885. user_head: sessionStorage.getItem("userhead"),
  2886. },
  2887. data: data,
  2888. });
  2889. console.log(res, "自定义添加密码");
  2890. if (res.data.code == 200) {
  2891. passManagementVisible.value = false;
  2892. keyListData();
  2893. ElMessage({
  2894. type: "success",
  2895. showClose: true,
  2896. message: res.data.message,
  2897. center: true,
  2898. });
  2899. } else {
  2900. ElMessage({
  2901. type: "error",
  2902. showClose: true,
  2903. message: res.data.message,
  2904. center: true,
  2905. });
  2906. }
  2907. }
  2908. } else {
  2909. console.log("error submit!", fields);
  2910. }
  2911. });
  2912. };
  2913. // 随机八位数密码
  2914. const randomCipher =async () => {
  2915. let res = await axios({
  2916. method: "get",
  2917. url: api.value + "/unlocking-admin/getPassWord",
  2918. headers: {
  2919. token: sessionStorage.getItem("token"),
  2920. user_head: sessionStorage.getItem("userhead"),
  2921. },
  2922. });
  2923. console.log(res, "随机密码");
  2924. if (res.data.code == 200) {
  2925. passManagementRuleForm.pass = res.data.data.passWord;
  2926. } else {
  2927. ElMessage({
  2928. type: "error",
  2929. showClose: true,
  2930. message: res.data.message,
  2931. center: true,
  2932. });
  2933. }
  2934. };
  2935. // // 获取管理端角色信息
  2936. // const rolesList = async () => {
  2937. // let res = await axios({
  2938. // method: "get",
  2939. // url: api.value + "/admin-menu/getUserRole",
  2940. // headers: {
  2941. // token: sessionStorage.getItem("token"),
  2942. // user_head: sessionStorage.getItem("userhead"),
  2943. // },
  2944. // });
  2945. // console.log(res, "管理端角色");
  2946. // if (res.data.code == 200) {
  2947. // fingerprintoptions.value = res.data.data;
  2948. // } else {
  2949. // ElMessage({
  2950. // type: "error",
  2951. // showClose: true,
  2952. // message: res.data.message,
  2953. // center: true,
  2954. // });
  2955. // }
  2956. // };
  2957. // // 改变管理端角色 获取用户角色信息
  2958. // const fingerprintChange = async (val) => {
  2959. // console.log(val);
  2960. // let data = {
  2961. // adminMenuId: val[val.length - 1],
  2962. // };
  2963. // let res = await axios({
  2964. // method: "get",
  2965. // url: api.value + "/admin/userList",
  2966. // headers: {
  2967. // token: sessionStorage.getItem("token"),
  2968. // user_head: sessionStorage.getItem("userhead"),
  2969. // },
  2970. // params: data,
  2971. // });
  2972. // console.log(res, "用户角色");
  2973. // if (res.data.code == 200) {
  2974. // fingerprintChangeList.value = res.data.data;
  2975. // } else {
  2976. // ElMessage({
  2977. // type: "error",
  2978. // showClose: true,
  2979. // message: res.data.message,
  2980. // center: true,
  2981. // });
  2982. // }
  2983. // };
  2984. // 钥匙管理 添加指纹(-----------------------------------------------------------------)
  2985. const fingerprintClick = (val) => {
  2986. console.log("添加指纹",val);
  2987. keypassflag.value=val
  2988. // rolesList();
  2989. // fingerprintChangeList.value=""
  2990. fingerprintVisible.value = true;
  2991. // fingerprintRuleForm.level = "";
  2992. fingerprintRuleForm.name = "";
  2993. fingerprintRuleForm.phone = "";
  2994. fingerprintRuleForm.fingerprintNum = "";
  2995. fingerprintRuleForm.effectiveTime = "";
  2996. fingerprintRuleForm.failureTime = "";
  2997. nextTick(()=>{
  2998. fingerprintRef.value.resetFields();
  2999. })
  3000. };
  3001. const cancelFingerprint = () => {
  3002. fingerprintVisible.value = false;
  3003. fingerprintRef.value.resetFields();
  3004. };
  3005. // 指纹录取
  3006. const fingerprintNext = (formEl) => {
  3007. addFingerprintVisible.value = true;
  3008. step.list = [
  3009. { id: 1, title: "" },
  3010. { id: 2, title: "" },
  3011. { id: 3, title: "" },
  3012. { id: 4, title: "" },
  3013. ];
  3014. stepindex.value = 0;
  3015. var wsUrl = "ws://localhost:8181/";
  3016. let websocket = new WebSocket(wsUrl);
  3017. ws.value = websocket;
  3018. websocket.onopen = function (evt) {
  3019. var params = { type: 101, data: null };
  3020. websocket.send(JSON.stringify(params));
  3021. };
  3022. websocket.onmessage = function (evt) {
  3023. // console.log(evt.data, "输出指纹数据");
  3024. let data = JSON.parse(evt.data);
  3025. if (data.type == 0) {
  3026. console.log(data.data.portNames);
  3027. let num=0
  3028. if(data.data.portNames){
  3029. num=data.data.portNames.length
  3030. console.log(JSON.parse(evt.data).data.portNames[num-1]);
  3031. }
  3032. // console.log(JSON.parse(evt.data).data.portNames[1]); // 获取到 USB接口
  3033. let params1 = {
  3034. type: 1,
  3035. data: {
  3036. type: 0,
  3037. portName: JSON.parse(evt.data).data.portNames[num-1],
  3038. baudRate: 115200,
  3039. },
  3040. };
  3041. websocket.send(JSON.stringify(params1));
  3042. } else if (data.type == 110) {
  3043. console.log("已获取设备信息");
  3044. } else if (data.type == 11) {
  3045. var params2 = {
  3046. type: 2,
  3047. data: {
  3048. totalStep: 4,
  3049. },
  3050. };
  3051. websocket.send(JSON.stringify(params2));
  3052. } else if (data.type == 21) {
  3053. if (data.data.step == 0) {
  3054. // console.log("请按压指纹");
  3055. ElMessage({
  3056. message: "请开始按压指纹",
  3057. type: "success",
  3058. });
  3059. } else {
  3060. // console.log(`请按下同一指纹,第${data.data.step}次按压`);
  3061. if (data.data.step <= 4) {
  3062. step.list.forEach((item) => {
  3063. if (item.id == data.data.step) {
  3064. item.title = `请按下同一指纹,第${data.data.step}次录入指纹成功`;
  3065. }
  3066. });
  3067. }
  3068. stepindex.value = data.data.step;
  3069. }
  3070. // _this.$message.warning("请将手指按在传感器上");
  3071. if (data.data.step > 4) {
  3072. var params = {
  3073. type: 3,
  3074. data: {
  3075. id: data.data.id,
  3076. },
  3077. };
  3078. websocket.send(JSON.stringify(params));
  3079. }
  3080. } else if (data.type == 31) {
  3081. fingerprintRuleForm.fingerprintNum = data.data.template;
  3082. console.log(data.data.template, "指纹数据");
  3083. addFingerprintVisible.value = false;
  3084. ws.value.close();
  3085. ElMessage({
  3086. message: "指纹录取成功",
  3087. type: "success",
  3088. });
  3089. // setTimeout(() => {
  3090. // _this.fingerprintShow = false;
  3091. // ws.value.close();
  3092. // }, 1500);
  3093. } else {
  3094. ElMessage({
  3095. message: "设备连接失败,请刷新重新录入",
  3096. type: "error",
  3097. });
  3098. }
  3099. };
  3100. websocket.onclose = function (evt) {
  3101. console.log("关闭连接");
  3102. // ws.value.close();
  3103. };
  3104. websocket.onerror = function (evt) {
  3105. // console.log("错误提示");
  3106. };
  3107. };
  3108. const fingerprintconfig = (formEl) => {
  3109. if (!formEl) return;
  3110. formEl.validate(async (valid, fields) => {
  3111. if (valid) {
  3112. if(keypassflag.value=='系统'){
  3113. let data = {
  3114. permissionSettingId: sessionStorage.getItem("permissionSettingId"), //权限表id
  3115. adminId: sessionStorage.getItem("id"), //管理员id
  3116. houseNumberId: keyData.houseNumberId, //房间号id
  3117. startTime: fingerprintRuleForm.effectiveTime, // 开始时间
  3118. endTime: fingerprintRuleForm.failureTime, //结束时间
  3119. usersId: fingerprintRuleForm.name, //用户id
  3120. luid: keyData.equipmentType, //设备id
  3121. fingerprintData: fingerprintRuleForm.fingerprintNum, //指纹特征值
  3122. type: "4", //1:管理员用户,2:普通用户(永久),4:时效性用户,5:一次性时效密码用户,100:时效性无网络密码用户
  3123. };
  3124. let res = await axios({
  3125. method: "post",
  3126. url: api.value + "/unlocking-employee/saveFingerprint",
  3127. headers: {
  3128. token: sessionStorage.getItem("token"),
  3129. user_head: sessionStorage.getItem("userhead"),
  3130. },
  3131. data: data,
  3132. });
  3133. console.log(res, "系统添加指纹钥匙");
  3134. if (res.data.code == 200) {
  3135. fingerprintVisible.value = false;
  3136. keyListData();
  3137. ElMessage({
  3138. type: "success",
  3139. showClose: true,
  3140. message: res.data.message,
  3141. center: true,
  3142. });
  3143. } else {
  3144. ElMessage({
  3145. type: "error",
  3146. showClose: true,
  3147. message: res.data.message,
  3148. center: true,
  3149. });
  3150. }
  3151. }else if(keypassflag.value=='自定义'){
  3152. let data = {
  3153. permissionSettingId: sessionStorage.getItem("permissionSettingId"), //权限表id
  3154. adminId: sessionStorage.getItem("id"), //管理员id
  3155. houseNumberId: keyData.houseNumberId, //房间号id
  3156. startTime: fingerprintRuleForm.effectiveTime, // 开始时间
  3157. endTime: fingerprintRuleForm.failureTime, //结束时间
  3158. userName: fingerprintRuleForm.name, //用户id
  3159. phone: fingerprintRuleForm.phone, //用户id
  3160. luid: keyData.equipmentType, //设备id
  3161. fingerprintData: fingerprintRuleForm.fingerprintNum, //指纹特征值
  3162. type: "4", //1:管理员用户,2:普通用户(永久),4:时效性用户,5:一次性时效密码用户,100:时效性无网络密码用户
  3163. };
  3164. let res = await axios({
  3165. method: "post",
  3166. url: api.value + "/unlocking-custom/saveFingerprint",
  3167. headers: {
  3168. token: sessionStorage.getItem("token"),
  3169. user_head: sessionStorage.getItem("userhead"),
  3170. },
  3171. data: data,
  3172. });
  3173. console.log(res, "自定义添加指纹钥匙");
  3174. if (res.data.code == 200) {
  3175. fingerprintVisible.value = false;
  3176. keyListData();
  3177. ElMessage({
  3178. type: "success",
  3179. showClose: true,
  3180. message: res.data.message,
  3181. center: true,
  3182. });
  3183. } else {
  3184. ElMessage({
  3185. type: "error",
  3186. showClose: true,
  3187. message: res.data.message,
  3188. center: true,
  3189. });
  3190. }
  3191. }
  3192. }
  3193. });
  3194. };
  3195. // 钥匙管理中删除系统用户
  3196. const fingerprintDel=async (row)=>{
  3197. console.log(row);
  3198. let data = {
  3199. unlockingEmpId: row.id, //权限表id
  3200. };
  3201. let res = await axios({
  3202. method: "get",
  3203. url: api.value + "/unlocking-employee/deleteLock",
  3204. headers: {
  3205. token: sessionStorage.getItem("token"),
  3206. user_head: sessionStorage.getItem("userhead"),
  3207. },
  3208. params: data,
  3209. });
  3210. console.log(res, "删除指纹钥匙");
  3211. if (res.data.code == 200) {
  3212. keyListData();
  3213. ElMessage({
  3214. type: "success",
  3215. showClose: true,
  3216. message: res.data.message,
  3217. center: true,
  3218. });
  3219. } else {
  3220. ElMessage({
  3221. type: "error",
  3222. showClose: true,
  3223. message: res.data.message,
  3224. center: true,
  3225. });
  3226. }
  3227. }
  3228. // 钥匙管理中删除自定义用户
  3229. const customDel=async (row)=>{
  3230. console.log(row);
  3231. let data = {
  3232. unlockingAdminId: row.id, //权限表id
  3233. };
  3234. let res = await axios({
  3235. method: "get",
  3236. url: api.value + "/unlocking-custom/deleteLock",
  3237. headers: {
  3238. token: sessionStorage.getItem("token"),
  3239. user_head: sessionStorage.getItem("userhead"),
  3240. },
  3241. params: data,
  3242. });
  3243. console.log(res, "删除指纹钥匙");
  3244. if (res.data.code == 200) {
  3245. keyListData();
  3246. ElMessage({
  3247. type: "success",
  3248. showClose: true,
  3249. message: res.data.message,
  3250. center: true,
  3251. });
  3252. } else {
  3253. ElMessage({
  3254. type: "error",
  3255. showClose: true,
  3256. message: res.data.message,
  3257. center: true,
  3258. });
  3259. }
  3260. }
  3261. // 关闭指纹录入
  3262. const cancelAddFingerprint = () => {
  3263. addFingerprintVisible.value = false;
  3264. // var wsUrl = "ws://localhost:8181/";
  3265. // const websocket = new WebSocket(wsUrl);
  3266. ws.value.close();
  3267. };
  3268. // 钥匙管理 添加身份证(-----------------------------------------------------------------)
  3269. const identityCardClick = (val,card) => {
  3270. keypassflag.value=val
  3271. if(card){
  3272. cardFlag.value=card
  3273. }else{
  3274. cardFlag.value=""
  3275. }
  3276. // rolesList();
  3277. // fingerprintChangeList.value=""
  3278. identityCardVisible.value = true;
  3279. identityCardRuleForm.level = "";
  3280. identityCardRuleForm.name = "";
  3281. identityCardRuleForm.phone = "";
  3282. identityCardRuleForm.icCard = "";
  3283. identityCardRuleForm.cardType = "";
  3284. identityCardRuleForm.effectiveTime = "";
  3285. identityCardRuleForm.failureTime = "";
  3286. nextTick(()=>{
  3287. identityCardRef.value.resetFields();
  3288. })
  3289. };
  3290. const cancelIdentityCard = () => {
  3291. identityCardVisible.value = false;
  3292. identityCardRef.value.resetFields();
  3293. };
  3294. const Card = () => {
  3295. var wsUrl = "ws://localhost:8181/";
  3296. let websocket = new WebSocket(wsUrl);
  3297. // wsidentityCard.value = websocket;
  3298. websocket.onopen = function (evt) {
  3299. var params = { type: 104, data: null };
  3300. websocket.send(JSON.stringify(params));
  3301. };
  3302. websocket.onmessage = function (evt) {
  3303. let data = JSON.parse(evt.data);
  3304. console.log(data);
  3305. if (data.type == 141) {
  3306. identityCardTitle.value = "请插入设备";
  3307. identityCardIndex.value = 0;
  3308. } else if (data.type == 150) {
  3309. identityCardTitle.value = "配置失败,请检查卡片是否已放置设备上";
  3310. identityCardIndex.value = 1;
  3311. } else if (data.type == 140) {
  3312. // identityCardNum.value = data.data.uid;
  3313. console.log(data.data.uid, "读取的卡号");
  3314. identityCardIndex.value = 2;
  3315. identityCardTitle.value = "读卡中";
  3316. if (data.data.uid) {
  3317. setTimeout(() => {
  3318. identityCardIndex.value = 3;
  3319. identityCardTitle.value = "读卡成功";
  3320. }, 1500);
  3321. }
  3322. // ElMessage({
  3323. // type: "success",
  3324. // showClose: true,
  3325. // message: "添加卡片成功",
  3326. // center: true,
  3327. // });
  3328. // identityCardTitle.value = "获取卡号成功";
  3329. // addIdentityCardVisible.value = false;
  3330. // identityCardVisible.value = false;
  3331. // identityCardRef.value.resetFields();
  3332. // setTimeout(() => {
  3333. // _this.icCardShow = false;
  3334. // }, 2000);
  3335. }
  3336. };
  3337. };
  3338. // 身份证读卡
  3339. const identityCardNext = () => {
  3340. addIdentityCardVisible.value = true;
  3341. Card();
  3342. };
  3343. const identityCardConfig = (formEl) => {
  3344. if (!formEl) return;
  3345. formEl.validate(async (valid, fields) => {
  3346. if (valid) {
  3347. if(keypassflag.value=='系统'){
  3348. if(cardFlag.value=='房卡'){
  3349. identityCardRuleForm.cardType=0 // 0:房卡 1:身份证
  3350. }else if(cardFlag.value=='身份证'){
  3351. identityCardRuleForm.cardType=1
  3352. }
  3353. let data = {
  3354. permissionSettingId: sessionStorage.getItem("permissionSettingId"), //权限表id
  3355. adminId: sessionStorage.getItem("id"), //管理员id
  3356. houseNumberId: keyData.houseNumberId, //房间号id
  3357. startTime: identityCardRuleForm.effectiveTime, // 开始时间
  3358. endTime: identityCardRuleForm.failureTime, //结束时间
  3359. usersId: identityCardRuleForm.name, //用户id
  3360. luid: keyData.equipmentType, //设备id
  3361. card: identityCardRuleForm.icCard, //指纹特征值
  3362. cardType: identityCardRuleForm.cardType, //指纹特征值
  3363. type: "4", //1:管理员用户,2:普通用户(永久),4:时效性用户,5:一次性时效密码用户,100:时效性无网络密码用户
  3364. };
  3365. let res = await axios({
  3366. method: "post",
  3367. url: api.value + "/unlocking-employee/saveCard",
  3368. headers: {
  3369. token: sessionStorage.getItem("token"),
  3370. user_head: sessionStorage.getItem("userhead"),
  3371. },
  3372. data: data,
  3373. });
  3374. console.log(res, "系统添加卡片钥匙");
  3375. if (res.data.code == 200) {
  3376. identityCardVisible.value = false;
  3377. keyListData();
  3378. ElMessage({
  3379. type: "success",
  3380. showClose: true,
  3381. message: res.data.message,
  3382. center: true,
  3383. });
  3384. } else {
  3385. ElMessage({
  3386. type: "error",
  3387. showClose: true,
  3388. message: res.data.message,
  3389. center: true,
  3390. });
  3391. }
  3392. }else if(keypassflag.value=='自定义'){
  3393. if(cardFlag.value=='房卡'){
  3394. identityCardRuleForm.cardType=0 // 0:房卡 1:身份证
  3395. }else if(cardFlag.value=='身份证'){
  3396. identityCardRuleForm.cardType=1
  3397. }
  3398. let data = {
  3399. permissionSettingId: sessionStorage.getItem("permissionSettingId"), //权限表id
  3400. adminId: sessionStorage.getItem("id"), //管理员id
  3401. houseNumberId: keyData.houseNumberId, //房间号id
  3402. startTime: identityCardRuleForm.effectiveTime, // 开始时间
  3403. endTime: identityCardRuleForm.failureTime, //结束时间
  3404. userName: identityCardRuleForm.name, //用户id
  3405. phone: identityCardRuleForm.phone, //用户id
  3406. luid: keyData.equipmentType, //设备id
  3407. card: identityCardRuleForm.icCard, //指纹特征值
  3408. cardType: identityCardRuleForm.cardType, //指纹特征值
  3409. type: "4", //1:管理员用户,2:普通用户(永久),4:时效性用户,5:一次性时效密码用户,100:时效性无网络密码用户
  3410. };
  3411. let res = await axios({
  3412. method: "post",
  3413. url: api.value + "/unlocking-custom/saveCard",
  3414. headers: {
  3415. token: sessionStorage.getItem("token"),
  3416. user_head: sessionStorage.getItem("userhead"),
  3417. },
  3418. data: data,
  3419. });
  3420. console.log(res, "自定义添加卡片钥匙");
  3421. if (res.data.code == 200) {
  3422. identityCardVisible.value = false;
  3423. keyListData();
  3424. ElMessage({
  3425. type: "success",
  3426. showClose: true,
  3427. message: res.data.message,
  3428. center: true,
  3429. });
  3430. } else {
  3431. ElMessage({
  3432. type: "error",
  3433. showClose: true,
  3434. message: res.data.message,
  3435. center: true,
  3436. });
  3437. }
  3438. }
  3439. }
  3440. });
  3441. };
  3442. // 重试 身份卡
  3443. const retry = () => {
  3444. // identityCardNum.value = "";
  3445. Card();
  3446. };
  3447. const cancelAddIdentityCard = () => {
  3448. addIdentityCardVisible.value = false;
  3449. identityCardIndex.value = 0;
  3450. };
  3451. //导出功能
  3452. const importExcel = lodash.debounce(async () => {
  3453. let data = {
  3454. ledgerParam: searchInput.keyWord,
  3455. managerId: sessionStorage.getItem("token"),
  3456. };
  3457. if (searchInput.createTime) {
  3458. data.payStartTime = searchInput.createTime[0];
  3459. data.payEndTime = searchInput.createTime[1];
  3460. }
  3461. if (searchInput.status) {
  3462. data.orderStatus = searchInput.status;
  3463. }
  3464. let res = await axios({
  3465. method: "post",
  3466. url: api.value + "/mhotel/booktoBookExcel.action",
  3467. headers: {
  3468. // token: sessionStorage.getItem("token"),
  3469. },
  3470. params: data,
  3471. });
  3472. console.log(res, "导出订单管理");
  3473. if (res.data.code == 200) {
  3474. var downloadPath = res.data.downurl;
  3475. // window.open(downloadPath);
  3476. window.location.href = downloadPath;
  3477. var downloadLink = document.createElement("a");
  3478. downloadLink.style.display = "none"; // 使其隐藏
  3479. downloadLink.href = downloadPath;
  3480. downloadLink.download = "";
  3481. downloadLink.click();
  3482. document.body.appendChild(downloadLink);
  3483. document.body.removeChild(downloadLink);
  3484. ElMessage({
  3485. type: "success",
  3486. showClose: true,
  3487. message: res.data.message,
  3488. center: true,
  3489. });
  3490. } else {
  3491. ElMessage({
  3492. type: "error",
  3493. showClose: true,
  3494. message: res.data.message,
  3495. center: true,
  3496. });
  3497. }
  3498. }, 1000);
  3499. // 表格斑马纹颜色修改
  3500. const tableRowClassName = ({ row, rowIndex }) => {
  3501. if (rowIndex % 2 === 0) {
  3502. return "even";
  3503. } else if (rowIndex % 2 !== 0) {
  3504. return "odd";
  3505. }
  3506. return "";
  3507. };
  3508. // 分页
  3509. const handleCurrentChange = (value) => {
  3510. // console.log(value);
  3511. currentPage.value = value;
  3512. getList();
  3513. };
  3514. onBeforeMount(async () => {
  3515. api.value = store.state.user.api;
  3516. const btnflag = JSON.parse(sessionStorage.getItem("btnflag"));
  3517. flagBtn.value = btnflag.doorLock;
  3518. console.log(flagBtn.value, "按钮权限");
  3519. roomNameTypeData();
  3520. getList();
  3521. schoolData()
  3522. });
  3523. onUnmounted(() => {
  3524. // document.removeEventListener("keyup", Enters);
  3525. });
  3526. </script>
  3527. <style scoped lang="scss">
  3528. .content-box {
  3529. width: 97.5%;
  3530. height: calc(100vh - 105px);
  3531. margin: 20px auto;
  3532. background-color: #fff;
  3533. color: #fff;
  3534. display: flex;
  3535. flex-direction: column;
  3536. box-shadow: 0px 3px 10px rgba(0, 97, 255, 0.2);
  3537. .left {
  3538. // width: calc(100wh - 40px);
  3539. display: flex;
  3540. align-items: center;
  3541. height: 60px;
  3542. margin: 0 30px;
  3543. border-bottom: 1px solid #ccc;
  3544. color: rgb(0, 0, 0);
  3545. font-size: 18px;
  3546. font-weight: 600;
  3547. .cameratxt {
  3548. height: 60px;
  3549. line-height: 60px;
  3550. }
  3551. }
  3552. .middles {
  3553. height: calc(100% - 81px);
  3554. display: flex;
  3555. flex-direction: column;
  3556. }
  3557. .middle {
  3558. width: calc(100% - 60px);
  3559. margin: 0 auto;
  3560. color: #000;
  3561. // border-bottom: 1px solid rgb(231, 231, 231);
  3562. .filter {
  3563. display: flex;
  3564. flex-wrap: wrap;
  3565. align-items: center;
  3566. padding: 10px 0 0 0;
  3567. .search {
  3568. color: #fff;
  3569. }
  3570. .condition {
  3571. display: flex;
  3572. align-items: center;
  3573. // margin: 0 0 10px 0;
  3574. }
  3575. }
  3576. .changeItems {
  3577. display: flex;
  3578. flex-wrap: wrap;
  3579. margin:10px 0 0 0;
  3580. .changeItem {
  3581. padding: 0 15px;
  3582. height: 30px;
  3583. background-color: rgba(230, 230, 230, 1);
  3584. text-align: center;
  3585. line-height: 30px;
  3586. font-size: 14px;
  3587. margin:0 15px 10px 0;
  3588. border-radius: 3px;
  3589. color: rgba(166, 166, 166, 1);
  3590. cursor: pointer;
  3591. border: 1px solid transparent;
  3592. }
  3593. .changeItem_active {
  3594. background-color: rgba(222, 234, 252, 1);
  3595. color: rgba(0, 97, 255, 1);
  3596. border: 1px solid rgba(0, 97, 255, 1);
  3597. }
  3598. .search {
  3599. margin-right: 5px;
  3600. }
  3601. }
  3602. .gongneng {
  3603. margin: 10px 0 20px 0;
  3604. span {
  3605. color: #fff;
  3606. }
  3607. }
  3608. :deep(.cont) {
  3609. width: 60%;
  3610. margin: 20px auto;
  3611. }
  3612. :deep(.download) {
  3613. display: flex;
  3614. align-items: center;
  3615. margin: 10px;
  3616. }
  3617. :deep(.download span) {
  3618. font-size: 16px;
  3619. margin-left: 20px;
  3620. }
  3621. :deep(.cont .el-button) {
  3622. margin-left: 60px;
  3623. margin-bottom: 30px;
  3624. }
  3625. :deep(.cont .accomplish) {
  3626. width: 100%;
  3627. display: flex;
  3628. justify-content: center;
  3629. }
  3630. :deep(.cont .accomplish .el-button) {
  3631. width: 50%;
  3632. margin: 0;
  3633. }
  3634. }
  3635. .footer {
  3636. width: calc(100% - 60px);
  3637. flex: 1;
  3638. overflow: auto;
  3639. margin: 0 auto;
  3640. color: #000;
  3641. overflow: auto;
  3642. .floor {
  3643. .title {
  3644. margin: 8px 0;
  3645. .t1 {
  3646. font-weight: 600;
  3647. margin-right: 10px;
  3648. }
  3649. .t2 {
  3650. font-size: 13px;
  3651. color: rgba(102, 102, 102, 1);
  3652. }
  3653. }
  3654. .roomList {
  3655. display: flex;
  3656. flex-wrap: wrap;
  3657. font-size: 14px;
  3658. .room {
  3659. width: 193px;
  3660. height: 114px;
  3661. opacity: 1;
  3662. border-radius: 4px;
  3663. background: rgba(240, 243, 247, 1);
  3664. margin: 5px 18px 18px 0;
  3665. // padding-left: 15px;
  3666. .roomNum {
  3667. font-size: 16px;
  3668. // height: 24px;
  3669. font-weight: 600;
  3670. padding: 15px 0 5px 15px;
  3671. }
  3672. .rLock {
  3673. color: rgba(128, 128, 128, 1);
  3674. padding: 0 0 0 15px;
  3675. }
  3676. .wifi {
  3677. display: flex;
  3678. align-items: center;
  3679. padding: 10px 0 10px 15px;
  3680. color: rgba(51, 51, 51, 1);
  3681. img {
  3682. width: 14px;
  3683. padding-right: 5px;
  3684. }
  3685. }
  3686. }
  3687. }
  3688. }
  3689. // 添加员工弹窗样式
  3690. :deep(.addStaff) {
  3691. // height: 600px;
  3692. overflow: hidden;
  3693. border-radius: 11px;
  3694. .el-dialog__header {
  3695. border-radius: 11px 11px 0 0;
  3696. background: rgba(237, 241, 245, 1);
  3697. font-weight: 600;
  3698. margin: 0;
  3699. .el-dialog__headerbtn {
  3700. outline: none;
  3701. }
  3702. }
  3703. .el-dialog__body {
  3704. overflow: auto;
  3705. padding: 0px 20px 10px 20px;
  3706. .order_info {
  3707. margin: 20px 0 15px 0;
  3708. .title {
  3709. display: flex;
  3710. align-items: center;
  3711. margin: 25px 0 10px 0;
  3712. img {
  3713. width: 20px;
  3714. height: 20px;
  3715. margin-right: 10px;
  3716. }
  3717. span {
  3718. color: #000;
  3719. font-size: 18px;
  3720. font-weight: 800;
  3721. }
  3722. }
  3723. // 排列模式样式
  3724. .workNum {
  3725. display: flex;
  3726. align-items: center;
  3727. margin-bottom: 12px;
  3728. font-size: 16px;
  3729. .titles {
  3730. color: rgba(128, 128, 128, 1);
  3731. margin-right: 12px;
  3732. font-weight: 200;
  3733. width: 80px;
  3734. }
  3735. span {
  3736. color: #000;
  3737. font-weight: 600;
  3738. }
  3739. ul {
  3740. list-style: none;
  3741. display: flex;
  3742. flex-wrap: wrap;
  3743. margin: 0;
  3744. padding: 0;
  3745. li {
  3746. border: 1px solid rgba(166, 166, 166, 1);
  3747. margin-right: 10px;
  3748. padding: 1px 4px;
  3749. border-radius: 6px;
  3750. cursor: pointer;
  3751. }
  3752. li.is_active {
  3753. background-color: rgba(9, 101, 98, 1);
  3754. color: #fff;
  3755. }
  3756. }
  3757. // .el-checkbox-button {
  3758. // margin-right: 10px;
  3759. // border: 1px solid #ccc;
  3760. // border-radius: 4px;
  3761. // box-sizing: border-box;
  3762. // .el-checkbox-button__inner {
  3763. // border: none;
  3764. // border-radius: 3px;
  3765. // }
  3766. // }
  3767. // .el-checkbox-button.is-focus {
  3768. // .el-checkbox-button__inner {
  3769. // color: #fff;
  3770. // background-color: rgba(9, 101, 98, 1);
  3771. // }
  3772. // }
  3773. }
  3774. }
  3775. .options {
  3776. margin: 0 0 10px 0;
  3777. width: 95%;
  3778. display: flex;
  3779. flex-direction: row-reverse;
  3780. .queding {
  3781. margin-left: 20px;
  3782. color: #fff;
  3783. }
  3784. }
  3785. .houseNumber {
  3786. margin: 20px 0;
  3787. // .el-checkbox-button {
  3788. // margin-right: 10px;
  3789. // border: 1px solid #ccc;
  3790. // border-radius: 4px;
  3791. // box-sizing: border-box;
  3792. // .el-checkbox-button__inner {
  3793. // border: none;
  3794. // border-radius: 3px;
  3795. // }
  3796. // }
  3797. // .el-checkbox-button.is-focus {
  3798. // .el-checkbox-button__inner {
  3799. // color: #fff;
  3800. // background-color: rgba(9, 101, 98, 1);
  3801. // }
  3802. // }
  3803. ul {
  3804. list-style: none;
  3805. display: flex;
  3806. flex-wrap: wrap;
  3807. margin: 0;
  3808. padding: 0;
  3809. li {
  3810. border: 1px solid rgba(166, 166, 166, 1);
  3811. margin-right: 10px;
  3812. padding: 1px 4px;
  3813. border-radius: 6px;
  3814. cursor: pointer;
  3815. }
  3816. li.is_active {
  3817. background-color: rgba(9, 101, 98, 1);
  3818. color: #fff;
  3819. }
  3820. }
  3821. }
  3822. }
  3823. }
  3824. }
  3825. .footer::-webkit-scrollbar-track {
  3826. background-color: #daeeff;
  3827. }
  3828. .footer::-webkit-scrollbar {
  3829. background-color: #0888f8;
  3830. height: 3px;
  3831. width: 4px;
  3832. }
  3833. .footer::-webkit-scrollbar-thumb {
  3834. background: #57b2ff;
  3835. border-radius: 4px;
  3836. height: 3px;
  3837. width: 4px;
  3838. }
  3839. .pageSize {
  3840. display: flex;
  3841. align-items: center;
  3842. justify-content: space-between;
  3843. margin: 0 30px;
  3844. span {
  3845. color: #000;
  3846. }
  3847. .el-pagination {
  3848. // width: 1600px;
  3849. :deep(.el-pagination__total) {
  3850. color: #000;
  3851. }
  3852. :deep(.el-pagination__goto) {
  3853. color: #000;
  3854. }
  3855. :deep(.el-pagination__classifier) {
  3856. color: #000;
  3857. }
  3858. :deep(.el-input__wrapper) {
  3859. border: 1px solid rgba(0, 0, 0, 1);
  3860. border-radius: 5px;
  3861. box-shadow: none;
  3862. }
  3863. :deep(.el-pager li) {
  3864. margin: 0 5px;
  3865. border: 1px solid rgba(0, 0, 0, 1);
  3866. border-radius: 5px;
  3867. background-color: transparent;
  3868. }
  3869. :deep(.el-pager li.is-active) {
  3870. background-color: rgba(111, 182, 184, 1);
  3871. }
  3872. :deep(.btn-prev) {
  3873. margin-right: 5px;
  3874. border: 1px solid rgba(0, 0, 0, 1);
  3875. border-radius: 5px;
  3876. background-color: transparent;
  3877. }
  3878. :deep(.btn-next) {
  3879. margin-left: 5px;
  3880. border: 1px solid rgba(0, 0, 0, 1);
  3881. border-radius: 5px;
  3882. background-color: transparent;
  3883. }
  3884. }
  3885. }
  3886. }
  3887. .el-input {
  3888. width: 192px;
  3889. }
  3890. .firstLogin {
  3891. position: absolute;
  3892. top: 0;
  3893. left: 0;
  3894. width: 100%;
  3895. height: calc(100vh);
  3896. background-color: rgba(0, 0, 0, 0.2);
  3897. z-index: 1000000;
  3898. display: flex;
  3899. justify-content: center;
  3900. align-items: center;
  3901. .goInfo {
  3902. width: 655px;
  3903. height: 408px;
  3904. background-color: #fff;
  3905. border-radius: 9px;
  3906. display: flex;
  3907. flex-direction: column;
  3908. justify-content: center;
  3909. align-items: center;
  3910. color: #000;
  3911. h2 {
  3912. margin: 0;
  3913. font-size: 28px;
  3914. }
  3915. p {
  3916. margin: 60px 0;
  3917. padding: 0;
  3918. font-size: 18px;
  3919. }
  3920. }
  3921. }
  3922. // 弹出的信息框
  3923. .roominfoPopper {
  3924. .roomInfo {
  3925. // border: 1px solid red;
  3926. color: #fff;
  3927. font-size: 14px;
  3928. position: relative;
  3929. .close {
  3930. position: absolute;
  3931. cursor: pointer;
  3932. right: -40px;
  3933. top: -30px;
  3934. img {
  3935. width: 30px;
  3936. height: 30px;
  3937. }
  3938. }
  3939. .title {
  3940. font-size: 16px;
  3941. padding: 7.5px 0;
  3942. border-bottom: 1px solid rgba(255, 255, 255, 0.5);
  3943. }
  3944. .content {
  3945. display: flex;
  3946. .lefts {
  3947. border-right: 1px solid rgba(255, 255, 255, 0.5);
  3948. span:nth-child(1) {
  3949. text-align: right;
  3950. display: inline-block;
  3951. width: 72px;
  3952. margin: 5px 15px 5px 0;
  3953. }
  3954. span:nth-child(2) {
  3955. text-align: left;
  3956. display: inline-block;
  3957. width: 190px;
  3958. }
  3959. }
  3960. .rigths {
  3961. width: 140px;
  3962. margin-left: 15px;
  3963. div {
  3964. display: flex;
  3965. align-items: center;
  3966. height: 30px;
  3967. cursor: pointer;
  3968. img {
  3969. width: 18px;
  3970. height: 18px;
  3971. margin-right: 5px;
  3972. }
  3973. span {
  3974. text-align: left;
  3975. display: inline-block;
  3976. }
  3977. .deblocking {
  3978. transform: translateX(3px);
  3979. }
  3980. }
  3981. }
  3982. }
  3983. }
  3984. }
  3985. // 消息列表弹窗
  3986. :deep(.newsDialog) {
  3987. // height: 600px;
  3988. overflow: hidden;
  3989. border-radius: 11px;
  3990. .el-dialog__header {
  3991. border-radius: 11px 11px 0 0;
  3992. background: rgba(237, 241, 245, 1);
  3993. font-weight: 600;
  3994. margin: 0;
  3995. .el-dialog__headerbtn {
  3996. outline: none;
  3997. }
  3998. }
  3999. .el-dialog__body {
  4000. overflow: auto;
  4001. padding: 0px 20px 10px 20px;
  4002. .middle {
  4003. width: 96%;
  4004. margin: 0 auto;
  4005. color: #000;
  4006. // 切换 消息记录 操作记录
  4007. .changeItems {
  4008. display: flex;
  4009. margin: 15px 0 0 0;
  4010. .changeNews {
  4011. // width: 80px;
  4012. padding: 0 10px;
  4013. height: 30px;
  4014. background-color: rgba(230, 230, 230, 1);
  4015. text-align: center;
  4016. line-height: 30px;
  4017. font-size: 14px;
  4018. margin-right: 15px;
  4019. border-radius: 3px;
  4020. color: rgba(166, 166, 166, 1);
  4021. cursor: pointer;
  4022. }
  4023. .changeNews_active {
  4024. background-color: rgba(222, 234, 252, 1);
  4025. color: rgba(0, 97, 255, 1);
  4026. }
  4027. }
  4028. // border-bottom: 1px solid rgb(231, 231, 231);
  4029. .filter {
  4030. display: flex;
  4031. flex-wrap: wrap;
  4032. align-items: center;
  4033. margin: 10px 0 0 0;
  4034. justify-content: start;
  4035. .search {
  4036. color: #fff;
  4037. }
  4038. .condition {
  4039. display: flex;
  4040. align-items: center;
  4041. margin: 10px 30px 10px 0;
  4042. :deep(.el-input .el-input__inner) {
  4043. font-size: 14px;
  4044. }
  4045. // span {
  4046. // margin: 0 10px 0 0;
  4047. // }
  4048. }
  4049. }
  4050. .gongneng {
  4051. margin: 10px 0 20px 0;
  4052. span {
  4053. color: #fff;
  4054. }
  4055. }
  4056. :deep(.cont) {
  4057. width: 60%;
  4058. margin: 20px auto;
  4059. }
  4060. :deep(.download) {
  4061. display: flex;
  4062. align-items: center;
  4063. margin: 10px;
  4064. }
  4065. :deep(.download span) {
  4066. font-size: 16px;
  4067. margin-left: 20px;
  4068. }
  4069. :deep(.cont .el-button) {
  4070. margin-left: 60px;
  4071. margin-bottom: 30px;
  4072. }
  4073. :deep(.cont .accomplish) {
  4074. width: 100%;
  4075. display: flex;
  4076. justify-content: center;
  4077. }
  4078. :deep(.cont .accomplish .el-button) {
  4079. width: 50%;
  4080. margin: 0;
  4081. }
  4082. }
  4083. .pageSize {
  4084. display: flex;
  4085. align-items: center;
  4086. justify-content: space-between;
  4087. margin: 10px 30px;
  4088. span {
  4089. color: #000;
  4090. }
  4091. .el-pagination {
  4092. // width: 1600px;
  4093. .el-pagination__total {
  4094. color: #000;
  4095. }
  4096. .el-pagination__goto {
  4097. color: #000;
  4098. }
  4099. .el-pagination__classifier {
  4100. color: #000;
  4101. }
  4102. .el-input__wrapper {
  4103. border: 1px solid rgba(0, 0, 0, 1);
  4104. border-radius: 5px;
  4105. box-shadow: none;
  4106. }
  4107. .el-pager li {
  4108. margin: 0 5px;
  4109. border: 1px solid rgba(0, 0, 0, 1);
  4110. border-radius: 5px;
  4111. background-color: transparent;
  4112. }
  4113. .el-pager li.is-active {
  4114. // background-color: rgba(111, 182, 184, 1);
  4115. border: 1px solid rgba(0, 97, 255, 1);
  4116. color: rgba(0, 97, 255, 1);
  4117. // border: 1px solid red;
  4118. }
  4119. .btn-prev {
  4120. margin-right: 5px;
  4121. border: 1px solid rgba(0, 0, 0, 1);
  4122. border-radius: 5px;
  4123. background-color: transparent;
  4124. }
  4125. .btn-next {
  4126. margin-left: 5px;
  4127. border: 1px solid rgba(0, 0, 0, 1);
  4128. border-radius: 5px;
  4129. background-color: transparent;
  4130. }
  4131. }
  4132. }
  4133. .footers {
  4134. width: 96%;
  4135. // height: 402px;
  4136. margin: 10px auto 20px;
  4137. .el-table--fit {
  4138. height: 100%;
  4139. .el-table__header-wrapper {
  4140. background-color: #000;
  4141. font-size: 15px;
  4142. tr {
  4143. color: #000;
  4144. }
  4145. }
  4146. .el-table__row {
  4147. height: 50px;
  4148. font-size: 15px;
  4149. color: #000;
  4150. .orderNum {
  4151. color: rgba(111, 182, 184, 1);
  4152. cursor: pointer;
  4153. }
  4154. }
  4155. .el-table__row:nth-child(2n) {
  4156. .el-table-fixed-column--right {
  4157. background-color: rgba(240, 243, 247, 1);
  4158. }
  4159. }
  4160. .el-table__row td {
  4161. padding: 0;
  4162. border: 0;
  4163. }
  4164. .el-button--primary {
  4165. margin-left: 5px;
  4166. }
  4167. .el-table__body .even {
  4168. background-color: #fff;
  4169. }
  4170. .el-table__body .odd {
  4171. background-color: rgba(240, 243, 247, 1);
  4172. }
  4173. }
  4174. }
  4175. }
  4176. }
  4177. // 远程开锁弹窗
  4178. :deep(.unlockingDialog) {
  4179. // height: 600px;
  4180. overflow: hidden;
  4181. border-radius: 11px;
  4182. .el-dialog__header {
  4183. border-radius: 11px 11px 0 0;
  4184. background: rgba(245, 249, 255, 1);
  4185. font-weight: 600;
  4186. height: 60px;
  4187. padding: 0 20px;
  4188. line-height: 60px;
  4189. margin: 0;
  4190. border-bottom: 1px solid rgba(230, 230, 230, 1);
  4191. .el-dialog__headerbtn {
  4192. outline: none;
  4193. }
  4194. }
  4195. .el-dialog__body {
  4196. padding: 0px 20px 20px 20px;
  4197. // height: 200px;
  4198. // display: flex;
  4199. // flex-direction: column-reverse;
  4200. .middle {
  4201. width: 96%;
  4202. color: #000;
  4203. .content {
  4204. height: 100px;
  4205. padding: 50px 0 0 0;
  4206. font-size: 16px;
  4207. letter-spacing: 1px;
  4208. }
  4209. .marning{
  4210. font-size:12px;
  4211. color:red
  4212. }
  4213. .options {
  4214. display: flex;
  4215. flex-direction: row-reverse;
  4216. align-items: center;
  4217. margin: 10px 0;
  4218. .queding {
  4219. margin-left: 20px;
  4220. }
  4221. }
  4222. .item {
  4223. display: flex;
  4224. align-items: center;
  4225. margin: 24px 0;
  4226. .title {
  4227. width: 100px;
  4228. text-align: right;
  4229. margin-right: 10px;
  4230. }
  4231. }
  4232. .againPass {
  4233. margin: 24px 0 40px 0;
  4234. }
  4235. }
  4236. }
  4237. }
  4238. // 批量导入
  4239. :deep(.bulkImportDialog) {
  4240. // height: 600px;
  4241. overflow: hidden;
  4242. border-radius: 11px;
  4243. .el-dialog__header {
  4244. border-radius: 11px 11px 0 0;
  4245. background: rgba(245, 249, 255, 1);
  4246. font-weight: 600;
  4247. height: 60px;
  4248. padding: 0 20px;
  4249. line-height: 60px;
  4250. margin: 0;
  4251. border-bottom: 1px solid rgba(230, 230, 230, 1);
  4252. .el-dialog__headerbtn {
  4253. outline: none;
  4254. }
  4255. }
  4256. .el-dialog__body {
  4257. padding: 20px 0 30px 0;
  4258. // height: 200px;
  4259. // display: flex;
  4260. // flex-direction: column-reverse;
  4261. .middle {
  4262. width: calc(100% - 40px);
  4263. color: #000;
  4264. .content {
  4265. height: 100px;
  4266. padding: 50px 0 0 20px;
  4267. font-size: 16px;
  4268. letter-spacing: 1px;
  4269. }
  4270. .options {
  4271. display: flex;
  4272. flex-direction: row-reverse;
  4273. align-items: center;
  4274. margin: 10px 0;
  4275. .queding {
  4276. margin-left: 20px;
  4277. }
  4278. }
  4279. .startImport {
  4280. .el-button {
  4281. width: 500px;
  4282. height: 42px;
  4283. }
  4284. .downLoad {
  4285. color: rgba(0, 97, 255, 1);
  4286. font-size: 14px;
  4287. margin-left: 15px;
  4288. cursor: pointer;
  4289. }
  4290. }
  4291. }
  4292. }
  4293. }
  4294. // 绑定设备弹窗
  4295. :deep(.BindingDialog) {
  4296. height: 300px;
  4297. overflow: hidden;
  4298. border-radius: 11px;
  4299. .el-dialog__header {
  4300. border-radius: 11px 11px 0 0;
  4301. background: rgba(245, 249, 255, 1);
  4302. font-weight: 600;
  4303. height: 60px;
  4304. padding: 0 20px;
  4305. line-height: 60px;
  4306. margin: 0;
  4307. border-bottom: 1px solid rgba(230, 230, 230, 1);
  4308. .el-dialog__headerbtn {
  4309. outline: none;
  4310. }
  4311. }
  4312. .el-dialog__body {
  4313. padding: 20px;
  4314. .middle {
  4315. width: 96%;
  4316. color: #000;
  4317. .options {
  4318. display: flex;
  4319. flex-direction: row-reverse;
  4320. align-items: center;
  4321. margin: 120px 0 0 0;
  4322. .el-form-item__content {
  4323. flex: none;
  4324. }
  4325. .queding {
  4326. margin-left: 20px;
  4327. }
  4328. }
  4329. }
  4330. }
  4331. }
  4332. // 设置临时总卡
  4333. :deep(.temporaryCardDialog) {
  4334. // height: 420px;
  4335. border-radius: 11px;
  4336. .el-dialog__header {
  4337. border-radius: 11px 11px 0 0;
  4338. background: rgba(237, 241, 245, 1);
  4339. font-weight: 600;
  4340. margin: 0;
  4341. .el-dialog__headerbtn {
  4342. outline: none;
  4343. }
  4344. }
  4345. .el-dialog__body {
  4346. padding: 30px 20px 10px 20px;
  4347. // .el-input {
  4348. // // width: 200px;
  4349. // .el-input__suffix-inner {
  4350. // color: rgba(61, 81, 232, 1);
  4351. // }
  4352. // }
  4353. .el-form-item__content {
  4354. width: 200px;
  4355. }
  4356. .options {
  4357. margin: 10px 20px 20px 0;
  4358. width: 100%;
  4359. .el-form-item__content {
  4360. display: flex;
  4361. flex-direction: row-reverse;
  4362. }
  4363. .queding {
  4364. color: #fff;
  4365. margin-left: 15px;
  4366. }
  4367. }
  4368. }
  4369. }
  4370. // 钥匙管理
  4371. :deep(.keyDialog) {
  4372. border-radius: 11px;
  4373. .el-dialog__header {
  4374. border-radius: 11px 11px 0 0;
  4375. background: rgba(237, 241, 245, 1);
  4376. font-weight: 600;
  4377. margin: 0;
  4378. .el-dialog__headerbtn {
  4379. outline: none;
  4380. }
  4381. }
  4382. .el-dialog__body {
  4383. // padding: 10px 20px 10px 20px;
  4384. max-height: 750px;
  4385. overflow: auto;
  4386. .el-form-item__content {
  4387. width: 200px;
  4388. }
  4389. .title {
  4390. margin: 20px;
  4391. box-sizing: border-box;
  4392. .keyTitle {
  4393. width: 1130px;
  4394. height: 50px;
  4395. background: rgba(235, 235, 235, 1);
  4396. display: flex;
  4397. justify-content: space-between;
  4398. align-items: center;
  4399. position: relative;
  4400. z-index: 99;
  4401. .Addkey {
  4402. width: 120px;
  4403. }
  4404. .txt {
  4405. color: rgba(0, 0, 0, 1);
  4406. margin-left: 25px;
  4407. font-weight: 400;
  4408. }
  4409. }
  4410. .el-collapse {
  4411. border: none;
  4412. position: relative;
  4413. top: -50px;
  4414. }
  4415. .el-collapse-item {
  4416. // border-radius: 5px;
  4417. .el-collapse-item__header {
  4418. border: none;
  4419. background: rgba(235, 235, 235, 1);
  4420. width: 33px;
  4421. height: 50px;
  4422. transform: translateX(1130px);
  4423. border-radius: 0;
  4424. outline: none;
  4425. }
  4426. .el-collapse-item__wrap {
  4427. border: 1px solid rgba(229, 229, 229, 1);
  4428. }
  4429. }
  4430. .el-collapse-item__content {
  4431. padding: 0;
  4432. .table {
  4433. width: 1160px;
  4434. margin: 20px auto;
  4435. .el-table--fit {
  4436. .el-table__header-wrapper {
  4437. font-size: 15px;
  4438. tr {
  4439. color: #000;
  4440. }
  4441. }
  4442. .el-table__row {
  4443. height: 50px;
  4444. font-size: 15px;
  4445. color: #000;
  4446. }
  4447. .el-table__row td {
  4448. padding: 0;
  4449. border: 0;
  4450. }
  4451. .el-table__body .even {
  4452. background-color: #fff;
  4453. }
  4454. .el-table__body .odd {
  4455. background-color: rgba(240, 243, 247, 1);
  4456. }
  4457. }
  4458. .options {
  4459. display: flex;
  4460. justify-content: center;
  4461. .reset {
  4462. margin: 0 5px;
  4463. color: rgba(0, 97, 255, 1);
  4464. cursor: pointer;
  4465. }
  4466. }
  4467. }
  4468. }
  4469. }
  4470. }
  4471. }
  4472. // 钥匙管理 密码管理
  4473. :deep(.passManagementDialog) {
  4474. // height: 420px;
  4475. border-radius: 11px;
  4476. .el-dialog__header {
  4477. border-radius: 11px 11px 0 0;
  4478. background: rgba(237, 241, 245, 1);
  4479. font-weight: 600;
  4480. margin: 0;
  4481. .el-dialog__headerbtn {
  4482. outline: none;
  4483. }
  4484. }
  4485. .el-dialog__body {
  4486. padding: 10px 20px 10px 20px;
  4487. // .el-input {
  4488. // // width: 200px;
  4489. // .el-input__suffix-inner {
  4490. // color: rgba(61, 81, 232, 1);
  4491. // }
  4492. // }
  4493. .el-form-item__content {
  4494. .el-input-group__append {
  4495. background-color: rgba(222, 234, 252, 1);
  4496. color: rgba(0, 97, 255, 1);
  4497. cursor: pointer;
  4498. user-select: none;
  4499. }
  4500. }
  4501. .options {
  4502. margin: 10px 20px 20px 0;
  4503. width: 100%;
  4504. .el-form-item__content {
  4505. display: flex;
  4506. flex-direction: row-reverse;
  4507. }
  4508. .queding {
  4509. color: #fff;
  4510. margin-left: 15px;
  4511. }
  4512. }
  4513. }
  4514. }
  4515. // 钥匙管理 添加指纹
  4516. :deep(.fingerprintDialog) {
  4517. // height: 420px;
  4518. border-radius: 11px;
  4519. .el-dialog__header {
  4520. border-radius: 11px 11px 0 0;
  4521. background: rgba(237, 241, 245, 1);
  4522. font-weight: 600;
  4523. margin: 0;
  4524. .el-dialog__headerbtn {
  4525. outline: none;
  4526. }
  4527. }
  4528. .el-dialog__body {
  4529. padding: 30px 20px 10px 20px;
  4530. .el-form-item__content {
  4531. width: 200px;
  4532. }
  4533. .options {
  4534. margin: 10px 20px 20px 0;
  4535. width: 100%;
  4536. .el-form-item__content {
  4537. display: flex;
  4538. flex-direction: row-reverse;
  4539. }
  4540. .options {
  4541. margin: 10px 20px 20px 0;
  4542. width: 100%;
  4543. .el-form-item__content {
  4544. display: flex;
  4545. flex-direction: row-reverse;
  4546. }
  4547. .queding {
  4548. color: #fff;
  4549. margin-left: 15px;
  4550. }
  4551. }
  4552. }
  4553. }
  4554. }
  4555. // 指纹弹窗
  4556. :deep(.fingerprint) {
  4557. width: 611px;
  4558. height: 486px;
  4559. border-radius: 11px;
  4560. .el-dialog__header {
  4561. border-radius: 11px 11px 0 0;
  4562. background: rgba(237, 241, 245, 1);
  4563. font-weight: 600;
  4564. margin: 0;
  4565. .el-dialog__headerbtn {
  4566. outline: none;
  4567. }
  4568. }
  4569. .el-dialog__body {
  4570. padding: 0;
  4571. .elbody {
  4572. display: flex;
  4573. justify-content: space-between;
  4574. align-items: center;
  4575. padding: 20px 20px;
  4576. font-size: 18px;
  4577. color: #000;
  4578. border-bottom: 0.5px solid #ccc;
  4579. i {
  4580. cursor: pointer;
  4581. }
  4582. }
  4583. }
  4584. .el-dialog__footer {
  4585. .el-button--primary {
  4586. background: rgba(41, 109, 227, 1);
  4587. }
  4588. }
  4589. }
  4590. // 钥匙管理 添加身份证
  4591. :deep(.identityCard) {
  4592. // height: 420px;
  4593. border-radius: 11px;
  4594. .el-dialog__header {
  4595. border-radius: 11px 11px 0 0;
  4596. background: rgba(237, 241, 245, 1);
  4597. font-weight: 600;
  4598. margin: 0;
  4599. .el-dialog__headerbtn {
  4600. outline: none;
  4601. }
  4602. }
  4603. .el-dialog__body {
  4604. padding: 30px 20px 10px 20px;
  4605. .el-form-item__content {
  4606. width: 200px;
  4607. }
  4608. .options {
  4609. margin: 10px 20px 20px 0;
  4610. width: 100%;
  4611. .el-form-item__content {
  4612. display: flex;
  4613. flex-direction: row-reverse;
  4614. }
  4615. .queding {
  4616. color: #fff;
  4617. margin-left: 15px;
  4618. }
  4619. }
  4620. }
  4621. }
  4622. // 身份证读取
  4623. :deep(.addIdentityCard) {
  4624. // height: 420px;
  4625. border-radius: 11px;
  4626. .el-dialog__header {
  4627. border-radius: 11px 11px 0 0;
  4628. background: rgba(237, 241, 245, 1);
  4629. font-weight: 600;
  4630. margin: 0;
  4631. .el-dialog__headerbtn {
  4632. outline: none;
  4633. }
  4634. }
  4635. .el-dialog__body {
  4636. padding: 30px 20px 10px 20px;
  4637. height: 330px;
  4638. font-size: 16px;
  4639. font-weight: 600;
  4640. color: #000;
  4641. .el-steps {
  4642. width: 600px;
  4643. transform: translateX(90px);
  4644. margin: 0 0 40px 0;
  4645. }
  4646. .title {
  4647. text-align: center;
  4648. }
  4649. .icons {
  4650. display: flex;
  4651. justify-content: center;
  4652. img {
  4653. width: 70px;
  4654. margin: 40px 0;
  4655. }
  4656. .loading {
  4657. animation: move 3s linear;
  4658. }
  4659. @keyframes move {
  4660. 0% {
  4661. transform: rotate(0);
  4662. }
  4663. 100% {
  4664. transform: rotate(360deg);
  4665. }
  4666. }
  4667. }
  4668. .retry {
  4669. text-align: center;
  4670. span {
  4671. color: red;
  4672. padding: 0 8px;
  4673. cursor: pointer;
  4674. }
  4675. }
  4676. }
  4677. }
  4678. </style>
  4679. <style lang="scss">
  4680. .roominfoPopper {
  4681. background: rgba(0, 0, 0, 0.8) !important;
  4682. border: none !important;
  4683. .el-popper__arrow::before {
  4684. background: rgba(0, 0, 0, 0.8) !important;
  4685. }
  4686. }
  4687. </style>