diff --git a/json/agreement.json b/json/agreement.json index ff94b8e..1e704e3 100644 --- a/json/agreement.json +++ b/json/agreement.json @@ -1,6 +1,29 @@ { "tblname":"agreement", "params":{ + "toolbar":{ + "tools":[ + { + "name":"prodauth", + "selected_row":true, + "label":"授权" + } + ] + }, + "binds":[ + { + "wid":"self", + "event":"prodauth", + "actiontype":"urlwidget", + "target":"PopupWindow", + "options":{ + "url":"{{entire_url('platformbiz/agreeproduct_auth.dspy')}}", + "params":{ + "agreedetailid":"{{params_kw.agreedetailid}}" + } + } + } + ], "browserfields": { "exclouded": ["id"], "alters": {} diff --git a/json/choose_prodtype.json b/json/choose_prodtype.json index 45b7a06..8baf780 100644 --- a/json/choose_prodtype.json +++ b/json/choose_prodtype.json @@ -1,9 +1,32 @@ { - "treetype":"singlestruct", "tblname":"prodtype", "uitype":"tree", "alias":"choose_prodtype", "params":{ + "toolbar":{ + "bar_cwidth":2, + "tools":[ + { + "name":"test", + "selected_data":true, + "label":"TEST" + } + ] + }, + "binds":[ + { + "wid":"self", + "event":"prodauth", + "actiontype":"urlwidget", + "target":"PopupWindow", + "options":{ + "url":"{{entire_url('platformbiz/ag.dspy')}}", + "params":{ + "agreedetailid":"{{params_kw.agreedetailid}}" + } + } + } + ], "idField":"id", "textField":"name", "editable":true, @@ -11,12 +34,7 @@ "alters":{} }, "edit_exclouded_fields":["del_flg", "create_at"], - "checkField":"dd", - "parentField":"parentid", - "toolbar":{ - }, - "binds":[ - ] + "parentField":"parentid" } } diff --git a/json/prodtype.json b/json/prodtype.json index 498fbee..08179a7 100644 --- a/json/prodtype.json +++ b/json/prodtype.json @@ -6,39 +6,6 @@ "textField":"name", "parentField":"parentid", "editable":true, - "toolbar":{ - "tools":[ - { - "target":"PopupWindow", - "name":"spec", - "selected_data":true, - "label":"规格" - } - ] - }, - "binds":[ - { - "wid":"self", - "event":"spec", - "actiontype":"urlwidget", - "target":"PopupWindow", - "popup_options":{ - "width":"80%", - "height":"80%" - }, - "params_mapping":{ - "mapping":{ - "id":"prodtypeid" - }, - "need_others":false - }, - "options":{ - "params":{ - }, - "url":"/platformbiz/prodtypespec" - } - } - ], "browserfields": { "exclouded": ["id", "parentid" ], "alters": {} diff --git a/platformbiz/product.py b/platformbiz/product.py index 980a1e7..7c7b4ea 100644 --- a/platformbiz/product.py +++ b/platformbiz/product.py @@ -18,6 +18,7 @@ a.description, a.prod_state, a.product_code, a.spec_note, +b.id as apid, d.id as agreeid, d.providerid, d.resellerid @@ -35,8 +36,9 @@ where a.id = b.providerpid return for rec in recs: + pid = getID() d = { - "id":getID(), + "id":pid, "name":rec.name, "prodtypeid":rec.prodtypeid, "orgid":rec.resellerid, @@ -49,6 +51,7 @@ where a.id = b.providerpid "spec_note":rec.spec_note } await sor.C('product', d) + await sor.U('agreeproduct', {'id':rec.apid, 'resellerpid':pid}) async def open_agree_account(sor, providerid, sellerid): accounting_orgid = await get_accounting_orgid(sor) diff --git a/wwwroot/agree_prodclone.dspy b/wwwroot/agree_prodclone.dspy new file mode 100644 index 0000000..21faf07 --- /dev/null +++ b/wwwroot/agree_prodclone.dspy @@ -0,0 +1,9 @@ +debug(f'params_kw=}') +orgid = await get_userorgid() +db = DBPools() +dbname = await get_module_dbname('platformbiz') +async with db.sqlorContext(dbname) as sor: + await agree_products_clone(sor, orgid, params_kw.id) + return UiMessage(title='product clone', message='product clone finished') +debug('product clone error') +return UiError(title='product clone', message='product clone error')