2
3
Переглянути джерело

前后:增项年审信息变更改公司名改用户表的realname;信息变更验证资质

dubch 4 роки тому
батько
коміт
36cd59218f

+ 19 - 0
src/dashoo.cn/backend/api/controllers/oilsupplier/annualListener.go

@@ -8,6 +8,8 @@ import (
 	"dashoo.cn/backend/api/business/oilsupplier/supplier"
 	"dashoo.cn/backend/api/business/oilsupplier/supplierfile"
 	"dashoo.cn/backend/api/business/paymentinfo"
+	"dashoo.cn/backend/api/business/register"
+	"dashoo.cn/business/userRole"
 	"encoding/json"
 	"log"
 	"strconv"
@@ -363,6 +365,23 @@ func (this *OilAnnualListenerController) WorkflowEndAudit() {
 		log.Print("年审实际变更信息出错: ", err)
 	}
 
+	// 更新user表的RealName
+	var user userRole.Base_User
+	for _,item := range infoItems{
+		if item.SelectItem == "SupplierName" {
+			user.Realname = item.ChangeInfo
+			var cor register.OilCorporateInfo
+			var cert suppliercert.OilSupplierCert
+			var supplier supplier.OilSupplier
+			srv.GetEntityByWhere(OilSupplierCertName,"Id = " + strconv.Itoa(annualEntity.CerId),&cert)
+			srv.GetEntityByWhere(OilSupplierName,"Id = " + strconv.Itoa(cert.SupplierId),&supplier)
+			srv.GetEntityByWhere(OilCorporateInfoName,"CommercialNo = '" + supplier.CommercialNo + "'",&cor)
+			if cor.UserId > 0{
+				srv.UpdateEntityBywheretbl("Base_User", &user, []string{"RealName"}, "Id = " + strconv.Itoa(cor.UserId))
+			}
+		}
+	}
+
 	this.Data["json"] = 1
 	this.ServeJSON()
 }

+ 12 - 0
src/dashoo.cn/backend/api/controllers/oilsupplier/infochange.go

@@ -2151,6 +2151,18 @@ func (this *InfoChangeController) updateChangeInfo(supplierId int, infoId string
 				this.BusinessDelete(utils.ToStr(supplierId))
 			}
 		}
+		// 更新user表的RealName
+		if item.SelectItem == "SupplierName" {
+			var user userRole.Base_User
+			user.Realname = item.ChangeInfo
+			var cor register.OilCorporateInfo
+			var supplier supplier.OilSupplier
+			svc.GetEntityByWhere(OilSupplierName,"Id = " + strconv.Itoa(supplierId),&supplier)
+			svc.GetEntityByWhere(OilCorporateInfoName,"CommercialNo = '" + supplier.CommercialNo + "'",&cor)
+			if cor.UserId > 0 {
+				svc.UpdateEntityBywheretbl("Base_User", &user, []string{"RealName"}, "Id = " + strconv.Itoa(cor.UserId))
+			}
+		}
 	}
 
 	this.FileDelete(strconv.Itoa(supplierId))

+ 19 - 0
src/dashoo.cn/backend/api/controllers/oilsupplier/suppliercertAppendListener.go

@@ -8,6 +8,8 @@ import (
 	"dashoo.cn/backend/api/business/oilsupplier/suppliercertsub"
 	"dashoo.cn/backend/api/business/oilsupplier/supplierfile"
 	"dashoo.cn/backend/api/business/paymentinfo"
+	"dashoo.cn/backend/api/business/register"
+	"dashoo.cn/business/userRole"
 	"encoding/json"
 	"strconv"
 	"strings"
@@ -390,6 +392,23 @@ func (this *OilSupplierCertAppendListenerController) WorkflowEndAudit() {
 			certAppendSrv.UpdateEntityBytbl(OilSupplierFileName, qualDetail[i].FileId, &supFileModel, []string{"FileName", "FileUrl", "EffectDate"})
 		}
 	}
+
+	// 更新user表的RealName
+	var user userRole.Base_User
+	for _,item := range infoItems{
+		if item.SelectItem == "SupplierName" {
+			user.Realname = item.ChangeInfo
+			var cor register.OilCorporateInfo
+			var cert suppliercert.OilSupplierCert
+			var supplier supplier.OilSupplier
+			certAppendSrv.GetEntityByWhere(OilSupplierCertName,"Id = " + strconv.Itoa(supplierCertAppendEntity.SupplierCertId),&cert)
+			certAppendSrv.GetEntityByWhere(OilSupplierName,"Id = " + strconv.Itoa(cert.SupplierId),&supplier)
+			certAppendSrv.GetEntityByWhere(OilCorporateInfoName,"CommercialNo = '" + supplier.CommercialNo + "'",&cor)
+			if cor.UserId > 0{
+				certAppendSrv.UpdateEntityBywheretbl("Base_User", &user, []string{"RealName"}, "Id = " + strconv.Itoa(cor.UserId))
+			}
+		}
+	}
 	this.Data["json"] = 1
 	this.ServeJSON()
 }

+ 1 - 1
src/dashoo.cn/backend/api/controllers/register/oilcorporateinfo.go

@@ -525,7 +525,7 @@ func (this *OilCorporateInfoController) ComAudit() {
 			var sPerson userRole.Base_User
 			svc.GetEntity(&sPerson, "Id ="+this.User.Id)
 			toMobile := model.UserTelephone
-			msg := "市场管理信息系统账号注册失败,因“" + Remark + "”,请按照要求重新注册,联系人:" + sPerson.Realname + ",联系电话:" + sPerson.Telephone + ""
+			msg := "市场管理信息系统账号注册失败,因“" + Remark + "”,请按照要求重新注册,联系人:" + sPerson.Realname + " "
 
 			//调用短信接口发送短信
 			msgService := msg2.GetMsgService(utils.DBE)

+ 3 - 0
src/dashoo.cn/frontend_web/src/pages/login.vue

@@ -412,6 +412,7 @@ import Base64  from 'base-64'
     // },
 
     loginptr () {
+      console.log(this.model.password, 'this.model.password')
       let params = {
         username: this.model.username,
         password: Base64.encode(this.model.password)
@@ -459,6 +460,7 @@ export default class Login extends Vue {
       return false
     }
     this.loading = true
+    console.log(this.model.password, 'this.model.password1')
     this.$refs.user.validate(async valid => {
       try {
         if (valid) {
@@ -478,6 +480,7 @@ export default class Login extends Vue {
           }
         }
       } catch (e) {
+        console.error(e, 'e')
         if (e.response.status === 777) {
           this.$message({
             showClose: true,

+ 1 - 1
src/dashoo.cn/frontend_web/src/pages/oilsupplier/infochangech/_opera/auditoperation.vue

@@ -143,7 +143,7 @@
               </el-col>
 
               <el-col :span="8">
-                <el-form-item label-width="150px" label="统一社会信用代码" prop="CommercialNo">
+                <el-form-item label="统一社会信用代码" prop="CommercialNo">
                   <el-input v-model="formData.CommercialNo" maxlength="50" :readonly="true"
                     :class="changedForm['CommercialNo'] ? 'modified-form-input' : ''" placeholder="请输入"
                     style="width: 100%">

+ 117 - 97
src/dashoo.cn/frontend_web/src/pages/oilsupplier/infochangech/_opera/operation.vue

@@ -1679,6 +1679,7 @@
           .catch(() => {})
       },
       companySubmitToSecUnitSeparate () {
+        this.saveinfochange(1)
         if (this.UnitOrg === '') {
           this.$message({
             type: 'warning',
@@ -1696,30 +1697,37 @@
         this.entityForm.auditer = this.UnitOrg
         this.entityForm.MInfoId = this.MInfoId
         this.btnloading = true
-        let params = {
-          unitId: this.UnitOrg,
-          AuditRemark: this.entityForm.Remark
-        }
-        api.companyAuditEntity(this.MInfoId, params, this.$axios).then(res => {
-          if (res.data.code === 0) {
-            // 保存成功后,初始化数据,变成修改
-            this.initDatas()
-            this.$router.push('/oilsupplier/infochangech')
-            this.ComAuditdialogShow = false
-            this.butnab = true
-            this.$message({
-              type: 'success',
-              message: res.data.message
+        this.saveinfochange(1).then(val => {
+          console.log(val,'222222')
+          if (val) {
+            let params = {
+              unitId: this.UnitOrg,
+              AuditRemark: this.entityForm.Remark
+            }
+            api.companyAuditEntity(this.MInfoId, params, this.$axios).then(res => {
+              if (res.data.code === 0) {
+                // 保存成功后,初始化数据,变成修改
+                this.initDatas()
+                this.$router.push('/oilsupplier/infochangech')
+                this.ComAuditdialogShow = false
+                this.butnab = true
+                this.$message({
+                  type: 'success',
+                  message: res.data.message
+                })
+              } else {
+                this.$message({
+                  type: 'warning',
+                  message: res.data.message
+                })
+              }
+              this.btnloading = false
+            }).catch(err => {
+              console.error(err)
             })
           } else {
-            this.$message({
-              type: 'warning',
-              message: res.data.message
-            })
+            this.btnloading = false
           }
-          this.btnloading = false
-        }).catch(err => {
-          console.error(err)
         })
       },
       setAuditerFen (val, name) {
@@ -2559,53 +2567,59 @@
       },
       // 保存信息变更数据
       saveinfochange (val) {
-        this.saveLoading = true
-        let v1 = false
-        let v2 = false
-        this.$refs['formData'].validate((valid) => {
-          if (valid) {
-            v1 = true
-          }
-        })
-        this.$refs['EntityFormCert'].validate((valid) => {
-          if (valid) {
-            v2 = true
-          }
-        })
-        if (v1 && v2) {
-          supplierapi.checkBack(this.formData.BankAccount, this.formData.Id, this.$axios).then(res => {
-            if (res.data.item) {
-              this.$message({
-                type: 'warning',
-                message: '该银行账号与其他公司重复'
-              })
-              this.saveLoading = false
-            } else {
-              // 供应商类型变更时检查是否缺少资质
-              let fileType = {
-                Type: this.formData.OperType === '制造商' ? 1 : 2,
-                SupplierId: this.formData.Id
-              }
-              supplierapi.checkCertFileForSupTypeChange(fileType, this.$axios).then(res => {
-                if (res.data.code === 1) {
-                  this.addInfoChangeItemCh(val)
-                } else {
-                  this.$message({
-                    type: 'warning',
-                    message: res.data.message
-                  })
-                  this.saveLoading = false
-                  return false
-                }
-              })
+        return new Promise((resolve, reject) => {
+          this.saveLoading = true
+          let v1 = false
+          let v2 = false
+          this.$refs['formData'].validate((valid) => {
+            if (valid) {
+              v1 = true
             }
-          }).catch(err => {
-            this.saveLoading = false
-            console.error(err)
           })
-        } else {
-          this.saveLoading = false
-        }
+          this.$refs['EntityFormCert'].validate((valid) => {
+            if (valid) {
+              v2 = true
+            }
+          })
+          if (v1 && v2) {
+            supplierapi.checkBack(this.formData.BankAccount, this.formData.Id, this.$axios).then(res => {
+              if (res.data.item) {
+                this.$message({
+                  type: 'warning',
+                  message: '该银行账号与其他公司重复'
+                })
+                this.saveLoading = false
+                resolve(false)
+              } else {
+                // 供应商类型变更时检查是否缺少资质
+                let fileType = {
+                  Type: this.formData.OperType === '制造商' ? 1 : 2,
+                  SupplierId: this.formData.Id
+                }
+                supplierapi.checkCertFileForSupTypeChange(fileType, this.$axios).then(res => {
+                  if (res.data.code === 1) {
+                    this.addInfoChangeItemCh(val)
+                    resolve(true)
+                  } else {
+                    this.$message({
+                      type: 'warning',
+                      message: res.data.message
+                    })
+                    this.saveLoading = false
+                    resolve(false)
+                  }
+                })
+              }
+            }).catch(err => {
+              this.saveLoading = false
+              console.error(err)
+              resolve(false)
+            })
+          } else {
+            this.saveLoading = false
+            resolve(false)
+          }
+        })
       },
       addInfoChangeItemCh (val) {
         let AllInfochangeItemList = {
@@ -2624,8 +2638,8 @@
               })
             } else {
               // val等于1 说明是提交时保存,保存通过后再弹框
-              this.getFirAuditerByDept()
-              this.commitshow = true
+              // this.getFirAuditerByDept()
+              // this.commitshow = true
             }
             this.saveLoading = false
           } else {
@@ -2711,14 +2725,13 @@
       },
       // 二级分办单位替企业申请:
       separateUnitSubmitApplyBtn () {
-        this.saveinfochange(1)
-        // this.getFirAuditerByDept()
-        // this.commitshow = true
+        // this.saveinfochange(1)
+        this.getFirAuditerByDept()
+        this.commitshow = true
       },
       // 二级分办单位提交审批
       separateUnitSubmitAuditMakeSure () {
         console.log('二级分办单位,确认提交审批')
-        this.saveinfochange(1)
         if (this.auditer === '') {
           this.$message({
             type: 'warning',
@@ -2733,35 +2746,42 @@
           })
           return
         }
-        this.entityForm.fushenauditer = this.fushenauditer
-        this.entityForm.auditer = this.auditer
-        this.entityForm.MInfoId = this.MInfoId
-        let params = {
-          FirstAudit: this.auditer,
-          SecondAudit: this.fushenauditer,
-          AuditRemark: this.entityForm.Remark
-        }
         this.btnloading = true
-        api.separateUnitAuditEntity(this.MInfoId, params, this.$axios).then(res => {
-          if (res.data.code === 0) {
-            // 保存成功后,初始化数据,变成修改
-            this.initDatas()
-            this.$router.push('/oilsupplier/infochangech')
-            this.commitshow = false
-            this.butnab = true
-            this.$message({
-              type: 'success',
-              message: res.data.message
+        this.saveinfochange(1).then(val => {
+          console.log(val,'222222')
+          if (val) {
+            this.entityForm.fushenauditer = this.fushenauditer
+            this.entityForm.auditer = this.auditer
+            this.entityForm.MInfoId = this.MInfoId
+            let params = {
+              FirstAudit: this.auditer,
+              SecondAudit: this.fushenauditer,
+              AuditRemark: this.entityForm.Remark
+            }
+            api.separateUnitAuditEntity(this.MInfoId, params, this.$axios).then(res => {
+              if (res.data.code === 0) {
+                // 保存成功后,初始化数据,变成修改
+                this.initDatas()
+                this.$router.push('/oilsupplier/infochangech')
+                this.commitshow = false
+                this.butnab = true
+                this.$message({
+                  type: 'success',
+                  message: res.data.message
+                })
+              } else {
+                this.$message({
+                  type: 'warning',
+                  message: res.data.message
+                })
+              }
+              this.btnloading = false
+            }).catch(err => {
+              console.error(err)
             })
           } else {
-            this.$message({
-              type: 'warning',
-              message: res.data.message
-            })
+            this.btnloading = false
           }
-          this.btnloading = false
-        }).catch(err => {
-          console.error(err)
         })
       },
       // 删除信息变更项