Bläddra i källkod

样本管理 导出可选择扩展字段

gongyb 4 år sedan
förälder
incheckning
299a8a7521

+ 108 - 21
src/dashoo.cn/frontend_animal/src/pages/samples/archived/index.vue

@@ -210,6 +210,23 @@
         </span>
     </el-dialog>
 
+    <el-dialog title="样本导出" :visible.sync="sampleExportVisible" width = "800px">
+      <el-form>
+        <el-form-item label="样本类型">
+          <el-select v-model="SampleType" placeholder="请选择样本类型">
+            <el-option v-for="(item, index) in ExportSampleTypeList"
+                       :label="item.name"
+                       :value="item.id"
+                       :key="index"></el-option>
+          </el-select>
+        </el-form-item>
+      </el-form>
+      <span slot="footer" class="dialog-footer">
+          <el-button size="mini" @click="sampleExportVisible = false">取 消</el-button>
+          <el-button size="mini" type="primary" @click="exportsamples">导 出</el-button>
+        </span>
+    </el-dialog>
+
     <el-dialog title="选中显示列(拖拽可以实现排序)" :visible.sync="columndialogVisible" top="5vh">
       <el-checkbox :indeterminate="isIndeterminate" v-model="checkAll" @change="handleCheckAllChange"
         style="margin-left:15px;">全选</el-checkbox>
@@ -255,6 +272,8 @@ export default {
   data () {
     return {
       dialogVisible: false,
+      sampleExportVisible: false, // 样本导出弹框
+      exportType: '',
       currentItemCount: 0, // 当前页显示数量
       currentPage: 1, // 当前页
       size: 200, // 每页显示数量
@@ -274,6 +293,7 @@ export default {
       CreateOn: [], // 录入时期
       StartDate: '', // 开始时期
       EndDate: '', // 结束时期
+      ExportSampleTypeList: [], // 导出的样本类型列表
       GroupName: '', // 所属分组
       Name: '', // 名称
       SourceName: '', // 样本来源
@@ -550,8 +570,12 @@ export default {
         .then(res => {
           this.ExpandInfoList = res.data
         })
+      // 获取样本类型列表
+      service.postRequest('dashoo.biobank.bee-0.1', 'SampleRelated', 'GetSampleType')
+        .then(res => {
+          this.SampleTypeList = res.data
+        })
     },
-    // 获取容器名称列表
     GetEquipmentInfos () {
       if (this.DItem != ''){
         service.postRequest('dashoo.biobank.bee-0.1', 'Equipment', 'GetEquipmentInfos', {DItem: this.DItem})
@@ -585,7 +609,10 @@ export default {
         _currentPage: -1
       })
         .then(res => {
-          _this.sampletypes = res.data.items
+          this.getSampleTypeList(this.multipleSelection)
+          this.exportType = 'exportchosen'
+          this.sampleExportVisible = true
+          // _this.exportsamples('exportchosen')
           if (store.get('samplewaitstoreseach').searchWithTemplate && store.get('samplewaitstoreseach').searchWithTemplate !==
             '') { // 自定义查询
             this.handleSearchCommand(store.get('samplewaitstoreseach').searchWithTemplate)
@@ -716,7 +743,7 @@ export default {
         Name: name,
         Fields: []
       }),
-        this.currentSearchTemplateName = name
+      this.currentSearchTemplateName = name
 
       for (let i = 0; i < this.searchTemplates.length; i++) {
         if (this.searchTemplates[i].Name == this.currentSearchTemplateName) {
@@ -1053,7 +1080,10 @@ export default {
           })
           return
         }
-        _this.exportsamples('exportpage')
+        this.getSampleTypeList(null)
+        this.exportType = 'exportpage'
+        this.sampleExportVisible = true
+        // _this.exportsamples('exportpage')
       } else if (command == 'exportall') { // 导出所有数据
         _this.$confirm('此操作将导出所有满足条件的数据!是否继续导出?', '提示', {
           confirmButtonText: '确定',
@@ -1064,7 +1094,45 @@ export default {
         }).catch(() => {})
       }
     },
-    exportsamples (val) {
+    // 获取当前选择样本的类型
+    getSampleTypeList (multipleSelection) {
+      let _this = this
+      _this.ExportSampleTypeList = [{
+        name: '全部',
+        id: 0
+      }]
+      // 导出当前页,遍历当前页数据的样本类型
+      if (multipleSelection != null) {
+        for (var i = 0; i < multipleSelection.length; i++) {
+          var items = undefined
+          items = this.ExportSampleTypeList.find((item) => {
+            if (item.id == multipleSelection[i].SampleType) {
+              return item
+            }
+          })
+          if (items == undefined) {
+            _this.ExportSampleTypeList.push(...this.SampleTypeList.filter(function (e) {
+              return e.id == multipleSelection[i].SampleType
+            }))
+          }
+        }
+      } else if (multipleSelection == null) {
+        for (var i = 0; i < _this.list.length; i++) {
+          var items = undefined
+          items = this.ExportSampleTypeList.find((item) => {
+            if (item.id == _this.list[i].SampleType) {
+              return item
+            }
+          })
+          if (items == undefined) {
+            this.ExportSampleTypeList.push(...this.SampleTypeList.filter(function (e) {
+              return e.id == _this.list[i].SampleType
+            }))
+          }
+        }
+      }
+    },
+    exportsamples () {
       let _this = this
       // 显示列
       let showcolumnarr = []
@@ -1077,8 +1145,8 @@ export default {
         }
       }
       let params = {
-        _currentPage: this.currentPage,
-        _size: this.size,
+        currentPage: this.currentPage,
+        size: this.size,
         BarCode: this.BarCode,
         SampleCode: this.SampleCode,
         SampleType: this.SampleType,
@@ -1094,9 +1162,12 @@ export default {
         Validity: this.Validity,
         InnerCode: this.InnerCode,
         GroupName: this.GroupName,
-        showcolumnarr: showcolumnarr + '',
-        showcolumnnamearr: showcolumnnamearr + '',
-        ExportFlag: 'archived'
+        showColumn: showcolumnarr + '',
+        showColumnName: showcolumnnamearr + '',
+        type: 'archived'
+        // showcolumnarr: showcolumnarr + '',
+        // showcolumnnamearr: showcolumnnamearr + '',
+        // ExportFlag: 'archived'
       }
       if (this.CreateOn && this.CreateOn.length === 2) {
         let params2 = {
@@ -1113,7 +1184,7 @@ export default {
         params = Object.assign(params, params3)
       }
       // 导出所选样本
-      if (val == 'exportchosen') {
+      if (_this.exportType == 'exportchosen') {
         for (var i = 0; i < _this.multipleSelection.length; i++) {
           if (i == _this.multipleSelection.length - 1) {
             id += _this.multipleSelection[i].Id
@@ -1127,7 +1198,7 @@ export default {
         params = Object.assign(params, paramsid)
       }
       // 导出当前页样本
-      if (val == 'exportpage') {
+      if (_this.exportType == 'exportpage') {
         for (var i = 0; i < _this.list.length; i++) {
           if (i == _this.list.length - 1) {
             id += _this.list[i].Id
@@ -1140,15 +1211,31 @@ export default {
         }
         params = Object.assign(params, paramsid)
       }
-      _this.$axios.get('/sampleinput/exportexcel', {
-        params
-      })
-        .then(res => {
-          window.location = 'http://' + res.data
-        })
-        .catch(err => {
-          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
     },
     // 样本条码批量打印
     batchprint () {

+ 102 - 13
src/dashoo.cn/frontend_animal/src/pages/samples/prerecorded/index.vue

@@ -208,6 +208,22 @@
           <el-button size="mini" type="primary" @click="seachdata">查 询</el-button>
         </span>
     </el-dialog>
+    <el-dialog title="样本导出" :visible.sync="sampleExportVisible" width = "800px">
+      <el-form>
+        <el-form-item label="样本类型">
+          <el-select v-model="SampleType" placeholder="请选择样本类型">
+            <el-option v-for="(item, index) in ExportSampleTypeList"
+                       :label="item.name"
+                       :value="item.id"
+                       :key="index"></el-option>
+          </el-select>
+        </el-form-item>
+      </el-form>
+      <span slot="footer" class="dialog-footer">
+          <el-button size="mini" @click="sampleExportVisible = false">取 消</el-button>
+          <el-button size="mini" type="primary" @click="exportsamples">导 出</el-button>
+        </span>
+    </el-dialog>
     <el-dialog title="打印" :visible.sync="dialogPrintVisible" size="tiny">
       <el-select v-model="Printscheme" clearable placeholder="请选择">
         <el-option v-for="item in printschemelist" :label="item.Name" :value="item.FileName" :key="item.FieldName"></el-option>
@@ -259,6 +275,8 @@
       return {
         dialogVisible: false,
         currentItemCount: 0, // 当前页显示数量
+        sampleExportVisible: false, // 样本导出弹框
+        exportType: '',
         currentPage: 1, // 当前页
         size: 200, // 每页显示数量
         list: [], // table显示数据集
@@ -276,6 +294,8 @@
         CreateOn: [], // 录入时期
         StartDate: '', // 开始时期
         EndDate: '', // 结束时期
+        SampleTypeList: [], // 样本类型列表
+        ExportSampleTypeList: [], // 导出的样本类型列表
         GroupName: '', // 所属分组
         Name: '', // 名称
         SourceName: '', // 样本来源
@@ -575,18 +595,25 @@
           .catch(err => {
             console.error(err)
           })
+        // 获取容器类型
         service.postRequest('dashoo.biobank.bee-0.1', 'Equipment', 'GetEquipmentType')
           .then(res => {
             this.EquipmentList = res.data
           })
         this.$refs.multipleTable.doLayout()
+        // 获取样本扩展列表
         service.postRequest('dashoo.biobank.bee-0.1', 'SampleRelated', 'CustomizeSearch', {type: 'Sample'})
           .then(res => {
             this.ExpandInfoList = res.data
           })
+        // 获取样本类型列表
+        service.postRequest('dashoo.biobank.bee-0.1', 'SampleRelated', 'GetSampleType')
+          .then(res => {
+            this.SampleTypeList = res.data
+          })
       },
       GetEquipmentInfos () {
-        if (this.DItem != ''){
+        if (this.DItem != '') {
           service.postRequest('dashoo.biobank.bee-0.1', 'Equipment', 'GetEquipmentInfos', {DItem: this.DItem})
             .then(res => {
               this.EquipmentInfosList = res.data
@@ -660,7 +687,10 @@
             })
             return
           }
-          _this.exportsamples('exportchosen')
+          this.getSampleTypeList(this.multipleSelection)
+          this.exportType = 'exportchosen'
+          this.sampleExportVisible = true
+          // _this.exportsamples('exportchosen')
         } else if (command == 'exportpage') { // 导出当前页数据
           if (_this.list.length < 1) {
             _this.$message({
@@ -669,18 +699,60 @@
             })
             return
           }
-          _this.exportsamples('exportpage')
+          this.getSampleTypeList(null)
+          this.exportType = 'exportpage'
+          this.sampleExportVisible = true
+          // _this.exportsamples('exportpage')
         } else if (command == 'exportall') { // 导出所有数据
           _this.$confirm('此操作将导出所有满足条件的数据!是否继续导出?', '提示', {
             confirmButtonText: '确定',
             cancelButtonText: '取消',
             type: 'info'
           }).then(() => {
+            this.exportType = 'exportall'
             _this.exportsamples()
           }).catch(() => {})
         }
       },
-      exportsamples (val) {
+      // 获取当前选择样本的类型
+      getSampleTypeList (multipleSelection) {
+        let _this = this
+        _this.ExportSampleTypeList = [{
+          name: '全部',
+          id: 0
+        }]
+        // 导出当前页,遍历当前页数据的样本类型
+        if (multipleSelection != null) {
+          for (var i = 0; i < multipleSelection.length; i++) {
+            var items = undefined
+            items = this.ExportSampleTypeList.find((item) => {
+              if (item.id == multipleSelection[i].SampleType) {
+                return item
+              }
+            })
+            if (items == undefined) {
+              _this.ExportSampleTypeList.push(...this.SampleTypeList.filter(function (e) {
+                return e.id == multipleSelection[i].SampleType
+              }))
+            }
+          }
+        } else if (multipleSelection == null) {
+          for (var i = 0; i < _this.list.length; i++) {
+            var items = undefined
+            items = this.ExportSampleTypeList.find((item) => {
+              if (item.id == _this.list[i].SampleType) {
+                return item
+              }
+            })
+            if (items == undefined) {
+              this.ExportSampleTypeList.push(...this.SampleTypeList.filter(function (e) {
+                return e.id == _this.list[i].SampleType
+              }))
+            }
+          }
+        }
+      },
+      exportsamples () {
         let _this = this
         // 显示列
         let showcolumnarr = []
@@ -693,8 +765,8 @@
           }
         }
         let params = {
-          _currentPage: this.currentPage,
-          _size: this.size,
+          currentPage: this.exportType == 'exportall' ? 0 : this.currentPage,
+          size: this.exportType == 'exportall' ? 0 : this.size,
           BarCode: this.BarCode,
           SampleCode: this.SampleCode,
           SampleType: this.SampleType,
@@ -706,9 +778,13 @@
           Validity: this.Validity,
           InnerCode: this.InnerCode,
           GroupName: this.GroupName,
-          showcolumnarr: showcolumnarr + '',
+          showColumn: showcolumnarr + '',
+          showColumnName: showcolumnnamearr + '',
+          type: 'prerecorded'
+          /* showcolumnarr: showcolumnarr + '',
           showcolumnnamearr: showcolumnnamearr + '',
-          ExportFlag: 'prerecorded'
+          ExportFlag: 'prerecorded' */
+
         }
         if (this.CreateOn && this.CreateOn.length === 2) {
           let params2 = {
@@ -725,7 +801,7 @@
           params = Object.assign(params, params3)
         }
         // 导出所选样本
-        if (val == 'exportchosen') {
+        if (_this.exportType == 'exportchosen') {
           for (var i = 0; i < _this.multipleSelection.length; i++) {
             if (i == _this.multipleSelection.length - 1) {
               id += _this.multipleSelection[i].Id
@@ -739,7 +815,7 @@
           params = Object.assign(params, paramsid)
         }
         // 导出当前页样本
-        if (val == 'exportpage') {
+        if (_this.exportType == 'exportpage') {
           for (var i = 0; i < _this.list.length; i++) {
             if (i == _this.list.length - 1) {
               id += _this.list[i].Id
@@ -752,8 +828,20 @@
           }
           params = Object.assign(params, paramsid)
         }
-        console.log(params, 'params++')
-        _this.$axios.get('/sampleinput/exportexcel', {
+        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)
+      },
+      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
+        /* _this.$axios.get('/sampleinput/exportexcel', {
           params
         })
           .then(res => {
@@ -762,7 +850,7 @@
           .catch(err => {
             // handle error
             console.error(err)
-          })
+          }) */
       },
       // 样本条码批量打印
       batchprint () {
@@ -1202,6 +1290,7 @@
         this.SampleType = ''
         this.STNoteField = ''
         this.Stnotevalue = ''
+        this.exportType = ''
         this.Validity = []
         this.GroupName = ''
         this.currentPage = 1

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

@@ -357,7 +357,7 @@
         Id: 0, // ID
         BarCode: '', // 样本条码
         SampleCode: '', // 样本编码
-        SampleType: 0, // 样本类型
+        SampleType: '', // 样本类型
         SamplingSite: '', // 取材部位
         Stnotevalue: '', // 特有扩展检索值
         STNoteField: [], // 特有扩展名称

+ 111 - 19
src/dashoo.cn/frontend_animal/src/pages/samples/waitingstore/index.vue

@@ -213,6 +213,22 @@
           <el-button size="mini" type="primary" @click="seachdata">查 询</el-button>
         </span>
     </el-dialog>
+    <el-dialog title="样本导出" :visible.sync="sampleExportVisible" width = "800px">
+      <el-form>
+        <el-form-item label="样本类型">
+          <el-select v-model="SampleType" placeholder="请选择样本类型">
+            <el-option v-for="(item, index) in ExportSampleTypeList"
+                       :label="item.name"
+                       :value="item.id"
+                       :key="index"></el-option>
+          </el-select>
+        </el-form-item>
+      </el-form>
+      <span slot="footer" class="dialog-footer">
+          <el-button size="mini" @click="sampleExportVisible = false">取 消</el-button>
+          <el-button size="mini" type="primary" @click="exportsamples">导 出</el-button>
+        </span>
+    </el-dialog>
 
     <el-dialog title="选中显示列(拖拽可以实现排序)" :visible.sync="columndialogVisible" top="5vh">
       <el-checkbox :indeterminate="isIndeterminate" v-model="checkAll" @change="handleCheckAllChange" style="margin-left:15px;">全选</el-checkbox>
@@ -255,6 +271,8 @@
     data () {
       return {
         dialogVisible: false,
+        sampleExportVisible: false, // 样本导出弹框
+        exportType: '',
         currentItemCount: 0, // 当前页显示数量
         currentPage: 1, // 当前页
         size: 200, // 每页显示数量
@@ -277,6 +295,8 @@
         Name: '', // 名称
         SourceName: '', // 样本来源
         InnerCode: '', // 样本内码
+        SampleTypeList: [], // 样本类型列表
+        ExportSampleTypeList: [], // 导出的样本类型列表
         dialogFormVisible: false, // 添加弹框是否显示
         showquerydiv: false,
         sampletypes: [], // 样本类型
@@ -538,15 +558,22 @@
           .catch(err => {
             console.error(err)
           })
+        // 获取容器类型
         service.postRequest('dashoo.biobank.bee-0.1', 'Equipment', 'GetEquipmentType')
           .then(res => {
             this.EquipmentList = res.data
           })
         this.$refs.multipleTable.doLayout()
+        // 获取样本扩展列表
         service.postRequest('dashoo.biobank.bee-0.1', 'SampleRelated', 'CustomizeSearch', {type: 'Sample'})
           .then(res => {
             this.ExpandInfoList = res.data
           })
+        // 获取样本类型列表
+        service.postRequest('dashoo.biobank.bee-0.1', 'SampleRelated', 'GetSampleType')
+          .then(res => {
+            this.SampleTypeList = res.data
+          })
       },
       GetEquipmentInfos () {
         if (this.DItem != ''){
@@ -1023,6 +1050,7 @@
         this.STNoteField = ''
         this.Stnotevalue = ''
         this.Validity = []
+        this.exportType = ''
         this.Noteitem = []
         this.Noteitemvalue = ''
         this.currentPage = 1
@@ -1040,7 +1068,10 @@
             })
             return
           }
-          _this.exportsamples('exportchosen')
+          this.getSampleTypeList(this.multipleSelection)
+          this.exportType = 'exportchosen'
+          this.sampleExportVisible = true
+          // _this.exportsamples('exportchosen')
         } else if (command == 'exportpage') { // 导出当前页数据
           if (_this.list.length < 1) {
             _this.$message({
@@ -1049,18 +1080,60 @@
             })
             return
           }
-          _this.exportsamples('exportpage')
+          this.getSampleTypeList(null)
+          this.exportType = 'exportpage'
+          this.sampleExportVisible = true
+          // _this.exportsamples('exportpage')
         } else if (command == 'exportall') { // 导出所有数据
           _this.$confirm('此操作将导出所有满足条件的数据!是否继续导出?', '提示', {
             confirmButtonText: '确定',
             cancelButtonText: '取消',
             type: 'info'
           }).then(() => {
+            this.exportType = 'exportall'
             _this.exportsamples()
           }).catch(() => {})
         }
       },
-      exportsamples (val) {
+      // 获取当前选择样本的类型
+      getSampleTypeList (multipleSelection) {
+        let _this = this
+        _this.ExportSampleTypeList = [{
+          name: '全部',
+          id: 0
+        }]
+        // 导出当前页,遍历当前页数据的样本类型
+        if (multipleSelection != null) {
+          for (var i = 0; i < multipleSelection.length; i++) {
+            var items = undefined
+            items = this.ExportSampleTypeList.find((item) => {
+              if (item.id == multipleSelection[i].SampleType) {
+                return item
+              }
+            })
+            if (items == undefined) {
+              _this.ExportSampleTypeList.push(...this.SampleTypeList.filter(function (e) {
+                return e.id == multipleSelection[i].SampleType
+              }))
+            }
+          }
+        } else if (multipleSelection == null) {
+          for (var i = 0; i < _this.list.length; i++) {
+            var items = undefined
+            items = this.ExportSampleTypeList.find((item) => {
+              if (item.id == _this.list[i].SampleType) {
+                return item
+              }
+            })
+            if (items == undefined) {
+              this.ExportSampleTypeList.push(...this.SampleTypeList.filter(function (e) {
+                return e.id == _this.list[i].SampleType
+              }))
+            }
+          }
+        }
+      },
+      exportsamples () {
         let _this = this
         // 显示列
         let showcolumnarr = []
@@ -1073,8 +1146,8 @@
           }
         }
         let params = {
-          _currentPage: this.currentPage,
-          _size: this.size,
+          currentPage: this.exportType == 'exportall' ? 0 : this.currentPage,
+          size: this.exportType == 'exportall' ? 0 : this.size,
           BarCode: this.BarCode,
           SampleCode: this.SampleCode,
           SampleType: this.SampleType,
@@ -1090,9 +1163,12 @@
           Validity: this.Validity,
           InnerCode: this.InnerCode,
           GroupName: this.GroupName,
-          showcolumnarr: showcolumnarr + '',
-          showcolumnnamearr: showcolumnnamearr + '',
-          ExportFlag: 'waitingstore'
+          showColumn: showcolumnarr + '',
+          showColumnName: showcolumnnamearr + '',
+          type: 'waitingstore'
+          // showcolumnarr: showcolumnarr + '',
+          // showcolumnnamearr: showcolumnnamearr + '',
+          // ExportFlag: 'waitingstore'
         }
         if (this.CreateOn && this.CreateOn.length === 2) {
           let params2 = {
@@ -1109,7 +1185,7 @@
           params = Object.assign(params, params3)
         }
         // 导出所选样本
-        if (val == 'exportchosen') {
+        if (_this.exportType == 'exportchosen') {
           for (var i = 0; i < _this.multipleSelection.length; i++) {
             if (i == _this.multipleSelection.length - 1) {
               id += _this.multipleSelection[i].Id
@@ -1123,7 +1199,7 @@
           params = Object.assign(params, paramsid)
         }
         // 导出当前页样本
-        if (val == 'exportpage') {
+        if (_this.exportType == 'exportchosen') {
           for (var i = 0; i < _this.list.length; i++) {
             if (i == _this.list.length - 1) {
               id += _this.list[i].Id
@@ -1136,15 +1212,31 @@
           }
           params = Object.assign(params, paramsid)
         }
-        _this.$axios.get('/sampleinput/exportexcel', {
-          params
-        })
-          .then(res => {
-            window.location = 'http://' + res.data
-          })
-          .catch(err => {
-            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
       },
       // 样本条码批量打印
       batchprint () {