{"id":1609,"date":"2023-08-22T11:01:00","date_gmt":"2023-08-22T03:01:00","guid":{"rendered":"http:\/\/www.plm.cn\/?p=1609"},"modified":"2023-10-17T17:28:36","modified_gmt":"2023-10-17T09:28:36","slug":"%e4%bd%8e%e4%bb%a3%e7%a0%81%e5%b9%b3%e5%8f%b0%e5%af%b9json%e6%a0%bc%e5%bc%8f%e6%95%b0%e6%8d%ae%e8%8e%b7%e5%8f%96","status":"publish","type":"post","link":"http:\/\/www.plm.cn\/1609\/","title":{"rendered":"\u4f4e\u4ee3\u7801\u5e73\u53f0\u5bf9json\u683c\u5f0f\u6570\u636e\u83b7\u53d6"},"content":{"rendered":"

Mobox\u4f4e\u4ee3\u7801\u5e73\u53f0\u6709\u6570\u636e\u662f\u901a\u8fc7json\u683c\u5f0f\u8fdb\u884c\u4f20\u9012\u7684\uff0c\u5bf9\u4e8ejson\u683c\u5f0f \u67094\u7c7b<\/p>\n

1\u3001\u8fd4\u56de\u7eaf\u6570\u7ec4<\/h5>\n

\u63cf\u8ff0\uff1a[“12.5″,”235”]<\/p>\n

\u6570\u636e\u83b7\u53d6\u8fc7\u7a0b\uff1a<\/p>\n

\"\"<\/p>\n

2\u3001\u8fd4\u56de\u7eaf\u5bf9\u8c61<\/h5>\n

\u63cf\u8ff0\uff1a{“id”:”%s”,”name”:”%s”}<\/p>\n

\u6570\u636e\u83b7\u53d6\u8fc7\u7a0b\uff1a<\/p>\n

\"\"<\/p>\n

 <\/p>\n

3\u3001\u8fd4\u56de\u5bf9\u8c61\uff08\u5305\u542b\u6570\u7ec4\uff09<\/h5>\n

\"\"<\/p>\n

\u63cf\u8ff0\uff1a{“id”:”xxx”,”attrs”:[{“attr”:”attr1″,”value”:”xxx1″},{“attr”:”attr2″,”value”:”xxx2″}, …]}<\/p>\n

\u6570\u636e\u83b7\u53d6\u8fc7\u7a0b\uff1a<\/p>\n

\"\"<\/p>\n

4\u3001\u8fd4\u56de\u6570\u7ec4 [\u542b\u5bf9\u8c61\uff08\u542b\u6570\u7ec4\uff09]\u00a0 \u00a0 \u6700\u590d\u6742<\/h5>\n

\u63cf\u8ff0\uff1a[{“id”:”xxx”,”attrs”:[{“attr”:”attr1″,”value”:”xxx1″},{“attr”:”attr2″,”value”:”xxx2″}, …]},…]<\/p>\n

\"\"<\/p>\n

\u6570\u7ec4 \u542b \u5bf9\u8c61\uff08\u542b\u6570\u7ec4\uff09 \u6bd4\u8f83\u591a\u7684\u51fa\u73b0\u5728 grid \uff0c\u884c\u5217\u5904\u7406 \uff08\u6bd4\u5982 \u904d\u5386\u8868\uff0c\u505a\u663e\u793a\u524d\u5904\u7406\uff09<\/p>\n

\u3010\u4f8b\u5b50\u3011<\/span><\/h3>\n
\n

json = require (“json”)<\/p>\n

mobox = require (“OILua_JavelinExt”)<\/p>\n

function AfterSelectCustomer ( strLuaDEID )<\/h5>\n

local nRet, strUserLogin, strUserName , strRetInfo<\/p>\n

local strRetInfo<\/p>\n

— \u83b7\u53d6\u5f53\u524d\u9009\u62e9\u6570\u636e<\/p>\n

nRet, strRetInfo = mobox.getCurEditDataPacket( strLuaDEID )<\/p>\n

if ( nRet~=0 ) then<\/p>\n

mobox.error( strLuaDEID, “\u65e0\u6cd5\u83b7\u53d6Lua\u6570\u636e\u5305!”)<\/p>\n

return<\/p>\n

end<\/p>\n

if ( strRetInfo==” ) then<\/p>\n

mobox.error( strLuaDEID, “\u63a5\u53e3\u6570\u636e\u5305\u4e3a\u7a7a!”)<\/p>\n

return<\/p>\n

end<\/p>\n

local Retobjs<\/p>\n

local n, nCount<\/p>\n

local strKAtax, strKAName, strKASCode, strINDUSTRY, strNATURE, strTEL, strADDRESS, strBank, strACCOUNT, strEXPRESS<\/p>\n

Retobjs = json.decode(strRetInfo)<\/p>\n

nCount = #Retobjs<\/p>\n

if (nCount == 0) then<\/p>\n

return<\/p>\n

end<\/p>\n

local obj, attrs<\/p>\n

for n = 1, nCount do<\/span><\/p>\n

obj = Retobjs[n]<\/p>\n

attrs = obj.attrs<\/p>\n

nattr_count = #attrs<\/p>\n

— \u83b7\u53d6 \u76f8\u5173\u53c2\u6570<\/p>\n

for nIndex = 1, nattr_count do<\/span><\/p>\n

strAttr = attrs[nIndex].attr<\/p>\n

strValue = attrs[nIndex].value<\/p>\n

if (strAttr == ‘S_KA_NAME’) then<\/p>\n

strKAName = strValue<\/p>\n

end<\/p>\n

if (strAttr == ‘S_TAX_CODE’) then<\/p>\n

strKAtax = strValue<\/p>\n

— \u5982\u679c\u5ba2\u6237\u7684\u7a0e\u53f7\u6ca1\u6709\u586b\u5199 \uff0c\u4e0d\u5141\u8bb8\u505a\u5408\u540c<\/p>\n

if ( strKAtax == ” or strKAtax == nil ) then<\/p>\n

mobox.error( strLuaDEID, “\u7a0e\u53f7\u4e0d\u80fd\u4e3a\u7a7a ! \u5148\u4fee\u6539\u6b64\u5ba2\u6237\u5c5e\u6027\uff0c\u5c06\u5176\u7a0e\u53f7\uff08\u53ca\u76f8\u5173\u5f00\u7968\u4fe1\u606f\uff09\u52a0\u5165”)<\/p>\n

return<\/p>\n

end<\/p>\n

end<\/span><\/p>\n

— \u4ee5\u4e0b\u4ee5\u6b64\u7c7b\u63a8 \uff0c\u5bf9\u76f8\u5173\u9700\u8981\u8d4b\u503c\u7684 \u53d8\u91cf \u3002\u3002\u3002<\/span><\/p>\n

end<\/span><\/p>\n

end
\n— \u8bbe\u7f6e \u5546\u673a\u7f16\u53f7,\u5ba2\u6237\u7f16\u53f7\uff0c\u5ba2\u6237\u540d\u79f0<\/p>\n

local setAttr = ‘[{“attr”:”S_KA_CODE”,”value”:”‘..strKASCode..'”},{“attr”:”S_KA_NAME”,”value”:”‘..strKAName..'”},{“attr”:”S_INDUSTRY”,”value”:”‘..strINDUSTRY..'”},{“attr”:”S_NATURE”,”value”:”‘..strNATURE..'”},{“attr”:”S_ACCOUNT”,”value”:”‘..strACCOUNT..'”},{“attr”:”S_TEL”,”value”:”‘..strTEL..'”},{“attr”:”S_ADDRESS”,”value”:”‘..strADDRESS..'”},{“attr”:”S_BANK”,”value”:”‘..strBank..'”},{“attr”:”S_EXPRESS”,”value”:”‘..strEXPRESS..'”},{“attr”:”S_TAX_CODE”,”value”:”‘..strKAtax..'”}]’<\/p>\n

mobox.setCurEditDataObjAttr( strLuaDEID,setAttr )
\nend<\/strong><\/p><\/blockquote>\n<\/div>\n

<\/div>\n

\"\"<\/p>\n","protected":false},"excerpt":{"rendered":"

Mobox\u4f4e\u4ee3\u7801\u5e73\u53f0\u6709\u6570\u636e\u662f\u901a\u8fc7json\u683c\u5f0f\u8fdb\u884c\u4f20\u9012\u7684\uff0c\u5bf9\u4e8ejson\u683c\u5f0f \u67094\u7c7b 1\u3001\u8fd4\u56de\u7eaf\u6570\u7ec4 \u63cf\u8ff0\uff1a[&# […]<\/p>\n","protected":false},"author":1,"featured_media":1353,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,1,12],"tags":[15,14],"class_list":["post-1609","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-plmcenter","category-didaima","category-ssdoc","tag-fangan","tag-jiaoben"],"_links":{"self":[{"href":"http:\/\/www.plm.cn\/wp-json\/wp\/v2\/posts\/1609","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.plm.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.plm.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.plm.cn\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.plm.cn\/wp-json\/wp\/v2\/comments?post=1609"}],"version-history":[{"count":4,"href":"http:\/\/www.plm.cn\/wp-json\/wp\/v2\/posts\/1609\/revisions"}],"predecessor-version":[{"id":1672,"href":"http:\/\/www.plm.cn\/wp-json\/wp\/v2\/posts\/1609\/revisions\/1672"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/www.plm.cn\/wp-json\/wp\/v2\/media\/1353"}],"wp:attachment":[{"href":"http:\/\/www.plm.cn\/wp-json\/wp\/v2\/media?parent=1609"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.plm.cn\/wp-json\/wp\/v2\/categories?post=1609"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.plm.cn\/wp-json\/wp\/v2\/tags?post=1609"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}