|
@@ -60,36 +60,59 @@
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<!-- 查询区 -->
|
|
<!-- 查询区 -->
|
|
|
- <el-form :inline="true" class="mb-12">
|
|
|
|
|
- <el-form-item>
|
|
|
|
|
- <el-input v-model="tableQuery.queryParam.courseName" placeholder="搜索培训课程名称" clearable />
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
-
|
|
|
|
|
- <el-form-item>
|
|
|
|
|
- <el-date-picker
|
|
|
|
|
- v-model="dateRange"
|
|
|
|
|
- type="daterange"
|
|
|
|
|
- range-separator="至"
|
|
|
|
|
- start-placeholder="开始时间"
|
|
|
|
|
- end-placeholder="结束时间"
|
|
|
|
|
- />
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
-
|
|
|
|
|
- <el-form-item>
|
|
|
|
|
|
|
+ <div style="margin-bottom: 20px">
|
|
|
|
|
+ <el-button type="primary" :icon="Plus" @click="handleAdd"> 新增课程 </el-button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <el-form :inline="true" class="mb-12 flex align-middle act-search">
|
|
|
|
|
+ <section class="select-box">
|
|
|
|
|
+ <el-form-item>
|
|
|
|
|
+ <el-input v-model="tableQuery.queryParam.courseName" placeholder="搜索培训课程名称" clearable />
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+
|
|
|
|
|
+ <el-form-item>
|
|
|
|
|
+ <el-date-picker
|
|
|
|
|
+ v-model="dateRange"
|
|
|
|
|
+ type="daterange"
|
|
|
|
|
+ range-separator="至"
|
|
|
|
|
+ start-placeholder="开始时间"
|
|
|
|
|
+ end-placeholder="结束时间"
|
|
|
|
|
+ value-format="YYYY-MM-DD"
|
|
|
|
|
+ format="YYYY-MM-DD"
|
|
|
|
|
+ />
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </section>
|
|
|
|
|
+ <el-form-item class="search-btn">
|
|
|
<el-button type="primary" @click="handleSearch"> 查询 </el-button>
|
|
<el-button type="primary" @click="handleSearch"> 查询 </el-button>
|
|
|
- <el-button type="primary" @click="handleAdd"> 新增课程 </el-button>
|
|
|
|
|
|
|
+ <el-button @click="handleReset"> 重置 </el-button>
|
|
|
<el-button @click="handleExport"> 导出 </el-button>
|
|
<el-button @click="handleExport"> 导出 </el-button>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-form>
|
|
</el-form>
|
|
|
|
|
|
|
|
<!-- 表格 -->
|
|
<!-- 表格 -->
|
|
|
- <el-table :data="tableData" border stripe>
|
|
|
|
|
|
|
+ <div class="batch-table">
|
|
|
|
|
+ <BasicTable
|
|
|
|
|
+ ref="basicTableRef"
|
|
|
|
|
+ :tableData="tableData"
|
|
|
|
|
+ :tableConfig="tableConfig"
|
|
|
|
|
+ @update:pageSize="handleSizeChange"
|
|
|
|
|
+ @update:pageNumber="handleCurrentChange"
|
|
|
|
|
+ >
|
|
|
|
|
+ <template #action="scope">
|
|
|
|
|
+ <div class="action-container--div" style="justify-content: left">
|
|
|
|
|
+ <el-button link type="primary" @click="handleEdit(scope.row)"> 编辑 </el-button>
|
|
|
|
|
+ <el-button link type="primary" @click="handleDelete(scope.row)"> 删除 </el-button>
|
|
|
|
|
+ <el-button link type="primary" @click="handleView(scope.row)"> 查看 </el-button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </BasicTable>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <!-- <el-table :data="tableData" border stripe>
|
|
|
<el-table-column type="index" label="编号" width="80" fixed="left" />
|
|
<el-table-column type="index" label="编号" width="80" fixed="left" />
|
|
|
<el-table-column prop="courseName" label="培训课程名称" width="240" fixed="left" />
|
|
<el-table-column prop="courseName" label="培训课程名称" width="240" fixed="left" />
|
|
|
<el-table-column prop="trainingDate" width="230" label="培训时间" />
|
|
<el-table-column prop="trainingDate" width="230" label="培训时间" />
|
|
|
<el-table-column prop="courseTypeName" label="课程所属分类" width="180" />
|
|
<el-table-column prop="courseTypeName" label="课程所属分类" width="180" />
|
|
|
<el-table-column prop="trainingMethod" label="培训方式" width="120" />
|
|
<el-table-column prop="trainingMethod" label="培训方式" width="120" />
|
|
|
- <!-- <el-table-column prop="courseIntroduction" label="培训课程简述" /> -->
|
|
|
|
|
|
|
+ <el-table-column prop="courseIntroduction" label="培训课程简述" />
|
|
|
<el-table-column prop="trainingTeacher" label="培训课程讲师" width="140" />
|
|
<el-table-column prop="trainingTeacher" label="培训课程讲师" width="140" />
|
|
|
<el-table-column prop="groupOfParticipantsDesc" label="计划参与人数所属分组" width="200" />
|
|
<el-table-column prop="groupOfParticipantsDesc" label="计划参与人数所属分组" width="200" />
|
|
|
<el-table-column prop="planNumOfParticipants" label="计划参与人数" width="140" />
|
|
<el-table-column prop="planNumOfParticipants" label="计划参与人数" width="140" />
|
|
@@ -98,8 +121,8 @@
|
|
|
<el-table-column label="操作" width="280" fixed="right">
|
|
<el-table-column label="操作" width="280" fixed="right">
|
|
|
<template #default="{ row }">
|
|
<template #default="{ row }">
|
|
|
<el-button link type="primary" @click="handleEdit(row)"> 编辑 </el-button>
|
|
<el-button link type="primary" @click="handleEdit(row)"> 编辑 </el-button>
|
|
|
- <el-button link type="danger" @click="handleDelete(row)"> 删除 </el-button>
|
|
|
|
|
- <el-button link @click="handleView(row)"> 查看 </el-button>
|
|
|
|
|
|
|
+ <el-button link type="primary" @click="handleDelete(row)"> 删除 </el-button>
|
|
|
|
|
+ <el-button link type="primary" @click="handleView(row)"> 查看 </el-button>
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
</el-table>
|
|
</el-table>
|
|
@@ -113,7 +136,7 @@
|
|
|
@current-change="handlePageChange"
|
|
@current-change="handlePageChange"
|
|
|
@size-change="handleSizeChange"
|
|
@size-change="handleSizeChange"
|
|
|
/>
|
|
/>
|
|
|
- </div>
|
|
|
|
|
|
|
+ </div> -->
|
|
|
</el-card>
|
|
</el-card>
|
|
|
</div>
|
|
</div>
|
|
|
<AddTrainingInformation :state="type" v-model:visible="showAddTrainingInfo" :currentId="currentTableId" @save-success="handleSearch" />
|
|
<AddTrainingInformation :state="type" v-model:visible="showAddTrainingInfo" :currentId="currentTableId" @save-success="handleSearch" />
|
|
@@ -134,6 +157,11 @@
|
|
|
import AddTrainingInformation from './addTrainingInformation.vue';
|
|
import AddTrainingInformation from './addTrainingInformation.vue';
|
|
|
import type { QueryPageRequest } from '@/types/basic-query';
|
|
import type { QueryPageRequest } from '@/types/basic-query';
|
|
|
import { downloadByData } from '@/utils/file/download';
|
|
import { downloadByData } from '@/utils/file/download';
|
|
|
|
|
+ import { Plus } from '@element-plus/icons-vue';
|
|
|
|
|
+ import BasicTable from '@/components/BasicTable.vue';
|
|
|
|
|
+ import useTableConfig from '@/hooks/useTableConfigHook';
|
|
|
|
|
+ import { TABLE_OPTIONS, COURSE_TABLE_COLUMNS } from '../configs/tables';
|
|
|
|
|
+
|
|
|
const router = useRouter();
|
|
const router = useRouter();
|
|
|
const route = useRoute();
|
|
const route = useRoute();
|
|
|
|
|
|
|
@@ -141,10 +169,7 @@
|
|
|
const currentId = computed(() => Number(route.query.id));
|
|
const currentId = computed(() => Number(route.query.id));
|
|
|
|
|
|
|
|
const isViewMode = computed(() => operate.value === 'education-training-plan-management-dept-view');
|
|
const isViewMode = computed(() => operate.value === 'education-training-plan-management-dept-view');
|
|
|
- const query = ref({
|
|
|
|
|
- name: '',
|
|
|
|
|
- time: [],
|
|
|
|
|
- });
|
|
|
|
|
|
|
+
|
|
|
const details = reactive({
|
|
const details = reactive({
|
|
|
trainingPlanName: '',
|
|
trainingPlanName: '',
|
|
|
categoryName: '',
|
|
categoryName: '',
|
|
@@ -161,11 +186,11 @@
|
|
|
createdAt: '',
|
|
createdAt: '',
|
|
|
deptName: '',
|
|
deptName: '',
|
|
|
});
|
|
});
|
|
|
- const page = ref({
|
|
|
|
|
- current: 1,
|
|
|
|
|
- size: 10,
|
|
|
|
|
- total: 0,
|
|
|
|
|
- });
|
|
|
|
|
|
|
+
|
|
|
|
|
+ // 表格
|
|
|
|
|
+ const basicTableRef = ref<InstanceType<typeof BasicTable>>();
|
|
|
|
|
+
|
|
|
|
|
+ const { tableConfig, pagination } = useTableConfig(COURSE_TABLE_COLUMNS, TABLE_OPTIONS);
|
|
|
|
|
|
|
|
const tableData = ref([]);
|
|
const tableData = ref([]);
|
|
|
const type = ref('add');
|
|
const type = ref('add');
|
|
@@ -175,36 +200,51 @@
|
|
|
const dateRange = ref([]);
|
|
const dateRange = ref([]);
|
|
|
|
|
|
|
|
const tableQuery = reactive<QueryPageRequest<TableParamsType>>({
|
|
const tableQuery = reactive<QueryPageRequest<TableParamsType>>({
|
|
|
- pageNumber: page.value.current,
|
|
|
|
|
- pageSize: page.value.size,
|
|
|
|
|
|
|
+ pageNumber: pagination.pageNumber,
|
|
|
|
|
+ pageSize: pagination.pageSize,
|
|
|
queryParam: {
|
|
queryParam: {
|
|
|
petpiId: currentId.value,
|
|
petpiId: currentId.value,
|
|
|
- courseName: '',
|
|
|
|
|
- dateStart: dateRange.value[0],
|
|
|
|
|
- dateEnd: dateRange.value[1],
|
|
|
|
|
|
|
+ courseName: undefined,
|
|
|
|
|
+ dateStart: undefined, //dateRange.value[0],
|
|
|
|
|
+ dateEnd: undefined, //dateRange.value[1],
|
|
|
},
|
|
},
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
- const handlePageChange = (current) => {
|
|
|
|
|
- page.value.current = current;
|
|
|
|
|
|
|
+ const handleCurrentChange = (value: number) => {
|
|
|
|
|
+ pagination.pageNumber = value;
|
|
|
|
|
+ tableQuery.pageNumber = value;
|
|
|
getTableList();
|
|
getTableList();
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
- const handleSizeChange = (size) => {
|
|
|
|
|
- page.value.size = size;
|
|
|
|
|
- page.value.current = 1;
|
|
|
|
|
|
|
+ const handleSizeChange = (value: number) => {
|
|
|
|
|
+ pagination.pageSize = value;
|
|
|
|
|
+ tableQuery.pageSize = value;
|
|
|
getTableList();
|
|
getTableList();
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
const handleSearch = () => {
|
|
const handleSearch = () => {
|
|
|
showAddTrainingInfo.value = false
|
|
showAddTrainingInfo.value = false
|
|
|
- page.value.current = 1;
|
|
|
|
|
|
|
+ pagination.pageNumber = 1;
|
|
|
tableQuery.pageNumber = 1;
|
|
tableQuery.pageNumber = 1;
|
|
|
getTableList();
|
|
getTableList();
|
|
|
};
|
|
};
|
|
|
-
|
|
|
|
|
|
|
+ const handleReset = ()=>{
|
|
|
|
|
+ pagination.pageNumber = 1;
|
|
|
|
|
+ pagination.pageSize = 20;
|
|
|
|
|
+ Object.assign(tableQuery, {
|
|
|
|
|
+ pageNumber: 1,
|
|
|
|
|
+ pageSize: pagination.pageSize,
|
|
|
|
|
+ queryParam: {
|
|
|
|
|
+ petpiId: currentId.value,
|
|
|
|
|
+ courseName: undefined,
|
|
|
|
|
+ dateStart: undefined,
|
|
|
|
|
+ dateEnd: undefined,
|
|
|
|
|
+ },
|
|
|
|
|
+ });
|
|
|
|
|
+ dateRange.value = [];
|
|
|
|
|
+ handleSearch();
|
|
|
|
|
+ }
|
|
|
const handleExport = async () => {
|
|
const handleExport = async () => {
|
|
|
-
|
|
|
|
|
try {
|
|
try {
|
|
|
const response = await exportEducationTrainingPlanCourseData(tableQuery.queryParam)
|
|
const response = await exportEducationTrainingPlanCourseData(tableQuery.queryParam)
|
|
|
if (response) {
|
|
if (response) {
|
|
@@ -245,15 +285,21 @@
|
|
|
});
|
|
});
|
|
|
};
|
|
};
|
|
|
const getTableList = async () => {
|
|
const getTableList = async () => {
|
|
|
|
|
+ tableConfig.loading = true;
|
|
|
if (!currentId.value) return;
|
|
if (!currentId.value) return;
|
|
|
try {
|
|
try {
|
|
|
|
|
+ tableQuery.queryParam.dateStart = dateRange.value ? dateRange.value[0]: undefined
|
|
|
|
|
+ tableQuery.queryParam.dateEnd = dateRange.value ? dateRange.value[1]: undefined
|
|
|
const res = await queryTrainingTableData(tableQuery);
|
|
const res = await queryTrainingTableData(tableQuery);
|
|
|
if (res) {
|
|
if (res) {
|
|
|
tableData.value = res.records || [];
|
|
tableData.value = res.records || [];
|
|
|
- page.value.total = res.total || 0;
|
|
|
|
|
|
|
+ pagination.total = res.totalRow;
|
|
|
}
|
|
}
|
|
|
} catch (e) {
|
|
} catch (e) {
|
|
|
- ElMessage.error('获取培训课程列表失败');
|
|
|
|
|
|
|
+ tableData.value = [];
|
|
|
|
|
+ pagination.total = 0;
|
|
|
|
|
+ } finally {
|
|
|
|
|
+ tableConfig.loading = false;
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
const getDetail = async () => {
|
|
const getDetail = async () => {
|
|
@@ -303,6 +349,9 @@
|
|
|
.mb-12 {
|
|
.mb-12 {
|
|
|
margin-bottom: 12px;
|
|
margin-bottom: 12px;
|
|
|
}
|
|
}
|
|
|
|
|
+ .align-middle {
|
|
|
|
|
+ justify-content: space-between;
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
.mb-16 {
|
|
.mb-16 {
|
|
|
margin-bottom: 16px;
|
|
margin-bottom: 16px;
|