4
0
Эх сурвалжийг харах

添加已存储样本导出时样本类型选择

jianglw 4 жил өмнө
parent
commit
48ea934fe6

+ 7 - 3
src/dashoo.cn/frontend_animal/src/pages/samples/archived/index.vue

@@ -265,8 +265,9 @@ export default {
       Stnotevalue: '', // 特有扩展检索值
       DItem: '', // 容器类型id
       EquipmentList: [], // 容器类型列表
-      ExpandInfoList: [], // 扩展字段列表
       EquipmentInfosList: [], // 容器名称列表
+      SampleTypeList: [], // 样本类型列表
+      ExpandInfoList: [], // 扩展字段列表
       EquipmentIds: [], // 设备id列表
       STNoteField: [], // 特有扩展名称
       CreateBy: '', // 录入人
@@ -538,16 +539,19 @@ export default {
         .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
         })
     },
+    // 获取容器名称列表
     GetEquipmentInfos () {
       if (this.DItem != ''){
         service.postRequest('dashoo.biobank.bee-0.1', 'Equipment', 'GetEquipmentInfos', {DItem: this.DItem})
@@ -690,7 +694,7 @@ export default {
           template: command,
           isDelete: 0,
           type: 'Sample',
-          status: 'waitingstore'
+          status: 'archived'
         }
         console.log(params)
         service.postRequest('dashoo.biobank.bee-0.1', 'SampleRelated', 'SampleSearchByTemplate', params).then(res => {
@@ -1092,7 +1096,7 @@ export default {
         GroupName: this.GroupName,
         showcolumnarr: showcolumnarr + '',
         showcolumnnamearr: showcolumnnamearr + '',
-        ExportFlag: 'waitingstore'
+        ExportFlag: 'archived'
       }
       if (this.CreateOn && this.CreateOn.length === 2) {
         let params2 = {

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

@@ -252,6 +252,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(ExportType)">导 出</el-button>
+        </span>
+      </el-dialog>
+
       <el-dialog title="打印" :visible.sync="dialogPrintVisible" size="tiny">
         <el-select v-model="Printscheme" placeholder="请选择">
           <el-option v-for="item in printschemelist" :label="item.Name" :value="item.FileName" :key="item.FileName">
@@ -324,6 +341,8 @@
     data () {
       return {
         dialogVisible: false,
+        sampleExportVisible: false, // 样本导出弹框
+        exportType: '',
         sampleinfodetail: {
           BarCode: '',
           SampleCode: ''
@@ -347,6 +366,8 @@
         EquipmentList: [], // 容器类型列表
         EquipmentInfosList: [], // 容器名称列表
         ExpandInfoList: [], // 扩展字段列表
+        SampleTypeList: [], // 样本类型列表
+        ExportSampleTypeList: [], // 导出的样本类型列表
         StartDate: '', // 开始时期
         EndDate: '', // 结束时期
         CreateOn: [],
@@ -636,15 +657,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 != ''){
@@ -874,7 +902,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({
@@ -883,7 +914,10 @@
             })
             return
           }
-          _this.exportsamples('exportpage')
+          this.getSampleTypeList(null)
+          this.exportType = 'exportpage'
+          this.sampleExportVisible = true
+          // _this.exportsamples('exportpage')
         } else if (command == 'exportall') { // 导出所有数据
           _this.$confirm('此操作将导出所有满足条件的数据!是否继续导出?', '提示', {
             confirmButtonText: '确定',
@@ -894,6 +928,44 @@
           }).catch(() => {})
         }
       },
+      // 获取当前选择样本的类型
+      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 (val) {
         let _this = this
         _this.exportloading = true
@@ -1328,6 +1400,7 @@
         this.SampleType = ''
         this.STNoteField = ''
         this.Stnotevalue = ''
+        this.exportType = ''
 
         this.Validity = []
         this.currentPage = 1