Crunchy
2025-04-29 e5454b769d44a34af423bf87ac8a740bf8c20341
src/views/CNAS/systemManagement/managementReview/components/managementReviewPlan.vue
@@ -1,19 +1,24 @@
<template>
  <div>
    <div class="search-background">
      <span class="search-group">
        <span style="width: 160px">评审地点:</span>
        <el-input v-model="searchForm.judgingLocation" clearable size="small"></el-input>
        <el-button size="medium" style="margin-left: 10px" @click="resetSearchForm">重 置</el-button>
        <el-button size="medium" type="primary" @click="searchList">查 询</el-button>
      </span>
      <span class="search-group">
        <el-button size="medium" type="primary" @click="openFormDia('add')">新 增</el-button>
      </span>
    <div class="search">
      <div>
        <el-form :model="searchForm" ref="searchForm" size="small" :inline="true">
          <el-form-item label="评审地点" prop="judgingLocation">
            <el-input v-model="searchForm.judgingLocation" clearable size="small"></el-input>
          </el-form-item>
          <el-form-item>
            <el-button type="primary"  size="mini" @click="searchList">查询</el-button>
            <el-button size="mini" @click="resetSearchForm">重置</el-button>
          </el-form-item>
        </el-form>
      </div>
      <div>
        <el-button size="small" type="primary" @click="openFormDia('add')">新 增</el-button>
      </div>
    </div>
    <div class="table">
      <limsTable :column="tableColumn" :height="'calc(100vh - 23em)'" :table-data="tableData"
        :table-loading="tableLoading" style="padding: 0 10px;margin-bottom: 16px" :page="page" @pagination="pagination">
        :table-loading="tableLoading" :page="page" @pagination="pagination">
      </limsTable>
    </div>
    <management-form-d-ia v-if="managementFormDIa" ref="managementFormDIa"
@@ -215,7 +220,6 @@
        size: this.page.size
      }).then(res => {
        this.tableLoading = false
        if (res.code === 201) return
        this.tableData = res.data.records
        this.page.total = res.data.total
      }).catch(err => {
@@ -249,7 +253,6 @@
        this.tableLoading = true
        deleteReviewProgram({ id: row.id }).then(res => {
          this.tableLoading = false
          if (res.code === 201) return
          this.$message.success('删除成功')
          this.searchList()
        }).catch(err => {
@@ -271,38 +274,8 @@
    },
    handleDown(row) {
      exportReviewProgram({ id: row.id }).then(res => {
        if (res.code == 201) {
          this.$message.error(res.message)
          return
        }
        const blob = new Blob([res], { type: 'application/octet-stream' });
        //将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 = '评审计划.docx';
              link.click();
              this.$download.saveAs(blob, name)
              this.$message.success('导出成功')
            }
          } catch (err) {
            console.log(err);
            const url = URL.createObjectURL(blob);
            const link = document.createElement('a');
            link.href = url;
            link.download = '评审计划.docx';
            link.click();
            this.$message.success('导出成功')
          }
        }
        this.$download.saveAs(blob, '评审计划.docx');
      })
    },
    lookFile(url, name) {
@@ -312,28 +285,16 @@
    },
    handleDown0(url, name) {
      if (!url) return this.$message.warning('文件未上传')
      let url0 = this.javaApi + '/word/' + url
      const link = document.createElement('a');
      link.href = url0;
      link.target = '_blank';
      link.click();
      this.$download.saveAs(url, name);
    }
  }
};
</script>
<style scoped>
.search-background {
  width: 100%;
  height: 60px;
  line-height: 60px;
.search {
  height: 46px;
  display: flex;
  justify-content: space-between;
}
.search-group {
  display: flex;
  align-items: center;
  margin: 0 20px;
}
</style>