doorLock.vue 153 KB

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