bugfix
This commit is contained in:
parent
3dddf94bb8
commit
87bb4ba10f
15
wwwroot/add_provider.dspy
Normal file
15
wwwroot/add_provider.dspy
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
orgname = params_kw.orgname
|
||||||
|
async with get_sor_context(request._run_ns, 'platformbiz') as sor:
|
||||||
|
recs = await sor.R('organization', {'orgname': orgname})
|
||||||
|
if not recs:
|
||||||
|
orgid = uuid()
|
||||||
|
ns = {
|
||||||
|
"id": orgid,
|
||||||
|
"orgname": orgname
|
||||||
|
}
|
||||||
|
await create_org(sor, ns, ['provider'])
|
||||||
|
await openProviderAccounts(sor, '0', orgid)
|
||||||
|
recs = ns
|
||||||
|
return UiMessage(title='添加供应商', message=f'添加成功, 新供应商id={recs.id}')
|
||||||
|
return UiError(title='添加供应商', message=f'添加失败')
|
||||||
|
|
||||||
36
wwwroot/add_provider.ui
Normal file
36
wwwroot/add_provider.ui
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
{% set roles = get_user_roles(get_user()) %}
|
||||||
|
{% if owner.operator in roles %}
|
||||||
|
{
|
||||||
|
"widgettype": "Form",
|
||||||
|
"options": {
|
||||||
|
"description": "添加平台供应商",
|
||||||
|
"submit_url": "{{entire_url('add_provider.dspy')}}",
|
||||||
|
"fields":[
|
||||||
|
{
|
||||||
|
"name": "orgname",
|
||||||
|
"label": "供应商名",
|
||||||
|
"uitype": "str",
|
||||||
|
"required": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
{% else %}
|
||||||
|
{
|
||||||
|
“widgettype": "PopupWindow"
|
||||||
|
"options": {
|
||||||
|
"content":{
|
||||||
|
"widgettype": "Text",
|
||||||
|
"options": {
|
||||||
|
"otext": "你无权使用此功能",
|
||||||
|
"i18n": true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"auto_open": true,
|
||||||
|
"auto_close": true,
|
||||||
|
"tiemout": 4,
|
||||||
|
"archor": "cc",
|
||||||
|
"cwidth": 5,
|
||||||
|
"cheight": 10
|
||||||
|
}
|
||||||
|
}
|
||||||
|
{% endif %}
|
||||||
Loading…
x
Reference in New Issue
Block a user