This commit is contained in:
yumoqing 2026-01-07 15:08:54 +08:00
parent 10115df0df
commit 77bc195215
2 changed files with 47 additions and 5 deletions

View File

@ -7,11 +7,12 @@ db = DBPools()
dbname = get_module_dbname('rbac')
async with db.sqlorContext(dbname) as sor:
ownerid = await get_userorgid()
await create_org(sor, ns, orgtypes=['customer', 'provider'])
if openCustomerAccounts:
await openCustomerAccounts(sor, ownerid, orgid)
if openProviderAccounts:
await openProviderAccounts(sor, ownerid, id)
orgid = id
await create_org(sor, ns, orgtypes=['provider'])
try:
await openRetailRelationshipAccounts(sor, ownerid, ownerid, orgid)
except Exception as e:
exception(f'{e}')
return {
"widgettype":"Message",
"options":{

41
wwwroot/add_provider.ui Normal file
View File

@ -0,0 +1,41 @@
{% set orgid = get_userorgid() %}
{% if orgid != get_owner_orgid() %}
{
"widgettype":"Text",
"options":{
"i18n":true,
"otext":"you are not owner user"
}
}
{% else %}
{
"widgettype":"Form",
"options":{
"width":"100%",
"height":"100%",
"fields":[
{
"name":"orgname",
"label":"机构名称",
"uitype":"str",
"required":true
},{
"name":"orgabbr",
"label":"机构简称",
"uitype":"str"
}
]
},
"binds":[
{
"wid":"self",
"event":"submit",
"actiontype":"urlwidget",
"target":"self",
"options":{
"url":"{{entire_url('add_provider.dspy')}}"
}
}
]
}
{% endif %}