Selaa lähdekoodia

专业处室下拉

huahaiyan 6 vuotta sitten
vanhempi
commit
b48b1df97a

+ 2 - 2
src/dashoo.cn/backend/api/business/oilsupplier/supplier/oilsupplierService.go

@@ -192,8 +192,8 @@ func (s *OilSupplierService) GetUpdateCols(oilSupplierCertTableName string, supp
 	return cols
 }
 
-func (s *OilSupplierService) GetProOrTreeList(entitiesPtr interface{}){
-	where := " Id=100000180 OR ParentId=100000180 "
+func (s *OilSupplierService) GetProOrTreeList(ids string, entitiesPtr interface{}){
+	where := " Id in ("+ids+")"
 	sql := "SELECT Id, FullName, ParentId FROM Base_Organize where " + where
 	s.DBE.SQL(sql).Find(entitiesPtr)
 	return

+ 7 - 0
src/dashoo.cn/backend/api/business/organize/organizeService.go

@@ -121,6 +121,13 @@ func (s *OrganizeService) GetAllChildById(topid string) string {
 	return mod.Id
 }
 
+//根据
+func (s *OrganizeService) GetAllChildUnitById(topid string) string {
+	mod := new(Id_Str)
+	s.DBE.Sql(`select fun_getOrganizechildlist_unit ('` + topid +  `') as Id`).Get(mod)
+	return mod.Id
+}
+
 //根据 物质类
 func (s *OrganizeService) GetAllGoodsChildById(topid string) string {
 	mod := new(Id_Str)

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

@@ -1416,7 +1416,8 @@ func (this *OilSupplierController) GetDictListByStatus() {
 	dictList["CountryList"] = areaJsonSvc.GetCountryList()
 	//获取专业审批处室部门
 	var preorglist []organize.Base_Organizetree
-	svc.GetProOrTreeList(&preorglist)
+	ids := orgsvc.GetAllChildUnitById("0")
+	svc.GetProOrTreeList(ids, &preorglist)
 	dictList["ProOrgList"] = preorglist
 	//获取我创建的所有公司
 	var list []supplier.OilSupplier
@@ -1871,11 +1872,13 @@ func (this *OilSupplierController) GetAuditerByFist() {
 	Id := this.Ctx.Input.Param(":firstId")
 	auditstepcode := this.GetString("auditstepcode")
 	certSrv := suppliercert.GetOilSupplierCertService(utils.DBE)
+	orgSrv := organize.GetOrganizeService(utils.DBE)
 	var userentity userRole.Base_User
 	certSrv.GetEntityById(Id,&userentity)
-	depId := strings.Split(userentity.Superior,",")
+	comid := orgSrv.GetMyUnitDepartmentId(userentity.Departmentid)
+	//depId := strings.Split(userentity.Superior,",")
 	var users []userRole.Base_RoleList
-	certSrv.GetAuditUser(depId[len(depId)-1], auditstepcode, &users)
+	certSrv.GetAuditUser(comid, auditstepcode, &users)
 	var datainfo ErrorDataInfo
 	datainfo.Item = users
 	this.Data["json"] = &datainfo

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

@@ -650,7 +650,7 @@
       this.formData.Id = 0;
     }
     this.getDictOptions();
-    this.getorgtreelist();
+    //this.getorgtreelist();
     this.IsCompanyUser = this.authUser.Profile.IsCompanyUser;
 
       if (this.IsCompanyUser && this.serviceId === "add") {
@@ -933,7 +933,7 @@
           majorAduit: this.formData.ThirdAudit
         }
         api.getDictListByStatus(params, this.$axios).then(res => {
-          this.dictData = res.data.items
+          //this.dictData = res.data.items
           this.orgtreelist = window.toolfun_gettreejson(res.data.items['ProOrgList'], 'id', 'pId', 'id,name')
           // this.auditerOptions = res.data.items['Auditer']
           // this.organizeOption = res.data.items['Organizes']
@@ -941,35 +941,35 @@
           console.error(err)
         })
       },
-      getorgtreelist() {
-        let _this = this;
-        let params = {
-          IsInnerOrganize: 1
-        };
-        _this.$axios
-          .get("organizes/orgalllist", {
-            params
-          })
-          .then(res => {
-            _this.orgtreelist = window.toolfun_gettreejson(
-              res.data.items,
-              "Id",
-              "Parentid",
-              "Id,Fullname"
-            );
-            if (_this.authUser.Profile.IsCompanyUser === 0) {
-              this.secOrganize = _this.authUser.Profile.Superior.split(",").map(
-                val => {
-                  return parseInt(val);
-                }
-              );
-              this.auditOrgChang(this.secOrganize);
-            }
-          })
-          .catch(err => {
-            console.error(err);
-          });
-      },
+      // getorgtreelist() {
+      //   let _this = this;
+      //   let params = {
+      //     IsInnerOrganize: 1
+      //   };
+      //   _this.$axios
+      //     .get("organizes/orgalllist", {
+      //       params
+      //     })
+      //     .then(res => {
+      //       _this.orgtreelist = window.toolfun_gettreejson(
+      //         res.data.items,
+      //         "Id",
+      //         "Parentid",
+      //         "Id,Fullname"
+      //       );
+      //       if (_this.authUser.Profile.IsCompanyUser === 0) {
+      //         this.secOrganize = _this.authUser.Profile.Superior.split(",").map(
+      //           val => {
+      //             return parseInt(val);
+      //           }
+      //         );
+      //         this.auditOrgChang(this.secOrganize);
+      //       }
+      //     })
+      //     .catch(err => {
+      //       console.error(err);
+      //     });
+      // },
 
       auditOrgChang(val) {
         console.log("------val", val)