zhangyang 4 년 전
부모
커밋
0aae6ca939

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

@@ -13,7 +13,7 @@
 			<HorizontalLayout>
 				<Control width="1" bkcolor="#FFD1D1D1"></Control>
 				
-				<VerticalLayout width="888" bkcolor="#FFFFFFFF" vscrollbar="true">
+				<VerticalLayout name="shangpin_create_page_info_layout" width="888" bkcolor="#FFFFFFFF" vscrollbar="true">
 					<Label text="基本信息" height="58" padding="20,0,0,0" font="20"></Label>
 						
 					<Control height="1" bkcolor="#FFEBE8E8" padding="10,0,10,0"></Control>

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

@@ -12,7 +12,7 @@
 			<HorizontalLayout>
 				<Control width="1" bkcolor="#FFD1D1D1"></Control>
 				
-				<VerticalLayout width="888" bkcolor="#FFFFFFFF" vscrollbar="true">
+				<VerticalLayout name="shangpin_create_page_info_layout" width="888" bkcolor="#FFFFFFFF" vscrollbar="true">
 					<Label text="基本信息" height="58" padding="20,0,0,0" font="20"></Label>
 						
 					<Control height="1" bkcolor="#FFEBE8E8" padding="10,0,10,0"></Control>

+ 7 - 0
zhipuzi_pos_windows/page/CShangpinCreatePageUI.cpp

@@ -130,6 +130,13 @@ void CShangpinCreatePageUI::InitShow()
 	pJiagongfangshi->Selected(true, false);
 
 	ShowError(L"");
+
+	CVerticalLayoutUI* layout = static_cast<CVerticalLayoutUI*>(this->FindSubControl(L"shangpin_create_page_info_layout"));
+	
+	SIZE pos;
+	pos.cx = 0;
+	pos.cy = 0;
+	layout->SetScrollPos(pos);
 }
 
 //´¦Àí°´Å¥µã»÷Ààʼþ

+ 21 - 4
zhipuzi_pos_windows/page/CShangpinUpdatePageUI.cpp

@@ -24,7 +24,6 @@ void CShangpinUpdatePageUI::InitShow()
 	//商品名字
 	CEditUI* pName = static_cast<CEditUI*>(this->FindSubControl(L"shangpin_create_page_name_edit"));
 	pName->SetText(CLewaimaiString::UTF8ToUnicode(m_foodinfo.name).c_str());
-	pName->SetFocus();
 
 	//商品序号
 	CEditUI* pXuhao = static_cast<CEditUI*>(this->FindSubControl(L"shangpin_create_page_xuhao_edit"));
@@ -100,16 +99,16 @@ void CShangpinUpdatePageUI::InitShow()
 
 	//库存类型
 	CCheckBoxUI* pKucuntypeOpen = static_cast<CCheckBoxUI*>(this->FindSubControl(L"shangpin_create_page_kucun_open"));	
-	CCheckBoxUI* pKucuntypeXiajia = static_cast<CCheckBoxUI*>(this->FindSubControl(L"shangpin_create_page_status_xiajia"));
+	CCheckBoxUI* pKucuntypeWuxian = static_cast<CCheckBoxUI*>(this->FindSubControl(L"shangpin_create_page_kucun_wuxian"));
 	if (m_foodinfo.stockvalid == "1")
 	{
 		pKucuntypeOpen->Selected(true, false);
-		pKucuntypeXiajia->Selected(false, false);
+		pKucuntypeWuxian->Selected(false, false);
 	}
 	else
 	{
 		pKucuntypeOpen->Selected(false, false);
-		pKucuntypeXiajia->Selected(true, false);
+		pKucuntypeWuxian->Selected(true, false);
 	}
 
 	//当前库存
@@ -165,6 +164,15 @@ void CShangpinUpdatePageUI::InitShow()
 	//商品加工方式
 	CCheckBoxUI* pJiagongfangshi = static_cast<CCheckBoxUI*>(this->FindSubControl(L"shangpin_create_page_fangan_1"));
 	pJiagongfangshi->Selected(true, false);
+
+	ShowError(L"");
+
+	CVerticalLayoutUI* layout = static_cast<CVerticalLayoutUI*>(this->FindSubControl(L"shangpin_create_page_info_layout"));
+
+	SIZE pos;
+	pos.cx = 0;
+	pos.cy = 0;
+	layout->SetScrollPos(pos);
 }
 
 //处理按钮点击类事件
@@ -760,6 +768,15 @@ void CShangpinUpdatePageUI::ShowError(std::wstring msg)
 {
 	CLabelUI* pResult = static_cast<CLabelUI*>(this->FindSubControl(L"shangpin_create_page_save_result"));
 	pResult->SetText(msg.c_str());
+
+	if (msg == L"")
+	{
+		pResult->SetVisible(false);
+	}
+	else
+	{
+		pResult->SetVisible(true);
+	}
 }
 
 void CShangpinUpdatePageUI::PrintShangpinTiaoma()

+ 0 - 1
zhipuzi_pos_windows/pch/pch.h

@@ -73,7 +73,6 @@ using namespace rapidjson;
 #include "../helper/CLewaimaiLog.h"
 #include "../helper/CLewaimaiTime.h"
 
-#include "../tool/CSqlite3.h"
 #include "../tool/CSetting.h"
 
 #include "../network/CZhipuziHttpClient.h"

+ 19 - 2
zhipuzi_pos_windows/tool/CSqlite3.cpp

@@ -514,10 +514,15 @@ bool CSqlite3::InitPosFood()
 					"stockvalid    CHAR(100)          NOT NULL," \
 					"stock_warning    CHAR(100)          NOT NULL," \
 					"is_shouyinji_show    CHAR(20)          NOT NULL," \
+					"is_waimai_show    CHAR(20)          NOT NULL," \
+					"is_tangshi_show    CHAR(20)          NOT NULL," \
+					"is_zhengcan_show    CHAR(20)          NOT NULL," \
 					"expiration_date   CHAR(100)          NOT NULL," \
 					"is_weight    CHAR(20)          NOT NULL," \
 					"weight_plu_code    CHAR(20)          NOT NULL," \
 					"weight_food_code    CHAR(20)          NOT NULL," \
+					"jiagong_type    CHAR(20)          NOT NULL," \
+					"cost_mode    CHAR(20)          NOT NULL," \
 					"member_price_json    CHAR(100)          NOT NULL);";
 
 				if (sqlite3_prepare_v2(m_db, sql.c_str(), -1, &stmt, NULL) == SQLITE_OK)
@@ -847,6 +852,12 @@ bool CSqlite3::InitFoodData(rapidjson::Value& foodrows)
 		std::string is_weight = foodinfo["is_weight"].GetString();
 		std::string member_price_json = foodinfo["member_price_json"].GetString();
 
+		std::string is_waimai_show = foodinfo["is_waimai_show"].GetString();
+		std::string is_tangshi_show = foodinfo["is_tangshi_show"].GetString();
+		std::string is_zhengcan_show = foodinfo["is_zhengcan_show"].GetString();
+		std::string jiagong_type = foodinfo["jiagong_type"].GetString();
+		std::string cost_mode = foodinfo["cost_mode"].GetString();
+
 		std::string weight_plu_code;
 		if (foodinfo["weight_plu_code"].IsString())
 		{
@@ -869,10 +880,10 @@ bool CSqlite3::InitFoodData(rapidjson::Value& foodrows)
 
 		//²åÈëÒ»¸öÉÌÆ·Êý¾Ý
 		std::string sql = "INSERT INTO pos_food (id,shop_id,name,price,tag,status,type_id,is_dabao,dabao_money,is_nature,nature,autostocknum,goods_img,unit,barcode,member_price_used,member_price, \
-			buying_price,stock,stockvalid,stock_warning,is_shouyinji_show,expiration_date,is_weight,member_price_json,weight_plu_code,weight_food_code) VALUES ('" + id + "' ,'" + shop_id + "','" \
+			buying_price,stock,stockvalid,stock_warning,is_shouyinji_show,is_waimai_show,is_tangshi_show,is_zhengcan_show,expiration_date,is_weight,member_price_json,weight_plu_code,weight_food_code,jiagong_type,cost_mode) VALUES ('" + id + "' ,'" + shop_id + "','" \
 			+ name + "', '" + price + "', '" + tag + "', '" + status + "', '" + type_id + "', '" + is_dabao + "', '" + dabao_money + "', '" + is_nature + "', '" + nature + "', '" \
 			+ autostocknum + "', '" + goods_img + "', '" + unit + "', '" + barcode + "', '" + member_price_used + "', '" + member_price + "', '" + buying_price + "', '" + stock + "', '" \
-			+ stockvalid + "', '" + stock_warning + "', '" + is_shouyinji_show + "', '" + expiration_date + "','" + is_weight + "','" + member_price_json + "','" + weight_plu_code + "','" + weight_food_code + "')";
+			+ stockvalid + "', '" + stock_warning + "', '" + is_shouyinji_show + "', '" + is_waimai_show + "', '" + is_tangshi_show + "', '" + is_zhengcan_show + "', '" + expiration_date + "','" + is_weight + "','" + member_price_json + "','" + weight_plu_code + "','" + weight_food_code + "','" + jiagong_type + "','" + cost_mode + "')";
 
 		bool ret = this->ExeSQl(sql);
 		if (!ret)
@@ -1012,6 +1023,12 @@ bool CSqlite3::UpdateOneFood(rapidjson::Value& foodrows)
 	std::string is_weight = foodinfo["is_weight"].GetString();
 	std::string member_price_json = foodinfo["member_price_json"].GetString();
 
+	std::string is_waimai_show = foodinfo["is_waimai_show"].GetString();
+	std::string is_tangshi_show = foodinfo["is_tangshi_show"].GetString();
+	std::string is_zhengcan_show = foodinfo["is_zhengcan_show"].GetString();
+	std::string jiagong_type = foodinfo["jiagong_type"].GetString();
+	std::string cost_mode = foodinfo["cost_mode"].GetString();
+
 	std::string weight_plu_code;
 	if (foodinfo["weight_plu_code"].IsString())
 	{

+ 2 - 0
zhipuzi_pos_windows/wnd/CDiandanNatureWnd.cpp

@@ -4,6 +4,8 @@
 #include "../control/CDiandanNatureItemUI.h"
 #include "../control/ControlEx.h"
 
+#include "../tool/CSqlite3.h"
+
 void CDiandanNatureWnd::Init()
 {
 	bool is_taocan;

+ 2 - 0
zhipuzi_pos_windows/wnd/CMainWnd.cpp

@@ -16,6 +16,8 @@
 
 #include "../wnd/CImageAttentionWnd.h"
 
+#include "../tool/CSqlite3.h"
+
 void CMainWnd::Init()
 {
 	//设置店铺名字

+ 2 - 0
zhipuzi_pos_windows/zhipuzi/CDiandanOrderItem.cpp

@@ -1,6 +1,8 @@
 #include "../pch/pch.h"
 #include "CDiandanOrderItem.h"
 
+#include "../tool/CSqlite3.h"
+
 bool CDiandanOrderItem::operator==(CDiandanOrderItem& t)
 {
 	if (this->m_is_taocan != t.m_is_taocan)

+ 3 - 0
zhipuzi_pos_windows/zhipuzi/CFood.h

@@ -28,6 +28,9 @@ public:
 	std::string stockvalid;
 	std::string stock_warning;
 	std::string is_shouyinji_show;
+	std::string is_waimai_show;
+	std::string is_tangshi_show;
+	std::string is_zhengcan_show;
 	std::string expiration_date;
 	std::string is_weight;
 	std::string member_price_json;