index.vue 68 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113
  1. <template>
  2. <div class="app-container">
  3. <el-row>
  4. <el-col :span="24">
  5. <div class="cell">
  6. <div class="cell-title">
  7. <div class="title-left">
  8. <div class="title">系统设置/民宿管理</div>
  9. </div>
  10. </div>
  11. <div class="cell-body">
  12. <div class="controls">
  13. <el-form :inline="true" :model="formInline" class="demo-form-inline">
  14. <el-form-item label="所属乡镇">
  15. <el-select v-model="formInline.id" clearable placeholder="请选择">
  16. <el-option v-for="item in formInline.options" :key="item.id" :label="item.hotelTownship" :value="item.id">
  17. </el-option>
  18. </el-select>
  19. </el-form-item>
  20. <el-form-item label="">
  21. <el-input v-model="formInline.adminName" prefix-icon="el-icon-search" clearable placeholder="请输入关键字"></el-input>
  22. </el-form-item>
  23. <el-form-item>
  24. <el-button type="primary" class="btn-search" @click="btn_search">查询</el-button>
  25. </el-form-item>
  26. </el-form>
  27. <div class="right-btns">
  28. <el-button type="primary" class="export" @click="add_house_dialog">添加民宿</el-button>
  29. <el-button type="primary" class="export" @click="hostelConfiguration">民宿配置</el-button>
  30. </div>
  31. </div>
  32. <el-table :data="tableData" height="510" style="width: 100%" :cell-style="cell_style" v-loading="loading"
  33. :header-cell-style="header_cell_style">
  34. <el-table-column type="expand" width="58">
  35. <template slot-scope="props">
  36. <el-form label-position="left" inline class="demo-table-expand">
  37. <el-form-item label="银行卡号">
  38. <span>{{ props.row.bankCard }}</span>
  39. </el-form-item>
  40. <el-form-item label="银行名称">
  41. <span>{{ props.row.bankName }}</span>
  42. </el-form-item>
  43. <el-form-item label="卡户主姓名">
  44. <span>{{ props.row.cardName }}</span>
  45. </el-form-item>
  46. <el-form-item label="权限">
  47. <span>{{ props.row.level == 1 ? '管理员' : '超级管理员' }}</span>
  48. </el-form-item>
  49. <el-form-item label="创建时间">
  50. <span>{{ props.row.createDate }}</span>
  51. </el-form-item>
  52. <el-form-item label="修改时间">
  53. <span>{{ props.row.modifyDate }}</span>
  54. </el-form-item>
  55. </el-form>
  56. </template>
  57. </el-table-column>
  58. <el-table-column label="序号" align="center" width="100">
  59. <template slot-scope="scope">
  60. <span>{{ scope.row.xuhao }}</span>
  61. </template>
  62. </el-table-column>
  63. <el-table-column label="状态" align="center" width="80">
  64. <template slot-scope="scope">
  65. <span>{{ scope.row.status === 1 ? '正常' : '已冻结' }}</span>
  66. </template>
  67. </el-table-column>
  68. <el-table-column label="民宿名称" align="center">
  69. <template slot-scope="scope">
  70. <span>{{ scope.row.hotelName }}</span>
  71. </template>
  72. </el-table-column>
  73. <el-table-column label="联系人(法人)" align="center">
  74. <template slot-scope="scope">
  75. <span>{{ scope.row.corpnName }}</span>
  76. </template>
  77. </el-table-column>
  78. <el-table-column label="联系电话" align="center">
  79. <template slot-scope="scope">
  80. <span>{{ scope.row.corpnPhone }}</span>
  81. </template>
  82. </el-table-column>
  83. <el-table-column label="所属乡镇" align="center">
  84. <template slot-scope="scope">
  85. <span>{{ scope.row.hotelTownshipName}}</span>
  86. </template>
  87. </el-table-column>
  88. <el-table-column label="民宿账号" align="center">
  89. <template slot-scope="scope">
  90. <span>{{ scope.row.adminName }}</span>
  91. </template>
  92. </el-table-column>
  93. <el-table-column label="操作" align="center" width="210">
  94. <template slot-scope="scope">
  95. <div class="action-btns">
  96. <el-link class="bg-btn" @click="show_confirm_dialog(scope.$index, scope.row, 'reset')">密码重置</el-link>
  97. <el-link class="bg-btn" @click="modify_house_dialog(scope.$index, scope.row)">修改</el-link>
  98. <el-link v-if="scope.row.status === 1" type="primary"
  99. @click="show_confirm_dialog(scope.$index, scope.row, 'frozen')">冻结</el-link>
  100. <el-link v-if="scope.row.status === 2" type="warning"
  101. @click="show_confirm_dialog(scope.$index, scope.row, 'thaw')">解冻</el-link>
  102. <el-link type="danger" @click="show_confirm_dialog(scope.$index, scope.row, 'delete')">删除</el-link>
  103. </div>
  104. </template>
  105. </el-table-column>
  106. </el-table>
  107. <div class="pagination-table">
  108. <div class="txt-notice">注:账号解冻后,密码默认为Jams_123456</div>
  109. <el-pagination @current-change="currentPageChange" :current-page.sync="pagination.currentPage" :page-size="pagination.pageSize"
  110. layout="prev, pager, next, jumper" :total="pagination.total">
  111. </el-pagination>
  112. </div>
  113. </div>
  114. </div>
  115. </el-col>
  116. </el-row>
  117. <!-- 添加民宿 -->
  118. <el-dialog title="添加民宿" custom-class="add-house-class" :visible.sync="dialogAddHostelFormVisible" :close-on-click-modal="false"
  119. :close-on-press-escape="false" @close="add_house_dialog_close">
  120. <el-form :model="formAddHostel" ref="addHostelForm" :rules="addHostelFormRules">
  121. <el-row>
  122. <el-col :span="12">
  123. <div style="font-size: 16px;font-weight: 700; color: rgba(0, 0, 0, 1); margin: -10px 0 20px 20px;">民宿信息</div>
  124. <el-form-item label="民宿名称:" :label-width="formLabelWidth" :required="true" prop="hotelName">
  125. <el-input v-model="formAddHostel.hotelName" autocomplete="off" placeholder="请输入民宿名称" maxlength="20">
  126. </el-input>
  127. </el-form-item>
  128. <el-form-item label="法人姓名:" :label-width="formLabelWidth" :required="true" prop="corpnName">
  129. <el-input v-model="formAddHostel.corpnName" autocomplete="off" placeholder="请输入法人姓名" maxlength="8">
  130. </el-input>
  131. </el-form-item>
  132. <el-form-item label="法人电话:" :label-width="formLabelWidth" :required="true" prop="corpnPhone">
  133. <el-input v-model="formAddHostel.corpnPhone" autocomplete="off" placeholder="请输入法人电话" maxlength="13">
  134. </el-input>
  135. </el-form-item>
  136. <el-form-item label="所属乡镇:" :label-width="formLabelWidth" :required="true" prop="id">
  137. <el-select v-model="formAddHostel.id" clearable placeholder="请选择乡镇" @change="getHotelId($event)">
  138. <el-option v-for="item in formAddHostel.options" :key="item.id" :label="item.hotelTownship" :value="item.id">
  139. </el-option>
  140. </el-select>
  141. </el-form-item>
  142. <el-form-item label="民宿账号:" :label-width="formLabelWidth" :required="true" prop="adminName">
  143. <el-input v-model="formAddHostel.adminName" autocomplete="off" placeholder="请输入民宿账号" maxlength="16">
  144. </el-input>
  145. </el-form-item>
  146. <div
  147. style="font-size: 18px;font-weight: 400;letter-spacing: 0px;line-height: 26.06px;color: rgba(212, 48, 48, 1);text-align: left;vertical-align: top;">
  148. 注:账号解冻后,密码默认为Jams_123456</div>
  149. </el-col>
  150. <el-col :span="12">
  151. <div style="font-size: 16px;font-weight: 700; color: rgba(0, 0, 0, 1); margin: -10px 0 20px 20px;">提现信息</div>
  152. <el-form-item label="银行卡号:" :label-width="formLabelWidth" :required="true" prop="bankCard">
  153. <el-input v-model="formAddHostel.bankCard" autocomplete="off" placeholder="请输入银行卡号" maxlength="19">
  154. </el-input>
  155. </el-form-item>
  156. <el-form-item label="户主姓名:" :label-width="formLabelWidth" :required="true" prop="cardName">
  157. <el-input v-model="formAddHostel.cardName" autocomplete="off" placeholder="请输入户主姓名" maxlength="8">
  158. </el-input>
  159. </el-form-item>
  160. <el-form-item label="银行名称:" :label-width="formLabelWidth" :required="true" prop="bankName">
  161. <el-input v-model="formAddHostel.bankName" autocomplete="off" placeholder="请输入银行名称" maxlength="10">
  162. </el-input>
  163. </el-form-item>
  164. </el-col>
  165. </el-row>
  166. <el-row>
  167. <el-col :span="24">
  168. <div style="font-size: 16px;font-weight: 700; color: rgba(0, 0, 0, 1); margin: 0px 0 20px 20px;">营业执照</div>
  169. <el-form-item label="" :required="true" prop="fileUrl">
  170. <pl-upload v-model="formAddHostel.fileUrl" :times="times" :linkUrl="formAddHostel.url" :limitCount="6" :type="1"></pl-upload>
  171. </el-form-item>
  172. </el-col>
  173. </el-row>
  174. </el-form>
  175. <div
  176. style="font-size: 18px;font-weight: 400;letter-spacing: 0px;line-height: 26.06px;color: rgba(212, 48, 48, 1);text-align: left;vertical-align: top;">
  177. (注:最多可上传6张图片)</div>
  178. <div slot="footer" class="dialog-footer">
  179. <el-button class="add-info-cancel-btn" @click="dialogAddHostelFormVisible = false">取 消</el-button>
  180. <el-button class="add-info-confirm-btn" @click="add_house_dialog_handler">确 认</el-button>
  181. </div>
  182. </el-dialog>
  183. <!-- 修改民宿对话框 -->
  184. <el-dialog title="修改民宿" custom-class="modify-house-class" :visible.sync="dialogModifyHostelFormVisible" :close-on-click-modal="false"
  185. :close-on-press-escape="false" @close="modify_house_dialog_close">
  186. <el-form :model="formModifyHostel" ref="modifyHostelForm" :rules="modifyHostelFormRules">
  187. <el-row>
  188. <el-col :span="12">
  189. <div style="font-size: 16px;font-weight: 700; color: rgba(0, 0, 0, 1); margin: -10px 0 20px 20px;">民宿信息</div>
  190. <el-form-item label="民宿名称:" :label-width="formLabelWidth" :required="true" prop="hotelName">
  191. <el-input v-model="formModifyHostel.hotelName" autocomplete="off" placeholder="请输入民宿名称" maxlength="20">
  192. </el-input>
  193. </el-form-item>
  194. <el-form-item label="法人姓名:" :label-width="formLabelWidth" :required="true" prop="corpnName">
  195. <el-input v-model="formModifyHostel.corpnName" autocomplete="off" placeholder="请输入法人姓名" maxlength="8">
  196. </el-input>
  197. </el-form-item>
  198. <el-form-item label="法人电话:" :label-width="formLabelWidth" :required="true" prop="corpnPhone">
  199. <el-input v-model="formModifyHostel.corpnPhone" autocomplete="off" placeholder="请输入法人电话" maxlength="13">
  200. </el-input>
  201. </el-form-item>
  202. <el-form-item label="所属乡镇:" :label-width="formLabelWidth" :required="true" prop="id">
  203. <el-select v-model="formModifyHostel.hotelTownship" clearable placeholder="请选择乡镇">
  204. <el-option v-for="item in formModifyHostel.options" :key="item.id" :label="item.hotelTownship" :value="item.id">
  205. </el-option>
  206. </el-select>
  207. </el-form-item>
  208. <el-form-item label="民宿账号:" :label-width="formLabelWidth" :required="true" prop="adminName">
  209. <el-input v-model="formModifyHostel.adminName" autocomplete="off" placeholder="请输入民宿账号" maxlength="16">
  210. </el-input>
  211. </el-form-item>
  212. <div
  213. style="font-size: 18px;font-weight: 400;letter-spacing: 0px;line-height: 26.06px;color: rgba(212, 48, 48, 1);text-align: left;vertical-align: top;">
  214. 注:账号解冻后,密码默认为Jams_123456</div>
  215. </el-col>
  216. <el-col :span="12">
  217. <div style="font-size: 16px;font-weight: 700; color: rgba(0, 0, 0, 1); margin: -10px 0 20px 20px;">提现信息</div>
  218. <el-form-item label="银行卡号:" :label-width="formLabelWidth" :required="true" prop="bankCard">
  219. <el-input v-model="formModifyHostel.bankCard" autocomplete="off" placeholder="请输入银行卡号" maxlength="19">
  220. </el-input>
  221. </el-form-item>
  222. <el-form-item label="户主姓名:" :label-width="formLabelWidth" :required="true" prop="cardName">
  223. <el-input v-model="formModifyHostel.cardName" autocomplete="off" placeholder="请输入户主姓名" maxlength="8">
  224. </el-input>
  225. </el-form-item>
  226. <el-form-item label="银行名称:" :label-width="formLabelWidth" :required="true" prop="bankName" maxlength="10">
  227. <el-input v-model="formModifyHostel.bankName" autocomplete="off" placeholder="请输入银行名称">
  228. </el-input>
  229. </el-form-item>
  230. </el-col>
  231. </el-row>
  232. <el-row>
  233. <el-col :span="24">
  234. <div style="font-size: 16px;font-weight: 700; color: rgba(0, 0, 0, 1); margin: 0px 0 20px 20px;">营业执照</div>
  235. <el-form-item label="" :required="true" prop="fileUrl">
  236. <pl-upload v-model="formModifyHostel.fileUrl" :linkId="formModifyHostel.id" :limitCount="6" :type="1"></pl-upload>
  237. </el-form-item>
  238. </el-col>
  239. </el-row>
  240. </el-form>
  241. <div
  242. style="font-size: 18px;font-weight: 400;letter-spacing: 0px;line-height: 26.06px;color: rgba(212, 48, 48, 1);text-align: left;vertical-align: top;">
  243. (注:最多可上传6张图片)</div>
  244. <div slot="footer" class="dialog-footer">
  245. <el-button class="add-info-cancel-btn" @click="dialogModifyHostelFormVisible = false">取 消</el-button>
  246. <el-button class="add-info-confirm-btn" @click="modify_house_dialog_handler">确 认</el-button>
  247. </div>
  248. </el-dialog>
  249. <!-- 民宿配置 -->
  250. <el-dialog title="民宿配置" custom-class="configuration-window" :visible.sync="dialogResidentialHostelConfigurationVisible" :close-on-click-modal="false"
  251. :close-on-press-escape="false" @close="residential_hostel_configuration_dialog_close">
  252. <el-tabs v-model="activeName" @tab-click="tabHandleClick">
  253. <el-tab-pane label="民宿类型" name="first">
  254. <el-row>
  255. <el-col :span="24" class="configure-btn-position">
  256. <el-button class="configure-btn" @click="add_dictionary_dialog(1)">添加</el-button>
  257. </el-col>
  258. </el-row>
  259. <el-row>
  260. <el-col :span="24">
  261. <el-table :data="tableData_hostel_class" height="380" style="width: 100%" :cell-style="cell_style" v-loading="loading"
  262. :header-cell-style="header_cell_style">
  263. <el-table-column label="序号" align="center" width="100">
  264. <template slot-scope="scope">
  265. <span>{{ (pagination.currentPage - 1) * pagination.pageSize + scope.$index + 1 }}</span>
  266. </template>
  267. </el-table-column>
  268. <el-table-column label="民宿类型" align="center">
  269. <template slot-scope="scope">
  270. <span>{{ scope.row.name }}</span>
  271. </template>
  272. </el-table-column>
  273. <el-table-column label="操作" align="center" width="110">
  274. <template slot-scope="scope">
  275. <div class="action-btns">
  276. <el-link class="bg-btn" @click="show_modify_dictionary_dialog(scope.$index, scope.row, 1)">编辑</el-link>
  277. <el-link type="danger" @click="delete_dictionary_dialog(scope.$index, scope.row)">删除</el-link>
  278. </div>
  279. </template>
  280. </el-table-column>
  281. </el-table>
  282. </el-col>
  283. </el-row>
  284. </el-tab-pane>
  285. <el-tab-pane label="民宿服务" name="second">
  286. <el-row>
  287. <el-col :span="24" class="configure-btn-position">
  288. <el-button class="configure-btn" @click="add_dictionary_dialog(2)">添加</el-button>
  289. </el-col>
  290. </el-row>
  291. <el-row>
  292. <el-col :span="24">
  293. <el-table :data="tableData_hostel_service" height="380" style="width: 100%" :cell-style="cell_style" v-loading="loading"
  294. :header-cell-style="header_cell_style">
  295. <el-table-column label="序号" align="center" width="100">
  296. <template slot-scope="scope">
  297. <span>{{ (pagination.currentPage - 1) * pagination.pageSize + scope.$index + 1 }}</span>
  298. </template>
  299. </el-table-column>
  300. <el-table-column label="图标" align="center" width="128">
  301. <template slot-scope="scope">
  302. <img :src="scope.row.fileUrl" width="24" height="24">
  303. </template>
  304. </el-table-column>
  305. <el-table-column label="民宿服务" align="center">
  306. <template slot-scope="scope">
  307. <span>{{ scope.row.name }}</span>
  308. </template>
  309. </el-table-column>
  310. <el-table-column label="操作" align="center" width="110">
  311. <template slot-scope="scope">
  312. <div class="action-btns">
  313. <el-link class="bg-btn" @click="show_modify_dictionary_dialog(scope.$index, scope.row, 2)">编辑</el-link>
  314. <el-link type="danger" @click="delete_dictionary_dialog(scope.$index, scope.row)">删除</el-link>
  315. </div>
  316. </template>
  317. </el-table-column>
  318. </el-table>
  319. </el-col>
  320. </el-row>
  321. </el-tab-pane>
  322. <el-tab-pane label="房型名称" name="third">
  323. <el-row>
  324. <el-col :span="24" class="configure-btn-position">
  325. <el-button class="configure-btn" @click="add_dictionary_dialog(3)">添加</el-button>
  326. </el-col>
  327. </el-row>
  328. <el-row>
  329. <el-col :span="24">
  330. <el-table :data="tableData_house_name" height="380" style="width: 100%" :cell-style="cell_style" v-loading="loading"
  331. :header-cell-style="header_cell_style">
  332. <el-table-column label="序号" align="center" width="100">
  333. <template slot-scope="scope">
  334. <span>{{ (pagination.currentPage - 1) * pagination.pageSize + scope.$index + 1 }}</span>
  335. </template>
  336. </el-table-column>
  337. <el-table-column label="房型名称" align="center">
  338. <template slot-scope="scope">
  339. <span>{{ scope.row.name }}</span>
  340. </template>
  341. </el-table-column>
  342. <el-table-column label="操作" align="center" width="110">
  343. <template slot-scope="scope">
  344. <div class="action-btns">
  345. <el-link class="bg-btn" @click="show_modify_dictionary_dialog(scope.$index, scope.row, 3)">编辑</el-link>
  346. <el-link type="danger" @click="delete_dictionary_dialog(scope.$index, scope.row)">删除</el-link>
  347. </div>
  348. </template>
  349. </el-table-column>
  350. </el-table>
  351. </el-col>
  352. </el-row>
  353. </el-tab-pane>
  354. <el-tab-pane label="房型服务" name="fourth">
  355. <el-row>
  356. <el-col :span="24" class="configure-btn-position">
  357. <el-button class="configure-btn" @click="add_dictionary_dialog(4)">添加</el-button>
  358. </el-col>
  359. </el-row>
  360. <el-row>
  361. <el-col :span="24">
  362. <el-table :data="tableData_house_service" height="380" style="width: 100%" :cell-style="cell_style" v-loading="loading"
  363. :header-cell-style="header_cell_style">
  364. <el-table-column label="序号" align="center" width="100">
  365. <template slot-scope="scope">
  366. <span>{{ (pagination.currentPage - 1) * pagination.pageSize + scope.$index + 1 }}</span>
  367. </template>
  368. </el-table-column>
  369. <el-table-column label="图标" align="center" width="128">
  370. <template slot-scope="scope">
  371. <img :src="scope.row.fileUrl" alt="" width="24" height="24">
  372. </template>
  373. </el-table-column>
  374. <el-table-column label="房型服务" align="center">
  375. <template slot-scope="scope">
  376. <span>{{ scope.row.name }}</span>
  377. </template>
  378. </el-table-column>
  379. <el-table-column label="操作" align="center" width="110">
  380. <template slot-scope="scope">
  381. <div class="action-btns">
  382. <el-link class="bg-btn" @click="show_modify_dictionary_dialog(scope.$index, scope.row, 4)">编辑</el-link>
  383. <el-link type="danger" @click="delete_dictionary_dialog(scope.$index, scope.row)">删除</el-link>
  384. </div>
  385. </template>
  386. </el-table-column>
  387. </el-table>
  388. </el-col>
  389. </el-row>
  390. </el-tab-pane>
  391. </el-tabs>
  392. </el-dialog>
  393. <!-- 添加民宿类型配置字典 不带图标-->
  394. <el-dialog title="添加民宿类型" custom-class="add-ms-class" :visible.sync="dialogAddDictionaryFormVisible" :close-on-click-modal="false"
  395. :close-on-press-escape="false" @close="add_house_dialog_close">
  396. <el-row>
  397. <el-col :span="24">
  398. <el-form :model="add_dictionary_data" ref="addHostelClassForm" :rules="addHostelClassFormRules">
  399. <el-form-item label="民宿类型:" :label-width="formLabelWidth" :required="true" prop="name">
  400. <el-input v-model="add_dictionary_data.name" autocomplete="off" maxlength="10" placeholder="请输入民宿类型">
  401. </el-input>
  402. </el-form-item>
  403. </el-form>
  404. </el-col>
  405. </el-row>
  406. <div slot="footer" class="dialog-footer">
  407. <el-button class="add-info-cancel-btn" @click="dialogAddDictionaryFormVisible = false">取 消</el-button>
  408. <el-button class="add-info-confirm-btn" @click="add_house_class_dialog_handler(1)">确 认</el-button>
  409. </div>
  410. </el-dialog>
  411. <!-- 添加民宿服务配置字典 带图标-->
  412. <el-dialog title="添加民宿服务" custom-class="add-ms-service" :visible.sync="dialogAddDictionaryServiceFormVisible" :close-on-click-modal="false"
  413. :close-on-press-escape="false" @close="add_house_dialog_close">
  414. <el-form :model="add_dictionary_data" ref="addHostelServiceForm" :rules="addHostelServiceFormRules">
  415. <el-row>
  416. <el-col :span="24">
  417. <el-form-item label="民宿服务:" :label-width="formLabelWidth" :required="true" prop="name">
  418. <el-input v-model="add_dictionary_data.name" autocomplete="off" maxlength="16" placeholder="请输入民宿服务">
  419. </el-input>
  420. </el-form-item>
  421. </el-col>
  422. </el-row>
  423. <el-row>
  424. <el-col :span="24">
  425. <div style="font-size: 16px;font-weight: 700; color: rgba(0, 0, 0, 1); margin: 0px 0 20px 20px;">图标</div>
  426. <el-form-item label="" :required="true" prop="fileUrl">
  427. <pl-upload v-model="add_dictionary_data.fileUrl" :times="times" :linkUrl="add_dictionary_data.url" :limitCount="1"
  428. :type="2"></pl-upload>
  429. </el-form-item>
  430. </el-col>
  431. </el-row>
  432. </el-form>
  433. <div slot="footer" class="dialog-footer">
  434. <el-button class="add-info-cancel-btn" @click="dialogAddDictionaryServiceFormVisible = false">取 消</el-button>
  435. <el-button class="add-info-confirm-btn" @click="add_house_class_dialog_handler(2)">确 认</el-button>
  436. </div>
  437. </el-dialog>
  438. <!-- 添加房型名称配置字典 不带图标-->
  439. <el-dialog title="添加房型名称" custom-class="add-ms-class" :visible.sync="dialogAddDictionaryNameFormVisible" :close-on-click-modal="false"
  440. :close-on-press-escape="false" @close="add_house_dialog_close">
  441. <el-row>
  442. <el-col :span="24">
  443. <el-form :model="add_dictionary_data" ref="addHostelNameForm" :rules="addHostelNameFormRules">
  444. <el-form-item label="房型名称:" :label-width="formLabelWidth" :required="true" prop="name">
  445. <el-input v-model="add_dictionary_data.name" autocomplete="off" maxlength="16" placeholder="请输入房型名称">
  446. </el-input>
  447. </el-form-item>
  448. </el-form>
  449. </el-col>
  450. </el-row>
  451. <div slot="footer" class="dialog-footer">
  452. <el-button class="add-info-cancel-btn" @click="dialogAddDictionaryNameFormVisible = false">取 消</el-button>
  453. <el-button class="add-info-confirm-btn" @click="add_house_class_dialog_handler(3)">确 认</el-button>
  454. </div>
  455. </el-dialog>
  456. <!-- 添加房型服务配置字典 带图标-->
  457. <el-dialog title="添加房型服务" custom-class="add-ms-service" :visible.sync="dialogAddDictionaryHouseServiceFormVisible" :close-on-click-modal="false"
  458. :close-on-press-escape="false" @close="add_house_dialog_close">
  459. <el-form :model="add_dictionary_data" ref="addHouseTypeServiceForm" :rules="addHouseTypeServiceFormRules">
  460. <el-row>
  461. <el-col :span="24">
  462. <el-form-item label="房型服务:" :label-width="formLabelWidth" :required="true" prop="name">
  463. <el-input v-model="add_dictionary_data.name" autocomplete="off" maxlength="8" placeholder="请输入房型服务">
  464. </el-input>
  465. </el-form-item>
  466. </el-col>
  467. </el-row>
  468. <el-row>
  469. <el-col :span="24">
  470. <div style="font-size: 16px;font-weight: 700; color: rgba(0, 0, 0, 1); margin: 0px 0 20px 20px;">图标</div>
  471. <el-form-item label="" :required="true" prop="fileUrl">
  472. <pl-upload v-model="add_dictionary_data.fileUrl" :times="times" :linkUrl="add_dictionary_data.url" :limitCount="1"
  473. :type="2"></pl-upload>
  474. </el-form-item>
  475. </el-col>
  476. </el-row>
  477. </el-form>
  478. <div slot="footer" class="dialog-footer">
  479. <el-button class="add-info-cancel-btn" @click="dialogAddDictionaryHouseServiceFormVisible = false">取 消</el-button>
  480. <el-button class="add-info-confirm-btn" @click="add_house_class_dialog_handler(4)">确 认</el-button>
  481. </div>
  482. </el-dialog>
  483. <!-- 修改民宿类型配置字典 不带图标-->
  484. <el-dialog title="修改民宿类型" custom-class="add-ms-class" :visible.sync="dialogModifyDictionaryFormVisible" :close-on-click-modal="false"
  485. :close-on-press-escape="false" @close="add_house_dialog_close">
  486. <el-row>
  487. <el-col :span="24">
  488. <el-form :model="modify_dictionary_data" ref="modifyHostelClassForm" :rules="modifyHostelClassFormRules">
  489. <el-form-item label="民宿类型:" :label-width="formLabelWidth" :required="true" prop="name">
  490. <el-input v-model="modify_dictionary_data.name" autocomplete="off" maxlength="10" placeholder="请输入民宿类型">
  491. </el-input>
  492. </el-form-item>
  493. </el-form>
  494. </el-col>
  495. </el-row>
  496. <div slot="footer" class="dialog-footer">
  497. <el-button class="add-info-cancel-btn" @click="dialogModifyDictionaryFormVisible = false">取 消</el-button>
  498. <el-button class="add-info-confirm-btn" @click="modify_house_class_dialog_handler(1)">确 认</el-button>
  499. </div>
  500. </el-dialog>
  501. <!-- 修改民宿服务配置字典 带图标-->
  502. <el-dialog title="修改民宿服务" custom-class="add-ms-service" :visible.sync="dialogModifyDictionaryServiceFormVisible" :close-on-click-modal="false"
  503. :close-on-press-escape="false" @close="add_house_dialog_close">
  504. <el-form :model="modify_dictionary_data" ref="modifyHostelServiceForm" :rules="modifyHostelServiceFormRules">
  505. <el-row>
  506. <el-col :span="24">
  507. <el-form-item label="民宿服务:" :label-width="formLabelWidth" :required="true" prop="name">
  508. <el-input v-model="modify_dictionary_data.name" autocomplete="off" maxlength="16" placeholder="请输入民宿服务">
  509. </el-input>
  510. </el-form-item>
  511. </el-col>
  512. </el-row>
  513. <el-row>
  514. <el-col :span="24">
  515. <div style="font-size: 16px;font-weight: 700; color: rgba(0, 0, 0, 1); margin: 0px 0 20px 20px;">图标</div>
  516. <el-form-item label="" :required="true" prop="fileUrl">
  517. <pl-upload v-model="modify_dictionary_data.fileUrl" :linkUrl="modify_dictionary_data.url" :limitCount="1" :type="2"></pl-upload>
  518. </el-form-item>
  519. </el-col>
  520. </el-row>
  521. </el-form>
  522. <div slot="footer" class="dialog-footer">
  523. <el-button class="add-info-cancel-btn" @click="dialogModifyDictionaryServiceFormVisible = false">取 消</el-button>
  524. <el-button class="add-info-confirm-btn" @click="modify_house_class_dialog_handler(2)">确 认</el-button>
  525. </div>
  526. </el-dialog>
  527. <!-- 修改房型名称配置字典 不带图标-->
  528. <el-dialog title="修改房型名称" custom-class="add-ms-class" :visible.sync="dialogModifyDictionaryNameFormVisible" :close-on-click-modal="false"
  529. :close-on-press-escape="false" @close="add_house_dialog_close">
  530. <el-row>
  531. <el-col :span="24">
  532. <el-form :model="modify_dictionary_data" ref="modifyHostelNameForm" :rules="modifyHostelNameFormRules">
  533. <el-form-item label="房型名称:" :label-width="formLabelWidth" :required="true" prop="name">
  534. <el-input v-model="modify_dictionary_data.name" autocomplete="off" maxlength="16" placeholder="请输入房型名称">
  535. </el-input>
  536. </el-form-item>
  537. </el-form>
  538. </el-col>
  539. </el-row>
  540. <div slot="footer" class="dialog-footer">
  541. <el-button class="add-info-cancel-btn" @click="dialogModifyDictionaryNameFormVisible = false">取 消</el-button>
  542. <el-button class="add-info-confirm-btn" @click="modify_house_class_dialog_handler(3)">确 认</el-button>
  543. </div>
  544. </el-dialog>
  545. <!-- 修改房型服务配置字典 带图标-->
  546. <el-dialog title="修改房型服务" custom-class="add-ms-service" :visible.sync="dialogModifyDictionaryHouseServiceFormVisible" :close-on-click-modal="false"
  547. :close-on-press-escape="false" @close="add_house_dialog_close">
  548. <el-form :model="modify_dictionary_data" ref="modifyHouseTypeServiceForm" :rules="modifyHouseTypeServiceFormRules">
  549. <el-row>
  550. <el-col :span="24">
  551. <el-form-item label="房型服务:" :label-width="formLabelWidth" :required="true" prop="name">
  552. <el-input v-model="modify_dictionary_data.name" autocomplete="off" maxlength="8" placeholder="请输入房型服务">
  553. </el-input>
  554. </el-form-item>
  555. </el-col>
  556. </el-row>
  557. <el-row>
  558. <el-col :span="24">
  559. <div style="font-size: 16px;font-weight: 700; color: rgba(0, 0, 0, 1); margin: 0px 0 20px 20px;">图标</div>
  560. <el-form-item label="" :required="true" prop="fileUrl">
  561. <pl-upload v-model="modify_dictionary_data.fileUrl" :linkUrl="modify_dictionary_data.url" :limitCount="1" :type="2"></pl-upload>
  562. </el-form-item>
  563. </el-col>
  564. </el-row>
  565. </el-form>
  566. <div slot="footer" class="dialog-footer">
  567. <el-button class="add-info-cancel-btn" @click="dialogModifyDictionaryHouseServiceFormVisible = false">取 消</el-button>
  568. <el-button class="add-info-confirm-btn" @click="modify_house_class_dialog_handler(4)">确 认</el-button>
  569. </div>
  570. </el-dialog>
  571. <!-- 确认对话框 -->
  572. <el-dialog custom-class="el-dialog-delete-house" :visible.sync="dialogConfirmVisible" :close-on-click-modal="false" :close-on-press-escape="false"
  573. :show-close="false">
  574. <div slot="" class="del-account-body">
  575. <img src="../../icons/serveAC/del_warning.png" alt="">
  576. <div class="del-account-body-txt">{{ delete_frozen_thaw_Data.prompt_message }}</div>
  577. </div>
  578. <div slot="footer" class="dialog-footer">
  579. <el-button class="add-info-cancel-btn" @click="dialogConfirmVisible = false"> 否 </el-button>
  580. <el-button class="add-info-confirm-btn" @click="delete_frozen_thaw_dialog_handler"> 是 </el-button>
  581. </div>
  582. </el-dialog>
  583. </div>
  584. </template>
  585. <script>
  586. import {
  587. getTableData,
  588. getTowns,
  589. addHostel,
  590. modifyHostel,
  591. delHostelAccount,
  592. resetHostelAccountPassword,
  593. frozenHostelAccount,
  594. thawHostelAccount,
  595. listHomestayDictionary,
  596. addHomestayDictionary,
  597. modifyHomestayDictionary,
  598. delHomestayDictionary
  599. } from '@/api/residentialhostelMgr'
  600. import plUpload from "@/components/pl-upload/index"
  601. import {
  602. Level
  603. } from 'chalk';
  604. export default {
  605. components: {
  606. plUpload
  607. },
  608. data() {
  609. var checkTownId = (rule, value, callback) => {
  610. if (!value) {
  611. return callback(new Error('请选择乡镇'));
  612. }
  613. callback();
  614. };
  615. var checkHotelName = (rule, value, callback) => {
  616. if (!value) {
  617. return callback(new Error('请输入民宿名称'));
  618. }
  619. setTimeout(() => {
  620. var reg = /^[\s\W\u4e00-\u9fa5]{2,20}$/
  621. if (!reg.test(value)) {
  622. callback(new Error('不能包含特殊符号和空白字符,2到20个'));
  623. } else {
  624. callback();
  625. }
  626. }, 100);
  627. };
  628. var checkCorpnName = (rule, value, callback) => {
  629. if (!value) {
  630. return callback(new Error('请输入法人姓名'));
  631. }
  632. setTimeout(() => {
  633. var reg = /^[\u4e00-\u9fa5]{2,10}$/
  634. if (!reg.test(value)) {
  635. callback(new Error('只能包含2到10个汉字'));
  636. } else {
  637. callback();
  638. }
  639. }, 100);
  640. };
  641. var checkCorpnPhone = (rule, value, callback) => {
  642. if (!value) {
  643. return callback(new Error('请输入法人电话'));
  644. }
  645. setTimeout(() => {
  646. var reg = /^(0\d{2,3}-\d{7,8}|1[3456789]\d{9})$/
  647. if (!reg.test(value)) {
  648. callback(new Error('请输入手机号或座机'));
  649. } else {
  650. callback();
  651. }
  652. }, 100);
  653. };
  654. var checkAdminName = (rule, value, callback) => {
  655. if (!value) {
  656. return callback(new Error('请输入民宿账号'));
  657. }
  658. setTimeout(() => {
  659. var reg = /^[a-zA-Z0-9_]{5,16}$/
  660. if (!reg.test(value)) {
  661. callback(new Error('只能包含字母、数字和下划线,长度5到16个之间'));
  662. } else {
  663. callback();
  664. }
  665. }, 100);
  666. };
  667. var checkBankCard = (rule, value, callback) => {
  668. if (!value) {
  669. return callback(new Error('请输入银行卡号'));
  670. }
  671. setTimeout(() => {
  672. var reg = /^([1-9]{1})(\d{15,18})$/
  673. if (!reg.test(value)) {
  674. callback(new Error('银行卡号长度16-19位数字'));
  675. } else {
  676. callback();
  677. }
  678. }, 100);
  679. };
  680. var checkCardName = (rule, value, callback) => {
  681. if (!value) {
  682. return callback(new Error('请输入户主姓名'));
  683. }
  684. setTimeout(() => {
  685. var reg = /^[\u4e00-\u9fa5]{2,8}$/
  686. if (!reg.test(value)) {
  687. callback(new Error('只能包含2到8个汉字'));
  688. } else {
  689. callback();
  690. }
  691. }, 100);
  692. };
  693. var checkBankName = (rule, value, callback) => {
  694. if (!value) {
  695. return callback(new Error('请输入银行名称'));
  696. }
  697. setTimeout(() => {
  698. var reg = /^[\u4e00-\u9fa5]{4,10}$/
  699. if (!reg.test(value)) {
  700. callback(new Error('只能包含4到10个汉字'));
  701. } else {
  702. callback();
  703. }
  704. }, 100);
  705. };
  706. var checkFileUrl = (rule, value, callback) => {
  707. if (value == '[]' || value == '') {
  708. return callback(new Error('请上传营业执照'));
  709. }
  710. callback();
  711. };
  712. var checkHostelCalssName = (rule, value, callback) => {
  713. if (!value) {
  714. return callback(new Error('请输入民宿类型'));
  715. }
  716. setTimeout(() => {
  717. var reg = /^[\u4e00-\u9fa5]{2,10}$/
  718. if (!reg.test(value)) {
  719. callback(new Error('只能包含2到10个汉字'));
  720. } else {
  721. callback();
  722. }
  723. }, 100);
  724. };
  725. var checkHostelServiceName = (rule, value, callback) => {
  726. if (!value) {
  727. return callback(new Error('请输入民宿服务'));
  728. }
  729. setTimeout(() => {
  730. var reg = /^[\u4e00-\u9fa5]{2,10}$/
  731. if (!reg.test(value)) {
  732. callback(new Error('只能包含2到10个汉字'));
  733. } else {
  734. callback();
  735. }
  736. }, 100);
  737. };
  738. var checkHostelName = (rule, value, callback) => {
  739. if (!value) {
  740. return callback(new Error('请输入房型名称'));
  741. }
  742. setTimeout(() => {
  743. var reg = /^[\u4e00-\u9fa5]{2,10}$/
  744. if (!reg.test(value)) {
  745. callback(new Error('只能包含2到10个汉字'));
  746. } else {
  747. callback();
  748. }
  749. }, 100);
  750. };
  751. var checkHouseTypeService = (rule, value, callback) => {
  752. if (!value) {
  753. return callback(new Error('请输入房型服务'));
  754. }
  755. setTimeout(() => {
  756. var reg = /^[\u4e00-\u9fa5]{2,8}$/
  757. if (!reg.test(value)) {
  758. callback(new Error('只能包含2到8个汉字'));
  759. } else {
  760. callback();
  761. }
  762. }, 100);
  763. };
  764. var checkIcon = (rule, value, callback) => {
  765. if (value == '[]' || value == '' || value == undefined) {
  766. return callback(new Error('请上传图标'));
  767. }
  768. callback();
  769. };
  770. return {
  771. currentUserLevel: this.$store.state.user.level, // 当前用户的权限
  772. activeName: 'first', // 默认激活那个选项卡
  773. dialogResidentialHostelConfigurationVisible: false, // 民宿配置对话框显示和隐藏变量
  774. dialogAddHostelFormVisible: false, // 添加民宿对话框显示和隐藏变量
  775. dialogModifyHostelFormVisible: false, // 修改对话框的显示和隐藏变量
  776. dialogConfirmVisible: false, // 对话框的显示和隐藏变量
  777. dialogAddDictionaryFormVisible: false, // 添加民宿字典对话框显示和隐藏变量
  778. dialogAddDictionaryServiceFormVisible: false,
  779. dialogAddDictionaryNameFormVisible: false,
  780. dialogAddDictionaryHouseServiceFormVisible: false,
  781. dialogModifyDictionaryFormVisible: false,
  782. dialogModifyDictionaryServiceFormVisible: false,
  783. dialogModifyDictionaryNameFormVisible: false,
  784. dialogModifyDictionaryHouseServiceFormVisible: false,
  785. formLabelWidth: '120px',
  786. // 表格单元格样式
  787. cell_style: {
  788. color: '#1A202B',
  789. 'font-size': '14px',
  790. 'font-family': 'Microsoft YaHei-3970(82674968)'
  791. },
  792. // 表格头部样式
  793. header_cell_style: {
  794. background: '#E6ECFE',
  795. color: '#1A202B',
  796. 'font-size': '16px',
  797. 'font-family': 'Microsoft YaHei-3970(82674968)'
  798. },
  799. // 查询数据
  800. formInline: {
  801. options: [],
  802. id: '',
  803. adminName: ''
  804. },
  805. // 删除、冻结、解冻民宿
  806. delete_frozen_thaw_Data: {
  807. prompt_message: '',
  808. id: '',
  809. action: ''
  810. },
  811. tableData: [],
  812. // 民宿类别
  813. tableData_hostel_class: [],
  814. // 民宿服务
  815. tableData_hostel_service: [],
  816. // 房型名称
  817. tableData_house_name: [],
  818. // 房型服务
  819. tableData_house_service: [],
  820. cond_data: {},
  821. // 分页参数
  822. pagination: {
  823. currentPage: 1,
  824. pageSize: 9,
  825. total: 0
  826. },
  827. loading: true,
  828. formAddHostel: {
  829. options: [],
  830. id: '',
  831. hotelTownship: '',
  832. hotelName: '',
  833. corpnName: '',
  834. corpnPhone: '',
  835. adminName: '',
  836. bankCard: '',
  837. cardName: '',
  838. bankName: '',
  839. fileUrl: '', // 图片上传列表
  840. url: '', // 上传的图片列表
  841. level: this.$store.state.user.level
  842. },
  843. addHostelFormRules: {
  844. hotelName: [{
  845. validator: checkHotelName
  846. }],
  847. corpnName: [{
  848. validator: checkCorpnName
  849. }],
  850. corpnPhone: [{
  851. validator: checkCorpnPhone
  852. }],
  853. id: [{
  854. validator: checkTownId
  855. }],
  856. adminName: [{
  857. validator: checkAdminName
  858. }],
  859. bankCard: [{
  860. validator: checkBankCard
  861. }],
  862. cardName: [{
  863. validator: checkCardName
  864. }],
  865. bankName: [{
  866. validator: checkBankName
  867. }],
  868. fileUrl: [{
  869. validator: checkFileUrl
  870. }]
  871. },
  872. formModifyHostel: {
  873. options: [],
  874. id: '',
  875. hotelTownship: '',
  876. hotelTownshipName: '',
  877. hotelName: '',
  878. corpnName: '',
  879. corpnPhone: '',
  880. adminName: '',
  881. bankCard: '',
  882. cardName: '',
  883. bankName: '',
  884. fileUrl: '', // 图片上传列表
  885. url: '', // 上传的图片列表
  886. level: this.$store.state.user.level
  887. },
  888. modifyHostelFormRules: {
  889. hotelName: [{
  890. validator: checkHotelName
  891. }],
  892. corpnName: [{
  893. validator: checkCorpnName
  894. }],
  895. corpnPhone: [{
  896. validator: checkCorpnPhone
  897. }],
  898. id: [{
  899. validator: checkTownId
  900. }],
  901. adminName: [{
  902. validator: checkAdminName
  903. }],
  904. bankCard: [{
  905. validator: checkBankCard
  906. }],
  907. cardName: [{
  908. validator: checkCardName
  909. }],
  910. bankName: [{
  911. validator: checkBankName
  912. }],
  913. fileUrl: [{
  914. validator: checkFileUrl
  915. }]
  916. },
  917. // 修改字典数据
  918. modify_dictionary_data: {
  919. id: 0,
  920. code: 0,
  921. name: '',
  922. fileUrl: '', // 图片上传列表
  923. url: ''
  924. },
  925. // 增加字典数据
  926. add_dictionary_data: {
  927. code: 0,
  928. name: '',
  929. fileUrl: '', // 图片上传列表
  930. url: ''
  931. },
  932. // 删除字典数据
  933. del_dictionary_data: {
  934. id: ''
  935. },
  936. times: '',
  937. addHostelClassFormRules: {
  938. name: [{
  939. validator: checkHostelCalssName
  940. }]
  941. },
  942. addHostelServiceFormRules: {
  943. name: [{
  944. validator: checkHostelServiceName
  945. }],
  946. fileUrl: [{
  947. validator: checkIcon
  948. }]
  949. },
  950. addHostelNameFormRules: {
  951. name: [{
  952. validator: checkHostelName
  953. }]
  954. },
  955. addHouseTypeServiceFormRules: {
  956. name: [{
  957. validator: checkHouseTypeService
  958. }],
  959. fileUrl: [{
  960. validator: checkIcon
  961. }]
  962. },
  963. modifyHostelClassFormRules: {
  964. name: [{
  965. validator: checkHostelCalssName
  966. }]
  967. },
  968. modifyHostelServiceFormRules: {
  969. name: [{
  970. validator: checkHostelServiceName
  971. }],
  972. fileUrl: [{
  973. validator: checkIcon
  974. }]
  975. },
  976. modifyHostelNameFormRules: {
  977. name: [{
  978. validator: checkHostelName
  979. }]
  980. },
  981. modifyHouseTypeServiceFormRules: {
  982. name: [{
  983. validator: checkHouseTypeService
  984. }],
  985. fileUrl: [{
  986. validator: checkIcon
  987. }]
  988. }
  989. }
  990. },
  991. created() {
  992. // 检测权限
  993. if (this.currentUserLevel !== 2) {
  994. this.$router.replace({
  995. path: '/data'
  996. })
  997. return
  998. }
  999. // 获取消费记录,表格数据
  1000. this.get_table_data('list')
  1001. // 获取乡镇
  1002. this.get_towns()
  1003. // 民宿字典列表
  1004. this.getHostelListByCode(1234)
  1005. },
  1006. mounted() {
  1007. // 修改分页栏文字
  1008. document.getElementsByClassName("el-pagination__jump")[0].childNodes[0].nodeValue = "跳至";
  1009. },
  1010. methods: {
  1011. /**
  1012. * 民宿类型
  1013. */
  1014. get_listHomestayDictionary_1() {
  1015. // 1.民宿类型
  1016. listHomestayDictionary(1).then((res) => {
  1017. // console.log(res);
  1018. if (typeof res.code == 'undefined' || res.code == '') {
  1019. this.$message.error('返回数据格式问题,code未获取到!');
  1020. return;
  1021. }
  1022. if (res.code === 200) {
  1023. if (typeof res.data !== 'undefined') {
  1024. this.tableData_hostel_class = []
  1025. for (var i = 0; i < res.data.length; i++) {
  1026. this.tableData_hostel_class.push({
  1027. id: res.data[i].id,
  1028. code: res.data[i].code,
  1029. name: res.data[i].name
  1030. })
  1031. }
  1032. }
  1033. } else {
  1034. this.$message.error(res.message);
  1035. }
  1036. }).catch((err) => {
  1037. // console.log(err);
  1038. this.$message.error(err.message);
  1039. })
  1040. },
  1041. /**
  1042. * 民宿服务
  1043. */
  1044. get_listHomestayDictionary_2() {
  1045. // 2.民宿服务
  1046. listHomestayDictionary(2).then((res) => {
  1047. // console.log(res);
  1048. if (typeof res.code == 'undefined' || res.code == '') {
  1049. this.$message.error('返回数据格式问题,code未获取到!');
  1050. return;
  1051. }
  1052. if (res.code === 200) {
  1053. if (typeof res.data !== 'undefined') {
  1054. this.tableData_hostel_service = []
  1055. for (var i = 0; i < res.data.length; i++) {
  1056. this.tableData_hostel_service.push({
  1057. id: res.data[i].id,
  1058. code: res.data[i].code,
  1059. name: res.data[i].name,
  1060. fileUrl: res.data[i].fileUrl
  1061. })
  1062. }
  1063. }
  1064. } else {
  1065. this.$message.error(res.message);
  1066. }
  1067. }).catch((err) => {
  1068. // console.log(err);
  1069. this.$message.error(err.message);
  1070. })
  1071. },
  1072. /**
  1073. * 房型名称
  1074. */
  1075. get_listHomestayDictionary_3() {
  1076. // 3.房型名称
  1077. listHomestayDictionary(3).then((res) => {
  1078. // console.log(res);
  1079. if (typeof res.code == 'undefined' || res.code == '') {
  1080. this.$message.error('返回数据格式问题,code未获取到!');
  1081. return;
  1082. }
  1083. if (res.code === 200) {
  1084. if (typeof res.data !== 'undefined') {
  1085. this.tableData_house_name = []
  1086. for (var i = 0; i < res.data.length; i++) {
  1087. this.tableData_house_name.push({
  1088. id: res.data[i].id,
  1089. code: res.data[i].code,
  1090. name: res.data[i].name
  1091. });
  1092. }
  1093. }
  1094. } else {
  1095. this.$message.error(res.message);
  1096. }
  1097. }).catch((err) => {
  1098. // console.log(err);
  1099. this.$message.error(err.message);
  1100. })
  1101. },
  1102. get_listHomestayDictionary_4() {
  1103. // 4.房型服务
  1104. listHomestayDictionary(4).then((res) => {
  1105. // console.log(res);
  1106. if (typeof res.code == 'undefined' || res.code == '') {
  1107. this.$message.error('返回数据格式问题,code未获取到!');
  1108. return;
  1109. }
  1110. if (res.code === 200) {
  1111. if (typeof res.data !== 'undefined') {
  1112. this.tableData_house_service = []
  1113. for (var i = 0; i < res.data.length; i++) {
  1114. this.tableData_house_service.push({
  1115. id: res.data[i].id,
  1116. code: res.data[i].code,
  1117. name: res.data[i].name,
  1118. fileUrl: res.data[i].fileUrl
  1119. });
  1120. }
  1121. }
  1122. } else {
  1123. this.$message.error(res.message);
  1124. }
  1125. }).catch((err) => {
  1126. // console.log(err);
  1127. this.$message.error(err.message);
  1128. })
  1129. },
  1130. /**
  1131. * 民宿字典列表
  1132. */
  1133. getHostelListByCode(param) {
  1134. if (param === 1234) {
  1135. this.get_listHomestayDictionary_1()
  1136. this.get_listHomestayDictionary_2()
  1137. this.get_listHomestayDictionary_3()
  1138. this.get_listHomestayDictionary_4()
  1139. } else if (param === 1) {
  1140. this.get_listHomestayDictionary_1()
  1141. } else if (param === 2) {
  1142. this.get_listHomestayDictionary_2()
  1143. } else if (param === 3) {
  1144. this.get_listHomestayDictionary_3()
  1145. } else if (param === 4) {
  1146. this.get_listHomestayDictionary_4()
  1147. }
  1148. },
  1149. // 获取民宿id
  1150. getHotelId(e) {
  1151. this.formAddHostel.id = e
  1152. },
  1153. // tab切换获取code
  1154. tabHandleClick(tab, event) {
  1155. // console.log(tab.index, tab.name, event);
  1156. },
  1157. /**
  1158. * 显示民宿添加对话框
  1159. */
  1160. add_house_dialog() {
  1161. this.dialogAddHostelFormVisible = true;
  1162. this.times = new Date().getTime().toString()
  1163. },
  1164. /**
  1165. * 打开民宿配置对话框
  1166. */
  1167. hostelConfiguration() {
  1168. this.dialogResidentialHostelConfigurationVisible = true
  1169. },
  1170. // 添加民宿字典,先显示对话框
  1171. add_dictionary_dialog(i) {
  1172. this.clear_add_dictionary_data()
  1173. if (i === 1) {
  1174. this.dialogAddDictionaryFormVisible = true
  1175. } else if (i === 2) {
  1176. this.dialogAddDictionaryServiceFormVisible = true
  1177. } else if (i === 3) {
  1178. this.dialogAddDictionaryNameFormVisible = true
  1179. } else if (i === 4) {
  1180. this.dialogAddDictionaryHouseServiceFormVisible = true
  1181. }
  1182. this.times = new Date().getTime().toString()
  1183. this.add_dictionary_data.code = i;
  1184. },
  1185. // 显示民宿类型修改对话框
  1186. show_modify_dictionary_dialog(index, row, i) {
  1187. // console.log(index, row, i);
  1188. this.modify_dictionary_data.id = row.id
  1189. this.modify_dictionary_data.code = row.code
  1190. this.modify_dictionary_data.name = row.name
  1191. if (typeof row.fileUrl !== 'undefined') {
  1192. this.modify_dictionary_data.url = row.fileUrl
  1193. }
  1194. if (i === 1) {
  1195. this.dialogModifyDictionaryFormVisible = true
  1196. } else if (i === 2) {
  1197. this.dialogModifyDictionaryServiceFormVisible = true
  1198. } else if (i === 3) {
  1199. this.dialogModifyDictionaryNameFormVisible = true
  1200. } else if (i === 4) {
  1201. this.dialogModifyDictionaryHouseServiceFormVisible = true
  1202. }
  1203. },
  1204. /**
  1205. * 修改民宿字典
  1206. * @param {Object} index
  1207. * @param {Object} row
  1208. */
  1209. modify_house_class_dialog_handler(i) {
  1210. var that = this;
  1211. if (i === 1) {
  1212. that.$refs["modifyHostelClassForm"].validate(validate => {
  1213. if (validate) {
  1214. this.modifyHomestayDictionary_shared(i)
  1215. } else {
  1216. that.$message.error('请按规范填写');
  1217. return false;
  1218. }
  1219. })
  1220. } else if (i === 2) {
  1221. that.$refs["modifyHostelServiceForm"].validate(validate => {
  1222. if (validate) {
  1223. this.modifyHomestayDictionary_shared(i)
  1224. } else {
  1225. that.$message.error('请按规范填写');
  1226. return false;
  1227. }
  1228. })
  1229. } else if (i === 3) {
  1230. that.$refs["modifyHostelNameForm"].validate(validate => {
  1231. if (validate) {
  1232. this.modifyHomestayDictionary_shared(i)
  1233. } else {
  1234. that.$message.error('请按规范填写');
  1235. return false;
  1236. }
  1237. })
  1238. } else if (i === 4) {
  1239. that.$refs["modifyHouseTypeServiceForm"].validate(validate => {
  1240. if (validate) {
  1241. this.modifyHomestayDictionary_shared(i)
  1242. } else {
  1243. that.$message.error('请按规范填写');
  1244. return false;
  1245. }
  1246. })
  1247. }
  1248. },
  1249. /**
  1250. * 修改民宿字典共享函数
  1251. * @param {Object} i
  1252. */
  1253. modifyHomestayDictionary_shared(i) {
  1254. var that = this;
  1255. modifyHomestayDictionary(this.modify_dictionary_data).then((res) => {
  1256. // console.log(res);
  1257. if (typeof res.code == 'undefined' || res.code == '') {
  1258. that.$message.error('返回数据格式问题,code未获取到!');
  1259. return;
  1260. }
  1261. if (res.code === 200) {
  1262. // 重新读取,刷新表格显示
  1263. that.getHostelListByCode(i)
  1264. if (i === 1) {
  1265. that.dialogModifyDictionaryFormVisible = false
  1266. } else if (i === 2) {
  1267. that.dialogModifyDictionaryServiceFormVisible = false
  1268. } else if (i === 3) {
  1269. that.dialogModifyDictionaryNameFormVisible = false
  1270. } else if (i === 4) {
  1271. that.dialogModifyDictionaryHouseServiceFormVisible = false
  1272. }
  1273. that.$message.success(res.message);
  1274. } else {
  1275. that.$message.error(res.message);
  1276. }
  1277. }).catch((err) => {
  1278. // console.log(err);
  1279. that.$message.error(err.message);
  1280. })
  1281. },
  1282. /**
  1283. * 删除民宿字典
  1284. * @param {Object} index
  1285. * @param {Object} row
  1286. */
  1287. delete_dictionary_dialog(index, row) {
  1288. // console.log(index, row);
  1289. this.del_dictionary_data.id = row.id
  1290. this.delete_frozen_thaw_Data.prompt_message = `确定删除【${row.name}】吗?`
  1291. this.delete_frozen_thaw_Data.action = 'delDic'
  1292. this.dialogConfirmVisible = true
  1293. },
  1294. /**
  1295. * 修改民宿
  1296. */
  1297. modify_house_dialog(index, row) {
  1298. console.log(index, row);
  1299. this.formModifyHostel.id = row.id;
  1300. this.formModifyHostel.hotelTownship = row.hotelTownshipName;
  1301. this.formModifyHostel.hotelName = row.hotelName;
  1302. this.formModifyHostel.corpnName = row.corpnName;
  1303. this.formModifyHostel.corpnPhone = row.corpnPhone;
  1304. this.formModifyHostel.adminName = row.adminName;
  1305. this.formModifyHostel.bankCard = row.bankCard;
  1306. this.formModifyHostel.cardName = row.cardName;
  1307. this.formModifyHostel.bankName = row.bankName;
  1308. // this.formModifyHostel.fileUrl = row.bankName;
  1309. this.dialogModifyHostelFormVisible = true;
  1310. console.log(this.formModifyHostel.fileUrl);
  1311. console.log(this.formModifyHostel.url);
  1312. },
  1313. /**
  1314. * 关闭添加对话框
  1315. */
  1316. add_house_dialog_close() {
  1317. // 关闭添加对话框
  1318. this.dialogAddHostelFormVisible = false;
  1319. },
  1320. /**
  1321. * 关闭民宿配置
  1322. */
  1323. residential_hostel_configuration_dialog_close() {
  1324. this.dialogResidentialHostelConfigurationVisible = false
  1325. },
  1326. /**
  1327. * 添加民宿类型
  1328. */
  1329. add_house_class_dialog_handler(i) {
  1330. var that = this;
  1331. if (i === 1) {
  1332. that.$refs["addHostelClassForm"].validate(validate => {
  1333. if (validate) {
  1334. that.addHostel_shared(i)
  1335. } else {
  1336. that.$message.error('请按规范填写');
  1337. return false;
  1338. }
  1339. })
  1340. } else if (i === 2) {
  1341. that.$refs["addHostelServiceForm"].validate(validate => {
  1342. if (validate) {
  1343. that.addHostel_shared(i)
  1344. } else {
  1345. that.$message.error('请按规范填写');
  1346. return false;
  1347. }
  1348. })
  1349. } else if (i === 3) {
  1350. that.$refs["addHostelNameForm"].validate(validate => {
  1351. if (validate) {
  1352. that.addHostel_shared(i)
  1353. } else {
  1354. that.$message.error('请按规范填写');
  1355. return false;
  1356. }
  1357. })
  1358. } else if (i === 4) {
  1359. that.$refs["addHouseTypeServiceForm"].validate(validate => {
  1360. if (validate) {
  1361. that.addHostel_shared(i)
  1362. } else {
  1363. that.$message.error('请按规范填写');
  1364. return false;
  1365. }
  1366. })
  1367. }
  1368. },
  1369. /**
  1370. *
  1371. * @param {Object} i
  1372. */
  1373. addHostel_shared(i) {
  1374. addHomestayDictionary(this.add_dictionary_data).then((res) => {
  1375. // console.log(res);
  1376. if (typeof res.code == 'undefined' || res.code == '') {
  1377. this.$message.error('返回数据格式问题,code未获取到!');
  1378. return;
  1379. }
  1380. if (res.code === 200) {
  1381. // 重新读取,刷新表格显示
  1382. this.getHostelListByCode(i);
  1383. if (i === 1) {
  1384. this.dialogAddDictionaryFormVisible = false;
  1385. } else if (i === 2) {
  1386. this.dialogAddDictionaryServiceFormVisible = false
  1387. } else if (i === 3) {
  1388. this.dialogAddDictionaryNameFormVisible = false
  1389. } else if (i === 4) {
  1390. this.dialogAddDictionaryHouseServiceFormVisible = false
  1391. }
  1392. this.clear_add_dictionary_data()
  1393. this.$message.success(res.message);
  1394. } else {
  1395. this.$message.error(res.message);
  1396. }
  1397. }).catch((err) => {
  1398. // console.log(err);
  1399. this.$message.error(err.message);
  1400. })
  1401. },
  1402. // 初始化字典数据
  1403. clear_add_dictionary_data() {
  1404. this.add_dictionary_data = {
  1405. code: 0,
  1406. name: '',
  1407. fileUrl: '', // 图片上传列表
  1408. url: ''
  1409. }
  1410. },
  1411. /**
  1412. * 添加民宿操作
  1413. */
  1414. add_house_dialog_handler() {
  1415. // 调用添加接口
  1416. this.$refs["addHostelForm"].validate(validate => {
  1417. if (validate) {
  1418. addHostel(this.formAddHostel).then((res) => {
  1419. // console.log(res);
  1420. if (typeof res.code == 'undefined' || res.code == '') {
  1421. this.$message.error('返回数据格式问题,code未获取到!');
  1422. return;
  1423. }
  1424. if (res.code === 200) {
  1425. // 重新读取,刷新表格显示
  1426. this.get_table_data('list');
  1427. this.clear_data()
  1428. this.dialogAddHostelFormVisible = false;
  1429. this.$message.success(res.message);
  1430. } else {
  1431. this.$message.error(res.message);
  1432. }
  1433. }).catch((err) => {
  1434. // console.log(err);
  1435. this.$message.error(err.message);
  1436. })
  1437. } else {
  1438. this.$message.error('请按规范填写');
  1439. return false;
  1440. }
  1441. })
  1442. },
  1443. clear_data() {
  1444. this.formAddHostel.id = ''
  1445. this.formAddHostel.hotelTownship = ''
  1446. this.formAddHostel.hotelName = ''
  1447. this.formAddHostel.corpnName = ''
  1448. this.formAddHostel.corpnPhone = ''
  1449. this.formAddHostel.adminName = ''
  1450. this.formAddHostel.bankCard = ''
  1451. this.formAddHostel.cardName = ''
  1452. this.formAddHostel.bankName = ''
  1453. this.formAddHostel.fileUrl = '' // 图片上传列表
  1454. this.formAddHostel.url = '' // 上传的图片列表
  1455. this.formAddHostel.level = this.currentUserLevel
  1456. },
  1457. /**
  1458. * 修改民宿
  1459. */
  1460. modify_house_dialog_handler() {
  1461. // console.log(this.formModifyHostel);
  1462. // 调用修改接口
  1463. this.$refs["modifyHostelForm"].validate(validate => {
  1464. if (validate) {
  1465. modifyHostel(this.formModifyHostel).then((res) => {
  1466. // console.log(res);
  1467. if (typeof res.code == 'undefined' || res.code == '') {
  1468. this.$message.error('返回数据格式问题,code未获取到!');
  1469. return;
  1470. }
  1471. if (res.code === 200) {
  1472. // 重新读取,刷新表格显示
  1473. this.get_table_data('list');
  1474. this.clear_modify_data()
  1475. this.dialogModifyHostelFormVisible = false;
  1476. this.$message.success(res.message);
  1477. } else {
  1478. this.$message.error(res.message);
  1479. }
  1480. }).catch((err) => {
  1481. // console.log(err);
  1482. this.$message.error(err.message);
  1483. })
  1484. } else {
  1485. this.$message.error('请按规范填写');
  1486. return false;
  1487. }
  1488. })
  1489. },
  1490. clear_modify_data() {
  1491. this.formAddHostel.id = ''
  1492. this.formAddHostel.hotelTownship = ''
  1493. this.formAddHostel.hotelName = ''
  1494. this.formAddHostel.hotelTownshipName = ''
  1495. this.formAddHostel.corpnName = ''
  1496. this.formAddHostel.corpnPhone = ''
  1497. this.formAddHostel.adminName = ''
  1498. this.formAddHostel.bankCard = ''
  1499. this.formAddHostel.cardName = ''
  1500. this.formAddHostel.bankName = ''
  1501. this.formAddHostel.fileUrl = '' // 图片上传列表
  1502. this.formAddHostel.url = '' // 上传的图片列表
  1503. },
  1504. /**
  1505. * 重置密码
  1506. */
  1507. reset_hostel_dialog_handler() {
  1508. resetHostelAccountPassword(this.resetHostelData.id).then((res) => {
  1509. // console.log(res);
  1510. if (typeof res.code == 'undefined' || res.code == '') {
  1511. this.$message.error('返回数据格式问题,code未获取到!');
  1512. return;
  1513. }
  1514. if (res.code === 200) {
  1515. // 重新读取,刷新表格显示
  1516. this.get_table_data('list');
  1517. this.dialogResetHostelVisible = false;
  1518. this.$message.success(res.message);
  1519. } else {
  1520. this.$message.error(res.message);
  1521. }
  1522. }).catch((err) => {
  1523. // console.log(err);
  1524. this.$message.error(err.message);
  1525. })
  1526. },
  1527. /**
  1528. * 关闭修改对话框
  1529. */
  1530. modify_house_dialog_close() {
  1531. // 关闭修改对话框
  1532. this.dialogModifyHostelFormVisible = false;
  1533. },
  1534. /**
  1535. * 删除、冻结、解冻、重置密码民宿对话框
  1536. */
  1537. show_confirm_dialog(index, row, param) {
  1538. // console.log(index, row);
  1539. // 需要删除的数据关键字,赋值准备删除
  1540. this.delete_frozen_thaw_Data.id = row.id;
  1541. if (param === 'reset') {
  1542. this.delete_frozen_thaw_Data.prompt_message = '是否确定重置账号【' + row.adminName + '】?';
  1543. } else if (param === 'frozen') {
  1544. this.delete_frozen_thaw_Data.prompt_message = '是否确定冻结账号【' + row.adminName + '】?';
  1545. } else if (param === 'thaw') {
  1546. this.delete_frozen_thaw_Data.prompt_message = '是否确定解冻账号【' + row.adminName + '】?';
  1547. } else if (param === 'delete') {
  1548. this.delete_frozen_thaw_Data.prompt_message = '是否确定删除账号【' + row.adminName + '】?';
  1549. } else {
  1550. this.delete_frozen_thaw_Data.prompt_message = '未知错误操作!';
  1551. }
  1552. this.delete_frozen_thaw_Data.action = param
  1553. // 显示删除对话框
  1554. this.dialogConfirmVisible = true;
  1555. },
  1556. // 删除、冻结、解冻、重置密码操作共用体
  1557. share_function(res, param) {
  1558. // console.log(res, param);
  1559. if (typeof res.code == 'undefined' || res.code == '') {
  1560. this.$message.error('返回数据格式问题,code未获取到!');
  1561. return;
  1562. }
  1563. if (res.code === 200) {
  1564. // 重新读取,刷新表格显示
  1565. if (param === 'ms') {
  1566. this.get_table_data('list');
  1567. } else {
  1568. this.getHostelListByCode(1234)
  1569. }
  1570. this.dialogConfirmVisible = false;
  1571. this.$message.success(res.message);
  1572. } else {
  1573. this.$message.error(res.message);
  1574. }
  1575. },
  1576. /**
  1577. * 删除、冻结、解冻、重置密码操作
  1578. */
  1579. delete_frozen_thaw_dialog_handler() {
  1580. var that = this;
  1581. if (this.delete_frozen_thaw_Data.action === 'reset') {
  1582. // 调用解冻接口
  1583. resetHostelAccountPassword(this.delete_frozen_thaw_Data.id).then((res) => {
  1584. that.share_function(res, 'ms')
  1585. }).catch((err) => {
  1586. // console.log(err);
  1587. this.$message.error(err.message);
  1588. })
  1589. } else if (this.delete_frozen_thaw_Data.action === 'frozen') {
  1590. // 调用冻结接口
  1591. frozenHostelAccount(this.delete_frozen_thaw_Data.id).then((res) => {
  1592. that.share_function(res, 'ms')
  1593. }).catch((err) => {
  1594. // console.log(err);
  1595. this.$message.error(err.message);
  1596. })
  1597. } else if (this.delete_frozen_thaw_Data.action === 'thaw') {
  1598. // 调用解冻接口
  1599. thawHostelAccount(this.delete_frozen_thaw_Data.id).then((res) => {
  1600. that.share_function(res, 'ms')
  1601. }).catch((err) => {
  1602. // console.log(err);
  1603. this.$message.error(err.message);
  1604. })
  1605. } else if (this.delete_frozen_thaw_Data.action === 'delete') {
  1606. // 调用删除接口
  1607. delHostelAccount(this.delete_frozen_thaw_Data.id).then((res) => {
  1608. that.share_function(res, 'ms')
  1609. }).catch((err) => {
  1610. // console.log(err);
  1611. this.$message.error(err.message);
  1612. })
  1613. } else if (this.delete_frozen_thaw_Data.action === 'delDic') {
  1614. // 民宿字典
  1615. delHomestayDictionary(this.del_dictionary_data.id).then((res) => {
  1616. that.share_function(res, 'dic')
  1617. }).catch((err) => {
  1618. // console.log(err);
  1619. this.$message.error(err.message);
  1620. })
  1621. } else {
  1622. this.$message.error('未知操作!');
  1623. }
  1624. },
  1625. // 获取乡镇列表
  1626. get_towns() {
  1627. getTowns().then((res) => {
  1628. if (res.code === 200) {
  1629. this.formInline.options = []
  1630. this.formAddHostel.options = []
  1631. this.formModifyHostel.options = []
  1632. for (var i = 0; i < res.data.length; i++) {
  1633. let town = {
  1634. id: res.data[i].id,
  1635. hotelTownship: res.data[i].name
  1636. }
  1637. this.formInline.options.push(town)
  1638. this.formAddHostel.options.push(town)
  1639. this.formModifyHostel.options.push(town)
  1640. }
  1641. } else {
  1642. if (res.data.length === 0) {
  1643. this.formInline.options = []
  1644. this.$message.warning('没有符合条件的数据!')
  1645. } else {
  1646. this.$message.warning(res.message)
  1647. }
  1648. }
  1649. }).catch((err) => {
  1650. // console.log(err);
  1651. this.$message.error(err.message)
  1652. });
  1653. },
  1654. /**
  1655. * 获取消费记录,表格数据
  1656. */
  1657. get_table_data(param) {
  1658. this.loading = true
  1659. this.get_condtion();
  1660. let data = this.cond_data;
  1661. if (param == 'search') {
  1662. data.page = 1
  1663. this.pagination.currentPage = 1
  1664. }
  1665. // console.log(data);
  1666. getTableData(data).then((res) => {
  1667. // console.log(res);
  1668. let tempData = res.data.pageList;
  1669. if (typeof tempData !== 'undefined' && tempData !== '') {
  1670. this.pagination.total = res.data.total
  1671. this.tableData = []
  1672. for (var i = 0; i < tempData.length; i++) {
  1673. tempData[i].xuhao = (this.pagination.currentPage - 1) * this.pagination.pageSize + i + 1
  1674. this.tableData.push(tempData[i])
  1675. }
  1676. } else {
  1677. this.tableData = []
  1678. this.$message.warning('没有符合条件的数据!')
  1679. }
  1680. }).catch((err) => {
  1681. // console.log(err);
  1682. this.$message.error(err.message)
  1683. });
  1684. this.loading = false;
  1685. },
  1686. /**
  1687. * 条件
  1688. */
  1689. get_condtion() {
  1690. let data = {
  1691. page: this.pagination.currentPage,
  1692. rows: this.pagination.pageSize,
  1693. level: this.currentUserLevel
  1694. }
  1695. if (this.formInline.id !== '') {
  1696. data.hotelTownship = this.formInline.id // 对应id
  1697. }
  1698. if (this.formInline.adminName !== '') {
  1699. data.adminName = this.formInline.adminName
  1700. }
  1701. this.cond_data = data;
  1702. },
  1703. /**
  1704. * 搜索
  1705. */
  1706. btn_search() {
  1707. this.get_table_data('search')
  1708. },
  1709. /**
  1710. * currentPage 改变时会触发
  1711. * @param {Object} val
  1712. */
  1713. currentPageChange(val) {
  1714. this.pagination.currentPage = val
  1715. this.get_table_data('pages')
  1716. }
  1717. }
  1718. }
  1719. </script>
  1720. <style lang="scss" scoped>
  1721. .app-container {
  1722. background-color: #EFF2F7;
  1723. padding: 10px;
  1724. .el-row {
  1725. .el-col {
  1726. padding: 10px;
  1727. .cell {
  1728. padding: 30px;
  1729. border-radius: 10px;
  1730. background-color: #FFFFFF;
  1731. // box-shadow: 5px 5px 15px #979797;
  1732. box-shadow: 0px 3px 21px 0px rgba(60, 108, 254, 0.16);
  1733. .cell-title {
  1734. display: flex;
  1735. justify-content: space-between;
  1736. align-items: center;
  1737. margin-bottom: 30px;
  1738. padding-bottom: 30px;
  1739. border-bottom: 1px solid #CCCCCC;
  1740. .title-left {
  1741. display: flex;
  1742. align-items: center;
  1743. .title {
  1744. font-size: 22px;
  1745. font-family: Microsoft YaHei-3970(82674968);
  1746. font-weight: bold;
  1747. color: #1A202B;
  1748. }
  1749. .title-detail {
  1750. margin-left: 50px;
  1751. font-size: 18px;
  1752. font-family: Microsoft YaHei-3970(82674968);
  1753. color: #1A202B;
  1754. }
  1755. }
  1756. .title-right {
  1757. display: flex;
  1758. justify-content: space-between;
  1759. align-items: center;
  1760. .el-button {
  1761. width: 110px;
  1762. height: 46px;
  1763. background: #2B4CFE;
  1764. font-size: 18px;
  1765. color: #FFFFFF;
  1766. font-family: Microsoft YaHei-3970(82674968);
  1767. border-radius: 5px;
  1768. }
  1769. .el-button--warning {
  1770. background: #F88A64;
  1771. }
  1772. }
  1773. }
  1774. .cell-body {
  1775. .controls {
  1776. display: flex;
  1777. justify-content: space-between;
  1778. align-items: center;
  1779. .demo-form-inline {
  1780. display: inline-flex;
  1781. flex-wrap: wrap;
  1782. align-items: center;
  1783. justify-content: flex-start;
  1784. .btn-search {
  1785. background: rgba(9, 101, 98, 1);
  1786. font-size: 14px;
  1787. color: #FFFFFF;
  1788. font-family: Microsoft YaHei-3970(82674968);
  1789. border-radius: 5px;
  1790. border: none;
  1791. }
  1792. }
  1793. .right-btns {
  1794. width: 220px;
  1795. display: flex;
  1796. justify-content: flex-start;
  1797. .export {
  1798. background: rgba(9, 101, 98, 1);
  1799. font-size: 14px;
  1800. color: #FFFFFF;
  1801. font-family: Microsoft YaHei-3970(82674968);
  1802. border-radius: 5px;
  1803. margin-bottom: 22px;
  1804. border: none;
  1805. }
  1806. }
  1807. }
  1808. .pagination-table {
  1809. display: flex;
  1810. justify-content: space-between;
  1811. align-items: center;
  1812. height: 30px;
  1813. margin-top: 20px;
  1814. padding-right: 100px;
  1815. .txt-notice {
  1816. color: rgba(212, 48, 48, 1);
  1817. }
  1818. ::v-deep .el-pagination {
  1819. display: flex;
  1820. justify-content: flex-end;
  1821. align-items: center;
  1822. }
  1823. ::v-deep .el-pagination ul {
  1824. display: flex;
  1825. }
  1826. ::v-deep .el-pagination button,
  1827. ::v-deep .el-pagination li {
  1828. display: flex;
  1829. justify-content: center;
  1830. align-items: center;
  1831. width: 50px;
  1832. height: 36px;
  1833. border: 1px solid #626262;
  1834. border-radius: 3px;
  1835. font-size: 14px;
  1836. margin: 0 5px;
  1837. }
  1838. ::v-deep .el-pagination span {
  1839. margin-left: 10px;
  1840. }
  1841. ::v-deep .el-pagination .el-pagination__jump {
  1842. font-size: 16px;
  1843. }
  1844. ::v-deep .el-pagination .el-pagination__editor {
  1845. width: 50px;
  1846. height: 36px;
  1847. margin: 0 5px;
  1848. }
  1849. ::v-deep .el-pagination .el-input__inner {
  1850. width: 50px;
  1851. height: 36px;
  1852. border: 1px solid #626262;
  1853. margin: -4px 0 0 0;
  1854. }
  1855. }
  1856. }
  1857. .action-btns {
  1858. display: flex;
  1859. justify-content: space-around;
  1860. .bg-btn {
  1861. color: rgba(9, 101, 98, 1);
  1862. }
  1863. }
  1864. }
  1865. }
  1866. }
  1867. ::v-deep .hide .el-upload--picture-card {
  1868. display: none;
  1869. }
  1870. ::v-deep .el-dialog {
  1871. margin: 0 !important;
  1872. width: 400px;
  1873. height: 460px;
  1874. background: #FFFFFF;
  1875. box-shadow: 0px 0px 13px 0px rgba(0, 0, 0, 0.29);
  1876. border-radius: 6px;
  1877. position: absolute;
  1878. top: 50%;
  1879. left: 50%;
  1880. transform: translate(-50%, -50%);
  1881. .el-dialog__header {
  1882. display: flex;
  1883. align-items: center;
  1884. width: 100%;
  1885. height: 58px;
  1886. padding: 30px;
  1887. // background: #E6EBFE;
  1888. border-radius: 6px 6px 0px 0px;
  1889. font-weight: bold;
  1890. border-bottom: 1px solid rgba(230, 230, 230, 1);
  1891. }
  1892. .el-dialog__body {
  1893. padding-bottom: 0;
  1894. .el-form-item__label,
  1895. .el-form-item__content {
  1896. font-size: 16px;
  1897. font-family: Microsoft YaHei-3970(82674968);
  1898. color: #53575A;
  1899. }
  1900. .el-input__inner {
  1901. width: 280px;
  1902. }
  1903. }
  1904. // 删除对话框的样式
  1905. .del-account-body {
  1906. display: flex;
  1907. flex-direction: column;
  1908. justify-content: center;
  1909. align-items: center;
  1910. height: 180px;
  1911. img {
  1912. width: 72px;
  1913. }
  1914. .del-account-body-txt {
  1915. height: 58px;
  1916. line-height: 58px;
  1917. font-size: 18px;
  1918. font-family: Microsoft YaHei-3970(82674968);
  1919. color: #333333;
  1920. }
  1921. }
  1922. .el-dialog__footer {
  1923. padding-bottom: 0 !important;
  1924. text-align: center;
  1925. .el-button.el-button--default {
  1926. width: 75px;
  1927. height: 40px;
  1928. border: 1px solid #2B4CFE;
  1929. border-radius: 6px;
  1930. font-size: 16px;
  1931. font-family: Microsoft YaHei-3970(82674968);
  1932. color: #2B4CFE;
  1933. }
  1934. .el-button.el-button--primary {
  1935. width: 75px;
  1936. height: 40px;
  1937. background: #2B4CFE;
  1938. border-radius: 6px;
  1939. font-size: 16px;
  1940. font-family: Microsoft YaHei-3970(82674968);
  1941. color: #FFFFFF;
  1942. margin-left: 60px;
  1943. }
  1944. }
  1945. }
  1946. }
  1947. </style>
  1948. <style>
  1949. .add-house-class,
  1950. .modify-house-class {
  1951. width: 998px !important;
  1952. height: 860px !important;
  1953. }
  1954. .configuration-window {
  1955. width: 580px !important;
  1956. height: 620px !important;
  1957. }
  1958. .el-dialog-delete-house {
  1959. height: 300px !important;
  1960. width: 500px !important;
  1961. }
  1962. .el-dialog-delete-house .el-dialog__header {
  1963. display: none !important;
  1964. }
  1965. .add-info-cancel-btn {
  1966. color: rgba(9, 101, 98, 1) !important;
  1967. border: 1px solid rgba(9, 101, 98, 1) !important;
  1968. }
  1969. .add-info-confirm-btn {
  1970. border: none !important;
  1971. background: rgba(9, 101, 98, 1) !important;
  1972. color: #fff !important;
  1973. border-radius: 5px !important;
  1974. margin-left: 28px !important;
  1975. }
  1976. .configure-btn-position {
  1977. display: flex;
  1978. justify-content: flex-end;
  1979. }
  1980. .configure-btn {
  1981. border: none !important;
  1982. background: rgba(9, 101, 98, 1) !important;
  1983. color: #fff !important;
  1984. border-radius: 5px !important;
  1985. }
  1986. .el-tabs__item.is-top {
  1987. color: rgba(9, 101, 98, 1) !important;
  1988. }
  1989. .el-tabs__active-bar {
  1990. background-color: rgba(9, 101, 98, 1) !important;
  1991. }
  1992. .dialog-footer {
  1993. display: flex;
  1994. justify-content: flex-end;
  1995. }
  1996. .demo-table-expand {
  1997. font-size: 0;
  1998. }
  1999. .demo-table-expand label {
  2000. width: 108px;
  2001. text-align: right !important;
  2002. color: #99a9bf;
  2003. }
  2004. .demo-table-expand .el-form-item {
  2005. margin-right: 0;
  2006. margin-bottom: 0;
  2007. width: 33%;
  2008. }
  2009. .add-ms-class {
  2010. width: 400px !important;
  2011. height: 280px !important;
  2012. }
  2013. .add-ms-class .el-input__inner {
  2014. width: 220px !important;
  2015. }
  2016. .add-ms-service {
  2017. width: 400px !important;
  2018. height: 480px !important;
  2019. }
  2020. .add-ms-service .el-input__inner {
  2021. width: 220px !important;
  2022. }
  2023. </style>