Forráskód Böngészése

驳回的待办-办理按钮跳转, 入库以后相关状态的更新

baichengfei 5 éve
szülő
commit
fc2a9c779a

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

@@ -292,9 +292,10 @@ func (this *OilAnnualListenerController) WorkflowEndAudit() {
 	cols := []string{
 		"Id",
 		"Status",
+		"ApplyTime",
 	}
 	//进入此步骤,记录在数据库中
-	annualEntity.Status = suppliercert.ALL_PASE_STATUS //审核完成
+	annualEntity.Status = suppliercert.STORE_STATUS //审核完成
 	annualEntity.ApplyTime = annualEntity.ApplyTime.AddDate(1, 0, 0) //更新年审表时间
 	srv.UpdateEntityByIdCols(annualId, annualEntity, cols)
 

+ 51 - 0
src/dashoo.cn/backend/api/controllers/oilsupplier/annualaudit.go

@@ -1116,6 +1116,57 @@ func (this *AnnualAuditController) CommonAuditEntity() {
 	}
 }
 
+// @Title 确认是否入库
+// @Description 确认是否入库
+// @Success	200	{object} controllers.Request
+// @router /update-is-storage/:id [post]
+func (this *AnnualAuditController) UpdateIsStorage() {
+	id := this.Ctx.Input.Param(":id")
+	status := this.GetString("Status")
+	PACNumber := this.GetString("PACNumber")
+	SupplierId := this.GetString("SupplierId")
+	var errinfo ErrorInfo
+	if id == "" {
+		errinfo.Message = "操作失败!请求信息不完整"
+		errinfo.Code = -2
+		this.Data["json"] = &errinfo
+		this.ServeJSON()
+		return
+	}
+
+	var annualEntity annualaudit.OilAnnualAudit
+	annualSrv := annualaudit.GetOilAnnualAuditService(utils.DBE)
+	annualSrv.GetEntityById(id, &annualEntity)
+
+	var supplierEntity supplier.OilSupplier
+	srv := supplier.GetOilSupplierService(utils.DBE)
+	srv.GetEntityById(SupplierId, &supplierEntity)
+	supplierEntity.PACNumber = PACNumber
+	srvCols := []string{"PACNumber"}
+	srv.UpdateEntityByIdCols(SupplierId, &supplierEntity, srvCols)
+
+	AuditRemark := ""
+	if status == "1" {
+		AuditRemark = "已入库。"
+	} else {
+		AuditRemark = "入库审批驳回。"
+	}
+
+	svcActiviti := workflow.GetActivitiService(utils.DBE)
+	var ActiComplete workflow.ActiCompleteVM
+	ActiComplete.ProcessKey = workflow.OIL_AUDIT_APPLY
+	ActiComplete.BusinessKey = annualEntity.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} ErrorInfo

+ 51 - 0
src/dashoo.cn/backend/api/controllers/oilsupplier/suppliercert.go

@@ -1017,6 +1017,57 @@ func (this *OilSupplierCertController) ConcentrateAuditEntity() {
 	//certSrv.UpdateEntityByIdCols(supplierCertId, supplierCertEntity, cols)
 }
 
+// @Title 确认是否入库
+// @Description 确认是否入库
+// @Success	200	{object} controllers.Request
+// @router /update-is-storage/:id [post]
+func (this *OilSupplierCertController) UpdateIsStorage() {
+	id := this.Ctx.Input.Param(":id")
+	status := this.GetString("Status")
+	PACNumber := this.GetString("PACNumber")
+	SupplierId := this.GetString("SupplierId")
+	var errinfo ErrorInfo
+	if id == "" {
+		errinfo.Message = "操作失败!请求信息不完整"
+		errinfo.Code = -2
+		this.Data["json"] = &errinfo
+		this.ServeJSON()
+		return
+	}
+
+	var supplierCertEntity suppliercert.OilSupplierCert
+	certSrv := suppliercert.GetOilSupplierCertService(utils.DBE)
+	certSrv.GetEntityById(id, &supplierCertEntity)
+
+	var supplierEntity supplier.OilSupplier
+	srv := supplier.GetOilSupplierService(utils.DBE)
+	srv.GetEntityById(SupplierId, &supplierEntity)
+	supplierEntity.PACNumber = PACNumber
+	srvCols := []string{"PACNumber"}
+	srv.UpdateEntityByIdCols(SupplierId, &supplierEntity, srvCols)
+
+	AuditRemark := ""
+	if status == "1" {
+		AuditRemark = "已入库。"
+	} else {
+		AuditRemark = "入库审批驳回。"
+	}
+
+	svcActiviti := workflow.GetActivitiService(utils.DBE)
+	var ActiComplete workflow.ActiCompleteVM
+	ActiComplete.ProcessKey = workflow.OIL_ENUSER_SUPPLIER_APPLY
+	ActiComplete.BusinessKey = supplierCertEntity.BusinessKey
+	ActiComplete.UserId = this.User.Id //审批人员
+	ActiComplete.Result = "1" //前台审批[同意、不同意]
+	ActiComplete.Remarks = AuditRemark
+	ActiComplete.CallbackUrl = utils.Cfg.MustValue("workflow", "callbackHost")
+	receiveVal := svcActiviti.TaskComplete(ActiComplete)
+	if receiveVal != "true" {
+		panic("工作流异常,请联系管理员!" + receiveVal)
+	}
+
+}
+
 // @Title 获取实体
 // @Description 获取实体
 // @Success 200 {object} controllers.Request

+ 8 - 0
src/dashoo.cn/backend/api/controllers/oilsupplier/suppliercertListener.go

@@ -408,9 +408,17 @@ func (this *OilSupplierCertListenerController) WorkflowEndAudit() {
 	cols := []string{
 		"Id",
 		"Status",
+		"ApplyTime",
+		"InFlag",
+		"StorageOn",
+		"ModifiedOn",
 	}
 	//进入此步骤,记录在数据库中
 	supplierCertEntity.Status = suppliercert.STORE_STATUS //已入库
+	supplierCertEntity.StorageOn = time.Now()
+	supplierCertEntity.ApplyTime = time.Now().AddDate(1, 0, 0)
+	supplierCertEntity.InFlag = "1"
+	supplierCertEntity.ModifiedOn = time.Now()
 	certSrv.UpdateEntityByIdCols(supplierCertId, supplierCertEntity, cols)
 
 	this.Data["json"] = 1

+ 52 - 1
src/dashoo.cn/backend/api/controllers/oilsupplier/suppliercertappend.go

@@ -1008,7 +1008,7 @@ func (this *OilSupplierCertAppendController) AppendBusinessOfficeSeparateAuditEn
 // @Description 集中审批
 // @Success 200 {object} controllers.Request
 // @router /concentrate-audit/:id [post]
-func (this *OilSupplierCertController) AppendConcentrateAuditEntity() {
+func (this *OilSupplierCertAppendController) AppendConcentrateAuditEntity() {
 	certAppendId := this.Ctx.Input.Param(":id")
 	AuditRemark := this.GetString("AuditRemark") // TODO 前台选择的审批结果
 
@@ -1054,6 +1054,57 @@ func (this *OilSupplierCertController) AppendConcentrateAuditEntity() {
 	//certSrv.UpdateEntityByIdCols(supplierCertId, supplierCertEntity, cols)
 }
 
+// @Title 确认是否入库
+// @Description 确认是否入库
+// @Success	200	{object} controllers.Request
+// @router /update-is-storage/:id [post]
+func (this *OilSupplierCertAppendController) UpdateIsStorage() {
+	id := this.Ctx.Input.Param(":id")
+	status := this.GetString("Status")
+	PACNumber := this.GetString("PACNumber")
+	SupplierId := this.GetString("SupplierId")
+	var errinfo ErrorInfo
+	if id == "" {
+		errinfo.Message = "操作失败!请求信息不完整"
+		errinfo.Code = -2
+		this.Data["json"] = &errinfo
+		this.ServeJSON()
+		return
+	}
+
+	var supplierCertAppendEntity suppliercertappend.OilSupplierCertAppend
+	certAppendSrv := suppliercertappend.GetOilSupplierCertAppendService(utils.DBE)
+	certAppendSrv.GetEntityById(id, &supplierCertAppendEntity)
+
+	var supplierEntity supplier.OilSupplier
+	srv := supplier.GetOilSupplierService(utils.DBE)
+	srv.GetEntityById(SupplierId, &supplierEntity)
+	supplierEntity.PACNumber = PACNumber
+	srvCols := []string{"PACNumber"}
+	srv.UpdateEntityByIdCols(SupplierId, &supplierEntity, srvCols)
+
+	AuditRemark := ""
+	if status == "1" {
+		AuditRemark = "已入库。"
+	} else {
+		AuditRemark = "入库审批驳回。"
+	}
+
+	svcActiviti := workflow.GetActivitiService(utils.DBE)
+	var ActiComplete workflow.ActiCompleteVM
+	ActiComplete.ProcessKey = workflow.OIL_ENUSER_APPEND_APPLY
+	ActiComplete.BusinessKey = supplierCertAppendEntity.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 审批
 // @Param 	body body suppliercert.OilSupplierCert

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

@@ -183,5 +183,12 @@ export default {
       method: 'post',
       params: params
     })
+  },
+  updateIsStorage (entityId, params, myAxios) {
+    return myAxios({
+      url: '/annualaudit/update-is-storage/' + entityId,
+      method: 'post',
+      params: params
+    })
   }
 }

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

@@ -103,5 +103,12 @@ export default {
       method: 'post',
       params: params
     })
+  },
+  updateIsStorage (entityId, params, myAxios) {
+    return myAxios({
+      url: '/suppliercertappend/update-is-storage/' + entityId,
+      method: 'post',
+      params: params
+    })
   }
 }

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

@@ -45,6 +45,13 @@ export default {
       params: params
     })
   },
+  updateIsStorage (entityId, params, myAxios) {
+    return myAxios({
+      url: '/suppliercert/update-is-storage/' + entityId,
+      method: 'post',
+      params: params
+    })
+  },
   deleteEntity (entityId, myAxios) {
     return myAxios({
       url: '/suppliercert/delete/' + entityId,

+ 21 - 5
src/dashoo.cn/frontend_web/src/pages/index.vue

@@ -584,16 +584,16 @@
       },
       rowClick (val) {
         let SupplierType = ''
-        if (val.Status === '7' && val.Type !== '04') {
+        if (val.Status === '7' && val.Type !== '4') {
           // 待入库状态时直接跳转单独的入库审批页面,.信息变更入库不需要区分类型, 直接审批。
           if (val.SupplierTypeCode === '01') {
             SupplierType = 'goodsedit'
-          } else if (val.SupplierTypeCode === '02') {
+          } else if (val.SupplierTypeCode === '2') {
             SupplierType = 'basisedit'
           } else {
             SupplierType = 'techedit'
           }
-          this.$router.push('oilsupplier/supplierstorage/' + val.Id + '/' + SupplierType + '?certid=' + val.CertId)
+          this.$router.push('oilsupplier/supplierstorage/' + val.Id + '/' + SupplierType + '?certid=' + val.CertId + '&applytype=' + val.Type)
         } else {
           if (val.Type === '1') {
             if (val.SupplierTypeCode === '01') {
@@ -603,15 +603,27 @@
             } else {
               SupplierType = 'techedit'
             }
-            this.$router.push('oilsupplier/supplieraudit/' + val.Id + '/' + SupplierType + '?certid=' + val.CertId)
+            // 准入 且审批未通过之后 创建人中的待办按钮
+            if (Number(val.Status) <= 0) {
+              this.$router.push('oilsupplier/supplier/' + val.Id + '/' + SupplierType + '?certid=' + val.CertId)
+            } else {
+              this.$router.push('oilsupplier/supplieraudit/' + val.Id + '/' + SupplierType + '?certid=' + val.CertId)
+            }
           } else if (val.Type === '2') {
+            let appendId = ''
             if (val.SupplierTypeCode === '01') {
               SupplierType = 'goodsdataopera'
+              appendId = '1'
             } else if (val.SupplierTypeCode === '02') {
+              appendId = '2'
               SupplierType = 'basisdataopera'
             } else {
+              appendId = '3'
               SupplierType = 'techdataopera'
             }
+            if (Number(val.Status) <= 0) {
+              this.$router.push('oilsupplier/supplierappend/' + appendId + '/' + SupplierType + '?Id=' + val.Id + '&editFlag=1&sId=' + val.SupplierId)
+            }
             this.$router.push('oilsupplier/addtionaudit/' + val.Id + '/' + SupplierType)
           } else if (val.Type === '3') {
             if (val.SupplierTypeCode === '01') {
@@ -621,7 +633,11 @@
             } else {
               SupplierType = 'techoperation'
             }
-            this.$router.push('oilsupplier/annualaudit/' + val.SupplierId + '/' + SupplierType + '?certid=' + val.CertId + '&WorkflowId=' + val.WorkflowId + '&AnnualStatus=' + val.Status + '&annualId=' + val.Id + '&Step=' + val.Step)
+            if (Number(val.Status) <= 0) {
+              this.$router.push('oilsupplier/annualaudit/' + val.SupplierId + '/' + SupplierType + '?certid=' + val.CertId + '&WorkflowId=' + val.WorkflowId + '&Status=' + val.Status + '&Step=' + val.Step + '&annualId=' + val.Id)
+            } else {
+              this.$router.push('oilsupplier/annualaudit/' + val.SupplierId + '/' + SupplierType + '?certid=' + val.CertId + '&WorkflowId=' + val.WorkflowId + '&AnnualStatus=' + val.Status + '&annualId=' + val.Id + '&Step=' + val.Step)
+            }
             // /oilsupplier/annualaudit/' + scope.row.SupplierId + '/auditoperation?certid=' + scope.row.CerId +'&WorkflowId='+scope.row.WorkflowId+'&AnnualStatus='+scope.row.Status+'&annualId='+scope.row.Id+'&Step='+scope.row.Step
           } else if (val.Type === '4') {
             this.$router.push('/oilsupplier/infochangech/' + val.Id + '/auditoperation?InfoStatus=' + val.Status + '&SupId=' + val.SupplierId)

+ 24 - 4
src/dashoo.cn/frontend_web/src/pages/oilsupplier/supplierstorage/_opera/basisedit.vue

@@ -276,6 +276,8 @@
   } from 'vuex'
   import api from '@/api/oilsupplier/supplier'
   import apiCert from '@/api/oilsupplier/suppliercert'
+  import apiCertAppend from '@/pages/oilsupplier/supplierappend'
+  import apiAnnual from '@/pages/oilsupplier/annualaudit'
   import SupplierFileTable from '@/pages/oilsupplier/supplierfile/table.vue'
   import WfHistory from '@/components/workflow/wfmultihistory.vue'
   import WfBackHistory from '@/components/workflow/wfbackhistory.vue'
@@ -343,6 +345,7 @@
         firstAudit: '',
         serviceId: '',
         certId: '',
+        applyType: '',
         classId: '02',
         auditform: {
           FirstAuditName: '',
@@ -474,6 +477,9 @@
       if (this.$route.query.certid) {
         this.certId = this.$route.query.certid + ''
       }
+      if (this.$route.query.applytype) {
+        this.applyType = this.$route.query.applytype + ''
+      }
       if (this.serviceId !== 'add' && this.serviceId > 0) {
         this.formData.Id = this.serviceId
       } else {
@@ -541,13 +547,13 @@
       createWZAccessCardNo () {
         apiCert.createAccessCardNo(this.formData.Id, this.formData.CertId, '02', this.$axios).then(res => {
           this.formData.JSAccessCardNo = res.data
-          if(this.formData.JSAccessCardNo != ''){
+          if (this.formData.JSAccessCardNo != '') {
             // alert('生成编码成功!');
             this.$message({
               type: 'success',
               message: '生成编码成功!'
-              })
-            }
+            })
+          }
           this.initDatas()
         })
       },
@@ -559,6 +565,20 @@
           })
           return
         }
+        let tepApi = {}
+        if (this.applyType === '1') { // 准入
+          tepApi = apiCert
+        } else if (this.applyType === '2') { // 增项
+          tepApi = apiCertAppend
+        } else if (this.applyType === '3') { // 年审
+          tepApi = apiAnnual
+        } else {
+          this.$message({
+            type: 'warning',
+            message: '审批类型错误!!'
+          })
+          return
+        }
         this.$confirm('确认提交入库', '提示', {
           confirmButtonText: '确认',
           cancelButtonText: '取消',
@@ -567,7 +587,7 @@
           let params = {
             Status: this.formData.Status
           }
-          apiCert.updateStorage(this.certId, params, this.$axios).then(res => {
+          tepApi.updateIsStorage(this.certId, params, this.$axios).then(res => {
             this.initDatas()
             if (res.data.code === 0) {
               this.$message({

+ 26 - 4
src/dashoo.cn/frontend_web/src/pages/oilsupplier/supplierstorage/_opera/goodsedit.vue

@@ -277,6 +277,8 @@
   } from 'vuex'
   import api from '@/api/oilsupplier/supplier'
   import apiCert from '@/api/oilsupplier/suppliercert'
+  import apiCertAppend from '@/pages/oilsupplier/supplierappend'
+  import apiAnnual from '@/pages/oilsupplier/annualaudit'
   import SupplierFileTable from '@/pages/oilsupplier/supplierfile/table.vue'
   import WfHistory from '@/components/workflow/wfmultihistory.vue'
   import WfBackHistory from '@/components/workflow/wfbackhistory.vue'
@@ -344,6 +346,7 @@
         auditerName: '',
         serviceId: '',
         certId: '',
+        applyType: '',
         classId: '01',
         FirstAudit: '',
         auditform: {
@@ -476,6 +479,10 @@
       if (this.$route.query.certid) {
         this.certId = this.$route.query.certid + ''
       }
+      if (this.$route.query.applytype) {
+        console.log('申请类型', this.$route.query.applytype)
+        this.applyType = this.$route.query.applytype + ''
+      }
       if (this.serviceId !== 'add' && this.serviceId > 0) {
         this.formData.Id = this.serviceId
       } else {
@@ -544,17 +551,18 @@
       createWZAccessCardNo () {
         apiCert.createAccessCardNo(this.formData.Id, this.formData.CertId, '01', this.$axios).then(res => {
           this.formData.WZAccessCardNo = res.data
-          if(this.formData.WZAccessCardNo != ''){
+          if (this.formData.WZAccessCardNo != '') {
             // alert('生成编码成功!');
             this.$message({
               type: 'success',
               message: '生成编码成功!'
-              })
-            }
+            })
+          }
           this.initDatas()
         })
       },
       confirm () {
+        console.log('物资类保单', this.formData)
         if (this.formData.WZAccessCardNo === '') {
           this.$message({
             type: 'warning',
@@ -562,6 +570,20 @@
           })
           return
         }
+        let tepApi = {}
+        if (this.applyType === '1') {
+          tepApi = apiCert
+        } else if (this.applyType === '2') {
+          tepApi = apiCertAppend
+        } else if (this.applyType === '3') {
+          tepApi = apiAnnual
+        } else {
+          this.$message({
+            type: 'warning',
+            message: '审批类型错误!!'
+          })
+          return
+        }
         this.$confirm('确认提交入库', '提示', {
           confirmButtonText: '确认',
           cancelButtonText: '取消',
@@ -572,7 +594,7 @@
             PACNumber: this.formData.PACNumber,
             SupplierId: this.formData.Id
           }
-          apiCert.updateStorage(this.certId, params, this.$axios).then(res => {
+          tepApi.updateIsStorage(this.certId, params, this.$axios).then(res => {
             if (res.data.code === 0) {
               this.initDatas()
               this.$message({

+ 24 - 4
src/dashoo.cn/frontend_web/src/pages/oilsupplier/supplierstorage/_opera/techedit.vue

@@ -284,6 +284,8 @@
   } from 'vuex'
   import api from '@/api/oilsupplier/supplier'
   import apiCert from '@/api/oilsupplier/suppliercert'
+  import apiCertAppend from '@/pages/oilsupplier/supplierappend'
+  import apiAnnual from '@/pages/oilsupplier/annualaudit'
   import SupplierFileTable from '@/pages/oilsupplier/supplierfile/table.vue'
   import WfHistory from '@/components/workflow/wfmultihistory.vue'
   import WfBackHistory from '@/components/workflow/wfbackhistory.vue'
@@ -351,6 +353,7 @@
         firstAudit: '',
         serviceId: '',
         certId: '',
+        applyType: '',
         classId: '03',
         auditform: {
           FirstAuditName: '',
@@ -481,6 +484,9 @@
       if (this.$route.query.certid) {
         this.certId = this.$route.query.certid + ''
       }
+      if (this.$route.query.applytype) {
+        this.applyType = this.$route.query.applytype + ''
+      }
       if (this.serviceId !== 'add' && this.serviceId > 0) {
         this.formData.Id = this.serviceId
       } else {
@@ -549,13 +555,13 @@
       createJFAccessCardNo () {
         apiCert.createAccessCardNo(this.formData.Id, this.formData.CertId, '03', this.$axios).then(res => {
           this.formData.JFAccessCardNo = res.data
-          if(this.formData.JFAccessCardNo != ''){
+          if (this.formData.JFAccessCardNo != '') {
             // alert('生成编码成功!');
             this.$message({
               type: 'success',
               message: '生成编码成功!'
-              })
-            }
+            })
+          }
           this.initDatas()
         })
       },
@@ -567,6 +573,20 @@
           })
           return
         }
+        let tepApi = {}
+        if (this.applyType === '1') {
+          tepApi = apiCert
+        } else if (this.applyType === '2') {
+          tepApi = apiCertAppend
+        } else if (this.applyType === '3') {
+          tepApi = apiAnnual
+        } else {
+          this.$message({
+            type: 'warning',
+            message: '审批类型错误!!'
+          })
+          return
+        }
         this.$confirm('确认提交入库', '提示', {
           confirmButtonText: '确认',
           cancelButtonText: '取消',
@@ -575,7 +595,7 @@
           let params = {
             Status: this.formData.Status
           }
-          apiCert.updateStorage(this.certId, params, this.$axios).then(res => {
+          tepApi.updateIsStorage(this.certId, params, this.$axios).then(res => {
             if (res.data.code === 0) {
               this.initDatas()
               this.$message({