fei
2025-11-15 2417a23dc04d04bd422d6f978958e10bf1633548
修改代码
1个文件已修改
60 ■■■■ 已修改文件
src/views/archiveManager/index.vue 60 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/archiveManager/index.vue
@@ -419,9 +419,10 @@
            <div class="option-group">
              <div class="option-label">选择注解:</div>
              <div class="annotation-options">
                <label v-for="i in 5" :key="i" class="annotation-checkbox">
                  <input type="checkbox" v-model="excelOptions.selectedAnnotations" :value="i">
                  <span>注解{{ i }}</span>
              <label v-for="(annotation, index) in excelOptions.selectedAnnotations" :key="index" class="signature-checkbox">
                              <input type="checkbox" v-model="excelOptions.subselectedAnnotations" :value="annotation">
                              <span>{{ annotation }}
                              </span>
                </label>
              </div>
            </div>
@@ -431,10 +432,13 @@
              <div class="option-label">签名栏设置:</div>
              <div class="signature-options">
                <div class="signature-checkboxes">
                  <label v-for="i in 3" :key="i" class="signature-checkbox">
                    <input type="checkbox" v-model="excelOptions.selectedSignatures" :value="i">
                    <span>签名栏{{ i }}</span>
                 <label v-for="(signature, index) in excelOptions.selectedSignatures" :key="index" class="signature-checkbox">
                                 <input type="checkbox" v-model="excelOptions.subselectedSignatures" :value="signature">
                                 <span>{{ signature }}</span>
                  </label>
                </div>
<!--                <p v-if="excelOptions.selectedSignatures.length === 0" class="option-tip">请选择至少一个签名栏</p> -->
              </div>
@@ -442,7 +446,9 @@
          </div>
        </div>
    <!-- 优化的Excel预览组件 -->
    <div class="excel-preview-wrapper" v-if="excelDialogVisible">
     <el-dialog class="excel-preview-wrapper" :visible.sync="showExcelPreview" :modal="false" width="80%">
    <div  >
      <!-- 主要预览组件 -->
      <vue-office-excel
        v-if="currentExcelUrl"
@@ -464,7 +470,7 @@
        <button class="excel-dialog-btn download-btn" @click="handleDownloadClick">下载Excel文件</button>
      </div>
    </div>
</el-dialog>
        <div class="excel-dialog-footer">
          <button class="excel-dialog-btn preview-btn" @click="handlePreviewClick">预览</button>
          <button class="excel-dialog-btn print-btn" @click="handlePrintClick">打印</button>
@@ -885,8 +891,15 @@
    // Excel选项配置
    excelOptions: {
      includeQrCode: false, // 是否包含二维码
      selectedAnnotations: [], // 选中的注解列表
      selectedAnnotations: ["本清单由档案形成部门完成",
           "文件类型必须录入,包括结论材料、过程材料、申请材料,其他材料",
            "公开属性必须录入,主动公开、依申请公开、免予公开",
             "保管期限:30年或永久",
            "页号按照正式录入页码为准"], // 选中的注解列表
      includeSignature: false, // 是否包含签名栏
            selectedSignatures: ['业务科室移交人:', '审批科移交人:', '档案整理公司:'], // 选中的签名栏列表
            subselectedSignatures: [],
            subselectedAnnotations: [],
      signaturePosition: 'bottom' // 签名栏位置:top/bottom
    },
      // 表单参数
@@ -1377,7 +1390,7 @@
    /** 处理预览按钮点击 */
    handlePreviewClick() {
      this.excelLoading = true;
      this.showExcelPreview = true;
      this.excelRenderError = '';
      // 重置vue-office-excel组件
@@ -1602,13 +1615,23 @@
    /** 从后端获取Excel文件 */
    getExcelFile(id) {
      var includeQrCode = this.excelOptions.includeQrCode;
      return new Promise((resolve, reject) => {
        // 首先尝试使用axios(项目已有的HTTP客户端)
        try {
          // 获取用户选择的注解
          const { selectedAnnotations } = this.excelOptions;
          // 构建参数,包含注解内容
          const params = {
            recordId: id,
          };
alert(355)
          axios({
            method: 'Post',
            url: `${process.env.VUE_APP_BASE_API}/system/records/model`,
            params: { id: id },
            url: `${process.env.VUE_APP_BASE_API}/system/records/recordFileList`+"/"+includeQrCode,
            params: params,
            responseType: 'blob',
            headers: { 'Authorization': 'Bearer ' + getToken() }
          }).then(response => {
@@ -1629,9 +1652,20 @@
    fallbackGetExcelFile(id, resolve, reject) {
      try {
        const xhr = new XMLHttpRequest();
        // 构建查询参数,包含注解内容
        const queryParams = new URLSearchParams({
          id: id,
          annotation1: "本清单由档案形成部门完成",
          annotation2: "文件类型必须录入,包括结论材料、过程材料、申请材料,其他材料",
          annotation3: "公开属性必须录入,主动公开、依申请公开、免予公开",
          annotation4: "保管期限:30年或永久",
          annotation5: "页号按照正式录入页码为准"
        }).toString();
        // 尝试不同的API路径,以适应可能的后端实现
        const apiUrls = [
          `${process.env.VUE_APP_BASE_API}/system/records/model?id=${id}`,
          `${process.env.VUE_APP_BASE_API}/system/records/model?${queryParams}`,
          `${process.env.VUE_APP_BASE_API}/system/records/model`
        ];