a390dbc5239ac26f093c6670c12cfd6a49ca6037..7619b42541a7b44c4f859b17f69d087b39aef08c
2025-11-24 zhouwx
修改
7619b4 对比 | 目录
2025-11-24 祖安之光
修改新增
b231c4 对比 | 目录
已添加3个文件
已修改4个文件
979 ■■■■■ 文件已修改
src/api/projectFileNew/index.js 34 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/build/conpanyFunctionConsult/digitalFileDep/project/projectCaralog/components/editDialog.vue 92 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/build/conpanyFunctionConsult/digitalFileDep/project/projectFileNew/components/dataDialog.vue 222 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/build/conpanyFunctionConsult/digitalFileDep/project/projectFileNew/index.vue 576 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/work/assetMng/toolsMonitorMeasure/annualVerificationPlan/index.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/work/sealManagement/apply/components/editDialog.vue 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/work/sealManagement/apply/index.vue 46 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/projectFileNew/index.js
对比新文件
@@ -0,0 +1,34 @@
import request from "@/utils/request";
//评价
export function getCaralogFile(params) {
    return request({
        url: '/quality-target/document/list',
        method: 'get',
        params: params
    })
}
export function addCaralogFile(data) {
    return request({
        url: '/quality-target/project/insert',
        method: 'post',
        data: data
    })
}
export function editCaralogFile(params) {
    return request({
        url: `/quality-target/project/update`,
        method: 'post',
        data: params
    })
}
// export function delCaralogFile(data) {
//     return request({
//         url: `/composite/expect/evaluate/deleted?expectEvaluateId=${data}`,
//         method: 'get'
//     })
// }
src/views/build/conpanyFunctionConsult/digitalFileDep/project/projectCaralog/components/editDialog.vue
@@ -30,6 +30,20 @@
        <el-form-item label="排序:"  prop="sort">
          <el-input v-model.number.trim="state.form.sort" type="number" :disabled="state.title =='查看'" placeholder="排序"></el-input>
        </el-form-item>
        <el-form-item label="模板文件:" prop="filePath">
          <el-upload accept=".doc,.docx,.pdf" :action="state.uploadUrl" :headers="state.header" method="post" :on-success="(res, uploadFile)=>handleAvatarSuccess(res, uploadFile)" :on-exceed="showTip" :limit='state.fileLimit' v-model:file-list="state.fileList" :before-upload="picSize" :on-remove="(file, uploadFiles)=>handleRemove(file, uploadFiles)" >
            <el-button type="primary">点击上传</el-button>
            <template #tip>
              <div class="el-upload__tip">支持上传.doc、.docx、.pdf格式文档,尺寸小于30M,最多可上传1份</div>
            </template>
          </el-upload>
        </el-form-item>
        <el-form-item label="是否添加文件:"  prop="isFile">
          <el-radio-group v-model="state.form.isFile"  >
            <el-radio :label="1">是</el-radio>
            <el-radio :label="2">否</el-radio>
          </el-radio-group>
        </el-form-item>
      </el-form>
      <template #footer v-if="state.title !='查看'">
        <span class="dialog-footer">
@@ -44,6 +58,8 @@
import {reactive, ref, toRefs, defineEmits, nextTick, onMounted} from 'vue'
import {ElMessage} from "element-plus";
import {addCatalogue, editCatalogue, getCatalogue} from "@/api/qualityManage/catalog";
import {getToken} from "@/utils/auth";
import {delPic} from "@/api/onlineEducation/banner";
const emit = defineEmits(["getList"]);
const dialogVisible = ref(false)
@@ -56,17 +72,28 @@
    number:'',
    parentId: null,
    companyId: null,
    sort: null
    sort: null,
    isFile:null,
    filePath:'',
    fileName:''
  },
  formRules:{
    mess: [{ required: true, message: '请输入目录名称', trigger: 'blur' }],
    number: [{ required: true, message: '请输入序号', trigger: 'blur' }],
    parentId:[{ required: true, message: '请选择上级分支', trigger: 'blur' }],
    sort: [{ required: true, message: '请输入排序', trigger: 'blur' }],
    isFile:[{ required: true, message: '请选择是否添加文件', trigger: 'blur' }],
    // filePath:[{ required: true, message: '请上传文件', trigger: 'blur' }],
  },
  isAdmin: false,
  companyList: [],
  menuOptions: [],
  uploadUrl: import.meta.env.VITE_APP_BASE_API + '/system/common/uploadFile',
  header: {
    Authorization: getToken()
  },
  fileLimit: 1,
  fileList: [],
})
onMounted(() => {
@@ -91,6 +118,13 @@
        state.form[key] = value[key]
      }
    })
    if(value.filePath) {
      const obj = {
        url: value.filePath,
        name: value.fileName
      }
      state.fileList = [obj]
    }
  }
  state.form.companyId = companyId
@@ -160,6 +194,56 @@
  traverse(val); // 从根节点开始遍历
  return val;
}
const handleAvatarSuccess = (res, uploadFile) => {
  if(res.code == 200){
    state.form.filePath = res.data.path
    state.form.fileName = res.data.originName
    state.form.format = '.' + res.data.filename.split('.')[1]
  }else{
    state.fileList = []
    ElMessage({
      type: 'warning',
      message: '文件上传失败'
    })
  }
}
const showTip =()=>{
  ElMessage({
    type: 'warning',
    message: '超出文件上传数量'
  });
}
const picSize = async (rawFile) => {
  if(rawFile.size / 1024 / 1024 > 30){
    ElMessage({
      type: 'warning',
      message: '文件大小不能超过30M'
    });
    return false
  }
};
const handleRemove = async (file, uploadFiles) => {
  let path = state.form.filePath;
  await delPic({path: path}).then(res => {
    if(res.code == 200){
      // ElMessage({
      //   type: 'success',
      //   message: '文件已删除'
      // })
      state.form.filePath = ''
      state.form.fileName = ''
      state.form.format = ''
    }else{
      ElMessage({
        type: 'warning',
        message: res.message
      })
    }
  }).catch(() => {
    state.form.imgUrl = ''
  });
}
const handleClose = () => {
  state.form = {
    id: null,
@@ -167,8 +251,12 @@
    number:'',
    parentId: null,
    companyId: null,
    sort: null
    sort: null,
    isFile:null,
    filePath:'',
    fileName:''
  }
  state.fileList = []
  state.isTree = false
  superRef.value.clearValidate();
  superRef.value.resetFields()
src/views/build/conpanyFunctionConsult/digitalFileDep/project/projectFileNew/components/dataDialog.vue
对比新文件
@@ -0,0 +1,222 @@
<template>
  <div class="notice">
    <el-dialog
        v-model="dialogVisible"
        :title="state.title"
        width="600px"
        :before-close="handleClose"
        :modal="false"
        draggable
        :close-on-press-escape="false"
        :close-on-click-modal="false"
    >
      <el-form :model="state.form" size="default" ref="superRef" :rules="state.formRules" label-width="150px" >
        <el-form-item label="文件:" prop="projectDocuments">
          <el-upload
              accept=".doc,.docx,.pdf,.png,.jpg,.jpeg"
              :action="state.uploadUrl"
              :headers="state.header"
              method="post"
              :on-success="(res, uploadFile)=>handleAvatarSuccess(res, uploadFile)"
              :on-exceed="showTip"
              v-model:file-list="state.fileList"
              :before-upload="picSize"
              :on-remove="(file, uploadFiles)=>handleRemove(file, uploadFiles)" >
            <el-button type="primary">点击上传</el-button>
            <template #tip>
              <div class="el-upload__tip">支持上传.doc、.docx、.pdf、图片格式文档,尺寸小于5M</div>
            </template>
          </el-upload>
        </el-form-item>
      </el-form>
      <template #footer v-if="state.title !='查看'">
        <span class="dialog-footer">
            <el-button @click="handleClose" size="default">取 消</el-button>
            <el-button type="primary"  @click="onSubmit" size="default" v-preReClick>确认</el-button>
        </span>
      </template>
    </el-dialog>
  </div>
</template>
<script setup>
import {reactive, ref, toRefs, defineEmits, nextTick, onMounted} from 'vue'
import {ElMessage} from "element-plus";
import {addUser, editUser, getUserById, resetPwd} from "@/api/onlineEducation/user"
import {Base64} from "js-base64"
import {getCompany} from "@/api/onlineEducation/company";
import {addIndustryTemp, updateIndustryTemp, updateInfoPlatforms} from "@/api/staffManage/staff";
import {getToken} from "@/utils/auth";
import {delPic} from "@/api/onlineEducation/banner";
import {addFile, editFile} from "@/api/qualityManage/range";
import {addProductFile, editProductFile, getProductSet} from "@/api/selfProblems/productFile";
import Cookies from "js-cookie";
import {addCaralogFile, editCaralogFile} from "@/api/projectFileNew";
const emit = defineEmits(["getList"]);
const dialogVisible = ref(false)
const superRef = ref()
const state = reactive({
  title: '',
  form: {
    id: null,
    type: 3,
    projectDocuments:[],
    catalogueId:null,
    itemId:null
  },
  formRules:{
    projectDocuments: [{ required: true, message: '请选择文件', trigger: 'blur' }],
  },
  isAdmin: false,
  companyList: [],
  industryList: [],
  uploadUrl: import.meta.env.VITE_APP_BASE_API + '/system/common/uploadFile',
  header: {
    Authorization: getToken()
  },
  fileList: [],
  projectList: [],
  userId: null,
})
onMounted(() => {
});
const openDialog = async (type, value,companyId,itemId,catalogueId) => {
  const userInfo = JSON.parse(Cookies.get('userInfo'))
  state.isAdmin = userInfo.userType === 0;
  state.title = type === 'add' ? '新增' : type ==='edit' ? '编辑' : '查看'
  state.form.companyId = companyId
  state.form.itemId = itemId
  state.form.catalogueId = catalogueId
  if(state.title == '编辑'||state.title == '查看'){
    Object.keys(state.form).forEach(key => {
      if (key in value) {
        state.form[key] = value[key]
      }
    })
    state.fileList = value.projectDocuments.map(i => {
      return {
        name: i.fileName,
        path: i.filePath
      }
    })
    state.form.itemId = state.form.itemId == 0 ? null : state.form.itemId
  }
  dialogVisible.value = true
}
const handleChange = ()=> {
  console.log(state.form.catalogueId,'id')
}
const onSubmit = async () => {
  const valid = await superRef.value.validate();
  if(valid){
    if(state.title == '新增'){
      const {id,...data} = state.form
      const res = await addCaralogFile(data)
      if(res.code == 200){
        ElMessage.success(res.message)
        emit('getList')
        handleClose()
        dialogVisible.value = false;
      }else{
        ElMessage.warning(res.message)
      }
    }else{
      const res = await editCaralogFile(state.form)
      if(res.code == 200){
        ElMessage.success(res.message)
        emit('getList')
        handleClose()
        dialogVisible.value = false;
      }else{
        ElMessage.warning(res.message)
      }
    }
  }
}
const handleAvatarSuccess = (response,uploadFile) => {
  if(response.code == 200){
    state.form.projectDocuments = state.fileList.map(item => {
      return {
        fileName: item.response ? item.response?.data.originName: item.name,
        filePath: item.response ? item.response?.data.path: item.path
      }
    })
  }else{
    // state.fileList = []
    // state.form.projectDocuments = []
    ElMessage({
      type: 'warning',
      message: response.message
    })
  }
}
const showTip =()=>{
  ElMessage({
    type: 'warning',
    message: '超出文件上传数量'
  });
}
const picSize = async (rawFile) => {
  if(rawFile.size / 1024 / 1024 > 5){
    ElMessage({
      type: 'warning',
      message: '文件大小不能超过5M'
    });
    return false
  }
};
const handleRemove = async (file, uploadFiles) => {
  state.form.projectDocuments = state.fileList.map(item => {
    return {
      fileName: item.response ? item.response?.data.originName: item.name,
      filePath: item.response ? item.response?.data.path: item.path
    }
  })
}
const handleClose = () => {
  state.form = {
    id: null,
    name: '',
    type: 3,
    filePath: '',
    fileName: '',
    companyId: null,
    catalogueId: null,
    erdact: '',
    number: '',
    itemId: null
  }
  state.fileList = []
  superRef.value.clearValidate();
  superRef.value.resetFields()
  dialogVisible.value = false;
}
defineExpose({
  openDialog
});
</script>
<style scoped lang="scss">
.notice{
  :deep(.el-form .el-form-item__label) {
    font-size: 15px;
  }
  .file {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
  }
}
</style>
src/views/build/conpanyFunctionConsult/digitalFileDep/project/projectFileNew/index.vue
对比新文件
@@ -0,0 +1,576 @@
<template>
  <div class="app-container">
    <div style="margin-bottom: 10px">
      <el-form style="display: flex;flex-wrap: wrap;">
        <el-form-item label="单位名称:" v-if="data.isAdmin" style="margin-left: 20px">
          <el-select
              v-model="data.queryParams.companyName"
              filterable
              remote
              @change="selectValue"
              reserve-keyword
              remote-show-suffix
              :remote-method="getCompanyList"
              :loading="loadingCompany"
              style="width: 240px"
          >
            <el-option
                v-for="item in data.companyList"
                :key="item.id"
                :label="item.name"
                :value="item.name"
            />
          </el-select>
        </el-form-item>
        <el-form-item style="margin-left: 15px" label="项目名称:">
          <el-select v-model="data.queryParams.itemId"
                     filterable
                     placeholder="请选择"
                     clearable style="width: 100%"
                     @change="changePro"
                    >
            <el-option
                v-for="item in data.projectList"
                :key="item.id"
                :label="item.itemName"
                :value="item.id">
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item style="margin-left: 15px">
          <el-button  type="primary" @click="query">查询</el-button>
          <el-button  type="primary" plain @click="reset">重置</el-button>
        </el-form-item>
<!--        <el-form-item>-->
<!--          <el-button-->
<!--              style="margin-left: 15px"-->
<!--              type="primary"-->
<!--              @click="exportData"-->
<!--          >导出</el-button>-->
<!--        </el-form-item>-->
      </el-form>
    </div>
    <el-table v-loading="loading"
              :data="data.dataList"
              :border="true"
              row-key="id"
              :default-expand-all="true"
              :tree-props="{ children: 'children'}"
    >
      <el-table-column label="目录名称" prop="mess"  >
        <template #default="scope">
          {{scope.row.number}} {{scope.row.mess}}
        </template>
      </el-table-column>
            <el-table-column label="项目文档" prop="projectDocuments" align="center" >
              <template #default="scope">
                <div style="display: flex;align-items: center">
                  <div v-for="(item,index) in scope.row.projectDocuments" >
                    <div >
                      <el-link type="primary" @click="openFile(item.filePath)">{{item.fileName}} </el-link><span v-if="index != scope.row.projectDocuments.length-1">、</span>
                    </div>
                  </div>
                </div>
              </template>
            </el-table-column>
            <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="260" >
              <template #default="scope">
                <div v-if="scope.row.filePath || scope.row.isFile == 1">
                  <el-button v-if="scope.row.filePath" link type="primary"  @click="openFile(scope.row.filePath)" >查看模板</el-button>
                  <el-button v-if="scope.row.filePath" link type="primary"  @click="downloadFile(scope.row)" >下载模板</el-button>
                  <el-button v-if="scope.row.isFile == 1" link type="primary" v-hasPermi="['productFileNew:add']" @click="openDataDialog('add',{},scope.row)">新增</el-button>
                  <el-button v-if="scope.row.isFile == 1 && scope.row.projectDocuments && scope.row.projectDocuments.length>0" link type="primary" v-hasPermi="['productFileNew:add']" @click="openDataDialog('edit',scope.row,scope.row)">编辑</el-button>
                </div>
                <div v-else>--</div>
              </template>
            </el-table-column>
          </el-table>
        <div class="pag-container">
          <el-pagination
              v-model:current-page="data.queryParams.pageNum"
              v-model:page-size="data.queryParams.pageSize"
              :page-sizes="[10,15,20,25]"
              layout="total, sizes, prev, pager, next, jumper"
              :total="total"
              @size-change="handleSizeChange"
              @current-change="handleCurrentChange"
          />
        </div>
<!--        <div style="display: flex;align-items: center;justify-content: right;margin-top: 10px">-->
<!--          <el-button v-if="state.form.id && data.isAdmin" type="danger"  @click="deleteData">删除</el-button>-->
<!--          <el-button v-if="data.isAdmin" type="primary"  @click="addData()">保存</el-button>-->
<!--        </div>-->
<!--      </div>-->
<!--    </div>-->
    <dataDialog ref="dialogRef" @getList="getList"></dataDialog>
  </div>
</template>
<script setup>
import {getCurrentInstance, nextTick, onMounted, reactive, ref, toRefs} from "vue";
import Cookies from "js-cookie";
import {ElMessage, ElMessageBox} from "element-plus";
import {getCompany} from "@/api/onlineEducation/company";
import {getToken} from "@/utils/auth";
import {delPic} from "@/api/onlineEducation/banner";
import dataDialog from "./components/dataDialog.vue"
import {delSysClause} from "@/api/staffManage/staff";
import {getCatalogue} from "@/api/qualityManage/catalog";
import {
  addCatalogueData,
  addFile, delCatalogueData,
  delFile,
  editCatalogueData,
  getCatalogueData,
  getFile
} from "@/api/qualityManage/range";
import axios from "axios";
import TEditor from "@/components/Tinymce/Tinymce.vue";
import {renderAsync} from "docx-preview";
import {delProductFile, getProductFilePage, getProductSet} from "@/api/selfProblems/productFile";
import {generateWordDocument} from "@/utils/exportWord";
import {getCaralogFile} from "@/api/projectFileNew";
const { proxy } = getCurrentInstance();
const loading = ref(false);
const dialogRef = ref();
const treeRef = ref()
const dialogRecordRef = ref();
const currentSelectedKey = ref()
const loadingCompany = ref(false)
const data = reactive({
  queryParams: {
    type: 3,
    companyId: null,
    itemId: null,
    pageNum: 1,
    pageSize: 10,
  },
  companyList: [],
  projectList: [],
  isAdmin: false,
  userId: null,
  defaultProps: {
    children: 'children',
    label: 'name',
  },
  dataList: []
});
const total = ref(0);
const { queryParams } = toRefs(data);
onMounted(async () => {
  const userInfo = JSON.parse(Cookies.get('userInfo'))
  data.isAdmin = userInfo.userType === 0;
  data.userId = userInfo.id
  if(data.isAdmin){
    await getCompanyList()
    data.queryParams.companyId = data.companyList[0].id
    data.queryParams.companyName = data.companyList[0].name
  }else {
    data.queryParams.companyId = userInfo.companyId
  }
  await getProjectList()
  await getList()
})
const getProjectList = async () => {
  const param = {
    companyId: data.queryParams.companyId,
    userId: data.isAdmin ? null : data.userId
  }
  const res = await getProductSet(param);
  if(res.code === 200){
    data.projectList = res.data
    // if(res.data && res.data.length >0 ){
    //   data.queryParams.itemId = res.data[0].id
    // }
  }else{
    ElMessage.warning(res.message)
  }
}
const getList = async () => {
  loading.value = true
  const param = {
    companyId:data.queryParams.companyId,
    type: 3,
    itemId:data.queryParams.itemId,
  }
  const res = await getCaralogFile(param);
  if(res.code === 200){
    data.dataList = res.data.data
  }else{
    ElMessage.warning(res.message)
  }
  loading.value = false
}
const handleTree = (val) => {
  const traverse = (nodes, currentPath = '') => {
    nodes.forEach((node, index) => {
      node.mess = `${node.number} ${node.mess}`;
      // 递归处理子节点(传递当前序号路径)
      if (node.children && node.children.length) {
        traverse(node.children, node.number);
      }
    });
  };
  traverse(val); // 从根节点开始遍历
  return val;
}
const getCompanyList = async (val)=>{
  if(val){
    loadingCompany.value = true;
    const queryParams = {
      name: val
    }
    const res = await getCompany(queryParams)
    if (res.code == 200) {
      loadingCompany.value = false;
      data.companyList = res.data.list
    } else {
      ElMessage.warning(res.message)
    }
  }else {
    loadingCompany.value = true;
    const queryParams = {
      pageSize: 10,
      pageNum: 1,
    }
    const res = await getCompany(queryParams)
    if (res.code == 200) {
      loadingCompany.value = false;
      data.companyList = res.data.list
    } else {
      ElMessage.warning(res.message)
    }
  }
}
const selectValue = async (val) => {
  data.companyList.forEach(item => {
    if(item.name === val){
      data.queryParams.companyId = item.id
    }
  })
  data.projectList = []
  data.queryParams.itemId = null
  await getProjectList()
}
const changePro = () => {
}
const openDataDialog = (type, value,item) => {
  if(type === 'add' ){
   if(!data.queryParams.companyId){
     ElMessage.warning('请选择单位')
     return
   }
    if(!data.queryParams.itemId){
      ElMessage.warning('请先选择项目!')
      return
    }
  }
  dialogRef.value.openDialog(type, value, data.queryParams.companyId,data.queryParams.itemId,item.id);
}
const handleDataDelete = (val) => {
  ElMessageBox.confirm(
      '确定删除此条数据?',
      '提示',
      {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning',
      })
      .then( async() => {
        const res = await delProductFile(val.id)
        if(res.code == 200){
          ElMessage.success('数据删除成功')
          await getList()
        }else{
          ElMessage.warning(res.message)
        }
      })
}
const handleRecordDelete = (val) => {
  ElMessageBox.confirm(
      '确定删除此条数据?',
      '提示',
      {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning',
      })
      .then( async() => {
        const res = await delFile(val.id)
        if(res.code == 200){
          ElMessage.success('数据删除成功')
          await getList()
        }else{
          ElMessage.warning(res.message)
        }
      })
}
const reset = async () => {
  data.queryParams = {
    companyId: data.isAdmin ? null : data.queryParams.companyId,
    pageNum: 1,
    pageSize: 10,
    itemId: null,
  }
  data.companyList = [];
  if(data.isAdmin){
    await  getCompanyList()
    data.queryParams.companyId = data.companyList[0].id
    data.queryParams.companyName = data.companyList[0].name
  }
  await getProjectList();
  await getList();
}
const query = async () => {
  await getList()
}
const handleSizeChange = (val) => {
  data.queryParams.pageSize = val
  getList()
}
const handleCurrentChange = (val) => {
  data.queryParams.pageNum = val
  getList()
}
const downloadFile = (e)=>{
  axios.get(import.meta.env.VITE_APP_BASE_API + '/' +e.filePath,{headers:{'Content-Type': 'application/json','Authorization': `${getToken()}`},responseType: 'blob'}).then(res=>{
    if (res) {
      const link = document.createElement('a')
      let blob = new Blob([res.data],{type: res.data.type})
      link.style.display = "none";
      link.href = URL.createObjectURL(blob); // 创建URL
      link.setAttribute("download", e.fileName);
      document.body.appendChild(link);
      link.click();
      document.body.removeChild(link);
    } else {
      ElMessage({
        type: 'warning',
        message: '文件读取失败'
      });
    }
  })
}
const openFile = async(path)=>{
  const ext = path.split('.').pop().toLowerCase();
  if (ext === 'doc' || ext === 'xls' || ext === 'xlsx' || ext === 'ppt' || ext === 'pptx') {
    ElMessageBox.confirm(`暂不支持线上预览.${ext}文件,是否下载查看?`, '提示', { confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning' }).then(() => {
      window.open(`${import.meta.env.VITE_APP_BASE_API}/${path}`, '_blank');
    }).catch(() => {
      console.log('取消预览')
    });
    return
  }else if(ext === 'pdf' || ext === 'jpg'||  ext === 'jpeg' || ext === 'png' ){
    window.open(`${import.meta.env.VITE_APP_BASE_API}/${path}`, '_blank');
  }else{
    try {
      // 1. 获取文件
      const response = await fetch(import.meta.env.VITE_APP_BASE_API + '/' + path);
      const arrayBuffer = await response.arrayBuffer();
      // 2. 创建新窗口
      const win = window.open('', '_blank');
      win.document.write(`
      <!DOCTYPE html>
      <html>
        <head>
          <title>预览</title>
          <style>
            body { margin: 20px; font-family: Arial; }
            .docx-container { width: 100%; height: 100%; }
          </style>
        </head>
        <body>
          <div id="container" class="docx-container"></div>
        </body>
      </html>
    `);
      // 3. 渲染 DOCX
      await renderAsync(arrayBuffer, win.document.getElementById('container'));
    } catch (error) {
      console.error('预览失败:', error);
      alert(`预览失败: ${error.message}`);
    }
  }
}
const exportData = () => {
  if(data.dataList.length == 0){
    ElMessage.warning('暂无数据!')
    return
  }
  startGeneration()
}
const templatePath = '/fileProjectExample.docx'
const startGeneration = async () => {
  let table = {}
  table.name = data.dataList[0].companyName
  const dataList = data.dataList.map((item,index) => {
    return{
      ...item,
      caralog: item.catalogueName
    }
  })
  const caralogList = idGroupToTree(dataList)
  const itemList = idGroupToTree(data.projectList)
  table.tableList = caralogList.map((item,index) => {
    return {
      ...item,
      fileList: item.children.map((f,findex) => {
        return{
          ...f,
          first: findex == 0,
        }
      })
    }
  })
  try {
    generateWordDocument(templatePath, table,  table.name+'_项目过程管控文件清单.docx');
  } catch (error){
    ElMessage({
      type: 'warning',
      message: '导出失败'
    });
  }
}
function idGroupToTree(data) {
  const groups = data.reduce((map, item) => {
    map.has(item.caralog) || map.set(item.caralog, []);
    map.get(item.caralog).push(item);
    return map;
  }, new Map());
  return Array.from(groups).map(([caralog, items]) => ({
    caralog,
    children: items
  }));
}
</script>
<style scoped lang="scss">
.app-container{
  .pag-container{
    float: right;
    margin-top: 10px;
  }
  .bottom{
    display: flex;
    width: auto;
    height: auto;
    border: 1px solid #c3c3c3;
    margin: 20px;
    .left{
      //border-right: 1px solid darkgray;
      display: flex;
      min-width: 240px;
      height: 700px;
      margin: 20px 20px 20px 50px;
      flex-direction: column;
      :deep(.el-tree){
        background: none;
      }
      :deep(.el-tooltip )
      {
        color: black;
        text-overflow: ellipsis;
        overflow: hidden;
        word-break: break-all;
        white-space: nowrap;
      }
      .tree-text {
        display: inline-block;
        max-width: 300px;   /* 根据实际容器宽度调整 */
        white-space: nowrap; /* 强制不换行 */
        overflow: hidden;    /* 隐藏溢出 */
        text-overflow: ellipsis; /* 显示省略号 */
      }
      /* 可选:移除el-tree默认的节点内边距 */
      .el-tree-node__content {
        padding-right: 5px;
      }
      .tree-container {
        max-width: 600px;
        margin-top: 20px;
        height: 100%;
        max-height: 1200px;
        box-shadow: 8px 0 15px rgba(0,21,41,0.08);
        overflow: auto;  /* 确保出现滚动条 */
      }
      /* 隐藏默认滚动条 */
      .tree-hide-scrollbar::-webkit-scrollbar {
        width: 5px;
        background-color: transparent;
      }
      .tree-hide-scrollbar::-webkit-scrollbar-thumb {
        background-color: transparent;
        border-radius: 4px;
      }
      /* 鼠标悬停时显示滚动条 */
      .tree-hide-scrollbar:hover::-webkit-scrollbar-thumb {
        background-color: #e1e1e1;
      }
      .tree-hide-scrollbar:hover::-webkit-scrollbar-track {
        background-color: #f5f7fa;
      }
      .tree{
        max-width: 600px;
        margin-top: 20px;
        height: 800px;
        overflow-x: hidden;
        box-shadow: 8px 0 15px rgba(0,21,41,0.08)
      }
    }
    .right{
      margin: 20px 20px 20px 10px;
      flex: 1;
      min-width: 100px;
      :deep(.el-form-item__label){
        font-weight: 600;font-size: 20px
      }
      :deep(.el-form-item__content){
        float: right;
      }
      .reviewTable {
        :deep(table){
          border: 1px solid #ccc;
          text-align: center;
        }
        :deep(table td){
          border: 1px solid #ccc;
          text-align: center;
          padding: 0 5px;
        }
        :deep(table th){
          border: 1px solid #ccc;
        }
      }
    }
  }
}
</style>
src/views/work/assetMng/toolsMonitorMeasure/annualVerificationPlan/index.vue
@@ -325,6 +325,10 @@
}
const openDialog = (type, value) => {
  if(!data.queryParams.companyId){
    ElMessage.warning('请先选择单位')
    return
  }
  dialogRef.value.openDialog(type, value, data.queryParams.companyId, data.isAdmin, data.companyList);
}
src/views/work/sealManagement/apply/components/editDialog.vue
@@ -102,14 +102,14 @@
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="24">
        <el-row :gutter="24" v-if="title == '查看'">
          <el-col :span="24" style="margin-left: 50px">
            <span style="font-size: 19px;font-weight: 600;">签字意见</span>
            <el-table :data="state.form.flows" :border="true" style="width: 90%;margin-top: 10px">
              <el-table-column label="流程名称" prop="flowName" width="220" align="center"></el-table-column>
              <el-table-column label="内容" align="center">
                <template #default="scope">
                  <span>{{scope.row.approveDeptName}}/{{scope.row.approveUserName}} {{scope.row.approveTime}} {{scope.row.approveContent}}</span>
                  <span>{{scope.row.approveDeptName}}/{{scope.row.approveUserName}} {{scope.row.approveTime}} {{scope.row.approveContent}} {{scope.row.approveMess}}</span>
                </template>
              </el-table-column>
            </el-table>
@@ -267,6 +267,7 @@
      approveUserName: res.data.leaderName,
      approveDeptName: res.data.deptName,
      approveContent: '',
      approveMess:'',
      approveTime: null,
      approveStatus: null,
      status: null
src/views/work/sealManagement/apply/index.vue
@@ -77,12 +77,16 @@
        width="500px"
        :before-close="handleClose"
    >
      <el-form :model="data.applyForm" size="default" ref="noticeRef" label-width="110px" >
      <el-form :model="data.applyForm"  :rules="data.rules" size="default" ref="busRef" label-width="110px" >
        <el-form-item label="审批意见:" prop="approveStatus" >
          <el-radio-group v-model="data.applyForm.approveStatus" >
            <el-radio :label="1">同意</el-radio>
            <el-radio :label="2">不同意</el-radio>
          </el-radio-group>
        </el-form-item>
        <el-form-item prop="approveMess" >
          <el-input type="textarea" :rows="3" v-model="data.applyForm.approveMess"></el-input>
        </el-form-item>
      </el-form>
      <template #footer >
@@ -107,6 +111,7 @@
const { proxy } = getCurrentInstance();
const loading = ref(false);
const noticeRef = ref();
const busRef = ref();
const loadingCompany = ref(false)
const choosedData = ref([])
const data = reactive({
@@ -126,8 +131,13 @@
  applyForm: {
    useSealId: null,
    approveUserId: null,
    approveStatus: null
  }
    approveStatus: null,
    approveMess:''
  },
  rules: {
    approveStatus:[{ required: true, message: '请选择审批意见', trigger: 'blur' }],
    approveMess:[{ required: true, message: '请输入意见内容', trigger: 'blur' }],
  },
});
const dataList = ref([]);
const total = ref(0);
@@ -267,7 +277,8 @@
  data.applyForm = {
    useSealId: val.id,
    approveUserId: data.userId,
    approveStatus: null
    approveStatus: null,
    approveMess:''
  }
  data.showDialog = true
}
@@ -275,22 +286,27 @@
  data.applyForm = {
    useSealId: null,
    approveUserId: null,
    approveStatus: null
    approveStatus: null,
    approveMess:''
  }
  data.showDialog = false
}
const onSubmit = async () => {
  const res = await reviewApply(data.applyForm)
  if(res.code === 200){
    ElMessage({
      type: 'success',
      message: '审批成功'
    });
    await getList();
    data.showDialog = false
  }else{
    ElMessage.warning(res.message)
  const valid = await busRef.value.validate();
  if(valid){
    const res = await reviewApply(data.applyForm)
    if(res.code === 200){
      ElMessage({
        type: 'success',
        message: '审批成功'
      });
      await getList();
      data.showDialog = false
    }else{
      ElMessage.warning(res.message)
    }
  }
}
</script>
<style lang="scss">