| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373 |
- <template>
- <div class="app-container">
- <el-row>
- <el-col :span="24">
- <div class="cell">
- <div class="cell-title">
- <div class="title-left">
- <div class="title">系统设置/民宿管理</div>
- </div>
- </div>
- <div class="cell-body">
- <div class="controls">
- <el-form :inline="true" :model="formInline" class="demo-form-inline">
- <el-form-item label="所属乡镇">
- <el-select v-model="formInline.id" clearable placeholder="请选择">
- <el-option v-for="item in formInline.options" :key="item.id" :label="item.hotelTownship" :value="item.id">
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="">
- <el-input v-model="formInline.adminName" prefix-icon="el-icon-search" clearable placeholder="请输入关键字"></el-input>
- </el-form-item>
- <el-form-item>
- <el-button type="primary" class="btn-search" @click="btn_search">查询</el-button>
- </el-form-item>
- </el-form>
- <div class="right-btns">
- <el-button type="primary" class="export" @click="add_house_dialog">添加民宿</el-button>
- <el-button type="primary" class="export" @click="hostelConfiguration">民宿配置</el-button>
- </div>
- </div>
- <el-table :data="tableData" height="510" style="width: 100%" :cell-style="cell_style" v-loading="loading"
- :header-cell-style="header_cell_style">
- <el-table-column type="expand" width="58">
- <template slot-scope="props">
- <el-form label-position="left" inline class="demo-table-expand">
- <el-form-item label="银行卡号">
- <span>{{ props.row.bankCard }}</span>
- </el-form-item>
- <el-form-item label="银行名称">
- <span>{{ props.row.bankName }}</span>
- </el-form-item>
- <el-form-item label="卡户主姓名">
- <span>{{ props.row.cardName }}</span>
- </el-form-item>
- <el-form-item label="权限">
- <span>{{ props.row.level == 1 ? '管理员' : '超级管理员' }}</span>
- </el-form-item>
- <el-form-item label="创建时间">
- <span>{{ props.row.createDate }}</span>
- </el-form-item>
- <el-form-item label="修改时间">
- <span>{{ props.row.modifyDate }}</span>
- </el-form-item>
- </el-form>
- </template>
- </el-table-column>
- <el-table-column label="序号" align="center" width="100">
- <template slot-scope="scope">
- <span>{{ scope.row.xuhao }}</span>
- </template>
- </el-table-column>
- <el-table-column label="状态" align="center" width="80">
- <template slot-scope="scope">
- <span>{{ scope.row.status === 1 ? '正常' : '已冻结' }}</span>
- </template>
- </el-table-column>
- <el-table-column label="民宿等级" align="center" width="110">
- <template slot-scope="scope">
- <span v-if="scope.row.type == 1">银宿级</span>
- <span v-else-if="scope.row.type == 2">金宿级</span>
- <span v-else="scope.row.type == 3">白金级</span>
- </template>
- </el-table-column>
- <el-table-column label="民宿名称" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.hotelName }}</span>
- </template>
- </el-table-column>
- <el-table-column label="联系人(法人)" align="center" width="120">
- <template slot-scope="scope">
- <span>{{ scope.row.corpnName }}</span>
- </template>
- </el-table-column>
- <el-table-column label="联系电话" align="center" width="120">
- <template slot-scope="scope">
- <span>{{ scope.row.corpnPhone }}</span>
- </template>
- </el-table-column>
- <el-table-column label="所属乡镇" align="center" width="130">
- <template slot-scope="scope">
- <span>{{ scope.row.hotelTownshipName}}</span>
- </template>
- </el-table-column>
- <el-table-column label="民宿账号" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.adminName }}</span>
- </template>
- </el-table-column>
- <el-table-column label="操作" align="center" width="210">
- <template slot-scope="scope">
- <div class="action-btns">
- <el-link class="bg-btn" @click="show_confirm_dialog(scope.$index, scope.row, 'reset')">密码重置</el-link>
- <el-link class="bg-btn" @click="modify_house_dialog(scope.$index, scope.row)">修改</el-link>
- <el-link v-if="scope.row.status === 1" type="primary"
- @click="show_confirm_dialog(scope.$index, scope.row, 'frozen')">冻结</el-link>
- <el-link v-if="scope.row.status === 2" type="warning"
- @click="show_confirm_dialog(scope.$index, scope.row, 'thaw')">解冻</el-link>
- <el-link type="danger" @click="show_confirm_dialog(scope.$index, scope.row, 'delete')">删除</el-link>
- </div>
- </template>
- </el-table-column>
- </el-table>
- <div class="pagination-table">
- <div class="txt-notice">注:账号解冻后,密码默认为Jams_123456</div>
- <el-pagination @current-change="currentPageChange" :current-page.sync="pagination.currentPage" :page-size="pagination.pageSize"
- layout="prev, pager, next, jumper" :total="pagination.total">
- </el-pagination>
- </div>
- </div>
- </div>
- </el-col>
- </el-row>
- <!-- 添加民宿 -->
- <el-dialog title="添加民宿" custom-class="add-house-class" :visible.sync="dialogAddHostelFormVisible" :close-on-click-modal="false"
- :close-on-press-escape="false" @close="add_house_dialog_close">
- <el-form :model="formAddHostel" ref="addHostelForm" :rules="addHostelFormRules">
- <el-row>
- <el-col :span="12">
- <div style="font-size: 16px;font-weight: 700; color: rgba(0, 0, 0, 1); margin: -10px 0 20px 20px;">民宿信息</div>
- <el-form-item label="民宿名称:" :label-width="formLabelWidth" :required="true" prop="hotelName">
- <el-input v-model="formAddHostel.hotelName" autocomplete="off" placeholder="请输入民宿名称" maxlength="20">
- </el-input>
- </el-form-item>
- <el-form-item label="法人姓名:" :label-width="formLabelWidth" :required="true" prop="corpnName">
- <el-input v-model="formAddHostel.corpnName" autocomplete="off" placeholder="请输入法人姓名" maxlength="8">
- </el-input>
- </el-form-item>
- <el-form-item label="法人电话:" :label-width="formLabelWidth" :required="true" prop="corpnPhone">
- <el-input v-model="formAddHostel.corpnPhone" autocomplete="off" placeholder="请输入法人电话" maxlength="13">
- </el-input>
- </el-form-item>
- <el-form-item label="所属乡镇:" :label-width="formLabelWidth" :required="true" prop="id">
- <el-select v-model="formAddHostel.hotelTownship" clearable placeholder="请选择乡镇" @change="getHotelId($event)">
- <el-option v-for="item in formAddHostel.options" :key="item.id" :label="item.hotelTownship" :value="item.id">
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="民宿账号:" :label-width="formLabelWidth" :required="true" prop="adminName">
- <el-input v-model="formAddHostel.adminName" autocomplete="off" placeholder="请输入民宿账号" maxlength="16">
- </el-input>
- </el-form-item>
- <div
- 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;">
- 注:密码默认为Jams_123456</div>
- </el-col>
- <el-col :span="12">
- <div style="font-size: 16px;font-weight: 700; color: rgba(0, 0, 0, 1); margin: -10px 0 20px 20px;">提现信息</div>
- <el-form-item label="银行卡号:" :label-width="formLabelWidth" :required="true" prop="bankCard">
- <el-input v-model="formAddHostel.bankCard" autocomplete="off" placeholder="请输入银行卡号" maxlength="19">
- </el-input>
- </el-form-item>
- <el-form-item label="户主姓名:" :label-width="formLabelWidth" :required="true" prop="cardName">
- <el-input v-model="formAddHostel.cardName" autocomplete="off" placeholder="请输入户主姓名" maxlength="8">
- </el-input>
- </el-form-item>
- <el-form-item label="银行名称:" :label-width="formLabelWidth" :required="true" prop="bankName">
- <el-input v-model="formAddHostel.bankName" autocomplete="off" placeholder="请输入银行名称" maxlength="10">
- </el-input>
- </el-form-item>
- <el-form-item label="民宿等级:" :label-width="formLabelWidth" :required="true" prop="jibieId">
- <el-select v-model="formAddHostel.jibieId" clearable placeholder="请选择等级">
- <el-option v-for="item in formAddHostel.jibie" :key="item.id" :label="item.jibieName" :value="item.id">
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="720全景链接" :label-width="formLabelWidth" :required="true" prop="linkproUrl">
- <el-input v-model="formAddHostel.linkproUrl" autocomplete="off" placeholder="请输入720全景链接">
- </el-input>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="24">
- <div style="font-size: 16px;font-weight: 700; color: rgba(0, 0, 0, 1); margin: 0px 0 20px 20px;">营业执照</div>
- <el-form-item label="" :required="true" prop="fileUrl">
- <pl-upload v-model="formAddHostel.fileUrl" :times="times" :linkUrl="formAddHostel.url" :limitCount="6" :type="1"></pl-upload>
- </el-form-item>
- </el-col>
- </el-row>
- </el-form>
- <div
- 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;">
- (注:最多可上传6张图片)</div>
- <div slot="footer" class="dialog-footer">
- <el-button class="add-info-cancel-btn" @click="dialogAddHostelFormVisible = false">取 消</el-button>
- <el-button class="add-info-confirm-btn" @click="add_house_dialog_handler">确 认</el-button>
- </div>
- </el-dialog>
- <!-- 修改民宿对话框 -->
- <el-dialog title="修改民宿" custom-class="modify-house-class" :visible.sync="dialogModifyHostelFormVisible" :close-on-click-modal="false"
- :close-on-press-escape="false" @close="modify_house_dialog_close">
- <el-form :model="formModifyHostel" ref="modifyHostelForm" :rules="modifyHostelFormRules">
- <el-row>
- <el-col :span="12">
- <div style="font-size: 16px;font-weight: 700; color: rgba(0, 0, 0, 1); margin: -10px 0 20px 20px;">民宿信息</div>
- <el-form-item label="民宿名称:" :label-width="formLabelWidth" :required="true" prop="hotelName">
- <el-input v-model="formModifyHostel.hotelName" autocomplete="off" placeholder="请输入民宿名称" maxlength="20">
- </el-input>
- </el-form-item>
- <el-form-item label="法人姓名:" :label-width="formLabelWidth" :required="true" prop="corpnName">
- <el-input v-model="formModifyHostel.corpnName" autocomplete="off" placeholder="请输入法人姓名" maxlength="8">
- </el-input>
- </el-form-item>
- <el-form-item label="法人电话:" :label-width="formLabelWidth" :required="true" prop="corpnPhone">
- <el-input v-model="formModifyHostel.corpnPhone" autocomplete="off" placeholder="请输入法人电话" maxlength="13">
- </el-input>
- </el-form-item>
- <el-form-item label="所属乡镇:" :label-width="formLabelWidth" :required="true" prop="id">
- <el-select v-model="formModifyHostel.hotelTownship" clearable placeholder="请选择乡镇">
- <el-option v-for="item in formModifyHostel.options" :key="item.id" :label="item.hotelTownship" :value="item.id">
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="民宿账号:" :label-width="formLabelWidth" :required="true" prop="adminName">
- <el-input v-model="formModifyHostel.adminName" autocomplete="off" placeholder="请输入民宿账号" maxlength="16">
- </el-input>
- </el-form-item>
- <div
- 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;">
- 注:密码默认为Jams_123456</div>
- </el-col>
- <el-col :span="12">
- <div style="font-size: 16px;font-weight: 700; color: rgba(0, 0, 0, 1); margin: -10px 0 20px 20px;">提现信息</div>
- <el-form-item label="银行卡号:" :label-width="formLabelWidth" :required="true" prop="bankCard">
- <el-input v-model="formModifyHostel.bankCard" autocomplete="off" placeholder="请输入银行卡号" maxlength="19">
- </el-input>
- </el-form-item>
- <el-form-item label="户主姓名:" :label-width="formLabelWidth" :required="true" prop="cardName">
- <el-input v-model="formModifyHostel.cardName" autocomplete="off" placeholder="请输入户主姓名" maxlength="8">
- </el-input>
- </el-form-item>
- <el-form-item label="银行名称:" :label-width="formLabelWidth" :required="true" prop="bankName" maxlength="20">
- <el-input v-model="formModifyHostel.bankName" autocomplete="off" placeholder="请输入银行名称">
- </el-input>
- </el-form-item>
- <el-form-item label="民宿等级:" :label-width="formLabelWidth" :required="true" prop="type">
- <el-select v-model="formModifyHostel.type" clearable placeholder="请选择等级">
- <el-option v-for="item in formModifyHostel.jibie" :key="item.id" :label="item.jibieName" :value="item.id">
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="720全景链接" :label-width="formLabelWidth" :required="true" prop="linkProUrl">
- <el-input v-model="formModifyHostel.linkProUrl" autocomplete="off" placeholder="请输入720全景链接">
- </el-input>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="24">
- <div style="font-size: 16px;font-weight: 700; color: rgba(0, 0, 0, 1); margin: 0px 0 20px 20px;">营业执照</div>
- <el-form-item label="" :required="true" prop="fileUrl">
- <pl-upload v-model="formModifyHostel.fileUrl" :linkId="formModifyHostel.id" :limitCount="6" :type="1"></pl-upload>
- </el-form-item>
- </el-col>
- </el-row>
- </el-form>
- <div
- 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;">
- (注:最多可上传6张图片)</div>
- <div slot="footer" class="dialog-footer">
- <el-button class="add-info-cancel-btn" @click="dialogModifyHostelFormVisible = false">取 消</el-button>
- <el-button class="add-info-confirm-btn" @click="modify_house_dialog_handler">确 认</el-button>
- </div>
- </el-dialog>
- <!-- 民宿配置 -->
- <el-dialog title="民宿配置" custom-class="configuration-window" :visible.sync="dialogResidentialHostelConfigurationVisible" :close-on-click-modal="false"
- :close-on-press-escape="false" @close="residential_hostel_configuration_dialog_close">
- <el-tabs v-model="activeName" @tab-click="tabHandleClick">
- <el-tab-pane label="民宿类型" name="first">
- <el-row>
- <el-col :span="24" class="configure-btn-position">
- <el-button class="configure-btn" @click="add_dictionary_dialog(1)">添加</el-button>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="24">
- <el-table :data="tableData_hostel_class" height="380" style="width: 100%" :cell-style="cell_style" v-loading="loading"
- :header-cell-style="header_cell_style">
- <el-table-column label="序号" align="center" width="100">
- <template slot-scope="scope">
- <span>{{ (pagination.currentPage - 1) * pagination.pageSize + scope.$index + 1 }}</span>
- </template>
- </el-table-column>
- <el-table-column label="民宿类型" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.name }}</span>
- </template>
- </el-table-column>
- <el-table-column label="操作" align="center" width="110">
- <template slot-scope="scope">
- <div class="action-btns">
- <el-link class="bg-btn" @click="show_modify_dictionary_dialog(scope.$index, scope.row, 1)">编辑</el-link>
- <el-link type="danger" @click="delete_dictionary_dialog(scope.$index, scope.row)">删除</el-link>
- </div>
- </template>
- </el-table-column>
- </el-table>
- </el-col>
- </el-row>
- </el-tab-pane>
- <el-tab-pane label="民宿服务" name="second">
- <el-row>
- <el-col :span="24" class="configure-btn-position">
- <el-button class="configure-btn" @click="add_dictionary_dialog(2)">添加</el-button>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="24">
- <el-table :data="tableData_hostel_service" height="380" style="width: 100%" :cell-style="cell_style" v-loading="loading"
- :header-cell-style="header_cell_style">
- <el-table-column label="序号" align="center" width="100">
- <template slot-scope="scope">
- <span>{{ (pagination.currentPage - 1) * pagination.pageSize + scope.$index + 1 }}</span>
- </template>
- </el-table-column>
- <el-table-column label="图标" align="center" width="128">
- <template slot-scope="scope">
- <img :src="scope.row.fileUrl" width="24" height="24">
- </template>
- </el-table-column>
- <el-table-column label="民宿服务" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.name }}</span>
- </template>
- </el-table-column>
- <el-table-column label="操作" align="center" width="110">
- <template slot-scope="scope">
- <div class="action-btns">
- <el-link class="bg-btn" @click="show_modify_dictionary_dialog(scope.$index, scope.row, 2)">编辑</el-link>
- <el-link type="danger" @click="delete_dictionary_dialog(scope.$index, scope.row)">删除</el-link>
- </div>
- </template>
- </el-table-column>
- </el-table>
- </el-col>
- </el-row>
- </el-tab-pane>
- <el-tab-pane label="房型名称" name="third">
- <el-row>
- <el-col :span="24" class="configure-btn-position">
- <el-button class="configure-btn" @click="add_dictionary_dialog(3)">添加</el-button>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="24">
- <el-table :data="tableData_house_name" height="380" style="width: 100%" :cell-style="cell_style" v-loading="loading"
- :header-cell-style="header_cell_style">
- <el-table-column label="序号" align="center" width="100">
- <template slot-scope="scope">
- <span>{{ (pagination.currentPage - 1) * pagination.pageSize + scope.$index + 1 }}</span>
- </template>
- </el-table-column>
- <el-table-column label="房型名称" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.name }}</span>
- </template>
- </el-table-column>
- <el-table-column label="操作" align="center" width="110">
- <template slot-scope="scope">
- <div class="action-btns">
- <el-link class="bg-btn" @click="show_modify_dictionary_dialog(scope.$index, scope.row, 3)">编辑</el-link>
- <el-link type="danger" @click="delete_dictionary_dialog(scope.$index, scope.row)">删除</el-link>
- </div>
- </template>
- </el-table-column>
- </el-table>
- </el-col>
- </el-row>
- </el-tab-pane>
- <el-tab-pane label="房型服务" name="fourth">
- <el-row>
- <el-col :span="24" class="configure-btn-position">
- <el-button class="configure-btn" @click="add_dictionary_dialog(4)">添加</el-button>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="24">
- <el-table :data="tableData_house_service" height="380" style="width: 100%" :cell-style="cell_style" v-loading="loading"
- :header-cell-style="header_cell_style">
- <el-table-column label="序号" align="center" width="100">
- <template slot-scope="scope">
- <span>{{ (pagination.currentPage - 1) * pagination.pageSize + scope.$index + 1 }}</span>
- </template>
- </el-table-column>
- <el-table-column label="图标" align="center" width="128">
- <template slot-scope="scope">
- <img :src="scope.row.fileUrl" alt="" width="24" height="24">
- </template>
- </el-table-column>
- <el-table-column label="房型服务" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.name }}</span>
- </template>
- </el-table-column>
- <el-table-column label="操作" align="center" width="110">
- <template slot-scope="scope">
- <div class="action-btns">
- <el-link class="bg-btn" @click="show_modify_dictionary_dialog(scope.$index, scope.row, 4)">编辑</el-link>
- <el-link type="danger" @click="delete_dictionary_dialog(scope.$index, scope.row)">删除</el-link>
- </div>
- </template>
- </el-table-column>
- </el-table>
- </el-col>
- </el-row>
- </el-tab-pane>
- <el-tab-pane label="其他配置" name="fifth">
- <el-row>
- <el-col :span="24">
- <div style="font-size: 14px; font-weight: bold; margin: 50px 0 10px 0;">订单响应:</div>
- <div style="display: flex; align-items: center;">
- <div style="white-space: nowrap; padding-left: 30px;">当民宿设置手动接单时,用户下单后</div>
- <el-select class="custom-select" v-model="otherConfig[0].miniteValue" placeholder="请选择">
- <el-option v-for="item in otherConfig[0].miniteOptions" :key="item.value" :label="item.label" :value="item.value">
- </el-option>
- </el-select>
- <div style="white-space: nowrap;">内响应订单;</div>
- </div>
- <div style="display: flex; align-items: center;">
- <div style="white-space: nowrap; padding-left: 30px;">若没响应,则自动</div>
- <el-select class="custom-select" v-model="otherConfig[1].value" placeholder="请选择">
- <el-option v-for="item in otherConfig[1].options" :key="item.value" :label="item.label" :value="item.value">
- </el-option>
- </el-select>
- <div>。</div>
- </div>
- <div style="font-size: 14px; font-weight: bold; margin: 50px 0 10px 0;">民宿预订期:</div>
- <div style="display: flex; align-items: center;">
- <div style="white-space: nowrap; padding-left: 30px;">可预订</div>
- <el-select class="custom-select" v-model="otherConfig[2].monthValue" placeholder="请选择">
- <el-option v-for="item in otherConfig[2].monthOptions" :key="item.value" :label="item.label" :value="item.value">
- </el-option>
- </el-select>
- <div>内的房间。</div>
- </div>
- <div style="display: flex; justify-content: flex-end; padding-top: 130px;">
- <el-button class="cancel-btn" @click="dialogResidentialHostelConfigurationVisible = false">取 消</el-button>
- <el-button type="primary" class="confirm-btn" @click="handlerOtherConfig">确 定</el-button>
- </div>
- </el-col>
- </el-row>
- </el-tab-pane>
- </el-tabs>
- </el-dialog>
- <!-- 添加民宿类型配置字典 不带图标-->
- <el-dialog title="添加民宿类型" custom-class="add-ms-class" :visible.sync="dialogAddDictionaryFormVisible" :close-on-click-modal="false"
- :close-on-press-escape="false" @close="add_house_dialog_close">
- <el-row>
- <el-col :span="24">
- <el-form :model="add_dictionary_data" ref="addHostelClassForm" :rules="addHostelClassFormRules">
- <el-form-item label="民宿类型:" :label-width="formLabelWidth" :required="true" prop="name">
- <el-input v-model="add_dictionary_data.name" autocomplete="off" maxlength="20" placeholder="请输入民宿类型">
- </el-input>
- </el-form-item>
- </el-form>
- </el-col>
- </el-row>
- <div slot="footer" class="dialog-footer">
- <el-button class="add-info-cancel-btn" @click="dialogAddDictionaryFormVisible = false">取 消</el-button>
- <el-button class="add-info-confirm-btn" @click="add_house_class_dialog_handler(1)">确 认</el-button>
- </div>
- </el-dialog>
- <!-- 添加民宿服务配置字典 带图标-->
- <el-dialog title="添加民宿服务" custom-class="add-ms-service" :visible.sync="dialogAddDictionaryServiceFormVisible" :close-on-click-modal="false"
- :close-on-press-escape="false" @close="add_house_dialog_close">
- <el-form :model="add_dictionary_data" ref="addHostelServiceForm" :rules="addHostelServiceFormRules">
- <el-row>
- <el-col :span="24">
- <el-form-item label="民宿服务:" :label-width="formLabelWidth" :required="true" prop="name">
- <el-input v-model="add_dictionary_data.name" autocomplete="off" maxlength="20" placeholder="请输入民宿服务">
- </el-input>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="24">
- <div style="font-size: 16px;font-weight: 700; color: rgba(0, 0, 0, 1); margin: 0px 0 20px 20px;">图标</div>
- <el-form-item label="" :required="true" prop="fileUrl">
- <pl-upload v-model="add_dictionary_data.fileUrl" :times="times" :linkUrl="add_dictionary_data.url" :limitCount="1"
- :type="2"></pl-upload>
- </el-form-item>
- </el-col>
- </el-row>
- </el-form>
- <div slot="footer" class="dialog-footer">
- <el-button class="add-info-cancel-btn" @click="dialogAddDictionaryServiceFormVisible = false">取 消</el-button>
- <el-button class="add-info-confirm-btn" @click="add_house_class_dialog_handler(2)">确 认</el-button>
- </div>
- </el-dialog>
- <!-- 添加房型名称配置字典 不带图标-->
- <el-dialog title="添加房型名称" custom-class="add-ms-class" :visible.sync="dialogAddDictionaryNameFormVisible" :close-on-click-modal="false"
- :close-on-press-escape="false" @close="add_house_dialog_close">
- <el-row>
- <el-col :span="24">
- <el-form :model="add_dictionary_data" ref="addHostelNameForm" :rules="addHostelNameFormRules">
- <el-form-item label="房型名称:" :label-width="formLabelWidth" :required="true" prop="name">
- <el-input v-model="add_dictionary_data.name" autocomplete="off" maxlength="20" placeholder="请输入房型名称">
- </el-input>
- </el-form-item>
- </el-form>
- </el-col>
- </el-row>
- <div slot="footer" class="dialog-footer">
- <el-button class="add-info-cancel-btn" @click="dialogAddDictionaryNameFormVisible = false">取 消</el-button>
- <el-button class="add-info-confirm-btn" @click="add_house_class_dialog_handler(3)">确 认</el-button>
- </div>
- </el-dialog>
- <!-- 添加房型服务配置字典 带图标-->
- <el-dialog title="添加房型服务" custom-class="add-ms-service" :visible.sync="dialogAddDictionaryHouseServiceFormVisible" :close-on-click-modal="false"
- :close-on-press-escape="false" @close="add_house_dialog_close">
- <el-form :model="add_dictionary_data" ref="addHouseTypeServiceForm" :rules="addHouseTypeServiceFormRules">
- <el-row>
- <el-col :span="24">
- <el-form-item label="房型服务:" :label-width="formLabelWidth" :required="true" prop="name">
- <el-input v-model="add_dictionary_data.name" autocomplete="off" maxlength="20" placeholder="请输入房型服务">
- </el-input>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="24">
- <div style="font-size: 16px;font-weight: 700; color: rgba(0, 0, 0, 1); margin: 0px 0 20px 20px;">图标</div>
- <el-form-item label="" :required="true" prop="fileUrl">
- <pl-upload v-model="add_dictionary_data.fileUrl" :times="times" :linkUrl="add_dictionary_data.url" :limitCount="1"
- :type="2"></pl-upload>
- </el-form-item>
- </el-col>
- </el-row>
- </el-form>
- <div slot="footer" class="dialog-footer">
- <el-button class="add-info-cancel-btn" @click="dialogAddDictionaryHouseServiceFormVisible = false">取 消</el-button>
- <el-button class="add-info-confirm-btn" @click="add_house_class_dialog_handler(4)">确 认</el-button>
- </div>
- </el-dialog>
- <!-- 修改民宿类型配置字典 不带图标-->
- <el-dialog title="修改民宿类型" custom-class="add-ms-class" :visible.sync="dialogModifyDictionaryFormVisible" :close-on-click-modal="false"
- :close-on-press-escape="false" @close="add_house_dialog_close">
- <el-row>
- <el-col :span="24">
- <el-form :model="modify_dictionary_data" ref="modifyHostelClassForm" :rules="modifyHostelClassFormRules">
- <el-form-item label="民宿类型:" :label-width="formLabelWidth" :required="true" prop="name">
- <el-input v-model="modify_dictionary_data.name" autocomplete="off" maxlength="20" placeholder="请输入民宿类型">
- </el-input>
- </el-form-item>
- </el-form>
- </el-col>
- </el-row>
- <div slot="footer" class="dialog-footer">
- <el-button class="add-info-cancel-btn" @click="dialogModifyDictionaryFormVisible = false">取 消</el-button>
- <el-button class="add-info-confirm-btn" @click="modify_house_class_dialog_handler(1)">确 认</el-button>
- </div>
- </el-dialog>
- <!-- 修改民宿服务配置字典 带图标-->
- <el-dialog title="修改民宿服务" custom-class="add-ms-service" :visible.sync="dialogModifyDictionaryServiceFormVisible" :close-on-click-modal="false"
- :close-on-press-escape="false" @close="add_house_dialog_close">
- <el-form :model="modify_dictionary_data" ref="modifyHostelServiceForm" :rules="modifyHostelServiceFormRules">
- <el-row>
- <el-col :span="24">
- <el-form-item label="民宿服务:" :label-width="formLabelWidth" :required="true" prop="name">
- <el-input v-model="modify_dictionary_data.name" autocomplete="off" maxlength="20" placeholder="请输入民宿服务">
- </el-input>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="24">
- <div style="font-size: 16px;font-weight: 700; color: rgba(0, 0, 0, 1); margin: 0px 0 20px 20px;">图标</div>
- <el-form-item label="" :required="true" prop="fileUrl">
- <pl-upload v-model="modify_dictionary_data.fileUrl" :linkUrl="modify_dictionary_data.url" :limitCount="1" :type="2"></pl-upload>
- </el-form-item>
- </el-col>
- </el-row>
- </el-form>
- <div slot="footer" class="dialog-footer">
- <el-button class="add-info-cancel-btn" @click="dialogModifyDictionaryServiceFormVisible = false">取 消</el-button>
- <el-button class="add-info-confirm-btn" @click="modify_house_class_dialog_handler(2)">确 认</el-button>
- </div>
- </el-dialog>
- <!-- 修改房型名称配置字典 不带图标-->
- <el-dialog title="修改房型名称" custom-class="add-ms-class" :visible.sync="dialogModifyDictionaryNameFormVisible" :close-on-click-modal="false"
- :close-on-press-escape="false" @close="add_house_dialog_close">
- <el-row>
- <el-col :span="24">
- <el-form :model="modify_dictionary_data" ref="modifyHostelNameForm" :rules="modifyHostelNameFormRules">
- <el-form-item label="房型名称:" :label-width="formLabelWidth" :required="true" prop="name">
- <el-input v-model="modify_dictionary_data.name" autocomplete="off" maxlength="20" placeholder="请输入房型名称">
- </el-input>
- </el-form-item>
- </el-form>
- </el-col>
- </el-row>
- <div slot="footer" class="dialog-footer">
- <el-button class="add-info-cancel-btn" @click="dialogModifyDictionaryNameFormVisible = false">取 消</el-button>
- <el-button class="add-info-confirm-btn" @click="modify_house_class_dialog_handler(3)">确 认</el-button>
- </div>
- </el-dialog>
- <!-- 修改房型服务配置字典 带图标-->
- <el-dialog title="修改房型服务" custom-class="add-ms-service" :visible.sync="dialogModifyDictionaryHouseServiceFormVisible" :close-on-click-modal="false"
- :close-on-press-escape="false" @close="add_house_dialog_close">
- <el-form :model="modify_dictionary_data" ref="modifyHouseTypeServiceForm" :rules="modifyHouseTypeServiceFormRules">
- <el-row>
- <el-col :span="24">
- <el-form-item label="房型服务:" :label-width="formLabelWidth" :required="true" prop="name">
- <el-input v-model="modify_dictionary_data.name" autocomplete="off" maxlength="20" placeholder="请输入房型服务">
- </el-input>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="24">
- <div style="font-size: 16px;font-weight: 700; color: rgba(0, 0, 0, 1); margin: 0px 0 20px 20px;">图标</div>
- <el-form-item label="" :required="true" prop="fileUrl">
- <pl-upload v-model="modify_dictionary_data.fileUrl" :linkUrl="modify_dictionary_data.url" :limitCount="1" :type="2"></pl-upload>
- </el-form-item>
- </el-col>
- </el-row>
- </el-form>
- <div slot="footer" class="dialog-footer">
- <el-button class="add-info-cancel-btn" @click="dialogModifyDictionaryHouseServiceFormVisible = false">取 消</el-button>
- <el-button class="add-info-confirm-btn" @click="modify_house_class_dialog_handler(4)">确 认</el-button>
- </div>
- </el-dialog>
- <!-- 确认对话框 -->
- <el-dialog custom-class="el-dialog-delete-house" :visible.sync="dialogConfirmVisible" :close-on-click-modal="false" :close-on-press-escape="false"
- :show-close="false">
- <div slot="" class="del-account-body">
- <img src="../../icons/serveAC/del_warning.png" alt="">
- <div class="del-account-body-txt">{{ delete_frozen_thaw_Data.prompt_message }}</div>
- </div>
- <div slot="footer" class="dialog-footer">
- <el-button class="add-info-cancel-btn" @click="dialogConfirmVisible = false"> 否 </el-button>
- <el-button class="add-info-confirm-btn" @click="delete_frozen_thaw_dialog_handler"> 是 </el-button>
- </div>
- </el-dialog>
- </div>
- </template>
- <script>
- import {
- getTableData,
- getTowns,
- addHostel,
- modifyHostel,
- delHostelAccount,
- resetHostelAccountPassword,
- frozenHostelAccount,
- thawHostelAccount,
- listHomestayDictionary,
- addHomestayDictionary,
- modifyHomestayDictionary,
- delHomestayDictionary,
- otherConfig,
- modifyOtherConfig
- } from '@/api/residentialhostelMgr'
- import plUpload from "@/components/pl-upload/index"
- import {
- Level
- } from 'chalk';
- export default {
- components: {
- plUpload
- },
- data() {
- var checkTownId = (rule, value, callback) => {
- if (!value) {
- return callback(new Error('请选择乡镇'));
- }
- callback();
- };
- var checkHotelName = (rule, value, callback) => {
- if (!value) {
- return callback(new Error('请输入民宿名称'));
- }
- setTimeout(() => {
- var reg = /^[\s\W\u4e00-\u9fa5]{2,20}$/
- if (!reg.test(value)) {
- callback(new Error('不能包含特殊符号和空白字符,2到20个'));
- } else {
- callback();
- }
- }, 100);
- };
- var checkCorpnName = (rule, value, callback) => {
- if (!value) {
- return callback(new Error('请输入法人姓名'));
- }
- setTimeout(() => {
- var reg = /^[\u4e00-\u9fa5]{2,10}$/
- if (!reg.test(value)) {
- callback(new Error('只能包含2到10个汉字'));
- } else {
- callback();
- }
- }, 100);
- };
- var checkCorpnPhone = (rule, value, callback) => {
- if (!value) {
- return callback(new Error('请输入法人电话'));
- }
- setTimeout(() => {
- var reg = /^(0\d{2,3}-\d{7,8}|1[3456789]\d{9})$/
- if (!reg.test(value)) {
- callback(new Error('请输入手机号或座机'));
- } else {
- callback();
- }
- }, 100);
- };
- var checkAdminName = (rule, value, callback) => {
- if (!value) {
- return callback(new Error('请输入民宿账号'));
- }
- setTimeout(() => {
- var reg = /^[a-zA-Z0-9_]{5,16}$/
- if (!reg.test(value)) {
- callback(new Error('只能包含字母、数字和下划线,长度5到16个之间'));
- } else {
- callback();
- }
- }, 100);
- };
- var checkBankCard = (rule, value, callback) => {
- if (!value) {
- return callback(new Error('请输入银行卡号'));
- }
- setTimeout(() => {
- var reg = /^([1-9]{1})(\d{15,18})$/
- if (!reg.test(value)) {
- callback(new Error('银行卡号长度16-19位数字'));
- } else {
- callback();
- }
- }, 100);
- };
- var checkCardName = (rule, value, callback) => {
- if (!value) {
- return callback(new Error('请输入户主姓名'));
- }
- setTimeout(() => {
- var reg = /^[\u4e00-\u9fa5]{2,8}$/
- if (!reg.test(value)) {
- callback(new Error('只能包含2到8个汉字'));
- } else {
- callback();
- }
- }, 100);
- };
- var checkBankName = (rule, value, callback) => {
- if (!value) {
- return callback(new Error('请输入银行名称'));
- }
- setTimeout(() => {
- var reg = /^[\u4e00-\u9fa5]{4,20}$/
- if (!reg.test(value)) {
- callback(new Error('只能包含4到20个汉字'));
- } else {
- callback();
- }
- }, 100);
- };
- var checkFileUrl = (rule, value, callback) => {
- if (value == '[]' || value == '') {
- return callback(new Error('请上传营业执照'));
- }
- callback();
- };
- var checkJibieId = (rule, value, callback) => {
- if (!value) {
- return callback(new Error('请选择民宿等级'));
- }
- callback();
- };
- var checkLinkproUrl = (rule, value, callback) => {
- if (!value) {
- return callback(new Error('请输入720全景链接'));
- }
- callback();
- };
- var checkHostelCalssName = (rule, value, callback) => {
- if (!value) {
- return callback(new Error('请输入民宿类型'));
- }
- setTimeout(() => {
- var reg = /^[^\s]{2,20}$/
- if (!reg.test(value)) {
- callback(new Error('只能包含2到20个字符长度'));
- } else {
- callback();
- }
- }, 100);
- };
- var checkHostelServiceName = (rule, value, callback) => {
- if (!value) {
- return callback(new Error('请输入民宿服务'));
- }
- setTimeout(() => {
- var reg = /^[^\s]{2,20}$/
- if (!reg.test(value)) {
- callback(new Error('只能包含2到20个字符长度'));
- } else {
- callback();
- }
- }, 100);
- };
- var checkHostelName = (rule, value, callback) => {
- if (!value) {
- return callback(new Error('请输入房型名称'));
- }
- setTimeout(() => {
- var reg = /^[^\s]{2,20}$/
- if (!reg.test(value)) {
- callback(new Error('只能包含2到20个字符长度'));
- } else {
- callback();
- }
- }, 100);
- };
- var checkHouseTypeService = (rule, value, callback) => {
- if (!value) {
- return callback(new Error('请输入房型服务'));
- }
- setTimeout(() => {
- var reg = /^[^\s]{2,20}$/
- if (!reg.test(value)) {
- callback(new Error('只能包含2到20个字符长度'));
- } else {
- callback();
- }
- }, 100);
- };
- var checkIcon = (rule, value, callback) => {
- if (value == '[]' || value == '' || value == undefined) {
- return callback(new Error('请上传图标'));
- }
- callback();
- };
- return {
- currentUserLevel: this.$store.state.user.level, // 当前用户的权限
- activeName: 'first', // 默认激活第一个选项卡
- dialogResidentialHostelConfigurationVisible: false, // 民宿配置对话框显示和隐藏变量
- dialogAddHostelFormVisible: false, // 添加民宿对话框显示和隐藏变量
- dialogModifyHostelFormVisible: false, // 修改对话框的显示和隐藏变量
- dialogConfirmVisible: false, // 对话框的显示和隐藏变量
- dialogAddDictionaryFormVisible: false, // 添加民宿字典对话框显示和隐藏变量
- dialogAddDictionaryServiceFormVisible: false,
- dialogAddDictionaryNameFormVisible: false,
- dialogAddDictionaryHouseServiceFormVisible: false,
- dialogModifyDictionaryFormVisible: false,
- dialogModifyDictionaryServiceFormVisible: false,
- dialogModifyDictionaryNameFormVisible: false,
- dialogModifyDictionaryHouseServiceFormVisible: false,
- formLabelWidth: '120px',
- // 表格单元格样式
- cell_style: {
- color: '#1A202B',
- 'font-size': '14px',
- 'font-family': 'Microsoft YaHei-3970(82674968)'
- },
- // 表格头部样式
- header_cell_style: {
- background: '#E6ECFE',
- color: '#1A202B',
- 'font-size': '16px',
- 'font-family': 'Microsoft YaHei-3970(82674968)'
- },
- // 查询数据
- formInline: {
- options: [],
- id: '',
- adminName: ''
- },
- // 删除、冻结、解冻民宿
- delete_frozen_thaw_Data: {
- prompt_message: '',
- id: '',
- action: ''
- },
- tableData: [],
- // 民宿类别
- tableData_hostel_class: [],
- // 民宿服务
- tableData_hostel_service: [],
- // 房型名称
- tableData_house_name: [],
- // 房型服务
- tableData_house_service: [],
- cond_data: {},
- // 分页参数
- pagination: {
- currentPage: 1,
- pageSize: 9,
- total: 0
- },
- loading: true,
- formAddHostel: {
- options: [],
- id: '',
- hotelTownship: '',
- hotelName: '',
- corpnName: '',
- corpnPhone: '',
- adminName: '',
- bankCard: '',
- cardName: '',
- bankName: '',
- jibie: [{
- id: 1,
- jibieName: '银宿级'
- },
- {
- id: 2,
- jibieName: '金宿级'
- },
- {
- id: 3,
- jibieName: '白金级'
- },
- ], //民宿级别
- jibieId: '',
- fileUrl: '', // 图片上传列表
- url: '', // 上传的图片列表
- linkproUrl: '', //720全景链接
- level: this.$store.state.user.level
- },
- addHostelFormRules: {
- hotelName: [{
- validator: checkHotelName
- }],
- corpnName: [{
- validator: checkCorpnName
- }],
- corpnPhone: [{
- validator: checkCorpnPhone
- }],
- id: [{
- validator: checkTownId
- }],
- adminName: [{
- validator: checkAdminName
- }],
- bankCard: [{
- validator: checkBankCard
- }],
- cardName: [{
- validator: checkCardName
- }],
- bankName: [{
- validator: checkBankName
- }],
- fileUrl: [{
- validator: checkFileUrl
- }],
- jibieId: [{
- validator: checkJibieId
- }],
- linkproUrl: [{
- validator: checkLinkproUrl
- }],
- },
- formModifyHostel: {
- options: [],
- id: '',
- hotelTownship: '',
- hotelTownshipName: '',
- hotelName: '',
- corpnName: '',
- corpnPhone: '',
- adminName: '',
- bankCard: '',
- cardName: '',
- bankName: '',
- jibie: [{
- id: 1,
- jibieName: '银宿级'
- },
- {
- id: 2,
- jibieName: '金宿级'
- },
- {
- id: 3,
- jibieName: '白金级'
- },
- ], //民宿级别
- type: '',
- fileUrl: '', // 图片上传列表
- url: '', // 上传的图片列表
- linkProUrl: '', //720全景链接
- level: this.$store.state.user.level
- },
- modifyHostelFormRules: {
- hotelName: [{
- validator: checkHotelName
- }],
- corpnName: [{
- validator: checkCorpnName
- }],
- corpnPhone: [{
- validator: checkCorpnPhone
- }],
- id: [{
- validator: checkTownId
- }],
- adminName: [{
- validator: checkAdminName
- }],
- bankCard: [{
- validator: checkBankCard
- }],
- cardName: [{
- validator: checkCardName
- }],
- bankName: [{
- validator: checkBankName
- }],
- fileUrl: [{
- validator: checkFileUrl
- }],
- type: [{
- validator: checkJibieId
- }],
- linkProUrl: [{
- validator: checkLinkproUrl
- }],
- },
- // 修改字典数据
- modify_dictionary_data: {
- id: 0,
- code: 0,
- name: '',
- fileUrl: '', // 图片上传列表
- url: ''
- },
- // 增加字典数据
- add_dictionary_data: {
- code: 0,
- name: '',
- fileUrl: '', // 图片上传列表
- url: ''
- },
- // 删除字典数据
- del_dictionary_data: {
- id: ''
- },
- times: '',
- addHostelClassFormRules: {
- name: [{
- validator: checkHostelCalssName
- }]
- },
- addHostelServiceFormRules: {
- name: [{
- validator: checkHostelServiceName
- }],
- fileUrl: [{
- validator: checkIcon
- }]
- },
- addHostelNameFormRules: {
- name: [{
- validator: checkHostelName
- }]
- },
- addHouseTypeServiceFormRules: {
- name: [{
- validator: checkHouseTypeService
- }],
- fileUrl: [{
- validator: checkIcon
- }]
- },
- modifyHostelClassFormRules: {
- name: [{
- validator: checkHostelCalssName
- }]
- },
- modifyHostelServiceFormRules: {
- name: [{
- validator: checkHostelServiceName
- }],
- fileUrl: [{
- validator: checkIcon
- }]
- },
- modifyHostelNameFormRules: {
- name: [{
- validator: checkHostelName
- }]
- },
- modifyHouseTypeServiceFormRules: {
- name: [{
- validator: checkHouseTypeService
- }],
- fileUrl: [{
- validator: checkIcon
- }]
- },
- otherConfig: [{
- miniteOptions: [{
- value: '1',
- label: '1分钟'
- }, {
- value: '2',
- label: '2分钟'
- }, {
- value: '3',
- label: '3分钟'
- }, {
- value: '4',
- label: '4分钟'
- }, {
- value: '5',
- label: '5分钟'
- }],
- miniteValue: '',
- id: ''
- }, {
- options: [{
- value: '1',
- label: '接单'
- }, {
- value: '2',
- label: '拒单'
- }],
- value: '',
- id: ''
- }, {
- monthOptions: [{
- value: '1',
- label: '1个月'
- }, {
- value: '2',
- label: '2个月'
- }, {
- value: '3',
- label: '3个月'
- }, {
- value: '4',
- label: '4个月'
- }, {
- value: '5',
- label: '5个月'
- }, {
- value: '6',
- label: '6个月'
- }],
- monthValue: '',
- id: ''
- }]
- }
- },
- created() {
- // 检测权限
- if (this.currentUserLevel !== 2) {
- this.$router.replace({
- path: '/data'
- })
- return
- }
- // 获取消费记录,表格数据
- this.get_table_data('list')
- // 获取乡镇
- this.get_towns()
- // 民宿字典列表
- this.getHostelListByCode(1234)
-
- this.getOtherConfig()
- },
- mounted() {
- // 修改分页栏文字
- document.getElementsByClassName("el-pagination__jump")[0].childNodes[0].nodeValue = "跳至";
- },
- methods: {
- handlerOtherConfig() {
- modifyOtherConfig(this.otherConfig).then((res) => {
- // console.log(res);
- if (typeof res.code == 'undefined' || res.code == '') {
- this.$message.error('返回数据格式问题,code未获取到!');
- return;
- }
- if (res.code === 200) {
- this.$message.success(res.message);
- this.dialogResidentialHostelConfigurationVisible = false;
- } else {
- this.$message.error(res.message);
- }
- }).catch((err) => {
- // console.log(err);
- this.$message.error(err.message);
- })
- },
- // 获取民宿其他配置
- getOtherConfig() {
- otherConfig().then((res) => {
- // console.log(res);
- if (typeof res.code == 'undefined' || res.code == '') {
- this.$message.error('返回数据格式问题,code未获取到!');
- return;
- }
- if (res.code === 200) {
- if (typeof res.date !== 'undefined') {
- var data = res.date;
- for (var i = 0; i < data.length; i++) {
- if (data[i].description.includes('多少分钟')) {
- this.otherConfig[0].miniteValue = data[i].code;
- this.otherConfig[0].id = data[i].id;
- } else if (data[i].description.includes('拒单')) {
- this.otherConfig[1].value = data[i].code;
- this.otherConfig[1].id = data[i].id;
- } else {
- this.otherConfig[2].monthValue = data[i].code;
- this.otherConfig[2].id = data[i].id;
- }
- }
- }
- } else {
- this.$message.error(res.message);
- }
- }).catch((err) => {
- // console.log(err);
- this.$message.error(err.message);
- })
- },
- /**
- * 民宿类型
- */
- get_listHomestayDictionary_1() {
- // 1.民宿类型
- listHomestayDictionary(1).then((res) => {
- // console.log(res);
- if (typeof res.code == 'undefined' || res.code == '') {
- this.$message.error('返回数据格式问题,code未获取到!');
- return;
- }
- if (res.code === 200) {
- if (typeof res.data !== 'undefined') {
- this.tableData_hostel_class = []
- for (var i = 0; i < res.data.length; i++) {
- this.tableData_hostel_class.push({
- id: res.data[i].id,
- code: res.data[i].code,
- name: res.data[i].name
- })
- }
- }
- } else {
- this.$message.error(res.message);
- }
- }).catch((err) => {
- // console.log(err);
- this.$message.error(err.message);
- })
- },
- /**
- * 民宿服务
- */
- get_listHomestayDictionary_2() {
- // 2.民宿服务
- listHomestayDictionary(2).then((res) => {
- // console.log(res);
- if (typeof res.code == 'undefined' || res.code == '') {
- this.$message.error('返回数据格式问题,code未获取到!');
- return;
- }
- if (res.code === 200) {
- if (typeof res.data !== 'undefined') {
- this.tableData_hostel_service = []
- for (var i = 0; i < res.data.length; i++) {
- this.tableData_hostel_service.push({
- id: res.data[i].id,
- code: res.data[i].code,
- name: res.data[i].name,
- fileUrl: res.data[i].fileUrl
- })
- }
- }
- } else {
- this.$message.error(res.message);
- }
- }).catch((err) => {
- // console.log(err);
- this.$message.error(err.message);
- })
- },
- /**
- * 房型名称
- */
- get_listHomestayDictionary_3() {
- // 3.房型名称
- listHomestayDictionary(3).then((res) => {
- // console.log(res);
- if (typeof res.code == 'undefined' || res.code == '') {
- this.$message.error('返回数据格式问题,code未获取到!');
- return;
- }
- if (res.code === 200) {
- if (typeof res.data !== 'undefined') {
- this.tableData_house_name = []
- for (var i = 0; i < res.data.length; i++) {
- this.tableData_house_name.push({
- id: res.data[i].id,
- code: res.data[i].code,
- name: res.data[i].name
- });
- }
- }
- } else {
- this.$message.error(res.message);
- }
- }).catch((err) => {
- // console.log(err);
- this.$message.error(err.message);
- })
- },
- get_listHomestayDictionary_4() {
- // 4.房型服务
- listHomestayDictionary(4).then((res) => {
- // console.log(res);
- if (typeof res.code == 'undefined' || res.code == '') {
- this.$message.error('返回数据格式问题,code未获取到!');
- return;
- }
- if (res.code === 200) {
- if (typeof res.data !== 'undefined') {
- this.tableData_house_service = []
- for (var i = 0; i < res.data.length; i++) {
- this.tableData_house_service.push({
- id: res.data[i].id,
- code: res.data[i].code,
- name: res.data[i].name,
- fileUrl: res.data[i].fileUrl
- });
- }
- }
- } else {
- this.$message.error(res.message);
- }
- }).catch((err) => {
- // console.log(err);
- this.$message.error(err.message);
- })
- },
- /**
- * 民宿字典列表
- */
- getHostelListByCode(param) {
- if (param === 1234) {
- this.get_listHomestayDictionary_1()
- this.get_listHomestayDictionary_2()
- this.get_listHomestayDictionary_3()
- this.get_listHomestayDictionary_4()
- } else if (param === 1) {
- this.get_listHomestayDictionary_1()
- } else if (param === 2) {
- this.get_listHomestayDictionary_2()
- } else if (param === 3) {
- this.get_listHomestayDictionary_3()
- } else if (param === 4) {
- this.get_listHomestayDictionary_4()
- }
- },
- // 获取民宿id
- getHotelId(e) {
- this.formAddHostel.id = e
- },
- // tab切换获取code
- tabHandleClick(tab, event) {
- // console.log(tab.index, tab.name, event);
- },
- /**
- * 显示民宿添加对话框
- */
- add_house_dialog() {
- this.dialogAddHostelFormVisible = true;
- this.times = new Date().getTime().toString()
- },
- /**
- * 打开民宿配置对话框
- */
- hostelConfiguration() {
- this.dialogResidentialHostelConfigurationVisible = true
- },
- // 添加民宿字典,先显示对话框
- add_dictionary_dialog(i) {
- this.clear_add_dictionary_data()
- if (i === 1) {
- this.dialogAddDictionaryFormVisible = true
- } else if (i === 2) {
- this.dialogAddDictionaryServiceFormVisible = true
- } else if (i === 3) {
- this.dialogAddDictionaryNameFormVisible = true
- } else if (i === 4) {
- this.dialogAddDictionaryHouseServiceFormVisible = true
- }
- this.times = new Date().getTime().toString()
- this.add_dictionary_data.code = i;
- },
- // 显示民宿类型修改对话框
- show_modify_dictionary_dialog(index, row, i) {
- // console.log(index, row, i);
- this.modify_dictionary_data.id = row.id
- this.modify_dictionary_data.code = row.code
- this.modify_dictionary_data.name = row.name
- if (typeof row.fileUrl !== 'undefined') {
- this.modify_dictionary_data.url = row.fileUrl
- }
- if (i === 1) {
- this.dialogModifyDictionaryFormVisible = true
- } else if (i === 2) {
- this.dialogModifyDictionaryServiceFormVisible = true
- } else if (i === 3) {
- this.dialogModifyDictionaryNameFormVisible = true
- } else if (i === 4) {
- this.dialogModifyDictionaryHouseServiceFormVisible = true
- }
- },
- /**
- * 修改民宿字典
- * @param {Object} index
- * @param {Object} row
- */
- modify_house_class_dialog_handler(i) {
- var that = this;
- if (i === 1) {
- that.$refs["modifyHostelClassForm"].validate(validate => {
- if (validate) {
- this.modifyHomestayDictionary_shared(i)
- } else {
- that.$message.error('请按规范填写');
- return false;
- }
- })
- } else if (i === 2) {
- that.$refs["modifyHostelServiceForm"].validate(validate => {
- if (validate) {
- this.modifyHomestayDictionary_shared(i)
- } else {
- that.$message.error('请按规范填写');
- return false;
- }
- })
- } else if (i === 3) {
- that.$refs["modifyHostelNameForm"].validate(validate => {
- if (validate) {
- this.modifyHomestayDictionary_shared(i)
- } else {
- that.$message.error('请按规范填写');
- return false;
- }
- })
- } else if (i === 4) {
- that.$refs["modifyHouseTypeServiceForm"].validate(validate => {
- if (validate) {
- this.modifyHomestayDictionary_shared(i)
- } else {
- that.$message.error('请按规范填写');
- return false;
- }
- })
- }
- },
- /**
- * 修改民宿字典共享函数
- * @param {Object} i
- */
- modifyHomestayDictionary_shared(i) {
- var that = this;
- modifyHomestayDictionary(this.modify_dictionary_data).then((res) => {
- // console.log(res);
- if (typeof res.code == 'undefined' || res.code == '') {
- that.$message.error('返回数据格式问题,code未获取到!');
- return;
- }
- if (res.code === 200) {
- // 重新读取,刷新表格显示
- that.getHostelListByCode(i)
- if (i === 1) {
- that.dialogModifyDictionaryFormVisible = false
- } else if (i === 2) {
- that.dialogModifyDictionaryServiceFormVisible = false
- } else if (i === 3) {
- that.dialogModifyDictionaryNameFormVisible = false
- } else if (i === 4) {
- that.dialogModifyDictionaryHouseServiceFormVisible = false
- }
- that.$message.success(res.message);
- } else {
- that.$message.error(res.message);
- }
- }).catch((err) => {
- // console.log(err);
- that.$message.error(err.message);
- })
- },
- /**
- * 删除民宿字典
- * @param {Object} index
- * @param {Object} row
- */
- delete_dictionary_dialog(index, row) {
- // console.log(index, row);
- this.del_dictionary_data.id = row.id
- this.delete_frozen_thaw_Data.prompt_message = `确定删除【${row.name}】吗?`
- this.delete_frozen_thaw_Data.action = 'delDic'
- this.dialogConfirmVisible = true
- },
- /**
- * 修改民宿
- */
- modify_house_dialog(index, row) {
- console.log(index, row);
- var t = parseInt(row.hotelTownship);
- this.formModifyHostel.id = row.id;
- if (typeof t === 'number' && isNaN(t)) {
- this.formModifyHostel.hotelTownship = "";
- } else {
- this.formModifyHostel.hotelTownship = t;
- }
- this.formModifyHostel.hotelName = row.hotelName;
- this.formModifyHostel.corpnName = row.corpnName;
- this.formModifyHostel.corpnPhone = row.corpnPhone;
- this.formModifyHostel.adminName = row.adminName;
- this.formModifyHostel.bankCard = row.bankCard;
- this.formModifyHostel.cardName = row.cardName;
- this.formModifyHostel.bankName = row.bankName;
- this.formModifyHostel.type = row.type;
- this.formModifyHostel.linkProUrl = row.linkProUrl;
- // this.formModifyHostel.fileUrl = row.bankName;
- this.dialogModifyHostelFormVisible = true;
- // console.log(this.formModifyHostel.fileUrl);
- // console.log(this.formModifyHostel.url);
- },
- /**
- * 关闭添加对话框
- */
- add_house_dialog_close() {
- // 关闭添加对话框
- this.dialogAddHostelFormVisible = false;
- },
- /**
- * 关闭民宿配置
- */
- residential_hostel_configuration_dialog_close() {
- this.dialogResidentialHostelConfigurationVisible = false
- },
- /**
- * 添加民宿类型
- */
- add_house_class_dialog_handler(i) {
- var that = this;
- if (i === 1) {
- that.$refs["addHostelClassForm"].validate(validate => {
- if (validate) {
- that.addHostel_shared(i)
- } else {
- that.$message.error('请按规范填写');
- return false;
- }
- })
- } else if (i === 2) {
- that.$refs["addHostelServiceForm"].validate(validate => {
- if (validate) {
- that.addHostel_shared(i)
- } else {
- that.$message.error('请按规范填写');
- return false;
- }
- })
- } else if (i === 3) {
- that.$refs["addHostelNameForm"].validate(validate => {
- if (validate) {
- that.addHostel_shared(i)
- } else {
- that.$message.error('请按规范填写');
- return false;
- }
- })
- } else if (i === 4) {
- that.$refs["addHouseTypeServiceForm"].validate(validate => {
- if (validate) {
- that.addHostel_shared(i)
- } else {
- that.$message.error('请按规范填写');
- return false;
- }
- })
- }
- },
- /**
- *
- * @param {Object} i
- */
- addHostel_shared(i) {
- addHomestayDictionary(this.add_dictionary_data).then((res) => {
- // console.log(res);
- if (typeof res.code == 'undefined' || res.code == '') {
- this.$message.error('返回数据格式问题,code未获取到!');
- return;
- }
- if (res.code === 200) {
- // 重新读取,刷新表格显示
- this.getHostelListByCode(i);
- if (i === 1) {
- this.dialogAddDictionaryFormVisible = false;
- } else if (i === 2) {
- this.dialogAddDictionaryServiceFormVisible = false
- } else if (i === 3) {
- this.dialogAddDictionaryNameFormVisible = false
- } else if (i === 4) {
- this.dialogAddDictionaryHouseServiceFormVisible = false
- }
- this.clear_add_dictionary_data()
- this.$message.success(res.message);
- } else {
- this.$message.error(res.message);
- }
- }).catch((err) => {
- // console.log(err);
- this.$message.error(err.message);
- })
- },
- // 初始化字典数据
- clear_add_dictionary_data() {
- this.add_dictionary_data = {
- code: 0,
- name: '',
- fileUrl: '', // 图片上传列表
- url: ''
- }
- },
- /**
- * 添加民宿操作
- */
- add_house_dialog_handler() {
- // 调用添加接口
- this.$refs["addHostelForm"].validate(validate => {
- if (validate) {
- addHostel(this.formAddHostel).then((res) => {
- // console.log(res);
- if (typeof res.code == 'undefined' || res.code == '') {
- this.$message.error('返回数据格式问题,code未获取到!');
- return;
- }
- if (res.code === 200) {
- // 重新读取,刷新表格显示
- this.get_table_data('list');
- this.clear_data()
- this.dialogAddHostelFormVisible = false;
- this.$message.success(res.message);
- } else {
- this.$message.error(res.message);
- }
- }).catch((err) => {
- // console.log(err);
- this.$message.error(err.message);
- })
- } else {
- this.$message.error('请按规范填写');
- return false;
- }
- })
- },
- clear_data() {
- this.formAddHostel.id = ''
- this.formAddHostel.hotelTownship = ''
- this.formAddHostel.hotelName = ''
- this.formAddHostel.corpnName = ''
- this.formAddHostel.corpnPhone = ''
- this.formAddHostel.adminName = ''
- this.formAddHostel.bankCard = ''
- this.formAddHostel.cardName = ''
- this.formAddHostel.bankName = ''
- this.formAddHostel.fileUrl = '' // 图片上传列表
- this.formAddHostel.url = '' // 上传的图片列表
- this.formAddHostel.level = this.currentUserLevel
- },
- /**
- * 修改民宿
- */
- modify_house_dialog_handler() {
- // console.log(this.formModifyHostel);
- // 调用修改接口
- this.$refs["modifyHostelForm"].validate(validate => {
- if (validate) {
- modifyHostel(this.formModifyHostel).then((res) => {
- // console.log(res);
- if (typeof res.code == 'undefined' || res.code == '') {
- this.$message.error('返回数据格式问题,code未获取到!');
- return;
- }
- if (res.code === 200) {
- // 重新读取,刷新表格显示
- this.get_table_data('list');
- this.clear_modify_data()
- this.dialogModifyHostelFormVisible = false;
- this.$message.success(res.message);
- } else {
- this.$message.error(res.message);
- }
- }).catch((err) => {
- // console.log(err);
- this.$message.error(err.message);
- })
- } else {
- this.$message.error('请按规范填写');
- return false;
- }
- })
- },
- clear_modify_data() {
- this.formAddHostel.id = ''
- this.formAddHostel.hotelTownship = ''
- this.formAddHostel.hotelName = ''
- this.formAddHostel.hotelTownshipName = ''
- this.formAddHostel.corpnName = ''
- this.formAddHostel.corpnPhone = ''
- this.formAddHostel.adminName = ''
- this.formAddHostel.bankCard = ''
- this.formAddHostel.cardName = ''
- this.formAddHostel.bankName = ''
- this.formAddHostel.fileUrl = '' // 图片上传列表
- this.formAddHostel.url = '' // 上传的图片列表
- },
- /**
- * 重置密码
- */
- reset_hostel_dialog_handler() {
- resetHostelAccountPassword(this.resetHostelData.id).then((res) => {
- // console.log(res);
- if (typeof res.code == 'undefined' || res.code == '') {
- this.$message.error('返回数据格式问题,code未获取到!');
- return;
- }
- if (res.code === 200) {
- // 重新读取,刷新表格显示
- this.get_table_data('list');
- this.dialogResetHostelVisible = false;
- this.$message.success(res.message);
- } else {
- this.$message.error(res.message);
- }
- }).catch((err) => {
- // console.log(err);
- this.$message.error(err.message);
- })
- },
- /**
- * 关闭修改对话框
- */
- modify_house_dialog_close() {
- // 关闭修改对话框
- this.dialogModifyHostelFormVisible = false;
- },
- /**
- * 删除、冻结、解冻、重置密码民宿对话框
- */
- show_confirm_dialog(index, row, param) {
- // console.log(index, row);
- // 需要删除的数据关键字,赋值准备删除
- this.delete_frozen_thaw_Data.id = row.id;
- if (param === 'reset') {
- this.delete_frozen_thaw_Data.prompt_message = '是否确定重置账号【' + row.adminName + '】?';
- } else if (param === 'frozen') {
- this.delete_frozen_thaw_Data.prompt_message = '是否确定冻结账号【' + row.adminName + '】?';
- } else if (param === 'thaw') {
- this.delete_frozen_thaw_Data.prompt_message = '是否确定解冻账号【' + row.adminName + '】?';
- } else if (param === 'delete') {
- this.delete_frozen_thaw_Data.prompt_message = '是否确定删除账号【' + row.adminName + '】?';
- } else {
- this.delete_frozen_thaw_Data.prompt_message = '未知错误操作!';
- }
- this.delete_frozen_thaw_Data.action = param
- // 显示删除对话框
- this.dialogConfirmVisible = true;
- },
- // 删除、冻结、解冻、重置密码操作共用体
- share_function(res, param) {
- // console.log(res, param);
- if (typeof res.code == 'undefined' || res.code == '') {
- this.$message.error('返回数据格式问题,code未获取到!');
- return;
- }
- if (res.code === 200) {
- // 重新读取,刷新表格显示
- if (param === 'ms') {
- this.get_table_data('list');
- } else {
- this.getHostelListByCode(1234)
- }
- this.dialogConfirmVisible = false;
- this.$message.success(res.message);
- } else {
- this.$message.error(res.message);
- }
- },
- /**
- * 删除、冻结、解冻、重置密码操作
- */
- delete_frozen_thaw_dialog_handler() {
- var that = this;
- if (this.delete_frozen_thaw_Data.action === 'reset') {
- // 调用解冻接口
- resetHostelAccountPassword(this.delete_frozen_thaw_Data.id).then((res) => {
- that.share_function(res, 'ms')
- }).catch((err) => {
- // console.log(err);
- this.$message.error(err.message);
- })
- } else if (this.delete_frozen_thaw_Data.action === 'frozen') {
- // 调用冻结接口
- frozenHostelAccount(this.delete_frozen_thaw_Data.id).then((res) => {
- that.share_function(res, 'ms')
- }).catch((err) => {
- // console.log(err);
- this.$message.error(err.message);
- })
- } else if (this.delete_frozen_thaw_Data.action === 'thaw') {
- // 调用解冻接口
- thawHostelAccount(this.delete_frozen_thaw_Data.id).then((res) => {
- that.share_function(res, 'ms')
- }).catch((err) => {
- // console.log(err);
- this.$message.error(err.message);
- })
- } else if (this.delete_frozen_thaw_Data.action === 'delete') {
- // 调用删除接口
- delHostelAccount(this.delete_frozen_thaw_Data.id).then((res) => {
- that.share_function(res, 'ms')
- }).catch((err) => {
- // console.log(err);
- this.$message.error(err.message);
- })
- } else if (this.delete_frozen_thaw_Data.action === 'delDic') {
- // 民宿字典
- delHomestayDictionary(this.del_dictionary_data.id).then((res) => {
- that.share_function(res, 'dic')
- }).catch((err) => {
- // console.log(err);
- this.$message.error(err.message);
- })
- } else {
- this.$message.error('未知操作!');
- }
- },
- // 获取乡镇列表
- get_towns() {
- getTowns().then((res) => {
- if (res.code === 200) {
- this.formInline.options = []
- this.formAddHostel.options = []
- this.formModifyHostel.options = []
- for (var i = 0; i < res.data.length; i++) {
- let town = {
- id: res.data[i].id,
- hotelTownship: res.data[i].name
- }
- this.formInline.options.push(town)
- this.formAddHostel.options.push(town)
- this.formModifyHostel.options.push(town)
- }
- } else {
- if (res.data.length === 0) {
- this.formInline.options = []
- this.$message.warning('没有符合条件的数据!')
- } else {
- this.$message.warning(res.message)
- }
- }
- }).catch((err) => {
- // console.log(err);
- this.$message.error(err.message)
- });
- },
- /**
- * 获取消费记录,表格数据
- */
- get_table_data(param) {
- this.loading = true
- this.get_condtion();
- let data = this.cond_data;
- if (param == 'search') {
- data.page = 1
- this.pagination.currentPage = 1
- }
- // console.log(data);
- getTableData(data).then((res) => {
- // console.log(res);
- let tempData = res.data.pageList;
- if (typeof tempData !== 'undefined' && tempData !== '') {
- this.pagination.total = res.data.total
- this.tableData = []
- for (var i = 0; i < tempData.length; i++) {
- tempData[i].xuhao = (this.pagination.currentPage - 1) * this.pagination.pageSize + i + 1
- this.tableData.push(tempData[i])
- }
- } else {
- this.tableData = []
- this.$message.warning('没有符合条件的数据!')
- }
- }).catch((err) => {
- // console.log(err);
- this.$message.error(err.message)
- });
- this.loading = false;
- },
- /**
- * 条件
- */
- get_condtion() {
- let data = {
- page: this.pagination.currentPage,
- rows: this.pagination.pageSize,
- level: this.currentUserLevel
- }
- if (this.formInline.id !== '') {
- data.hotelTownship = this.formInline.id // 对应id
- }
- if (this.formInline.adminName !== '') {
- data.adminName = this.formInline.adminName
- }
- this.cond_data = data;
- },
- /**
- * 搜索
- */
- btn_search() {
- this.get_table_data('search')
- },
- /**
- * currentPage 改变时会触发
- * @param {Object} val
- */
- currentPageChange(val) {
- this.pagination.currentPage = val
- this.get_table_data('pages')
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .app-container {
- background-color: #EFF2F7;
- padding: 10px;
- .el-row {
- .el-col {
- padding: 10px;
- .cell {
- padding: 30px;
- border-radius: 10px;
- background-color: #FFFFFF;
- // box-shadow: 5px 5px 15px #979797;
- box-shadow: 0px 3px 21px 0px rgba(60, 108, 254, 0.16);
- .cell-title {
- display: flex;
- justify-content: space-between;
- align-items: center;
- margin-bottom: 30px;
- padding-bottom: 30px;
- border-bottom: 1px solid #CCCCCC;
- .title-left {
- display: flex;
- align-items: center;
- .title {
- font-size: 22px;
- font-family: Microsoft YaHei-3970(82674968);
- font-weight: bold;
- color: #1A202B;
- }
- .title-detail {
- margin-left: 50px;
- font-size: 18px;
- font-family: Microsoft YaHei-3970(82674968);
- color: #1A202B;
- }
- }
- .title-right {
- display: flex;
- justify-content: space-between;
- align-items: center;
- .el-button {
- width: 110px;
- height: 46px;
- background: #2B4CFE;
- font-size: 18px;
- color: #FFFFFF;
- font-family: Microsoft YaHei-3970(82674968);
- border-radius: 5px;
- }
- .el-button--warning {
- background: #F88A64;
- }
- }
- }
- .cell-body {
- .controls {
- display: flex;
- justify-content: space-between;
- align-items: center;
- .demo-form-inline {
- display: inline-flex;
- flex-wrap: wrap;
- align-items: center;
- justify-content: flex-start;
- .btn-search {
- background: rgba(9, 101, 98, 1);
- font-size: 14px;
- color: #FFFFFF;
- font-family: Microsoft YaHei-3970(82674968);
- border-radius: 5px;
- border: none;
- }
- }
- .right-btns {
- width: 220px;
- display: flex;
- justify-content: flex-start;
- .export {
- background: rgba(9, 101, 98, 1);
- font-size: 14px;
- color: #FFFFFF;
- font-family: Microsoft YaHei-3970(82674968);
- border-radius: 5px;
- margin-bottom: 22px;
- border: none;
- }
- }
- }
- .pagination-table {
- display: flex;
- justify-content: space-between;
- align-items: center;
- height: 30px;
- margin-top: 20px;
- padding-right: 100px;
- .txt-notice {
- color: rgba(212, 48, 48, 1);
- }
- ::v-deep .el-pagination {
- display: flex;
- justify-content: flex-end;
- align-items: center;
- }
- ::v-deep .el-pagination ul {
- display: flex;
- }
- ::v-deep .el-pagination button,
- ::v-deep .el-pagination li {
- display: flex;
- justify-content: center;
- align-items: center;
- width: 50px;
- height: 36px;
- border: 1px solid #626262;
- border-radius: 3px;
- font-size: 14px;
- margin: 0 5px;
- }
- ::v-deep .el-pagination span {
- margin-left: 10px;
- }
- ::v-deep .el-pagination .el-pagination__jump {
- font-size: 16px;
- }
- ::v-deep .el-pagination .el-pagination__editor {
- width: 50px;
- height: 36px;
- margin: 0 5px;
- }
- ::v-deep .el-pagination .el-input__inner {
- width: 50px;
- height: 36px;
- border: 1px solid #626262;
- margin: -4px 0 0 0;
- }
- }
- }
- .action-btns {
- display: flex;
- justify-content: space-around;
- .bg-btn {
- color: rgba(9, 101, 98, 1);
- }
- }
- }
- }
- }
- ::v-deep .hide .el-upload--picture-card {
- display: none;
- }
- ::v-deep .el-dialog {
- margin: 0 !important;
- width: 400px;
- height: 460px;
- background: #FFFFFF;
- box-shadow: 0px 0px 13px 0px rgba(0, 0, 0, 0.29);
- border-radius: 6px;
- position: absolute;
- top: 50%;
- left: 50%;
- transform: translate(-50%, -50%);
- .el-dialog__header {
- display: flex;
- align-items: center;
- width: 100%;
- height: 58px;
- padding: 30px;
- // background: #E6EBFE;
- border-radius: 6px 6px 0px 0px;
- font-weight: bold;
- border-bottom: 1px solid rgba(230, 230, 230, 1);
- }
- .el-dialog__body {
- padding-bottom: 0;
- .el-form-item__label,
- .el-form-item__content {
- font-size: 16px;
- font-family: Microsoft YaHei-3970(82674968);
- color: #53575A;
- }
- .el-input__inner {
- width: 280px;
- }
- }
- // 删除对话框的样式
- .del-account-body {
- display: flex;
- flex-direction: column;
- justify-content: center;
- align-items: center;
- height: 180px;
- img {
- width: 72px;
- }
- .del-account-body-txt {
- height: 58px;
- line-height: 58px;
- font-size: 18px;
- font-family: Microsoft YaHei-3970(82674968);
- color: #333333;
- }
- }
- .el-dialog__footer {
- padding-bottom: 0 !important;
- text-align: center;
- .el-button.el-button--default {
- width: 75px;
- height: 40px;
- border: 1px solid #2B4CFE;
- border-radius: 6px;
- font-size: 16px;
- font-family: Microsoft YaHei-3970(82674968);
- color: #2B4CFE;
- }
- .el-button.el-button--primary {
- width: 75px;
- height: 40px;
- background: #2B4CFE;
- border-radius: 6px;
- font-size: 16px;
- font-family: Microsoft YaHei-3970(82674968);
- color: #FFFFFF;
- margin-left: 60px;
- }
- }
- }
- }
- </style>
- <style>
- .add-house-class,
- .modify-house-class {
- width: 998px !important;
- height: 860px !important;
- }
- .configuration-window {
- width: 580px !important;
- height: 620px !important;
- }
- .el-dialog-delete-house {
- height: 300px !important;
- width: 500px !important;
- }
- .el-dialog-delete-house .el-dialog__header {
- display: none !important;
- }
- .add-info-cancel-btn {
- color: rgba(9, 101, 98, 1) !important;
- border: 1px solid rgba(9, 101, 98, 1) !important;
- }
- .add-info-confirm-btn {
- border: none !important;
- background: rgba(9, 101, 98, 1) !important;
- color: #fff !important;
- border-radius: 5px !important;
- margin-left: 28px !important;
- }
- .configure-btn-position {
- display: flex;
- justify-content: flex-end;
- }
- .configure-btn {
- border: none !important;
- background: rgba(9, 101, 98, 1) !important;
- color: #fff !important;
- border-radius: 5px !important;
- }
- .el-tabs__item.is-top {
- color: rgba(9, 101, 98, 1) !important;
- }
- .el-tabs__active-bar {
- background-color: rgba(9, 101, 98, 1) !important;
- }
- .dialog-footer {
- display: flex;
- justify-content: flex-end;
- }
- .demo-table-expand {
- font-size: 0;
- }
- .demo-table-expand label {
- width: 108px;
- text-align: right !important;
- color: #99a9bf;
- }
- .demo-table-expand .el-form-item {
- margin-right: 0;
- margin-bottom: 0;
- width: 33%;
- }
- .add-ms-class {
- width: 400px !important;
- height: 280px !important;
- }
- .add-ms-class .el-input__inner {
- width: 220px !important;
- }
- .add-ms-service {
- width: 400px !important;
- height: 480px !important;
- }
- .add-ms-service .el-input__inner {
- width: 220px !important;
- }
- .custom-select {
- margin: 0 3px !important;
- }
- .custom-select .el-input,
- .custom-select .el-input__inner {
- /* 修改输入框宽度和高度 */
- width: 88px !important;
- height: 30px !important;
- }
- .custom-select .el-input__icon {
- line-height: 30px !important;
- width: 18px !important;
- }
- .custom-select .el-select-dropdown {
- /* 修改下拉菜单宽度和最大高度 */
- width: 90px !important;
- max-height: 60px !important;
- }
- .custom-select .el-option {
- /* 修改选项高度和行高 */
- height: 40px !important;
- line-height: 40px !important;
- }
- </style>
|