|
@@ -164,6 +164,7 @@
|
|
<el-table-column type="selection" width="55" align="center" />
|
|
<el-table-column type="selection" width="55" align="center" />
|
|
<el-table-column label="营期名称" align="center" prop="periodName" />
|
|
<el-table-column label="营期名称" align="center" prop="periodName" />
|
|
<el-table-column label="公司名称" align="center" prop="companyName" />
|
|
<el-table-column label="公司名称" align="center" prop="companyName" />
|
|
|
|
+ <el-table-column label="营期状态" align="center" prop="periodStatus" width="100" :formatter="periodStatusFormatter" />
|
|
<el-table-column label="开营开始时间" align="center" prop="periodStartingTime" width="180" />
|
|
<el-table-column label="开营开始时间" align="center" prop="periodStartingTime" width="180" />
|
|
<el-table-column label="开营结束时间" align="center" prop="periodEndTime" width="180" />
|
|
<el-table-column label="开营结束时间" align="center" prop="periodEndTime" width="180" />
|
|
<el-table-column label="创建时间" align="center" prop="createTime" width="180" />
|
|
<el-table-column label="创建时间" align="center" prop="createTime" width="180" />
|
|
@@ -402,6 +403,22 @@
|
|
<el-table-column label="小节" align="center" prop="videoName" />
|
|
<el-table-column label="小节" align="center" prop="videoName" />
|
|
<el-table-column label="营期时间" align="center" prop="dayDate" width="150" />
|
|
<el-table-column label="营期时间" align="center" prop="dayDate" width="150" />
|
|
<el-table-column label="创建时间" align="center" prop="createTime" width="150" />
|
|
<el-table-column label="创建时间" align="center" prop="createTime" width="150" />
|
|
|
|
+ <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <el-button
|
|
|
|
+ size="mini"
|
|
|
|
+ type="text"
|
|
|
|
+ icon="el-icon-top"
|
|
|
|
+ @click="handleTop(scope.row)"
|
|
|
|
+ >上移</el-button>
|
|
|
|
+ <el-button
|
|
|
|
+ size="mini"
|
|
|
|
+ type="text"
|
|
|
|
+ icon="el-icon-bottom"
|
|
|
|
+ @click="handleBottom(scope.row)"
|
|
|
|
+ >下移</el-button>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
</el-table>
|
|
</el-table>
|
|
</el-tab-pane>
|
|
</el-tab-pane>
|
|
<el-tab-pane label="公司列表" name="company">
|
|
<el-tab-pane label="公司列表" name="company">
|
|
@@ -432,7 +449,7 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
-import {addPeriod, delPeriod, exportPeriod, getPeriod, pagePeriod, updatePeriod, getDays, addCourse, updateListCourseData} from "@/api/course/userCoursePeriod";
|
|
|
|
|
|
+import {addPeriod, delPeriod, exportPeriod, getPeriod, pagePeriod, updatePeriod, getDays, addCourse, updateListCourseData, periodCourseMove} from "@/api/course/userCoursePeriod";
|
|
import {getCompanyList} from "@/api/company/company";
|
|
import {getCompanyList} from "@/api/company/company";
|
|
import { listCamp, addCamp, editCamp, delCamp, copyCamp } from "@/api/course/userCourseCamp";
|
|
import { listCamp, addCamp, editCamp, delCamp, copyCamp } from "@/api/course/userCourseCamp";
|
|
import { courseList,videoList } from '@/api/course/courseRedPacketLog'
|
|
import { courseList,videoList } from '@/api/course/courseRedPacketLog'
|
|
@@ -1152,6 +1169,71 @@ export default {
|
|
this.redPacketVisible = true;
|
|
this.redPacketVisible = true;
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ /** 上移课程 */
|
|
|
|
+ handleTop(row) {
|
|
|
|
+ const currentIndex = this.course.list.findIndex(item => item.id === row.id);
|
|
|
|
+ if (currentIndex <= 0) {
|
|
|
|
+ this.$message.warning('已经是第一条数据');
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // 获取上一条数据
|
|
|
|
+ const prevRow = this.course.list[currentIndex - 1];
|
|
|
|
+ console.log({
|
|
|
|
+ id: row.id,
|
|
|
|
+ targetId: prevRow.id,
|
|
|
|
+ type: 1 //上移
|
|
|
|
+ })
|
|
|
|
+ periodCourseMove({
|
|
|
|
+ id: row.id,
|
|
|
|
+ targetId: prevRow.id,
|
|
|
|
+ type: 1 //上移
|
|
|
|
+ }).then(response => {
|
|
|
|
+ if (response.code === 200) {
|
|
|
|
+ this.$message.success('上移成功');
|
|
|
|
+ this.getCourseList();
|
|
|
|
+ } else {
|
|
|
|
+ this.$message.error(response.msg || '上移失败');
|
|
|
|
+ }
|
|
|
|
+ }).catch(() => {
|
|
|
|
+ this.$message.error('上移失败');
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ /** 下移课程 */
|
|
|
|
+ handleBottom(row) {
|
|
|
|
+ const currentIndex = this.course.list.findIndex(item => item.id === row.id);
|
|
|
|
+ if (currentIndex === -1 || currentIndex >= this.course.list.length - 1) {
|
|
|
|
+ this.$message.warning('已经是最后一条数据');
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // 获取下一条数据
|
|
|
|
+ const nextRow = this.course.list[currentIndex + 1];
|
|
|
|
+
|
|
|
|
+ periodCourseMove({
|
|
|
|
+ id: row.id,
|
|
|
|
+ targetId: nextRow.id,
|
|
|
|
+ type: 2 //下移
|
|
|
|
+ }).then(response => {
|
|
|
|
+ if (response.code === 200) {
|
|
|
|
+ this.$message.success('下移成功');
|
|
|
|
+ this.getCourseList(); // 重新加载列表
|
|
|
|
+ } else {
|
|
|
|
+ this.$message.error(response.msg || '下移失败');
|
|
|
|
+ }
|
|
|
|
+ }).catch(() => {
|
|
|
|
+ this.$message.error('下移失败');
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ /** 营期状态格式化 */
|
|
|
|
+ periodStatusFormatter(row) {
|
|
|
|
+ const statusMap = {
|
|
|
|
+ 1: '未开始',
|
|
|
|
+ 2: '进行中',
|
|
|
|
+ 3: '已结束'
|
|
|
|
+ };
|
|
|
|
+ return statusMap[row.periodStatus] || '未知状态';
|
|
|
|
+ },
|
|
},
|
|
},
|
|
};
|
|
};
|
|
</script>
|
|
</script>
|