Ver Fonte

BF: 添加资质提示

yuedefeng há 5 anos atrás
pai
commit
1d1ca90fd2

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

@@ -453,17 +453,17 @@ func (this *OilSupplierCertSubController) AddGoodsByFilter() {
 	// 查询出已有哪些资质
 	supplierId := dataother.SupplierId
 	supplierTypeCode := dataother.SupplierTypeCode
-	var tableheaderList []tableheader.BaseTableheader
+	var tableheaderList []supplierfile.OilSupplierFile
 
-	fileSql := "SELECT b.* from OilSupplierFile a LEFT JOIN Base_TableHeader b on a.NeedFileType=b.Name AND "
-	fileSql += " a.SupplierTypeCode=b.CategoryCode WHERE a.SupplierId='" + strconv.Itoa(supplierId) + "'"
-	fileSql += " AND (a.SupplierTypeCode='" + supplierTypeCode + "' or a.SupplierTypeCode='000')"
+	fileSql := "SELECT * from OilSupplierFile WHERE SupplierId='" + strconv.Itoa(supplierId) + "'"
+	fileSql += " AND (SupplierTypeCode='" + supplierTypeCode + "' or SupplierTypeCode='000')"
 
 	svcHeader := tableheader.GetTableHeaderService(utils.DBE)
 	svcHeader.DBE.SQL(fileSql).Find(&tableheaderList)
+
 	var companyHasHeaders string
 	for _, tableheader := range tableheaderList {
-		companyHasHeaders += tableheader.Name + ","
+		companyHasHeaders += tableheader.NeedFileType + ","
 	}
 	var supplierModel supplier.OilSupplier
 	svcSupplier := supplier.GetOilSupplierService(utils.DBE)
@@ -1061,16 +1061,29 @@ func (this *OilSupplierCertSubController) UpdateStatus() {
 // @Description
 // @router /modify-manufacturer/:id [post]
 func (this *OilSupplierCertSubController) SetManufacturer() {
-	certSubId, error := strconv.Atoi(this.Ctx.Input.Param(":id"))
+	// certSubId, error := strconv.Atoi(this.Ctx.Input.Param(":id"))
+	certSubId := this.Ctx.Input.Param(":id")
 
 	var manufacturerChangeDTO suppliercertsub.ManufacturerChangeDTO
 	var jsonblob = this.Ctx.Input.RequestBody
 	json.Unmarshal(jsonblob, &manufacturerChangeDTO)
 
+	/**
 	manufacturerChangeDTO.CertSubIdList = [] int{certSubId}
 	invalidCertMsg := setManufacturerHandler(manufacturerChangeDTO)
+	*/
+	svc := suppliercertsub.GetOilSupplierCertSubService(utils.DBE)
+	strIsManufacturer := strconv.Itoa(manufacturerChangeDTO.IsManufacturer)
+	sqlStr := "update OilSupplierCertSub set IsManufacturer='" + strIsManufacturer + "' where Id='" + certSubId + "'"
+	svc.DBE.Exec(sqlStr)
 
 	var errinfo ErrorDataInfo
+	errinfo.Message = "修改成功!"
+	errinfo.Code = 0
+	this.Data["json"] = &errinfo
+	this.ServeJSON()
+
+	/*var errinfo ErrorDataInfo
 	if error == nil && invalidCertMsg == "" {
 		errinfo.Message = "修改成功!"
 		errinfo.Code = 0
@@ -1081,7 +1094,7 @@ func (this *OilSupplierCertSubController) SetManufacturer() {
 		errinfo.Code = -1
 		this.Data["json"] = &errinfo
 		this.ServeJSON()
-	}
+	}*/
 }
 
 // @Title 批量修改是否为供应商

+ 2 - 1
src/dashoo.cn/frontend_web/src/components/oilsupplier/subfilelist.vue

@@ -592,7 +592,8 @@
               }
             }
           }
-          if ((this.isInvestigate) && (this.InStyle != '2') && (this.OperType == '代理商')) {
+          if ((this.isInvestigate) && (this.InStyle != '2')) { // (this.OperType == '代理商')
+            // 准入方式除“一级”以外的选项都需要上传现场考察报告
             if (this.scenefile.Id == '' || this.scenefile.Id == '0') {
               this.$message({
                 type: 'warning',

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

@@ -1430,6 +1430,7 @@ export default {
         }
         this.UnitOrgOptions = list;
         this.allorgunitOptions = res.data.items['Allunitorglist']
+        // 系统参数设置: 是否需要现场考察报告
         this.isInvestigate = res.data.items['isInvestigate'] === 'true'
         this.orgunitChange(this.UnitOrg)
         // this.auditerOptions = res.data.items['Auditer']