浏览代码

上岗证/作业证书一览表 - 附件

wangggziwen 1 年之前
父节点
当前提交
efe6abea73
共有 1 个文件被更改,包括 323 次插入24 次删除
  1. 323 24
      ui/src/views/training/worklicensecertificate/index.vue

+ 323 - 24
ui/src/views/training/worklicensecertificate/index.vue

@@ -413,35 +413,40 @@
       <el-table-column type="selection" width="55" align="center" />
       <el-table-column label="姓名" align="center" prop="name" :show-overflow-tooltip="true"/>
       <el-table-column label="员工号" align="center" prop="employeeid" :show-overflow-tooltip="true"/>
-      <el-table-column label="身份证件号" align="center" prop="idnum" :show-overflow-tooltip="true"/>
+      <el-table-column label="身份证件号" align="center" prop="idnum" :show-overflow-tooltip="true" width="150"/>
       <el-table-column label="班组" align="center" prop="classes" :show-overflow-tooltip="true"/>
       <el-table-column label="职务" align="center" prop="post" :show-overflow-tooltip="true"/>
       <el-table-column label="证件类型" align="center" prop="idtype" :show-overflow-tooltip="true"/>
-      <el-table-column label="证件号" align="center" prop="worklicenseIdnum" :show-overflow-tooltip="true"/>
+      <el-table-column label="证件号" align="center" prop="worklicenseIdnum" :show-overflow-tooltip="true" width="120"/>
       <el-table-column label="岗位">
         <el-table-column label="开工锅炉" align="center" prop="boiler" :show-overflow-tooltip="true">
           <template slot-scope="scope">
             <span>{{ scope.row.boiler == 1 ? "YES" : "NO" }}</span>
+            <el-button v-if="scope.row.boiler == 1" icon="el-icon-folder" style="color:#6e96fa;" @click="handleDoc(scope.row , 'license-boiler')"  circle></el-button>
           </template>
         </el-table-column>
         <el-table-column label="裂解" align="center" prop="cracking" :show-overflow-tooltip="true">
           <template slot-scope="scope">
             <span>{{ scope.row.cracking == 1 ? "YES" : "NO" }}</span>
+            <el-button v-if="scope.row.cracking == 1" icon="el-icon-folder" style="color:#6e96fa;" @click="handleDoc(scope.row , 'license-cracking')"  circle></el-button>
           </template>
         </el-table-column>
         <el-table-column label="热区" align="center" prop="hotarea" :show-overflow-tooltip="true">
           <template slot-scope="scope">
             <span>{{ scope.row.hotarea == 1 ? "YES" : "NO" }}</span>
+            <el-button v-if="scope.row.hotarea == 1" icon="el-icon-folder" style="color:#6e96fa;" @click="handleDoc(scope.row , 'license-hotarea')"  circle></el-button>
           </template>
         </el-table-column>
         <el-table-column label="冷区" align="center" prop="coldarea" :show-overflow-tooltip="true">
           <template slot-scope="scope">
             <span>{{ scope.row.coldarea == 1 ? "YES" : "NO" }}</span>
+            <el-button v-if="scope.row.coldarea == 1" icon="el-icon-folder" style="color:#6e96fa;" @click="handleDoc(scope.row , 'license-coldarea')"  circle></el-button>
           </template>
         </el-table-column>
         <el-table-column label="芳烃" align="center" prop="aromatic" :show-overflow-tooltip="true">
           <template slot-scope="scope">
             <span>{{ scope.row.aromatic == 1 ? "YES" : "NO" }}</span>
+            <el-button v-if="scope.row.aromatic == 1" icon="el-icon-folder" style="color:#6e96fa;" @click="handleDoc(scope.row , 'license-aromatic')"  circle></el-button>
           </template>
         </el-table-column>
       </el-table-column>
@@ -456,8 +461,18 @@
         </template>
       </el-table-column>
       <el-table-column label="压力容器和管道证书(4年复审)">
-        <el-table-column label="压力容器" align="center" prop="container" :show-overflow-tooltip="true"/>
-        <el-table-column label="压力管道" align="center" prop="pipe" :show-overflow-tooltip="true"/>
+        <el-table-column label="压力容器" align="center" prop="container" :show-overflow-tooltip="true">
+          <template slot-scope="scope">
+            <span>{{ scope.row.container }}</span>
+            <el-button v-if="scope.row.container != null" icon="el-icon-folder" style="color:#6e96fa;" @click="handleDoc(scope.row , 'certificate-container')"  circle></el-button>
+          </template>
+        </el-table-column>
+        <el-table-column label="压力管道" align="center" prop="pipe" :show-overflow-tooltip="true">
+          <template slot-scope="scope">
+            <span>{{ scope.row.pipe }}</span>
+            <el-button v-if="scope.row.pipe != null" icon="el-icon-folder" style="color:#6e96fa;" @click="handleDoc(scope.row , 'certificate-pipe')"  circle></el-button>
+          </template>
+        </el-table-column>
         <el-table-column label="取证日期" align="center" prop="reviewdate" width="100">
           <template slot-scope="scope">
             <span>{{ parseTime(scope.row.reviewdate, '{y}-{m}-{d}') }}</span>
@@ -468,10 +483,15 @@
             <span>{{ parseTime(scope.row.pipevalidity, '{y}-{m}-{d}') }}</span>
           </template>
         </el-table-column>
-        <el-table-column label="证件号" align="center" prop="certificateNo" :show-overflow-tooltip="true"/>
+        <el-table-column label="证件号" align="center" prop="certificateNo" :show-overflow-tooltip="true" width="120"/>
       </el-table-column>
       <el-table-column label="锅炉证书(4年)">
-        <el-table-column label="锅炉证" align="center" prop="boilerid" :show-overflow-tooltip="true"/>
+        <el-table-column label="锅炉证" align="center" prop="boilerid" :show-overflow-tooltip="true">
+          <template slot-scope="scope">
+            <span>{{ scope.row.boilerid }}</span>
+            <el-button v-if="scope.row.boilerid != null" icon="el-icon-folder" style="color:#6e96fa;" @click="handleDoc(scope.row , 'certificate-boilerid')"  circle></el-button>
+          </template>
+        </el-table-column>
         <el-table-column label="有效期" align="center" prop="boilvalidity" width="100">
           <template slot-scope="scope">
             <span>{{ parseTime(scope.row.boilvalidity, '{y}-{m}-{d}') }}</span>
@@ -479,7 +499,12 @@
         </el-table-column>
       </el-table-column>
       <el-table-column label="危险化学品安全生产(3年复审,6年有效期)">
-        <el-table-column label="加氢工艺" align="center" prop="hydrogenation" :show-overflow-tooltip="true"/>
+        <el-table-column label="加氢工艺" align="center" prop="hydrogenation" :show-overflow-tooltip="true" width="180">
+          <template slot-scope="scope">
+            <span>{{ scope.row.hydrogenation }}</span>
+            <el-button v-if="scope.row.hydrogenation != null" icon="el-icon-folder" style="color:#6e96fa;" @click="handleDoc(scope.row , 'certificate-hydrogenation')"  circle></el-button>
+          </template>
+        </el-table-column>
         <el-table-column label="有效期" align="center" prop="hydvalidity" width="100">
           <template slot-scope="scope">
             <span>{{ parseTime(scope.row.hydvalidity, '{y}-{m}-{d}') }}</span>
@@ -490,7 +515,12 @@
             <span>{{ parseTime(scope.row.hydnextreview, '{y}-{m}-{d}') }}</span>
           </template>
         </el-table-column>
-        <el-table-column label="裂化工艺" align="center" prop="crackingid" :show-overflow-tooltip="true"/>
+        <el-table-column label="裂化工艺" align="center" prop="crackingid" :show-overflow-tooltip="true" width="180">
+          <template slot-scope="scope">
+            <span>{{ scope.row.crackingid }}</span>
+            <el-button v-if="scope.row.crackingid != null" icon="el-icon-folder" style="color:#6e96fa;" @click="handleDoc(scope.row , 'certificate-crackingid')"  circle></el-button>
+          </template>
+        </el-table-column>
         <el-table-column label="有效期" align="center" prop="crackingvalidity" width="100">
           <template slot-scope="scope">
             <span>{{ parseTime(scope.row.crackingvalidity, '{y}-{m}-{d}') }}</span>
@@ -501,7 +531,12 @@
             <span>{{ parseTime(scope.row.crackingreview, '{y}-{m}-{d}') }}</span>
           </template>
         </el-table-column>
-        <el-table-column label="裂化工艺" align="center" prop="refrigeration" :show-overflow-tooltip="true"/>
+        <el-table-column label="制冷与空调作业" align="center" prop="refrigeration" :show-overflow-tooltip="true" width="180">
+          <template slot-scope="scope">
+            <span>{{ scope.row.refrigeration }}</span>
+            <el-button v-if="scope.row.refrigeration != null" icon="el-icon-folder" style="color:#6e96fa;" @click="handleDoc(scope.row , 'certificate-refrigeration')"  circle></el-button>
+          </template>
+        </el-table-column>
         <el-table-column label="有效期" align="center" prop="refrigerationvalidity" width="100">
           <template slot-scope="scope">
             <span>{{ parseTime(scope.row.refrigerationvalidity, '{y}-{m}-{d}') }}</span>
@@ -529,6 +564,11 @@
             <span>{{ parseTime(scope.row.foremannextreview, '{y}-{m}-{d}') }}</span>
           </template>
         </el-table-column>
+        <el-table-column label="附件" align="center" width="80">
+          <template slot-scope="scope">
+            <el-button icon="el-icon-folder" style="color:#6e96fa;" @click="handleDoc(scope.row , 'certificate-foremantrain')"  circle></el-button>
+          </template>
+        </el-table-column>
       </el-table-column>
       <el-table-column label="建筑消防(无复审)">
         <el-table-column label="取证日期" align="center" prop="fireProtection" width="100">
@@ -536,6 +576,11 @@
             <span>{{ parseTime(scope.row.fireProtection, '{y}-{m}-{d}') }}</span>
           </template>
         </el-table-column>
+        <el-table-column label="附件" align="center" width="80">
+          <template slot-scope="scope">
+            <el-button icon="el-icon-folder" style="color:#6e96fa;" @click="handleDoc(scope.row , 'certificate-fireProtection')"  circle></el-button>
+          </template>
+        </el-table-column>
       </el-table-column>
       <el-table-column label="锅炉水质处理">
         <el-table-column label="最近培训日期" align="center" prop="waterdate" width="100">
@@ -543,6 +588,11 @@
             <span>{{ parseTime(scope.row.waterdate, '{y}-{m}-{d}') }}</span>
           </template>
         </el-table-column>
+        <el-table-column label="附件" align="center" width="80">
+          <template slot-scope="scope">
+            <el-button icon="el-icon-folder" style="color:#6e96fa;" @click="handleDoc(scope.row , 'certificate-waterdate')"  circle></el-button>
+          </template>
+        </el-table-column>
       </el-table-column>
       <el-table-column label="锅炉能效">
         <el-table-column label="最近培训日期" align="center" prop="energydate" width="100">
@@ -550,6 +600,11 @@
             <span>{{ parseTime(scope.row.energydate, '{y}-{m}-{d}') }}</span>
           </template>
         </el-table-column>
+        <el-table-column label="附件" align="center" width="80">
+          <template slot-scope="scope">
+            <el-button icon="el-icon-folder" style="color:#6e96fa;" @click="handleDoc(scope.row , 'certificate-energydate')"  circle></el-button>
+          </template>
+        </el-table-column>
       </el-table-column>
       <!--<el-table-column label="创建人" align="center" prop="createrCode" :show-overflow-tooltip="true"/>-->
       <!--<el-table-column label="创建时间" align="center" prop="createdate" width="100">-->
@@ -756,8 +811,8 @@
                               placeholder="选择复审">
               </el-date-picker>
             </el-form-item>
-            <el-form-item label="裂化工艺" prop="refrigeration">
-              <el-input v-model="form.refrigeration" placeholder="请输入裂化工艺" />
+            <el-form-item label="制冷与空调作业" prop="refrigeration">
+              <el-input v-model="form.refrigeration" placeholder="请输入制冷与空调作业" />
             </el-form-item>
             <el-form-item label="有效期" prop="refrigerationvalidity">
               <el-date-picker clearable size="small" style="width: 200px"
@@ -889,6 +944,88 @@
               <el-button @click="upload.open = false">取 消</el-button>
           </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="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>
+      <!-- pdf预览 -->
+      <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>
 
@@ -898,6 +1035,7 @@ import { treeselect } from "@/api/system/dept";
 import { getToken } from "@/utils/auth";
 import Treeselect from "@riophae/vue-treeselect";
 import "@riophae/vue-treeselect/dist/vue-treeselect.css";
+import {addCommonfile, allFileList, delCommonfile, updateCommonfile} from "@/api/common/commonfile";
 
 export default {
   name: "Worklicensecertificate",
@@ -1011,7 +1149,41 @@ export default {
         deptId: [
           { required: true, message: "部门编号不能为空", trigger: "blur" }
         ]
-      }
+      },
+      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: 'training'
+        },
+        pType: 'training',
+        pId: null,
+        form: {}
+      },
+      pdf : {
+        title: '',
+        pdfUrl: '',
+        numPages: null,
+        open: false,
+        pageNum: 1,
+        pageTotalNum: 1,
+        loadedRatio: 0,
+      },
     };
   },
   watch: {
@@ -1029,6 +1201,133 @@ export default {
     this.getTreeselect();
   },
   methods: {
+    /** 删除按钮操作 */
+    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('删除成功'));
+      })
+    },
+    // 文件下载处理
+    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
+    },
+    // 上一页
+    prePage() {
+      let page = this.pdf.pageNum
+      page = page > 1 ? page - 1 : this.pdf.pageTotalNum
+      this.pdf.pageNum = page
+    },
+    // 下一页
+    nextPage() {
+      let page = this.pdf.pageNum
+      page = page < this.pdf.pageTotalNum ? page + 1 : 1
+      this.pdf.pageNum = page
+    },
+    //附件上传中处理
+    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()
+    },
+    // 文件上传中处理
+    handleFileUploadProgress(event, file, fileList) {
+      this.upload.isUploading = true;
+    },
+    // 文件上传成功处理
+    handleFileSuccess(response, file, fileList) {
+      this.upload.open = false;
+      this.upload.isUploading = false;
+      this.$refs.upload.clearFiles();
+      if (response.data[0] != null) {
+        this.$alert(this.$t('成功导入') + response.msg + this.$t('条数据') + "," + this.$t('第') + response.data + this.$t('行数据出现错误导入失败')+"。", this.$t('导入结果'), { dangerouslyUseHTMLString: true });
+      }else {
+        this.$alert(this.$t('成功导入') + response.msg + this.$t('条数据'), this.$t('导入结果'), { dangerouslyUseHTMLString: true });
+      }
+      this.getList();
+    },
+    /** 报告附件按钮操作 */
+    handleDoc(row , fileType) {
+      var workType = "";
+      if (fileType === "license-boiler"){
+        workType = '开工锅炉上岗证';
+      }else if (fileType === "license-cracking"){
+        workType = '裂解上岗证';
+      }else if (fileType === "license-hotarea"){
+        workType = '压缩上岗证';
+      }else if (fileType === "license-coldarea"){
+        workType = "分离上岗证";
+      }else if (fileType === "license-aromatic"){
+        workType = "芳烃上岗证";
+      }else if (fileType === "certificate-container"){
+        workType = "压力容器作业证书";
+      }else if (fileType === "certificate-pipe"){
+        workType = "压力管道作业证书";
+      }else if (fileType === "certificate-boilerid"){
+        workType = "锅炉证";
+      }else if (fileType === "certificate-hydrogenation"){
+        workType = "加氢工艺作业证书";
+      }else if (fileType === "certificate-crackingid"){
+        workType = "裂化工艺作业证书";
+      }else if (fileType === "certificate-refrigeration"){
+        workType = "制冷与空调作业证书";
+      }else if (fileType === "certificate-foremantrain"){
+        workType = "班组长安全生产合格证";
+      }else if (fileType === "certificate-fireProtection"){
+        workType = "建筑消防作业证书";
+      }else if (fileType === "certificate-waterdate"){
+        workType = "锅炉水质处理作业证书";
+      }else if (fileType === "certificate-energydate"){
+        workType = "锅炉能效作业证书";
+      }
+      this.doc.pType = fileType
+      this.doc.queryParams.pType = fileType
+      this.doc.id = row.id;
+      this.doc.title = row.name + '的' + workType + '附件';
+      this.doc.open = true;
+      this.doc.queryParams.pId = row.id
+      this.doc.pId = row.id
+      this.getFileList();
+    },
+    getFileList (){
+      allFileList(this.doc.queryParams).then(response => {
+        response.forEach(element => {
+          element["isEdit"] = false
+        });
+        response.forEach(element => {
+          element["isAdd"] = false
+        });
+        this.doc.commonfileList = response;
+      });
+    },
     /** 查询上岗证/作业证书一览列表 */
     getList() {
       this.loading = true;
@@ -1239,18 +1538,18 @@ export default {
               this.download(response.msg);
           });
       },
-      // 文件上传中处理
-      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();
-      },
+      // // 文件上传中处理
+      // 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();