feat: 新建赴校信息开发中

This commit is contained in:
xiangbo 2025-08-18 18:03:15 +08:00
parent 9d647f8645
commit 3aaebcb3cf
2 changed files with 111 additions and 10 deletions

View File

@ -6,8 +6,8 @@ import type { Res } from "@/utils/http/types";
* @param {string} type type=StatusEnum * @param {string} type type=StatusEnum
* @return {object} * @return {object}
*/ */
export function getenum(data) { export function getenumApi(data) {
return http.request<Res<any>>("post", `/back/schools/QueryCombo`, { return http.request<Res<any>>("post", `/SchoolBusiness/QueryCombo`, {
data data
}); });
} }
@ -16,8 +16,34 @@ export function getenum(data) {
* @param {string} type type=StatusEnum * @param {string} type type=StatusEnum
* @return {object} * @return {object}
*/ */
export function getPageList(data) { export function getPageListApi(data) {
return http.request<Res<any>>("post", `/SchoolBusiness/QueryPageList`, { return http.request<Res<any>>("post", `/SchoolBusiness/QueryPageList`, {
data data
}); });
} }
/**
* @description id:0()
* @return {object}
*/
export function addOrEditApi(data: any) {
return http.request<Res<any>>("post", `/SchoolBusiness/Edit`, {
data
});
}
/**
* @description
* @param {string} type type=StatusEnum
* @return {object}
*/
export function getSchoolBusinessDetailApi(id: string | number) {
return http.request<Res<any>>("get", `/SchoolBusiness/${id}`);
}
/**
* @description
* @return {object}
*/
export function deleteSchoolBusinessApi(data: Array<string | number>) {
return http.request<Res<any>>("post", `/SchoolBusiness/Del`, {
data
});
}

View File

@ -98,7 +98,7 @@
</el-tag> </el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="lastTime" label="最后跟进时间" min-width="160" /> <!-- <el-table-column prop="lastTime" label="最后跟进时间" min-width="160" /> -->
<el-table-column label="操作" fixed="right" min-width="220"> <el-table-column label="操作" fixed="right" min-width="220">
<template #default="{ row }"> <template #default="{ row }">
<el-button size="small" type="danger" plain @click="onDelete(row)" <el-button size="small" type="danger" plain @click="onDelete(row)"
@ -132,11 +132,18 @@
</template> </template>
<!-- 赴校信息管理菜单 --> <!-- 赴校信息管理菜单 -->
<script setup lang="ts" name="Toschoolinfomanage"> <script setup lang="ts" name="Toschoolinfomanage">
import { getenum, getPageList } from "@/api/toschoolinfomanage"; import {
addOrEditApi,
getenumApi,
getPageListApi,
getSchoolBusinessDetailApi,
deleteSchoolBusinessApi
} from "@/api/toschoolinfomanage";
import { ref, reactive, computed, onMounted } from "vue"; import { ref, reactive, computed, onMounted } from "vue";
import dayjs from "dayjs"; import dayjs from "dayjs";
import { ElMessage } from "element-plus"; import { ElMessage } from "element-plus";
import AddModal from "./addModal.vue"; import AddModal from "./addModal.vue";
import { message } from "@/utils/message";
interface TableItem { interface TableItem {
id: number; id: number;
school: string; school: string;
@ -157,7 +164,7 @@ const schoolOptions = ref([
]); ]);
const isShowAddModal = ref(false); const isShowAddModal = ref(false);
onMounted(() => { onMounted(() => {
getenum({ TextName: "Name", ValueName: "Id" }).then(res => { getenumApi({ TextName: "Name", ValueName: "Id" }).then(res => {
if (res.code === 200) { if (res.code === 200) {
schoolOptions.value = res.data.map(i => ({ schoolOptions.value = res.data.map(i => ({
label: i.text, label: i.text,
@ -165,6 +172,7 @@ onMounted(() => {
})); }));
} }
}); });
// addOrEdit();
loadList(); loadList();
}); });
@ -174,6 +182,60 @@ const gradeOptions = [
{ label: "高三", value: "高三" }, { label: "高三", value: "高三" },
{ label: "初三", value: "初三" } { label: "初三", value: "初三" }
]; ];
/**
* 新建赴校信息提交
*/
const addOrEdit = () => {
addOrEditApi(
addOrEditApi({
id: 0,
schoolId: 708490619039814,
schoolName: "重庆测试学校",
grade: "初二",
schoolBusinessUser: ["向波4"],
startTime: "2025-08-20T07:28:38",
// remark: "string",
feedbackQuestions: [
{
endTime: null,
question: "xb测试反馈问题1双师课堂",
questionType: 10,
solution: "xb测试反馈问题1建议",
sort: "1"
}
// {
// endTime: null,
// question: "xb2",
// questionType: 15,
// solution: "xb2",
// sort: "2"
// },
// {
// endTime: null,
// question: "xb2",
// questionType: 20,
// solution: "xb3",
// sort: "3"
// }
],
// solutionRecord: {
// solution: "string",
// endRecord: "string",
// record: [
// {
// executionRecords: "string",
// executionTime: "2025-08-18T08:31:52.716Z"
// }
// ]
// },
// solutionEnd: true,
isDiscussion: false,
discussion: "开展座谈座谈座谈座谈座谈座谈座谈座谈座谈座谈座谈座谈座谈",
isClassMeeting: false,
classMeeting: "班会情况班会情况班会情况班会情况班会情况班会情况班会情况"
})
);
};
const query = reactive({ const query = reactive({
school: "" as string | undefined, school: "" as string | undefined,
@ -234,7 +296,7 @@ async function loadList() {
payload.startTimeEnd = query.times[1]; payload.startTimeEnd = query.times[1];
} }
try { try {
const res = await getPageList(payload); const res = await getPageListApi(payload);
if (res.code === 200) { if (res.code === 200) {
const rows = Array.isArray(res.data?.data) ? res.data.data : []; const rows = Array.isArray(res.data?.data) ? res.data.data : [];
listData.value = rows.map(mapApiItemToRow); listData.value = rows.map(mapApiItemToRow);
@ -285,11 +347,24 @@ function handleSizeChange(s: number) {
} }
function onDelete(row: TableItem) { function onDelete(row: TableItem) {
console.log(`删除`); console.log(`删除`, row);
deleteSchoolBusinessApi([row.id]).then(res => {
if (res.code === 200) {
message("删除成功", { type: "success" });
loadList();
}
});
} }
/**
* 获取详情
* @param row
*/
function onDetail(row: TableItem) { function onDetail(row: TableItem) {
console.log(`详情`); getSchoolBusinessDetailApi(row.id).then(res => {
if (res.code === 200) {
console.log("详情信息", res.data);
}
});
} }
function onFollow(row: TableItem) { function onFollow(row: TableItem) {