瀏覽代碼

样本导出功能切换到微服务上

jianglw 4 年之前
父節點
當前提交
90d637ade7

+ 1 - 1
src/dashoo.cn/frontend_animal/src/pages/biobank/source/animal.vue

@@ -899,7 +899,7 @@ export default {
         AuditorName: this.AuditorName,
         showColumn: showcolumnarr + '',
         showColumnName: showcolumnnamearr + '',
-        Type: 'SampleSource'
+        type: 'SampleSource'
       }
       /*    if (this.CreateOn && this.CreateOn.length === 2) {
         let params2 = {

+ 33 - 17
src/dashoo.cn/frontend_animal/src/pages/samples/stored/index.vue

@@ -908,8 +908,8 @@
           }
         }
         let params = {
-          _currentPage: this.currentPage,
-          _size: this.size,
+          currentPage: this.currentPage,
+          size: this.size,
           BarCode: this.BarCode,
           SampleCode: this.SampleCode,
           SampleType: this.SampleType,
@@ -921,9 +921,12 @@
           Validity: this.Validity,
           InnerCode: this.InnerCode,
           GroupName: this.GroupName,
-          showcolumnarr: showcolumnarr + '',
-          showcolumnnamearr: showcolumnnamearr + '',
-          ExportFlag: 'stored'
+          showColumn: showcolumnarr + '',
+          showColumnName: showcolumnnamearr + '',
+          type: 'stored'
+          // showcolumnarr: showcolumnarr + '',
+          // showcolumnnamearr: showcolumnnamearr + '',
+          // ExportFlag: 'stored'
         }
         if (this.CreateOn && this.CreateOn.length === 2) {
           let params2 = {
@@ -967,18 +970,31 @@
           }
           params = Object.assign(params, paramsid)
         }
-        _this.$axios.get('/sampleinput/exportexcel', {
-          params
-        })
-          .then(res => {
-            _this.exportloading = false
-            window.location = 'http://' + res.data
-          })
-          .catch(err => {
-            _this.exportloading = false
-            // handle error
-            console.error(err)
-          })
+        const dateInfo = this.formatExportDate(new Date())
+        const name = dateInfo + '样本来源.xlsx'
+        console.log('filename', name)
+        // 样本来源相关导出
+        service.downloadExcel('dashoo.biobank.bee-0.1', 'SampleRelated', 'ExportExcel', name, params)
+        // _this.$axios.get('/sampleinput/exportexcel', {
+        //   params
+        // })
+        //   .then(res => {
+        //     _this.exportloading = false
+        //     // window.location = 'http://' + res.data
+        //   })
+        //   .catch(err => {
+        //     _this.exportloading = false
+        //     // handle error
+        //     console.error(err)
+        //   })
+      },
+      formatExportDate (date) {
+        var y = date.getFullYear()
+        var m = date.getMonth() + 1
+        m = m < 10 ? ('0' + m) : m
+        var d = date.getDate()
+        d = d < 10 ? ('0' + d) : d
+        return y + m + d
       },
       doprintscheme () {
         this.dialogPrintVisible = false