| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480 |
- <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 title="添加优惠券" :visible.sync="dialogFormVisible" center>
- <div style="margin-bottom: 10px;" v-if="this.shopId == -1">
- <span style="width: 200px;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: 200px;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: 200px;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: 200px;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: 200px;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: 200px;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: 200px;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: 142px;"
- >兑换积分初始值为100,是必填项,不填则默认向所有用户发券</span
- >
- <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 title="修改优惠券" :visible.sync="dialogFormVisible1" center>
- <el-form :model="form">
- <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: 120px;"
- >兑换积分初始值为100,是必填项,不填则默认向所有用户发券</span
- >
- </el-form>
- <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",
- 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 = "";
- if (this.shopId === 0) {
- this.shopIds = 0;
- } else {
- this.shopIds = "";
- }
- 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.needIntegral == "") {
- this.$notify({
- title: "提示",
- duration: 1800,
- message: "请输入兑换积分",
- type: "warning"
- });
- return;
- }
- }
- 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
- })
- }).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: () => {}
- });
- }
- });
- },
- // 修改优惠券
- compile(index, rows) {
- 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;
- },
- // 修改优惠券
- 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.form.needIntegral == "") {
- this.$notify({
- title: "提示",
- duration: 1800,
- message: "请输入兑换积分",
- type: "warning"
- });
- return;
- }
- }
- 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
- })
- }).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%;
- }
- </style>
|