Ben Lin
2025-03-05 abbc201b41a1a25a19ccf7cff8df633dadcf5d88
src/views/tigerprojects/system/role/RoleDrawer.vue
@@ -126,14 +126,14 @@
    setDrawerProps({ confirmLoading: false });
    // 需要在setFieldsValue之前先填充treeData,否则Tree组件可能会报key not exist警告
    if (unref(treeData).length === 0) {
      treeData.value = (await getMenuList()) as any as TreeItem[];
      treeData.value = (await getMenuList({menuName: 'SYSTEM'})) as any as TreeItem[];
    }
    if (unref(treeDataOrg).length === 0) {
      treeDataOrg.value = (await getTreeList()) as any as TreeItem[];
    }
    if (unref(treeDataProd).length === 0) {
      // treeDataProd.value = (await getProdTreeList()) as any as TreeItem[];
      let prodTreeData = await getEntity({sqlcmd: '', entityName: 'V_PROD_TREE'});
      let prodTreeData = await getEntity({sqlcmd: '', entityName: 'V_PROD_TREE', order: ''});
      treeDataProd.value = convertToTree(prodTreeData.Data.Items,'PARENT_CODE', 'CODE', '');
    }
    if (unref(treeDataWh).length === 0) {
@@ -156,6 +156,7 @@
      }
      //console.log(list,11);
      data.record.menu = list2;
      halfCheckedKeys.value = list;
      expandedKeys.value = list;
      await getRuleOrg(data);
      await getRuleWh(data);
@@ -166,7 +167,11 @@
    }
  });
  //获取角色对应的组织
  /**
   * @description: 获取角色对应的组织
   * @param {*} data
   * @return {*}
   */
  async function getRuleOrg(data) {
    const orgList = await getROList(data.record.ID);
    var hfList = [];
@@ -181,10 +186,15 @@
      }
    }
    data.record.org = hfList;
    halfCheckedKeysOrg.value = list;
    expandedKeysOrg.value = list;
  }
  //获取角色对应的仓库
  /**
   * @description: 获取角色对应的仓库
   * @param {*} data
   * @return {*}
   */
  async function getRuleWh(data) {
    const whList = await getWhList(data.record.ID);
    var hfList = [];
@@ -199,9 +209,15 @@
      }
    }
    data.record.wh = hfList;
    halfCheckedKeysWh.value = list;
    expandedKeysWh.value = list;
  }
  /**
   * @description: 获取角色对应的生产
   * @param {*} data
   * @return {*}
   */
  async function getRuleProd(data) {
    const prodList = await getProdList(data.record.ID);
    var hfList = [];
@@ -216,6 +232,7 @@
      }
    }
    data.record.fty = hfList;
    halfCheckedKeysFty.value = list;
    expandedKeysFty.value = list;
  }