2
3
baichengfei 5 лет назад
Родитель
Сommit
e2f6215449

+ 93 - 5
src/dashoo.cn/backend/api/controllers/oilsupplier/annualaudit.go

@@ -844,6 +844,94 @@ func (this *AnnualAuditController) AddAuditEntity() {
 
 }
 
+// @Title 企业用户提交按钮  --启动工作流
+// @Description 企业用户提交按钮
+// @Success	200	{object} controllers.Request
+// @router /company-audit/:id [post]
+func (this *AnnualAuditController) CompanyAuditEntity() {
+	annualId := this.Ctx.Input.Param(":id")
+	unitId := this.GetString("UnitId")
+	// typeCode := this.GetString("TypeCode")
+	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("非企业用户,请用分办功能提交!")
+	}
+
+	//取出准入申请表
+	srv := annualaudit.GetOilAnnualAuditService(utils.DBE)
+	var annualEntity annualaudit.OilAnnualAudit
+	srv.GetEntityById(annualId, &annualEntity)
+	//srv.IsSupplierCertCanSubmit(strconv.Itoa(supplierCertEntity.Id), certId) TODO 参数检查
+
+	//取出企业主表
+	supplierSvc := supplier.GetOilSupplierService(utils.DBE)
+	var supplierEntity supplier.OilSupplier
+	//检查是否可提交
+	supplierSvc.GetEntityById(annualEntity.SupplierId, &supplierEntity)
+
+	status, _ := strconv.Atoi(annualEntity.Status)
+	if status > 0 {
+		panic("工作流已经启动,请刷新重试!")
+	}
+
+	svcActiviti := workflow.GetActivitiService(utils.DBE)
+	//启动工作流
+	businessKey := annualId + "-" + strconv.Itoa(annualEntity.AuditIndex)
+	processInstanceId := annualEntity.WorkflowId
+	// 如果被驳回,不再新启工作流
+	if processInstanceId == "" {
+		processInstanceId = svcActiviti.StartProcess2(workflow.OIL_AUDIT_APPLY, businessKey, this.User.Id, "1", annualEntity.SupplierTypeName, supplierEntity.SupplierName)
+		if len(processInstanceId) <= 0 {
+			panic("工作流启动失败!")
+		}
+	}
+	// 将启动和工作流,选择的初审和复审人员保存下来
+	cols := []string{
+		"Id",
+		"WorkflowId",
+		"BusinessKey",
+		"ProcessKey",
+		"CommitComId",
+		"AuditIndex",
+	}
+	annualEntity.ProcessKey = workflow.OIL_AUDIT_APPLY
+	annualEntity.BusinessKey = businessKey
+	annualEntity.WorkflowId = processInstanceId
+	annualEntity.CommitComId = unitId
+	annualEntity.AuditIndex += 1
+	srv.UpdateEntityByIdCols(annualId, annualEntity, cols)
+
+	var ActiComplete workflow.ActiCompleteVM
+	ActiComplete.ProcessKey = workflow.OIL_AUDIT_APPLY
+	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
@@ -1816,9 +1904,9 @@ func (this *AnnualAuditController) AddAppChange() {
 // @Success 200 {object} controllers.Request
 // @router /update-pay-status/:id [post]
 func (this *AnnualAuditController) UpdatePayStatus() {
-	certId := this.Ctx.Input.Param(":id")
+	annualId := this.Ctx.Input.Param(":id")
 	var errinfo ErrorInfo
-	if certId == "" {
+	if annualId == "" {
 		errinfo.Message = "操作失败!请求信息不完整"
 		errinfo.Code = -2
 		this.Data["json"] = &errinfo
@@ -1827,11 +1915,11 @@ func (this *AnnualAuditController) UpdatePayStatus() {
 	}
 	annualAuditSrv := annualaudit.GetOilAnnualAuditService(utils.DBE)
 	var annualAuditEntity annualaudit.OilAnnualAudit
-	annualAuditSrv.GetEntityById(certId, &annualAuditEntity)
+	annualAuditSrv.GetEntityById(annualId, &annualAuditEntity)
 
 	paySrv := paymentinfo.GetPaymentService(utils.DBE)
 	var paymentInfoEntities []paymentinfo.OilPaymentInfo
-	err := paySrv.GetPaymentInfoBySrcId(certId, "2", &paymentInfoEntities)
+	err := paySrv.GetPaymentInfoBySrcId(annualId, "2", &paymentInfoEntities)
 
 	if err != nil {
 		errinfo.Message = "未知错误,请稍后再试!"
@@ -1857,7 +1945,7 @@ func (this *AnnualAuditController) UpdatePayStatus() {
 		}
 	}
 
-	sql :="UPDATE OilPaymentInfo SET IsPay ='1' where SrcId=" + certId
+	sql :="UPDATE OilPaymentInfo SET IsPay ='1' where SrcId=" + annualId
 	annualAuditSrv.DBE.Exec(sql)
 	errinfo.Message = "确认交费成功!"
 	errinfo.Code = 0

+ 166 - 2
src/dashoo.cn/backend/api/controllers/oilsupplier/paymentinfo.go

@@ -351,8 +351,8 @@ func (this *PaymentInfoController) SureEntity() {
 // @Title 确认缴费单--回调
 // @Description 确认缴费单
 // @Success	200	{object} controllers.Request
-// @router /receive-money-bill-list [post]
-func (this *PaymentInfoController) ReceiveMoneyBillList() {
+// @router /receive-money-bill-list-copy [post]
+func (this *PaymentInfoController) ReceiveMoneyBillListCopy() {
 	var errinfo ErrorInfo
 	svc := paymentinfo.GetPaymentService(utils.DBE)
 	var billParams bankapi.BillReceiveMoneyParams
@@ -558,6 +558,170 @@ func (this *PaymentInfoController) ReceiveMoneyBillList() {
 	this.ServeJSON()
 }
 
+// @Title 确认缴费单--回调
+// @Description 确认缴费单
+// @Success	200	{object} controllers.Request
+// @router /receive-money-bill-list [post]
+func (this *PaymentInfoController) ReceiveMoneyBillList() {
+	var errInfo ErrorInfo
+	svc := paymentinfo.GetPaymentService(utils.DBE)
+	var billParams bankapi.BillReceiveMoneyParams
+	var jsonBlob = this.Ctx.Input.RequestBody
+	json.Unmarshal(jsonBlob, &billParams)
+
+	//已有的银行流水号说明是重复调用,将被丢弃
+	cntWhere := " 1= 1 and BankSerialNum = '" + billParams.BankSerialNum + "' "
+	var paymentInfoCnt []paymentinfo.OilPaymentInfo
+	svc.GetEntities(&paymentInfoCnt, cntWhere)
+	if paymentInfoCnt != nil && len(paymentInfoCnt) > 0 {
+		errInfo.Message = "重复调用"
+		errInfo.Code = -1
+		this.Data["json"] = &errInfo
+		this.ServeJSON()
+		return
+	}
+
+	strIds := strings.Trim(billParams.Ids, ",")
+	sqlList := "id in (" + strIds + ") and IsPay = '1'"
+	var paymentInfos []paymentinfo.OilPaymentInfo
+	svc.GetEntities(&paymentInfos, sqlList)
+
+	t := time.Now()
+	sql := "update OilPaymentInfo set IsPay = '2', "
+	sql += "BankName='" + billParams.BankName + "', "
+	sql += "BankSerialNum='" + billParams.BankSerialNum + "', "
+	sql += "PayDate='" + billParams.PayDate.Format("2006-01-02 15:04:05") + "', "
+	sql += "PayMode='" + billParams.PayMode + "', "
+	sql += "ModifiedOn='" + t.Format("2006-01-02 15:04:05") + "', "
+	sql += "ModifiedBy='" + this.User.Realname + "', "
+	sql += "ModifiedUserId='" + this.User.Id + "' "
+	sql += " where Id in (" + strIds + ") and IsPay = '1'"
+	svc.DBE.Query(sql)
+
+	supplierId := 0
+	srcIds := ""
+	svcActiviti := workflow.GetActivitiService(utils.DBE)
+	for _, payItem := range paymentInfos {
+		supplierId = payItem.SupplierId
+		srcIds = srcIds + "," + strconv.Itoa(payItem.Id)
+		if payItem.PayType == "1" {
+			//准入申请
+			//取出准入表信息
+			certSrv := suppliercert.GetOilSupplierCertService(utils.DBE)
+			var supplierCertEntity suppliercert.OilSupplierCert
+			certSrv.GetEntityById(payItem.SrcId, &supplierCertEntity)
+
+			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 = "交费成功。"
+			ActiComplete.CallbackUrl = utils.Cfg.MustValue("workflow", "callbackHost")
+
+			res := svcActiviti.TaskComplete(ActiComplete)
+			if res != "true" {
+				fmt.Println("工作流异常,请联系管理员!" + res)
+				//panic("工作流异常,请联系管理员!" + res)
+			}
+		} else if payItem.PayType == "2" { //年审
+			//TODO: 修改年审时间
+			annualSvc := annualaudit.GetOilAnnualAuditService(utils.DBE)
+			var annualEntities []annualaudit.OilAnnualAudit
+			annWhere := " SupplierId = " + utils.ToStr(payItem.SupplierId) + " and CerId = " + utils.ToStr(payItem.SupplierCertId) + " and Status = '6'"
+			svc.GetEntitysByWhere(OilAnnualAuditName, annWhere, &annualEntities)
+			if len(annualEntities) > 0 {
+				//更新年审表时间
+				var annModel annualaudit.OilAnnualAudit
+				annModel.Status = suppliercert.ALL_PASE_STATUS
+				annModel.ApplyTime = annualEntities[0].ApplyTime.AddDate(1, 0, 0)
+				annualSvc.UpdateEntityBywheretbl(OilAnnualAuditName, &annModel, []string{"ApplyTime", "Status"}, annWhere)
+				//更新准入表时间
+				var certmodel suppliercert.OilSupplierCert
+				certmodel.ApplyTime = annualEntities[0].ApplyTime.AddDate(1, 0, 0)
+				certmodel.InFlag = "1"
+				svc.UpdateEntityByIdCols(strconv.Itoa(payItem.SupplierCertId), &certmodel, []string{"ApplyTime", "InFlag"})
+			}
+		} else if payItem.PayType == "3" { //增项
+			appSvc := suppliercertappend.GetOilSupplierCertAppendService(utils.DBE)
+			//更新准入项表
+			accessWhere := " SupplierId = " + utils.ToStr(payItem.SupplierId) + " and SupplierCertId = " + utils.ToStr(payItem.SupplierCertId) + " and Type = '2'"
+			var appendSubModel suppliercertsub.OilSupplierCertSub
+			appendSubModel.Type = "3"
+			appSvc.UpdateEntityBywheretbl(OilSupplierCertSubName, &appendSubModel, []string{"Type"}, accessWhere)
+			//更新资质表
+			appendFileWhere := " SupplierId = " + utils.ToStr(payItem.SupplierId) + " and SupType = 2"
+			var appendSubFileModel supplierfile.OilSupplierFile
+			appendSubFileModel.SupType = 3
+			appSvc.UpdateEntityBywheretbl(OilSupplierCertSubName, &appendSubFileModel, []string{"SupType"}, appendFileWhere)
+			//更新增项表
+			appendWhere := " SupplierId = " + utils.ToStr(payItem.SupplierId) + " and SupplierCertId = " + utils.ToStr(payItem.SupplierCertId) + " and Status = '6'"
+			var appendModel suppliercertappend.OilSupplierCertAppend
+			appendModel.Status = suppliercert.ALL_PASE_STATUS
+			appSvc.UpdateEntityBywheretbl(OilSupplierCertAppendName, &appendModel, []string{"Status"}, appendWhere)
+		}
+	}
+
+	// 待开发票
+
+	var suppentity supplier.OilSupplier
+	where := "Id=" + strconv.Itoa(supplierId)
+	svc.GetEntity(&suppentity, where)
+
+	var invoiceInfo invoiceinfo.OilInvoiceInfo
+	invoiceInfo.SrcIds = strings.Trim(srcIds, ",")
+	invoiceInfo.Amount = billParams.ReceiveAmount
+	invoiceInfo.BankSerialNum = billParams.BankSerialNum
+	invoiceInfo.IsInvoice = "0"
+	invoiceInfo.SupplierId = supplierId
+	invoiceInfo.SupplierName = suppentity.SupplierName
+	invoiceInfo.CommercialNo = suppentity.CommercialNo
+	invoiceInfo.Address = suppentity.Address
+	invoiceInfo.BankAccount = suppentity.BankAccount
+	invoiceInfo.DepositBank = suppentity.DepositBank
+	invoiceInfo.Email = suppentity.EMail
+	invoiceInfo.CreateOn = time.Now()
+
+	svc.InsertEntity(&invoiceInfo)
+
+	userSvc := userRole.GetUserService(utils.DBE)
+	paramSvc := baseparameter.GetBaseparameterService(utils.DBE)
+	financeRoleId := paramSvc.GetBaseparameterMessage("", "paramset", "FinanceRoleId")
+	ids := userSvc.GetUserIdsByRoleId(financeRoleId)
+	tempStr := strings.Join(ids, ",")
+	uids := strings.Replace(tempStr, "uid_", "", -1)
+	uids = strings.Trim(uids, ",")
+
+	businessKey := strconv.Itoa(invoiceInfo.Id)
+	result := "1"
+	processInstanceId := svcActiviti.StartProcess2(workflow.OIL_SUPPLIER_VERIFY, businessKey, uids, result, "04", suppentity.SupplierName)
+	invoiceInfo.WorkflowId = processInstanceId
+	cols := []string{"WorkflowId"}
+	svc.UpdateEntityByIdCols(invoiceInfo.Id, &invoiceInfo, cols)
+
+
+	//记录对账日志
+	paymentBankInfo := new(paymentbankinfo.OilPaymentBankInfo)
+	paymentBankInfo.BillIds = billParams.Ids
+	paymentBankInfo.PayMode = billParams.PayMode
+	paymentBankInfo.PayDate = billParams.PayDate
+	paymentBankInfo.BankSerialNum = billParams.BankSerialNum
+	paymentBankInfo.ReceiveAmount = billParams.ReceiveAmount
+	paymentBankInfo.BankName = billParams.BankName
+	paymentBankInfo.CreateUserId = 0
+	paymentBankInfo.CreateOn = time.Now()
+	paymentBankInfo.ModifiedUserId = 0
+	paymentBankInfo.ModifiedOn = time.Now()
+	paymentBankInfo.WriteInType = "1" //初次回调
+	payBankSvc := paymentbankinfo.GetPaymentSelectService(utils.DBE)
+	payBankSvc.InsertEntity(paymentBankInfo)
+
+	errInfo.Message = "修改成功!"
+	errInfo.Code = 0
+	this.Data["json"] = &errInfo
+	this.ServeJSON()
+}
+
 // @Title 对账后有未更改状态的,再次确认缴费单--回调
 // @Description 确认缴费单
 // @Success	200	{object} controllers.Request

+ 8 - 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 := false, false
+		res1, res2, res3 := false, false, false
 		if strconv.Itoa(supplierCertEntity.CreateUserId) == this.User.Id {
 			res1 = true
 		}
@@ -1055,7 +1055,13 @@ func (this *OilSupplierCertController) IsAccess() {
 		if strconv.Itoa(supplierCertAppendEntity.CreateUserId) == this.User.Id {
 			res2 = true
 		}
-		if res1 || res2 {
+		annualSrv := annualaudit.GetOilAnnualAuditService(utils.DBE)
+		var annualEntity annualaudit.OilAnnualAudit
+		annualSrv.GetEntityById(id, &annualEntity)
+		if strconv.Itoa(annualEntity.CreateUserId) == this.User.Id {
+			res3 = true
+		}
+		if res1 || res2 || res3 {
 			res = true
 		}
 	} else {

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

@@ -176,5 +176,12 @@ export default {
       method: 'post',
       params: params
     })
+  },
+  companyAuditEntity (entityId, params, myAxios) {
+    return myAxios({
+      url: '/annualaudit/company-audit/' + entityId,
+      method: 'post',
+      params: params
+    })
   }
 }

+ 1 - 1
src/dashoo.cn/frontend_web/src/pages/oilsupplier/addtionaudit/_opera/goodsdataopera.vue

@@ -22,7 +22,7 @@
             <!-- <el-button slot="reference" plain size="mini" style="margin-right: 8px">查看进度</el-button> -->
           </el-popover>
           <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">审批1流程</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="commonAuditClick" v-if="auditBtn && this.formData.Status === '1'">初审</el-button>
           <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="businessOfficeSeparateAuditClick" v-if="auditBtn && this.formData.Status === '3'">提交专业审批</el-button>

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

@@ -29,8 +29,8 @@
            <el-button type="primary" size="mini" style="margin-right: 8px" @click="itemsshow">查看变更项</el-button>
           <el-button type="primary" size="mini" style="margin-left: 8px" @click="commonAuditClick()" v-if="auditBtn && AnnualStatus == '1'">初审</el-button>
           <el-button type="primary" size="mini" style="margin-left: 8px" @click="commonAuditClick()" v-if="auditBtn && AnnualStatus == '2'">复审</el-button>
-          <el-button type="primary" size="mini" style="margin-left: 8px" @click="profAudit()" v-if="auditBtn && AnnualStatus == '3'">提交专业审核</el-button> <!-- 未用到 -->
-          <el-button type="primary" size="mini" style="margin-left: 8px" @click="annualAudit()" v-if="auditBtn && AnnualStatus == '4'">专业审核</el-button><!-- 未用到 -->
+          <!--<el-button type="primary" size="mini" style="margin-left: 8px" @click="profAudit()" v-if="auditBtn && AnnualStatus == '3'">提交专业审核</el-button> &lt;!&ndash; 未用到 &ndash;&gt;-->
+          <!--<el-button type="primary" size="mini" style="margin-left: 8px" @click="annualAudit()" v-if="auditBtn && AnnualStatus == '4'">专业审核</el-button>&lt;!&ndash; 未用到 &ndash;&gt;-->
           <el-button type="primary" size="mini" style="margin-left: 8px" @click="commonAuditClick()" v-if="auditBtn && AnnualStatus == '5'">审批</el-button><!-- 企业法规处 -->
           <el-button type="primary" style="margin-left: 8px;" size="mini" @click="secUnitSeparateAuditClick" v-if="auditBtn && AnnualStatus == '10'">提交</el-button>
           <el-button type="primary" size="mini" style="margin-left: 8px;" onclick="window.history.go(-1)">返回</el-button>

+ 290 - 24
src/dashoo.cn/frontend_web/src/pages/oilsupplier/annualaudit/_opera/basicauditoperation.vue

@@ -26,19 +26,14 @@
           </el-button>
           <el-button type="primary" style="margin-left: 8px;" size="mini" @click="profAudit()" v-if="AnnualStatus == 3">
             专业审核分配</el-button> -->
-           <el-button type="primary" size="mini" style="margin-right: 8px" @click="itemsshow">查看变更项</el-button>
-          <el-button type="primary" size="mini" style="margin-left: 8px" @click="annualAudit()"
-            v-if="auditBtn && AnnualStatus == '1'">初审</el-button>
-          <el-button type="primary" size="mini" style="margin-left: 8px" @click="annualAudit()"
-            v-if="auditBtn && AnnualStatus == '2'">复审</el-button>
-          <el-button type="primary" size="mini" style="margin-left: 8px" @click="profAudit()"
-            v-if="auditBtn && AnnualStatus == '3'">提交专业审核</el-button>
-          <el-button type="primary" size="mini" style="margin-left: 8px" @click="annualAudit()"
-            v-if="auditBtn && AnnualStatus == '4'">专业审核</el-button>
-          <el-button type="primary" size="mini" style="margin-left: 8px" @click="annualAudit()"
-                     v-if="auditBtn && AnnualStatus == '5'">审批</el-button>
-          <el-button type="primary" style="margin-left: 8px;" size="mini" @click="fenbanBtn" v-if="auditBtn && AnnualStatus == '10'">
-            提交</el-button>
+          <el-button type="primary" size="mini" style="margin-right: 8px" @click="itemsshow">查看变更项</el-button>
+          <el-button type="primary" size="mini" style="margin-left: 8px" @click="commonAuditClick()" v-if="auditBtn && AnnualStatus == '1'">初审</el-button>
+          <el-button type="primary" size="mini" style="margin-left: 8px" @click="commonAuditClick()" v-if="auditBtn && AnnualStatus == '2'">复审</el-button>
+          <!--<el-button type="primary" size="mini" style="margin-left: 8px" @click="profAudit()" v-if="auditBtn && AnnualStatus == '3'">提交专业审核</el-button>-->
+          <!--<el-button type="primary" size="mini" style="margin-left: 8px" @click="annualAudit()" v-if="auditBtn && AnnualStatus == '4'">专业审核</el-button>-->
+          <el-button type="primary" size="mini" style="margin-left: 8px" @click="commonAuditClick()" v-if="auditBtn && AnnualStatus == '5'">审批</el-button>
+          <el-button type="primary" style="margin-left: 8px;" size="mini" @click="secUnitSeparateAuditClick" v-if="auditBtn && AnnualStatus == '10'">提交</el-button>
+          <el-button type="primary" size="mini" style="margin-left: 8px" @click="paySureClick()" v-if="auditBtn && parseInt(this.anndata.Status) === 6">交费</el-button>
           <el-button type="primary" size="mini" style="margin-left: 8px;" onclick="window.history.go(-1)">返回</el-button>
         </span>
       </div>
@@ -718,7 +713,24 @@
         <el-button type="primary" size="small" @click="makeSure()" :loading="loading">确 定</el-button>
       </div>
     </el-dialog>
-
+    <el-dialog title="审核" :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="0" @change="radioChange">未通过</el-radio>
+          </template>
+        </el-form-item>
+        <el-form-item label="意见" :rules="[{ required: true, message: '请输入审批意见', trigger: 'blur' }]">
+          <el-input type="textarea" v-model="shenheForm.AuditorRemark" :placeholder="textplaceholder">
+          </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="dialogProfAudit" width="420px">
       <el-form ref="searchForm" label-width="110px">
         <el-form-item label="审批人">
@@ -801,6 +813,65 @@
       </span>
       <br>
     </el-dialog>
+    <el-dialog title="分办" :visible.sync="dialogSecUnitSeparateVisible" width="520px">
+      <el-form label-width="90px" :model="shenheForm" 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" v-if="shenheForm.SuccessStatus == 1">
+            <el-form-item label="初审人员">
+              <!--<el-input ref="selectAuditer" readonly v-model="auditerName" placeholder="请选择初审人">-->
+              <!--<el-button slot="append" icon="el-icon-search" @click="chooseAuditorShow"></el-button>-->
+              <!--</el-input>-->
+              <el-select ref="selectAuditer"
+                         v-model="auditer"
+                         placeholder="请选择初审人"
+                         style="width: 100%"
+                         filterable
+                         allow-create
+                         default-first-option
+                         @change="auditOrgChang()">
+                <el-option v-for="item in firOptions"
+                           :key="item.Id"
+                           :label="item.Realname"
+                           :value="item.Id">
+                </el-option>
+              </el-select>
+            </el-form-item>
+            <el-form-item label="复审人员">
+              <el-select ref="selectAuditer" v-model="fushenauditer" 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>
+              </el-select>
+            </el-form-item>
+          </el-col>
+          <el-col :span="24" v-if="shenheForm.SuccessStatus == 1">
+            <el-form-item label="备注">
+              <el-input v-model="shenheForm.AuditorRemark" type="textarea" placeholder="请输入备注内容">
+              </el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :span="24" v-if="shenheForm.SuccessStatus == 0">
+            <el-form-item label="退回原因">
+              <el-input v-model="shenheForm.AuditorRemark" type="textarea" placeholder="退回意见不能少于5个字">
+              </el-input>
+            </el-form-item>
+          </el-col>
+        </el-row>
+      </el-form>
+      <span style="float: right;margin-top:-10px;">
+        <el-button size="small" @click="dialogSecUnitSeparateVisible = false">取 消</el-button>
+        <el-button type="primary" size="small" @click="secUnitSeparateAuditMakeSure()" :loading="loading">确 定</el-button>
+      </span>
+      <br>
+    </el-dialog>
     <el-dialog title="变更项查看" :visible.sync="myitemsshow" width="780px">
       <el-table :data="InfoData" border style="width: 100%">
         <el-table-column align="center" prop="SelectItemName" label="变更项目">
@@ -978,6 +1049,8 @@
       return {
         firOptions: [],
         loading: false,
+        dialogCommonAuditMakeSureVisible: false,
+        dialogSecUnitSeparateVisible: false,
         sizeProject: 10,
         currentPageProject: 1,
         currentItemCountProject: 0,
@@ -1366,21 +1439,20 @@
       this.getsubfile()
     },
     methods: {
-
-      imgFormat(val,index){
-        if(val !=null && val != undefined && val !=''){
+      imgFormat (val, index) {
+        if (val != null && val != undefined && val != '') {
           let fileurlall = val.split('$')[index]
           let fileurl = fileurlall.split('|')
-          if(fileurl[1] != null && fileurl[1] !='' && fileurl[1] != undefined){
-            let Format  = fileurl[1].split(".")
-            if(Format[1]!=null && Format[1] !='' && Format[1] != undefined){
-               let pictureFormat = Format[1];
-              if("jpg"== pictureFormat || "bmp" ==pictureFormat || "png" ==pictureFormat || "gif" ==pictureFormat|| "jpeg" ==pictureFormat){
-                return false;
+          if (fileurl[1] != null && fileurl[1] != '' && fileurl[1] != undefined) {
+            let Format = fileurl[1].split('.')
+            if (Format[1] != null && Format[1] != '' && Format[1] != undefined) {
+              let pictureFormat = Format[1]
+              if (pictureFormat == 'jpg' || pictureFormat == 'bmp' || pictureFormat == 'png' || pictureFormat == 'gif' || pictureFormat == 'jpeg') {
+                return false
               }
             }
           }
-          return true;
+          return true
         }
       },
       getFirAuditerByDept () {
@@ -1523,6 +1595,8 @@
               this.auditstepcode = 'PROF_AUDIT'
             } else if (this.anndata.Status === '5') {
               this.auditstepcode = 'PROF_REGULATION'
+            } else if (this.anndata.Status === '6') {
+              this.auditstepcode = 'PAYING_FEE'
             } else if (this.anndata.Status === '10') {
               if (this.anndata.SupplierTypeName === '01') {
                 this.auditstepcode = 'SUB_OFFICE_WZ'
@@ -2079,6 +2153,198 @@
         })
       },
 
+      commonAuditClick () {
+        console.log('审批公共会话框')
+        this.shenheForm.AnnualId = parseInt(this.annualId)
+        this.dialogCommonAuditMakeSureVisible = true
+      },
+      commonAuditMakeSure () {
+        console.log('审批结果公共提交')
+        let checkRes = this.commonAuditParamsCheck()
+        console.log(checkRes, '审批结果公共提交')
+        if (!checkRes) {
+          return false
+        }
+        this.loading = true
+        let params = {
+          result: this.shenheForm.SuccessStatus,
+          AuditRemark: this.shenheForm.AuditorRemark
+        }
+        console.log('审批结果提交参数:', params)
+        annualapi.commonAuditEntity(this.shenheForm.AnnualId, params, this.$axios).then(res => {
+          if (res.data.code === 0) {
+            console.log('审批提交,成功返回')
+            this.$message({
+              type: 'success',
+              message: res.data.message
+            })
+            this.$router.push('/')
+          } else {
+            this.$message({
+              type: 'warning',
+              message: res.data.message
+            })
+          }
+          this.dialogCommonAuditMakeSureVisible = false
+          this.loading = false
+        }).catch(err => {
+          console.error(err)
+        })
+      },
+      commonAuditParamsCheck () {
+        if (this.shenheForm.SuccessStatus === 1) {
+          if (this.shenheForm.AuditorRemark.trim().length < 20 && this.AnnualStatus && this.AnnualStatus !== '10') {
+            if (this.AnnualStatus !== '5') {
+              this.$message({
+                type: 'warning',
+                message: '审批意见不能低于20个字符!'
+              })
+              return false
+            }
+          }
+        } else {
+          if (this.shenheForm.AuditorRemark.trim().length < 5) {
+            this.$message({
+              type: 'warning',
+              message: '退回意见不能低于5个字符!'
+            })
+            return false
+          }
+        }
+        return true
+      },
+      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
+        }
+        console.log('交费结果确认提交参数:', params)
+        annualapi.updatePayStatus(this.annualId, 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.loading = false
+        }).catch(err => {
+          console.error(err)
+        })
+      },
+      // 二级单位分办
+      secUnitSeparateAuditClick () {
+        console.log('二级单位分办审批会话框')
+        this.getFirAuditerByDept()
+        this.shenheForm.AnnualId = parseInt(this.annualId)
+        this.dialogSecUnitSeparateVisible = true
+      },
+      // 二级单位分办审批参数检查 ⬇
+      secUnitSeparateAuditParamsCheck () {
+        if (this.shenheForm.SuccessStatus === 1) {
+          if (this.auditer === '') {
+            this.$message({
+              type: 'warning',
+              message: '请选择初审人!'
+            })
+            return
+          }
+          if (this.fushenauditer === '') {
+            this.$message({
+              type: 'warning',
+              message: '请选择复审人!'
+            })
+            return
+          }
+          if (this.shenheForm.AuditorRemark.trim().length < 1 && this.formData.Status === '5') {
+            this.$message({
+              type: 'warning',
+              message: '请填写审批意见!'
+            })
+            return
+          }
+          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 false
+          }
+        } else {
+          this.shenheForm.AuditorRemark = this.backRemark
+          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 false
+          }
+        }
+        return true
+      },
+      // 二级单位分办审批结果确认 ⬇
+      secUnitSeparateAuditMakeSure () {
+        console.log('二级单位分办审批结果确认')
+        let checkRes = this.secUnitSeparateAuditParamsCheck()
+        if (!checkRes) {
+          return false
+        }
+        this.loading = true
+        let params = {
+          FirstAudit: this.auditer,
+          SecondAudit: this.fushenauditer,
+          AuditRemark: this.shenheForm.AuditorRemark
+        }
+        console.log('二级单位分办审批结果提交参数:', params)
+        annualapi.separateAuditEntity(this.shenheForm.AnnualId, params, this.$axios).then(res => {
+          if (res.data.code === 0) {
+            console.log('审批提交,成功返回')
+            this.initDatas()
+            this.$message({
+              type: 'success',
+              message: res.data.message
+            })
+            this.dialogSecUnitSeparateVisible = false
+          } else {
+            this.$message({
+              type: 'warning',
+              message: res.data.message
+            })
+          }
+          this.loading = false
+        }).catch(err => {
+          console.error(err)
+        })
+      },
       annualAudit () {
         this.shenheForm.AnnualId = parseInt(this.annualId)
         this.dialogMakeSure = true

+ 151 - 24
src/dashoo.cn/frontend_web/src/pages/oilsupplier/annualaudit/_opera/bassicoperation.vue

@@ -22,14 +22,9 @@
             <!-- <el-button slot="reference" plain size="mini" style="margin-left: 8px">查看进度</el-button> -->
           </el-popover>
           <el-button type="primary" size="mini" style="margin-right: 8px" @click="itemsshow">查看变更项</el-button>
-          <el-button type="primary" size="mini" style="margin-right: 8px" @click="commitfenban"
-                     v-if="Status <= 0 && authUser.Profile.IsCompanyUser == 1">提交分办
-          </el-button>
-          <el-button type="primary" size="mini" style="margin-right: 8px" @click="clickaddshow()"
-                     v-if="Status <= 0 && authUser.Profile.IsCompanyUser == 0">提交审核
-          </el-button>
-          <el-button type="primary" style="margin-left: 8px;" size="mini" @click="clickaddshow()" v-if="Status == 10 &&  authUser.Profile.IsCompanyUser == 0">
-            提交审核</el-button>
+          <el-button type="primary" size="mini" style="margin-right: 8px" @click="comSubmitToSeparateUnitClick" v-if="Status <= 0 && authUser.Profile.IsCompanyUser == 1">提交分办</el-button>
+          <el-button type="primary" size="mini" style="margin-right: 8px" @click="separateUnitSubmitClick()" v-if="Status <= 0 && authUser.Profile.IsCompanyUser == 0">提交审核</el-button>
+          <el-button type="primary" style="margin-left: 8px;" size="mini" @click="separateUnitSubmitClick()" v-if="Status == 10 &&  authUser.Profile.IsCompanyUser == 0"> 提交审核</el-button>
           <router-link :to="'/oilsupplier/annualaudit/basicindex'">
             <el-button type="primary" size="mini" style="margin-left: 8px;">返回</el-button>
           </router-link>
@@ -711,7 +706,7 @@
                          style="margin-top: 20px"></business-list>
         </el-tab-pane>
 
-        <el-tab-pane label="提交审批">
+        <el-tab-pane label="提交审批" v-if="Status != '0'">
           <el-card class="box-card" style="height: 800px">
             <div slot="header" class="clearfix">
               <span>审批流程</span>
@@ -742,7 +737,7 @@
                    v-if="parseInt(activeName) < totalTab">下一步</el-button>
         <el-button type="primary"
                    size="mini"
-                   @click="commitfenban()"
+                   @click="comSubmitToSeparateUnitClick()"
                    v-if="IsCompanyUser == 1 && parseInt(activeName)==3 && Status <= 0">
           提交
         </el-button>
@@ -765,16 +760,14 @@
         </el-table-column>
       </el-table>
     </el-dialog>
-    <el-dialog title="提交申请" :visible.sync="addshow" width="520px">
+    <el-dialog title="提交申请" :visible.sync="dialogSeparateUnitAuditVisible" width="520px">
       <el-form label-width="90px" :model="entityForm" :rules="rules" ref="EntityFormref">
         <el-row>
           <el-col :span="24">
-            <!-- <el-form-item label="审批人" prop="auditer" required>
-              <el-select ref="selectAuditer" v-model="entityForm.auditer" placeholder="请选择" style="width: 100%"
-                filterable allow-create default-first-option>
-                <el-option v-for="item in auditerOption" :key="item.id" :label="item.realname" :value="item.id">
-                </el-option>
-              </el-select>
+            <!-- <el-form-item label="审批人">
+              <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-input ref="selectAuditer" readonly v-model="auditerName" placeholder="请选择初审人">-->
@@ -817,12 +810,12 @@
         </el-row>
       </el-form>
       <span style="float: right;margin-top:-10px;">
-        <el-button size="small" @click="addshow = false">取 消</el-button>
-        <el-button type="primary" size="small" @click="addAnnualAudit()" :loading="loading">确 定</el-button>
+        <el-button size="small" @click="dialogSeparateUnitAuditVisible = false">取 消</el-button>
+        <el-button type="primary" size="small" @click="separateUnitSubmitAuditMakeSure()" :loading="loading">确 定</el-button>
       </span>
       <br>
     </el-dialog>
-    <el-dialog title="分办" :visible.sync="ComAuditdialogShow" width="520px">
+    <el-dialog title="分办" :visible.sync="dialogComSubmitToSeparateUnitVisible" width="520px">
       <el-form ref="searchForm" label-width="100px">
         <el-row>
           <el-col :span="24">
@@ -856,8 +849,8 @@
         </el-row>
       </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="loading">确定</el-button>
+        <el-button size="mini" @click="dialogComSubmitToSeparateUnitVisible = false">取 消</el-button>
+        <el-button size="mini" type="primary" @click="companySubmitToSecUnitSeparate" :loading="loading">确定</el-button>
       </span>
     </el-dialog>
     <el-dialog :title="Title" :visible.sync="visible" top="5vh">
@@ -1226,7 +1219,9 @@ import apiCert from '@/api/oilsupplier/suppliercert'
         secauditerOptions: [],
         audithistoryshow: false,
         chooseAuditorVisible: false,
-        myitemsshow:false,
+        dialogSeparateUnitAuditVisible: false,
+        dialogComSubmitToSeparateUnitVisible: false,
+        myitemsshow: false,
         HSEOptions: [{
           value: '1',
           label: '是'
@@ -1465,7 +1460,7 @@ import apiCert from '@/api/oilsupplier/suppliercert'
           BusinessScope: false,
           Remark: false
         },
-        formDataOther:{
+        formDataOther: {
 
         },
         formData: {
@@ -2285,6 +2280,138 @@ import apiCert from '@/api/oilsupplier/suppliercert'
       commitfenban () {
         this.ComAuditdialogShow = true
       },
+      separateUnitSubmitClick () {
+        this.getFirAuditerByDept()
+        this.dialogSeparateUnitAuditVisible = true
+      },
+      separateUnitSubmitAuditParamsCheck () {
+        this.$refs['EntityFormref'].validate((valid) => {
+          if (valid) {
+            if (this.auditer === '') {
+              this.$message({
+                type: 'warning',
+                message: '请选择审批人!'
+              })
+              return
+            }
+            if (this.fushenauditer === '') {
+              this.$message({
+                type: 'warning',
+                message: '请选择复审人!'
+              })
+              return
+            }
+            return true
+          }
+        })
+      },
+      separateUnitSubmitAuditMakeSure () {
+        console.log('二级分办单位审核结果 确认提交')
+        let checkRes = this.separateUnitSubmitAuditParamsCheck
+        if (!checkRes) {
+          return false
+        }
+        let params = {
+          firstAudit: this.auditer,
+          SecondAudit: this.fushenauditer,
+          AuditRemark: this.entityForm.Remark
+        }
+        this.loading = true
+        annualapi.separateUnitAuditEntity(this.annualId, params, this.$axios).then(res => {
+          if (res.data.code === 0) {
+            // 保存成功后,初始化数据,变成修改
+            // this.Status = res.data.item
+            // this.entityForm.Status = this.Status
+            // this.initDatas()
+            this.getstatus(this.annualId)
+            this.dialogSeparateUnitAuditVisible = false
+            this.$message({
+              type: 'success',
+              message: res.data.message
+            })
+          } else {
+            this.$message({
+              type: 'warning',
+              message: res.data.message
+            })
+          }
+          this.loading = false
+        }).catch(err => {
+          this.loading = false
+          console.error(err)
+        })
+      },
+      comSubmitToSeparateUnitClick () {
+        this.dialogComSubmitToSeparateUnitVisible = true
+      },
+      // 企业用户自行提交审批
+      companySubmitToSecUnitSeparate () {
+        this.saveinfochange(1)
+        let checkRes = this.companySubmitToSecUnitParamsCheck
+        if (!checkRes) {
+          return false
+        }
+        this.loading = true
+        // this.auditform.FirstAuditName = this.UnitOrg
+        // this.auditform.CertId = this.formData.Id
+        // this.auditform.TypeCode = '01'
+        let params = {
+          UnitId: this.UnitOrg,
+          AuditRemark: this.auditform.AuditRemark
+        }
+        annualapi.companyAuditEntity(this.formData.Id, params, this.$axios).then(res => {
+          if (res.data.code === 0) {
+            // 保存成功后,初始化数据,变成修改
+            this.getEntityById()
+            this.dialogComSubmitToSeparateUnitVisible = false
+            this.$message({
+              type: 'success',
+              message: res.data.message
+            })
+          } else {
+            this.$message({
+              type: 'warning',
+              message: res.data.message
+            })
+          }
+          this.loading = false
+        }).catch(err => {
+          console.error(err)
+        })
+      },
+      companySubmitToSecUnitParamsCheck () {
+        if (this.myentityList == null || this.myentityList.length <= 0) {
+          this.$message({
+            type: 'warning',
+            message: '没有新增准入项,不能提交!'
+          })
+          return
+        }
+        for (let idx in this.subfileList1) {
+          if (this.subfileList1[idx].OldFileUrl === '' && this.subfileList1[idx].FileUrl === '') {
+            this.$message({
+              type: 'warning',
+              message: this.subfileList1[idx].NeedFileType + '没有上传,不能提交!'
+            })
+            return
+          }
+        }
+        if (this.UnitOrg === '') {
+          this.$message({
+            type: 'warning',
+            message: '请选择分办单位!'
+          })
+          return
+        }
+        if (this.orgauditOptions == null || this.orgauditOptions.length == 0) {
+          this.$message({
+            type: 'warning',
+            message: '该单位未配置分办人!'
+          })
+          return
+        }
+        return true
+      },
       getstatus (annid) {
         annualapi.getEntity(annid, this.$axios)
           .then(res => {

+ 89 - 23
src/dashoo.cn/frontend_web/src/pages/oilsupplier/annualaudit/_opera/goodsoperation.vue

@@ -22,14 +22,9 @@
             <!-- <el-button slot="reference" plain size="mini" style="margin-left: 8px">查看进度</el-button> -->
           </el-popover>
           <el-button type="primary" size="mini" style="margin-right: 8px" @click="itemsshow">查看变更项</el-button>
-          <el-button type="primary" size="mini" style="margin-right: 8px" @click="commitfenban"
-                     v-if="Status <= 0 && authUser.Profile.IsCompanyUser == 1">提交分办
-          </el-button>
-          <el-button type="primary" size="mini" style="margin-right: 8px" @click="separateUnitSubmitClick()"
-                     v-if="Status <= 0 && authUser.Profile.IsCompanyUser == 0">提交审核
-          </el-button>
-          <el-button type="primary" style="margin-left: 8px;" size="mini" @click="separateUnitSubmitClick()" v-if="Status == 10 &&  authUser.Profile.IsCompanyUser == 0">
-            提交审核</el-button>
+          <el-button type="primary" size="mini" style="margin-right: 8px" @click="comSubmitToSeparateUnitClick" v-if="Status <= 0 && authUser.Profile.IsCompanyUser == 1">提交分办</el-button>
+          <el-button type="primary" size="mini" style="margin-right: 8px" @click="separateUnitSubmitClick()" v-if="Status <= 0 && authUser.Profile.IsCompanyUser == 0">提交审核</el-button>
+          <el-button type="primary" style="margin-left: 8px;" size="mini" @click="separateUnitSubmitClick()" v-if="Status == 10 &&  authUser.Profile.IsCompanyUser == 0">提交审核</el-button>
           <router-link :to="'/oilsupplier/annualaudit/goodsindex'">
             <el-button type="primary" size="mini" style="margin-left: 8px;">返回</el-button>
           </router-link>
@@ -799,7 +794,7 @@
                          style="margin-top: 20px"></business-list>
         </el-tab-pane>
 
-        <el-tab-pane label="审批流程" v-if="parseInt(Status) > 0">
+        <el-tab-pane label="审批流程" v-if="Status != '0'">
           <el-card class="box-card" style="height: 800px">
             <div slot="header" class="clearfix">
               <span>审批流程</span>
@@ -830,7 +825,7 @@
                    v-if="parseInt(activeName) < totalTab">下一步</el-button>
         <el-button type="primary"
                    size="mini"
-                   @click="commitfenban()"
+                   @click="comSubmitToSeparateUnitClick()"
                    v-if="IsCompanyUser == 1 && parseInt(activeName)==3 && Status <= 0">
           提交
         </el-button>
@@ -894,7 +889,7 @@
       </span>
       <br>
     </el-dialog>
-    <el-dialog title="分办" :visible.sync="ComAuditdialogShow" width="520px">
+    <el-dialog title="分办" :visible.sync="dialogComSubmitToSeparateUnitVisible" width="520px">
       <el-form ref="searchForm" label-width="100px">
         <el-row>
           <el-col :span="24">
@@ -928,8 +923,8 @@
         </el-row>
       </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="loading">确定</el-button>
+        <el-button size="mini" @click="dialogComSubmitToSeparateUnitVisible = false">取 消</el-button>
+        <el-button size="mini" type="primary" @click="companySubmitToSecUnitSeparate" :loading="loading">确定</el-button>
       </span>
     </el-dialog>
     <el-dialog title="变更项查看" :visible.sync="myitemsshow" width="780px">
@@ -1321,7 +1316,7 @@
         SupplierTypeCode: '01',
         UnitOrg: '',
         chooseAuditorVisibleFen: false,
-        ComAuditdialogShow: false,
+        dialogComSubmitToSeparateUnitVisible: false,
         myitemsshow: false,
         savebtn: true,
         visbtn: '1',
@@ -2319,7 +2314,7 @@
             this.entityForm.Status = this.Status
             // this.initDatas();
             this.getstatus(this.annualId)
-            this.ComAuditdialogShow = false
+            this.dialogComSubmitToSeparateUnitVisible = false
             this.$message({
               type: 'success',
               message: res.data.message
@@ -2336,7 +2331,7 @@
         })
       },
       commitfenban () {
-        this.ComAuditdialogShow = true
+        this.dialogComSubmitToSeparateUnitVisible = true
       },
       setAuditerFen (val, name) {
         this.auditer = val
@@ -2822,8 +2817,7 @@
       //   })
       // },
       // 保存信息
-      saveinfochange () {
-        console.log('保存3')
+      saveinfochange (val) {
         let valid1 = false
         let valid2 = false
         this.$refs['EntityForm'].validate((valid) => {
@@ -2843,10 +2837,12 @@
             if (res.data.code === 0) {
               // 保存成功后,初始化数据,变成修改
               this.initDatas()
-              this.$message({
-                type: 'success',
-                message: res.data.message
-              })
+              if (val !== 1) {
+                this.$message({
+                  type: 'success',
+                  message: res.data.message
+                })
+              }
             } else {
               this.$message({
                 type: 'warning',
@@ -2971,7 +2967,77 @@
           console.error(err)
         })
       },
-
+      comSubmitToSeparateUnitClick () {
+        this.dialogComSubmitToSeparateUnitVisible = true
+      },
+      // 企业用户自行提交审批
+      companySubmitToSecUnitSeparate () {
+        this.saveinfochange(1)
+        let checkRes = this.companySubmitToSecUnitParamsCheck
+        if (!checkRes) {
+          return false
+        }
+        this.loading = true
+        // this.auditform.FirstAuditName = this.UnitOrg
+        // this.auditform.CertId = this.formData.Id
+        // this.auditform.TypeCode = '01'
+        let params = {
+          UnitId: this.UnitOrg,
+          AuditRemark: this.auditform.AuditRemark
+        }
+        annualapi.companyAuditEntity(this.formData.Id, params, this.$axios).then(res => {
+          if (res.data.code === 0) {
+            // 保存成功后,初始化数据,变成修改
+            this.getEntityById()
+            this.dialogComSubmitToSeparateUnitVisible = false
+            this.$message({
+              type: 'success',
+              message: res.data.message
+            })
+          } else {
+            this.$message({
+              type: 'warning',
+              message: res.data.message
+            })
+          }
+          this.loading = false
+        }).catch(err => {
+          console.error(err)
+        })
+      },
+      companySubmitToSecUnitParamsCheck () {
+        if (this.myentityList == null || this.myentityList.length <= 0) {
+          this.$message({
+            type: 'warning',
+            message: '没有新增准入项,不能提交!'
+          })
+          return
+        }
+        for (let idx in this.subfileList1) {
+          if (this.subfileList1[idx].OldFileUrl === '' && this.subfileList1[idx].FileUrl === '') {
+            this.$message({
+              type: 'warning',
+              message: this.subfileList1[idx].NeedFileType + '没有上传,不能提交!'
+            })
+            return
+          }
+        }
+        if (this.UnitOrg === '') {
+          this.$message({
+            type: 'warning',
+            message: '请选择分办单位!'
+          })
+          return
+        }
+        if (this.orgauditOptions == null || this.orgauditOptions.length == 0) {
+          this.$message({
+            type: 'warning',
+            message: '该单位未配置分办人!'
+          })
+          return
+        }
+        return true
+      },
       addAnnualAudit () {
         this.$refs['EntityFormref'].validate((valid) => {
           if (valid) {

+ 166 - 40
src/dashoo.cn/frontend_web/src/pages/oilsupplier/annualaudit/_opera/operation.vue

@@ -22,14 +22,9 @@
             <!-- <el-button slot="reference" plain size="mini" style="margin-left: 8px">查看进度</el-button> -->
           </el-popover>
           <el-button type="primary" size="mini" style="margin-right: 8px" @click="itemsshow">查看变更项</el-button>
-          <el-button type="primary" size="mini" style="margin-right: 8px" @click="commitfenban"
-                     v-if="Status <= 0 && authUser.Profile.IsCompanyUser == 1">提交分办
-          </el-button>
-          <el-button type="primary" size="mini" style="margin-right: 8px" @click="clickaddshow()"
-                     v-if="Status <= 0 && authUser.Profile.IsCompanyUser == 0">提交审核
-          </el-button>
-          <el-button type="primary" style="margin-left: 8px;" size="mini" @click="clickaddshow()" v-if="Status == 10 &&  authUser.Profile.IsCompanyUser == 0">
-            提交审核</el-button>
+          <el-button type="primary" size="mini" style="margin-right: 8px" @click="comSubmitToSeparateUnitClick" v-if="Status <= 0 && authUser.Profile.IsCompanyUser == 1">提交分办</el-button>
+          <el-button type="primary" size="mini" style="margin-right: 8px" @click="separateUnitSubmitClick()" v-if="Status <= 0 && authUser.Profile.IsCompanyUser == 0">提1交审核</el-button>
+          <el-button type="primary" style="margin-left: 8px;" size="mini" @click="separateUnitSubmitClick()" v-if="Status == 10 &&  authUser.Profile.IsCompanyUser == 0"> 提交审核</el-button>
           <router-link :to="'/oilsupplier/annualaudit/techindex'">
             <el-button type="primary" size="mini" style="margin-left: 8px;">返回</el-button>
           </router-link>
@@ -628,7 +623,7 @@
                          style="margin-top: 20px"></business-list>
         </el-tab-pane>
 
-        <el-tab-pane label="提交审批">
+        <el-tab-pane label="审批流程" v-if="Status != '0'">
           <el-card class="box-card" style="height: 800px">
             <div slot="header" class="clearfix">
               <span>审批流程</span>
@@ -659,14 +654,14 @@
                    v-if="parseInt(activeName) < totalTab">下一步</el-button>
         <el-button type="primary"
                    size="mini"
-                   @click="commitfenban()"
+                   @click="comSubmitToSeparateUnitClick()"
                    v-if="IsCompanyUser == 1 && parseInt(activeName)==3 && Status <= 0">
           提交
         </el-button>
       </div>
 
     </el-card>
-    <el-dialog title="提交审批" :visible.sync="addshow" width="520px">
+    <el-dialog title="提交申请" :visible.sync="dialogSeparateUnitAuditVisible" width="520px">
       <el-form label-width="90px" :model="entityForm" :rules="rules" ref="EntityFormref">
         <el-row>
           <el-col :span="24">
@@ -716,12 +711,12 @@
         </el-row>
       </el-form>
       <span style="float: right;margin-top:-10px;">
-        <el-button size="small" @click="addshow = false">取 消</el-button>
-        <el-button type="primary" size="small" @click="addAnnualAudit()" :loading="loading">确 定</el-button>
+        <el-button size="small" @click="dialogSeparateUnitAuditVisible = false">取 消</el-button>
+        <el-button type="primary" size="small" @click="separateUnitSubmitAuditMakeSure()" :loading="loading">确 定</el-button>
       </span>
       <br>
     </el-dialog>
-    <el-dialog title="分办" :visible.sync="ComAuditdialogShow" width="520px">
+    <el-dialog title="分办" :visible.sync="dialogComSubmitToSeparateUnitVisible" width="520px">
       <el-form ref="searchForm" label-width="100px">
         <el-row>
           <el-col :span="24">
@@ -755,8 +750,8 @@
         </el-row>
       </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="loading">确定</el-button>
+        <el-button size="mini" @click="dialogComSubmitToSeparateUnitVisible = false">取 消</el-button>
+        <el-button size="mini" type="primary" @click="companySubmitToSecUnitSeparate" :loading="loading">确定</el-button>
       </span>
     </el-dialog>
     <el-dialog title="变更项查看" :visible.sync="myitemsshow" width="780px">
@@ -892,15 +887,13 @@
   import setapi from '@/api/oilsupplier/oilclassorgset'
 
   // v-viewer
-  import Vue from 'vue';
-  import Viewer from 'v-viewer'
+  import Vue from 'vue'
+import Viewer from 'v-viewer'
   import 'viewerjs/dist/viewer.css'
   Vue.use(Viewer)
   Viewer.setDefaults({
     Options: { 'inline': true, 'button': true, 'navbar': true, 'title': true, 'toolbar': true, 'tooltip': true, 'movable': true, 'zoomable': true, 'rotatable': true, 'scalable': true, 'transition': true, 'fullscreen': true, 'keyboard': true, 'url': 'data-source' }
   })
-
-
   export default {
     computed: {
       ...mapGetters({
@@ -1327,6 +1320,8 @@
         UnitOrg: '',
         chooseAuditorVisibleFen: false,
         ComAuditdialogShow: false,
+        dialogSeparateUnitAuditVisible: false,
+        dialogComSubmitToSeparateUnitVisible: false,
         savebtn: true,
         visbtn: '1',
         fushenauditer: '', // 复审人员
@@ -1829,22 +1824,20 @@
       lineheight (list) {
         return list * 23 + ''
       },
-
-      imgFormat(val,index){
-         console.log(val)
-        if(val !=null && val != undefined && val !=''){
+      imgFormat (val, index) {
+        if (val != null && val != undefined && val != '') {
           let fileurlall = val.split('$')[index]
           let fileurl = fileurlall.split('|')
-          if(fileurl[1] != null && fileurl[1] !='' && fileurl[1] != undefined){
-            let Format  = fileurl[1].split(".")
-            if(Format[1]!=null && Format[1] !='' && Format[1] != undefined){
-               let pictureFormat = Format[1];
-              if("jpg"== pictureFormat || "bmp" ==pictureFormat || "png" ==pictureFormat || "gif" ==pictureFormat|| "jpeg" ==pictureFormat){
-                return false;
+          if (fileurl[1] != null && fileurl[1] != '' && fileurl[1] != undefined) {
+            let Format = fileurl[1].split('.')
+            if (Format[1] != null && Format[1] != '' && Format[1] != undefined) {
+              let pictureFormat = Format[1]
+              if (pictureFormat == 'jpg' || pictureFormat == 'bmp' || pictureFormat == 'png' || pictureFormat == 'gif' || pictureFormat == 'jpeg') {
+                return false
               }
             }
           }
-          return true;
+          return true
         }
       },
       fileurlcut (val, index) {
@@ -2221,6 +2214,139 @@
         this.ComAuditdialogShow = true
       },
 
+      separateUnitSubmitClick () {
+        console.log('提交审核按钮')
+        this.getFirAuditerByDept()
+        this.dialogSeparateUnitAuditVisible = true
+      },
+      separateUnitSubmitAuditParamsCheck () {
+        this.$refs['EntityFormref'].validate((valid) => {
+          if (valid) {
+            if (this.auditer === '') {
+              this.$message({
+                type: 'warning',
+                message: '请选择审批人!'
+              })
+              return
+            }
+            if (this.fushenauditer === '') {
+              this.$message({
+                type: 'warning',
+                message: '请选择复审人!'
+              })
+              return
+            }
+            return true
+          }
+        })
+      },
+      separateUnitSubmitAuditMakeSure () {
+        console.log('二级分办单位审核结果 确认提交')
+        let checkRes = this.separateUnitSubmitAuditParamsCheck
+        if (!checkRes) {
+          return false
+        }
+        let params = {
+          firstAudit: this.auditer,
+          SecondAudit: this.fushenauditer,
+          AuditRemark: this.entityForm.Remark
+        }
+        this.loading = true
+        annualapi.separateUnitAuditEntity(this.annualId, params, this.$axios).then(res => {
+          if (res.data.code === 0) {
+            // 保存成功后,初始化数据,变成修改
+            // this.Status = res.data.item
+            // this.entityForm.Status = this.Status
+            // this.initDatas()
+            this.getstatus(this.annualId)
+            this.dialogSeparateUnitAuditVisible = false
+            this.$message({
+              type: 'success',
+              message: res.data.message
+            })
+          } else {
+            this.$message({
+              type: 'warning',
+              message: res.data.message
+            })
+          }
+          this.loading = false
+        }).catch(err => {
+          this.loading = false
+          console.error(err)
+        })
+      },
+      comSubmitToSeparateUnitClick () {
+        this.dialogComSubmitToSeparateUnitVisible = true
+      },
+      // 企业用户自行提交审批
+      companySubmitToSecUnitSeparate () {
+        this.saveinfochange(1)
+        let checkRes = this.companySubmitToSecUnitParamsCheck
+        if (!checkRes) {
+          return false
+        }
+        this.loading = true
+        // this.auditform.FirstAuditName = this.UnitOrg
+        // this.auditform.CertId = this.formData.Id
+        // this.auditform.TypeCode = '01'
+        let params = {
+          UnitId: this.UnitOrg,
+          AuditRemark: this.auditform.AuditRemark
+        }
+        annualapi.companyAuditEntity(this.formData.Id, params, this.$axios).then(res => {
+          if (res.data.code === 0) {
+            // 保存成功后,初始化数据,变成修改
+            this.getEntityById()
+            this.dialogComSubmitToSeparateUnitVisible = false
+            this.$message({
+              type: 'success',
+              message: res.data.message
+            })
+          } else {
+            this.$message({
+              type: 'warning',
+              message: res.data.message
+            })
+          }
+          this.loading = false
+        }).catch(err => {
+          console.error(err)
+        })
+      },
+      companySubmitToSecUnitParamsCheck () {
+        if (this.myentityList == null || this.myentityList.length <= 0) {
+          this.$message({
+            type: 'warning',
+            message: '没有新增准入项,不能提交!'
+          })
+          return
+        }
+        for (let idx in this.subfileList1) {
+          if (this.subfileList1[idx].OldFileUrl === '' && this.subfileList1[idx].FileUrl === '') {
+            this.$message({
+              type: 'warning',
+              message: this.subfileList1[idx].NeedFileType + '没有上传,不能提交!'
+            })
+            return
+          }
+        }
+        if (this.UnitOrg === '') {
+          this.$message({
+            type: 'warning',
+            message: '请选择分办单位!'
+          })
+          return
+        }
+        if (this.orgauditOptions == null || this.orgauditOptions.length == 0) {
+          this.$message({
+            type: 'warning',
+            message: '该单位未配置分办人!'
+          })
+          return
+        }
+        return true
+      },
       getstatus (annid) {
         annualapi.getEntity(annid, this.$axios)
           .then(res => {
@@ -2375,7 +2501,7 @@
             this.$refs['businessList'].getvalue(res.data.Id, this.SupplierTypeCode, this.certId)
             // this.$refs['subfileList'].getvalue(res.data.Id, this.SupplierTypeCode, this.certId)
             if (this.certId && this.WorkflowId) {
-              this.$refs['WfHistory'].getHistoryTask() /* 刷新工作流*/
+              this.$refs['WfHistory'].getHistoryTask() /* 刷新工作流 */
             }
           }).catch(err => {
             console.error(err)
@@ -2436,7 +2562,7 @@
       },
 
       auditOrgChang () {
-        let auditstepcode = 'SECOND_TRIAL';
+        let auditstepcode = 'SECOND_TRIAL'
         api
           .getAuditerByFirst(this.auditer, auditstepcode, this.$axios)
           .then(res => {
@@ -2839,9 +2965,9 @@
               _this.infochangeForm.SelectItemName = '行业特殊要求的认证证书'
             } else if (_this.infochangeForm.SelectItem === 'BusinessScope') {
               _this.infochangeForm.SelectItemName = '营业范围'
-            }else if (_this.infochangeForm.SelectItem === 'TjinNotify') {
+            } else if (_this.infochangeForm.SelectItem === 'TjinNotify') {
               _this.infochangeForm.SelectItemName = '进津备案通知书'
-            }else if (_this.infochangeForm.SelectItem === 'QualifCert') {
+            } else if (_this.infochangeForm.SelectItem === 'QualifCert') {
               _this.infochangeForm.SelectItemName = '企业资质证书(编号 级别)'
             } else if (_this.infochangeForm.SelectItem === 'Remark') {
               _this.infochangeForm.SelectItemName = '备注'
@@ -2969,24 +3095,24 @@
               if (res.data.code === 0) {
                 // 保存成功后,初始化数据,变成修改
                 this.entityForm.Id = res.data.item
-              // this.initDatas();
-              this.addshow = false
+                // this.initDatas();
+                this.addshow = false
                 this.getstatus(this.annualId)
                 this.$message({
                   type: 'success',
                   message: res.data.message
                 })
-            } else {
+              } else {
                 this.$message({
                   type: 'warning',
                   message: res.data.message
                 })
-            }
+              }
             }).catch(err => {
               this.loading = false
               console.error(err)
             })
-        }
+          }
         })
       },
 

+ 296 - 32
src/dashoo.cn/frontend_web/src/pages/oilsupplier/annualaudit/_opera/techoperation.vue

@@ -26,19 +26,14 @@
           </el-button>
           <el-button type="primary" style="margin-left: 8px;" size="mini" @click="profAudit()" v-if="AnnualStatus == 3">
             专业审核分配</el-button> -->
-           <el-button type="primary" size="mini" style="margin-right: 8px" @click="itemsshow">查看变更项</el-button>
-          <el-button type="primary" size="mini" style="margin-left: 8px" @click="annualAudit()"
-            v-if="auditBtn && AnnualStatus == '1'">初审</el-button>
-          <el-button type="primary" size="mini" style="margin-left: 8px" @click="annualAudit()"
-            v-if="auditBtn && AnnualStatus == '2'">复审</el-button>
-          <el-button type="primary" size="mini" style="margin-left: 8px" @click="profAudit()"
-            v-if="auditBtn && AnnualStatus == '3'">提交专业审核</el-button>
-          <el-button type="primary" size="mini" style="margin-left: 8px" @click="annualAudit()"
-            v-if="auditBtn && AnnualStatus == '4'">专业审核</el-button>
-          <el-button type="primary" size="mini" style="margin-left: 8px" @click="annualAudit()"
-                     v-if="auditBtn && AnnualStatus == '5'">审批</el-button>
-          <el-button type="primary" style="margin-left: 8px;" size="mini" @click="fenbanBtn" v-if="auditBtn && AnnualStatus == '10'">
-            提交</el-button>
+          <el-button type="primary" size="mini" style="margin-right: 8px" @click="itemsshow">查看变更项</el-button>
+          <el-button type="primary" size="mini" style="margin-left: 8px" @click="commonAuditClick()" v-if="auditBtn && AnnualStatus == '1'">初审</el-button>
+          <el-button type="primary" size="mini" style="margin-left: 8px" @click="commonAuditClick()" v-if="auditBtn && AnnualStatus == '2'">复审</el-button>
+          <!--<el-button type="primary" size="mini" style="margin-left: 8px" @click="profAudit()" v-if="auditBtn && AnnualStatus == '3'">提交专业审核</el-button>-->
+          <!--<el-button type="primary" size="mini" style="margin-left: 8px" @click="annualAudit()" v-if="auditBtn && AnnualStatus == '4'">专业审核</el-button>-->
+          <el-button type="primary" size="mini" style="margin-left: 8px" @click="commonAuditClick()" v-if="auditBtn && AnnualStatus == '5'">审批</el-button>
+          <el-button type="primary" style="margin-left: 8px;" size="mini" @click="secUnitSeparateAuditClick" v-if="auditBtn && AnnualStatus == '10'">提交</el-button>
+          <el-button type="primary" size="mini" style="margin-left: 8px" @click="paySureClick()" v-if="auditBtn && parseInt(this.anndata.Status) === 6">交费</el-button>
           <el-button type="primary" size="mini" style="margin-left: 8px;" onclick="window.history.go(-1)">返回</el-button>
         </span>
       </div>
@@ -632,7 +627,24 @@
         <el-button type="primary" size="small" @click="makeSure()" :loading="loading">确 定</el-button>
       </div>
     </el-dialog>
-
+    <el-dialog title="审核" :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="0" @change="radioChange">未通过</el-radio>
+          </template>
+        </el-form-item>
+        <el-form-item label="意见" :rules="[{ required: true, message: '请输入审批意见', trigger: 'blur' }]">
+          <el-input type="textarea" v-model="shenheForm.AuditorRemark" :placeholder="textplaceholder">
+          </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="dialogProfAudit" width="420px">
       <el-form ref="searchForm" label-width="110px">
         <el-form-item label="审批人">
@@ -657,8 +669,8 @@
           <el-col :span="24">
             <el-form-item label="审批状态">
               <el-radio-group v-model="shenheForm.SuccessStatus">
-                <el-radio :label="1" @change="radioChange">通过</el-radio>
-                <el-radio :label="0" @change="radioChange">退回</el-radio>
+                <el-radio :label="1">通过</el-radio>
+                <el-radio :label="0">退回</el-radio>
               </el-radio-group>
             </el-form-item>
           </el-col>
@@ -715,6 +727,65 @@
       </span>
       <br>
     </el-dialog>
+    <el-dialog title="分办" :visible.sync="dialogSecUnitSeparateVisible" width="520px">
+      <el-form label-width="90px" :model="shenheForm" 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" v-if="shenheForm.SuccessStatus == 1">
+            <el-form-item label="初审人员">
+              <!--<el-input ref="selectAuditer" readonly v-model="auditerName" placeholder="请选择初审人">-->
+              <!--<el-button slot="append" icon="el-icon-search" @click="chooseAuditorShow"></el-button>-->
+              <!--</el-input>-->
+              <el-select ref="selectAuditer"
+                         v-model="auditer"
+                         placeholder="请选择初审人"
+                         style="width: 100%"
+                         filterable
+                         allow-create
+                         default-first-option
+                         @change="auditOrgChang()">
+                <el-option v-for="item in firOptions"
+                           :key="item.Id"
+                           :label="item.Realname"
+                           :value="item.Id">
+                </el-option>
+              </el-select>
+            </el-form-item>
+            <el-form-item label="复审人员">
+              <el-select ref="selectAuditer" v-model="fushenauditer" 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>
+              </el-select>
+            </el-form-item>
+          </el-col>
+          <el-col :span="24" v-if="shenheForm.SuccessStatus == 1">
+            <el-form-item label="备注">
+              <el-input v-model="shenheForm.AuditorRemark" type="textarea" placeholder="请输入备注内容">
+              </el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :span="24" v-if="shenheForm.SuccessStatus == 0">
+            <el-form-item label="退回原因">
+              <el-input v-model="shenheForm.AuditorRemark" type="textarea" placeholder="退回意见不能少于5个字">
+              </el-input>
+            </el-form-item>
+          </el-col>
+        </el-row>
+      </el-form>
+      <span style="float: right;margin-top:-10px;">
+        <el-button size="small" @click="dialogSecUnitSeparateVisible = false">取 消</el-button>
+        <el-button type="primary" size="small" @click="secUnitSeparateAuditMakeSure()" :loading="loading">确 定</el-button>
+      </span>
+      <br>
+    </el-dialog>
     <el-dialog title="变更项查看" :visible.sync="myitemsshow" width="780px">
       <el-table :data="InfoData" border style="width: 100%">
         <el-table-column align="center" prop="SelectItemName" label="变更项目">
@@ -758,16 +829,14 @@
   import ChooseAuditor from '@/components/oilsupplier/chooseauditor'
   import _ from 'lodash'
 
-   // v-viewer
-  import Vue from 'vue';
+  // v-viewer
+  import Vue from 'vue'
   import Viewer from 'v-viewer'
   import 'viewerjs/dist/viewer.css'
   Vue.use(Viewer)
   Viewer.setDefaults({
     Options: { 'inline': true, 'button': true, 'navbar': true, 'title': true, 'toolbar': true, 'tooltip': true, 'movable': true, 'zoomable': true, 'rotatable': true, 'scalable': true, 'transition': true, 'fullscreen': true, 'keyboard': true, 'url': 'data-source' }
   })
-
-
   export default {
     computed: {
       ...mapGetters({
@@ -961,6 +1030,8 @@
         }],
         addshow: false,
         chooseAuditorVisible: false,
+        dialogCommonAuditMakeSureVisible: false,
+        dialogSecUnitSeparateVisible: false,
         auditer: '',
         auditerName: '',
         fushenauditer: '',
@@ -1384,21 +1455,20 @@
         }
         return retUrl
       },
-       imgFormat(val,index){
-         console.log(val)
-        if(val !=null && val != undefined && val !=''){
+      imgFormat (val, index) {
+        if (val != null && val != undefined && val != '') {
           let fileurlall = val.split('$')[index]
           let fileurl = fileurlall.split('|')
-          if(fileurl[1] != null && fileurl[1] !='' && fileurl[1] != undefined){
-            let Format  = fileurl[1].split(".")
-            if(Format[1]!=null && Format[1] !='' && Format[1] != undefined){
-               let pictureFormat = Format[1];
-              if("jpg"== pictureFormat || "bmp" ==pictureFormat || "png" ==pictureFormat || "gif" ==pictureFormat|| "jpeg" ==pictureFormat){
-                return false;
+          if (fileurl[1] != null && fileurl[1] != '' && fileurl[1] != undefined) {
+            let Format = fileurl[1].split('.')
+            if (Format[1] != null && Format[1] != '' && Format[1] != undefined) {
+              let pictureFormat = Format[1]
+              if (pictureFormat == 'jpg' || pictureFormat == 'bmp' || pictureFormat == 'png' || pictureFormat == 'gif' || pictureFormat == 'jpeg') {
+                return false
               }
             }
           }
-          return true;
+          return true
         }
       },
       getsubfile () {
@@ -1452,6 +1522,97 @@
         this.shenheForm.AnnualId = parseInt(this.annualId)
         this.addshow = true
       },
+      // 二级单位分办
+      secUnitSeparateAuditClick () {
+        console.log('二级单位分办审批会话框')
+        this.getFirAuditerByDept()
+        this.shenheForm.AnnualId = parseInt(this.annualId)
+        this.dialogSecUnitSeparateVisible = true
+      },
+      // 二级单位分办审批参数检查 ⬇
+      secUnitSeparateAuditParamsCheck () {
+        if (this.shenheForm.SuccessStatus === 1) {
+          if (this.auditer === '') {
+            this.$message({
+              type: 'warning',
+              message: '请选择初审人!'
+            })
+            return
+          }
+          if (this.fushenauditer === '') {
+            this.$message({
+              type: 'warning',
+              message: '请选择复审人!'
+            })
+            return
+          }
+          if (this.shenheForm.AuditorRemark.trim().length < 1 && this.formData.Status === '5') {
+            this.$message({
+              type: 'warning',
+              message: '请填写审批意见!'
+            })
+            return
+          }
+          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 false
+          }
+        } else {
+          this.shenheForm.AuditorRemark = this.backRemark
+          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 false
+          }
+        }
+        return true
+      },
+      // 二级单位分办审批结果确认 ⬇
+      secUnitSeparateAuditMakeSure () {
+        console.log('二级单位分办审批结果确认')
+        let checkRes = this.secUnitSeparateAuditParamsCheck()
+        if (!checkRes) {
+          return false
+        }
+        this.loading = true
+        let params = {
+          FirstAudit: this.auditer,
+          SecondAudit: this.fushenauditer,
+          AuditRemark: this.shenheForm.AuditorRemark
+        }
+        console.log('二级单位分办审批结果提交参数:', params)
+        annualapi.separateAuditEntity(this.shenheForm.AnnualId, params, this.$axios).then(res => {
+          if (res.data.code === 0) {
+            console.log('审批提交,成功返回')
+            this.initDatas()
+            this.$message({
+              type: 'success',
+              message: res.data.message
+            })
+            this.dialogSecUnitSeparateVisible = false
+          } else {
+            this.$message({
+              type: 'warning',
+              message: res.data.message
+            })
+          }
+          this.loading = false
+        }).catch(err => {
+          console.error(err)
+        })
+      },
       orgtreeChange (val) {
         this.userOptions = []
         if (val) {
@@ -1531,6 +1692,8 @@
               this.auditstepcode = 'PROF_AUDIT'
             } else if (this.anndata.Status === '5') {
               this.auditstepcode = 'PROF_REGULATION'
+            } else if (this.anndata.Status === '6') {
+              this.auditstepcode = 'PAYING_FEE'
             } else if (this.anndata.Status === '10') {
               if (this.anndata.SupplierTypeName === '01') {
                 this.auditstepcode = 'SUB_OFFICE_WZ'
@@ -2078,9 +2241,9 @@
               _this.infochangeForm.SelectItemName = '行业特殊要求的认证证书'
             } else if (_this.infochangeForm.SelectItem === 'BusinessScope') {
               _this.infochangeForm.SelectItemName = '营业范围'
-            }else if (_this.infochangeForm.SelectItem === 'TjinNotify') {
+            } else if (_this.infochangeForm.SelectItem === 'TjinNotify') {
               _this.infochangeForm.SelectItemName = '进津备案通知书'
-            }else if (_this.infochangeForm.SelectItem === 'QualifCert') {
+            } else if (_this.infochangeForm.SelectItem === 'QualifCert') {
               _this.infochangeForm.SelectItemName = '企业资质证书(编号 级别)'
             } else if (_this.infochangeForm.SelectItem === 'Remark') {
               _this.infochangeForm.SelectItemName = '备注'
@@ -2127,6 +2290,107 @@
         this.shenheForm.AnnualId = parseInt(this.annualId)
         this.dialogMakeSure = true
       },
+      commonAuditClick () {
+        console.log('审批公共会话框')
+        this.shenheForm.AnnualId = parseInt(this.annualId)
+        this.dialogCommonAuditMakeSureVisible = true
+      },
+      commonAuditMakeSure () {
+        console.log('审批结果公共提交')
+        let checkRes = this.commonAuditParamsCheck()
+        console.log(checkRes, '审批结果公共提交')
+        if (!checkRes) {
+          return false
+        }
+        this.loading = true
+        let params = {
+          result: this.shenheForm.SuccessStatus,
+          AuditRemark: this.shenheForm.AuditorRemark
+        }
+        console.log('审批结果提交参数:', params)
+        annualapi.commonAuditEntity(this.shenheForm.AnnualId, params, this.$axios).then(res => {
+          if (res.data.code === 0) {
+            console.log('审批提交,成功返回')
+            this.$message({
+              type: 'success',
+              message: res.data.message
+            })
+            this.$router.push('/')
+          } else {
+            this.$message({
+              type: 'warning',
+              message: res.data.message
+            })
+          }
+          this.dialogCommonAuditMakeSureVisible = false
+          this.loading = false
+        }).catch(err => {
+          console.error(err)
+        })
+      },
+      commonAuditParamsCheck () {
+        if (this.shenheForm.SuccessStatus === 1) {
+          if (this.shenheForm.AuditorRemark.trim().length < 20 && this.AnnualStatus && this.AnnualStatus !== '10') {
+            if (this.AnnualStatus !== '5') {
+              this.$message({
+                type: 'warning',
+                message: '审批意见不能低于20个字符!'
+              })
+              return false
+            }
+          }
+        } else {
+          if (this.shenheForm.AuditorRemark.trim().length < 5) {
+            this.$message({
+              type: 'warning',
+              message: '退回意见不能低于5个字符!'
+            })
+            return false
+          }
+        }
+        return true
+      },
+      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
+        }
+        console.log('交费结果确认提交参数:', params)
+        annualapi.updatePayStatus(this.annualId, 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.loading = false
+        }).catch(err => {
+          console.error(err)
+        })
+      },
       profAudit () {
         this.shenheForm.AnnualId = parseInt(this.annualId)
         this.auditOrgChange()