From e3cac4fb5b540b45d6ec1a53a534d08c03d7c174 Mon Sep 17 00:00:00 2001
From: fei <791364011@qq.com>
Date: 星期六, 15 十一月 2025 16:36:08 +0800
Subject: [PATCH] 打的修改

---
 src/views/archiveManager/arMAutoUser.vue |   66 +++++++++++++++++++++-----------
 1 files changed, 43 insertions(+), 23 deletions(-)

diff --git a/src/views/archiveManager/arMAutoUser.vue b/src/views/archiveManager/arMAutoUser.vue
index c978b7f..d7eb9ef 100644
--- a/src/views/archiveManager/arMAutoUser.vue
+++ b/src/views/archiveManager/arMAutoUser.vue
@@ -48,7 +48,7 @@
           v-hasPermi="['system:role:remove']"
         >鎵归噺鍙栨秷鎺堟潈</el-button>
       </el-col> -->
-      <el-col :span="1.5">
+    <!--  <el-col :span="1.5">
         <el-button
           type="warning"
           plain
@@ -56,7 +56,7 @@
           size="mini"
           @click="handleClose"
         >鍏抽棴</el-button>
-      </el-col>
+      </el-col> -->
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
 
@@ -105,14 +105,15 @@
       :limit.sync="queryParams.pageSize"
       @pagination="getList"
     />
-    <select-user ref="select" :roleId="queryParams.roleId" :recordId="queryParams.recordId" @ok="handleQuery" />
+    <select-user ref="select" :roleId="queryParams.roleId" :recordId="queryParams.archiveRecordsId" @ok="handleQuery" />
   </div>
 </template>
 
 <script>
 import {UserRoleIdList, allocatedUserList, authUserCancel, authUserCancelAll } from "@/api/system/role"
 import selectUser from "./seleUser"
-import {listArchiverecordstouser,addArchiverecordstouser} from "@/api/system/archiverecordstouser"
+  import { listMaterials, getMaterials, delMaterials, addMaterials, updateMaterials,getArchiverecordstouserByReIdAndUid } from "@/api/system/materials"
+import {listArchiverecordstouser,addArchiverecordstouser,delArchiverecordstouserByReIdAndUid,getArchiverecordstouser} from "@/api/system/archiverecordstouser"
 export default {
   name: "AuthUser1",
   dicts: ['sys_normal_disable'],
@@ -137,35 +138,48 @@
         pageNum: 1,
         pageSize: 10,
         roleId: undefined,
-        archiveRecordsId: undefined
-      //  userName: undefined,
-      //  phonenumber: undefined
+        archiveRecordsId: undefined,
+
+        // SysUser.userName: undefined,
+        // phonenumber: undefined
       }
     }
   },
   created() {
     const roleId = this.$route.params && this.$route.params.roleId
     const recordId = this.$route.params && this.$route.params.archiveRecordsId
-    alert(recordId)
-    if (roleId&&recordId) {
+
+    if (roleId && recordId) {
       this.queryParams.roleId = roleId
-      this.queryParams.archiveRecordsId = recordId
+      // 杩涜绫诲瀷杞崲
+      this.queryParams.archiveRecordsId = !isNaN(Number(recordId)) ? Number(recordId) : 0
       this.getList()
     }
   },
   methods: {
+    // 淇敼 getList 鏂规硶
     /** 鏌ヨ鎺堟潈鐢ㄦ埛鍒楄〃 */
     getList() {
       this.loading = true
-      console.log(this.queryParams)
-      console.log("------------")
-      listArchiverecordstouser(this.queryParams).then(response => {
-        console.log(response)
-          this.userList = response.data.data
-          this.total = response.data.total
-          this.loading = false
-        }
-      )
+      // 鍒涘缓涓�涓柊瀵硅薄锛屽皢瀛楃涓茬被鍨嬬殑archiveRecordsId杞崲涓烘暟瀛楃被鍨�
+      const params = {
+        ...this.queryParams,
+        archiveRecordsId: !isNaN(Number(this.queryParams.archiveRecordsId)) ?
+                    Number(this.queryParams.archiveRecordsId) : 0
+      }
+      listArchiverecordstouser(params).then(response => {
+        this.userList = response.data.data
+        this.total = response.data.total
+        this.loading = false
+      })
+    },
+    /** 鎵撳紑鎺堟潈鐢ㄦ埛琛ㄥ脊绐� */
+    openSelectUser() {
+      // 纭繚浼犻�掔粰select缁勪欢鐨剅ecordId鏄暟瀛楃被鍨�
+      const recordId = !isNaN(Number(this.queryParams.archiveRecordsId)) ?
+                    Number(this.queryParams.archiveRecordsId) : 0
+
+      this.$refs.select.show(recordId)
     },
     // 杩斿洖鎸夐挳
     handleClose() {
@@ -189,13 +203,19 @@
     },
     /** 鎵撳紑鎺堟潈鐢ㄦ埛琛ㄥ脊绐� */
     openSelectUser() {
-      this.$refs.select.show()
+      // alert(this.queryParams.roleId)
+      // alert(this.queryParams.archiveRecordsId )
+      this.$refs.select.show(this.queryParams.archiveRecordsId)
     },
     /** 鍙栨秷鎺堟潈鎸夐挳鎿嶄綔 */
     cancelAuthUser(row) {
-      const roleId = this.queryParams.roleId
-      this.$modal.confirm('纭瑕佸彇娑堣鐢ㄦ埛"' + row.userName + '"瑙掕壊鍚楋紵').then(function() {
-        return authUserCancel({ userId: row.userId, roleId: roleId })
+      const recordId = this.queryParams.archiveRecordsId
+      var userId = row.userId
+      // alert(userId)
+      // alert(this.queryParams.archiveRecordsId)
+      // alert(row.sysUser.userName)
+      this.$modal.confirm('纭瑕佸彇娑堣鐢ㄦ埛"' + row.sysUser.userName + '"鎺堟潈鍚楋紵').then(function() {
+        return delArchiverecordstouserByReIdAndUid({  recordId: recordId, userId: userId   })
       }).then(() => {
         this.getList()
         this.$modal.msgSuccess("鍙栨秷鎺堟潈鎴愬姛")

--
Gitblit v1.9.1