Procházet zdrojové kódy

样本来源自定义查询相关方法

jianglw před 4 roky
rodič
revize
a671ed0d94

+ 12 - 9
src/dashoo.cn/backend/api/controllers/samplesinfo/samplesinput.go

@@ -292,7 +292,7 @@ func (this *SamplesinputController) AnimalList() {
 		where = where + " and SourceName like '%" + donorname + "%'"
 	}
 	var list []samplesinfo.SamplesInfoList
-	total, list := svc.GetPagingEntitiesWithTb(this.User.AccCode, page.CurrentPage, page.Size, this.User.AccCode+AnimaltbName, "Id desc", where)
+	total, list := svc.GetPagingEntitiesWithTb(this.User.AccCode, page.CurrentPage, page.Size, this.User.AccCode+AnimaltbName, "SourceName, groupNo asc , sampletype", where)
 
 	var datainfo DataInfo
 	datainfo.Items = list
@@ -2346,7 +2346,7 @@ func (this *SamplesinputController) Listajax() {
 	}
 	svc := samplesinfo.GetSamplesInfoService(utils.DBE)
 	var samplespre []samplesinfo.SamplesInfoList
-	total, samplespre := svc.GetPagingEntitiesWithTb(this.User.AccCode, page.CurrentPage, page.Size, this.User.AccCode+AnimaltbName, "a.Id desc", where)
+	total, samplespre := svc.GetPagingEntitiesWithTb(this.User.AccCode, page.CurrentPage, page.Size, this.User.AccCode+AnimaltbName, "SourceName, groupNo asc , sampletype", where)
 
 	var datainfo DataInfo
 	datainfo.Items = samplespre
@@ -2515,7 +2515,7 @@ func (this *SamplesinputController) DeleteTemplate() {
 type searchTemplateField struct {
 	Field string //字段
 	OrAnd string //与前值关系
-	Value string //树脂
+	Value string //数值
 }
 
 var a_table_fields_for_search = map[string]int{
@@ -2579,12 +2579,14 @@ func (this *SamplesinputController) SearchList() {
 		this.ServeJSON()
 		return
 	}
-
-	where := " IState =1 and DeletionStateCode=0 "
 	//设备权限
-	svcs := equipment.GetEquipmentService(utils.DBE)
-	poweeids := svcs.GetPowerEquipmentids(this.User.AccCode, utils.ToStr(this.User.Id))
-	where = where + " and  a.EquipmentId in(" + strings.Join(poweeids, ",") + ")"
+	svcPermission := permission.GetPermissionService(utils.DBE)
+	eids := svcPermission.GetEquipmentIdById(utils.ToStr(this.User.Id))
+	where := " IState =1 and DeletionStateCode=0 and (f.CreateUserId= " + utils.ToStr(this.User.Id) + " or a.EquipmentId in ("+eids+"))"
+	//设备权限
+	//svcs := equipment.GetEquipmentService(utils.DBE)
+	//poweeids := svcs.GetPowerEquipmentids(this.User.AccCode, utils.ToStr(this.User.Id))
+	//where = where + " and  a.EquipmentId in(" + strings.Join(poweeids, ",") + ")"
 
 	for i, field := range fields {
 		if i != 0 {
@@ -2629,7 +2631,8 @@ func (this *SamplesinputController) SearchList() {
 	where += ")"
 
 	var list []samplesinfo.SamplesInfoList
-	total, list := svc.GetPagingEntitiesWithOrderSearch(this.User.AccCode, page.CurrentPage, page.Size, "Id desc", where)
+	//total, list := svc.GetPagingEntitiesWithOrderSearch(this.User.AccCode, page.CurrentPage, page.Size, "SourceName, groupNo asc , sampletype", where)
+	total, list := svc.GetPagingEntitiesWithTb(this.User.AccCode, page.CurrentPage, page.Size, this.User.AccCode+AnimaltbName, "SourceName, groupNo asc , sampletype", where)
 
 	var datainfo DataInfo
 	datainfo.Items = list

+ 4 - 5
src/dashoo.cn/backend/api/controllers/samplesinfo/samplespreinput.go

@@ -203,7 +203,7 @@ func (this *SamplespreinputController) AnimalList() {
 	}
 	svc := samplesinfo.GetSamplesInfoService(utils.DBE)
 	var list []samplesinfo.SamplesInfoList
-	total, list := svc.GetPagingEntitiesWithTb(this.User.AccCode, page.CurrentPage, page.Size, this.User.AccCode+AnimaltbName, "Id desc", where)
+	total, list := svc.GetPagingEntitiesWithTb(this.User.AccCode, page.CurrentPage, page.Size, this.User.AccCode+AnimaltbName, "SourceName, groupNo asc , sampletype", where)
 
 	var datainfo DataInfo
 	datainfo.Items = list
@@ -279,7 +279,7 @@ func (this *SamplespreinputController) AnimalApplyList() {
 	}
 	svc := samplesinfo.GetSamplesInfoService(utils.DBE)
 	var list []samplesinfo.SamplesInfoList
-	total, list := svc.GetPagingEntitiesWithTb(this.User.AccCode, page.CurrentPage, page.Size, this.User.AccCode+AnimaltbName, "Id ", where)
+	total, list := svc.GetPagingEntitiesWithTb(this.User.AccCode, page.CurrentPage, page.Size, this.User.AccCode+AnimaltbName, "SourceName, groupNo asc , sampletype", where)
 
 	var datainfo DataInfo
 	datainfo.Items = list
@@ -1048,7 +1048,6 @@ func (this *SamplespreinputController) SearchList() {
 		this.ServeJSON()
 		return
 	}
-
 	where := " a.IState in (2,3,4,7,8) and a.DeletionStateCode=0 "
 	//设备权限
 	//	svcs := equipment.GetEquipmentService(utils.DBE)
@@ -1098,8 +1097,8 @@ func (this *SamplespreinputController) SearchList() {
 	where += ")"
 
 	var list []samplesinfo.SamplesInfoList
-	total, list := svc.GetPagingEntitiesWithOrderSearch(this.User.AccCode, page.CurrentPage, page.Size, "Id desc", where)
-
+	//total, list := svc.GetPagingEntitiesWithOrderSearch(this.User.AccCode, page.CurrentPage, page.Size, "Id desc", where)
+	total, list := svc.GetPagingEntitiesWithTb(this.User.AccCode, page.CurrentPage, page.Size, this.User.AccCode+AnimaltbName, "SourceName, groupNo asc , sampletype", where)
 	var datainfo DataInfo
 	datainfo.Items = list
 	datainfo.CurrentItemCount = total

+ 3 - 3
src/dashoo.cn/backend/api/controllers/samplesinfo/samplesunsave.go

@@ -201,7 +201,7 @@ func (this *SamplesunsaveController) AnimalList() {
 
 	svc := samplesinfo.GetSamplesInfoService(utils.DBE)
 	var list []samplesinfo.SamplesInfoList
-	total, list := svc.GetPagingEntitiesWithTb(this.User.AccCode, page.CurrentPage, page.Size, this.User.AccCode+AnimaltbName, "Id desc", where)
+	total, list := svc.GetPagingEntitiesWithTb(this.User.AccCode, page.CurrentPage, page.Size, this.User.AccCode+AnimaltbName, "SourceName, groupNo asc , sampletype", where)
 
 	var datainfo DataInfo
 	datainfo.Items = list
@@ -362,8 +362,8 @@ func (this *SamplesunsaveController) SearchList() {
 	where += ")"
 
 	var list []samplesinfo.SamplesInfoList
-	total, list := svc.GetPagingEntitiesWithOrderSearch(this.User.AccCode, page.CurrentPage, page.Size, "Id desc", where)
-
+	//total, list := svc.GetPagingEntitiesWithOrderSearch(this.User.AccCode, page.CurrentPage, page.Size, "Id desc", where)
+	total, list := svc.GetPagingEntitiesWithTb(this.User.AccCode, page.CurrentPage, page.Size, this.User.AccCode+AnimaltbName, "SourceName, groupNo asc , sampletype", where)
 	var datainfo DataInfo
 	datainfo.Items = list
 	datainfo.CurrentItemCount = total

+ 4 - 4
src/dashoo.cn/frontend_animal/src/components/samples/samplesourcesearchdialog.vue

@@ -393,7 +393,7 @@ export default {
       }
       //   {
       //   value: 'Latitude',
-      //   label: '纬度',
+      //   label: '纬度',扩展
       //   type: 'str'
       // }, {
       //   value: 'Longitude',
@@ -507,7 +507,7 @@ export default {
     removeCustomCondition (row) {
       if (this.searchTableData !== undefined && this.searchTableData != null && this.searchTableData.length > 0) {
         for (var i = 0; i < this.searchTableData.length; i++) {
-          if (row.Name === this.searchTableData[i].Name) {
+          if (row.name === this.searchTableData[i].name) {
             this.searchTableData.splice(i, 1)
           }
         }
@@ -715,7 +715,7 @@ export default {
           if (this.searchTableData[i].Operate === '' || this.searchTableData[i].Operate === undefined || this.searchTableData[i].Operate === null) {
             this.$message({
               type: 'warning',
-              message: '【' + this.searchTableData[i].Name + '】表达式为空,保存失败!'
+              message: '【' + this.searchTableData[i].name + '】表达式为空,保存失败!'
             })
             return
           }
@@ -723,7 +723,7 @@ export default {
           if ((i != this.searchTableData.length - 1) && (this.searchTableData[i].Guanxi === '' || this.searchTableData[i].Guanxi === undefined || this.searchTableData[i].Guanxi === null)) {
             this.$message({
               type: 'warning',
-              message: '【' + this.searchTableData[i].Name + '】逻辑关系为空,保存失败!'
+              message: '【' + this.searchTableData[i].name + '】逻辑关系为空,保存失败!'
             })
             return
           }

+ 8 - 3
src/dashoo.cn/frontend_animal/src/pages/biobank/source/_opera/sourcedetail.vue

@@ -45,7 +45,7 @@
             </el-col>
             <el-col :span="6">
               <label>来源内码 : {{ animalForm.InnerNo }}</label>
-            </el-col>           
+            </el-col>
             <el-col :span="6">
               <label>数量 : {{ animalForm.Amount }} {{ animalForm.Unit }} </label>
             </el-col>
@@ -213,15 +213,18 @@
         animalextends: [], // 扩展字段
         sampletotal: {}, // 样本统计
         devicesamples: [], // 设备中样本
-        formLabelWidth: '120px'
+        formLabelWidth: '120px',
+        CreateOn: []
       }
     },
     created() {
       this.createpage()
     },
     watch: {
-      '$route'(to, from) {
+      '$route' (to, from) {
         this.createpage()
+        var anchor = this.$el.querySelector('#topdiv')
+        anchor.scrollIntoView()
       }
     },
     methods: {
@@ -320,11 +323,13 @@
           this.$router.push({
             name: this.$route.query.pname,
             query: {
+              CreateOn: this.CreateOn,
               size: this.$route.query.size,
               currentPage: this.$route.query.currentPage
             }
           })
         } else {
+
           this.$router.go(-1)
         }
       },

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

@@ -631,7 +631,7 @@ export default {
           type: 'SampleSource'
         }
         console.log(params)
-        service.postRequest('dashoo.biobank.bee-0.1', 'SampleRelated', 'SearchByTemplate', params).then(res => {
+        service.postRequest('dashoo.biobank.bee-0.1', 'SampleRelated', 'SampleSourceSearchByTemplate', params).then(res => {
           this.donorsList = res.data.list
           this.currentItemCount = res.data.total
         })

+ 38 - 12
src/dashoo.cn/frontend_animal/src/pages/setting/sampletype/_opera/stypeitem.vue

@@ -95,19 +95,24 @@
           </el-select>
         </el-form-item>
         <el-form-item label="显示名称" prop="Name" label-width="120px">
-          <el-select ref="nameSelect" filterable default-first-option v-model="stypenItemForm.Name"
-            @change="getItemdata()" placeholder="请选择显示名称" style="width: 100%">
-            <el-option v-for="item in groupItemList" :key="item.Key" :label="item.Name" :value="item.Name">
-            </el-option>
-          </el-select>
+<!--          <el-select ref="nameSelect" filterable default-first-option v-model="stypenItemForm.Name"-->
+<!--            @change="getItemdata()" placeholder="请选择显示名称" style="width: 100%">-->
+<!--            <el-option v-for="item in groupItemList" :key="item.Key" :label="item.Name" :value="item.Name">-->
+<!--            </el-option>-->
+<!--          </el-select>-->
+          <el-input placeholder="请输入显示名称" v-model="stypenItemForm.Name">
+
+          </el-input>
         </el-form-item>
         <el-form-item label="字段类型" prop="FieldType" label-width="120px">
-          <el-select ref="typeSelect" v-model="stypenItemForm.FieldType" style="width:100%" placeholder="请选择字段类型" disabled>
-            <el-option label="字符型" value="1"></el-option>
-            <el-option label="列表型" value="2"></el-option>
-            <el-option label="文本型" value="3"></el-option>
-            <el-option label="日期型" value="4"></el-option>
-            <el-option label="图片型" value="5"></el-option>
+          <el-select ref="typeSelect" v-model="stypenItemForm.FieldType" style="width:100%" placeholder="请选择字段类型">
+            <el-option
+              v-for="item in filedTypeList"
+              :key="item.value"
+              :label="item.label"
+              :value="item.value"
+              @click.native="setFieldType(item.label)">
+            </el-option>
           </el-select>
         </el-form-item>
         <el-form-item label="默认值" prop="FieldDefault"
@@ -216,6 +221,22 @@
           Remark: '',
           SortCode: 0,
         },
+        filedTypeList: [{
+          label: '字符型',
+          value: '1'
+        }, {
+          label: '列表型',
+          value: '2',
+        }, {
+          label: '文本型',
+          value: '3',
+        }, {
+          label: '日期型',
+          value: '4',
+        }, {
+          label: '图片型',
+          value: '5',
+        }],
         Listvalues: [],
         groupList: [],
         groupItemList: [],
@@ -254,7 +275,12 @@
             console.error(err)
           })
       },
-      addStypeItem() {
+
+      // 获取字段类型名称
+      setFieldType (val) {
+        this.stypenItemForm.FieldTypeName = val
+      },
+      addStypeItem () {
         let _this = this
         let params = {
           stypeItemId: _this.stypeItemId,