Răsfoiți Sursa

角色管理,用户列表查看本部门

huahaiyan 6 ani în urmă
părinte
comite
87a466f7d1

+ 18 - 4
src/dashoo.cn/backend/api/controllers/casbin/role.go

@@ -102,12 +102,19 @@ func (this *RoleController) GetAuditerByDept() {
 	var users []userRole.Base_RoleList
 	rsvc := auditsetting.GetOilAuditSettingService(utils.DBE)
 	organsvc := organize.GetOrganizeService(utils.DBE)
-	depids := organsvc.GetChildByTopId(Id)
-	where := "DepartmentId in (" + depids + ")"
+	where := "1=1"
+	//判断超级管理员和有查看所有数据权限的用户
+	svcPerm := permission.GetPermissionService(utils.DBE)
+	isauth := svcPerm.IsAuthorized(this.User.Id, "oil_supplier.marketAccess.AllRecord")
+	if !svcPerm.IsAdmin(this.User.Id) && !isauth {
+		depids := organsvc.GetChildByTopId(Id)
+		where += " and DepartmentId in (" + depids + ")"
+	}else {
+		depids := organsvc.GetChildByTopId("0")
+		where += " and DepartmentId in (" + depids + ")"
+	}
 	where += " and IsCompanyUser = 0"
-	//where := "DepartmentId = " + Id
 	rsvc.GetEntitysByWhere(BaseUserName, where, &users)
-
 	var datainfo ErrorDataInfo
 	if users == nil {
 		datainfo.Code = 0
@@ -505,6 +512,12 @@ func (this *RoleController) GetUsersForRole() {
 	if keyword != "" {
 		where = where + " and Realname like '%" + keyword + "%'"
 	}
+	//判断超级管理员和有查看所有数据权限的用户
+	svcPerm := permission.GetPermissionService(utils.DBE)
+	isauth := svcPerm.IsAuthorized(this.User.Id, "oil_supplier.marketAccess.AllRecord")
+	if !svcPerm.IsAdmin(this.User.Id) && !isauth {
+		where += " and Unit = '" + this.User.Uint+"'"
+	}
 	total, users := svc.GetUserListForRole(page.CurrentPage, page.Size, roleid, "Id", where)
 
 	var datainfo DataInfo
@@ -528,6 +541,7 @@ func (this *RoleController) UserRoleAddUser() {
 	for i := 0; i < len(userids); i++ {
 		if userids[i] != "0" && userids[i] != "" {
 			//err = svc.AddUserToRole(userid, roleids[i], entity[0])
+			//utils.RBAC.GetUsersForRoleInDomain("rid_"+roleid, utils.DOMAIN)
 			utils.RBAC.DeleteRoleForUserInDomain("uid_"+userids[i], "rid_"+roleid, utils.DOMAIN)
 			utils.RBAC.AddRoleForUserInDomain("uid_"+userids[i], "rid_"+roleid, utils.DOMAIN)
 		}

+ 2 - 1
src/dashoo.cn/backend/api/controllers/oilsupplier/infochange.go

@@ -1140,11 +1140,12 @@ func (this *InfoChangeController) InfoAudit() {
 	if dataother.SuccessStatus == 1 {
 		ActiComplete.Result = "1"
 		receiveVal := svcActiviti.TaskComplete(ActiComplete)
-		infomodel.Status = status
+
 		if infomodel.Status == suppliercert.CENT_AUDIT_STATUS {
 			//信息更新
 			var infochangeitemmodel infochange.OilInfoChangeItem
 			infochangeitemmodel.ChangeStatus = 1
+			infomodel.Status = status
 			itemswhere := "InfoId = " + utils.ToStr(infoid)
 			myerr = svc.UpdateEntityBywheretbl(OilInfoChangeItemName, &infochangeitemmodel, []string{"ChangeStatus"}, itemswhere)
 			myerr = this.updatesupplier(dataother.SuppId, infoitems, infomodel)

+ 10 - 2
src/dashoo.cn/backend/api/controllers/oilsupplier/suppliercertappend.go

@@ -5,6 +5,7 @@ import (
 	"dashoo.cn/backend/api/business/auditsetting"
 	"dashoo.cn/backend/api/business/oilsupplier/suppliercertsub"
 	"dashoo.cn/backend/api/business/organize"
+	"dashoo.cn/backend/api/business/register"
 	"dashoo.cn/business2/parameter"
 	"dashoo.cn/business2/userRole"
 	"encoding/json"
@@ -149,16 +150,23 @@ func (this *OilSupplierCertAppendController) GetEntityById() {
 // @router /getsupplier [get]
 func (this *OilSupplierCertAppendController) GetSupplier() {
 	SuppTypeCode := this.GetString("SuppTypeCode")
+	svc := suppliercertappend.GetOilSupplierCertAppendService(utils.DBE)
 	where := "1=1 "
 	if SuppTypeCode != "" {
 		where = " WHERE b.Id is NOT NULL AND a.SupplierTypeCode = '" + SuppTypeCode + "' and a.InFlag='1'"
 	}else {
 		where = " WHERE b.Id is NOT NULL AND a.InFlag='1'"
 	}
+	var registerUser register.OilCorporateInfo
+	sql := " UserName='" + this.User.Username + "'"
+	svc.GetEntity(&registerUser,sql)
+	//企业用户必须加创建人条件
 	if this.User.IsCompanyUser == 1 {
-		where = where + " and b.CreateUserId = '" + this.User.Id + "'"
+		where = where + " and (b.CreateUserId = '" + this.User.Id + "' or b.CommercialNo='"+registerUser.CommercialNo+"')"
+	//if this.User.IsCompanyUser == 1 {
+	//	where = where + " and b.CreateUserId = '" + this.User.Id + "'"
 	}
-	svc := suppliercertappend.GetOilSupplierCertAppendService(utils.DBE)
+
 	sqlStr := "SELECT b.Id AS SupplierId, a.Id AS SupplierCertId, b.SupplierName AS SupplierName FROM OilSupplierCert AS a LEFT JOIN OilSupplier AS b ON a.SupplierId = b.Id "
 	sqlStr = sqlStr + where
 

+ 5 - 2
src/dashoo.cn/frontend_web/src/pages/oilsupplier/infochangech/_opera/operation.vue

@@ -99,8 +99,8 @@
 
               <el-col :span="8">
                 <el-form-item label="中石油准入证编号">
-                  <el-input v-model="formData.PACNumber" maxlength="255" :readonly="true" placeholder="请输入"
-                    :class="getchange('PACNumber') ? 'modified-form-input' : ''" style="width: 100%">
+                  <el-input v-model="formData.OilCertificateNo" maxlength="255" :readonly="true" placeholder="请输入"
+                    :class="getchange('OilCertificateNo') ? 'modified-form-input' : ''" style="width: 100%">
                   </el-input>
                 </el-form-item>
               </el-col>
@@ -780,6 +780,7 @@
           LinkZipCode: '',
           QualitySystemCert: '',
           ProductQualityCert: '',
+          AgentManufacturer: '',
           MaunLicense: '',
           QualifCert: '',
           QualifCertLevel: '',
@@ -1120,6 +1121,7 @@
       comparevalue(newValue) {
         let _this = this
         _this.infochangeItemList = []
+        console.log("-newValue----",newValue)
         _.forEach(newValue, function (value, key) {
           if (_this.copyformdata[key] != value) {
             _this.infochangeForm = {}
@@ -1129,6 +1131,7 @@
             _this.infochangeItemList.push(_this.infochangeForm)
           }
         })
+        console.log("==this.infochangeItemList==",this.infochangeItemList)
       },
       openDialog(val) {
         this.Title = '资质变更'

+ 1 - 1
src/dashoo.cn/frontend_web/src/pages/oilsupplier/infochangech/index.vue

@@ -61,7 +61,7 @@
               <span v-if="scope.row.Status=='-2'" style="color:#F56C6C">复审未通过</span>
               <span v-if="scope.row.Status=='3'" style="color:#E6A23C">待法规处审核</span>
               <span v-if="scope.row.Status=='-5'" style="color:#F56C6C">审核未通过</span>
-              <span v-if="scope.row.Status=='4'" style="color:#67C23A">审核通过</span>
+              <span v-if="scope.row.Status=='11'" style="color:#67C23A">审核通过</span>
             </template>
           </el-table-column>
           <el-table-column prop="ConmmitTime" sortable min-width="100" label="申请日期" align="center"

+ 5 - 4
src/dashoo.cn/frontend_web/src/pages/system/userrole.vue

@@ -85,10 +85,10 @@
     <el-dialog title="包含用户列表" :visible.sync="userDialogVisible">
       <el-button type="primary" size="mini" style="float: right; margin-top: -10px;margin-left :5px"
         @click="deleteuserdataall()">删除所有关联用户</el-button>
-      <el-button type="primary" size="mini" style="float: right; margin-top: -10px" v-if="adminpermission == 0"
+      <!-- <el-button type="primary" size="mini" style="float: right; margin-top: -10px" v-if="adminpermission == 0"
         @click="roleadduser()">添加
-      </el-button>
-      <el-button type="primary" size="mini" style="float: right; margin-top: -10px" v-if="adminpermission == 1"
+      </el-button> -->
+      <el-button type="primary" size="mini" style="float: right; margin-top: -10px"
         @click="roleadduseradmin()">添加
       </el-button>
       <br />
@@ -119,7 +119,7 @@
       </div>
     </el-dialog>
     <!-- 超级添加用户 -->
-    <el-dialog title="添加用户" :visible="adminadduser" top="5vh" width="800px">
+    <el-dialog title="添加用户" :visible.sync="adminadduser" top="5vh" width="800px">
       <el-form label-width="110px">
         <el-row :gutter="10">
           <el-col :span="12">
@@ -525,6 +525,7 @@
       },
       roleadduseradmin() {
         this.getorgtreelist()
+        this.selectedOptions=[]
         this.adminadduser = true
       },
       roleadduser() {