|
@@ -39,16 +39,12 @@
|
|
prop="num"
|
|
prop="num"
|
|
label="数量"
|
|
label="数量"
|
|
></el-table-column>
|
|
></el-table-column>
|
|
- <el-table-column
|
|
|
|
- align="center"
|
|
|
|
- prop="phone"
|
|
|
|
- label="操作"
|
|
|
|
- >
|
|
|
|
- <template slot-scope="scope">
|
|
|
|
- <div>
|
|
|
|
- {{scope.row.ops?'撤回':'发放'}}
|
|
|
|
- </div>
|
|
|
|
- </template>
|
|
|
|
|
|
+ <el-table-column align="center" prop="phone" label="操作">
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <div>
|
|
|
|
+ {{ scope.row.ops ? "撤回" : "发放" }}
|
|
|
|
+ </div>
|
|
|
|
+ </template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
<el-table-column
|
|
<el-table-column
|
|
align="center"
|
|
align="center"
|
|
@@ -81,7 +77,13 @@
|
|
/>
|
|
/>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
- <el-dialog title="发放名单" :visible.sync="couponDetailVisible" width="1000px" append-to-body v-if="couponDetailVisible">
|
|
|
|
|
|
+ <el-dialog
|
|
|
|
+ title="发放名单"
|
|
|
|
+ :visible.sync="couponDetailVisible"
|
|
|
|
+ width="1000px"
|
|
|
|
+ append-to-body
|
|
|
|
+ v-if="couponDetailVisible"
|
|
|
|
+ >
|
|
<couponGiveChiose :activeRow="activeRows" />
|
|
<couponGiveChiose :activeRow="activeRows" />
|
|
<span slot="footer" class="dialog-footer">
|
|
<span slot="footer" class="dialog-footer">
|
|
<el-button @click="couponDetailVisible = false">取 消</el-button>
|
|
<el-button @click="couponDetailVisible = false">取 消</el-button>
|
|
@@ -97,11 +99,11 @@
|
|
<script>
|
|
<script>
|
|
import pagination from "@/components/Pagination/index";
|
|
import pagination from "@/components/Pagination/index";
|
|
import { getStudentList } from "@/api/vipSeting";
|
|
import { getStudentList } from "@/api/vipSeting";
|
|
-import {getIssueRecord} from './api'
|
|
|
|
-import couponGiveChiose from'./couponGiveChiose'
|
|
|
|
|
|
+import { getIssueRecord, checkRevoke,revokeCoupon } from "./api";
|
|
|
|
+import couponGiveChiose from "./couponGiveChiose";
|
|
export default {
|
|
export default {
|
|
- props:['activeRow'],
|
|
|
|
- components: { pagination,couponGiveChiose },
|
|
|
|
|
|
+ props: ["activeRow"],
|
|
|
|
+ components: { pagination, couponGiveChiose },
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
searchForm: {
|
|
searchForm: {
|
|
@@ -118,8 +120,8 @@ export default {
|
|
total: 0, // 总条数
|
|
total: 0, // 总条数
|
|
page_size: [10, 20, 40, 50], // 选择限制显示条数
|
|
page_size: [10, 20, 40, 50], // 选择限制显示条数
|
|
},
|
|
},
|
|
- couponDetailVisible:false,
|
|
|
|
- activeRows:null
|
|
|
|
|
|
+ couponDetailVisible: false,
|
|
|
|
+ activeRows: null,
|
|
};
|
|
};
|
|
},
|
|
},
|
|
//生命周期 - 创建完成(可以访问当前this实例)
|
|
//生命周期 - 创建完成(可以访问当前this实例)
|
|
@@ -145,7 +147,7 @@ export default {
|
|
...rest,
|
|
...rest,
|
|
page: this.rules.page,
|
|
page: this.rules.page,
|
|
rows: this.rules.limit,
|
|
rows: this.rules.limit,
|
|
- couponId:this.activeRow.id
|
|
|
|
|
|
+ couponId: this.activeRow.id,
|
|
};
|
|
};
|
|
const res = await getIssueRecord(params);
|
|
const res = await getIssueRecord(params);
|
|
this.tableList = res.data.rows;
|
|
this.tableList = res.data.rows;
|
|
@@ -154,10 +156,36 @@ export default {
|
|
console.log(e);
|
|
console.log(e);
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- revokeCoupon(row) {},
|
|
|
|
|
|
+ async revokeCoupon(row) {
|
|
|
|
+ let num = 0;
|
|
|
|
+ try {
|
|
|
|
+ const res = await checkRevoke({ issueId: row.id });
|
|
|
|
+ num = res.data;
|
|
|
|
+ } catch (e) {
|
|
|
|
+ console.log(e);
|
|
|
|
+ }
|
|
|
|
+ let str = "";
|
|
|
|
+ if (num > 0) {
|
|
|
|
+ str = `当前已有${num}学员优惠券已使用,仅可对未使用学员撤回.是否确认继续撤销?`;
|
|
|
|
+ } else {
|
|
|
|
+ str = "是否确认继续撤销?";
|
|
|
|
+ }
|
|
|
|
+ this.$confirm(str, "提示", {
|
|
|
|
+ confirmButtonText: "确定",
|
|
|
|
+ cancelButtonText: "取消",
|
|
|
|
+ }).then(async some=>{
|
|
|
|
+ try{
|
|
|
|
+ const res = await revokeCoupon({issueId: row.id})
|
|
|
|
+ this.$message.success('撤销成功')
|
|
|
|
+ this.getList()
|
|
|
|
+ }catch(e){
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
couponDetail(row) {
|
|
couponDetail(row) {
|
|
this.activeRows = row;
|
|
this.activeRows = row;
|
|
- this.couponDetailVisible = true
|
|
|
|
|
|
+ this.couponDetailVisible = true;
|
|
},
|
|
},
|
|
},
|
|
},
|
|
};
|
|
};
|