From b64a83dda524fd1aa969622e2cb8e9469a95a283 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期五, 28 二月 2025 17:12:23 +0800
Subject: [PATCH] 人员-人员能力、沟通记录搬迁

---
 src/views/CNAS/personnel/personnelInfo/tabs/personnel-capacity.vue |  193 ++++++++++++++++++-----------------------------
 1 files changed, 74 insertions(+), 119 deletions(-)

diff --git a/src/views/CNAS/personnel/personnelInfo/tabs/personnel-capacity.vue b/src/views/CNAS/personnel/personnelInfo/tabs/personnel-capacity.vue
index b6dc914..ac989ea 100644
--- a/src/views/CNAS/personnel/personnelInfo/tabs/personnel-capacity.vue
+++ b/src/views/CNAS/personnel/personnelInfo/tabs/personnel-capacity.vue
@@ -1,39 +1,29 @@
 <!-- 浜哄憳鑳藉姏 -->
 <template>
   <div>
-    <div style="text-align: left; margin-bottom: 15px;padding: 0 16px">
-      <label>濮撳悕</label>
-      <el-input v-model="userName" placeholder="璇疯緭鍏ュ鍚�" size="small" style="width: 20vh;"></el-input>
-      <el-button size="small" type="primary" @click="refreshTable">鏌ヨ</el-button>
-      <div v-if="!isDepartment" style="float: right;">
-        <el-button size="small" type="primary" @click="addAppointPost('add')">鏂板</el-button>
+    <div style="display: flex;justify-content: space-between;">
+      <el-form ref="page" size="small" :inline="true">
+        <el-form-item label="濮撳悕">
+          <el-input v-model="userName" placeholder="璇疯緭鍏ュ鍚�" size="small" clearable></el-input>
+        </el-form-item>
+        <el-form-item>
+          <el-button size="small" type="primary" @click="refreshTable">鏌� 璇�</el-button>
+        </el-form-item>
+      </el-form>
+      <div>
+        <el-button v-if="!isDepartment" size="small" type="primary" @click="addAppointPost('add')">鏂板</el-button>
       </div>
     </div>
-    <div class="table">
-      <TableCard :showForm="false" :showTitle="false">
-        <template v-slot:table>
-          <ZTTable
-            :column="yearColumnData"
-            :height="'calc(100vh - 20em)'"
-            :table-data="tableData"
-            :table-loading="yearLoading"
-            style="padding: 0 15px;margin-bottom: 16px"
-          >
-            <div slot="jobResponsibilities" slot-scope="scope">
-              <div v-html="changeLine(scope.row.responsibilities)"></div>
-            </div>
-            <div slot="placeWorkSlot" slot-scope="scope">
-              <div v-html="changeLine(scope.row.placeWork)"></div>
-            </div>
-          </ZTTable>
-        </template>
-      </TableCard>
-      <el-pagination :current-page="1" :page-size="search.size" :page-sizes="[10, 20, 30, 50, 100]"
-                     :total="search.total" layout="->,total, sizes, prev, pager, next, jumper"
-                     @size-change="handleSizeChange"
-                     @current-change="handleCurrentChange">
-      </el-pagination>
-    </div>
+    <lims-table :tableData="tableData" :column="yearColumnData"
+                @pagination="pagination" :height="'calc(100vh - 20em)'"
+                :page="search" :tableLoading="yearLoading">
+      <div slot="jobResponsibilities" slot-scope="scope">
+        <div v-html="changeLine(scope.row.responsibilities)"></div>
+      </div>
+      <div slot="placeWorkSlot" slot-scope="scope">
+        <div v-html="changeLine(scope.row.placeWork)"></div>
+      </div>
+    </lims-table>
     <!--鏂板鑳藉姏璁ゅ畾寮规-->
     <el-dialog :close-on-click-modal="false" :close-on-press-escape="false" :title="title"
                :visible.sync="dialogVisible"
@@ -48,11 +38,6 @@
             </el-select>
           </el-form-item>
         </el-col>
-<!--        <el-col :span="12">-->
-<!--          <el-form-item label="鑱岀О锛�" label-width="110px" prop="technicalPost">-->
-<!--            <el-input v-model="form.technicalPost" :disabled="operationType === 'view'" clearable size="small" style="width: 100%;"/>-->
-<!--          </el-form-item>-->
-<!--        </el-col>-->
         <el-col :span="24">
           <div style="display: flex;justify-content: space-evenly;font-weight: 600">
             <span>鏌ユ牳缁撴灉</span>
@@ -67,7 +52,7 @@
         </el-col>
         <el-col :span="8">
           <el-form-item class="radio-group" prop="academicConformNot" style="text-align: center">
-            <el-radio-group v-model="form.academicConformNot" :disabled="operationType === 'view' || operationType === 'confirm'">
+            <el-radio-group v-model="form.academicConformNot" :disabled="operationType === 'view' || operationType === 'confirm'" v-removeAriaHidden>
               <el-radio :label="1">绗﹀悎</el-radio>
               <el-radio :label="2">涓嶇鍚�</el-radio>
               <el-radio :label="3">涓嶉�傜敤</el-radio>
@@ -86,7 +71,7 @@
         </el-col>
         <el-col :span="8">
           <el-form-item class="radio-group" prop="relatedYearsConformNot" style="text-align: center">
-            <el-radio-group v-model="form.relatedYearsConformNot" :disabled="operationType === 'view' || operationType === 'confirm'">
+            <el-radio-group v-model="form.relatedYearsConformNot" :disabled="operationType === 'view' || operationType === 'confirm'" v-removeAriaHidden>
               <el-radio :label="1">绗﹀悎</el-radio>
               <el-radio :label="2">涓嶇鍚�</el-radio>
               <el-radio :label="3">涓嶉�傜敤</el-radio>
@@ -105,7 +90,7 @@
         </el-col>
         <el-col :span="8">
           <el-form-item class="radio-group" prop="relatedTrainingConformNot" style="text-align: center">
-            <el-radio-group v-model="form.relatedTrainingConformNot" :disabled="operationType === 'view' || operationType === 'confirm'">
+            <el-radio-group v-model="form.relatedTrainingConformNot" :disabled="operationType === 'view' || operationType === 'confirm'" v-removeAriaHidden>
               <el-radio :label="1">绗﹀悎</el-radio>
               <el-radio :label="2">涓嶇鍚�</el-radio>
               <el-radio :label="3">涓嶉�傜敤</el-radio>
@@ -125,7 +110,7 @@
         </el-col>
         <el-col :span="8">
           <el-form-item class="radio-group" prop="relevantExperienceConformNot" style="text-align: center">
-            <el-radio-group v-model="form.relevantExperienceConformNot" :disabled="operationType === 'view' || operationType === 'confirm'">
+            <el-radio-group v-model="form.relevantExperienceConformNot" :disabled="operationType === 'view' || operationType === 'confirm'" v-removeAriaHidden>
               <el-radio :label="1">绗﹀悎</el-radio>
               <el-radio :label="2">涓嶇鍚�</el-radio>
               <el-radio :label="3">涓嶉�傜敤</el-radio>
@@ -147,7 +132,7 @@
         </el-col>
         <el-col :span="8">
           <el-form-item class="radio-group" prop="workLicenseConformNot" style="text-align: center">
-            <el-radio-group v-model="form.workLicenseConformNot" :disabled="operationType === 'view' || operationType === 'confirm'">
+            <el-radio-group v-model="form.workLicenseConformNot" :disabled="operationType === 'view' || operationType === 'confirm'" v-removeAriaHidden>
               <el-radio :label="1">绗﹀悎</el-radio>
               <el-radio :label="2">涓嶇鍚�</el-radio>
               <el-radio :label="3">涓嶉�傜敤</el-radio>
@@ -163,7 +148,7 @@
           <el-form-item label="宀椾綅鑱岃矗锛�" label-width="110px" prop="jobResponsibilitiesTem" style="height: 450px">
             <el-checkbox-group v-model="form.jobResponsibilitiesTem" :disabled="operationType === 'view' || operationType === 'confirm'"
                                @change="selectResponsibilities">
-              <el-checkbox v-for="city in responsibilities" :key="city.value" :label="city.label"
+              <el-checkbox v-for="city in dict.type.responsibilities_list" :key="city.value" :label="city.label"
                            :value="city.value"></el-checkbox>
             </el-checkbox-group>
           </el-form-item>
@@ -171,7 +156,7 @@
         <el-col :span="8">
           <el-form-item class="radio-group" prop="jobResponsibilitiesConformNot"
                         style="text-align: center;height: 420px">
-            <el-radio-group v-model="form.jobResponsibilitiesConformNot" :disabled="operationType === 'view' || operationType === 'confirm'">
+            <el-radio-group v-model="form.jobResponsibilitiesConformNot" :disabled="operationType === 'view' || operationType === 'confirm'" v-removeAriaHidden>
               <el-radio :label="1">绗﹀悎</el-radio>
               <el-radio :label="2">涓嶇鍚�</el-radio>
               <el-radio :label="3">涓嶉�傜敤</el-radio>
@@ -189,7 +174,7 @@
         </el-col>
         <el-col :span="16">
           <el-form-item label="缁煎悎璇勪环锛�" label-width="110px" prop="comprehensiveAssessment">
-            <el-radio-group v-model="form.comprehensiveAssessment" :disabled="operationType === 'view' || operationType === 'confirm'">
+            <el-radio-group v-model="form.comprehensiveAssessment" :disabled="operationType === 'view' || operationType === 'confirm'" v-removeAriaHidden>
               <el-radio label="Qualified this position">鍙儨浠昏宀椾綅</el-radio>
               <el-radio label="You can work while training">鍙竟鍩硅杈逛笂宀�</el-radio>
               <el-radio label="Iconpetent for the position">涓嶈儨浠昏宀椾綅</el-radio>
@@ -218,6 +203,18 @@
 
 <script>
 
+import limsTable from "@/components/Table/lims-table.vue";
+import {
+  addOrUpdatePersonPersonnelCapacity,
+  confirmPersonnelCapability,
+  deletePersonPersonnelCapacity,
+  exportPersonnelCapacity,
+  personPersonnelCapacityPage,
+  submitConfirmPersonnelCapability
+} from "@/api/cnas/personal/personPersonnelCapacity";
+import {selectUserCondition} from "@/api/cnas/resourceDemand/facilitiesEnvironment/facilitiesAndEnvironment";
+import {mapGetters} from "vuex";
+
 export default {
   props: {
     departId: {
@@ -232,8 +229,12 @@
     }
   },
   components: {
-
+    limsTable
   },
+  computed: {
+    ...mapGetters(["userId"]),
+  },
+  dicts: ['responsibilities_list'],
   data() {
     return {
       userName: '',
@@ -344,7 +345,7 @@
                 this.handleViewClick('confirm', row);
               },
               disabled: (row) => {
-                if (row.confirmDate || JSON.parse(localStorage.getItem("user")).userId != row.confirmOperatingPersonnelId) {
+                if (row.confirmDate || this.userId != row.confirmOperatingPersonnelId) {
                   return true
                 } else {
                   return false
@@ -401,35 +402,10 @@
   methods: {
     // 涓嬭浇
     downLoadPost(row) {
-      this.$axios.get(this.$api.personnel.exportPersonnelCapacity + '?id=' + row.id,{responseType: "blob"}).then(res => {
+      exportPersonnelCapacity({id: row.id}).then(res => {
         this.outLoading = false
         const blob = new Blob([res],{ type: 'application/msword' });
-        //灏咮lob 瀵硅薄杞崲鎴愬瓧绗︿覆
-        let reader = new FileReader();
-        reader.readAsText(blob, 'utf-8');
-        reader.onload = () => {
-          try {
-            let result = JSON.parse(reader.result);
-            if (result.message) {
-              this.$message.error(result.message);
-            } else {
-              const url = URL.createObjectURL(blob);
-              const link = document.createElement('a');
-              link.href = url;
-              link.download = "浜哄憳鑳藉姏瀵煎嚭" + '.docx';
-              link.click();
-              this.$message.success('瀵煎嚭鎴愬姛')
-            }
-          } catch (err) {
-            console.log(err);
-            const url = URL.createObjectURL(blob);
-            const link = document.createElement('a');
-            link.href = url;
-            link.download = "浜哄憳鑳藉姏瀵煎嚭" + '.docx';
-            link.click();
-            this.$message.success('瀵煎嚭鎴愬姛')
-          }
-        }
+        this.$download.saveAs(blob, '浜哄憳鑳藉姏瀵煎嚭.docx')
       })
     },
     // 鏌ヨ
@@ -439,11 +415,21 @@
     // 鑾峰彇浜哄憳鑳藉姏鍒楄〃淇℃伅
     getList(userId) {
       this.search.userId = userId;
-      const name = this.isDepartment ? 'departmentId' : 'userId';
+      const params = this.isDepartment ?
+        {
+          departmentId: this.search.userId,
+          size: this.search.size,
+          current: this.search.current,
+          userName: this.userName,
+        }: {
+          userId: this.search.userId,
+          size: this.search.size,
+          current: this.search.current,
+          userName: this.userName,
+        }
       this.yearLoading = true
-      this.$axios.get(this.$api.personnel.personPersonnelCapacityPage + '?userName=' + this.userName + `&${name}=` + this.search.userId + '&size=' + this.search.size + '&current=' + this.search.current).then(res => {
+      personPersonnelCapacityPage(params).then(res => {
         this.yearLoading = false
-        if (res.code === 201) return;
         this.tableData = res.data.records;
         this.search.total = res.data.total;
       }).catch(err => {
@@ -451,22 +437,19 @@
         this.yearLoading = false
       })
     },
+    pagination (page) {
+      this.search.size = page.limit
+      this.refreshTable()
+    },
     selectResponsibilities(arr) {
       let arrTem = [];
       arr.map(val => {
-        const index = this.responsibilities.findIndex(item => item.label === val);
+        const index = this.dict.type.responsibilities_list.findIndex(item => item.label === val);
         if (index > -1) {
-          arrTem.push(this.responsibilities[index].value);
+          arrTem.push(this.dict.type.responsibilities_list[index].value);
         }
       });
       this.form.jobResponsibilities = arrTem.join(',');
-    },
-    getResponsibilities() {
-      this.$axios.post(this.$api.enums.selectEnumByCategory, {
-        category: '宀椾綅鑱岃矗'
-      }).then(res => {
-        this.responsibilities = res.data;
-      });
     },
     changeLine (val) {
       if(val) {
@@ -480,13 +463,11 @@
       this.operationType = type;
       this.title = '鏂板鑳藉姏璁ゅ畾'
       this.dialogVisible = true;
-      console.log('this.departId---', this.departId)
       this.form = {
         jobResponsibilitiesTem: []
       }
       this.form.userId = this.departId
       this.getUserList();
-      this.getResponsibilities();
 
     },
     // 缂栬緫/鏌ョ湅
@@ -502,17 +483,12 @@
         this.$set(this.form, 'jobResponsibilitiesTem', [])
       }
       this.getUserList();
-      this.getResponsibilities();
     },
     // 淇濆瓨
     submitForm() {
       this.$refs.infoForm.validate((valid) => {
         if (valid) {
-          this.$axios.post(this.$api.personnel.addOrUpdatePersonPersonnelCapacity, this.form, {
-            headers: {
-              'Content-Type': 'application/json'
-            }
-          }).then(res => {
+          addOrUpdatePersonPersonnelCapacity(this.form).then(res => {
             if (res.code == 200) {
               this.$message.success('鎻愪氦鎴愬姛');
               this.getList(this.departId);
@@ -526,11 +502,7 @@
     submitForm1() {
       this.$refs.infoForm.validate((valid) => {
         if (valid) {
-          this.$axios.post(this.$api.personnel.submitConfirmPersonnelCapability, this.form, {
-            headers: {
-              'Content-Type': 'application/json'
-            }
-          }).then(res => {
+          submitConfirmPersonnelCapability(this.form).then(res => {
             if (res.code == 200) {
               this.$message.success('鎻愪氦鎴愬姛');
               this.getList(this.departId);
@@ -541,7 +513,7 @@
       });
     },
     verifyGet () {
-      this.$axios.get(this.$api.personnel.confirmPersonnelCapability + '?id=' + this.verifyGetId).then(res => {
+      confirmPersonnelCapability({id: this.verifyGetId}).then(res => {
         if (res.code == 200) {
           this.$message.success('纭鎴愬姛');
           this.resetForm()
@@ -556,7 +528,7 @@
         cancelButtonText: '鍙栨秷',
         type: 'warning'
       }).then(() => {
-        this.$axios.delete(this.$api.personnel.deletePersonPersonnelCapacity + '?id=' + id).then(res => {
+        deletePersonPersonnelCapacity({id: id}).then(res => {
           if (res.code == 200) {
             this.$message.success('鍒犻櫎鎴愬姛');
             this.getList(this.departId);
@@ -571,20 +543,12 @@
       this.dialogVisible = false;
     },
     getUserList(){
-      this.$axios.get(this.$api.user.selectDepartmentLimsUserList).then(res => {
+      selectUserCondition().then(res => {
         if (res.code == 200) {
           this.responsibleOptions = res.data
         }
       })
     },
-    handleSizeChange(val) {
-      this.search.size = val;
-      this.getList(this.departId);
-    },
-    handleCurrentChange(val) {
-      this.search.current = val;
-      this.getList(this.departId);
-    }
   },
   watch: {
     // 鐩戝惉鐐瑰嚮el-tree鐨勬暟鎹紝杩涜鏁版嵁鍒锋柊
@@ -593,21 +557,12 @@
         this.getList(newId);
       }
     },
-    // 鐩戝惉鐐瑰嚮el-tree鐨勬暟鎹紝杩涜鏁版嵁鍒锋柊
-    isDepartment: {
-      handler(newId, oldId) {
-        this.getList(this.departId);
-      }
-    },
   }
 };
 </script>
 <style scoped>
->>>.el-dialog {
-  margin: 6vh auto 50px !important;
-}
 >>> .el-dialog__body {
-  max-height: 70vh;
+  max-height: 74vh;
   overflow-y: auto;
 }
 

--
Gitblit v1.9.3