| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833 |
- <template>
- <div>
- <el-tabs v-model="activeName" @tab-click="handleClick">
- <el-tab-pane label="平台优惠券" name="seventh">
- <div style="display: flex;justify-content: space-between;">
- <div>
- <span>优惠券状态:</span>
- <el-select
- :clearable="true"
- @change="refreshShop"
- v-model="selectState"
- placeholder="请选择状态"
- >
- <el-option label="待审核" :value="0"></el-option>
- <el-option label="已发布" :value="1"></el-option>
- <el-option label="已撤销" :value="2"></el-option>
- </el-select>
- </div>
- <div>
- <el-button
- size="mini"
- type="primary"
- icon="document"
- @click="refresh"
- >刷新</el-button
- >
- <el-button
- style="margin:0 0 20px 10px;"
- :disabled="!isAuth('coupon:add')"
- size="mini"
- type="primary"
- icon="document"
- @click="classifyStair()"
- >添加优惠券</el-button
- >
- <el-button
- style="margin:0 0 20px 10px;"
- :disabled="!isAuth('coupon:log')"
- size="mini"
- type="primary"
- icon="document"
- @click="couponLog()"
- >查看优惠券日志</el-button
- >
- </div>
- </div>
- <el-table v-loading="tableDataLoading" :data="tableData.list">
- <el-table-column prop="couponId" label="编号" width="80">
- </el-table-column>
- <el-table-column prop="couponName" label="优惠券名称">
- </el-table-column>
- <el-table-column prop="couponPicture" label="图片">
- <template slot-scope="scope">
- <img
- :src="scope.row.couponPicture"
- alt=""
- width="40"
- height="40"
- />
- </template>
- </el-table-column>
- <el-table-column prop="money" label="优惠券金额"> </el-table-column>
- <el-table-column prop="minMoney" label="最低消费"> </el-table-column>
- <el-table-column prop="endDate" label="有效天数"> </el-table-column>
- <el-table-column prop="needIntegral" label="兑换积分">
- </el-table-column>
- <el-table-column prop="state" label="状态">
- <template slot-scope="scope">
- <span v-if="scope.row.state == 0">待审核</span>
- <span v-if="scope.row.state == 1">已发布</span>
- <span v-if="scope.row.state == 2">已撤销</span>
- </template>
- </el-table-column>
- <el-table-column label="操作" width="250">
- <template slot-scope="scope">
- <el-button
- v-if="scope.row.state == 1"
- :disabled="!isAuth('coupon:update')"
- size="mini"
- type="primary"
- icon="document"
- @click="songCoupon(scope.row)"
- >赠送
- </el-button>
- <el-button
- v-if="superAdmin == 1 && scope.row.state == 1"
- size="mini"
- type="primary"
- :disabled="!isAuth('coupon:update')"
- @click="compile(scope.$index, scope.row)"
- >编辑
- </el-button>
- <el-button
- v-if="scope.row.state == 1"
- size="mini"
- type="danger"
- :disabled="!isAuth('coupon:delete')"
- @click="deleteStair(scope.row)"
- >删除
- </el-button>
- <el-button
- v-if="superAdmin == 1 && scope.row.state == 0"
- size="mini"
- type="primary"
- @click="announceStair(scope.row, 1)"
- >发布
- </el-button>
- <el-button
- v-if="superAdmin == 1 && scope.row.state == 0"
- size="mini"
- type="danger"
- @click="announceStair(scope.row, 2)"
- >撤销
- </el-button>
- </template>
- </el-table-column>
- </el-table>
- <div style="text-align: center;margin-top: 10px;">
- <el-pagination
- @size-change="handleSizeChange"
- @current-change="handleCurrentChange"
- :page-sizes="[10, 20, 30, 40]"
- :page-size="limit"
- :current-page="page"
- layout="total,sizes, prev, pager, next"
- :total="tableData.totalCount"
- >
- </el-pagination>
- </div>
- </el-tab-pane>
- <el-tab-pane label="商家优惠券" name="youhuiquan">
- <div style="position: relative;display: inline-block;margin: 10px 0px;">
- <span>商户名称:</span>
- <el-input
- style="width: 200px;"
- @keydown.enter.native="animeDat"
- placeholder="请输入商户名称"
- v-model="shopName"
- >
- </el-input
- >
- <el-button
- size="mini"
- type="primary"
- icon="document"
- @click="refreshShop"
- >查询</el-button
- >
- <el-button
- style="margin:0 0 20px 10px;"
- :disabled="!isAuth('coupon:add')"
- size="mini"
- type="primary"
- icon="document"
- @click="classifyStair()"
- >添加优惠券</el-button
- >
- </div>
- <el-table v-loading="tableDataLoading" :data="tableData.list">
- <el-table-column prop="couponId" label="编号" width="80">
- </el-table-column>
- <el-table-column prop="shopName" label="商户名称"> </el-table-column>
- <el-table-column prop="couponName" label="优惠券名称">
- </el-table-column>
- <el-table-column prop="couponPicture" label="图片">
- <template slot-scope="scope">
- <img
- :src="scope.row.couponPicture"
- alt=""
- width="40"
- height="40"
- />
- </template>
- </el-table-column>
- <el-table-column prop="money" label="优惠券金额"> </el-table-column>
- <el-table-column prop="minMoney" label="最低消费"> </el-table-column>
- <el-table-column prop="endDate" label="有效天数"> </el-table-column>
- <!-- <el-table-column prop="needIntegral" label="兑换积分">
- </el-table-column> -->
- <el-table-column label="操作" width="250">
- <template slot-scope="scope">
- <el-button
- style="margin-left:15px;"
- :disabled="!isAuth('coupon:update')"
- size="mini"
- type="primary"
- icon="document"
- @click="songCoupon(scope.row)"
- >赠送</el-button
- >
- <el-button
- size="mini"
- type="primary"
- :disabled="!isAuth('coupon:update')"
- @click="compile(scope.$index, scope.row)"
- >编辑
- </el-button>
- <el-button
- size="mini"
- type="danger"
- :disabled="!isAuth('coupon:delete')"
- @click="deleteStair(scope.row)"
- >删除
- </el-button>
- </template>
- </el-table-column>
- </el-table>
- <div style="text-align: center;margin-top: 10px;">
- <el-pagination
- @size-change="handleSizeChange"
- @current-change="handleCurrentChange"
- :page-sizes="[10, 20, 30, 40]"
- :page-size="limit"
- :current-page="page"
- layout="total,sizes, prev, pager, next"
- :total="tableData.totalCount"
- >
- </el-pagination>
- </div>
- </el-tab-pane>
- </el-tabs>
- <!-- 查看优惠券日志 -->
- <el-dialog
- title="查看优惠券日志"
- custom-class="couponLog"
- :visible.sync="couponLogVisible"
- center
- >
- <el-table v-loading="couponLogLoading" :data="couponLogTable">
- <el-table-column prop="couponId" label="编号" width="80">
- </el-table-column>
- <el-table-column prop="couponName" label="优惠券名称">
- </el-table-column>
- <el-table-column prop="couponPicture" label="图片">
- <template slot-scope="scope">
- <img :src="scope.row.couponPicture" alt="" width="40" height="40" />
- </template>
- </el-table-column>
- <el-table-column prop="money" label="优惠券金额"> </el-table-column>
- <el-table-column prop="minMoney" label="最低消费"> </el-table-column>
- <el-table-column prop="endDate" label="有效天数"> </el-table-column>
- <el-table-column prop="needIntegral" label="兑换积分">
- </el-table-column>
- <el-table-column prop="state" label="状态">
- <template slot-scope="scope">
- <span v-if="scope.row.state == 0">待审核</span>
- <span v-if="scope.row.state == 1">已发布</span>
- <span v-if="scope.row.state == 2">已撤销</span>
- </template>
- </el-table-column>
- <el-table-column prop="content" label="操作内容"> </el-table-column>
- <el-table-column prop="username" label="操作人"> </el-table-column>
- <el-table-column prop="createTime" label="操作时间"> </el-table-column>
- </el-table>
- <div style="text-align: center;margin-top: 10px;">
- <el-pagination
- @size-change="couponLogSize"
- @current-change="couponLogCurrent"
- :page-sizes="[10, 20, 30, 40]"
- :page-size="couponLogLimit"
- :current-page="couponLogPage"
- layout="total,sizes, prev, pager, next"
- :total="couponLogTotal"
- >
- </el-pagination>
- </div>
- <!-- <div slot="footer" class="dialog-footer">
- <el-button @click="couponLogVisible = false">取 消</el-button>
- <el-button type="primary" @click="startCouponLog()">确 定</el-button>
- </div> -->
- </el-dialog>
- <!-- 添加优惠券 -->
- <el-dialog
- customClass="discount"
- title="添加优惠券"
- :visible.sync="dialogFormVisible"
- center
- >
- <div style="display: flex;justify-content: center;">
- <div>
- <div style="margin-bottom: 10px;" v-if="this.shopId == -1">
- <span style="width:150px;display: inline-block;text-align: right;"
- >商铺名称:</span
- >
- <el-input
- v-model="shopNames"
- placeholder="请选择商铺"
- style="width:50%;"
- @focus="selectUserId"
- ></el-input>
- </div>
- <div style="margin-bottom: 10px;">
- <span style="width: 150px;display: inline-block;text-align: right;"
- >优惠券名称:</span
- >
- <el-input
- style="width:50%;"
- v-model="couponName"
- type="text"
- placeholder="请输入优惠券名称"
- ></el-input>
- </div>
- <div style="margin-bottom: 10px;">
- <span style="width: 150px;display: inline-block;text-align: right;"
- >图片:</span
- >
- <!-- <el-input style="width:50%;" v-model="couponPicture" type="text" placeholder="请输入图片"></el-input> -->
- <div
- style=" width:148px;height:148px;background-color: #fbfdff; border: 1px dashed #c0ccda;border-radius: 6px;text-align: center;line-height: 148px;display: inline-block;"
- >
- <el-upload
- class="avatar-uploader"
- v-model="couponPicture"
- :action="Tupiantou"
- :show-file-list="false"
- :on-success="handleAvatarSuccess1"
- :before-upload="beforeAvatarUpload"
- >
- <img
- v-if="couponPicture"
- :src="couponPicture"
- class="avatar"
- style="width: 148px;height: 148px;"
- />
- <i
- v-else
- class="el-icon-plus avatar-uploader-icon"
- style="font-size: 28px;color: #8c939d"
- ></i>
- </el-upload>
- </div>
- </div>
- <div style="margin-bottom: 10px;">
- <span style="width: 150px;display: inline-block;text-align: right;"
- >优惠券金额:</span
- >
- <el-input
- style="width:50%;"
- v-model="money"
- type="text"
- placeholder="请输入优惠券金额"
- ></el-input>
- </div>
- <div style="margin-bottom: 10px;">
- <span style="width: 150px;display: inline-block;text-align: right;"
- >最低消费:</span
- >
- <el-input
- style="width:50%;"
- v-model="minMoney"
- type="text"
- placeholder="请输入最低消费"
- ></el-input>
- </div>
- <div style="margin-bottom: 10px;">
- <span style="width: 150px;display: inline-block;text-align: right;"
- >有效天数:</span
- >
- <el-input
- style="width:50%;"
- v-model="endDate"
- type="text"
- placeholder="请输入有效天数"
- ></el-input>
- </div>
- <div style="margin-bottom: 10px;" v-if="this.shopId == 0">
- <span style="width: 150px;display: inline-block;text-align: right;"
- >兑换积分:</span
- >
- <el-input
- style="width:50%;"
- v-model="needIntegral"
- type="text"
- placeholder="请输入兑换积分"
- ></el-input>
- </div>
- <span style="color: red;margin-left: 32px;"
- >兑换积分初始值为100,是必填项,不填则默认向所有用户发券</span
- >
- </div>
- <div v-loading="allShopLoading" v-if="this.shopId == 0">
- <div style="width: 500px;height: 200px;">
- <div style="margin-bottom: 10px;">
- <span
- style="width: 150px;display: inline-block;text-align: right;"
- >使用范围:</span
- >
- <el-checkbox
- @change="checkChange($event, '不限制')"
- v-model="allMerchant"
- >不限制</el-checkbox
- >
- <el-checkbox
- @change="checkChange($event, '部分商家')"
- v-model="someMerchant"
- >部分商家</el-checkbox
- >
- </div>
- <div style="margin:0 0 10px 80px;" v-if="someMerchant">
- <el-input
- v-model="selectName"
- placeholder="请输入商铺名称"
- style="width:50%;"
- clearable
- @change="shopNameSeache"
- ></el-input>
- <!-- <el-button
- style="margin-left: 15px"
- size="medium"
- type="primary"
- icon="document"
- @click="shopNameSeache"
- >查询
- </el-button> -->
- </div>
- <div
- v-if="someMerchant"
- style="margin:0 0 10px 80px;height: 300px;border: 1px solid #ccc;overflow: auto;"
- @scroll="handleTreeScroll"
- >
- <el-tree
- class="shop"
- ref="tree"
- :data="dataTree"
- show-checkbox
- node-key="shopId"
- :props="defaultProps"
- @check="treeCheck"
- ></el-tree>
- <div style="text-align: center;" v-if="allShopListShow">
- 数据已全部加载完
- </div>
- </div>
- <div style="margin-bottom: 10px;" v-if="someMerchant">
- <span
- style="width: 130px;display: inline-block;text-align: right;"
- >已选择</span
- ><span style="color: red;">{{ selectMerchant.length }}</span
- >个商家
- </div>
- </div>
- </div>
- </div>
- <div slot="footer" class="dialog-footer">
- <el-button @click="dialogFormVisible = false">取 消</el-button>
- <el-button type="primary" @click="StairNoticeTo()">确 定</el-button>
- </div>
- </el-dialog>
- <!-- 修改优惠券 -->
- <el-dialog
- customClass="discount"
- title="修改优惠券"
- :visible.sync="dialogFormVisible1"
- center
- :before-close="compileClose"
- >
- <div style="display: flex;justify-content: center;">
- <el-form :model="form">
- <div style="display: flex;justify-content: center;">
- <div>
- <el-form-item
- label="商铺名称:"
- :label-width="formLabelWidth"
- v-if="this.shopId == -1"
- >
- <el-input
- v-model="shopNames"
- placeholder="请选择商铺"
- style="width:50%;"
- @focus="selectUserId"
- >
- </el-input>
- </el-form-item>
- <el-form-item label="优惠券名称:" :label-width="formLabelWidth">
- <el-input
- v-model="form.couponName"
- style="width:65%;"
- ></el-input>
- </el-form-item>
- <el-form-item label="图片:" :label-width="formLabelWidth">
- <!-- <el-input v-model="form.campusDetails" style="width:65%;"></el-input> -->
- <div
- style=" width:148px;height:148px;background-color: #fbfdff; border: 1px dashed #c0ccda;border-radius: 6px;text-align: center;line-height: 148px;display: inline-block;"
- >
- <el-upload
- class="avatar-uploader"
- v-model="form.couponPicture"
- :action="Tupiantou"
- :show-file-list="false"
- :on-success="handleAvatarSuccess2"
- :before-upload="beforeAvatarUpload"
- >
- <img
- v-if="form.couponPicture"
- :src="form.couponPicture"
- class="avatar"
- style="width: 148px;height: 148px;"
- />
- <i
- v-else
- class="el-icon-plus avatar-uploader-icon"
- style="font-size: 28px;color: #8c939d"
- ></i>
- </el-upload>
- </div>
- </el-form-item>
- <el-form-item label="优惠券金额:" :label-width="formLabelWidth">
- <el-input v-model="form.money" style="width:65%;"></el-input>
- </el-form-item>
- <el-form-item label="最低消费:" :label-width="formLabelWidth">
- <el-input v-model="form.minMoney" style="width:65%;"></el-input>
- </el-form-item>
- <el-form-item label="有效天数:" :label-width="formLabelWidth">
- <el-input v-model="form.endDate" style="width:65%;"></el-input>
- </el-form-item>
- <el-form-item
- label="兑换积分:"
- :label-width="formLabelWidth"
- v-if="this.shopId == 0"
- >
- <el-input
- v-model="form.needIntegral"
- style="width:65%;"
- ></el-input>
- </el-form-item>
- <span style="color: red;margin-left: 32px;"
- >兑换积分初始值为100,是必填项,不填则默认向所有用户发券</span
- >
- </div>
- <div v-loading="allShopLoading" v-if="this.shopId == 0">
- <div style="width: 500px;height: 200px;">
- <div style="margin-bottom: 10px;">
- <span
- style="width: 150px;display: inline-block;text-align: right;"
- >使用范围:</span
- >
- <el-checkbox
- @change="checkChange($event, '不限制')"
- v-model="allMerchant"
- >不限制</el-checkbox
- >
- <el-checkbox
- @change="checkChange($event, '部分商家')"
- v-model="someMerchant"
- >部分商家</el-checkbox
- >
- </div>
- <div style="margin:0 0 10px 80px;" v-if="someMerchant">
- <el-input
- v-model="selectName"
- placeholder="请输入商铺名称"
- style="width:50%;"
- clearable
- @change="shopNameSeache"
- ></el-input>
- <!-- <el-button
- style="margin-left: 15px"
- size="medium"
- type="primary"
- icon="document"
- @click="shopNameSeache"
- >查询
- </el-button> -->
- </div>
- <div
- v-if="someMerchant"
- style="margin:0 0 10px 80px;height: 300px;border: 1px solid #ccc;overflow: auto;"
- @scroll="handleTreeScroll"
- >
- <el-tree
- class="shop"
- ref="tree"
- :data="dataTree"
- show-checkbox
- node-key="shopId"
- :props="defaultProps"
- @check="treeCheck"
- ></el-tree>
- <div style="text-align: center;" v-if="allShopListShow">
- 数据已全部加载完
- </div>
- </div>
- <div style="margin-bottom: 10px;" v-if="someMerchant">
- <span
- style="width: 130px;display: inline-block;text-align: right;"
- >已选择</span
- ><span style="color: red;">{{ selectMerchant.length }}</span
- >个商家
- </div>
- </div>
- </div>
- </div>
- </el-form>
- </div>
- <div slot="footer" class="dialog-footer">
- <el-button @click="dialogFormVisible1 = false">取 消</el-button>
- <el-button type="primary" @click="CompileNoticeTo()">确 定</el-button>
- </div>
- </el-dialog>
- <!-- 赠送优惠券-->
- <el-dialog title="赠送优惠券" :visible.sync="dialogFormVisible0" center>
- <div style="margin: 10px 0;">
- <span style="width: 200px;display: inline-block;text-align: right;"
- >选择用户:</span
- >
- <el-tag
- :key="tag"
- v-for="(tag, j) in userNameList"
- closable
- :disable-transitions="false"
- @close="couponIdClose1(tag, j)"
- >
- {{ tag }}
- </el-tag>
- <el-button class="button-new-tag" size="small" @click="couponIdBtn1()"
- >添加</el-button
- >
- </div>
- <div slot="footer" class="dialog-footer">
- <el-button @click="dialogFormVisible0 = false">取 消</el-button>
- <el-button type="primary" @click="songNoticeTo()">确 定</el-button>
- </div>
- </el-dialog>
- <!-- 用户列表 -->
- <el-dialog
- title="用户列表"
- :visible.sync="dialogFormVisible5"
- center
- width="80%"
- >
- <el-input
- style="width: 150px;"
- @keydown.enter.native="select1"
- clearable
- placeholder="请输入手机号"
- v-model="phone"
- >
- </el-input
- >
- <el-input
- style="width: 150px;"
- @keydown.enter.native="select1"
- clearable
- placeholder="请输入昵称"
- v-model="nickName"
- >
- </el-input>
- <div style="display: inline-block;">
- <el-button
- style="margin-left:15px;"
- size="mini"
- type="primary"
- icon="document"
- @click="select1"
- >查询
- </el-button>
- <el-button
- style="margin-left:15px;"
- size="mini"
- type="primary"
- icon="document"
- @click="cleans1"
- >重置
- </el-button>
- </div>
- <el-button
- style="margin-left:15px;"
- :disabled="userIdList.length <= 0"
- size="mini"
- type="primary"
- icon="document"
- @click="closes2()"
- >确定</el-button
- >
- <el-table
- v-loading="tableDataLoading1"
- @selection-change="changeFun1"
- :data="userData.list"
- :row-key="
- row => {
- return row.userId;
- }
- "
- ref="multipleTable"
- >
- <el-table-column :reserve-selection="true" type="selection" fixed>
- </el-table-column>
- <el-table-column prop="userId" label="编号"> </el-table-column>
- <el-table-column fixed prop="nickName" label="昵称">
- <template slot-scope="scope">
- <span style="color: #f56c6c;">{{
- scope.row.nickName ? scope.row.nickName : "未设置"
- }}</span>
- </template>
- </el-table-column>
- <el-table-column label="图像">
- <template slot-scope="scope">
- <img
- v-if="scope.row.avatar == null"
- src="~@/assets/img/avatar.png"
- alt=""
- width="40"
- height="40"
- />
- <img v-else :src="scope.row.avatar" alt="" width="40" height="40" />
- </template>
- </el-table-column>
- <el-table-column prop="phone" label="手机号" width="120">
- <template slot-scope="scope">
- <span
- style="color: #4f9dec;cursor: pointer;"
- @click="updates(scope.row)"
- >{{ scope.row.phone ? scope.row.phone : "未绑定" }}</span
- >
- </template>
- </el-table-column>
- <el-table-column prop="platform" label="来源"> </el-table-column>
- <el-table-column prop="createTime" label="创建时间"> </el-table-column>
- </el-table>
- <div style="text-align: center;margin-top: 10px;">
- <el-pagination
- @size-change="handleSizeChange2"
- @current-change="handleCurrentChange2"
- :page-sizes="[5, 10, 15, 20]"
- :page-size="size1"
- :current-page="page1"
- layout="total,sizes, prev, pager, next,jumper"
- :total="userData.totalCount"
- >
- </el-pagination>
- </div>
- </el-dialog>
- <!-- 商户列表 -->
- <el-dialog
- title="商户列表"
- :visible.sync="dialogFormVisible11"
- center
- width="80%"
- >
- <el-input
- style="width: 150px;"
- @keydown.enter.native="select11"
- clearable
- placeholder="请输入商户名称"
- v-model="shopName1"
- >
- </el-input
- >
- <div style="display: inline-block;">
- <el-button
- style="margin-left:15px;"
- size="mini"
- type="primary"
- icon="document"
- @click="select11"
- >查询
- </el-button>
- <el-button
- style="margin-left:15px;"
- size="mini"
- type="primary"
- icon="document"
- @click="cleans11"
- >重置
- </el-button>
- </div>
- <el-table v-loading="tableDataLoading11" :data="shopData.list">
- <el-table-column label="编号" prop="shopId" width="80" fixed="left">
- </el-table-column>
- <el-table-column label="名称" prop="shopName" fixed="left">
- </el-table-column>
- <el-table-column label="店铺手机号" prop="phone" width="120">
- </el-table-column>
- <el-table-column label="商铺类型" prop="shopTypeName">
- </el-table-column>
- <el-table-column prop="shopCover" label="封面图" width="150">
- <template slot-scope="scope">
- <div style="display: inline-block; margin: 3px;">
- <el-popover placement="top-start" title="" trigger="hover">
- <img
- style="width: 50px; height: 50px"
- :src="scope.row.shopCover"
- alt=""
- slot="reference"
- />
- <img
- style="width: 300px; height: auto"
- :src="scope.row.shopCover"
- alt=""
- />
- </el-popover>
- </div>
- </template>
- </el-table-column>
- <el-table-column label="营业状态" prop="putawayFlag">
- <template slot-scope="scope">
- <span>{{ scope.row.putawayFlag == 0 ? "上班啦" : "打烊啦" }}</span>
- </template>
- </el-table-column>
- <el-table-column label="配送费" prop="errandMoney" width="150">
- <template slot-scope="scope">
- <span>{{ scope.row.errandMoney ? scope.row.errandMoney : 0 }}</span>
- <el-button
- size="mini"
- type="danger"
- style="color: #4f9dec;background: #fff;border: none;"
- :disabled="!isAuth('userList:updateMoney')"
- @click="rechargenone(scope.row, 1)"
- >修改配送费
- </el-button>
- </template>
- </el-table-column>
- <el-table-column
- label="配送距离"
- prop="distributionDistance"
- width="150"
- >
- <template slot-scope="scope">
- <span>{{
- scope.row.distributionDistance
- ? scope.row.distributionDistance
- : 0
- }}</span>
- </template>
- </el-table-column>
- <el-table-column label="商铺标签" prop="shopLable"> </el-table-column>
- <el-table-column label="开店时间" prop="businessHours">
- </el-table-column>
- <el-table-column label="闭店时间" prop="lockHours"> </el-table-column>
- <el-table-column label="商铺评分" prop="shopScore"> </el-table-column>
- <el-table-column label="商铺销量" prop="shopSales"> </el-table-column>
- <el-table-column label="商家公告" prop="shopNotice" width="150">
- </el-table-column>
- <el-table-column fixed="right" label="操作">
- <template slot-scope="scope">
- <el-button
- style="margin-left:15px;"
- size="mini"
- type="primary"
- icon="document"
- @click="closes3(scope.row)"
- >
- 确定</el-button
- >
- </template>
- </el-table-column>
- </el-table>
- <div style="text-align: center;margin-top: 10px;">
- <el-pagination
- @size-change="handleSizeChangeS"
- @current-change="handleCurrentChangeS"
- :page-sizes="[10, 20, 30, 50]"
- :page-size="size1"
- :current-page="page1"
- layout="total,sizes, prev, pager, next,jumper"
- :total="shopData.totalCount"
- >
- </el-pagination>
- </div>
- </el-dialog>
- </div>
- </template>
- <script>
- export default {
- data() {
- return {
- userId: "",
- superAdmin: "", // 判断是否为超级管理员 1是超级管理员 0不是超级管理员
- selectState: "",
- limit: 10,
- page: 1,
- size1: 10,
- page1: 1,
- checkBoxData: [], //多选框选择的值
- formLabelWidth: "200px",
- tableDataLoading: false,
- dialogFormVisible: false,
- dialogFormVisible1: false,
- dialogFormVisible0: false,
- dialogFormVisible5: false,
- tableDataLoading1: false,
- tableData: [],
- couponName: "",
- couponPicture: "",
- endDate: "",
- minMoney: "",
- money: "",
- needIntegral: "100",
- // 使用范围
- allMerchant: false,
- someMerchant: false,
- dataTree: [],
- defaultProps: {
- label: "shopName",
- value: "shopId"
- },
- merchantPage: 1,
- merchantLimit: 20,
- selectName: "",
- allShopListShow: false, // 商家下拉全部加载完成
- allShopLoading: true, // 商家下拉数据加载中
- merchantList: [],
- usedShopId: "",
- selectMerchant: [], // 勾选中的数据
- merchantTotalPage: 1,
- merchantSelectTotal: "",
- form: {
- couponId: "",
- couponName: "",
- couponPicture: "",
- endDate: "",
- minMoney: "",
- money: "",
- needIntegral: ""
- },
- userNameList: [],
- userIdList: [],
- userData: [],
- phone: "",
- nickName: "",
- couponId: "",
- activeName: "seventh",
- shopName: "",
- shopId: 0,
- tableDataLoading11: false,
- dialogFormVisible11: false,
- shopIds: "",
- shopNames: "",
- shopName1: "",
- shopData: {},
- shopIds2: "",
- content: "",
- couponLogVisible: false, // 查看优惠券日志
- couponLogLoading: false,
- couponLogTable: [],
- couponLogLimit: 10,
- couponLogPage: 1,
- couponLogTotal: 1
- };
- },
- methods: {
- handleClick(tab, event) {
- if (tab._props.label == "平台优惠券") {
- this.page = 1;
- this.limit = 10;
- this.shopName = "";
- this.shopId = 0;
- this.dataSelect();
- }
- if (tab._props.label == "商家优惠券") {
- this.page = 1;
- this.limit = 10;
- this.shopName = "";
- this.shopId = -1;
- this.dataSelect();
- }
- },
- // 多选
- changeFun(val) {
- this.checkBoxData = val;
- },
- handleSizeChange(val) {
- this.limit = val;
- this.dataSelect();
- },
- handleCurrentChange(val) {
- this.page = val;
- this.dataSelect();
- },
- handleSizeChange2(val) {
- this.size1 = val;
- this.dataSelect1();
- },
- handleCurrentChange2(val) {
- this.page1 = val;
- this.dataSelect1();
- },
- handleSizeChangeS(val) {
- this.size1 = val;
- this.dataSelect11();
- },
- handleCurrentChangeS(val) {
- this.page1 = val;
- this.dataSelect11();
- },
- beforeAvatarUpload(file) {
- return this.$processImage(this, file, false);
- },
- handleAvatarSuccess1(file, fileList) {
- this.couponPicture = file.data;
- },
- handleAvatarSuccess2(file, fileList) {
- this.form.couponPicture = file.data;
- },
- // 刷新
- refresh() {
- this.page = 1;
- this.dataSelect();
- },
- // 查看优惠券日志
- couponLog() {
- this.couponLogVisible = true;
- this.couponLogList();
- },
- couponLogList() {
- this.couponLogLoading = true;
- this.$http({
- url: this.$http.adornUrl("admin/couponLog/selectCouponLog"),
- method: "get",
- params: this.$http.adornParams({
- page: this.couponLogPage,
- limit: this.couponLogLimit
- })
- }).then(({ data }) => {
- console.log(data, "查看优惠券日志");
- this.couponLogLoading = false;
- let returnData = data.data;
- this.couponLogTable = returnData.list;
- this.couponLogTotal = returnData.totalCount;
- });
- },
- couponLogSize(val) {
- this.couponLogLimit = val;
- this.couponLogList();
- },
- couponLogCurrent(val) {
- this.couponLogPage = val;
- this.couponLogList();
- },
- // 添加优惠券弹框
- classifyStair() {
- this.couponName = "";
- this.couponPicture = "";
- this.endDate = "";
- this.minMoney = "";
- this.money = "";
- this.needIntegral = "100";
- this.shopNames = "";
- this.merchantPage = 1;
- this.merchantList = [];
- this.selectMerchant = [];
- this.allMerchant = false;
- this.someMerchant = false;
- this.allShopListShow = false;
- if (this.shopId === 0) {
- this.shopIds = 0;
- this.merchantData();
- } else {
- this.shopIds = "";
- }
- // 重置滚动位置
- // this.$nextTick(() => {
- // console.log(document.querySelector('.shop'));
- // // document.querySelector('.el-tree__body-wrapper')
- // const treeWrapper = this.$refs.tree;
- // if (treeWrapper) {
- // treeWrapper.scrollTop = 0; // 重置滚动位置
- // }
- // });
- this.dialogFormVisible = true;
- },
- // 确定添加优惠券
- StairNoticeTo() {
- if (this.couponName == "") {
- this.$notify({
- title: "提示",
- duration: 1800,
- message: "请输入优惠券名称",
- type: "warning"
- });
- return;
- }
- if (this.couponPicture == "") {
- this.$notify({
- title: "提示",
- duration: 1800,
- message: "请上传图片",
- type: "warning"
- });
- return;
- }
- if (this.money == "") {
- this.$notify({
- title: "提示",
- duration: 1800,
- message: "请输入优惠券金额",
- type: "warning"
- });
- return;
- }
- if (this.minMoney == "") {
- this.$notify({
- title: "提示",
- duration: 1800,
- message: "请输入最低消费",
- type: "warning"
- });
- return;
- }
- if (this.endDate == "") {
- this.$notify({
- title: "提示",
- duration: 1800,
- message: "请输入有效天数",
- type: "warning"
- });
- return;
- }
- if (this.shopId == 0) {
- if (!this.allMerchant && !this.someMerchant) {
- this.$notify({
- title: "提示",
- duration: 1800,
- message: "商家不能为空",
- type: "warning"
- });
- return;
- }
- }
- if (this.shopId === 0) {
- this.usedShopId = "";
- if (this.allMerchant) {
- this.usedShopId = 0;
- }
- if (this.someMerchant) {
- this.usedShopId = this.selectMerchant.join(",");
- }
- if (this.needIntegral == "") {
- this.$notify({
- title: "提示",
- duration: 1800,
- message: "请输入兑换积分",
- type: "warning"
- });
- return;
- }
- } else {
- this.usedShopId = "";
- }
- this.$http({
- url: this.$http.adornUrl("admin/coupon/issueCoupon"),
- method: "post",
- data: this.$http.adornData({
- couponName: this.couponName,
- couponPicture: this.couponPicture,
- endDate: this.endDate,
- minMoney: this.minMoney,
- money: this.money,
- needIntegral: this.needIntegral,
- shopId: this.shopIds,
- sysUserId: this.userId,
- usedShopId: this.usedShopId
- })
- }).then(({ data }) => {
- if (data.code == 0) {
- this.dialogFormVisible = false;
- this.$message({
- message: "添加成功",
- type: "success",
- duration: 1500,
- onClose: () => {
- this.dataSelect();
- }
- });
- } else {
- this.$message({
- message: data.msg,
- type: "warning",
- duration: 1500,
- onClose: () => {}
- });
- }
- });
- },
- checkChange(val, title) {
- console.log(val, title);
- if (val) {
- if (title == "不限制") {
- this.someMerchant = false;
- }
- if (title == "部分商家") {
- this.allMerchant = false;
- // this.merchantData();
- }
- }
- this.$nextTick(() => {
- if (this.$refs.tree) {
- this.$refs.tree.setCheckedKeys(this.selectMerchant);
- }
- });
- },
- treeCheck(checkedNodes, checkedKeys) {
- console.log(checkedKeys.checkedKeys);
- this.selectMerchant = checkedKeys.checkedKeys;
- },
- // 平台优惠券 弹窗 搜索商铺
- shopNameSeache() {
- this.merchantPage = 1;
- this.merchantData();
- },
- // 商铺列表
- merchantData(title) {
- this.allShopLoading = true;
- this.$http({
- url: this.$http.adornUrl("admin/goods/selectAllShop"),
- method: "get",
- params: this.$http.adornParams({
- page: this.merchantPage,
- limit: this.merchantLimit,
- shopName: this.selectName
- })
- }).then(({ data }) => {
- console.log(data, "店铺名称列表");
- if (data.code == 0) {
- if (title == "滚动") {
- this.dataTree = [...this.dataTree, ...data.data.list];
- } else {
- this.dataTree = data.data.list;
- }
- console.log(this.selectMerchant, "选择的数据");
- if (this.$refs.tree) {
- this.$refs.tree.setCheckedKeys(this.selectMerchant);
- }
- this.merchantTotalPage = data.data.totalPage;
- this.allShopLoading = false;
- }
- });
- },
- // 树形组件滚动操作
- handleTreeScroll(event) {
- const { scrollTop, scrollHeight, clientHeight } = event.target;
- // 判断是否滚动到底部
- if (scrollTop + clientHeight >= scrollHeight) {
- console.log("滚动到底部了");
- // 在这里执行你需要的逻辑,比如加载更多数据
- if (this.merchantPage >= this.merchantTotalPage) {
- // this.$message({
- // title: "提示",
- // duration: 1800,
- // message: "数据已全部加载完",
- // type: "warning"
- // });
- this.allShopListShow = true;
- return;
- }
- this.merchantPage++;
- console.log(this.merchantPage, "后");
- this.merchantData("滚动");
- }
- },
- // 修改优惠券
- compile(index, rows) {
- this.selectMerchant = [];
- console.log(rows);
- this.merchantPage = 1;
- this.merchantData();
- if (rows.usedShopId == 0) {
- this.usedShopId = 0;
- this.allMerchant = true;
- this.someMerchant = false;
- } else if (rows.usedShopId != null && rows.usedShopId != 0) {
- this.usedShopId = rows.usedShopId;
- this.selectMerchant = rows.usedShopId.split(",");
- this.allMerchant = false;
- this.someMerchant = true;
- } else {
- this.usedShopId = "";
- this.allMerchant = false;
- this.someMerchant = false;
- }
- this.allShopListShow = false;
- this.form.couponName = rows.couponName;
- this.form.couponPicture = rows.couponPicture;
- this.form.endDate = rows.endDate;
- this.form.minMoney = rows.minMoney;
- this.form.money = rows.money;
- this.form.needIntegral = rows.needIntegral;
- this.form.couponId = rows.couponId;
- this.shopNames = rows.shopName;
- this.shopIds = rows.shopId;
- this.dialogFormVisible1 = true;
- },
- compileClose() {
- if (this.shopId == 0 && this.someMerchant) {
- this.$nextTick(() => {
- const treeWrapper = this.$refs.tree.$el.querySelector(".el-tree");
- if (treeWrapper) {
- treeWrapper.scrollTop = 0;
- }
- });
- }
- this.dialogFormVisible1 = false;
- this.allMerchant = false;
- this.someMerchant = false;
- },
- // 确定修改优惠券
- CompileNoticeTo() {
- if (this.form.campusName == "") {
- this.$notify({
- title: "提示",
- duration: 1800,
- message: "请输入优惠券名称",
- type: "warning"
- });
- return;
- }
- if (this.form.couponPicture == "") {
- this.$notify({
- title: "提示",
- duration: 1800,
- message: "请上传图片",
- type: "warning"
- });
- return;
- }
- if (this.form.money == "") {
- this.$notify({
- title: "提示",
- duration: 1800,
- message: "请输入优惠券金额",
- type: "warning"
- });
- return;
- }
- if (this.form.minMoney == "") {
- this.$notify({
- title: "提示",
- duration: 1800,
- message: "请输入最低消费",
- type: "warning"
- });
- return;
- }
- if (this.form.endDate == "") {
- this.$notify({
- title: "提示",
- duration: 1800,
- message: "请输入有效天数",
- type: "warning"
- });
- return;
- }
- if (this.shopId == 0) {
- if (!this.allMerchant && !this.someMerchant) {
- this.$notify({
- title: "提示",
- duration: 1800,
- message: "商家不能为空",
- type: "warning"
- });
- return;
- }
- }
- if (this.shopId === 0) {
- this.usedShopId = "";
- if (this.allMerchant) {
- this.usedShopId = 0;
- }
- if (this.someMerchant) {
- this.usedShopId = this.selectMerchant.join(",");
- }
- if (this.needIntegral == "") {
- this.$notify({
- title: "提示",
- duration: 1800,
- message: "请输入兑换积分",
- type: "warning"
- });
- return;
- }
- } else {
- this.usedShopId = "";
- }
- this.$http({
- url: this.$http.adornUrl("admin/coupon/updateCoupon"),
- method: "post",
- data: this.$http.adornData({
- couponId: this.form.couponId,
- couponName: this.form.couponName,
- couponPicture: this.form.couponPicture,
- endDate: this.form.endDate,
- minMoney: this.form.minMoney,
- money: this.form.money,
- needIntegral: this.form.needIntegral,
- shopId: this.shopIds,
- sysUserId: this.userId,
- usedShopId: this.usedShopId
- })
- }).then(({ data }) => {
- if (data.code == 0) {
- this.$message({
- message: "操作成功",
- type: "success",
- duration: 1500,
- onClose: () => {
- this.dialogFormVisible1 = false;
- this.dataSelect();
- }
- });
- } else {
- this.$message({
- message: data.msg,
- type: "error",
- duration: 1500,
- onClose: () => {
- this.dialogFormVisible1 = false;
- this.dataSelect();
- }
- });
- }
- });
- },
- // 发布审核优惠券
- announceStair(rows, index) {
- let title = "";
- if (index == 1) {
- title = "确定发布此条优惠券?";
- } else if (title == 2) {
- title = "确定撤销此条优惠券?";
- }
- this.$confirm(`${title}`, "提示", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- })
- .then(() => {
- this.$http({
- url: this.$http.adornUrl("admin/coupon/checkCoupon"),
- method: "get",
- params: this.$http.adornParams({
- couponId: rows.couponId,
- sysUserId: this.userId,
- state: index
- })
- }).then(({ data }) => {
- console.log(data);
- if (data.code == 0) {
- this.$message({
- message: "操作成功",
- type: "success",
- duration: 1500,
- onClose: () => {
- this.dataSelect();
- }
- });
- } else {
- this.$message({
- message: data.msg,
- type: "error",
- duration: 1500,
- onClose: () => {
- this.dataSelect();
- }
- });
- }
- });
- })
- .catch(() => {});
- },
- // 删除
- deleteStair(row) {
- this.$confirm(`确定删除此条信息?`, "提示", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- })
- .then(() => {
- this.$http({
- url: this.$http.adornUrl("admin/coupon/deleteCoupon"),
- method: "post",
- params: this.$http.adornParams({
- couponId: row.couponId,
- sysUserId: this.userId
- })
- }).then(({ data }) => {
- if (data.code == 0) {
- this.$message({
- message: "删除成功",
- type: "success",
- duration: 1500,
- onClose: () => {
- this.dataSelect();
- }
- });
- } else {
- this.$message({
- message: data.msg,
- type: "error",
- duration: 1500,
- onClose: () => {
- this.dataSelect();
- }
- });
- }
- });
- })
- .catch(() => {});
- },
- // 重置
- cleans() {
- this.phone = "";
- this.status = 0;
- this.dataSelect();
- },
- // 获取派单数据列表
- dataSelect() {
- this.tableDataLoading = true;
- if (this.shopId == 0) {
- this.$http({
- url: this.$http.adornUrl("admin/coupon/selectAdminCoupon"),
- method: "get",
- params: this.$http.adornParams({
- page: this.page,
- limit: this.limit,
- state: this.selectState
- })
- }).then(({ data }) => {
- console.log(data, "平台优惠券");
- this.tableDataLoading = false;
- let returnData = data.data;
- this.tableData = returnData;
- // if(data.data.list.length==0){
- // this.page = this.page-1
- // this.dataSelect()
- // }
- });
- } else if (this.shopId == -1) {
- this.$http({
- url: this.$http.adornUrl("admin/coupon/seleteAllCoupon"),
- method: "get",
- params: this.$http.adornParams({
- page: this.page,
- limit: this.limit,
- content: this.content,
- shopId: this.shopId,
- shopName: this.shopName
- })
- }).then(({ data }) => {
- console.log(data, "商家优惠券");
- this.tableDataLoading = false;
- let returnData = data.data;
- this.tableData = returnData;
- // if(data.data.list.length==0){
- // this.page = this.page-1
- // this.dataSelect()
- // }
- });
- }
- },
- // 赠送优惠券
- songCoupon(row) {
- this.couponId = row.couponId;
- this.shopIds2 = row.shopId;
- this.userIdList = [];
- this.userNameList = [];
- this.dialogFormVisible0 = true;
- },
- // 打开用户列表
- couponIdBtn1() {
- this.page1 = 1;
- this.dataSelect1();
- this.dialogFormVisible5 = true;
- if (this.userIdList.length == 0) {
- this.cleansHc();
- }
- },
- // 清空选中缓存
- cleansHc(rows) {
- console.log("---", this.$refs.multipleTable);
- if (this.$refs.multipleTable) {
- this.$refs.multipleTable.clearSelection();
- }
- },
- // 多选用户
- changeFun1(val) {
- console.log("多选", val);
- var userIdList = [];
- var userNameList = [];
- for (var i in val) {
- userIdList.push(val[i].userId);
- userNameList.push(val[i].nickName);
- }
- this.userIdList = userIdList;
- this.userNameList = userNameList;
- console.log(JSON.stringify(this.userIdList));
- },
- // 赠送优惠券
- songNoticeTo() {
- if (this.userIdList.length == 0) {
- this.$notify({
- title: "提示",
- duration: 1800,
- message: "请选择用户",
- type: "warning"
- });
- return;
- }
- if (this.shopId == -1) {
- var shopIds1 = this.shopIds2;
- } else {
- var shopIds1 = this.shopId;
- }
- var userIdList = this.userIdList.toString();
- this.$http({
- url: this.$http.adornUrl("admin/coupon/giveCoupon"),
- method: "get",
- params: this.$http.adornParams({
- userIds: userIdList,
- shopId: shopIds1,
- couponId: this.couponId
- })
- }).then(({ data }) => {
- this.$message({
- message: "操作成功",
- type: "success",
- duration: 1500,
- onClose: () => {
- this.userIdList = [];
- this.userNameList = [];
- this.shopIds2 = "";
- this.dataSelect();
- }
- });
- this.dialogFormVisible0 = false;
- });
- },
- // 获取用户数据列表
- dataSelect1() {
- let phone = -1;
- if (this.phone) {
- phone = this.phone;
- }
- this.tableDataLoading1 = true;
- this.$http({
- url: this.$http.adornUrl("user/selectUserList"),
- method: "get",
- params: this.$http.adornParams({
- page: this.page1,
- limit: this.size1,
- shopAdminFlag: "",
- phone: this.phone,
- userName: this.nickName,
- type: ""
- })
- }).then(({ data }) => {
- this.tableDataLoading1 = false;
- let returnData = data.data;
- this.userData = returnData;
- });
- },
- // 查询
- select1() {
- this.page = 1;
- this.dataSelect1();
- },
- // 重置
- cleans1() {
- this.page = 1;
- this.phone = "";
- this.nickName = "";
- this.dataSelect1();
- },
- couponIdClose1(ietm, index) {
- console.log("index", index, "ietm", ietm, this.userIdList.length);
- if (this.userIdList.length < 2) {
- this.$message({
- title: "提示",
- type: "error",
- duration: 1800,
- message: "最少需要选中一位用户",
- type: "warning"
- });
- return;
- } else {
- this.userIdList.splice(index, 1);
- this.userNameList.splice(index, 1);
- }
- },
- // 批量开启
- closes2(id) {
- this.isCoupon = 1;
- this.dialogFormVisible5 = false;
- },
- // 获取派单数据列表
- dataSelectShop() {
- this.tableDataLoading = true;
- this.$http({
- url: this.$http.adornUrl("coupon/seleteAllCoupon"),
- method: "get",
- params: this.$http.adornParams({
- page: this.page,
- limit: this.limit,
- shopName: this.shopName,
- shopId: this.shopId
- })
- }).then(({ data }) => {
- this.tableDataLoading = false;
- let returnData = data.data;
- this.tableData = returnData;
- // if(data.data.list.length==0){
- // this.page = this.page-1
- // this.dataSelect()
- // }
- });
- },
- // 获取用户数据列表
- dataSelect11() {
- this.tableDataLoading = true;
- this.$http({
- url: this.$http.adornUrl("admin/goods/selectAllShop"),
- method: "get",
- params: this.$http.adornParams({
- page: this.page1,
- limit: this.size1,
- shopName: this.shopName1,
- region: "",
- isActivity: ""
- })
- }).then(({ data }) => {
- this.tableDataLoading = false;
- for (var i in data.data.list) {
- if (data.data.list[i].shopBanner) {
- data.data.list[i].shopBanner = data.data.list[i].shopBanner.split(
- ","
- );
- }
- }
- let returnData = data.data;
- this.shopData = returnData;
- });
- },
- // 查询
- select11() {
- this.page1 = 1;
- this.dataSelect11();
- },
- // 查看用户
- selectUserId() {
- this.dialogFormVisible11 = true;
- this.page1 = 1;
- this.shopName1 = "";
- this.dataSelect11();
- },
- // 重置
- cleans11() {
- this.page1 = 1;
- this.shopName1 = "";
- this.dataSelect11();
- },
- closes3(row) {
- this.shopIds = row.shopId;
- this.shopNames = row.shopName;
- this.dialogFormVisible11 = false;
- },
- refreshShop() {
- this.page = 1;
- this.dataSelect();
- }
- },
- mounted() {
- this.dataSelect();
- },
- created() {
- var userId = this.$cookie.get("userId");
- this.userId = userId;
- this.$http({
- url: this.$http.adornUrl("sys/user/isSuperAdmin"),
- method: "get",
- params: this.$http.adornParams({
- sysUserId: userId
- })
- }).then(({ data }) => {
- console.log(data);
- if (data.code == 0) {
- this.superAdmin = data.superAdmin;
- } else {
- this.$message({
- message: data.msg,
- type: "warning",
- duration: 1500,
- onClose: () => {}
- });
- }
- });
- // 超级管理员 审核中 发布 撤销
- // 已发布 赠送 编辑 删除
- // 已撤销
- // 普通用户 审核中
- // 已发布 赠送 删除
- // 已撤销
- }
- };
- </script>
- <style lang="scss">
- .couponLog {
- width: 60%;
- }
- .discount {
- width: 1000px;
- .shop {
- .el-tree-node__content {
- .is-leaf.el-tree-node__expand-icon {
- // display: none;
- }
- }
- }
- }
- </style>
|