feige
3 天以前 7706412d104e452b917ec132dcd9377680a83449
src/views/archiveManager/seleUser.vue
@@ -57,7 +57,7 @@
</template>
<script>
  import {listArchiverecordstouser,addArchiverecordstouser,authRecordToUser} from "@/api/system/archiverecordstouser"
  import {listArchiverecordstouser,addArchiverecordstouser,authRecordToUser,getArchiverecordstouserByReIdAndUid} from "@/api/system/archiverecordstouser"
import { UserRoleIdList,unallocatedUserList, authUserSelectAll } from "@/api/system/role"
export default {
@@ -67,7 +67,7 @@
    roleId: {
      type: [Number, String]
    },
    recordId: {
    archiveRecordsId: {
      type: [Number, String]
    }
  },
@@ -86,7 +86,7 @@
        pageNum: 1,
        pageSize: 10,
        roleId: undefined,
        recordId: undefined,
        archiveRecordsId: undefined,
        userName: undefined,
        phonenumber: undefined
      }
@@ -94,9 +94,13 @@
  },
  methods: {
    // 显示弹框
    show() {
    show(archiveRecordsId) {
      if (archiveRecordsId) {
    this.archiveRecordsId = archiveRecordsId
  }
      this.queryParams.roleId = this.roleId
      this.queryParams.recordId = this.recordId
      this.queryParams.archiveRecordsId = this.archiveRecordsId
      this.getList()
      this.visible = true
    },
@@ -128,19 +132,22 @@
    },
    /** 选择授权用户操作 */
    handleSelectUser() {
      const recordId = this.queryParams.recordId
      const archiveRecordsId = this.queryParams.archiveRecordsId
      const userIds = this.userIds.join(",")
      alert(recordId)
      alert(userIds)
      if (userIds == "") {
        this.$modal.msgError("请选择要分配的用户")
        return
      }
      authRecordToUser({ recordId: recordId, userIds: userIds }).then(res => {
        this.$modal.msgSuccess(res.msg)
        this.visible = false
        this.$emit("ok")
      authRecordToUser({ recordId: archiveRecordsId, userIds: userIds }).then(res => {
        if(res.code === 200) {
      this.$modal.msgSuccess(res.msg)
      this.visible = false
      this.$emit("ok")
    } else {
      this.$modal.msgError(res.msg || "授权失败,已经授权过了")
    }
      })
    }
  }