spring
2025-02-19 b87075597989e9a7de543967d54be4780be27de7
src/components/caorui/Department/components/Plan/index.vue
@@ -46,8 +46,8 @@
                        <el-date-picker v-model="yearDetailForm.date" class="date_box" format="yyyy-MM-dd" placeholder="选择日期"
                            size="small" type="date" value-format="yyyy-MM-dd">
                        </el-date-picker>
                        <span>监督项目</span>
                        <el-input v-model="yearDetailForm.project" class="search" placeholder="请输入" size="small"></el-input>
                        <!-- <span>监督项目</span> -->
                        <!-- <el-input v-model="yearDetailForm.superviseDes" class="search" placeholder="请输入" size="small"></el-input> -->
                        <el-button size="small" type="primary" @click="getYearDetailPlanList">查询</el-button>
                        <el-button size="small" @click="clearDetail">清空</el-button>
                    </div>
@@ -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',
@@ -190,8 +193,7 @@
                }],
            yearLoading: false,
            yearDetailForm: {
                date: undefined,
                project: undefined
                date: undefined
            },
            yearDetailTableData: [],    // 年明细表
            yearDeatilPage: {
@@ -213,8 +215,8 @@
                    label: '备注',
                    prop: 'remarks'
                }, {
                    label: '培训日期',
                    prop: 'trainDate'
                    label: '监督项目',
                    prop: 'superviseProject'
                }, {
                    label: '创建',
                    prop: 'createBy'
@@ -307,7 +309,6 @@
        // 清除明细
        clearDetail() {
            this.yearDetailForm.date = undefined
            this.yearDetailForm.project = undefined
            this.getYearDetailPlanList()
        },
@@ -323,8 +324,7 @@
                    planId: this.planId,
                    current: this.yearDeatilPage.curent,
                    size: this.yearDeatilPage.pageSize,
                    date: this.yearDetailForm.date,
                    project: this.yearDetailForm.project
                    date: this.yearDetailForm.date
                }
            })
            if (code == 200) {
@@ -409,15 +409,35 @@
        },
      // 年度计划表-下载
      downLoadPost(row) {
        this.$axios.get(exportSuperVisePlanApi + '?id=' + row.id,{responseType: "blob"}).then(res => {
        this.$axios.post(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) {