lining 6 anni fa
parent
commit
f980834e2d

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

@@ -71,6 +71,7 @@ const (
 	DRAFT_STATUS string = "0" //草稿状态
 	FIRST_TRIAL_STATUS string = "1" //二级单位初审
 	SECOND_TRIAL_STATUS string = "2" //二级单位复审
+	THIRD_TRIAL_STATUS string = "3" //专业处接收
 	PROF_AUDIT_STATUS string = "2" //专业科室审核
 )
 

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

@@ -66,13 +66,16 @@ type MultiOrgAuditVM struct {
 
 const (
 	//供方准入流程图
-	OIL_SUPPLIER_APPLY string = "oil_supplier_apply"
+	OIL_SUPPLIER_APPLY string = "oil_supplier_apply_1"
 	//增项业务
 	OIL_SUPPLIER_APPEND string = "oil_supplier_append"
 	//业务步骤编码 初审
 	FIRST_TRIAL string = "FIRST_TRIAL"
 	// 复审
 	SECOND_TRIAL string= "SECOND_TRIAL"
+	//专业处室接收
+	PROF_RECE string = "PROF_RECE"
+
 	//业务处室专业审核
 	PROF_AUDIT string = "PROF_AUDIT"
 

+ 10 - 1
src/dashoo.cn/backend/api/controllers/oilsupplier/supplier.go

@@ -1,6 +1,7 @@
 package oilsupplier
 
 import (
+	"dashoo.cn/backend/api/business/auditsetting"
 	"dashoo.cn/backend/api/business/organize"
 	"encoding/json"
 	"strconv"
@@ -17,7 +18,7 @@ import (
 	"dashoo.cn/backend/api/business/oilsupplier/supplier"
 	"dashoo.cn/backend/api/business/oilsupplier/suppliercert"
 	. "dashoo.cn/backend/api/controllers"
-	"dashoo.cn/business/userRole"
+	"dashoo.cn/business2/userRole"
 	"dashoo.cn/utils"
 	"github.com/go-xorm/xorm"
 )
@@ -1011,6 +1012,14 @@ func (this *OilSupplierController) GetDictList() {
 	//customerSvc.GetEntitysByWhere(this.User.AccCode + CustomerName, "", &dictCustomer)
 	//dictList["EntrustCorp"] = &dictCustomer
 
+	//获得有审核权限的人员
+	var users []userRole.Base_RoleList
+	var auditWorkflow auditsetting.Base_OilAuditSetting
+	rsvc := auditsetting.GetOilAuditSettingService(utils.DBE)
+	rsvc.GetAuditStepRoleEntity(OilAuditSettingName, this.User.DepartmentId, workflow.SECOND_TRIAL, &auditWorkflow)
+	users = rsvc.GetUserByRole(strconv.Itoa(auditWorkflow.RoleId), this.User.AccCode) //
+	dictList["SecondAudit"] = users
+
 	var datainfo DataInfo
 	datainfo.Items = dictList
 	this.Data["json"] = &datainfo

+ 65 - 26
src/dashoo.cn/backend/api/controllers/oilsupplier/suppliercert.go

@@ -499,6 +499,12 @@ func (this *OilSupplierCertController) DeleteEntity() {
 func (this *OilSupplierCertController) AuditEntity() {
 	certId := this.Ctx.Input.Param(":id")
 	firstAudit := this.GetString("firstAudit")
+
+	//取出审批列表
+	certSrv := suppliercert.GetOilSupplierCertService(utils.DBE)
+	var supplierCertEntity suppliercert.OilSupplierCert
+	certSrv.GetEntityById(certId, &supplierCertEntity)
+
 	var errinfo ErrorDataInfo
 	defer func() { //finally处理失败的异常
 		if err := recover(); err != nil {
@@ -521,9 +527,6 @@ func (this *OilSupplierCertController) AuditEntity() {
 	//	result = "0"
 	//}
 
-	//取出审批列表
-	certSrv := suppliercert.GetOilSupplierCertService(utils.DBE)
-
 	svcActiviti := workflow.GetActivitiService(utils.DBE)
 	//获得有审核权限的人员
 	var users []userRole.Base_RoleList
@@ -533,6 +536,11 @@ func (this *OilSupplierCertController) AuditEntity() {
 	rsvc.GetAuditStepRoleEntity(OilAuditSettingName, firstAudit, workflow.FIRST_TRIAL, &auditWorkflow)
 	users = rsvc.GetUserByRole(strconv.Itoa(auditWorkflow.RoleId), this.User.AccCode) //
 
+	processInstanceId := ""
+	if supplierCertEntity.WorkflowId == "0" || len(supplierCertEntity.WorkflowId) <= 0 {
+		//启动工作流
+		processInstanceId = svcActiviti.StartProcess(workflow.OIL_SUPPLIER_APPLY, certId, this.User.Id)
+	}
 
 	//processInstanceId,_ := certSrv.SubmitOrgAudit(certId, workflow.OIL_SUPPLIER_APPLY, workflow.FIRST_TRIAL, this.User.Id, result, "提交给二级单位初审", OilSupplierCertSubName, OilClassOrgSettingName, "", "")
 	for _, tmpUser := range users {
@@ -545,7 +553,7 @@ func (this *OilSupplierCertController) AuditEntity() {
 	ActiComplete.UserNames = userIds
 	ActiComplete.UserId = this.User.Id
 	ActiComplete.Result = "1"
-	ActiComplete.Remarks = "提交给二级单位初审"
+	ActiComplete.Remarks = ""
 	ActiComplete.CallbackUrl = ""
 	receiveVal := svcActiviti.TaskComplete(ActiComplete)
 
@@ -564,9 +572,8 @@ func (this *OilSupplierCertController) AuditEntity() {
 
 	fmt.Println("-----------processInstanceId------------")
 	//记下workflowID(首次提交时才会记录,中间状态请忽略) 及审批状态
-	var supplierCertEntity suppliercert.OilSupplierCert
-	certSrv.GetEntityById(certId, supplierCertEntity)
-	//supplierCertEntity.WorkflowId = processInstanceId
+
+	supplierCertEntity.WorkflowId = processInstanceId
 	supplierCertEntity.Status = suppliercert.FIRST_TRIAL_STATUS //二级单位初审
 	supplierCertEntity.Step = 2
 	supplierCertEntity.FirstAudit,_ = strconv.Atoi(firstAudit)
@@ -680,7 +687,13 @@ func (this *OilSupplierCertController) AuditEntityappend() {
 // @router /auditEntityFir/:id [post]
 func (this *OilSupplierCertController) AuditEntityFir() {
 	certId := this.Ctx.Input.Param(":id")
-	status := this.GetString("status")
+	auditer := this.GetString("auditer")
+
+	//取出审批列表
+	certSrv := suppliercert.GetOilSupplierCertService(utils.DBE)
+	var supplierCertEntity suppliercert.OilSupplierCert
+	certSrv.GetEntityById(certId, &supplierCertEntity)
+
 	var jsonblob = this.Ctx.Input.RequestBody
 	var dataother ShenHeModel
 	json.Unmarshal(jsonblob, &dataother)
@@ -700,29 +713,54 @@ func (this *OilSupplierCertController) AuditEntityFir() {
 		}
 	}()
 
-	wfNodeCode := "" // 审批步骤
-	remarks := ""
-	step := "2"
-	if status == "1" {
-		wfNodeCode = workflow.SECOND_TRIAL
-		remarks = "提交给二级单位复审"
-		step = "2"
-	} else if status == "2" {
-		wfNodeCode = workflow.PROF_AUDIT
-		remarks = "提交给专业处审批"
-		step = "2"
-	} else if status == "3" {
+	//remarks := ""
+	step := 2
+	status := ""
+	if supplierCertEntity.Status == "1" {
+		status = suppliercert.SECOND_TRIAL_STATUS
+		//remarks = "提交给二级单位复审"
+		step = 2
+	} else if supplierCertEntity.Status == "2" {
+		//remarks = "提交给专业处"
+		status = suppliercert.THIRD_TRIAL_STATUS
+		step = 2
+		//获得有专业审核接收权限的人员
+		var users1 []userRole.Base_RoleList
+		var auditWorkflow1 auditsetting.Base_OilAuditSetting
+		rsvc := auditsetting.GetOilAuditSettingService(utils.DBE)
+		rsvc.GetAuditStepRoleEntity(OilAuditSettingName, "100000172", workflow.PROF_RECE, &auditWorkflow1)
+		users1 = rsvc.GetUserByRole(strconv.Itoa(auditWorkflow1.RoleId), this.User.AccCode)
+		for _, tmpUser := range users1 {
+			auditer += strconv.FormatInt(tmpUser.Id, 10) + ","
+		}
+		auditer = strings.Trim(auditer, ",")
+	} else if supplierCertEntity.Status == "3" {
 
-	} else if status == "4" {
+	} else if supplierCertEntity.Status == "4" {
 
 	}
 
+	svcActiviti := workflow.GetActivitiService(utils.DBE)
 	if dataother.SuccessStatus == 1 {
-		//取出审批列表
-		certSrv := suppliercert.GetOilSupplierCertService(utils.DBE)
-		_,res := certSrv.SubmitOrgAudit(certId, workflow.OIL_SUPPLIER_APPLY, wfNodeCode, this.User.Id, "1", remarks, OilSupplierCertSubName, OilClassOrgSettingName, suppliercert.SECOND_TRIAL_STATUS, step)
-		if res == "true" {
-			errinfo.Message = "审核通过!"
+		var ActiComplete workflow.ActiCompleteVM
+		ActiComplete.ProcessKey = workflow.OIL_SUPPLIER_APPLY
+		ActiComplete.BusinessKey = certId
+		ActiComplete.UserNames = auditer
+		ActiComplete.UserId = this.User.Id
+		ActiComplete.Result = "1"
+		ActiComplete.Remarks = dataother.AuditorRemark
+		ActiComplete.CallbackUrl = ""
+		receiveVal := svcActiviti.TaskComplete(ActiComplete)
+
+		if receiveVal == "true" {
+			supplierCertEntity.Status = status
+			supplierCertEntity.Step = step
+			cols := []string{
+				"Status",
+				"Step",
+			}
+			certSrv.UpdateEntityByIdCols(certId, supplierCertEntity, cols)
+			errinfo.Message = "提交成功!"
 			errinfo.Code = 0
 			this.Data["json"] = &errinfo
 			this.ServeJSON()
@@ -731,6 +769,7 @@ func (this *OilSupplierCertController) AuditEntityFir() {
 			errinfo.Code = -1
 			this.Data["json"] = &errinfo
 			this.ServeJSON()
+			return
 		}
 	} else {
 

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

@@ -64,9 +64,9 @@ export default {
       method: 'post'
     })
   },
-  auditEntityFir (entityId, status, params, myAxios) {
+  auditEntityFir (entityId, auditer, params, myAxios) {
     return myAxios({
-      url: '/suppliercert/auditEntityFir/' + entityId + '?status=' + status,
+      url: '/suppliercert/auditEntityFir/' + entityId + '?auditer=' + auditer,
       method: 'post',
       data: params
     })

+ 5 - 1
src/dashoo.cn/frontend_web/src/components/oilsupplier/auditbuslist.vue

@@ -4,7 +4,7 @@
       <div slot="header" class="clearfix">
         <span style="font-weight: bold">分类</span>
         <span style="float: right;">
-          <el-button type="primary" size="mini" @click="AuditEntity">提交审批</el-button>
+          <el-button type="primary" size="mini"  v-if ="Visiblebtn =='0'" @click="AuditEntity">提交审批</el-button>
         </span>
       </div>
       <el-table :data="auditbusList" border>
@@ -105,6 +105,10 @@
       SupplierTypeCode: {
         type: String,
         default: '0'
+      },
+      Visiblebtn: {
+        type: String,
+        default: '0'
       }
     },
     created () {

+ 35 - 6
src/dashoo.cn/frontend_web/src/pages/oilsupplier/supplieraudit/_opera/goodsedit.vue

@@ -147,7 +147,7 @@
 
         <el-tab-pane label="审批意见">
           <auditbus-list ref="auditbusList" :data="auditbusList" :SupplierCertId="certId" :SupplierId="serviceId"
-                         :SupplierTypeCode="classId" height="360px" style="margin-top: 20px"></auditbus-list>
+                         :SupplierTypeCode="classId" :Visiblebtn="this.formData.Status" height="360px" style="margin-top: 20px"></auditbus-list>
         </el-tab-pane>
 
         <el-tab-pane label="流程查看">
@@ -162,6 +162,17 @@
     </el-card>
     <el-dialog title="审核" :visible.sync="dialogMakeSure">
       <el-form :model="shenheForm" label-width="100px" ref="shenheForm">
+        <el-form-item :label="aduitlabel" v-if="this.formData.Status != '2'">
+          <el-select ref="selectAuditer" v-model="auditer" placeholder="请选择"
+                     style="width: 90%" filterable allow-create default-first-option>
+            <el-option
+              v-for="item in auditerOptions"
+              :key="item.id"
+              :label="item.realname"
+              :value="item.id">
+            </el-option>
+          </el-select>
+        </el-form-item>
         <el-form-item label="审核状态">
           <template>
             <el-radio class="radio" v-model="shenheForm.SuccessStatus" :label="1">通过</el-radio>
@@ -224,15 +235,16 @@
         patentList: [], // 拥有专利、专有技术及工法
         winningList: [], // 近三年获得省部级及以上主要技术、管理成果、获奖项目
         auditbusList: [], // 待审核业务
-
+        auditerOptions: [], // 审核人员
         serviceId: '',
         certId: '',
         classId: '01',
         dictData: null,
         dialogMakeSure: false,
-
+        aduitlabel: '审核人员',
+        auditer: '',
         shenheForm: {
-          SuccessStatus: 3,
+          SuccessStatus: 1,
           AuditorRemark: '',
           AnnualId: 0
         },
@@ -326,7 +338,7 @@
           WorkflowId: ''
         },
         entrydetail: {
-          process: 'oil_supplier_apply',
+          process: 'oil_supplier_apply_1',
           business: '',
           instance: ''
         }
@@ -376,6 +388,11 @@
 
             this.entrydetail.business = this.certId
             this.entrydetail.instance = this.formDataCert.WorkflowId
+            if (this.formData.Status === '1') {
+              this.aduitlabel = '复审人员'
+            } else if (this.formData.Status === '3') {
+              this.aduitlabel = '审批人'
+            }
           }).catch(err => {
             console.error(err)
           })
@@ -385,6 +402,8 @@
       getDictOptions () {
         api.getDictList(this.$axios).then(res => {
           this.dictData = res.data.items
+          this.auditerOptions = res.data.items['SecondAudit']
+          console.log(this.auditerOptions, 'this.auditerOptions')
         }).catch(err => {
           console.error(err)
         })
@@ -519,6 +538,16 @@
 
       // 审核通过
       makeSure () {
+        console.log(this.auditer)
+        if (this.shenheForm.SuccessStatus === 1) {
+          if ((!this.auditer || this.auditer === 0) && this.formData.Status !== '2') {
+            this.$message({
+              type: 'warning',
+              message: '请选择审核人!'
+            })
+            return
+          }
+        }
         this.dialogMakeSure = false
         this.checkstatus()
       },
@@ -526,7 +555,7 @@
       checkstatus () {
         let params = this.shenheForm
         console.log(this.shenheForm, '---this.shenheForm----')
-        apiCert.auditEntityFir(this.certId, this.formData.Status, params, this.$axios).then(res => {
+        apiCert.auditEntityFir(this.certId, this.auditer, params, this.$axios).then(res => {
           if (res.data.code === 0) {
             this.initDatas()
             this.$message({