| | |
| | | #include <wobject/xstring.hpp> |
| | | #include <xcontrol/xtreeview.hpp> |
| | | #include <xcontrol/xdwgrid.hpp> |
| | | use "win.vl" |
| | | use "treeview.vm" |
| | | use "dev:vm[xdwgrid.vm]" |
| | | use "dev:vm[xdwtable.vm]" |
| | | use "pref.vl" |
| | | use "dev:vm[xml.vm]" |
| | | use "dev:vm[xaserverarg.vm]" |
| | | use "dev:vm[xaserver.vm]" |
| | | use "dev:vm[xutil.vm]" |
| | | use "list.vl" |
| | | unit vbusiness.xpage |
| | | [ |
| | | HrOrg is extend list; |
| | | about HrOrg |
| | | [ |
| | | control: |
| | | |
| | | #include "vbusiness/vframe/listwin.vframe.vbusiness.hpp" |
| | | #include "viewobject/view.base.hpp" |
| | | method: |
| | | [ |
| | | xdwgrid__ dw_list; |
| | | treeview__ tv_org; |
| | | string sOrgID; |
| | | string sOrgName; |
| | | |
| | | using xml = KXMLDOMDocument; |
| | | class __declspec(dllexport) Deduction : public xframe |
| | | { |
| | | public: |
| | | xdwgrid dw_list; |
| | | xstring EntityID; |
| | | xstring InvoiceNo; |
| | | string sRootOrgID; |
| | | string sRootOrgName; |
| | | |
| | | xnode m_agentNode; //Agent Condition |
| | | |
| | | public: |
| | | Deduction(void* implPtr, HWND hWnd) :xframe(implPtr, hWnd) {} |
| | | public: |
| | | static Deduction* CreateInstance(void* implPtr, void* hWnd) |
| | | { |
| | | Deduction* pWin = new Deduction(implPtr, (HWND)hWnd); |
| | | return pWin; |
| | | } |
| | | int SetAgent() |
| | | { |
| | | xstring xfNodeAgentArea = L"agentarea"; |
| | | xnode anode = GetAgentNode(xfNodeAgentArea); |
| | | if (m_agentNode) |
| | | { |
| | | SetAgentNode(anode, m_agentNode); |
| | | } |
| | | else |
| | | { |
| | | KXMLDOMElement xframeElement = GetElement(); |
| | | KXMLDOMElement agent = xframeElement.selectSingleNode(L"agent/" + xfNodeAgentArea + L"[1]/*"); |
| | | if (agent) |
| | | xnode__ m_agentNode; //Agent Condition |
| | | string m_agentCond; //Agent Node |
| | | int SetAgent() |
| | | { |
| | | xstring s = agent.xml(); |
| | | m_agentNode = SetAgentNode(anode, s); |
| | | string xfNodeAgentArea = "agentarea"; |
| | | xnode__ anode = new xnode__; |
| | | anode.setNativePointer(GetAgentNode(xfNodeAgentArea)); |
| | | var xframeElement = GetElement(); |
| | | var agent = xframeElement.selectSingleNode("agent/" + xfNodeAgentArea + "[1]/*"); |
| | | if (agent) |
| | | { |
| | | string s = agent.xml; |
| | | SetAgentNodeContent(anode, s); |
| | | } |
| | | return 1; |
| | | } |
| | | } |
| | | return 1; |
| | | } |
| | | |
| | | int OnRowChanged(TEvent* evt, LPARAM p) |
| | | { |
| | | DWNMHDR& hdr = *(DWNMHDR*)evt->notify.pnmh; |
| | | int row = hdr.row; |
| | | SetAgent(); |
| | | return 1; |
| | | } |
| | | int OnRetrieve() |
| | | { |
| | | int hIcon = xutil__::SetCursorWait(); |
| | | xml__ x = new xml__; |
| | | x.setNativePointer(x.CreateInstance()); |
| | | xaserverarg__ arg = new xaserverarg__; |
| | | arg.setNativePointer(arg.CreateInstance()); |
| | | arg.AddArg("guid", sOrgID); |
| | | if (url::get("OrganizationStruct/list.HrOrg", arg.GetString(), x) != 1) |
| | | { |
| | | trace(x.GetXmlDoc().text); |
| | | return -1; |
| | | } |
| | | else |
| | | { |
| | | dw_list.Retrieve(x); |
| | | dw_list.Redraw(); |
| | | } |
| | | dw_list.SetReadOnly(true); |
| | | xutil__::RestoreCursor(hIcon); |
| | | return 1; |
| | | } |
| | | |
| | | //焦点激活处理函数 |
| | | int OnSetFocus(TEvent* evt, LPARAM param) |
| | | { |
| | | //重置工具条 |
| | | SetAgent(); |
| | | return 1; |
| | | } |
| | | //焦点激活处理函数 |
| | | int OnSetFocus(ref TEvent evt, int p) |
| | | { |
| | | SetAgent(); |
| | | //OnRetrieve(); |
| | | //重置工具条 |
| | | return 1; |
| | | } |
| | | |
| | | //命令发布函数 |
| | | int OnCmdDispatch(xstring comdid) |
| | | { |
| | | if (comdid == L"xmSave") |
| | | { |
| | | OnSave(); |
| | | return 1; |
| | | } |
| | | if (comdid == L"xmSearch") |
| | | { |
| | | OnRetrieve(InvoiceNo, EntityID); |
| | | return 1; |
| | | } |
| | | if (comdid == L"xmClose") |
| | | { |
| | | CloseWindow(); |
| | | return 1; |
| | | } |
| | | return 0; |
| | | } |
| | | int OnCreateTree(string sguid, int parentitem) |
| | | { |
| | | int wid = tv_org.GetId(); |
| | | xml__ x = new xml__; |
| | | x.setNativePointer(xml__::CreateInstance()); |
| | | xaserverarg__ arg = new xaserverarg__; |
| | | arg.setNativePointer(arg.CreateInstance()); |
| | | arg.AddArg("sguid", sguid); |
| | | if (url::post("/sale/data/OrganizationStruct/tree.child.OrgChart", arg.GetString(), x) != 1) |
| | | { |
| | | trace(x.GetXml()); |
| | | return -1; |
| | | } |
| | | //trace(x.GetXml()); |
| | | var list = x.GetXmlDoc().selectNodes("//Org"); |
| | | int i = 0, s = list.length; |
| | | msxml::IXMLDOMElement xitem; |
| | | string sname; |
| | | string sguid; |
| | | if (s > 0) |
| | | { |
| | | for (i = 0; i < s; i++) |
| | | { |
| | | xitem = list.item(s - i - 1); |
| | | sname = xitem.SelectSingleNode("OrgName").text; |
| | | sguid = xitem.SelectSingleNode("@guid").text; |
| | | int curItem = tv_org.InsertChildItemEx(wid, parentitem, sname, xitem, 15, 4); |
| | | OnCreateTree(sguid, curItem); |
| | | /*string id = xitem.selectSingleNode("ModuleID").text; |
| | | string Name=""; |
| | | if(xitem.selectSingleNode("ModuleName")) Name=xitem.selectSingleNode("ModuleName").text; |
| | | string image = 15; |
| | | if(xitem.selectSingleNode("ModuelImage")) image=xitem.selectSingleNode("ModuelImage").text; |
| | | int curItem=treeview__::InsertItem(tv_menu.GetId(), parentItem,0,Name,id,image.toInt()); |
| | | string child=xitem.selectSingleNode("@child").text;//item.getAttribute("HasChild"); |
| | | if (child != "0") |
| | | treeview__::SetItemChild1(tv_menu.GetId(), curItem,1);*/ |
| | | } |
| | | } |
| | | return 1; |
| | | } |
| | | |
| | | //命令处理事件 |
| | | int OnXCommand(TEvent* evt, LPARAM param) |
| | | { |
| | | return OnCmdDispatch(evt->xcommand.pStrID); |
| | | } |
| | | int OnTreeExpanding(ref TNotifyEvent evt, int p) |
| | | { |
| | | ref NMTREEVIEW nmtv = evt.pnmh; |
| | | int sitem = nmtv.itemNew.hItem; |
| | | |
| | | xstring GetGuid() |
| | | { |
| | | return publiccode::GetGuid(); |
| | | } |
| | | string id = treeview__::GetItemData(tv_org.GetId(), sitem); |
| | | int hCursor = xutil__::SetCursorWait(); |
| | | OnCreateTree(id, sitem); |
| | | xutil__::RestoreCursor(hCursor); |
| | | return 1; |
| | | } |
| | | |
| | | int OnSave() |
| | | { |
| | | xml x; |
| | | |
| | | dw_list.AcceptText(); |
| | | dw_list.DwUpdateAllToEx(x); |
| | | xaserverarg arg ; |
| | | |
| | | arg.AddArg(L"content", x.xml()); |
| | | trace(x.xml()); |
| | | if (xurl::get(L"/sale/data/AR/update/ARDeduction", arg.GetString(), x) != 1) |
| | | { |
| | | xstring error = x.text(); |
| | | alert(L"err:" + error); |
| | | return 1; |
| | | } |
| | | xstring str = x.documentElement().getAttribute(L"text"); |
| | | if (str == L"true") |
| | | { |
| | | dw_list.ResetUpdateStatus(); |
| | | alert(L"保存成功!"); |
| | | } |
| | | else |
| | | { |
| | | alert(L"保存失败!"); |
| | | } |
| | | return 1; |
| | | } |
| | | //树点击事件 |
| | | int OnTreeSelecded(ref TNotifyEvent evt, int p) |
| | | { |
| | | ref NMTREEVIEW nmtv = evt.pnmh; |
| | | int hItem = nmtv.itemNew.hItem; |
| | | int wid = tv_org.GetId(); |
| | | int hitem = treeview__::GetSelectedItem(wid); |
| | | msxml::IXMLDOMElement ele = treeview__::GetItemData(wid, hitem); |
| | | |
| | | int OnItemChanged(TEvent* evt, LPARAM p) |
| | | { |
| | | DWNMHDR& hdr = *(DWNMHDR*)evt->notify.pnmh; |
| | | xstring colname = hdr.colname; |
| | | xstring value = hdr.data; |
| | | int row = hdr.row; |
| | | xstring dwname = L"dw_list"; |
| | | if (colname == L"DeductionAmount") |
| | | { |
| | | dw_list.SetItemString(row, L"SettlementAdjustID", EntityID); |
| | | xstring id = publiccode::GetGuid(); |
| | | KXMLDOMElement ele = dw_list.GetRowElement(row); |
| | | ele.setAttribute(L"guid", id); |
| | | //dw_list.SetGuid(row,id); |
| | | //alert(ele.xml); |
| | | //alert(dw_list.GetGuid(row)); |
| | | } |
| | | dw_list.Redraw(); |
| | | return 1; |
| | | } |
| | | int hroot = treeview__::GetParentItem(wid, hitem); |
| | | int hparent = treeview__::GetParentItem(wid, hroot); |
| | | if (!hparent) |
| | | { |
| | | hparent = hroot; |
| | | hroot = hitem; |
| | | } |
| | | bool found = false; |
| | | if (hparent) found = true; |
| | | while (treeview__::GetParentItem(wid, hparent)) |
| | | { |
| | | hroot = hparent; |
| | | hparent = treeview__::GetParentItem(wid, hroot); |
| | | } |
| | | if (found) |
| | | { |
| | | msxml::IXMLDOMElement ele1 = treeview__::GetItemData(wid, hroot); |
| | | //trace(ele1.xml); |
| | | //sRootOrgID = ele1.SelectSingleNode("CompanyID").text; |
| | | //sRootOrgName = ele1.selectSingleNode("CompanyID/@_displaystring").text; |
| | | } |
| | | |
| | | int OnAttachEvent() |
| | | { |
| | | //绑定工具条点击事件 |
| | | AttachEvent(L"WM_XCOMMAND", (FEvent)&Deduction::OnXCommand); |
| | | //获取焦点事件,用于重置工具条 |
| | | AttachEvent(L"WM_SETFOCUS", (FEvent)&Deduction::OnSetFocus); |
| | | AttachEvent(L"dw_list", L"DWV_ROWFOCUSCHANGED", (FEvent)&Deduction::OnRowChanged); |
| | | AttachEvent(L"dw_list", L"DWV_ITEMCHANGED", (FEvent)&Deduction::OnItemChanged); |
| | | return 1; |
| | | } |
| | | string ls_orgid = ele.SelectSingleNode("@guid").text; |
| | | sOrgID = ls_orgid + ""; |
| | | //trace(sOrgID); |
| | | sOrgName = ele.selectSingleNode("OrgName").text; |
| | | OnRetrieve(); |
| | | return 1; |
| | | } |
| | | |
| | | int OnTreeMoveNode(ref TNotifyEvent evt, int p) |
| | | { |
| | | ref TVNNMHDR nmtv = evt.pnmh; |
| | | int xfrom = nmtv.FromItem; |
| | | int xto = nmtv.ToItem; |
| | | |
| | | int ret = win__::MessageBox(this.GetHWND(), "确定移动组织节点?", "提示:", 1); |
| | | //trace(ret); |
| | | int wid = tv_org.GetId(); |
| | | if (ret == 2) |
| | | { |
| | | treeview__::DeleteItem(wid, xto); |
| | | return -1; |
| | | } |
| | | |
| | | //string fid = treeview__::GetItemData(wid, xfrom); |
| | | //string tid = treeview__::GetItemData(wid, xto); |
| | | int xtop = treeview__::GetParentItem(wid, xto); |
| | | msxml::IXMLDOMElement ef = treeview__::GetItemData(wid, xfrom); |
| | | msxml::IXMLDOMElement et = treeview__::GetItemData(wid, xtop); |
| | | string fid = ef.SelectSingleNode("@guid").text;//ef.xml; |
| | | string tid = et.SelectSingleNode("@guid").text;//et.xml; |
| | | xml__ x = new xml__; |
| | | x.setNativePointer(xml__::CreateInstance()); |
| | | xaserverarg__ arg = new xaserverarg__; |
| | | arg.setNativePointer(arg.CreateInstance()); |
| | | arg.AddArg("from", fid); |
| | | arg.AddArg("to", tid); |
| | | //trace(et.xml); |
| | | //return 1; |
| | | if (url::post("OrganizationStruct/move.update.HrOrg", arg.GetString(), x) != 1) |
| | | { |
| | | trace("error:" + x.GetXml()); |
| | | alert("移动组织节点出错!"); |
| | | treeview__::DeleteItem(wid, xto); |
| | | return 0; |
| | | } |
| | | treeview__::DeleteItem(wid, xfrom); |
| | | return 1; |
| | | } |
| | | |
| | | //xgridex双击 |
| | | int OnDoubleClicked(ref TNotifyEvent evt, int p) |
| | | { |
| | | ref DWNMHDR hdr = evt.pnmh; |
| | | int row = hdr.row; |
| | | if (row < 1 || row > dw_list.GetRowCount()) |
| | | return 1; |
| | | msxml::IXMLDOMElement e = dw_list.GetRowElement(row); |
| | | string sguid = e.SelectSingleNode("@guid").text; |
| | | xaserverarg__ arg = new xaserverarg__; |
| | | arg.setNativePointer(arg.CreateInstance()); |
| | | arg.AddArg("operate", "modify"); |
| | | arg.AddArg("guid", sguid); |
| | | arg.AddArg("tvOrgID", sOrgID); |
| | | arg.AddArg("tvOrgName", sOrgName); |
| | | arg.AddArg("tvRootOrgID", sRootOrgID); |
| | | arg.AddArg("tvRootOrgName", sRootOrgName); |
| | | //trace(row.toString()); |
| | | //win__::OpenWindow("dev:xpage[HrOrgMaint.xpage]",arg); |
| | | openUrl("组织架构.vface/xpage/HrOrg/maint", arg); |
| | | return 1; |
| | | } |
| | | |
| | | int AddRow() |
| | | { |
| | | /*int wid = tv_org.GetId(); |
| | | int hitem=treeview__::GetSelectedItem(wid); |
| | | int root=treeview__::GetRootItem(wid); |
| | | if (hitem == root) |
| | | { |
| | | win32::MessageBox(GetHWND(),"根组织!","提示",0); |
| | | return -1; |
| | | }*/ |
| | | //int row = dw_list.GetNextSelectRow(1); |
| | | //IXMLDOMElement e = dw_list.GetRowElement(row); |
| | | //string sguid = e.getAttribute("guid"); |
| | | |
| | | xaserverarg__ arg = new xaserverarg__; |
| | | arg.setNativePointer(arg.CreateInstance()); |
| | | arg.AddArg("operate", "new0"); |
| | | arg.AddArg("guid", ""); |
| | | arg.AddArg("tvOrgID", sOrgID); |
| | | arg.AddArg("tvOrgName", sOrgName); |
| | | arg.AddArg("tvRootOrgID", sRootOrgID); |
| | | arg.AddArg("tvRootOrgName", sRootOrgName); |
| | | openUrl("组织架构.vface/xpage/HrOrg/maint", arg); |
| | | return 1; |
| | | } |
| | | |
| | | int ModifyRow() |
| | | { |
| | | int row = dw_list.GetNextSelectRow(1); |
| | | if (row < 1) |
| | | { |
| | | row = dw_list.GetRow(); |
| | | if (row < 1) |
| | | { |
| | | win__::MessageBox(GetHWND(), "请选中要修改的组织数据行!", "提示", 0); |
| | | return -1; |
| | | } |
| | | } |
| | | msxml::IXMLDOMElement e = dw_list.GetRowElement(row); |
| | | string sguid = e.SelectSingleNode("@guid").text; |
| | | xaserverarg__ arg = new xaserverarg__; |
| | | arg.setNativePointer(arg.CreateInstance()); |
| | | arg.AddArg("operate", "modify"); |
| | | arg.AddArg("guid", sguid); |
| | | arg.AddArg("tvOrgID", sOrgID); |
| | | arg.AddArg("tvOrgName", sOrgName); |
| | | arg.AddArg("tvRootOrgID", sRootOrgID); |
| | | arg.AddArg("tvRootOrgName", sRootOrgName); |
| | | openUrl("组织架构.vface/xpage/HrOrg/maint", arg); |
| | | return 1; |
| | | } |
| | | |
| | | int OnDeleteItem(string sguid) |
| | | { |
| | | int wid = tv_org.GetId(); |
| | | int hitem = treeview__::GetSelectedItem(wid); |
| | | int ditem = treeview__::GetChildItem(wid, hitem); |
| | | msxml::IXMLDOMElement e = treeview__::GetItemData(wid, ditem); |
| | | if (e) |
| | | { |
| | | string dguid = e.SelectSingleNode("@guid").text; |
| | | while (dguid != sguid) |
| | | { |
| | | ditem = treeview__::GetNextItem(wid, ditem); |
| | | e = treeview__::GetItemData(wid, ditem); |
| | | dguid = e.SelectSingleNode("@guid").text; |
| | | } |
| | | treeview__::DeleteItem(wid, ditem); |
| | | } |
| | | return 1; |
| | | } |
| | | int DeleteRow() |
| | | { |
| | | int row = dw_list.GetNextSelectRow(1); |
| | | if (row < 1) |
| | | { |
| | | row = dw_list.GetRow(); |
| | | if (row < 1) |
| | | { |
| | | //win__::MessageBox(GetHWND(),"请选中要删除的组织数据行!","提示",0); |
| | | return -1; |
| | | } |
| | | } |
| | | msxml::IXMLDOMElement e = dw_list.GetRowElement(row); |
| | | string sguid = e.SelectSingleNode("@guid").text; |
| | | string sName = e.selectSingleNode("OrgName").text; |
| | | sName += ""; |
| | | xml__ x = new xml__; |
| | | x.setNativePointer(x.CreateInstance()); |
| | | xaserverarg__ arg = new xaserverarg__; |
| | | arg.setNativePointer(arg.CreateInstance()); |
| | | arg.AddArg("guid", sguid); |
| | | if (url::get("OrganizationStruct/child.OrgNums", arg.GetString(), x) != 1) |
| | | { |
| | | trace(x.GetXmlDoc().text); |
| | | return -1; |
| | | } |
| | | else |
| | | { |
| | | msxml::IXMLDOMElement ele = x.GetXmlDoc().documentElement; |
| | | string snums = ele.SelectSingleNode("@num").text; |
| | | int num = snums.toInt(); |
| | | if (num != 0) |
| | | { |
| | | win__::MessageBox(GetHWND(), "组织 " + sName + " 存在下级组织单元,禁止删除!", "提示", 0); |
| | | return 1; |
| | | } |
| | | } |
| | | |
| | | int MB_YESNO = 0x00000004; |
| | | int IDYES = 6; |
| | | if (win__::MessageBox(GetHWND(), "确认要删除组织 " + sName + " 的信息吗?", "提示", MB_YESNO) != IDYES) return 1; |
| | | arg.AddArg("guid", sguid); |
| | | //trace(sguid); |
| | | xml__ x1 = new xml__; |
| | | x1.setNativePointer(x1.CreateInstance()); |
| | | if (url::post("/sale/data/OrganizationStruct/delete.HrOrg", arg.GetString(), x1) != 1) |
| | | { |
| | | string error = x1.GetXmlDoc().text; |
| | | trace(error); |
| | | } |
| | | else |
| | | { |
| | | //win32::MessageBox(GetHWND(),"删除成功!","提示",0); |
| | | dw_list.DeleteRow(row); |
| | | OnDeleteItem(sguid); |
| | | } |
| | | return 1; |
| | | } |
| | | |
| | | int Productlinemaint() |
| | | { |
| | | xaserverarg__ arg = new xaserverarg__; |
| | | arg.setNativePointer(arg.CreateInstance()); |
| | | arg.AddArg("id", "产品线"); |
| | | openUrl("公共设置.vface/worknode/quickcode/config", arg); |
| | | //openUrl("下拉窗口.vface/xpage/hremployee/select", arg); |
| | | |
| | | return 1; |
| | | } |
| | | int setTree() |
| | | { |
| | | string str = "<vbox name='tree' >"; |
| | | str += "<xtree name='tv_org' imagelist='0' drag='true'>"; |
| | | str += "<treeitem src='xquery:[OrgChart.hr.xq]' src1='xquery:[OrgStructureRetrieve.xq]' xcaption='OrgName' xroot='/root' xpath='Org' xchildpath='Org' image='15' loop='yes' xdata='.'/>"; |
| | | str += "</xtree></vbox>"; |
| | | string xfNodeAgentArea = "tree"; |
| | | xnode__ anode = new xnode__; |
| | | anode.setNativePointer(GetAgentNode(xfNodeAgentArea)); |
| | | SetAgentNodeContent(anode, str); |
| | | tv_org = new treeview__; |
| | | tv_org.setNativePointer(this.GetControl("tv_org")); |
| | | AttachEvent("tv_org", "TVN_SELCHANGED", OnTreeSelecded); |
| | | int root = treeview__::GetRootItem(tv_org.GetId()); |
| | | if (root > 0) |
| | | { |
| | | treeview__::ExpandItemEx(tv_org.GetId(), root); |
| | | } |
| | | return 1; |
| | | } |
| | | //命令发布函数 |
| | | int OnCmdDispatch(string comdid) |
| | | { |
| | | if (comdid == "AddRow") { return AddRow(); } |
| | | else if (comdid == "ModifyRow") { return ModifyRow(); } |
| | | else if (comdid == "DeleteRow") { return DeleteRow(); } |
| | | else if (comdid == "OrgType") |
| | | { |
| | | xaserverarg__ arg = new xaserverarg__; |
| | | arg.setNativePointer(arg.CreateInstance()); |
| | | arg.AddArg("id", "组织类型"); |
| | | openUrl("公共设置.vface/worknode/quickcode/config", arg); |
| | | //openUrl("组织架构.vface/xpage/HrOrg/type"); |
| | | } |
| | | else if (comdid == "Refresh") |
| | | { |
| | | OnRetrieve(); |
| | | setTree(); |
| | | AttachEvent("tv_org", "TVN_ENDDRAG", OnTreeMoveNode); |
| | | } |
| | | else if (comdid == "Productlinemaint") |
| | | { |
| | | Productlinemaint(); |
| | | } |
| | | return 0; |
| | | } |
| | | |
| | | //命令处理事件 |
| | | int OnXCommand(ref TXCommandEvent evt, int p) |
| | | { |
| | | return OnCmdDispatch(evt.pStrID); |
| | | } |
| | | |
| | | int OnAttachEvent() |
| | | { |
| | | //绑定工具条点击事件 |
| | | AttachEvent("WM_XCOMMAND", OnXCommand); |
| | | //获取焦点事件,用于重置工具条 |
| | | AttachEvent("WM_SETFOCUS", OnSetFocus); |
| | | //获得树的点击事件 |
| | | AttachEvent("tv_org", "TVN_SELCHANGED", OnTreeSelecded); |
| | | AttachEvent("tv_org", "TVN_ITEMEXPANDING", OnTreeExpanding); |
| | | AttachEvent("tv_org", "TVN_ENDDRAG", OnTreeMoveNode); |
| | | //双击 |
| | | AttachEvent("dw_list", "DWV_DOUBLECLICKED", OnDoubleClicked); |
| | | } |
| | | |
| | | int OnInitial() |
| | | { |
| | | SetAgent(); |
| | | |
| | | OnAttachEvent(); |
| | | |
| | | return 1; |
| | | } |
| | | |
| | | int onload() |
| | | { |
| | | tv_org = new treeview__; |
| | | tv_org.setNativePointer(this.GetControl("tv_org")); |
| | | dw_list = new xdwgrid__; |
| | | dw_list.setNativePointer(this.GetControl("dw_list")); |
| | | dw_list.openUrl("组织架构.vface/template/HrOrg/list"); |
| | | dw_list.SetSelectionMode(1); |
| | | dw_list.SetReadOnly(true); |
| | | dw_list.SetColumnState("OrgPlat", false); |
| | | dw_list.SetColumnState("OrgComLeader", false); |
| | | dw_list.SetColumnState("OrgSupLeader", false); |
| | | dw_list.SetColumnState("OrgProLine", false); |
| | | |
| | | |
| | | int OnRetrieve(xstring InvoiceNo, xstring EntityID) |
| | | { |
| | | xml x; |
| | | |
| | | xaserverarg arg ; |
| | | |
| | | arg.AddArg(L"InvoiceNo", InvoiceNo); |
| | | arg.AddArg(L"InvoiceNoEx", xcontrol(GetControl(L"search")).GetText()); |
| | | arg.AddArg(L"EntityID", EntityID); |
| | | OnInitial(); |
| | | |
| | | //trace(GetControl(L"search").GetText()); |
| | | if (getUrl(L"/sale/data/AR/DeductionList", arg.GetString(), x) != 1) |
| | | { |
| | | trace(x.text()); |
| | | return -1; |
| | | } |
| | | else |
| | | { |
| | | dw_list.Retrieve(x); |
| | | dw_list.Redraw(); |
| | | } |
| | | dw_list.SetSelectionMode(1); |
| | | return 1; |
| | | } |
| | | //OnCreateTree("00000000-0000-0000-0000-000000000000", 0); |
| | | int root = treeview__::GetRootItem(tv_org.GetId()); |
| | | if (root > 0) |
| | | { |
| | | treeview__::ExpandItemEx(tv_org.GetId(), root); |
| | | msxml::IXMLDOMElement ele = treeview__::GetItemData(tv_org.GetId(), root); |
| | | if (ele) |
| | | { |
| | | string ls_orgid = ele.SelectSingleNode("@guid").text; |
| | | sOrgID = ls_orgid + ""; |
| | | sOrgName = ele.selectSingleNode("OrgName").text; |
| | | OnRetrieve(); |
| | | } |
| | | } |
| | | |
| | | int onload() |
| | | { |
| | | SetArg(); |
| | | dw_list = GetControl(L"dw_list"); |
| | | dw_list.openUrl(L"/sale/view/AR/template/Deduction"); |
| | | return 1; |
| | | } |
| | | ] |
| | | |
| | | dw_list.SetColumnState(L"ID", false); |
| | | dw_list.SetColumnState(L"GDNLineID", false); |
| | | dw_list.SetColumnState(L"SettlementAdjustID", false); |
| | | |
| | | |
| | | if (GetWinParam()) |
| | | { |
| | | xaserverarg arg = GetArg(); |
| | | EntityID = arg.GetArgString(L"EntityID"); |
| | | InvoiceNo = arg.GetArgString(L"InvoiceNo"); |
| | | } |
| | | trace(InvoiceNo); |
| | | OnRetrieve(InvoiceNo, EntityID); |
| | | OnAttachEvent(); |
| | | return 1; |
| | | } |
| | | |
| | | int onloaded() |
| | | { |
| | | SetAgent(); |
| | | |
| | | return 1; |
| | | } |
| | | }; |
| | | ] |
| | | ] |