yuedefeng 5 lat temu
rodzic
commit
36f99dbcbc

+ 1 - 0
src/dashoo.cn/backend/api/business/oilsupplier/suppliercertsub/oilsuppliercertsub.go

@@ -169,6 +169,7 @@ type OilSupplierCert2File struct {
 	Id               int       `xorm:"not null pk autoincr INT(10)"`
 	SupplierId       int       `xorm:"not null default 0 comment('供方基本信息表主键') INT(10)"`
 	SupplierCertId   int       `xorm:"not null default 0 comment('供方准入证书信息表主键') INT(10)"`
+	SupplierCertSubId   int    `xorm:"not null default 0 comment('供方准入范围表ID') INT(10)"`
 	SupplierTypeCode string    `xorm:"not null default '0' comment('准入类别代码(1 物资类,2 基建类,3 技术服务类)') VARCHAR(5)"`
 	IsManuf          string    `xorm:"VARCHAR(5)"`
 	SubClassId       int       `xorm:"not null default 0 comment('分类表ID') INT(10)"`

+ 187 - 345
src/dashoo.cn/backend/api/controllers/oilsupplier/suppliercertsub.go

@@ -344,147 +344,6 @@ func (this *OilSupplierCertSubController) DeleteEntity() {
 	}
 }
 
-// @Title 批量添加准入范围--物资类
-// @Description 批量添加准入范围
-// @Success 200 {object} business.device.DeviceChannels
-// @router /addgoodsbus [post]
-func (this *OilSupplierCertSubController) AddGoodsBus() {
-	var jsonblob = this.Ctx.Input.RequestBody
-	var datamain suppliercertsub.OilSupplierCertSub
-	var dataother suppliercertsub.SupplierCertSubModel
-
-	json.Unmarshal(jsonblob, &datamain)
-	json.Unmarshal(jsonblob, &dataother)
-
-	var supplierCertModel suppliercert.OilSupplierCert
-	svcCert := suppliercert.GetOilSupplierCertService(utils.DBE)
-	svcCert.GetEntityById(datamain.SupplierCertId, &supplierCertModel)
-
-	var supplierModel supplier.OilSupplier
-	svcSupplier := supplier.GetOilSupplierService(utils.DBE)
-	svcSupplier.GetEntityById(datamain.SupplierId, &supplierModel)
-
-	for n := 0; n < len(dataother.CheckList); n++ {
-		where_sub := "SupplierTypeCode = 01 and SupplierId = '" + strconv.Itoa(dataother.SupplierId) + "'"
-		where_sub += " and SupplierCertId = '" + strconv.Itoa(dataother.SupplierCertId) + "'"
-		where_sub += " and SubClassId = '" + dataother.CheckList[n].Id + "'"
-		var model suppliercertsub.OilSupplierCertSub
-		svc := suppliercertsub.GetOilSupplierCertSubService(utils.DBE)
-		has := svc.GetEntityByWhere(OilSupplierCertSubName, where_sub, &model)
-
-		if !has {
-			if supplierModel.OperType == "制造商" {
-				datamain.IsManufacturer = 1
-			} else {
-				datamain.IsManufacturer = 2
-			}
-			datamain.SubClassId, _ = utils.StrTo(dataother.CheckList[n].Id).Int()
-			datamain.Code = dataother.CheckList[n].Code
-			datamain.Name = dataother.CheckList[n].Name
-			datamain.GoodsLevel = dataother.CheckList[n].GoodsLevel
-			datamain.Remark = dataother.Remark
-			datamain.IsDelete = 0
-			datamain.CreateBy = this.User.Realname
-			datamain.CreateUserId, _ = utils.StrTo(this.User.Id).Int()
-			unitsvc := organize.GetOrganizeService(utils.DBE)
-			unitid := unitsvc.GetMyUnitDepartmentId(this.User.DepartmentId)
-			if unitid == "100000095" { // 100000095 企管法规处(内控与风险管理处)
-				datamain.CertSubStatus = "1"
-			}
-
-			filesvc := supplierfile.GetSupplierfileService(utils.DBE)
-			needList := filesvc.GetGoodsNeedFileList(dataother.CheckList[n].Id, strconv.Itoa(datamain.IsManufacturer)) // 需要的资质
-			paramSvc := baseparameter.GetBaseparameterService(utils.DBE)
-
-			isContinue := false
-			if datamain.IsManufacturer == 2 {
-				needList1 := filesvc.GetGoodsNeedFileList(dataother.CheckList[n].Id, "1") // 需要的资质--制造类
-				// 中油集团公司产品质量认可证书
-				CNPCrenkezhengshu := paramSvc.GetBaseparameterMessage("GFGL", "paramset", "CNPCrenkezhengshu")
-				for _, item := range needList1 {
-					if item.FileName == CNPCrenkezhengshu {
-						isContinue = true
-						break
-					}
-				}
-			}
-			if isContinue {
-				break
-			}
-			svc.InsertEntityBytbl(OilSupplierCertSubName, &datamain)
-
-			if supplierCertModel.InStyle == "4" {
-				var needFile supplierfile.FileList
-				//战略合作协议扫描件
-				needFile.FileName = paramSvc.GetBaseparameterMessage("GFGL", "paramset", "CooperationFile")
-				needList = append(needList, needFile)
-			}
-
-			var Havelist []supplierfile.OilSupplierFile // 已经有的资质
-			where := "SupplierTypeCode in (01,000) and IsManuf in ('0','" + strconv.Itoa(datamain.IsManufacturer) + "', '') and SupplierId = '" + strconv.Itoa(dataother.SupplierId) + "'"
-			svc.GetEntitysByWhere(OilSupplierFileName, where, &Havelist)
-
-			//三证合一或五证合一不需要的字段
-			mergerCertSkipField := paramSvc.GetBaseparameterMessage("GFGL", "paramset", "MergerCertSkipFieldName")
-			//"营业执照,组织代码,组织机构代码证,税务登记证,税务登记,开户许可,银行开户许可证,承诺书,诚信合规承诺书,企业信息系统截图,战略合作协议扫描件,"
-			mustField := paramSvc.GetBaseparameterMessage("GFGL", "paramset", "MustFieldName")
-
-			for i := 0; i < len(needList); i++ {
-				var entity supplierfile.OilSupplierFile
-				entity.SupplierId = dataother.SupplierId
-
-				if (supplierModel.CredentialFlag == "1" || supplierModel.CredentialFlag == "2") && strings.Contains(mergerCertSkipField, needList[i].FileName+",") { //三证合一或五证合一了
-					continue
-				}
-				//加入对应表OilSupplierCert2File
-				var cert2File suppliercertsub.OilSupplierCert2File //创建结构体
-				cert2File.SupplierId = dataother.SupplierId
-				cert2File.SupplierCertId = dataother.SupplierCertId
-				cert2File.SupplierTypeCode = dataother.SupplierTypeCode
-				cert2File.IsManuf = strconv.Itoa(datamain.IsManufacturer)
-				cert2File.SubClassId, _ = utils.StrTo(dataother.CheckList[n].Id).Int()
-				cert2File.Code = dataother.CheckList[n].Code
-				cert2File.Name = dataother.CheckList[n].Name
-				cert2File.NeedFileType = needList[i].FileName
-				svc.InsertEntityBytbl(OilSupplierCert2FileName, &cert2File)
-
-				if strings.Contains(mustField, needList[i].FileName+",") {
-					entity.SupplierTypeCode = "000"
-					entity.IsManuf = "0"
-				} else {
-					entity.SupplierTypeCode = dataother.SupplierTypeCode
-					entity.IsManuf = strconv.Itoa(datamain.IsManufacturer)
-				}
-				entity.NeedFileType = needList[i].FileName
-				entity.FileType = 1
-				//entity.EffectDate = time.Now()
-				entity.CreateBy = this.User.Realname
-				entity.CreateUserId, _ = utils.StrTo(this.User.Id).Int()
-				entity.SupType = 1
-
-				isRepeat := false
-				for j := 0; j < len(Havelist); j++ {
-					if Havelist[j].NeedFileType == needList[i].FileName {
-						isRepeat = true
-						break
-					}
-				}
-				if isRepeat == true {
-					continue
-				}
-				svc.InsertEntityBytbl(OilSupplierFileName, &entity)
-			}
-
-		}
-	}
-
-	var errinfo ErrorDataInfo
-	errinfo.Message = "操作成功!"
-	errinfo.Code = 0
-	this.Data["json"] = &errinfo
-	this.ServeJSON()
-}
-
 // @Title 批量添加准入范围--物资类
 // @Description 批量添加准入范围
 // @Success 200 {object} business.device.DeviceChannels
@@ -662,17 +521,6 @@ func (this *OilSupplierCertSubController) AddGoodsByFilter() {
 					certsValid = false
 					break
 				}
-				//加入对应表OilSupplierCert2File, 保存准入项所需的资质关系
-				var cert2File suppliercertsub.OilSupplierCert2File //创建结构体
-				cert2File.SupplierId = dataother.SupplierId
-				cert2File.SupplierCertId = dataother.SupplierCertId
-				cert2File.SupplierTypeCode = dataother.SupplierTypeCode
-				cert2File.IsManuf = strconv.Itoa(datamain.IsManufacturer)
-				cert2File.SubClassId, _ = utils.StrTo(dataother.CheckList[n].Id).Int()
-				cert2File.Code = dataother.CheckList[n].Code
-				cert2File.Name = dataother.CheckList[n].Name
-				cert2File.NeedFileType = needHeader.FileName
-				svc.InsertEntityBytbl(OilSupplierCert2FileName, &cert2File)
 			}
 			if !certsValid {
 				//缺少资质,不会保存
@@ -691,7 +539,28 @@ func (this *OilSupplierCertSubController) AddGoodsByFilter() {
 			if unitid == "100000095" { // 100000095 企管法规处(内控与风险管理处)
 				datamain.CertSubStatus = "1"
 			}
+			//插入准入范围表
 			svc.InsertEntityBytbl(OilSupplierCertSubName, &datamain)
+			//插入准入范围所需资质记录表
+			for _, needHeader := range needList {
+				if (supplierModel.CredentialFlag == "1" || supplierModel.CredentialFlag == "2") &&
+					strings.Contains(mergerCertSkipField, needHeader.FileName+",") {
+					//三证合一或五证合一的证件,不需要保存
+					continue
+				}
+				//加入对应表OilSupplierCert2File, 保存准入项所需的资质关系
+				var cert2File suppliercertsub.OilSupplierCert2File //创建结构体
+				cert2File.SupplierId = dataother.SupplierId
+				cert2File.SupplierCertId = dataother.SupplierCertId
+				cert2File.SupplierCertSubId = datamain.Id
+				cert2File.SupplierTypeCode = dataother.SupplierTypeCode
+				cert2File.IsManuf = strconv.Itoa(datamain.IsManufacturer)
+				cert2File.SubClassId, _ = utils.StrTo(dataother.CheckList[n].Id).Int()
+				cert2File.Code = dataother.CheckList[n].Code
+				cert2File.Name = dataother.CheckList[n].Name
+				cert2File.NeedFileType = needHeader.FileName
+				svc.InsertEntityBytbl(OilSupplierCert2FileName, &cert2File)
+			}
 			vaildCnt++
 		}
 	}
@@ -710,11 +579,86 @@ func (this *OilSupplierCertSubController) AddGoodsByFilter() {
 	this.ServeJSON()
 }
 
+
+// @Title 批量添加准入范围--技术服务类
+// @Description 批量添加准入范围
+// @Success 200 {object} business.device.DeviceChannels
+// @router /tech-cert-lost [post]
+func (this *OilSupplierCertSubController) CheckTechCertLost() {
+	var jsonblob = this.Ctx.Input.RequestBody
+	var datamain suppliercertsub.OilSupplierCertSub
+	var dataother suppliercertsub.TechnologySubModel
+	json.Unmarshal(jsonblob, &datamain)
+	json.Unmarshal(jsonblob, &dataother)
+
+	var supplierCertModel suppliercert.OilSupplierCert
+	svcCert := suppliercert.GetOilSupplierCertService(utils.DBE)
+	svcCert.GetEntityById(datamain.SupplierCertId, &supplierCertModel)
+
+	var supplierModel supplier.OilSupplier
+	svcSupplier := supplier.GetOilSupplierService(utils.DBE)
+	svcSupplier.GetEntityById(datamain.SupplierId, &supplierModel)
+
+	var lostCertList []LostCertFiles
+
+	for n := 0; n < len(dataother.CheckList); n++ {
+		paramSvc := baseparameter.GetBaseparameterService(utils.DBE)
+		filesvc := supplierfile.GetSupplierfileService(utils.DBE)
+		needList := filesvc.GetTechNeedFileList(strconv.Itoa(dataother.CheckList[n].Id))
+
+		if supplierCertModel.InStyle == "4" {
+			var needFile supplierfile.FileList
+			needFile.FileName = paramSvc.GetBaseparameterMessage("GFGL", "paramset", "CooperationFile")
+			needList = append(needList, needFile)
+		}
+
+		var fileist []supplierfile.OilSupplierFile
+		where := "SupplierTypeCode in (03,000) and SupplierId = '" + strconv.Itoa(dataother.SupplierId) + "'"
+		svcSupplier.GetEntitysByWhere(OilSupplierFileName, where, &fileist)
+
+		var companyHasHeaders string
+		for _, tableheader := range fileist {
+			companyHasHeaders += tableheader.NeedFileType + ","
+		}
+
+		//三证合一或五证合一不需要的字段
+		mergerCertSkipField := paramSvc.GetBaseparameterMessage("GFGL", "paramset", "MergerCertSkipFieldName")
+		for i := 0; i < len(needList); i++ {
+			var entity supplierfile.OilSupplierFile
+			entity.SupplierId = dataother.SupplierId
+			if (supplierModel.CredentialFlag == "1" || supplierModel.CredentialFlag == "2") && strings.Contains(mergerCertSkipField, needList[i].FileName+",") { //三证合一或五证合一了
+				continue
+			}
+			if !strings.Contains(companyHasHeaders, needList[i].FileName+",") {
+				//缺少的资质
+				var tmpLostCert LostCertFiles
+				tmpLostCert.Code = dataother.CheckList[n].Code
+				tmpLostCert.Name = dataother.CheckList[n].Name
+				tmpLostCert.CertFileName = needList[i].FileName
+				lostCertList = append(lostCertList, tmpLostCert)
+			}
+		}
+	}
+	var errinfo ErrorDataInfo
+	if len(lostCertList) <= 0 {
+		errinfo.Code = 0
+		errinfo.Message = "验证通过!"
+		this.Data["json"] = nil
+	} else {
+		errinfo.Code = -1
+		errinfo.Message = "缺少资质!"
+		this.Data["json"] = &lostCertList
+	}
+	this.ServeJSON()
+}
+
 // @Title 批量添加准入范围--技术服务类
 // @Description 批量添加准入范围
 // @Success 200 {object} business.device.DeviceChannels
 // @router /addtechbus [post]
 func (this *OilSupplierCertSubController) AddTechBus() {
+	//TODO: 没有像AddGoodsByFilter一样,保存时做合法性验证,因为在保存之前已经在前台调用了CheckTechCertLost验证过了,
+	// 以后有时间再加上
 	var jsonblob = this.Ctx.Input.RequestBody
 	var datamain suppliercertsub.OilSupplierCertSub
 	var dataother suppliercertsub.TechnologySubModel
@@ -769,8 +713,8 @@ func (this *OilSupplierCertSubController) AddTechBus() {
 			//三证合一或五证合一不需要的字段
 			mergerCertSkipField := paramSvc.GetBaseparameterMessage("GFGL", "paramset", "MergerCertSkipFieldName")
 
-			//"营业执照,组织代码,组织机构代码证,税务登记证,税务登记,开户许可,银行开户许可证,承诺书,诚信合规承诺书,企业信息系统截图,战略合作协议扫描件,"
-			mustField := paramSvc.GetBaseparameterMessage("GFGL", "paramset", "MustFieldName")
+			// "营业执照,组织代码,组织机构代码证,税务登记证,税务登记,开户许可,银行开户许可证,承诺书,诚信合规承诺书,企业信息系统截图,战略合作协议扫描件,"
+			// mustField := paramSvc.GetBaseparameterMessage("GFGL", "paramset", "MustFieldName")
 			for i := 0; i < len(needList); i++ {
 				var entity supplierfile.OilSupplierFile
 				entity.SupplierId = dataother.SupplierId
@@ -782,39 +726,14 @@ func (this *OilSupplierCertSubController) AddTechBus() {
 				var cert2File suppliercertsub.OilSupplierCert2File //创建结构体
 				cert2File.SupplierId = dataother.SupplierId
 				cert2File.SupplierCertId = dataother.SupplierCertId
+				cert2File.SupplierCertSubId = datamain.Id
 				cert2File.SupplierTypeCode = dataother.SupplierTypeCode
 				cert2File.SubClassId = dataother.CheckList[n].Id
 				cert2File.Code = dataother.CheckList[n].Code
 				cert2File.Name = dataother.CheckList[n].Name
 				cert2File.NeedFileType = needList[i].FileName
 				svc.InsertEntityBytbl(OilSupplierCert2FileName, &cert2File)
-				if strings.Contains(mustField, needList[i].FileName+",") {
-					entity.SupplierTypeCode = "000"
-					entity.IsManuf = "0"
-				} else {
-					entity.SupplierTypeCode = dataother.SupplierTypeCode
-				}
-				entity.NeedFileType = needList[i].FileName
-				entity.FileType = 1
-				//entity.EffectDate = time.Now()
-				entity.CreateBy = this.User.Realname
-				entity.CreateUserId, _ = utils.StrTo(this.User.Id).Int()
-				entity.SupType = 1
-
-				isRepeat := false
-				for j := 0; j < len(list); j++ {
-					if list[j].NeedFileType == needList[i].FileName {
-						isRepeat = true
-						break
-					}
-				}
-				if isRepeat == true {
-					continue
-				}
-
-				svc.InsertEntityBytbl(OilSupplierFileName, &entity)
 			}
-
 		}
 	}
 
@@ -825,8 +744,81 @@ func (this *OilSupplierCertSubController) AddTechBus() {
 	this.ServeJSON()
 }
 
-// @Title 新增准入范围
-// @Description 新增准入范围
+// @Title 检查资质是否完整--基建类
+// @Description 批量添加准入范围
+// @Success 200 {object} lostCertList []LostCertFiles
+// @router /check-basis-lost [post]
+func (this *OilSupplierCertSubController) CheckBasisBusinessLost() {
+	var model suppliercertsub.OilSupplierCertSub
+	var err error
+	var jsonblob = this.Ctx.Input.RequestBody
+	json.Unmarshal(jsonblob, &model)
+
+	var supplierCertModel suppliercert.OilSupplierCert
+	svcCert := suppliercert.GetOilSupplierCertService(utils.DBE)
+	svcCert.GetEntityById(model.SupplierCertId, &supplierCertModel)
+
+	var supplierModel supplier.OilSupplier
+	svcSupplier := supplier.GetOilSupplierService(utils.DBE)
+	svcSupplier.GetEntityById(model.SupplierId, &supplierModel)
+
+	paramSvc := baseparameter.GetBaseparameterService(utils.DBE)
+	filesvc := supplierfile.GetSupplierfileService(utils.DBE)
+	var needList []supplierfile.FileList
+
+	var lostCertList []LostCertFiles
+
+	needList = filesvc.GetBasicNeedFileList(strconv.Itoa(model.SubClassId))
+
+	if supplierCertModel.InStyle == "4" {
+		var needFile supplierfile.FileList
+		needFile.FileName = paramSvc.GetBaseparameterMessage("GFGL", "paramset", "CooperationFile")
+		needList = append(needList, needFile)
+	}
+
+	if err == nil {
+		var list []supplierfile.OilSupplierFile
+		where := "SupplierTypeCode in (02,000) and SupplierId = '" + strconv.Itoa(model.SupplierId) + "'"
+		svcCert.GetEntitysByWhere(OilSupplierFileName, where, &list)
+		var companyHasHeaders string
+		for _, tableheader := range list {
+			companyHasHeaders += tableheader.NeedFileType + ","
+		}
+
+		//三证合一或五证合一不需要的字段
+		mergerCertSkipField := paramSvc.GetBaseparameterMessage("GFGL", "paramset", "MergerCertSkipFieldName")
+
+		//"营业执照,组织代码,组织机构代码证,税务登记证,税务登记,开户许可,银行开户许可证,承诺书,诚信合规承诺书,企业信息系统截图,战略合作协议扫描件,"
+		// mustField := paramSvc.GetBaseparameterMessage("GFGL", "paramset", "MustFieldName")
+		for i := 0; i < len(needList); i++ {
+			if (supplierModel.CredentialFlag == "1" || supplierModel.CredentialFlag == "2") && strings.Contains(mergerCertSkipField, needList[i].FileName+",") { //三证合一或五证合一了
+				continue
+			}
+			if !strings.Contains(companyHasHeaders, needList[i].FileName+",") {
+				//缺少的资质
+				var tmpLostCert LostCertFiles
+				tmpLostCert.Code = model.Code
+				tmpLostCert.Name = model.Name
+				tmpLostCert.CertFileName = needList[i].FileName
+				lostCertList = append(lostCertList, tmpLostCert)
+			}
+		}
+	}
+	var errinfo ErrorDataInfo
+	if len(lostCertList) <= 0 {
+		errinfo.Code = 0
+		errinfo.Message = "验证通过!"
+		this.Data["json"] = nil
+	} else {
+		errinfo.Code = -1
+		errinfo.Message = "缺少资质!"
+		this.Data["json"] = &lostCertList
+	}
+	this.ServeJSON()
+}
+
+// @Title 新增准入范围 --基建类
+// @Description 新增准入范围 --基建类
 // @Success	200	{object} controllers.Request
 // @router /addbusiness [post]
 func (this *OilSupplierCertSubController) AddBusiness() {
@@ -888,49 +880,25 @@ func (this *OilSupplierCertSubController) AddBusiness() {
 		mergerCertSkipField := paramSvc.GetBaseparameterMessage("GFGL", "paramset", "MergerCertSkipFieldName")
 
 		//"营业执照,组织代码,组织机构代码证,税务登记证,税务登记,开户许可,银行开户许可证,承诺书,诚信合规承诺书,企业信息系统截图,战略合作协议扫描件,"
-		mustField := paramSvc.GetBaseparameterMessage("GFGL", "paramset", "MustFieldName")
+		// mustField := paramSvc.GetBaseparameterMessage("GFGL", "paramset", "MustFieldName")
 
 		for i := 0; i < len(needList); i++ {
+			if (supplierModel.CredentialFlag == "1" || supplierModel.CredentialFlag == "2") && strings.Contains(mergerCertSkipField, needList[i].FileName+",") { //三证合一或五证合一了
+				continue
+			}
 			var entity supplierfile.OilSupplierFile
 			entity.SupplierId = model.SupplierId
 			//加入对应表OilSupplierCert2File
 			var cert2File suppliercertsub.OilSupplierCert2File //创建结构体
 			cert2File.SupplierId = model.SupplierId
 			cert2File.SupplierCertId = model.SupplierCertId
+			cert2File.SupplierCertSubId = model.Id
 			cert2File.SupplierTypeCode = model.SupplierTypeCode
 			cert2File.SubClassId = model.SubClassId
 			cert2File.Code = model.Code
 			cert2File.Name = model.Name
 			cert2File.NeedFileType = needList[i].FileName
 			svc.InsertEntityBytbl(OilSupplierCert2FileName, &cert2File)
-			if (supplierModel.CredentialFlag == "1" || supplierModel.CredentialFlag == "2") && strings.Contains(mergerCertSkipField, needList[i].FileName+",") { //三证合一或五证合一了
-				continue
-			}
-
-			if strings.Contains(mustField, needList[i].FileName+",") {
-				entity.SupplierTypeCode = "000"
-				entity.IsManuf = "0"
-			} else {
-				entity.SupplierTypeCode = model.SupplierTypeCode
-			}
-			entity.NeedFileType = needList[i].FileName
-			entity.FileType = 1
-			//entity.EffectDate = time.Now()
-			entity.CreateBy = this.User.Realname
-			entity.CreateUserId, _ = utils.StrTo(this.User.Id).Int()
-			entity.SupType = 1
-
-			isRepeat := false
-			for j := 0; j < len(list); j++ {
-				if list[j].NeedFileType == needList[i].FileName {
-					isRepeat = true
-					break
-				}
-			}
-			if isRepeat == true {
-				continue
-			}
-			svc.InsertEntityBytbl(OilSupplierFileName, &entity)
 		}
 
 	}
@@ -957,9 +925,6 @@ func (this *OilSupplierCertSubController) AddBusiness() {
 func (this *OilSupplierCertSubController) BusinessDelete() {
 	Id := this.Ctx.Input.Param(":Id")
 	//SupplierCertId := this.GetString("SupplierCertId")
-	SupplierId := this.GetString("SupplierId")
-	SupplierTypeCode := this.GetString("SupplierTypeCode")
-	var IsManufacturer string
 	var errinfo ErrorInfo
 	if Id == "" {
 		errinfo.Message = "操作失败!请求信息不完整"
@@ -968,141 +933,18 @@ func (this *OilSupplierCertSubController) BusinessDelete() {
 		this.ServeJSON()
 		return
 	}
-	Ids := strings.Split(Id, ",")
 
 	//根据Id查出OilSupplierCertSub的SubClassId
 	svc := suppliercertsub.GetOilSupplierCertSubService(utils.DBE) //获得数据库引擎
-	filesvc := supplierfile.GetSupplierfileService(utils.DBE)
-	paramSvc := baseparameter.GetBaseparameterService(utils.DBE)
-
-	//
-	var CertSublList []suppliercertsub.OilSupplierCertSub
-	where := "SupplierId=" + SupplierId + " and Id not in (" + Id + ") and SupplierTypeCode =" + SupplierTypeCode // 没有删除的准入范围
-	svc.GetEntities(&CertSublList, where)
-	SubClassIds := ""
-	for _, CertSub := range CertSublList {
-
-		SubClassIds += strconv.Itoa(CertSub.SubClassId) + ","
-	}
-	var SurplusList []supplierfile.FileList
-	SubClassIds = strings.Trim(SubClassIds, ",")
-	if SubClassIds != "" {
-		if SupplierTypeCode == "01" {
-			//SurplusList = filesvc.GetGoodsNeedFileList(SubClassIds, IsManufacturer)
-		} else if SupplierTypeCode == "02" {
-			SurplusList = filesvc.GetBasicNeedFileList(SubClassIds)
-		} else if SupplierTypeCode == "03" {
-			SurplusList = filesvc.GetTechNeedFileList(SubClassIds)
-		}
-	}
-	fileNames := ""
-	for _, CertSub := range SurplusList {
-		fileNames += CertSub.FileName + ","
-	}
-
-	for i := 0; i < len(Ids); i++ {
-		IsManufacturer = filesvc.CheckIsManuf(Ids[i])
-		if SubClassIds != "" {
-			if SupplierTypeCode == "01" {
-				var CertSublList2 []suppliercertsub.OilSupplierCertSub
-				wheregood := "SupplierId=" + SupplierId + " and Id not in (" + Id + ") and SupplierTypeCode =" + SupplierTypeCode + " and IsManufacturer =" + IsManufacturer // 没有删除的准入范围
-				svc.GetEntities(&CertSublList2, wheregood)
-				SubClassIds2 := ""
-				for _, CertSub := range CertSublList2 {
-					SubClassIds2 += strconv.Itoa(CertSub.SubClassId) + ","
-				}
-				SubClassIds2 = strings.Trim(SubClassIds2, ",")
-				SurplusList = filesvc.GetGoodsNeedFileList(SubClassIds2, IsManufacturer)
-			}
-		}
-		if fileNames == "" {
-			for _, CertSub := range SurplusList {
-				fileNames += CertSub.FileName + ","
-			}
-		}
-		var datamain suppliercertsub.OilSupplierCertSub    //创建OilSupplierCertSub结构体(映射用)
-		var datamain2 []suppliercertsub.OilSupplierCertSub //空的查询用
-
-		where := " Id= " + Ids[i]
-		svc.GetEntity(&datamain, where) //根据Id查找,映射结构体
-
-		//再根据企业id查找这个企业有几个准入范围(如果只有一个准入范围了,基本资质也删除)
-
-		supplierId := datamain.SupplierId
-		where = "SupplierId=" + strconv.Itoa(supplierId)
-		svc.GetEntities(&datamain2, where)
-		flag := 0
-		if len(datamain2) == 1 {
-			flag = 1
-		}
-		subClassId := datamain.SubClassId //4.拿到结构体中的准入范围SubClassId
-		//根据SubClassId查出此准入范围所拥有的资质名称
-		var needList []supplierfile.FileList //定义存储所拥有资质名称的数组
-		if datamain.SupplierTypeCode == "01" {
-			needList = filesvc.GetGoodsNeedFileList(strconv.Itoa(subClassId), IsManufacturer) //通过准入范围Id获得资质名称并填充数组
-		} else if datamain.SupplierTypeCode == "02" {
-			needList = filesvc.GetBasicNeedFileList(strconv.Itoa(subClassId))
-		} else {
-			needList = filesvc.GetTechNeedFileList(strconv.Itoa(subClassId))
-		}
+	where := "delete from " + OilSupplierCertSubName + " where Id in (" + Id + ")" // 没有删除的准入范围
+	whereCert2File := "delete from " + OilSupplierCert2FileName + " where SupplierCertSubId in (" + Id + ")" // 没有删除的准入范围
+	svc.DBE.Exec(where)
+	svc.DBE.Exec(whereCert2File)
 
-		var mustField string
-		mustField = paramSvc.GetBaseparameterMessage("GFGL", "paramset", "MustFieldName") //必需的资质
-
-		//根据企业ID(SupplierId)和此准入范围所拥有的资质名称删除OilSupplierFile表中对应的资质
-		for j := 0; j < len(needList); j++ { //循环遍历资质名称数组,逐条删除
-
-			if flag == 0 && strings.Contains(mustField, needList[j].FileName+",") {
-				continue
-			}
-			if flag == 0 && strings.Contains(fileNames, needList[j].FileName+",") {
-				continue
-			}
-			if datamain.SupplierTypeCode == "01" {
-				where = " SupplierId= '" + strconv.Itoa(datamain.SupplierId) + "' and SupplierTypeCode =" + SupplierTypeCode + " and IsManuf='" + IsManufacturer + "' and NeedFileType='" + needList[j].FileName + "'" //拼接删除sql
-			} else {
-				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 = "删除成功"
-				errinfo.Code = 0
-				this.Data["json"] = &errinfo
-				this.ServeJSON()
-			} else {
-				errinfo.Message = "删除失败!" + utils.AlertProcess(err.Error())
-				errinfo.Code = -1
-				this.Data["json"] = &errinfo
-				this.ServeJSON()
-			}
-		}
-		where = " SupplierId=" + strconv.Itoa(datamain.SupplierId) + " and SupplierTypeCode =" + SupplierTypeCode + " and SubClassId=" + strconv.Itoa(subClassId)
-		err1 := svc.DeleteEntityBytbl(OilSupplierCert2FileName, where)
-		if err1 == nil {
-			errinfo.Message = "删除成功"
-			errinfo.Code = 0
-			this.Data["json"] = &errinfo
-			this.ServeJSON()
-		} else {
-			errinfo.Message = "删除失败!" + utils.AlertProcess(err1.Error())
-			errinfo.Code = -1
-			this.Data["json"] = &errinfo
-			this.ServeJSON()
-		}
-		where = " Id= " + Ids[i] + " and SupplierTypeCode =" + SupplierTypeCode
-		err2 := svc.DeleteEntityBytbl(OilSupplierCertSubName, where) //删除OilSupplierCertSub单条准入范围
-		if err2 == nil {
-			errinfo.Message = "删除成功"
-			errinfo.Code = 0
-			this.Data["json"] = &errinfo
-			this.ServeJSON()
-		} else {
-			errinfo.Message = "删除失败!" + utils.AlertProcess(err2.Error())
-			errinfo.Code = -1
-			this.Data["json"] = &errinfo
-			this.ServeJSON()
-		}
-	}
+	errinfo.Message = "删除成功!"
+	errinfo.Code = 0
+	this.Data["json"] = &errinfo
+	this.ServeJSON()
 }
 
 // @Title 获取待审核业务列表

+ 57 - 94
src/dashoo.cn/frontend_web/src/components/oilsupplier/businesslist.vue

@@ -4,6 +4,10 @@
       <div slot="header" class="clearfix">
         <span style="font-weight: bold">准入范围</span>
         <span style="float: right;">
+          <el-button type="primary" size="mini" style="float: right;margin-left: 25px" @click="commitAudit()"
+                     v-if="canadd && IsCompanyUser == 0">
+          提交审批
+          </el-button>
            <el-button style="float: right; padding: 3px 0px" type="text" @click="deletedata()" v-if="candelete">删除</el-button>
           <el-button style="float: right; padding: 3px 25px" type="text" @click="showDialog" v-if="canadd || newcanadd">添加
           </el-button>
@@ -48,17 +52,16 @@
     </el-card>
 
     <el-dialog v-loading="loading" element-loading-text="正在添加请稍后..." :title="Title" :visible.sync="visible" top="5vh">
-      <el-form ref="BusinessForm" :model="BusinessForm" label-width="100px">
+      <el-alert
+        style="margin-bottom: 5px"
+        v-if="lostTableDataInfo.length > 0"
+        :title="'缺少资质:' + lostTableDataInfo"
+        :closable="false"
+        type="warning">
+      </el-alert>
+      <el-form ref="BusinessForm" :model="BusinessForm" label-width="100px" size="small">
         <el-row>
-          <!-- <el-col :span="12" v-if="SupplierTypeCode == '01' && Title == '新增准入范围'">
-            <el-form-item label="名称" prop="checkName">
-              <el-cascader ref="cascader" :options="optionsList" style="width:100%" :props="goodsProps"
-                :show-all-levels="false" v-model="selectedOptList" @active-item-change="getChildrens"
-                @change="getGoodsCode" placeholder="请选择分类">
-              </el-cascader>
-            </el-form-item>
-          </el-col> -->
-          <el-col :span="12" v-if="SupplierTypeCode == '02' && Title == '新增准入范围'">
+          <el-col :span="12">
             <el-form-item label="名称" required>
               <el-input placeholder="请选择名称" v-model="BusinessForm.Name" style="width:100%" readonly>
                 <el-button type="primary" style="width:30%" @click="basicDialog = true" slot="append">选择
@@ -66,17 +69,6 @@
               </el-input>
             </el-form-item>
           </el-col>
-          <!-- <el-col :span="12" v-if="SupplierTypeCode == '03' && Title == '新增准入范围'">
-            <el-form-item label="名称" required>
-              <el-cascader :options="techTreeList" :props="orgtreeprops" change-on-select :show-all-levels="false"
-                v-model="selectedorg" placeholder="请选择菜单" @change="getCode()" style="width:100%"></el-cascader>
-            </el-form-item>
-          </el-col> -->
-          <el-col :span="12" v-if="Title == '编辑准入范围'">
-            <el-form-item label="名称">
-              <el-input v-model="BusinessForm.Name" placeholder="请输入名称" disabled></el-input>
-            </el-form-item>
-          </el-col>
           <el-col :span="12">
             <el-form-item label="编码" required>
               <el-input v-model="BusinessForm.Code" placeholder="请输入编码" readonly></el-input>
@@ -90,8 +82,8 @@
         </el-row>
       </el-form>
       <div slot="footer" class="dialog-footer" style="margin-top:-30px;">
-        <el-button @click="visible = false">取 消</el-button>
-        <el-button type="primary" @click="addBasicBus()">确 定</el-button>
+        <el-button @click="visible = false" size="small">取 消</el-button>
+        <el-button type="primary" size="small" :disabled="lostTableDataInfo.length > 0" @click="addBasicBus()">确 定</el-button>
       </div>
     </el-dialog>
 
@@ -107,7 +99,7 @@
           <el-input size="mini" style="width: 165px;" v-model="keyword" placeholder="请输入业务名称"></el-input>
         </el-form-item>
       </el-form>
-      <el-table :data="techList" border>
+      <el-table :data="techList" border size="mini" highlight-current-row>
         <el-table-column label="操作" width="70" align="center" fixed>
           <template slot-scope="scope">
             <el-button type="text" size="small" @click="getChooseCode(scope.row)">选择</el-button>
@@ -149,14 +141,15 @@
         default: false
       }
     },
-    /* created() {
-      this.initData()
-    },
     computed: {
       ...mapGetters({
-        session: 'session'
+        session: 'session',
+        authUser: 'authUser'
       })
-    }, */
+    },
+    created () {
+      this.IsCompanyUser = this.authUser.Profile.IsCompanyUser
+    },
     data () {
       var CheckSelectedOption = (rule, value, callback) => {
         if (this.selectedOptList && this.selectedOptList.length < 1) {
@@ -166,12 +159,14 @@
         }
       }
       return {
+        IsCompanyUser: '',
         loading: false,
         Ids: [],
         SupplierId: 0,
         SupplierTypeCode: '',
         SupplierCertId: 0,
-
+        lostTableDataInfo: '',
+        lostTableData: [],
         businessList: [],
         techList: [],
         // techTreeList: [],
@@ -251,6 +246,9 @@
         } else {
         }
       },
+      commitAudit () {
+        this.$emit('commitAudit')
+      },
       handleSelectionChange (val) {
         this.Ids = []
         for (var i = 0; i < val.length; i++) {
@@ -335,6 +333,14 @@
       // },
       addBasicBus () {
         let _this = this
+        if (! this.BusinessForm.SubClassId) {
+          _this.$message({
+            type: 'warning',
+            message: '请选择准入范围'
+          })
+          return false
+        }
+
         _this.BusinessForm.SupplierId = parseInt(_this.BusinessForm.SupplierId)
         _this.BusinessForm.SupplierCertId = parseInt(_this.BusinessForm.SupplierCertId)
         _this.BusinessForm.SubClassId = parseInt(_this.BusinessForm.SubClassId)
@@ -362,65 +368,6 @@
             console.error(err)
           })
       },
-      // addBusiness() {
-      //   let _this = this
-      //   _this.BusinessForm.SupplierId = parseInt(_this.BusinessForm.SupplierId)
-      //   _this.BusinessForm.SupplierCertId = parseInt(_this.BusinessForm.SupplierCertId)
-      //   _this.BusinessForm.SubClassId = parseInt(_this.BusinessForm.SubClassId)
-      //   //因为表单验证不能用,所以采用提示验证
-      //   if (_this.selectedorg.length < 1) {
-      //     _this.$message({
-      //       type: 'warning',
-      //       message: '名称不能为空,请选择分类!'
-      //     })
-      //   } else {
-      //     _this.$axios.post('/suppliercertsub/addbusiness/', _this.BusinessForm)
-      //       .then(res => {
-      //         if (res.data.code === 0) {
-      //           _this.$message({
-      //             type: 'success',
-      //             message: res.data.message
-      //           })
-      //           _this.BusinessForm.Id = res.data.item + ''
-      //           _this.visible = false
-      //           _this.initData()
-      //         } else {
-      //           _this.$message({
-      //             type: 'warning',
-      //             message: res.data.message
-      //           })
-      //         }
-      //       })
-      //       .catch(err => {
-      //         console.error(err)
-      //       })
-      //   }
-      // },
-      // editBusiness() {
-      //   let _this = this
-      //   _this.BusinessForm.SupplierId = parseInt(_this.BusinessForm.SupplierId)
-      //   _this.BusinessForm.SupplierCertId = parseInt(_this.BusinessForm.SupplierCertId)
-      //   _this.BusinessForm.SubClassId = parseInt(_this.BusinessForm.SubClassId)
-      //   _this.$axios.put('/suppliercertsub/editbusiness/' + _this.BusinessForm.Id, _this.BusinessForm)
-      //     .then(res => {
-      //       if (res.data.code === 0) {
-      //         _this.$message({
-      //           type: 'success',
-      //           message: res.data.message
-      //         })
-      //         this.visible = false
-      //         this.initData()
-      //       } else {
-      //         _this.$message({
-      //           type: 'warning',
-      //           message: res.data.message
-      //         })
-      //       }
-      //     })
-      //     .catch(err => {
-      //       console.error(err)
-      //     })
-      // },
       deletedata (val) {
         if (val != null && val != '') {
           this.Ids = []
@@ -610,13 +557,29 @@
       //   }
       // },
       getChooseCode (val) {
-        this.ClassId = val.Id
-        this.BusinessForm.SubClassId = val.Id
-        this.BusinessForm.Code = val.Code
-        this.BusinessForm.Name = val.Name
-        this.basicDialog = false
+        let _this = this
+        _this.BusinessForm.SubClassId = 0
+        _this.$axios.post('/suppliercertsub//check-basis-lost', _this.BusinessForm)
+          .then(res => {
+            _this.lostTableData = res.data || []
+            _this.lostTableDataInfo = ''
+            for (let i=0; i<_this.lostTableData.length; i++) {
+              _this.lostTableDataInfo += _this.lostTableData[i].CertFileName + ', '
+            }
+            _this.ClassId = val.Id
+            _this.BusinessForm.SupplierId = parseInt(_this.BusinessForm.SupplierId)
+            _this.BusinessForm.SupplierCertId = parseInt(_this.BusinessForm.SupplierCertId)
+            _this.BusinessForm.SubClassId = parseInt(val.Id)
+            _this.BusinessForm.Code = val.Code
+            _this.BusinessForm.Name = val.Name
+            _this.basicDialog = false
+          })
+          .catch(err => {
+            console.error(err)
+          })
       },
 
+
       handleSizeChange (value) {
         this.size = value
         this.currentPage = 1

+ 3 - 50
src/dashoo.cn/frontend_web/src/components/oilsupplier/goodslist.vue

@@ -531,12 +531,12 @@ export default {
       let val1 = this.$refs.orgmanagetree.getCheckedNodes()
       let val2 = this.$refs.secmanagetree.getCheckedNodes()
       this.checkList = []
-      for (var i = 0; i < val1.length; i++) {
+      for (let i = 0; i < val1.length; i++) {
         if (val1[i].Code.length == 8) {
           this.checkList.push(val1[i])
         }
       }
-      for (var i = 0; i < val2.length; i++) {
+      for (let i = 0; i < val2.length; i++) {
         if (val2[i].Code.length == 8) {
           this.checkList.push(val2[i])
         }
@@ -544,53 +544,6 @@ export default {
       this.addBusiness()
       this.switchstatus = false
     },
-    addBusiness1 () {
-      if (this.sectionCert.length <= 0) {
-        this.$message({
-          type: 'warning',
-          message: '请选择准入类别'
-        })
-        return
-      }
-      let params = {
-        SupplierId: parseInt(this.SupplierId),
-        SupplierCertId: parseInt(this.SupplierCertId),
-        SupplierTypeCode: '01',
-        Type: '1',
-        CertSubStatus: '-1',
-        IsManufacturer: 2,
-        Remark: this.Remark1,
-        CheckList: this.sectionCert
-      }
-      for (var i = 0; i < this.sectionCert.length; i++) {
-        this.sectionCert[i].Id = this.sectionCert[i].Id + ''
-      }
-      this.loading = true
-      this.$axios.post('/suppliercertsub/addgoodsbus', params)
-        .then(res => {
-          if (res.data.code === 0) {
-            this.$message({
-              type: 'success',
-              message: res.data.message
-            })
-            this.goodsDialog = false
-            this.loading = false
-            this.sectionCert = []
-            this.Remark1 = ''
-            this.initData()
-            this.initData2019()
-          } else {
-            this.loading = false
-            this.$message({
-              type: 'warning',
-              message: '操作失败!'
-            })
-          }
-        })
-        .catch(err => {
-          console.error(err)
-        })
-    },
     addBusiness () {
       let _this = this
       let params = {
@@ -614,7 +567,7 @@ export default {
         return
       }
       _this.loading = true
-        _this.$axios.post('/suppliercertsub/addgoodsbus', params)
+        _this.$axios.post('/suppliercertsub/add-goods-certsub-filter', params)
         .then(res => {
           if (res.data.code === 0) {
             _this.$message({

+ 3 - 55
src/dashoo.cn/frontend_web/src/components/oilsupplier/goodslist2.vue

@@ -8,7 +8,7 @@
           <el-button type="primary" size="mini" style="float: right;margin-left: 25px" @click="commitAudit()"
                      v-if="canadd && IsCompanyUser == 0">
           提交审批
-        </el-button>
+          </el-button>
           <el-button style="float: right; padding: 3px 0px;"
                      type="text"
                      @click="deletedata()"
@@ -271,13 +271,6 @@
                    :disabled="lostTableData && lostTableData.length > 0"
                    @click="getChecklist()">确 定</el-button>
       </div>
-      <!--<div slot="footer"-->
-      <!--class="dialog-footer"-->
-      <!--v-if="tabIdx==2">-->
-      <!--<el-button type="primary"-->
-      <!--size="mini"-->
-      <!--@click="addBusiness1()">确 定</el-button>-->
-      <!--</div>-->
     </el-dialog>
   </div>
 </template>
@@ -565,53 +558,6 @@
         this.addBusiness()
         this.switchstatus = false
       },
-      addBusiness1 () {
-        if (this.sectionCert.length <= 0) {
-          this.$message({
-            type: 'warning',
-            message: '请选择准入类别'
-          })
-          return
-        }
-        let params = {
-          SupplierId: parseInt(this.SupplierId),
-          SupplierCertId: parseInt(this.SupplierCertId),
-          SupplierTypeCode: '01',
-          Type: '1',
-          CertSubStatus: '-1',
-          IsManufacturer: 2,
-          Remark: this.Remark1,
-          CheckList: this.sectionCert
-        }
-        for (var i = 0; i < this.sectionCert.length; i++) {
-          this.sectionCert[i].Id = this.sectionCert[i].Id + ''
-        }
-        this.loading = true
-        this.$axios.post('/suppliercertsub/addgoodsbus', params)
-          .then(res => {
-            if (res.data.code === 0) {
-              this.$message({
-                type: 'success',
-                message: res.data.message
-              })
-              this.goodsDialog = false
-              this.loading = false
-              this.sectionCert = []
-              this.Remark1 = ''
-              this.initData()
-              this.initData2019()
-            } else {
-              this.loading = false
-              this.$message({
-                type: 'warning',
-                message: '操作失败!'
-              })
-            }
-          })
-          .catch(err => {
-            console.error(err)
-          })
-      },
       addBusiness () {
         let _this = this
         let params = {
@@ -720,6 +666,8 @@
       showDialog () {
         // this.getorgtreelist()
         this.goodsDialog = true
+        this.CheckList = []
+        this.lostTableData = []
       },
       getsectreelist () {
         let _this = this

+ 105 - 11
src/dashoo.cn/frontend_web/src/components/oilsupplier/techlist.vue

@@ -4,10 +4,10 @@
       <div slot="header" class="clearfix">
         <span style="font-weight: bold">准入范围</span>
         <span style="float: right;">
-           <el-button style="float: right; padding: 3px 0px" type="text" @click="deletedata()" v-if="candelete">删除</el-button>
-          <el-button style="float: right; padding: 3px 25px" type="text" @click="showDialog" v-if="canadd || newcanadd">添加
-
-          </el-button>
+          <el-button type="primary" size="mini" style="float: right;margin-left: 25px" @click="commitAudit()"
+                     v-if="canadd && IsCompanyUser == 0">提交审批</el-button>
+          <el-button style="float: right; padding: 3px 0px" type="text" @click="deletedata()" v-if="candelete">删除</el-button>
+          <el-button style="float: right; padding: 3px 25px" type="text" @click="showDialog" v-if="canadd || newcanadd">添加</el-button>
         </span>
       </div>
       <el-table :data="techList" border height="calc(100vh - 435px)" size="mini" @selection-change="handleSelectionChange">
@@ -42,19 +42,45 @@
       </el-pagination>
     </el-card>
 
-    <el-dialog v-loading="loading" element-loading-text="正在添加请稍后..." title="服务类业务列表" :visible.sync="techDialog" top="5vh">
+    <el-dialog element-loading-text="正在添加请稍后..." title="服务类业务列表" :visible.sync="techDialog" top="5vh">
       <el-row style="margin-top: -10px">
         <el-col :span="12">
           <el-input v-model="keyword" placeholder="请输入名称或代码" size="mini" style="width: 250px;"></el-input>
           <el-button style="float: right;" type="primary" size="mini" @click="getorgtreelist()">查询</el-button>
         </el-col>
       </el-row>
-      <el-row :gutter="20" style="height: calc(100vh - 450px); overflow: auto; margin-top:20px">
-        <el-col :span="20">
+      <el-row :gutter="20">
+        <el-col :span="14">
           <el-tree highlight-current :expand-on-click-node="true" node-key="CodeName" :data="orgtreelist"
-            :props="orgtreeprops" ref="orgmanagetree" show-checkbox>
+            :props="orgtreeprops" style="margin-top: 20px; height: calc(100vh - 450px); overflow: auto;"
+            @check="checkLostCertTimeOut" ref="orgmanagetree" show-checkbox>
           </el-tree>
         </el-col>
+        <el-col :span="10">
+          <el-table
+            height="370px"
+            row-class-name="warning-row"
+            highlight-current-row
+            :data="lostTableData"
+            border
+            size="mini"
+            style="width: 100%; margin-top:20px">
+            <el-table-column
+              prop="Code"
+              label="准入编码">
+              <template slot-scope="scope">
+                {{scope.row.Code + ' ' + scope.row.Name}}
+              </template>
+            </el-table-column>
+            <el-table-column
+              prop="CertFileName"
+              label="缺少资质">
+              <template slot="header" slot-scope="scope">
+                <span style="color: red">{{'缺少资质(' + (lostTableData ? lostTableData.length : 0) + ')'}}</span>
+              </template>
+            </el-table-column>
+          </el-table>
+        </el-col>
       </el-row>
       <el-row style="margin-top: 30px">
         备注信息:
@@ -64,7 +90,9 @@
       </el-row>
       <div slot="footer" class="dialog-footer">
         <!--<el-button size="mini" @click="visible = false">取 消</el-button>-->
-        <el-button type="primary" size="mini" @click="getChecklist()">确 定</el-button>
+        <el-button type="primary" size="mini" :loading="loading"
+                   :disabled="lostTableData && lostTableData.length > 0"
+                   @click="getChecklist()">确 定</el-button>
       </div>
     </el-dialog>
   </div>
@@ -92,6 +120,15 @@
         default: false
       }
     },
+    computed: {
+      ...mapGetters({
+        session: 'session',
+        authUser: 'authUser'
+      })
+    },
+    created () {
+      this.IsCompanyUser = this.authUser.Profile.IsCompanyUser
+    },
     /* created() {
       this.initData()
     },
@@ -103,6 +140,7 @@
     data () {
       return {
         loading: false,
+        IsCompanyUser: '',
         Ids: [],
         SupplierId: 0,
         SupplierTypeCode: '',
@@ -125,6 +163,7 @@
         currentPage: 1, // 分页
         size: 10,
         currentItemCount: 0,
+        lostTableData: [],
         flagId: 0 // 标记是否第一次点击
       }
     },
@@ -152,6 +191,9 @@
         } else {
         }
       },
+      commitAudit () {
+        this.$emit('commitAudit')
+      },
       handleSelectionChange (val) {
         this.Ids = []
         for (var i = 0; i < val.length; i++) {
@@ -184,6 +226,51 @@
             console.error(err)
           })
       },
+      checkLostCertTimeOut () {
+        let _this = this
+        this.loading = true
+        setTimeout(function () {
+          _this.$nextTick(() => {
+            _this.checkLostCert()
+          })
+        }, 100)
+      },
+      checkLostCert () {
+        let _this = this
+        let params = {
+          SupplierId: parseInt(_this.SupplierId),
+          SupplierCertId: parseInt(_this.SupplierCertId),
+          SupplierTypeCode: '03',
+          Type: '1',
+          CertSubStatus: '-1',
+          Remark: _this.Remark
+        }
+
+        let val = this.$refs.orgmanagetree.getCheckedNodes()
+        this.checkList = []
+        for (var i = 0; i < val.length; i++) {
+          if (!val[i].children || val[i].children.length <= 0) {
+            this.checkList.push(val[i])
+          }
+        }
+        if (_this.checkList.length > 0) {
+          params = Object.assign(params, {
+            CheckList: _this.checkList
+          })
+        } else {
+          _this.lostTableData = []
+          this.loading = false
+          return
+        }
+        _this.$axios.post('/suppliercertsub/tech-cert-lost', params).then(res => {
+          _this.lostTableData = res.data
+          this.loading = false
+        }).catch(err => {
+          this.loading = false
+          console.error(err)
+        })
+
+      },
       getChecklist () {
         let val = this.$refs.orgmanagetree.getCheckedNodes()
         this.checkList = []
@@ -296,6 +383,8 @@
       showDialog () {
         this.getorgtreelist()
         this.techDialog = true
+        this.CheckList = []
+        this.lostTableData = []
       },
       getorgtreelist () {
         let _this = this
@@ -327,6 +416,11 @@
 </script>
 
 <style>
-
-
+  .el-pagination {
+    margin: 1rem 0 2rem;
+    text-align: right;
+  }
+  .el-table .warning-row {
+    background: oldlace;
+  }
 </style>

+ 7 - 1
src/dashoo.cn/frontend_web/src/pages/oilsupplier/supplier/_opera/basisedit.vue

@@ -314,6 +314,7 @@
                          @close="getbuslist"
                          :canadd="add_flat"
                          :candelete="delete_flat"
+                         @commitAudit="commitAudit"
                          height="360px"
                          style="margin-top: 20px"></business-list>
         </el-tab-pane>
@@ -1515,10 +1516,12 @@ export default {
     },
     getFirAuditerByDept () {
       let deptid = this.authUser.Profile.DepartmentId
+      if (!deptid) {
+        return false
+      }
       this.userOptions = []
       let auditstepcode = 'FIRST_TRIAL' // 初审人
       api.getFirAuditerByDept(deptid, auditstepcode, this.$axios).then(res => {
-        console.log(res)
         this.firOptions = res.data.item
       }).catch(err => {
         console.error(err)
@@ -1537,6 +1540,9 @@ export default {
       this.$refs['chooseAuditor'].getorgtreelist(this.formData.SupplierTypeCode)
       this.chooseAuditorVisible = true
     },
+    commitAudit () {
+      this.$refs['subfileList'].nextStep()
+    },
     setAuditer (val, name) {
       this.auditer = val
       this.auditerName = name

+ 0 - 1
src/dashoo.cn/frontend_web/src/pages/oilsupplier/supplier/_opera/goodsedit.vue

@@ -574,7 +574,6 @@ export default {
   name: 'goodsEdit',
   created () {
     if (this.$route.query.showcy) {
-      debugger
       this.showcy = true
     }
   },

+ 67 - 62
src/dashoo.cn/frontend_web/src/pages/oilsupplier/supplier/_opera/techedit.vue

@@ -313,6 +313,7 @@
                      :canadd="add_flat"
                      :candelete="delete_flat"
                      height="360px"
+                     @commitAudit="commitAudit"
                      style="margin-top: 20px"></tech-list>
         </el-tab-pane>
 
@@ -1150,71 +1151,72 @@ export default {
     initDatas () {
       if (this.formData.Id) {
         this.isCanUpdateSupplier(this.formData.Id)
-        api.getEntityAndCert(this.certId, this.$axios).then(res => {
-          this.formData = res.data
-          this.formDataCert.WorkerTotal = this.formData.WorkerTotal
-          this.WorkerTotal = this.formData.WorkerTotal
-          this.formDataCert.ContractNum = this.formData.ContractNum
-          this.formDataCert.UniversityNum = this.formData.UniversityNum
-          this.formDataCert.TechnicalNum = this.formData.TechnicalNum
-          this.formDataCert.AboveProfNum = this.formData.AboveProfNum
-          this.formDataCert.MiddleProfNum = this.formData.MiddleProfNum
-          this.formDataCert.NationalRegNum = this.formData.NationalRegNum
-          this.formDataCert.NationalCertTotal = this.formData.NationalCertTotal
-          this.formDataCert.DesignerTotal = this.formData.DesignerTotal
-          this.formDataCert.SkillerTotal = this.formData.SkillerTotal
-          this.formDataCert.Status = this.formData.Status
-          this.formDataCert.WorkflowId = this.formData.WorkflowId
-          this.formDataCert.InStyle = this.formData.InStyle
-          if (this.formData.Status > 0 || this.formData.Status == -5) {
-            this.add_flat = false
-          }
-          if ((this.formData.Status > 0) && (this.formData.Status != 4)) {
-            this.delete_flat = false
-          }
-          if ((this.formData.Status > 0) && (this.authUser.Profile.IsCompanyUser == 1)) {
-            this.delete_flat = false
-          }
-          if (this.formData.CredentialFlag != '') {
-            this.$refs['TechInfo'].showorhid(this.formData.CredentialFlag)
-          }
-          this.formDataCert.WorkflowId = this.formData.WorkflowId
-          this.$refs['TechInfo'].CityAry = []
-          this.$refs['TechInfo'].CityAry.push(this.formData.Province)
-          this.$refs['TechInfo'].CityAry.push(this.formData.City)
-          this.$refs['TechInfo'].CityAry.push(this.formData.Street)
-          this.$refs['TechInfo'].LinkCityAry = []
-          this.$refs['TechInfo'].LinkCityAry.push(this.formData.LinkProvince)
-          this.$refs['TechInfo'].LinkCityAry.push(this.formData.LinkCity)
-          this.$refs['TechInfo'].LinkCityAry.push(this.formData.LinkStreet)
-          /* this.$refs["TechInfo"].UnitRelationAry = []
+        this.$nextTick(() => {
+          api.getEntityAndCert(this.certId, this.$axios).then(res => {
+            this.formData = res.data
+            this.formDataCert.WorkerTotal = this.formData.WorkerTotal
+            this.WorkerTotal = this.formData.WorkerTotal
+            this.formDataCert.ContractNum = this.formData.ContractNum
+            this.formDataCert.UniversityNum = this.formData.UniversityNum
+            this.formDataCert.TechnicalNum = this.formData.TechnicalNum
+            this.formDataCert.AboveProfNum = this.formData.AboveProfNum
+            this.formDataCert.MiddleProfNum = this.formData.MiddleProfNum
+            this.formDataCert.NationalRegNum = this.formData.NationalRegNum
+            this.formDataCert.NationalCertTotal = this.formData.NationalCertTotal
+            this.formDataCert.DesignerTotal = this.formData.DesignerTotal
+            this.formDataCert.SkillerTotal = this.formData.SkillerTotal
+            this.formDataCert.Status = this.formData.Status
+            this.formDataCert.WorkflowId = this.formData.WorkflowId
+            this.formDataCert.InStyle = this.formData.InStyle
+            if (this.formData.Status > 0 || this.formData.Status == -5) {
+              this.add_flat = false
+            }
+            if ((this.formData.Status > 0) && (this.formData.Status != 4)) {
+              this.delete_flat = false
+            }
+            if ((this.formData.Status > 0) && (this.authUser.Profile.IsCompanyUser == 1)) {
+              this.delete_flat = false
+            }
+            if (this.formData.CredentialFlag != '') {
+              this.$refs['TechInfo'].showorhid(this.formData.CredentialFlag)
+            }
+            this.formDataCert.WorkflowId = this.formData.WorkflowId
+            this.$refs['TechInfo'].CityAry = []
+            this.$refs['TechInfo'].CityAry.push(this.formData.Province)
+            this.$refs['TechInfo'].CityAry.push(this.formData.City)
+            this.$refs['TechInfo'].CityAry.push(this.formData.Street)
+            this.$refs['TechInfo'].LinkCityAry = []
+            this.$refs['TechInfo'].LinkCityAry.push(this.formData.LinkProvince)
+            this.$refs['TechInfo'].LinkCityAry.push(this.formData.LinkCity)
+            this.$refs['TechInfo'].LinkCityAry.push(this.formData.LinkStreet)
+            /* this.$refs["TechInfo"].UnitRelationAry = []
 
-          if (this.formData.SpecTypeCode.length > 0) {
-            this.$refs['TechInfo'].UnitRelationAry = this.formData.SpecTypeCode.split(',')
-          } */
+            if (this.formData.SpecTypeCode.length > 0) {
+              this.$refs['TechInfo'].UnitRelationAry = this.formData.SpecTypeCode.split(',')
+            } */
 
-          this.entrydetail.business = this.certId
-          this.entrydetail.instance = this.formDataCert.WorkflowId
-          this.entrydetail.process = this.formData.ProcessKey
-          this.backhistroy.certId = this.certId
-          this.backhistroy.workflowId = this.formDataCert.WorkflowId
-          /* if (this.certId && this.formDataCert.WorkflowId) {
-            this.$refs['WfHistory'].getHistoryTask() /!* 刷新工作流 *!/
-          } */
-          this.$refs['equipmentList'].getvalue(this.formData.Id, this.formData.SupplierTypeCode, this.certId)
-          this.$refs['performanceList'].getvalue(this.formData.Id, this.formData.SupplierTypeCode, this.certId)
-          this.$refs['patentList'].getvalue(this.formData.Id, this.formData.SupplierTypeCode, this.certId)
-          this.$refs['winningList'].getvalue(this.formData.Id, this.formData.SupplierTypeCode, this.certId)
-          this.$refs['techList'].getvalue(this.formData.Id, this.formData.SupplierTypeCode, this.certId)
-          this.$refs['subfileList'].getvalue(this.formData.Id, this.formData.SupplierTypeCode, this.certId, this
-            .formDataCert.InStyle)
+            this.entrydetail.business = this.certId
+            this.entrydetail.instance = this.formDataCert.WorkflowId
+            this.entrydetail.process = this.formData.ProcessKey
+            this.backhistroy.certId = this.certId
+            this.backhistroy.workflowId = this.formDataCert.WorkflowId
+            /* if (this.certId && this.formDataCert.WorkflowId) {
+              this.$refs['WfHistory'].getHistoryTask() /!* 刷新工作流 *!/
+            } */
+            this.$refs['equipmentList'].getvalue(this.formData.Id, this.formData.SupplierTypeCode, this.certId)
+            this.$refs['performanceList'].getvalue(this.formData.Id, this.formData.SupplierTypeCode, this.certId)
+            this.$refs['patentList'].getvalue(this.formData.Id, this.formData.SupplierTypeCode, this.certId)
+            this.$refs['winningList'].getvalue(this.formData.Id, this.formData.SupplierTypeCode, this.certId)
+            this.$refs['techList'].getvalue(this.formData.Id, this.formData.SupplierTypeCode, this.certId)
+            this.$refs['subfileList'].getvalue(this.formData.Id, this.formData.SupplierTypeCode, this.certId, this
+              .formDataCert.InStyle)
 
-          this.$refs['usednameselectIndex'].getvalue()
-          if (this.formData.InStyle == '2' || this.formData.InStyle == '6' || this.formData.InStyle == '4') {
-            this.allowpre = false
-          }
-        }).catch(err => {
-          console.error(err)
+            if (this.formData.InStyle == '2' || this.formData.InStyle == '6' || this.formData.InStyle == '4') {
+              this.allowpre = false
+            }
+          }).catch(err => {
+            console.error(err)
+          })
         })
       }
     },
@@ -1540,6 +1542,9 @@ export default {
       this.$refs['chooseAuditor'].getorgtreelist(this.formData.SupplierTypeCode)
       this.chooseAuditorVisible = true
     },
+    commitAudit () {
+      this.$refs['subfileList'].nextStep()
+    },
     setAuditer (val, name) {
       this.auditer = val
       this.auditerName = name

+ 48 - 45
src/dashoo.cn/frontend_web/src/pages/oilsupplier/suppliernopass/_opera/basisedit.vue

@@ -593,52 +593,55 @@
       initDatas () {
         this.isCanUpdateSupplier(this.formData.Id)
         if (this.formData.Id) {
-          api.getEntityAndCert(this.certId, this.$axios).then(res => {
-            this.formData = res.data
-            this.formDataCert.WorkerTotal = this.formData.WorkerTotal
-            this.formDataCert.ContractNum = this.formData.ContractNum
-            this.formDataCert.UniversityNum = this.formData.UniversityNum
-            this.formDataCert.TechnicalNum = this.formData.TechnicalNum
-            this.formDataCert.AboveProfNum = this.formData.AboveProfNum
-            this.formDataCert.MiddleProfNum = this.formData.MiddleProfNum
-            this.formDataCert.NationalRegNum = this.formData.NationalRegNum
-            this.formDataCert.NationalCertTotal = this.formData.NationalCertTotal
-            this.formDataCert.DesignerTotal = this.formData.DesignerTotal
-            this.formDataCert.SkillerTotal = this.formData.SkillerTotal
-            this.formDataCert.Status = this.formData.Status
-            this.formDataCert.WorkflowId = this.formData.WorkflowId
-            if (this.formData.Status != 0) {
-              this.add_flat = false
-            }
-            this.$refs['BasisInfo'].CityAry = []
-            this.$refs['BasisInfo'].CityAry.push(this.formData.Province)
-            this.$refs['BasisInfo'].CityAry.push(this.formData.City)
-            this.$refs['BasisInfo'].CityAry.push(this.formData.Street)
-            this.$refs['BasisInfo'].LinkCityAry = []
-            this.$refs['BasisInfo'].LinkCityAry.push(this.formData.LinkProvince)
-            this.$refs['BasisInfo'].LinkCityAry.push(this.formData.LinkCity)
-            this.$refs['BasisInfo'].LinkCityAry.push(this.formData.LinkStreet)
-            /* this.$refs['BasisInfo'].UnitRelationAry = []
-            if (this.formData.SpecTypeCode.length > 0) {
-              this.$refs['BasisInfo'].UnitRelationAry = this.formData.SpecTypeCode.split(',')
-            } */
-
-            this.entrydetail.business = this.certId
-            this.entrydetail.instance = this.formDataCert.WorkflowId
-            this.backhistroy.certId = this.certId
-            this.backhistroy.workflowId = this.formDataCert.WorkflowId
-            if (this.certId && this.formDataCert.WorkflowId) {
-              // this.$refs['WfHistory'].getHistoryTask() /* 刷新工作流 */
-            }
-            this.$refs['equipmentList'].getvalue(this.formData.Id, this.formData.SupplierTypeCode, this.certId)
-            this.$refs['performanceList'].getvalue(this.formData.Id, this.formData.SupplierTypeCode, this.certId)
-            this.$refs['patentList'].getvalue(this.formData.Id, this.formData.SupplierTypeCode, this.certId)
-            this.$refs['winningList'].getvalue(this.formData.Id, this.formData.SupplierTypeCode, this.certId)
-            this.$refs['businessList'].getvalue(this.formData.Id, this.formData.SupplierTypeCode, this.certId)
-            this.$refs['subfileList'].getvalue(this.formData.Id, this.formData.SupplierTypeCode, this.certId)
-          }).catch(err => {
-            console.error(err)
+          this.$nextTick(() => {
+            api.getEntityAndCert(this.certId, this.$axios).then(res => {
+              this.formData = res.data
+              this.formDataCert.WorkerTotal = this.formData.WorkerTotal
+              this.formDataCert.ContractNum = this.formData.ContractNum
+              this.formDataCert.UniversityNum = this.formData.UniversityNum
+              this.formDataCert.TechnicalNum = this.formData.TechnicalNum
+              this.formDataCert.AboveProfNum = this.formData.AboveProfNum
+              this.formDataCert.MiddleProfNum = this.formData.MiddleProfNum
+              this.formDataCert.NationalRegNum = this.formData.NationalRegNum
+              this.formDataCert.NationalCertTotal = this.formData.NationalCertTotal
+              this.formDataCert.DesignerTotal = this.formData.DesignerTotal
+              this.formDataCert.SkillerTotal = this.formData.SkillerTotal
+              this.formDataCert.Status = this.formData.Status
+              this.formDataCert.WorkflowId = this.formData.WorkflowId
+              if (this.formData.Status != 0) {
+                this.add_flat = false
+              }
+              this.$refs['BasisInfo'].CityAry = []
+              this.$refs['BasisInfo'].CityAry.push(this.formData.Province)
+              this.$refs['BasisInfo'].CityAry.push(this.formData.City)
+              this.$refs['BasisInfo'].CityAry.push(this.formData.Street)
+              this.$refs['BasisInfo'].LinkCityAry = []
+              this.$refs['BasisInfo'].LinkCityAry.push(this.formData.LinkProvince)
+              this.$refs['BasisInfo'].LinkCityAry.push(this.formData.LinkCity)
+              this.$refs['BasisInfo'].LinkCityAry.push(this.formData.LinkStreet)
+              /* this.$refs['BasisInfo'].UnitRelationAry = []
+              if (this.formData.SpecTypeCode.length > 0) {
+                this.$refs['BasisInfo'].UnitRelationAry = this.formData.SpecTypeCode.split(',')
+              } */
+
+              this.entrydetail.business = this.certId
+              this.entrydetail.instance = this.formDataCert.WorkflowId
+              this.backhistroy.certId = this.certId
+              this.backhistroy.workflowId = this.formDataCert.WorkflowId
+              if (this.certId && this.formDataCert.WorkflowId) {
+                // this.$refs['WfHistory'].getHistoryTask() /* 刷新工作流 */
+              }
+              this.$refs['equipmentList'].getvalue(this.formData.Id, this.formData.SupplierTypeCode, this.certId)
+              this.$refs['performanceList'].getvalue(this.formData.Id, this.formData.SupplierTypeCode, this.certId)
+              this.$refs['patentList'].getvalue(this.formData.Id, this.formData.SupplierTypeCode, this.certId)
+              this.$refs['winningList'].getvalue(this.formData.Id, this.formData.SupplierTypeCode, this.certId)
+              this.$refs['businessList'].getvalue(this.formData.Id, this.formData.SupplierTypeCode, this.certId)
+              this.$refs['subfileList'].getvalue(this.formData.Id, this.formData.SupplierTypeCode, this.certId)
+            }).catch(err => {
+              console.error(err)
+            })
           })
+
         }
       },
       getbuslist () {