Parcourir la source

修改样本原高级查询的bug

peiyt il y a 6 ans
Parent
commit
d561e6a78d

+ 1 - 1
src/dashoo.cn/backend/api/controllers/biobank/samplessource.go

@@ -733,7 +733,7 @@ func (this *SamplesSourceController) AnimalList() {
 		where = where + " and ProjectName = '" + ProjectName + "'"
 	}
 	if Address != "" {
-		where = where + " and ( ProvinceName like '%" + Address + "% or CityName like '%" + Address + "% or StreetName like '%" + Address + "% or Address like '%" + Address + "%)'"
+		where = where + " and ( ProvinceName like '%" + Address + "%' or CityName like '%" + Address + "%' or StreetName like '%" + Address + "%' or Address like '%" + Address + "%')"
 	}
 	if AuditorStatus != "" {
 		where = where + " and AuditorStatus = '" + AuditorStatus + "'"

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

@@ -195,11 +195,11 @@
       })
     },
     name: 'samplessource',
-    data() {
+    data () {
       return {
         filehost: '',
         importfileparam: {}, // 导入文件参数
-        importfilepath: '', //导入文件路径
+        importfilepath: '', // 导入文件路径
         importVisible: false, // 导入对话框
         importmsg: '未选择文件', // 导入文件
         dialogVisible: false,
@@ -218,7 +218,7 @@
           Tive: '',
           remark: '',
           starttime: null,
-          endtime: null,
+          endtime: null
         },
         SurveyDate: [], // 采样日期
         CreateOn: [new Date(new Date().getTime() - 3 * 30 * 24 * 60 * 60 * 1000), new Date()],
@@ -226,7 +226,7 @@
         currentPage: 1,
         size: 10,
         donorsList: [],
-        //列表排序
+        // 列表排序
         Column: {
           Order: '',
           Prop: ''
@@ -234,10 +234,10 @@
         acceptUsers: [],
         userlist: [],
         genuslist: [],
-        projectlist: [],
+        projectlist: []
       }
     },
-    created() {
+    created () {
       if (this.$route.query.size && this.$route.query.currentPage) {
         this.size = parseInt(this.$route.query.size)
         this.currentPage = parseInt(this.$route.query.currentPage)
@@ -251,7 +251,7 @@
       }
     },
     methods: {
-      initdata() {
+      initdata () {
         let _this = this
         let SurveyDate = []
         if (!_this.SurveyDate) {
@@ -265,7 +265,8 @@
           SurveyDate.push(_this.formatDateTime(_this.SurveyDate[1]))
         }
         let CreateOn = []
-        if (_this.CreateOn.length == 2) {
+        console.log(_this.CreateOn, 'CreateOn')
+        if (_this.CreateOn != null && _this.CreateOn.length == 2) {
           _this.CreateOn[1].setHours(23)
           _this.CreateOn[1].setMinutes(59)
           _this.CreateOn[1].setSeconds(59)
@@ -281,8 +282,8 @@
         Object.assign(params, _this.searchform)
         _this.$axios.get('/samplessource/animallist?SurveyDate=' + SurveyDate.join(',') + '&CreateOn=' +
             CreateOn.join(','), {
-              params
-            })
+          params
+        })
           .then(res => {
             _this.donorsList = res.data.items
             _this.currentItemCount = res.data.currentItemCount
@@ -291,11 +292,11 @@
             console.error(err)
           })
       },
-      getaddress(val) {
+      getaddress (val) {
         let address = val.ProvinceName + val.CityName + val.StreetName + val.Address
         return address
       },
-      getAnimalGenus() {
+      getAnimalGenus () {
         // 获取种属
         let _this = this
         _this.$axios.get('/items/worditem?code=AnimalGenus', {})
@@ -303,22 +304,22 @@
             _this.genuslist = res.data
           })
       },
-      //获取项目属性
-      getProjectlist() {
+      // 获取项目属性
+      getProjectlist () {
         let _this = this
         _this.$axios.get('/items/worditem?code=ProjectName', {})
           .then(res => {
             _this.projectlist = res.data
           })
       },
-      delSamplesSource(val) {
+      delSamplesSource (val) {
         let _this = this
         _this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
           confirmButtonText: '确定',
           cancelButtonText: '取消',
           type: 'warning'
         }).then(() => {
-          _this.$axios.delete("samplessource/delbioinfo/" + val.Id + '?GenusId=' + val.GenusId, null)
+          _this.$axios.delete('samplessource/delbioinfo/' + val.Id + '?GenusId=' + val.GenusId, null)
             .then(res => {
               // response
               if (res.data.code === 0) {
@@ -338,8 +339,8 @@
             .catch(() => {})
         }).catch(() => {})
       },
-      //导入蜜蜂样本来源
-      importData() {
+      // 导入蜜蜂样本来源
+      importData () {
         let _this = this
         if (_this.importfilepath === '') {
           _this.$message({
@@ -371,10 +372,10 @@
             console.error(err)
           })
       },
-      handleexportfileSuccess(res, file) {
+      handleexportfileSuccess (res, file) {
         this.importfilepath = res
       },
-      beforeexportfileUpload(file) {
+      beforeexportfileUpload (file) {
         let i = file.name.lastIndexOf('.')
         let typename = ''
         if (i > -1) {
@@ -394,8 +395,8 @@
         return true
       },
 
-      //列表排序功能
-      orderby(column) {
+      // 列表排序功能
+      orderby (column) {
         if (column.order == 'ascending') {
           this.Column.Order = 'asc'
         } else if (column.order == 'descending') {
@@ -404,18 +405,18 @@
         this.Column.Prop = column.prop
         this.initdata()
       },
-      seachdata() {
+      seachdata () {
         this.currentPage = 1
         this.initdata()
       },
-      searchCommand(command) {
+      searchCommand (command) {
         if (command == 'search') {
           this.dialogVisible = true
         } else if (command == 'clear') {
           this.clearSearch()
         }
       },
-      clearSearch() {
+      clearSearch () {
         this.searchform.GenusId = ''
         this.searchform.Genus = ''
         this.searchform.Address = ''
@@ -429,27 +430,27 @@
         this.CreateOn = []
         this.initdata()
       },
-      handleSizeChange(value) {
+      handleSizeChange (value) {
         this.size = value
         this.currentPage = 1
         this.initdata()
       },
-      handleCurrentChange(value) {
+      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;
+      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) {
+      jstimehandle (val) {
         if (val === '') {
           return '----'
         } else if (val === '0001-01-01T08:00:00+08:00') {
@@ -463,7 +464,6 @@
       }
     }
   }
-
 </script>
 
 <style lang="scss">