|
@@ -52,8 +52,23 @@
|
|
|
<el-table-column label="考核情况" align="center" prop="assess" :show-overflow-tooltip="true" width="180"/>
|
|
|
<el-table-column label="培训状态" align="center" prop="planStatus" :show-overflow-tooltip="true" width="180"/>
|
|
|
<el-table-column label="第一次成绩" align="center" prop="score1" :show-overflow-tooltip="true" width="180"/>
|
|
|
+ <el-table-column label="附件" align="center" :show-overflow-tooltip="true" width="80">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button icon="el-icon-folder" style="color:#6e96fa;" @click="handleDoc(scope.row , 'tsNew-score1')" circle></el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
<el-table-column label="第二次成绩" align="center" prop="score2" :show-overflow-tooltip="true" width="180"/>
|
|
|
+ <el-table-column label="附件" align="center" :show-overflow-tooltip="true" width="80">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button icon="el-icon-folder" style="color:#6e96fa;" @click="handleDoc(scope.row , 'tsNew-score2')" circle></el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
<el-table-column label="第三次成绩" align="center" prop="score3" :show-overflow-tooltip="true" width="180"/>
|
|
|
+ <el-table-column label="附件" align="center" :show-overflow-tooltip="true" width="80">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button icon="el-icon-folder" style="color:#6e96fa;" @click="handleDoc(scope.row , 'tsNew-score3')" circle></el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
<el-table-column label="备注" align="center" prop="remarks" :show-overflow-tooltip="true" width="180"/>
|
|
|
<el-table-column label="操作" align="center" fixed="right" width="230" class-name="small-padding fixed-width">
|
|
|
<template slot-scope="scope">
|
|
@@ -147,12 +162,25 @@
|
|
|
<el-form-item label="第三次成绩" prop="score3">
|
|
|
<el-input v-model="form.score3" placeholder="请输入第三次成绩"/>
|
|
|
</el-form-item>
|
|
|
+ <el-form-item label="计划培训开始时间" prop="planStartData">
|
|
|
+ <el-date-picker clearable size="small" style="width: 200px"
|
|
|
+ v-model="form.planStartData"
|
|
|
+ type="date"
|
|
|
+ value-format="yyyy-MM-dd"
|
|
|
+ placeholder="选择计划培训开始时间">
|
|
|
+ </el-date-picker>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="计划培训结束时间" prop="planEndData">
|
|
|
+ <el-date-picker clearable size="small" style="width: 200px"
|
|
|
+ v-model="form.planEndData"
|
|
|
+ type="date"
|
|
|
+ value-format="yyyy-MM-dd"
|
|
|
+ placeholder="选择计划培训结束时间">
|
|
|
+ </el-date-picker>
|
|
|
+ </el-form-item>
|
|
|
<el-form-item label="备注" prop="remarks">
|
|
|
<el-input v-model="form.remarks" placeholder="请输入备注"/>
|
|
|
</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>
|
|
@@ -210,6 +238,95 @@
|
|
|
v-if="ppt"></iframe>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
+
|
|
|
+
|
|
|
+ <!-- 报告附件对话框 -->
|
|
|
+ <el-dialog :close-on-click-modal="false" v-dialogDrag :title="doc.title" :visible.sync="doc.open" width="1000px" 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" prop="createdate" :show-overflow-tooltip="true" width="120">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>{{ parseTime(scope.row.createdate, '{y}-{m}-{d}') }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <!-- <el-table-column :label="$t('培训日期')" align="center" prop="pDate" width="150">-->
|
|
|
+ <!-- <template slot-scope="scope">-->
|
|
|
+ <!-- <el-date-picker-->
|
|
|
+ <!-- v-if="scope.row.isEdit"-->
|
|
|
+ <!-- v-model="scope.row.pDate"-->
|
|
|
+ <!-- type="date"-->
|
|
|
+ <!-- value-format="yyyy-MM-dd"-->
|
|
|
+ <!-- placeholder="日期">-->
|
|
|
+ <!-- </el-date-picker>-->
|
|
|
+ <!-- <span v-else>{{ parseTime(scope.row.pDate, '{y}-{m}-{d}') }}</span>-->
|
|
|
+ <!-- </template>-->
|
|
|
+ <!-- </el-table-column>-->
|
|
|
+ <el-table-column :label="$t('操作')" align="center" width="220" 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 v-hasPermi="['training:trainingrecords:file']" type="text" size="small" v-if="scope.row.isEdit" @click="save(scope.row)">保存</el-button>
|
|
|
+ <el-button type="text" size="small" v-if="scope.row.isEdit" @click="cancelFile(scope.row, scope.$index)">取消</el-button>
|
|
|
+ <!-- <el-button v-hasPermi="['training:trainingrecords:file']" v-if="!scope.row.isEdit" @click="edit(scope.row)" icon="el-icon-edit" type="text" size="mini">编辑</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)"
|
|
|
+ v-hasPermi="['training:trainingrecords:file']"
|
|
|
+ >{{ $t('删除') }}</el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ <el-dialog :close-on-click-modal="false" v-dialogDrag :title="pdf.title" :visible.sync="pdf.open" width="1300px" append-to-body>
|
|
|
+ <div style="margin-top: -60px;float: right;margin-right: 40px;">
|
|
|
+ <el-button size="mini" type="text" @click="openPdf">{{$t('新页面打开PDF')}}</el-button></div>
|
|
|
+ <div style="margin-top: -30px">
|
|
|
+ <iframe :src="pdf.pdfUrl" frameborder="0" width="100%" height="700px"></iframe>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <!-- <el-button type="primary" @click="submitFileForm">{{ $t('确 定') }}</el-button>-->
|
|
|
+ <el-button @click="doc.open = false">{{ $t('返 回') }}</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -245,6 +362,8 @@ import {
|
|
|
} from "@/api/training/bccnew/ftplandsdt";
|
|
|
import {treeselect} from "@/api/system/dept";
|
|
|
import Treeselect from "@riophae/vue-treeselect";
|
|
|
+import {getToken} from "@/utils/auth";
|
|
|
+import {allFileList, delCommonfile} from "@/api/common/commonfile";
|
|
|
|
|
|
var timer = null;
|
|
|
export default {
|
|
@@ -261,7 +380,33 @@ export default {
|
|
|
data: {}
|
|
|
},
|
|
|
ppt: false,
|
|
|
- pdf: {
|
|
|
+ // 报告附件参数
|
|
|
+ doc: {
|
|
|
+ file: "",
|
|
|
+ // 是否显示弹出层(报告附件)
|
|
|
+ open: false,
|
|
|
+ // 弹出层标题(报告附件)
|
|
|
+ title: "附件",
|
|
|
+ // 是否禁用上传
|
|
|
+ isUploading: false,
|
|
|
+ // 是否更新已经存在的用户数据
|
|
|
+ updateSupport: 0,
|
|
|
+ // 报告附件上传位置编号
|
|
|
+ ids: 0,
|
|
|
+ // 设置上传的请求头部
|
|
|
+ headers: { Authorization: "Bearer " + getToken() },
|
|
|
+ // 上传的地址
|
|
|
+ url: process.env.VUE_APP_BASE_API + "/common/commonfile/uploadFile",
|
|
|
+ commonfileList: null,
|
|
|
+ queryParams: {
|
|
|
+ pId: null,
|
|
|
+ pType: 'traning'
|
|
|
+ },
|
|
|
+ pType: 'traning',
|
|
|
+ pId: null,
|
|
|
+ form: {}
|
|
|
+ },
|
|
|
+ pdf : {
|
|
|
title: '',
|
|
|
pdfUrl: '',
|
|
|
numPages: null,
|
|
@@ -321,6 +466,101 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
methods: {
|
|
|
+ // 文件上传中处理
|
|
|
+ handleFileUploadProgress(event, file, fileList) {
|
|
|
+ this.upload.isUploading = true;
|
|
|
+ },
|
|
|
+ // 文件上传成功处理
|
|
|
+ handleFileSuccess(response, file, fileList) {
|
|
|
+ this.upload.open = false;
|
|
|
+ this.upload.isUploading = false;
|
|
|
+ this.$refs.upload.clearFiles();
|
|
|
+ this.$alert(response.msg, "导入结果", { dangerouslyUseHTMLString: true });
|
|
|
+ this.getList();
|
|
|
+ },
|
|
|
+ // 提交上传文件
|
|
|
+ submitFileForm() {
|
|
|
+ this.$refs.upload.submit();
|
|
|
+ },
|
|
|
+ /** 报告附件按钮操作 */
|
|
|
+ handleDoc(row , fileType) {
|
|
|
+ if (this.planType === 1) {
|
|
|
+ fileType+='lj';
|
|
|
+ } else if (this.planType === 2) {
|
|
|
+ fileType+='ys';
|
|
|
+ } else if (this.planType === 3) {
|
|
|
+ fileType+='fl';
|
|
|
+ } else if (this.planType === 4) {
|
|
|
+ fileType+='ft';
|
|
|
+ }
|
|
|
+ this.doc.pType = fileType
|
|
|
+ this.doc.queryParams.pType = fileType
|
|
|
+ this.doc.id = row.id;
|
|
|
+ this.doc.title = this.$t('附件') ;
|
|
|
+ this.doc.open = true;
|
|
|
+ this.doc.queryParams.pId = row.id
|
|
|
+ this.doc.pId = row.id
|
|
|
+ this.getFileList()
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.doc.clearFiles()
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getFileList (){
|
|
|
+ allFileList(this.doc.queryParams).then(response => {
|
|
|
+ response.forEach(element => {
|
|
|
+ element["isEdit"] = false
|
|
|
+ });
|
|
|
+ response.forEach(element => {
|
|
|
+ element["isAdd"] = false
|
|
|
+ });
|
|
|
+ this.doc.commonfileList = response;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ //附件上传中处理
|
|
|
+ handleFileDocProgress(event, file, fileList) {
|
|
|
+ this.doc.file = file;
|
|
|
+ this.doc.isUploading = true;
|
|
|
+ },
|
|
|
+ //附件上传成功处理
|
|
|
+ handleFileDocSuccess(response, file, fileList) {
|
|
|
+ this.doc.isUploading = false;
|
|
|
+ this.$alert(response.msg, this.$t('导入结果'), { dangerouslyUseHTMLString: true });
|
|
|
+ this.getFileList()
|
|
|
+ },
|
|
|
+ // 文件下载处理
|
|
|
+ handleDownload(row) {
|
|
|
+ var name = row.fileName;
|
|
|
+ var url = row.fileUrl;
|
|
|
+ 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()
|
|
|
+ },
|
|
|
+ openPdf(){
|
|
|
+ window.open(this.pdf.pdfUrl);//path是文件的全路径地址
|
|
|
+ },
|
|
|
+ handleSee (row){
|
|
|
+ // window.open(process.env.VUE_APP_BASE_API +'/pdf/web/viewer.html?file=' + process.env.VUE_APP_BASE_API + row.fileUrl);//path是文件的全路径地址
|
|
|
+ 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
|
|
|
+ },
|
|
|
+ /** 删除按钮操作 */
|
|
|
+ handleDeleteDoc(row) {
|
|
|
+ const ids = row.id || this.ids;
|
|
|
+ this.$confirm(this.$t('是否确认删除?'), this.$t('警告'), {
|
|
|
+ confirmButtonText: this.$t('确定'),
|
|
|
+ cancelButtonText: this.$t('取消'),
|
|
|
+ type: "warning"
|
|
|
+ }).then(function() {
|
|
|
+ return delCommonfile(ids);
|
|
|
+ }).then(() => {
|
|
|
+ this.getFileList()
|
|
|
+ this.msgSuccess(this.$t('删除成功'));
|
|
|
+ })
|
|
|
+ },
|
|
|
handleClose() {
|
|
|
window.clearInterval(timer);
|
|
|
this.getList();
|