Ver código fonte

准入初审- 提交审批 按钮

herozyw1 6 anos atrás
pai
commit
3c7ff64caf

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

@@ -69,6 +69,9 @@ const (
 	//业务步骤编码
 	FIRST_TRIAL string = "FIRST_TRIAL"
 
+	//业务处室专业审核
+	PROF_AUDIT string = "PROF_AUDIT"
+
 	//年审流程图
 	OIL_AUDIT_APPLY string = "oil_audit_apply"
 )

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

@@ -1,12 +1,13 @@
 package oilsupplier
 
 import (
-	"dashoo.cn/business2/permission"
 	"encoding/json"
 	"strconv"
 	"strings"
 	"time"
 
+	"dashoo.cn/business2/permission"
+
 	"dashoo.cn/backend/api/business/workflow"
 	"dashoo.cn/business2/areajson"
 	"dashoo.cn/business2/items"

+ 35 - 1
src/dashoo.cn/backend/api/controllers/oilsupplier/suppliercert.go

@@ -494,7 +494,6 @@ func (this *OilSupplierCertController) DeleteEntity() {
 // @router /audit/:id [post]
 func (this *OilSupplierCertController) AuditEntity() {
 	certId := this.Ctx.Input.Param(":id")
-
 	var errinfo ErrorDataInfo
 	defer func() { //finally处理失败的异常
 		if err := recover(); err != nil {
@@ -530,6 +529,41 @@ func (this *OilSupplierCertController) AuditEntity() {
 	certSrv.UpdateEntityByIdCols(certId, supplierCertEntity, cols)
 }
 
+// @Title 准入初审提交审批
+// @Description 准入初审提交审批
+// @Success	200	{object} controllers.Request
+// @router /admission/:id [post]
+func (this *OilSupplierCertController) AuditEntityadmission() {
+	certId := this.Ctx.Input.Param(":id")
+	var errinfo ErrorDataInfo
+	defer func() { //finally处理失败的异常
+		if err := recover(); err != nil {
+			errinfo.Message = "提交失败," + err.(string)
+			errinfo.Code = -1
+			this.Data["json"] = &errinfo
+			this.ServeJSON()
+		} else {
+			//返回正确结果
+			errinfo.Message = "审核提交成功"
+			errinfo.Code = 0
+			this.Data["json"] = &errinfo
+			this.ServeJSON()
+		}
+	}()
+	//取出审批列表
+	certSrv := suppliercert.GetOilSupplierCertService(utils.DBE)
+	certSrv.SubmitOrgAudit(certId, workflow.OIL_SUPPLIER_APPLY, workflow.PROF_AUDIT, this.User.Id, "1", "提交给专业科室审核", OilSupplierCertSubName, OilClassOrgSettingName)
+	//记下workflowID(首次提交时才会记录,中间状态请忽略) 及审批状态
+	var supplierCertEntity suppliercert.OilSupplierCert
+	certSrv.GetEntityById(certId, supplierCertEntity)
+	supplierCertEntity.Status = suppliercert.PROF_AUDIT_STATUS //二级单位初审
+	cols := []string{
+		"Id",
+		"Status",
+	}
+	certSrv.UpdateEntityByIdCols(certId, supplierCertEntity, cols)
+}
+
 //// @Title 提交二级审批
 //// @Description 提交二级审批
 //// @Param 	body body suppliercert.OilSupplierCert

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

@@ -50,4 +50,10 @@ export default {
       method: 'post'
     })
   },
+  auditEntityadmission (entityId, myAxios) {
+    return myAxios({
+      url: '/suppliercert/admission/' + entityId,
+      method: 'post'
+    })
+  }
 }

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

@@ -87,7 +87,7 @@
     mapGetters
   } from 'vuex'
   import AuditfileList from '../../components/oilsupplier/auditfilelist'
-
+  import apiCert from '@/api/oilsupplier/suppliercert'
   export default {
     name: 'AuditBusList',
     components: {
@@ -109,6 +109,7 @@
     },
     created() {
       this.initData()
+      this.certId = this.$route.query.certid + ''
     },
     computed: {
       ...mapGetters({
@@ -176,11 +177,33 @@
             console.error(err)
           })
       },
+      // AuditEntity() {
+      //   this.$axios.post('/suppliercert/audit' + this.certId, {
+      //     params
+      //   }).then(res => {
+      //     if (res.data.code === 0) {
+      //       this.initData()
+      //       this.$message({
+      //         type: 'success',
+      //         message: res.data.message
+      //       });
+      //     } else {
+      //       this.$message({
+      //         type: 'warning',
+      //         message: res.data.message
+      //       });
+      //     }
+      //   }).catch(err => {
+      //     console.error(err)
+      //   });
+      // },
+
+      //准入初审 提交审批
       AuditEntity() {
-        this.$axios.post('/suppliercert/audit' + this.certId, {
-          params
-        }).then(res => {
+        this.applyLoading = true
+        apiCert.auditEntityadmission(this.certId, this.$axios).then(res => {
           if (res.data.code === 0) {
+            //保存成功后,初始化数据,变成修改
             this.initData()
             this.$message({
               type: 'success',
@@ -192,11 +215,12 @@
               message: res.data.message
             });
           }
+          this.applyLoading = false
+
         }).catch(err => {
           console.error(err)
         });
       },
-
       addAudit() {
         let _this = this;
         _this.AuditForm.SupplierId = parseInt(_this.AuditForm.SupplierId)