| | |
| | | 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) { |
| | |
| | | } |
| | | //console.log(list,11); |
| | | data.record.menu = list2; |
| | | halfCheckedKeys.value = list; |
| | | expandedKeys.value = list; |
| | | await getRuleOrg(data); |
| | | await getRuleWh(data); |
| | |
| | | } |
| | | }); |
| | | |
| | | //获取角色对应的组织 |
| | | /** |
| | | * @description: 获取角色对应的组织 |
| | | * @param {*} data |
| | | * @return {*} |
| | | */ |
| | | async function getRuleOrg(data) { |
| | | const orgList = await getROList(data.record.ID); |
| | | var hfList = []; |
| | |
| | | } |
| | | } |
| | | 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 = []; |
| | |
| | | } |
| | | } |
| | | 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 = []; |
| | |
| | | } |
| | | } |
| | | data.record.fty = hfList; |
| | | halfCheckedKeysFty.value = list; |
| | | expandedKeysFty.value = list; |
| | | } |
| | | |