system.vue 54 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921
  1. <template>
  2. <div class="content-box">
  3. <div class="title">
  4. <div class="cameratxt">系统通知</div>
  5. </div>
  6. <div class="contentss">
  7. <div class="left">
  8. <div class="titles">公寓设置</div>
  9. <div class="tooltips">
  10. <div class="img img1">
  11. <div class="img_title">
  12. <span>详情图:</span>
  13. </div>
  14. <div class="updateImg">
  15. <div class="carousel">
  16. <div class="pre" @click="infoImgClick2('left')">
  17. <img src="@/assets/left.png" alt="" />
  18. </div>
  19. <el-carousel
  20. ref="infoImg2"
  21. indicator-position="none"
  22. arrow="always"
  23. :autoplay="false"
  24. @change="switchImg2"
  25. :initial-index="switchImgInd2"
  26. >
  27. <el-carousel-item
  28. v-for="item in systemData.coverPicture"
  29. :key="item.id"
  30. >
  31. <img :src="item.url" alt="" />
  32. </el-carousel-item>
  33. </el-carousel>
  34. <div class="pre" @click="infoImgClick2('right')">
  35. <img src="@/assets/right.png" alt="" />
  36. </div>
  37. <span class="numImg" v-if="systemData.coverPicture">{{
  38. switchImgInd2 + 1 + "/" + systemData.coverPicture.length
  39. }}</span>
  40. <div class="lookImg" v-if="systemData.coverPicture">
  41. <img src="@/assets/lookImg.png" alt="" @click="lookImg" />
  42. <div
  43. class="delimg"
  44. @click="delImgList(item)"
  45. v-if="flagBtn.gongyushezhi == 1"
  46. ></div>
  47. </div>
  48. </div>
  49. <el-upload
  50. v-if="flagBtn.gongyushezhi == 1"
  51. class="avatar-uploader"
  52. action=""
  53. :on-preview="handlePreview2"
  54. :on-remove="handleRemove2"
  55. :on-change="handleChange2"
  56. :http-request="handleUpload2"
  57. :before-upload="beforeAvatarUpload2"
  58. >
  59. <template #trigger>
  60. <el-button type="primary" color="rgba(0, 97, 255, 1)"
  61. >上传图片</el-button
  62. >
  63. </template>
  64. <template #tip>
  65. <!-- <div class="el-upload__tip">
  66. (注:图片大小不超过10M,建议按16:9比例)
  67. </div> -->
  68. </template>
  69. </el-upload>
  70. </div>
  71. </div>
  72. </div>
  73. <div class="tooltips">
  74. <div class="rows">
  75. <div class="conts">
  76. <div class="name">名称:</div>
  77. <el-input
  78. v-if="flagBtn.gongyushezhi == 1"
  79. clearable
  80. v-model.trim="systemData.name"
  81. @blur="systemChange"
  82. placeholder="请输入名称"
  83. style="max-width: 300px; width: 280px"
  84. />
  85. <span
  86. v-else
  87. style="
  88. display: inline-block;
  89. max-width: 300px;
  90. width: 280px;
  91. border: 1px solid #ccc;
  92. border-radius: 3px;
  93. height: 30px;
  94. line-height: 30px;
  95. padding-left: 8px;
  96. "
  97. >{{ systemData.name }}</span
  98. >
  99. </div>
  100. <div class="conts">
  101. <div class="name">开业时间:</div>
  102. <el-date-picker
  103. v-if="flagBtn.gongyushezhi == 1"
  104. v-model="systemData.openingTime"
  105. type="datetime"
  106. format="YYYY-MM-DD HH:mm:ss"
  107. value-format="YYYY-MM-DD HH:mm:ss"
  108. :prefix-icon="Calendar"
  109. placeholder="请选择开业时间"
  110. style="max-width: 300px; width: 280px"
  111. @change="systemChange"
  112. />
  113. <span
  114. v-else
  115. style="
  116. display: inline-block;
  117. max-width: 300px;
  118. width: 280px;
  119. border: 1px solid #ccc;
  120. border-radius: 3px;
  121. height: 30px;
  122. line-height: 30px;
  123. padding-left: 8px;
  124. "
  125. >{{ systemData.openingTime }}</span
  126. >
  127. </div>
  128. </div>
  129. </div>
  130. <div class="tooltips">
  131. <div class="rows">
  132. <div class="conts">
  133. <div class="name">地址:</div>
  134. <el-input
  135. v-if="flagBtn.gongyushezhi == 1"
  136. clearable
  137. v-model.trim="systemData.address"
  138. @blur="systemChange"
  139. placeholder="请输入地址"
  140. style="max-width: 300px; width: 280px"
  141. />
  142. <span
  143. v-else
  144. style="
  145. display: inline-block;
  146. max-width: 300px;
  147. width: 280px;
  148. border: 1px solid #ccc;
  149. border-radius: 3px;
  150. height: 30px;
  151. line-height: 30px;
  152. padding-left: 8px;
  153. overflow-x: auto;
  154. "
  155. >{{ systemData.address }}</span
  156. >
  157. </div>
  158. <div class="conts">
  159. <div class="name">装修时间:</div>
  160. <el-date-picker
  161. v-if="flagBtn.gongyushezhi == 1"
  162. v-model="systemData.decorationTime"
  163. type="datetime"
  164. format="YYYY-MM-DD HH:mm:ss"
  165. value-format="YYYY-MM-DD HH:mm:ss"
  166. :prefix-icon="Calendar"
  167. placeholder="请选择装修时间"
  168. style="max-width: 300px; width: 280px"
  169. @change="systemChange"
  170. />
  171. <span
  172. v-else
  173. style="
  174. display: inline-block;
  175. max-width: 300px;
  176. width: 280px;
  177. border: 1px solid #ccc;
  178. border-radius: 3px;
  179. height: 30px;
  180. line-height: 30px;
  181. padding-left: 8px;
  182. "
  183. >{{ systemData.decorationTime }}</span
  184. >
  185. </div>
  186. </div>
  187. </div>
  188. <div class="tooltips">
  189. <div class="rows">
  190. <div class="conts">
  191. <div class="name">全日房入住时间:</div>
  192. <!-- <el-time-picker
  193. v-model="systemData.liveTime"
  194. format="HH:mm"
  195. value-format="HH:mm"
  196. :prefix-icon="Calendar"
  197. placeholder="请输入入住时间"
  198. style="max-width: 300px; width: 280px"
  199. @change="systemChange"
  200. /> -->
  201. <el-time-picker
  202. v-if="flagBtn.gongyushezhi == 1"
  203. v-model="systemData.liveTime"
  204. is-range
  205. range-separator="-"
  206. format="HH:mm:ss"
  207. value-format="HH:mm:ss"
  208. start-placeholder="开始时间"
  209. end-placeholder="结束时间"
  210. @change="systemChange"
  211. />
  212. <span
  213. v-else
  214. style="
  215. display: inline-block;
  216. max-width: 300px;
  217. width: 280px;
  218. border: 1px solid #ccc;
  219. border-radius: 3px;
  220. height: 30px;
  221. line-height: 30px;
  222. padding-left: 8px;
  223. "
  224. >{{ systemData.liveTime[0] }} -
  225. {{ systemData.liveTime[1] }}</span
  226. >
  227. </div>
  228. <!-- <div class="conts">
  229. <div class="name">离店时间:</div>
  230. <el-time-picker
  231. v-model="systemData.leaveTime"
  232. format="HH:mm"
  233. value-format="HH:mm"
  234. :prefix-icon="Calendar"
  235. placeholder="请选择离店时间"
  236. style="max-width: 300px; width: 280px"
  237. @change="systemChange"
  238. />
  239. </div> -->
  240. </div>
  241. </div>
  242. <div class="tooltips">
  243. <div class="rows">
  244. <div class="conts">
  245. <div class="name">钟点房入住时间:</div>
  246. <div class="hourlivetime">
  247. <div
  248. class="addlive"
  249. v-for="(i, ind) in systemData.hourlivetime"
  250. >
  251. <el-time-picker
  252. v-if="flagBtn.gongyushezhi == 1"
  253. v-model="i.time"
  254. is-range
  255. range-separator="-"
  256. start-placeholder="开始时间"
  257. end-placeholder="结束时间"
  258. format="HH:mm:ss"
  259. value-format="HH:mm:ss"
  260. @change="systemChange"
  261. />
  262. <span
  263. v-else
  264. style="
  265. display: inline-block;
  266. max-width: 300px;
  267. width: 280px;
  268. border: 1px solid #ccc;
  269. border-radius: 3px;
  270. height: 30px;
  271. line-height: 30px;
  272. padding-left: 8px;
  273. "
  274. >{{ i.time[0] }} - {{ i.time[1] }}</span
  275. >
  276. <img
  277. v-if="flagBtn.gongyushezhi == 1"
  278. class="img"
  279. src="@/assets/addRoom.png"
  280. @click="addhourClick(ind)"
  281. alt=""
  282. />
  283. <img
  284. class="img"
  285. src="@/assets/delRoom.png"
  286. @click="delhourClick(ind)"
  287. alt=""
  288. v-if="ind != 0 && flagBtn.gongyushezhi == 1"
  289. />
  290. <div class="img" alt="" v-else />
  291. </div>
  292. </div>
  293. </div>
  294. </div>
  295. </div>
  296. <div class="tooltips">
  297. <div class="rows">
  298. <div class="conts">
  299. <div class="name">电话号码:</div>
  300. <el-input
  301. v-if="flagBtn.gongyushezhi == 1"
  302. clearable
  303. v-model.trim="systemData.phoneNumbr"
  304. @blur="systemChange"
  305. class="w-50 m-2"
  306. placeholder="请输入电话号码"
  307. style="max-width: 300px; width: 280px"
  308. />
  309. <span
  310. v-else
  311. style="display: inline-block; max-width: 300px; width: 280px"
  312. >{{ systemData.phoneNumbr }}</span
  313. >
  314. </div>
  315. </div>
  316. </div>
  317. <div class="tooltips">
  318. <div class="rows">
  319. <div class="textarea">
  320. <div class="name">公寓简介:</div>
  321. <!-- <el-input
  322. v-if="flagBtn.gongyushezhi == 1"
  323. v-model="systemData.introductory"
  324. :rows="9"
  325. maxlength="1000"
  326. type="textarea"
  327. show-word-limit
  328. placeholder="请输入公寓简介"
  329. @blur="systemChange"
  330. /> -->
  331. <Richtext
  332. v-if="textShow"
  333. @richtextClick="richtextClick"
  334. :fatherMessage="fatherMessage"
  335. ></Richtext>
  336. <!-- <span v-else style="display: inline-block;max-width: 600px; width: 1000px;height:200px;border: 1px solid #ccc;overflow: auto;border-radius: 3px;padding: 5px 8px;">{{ systemData.introductory }}</span> -->
  337. </div>
  338. </div>
  339. </div>
  340. </div>
  341. <div class="right">
  342. <div class="ApartmentSetting">
  343. <div class="titles">
  344. <div class="title">设施服务设置</div>
  345. <el-button
  346. v-if="flagBtn.sheshifuwushezhi == 1"
  347. @click="facilityServicesAdd"
  348. type="primary"
  349. color="rgba(0, 97, 255, 1)"
  350. >添加
  351. </el-button>
  352. </div>
  353. <el-table
  354. :row-class-name="tableRowClassName"
  355. :data="tableData.list"
  356. @selection-change="handleSelectionChange"
  357. :header-cell-style="{
  358. background: 'rgba(240, 243, 247, 1)',
  359. height: '50px',
  360. border: 0,
  361. }"
  362. >
  363. <el-table-column
  364. align="center"
  365. prop="iconPath"
  366. label="图标"
  367. width="120"
  368. >
  369. <template #default="{ row }">
  370. <img
  371. :src="row.iconPath"
  372. alt=""
  373. style="width: 30px; height: 30px"
  374. />
  375. </template>
  376. </el-table-column>
  377. <el-table-column
  378. align="center"
  379. prop="houseService"
  380. label="房型服务"
  381. />
  382. <el-table-column
  383. v-if="flagBtn.sheshifuwushezhi == 1"
  384. align="center"
  385. label="操作"
  386. >
  387. <template #default="scope">
  388. <div class="options">
  389. <div class="look" @click="facilityServicesEdit(scope.row)">
  390. 编辑
  391. </div>
  392. <el-popconfirm
  393. width="220"
  394. confirm-button-text="确认"
  395. cancel-button-text="取消"
  396. :icon="InfoFilled"
  397. icon-color="#f89626"
  398. title="是否删除此设施服务?"
  399. @confirm="facilityServicesDel(scope.row)"
  400. @cancel="cancelEvent"
  401. >
  402. <template #reference>
  403. <div class="del">删除</div>
  404. </template>
  405. </el-popconfirm>
  406. </div>
  407. </template>
  408. </el-table-column>
  409. </el-table>
  410. <!-- <div class="titles">
  411. <div class="set">退房设置</div>
  412. </div>
  413. <div class="system">
  414. <span>退房后 </span>
  415. <el-input
  416. v-if="flagBtn.tuifangshezhi == 1"
  417. clearable
  418. v-model.trim="checkOutData.turnOffTime"
  419. style="width: 150px; margin: 0 8px"
  420. placeholder="请输入时间"
  421. @blur="checkOutSettingUpdate"
  422. >
  423. <template #suffix>
  424. <img
  425. src="@/assets/icons/clock.png"
  426. alt=""
  427. style="width: 15px"
  428. />
  429. </template>
  430. </el-input>
  431. <span
  432. v-else
  433. style="
  434. display: inline-block;
  435. width: 150px;
  436. border: 1px solid #ccc;
  437. border-radius: 3px;
  438. height: 30px;
  439. line-height: 30px;
  440. padding-left: 8px;
  441. margin: 0 8px;
  442. "
  443. >{{ checkOutData.turnOffTime }}</span
  444. >
  445. <span>分钟,断电</span>
  446. </div>
  447. <div class="system">
  448. <span>预定时间最多 </span>
  449. <el-input
  450. v-if="flagBtn.tuifangshezhi == 1"
  451. clearable
  452. v-model.trim="checkOutData.preDay"
  453. style="width: 150px; margin: 0 8px"
  454. placeholder="请输入天数"
  455. @blur="checkOutSettingUpdate"
  456. >
  457. </el-input>
  458. <span
  459. v-else
  460. style="
  461. display: inline-block;
  462. width: 150px;
  463. border: 1px solid #ccc;
  464. border-radius: 3px;
  465. height: 30px;
  466. line-height: 30px;
  467. padding-left: 8px;
  468. margin: 0 8px;
  469. "
  470. >{{ checkOutData.preDay }}</span
  471. >
  472. <span>天</span>
  473. </div> -->
  474. <div class="titles">
  475. <div class="set">
  476. 补助设置<span style="font-size: 14px; padding: 0 15px"
  477. >/ 每房每日定额</span
  478. >
  479. </div>
  480. </div>
  481. <div class="system">
  482. <span>每人补助水量 </span>
  483. <el-input
  484. v-if="flagBtn.buzhushezhi == 1"
  485. clearable
  486. v-model.trim="subsidySetupData.freeQuotaOfWater"
  487. style="width: 150px; margin: 0 8px"
  488. placeholder="请输入吨数"
  489. @blur="subsidySetupUpdate"
  490. >
  491. </el-input>
  492. <span
  493. v-else
  494. style="
  495. display: inline-block;
  496. width: 150px;
  497. border: 1px solid #ccc;
  498. border-radius: 3px;
  499. height: 30px;
  500. line-height: 30px;
  501. padding-left: 8px;
  502. margin: 0 8px;
  503. "
  504. >{{ subsidySetupData.freeQuotaOfWater }}</span
  505. >
  506. <span>吨</span>
  507. <span
  508. style="
  509. margin: 0 15px;
  510. display: inline-block;
  511. height: 32px;
  512. width: 2px;
  513. border-right: 1px solid rgba(166, 166, 166, 1);
  514. "
  515. ></span>
  516. <span>每人补助电量 </span>
  517. <el-input
  518. v-if="flagBtn.buzhushezhi == 1"
  519. clearable
  520. v-model.trim="subsidySetupData.freeQuotaOfElectric"
  521. style="width: 150px; margin: 0 8px"
  522. placeholder="请输入度数"
  523. @blur="subsidySetupUpdate"
  524. >
  525. </el-input>
  526. <span
  527. v-else
  528. style="
  529. display: inline-block;
  530. width: 150px;
  531. border: 1px solid #ccc;
  532. border-radius: 3px;
  533. height: 30px;
  534. line-height: 30px;
  535. padding-left: 8px;
  536. margin: 0 8px;
  537. "
  538. >{{ subsidySetupData.freeQuotaOfElectric }}</span
  539. >
  540. <span>度</span>
  541. </div>
  542. <div class="titles">
  543. <div class="set">黑名单设置</div>
  544. </div>
  545. <div class="system">
  546. <span>预订未入住超 </span>
  547. <el-input
  548. v-if="flagBtn.heimingdanshezhi == 1"
  549. clearable
  550. v-model.trim="blackListData.num"
  551. style="width: 150px; margin: 0 8px"
  552. placeholder="请输入天数"
  553. @blur="blackListDataUpdate"
  554. >
  555. </el-input>
  556. <span
  557. v-else
  558. style="
  559. display: inline-block;
  560. width: 150px;
  561. border: 1px solid #ccc;
  562. border-radius: 3px;
  563. height: 30px;
  564. line-height: 30px;
  565. padding-left: 8px;
  566. margin: 0 8px;
  567. "
  568. >{{ blackListData.num }}</span
  569. >
  570. <span>次,进入黑名单,不可免费预订</span>
  571. </div>
  572. <!-- <div class="titles">
  573. <div class="set">催缴设置</div>
  574. </div>
  575. <div class="system">
  576. <span>每 </span>
  577. <el-input
  578. v-if="flagBtn.cuijiaoshezhi == 1"
  579. clearable
  580. v-model.trim="callSystemData.askForPayment"
  581. style="width: 150px; margin: 0 8px"
  582. placeholder="请输入天数"
  583. @blur="callSystemDataUpdate"
  584. >
  585. </el-input>
  586. <span
  587. v-else
  588. style="
  589. display: inline-block;
  590. width: 150px;
  591. border: 1px solid #ccc;
  592. border-radius: 3px;
  593. height: 30px;
  594. line-height: 30px;
  595. padding-left: 8px;
  596. margin: 0 8px;
  597. "
  598. >{{ callSystemData.askForPayment }}</span
  599. >
  600. <span>天,对待结账老师进行催缴</span>
  601. </div> -->
  602. </div>
  603. </div>
  604. </div>
  605. <div class="bgImg" v-if="bgImg">
  606. <el-carousel
  607. @click="bgImg = false"
  608. ref="bgImg"
  609. indicator-position
  610. arrow="always"
  611. :autoplay="false"
  612. @change="switchBgImg"
  613. trigger
  614. :initial-index="switchImgInd3"
  615. >
  616. <el-carousel-item v-for="item in bgImgList" :key="item.id">
  617. <img :src="item.url" alt="" />
  618. </el-carousel-item>
  619. </el-carousel>
  620. </div>
  621. <!-- 查看设施服务添加 -->
  622. <el-dialog
  623. class="addtable"
  624. v-model="addtableDataDialog"
  625. :close-on-click-modal="false"
  626. :close-on-press-escape="false"
  627. :title="dialongTitle"
  628. align-center
  629. width="500"
  630. :before-close="cancelAddtable"
  631. >
  632. <div class="slider">
  633. <el-form
  634. ref="addtableRef"
  635. :model="addtableRuleForm"
  636. :rules="addtableRules"
  637. label-width="100px"
  638. class="demo-ruleForm"
  639. size="default"
  640. label-position="left"
  641. status-icon
  642. :inline="true"
  643. >
  644. <el-form-item label="图标 :" prop="icon">
  645. <div class="lookImg">
  646. <img :src="addtableRuleForm.icon" alt="" @click="lookImg(i)" />
  647. <div
  648. class="lookImgs"
  649. @click="lookImgs(addtableRuleForm.icon)"
  650. v-if="addtableRuleForm.icon"
  651. >
  652. <img src="@/assets/lookImg.png" alt="" />
  653. </div>
  654. </div>
  655. <el-upload
  656. class="avatar-uploader"
  657. action=""
  658. list-type="picture"
  659. :on-preview="handleAddtablePreview"
  660. :on-change="handleAddtableChange"
  661. :http-request="handleAddtableUpload"
  662. :before-upload="beforeAddtableAvatarUpload"
  663. >
  664. <template #trigger>
  665. <el-button type="primary" color="rgba(0, 97, 255, 1)"
  666. >上传图片</el-button
  667. >
  668. </template>
  669. <template #tip>
  670. <div class="el-upload__tip">
  671. (注:图片大小不超过1M,建议按1:1比例)
  672. </div>
  673. </template>
  674. </el-upload>
  675. </el-form-item>
  676. <el-form-item label="房型服务 :" prop="name">
  677. <el-input
  678. v-model.trim="addtableRuleForm.name"
  679. placeholder="请输入房型服务"
  680. clearable
  681. />
  682. </el-form-item>
  683. <el-form-item class="options">
  684. <el-button
  685. color="rgba(41, 109, 227, 1)"
  686. class="queding"
  687. type="primary"
  688. @click="submitAddtable(addtableRef)"
  689. >
  690. 确认
  691. </el-button>
  692. <el-button type="primary" plain @click="cancelAddtable"
  693. >取消</el-button
  694. >
  695. </el-form-item>
  696. </el-form>
  697. </div>
  698. </el-dialog>
  699. </div>
  700. </template>
  701. <script setup>
  702. import {
  703. ref,
  704. reactive,
  705. nextTick,
  706. onMounted,
  707. onBeforeMount,
  708. onUnmounted,
  709. } from "vue";
  710. import { useRouter, useRoute } from "vue-router";
  711. import { ElMessage, ElMessageBox } from "element-plus";
  712. import { Calendar } from "@element-plus/icons-vue";
  713. import vidiconsApi from "@/api/vidicons.js";
  714. import { dayjs } from "element-plus";
  715. import lodash from "lodash";
  716. import axios from "axios";
  717. import Richtext from "./richtext.vue";
  718. import { useStore } from "vuex";
  719. const store = useStore();
  720. const api = ref("");
  721. const router = useRouter();
  722. const route = useRoute(); // 获取router-push传过来的flag
  723. const flagBtn = ref(); // 按钮权限
  724. // 设置详情数据 (====================)
  725. const systemData = reactive({
  726. address: null,
  727. coverPicture: [],
  728. decorationTime: null,
  729. id: null,
  730. introductory: null,
  731. hourlivetime: [],
  732. liveTime: [],
  733. name: null,
  734. openingTime: null,
  735. phoneNumbr: null,
  736. });
  737. // 富文本内容
  738. const textShow = ref(false);
  739. const fatherMessage = ref({
  740. data: "",
  741. });
  742. // 查看设施服务设置数据 (===========================)
  743. const tableData = reactive({
  744. list: [],
  745. });
  746. const addtableDataDialog = ref(false);
  747. const dialongTitle = ref("设施服务添加");
  748. const addtableRef = ref();
  749. const addtableRuleForm = reactive({
  750. id: "",
  751. icon: "",
  752. name: "",
  753. });
  754. const addtableRules = reactive({
  755. icon: [{ required: true, message: "图标不能为空", trigger: "blur" }],
  756. name: [{ required: true, message: "房型服务不能为空", trigger: "blur" }],
  757. });
  758. // 退房设置数据 (====================================)
  759. const checkOutData = reactive({
  760. id: "",
  761. turnOffTime: "",
  762. preDay: "",
  763. });
  764. // 补助设置查询
  765. const subsidySetupData = reactive({
  766. freeQuotaOfElectric: "",
  767. freeQuotaOfWater: "",
  768. id: "",
  769. });
  770. // 催缴设置查询
  771. const callSystemData = reactive({
  772. id: "",
  773. askForPayment: "",
  774. });
  775. // 黑名单设置
  776. const blackListData = reactive({
  777. id: "",
  778. num: "",
  779. });
  780. // 添加员工弹窗数据 (------------------------------------)
  781. const addDialogVisible = ref(false); // 控制添加员工弹窗
  782. const cities = ref([]); // 名宿配置数据
  783. const checkedCities = ref([]); // 名宿配置选中数据
  784. const infoImg2 = ref(); // 控制走马灯ref
  785. const switchImgInd2 = ref(0); // 幻灯片的默认索引
  786. const imgList2 = ref([]); // 弹窗中详情图地址(幻灯片)
  787. const fileList = reactive({ list: [] }); // 添加多张图片的文件
  788. const searchInput = reactive({
  789. keyWord: "",
  790. teamId: "",
  791. schoolId: "",
  792. }); // 搜索按钮数据
  793. // 添加员工表单数据
  794. const ruleForm = reactive({
  795. name: "研究生公寓", // 名称
  796. openingTime: "", // 开业时间
  797. id: "",
  798. });
  799. // 点击查看图片
  800. const bgImg = ref(false);
  801. const bgImgList = ref([]);
  802. const switchImgInd3 = ref();
  803. // 系统设置信息
  804. const getList = async () => {
  805. let data = {
  806. permissionSettingId: sessionStorage.getItem("permissionSettingId"),
  807. };
  808. let res = await axios({
  809. method: "get",
  810. url: api.value + "/apartment-setting/list",
  811. headers: {
  812. token: sessionStorage.getItem("token"),
  813. user_head: sessionStorage.getItem("user_head"),
  814. },
  815. params: data,
  816. });
  817. console.log(res, "系统设置信息");
  818. if (res.data.code == 200) {
  819. systemData.address = res.data.data.address;
  820. if (res.data.data.coverPicture) {
  821. systemData.coverPicture = res.data.data.coverPicture;
  822. } else {
  823. systemData.coverPicture = [];
  824. }
  825. systemData.decorationTime = res.data.data.decorationTime;
  826. systemData.id = res.data.data.id;
  827. // console.log(res.data.data.introductory);
  828. systemData.introductory = res.data.data.introductory;
  829. fatherMessage.value.data = res.data.data.introductory;
  830. let arr = res.data.data.hourTime.split(",");
  831. let hourData = [];
  832. arr.forEach((i) => {
  833. let time = i.split("-");
  834. hourData.push({
  835. time: time,
  836. });
  837. });
  838. console.log(hourData);
  839. systemData.hourlivetime = hourData;
  840. systemData.liveTime[0] = res.data.data.liveTime;
  841. systemData.liveTime[1] = res.data.data.leaveTime;
  842. systemData.name = res.data.data.name;
  843. systemData.openingTime = res.data.data.openingTime;
  844. systemData.phoneNumbr = res.data.data.phoneNumbr;
  845. } else {
  846. if (res.data.code == 500) {
  847. console.log(res.data);
  848. if (res.data.message == "无效token,请重新登入") {
  849. router.push({ path: "/login" });
  850. }
  851. }
  852. ElMessage({
  853. type: "error",
  854. showClose: true,
  855. message: res.data.message,
  856. center: true,
  857. });
  858. }
  859. };
  860. // 添加钟点房时间列表
  861. const addhourClick = () => {
  862. systemData.hourlivetime.push({ time: [] });
  863. };
  864. // 删除钟点房时间列表
  865. const delhourClick = (ind) => {
  866. systemData.hourlivetime.splice(ind, 1);
  867. console.log(systemData.hourlivetime);
  868. systemChange();
  869. };
  870. // 查看设施服务设置
  871. const facilityServices = async () => {
  872. let data = {
  873. permissionSettingId: sessionStorage.getItem("permissionSettingId"),
  874. };
  875. let ress = await axios({
  876. method: "get",
  877. url: api.value + "/facility-services/list",
  878. headers: {
  879. token: sessionStorage.getItem("token"),
  880. user_head: sessionStorage.getItem("user_head"),
  881. },
  882. params: data,
  883. });
  884. console.log(ress, "查看设施服务设置");
  885. if (ress.data.code == 200) {
  886. tableData.list = ress.data.data;
  887. } else {
  888. ElMessage({
  889. type: "error",
  890. showClose: true,
  891. message: ress.data.message,
  892. center: true,
  893. });
  894. }
  895. };
  896. // 退房设置查询
  897. const checkOutSetting = async () => {
  898. let data = {
  899. permissionSettingId: sessionStorage.getItem("permissionSettingId"),
  900. };
  901. let resss = await axios({
  902. method: "get",
  903. url: api.value + "/check-out-setting/list",
  904. headers: {
  905. token: sessionStorage.getItem("token"),
  906. user_head: sessionStorage.getItem("user_head"),
  907. },
  908. params: data,
  909. });
  910. console.log(resss, "退房设置查询");
  911. if (resss.data.code == 200) {
  912. checkOutData.id = resss.data.data[0].id;
  913. checkOutData.turnOffTime = resss.data.data[0].turnOffTime;
  914. checkOutData.preDay = resss.data.data[0].preDay;
  915. } else {
  916. ElMessage({
  917. type: "error",
  918. showClose: true,
  919. message: resss.data.message,
  920. center: true,
  921. });
  922. }
  923. };
  924. // 补助设置查询
  925. const subsidySetup = async () => {
  926. let data = {
  927. permissionSettingId: sessionStorage.getItem("permissionSettingId"),
  928. };
  929. let resss = await axios({
  930. method: "get",
  931. url: api.value + "/subsidy-setup/list",
  932. headers: {
  933. token: sessionStorage.getItem("token"),
  934. user_head: sessionStorage.getItem("user_head"),
  935. },
  936. params: data,
  937. });
  938. console.log(resss, "补助设置查询");
  939. if (resss.data.code == 200) {
  940. subsidySetupData.freeQuotaOfElectric =
  941. resss.data.data[0].freeQuotaOfElectric;
  942. subsidySetupData.freeQuotaOfWater = resss.data.data[0].freeQuotaOfWater;
  943. subsidySetupData.id = resss.data.data[0].id;
  944. } else {
  945. ElMessage({
  946. type: "error",
  947. showClose: true,
  948. message: resss.data.message,
  949. center: true,
  950. });
  951. }
  952. };
  953. // 催缴设置查询
  954. const callSystem = async () => {
  955. let data = {
  956. permissionSettingId: sessionStorage.getItem("permissionSettingId"),
  957. };
  958. let resss = await axios({
  959. method: "get",
  960. url: api.value + "/call-system/list",
  961. headers: {
  962. token: sessionStorage.getItem("token"),
  963. user_head: sessionStorage.getItem("user_head"),
  964. },
  965. params: data,
  966. });
  967. console.log(resss, "催缴设置查询");
  968. if (resss.data.code == 200) {
  969. callSystemData.askForPayment = resss.data.data[0].askForPayment;
  970. callSystemData.id = resss.data.data[0].id;
  971. } else {
  972. ElMessage({
  973. type: "error",
  974. showClose: true,
  975. message: resss.data.message,
  976. center: true,
  977. });
  978. }
  979. };
  980. // 黑名单设置
  981. const blackList = async () => {
  982. let resss = await axios({
  983. method: "get",
  984. url: api.value + "/blacklist-setting/list",
  985. headers: {
  986. token: sessionStorage.getItem("token"),
  987. user_head: sessionStorage.getItem("user_head"),
  988. },
  989. });
  990. console.log(resss, "黑名单设置");
  991. if (resss.data.code == 200) {
  992. blackListData.num = resss.data.data.count;
  993. blackListData.id = resss.data.data.id;
  994. } else {
  995. ElMessage({
  996. type: "error",
  997. showClose: true,
  998. message: resss.data.message,
  999. center: true,
  1000. });
  1001. }
  1002. };
  1003. // 系统设置信息修改 (===============================================================)
  1004. const systemChange = async () => {
  1005. let arr = [];
  1006. systemData.coverPicture.forEach((item) => {
  1007. arr.push(item.url);
  1008. });
  1009. console.log(systemData.hourlivetime);
  1010. let flag = systemData.hourlivetime.some((item) => {
  1011. return item.time.length == 0;
  1012. });
  1013. let hourlivetime = [];
  1014. if (flag) {
  1015. ElMessage({
  1016. type: "warning",
  1017. showClose: true,
  1018. message: "时间段不能为空",
  1019. center: true,
  1020. });
  1021. return false;
  1022. } else {
  1023. systemData.hourlivetime.forEach((item) => {
  1024. let val = item.time.join("-");
  1025. hourlivetime.push(val);
  1026. });
  1027. }
  1028. console.log(hourlivetime.join(","));
  1029. let data = {
  1030. permissionSettingId: sessionStorage.getItem("permissionSettingId"), //权限表id
  1031. id: systemData.id, //id(不带id时是添加,带id时是修改)
  1032. coverPicture: arr.join(","), //封面图,多张用,隔开
  1033. name: systemData.name, //名称
  1034. address: systemData.address, //地址
  1035. openingTime: systemData.openingTime, //开业时间
  1036. decorationTime: systemData.decorationTime, //装修时间
  1037. liveTime: systemData.liveTime[0], //入住时间
  1038. leaveTime: systemData.liveTime[1], //离店时间
  1039. hourTime: hourlivetime.join(","), // 钟点房时段
  1040. phoneNumbr: systemData.phoneNumbr, //电话号码
  1041. introductory: systemData.introductory, //简介
  1042. };
  1043. let res = await axios({
  1044. method: "post",
  1045. url: api.value + "/apartment-setting/updateOrSave",
  1046. headers: {
  1047. token: sessionStorage.getItem("token"),
  1048. user_head: sessionStorage.getItem("user_head"),
  1049. },
  1050. data: data,
  1051. });
  1052. console.log(res, "系统设置信息修改");
  1053. if (res.data.code == 200) {
  1054. getList();
  1055. ElMessage({
  1056. type: "success",
  1057. showClose: true,
  1058. message: res.data.message,
  1059. center: true,
  1060. });
  1061. } else {
  1062. ElMessage({
  1063. type: "error",
  1064. showClose: true,
  1065. message: res.data.message,
  1066. center: true,
  1067. });
  1068. }
  1069. };
  1070. // 富文本编辑器 (----------------------------------------------------)
  1071. const richtextClick = lodash.debounce((data) => {
  1072. console.log(data, "富文本传过来的数据");
  1073. systemData.introductory = data.html;
  1074. fatherMessage.value.data = data.html;
  1075. if (flagBtn.value.gongyushezhi == 1) {
  1076. systemChange();
  1077. }
  1078. }, 500);
  1079. // 查看设施服务添加 (===============================================================)
  1080. const facilityServicesAdd = async () => {
  1081. addtableDataDialog.value = true;
  1082. addtableRuleForm.icon = "";
  1083. addtableRuleForm.name = "";
  1084. addtableRuleForm.id = "";
  1085. };
  1086. const cancelAddtable = () => {
  1087. addtableDataDialog.value = false;
  1088. };
  1089. // 上传图片
  1090. const handleAddtableChange = async (file, fileList) => {
  1091. console.log(file, "11111111");
  1092. };
  1093. // 可以获取图片参数(封面图上传图片)
  1094. const handleAddtableUpload = async (file) => {
  1095. console.log(file, "22222222");
  1096. let data = new FormData();
  1097. data.set("file", file.file);
  1098. let res = await axios({
  1099. method: "post",
  1100. url: api.value + "/upload/save",
  1101. headers: {
  1102. token: sessionStorage.getItem("token"),
  1103. user_head: sessionStorage.getItem("user_head"),
  1104. },
  1105. data: data,
  1106. });
  1107. console.log(res, "成功上传图片");
  1108. if (res.data.code == 200) {
  1109. addtableRuleForm.icon = res.data.data.url;
  1110. } else {
  1111. ElMessage({
  1112. type: "error",
  1113. showClose: true,
  1114. message: res.data.message,
  1115. center: true,
  1116. });
  1117. }
  1118. };
  1119. // 限制上传图片的大小
  1120. const beforeAddtableAvatarUpload = (rawFile) => {
  1121. // console.log(rawFile.type);
  1122. if (rawFile.type !== "image/jpeg" && rawFile.type !== "image/png") {
  1123. ElMessage.error("图片格式必须为JPG/PNG格式!");
  1124. return false;
  1125. } else if (rawFile.size / 1024 / 1024 > 1) {
  1126. ElMessage.error("图片的大小不能超过1MB!");
  1127. return false;
  1128. }
  1129. return true;
  1130. };
  1131. // 确认维护信息
  1132. const submitAddtable = lodash.debounce(async (formEl) => {
  1133. if (!formEl) return;
  1134. await formEl.validate(async (valid, fields) => {
  1135. if (valid) {
  1136. let data = {
  1137. permissionSettingId: sessionStorage.getItem("permissionSettingId"), //权限表id
  1138. iconPath: addtableRuleForm.icon, //图标路径
  1139. houseService: addtableRuleForm.name, //房型服务
  1140. };
  1141. if (addtableRuleForm.id) {
  1142. data.id = addtableRuleForm.id;
  1143. let res = await axios({
  1144. method: "post",
  1145. url: api.value + "/facility-services/update",
  1146. headers: {
  1147. token: sessionStorage.getItem("token"),
  1148. user_head: sessionStorage.getItem("user_head"),
  1149. },
  1150. data: data,
  1151. });
  1152. console.log(res, "确定编辑服务");
  1153. if (res.data.code == 200) {
  1154. facilityServices();
  1155. ElMessage({
  1156. type: "success",
  1157. showClose: true,
  1158. message: res.data.message,
  1159. center: true,
  1160. });
  1161. addtableDataDialog.value = false;
  1162. } else {
  1163. ElMessage({
  1164. type: "error",
  1165. showClose: true,
  1166. message: res.data.message,
  1167. center: true,
  1168. });
  1169. }
  1170. } else {
  1171. let res = await axios({
  1172. method: "post",
  1173. url: api.value + "/facility-services/save",
  1174. headers: {
  1175. token: sessionStorage.getItem("token"),
  1176. user_head: sessionStorage.getItem("user_head"),
  1177. },
  1178. data: data,
  1179. });
  1180. console.log(res, "确定添加服务");
  1181. if (res.data.code == 200) {
  1182. facilityServices();
  1183. ElMessage({
  1184. type: "success",
  1185. showClose: true,
  1186. message: res.data.message,
  1187. center: true,
  1188. });
  1189. addtableDataDialog.value = false;
  1190. } else {
  1191. ElMessage({
  1192. type: "error",
  1193. showClose: true,
  1194. message: res.data.message,
  1195. center: true,
  1196. });
  1197. }
  1198. }
  1199. } else {
  1200. console.log("error submit!", fields);
  1201. }
  1202. });
  1203. }, 1500);
  1204. const facilityServicesEdit = (row) => {
  1205. console.log(row);
  1206. addtableDataDialog.value = true;
  1207. addtableRuleForm.icon = row.iconPath;
  1208. addtableRuleForm.name = row.houseService;
  1209. addtableRuleForm.id = row.id;
  1210. };
  1211. // 删除服务设置
  1212. const facilityServicesDel = async (row) => {
  1213. let data = {
  1214. permissionSettingId: sessionStorage.getItem("permissionSettingId"),
  1215. id: row.id,
  1216. };
  1217. let res = await axios({
  1218. method: "get",
  1219. url: api.value + "/facility-services/delete",
  1220. headers: {
  1221. token: sessionStorage.getItem("token"),
  1222. user_head: sessionStorage.getItem("user_head"),
  1223. },
  1224. params: data,
  1225. });
  1226. console.log(res, "删除服务设置");
  1227. if (res.data.code == 200) {
  1228. facilityServices();
  1229. ElMessage({
  1230. type: "success",
  1231. showClose: true,
  1232. message: res.data.message,
  1233. center: true,
  1234. });
  1235. } else {
  1236. ElMessage({
  1237. type: "error",
  1238. showClose: true,
  1239. message: res.data.message,
  1240. center: true,
  1241. });
  1242. }
  1243. };
  1244. // 退房设置修改 (===============================================================)
  1245. const checkOutSettingUpdate = async () => {
  1246. let data = {
  1247. id: checkOutData.id, //退房设置id(不带id时是添加,带id时是修改)
  1248. permissionSettingId: sessionStorage.getItem("permissionSettingId"),
  1249. turnOffTime: checkOutData.turnOffTime, //退房后断水断电时间 单位:分钟
  1250. preDay: checkOutData.preDay, //预定提前天数 单位:天
  1251. };
  1252. let resss = await axios({
  1253. method: "post",
  1254. url: api.value + "/check-out-setting/saveOrUpdate",
  1255. headers: {
  1256. token: sessionStorage.getItem("token"),
  1257. user_head: sessionStorage.getItem("user_head"),
  1258. },
  1259. data: data,
  1260. });
  1261. console.log(resss, "退房设置修改");
  1262. if (resss.data.code == 200) {
  1263. checkOutSetting();
  1264. ElMessage({
  1265. type: "success",
  1266. showClose: true,
  1267. message: resss.data.message,
  1268. center: true,
  1269. });
  1270. } else {
  1271. ElMessage({
  1272. type: "error",
  1273. showClose: true,
  1274. message: resss.data.message,
  1275. center: true,
  1276. });
  1277. }
  1278. };
  1279. // 补助设置修改 (================================================================)
  1280. const subsidySetupUpdate = async () => {
  1281. let data = {
  1282. id: subsidySetupData.id, //补助设置id(不带id时是添加,带id时是修改)
  1283. permissionSettingId: sessionStorage.getItem("permissionSettingId"),
  1284. freeQuotaOfWater: subsidySetupData.freeQuotaOfWater, //水免费额度
  1285. freeQuotaOfElectric: subsidySetupData.freeQuotaOfElectric, //电免费额度
  1286. };
  1287. let resss = await axios({
  1288. method: "post",
  1289. url: api.value + "/subsidy-setup/saveOrUpdate",
  1290. headers: {
  1291. token: sessionStorage.getItem("token"),
  1292. user_head: sessionStorage.getItem("user_head"),
  1293. },
  1294. data: data,
  1295. });
  1296. console.log(resss, "补助设置修改");
  1297. if (resss.data.code == 200) {
  1298. subsidySetup();
  1299. ElMessage({
  1300. type: "success",
  1301. showClose: true,
  1302. message: resss.data.message,
  1303. center: true,
  1304. });
  1305. } else {
  1306. ElMessage({
  1307. type: "error",
  1308. showClose: true,
  1309. message: resss.data.message,
  1310. center: true,
  1311. });
  1312. }
  1313. };
  1314. // 催缴设置修改 (================================================================)
  1315. const callSystemDataUpdate = async () => {
  1316. let data = {
  1317. id: callSystemData.id, //催缴设置id(不带id时是添加,带id时是修改)
  1318. permissionSettingId: sessionStorage.getItem("permissionSettingId"),
  1319. askForPayment: callSystemData.askForPayment,
  1320. };
  1321. let resss = await axios({
  1322. method: "post",
  1323. url: api.value + "/call-system/saveOrUpdate",
  1324. headers: {
  1325. token: sessionStorage.getItem("token"),
  1326. user_head: sessionStorage.getItem("user_head"),
  1327. },
  1328. data: data,
  1329. });
  1330. console.log(resss, "催缴设置修改");
  1331. if (resss.data.code == 200) {
  1332. callSystem();
  1333. ElMessage({
  1334. type: "success",
  1335. showClose: true,
  1336. message: resss.data.message,
  1337. center: true,
  1338. });
  1339. } else {
  1340. ElMessage({
  1341. type: "error",
  1342. showClose: true,
  1343. message: resss.data.message,
  1344. center: true,
  1345. });
  1346. }
  1347. };
  1348. // 黑名单设置修改 (================================================================)
  1349. const blackListDataUpdate = async () => {
  1350. let data = {
  1351. id: blackListData.id, //催缴设置id(不带id时是添加,带id时是修改)
  1352. count: blackListData.num,
  1353. };
  1354. let resss = await axios({
  1355. method: "post",
  1356. url: api.value + "/blacklist-setting/update",
  1357. headers: {
  1358. token: sessionStorage.getItem("token"),
  1359. user_head: sessionStorage.getItem("user_head"),
  1360. },
  1361. data: data,
  1362. });
  1363. console.log(resss, "催缴设置修改");
  1364. if (resss.data.code == 200) {
  1365. blackList();
  1366. ElMessage({
  1367. type: "success",
  1368. showClose: true,
  1369. message: resss.data.message,
  1370. center: true,
  1371. });
  1372. } else {
  1373. ElMessage({
  1374. type: "error",
  1375. showClose: true,
  1376. message: resss.data.message,
  1377. center: true,
  1378. });
  1379. }
  1380. };
  1381. // 左右切换走马灯
  1382. const infoImgClick2 = (val) => {
  1383. if (val == "right") {
  1384. //点击右按钮切换至下一页走马灯
  1385. infoImg2.value.next();
  1386. } else {
  1387. //点击左按钮切换至上一页走马灯
  1388. infoImg2.value.prev();
  1389. }
  1390. };
  1391. // 得到当前幻灯片的索引
  1392. const switchImg2 = (val) => {
  1393. // console.log(val);
  1394. switchImgInd2.value = val;
  1395. };
  1396. // 删除幻灯片中的图片
  1397. const delImgList = (item) => {
  1398. console.log(switchImgInd2.value);
  1399. // console.log(item);
  1400. systemData.coverPicture = systemData.coverPicture.filter((i, index) => {
  1401. // return i.count != item.count;
  1402. return index != switchImgInd2.value;
  1403. });
  1404. systemChange();
  1405. };
  1406. //轮播图上传(-----------------------------------------------)
  1407. // 移出照片
  1408. const handleRemove2 = (uploadFile, uploadFiles) => {
  1409. // console.log(uploadFile.uid, uploadFiles);
  1410. // fileList.list = fileList.list.filter((item) => {
  1411. // return item.uid != uploadFile.uid;
  1412. // });
  1413. // ruleForm.fileListJson = fileList.list;
  1414. };
  1415. // 点击图片的查看按钮
  1416. const handlePreview2 = (file) => {
  1417. // imgUrl.value = file.url;
  1418. // imgVisible.value = true;
  1419. // console.log(file);
  1420. };
  1421. // 限制上传图片的大小
  1422. const beforeAvatarUpload2 = (rawFile) => {
  1423. // console.log(rawFile.type);
  1424. if (rawFile.type !== "image/jpeg" && rawFile.type !== "image/png") {
  1425. ElMessage.error("图片格式必须为JPG/PNG格式!");
  1426. return false;
  1427. } else if (rawFile.size / 1024 / 1024 > 10) {
  1428. ElMessage.error("图片的大小不能超过10MB!");
  1429. return false;
  1430. }
  1431. return true;
  1432. };
  1433. // 添加照片时往fileList列表中添加图片信息
  1434. const handleChange2 = async (file, fileLists) => {
  1435. // console.log(file, "1111");
  1436. // fileList.list.push(file);
  1437. };
  1438. // 可以获取图片参数
  1439. const handleUpload2 = async (file) => {
  1440. console.log(file, "22222222");
  1441. let data = new FormData();
  1442. data.set("file", file.file);
  1443. let res = await axios({
  1444. method: "post",
  1445. url: api.value + "/upload/save",
  1446. headers: {
  1447. token: sessionStorage.getItem("token"),
  1448. user_head: sessionStorage.getItem("user_head"),
  1449. },
  1450. data: data,
  1451. });
  1452. console.log(res, "成功上传图片");
  1453. if (res.data.code == 200) {
  1454. console.log(systemData.coverPicture);
  1455. systemData.coverPicture.push({
  1456. url: res.data.data.url,
  1457. count: systemData.coverPicture.length,
  1458. });
  1459. systemChange();
  1460. } else {
  1461. ElMessage({
  1462. type: "error",
  1463. showClose: true,
  1464. message: res.data.message,
  1465. center: true,
  1466. });
  1467. }
  1468. console.log(systemData.coverPicture, "详情图片");
  1469. };
  1470. // 查看图片一张
  1471. const lookImgs = (i) => {
  1472. bgImg.value = true;
  1473. let arr = [];
  1474. arr.push({
  1475. url: i,
  1476. });
  1477. bgImgList.value = arr;
  1478. };
  1479. // 查看图片多张
  1480. const lookImg = () => {
  1481. bgImg.value = true;
  1482. // let arr = [];
  1483. // systemData.coverPicture.forEach((item) => {
  1484. // arr.push({
  1485. // url: item.url,
  1486. // count: item.count,
  1487. // });
  1488. // });
  1489. switchImgInd3.value = switchImgInd2.value;
  1490. bgImgList.value = systemData.coverPicture;
  1491. };
  1492. // 切换图片后缩列图也跟着变
  1493. const switchBgImg = (val) => {
  1494. console.log(val);
  1495. switchImgInd3.value = val;
  1496. infoImg2.value.setActiveItem(val);
  1497. };
  1498. // 表格斑马纹颜色修改
  1499. const tableRowClassName = ({ row, rowIndex }) => {
  1500. if (rowIndex % 2 === 0) {
  1501. return "even";
  1502. } else if (rowIndex % 2 !== 0) {
  1503. return "odd";
  1504. }
  1505. return "";
  1506. };
  1507. onBeforeMount(async () => {
  1508. api.value = store.state.user.api;
  1509. const btnflag = JSON.parse(sessionStorage.getItem("btnflag"));
  1510. flagBtn.value = btnflag.system;
  1511. console.log(flagBtn.value, "按钮权限");
  1512. getList();
  1513. facilityServices();
  1514. checkOutSetting();
  1515. subsidySetup();
  1516. callSystem();
  1517. blackList();
  1518. });
  1519. onMounted(() => {
  1520. setTimeout(() => {
  1521. textShow.value = true;
  1522. }, 1000);
  1523. });
  1524. </script>
  1525. <style scoped lang="scss">
  1526. .content-box {
  1527. width: calc(100% - 40px);
  1528. height: calc(100% - 105px);
  1529. margin: 20px auto;
  1530. background-color: #fff;
  1531. color: #fff;
  1532. display: flex;
  1533. flex-direction: column;
  1534. box-shadow: 0px 3px 10px rgba(0, 97, 255, 0.2);
  1535. .title {
  1536. // width: calc(100wh - 40px);
  1537. .cameratxt {
  1538. height: 60px;
  1539. line-height: 60px;
  1540. margin: 0 30px;
  1541. border-bottom: 1px solid #ccc;
  1542. color: #000;
  1543. font-size: 18px;
  1544. font-weight: 600;
  1545. }
  1546. }
  1547. .contentss {
  1548. width: calc(100% - 60px);
  1549. height: calc(100% - 81px);
  1550. margin: 0 auto;
  1551. display: flex;
  1552. overflow: auto;
  1553. .left {
  1554. // width: 900px;
  1555. width: calc(100% - 600px);
  1556. min-width: 750px;
  1557. color: #000;
  1558. margin-right: 50px;
  1559. .titles {
  1560. font-size: 18px;
  1561. margin: 20px 0;
  1562. font-weight: 700;
  1563. }
  1564. .tooltips {
  1565. display: flex;
  1566. margin: 22px 0;
  1567. .img {
  1568. display: flex;
  1569. margin-right: 20px;
  1570. .img_title {
  1571. // margin: 0 20px 0 0;
  1572. display: flex;
  1573. flex-direction: column;
  1574. align-items: center;
  1575. span {
  1576. display: inline-block;
  1577. width: 53px;
  1578. }
  1579. }
  1580. .carousel {
  1581. height: 120px;
  1582. display: flex;
  1583. align-items: center;
  1584. position: relative;
  1585. .pre {
  1586. img {
  1587. width: 30px;
  1588. cursor: pointer;
  1589. }
  1590. }
  1591. .numImg {
  1592. position: relative;
  1593. color: #fff;
  1594. right: 70px;
  1595. bottom: -40px;
  1596. }
  1597. .el-carousel {
  1598. width: 213px;
  1599. height: 120px;
  1600. img {
  1601. width: 213px;
  1602. height: 120px;
  1603. }
  1604. :deep(.el-carousel__arrow) {
  1605. display: none;
  1606. }
  1607. :deep(.el-carousel__container) {
  1608. border: 1px solid #ccc;
  1609. height: 120px !important;
  1610. box-sizing: border-box;
  1611. .el-carousel__arrow {
  1612. display: none;
  1613. }
  1614. }
  1615. }
  1616. .lookImg {
  1617. width: 213px;
  1618. height: 120px;
  1619. cursor: pointer;
  1620. position: absolute;
  1621. top: 0;
  1622. left: 30px;
  1623. display: flex;
  1624. justify-content: center;
  1625. align-items: center;
  1626. img {
  1627. width: 30px;
  1628. height: 30px;
  1629. opacity: 0;
  1630. }
  1631. .delimg {
  1632. background: url("../../assets/imgDel.png");
  1633. background-size: 100% 100%;
  1634. width: 30px;
  1635. height: 30px;
  1636. opacity: 0;
  1637. }
  1638. }
  1639. .lookImg:hover {
  1640. background-color: rgba(0, 0, 0, 0.2);
  1641. img {
  1642. opacity: 1;
  1643. }
  1644. .delimg {
  1645. opacity: 1;
  1646. }
  1647. }
  1648. }
  1649. .avatar-uploader {
  1650. margin: 20px 0 10px 90px;
  1651. :deep(.el-upload-list) {
  1652. display: none;
  1653. }
  1654. }
  1655. }
  1656. .rows {
  1657. width: 100%;
  1658. display: flex;
  1659. justify-content: space-between;
  1660. .conts {
  1661. display: flex;
  1662. align-items: center;
  1663. .name {
  1664. width: 80px;
  1665. margin: 0 12px 0 0;
  1666. }
  1667. .el-input {
  1668. max-width: 300px;
  1669. }
  1670. }
  1671. .textarea {
  1672. width: 100%;
  1673. .name {
  1674. margin: 5px 0 15px 0;
  1675. }
  1676. }
  1677. .hourlivetime {
  1678. display: flex;
  1679. // align-items: center;
  1680. flex-direction: column;
  1681. .addlive {
  1682. display: flex;
  1683. align-items: center;
  1684. margin-bottom: 15px;
  1685. .img {
  1686. width: 28px;
  1687. height: 28px;
  1688. margin-left: 15px;
  1689. margin-right: 0;
  1690. cursor: pointer;
  1691. }
  1692. }
  1693. }
  1694. }
  1695. }
  1696. }
  1697. .right {
  1698. // width: calc(100% - 950px);
  1699. width: 600px;
  1700. height: 100%;
  1701. color: #000;
  1702. .ApartmentSetting {
  1703. .titles {
  1704. display: flex;
  1705. justify-content: space-between;
  1706. align-items: center;
  1707. // border-bottom: 1px solid rgba(229, 229, 229, 1);
  1708. .title {
  1709. font-size: 18px;
  1710. padding: 20px 0;
  1711. font-weight: 700;
  1712. }
  1713. .set {
  1714. font-size: 18px;
  1715. font-weight: 700;
  1716. margin: 30px 0 0 0;
  1717. }
  1718. }
  1719. .el-table--fit {
  1720. height: 100%;
  1721. :deep(.el-table__header-wrapper) {
  1722. background-color: #000;
  1723. font-size: 15px;
  1724. color: #000;
  1725. .cell {
  1726. color: #000;
  1727. }
  1728. }
  1729. :deep(.el-table__body-wrapper) {
  1730. .el-scrollbar {
  1731. height: 200px;
  1732. }
  1733. }
  1734. :deep(.el-table__row) {
  1735. height: 50px;
  1736. font-size: 15px;
  1737. color: #000;
  1738. }
  1739. :deep(.el-table__row td) {
  1740. padding: 0;
  1741. border: 0;
  1742. }
  1743. .el-button--primary {
  1744. margin-left: 5px;
  1745. }
  1746. :deep(.el-table__body .even) {
  1747. background-color: #fff;
  1748. }
  1749. :deep(.el-table__body .odd) {
  1750. background-color: rgba(240, 243, 247, 1);
  1751. }
  1752. :deep(.options) {
  1753. display: flex;
  1754. justify-content: center;
  1755. align-items: center;
  1756. .reset {
  1757. color: rgba(9, 101, 98, 1);
  1758. cursor: pointer;
  1759. }
  1760. .look {
  1761. margin: 0 15px;
  1762. color: rgba(30, 125, 251, 1);
  1763. cursor: pointer;
  1764. }
  1765. .del {
  1766. color: rgba(212, 48, 48, 1);
  1767. cursor: pointer;
  1768. }
  1769. }
  1770. }
  1771. .system {
  1772. margin: 20px 0 0 0;
  1773. display: flex;
  1774. align-items: center;
  1775. }
  1776. }
  1777. }
  1778. }
  1779. .bgImg {
  1780. position: absolute;
  1781. left: 0;
  1782. top: 0;
  1783. z-index: 99999999;
  1784. width: 100%;
  1785. height: 100%;
  1786. background-color: rgba(255, 255, 255, 0.8);
  1787. // border-radius: 50px;
  1788. :deep(.el-carousel__container) {
  1789. width: 100%;
  1790. height: calc(100vh);
  1791. .el-carousel__item {
  1792. display: flex;
  1793. justify-content: center;
  1794. img {
  1795. height: 100%;
  1796. }
  1797. }
  1798. }
  1799. }
  1800. // 添加房型弹窗样式
  1801. :deep(.addtable) {
  1802. height: 400px;
  1803. border-radius: 11px;
  1804. .el-dialog__header {
  1805. border-radius: 11px 11px 0 0;
  1806. background: rgba(237, 241, 245, 1);
  1807. font-weight: 600;
  1808. margin: 0;
  1809. .el-dialog__headerbtn {
  1810. outline: none;
  1811. }
  1812. }
  1813. .el-dialog__body {
  1814. padding: 10px 30px 10px 30px;
  1815. .el-form {
  1816. display: flex;
  1817. flex-direction: column;
  1818. .el-form-item__content {
  1819. .lookImg {
  1820. width: 120px;
  1821. height: 120px;
  1822. margin-bottom: 10px;
  1823. img {
  1824. width: 120px;
  1825. height: 120px;
  1826. }
  1827. .lookImgs {
  1828. width: 120px;
  1829. height: 120px;
  1830. cursor: pointer;
  1831. position: absolute;
  1832. background-color: rgba(0, 0, 0, 0.3);
  1833. left: 0;
  1834. top: 0;
  1835. display: flex;
  1836. justify-content: center;
  1837. align-items: center;
  1838. opacity: 0;
  1839. img {
  1840. width: 30px;
  1841. height: 30px;
  1842. }
  1843. }
  1844. .lookImgs:hover {
  1845. opacity: 1;
  1846. }
  1847. }
  1848. .avatar-uploader {
  1849. .el-upload-list {
  1850. display: none;
  1851. }
  1852. }
  1853. }
  1854. }
  1855. .options {
  1856. width: 100%;
  1857. margin: 10px 0;
  1858. .el-form-item__content {
  1859. .queding {
  1860. margin-left: 20px;
  1861. color: #fff;
  1862. }
  1863. display: flex;
  1864. flex-direction: row-reverse;
  1865. }
  1866. }
  1867. }
  1868. }
  1869. }
  1870. </style>