ソースを参照

准入物资类审批,工作流审批、监听

baichengfei 5 年 前
コミット
16c728e3f2

+ 24 - 0
src/dashoo.cn/backend/api/business/auditsetting/oilauditsettingService.go

@@ -78,4 +78,28 @@ func  (s *OilAuditSettingService) GetApproverIdsByStepCodeAndUnitId(stepCode, un
 	approverIds = strings.Trim(userIds, ",")
 	return approverIds
 
+}
+
+func  (s *OilAuditSettingService) GetApproverIdsByStepCodeForConcentrateAudit(stepCode string) (approverIds string) {
+	var setting Base_OilAuditSetting
+	var userlist []userRole.Base_User
+
+	usvc := userRole.GetUserService(utils.DBE)
+	whereSetting := "AuditStepCode='" + stepCode + "'"
+	usvc.GetEntity(&setting, whereSetting)
+	ids := usvc.GetUserIdsByRoleId(strconv.Itoa(setting.RoleId))
+	tempstr := strings.Join(ids, ",")
+	uids := strings.Replace(tempstr, "uid_", "", -1)
+	uids = strings.Trim(uids, ",")
+	if uids != "" {
+		whereUsers := "Id in (" + uids + ")"
+		usvc.GetEntities(&userlist, whereUsers)
+	}
+
+	userIds := ""
+	for _, tmpUser := range userlist {
+		userIds += strconv.Itoa(tmpUser.Id) + ","
+	}
+	approverIds = strings.Trim(userIds, ",")
+	return approverIds
 }

+ 2 - 0
src/dashoo.cn/backend/api/business/oilsupplier/suppliercert/oilsuppliercert.go

@@ -56,6 +56,7 @@ type OilSupplierCert struct {
 	FirstAudit        int       `xorm:"default 0 comment('初审') INT(10)"`
 	SecondAudit       int       `xorm:"default 0 comment('复审') INT(10)"`
 	ThirdAudit        int       `xorm:"default 0 comment('专业科室审批') INT(10)"`
+	ProfessionalAudit int		`xorm:"default 0 comment('业务处室专业审批') INT(10)"`
 	FourthAudit       int       `xorm:"default 0 comment('集中审批') INT(10)"`
 	AuditIndex        int       `xorm:"default 0 comment('审批次数') INT(11)"`
 	BackRemark        string    `xorm:"default '' comment('退回原因') VARCHAR(255)"`
@@ -123,6 +124,7 @@ type Del_OilSupplierCert struct {
 	FirstAudit        int       `xorm:"default 0 comment('初审') INT(10)"`
 	SecondAudit       int       `xorm:"default 0 comment('复审') INT(10)"`
 	ThirdAudit        int       `xorm:"default 0 comment('专业科室审批') INT(10)"`
+	ProfessionalAudit int		`xorm:"default 0 comment('业务处室专业审批') INT(10)"`
 	FourthAudit       int       `xorm:"default 0 comment('集中审批') INT(10)"`
 	AuditIndex        int       `xorm:"default 0 comment('审批次数') INT(11)"`
 	BackRemark        string    `xorm:"default '' comment('退回原因') VARCHAR(255)"`

+ 6 - 2
src/dashoo.cn/backend/api/controllers/base.go

@@ -334,7 +334,6 @@ func (this *BaseController) Prepare() {
 		"/api/register/getCode",
 		"/api/register/updatepassword",
 		"/api/bankapi/get-icbc-gfgl2019-token",
-		"/api/suppliercert-listener",
 	}
 	for _, v := range urls {
 		fmt.Println("**this.Ctx.Input.URL()**", this.Ctx.Input.URL())
@@ -352,6 +351,11 @@ func (this *BaseController) Prepare() {
 			fmt.Println("/api/workflow/historyimg/")
 			break
 		}
+		if strings.Contains(this.Ctx.Input.URL(), "/api/suppliercert-listener/") {
+			find = true
+			fmt.Println("/api/suppliercert-listener/")
+			break
+		}
 	}
 
 	if !find { // 如果是登录操作不做验证
@@ -374,7 +378,7 @@ func (this *BaseController) Prepare() {
 		this.User.Description = usermodel.Description
 		this.User.DepartmentId = usermodel.Departmentid
 		this.User.IsCompanyUser = usermodel.IsCompanyUser
-		this.User.Uint = usermodel.Unit
+		this.User.Unit = usermodel.Unit
 		//		this.User.Superior = usermodel.Superior
 		this.User.Roles = utils.ToStr(usermodel.Roleid)
 		beego.Debug("User:", this.User)

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

@@ -564,7 +564,7 @@ func (this *RoleController) GetUsersForRole() {
 	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 + "'"
+		where += " and Unit = '" + this.User.Unit + "'"
 	}
 	total, users := svc.GetUserListForRole(page.CurrentPage, page.Size, roleid, "Id", where)
 

+ 1 - 1
src/dashoo.cn/backend/api/controllers/casbin/user.go

@@ -207,7 +207,7 @@ func (this *UserController) List() {
 // @router /parlist [get]
 func (this *UserController) ParList() {
 	page := this.GetPageInfoForm()
-	unit := this.User.Uint
+	unit := this.User.Unit
 	IsCompanyUser := this.User.IsCompanyUser
 	svc := permission.GetPermissionService(utils.DBE)
 	organsvc := organize.GetOrganizeService(utils.DBE)

+ 125 - 12
src/dashoo.cn/backend/api/controllers/oilsupplier/suppliercert.go

@@ -674,11 +674,7 @@ func (this *OilSupplierCertController) CompanyAuditEntity() {
 	ActiComplete.Result =  "1" //提交给二级单位分办
 	ActiComplete.Remarks = AuditRemark
 	ActiComplete.CallbackUrl = utils.Cfg.MustValue("workflow", "callbackHost")
-	//取出下一步的审批人
-	/** stepCode := workflow.GetWorkFlowStepCode(typeCode)
-	auditSettingService := auditsetting.GetOilAuditSettingService(utils.DBE)
-	approverIds := auditSettingService.GetApproverIdsByStepCodeAndUnitId(stepCode, unitId)
-	ActiComplete.UserNames = approverIds */
+
 	receiveVal := svcActiviti.TaskComplete(ActiComplete)
 	if receiveVal != "true" {
 		panic("工作流异常,请联系管理员!" + receiveVal)
@@ -696,7 +692,11 @@ func (this *OilSupplierCertController) UnitAuditEntity() {
 	thirdAudit := this.GetString("ThirdAudit")
 	// typeCode := this.GetString("TypeCode")
 	AuditRemark := this.GetString("AuditRemark")
-	unitId := this.User.Uint
+	userId := this.User.Id
+	var baseUserInfo userRole.Base_User
+	userService := userRole.GetUserService(utils.DBE)
+	userService.GetEntityById(userId, &baseUserInfo)
+	unitId := baseUserInfo.UnitId
 
 	var errinfo ErrorDataInfo
 	defer func() { //finally处理失败的异常
@@ -722,6 +722,15 @@ func (this *OilSupplierCertController) UnitAuditEntity() {
 	supplierSvc := supplier.GetOilSupplierService(utils.DBE)
 	var supplierEntity supplier.OilSupplier
 	supplierSvc.GetEntityById(supplierCertEntity.SupplierId, &supplierEntity)
+	// 取准入范围列表
+
+	//certSubSrv := suppliercertsub.GetOilSupplierCertSubService(utils.DBE)
+	//var supplierCertSubList []suppliercertsub.OilSupplierCertSub
+	//where := "SupplierCertId='" + strconv.Itoa(supplierCertEntity.Id) + "'"
+	//certSubSrv.GetEntity(&supplierCertSubList, where)
+	//if len(supplierCertSubList) <= 0 {
+	//	panic("准入范围不能为空!")
+	//}
 
 
 	svcActiviti := workflow.GetActivitiService(utils.DBE)
@@ -746,7 +755,7 @@ func (this *OilSupplierCertController) UnitAuditEntity() {
 	supplierCertEntity.FirstAudit, _ = strconv.Atoi(firstAudit)
 	supplierCertEntity.SecondAudit, _ = strconv.Atoi(secondAudit)
 	supplierCertEntity.ThirdAudit, _ = strconv.Atoi(thirdAudit)
-	supplierCertEntity.CommitComId = unitId
+	supplierCertEntity.CommitComId = strconv.Itoa(unitId)
 	supplierCertEntity.AuditIndex += 1
 	certSrv.UpdateEntityByIdCols(certId, supplierCertEntity, cols)
 
@@ -754,7 +763,7 @@ func (this *OilSupplierCertController) UnitAuditEntity() {
 	ActiComplete.ProcessKey = workflow.OIL_ENUSER_SUPPLIER_APPLY
 	ActiComplete.BusinessKey = supplierCertEntity.BusinessKey
 	ActiComplete.UserId = this.User.Id // 当前审批操作人员
-	ActiComplete.UserNames = secondAudit // 当前审批操作人员
+	//ActiComplete.UserNames = secondAudit // 当前审批操作人员
 	ActiComplete.Result = "2" //分办提交给二级单位初审
 	ActiComplete.Remarks = AuditRemark
 	ActiComplete.CallbackUrl = utils.Cfg.MustValue("workflow", "callbackHost")
@@ -767,7 +776,7 @@ func (this *OilSupplierCertController) UnitAuditEntity() {
 // @Title 二级单位分办 --审批
 // @Description 二级分办
 // @Success	200	{object} controllers.Request
-// @router /audit/:id [post]
+// @router /separate-audit/:id [post]
 func (this *OilSupplierCertController) SeparateAuditEntity() {
 	certId := this.Ctx.Input.Param(":id")
 	firstAudit := this.GetString("FirstAudit")
@@ -822,13 +831,13 @@ func (this *OilSupplierCertController) SeparateAuditEntity() {
 	}
 }
 
-// @Title 分办之后的各级审批  --审批
+// @Title 分办之后的各级审批  --审批 包含:二级单位初审、复审, 业务处室专业审核
 // @Description 分办之后的各级审批
 // @Success	200	{object} controllers.Request
-// @router /audit/:id [post]
+// @router /common-audit/:id [post]
 func (this *OilSupplierCertController) CommonAuditEntity() {
 	certId := this.Ctx.Input.Param(":id")
-	result := this.Ctx.Input.Param("result")
+	result := this.GetString("result")
 	AuditRemark := this.GetString("AuditRemark")
 
 	var errinfo ErrorDataInfo
@@ -866,6 +875,110 @@ func (this *OilSupplierCertController) CommonAuditEntity() {
 	}
 }
 
+// @Title 业务处室接收分办 专业审批
+// @Description 业务处室接收分办 专业审批
+// @Success 200 {object} controllers.Request
+// @router /business-separate-audit/:id [post]
+func (this *OilSupplierCertController) BusinessOfficeSeparateAuditEntity() {
+	certId := this.Ctx.Input.Param(":id")
+	ProfessionalAudit := this.GetString("ProfessionalAudit")
+	AuditRemark := this.GetString("AuditRemark")
+
+	var errInfo ErrorDataInfo
+	defer func() { //finally处理失败的异常
+		if err := recover(); err != nil {
+			errInfo.Message = err.(string)
+			errInfo.Code = -1
+			this.Data["json"] = &errInfo
+			this.ServeJSON()
+		} else {
+			//返回正确结果
+			errInfo.Message = "审核提交成功"
+			errInfo.Code = 0
+			this.Data["json"] = &errInfo
+			this.ServeJSON()
+		}
+	}()
+
+	//取出准入表信息
+	certSrv := suppliercert.GetOilSupplierCertService(utils.DBE)
+	var supplierCertEntity suppliercert.OilSupplierCert
+	certSrv.GetEntityById(certId, &supplierCertEntity)
+
+	svcActiviti := workflow.GetActivitiService(utils.DBE)
+	var ActiComplete workflow.ActiCompleteVM
+	ActiComplete.ProcessKey = workflow.OIL_ENUSER_SUPPLIER_APPLY
+	ActiComplete.BusinessKey = supplierCertEntity.BusinessKey
+	ActiComplete.UserId = this.User.Id //审批人员
+	ActiComplete.Result = "1" //前台审批[同意、不同意]
+	ActiComplete.UserNames = ProfessionalAudit
+	ActiComplete.Remarks = AuditRemark
+	ActiComplete.CallbackUrl = utils.Cfg.MustValue("workflow", "callbackHost")
+	receiveVal := svcActiviti.TaskComplete(ActiComplete)
+	if receiveVal != "true" {
+		panic("工作流异常,请联系管理员!" + receiveVal)
+	}
+	cols := []string{
+		"Id",
+		"Status",
+		"ProfessionalAudit",
+	}
+	supplierCertId := strings.Split(supplierCertEntity.BusinessKey, "-")[0]
+	supplierCertEntity.Status = suppliercert.PROF_AUDIT_STATUS //专业处室接收
+	supplierCertEntity.ProfessionalAudit, _ = strconv.Atoi(ProfessionalAudit)
+	certSrv.UpdateEntityByIdCols(supplierCertId, supplierCertEntity, cols)
+}
+
+// @Title 集中审批
+// @Description 集中审批
+// @Success 200 {object} controllers.Request
+// @router /concentrate-audit/:id [post]
+func (this *OilSupplierCertController) ConcentrateAuditEntity() {
+	certId := this.Ctx.Input.Param(":id")
+	AuditRemark := this.GetString("AuditRemark")
+
+	var errInfo ErrorDataInfo
+	defer func() { //finally处理失败的异常
+		if err := recover(); err != nil {
+			errInfo.Message = err.(string)
+			errInfo.Code = -1
+			this.Data["json"] = &errInfo
+			this.ServeJSON()
+		} else {
+			//返回正确结果
+			errInfo.Message = "审核提交成功"
+			errInfo.Code = 0
+			this.Data["json"] = &errInfo
+			this.ServeJSON()
+		}
+	}()
+
+	//取出准入表信息
+	certSrv := suppliercert.GetOilSupplierCertService(utils.DBE)
+	var supplierCertEntity suppliercert.OilSupplierCert
+	certSrv.GetEntityById(certId, &supplierCertEntity)
+
+	svcActiviti := workflow.GetActivitiService(utils.DBE)
+	var ActiComplete workflow.ActiCompleteVM
+	ActiComplete.ProcessKey = workflow.OIL_ENUSER_SUPPLIER_APPLY
+	ActiComplete.BusinessKey = supplierCertEntity.BusinessKey
+	ActiComplete.UserId = this.User.Id //审批人员
+	ActiComplete.Result = "1" //前台审批[同意、不同意]
+	ActiComplete.Remarks = AuditRemark
+	ActiComplete.CallbackUrl = utils.Cfg.MustValue("workflow", "callbackHost")
+	receiveVal := svcActiviti.TaskComplete(ActiComplete)
+	if receiveVal != "true" {
+		panic("工作流异常,请联系管理员!" + receiveVal)
+	}
+	//cols := []string{
+	//	"Id",
+	//	"Status",
+	//}
+	//supplierCertId := strings.Split(supplierCertEntity.BusinessKey, "-")[0]
+	//supplierCertEntity.Status = suppliercert.PROF_AUDIT_STATUS //专业处室接收
+	//certSrv.UpdateEntityByIdCols(supplierCertId, supplierCertEntity, cols)
+}
+
 // @Title 获取实体
 // @Description 获取实体
 // @Success 200 {object} controllers.Request

+ 188 - 18
src/dashoo.cn/backend/api/controllers/oilsupplier/suppliercertListener.go

@@ -1,25 +1,36 @@
 package oilsupplier
 
 import (
+	"encoding/json"
+	"strconv"
+	"strings"
+
 	"dashoo.cn/backend/api/business/auditsetting"
 	"dashoo.cn/backend/api/business/oilsupplier/suppliercert"
 	"dashoo.cn/backend/api/business/workflow"
 	. "dashoo.cn/backend/api/controllers"
 	"dashoo.cn/utils"
-	"strings"
 )
 
 type OilSupplierCertListenerController struct {
 	BaseController
 }
 
+type ListenerApproveInfo struct {
+	Users string	`json:"users"`
+}
+
+type ListenerApproveParams struct {
+	BusinessKey string	`json:"businessKey"`
+}
+
 // @Title 获取二级单位分办人员列表 --回调
 // @Description get user by token
 // @Success 200 {string} string
 // @router /pre-fen-trail [get]
-func (this *OilSupplierCertListenerController) PreFenTrialStatus () {
+func (this *OilSupplierCertListenerController) PreFenTrialStatus() {
 	businessKey := this.GetString("businessKey")
-	supplierCertId := strings.Split(businessKey, "_")[0]
+	supplierCertId := strings.Split(businessKey, "-")[0]
 
 	certSrv := suppliercert.GetOilSupplierCertService(utils.DBE)
 	var supplierCertEntity suppliercert.OilSupplierCert
@@ -40,14 +51,13 @@ func (this *OilSupplierCertListenerController) PreFenTrialStatus () {
 	this.ServeJSON()
 }
 
-
 // @Title 获取二级单位初审人员列表--回调
 // @Description get user by token
 // @Success 200 {string} string
 // @router /pre-first-trail [get]
 func (this *OilSupplierCertListenerController) PreFirstTrail() {
 	businessKey := this.GetString("businessKey")
-	supplierCertId := strings.Split(businessKey, "_")[0]
+	supplierCertId := strings.Split(businessKey, "-")[0]
 
 	certSrv := suppliercert.GetOilSupplierCertService(utils.DBE)
 	var supplierCertEntity suppliercert.OilSupplierCert
@@ -94,10 +104,12 @@ func (this *OilSupplierCertListenerController) PreSecondTrail() {
 // @Title 获取业务处室接收分办人员列表 --回调
 // @Description get user by token
 // @Success 200 {string} string
-// @router /pre-third-trail [get]
-func (this *OilSupplierCertListenerController) PreThirdTrialStatus () {
-	businessKey := this.GetString("businessKey")
-	supplierCertId := strings.Split(businessKey, "_")[0]
+// @router /pre-third-trail [post]
+func (this *OilSupplierCertListenerController) PreThirdTrialStatus() {
+	var jsonBlob = this.Ctx.Input.RequestBody
+	var listenerApprove ListenerApproveParams
+	json.Unmarshal(jsonBlob, &listenerApprove)
+	supplierCertId := strings.Split(listenerApprove.BusinessKey, "-")[0]
 
 	certSrv := suppliercert.GetOilSupplierCertService(utils.DBE)
 	var supplierCertEntity suppliercert.OilSupplierCert
@@ -113,8 +125,10 @@ func (this *OilSupplierCertListenerController) PreThirdTrialStatus () {
 	//查出业务处室接收分办的人员
 	stepCode := workflow.PROF_RECE //专业处室接收
 	auditSettingService := auditsetting.GetOilAuditSettingService(utils.DBE)
-	approverIds := auditSettingService.GetApproverIdsByStepCodeAndUnitId(stepCode, supplierCertEntity.CommitComId)
-	this.Data["json"] = approverIds
+	approverIds := auditSettingService.GetApproverIdsByStepCodeAndUnitId(stepCode, strconv.Itoa(supplierCertEntity.ThirdAudit))
+	var approveInfo ListenerApproveInfo
+	approveInfo.Users = approverIds
+	this.Data["json"] = &approveInfo
 	this.ServeJSON()
 }
 
@@ -124,7 +138,7 @@ func (this *OilSupplierCertListenerController) PreThirdTrialStatus () {
 // @router /pre-prof-audit [get]
 func (this *OilSupplierCertListenerController) PreProfAudit() {
 	businessKey := this.GetString("businessKey")
-	supplierCertId := strings.Split(businessKey, "_")[0]
+	supplierCertId := strings.Split(businessKey, "-")[0]
 
 	certSrv := suppliercert.GetOilSupplierCertService(utils.DBE)
 	var supplierCertEntity suppliercert.OilSupplierCert
@@ -137,11 +151,109 @@ func (this *OilSupplierCertListenerController) PreProfAudit() {
 	supplierCertEntity.Status = suppliercert.PROF_AUDIT_STATUS //业务处室专业审批
 	certSrv.UpdateEntityByIdCols(supplierCertId, supplierCertEntity, cols)
 
-	//查出业务处室接收分办的人员
-	stepCode := workflow.PROF_AUDIT
+	//查出业务处室专业审批的人员
+	//专业审批人已在分办时指定
+	//stepCode := workflow.PROF_AUDIT
+	//auditSettingService := auditsetting.GetOilAuditSettingService(utils.DBE)
+	//approverIds := auditSettingService.GetApproverIdsByStepCodeAndUnitId(stepCode, supplierCertEntity.CommitComId)
+	this.Data["json"] = 1
+	this.ServeJSON()
+}
+
+// @Title 获取集中审批人员列表 --回调
+// @Description get user by token
+// @Success 200 {string} string
+// @router /pre-concentrate-audit [post]
+func (this *OilSupplierCertListenerController) ConcentrateAudit() {
+	var jsonBlob = this.Ctx.Input.RequestBody
+	var listenerApprove ListenerApproveParams
+	json.Unmarshal(jsonBlob, &listenerApprove)
+	supplierCertId := strings.Split(listenerApprove.BusinessKey, "-")[0]
+
+	certSrv := suppliercert.GetOilSupplierCertService(utils.DBE)
+	var supplierCertEntity suppliercert.OilSupplierCert
+	certSrv.GetEntityById(supplierCertId, &supplierCertEntity)
+	cols := []string{
+		"Id",
+		"Status",
+	}
+	//进入此步骤,记录在数据库中
+	supplierCertEntity.Status = suppliercert.CENT_AUDIT_STATUS //集中审批
+	certSrv.UpdateEntityByIdCols(supplierCertId, supplierCertEntity, cols)
+
+	//查出集中审批的人员
+	stepCode := workflow.PROF_CONCENT //集中审批
 	auditSettingService := auditsetting.GetOilAuditSettingService(utils.DBE)
-	approverIds := auditSettingService.GetApproverIdsByStepCodeAndUnitId(stepCode, supplierCertEntity.CommitComId)
-	this.Data["json"] = approverIds
+	approverIds := auditSettingService.GetApproverIdsByStepCodeForConcentrateAudit(stepCode)
+	var approveInfo ListenerApproveInfo
+	approveInfo.Users = approverIds
+	this.Data["json"] = &approveInfo
+	this.ServeJSON()
+}
+
+// @Title 查询是否集中审批--回调
+// @Description 查询是否集中审批
+// @Success 200 {string} string
+// @router /check-need-concentrate-audit [get]
+func (this *OilSupplierCertListenerController) CheckNeedConcentrateAudit() {
+	businessKey := this.GetString("businessKey")
+	supplierCertId := strings.Split(businessKey, "-")[0]
+
+	certSrv := suppliercert.GetOilSupplierCertService(utils.DBE)
+	var supplierCertEntity suppliercert.OilSupplierCert
+	certSrv.GetEntityById(supplierCertId, &supplierCertEntity)
+
+	if supplierCertEntity.SupplierTypeCode != "01" {
+		panic("准入类别错误!请联系管理员!")
+	}
+
+	// 需要集中评审的准入类型
+	var concentrateInStyleList []string
+	concentrateInStyleList = append(concentrateInStyleList, suppliercert.PINGSHEN)
+	concentrateInStyleList = append(concentrateInStyleList, suppliercert.NEIBUDUOYUAN)
+	// 不需要集中评审的准入类型
+	var unConcentrateInStyleList []string
+	unConcentrateInStyleList = append(unConcentrateInStyleList, suppliercert.YIJIWUZI)
+	unConcentrateInStyleList = append(unConcentrateInStyleList, suppliercert.ERJIWUZI)
+	unConcentrateInStyleList = append(unConcentrateInStyleList, suppliercert.ZHANLUEHEZUO)
+	unConcentrateInStyleList = append(unConcentrateInStyleList, suppliercert.WAIBUSHICHANG)
+
+	result := 0
+	isConcentrateAudit := "false"
+	unConcentrateAudit := "false"
+	for _, eachItem := range concentrateInStyleList{
+		if eachItem == supplierCertEntity.InStyle {
+			// 需要集中评审
+			isConcentrateAudit = "true"
+			result = 1
+			break
+		}
+	}
+	for _, eachItem := range unConcentrateInStyleList{
+		if eachItem == supplierCertEntity.InStyle {
+			// 不需要集中评审
+			unConcentrateAudit = "true"
+			result = 2
+			break
+		}
+	}
+
+	if isConcentrateAudit == unConcentrateAudit{
+		// 准入类型评审方式错误!请联系管理员
+		result = 0
+	}
+
+	//if result == 1 {
+	//	cols := []string{
+	//		"Id",
+	//		"Status",
+	//	}
+	//	//进入此步骤,记录在数据库中
+	//	supplierCertEntity.Status = suppliercert.PROF_AUDIT_STATUS //业务处室专业审批
+	//	certSrv.UpdateEntityByIdCols(supplierCertId, supplierCertEntity, cols)
+	//}
+
+	this.Data["json"] = result
 	this.ServeJSON()
 }
 
@@ -151,12 +263,70 @@ func (this *OilSupplierCertListenerController) PreProfAudit() {
 // @router /check-need-pay [get]
 func (this *OilSupplierCertListenerController) CheckNeedPay() {
 	businessKey := this.GetString("businessKey")
-	supplierCertId := strings.Split(businessKey, "_")[0]
+	supplierCertId := strings.Split(businessKey, "-")[0]
+
+	certSrv := suppliercert.GetOilSupplierCertService(utils.DBE)
+	var supplierCertEntity suppliercert.OilSupplierCert
+	certSrv.GetEntityById(supplierCertId, &supplierCertEntity)
 
+	var isPayList []string
+	isPayList = append(isPayList, suppliercert.PINGSHEN)
+	isPayList = append(isPayList, suppliercert.WAIBUSHICHANG)
+	var unPayList []string
+	unPayList = append(unPayList, suppliercert.YIJIWUZI)
+	unPayList = append(unPayList, suppliercert.ERJIWUZI)
+	unPayList = append(unPayList, suppliercert.ZHANLUEHEZUO)
+	unPayList = append(unPayList, suppliercert.NEIBUDUOYUAN)
+
+	result := 0
+	isPay := "false"
+	unPay := "false"
+	for _, eachItem := range isPayList{
+		if eachItem == supplierCertEntity.InStyle {
+			// 需要付费
+			isPay = "true"
+			result = 1
+			break
+		}
+	}
+	for _, eachItem := range unPayList{
+		if eachItem == supplierCertEntity.InStyle {
+			// 不需要付费
+			unPay = "true"
+			result = 2
+			break
+		}
+	}
+	if isPay == unPay{
+		// 准入类型是否付费有误!请联系管理员
+		result = 0
+	}
+
+	this.Data["json"] = result
+	this.ServeJSON()
+}
+
+// @Title 获取交费人--回调
+// @Description get user by token
+// @Success 200 {string} string
+// @router /pre-payer [get]
+func (this *OilSupplierCertListenerController) GetPrePayer() {
+	businessKey := this.GetString("businessKey")
+	supplierCertId := strings.Split(businessKey, "-")[0]
 	certSrv := suppliercert.GetOilSupplierCertService(utils.DBE)
 	var supplierCertEntity suppliercert.OilSupplierCert
 	certSrv.GetEntityById(supplierCertId, &supplierCertEntity)
 
-	this.Data["json"] = "1"
+	cols := []string{
+		"Id",
+		"Status",
+	}
+	//进入此步骤,记录在数据库中
+	supplierCertEntity.Status = suppliercert.PAYING_AUDIT_STATUS //待缴费
+	certSrv.UpdateEntityByIdCols(supplierCertId, supplierCertEntity, cols)
+
+	//创建人即为交费的人员
+	approverIds := supplierCertEntity.CommitComId
+	this.Data["json"] = approverIds
 	this.ServeJSON()
 }

+ 2 - 1
src/dashoo.cn/backend/api/models/token.go

@@ -46,7 +46,8 @@ type UserInfo struct {
 	Description   string
 	IsCompanyUser int
 	Superior      string
-	Uint          string
+	Unit          string
+	UnitId		  int	`xorm:"INT(11)"`
 }
 
 // 建立JWT Token

+ 22 - 1
src/dashoo.cn/frontend_web/src/api/oilsupplier/suppliercert.js

@@ -58,7 +58,7 @@ export default {
       params: params
     })
   },
-  auditEntity (entityId, params, myAxios) {
+  unitAuditEntity (entityId, params, myAxios) {
     return myAxios({
       url: '/suppliercert/unit-audit/' + entityId,
       method: 'post',
@@ -146,5 +146,26 @@ export default {
       method: 'post',
       params: params
     })
+  },
+  separateAuditEntity (id, params, myAxios) {
+    return myAxios({
+      url: 'suppliercert/separate-audit/' + id,
+      method: 'post',
+      params: params
+    })
+  },
+  commonAuditEntity (id, params, myAxios) {
+    return myAxios({
+      url: 'suppliercert/common-audit/' + id,
+      method: 'post',
+      params: params
+    })
+  },
+  businessOfficeSeparateAuditEntity (id, params, myAxios) {
+    return myAxios({
+      url: 'suppliercert/business-separate-audit/' + id,
+      method: 'post',
+      params: params
+    })
   }
 }

+ 0 - 1
src/dashoo.cn/frontend_web/src/components/oilsupplier/goodsinfo.vue

@@ -1394,7 +1394,6 @@ export default {
           }
         }
       }
-
     },
     currentSel (event) {
       if (event === 2) {

+ 0 - 4
src/dashoo.cn/frontend_web/src/components/oilsupplier/goodslist2.vue

@@ -5,10 +5,6 @@
            class="clearfix">
         <span style="font-weight: bold">准入范围</span>
         <span style="float: right;">
-          <el-button type="primary" size="mini" style="float: right;margin-left: 25px" @click="commitAudit()"
-                     v-if="canadd && IsCompanyUser == 0">
-          提交审批
-          </el-button>
           <el-button style="float: right; padding: 3px 0px;"
                      type="text"
                      @click="deletedata()"

+ 3 - 0
src/dashoo.cn/frontend_web/src/components/oilsupplier/subfilelist2.vue

@@ -556,11 +556,14 @@
                 return
               }
             }
+            console.log('提交审批01')
             this.$emit('close')
           } else {
+            console.log('提交审批02')
             this.$emit('close')
           }
         } else {
+          console.log('提交审批03')
           this.$message({
             type: 'warning',
             message: '请选择准入范围!'

+ 7 - 6
src/dashoo.cn/frontend_web/src/components/workflow/wfhistory.vue

@@ -15,7 +15,7 @@
             {{ assigneeToAssignee(scope.row.assignee) }}
           </span>
           <el-tooltip class="item" v-if="!scope.row.assignee" content="当前步骤有审批权限的人员" placement="top-start">
-            <span style="font-style: italic; color:#00F">
+            <span style="color:#00F">
               {{ assigneeToUsers(scope.row.users) }}
             </span>
           </el-tooltip>
@@ -32,9 +32,9 @@
         </template>
       </el-table-column>
     </el-table>
-    <div style="margin-top:5px; text-align: center;">
+    <el-card style="text-align: center; overflow-x: auto">
       <img :src="baseurl + 'workflow/historyimg/' + entryinfo.instance +'?t='+(new Date()).getTime() " v-if="entryinfo.instance">
-    </div>
+    </el-card>
   </div>
 </template>
 
@@ -94,6 +94,7 @@
           params
         })
           .then(res => {
+            console.log('历史任务', res.data)
             this.tmp_historyTask = res.data.items
             let useridstr = ''
             for (let i = 0; i < this.tmp_historyTask.length; i++) {
@@ -106,8 +107,8 @@
             }
             if (useridstr) {
               useridstr = useridstr.substring(0, useridstr.length - 1)
+              this.getuserlist(useridstr)
             }
-            this.getuserlist(useridstr)
           })
           .catch(err => {
             // handle error
@@ -127,7 +128,7 @@
         for (let idx = 0; idx < userArr.length; idx++) {
           let val = userArr[idx]
           for (let i = 0; i < this.userlist.length; i++) {
-            if (parseInt(val) == parseInt(this.userlist[i].Id)) {
+            if (parseInt(val) === parseInt(this.userlist[i].Id)) {
               userNames += this.userlist[i].Realname + ', '
             }
           }
@@ -136,7 +137,7 @@
           userNames = userNames.substring(0, userNames.length - 2)
         }
         return userNames
-    },
+      },
       getuserlist (val) {
         // let params = {
         //   userids: val

+ 1 - 1
src/dashoo.cn/frontend_web/src/components/workflow/wfmultihistory.vue

@@ -151,7 +151,7 @@
           userNames = userNames.substring(0, userNames.length - 2)
         }
         return userNames
-    },
+      },
       getuserlist (val) {
         this.$axios.post('workflow/userlist_post?userids=' + val)
           .then(res => {

+ 69 - 19
src/dashoo.cn/frontend_web/src/pages/oilsupplier/supplier/_opera/goodsedit.vue

@@ -52,9 +52,12 @@
           <el-button type="primary"
                      size="mini"
                      @click="nextStep()"
-                     v-if="add_flat && IsCompanyUser == 1 && parseInt(activeName)==3">
+                     v-if="add_flat && parseInt(IsCompanyUser) === 1 && parseInt(activeName) === 3">
             提交
           </el-button>
+          <el-button v-if="parseInt(IsCompanyUser) !== 1 && (this.formData.Status == '' || parseInt(this.formData.Status) === 0) " type="primary" size="mini" style="float: right;margin-left: 25px" @click="commitAudit()">
+            提交审批
+          </el-button>
           <!--<el-button type="primary" @click="toPdf" size="mini" :disabled="formData.Status == 0">准入范围</el-button>-->
           <!--<router-link :to="'/oilsupplier/supplier/goodslist'">-->
           <!--<el-button type="primary" size="mini" style="margin-left: 8px" v-if="showReturn">返回</el-button>-->
@@ -328,8 +331,8 @@
                 </el-button>
               </span>-->
             </div>
-            <wf-multi-history ref="WfHistory"
-                              :entryinfo="entrydetail"></wf-multi-history>
+            <wf-history ref="WfHistory"
+                              :entryinfo="entrydetail"></wf-history>
           </el-card>
         </el-tab-pane>
 
@@ -402,14 +405,6 @@
                            :value="item.Id">
                 </el-option>
               </el-select>
-              <!--<el-input ref="selectAuditer"-->
-                        <!--readonly-->
-                        <!--v-model="auditerName"-->
-                        <!--placeholder="请选择初审人">-->
-                <!--<el-button slot="append"-->
-                           <!--icon="el-icon-search"-->
-                           <!--@click="chooseAuditorShow"></el-button>-->
-              <!--</el-input>-->
             </el-form-item>
             <el-form-item label="复审人员">
               <el-select ref="selectAuditer"
@@ -460,7 +455,7 @@
                    @click="dialogVisible = false">取 消</el-button>
         <el-button size="mini"
                    type="primary"
-                   @click="AuditEntity" :loading="loading">确定</el-button>
+                   @click="secondaryUnitSubmitApply" :loading="loading">确定</el-button>
       </span>
     </el-dialog>
     <el-dialog title="提交"
@@ -530,8 +525,9 @@ import api from '@/api/oilsupplier/supplier'
 import apiCert from '@/api/oilsupplier/suppliercert'
 import annapi from '@/api/oilsupplier/annualaudit'
 import SupplierFileTable from '@/pages/oilsupplier/supplierfile/table.vue'
-import WfMultiHistory from '@/components/workflow/wfmultihistory.vue'
-import WfBackHistory from '@/components/workflow/wfbackhistory.vue'
+import WfHistory from '@/components/workflow/wfhistory.vue'
+// import WfMultiHistory from '@/components/workflow/wfmultihistory.vue'
+// import WfBackHistory from '@/components/workflow/wfbackhistory.vue'
 import SupplierCertEdit from '@/components/oilsupplier/suppliercertedit.vue'
 import dataapi from '@/api/oilsupplier/dataentry'
 import EquipmentList from '@/components/oilsupplier/equipmentlist'
@@ -550,8 +546,9 @@ export default {
   components: {
     FloatImgBtn,
     SupplierFileTable,
-    WfMultiHistory,
-    WfBackHistory,
+    WfHistory,
+    // WfMultiHistory,
+    // WfBackHistory,
     SupplierCertEdit,
     ChooseAuditorFen,
 
@@ -884,7 +881,7 @@ export default {
             title: '提示',
             message: '请上传现场考察报告!',
             type: 'warning'
-          });
+          })
           return false
         }
       }
@@ -1714,14 +1711,15 @@ export default {
       }
     },
     commitAudit () {
-      if (this.formDataCert.InStyle != '2' && this.formDataCert.InStyle != '3' ) {
+      console.log('提交审批')
+      if (this.formDataCert.InStyle != '2' && this.formDataCert.InStyle != '3') {
         // 准入方式,除一级二级外其他需要考察报告
         if (this.$refs['GoodsInfo'].scenefile.FileUrl.length <= 0) {
           this.$notify({
             title: '提示',
             message: '请上传现场考察报告!',
             type: 'warning'
-          });
+          })
           return false
         }
       }
@@ -1812,6 +1810,58 @@ export default {
           console.error(err)
         })
     },
+    secondaryUnitSubmitApply (val) {
+      if (this.auditer === '') {
+        this.$message({
+          type: 'warning',
+          message: '请选择初审人!'
+        })
+        return
+      }
+      if (this.fushenauditer === '') {
+        this.$message({
+          type: 'warning',
+          message: '请选择复审人!'
+        })
+        return
+      }
+      if (this.selectDept === 0 || this.selectDept == '') {
+        this.$message({
+          type: 'warning',
+          message: '请选择专业处室!'
+        })
+        return
+      }
+      this.loading = true
+      this.applyLoading = true
+      let params = {
+        'FirstAudit': this.auditer,
+        'SecondAudit': this.fushenauditer,
+        'ThirdAudit': this.selectDept, // this.majorDept[this.majorDept.length - 1] 专业处室部门id
+        'AuditRemark': this.auditform.AuditRemark
+      }
+      console.log(params)
+      apiCert.unitAuditEntity(this.certId, params, this.$axios).then(res => {
+        if (res.data.code === 0) {
+          // 保存成功后,初始化数据,变成修改
+          this.initDatas()
+          this.dialogVisible = false
+          this.$message({
+            type: 'success',
+            message: res.data.message
+          })
+        } else {
+          this.$message({
+            type: 'warning',
+            message: res.data.message
+          })
+        }
+        this.applyLoading = false
+        this.loading = false
+      }).catch(err => {
+        console.error(err)
+      })
+    },
     SubpEntity () {
       if (this.orgauditOptions == null || this.orgauditOptions.length === 0) {
         this.$message({

+ 144 - 48
src/dashoo.cn/frontend_web/src/pages/oilsupplier/supplieraudit/_opera/goodsedit.vue

@@ -8,16 +8,14 @@
     <el-card class="box-card">
       <div slot="header">
         <span>
-          <i class="icon icon-table2"></i> 审批
+          <i class="icon icon-table2"></i> 审批-{{auditBtn}}
         </span>
         <span style="float: right;">
-          <!--<el-button type="primary" size="mini" style="margin-left: 8px" @click="allocationBtn" v-if="this.formData.Status == '3'">提交专业审批</el-button>-->
-          <!--<el-button type="primary" size="mini" style="margin-left: 8px" @click="AuditEntity" v-if="auditBtn && this.formData.Status != '6'">{{auditTitle}}</el-button>-->
-          <el-button type="primary" size="mini" style="margin-left: 8px" @click="AuditEntity()"
+          <el-button type="primary" size="mini" style="margin-left: 8px" @click="commonAuditClick()"
             v-if="auditBtn && this.formData.Status == '1'">初审</el-button>
-          <el-button type="primary" size="mini" style="margin-left: 8px" @click="AuditEntity()"
+          <el-button type="primary" size="mini" style="margin-left: 8px" @click="commonAuditClick()"
             v-if="auditBtn && this.formData.Status == '2'">复审</el-button>
-          <el-button type="primary" size="mini" style="margin-left: 8px" @click="AuditEntity()"
+          <el-button type="primary" size="mini" style="margin-left: 8px" @click="businessOfficeSeparateAuditClick()"
             v-if="auditBtn && this.formData.Status == '3' && this.formData.InStyle != '2'">提交专业审核</el-button>
           <el-button type="primary" size="mini" style="margin-left: 8px" @click="AuditEntity()"
             v-if="auditBtn && this.formData.Status == '4' && this.formData.InStyle != '2'">专业审核</el-button>
@@ -174,7 +172,7 @@
             <div slot="header" class="clearfix">
               <span>审批流程</span>
             </div>
-            <wf-multi-history :entryinfo="entrydetail"></wf-multi-history>
+            <wf-history :entryinfo="entrydetail"></wf-history>
           </el-card>
         </el-tab-pane>
 
@@ -191,20 +189,6 @@
     </el-card>
     <el-dialog :title="atitle" :visible.sync="dialogMakeSure">
       <el-form :model="shenheForm" label-width="100px" ref="shenheForm">
-        <!-- <el-form-item label="专业科室" v-if="this.formData.Status == '1'"> -->
-        <!--<el-select ref="selectauditOrg" v-model="majorDept" placeholder="请选择"-->
-        <!--style="width: 90%" 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-cascader :options="orgtreelist" :props="orgtreeprops" change-on-select :show-all-levels="false" filterable
-            style="width: 100%" v-model="majorDept" placeholder="请选择组织">
-          </el-cascader>
-        </el-form-item> -->
         <el-form-item :label="aduitlabel" v-if="this.formData.Status == '3'">
           <el-select ref="selectAuditer" v-model="auditer" placeholder="请选择" style="width: 100%" filterable allow-create
             default-first-option>
@@ -229,6 +213,25 @@
         <el-button type="primary" size="small" @click="makeSure()" :loading="loading">确 定</el-button>
       </div>
     </el-dialog>
+    <el-dialog :title="atitle" :visible.sync="dialogCommonAuditMakeSureVisible">
+      <el-form :model="shenheForm" label-width="100px" ref="shenheForm">
+        <el-form-item label="审核状态">
+          <template>
+            <el-radio class="radio" v-model="shenheForm.SuccessStatus" :label="1" @change="radioChange">通过</el-radio>
+            <el-radio class="radio" v-model="shenheForm.SuccessStatus" :label="2" @change="radioChange">退回</el-radio>
+          </template>
+        </el-form-item>
+        <el-form-item porp="AuditorRemark" label="意见"
+                      :rules="[{ required: true, message: '请输入审批意见', trigger: 'blur' }]">
+          <el-input type="textarea" v-model="shenheForm.AuditorRemark" :placeholder="textplaceholder"
+                    minlength="20"></el-input>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer" style="margin-top: -25px">
+        <el-button size="small" @click="dialogCommonAuditMakeSureVisible = false">取 消</el-button>
+        <el-button type="primary" size="small" @click="commonAuditMakeSure()" :loading="loading">确 定</el-button>
+      </div>
+    </el-dialog>
     <el-dialog title="审核" :visible.sync="dialogMakeSure2">
       <el-form :model="shenheForm" label-width="100px" ref="shenheForm">
 
@@ -271,16 +274,10 @@
         <el-button type="primary" size="small" @click="makeSure()" :loading="loading">确 定</el-button>
       </div>
     </el-dialog>
-    <el-dialog title="提交领导审核" :visible.sync="dialogAllocation">
+    <el-dialog title="提交领导审核" :visible.sync="dialogBusinessOfficeSeparateAuditVisible">
       <el-form :model="shenheForm" label-width="100px" ref="shenheForm">
-        <!-- <el-form-item label="审批人部门">
-          <el-cascader :options="secorgtreelist" :props="orgtreeprops" change-on-select :show-all-levels="false"
-                       filterable style="width: 100%" @change="auditOrgChange"
-                       placeholder="请选择组织">
-          </el-cascader>
-        </el-form-item> -->
         <el-form-item label="审批人">
-          <el-select ref="selectAuditer" v-model="auditer" placeholder="请选择" style="width: 100%" filterable allow-create
+          <el-select ref="selectAuditer" v-model="ProfessionalAudit" placeholder="请选择" style="width: 100%" filterable allow-create
             default-first-option>
             <el-option v-for="item in secauditerOptions" :key="item.Id" :label="item.Realname" :value="item.Id">
             </el-option>
@@ -291,8 +288,8 @@
         </el-form-item>
       </el-form>
       <div slot="footer" class="dialog-footer" style="margin-top: -25px">
-        <el-button size="small" @click="dialogAllocation = false">取 消</el-button>
-        <el-button type="primary" size="small" @click="makeSure()" :loading="loading">确 定</el-button>
+        <el-button size="small" @click="dialogBusinessOfficeSeparateAuditVisible = false">取 消</el-button>
+        <el-button type="primary" size="small" @click="businessOfficeSeparateAuditMakeSure()" :loading="loading">确 定</el-button>
       </div>
     </el-dialog>
     <el-dialog title="提交初审" :visible.sync="dialogVisible" width="520px">
@@ -378,8 +375,6 @@
   import apiCert from '@/api/oilsupplier/suppliercert'
   import SupplierFileTable from '@/pages/oilsupplier/supplierfile/table.vue'
   import WfHistory from '@/components/workflow/wfhistory.vue'
-  import WfMultiHistory from '@/components/workflow/wfmultihistory.vue'
-  import WfBackHistory from '@/components/workflow/wfbackhistory.vue'
   import SupplierCertEdit from '@/components/oilsupplier/suppliercertedit.vue'
 
   import EquipmentList from '@/components/oilsupplier/equipmentlist'
@@ -396,8 +391,6 @@
       ChooseAuditor,
       SupplierFileTable,
       WfHistory,
-      WfBackHistory,
-      WfMultiHistory,
       SupplierCertEdit,
 
       EquipmentList, // 企业主要设备
@@ -423,9 +416,12 @@
         backRemark: '',
         textplaceholder: '审核意见须具体、明确(含企业资质、资信、能力等内容,不少于20字)',
         auditer: '',
+        ProfessionalAudit: '', // 业务处室专业审批人id
         auditerName: '',
         dialogVisible: false,
         chooseAuditorVisible: false,
+        dialogCommonAuditMakeSureVisible: false,
+        dialogSecondAuditMakeSureVisible: false,
         equipmentList: [], // 企业主要设备
         performanceList: [], // 近三年主要业绩
         patentList: [], // 专利及专有技术
@@ -457,7 +453,7 @@
         dictData: null,
         dialogMakeSure: false,
         dialogMakeSure2: false,
-        dialogAllocation: false,
+        dialogBusinessOfficeSeparateAuditVisible: false,
         add_flat: false,
         delete_flat: true,
         aduitlabel: '审核人',
@@ -628,7 +624,7 @@
             this.shenheForm.AuditorRemark = ''
           }
         } else {
-          if (this.shenheForm.SuccessStatus === 1){
+          if (this.shenheForm.SuccessStatus === 1) {
             this.textplaceholder = '审核意见须具体、明确(含企业资质、资信、能力等内容,不少于20字)'
           } else {
             this.textplaceholder = '退回意见不能少于5个字'
@@ -685,7 +681,6 @@
             console.error(err)
           })
       },
-
       initDatas () {
         if (this.formData.Id) {
           api.getEntityAndCert(this.certId, this.$axios).then(res => {
@@ -789,7 +784,6 @@
           console.log(err)
         })
       },
-
       getDictOptions () {
         let params = {
           status: this.formData.Status,
@@ -818,7 +812,7 @@
             console.error(err)
           })
       },
-      getorgtreelistbydeptid() {
+      getorgtreelistbydeptid () {
         let _this = this
         let params = {
           IsInnerOrganize: 1
@@ -867,12 +861,10 @@
           }
         })
       },
-
       // 保存信息
       saveCertEntity () {
         this.$refs['SupplierCertEditCompoment'].saveEntity()
       },
-
       addEntity () {
         this.formData.SupplierTypeCode = '02'
         this.formData.SupplierTypeName = '物资类'
@@ -896,7 +888,6 @@
           console.error(err)
         })
       },
-
       updateEntity () {
         api.updateEntity(this.formData.Id, this.formData, this.$axios).then(res => {
           if (res.data.code === 0) {
@@ -916,7 +907,6 @@
           console.error(err)
         })
       },
-
       CheckCompanyBase () {
         if (!this.formData.Id) {
           this.$message({
@@ -970,10 +960,11 @@
         })
       },
       AuditEntity (val) {
+        console.log('专业审核01')
         this.auditOrgChange()
         this.btnstatus = val
         if (this.formData.Status === '3') {
-          this.dialogAllocation = true
+          this.dialogBusinessOfficeSeparateAuditVisible = true
         } else if (this.formData.Status === '1') {
           this.dialogMakeSure2 = true
         } else if (this.formData.Status === '10') {
@@ -981,12 +972,117 @@
           this.changeOrgUnit(this.selectDept)
           this.dialogVisible = true
         } else {
+          console.log('专业审核05')
           this.dialogMakeSure = true
           this.radioChange()
         }
       },
-      allocationBtn () {
-        this.dialogAllocation = true
+      // 二级单位——初审会话框
+      commonAuditClick () {
+        console.log('审批会话框')
+        this.dialogCommonAuditMakeSureVisible = true
+        this.radioChange()
+      },
+      // 二级单位————初审结果提交
+      commonAuditMakeSure () {
+        console.log('审批结果提交')
+        if (this.shenheForm.SuccessStatus === 1) {
+          if (this.shenheForm.AuditorRemark.trim().length < 20 && this.formData.Status !== '3' && this.formData.Status !== '5' && this.formData.Status !== '10') {
+            this.$message({
+              type: 'warning',
+              message: '审批意见不能低于20个字符!'
+            })
+            return
+          }
+          if (this.shenheForm.AuditorRemark.trim().length < 1 && this.formData.Status === '5') {
+            this.$message({
+              type: 'warning',
+              message: '请填写审批意见!'
+            })
+            return
+          }
+        } else {
+          if (this.shenheForm.AuditorRemark.trim().length < 5 && this.formData.Status !== '3' && this.formData.Status !== '5') {
+            this.$message({
+              type: 'warning',
+              message: '退回意见不能低于5个字符!'
+            })
+            return
+          }
+          if (this.shenheForm.AuditorRemark.trim().length < 1 && this.formData.Status === '5') {
+            this.$message({
+              type: 'warning',
+              message: '请填写退回意见!'
+            })
+            return
+          }
+        }
+        this.loading = true
+        let params = {
+          result: this.shenheForm.SuccessStatus,
+          AuditRemark: this.shenheForm.AuditorRemark
+        }
+        console.log('审批结果提交参数:', params)
+        apiCert.commonAuditEntity(this.certId, params, this.$axios).then(res => {
+          if (res.data.code === 0) {
+            console.log('审批提交,成功返回')
+            this.initDatas()
+            this.$message({
+              type: 'success',
+              message: res.data.message
+            })
+          } else {
+            this.$message({
+              type: 'warning',
+              message: res.data.message
+            })
+          }
+          this.dialogCommonAuditMakeSureVisible = false
+          this.loading = false
+        }).catch(err => {
+          console.error(err)
+        })
+      },
+      // 业务处室接收——分办
+      businessOfficeSeparateAuditClick (val) {
+        console.log('业务处室接收————分办')
+        this.auditOrgChange()
+        console.log('请求部门结束')
+        this.dialogBusinessOfficeSeparateAuditVisible = true
+      },
+      businessOfficeSeparateAuditMakeSure () {
+        if (this.ProfessionalAudit === '') {
+          this.$message({
+            type: 'warning',
+            message: '请选择审批人!'
+          })
+          return
+        }
+        this.loading = true
+        let params = {
+          ProfessionalAudit: this.ProfessionalAudit,
+          AuditRemark: this.shenheForm.AuditorRemark
+        }
+        console.log('业务处室专业审批, 提交参数: ', params)
+        apiCert.businessOfficeSeparateAuditEntity(this.certId, params, this.$axios).then(res => {
+          if (res.data.code === 0) {
+            console.log('审批提交,成功返回')
+            this.initDatas()
+            this.$message({
+              type: 'success',
+              message: res.data.message
+            })
+          } else {
+            this.$message({
+              type: 'warning',
+              message: res.data.message
+            })
+          }
+          this.dialogBusinessOfficeSeparateAuditVisible = false
+          this.loading = false
+        }).catch(err => {
+          console.error(err)
+        })
       },
       // 审核通过
       makeSure () {
@@ -1101,7 +1197,7 @@
               this.initDatas()
               this.dialogVisible = false
               this.dialogMakeSure = false
-              this.dialogAllocation = false
+              this.dialogBusinessOfficeSeparateAuditVisible = false
               this.dialogMakeSure2 = false
             }
             this.$message({

+ 1 - 0
src/dashoo.cn/frontend_web/src/pages/signup.vue

@@ -589,6 +589,7 @@
                 type: 'warning',
                 message: '该单位没有审核人!'
               })
+              this.isLoading = false
               return
             }
             let _this = this