瀏覽代碼

准入申请-确认入库 同意 退回

baichengfei 5 年之前
父節點
當前提交
c8569ead76

+ 22 - 5
src/dashoo.cn/backend/api/controllers/oilsupplier/suppliercert.go

@@ -1024,7 +1024,8 @@ func (this *OilSupplierCertController) ConcentrateAuditEntity() {
 func (this *OilSupplierCertController) UpdateIsStorage() {
 	id := this.Ctx.Input.Param(":id")
 	result := this.GetString("result")
-	WZAccessCardNo := this.GetString("WZAccessCardNo")
+	AccessCardNo := this.GetString("AccessCardNo")
+	BackRemark := this.GetString("BackRemark")
 	SupplierId := this.GetString("SupplierId")
 	var errinfo ErrorInfo
 	if id == "" {
@@ -1059,11 +1060,27 @@ func (this *OilSupplierCertController) UpdateIsStorage() {
 		var supplierEntity supplier.OilSupplier
 		srv := supplier.GetOilSupplierService(utils.DBE)
 		srv.GetEntityById(SupplierId, &supplierEntity)
-		supplierEntity.WZAccessCardNo = WZAccessCardNo
-		srvCols := []string{"WZAccessCardNo"}
+		var srvCols []string
+		if supplierCertEntity.SupplierTypeCode == "01" {
+			supplierEntity.WZAccessCardNo = AccessCardNo
+			srvCols = append(srvCols, "WZAccessCardNo")
+		} else if supplierCertEntity.SupplierTypeCode == "02" {
+			supplierEntity.WZAccessCardNo = AccessCardNo
+			srvCols = append(srvCols, "JSAccessCardNo")
+		} else if supplierCertEntity.SupplierTypeCode == "03" {
+			supplierEntity.WZAccessCardNo = AccessCardNo
+			srvCols = append(srvCols, "JFAccessCardNo")
+		} else {
+			panic("准入类别错误!")
+		}
+
 		srv.UpdateEntityByIdCols(SupplierId, &supplierEntity, srvCols)
 	} else {
-		AuditRemark = "待入库未通过。"
+		if BackRemark != "" {
+			AuditRemark = BackRemark
+		} else {
+			AuditRemark = "待入库未通过。"
+		}
 	}
 
 	svcActiviti := workflow.GetActivitiService(utils.DBE)
@@ -1071,7 +1088,7 @@ func (this *OilSupplierCertController) UpdateIsStorage() {
 	ActiComplete.ProcessKey = workflow.OIL_ENUSER_SUPPLIER_APPLY
 	ActiComplete.BusinessKey = supplierCertEntity.BusinessKey
 	ActiComplete.UserId = this.User.Id //审批人员
-	ActiComplete.Result = result
+	ActiComplete.Result = "1"
 	ActiComplete.Remarks = AuditRemark
 	ActiComplete.CallbackUrl = utils.Cfg.MustValue("workflow", "callbackHost")
 	receiveVal := svcActiviti.TaskComplete(ActiComplete)

+ 10 - 21
src/dashoo.cn/frontend_web/src/pages/oilsupplier/supplierstorage/_opera/basisedit.vue

@@ -505,16 +505,17 @@
     methods: {
       backEntity () {
         let params = {
-          Status: '-7',
-          BackRemark: this.backRemark
+          result: '0',
+          BackRemark: this.backRemark,
+          SupplierId: this.formData.Id
         }
         this.btnLoading = true
-        apiCert.backStatus(this.formData.CertId, params, this.$axios).then(res => {
+        apiCert.updateIsStorage(this.certId, params, this.$axios).then(res => {
           this.dialogVisibleBack = false
           this.initDatas()
           if (this.$refs['WfHistory']) {
-                this.$refs['WfHistory'].getHistoryTask()
-              }
+            this.$refs['WfHistory'].getHistoryTask()
+          }
           console.log('已强制刷新历史审批流程')
           if (res.data.code === 0) {
             this.$message({
@@ -574,20 +575,6 @@
           })
           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.btnLoading = true
         this.$confirm('确认提交入库', '提示', {
           confirmButtonText: '确认',
@@ -595,9 +582,11 @@
           type: 'warning'
         }).then(() => {
           let params = {
-            Status: this.formData.Status
+            result: '1',
+            AccessCardNo: this.formData.JSAccessCardNo, // 基建类准入编码 确认入库时 自动更新准入编码
+            SupplierId: this.formData.Id
           }
-          tepApi.updateIsStorage(this.certId, params, this.$axios).then(res => {
+          apiCert.updateIsStorage(this.certId, params, this.$axios).then(res => {
             this.initDatas()
             if (this.$refs['WfHistory']) {
               this.$refs['WfHistory'].getHistoryTask()

+ 10 - 5
src/dashoo.cn/frontend_web/src/pages/oilsupplier/supplierstorage/_opera/goodsedit.vue

@@ -509,18 +509,23 @@
     methods: {
       backEntity () {
         let params = {
-          Status: '-7',
-          BackRemark: this.backRemark
+          result: '0',
+          BackRemark: this.backRemark,
+          SupplierId: this.formData.Id
         }
         this.btnLoading = true
-        apiCert.backStatus(this.formData.CertId, params, this.$axios).then(res => {
+        apiCert.updateIsStorage(this.certId, params, this.$axios).then(res => {
           this.dialogVisibleBack = false
+          this.initDatas()
+          if (this.$refs['WfHistory']) {
+            this.$refs['WfHistory'].getHistoryTask()
+          }
           if (res.data.code === 0) {
             this.$message({
               type: 'success',
               message: res.data.message
             })
-            this.$router.push('/')
+            // this.$router.push('/')
           } else {
             this.$message({
               type: 'warning',
@@ -582,7 +587,7 @@
         }).then(() => {
           let params = {
             result: '1',
-            WZAccessCardNo: this.formData.WZAccessCardNo, // 物资类准入编码 确认入库时 自动更新准入编码
+            AccessCardNo: this.formData.WZAccessCardNo, // 物资类准入编码 确认入库时 自动更新准入编码
             SupplierId: this.formData.Id
           }
           let _this = this

+ 11 - 22
src/dashoo.cn/frontend_web/src/pages/oilsupplier/supplierstorage/_opera/techedit.vue

@@ -513,16 +513,17 @@
     methods: {
       backEntity () {
         let params = {
-          Status: '-7',
-          BackRemark: this.backRemark
+          result: '0',
+          BackRemark: this.backRemark,
+          SupplierId: this.formData.Id
         }
         this.btnLoading = true
-        apiCert.backStatus(this.formData.CertId, params, this.$axios).then(res => {
+        apiCert.updateIsStorage(this.certId, params, this.$axios).then(res => {
           this.dialogVisibleBack = false
           this.initDatas()
           if (this.$refs['WfHistory']) {
-                this.$refs['WfHistory'].getHistoryTask()
-              }
+            this.$refs['WfHistory'].getHistoryTask()
+          }
           console.log('已强制刷新历史审批流程')
           if (res.data.code === 0) {
             this.$message({
@@ -530,7 +531,7 @@
               message: res.data.message
             })
             this.btnLoading = false
-            this.$router.push('/')
+            // this.$router.push('/')
           } else {
             this.$message({
               type: 'warning',
@@ -583,20 +584,6 @@
           })
           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.btnLoading = true
         this.$confirm('确认提交入库', '提示', {
           confirmButtonText: '确认',
@@ -604,9 +591,11 @@
           type: 'warning'
         }).then(() => {
           let params = {
-            Status: this.formData.Status
+            result: '1',
+            AccessCardNo: this.formData.JFAccessCardNo, // 服务类准入编码 确认入库时 自动更新准入编码
+            SupplierId: this.formData.Id
           }
-          tepApi.updateIsStorage(this.certId, params, this.$axios).then(res => {
+          apiCert.updateIsStorage(this.certId, params, this.$axios).then(res => {
             if (res.data.code === 0) {
               this.initDatas()
               if (this.$refs['WfHistory']) {