linwenling
2023-10-22 dbca8bf9dde4fe0c7eb89a0c30b095eb823142a5
ruoyi-ui/src/views/healthy/healthyInfo.vue
@@ -1,8 +1,15 @@
<template>
  <div class="app-container">
  <div class="app-container" id="printable-content">
    <div class="form-header mt">
      <h4 class="dt h4">健康详细信息 </h4>
      <h1 style="font-size:21px;padding-top:30px;display: flex;justify-content: space-between;align-items: center;" >
        <span>健康记录详细信息</span>
        <div style="display: flex; align-items: center;">
          <el-button size="mini" type="text"  v-print="'#printable-content'" v-hasPermi="['person:information:memo']">
            <div class="form" ><el-icon  style="padding-right:100px;"></el-icon>
              <span class="text" style="width: 69px;height: 26px;font-size: 16px;
            font-family: Microsoft YaHei-Regular, Microsoft YaHei; color: #EBA4AA;">打印</span></div>
          </el-button></div>
      </h1>
    </div>
    <el-form ref="elForm" :model="formData" :rules="rules" size="medium" label-width="120px">
@@ -38,6 +45,8 @@
        multiple
        :http-request="requestUpload"
        :file-list="fileList"
        :disabled="!btn"
        :class="{ hide: !btn }"
      >
        <div v-if="uploading" class="upload-status">正在上传...</div>
        <i v-if="!uploading" slot="default" class="el-icon-plus"></i>
@@ -89,6 +98,8 @@
        :on-remove="handleRemoveFile"
        :http-request="requestUpload"
        :show-file-list="true"
        :disabled="!btn"
        :class="{ hide: !btn }"
      >
        <div v-if="uploading" class="upload-status">正在上传...</div>
        <i v-if="!uploading" slot="default" class="el-icon-plus"></i>
@@ -142,7 +153,7 @@
  </div>
</template>
<script>
import {getHealthInfo,  uploadPic, download, updateSecret} from "@/api/healthy/index";
import {getHealthInfo, uploadPic, download, updateHealth} from "@/api/healthy/index";
import {addRole, updateRole} from "@/api/system/role";
import {blobValidate} from "@/utils/ruoyi";
import errorCode from "@/utils/errorCode";
@@ -169,7 +180,6 @@
        type: undefined,
        happenTime: undefined,
        accNo:undefined,
        validityDate:undefined,
        password:undefined,
        validityDate:undefined,
        isFinger:undefined,
@@ -255,6 +265,7 @@
      document.title = "查看健康详细信息";
      this.$route.meta.title = "查看健康详细信息";//列表的名称
      this.isShow=false
      this.btn = false;
    }
    let _this = this
@@ -319,7 +330,7 @@
        if (valid) {
          if (this.formData.id != undefined) {
            updateSecret(this.formData).then(response => {
            updateHealth(this.formData).then(response => {
              this.$modal.msgSuccess("修改成功");
              // this.open = false;
              this.btn=false
@@ -363,9 +374,16 @@
    },
    handleFileCardPreview(file){
      this.dialogFileUrl = file.url;
      // alert(file.url)
      // this.dialogFileUrl = 'https://www.bendudu.com:8080/profile/upload/2023/10/18/20231018214647A011.doc'
      // this.dialogFileUrl = 'https://47.93.189.255:8080/profile/upload/2023/03/19/test7_20230319222030A007.jpg'
      if(this.dialogFileUrl.includes("47.93.189.255")==true)
        this.dialogFileUrl = this.dialogFileUrl.replace("47.93.189.255","www.bendudu.com")
      //alert(this.dialogFileUrl)
      const Base64 = require('js-base64').Base64
      this.desurl = process.env.VUE_APP_BASE_OTHER_API+'onlinePreview?url='+encodeURIComponent(Base64.encode(this.dialogFileUrl));
      myWindow=window.open(this.desurl,'','width=1200,height=800,top=150,left=300');
      this.desurl = process.env.VUE_APP_BASE_OTHER_API+"preview/"+'onlinePreview?url='+encodeURIComponent(Base64.encode(this.dialogFileUrl));
      let myWindow=window.open(this.desurl,'','width=1200,height=800,top=150,left=300');
    },
    handlePictureCardPreview(file) {
      this.dialogImageUrl = file.url;
@@ -379,7 +397,7 @@
      download(formData).then(async (response) => {
        const isLogin = await blobValidate(response);
        let nt = new Date().getTime()
        let filename = 'familyevent_'+nt+'.'+suffix
        let filename = 'healthyInfo'+nt+'.'+suffix
        const blob = new Blob([response])
        saveAs(blob, filename)
      })
@@ -387,7 +405,7 @@
    handleEdit()
    {
      this.dsb = false
      // this.btn = true
      this.btn = true
      this.isShow=false
    },
    requestUpload(params)
@@ -415,13 +433,6 @@
    },
    /** 导出按钮操作 */
    handleExport() {
      this.download('/zfEconomy/export', {
        ...this.queryParams
      }, `zfEconomy_${new Date().getTime()}.xlsx`)
    }
  }
}
@@ -441,4 +452,10 @@
  display: block;
  position: absolute;
}
.hide .el-upload--picture-card {
  display: none;
}
.form{
  background:center/11% no-repeat url('../../assets/icons/form.png') ;
}
</style>