From aaeb4aef4dba9deb9abc1531fa6d5de96e30d36d Mon Sep 17 00:00:00 2001 From: yumoqing Date: Mon, 17 Feb 2025 17:19:13 +0800 Subject: [PATCH] bugfix --- json/build.sh | 3 + wwwroot/select_org/.get_organization.dspy.swp | Bin 0 -> 16384 bytes wwwroot/select_org/.index.ui.swp | Bin 0 -> 12288 bytes wwwroot/select_org/get_organization.dspy | 148 ++++++++++++ wwwroot/select_org/index.ui | 56 +++++ wwwroot/select_org/orglist.ui | 228 ++++++++++++++++++ 6 files changed, 435 insertions(+) create mode 100755 json/build.sh create mode 100644 wwwroot/select_org/.get_organization.dspy.swp create mode 100644 wwwroot/select_org/.index.ui.swp create mode 100644 wwwroot/select_org/get_organization.dspy create mode 100644 wwwroot/select_org/index.ui create mode 100644 wwwroot/select_org/orglist.ui diff --git a/json/build.sh b/json/build.sh new file mode 100755 index 0000000..e596dff --- /dev/null +++ b/json/build.sh @@ -0,0 +1,3 @@ +#!/usr/bin/bash + +xls2ui -m ../models -o ../wwwroot platformbiz *.json diff --git a/wwwroot/select_org/.get_organization.dspy.swp b/wwwroot/select_org/.get_organization.dspy.swp new file mode 100644 index 0000000000000000000000000000000000000000..9a49d0c8bfe905048ecb5f98f67722049d88a268 GIT binary patch literal 16384 zcmeI2TWl0n7{?EYXi+Ya5MOvWERfkYW!o(mVYM&H3lWow0l}u(%x7wB3k|?j~ zqB?%oXHj8EELjqZ@Ons5qXB7aNg|O@6-6)6#E2Nw{fZhc35(W|m!++|E-A7{&|=B) zYi6lT0j9vX3dHr$l9e;b(lT$UnQx(M0iFB6`f-b}M5X{!fGNNfU}Z?xWVVM z2;spqU=t_-^TA&;3HcrT2rh$8upjIOJ3tLs1IoaBFb~WIzuZsASKtG15_Et=APFkL zYES~)zy)sIN67c!6VL@Z!Ew+G0^o750+fJ4Fbn)VgOG2)70?aNfde20Hi6Zk96SUb z1UCx^F~C*u8Tbfvf;}J({9q$k2fSbg`1M{wegN0NRd61(fjZy^rJxWj1k=Dzc-itL zxBwbK5@=u(co-}KGr`x>3Hbti3f=;(Km}D`1E>JYz+76a_n1GR@VdLGC?rMj=ZYW&3rRtN6R70uQ>Tq1S~DUzyzx$|Ra9digXN!;T47_ahC&0m}F*eMN*Ibw^7La4w+ zd0C)#Dve0BB3)EJn0XO(5h+AR)#4*#Hi+Yf(onsud4ftTiLtk>)@X{1ctH&D@rdrv z)MG}vLy{N~v|-aK%1x)1kt_x5-6^dH-PaIn#MaVJ7$K4Zr_Mtir>b)vuJA|jR||J!{%Jx;{38r6iwFU@}f;sQ)tN*T`|?{9BUUpbS@c$Al9e;}?&vZ!ejHvuy${}vb>XN;qb zxvcVnpyp+-Z25}(?F}?{rMk}MvL~XOk-Uvg=APN#+GupVY4&tak8?HSLLa))1xeE- z8Gna5$)hiJXNYgZ^eZnI-OWzj!%PPyJ^3%0O?5Qowi#2EI&>G8-`Ecer@NTZ`44Zp z>0s);UOXpK2QQ>gAI&w+K}FX2psuL?ShXVOaY;=^Z^!<)mhHrG#&}Yl&OAemmQ%*w zwp@1kh{S7t>!~u~aMva|#}k=>fqzs-&Sx z&UWPB7t;`xWLjyuVzQ#!KA-6`4fLK>Yzw@nsCal2 ztX`Q*9rFfaI>(x#>Xv8hxXDPgHHDvQX=ddq^f_f>d^qDxd+ErmRuZxfE^2cAChx14 zwaiLqFxy~+Y!39$h}m8;G1vcVv1V@s=K3GYNo%`?@M&-YybRhvGcfaQ18idoFa?+b zOaZ0V17o+d@;q_0}sAsR`6j-4!dz?ea)hT*OGFOCM3O@3IQ{RqCSTAdU)&N&U{P6 LYY&a0w2%A^wG7tC literal 0 HcmV?d00001 diff --git a/wwwroot/select_org/.index.ui.swp b/wwwroot/select_org/.index.ui.swp new file mode 100644 index 0000000000000000000000000000000000000000..2d87dc2fcdcffee4f5f94eae7af8aa24822bd22c GIT binary patch literal 12288 zcmeI2-%FEG7{`xc7o)5wyz0hImI~@NE6~wJM1lRfuvDUm@oqbAhqia~eb1aaRuPFv z1clI5RFM6!i;4;&g`&HlZtJFNr;&ey^gZtn=XPP<8qeUfcRTMn&-p%|qZi^E3k{w+ z*VNM)W_ayltoiM$N43L418_27nj_!tmLtWvJUbLU@YudAW zVB_m)CK(_DWPl8i0Wv@a$N(821DoD}%GI&!=wgf4NyNL>)m*)=bRh#|fDDiUGC&5% z02v?yWPl8i0Wv@aHlYC{!PvcRU^~L&|Ns8q|0_EgTLQnpSMUM615dysFabuuC2$&? z1joQp&(z#MoFUW1q58JGg& zpbwk{z2F4s0Y|`Iuoe74U*Etim;sN$eJ~B2o;Tr{QDibe2FL&zAOmE843Ggb@ZT6H zvA`7;2n2XRCU^v&ilEf)4B2r@<`j=`m6CR+CGeoI)tWObBV)I5XNEGYq|h_)AhBV} zaYM36Cuw;?^MTftnfDSw<-XQ@pyATLyE zaD6m>fi+g#nEr9CNhibICXXm9FLa+eL{^DWt$Xq2$A!uH-#4bpw`a=_=E@ImwJ&{| zUYK~gaQDvQ^EXSMC(H9QenzwjB`U=u;V$RYbfGGRwXys4F78xUv7L{(R^5|Z&5Cmu zGMPdow{lHg{nJ=En%?8tQKxFr)!g4cw0ej9Wm cZGwkGp#%EFx!-_0f~KpssP16U?V!m10#++Ha{vGU literal 0 HcmV?d00001 diff --git a/wwwroot/select_org/get_organization.dspy b/wwwroot/select_org/get_organization.dspy new file mode 100644 index 0000000..5d11930 --- /dev/null +++ b/wwwroot/select_org/get_organization.dspy @@ -0,0 +1,148 @@ + +ns = params_kw.copy() +debug(f'{ns=}') + +debug(f'get_organization.dspy:{ns=}') +if not ns.get('page'): + ns['page'] = 1 +if not ns.get('sort'): + + + ns['sort'] = 'orgname' + + + +sql = '''select a.*, b.province_id_text +from (select * from organization where 1=1 {filterstr}) a left join (select k as province_id, + v as province_id_text from appcodes_kv where parentid='chnaddr') b on a.province_id = b.province_id + ''' + +filterjson = params_kw.get('data_filter') +if not filterjson: + fields = [ f['name'] for f in [ + { + "name": "id", + "title": "机构编码", + "type": "str", + "length": 32 + }, + { + "name": "orgname", + "title": "机构名称", + "type": "str", + "length": 100 + }, + { + "name": "alias_name", + "title": "机构别名", + "type": "str", + "length": 100 + }, + { + "name": "contactor", + "title": "联系人", + "type": "str", + "length": 32 + }, + { + "name": "contactor_phone", + "title": "联系人电话", + "type": "str", + "length": 100 + }, + { + "name": "province_id", + "title": "所在省id", + "type": "str", + "length": 32 + }, + { + "name": "city_id", + "title": "所在城市id", + "type": "str", + "length": 32 + }, + { + "name": "distinct_id", + "title": "所在地区id", + "type": "str", + "length": 32 + }, + { + "name": "emailaddress", + "title": "邮箱", + "type": "str", + "length": 256 + }, + { + "name": "address", + "title": "地址", + "type": "str", + "length": 400 + }, + { + "name": "main_business", + "title": "主营业务描述", + "type": "str", + "length": 1000 + }, + { + "name": "orgcode", + "title": "组织结构代码", + "type": "str", + "length": 100, + "comments": "个人客户存身份证" + }, + { + "name": "license_img", + "title": "营业执照", + "type": "str", + "length": 400, + "comments": "个人客户存身份证照片" + }, + { + "name": "id_img", + "title": "身份证", + "type": "str", + "length": 400, + "comments": "个人客户存身份证背面照片" + }, + { + "name": "parentid", + "title": "父机构id", + "type": "str", + "length": 32 + }, + { + "name": "org_type", + "title": "机构类型", + "type": "str", + "length": 32, + "comments": "0:业主机构;1:分销商;2:公司客户;3:个人客户;4:供应商" + }, + { + "name": "accountid", + "title": "账号", + "type": "str", + "length": 32 + } +] ] + filterjson = default_filterjson(fields, ns) +filterdic = ns.copy() +filterdic['filterstr'] = '' +if params_kw.orgname: + filterstr = " and orgname like ${orgname}$ " + ns['orgname'] = f'%{params_kw.orgname}%' + filterdic['filterstr'] = filterstr +sql = sql.format(**filterdic) + +debug(f'{sql=}') +db = DBPools() +dbname = await rfexe('get_module_dbname', 'rbac') +async with db.sqlorContext(dbname) as sor: + r = await sor.sqlPaging(sql, ns) + return r +return { + "total":0, + "rows":[] +} diff --git a/wwwroot/select_org/index.ui b/wwwroot/select_org/index.ui new file mode 100644 index 0000000..1f8cbf5 --- /dev/null +++ b/wwwroot/select_org/index.ui @@ -0,0 +1,56 @@ +{ + "widgettype":"VBox", + "options":{ + "height":"100%", + "width":"100%" + }, + "subwidgets":[ + { + "widgettype":"Title4", + "options":{ + "otext":"机构选择", + "i18n":true + } + }, + { + "widgettype":"HBox", + "options":{ + "cheight":2 + }, + "subwidgets":[ + { + "widgettype":"Text", + "options":{ + "cwidth":12, + "otext":"点击选择机构,输入名称过滤", + "i18n":true + } + }, + { + "id":"orgname_input", + "widgettype":"UiStr", + "options":{ + "name":"orgname", + "uitype":"str", + "css":"filler" + } + } + ] + }, + { + "widgettype":"urlwidget", + "options":{ + "url":"{{entire_url('orglist.ui')}}" + } + } + ], + "binds":[ + { + "wid":"orgname_input", + "event":"changed", + "actiontype":"script", + "target":"organization_tbl", + "script":"this.render(params)" + } + ] +} diff --git a/wwwroot/select_org/orglist.ui b/wwwroot/select_org/orglist.ui new file mode 100644 index 0000000..71e2c29 --- /dev/null +++ b/wwwroot/select_org/orglist.ui @@ -0,0 +1,228 @@ + +{ + "id":"organization_tbl", + "widgettype":"Tabular", + "options":{ + "title":"机构", + "css":"card", + "data_url":"{{entire_url('./get_organization.dspy')}}", + "data_method":"GET", + "data_params":{{json.dumps(params_kw, indent=4, ensure_ascii=False)}}, + "row_options":{ + "browserfields": {"alters": null, "cwidth": {}, "exclouded": ["id"]}, + "editexclouded":[ + "id" +], + "fields":[ + { + "name": "id", + "title": "机构编码", + "type": "str", + "length": 32, + "cwidth": 18, + "uitype": "str", + "datatype": "str", + "label": "机构编码" + }, + { + "name": "orgname", + "title": "机构名称", + "type": "str", + "length": 100, + "cwidth": 18, + "uitype": "str", + "datatype": "str", + "label": "机构名称" + }, + { + "name": "alias_name", + "title": "机构别名", + "type": "str", + "length": 100, + "cwidth": 18, + "uitype": "str", + "datatype": "str", + "label": "机构别名" + }, + { + "name": "contactor", + "title": "联系人", + "type": "str", + "length": 32, + "cwidth": 18, + "uitype": "str", + "datatype": "str", + "label": "联系人" + }, + { + "name": "contactor_phone", + "title": "联系人电话", + "type": "str", + "length": 100, + "cwidth": 18, + "uitype": "str", + "datatype": "str", + "label": "联系人电话" + }, + { + "name": "province_id", + "title": "所在省id", + "type": "str", + "length": 32, + "label": "所在省id", + "uitype": "code", + "valueField": "province_id", + "textField": "province_id_text", + "params": { + "dbname": "{{rfexe('get_module_dbname', 'rbac')}}", + "table": "appcode_kv", + "tblvalue": "k", + "tbltext": "v", + "valueField": "province_id", + "textField": "province_id_text", + "cond": "parentid='chnaddr'" + }, + "dataurl": "{{entire_url('/appbase/get_code.dspy')}}" + }, + { + "name": "city_id", + "title": "所在城市id", + "type": "str", + "length": 32, + "label": "所在城市id", + "uitype": "code", + "valueField": "city_id", + "textField": "city_id_text", + "params": { + "dbname": "{{rfexe('get_module_dbname', 'rbac')}}", + "table": "appcode_kv", + "tblvalue": "k", + "tbltext": "v", + "valueField": "city_id", + "textField": "city_id_text", + "cond": "parentid=${province_id}$" + }, + "dataurl": "{{entire_url('/appbase/get_code.dspy')}}" + }, + { + "name": "distinct_id", + "title": "所在地区id", + "type": "str", + "length": 32, + "label": "所在地区id", + "uitype": "code", + "valueField": "distinct_id", + "textField": "distinct_id_text", + "params": { + "dbname": "{{rfexe('get_module_dbname', 'rbac')}}", + "table": "appcode_kv", + "tblvalue": "k", + "tbltext": "v", + "valueField": "distinct_id", + "textField": "distinct_id_text", + "cond": "parentid=${city_id}$" + }, + "dataurl": "{{entire_url('/appbase/get_code.dspy')}}" + }, + { + "name": "emailaddress", + "title": "邮箱", + "type": "str", + "length": 256, + "cwidth": 18, + "uitype": "str", + "datatype": "str", + "label": "邮箱" + }, + { + "name": "address", + "title": "地址", + "type": "str", + "length": 400, + "cwidth": 18, + "uitype": "str", + "datatype": "str", + "label": "地址" + }, + { + "name": "main_business", + "title": "主营业务描述", + "type": "str", + "length": 1000, + "cwidth": 18, + "uitype": "str", + "datatype": "str", + "label": "主营业务描述" + }, + { + "name": "orgcode", + "title": "组织结构代码", + "type": "str", + "length": 100, + "comments": "个人客户存身份证", + "cwidth": 18, + "uitype": "str", + "datatype": "str", + "label": "组织结构代码" + }, + { + "name": "license_img", + "title": "营业执照", + "type": "str", + "length": 400, + "comments": "个人客户存身份证照片", + "cwidth": 18, + "uitype": "str", + "datatype": "str", + "label": "营业执照" + }, + { + "name": "id_img", + "title": "身份证", + "type": "str", + "length": 400, + "comments": "个人客户存身份证背面照片", + "cwidth": 18, + "uitype": "str", + "datatype": "str", + "label": "身份证" + }, + { + "name": "parentid", + "title": "父机构id", + "type": "str", + "length": 32, + "cwidth": 18, + "uitype": "str", + "datatype": "str", + "label": "父机构id" + }, + { + "name": "org_type", + "title": "机构类型", + "type": "str", + "length": 32, + "comments": "0:业主机构;1:分销商;2:公司客户;3:个人客户;4:供应商", + "cwidth": 18, + "uitype": "str", + "datatype": "str", + "label": "机构类型" + }, + { + "name": "accountid", + "title": "账号", + "type": "str", + "length": 32, + "cwidth": 18, + "uitype": "str", + "datatype": "str", + "label": "账号" + } +] + }, + + "page_rows":160, + "cache_limit":5 + } + +}