Explorar el Código

容器权限及入库审核分页查询

shihang hace 6 años
padre
commit
9de20fbe78

+ 17 - 2
src/dashoo.cn/backend/api/controllers/equipment/equipment.go

@@ -160,11 +160,26 @@ func (this *EquipmentController) NameIdList() {
 	svcPermission := permission.GetPermissionService(utils.DBE)
 	eids := svcPermission.GetEquipmentIdById(utils.ToStr(this.User.Id))
 
+	userSvc := userRole.GetUserService(utils.DBE)
+	organizeSvc := organize.GetOrganizeService(utils.DBE)
+	departList := organizeSvc.GetChildByTopId(this.User.DepartmentId)
+	//取出当前部门及下级部门的所有用户列表
+	var subUserList []userRole.Base_User
+	whereUser := " 1=1 "
+	whereUser += " and DepartmentId in (" + departList + ")"
+	userSvc.GetEntities(&subUserList, whereUser)
+	var userIds string
+
+	for _, tmpUser := range subUserList {
+		userIds += strconv.Itoa(tmpUser.Id) + ","
+	}
+	userIds = strings.Trim(userIds, ",")
+
 	where := " a.AccCode = '" + this.User.AccCode + "'"
 	if eids != "" {
-		where = where + " and (a.CreateUserId= " + utils.ToStr(this.User.Id) + " or a.Id in (" + eids + "))"
+		where = where + " and (a.CreateUserId in (" + userIds + ")" + " or a.Id in (" + eids + "))"
 	} else {
-		where = where + "and a.CreateUserId= " + utils.ToStr(this.User.Id)
+		where = where + "and a.CreateUserId in (" + userIds + ")"
 	}
 
 	var list []string

+ 26 - 2
src/dashoo.cn/backend/api/controllers/samplesinfo/samplesinput.go

@@ -3,13 +3,16 @@ package samplesinfo
 import (
 	"encoding/json"
 	"fmt"
+	"strconv"
 	"strings"
 	"time"
 
 	"dashoo.cn/backend/api/business/approveinfo"
 	"dashoo.cn/backend/api/business/samplesubpackage"
 	. "dashoo.cn/backend/api/controllers"
+	"dashoo.cn/business2/organize"
 	"dashoo.cn/business2/permission"
+	"dashoo.cn/business2/userRole"
 	"github.com/astaxie/beego"
 
 	//	"dashoo.cn/backend/api/business/currboxcapacity"
@@ -68,11 +71,32 @@ func (this *SamplesinputController) List() {
 	//设备权限
 	svcPermission := permission.GetPermissionService(utils.DBE)
 	eids := svcPermission.GetEquipmentIdById(utils.ToStr(this.User.Id))
+
+	userSvc := userRole.GetUserService(utils.DBE)
+	organizeSvc := organize.GetOrganizeService(utils.DBE)
+	departList := organizeSvc.GetChildByTopId(this.User.DepartmentId)
+	//取出当前部门及下级部门的所有用户列表
+	var subUserList []userRole.Base_User
+	whereUser := " 1=1 "
+	whereUser += " and DepartmentId in (" + departList + ")"
+	userSvc.GetEntities(&subUserList, whereUser)
+	var userIds string
+
+	for _, tmpUser := range subUserList {
+		userIds += strconv.Itoa(tmpUser.Id) + ","
+	}
+	userIds = strings.Trim(userIds, ",")
+
 	if eids != "" {
-		where = where + " and (f.CreateUserId= " + utils.ToStr(this.User.Id) + " or a.EquipmentId in (" + eids + "))"
+		where = where + " and (f.CreateUserId in (" + userIds + ")" + " or a.EquipmentId in (" + eids + "))"
 	} else {
-		where = where + "and f.CreateUserId= " + utils.ToStr(this.User.Id)
+		where = where + "and f.CreateUserId in (" + userIds + ")"
 	}
+	//	if eids != "" {
+	//		where = where + " and (f.CreateUserId= " + utils.ToStr(this.User.Id) + " or a.EquipmentId in (" + eids + "))"
+	//	} else {
+	//		where = where + "and f.CreateUserId= " + utils.ToStr(this.User.Id)
+	//	}
 
 	sampleCode := this.GetString("SampleCode")
 	if sampleCode != "" {

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

@@ -394,11 +394,11 @@
       },
       handleSizeChange(val) {
         this.size = val
-        this.currpage = 1
+        this.currentPage = 1
         this.initdata()
       },
       handleCurrentChange(val) {
-        this.currpage = val
+        this.currentPage = val
         this.initdata()
       },
       jstimehandle(val) {

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

@@ -394,11 +394,11 @@
       },
       handleSizeChange(val) {
         this.size = val
-        this.currpage = 1
+        this.currentPage = 1
         this.initdata()
       },
       handleCurrentChange(val) {
-        this.currpage = val
+        this.currentPage = val
         this.initdata()
       },
       jstimehandle(val) {

+ 0 - 1
src/dashoo.cn/frontend_web/src/pages/report/samples/samplesstoredbydate.vue

@@ -311,7 +311,6 @@
       getequipment() {
         this.$axios.get('/equipment/elist', {})
           .then(res => {
-            // response
             for (var i = 0; i < res.data.items.length / 2; i++) {
               this.equipmentlist.push({
                 label: res.data.items[2 * i],