Procházet zdrojové kódy

交费按钮;注释首页加载

baichengfei před 5 roky
rodič
revize
eb8eaccf9a

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

@@ -1817,11 +1817,24 @@ func (this *AnnualAuditController) AddAppChange() {
 // @router /update-pay-status/:id [post]
 func (this *AnnualAuditController) UpdatePayStatus() {
 	certId := this.Ctx.Input.Param(":id")
-	supplierCertSrv := suppliercert.GetOilSupplierCertService(utils.DBE)
-	var supplierCertEntity suppliercert.OilSupplierCert
-	supplierCertSrv.GetEntityById(certId, &supplierCertEntity)
+	var errinfo ErrorInfo
+	if certId == "" {
+		errinfo.Message = "操作失败!请求信息不完整"
+		errinfo.Code = -2
+		this.Data["json"] = &errinfo
+		this.ServeJSON()
+		return
+	}
+	annualAuditSrv := annualaudit.GetOilAnnualAuditService(utils.DBE)
+	var annualAuditEntity annualaudit.OilAnnualAudit
+	annualAuditSrv.GetEntityById(certId, &annualAuditEntity)
 
 	// PayType = 2
-	//TODO SrcId获取表id,更新isPay状态为1和主表Status状态:CONFIRM_PAYED_STATUS(11)
-
+	//TODO SrcId获取表id,更新isPay状态为1
+	sql :="UPDATE OilPaymentInfo SET IsPay ='1' where SrcId=" + certId
+	annualAuditSrv.DBE.Exec(sql)
+	errinfo.Message = "确认交费成功!"
+	errinfo.Code = 0
+	this.Data["json"] = &errinfo
+	this.ServeJSON()
 }

+ 15 - 2
src/dashoo.cn/backend/api/controllers/oilsupplier/suppliercert.go

@@ -1821,11 +1821,24 @@ func (this *OilSupplierCertController) UpdateIsRestrict() {
 // @router /update-pay-status/:id [post]
 func (this *OilSupplierCertController) UpdatePayStatus() {
 	certId := this.Ctx.Input.Param(":id")
+	var errinfo ErrorInfo
+	if certId == "" {
+		errinfo.Message = "操作失败!请求信息不完整"
+		errinfo.Code = -2
+		this.Data["json"] = &errinfo
+		this.ServeJSON()
+		return
+	}
 	supplierCertSrv := suppliercert.GetOilSupplierCertService(utils.DBE)
 	var supplierCertEntity suppliercert.OilSupplierCert
 	supplierCertSrv.GetEntityById(certId, &supplierCertEntity)
 
 	// PayType = 1
-	//TODO SrcId获取表id,更新isPay状态为1和主表Status状态:CONFIRM_PAYED_STATUS(11)
-
+	//TODO SrcId获取表id,更新isPay状态为1
+	sql :="UPDATE OilPaymentInfo SET IsPay ='1' where SrcId=" + certId
+	supplierCertSrv.DBE.Exec(sql)
+	errinfo.Message = "确认交费成功!"
+	errinfo.Code = 0
+	this.Data["json"] = &errinfo
+	this.ServeJSON()
 }

+ 18 - 5
src/dashoo.cn/backend/api/controllers/oilsupplier/suppliercertappend.go

@@ -1588,11 +1588,24 @@ func (this *OilSupplierCertAppendController) DeleteNewFile() {
 // @router /update-pay-status/:id [post]
 func (this *OilSupplierCertAppendController) UpdatePayStatus() {
 	certId := this.Ctx.Input.Param(":id")
-	supplierCertSrv := suppliercert.GetOilSupplierCertService(utils.DBE)
-	var supplierCertEntity suppliercert.OilSupplierCert
-	supplierCertSrv.GetEntityById(certId, &supplierCertEntity)
+	var errinfo ErrorInfo
+	if certId == "" {
+		errinfo.Message = "操作失败!请求信息不完整"
+		errinfo.Code = -2
+		this.Data["json"] = &errinfo
+		this.ServeJSON()
+		return
+	}
+	supplierCerAppendtSrv := suppliercertappend.GetOilSupplierCertAppendService(utils.DBE)
+	var supplierCertAppendEntity suppliercertappend.OilSupplierCertAppend
+	supplierCerAppendtSrv.GetEntityById(certId, &supplierCertAppendEntity)
 
 	// PayType = 3
-	// TODO SrcId获取表id,更新isPay状态为1和主表Status状态:CONFIRM_PAYED_STATUS(11)
-
+	// TODO SrcId获取表id,更新isPay状态为1
+	sql :="UPDATE OilPaymentInfo SET IsPay ='1' where SrcId=" + certId
+	supplierCerAppendtSrv.DBE.Exec(sql)
+	errinfo.Message = "确认交费成功!"
+	errinfo.Code = 0
+	this.Data["json"] = &errinfo
+	this.ServeJSON()
 }

+ 3 - 3
src/dashoo.cn/frontend_web/src/pages/index.vue

@@ -508,9 +508,9 @@
       }
     },
     created () {
-      if(this.authUser.Profile.IsCompanyUser==1){
-         this.$router.push('/oilsupplier/supplier') //跳转到登录页
-      }
+      // if(this.authUser.Profile.IsCompanyUser==1){
+      //    this.$router.push('/oilsupplier/supplier') //跳转到登录页
+      // }
       this.initDatas()
     },
     methods: {

+ 44 - 0
src/dashoo.cn/frontend_web/src/pages/oilsupplier/supplieraudit/_opera/basisedit.vue

@@ -27,6 +27,8 @@
             v-if="auditBtn && this.formData.Status == '5'">集中评审</el-button>
           <el-button type="primary" size="mini" style="margin-left: 8px" @click="AuditEntity()"
             v-if="this.formData.Status == '10'">分办</el-button>
+          <el-button type="primary" size="mini" style="margin-left: 8px" @click="paySureClick()"
+            v-if="parseInt(this.formData.Status) === 6">交费</el-button>
           <el-button type="primary" size="mini" style="margin-left: 8px" onclick="window.history.go(-1)">返回</el-button>
         </span>
       </div>
@@ -971,6 +973,48 @@
       allocationBtn () {
         this.dialogAllocation = 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)
+        apiCert.updatePayStatus(this.certId, 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.dialogSecUnitSeparateVisible = false
+          this.loading = false
+        }).catch(err => {
+          console.error(err)
+        })
+      },
       // 审核通过
       makeSure () {
         if (this.shenheForm.SuccessStatus === 1) {

+ 3 - 14
src/dashoo.cn/frontend_web/src/pages/oilsupplier/supplieraudit/_opera/goodsedit.vue

@@ -17,7 +17,7 @@
           <el-button type="primary" size="mini" style="margin-left: 8px" @click="commonAuditClick()" v-if="auditBtn && parseInt(this.formData.Status) === 4 && parseInt(this.formData.InStyle) !== 2">专业审核</el-button>
           <el-button type="primary" size="mini" style="margin-left: 8px" @click="concentrateAuditClick()" v-if="auditBtn && parseInt(this.formData.Status) === 5">集中评审</el-button>
           <el-button type="primary" size="mini" style="margin-left: 8px" @click="secUnitSeparateAuditClick()" v-if="parseInt(this.formData.Status) === 10">分办</el-button>
-          <el-button type="primary" size="mini" style="margin-left: 8px" @click="paySureClick()" v-if="auditBtn && parseInt(this.formData.Status) === 6">交费</el-button>
+          <el-button type="primary" size="mini" style="margin-left: 8px" @click="paySureClick()" v-if="parseInt(this.formData.Status) === 6">交费</el-button>
           <!--<router-link>-->
           <el-button type="primary" size="mini" style="margin-left: 8px" onclick="window.history.go(-1)">返回</el-button>
           <!--</router-link>-->
@@ -1254,18 +1254,7 @@
           cancelButtonText: '取消',
           type: 'warning'
         }).then(() => {
-          let payRes = this.payMakeSure()
-          if (payRes) {
-            this.$message({
-              type: 'success',
-              message: '确认成功!'
-            })
-          } else {
-            this.$message({
-              type: 'success',
-              message: '确认失败!'
-            })
-          }
+          this.payMakeSure()
         }).catch(() => {
           this.$message({
             type: 'info',
@@ -1279,7 +1268,7 @@
         let params = {
           payStatus: this.payStatus
         }
-        console.log('交费结果确认提交参数:', params)
+        console.log('交费结果确认提交参数:', this.certId)
         apiCert.updatePayStatus(this.certId, params, this.$axios).then(res => {
           if (res.data.code === 0) {
             console.log('交费成功')

+ 1 - 12
src/dashoo.cn/frontend_web/src/pages/oilsupplier/supplieraudit/_opera/techedit.vue

@@ -1274,18 +1274,7 @@
           cancelButtonText: '取消',
           type: 'warning'
         }).then(() => {
-          let payRes = this.payMakeSure()
-          if (payRes) {
-            this.$message({
-              type: 'success',
-              message: '确认成功!'
-            })
-          } else {
-            this.$message({
-              type: 'success',
-              message: '确认失败!'
-            })
-          }
+          this.payMakeSure()
         }).catch(() => {
           this.$message({
             type: 'info',