coupon.vue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753
  1. <template>
  2. <div>
  3. <div style="display: inline-block;float: right;">
  4. <el-button size="mini" type="primary" icon="document" @click="refresh"
  5. >刷新</el-button
  6. >
  7. <el-button
  8. style="margin:0 0 20px 10px;"
  9. size="mini"
  10. type="primary"
  11. icon="document"
  12. @click="classifyStair()"
  13. >添加优惠券</el-button
  14. >
  15. </div>
  16. <el-table v-loading="tableDataLoading" :data="tableData.list">
  17. <!-- <el-table-column type="selection" fixed>
  18. </el-table-column> @selection-change="changeFun"-->
  19. <el-table-column prop="couponId" label="编号" width="80">
  20. </el-table-column>
  21. <el-table-column prop="couponName" label="优惠券名称"> </el-table-column>
  22. <el-table-column prop="couponPicture" label="图片">
  23. <template slot-scope="scope">
  24. <img :src="scope.row.couponPicture" alt="" width="40" height="40" />
  25. </template>
  26. </el-table-column>
  27. <el-table-column prop="money" label="优惠券金额"> </el-table-column>
  28. <el-table-column prop="minMoney" label="最低消费"> </el-table-column>
  29. <el-table-column prop="endDate" label="有效天数"> </el-table-column>
  30. <!-- <el-table-column prop="needIntegral" label="兑换积分">
  31. </el-table-column> -->
  32. <el-table-column label="操作" width="250">
  33. <template slot-scope="scope">
  34. <el-button
  35. style="margin-left:15px;"
  36. size="mini"
  37. type="primary"
  38. icon="document"
  39. @click="songCoupon(scope.row)"
  40. >赠送</el-button
  41. >
  42. <el-button
  43. size="mini"
  44. type="primary"
  45. @click="compile(scope.$index, scope.row)"
  46. >编辑
  47. </el-button>
  48. <el-button size="mini" type="danger" @click="deleteStair(scope.row)"
  49. >删除
  50. </el-button>
  51. </template>
  52. </el-table-column>
  53. </el-table>
  54. <div style="text-align: center;margin-top: 10px;">
  55. <el-pagination
  56. @size-change="handleSizeChange"
  57. @current-change="handleCurrentChange"
  58. :page-sizes="[10, 20, 30, 40]"
  59. :page-size="limit"
  60. :current-page="page"
  61. layout="total,sizes, prev, pager, next"
  62. :total="tableData.totalCount"
  63. >
  64. </el-pagination>
  65. </div>
  66. <!-- 添加优惠券 -->
  67. <el-dialog title="添加优惠券" :visible.sync="dialogFormVisible" center>
  68. <div style="margin-bottom: 10px;">
  69. <span style="width: 200px;display: inline-block;text-align: right;"
  70. >优惠券名称:</span
  71. >
  72. <el-input
  73. style="width:50%;"
  74. v-model="couponName"
  75. type="text"
  76. placeholder="请输入优惠券名称"
  77. ></el-input>
  78. </div>
  79. <div style="margin-bottom: 10px;">
  80. <span style="width: 200px;display: inline-block;text-align: right;"
  81. >图片:</span
  82. >
  83. <!-- <el-input style="width:50%;" v-model="couponPicture" type="text" placeholder="请输入图片"></el-input> -->
  84. <div
  85. style=" width:148px;height:148px;background-color: #fbfdff; border: 1px dashed #c0ccda;border-radius: 6px;text-align: center;line-height: 148px;display: inline-block;"
  86. >
  87. <el-upload
  88. class="avatar-uploader"
  89. v-model="couponPicture"
  90. :action="Tupiantou"
  91. :show-file-list="false"
  92. :on-success="handleAvatarSuccess1"
  93. :before-upload="beforeAvatarUpload"
  94. >
  95. <img
  96. v-if="couponPicture"
  97. :src="couponPicture"
  98. class="avatar"
  99. style="width: 148px;height: 148px;"
  100. />
  101. <i
  102. v-else
  103. class="el-icon-plus avatar-uploader-icon"
  104. style="font-size: 28px;color: #8c939d"
  105. ></i>
  106. </el-upload>
  107. </div>
  108. </div>
  109. <div style="margin-bottom: 10px;">
  110. <span style="width: 200px;display: inline-block;text-align: right;"
  111. >优惠券金额:</span
  112. >
  113. <el-input
  114. style="width:50%;"
  115. v-model="money"
  116. type="text"
  117. placeholder="请输入优惠券金额"
  118. ></el-input>
  119. </div>
  120. <div style="margin-bottom: 10px;">
  121. <span style="width: 200px;display: inline-block;text-align: right;"
  122. >最低消费:</span
  123. >
  124. <el-input
  125. style="width:50%;"
  126. v-model="minMoney"
  127. type="text"
  128. placeholder="请输入最低消费"
  129. ></el-input>
  130. </div>
  131. <div style="margin-bottom: 10px;">
  132. <span style="width: 200px;display: inline-block;text-align: right;"
  133. >有效天数:</span
  134. >
  135. <el-input
  136. style="width:50%;"
  137. v-model="endDate"
  138. type="text"
  139. placeholder="请输入有效天数"
  140. ></el-input>
  141. </div>
  142. <!-- <div style="margin-bottom: 10px;">
  143. <span style="width: 200px;display: inline-block;text-align: right;">兑换积分:</span>
  144. <el-input style="width:50%;" v-model="needIntegral" type="text" placeholder="请输入兑换积分"></el-input>
  145. </div> -->
  146. <div slot="footer" class="dialog-footer">
  147. <el-button @click="dialogFormVisible = false">取 消</el-button>
  148. <el-button type="primary" @click="StairNoticeTo()">确 定</el-button>
  149. </div>
  150. </el-dialog>
  151. <!-- 修改一级分类 -->
  152. <el-dialog title="修改优惠券" :visible.sync="dialogFormVisible1" center>
  153. <el-form :model="form">
  154. <el-form-item label="优惠券名称:" :label-width="formLabelWidth">
  155. <el-input v-model="form.couponName" style="width:65%;"></el-input>
  156. </el-form-item>
  157. <el-form-item label="图片:" :label-width="formLabelWidth">
  158. <!-- <el-input v-model="form.campusDetails" style="width:65%;"></el-input> -->
  159. <div
  160. style=" width:148px;height:148px;background-color: #fbfdff; border: 1px dashed #c0ccda;border-radius: 6px;text-align: center;line-height: 148px;display: inline-block;"
  161. >
  162. <el-upload
  163. class="avatar-uploader"
  164. v-model="form.couponPicture"
  165. :action="Tupiantou"
  166. :show-file-list="false"
  167. :on-success="handleAvatarSuccess2"
  168. :before-upload="beforeAvatarUpload"
  169. >
  170. <img
  171. v-if="form.couponPicture"
  172. :src="form.couponPicture"
  173. class="avatar"
  174. style="width: 148px;height: 148px;"
  175. />
  176. <i
  177. v-else
  178. class="el-icon-plus avatar-uploader-icon"
  179. style="font-size: 28px;color: #8c939d"
  180. ></i>
  181. </el-upload>
  182. </div>
  183. </el-form-item>
  184. <el-form-item label="优惠券金额:" :label-width="formLabelWidth">
  185. <el-input v-model="form.money" style="width:65%;"></el-input>
  186. </el-form-item>
  187. <el-form-item label="最低消费:" :label-width="formLabelWidth">
  188. <el-input v-model="form.minMoney" style="width:65%;"></el-input>
  189. </el-form-item>
  190. <el-form-item label="有效天数:" :label-width="formLabelWidth">
  191. <el-input v-model="form.endDate" style="width:65%;"></el-input>
  192. </el-form-item>
  193. <!-- <el-form-item label="兑换积分:" :label-width="formLabelWidth">
  194. <el-input v-model="form.needIntegral" style="width:65%;"></el-input>
  195. </el-form-item> -->
  196. </el-form>
  197. <div slot="footer" class="dialog-footer">
  198. <el-button @click="dialogFormVisible1 = false">取 消</el-button>
  199. <el-button type="primary" @click="CompileNoticeTo()">确 定</el-button>
  200. </div>
  201. </el-dialog>
  202. <!-- 赠送优惠券-->
  203. <el-dialog title="赠送优惠券" :visible.sync="dialogFormVisible0" center>
  204. <div style="margin: 10px 0;">
  205. <span style="width: 200px;display: inline-block;text-align: right;"
  206. >选择用户:</span
  207. >
  208. <el-tag
  209. :key="tag"
  210. v-for="(tag, j) in userNameList"
  211. closable
  212. :disable-transitions="false"
  213. @close="couponIdClose1(tag, j)"
  214. >
  215. {{ tag }}
  216. </el-tag>
  217. <el-button class="button-new-tag" size="small" @click="couponIdBtn1()"
  218. >添加</el-button
  219. >
  220. </div>
  221. <div slot="footer" class="dialog-footer">
  222. <el-button @click="dialogFormVisible0 = false">取 消</el-button>
  223. <el-button type="primary" @click="songNoticeTo()">确 定</el-button>
  224. </div>
  225. </el-dialog>
  226. <!-- 用户列表 -->
  227. <el-dialog title="用户列表" :visible.sync="dialogFormVisible5" center>
  228. <el-input
  229. style="width: 150px;"
  230. @keydown.enter.native="select1"
  231. clearable
  232. placeholder="请输入手机号"
  233. v-model="phone"
  234. >
  235. </el-input
  236. >&nbsp;&nbsp;&nbsp;&nbsp;
  237. <el-input
  238. style="width: 150px;"
  239. @keydown.enter.native="select1"
  240. clearable
  241. placeholder="请输入昵称"
  242. v-model="nickName"
  243. >
  244. </el-input>
  245. <div style="display: inline-block;">
  246. <el-button
  247. style="margin-left:15px;"
  248. size="mini"
  249. type="primary"
  250. icon="document"
  251. @click="select1"
  252. >查询</el-button
  253. >
  254. <el-button
  255. style="margin-left:15px;"
  256. size="mini"
  257. type="primary"
  258. icon="document"
  259. @click="cleans1"
  260. >重置</el-button
  261. >
  262. </div>
  263. <el-button
  264. style="margin-left:15px;"
  265. :disabled="userIdList.length <= 0"
  266. size="mini"
  267. type="primary"
  268. icon="document"
  269. @click="closes2()"
  270. >确定</el-button
  271. >
  272. <el-table
  273. v-loading="tableDataLoading1"
  274. @selection-change="changeFun1"
  275. :data="userData.list"
  276. :row-key="
  277. row => {
  278. return row.userId;
  279. }
  280. "
  281. >
  282. <el-table-column :reserve-selection="true" type="selection" fixed>
  283. </el-table-column>
  284. <el-table-column prop="userId" label="编号"> </el-table-column>
  285. <el-table-column fixed prop="nickName" label="昵称">
  286. <template slot-scope="scope">
  287. <span style="color: #f56c6c;">{{
  288. scope.row.nickName ? scope.row.nickName : "未设置"
  289. }}</span>
  290. </template>
  291. </el-table-column>
  292. <el-table-column label="图像">
  293. <template slot-scope="scope">
  294. <img
  295. v-if="scope.row.avatar == null"
  296. src="~@/assets/img/avatar.png"
  297. alt=""
  298. width="40"
  299. height="40"
  300. />
  301. <img v-else :src="scope.row.avatar" alt="" width="40" height="40" />
  302. </template>
  303. </el-table-column>
  304. <el-table-column prop="phone" label="手机号" width="120">
  305. <template slot-scope="scope">
  306. <span style="color: #4f9dec;cursor: pointer;">{{
  307. scope.row.phone ? scope.row.phone : "未绑定"
  308. }}</span>
  309. </template>
  310. </el-table-column>
  311. <el-table-column prop="platform" label="来源"> </el-table-column>
  312. <el-table-column prop="createTime" label="创建时间"> </el-table-column>
  313. </el-table>
  314. <div style="text-align: center;margin-top: 10px;">
  315. <el-pagination
  316. @size-change="handleSizeChange2"
  317. @current-change="handleCurrentChange2"
  318. :page-sizes="[5, 10, 15, 20]"
  319. :page-size="size1"
  320. :current-page="page1"
  321. layout="total,sizes, prev, pager, next,jumper"
  322. :total="userData.totalCount"
  323. >
  324. </el-pagination>
  325. </div>
  326. </el-dialog>
  327. </div>
  328. </template>
  329. <script>
  330. export default {
  331. data() {
  332. return {
  333. limit: 10,
  334. page: 1,
  335. size1: 10,
  336. page1: 1,
  337. checkBoxData: [], //多选框选择的值
  338. formLabelWidth: "200px",
  339. tableDataLoading: false,
  340. dialogFormVisible: false,
  341. dialogFormVisible1: false,
  342. dialogFormVisible0: false,
  343. dialogFormVisible5: false,
  344. tableDataLoading1: false,
  345. tableData: [],
  346. couponName: "",
  347. couponPicture: "",
  348. endDate: "",
  349. minMoney: "",
  350. money: "",
  351. needIntegral: "",
  352. form: {
  353. couponId: "",
  354. couponName: "",
  355. couponPicture: "",
  356. endDate: "",
  357. minMoney: "",
  358. money: "",
  359. needIntegral: ""
  360. },
  361. userNameList: [],
  362. userIdList: [],
  363. userData: [],
  364. phone: "",
  365. nickName: "",
  366. couponId: "",
  367. shopId: "",
  368. content: ""
  369. };
  370. },
  371. methods: {
  372. // 多选
  373. changeFun(val) {
  374. this.checkBoxData = val;
  375. },
  376. handleSizeChange(val) {
  377. this.limit = val;
  378. this.dataSelect();
  379. },
  380. handleCurrentChange(val) {
  381. this.page = val;
  382. this.dataSelect();
  383. },
  384. handleSizeChange2(val) {
  385. this.size1 = val;
  386. this.dataSelect1();
  387. },
  388. handleCurrentChange2(val) {
  389. this.page1 = val;
  390. this.dataSelect1();
  391. },
  392. beforeAvatarUpload(file) {
  393. return this.$processImage(this, file, false);
  394. },
  395. handleAvatarSuccess1(file, fileList) {
  396. this.couponPicture = file.data;
  397. },
  398. handleAvatarSuccess2(file, fileList) {
  399. this.form.couponPicture = file.data;
  400. },
  401. // 刷新
  402. refresh() {
  403. this.page = 1;
  404. this.dataSelect();
  405. },
  406. // 添加优惠券弹框
  407. classifyStair() {
  408. this.couponName = "";
  409. this.couponPicture = "";
  410. this.endDate = "";
  411. this.minMoney = "";
  412. this.money = "";
  413. this.needIntegral = "";
  414. this.dialogFormVisible = true;
  415. },
  416. // 添加优惠券
  417. StairNoticeTo() {
  418. if (this.campusName == "") {
  419. this.$notify({
  420. title: "提示",
  421. duration: 1800,
  422. message: "请输入优惠券名称",
  423. type: "warning"
  424. });
  425. return;
  426. }
  427. if (this.campusDetails == "") {
  428. this.$notify({
  429. title: "提示",
  430. duration: 1800,
  431. message: "请输入优惠券地址",
  432. type: "warning"
  433. });
  434. return;
  435. }
  436. if (this.money == "") {
  437. this.$notify({
  438. title: "提示",
  439. duration: 1800,
  440. message: "请输入优惠券金额",
  441. type: "warning"
  442. });
  443. return;
  444. }
  445. if (this.minMoney == "") {
  446. this.$notify({
  447. title: "提示",
  448. duration: 1800,
  449. message: "请输入最低消费",
  450. type: "warning"
  451. });
  452. return;
  453. }
  454. if (this.endDate == "") {
  455. this.$notify({
  456. title: "提示",
  457. duration: 1800,
  458. message: "请输入有效天数",
  459. type: "warning"
  460. });
  461. return;
  462. }
  463. this.$http({
  464. url: this.$http.adornUrl("admin/coupon/issueCoupon"),
  465. method: "post",
  466. data: this.$http.adornData({
  467. couponName: this.couponName,
  468. couponPicture: this.couponPicture,
  469. endDate: this.endDate,
  470. minMoney: this.minMoney,
  471. money: this.money,
  472. needIntegral: this.needIntegral,
  473. shopId: this.shopId
  474. })
  475. }).then(({ data }) => {
  476. if (data.code == 0) {
  477. this.dialogFormVisible = false;
  478. this.$message({
  479. message: "添加成功",
  480. type: "success",
  481. duration: 1500,
  482. onClose: () => {
  483. this.dataSelect();
  484. }
  485. });
  486. } else {
  487. this.$message({
  488. message: data.msg,
  489. type: "warning",
  490. duration: 1500,
  491. onClose: () => {}
  492. });
  493. }
  494. });
  495. },
  496. // 修改优惠券
  497. compile(index, rows) {
  498. this.form.couponName = rows.couponName;
  499. this.form.couponPicture = rows.couponPicture;
  500. this.form.endDate = rows.endDate;
  501. this.form.minMoney = rows.minMoney;
  502. this.form.money = rows.money;
  503. this.form.needIntegral = rows.needIntegral;
  504. this.form.couponId = rows.couponId;
  505. this.dialogFormVisible1 = true;
  506. },
  507. // 修改优惠券
  508. CompileNoticeTo() {
  509. this.$http({
  510. url: this.$http.adornUrl("admin/coupon/updateCoupon"),
  511. method: "post",
  512. data: this.$http.adornData({
  513. couponId: this.form.couponId,
  514. couponName: this.form.couponName,
  515. couponPicture: this.form.couponPicture,
  516. endDate: this.form.endDate,
  517. minMoney: this.form.minMoney,
  518. money: this.form.money,
  519. needIntegral: this.form.needIntegral,
  520. shopId: this.shopId
  521. })
  522. }).then(({ data }) => {
  523. if (data.code == 0) {
  524. this.$message({
  525. message: "操作成功",
  526. type: "success",
  527. duration: 1500,
  528. onClose: () => {
  529. this.dialogFormVisible1 = false;
  530. this.dataSelect();
  531. }
  532. });
  533. } else {
  534. this.$message({
  535. message: data.msg,
  536. type: "error",
  537. duration: 1500,
  538. onClose: () => {
  539. this.dialogFormVisible1 = false;
  540. this.dataSelect();
  541. }
  542. });
  543. }
  544. });
  545. },
  546. //删除
  547. deleteStair(row) {
  548. this.$confirm(`确定删除此条信息?`, "提示", {
  549. confirmButtonText: "确定",
  550. cancelButtonText: "取消",
  551. type: "warning"
  552. })
  553. .then(() => {
  554. this.$http({
  555. url: this.$http.adornUrl("admin/coupon/deleteCoupon"),
  556. method: "post",
  557. params: this.$http.adornParams({
  558. couponId: row.couponId
  559. })
  560. }).then(({ data }) => {
  561. if (data.code == 0) {
  562. this.$message({
  563. message: "删除成功",
  564. type: "success",
  565. duration: 1500,
  566. onClose: () => {
  567. this.dataSelect();
  568. }
  569. });
  570. } else {
  571. this.$message({
  572. message: data.msg,
  573. type: "error",
  574. duration: 1500,
  575. onClose: () => {
  576. this.dataSelect();
  577. }
  578. });
  579. }
  580. });
  581. })
  582. .catch(() => {});
  583. },
  584. // 重置
  585. cleans() {
  586. this.phone = "";
  587. this.status = 0;
  588. this.dataSelect();
  589. },
  590. // 获取派单数据列表
  591. dataSelect() {
  592. this.tableDataLoading = true;
  593. this.$http({
  594. url: this.$http.adornUrl("admin/coupon/seleteAllCoupon"),
  595. method: "get",
  596. params: this.$http.adornParams({
  597. page: this.page,
  598. limit: this.limit,
  599. content: this.content,
  600. shopId: this.shopId
  601. })
  602. }).then(({ data }) => {
  603. this.tableDataLoading = false;
  604. let returnData = data.data;
  605. this.tableData = returnData;
  606. // if(data.data.list.length==0){
  607. // this.page = this.page-1
  608. // this.dataSelect()
  609. // }
  610. });
  611. },
  612. // 赠送优惠券
  613. songCoupon(row) {
  614. this.couponId = row.couponId;
  615. this.userIdList = [];
  616. this.userNameList = [];
  617. this.dialogFormVisible0 = true;
  618. },
  619. // 打开用户列表
  620. couponIdBtn1() {
  621. this.page1 = 1;
  622. this.dataSelect1();
  623. this.dialogFormVisible5 = true;
  624. if (this.userIdList.length == 0) {
  625. this.cleansHc();
  626. }
  627. },
  628. // 清空选中缓存
  629. cleansHc(rows) {
  630. console.log("---", this.$refs.multipleTable);
  631. if (this.$refs.multipleTable) {
  632. this.$refs.multipleTable.clearSelection();
  633. }
  634. },
  635. // 多选用户
  636. changeFun1(val) {
  637. console.log("多选", val);
  638. var userIdList = [];
  639. var userNameList = [];
  640. for (var i in val) {
  641. userIdList.push(val[i].userId);
  642. userNameList.push(val[i].nickName);
  643. }
  644. this.userIdList = userIdList;
  645. this.userNameList = userNameList;
  646. },
  647. // 赠送优惠券
  648. songNoticeTo() {
  649. if (this.userIdList.length == 0) {
  650. this.$notify({
  651. title: "提示",
  652. duration: 1800,
  653. message: "请选择用户",
  654. type: "warning"
  655. });
  656. return;
  657. }
  658. var userIdList = this.userIdList.toString();
  659. this.$http({
  660. url: this.$http.adornUrl("admin/coupon/giveCoupon"),
  661. method: "get",
  662. params: this.$http.adornParams({
  663. userIds: userIdList,
  664. shopId: this.shopId,
  665. couponId: this.couponId
  666. })
  667. }).then(({ data }) => {
  668. this.$message({
  669. message: "操作成功",
  670. type: "success",
  671. duration: 1500,
  672. onClose: () => {
  673. this.userIdList = [];
  674. this.userNameList = [];
  675. this.dataSelect();
  676. }
  677. });
  678. this.dialogFormVisible0 = false;
  679. });
  680. },
  681. // 获取用户数据列表
  682. dataSelect1() {
  683. let phone = -1;
  684. if (this.phone) {
  685. phone = this.phone;
  686. }
  687. this.tableDataLoading1 = true;
  688. this.$http({
  689. url: this.$http.adornUrl("user/selectUserList"),
  690. method: "get",
  691. params: this.$http.adornParams({
  692. page: this.page1,
  693. limit: this.size1,
  694. shopAdminFlag: "",
  695. phone: this.phone,
  696. userName: this.nickName,
  697. type: ""
  698. })
  699. }).then(({ data }) => {
  700. this.tableDataLoading1 = false;
  701. let returnData = data.data;
  702. this.userData = returnData;
  703. });
  704. },
  705. // 查询
  706. select1() {
  707. this.page1 = 1;
  708. this.dataSelect1();
  709. },
  710. // 重置
  711. cleans1() {
  712. this.page1 = 1;
  713. this.phone = "";
  714. this.nickName = "";
  715. this.dataSelect1();
  716. },
  717. couponIdClose1(ietm, index) {
  718. console.log("index", index, "ietm", ietm, this.userIdList.length);
  719. if (this.userIdList.length < 2) {
  720. this.$message({
  721. title: "提示",
  722. type: "error",
  723. duration: 1800,
  724. message: "最少需要选中一位用户",
  725. type: "warning"
  726. });
  727. return;
  728. } else {
  729. this.userIdList.splice(index, 1);
  730. this.userNameList.splice(index, 1);
  731. }
  732. },
  733. // 批量开启
  734. closes2(id) {
  735. this.isCoupon = 1;
  736. this.dialogFormVisible5 = false;
  737. }
  738. },
  739. mounted() {
  740. this.shopId = this.$cookie.get("shopId");
  741. this.dataSelect();
  742. }
  743. };
  744. </script>
  745. <style></style>