Browse Source

信息变更申请, 交费回调后的方法处理

baichengfei 5 năm trước cách đây
mục cha
commit
8d437e3d1a

+ 4 - 0
src/dashoo.cn/backend/api/business/oilsupplier/infochange/infochange.go

@@ -16,7 +16,9 @@ type OilInfoChange struct {
 	FirstAudit          int       `xorm:"default 0 comment('初审') INT(11)"`
 	SecondAudit         int       `xorm:"default 0 comment('复审') INT(11)"`
 	Step                int       `xorm:"comment('页面上第几步') INT(10)"`
+	CommitComId      string       `xorm:"default '0' comment('提交二级单位Id') VARCHAR(50)"`
 	BusinessKey         string    `xorm:"VARCHAR(255)"`
+	ProcessKey         string     `xorm:"VARCHAR(255)"`
 	WorkFlowId          string    `xorm:"comment('工作流的ID') VARCHAR(50)"`
 	OldSupplierName     string    `xorm:"comment('曾用名') VARCHAR(255)"`
 	SupplierTypeCode    string    `xorm:"comment('准入类别代码(1 物资类,2 基建类,3 技术服务类)') VARCHAR(5)"`
@@ -103,7 +105,9 @@ type Del_OilInfoChange struct {
 	FirstAudit          int       `xorm:"default 0 comment('初审') INT(11)"`
 	SecondAudit         int       `xorm:"default 0 comment('复审') INT(11)"`
 	Step                int       `xorm:"comment('页面上第几步') INT(10)"`
+	CommitComId      string    	  `xorm:"default '0' comment('提交二级单位Id') VARCHAR(50)"`
 	BusinessKey         string    `xorm:"VARCHAR(255)"`
+	ProcessKey         string     `xorm:"VARCHAR(255)"`
 	WorkFlowId          string    `xorm:"comment('工作流的ID') VARCHAR(50)"`
 	OldSupplierName     string    `xorm:"comment('曾用名') VARCHAR(255)"`
 	SupplierTypeCode    string    `xorm:"comment('准入类别代码(1 物资类,2 基建类,3 技术服务类)') VARCHAR(5)"`

+ 3 - 1
src/dashoo.cn/backend/api/business/oilsupplier/suppliercert/oilsuppliercert.go

@@ -158,13 +158,15 @@ const (
 	PAYING_AUDIT_STATUS    string = "6"   //待交费
 	STOREING_STATUS        string = "7"   //待入库
 	STORE_STATUS           string = "8"   //已入库
+	LAW_AUDIT_STATUS	   string = "9"	  //企管法规处通过
 	FEN_TRIAL_STATUS       string = "10"  //二级单位分办
-	NO_FEN_TRIAL_STATUS    string = "-10" //二级单位分办未通过
 	NOPASS_STATUS          string = "-1"  // 初审未通过
 	NO_SECOND_TRIAL_STATUS string = "-2"  // 复审未通过
 	NO_THIRD_TRIAL_STATUS  string = "-3"  // 专业处接收未通过
 	NO_PROF_AUDIT_STATUS   string = "-4"  // 专业处室未通过
 	NO_CENT_AUDIT_STATUS   string = "-5"  // 集中评审未通过
+	NO_LAW_AUDIT_STATUS	   string = "9"	  // 企管法规处未通过
+	NO_FEN_TRIAL_STATUS    string = "-10" //二级单位分办未通过
 	ALL_PASE_STATUS        string = "11"  //审核完成
 
 	DOOGS_TYPECODE string = "01" // 物资类

+ 2 - 2
src/dashoo.cn/backend/api/business/paymentinfo/paymentinfo.go

@@ -15,7 +15,7 @@ type OilPaymentInfo struct {
 	IsInvoice      string    `xorm:"comment('是已开发票 1 是 0否') VARCHAR(5)"`
 	IsVerify       string    `xorm:"comment('是否对账 1 是 0否') VARCHAR(5) DEFAULT '0'"`
 	PayMode        string    `xorm:"comment('缴费方式') VARCHAR(10)"`
-	PayType        string    `xorm:"comment('缴费类型 1 准入缴费 2 年审缴费 3 增项缴费 4 换证 5罚款 6其它') VARCHAR(10)"`
+	PayType        string    `xorm:"comment('缴费类型 1 准入缴费 2 年审缴费 3 增项缴费 4 换证 5罚款 6其它 7信息变更') VARCHAR(10)"`
 	PayDate        time.Time `xorm:"comment('缴费日期') DATETIME"`
 	VerifyDate     time.Time `xorm:"comment('对账时间') DATETIME"`
 	BankSerialNum  string    `xorm:"comment('银行流水号') VARCHAR(50)"`
@@ -43,7 +43,7 @@ type Del_OilPaymentInfo struct {
 	IsPay          string    `xorm:"comment('是否缴费 0待缴费 1缴费确认 2已缴费') VARCHAR(5)"`
 	IsInvoice      string    `xorm:"comment('是已开发票 1 是 0否') VARCHAR(5)"`
 	PayMode        string    `xorm:"comment('缴费方式') VARCHAR(10)"`
-	PayType        string    `xorm:"comment('缴费类型 1 准入缴费 2 年审缴费 3 增项缴费 4 换证 5罚款 6其它') VARCHAR(10)"`
+	PayType        string    `xorm:"comment('缴费类型 1 准入缴费 2 年审缴费 3 增项缴费 4 换证 5罚款 6其它 7信息变更') VARCHAR(10)"`
 	PayDate        time.Time `xorm:"comment('缴费日期') DATETIME"`
 	BankSerialNum  string    `xorm:"comment('银行流水号') VARCHAR(50)"`
 	BankName       string    `xorm:"comment('银行名称') VARCHAR(100)"`

+ 1 - 0
src/dashoo.cn/backend/api/business/workflow/workflow.go

@@ -169,6 +169,7 @@ const (
 	PAYING_FEE string = "PAYING_FEE"
 	// 企业法规处审核
 	PROF_REGULATION string = "PROF_REGULATION"
+	PROF_REGULATION_STORAGE string = "PROF_REGULATION_STORAGE"
 	// 企业用户注册
 	COMPONY_AUDIT string = "COMPONY_AUDIT"
 )

+ 5 - 0
src/dashoo.cn/backend/api/controllers/base.go

@@ -366,6 +366,11 @@ func (this *BaseController) Prepare() {
 			fmt.Println("/api/annual-listener/")
 			break
 		}
+		if strings.Contains(this.Ctx.Input.URL(), "/api/info-change-listener/") {
+			find = true
+			fmt.Println("/api/info-change-listener/")
+			break
+		}
 	}
 
 	if !find { // 如果是登录操作不做验证

+ 309 - 0
src/dashoo.cn/backend/api/controllers/oilsupplier/infoChangeListener.go

@@ -0,0 +1,309 @@
+package oilsupplier
+
+import (
+	"dashoo.cn/backend/api/business/auditsetting"
+	msg2 "dashoo.cn/backend/api/business/msg"
+	"dashoo.cn/backend/api/business/oilsupplier/infochange"
+	"dashoo.cn/backend/api/business/oilsupplier/oilcostmanage"
+	"dashoo.cn/backend/api/business/oilsupplier/supplier"
+	"dashoo.cn/backend/api/business/oilsupplier/suppliercert"
+	"dashoo.cn/backend/api/business/oilsupplier/suppliercertappend"
+	"dashoo.cn/backend/api/business/paymentinfo"
+	"dashoo.cn/backend/api/business/workflow"
+	. "dashoo.cn/backend/api/controllers"
+	baseparameter "dashoo.cn/business2/parameter"
+	"dashoo.cn/utils"
+	"encoding/json"
+	"strconv"
+	"strings"
+	"time"
+)
+
+type OilInfoChangeListenerController struct {
+	BaseController
+}
+
+// @Title 获取二级单位分办人员列表 --回调
+// @Description get user by token
+// @Success 200 {string} string
+// @router /pre-fen-trail [post]
+func (this *OilInfoChangeListenerController) PreFenTrialStatus() {
+	var jsonBlob = this.Ctx.Input.RequestBody
+	var listenerApprove ListenerApproveParams
+	json.Unmarshal(jsonBlob, &listenerApprove)
+	infoId := strings.Split(listenerApprove.BusinessKey, "-")[0]
+
+	infoSrv := infochange.GetInfoChangeService(utils.DBE)
+	var infoChangeEntity infochange.OilInfoChange
+	infoSrv.GetEntityById(infoId, &infoChangeEntity)
+	cols := []string{
+		"Id",
+		"Status",
+	}
+	//进入此步骤,记录在数据库中
+	infoChangeEntity.Status = suppliercert.FEN_TRIAL_STATUS //二级单位分办
+	infoSrv.UpdateEntityByIdCols(infoId, infoChangeEntity, cols)
+
+	//查出二级单位分办的人员
+	stepCode := workflow.GetWorkFlowStepCode(infoChangeEntity.SupplierTypeCode)
+	auditSettingService := auditsetting.GetOilAuditSettingService(utils.DBE)
+	approverIds := auditSettingService.GetApproverIdsByStepCodeAndUnitId(stepCode, infoChangeEntity.CommitComId)
+	var approveInfo ListenerApproveInfo
+	approveInfo.Users = approverIds
+	this.Data["json"] = &approveInfo
+	this.ServeJSON()
+}
+
+// @Title 获取二级单位初审人员列表--回调
+// @Description get user by token
+// @Success 200 {string} string
+// @router /pre-first-trail [get]
+func (this *OilInfoChangeListenerController) PreFirstTrail() {
+	businessKey := this.GetString("businessKey")
+	infoId := strings.Split(businessKey, "-")[0]
+
+	infoSrv := infochange.GetInfoChangeService(utils.DBE)
+	var infoChangeEntity infochange.OilInfoChange
+	infoSrv.GetEntityById(infoId, &infoChangeEntity)
+	cols := []string{
+		"Id",
+		"Status",
+	}
+	//进入此步骤,记录在数据库中
+	infoChangeEntity.Status = suppliercert.FIRST_TRIAL_STATUS //二级单位初审
+	infoSrv.UpdateEntityByIdCols(infoId, infoChangeEntity, cols)
+
+	//返回查出的初审人员操作人员列表
+	approverIds := infoChangeEntity.FirstAudit
+	this.Data["json"] = approverIds
+	this.ServeJSON()
+}
+
+// @Title 获取二级单位复审人员列表--回调
+// @Description get user by token
+// @Success 200 {string} string
+// @router /pre-second-trail [get]
+func (this *OilInfoChangeListenerController) PreSecondTrail() {
+	businessKey := this.GetString("businessKey")
+	infoId := strings.Split(businessKey, "_")[0]
+
+	infoSrv := suppliercertappend.GetOilSupplierCertAppendService(utils.DBE)
+	var infoChangeEntity infochange.OilInfoChange
+	infoSrv.GetEntityById(infoId, &infoChangeEntity)
+	cols := []string{
+		"Id",
+		"Status",
+	}
+	//进入此步骤,记录在数据库中
+	infoChangeEntity.Status = suppliercert.SECOND_TRIAL_STATUS //二级单位复审
+	infoSrv.UpdateEntityByIdCols(infoId, infoChangeEntity, cols)
+
+	//返回查出的复审人员操作人员列表
+	approverIds := infoChangeEntity.SecondAudit
+	this.Data["json"] = approverIds
+	this.ServeJSON()
+}
+
+// @Title 企业法规处审批人员列表 --回调
+// @Description get user by token
+// @Success 200 {string} string
+// @router /law-office-auditors [post]
+func (this *OilInfoChangeListenerController) GetLawOfficeAuditors() {
+	var jsonBlob = this.Ctx.Input.RequestBody
+	var listenerApprove ListenerApproveParams
+	json.Unmarshal(jsonBlob, &listenerApprove)
+	infoId := strings.Split(listenerApprove.BusinessKey, "-")[0]
+
+	svc := infochange.GetInfoChangeService(utils.DBE)
+	var infoChangeEntity infochange.OilInfoChange
+	svc.GetEntityById(infoId, &infoChangeEntity)
+	cols := []string{
+		"Id",
+		"Status",
+	}
+	//进入此步骤,记录在数据库中
+	infoChangeEntity.Status = suppliercert.CENT_AUDIT_STATUS //企业法规处
+	svc.UpdateEntityByIdCols(infoId, infoChangeEntity, cols)
+
+	//查出企业法规处审批的人员
+	stepCode := workflow.PROF_REGULATION //企业法规处
+	auditSettingService := auditsetting.GetOilAuditSettingService(utils.DBE)
+	approverIds := auditSettingService.GetApproverIdsByStepCodeForConcentrateAudit(stepCode)
+	var approveInfo ListenerApproveInfo
+	approveInfo.Users = approverIds
+	this.Data["json"] = &approveInfo
+	this.ServeJSON()
+}
+
+// @Title 查询是否交费--回调
+// @Description get user by token
+// @Success 200 {string} string
+// @router /check-need-pay [get]
+func (this *OilInfoChangeListenerController) CheckNeedPay() {
+	businessKey := this.GetString("businessKey")
+	infoId := strings.Split(businessKey, "-")[0]
+
+	infoSrv := suppliercertappend.GetOilSupplierCertAppendService(utils.DBE)
+	var infoChangeEntity infochange.OilInfoChange
+	infoSrv.GetEntityById(infoId, &infoChangeEntity)
+
+	paramSvc := baseparameter.GetBaseparameterService(utils.DBE)
+	isPay, _ := strconv.Atoi(paramSvc.GetBaseparameterMessage("PAYCHECK", "paramset", "isPayFeeForInfoChange"))
+
+	// 1交费, 2不交费
+	this.Data["json"] = isPay
+	this.ServeJSON()
+}
+
+// @Title 获取交费人--回调
+// @Description get user by token
+// @Success 200 {string} string
+// @router /pre-payer [get]
+func (this *OilInfoChangeListenerController) GetPrePayer() {
+	businessKey := this.GetString("businessKey")
+	infoId := strings.Split(businessKey, "-")[0]
+	infoSrv := suppliercertappend.GetOilSupplierCertAppendService(utils.DBE)
+	var infoChangeEntity infochange.OilInfoChange
+	infoSrv.GetEntityById(infoId, &infoChangeEntity)
+
+	cols := []string{
+		"Id",
+		"Status",
+	}
+	//进入此步骤,记录在数据库中
+	infoChangeEntity.Status = suppliercert.PAYING_AUDIT_STATUS //待缴费
+	infoSrv.UpdateEntityByIdCols(infoId, infoChangeEntity, cols)
+
+	// 信息变更审批通过且需要交费, 创建交费信息
+	supplierSrv := supplier.GetOilSupplierService(utils.DBE)
+	var supplierEntity supplier.OilSupplier
+	supplierSrv.GetEntityById(infoChangeEntity.SupplierId, &supplierEntity)
+
+	paySvc := paymentinfo.GetPaymentService(utils.DBE)
+	var Amount float64
+	costSvc := oilcostmanage.GetOilCostManageService(utils.DBE)
+	Amount = costSvc.GetAmount("INFOCHANGE", "01")	// 不区分类别 2020.08.30
+	var payInfo paymentinfo.OilPaymentInfo
+	payInfo.SrcId = infoChangeEntity.Id
+	payInfo.SupplierId = infoChangeEntity.SupplierId
+	payInfo.SupplierCertId = infoChangeEntity.Id
+	payInfo.USCCode = supplierEntity.CommercialNo
+	payInfo.SupplierName = supplierEntity.SupplierName
+	payInfo.PayType = "7" // 信息变更
+	payInfo.IsPay = "0"
+	payInfo.IsInvoice = "0"
+	payInfo.Amount = strconv.FormatFloat(Amount, 'E', -1, 64)
+	payInfo.CreateUserId = infoChangeEntity.CreateUserId
+	payInfo.CreateBy = infoChangeEntity.CreateBy
+	payInfo.CreateOn = time.Now()
+	paySvc.InsertEntity(&payInfo)
+
+	//创建人即为交费的人员
+	approverIds := infoChangeEntity.CreateUserId
+	this.Data["json"] = approverIds
+	this.ServeJSON()
+}
+
+// @Title 企业法规处入库人员列表 --回调
+// @Description get user by token
+// @Success 200 {string} string
+// @router /pre-storage-audit [post]
+func (this *OilInfoChangeListenerController) GetStorageAuditor() {
+	var jsonBlob = this.Ctx.Input.RequestBody
+	var listenerApprove ListenerApproveParams
+	json.Unmarshal(jsonBlob, &listenerApprove)
+	infoId := strings.Split(listenerApprove.BusinessKey, "-")[0]
+
+	certAppendSrv := suppliercertappend.GetOilSupplierCertAppendService(utils.DBE)
+	var infoChangeEntity infochange.OilInfoChange
+	certAppendSrv.GetEntityById(infoId, &infoChangeEntity)
+	cols := []string{
+		"Id",
+		"Status",
+	}
+	//进入此步骤,记录在数据库中
+	infoChangeEntity.Status = suppliercert.STOREING_STATUS //待入库
+	certAppendSrv.UpdateEntityByIdCols(infoId, infoChangeEntity, cols)
+
+	//查出入库审批的人员
+	stepCode := workflow.PROF_REGULATION //待入库(企业法规处)
+	auditSettingService := auditsetting.GetOilAuditSettingService(utils.DBE)
+	approverIds := auditSettingService.GetApproverIdsByStepCodeForConcentrateAudit(stepCode)
+	var approveInfo ListenerApproveInfo
+	approveInfo.Users = approverIds
+	this.Data["json"] = &approveInfo
+	this.ServeJSON()
+}
+
+// @Title 企业法规处审批入库完成, 工作流结束--回调
+// @Description get user by token
+// @Success 200 {string} string
+// @router /workflow-end [get]
+func (this *OilInfoChangeListenerController) WorkflowEndAudit() {
+	businessKey := this.GetString("businessKey")
+	infoId := strings.Split(businessKey, "-")[0]
+	certAppendSrv := suppliercertappend.GetOilSupplierCertAppendService(utils.DBE)
+	var infoChangeEntity infochange.OilInfoChange
+	certAppendSrv.GetEntityById(infoId, &infoChangeEntity)
+
+	cols := []string{
+		"Id",
+		"Status",
+	}
+	//进入此步骤,记录在数据库中
+	infoChangeEntity.Status = suppliercert.STORE_STATUS //已入库
+	certAppendSrv.UpdateEntityByIdCols(infoId, infoChangeEntity, cols)
+
+	this.Data["json"] = 1
+	this.ServeJSON()
+}
+
+// @Title 审批驳回--回调
+// @Description get user by token
+// @Success 200 {string} string
+// @router /approval-refuse [get]
+func (this *OilInfoChangeListenerController) ApprovalRefuse() {
+	businessKey := this.GetString("businessKey")
+	stepCodeStatus := this.GetString("stepCode")
+	infoId := strings.Split(businessKey, "-")[0]
+	infoSrv := suppliercertappend.GetOilSupplierCertAppendService(utils.DBE)
+	var infoChangeEntity infochange.OilInfoChange
+	infoSrv.GetEntityById(infoId, &infoChangeEntity)
+
+	cols := []string{
+		"Id",
+		"Status",
+	}
+	//进入此步骤,记录在数据库中
+	infoChangeEntity.Status = stepCodeStatus
+	infoSrv.UpdateEntityByIdCols(infoId, infoChangeEntity, cols)
+
+	//supplierSrv := supplier.GetOilSupplierService(utils.DBE)
+	//var supplierEntity supplier.OilSupplier
+	//supplierSrv.GetEntityById(infoChangeEntity.SupplierId, &supplierEntity)
+	// 发送驳回通知短信
+	//this.AuditRejectNotice(infoChangeEntity, supplierEntity)
+
+	// TODO 驳回后原工作流的处理, 新工作流的处理
+	this.Data["json"] = 1
+	this.ServeJSON()
+}
+
+// @Title 信息变更申请审核未通过短信通知
+// @Description 审核未通过短信通知
+// @Success	200	{object}
+// @router /audit-reject-notice/:id [post]
+func (this *OilInfoChangeListenerController) AuditRejectNotice(infoChangeEntity infochange.OilInfoChange, supplierEntity supplier.OilSupplier) {
+	toMobile := supplierEntity.Mobile
+	bFlag := ""
+	if infoChangeEntity.SupplierTypeCode == "01" {
+		bFlag = "物资类"
+	} else if infoChangeEntity.SupplierTypeCode == "02" {
+		bFlag = "基建类"
+	} else {
+		bFlag = "服务类"
+	}
+	msg := "您的" + bFlag + "增项审核未通过,请及时查看!"
+	msgService := msg2.GetMsgService(utils.DBE)
+	msgService.HandleMsg(toMobile, msg, "5-1", infoChangeEntity.CreateBy, supplierEntity.ContactName, strconv.Itoa(infoChangeEntity.CreateUserId), this.User.Username)
+}

+ 331 - 0
src/dashoo.cn/backend/api/controllers/oilsupplier/infochange.go

@@ -9,6 +9,7 @@ import (
 	"dashoo.cn/backend/api/business/oilsupplier/suppliercert"
 	"dashoo.cn/backend/api/business/oilsupplier/suppliercertsub"
 	"dashoo.cn/backend/api/business/oilsupplier/supplierfile"
+	"dashoo.cn/backend/api/business/paymentinfo"
 	"dashoo.cn/backend/api/business/register"
 	"dashoo.cn/business2/parameter"
 	"dashoo.cn/business2/permission"
@@ -1533,6 +1534,336 @@ func (this *InfoChangeController) InfoAudit() {
 	}
 }
 
+// @Title 企业用户提交按钮  --启动工作流
+// @Description 企业用户提交按钮
+// @Success	200	{object} controllers.Request
+// @router /company-audit/:id [post]
+func (this *InfoChangeController) CompanyAuditEntity() {
+	infoId := this.Ctx.Input.Param(":id")
+	unitId := this.GetString("unitId")
+	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()
+		}
+	}()
+
+	if this.User.IsCompanyUser == 0 {
+		// 0二级单位; 1企业用户
+		panic("非企业用户,请用分办功能提交!")
+	}
+
+	//取出准入申请表
+	infoSrv := infochange.GetInfoChangeService(utils.DBE)
+	var infoChangeEntity infochange.OilInfoChange
+	infoSrv.GetEntityById(infoId, &infoChangeEntity)
+	// TODO 检查是否可以提交
+	//infoSrv.IsSupplierCertCanSubmit(strconv.Itoa(supplierCertEntity.Id), certId)
+
+	//取出企业主表
+	supplierSvc := supplier.GetOilSupplierService(utils.DBE)
+	var supplierEntity supplier.OilSupplier
+	//检查是否可提交
+	supplierSvc.GetEntityById(infoChangeEntity.SupplierId, &supplierEntity)
+
+	status, _ := strconv.Atoi(infoChangeEntity.Status)
+	if status > 0 {
+		panic("工作流已经启动,请刷新重试!")
+	}
+
+	svcActiviti := workflow.GetActivitiService(utils.DBE)
+	//启动工作流
+	businessKey := infoId + "-" + strconv.Itoa(infoChangeEntity.AuditIndex)
+	processInstanceId := infoChangeEntity.WorkFlowId
+	// 如果被驳回,不再新启工作流
+	if processInstanceId == "" {
+		processInstanceId = svcActiviti.StartProcess2(workflow.OIL_INFO_CHANGE, businessKey, this.User.Id, "1", infoChangeEntity.SupplierTypeCode, supplierEntity.SupplierName)
+		if len(processInstanceId) <= 0 {
+			panic("工作流启动失败!")
+		}
+	}
+	// 将启动和工作流,选择的分办单位id记录下来
+	cols := []string{
+		"Id",
+		"WorkflowId",
+		"BusinessKey",
+		"ProcessKey",
+		"CommitComId",
+		"AuditIndex",
+	}
+	infoChangeEntity.ProcessKey = workflow.OIL_INFO_CHANGE
+	infoChangeEntity.BusinessKey = businessKey
+	infoChangeEntity.WorkFlowId = processInstanceId
+	infoChangeEntity.CommitComId = unitId
+	infoChangeEntity.AuditIndex += 1
+	infoSrv.UpdateEntityByIdCols(infoId, infoChangeEntity, cols)
+
+	var ActiComplete workflow.ActiCompleteVM
+	ActiComplete.ProcessKey = workflow.OIL_INFO_CHANGE
+	ActiComplete.BusinessKey = 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)
+	}
+}
+
+// @Title 二级单位提交审批 --启动工作流
+// @Description 二级单位提交审批
+// @Success	200	{object} controllers.Request
+// @router /unit-audit/:id [post]
+func (this *InfoChangeController) UnitAuditEntity() {
+	infoId := this.Ctx.Input.Param(":id")
+	firstAudit := this.GetString("FirstAudit")
+	secondAudit := this.GetString("SecondAudit")
+	AuditRemark := this.GetString("AuditRemark")
+	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处理失败的异常
+		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()
+		}
+	}()
+
+	//取出准入表信息
+	svc := infochange.GetInfoChangeService(utils.DBE)
+	var infoChangeEntity infochange.OilInfoChange
+	svc.GetEntityById(infoId, &infoChangeEntity)
+	// TODO 检查是否可提交
+	//svc.IsSupplierCertCanSubmit(strconv.Itoa(supplierCertEntity.Id), certId)
+	//取出企业主表
+	supplierSvc := supplier.GetOilSupplierService(utils.DBE)
+	var supplierEntity supplier.OilSupplier
+	supplierSvc.GetEntityById(infoChangeEntity.SupplierId, &supplierEntity)
+
+	svcActiviti := workflow.GetActivitiService(utils.DBE)
+	//启动工作流
+	businessKey := infoId + "-" + strconv.Itoa(infoChangeEntity.AuditIndex)
+	processInstanceId := infoChangeEntity.WorkFlowId
+	// 如果被驳回,不再新启工作流
+	if processInstanceId == "" {
+		processInstanceId = svcActiviti.StartProcess2(workflow.OIL_INFO_CHANGE, businessKey, this.User.Id, "1", infoChangeEntity.SupplierTypeCode, supplierEntity.SupplierName)
+		if len(processInstanceId) <= 0 {
+			panic("工作流启动失败!")
+		}
+	}
+	// 将启动和工作流,选择的初审和复审人员保存下来
+	cols := []string{
+		"Id",
+		"FirstAudit",
+		"SecondAudit",
+		"thirdAudit",
+		"WorkflowId",
+		"BusinessKey",
+		"ProcessKey",
+		"CommitComId",
+		"AuditIndex",
+	}
+	infoChangeEntity.ProcessKey = workflow.OIL_INFO_CHANGE
+	infoChangeEntity.BusinessKey = businessKey
+	infoChangeEntity.WorkFlowId = processInstanceId
+	infoChangeEntity.FirstAudit, _ = strconv.Atoi(firstAudit)
+	infoChangeEntity.SecondAudit, _ = strconv.Atoi(secondAudit)
+	infoChangeEntity.CommitComId = strconv.Itoa(unitId)
+	infoChangeEntity.AuditIndex += 1
+	svc.UpdateEntityByIdCols(infoId, infoChangeEntity, cols)
+
+	var ActiComplete workflow.ActiCompleteVM
+	ActiComplete.ProcessKey = workflow.OIL_INFO_CHANGE
+	ActiComplete.BusinessKey = infoChangeEntity.BusinessKey
+	ActiComplete.UserId = this.User.Id // 当前审批操作人员
+	//ActiComplete.UserNames = secondAudit // 当前审批操作人员
+	ActiComplete.Result = "2" //分办提交给二级单位初审
+	ActiComplete.Remarks = AuditRemark
+	ActiComplete.CallbackUrl = utils.Cfg.MustValue("workflow", "callbackHost")
+	receiveVal := svcActiviti.TaskComplete(ActiComplete)
+	if receiveVal != "true" {
+		panic("工作流异常,请联系管理员!" + receiveVal)
+	}
+}
+
+// @Title 二级单位分办 --审批
+// @Description 二级分办
+// @Success	200	{object} controllers.Request
+// @router /separate-audit/:id [post]
+func (this *InfoChangeController) SeparateAuditEntity() {
+	infoId := this.Ctx.Input.Param(":id")
+	//SuppId := this.GetString("SuppId")
+	firstAudit := this.GetString("FirstAudit")
+	secondAudit := this.GetString("SecondAudit")
+	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()
+		}
+	}()
+
+	// 取出准入表信息
+	infoSrv := infochange.GetInfoChangeService(utils.DBE)
+	var infoChangeEntity infochange.OilInfoChange
+	infoSrv.GetEntityById(infoId, &infoChangeEntity)
+	// 将选择的初审和复审人员保存下来
+	cols := []string{
+		"FirstAudit",
+		"SecondAudit",
+		"thirdAudit",
+	}
+	infoChangeEntity.FirstAudit, _ = strconv.Atoi(firstAudit)
+	infoChangeEntity.SecondAudit, _ = strconv.Atoi(secondAudit)
+	infoSrv.UpdateEntityByIdCols(infoId, infoChangeEntity, cols)
+
+	svcActiviti := workflow.GetActivitiService(utils.DBE)
+	var ActiComplete workflow.ActiCompleteVM
+	ActiComplete.ProcessKey = workflow.OIL_INFO_CHANGE
+	ActiComplete.BusinessKey = infoChangeEntity.BusinessKey
+	ActiComplete.UserId = this.User.Id // 审批人员
+	// ActiComplete.UserNames = secondAudit // 初审人员
+	ActiComplete.Result = "1" //分办完成后只向前走
+	ActiComplete.Remarks = AuditRemark
+	ActiComplete.CallbackUrl = utils.Cfg.MustValue("workflow", "callbackHost")
+	receiveVal := svcActiviti.TaskComplete(ActiComplete)
+	if receiveVal != "true" {
+		panic("工作流异常,请联系管理员!" + receiveVal)
+	}
+}
+
+// @Title 分办之后的各级审批  --审批 包含:二级单位初审、复审, 企管法规处评审
+// @Description 分办之后的各级审批
+// @Success	200	{object} controllers.Request
+// @router /common-audit/:id [post]
+func (this *InfoChangeController) CommonAuditEntity() {
+	infoId := this.Ctx.Input.Param(":id")
+	result := this.GetString("result")
+	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()
+		}
+	}()
+
+	//取出变更表信息
+	infoSrv := infochange.GetInfoChangeService(utils.DBE)
+	var infoChangeEntity infochange.OilInfoChange
+	infoSrv.GetEntityById(infoId, &infoChangeEntity)
+
+	svcActiviti := workflow.GetActivitiService(utils.DBE)
+	var ActiComplete workflow.ActiCompleteVM
+	ActiComplete.ProcessKey = workflow.OIL_INFO_CHANGE
+	ActiComplete.BusinessKey = infoChangeEntity.BusinessKey
+	ActiComplete.UserId = this.User.Id //审批人员
+	ActiComplete.Result = result //前台审批[同意、不同意]
+	ActiComplete.Remarks = AuditRemark
+	ActiComplete.CallbackUrl = utils.Cfg.MustValue("workflow", "callbackHost")
+	receiveVal := svcActiviti.TaskComplete(ActiComplete)
+	if receiveVal != "true" {
+		panic("工作流异常,请联系管理员!" + receiveVal)
+	}
+}
+
+// @Title 交费用户确认交费
+// @Description 交费用户确认交费
+// @Success 200 {object} controllers.Request
+// @router /update-pay-status/:id [post]
+func (this *InfoChangeController) UpdatePayStatus() {
+	infoId := this.Ctx.Input.Param(":id")
+	var errinfo ErrorInfo
+	if infoId == "" {
+		errinfo.Message = "操作失败!请求信息不完整"
+		errinfo.Code = -2
+		this.Data["json"] = &errinfo
+		this.ServeJSON()
+		return
+	}
+	infoSrv := infochange.GetInfoChangeService(utils.DBE)
+	var infoChangeEntity infochange.OilInfoChange
+	infoSrv.GetEntityById(infoId, &infoChangeEntity)
+
+	paySrv := paymentinfo.GetPaymentService(utils.DBE)
+	var paymentInfoEntities []paymentinfo.OilPaymentInfo
+	err := paySrv.GetPaymentInfoBySrcId(infoId, "1", &paymentInfoEntities)
+
+	if err != nil {
+		errinfo.Message = "未知错误,请稍后再试!"
+		errinfo.Code = -1
+		this.Data["json"] = &errinfo
+		this.ServeJSON()
+	}
+
+	if len(paymentInfoEntities) == 1 {
+		for _, item := range  paymentInfoEntities {
+			if item.IsPay == "1" {
+				errinfo.Message = "已确认交费!请耐心等待"
+				errinfo.Code = -1
+				this.Data["json"] = &errinfo
+				this.ServeJSON()
+			}
+			if item.IsPay == "2" {
+				errinfo.Message = "已交费!请勿重复操作!"
+				errinfo.Code = -1
+				this.Data["json"] = &errinfo
+				this.ServeJSON()
+			}
+		}
+	}
+
+	sql :="UPDATE OilPaymentInfo SET IsPay ='1' where SrcId=" + infoId + " and PayType='1'"
+	paySrv.DBE.Exec(sql)
+	errinfo.Message = "确认交费成功!"
+	errinfo.Code = 0
+	this.Data["json"] = &errinfo
+	this.ServeJSON()
+}
+
 //更新供方信息表
 func (this *InfoChangeController) updatesupplier(supname string, suppid int, infoitems []infochange.OilInfoChangeItem, supmodel supplier.OilSupplier) error {
 	svc := infochange.GetInfoChangeService(utils.DBE)

+ 23 - 3
src/dashoo.cn/backend/api/controllers/oilsupplier/paymentinfo.go

@@ -4,6 +4,7 @@ import (
 	"dashoo.cn/backend/api/business/auditsetting"
 	"dashoo.cn/backend/api/business/invoiceinfo"
 	"dashoo.cn/backend/api/business/oilsupplier/annualaudit"
+	"dashoo.cn/backend/api/business/oilsupplier/infochange"
 	"dashoo.cn/backend/api/business/oilsupplier/paymentbankinfo"
 	"dashoo.cn/backend/api/business/oilsupplier/suppliercertappend"
 	"dashoo.cn/backend/api/business/oilsupplier/suppliercertsub"
@@ -614,7 +615,7 @@ func (this *PaymentInfoController) ReceiveMoneyBillList() {
 			var ActiComplete workflow.ActiCompleteVM
 			ActiComplete.ProcessKey = workflow.OIL_ENUSER_SUPPLIER_APPLY
 			ActiComplete.BusinessKey = supplierCertEntity.BusinessKey
-			ActiComplete.UserId = this.User.Id
+			ActiComplete.UserId = strconv.Itoa(supplierCertEntity.CreateUserId)
 			ActiComplete.Result = "1"
 			ActiComplete.Remarks = "交费成功。"
 			ActiComplete.CallbackUrl = utils.Cfg.MustValue("workflow", "callbackHost")
@@ -633,7 +634,7 @@ func (this *PaymentInfoController) ReceiveMoneyBillList() {
 			var ActiComplete workflow.ActiCompleteVM
 			ActiComplete.ProcessKey = workflow.OIL_AUDIT_APPLY
 			ActiComplete.BusinessKey = annualEntity.BusinessKey
-			ActiComplete.UserId = this.User.Id
+			ActiComplete.UserId = strconv.Itoa(annualEntity.CreateUserId)
 			ActiComplete.Result = "1"
 			ActiComplete.Remarks = "交费成功。"
 			ActiComplete.CallbackUrl = utils.Cfg.MustValue("workflow", "callbackHost")
@@ -652,7 +653,26 @@ func (this *PaymentInfoController) ReceiveMoneyBillList() {
 			var ActiComplete workflow.ActiCompleteVM
 			ActiComplete.ProcessKey = workflow.OIL_ENUSER_APPEND_APPLY
 			ActiComplete.BusinessKey = appendEntity.BusinessKey
-			ActiComplete.UserId = this.User.Id
+			ActiComplete.UserId = strconv.Itoa(appendEntity.CreateUserId)
+			ActiComplete.Result = "1"
+			ActiComplete.Remarks = "交费成功。"
+			ActiComplete.CallbackUrl = utils.Cfg.MustValue("workflow", "callbackHost")
+
+			res := svcActiviti.TaskComplete(ActiComplete)
+			if res != "true" {
+				fmt.Println("工作流异常,请联系管理员!" + res)
+				//panic("工作流异常,请联系管理员!" + res)
+			}
+		} else if payItem.PayType == "7" { // 信息变更
+			//取出信息变更表信息
+			infoSrv := infochange.GetInfoChangeService(utils.DBE)
+			var infoChangeEntity infochange.OilInfoChange
+			infoSrv.GetEntityById(payItem.SrcId, &infoChangeEntity)
+
+			var ActiComplete workflow.ActiCompleteVM
+			ActiComplete.ProcessKey = workflow.OIL_INFO_CHANGE
+			ActiComplete.BusinessKey = infoChangeEntity.BusinessKey
+			ActiComplete.UserId = strconv.Itoa(infoChangeEntity.CreateUserId)
 			ActiComplete.Result = "1"
 			ActiComplete.Remarks = "交费成功。"
 			ActiComplete.CallbackUrl = utils.Cfg.MustValue("workflow", "callbackHost")

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

@@ -1045,7 +1045,7 @@ func (this *OilSupplierCertController) IsAccess() {
 		certSrv := suppliercert.GetOilSupplierCertService(utils.DBE)
 		var supplierCertEntity suppliercert.OilSupplierCert
 		certSrv.GetEntityById(id, &supplierCertEntity)
-		res1, res2, res3 := false, false, false
+		res1, res2, res3, res4 := false, false, false, false
 		if strconv.Itoa(supplierCertEntity.CreateUserId) == this.User.Id {
 			res1 = true
 		}
@@ -1061,7 +1061,14 @@ func (this *OilSupplierCertController) IsAccess() {
 		if strconv.Itoa(annualEntity.CreateUserId) == this.User.Id {
 			res3 = true
 		}
-		if res1 || res2 || res3 {
+
+		infoChangeSrv := infochange.GetInfoChangeService(utils.DBE)
+		var infoChangeEntity infochange.OilInfoChange
+		infoChangeSrv.GetEntityById(id, &infoChangeEntity)
+		if strconv.Itoa(infoChangeEntity.CreateUserId) == this.User.Id {
+			res4 = true
+		}
+		if res1 || res2 || res3 || res4 {
 			res = true
 		}
 	} else {
@@ -1358,6 +1365,7 @@ func (this *OilSupplierCertController) SendingSMSSupplierFile() {
 			if this.User != nil {
 				loginName = this.User.Username
 			}
+			// TODO typeCode值
 			msgService.HandleMsg(toMobile, msg, "1-1", item.CreateBy, item.ContactName, strconv.Itoa(item.CreateUserId), loginName)
 		}
 	}

+ 5 - 0
src/dashoo.cn/backend/api/routers/router.go

@@ -269,6 +269,11 @@ func init() {
 				&oilsupplier.OilAnnualListenerController{},
 			),
 		),
+		beego.NSNamespace("/info-change-listener",
+			beego.NSInclude(
+				&oilsupplier.OilInfoChangeListenerController{},
+			),
+		),
 		beego.NSNamespace("/suppliercertsub",
 			beego.NSInclude(
 				&oilsupplier.OilSupplierCertSubController{},

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

@@ -83,7 +83,7 @@ export default {
       data: shenheform
     })
   },
-  commitAuditEntity(entityId, params, myAxios) {
+  commitAuditEntity (entityId, params, myAxios) {
     return myAxios({
       url: '/infochange/commitaudit/' + entityId,
       method: 'post',
@@ -110,7 +110,7 @@ export default {
       method: 'GET'
     })
   },
-  getAuditerByDept(deptId, myAxios) {
+  getAuditerByDept (deptId, myAxios) {
     return myAxios({
       url: '/infochange/getauditerbydept/' + deptId,
       method: 'GET'
@@ -140,5 +140,43 @@ export default {
       url: '/infochange/deletenewfile/' + Id,
       method: 'delete'
     })
+  },
+  // 企业用户提交申请
+  companyAuditEntity (infoId, params, myAxios) {
+    return myAxios({
+      url: '/infochange/company-audit/' + infoId,
+      method: 'post',
+      params: params
+    })
+  },
+  // 二级分办单位提交申请:
+  separateUnitAuditEntity (infoId, params, myAxios) {
+    return myAxios({
+      url: '/infochange/unit-audit/' + infoId,
+      method: 'post',
+      params: params
+    })
+  },
+  // 分办单位审批
+  separateAuditEntity (id, params, myAxios) {
+    return myAxios({
+      url: 'infochange/separate-audit/' + id,
+      method: 'post',
+      params: params
+    })
+  },
+  commonAuditEntity (id, params, myAxios) {
+    return myAxios({
+      url: 'infochange/common-audit/' + id,
+      method: 'post',
+      params: params
+    })
+  },
+  updatePayStatus  (id, params, myAxios) {
+    return myAxios({
+      url: 'infochange/update-pay-status/' + id,
+      method: 'post',
+      params: params
+    })
   }
 }

+ 134 - 95
src/dashoo.cn/frontend_web/src/pages/oilsupplier/infochangech/_opera/auditoperation.vue

@@ -13,14 +13,12 @@
         <span style="float: right;">
           <el-button type="primary" size="mini" style="margin-left: 8px" @click="itemsshow">查看变更项</el-button>
           <el-button type="primary" size="mini" style="margin-left: 8px" @click="auhistory">审批流程</el-button>
-          <el-button type="primary" size="mini" style="margin-left: 8px" @click="fenbanbtn"
-                     v-if="auditBtn && InfoStatusBool()">分办</el-button>
-          <el-button type="primary" size="mini" style="margin-left: 8px" @click="submitInfoChange"
-            v-if="auditBtn && InfoStatus == '1'">初审</el-button>
-          <el-button type="primary" size="mini" style="margin-left: 8px" @click="submitInfoChange"
-            v-if="auditBtn && InfoStatus == '2'">复审</el-button>
-          <el-button type="primary" size="mini" style="margin-left: 8px" @click="submitInfoChange"
-            v-if="auditBtn && InfoStatus == '5'">审批</el-button>
+          <el-button type="primary" size="mini" style="margin-left: 8px" @click="secUnitSeparateAuditBtn" v-if="auditBtn && InfoStatusBool()">分办</el-button>
+          <el-button type="primary" size="mini" style="margin-left: 8px" @click="commonAuditClick" v-if="auditBtn && InfoStatus == '1'">初审</el-button>
+          <el-button type="primary" size="mini" style="margin-left: 8px" @click="commonAuditClick" v-if="auditBtn && InfoStatus == '2'">复审</el-button>
+          <el-button type="primary" size="mini" style="margin-left: 8px" @click="commonAuditClick" v-if="auditBtn && InfoStatus == '5'">审批</el-button>
+          <el-button type="primary" size="mini" style="margin-left: 8px" @click="commonAuditClick" v-if="auditBtn && InfoStatus == '7'">入库审批</el-button>
+          <el-button type="primary" size="mini" style="margin-left: 8px" @click="paySureClick()" v-if="auditBtn && InfoStatus == '6'">交费</el-button>
           <!-- <el-button type="primary" size="mini" @click="submitInfoChange" v-if="InfoStatus > 0">审核</el-button> -->
           <el-button type="primary" size="mini" style="margin-left: 8px;"  onclick="window.history.go(-1)">返回</el-button>
         </span>
@@ -708,7 +706,7 @@
       </el-table>
     </el-dialog>
 
-    <el-dialog title="审核" :visible.sync="commitshow">
+    <el-dialog title="审核" :visible.sync="dialogCommonAuditMakeSureVisible">
       <el-form label-width="120px" :model="shenheForm" ref="EntityFormref">
         <el-row>
           <el-col :span="24">
@@ -728,25 +726,25 @@
         </el-row>
       </el-form>
       <span style="float: right;margin-top:-10px;">
-        <el-button size="small" @click="commitshow = false">取 消</el-button>
-        <el-button type="primary" size="small" @click="makeSure()" :loading="btnloading">确 定</el-button>
+        <el-button size="small" @click="dialogCommonAuditMakeSureVisible = false">取 消</el-button>
+        <el-button type="primary" size="small" @click="commonAuditMakeSure()" :loading="btnloading">确 定</el-button>
       </span>
       <br>
     </el-dialog>
     <el-dialog title="审批流程" :visible.sync="audithistoryshow" width="1200px">
       <wf-multi-history ref="WfHistory" :entryinfo="entrydetail"></wf-multi-history>
     </el-dialog>
-    <el-dialog title="提交申请" :visible.sync="commitshowfen" width="520px">
+    <el-dialog title="提交申请" :visible.sync="dialogSecUnitSeparateVisible" width="520px">
       <el-form label-width="90px" :model="entityForm" ref="EntityFormref">
         <el-row>
-          <el-col :span="24">
-            <el-form-item label="审批状态">
-              <el-radio-group v-model="shenheForm.SuccessStatus">
-                <el-radio :label="1">通过</el-radio>
-                <el-radio :label="0">退回</el-radio>
-              </el-radio-group>
-            </el-form-item>
-          </el-col>
+          <!--<el-col :span="24">-->
+          <!--  <el-form-item label="审批状态">-->
+          <!--    <el-radio-group v-model="shenheForm.SuccessStatus">-->
+          <!--      <el-radio :label="1">通过</el-radio>-->
+          <!--      <el-radio :label="0">退回</el-radio>-->
+          <!--    </el-radio-group>-->
+          <!--  </el-form-item>-->
+          <!--</el-col>-->
           <el-col :span="24" v-if="shenheForm.SuccessStatus == 1">
             <el-form-item label="初审人员">
               <!--<el-input ref="selectAuditer" readonly v-model="auditerName" placeholder="请选择初审人">-->
@@ -789,8 +787,8 @@
         </el-row>
       </el-form>
       <span style="float: right;margin-top:-10px;">
-        <el-button size="small" @click="commitshowfen = false">取 消</el-button>
-        <el-button type="primary" size="small" @click="addInfoChangeAudit()" :loading="btnloading">确 定</el-button>
+        <el-button size="small" @click="dialogSecUnitSeparateVisible = false">取 消</el-button>
+        <el-button type="primary" size="small" @click="secUnitSeparateAuditMakeSure()" :loading="btnloading">确 定</el-button>
       </span>
       <br>
     </el-dialog>
@@ -1107,8 +1105,8 @@
         auditerName: '',
         supplierId: '',
         auditerOption: [],
-        commitshow: false,
-        commitshowfen: false,
+        dialogCommonAuditMakeSureVisible: false,
+        dialogSecUnitSeparateVisible: false,
         InfoData: [],
         AddChangeShow: false,
         selectuserlist: [],
@@ -1116,7 +1114,7 @@
         infochangeForm: {
           SelectItem: '',
           BeChangeInfo: '',
-          ChangeInfo: '',
+          ChangeInfo: ''
         },
         serviceId: '',
         certId: '',
@@ -1165,57 +1163,99 @@
           console.error(err)
         })
       },
-      fenbanbtn () {
+      secUnitSeparateAuditBtn () {
+        this.shenheForm.SuccessStatus = 1
         this.getFirAuditerByDept()
-        this.commitshowfen = true
+        this.dialogSecUnitSeparateVisible = true
       },
-      addInfoChangeAudit () {
-        if (this.shenheForm.SuccessStatus === 1) {
-          if (this.auditer === '') {
-            this.$message({
-              type: 'warning',
-              message: '请选择初审人!'
-            })
-            return
-          }
-          if (this.fushenauditer === '') {
+      secUnitSeparateAuditMakeSure () {
+        if (this.auditer === '') {
+          this.$message({
+            type: 'warning',
+            message: '请选择初审人!'
+          })
+          return
+        }
+        if (this.fushenauditer === '') {
+          this.$message({
+            type: 'warning',
+            message: '请选择复审人!'
+          })
+          return
+        }
+        let params = {
+          SuppId: parseInt(this.SuppId),
+          FirstAudit: this.auditer,
+          SecondAudit: this.fushenauditer,
+          AuditRemark: this.shenheForm.AuditRemark
+        }
+        console.log('二级单位分办审批结果提交参数:', params)
+        this.btnloading = true
+        api.separateAuditEntity(parseInt(this.infoId), params, this.$axios).then(res => {
+          if (res.data.code === 0) {
+            // 保存成功后,初始化数据,变成修改
+            this.initDatas()
+            this.dialogSecUnitSeparateVisible = false
             this.$message({
-              type: 'warning',
-              message: '请选择复审人!'
+              type: 'success',
+              message: res.data.message
             })
-            return
-          }
-        } else {
-          if (this.shenheForm.AuditorRemark.trim().length < 5 && this.formData.Status !== '3') {
+            this.$router.push('/')
+          } else {
             this.$message({
               type: 'warning',
-              message: '退回意见不能低于5个字符!'
+              message: res.data.message
             })
-            return
           }
+          this.btnloading = false
+        }).catch(err => {
+          console.error(err)
+        })
+      },
+      commonAuditClick () {
+        console.log('审批公共会话框')
+        this.dialogCommonAuditMakeSureVisible = true
+        this.radioChange()
+      },
+      paySureClick () {
+        console.log('交费按钮')
+        this.$confirm('是否确认交费', '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(() => {
+          this.payMakeSure()
+        }).catch(() => {
+          this.$message({
+            type: 'info',
+            message: '已取消'
+          })
+        })
+      },
+      payMakeSure () {
+        console.log('交费结果确认')
+        this.loading = true
+        let params = {
+          payStatus: this.payStatus
         }
-        this.shenheForm.SecondAudit = this.fushenauditer
-        this.shenheForm.FirstAudit = parseInt(this.auditer)
-        this.shenheForm.InfoId = parseInt(this.infoId)
-        this.shenheForm.SuppId = parseInt(this.SuppId)
-        this.btnloading = true
-        api.infoAudit(this.shenheForm, this.$axios).then(res => {
+        console.log('交费结果确认提交参数:', this.certId)
+        api.updatePayStatus(parseInt(this.infoId), params, this.$axios).then(res => {
           if (res.data.code === 0) {
-            // 保存成功后,初始化数据,变成修改
-            this.initDatas()
-            this.commitshowfen = false
+            console.log('交费成功')
+            // this.initDatas()
+            this.$router.push('/')
             this.$message({
               type: 'success',
               message: res.data.message
             })
-            this.$router.push('/')
           } else {
             this.$message({
               type: 'warning',
               message: res.data.message
             })
           }
-          this.btnloading = false
+          this.dialogSecUnitSeparateVisible = false
+          this.loading = false
         }).catch(err => {
           console.error(err)
         })
@@ -1307,6 +1347,8 @@
                 this.auditstepcode = 'PROF_REGULATION'
               } else if (this.Infomain[0].Status === '6') {
                 this.auditstepcode = 'PAYING_FEE'
+              } else if (this.Infomain[0].Status === '7') {
+                this.auditstepcode = 'PROF_REGULATION_STORAGE'
               } else if (this.Infomain[0].Status === '10') {
                 this.auditstepcode = 'SUB_OFFICE_BG'
               }
@@ -1683,17 +1725,6 @@
             console.error(err)
           })
       },
-      // getchange(key) {
-      //   if (this.infochangedata) {
-      //     for (var i = 0; i < this.infochangedata.length; i++) {
-      //       if (this.infochangedata[i].SelectItem == key) {
-      //         return true
-      //       }
-      //     }
-      //     return false
-      //   }
-
-      // },
       getDictOptions () {
         let params = {
           status: this.formData.Status,
@@ -1762,14 +1793,47 @@
       },
       // 提交信息变更审核
       submitInfoChange () {
-        this.commitshow = true
+        this.dialogCommonAuditMakeSureVisible = true
       },
       // 审批历史
       auhistory () {
         this.audithistoryshow = true
       },
       // 审核通过
-      makeSure () {
+      commonAuditMakeSure () {
+        let checkRes = this.commonAuditParamsCheck()
+        console.log(checkRes, '审批结果公共提交')
+        if (!checkRes) {
+          return false
+        }
+        let params = {
+          SuppId: parseInt(this.SuppId),
+          result: this.shenheForm.SuccessStatus,
+          AuditRemark: this.shenheForm.AuditorRemark
+        }
+        this.btnloading = true
+        api.commonAuditEntity(parseInt(this.infoId), params, this.$axios).then(res => {
+          if (res.data.code === 0) {
+            // 保存成功后,初始化数据,变成修改
+            this.initDatas()
+            this.dialogCommonAuditMakeSureVisible = false
+            this.$message({
+              type: 'success',
+              message: res.data.message
+            })
+            this.$router.push('/')
+          } else {
+            this.$message({
+              type: 'warning',
+              message: res.data.message
+            })
+          }
+          this.btnloading = false
+        }).catch(err => {
+          console.error(err)
+        })
+      },
+      commonAuditParamsCheck () {
         if (this.shenheForm.SuccessStatus === 1) {
           if (this.shenheForm.AuditorRemark.trim().length < 1 && this.InfoStatus && this.InfoStatus !== '3' && this.InfoStatus !== '5') {
             this.$message({
@@ -1794,32 +1858,7 @@
             return
           }
         }
-        this.infoChangeAuditLaw()
-      },
-      infoChangeAuditLaw () {
-        this.shenheForm.InfoId = parseInt(this.infoId)
-        this.shenheForm.SuppId = parseInt(this.SuppId)
-        this.btnloading = true
-        api.infoAudit(this.shenheForm, this.$axios).then(res => {
-          if (res.data.code === 0) {
-            // 保存成功后,初始化数据,变成修改
-            this.initDatas()
-            this.commitshow = false
-            this.$message({
-              type: 'success',
-              message: res.data.message
-            })
-            this.$router.push('/')
-          } else {
-            this.$message({
-              type: 'warning',
-              message: res.data.message
-            })
-          }
-          this.btnloading = false
-        }).catch(err => {
-          console.error(err)
-        })
+        return true
       },
       handleProjectSizeChange (value) {
         this.sizeProject = value

+ 26 - 17
src/dashoo.cn/frontend_web/src/pages/oilsupplier/infochangech/_opera/operation.vue

@@ -14,14 +14,14 @@
           <el-button type="primary" size="mini" style="margin-left: 8px" @click="itemsshow">查看变更项</el-button>
           <el-button type="primary" size="mini" style="margin-left: 8px" @click="auhistory">审批流程</el-button>
           <el-button type="primary" size="mini" style="margin-left: 8px"
-            v-if="(InfoStatus == 0 || InfoStatus == '' || InfoStatus == -1|| InfoStatus == -2 || InfoStatus == -10 ) && !butnab" @click="saveinfochange">保存
+            v-if="(InfoStatus == 0 || InfoStatus == '' || InfoStatus == -1|| InfoStatus == -2 || InfoStatus == -5 ) && !butnab" @click="saveinfochange">保存
           </el-button>
           <!-- <el-button type="primary" size="mini" style="margin-left: 8px" @click="auhistory">审批历史</el-button> -->
-          <el-button type="primary" size="mini" @click="submitInfoChange"
+          <el-button type="primary" size="mini" @click="companySubmitApplyBtn"
             v-if="(InfoStatus == 0 || InfoStatus == '' || InfoStatus == -1 || InfoStatus == -2 || InfoStatus == -10 || InfoStatus == -5) && !butnab && authUser.Profile.IsCompanyUser == 1">提交分办
           </el-button>
-          <el-button type="primary" size="mini" @click="submitApplyBtn"
-                     v-if="(InfoStatus == 0 || InfoStatus == '' || InfoStatus == -1 || InfoStatus == -2 || InfoStatus == -10) && authUser.Profile.IsCompanyUser == 0 ">提交申请
+          <el-button type="primary" size="mini" @click="separateUnitSubmitApplyBtn"
+                     v-if="(InfoStatus == 0 || InfoStatus == '' || InfoStatus == -1 || InfoStatus == -2 || InfoStatus == -5) && authUser.Profile.IsCompanyUser == 0 ">提交1申请
           </el-button>
           <router-link :to="'/oilsupplier/infochangech'">
             <el-button type="primary" size="mini" style="margin-left: 8px">返回</el-button>
@@ -841,7 +841,7 @@
       </el-form>
       <span style="float: right;margin-top:-10px;">
         <el-button size="small" @click="commitshow = false">取 消</el-button>
-        <el-button type="primary" size="small" @click="addInfoChangeAudit()" :loading="btnloading">确 定</el-button>
+        <el-button type="primary" size="small" @click="separateUnitSubmitAuditMakeSure()" :loading="btnloading">确 定</el-button>
       </span>
       <br>
     </el-dialog>
@@ -849,11 +849,6 @@
       <el-form ref="searchForm" label-width="100px">
         <el-row>
           <el-col :span="24">
-            <!--<el-form-item label="分办人员">-->
-              <!--<el-input ref="selectAuditerFen" readonly v-model="auditerName" placeholder="请选择分办人">-->
-                <!--<el-button slot="append" icon="el-icon-search" @click="chooseAuditorShowFen"></el-button>-->
-              <!--</el-input>-->
-            <!--</el-form-item>-->
             <el-form-item label="分办单位">
               <el-select filterable
                          v-model="UnitOrg"
@@ -880,7 +875,7 @@
       </el-form>
       <span slot="footer" class="dialog-footer">
         <el-button size="mini" @click="ComAuditdialogShow = false">取 消</el-button>
-        <el-button size="mini" type="primary" @click="SubpEntity" :loading="btnloading">确定</el-button>
+        <el-button size="mini" type="primary" @click="companySubmitToSecUnitSeparate" :loading="btnloading">确定</el-button>
       </span>
     </el-dialog>
     <choose-auditor ref="chooseAuditor" @close="setAuditer" @hideChooseAuditer="chooseAuditorVisible=false"
@@ -1599,7 +1594,7 @@
           })
           .catch(() => {})
       },
-      SubpEntity () {
+      companySubmitToSecUnitSeparate () {
         if (this.UnitOrg === '') {
           this.$message({
             type: 'warning',
@@ -1617,10 +1612,15 @@
         this.entityForm.auditer = this.UnitOrg
         this.entityForm.MInfoId = this.MInfoId
         this.btnloading = true
-        api.commitAuditEntity(this.supplierId, this.entityForm, this.$axios).then(res => {
+        let params = {
+          unitId: this.UnitOrg,
+          AuditRemark: this.entityForm.Remark
+        }
+        api.companyAuditEntity(this.MInfoId, params, this.$axios).then(res => {
           if (res.data.code === 0) {
             // 保存成功后,初始化数据,变成修改
             this.initDatas()
+            this.$router.push('/')
             this.ComAuditdialogShow = false
             this.butnab = true
             this.$message({
@@ -2564,7 +2564,7 @@
         this.formData.LinkAllAddress = this.linkaddress[0] + '/' + this.linkaddress[1] + '/' + this.linkaddress[2]
       },
       // 提交信息变更审核
-      submitInfoChange () {
+      companySubmitApplyBtn () {
         // this.commitshow = true
         this.ComAuditdialogShow = true
       },
@@ -2578,12 +2578,15 @@
           console.error(err)
         })
       },
-      submitApplyBtn () {
+      separateUnitSubmitApplyBtn () {
         this.saveinfochange(1)
         this.getFirAuditerByDept()
         this.commitshow = true
       },
-      addInfoChangeAudit () {
+      // 二级分办单位提交审批
+      separateUnitSubmitAuditMakeSure () {
+        console.log('二级分办单位,确认提交审批')
+        this.saveinfochange(1)
         if (this.auditer === '') {
           this.$message({
             type: 'warning',
@@ -2601,11 +2604,17 @@
         this.entityForm.fushenauditer = this.fushenauditer
         this.entityForm.auditer = this.auditer
         this.entityForm.MInfoId = this.MInfoId
+        let params = {
+          FirstAudit: this.auditer,
+          SecondAudit: this.fushenauditer,
+          AuditRemark: this.entityForm.Remark
+        }
         this.btnloading = true
-        api.commitAuditEntity(this.supplierId, this.entityForm, this.$axios).then(res => {
+        api.separateUnitAuditEntity(this.MInfoId, params, this.$axios).then(res => {
           if (res.data.code === 0) {
             // 保存成功后,初始化数据,变成修改
             this.initDatas()
+            this.$router.push('/')
             this.commitshow = false
             this.butnab = true
             this.$message({

+ 12 - 9
src/dashoo.cn/frontend_web/src/pages/oilsupplier/paymentinfo/icbclist.vue

@@ -175,21 +175,24 @@
       transferStr (val) {
         if (val === '1') {
           return '准入交费'
-        }else if (val === '2') {
+        } else if (val === '2') {
           return '年审交费'
-        }else if (val === '3') {
+        } else if (val === '3') {
           return '增项交费'
+        } else if (val === '7') {
+          return '信息变更'
         } else {
           return val
         }
       },
-      RndNum(n){
-        let rnd="";
-        for(var i=0;i<n;i++)
-          rnd+=Math.floor(Math.random()*10);
-        return rnd;
+      RndNum (n) {
+        let rnd = ''
+        for (var i = 0; i < n; i++) {
+          rnd += Math.floor(Math.random() * 10)
+        }
+        return rnd
       },
-      handleGetMoneyConfirm() {
+      handleGetMoneyConfirm () {
         let idlist = ''
         let sumMoeny = 0.0
         for (let idx in this.entityList) {
@@ -215,7 +218,7 @@
           this.$confirm('确认收款吗?', '提示', {
             confirmButtonText: '确定',
             cancelButtonText: '取消',
-            type: 'info'
+            type: 'warning'
           }).then(() => {
             this.handleGetMoney()
           })