|
@@ -1,114 +1,5 @@
|
|
<template>
|
|
<template>
|
|
<div class="app-container">
|
|
<div class="app-container">
|
|
- <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
|
|
|
|
- <el-form-item label="课程内容" prop="plantName">
|
|
|
|
- <el-input
|
|
|
|
- v-model="queryParams.plantName"
|
|
|
|
- placeholder="请输入课程内容"
|
|
|
|
- clearable
|
|
|
|
- size="small"
|
|
|
|
- @keyup.enter.native="handleQuery"
|
|
|
|
- />
|
|
|
|
- </el-form-item>
|
|
|
|
- <el-form-item label="开始日期" prop="startDate">
|
|
|
|
- <el-date-picker clearable size="small" style="width: 200px"
|
|
|
|
- v-model="queryParams.startDate"
|
|
|
|
- type="date"
|
|
|
|
- value-format="yyyy-MM-dd"
|
|
|
|
- placeholder="选择开始日期">
|
|
|
|
- </el-date-picker>
|
|
|
|
- </el-form-item>
|
|
|
|
- <el-form-item label="结束日期" prop="endDate">
|
|
|
|
- <el-date-picker clearable size="small" style="width: 200px"
|
|
|
|
- v-model="queryParams.endDate"
|
|
|
|
- type="date"
|
|
|
|
- value-format="yyyy-MM-dd"
|
|
|
|
- placeholder="选择结束日期">
|
|
|
|
- </el-date-picker>
|
|
|
|
- </el-form-item>
|
|
|
|
- <!-- <el-form-item label="学时" prop="classHour">
|
|
|
|
- <el-input
|
|
|
|
- v-model="queryParams.classHour"
|
|
|
|
- placeholder="请输入学时"
|
|
|
|
- clearable
|
|
|
|
- size="small"
|
|
|
|
- @keyup.enter.native="handleQuery"
|
|
|
|
- />
|
|
|
|
- </el-form-item> -->
|
|
|
|
- <el-form-item label="学习状态" prop="studyState">
|
|
|
|
- <el-select v-model="queryParams.studyState" placeholder="请选择学习状态" clearable size="small">
|
|
|
|
- <el-option
|
|
|
|
- v-for="dict in studyStateOptions"
|
|
|
|
- :key="dict.dictValue"
|
|
|
|
- :label="dict.dictLabel"
|
|
|
|
- :value="dict.dictValue"
|
|
|
|
- />
|
|
|
|
- </el-select>
|
|
|
|
- </el-form-item>
|
|
|
|
- <el-form-item>
|
|
|
|
- <el-button type="cyan" 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"
|
|
|
|
- icon="el-icon-plus"
|
|
|
|
- size="mini"
|
|
|
|
- @click="handleAdd"
|
|
|
|
- v-hasPermi="['spec:plan:add']"
|
|
|
|
- >新增</el-button>
|
|
|
|
- </el-col>
|
|
|
|
- <el-col :span="1.5">
|
|
|
|
- <el-button
|
|
|
|
- type="success"
|
|
|
|
- icon="el-icon-edit"
|
|
|
|
- size="mini"
|
|
|
|
- :disabled="single"
|
|
|
|
- @click="handleUpdate"
|
|
|
|
- v-hasPermi="['spec:plan:edit']"
|
|
|
|
- >修改</el-button>
|
|
|
|
- </el-col>
|
|
|
|
- <el-col :span="1.5">
|
|
|
|
- <el-button
|
|
|
|
- type="danger"
|
|
|
|
- icon="el-icon-delete"
|
|
|
|
- size="mini"
|
|
|
|
- :disabled="multiple"
|
|
|
|
- @click="handleDelete"
|
|
|
|
- v-hasPermi="['spec:plan:remove']"
|
|
|
|
- >删除</el-button>
|
|
|
|
- </el-col>
|
|
|
|
- <el-col :span="1.5">
|
|
|
|
- <el-button
|
|
|
|
- type="info"
|
|
|
|
- icon="el-icon-upload2"
|
|
|
|
- size="mini"
|
|
|
|
- @click="handleImport"
|
|
|
|
- v-hasPermi="['spec:plan:edit']"
|
|
|
|
- >导入</el-button>
|
|
|
|
- </el-col>
|
|
|
|
- <el-col :span="1.5">
|
|
|
|
- <el-button
|
|
|
|
- type="warning"
|
|
|
|
- icon="el-icon-download"
|
|
|
|
- size="mini"
|
|
|
|
- @click="handleExport"
|
|
|
|
- v-hasPermi="['spec:plan:export']"
|
|
|
|
- >导出</el-button>
|
|
|
|
- </el-col>
|
|
|
|
- <el-col :span="1.5">
|
|
|
|
- <el-button
|
|
|
|
- type="success"
|
|
|
|
- size="mini"
|
|
|
|
- :disabled="multiple"
|
|
|
|
- @click="addAprrove('')"
|
|
|
|
- >{{ $t('提交申请') }}</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" :height="clientHeight" border :cell-style="tableCellStyle">
|
|
<el-table v-loading="loading" :data="planList" @selection-change="handleSelectionChange" :height="clientHeight" border :cell-style="tableCellStyle">
|
|
<el-table-column type="selection" width="55" align="center" />
|
|
<el-table-column type="selection" width="55" align="center" />
|
|
@@ -132,37 +23,28 @@
|
|
<el-table-column label="学习状态" align="center" prop="studyState" :formatter="studyStateFormat" width="120"/>
|
|
<el-table-column label="学习状态" align="center" prop="studyState" :formatter="studyStateFormat" width="120"/>
|
|
<el-table-column label="操作" align="center" fixed="right" class-name="small-padding fixed-width">
|
|
<el-table-column label="操作" align="center" fixed="right" class-name="small-padding fixed-width">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
- <el-button
|
|
|
|
- size="mini"
|
|
|
|
- type="text"
|
|
|
|
- icon="el-icon-s-flag"
|
|
|
|
- v-hasPermi="['spec:plan:edit']"
|
|
|
|
- @click="handleStart(scope.row)"
|
|
|
|
- v-if="scope.row.studyState == 0"
|
|
|
|
- >开始</el-button>
|
|
|
|
<el-button
|
|
<el-button
|
|
size="mini"
|
|
size="mini"
|
|
type="text"
|
|
type="text"
|
|
icon="el-icon-circle-check"
|
|
icon="el-icon-circle-check"
|
|
v-hasPermi="['spec:plan:edit']"
|
|
v-hasPermi="['spec:plan:edit']"
|
|
- @click="handleEnd(scope.row)"
|
|
|
|
- v-if="scope.row.studyState == 1"
|
|
|
|
- >结束</el-button>
|
|
|
|
|
|
+ @click="handleFeedback(scope.row)"
|
|
|
|
+ v-if="scope.row.studyState == 0"
|
|
|
|
+ >反馈</el-button>
|
|
<el-button
|
|
<el-button
|
|
size="mini"
|
|
size="mini"
|
|
type="text"
|
|
type="text"
|
|
- icon="el-icon-view"
|
|
|
|
|
|
+ icon="el-icon-document"
|
|
|
|
+ @click="handleDoc(scope.row)"
|
|
v-hasPermi="['spec:plan:edit']"
|
|
v-hasPermi="['spec:plan:edit']"
|
|
- @click="handleDetail(scope.row)"
|
|
|
|
- v-if="scope.row.studyState == 2 || scope.row.studyState == 3"
|
|
|
|
- >详情</el-button>
|
|
|
|
|
|
+ >学员附件</el-button>
|
|
<el-button
|
|
<el-button
|
|
size="mini"
|
|
size="mini"
|
|
type="text"
|
|
type="text"
|
|
icon="el-icon-document"
|
|
icon="el-icon-document"
|
|
@click="handleDoc(scope.row)"
|
|
@click="handleDoc(scope.row)"
|
|
v-hasPermi="['spec:plan:edit']"
|
|
v-hasPermi="['spec:plan:edit']"
|
|
- >附件</el-button>
|
|
|
|
|
|
+ >学习资料</el-button>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
</el-table>
|
|
</el-table>
|
|
@@ -174,109 +56,8 @@
|
|
:limit.sync="queryParams.pageSize"
|
|
:limit.sync="queryParams.pageSize"
|
|
@pagination="getList"
|
|
@pagination="getList"
|
|
/>
|
|
/>
|
|
- <!-- 添加或修改培训计划对话框 -->
|
|
|
|
- <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
|
|
|
- <el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
|
|
|
- <!-- 添加对话框显示下拉列表 -->
|
|
|
|
- <el-form-item label="员工" prop="staffId" v-if="this.operation=='add'">
|
|
|
|
- <el-select v-model="form.staffId" placeholder="请选择学员">
|
|
|
|
- <el-option
|
|
|
|
- v-for="successor in successorOptions"
|
|
|
|
- :key="successor.key"
|
|
|
|
- :label="successor.value"
|
|
|
|
- :value="successor.key"
|
|
|
|
- ></el-option>
|
|
|
|
- </el-select>
|
|
|
|
- </el-form-item>
|
|
|
|
- <!-- 修改对话框显示员工姓名 -->
|
|
|
|
- <el-form-item label="员工" prop="staffName" v-if="this.operation=='modify'">
|
|
|
|
- <el-input v-model="form.staffName" readonly />
|
|
|
|
- </el-form-item>
|
|
|
|
- <el-form-item label="课程内容" prop="plantName">
|
|
|
|
- <el-input v-model="form.plantName" placeholder="请输入课程内容" />
|
|
|
|
- </el-form-item>
|
|
|
|
- <el-form-item label="部门编号" prop="deptId">
|
|
|
|
- <el-input v-model="form.deptId" placeholder="请输入部门编号" />
|
|
|
|
- </el-form-item>
|
|
|
|
- <el-form-item label="开始日期" prop="startDate">
|
|
|
|
- <el-date-picker clearable size="small" style="width: 200px"
|
|
|
|
- v-model="form.startDate"
|
|
|
|
- type="date"
|
|
|
|
- value-format="yyyy-MM-dd"
|
|
|
|
- placeholder="选择开始日期">
|
|
|
|
- </el-date-picker>
|
|
|
|
- </el-form-item>
|
|
|
|
- <el-form-item label="结束日期" prop="endDate">
|
|
|
|
- <el-date-picker clearable size="small" style="width: 200px"
|
|
|
|
- v-model="form.endDate"
|
|
|
|
- type="date"
|
|
|
|
- value-format="yyyy-MM-dd"
|
|
|
|
- placeholder="选择结束日期">
|
|
|
|
- </el-date-picker>
|
|
|
|
- </el-form-item>
|
|
|
|
- <!-- <el-form-item label="学时" prop="classHour">
|
|
|
|
- <el-input v-model="form.classHour" placeholder="请输入学时" />
|
|
|
|
- </el-form-item> -->
|
|
|
|
- <el-form-item label="具体内容">
|
|
|
|
- <!-- <editor v-model="form.classContent" :min-height="192"/> -->
|
|
|
|
- <el-input
|
|
|
|
- type="textarea"
|
|
|
|
- :rows="6"
|
|
|
|
- placeholder="请输入内容"
|
|
|
|
- v-model="form.classContent">
|
|
|
|
- </el-input>
|
|
|
|
- </el-form-item>
|
|
|
|
- <el-form-item label="学习状态" prop="studyState" v-if="this.operation=='modify'">
|
|
|
|
- <el-select v-model="form.studyState" placeholder="请选择学习状态">
|
|
|
|
- <el-option
|
|
|
|
- v-for="dict in studyStateOptions"
|
|
|
|
- :key="dict.dictValue"
|
|
|
|
- :label="dict.dictLabel"
|
|
|
|
- :value="dict.dictValue"
|
|
|
|
- ></el-option>
|
|
|
|
- </el-select>
|
|
|
|
- </el-form-item>
|
|
|
|
- <el-form-item label="归属部门" prop="deptId">
|
|
|
|
- <treeselect v-model="form.deptId" :options="deptOptions" :show-count="true" placeholder="请选择归属部门" />
|
|
|
|
- </el-form-item>
|
|
|
|
- </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>
|
|
|
|
- <!-- 用户导入对话框 -->
|
|
|
|
- <el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
|
|
|
|
- <el-upload
|
|
|
|
- ref="upload"
|
|
|
|
- :limit="1"
|
|
|
|
- accept=".xlsx, .xls"
|
|
|
|
- :headers="upload.headers"
|
|
|
|
- :action="upload.url + '?updateSupport=' + upload.updateSupport"
|
|
|
|
- :disabled="upload.isUploading"
|
|
|
|
- :on-progress="handleFileUploadProgress"
|
|
|
|
- :on-success="handleFileSuccess"
|
|
|
|
- :auto-upload="false"
|
|
|
|
- drag
|
|
|
|
- >
|
|
|
|
- <i class="el-icon-upload"></i>
|
|
|
|
- <div class="el-upload__text">
|
|
|
|
- 将文件拖到此处,或
|
|
|
|
- <em>点击上传</em>
|
|
|
|
- </div>
|
|
|
|
- <div class="el-upload__tip" slot="tip">
|
|
|
|
- <el-checkbox v-model="upload.updateSupport" />是否更新已经存在的用户数据
|
|
|
|
- <el-link type="info" style="font-size:12px" @click="importTemplate">下载模板</el-link>
|
|
|
|
- </div>
|
|
|
|
- <div class="el-upload__tip" style="color:red" slot="tip">提示:仅允许导入“xls”或“xlsx”格式文件!</div>
|
|
|
|
- </el-upload>
|
|
|
|
- <div slot="footer" class="dialog-footer">
|
|
|
|
- <el-button type="primary" @click="submitFileForm">确 定</el-button>
|
|
|
|
- <el-button @click="upload.open = false">取 消</el-button>
|
|
|
|
- </div>
|
|
|
|
- </el-dialog>
|
|
|
|
- <!-- 报告附件对话框 -->
|
|
|
|
- <el-dialog v-dialogDrag :title="doc.title" :visible.sync="doc.open" width="700px" append-to-body>
|
|
|
|
|
|
+ <!-- 附件对话框 -->
|
|
|
|
+ <el-dialog v-dialogDrag :title="doc.title" :visible.sync="doc.open" width="800px" append-to-body>
|
|
<el-upload
|
|
<el-upload
|
|
ref="doc"
|
|
ref="doc"
|
|
:limit="50"
|
|
:limit="50"
|
|
@@ -304,7 +85,7 @@
|
|
</el-table-column>
|
|
</el-table-column>
|
|
<el-table-column :label="$t('大小(Kb)')" align="center" prop="fileSize" :show-overflow-tooltip="true" width="80" />
|
|
<el-table-column :label="$t('大小(Kb)')" align="center" prop="fileSize" :show-overflow-tooltip="true" width="80" />
|
|
<el-table-column :label="$t('上传人')" align="center" prop="creator" :show-overflow-tooltip="true" width="120"/>
|
|
<el-table-column :label="$t('上传人')" align="center" prop="creator" :show-overflow-tooltip="true" width="120"/>
|
|
- <el-table-column :label="$t('操作')" align="center" width="120" class-name="small-padding fixed-width">
|
|
|
|
|
|
+ <el-table-column :label="$t('操作')" align="center" width="180" class-name="small-padding fixed-width">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
<el-button
|
|
<el-button
|
|
v-if="scope.row.fileName.endsWith('pdf')"
|
|
v-if="scope.row.fileName.endsWith('pdf')"
|
|
@@ -339,62 +120,107 @@
|
|
<el-button @click="doc.open = false">{{ $t('返 回') }}</el-button>
|
|
<el-button @click="doc.open = false">{{ $t('返 回') }}</el-button>
|
|
</div>
|
|
</div>
|
|
</el-dialog>
|
|
</el-dialog>
|
|
- <!-- 查看培训详情对话框 -->
|
|
|
|
- <el-dialog v-dialogDrag :title="detail.title" :visible.sync="detail.open" width="700px" append-to-body>
|
|
|
|
- <el-table :data="tableData" border style="width: 100%">
|
|
|
|
- <el-table-column prop="id" label="编号" width="50"></el-table-column>
|
|
|
|
- <el-table-column prop="question" label="问题" width="250"></el-table-column>
|
|
|
|
- <el-table-column prop="answer" label="答案"></el-table-column>
|
|
|
|
- </el-table>
|
|
|
|
- <div slot="footer" class="dialog-footer">
|
|
|
|
- <el-button @click="detail.open = false">{{ $t('返 回') }}</el-button>
|
|
|
|
- </div>
|
|
|
|
- </el-dialog>
|
|
|
|
<!-- 反馈对话框 -->
|
|
<!-- 反馈对话框 -->
|
|
- <el-dialog v-dialogDrag :title="feedback.title" :visible.sync="feedback.open" width="400px" append-to-body>
|
|
|
|
- <div>{{feedbackParams.question1}}</div>
|
|
|
|
- <el-input v-model="feedbackParams.question1" type="hidden"></el-input>
|
|
|
|
- <el-input v-model="feedbackParams.answer1" placeholder="请输入答案" type="textarea" rows="3"></el-input>
|
|
|
|
- <div style="margin-top:20px;">{{feedbackParams.question2}}</div>
|
|
|
|
- <el-input value="feedbackParams.question2" type="hidden"></el-input>
|
|
|
|
- <el-input v-model="feedbackParams.answer2" placeholder="请输入答案" type="textarea" rows="3"></el-input>
|
|
|
|
- <div style="margin-top:20px;">{{feedbackParams.question3}}</div>
|
|
|
|
- <el-input value="feedbackParams.question3" type="hidden"></el-input>
|
|
|
|
- <el-input v-model="feedbackParams.answer3" placeholder="请输入答案" type="textarea" rows="3"></el-input>
|
|
|
|
|
|
+ <el-dialog v-dialogDrag :title="feedbackDialog.title" :visible.sync="feedbackDialog.open" width="800px" append-to-body>
|
|
|
|
+ <el-upload
|
|
|
|
+ ref="doc"
|
|
|
|
+ :limit="50"
|
|
|
|
+ :headers="doc.headers"
|
|
|
|
+ :action="doc.url + '?pType=' + doc.pType + '&pId=' + doc.pId"
|
|
|
|
+ :disabled="doc.isUploading"
|
|
|
|
+ :on-progress="handleFileDocProgress"
|
|
|
|
+ :on-success="handleFileDocSuccess"
|
|
|
|
+ :auto-upload="true"
|
|
|
|
+ drag
|
|
|
|
+ >
|
|
|
|
+ <i class="el-icon-upload"></i>
|
|
|
|
+ <div class="el-upload__text">
|
|
|
|
+ {{ $t('将文件拖到此处,或') }}
|
|
|
|
+ <em>{{ $t('点击上传') }}</em>
|
|
|
|
+ </div>
|
|
|
|
+ </el-upload>
|
|
|
|
+ <el-table :data="doc.commonfileList" border>
|
|
|
|
+ <el-table-column :label="$t('文件名')" align="center" prop="fileName" :show-overflow-tooltip="true">
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <a class="link-type" @click="handleDownload(scope.row)">
|
|
|
|
+ <span>{{ scope.row.fileName }}</span>
|
|
|
|
+ </a>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column :label="$t('大小(Kb)')" align="center" prop="fileSize" :show-overflow-tooltip="true" width="80" />
|
|
|
|
+ <el-table-column :label="$t('上传人')" align="center" prop="creator" :show-overflow-tooltip="true" width="120"/>
|
|
|
|
+ <el-table-column :label="$t('操作')" align="center" width="180" class-name="small-padding fixed-width">
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <el-button
|
|
|
|
+ v-if="scope.row.fileName.endsWith('pdf')"
|
|
|
|
+ size="mini"
|
|
|
|
+ type="text"
|
|
|
|
+ icon="el-icon-view"
|
|
|
|
+ @click="handleSee(scope.row)"
|
|
|
|
+ >{{ $t('预览') }}</el-button>
|
|
|
|
+ <el-button
|
|
|
|
+ size="mini"
|
|
|
|
+ type="text"
|
|
|
|
+ icon="el-icon-download"
|
|
|
|
+ @click="handleDownload(scope.row)"
|
|
|
|
+ >{{ $t('下载') }}</el-button>
|
|
|
|
+ <el-button
|
|
|
|
+ size="mini"
|
|
|
|
+ type="text"
|
|
|
|
+ icon="el-icon-delete"
|
|
|
|
+ @click="handleDeleteDoc(scope.row)"
|
|
|
|
+ >{{ $t('删除') }}</el-button>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ </el-table>
|
|
|
|
+ <el-form>
|
|
|
|
+ <el-form-item label="我学到了什么?">
|
|
|
|
+ <el-input v-model="feedbackParams.answer1" placeholder="请输入" type="textarea"></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="理论学习和平时操作的不同之处?">
|
|
|
|
+ <el-input v-model="feedbackParams.answer2" placeholder="请输入" type="textarea"></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="完成此课程后有什么更好的合理化建议?">
|
|
|
|
+ <el-input v-model="feedbackParams.answer3" placeholder="请输入" type="textarea"></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-form>
|
|
<div slot="footer" class="dialog-footer">
|
|
<div slot="footer" class="dialog-footer">
|
|
- <el-button @click="handleAddFeedback()">{{ $t('提 交') }}</el-button>
|
|
|
|
- <el-button @click="feedback.open = false">{{ $t('返 回') }}</el-button>
|
|
|
|
|
|
+ <el-button @click="handleSubmitFeedback()">{{ $t('保 存') }}</el-button>
|
|
|
|
+ <el-button @click="feedbackDialog.open = false">{{ $t('返 回') }}</el-button>
|
|
</div>
|
|
</div>
|
|
</el-dialog>
|
|
</el-dialog>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
-import { getFeedback, addFeedback } from "@/api/training/spec/planfeedback";
|
|
|
|
-import { getPlan, delPlan, addPlan, updatePlan, updatePlan2,exportPlan, importTemplate, listPlanByStaffId } from "@/api/training/spec/plan";
|
|
|
|
-import { allFileList, delCommonfile } from "@/api/common/commonfile";
|
|
|
|
|
|
+import {
|
|
|
|
+ updateAnswer,
|
|
|
|
+ addAnswer,
|
|
|
|
+ getAnswerByPlanIdAndQuestionId
|
|
|
|
+} from "@/api/training/spec/answer";
|
|
|
|
+import {
|
|
|
|
+ getPlan,
|
|
|
|
+ delPlan,
|
|
|
|
+ addPlan,
|
|
|
|
+ updatePlan,
|
|
|
|
+ exportPlan,
|
|
|
|
+ importTemplate,
|
|
|
|
+ listPlanByStaffId
|
|
|
|
+} from "@/api/training/spec/plan";
|
|
|
|
+import {
|
|
|
|
+ allFileList,
|
|
|
|
+ delCommonfile
|
|
|
|
+} from "@/api/common/commonfile";
|
|
import { treeselect } from "@/api/system/dept";
|
|
import { treeselect } from "@/api/system/dept";
|
|
import { getToken } from "@/utils/auth";
|
|
import { getToken } from "@/utils/auth";
|
|
import Treeselect from "@riophae/vue-treeselect";
|
|
import Treeselect from "@riophae/vue-treeselect";
|
|
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
|
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
|
|
|
|
|
export default {
|
|
export default {
|
|
- name: "Plan",
|
|
|
|
|
|
+ name: "MyPlan",
|
|
components: { Treeselect },
|
|
components: { Treeselect },
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
- // 表格数据
|
|
|
|
- tableData: [],
|
|
|
|
- // 反馈对话框参数
|
|
|
|
- feedbackParams: {
|
|
|
|
- planId: 0,
|
|
|
|
- question1: "我学到了什么?",
|
|
|
|
- question2: "理论学习和平时操作的不同之处?",
|
|
|
|
- question3: "完成此课程后有什么更好的合理化建议?",
|
|
|
|
- answer1: "",
|
|
|
|
- answer2: "",
|
|
|
|
- answer3: ""
|
|
|
|
- },
|
|
|
|
// 遮罩层
|
|
// 遮罩层
|
|
loading: true,
|
|
loading: true,
|
|
// 选中数组
|
|
// 选中数组
|
|
@@ -421,27 +247,6 @@ export default {
|
|
open: false,
|
|
open: false,
|
|
// 学习状态字典
|
|
// 学习状态字典
|
|
studyStateOptions: [],
|
|
studyStateOptions: [],
|
|
- // 学员列表
|
|
|
|
- successorOptions: [],
|
|
|
|
- // 包含导师ID的查询对象
|
|
|
|
- queryObject: {
|
|
|
|
- mentorStaffId: "00427"
|
|
|
|
- },
|
|
|
|
- // 用户导入参数
|
|
|
|
- upload: {
|
|
|
|
- // 是否显示弹出层(用户导入)
|
|
|
|
- open: false,
|
|
|
|
- // 弹出层标题(用户导入)
|
|
|
|
- title: "",
|
|
|
|
- // 是否禁用上传
|
|
|
|
- isUploading: false,
|
|
|
|
- // 是否更新已经存在的用户数据
|
|
|
|
- updateSupport: 0,
|
|
|
|
- // 设置上传的请求头部
|
|
|
|
- headers: { Authorization: "Bearer " + getToken() },
|
|
|
|
- // 上传的地址
|
|
|
|
- url: process.env.VUE_APP_BASE_API + "/spec/plan/importData"
|
|
|
|
- },
|
|
|
|
// 报告附件参数
|
|
// 报告附件参数
|
|
doc: {
|
|
doc: {
|
|
file: "",
|
|
file: "",
|
|
@@ -467,25 +272,26 @@ export default {
|
|
pType: 'plan',
|
|
pType: 'plan',
|
|
pId: null
|
|
pId: null
|
|
},
|
|
},
|
|
- // 查看培训详情参数
|
|
|
|
- detail: {
|
|
|
|
|
|
+ // 反馈对话框参数
|
|
|
|
+ feedbackDialog: {
|
|
// 是否显示弹出层(报告附件)
|
|
// 是否显示弹出层(报告附件)
|
|
open: false,
|
|
open: false,
|
|
// 弹出层标题(报告附件)
|
|
// 弹出层标题(报告附件)
|
|
title: ""
|
|
title: ""
|
|
},
|
|
},
|
|
// 反馈参数
|
|
// 反馈参数
|
|
- feedback: {
|
|
|
|
- // 是否显示弹出层(报告附件)
|
|
|
|
- open: false,
|
|
|
|
- // 弹出层标题(报告附件)
|
|
|
|
- title: ""
|
|
|
|
|
|
+ feedbackParams: {
|
|
|
|
+ answer1: null,
|
|
|
|
+ answer2: null,
|
|
|
|
+ answer3: null
|
|
},
|
|
},
|
|
|
|
+ // 计划id
|
|
|
|
+ planId: null,
|
|
// 查询参数
|
|
// 查询参数
|
|
queryParams: {
|
|
queryParams: {
|
|
pageNum: 1,
|
|
pageNum: 1,
|
|
pageSize: 20,
|
|
pageSize: 20,
|
|
- staffId: "00431",
|
|
|
|
|
|
+ staffId: null,
|
|
plantName: null,
|
|
plantName: null,
|
|
startDate: null,
|
|
startDate: null,
|
|
endDate: null,
|
|
endDate: null,
|
|
@@ -508,18 +314,6 @@ export default {
|
|
pageTotalNum: 1,
|
|
pageTotalNum: 1,
|
|
loadedRatio: 0,
|
|
loadedRatio: 0,
|
|
},
|
|
},
|
|
- // 开始参数
|
|
|
|
- startParams: {
|
|
|
|
- id: 0,
|
|
|
|
- studyState: 1,
|
|
|
|
- planId: null
|
|
|
|
- },
|
|
|
|
- // 结束参数
|
|
|
|
- endParams: {
|
|
|
|
- id: 0,
|
|
|
|
- studyState: 3,
|
|
|
|
- dateOfCompletion: null
|
|
|
|
- },
|
|
|
|
};
|
|
};
|
|
},
|
|
},
|
|
watch: {
|
|
watch: {
|
|
@@ -540,93 +334,140 @@ export default {
|
|
});
|
|
});
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
- // 单元格样式
|
|
|
|
- tableCellStyle (row, column, rowIndex, columnIndex) {
|
|
|
|
|
|
+ /** 单元格样式 */
|
|
|
|
+ tableCellStyle(row, column, rowIndex, columnIndex) {
|
|
if (row.column.label === "实际完成日期" && row.row.dateOfCompletion > row.row.endDate) {
|
|
if (row.column.label === "实际完成日期" && row.row.dateOfCompletion > row.row.endDate) {
|
|
return "background: #FFEEEE"
|
|
return "background: #FFEEEE"
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- /** 结束学习处理 */
|
|
|
|
- handleEnd(row) {
|
|
|
|
- this.handleFeedback(row);
|
|
|
|
- },
|
|
|
|
- /** 反馈处理 */
|
|
|
|
|
|
+
|
|
|
|
+ /** 反馈按钮处理 */
|
|
handleFeedback(row) {
|
|
handleFeedback(row) {
|
|
- this.endParams.id = row.id;
|
|
|
|
- this.feedback.id = row.id;
|
|
|
|
- this.feedback.title = row.plantName + this.$t('反馈');
|
|
|
|
- this.feedback.open = true;
|
|
|
|
- },
|
|
|
|
- /** 新增反馈处理 */
|
|
|
|
- handleAddFeedback() {
|
|
|
|
- this.feedbackParams.planId = this.endParams.id;
|
|
|
|
- this.endParams.dateOfCompletion = new Date();
|
|
|
|
- // 新增培训计划反馈
|
|
|
|
- addFeedback(this.feedbackParams).then(response => {
|
|
|
|
- this.feedback.open = false;
|
|
|
|
- // 修改培训计划学习状态
|
|
|
|
- updatePlan2(this.endParams).then(response => {
|
|
|
|
- this.msgSuccess("已结束学习");
|
|
|
|
- this.getList();
|
|
|
|
- });
|
|
|
|
|
|
+ this.feedbackParams = {};
|
|
|
|
+
|
|
|
|
+ let feedback1 = {};
|
|
|
|
+ feedback1.planId = row.id;
|
|
|
|
+ feedback1.questionId = 1;
|
|
|
|
+
|
|
|
|
+ let feedback2 = {};
|
|
|
|
+ feedback2.planId = row.id;
|
|
|
|
+ feedback2.questionId = 2;
|
|
|
|
+
|
|
|
|
+ let feedback3 = {};
|
|
|
|
+ feedback3.planId = row.id;
|
|
|
|
+ feedback3.questionId = 3;
|
|
|
|
+
|
|
|
|
+ getAnswerByPlanIdAndQuestionId(feedback1).then(response => {
|
|
|
|
+ let data = response.data;
|
|
|
|
+ if (data != null) {
|
|
|
|
+ this.feedbackParams.answer1 = data.answer;
|
|
|
|
+ }
|
|
|
|
+ return getAnswerByPlanIdAndQuestionId(feedback2);
|
|
|
|
+ }).then(response => {
|
|
|
|
+ let data = response.data;
|
|
|
|
+ if (data != null) {
|
|
|
|
+ this.feedbackParams.answer2 = data.answer;
|
|
|
|
+ }
|
|
|
|
+ return getAnswerByPlanIdAndQuestionId(feedback3);
|
|
|
|
+ }).then(response => {
|
|
|
|
+ let data = response.data;
|
|
|
|
+ if (data != null) {
|
|
|
|
+ this.feedbackParams.answer3 = data.answer;
|
|
|
|
+ }
|
|
|
|
+ this.planId = row.id;
|
|
|
|
+ this.feedbackDialog.title = row.plantName + "学习心得";
|
|
|
|
+ this.feedbackDialog.open = true;
|
|
});
|
|
});
|
|
},
|
|
},
|
|
- /** 开始学习 */
|
|
|
|
- handleStart(row) {
|
|
|
|
- this.startParams.id = row.id;
|
|
|
|
- updatePlan2(this.startParams).then(response => {
|
|
|
|
- this.msgSuccess("已开始学习");
|
|
|
|
- this.getList();
|
|
|
|
|
|
+
|
|
|
|
+ /** 提交反馈处理 */
|
|
|
|
+ handleSubmitFeedback() {
|
|
|
|
+ // 打包数据
|
|
|
|
+ let feedback1 = {};
|
|
|
|
+ feedback1.planId = this.planId;
|
|
|
|
+ feedback1.questionId = 1;
|
|
|
|
+ feedback1.answer = this.feedbackParams.answer1;
|
|
|
|
+
|
|
|
|
+ let feedback2 = {};
|
|
|
|
+ feedback2.planId = this.planId;
|
|
|
|
+ feedback2.questionId = 2;
|
|
|
|
+ feedback2.answer = this.feedbackParams.answer2;
|
|
|
|
+
|
|
|
|
+ let feedback3 = {};
|
|
|
|
+ feedback3.planId = this.planId;
|
|
|
|
+ feedback3.questionId = 3;
|
|
|
|
+ feedback3.answer = this.feedbackParams.answer3;
|
|
|
|
+
|
|
|
|
+ // 保存数据
|
|
|
|
+ getAnswerByPlanIdAndQuestionId(feedback1).then(response => {
|
|
|
|
+ let data = response.data;
|
|
|
|
+ if (data != null) {
|
|
|
|
+ feedback1.id = data.id;
|
|
|
|
+ updateAnswer(feedback1);
|
|
|
|
+ } else {
|
|
|
|
+ addAnswer(feedback1);
|
|
|
|
+ }
|
|
});
|
|
});
|
|
- },
|
|
|
|
- /** 查看培训详情处理 */
|
|
|
|
- handleDetail(row) {
|
|
|
|
- this.tableData = [];
|
|
|
|
- this.detail.id = row.id;
|
|
|
|
- this.detail.title = row.plantName + this.$t('详情');
|
|
|
|
- this.detail.open = true;
|
|
|
|
- getFeedback(row.id).then(response => {
|
|
|
|
- let feedbackObject = response.data;
|
|
|
|
- let data1 = { id: 1, question: feedbackObject.question1, answer: feedbackObject.answer1};
|
|
|
|
- let data2 = { id: 2, question: feedbackObject.question2, answer: feedbackObject.answer2};
|
|
|
|
- let data3 = { id: 3, question: feedbackObject.question3, answer: feedbackObject.answer3};
|
|
|
|
- this.tableData.push(data1);
|
|
|
|
- this.tableData.push(data2);
|
|
|
|
- this.tableData.push(data3);
|
|
|
|
|
|
+
|
|
|
|
+ getAnswerByPlanIdAndQuestionId(feedback2).then(response => {
|
|
|
|
+ let data = response.data;
|
|
|
|
+ if (data != null) {
|
|
|
|
+ feedback2.id = data.id;
|
|
|
|
+ updateAnswer(feedback2);
|
|
|
|
+ } else {
|
|
|
|
+ addAnswer(feedback2);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ getAnswerByPlanIdAndQuestionId(feedback3).then(response => {
|
|
|
|
+ let data = response.data;
|
|
|
|
+ if (data != null) {
|
|
|
|
+ feedback3.id = data.id;
|
|
|
|
+ updateAnswer(feedback3);
|
|
|
|
+ } else {
|
|
|
|
+ addAnswer(feedback3);
|
|
|
|
+ }
|
|
});
|
|
});
|
|
|
|
+
|
|
|
|
+ // 隐藏对话框
|
|
|
|
+ this.feedbackDialog.open = false;
|
|
|
|
+
|
|
|
|
+ // 提示
|
|
|
|
+ this.msgSuccess("保存成功");
|
|
},
|
|
},
|
|
|
|
+
|
|
/** 文件下载处理 */
|
|
/** 文件下载处理 */
|
|
handleDownload(row) {
|
|
handleDownload(row) {
|
|
var name = row.fileName;
|
|
var name = row.fileName;
|
|
var url = row.fileUrl;
|
|
var url = row.fileUrl;
|
|
var suffix = url.substring(url.lastIndexOf("."), url.length);
|
|
var suffix = url.substring(url.lastIndexOf("."), url.length);
|
|
- const a = document.createElement('a')
|
|
|
|
- a.setAttribute('download', name)
|
|
|
|
- a.setAttribute('target', '_blank')
|
|
|
|
- a.setAttribute('href', process.env.VUE_APP_BASE_API + url)
|
|
|
|
- a.click()
|
|
|
|
|
|
+ const a = document.createElement('a');
|
|
|
|
+ a.setAttribute('download', name);
|
|
|
|
+ a.setAttribute('target', '_blank');
|
|
|
|
+ a.setAttribute('href', process.env.VUE_APP_BASE_API + url);
|
|
|
|
+ a.click();
|
|
},
|
|
},
|
|
- openPdf(){
|
|
|
|
|
|
+ openPdf() {
|
|
window.open(this.pdf.pdfUrl);//path是文件的全路径地址
|
|
window.open(this.pdf.pdfUrl);//path是文件的全路径地址
|
|
},
|
|
},
|
|
- handleSee (row){
|
|
|
|
- this.pdf.open =true
|
|
|
|
- this.pdf.title = row.fileName
|
|
|
|
- this.pdf.pdfUrl = process.env.VUE_APP_BASE_API +'/pdf/web/viewer.html?file=' + process.env.VUE_APP_BASE_API + row.fileUrl
|
|
|
|
|
|
+ handleSee(row) {
|
|
|
|
+ this.pdf.open = true;
|
|
|
|
+ this.pdf.title = row.fileName;
|
|
|
|
+ this.pdf.pdfUrl = process.env.VUE_APP_BASE_API +'/pdf/web/viewer.html?file=' + process.env.VUE_APP_BASE_API + row.fileUrl;
|
|
},
|
|
},
|
|
/** 报告附件按钮操作 */
|
|
/** 报告附件按钮操作 */
|
|
handleDoc(row) {
|
|
handleDoc(row) {
|
|
this.doc.id = row.id;
|
|
this.doc.id = row.id;
|
|
- this.doc.title = row.plantName + this.$t('附件');
|
|
|
|
|
|
+ this.doc.title = row.plantName + this.$t('学习资料');
|
|
this.doc.open = true;
|
|
this.doc.open = true;
|
|
- this.doc.queryParams.pId = row.id
|
|
|
|
- this.doc.pId = row.id
|
|
|
|
- this.getFileList()
|
|
|
|
|
|
+ this.doc.queryParams.pId = row.id;
|
|
|
|
+ this.doc.pId = row.id;
|
|
|
|
+ this.getFileList();
|
|
this.$nextTick(() => {
|
|
this.$nextTick(() => {
|
|
- this.$refs.doc.clearFiles()
|
|
|
|
|
|
+ this.$refs.doc.clearFiles();
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- getFileList (){
|
|
|
|
|
|
+ getFileList() {
|
|
allFileList(this.doc.queryParams).then(response => {
|
|
allFileList(this.doc.queryParams).then(response => {
|
|
this.doc.commonfileList = response;
|
|
this.doc.commonfileList = response;
|
|
});
|
|
});
|
|
@@ -665,12 +506,12 @@ export default {
|
|
this.loading = false;
|
|
this.loading = false;
|
|
});
|
|
});
|
|
},
|
|
},
|
|
- /** 查询部门下拉树结构 */
|
|
|
|
- getTreeselect() {
|
|
|
|
- treeselect().then(response => {
|
|
|
|
- this.deptOptions = response.data;
|
|
|
|
- });
|
|
|
|
- },
|
|
|
|
|
|
+ /** 查询部门下拉树结构 */
|
|
|
|
+ getTreeselect() {
|
|
|
|
+ treeselect().then(response => {
|
|
|
|
+ this.deptOptions = response.data;
|
|
|
|
+ });
|
|
|
|
+ },
|
|
/** 学习状态字典翻译 */
|
|
/** 学习状态字典翻译 */
|
|
studyStateFormat(row, column) {
|
|
studyStateFormat(row, column) {
|
|
return this.selectDictLabel(this.studyStateOptions, row.studyState);
|
|
return this.selectDictLabel(this.studyStateOptions, row.studyState);
|