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/PersonnelTraining/Edit.vue |   94 ++++++++++++++++++++++++++++++++++++++++++++---
 1 files changed, 88 insertions(+), 6 deletions(-)

diff --git a/src/views/CNAS/personnel/personnelInfo/Department/components/PersonnelTraining/Edit.vue b/src/views/CNAS/personnel/personnelInfo/Department/components/PersonnelTraining/Edit.vue
index 1953d01..b880fd0 100644
--- a/src/views/CNAS/personnel/personnelInfo/Department/components/PersonnelTraining/Edit.vue
+++ b/src/views/CNAS/personnel/personnelInfo/Department/components/PersonnelTraining/Edit.vue
@@ -167,14 +167,17 @@
         <div class="search_thing">
           <div class="search_label">鐢ㄦ埛鍚嶏細</div>
           <div class="search_input">
-            <el-input v-model="addUserTableInfo.entity.name" clearable placeholder="璇疯緭鍏�" size="small"
+            <el-input v-model="queryParams.name" clearable placeholder="璇疯緭鍏�" size="small"
               @keyup.enter.native="$refs.ValueTable.selectList()"></el-input>
           </div>
         </div>
       </div>
       <div v-if="selectUserDia" class="body" style="height: 60vh;">
-        <ValueTable ref="ValueTable" :componentData="addUserTableInfo" :isSelectedList="isSelectedList"
-          :url="$api.user.selectUserList" />
+        <lims-table :tableData="tableData" :column="column" :tableLoading="tableLoading" :height="'calc(100vh - 290px)'"
+          :page="page" @pagination="pagination" :isSelection="true"
+          :handleSelectionChange="handleSelectionChange"></lims-table>
+        <!-- <ValueTable ref="ValueTable" :componentData="addUserTableInfo" :isSelectedList="isSelectedList"
+          :url="$api.user.selectUserList" /> -->
       </div>
       <span slot="footer" class="dialog-footer">
         <el-button @click="selectUserDia = false">鍙� 娑�</el-button>
@@ -187,7 +190,7 @@
 <script>
 import TableCard from '@/components/TableCard/index.vue';
 import limsTable from "@/components/Table/lims-table.vue";
-import ValueTable from '@/components/Table/value-table.vue';
+// import ValueTable from '@/components/Table/value-table.vue';
 import filePreview from "@/components/Preview/filePreview.vue";
 import {
   fileDownLoad,
@@ -198,13 +201,14 @@
   newPersonnelAddedToTrainingRecords,
   deleteTrainingAndAssessmentRecords,
   trainingAndAssessmentRecordsAdded,
+  selectUserList,
 } from '@/api/cnas/personnel/personnelInfo.js'
 import { selectUserCondition } from "@/api/system/user";
 import { mapGetters } from "vuex";
 export default {
   name: 'Edit',
   // import 寮曞叆鐨勭粍浠堕渶瑕佹敞鍏ュ埌瀵硅薄涓墠鑳戒娇鐢�
-  components: { ValueTable, limsTable, TableCard, filePreview },
+  components: { limsTable, TableCard, filePreview },
   props: {
     currentRow: {
       type: Object,
@@ -286,7 +290,60 @@
         upUserDepardLimsIdPower: true
       },
       multipleSelection: [],
+      multipleSelections: [],
       userList: [],
+      stateList: [
+        {
+          value: 1,
+          type: 'success',
+          label: '鍚敤'
+        },
+        {
+          value: 0,
+          type: 'danger',
+          label: '鍋滅敤'
+        }
+      ],
+      queryParams: {},
+      tableData: [],
+      column: [
+        { label: "濮撳悕", prop: "name" },
+        { label: "璐﹀彿", prop: "account" },
+        {
+          label: "瑙掕壊",
+          prop: "roleName",
+        },
+        {
+          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;
+            }
+          },
+        },
+        { label: "鐢佃瘽鍙风爜", prop: "phone" },
+      ],
+      page: {
+        total: 0,
+        size: 10,
+        current: 0,
+      },
+      tableLoading: false,
     };
   },
   computed: {
@@ -394,12 +451,37 @@
         this.$message.success("鎿嶄綔鎴愬姛锛�")
       }
     },
+    getList() {
+      this.tableLoading = true;
+      let param = { ...this.queryParams, ...this.page };
+      delete param.total;
+      selectUserList({ ...param })
+        .then((res) => {
+          this.tableLoading = false;
+          if (res.code === 200) {
+            this.tableData = res.data.records;
+            this.page.total = res.data.total;
+          }
+        })
+        .catch((err) => {
+          this.tableLoading = false;
+        });
+    },
+    pagination({ page, limit }) {
+      this.page.current = page;
+      this.page.size = limit;
+      this.getList();
+    },
+    handleSelectionChange(val) {
+      this.multipleSelections = val
+    },
     addPerson() {
       this.isSelectedList = this.trainingTableData.map(item => item.userId)
+      this.getList()
       this.selectUserDia = true;
     },
     selectUser() {
-      let selects = this.$refs.ValueTable.multipleSelection;
+      let selects = this.multipleSelections;
       if (selects.length == 0) {
         this.$message.error('鏈�夋嫨鏁版嵁');
         return;

--
Gitblit v1.9.3