index.vue 76 KB

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