From bdd5fd12d584a71b03d0f7a7a10f3364b8e5f0e1 Mon Sep 17 00:00:00 2001
From: spring <2396852758@qq.com>
Date: 星期二, 11 三月 2025 11:00:58 +0800
Subject: [PATCH] 人员修改

---
 src/views/CNAS/personnel/personnelInfo/Department/components/PersonnelList/index.vue |  129 +++++++++++++++++++++++++++++--------------
 1 files changed, 87 insertions(+), 42 deletions(-)

diff --git a/src/views/CNAS/personnel/personnelInfo/Department/components/PersonnelList/index.vue b/src/views/CNAS/personnel/personnelInfo/Department/components/PersonnelList/index.vue
index 4aa3298..65aaa66 100644
--- a/src/views/CNAS/personnel/personnelInfo/Department/components/PersonnelList/index.vue
+++ b/src/views/CNAS/personnel/personnelInfo/Department/components/PersonnelList/index.vue
@@ -15,7 +15,8 @@
         <el-button :loading="synchronousLoading" size="small" type="primary" @click="synchronous"
           :v-show="departId">鍚屾绗笁鏂逛汉鍛樹俊鎭�</el-button>
         <el-button :loading="outLoading" size="small" type="primary" @click="handleDown">瀵煎嚭</el-button>
-        <el-button size="small" type="primary" @click="selectUserDia = true">鏂板缓</el-button>
+        <el-button size="small" type="primary"
+          @click="selectUserDia = true, getList(), queryParams.name = '', multipleSelection = []">鏂板缓</el-button>
       </span>
     </div>
     <div class="search-table">
@@ -60,13 +61,15 @@
         <div class="search_thing">
           <div class="search_label">鐢ㄦ埛鍚嶏細</div>
           <div class="search_input">
-            <el-input v-model="addUserTableInfo.entity.name" clearable placeholder="璇疯緭鍏�" size="small"
-              @keyup.enter.native="$refs.ValueTable.selectList()"></el-input>
+            <el-input v-model="queryParams.name" clearable placeholder="璇疯緭鍏�" size="small"
+              @keyup.enter.native="getList()" style="width: 200px;"></el-input>
           </div>
         </div>
       </div>
       <div v-if="selectUserDia" class="body" style="height: 60vh;">
-        <ValueTable ref="ValueTable" :componentData="addUserTableInfo" :url="$api.user.selectUserList" />
+        <lims-table :tableData="tableData" :column="column" :tableLoading="tableLoading" :height="'calc(100vh - 290px)'"
+          :page="personPage" @pagination="pagination" :isSelection="true"
+          :handleSelectionChange="handleSelectionChange"></lims-table>
       </div>
       <span slot="footer" class="dialog-footer">
         <el-button @click="selectUserDia = false">鍙� 娑�</el-button>
@@ -77,7 +80,7 @@
 </template>
 
 <script>
-import ValueTable from '@/components/Table/value-table.vue';
+import limsTable from "@/components/Table/lims-table.vue";
 import {
   getEmployees,
   basicInformationOfPersonnelSelectPage,
@@ -85,11 +88,12 @@
   upUserDepardLimsId,
   exportPersonBasicInfo,
   exportPersonBasicInfoById,
+  selectUserList,
 } from '@/api/cnas/personnel/personnelInfo.js'
 export default {
   name: 'PersonnelList',
   // import 寮曞叆鐨勭粍浠堕渶瑕佹敞鍏ュ埌瀵硅薄涓墠鑳戒娇鐢�
-  components: { ValueTable },
+  components: { limsTable },
   props: {
     departId: {
       type: Number,
@@ -109,6 +113,8 @@
   data() {
     // 杩欓噷瀛樻斁鏁版嵁
     return {
+      entity: {},
+      multipleSelection: [],
       synchronousLoading: false,
       page: {
         size: 20,
@@ -117,46 +123,61 @@
       outLoading: false,
       tableLoading: false,
       tableData: [], // 浜哄憳鎬诲垪琛ㄦ暟鎹�
-      selectUserDia: false, // 娣诲姞浜哄憳寮规
-      entity: {
-        name: '',
-        orderBy: {
-          field: 'id',
-          order: 'asc'
+      selectUserDia: false, // 娣诲姞浜哄憳寮规,
+      stateList: [
+        {
+          value: 1,
+          type: 'success',
+          label: '鍚敤'
+        },
+        {
+          value: 0,
+          type: 'danger',
+          label: '鍋滅敤'
         }
+      ],
+      queryParams: {
+        name: ''
       },
-      addUserTableInfo: {
-        name: null,
-        entity: {
-          isCustom: 0,
-          orderBy: {
-            field: 'id',
-            order: 'asc'
-          }
+      tableData: [],
+      column: [
+        { label: "濮撳悕", prop: "name" },
+        { label: "璐﹀彿", prop: "account" },
+        {
+          label: "瑙掕壊",
+          prop: "roleName",
         },
-        isIndex: true,
-        showSelect: true,
-        select: true,
-        do: [],
-        tagField: {
-          state: {
-            select: [
-              {
-                value: 1,
-                type: 'success',
-                label: '鍚敤'
-              },
-              {
-                value: 0,
-                type: 'danger',
-                label: '鍋滅敤'
-              }
-            ]
-          }
+        {
+          label: "鐘舵��", prop: "state", dataType: "tag",
+          formatData: (params) => {
+            let index = this.stateList.findIndex(
+              (item) => item.value == params
+            );
+            if (index > -1) {
+              return this.stateList[index].label;
+            } else {
+              return null;
+            }
+          },
+          formatType: (params) => {
+            let index = this.stateList.findIndex(
+              (item) => item.value == params
+            );
+            if (index > -1) {
+              return this.stateList[index].type;
+            } else {
+              return null;
+            }
+          },
         },
-        selectField: {},
-        upUserDepardLimsIdPower: true
+        { label: "鐢佃瘽鍙风爜", prop: "phone" },
+      ],
+      personPage: {
+        total: 0,
+        size: 10,
+        current: 0,
       },
+      tableLoading: false,
     };
   },
   mounted() {
@@ -232,12 +253,15 @@
       this.page.current = val;
       this.refreshTable();
     },
+    handleSelectionChange(val) {
+      this.multipleSelection = val
+    },
     selectUser() {
       if (!this.currentCompaniesList.length > 0) {
         this.$message.warning("璇烽�夋嫨閮ㄩ棬锛�")
         return;
       }
-      let selects = this.$refs.ValueTable.multipleSelection;
+      let selects = this.multipleSelection;
       if (selects.length == 0) {
         this.$message.error('鏈�夋嫨鏁版嵁');
         return;
@@ -265,6 +289,27 @@
       });
       this.$emit('refreshTree')
     },
+    getList() {
+      this.tableLoading = true;
+      let param = { ...this.queryParams, ...this.personPage };
+      delete param.total;
+      selectUserList({ ...param })
+        .then((res) => {
+          this.tableLoading = false;
+          if (res.code === 200) {
+            this.tableData = res.data.records;
+            this.personPage.total = res.data.total;
+          }
+        })
+        .catch((err) => {
+          this.tableLoading = false;
+        });
+    },
+    pagination({ page, limit }) {
+      this.personPage.current = page;
+      this.personPage.size = limit;
+      this.getList();
+    },
     handleDown() {
       this.outLoading = true;
       let entity = this.HaveJson(this.entity)

--
Gitblit v1.9.3