Coupon_CreateCoupon.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799
  1. <template>
  2. <div v-if="pageStatus == 0">配置加载中...</div>
  3. <div v-else-if="pageStatus == 1">此页面不对此账号开放</div>
  4. <div v-else-if="pageStatus == 2">
  5. 没有此页内容的配置权限,请检查集团上的配置
  6. </div>
  7. <div v-else-if="pageStatus == 3">加载发生错误</div>
  8. <div v-else-if="pageStatus == 4" class="app-container">
  9. <el-form>
  10. <el-form-item label="启动优惠劵" label-width="88px">
  11. <el-switch
  12. v-model="couponEnabledFlag"
  13. active-value="1"
  14. inactive-value="0"
  15. @change="handleFlagChange()"
  16. ></el-switch>
  17. </el-form-item>
  18. <hr />
  19. </el-form>
  20. <div v-if="couponEnabledFlag == 1">
  21. <el-form
  22. :model="createForm"
  23. ref="createForm"
  24. :inline="true"
  25. label-width="88px"
  26. >
  27. <el-form-item label="设备类型" prop="deviceType">
  28. <el-select
  29. v-model="createForm.deviceType"
  30. clearable
  31. placeholder="请选择"
  32. >
  33. <el-option label="小票打印机" value="1"></el-option>
  34. <el-option label="POS" value="2"></el-option>
  35. </el-select>
  36. </el-form-item>
  37. <el-form-item label="密钥" prop="deviceSerialNum">
  38. <el-input
  39. v-model="createForm.deviceSerialNum"
  40. placeholder="请输入设备密钥"
  41. clearable
  42. size="small"
  43. @keyup.enter.native="handleQuery"
  44. />
  45. </el-form-item>
  46. <el-form-item>
  47. <el-button
  48. type="cyan"
  49. icon="el-icon-search"
  50. size="mini"
  51. @click="handleQuery"
  52. >搜索</el-button
  53. >
  54. <el-button
  55. type="info"
  56. icon="el-icon-refresh"
  57. size="mini"
  58. @click="resetQuery"
  59. >重置</el-button
  60. >
  61. <el-button
  62. type="primary"
  63. icon="el-icon-plus"
  64. size="mini"
  65. @click="handleAdd"
  66. >新增</el-button
  67. >
  68. </el-form-item>
  69. </el-form>
  70. <el-table :data="couponList">
  71. <af-table-column label="优惠券名称" align="center" prop="couponName" />
  72. <af-table-column label="状态" align="center" width="100">
  73. <template slot-scope="scope">
  74. <el-switch
  75. v-model="scope.row.status"
  76. active-value="1"
  77. inactive-value="0"
  78. @change="handleStatusChange(scope.row)"
  79. ></el-switch>
  80. </template>
  81. </af-table-column>
  82. <!-- <af-table-column label="面值" align="center" prop="gunNo" /> -->
  83. <!-- <af-table-column label="有效期" align="center" prop="deviceFactory" /> -->
  84. <af-table-column
  85. label="操作"
  86. align="center"
  87. class-name="small-padding fixed-width"
  88. width="120px"
  89. >
  90. <template slot-scope="scope">
  91. <el-button
  92. size="mini"
  93. type="text"
  94. icon="el-icon-edit"
  95. @click="handleUpdate(scope.row)"
  96. v-if="scope.row.editFlag"
  97. >修改</el-button
  98. >
  99. <!-- <el-button
  100. size="mini"
  101. type="text"
  102. icon="el-icon-delete"
  103. @click="handleDelete(scope.row)"
  104. >删除</el-button
  105. > -->
  106. </template>
  107. </af-table-column>
  108. </el-table>
  109. <pagination
  110. :hidden="total > 0 ? false : true"
  111. :total="total"
  112. :page.sync="queryForm.pageNum"
  113. :limit.sync="queryForm.pageSize"
  114. @pagination="getCoupon"
  115. :autoScroll="true"
  116. />
  117. </div>
  118. <div v-else style="text-align:center">
  119. 亲,您的油站暂未启动优惠券功能,呦~
  120. </div>
  121. <!-- 添加或修改油站设备管理对话框 -->
  122. <el-dialog
  123. :title="title"
  124. :visible.sync="open"
  125. width="600px"
  126. append-to-body
  127. status-icon
  128. >
  129. <el-form
  130. ref="dialogForm"
  131. :model="createForm"
  132. :rules="rules"
  133. label-width="180px"
  134. >
  135. <el-form-item label="优惠劵名称(油站备注)" prop="couponName">
  136. <input
  137. type="text"
  138. class="form-control"
  139. v-model="createForm.couponName"
  140. style="width: 180px"
  141. />
  142. </el-form-item>
  143. <el-form-item label="优惠劵内容(用户展示)" prop="couponDetails">
  144. <input
  145. type="text"
  146. class="form-control"
  147. v-model="createForm.couponDetails"
  148. style="width: 180px"
  149. />
  150. </el-form-item>
  151. <el-form-item label="优惠劵使用条件" prop="couponThresholdAmt">
  152. <div>
  153. <input
  154. type="text"
  155. class="form-control d-inline"
  156. v-model.number="createForm.couponThresholdAmt"
  157. style="width: 100px"
  158. />
  159. 元 可用
  160. </div>
  161. </el-form-item>
  162. <el-form-item label="优惠券类型" prop="couponType">
  163. <el-radio-group v-model="createForm.couponType">
  164. <el-radio label="1">现金券</el-radio>
  165. <el-radio label="2">折扣劵</el-radio>
  166. <el-radio label="3">兑换劵</el-radio>
  167. </el-radio-group>
  168. </el-form-item>
  169. <el-form-item
  170. label="优惠金额"
  171. prop="couponAmt"
  172. v-if="createForm.couponType == 1 || createForm.couponType == 2"
  173. >
  174. <div v-if="createForm.couponType == 1">
  175. 固定面值—<input
  176. type="text"
  177. class="form-control d-inline"
  178. v-model.number="createForm.couponAmt"
  179. style="width: 100px"
  180. />
  181. </div>
  182. <div v-if="createForm.couponType == 2">
  183. 折扣比例—<input
  184. type="text"
  185. class="form-control d-inline"
  186. v-model.number="createForm.couponAmt"
  187. style="width: 100px"
  188. />
  189. %
  190. </div>
  191. </el-form-item>
  192. <el-form-item
  193. label="优惠券适用油品"
  194. prop="oilNameList"
  195. v-if="createForm.couponType == 1 || createForm.couponType == 2"
  196. >
  197. <el-checkbox-group v-model="createForm.oilNameList">
  198. <el-checkbox
  199. :label="ele.oilName"
  200. v-for="ele in oilNameList"
  201. :key="ele.oilName"
  202. ></el-checkbox>
  203. </el-checkbox-group>
  204. </el-form-item>
  205. <el-form-item label="优惠券有效期" prop="effectiveTimeType">
  206. <div>
  207. <div>
  208. <el-radio-group v-model="createForm.effectiveTimeType">
  209. <el-radio label="1">固定时间段</el-radio>
  210. <el-radio label="2">固定天数</el-radio>
  211. </el-radio-group>
  212. </div>
  213. <div style="margin-top: 10px">
  214. <div v-if="createForm.effectiveTimeType == 1">
  215. <el-date-picker
  216. style="margin: 0px 10px; width: 300px"
  217. v-model="createForm.effectiveTime"
  218. type="datetimerange"
  219. value-format="yyyy-MM-dd HH:mm:ss"
  220. size="mini"
  221. range-separator="至"
  222. start-placeholder="开始日期"
  223. end-placeholder="结束日期"
  224. >
  225. </el-date-picker>
  226. </div>
  227. <div
  228. v-if="createForm.effectiveTimeType == 2"
  229. style="margin-left: 20px"
  230. >
  231. 自用户领取后
  232. <input
  233. type="text"
  234. class="form-control d-inline"
  235. v-model.number="createForm.effectiveDayNum"
  236. style="width: 80px"
  237. />
  238. 天内有效
  239. </div>
  240. </div>
  241. </div>
  242. </el-form-item>
  243. <el-form-item label="生成优惠券的数量" prop="couponNum">
  244. 共生成
  245. <input
  246. type="text"
  247. class="form-control d-inline"
  248. v-model.number="createForm.couponNum"
  249. style="width: 100px"
  250. />
  251. </el-form-item>
  252. <el-form-item label="单人可持有数量" prop="couponHoldNum">
  253. 单个用户最多拥有
  254. <input
  255. type="text"
  256. class="form-control d-inline"
  257. v-model.number="createForm.couponHoldNum"
  258. style="width: 100px"
  259. />
  260. 张优惠券
  261. </el-form-item>
  262. <el-form-item label="累计可拥有数量" prop="couponReceiveNum">
  263. 单个用户累计可以拥有
  264. <input
  265. type="text"
  266. class="form-control d-inline"
  267. v-model.number="createForm.couponReceiveNum"
  268. style="width: 100px"
  269. />
  270. 张优惠券
  271. </el-form-item>
  272. <el-form-item
  273. label="用券时可用电子卡"
  274. prop="isCardFlag"
  275. v-if="createForm.couponType == 1 || createForm.couponType == 2"
  276. >
  277. <el-radio-group v-model="createForm.isCardFlag">
  278. <el-radio label="1">可以使用电子卡</el-radio>
  279. <el-radio label="0">不可用电子卡</el-radio>
  280. </el-radio-group>
  281. </el-form-item>
  282. <el-form-item
  283. label="用券时叠加等级优惠"
  284. prop="isGradeFlag"
  285. v-if="createForm.couponType == 1 || createForm.couponType == 2"
  286. >
  287. <el-radio-group v-model="createForm.isGradeFlag">
  288. <el-radio label="1">叠加等级优惠</el-radio>
  289. <el-radio label="0">不叠加等级优惠</el-radio>
  290. </el-radio-group>
  291. </el-form-item>
  292. <el-form-item
  293. label="用劵时叠加优惠方案"
  294. prop="isMakertFlag"
  295. v-if="createForm.couponType == 1 || createForm.couponType == 2"
  296. >
  297. <el-radio-group v-model="createForm.isMakertFlag">
  298. <el-radio label="1">叠加优惠方案</el-radio>
  299. <el-radio label="0">不叠加优惠方案</el-radio>
  300. </el-radio-group>
  301. </el-form-item>
  302. <el-form-item
  303. label="优惠券的核销方"
  304. prop="couponType"
  305. v-if="createForm.couponType == 3"
  306. >
  307. (自己的站点也是核销商)
  308. </el-form-item>
  309. <div v-if="createForm.couponType == 3">
  310. <el-col :span="11">
  311. <el-table
  312. :data="unselectedCouponList"
  313. border
  314. size="mini"
  315. :resizable="false"
  316. highlight-current-row
  317. height="500"
  318. @selection-change="handleLeftChange"
  319. disabled
  320. ref="leftTable"
  321. >
  322. >
  323. <el-table-column label="可选">
  324. <el-table-column
  325. prop="phone"
  326. label="姓名"
  327. type="selection"
  328. ></el-table-column>
  329. <el-table-column prop="deptName" label="机构"></el-table-column>
  330. <el-table-column label="添加" width="60px" align="center">
  331. <template slot-scope="scope">
  332. <el-button
  333. type="text"
  334. icon="el-icon-circle-plus-outline"
  335. class="underline btn24"
  336. size="mini"
  337. @click="handleMoveLabel('right', scope.row)"
  338. >添加</el-button
  339. >
  340. </template>
  341. </el-table-column>
  342. </el-table-column>
  343. </el-table>
  344. </el-col>
  345. <el-col :span="2" style="text-align: center">
  346. <el-button
  347. type="primary"
  348. size="mini"
  349. @click="toggleLabel"
  350. style="
  351. margin-top: 200px;
  352. text-align: center;
  353. width: 30px;
  354. padding-right: 0;
  355. padding-left: 0;
  356. "
  357. :disabled="toggleable"
  358. >切换</el-button
  359. >
  360. </el-col>
  361. <el-col :span="11">
  362. <el-table
  363. :data="selectedCouponList"
  364. border
  365. size="mini"
  366. highlight-current-row
  367. :resizable="false"
  368. height="500"
  369. @selection-change="handleRightChange"
  370. :loading="true"
  371. ref="rightTable"
  372. >
  373. <el-table-column label="已选" :resizable="false">
  374. <el-table-column
  375. prop="phone"
  376. type="selection"
  377. ></el-table-column>
  378. <el-table-column prop="deptName" label="姓名"></el-table-column>
  379. <el-table-column label="移除" width="60px" align="center">
  380. <template slot-scope="scope">
  381. <el-button
  382. type="text"
  383. icon="el-icon-remove-outline"
  384. class="underline btn24"
  385. size="mini"
  386. @click="handleMoveLabel('left', scope.row)"
  387. >移除</el-button
  388. >
  389. </template>
  390. </el-table-column>
  391. </el-table-column>
  392. </el-table>
  393. </el-col>
  394. </div>
  395. </el-form>
  396. <div slot="footer" class="dialog-footer">
  397. <el-button type="primary" @click="submitForm">确 定</el-button>
  398. <el-button @click="cancel">取 消</el-button>
  399. </div>
  400. </el-dialog>
  401. </div>
  402. </template>
  403. <script>
  404. import {
  405. listManage,
  406. getManage,
  407. delManage,
  408. addManage,
  409. updateManage,
  410. exportManage,
  411. changeManageStatus,
  412. } from "@/api/station/manage";
  413. import { listGun } from "@/api/station/gun";
  414. import { listPrice } from "@/api/station/price";
  415. import { addInfo, verificationList, listInfo, updateInfo, changeCouponStatus } from "@/api/coupon";
  416. import { updateDept } from "@/api/system/dept";
  417. export default {
  418. name: "Station_Equipment",
  419. data() {
  420. let validateGunNo = (rule, value, callback) => {
  421. callback();
  422. };
  423. return {
  424. couponEnabledFlag: "1",
  425. pageStatus: 4,
  426. // 油站设备管理表格数据
  427. createForm: {
  428. couponName: "",
  429. couponDetails: "",
  430. couponThresholdAmt: 0,
  431. couponType: "1",
  432. couponAmt: 0,
  433. oilNameList: [],
  434. effectiveTimeType: "", //有效时间类型: 1,固定时间;2,领取后x天内有效
  435. effectiveTime: [],
  436. effectiveDayNum: 30,
  437. couponHoldNum: 1,
  438. couponReceiveNum: 100,
  439. couponNum: 100,
  440. status: "1",
  441. verificationList: [],
  442. isCardFlag: "1",
  443. isGradeFlag: "1",
  444. isMakertFlag: "1",
  445. },
  446. couponList: [],
  447. oilNameList: [],
  448. allVerificationList: [
  449. ],
  450. equipmentList: [],
  451. // 油枪复选
  452. allGunList: [],
  453. // 已选的油枪
  454. checkedGunList: [],
  455. //设备状态
  456. deviceStatusOptions: [],
  457. //设备类型
  458. deviceTypeOptions: [],
  459. stationOptions: [],
  460. // 弹出层标题
  461. title: "",
  462. // 是否显示弹出层
  463. open: false,
  464. // 总条数
  465. total: 100,
  466. leftQuery: {},
  467. rightQuery: {},
  468. leftData: [],
  469. rightData: [],
  470. moveRightData: [],
  471. moveLeftData: [],
  472. // 查询参数
  473. queryForm: {
  474. pageNum: 1,
  475. pageSize: 10, // 初始值只能比10大
  476. },
  477. // 表单校验
  478. rules: {},
  479. };
  480. },
  481. created() {
  482. this.init();
  483. this.getCoupon();
  484. this.setPageStatus();
  485. },
  486. computed: {
  487. toggleable() {
  488. if (this.moveRightData.length === 0 && this.moveLeftData.length === 0) {
  489. return true;
  490. }
  491. return false;
  492. },
  493. selectedCouponList() {
  494. return this.allVerificationList.filter((ele) => {
  495. if(this.createForm.verificationList == null) {
  496. this.createForm.verificationList = [];
  497. }
  498. return this.createForm.verificationList.includes(ele.deptId);
  499. });
  500. },
  501. unselectedCouponList() {
  502. return this.allVerificationList.filter((ele) => {
  503. if(this.createForm.verificationList == null) {
  504. this.createForm.verificationList = [];
  505. }
  506. return !!!this.createForm.verificationList.includes(ele.deptId);
  507. });
  508. },
  509. getTodayDateString() {
  510. const today = new Date();
  511. return;
  512. },
  513. },
  514. methods: {
  515. handleMoveLabel(direction, row){
  516. console.log(row)
  517. if(this.createForm.verificationList == null) {
  518. this.createForm.verificationList = [];
  519. }
  520. if(direction == "right"){
  521. this.createForm.verificationList.push(row.deptId)
  522. }else{
  523. this.createForm.verificationList = this.createForm.verificationList.filter((ele)=>{
  524. return ele != row.deptId
  525. })
  526. }
  527. },
  528. handleFlagChange() {
  529. const that = this
  530. let text = this.couponEnabledFlag === "1" ? "启用" : "停用";
  531. this.$confirm('确认要"' + text + '"优惠券功能吗?', "警告", {
  532. confirmButtonText: "确定",
  533. cancelButtonText: "取消",
  534. type: "warning",
  535. })
  536. .then(function () {
  537. return changeCouponStatus({
  538. deptId: that.deptId,
  539. couponEnabledFlag: that.couponEnabledFlag,
  540. });
  541. })
  542. .then(() => {
  543. that.msgSuccess(text + "成功");
  544. })
  545. .catch(function () {
  546. that.couponEnabledFlag = that.couponEnabledFlag === "0" ? "1" : "0";
  547. });
  548. },
  549. handleStatusChange(row) {
  550. let text = row.status === "1" ? "启用" : "停用";
  551. this.$confirm(
  552. '确认要"' + text + '""' + row.couponName + '"该优惠券吗?',
  553. "警告",
  554. {
  555. confirmButtonText: "确定",
  556. cancelButtonText: "取消",
  557. type: "warning",
  558. }
  559. )
  560. .then(function () {
  561. return updateInfo({
  562. id: row.id,
  563. status: row.status,
  564. });
  565. })
  566. .then(() => {
  567. this.msgSuccess(text + "成功");
  568. })
  569. .catch(function () {
  570. row.status = row.status === "0" ? "1" : "0";
  571. });
  572. },
  573. getOilList() {
  574. listPrice()
  575. .then((res) => {
  576. if (res.code == 200) {
  577. this.oilNameList = res.rows || [];
  578. } else {
  579. throw new Error("");
  580. }
  581. })
  582. .catch((err) => {
  583. this.msgError("亲,拉取油品列表失败~");
  584. });
  585. },
  586. getCoupon() {
  587. listInfo({
  588. pageNum: 1,
  589. pageSize: 10,
  590. })
  591. .then((res) => {
  592. if (res.code == 200) {
  593. console.log(res);
  594. if (res.rows == null) {
  595. this.total = 0;
  596. this.couponList = [];
  597. } else {
  598. this.total = res.total;
  599. this.couponList = res.rows;
  600. }
  601. } else {
  602. throw new Error("");
  603. }
  604. })
  605. .catch((err) => {
  606. this.msgError("亲,拉取优惠券列表失败~");
  607. });
  608. },
  609. getVerificationList() {
  610. verificationList({
  611. pageNum: 1,
  612. pageSize: 1000,
  613. })
  614. .then((res) => {
  615. if (res.code == 200) {
  616. if (res.rows == null) {
  617. this.allVerificationList = [];
  618. } else {
  619. this.allVerificationList = res.rows;
  620. }
  621. } else {
  622. throw new Error("");
  623. }
  624. })
  625. .catch((err) => {
  626. this.msgError("亲,拉取核销机构失败~");
  627. });
  628. },
  629. toggleLabel() {
  630. if (this.moveLeftData.length !== 0) {
  631. this.createForm.verificationList =
  632. this.createForm.verificationList.filter((ele) => {
  633. return ele != this.moveLeftData;
  634. });
  635. this.createForm = { ...this.createForm };
  636. return;
  637. }
  638. if (this.moveRightData.length !== 0) {
  639. this.createForm.verificationList = [
  640. ...new Set(
  641. this.createForm.verificationList.concat(this.moveRightData)
  642. ),
  643. ].filter((ele) => {
  644. return !!ele;
  645. });
  646. this.createForm = { ...this.createForm };
  647. return;
  648. }
  649. return;
  650. },
  651. handleLeftChange(val) {
  652. let changeArr = [];
  653. val.map((ele) => {
  654. changeArr.push(ele.deptId);
  655. });
  656. console.log(changeArr);
  657. this.moveLeftData = [];
  658. this.moveRightData = changeArr;
  659. // console.log(this.moveRightData);
  660. this.$refs.rightTable.clearSelection();
  661. },
  662. handleRightChange(val) {
  663. let changeArr = [];
  664. val.map((ele) => {
  665. changeArr.push(ele.deptId);
  666. });
  667. this.moveLeftData = changeArr;
  668. this.moveRightData = [];
  669. this.$refs.leftTable.clearSelection();
  670. },
  671. init() {
  672. this.getOilList();
  673. this.getCoupon();
  674. this.getVerificationList();
  675. },
  676. setPageStatus() {
  677. this.queryPageStatus([2]).then((res) => {
  678. this.pageStatus = res;
  679. });
  680. },
  681. // 取消按钮
  682. cancel() {
  683. this.open = false;
  684. },
  685. /** 搜索按钮操作 */
  686. handleQuery() {
  687. this.createForm.pageNum = 1;
  688. this.getList();
  689. },
  690. deviceNoInput(value) {
  691. this.dialogForm.posQueue = value;
  692. },
  693. /** 重置按钮操作 */
  694. resetQuery() {
  695. this.resetForm("createForm");
  696. this.handleQuery();
  697. },
  698. /** 新增按钮操作 */
  699. handleAdd() {
  700. this.title = "添加优惠券";
  701. this.createForm = {
  702. couponName: "",
  703. couponDetails: "",
  704. couponThresholdAmt: 0,
  705. couponType: "1",
  706. couponAmt: 0,
  707. oilNameList: [],
  708. effectiveTimeType: "",
  709. effectiveTime: [],
  710. effectiveDayNum: 30,
  711. couponHoldNum: 1,
  712. couponReceiveNum: 100,
  713. couponNum: 100,
  714. status: "1",
  715. verificationList: [],
  716. isCardFlag: "1",
  717. isGradeFlag: "1",
  718. isMakertFlag: "1",
  719. }
  720. this.open = true;
  721. },
  722. /** 修改按钮操作 */
  723. handleUpdate(row) {
  724. // // 查找自己已经选中的枪号
  725. this.createForm = JSON.parse(JSON.stringify(row));
  726. this.title = "修改油站设备管理";
  727. this.open = true;
  728. },
  729. /** 提交按钮 */
  730. submitForm() {
  731. this.$refs["dialogForm"].validate((valid) => {
  732. if (valid) {
  733. if(!!this.createForm.id){
  734. updateInfo(this.createForm).then((res) => {
  735. if(res.code == 200){
  736. this.msgSuccess("亲,修改成功了~")
  737. this.getCoupon()
  738. this.open = false
  739. }else{
  740. throw new Error("");
  741. }
  742. }).catch((err) => {
  743. this.msgError("修改失败了呀~")
  744. });
  745. }else{
  746. addInfo(this.createForm).then((res) => {
  747. if(res.code == 200){
  748. this.msgSuccess("亲,新增成功了~")
  749. this.getCoupon()
  750. this.open = false
  751. }else{
  752. throw new Error("");
  753. }
  754. }).catch((err)=>{
  755. this.msgError("创建优惠劵失败了~")
  756. });
  757. }
  758. }
  759. });
  760. },
  761. /** 删除按钮操作 */
  762. handleDelete(row) {
  763. const deviceIds = row.deviceId;
  764. this.$confirm("是否确认删除油站设备管理", "警告", {
  765. confirmButtonText: "确定",
  766. cancelButtonText: "取消",
  767. type: "warning",
  768. })
  769. .then(function () {
  770. return delManage(deviceIds);
  771. })
  772. .then(() => {
  773. this.getList();
  774. this.msgSuccess("删除成功");
  775. });
  776. },
  777. },
  778. };
  779. </script>
  780. <style lang="scss">
  781. .el-transfer__buttons {
  782. }
  783. </style>