ly пре 2 година
родитељ
комит
69e395fe64

+ 1 - 1
master/src/main/java/com/ruoyi/project/training/controller/TTrainingController.java

@@ -235,7 +235,7 @@ public class TTrainingController extends BaseController {
                 i = 1;
             }
         }
-        if (tTraining.getStartDate() != null) {
+        if (tTraining.getCourseStartdate() != null) {
             logger.info("修改了时间");
             i = 1;
         }

+ 0 - 9
ui/src/views/invoice/bookingworkticket/index.vue

@@ -564,15 +564,6 @@ import {
   getAllUserUnit
 } from "@/api/invoice/unit";
 import {
-  listUser,
-  getUser,
-  delUser,
-  addUser,
-  updateUser,
-  exportUser,
-  resetUserPwd,
-  changeUserStatus,
-  userDataScope,
   getUserByUserName
 } from "@/api/system/user";
 import {

+ 104 - 95
ui/src/views/plant/organization/index.vue

@@ -117,6 +117,7 @@ import Branch from './branch'
 import {listOgzStaffmgr} from "@/api/plant/staffmgr";
 import {getToken} from "@/utils/auth";
 import {allFileList} from "@/api/common/commonfile";
+import {getUserByUserName} from "@/api/system/user";
 
 export default {
   components: {Branch, VueDraggableResizable},
@@ -145,7 +146,7 @@ export default {
       },
       units: [],
       teams: [],
-      actualposts: ["24", "26", "14", "16", "18", "20", "12", "10", "34", "36","15"],
+      actualposts: ["24", "26", "14", "16", "18", "20", "12", "10", "34", "36","15","11"],
       dragMove: true,
       drawer: false,
       info: {},
@@ -563,104 +564,108 @@ export default {
     getChartData() {
       this.queryParams.units = this.units.join()
       this.queryParams.teams = this.teams.join()
-      this.queryParams.actualposts = this.actualposts.join()
-      listOgzStaffmgr(this.queryParams).then(response => {
-        this.staffmgrList = response;
-        this.list2 = []
-
-        for (let i = 0; i < this.staffmgrList.length; i++) {
-          console.log("第" + i)
-          let post = this.selectDictLabel(this.actualpostOptions, this.staffmgrList[i].actualpost)
-          if (this.staffmgrList[i].pId == 0) {
-            let nodeData = {
-              id: this.staffmgrList[i].id,
-              pId: this.staffmgrList[i].pId,
-              label: this.staffmgrList[i].name,
-              post: post,
-              secretary: [[], []],
-              // img: 'http://47.114.101.16:8080' + process.env.VUE_APP_BASE_API + this.staffmgrList[i].photo,
-              img: 'https://cpms.basf-ypc.net.cn' + process.env.VUE_APP_BASE_API + this.staffmgrList[i].photo,
-              bz1: false,
-              bz2: false,
-              bz3: false,
-              bz4: false,
-              bz5: false,
-              bz6: false,
-              bz7: false,
-              bz8: false
-            }
-            if (this.staffmgrList[i].specialDuty) {
-              // console.log(this.staffmgrList[i].specialDuty)
-              let dutyArr = this.staffmgrList[i].specialDuty.split(",")
-              for (let i = 0; i < dutyArr.length; i++) {
-                if (dutyArr[i] == "10") {
-                  nodeData.bz4 = true
-                } else if (dutyArr[i] == "12") {
-                  nodeData.bz3 = true
-                } else if (dutyArr[i] == "14") {
-                  nodeData.bz5 = true
-                } else if (dutyArr[i] == "16") {
-                  nodeData.bz6 = true
-                } else if (dutyArr[i] == "18") {
-                  nodeData.bz2 = true
-                } else if (dutyArr[i] == "20") {
-                  nodeData.bz1 = true
-                } else if (dutyArr[i] == "22") {
-                  nodeData.bz8 = true
-                } else if (dutyArr[i] == "24") {
-                  nodeData.bz7 = true
+      //CBP/B的人需要看ehs和副操
+      let names = this.$store.state.user.name
+      //查询用户归属的部门名称
+        if('10010' == this.$store.state.user.deptId) {
+          this.actualposts.push('22')
+        }
+          this.queryParams.actualposts = this.actualposts.join()
+          listOgzStaffmgr(this.queryParams).then(response => {
+            this.staffmgrList = response;
+            this.list2 = []
+            for (let i = 0; i < this.staffmgrList.length; i++) {
+              console.log("第" + i)
+              let post = this.selectDictLabel(this.actualpostOptions, this.staffmgrList[i].actualpost)
+              if (this.staffmgrList[i].pId == 0) {
+                let nodeData = {
+                  id: this.staffmgrList[i].id,
+                  pId: this.staffmgrList[i].pId,
+                  label: this.staffmgrList[i].name,
+                  post: post,
+                  secretary: [[], []],
+                  // img: 'http://47.114.101.16:8080' + process.env.VUE_APP_BASE_API + this.staffmgrList[i].photo,
+                  img: 'https://cpms.basf-ypc.net.cn' + process.env.VUE_APP_BASE_API + this.staffmgrList[i].photo,
+                  bz1: false,
+                  bz2: false,
+                  bz3: false,
+                  bz4: false,
+                  bz5: false,
+                  bz6: false,
+                  bz7: false,
+                  bz8: false
                 }
-              }
-            }
-            this.list2.push(nodeData)
-          } else {
-            let nodeData = {
-              id: this.staffmgrList[i].id,
-              pId: this.staffmgrList[i].pId,
-              label: this.staffmgrList[i].name,
-              post: post,
-              img: 'https://cpms.basf-ypc.net.cn' + process.env.VUE_APP_BASE_API + this.staffmgrList[i].photo,
-              // img: 'http://47.114.101.16:8080' + process.env.VUE_APP_BASE_API + this.staffmgrList[i].photo,
-              bz1: false,
-              bz2: false,
-              bz3: false,
-              bz4: false,
-              bz5: false,
-              bz6: false,
-              bz7: false,
-              bz8: false
-            }
-            if (this.staffmgrList[i].specialDuty) {
-              // console.log(this.staffmgrList[i].specialDuty)
-              let dutyArr = this.staffmgrList[i].specialDuty.split(",")
-              for (let i = 0; i < dutyArr.length; i++) {
-                if (dutyArr[i] == "10") {
-                  nodeData.bz4 = true
-                } else if (dutyArr[i] == "12") {
-                  nodeData.bz3 = true
-                } else if (dutyArr[i] == "14") {
-                  nodeData.bz5 = true
-                } else if (dutyArr[i] == "16") {
-                  nodeData.bz6 = true
-                } else if (dutyArr[i] == "18") {
-                  nodeData.bz2 = true
-                } else if (dutyArr[i] == "20") {
-                  nodeData.bz1 = true
-                } else if (dutyArr[i] == "22") {
-                  nodeData.bz8 = true
-                } else if (dutyArr[i] == "24") {
-                  nodeData.bz7 = true
+                if (this.staffmgrList[i].specialDuty) {
+                  // console.log(this.staffmgrList[i].specialDuty)
+                  let dutyArr = this.staffmgrList[i].specialDuty.split(",")
+                  for (let i = 0; i < dutyArr.length; i++) {
+                    if (dutyArr[i] == "10") {
+                      nodeData.bz4 = true
+                    } else if (dutyArr[i] == "12") {
+                      nodeData.bz3 = true
+                    } else if (dutyArr[i] == "14") {
+                      nodeData.bz5 = true
+                    } else if (dutyArr[i] == "16") {
+                      nodeData.bz6 = true
+                    } else if (dutyArr[i] == "18") {
+                      nodeData.bz2 = true
+                    } else if (dutyArr[i] == "20") {
+                      nodeData.bz1 = true
+                    } else if (dutyArr[i] == "22") {
+                      nodeData.bz8 = true
+                    } else if (dutyArr[i] == "24") {
+                      nodeData.bz7 = true
+                    }
+                  }
                 }
+                this.list2.push(nodeData)
+              } else {
+                let nodeData = {
+                  id: this.staffmgrList[i].id,
+                  pId: this.staffmgrList[i].pId,
+                  label: this.staffmgrList[i].name,
+                  post: post,
+                  img: 'https://cpms.basf-ypc.net.cn' + process.env.VUE_APP_BASE_API + this.staffmgrList[i].photo,
+                  // img: 'http://47.114.101.16:8080' + process.env.VUE_APP_BASE_API + this.staffmgrList[i].photo,
+                  bz1: false,
+                  bz2: false,
+                  bz3: false,
+                  bz4: false,
+                  bz5: false,
+                  bz6: false,
+                  bz7: false,
+                  bz8: false
+                }
+                if (this.staffmgrList[i].specialDuty) {
+                  // console.log(this.staffmgrList[i].specialDuty)
+                  let dutyArr = this.staffmgrList[i].specialDuty.split(",")
+                  for (let i = 0; i < dutyArr.length; i++) {
+                    if (dutyArr[i] == "10") {
+                      nodeData.bz4 = true
+                    } else if (dutyArr[i] == "12") {
+                      nodeData.bz3 = true
+                    } else if (dutyArr[i] == "14") {
+                      nodeData.bz5 = true
+                    } else if (dutyArr[i] == "16") {
+                      nodeData.bz6 = true
+                    } else if (dutyArr[i] == "18") {
+                      nodeData.bz2 = true
+                    } else if (dutyArr[i] == "20") {
+                      nodeData.bz1 = true
+                    } else if (dutyArr[i] == "22") {
+                      nodeData.bz8 = true
+                    } else if (dutyArr[i] == "24") {
+                      nodeData.bz7 = true
+                    }
+                  }
+                }
+                this.list2.push(nodeData)
               }
             }
-            this.list2.push(nodeData)
-          }
-        }
-
-        this.list1 = this.listToTree(this.list2)
-        console.log(this.list1)
-        console.log(JSON.stringify(this.list1))
-      })
+            this.list1 = this.listToTree(this.list2)
+            console.log(this.list1)
+            console.log(JSON.stringify(this.list1))
+          })
     },
     listToTree(list) {
       let map = {};
@@ -670,6 +675,10 @@ export default {
         }
       });
       list.forEach(item => {
+        if (item.post == 'EHS督导') { //
+          console.log('EHS督导')
+          item.secretary = null
+        }
         if (item.pId !== 0 && map[item.pId]) {
           // map[item.pId].children ? map[item.pId].children.push(item) : map[item.pId].children = [item];
           if (item.post == '装置副经理') {

+ 220 - 134
ui/src/views/training/byxWorkcertificate/index.vue

@@ -90,63 +90,48 @@
       <el-table-column :label="$t('姓名')" align="center" prop="name" :show-overflow-tooltip="true"/>
       <el-table-column :label="$t('员工号')" align="center" prop="employeeid" :show-overflow-tooltip="true"/>
       <el-table-column :label="$t('班组')" align="center" prop="classes" :formatter="classesFormat" />
-      <el-table-column :label="$t('移动式压力容器充装')" align="center" prop="container" :show-overflow-tooltip="true"/>
+      <el-table-column :label="$t('移动式压力容器充装')" align="center" prop="container" :show-overflow-tooltip="true">
+        <template slot-scope="scope">
+          <span> {{scope.row.container}}</span>
+          <el-button icon="el-icon-folder" style="color:#6e96fa;" @click="handleDoc(scope.row , 'byxworkcertificate-container')"  circle></el-button>
+        </template>
+      </el-table-column>
       <el-table-column :label="$t('证件号')" align="center" prop="containerIdnum" :show-overflow-tooltip="true"/>
       <el-table-column :label="$t('证件有效期')" align="center" prop="containerDate" width="100">
         <template slot-scope="scope">
           <span>{{ parseTime(scope.row.containerDate, '{y}-{m}-{d}') }}</span>
         </template>
       </el-table-column>
-      <el-table-column :label="$t('消防设施操作')" align="center" prop="fireFacilities" :show-overflow-tooltip="true"/>
+      <el-table-column :label="$t('消防设施操作')" align="center" prop="fireFacilities" :show-overflow-tooltip="true">
+        <template slot-scope="scope">
+          <span> {{scope.row.fireFacilities}}</span>
+          <el-button icon="el-icon-folder" style="color:#6e96fa;" @click="handleDoc(scope.row , 'byxworkcertificate-fireFacilities')"  circle></el-button>
+        </template>
+      </el-table-column>
       <el-table-column :label="$t('证件号')" align="center" prop="fireFacilitiesIdnum" :show-overflow-tooltip="true"/>
       <el-table-column :label="$t('证件有效期')" align="center" prop="fireFacilitiesDate" width="100">
         <template slot-scope="scope">
           <span>{{ parseTime(scope.row.fireFacilitiesDate, '{y}-{m}-{d}') }}</span>
         </template>
       </el-table-column>
-<!--      <el-table-column :label="$t('身份证件号')" align="center" prop="idnum" :show-overflow-tooltip="true"/>-->
-<!--      <el-table-column :label="$t('复证日期')" align="center" prop="reviewdate" width="100">-->
-<!--        <template slot-scope="scope">-->
-<!--          <span>{{ parseTime(scope.row.reviewdate, '{y}-{m}-{d}') }}</span>-->
-<!--        </template>-->
-<!--      </el-table-column>-->
-<!--      <el-table-column :label="$t('证书有效期')" align="center" prop="pipevalidity" width="100">-->
-<!--        <template slot-scope="scope">-->
-<!--          <span>{{ parseTime(scope.row.pipevalidity, '{y}-{m}-{d}') }}</span>-->
-<!--        </template>-->
-<!--      </el-table-column>-->
-      <el-table-column :label="$t('监护人专项培训')" align="center" prop="guardian" :show-overflow-tooltip="true"/>
+
+      <el-table-column :label="$t('监护人专项培训')" align="center" prop="guardian" :show-overflow-tooltip="true">
+      <template slot-scope="scope">
+        <span> {{scope.row.guardian}}</span>
+      <el-button icon="el-icon-folder" style="color:#6e96fa;" @click="handleDoc(scope.row , 'byxworkcertificate-guardian')"  circle></el-button>
+      </template>
+      </el-table-column>
       <el-table-column :label="$t('证件号')" align="center" prop="guardianIdnum" :show-overflow-tooltip="true"/>
       <el-table-column :label="$t('证书有效期')" align="center" prop="boilvalidity" width="100">
         <template slot-scope="scope">
           <span>{{ parseTime(scope.row.boilvalidity, '{y}-{m}-{d}') }}</span>
         </template>
       </el-table-column>
-<!--      <el-table-column :label="$t('加氢工艺')" align="center" prop="hydrogenation" :show-overflow-tooltip="true"/>
-      <el-table-column :label="$t('证书有效期')" align="center" prop="hydvalidity" width="100">
-        <template slot-scope="scope">
-          <span>{{ parseTime(scope.row.hydvalidity, '{y}-{m}-{d}') }}</span>
-        </template>
-      </el-table-column>
-      <el-table-column :label="$t('下次复审')" align="center" prop="hydnextreview" width="100">
-        <template slot-scope="scope">
-          <span>{{ parseTime(scope.row.hydnextreview, '{y}-{m}-{d}') }}</span>
-        </template>
-      </el-table-column>-->
-<!--      <el-table-column :label="$t('裂化工艺')" align="center" prop="cracking" :show-overflow-tooltip="true"/>
-      <el-table-column :label="$t('证书有效期')" align="center" prop="crackingvalidity" width="100">
-        <template slot-scope="scope">
-          <span>{{ parseTime(scope.row.crackingvalidity, '{y}-{m}-{d}') }}</span>
-        </template>
-      </el-table-column>
-      <el-table-column :label="$t('下次复审')" align="center" prop="crackingreview" width="100">
-        <template slot-scope="scope">
-          <span>{{ parseTime(scope.row.crackingreview, '{y}-{m}-{d}') }}</span>
-        </template>
-      </el-table-column>-->
-      <el-table-column :label="$t('班组长首次培训日期')" align="center" prop="foremantrain" width="100">
+
+      <el-table-column :label="$t('班组长首次培训日期')" align="center" prop="foremantrain" width="130">
         <template slot-scope="scope">
           <span>{{ parseTime(scope.row.foremantrain, '{y}-{m}-{d}') }}</span>
+          <el-button icon="el-icon-folder" style="color:#6e96fa;" @click="handleDoc(scope.row , 'byxworkcertificate-foremantrain')"  circle></el-button>
         </template>
       </el-table-column>
       <el-table-column :label="$t('班组长本次复审')" align="center" prop="foremanreview" width="100">
@@ -159,21 +144,7 @@
           <span>{{ parseTime(scope.row.foremannextreview, '{y}-{m}-{d}') }}</span>
         </template>
       </el-table-column>
-<!--      <el-table-column :label="$t('锅炉水质培训日期')" align="center" prop="waterdate" width="100">
-        <template slot-scope="scope">
-          <span>{{ parseTime(scope.row.waterdate, '{y}-{m}-{d}') }}</span>
-        </template>
-      </el-table-column>
-      <el-table-column :label="$t('锅炉能效培训日期')" align="center" prop="energydate" width="100">
-        <template slot-scope="scope">
-          <span>{{ parseTime(scope.row.energydate, '{y}-{m}-{d}') }}</span>
-        </template>
-      </el-table-column>
-      <el-table-column :label="$t('制冷作业培训日期')" align="center" prop="refrigerationdate" width="100">
-        <template slot-scope="scope">
-          <span>{{ parseTime(scope.row.refrigerationdate, '{y}-{m}-{d}') }}</span>
-        </template>
-      </el-table-column>-->
+
       <el-table-column :label="$t('备注')" align="center" prop="remarks" :show-overflow-tooltip="true"/>
       <el-table-column :label="$t('操作')" align="center" fixed="right" width="120" class-name="small-padding fixed-width">
         <template slot-scope="scope">
@@ -260,25 +231,7 @@
                           :placeholder="$t('请选择') + $t('证件有效期')">
           </el-date-picker>
         </el-form-item>
-<!--        <el-form-item :label="$t('身份证件号')" prop="idnum">-->
-<!--          <el-input v-model="form.idnum" :placeholder="$t('请输入') + $t('员工姓名')" />-->
-<!--        </el-form-item>-->
-<!--        <el-form-item :label="$t('复证日期')" prop="reviewdate">-->
-<!--          <el-date-picker clearable size="small" style="width: 200px"-->
-<!--                          v-model="form.reviewdate"-->
-<!--                          type="date"-->
-<!--                          value-format="yyyy-MM-dd"-->
-<!--                          :placeholder="$t('请选择') + $t('复证日期')">-->
-<!--          </el-date-picker>-->
-<!--        </el-form-item>-->
-<!--        <el-form-item :label="$t('证书有效期')" prop="pipevalidity">-->
-<!--          <el-date-picker clearable size="small" style="width: 200px"-->
-<!--                          v-model="form.pipevalidity"-->
-<!--                          type="date"-->
-<!--                          value-format="yyyy-MM-dd"-->
-<!--                          :placeholder="$t('请选择') + $t('证书有效期')">-->
-<!--          </el-date-picker>-->
-<!--        </el-form-item>-->
+
         <el-form-item :label="$t('监护人专项培训')" prop="guardian">
           <el-input v-model="form.guardian" :placeholder="$t('请输入') + $t('监护人专项培训')" />
         </el-form-item>
@@ -293,44 +246,7 @@
                           :placeholder="$t('请选择') + $t('证书有效期')">
           </el-date-picker>
         </el-form-item>
-<!--        <el-form-item :label="$t('加氢工艺')" prop="hydrogenation">
-          <el-input v-model="form.hydrogenation" :placeholder="$t('请输入') + $t('加氢工艺')" />
-        </el-form-item>
-       <el-form-item :label="$t('证书有效期')" prop="hydvalidity">
-          <el-date-picker clearable size="small" style="width: 200px"
-                          v-model="form.hydvalidity"
-                          type="date"
-                          value-format="yyyy-MM-dd"
-                          :placeholder="$t('请选择') + $t('证书有效期')">
-          </el-date-picker>
-        </el-form-item>
-        <el-form-item :label="$t('下次复审')" prop="hydnextreview">
-          <el-date-picker clearable size="small" style="width: 200px"
-                          v-model="form.hydnextreview"
-                          type="date"
-                          value-format="yyyy-MM-dd"
-                          :placeholder="$t('请选择') + $t('下次复审')">
-          </el-date-picker>
-        </el-form-item>-->
-<!--        <el-form-item :label="$t('裂化工艺')" prop="cracking">
-          <el-input v-model="form.cracking" :placeholder="$t('请输入') + $t('裂化工艺')" />
-        </el-form-item>
-        <el-form-item :label="$t('证书有效期')" prop="crackingvalidity">
-          <el-date-picker clearable size="small" style="width: 200px"
-                          v-model="form.crackingvalidity"
-                          type="date"
-                          value-format="yyyy-MM-dd"
-                          :placeholder="$t('请选择') + $t('证书有效期')">
-          </el-date-picker>
-        </el-form-item>
-        <el-form-item :label="$t('下次复审')" prop="crackingreview">
-          <el-date-picker clearable size="small" style="width: 200px"
-                          v-model="form.crackingreview"
-                          type="date"
-                          value-format="yyyy-MM-dd"
-                          :placeholder="$t('请选择') + $t('下次复审')">
-          </el-date-picker>
-        </el-form-item>-->
+
         <el-form-item :label="$t('班组长首次培训日期')" prop="foremantrain">
           <el-date-picker clearable size="small" style="width: 200px"
                           v-model="form.foremantrain"
@@ -355,30 +271,7 @@
                           :placeholder="$t('请选择') + $t('班组长下次复审')">
           </el-date-picker>
         </el-form-item>
-<!--        <el-form-item :label="$t('锅炉水质培训日期')" prop="waterdate">
-          <el-date-picker clearable size="small" style="width: 200px"
-                          v-model="form.waterdate"
-                          type="date"
-                          value-format="yyyy-MM-dd"
-                          :placeholder="$t('请选择') + $t('锅炉水质培训日期')">
-          </el-date-picker>
-        </el-form-item>
-        <el-form-item :label="$t('锅炉能效培训日期')" prop="energydate">
-          <el-date-picker clearable size="small" style="width: 200px"
-                          v-model="form.energydate"
-                          type="date"
-                          value-format="yyyy-MM-dd"
-                          :placeholder="$t('请选择') + $t('锅炉能效培训日期')">
-          </el-date-picker>
-        </el-form-item>
-        <el-form-item :label="$t('制冷作业培训日期')" prop="refrigerationdate">
-          <el-date-picker clearable size="small" style="width: 200px"
-                          v-model="form.refrigerationdate"
-                          type="date"
-                          value-format="yyyy-MM-dd"
-                          :placeholder="$t('请选择') + $t('制冷作业培训日期')">
-          </el-date-picker>
-        </el-form-item>-->
+
         <el-form-item :label="$t('备注')" prop="remarks">
           <el-input v-model="form.remarks" :placeholder="$t('请输入') + $t('备注')" />
         </el-form-item>
@@ -424,6 +317,88 @@
         <el-button @click="upload.open = false">{{ $t('取 消') }}</el-button>
       </div>
     </el-dialog>
+    <!-- 报告附件对话框 -->
+    <el-dialog v-dialogDrag :title="doc.title" :visible.sync="doc.open" width="1000px" append-to-body >
+      <el-upload v-hasPermi="['training:trainingrecords:file']"
+                 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>
+      <el-dialog 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>
     <el-drawer
       :title="$t('数据分析')"
       size="600px"
@@ -459,6 +434,7 @@ import {
   import Treeselect from "@riophae/vue-treeselect";
   import "@riophae/vue-treeselect/dist/vue-treeselect.css";
   import CertData from "./certData";
+import {allFileList, delCommonfile} from "@/api/common/commonfile";
 
   export default {
     name: "byxWorkcertificate",
@@ -510,6 +486,41 @@ import {
           // 上传的地址
           url: process.env.VUE_APP_BASE_API + "/training/byxWorkcertificate/importData"
         },
+        // 报告附件参数
+        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,
+          open: false,
+          pageNum: 1,
+          pageTotalNum: 1,
+          loadedRatio: 0,
+        },
         // 查询参数
         queryParams: {
           pageNum: 1,
@@ -741,7 +752,82 @@ import {
       //数据分析
       handleData(){
         this.drawer = true
-      }
+      },
+      /** 报告附件按钮操作 */
+      handleDoc(row , fileType) {
+        var workType = "";
+        if (fileType === "byxworkcertificate-container"){
+          workType = this.$t('移动式压力容器充装');
+        }else if (fileType === "byxworkcertificate-fireFacilities"){
+          workType = this.$t('消防设施操作');
+        }else if (fileType === "byxworkcertificate-guardian") {
+          workType = this.$t('监护人专项培训');
+        }else if (fileType === "byxworkcertificate-foremantrain") {
+          workType = this.$t('班组长');
+        }
+
+        this.doc.pType = fileType
+        this.doc.queryParams.pType = fileType
+        this.doc.id = row.id;
+        this.doc.title = row.name + this.$t('的')+ this.$t('空格') + workType+ this.$t('空格') + this.$t('空格')+ 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()
+        })
+      },
+      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
+      },
+      // 文件下载处理
+      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()
+      },
+      /** 删除按钮操作 */
+      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('删除成功'));
+        })
+      },
+      openPdf(){
+        window.open(this.pdf.pdfUrl);//path是文件的全路径地址
+      },
+      //附件上传中处理
+      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()
+      },
+      getFileList (){
+        allFileList(this.doc.queryParams).then(response => {
+          this.doc.commonfileList = response;
+        });
+      },
     }
   };
 </script>

+ 3 - 3
ui/src/views/training/matrix/index.vue

@@ -84,9 +84,9 @@
     </el-row>
 
     <el-table ref="matrixTable" v-loading="loading" :data="matrixList" @selection-change="handleSelectionChange" :cell-class-name="tableCellClassName" :height="clientHeight" border>
-      <el-table-column type="selection" width="55" min-width="55" align="center" />
-      <el-table-column :label="$t('培训级别')" align="center" prop="trainingLevel" width="150" min-width="55":formatter="trainingLevelFormat" />
-      <el-table-column :label="$t('课程名称')" align="center" prop="item" width="250" min-width="55":show-overflow-tooltip="true"/>
+      <el-table-column type="selection" width="55" fixed="left" min-width="55" align="center" />
+      <el-table-column :label="$t('培训级别')" fixed="left" align="center" prop="trainingLevel" width="150" min-width="55":formatter="trainingLevelFormat" />
+      <el-table-column :label="$t('课程名称')" fixed="left" align="center" prop="item" width="250" min-width="55":show-overflow-tooltip="true"/>
       <el-table-column :label="$t('课程代码')" align="center" prop="courseCode" width="150" min-width="55":show-overflow-tooltip="true"/>
       <el-table-column :label="$t('频率')" align="center" prop="frequency" width="300" min-width="55":show-overflow-tooltip="true"/>
       <el-table-column :label="$t('责任部门')" align="center" prop="responsDept" width="120" min-width="120" :formatter="responsDeptFormat" />