|
|
|
@ -1,141 +1,76 @@ |
|
|
|
<template> |
|
|
|
<div class="main-container"> |
|
|
|
<el-card class="box-card !border-none" shadow="never"> |
|
|
|
|
|
|
|
<div class="flex justify-between items-center"> |
|
|
|
<span class="text-lg">{{pageName}}</span> |
|
|
|
<el-button type="primary" @click="addEvent"> |
|
|
|
{{ t('addPersonCourseSchedule') }} |
|
|
|
</el-button> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
<el-card |
|
|
|
class="box-card !border-none my-[10px] table-search-wrap" |
|
|
|
shadow="never" |
|
|
|
> |
|
|
|
<el-form |
|
|
|
:inline="true" |
|
|
|
:model="personCourseScheduleTable.searchParam" |
|
|
|
ref="searchFormRef" |
|
|
|
> |
|
|
|
<el-form-item :label="t('personId')" prop="person_id"> |
|
|
|
<el-input |
|
|
|
v-model="personCourseScheduleTable.searchParam.person_id" |
|
|
|
:placeholder="t('personIdPlaceholder')" |
|
|
|
/> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item :label="t('personType')" prop="person_type"> |
|
|
|
<el-input |
|
|
|
v-model="personCourseScheduleTable.searchParam.person_type" |
|
|
|
:placeholder="t('personTypePlaceholder')" |
|
|
|
/> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item :label="t('scheduleId')" prop="schedule_id"> |
|
|
|
<el-input |
|
|
|
v-model="personCourseScheduleTable.searchParam.schedule_id" |
|
|
|
:placeholder="t('scheduleIdPlaceholder')" |
|
|
|
/> |
|
|
|
<el-card class="box-card !border-none my-[10px] table-search-wrap" shadow="never"> |
|
|
|
<el-form :inline="true" :model="personCourseScheduleTable.searchParam" ref="searchFormRef"> |
|
|
|
|
|
|
|
<el-form-item label="资源名称" prop="name"> |
|
|
|
<el-input v-model="personCourseScheduleTable.searchParam.name" |
|
|
|
placeholder="请输入资源名称" /> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item :label="t('courseDate')" prop="course_date"> |
|
|
|
<el-input |
|
|
|
v-model="personCourseScheduleTable.searchParam.course_date" |
|
|
|
:placeholder="t('courseDatePlaceholder')" |
|
|
|
/> |
|
|
|
|
|
|
|
<el-form-item label="资源手机号" prop="phone_number"> |
|
|
|
<el-input v-model="personCourseScheduleTable.searchParam.phone_number" |
|
|
|
placeholder="请输入资源手机号" /> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item :label="t('timeSlot')" prop="time_slot"> |
|
|
|
<el-input |
|
|
|
v-model="personCourseScheduleTable.searchParam.time_slot" |
|
|
|
:placeholder="t('timeSlotPlaceholder')" |
|
|
|
/> |
|
|
|
|
|
|
|
<el-form-item label="校区" prop="campus_name"> |
|
|
|
<el-input v-model="personCourseScheduleTable.searchParam.campus_name" |
|
|
|
placeholder="请输入校区" /> |
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<el-form-item> |
|
|
|
<el-button type="primary" @click="loadPersonCourseScheduleList()">{{ |
|
|
|
t('search') |
|
|
|
}}</el-button> |
|
|
|
<el-button @click="resetForm(searchFormRef)">{{ |
|
|
|
t('reset') |
|
|
|
}}</el-button> |
|
|
|
<el-button type="primary" @click="loadPersonCourseScheduleList()">{{ t('search') }}</el-button> |
|
|
|
<el-button @click="resetForm(searchFormRef)">{{ t('reset') }}</el-button> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
</el-card> |
|
|
|
|
|
|
|
<div class="mt-[10px]"> |
|
|
|
<el-table |
|
|
|
:data="personCourseScheduleTable.data" |
|
|
|
size="large" |
|
|
|
v-loading="personCourseScheduleTable.loading" |
|
|
|
> |
|
|
|
<el-table :data="personCourseScheduleTable.data" size="large" v-loading="personCourseScheduleTable.loading"> |
|
|
|
<template #empty> |
|
|
|
<span>{{ |
|
|
|
!personCourseScheduleTable.loading ? t('emptyData') : '' |
|
|
|
}}</span> |
|
|
|
<span>{{ !personCourseScheduleTable.loading ? t('emptyData') : '' }}</span> |
|
|
|
</template> |
|
|
|
<el-table-column |
|
|
|
prop="person_id" |
|
|
|
:label="t('personId')" |
|
|
|
min-width="120" |
|
|
|
:show-overflow-tooltip="true" |
|
|
|
/> |
|
|
|
|
|
|
|
<el-table-column |
|
|
|
prop="person_type" |
|
|
|
:label="t('personType')" |
|
|
|
min-width="120" |
|
|
|
:show-overflow-tooltip="true" |
|
|
|
/> |
|
|
|
|
|
|
|
<el-table-column |
|
|
|
prop="schedule_id" |
|
|
|
:label="t('scheduleId')" |
|
|
|
min-width="120" |
|
|
|
:show-overflow-tooltip="true" |
|
|
|
/> |
|
|
|
|
|
|
|
<el-table-column |
|
|
|
prop="course_date" |
|
|
|
:label="t('courseDate')" |
|
|
|
min-width="120" |
|
|
|
:show-overflow-tooltip="true" |
|
|
|
/> |
|
|
|
|
|
|
|
<el-table-column |
|
|
|
prop="time_slot" |
|
|
|
:label="t('timeSlot')" |
|
|
|
min-width="120" |
|
|
|
:show-overflow-tooltip="true" |
|
|
|
/> |
|
|
|
|
|
|
|
<el-table-column |
|
|
|
:label="t('operation')" |
|
|
|
fixed="right" |
|
|
|
min-width="120" |
|
|
|
> |
|
|
|
<el-table-column prop="name" label="资源名称" min-width="120" :show-overflow-tooltip="true"/> |
|
|
|
|
|
|
|
<el-table-column label="人员类型" min-width="180" align="center" :show-overflow-tooltip="true"> |
|
|
|
<template #default="{ row }"> |
|
|
|
<el-button type="primary" link @click="editEvent(row)">{{ |
|
|
|
t('edit') |
|
|
|
}}</el-button> |
|
|
|
<el-button type="primary" link @click="deleteEvent(row.id)">{{ |
|
|
|
t('delete') |
|
|
|
}}</el-button> |
|
|
|
<div v-for="(item, index) in person_typeList"> |
|
|
|
<div v-if="item.value == row.person_type">{{ item.name }}</div> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
|
|
|
|
<el-table-column prop="course_type" label="课程类型" min-width="120" :show-overflow-tooltip="true"/> |
|
|
|
|
|
|
|
<el-table-column prop="course_date" :label="t('courseDate')" min-width="120" :show-overflow-tooltip="true"/> |
|
|
|
|
|
|
|
<el-table-column prop="time_slot" :label="t('timeSlot')" min-width="120" :show-overflow-tooltip="true"/> |
|
|
|
|
|
|
|
<el-table-column :label="t('operation')" fixed="right" min-width="120"> |
|
|
|
<template #default="{ row }"> |
|
|
|
<el-button type="primary" link @click="deleteEvent(row.id)">请假</el-button> |
|
|
|
<el-button type="primary" link @click="xkEvent(row.id)">消课</el-button> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
|
|
|
|
</el-table> |
|
|
|
<div class="mt-[16px] flex justify-end"> |
|
|
|
<el-pagination |
|
|
|
v-model:current-page="personCourseScheduleTable.page" |
|
|
|
v-model:page-size="personCourseScheduleTable.limit" |
|
|
|
layout="total, sizes, prev, pager, next, jumper" |
|
|
|
:total="personCourseScheduleTable.total" |
|
|
|
@size-change="loadPersonCourseScheduleList()" |
|
|
|
@current-change="loadPersonCourseScheduleList" |
|
|
|
/> |
|
|
|
<el-pagination v-model:current-page="personCourseScheduleTable.page" v-model:page-size="personCourseScheduleTable.limit" |
|
|
|
layout="total, sizes, prev, pager, next, jumper" :total="personCourseScheduleTable.total" |
|
|
|
@size-change="loadPersonCourseScheduleList()" @current-change="loadPersonCourseScheduleList" /> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
<edit |
|
|
|
ref="editPersonCourseScheduleDialog" |
|
|
|
@complete="loadPersonCourseScheduleList" |
|
|
|
/> |
|
|
|
<edit ref="editPersonCourseScheduleDialog" @complete="loadPersonCourseScheduleList" /> |
|
|
|
</el-card> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
@ -144,16 +79,13 @@ |
|
|
|
import { reactive, ref, watch } from 'vue' |
|
|
|
import { t } from '@/lang' |
|
|
|
import { useDictionary } from '@/app/api/dict' |
|
|
|
import { |
|
|
|
getPersonCourseScheduleList, |
|
|
|
deletePersonCourseSchedule, |
|
|
|
} from '@/app/api/person_course_schedule' |
|
|
|
import { getPersonCourseScheduleList, deletePersonCourseSchedule, getWithCustomerResourcesList,xkPersonCourseSchedule} from '@/app/api/person_course_schedule' |
|
|
|
import { img } from '@/utils/common' |
|
|
|
import { ElMessageBox,FormInstance } from 'element-plus' |
|
|
|
import Edit from '@/app/views/person_course_schedule/components/person-course-schedule-edit.vue' |
|
|
|
import { useRoute } from 'vue-router' |
|
|
|
const route = useRoute() |
|
|
|
const pageName = route.meta.title |
|
|
|
const pageName = route.meta.title; |
|
|
|
|
|
|
|
let personCourseScheduleTable = reactive({ |
|
|
|
page: 1, |
|
|
|
@ -162,12 +94,10 @@ let personCourseScheduleTable = reactive({ |
|
|
|
loading: true, |
|
|
|
data: [], |
|
|
|
searchParam:{ |
|
|
|
person_id: '', |
|
|
|
person_type: '', |
|
|
|
schedule_id: '', |
|
|
|
course_date: '', |
|
|
|
time_slot: '', |
|
|
|
}, |
|
|
|
"name":"", |
|
|
|
"phone_number":"", |
|
|
|
"campus_name":"" |
|
|
|
} |
|
|
|
}) |
|
|
|
|
|
|
|
const searchFormRef = ref<FormInstance>() |
|
|
|
@ -176,6 +106,11 @@ const searchFormRef = ref<FormInstance>() |
|
|
|
const selectData = ref<any[]>([]) |
|
|
|
|
|
|
|
// 字典数据 |
|
|
|
const person_typeList = ref([] as any[]) |
|
|
|
const person_typeDictList = async () => { |
|
|
|
person_typeList.value = await (await useDictionary('person_type')).data.dictionary |
|
|
|
} |
|
|
|
person_typeDictList(); |
|
|
|
|
|
|
|
/** |
|
|
|
* 获取人员与课程安排关系列表 |
|
|
|
@ -187,14 +122,12 @@ const loadPersonCourseScheduleList = (page: number = 1) => { |
|
|
|
getPersonCourseScheduleList({ |
|
|
|
page: personCourseScheduleTable.page, |
|
|
|
limit: personCourseScheduleTable.limit, |
|
|
|
...personCourseScheduleTable.searchParam, |
|
|
|
}) |
|
|
|
.then((res) => { |
|
|
|
...personCourseScheduleTable.searchParam |
|
|
|
}).then(res => { |
|
|
|
personCourseScheduleTable.loading = false |
|
|
|
personCourseScheduleTable.data = res.data.data |
|
|
|
personCourseScheduleTable.total = res.data.total |
|
|
|
}) |
|
|
|
.catch(() => { |
|
|
|
}).catch(() => { |
|
|
|
personCourseScheduleTable.loading = false |
|
|
|
}) |
|
|
|
} |
|
|
|
@ -223,19 +156,43 @@ const editEvent = (data: any) => { |
|
|
|
* 删除人员与课程安排关系 |
|
|
|
*/ |
|
|
|
const deleteEvent = (id: number) => { |
|
|
|
ElMessageBox.confirm(t('personCourseScheduleDeleteTips'), t('warning'), { |
|
|
|
ElMessageBox.confirm("确定请假吗", t('warning'), |
|
|
|
{ |
|
|
|
confirmButtonText: t('confirm'), |
|
|
|
cancelButtonText: t('cancel'), |
|
|
|
type: 'warning', |
|
|
|
} |
|
|
|
).then(() => { |
|
|
|
deletePersonCourseSchedule(id).then(() => { |
|
|
|
loadPersonCourseScheduleList() |
|
|
|
}).catch(() => { |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
const xkEvent = (id: number) => { |
|
|
|
ElMessageBox.confirm("确定销课吗", t('warning'), |
|
|
|
{ |
|
|
|
confirmButtonText: t('confirm'), |
|
|
|
cancelButtonText: t('cancel'), |
|
|
|
type: 'warning', |
|
|
|
}).then(() => { |
|
|
|
deletePersonCourseSchedule(id) |
|
|
|
.then(() => { |
|
|
|
} |
|
|
|
).then(() => { |
|
|
|
xkPersonCourseSchedule(id).then(() => { |
|
|
|
loadPersonCourseScheduleList() |
|
|
|
}).catch(() => { |
|
|
|
}) |
|
|
|
.catch(() => {}) |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const personIdList = ref([]) |
|
|
|
const setPersonIdList = async () => { |
|
|
|
personIdList.value = await (await getWithCustomerResourcesList({})).data |
|
|
|
} |
|
|
|
setPersonIdList() |
|
|
|
|
|
|
|
const resetForm = (formEl: FormInstance | undefined) => { |
|
|
|
if (!formEl) return |
|
|
|
formEl.resetFields() |
|
|
|
|