From 78affdc74a7b86df8a1f07311741f84942ef7944 Mon Sep 17 00:00:00 2001
From: xj qian <qianxj15@sina.com>
Date: 星期四, 11 七月 2024 22:21:17 +0800
Subject: [PATCH] Merge branch 'master' of http://116.62.18.175:6699/r/mis-prj
---
jrj/project/total3/FactoryPayment.cpp | 194 ++++
jrj/project/total3/viewex.total.cpp | 389 +++++++++
jrj/project/total3/viewex.total2.cpp | 370 +++++++++
jrj/project/total3/ProductNewList.cpp | 598 +++++++++++++++
jrj/project/total3/GDNItem.GDN.cpp | 195 +++++
jrj/project/total3/viewex.total1.cpp | 369 +++++++++
jrj/ext-jrj/ext-jrj.vcxproj | 7
jrj/project/total3/ProductNoOut.SO.cpp | 188 ++++
jrj/ext-jrj/ext-jrj.vcxproj.filters | 21
9 files changed, 2,331 insertions(+), 0 deletions(-)
diff --git a/jrj/ext-jrj/ext-jrj.vcxproj b/jrj/ext-jrj/ext-jrj.vcxproj
index f927954..2d39947 100644
--- a/jrj/ext-jrj/ext-jrj.vcxproj
+++ b/jrj/ext-jrj/ext-jrj.vcxproj
@@ -679,6 +679,13 @@
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\project\start.vframe.vbusiness.cpp" />
+ <ClCompile Include="..\project\total3\FactoryPayment.cpp" />
+ <ClCompile Include="..\project\total3\GDNItem.GDN.cpp" />
+ <ClCompile Include="..\project\total3\ProductNewList.cpp" />
+ <ClCompile Include="..\project\total3\ProductNoOut.SO.cpp" />
+ <ClCompile Include="..\project\total3\viewex.total.cpp" />
+ <ClCompile Include="..\project\total3\viewex.total1.cpp" />
+ <ClCompile Include="..\project\total3\viewex.total2.cpp" />
<ClCompile Include="..\project\total3\ViewTotalArgWin.cpp" />
<ClCompile Include="..\project\total3\ViewExTotalWin.cpp" />
<ClCompile Include="..\project\tradedocument\DocFileSaveDlg.cpp" />
diff --git a/jrj/ext-jrj/ext-jrj.vcxproj.filters b/jrj/ext-jrj/ext-jrj.vcxproj.filters
index 0256d21..7638a8b 100644
--- a/jrj/ext-jrj/ext-jrj.vcxproj.filters
+++ b/jrj/ext-jrj/ext-jrj.vcxproj.filters
@@ -818,5 +818,26 @@
<ClCompile Include="..\project\business\QuoteFile.cpp">
<Filter>project\business</Filter>
</ClCompile>
+ <ClCompile Include="..\project\total3\FactoryPayment.cpp">
+ <Filter>vbusiness\total</Filter>
+ </ClCompile>
+ <ClCompile Include="..\project\total3\GDNItem.GDN.cpp">
+ <Filter>vbusiness\total</Filter>
+ </ClCompile>
+ <ClCompile Include="..\project\total3\ProductNewList.cpp">
+ <Filter>vbusiness\total</Filter>
+ </ClCompile>
+ <ClCompile Include="..\project\total3\ProductNoOut.SO.cpp">
+ <Filter>vbusiness\total</Filter>
+ </ClCompile>
+ <ClCompile Include="..\project\total3\viewex.total.cpp">
+ <Filter>vbusiness\total</Filter>
+ </ClCompile>
+ <ClCompile Include="..\project\total3\viewex.total1.cpp">
+ <Filter>vbusiness\total</Filter>
+ </ClCompile>
+ <ClCompile Include="..\project\total3\viewex.total2.cpp">
+ <Filter>vbusiness\total</Filter>
+ </ClCompile>
</ItemGroup>
</Project>
\ No newline at end of file
diff --git a/jrj/project/total3/FactoryPayment.cpp b/jrj/project/total3/FactoryPayment.cpp
new file mode 100644
index 0000000..1272168
--- /dev/null
+++ b/jrj/project/total3/FactoryPayment.cpp
@@ -0,0 +1,194 @@
+#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) FactoryPayment : public xwin
+ {
+ public:
+ FactoryPayment(void* implPtr, HWND hWnd) :xwin(implPtr, hWnd) {}
+ public:
+ static FactoryPayment* CreateInstance(void* implPtr, void* hWnd)
+ {
+ FactoryPayment* pWin = new FactoryPayment(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/template/SOSupplierInfoArg");
+ 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/SOSupplierInfoList", argStr);
+
+ xutil::RestoreCursor(hCursor);
+ }
+ else
+ {
+ argStr = L"";
+ OnRetrieve(L"/sale/data/Total3/total/SOSupplierInfoList", 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)&FactoryPayment::OnXCommand);
+ //获取焦点事件,用于重置工具条
+ AttachEvent(L"WM_SETFOCUS", (FEvent)&FactoryPayment::OnSetFocus);
+ AttachEvent(L"cb_report", L"CBN_SELCHANGE", (FEvent)&FactoryPayment::OnCombboChanged);
+ AttachEvent(L"dw_report", L"DWV_CLICKED", (FEvent)&FactoryPayment::OnDWClick);
+ }
+
+ 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/SOSupplierInfoList");
+
+ /*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
diff --git a/jrj/project/total3/GDNItem.GDN.cpp b/jrj/project/total3/GDNItem.GDN.cpp
new file mode 100644
index 0000000..f2730a1
--- /dev/null
+++ b/jrj/project/total3/GDNItem.GDN.cpp
@@ -0,0 +1,195 @@
+#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) ViewGDNItemTotalWin : public xwin
+ {
+ public:
+ ViewGDNItemTotalWin(void* implPtr, HWND hWnd) :xwin(implPtr, hWnd) {}
+ public:
+ static ViewGDNItemTotalWin* CreateInstance(void* implPtr, void* hWnd)
+ {
+ ViewGDNItemTotalWin* pWin = new ViewGDNItemTotalWin(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/Full1", argStr);
+
+ xutil::RestoreCursor(hCursor);
+ }
+ else
+ {
+ argStr = L"";
+ OnRetrieve(L"/sale/data/Total3/total/GDNTotal/Item/Full1", 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)&ViewGDNItemTotalWin::OnXCommand);
+ //获取焦点事件,用于重置工具条
+ AttachEvent(L"WM_SETFOCUS", (FEvent)&ViewGDNItemTotalWin::OnSetFocus);
+ AttachEvent(L"cb_report", L"CBN_SELCHANGE", (FEvent)&ViewGDNItemTotalWin::OnCombboChanged);
+ AttachEvent(L"dw_report", L"DWV_CLICKED", (FEvent)&ViewGDNItemTotalWin::OnDWClick);
+ }
+
+ 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/GDNitem/ship/full");
+
+ 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
diff --git a/jrj/project/total3/ProductNewList.cpp b/jrj/project/total3/ProductNewList.cpp
new file mode 100644
index 0000000..93a0616
--- /dev/null
+++ b/jrj/project/total3/ProductNewList.cpp
@@ -0,0 +1,598 @@
+#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 "xcontrol/xshtml.hpp"
+
+#include <vbusiness/vutil/publiccode.vutil.vbusiness.hpp>
+#include "viewobject/view.base.hpp"
+#include "vbusiness/vframe/frame.vframe.vbusiness.hpp"
+#include "viewobject/productlibrary.view.hpp"
+
+using xml = KXMLDOMDocument;
+ class __declspec(dllexport) ProductNewList : public xframe
+ {
+ public:
+ ProductNewList(void* implPtr, HWND hWnd) :xframe(implPtr, hWnd) {}
+ public:
+ static ProductNewList* CreateInstance(void* implPtr, void* hWnd)
+ {
+ ProductNewList* pWin = new ProductNewList(implPtr, (HWND)hWnd);
+ return pWin;
+ }
+ public:
+ xdwgrid dw_list;
+ KXMLDOMElement imageElement;
+ xnode m_agentNode; //Agent Condition
+
+ 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 OnRetrieve()
+ {
+ xml x;
+ xcontrol query = GetControl(L"sle_search");
+ xstring keyword = query.GetText();
+ //alert(keyword);
+
+ xaserverarg arg ;
+
+ arg.AddArg(L"keyword", keyword);
+ if (xurl::get(L"/sale/data/ProductLibrary3/data/list/newlist", arg.GetString(), x) != 1)
+ {
+ xstring error = x.text();
+ trace(error);
+ }
+ else
+ {
+ //alert(x.GetXml());
+ dw_list.Retrieve(x);
+ //dw_list.SetReadOnly(true);
+ }
+
+ for (int i = 1; i <= dw_list.GetColumnCount(); i++)
+ {
+ //trace(dw_list.GetColumnName(i));
+ if (dw_list.GetColumnName(i) != L"GoodsNo" &&
+ dw_list.GetColumnName(i) != L"EName" &&
+ dw_list.GetColumnName(i) != L"CName")
+ dw_list.SetReadOnlyColumn(i);
+ }
+ dw_list.Redraw();
+ }
+
+ int OnRetrieveEx()
+ {
+ xml x;
+ xcontrol query = GetControl(L"sle_search");
+ xstring keyword = query.GetText();
+ //alert(keyword);
+
+ xaserverarg arg ;
+
+ arg.AddArg(L"keyword", keyword);
+ if (xurl::get(L"/sale/data/ProductLibrary3/data/list/newlistEx", arg.GetString(), x) != 1)
+ {
+ xstring error = x.text();
+ trace(error);
+ }
+ else
+ {
+ //alert(x.GetXml());
+ dw_list.Retrieve(x);
+ //dw_list.SetReadOnly(true);
+ }
+
+ for (int i = 1; i <= dw_list.GetColumnCount(); i++)
+ {
+ //trace(dw_list.GetColumnName(i));
+ if (dw_list.GetColumnName(i) != L"GoodsNo" &&
+ dw_list.GetColumnName(i) != L"EName" &&
+ dw_list.GetColumnName(i) != L"CName")
+ dw_list.SetReadOnlyColumn(i);
+ }
+ dw_list.Redraw();
+ }
+
+ xml GetGoodsPropList(xstring guid)
+ {
+ xml x;
+
+ xaserverarg arg ;
+
+ arg.AddArg(L"guid", guid);
+ if (xurl::get(L"/sale/data/SO/goods/goodsprop/list", arg.GetString(), x) != 1)
+ {
+ xstring error = x.text();
+ alert(error);
+ }
+ return x;
+ }
+
+ xml GetGoodsPropListEx(xstring guid)
+ {
+ xml x;
+
+ xstring fields = L"<data>";
+ //fields +=L"<field name='HighestPrice' label='最高价'/>";
+ //fields +=L"<field name='LowestPrice' label='最低价'/>";
+
+ //fields +=L"<field name='BulkPrice' label='散货价'/>";
+ //fields +=L"<field name='CardPrice' label='纸卡价'/>";
+ //fields +=L"<field name='BuyPrice' label='采购价'/>";
+ //fields +=L"<field name='SupplierID' label='货源'/>";
+
+ fields += L"<field name='Packing' label='包装方式'/>";
+ fields += L"<field name='PackingRate' label='每箱数量'/>";
+ fields += L"<field name='VolumeDesc1' label='包装尺码'/>";
+ fields += L"<field name='GWPerPkg' label='毛重'/>";
+ fields += L"<field name='NWPerPkg' label='净重'/>";
+ //fields +=L"<field name='DeveloperID' label='开发人员'/>";
+ fields += L"<field name='AttributeValue_1' label='产品属性'/>";
+ //fields +=L"<field name='Remark' label='备注'/>";
+
+ fields += L"</data>";
+ x.loadXML(fields);
+
+ return x;
+ }
+
+ xstring makeHtml(int row)
+ {
+ xstring id = dw_list.GetGuid(row);
+
+ xml x = GetGoodsPropList(id);
+ xml x1 = GetGoodsPropListEx(id);
+
+ xstring html = L"<html><style> .text{ font-weight:400} .label { font-weight:400;}</style><body style='margin:2;background-color:#ccdccc none #f0f0f0 none'>";
+ html += L"<div ><span style='font-weight:700;width:50;font-size:10pt' >编号:</span><span style='width:90;font-size:10pt'>" + dw_list.GetItemString(row, L"SKUNo") +
+ L"</span> <span style='font-weight:700;width:50;font-size:10pt' >类项:</span><span style='width:90;font-size:10pt'>" + dw_list.GetItemString(row, L"RefNo") +
+ L"</span></div>";
+ html += L"<div ><span style='font-weight:700;width:50;font-size:10pt' >公司型号:</span><span style='width:90;font-size:10pt'>" + dw_list.GetItemString(row, L"GoodsNo") +
+ L"</span></div>";
+ html += L"<div ><span style='font-weight:700;width:50;font-size:10pt' >品名:</span><span style='width:90;font-size:10pt'>" + dw_list.GetItemString(row, L"CName") +
+ L"</span></div>";
+ if (dw_list.GetItemString(row, L"CSpec") != L"")
+ html += L"<div ><span style='font-weight:700;width:50;font-size:10pt' >规格:</span><span style='width:90;font-size:10pt'>" + dw_list.GetItemString(row, L"CSpec") +
+ L"</span></div>";
+
+ KXMLDOMNodeList fieldsEx = x1.selectNodes(L"data/field");
+ xstring ls_detail = L"";
+ xstring ls_item = L"";
+ xstring name;
+ xstring label;
+ int len = fieldsEx.length();
+ int i = 0;
+
+ for (i = 0; i < len; true)
+ {
+ int cnt = 0;
+ ls_item = L"";
+ while (cnt < 2)
+ {
+ name = fieldsEx.item(i).selectSingleNode(L"@name").text();
+ label = fieldsEx.item(i).selectSingleNode(L"@label").text();
+ ls_item += L"<td>" + label + L"</td>" + L"<td style='text-align:center'>" + dw_list.GetItemString(row, name) + L"</td>";
+ cnt++;
+ i++;
+ if (i == len)break;
+ }
+ ls_detail += L"<tr>" + ls_item + L"</tr>";
+ }
+ html += (xstring)L"<div style='margin-left:8px;margin-right:16px;'>" +
+ +L"<table><colgroup span='1' width='70'/><colgroup span='1' width='120'/><colgroup span='1' width='70'/><colgroup span='1' width='120'/>"
+ + ls_detail
+ + L"</table>"
+ + L"</div>";
+
+ xstring ls_star = L"";
+ KXMLDOMNodeList fields = x.selectNodes(L"data/field");
+ len = fields.length();
+
+ ls_detail = L"";
+ if (len > 0)
+ html += L"<div ><span style='font-weight:700;width:50;font-size:10pt' >技术要求:</span></div>";
+ for (i = 0; i < len; true)
+ {
+ ls_item = L"";
+
+ int count = 0;
+ while (count < 2)
+ {
+ name = fields.item(i).selectSingleNode(L"@name").text();
+ label = fields.item(i).selectSingleNode(L"@label").text();
+ if (name == L"QualityTerm" || name == L"PackTerm" || label == L"质量" || label == L"包装质量" || label == L"技术要求")
+ {
+ i++;
+ if (i >= len)count = 2;
+ continue;
+ }
+ else if (dw_list.GetItemString(row, name) == L"")
+ {
+ KXMLDOMNodeList options = fields.item(i).selectNodes(L"item");
+ int tlen = options.length();
+ xstring terms = L"";
+ for (int k = 0; k < tlen; k++)
+ {
+ if (options.item(k).text())
+ {
+ if (k > 0) terms += L", L";
+ terms += L"[" + xstring(options.item(k).text()) + L"]";
+ }
+ }
+ ls_star += L"<div ><span style='font-weight:700;width:50;font-size:10pt' >" + label + L"*:</span><span style='width:90;font-size:10pt'>" + terms + L"</span></div>";
+ }
+ else
+ {
+ ls_item = L"<td>" + label + L"</td>" + L"<td>" + dw_list.GetItemString(row, name) + L"</td>";
+ count++;
+ }
+ i++;
+ if (i >= len)count = 2;
+ }
+ ls_item = L"<tr>" + ls_item + L"</tr>";
+ ls_detail += ls_item;
+ }
+
+ html +=(xstring) L"<div style='margin-left:8px;margin-right:16px;'>" +
+ +L"<table><colgroup span='1' width='70'/><colgroup span='1' width='120'/><colgroup span='1' width='70'/><colgroup span='1' width='120'/>"
+ + ls_detail
+ + L"</table>"
+ + L"</div>";
+ if (dw_list.GetItemString(row, L"QualityTerm") != L"")
+ {
+ html += L"<div style='height:12px'/>";
+ html += L"<div ><span style='font-weight:700;width:50;font-size:10pt' >质量:</span></div>";
+ html += L"<div ><span style='margin-left:8px;margin-right:16px;font-weight:400;font-size:10pt' >" + dw_list.GetItemString(row, L"QualityTerm") + L"</span></div>";
+ }
+
+ if (dw_list.GetItemString(row, L"PackTerm") != L"")
+ {
+ html += L"<div style='height:12px'/>";
+ html += L"<div ><span style='font-weight:700;width:50;font-size:10pt' >包装质量:</span></div>";
+ html += L"<div ><span style='margin-left:8px;margin-right:16px;font-weight:400;font-size:10pt' >" + dw_list.GetItemString(row, L"PackTerm") + L"</span></div>";
+ }
+
+ if (dw_list.GetItemString(row, L"Remark") != L"")
+ {
+ //html += L"<div style='height:12px'/>";
+ html += L"<div ><span style='font-weight:700;width:50;font-size:10pt' >备注:</span></div>";
+ html += L"<div ><span style='margin-left:8px;margin-right:16px;font-weight:400;font-size:10pt' >" + dw_list.GetItemString(row, L"Remark") + L"</span></div>";
+ }
+
+ html += L"<div style='height:24px'/>";
+
+ //星标项
+ html += ls_star;
+
+ //显示图片
+ /*
+ if (id != L"")
+ {
+ xml xp=new xml;
+ xp.setNativePointer(xml::CreateInstance());
+ xaserverarg arg_pic=new xaserverarg;
+ arg_pic.setNativePointer(arg_pic.CreateInstance());
+ arg_pic.AddArg(L"SKUID",id);
+ if(xurl::get(L"/sale/data/ProductLibrary3/pref/picture/imagelistSKU",arg_pic.GetString(),xp)!=1)
+ {
+ trace(L"xxx",xp.GetXml());
+ }else {
+ html += L"<div ><span style='font-weight:700;width:50;font-size:10pt' >图片:</span>" ;
+ KXMLDOMElement ep= xp.selectSingleNode(L"ImageList");
+ if (ep)
+ {
+ if (ep.SelectNodes(L"image")){
+ KXMLDOMNodeList nlistp = ep.SelectNodes(L"image");
+ int ip=0;
+ int lenp = nlistp.length();
+ for(ip=0;ip<lenp;ip++)
+ {
+ KXMLDOMElement xitemp = nlistp.item(ip);
+ xstring filename = xitemp.selectSingleNode(L"PicPath").text();
+ //trace(filename);
+ html += L"<control visible='layer' controlclass='ximage' data='' src='http://192.168.7.241:7001" + filename +L"'/>";
+ }
+ }
+ }
+ html += L"</div>";
+ }
+ }else {
+ xstring picname = L"1FA9E331-F95C-4E51-B80C-73FB9B911D8D.jpg";//dw_list.GetItemString(row,L"ImgName"); //ItemID+L".jpg";
+ xstring str = picname.mid(0,2);
+ str = str.upper();
+ xstring serversrc =L"http://192.168.7.241:1001/business/products/chanpin/"+str+L"/"+picname;
+ html += L"<div ><span style='font-weight:700;width:50;font-size:10pt' >图片:</span>";
+ html += L"<control visible='layer' controlclass='ximage' data='' src='"+ serversrc +L"'/></div>";
+ }
+ */
+ html += L"</body></html>";
+ //trace(html);
+ return html;
+ }
+
+ int OnShowImage(xstring skuid)
+ {
+ ximageview im = GetControl(L"im1");
+ //im.RemoveImage();
+ im.Reset();
+
+ xml xp;
+
+ xaserverarg arg_pic ;
+
+ arg_pic.AddArg(L"SKUID", skuid);
+ if (xurl::get(L"/sale/data/ProductLibrary3/pref/picture/imagelistSKU", arg_pic.GetString(), xp) != 1)
+ {
+ trace(L"xxx:" + xstring(xp.xml(), true));
+ }
+ else
+ {
+ //trace(skuid+L" "+xp.GetXml());
+ imageElement = xp.documentElement();
+ KXMLDOMNodeList nlistp = xp.selectNodes(L"ImageList/image");
+ int lenp = nlistp.length();
+ for (int ip = 0; ip < lenp; ip++)
+ {
+ KXMLDOMElement xitem = nlistp.item(ip);
+ xstring picname = xitem.selectSingleNode(L"PicPath").text();
+ xstring goodno = xitem.selectSingleNode(L"GoodsNo").text();
+ if (picname == L"/business/products/Thumbs//")
+ picname = L"/business/products/Thumbs/00/00000000-0000-0000-0000-000000000000.jpg";
+ im.AddImages(picname, L"");
+ }
+ im.Redraw();
+ //win32::SendMessage(im.GetId(),0x000f,0,1);
+ //win32::InvalidateRect(im.GetId(),cast(0 as ref xrect),true);
+ }
+ return 1;
+ }
+
+ int OnRowChanged(TEvent* evt, int p)
+ {
+ DWNMHDR& hdr = *(DWNMHDR*)evt->notify.pnmh;
+ int row = hdr.row;
+
+ xshtml xs = GetControl(L"html_detail");
+ xstring html = makeHtml(row);
+ xs.SetContent(html);
+ xs.Redraw();
+
+ xstring id = dw_list.GetGuid(row);
+ OnShowImage(id);
+
+ return 1;
+ }
+
+ int OnImgDBClicked(TEvent* evt, int pr)
+ {
+ IMGNNMHDR& nmtv = *(IMGNNMHDR*)evt->notify.pnmh;
+ xstring src = nmtv.path;
+ /*if(src.length() > 60)
+ src = src.right(44);
+ else
+ src=src.mid(src.find(L"Thumbs", 0)+6, 50);
+ */
+ xaserverarg& arg = *new xaserverarg;
+
+ //arg.AddArg(L"src",L"/business/products/chanpin"+src);
+ arg.AddArg(L"src", src);
+
+ //win::OpenWindow(L"dev:xpage[BigPicture.vx]",arg);
+
+ //int h = (L"/sale/view/ProductLibrary/xpage/bigpictureview", arg);
+ int h = openUrl(L"dev:xpage[BigPictureView.Product3.vx]", &arg);
+
+ /*
+ xwin x = new xwin;
+ x.setNativePointer(h);
+ m_winHwnd = x.GetHWND();
+
+ xstring sh = doc.GetXml();
+ int p = cast(sh as int);
+ win32::SendMessage(m_winHwnd, 0x401, p, 0);
+ */
+ return 1;
+ }
+
+ int OnSave()
+ {
+ dw_list.AcceptText();
+ if (dw_list.GetRowCount() < 1) return 0;
+ xstring error = L"";
+ xml x;
+
+ dw_list.DwUpdateAllToEx(x);
+ xaserverarg arg ;
+
+ arg.AddArg(L"content", x.xml());
+
+ //trace(x.GetXml());
+ if (xurl::get(L"/sale/data/ProductLibrary3/update/productex", arg.GetString(), x) != 1)
+ {
+ error = x.text();
+ alert(error);
+ return 1;
+ }
+ else
+ {
+ alert(L"保存成功");
+ arg.AddArg(L"No", dw_list.GetItemString(dw_list.GetRow(), L"SKUNo"));
+ if (xurl::get(L"/sale/data/business/message/productApplyedMessage", arg.GetString(), x) != 1)
+ {
+ error = x.text();
+ trace(error);
+ return 0;
+ }
+ }
+ return 1;
+ }
+ int OnMakeNewGoodsNo()
+ {
+ if (dw_list.GetItemString(dw_list.GetRow(), L"GoodsNo") != L"") return 1;
+ if (dw_list.GetRowCount() < 1) return 1;
+ xaserverarg arg ;
+
+ arg.AddArg(L"EntityID", dw_list.GetGuid(dw_list.GetRow()));
+ KXMLDOMElement e = dw_list.GetRowElement(dw_list.GetRow());
+ int pr = cast(e as int);
+ arg.AddArg(L"data",xstring( pr));
+ pr = cast(dw_list as int);
+ arg.AddArg(L"dw", pr.toString());
+ arg.AddArg(L"HWND", xstring((__int64)GetHWND()));
+ OpenWindow(L"dev:xpage[ProductNewItem.vx]", arg );
+ return 1;
+ }
+
+ //命令发布函数
+ int OnCmdDispatch(xstring comdid)
+ {
+ if (comdid == L"xmCancel")
+ {
+ CloseWindow();
+ return 1;
+ }
+ if (comdid == L"xmMakeGoodsNo")
+ {
+ return OnMakeNewGoodsNo();
+ }
+ if (comdid == L"xmProductView")
+ {
+ OpenWindow(L"dev:xpage[Product.SearchDlg.vx]", 0);
+ return 1;
+ }
+ if (comdid == L"xmRefresh")
+ {
+ if (xaserver::GetUserNo() != L"00A01")
+ {
+ OnRetrieve();
+ }
+ else
+ {
+ OnRetrieveEx();
+ }
+ return 1;
+ }
+ if (comdid == L"xmDelete")
+ {
+
+ int row = listwin::dw_list.GetNextSelectRow(1);
+
+ if (row < 1) {
+ row = listwin::dw_list.GetRow();
+ if (row < 1) {
+ //win::MessageBox(GetHWND(),L"请选中要删除的行!",L"提示",0);
+ return -1;
+ }
+ }
+
+ KXMLDOMElement e = listwin::dw_list.GetRowElement(row);
+
+ xstring sguid = e.selectSingleNode(L"@guid").text();
+
+ int MB_YESNO = 0x00000004;
+ int IDYES = 6;
+ if (MessageBox(GetHWND(), L"确认删除吗?", L"提示", MB_YESNO) != IDYES) return 1;
+ xml x;
+
+ xaserverarg arg ;
+
+ arg.AddArg(L"EntityID", sguid);
+ // trace(sguid);
+ if (xurl::post(L"/sale/data/ProductLibrary3/delete/Product", arg.GetString(), x) != 1)
+ {
+ xstring error = x.text();
+ trace(error);
+ }
+ else
+ {
+ KXMLDOMElement msg = x.selectNodes(L"process").item(0);
+ xstring success = msg.selectSingleNode(L"@finished").text();
+ if (success == L"0")
+ {
+ alert(msg.selectSingleNode(L"@errInfo").text());
+ }
+ else
+ {
+ MessageBox(GetHWND(), L"删除成功!", L"提示", 0);
+ listwin::dw_list.DeleteRow(row);
+ }
+ }
+ return 1;
+ }
+
+ if (comdid == L"xmSave") return OnSave();
+
+ return 0;
+ }
+
+
+
+ //命令处理事件
+ int OnXCommand(TEvent* evt, int param)
+ {
+ return OnCmdDispatch(evt->xcommand.pStrID);
+ }
+
+ int OnAttachEvent()
+ {
+ //绑定工具条点击事件
+ AttachEvent(L"WM_XCOMMAND", (FEvent)&ProductNewList::OnXCommand);
+ //获取焦点事件,用于重置工具条
+ AttachEvent(L"WM_SETFOCUS", (FEvent)&ProductNewList::OnSetFocus);
+ AttachEvent(L"dw_list", L"DWV_ROWFOCUSCHANGED", (FEvent)&ProductNewList::OnRowChanged);
+ AttachEvent(L"im1", L"IMG_LDBCLICK", (FEvent)&ProductNewList::OnImgDBClicked);
+ }
+
+ int onload()
+ {
+ dw_list = GetControl(L"dw_list");
+ dw_list.SetDataObject(ProductLibraryView::GetMaintListForm3(L""));
+ dw_list.SetEditUpperMode(true);
+ dw_list.SetReadOnly(true);
+ OnAttachEvent();
+
+ dw_list.SetColumnState(L"SKUID", false);
+
+ return 1;
+ }
+
+ int onloaded()
+ {
+ SetAgent();
+
+ if (xaserver::GetUserNo() != L"00A01") OnRetrieve();
+
+
+ return 1;
+ }
+ };
\ No newline at end of file
diff --git a/jrj/project/total3/ProductNoOut.SO.cpp b/jrj/project/total3/ProductNoOut.SO.cpp
new file mode 100644
index 0000000..9f3243b
--- /dev/null
+++ b/jrj/project/total3/ProductNoOut.SO.cpp
@@ -0,0 +1,188 @@
+#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) ViewProductNoOutTotalWin : public xwin
+ {
+ public:
+ ViewProductNoOutTotalWin(void* implPtr, HWND hWnd) :xwin(implPtr, hWnd) {}
+ public:
+ static ViewProductNoOutTotalWin* CreateInstance(void* implPtr, void* hWnd)
+ {
+ ViewProductNoOutTotalWin* pWin = new ViewProductNoOutTotalWin(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/SODY");
+ if (argStr != L"")
+ ar.AddArg(L"arg", argStr);
+ 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/SODY", argStr);
+
+ xutil::RestoreCursor(hCursor);
+ }
+
+ else
+ {
+ argStr = L"";
+ OnRetrieve(L"/sale/data/Total3/total/SODY", 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);
+ SwitchReport(e);
+ 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)&ViewProductNoOutTotalWin::OnXCommand);
+ //获取焦点事件,用于重置工具条
+ AttachEvent(L"WM_SETFOCUS", (FEvent)&ViewProductNoOutTotalWin::OnSetFocus);
+ AttachEvent(L"cb_report", L"CBN_SELCHANGE", (FEvent)&ViewProductNoOutTotalWin::OnCombboChanged);
+ AttachEvent(L"dw_report", L"DWV_CLICKED", (FEvent)&ViewProductNoOutTotalWin::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/PRODUCTSODY");
+
+ 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
diff --git a/jrj/project/total3/viewex.total.cpp b/jrj/project/total3/viewex.total.cpp
new file mode 100644
index 0000000..57e3bd0
--- /dev/null
+++ b/jrj/project/total3/viewex.total.cpp
@@ -0,0 +1,389 @@
+#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 ViewEx111TotalWin : public xwin
+ {
+ public:
+ ViewEx111TotalWin(void* implPtr, HWND hWnd) :xwin(implPtr, hWnd) {}
+ public:
+ static ViewEx111TotalWin* CreateInstance(void* implPtr, void* hWnd)
+ {
+ ViewEx111TotalWin* pWin = new ViewEx111TotalWin(implPtr, (HWND)hWnd);
+ return pWin;
+ }
+ public:
+ xdwgrid dw_list;
+ xoffice dw_office;
+ xcell dw_cell;
+ xnode m_agentNode; //Agent Condition
+ KXMLDOMElement rptEle;
+ xstring m_category;
+ xstring argStr;
+
+ int hWndImageView;
+ int hWndRetrieveTip;
+ bool dataretrieveing;
+
+ 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)
+ {
+ xstring UserNo = publiccode::GetUser().no;
+
+ HCURSOR hCursor = 0;
+ //if(UserNo !=L"00603")
+ //{
+ if (comdid == L"xmAnalysis")
+ {
+ hCursor = xutil::SetCursorWait();
+ xstring str = dw_list.DataAnalysis(L"");
+ xaserverarg arg ;
+
+ arg.AddArg(L"html", str);
+
+ OpenWindow(L"dev:xpage[data.vanalysis.vx]", arg);
+ xutil::RestoreCursor(hCursor);
+ return 1;
+ }
+ if (comdid == L"xmSaveAs")
+ {
+ dw_list.SaveAs(L"");
+ return 1;
+ }
+
+ if (comdid == L"xmRemarks")
+ {
+ xstring name = rptEle.getAttribute(L"name");
+
+ xml x = ViewObject::RetrieveData(L"/sale/data/TradeFinance3/GetSetUpRemarks", L"Type", name);
+ KXMLDOMNodeList items = x.selectNodes(L"data/Item");
+ KXMLDOMNode t = items.item(0);
+ xstring Content = L"";
+ if (t.selectSingleNode(L"Content"))
+ {
+ Content = t.selectSingleNode(L"Content").text();
+ }
+
+ xaserverarg arg1 ;
+
+ arg1.AddArg(L"value", Content);
+ OpenWindow(L"dev:xpage[memo.edit.new.vx]", arg1);
+ return 1;
+
+ }
+ //}
+ if (comdid == L"xmLookImage")
+ {
+ int row = dw_list.GetRow();
+ xstring skuid = dw_list.GetGuid(row);
+ OnLookImage(skuid);
+ return 1;
+ }
+ if (comdid == L"xmTrans")
+ return OnTransData();
+ if (comdid == L"xmQuery")
+ {
+ if (rptEle)
+ {
+ xstring argUrl = rptEle.getAttribute(L"arg");
+ if (argUrl != L"")
+ {
+ xaserverarg ar ;
+
+ ar.AddArg(L"argurl", argUrl);
+ if (argStr != L"")
+ ar.AddArg(L"arg", argStr);
+ 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(rptEle.getAttribute(L"data"), argStr);
+ xutil::RestoreCursor(hCursor);
+ }
+ }
+ else
+ {
+ argStr = L"";
+ OnRetrieve(rptEle.getAttribute(L"data"), argStr);
+ }
+ }
+ return 1;
+ }
+
+ return 0;
+ }
+
+ int OnLookImage(xstring skuid)
+ {
+ HCURSOR hCursor = xutil::SetCursorWait();
+ xaserverarg arg ;
+ arg.AddArg(L"guid", skuid);
+ OpenWindow(L"dev:xpage[ViewPictures.vx]", arg);
+ xutil::RestoreCursor(hCursor);
+ return 1;
+ }
+
+ int SwitchReport(KXMLDOMElement e)
+ {
+ xstring dwname = e.getAttribute(L"template");
+ xstring dataurl = e.getAttribute(L"data");
+ xstring sheettype = e.getAttribute(L"reporttype");
+ if (rptEle != e)
+ {
+ argStr = L"";
+ rptEle = e;
+ }
+ if (sheettype == L"") sheettype = L"report";
+ SwitchLayer(L"dw_" + sheettype, L"report");
+ if (sheettype == L"report")dw_list.openUrl(dwname);
+
+ SetAgent();
+ return 1;
+ }
+
+ 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);
+ SwitchReport(e);
+ PostMessage(GetHWND(), 0x401, (WPARAM)L"xmQuery", 0);
+ //OnCmdDispatch(L"xmQuery");
+ xutil::RestoreCursor(hCursor);
+ }
+ return 1;
+ }
+
+ int OnTransData()
+ {
+ int ret =MessageBox(GetHWND(), L"是否更新数据?\n更新过程预计需要四十分钟,如果中间弹出等待时间过长的提示,请点击中间重试按钮,或等待到一定时间再点击", L"提示", 0x4 /*yesno*/);
+ if (ret != 6 /*IDYES */) return 1;
+
+ xml x;
+
+ HCURSOR hCursor = xutil::SetCursorWait();
+ if (xurl::get(L"/sale/data/Total3/total/transdata", L"", x) != 1)
+ {
+ xutil::RestoreCursor(hCursor);
+ return 1;
+ }
+ else
+ {
+ xutil::RestoreCursor(hCursor);
+ alert(L"数据传输完成!");
+ return 1;
+ }
+
+ 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;
+
+ xaserverarg arg;
+ /*
+ if(colname==L"SONo")
+ {
+ xstring SONo = dw_list.GetItemString(row,colname);
+ arg=new xaserverarg;
+
+ arg.AddArg(L"EntityNo",SONo);
+ arg.AddArg(L"ReadOnly",L"true");
+ OpenWindow(L"dev:xpage[base.maint.so.vx]",arg.getNativePointer());
+ }
+ if(colname==L"InvoiceNo")
+ {
+ xstring InvoiceNo= dw_list.GetItemString(row,colname);
+ arg=new xaserverarg;
+
+ arg.AddArg(L"EntityNo",InvoiceNo);
+ arg.AddArg(L"ReadOnly",L"true");
+ OpenWindow(L"dev:xpage[maint.GDN3.vx]",arg.getNativePointer());
+ }
+ if(colname==L"InvoiceNoEx")
+ {
+ xstring InvoiceNoEx= dw_list.GetItemString(row,colname);
+ arg=new xaserverarg;
+
+ arg.AddArg(L"EntityNo",InvoiceNoEx);
+ arg.AddArg(L"invoiceno",InvoiceNoEx);
+ arg.AddArg(L"ReadOnly",L"true");
+ OpenWindow(L"dev:xpage[maint.vatnotify.vx]",arg.getNativePointer());
+ }
+ */
+ return 1;
+ }
+
+ int OnAttachEvent()
+ {
+ //绑定工具条点击事件
+ AttachEvent(L"WM_XCOMMAND", (FEvent)&ViewEx111TotalWin::OnXCommand);
+ //获取焦点事件,用于重置工具条
+ AttachEvent(L"WM_SETFOCUS", (FEvent)&ViewEx111TotalWin::OnSetFocus);
+ AttachEvent(L"cb_report", L"CBN_SELCHANGE", (FEvent)&ViewEx111TotalWin::OnCombboChanged);
+ AttachEvent(L"dw_report", L"DWV_CLICKED", (FEvent)&ViewEx111TotalWin::OnDWClick);
+ return 1;
+ }
+
+ int OnRetrieve(xstring dataurl, xstring argstr)
+ {
+ if (!rptEle) return 0;
+
+ dw_list.Reset();
+
+ xml x;
+
+ xaserverarg arg ;
+
+ arg.AddArg(L"arg", argstr);
+ trace(argstr);
+
+ xstring sheettype = rptEle.getAttribute(L"reporttype");
+ if (sheettype == L"") sheettype = L"report";
+ if (xurl::get(dataurl, arg.GetString(), x) != 1)
+ {
+ //trace(L"\r\n--------" + x.text());
+ dw_list.Redraw();
+ return -1;
+ }
+ else
+ {
+ //xutil::SaveToFile(L"C:\\Temp\\Total3.xml",x.GetXml(),L"",L"",L"");
+ if (sheettype == L"report")
+ {
+ dw_list.Retrieve(x);
+ dw_list.Redraw();
+ dw_list.SetReadOnly(true);
+ }
+ else if (sheettype == L"cell")
+ {
+ }
+ else if (sheettype == L"office")
+ {
+ dw_office.LoadTemplate(x,0);
+ for (int i = 0; i < dw_office.GetSheetCount(); i++)
+ {
+ xcell sheet = dw_office.GetSheet(i);
+ sheet.SetReadOnly(true);
+ }
+ }
+ }
+ return 1;
+ }
+
+ xml getReportSet(xstring category)
+ {
+ xml x;
+
+ xaserverarg arg ;
+
+ arg.AddArg(L"category", category);
+ if (xurl::get(L"/sale/data/Total3/reportset", arg.GetString(), x) != 1)
+ {
+ return 0;
+ }
+ return x;
+ }
+
+ int onload()
+ {
+ SetArg();
+ 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/sodetail");
+
+ argStr = L"";
+
+ xcombobox xc = GetControl(L"cb_report");
+
+ m_category = L"total/business";
+ //m_category = L"total/sample";
+ if (GetWinParam()) {
+ xaserverarg arg =GetArg();
+ m_category = arg.GetArgString(L"category");
+ }
+ xml x = getReportSet(m_category);
+ if (x)
+ {
+ KXMLDOMNodeList nlist = x.selectNodes(L"//reports/report");
+ int len = nlist.length();
+ for (int i = 0; i < len; i++)
+ {
+ KXMLDOMElement rpt = nlist.item(i);
+ xstring name = rpt.getAttribute(L"name");
+
+ if (i == 0) xc.SetText(name);
+ if (i == 0) rptEle = rpt;
+ }
+ }
+ OnAttachEvent();
+ return 1;
+ }
+
+ int onloaded()
+ {
+ SetAgent();
+
+ if (rptEle)
+ {
+ SwitchReport(rptEle);
+ //OnCmdDispatch(L"xmQuery");
+ }
+
+ return 1;
+ }
+ };
\ No newline at end of file
diff --git a/jrj/project/total3/viewex.total1.cpp b/jrj/project/total3/viewex.total1.cpp
new file mode 100644
index 0000000..1370195
--- /dev/null
+++ b/jrj/project/total3/viewex.total1.cpp
@@ -0,0 +1,369 @@
+#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) ViewExTotal1Win : public xwin
+ {
+ public:
+ ViewExTotal1Win(void* implPtr, HWND hWnd) :xwin(implPtr, hWnd) {}
+ public:
+ static ViewExTotal1Win* CreateInstance(void* implPtr, void* hWnd)
+ {
+ ViewExTotal1Win* pWin = new ViewExTotal1Win(implPtr, (HWND)hWnd);
+ return pWin;
+ }
+ public:
+ xdwgrid dw_list;
+ xoffice dw_office;
+ xcell dw_cell;
+ xnode m_agentNode; //Agent Condition
+ KXMLDOMElement rptEle;
+ xstring m_category;
+ xstring argStr;
+
+ int hWndImageView;
+ int hWndRetrieveTip;
+ bool dataretrieveing;
+
+ 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)
+ {
+ xstring UserNo = publiccode::GetUser().no;
+
+ HCURSOR hCursor = 0;
+ //if(UserNo !=L"00603")
+ //{
+ if (comdid == L"xmAnalysis")
+ {
+ hCursor = xutil::SetCursorWait();
+ xstring str = dw_list.DataAnalysis(L"");
+ xaserverarg arg ;
+
+ arg.AddArg(L"html", str);
+
+ OpenWindow(L"dev:xpage[data.vanalysis.vx]", arg );
+ xutil::RestoreCursor(hCursor);
+ return 1;
+ }
+ if (comdid == L"xmSaveAs")
+ {
+ dw_list.SaveAs(L"");
+ return 1;
+ }
+ //}
+ if (comdid == L"xmLookImage")
+ {
+ int row = dw_list.GetRow();
+ xstring skuid = dw_list.GetGuid(row);
+ OnLookImage(skuid);
+ return 1;
+ }
+ if (comdid == L"xmTrans")
+ return OnTransData();
+ if (comdid == L"xmQuery")
+ {
+ if (rptEle)
+ {
+ xstring argUrl = rptEle.getAttribute(L"arg");
+ if (argUrl != L"")
+ {
+ xaserverarg ar ;
+
+ ar.AddArg(L"argurl", argUrl);
+ if (argStr != L"")
+ ar.AddArg(L"arg", argStr);
+ 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(rptEle.getAttribute(L"data"), argStr);
+ xutil::RestoreCursor(hCursor);
+ }
+ }
+ else
+ {
+ argStr = L"";
+ OnRetrieve(rptEle.getAttribute(L"data"), argStr);
+ }
+ }
+ return 1;
+ }
+
+ return 0;
+ }
+
+ int OnLookImage(xstring skuid)
+ {
+ HCURSOR hCursor = xutil::SetCursorWait();
+ xaserverarg arg ;
+ arg.AddArg(L"guid", skuid);
+ OpenWindow(L"dev:xpage[ViewPictures.vx]", arg);
+ xutil::RestoreCursor(hCursor);
+ return 1;
+ }
+
+ int SwitchReport(KXMLDOMElement e)
+ {
+ xstring dwname = e.getAttribute(L"template");
+ xstring dataurl = e.getAttribute(L"data");
+ xstring sheettype = e.getAttribute(L"reporttype");
+ if (rptEle != e)
+ {
+ argStr = L"";
+ rptEle = e;
+ }
+ if (sheettype == L"") sheettype = L"report";
+ SwitchLayer(L"dw_" + sheettype, L"report");
+ if (sheettype == L"report")dw_list.openUrl(dwname);
+
+ SetAgent();
+ return 1;
+ }
+
+ 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);
+ SwitchReport(e);
+ PostMessage(GetHWND(), 0x401, (WPARAM)L"xmQuery", 0);
+ //OnCmdDispatch(L"xmQuery");
+ xutil::RestoreCursor(hCursor);
+ }
+ return 1;
+ }
+
+ int OnTransData()
+ {
+ int ret = MessageBox(GetHWND(), L"是否更新数据?\n更新过程预计需要四十分钟,如果中间弹出等待时间过长的提示,请点击中间重试按钮,或等待到一定时间再点击", L"提示", 0x4 /*yesno*/);
+ if (ret != 6 /*IDYES */) return 1;
+
+ xml x;
+
+ HCURSOR hCursor = xutil::SetCursorWait();
+ if (xurl::get(L"/sale/data/Total3/total/transdata", L"", x) != 1)
+ {
+ xutil::RestoreCursor(hCursor);
+ return 1;
+ }
+ else
+ {
+ xutil::RestoreCursor(hCursor);
+ alert(L"数据传输完成!");
+ return 1;
+ }
+
+ 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;
+
+ xaserverarg arg;
+ /*
+ if(colname==L"SONo")
+ {
+ xstring SONo = dw_list.GetItemString(row,colname);
+ arg=new xaserverarg;
+
+ arg.AddArg(L"EntityNo",SONo);
+ arg.AddArg(L"ReadOnly",L"true");
+ OpenWindow(L"dev:xpage[base.maint.so.vx]",arg.getNativePointer());
+ }
+ if(colname==L"InvoiceNo")
+ {
+ xstring InvoiceNo= dw_list.GetItemString(row,colname);
+ arg=new xaserverarg;
+
+ arg.AddArg(L"EntityNo",InvoiceNo);
+ arg.AddArg(L"ReadOnly",L"true");
+ OpenWindow(L"dev:xpage[maint.GDN3.vx]",arg.getNativePointer());
+ }
+ if(colname==L"InvoiceNoEx")
+ {
+ xstring InvoiceNoEx= dw_list.GetItemString(row,colname);
+ arg=new xaserverarg;
+
+ arg.AddArg(L"EntityNo",InvoiceNoEx);
+ arg.AddArg(L"invoiceno",InvoiceNoEx);
+ arg.AddArg(L"ReadOnly",L"true");
+ OpenWindow(L"dev:xpage[maint.vatnotify.vx]",arg.getNativePointer());
+ }
+ */
+ return 1;
+ }
+
+ int OnAttachEvent()
+ {
+ //绑定工具条点击事件
+ AttachEvent(L"WM_XCOMMAND", (FEvent)&ViewExTotal1Win::OnXCommand);
+ //获取焦点事件,用于重置工具条
+ AttachEvent(L"WM_SETFOCUS", (FEvent)&ViewExTotal1Win::OnSetFocus);
+ AttachEvent(L"cb_report", L"CBN_SELCHANGE", (FEvent)&ViewExTotal1Win::OnCombboChanged);
+ AttachEvent(L"dw_report", L"DWV_CLICKED", (FEvent)&ViewExTotal1Win::OnDWClick);
+ return 1;
+ }
+
+ int OnRetrieve(xstring dataurl, xstring argstr)
+ {
+ if (!rptEle) return 0;
+
+ dw_list.Reset();
+
+ xml x;
+
+ xaserverarg arg ;
+
+ arg.AddArg(L"arg", argstr);
+ trace(argstr);
+
+ xstring sheettype = rptEle.getAttribute(L"reporttype");
+ if (sheettype == L"") sheettype = L"report";
+ if (xurl::get(dataurl, arg.GetString(), x) != 1)
+ {
+ //trace(L"\r\n--------" + x.text());
+ dw_list.Redraw();
+ return -1;
+ }
+ else
+ {
+ //xutil::SaveToFile(L"C:\\Temp\\Total3.xml",x.GetXml(),L"",L"",L"");
+ if (sheettype == L"report")
+ {
+ dw_list.Retrieve(x);
+ dw_list.Redraw();
+ dw_list.SetReadOnly(true);
+ }
+ else if (sheettype == L"cell")
+ {
+ }
+ else if (sheettype == L"office")
+ {
+ dw_office.LoadTemplate(x,0);
+ for (int i = 0; i < dw_office.GetSheetCount(); i++)
+ {
+ xcell sheet = dw_office.GetSheet(i);
+ sheet.SetReadOnly(true);
+ }
+ }
+ }
+ return 1;
+ }
+
+ xml getReportSet(xstring category)
+ {
+ xml x;
+
+ xaserverarg arg ;
+
+ arg.AddArg(L"category", category);
+ if (xurl::get(L"/sale/data/Total3/reportset", arg.GetString(), x) != 1)
+ {
+ return 0;
+ }
+ return x;
+ }
+
+ int onload()
+ {
+ SetArg();
+ 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/sodetail");
+
+ argStr = L"";
+
+ xcombobox xc = GetControl(L"cb_report");
+
+ m_category = L"total/business";
+ //m_category = L"total/sample";
+ if (GetWinParam()) {
+ xaserverarg arg=GetArg() ;
+
+ m_category = arg.GetArgString(L"category");
+ }
+ xml x = getReportSet(m_category);
+ if (x)
+ {
+ KXMLDOMNodeList nlist = x.selectNodes(L"//reports/report");
+ int len = nlist.length();
+ for (int i = 0; i < len; i++)
+ {
+ KXMLDOMElement rpt = nlist.item(i);
+ xstring name = rpt.getAttribute(L"name");
+ if (i == 0) xc.SetText(name);
+ if (i == 0) rptEle = rpt;
+ }
+ }
+ OnAttachEvent();
+ return 1;
+ }
+
+ int onloaded()
+ {
+ SetAgent();
+
+ if (rptEle)
+ {
+ SwitchReport(rptEle);
+ //OnCmdDispatch(L"xmQuery");
+ }
+
+ return 1;
+ }
+ };
\ No newline at end of file
diff --git a/jrj/project/total3/viewex.total2.cpp b/jrj/project/total3/viewex.total2.cpp
new file mode 100644
index 0000000..8285b34
--- /dev/null
+++ b/jrj/project/total3/viewex.total2.cpp
@@ -0,0 +1,370 @@
+#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) ViewExTotal2Win : public xwin
+ {
+ public:
+ ViewExTotal2Win(void* implPtr, HWND hWnd) :xwin(implPtr, hWnd) {}
+ public:
+ static ViewExTotal2Win* CreateInstance(void* implPtr, void* hWnd)
+ {
+ ViewExTotal2Win* pWin = new ViewExTotal2Win(implPtr, (HWND)hWnd);
+ return pWin;
+ }
+ public:
+ xdwgrid dw_list;
+ xoffice dw_office;
+ xcell dw_cell;
+ xnode m_agentNode; //Agent Condition
+ KXMLDOMElement rptEle;
+ xstring m_category;
+ xstring argStr;
+
+ int hWndImageView;
+ int hWndRetrieveTip;
+ bool dataretrieveing;
+
+ 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)
+ {
+ xstring UserNo = publiccode::GetUser().no;
+
+ HCURSOR hCursor = 0;
+ //if(UserNo !=L"00603")
+ //{
+ if (comdid == L"xmAnalysis")
+ {
+ hCursor = xutil::SetCursorWait();
+ xstring str = dw_list.DataAnalysis(L"");
+ xaserverarg arg ;
+
+ arg.AddArg(L"html", str);
+
+ OpenWindow(L"dev:xpage[data.vanalysis.vx]", arg);
+ xutil::RestoreCursor(hCursor);
+ return 1;
+ }
+ if (comdid == L"xmSaveAs")
+ {
+ dw_list.SaveAs(L"");
+ return 1;
+ }
+ //}
+ if (comdid == L"xmLookImage")
+ {
+ int row = dw_list.GetRow();
+ xstring skuid = dw_list.GetGuid(row);
+ OnLookImage(skuid);
+ return 1;
+ }
+ if (comdid == L"xmTrans")
+ return OnTransData();
+ if (comdid == L"xmQuery")
+ {
+ if (rptEle)
+ {
+ xstring argUrl = rptEle.getAttribute(L"arg");
+ if (argUrl != L"")
+ {
+ xaserverarg ar ;
+
+ ar.AddArg(L"argurl", argUrl);
+ if (argStr != L"")
+ ar.AddArg(L"arg", argStr);
+ 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(rptEle.getAttribute(L"data"), argStr);
+ xutil::RestoreCursor(hCursor);
+ }
+ }
+ else
+ {
+ argStr = L"";
+ OnRetrieve(rptEle.getAttribute(L"data"), argStr);
+ }
+ }
+ return 1;
+ }
+
+ return 0;
+ }
+
+ int OnLookImage(xstring skuid)
+ {
+ HCURSOR hCursor = xutil::SetCursorWait();
+ xaserverarg arg ;
+ arg.AddArg(L"guid", skuid);
+ OpenWindow(L"dev:xpage[ViewPictures.vx]", arg);
+ xutil::RestoreCursor(hCursor);
+ return 1;
+ }
+
+ int SwitchReport(KXMLDOMElement e)
+ {
+ xstring dwname = e.getAttribute(L"template");
+ xstring dataurl = e.getAttribute(L"data");
+ xstring sheettype = e.getAttribute(L"reporttype");
+ if (rptEle != e)
+ {
+ argStr = L"";
+ rptEle = e;
+ }
+ if (sheettype == L"") sheettype = L"report";
+ SwitchLayer(L"dw_" + sheettype, L"report");
+ if (sheettype == L"report")dw_list.openUrl(dwname);
+
+ SetAgent();
+ return 1;
+ }
+
+ 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);
+ SwitchReport(e);
+ PostMessage(GetHWND(), 0x401, (WPARAM)L"xmQuery", 0);
+ //OnCmdDispatch(L"xmQuery");
+ xutil::RestoreCursor(hCursor);
+ }
+ return 1;
+ }
+
+ int OnTransData()
+ {
+ int ret =MessageBox(GetHWND(), L"是否更新数据?\n更新过程预计需要四十分钟,如果中间弹出等待时间过长的提示,请点击中间重试按钮,或等待到一定时间再点击", L"提示", 0x4 /*yesno*/);
+ if (ret != 6 /*IDYES */) return 1;
+
+ xml x;
+
+ HCURSOR hCursor = xutil::SetCursorWait();
+ if (xurl::get(L"/sale/data/Total3/total/transdata", L"", x) != 1)
+ {
+ xutil::RestoreCursor(hCursor);
+ return 1;
+ }
+ else
+ {
+ xutil::RestoreCursor(hCursor);
+ alert(L"数据传输完成!");
+ return 1;
+ }
+
+ 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;
+
+ xaserverarg arg;
+ /*
+ if(colname==L"SONo")
+ {
+ xstring SONo = dw_list.GetItemString(row,colname);
+ arg=new xaserverarg;
+
+ arg.AddArg(L"EntityNo",SONo);
+ arg.AddArg(L"ReadOnly",L"true");
+ OpenWindow(L"dev:xpage[base.maint.so.vx]",arg.getNativePointer());
+ }
+ if(colname==L"InvoiceNo")
+ {
+ xstring InvoiceNo= dw_list.GetItemString(row,colname);
+ arg=new xaserverarg;
+
+ arg.AddArg(L"EntityNo",InvoiceNo);
+ arg.AddArg(L"ReadOnly",L"true");
+ OpenWindow(L"dev:xpage[maint.GDN3.vx]",arg.getNativePointer());
+ }
+ if(colname==L"InvoiceNoEx")
+ {
+ xstring InvoiceNoEx= dw_list.GetItemString(row,colname);
+ arg=new xaserverarg;
+
+ arg.AddArg(L"EntityNo",InvoiceNoEx);
+ arg.AddArg(L"invoiceno",InvoiceNoEx);
+ arg.AddArg(L"ReadOnly",L"true");
+ OpenWindow(L"dev:xpage[maint.vatnotify.vx]",arg.getNativePointer());
+ }
+ */
+ return 1;
+ }
+
+ int OnAttachEvent()
+ {
+ //绑定工具条点击事件
+ AttachEvent(L"WM_XCOMMAND", (FEvent)&ViewExTotal2Win::OnXCommand);
+ //获取焦点事件,用于重置工具条
+ AttachEvent(L"WM_SETFOCUS", (FEvent)&ViewExTotal2Win::OnSetFocus);
+ AttachEvent(L"cb_report", L"CBN_SELCHANGE", (FEvent)&ViewExTotal2Win::OnCombboChanged);
+ AttachEvent(L"dw_report", L"DWV_CLICKED", (FEvent)&ViewExTotal2Win::OnDWClick);
+ return 1;
+ }
+
+ int OnRetrieve(xstring dataurl, xstring argstr)
+ {
+ if (!rptEle) return 0;
+
+ dw_list.Reset();
+
+ xml x;
+
+ xaserverarg arg ;
+
+ arg.AddArg(L"arg", argstr);
+ trace(argstr);
+
+ xstring sheettype = rptEle.getAttribute(L"reporttype");
+ if (sheettype == L"") sheettype = L"report";
+ if (xurl::get(dataurl, arg.GetString(), x) != 1)
+ {
+ //trace(L"\r\n--------" + x.text());
+ dw_list.Redraw();
+ return -1;
+ }
+ else
+ {
+ //xutil::SaveToFile(L"C:\\Temp\\Total3.xml",x.GetXml(),L"",L"",L"");
+ if (sheettype == L"report")
+ {
+ dw_list.Retrieve(x);
+ dw_list.Redraw();
+ dw_list.SetReadOnly(true);
+ }
+ else if (sheettype == L"cell")
+ {
+ }
+ else if (sheettype == L"office")
+ {
+ dw_office.LoadTemplate(x, 0);
+ for (int i = 0; i < dw_office.GetSheetCount(); i++)
+ {
+ xcell sheet = dw_office.GetSheet(i);
+ sheet.SetReadOnly(true);
+ }
+ }
+ }
+ return 1;
+ }
+
+ xml getReportSet(xstring category)
+ {
+ xml x;
+
+ xaserverarg arg ;
+
+ arg.AddArg(L"category", category);
+ if (xurl::get(L"/sale/data/Total3/reportset", arg.GetString(), x) != 1)
+ {
+ return 0;
+ }
+ return x;
+ }
+
+ int onload()
+ {
+ SetArg();
+ 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/sodetail");
+
+ argStr = L"";
+
+ xcombobox xc = GetControl(L"cb_report");
+
+ m_category = L"total/business";
+ //m_category = L"total/sample";
+ if (GetWinParam()) {
+ xaserverarg arg =GetArg();
+
+ m_category = arg.GetArgString(L"category");
+ }
+ xml x = getReportSet(m_category);
+ if (x)
+ {
+ KXMLDOMNodeList nlist = x.selectNodes(L"//reports/report");
+ int len = nlist.length();
+ for (int i = 0; i < len; i++)
+ {
+ KXMLDOMElement rpt = nlist.item(i);
+ xstring name = rpt.getAttribute(L"name");
+ xc.AddItem(name, rpt);
+ if (i == 0) xc.SetText(name);
+ if (i == 0) rptEle = rpt;
+ }
+ }
+ OnAttachEvent();
+ return 1;
+ }
+
+ int onloaded()
+ {
+ SetAgent();
+
+ if (rptEle)
+ {
+ SwitchReport(rptEle);
+ //OnCmdDispatch(L"xmQuery");
+ }
+
+ return 1;
+ }
+ };
\ No newline at end of file
--
Gitblit v1.9.3