浏览代码

分组 按钮权限

lining 6 年之前
父节点
当前提交
3dbc65e225

+ 53 - 18
src/dashoo.cn/backend/api/controllers/lims/limsdataentry.go

@@ -35,6 +35,7 @@ import (
 	"dashoo.cn/backend/api/business/workflow"
 	"dashoo.cn/business2/organize"
 	"dashoo.cn/business2/userRole"
+	userRole2 "dashoo.cn/business_lims/userRole"
 
 	"os"
 
@@ -237,10 +238,16 @@ func (this *LimsDataEntryController) GetToDoList() {
 	rsvc.GetAuditStepRoleEntity(OilAuditSettingName, this.User.DepartmentId, workflow.DATAAUDIT, &RoleSet)
 	//processInstanceId = svcActiviti.GetMyTasks(RoleSet.WorkFlowCord, this.User.Id)
 	//查出所有的待办和已办任务
+	where := " 1=1 "
 	if len(queryTaskStatus) <= 0 { //保留原来的功能
 		processInstanceId = svcActiviti.GetMyTasks(RoleSet.WorkFlowCord, this.User.Id)
 	} else if queryTaskStatus == "1" { //待办
 		processInstanceId = svcActiviti.GetMyTasks(RoleSet.WorkFlowCord, this.User.Id)
+		if len(processInstanceId) > 0  {
+			where += " and a.Id in (" + processInstanceId + ")"
+		} else {
+			where += " and a.Id = 0"
+		}
 	} else if queryTaskStatus == "2" { //已办
 		ListDone = svcActiviti.GetMyFinishedTasksWithTime(RoleSet.WorkFlowCord, this.User.Id)
 
@@ -248,25 +255,29 @@ func (this *LimsDataEntryController) GetToDoList() {
 			processInstanceId = processInstanceId + value.BusinessKey + ","
 		}
 		processInstanceId = strings.Trim(processInstanceId, ",")
+		if len(processInstanceId) > 0  {
+			where += " and a.Id in (" + processInstanceId + ")"
+		} else {
+			where += " and a.Id = 0"
+		}
 	} else {
+		organizeSvc := organize.GetOrganizeService(utils.DBE)
+		departList := organizeSvc.GetChildByTopId(this.User.DepartmentId)
+		//取出当前部门及下级部门的所有用户列表
+		var subUserList []userRole.Base_User
+		whereUser := " 1=1 "
+		whereUser += " and DepartmentId in (" + departList + ")"
+		svc.GetEntities(&subUserList, whereUser)
+		var userIds string
+
+		for _, tmpUser := range subUserList {
+			userIds += strconv.Itoa(tmpUser.Id) + ","
+		}
+		userIds = strings.Trim(userIds, ",")
 
+		where += " AND a.CreateUserId in (" + userIds + ")"
 	}
-	organizeSvc := organize.GetOrganizeService(utils.DBE)
-	departList := organizeSvc.GetChildByTopId(this.User.DepartmentId)
-	//取出当前部门及下级部门的所有用户列表
-	var subUserList []userRole.Base_User
-	whereUser := " 1=1 "
-	whereUser += " and DepartmentId in (" + departList + ")"
-	svc.GetEntities(&subUserList, whereUser)
-	var userIds string
-
-	for _, tmpUser := range subUserList {
-		userIds += strconv.Itoa(tmpUser.Id) + ","
-	}
-	userIds = strings.Trim(userIds, ",")
 
-	where := " 1=1 "
-	where += " AND a.CreateUserId in (" + userIds + ")"
 
 	//switch this.User.DepartmentId {
 	//case "100000150":
@@ -292,9 +303,7 @@ func (this *LimsDataEntryController) GetToDoList() {
 		orderby = Prop + " " + Order
 	}
 	where += " and b.BalanceStatus <> 0 "
-	if len(processInstanceId) > 0 {
-		where += " and a.Id in (" + processInstanceId + ")"
-	}
+
 	if EntrustNo != "" {
 		where = where + " and b.EntrustNo like '%" + EntrustNo + "%'"
 	}
@@ -4938,6 +4947,32 @@ func (this *LimsDataEntryController) GetEntrustEquipment() {
 
 }
 
+// @Title 获取审批步骤编码
+// @Description
+// @Success	200	{object} controllers.Request
+// @router /getauditstepcode [get]
+func (this *LimsDataEntryController) GetAuditStepCode() {
+	svc := userRole2.GetUserService(utils.DBE)
+	roleofrole := svc.GetUserRoleIds(this.User.Id)
+	rids := ""
+	for _,item := range roleofrole {
+		rids += "," + 	strings.Trim(item, "rid_")
+	}
+	rids = strings.Trim(rids, ",")
+	var roleSet []auditsetting.Base_OilAuditSetting
+	svcr := auditsetting.GetOilAuditSettingService(utils.DBE)
+	where := "RoleId IN (" + rids + ")"
+	svcr.GetEntities(&roleSet, where)
+	stepCode := ""
+	for _,item := range roleSet {
+		stepCode += "," + item.AuditStepCode
+	}
+	stepCode = strings.Trim(stepCode, ",")
+	this.Data["json"] = stepCode
+	this.ServeJSON()
+
+}
+
 func (this *LimsDataEntryController) adddataentrydetail(entrustmainId, dataentryid, balanceid int, positionCheckId, entrustNo,templatecode, AccCode string) error {
 	var err error
 	svc := limsdataentry.GetLimsDataEntryService(utils.DBE)

+ 57 - 15
src/dashoo.cn/frontend_web/src/pages/lims/checkequipmentlist/index.vue

@@ -52,10 +52,21 @@
                            placeholder="按设备分类查询"
                            @change="ProjectTypeChangeHandler"
                            @clear="ProjectTypeClearHandler">
-                  <el-option v-for="item in projectTypeList"
-                             :key="item.id"
-                             :label="item.FullName"
-                             :value="item.Id"></el-option>
+                  <el-option-group
+                    v-for="group in options"
+                    :key="group.label"
+                    :label="group.label">
+                    <el-option
+                      v-for="item in group.options"
+                      :key="item.Id"
+                      :label="item.FullName"
+                      :value="item.Id">
+                    </el-option>
+                  </el-option-group>
+                  <!--<el-option v-for="item in projectTypeList"-->
+                             <!--:key="item.id"-->
+                             <!--:label="item.FullName"-->
+                             <!--:value="item.Id"></el-option>-->
                 </el-select>
               </el-form-item>
 
@@ -279,10 +290,21 @@
                      filterable
                      placeholder="请选择"
                      @change="changeDetectionCycle">
-            <el-option v-for="item in projectTypeList"
-                       :key="item.id"
-                       :label="item.FullName"
-                       :value="item.Id"></el-option>
+            <!--<el-option v-for="item in projectTypeList"-->
+                       <!--:key="item.id"-->
+                       <!--:label="item.FullName"-->
+                       <!--:value="item.Id"></el-option>-->
+            <el-option-group
+              v-for="group in options"
+              :key="group.label"
+              :label="group.label">
+              <el-option
+                v-for="item in group.options"
+                :key="item.Id"
+                :label="item.FullName"
+                :value="item.Id">
+              </el-option>
+            </el-option-group>
           </el-select>
         </el-form-item>
         <el-form-item label="安装地点"
@@ -327,12 +349,13 @@
                        placeholder="请选择"
                        style="width: 85px"
                        disabled>
-              <el-option label="年"
-                         value="年"></el-option>
-              <el-option label="月"
-                         value="月"></el-option>
-              <el-option label="天"
-                         value="天"></el-option>
+              <template slot="append">{{formData.CycleUnit}}</template>
+              <!--<el-option label="年"-->
+                         <!--value="年"></el-option>-->
+              <!--<el-option label="月"-->
+                         <!--value="月"></el-option>-->
+              <!--<el-option label="天"-->
+                         <!--value="天"></el-option>-->
             </el-select>
           </el-input>
         </el-form-item>
@@ -557,7 +580,26 @@ export default {
         children: 'children'
       },
       customerForm: [],
-      CustomerId: 0
+      CustomerId: 0,
+      options: [{
+        label: '特检',
+        options: [
+          {Id: 179, FullName: '电气接地装置检测'},
+          {Id: 286, FullName: '防雷装置检测'},
+          {Id: 187, FullName: '防雷装置(等电位)检测'},
+          {Id: 181, FullName: '漏电保护器检测'}
+        ]
+      }, {
+        label: '宇信',
+        options: [
+          {Id: 156, FullName: '阻火器检测'},
+          {Id: 183, FullName: '呼吸阀检测'},
+          {Id: 154, FullName: '液压安全阀检测'},
+          {Id: 189, FullName: '空气泡沫产生器检测'},
+          {Id: 141, FullName: '游梁式抽油机检测'},
+          {Id: 173, FullName: '无游梁式抽油机检测'}
+        ]
+      }],
     }
   },
   created () {

+ 50 - 0
src/dashoo.cn/frontend_web/src/pages/lims/dataentry/tasktodo2.vue

@@ -331,6 +331,7 @@
     },
     data () {
       return {
+        tjz: false,
         tableLoading: true,
         queryTaskStatus: 0,
         // dialogdataentryhistoryVisible: false,
@@ -365,12 +366,14 @@
         dataentryid: 0,
         DataEntryId: 0,
         currentdate: '',
+        stepcode: '',
         detailList: [],
         taskbalacelist: [],
         selectSamples: [],
         docTemplateDictList: [],
         tableColumns2: [],
         dataentryhistorylist: [],
+        departmentList: [],
         currentItemCount: 0,
         historycurrentItemCount: 0,
         historycurrentPage: 1,
@@ -433,10 +436,12 @@
       }
     },
     created () {
+      this.departmentId = this.authUser.Profile.DepartmentId
       // this.initData()
       this.getDictList()
       this.getDetaillist() // 检测明细项下拉
       this.initdata2()
+      this.getAuditStepCode()
     },
     watch: {
       $route (val) {
@@ -444,6 +449,51 @@
       }
     },
     methods: {
+      isShow (status, code) {
+        if (this.tjz) {
+
+        } else {
+          if (status === 1) {
+            return this.stepcode.indexOf(code) !== -1
+          } else if (status === 2) {
+            return this.stepcode.indexOf(code) !== -1
+          } else if (status === 4) {
+            return this.stepcode.indexOf(code) !== -1
+          } else {
+            return false
+          }
+        }
+      },
+      getAuditStepCode () {
+        let params = {
+
+        }
+        this.$axios.get('/limsdataentry/getauditstepcode', {
+          params
+        }).then(res => {
+          this.stepcode = res.data
+          console.log(this.stepcode)
+        })
+          .catch(err => {
+            console.error(err)
+          })
+      },
+      // 判断组织结构确定流程
+      getOrganizeListById () {
+        this.$axios.get('/limsentrust/getstyle')
+          .then(
+            function (response) {
+              this.departmentList = response.data.items
+              let arr = this.departmentList.split(',')
+              for (var i = 0; i < arr.length; i++) {
+                if (this.departmentId == arr[i]) {
+                  this.tjz = true
+                }
+              }
+            }).catch(function (error) {
+              console.log(error)
+        })
+      },
       // 添加数据录入记录
       adddataentry () {
         this.getpartuserlist()

+ 31 - 1
src/dashoo.cn/frontend_web/src/pages/lims/taskplan/_opera/operation.vue

@@ -38,7 +38,18 @@
             <el-form-item label="检测项目" prop="ProjectTypeId">
               <el-select ref="refProjectTypeId" v-model="mainForm.ProjectTypeId" @change="SampleTypeChangeHandler"
                          style="width:100%" filterable placeholder="请选择">
-                <el-option v-for="item in projectTypeList" :key="item.id" :label="item.FullName" :value="item.Id"></el-option>
+                <!--<el-option v-for="item in projectTypeList" :key="item.id" :label="item.FullName" :value="item.Id"></el-option>-->
+                <el-option-group
+                  v-for="group in options"
+                  :key="group.label"
+                  :label="group.label">
+                  <el-option
+                    v-for="item in group.options"
+                    :key="item.Id"
+                    :label="item.FullName"
+                    :value="item.Id">
+                  </el-option>
+                </el-option-group>
               </el-select>
             </el-form-item>
           </el-col>
@@ -441,6 +452,25 @@
         status_flag: false,
         deliverShow: false,
         deliverList: [],
+        options: [{
+          label: '特检',
+          options: [
+            {Id: 179, FullName: '电气接地装置检测'},
+            {Id: 286, FullName: '防雷装置检测'},
+            {Id: 187, FullName: '防雷装置(等电位)检测'},
+            {Id: 181, FullName: '漏电保护器检测'}
+          ]
+        }, {
+          label: '宇信',
+          options: [
+            {Id: 156, FullName: '阻火器检测'},
+            {Id: 183, FullName: '呼吸阀检测'},
+            {Id: 154, FullName: '液压安全阀检测'},
+            {Id: 189, FullName: '空气泡沫产生器检测'},
+            {Id: 141, FullName: '游梁式抽油机检测'},
+            {Id: 173, FullName: '无游梁式抽油机检测'}
+          ]
+        }],
         deliverTitle: '',
         deliver_flag: '',
         // 分页参数