tian
2025-10-13 406f7526df2f05e972cf3d5ccabc6610501828a6
修改给录入人员授权bug
3个文件已修改
39 ■■■■■ 已修改文件
src/views/archiveManager/arMAutoUser.vue 27 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/archiveManager/index.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/archiveManager/seleUser.vue 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/archiveManager/arMAutoUser.vue
@@ -113,7 +113,7 @@
import {UserRoleIdList, allocatedUserList, authUserCancel, authUserCancelAll } from "@/api/system/role"
import selectUser from "./seleUser"
  import { listMaterials, getMaterials, delMaterials, addMaterials, updateMaterials,getArchiverecordstouserByReIdAndUid } from "@/api/system/materials"
import {listArchiverecordstouser,addArchiverecordstouser,delArchiverecordstouserByReIdAndUid} from "@/api/system/archiverecordstouser"
import {listArchiverecordstouser,addArchiverecordstouser,delArchiverecordstouserByReIdAndUid,getArchiverecordstouser} from "@/api/system/archiverecordstouser"
export default {
  name: "AuthUser1",
  dicts: ['sys_normal_disable'],
@@ -151,23 +151,34 @@
   
    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)
      // 创建一个新对象,将字符串类型的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组件的recordId是数字类型
      const recordId = !isNaN(Number(this.queryParams.archiveRecordsId)) ?
                    Number(this.queryParams.archiveRecordsId) : 0
      this.$refs.select.show(recordId)
    },
    // 返回按钮
    handleClose() {
src/views/archiveManager/index.vue
@@ -1151,7 +1151,7 @@
    handleAuthUser: function(row) {
      const roleId = 2
      var archiveRecordsId = row.recordId
   //   alert(roleId)
   alert(roleId)
      this.$router.push("/archiveManager/infoManagerAu/user/" + roleId+"/"+archiveRecordsId)
    },
    /** 删除按钮操作 */
src/views/archiveManager/seleUser.vue
@@ -106,7 +106,8 @@
    // 显示弹框
    show(archiveRecordsId) {
      if (archiveRecordsId) {
    this.archiveRecordsId = archiveRecordsId
        // 进行类型转换
        this.archiveRecordsId = !isNaN(Number(archiveRecordsId)) ? Number(archiveRecordsId) : 0
  }
      this.queryParams.roleId = this.roleId
      this.queryParams.archiveRecordsId = this.archiveRecordsId
@@ -146,12 +147,15 @@
      const archiveRecordsId = this.queryParams.archiveRecordsId
      const userIds = this.userIds.join(",")
      if (userIds == "") {
        this.$modal.msgError("请选择要分配的用户")
        return
      }
      authRecordToUser({ recordId: archiveRecordsId, userIds: userIds }).then(res => {
      // 创建转换后的参数,确保recordId是数字类型
      const convertedRecordId = !isNaN(Number(archiveRecordsId)) ? Number(archiveRecordsId) : 0
      authRecordToUser({ recordId: convertedRecordId, userIds: userIds }).then(res => {
        if(res.code === 200) {
      this.$modal.msgSuccess(res.msg)
      this.visible = false