licp
2024-12-24 e4bb381c896015c4b87faa002ba6875c06a2fd16
src/components/caorui/Department/components/Plan/index.vue
@@ -92,7 +92,7 @@
        return {
            planId: undefined,
            yearForm: {
                organizationPerson: undefined,
              organizationPerson: undefined,
            },
            yearTableData: [],  // 年表
            yearPage: {
@@ -107,7 +107,7 @@
                    minWidth: '150px'
                }, {
                    label: '编制人',
                    prop: 'organizationPerson',
                    prop: 'organizationPersonName',
                    minWidth: '100'
                }, {
                    label: '编制日期',
@@ -117,14 +117,17 @@
                    label: '批准人',
                    prop: 'approvalName',
                    minWidth: '100'
                }, {
                },
                 {
                    label: '批准日期',
                    prop: 'approvalDate',
                    minWidth: '160'
                }, {
                    label: '审核人',
                    prop: 'examine'
                }, {
                },
                // {
                //     label: '审核人',
                //     prop: 'examine'
                // },
                {
                    dataType: 'tag',
                    label: '批准状态',
                    prop: 'approvalStatus',
@@ -411,13 +414,33 @@
      downLoadPost(row) {
        this.$axios.get(exportSuperVisePlanApi + '?id=' + row.id,{responseType: "blob"}).then(res => {
          this.outLoading = false
          this.$message.success('导出成功')
          const blob = new Blob([res],{ type: 'application/msword' });
          const url = URL.createObjectURL(blob);
          const link = document.createElement('a');
          link.href = url;
          link.download = row.fileName + '.docx';
          link.click();
          //将Blob 对象转换成字符串
          let reader = new FileReader();
          reader.readAsText(blob, 'utf-8');
          reader.onload = () => {
            try {
              let result = JSON.parse(reader.result);
              if (result.message) {
                this.$message.error(result.message);
              } else {
                const url = URL.createObjectURL(blob);
                const link = document.createElement('a');
                link.href = url;
                link.download = row.fileName + '.docx';
                link.click();
                this.$message.success('导出成功')
              }
            } catch (err) {
              console.log(err);
              const url = URL.createObjectURL(blob);
              const link = document.createElement('a');
              link.href = url;
              link.download = row.fileName + '.docx';
              link.click();
              this.$message.success('导出成功')
            }
          }
        })
      },
      async approvalYearPlanFun(approvalStatus, rowId) {