|
|
@@ -17,14 +17,29 @@
|
|
|
<el-table-column type="selection" width="55" align="center"/>
|
|
|
<el-table-column type="index" label="序号" width="60" align="center" />
|
|
|
<el-table-column label="公司名称" prop="companyName" align="center" />
|
|
|
- <el-table-column label="操作" align="center" width="120">
|
|
|
+ <el-table-column label="操作" align="center" width="220">
|
|
|
<template slot-scope="scope">
|
|
|
<el-button
|
|
|
size="mini"
|
|
|
type="text"
|
|
|
@click="handleInputAmount(scope.row)"
|
|
|
+ v-if="scope.row.openRedPacket === 1"
|
|
|
v-hasPermi="['course:period:setCourseRedPacket']"
|
|
|
>设置红包</el-button>
|
|
|
+ <el-button
|
|
|
+ size="mini"
|
|
|
+ type="text"
|
|
|
+ @click="handleOpenRedPacket(scope.row)"
|
|
|
+ v-if="scope.row.openRedPacket === 0"
|
|
|
+ v-hasPermi="['course:period:changeRedPacketState']"
|
|
|
+ >打开红包</el-button>
|
|
|
+ <el-button
|
|
|
+ size="mini"
|
|
|
+ type="text"
|
|
|
+ @click="handleCloseRedPacket(scope.row)"
|
|
|
+ v-if="scope.row.openRedPacket === 1"
|
|
|
+ v-hasPermi="['course:period:changeRedPacketState']"
|
|
|
+ >关闭红包</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
@@ -95,8 +110,8 @@ import {
|
|
|
getPeriodCompanyList,
|
|
|
batchSaveRedPacket,
|
|
|
getPeriodRedPacketList,
|
|
|
- batchSaveRedPacketByCompany
|
|
|
-} from "@/api/course/userCoursePeriod";
|
|
|
+ batchSaveRedPacketByCompany, changeRedPacketState
|
|
|
+} from '@/api/course/userCoursePeriod'
|
|
|
import redPacket from "@/views/course/userCoursePeriod/redPacket.vue";
|
|
|
|
|
|
export default {
|
|
|
@@ -175,6 +190,30 @@ export default {
|
|
|
this.courseDialogVisible = true;
|
|
|
this.getCourseList();
|
|
|
},
|
|
|
+ // 打开红包
|
|
|
+ handleOpenRedPacket(row) {
|
|
|
+ const params = {
|
|
|
+ periodId: this.periodId,
|
|
|
+ companyId: row.companyId,
|
|
|
+ state: 1
|
|
|
+ }
|
|
|
+ changeRedPacketState(params).then(response => {
|
|
|
+ this.msgSuccess(response.msg)
|
|
|
+ this.getCompanyList()
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 关闭红包
|
|
|
+ handleCloseRedPacket(row) {
|
|
|
+ const params = {
|
|
|
+ periodId: this.periodId,
|
|
|
+ companyId: row.companyId,
|
|
|
+ state: 0
|
|
|
+ }
|
|
|
+ changeRedPacketState(params).then(response => {
|
|
|
+ this.msgSuccess(response.msg)
|
|
|
+ this.getCompanyList()
|
|
|
+ })
|
|
|
+ },
|
|
|
// 获取课程列表
|
|
|
getCourseList() {
|
|
|
getPeriodRedPacketList({
|