ソースを参照

前后:登录/准入统一代码不能重复;准入范围批量检查逻辑

dubch 5 年 前
コミット
2e609f9646

+ 3 - 6
src/dashoo.cn/backend/api/controllers/oilsupplier/suppliercertsub.go

@@ -428,8 +428,7 @@ func (this *OilSupplierCertSubController) CheckCertSubLost () {
 				tmpLostCert.CertFileName = needHeader.FileName
 				lostCertList = append(lostCertList, tmpLostCert)
 			} else {
-				// 1准入 2增项
-				if (fileist1.SupType == 1 && fileist1.FileName == "") || (fileist1.SupType == 2 && filelist2.FileName == "") {
+				if filelist2.FileName == "" && fileist1.FileName == "" {
 					//缺少的资质
 					var tmpLostCert LostCertFiles
 					tmpLostCert.Code = dataother.CheckList[n].Code
@@ -666,8 +665,7 @@ func (this *OilSupplierCertSubController) CheckTechCertLost() {
 				tmpLostCert.CertFileName = needList[i].FileName
 				lostCertList = append(lostCertList, tmpLostCert)
 			} else {
-				// 1准入 2增项
-				if (fileist1.SupType == 1 && fileist1.FileName == "") || (fileist1.SupType == 2 && filelist2.FileName == "") {
+				if filelist2.FileName == "" && fileist1.FileName == "" {
 					//缺少的资质
 					var tmpLostCert LostCertFiles
 					tmpLostCert.Code = dataother.CheckList[n].Code
@@ -850,8 +848,7 @@ func (this *OilSupplierCertSubController) CheckBasisBusinessLost() {
 				tmpLostCert.CertFileName = needList[i].FileName
 				lostCertList = append(lostCertList, tmpLostCert)
 			} else {
-				// 1准入 2增项
-				if (fileist1.SupType == 1 && fileist1.FileName == "") || (fileist1.SupType == 2 && filelist2.FileName == "") {
+				if filelist2.FileName == "" && fileist1.FileName == "" {
 					//缺少的资质
 					var tmpLostCert LostCertFiles
 					tmpLostCert.Code = model.Code

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

@@ -140,7 +140,7 @@ func (this *OilCorporateInfoController) GetSupplierName() {
 // @router /getcommercialno [get]
 func (this *OilCorporateInfoController) GetCommercialNo() {
 	commercialno := this.GetString("commercialno")
-	sqlStr := "SELECT CommercialNo FROM OilCorporateInfo where CommercialNo='" + commercialno + "' and CheckStatus!='-1'";
+	sqlStr := "SELECT CommercialNo FROM OilCorporateInfo where CommercialNo='" + commercialno + "' and CheckStatus!='-1'"
 	svc := register.GetOilCorporateInfoService(utils.DBE)
 	list, _ := svc.DBE.QueryString(sqlStr)
 	var errorInfo ErrorDataInfo
@@ -149,6 +149,19 @@ func (this *OilCorporateInfoController) GetCommercialNo() {
 		this.Data["json"] = &errorInfo
 		this.ServeJSON()
 	} else {
+		// 查申请主表
+		supplierId := this.GetString("supId")
+		sqlStr := "SELECT CommercialNo FROM OilSupplier where CommercialNo='" + commercialno + "'"
+		if supplierId != "" {
+			sqlStr += " and Id !=" + supplierId
+		}
+		svc := supplier.GetOilSupplierService(utils.DBE)
+		list1, _ := svc.DBE.QueryString(sqlStr)
+		if list1 != nil {
+			errorInfo.Item = true
+			this.Data["json"] = &errorInfo
+			this.ServeJSON()
+		}
 		errorInfo.Item = false
 		this.Data["json"] = &errorInfo
 		this.ServeJSON()

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

@@ -193,5 +193,11 @@ export default {
       url: 'supplier/getbycomminercialno' + commercialNo,
       method: 'GET'
     })
+  },
+  signupCommercialNo (commercialNo, supId, myAxios) {
+    return myAxios({
+      url: 'register/getcommercialno?commercialno=' + commercialNo + '&supId=' + supId,
+      method: 'GET'
+    })
   }
 }

+ 0 - 12
src/dashoo.cn/frontend_web/src/pages/oilsupplier/annualaudit/_opera/bassicoperation.vue

@@ -2097,13 +2097,6 @@ import apiCert from '@/api/oilsupplier/suppliercert'
           _this.fileList.push(params)
         }
       },
-      getFileDictOptions () {
-        fileapi.getDictList(this.$axios).then(res => {
-          this.yasuoname = res.data.items['YaSuoName']
-        }).catch(err => {
-          console.error(err)
-        })
-      },
       jsEffectDate (val) {
         if (val === '') {
           return ''
@@ -2619,11 +2612,6 @@ import apiCert from '@/api/oilsupplier/suppliercert'
       getbuslist () {
         this.$refs['subfileList'].getvalue(this.formData.Id, this.SupplierTypeCode, this.certId)
       },
-      setAuditer (val, name) {
-        this.auditer = val
-        this.auditerName = name
-        this.chooseAuditorVisible = false
-      },
       equipmentdialog () {
         this.$refs['equipmentList'].showDialog()
       },

+ 23 - 11
src/dashoo.cn/frontend_web/src/pages/oilsupplier/supplier/_opera/basisedit.vue

@@ -1422,19 +1422,31 @@ export default {
         }
         // this.formData.WellNo = this.$refs.selectWellNo.selectedLabel + '';
         this.formData.RegCapital = parseFloat(this.formData.RegCapital)
-        if (!this.formData.Id || !this.certId) {
-          if (val === 1) {
-            this.addEntityNoInfo()
-          } else {
-            this.addEntity()
-          }
-        } else {
-          if (val === 1) {
-            this.updateEntityNoInfo()
+        api.signupCommercialNo(this.formData.CommercialNo, this.formData.Id, this.$axios).then(res => {
+          console.log(res, 'Item')
+          if (res.data.item) {
+            this.$message({
+              type: 'warning',
+              message: '该统一社会信用代码与其他公司重复'
+            })
           } else {
-            this.updateEntity()
+            if (!this.formData.Id || !this.certId) {
+              if (val === 1) {
+                this.addEntityNoInfo()
+              } else {
+                this.addEntity()
+              }
+            } else {
+              if (val === 1) {
+                this.updateEntityNoInfo()
+              } else {
+                this.updateEntity()
+              }
+            }
           }
-        }
+        }).catch(err => {
+          console.error(err)
+        })
         return true
       } else {
         return false

+ 23 - 11
src/dashoo.cn/frontend_web/src/pages/oilsupplier/supplier/_opera/goodsedit.vue

@@ -1600,19 +1600,31 @@ export default {
         }
         // this.formData.WellNo = this.$refs.selectWellNo.selectedLabel + '';
         this.formData.RegCapital = parseFloat(this.formData.RegCapital)
-        if (!this.formData.Id || !this.certId) {
-          if (val === 1) {
-            this.addEntityNoInfo()
-          } else {
-            this.addEntity()
-          }
-        } else {
-          if (val === 1) {
-            this.updateEntityNoInfo()
+        api.signupCommercialNo(this.formData.CommercialNo, this.formData.Id, this.$axios).then(res => {
+          console.log(res, 'Item')
+          if (res.data.item) {
+            this.$message({
+              type: 'warning',
+              message: '该统一社会信用代码与其他公司重复'
+            })
           } else {
-            this.updateEntity()
+            if (!this.formData.Id || !this.certId) {
+              if (val === 1) {
+                this.addEntityNoInfo()
+              } else {
+                this.addEntity()
+              }
+            } else {
+              if (val === 1) {
+                this.updateEntityNoInfo()
+              } else {
+                this.updateEntity()
+              }
+            }
           }
-        }
+        }).catch(err => {
+          console.error(err)
+        })
         return true
       }
     },

+ 23 - 11
src/dashoo.cn/frontend_web/src/pages/oilsupplier/supplier/_opera/techedit.vue

@@ -1418,19 +1418,31 @@ export default {
         }
         // this.formData.WellNo = this.$refs.selectWellNo.selectedLabel + '';
         this.formData.RegCapital = parseFloat(this.formData.RegCapital)
-        if (!this.formData.Id || !this.certId) {
-          if (val === 1) {
-            this.addEntityNoInfo()
-          } else {
-            this.addEntity()
-          }
-        } else {
-          if (val === 1) {
-            this.updateEntityNoInfo()
+        api.signupCommercialNo(this.formData.CommercialNo, this.formData.Id, this.$axios).then(res => {
+          console.log(res, 'Item')
+          if (res.data.item) {
+            this.$message({
+              type: 'warning',
+              message: '该统一社会信用代码与其他公司重复'
+            })
           } else {
-            this.updateEntity()
+            if (!this.formData.Id || !this.certId) {
+              if (val === 1) {
+                this.addEntityNoInfo()
+              } else {
+                this.addEntity()
+              }
+            } else {
+              if (val === 1) {
+                this.updateEntityNoInfo()
+              } else {
+                this.updateEntity()
+              }
+            }
           }
-        }
+        }).catch(err => {
+          console.error(err)
+        })
         return true
       } else {
         return false