20 lines
561 B
Plaintext
20 lines
561 B
Plaintext
|
|
ns = params_kw.copy()
|
|
|
|
data = ns.copy()
|
|
data.pop('page', None)
|
|
data.pop('rows', None)
|
|
data.pop('data_filter', None)
|
|
|
|
if not data.get('id'):
|
|
return {'widgettype':'Error','options':{'title':'Update Error','message':'缺少id'}}
|
|
|
|
try:
|
|
db = DBPools()
|
|
dbname = get_module_dbname('supplychain')
|
|
async with db.sqlorContext(dbname) as sor:
|
|
await sor.U('suppliers', data)
|
|
return {'widgettype':'Message','options':{'title':'Update Success','message':'ok'}}
|
|
except Exception as e:
|
|
return {'widgettype':'Error','options':{'title':'Update Error','message':str(e)}}
|