Browse Source

修改添加课程

qaz 1 ngày trước cách đây
mục cha
commit
50b27e294b

+ 1 - 1
.env.development

@@ -5,7 +5,7 @@ ENV = 'development'
 #线下:http://192.168.100.187:8083
 # 本地环境接口地址 121.36.251.245
 
-VITE_API_URL = 'http://1.94.168.85:8086'
+VITE_API_URL = 'http://192.168.100.101:8086'
 # VITE_API_URL = 'http://192.168.100.187:9084'
 # VITE_API_URL = 'https://backend.qicai321.com'
 VITE_API_WX_URL='https://api.weixin.qq.com/'

+ 7 - 2
src/views/system/timetablemanage/AdditionDialog/index.vue

@@ -59,7 +59,7 @@
 
 <script setup lang="ts">
 import { ref, defineExpose,onMounted } from 'vue';
-import {AddObj,getTeacherList,UpdateObj} from '../api';
+import {AddObj,getTeacherList,UpdateObj,CopyList} from '../api';
 import { ElMessage } from 'element-plus';
 
 const teacherList = ref<any[]>([]);
@@ -140,7 +140,12 @@ async function save() {
       if (isEdit) {
           await UpdateObj(form.value);
       }else{
-          await AddObj(form.value); 
+          await AddObj(form.value);
+          // 在添加成功后调用CopyList
+          await CopyList({
+            source_date: form.value.class_date,
+            mode: "rest_of_semester"
+          });
       }
       visible.value = false;
       ElMessage.success(isEdit ? '编辑成功' : '创建成功');

+ 8 - 0
src/views/system/timetablemanage/api.ts

@@ -63,6 +63,14 @@ export function GetPermission(week_offset:number) {
     });
 }
 
+/*复制列表  */
+export function CopyList(obj: AddReq) {
+	return request({
+		url: '/api/system/manageclass/copy-schedule/',
+		method: 'post',
+		data: obj,
+	});
+}
 
 export async function getScheduleData(result:object): Promise<any[]> {
 	const schedule = result.data.schedule;