From bb4dc0fab56e542e784311f95ae6d7e7dd785a8f Mon Sep 17 00:00:00 2001
From: xj qian <qianxj15@sina.com>
Date: 星期二, 29 十月 2024 17:10:33 +0800
Subject: [PATCH] update

---
 jrj/project/business/Affair/ProcessManagement.cpp |  180 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 180 insertions(+), 0 deletions(-)

diff --git a/jrj/project/business/Affair/ProcessManagement.cpp b/jrj/project/business/Affair/ProcessManagement.cpp
new file mode 100644
index 0000000..61d753a
--- /dev/null
+++ b/jrj/project/business/Affair/ProcessManagement.cpp
@@ -0,0 +1,180 @@
+#include <wobject/xstring.hpp>
+#include <xcontrol/xtreeview.hpp>
+#include <xcontrol/xdwgrid.hpp>
+#include <xcontrol/xcell.hpp>
+
+
+#include "vbusiness/vframe/listwin.vframe.vbusiness.hpp"
+#include "viewobject/view.base.hpp"
+
+using xml = KXMLDOMDocument;
+	class  __declspec(dllexport) ProcessManagement :  public xframe
+	{
+	public:
+		xdwgrid	dw_list;
+		xnode	m_agentNode;	//Agent Condition
+		
+	public:
+		ProcessManagement(void* implPtr, HWND hWnd) :xframe(implPtr, hWnd) {}
+	public:
+		static ProcessManagement* CreateInstance(void* implPtr, void* hWnd)
+		{
+			ProcessManagement* pWin = new ProcessManagement(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)
+				{
+					xstring s = agent.xml();
+					m_agentNode =  SetAgentNode (anode,s);
+				}
+			}
+			return 1;
+		}
+
+		//焦点激活处理函数
+		int OnSetFocus(TEvent* evt, LPARAM param)
+		{
+			//重置工具条
+			SetAgent();
+			return 1;
+		}
+			
+		//命令发布函数
+		int OnCmdDispatch(xstring comdid)
+		{	
+			
+			if(comdid == L"xmDelete")
+			{
+				int MB_OKCANCEL = 1;
+				int IDOK  = 1;
+				int ret =MessageBox(GetHWND(),L"确认删除流程?",L"提示",MB_OKCANCEL);
+				if(ret == IDOK)
+				{
+					int row = dw_list.GetRow();
+					xstring TaskID = dw_list.GetItemString(row,L"TaskID");
+				
+				
+					xml x = ViewObject::RetrieveData(L"/sale/data/business/DelProcessManagement",L"TaskID",TaskID);
+					xstring status = x.xml();
+					if(status.find(L"ok") == 1)
+					{
+						alert(L"删除成功");
+						dw_list.DeleteRow(row);
+					}else
+					{
+						alert(L"删除失败");
+					}
+				
+				}
+				return 1;
+				
+			}
+			else if (comdid == L"xmRefresh")
+			{
+				OnRetrieve();
+			}
+			else if (comdid == L"AA")
+			{
+				AA();
+			}
+			return 0;
+		}
+		int AA()
+		{		
+		
+				//xstring FobUnitPriceEx=dw_cell.GetItemString(row,colFOBPrice);
+			xstring FobUnitPriceEx=L"$123.0";
+			if(FobUnitPriceEx==L"$") FobUnitPriceEx=L"123";
+			//alert(FobUnitPriceEx.find(L"$").toString());
+			if(FobUnitPriceEx.find(L"$") >=0) FobUnitPriceEx=FobUnitPriceEx.right(FobUnitPriceEx.length() - 1);
+			trace(FobUnitPriceEx);
+		}
+		//触发鼠标离开后tran事件,通过查找某个参数得到对应的列			
+		int OnBaseItemChanged(TEvent* evt, int p)
+		{
+			DWNMHDR& hdr = *(DWNMHDR*)evt->notify.pnmh;
+			xstring colname=hdr.colname;
+			xstring value = hdr.data;
+			
+			xstring dwname = L"dw_list";
+			if(value != L"")
+			{
+				KXMLDOMNodeList nlist = GetElement().selectNodes(L"//*[@name='"+dwname+L"']/trans[@for='"+colname+L"']");
+				ViewObject::TransData(nlist, dw_list, hdr.row, colname, value);
+			}
+
+			return 1;
+		}
+			
+		
+		//命令处理事件
+		int OnXCommand(TEvent* evt, LPARAM param)
+		{
+			return OnCmdDispatch(evt->xcommand.pStrID);
+		}
+			
+		
+		
+		int OnAttachEvent()
+		{
+			//绑定工具条点击事件
+			AttachEvent(L"WM_XCOMMAND", (FEvent)&ProcessManagement::OnXCommand);
+			//获取焦点事件,用于重置工具条
+			AttachEvent(L"WM_SETFOCUS", (FEvent)&ProcessManagement::OnSetFocus);
+			AttachEvent(L"dw_list",L"DWV_ITEMCHANGED", (FEvent)&ProcessManagement::OnBaseItemChanged);
+			return 1;
+		}
+			
+
+		int  OnRetrieve()
+		{
+			xml x;
+			xaserverarg arg;
+			if (getUrl(L"/sale/data/business/ProcessManagement",arg.GetString(),x)!=1)
+			{
+				trace(x.text());
+				return -1;
+			}else	
+			{
+				dw_list.Retrieve(x);
+				dw_list.Redraw();
+				dw_list.SetReadOnly(true);
+				dw_list.SetSelectionMode(1);
+			}
+			return 1;
+		}
+	
+		int onload()
+		{
+			dw_list = GetControl(L"dw_list");
+			dw_list.openUrl(L"/sale/view/Business3/template/ProcessManagement");
+			dw_list.SetColumnState(L"TaskID",false);
+			
+			OnRetrieve();
+			
+			OnAttachEvent();	
+			
+			return 1;
+		}
+		
+		int onloaded()
+		{
+			SetAgent();
+			
+			
+			
+			return 1;
+		}		
+	};
\ No newline at end of file

--
Gitblit v1.9.3