Crunchy
2025-04-29 e5454b769d44a34af423bf87ac8a740bf8c20341
src/views/business/materialOrderComponents/materialOrder/downFileDialog.vue
@@ -20,12 +20,10 @@
</template>
<script>
import ValueTable from "@/components/Table/value-table.vue";
export default {
  name: "downFileDialog",
  // import 引入的组件需要注入到对象中才能使用
  components: {ValueTable},
  components: {},
  props: {
    downFileDialogVisible: {
      type: Boolean,
@@ -46,13 +44,27 @@
  methods: {
    // 进厂检验报告下载
    downLoad0 () {
      let url = this.javaApi+'/word/' + this.downLoadInfo.enterUrlS ? this.downLoadInfo.enterUrlS : this.downLoadInfo.enterUrl
      this.$download.saveAs(url, this.downLoadInfo.fileName);
      let url = this.downLoadInfo.enterUrlS ? this.downLoadInfo.enterUrlS : this.downLoadInfo.enterUrl
      if(url){
        url = url.split('.')[0]+'.pdf'
        const link = document.createElement('a');
        link.href = this.javaApi + url;
        link.target = '_blank';
        document.body.appendChild(link);
        link.click();
      }
    },
    // 季度检验报告下载
    downLoad1 () {
      let url = this.javaApi+'/word/' + this.downLoadInfo.quarterUrlS ? this.downLoadInfo.quarterUrlS : this.downLoadInfo.quarterUrl
      this.$download.saveAs(url, this.downLoadInfo.fileName);
      let url = this.downLoadInfo.quarterUrlS ? this.downLoadInfo.quarterUrlS : this.downLoadInfo.quarterUrl
      if(url){
        url = url.split('.')[0]+'.pdf'
        const link = document.createElement('a');
        link.href = this.javaApi + url;
        link.target = '_blank';
        document.body.appendChild(link);
        link.click();
      }
    }
  },
}