Ver código fonte

资质分三级

Liuqi 6 anos atrás
pai
commit
31bfb400d6

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

@@ -165,7 +165,7 @@ func (this *OilSupplierCertAppendSubController) AddAppendSub() {
 
 	if err == nil {
 		var list []supplierfile.OilSupplierFile
-		where := "SupplierId = '" + strconv.Itoa(model.SupplierId) + "'"
+		where := "SupplierTypeCode in (02,000) and SupplierId = '" + strconv.Itoa(model.SupplierId) + "'"
 		svc.GetEntitysByWhere(OilSupplierFileName, where, &list)
 
 		//三证合一或五证合一不需要的字段
@@ -280,7 +280,7 @@ func (this *OilSupplierCertAppendSubController) AddTechBus() {
 			}
 
 			var list []supplierfile.OilSupplierFile
-			where := "SupplierId = '" + strconv.Itoa(dataother.SupplierId) + "'"
+			where := "SupplierTypeCode in (03,000) and SupplierId = '" + strconv.Itoa(dataother.SupplierId) + "'"
 			svc.GetEntitysByWhere(OilSupplierFileName, where, &list)
 
 			//三证合一或五证合一不需要的字段
@@ -393,7 +393,7 @@ func (this *OilSupplierCertAppendSubController) AddGoodsBus() {
 			}
 
 			var list []supplierfile.OilSupplierFile
-			where := "SupplierId = '" + strconv.Itoa(dataother.SupplierId) + "'"
+			where := "SupplierTypeCode in (01,000) and SupplierId = '" + strconv.Itoa(dataother.SupplierId) + "'"
 			svc.GetEntitysByWhere(OilSupplierFileName, where, &list)
 
 			//三证合一或五证合一不需要的字段

+ 13 - 7
src/dashoo.cn/backend/api/controllers/oilsupplier/suppliercertsub.go

@@ -399,7 +399,7 @@ func (this *OilSupplierCertSubController) AddGoodsBus() {
 			}
 
 			var list []supplierfile.OilSupplierFile
-			where := "SupplierId = '" + strconv.Itoa(dataother.SupplierId) + "'"
+			where := "SupplierTypeCode in (01,000) and SupplierId = '" + strconv.Itoa(dataother.SupplierId) + "'"
 			svc.GetEntitysByWhere(OilSupplierFileName, where, &list)
 
 			//三证合一或五证合一不需要的字段
@@ -513,7 +513,7 @@ func (this *OilSupplierCertSubController) AddTechBus() {
 			}
 
 			var list []supplierfile.OilSupplierFile
-			where := "SupplierId = '" + strconv.Itoa(dataother.SupplierId) + "'"
+			where := "SupplierTypeCode in (03,000) and SupplierId = '" + strconv.Itoa(dataother.SupplierId) + "'"
 			svc.GetEntitysByWhere(OilSupplierFileName, where, &list)
 
 			//三证合一或五证合一不需要的字段
@@ -590,8 +590,13 @@ func (this *OilSupplierCertSubController) AddBusiness() {
 	where_certsub := " SupplierCertId = " + utils.ToStr(model.SupplierCertId) + " and SupplierTypeCode = 02"
 	where_certsub += " and SubClassId = '" + utils.ToStr(model.SubClassId) + "'"
 	has := svc.GetEntityByWhere(OilSupplierCertSubName, where_certsub, &submodel)
+	unitsvc := organize.GetOrganizeService(utils.DBE)
+	unitid := unitsvc.GetMyUnitDepartmentId(this.User.DepartmentId)
 	if !has {
 		//添加到准入分类表中
+		if unitid == "100000095" {
+			model.CertSubStatus = "1"
+		}
 		_, err = svc.InsertEntityBytbl(OilSupplierCertSubName, &model)
 	} else {
 		model.Id = submodel.Id
@@ -625,7 +630,7 @@ func (this *OilSupplierCertSubController) AddBusiness() {
 
 	if err == nil {
 		var list []supplierfile.OilSupplierFile
-		where := "SupplierId = '" + strconv.Itoa(model.SupplierId) + "'"
+		where := "SupplierTypeCode in (02,000) and SupplierId = '" + strconv.Itoa(model.SupplierId) + "'"
 		svc.GetEntitysByWhere(OilSupplierFileName, where, &list)
 
 		//三证合一或五证合一不需要的字段
@@ -718,7 +723,7 @@ func (this *OilSupplierCertSubController) BusinessDelete() {
 
 	//
 	var CertSublList []suppliercertsub.OilSupplierCertSub
-	where := "SupplierId=" + SupplierId + " and Id not in (" + Id + ")" // 没有删除的准入范围
+	where := "SupplierId=" + SupplierId + " and Id not in (" + Id + ") and SupplierTypeCode ="+ SupplierTypeCode// 没有删除的准入范围
 	svc.GetEntities(&CertSublList, where)
 	SubClassIds := ""
 	for _, CertSub := range CertSublList {
@@ -740,6 +745,7 @@ func (this *OilSupplierCertSubController) BusinessDelete() {
 	for _, CertSub := range SurplusList {
 		fileNames += CertSub.FileName + ","
 	}
+	fileNames = strings.Trim(fileNames, ",")
 	fmt.Println(fileNames)
 	for i := 0; i < len(Ids); i++ {
 		var datamain suppliercertsub.OilSupplierCertSub    //创建OilSupplierCertSub结构体(映射用)
@@ -780,7 +786,7 @@ func (this *OilSupplierCertSubController) BusinessDelete() {
 			if flag == 0 && strings.Contains(fileNames, needList[j].FileName+",") {
 				continue
 			}
-			where := " SupplierId= '" + strconv.Itoa(datamain.SupplierId) + "' and NeedFileType='" + needList[j].FileName + "'" //拼接删除sql
+			where := " SupplierId= '" + strconv.Itoa(datamain.SupplierId) + "' and SupplierTypeCode ="+ SupplierTypeCode + " and NeedFileType='" + needList[j].FileName + "'" //拼接删除sql
 			err := svc.DeleteEntityBytbl(OilSupplierFileName, where)                                                            //删除第j条资质数据
 			if err == nil {
 				errinfo.Message = "删除成功"
@@ -794,7 +800,7 @@ func (this *OilSupplierCertSubController) BusinessDelete() {
 				this.ServeJSON()
 			}
 		}
-		where = " SupplierId=" + strconv.Itoa(datamain.SupplierId) + " and SubClassId=" + strconv.Itoa(subClassId)
+		where = " SupplierId=" + strconv.Itoa(datamain.SupplierId) + " and SupplierTypeCode ="+ SupplierTypeCode +" and SubClassId=" + strconv.Itoa(subClassId)
 		err1 := svc.DeleteEntityBytbl(OilSupplierCert2FileName, where)
 		if err1 == nil {
 			errinfo.Message = "删除成功"
@@ -807,7 +813,7 @@ func (this *OilSupplierCertSubController) BusinessDelete() {
 			this.Data["json"] = &errinfo
 			this.ServeJSON()
 		}
-		where = " Id= " + Ids[i]
+		where = " Id= " + Ids[i]+" and SupplierTypeCode ="+ SupplierTypeCode
 		err2 := svc.DeleteEntityBytbl(OilSupplierCertSubName, where) //删除OilSupplierCertSub单条准入范围
 		if err2 == nil {
 			errinfo.Message = "删除成功"

+ 5 - 1
src/dashoo.cn/frontend_web/src/components/oilsupplier/businesslist.vue

@@ -435,7 +435,11 @@
               lock: true,
               text: '正在删除请稍后...'
             })
-            _this.$axios.delete('suppliercertsub/businessdelete/' + this.Ids.join(), {})
+            let params = {
+              SupplierId: parseInt(_this.SupplierId),
+              SupplierTypeCode: '02'
+            }
+            _this.$axios.delete('suppliercertsub/businessdelete/' + this.Ids.join(), {params})
               .then(function (response) {
                 if (response.data.code === 0) {
                   _this.$message({

+ 5 - 1
src/dashoo.cn/frontend_web/src/components/oilsupplier/goodslist.vue

@@ -507,7 +507,11 @@ export default {
             lock: true,
             text: '正在删除请稍后...'
           })
-          _this.$axios.delete('suppliercertsub/businessdelete/' + this.Ids.join(), {})
+            let params = {
+              SupplierId: parseInt(_this.SupplierId),
+              SupplierTypeCode: '01'
+            }
+          _this.$axios.delete('suppliercertsub/businessdelete/' + this.Ids.join(), {params})
             .then(function (response) {
               if (response.data.code === 0) {
                 _this.$message({

+ 5 - 1
src/dashoo.cn/frontend_web/src/components/oilsupplier/techlist.vue

@@ -262,7 +262,11 @@
               lock: true,
               text: '正在删除请稍后...'
             })
-            _this.$axios.delete('suppliercertsub/businessdelete/' + this.Ids.join(), {})
+            let params = {
+              SupplierId: parseInt(_this.SupplierId),
+              SupplierTypeCode: '03'
+            }
+            _this.$axios.delete('suppliercertsub/businessdelete/' + this.Ids.join(), {params})
               .then(function (response) {
                 if (response.data.code === 0) {
                   _this.$message({

+ 5 - 1
src/dashoo.cn/frontend_web/src/pages/oilsupplier/supplierappend/_opera/basisdataopera.vue

@@ -1328,7 +1328,11 @@ import fileapi from '@/api/oilsupplier/supplierfile'
           type: 'warning'
         })
           .then(() => {
-            _this.$axios.delete('suppliercertsub/businessdelete/' + Id, {})
+            let params = {
+              SupplierId: parseInt(_this.SupplierId),
+              SupplierTypeCode: '01'
+            }
+            _this.$axios.delete('suppliercertsub/businessdelete/' + Id, {params})
               .then(function (response) {
                 if (response.data.code === 0) {
                   _this.$message({

+ 5 - 1
src/dashoo.cn/frontend_web/src/pages/oilsupplier/supplierappend/_opera/goodsdataopera.vue

@@ -1551,7 +1551,11 @@
           type: 'warning'
         })
           .then(() => {
-            _this.$axios.delete('suppliercertsub/businessdelete/' + Id, {})
+            let params = {
+              SupplierId: parseInt(_this.SupplierId),
+              SupplierTypeCode: '01'
+            }
+            _this.$axios.delete('suppliercertsub/businessdelete/' + Id, {params})
               .then(function (response) {
                 if (response.data.code === 0) {
                   _this.$message({

+ 5 - 1
src/dashoo.cn/frontend_web/src/pages/oilsupplier/supplierappend/_opera/techdataopera.vue

@@ -1263,7 +1263,11 @@
           type: 'warning'
         })
           .then(() => {
-            _this.$axios.delete('suppliercertsub/businessdelete/' + Id, {})
+            let params = {
+              SupplierId: parseInt(_this.SupplierId),
+              SupplierTypeCode: '01'
+            }
+            _this.$axios.delete('suppliercertsub/businessdelete/' + Id, {params})
               .then(function (response) {
                 if (response.data.code === 0) {
                   _this.$message({