fei
5 天以前 a0f40c39abc6b26e101f54433c150af5bbbc240a
src/views/archiveManager/index.vue
@@ -327,6 +327,17 @@
          v-hasPermi="['system:materials:edit']"
        >批量授权</el-button>
      </el-col>
      <el-col v-if="userId==1" :span="1.5">
           <el-button
             type="warning"
             plain
             icon="el-icon-download"
             size="mini"
             @click="handleBackPermission"
             v-hasPermi="['system:materials:edit']"
           >批量取消授权</el-button>
         </el-col>
        <el-col v-if="userId==1" :span="1.5">
        <el-button
          type="warning"
@@ -438,6 +449,10 @@
                  @click="viewAndPrintExcel(scope.row)"
                  title="查看并打印Excel文件"
                >打印预整理清单</el-button>
                <el-button   icon="el-icon-edit" size="mini"
                v-if="userId!==1&&scope.row.ownData" type="text" @click="cancelAuthUser(scope.row)">
                  退回管理员</el-button>
          <el-button
                v-if="userId!==1&&scope.row.ownData"
@@ -552,8 +567,8 @@
              <div class="option-label">选择注解:</div>
              <div class="annotation-options">
              <label v-for="(annotation, index) in excelOptions.selectedAnnotations" :key="index" class="signature-checkbox">
                              <input type="checkbox" v-model="excelOptions.subselectedAnnotations" :value="index">
                              <span>{{ annotation }}
                              <input type="checkbox" v-model="excelOptions.subselectedAnnotations" :value="annotation.srt">
                              <span>{{ annotation.name }}
                              </span>
              </label>
              </div>
@@ -565,8 +580,8 @@
              <div class="signature-options">
                <div class="signature-checkboxes">
                 <label v-for="(signature, index) in excelOptions.selectedSignatures" :key="index" class="signature-checkbox">
                                 <input type="checkbox" v-model="excelOptions.subselectedSignatures" :value="index">
                                 <span>{{ signature }}</span>
                                 <input type="checkbox" v-model="excelOptions.subselectedSignatures" :value="signature.sot">
                                 <span>{{ signature.sigaName }}</span>
                  </label>
@@ -977,7 +992,7 @@
<script>
import VueOfficeExcel from '@vue-office/excel'
import '@vue-office/excel/lib/index.css'
import store from '@/store'
import axios from 'axios'
import { getToken } from '@/utils/auth'
import { enload, getIdFileCounts,batchSubmitRecords,updateStatusById,listRecords,getMaxId, getRecords, delRecords, addRecords, updateRecords } from "@/api/system/records"
@@ -986,8 +1001,9 @@
import { listPlaceName, listAllPlaceName } from "@/api/system/placeName"
import { judge,getFileCount } from "@/api/system/materials"
import { UserRoleIdList,unallocatedUserList, authUserSelectAll } from "@/api/system/role"
import {authManyRecordsToUsers}  from "@/api/system/archiverecordstouser"
import {authManyRecordsToUsers, delArchiverecordstouserByReIdAndUid, backPermission}  from "@/api/system/archiverecordstouser"
import { selectAllSig } from "@/api/system/signature"
import { selectAllAnn } from "@/api/system/annotation"
export default {
     components: {
        VueOfficeExcel
@@ -995,6 +1011,9 @@
  name: "InfoManager",
  data() {
    return {
      //删除批量授权
      allMapInfo: [],
      recId: '',
      openSearch: false,
      totalUser: 0,
      visibleUser:false,
@@ -1044,6 +1063,7 @@
      loading: true,
      // 选中数组
      ids: [],
      userAllIds: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
@@ -1155,7 +1175,8 @@
    this.fetchProjectOptions()
    this.fetchProjectCompanyOptions()
this.getList()
    this.getSigInfo();
    this.getAnnInfo();
  },
  watch: {
    'form.constructionUnit': {
@@ -1188,6 +1209,48 @@
    }
  },
  methods: {
    getAnnInfo(){
      selectAllAnn({}).then(response=>{
        this.excelOptions.selectedAnnotations = response.data
      })
    },
    getSigInfo(){
      selectAllSig({}).then(response => {
        console.log(']]][[[[[[[[[]]]]]]]]]')
        console.log(response)
        this.excelOptions.selectedSignatures= response.data
        console.log(this.excelOptions.selectedSignatures)
      })
    },
    /** 取消授权按钮操作 */
      cancelAuthUser(row) {
        const recordId =  row.id
        var userId = store.state.user.id
        var _this = this
        // alert(userId)
        // alert(this.queryParams.archiveRecordsId)
        // alert(row.sysUser.userName)
        this.$modal.confirm('确认要取消该用户的授权吗?').then(function() {
          return delArchiverecordstouserByReIdAndUid({  recordId: recordId, userId: userId   })
        }).then(() => {
        //  this.getList()
        //修改案卷的状态
    //  var id = row.id
        var status = '未上传附件'
        updateStatusById(status, recordId, '退回管理员').then(response=>{
        //  this.$modal.msgSuccess("提交成功")
         this.getList()
        // _this.$store.dispatch('tagsView/delView', this.$route);
        //   _this.$router.push('/archiveManager/infoManager')
          _this.$modal.msgSuccess("取消授权成功")
        })
        }).catch(() => {})
      },
    handleSearch()
    {
      this.openSearch = true;
@@ -1214,6 +1277,7 @@
        if(res.code === 200) {
          this.$modal.msgSuccess(res.msg)
          this.visibleUser = false
          this.getList()
        //  this.$emit("ok")
        } else {
          this.$modal.msgError(res.msg || "授权失败,已经授权过了")
@@ -1236,6 +1300,10 @@
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.userIds = selection.map(item => item.userId)
      var allMapInfo = selection.map(item =>(item.id, item.userId))
      console.log("0----------00000000000")
      console.log(allMapInfo)
    },
    // 查询表数据
    getUserList() {
@@ -1497,6 +1565,14 @@
      this.ids = selection.map(item => item.id)
      this.single = selection.length!==1
      this.multiple = !selection.length
      console.log(     this.ids)
      this.allMapInfo = selection.map(item => ({
  recordId: item.id,
  userId: item.userId
}));
console.log(this.allMapInfo)
    },
    /** 新增按钮操作 */
    handleAdd() {
@@ -1550,16 +1626,17 @@
       var id = row.id
             id = Number(id)
            var recordStrId = row.recordId
       var recordId = row.recordId
   this.download('/system/materials/exportBack/'+id+'/'+recordId, {
   }, `备考表_${new Date().getTime()}.pdf`)
   }, recordStrId +` 备考表.pdf`)
     },
     /*导出卷内目录*/
     JuanInfo(row)
     {
       var id = row.id
       console.log(row.pageCount)
      if(row.pageCount==null)
@@ -1572,7 +1649,7 @@
           var recordId = row.recordId
       this.download('/system/materials/exportJuan/'+id, {
       }, `卷内目录_${new Date().getTime()}.xls`)
       }, recordId+` 卷内目录.xls`)
     },
     /*导出案卷封面*/
     pageInfo(row)
@@ -1584,7 +1661,7 @@
           var recordId = row.recordId
       this.download('/system/materials/exportPageInfo/'+id+'/'+recordId, {
       }, `案卷封面_${new Date().getTime()}.xls`)
       },  recordId+` 案卷封面.xls`)
     },
    handleInfo(row)
    {
@@ -1689,6 +1766,23 @@
        this.open = true
        this.title = "修改档案记录"
      })
    },
    handleBackPermission()
    {
      console.log("--------------------++++++++++]]]]]")
      console.log(this.allMapInfo)
      var _this = this;
    const ids =  this.ids
      this.$modal.confirm('是否确认收回档案记录编号为"' + ids + '"的权限?').then(function() {
        backPermission(_this.allMapInfo)
      }).then(() => {
        this.getList()
        this.$modal.msgSuccess("收回权限成功")
      }).catch(() => {})
    },
    /*批量授权*/
    handleGivePermission()
@@ -1893,6 +1987,7 @@
      const id = row.id || this.ids;
     // alert(id)
      this.recordId = id;
      this.recId = row.recordId
      this.$modal.loading('正在获取Excel文件,请稍候...');
      // 从后端获取Excel文件
@@ -2122,6 +2217,7 @@
    /** 处理下载按钮点击 */
    handleDownloadClick() {
      if (this.currentExcelUrl) {
        // 获取用户选择的选项
        const { includeQrCode, selectedAnnotations } = this.excelOptions;
@@ -2137,12 +2233,12 @@
           link.href = this.currentExcelUrl;
           // 构建文件名,包含选项信息
           let filename = `record_${this.currentExcelId}`;
           if (includeQrCode) filename += '_qr';
           let filename =this.recId+ ` 预整理`;
           //if (includeQrCode) filename += '_qr';
           // if (selectedAnnotations.length > 0) {
           //   filename += `_anno${selectedAnnotations.join('')}`;x
           // }
           filename += `_${new Date().getTime()}.xls`;
           filename += `.xls`;
           link.download = filename;
@@ -2466,7 +2562,7 @@
            const url = URL.createObjectURL(blob);
            const link = document.createElement('a');
            link.href = url;
            link.download = `record_${id}_${new Date().getTime()}.xls`;
            link.download = `预整理.xls`;
            document.body.appendChild(link);
            link.click();
            document.body.removeChild(link);