mqd 3 лет назад
Родитель
Сommit
3467b0ae79
1 измененных файлов с 31 добавлено и 9 удалено
  1. 31 9
      src/pages/main/advertising/materialApplicationExa.vue

+ 31 - 9
src/pages/main/advertising/materialApplicationExa.vue

@@ -640,15 +640,6 @@ export default {
                 this.total = res.data.totalRecord;
                 this.wo = res.data.body.wo;
                 this.datalist.attList = JSON.parse(this.wo.fileUrl);
-                // console.log(this.datalist.attList)
-                // this.datalist.attList.forEach((item) => {
-                //     this.fileInfo.fileList.push({
-                //         id: item.fileCode,
-                //         fileName: item.fileName,
-                //         fileCode: item.fileCode,
-                //     });
-                // });
-
                 this.loading = false;
             });
         },
@@ -709,6 +700,37 @@ export default {
                         console.log(res);
                     });
                 }
+            } else if (v === 3) {
+                this.$http({
+                    url: "/market/cadvBusiMetirialWo/export",
+                    method: "post",
+                    headers: {
+                        "Content-Type": "application/json"
+                    },
+                    responseType: "blob",
+                    data: { id: this.params.woId }
+                }).then(res => {
+                    if (window.navigator && window.navigator.msSaveOrOpenBlob) {
+                        let blob = new Blob([res.data], {
+                            type: "application/vnd.ms-excel",
+                        });
+                        window.navigator.msSaveOrOpenBlob(
+                            blob,
+                            this.wo.bizName + ".xlsx"
+                        );
+                    } else {
+                        /* 火狐谷歌的文件下载方式 */
+                        var blob = new Blob([res.data]);
+                        var downloadElement = document.createElement("a");
+                        var href = window.URL.createObjectURL(blob);
+                        downloadElement.href = href;
+                        downloadElement.download = this.wo.bizName + ".xlsx";
+                        document.body.appendChild(downloadElement);
+                        downloadElement.click();
+                        document.body.removeChild(downloadElement);
+                        window.URL.revokeObjectURL(href);
+                    }
+                });
             } else if (v === 4) {
                 this.titname = "选择供应商";
                 this.supplierDialogStatus = true;