Ver Fonte

批量添加物资类准入范围

shihang há 6 anos atrás
pai
commit
02a3b4c323

+ 3 - 2
src/dashoo.cn/backend/api/business/oilsupplier/goodsaptitude/oilgoodsaptitude.go

@@ -85,12 +85,13 @@ type GoodsBusiness struct {
 	Id                int
 	Code              string
 	Name              string
+	CodeName          string
 	ParentId          int
 	Remark            string
 	DeletionStateCode int
 }
 
 type OrganizeSet struct {
-	ClassId        int
-	OrganizeIds    []string
+	ClassId     int
+	OrganizeIds []string
 }

+ 15 - 1
src/dashoo.cn/backend/api/business/oilsupplier/goodsaptitude/oilgoodsaptitudeService.go

@@ -1,10 +1,12 @@
 package goodsaptitude
 
 import (
+	"strconv"
+
 	. "dashoo.cn/backend/api/mydb"
+	"dashoo.cn/utils"
 	. "dashoo.cn/utils/db"
 	"github.com/go-xorm/xorm"
-	"strconv"
 )
 
 type OilGoodsAptitudeService struct {
@@ -51,3 +53,15 @@ func (s *OilGoodsAptitudeService) GetMyPagingEntitiesWithOrderBytbl(tableName st
 	}
 	return total
 }
+
+func (s *OilGoodsAptitudeService) GetGoodsList(goodsclass, where string) []GoodsBusiness {
+	if where == "" {
+		where = " 1=1 "
+	}
+	var sql string
+	sql = `select Id, Code, Name, concat(Code, '  ', Name) as CodeName, ParentId, Remark, DeletionStateCode  
+	from ` + goodsclass + ` where ` + where + `  order by Code asc `
+	List := make([]GoodsBusiness, 0)
+	utils.DBE.Sql(sql).Find(&List)
+	return List
+}

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

@@ -5,7 +5,7 @@ import (
 )
 
 type OilSupplierCertSub struct {
-	Id               int       `xorm:"not null pk autoincr INT(10)"`
+	Id               int       `xorm:<- not null pk autoincr INT(10)"`
 	SupplierId       int       `xorm:"not null comment('供方基本信息表主键') INT(10)"`
 	SupplierCertId   int       `xorm:"not null comment('供方准入证书信息表主键') INT(10)"`
 	SupplierTypeCode string    `xorm:"not null default '' comment('准入类别代码') VARCHAR(5)"`
@@ -21,6 +21,24 @@ type OilSupplierCertSub struct {
 	ModifiedUserId   int       `xorm:"INT(10)"`
 	ModifiedBy       string    `xorm:"VARCHAR(50)"`
 }
+type goodsChecked struct {
+	Id       string `json:"id"`
+	Code     string
+	Name     string
+	CodeName string
+}
+type SupplierCertSubModel struct {
+	CheckList        []goodsChecked //批量添加准入范围
+	Id               int            `xorm:"<- not null pk autoincr INT(10)"`
+	SupplierId       int
+	SupplierCertId   int
+	SupplierTypeCode string
+	SubClassId       int
+	Code             string
+	Name             string
+	Remark           string
+	IsDelete         int
+}
 
 type OilSupplierCertAppendSub struct {
 	Id             int       `xorm:"not null pk autoincr INT(10)"`

+ 31 - 64
src/dashoo.cn/backend/api/business/oilsupplier/supplierfile/supplierfileService.go

@@ -28,21 +28,21 @@ func GetSupplierfileService(xormEngine *xorm.Engine) *SupplierfileService {
 	return s
 }
 
-func (s *SupplierfileService) GetGoodsNeedFileList(classid int) (needList []FileList) {
+func (s *SupplierfileService) GetGoodsNeedFileList(classid string) (needList []FileList) {
 	var entity goodsaptitude.OilGoodsAptitude
-	sql := "select * from OilGoodsAptitude where ClassId = '" + strconv.Itoa(classid) + "'"
+	sql := "select * from OilGoodsAptitude where ClassId = '" + classid + "'"
 	s.DBE.Sql(sql).Get(&entity)
 	if entity.F01 == "1" {
 		needList = append(needList, FileList{FileName: "营业执照"})
 	}
 	if entity.F02 == "1" {
-		needList = append(needList, FileList{FileName: "组织机构代码"})
+		needList = append(needList, FileList{FileName: "组织代码"})
 	}
 	if entity.F03 == "1" {
-		needList = append(needList, FileList{FileName: "税务登记"})
+		needList = append(needList, FileList{FileName: "税务登记"})
 	}
 	if entity.F04 == "1" {
-		needList = append(needList, FileList{FileName: "银行开户许可"})
+		needList = append(needList, FileList{FileName: "开户许可"})
 	}
 	if entity.F05 == "1" {
 		needList = append(needList, FileList{FileName: "质量管理体系认证证书"})
@@ -54,122 +54,89 @@ func (s *SupplierfileService) GetGoodsNeedFileList(classid int) (needList []File
 		needList = append(needList, FileList{FileName: "职业健康安全管理体系认证证书"})
 	}
 	if entity.F08 == "1" {
-		needList = append(needList, FileList{FileName: "软件企业认定证书"})
+		needList = append(needList, FileList{FileName: "代理授权证书(代理商)"})
 	}
 	if entity.F09 == "1" {
 		needList = append(needList, FileList{FileName: "安全生产许可证"})
 	}
 	if entity.F10 == "1" {
-		needList = append(needList, FileList{FileName: "陆上石油天然气安全生产许可证"})
+		needList = append(needList, FileList{FileName: "特种劳动防护用品生产经营许可证"})
 	}
 	if entity.F11 == "1" {
-		needList = append(needList, FileList{FileName: "海洋石油作业安全生产许可证"})
+		needList = append(needList, FileList{FileName: "辐射安全许可证"})
 	}
 	if entity.F12 == "1" {
-		needList = append(needList, FileList{FileName: "辐射安全许可证"})
+		needList = append(needList, FileList{FileName: "危险化学品经营许可证"})
 	}
 	if entity.F13 == "1" {
-		needList = append(needList, FileList{FileName: "石油工程技术服务企业资质证书"})
+		needList = append(needList, FileList{FileName: "成品油批发经营批准证书"})
 	}
 	if entity.F14 == "1" {
-		needList = append(needList, FileList{FileName: "物业服务企业资质证书"})
+		needList = append(needList, FileList{FileName: "食品流通许可证"})
 	}
 	if entity.F15 == "1" {
-		needList = append(needList, FileList{FileName: "工业清洗企业资质证书"})
+		needList = append(needList, FileList{FileName: "医疗器械经营企业许可证"})
 	}
 	if entity.F16 == "1" {
-		needList = append(needList, FileList{FileName: "建设项目环境影响评价资格证书"})
+		needList = append(needList, FileList{FileName: "安全生产许可证"})
 	}
 	if entity.F17 == "1" {
-		needList = append(needList, FileList{FileName: "消防设施维护保养资质证书"})
+		needList = append(needList, FileList{FileName: "特种设备制造许可证"})
 	}
 	if entity.F18 == "1" {
-		needList = append(needList, FileList{FileName: "安全评价机构资质证书"})
+		needList = append(needList, FileList{FileName: "全国工业产品生产许可证"})
 	}
 	if entity.F19 == "1" {
-		needList = append(needList, FileList{FileName: "工程咨询招标代理机构资质证书"})
+		needList = append(needList, FileList{FileName: "危险化学品使用许可证"})
 	}
 	if entity.F20 == "1" {
-		needList = append(needList, FileList{FileName: "工程监督资质证书"})
+		needList = append(needList, FileList{FileName: "危险化学品登记证"})
 	}
 	if entity.F21 == "1" {
-		needList = append(needList, FileList{FileName: "土地开发资格证"})
+		needList = append(needList, FileList{FileName: "危险化学品经营许可证"})
 	}
 	if entity.F22 == "1" {
-		needList = append(needList, FileList{FileName: "房屋预售资格证"})
+		needList = append(needList, FileList{FileName: "化学品危险性鉴别与分类报告"})
 	}
 	if entity.F23 == "1" {
-		needList = append(needList, FileList{FileName: "保安服务许可证"})
+		needList = append(needList, FileList{FileName: "中国国家强制性产品认证证书"})
 	}
 	if entity.F24 == "1" {
-		needList = append(needList, FileList{FileName: "道路运输经营许可证"})
+		needList = append(needList, FileList{FileName: "产品型式认可证书"})
 	}
 	if entity.F25 == "1" {
-		needList = append(needList, FileList{FileName: "机动车维修经营许可证"})
+		needList = append(needList, FileList{FileName: "食品生产许可证"})
 	}
 	if entity.F26 == "1" {
-		needList = append(needList, FileList{FileName: "道路危险货物运输许可证"})
+		needList = append(needList, FileList{FileName: "制造计量器具许可证"})
 	}
 	if entity.F27 == "1" {
 		needList = append(needList, FileList{FileName: "特种设备安装改造维修许可证"})
 	}
 	if entity.F28 == "1" {
-		needList = append(needList, FileList{FileName: "建筑安全许可证"})
+		needList = append(needList, FileList{FileName: "中油集团公司产品质量认可证书"})
 	}
 	if entity.F29 == "1" {
-		needList = append(needList, FileList{FileName: "防火许可证"})
+		needList = append(needList, FileList{FileName: "辐射安全许可证"})
 	}
 	if entity.F30 == "1" {
-		needList = append(needList, FileList{FileName: "印刷经营许可证"})
+		needList = append(needList, FileList{FileName: "中国船级社型式认可证书"})
 	}
 	if entity.F31 == "1" {
-		needList = append(needList, FileList{FileName: "餐饮服务许可证"})
+		needList = append(needList, FileList{FileName: "涉及饮用水卫生安全产品卫生许可批件"})
 	}
 	if entity.F32 == "1" {
-		needList = append(needList, FileList{FileName: "劳务派遣经营许可证"})
+		needList = append(needList, FileList{FileName: "成品油批发经营批准证书"})
 	}
 	if entity.F33 == "1" {
-		needList = append(needList, FileList{FileName: "人力资源服务许可证"})
+		needList = append(needList, FileList{FileName: "医疗器械经营许可证"})
 	}
 	if entity.F34 == "1" {
-		needList = append(needList, FileList{FileName: "国家实验室认可证书"})
+		needList = append(needList, FileList{FileName: "节能产品认证证书"})
 	}
 	if entity.F35 == "1" {
-		needList = append(needList, FileList{FileName: "海洋石油专业设备检验检测机构证书"})
-	}
-	if entity.F36 == "1" {
-		needList = append(needList, FileList{FileName: "安全生产检验检测证书"})
-	}
-	if entity.F37 == "1" {
-		needList = append(needList, FileList{FileName: "液化气钢瓶检验证书"})
-	}
-	if entity.F38 == "1" {
-		needList = append(needList, FileList{FileName: "国家电网承试承装承修许可证"})
-	}
-	if entity.F39 == "1" {
-		needList = append(needList, FileList{FileName: "建筑企业资质证书"})
-	}
-	if entity.F40 == "1" {
-		needList = append(needList, FileList{FileName: "中油集团监造许可"})
+		needList = append(needList, FileList{FileName: "预应力件生产许可证"})
 	}
-	//	if entity.F41 == "1" {
-	//		needList = append(needList, FileList{FileName: "1"})
-	//	}
-	//	if entity.F42 == "1" {
-	//		needList = append(needList, FileList{FileName: "2"})
-	//	}
-	//	if entity.F43 == "1" {
-	//		needList = append(needList, FileList{FileName: "3"})
-	//	}
-	//	if entity.F44 == "1"
-	//		needList = append(needList, FileList{FileName: "4"})
-	//	}
-	//	if entity.F45 == "1" {
-	//		needList = append(needList, FileList{FileName: "5"})
-	//	}
-	//	if entity.F46 == "1" {
-	//		needList = append(needList, FileList{FileName: "6"})
-	//	}
 	return needList
 }
 

+ 13 - 17
src/dashoo.cn/backend/api/controllers/oilsupplier/goodsaptitude.go

@@ -334,28 +334,24 @@ func (this *OilGoodsAptitudeController) GoodsParentList() {
 	svc := goodsaptitude.GetOilGoodsAptitudeService(utils.DBE)
 	where := " ParentId = 0 and DeletionStateCode = 0 "
 	var list []goodsaptitude.GoodsBusiness
-	svc.GetEntitysByWhere(OilGoodsAptitudeClassName, where, &list)
+	list = svc.GetGoodsList(OilGoodsAptitudeClassName, where)
 	var datainfo DataInfo
 	datainfo.Items = list
 	this.Data["json"] = &datainfo
 	this.ServeJSON()
 }
 
-// @Title get 业务列表
+// @Title get 获取子类
 // @Description get SampleType by token
 // @Success 200 {object} sampletype.SampleType
-// @router /goodschildlist [get]
-//func (this *OilGoodsAptitudeController) GoodsChildList() {
-//	ParentId := this.GetString("ParentId")
-//	svc := goodsaptitude.GetOilGoodsAptitudeService(utils.DBE)
-//	where := " 1 = 1 "
-//	if ParentId != "" {
-//		where = where + " and ParentId = '" + ParentId + "'"
-//	}
-//	var list []goodsaptitude.GoodsBusiness
-//	svc.GetEntitysByWhere(OilGoodsAptitudeClassName, where, &list)
-//	var datainfo DataInfo
-//	datainfo.Items = list
-//	this.Data["json"] = &datainfo
-//	this.ServeJSON()
-//}
+// @router /goodschildlist/:id [get]
+func (this *OilGoodsAptitudeController) GoodsChildList() {
+	ParentId := this.Ctx.Input.Param(":id")
+	sqlStr := "SELECT Id, `Code`, `Name`, concat(Code, '  ', Name) as CodeName, ParentId FROM OilGoodsAptitudeClass WHERE FIND_IN_SET(ParentId, fun_getOilGoodsAptitudeClasschildlist(" + ParentId + ")) AND DeletionStateCode = 0 order by Code"
+	svc := goodsaptitude.GetOilGoodsAptitudeService(utils.DBE)
+	list, _ := svc.DBE.QueryString(sqlStr)
+	var datainfo DataInfo
+	datainfo.Items = list
+	this.Data["json"] = &datainfo
+	this.ServeJSON()
+}

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

@@ -2,7 +2,7 @@ package oilsupplier
 
 import (
 	"encoding/json"
-	//"fmt"
+	"fmt"
 	"strconv"
 	"strings"
 	"time"
@@ -300,6 +300,78 @@ 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
+	fmt.Println("===========================", string(jsonblob))
+	var datamain suppliercertsub.OilSupplierCertSub
+	var dataother suppliercertsub.SupplierCertSubModel
+	json.Unmarshal(jsonblob, &datamain)
+	json.Unmarshal(jsonblob, &dataother)
+	var errinfo ErrorDataInfo
+	fmt.Println("000000000000000000000===========", dataother.CheckList)
+	for n := 0; ; n++ {
+		if n == len(dataother.CheckList) {
+			fmt.Println("11111111111111111110===========", len(dataother.CheckList))
+			errinfo.Message = "操作成功!"
+			errinfo.Code = 0
+			this.Data["json"] = &errinfo
+			this.ServeJSON()
+		}
+		datamain.SubClassId, _ = utils.StrTo(dataother.CheckList[n].Id).Int()
+		datamain.Code = dataother.CheckList[n].Code
+		datamain.Name = dataother.CheckList[n].Name
+		datamain.IsDelete = 0
+		datamain.CreateBy = this.User.Realname
+		datamain.CreateUserId, _ = utils.StrTo(this.User.Id).Int()
+		svc := suppliercertsub.GetOilSupplierCertSubService(utils.DBE)
+		svc.InsertEntityBytbl(OilSupplierCertSubName, &datamain)
+
+		filesvc := supplierfile.GetSupplierfileService(utils.DBE)
+		needList := filesvc.GetGoodsNeedFileList(dataother.CheckList[n].Id)
+
+		var list []supplierfile.OilSupplierFile
+		where := "SupplierId = '" + strconv.Itoa(dataother.SupplierId) + "'"
+		svc.GetEntitysByWhere(OilSupplierFileName, where, &list)
+
+		if len(list) == 0 { //第一次添加准入项,将共有必备资质写入文件表
+			for i := 0; i < len(needList); i++ {
+				var entity supplierfile.OilSupplierFile
+				entity.SupplierId = dataother.SupplierId
+				if i < 4 {
+					entity.SupplierTypeCode = "000"
+				} 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()
+				svc.InsertEntityBytbl(OilSupplierFileName, &entity)
+			}
+		} else {
+			if len(needList) > 4 {
+				for i := 4; i < len(needList); i++ {
+					var entity supplierfile.OilSupplierFile
+					entity.SupplierId = dataother.SupplierId
+					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()
+					svc.InsertEntityBytbl(OilSupplierFileName, &entity)
+				}
+			}
+		}
+	}
+
+}
+
 // @Title 新增准入范围
 // @Description 新增准入范围
 // @Success	200	{object} controllers.Request
@@ -316,7 +388,7 @@ func (this *OilSupplierCertSubController) AddBusiness() {
 	filesvc := supplierfile.GetSupplierfileService(utils.DBE)
 	var needList []supplierfile.FileList
 	if model.SupplierTypeCode == "01" {
-		needList = filesvc.GetGoodsNeedFileList(model.SubClassId)
+		//		needList = filesvc.GetGoodsNeedFileList(model.SubClassId)
 	} else if model.SupplierTypeCode == "02" {
 		needList = filesvc.GetBasicNeedFileList(model.SubClassId)
 	} else {
@@ -326,7 +398,6 @@ func (this *OilSupplierCertSubController) AddBusiness() {
 	if err == nil {
 		var list []supplierfile.OilSupplierFile
 		where := "SupplierId = '" + strconv.Itoa(model.SupplierId) + "'"
-		//where += " and SupplierCertId = '" + strconv.Itoa(model.SupplierCertId) + "'"
 		svc.GetEntitysByWhere(OilSupplierFileName, where, &list)
 
 		if len(list) == 0 { //第一次添加准入项,将共有必备资质写入文件表

+ 61 - 119
src/dashoo.cn/frontend_web/src/components/oilsupplier/goodslist.vue

@@ -28,14 +28,14 @@
     <el-dialog title="基建类业务列表" :visible.sync="goodsDialog" top="5vh">
       <el-row :gutter="20" style="height: calc(100vh - 545px); overflow: auto;">
         <el-col :span="20">
-          <el-tree highlight-current :expand-on-click-node="true" node-key="id" :data="orgtreelist"
-            :props="orgtreeprops" ref="orgmanagetree" show-checkbox @check-change="getChildrens">
+          <el-tree highlight-current :expand-on-click-node="true" node-key="CodeName" :data="orgtreelist"
+            :props="orgtreeprops" ref="orgmanagetree" show-checkbox lazy @node-click="getChildrens">
           </el-tree>
         </el-col>
       </el-row>
       <div slot="footer" class="dialog-footer">
         <el-button size="mini" @click="visible = false">取 消</el-button>
-        <el-button type="primary" size="mini" @click="savedata()">确 定</el-button>
+        <el-button type="primary" size="mini" @click="getChecklist()">确 定</el-button>
       </div>
     </el-dialog>
   </div>
@@ -75,21 +75,22 @@
         orgtreelist: [],
         orgtreeprops: {
           value: 'Id',
-          label: 'Name',
+          label: 'CodeName',
           children: 'children'
         },
+        checkList: [],
 
-        BusinessForm: {
-          Id: '',
-          SupplierId: '',
-          SupplierCertId: '',
-          SupplierTypeCode: '',
-          SubClassId: '',
-          Code: '',
-          Name: '',
-          Remark: '',
-          IsDelete: 0
-        },
+        // BusinessForm: {
+        //   Id: '',
+        //   SupplierId: '',
+        //   SupplierCertId: '',
+        //   SupplierTypeCode: '',
+        //   SubClassId: '',
+        //   Code: '',
+        //   Name: '',
+        //   Remark: '',
+        //   IsDelete: 0
+        // },
         visible: false,
         selfVisible: this.visible, // 避免vue双向绑定警告
         currentPage: 1, // 分页
@@ -125,49 +126,55 @@
             console.error(err)
           })
       },
-      savedata() {
-        if (this.Title === '新增准入范围') {
-          this.addGoodsBus()
-        } else if (this.Title === '编辑准入范围') {
-          this.editBusiness()
+      getChecklist() {       
+        let val = this.$refs.orgmanagetree.getCheckedNodes()
+        this.checkList = []
+        for(var i = 0; i < val.length; i ++){
+          if(val[i].Code.length == 8){
+            this.checkList.push(val[i])
+          }
         }
+        this.addBusiness()
       },
-      addGoodsBus() {
+      addBusiness() {
+        console.log("-211111111111",this.SupplierId)
         let _this = this
-        let arr = []
-        arr = _this.$refs['cascader'].currentLabels
-        _this.BusinessForm.Name = arr[arr.length - 1]
-        _this.BusinessForm.SupplierId = parseInt(_this.BusinessForm.SupplierId)
-        _this.BusinessForm.SupplierCertId = parseInt(_this.BusinessForm.SupplierCertId)
-        _this.BusinessForm.SubClassId = parseInt(_this.BusinessForm.SubClassId)
-        //因为表单验证不能用,所以采用提示验证
-        if (_this.selectedOptList.length < 1) {
+        let params = {
+          SupplierId: parseInt(_this.SupplierId),
+          SupplierCertId: parseInt(_this.SupplierCertId),
+          SupplierTypeCode: '01',
+        }
+        if (_this.checkList.length > 0) {
+          params = Object.assign(params, {
+            CheckList: _this.checkList
+          })
+        } else {
           _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)
-            })
-        }
+          return
+        }      
+        _this.$axios.post('/suppliercertsub/addgoodsbus/', params)
+          .then(res => {
+            console.log("------------------", res.data.code)
+            if (res.data.code === 0) {
+              _this.$message({
+                type: 'success',
+                message: res.data.message
+              })
+              _this.goodsDialog = false
+              _this.initData()
+            } else {
+              _this.$message({
+                type: 'warning',
+                message: '操作失败!'
+              })
+            }
+          })
+          .catch(err => {
+            console.error(err)
+          })
       },
       deletedata(val) {
         let _this = this
@@ -206,11 +213,10 @@
         let _this = this
         this.$axios.get('goodsaptitude/goodsparentlist', {})
           .then(res => {
-            _this.orgtreelist = window.toolfun_gettreejson(res.data.items, 'Id', 'ParentId', 'Id,Name')           
+            _this.orgtreelist = window.toolfun_gettreejson(res.data.items, 'Id', 'ParentId', 'Id,Code,Name,CodeName')
             _this.orgtreelist.forEach((item, index) => {
               _this.$set(this.orgtreelist[index], 'children', [])
             })
-            console.log("-----------------", _this.orgtreelist)
           })
           .catch(err => {
             console.error(err)
@@ -221,23 +227,19 @@
         let _this = this
         let Id = val.id
         if (Id != _this.flagId) { //判断是否是第一次,若不相等则为第一次
-          this.$axios.get('goodsaptitudeclass/getchildlist/' + Id, {})
+          this.$axios.get('goodsaptitude/goodschildlist/' + Id, {})
             .then(res => {
               //获取下一级所有级联数据
               if (res.data.items) { //判断是否有数据
                 let tempList = []
-                tempList = window.toolfun_gettreejson(res.data.items, 'Id', 'ParentId', 'Id,Name')
-                 console.log("-j0000090------------------",this.orgtreelist)
+                tempList = window.toolfun_gettreejson(res.data.items, 'Id', 'ParentId', 'Id,Code,Name,CodeName')
                 //添加到上一级对应的选项中
-                console.log("-j111111111111111111----",Id)
                 for (let i = 0; i < _this.orgtreelist.length; i++) {
                   if (_this.orgtreelist[i].id === Id) {
-                      console.log("--oooooooooooooooooo-")
                     _this.$set(_this.orgtreelist[i], 'children', tempList)
                     break
                   }
                 }
-                console.log("-3333333333333333333333333---", _this.orgtreelist)
               } else {
                 //修改上一级的children属性
                 for (let i = 0; i < _this.orgtreelist.length; i++) {
@@ -247,7 +249,6 @@
                   }
                 }
               }
-              //做标记
               _this.flagId = Id
             })
             .catch(err => {
@@ -255,40 +256,6 @@
             })
         }
       },
-      //获取分类级联Id
-      getGoodsCode(item) {
-        this.getCodeById(item[item.length - 1]) //根据分类Id获取Code
-      },
-      //根据分类Id获取Code
-      getCodeById(Id) {
-        let _this = this
-        this.$axios.get('goodsaptitudeclass/getcode/' + Id, {})
-          .then(res => {
-            _this.BusinessForm.SubClassId = Id
-            _this.BusinessForm.Code = res.data.items[0].Code
-          })
-          .catch(err => {
-            console.error(err)
-          })
-      },
-
-      //   getCode() {
-      //     this.ClassId = this.selectedorg[this.selectedorg.length - 1]
-      //     for (var i = 0; i < this.techList.length; i++) {
-      //       if (this.selectedorg[this.selectedorg.length - 1] === this.techList[i].Id) {
-      //         this.BusinessForm.SubClassId = this.techList[i].Id
-      //         this.BusinessForm.Name = this.techList[i].Name
-      //         this.BusinessForm.Code = this.techList[i].Code
-      //       }
-      //     }
-      //   },
-      //   getChooseCode(val) {
-      //     this.ClassId = val.Id
-      //     this.BusinessForm.SubClassId = val.Id
-      //     this.BusinessForm.Code = val.Code
-      //     this.BusinessForm.Name = val.Name
-      //    // this.basicDialog = false
-      //   },
 
       handleSizeChange(value) {
         this.size = value
@@ -299,31 +266,6 @@
         this.currentPage = value
         this.initData()
       },
-      //   HandleSizeChange(value) {
-      //     this.Size = value
-      //     this.CurrentPage = 1
-      //     this.getbusiness()
-      //   },
-      //   HandleCurrentChange(value) {
-      //     this.CurrentPage = value
-      //     this.getbusiness()
-      //   },
-      seachdata() {
-        this.CurrentPage = -1
-        this.getbusiness()
-      },
-      jstimehandle(val) {
-        if (val === '') {
-          return '----'
-        } else if (val === '0001-01-01T08:00:00+08:00') {
-          return '----'
-        } else if (val === '5000-01-01T23:59:59+08:00') {
-          return '永久'
-        } else {
-          val = val.replace('T', ' ')
-          return val.substring(0, 10)
-        }
-      }
     }
   }