Browse Source

蜜蜂所样本来源导出按钮、分页查询默认条数、默认样本日期等功能

jianglw 4 years ago
parent
commit
b6784b9bbc

+ 1 - 1
src/dashoo.cn/frontend_animal/src/pages/biobank/allsearch/index.vue

@@ -322,7 +322,7 @@
         exportloading: false,
         currentItemCount: 0, // 当前页显示数量
         currentPage: 1, // 当前页
-        size: 10, // 每页显示数量
+        size: 200, // 每页显示数量
         list: [], // table显示数据集
         showquerydiv: false,
         Id: 0, // ID

+ 1 - 1
src/dashoo.cn/frontend_animal/src/pages/biobank/partner/index.vue

@@ -191,7 +191,7 @@
         currentItemCount2: 0,
         currentItemCount3: 0,
         currentPage: 1,
-        size: 10,
+        size: 200,
         rolesettitle: '',
         rolesetVisible: false,
         roleCheckAll: false,

+ 2 - 2
src/dashoo.cn/frontend_animal/src/pages/biobank/sampleCK/index.vue

@@ -157,7 +157,7 @@
     data() {
       return {
         dialogVisible: false,
-        size: 10,
+        size: 200,
         currentItemCount: 0,
         currentPage: 1,
         downloading: '',
@@ -172,7 +172,7 @@
           ConUserBy: '', //负责人
           ConUserId: ''
         },
-        EntryTime: [new Date(new Date().getTime() - 30 * 24 * 60 * 60 * 1000), new Date()], // 签订日期
+        EntryTime: [], // 签订日期 new Date(new Date().getTime() - 30 * 24 * 60 * 60 * 1000), new Date()
         userlist: [],
         clearable: false,
         CKList: [], //入库列表

+ 2 - 2
src/dashoo.cn/frontend_animal/src/pages/biobank/sampleRK/index.vue

@@ -151,7 +151,7 @@
     data() {
       return {
         dialogVisible: false,
-        size: 10,
+        size: 200,
         currentItemCount: 0,
         currentPage: 1,
         downloading: '',
@@ -165,7 +165,7 @@
           ConUserBy: '', //负责人
           ConUserId: ''
         },
-        EntryTime: [new Date(new Date().getTime() - 30 * 24 * 60 * 60 * 1000), new Date()], // 签订日期
+        EntryTime: [], // 签订日期 new Date(new Date().getTime() - 30 * 24 * 60 * 60 * 1000), new Date()
         userlist: [],
         clearable: false,
         RKList: [], //入库列表

+ 17 - 3
src/dashoo.cn/frontend_animal/src/pages/biobank/source/_opera/operationb.vue

@@ -66,7 +66,7 @@
                 <el-input v-model="samplesForm.InnerNo" placeholder="请输入来源内码" style="width: 100%" :disabled="samplesForm.AuditorStatus != 0 || !author_flag"></el-input>
               </el-form-item>
             </el-col>
-            
+
             <!-- <el-col :span="8">
               <el-form-item label="样本来源">
                 <el-select ref="refplace" v-model="samplesForm.SourceType" style="width:100%" placeholder="请选择样本来源">
@@ -128,7 +128,7 @@
             </el-col>
             <el-col :span="8">
               <el-form-item label="采样日期" prop="SurveyDate">
-                <el-date-picker v-model="samplesForm.SurveyDate" type="date" style="width:100%" placeholder="选择日期" :disabled="samplesForm.AuditorStatus != 0 || !author_flag">
+                <el-date-picker v-model="samplesForm.SurveyDate" format="yyyy-MM-dd" type="date" style="width:100%" placeholder="选择日期" :disabled="samplesForm.AuditorStatus != 0 || !author_flag">
                 </el-date-picker>
               </el-form-item>
             </el-col>
@@ -278,7 +278,7 @@
           Longitude: '',
           Latitude: '',
           Altitude: '',
-          SurveyDate: new Date(),
+          // SurveyDate: '',
           ProjectId: '',
           ProjectName: '',
           AuditorId: '',
@@ -363,17 +363,31 @@
       _this.getAnimalInfo()
     },
     methods: {
+      thisdate () {
+        console.log('date', this.samplesForm.SurveyDate)
+      },
       getAnimalInfo () {
         let _this = this
         _this.$axios.get('/samplessource/getanimalinfo/', {})
           .then(res => {
             _this.samplesForm = res.data.items
+            if (this.pagetitle = '添加样本来源') {
+              _this.samplesForm.SurveyDate = new Date()
+            }
             _this.author_flag = true
           })
           .catch(err => {
             console.error(err)
           })
       },
+      dateFormat (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
+      },
       savedata () {
         if (this.pid == 'addsource' || this.pid <= '0') {
           if (this.samplesForm.InnerNo != '') {

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

@@ -10,6 +10,16 @@
           <el-breadcrumb-item :to="{ path: '/biobank/source' }">样本来源</el-breadcrumb-item>
         </el-breadcrumb>
         <span style="float: right;">
+          <el-dropdown split-button type="primary" size="mini" style="margin-left:10px; margin-top: -4px;"
+                       @command="handleExportsamplesCommand">
+            导出
+            <el-dropdown-menu slot="dropdown">
+              <el-dropdown-item style="color:black;" command="exportchosen">导出所选样本源</el-dropdown-item>
+              <el-dropdown-item style="color:black;" command="exportpage">导出当前页样本源</el-dropdown-item>
+              <el-dropdown-item style="color:black;" command="exportall">导出所有样本源</el-dropdown-item>
+               <el-dropdown-item style="color:black;" command="exportassociation">导出关联的样本</el-dropdown-item>
+            </el-dropdown-menu>
+          </el-dropdown>
           <router-link :to="'/biobank/source/addsource/operationb'">
             <el-button type="primary" size="mini" style="margin-left:10px; margin-top: -4px;">添加</el-button>
           </router-link>
@@ -25,7 +35,7 @@
           </el-form-item>
           <el-form-item label="创建日期">
             <el-date-picker size="mini" style="width: 220px" v-model="CreateOn" type="daterange" range-separator="至"
-              start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
+                            start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
           </el-form-item>
           <el-form-item>
             <el-dropdown split-button type="primary" size="mini" @click="seachdata" @command="searchCommand">
@@ -39,15 +49,21 @@
         </el-form>
       </div>
 
-      <el-table :data="donorsList" border style="width: 100%" height="calc(100vh - 230px)" @sort-change="orderby">
-        <el-table-column label="操作" width="80" align="center" fixed>
+      <el-table ref="tableData" :data="donorsList" border style="width: 100%" height="calc(100vh - 230px)"
+                @selection-change="handleSelectionChange" @sort-change="orderby">
+        <el-table-column type="selection" width="55"></el-table-column>
+        <el-table-column label="操作" width="100" align="center" fixed>
           <template slot-scope="scope">
             <router-link
               :to="'/biobank/source/'+scope.row.Id+'/operationb?pname=biobank-source-animal&size='+size+'&currentPage='+currentPage">
               <el-button type="text" title="编辑" size="small" icon="el-icon-edit"></el-button>
             </router-link>
+            <span
+              @click="handlePush(scope.row.Name)">
+              <el-button type="text" title="查看关联样本" size="small" icon="el-icon-link"></el-button>
+            </span>
             <el-button size="small" type="text" icon="el-icon-delete" style="margin-left:3px;" title="删除"
-              @click="delSamplesSource(scope.row)"></el-button>
+                       @click="delSamplesSource(scope.row)"></el-button>
             <router-link :to="'/biobank/source/'+ scope.row.Id + '/sourcedetail'">
               <el-button size="small" title="详情" type="text" style="margin-left:3px;">
                 <i class="icon icon-eye"></i>
@@ -86,8 +102,8 @@
         </el-table-column>
       </el-table>
       <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage"
-        :page-sizes="[10, 100, 200, 500]" :page-size="size" layout="total, sizes, prev, pager, next, jumper"
-        :total="currentItemCount">
+                     :page-sizes="[10, 100, 200, 500]" :page-size="size" layout="total, sizes, prev, pager, next, jumper"
+                     :total="currentItemCount">
       </el-pagination>
     </el-card>
     <el-dialog title="高级查询" :visible.sync="dialogVisible" width="700px">
@@ -114,7 +130,7 @@
           <el-col :span="12">
             <el-form-item label="蜂种">
               <el-select ref="reftube" v-model="searchform.Genus" placeholder="请选择蜂种" style="width:100%" size="mini"
-                filterable>
+                         filterable>
                 <el-option v-for="item in genuslist" :label="item.Value" :value="item.Value" :key="item.Key">
                 </el-option>
               </el-select>
@@ -128,13 +144,13 @@
           <el-col :span="12">
             <el-form-item label="采样日期">
               <el-date-picker size="mini" style="width: 240px" v-model="SurveyDate" type="daterange" range-separator="至"
-                start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
+                              start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
             </el-form-item>
           </el-col>
           <el-col :span="12">
             <el-form-item label="项目属性">
               <el-select ref="refProject" v-model="searchform.ProjectName" size="mini" style="width: 240px"
-                placeholder="请选择项目属性">
+                         placeholder="请选择项目属性">
                 <el-option v-for="item in projectlist" :label="item.Value" :value="item.Value" :key="item.Value">
                 </el-option>
               </el-select>
@@ -143,7 +159,7 @@
           <el-col :span="12">
             <el-form-item label="审核状态">
               <el-select ref="refplace" v-model="searchform.AuditorStatus" size="mini" style="width: 240px"
-                placeholder="请选择样本来源">
+                         placeholder="请选择样本来源">
                 <el-option label="未审核" value="0"></el-option>
                 <el-option label="审核成功" value="1"></el-option>
                 <el-option label="审核失败" value="2"></el-option>
@@ -172,7 +188,7 @@
 
     <el-dialog title="样本批量导入" :visible.sync="importVisible">
       <el-upload :action="filehost + '/api/uploads/exportanimal'" :show-file-list="false" :data="importfileparam"
-        :on-success="handleexportfileSuccess" :before-upload="beforeexportfileUpload">
+                 :on-success="handleexportfileSuccess" :before-upload="beforeexportfileUpload">
         <el-button size="mini" type="primary">点击上传导入文件</el-button> <span>{{importmsg}}</span>
         <div slot="tip" class="el-upload__tip">只能上传由导入模板录入的xlsx文件,其中模板中带星号(*)的为必填项,不填写将会被忽略</div>
       </el-upload>
@@ -184,185 +200,167 @@
   </div>
 </template>
 <script>
-  import {
-    mapGetters
-  } from 'vuex'
-  export default {
+import {
+  mapGetters
+} from 'vuex'
+export default {
 
-    computed: {
-      ...mapGetters({
-        authUser: 'authUser'
-      })
+  computed: {
+    ...mapGetters({
+      authUser: 'authUser'
+    })
+  },
+  name: 'samplessource',
+  data () {
+    return {
+      filehost: '',
+      importfileparam: {}, // 导入文件参数
+      importfilepath: '', // 导入文件路径
+      importVisible: false, // 导入对话框
+      importmsg: '未选择文件', // 导入文件
+      dialogVisible: false,
+      classificationlist: [],
+      multipleSelection: [],
+      list: [], // table显示数据集
+      exportloading: false,
+      searchform: {
+        GenusId: '',
+        Genus: '',
+        Address: '',
+        InnerNo: '',
+        CreateOn: '',
+        Name: '',
+        Weight: '',
+        SourceType: '',
+        currentPage: '',
+        size: '',
+        ProjectName: '',
+        AuditorStatus: '',
+        AuditorName: '',
+        Tive: '',
+        remark: '',
+        starttime: null,
+        endtime: null
+      },
+      SurveyDate: [], // 采样日期
+      CreateOn: [],
+      currentItemCount: 0,
+      currentPage: 1,
+      size: 200,
+      donorsList: [],
+      // 列表排序
+      Column: {
+        Order: '',
+        Prop: ''
+      },
+      acceptUsers: [],
+      userlist: [],
+      genuslist: [],
+      projectlist: []
+    }
+  },
+  created () {
+    if (this.$route.query.size && this.$route.query.currentPage) {
+      this.size = parseInt(this.$route.query.size)
+      this.currentPage = parseInt(this.$route.query.currentPage)
+    }
+    this.filehost = process.env.imgserverhost
+    this.initdata()
+    this.getAnimalGenus()
+    this.getProjectlist()
+    this.importfileparam = {
+      accode: this.authUser.Profile.AccCode
+    }
+  },
+  methods: {
+    // 接收时this.$route.query.SourceName
+    handlePush (name) {
+      this.$router.push(
+        {path: '/samples/stored',
+          query: {name: name}
+        }
+      )
     },
-    name: 'samplessource',
-    data () {
-      return {
-        filehost: '',
-        importfileparam: {}, // 导入文件参数
-        importfilepath: '', // 导入文件路径
-        importVisible: false, // 导入对话框
-        importmsg: '未选择文件', // 导入文件
-        dialogVisible: false,
-        classificationlist: [],
-        searchform: {
-          GenusId: '',
-          Genus: '',
-          Address: '',
-          InnerNo: '',
-          Name: '',
-          Weight: '',
-          SourceType: '',
-          ProjectName: '',
-          AuditorStatus: '',
-          AuditorName: '',
-          Tive: '',
-          remark: '',
-          starttime: null,
-          endtime: null
-        },
-        SurveyDate: [], // 采样日期
-        CreateOn: [new Date(new Date().getTime() - 3 * 30 * 24 * 60 * 60 * 1000), new Date()],
-        currentItemCount: 0,
-        currentPage: 1,
-        size: 10,
-        donorsList: [],
-        // 列表排序
-        Column: {
-          Order: '',
-          Prop: ''
-        },
-        acceptUsers: [],
-        userlist: [],
-        genuslist: [],
-        projectlist: []
+    initdata () {
+      let _this = this
+      let SurveyDate = []
+      if (!_this.SurveyDate) {
+        _this.SurveyDate = []
       }
-    },
-    created () {
-      if (this.$route.query.size && this.$route.query.currentPage) {
-        this.size = parseInt(this.$route.query.size)
-        this.currentPage = parseInt(this.$route.query.currentPage)
+      if (_this.SurveyDate.length == 2) {
+        _this.SurveyDate[1].setHours(23)
+        _this.SurveyDate[1].setMinutes(59)
+        _this.SurveyDate[1].setSeconds(59)
+        SurveyDate.push(_this.formatDateTime(_this.SurveyDate[0]))
+        SurveyDate.push(_this.formatDateTime(_this.SurveyDate[1]))
       }
-      this.filehost = process.env.imgserverhost
-      this.initdata()
-      this.getAnimalGenus()
-      this.getProjectlist()
-      this.importfileparam = {
-        accode: this.authUser.Profile.AccCode
+      let CreateOn = []
+      if (_this.CreateOn != null) {
+        if (_this.CreateOn.length == 2) {
+          _this.CreateOn[1].setHours(23)
+          _this.CreateOn[1].setMinutes(59)
+          _this.CreateOn[1].setSeconds(59)
+          CreateOn.push(_this.formatDateTime(_this.CreateOn[0]))
+          CreateOn.push(_this.formatDateTime(_this.CreateOn[1]))
+        }
+      }
+
+      const params = {
+        _currentPage: this.currentPage,
+        _size: this.size,
+        Order: this.Column.Order,
+        Prop: this.Column.Prop
       }
+      Object.assign(params, _this.searchform)
+      _this.$axios.get('/samplessource/animallist?SurveyDate=' + SurveyDate.join(',') + '&CreateOn=' +
+        CreateOn.join(','), {
+        params
+      })
+        .then(res => {
+          _this.donorsList = res.data.items
+          _this.currentItemCount = res.data.currentItemCount
+        })
+        .catch(err => {
+          console.error(err)
+        })
     },
-    methods: {
-      initdata () {
-        let _this = this
-        let SurveyDate = []
-        if (!_this.SurveyDate) {
-          _this.SurveyDate = []
-        }
-        if (_this.SurveyDate.length == 2) {
-          _this.SurveyDate[1].setHours(23)
-          _this.SurveyDate[1].setMinutes(59)
-          _this.SurveyDate[1].setSeconds(59)
-          SurveyDate.push(_this.formatDateTime(_this.SurveyDate[0]))
-          SurveyDate.push(_this.formatDateTime(_this.SurveyDate[1]))
-        }
-        let CreateOn = []
-        if (_this.CreateOn != null) {
-          if (_this.CreateOn.length == 2) {
-            _this.CreateOn[1].setHours(23)
-            _this.CreateOn[1].setMinutes(59)
-            _this.CreateOn[1].setSeconds(59)
-            CreateOn.push(_this.formatDateTime(_this.CreateOn[0]))
-            CreateOn.push(_this.formatDateTime(_this.CreateOn[1]))
-          }
-        }
-        
-        const params = {
-          _currentPage: this.currentPage,
-          _size: this.size,
-          Order: this.Column.Order,
-          Prop: this.Column.Prop
-        }
-        Object.assign(params, _this.searchform)
-        _this.$axios.get('/samplessource/animallist?SurveyDate=' + SurveyDate.join(',') + '&CreateOn=' +
-            CreateOn.join(','), {
-          params
+    getaddress (val) {
+      let address = val.ProvinceName + val.CityName + val.StreetName + val.Address
+      return address
+    },
+    getAnimalGenus () {
+      // 获取种属
+      let _this = this
+      _this.$axios.get('/items/worditem?code=AnimalGenus', {})
+        .then(res => {
+          _this.genuslist = res.data
         })
+    },
+    // 获取项目属性
+    getProjectlist () {
+      let _this = this
+      _this.$axios.get('/items/worditem?code=ProjectName', {})
+        .then(res => {
+          _this.projectlist = res.data
+        })
+    },
+    delSamplesSource (val) {
+      let _this = this
+      _this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        _this.$axios.delete('samplessource/delbioinfo/' + val.Id + '?GenusId=' + val.GenusId, null)
           .then(res => {
-            _this.donorsList = res.data.items
-            _this.currentItemCount = res.data.currentItemCount
-          })
-          .catch(err => {
-            console.error(err)
-          })
-      },
-      getaddress (val) {
-        let address = val.ProvinceName + val.CityName + val.StreetName + val.Address
-        return address
-      },
-      getAnimalGenus () {
-        // 获取种属
-        let _this = this
-        _this.$axios.get('/items/worditem?code=AnimalGenus', {})
-          .then(res => {
-            _this.genuslist = res.data
-          })
-      },
-      // 获取项目属性
-      getProjectlist () {
-        let _this = this
-        _this.$axios.get('/items/worditem?code=ProjectName', {})
-          .then(res => {
-            _this.projectlist = res.data
-          })
-      },
-      delSamplesSource (val) {
-        let _this = this
-        _this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
-          confirmButtonText: '确定',
-          cancelButtonText: '取消',
-          type: 'warning'
-        }).then(() => {
-          _this.$axios.delete('samplessource/delbioinfo/' + val.Id + '?GenusId=' + val.GenusId, null)
-            .then(res => {
-              // response
-              if (res.data.code === 0) {
-                _this.$message({
-                  type: 'success',
-                  message: res.data.message
-                })
-                // 更新界面
-                _this.initdata()
-              } else {
-                _this.$message({
-                  type: 'warning',
-                  message: res.data.message
-                })
-              }
-            })
-            .catch(() => {})
-        }).catch(() => {})
-      },
-      // 导入蜜蜂样本来源
-      importData () {
-        let _this = this
-        if (_this.importfilepath === '') {
-          _this.$message({
-            type: 'warning',
-            message: '请先上传导入文件!'
-          })
-          return
-        }
-        _this.$axios.put('/samplessource/exceltosave?path=' + this.importfilepath, {})
-          .then(res => {
+            // response
             if (res.data.code === 0) {
               _this.$message({
                 type: 'success',
                 message: res.data.message
               })
-              _this.importVisible = false
-              _this.importfilepath = ''
-              _this.importmsg = '未选择文件'
               // 更新界面
-              _this.initData()
+              _this.initdata()
             } else {
               _this.$message({
                 type: 'warning',
@@ -370,117 +368,277 @@
               })
             }
           })
-          .catch(err => {
-            console.error(err)
+          .catch(() => {})
+      }).catch(() => {})
+    },
+    // 导入蜜蜂样本来源
+    importData () {
+      let _this = this
+      if (_this.importfilepath === '') {
+        _this.$message({
+          type: 'warning',
+          message: '请先上传导入文件!'
+        })
+        return
+      }
+      _this.$axios.put('/samplessource/exceltosave?path=' + this.importfilepath, {})
+        .then(res => {
+          if (res.data.code === 0) {
+            _this.$message({
+              type: 'success',
+              message: res.data.message
+            })
+            _this.importVisible = false
+            _this.importfilepath = ''
+            _this.importmsg = '未选择文件'
+            // 更新界面
+            _this.initData()
+          } else {
+            _this.$message({
+              type: 'warning',
+              message: res.data.message
+            })
+          }
+        })
+        .catch(err => {
+          console.error(err)
+        })
+    },
+    handleexportfileSuccess (res, file) {
+      this.importfilepath = res
+    },
+    beforeexportfileUpload (file) {
+      let i = file.name.lastIndexOf('.')
+      let typename = ''
+      if (i > -1) {
+        typename = file.name.substring(i)
+      }
+      let istype = (typename === '.xlsx')
+      let isLt50k = file.size / 1024 / 1024 / 2 < 1
+      if (!istype) {
+        this.$message.error('上传导入文件只能是 xlsx 格式!')
+        return false
+      }
+      if (!isLt50k) {
+        this.$message.error('上传导入文件大小不能超过 2M!')
+        return false
+      }
+      this.importmsg = '上传文件:' + file.name
+      return true
+    },
+
+    // 列表排序功能
+    orderby (column) {
+      if (column.order == 'ascending') {
+        this.Column.Order = 'asc'
+      } else if (column.order == 'descending') {
+        this.Column.Order = 'desc'
+      }
+      this.Column.Prop = column.prop
+      this.initdata()
+    },
+    seachdata () {
+      this.currentPage = 1
+      this.initdata()
+    },
+    searchCommand (command) {
+      if (command == 'search') {
+        this.dialogVisible = true
+      } else if (command == 'clear') {
+        this.clearSearch()
+      }
+    },
+    clearSearch () {
+      this.searchform.GenusId = ''
+      this.searchform.Genus = ''
+      this.searchform.Address = ''
+      this.searchform.InnerNo = ''
+      this.searchform.SourceType = ''
+      this.searchform.ProjectName = ''
+      this.searchform.Name = ''
+      this.searchform.AuditorStatus = ''
+      this.searchform.AuditorName = ''
+      this.Name = ''
+      this.InnerNo = ''
+      this.CreateOn = []
+      this.SurveyDate = []
+      this.initdata()
+    },
+    handleSizeChange (value) {
+      this.size = value
+      this.currentPage = 1
+      this.initdata()
+    },
+    handleCurrentChange (value) {
+      this.currentPage = value
+      this.initdata()
+    },
+    formatDateTime (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
+      var h = date.getHours()
+      var minute = date.getMinutes()
+      minute = minute < 10 ? ('0' + minute) : minute
+      return y + '-' + m + '-' + d + ' ' + h + ':' + minute
+    },
+    // 导出样本
+    handleExportsamplesCommand (command) {
+      let _this = this
+      console.log(_this.$refs.tableData)
+      if (command === 'exportchosen') { // 导出所选数据
+        if (_this.$refs.tableData.selection.length < 1) {
+          _this.$message({
+            type: 'warning',
+            message: '请选择要导出的样本'
           })
-      },
-      handleexportfileSuccess (res, file) {
-        this.importfilepath = res
-      },
-      beforeexportfileUpload (file) {
-        let i = file.name.lastIndexOf('.')
-        let typename = ''
-        if (i > -1) {
-          typename = file.name.substring(i)
-        }
-        let istype = (typename === '.xlsx')
-        let isLt50k = file.size / 1024 / 1024 / 2 < 1
-        if (!istype) {
-          this.$message.error('上传导入文件只能是 xlsx 格式!')
-          return false
+          return
         }
-        if (!isLt50k) {
-          this.$message.error('上传导入文件大小不能超过 2M!')
-          return false
+        _this.exportsamples('exportchosen')
+      } else if (command === 'exportpage') { // 导出当前页数据
+        if (_this.$refs.tableData.data.length < 1) {
+          _this.$message({
+            type: 'warning',
+            message: '当前页无样本'
+          })
+          return
         }
-        this.importmsg = '上传文件:' + file.name
-        return true
-      },
+        _this.exportsamples('exportpage')
+      } else if (command === 'exportall') { // 导出所有数据
+        _this.$confirm('此操作将导出所有满足条件的数据!是否继续导出?', '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'info'
+        }).then(() => {
+          _this.exportsamples()
+        }).catch(() => {
+        })
+      } else if (command === 'exporassociation') {
 
-      // 列表排序功能
-      orderby (column) {
-        if (column.order == 'ascending') {
-          this.Column.Order = 'asc'
-        } else if (column.order == 'descending') {
-          this.Column.Order = 'desc'
+      }
+    },
+    exportsamples (val) {
+      let _this = this
+      _this.exportloading = true
+      // 显示列
+      let showcolumnarr = []
+      let showcolumnnamearr = []
+      let id = ''
+      /* for (var i = 0; i < _this.showcolumn.length; i++) {
+        if (_this.showcolumn[i].show) {
+          showcolumnarr.push(_this.showcolumn[i].filed)
+          showcolumnnamearr.push(_this.showcolumn[i].name.replace(/,/g, ','))
         }
-        this.Column.Prop = column.prop
-        this.initdata()
-      },
-      seachdata () {
-        this.currentPage = 1
-        this.initdata()
-      },
-      searchCommand (command) {
-        if (command == 'search') {
-          this.dialogVisible = true
-        } else if (command == 'clear') {
-          this.clearSearch()
+      } */
+      let params = {
+        _currentPage: this.currentPage,
+        _size: this.size,
+        GenusId: this.GenusId,
+        Genus: this.Genus,
+        Address: this.Address,
+        InnerNo: this.InnerNo,
+        CreateOn: this.CreateOn,
+        SourceType: this.SourceType,
+        ProjectName: this.ProjectName,
+        Name: this.Name,
+        AuditorStatus: this.AuditorStatus,
+        AuditorName: this.AuditorName,
+        showcolumnarr: showcolumnarr + '',
+        showcolumnnamearr: showcolumnnamearr + '',
+        ExportFlag: 'stored'
+      }
+      /*    if (this.CreateOn && this.CreateOn.length === 2) {
+        let params2 = {
+          CreateOnstart: this.CreateOn[0] / 1000,
+          CreateOnend: this.CreateOn[1] / 1000
         }
-      },
-      clearSearch () {
-        this.searchform.GenusId = ''
-        this.searchform.Genus = ''
-        this.searchform.Address = ''
-        this.searchform.InnerNo = ''
-        this.searchform.SourceType = ''
-        this.searchform.ProjectName = ''
-        this.searchform.Name = ''
-        this.searchform.AuditorStatus = ''
-        this.searchform.AuditorName = ''
-        this.SurveyDate = []
-        this.CreateOn = []
-        this.initdata()
-      },
-      handleSizeChange (value) {
-        this.size = value
-        this.currentPage = 1
-        this.initdata()
-      },
-      handleCurrentChange (value) {
-        this.currentPage = value
-        this.initdata()
-      },
-      formatDateTime (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
-        var h = date.getHours()
-        var minute = date.getMinutes()
-        minute = minute < 10 ? ('0' + minute) : minute
-        return y + '-' + m + '-' + d + ' ' + h + ':' + minute
-      },
-      jstimehandle (val) {
-        if (val === '') {
-          return '----'
-        } else if (val === '0001-01-01T08:00:00+08:00') {
-          return '----'
-        } else if (val === '5000-01-01T23:59:59+08:00') {
-          return '永久'
-        } else {
-          val = val.replace('T', ' ')
-          return val.substring(0, 10)
+        params = Object.assign(params, params2)
+      }
+      if (_this.Validity && _this.Validity.length === 2) {
+        let params3 = {
+          Validitystart: _this.Validity[0] / 1000,
+          Validityend: _this.Validity[1] / 1000
+        }
+        params = Object.assign(params, params3)
+      } */
+      // 导出所选样本
+      if (val === 'exportchosen') {
+        for (var i = 0; i < _this.$refs.tableData.selection.length; i++) {
+          if (i === _this.$refs.tableData.selection.length - 1) {
+            id += _this.$refs.tableData.selection[i].Id
+          } else {
+            id += _this.$refs.tableData.selection[i].Id + ','
+          }
+        }
+        let paramsid = {
+          Id: id
         }
+        params = Object.assign(params, paramsid)
       }
+      // 导出当前页样本
+      if (val === 'exportpage') {
+        for (var i = 0; i < _this.$refs.tableData.data.length; i++) {
+          if (i === _this.$refs.tableData.data.length - 1) {
+            id += _this.$refs.tableData.data[i].Id
+          } else {
+            id += _this.$refs.tableData.data[i].Id + ','
+          }
+        }
+        let paramsid = {
+          Id: id
+        }
+        params = Object.assign(params, paramsid)
+      }
+      console.log(1)
+
+      _this.$axios.get('/samplesource/exportexcel', {
+        params
+      })
+        .then(res => {
+          _this.exportloading = false
+          window.location = 'http://' + res.data
+        })
+        .catch(err => {
+          _this.exportloading = false
+          // handle error
+          console.error(err)
+        })
+    },
+    jstimehandle (val) {
+      if (val === '') {
+        return '----'
+      } else if (val === '0001-01-01T08:00:00+08:00') {
+        return '----'
+      } else if (val === '5000-01-01T23:59:59+08:00') {
+        return '永久'
+      } else {
+        val = val.replace('T', ' ')
+        return val.substring(0, 10)
+      }
+    },
+    handleSelectionChange (val) {
+      this.multipleSelection = val
+      console.log('this.multipleSelection', this.multipleSelection)
     }
   }
+}
 </script>
 
 <style lang="scss">
-  .el-pagination {
-    margin: 1rem 0 2rem;
-    text-align: right;
-  }
+.el-pagination {
+  margin: 1rem 0 2rem;
+  text-align: right;
+}
 
-  .plab {
-    font-size: 13px;
-    color: #999;
-  }
+.plab {
+  font-size: 13px;
+  color: #999;
+}
 
-  .daiyunscss {
-    cursor: pointer;
-  }
+.daiyunscss {
+  cursor: pointer;
+}
 
 </style>

+ 1 - 1
src/dashoo.cn/frontend_animal/src/pages/biobank/sourcextends/index.vue

@@ -75,7 +75,7 @@
         keyword: '',
         currentItemCount: 0,
         currentPage: 1,
-        size: 10,
+        size: 200,
         list: [],
         //列表排序
         Column: {

+ 1 - 1
src/dashoo.cn/frontend_animal/src/pages/login.vue

@@ -219,7 +219,7 @@
   .footer {
     min-width: 1100px;
     width: 100%;
-    
+
   }
 
   .footer a {

+ 1 - 1
src/dashoo.cn/frontend_animal/src/pages/projectmanage/_opera/detail.vue

@@ -113,7 +113,7 @@
 <script>
   export default {
     name: 'projectdetail',
-    data() {
+    data () {
       return {
         list: [{
             BarCode: 'xq11111-1',

+ 360 - 355
src/dashoo.cn/frontend_animal/src/pages/report/samples/samplesstoredbydate.vue

@@ -10,7 +10,8 @@
           <el-breadcrumb-item :to="{ path: '/report/samplesstored' }">样本-已存储</el-breadcrumb-item>
         </el-breadcrumb>
         <span style="float: right;">
-          <el-button size="mini" type="primary" style="margin-left:10px; margin-top: -4px;" @click="handleExportsamplesCommand('exportall')">
+          <el-button size="mini" type="primary" style="margin-left:10px; margin-top: -4px;"
+                     @click="handleExportsamplesCommand('exportall')">
             导出
           </el-button>
         </span>
@@ -43,26 +44,29 @@
         </el-table-column>
         <el-table-column prop="ReceiveDate" sortable mini-width="240" label="接收日期" align="center" show-overflow-tooltip>
           <template slot-scope="scope">
-            {{ jstimehandle(scope.row.ReceiveDate+'') }}
+            {{ jstimehandle(scope.row.ReceiveDate + '') }}
           </template>
         </el-table-column>
         <el-table-column prop="ValidityDate" sortable mini-width="240" label="有效日期" align="center"
-          show-overflow-tooltip>
+                         show-overflow-tooltip>
           <template slot-scope="scope">
-            {{ jstimehandle(scope.row.ValidityDate+'') }}
+            {{ jstimehandle(scope.row.ValidityDate + '') }}
           </template>
         </el-table-column>
         <el-table-column label=" 录入人" prop="CreateBy" align="center"></el-table-column>
         <el-table-column label=" 容器名称" prop="EName" align="center"></el-table-column>
         <el-table-column label=" 存储位置" prop="Location" align="center">
           <template slot-scope="scope">
-            {{scope.row.ECode}}-{{numtoupchar(scope.row.ShelfY)}}{{scope.row.ShelfX}}-{{numtoupchar(scope.row.BoxY)}}{{scope.row.BoxX}}-{{postiontoupchar(scope.row.Position)}}
+            {{ scope.row.ECode }}-{{ numtoupchar(scope.row.ShelfY) }}{{
+              scope.row.ShelfX
+            }}-{{ numtoupchar(scope.row.BoxY) }}{{ scope.row.BoxX }}-{{ postiontoupchar(scope.row.Position) }}
           </template>
         </el-table-column>
         <!-- <el-table-column label=" 所属分组" prop="GroupName" align="center"></el-table-column> -->
       </el-table>
       <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage"
-        :page-sizes="[10, 100, 200, 500]" :page-size="size" layout="total, sizes, prev, pager, next, jumper" :total="currentItemCount">
+                     :page-sizes="[10, 100, 200, 500]" :page-size="size"
+                     layout="total, sizes, prev, pager, next, jumper" :total="currentItemCount">
       </el-pagination>
     </el-card>
 
@@ -71,12 +75,13 @@
         <el-row>
           <el-col :span="24">
             <el-form-item label-width="80px" label="创建日期">
-              <el-date-picker v-model="CreateDate" type="daterange" unlink-panels range-separator="至" start-placeholder="开始日期"
-                end-placeholder="结束日期" style="width:100%"></el-date-picker>
+              <el-date-picker v-model="CreateDate" type="daterange" unlink-panels range-separator="至"
+                              start-placeholder="开始日期"
+                              end-placeholder="结束日期" style="width:100%"></el-date-picker>
             </el-form-item>
           </el-col>
           <span style="float: right;margin-top:-10px;">
-            <el-button size="small" @click="balanceShow = false">取 消</el-button>
+            <el-button size="small" @click="dialogTableVisible = false">取 消</el-button>
             <el-button type="primary" size="small" @click="initData()">确 定</el-button>
           </span>
         </el-row>
@@ -89,7 +94,7 @@
           <el-col :span="12">
             <el-form-item label="创建日期">
               <el-date-picker size="mini" v-model="CreateDate" type="daterange" unlink-panels range-separator="至"
-                start-placeholder="开始日期" end-placeholder="结束日期" style="width:100%"></el-date-picker>
+                              start-placeholder="开始日期" end-placeholder="结束日期" style="width:100%"></el-date-picker>
             </el-form-item>
           </el-col>
           <el-col :span="12">
@@ -108,7 +113,7 @@
           <el-col :span="12">
             <el-form-item prop="SampleType" label="样本类型">
               <el-select size="mini" ref="selectsampletype" v-model="searchform.SampleTypeId" placeholder="请选择样本类型"
-                style="width: 100%">
+                         style="width: 100%">
                 <el-option v-for="item in sampletypelist" :key="item.Id" :label="item.Name" :value="item.Id">
                 </el-option>
               </el-select>
@@ -125,375 +130,375 @@
 </template>
 
 <script>
-  export default {
-    name: 'samplereport',
-    data() {
-      return {
-        dialogVisible: false,
-        dialogTableVisible: true,
-        currentItemCount: 0, // 当前页显示数量
-        currentPage: 1, // 当前页
-        size: 10, // 每页显示数量
-        searchform: {
-          Name: '',
-          SampleTypeId: '',
-          EId: ''
-        },
-        list: [],
-        equipmentlist: [],
-        sampletypelist: [],
-        CreateDate: [],
-        showcolumnselecd: [], // 选中的显示列
-        multipleSelection: [], // 多选框
-        showcolumn: [{
-            filed: 'BarCode',
-            name: '样本条码',
-            show: true,
-            kuoz: false
-          }, {
-            filed: 'SampleCode',
-            name: '样本编码',
-            show: true,
-            kuoz: false
-          }, {
-            filed: 'SourceName',
-            name: '样本来源',
-            show: true,
-            kuoz: false
-          }, {
-            filed: 'Name',
-            name: '名称',
-            show: true,
-            kuoz: false
-          }, {
-            filed: 'SampleTypeName',
-            name: '样本类型',
-            show: true,
-            kuoz: false
-          }, {
-            filed: 'Capacity',
-            name: '可用容量',
-            show: true,
-            kuoz: false
-          }, {
-            filed: 'InnerCode',
-            name: '样本内码',
-            show: true,
-            kuoz: false
-          }, {
-            filed: 'ValidityDate',
-            name: '有效日期',
-            show: true,
-            kuoz: false
-          }, {
-            filed: 'ReceiveDate',
-            name: '接收日期',
-            show: true,
-            kuoz: false
-          }, {
-            filed: 'CreateBy',
-            name: '录入人',
-            show: true,
-            kuoz: false
-          }, {
-            filed: 'Location',
-            name: '存储位置',
-            show: true,
-            kuoz: false,
-            columnwidth: 200
-          }, {
-            filed: 'EName',
-            name: '容器名称',
-            show: true,
-            kuoz: false,
-            columnwidth: 200
-          },
-          {
-            filed: 'GroupName',
-            name: '所属分组',
-            show: true,
-            kuoz: false
-          },
-          {
-            filed: 'CreateOn',
-            name: '创建日期',
-            show: true,
-            kuoz: false
-          }
-        ]
-      }
-    },
-    created() {
-      this.getequipment()
-      this.getsampletype()
-    },
-    methods: {
-      initData() {
-        let _this = this
-        let CreateDate = []
-        let params = {
-          _currentPage: this.currentPage,
-          _size: this.size
-        }
-        // 解析时间
-        if (_this.CreateDate && _this.CreateDate.length === 2) {
-          this.CreateDate[0].setHours(23)
-          this.CreateDate[0].setMinutes(59)
-          this.CreateDate[0].setSeconds(59)
-          this.CreateDate[1].setHours(23)
-          this.CreateDate[1].setMinutes(59)
-          this.CreateDate[1].setSeconds(59)
-          CreateDate.push(_this.formatDateTime(_this.CreateDate[0]))
-          CreateDate.push(_this.formatDateTime(_this.CreateDate[1]))
-        }
-        params = Object.assign(params, this.searchform)
-        this.$axios.get('reports/animalstoredlist?CreateDate=' + CreateDate, {
-            params
-          })
-          .then(res => {
-            this.list = res.data.items
-            this.currentItemCount = res.data.currentItemCount
-            this.dialogTableVisible = false
-          })
-          .catch(err => {
-            console.error(err)
-          })
+export default {
+  name: 'samplereport',
+  data () {
+    return {
+      dialogVisible: false,
+      dialogTableVisible: true,
+      currentItemCount: 0, // 当前页显示数量
+      currentPage: 1, // 当前页
+      size: 10, // 每页显示数量
+      searchform: {
+        Name: '',
+        SampleTypeId: '',
+        EId: ''
       },
-      getequipment() {
-        this.$axios.get('/equipment/elist', {})
-          .then(res => {
-            for (var i = 0; i < res.data.items.length / 2; i++) {
-              this.equipmentlist.push({
-                label: res.data.items[2 * i],
-                value: res.data.items[2 * i + 1]
-              })
-            }
-          })
-          .catch(err => {
-            // handle error
-            console.error(err)
-          })
-      },
-      getsampletype() {
-        this.$axios.get('sampletype/list', {})
-          .then(res => {
-            // response
-            this.sampletypelist = res.data.items
-          })
-          .catch(err => {
-            // handle error
-            console.error(err)
-          })
-      },
-      numtoupchar(num) {
-        return String.fromCharCode(64 + parseInt(num))
+      list: [],
+      equipmentlist: [],
+      sampletypelist: [],
+      CreateDate: [],
+      showcolumnselecd: [], // 选中的显示列
+      multipleSelection: [], // 多选框
+      showcolumn: [{
+        filed: 'BarCode',
+        name: '样本条码',
+        show: true,
+        kuoz: false
+      }, {
+        filed: 'SampleCode',
+        name: '样本编码',
+        show: true,
+        kuoz: false
+      }, {
+        filed: 'SourceName',
+        name: '样本来源',
+        show: true,
+        kuoz: false
+      }, {
+        filed: 'Name',
+        name: '名称',
+        show: true,
+        kuoz: false
+      }, {
+        filed: 'SampleTypeName',
+        name: '样本类型',
+        show: true,
+        kuoz: false
+      }, {
+        filed: 'Capacity',
+        name: '可用容量',
+        show: true,
+        kuoz: false
+      }, {
+        filed: 'InnerCode',
+        name: '样本内码',
+        show: true,
+        kuoz: false
+      }, {
+        filed: 'ValidityDate',
+        name: '有效日期',
+        show: true,
+        kuoz: false
+      }, {
+        filed: 'ReceiveDate',
+        name: '接收日期',
+        show: true,
+        kuoz: false
+      }, {
+        filed: 'CreateBy',
+        name: '录入人',
+        show: true,
+        kuoz: false
+      }, {
+        filed: 'Location',
+        name: '存储位置',
+        show: true,
+        kuoz: false,
+        columnwidth: 200
+      }, {
+        filed: 'EName',
+        name: '容器名称',
+        show: true,
+        kuoz: false,
+        columnwidth: 200
       },
-      postiontoupchar(postion) {
-        if (postion) {
-          let pos = postion.split(';')
-          if (pos.length === 2) {
-            return this.numtoupchar(pos[1]) + pos[0]
-          } else {
-            return postion
-          }
-        } else {
-          return ''
-        }
+      {
+        filed: 'GroupName',
+        name: '所属分组',
+        show: true,
+        kuoz: false
       },
-      // 导出样本
-      handleExportsamplesCommand(command) {
-        if (command === 'exportchosen') { // 导出所选数据
-          if (this.multipleSelection.length < 1) {
-            this.$message({
-              type: 'warning',
-              message: '请选择要导出的样本'
-            })
-            return
-          }
-          this.exportsamples('exportchosen')
-        } else if (command === 'exportpage') { // 导出当前页数据
-          if (this.list.length < 1) {
-            this.$message({
-              type: 'warning',
-              message: '当前页无样本'
+      {
+        filed: 'CreateOn',
+        name: '创建日期',
+        show: true,
+        kuoz: false
+      }
+      ]
+    }
+  },
+  created () {
+    this.getequipment()
+    this.getsampletype()
+  },
+  methods: {
+    initData () {
+      let _this = this
+      let CreateDate = []
+      let params = {
+        _currentPage: this.currentPage,
+        _size: this.size
+      }
+      // 解析时间
+      if (_this.CreateDate && _this.CreateDate.length === 2) {
+        this.CreateDate[0].setHours(23)
+        this.CreateDate[0].setMinutes(59)
+        this.CreateDate[0].setSeconds(59)
+        this.CreateDate[1].setHours(23)
+        this.CreateDate[1].setMinutes(59)
+        this.CreateDate[1].setSeconds(59)
+        CreateDate.push(_this.formatDateTime(_this.CreateDate[0]))
+        CreateDate.push(_this.formatDateTime(_this.CreateDate[1]))
+      }
+      params = Object.assign(params, this.searchform)
+      this.$axios.get('reports/animalstoredlist?CreateDate=' + CreateDate, {
+        params
+      })
+        .then(res => {
+          this.list = res.data.items
+          this.currentItemCount = res.data.currentItemCount
+          this.dialogTableVisible = false
+        })
+        .catch(err => {
+          console.error(err)
+        })
+    },
+    getequipment () {
+      this.$axios.get('/equipment/elist', {})
+        .then(res => {
+          for (var i = 0; i < res.data.items.length / 2; i++) {
+            this.equipmentlist.push({
+              label: res.data.items[2 * i],
+              value: res.data.items[2 * i + 1]
             })
-            return
           }
-          this.exportsamples('exportpage')
-        } else if (command === 'exportall') { // 导出所有数据
-          this.$confirm('此操作将导出所有满足条件的数据!是否继续导出?', '提示', {
-            confirmButtonText: '确定',
-            cancelButtonText: '取消',
-            type: 'info'
-          }).then(() => {
-            this.exportsamples()
-          }).catch(() => {})
+        })
+        .catch(err => {
+          // handle error
+          console.error(err)
+        })
+    },
+    getsampletype () {
+      this.$axios.get('sampletype/list', {})
+        .then(res => {
+          // response
+          this.sampletypelist = res.data.items
+        })
+        .catch(err => {
+          // handle error
+          console.error(err)
+        })
+    },
+    numtoupchar (num) {
+      return String.fromCharCode(64 + parseInt(num))
+    },
+    postiontoupchar (postion) {
+      if (postion) {
+        let pos = postion.split(';')
+        if (pos.length === 2) {
+          return this.numtoupchar(pos[1]) + pos[0]
+        } else {
+          return postion
         }
-      },
-      exportsamples(val) {
-        // 显示列
-        let showcolumnarr = []
-        let showcolumnnamearr = []
-        let id = ''
-        for (var i = 0; i < this.showcolumn.length; i++) {
-          if (this.showcolumn[i].show) {
-            showcolumnarr.push(this.showcolumn[i].filed)
-            showcolumnnamearr.push(this.showcolumn[i].name.replace(/,/g, ','))
-          }
+      } else {
+        return ''
+      }
+    },
+    // 导出样本
+    handleExportsamplesCommand (command) {
+      if (command === 'exportchosen') { // 导出所选数据
+        if (this.multipleSelection.length < 1) {
+          this.$message({
+            type: 'warning',
+            message: '请选择要导出的样本'
+          })
+          return
         }
-        // 解析时间
-        let CreateDate = []
-        if (this.CreateDate.length === 2) {
-          this.CreateDate[0].setHours(23)
-          this.CreateDate[0].setMinutes(59)
-          this.CreateDate[0].setSeconds(59)
-          this.CreateDate[1].setHours(23)
-          this.CreateDate[1].setMinutes(59)
-          this.CreateDate[1].setSeconds(59)
-          CreateDate.push(this.formatDateTime(this.CreateDate[0]))
-          CreateDate.push(this.formatDateTime(this.CreateDate[1]))
+        this.exportsamples('exportchosen')
+      } else if (command === 'exportpage') { // 导出当前页数据
+        if (this.list.length < 1) {
+          this.$message({
+            type: 'warning',
+            message: '当前页无样本'
+          })
+          return
         }
-        let params = {
-          _currentPage: this.currentPage,
-          _size: this.size,
-          showcolumnarr: showcolumnarr + '',
-          showcolumnnamearr: showcolumnnamearr + '',
-          ExportFlag: 'samplesstoredbydate'
+        this.exportsamples('exportpage')
+      } else if (command === 'exportall') { // 导出所有数据
+        this.$confirm('此操作将导出所有满足条件的数据!是否继续导出?', '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'info'
+        }).then(() => {
+          this.exportsamples()
+        }).catch(() => {
+        })
+      }
+    },
+    exportsamples (val) {
+      // 显示列
+      let showcolumnarr = []
+      let showcolumnnamearr = []
+      let id = ''
+      for (var i = 0; i < this.showcolumn.length; i++) {
+        if (this.showcolumn[i].show) {
+          showcolumnarr.push(this.showcolumn[i].filed)
+          showcolumnnamearr.push(this.showcolumn[i].name.replace(/,/g, ','))
         }
-        // 导出所选样本
-        if (val === 'exportchosen') {
-          for (let i = 0; i < this.multipleSelection.length; i++) {
-            if (i === this.multipleSelection.length - 1) {
-              id += this.multipleSelection[i].Id
-            } else {
-              id += this.multipleSelection[i].Id + ','
-            }
-          }
-          let paramsid = {
-            Id: id
+      }
+      // 解析时间
+      let CreateDate = []
+      if (this.CreateDate.length === 2) {
+        this.CreateDate[0].setHours(23)
+        this.CreateDate[0].setMinutes(59)
+        this.CreateDate[0].setSeconds(59)
+        this.CreateDate[1].setHours(23)
+        this.CreateDate[1].setMinutes(59)
+        this.CreateDate[1].setSeconds(59)
+        CreateDate.push(this.formatDateTime(this.CreateDate[0]))
+        CreateDate.push(this.formatDateTime(this.CreateDate[1]))
+      }
+      let params = {
+        _currentPage: this.currentPage,
+        _size: this.size,
+        showcolumnarr: showcolumnarr + '',
+        showcolumnnamearr: showcolumnnamearr + '',
+        ExportFlag: 'samplesstoredbydate'
+      }
+      // 导出所选样本
+      if (val === 'exportchosen') {
+        for (let i = 0; i < this.multipleSelection.length; i++) {
+          if (i === this.multipleSelection.length - 1) {
+            id += this.multipleSelection[i].Id
+          } else {
+            id += this.multipleSelection[i].Id + ','
           }
-          params = Object.assign(params, paramsid)
         }
-        // 导出当前页样本
-        if (val === 'exportpage') {
-          for (let i = 0; i < this.list.length; i++) {
-            if (i === this.list.length - 1) {
-              id += this.list[i].Id
-            } else {
-              id += this.list[i].Id + ','
-            }
-          }
-          let paramsid = {
-            Id: id
-          }
-          params = Object.assign(params, paramsid)
+        let paramsid = {
+          Id: id
         }
-        params = Object.assign(params, this.searchform)
-        console.log(params, 'params')
-        this.$axios.get('/reports/exportexcel?CreateDate=' + CreateDate, {
-            params
-          })
-          .then(res => {
-            window.location = 'http://' + res.data
-          })
-          .catch(err => {
-            // handle error
-            console.error(err)
-          })
-      },
-      handleSizeChange(value) {
-        this.size = value
-        this.currentPage = 1
-        this.initData()
-      },
-      handleCurrentChange(value) {
-        this.currentPage = value
-        this.initData()
-      },
-      jstimehandle(val) {
-        if (val === '') {
-          return '----'
-        } else if (val === '0001-01-01T08:00:00+08:00') {
-          return '----'
-        } else if (val === '5000-01-01T23:59:59+08:00') {
-          return '永久'
-        } else {
-          val = val.replace('T', ' ')
-          return val.substring(0, 10)
+        params = Object.assign(params, paramsid)
+      }
+      // 导出当前页样本
+      if (val === 'exportpage') {
+        for (let i = 0; i < this.list.length; i++) {
+          if (i === this.list.length - 1) {
+            id += this.list[i].Id
+          } else {
+            id += this.list[i].Id + ','
+          }
         }
-      },
-      formatDateTime(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;
-        var h = date.getHours();
-        var minute = date.getMinutes();
-        minute = minute < 10 ? ('0' + minute) : minute;
-        var minute = date.getMinutes();
-        minute = minute < 10 ? ('0' + minute) : minute;
-        var s = date.getSeconds()
-        s = s < 10 ? ('0' + s) : s;
-        return y + '-' + m + '-' + d + ' ' + h + ':' + minute + ':' + s;
-      },
-      searchCommand(command) {
-        if (command == 'search') {
-          this.dialogVisible = true
-        } else if (command == 'clear') {
-          this.clearSearch()
+        let paramsid = {
+          Id: id
         }
-      },
-      seachdata() {
-        this.currentPage = 1
-        this.initData()
-      },
-      clearSearch() {
-        this.searchform.Name = ''
-        this.searchform.SampleTypeId = ''
-        this.searchform.EId = ''
-        this.CreateDate = []
-        this.initData()
+        params = Object.assign(params, paramsid)
+      }
+      params = Object.assign(params, this.searchform)
+      console.log(params, 'params')
+      this.$axios.get('/reports/exportexcel?CreateDate=' + CreateDate, {
+        params
+      })
+        .then(res => {
+          window.location = 'http://' + res.data
+        })
+        .catch(err => {
+          // handle error
+          console.error(err)
+        })
+    },
+    handleSizeChange (value) {
+      this.size = value
+      this.currentPage = 1
+      this.initData()
+    },
+    handleCurrentChange (value) {
+      this.currentPage = value
+      this.initData()
+    },
+    jstimehandle (val) {
+      if (val === '') {
+        return '----'
+      } else if (val === '0001-01-01T08:00:00+08:00') {
+        return '----'
+      } else if (val === '5000-01-01T23:59:59+08:00') {
+        return '永久'
+      } else {
+        val = val.replace('T', ' ')
+        return val.substring(0, 10)
       }
+    },
+    formatDateTime (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
+      var h = date.getHours()
+      var minute = date.getMinutes()
+      minute = minute < 10 ? ('0' + minute) : minute
+      var minute = date.getMinutes()
+      minute = minute < 10 ? ('0' + minute) : minute
+      var s = date.getSeconds()
+      s = s < 10 ? ('0' + s) : s
+      return y + '-' + m + '-' + d + ' ' + h + ':' + minute + ':' + s
+    },
+    searchCommand (command) {
+      if (command == 'search') {
+        this.dialogVisible = true
+      } else if (command == 'clear') {
+        this.clearSearch()
+      }
+    },
+    seachdata () {
+      this.currentPage = 1
+      this.initData()
+    },
+    clearSearch () {
+      this.searchform.Name = ''
+      this.searchform.SampleTypeId = ''
+      this.searchform.EId = ''
+      this.CreateDate = []
+      this.initData()
     }
   }
-
+}
 </script>
 
 <style lang="scss">
-  .time {
-    font-size: 13px;
-    color: #999;
-  }
+.time {
+  font-size: 13px;
+  color: #999;
+}
 
-  .bottom {
-    margin-top: 13px;
-    line-height: 12px;
-  }
+.bottom {
+  margin-top: 13px;
+  line-height: 12px;
+}
 
-  .button {
-    padding: 0;
-    float: right;
-  }
+.button {
+  padding: 0;
+  float: right;
+}
 
-  .image {
-    width: 100%;
-    display: block;
-  }
+.image {
+  width: 100%;
+  display: block;
+}
 
-  .clearfix:before,
-  .clearfix:after {
-    display: table;
-    content: "";
-  }
+.clearfix:before,
+.clearfix:after {
+  display: table;
+  content: "";
+}
 
-  .clearfix:after {
-    clear: both
-  }
+.clearfix:after {
+  clear: both
+}
 
-  .el-pagination {
-    margin: 1rem 0 2rem;
-    text-align: right;
-  }
+.el-pagination {
+  margin: 1rem 0 2rem;
+  text-align: right;
+}
 
 </style>

+ 93 - 94
src/dashoo.cn/frontend_animal/src/pages/report/samples/samplesstoredbyequipment.vue

@@ -127,7 +127,7 @@
 <script>
   export default {
     name: 'samplereport',
-    data() {
+    data () {
       return {
         dialogVisible: false,
         dialogTableVisible: true,
@@ -146,90 +146,90 @@
         showcolumnselecd: [], // 选中的显示列
         multipleSelection: [], // 多选框
         showcolumn: [{
-            filed: 'BarCode',
-            name: '样本条码',
-            show: true,
-            kuoz: false
-          }, {
-            filed: 'SampleCode',
-            name: '样本编码',
-            show: true,
-            kuoz: false
-          }, {
-            filed: 'SourceName',
-            name: '样本来源',
-            show: true,
-            kuoz: false
-          }, {
-            filed: 'Name',
-            name: '名称',
-            show: true,
-            kuoz: false
-          }, {
-            filed: 'SampleTypeName',
-            name: '样本类型',
-            show: true,
-            kuoz: false
-          }, {
-            filed: 'Capacity',
-            name: '可用容量',
-            show: true,
-            kuoz: false
-          }, {
-            filed: 'InnerCode',
-            name: '样本内码',
-            show: true,
-            kuoz: false
-          }, {
-            filed: 'ValidityDate',
-            name: '有效日期',
-            show: true,
-            kuoz: false
-          }, {
-            filed: 'ReceiveDate',
-            name: '接收日期',
-            show: true,
-            kuoz: false
-          }, {
-            filed: 'CreateBy',
-            name: '录入人',
-            show: true,
-            kuoz: false
-          }, {
-            filed: 'Location',
-            name: '存储位置',
-            show: true,
-            kuoz: false,
-            columnwidth: 200
-          }, {
-            filed: 'EName',
-            name: '容器名称',
-            show: true,
-            kuoz: false,
-            columnwidth: 200
-          },
-          {
-            filed: 'GroupName',
-            name: '所属分组',
-            show: true,
-            kuoz: false
-          },
-          {
-            filed: 'CreateOn',
-            name: '创建日期',
-            show: true,
-            kuoz: false
-          }
+          filed: 'BarCode',
+          name: '样本条码',
+          show: true,
+          kuoz: false
+        }, {
+          filed: 'SampleCode',
+          name: '样本编码',
+          show: true,
+          kuoz: false
+        }, {
+          filed: 'SourceName',
+          name: '样本来源',
+          show: true,
+          kuoz: false
+        }, {
+          filed: 'Name',
+          name: '名称',
+          show: true,
+          kuoz: false
+        }, {
+          filed: 'SampleTypeName',
+          name: '样本类型',
+          show: true,
+          kuoz: false
+        }, {
+          filed: 'Capacity',
+          name: '可用容量',
+          show: true,
+          kuoz: false
+        }, {
+          filed: 'InnerCode',
+          name: '样本内码',
+          show: true,
+          kuoz: false
+        }, {
+          filed: 'ValidityDate',
+          name: '有效日期',
+          show: true,
+          kuoz: false
+        }, {
+          filed: 'ReceiveDate',
+          name: '接收日期',
+          show: true,
+          kuoz: false
+        }, {
+          filed: 'CreateBy',
+          name: '录入人',
+          show: true,
+          kuoz: false
+        }, {
+          filed: 'Location',
+          name: '存储位置',
+          show: true,
+          kuoz: false,
+          columnwidth: 200
+        }, {
+          filed: 'EName',
+          name: '容器名称',
+          show: true,
+          kuoz: false,
+          columnwidth: 200
+        },
+        {
+          filed: 'GroupName',
+          name: '所属分组',
+          show: true,
+          kuoz: false
+        },
+        {
+          filed: 'CreateOn',
+          name: '创建日期',
+          show: true,
+          kuoz: false
+        }
         ]
 
       }
     },
-    created() {
+    created () {
       this.getequipment()
       this.getsampletype()
     },
     methods: {
-      initData() {
+      initData () {
         let _this = this
         let CreateDate = []
         let params = {
@@ -250,8 +250,8 @@
         params = Object.assign(params, this.searchform)
         // request
         this.$axios.get('reports/animalstoredlist?CreateDate=' + CreateDate, {
-            params
-          })
+          params
+        })
           .then(res => {
             this.list = res.data.items
             this.currentItemCount = res.data.currentItemCount
@@ -262,7 +262,7 @@
             console.error(err)
           })
       },
-      getequipment() {
+      getequipment () {
         this.$axios.get('/equipment/elist', {})
           .then(res => {
             // response
@@ -278,7 +278,7 @@
             console.error(err)
           })
       },
-      getsampletype() {
+      getsampletype () {
         this.$axios.get('sampletype/list', {})
           .then(res => {
             // response
@@ -289,10 +289,10 @@
             console.error(err)
           })
       },
-      numtoupchar(num) {
+      numtoupchar (num) {
         return String.fromCharCode(64 + parseInt(num))
       },
-      postiontoupchar(postion) {
+      postiontoupchar (postion) {
         if (postion) {
           let pos = postion.split(';')
           if (pos.length === 2) {
@@ -305,7 +305,7 @@
         }
       },
       // 导出样本
-      handleExportsamplesCommand(command) {
+      handleExportsamplesCommand (command) {
         if (command === 'exportchosen') { // 导出所选数据
           if (this.multipleSelection.length < 1) {
             this.$message({
@@ -334,7 +334,7 @@
           }).catch(() => {})
         }
       },
-      exportsamples(val) {
+      exportsamples (val) {
         // 显示列
         let showcolumnarr = []
         let showcolumnnamearr = []
@@ -394,8 +394,8 @@
         }
         params = Object.assign(params, this.searchform)
         this.$axios.get('/reports/exportexcel?CreateDate=' + CreateDate, {
-            params
-          })
+          params
+        })
           .then(res => {
             window.location = 'http://' + res.data
           })
@@ -405,27 +405,27 @@
           })
       },
 
-      searchCommand(command) {
+      searchCommand (command) {
         if (command === 'search') {
           this.dialogVisible = true
         } else if (command === 'clear') {
           this.clearSearch()
         }
       },
-      seachdata() {
+      seachdata () {
         this.currentPage = 1
         this.initData()
       },
-      handleSizeChange(value) {
+      handleSizeChange (value) {
         this.size = value
         this.currentPage = 1
         this.initData()
       },
-      handleCurrentChange(value) {
+      handleCurrentChange (value) {
         this.currentPage = value
         this.initData()
       },
-      jstimehandle(val) {
+      jstimehandle (val) {
         if (val === '') {
           return '----'
         } else if (val === '0001-01-01T08:00:00+08:00') {
@@ -437,7 +437,7 @@
           return val.substring(0, 10)
         }
       },
-      clearSearch() {
+      clearSearch () {
         this.searchform.EName = ''
         this.searchform.Name = ''
         this.searchform.EId = ''
@@ -446,7 +446,6 @@
       }
     }
   }
-
 </script>
 
 <style lang="scss">

+ 94 - 95
src/dashoo.cn/frontend_animal/src/pages/report/samples/samplesstoredbysampletype.vue

@@ -76,7 +76,7 @@
             </el-select>
           </el-form-item>
           <span style="float: right;margin-top:-10px;">
-            <el-button size="small" @click="balanceShow = false">取 消</el-button>
+            <el-button size="small" @click="dialogTableVisible = false">取 消</el-button>
             <el-button type="primary" size="small" @click="initData()">确 定</el-button>
           </span>
         </el-row>
@@ -127,7 +127,7 @@
 <script>
   export default {
     name: 'samplereport',
-    data() {
+    data () {
       return {
         dialogVisible: false,
         dialogTableVisible: true,
@@ -146,90 +146,90 @@
         showcolumnselecd: [], // 选中的显示列
         multipleSelection: [], // 多选框
         showcolumn: [{
-            filed: 'BarCode',
-            name: '样本条码',
-            show: true,
-            kuoz: false
-          }, {
-            filed: 'SampleCode',
-            name: '样本编码',
-            show: true,
-            kuoz: false
-          }, {
-            filed: 'SourceName',
-            name: '样本来源',
-            show: true,
-            kuoz: false
-          }, {
-            filed: 'Name',
-            name: '名称',
-            show: true,
-            kuoz: false
-          }, {
-            filed: 'SampleTypeName',
-            name: '样本类型',
-            show: true,
-            kuoz: false
-          }, {
-            filed: 'Capacity',
-            name: '可用容量',
-            show: true,
-            kuoz: false
-          }, {
-            filed: 'InnerCode',
-            name: '样本内码',
-            show: true,
-            kuoz: false
-          }, {
-            filed: 'ValidityDate',
-            name: '有效日期',
-            show: true,
-            kuoz: false
-          }, {
-            filed: 'ReceiveDate',
-            name: '接收日期',
-            show: true,
-            kuoz: false
-          }, {
-            filed: 'CreateBy',
-            name: '录入人',
-            show: true,
-            kuoz: false
-          }, {
-            filed: 'Location',
-            name: '存储位置',
-            show: true,
-            kuoz: false,
-            columnwidth: 200
-          }, {
-            filed: 'EName',
-            name: '容器名称',
-            show: true,
-            kuoz: false,
-            columnwidth: 200
-          },
-          {
-            filed: 'GroupName',
-            name: '所属分组',
-            show: true,
-            kuoz: false
-          },
-          {
-            filed: 'CreateOn',
-            name: '创建日期',
-            show: true,
-            kuoz: false
-          }
+          filed: 'BarCode',
+          name: '样本条码',
+          show: true,
+          kuoz: false
+        }, {
+          filed: 'SampleCode',
+          name: '样本编码',
+          show: true,
+          kuoz: false
+        }, {
+          filed: 'SourceName',
+          name: '样本来源',
+          show: true,
+          kuoz: false
+        }, {
+          filed: 'Name',
+          name: '名称',
+          show: true,
+          kuoz: false
+        }, {
+          filed: 'SampleTypeName',
+          name: '样本类型',
+          show: true,
+          kuoz: false
+        }, {
+          filed: 'Capacity',
+          name: '可用容量',
+          show: true,
+          kuoz: false
+        }, {
+          filed: 'InnerCode',
+          name: '样本内码',
+          show: true,
+          kuoz: false
+        }, {
+          filed: 'ValidityDate',
+          name: '有效日期',
+          show: true,
+          kuoz: false
+        }, {
+          filed: 'ReceiveDate',
+          name: '接收日期',
+          show: true,
+          kuoz: false
+        }, {
+          filed: 'CreateBy',
+          name: '录入人',
+          show: true,
+          kuoz: false
+        }, {
+          filed: 'Location',
+          name: '存储位置',
+          show: true,
+          kuoz: false,
+          columnwidth: 200
+        }, {
+          filed: 'EName',
+          name: '容器名称',
+          show: true,
+          kuoz: false,
+          columnwidth: 200
+        },
+        {
+          filed: 'GroupName',
+          name: '所属分组',
+          show: true,
+          kuoz: false
+        },
+        {
+          filed: 'CreateOn',
+          name: '创建日期',
+          show: true,
+          kuoz: false
+        }
         ]
 
       }
     },
-    created() {
+    created () {
       this.getsampletype()
       this.getequipment()
     },
     methods: {
-      getequipment() {
+      getequipment () {
         this.$axios.get('/equipment/elist', {})
           .then(res => {
             // response
@@ -245,7 +245,7 @@
             console.error(err)
           })
       },
-      getsampletype() {
+      getsampletype () {
         this.$axios.get('sampletype/list', {})
           .then(res => {
             this.sampletypelist = res.data.items
@@ -254,10 +254,10 @@
             console.error(err)
           })
       },
-      numtoupchar(num) {
+      numtoupchar (num) {
         return String.fromCharCode(64 + parseInt(num))
       },
-      postiontoupchar(postion) {
+      postiontoupchar (postion) {
         if (postion) {
           let pos = postion.split(';')
           if (pos.length === 2) {
@@ -269,7 +269,7 @@
           return ''
         }
       },
-      initData() {
+      initData () {
         let CreateDate = []
         let params = {
           _currentPage: this.currentPage,
@@ -289,8 +289,8 @@
         params = Object.assign(params, this.searchform)
         // request
         this.$axios.get('reports/animalstoredlist?CreateDate=' + CreateDate, {
-            params
-          })
+          params
+        })
           .then(res => {
             this.list = res.data.items
             this.currentItemCount = res.data.currentItemCount
@@ -302,7 +302,7 @@
           })
       },
       // 导出样本
-      handleExportsamplesCommand(command) {
+      handleExportsamplesCommand (command) {
         if (command === 'exportchosen') { // 导出所选数据
           if (this.multipleSelection.length < 1) {
             this.$message({
@@ -331,7 +331,7 @@
           }).catch(() => {})
         }
       },
-      exportsamples(val) {
+      exportsamples (val) {
         // 显示列
         let showcolumnarr = []
         let showcolumnnamearr = []
@@ -391,8 +391,8 @@
         }
         params = Object.assign(params, this.searchform)
         this.$axios.get('/reports/exportexcel?CreateDate=' + CreateDate, {
-            params
-          })
+          params
+        })
           .then(res => {
             window.location = 'http://' + res.data
           })
@@ -402,27 +402,27 @@
           })
       },
 
-      searchCommand(command) {
+      searchCommand (command) {
         if (command === 'search') {
           this.dialogVisible = true
         } else if (command === 'clear') {
           this.clearSearch()
         }
       },
-      seachdata() {
+      seachdata () {
         this.currentPage = 1
         this.initData()
       },
-      handleSizeChange(value) {
+      handleSizeChange (value) {
         this.size = value
         this.currentPage = 1
         this.initData()
       },
-      handleCurrentChange(value) {
+      handleCurrentChange (value) {
         this.currentPage = value
         this.initData()
       },
-      jstimehandle(val) {
+      jstimehandle (val) {
         if (val === '') {
           return '----'
         } else if (val === '0001-01-01T08:00:00+08:00') {
@@ -434,7 +434,7 @@
           return val.substring(0, 10)
         }
       },
-      clearSearch() {
+      clearSearch () {
         this.searchform.Name = ''
         this.searchform.SampleTypeId = ''
         this.searchform.EId = ''
@@ -442,7 +442,6 @@
       }
     }
   }
-
 </script>
 
 <style lang="scss">

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

@@ -112,7 +112,7 @@
             <el-form-item label="录入日期">
               <el-date-picker v-model="CreateOn" type="daterange" range-separator="至" start-placeholder="开始日期"
                 end-placeholder="结束日期" size="mini" style="width:100%"></el-date-picker>
-            </el-form-item>           
+            </el-form-item>
           </el-col>
           <el-col :span="8">
             <el-form-item label="样本编码">
@@ -305,7 +305,7 @@
         dialogVisible: false,
         currentItemCount: 0, // 当前页显示数量
         currentPage: 1, // 当前页
-        size: 10, // 每页显示数量
+        size: 200, // 每页显示数量
         list: [], // table显示数据集
         BarCode: '', // 样本条码
         SampleCode: '', // 样本编码

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

@@ -70,7 +70,7 @@
         </el-table-column>
         <el-table-column :label="item.name" :key="item.name" v-if="item.show" v-for="item in showcolumn" :width="item.columnwidth"
           align="center" show-overflow-tooltip>
-          <template slot-scope="scope">   
+          <template slot-scope="scope">
             <template v-if="item.filed === 'SourceName'">
               <router-link :to="'/biobank/source/'+ scope.row.SourceId + '/sourcedetail?pname=samples-prerecorded&size='+size+'&currentPage='+currentPage"
                 :style="{color: scope.row.FamilyState === 0 ? 'blue' : 'red'}">
@@ -113,7 +113,7 @@
             <el-form-item label="录入日期">
               <el-date-picker v-model="CreateOn" type="daterange" range-separator="至" start-placeholder="开始日期"
                 end-placeholder="结束日期" size="mini" style="width:100%"></el-date-picker>
-            </el-form-item>            
+            </el-form-item>
           </el-col>
           <el-col :span="8">
             <el-form-item label="样本编码">
@@ -225,7 +225,7 @@
                   <el-input v-else-if="searchField == 'GroupName'" v-model="searchValue.GroupName" placeholder="请输入所属分组"></el-input>
                   <el-date-picker v-else-if="searchField == 'ReceiveDate'" v-model="searchValue.CreateOn" type="daterange"
                     range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" style="width:100%"></el-date-picker>
-                
+
                   <el-select v-else-if="searchField == 'SampleTypeName'" v-model="searchValue.SampleType" clearable
                     placeholder="请选择" @change="selsampletypeChange" style="width:100%">
                     <el-option v-for="item in sampletypes" :key="item.Id" :label="item.Name" :value="item.Name"></el-option>
@@ -295,7 +295,7 @@
         dialogVisible: false,
         currentItemCount: 0, // 当前页显示数量
         currentPage: 1, // 当前页
-        size: 10, // 每页显示数量
+        size: 200, // 每页显示数量
         list: [], // table显示数据集
         BarCode: '', // 样本条码
         SampleCode: '', // 样本编码

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

@@ -364,7 +364,7 @@
         exportloading: false,
         currentItemCount: 0, // 当前页显示数量
         currentPage: 1, // 当前页
-        size: 10, // 每页显示数量
+        size: 200, // 每页显示数量
         list: [], // table显示数据集
         showquerydiv: false,
         Id: 0, // ID
@@ -446,19 +446,21 @@
       }
     },
     created() {
+      this.SourceName = this.$route.query.name
+      console.log(this.$route.query.name,"this.$route.query.SourceNamethis.$route.query.SourceNamethis.$route.query.SourceNamethis.$route.query.SourceName")
       this.acc = this.authUser.Profile.AccCode
       if (this.$route.query.size && this.$route.query.currentPage) {
         this.size = parseInt(this.$route.query.size)
         this.currentPage = parseInt(this.$route.query.currentPage)
         let searchmodel = store.get('samplestoredseach')
         if (typeof (searchmodel) != 'undefined') {
-          if (searchmodel.BarCode && searchmodel.BarCode !== '') { //样本条码
+          if (searchmodel.BarCode && searchmodel.BarCode !== '') { // 样本条码
             this.BarCode = searchmodel.BarCode
           }
-          if (searchmodel.SampleCode && searchmodel.SampleCode !== '') { //样本编码
+          if (searchmodel.SampleCode && searchmodel.SampleCode !== '') { // 样本编码
             this.SampleCode = searchmodel.SampleCode
           }
-          if (searchmodel.SourceName && searchmodel.SourceName !== '') { //样本来源
+          if (searchmodel.SourceName && searchmodel.SourceName !== '') { // 样本来源
             this.SourceName = searchmodel.SourceName
           }
           if (searchmodel.InnerCode && searchmodel.InnerCode !== '') { //样本内码
@@ -642,8 +644,8 @@
         }
         store.set('samplestoredseach', params)
         this.$axios.get('/sampleinput/animallist', {
-            params
-          })
+          params
+        })
           .then(res => {
             _this.list = res.data.items
             _this.currentItemCount = res.data.currentItemCount
@@ -652,7 +654,7 @@
             console.error(err)
           })
       },
-      //根据子code获取所有父code
+      // 根据子code获取所有父code
       getparentcodebytopcode(v) {
         let _this = this
         _this.$axios.get('/sampleorgan/getparentcodebytopcode/' + v, {})
@@ -677,8 +679,8 @@
       },
       loadprintdata() {
         this.$axios.get('/sampleinput/getprintschemelist', {
-            _currentPage: -1
-          })
+          _currentPage: -1
+        })
           .then(res => {
             this.printschemelist = res.data.items
           }).catch(() => {})
@@ -686,12 +688,12 @@
       getextends() {
         let _this = this
         this.$axios.get('/sampleinput/getsampletype', {
-            _currentPage: -1
-          })
+          _currentPage: -1
+        })
           .then(res => {
             _this.sampletypes = res.data.items
             if (store.get('samplestoredseach').searchWithTemplate && store.get('samplestoredseach')
-              .searchWithTemplate !== '') { //自定义查询
+              .searchWithTemplate !== '') { // 自定义查询
               this.handleSearchCommand(store.get('samplestoredseach').searchWithTemplate)
             } else {
               this.initData()

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

@@ -114,7 +114,7 @@
             <el-form-item label="录入日期">
               <el-date-picker v-model="CreateOn" type="daterange" range-separator="至" start-placeholder="开始日期"
                 end-placeholder="结束日期" size="mini" style="width:100%"></el-date-picker>
-            </el-form-item>            
+            </el-form-item>
           </el-col>
           <el-col :span="8">
             <el-form-item label="样本编码">
@@ -127,7 +127,7 @@
               <el-select v-model="STNoteField" placeholder="请选择" size="mini" style="width:100%">
                 <el-option v-for="item in typetykzlist" :label="item.Name" :value="item.FieldName" :key="item.FieldName"></el-option>
               </el-select>
-            </el-form-item> 
+            </el-form-item>
           </el-col>
           <el-col :span="8">
             <el-form-item label="样本源名称">
@@ -217,7 +217,7 @@
                   <el-input v-else-if="searchField == 'GroupName'" v-model="searchValue.GroupName" placeholder="请输入所属分组"></el-input>
                   <el-date-picker v-else-if="searchField == 'ReceiveDate'" v-model="searchValue.CreateOn" type="daterange"
                     range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" style="width:100%"></el-date-picker>
-                 
+
                   <el-select v-else-if="searchField == 'SampleTypeName'" v-model="searchValue.SampleType" clearable
                     placeholder="请选择" @change="selsampletypeChange" style="width:100%">
                     <el-option v-for="item in sampletypes" :key="item.Id" :label="item.Name" :value="item.Name"></el-option>
@@ -287,7 +287,7 @@
         dialogVisible: false,
         currentItemCount: 0, // 当前页显示数量
         currentPage: 1, // 当前页
-        size: 10, // 每页显示数量
+        size: 200, // 每页显示数量
         list: [], // table显示数据集
         BarCode: '', // 样本条码
         SampleCode: '', // 样本编码

+ 128 - 0
src/dashoo.cn/frontend_animal/src/utils/micro_request.js

@@ -0,0 +1,128 @@
+import axios from 'axios'
+import { Notification, MessageBox, Message } from 'element-ui'
+import store from '@/store'
+import { getToken } from '@/utils/auth'
+import errorCode from '@/utils/errorCode'
+
+axios.defaults.headers['Content-Type'] = 'application/json;charset=utf-8'
+
+const service = axios.create({
+  // axios中请求配置有baseURL选项,表示请求URL公共部分
+  baseURL: process.env.VUE_APP_BASE_API,
+  // 超时
+  timeout: 60000
+})
+
+// request拦截器
+service.interceptors.request.use(config => {
+  config.headers['Tenant'] = process.env.VUE_APP_TENANT
+  config.headers['X-RPCX-Meta'] = 'tenant='+ process.env.VUE_APP_TENANT
+  // 是否需要设置 token
+  const isToken = (config.headers || {}).isToken === false
+  if (getToken() && !isToken) {
+    config.headers['Authorization'] = 'Bearer ' + getToken() // 让每个请求携带自定义token 请根据实际情况自行修改
+  }
+  return config
+}, error => {
+    console.log(error)
+    Promise.reject(error)
+})
+
+
+// 响应拦截器
+service.interceptors.response.use(res => {
+  // 未设置状态码则默认成功状态
+  const code = res.data.code || 200;
+  // 获取错误信息
+  const message = errorCode[code] || res.data.msg || errorCode['default']
+  if (code === 401) {
+    MessageBox.confirm(
+      '登录状态已过期,您可以继续留在该页面,或者重新登录',
+      '系统提示',
+      {
+        confirmButtonText: '重新登录',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }
+    ).then(() => {
+      store.dispatch('LogOut').then(() => {
+        location.reload() // 为了重新实例化vue-router对象 避免bug
+      })
+    })
+  }
+  else if (code === 500) {
+    Message({
+      message: message,
+      type: 'error'
+    })
+    return Promise.reject(new Error(message))
+  } else if (code !== 200) {
+    Notification.error({
+      title: message
+    })
+    return Promise.reject('error')
+  }
+  else {
+    return res.data
+  }
+},
+error => {
+  console.log('err' + error)
+  Message({
+    message: error.message,
+    type: 'error',
+    duration: 5 * 1000
+  })
+  return Promise.reject(error)
+})
+
+service.postRequest = function postRequest(basePath, srvName, funcName, data) {
+  if (data == undefined){
+    let nullParam = {"nullparam": 0}
+    data = nullParam
+  }
+  return service.request({
+    url: process.env.VUE_APP_MicroSrvProxy_API + basePath,
+    method: 'post',
+    headers: {
+      'Content-Type': 'application/rpcx',
+      'X-RPCX-SerializeType': '1',
+      'X-RPCX-ServicePath': srvName,
+      'X-RPCX-ServiceMethod': funcName
+    },
+    data: data
+  })
+};
+
+// Excel文件下载(服务端生成文件流)
+service.downloadExcel = function downloadExcel(basePath, srvName, funcName, fileName, data) {
+  if (fileName == undefined) {
+    fileName = 'data.xlsx'
+  }
+  if (data == undefined) {
+    let nullParam = {"nullparam": 0}
+    data = nullParam
+  }
+  service.request({
+    url: process.env.VUE_APP_MicroSrvProxy_API + basePath,
+    method: 'post',
+    responseType: 'blob',
+    headers: {
+      'Content-Type': 'application/rpcx',
+      'X-RPCX-SerializeType': '1',
+      'X-RPCX-ServicePath': srvName,
+      'X-RPCX-ServiceMethod': funcName
+    },
+    data: data
+  }).then(res => {
+    const aLink = document.createElement('a')
+    var blob = new Blob([res], { type: 'application/vnd.ms-excel' })
+    aLink.href = URL.createObjectURL(blob)
+    aLink.setAttribute('download', fileName) // 设置下载文件名称
+    document.body.appendChild(aLink)
+    aLink.click()
+    document.body.appendChild(aLink)
+    })
+};
+
+export default service