fei
20 小时以前 12c6f51d841e80bab7089725e63a034dbe6a294f
修改了代码
5个文件已修改
97 ■■■■ 已修改文件
src/api/system/materials.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/system/records.js 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main.js 36 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/archiveManager/archiveMaterial/index.vue 32 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/archiveManager/index.vue 23 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/system/materials.js
@@ -82,7 +82,7 @@
export function getFileCount(recordId)
{
  return request({
    url:'/system/materials/getFileCount/'+recordId,
    url:'/system/materials/getFileCounts/'+recordId,
    method:'get',
    // headers:{
src/api/system/records.js
@@ -8,10 +8,10 @@
  })
}
//更新状态
export function updateStatusById(status, id)
export function updateStatusById(status, id,operator)
{
  return request({
    url: '/system/records/updateStatusById/' + status+"/"+id,
    url: '/system/records/updateStatusById/' + status+"/"+id+"/"+operator,
    method: 'get',
  //  data: data
  })
src/main.js
@@ -62,7 +62,43 @@
Vue.use(directive)
Vue.use(plugins)
DictData.install()
// 创建一个自定义指令
Vue.directive('auto-height', {
  bind(el, binding) {
    const minRows = binding.value?.minRows || 1;
    const maxRows = binding.value?.maxRows || 10;
    const resize = () => {
      // 重置高度
      el.style.height = 'auto';
      // 获取内容高度
      const scrollHeight = el.scrollHeight;
      const lineHeight = parseInt(getComputedStyle(el).lineHeight);
      // 计算需要的行数
      let rows = Math.floor(scrollHeight / lineHeight);
      rows = Math.max(minRows, Math.min(rows, maxRows));
      // 设置行数
      el.setAttribute('rows', rows);
      el.style.height = `${rows * lineHeight}px`;
    };
    // 监听输入事件
    el.addEventListener('input', resize);
    // 初始化时调整一次
    resize();
    // 保存resize函数以便卸载
    el._autoHeightResize = resize;
  },
  unbind(el) {
    el.removeEventListener('input', el._autoHeightResize);
    delete el._autoHeightResize;
  }
});
/**
 * If you don't want to use mock-server
 * you want to use MockJs for mock api
src/views/archiveManager/archiveMaterial/index.vue
@@ -19,7 +19,9 @@
            <div class="title-search-wrapper">
              <el-input
                type="textarea"
                rows="1"
                rows="2"
                    v-auto-height="{ minRows: 2, maxRows: 10 }"
                v-model="form.creator"
                placeholder="请输入责任者"
                @input="handleCreatorInput"
@@ -51,7 +53,7 @@
            <div class="title-search-wrapper">
              <el-input
                type="textarea"
                rows="1"
                rows="2"
                v-model="form.title"
                placeholder="请输入文件题名"
                @input="handleTitleInput"
@@ -1037,7 +1039,7 @@
      //alert(this.totalPageCount)
      //alert(recordId)
      this.recordId = recordId;
      this.uploadUrl = process.env.VUE_APP_BASE_API +'/system/materials/upload/'+this.recordId
      this.uploadUrl = process.env.VUE_APP_BASE_API +'/system/materials/uploads/'+this.recordId
// alert('Bearer ' + getToken())
      this.reset()
      this.form.securityLevel = '普通' // 设置对话框表单默认值
@@ -1094,10 +1096,10 @@
     // 打开导入对话框
    handleImport() {
      //生成新的记录
      insertFile(this.recordId, this.totalPageCount).then(response => {
        console.log(response)
      //  alert(3245)
        })
      // insertFile(this.recordId, this.totalPageCount).then(response => {
      //   console.log(response)
      // //  alert(3245)
      //   })
      this.importDialogVisible = true
    },
    // 文件移除
@@ -1129,12 +1131,12 @@
     //   var res = response.data.res
     //  console.log(res)
       //alert(response.data.total)
       if(fileCount!=this.totalPageCount)
       {
         this.$modal.msgWarning('请选择与记录数一致的文件')
         return
       }
       else
       // if(fileCount!=this.totalPageCount)
       // {
       //   this.$modal.msgWarning('请选择与记录数一致的文件')
       //   return
       // }
     //  else
       {
         // 初始化上传状态计数
         this.uploadSuccessCount = 0;
@@ -1142,7 +1144,7 @@
         this.totalUploadFiles = fileCount;
         // 执行上传
           this.$refs.upload.submit()
           this.getList()
      //     this.getList()
       }
       // else
       // {
@@ -1641,7 +1643,7 @@
      //修改案卷的状态
  //  var id = row.id
      var status = '未上传附件'
      updateStatusById(status, recordId).then(response=>{
      updateStatusById(status, recordId, '退回管理员').then(response=>{
      //  this.$modal.msgSuccess("提交成功")
      //  this.getList()
      _this.$store.dispatch('tagsView/delView', this.$route);
src/views/archiveManager/index.vue
@@ -959,7 +959,7 @@
import { listAllCategory } from "@/api/system/category"
import { listAllProjectName } from "@/api/system/projectName"
import { listPlaceName, listAllPlaceName } from "@/api/system/placeName"
import { judge } from "@/api/system/materials"
import { judge,getFileCount } from "@/api/system/materials"
import { UserRoleIdList,unallocatedUserList, authUserSelectAll } from "@/api/system/role"
import {authManyRecordsToUsers}  from "@/api/system/archiverecordstouser"
@@ -1559,21 +1559,32 @@
    {
     //alert(row.id)
      var id = row.id
         var pageCount = row.pageCount
      if(pageCount===undefined||pageCount===0)
        this.$modal.msgWarning('请先补充案卷页数!')
      // 在提交之前,调用后端接口检查是否已经上传附件
      judge(id).then(response => {
        // console.log(response)
      getFileCount(id).then(response => {
        console.log(response)
        // alert(response.data)
        if (response.data===undefined||response.data === false) {
        if (response.length===undefined||response.length === 0) {
          // 如果文件数量为0,提示用户先上传附件
          this.$modal.msgWarning('请先上传附件,再进行提交操作')
        } else {
        }
        else if(response.length===pageCount)
        {
          // 如果已经上传了附件,继续提交操作
          var status = '录入完成'
          updateStatusById(status, id).then(response=>{
          updateStatusById(status, id, '提交案卷').then(response=>{
            this.$modal.msgSuccess("提交成功")
            this.getList()
          })
        }
        else
        {
          this.$modal.msgWarning('附件数量上传不足,请继续上传!')
        }
      }).catch(error => {
        console.error('检查附件数量失败:', error)
        this.$modal.msgError('检查附件数量失败,请稍后重试')