Forráskód Böngészése

年审审批工作流

huahaiyan 6 éve
szülő
commit
967c7cc017

+ 213 - 163
src/dashoo.cn/backend/api/controllers/oilsupplier/annualaudit.go

@@ -1,6 +1,12 @@
 package oilsupplier
 
 import (
+	"dashoo.cn/backend/api/business/baseUser"
+	"dashoo.cn/backend/api/business/organize"
+	"dashoo.cn/business2/areajson"
+	"dashoo.cn/business2/items"
+
+	"dashoo.cn/backend/api/business/auditsetting"
 	"encoding/json"
 	"fmt"
 	"strconv"
@@ -11,8 +17,7 @@ import (
 	"dashoo.cn/backend/api/business/oilsupplier/supplier"
 	"dashoo.cn/backend/api/business/workflow"
 
-	"dashoo.cn/backend/api/business/baseUser"
-	"dashoo.cn/business/userRole"
+	"dashoo.cn/business2/userRole"
 
 	. "dashoo.cn/backend/api/controllers"
 	"dashoo.cn/utils"
@@ -180,22 +185,47 @@ func (this *AnnualAuditController) GetSupplierList() {
 // @router /dictlist [get]
 func (this *AnnualAuditController) GetDictList() {
 	dictList := make(map[string]interface{})
-	//dictSvc := items.GetItemsService(utils.DBE)
+	dictSvc := items.GetItemsService(utils.DBE)
 	userSvc := baseUser.GetBaseUserService(utils.DBE)
+	areaJsonSvc := areajson.GetAreaJsonService(utils.DBE)
 	//customerSvc := svccustomer.GetCustomerService(utils.DBE)
-	//dictList["WellNo"] = dictSvc.GetKeyValueItems("WellNo", "")
+	dictList["UnitRelation"] = dictSvc.GetKeyValueItems("UnitRelation")
+	dictList["CompanyType"] = dictSvc.GetKeyValueItems("CompanyType")
 	var userEntity userRole.Base_User
 	userSvc.GetEntityById(this.User.Id, &userEntity)
-	dictList["Supervisers"] = userSvc.GetUserListByDepartmentId("", userEntity.Departmentid)
-
-	//var dictCustomer []svccustomer.Customer
-	//customerSvc.GetEntitysByWhere("" + CustomerName, "", &dictCustomer)
-	//dictList["EntrustCorp"] = &dictCustomer
-
+	dictList["Supervisers"] = userSvc.GetUserListByDepartmentId(this.User.AccCode, userEntity.Departmentid)
+	dictList["GaodeMapChinaAreas"] = areaJsonSvc.GetGaodeMapChinaAreas()
+	//获取我创建的所有公司
+	var list []supplier.OilSupplier
+	if this.User.IsCompanyUser == 1 {
+		svcSupplier := supplier.GetOilSupplierService(utils.DBE)
+		supplierWhere := " CreateUserId = '" + this.User.Id + "'"
+		svcSupplier.GetEntitysByWhere(OilSupplierName, supplierWhere, &list)
+		dictList["CompanyNames"] = list
+	} else { //二级单位不用获取
+		dictList["CompanyNames"] = list
+	}
+	// 部门
+	orgsvc := organize.GetOrganizeService(utils.DBE)
+	dictList["Organizes"] = orgsvc.GetCollectionDetailviewlist("'"+this.User.AccCode+"'")
+	//获得有专业审核接收权限的人员
+	var users1 []userRole.Base_RoleList
+	var auditWorkflow1 auditsetting.Base_OilAuditSetting
+	rsvc := auditsetting.GetOilAuditSettingService(utils.DBE)
+	rsvc.GetAuditStepRoleEntity(OilAuditSettingName, "100000172", workflow.PROF_RECE, &auditWorkflow1)
+	users1 = rsvc.GetUserByRole(strconv.Itoa(auditWorkflow1.RoleId), "")
+	dictList["Receive"] = users1
+	//获得有专业审核权限的人员
+	var users []userRole.Base_RoleList
+	var auditWorkflow auditsetting.Base_OilAuditSetting
+	rsvc.GetAuditStepRoleEntity(OilAuditSettingName, "100000172", workflow.PROF_AUDIT, &auditWorkflow)
+	users = rsvc.GetUserByRole(strconv.Itoa(auditWorkflow.RoleId), "")
+	dictList["ProfAudit"] = users
 	var datainfo DataInfo
 	datainfo.Items = dictList
 	this.Data["json"] = &datainfo
 	this.ServeJSON()
+
 }
 
 // @Title 获取实体
@@ -222,6 +252,7 @@ func (this *AnnualAuditController) AddEntity() {
 	var errinfo ErrorDataInfo
 	var jsonBlob = this.Ctx.Input.RequestBody
 	svc := annualaudit.GetOilAnnualAuditService(utils.DBE)
+	firstAudit := this.GetString("firstAudit")
 	json.Unmarshal(jsonBlob, &model)
 	where := "SupplierId = " + utils.ToStr(model.SupplierId) + " and SupplierTypeName = " + model.SupplierTypeName
 	var auditentity []annualaudit.OilAnnualAudit
@@ -250,22 +281,43 @@ func (this *AnnualAuditController) AddEntity() {
 	model.CerId = suppliermodel.CertId
 	model.Status = 0
 	model.BackReason = suppliermodel.BackReason
-	//svc.GetEntitysByWhere(""+OilSupplierName, supwhere, &supplierlist)
 	model.CreateOn = time.Now()
 	model.CreateBy = this.User.Realname
 	model.CreateUserId, _ = utils.StrTo(this.User.Id).Int()
-	//model.OrganizeId, _ = utils.StrTo(this.User.DepartmentId).Int()
+	//添加一条年审记录
 	_, err := svc.InsertEntityBytbl(""+OilAnnualAuditName, &model)
 	annualId := model.Id
-	//工作流开始
-	processInstanceId, res := svc.SubmitOrgAudit("", model.WorkflowId, utils.ToStr(model.CerId), utils.ToStr(model.Id), workflow.OIL_AUDIT_APPLY, workflow.FIRST_TRIAL, this.User.Id, "1", "提交给二级单位初审", OilSupplierCertSubName, OilClassOrgSettingName)
+	svcActiviti := workflow.GetActivitiService(utils.DBE)
+	//启动工作流
+	processInstanceId := svcActiviti.StartProcess(workflow.OIL_AUDIT_APPLY, utils.ToStr(annualId), this.User.Id)
+	//获得有审核权限的人员
+	var users []userRole.Base_RoleList
+	var userIds string
+	var auditWorkflow auditsetting.Base_OilAuditSetting
+	rsvc := auditsetting.GetOilAuditSettingService(utils.DBE)
+	rsvc.GetAuditStepRoleEntity(OilAuditSettingName, firstAudit, workflow.FIRST_TRIAL, &auditWorkflow)
+	users = rsvc.GetUserByRole(strconv.Itoa(auditWorkflow.RoleId), "")
+	for _, tmpUser := range users {
+		userIds += strconv.FormatInt(tmpUser.Id, 10) + ","
+	}
+	userIds = strings.Trim(userIds, ",")
+	var ActiComplete workflow.ActiCompleteVM
+	ActiComplete.ProcessKey = workflow.OIL_AUDIT_APPLY
+	ActiComplete.BusinessKey = strconv.Itoa(annualId)
+	ActiComplete.UserNames = userIds
+	ActiComplete.UserId = this.User.Id
+	ActiComplete.Result = "1"
+	ActiComplete.Remarks = "提交给二级单位初审"
+	ActiComplete.CallbackUrl = ""
+	//提交给二级单位初审
+	receiveVal := svcActiviti.TaskComplete(ActiComplete)
 	var auditmodel annualaudit.OilAnnualAudit
 	auditmodel.WorkflowId = processInstanceId
 	cols := []string{
 		"Id",
 		"WorkflowId",
 	}
-	if res == "true" {
+	if receiveVal == "true" {
 		_, err = svc.UpdateEntityByIdCols(annualId, auditmodel, cols)
 		if err == nil {
 			//新增
@@ -289,83 +341,6 @@ func (this *AnnualAuditController) AddEntity() {
 
 }
 
-// @Title 修改实体
-// @Description 修改实体
-// @Success	200	{object} controllers.Request
-// @router /update/:id [post]
-func (this *AnnualAuditController) UpdateEntity() {
-	id := this.Ctx.Input.Param(":id")
-	var errinfo ErrorInfo
-	if id == "" {
-		errinfo.Message = "操作失败!请求信息不完整"
-		errinfo.Code = -2
-		this.Data["json"] = &errinfo
-		this.ServeJSON()
-		return
-	}
-
-	var model annualaudit.OilAnnualAudit
-	svc := annualaudit.GetOilAnnualAuditService(utils.DBE)
-
-	var jsonBlob = this.Ctx.Input.RequestBody
-	json.Unmarshal(jsonBlob, &model)
-	model.ModifiedOn = time.Now()
-	model.ModifiedBy = this.User.Realname
-	model.ModifiedUserId, _ = utils.StrTo(this.User.Id).Int()
-
-	cols := []string{
-
-		"Id",
-
-		"Code",
-
-		"Name",
-
-		"F01",
-
-		"F02",
-
-		"F03",
-
-		"F04",
-
-		"F05",
-
-		"F06",
-
-		"F07",
-
-		"F25",
-
-		"Remark",
-
-		"DeletionStateCode",
-
-		"CreateOn",
-
-		"CreateUserId",
-
-		"CreateBy",
-
-		"ModifiedOn",
-
-		"ModifiedUserId",
-
-		"ModifiedBy",
-	}
-	err := svc.UpdateEntityBytbl(""+OilAnnualAuditName, id, &model, cols)
-	if err == nil {
-		errinfo.Message = "修改成功!"
-		errinfo.Code = 0
-		this.Data["json"] = &errinfo
-		this.ServeJSON()
-	} else {
-		errinfo.Message = "修改失败!" + utils.AlertProcess(err.Error())
-		errinfo.Code = -1
-		this.Data["json"] = &errinfo
-		this.ServeJSON()
-	}
-}
 
 // @Title 删除单条信息
 // @Description
@@ -400,36 +375,6 @@ func (this *AnnualAuditController) DeleteEntity() {
 	}
 }
 
-// @Title 基建类业务
-// @Description get user by token
-// @Success 200 {object} models.Userblood
-// @router /basiclist [get]
-func (this *AnnualAuditController) BasicList() {
-	page := this.GetPageInfoForm()
-	var list []annualaudit.OilAnnualAudit
-	svc := annualaudit.GetOilAnnualAuditService(utils.DBE)
-	where := " 1=1"
-	orderby := "Id"
-	asc := false
-	Order := this.GetString("Order")
-	Prop := this.GetString("Prop")
-	if Order != "" && Prop != "" {
-		orderby = Prop
-		if Order == "asc" {
-			asc = true
-		}
-	}
-	keyword := this.GetString("keyword")
-	if keyword != "" {
-		where = where + " and Name like '%" + keyword + "%'"
-	}
-	total := svc.GetPagingEntitiesWithoutAccCode(page.CurrentPage, page.Size, orderby, asc, &list, where)
-	var datainfo DataInfo
-	datainfo.Items = list
-	datainfo.CurrentItemCount = total
-	this.Data["json"] = &datainfo
-	this.ServeJSON()
-}
 
 // @Title 审核
 // @Description 审核
@@ -446,39 +391,65 @@ func (this *AnnualAuditController) AuditCallback() {
 	var errinfo ErrorInfo
 	var cols []string = []string{"Status"}
 	entityempty.Status, _ = strconv.Atoi(status)
-	err = svc.UpdateEntityBytbl(OilAnnualAuditName,annualId,&entityempty,cols)
+	err = svc.UpdateEntityBytbl(OilAnnualAuditName, annualId, &entityempty, cols)
 	if err != nil {
 		errinfo.Message = "审核错误!"
 		errinfo.Code = -1
 		this.Data["json"] = &errinfo
 		this.ServeJSON()
 	}
-	fmt.Println(result,status,annualId,bussinsid)
+	fmt.Println(result, status, annualId, bussinsid)
 }
 
 // @Title 审核
 // @Description 审核
 // @Success	200	{object} controllers.Request
-// @router /auditfirst/ [put]
-func (this *AnnualAuditController) QianfaReport() {
+// @router /auditfirst [put]
+func (this *AnnualAuditController) AnnualAudit() {
 	svc := annualaudit.GetOilAnnualAuditService(utils.DBE)
 	var jsonblob = this.Ctx.Input.RequestBody
 	var dataother ShenHeModel
+	ProfAudit:= this.GetString("ProfAudit")
 	json.Unmarshal(jsonblob, &dataother)
 	var list annualaudit.OilAnnualAudit
 	where := " Id = '" + strconv.Itoa(dataother.AnnualId) + "'"
 	svc.GetEntityByWhere(""+OilAnnualAuditName, where, &list)
+	svcActiviti := workflow.GetActivitiService(utils.DBE)
 	//审核状态判断进行的操作
 	if dataother.SuccessStatus == 1 {
 		var errinfo ErrorInfo
 		//提交审核工作流
-		processInstanceId, res := svc.SubmitOrgAudit(utils.ToStr(dataother.SuccessStatus), list.WorkflowId, utils.ToStr(list.CerId), utils.ToStr(list.Id), workflow.OIL_AUDIT_APPLY, workflow.PROF_AUDIT, this.User.Id, "1", "提交给业务处室专业审核", OilSupplierCertSubName, OilClassOrgSettingName)
-		fmt.Println(processInstanceId)
-		if res == "true" {
-			errinfo.Message = "审核通过!"
-			errinfo.Code = 0
-			this.Data["json"] = &errinfo
-			this.ServeJSON()
+		//processInstanceId, res := svc.SubmitOrgAudit(utils.ToStr(dataother.SuccessStatus), list.WorkflowId, utils.ToStr(list.CerId), utils.ToStr(list.Id), workflow.OIL_AUDIT_APPLY, workflow.PROF_AUDIT, this.User.Id, "1", "提交给业务处室专业审核", OilSupplierCertSubName, OilClassOrgSettingName)
+		//fmt.Println(processInstanceId)
+		var ActiComplete workflow.ActiCompleteVM
+		ActiComplete.ProcessKey = workflow.OIL_AUDIT_APPLY
+		ActiComplete.BusinessKey = strconv.Itoa(dataother.AnnualId)
+		ActiComplete.UserNames = ProfAudit
+		ActiComplete.UserId = this.User.Id
+		ActiComplete.Result = "1"
+		ActiComplete.Remarks = "提交给业务处接收人"
+		ActiComplete.CallbackUrl = ""
+		//提交给二级单位初审
+		receiveVal := svcActiviti.TaskComplete(ActiComplete)
+		var auditmodel annualaudit.OilAnnualAudit
+		auditmodel.Status = 1
+		cols := []string{
+			"Id",
+			"Status",
+		}
+		if receiveVal == "true" {
+			_, err := svc.UpdateEntityByIdCols(dataother.AnnualId, auditmodel, cols)
+			if err == nil {
+				errinfo.Message = "审核通过!"
+				errinfo.Code = 0
+				this.Data["json"] = &errinfo
+				this.ServeJSON()
+			}else {
+				errinfo.Message = "审核错误!" + utils.AlertProcess(err.Error())
+				errinfo.Code = -1
+				this.Data["json"] = &errinfo
+				this.ServeJSON()
+			}
 		} else {
 			errinfo.Message = "工作流异常,请联系管理员!"
 			errinfo.Code = -1
@@ -488,64 +459,143 @@ func (this *AnnualAuditController) QianfaReport() {
 
 	} else if dataother.SuccessStatus == 2 {
 		var errinfo ErrorInfo
-		//提交审核工作流
-		processInstanceId, res := svc.SubmitOrgAudit(utils.ToStr(dataother.SuccessStatus), list.WorkflowId, utils.ToStr(list.CerId), utils.ToStr(list.Id), workflow.OIL_AUDIT_APPLY, workflow.PROF_AUDIT, this.User.Id, "0", "提交给业务处室专业审核", OilSupplierCertSubName, OilClassOrgSettingName)
-		fmt.Println(processInstanceId)
-		if res == "true" {
-			errinfo.Message = "审核未通过!"
-			errinfo.Code = 0
+		var ActiComplete workflow.ActiCompleteVM
+		ActiComplete.ProcessKey = workflow.OIL_AUDIT_APPLY
+		ActiComplete.BusinessKey = strconv.Itoa(dataother.AnnualId)
+		ActiComplete.UserNames = ""
+		ActiComplete.UserId = this.User.Id
+		ActiComplete.Result = "0"
+		ActiComplete.Remarks = "初审未通过"
+		ActiComplete.CallbackUrl = ""
+		receiveVal := svcActiviti.TaskComplete(ActiComplete)
+		var auditmodel annualaudit.OilAnnualAudit
+		auditmodel.Status = 2
+		cols := []string{
+			"Id",
+			"Status",
+		}
+		if receiveVal == "true" {
+			_, err := svc.UpdateEntityByIdCols(dataother.AnnualId, auditmodel, cols)
+			if err == nil {
+				errinfo.Message = "审核未通过!"
+				errinfo.Code = 0
+				this.Data["json"] = &errinfo
+				this.ServeJSON()
+			}else {
+				errinfo.Message = "审核错误!" + utils.AlertProcess(err.Error())
+				errinfo.Code = -1
+				this.Data["json"] = &errinfo
+				this.ServeJSON()
+			}
+		} else {
+			errinfo.Message = "工作流异常,请联系管理员!"
+			errinfo.Code = -1
 			this.Data["json"] = &errinfo
 			this.ServeJSON()
+		}
+	} 	else if dataother.SuccessStatus == 3 {
+		var errinfo ErrorInfo
+		var ActiComplete workflow.ActiCompleteVM
+		ActiComplete.ProcessKey = workflow.OIL_AUDIT_APPLY
+		ActiComplete.BusinessKey = strconv.Itoa(dataother.AnnualId)
+		ActiComplete.UserNames = ProfAudit
+		ActiComplete.UserId = this.User.Id
+		ActiComplete.Result = "1"
+		ActiComplete.Remarks = "提交给业务处专业审核人"
+		ActiComplete.CallbackUrl = ""
+		//提交给业务处室专业审核
+		receiveVal := svcActiviti.TaskComplete(ActiComplete)
+		var auditmodel annualaudit.OilAnnualAudit
+		auditmodel.Status = 3
+		cols := []string{
+			"Id",
+			"Status",
+		}
+		if receiveVal == "true" {
+			_, err := svc.UpdateEntityByIdCols(dataother.AnnualId, auditmodel, cols)
+			if err == nil {
+				errinfo.Message = "已分配接收人!"
+				errinfo.Code = 0
+				this.Data["json"] = &errinfo
+				this.ServeJSON()
+			}else {
+				errinfo.Message = "分配错误!" + utils.AlertProcess(err.Error())
+				errinfo.Code = -1
+				this.Data["json"] = &errinfo
+				this.ServeJSON()
+			}
 		} else {
 			errinfo.Message = "工作流异常,请联系管理员!"
 			errinfo.Code = -1
 			this.Data["json"] = &errinfo
 			this.ServeJSON()
 		}
-	} else if dataother.SuccessStatus == 3 {
+	} else if dataother.SuccessStatus == 4 {
 		var errinfo ErrorInfo
-		//多实例工作流
-		svcActiviti := workflow.GetActivitiService(utils.DBE)
-		//多实例提交给下一步
 		var ActiComplete workflow.ActiCompleteVM
 		ActiComplete.ProcessKey = workflow.OIL_AUDIT_APPLY
-		ActiComplete.BusinessKey = utils.ToStr(dataother.AnnualId)
+		ActiComplete.BusinessKey = strconv.Itoa(dataother.AnnualId)
 		ActiComplete.UserNames = ""
 		ActiComplete.UserId = this.User.Id
 		ActiComplete.Result = "1"
 		ActiComplete.Remarks = "业务处室审核通过"
-		ActiComplete.CallbackUrl =  utils.Cfg.MustValue("workflow", "callbackHost")+"/api/annualaudit/auditcallback?status="+utils.ToStr(dataother.SuccessStatus) +"&annualId="+ utils.ToStr(dataother.AnnualId)
-		res := svcActiviti.TaskComplete(ActiComplete)
-		if res == "true" {
-			errinfo.Message = "审核通过!"
-			errinfo.Code = 0
-			this.Data["json"] = &errinfo
-			this.ServeJSON()
+		ActiComplete.CallbackUrl = ""
+		receiveVal := svcActiviti.TaskComplete(ActiComplete)
+		var auditmodel annualaudit.OilAnnualAudit
+		auditmodel.Status = 4
+		cols := []string{
+			"Id",
+			"Status",
+		}
+		if receiveVal == "true" {
+			_, err := svc.UpdateEntityByIdCols(dataother.AnnualId, auditmodel, cols)
+			if err == nil {
+				errinfo.Message = "审核通过!"
+				errinfo.Code = 0
+				this.Data["json"] = &errinfo
+				this.ServeJSON()
+			}else {
+				errinfo.Message = "审核错误!" + utils.AlertProcess(err.Error())
+				errinfo.Code = -1
+				this.Data["json"] = &errinfo
+				this.ServeJSON()
+			}
 		} else {
 			errinfo.Message = "工作流异常,请联系管理员!"
 			errinfo.Code = -1
 			this.Data["json"] = &errinfo
 			this.ServeJSON()
 		}
-	} else if dataother.SuccessStatus == 4 {
+	}else if dataother.SuccessStatus == 5 {
 		var errinfo ErrorInfo
-		//多实例工作流
-		svcActiviti := workflow.GetActivitiService(utils.DBE)
-		//多实例提交给下一步
 		var ActiComplete workflow.ActiCompleteVM
 		ActiComplete.ProcessKey = workflow.OIL_AUDIT_APPLY
-		ActiComplete.BusinessKey = utils.ToStr(dataother.AnnualId)
+		ActiComplete.BusinessKey = strconv.Itoa(dataother.AnnualId)
 		ActiComplete.UserNames = ""
 		ActiComplete.UserId = this.User.Id
 		ActiComplete.Result = "0"
 		ActiComplete.Remarks = "业务处室审核未通过"
-		ActiComplete.CallbackUrl =  utils.Cfg.MustValue("workflow", "callbackHost")+"/api/annualaudit/auditcallback?status="+utils.ToStr(dataother.SuccessStatus) +"&annualId="+ utils.ToStr(dataother.AnnualId)
-		res := svcActiviti.TaskComplete(ActiComplete)
-		if res == "true" {
-			errinfo.Message = "审核未通过!"
-			errinfo.Code = 0
-			this.Data["json"] = &errinfo
-			this.ServeJSON()
+		ActiComplete.CallbackUrl = ""
+		receiveVal := svcActiviti.TaskComplete(ActiComplete)
+		var auditmodel annualaudit.OilAnnualAudit
+		auditmodel.Status = 5
+		cols := []string{
+			"Id",
+			"Status",
+		}
+		if receiveVal == "true" {
+			_, err := svc.UpdateEntityByIdCols(dataother.AnnualId, auditmodel, cols)
+			if err == nil {
+				errinfo.Message = "审核未通过!"
+				errinfo.Code = 0
+				this.Data["json"] = &errinfo
+				this.ServeJSON()
+			}else {
+				errinfo.Message = "审核错误!" + utils.AlertProcess(err.Error())
+				errinfo.Code = -1
+				this.Data["json"] = &errinfo
+				this.ServeJSON()
+			}
 		} else {
 			errinfo.Message = "工作流异常,请联系管理员!"
 			errinfo.Code = -1

+ 2 - 2
src/dashoo.cn/frontend_web/src/api/oilsupplier/annualaudit.js

@@ -44,9 +44,9 @@ export default {
       method: 'GET'
     })
   },
-  addEntity (formData, myAxios) {
+  addEntity (formData, FirstAudit, myAxios) {
     return myAxios({
-      url: '/annualaudit/add',
+      url: '/annualaudit/add?firstAudit=' + FirstAudit,
       method: 'post',
       data: formData
     })

+ 87 - 21
src/dashoo.cn/frontend_web/src/pages/oilsupplier/annualaudit/_opera/auditoperation.vue

@@ -9,8 +9,9 @@
       <div slot="header" class="clearfix">
         <span>年审基本信息表</span>
         <span style="float: right;">
-          <el-button type="primary" size="mini" @click="annualAudit()" v-if="AnnualStatus == 0 ||AnnualStatus == 1">审核
+          <el-button type="primary" size="mini" @click="annualAudit()" v-if="AnnualStatus == 0 ||AnnualStatus == 3">审核
           </el-button>
+          <el-button type="primary" size="mini" @click="profAudit()" v-if="AnnualStatus == 1">专业审核分配</el-button>
         </span>
       </div>
       <el-tabs tab-position="right" style="margin-top: 10px">
@@ -189,6 +190,45 @@
         <el-button type="primary" size="small" @click="makeSure()">确 定</el-button>
       </div>
     </el-dialog>
+    <el-dialog title="确认审核通过请选择专业审核接收人" :visible.sync="selectAuditShow" width="420px">
+      <el-form ref="searchForm" label-width="110px">
+        <el-row>
+          <el-col :span="24">
+            <el-form-item label="接收人">
+              <el-select ref="selectProfAudit" v-model="ProfAudit" placeholder="请选择" style="width: 90%" filterable
+                allow-create default-first-option>
+                <el-option v-for="item in profAuditOption" :key="item.id" :label="item.realname" :value="item.id">
+                </el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+        </el-row>
+      </el-form>
+      <span slot="footer" class="dialog-footer">
+        <el-button size="mini" @click="selectAuditShow = false">取 消</el-button>
+        <el-button size="mini" type="primary" @click="checkstatus()">确定</el-button>
+      </span>
+    </el-dialog>
+
+    <el-dialog title="选择业务处专业审核人" :visible.sync="dialogProfAudit" width="420px">
+      <el-form ref="searchForm" label-width="110px">
+        <el-row>
+          <el-col :span="24">
+            <el-form-item label="审核人">
+              <el-select ref="selectProfAuditThen" v-model="ProfAuditThen" placeholder="请选择" style="width: 90%"
+                filterable allow-create default-first-option>
+                <el-option v-for="item in profAuditThenOption" :key="item.id" :label="item.realname" :value="item.id">
+                </el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+        </el-row>
+      </el-form>
+      <span slot="footer" class="dialog-footer">
+        <el-button size="mini" @click="dialogProfAudit = false">取 消</el-button>
+        <el-button size="mini" type="primary" @click="checkstatus()">确定</el-button>
+      </span>
+    </el-dialog>
   </div>
 </template>
 
@@ -196,6 +236,7 @@
   import {
     mapGetters
   } from 'vuex'
+  import annualapi from '@/api/oilsupplier/annualaudit';
   import api from '@/api/oilsupplier/supplier'
   import apiCert from '@/api/oilsupplier/suppliercert'
   import SupplierFileTable from '@/pages/oilsupplier/supplierfile/table.vue'
@@ -232,6 +273,8 @@
 
     data() {
       return {
+        dialogProfAudit: false,
+        selectAuditShow: false,
         canUpdateSupplier: true,
         dictData: null,
         applyLoading: false,
@@ -240,11 +283,15 @@
         patentList: [], //拥有专利、专有技术及工法
         winningList: [], //近三年获得省部级及以上主要技术、管理成果、获奖项目
         businessList: [], //准入业务
+        profAuditOption: [], //专业审核接收人
+        profAuditThenOption: [], //专业审核人
         serviceId: '',
         certId: '',
         classId: '',
         annualId: '',
         WorkflowId: '',
+        ProfAudit: '',
+        ProfAuditThen: '',
         formData: {
           Id: '',
           SupplierName: '',
@@ -328,7 +375,7 @@
         AnnualStatus: '',
         dialogMakeSure: false,
         shenheForm: {
-          SuccessStatus: 3,
+          SuccessStatus: 1,
           AuditorRemark: '',
           AnnualId: 0
         },
@@ -510,11 +557,11 @@
       },
 
       getDictOptions() {
-        api.getDictList(this.$axios).then(res => {
+        annualapi.getDictList(this.$axios).then(res => {
           this.dictData = res.data.items
-          /*this.UnitRelationOptions = res.data.items['UnitRelation']
-          this.getCityList(res.data.items['GaodeMapChinaAreas'])
-          this.CompanyTypeOptions = res.data.items['CompanyType']*/
+          this.profAuditOption = res.data.items['Receive']
+          this.profAuditThenOption = res.data.items['ProfAudit']
+          console.log("--- this.selectProfAudit--", this.profAuditOption)
         }).catch(err => {
           console.error(err)
         })
@@ -524,27 +571,43 @@
         this.shenheForm.AnnualId = parseInt(this.annualId)
         this.dialogMakeSure = true
       },
+      profAudit() {
+        this.shenheForm.AnnualId = parseInt(this.annualId)
+        this.dialogProfAudit = true
+      },
       //审核通过
       makeSure() {
         //审核通过的具体操作(未编写)
-        this.$confirm("确认审核结果!", "提示", {
-            confirmButtonText: "确定",
-            cancelButtonText: "取消",
-            type: "warning"
-          })
-          .then(() => {
-            if (this.AnnualStatus === '1') {
-              this.shenheForm.SuccessStatus = parseInt(this.shenheForm.SuccessStatus) + 2
-            }
-            this.dialogMakeSure = false
-            this.checkstatus()
-          })
-          .catch(() => {})
+        console.log("----this.shenheForm---", this.shenheForm)
+        if (this.AnnualStatus === '1') {
+          this.selectAuditShow = true
+        } else {
+          this.$confirm("确认审核结果!", "提示", {
+              confirmButtonText: "确定",
+              cancelButtonText: "取消",
+              type: "warning"
+            })
+            .then(() => {
+              this.dialogMakeSure = false
+              this.checkstatus()
+            })
+            .catch(() => {})
+        }
       },
       checkstatus() {
+        var ProfAuditUserId = ""
+        if (this.AnnualStatus === '1') {
+          this.shenheForm.SuccessStatus = parseInt(this.shenheForm.SuccessStatus) + 2
+          ProfAuditUserId = this.ProfAuditThen
+        } else if (this.AnnualStatus === '3') {
+          this.shenheForm.SuccessStatus = parseInt(this.shenheForm.SuccessStatus) + 3
+          this.ProfAudit = ""
+        } else if (this.AnnualStatus === '0') {
+          ProfAuditUserId = this.ProfAudit
+        }
         let params = this.shenheForm
         console.log("---this.shenheForm----", this.shenheForm)
-        this.$axios.put('/annualaudit/auditfirst/', params)
+        this.$axios.put('/annualaudit/auditfirst?ProfAudit=' + ProfAuditUserId, params)
           .then(res => {
             // response
             if (res.data.code === 0) {
@@ -552,7 +615,10 @@
                 type: 'success',
                 message: res.data.message,
               })
-              this.AnnualStatus = this.shenheForm.SuccessStatus
+              this.selectAuditShow = false
+              this.dialogMakeSure = false
+              this.dialogProfAudit = false
+              this.AnnualStatus = -1
             } else {
               this.$message({
                 type: 'warning',

+ 2 - 1
src/dashoo.cn/frontend_web/src/pages/oilsupplier/annualaudit/annualfistaudit.vue

@@ -36,7 +36,8 @@
         <el-table-column label="操作" min-width="180" align="center" fixed>
           <template slot-scope="scope">
             <router-link :to="'/oilsupplier/annualaudit/' + scope.row.SupplierId + '/auditoperation?certid=' + scope.row.CerId +'&WorkflowId='+scope.row.WorkflowId+'&AnnualStatus='+scope.row.Status+'&annualId='+scope.row.Id">
-              <el-button type="primary" plain title="审核" size="mini">审核</el-button>
+              <el-button type="primary" plain title="审核" size="mini" v-if="scope.row.Status == 0 ||scope.row.Status == 3">审核</el-button>
+              <el-button type="primary" plain title="专业审核分配" size="mini" v-if="scope.row.Status == 1">分配</el-button>
             </router-link>
           </template>
         </el-table-column>

+ 27 - 11
src/dashoo.cn/frontend_web/src/pages/oilsupplier/annualaudit/index.vue

@@ -72,10 +72,10 @@
         <el-table-column sortable min-width="110" align="center" prop="Status" label="审核状态">
           <template slot-scope="scope">
             <el-alert v-if="scope.row.Status=='2'" :closable="false" style="background:rgba(255,255,255,0.2)"
-              title="初审未通过" type="warning">
+              title="初审未通过" type="error">
             </el-alert>
             <el-alert v-if="scope.row.Status=='4'" :closable="false" style="background:rgba(255,255,255,0.2)"
-              title="审核未通过" type="error">
+              title="专业审核通过" type="success">
             </el-alert>
             <el-alert v-if="scope.row.Status=='0'" :closable="false" style="background:rgba(255,255,255,0.2)"
               title="已申请" type="info">
@@ -84,10 +84,10 @@
               title="初审通过" type="success">
             </el-alert>
             <el-alert v-if="scope.row.Status=='5'" :closable="false" style="background:rgba(255,255,255,0.2)"
-              title="已交费" type="success">
+              title="专业审核未通过" type="error">
             </el-alert>
             <el-alert v-if="scope.row.Status=='3'" :closable="false" style="background:rgba(255,255,255,0.2)"
-              title="专业审核通过" type="success">
+              title="业务处已接收" type="warning">
             </el-alert>
           </template>
         </el-table-column>
@@ -169,6 +169,21 @@
             </el-form-item>
           </el-col>
         </el-row>
+        <el-row>
+          <el-col :span="24">
+            <el-form-item label="初审单位">
+              <el-select ref="selectauditOrg" v-model="entityForm.FirstAudit" placeholder="请选择"
+                         style="width: 100%" filterable allow-create default-first-option>
+                <el-option
+                  v-for="item in organizeOption"
+                  :key="item.Id"
+                  :label="item.Fullname"
+                  :value="item.Id">
+                </el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+        </el-row>
       </el-form>
       <span style="float: right;margin-top:-10px;">
         <el-button size="small" @click="addUserShow = false">取 消</el-button>
@@ -206,6 +221,7 @@
         addshow: false,
         dialogVisible: false,
         delevisble: false,
+        organizeOption: [], // 审批部门
         //列表数据
         selectsupplierlist: [],
         entityList: [],
@@ -233,6 +249,7 @@
           SupplierName: '',
           SupplierId: '',
           SupplierTypeName: '',
+          FirstAudit:'',
         },
         searchForm: {
           Id: '',
@@ -275,7 +292,7 @@
       //查询列表
       this.initDatas()
       this.getselectsupplier()
-      //this.getDictOptions()
+      this.getDictOptions()
     },
     methods: {
       initDatas() {
@@ -315,7 +332,7 @@
       },
       addAnnualAudit() {
         console.log("----this.entityForm--", this.entityForm)
-        api.addEntity(this.entityForm, this.$axios).then(res => {
+        api.addEntity(this.entityForm, this.entityForm.FirstAudit, this.$axios).then(res => {
           if (res.data.code === 0) {
             console.log("--------res.data----", res.data)
             //保存成功后,初始化数据,变成修改
@@ -356,11 +373,10 @@
         })
       },
 
-      getDictOptions() {
-        api.getDictList(this.$axios).then(res => {
-          //this.dictOptions.customerList = res.data.items['customerList']
-          //this.dictOptions.projectList = res.data.items['projectList']
-
+      getDictOptions () {
+        supplierapi.getDictList(this.$axios).then(res => {
+          this.dictData = res.data.items
+          this.organizeOption = res.data.items['Organizes']
         }).catch(err => {
           console.error(err)
         })