Przeglądaj źródła

开始做批量录入商品

张洋 1 miesiąc temu
rodzic
commit
db2997f7d3

+ 4 - 0
bin/Win32/Debug/zhipuzi_pos_windows/skin/shangpin_page.xml

@@ -9,6 +9,10 @@
 					<Button name="shangpin_page_add_btn" width="320" height="60" padding="15,0,15,0" text="新建商品" textcolor="#FFFFFFFF" normalimage="file='btn_green_zhengchang.png' corner='5,5,5,5'" hotimage="file='btn_green_xuanfu.png' corner='5,5,5,5'" pushedimage="file='btn_green_dianji.png' corner='5,5,5,5'" />
 					<Button name="shangpin_page_add_btn" width="320" height="60" padding="15,0,15,0" text="新建商品" textcolor="#FFFFFFFF" normalimage="file='btn_green_zhengchang.png' corner='5,5,5,5'" hotimage="file='btn_green_xuanfu.png' corner='5,5,5,5'" pushedimage="file='btn_green_dianji.png' corner='5,5,5,5'" />
 				</HorizontalLayout>
 				</HorizontalLayout>
 				
 				
+				<HorizontalLayout height="60" width="380" padding="0,20,0,0">
+					<Button name="shangpin_page_piliang_add_btn" width="320" height="60" padding="15,0,15,0" text="批量录入商品" textcolor="#FFFFFFFF" normalimage="file='btn_red_zhengchang.png' corner='5,5,5,5'" hotimage="file='btn_red_xuanfu.png' corner='5,5,5,5'" pushedimage="file='btn_red_dianji.png' corner='5,5,5,5'" />
+				</HorizontalLayout>
+
 				<HorizontalLayout height="60" width="380" padding="0,20,0,0">
 				<HorizontalLayout height="60" width="380" padding="0,20,0,0">
 					<Button name="shangpin_page_add_type_btn" width="320" height="60" padding="15,0,15,0" text="新建分类" textcolor="#FFFFFFFF" normalimage="file='btn_red_zhengchang.png' corner='5,5,5,5'" hotimage="file='btn_red_xuanfu.png' corner='5,5,5,5'" pushedimage="file='btn_red_dianji.png' corner='5,5,5,5'" />
 					<Button name="shangpin_page_add_type_btn" width="320" height="60" padding="15,0,15,0" text="新建分类" textcolor="#FFFFFFFF" normalimage="file='btn_red_zhengchang.png' corner='5,5,5,5'" hotimage="file='btn_red_xuanfu.png' corner='5,5,5,5'" pushedimage="file='btn_red_dianji.png' corner='5,5,5,5'" />
 				</HorizontalLayout>
 				</HorizontalLayout>

+ 42 - 0
bin/Win32/Debug/zhipuzi_pos_windows/skin/shangpin_piliangluru_page.xml

@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Window>
+	<ShangpinPiliangluruPage>
+		<VerticalLayout bkcolor="#FFFFFFFF">
+			<HorizontalLayout height="60" bkcolor="#FFFFFFFF">
+				<Button name="shangpin_piliangluru_page_return_btn" tooltip="返回" width="38" height="38" padding="10,11,0,0" normalimage="file='zhengcan_back.png'" hotimage="" pushedimage=""/>
+				<Label text="批量录入商品" font="28" textcolor="#FF1087FF" width="300" height="30" padding="10,12,10,10"></Label>
+			</HorizontalLayout>
+
+			<Control height="1" bkcolor="#FFEBE8E8"></Control>
+
+			<HorizontalLayout>
+				<List name="list_saomashouyin_cart" padding="0,0,0,0" itemlinecolor="#FF000000" itemvalign="vcenter" vscrollbar="true">
+					<ListHeader inset="0,0,0,0" height="42">
+						<ListHeaderItem text="序号" width="50" align="center" />
+						<ListHeaderItem text="商品" width="200" align="center" />
+						<ListHeaderItem text="条码" width="150" align="center" />
+						<ListHeaderItem text="价格" width="80" align="center" />
+						<ListHeaderItem text="单位" width="80" align="center" />
+						<ListHeaderItem text="库存" width="50" align="center" />
+						<ListHeaderItem text="商品分类" width="80" align="center" />
+					</ListHeader>
+				</List>
+
+				<Control width="1" bkcolor="#FFEBE8E8"></Control>
+
+				<VerticalLayout width="380" bkcolor="#FFFFFFFF" padding="0,0,0,0">
+					<Label text="1、对于国标商品,可以直接用扫码抢扫描商品条码,系统自带的商品库会自动识别商品信息,快速录入" textcolor="#FF999999" wordbreak="true" height="40" padding="20,10,20,0" font="14"></Label>
+					<Label text="2、非国标商品,请手动输入商品信息" textcolor="#FF999999" wordbreak="true" height="20" padding="20,10,20,0" font="14"></Label>
+					<Label text="3、批量录入多个商品信息后,可以统一保存" textcolor="#FF999999" wordbreak="true" height="20" padding="20,10,20,0" font="14"></Label>
+				</VerticalLayout>	
+
+			</HorizontalLayout>			
+
+			<Control height="1" bkcolor="#FFEBE8E8"></Control>
+
+			<VerticalLayout height="100">
+				<Label name="saomashouyin_page_fenshu" text="共计0行,0件商品" font="20" textcolor="#FFFF4444" width="200" align="left" padding="15,0,0,0"></Label>
+			</VerticalLayout>
+		</VerticalLayout>
+	</ShangpinPiliangluruPage>
+</Window>

+ 6 - 1
zhipuzi_pos_windows/control/ControlEx.h

@@ -27,6 +27,7 @@
 #include "../page/CShoukuanOrderInfoPageUI.h"
 #include "../page/CShoukuanOrderInfoPageUI.h"
 #include "../page/CAIxuexiPageUI.h"
 #include "../page/CAIxuexiPageUI.h"
 #include "../page/CYubaozhuangbiaoqianPageUI.h"
 #include "../page/CYubaozhuangbiaoqianPageUI.h"
+#include "../page/CShangpinPiliangluruPageUI.h"
 
 
 #include "CWaimaiOrderItemUI.h"
 #include "CWaimaiOrderItemUI.h"
 #include "CDianneiOrderItemUI.h"
 #include "CDianneiOrderItemUI.h"
@@ -121,6 +122,10 @@ public:
 		{
 		{
 			return new CZhengcanOrderListPageUI;
 			return new CZhengcanOrderListPageUI;
 		}
 		}
+		else if (_tcscmp(pstrClass, _T("ShangpinPiliangluruPage")) == 0)
+		{
+			return new CShangpinPiliangluruPageUI;
+		}
 		else if (_tcscmp(pstrClass, _T("ZhengcanOrderInfoPage")) == 0)
 		else if (_tcscmp(pstrClass, _T("ZhengcanOrderInfoPage")) == 0)
 		{
 		{
 			return new CZhengcanOrderInfoPageUI;
 			return new CZhengcanOrderInfoPageUI;
@@ -190,4 +195,4 @@ public:
 
 
 		return NULL;
 		return NULL;
 	}
 	}
-};
+};

+ 6 - 1
zhipuzi_pos_windows/page/CShangpinPageUI.cpp

@@ -308,6 +308,11 @@ void CShangpinPageUI::HandleClickMsg(TNotifyUI& msg)
 		CShangpinCreatePageUI* page = static_cast<CShangpinCreatePageUI*>(m_pMainWnd->GetPage(CMainWnd::SHANGPIN_CREATE));
 		CShangpinCreatePageUI* page = static_cast<CShangpinCreatePageUI*>(m_pMainWnd->GetPage(CMainWnd::SHANGPIN_CREATE));
 		m_pMainWnd->SwitchPage(CMainWnd::SHANGPIN_CREATE);
 		m_pMainWnd->SwitchPage(CMainWnd::SHANGPIN_CREATE);
 	}
 	}
+	else if (name == L"shangpin_page_piliang_add_btn")
+	{
+		CShangpinPiliangluruPageUI* page = static_cast<CShangpinPiliangluruPageUI*>(m_pMainWnd->GetPage(CMainWnd::SHANGPIN_PILIANGLURU));
+		m_pMainWnd->SwitchPage(CMainWnd::SHANGPIN_PILIANGLURU);
+	}
 	else if (name == L"shangpin_page_add_type_btn")
 	else if (name == L"shangpin_page_add_type_btn")
 	{
 	{
 		ShowNewtype();
 		ShowNewtype();
@@ -486,4 +491,4 @@ void CShangpinPageUI::ShowNewtype()
 			return;
 			return;
 		}
 		}
 	}
 	}
-}
+}

+ 120 - 0
zhipuzi_pos_windows/page/CShangpinPiliangluruPageUI.cpp

@@ -0,0 +1,120 @@
+#include "pch.h"
+#include "CShangpinPiliangluruPageUI.h"
+
+#include "../control/ControlEx.h"
+
+#include "../tool/CSqlite3.h"
+
+#include "../wnd/CMainWnd.h"
+#include "../wnd/CShangpinNewTypeWnd.h"
+
+CShangpinPiliangluruPageUI::CShangpinPiliangluruPageUI()
+{
+}
+
+
+CShangpinPiliangluruPageUI::~CShangpinPiliangluruPageUI()
+{
+}
+
+void CShangpinPiliangluruPageUI::InitControl()
+{
+
+}
+
+//初始化当前页面的展示,处理默认展示效果,在页面被加载的时候调用
+void CShangpinPiliangluruPageUI::InitShow()
+{
+	
+}
+
+void CShangpinPiliangluruPageUI::RefreshShow()
+{
+	
+}
+
+//处理按钮点击类事件
+void CShangpinPiliangluruPageUI::HandleClickMsg(TNotifyUI& msg)
+{
+	CDuiString name = msg.pSender->GetName();
+
+	if (name == L"shangpin_piliangluru_page_return_btn")
+	{
+		m_pMainWnd->SwitchPage(CMainWnd::SHANGPIN, false);
+	}	
+}
+
+//处理option切换事件
+void CShangpinPiliangluruPageUI::HandleSelectChangeMsg(TNotifyUI& msg)
+{
+	CDuiString name = msg.pSender->GetName();
+
+	COptionUI* curOption = static_cast<COptionUI*>(msg.pSender);
+	std::wstring groupname = curOption->GetGroup();
+
+	
+}
+
+//处理下拉框、radio的切换事件
+void CShangpinPiliangluruPageUI::HandleItemSelectMsg(TNotifyUI& msg)
+{
+
+}
+
+//处理编辑框输入内容改变事件
+void CShangpinPiliangluruPageUI::HandleTextChangedMsg(TNotifyUI& msg)
+{
+	CDuiString name = msg.pSender->GetName();
+
+	
+}
+
+//处理扫码枪捕捉到的扫码信息
+void CShangpinPiliangluruPageUI::HandleTextCapture(std::string content)
+{
+
+}
+
+void CShangpinPiliangluruPageUI::SetPos(RECT rc, bool bNeedInvalidate)
+{
+	m_nPageWidth = rc.right - rc.left;
+
+	CContainerUI::SetPos(rc, bNeedInvalidate);
+}
+
+void CShangpinPiliangluruPageUI::ShowNewtype()
+{
+	if (m_is_show_modal_wnd == true)
+	{
+		return;
+	}
+
+	CShangpinNewTypeWnd* pMemoDlg = new CShangpinNewTypeWnd();
+
+	if (pMemoDlg != NULL)
+	{
+		m_is_show_modal_wnd = true;
+		m_curModalWnd = pMemoDlg;
+
+		pMemoDlg->Create(m_pManager->GetPaintWindow(), _T(""), UI_WNDSTYLE_DIALOG, WS_EX_WINDOWEDGE);
+		pMemoDlg->SetIcon(IDI_ICON_DUILIB);
+		pMemoDlg->CenterWindow();
+
+		UINT ret = pMemoDlg->ShowModal();
+
+		if (ret == IDOK)
+		{
+			//这里表示添加分类成功了,刷新分类显示
+
+			m_is_show_modal_wnd = false;
+			delete pMemoDlg;
+		}
+		else
+		{
+			m_is_show_modal_wnd = false;
+			delete pMemoDlg;
+
+			return;
+		}
+	}
+}

+ 58 - 0
zhipuzi_pos_windows/page/CShangpinPiliangluruPageUI.h

@@ -0,0 +1,58 @@
+#pragma once
+
+#include "pch.h"
+#include "../ui/CBasePageUI.h"
+
+#include "../zhipuzi/CFood.h"
+#include "../zhipuzi/CFoodtype.h"
+#include "../zhipuzi/CFoodpackage.h"
+
+#include "../control/CDiandanFoodItemUI.h"
+#include "../zhipuzi/CDiandanOrder.h"
+
+class CShangpinPiliangluruPageUI : public CBasePageUI
+{
+public:
+	CShangpinPiliangluruPageUI();
+	~CShangpinPiliangluruPageUI();
+
+	//初始化页面控件,页面创建构造的时候调用一次,注意和InitShow的区别,这个不触发控件的任何事件
+	void InitControl();
+
+	//初始化当前页面的展示,处理默认展示效果,在页面每次被选中加载(注意不是页面创建构造)的时候调用,如果多次选中会多次调用,这里要避免数据重复处理
+	void InitShow();
+
+	//收款一个订单成功,准备开始收款第2个订单的时候调用(会多次调度用)
+	void RefreshShow();
+
+	//处理按钮点击类事件
+	void HandleClickMsg(TNotifyUI& msg);
+
+	//处理option切换事件
+	void HandleSelectChangeMsg(TNotifyUI& msg);
+
+	//处理下拉框、radio的切换事件
+	void HandleItemSelectMsg(TNotifyUI& msg);
+
+	//处理编辑框输入内容改变事件
+	void HandleTextChangedMsg(TNotifyUI& msg);
+
+	//处理扫码枪捕捉到的扫码信息
+	void HandleTextCapture(std::string content);
+
+	//处理自定义消息,各个页面处理各个页面自己的(是自己处理的消息返回true,不是自己处理的消息返回false)
+	bool HandleCustomMessage(UINT uMsg, WPARAM wParam, LPARAM lParam)
+	{
+		return false;
+	}
+
+	void SetPos(RECT rc, bool bNeedInvalidate = true);
+
+	void ShowNewtype();
+private:
+	//所有商品分类(只包含收银机显示的分类)
+	std::vector<CFoodType> m_types;
+
+	//当前控件的实际宽度
+	int m_nPageWidth;
+};

+ 7 - 0
zhipuzi_pos_windows/wnd/CMainWnd.cpp

@@ -1562,6 +1562,13 @@ void CMainWnd::CreatePages()
 		m_pages[SHANGPIN_UPDATE] = pChildContainer;
 		m_pages[SHANGPIN_UPDATE] = pChildContainer;
 	}
 	}
 
 
+	{
+		CDialogBuilder builder;
+		CDialogBuilderCallbackEx cb;
+		pChildContainer = static_cast<CBasePageUI*>(builder.Create(_T("shangpin_piliangluru_page.xml"), (UINT)0, &cb, &m_pm));
+		m_pages[SHANGPIN_PILIANGLURU] = pChildContainer;
+	}
+
 	{
 	{
 		CDialogBuilder builder;
 		CDialogBuilder builder;
 		CDialogBuilderCallbackEx cb;
 		CDialogBuilderCallbackEx cb;

+ 2 - 1
zhipuzi_pos_windows/wnd/CMainWnd.h

@@ -30,6 +30,7 @@ public:
 		SHANGPIN, //商品管理
 		SHANGPIN, //商品管理
 		SHANGPIN_CREATE, //新建商品
 		SHANGPIN_CREATE, //新建商品
 		SHANGPIN_UPDATE, //修改商品
 		SHANGPIN_UPDATE, //修改商品
+		SHANGPIN_PILIANGLURU, //商品批量录入
 		ZHENGCAN, //正餐收银
 		ZHENGCAN, //正餐收银
 		SAOMASHOUYIN, //扫码收银
 		SAOMASHOUYIN, //扫码收银
 		CAIGOU, //采购
 		CAIGOU, //采购
@@ -214,4 +215,4 @@ private:
 
 
 	//是否正在设置快捷键
 	//是否正在设置快捷键
 	bool m_IsKuaijiejian;
 	bool m_IsKuaijiejian;
-};
+};

+ 2 - 0
zhipuzi_pos_windows/zhipuzi_pos_windows.vcxproj

@@ -249,6 +249,7 @@ copy $(ProjectDir)conf\ $(SolutionDir)bin\$(Platform)\$(Configuration)\conf\</Co
     <ClInclude Include="ai\YoloClassName.h" />
     <ClInclude Include="ai\YoloClassName.h" />
     <ClInclude Include="ai\YoloFeatureManager.h" />
     <ClInclude Include="ai\YoloFeatureManager.h" />
     <ClInclude Include="control\CFoodXuexiImageItemUI.h" />
     <ClInclude Include="control\CFoodXuexiImageItemUI.h" />
+    <ClInclude Include="page\CShangpinPiliangluruPageUI.h" />
     <ClInclude Include="page\CYubaozhuangbiaoqianPageUI.h" />
     <ClInclude Include="page\CYubaozhuangbiaoqianPageUI.h" />
     <ClInclude Include="page\CAIxuexiPageUI.h" />
     <ClInclude Include="page\CAIxuexiPageUI.h" />
     <ClInclude Include="ui\CTouchWindowBase.h" />
     <ClInclude Include="ui\CTouchWindowBase.h" />
@@ -379,6 +380,7 @@ copy $(ProjectDir)conf\ $(SolutionDir)bin\$(Platform)\$(Configuration)\conf\</Co
     <ClCompile Include="ai\SQLiteVecManager.cpp" />
     <ClCompile Include="ai\SQLiteVecManager.cpp" />
     <ClCompile Include="ai\YoloFeatureManager.cpp" />
     <ClCompile Include="ai\YoloFeatureManager.cpp" />
     <ClCompile Include="control\CFoodXuexiImageItemUI.cpp" />
     <ClCompile Include="control\CFoodXuexiImageItemUI.cpp" />
+    <ClCompile Include="page\CShangpinPiliangluruPageUI.cpp" />
     <ClCompile Include="page\CYubaozhuangbiaoqianPageUI.cpp" />
     <ClCompile Include="page\CYubaozhuangbiaoqianPageUI.cpp" />
     <ClCompile Include="sqlite3\shell.c">
     <ClCompile Include="sqlite3\shell.c">
       <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">NotUsing</PrecompiledHeader>
       <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">NotUsing</PrecompiledHeader>

+ 6 - 0
zhipuzi_pos_windows/zhipuzi_pos_windows.vcxproj.filters

@@ -402,6 +402,9 @@
     <ClInclude Include="page\CYubaozhuangbiaoqianPageUI.h">
     <ClInclude Include="page\CYubaozhuangbiaoqianPageUI.h">
       <Filter>头文件</Filter>
       <Filter>头文件</Filter>
     </ClInclude>
     </ClInclude>
+    <ClInclude Include="page\CShangpinPiliangluruPageUI.h">
+      <Filter>头文件</Filter>
+    </ClInclude>
   </ItemGroup>
   </ItemGroup>
   <ItemGroup>
   <ItemGroup>
     <ClCompile Include="pch\pch.cpp">
     <ClCompile Include="pch\pch.cpp">
@@ -761,6 +764,9 @@
     <ClCompile Include="page\CYubaozhuangbiaoqianPageUI.cpp">
     <ClCompile Include="page\CYubaozhuangbiaoqianPageUI.cpp">
       <Filter>源文件</Filter>
       <Filter>源文件</Filter>
     </ClCompile>
     </ClCompile>
+    <ClCompile Include="page\CShangpinPiliangluruPageUI.cpp">
+      <Filter>源文件</Filter>
+    </ClCompile>
   </ItemGroup>
   </ItemGroup>
   <ItemGroup>
   <ItemGroup>
     <Image Include="resource\zhipuzi.ico">
     <Image Include="resource\zhipuzi.ico">