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/index.vue                     |   16 
 src/InspectionWorker.worker.js                                       |    4 
 src/views/CNAS/personnel/personnelInfo/tabs/communicate.vue          |  334 +++++++++----------------
 src/views/CNAS/personnel/personnelInfo/components/communicateAdd.vue |  136 ++++++++++
 src/utils/index.js                                                   |    2 
 src/api/cnas/personal/personPersonnelCapacity.js                     |   51 +++
 src/views/CNAS/personnel/personnelInfo/tabs/personnel-capacity.vue   |  193 +++++---------
 src/api/cnas/personal/personPersonCommunicationAbilityPage.js        |   35 ++
 8 files changed, 426 insertions(+), 345 deletions(-)

diff --git a/src/InspectionWorker.worker.js b/src/InspectionWorker.worker.js
index c8e0764..9f6d11c 100644
--- a/src/InspectionWorker.worker.js
+++ b/src/InspectionWorker.worker.js
@@ -1815,7 +1815,7 @@
     // Create version of divisor with leading zero.
     bz.unshift(0);
 
-    // Add zeros to make remainder as long as divisor.
+    // CommunicateAdd zeros to make remainder as long as divisor.
     for (; rl++ < bl; ) r.push(0);
 
     do {
@@ -1853,7 +1853,7 @@
         }
       }
 
-      // Add the digit n to the result array.
+      // CommunicateAdd the digit n to the result array.
       qc[qi++] = cmp ? n : ++n;
 
       // Update the remainder.
diff --git a/src/api/cnas/personal/personPersonCommunicationAbilityPage.js b/src/api/cnas/personal/personPersonCommunicationAbilityPage.js
new file mode 100644
index 0000000..c1d553c
--- /dev/null
+++ b/src/api/cnas/personal/personPersonCommunicationAbilityPage.js
@@ -0,0 +1,35 @@
+import request from "@/utils/request";
+
+// 鏌ヨ浜哄憳娌熼�氳褰�
+export function personPersonCommunicationAbilityPage(query) {
+  return request({
+    url: "/personCommunicationAbility/personPersonCommunicationAbilityPage",
+    method: "get",
+    params: query
+  });
+}
+// 鍒犻櫎浜哄憳娌熼�氳褰�
+export function deletePersonCommunicationAbility(query) {
+  return request({
+    url: "/personCommunicationAbility/deletePersonCommunicationAbility",
+    method: "delete",
+    params: query
+  });
+}
+// 瀵煎嚭浜哄憳娌熼�氳褰�
+export function exportPersonCommunicationAbility(query) {
+  return request({
+    url: "/personCommunicationAbility/exportPersonCommunicationAbility",
+    method: "get",
+    params: query,
+    responseType: "blob"
+  });
+}
+// 鏂板-缂栬緫浜哄憳娌熼�氳褰�
+export function addOrUpdatePersonCommunicationAbility(query) {
+  return request({
+    url: "/personCommunicationAbility/addOrUpdatePersonCommunicationAbility",
+    method: "post",
+    data: query
+  });
+}
diff --git a/src/api/cnas/personal/personPersonnelCapacity.js b/src/api/cnas/personal/personPersonnelCapacity.js
new file mode 100644
index 0000000..f5b4503
--- /dev/null
+++ b/src/api/cnas/personal/personPersonnelCapacity.js
@@ -0,0 +1,51 @@
+import request from "@/utils/request";
+
+// 鏌ヨ浜哄憳鑳藉姏
+export function personPersonnelCapacityPage(query) {
+  return request({
+    url: "/personPersonnelCapacity/personPersonnelCapacityPage",
+    method: "get",
+    params: query
+  });
+}
+// 鏂板缂栬緫浜哄憳鑳藉姏
+export function addOrUpdatePersonPersonnelCapacity(query) {
+  return request({
+    url: "/personPersonnelCapacity/addOrUpdatePersonPersonnelCapacity",
+    method: "post",
+    data: query
+  });
+}
+// 鏂板缂栬緫浜哄憳鑳藉姏
+export function submitConfirmPersonnelCapability(query) {
+  return request({
+    url: "/personPersonnelCapacity/submitConfirmPersonnelCapability",
+    method: "post",
+    data: query
+  });
+}
+// 纭浜哄憳鑳藉姏
+export function confirmPersonnelCapability(query) {
+  return request({
+    url: "/personPersonnelCapacity/confirmPersonnelCapability",
+    method: "get",
+    params: query
+  });
+}
+// 鍒犻櫎浜哄憳鑳藉姏
+export function deletePersonPersonnelCapacity(query) {
+  return request({
+    url: "/personPersonnelCapacity/deletePersonPersonnelCapacity",
+    method: "delete",
+    params: query
+  });
+}
+// 瀵煎嚭浜哄憳鑳藉姏
+export function exportPersonnelCapacity(query) {
+  return request({
+    url: "/personPersonnelCapacity/exportPersonnelCapacity",
+    method: "get",
+    params: query,
+    responseType: "blob"
+  });
+}
diff --git a/src/utils/index.js b/src/utils/index.js
index 6a246f9..553fb3c 100644
--- a/src/utils/index.js
+++ b/src/utils/index.js
@@ -307,7 +307,7 @@
 }
 
 /**
- * Add class to element
+ * CommunicateAdd class to element
  * @param {HTMLElement} elm
  * @param {string} cls
  */
diff --git a/src/views/CNAS/personnel/personnelInfo/components/communicateAdd.vue b/src/views/CNAS/personnel/personnelInfo/components/communicateAdd.vue
new file mode 100644
index 0000000..8ac6ea6
--- /dev/null
+++ b/src/views/CNAS/personnel/personnelInfo/components/communicateAdd.vue
@@ -0,0 +1,136 @@
+<template><div class="add">
+  <el-dialog
+    :title="isEdit ?'缂栬緫闄勪欢璧勬枡':'鏂板闄勪欢璧勬枡'"
+    :visible.sync="dialogVisible"
+    width="40%"
+  >
+    <el-form
+      :model="form"
+      ref="form"
+      :rules="rules"
+      label-width="80px"
+      size="small"
+    >
+      <el-form-item label="娌熼�氫汉" prop="userId">
+        <el-select
+          v-model="form.userId"
+          placeholder="璇烽�夋嫨"
+          style="width: 100%" multiple
+        >
+          <el-option
+            v-for="(item, index) in userList"
+            :key="index"
+            :label="item.name"
+            :value="item.id"
+          ></el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item label="娌熼�氭椂闂�" prop="communicationTime">
+        <el-date-picker
+          v-model="form.communicationTime"
+          type="datetime"
+          value-format="yyyy-MM-dd HH:mm:ss"
+          placeholder="璇烽�夋嫨鏃ユ湡鏃堕棿"
+          style="width: 100%"
+        >
+        </el-date-picker>
+      </el-form-item >
+      <el-form-item label="娌熼�氬湴鐐�" prop="communicationPlace">
+        <el-input v-model="form.communicationPlace" placeholder="璇峰~鍐欐矡閫氬湴鐐�"></el-input>
+      </el-form-item >
+      <el-form-item label="娌熼�氬唴瀹�" prop="communicationContent">
+        <el-input v-model="form.communicationContent" placeholder="璇峰~鍐欐矡閫氬唴瀹�"></el-input>
+      </el-form-item >
+    </el-form>
+    <div slot="footer" class="foot">
+      <el-button @click="dialogVisible = false">鍙� 娑�</el-button>
+      <el-button type="primary" :loading="loading" @click="submitForm">纭� 瀹�</el-button>
+    </div>
+  </el-dialog>
+</div>
+</template>
+<script>
+import {selectUserCondition} from "@/api/business/inspectionTask";
+import {addOrUpdatePersonCommunicationAbility} from "@/api/cnas/personal/personPersonCommunicationAbilityPage";
+
+export default {
+  data() {
+    return {
+      isEdit: false,
+      dialogVisible: false,
+      form: {
+        id: '',
+        userId: [],
+        communicationTime: undefined,
+        communicationPlace: undefined,
+        communicationContent: undefined
+      },
+      rules: {
+        userId: [{ required: true, message: '璇烽�夋嫨娌熼�氫汉', trigger: 'change' }],
+        communicationTime: [{ required: true, message: '璇烽�夋嫨娌熼�氭椂闂�', trigger: 'change' }],
+        communicationPlace: [{ required: true, message: '璇峰~鍐欐矡閫氬湴鐐�', trigger: 'blur' }],
+        communicationContent: [{ required: true, message: '璇峰~鍐欐矡閫氬唴瀹�', trigger: 'blur' }],
+      },
+      loading: false,
+      userList: []
+    }
+  },
+  methods: {
+    /**
+     * @desc 鏄剧ず妯℃�佹
+     * @param {*} row
+     * @param {*} type
+     */
+    openDialog(row, type) {
+      this.getUserList()
+      this.dialogVisible = true
+      if(type) {
+        this.isEdit = true
+        this.form.id = row.id
+        this.form.userId = row.userId.split(',').map(m=>Number(m))
+        this.form.communicationTime = row.communicationTime
+        this.form.communicationPlace = row.communicationPlace
+        this.form.communicationContent = row.communicationContent
+      } else {
+        this.form.id = ''
+        this.resetForm('form')
+      }
+    },
+    /**
+     * @desc 鑾峰彇鐢ㄦ埛淇℃伅
+     */
+    async getUserList() {
+      selectUserCondition().then((res) => {
+        this.userList = res.data;
+      })
+    },
+    /**
+     * @desc 鎻愪氦琛ㄥ崟
+     */
+    async submitForm() {
+      this.$refs.form.validate((valid) => {
+        if (valid) {
+          this.loading = true
+          const params = {
+            id: this.form.id,
+            userId: this.form.userId.join(','),
+            communicationTime: this.form.communicationTime,
+            communicationPlace: this.form.communicationPlace,
+            communicationContent: this.form.communicationContent,
+          }
+          addOrUpdatePersonCommunicationAbility(params).then((res) => {
+            this.loading = false
+            this.resetForm('form')
+            this.$emit('submit')
+            this.dialogVisible = false
+          }).catch((err) => {
+            this.loading = false
+          })
+        }
+      })
+    }
+  }
+}
+</script>
+<style scoped>
+</style>
diff --git a/src/views/CNAS/personnel/personnelInfo/index.vue b/src/views/CNAS/personnel/personnelInfo/index.vue
index 0fa410d..9867a41 100644
--- a/src/views/CNAS/personnel/personnelInfo/index.vue
+++ b/src/views/CNAS/personnel/personnelInfo/index.vue
@@ -78,14 +78,14 @@
         <el-tab-pane label="浠昏亴鎺堟潈璁板綍" name="浠昏亴鎺堟潈璁板綍">
           <Mandate v-if="activeName === '浠昏亴鎺堟潈璁板綍'" ref="manDateRef" :departId="departId" :isDepartment="isDepartment"></Mandate>
         </el-tab-pane>
-<!--        <el-tab-pane label="浜哄憳鑳藉姏" name="浜哄憳鑳藉姏">-->
-<!--          <personnel-capacity v-if="activeName === '浜哄憳鑳藉姏'" ref="personnelCapacity"-->
-<!--                              :departId="departId"-->
-<!--                              :isDepartment="isDepartment"></personnel-capacity>-->
-<!--        </el-tab-pane>-->
-<!--        <el-tab-pane label="娌熼�氳褰�" name="娌熼�氳褰�">-->
-<!--          <Communicate v-if="activeName === '娌熼�氳褰�'" ref="communicateRef" :departId="departId" :isDepartment="isDepartment"></Communicate>-->
-<!--        </el-tab-pane>-->
+        <el-tab-pane label="浜哄憳鑳藉姏" name="浜哄憳鑳藉姏">
+          <personnel-capacity v-if="activeName === '浜哄憳鑳藉姏'" ref="personnelCapacity"
+                              :departId="departId"
+                              :isDepartment="isDepartment"></personnel-capacity>
+        </el-tab-pane>
+        <el-tab-pane label="娌熼�氳褰�" name="娌熼�氳褰�">
+          <Communicate v-if="activeName === '娌熼�氳褰�'" ref="communicateRef" :departId="departId" :isDepartment="isDepartment"></Communicate>
+        </el-tab-pane>
       </el-tabs>
     </div>
     <el-dialog :visible.sync="addDia" title="鏋舵瀯鏂板" width="400px">
diff --git a/src/views/CNAS/personnel/personnelInfo/tabs/communicate.vue b/src/views/CNAS/personnel/personnelInfo/tabs/communicate.vue
index 4ae47d9..186ee8e 100644
--- a/src/views/CNAS/personnel/personnelInfo/tabs/communicate.vue
+++ b/src/views/CNAS/personnel/personnelInfo/tabs/communicate.vue
@@ -1,48 +1,28 @@
 <template>
-    <div class="flex_column">
-<!--        <TableCard :showForm="isDepartment" title="娌熼�氳褰�">-->
-<!--            <template v-slot:form >-->
-<!--                <div v-if="isDepartment" class="w100 items_center justify_between">-->
-<!--                    <div></div>-->
-<!--                    <div>-->
-<!--                        &lt;!&ndash; <el-button type="primary" size="small">瀵煎嚭</el-button> &ndash;&gt;-->
-<!--                        <el-button size="small" type="primary" @click="openDialog">鏂板</el-button>-->
-<!--                    </div>-->
-<!--                </div>-->
-<!--            </template>-->
-<!--            <template v-slot:table>-->
-<!--                <ZTTable-->
-<!--                    :column="columnData"-->
-<!--                    :height="'calc(100vh - 21em)'"-->
-<!--                    :table-data="tableData"-->
-<!--                    :table-loading="loading"-->
-<!--                    style="margin-top: 18px; padding: 0 15px;"-->
-<!--                ></ZTTable>-->
-<!--                <el-divider></el-divider>-->
-<!--                <div class="pagination">-->
-<!--                    <div></div>-->
-<!--                    <el-pagination-->
-<!--                        :page-size="pagination.pageSize"-->
-<!--                        :page-sizes="[10, 20, 30, 40]"-->
-<!--                        :total="pagination.total"-->
-<!--                        layout="total, sizes, prev, pager, next, jumper"-->
-<!--                        @current-change=""-->
-<!--                        @size-change=""-->
-<!--                    >-->
-<!--                    </el-pagination>-->
-<!--                </div>-->
-<!--            </template>-->
-<!--        </TableCard>-->
-        <Add ref="communicateModal" @submit="getTableData"></Add>
+  <div class="flex_column">
+    <div v-if="isDepartment" style="display: flex;justify-content: space-between;margin-bottom: 10px">
+      <el-button size="small" type="primary" @click="getTableData">鍒锋柊</el-button>
+      <el-button size="small" type="primary" icon="el-icon-plus" @click="openDialog">鏂板</el-button>
     </div>
+    <lims-table :tableData="tableData" :column="columnData"
+                @pagination="page" :height="'calc(100vh - 18em)'"
+                :page="pagination" :tableLoading="loading"></lims-table>
+    <Add ref="communicateModal" @submit="getTableData"></Add>
+  </div>
 </template>
 <script>
-// import Add from "./Add.vue"
+import CommunicateAdd from "../components/communicateAdd.vue"
+import limsTable from "@/components/Table/lims-table.vue";
+import {
+  deletePersonCommunicationAbility, exportPersonCommunicationAbility,
+  personPersonCommunicationAbilityPage
+} from "@/api/cnas/personal/personPersonCommunicationAbilityPage";
 
 export default {
-    components: {
-        // Add
-    },
+  components: {
+    limsTable,
+    Add: CommunicateAdd
+  },
   props: {
     departId: {
       type: Number,
@@ -55,158 +35,109 @@
       default: false
     }
   },
-    data() {
-        return {
-            // departId: 0,
-            columnData: [
-                {
-                    label: '搴忓彿',
-                    prop: 'id'
-                }, {
-                    label: '娌熼�氫汉',
-                    prop: 'userName'
-                }, {
-                    label: '娌熼�氭椂闂�',
-                    prop: 'communicationTime'
-                }, {
-                    label: '娌熼�氬湴鐐�',
-                    prop: 'communicationPlace'
-                }, {
-                    label: '娌熼�氬唴瀹�',
-                    prop: 'communicationContent'
-                }, {
-                    label: '鎿嶄綔',
-                    dataType: 'action',
-                    operation: [
-                        {
-                            name: '缂栬緫',
-                            type: 'text',
-                            clickFun: (row) => {
-                                this.openDialog(row, true)
-                            }
-                        }, {
-                            name: '瀵煎嚭',
-                            type: 'text',
-                            clickFun: (row) => {
-                                this.handleDown(row)
-                            }
-                        }, {
-                            name: '鍒犻櫎',
-                            type: 'text',
-                            color: '#f56c6c',
-                            clickFun: (row) => {
-                                this.delPerson(row.id)
-                            }
-                        }
-                    ]
-                },
-            ],
-            tableData: [],
-            pagination: {
-                current: 1,
-                pageSize: 20,
-                total: 0
-            },
-            loading: false
-        }
-    },
-  mounted() {
-    // this.getTableData()
-  },
-  methods: {
-        openDialog(row, type=false) {
-            this.$refs.communicateModal.openDialog(row, type)
-        },
-        async getTableData() {
-            this.loading = true
-          const params = this.isDepartment ? {
-            departLimsId: this.departId,
-            current: this.pagination.current,
-            size: this.pagination.pageSize
-          } : {
-            userId: this.departId,
-            current: this.pagination.current,
-            size: this.pagination.pageSize
-          }
-            const { code, data } = await this.$axios({
-                method: 'get',
-                url: personPersonCommunicationAbilityPage,
-                params: params
-            })
-            if(code == 200) {
-                this.pagination.total = data.total
-                this.tableData = data.records
-                this.loading = false
-            }
-        },
-        /**
-         * @desc 鑾峰彇璁惧id
-         */
-        getDepart(id) {
-            // this.departId = id
-            this.getTableData()
-        },
-        /**
-         * @desc 鍒犻櫎娌熼�氳褰�
-         */
-        delPerson(id) {
-            this.$confirm('姝ゆ搷浣滃皢姘镐箙鍒犻櫎璇ユ枃浠�, 鏄惁缁х画?', '鎻愮ず', {
-                confirmButtonText: '纭畾',
-                cancelButtonText: '鍙栨秷',
-                type: 'warning'
-            }).then(async () => {
-                let formData = new FormData()
-                formData.append('id', id)
-                const { code } = await this.$axios({
-                    method: 'delete',
-                    url: deletePersonCommunicationAbility,
-                    data: formData
-                })
-                if(code == 200) {
-                    this.$message({
-                        type: 'success',
-                        message: '鍒犻櫎鎴愬姛!'
-                    });
-                    this.getTableData()
-                }
-            })
-        },
-        async handleDown(row){
-          this.$axios.post(this.$api.personCommunicationAbility.exportPersonCommunicationAbility,{id:row.id},{responseType: "blob"}).then(res => {
-            if(res.code == 201){
-              this.$message.error(res.message)
-              return
-            }
-            const blob = new Blob([res],{ type: 'application/octet-stream' });
-            //灏咮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 = row.userName+'-娌熼�氳褰�'+'.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 = row.userName+'-娌熼�氳褰�'+'.docx';
-                link.click();
-                this.$message.success('瀵煎嚭鎴愬姛')
+  data() {
+    return {
+      columnData: [
+        {
+          label: '娌熼�氫汉',
+          prop: 'userName'
+        }, {
+          label: '娌熼�氭椂闂�',
+          prop: 'communicationTime'
+        }, {
+          label: '娌熼�氬湴鐐�',
+          prop: 'communicationPlace'
+        }, {
+          label: '娌熼�氬唴瀹�',
+          prop: 'communicationContent'
+        }, {
+          label: '鎿嶄綔',
+          dataType: 'action',
+          operation: [
+            {
+              name: '缂栬緫',
+              type: 'text',
+              clickFun: (row) => {
+                this.openDialog(row, true)
+              }
+            }, {
+              name: '瀵煎嚭',
+              type: 'text',
+              clickFun: (row) => {
+                this.handleDown(row)
+              }
+            }, {
+              name: '鍒犻櫎',
+              type: 'text',
+              color: '#f56c6c',
+              clickFun: (row) => {
+                this.delPerson(row.id)
               }
             }
-          })
-        }
+          ]
+        },
+      ],
+      tableData: [],
+      pagination: {
+        current: 1,
+        size: 20,
+        total: 0
+      },
+      loading: false
+    }
+  },
+  mounted() {
+    this.getTableData()
+  },
+  methods: {
+    openDialog(row, type=false) {
+      this.$refs.communicateModal.openDialog(row, type)
     },
+    getTableData() {
+      this.loading = true
+      const params = this.isDepartment ? {
+        departLimsId: this.departId,
+        current: this.pagination.current,
+        size: this.pagination.size
+      } : {
+        userId: this.departId,
+        current: this.pagination.current,
+        size: this.pagination.size
+      }
+      personPersonCommunicationAbilityPage(params).then(res => {
+        this.loading = false
+        this.tableData = res.data.records
+        this.pagination.total = res.data.total
+      }).catch(err => {
+        this.loading = false
+      })
+    },
+    page (page) {
+      this.pagination.size = page.limit
+      this.getTableData()
+    },
+    /**
+     * @desc 鍒犻櫎娌熼�氳褰�
+     */
+    delPerson(id) {
+      this.$confirm('姝ゆ搷浣滃皢姘镐箙鍒犻櫎璇ユ枃浠�, 鏄惁缁х画?', '鎻愮ず', {
+        confirmButtonText: '纭畾',
+        cancelButtonText: '鍙栨秷',
+        type: 'warning'
+      }).then(async () => {
+        deletePersonCommunicationAbility({id: id}).then(res => {
+          this.$message.success('鍒犻櫎鎴愬姛!');
+          this.getTableData()
+        })
+      })
+    },
+    async handleDown(row){
+      exportPersonCommunicationAbility({id:row.id}).then(res => {
+        const blob = new Blob([res],{ type: 'application/octet-stream' });
+        this.$download.saveAs(blob, row.userName+'-娌熼�氳褰�'+'.docx');
+      })
+    }
+  },
   watch: {
     departId: {
       handler(newId, oldId) {
@@ -219,31 +150,4 @@
 }
 </script>
 <style scoped>
-.flex_column {
-    display: flex;
-    flex-direction: column;
-    justify-content: space-between;
-}
-.w100 {
-    width: 100%;
-}
-.pagination {
-    display: flex;
-    justify-content: space-between
-}
-.items_center {
-    display: flex;
-    align-items: center;
-}
-.justify_between {
-    justify-content: space-between
-}
-.date_box {
-    margin: 0 5px;
-}
-
-.search {
-    width: 150px;
-    padding: 0 16px;
-}
 </style>
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