Explorar el Código

修复高级查询结束时间大于开始时间时关闭弹窗继续查询的bug

jianglw hace 4 años
padre
commit
2a0a91ff8f

+ 5 - 14
src/dashoo.cn/backend/api/controllers/samplesinfo/samplesinput.go

@@ -295,18 +295,9 @@ func (this *SamplesinputController) AnimalList() {
 	if ditem != "" {
 		where = where + " and f.DItem = '" + ditem + "'"
 	}
-	equipmentIds :=this.GetStrings("EquipmentIds")
-	if equipmentIds != nil {
-		equipmentIdsStr := "("
-		for k, v := range equipmentIds {
-			if k == len(equipmentIds) -1 {
-				equipmentIdsStr += v
-			} else {
-				equipmentIdsStr += v + ","
-			}
-		}
-		equipmentIdsStr += ")"
-		where += " and f.Name in " + equipmentIdsStr
+	equipmentIds := this.GetString("EquipmentIds")
+	if equipmentIds != "" {
+		where += " and f.id in (" + equipmentIds + ")"
 	}
 	var list []samplesinfo.SamplesInfoList
 	total, list := svc.GetPagingEntitiesWithTb(this.User.AccCode, page.CurrentPage, page.Size, this.User.AccCode+AnimaltbName, "a.Id desc, SourceName, groupNo asc , sampletype", where)
@@ -2101,11 +2092,11 @@ func (this *SamplesinputController) ExportExcel() {
 	}
 	CreateOnstart, _ := this.GetInt64("CreateOnstart")
 	if CreateOnstart != 0 {
-		where = where + " and  a.CreateOn >'" + time.Unix(CreateOnstart, 0).Format("2006-01-02") + "'"
+		where = where + " and  a.CreateOn >='" + time.Unix(CreateOnstart, 0).Format("2006-01-02") + "'"
 	}
 	CreateOnend, _ := this.GetInt64("CreateOnend")
 	if CreateOnend != 0 {
-		where = where + " and a.CreateOn <'" + time.Unix(CreateOnend, 0).Format("2006-01-02") + " 23:59:59'"
+		where = where + " and a.CreateOn =<'" + time.Unix(CreateOnend, 0).Format("2006-01-02") + " 23:59:59'"
 	}
 	Validitystart, _ := this.GetInt64("Validitystart")
 	if Validitystart != 0 {

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

@@ -712,23 +712,26 @@ export default {
       }
     },
     seachdata () {
-      console.log("this.SurveyDateStart", this.SurveyDateStart)
-      console.log("this.SurveyDateEnd", this.SurveyDateEnd)
       this.dialogVisible = false
       this.currentPage = 1
       this.SurveyDate = []
+      this.CreateOn = []
       if ((this.SurveyDateStart != '' && this.SurveyDateEnd == '') || (this.SurveyDateStart == '' && this.SurveyDateEnd != '')) {
         this.$message.error('请输入完整采集日期!')
+        return
       } else if (this.SurveyDateStart > this.SurveyDateEnd) {
         this.$message.error('开始日期不能大于结束日期,请重新输入!')
+        return
       } else if (this.SurveyDateStart != '' && this.SurveyDateEnd != ''){
         this.SurveyDate.push(this.SurveyDateStart)
         this.SurveyDate.push(this.SurveyDateEnd)
       }
       if ((this.CreateOnStart != '' && this.CreateOnEnd == '') || (this.CreateOnStart == '' && this.CreateOnEnd != '')) {
         this.$message.error('请输入完整创建日期!')
+        return
       } else if (this.CreateOnStart > this.CreateOnEnd) {
         this.$message.error('开始日期不能大于结束日期,请重新输入!')
+        return
       } else if (this.CreateOnStart != '' && this.CreateOnEnd != ''){
         this.CreateOn.push(this.CreateOnStart)
         this.CreateOn.push(this.CreateOnEnd)
@@ -896,7 +899,7 @@ export default {
         project_name: this.searchform.ProjectName,
         auditor_status: this.searchform.AuditorStatus,
         auditor_name: this.searchform.AuditorName,
-        create_on: (this.CreateOn).join(','),
+        create_on: this.CreateOn[0] / 1000 + ',' + this.CreateOn[1] / 1000,
         show_column: showcolumnarr + '',
         show_column_name: showcolumnnamearr + '',
         type: 'SampleSource'

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

@@ -522,15 +522,6 @@
           }).catch(() => {})
       },
       initData () {
-        this.CreateOn = []
-        if ((this.StartDate != '' && this.EndDate == '') || (this.StartDate == '' && this.EndDate != '')) {
-          this.$message.error('请输入完整创建日期!')
-        } else if (this.StartDate > this.EndDate) {
-          this.$message.error('开始日期不能大于结束日期,请重新输入!')
-        } else if (this.StartDate != '' && this.EndDate != '') {
-          this.CreateOn.push(this.StartDate)
-          this.CreateOn.push(this.EndDate)
-        }
         this.currentSearchTemplate = ''
         let _this = this
         // 增加自定义显示列,存储位置,之后需要去掉
@@ -650,6 +641,17 @@
       },
       seachdata () {
         this.currentPage = 1
+        this.CreateOn = []
+        if ((this.StartDate != '' && this.EndDate == '') || (this.StartDate == '' && this.EndDate != '')) {
+          this.$message.error('请输入完整创建日期!')
+          return
+        } else if (this.StartDate > this.EndDate) {
+          this.$message.error('开始日期不能大于结束日期,请重新输入!')
+          return
+        } else if (this.StartDate != '' && this.EndDate != '') {
+          this.CreateOn.push(this.StartDate)
+          this.CreateOn.push(this.EndDate)
+        }
         this.initData()
         this.dialogVisible = false
       },

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

@@ -584,15 +584,6 @@
 
     methods: {
       initData () {
-        this.CreateOn = []
-        if ((this.StartDate != '' && this.EndDate == '') || (this.StartDate == '' && this.EndDate != '')) {
-          this.$message.error('请输入完整创建日期!')
-        } else if (this.StartDate > this.EndDate) {
-          this.$message.error('开始日期不能大于结束日期,请重新输入!')
-        } else if (this.StartDate != '' && this.EndDate != '') {
-          this.CreateOn.push(this.StartDate)
-          this.CreateOn.push(this.EndDate)
-        }
         this.currentSearchTemplate = ''
         let _this = this
         // 增加自定义显示列,存储位置,之后需要去掉
@@ -737,6 +728,17 @@
       },
       seachdata () {
         this.currentPage = 1
+        this.CreateOn = []
+        if ((this.StartDate != '' && this.EndDate == '') || (this.StartDate == '' && this.EndDate != '')) {
+          this.$message.error('请输入完整创建日期!')
+          return
+        } else if (this.StartDate > this.EndDate) {
+          this.$message.error('开始日期不能大于结束日期,请重新输入!')
+          return
+        } else if (this.StartDate != '' && this.EndDate != '') {
+          this.CreateOn.push(this.StartDate)
+          this.CreateOn.push(this.EndDate)
+        }
         this.initData()
         this.dialogVisible = false
       },

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

@@ -485,15 +485,6 @@
     },
     methods: {
       initData () {
-        this.CreateOn = []
-        if ((this.StartDate != '' && this.EndDate == '') || (this.StartDate == '' && this.EndDate != '')) {
-          this.$message.error('请输入完整创建日期!')
-        } else if (this.StartDate > this.EndDate) {
-          this.$message.error('开始日期不能大于结束日期,请重新输入!')
-        } else if (this.StartDate != '' && this.EndDate != '') {
-          this.CreateOn.push(this.StartDate)
-          this.CreateOn.push(this.EndDate)
-        }
         this.currentSearchTemplate = ''
         let _this = this
         // 增加自定义显示列,存储位置,之后需要去掉
@@ -619,6 +610,15 @@
       },
       seachdata () {
         this.currentPage = 1
+        this.CreateOn = []
+        if ((this.StartDate != '' && this.EndDate == '') || (this.StartDate == '' && this.EndDate != '')) {
+          this.$message.error('请输入完整创建日期!')
+        } else if (this.StartDate > this.EndDate) {
+          this.$message.error('开始日期不能大于结束日期,请重新输入!')
+        } else if (this.StartDate != '' && this.EndDate != '') {
+          this.CreateOn.push(this.StartDate)
+          this.CreateOn.push(this.EndDate)
+        }
         this.initData()
         this.dialogVisible = false
       },