From 06f1db87adc76afbfe8552cac0f5628adfeb167b Mon Sep 17 00:00:00 2001
From: lifan <2308045698@qq.com>
Date: 星期三, 10 十二月 2025 14:21:22 +0800
Subject: [PATCH] update

---
 jrj/project/total3/FactoryPaymentMethod.cpp |  197 +++++++++++++++++++++++++++++++++++++++++++++++++
 jrj/ext-jrj/ext-jrj.vcxproj                 |    1 
 jrj/ext-jrj/ext-jrj.vcxproj.filters         |    3 
 3 files changed, 201 insertions(+), 0 deletions(-)

diff --git a/jrj/ext-jrj/ext-jrj.vcxproj b/jrj/ext-jrj/ext-jrj.vcxproj
index 3322168..393e1c8 100644
--- a/jrj/ext-jrj/ext-jrj.vcxproj
+++ b/jrj/ext-jrj/ext-jrj.vcxproj
@@ -1156,6 +1156,7 @@
     </ClCompile>
     <ClCompile Include="..\project\start.vframe.vbusiness.cpp" />
     <ClCompile Include="..\project\total3\FactoryPayment.cpp" />
+    <ClCompile Include="..\project\total3\FactoryPaymentMethod.cpp" />
     <ClCompile Include="..\project\total3\GDNItem.GDN.cpp" />
     <ClCompile Include="..\project\total3\ProductNewList.cpp">
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</ExcludedFromBuild>
diff --git a/jrj/ext-jrj/ext-jrj.vcxproj.filters b/jrj/ext-jrj/ext-jrj.vcxproj.filters
index 2e519d7..2ac2814 100644
--- a/jrj/ext-jrj/ext-jrj.vcxproj.filters
+++ b/jrj/ext-jrj/ext-jrj.vcxproj.filters
@@ -1649,6 +1649,9 @@
     <ClCompile Include="..\project\business\Expense\SalaryslipExs.cpp">
       <Filter>project\business\Expense</Filter>
     </ClCompile>
+    <ClCompile Include="..\project\total3\FactoryPaymentMethod.cpp">
+      <Filter>vbusiness\total</Filter>
+    </ClCompile>
   </ItemGroup>
   <ItemGroup>
     <None Include="ext-jrj.def">
diff --git a/jrj/project/total3/FactoryPaymentMethod.cpp b/jrj/project/total3/FactoryPaymentMethod.cpp
new file mode 100644
index 0000000..09ebd73
--- /dev/null
+++ b/jrj/project/total3/FactoryPaymentMethod.cpp
@@ -0,0 +1,197 @@
+#include <wobject/xwin.hpp>
+#include <xcontrol/xdwgrid.hpp>
+#include <xcontrol/xoffice.hpp>
+#include <xcontrol/xcell.hpp>
+#include <xcontrol/xflowchart.hpp>
+#include <xcontrol/ximageview.hpp>
+#include <xcontrol/xcombobox.hpp>
+
+#include <vbusiness/vutil/publiccode.vutil.vbusiness.hpp>
+#include "viewobject/view.base.hpp"
+
+
+using xml = KXMLDOMDocument;
+class __declspec(dllexport) FactoryPaymentMethod : public xwin
+{
+public:
+	FactoryPaymentMethod(void* implPtr, HWND hWnd) :xwin(implPtr, hWnd) {}
+public:
+	static FactoryPaymentMethod* CreateInstance(void* implPtr, void* hWnd)
+	{
+		FactoryPaymentMethod* pWin = new FactoryPaymentMethod(implPtr, (HWND)hWnd);
+		return pWin;
+	}
+public:
+	xdwgrid	dw_list;
+	xoffice 	dw_office;
+	xcell		dw_cell;
+	xnode	m_agentNode;	//Agent Condition
+	xstring m_category;
+	xstring argStr;
+
+	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, int param)
+	{
+		//重置工具条
+		SetAgent();
+		return 1;
+	}
+
+	//命令发布函数
+	int OnCmdDispatch(xstring comdid)
+	{
+		HCURSOR hCursor = 0;
+		if (comdid == L"xmQuery")
+		{
+			xaserverarg ar;
+
+			ar.AddArg(L"argurl", L"/sale/view/Total3/arg/GDNItemshipfull");
+			if (argStr != L"")
+				ar.AddArg(L"arg", argStr);
+			ar.AddArg(L"action", L"");
+			OpenWindow(L"dev:xpage[view.total.arg.vx]", ar);
+			xstring arstr = ar.GetArgString(L"arg");
+			if (arstr != L"" && ar.GetArgString(L"action") == L"ok")
+			{
+				argStr = arstr;
+				hCursor = xutil::SetCursorWait();
+				OnRetrieve(L"/sale/data/Total3/total/GDNTotal/Item/FactoryPaymentMethod", argStr);
+
+				xutil::RestoreCursor(hCursor);
+			}
+			else
+			{
+				argStr = L"";
+				OnRetrieve(L"/sale/data/Total3/total/GDNTotal/Item/FactoryPaymentMethod", argStr);
+			}
+
+			return 1;
+		}
+		return 0;
+	}
+
+
+
+	int OnCombboChanged(TEvent* evt, int lParam)
+	{
+		int h = xcombobox::GetCurSel(evt->command.hCtrl);
+		if (h > -1)
+		{
+			HCURSOR hCursor = xutil::SetCursorWait();
+			KXMLDOMElement e = xcombobox::GetItemData(evt->command.hCtrl, h);
+
+			PostMessage(GetHWND(), 0x401, (WPARAM)L"xmQuery", 0);
+			//OnCmdDispatch(L"xmQuery");
+			xutil::RestoreCursor(hCursor);
+		}
+		return 1;
+	}
+
+
+
+	//命令处理事件
+	int OnXCommand(TEvent* evt, int param)
+	{
+		return OnCmdDispatch(evt->xcommand.pStrID);
+	}
+
+	int OnDWClick(TEvent* evt, int p)
+	{
+		DWNMHDR& hdr = *(DWNMHDR*)evt->notify.pnmh;
+		xstring value = hdr.data;
+		xstring colname = hdr.colname;
+		int row = hdr.row;
+
+		if (row < 1) return 1;
+
+		return 1;
+	}
+
+	int OnAttachEvent()
+	{
+		//绑定工具条点击事件
+		AttachEvent(L"WM_XCOMMAND", (FEvent)&FactoryPaymentMethod::OnXCommand);
+		//获取焦点事件,用于重置工具条
+		AttachEvent(L"WM_SETFOCUS", (FEvent)&FactoryPaymentMethod::OnSetFocus);
+		AttachEvent(L"cb_report", L"CBN_SELCHANGE", (FEvent)&FactoryPaymentMethod::OnCombboChanged);
+		AttachEvent(L"dw_report", L"DWV_CLICKED", (FEvent)&FactoryPaymentMethod::OnDWClick);
+
+		return 1;
+	}
+
+	int  OnRetrieve(xstring dataurl, xstring argstr)
+	{
+		dw_list.Reset();
+
+		xml x;
+
+		xaserverarg arg;
+
+		arg.AddArg(L"arg", argstr);
+
+
+		if (xurl::get(dataurl, arg.GetString(), x) != 1)
+		{
+			trace(x.text());
+			dw_list.Redraw();
+			return -1;
+		}
+
+		dw_list.Retrieve(x);
+		dw_list.Redraw();
+		dw_list.SetReadOnly(true);
+
+		return 1;
+	}
+
+	int onload()
+	{
+		dw_list = GetControl(L"dw_report");
+		dw_office = GetControl(L"dw_office");
+		dw_cell = GetControl(L"dw_cell");
+		dw_list.openUrl(L"/sale/view/Total3/template/business/gdn/FactoryPaymentMethod");
+
+		dw_list.SetColumnState(L"包装价", false);
+		dw_list.SetColumnState(L"包装总价", false);
+		dw_list.SetColumnState(L"UnitPrice", false);
+		dw_list.SetColumnState(L"SUMUnitPrice", false);
+		dw_list.SetColumnState(L"Packages", false);
+		dw_list.SetColumnState(L"HasImage", false);
+		dw_list.SetColumnState(L"Note", false);
+
+		argStr = L"";
+		xcombobox xc = GetControl(L"cb_report");
+
+
+		OnAttachEvent();
+		return 1;
+	}
+
+	int onloaded()
+	{
+		SetAgent();
+		OnCmdDispatch(L"xmQuery");
+		return 1;
+	}
+};
\ No newline at end of file

--
Gitblit v1.9.3