fei
1 天以前 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"
@@ -378,7 +389,7 @@
            <el-table-column label="操作" align="center" width="190" class-name="small-padding fixed-width">
              <template slot-scope="scope">
                <el-button
                v-if="scope.row.ownData"
                v-if="scope.row.ownData && scope.row.recordStatus!='录入完成'"
                  size="mini"
                  type="text"
@@ -396,7 +407,7 @@
                  v-hasPermi="['system:records:edit']"
                >查看卷内目录</el-button>
                <el-button
                      v-if="userId===1"
                        size="mini"
                        type="text"
@@ -406,7 +417,7 @@
                      >导出备考表</el-button>
                <el-button
                      v-if="userId===1"
                        size="mini"
                        type="text"
@@ -417,7 +428,7 @@
                      <el-button
                            v-if="userId===1"
                              size="mini"
                              type="text"
@@ -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"
@@ -474,7 +489,15 @@
                </el-dropdown>
              </template>
            </el-table-column>
      <el-table-column label="当前授权录入的用户" align="center" sortable="custom" prop="userName" width="120" v-if="userId==1">
   <template slot-scope="scope">
              <el-button
                :type="scope.row.userName === '' ? 'default' : 'primary'"
                size="mini">
                {{ scope.row.userName === null ? '未分配' : scope.row.userName }}
              </el-button>
              </template>
              </el-table-column>
            <el-table-column label="状态" align="center"  sortable="custom" prop="recordStatus" width="120">
              <template slot-scope="scope">
                <el-button :type="scope.row.recordStatus === '未录入' ? 'danger' : 'success'" size="mini">
@@ -544,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>
@@ -557,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>
@@ -722,6 +745,9 @@
        </el-form-item>
        <el-form-item label="备注" prop="remarks">
          <el-input v-model="form.remarks" type="textarea" placeholder="请输入内容" disabled/>
        </el-form-item>
        <el-form-item label="备考表备注" prop="noteRemark">
          <el-input v-model="form.noteRemark" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="历史相关发文号" prop="historicalReferenceNumber">
          <el-input v-model="form.historicalReferenceNumber" placeholder="请输入历史相关发文号" disabled/>
@@ -908,6 +934,9 @@
        <el-form-item label="备注" prop="remarks">
          <el-input v-model="form.remarks" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="备考表备注" prop="noteRemark">
          <el-input v-model="form.noteRemark" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="历史相关发文号" prop="historicalReferenceNumber">
          <el-input v-model="form.historicalReferenceNumber" placeholder="请输入历史相关发文号" />
        </el-form-item>
@@ -963,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"
@@ -972,15 +1001,19 @@
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
    },
  name: "Records",
  name: "InfoManager",
  data() {
    return {
      //删除批量授权
      allMapInfo: [],
      recId: '',
      openSearch: false,
      totalUser: 0,
      visibleUser:false,
@@ -1030,6 +1063,7 @@
      loading: true,
      // 选中数组
      ids: [],
      userAllIds: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
@@ -1047,7 +1081,7 @@
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        pageSize: 50,
        recordId: null,
        inquiryNumber: null,
        categoryType: null, // 类别类型
@@ -1093,8 +1127,8 @@
            "公开属性必须录入,主动公开、依申请公开、免予公开",
             "保管期限:30年或永久",
            "页号按照正式录入页码为准"], // 选中的注解列表
      includeSignature: false, // 是否包含签名栏
            selectedSignatures: ['业务科室移交人:', '审批科移交人:', '档案整理公司:'], // 选中的签名栏列表
            includeSignature: false, // 是否包含签名栏
            selectedSignatures: ['业务科室移交人:','审批科/法规科移交人:', '审批科移交人:', '档案整理公司:'], // 选中的签名栏列表
            subselectedSignatures: [],
            subselectedAnnotations: [],
      signaturePosition: 'bottom' // 签名栏位置:top/bottom
@@ -1141,7 +1175,8 @@
    this.fetchProjectOptions()
    this.fetchProjectCompanyOptions()
this.getList()
    this.getSigInfo();
    this.getAnnInfo();
  },
  watch: {
    'form.constructionUnit': {
@@ -1174,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;
@@ -1200,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 || "授权失败,已经授权过了")
@@ -1222,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() {
@@ -1483,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() {
@@ -1496,23 +1586,37 @@
    /*查看详情*/
    CheckInfo(row)
    {
      var recordStrId = row.recordId
   if(row.pageCount==null)
      console.log(recordStrId==='')
      console.log("+---------------------")
      if(recordStrId===''||recordStrId==null)
      {
        this.$modal.msgWarning("请先补充页码信息!")
        this.$modal.msgWarning("请补充档案号信息,再编辑卷内目录!")
        return
      }
         if( row.projectName==null||row.pageCount==null||row.caseTitle==null||row.constructionUnit==null)
      {
        this.$modal.msgWarning("请先补充页码等相关信息!")
        return;
      }
      var mid = row.id
      const roleId = 2
   //   alert(mid)
var filingNumber = row.filingNumber
if(filingNumber==="")
  filingNumber = ' '
      var recordId = mid
      var pageCount = row.pageCount
      var recordStrId = row.recordId
      var inquiryNumber = row.inquiryNumber
      var sho = false
    //  this.$router.push("/archiveManager/infoManagerAu/user/" + roleId+"/"+recordId)
      this.$router.push("/archiveManager/infoManagerAu/archiveMaterialManager/" + recordId+"/"+pageCount+"/"+sho+"/"+recordStrId+"/"+inquiryNumber)
      this.$router.push("/archiveManager/infoManagerAu/archiveMaterialManager/" + recordId+"/"+pageCount+"/"+sho+"/"+recordStrId+"/"+inquiryNumber+"/"+filingNumber)
    },
    /*导出备考表*/
@@ -1522,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)
@@ -1544,7 +1649,7 @@
           var recordId = row.recordId
       this.download('/system/materials/exportJuan/'+id, {
       }, `卷内目录_${new Date().getTime()}.xls`)
       }, recordId+` 卷内目录.xls`)
     },
     /*导出案卷封面*/
     pageInfo(row)
@@ -1556,7 +1661,7 @@
           var recordId = row.recordId
       this.download('/system/materials/exportPageInfo/'+id+'/'+recordId, {
       }, `案卷封面_${new Date().getTime()}.xls`)
       },  recordId+` 案卷封面.xls`)
     },
    handleInfo(row)
    {
@@ -1565,8 +1670,17 @@
       var valid = false;
      var pageCount = row.pageCount
      var recordStrId = row.recordId
      var filingNumber = row.filingNumber
      var inquiryNumber = row.inquiryNumber
      if(row.projectName!=null&&row.pageCount!=null&&row.caseTitle!=null&&row.constructionUnit)
      console.log(recordStrId==='')
      console.log("+---------------------")
      if(recordStrId===''||recordStrId==null)
      {
        this.$modal.msgWarning("请补充档案号信息,再编辑卷内目录!")
        return
      }
      if( row.projectName!=null&&row.pageCount!=null&&row.caseTitle!=null&&row.constructionUnit!=null)
       valid = true;
        if (valid) {
      var mid = row.id
@@ -1574,10 +1688,11 @@
   //   alert(mid)
      var recordId = mid
if(filingNumber==="")
  filingNumber = ' '
      var sho = true
    //  this.$router.push("/archiveManager/infoManagerAu/user/" + roleId+"/"+recordId)
      this.$router.push("/archiveManager/infoManagerAu/archiveMaterialManager/" + recordId+"/"+pageCount+"/"+sho+"/"+recordStrId+"/"+inquiryNumber)
      this.$router.push("/archiveManager/infoManagerAu/archiveMaterialManager/" + recordId+"/"+pageCount+"/"+sho+"/"+recordStrId+"/"+inquiryNumber+"/"+filingNumber)
      }else
      {
        this.$modal.msgWarning("请补充页号等相关信息,再编辑卷内目录!")
@@ -1651,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()
@@ -1855,6 +1987,7 @@
      const id = row.id || this.ids;
     // alert(id)
      this.recordId = id;
      this.recId = row.recordId
      this.$modal.loading('正在获取Excel文件,请稍候...');
      // 从后端获取Excel文件
@@ -2084,6 +2217,7 @@
    /** 处理下载按钮点击 */
    handleDownloadClick() {
      if (this.currentExcelUrl) {
        // 获取用户选择的选项
        const { includeQrCode, selectedAnnotations } = this.excelOptions;
@@ -2099,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;
@@ -2428,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);