|
|
@@ -0,0 +1,478 @@
|
|
|
+<template>
|
|
|
+ <div class="app-container">
|
|
|
+ <!--机构数据-->
|
|
|
+ <el-col :span="4" :xs="24">
|
|
|
+ <org-tree v-model="queryParams.belongOrgId" @defaultKey="getDefaultKey" @checkChange="checkChange"
|
|
|
+ @click="clickTreeNode"></org-tree>
|
|
|
+ </el-col>
|
|
|
+ <!--搜索栏-->
|
|
|
+ <el-col :span="20" :xs="24">
|
|
|
+ <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
|
|
+
|
|
|
+ <el-form-item label="机构类型" prop="execOrgType">
|
|
|
+ <el-select v-model="queryParams.execOrgType" placeholder="请选择执行机构类型" clearable>
|
|
|
+ <el-option
|
|
|
+ v-for="dict in dict.type.sys_org_type"
|
|
|
+ :key="dict.value"
|
|
|
+ :label="dict.label"
|
|
|
+ :value="dict.value"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="计划周期" prop="planCycle">
|
|
|
+ <el-select v-model="queryParams.planCycle" placeholder="请选择计划周期" clearable>
|
|
|
+ <el-option
|
|
|
+ v-for="dict in dict.type.plan_cycle"
|
|
|
+ :key="dict.value"
|
|
|
+ :label="dict.label"
|
|
|
+ :value="dict.value"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="计划状态" prop="planStatus">
|
|
|
+ <el-select v-model="queryParams.planStatus" placeholder="请选择计划状态" clearable>
|
|
|
+ <el-option
|
|
|
+ v-for="dict in dict.type.plan_status"
|
|
|
+ :key="dict.value"
|
|
|
+ :label="dict.label"
|
|
|
+ :value="dict.value"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="培训角色" prop="planRoleId">
|
|
|
+ <el-select v-model="form.planRoleId" placeholder="请选择">
|
|
|
+ <el-option v-for="item in planRoleList" :key="item.id" :label="item.name" :value="item.id"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="计划名称" prop="planName">
|
|
|
+ <el-input
|
|
|
+ v-model="queryParams.planName"
|
|
|
+ placeholder="请输入计划名称"
|
|
|
+ clearable
|
|
|
+ @keyup.enter.native="handleQuery"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ <el-form-item>
|
|
|
+ <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
|
|
+ <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+
|
|
|
+ <el-row :gutter="10" class="mb8">
|
|
|
+ <el-col :span="1.5">
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ plain
|
|
|
+ icon="el-icon-plus"
|
|
|
+ size="mini"
|
|
|
+ @click="handleAdd"
|
|
|
+ v-hasPermi="['system:plan:add']"
|
|
|
+ >新增
|
|
|
+ </el-button>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="1.5">
|
|
|
+ <el-button
|
|
|
+ type="success"
|
|
|
+ plain
|
|
|
+ icon="el-icon-edit"
|
|
|
+ size="mini"
|
|
|
+ :disabled="single"
|
|
|
+ @click="handleUpdate"
|
|
|
+ v-hasPermi="['system:plan:edit']"
|
|
|
+ >修改
|
|
|
+ </el-button>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="1.5">
|
|
|
+ <el-button
|
|
|
+ type="danger"
|
|
|
+ plain
|
|
|
+ icon="el-icon-delete"
|
|
|
+ size="mini"
|
|
|
+ :disabled="multiple"
|
|
|
+ @click="handleDelete"
|
|
|
+ v-hasPermi="['system:plan:remove']"
|
|
|
+ >删除
|
|
|
+ </el-button>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="1.5">
|
|
|
+ <el-button
|
|
|
+ type="warning"
|
|
|
+ plain
|
|
|
+ icon="el-icon-download"
|
|
|
+ size="mini"
|
|
|
+ @click="handleExport"
|
|
|
+ v-hasPermi="['system:plan:export']"
|
|
|
+ >导出
|
|
|
+ </el-button>
|
|
|
+ </el-col>
|
|
|
+ <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <el-table v-loading="loading" :data="planList" @selection-change="handleSelectionChange">
|
|
|
+ <el-table-column type="selection" width="55" align="center"/>
|
|
|
+ <el-table-column label="序号" align="center" prop="no"/>
|
|
|
+ <el-table-column label="计划名称" align="center" prop="planName"/>
|
|
|
+ <el-table-column label="计划创建机构" align="center" prop="createOrgName"/>
|
|
|
+ <el-table-column label="计划所属机构" align="center" prop="belongOrgName"/>
|
|
|
+ <el-table-column label="培训机构类型" align="center" prop="execOrgType">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <dict-tag :options="dict.type.sys_org_type" :value="scope.row.execOrgType"/>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="计划周期" align="center" prop="planCycle">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <dict-tag :options="dict.type.plan_cycle" :value="scope.row.planCycle"/>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="培训次数" align="center" prop="execTimes"/>
|
|
|
+ <el-table-column label="备注" align="center" prop="remark"/>
|
|
|
+ <el-table-column label="修改人" align="center" prop="updateBy"/>
|
|
|
+ <el-table-column label="计划状态" align="center" prop="planStatus">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <dict-tag :options="dict.type.plan_status" :value="scope.row.planStatus"/>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button
|
|
|
+ size="mini"
|
|
|
+ type="text"
|
|
|
+ icon="el-icon-edit"
|
|
|
+ @click="handleUpdate(scope.row)"
|
|
|
+ v-hasPermi="['system:plan:edit']"
|
|
|
+ >修改
|
|
|
+ </el-button>
|
|
|
+ <el-button
|
|
|
+ size="mini"
|
|
|
+ type="text"
|
|
|
+ icon="el-icon-delete"
|
|
|
+ @click="handleDelete(scope.row)"
|
|
|
+ v-hasPermi="['system:plan:remove']"
|
|
|
+ >删除
|
|
|
+ </el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+
|
|
|
+ <pagination
|
|
|
+ v-show="total>0"
|
|
|
+ :total="total"
|
|
|
+ :page.sync="queryParams.pageNum"
|
|
|
+ :limit.sync="queryParams.pageSize"
|
|
|
+ @pagination="getList"
|
|
|
+ />
|
|
|
+ </el-col>
|
|
|
+ <!-- 添加或修改教育培训计划对话框 -->
|
|
|
+ <el-dialog :title="title" :visible.sync="open" width="800px" append-to-body>
|
|
|
+ <el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="10">
|
|
|
+ <el-form-item label="计划名称" prop="planName">
|
|
|
+ <el-input v-model="form.planName" placeholder="请输入计划名称"/>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="14">
|
|
|
+ <el-form-item label="计划周期" prop="planCycle">
|
|
|
+ <el-select v-model="form.planCycle" placeholder="请选择计划周期">
|
|
|
+ <el-option
|
|
|
+ v-for="dict in dict.type.plan_cycle"
|
|
|
+ :key="dict.value"
|
|
|
+ :label="dict.label"
|
|
|
+ :value="parseInt(dict.value)"
|
|
|
+ ></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="10">
|
|
|
+ <el-form-item label="培训次数" prop="execTimes">
|
|
|
+ <template>
|
|
|
+ <el-input-number v-model="form.execTimes" :min="1" :max="10"></el-input-number>
|
|
|
+ </template>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="14">
|
|
|
+ <el-form-item label="计划状态" prop="planStatus">
|
|
|
+ <el-select v-model="form.planStatus" placeholder="请选择计划状态">
|
|
|
+ <el-option
|
|
|
+ v-for="dict in dict.type.plan_status"
|
|
|
+ :key="dict.value"
|
|
|
+ :label="dict.label"
|
|
|
+ :value="parseInt(dict.value)"
|
|
|
+ ></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="10">
|
|
|
+ <el-form-item label="立即生效" prop="buildTaskNow">
|
|
|
+ <el-checkbox v-model="form.buildTaskNow">
|
|
|
+ 勾选后在当前周期开始生效
|
|
|
+ </el-checkbox>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="14">
|
|
|
+ <el-form-item label="培训机构类型" prop="execOrgType">
|
|
|
+ <el-select v-model="form.execOrgType" placeholder="请选择执行机构类型">
|
|
|
+ <el-option
|
|
|
+ v-for="dict in dict.type.sys_org_type"
|
|
|
+ :key="dict.value"
|
|
|
+ :label="dict.label"
|
|
|
+ :value="parseInt(dict.value)"
|
|
|
+ ></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="10">
|
|
|
+ <el-form-item label="培训角色" prop="planRoleId">
|
|
|
+ <el-select v-model="form.planRoleId" placeholder="请选择" multiple>
|
|
|
+ <el-option v-for="item in roleList" :key="item.id" :label="item.name" :value="item.id"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="14">
|
|
|
+ <el-form-item label="培训机构" prop="belongOrgId">
|
|
|
+ <tree-select
|
|
|
+ v-model="form.belongOrgId"
|
|
|
+ :options="deptOptions"
|
|
|
+ :show-count="true"
|
|
|
+ :normalizer="tenantIdnormalizer"
|
|
|
+ :props="{checkStrictly: true, label:'name'}"
|
|
|
+ placeholder="请选择培训机构"/>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row>
|
|
|
+ <el-form-item label="备注" prop="remark">
|
|
|
+ <el-input v-model="form.remark" placeholder="请输入备注"/>
|
|
|
+ </el-form-item>
|
|
|
+ </el-row>
|
|
|
+ <el-col :span="14">
|
|
|
+ <el-form-item label="上传文件" prop="fileList">
|
|
|
+ <file-upload v-model="form.file"/>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-form>
|
|
|
+
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button type="primary" @click="submitForm">确 定</el-button>
|
|
|
+ <el-button @click="cancel">取 消</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import {listPlan, getPlan, delPlan, addPlan, updatePlan, listPlanRole, roleList} from "@/api/core/plan";
|
|
|
+import OrgTree from "@/components/orgTree/index.vue";
|
|
|
+import {deptTreeSelect} from "@/api/system/public";
|
|
|
+
|
|
|
+export default {
|
|
|
+ name: "Plan",
|
|
|
+ dicts: ['plan_cycle', 'sys_org_type', 'plan_status'],
|
|
|
+ components: {OrgTree},
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ // 遮罩层
|
|
|
+ loading: true,
|
|
|
+ // 选中数组
|
|
|
+ ids: [],
|
|
|
+ // 非单个禁用
|
|
|
+ single: true,
|
|
|
+ // 非多个禁用
|
|
|
+ multiple: true,
|
|
|
+ // 显示搜索条件
|
|
|
+ showSearch: true,
|
|
|
+ // 总条数
|
|
|
+ total: 0,
|
|
|
+ // 教育培训计划表格数据
|
|
|
+ planList: [],
|
|
|
+ // 弹出层标题
|
|
|
+ title: "",
|
|
|
+ // 是否显示弹出层
|
|
|
+ open: false,
|
|
|
+ // 查询参数
|
|
|
+ queryParams: {
|
|
|
+ execOrgType: null,
|
|
|
+ planCycle: null,
|
|
|
+ planStatus: null,
|
|
|
+ planRoleId: null,
|
|
|
+ planName: null,
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ belongOrgId: null
|
|
|
+
|
|
|
+ },
|
|
|
+ // 表单参数
|
|
|
+ form: {},
|
|
|
+ // 表单校验
|
|
|
+ rules: {},
|
|
|
+ planRoleList: [],
|
|
|
+ roleList: [],
|
|
|
+ //修改新增中的机构树
|
|
|
+ deptOptions: [],
|
|
|
+ };
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ this.getList();
|
|
|
+ this.initPlanRoleList();
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ /** 查询教育培训计划列表 */
|
|
|
+ getList() {
|
|
|
+ this.loading = true;
|
|
|
+ listPlan(this.queryParams).then(response => {
|
|
|
+ this.planList = response.rows;
|
|
|
+ this.total = response.total;
|
|
|
+ this.loading = false;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ //初始化与计划相关的角色信息
|
|
|
+ initPlanRoleList() {
|
|
|
+ listPlanRole({}).then(response => {
|
|
|
+ this.planRoleList = response.data;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ //初始化所有角色数据
|
|
|
+ initRoleList() {
|
|
|
+ roleList({}).then(response => {
|
|
|
+ this.roleList = response.data;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ /** 查询机构树数据 */
|
|
|
+ getDeptTree() {
|
|
|
+ deptTreeSelect().then(response => {
|
|
|
+ this.deptOptions = response.data;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 取消按钮
|
|
|
+ cancel() {
|
|
|
+ this.open = false;
|
|
|
+ this.reset();
|
|
|
+ },
|
|
|
+ // 表单重置
|
|
|
+ reset() {
|
|
|
+ this.form = {
|
|
|
+ id: null,
|
|
|
+ planName: null,
|
|
|
+ planCycle: null,
|
|
|
+ execTimes: null,
|
|
|
+ planStatus: null,
|
|
|
+ execOrgType: null,
|
|
|
+ startDate: null,
|
|
|
+ endDate: null,
|
|
|
+ buildTaskNow: null,
|
|
|
+ remark: null,
|
|
|
+ planRoleId: null,
|
|
|
+ fileList: null
|
|
|
+
|
|
|
+ };
|
|
|
+ this.resetForm("form");
|
|
|
+ },
|
|
|
+
|
|
|
+ getDefaultKey(key) {
|
|
|
+ this.queryParams.belongOrgId = key;
|
|
|
+ this.getList();
|
|
|
+ },
|
|
|
+ //单选框状态改变
|
|
|
+ checkChange(state) {
|
|
|
+ this.queryParams.checkSub = state;
|
|
|
+ this.handleQuery();
|
|
|
+ },
|
|
|
+ // 节点单击事件
|
|
|
+ clickTreeNode(data) {
|
|
|
+ this.queryParams.belongOrgId = data.id;
|
|
|
+ this.handleQuery();
|
|
|
+ },
|
|
|
+ /** treeSelect组件自定义数据*/
|
|
|
+ tenantIdnormalizer(node, instanceId) {
|
|
|
+ if (node.children && !node.children.length) {
|
|
|
+ delete node.children
|
|
|
+ }
|
|
|
+ return {
|
|
|
+ id: node.id,
|
|
|
+ label: node.name,
|
|
|
+ children: node.children
|
|
|
+ }
|
|
|
+ },
|
|
|
+ /** 搜索按钮操作 */
|
|
|
+ handleQuery() {
|
|
|
+ this.queryParams.pageNum = 1;
|
|
|
+ this.getList();
|
|
|
+ },
|
|
|
+ /** 重置按钮操作 */
|
|
|
+ resetQuery() {
|
|
|
+ this.resetForm("queryForm");
|
|
|
+ this.handleQuery();
|
|
|
+ },
|
|
|
+ // 多选框选中数据
|
|
|
+ handleSelectionChange(selection) {
|
|
|
+ this.ids = selection.map(item => item.id)
|
|
|
+ this.single = selection.length !== 1
|
|
|
+ this.multiple = !selection.length
|
|
|
+ },
|
|
|
+ /** 新增按钮操作 */
|
|
|
+ handleAdd() {
|
|
|
+ this.initRoleList();
|
|
|
+ this.getDeptTree()
|
|
|
+ this.reset();
|
|
|
+ this.open = true;
|
|
|
+ this.title = "添加教育培训计划";
|
|
|
+ },
|
|
|
+ /** 修改按钮操作 */
|
|
|
+ handleUpdate(row) {
|
|
|
+ this.initRoleList();
|
|
|
+ this.getDeptTree()
|
|
|
+ this.reset();
|
|
|
+ const id = row.id || this.ids
|
|
|
+ getPlan(id).then(response => {
|
|
|
+ this.form = response.data;
|
|
|
+ this.open = true;
|
|
|
+ this.title = "修改教育培训计划";
|
|
|
+ });
|
|
|
+ },
|
|
|
+ /** 提交按钮 */
|
|
|
+ submitForm() {
|
|
|
+ this.$refs["form"].validate(valid => {
|
|
|
+ if (valid) {
|
|
|
+ if (this.form.id != null) {
|
|
|
+ updatePlan(this.form).then(response => {
|
|
|
+ this.$modal.msgSuccess("修改成功");
|
|
|
+ this.open = false;
|
|
|
+ this.getList();
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ addPlan(this.form).then(response => {
|
|
|
+ this.$modal.msgSuccess("新增成功");
|
|
|
+ this.open = false;
|
|
|
+ this.getList();
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ /** 删除按钮操作 */
|
|
|
+ handleDelete(row) {
|
|
|
+ const ids = row.id || this.ids;
|
|
|
+ this.$modal.confirm('是否确认删除教育培训计划编号为"' + ids + '"的数据项?').then(function () {
|
|
|
+ return delPlan(ids);
|
|
|
+ }).then(() => {
|
|
|
+ this.getList();
|
|
|
+ this.$modal.msgSuccess("删除成功");
|
|
|
+ }).catch(() => {
|
|
|
+ });
|
|
|
+ },
|
|
|
+ /** 导出按钮操作 */
|
|
|
+ handleExport() {
|
|
|
+ this.download('system/plan/export', {
|
|
|
+ ...this.queryParams
|
|
|
+ }, `plan_${new Date().getTime()}.xlsx`)
|
|
|
+ }
|
|
|
+ }
|
|
|
+};
|
|
|
+</script>
|