fangtailive.vue 58 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800
  1. <template>
  2. <a-card :bordered="false">
  3. <a-tabs v-model="activeKey" type="card" @change="tabsClick">
  4. <a-tab-pane key="1" tab="实时房态"> </a-tab-pane>
  5. <a-tab-pane key="2" tab="日历房态"> </a-tab-pane>
  6. <a-tab-pane key="3" tab="客单"> </a-tab-pane>
  7. <a-tab-pane key="4" tab="远期房态"> </a-tab-pane>
  8. <a-tab-pane key="5" tab="物品租借"> </a-tab-pane>
  9. <a-tab-pane key="6" tab="客人留言"> </a-tab-pane>
  10. <a-tab-pane key="7" tab="客人物品管理"> </a-tab-pane>
  11. </a-tabs>
  12. <div
  13. v-if="activeKey === '1'"
  14. style="display: flex; height: calc(100vh - 240px)"
  15. >
  16. <div style="width: 80%" class="course-week">
  17. <div style="display: flex; flex-direction: column">
  18. <div style="display: flex; gap: 5px; flex-flow: wrap">
  19. <a-dropdown :disabled="scheduleBtnDis">
  20. <a-menu slot="overlay" @click="scheduleClick">
  21. <a-menu-item key="1"> 散客预定 </a-menu-item>
  22. <a-menu-item key="2"> 团队预定</a-menu-item>
  23. </a-menu>
  24. <a-button type="danger"> 预定 <a-icon type="down" /> </a-button>
  25. </a-dropdown>
  26. <a-dropdown :disabled="checkInBtnDis">
  27. <a-menu slot="overlay" @click="handleMenuClick">
  28. <a-menu-item key="1"> 散客入住 </a-menu-item>
  29. <a-menu-item key="2"> 团队入住</a-menu-item>
  30. </a-menu>
  31. <a-button type="danger">
  32. 入住 <a-icon type="down" />
  33. </a-button> </a-dropdown
  34. ><a-button
  35. style="margin-bottom: 10px"
  36. @click="handleClean"
  37. :disabled="cleanDisabled"
  38. type="danger"
  39. >置干净</a-button
  40. ><a-button
  41. style="margin-bottom: 10px"
  42. @click="handleDirty"
  43. type="danger"
  44. :disabled="dirtyDisabled"
  45. >置脏</a-button
  46. >
  47. <a-button
  48. v-if="wxCompleteBtn"
  49. style="margin-bottom: 10px"
  50. @click="handleCompleteRepair"
  51. type="danger"
  52. >完成维修</a-button
  53. >
  54. <a-button
  55. v-else
  56. style="margin-bottom: 10px"
  57. @click="handleWx"
  58. :disabled="lockDisabled"
  59. type="danger"
  60. >置维修</a-button
  61. >
  62. <a-button
  63. v-if="offLockBtn"
  64. style="margin-bottom: 10px"
  65. @click="handleOffLock"
  66. type="danger"
  67. >解锁</a-button
  68. ><a-button
  69. v-else
  70. style="margin-bottom: 10px"
  71. @click="handleLock"
  72. :disabled="lockDisabled"
  73. type="danger"
  74. >锁房</a-button
  75. >
  76. <a-button
  77. disabled
  78. style="margin-bottom: 10px"
  79. @click="handleAdd"
  80. type="danger"
  81. >联房</a-button
  82. ><a-button
  83. disabled
  84. style="margin-bottom: 10px"
  85. @click="handleAdd"
  86. type="danger"
  87. >批量制卡</a-button
  88. >
  89. <!-- <a-button style="margin-bottom: 10px" @click="toPage" type="danger"
  90. >查询散客详单</a-button
  91. >
  92. <a-button
  93. style="margin-bottom: 10px"
  94. @click="toTeamPage"
  95. type="danger"
  96. >查询团队详单</a-button
  97. > -->
  98. </div>
  99. <div class="week-top">
  100. <div class="w-choose-status">
  101. <div v-for="sta in roomStatusColorList">
  102. <span class="square" :style="{ background: sta.extend }"></span>
  103. <span class="title">{{ sta.title }}</span>
  104. </div>
  105. </div>
  106. <div class="w-choose-status">
  107. 批量操作<a-switch
  108. v-model="multipleRoom"
  109. @change="multipleRoomChange"
  110. />
  111. </div>
  112. </div>
  113. </div>
  114. <div class="week-table" style="overflow: hidden auto">
  115. <div id="components-grid-demo-playground" class="w-time-period-list">
  116. <div
  117. v-for="(period, cIndex) in roomList"
  118. :key="`period${cIndex}`"
  119. style="padding: 5px"
  120. >
  121. <p>
  122. <span style="color: rgba(0, 186, 173, 1); font-weight: 600">
  123. {{ period.buildingName }}{{ period.name }}
  124. </span>
  125. <a-divider type="vertical" />
  126. <span style="padding-right: 5px"
  127. >{{ period.rooms.length }}间:在住{{
  128. checkInCount(period.rooms)
  129. }}间/空置{{ vacantCount(period.rooms) }}间</span
  130. >
  131. <a-icon
  132. type="right"
  133. v-if="period.collapse == 0"
  134. @click="collapseClick(period, 1)"
  135. />
  136. <a-icon type="down" v-else @click="collapseClick(period, 0)" />
  137. </p>
  138. <a-row :gutter="[5, 5]" v-show="period.collapse == 1">
  139. <a-col
  140. v-for="(roomLive, roomLiveIndex) in period.rooms"
  141. :key="`period${cIndex}roomLive${roomLiveIndex}`"
  142. :span="3"
  143. @click.stop="roomItemClick(roomLive)"
  144. @dblclick.stop="handleBillInfo(roomLive)"
  145. >
  146. <!-- <div class="post-mark"></div> -->
  147. <div
  148. class="room-item"
  149. :style="{
  150. background:
  151. roomStatusColorList && roomStatusColorList.length > 0
  152. ? getRoomStatusColor(roomLive.roomInfo.roomStatus)
  153. : '',
  154. }"
  155. >
  156. <div
  157. class="select-cell"
  158. v-if="roomLive.roomInfo.state == 88"
  159. >
  160. <a-icon
  161. type="check-circle"
  162. theme="twoTone"
  163. two-tone-color="#52c41a"
  164. style="font-size: 40px"
  165. />
  166. </div>
  167. <a-popover placement="rightTop">
  168. <template
  169. slot="content"
  170. v-if="
  171. roomLive.livingData && roomLive.livingData.livingOrder
  172. "
  173. >
  174. <p>
  175. 入住:{{ roomLive.livingData.livingOrder.arrivalTime }}
  176. </p>
  177. <p>
  178. 预离:{{ roomLive.livingData.livingOrder.dueOutTime }}
  179. </p>
  180. <p>
  181. 已住:{{
  182. roomLive.livingData.livingOrder.liveDayCount
  183. }}晚 已付:{{
  184. roomLive.livingData.livingOrder.shouKuan
  185. }}元
  186. </p>
  187. <!-- <p>来源:{{ roomLive.detail.mobile }} 消费:300元</p> -->
  188. <p>
  189. 房价:{{
  190. roomLive.livingData.price &&
  191. roomLive.livingData.price.length > 0
  192. ? roomLive.livingData.price[0].price
  193. : 0
  194. }}/晚 余额:{{
  195. roomLive.livingData.livingOrder.shouKuan -
  196. roomLive.livingData.livingOrder.xiaoFei
  197. }}
  198. <!-- {{ roomLive.detail.balance }} -->
  199. </p>
  200. <p>
  201. 来源:{{
  202. getCustomerSourceList(
  203. roomLive.livingData.livingOrder.customerSource
  204. )
  205. }}
  206. </p>
  207. <p>注:{{ roomLive.livingData.livingOrder.remark }}</p>
  208. </template>
  209. <template
  210. slot="title"
  211. v-if="
  212. roomLive.livingData && roomLive.livingData.livingOrder
  213. "
  214. >
  215. <p>
  216. 客人姓名:{{
  217. roomLive.livingData.livingCustomers
  218. ? roomLive.livingData.livingCustomers.customerName
  219. : ""
  220. }}
  221. 性别:{{
  222. roomLive.livingData.livingCustomers
  223. ? roomLive.livingData.livingCustomers.gender == 1
  224. ? "男"
  225. : "女"
  226. : ""
  227. }}
  228. </p>
  229. <p>
  230. 手机号:{{
  231. roomLive.livingData.livingCustomers
  232. ? roomLive.livingData.livingCustomers.phone
  233. : ""
  234. }}
  235. </p>
  236. <!-- <p>同住人:{{ roomLive.detail.mobile }} 性别:女</p> -->
  237. </template>
  238. <template
  239. slot="content"
  240. v-if="
  241. !roomLive.livingData ||
  242. !roomLive.livingData.livingOrder
  243. "
  244. >
  245. <p>
  246. 房态:{{
  247. getRoomStatusName(roomLive.roomInfo.roomStatus)
  248. }}
  249. </p>
  250. <p
  251. v-if="
  252. roomLive.bookingData &&
  253. roomLive.bookingData.bookingCustomer
  254. "
  255. >
  256. 预定人:{{
  257. roomLive.bookingData.bookingCustomer.name
  258. }}
  259. </p>
  260. <p
  261. v-if="
  262. roomLive.bookingData &&
  263. roomLive.bookingData.bookingCustomer
  264. "
  265. >
  266. 手机:{{ roomLive.bookingData.bookingCustomer.phone }}
  267. </p>
  268. <p
  269. v-if="
  270. roomLive.bookingData &&
  271. roomLive.bookingData.bookingOrder
  272. "
  273. >
  274. 预抵日:{{
  275. roomLive.bookingData.bookingOrder.arrivalTime
  276. }}
  277. </p>
  278. <!-- <p>
  279. 备注:{{ roomLive.livingData.livingOrder.remark }}
  280. </p> -->
  281. </template>
  282. <template
  283. slot="title"
  284. v-if="
  285. !roomLive.livingData ||
  286. !roomLive.livingData.livingOrder
  287. "
  288. >
  289. <span>{{ roomLive.layout.name }}</span
  290. ><span>¥{{ roomLive.layout.marketPrice }}/晚</span>
  291. </template>
  292. <a-dropdown :trigger="['contextmenu']">
  293. <div style="height: 100%">
  294. <div
  295. style="
  296. text-overflow: ellipsis;
  297. white-space: nowrap;
  298. overflow: hidden;
  299. "
  300. >
  301. <span
  302. style="
  303. font-size: 20px;
  304. font-weight: 600;
  305. margin-right: 2px;
  306. "
  307. >{{ roomLive.roomInfo.name }}</span
  308. >
  309. {{ roomLive.layout.name }}
  310. </div>
  311. <template
  312. v-if="
  313. roomLive.livingData &&
  314. roomLive.livingData.livingOrder
  315. "
  316. >
  317. <!-- <div>
  318. <span style="margin-right: 5px">{{
  319. roomLive.detail.occupant
  320. }}</span
  321. ><a-tag
  322. :style="{
  323. color:
  324. sourceType[roomLive.detail.source || 1]
  325. .color,
  326. }"
  327. >携</a-tag
  328. >
  329. </div> -->
  330. <div>
  331. <span>
  332. {{
  333. roomLive.livingData.livingCustomers
  334. .customerName
  335. }}
  336. <a-tag
  337. color="pink"
  338. v-if="
  339. roomLive.livingData.livingOrder
  340. .vipCustomerId
  341. "
  342. >
  343. vip
  344. </a-tag>
  345. </span>
  346. </div>
  347. <div>
  348. <span
  349. >{{
  350. roomLive.livingData.livingOrder.liveDayCount
  351. }}天/{{
  352. roomLive.livingData.livingOrder.arrivalTime.substr(
  353. 5,
  354. 5
  355. )
  356. }}</span
  357. >
  358. </div>
  359. <div
  360. style="
  361. text-overflow: ellipsis;
  362. white-space: nowrap;
  363. overflow: hidden;
  364. "
  365. >
  366. <!-- <span
  367. >¥{{ roomLive.detail.amout }}/付{{
  368. roomLive.detail.payAmount
  369. }}/余{{ roomLive.detail.balance }}</span
  370. > -->
  371. <span
  372. >¥{{
  373. roomLive.livingData.price &&
  374. roomLive.livingData.price.length > 0
  375. ? roomLive.livingData.price[0].price
  376. : 0
  377. }}/付{{
  378. roomLive.livingData &&
  379. roomLive.livingData.livingOrder
  380. ? roomLive.livingData.livingOrder.shouKuan
  381. : 0
  382. }}/余{{
  383. roomLive.livingData &&
  384. roomLive.livingData.livingOrder
  385. ? roomLive.livingData.livingOrder.shouKuan -
  386. roomLive.livingData.livingOrder.xiaoFei
  387. : 0
  388. }}</span
  389. >
  390. </div>
  391. <a-tag
  392. color="blue"
  393. v-if="
  394. roomLive.livingData &&
  395. roomLive.livingData.livingOrder &&
  396. roomLive.livingData.livingOrder.shouKuan -
  397. roomLive.livingData.livingOrder.xiaoFei <
  398. 0
  399. "
  400. >欠</a-tag
  401. >
  402. <a-tag
  403. color="blue"
  404. v-if="
  405. roomLive.livingData &&
  406. roomLive.livingData.livingOrder &&
  407. roomLive.livingData.livingOrder.livingType == 2
  408. "
  409. >钟</a-tag
  410. >
  411. <a-tag
  412. color="blue"
  413. v-if="
  414. roomLive.livingData &&
  415. roomLive.livingData.livingOrder &&
  416. roomLive.livingData.livingOrder.isTeam
  417. "
  418. >团</a-tag
  419. ><a-tag
  420. color="blue"
  421. v-if="
  422. roomLive.livingData &&
  423. roomLive.livingData.livingOrder &&
  424. roomLive.livingData.livingOrder.dueOutTime ==
  425. currentDate
  426. "
  427. >离</a-tag
  428. >
  429. <a-tag color="blue">{{
  430. getCustomerSourceList(
  431. roomLive.livingData.livingOrder.customerSource,
  432. true
  433. )
  434. }}</a-tag>
  435. </template>
  436. <template v-else>
  437. <div>
  438. <span
  439. >¥{{ roomLive.layout.marketPrice }}/晚</span
  440. >
  441. </div>
  442. <div>
  443. <span
  444. v-if="
  445. roomLive.bookingData &&
  446. roomLive.bookingData.bookingOrder &&
  447. roomLive.bookingData.bookingCustomer
  448. "
  449. >
  450. {{ roomLive.bookingData.bookingCustomer.name }}
  451. </span>
  452. </div>
  453. <div>
  454. <span
  455. v-if="
  456. roomLive.bookingData &&
  457. roomLive.bookingData.bookingOrder
  458. "
  459. >
  460. {{
  461. roomLive.bookingData.bookingOrder.dayCount
  462. }}天/{{
  463. roomLive.bookingData.bookingOrder.arrivalTime.substr(
  464. 5,
  465. 5
  466. )
  467. }}
  468. </span>
  469. </div>
  470. <!-- <div
  471. style="
  472. margin-top: 22px;
  473. text-overflow: ellipsis;
  474. white-space: nowrap;
  475. overflow: hidden;
  476. "
  477. >
  478. <span
  479. >注:{{
  480. roomLive.livingData.livingOrder.remark
  481. }}</span
  482. >
  483. </div> -->
  484. <a-tag
  485. v-if="
  486. roomLive.bookingData &&
  487. roomLive.bookingData.bookingOrder
  488. "
  489. >订</a-tag
  490. >
  491. </template>
  492. </div>
  493. <a-menu
  494. slot="overlay"
  495. style="width: 126px"
  496. @click="(e) => onMenuClick(e, roomLive)"
  497. >
  498. <template
  499. v-if="
  500. roomLive.roomInfo.roomStatus === 3 ||
  501. roomLive.roomInfo.roomStatus === 4
  502. "
  503. >
  504. <a-menu-item key="6"> 详单 </a-menu-item>
  505. <a-menu-item key="7"> 账单 </a-menu-item>
  506. </template>
  507. <a-menu-item
  508. key="1"
  509. v-if="
  510. !roomLive.livingData ||
  511. !roomLive.livingData.livingOrder
  512. "
  513. >
  514. 入住
  515. </a-menu-item>
  516. <a-menu-item
  517. key="2"
  518. v-if="
  519. !roomLive.livingData ||
  520. !roomLive.livingData.livingOrder
  521. "
  522. >
  523. 预定</a-menu-item
  524. >
  525. <a-menu-item
  526. key="31"
  527. v-if="roomLive.roomInfo.roomStatus === 2"
  528. >
  529. 置干净
  530. </a-menu-item>
  531. <a-menu-item key="3" v-else> 置脏 </a-menu-item>
  532. <template
  533. v-if="
  534. roomLive.roomInfo.roomStatus !== 3 &&
  535. roomLive.roomInfo.roomStatus !== 4
  536. "
  537. >
  538. <a-menu-item
  539. key="41"
  540. v-if="roomLive.roomInfo.roomStatus === 5"
  541. >
  542. 完成维修
  543. </a-menu-item>
  544. <a-menu-item key="4" v-else> 置维修 </a-menu-item>
  545. <a-menu-item
  546. key="51"
  547. v-if="roomLive.roomInfo.roomStatus === 6"
  548. >
  549. 解锁
  550. </a-menu-item>
  551. <a-menu-item key="5" v-else> 锁房 </a-menu-item>
  552. </template>
  553. <template
  554. v-if="
  555. roomLive.roomInfo.roomStatus === 3 ||
  556. roomLive.roomInfo.roomStatus === 4
  557. "
  558. >
  559. <a-menu-item key="8"> 查房 </a-menu-item>
  560. <a-menu-item key="9"> 入账 </a-menu-item>
  561. <a-menu-item key="10"> 续租/提前 </a-menu-item>
  562. <a-menu-item key="11"> 制房卡 </a-menu-item>
  563. <a-menu-item key="12"> 注销房卡 </a-menu-item>
  564. <a-menu-item key="13"> 换房 </a-menu-item>
  565. <a-menu-item key="14"> 合并联房 </a-menu-item>
  566. <a-menu-item key="15"> 添加同住 </a-menu-item>
  567. <a-menu-item key="16"> 结账退房 </a-menu-item>
  568. <a-menu-item key="17"> 撤销入住 </a-menu-item>
  569. </template>
  570. <a-menu-item key="18"> 日志 </a-menu-item>
  571. </a-menu>
  572. </a-dropdown>
  573. </a-popover>
  574. </div>
  575. </a-col>
  576. </a-row>
  577. </div>
  578. </div>
  579. </div>
  580. </div>
  581. <div style="width: 1%"></div>
  582. <div style="width: 19%; overflow: hidden auto">
  583. <div>
  584. <a-input-search
  585. style="width: 100%; margin-bottom: 8px"
  586. placeholder="房间号/姓名/手机号/身份证号"
  587. enter-button="搜索"
  588. v-model="keyWord"
  589. type="danger"
  590. @search="checkChange"
  591. />
  592. </div>
  593. <p style="font-size: 16px; font-weight: 600; color: rgb(0, 186, 173)">
  594. 按楼层
  595. </p>
  596. <a-tree-select
  597. style="width: 100%"
  598. v-model="checkedroomBuildingFloorList"
  599. :tree-data="roomBuildingFloorTree"
  600. tree-checkable
  601. :show-checked-strategy="SHOW_PARENT"
  602. :replaceFields="{
  603. children: 'children',
  604. title: 'name',
  605. key: 'id',
  606. value: 'id',
  607. }"
  608. @change="checkChange"
  609. />
  610. <p
  611. style="
  612. font-size: 16px;
  613. font-weight: 600;
  614. color: rgb(0, 186, 173);
  615. margin-top: 10px;
  616. "
  617. >
  618. 按房态
  619. </p>
  620. <a-checkbox-group
  621. v-model="checkedRoomStatusList"
  622. :options="roomStatusList"
  623. @change="checkChange"
  624. >
  625. </a-checkbox-group>
  626. <p
  627. style="
  628. font-size: 16px;
  629. font-weight: 600;
  630. color: rgb(0, 186, 173);
  631. margin-top: 10px;
  632. "
  633. >
  634. 按来源
  635. </p>
  636. <a-checkbox-group
  637. v-model="checkedCustomerSourceList"
  638. :options="customerSourceList"
  639. @change="checkChange"
  640. >
  641. </a-checkbox-group>
  642. <p
  643. style="
  644. font-size: 16px;
  645. font-weight: 600;
  646. color: rgb(0, 186, 173);
  647. margin-top: 10px;
  648. "
  649. >
  650. 按房型
  651. </p>
  652. <a-checkbox-group
  653. v-model="checkedCesRoomLayoutList"
  654. :options="cesRoomLayoutList"
  655. @change="checkChange"
  656. >
  657. </a-checkbox-group>
  658. </div>
  659. </div>
  660. <template v-else-if="activeKey === '2'">
  661. <calendarfangtai> </calendarfangtai>
  662. </template>
  663. <template v-else-if="activeKey === '3'">
  664. <guestorders></guestorders>
  665. </template>
  666. <template v-else-if="activeKey === '4'">
  667. <forwardfangtai></forwardfangtai>
  668. </template>
  669. <template v-else-if="activeKey === '5'">
  670. <leasegoods></leasegoods>
  671. </template>
  672. <template v-else-if="activeKey === '6'">
  673. <membermessage></membermessage>
  674. </template>
  675. <template v-else-if="activeKey === '7'">
  676. <membergoodsmanage></membergoodsmanage>
  677. </template>
  678. <upkeep-room-modal ref="modalForm" @ok="modalWxFormOk"></upkeep-room-modal>
  679. <bill-room-info-modal
  680. ref="ModalBillRoomInfo"
  681. @ok="modalLockRoomFormOk"
  682. ></bill-room-info-modal>
  683. <bill-room-form-modal
  684. ref="ModalBillRoomForm"
  685. @ok="modalBillRoomFormOk"
  686. ></bill-room-form-modal>
  687. <schedule-room-modal
  688. ref="ModalScheduleRoom"
  689. @ok="modalFormOk"
  690. ></schedule-room-modal>
  691. <schedule-team-room-modal
  692. ref="ModalScheduleTeamRoom"
  693. @ok="modalTeamFormOk"
  694. ></schedule-team-room-modal>
  695. <edit-schedule-room-modal
  696. ref="ModalEditScheduleRoom"
  697. @ok="modalFormOk"
  698. ></edit-schedule-room-modal>
  699. <lock-room-modal
  700. ref="ModalLockRoom"
  701. @ok="modalLockRoomFormOk"
  702. ></lock-room-modal>
  703. <clean-room-modal
  704. ref="ModalCleanRoom"
  705. @ok="modalLockRoomFormOk"
  706. ></clean-room-modal>
  707. </a-card>
  708. </template>
  709. <script>
  710. import "@/assets/less/TableExpand.less";
  711. // import { mixinDevice } from "@/utils/mixin";
  712. // import { JeecgListMixin } from "@/mixins/JeecgListMixin";
  713. import { httpAction, getAction, postAction } from "@/api/manage";
  714. import UpkeepRoomModal from "./modules/upkeep/UpkeepRoomModal.vue";
  715. import BillRoomInfoModal from "./modules/checkIn/BillRoomInfoModal.vue";
  716. import BillRoomFormModal from "./modules/checkIn/BillRoomFormModal.vue";
  717. import ScheduleRoomModal from "./modules/schedule/ScheduleRoomModal.vue";
  718. import ScheduleTeamRoomModal from "./modules/scheduleTeam/ScheduleRoomModal.vue";
  719. import EditScheduleRoomModal from "./modules/schedule/EditScheduleRoomModal.vue";
  720. import LockRoomModal from "./modules/lock/LockRoomModal.vue";
  721. import CleanRoomModal from "./modules/clean/CleanRoomModal.vue";
  722. import calendarfangtai from "./calendarfangtai";
  723. import forwardfangtai from "./forwardfangtai";
  724. import guestorders from "./guestorders";
  725. import leasegoods from "./leasegoods";
  726. import membermessage from "./membermessage";
  727. import membergoodsmanage from "./membergoodsmanage";
  728. import { TreeSelect } from "ant-design-vue";
  729. import moment from "moment";
  730. const SHOW_PARENT = TreeSelect.SHOW_PARENT;
  731. export default {
  732. name: "BusMeetingRoomList",
  733. // mixins: [JeecgListMixin, mixinDevice],
  734. components: {
  735. UpkeepRoomModal,
  736. BillRoomInfoModal,
  737. BillRoomFormModal,
  738. ScheduleRoomModal,
  739. ScheduleTeamRoomModal,
  740. EditScheduleRoomModal,
  741. calendarfangtai,
  742. guestorders,
  743. forwardfangtai,
  744. leasegoods,
  745. membermessage,
  746. membergoodsmanage,
  747. LockRoomModal,
  748. CleanRoomModal,
  749. },
  750. data() {
  751. return {
  752. currentDate: moment(new Date()).format("YYYY-MM-DD"),
  753. activeKey: "1",
  754. timeId: null,
  755. multipleRoom: false,
  756. keyWord: "",
  757. checkedroomBuildingFloorList: [],
  758. SHOW_PARENT,
  759. cardStatus: {
  760. 0: {
  761. title: "空净",
  762. color: "rgba(67, 207, 124, 1)",
  763. },
  764. 1: {
  765. title: "在住",
  766. color: "#00a0e9",
  767. },
  768. 2: {
  769. title: "今日预离",
  770. color: "rgba(10, 122, 114, 1)",
  771. },
  772. 3: {
  773. title: "欠费",
  774. color: "rgba(172, 51, 193, 1)",
  775. },
  776. 4: {
  777. title: "锁房/脏房",
  778. color: "rgba(128, 128, 128, 1)",
  779. },
  780. },
  781. sourceType: {
  782. 0: {
  783. title: "美团",
  784. color: "rgba(67, 207, 124, 1)",
  785. },
  786. 1: {
  787. title: "携程",
  788. color: "#00a0e9",
  789. },
  790. 2: {
  791. title: "飞猪",
  792. color: "rgba(10, 122, 114, 1)",
  793. },
  794. 3: {
  795. title: "去哪儿",
  796. color: "rgba(172, 51, 193, 1)",
  797. },
  798. 4: {
  799. title: "同程艺龙",
  800. color: "rgba(128, 128, 128, 1)",
  801. },
  802. 5: {
  803. title: "微信订房",
  804. color: "rgba(128, 128, 128, 1)",
  805. },
  806. },
  807. startDate: "",
  808. endDate: "",
  809. customerSourceList: [],
  810. checkedCustomerSourceList: [],
  811. cesRoomLayoutList: [],
  812. checkedCesRoomLayoutList: [],
  813. roomBuildingFloorTree: [],
  814. roomStatusColorList: [],
  815. roomList: [],
  816. oldRoomList: [],
  817. roomStatusList: [],
  818. checkedRoomStatusList: [],
  819. scheduleBtnDis: false,
  820. checkInBtnDis: false,
  821. };
  822. },
  823. watch: {
  824. activeKey(key) {
  825. console.log("activeKey", key);
  826. },
  827. },
  828. computed: {
  829. lockDisabled() {
  830. return !this.roomList.some((t) =>
  831. t.rooms.some((c) => c.roomInfo.state === 88)
  832. );
  833. },
  834. offLockBtn() {
  835. return this.roomList.some((t) =>
  836. t.rooms.some(
  837. (c) => c.roomInfo.state === 88 && c.roomInfo.roomStatus === 6
  838. )
  839. );
  840. },
  841. wxCompleteBtn() {
  842. return this.roomList.some((t) =>
  843. t.rooms.some(
  844. (c) => c.roomInfo.state === 88 && c.roomInfo.roomStatus === 5
  845. )
  846. );
  847. },
  848. cleanDisabled() {
  849. return !this.roomList.some((t) =>
  850. t.rooms.some(
  851. (c) =>
  852. c.roomInfo.state === 88 &&
  853. (c.roomInfo.roomStatus === 2 || c.roomInfo.roomStatus === 4)
  854. )
  855. );
  856. },
  857. dirtyDisabled() {
  858. return !this.roomList.some((t) =>
  859. t.rooms.some(
  860. (c) =>
  861. c.roomInfo.state === 88 &&
  862. (c.roomInfo.roomStatus === 1 || c.roomInfo.roomStatus === 3)
  863. )
  864. );
  865. },
  866. },
  867. created() {
  868. // 禁用右键
  869. // document.oncontextmenu = new Function("event.returnValue=false");
  870. var _info = JSON.parse(localStorage.getItem("storeInfo"));
  871. // if (_info) {
  872. // this.model.hotelId = _info.id;
  873. // }
  874. getAction("/business/busDictItem/list", {
  875. hotelId: _info.id,
  876. dictId: "1639538915239743490",
  877. }).then((res) => {
  878. if (res.success) {
  879. var list = [];
  880. res.result.records.forEach((item) => {
  881. list.push({ label: item.itemText, value: item.id });
  882. });
  883. this.customerSourceList = list;
  884. }
  885. });
  886. getAction("/rooms/cesRoomLayout/list", {
  887. pageSize: 99999,
  888. pageNo: 1,
  889. }).then((res) => {
  890. if (res.success) {
  891. var list = [];
  892. res.result.records.forEach((item) => {
  893. list.push({ label: item.name, value: item.id });
  894. });
  895. this.cesRoomLayoutList = list;
  896. }
  897. });
  898. getAction("/rooms/cesRoomBuildingFloor/tree", {}).then((res) => {
  899. if (res.success) {
  900. this.roomBuildingFloorTree = res.result;
  901. }
  902. });
  903. getAction("/rooms/cesRooms/room-status-color", {}).then((res) => {
  904. if (res.success) {
  905. this.roomStatusColorList = res.result;
  906. var list = [];
  907. res.result.forEach((item) => {
  908. list.push({ label: item.title, value: item.value });
  909. });
  910. this.roomStatusList = list;
  911. }
  912. });
  913. this.loadData();
  914. },
  915. mounted() {
  916. // this.handleBillInfo();
  917. // this.handleCheckInAdd()
  918. // this.$refs.ModalScheduleRoom.addList([]);
  919. // this.$refs.ModalScheduleRoom.title = "预定登记";
  920. // this.$refs.ModalScheduleRoom.disableSubmit = false;
  921. // this.$refs.ModalScheduleTeamRoom.addList([]);
  922. // this.$refs.ModalScheduleTeamRoom.title = "团队预定登记";
  923. // this.$refs.ModalScheduleTeamRoom.disableSubmit = false;
  924. // this.$refs.ModalEditScheduleRoom.addList([]);
  925. // this.$refs.ModalEditScheduleRoom.title = "详单";
  926. // this.$refs.ModalEditScheduleRoom.disableSubmit = false;
  927. },
  928. methods: {
  929. moment,
  930. getCustomerSourceList(customerSource, first) {
  931. var find = this.customerSourceList.find((t) => t.value == customerSource);
  932. if (find) {
  933. return first ? find.label.substr(0, 1) : find.label;
  934. }
  935. return "";
  936. },
  937. checkInCount(rooms) {
  938. return rooms.filter((t) => t.livingData && t.livingData.livingOrder)
  939. .length;
  940. },
  941. vacantCount(rooms) {
  942. return rooms.filter((t) => !t.livingData || !t.livingData.livingOrder)
  943. .length;
  944. },
  945. tabsClick(e) {
  946. if (e == "1") {
  947. this.loadData();
  948. }
  949. },
  950. getRoomStatusColor(roomStatus) {
  951. var find = this.roomStatusColorList.find((t) => t.value == roomStatus);
  952. return find ? find.extend : "";
  953. },
  954. getRoomStatusName(roomStatus) {
  955. var find = this.roomStatusList.find((t) => t.value == roomStatus);
  956. return find ? find.label : "";
  957. },
  958. toPage() {
  959. this.$router.push({
  960. // path: "/room/scheduledetail",
  961. // query: { id: "YD20230331112026203" },
  962. name: "room-scheduledetail",
  963. params: { id: "YD20230331112026203" },
  964. });
  965. },
  966. toTeamPage() {
  967. this.$router.push({
  968. // path: "/room/scheduleteamdetail",
  969. // query: { id: "YD20230403170240075" },
  970. name: "room-scheduleteamdetail",
  971. params: { id: "YD20230403170240075" },
  972. });
  973. },
  974. addScheduleTeam() {
  975. this.$refs.ModalScheduleTeamRoom.addList([]);
  976. this.$refs.ModalScheduleTeamRoom.title = "团队预定登记";
  977. this.$refs.ModalScheduleTeamRoom.disableSubmit = false;
  978. },
  979. scheduleClick(e) {
  980. var selectRoom = [];
  981. this.roomList.forEach((t) => {
  982. t.rooms.forEach((c) => {
  983. if (c.roomInfo.state === 88) {
  984. c.roomInfo.marketPrice = c.layout.marketPrice;
  985. selectRoom.push(c.roomInfo);
  986. }
  987. });
  988. });
  989. this.$refs.ModalScheduleRoom.addList(selectRoom, e.key);
  990. this.$refs.ModalScheduleRoom.title =
  991. e.key == "1" ? "散客预定登记" : "团队预定登记";
  992. this.$refs.ModalScheduleRoom.disableSubmit = false;
  993. },
  994. handleMenuClick(e) {
  995. console.log("click", e);
  996. var selectRoom = [];
  997. this.roomList.forEach((t) => {
  998. t.rooms.forEach((c) => {
  999. if (c.roomInfo.state === 88) {
  1000. c.roomInfo.marketPrice = c.layout.marketPrice;
  1001. selectRoom.push(c.roomInfo);
  1002. }
  1003. });
  1004. });
  1005. this.$refs.ModalBillRoomForm.addList(selectRoom, e.key);
  1006. this.$refs.ModalBillRoomForm.title =
  1007. e.key == "1" ? "散客入住登记" : "团队入住登记";
  1008. this.$refs.ModalBillRoomForm.disableSubmit = false;
  1009. },
  1010. roomItemClick(roomLive) {
  1011. // 清除上一次的定时器
  1012. if (this.timeId) {
  1013. clearTimeout(this.timeId);
  1014. }
  1015. this.timeId = setTimeout(() => {
  1016. if (!this.multipleRoom && roomLive.roomInfo.state !== 88) {
  1017. this.roomList.forEach((item) => {
  1018. item.rooms.forEach((c) => {
  1019. if (c.roomInfo.state === 88) {
  1020. c.roomInfo.state = 0;
  1021. }
  1022. });
  1023. });
  1024. }
  1025. if (roomLive.roomInfo.state !== 88) {
  1026. roomLive.roomInfo.state = 88;
  1027. if (roomLive.livingData && roomLive.livingData.livingOrder) {
  1028. this.checkInBtnDis = true;
  1029. } else {
  1030. this.checkInBtnDis = false;
  1031. }
  1032. if (
  1033. (roomLive.livingData && roomLive.livingData.livingOrder) ||
  1034. (roomLive.bookingData && roomLive.bookingData.bookingOrder)
  1035. ) {
  1036. this.scheduleBtnDis = true;
  1037. } else {
  1038. this.scheduleBtnDis = false;
  1039. }
  1040. } else {
  1041. roomLive.roomInfo.state = 0;
  1042. }
  1043. if (this.multipleRoom) {
  1044. this.checkInBtnDis = false;
  1045. this.scheduleBtnDis = false;
  1046. this.roomList.forEach((item) => {
  1047. item.rooms.forEach((c) => {
  1048. if (c.roomInfo.state === 88) {
  1049. if (!this.checkInBtnDis) {
  1050. if (c.livingData && c.livingData.livingOrder) {
  1051. this.checkInBtnDis = true;
  1052. } else {
  1053. this.checkInBtnDis = false;
  1054. }
  1055. }
  1056. if (!this.scheduleBtnDis) {
  1057. if (
  1058. (c.livingData && c.livingData.livingOrder) ||
  1059. (c.bookingData && c.bookingData.bookingOrder)
  1060. ) {
  1061. this.scheduleBtnDis = true;
  1062. } else {
  1063. this.scheduleBtnDis = false;
  1064. }
  1065. }
  1066. }
  1067. });
  1068. });
  1069. }
  1070. // 清除定时器
  1071. clearTimeout(this.timeId);
  1072. }, 200);
  1073. },
  1074. handleBillInfo(roomLive) {
  1075. console.log("handleBillInfo", roomLive);
  1076. if (this.timeId) {
  1077. clearTimeout(this.timeId);
  1078. }
  1079. if (!roomLive.livingData || !roomLive.livingData.livingOrder) {
  1080. if (!roomLive.bookingData || !roomLive.bookingData.bookingOrder) {
  1081. this.handleCheckInAdd(roomLive);
  1082. } else {
  1083. this.$router.push({
  1084. name: "room-scheduledetail",
  1085. params: { id: roomLive.bookingData.bookingOrder.bookingOrdersNo },
  1086. });
  1087. }
  1088. } else {
  1089. this.$refs.ModalBillRoomInfo.add(
  1090. roomLive.livingData.livingOrder.bookingOrderId,
  1091. 1
  1092. );
  1093. this.$refs.ModalBillRoomInfo.title = "账单";
  1094. this.$refs.ModalBillRoomInfo.disableSubmit = true;
  1095. }
  1096. roomLive.roomInfo.state = 0;
  1097. },
  1098. handleCheckInAdd(roomLive) {
  1099. if (this.timeId) {
  1100. clearTimeout(this.timeId);
  1101. }
  1102. roomLive.roomInfo.marketPrice = roomLive.layout.marketPrice;
  1103. this.$refs.ModalBillRoomForm.addList([roomLive.roomInfo], 1);
  1104. this.$refs.ModalBillRoomForm.title = "散客入住登记";
  1105. this.$refs.ModalBillRoomForm.disableSubmit = false;
  1106. },
  1107. multipleRoomChange() {
  1108. this.roomList.forEach((item) => {
  1109. item.rooms.forEach((c) => {
  1110. if (c.roomInfo.state == 88) {
  1111. c.roomInfo.state = 0;
  1112. }
  1113. });
  1114. });
  1115. },
  1116. onChange() {},
  1117. onCheck(value, label, extra) {
  1118. console.log("onCheck", value);
  1119. console.log(
  1120. "checkedroomBuildingFloorList",
  1121. this.checkedroomBuildingFloorList
  1122. );
  1123. },
  1124. checkChange(e) {
  1125. console.log("e", e);
  1126. console.log(
  1127. "checkedroomBuildingFloorList",
  1128. this.checkedroomBuildingFloorList
  1129. );
  1130. var list = this.oldRoomList;
  1131. if (this.checkedCesRoomLayoutList.length > 0) {
  1132. list = this.oldRoomList.reduce((acc, curr) => {
  1133. const rooms = curr.rooms.filter((room) =>
  1134. this.checkedCesRoomLayoutList.includes(room.layout.id)
  1135. );
  1136. acc.push({ ...curr, rooms });
  1137. return acc;
  1138. }, []);
  1139. }
  1140. if (this.checkedRoomStatusList.length > 0) {
  1141. list = list.reduce((acc, curr) => {
  1142. const rooms = curr.rooms.filter((room) =>
  1143. this.checkedRoomStatusList.includes(
  1144. room.roomInfo.roomStatus.toString()
  1145. )
  1146. );
  1147. acc.push({ ...curr, rooms });
  1148. return acc;
  1149. }, []);
  1150. }
  1151. if (this.checkedCustomerSourceList.length > 0) {
  1152. list = list.reduce((acc, curr) => {
  1153. const rooms = curr.rooms.filter((room) =>
  1154. room.livingData && room.livingData.livingOrder
  1155. ? this.checkedCustomerSourceList.includes(
  1156. room.livingData.livingOrder.customerSource
  1157. )
  1158. : room.bookingData && room.bookingData.bookingOrder
  1159. ? this.checkedCustomerSourceList.includes(
  1160. room.bookingData.bookingOrder.customerSource
  1161. )
  1162. : false
  1163. );
  1164. acc.push({ ...curr, rooms });
  1165. return acc;
  1166. }, []);
  1167. }
  1168. if (this.checkedroomBuildingFloorList.length > 0) {
  1169. list = list.filter(
  1170. (item) =>
  1171. this.checkedroomBuildingFloorList.includes(item.buildingId) ||
  1172. this.checkedroomBuildingFloorList.includes(item.id)
  1173. );
  1174. }
  1175. if (this.keyWord) {
  1176. //房号/姓名/手机号搜索
  1177. list = list.reduce((acc, curr) => {
  1178. const rooms = curr.rooms.filter(
  1179. (room) =>
  1180. room.roomInfo.name == this.keyWord ||
  1181. (room.livingData && room.livingData.livingCustomers
  1182. ? room.livingData.livingCustomers.customerName == this.keyWord
  1183. : room.bookingData && room.bookingData.bookingCustomer
  1184. ? room.bookingData.bookingCustomer.name == this.keyWord
  1185. : false) ||
  1186. (room.livingData && room.livingData.livingCustomers
  1187. ? room.livingData.livingCustomers.phone == this.keyWord
  1188. : room.bookingData && room.bookingData.bookingCustomer
  1189. ? room.bookingData.bookingCustomer.phone == this.keyWord
  1190. : false)
  1191. );
  1192. acc.push({ ...curr, rooms });
  1193. return acc;
  1194. }, []);
  1195. }
  1196. console.log("list2", list);
  1197. this.roomList = list;
  1198. },
  1199. // roomStatusChange(e) {
  1200. // console.log("e", e);
  1201. // var list = this.oldRoomList;
  1202. // if (this.checkedRoomStatusList.length > 0) {
  1203. // list = this.oldRoomList.reduce((acc, curr) => {
  1204. // const rooms = curr.rooms.filter((room) =>
  1205. // this.checkedRoomStatusList.includes(room.roomInfo.roomStatus.toString())
  1206. // );
  1207. // acc.push({ ...curr, rooms });
  1208. // return acc;
  1209. // }, []);
  1210. // }
  1211. // console.log("list2", list);
  1212. // this.roomList = list;
  1213. // },
  1214. collapseClick(row, value) {
  1215. this.$set(row, "collapse", value);
  1216. },
  1217. handleAdd(e) {
  1218. this.$refs.modalForm.add();
  1219. this.$refs.modalForm.title = "维修";
  1220. this.$refs.modalForm.disableSubmit = false;
  1221. },
  1222. modalWxFormOk() {
  1223. this.loadData();
  1224. },
  1225. handleWx() {
  1226. var selectRoom = [];
  1227. this.roomList.forEach((t) => {
  1228. t.rooms.forEach((c) => {
  1229. if (c.roomInfo.state === 88) {
  1230. selectRoom.push({ roomId: c.roomInfo.id, roomNo: c.roomInfo.name });
  1231. }
  1232. });
  1233. });
  1234. if (selectRoom.length === 0) {
  1235. this.$message.warning("请先选择房间");
  1236. return;
  1237. }
  1238. console.log("selectRoom", selectRoom);
  1239. this.$refs.modalForm.add({ roomRepairList: selectRoom });
  1240. this.$refs.modalForm.title = "维修";
  1241. this.$refs.modalForm.disableSubmit = false;
  1242. },
  1243. handleLock(e) {
  1244. var selectRoom = [];
  1245. this.roomList.forEach((t) => {
  1246. t.rooms.forEach((c) => {
  1247. if (c.roomInfo.state === 88) {
  1248. selectRoom.push({ roomId: c.roomInfo.id, roomNo: c.roomInfo.name });
  1249. }
  1250. });
  1251. });
  1252. if (selectRoom.length === 0) {
  1253. this.$message.warning("请先选择房间");
  1254. return;
  1255. }
  1256. console.log("selectRoom", selectRoom);
  1257. this.$refs.ModalLockRoom.add({ roomLockList: selectRoom });
  1258. this.$refs.ModalLockRoom.title = "锁房";
  1259. this.$refs.ModalLockRoom.disableSubmit = false;
  1260. },
  1261. handleDirty() {
  1262. var selectRoom = [];
  1263. this.roomList.forEach((t) => {
  1264. t.rooms.forEach((c) => {
  1265. if (c.roomInfo.state === 88) {
  1266. selectRoom.push(c.roomInfo.id);
  1267. }
  1268. });
  1269. });
  1270. if (selectRoom.length === 0) {
  1271. this.$message.warning("请先选择房间");
  1272. return;
  1273. }
  1274. var ids = selectRoom.join(",");
  1275. postAction("/rooms/cesRooms/dirtyRoom?roomIds=" + ids, {}).then((res) => {
  1276. if (res.success) {
  1277. this.$message.success(res.message);
  1278. this.loadData();
  1279. }
  1280. });
  1281. },
  1282. handleClean(e) {
  1283. var selectRoom = [];
  1284. this.roomList.forEach((t) => {
  1285. t.rooms.forEach((c) => {
  1286. if (c.roomInfo.state === 88) {
  1287. selectRoom.push({ roomId: c.roomInfo.id, roomNo: c.roomInfo.name });
  1288. }
  1289. });
  1290. });
  1291. if (selectRoom.length === 0) {
  1292. this.$message.warning("请先选择房间");
  1293. return;
  1294. }
  1295. console.log("selectRoom", selectRoom);
  1296. this.$refs.ModalCleanRoom.add({ roomCleanList: selectRoom });
  1297. this.$refs.ModalCleanRoom.title = "清理房间";
  1298. this.$refs.ModalCleanRoom.disableSubmit = false;
  1299. },
  1300. handleOffLock() {
  1301. var selectRoom = [];
  1302. this.roomList.forEach((t) => {
  1303. t.rooms.forEach((c) => {
  1304. if (c.roomInfo.state === 88) {
  1305. selectRoom.push(c.roomInfo.id);
  1306. }
  1307. });
  1308. });
  1309. if (selectRoom.length === 0) {
  1310. this.$message.warning("请先选择房间");
  1311. return;
  1312. }
  1313. var ids = selectRoom.join(",");
  1314. postAction("/fw/fwRoomLock/offLockRoom?roomIds=" + ids, {}).then(
  1315. (res) => {
  1316. if (res.success) {
  1317. this.$message.success(res.message);
  1318. this.loadData();
  1319. }
  1320. }
  1321. );
  1322. },
  1323. handleCompleteRepair() {
  1324. var selectRoom = [];
  1325. this.roomList.forEach((t) => {
  1326. t.rooms.forEach((c) => {
  1327. if (c.roomInfo.state === 88) {
  1328. selectRoom.push(c.roomInfo.id);
  1329. }
  1330. });
  1331. });
  1332. if (selectRoom.length === 0) {
  1333. this.$message.warning("请先选择房间");
  1334. return;
  1335. }
  1336. var ids = selectRoom.join(",");
  1337. postAction("/fw/fwRoomRepair/completeRepairRoom?roomIds=" + ids, {}).then(
  1338. (res) => {
  1339. if (res.success) {
  1340. this.$message.success(res.message);
  1341. this.loadData();
  1342. }
  1343. }
  1344. );
  1345. },
  1346. modalLockRoomFormOk() {
  1347. this.loadData();
  1348. },
  1349. onMenuClick(e, row) {
  1350. console.log("e", e);
  1351. console.log("row", row);
  1352. var that = this;
  1353. if (e.key == "1") {
  1354. if (row.bookingData && row.bookingData.bookingOrder) {
  1355. this.$confirm({
  1356. title: "提示",
  1357. content: "此房间有预定是否预定转入住?",
  1358. onOk: function () {
  1359. that.$router.push({
  1360. name: "room-scheduledetail",
  1361. params: {
  1362. id: row.bookingData.bookingOrder.bookingOrdersNo,
  1363. },
  1364. });
  1365. },
  1366. });
  1367. } else {
  1368. row.roomInfo.marketPrice = row.layout.marketPrice;
  1369. this.$refs.ModalBillRoomForm.addList([row.roomInfo], 1);
  1370. this.$refs.ModalBillRoomForm.title = "散客入住登记";
  1371. this.$refs.ModalBillRoomForm.disableSubmit = false;
  1372. }
  1373. } else if (e.key == "2") {
  1374. this.$refs.ModalScheduleRoom.addList([row.roomInfo], 1);
  1375. this.$refs.ModalScheduleRoom.title = "散客预定登记";
  1376. this.$refs.ModalScheduleRoom.disableSubmit = false;
  1377. } else if (e.key == "3") {
  1378. var selectRoom = [row.roomInfo.id];
  1379. if (selectRoom.length === 0) {
  1380. this.$message.warning("请先选择房间");
  1381. return;
  1382. }
  1383. var ids = selectRoom.join(",");
  1384. postAction("/rooms/cesRooms/dirtyRoom?roomIds=" + ids, {}).then(
  1385. (res) => {
  1386. if (res.success) {
  1387. this.$message.success(res.message);
  1388. this.loadData();
  1389. }
  1390. }
  1391. );
  1392. } else if (e.key == "31") {
  1393. var selectRoom = [
  1394. {
  1395. roomId: row.roomInfo.id,
  1396. roomNo: row.roomInfo.name,
  1397. },
  1398. ];
  1399. if (selectRoom.length === 0) {
  1400. this.$message.warning("请先选择房间");
  1401. return;
  1402. }
  1403. console.log("selectRoom", selectRoom);
  1404. this.$refs.ModalCleanRoom.add({ roomCleanList: selectRoom });
  1405. this.$refs.ModalCleanRoom.title = "清理房间";
  1406. this.$refs.ModalCleanRoom.disableSubmit = false;
  1407. } else if (e.key == "4") {
  1408. var selectRoom = [
  1409. {
  1410. roomId: row.roomInfo.id,
  1411. roomNo: row.roomInfo.name,
  1412. },
  1413. ];
  1414. if (selectRoom.length === 0) {
  1415. this.$message.warning("请先选择房间");
  1416. return;
  1417. }
  1418. console.log("selectRoom", selectRoom);
  1419. this.$refs.modalForm.add({ roomRepairList: selectRoom });
  1420. this.$refs.modalForm.title = "维修";
  1421. this.$refs.modalForm.disableSubmit = false;
  1422. } else if (e.key == "41") {
  1423. var selectRoom = [row.roomInfo.id];
  1424. if (selectRoom.length === 0) {
  1425. this.$message.warning("请先选择房间");
  1426. return;
  1427. }
  1428. var ids = selectRoom.join(",");
  1429. postAction(
  1430. "/fw/fwRoomRepair/completeRepairRoom?roomIds=" + ids,
  1431. {}
  1432. ).then((res) => {
  1433. if (res.success) {
  1434. this.$message.success(res.message);
  1435. this.loadData();
  1436. }
  1437. });
  1438. } else if (e.key == "51") {
  1439. var selectRoom = [row.roomInfo.id];
  1440. if (selectRoom.length === 0) {
  1441. this.$message.warning("请先选择房间");
  1442. return;
  1443. }
  1444. var ids = selectRoom.join(",");
  1445. postAction("/fw/fwRoomLock/offLockRoom?roomIds=" + ids, {}).then(
  1446. (res) => {
  1447. if (res.success) {
  1448. this.$message.success(res.message);
  1449. this.loadData();
  1450. }
  1451. }
  1452. );
  1453. } else if (e.key == 6 || e.key == 7) {
  1454. this.handleBillInfo(row);
  1455. return;
  1456. } else if (e.key == 11 || e.key == 12) {
  1457. this.$message.error("接口程序未打开,请打开接口程序");
  1458. return;
  1459. } else if (e.key == 15) {
  1460. this.handleBillInfo(row);
  1461. return;
  1462. } else if (e.key == 18) {
  1463. this.$message.error("暂未实现");
  1464. return;
  1465. }
  1466. },
  1467. modalBillRoomFormOk(e) {
  1468. this.loadData();
  1469. console.log("e", e);
  1470. this.$refs.ModalBillRoomInfo.add(e);
  1471. this.$refs.ModalBillRoomInfo.title = "账单";
  1472. this.$refs.ModalBillRoomInfo.disableSubmit = true;
  1473. },
  1474. modalFormOk(e) {
  1475. console.log("e", e);
  1476. this.loadData();
  1477. this.$router.push({
  1478. // path: "/room/scheduledetail",
  1479. // query: { id: e },
  1480. name: "room-scheduledetail",
  1481. params: { id: e },
  1482. });
  1483. },
  1484. modalTeamFormOk(e) {
  1485. console.log("e", e);
  1486. this.loadData();
  1487. this.$router.push({
  1488. // path: "/room/scheduledetail",
  1489. // query: { id: e },
  1490. name: "room-scheduleteamdetail",
  1491. params: { id: e },
  1492. });
  1493. },
  1494. loadData() {
  1495. this.checkInBtnDis = false;
  1496. this.scheduleBtnDis = false;
  1497. getAction("/rooms/cesRooms/realtime-rooms", {}).then((res) => {
  1498. if (res.success) {
  1499. res.result.forEach((row) => {
  1500. this.$set(row, "collapse", 1);
  1501. });
  1502. this.roomList = res.result;
  1503. this.oldRoomList = JSON.parse(JSON.stringify(res.result));
  1504. }
  1505. });
  1506. },
  1507. },
  1508. };
  1509. </script>
  1510. <style scoped>
  1511. @import "~@assets/less/common.less";
  1512. </style>
  1513. <style scoped>
  1514. .course-week {
  1515. /* border: 1px solid #ddd; */
  1516. /* padding: 1%; */
  1517. box-sizing: border-box;
  1518. display: flex;
  1519. flex-direction: column;
  1520. }
  1521. .post-mark {
  1522. position: relative;
  1523. overflow: hidden;
  1524. width: 100%;
  1525. height: 100%;
  1526. }
  1527. .select-cell {
  1528. position: absolute;
  1529. width: 100%;
  1530. height: 100%;
  1531. left: 0;
  1532. top: 0;
  1533. z-index: 10;
  1534. -webkit-box-sizing: border-box;
  1535. box-sizing: border-box;
  1536. background: rgba(102, 102, 102, 0.5);
  1537. -webkit-user-select: none;
  1538. -moz-user-select: none;
  1539. -ms-user-select: none;
  1540. user-select: none;
  1541. border-radius: 5px;
  1542. display: flex;
  1543. justify-content: center;
  1544. align-items: center;
  1545. }
  1546. .week-top {
  1547. display: flex;
  1548. justify-content: space-between;
  1549. align-items: center;
  1550. width: 100%;
  1551. height: 40px;
  1552. padding: 0 1%;
  1553. box-sizing: border-box;
  1554. }
  1555. .week-top .week-btn-wrap {
  1556. width: 200px;
  1557. display: flex;
  1558. justify-content: space-around;
  1559. color: #409eff;
  1560. }
  1561. .week-top .week-btn-wrap span {
  1562. cursor: pointer;
  1563. display: flex;
  1564. justify-content: center;
  1565. align-items: center;
  1566. font-size: 15px;
  1567. }
  1568. .w-today-date {
  1569. font-weight: bold;
  1570. font-size: 16px;
  1571. }
  1572. .w-choose-status {
  1573. display: flex;
  1574. /* justify-content: flex-end;
  1575. width: 200px; */
  1576. }
  1577. .w-choose-status > div {
  1578. width: 100%;
  1579. flex: 1;
  1580. display: flex;
  1581. padding: 0 2%;
  1582. white-space: nowrap;
  1583. line-height: 20px;
  1584. box-sizing: border-box;
  1585. }
  1586. .w-choose-status > div .square {
  1587. display: flex;
  1588. width: 16px;
  1589. height: 16px;
  1590. border-radius: 4px;
  1591. box-sizing: border-box;
  1592. }
  1593. .w-choose-status > div .title {
  1594. display: flex;
  1595. align-items: center;
  1596. line-height: 16px;
  1597. padding-left: 4px;
  1598. font-size: 14px;
  1599. box-sizing: border-box;
  1600. }
  1601. .week-table {
  1602. display: flex;
  1603. flex-direction: column;
  1604. }
  1605. .week-table .table-header {
  1606. width: 100%;
  1607. height: 80px;
  1608. background: #eaedf2;
  1609. display: flex;
  1610. flex-direction: column;
  1611. align-items: center;
  1612. border-bottom: 1px solid #eaedf2;
  1613. box-sizing: border-box;
  1614. }
  1615. .table-header .w-table-date,
  1616. .table-week {
  1617. width: 100%;
  1618. height: 40px;
  1619. text-align: left;
  1620. display: flex;
  1621. justify-content: center;
  1622. align-items: center;
  1623. }
  1624. .table-header .w-table-date > span,
  1625. .table-week > span {
  1626. flex: 1;
  1627. color: #000;
  1628. height: 100%;
  1629. font-size: 14px;
  1630. display: flex;
  1631. justify-content: center;
  1632. align-items: center;
  1633. font-weight: bold;
  1634. }
  1635. .w-table-date .w-day-item,
  1636. .table-week .w-day-item {
  1637. color: #000;
  1638. font-size: 14px;
  1639. display: flex;
  1640. justify-content: center;
  1641. align-items: center;
  1642. }
  1643. .week-table .w-time-period-list {
  1644. width: 100%;
  1645. }
  1646. .w-time-period-list .w-time-period-row {
  1647. width: 100%;
  1648. min-height: 60px;
  1649. }
  1650. .w-time-period-col {
  1651. width: 100%;
  1652. min-height: 60px;
  1653. display: flex;
  1654. }
  1655. .w-time-period-col .w-time-period {
  1656. width: 12.5%;
  1657. display: flex;
  1658. justify-content: center;
  1659. align-items: center;
  1660. border-left: 1px solid #eaedf2;
  1661. /* border-bottom: 1px solid #eaedf2; */
  1662. box-sizing: border-box;
  1663. }
  1664. .w-time-period-col:last-child {
  1665. border-bottom: 1px solid #eaedf2;
  1666. }
  1667. .meeting-room-center {
  1668. transform: translate(-200%, 0%);
  1669. width: 14px;
  1670. font-size: 14px;
  1671. word-wrap: break-word;
  1672. position: absolute;
  1673. }
  1674. .w-time-period-col .w-row-day {
  1675. width: 100%;
  1676. display: flex;
  1677. justify-content: center;
  1678. }
  1679. .w-row-day .w-things {
  1680. flex: 1;
  1681. display: flex;
  1682. flex-direction: column;
  1683. align-items: center;
  1684. border-left: 1px solid #eaedf2;
  1685. border-bottom: 1px solid #eaedf2;
  1686. box-sizing: border-box;
  1687. cursor: pointer;
  1688. }
  1689. .w-row-day .w-things:last-child {
  1690. border-right: 1px solid #eaedf2;
  1691. }
  1692. .w-things .w-thing-item {
  1693. display: flex;
  1694. /* width: 80%; */
  1695. height: 135px;
  1696. font-size: 14px;
  1697. flex-direction: column;
  1698. justify-content: space-around;
  1699. min-height: 50px;
  1700. border-radius: 10px;
  1701. margin: 2% 1%;
  1702. padding: 1% 2%;
  1703. cursor: pointer;
  1704. color: #fff;
  1705. background: #ff6200;
  1706. box-sizing: border-box;
  1707. transition: all 1s linear 0.5s;
  1708. }
  1709. .w-isCurDate {
  1710. color: #ff2525 !important;
  1711. }
  1712. .w-noMore {
  1713. min-height: 200px;
  1714. padding: 2%;
  1715. display: flex;
  1716. justify-content: center;
  1717. align-items: center;
  1718. border: 1px solid rgba(156, 173, 173, 0.3);
  1719. color: #9cadadb7;
  1720. box-sizing: border-box;
  1721. }
  1722. .w_expand,
  1723. .w_shrink {
  1724. color: #0a98d5;
  1725. cursor: pointer;
  1726. width: 100%;
  1727. padding: 2% 0;
  1728. display: flex;
  1729. justify-content: center;
  1730. align-items: center;
  1731. }
  1732. </style>
  1733. <style scoped>
  1734. #components-grid-demo-playground [class~="ant-col"] {
  1735. background: transparent;
  1736. border: 0;
  1737. }
  1738. #components-grid-demo-playground .room-item {
  1739. background: rgba(67, 207, 124, 1);
  1740. height: 125px;
  1741. /* line-height: 200px; */
  1742. font-size: 13px;
  1743. color: #f9f9f9;
  1744. padding: 2px;
  1745. border-radius: 5px;
  1746. cursor: pointer;
  1747. position: relative;
  1748. }
  1749. #components-grid-demo-playground pre {
  1750. background: #f9f9f9;
  1751. border-radius: 6px;
  1752. font-size: 13px;
  1753. padding: 8px 16px;
  1754. }
  1755. </style>