123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224 |
- <template>
- <div class="training-plan-manage">
- <div class="part-box part-box-filter part-box-flex">
- <el-form ref="FilterForm" label-position="left" label-width="85px" inline>
- <template v-if="checkPrivilege('condition', 'condition')">
- <el-form-item label="专业:">
- <professional-select
- v-model="filter.professionalId"
- placeholder="专业"
- ></professional-select>
- </el-form-item>
- <el-form-item label="培养方案名称:">
- <el-input
- v-model.trim="filter.name"
- placeholder="培养方案名称"
- clearable
- ></el-input>
- </el-form-item>
- </template>
- <el-form-item label-width="0px">
- <el-button
- v-if="checkPrivilege('button', 'select')"
- type="primary"
- @click="search"
- >查询</el-button
- >
- </el-form-item>
- </el-form>
- <div class="part-box-action">
- <el-button
- v-if="checkPrivilege('button', 'add')"
- type="primary"
- icon="el-icon-add"
- @click="toAdd"
- >新增</el-button
- >
- </div>
- </div>
- <div class="part-box part-box-pad">
- <el-table ref="TableList" :data="dataList">
- <el-table-column
- type="index"
- label="序号"
- width="70"
- :index="indexMethod"
- ></el-table-column>
- <el-table-column prop="name" label="培养方案名称"> </el-table-column>
- <el-table-column prop="professionalName" label="专业">
- </el-table-column>
- <el-table-column prop="targetCount" label="培养目标">
- <span slot-scope="scope"> {{ scope.row.targetCount }}个 </span>
- </el-table-column>
- <el-table-column prop="requirementCount" label="毕业要求">
- <span slot-scope="scope"> {{ scope.row.requirementCount }}项 </span>
- </el-table-column>
- <el-table-column prop="courseCount" label="课程体系">
- <span slot-scope="scope"> {{ scope.row.courseCount }}门 </span>
- </el-table-column>
- <el-table-column prop="createName" label="创建人">
- <span slot-scope="scope">
- {{ scope.row.createRealName }}({{ scope.row.createLoginName }})
- </span>
- </el-table-column>
- <el-table-column
- class-name="action-column"
- label="操作"
- width="220"
- fixed="right"
- >
- <template slot-scope="scope">
- <el-button
- v-if="checkPrivilege('link', 'edit')"
- class="btn-primary"
- type="text"
- @click="toEdit(scope.row)"
- >编辑</el-button
- >
- <el-button
- v-if="checkPrivilege('link', 'copy')"
- class="btn-primary"
- type="text"
- @click="toCopy(scope.row)"
- >复制</el-button
- >
- <el-button
- v-if="checkPrivilege('link', 'delete')"
- class="btn-danger"
- type="text"
- @click="toDelete(scope.row)"
- >删除</el-button
- >
- <el-button
- v-if="checkPrivilege('link', 'CultureProgramDetail')"
- class="btn-primary"
- type="text"
- @click="toDetail(scope.row)"
- >查看详情</el-button
- >
- </template>
- </el-table-column>
- </el-table>
- <div class="part-page">
- <el-pagination
- background
- layout="total, sizes, prev, pager, next, jumper"
- :pager-count="5"
- :current-page="current"
- :total="total"
- :page-size="size"
- @current-change="toPage"
- @size-change="pageSizeChange"
- >
- </el-pagination>
- </div>
- </div>
- <!-- ModifyTrainingPlan -->
- <modify-training-plan
- v-if="checkPrivilege('button', 'add') || checkPrivilege('link', 'edit')"
- ref="ModifyTrainingPlan"
- :instance="curRow"
- @modified="getList"
- ></modify-training-plan>
- <!-- DetailTrainingPlan -->
- <detail-training-plan
- v-if="checkPrivilege('link', 'CultureProgramDetail')"
- ref="DetailTrainingPlan"
- :row-data="curRow"
- @modified="getList"
- ></detail-training-plan>
- </div>
- </template>
- <script>
- import {
- trainingPlanListPage,
- deleteTrainingPlan,
- copyTrainingPlan,
- } from "../api";
- import ModifyTrainingPlan from "../components/training-plan/ModifyTrainingPlan.vue";
- import DetailTrainingPlan from "../components/training-plan/DetailTrainingPlan.vue";
- export default {
- name: "training-plan-manage",
- components: { ModifyTrainingPlan, DetailTrainingPlan },
- data() {
- return {
- filter: {
- professionalId: "",
- name: "",
- },
- current: 1,
- size: this.GLOBAL.pageSize,
- total: 0,
- dataList: [],
- curRow: {},
- };
- },
- mounted() {
- this.toPage(1);
- },
- methods: {
- async getList() {
- if (!this.checkPrivilege("list", "list")) return;
- const datas = {
- ...this.filter,
- pageNumber: this.current,
- pageSize: this.size,
- };
- const data = await trainingPlanListPage(datas);
- this.dataList = data.records;
- this.total = data.total;
- },
- toPage(page) {
- this.current = page;
- this.getList();
- },
- search() {
- this.toPage(1);
- },
- toAdd() {
- this.curRow = {};
- this.$refs.ModifyTrainingPlan.open();
- },
- toEdit(row) {
- this.curRow = row;
- this.$refs.ModifyTrainingPlan.open();
- },
- async toDelete(row) {
- const confirm = await this.$confirm(
- `确定要删除培养方案【${row.name}】吗?`,
- "提示",
- {
- type: "warning",
- }
- ).catch(() => {});
- if (confirm !== "confirm") return;
- await deleteTrainingPlan(row.id);
- this.$message.success("删除成功!");
- this.deletePageLastItem();
- },
- async toCopy(row) {
- const confirm = await this.$confirm(
- `确定要复制培养方案【${row.name}】吗?`,
- "提示",
- {
- type: "warning",
- }
- ).catch(() => {});
- if (confirm !== "confirm") return;
- await copyTrainingPlan(row.id);
- this.$message.success("复制成功!");
- this.getList();
- },
- toDetail(row) {
- this.curRow = row;
- this.$refs.DetailTrainingPlan.open();
- },
- },
- };
- </script>
|