张洋 1 month ago
parent
commit
2500c33106

+ 1 - 1
bin/Win32/Debug/zhipuzi_pos_windows/skin/diandan_page.xml

@@ -49,7 +49,7 @@
 						<Button name="btn_diandan_canpaihao" text="输入餐牌号" height="38" width="100" padding="0,10,0,0" normalimage="" hotimage="" pushedimage="" bordersize="0" bkcolor="#00FFFFFF"></Button>
 						<Control width="1" bkcolor="#FFEBE8E8" padding="5,15,15,15"></Control>
 						<Control bkimage="order_delete.png" width="20" height="20" padding="0,20,0,0"></Control>
-						<Button name="btn_diandan_qingkong" text="清空" height="38" width="40" padding="0,10,10,0" textcolor="#FF999999" normalimage="" hotimage="" pushedimage="" bordersize="0" bkcolor="#00FFFFFF"></Button>
+						<Button name="btn_diandan_qingkong" text="清空" height="38" width="40" padding="0,10,10,0" normalimage="" hotimage="" pushedimage="" bordersize="0" bkcolor="#00FFFFFF"></Button>
 					</HorizontalLayout>
 					
 					<HorizontalLayout height="50" bkcolor="#FFF5F5F5">

+ 2 - 2
bin/Win32/Debug/zhipuzi_pos_windows/skin/saomashouyin_page.xml

@@ -27,7 +27,7 @@
 						<Control></Control>
 						<Control width="100"></Control>
 						<Control bkimage="order_delete.png" width="20" height="20" padding="0,20,0,0"></Control>
-						<Button name="btn_saomashouyin_qingkong" text="清空" height="38" width="40" padding="0,10,10,0" textcolor="#FF999999" normalimage="" hotimage="" pushedimage="" bordersize="0" bkcolor="#00FFFFFF"></Button>
+						<Button name="btn_saomashouyin_qingkong" text="清空" height="38" width="40" padding="0,10,10,0" normalimage="" hotimage="" pushedimage="" bordersize="0" bkcolor="#00FFFFFF"></Button>
 					</HorizontalLayout>
 
 					<Control height="1" bkcolor="#FFEBE8E8"></Control>
@@ -52,7 +52,7 @@
 			
 					<VerticalLayout height="145" bkcolor="#FFFFFFFF">
 						<HorizontalLayout height="70">
-							<Label name="saomashouyin_page_fenshu" text="共0行,0份" font="20" textcolor="#FFFF4444" width="160" align="left" padding="15,0,0,0"></Label>
+							<Label name="saomashouyin_page_fenshu" text="共计0行,0件商品" font="20" textcolor="#FFFF4444" width="200" align="left" padding="15,0,0,0"></Label>
 
 							<Control></Control>
 							

+ 2 - 2
bin/Win32/Debug/zhipuzi_pos_windows/skin/setting_biaoqian_print.xml

@@ -44,12 +44,12 @@
 	<Control height="1" bkcolor="#FFEAEAEA" padding="0,20,0,0"></Control>
 	
 	<HorizontalLayout height="44">
-		<Label text="指定商品分类打印标签" width="260" />
+		<Label text="订单打印按绑定商品分类打印标签" width="260" />
 		<CheckBox name="setting_biaoqian_printer_is_type" width="72" height="45" normalimage="file='switchbutton.png' source='0,0,143,91'" selectedimage="file='switchbutton.png' source='0,182,143,273'"/>
 	</HorizontalLayout>
 	
 	<HorizontalLayout height="500">
-		<Label text="当前绑定分类:" width="260"  height="44"/>
+		<Label text="当前绑定商品分类:" width="260"  height="44"/>
 		<VerticalLayout name="setting_biaoqian_printer_type_layout" padding="0,15,0,0">
 		
 		</VerticalLayout>

+ 2 - 2
bin/Win32/Debug/zhipuzi_pos_windows/skin/setting_page.xml

@@ -8,9 +8,9 @@
 					<Control height="1" bkcolor="#FFD1D1D1"></Control>
 					<Option name="setting_switch_page_diannei_order" text="店内订单设置" group="setting_switch" align="center" height="69" padding="0,0,0,0" selectedimage="file='white_bkg.png'" textcolor="#FF666666" selectedtextcolor="#FF000000" />
 					<Control height="1" bkcolor="#FFD1D1D1"></Control>
-					<Option name="setting_switch_page_printer" text="小票打印设置" group="setting_switch" align="center" height="69" padding="0,0,0,0" selectedimage="file='white_bkg.png'" textcolor="#FF666666" selectedtextcolor="#FF000000" />
+					<Option name="setting_switch_page_printer" text="收银小票打印设置" group="setting_switch" align="center" height="69" padding="0,0,0,0" selectedimage="file='white_bkg.png'" textcolor="#FF666666" selectedtextcolor="#FF000000" />
 					<Control height="1" bkcolor="#FFD1D1D1"></Control>
-					<Option name="setting_switch_page_biaoqian_printer" text="标签打印设置" group="setting_switch" align="center" height="69" padding="0,0,0,0" selectedimage="file='white_bkg.png'" textcolor="#FF666666" selectedtextcolor="#FF000000" />
+					<Option name="setting_switch_page_biaoqian_printer" text="标签纸打印设置" group="setting_switch" align="center" height="69" padding="0,0,0,0" selectedimage="file='white_bkg.png'" textcolor="#FF666666" selectedtextcolor="#FF000000" />
 					<Control height="1" bkcolor="#FFD1D1D1"></Control>
 					<Option name="setting_switch_page_chufang_printer" text="厨房打印设置" group="setting_switch" align="center" height="69" padding="0,0,0,0" selectedimage="file='white_bkg.png'" textcolor="#FF666666" selectedtextcolor="#FF000000" />
 					<Control height="1" bkcolor="#FFD1D1D1"></Control>

+ 1 - 1
bin/Win32/Debug/zhipuzi_pos_windows/skin/setting_print.xml

@@ -43,7 +43,7 @@
 		<Button name="setting_printer_wangkouk_save_btn" align="center" width="100" height="38" padding="20,8,0,3" text="保存" normalimage="file='btn_border_white.png' corner='5,5,5,5'" hotimage="file='btn_border_white_Hover.png' corner='5,5,5,5'" pushedimage="file='btn_border_white_Click.png' corner='5,5,5,5'" />
 	</HorizontalLayout>
 	<HorizontalLayout height="44" padding="0,20,0,0">
-		<Label text="小票格式设置" width="260" />
+		<Label text="收银小票格式设置" width="260" />
 	</HorizontalLayout>
 	<Control height="1" bkcolor="#FF708090" />
 	<HorizontalLayout height="44" visible="false">

+ 7 - 11
bin/Win32/Debug/zhipuzi_pos_windows/skin/setting_tiaomacheng.xml

@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <Window>
 	<HorizontalLayout height="44">
-		<Label text="条码格式" width="260"/>
+		<Label text="称重商品条码格式" width="260"/>
 		<Combo name="setting_tiaomacheng_geshi" padding="0,9,0,0" width="400" height="26" tooltip="请点击这里选择您的打印机打印小票联数" normalimage="file='Setting_Combox_Normal.png' corner='2,2,24,2'" hotimage="file='Setting_Combox_Hover.png' corner='2,2,24,2'" pushedimage="Setting_Combox_Click.png' corner='2,2,24,2'" textpadding="10,1,1,1" >
 			<ListLabelElement text="13位【FWWWWWWEEEEEC】" selected="true" />
 			<ListLabelElement text="13位【FWWWWWWNNNNNC】" />
@@ -15,7 +15,11 @@
 	</HorizontalLayout>	
 	
 	<HorizontalLayout height="44">
-		<Label text="W:商品编码;E:商品总价;N:商品重量,请根据您当前店内条码秤实际条码格式来选择" width="800"/>
+		<Label text="W:商品PLU编码;E:商品总价;N:商品重量,请根据您当前店内条码秤实际条码格式来选择" width="800"/>
+	</HorizontalLayout>
+
+	<HorizontalLayout height="44">
+		<Label text="如果您使用独立的条码秤,请选择当前条码秤所设置的格式类型,收银页面扫码时将按所选择的格式进行识别;如果您使用本系统的预包装称重打标签功能,请优先选择13位【FWWWWWWNNNNNC】模式" textcolor="#FF999999" wordbreak="true" width="800"/>
 	</HorizontalLayout>
 	
 	<Control height="1" bkcolor="#FFEAEAEA" padding="0,20,0,0"></Control>
@@ -38,16 +42,8 @@
 		<Button name="setting_tiaomacheng_tongbushangpin" align="center" width="300" height="44" padding="0,8,0,3" text="同步最新商品信息到条码秤" normalimage="file='btn_border_white.png' corner='5,5,5,5'" hotimage="file='btn_border_white_Hover.png' corner='5,5,5,5'" pushedimage="file='btn_border_white_Click.png' corner='5,5,5,5'" />
 	</HorizontalLayout>
 	
-	<HorizontalLayout height="52">		
-		<Button name="setting_tiaomacheng_tongburejian" align="center" width="300" height="44" padding="0,8,0,3" text="自动生成快捷热键到条码秤" normalimage="file='btn_border_white.png' corner='5,5,5,5'" hotimage="file='btn_border_white_Hover.png' corner='5,5,5,5'" pushedimage="file='btn_border_white_Click.png' corner='5,5,5,5'" />
-	</HorizontalLayout>
-	
-	<HorizontalLayout height="52">		
-		<Button name="setting_tiaomacheng_qingkongplu" textcolor="#FFFFFFFF" align="center" width="300" height="44" padding="0,8,0,3" text="清空电子秤所有商品PLU信息" normalimage="file='btn_border_red.png' corner='5,5,5,5'" hotimage="file='btn_border_red_Hover.png' corner='5,5,5,5'" pushedimage="file='btn_border_red_Click.png' corner='5,5,5,5'" />
-	</HorizontalLayout>
-	
 	<HorizontalLayout height="44">
-		<Label text="自动同步快捷热键将根据商品PLU编码生成,比如PLU编码为1,则热键为1,编码为10,则热键为10" width="900"/>
+		<Label text="上述操作将自动同步本机所有已经设置PLU编码的称重商品的PLU编码和价格信息到条码秤,并根据商品PLU编码生成快捷键,比如PLU编码为1,则快捷键为1,编码为10,则快捷键为10" textcolor="#FF999999" wordbreak="true" width="900"/>
 	</HorizontalLayout>
 	
 	<HorizontalLayout height="50" padding="0,20,0,0">

+ 1 - 1
bin/Win32/Debug/zhipuzi_pos_windows/skin/zhengcan_diandan_page.xml

@@ -33,7 +33,7 @@
 								<Button name="btn_diandan_canpaihao" text="人数" height="38" width="100" padding="0,10,0,0" normalimage="" hotimage="" pushedimage="" bordersize="0" bkcolor="#00FFFFFF"></Button>
 								<Control width="1" bkcolor="#FFEBE8E8" padding="5,15,15,15"></Control>
 								<Control bkimage="order_delete.png" width="20" height="20" padding="0,20,0,0"></Control>
-								<Button name="btn_diandan_qingkong" text="清空" height="38" width="40" padding="0,10,10,0" textcolor="#FF999999" normalimage="" hotimage="" pushedimage="" bordersize="0" bkcolor="#00FFFFFF"></Button>
+								<Button name="btn_diandan_qingkong" text="清空" height="38" width="40" padding="0,10,10,0" normalimage="" hotimage="" pushedimage="" bordersize="0" bkcolor="#00FFFFFF"></Button>
 							</HorizontalLayout>
 							
 							<HorizontalLayout height="50" bkcolor="#FFF5F5F5">

+ 1 - 1
zhipuzi_pos_windows/page/CDiandanPageUI.cpp

@@ -3742,7 +3742,7 @@ bool CDiandanPageUI::BiaoqianchengSaomaBarcode(std::string barcode)
 	//如果有价格,优先用价格
 	if (money.length() > 0)
 	{
-		//这个出来的单位是分,要把单位转成员
+		//这个出来的单位是分,要把单位转成元
 		d_money = atof(money.c_str());
 
 		d_money = d_money / 100;

+ 3 - 3
zhipuzi_pos_windows/page/CSaomashouyinPageUI.cpp

@@ -1268,12 +1268,12 @@ void CSaomashouyinPageUI::UpdateJiesuanInfo()
 
 	if (m_cur_diandan_order.getItemNum() > 0)
 	{
-		std::wstring ws_fenshu = L"共" + std::to_wstring(m_cur_diandan_order.getItemNum()) + L"行," + std::to_wstring(m_cur_diandan_order.getTotalNum()) + L"份";
+		std::wstring ws_fenshu = L"共计" + std::to_wstring(m_cur_diandan_order.getItemNum()) + L"行," + std::to_wstring(m_cur_diandan_order.getTotalNum()) + L"件商品";
 		pFenshuLabel->SetText(ws_fenshu.c_str());
 	}
 	else
 	{
-		pFenshuLabel->SetText(L"共0行,0份");
+		pFenshuLabel->SetText(L"共0行,0件商品");
 	}
 
 	//再刷新账单明细展示
@@ -3216,7 +3216,7 @@ bool CSaomashouyinPageUI::BiaoqianchengSaomaBarcode(std::string barcode)
 	//如果有价格,优先用价格
 	if (money.length() > 0)
 	{
-		//这个出来的单位是分,要把单位转成员
+		//这个出来的单位是分,要把单位转成元
 		d_money = atof(money.c_str());
 
 		d_money = d_money / 100;

+ 18 - 29
zhipuzi_pos_windows/page/CSettingPageUI.cpp

@@ -1621,14 +1621,6 @@ void CSettingPageUI::HandleClickMsg(TNotifyUI& msg)
 	{
 		this->StartTongbuBiaoqiancheng();
 	}
-	else if (name == L"setting_tiaomacheng_tongburejian")
-	{
-		this->StartTongbuRejian();
-	}
-	else if (name == L"setting_tiaomacheng_qingkongplu")
-	{
-		this->StartQiongkongPLU();
-	}
 	else if (name == _T("setting_is_ai_recognition_open"))
 	{
 		CCheckBoxUI * box = static_cast<CCheckBoxUI *>(this->FindSubControl(_T("setting_is_ai_recognition_open")));
@@ -2427,7 +2419,17 @@ void CSettingPageUI::StartTongbuBiaoqiancheng()
 	std::thread(&CSettingPageUI::HandleTongbuBiaoqiancheng, this).detach();
 }
 
+//分三步处理,第一步:清空标签秤现有数据 第二步:传输商品数据; 第三步:设置快捷键
 void CSettingPageUI::HandleTongbuBiaoqiancheng()
+{
+	this->HandleQiongkongPLU();
+
+	this->HandleTongbuPLU();
+
+	this->HandleTongbuRejian();
+}
+
+void CSettingPageUI::HandleTongbuPLU()
 {
 	boost::asio::io_context m_io;
 	boost::asio::ip::tcp::socket m_socket(m_io);
@@ -2477,25 +2479,21 @@ void CSettingPageUI::HandleTongbuBiaoqiancheng()
 		}
 
 		std::string plu = std::to_string(n_plu);
+
+		//左边补0,补到4位
 		plu = CLewaimaiString::BuZifuLeft(plu, 4 - plu.length(), '0');
 		data += plu;
 
 		data += "A";
 
 		//处理商品编码
-		int n_bianma = atoi(it->weight_food_code.c_str());
-		if (n_bianma < 1)
-		{
-			//无效的编码
-			continue;
-		}
-		else if (n_bianma > 999999)
-		{
-			//无效的编码
-			continue;
-		}
+
+		//这里我们把商品编码设置为跟PLU一样的,比如PLU是123,那么商品编码就是0000123
+		int n_bianma = n_plu;
 
 		std::string bianma = std::to_string(n_bianma);
+
+		//左边补0,补到7位
 		bianma = CLewaimaiString::BuZifuLeft(bianma, 7 - bianma.length(), '0');
 		data += bianma;
 
@@ -2548,17 +2546,13 @@ void CSettingPageUI::HandleTongbuBiaoqiancheng()
 		size_t len = m_socket.read_some(boost::asio::buffer(buf), error);
 		std::string result = buf;
 
+		//秤端接收成功后通常返回特定字节集(如 {48,118,48,48,48,49,97,48,13,10,3} 对应的 ASCII 字符),开发者需解析该返回值判断同步状态 。
 		LOG_INFO("发送PLU命令成功,返回信息:" << buf);
 	}
 
 	m_socket.close();
 }
 
-void CSettingPageUI::StartTongbuRejian()
-{
-	std::thread(&CSettingPageUI::HandleTongbuRejian, this).detach();
-}
-
 void CSettingPageUI::HandleTongbuRejian()
 {
 	boost::asio::io_context m_io;
@@ -2738,11 +2732,6 @@ void CSettingPageUI::HandleTongbuRejian()
 	m_socket.close();
 }
 
-void CSettingPageUI::StartQiongkongPLU()
-{
-	std::thread(&CSettingPageUI::HandleQiongkongPLU, this).detach();
-}
-
 void CSettingPageUI::HandleQiongkongPLU()
 {
 	boost::asio::io_context m_io;

+ 4 - 2
zhipuzi_pos_windows/page/CSettingPageUI.h

@@ -19,10 +19,12 @@ public:
 
 	void StartTongbuBiaoqiancheng();
 	void HandleTongbuBiaoqiancheng();
-	void StartTongbuRejian();
+
+	void HandleTongbuPLU();
 	void HandleTongbuRejian();
-	void StartQiongkongPLU();
 	void HandleQiongkongPLU();
+
+	//同步服务器最新商品数据
 	void StartTongbu();
 	void HandleTongbu();
 

+ 1 - 1
zhipuzi_pos_windows/page/CZhengcanDiandanPageUI.cpp

@@ -4277,7 +4277,7 @@ bool CZhengcanDiandanPageUI::BiaoqianchengSaomaBarcode(std::string barcode)
 	//如果有价格,优先用价格
 	if (money.length() > 0)
 	{
-		//这个出来的单位是分,要把单位转成员
+		//这个出来的单位是分,要把单位转成元
 		d_money = atof(money.c_str());
 
 		d_money = d_money / 100;