Selaa lähdekoodia

继续做,加油做

zhangyang 4 vuotta sitten
vanhempi
commit
4283fbad63

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

@@ -31,7 +31,7 @@
 					
 					<HorizontalLayout height="44" padding="0,30,0,0">
 						<Label text="商品分类:" width="80" height="44" padding="20,0,0,0"></Label>					
-						<Combo name="shangpin_create_page_foodtype" padding="15,9,0,0" width="140" 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" >
+						<Combo name="shangpin_create_page_foodtype" padding="15,9,0,0" width="300" height="32" 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" >
 							
 						</Combo>
 					</HorizontalLayout>

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

@@ -30,7 +30,7 @@
 					
 					<HorizontalLayout height="44" padding="0,30,0,0">
 						<Label text="商品分类:" width="80" height="44" padding="20,0,0,0"></Label>					
-						<Combo name="shangpin_create_page_foodtype" padding="15,9,0,0" width="140" 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" >
+						<Combo name="shangpin_create_page_foodtype" padding="15,9,0,0" width="300" height="32" 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" >
 							
 						</Combo>
 					</HorizontalLayout>

+ 52 - 6
zhipuzi_pos_windows/page/CShangpinUpdatePageUI.cpp

@@ -135,16 +135,49 @@ void CShangpinUpdatePageUI::InitShow()
 
 	//进货价模式
 	CCheckBoxUI* pJinhuomoshiNormal = static_cast<CCheckBoxUI*>(this->FindSubControl(L"shangpin_create_page_jinhuojia_normal"));
-	CCheckBoxUI* pJinhuomoshiJiaquan = static_cast<CCheckBoxUI*>(this->FindSubControl(L"shangpin_create_page_jinhuojia_jiaquan"));	
+	CCheckBoxUI* pJinhuomoshiJiaquan = static_cast<CCheckBoxUI*>(this->FindSubControl(L"shangpin_create_page_jinhuojia_jiaquan"));
+	if (m_foodinfo.cost_mode == "0")
+	{
+		pJinhuomoshiNormal->Selected(true, false);
+		pJinhuomoshiJiaquan->Selected(false, false);
+	}
+	else
+	{
+		pJinhuomoshiNormal->Selected(false, false);
+		pJinhuomoshiJiaquan->Selected(true, false);
+	}
 
 	//在哪些地方显示
 	CCheckBoxUI* pShouyinji = static_cast<CCheckBoxUI*>(this->FindSubControl(L"shangpin_create_page_showplace_shouyinji"));
 	CCheckBoxUI* pWaimai = static_cast<CCheckBoxUI*>(this->FindSubControl(L"shangpin_create_page_showplace_waimai"));
 	CCheckBoxUI* pSaomaidancan = static_cast<CCheckBoxUI*>(this->FindSubControl(L"shangpin_create_page_showplace_saomadiancan"));
 
-	pShouyinji->Selected(true, false);
-	pWaimai->Selected(true, false);
-	pSaomaidancan->Selected(true, false);
+	if (m_foodinfo.is_shouyinji_show == "1")
+	{
+		pShouyinji->Selected(true, false);
+	}
+	else
+	{
+		pShouyinji->Selected(false, false);
+	}
+
+	if (m_foodinfo.is_waimai_show == "1")
+	{
+		pWaimai->Selected(true, false);
+	}
+	else
+	{
+		pWaimai->Selected(false, false);
+	}
+
+	if (m_foodinfo.is_tangshi_show == "1")
+	{
+		pSaomaidancan->Selected(true, false);
+	}
+	else
+	{
+		pSaomaidancan->Selected(false, false);
+	}
 
 	//是否开启打包费
 	CCheckBoxUI* pDabao = static_cast<CCheckBoxUI*>(this->FindSubControl(L"shangpin_create_page_is_dabao"));
@@ -162,8 +195,21 @@ void CShangpinUpdatePageUI::InitShow()
 	pDaobaofei->SetText(CLewaimaiString::UTF8ToUnicode(m_foodinfo.dabao_money).c_str());
 
 	//商品加工方式
-	CCheckBoxUI* pJiagongfangshi = static_cast<CCheckBoxUI*>(this->FindSubControl(L"shangpin_create_page_fangan_1"));
-	pJiagongfangshi->Selected(true, false);
+	CCheckBoxUI* pJiagongfangshi_1 = static_cast<CCheckBoxUI*>(this->FindSubControl(L"shangpin_create_page_fangan_1"));
+	CCheckBoxUI* pJiagongfangshi_2 = static_cast<CCheckBoxUI*>(this->FindSubControl(L"shangpin_create_page_fangan_2"));
+	CCheckBoxUI* pJiagongfangshi_3 = static_cast<CCheckBoxUI*>(this->FindSubControl(L"shangpin_create_page_fangan_3"));
+	if (m_foodinfo.jiagong_type == "1")
+	{
+		pJiagongfangshi_1->Selected(true, false);
+	}
+	else if (m_foodinfo.jiagong_type == "2")
+	{
+		pJiagongfangshi_2->Selected(true, false);
+	}
+	else if (m_foodinfo.jiagong_type == "3")
+	{
+		pJiagongfangshi_3->Selected(true, false);
+	}
 
 	ShowError(L"");
 

+ 52 - 27
zhipuzi_pos_windows/tool/CSqlite3.cpp

@@ -1051,10 +1051,10 @@ bool CSqlite3::UpdateOneFood(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)
@@ -1314,11 +1314,16 @@ std::vector<CFood> CSqlite3::GetFoodForTiaomacheng()
 			newFood.stockvalid = (char*)sqlite3_column_text(stmt, 19);
 			newFood.stock_warning = (char*)sqlite3_column_text(stmt, 20);
 			newFood.is_shouyinji_show = (char*)sqlite3_column_text(stmt, 21);
-			newFood.expiration_date = (char*)sqlite3_column_text(stmt, 22);
-			newFood.is_weight = (char*)sqlite3_column_text(stmt, 23);
-			newFood.weight_plu_code = (char*)sqlite3_column_text(stmt, 24);
-			newFood.weight_food_code = (char*)sqlite3_column_text(stmt, 25);
-			newFood.member_price_json = (char*)sqlite3_column_text(stmt, 26);
+			newFood.is_waimai_show = (char*)sqlite3_column_text(stmt, 22);
+			newFood.is_tangshi_show = (char*)sqlite3_column_text(stmt, 23);
+			newFood.is_zhengcan_show = (char*)sqlite3_column_text(stmt, 24);
+			newFood.expiration_date = (char*)sqlite3_column_text(stmt, 25);
+			newFood.is_weight = (char*)sqlite3_column_text(stmt, 26);
+			newFood.weight_plu_code = (char*)sqlite3_column_text(stmt, 27);
+			newFood.weight_food_code = (char*)sqlite3_column_text(stmt, 28);
+			newFood.jiagong_type = (char*)sqlite3_column_text(stmt, 29);
+			newFood.cost_mode = (char*)sqlite3_column_text(stmt, 30);
+			newFood.member_price_json = (char*)sqlite3_column_text(stmt, 31);
 
 			data.push_back(newFood);
 		}
@@ -1381,11 +1386,16 @@ std::vector<CFood> CSqlite3::GetFoodByFoodname(std::string foodname, bool is_sho
 			newFood.stockvalid = (char*)sqlite3_column_text(stmt, 19);
 			newFood.stock_warning = (char*)sqlite3_column_text(stmt, 20);
 			newFood.is_shouyinji_show = (char*)sqlite3_column_text(stmt, 21);
-			newFood.expiration_date = (char*)sqlite3_column_text(stmt, 22);
-			newFood.is_weight = (char*)sqlite3_column_text(stmt, 23);
-			newFood.weight_plu_code = (char*)sqlite3_column_text(stmt, 24);
-			newFood.weight_food_code = (char*)sqlite3_column_text(stmt, 25);
-			newFood.member_price_json = (char*)sqlite3_column_text(stmt, 26);
+			newFood.is_waimai_show = (char*)sqlite3_column_text(stmt, 22);
+			newFood.is_tangshi_show = (char*)sqlite3_column_text(stmt, 23);
+			newFood.is_zhengcan_show = (char*)sqlite3_column_text(stmt, 24);
+			newFood.expiration_date = (char*)sqlite3_column_text(stmt, 25);
+			newFood.is_weight = (char*)sqlite3_column_text(stmt, 26);
+			newFood.weight_plu_code = (char*)sqlite3_column_text(stmt, 27);
+			newFood.weight_food_code = (char*)sqlite3_column_text(stmt, 28);
+			newFood.jiagong_type = (char*)sqlite3_column_text(stmt, 29);
+			newFood.cost_mode = (char*)sqlite3_column_text(stmt, 30);
+			newFood.member_price_json = (char*)sqlite3_column_text(stmt, 31);
 
 			data.push_back(newFood);
 		}
@@ -1489,11 +1499,16 @@ bool CSqlite3::GetFoodById(std::string food_id, CFood& newFood)
 			newFood.stockvalid = (char*)sqlite3_column_text(stmt, 19);
 			newFood.stock_warning = (char*)sqlite3_column_text(stmt, 20);
 			newFood.is_shouyinji_show = (char*)sqlite3_column_text(stmt, 21);
-			newFood.expiration_date = (char*)sqlite3_column_text(stmt, 22);
-			newFood.is_weight = (char*)sqlite3_column_text(stmt, 23);
-			newFood.weight_plu_code = (char*)sqlite3_column_text(stmt, 24);
-			newFood.weight_food_code = (char*)sqlite3_column_text(stmt, 25);
-			newFood.member_price_json = (char*)sqlite3_column_text(stmt, 26);
+			newFood.is_waimai_show = (char*)sqlite3_column_text(stmt, 22);
+			newFood.is_tangshi_show = (char*)sqlite3_column_text(stmt, 23);
+			newFood.is_zhengcan_show = (char*)sqlite3_column_text(stmt, 24);
+			newFood.expiration_date = (char*)sqlite3_column_text(stmt, 25);
+			newFood.is_weight = (char*)sqlite3_column_text(stmt, 26);
+			newFood.weight_plu_code = (char*)sqlite3_column_text(stmt, 27);
+			newFood.weight_food_code = (char*)sqlite3_column_text(stmt, 28);
+			newFood.jiagong_type = (char*)sqlite3_column_text(stmt, 29);
+			newFood.cost_mode = (char*)sqlite3_column_text(stmt, 30);
+			newFood.member_price_json = (char*)sqlite3_column_text(stmt, 31);
 		}
 
 		sqlite3_finalize(stmt);
@@ -1543,11 +1558,16 @@ bool CSqlite3::GetFoodByBarcode(std::string barcode, CFood& newFood)
 			newFood.stockvalid = (char*)sqlite3_column_text(stmt, 19);
 			newFood.stock_warning = (char*)sqlite3_column_text(stmt, 20);
 			newFood.is_shouyinji_show = (char*)sqlite3_column_text(stmt, 21);
-			newFood.expiration_date = (char*)sqlite3_column_text(stmt, 22);
-			newFood.is_weight = (char*)sqlite3_column_text(stmt, 23);
-			newFood.weight_plu_code = (char*)sqlite3_column_text(stmt, 24);
-			newFood.weight_food_code = (char*)sqlite3_column_text(stmt, 25);
-			newFood.member_price_json = (char*)sqlite3_column_text(stmt, 26);
+			newFood.is_waimai_show = (char*)sqlite3_column_text(stmt, 22);
+			newFood.is_tangshi_show = (char*)sqlite3_column_text(stmt, 23);
+			newFood.is_zhengcan_show = (char*)sqlite3_column_text(stmt, 24);
+			newFood.expiration_date = (char*)sqlite3_column_text(stmt, 25);
+			newFood.is_weight = (char*)sqlite3_column_text(stmt, 26);
+			newFood.weight_plu_code = (char*)sqlite3_column_text(stmt, 27);
+			newFood.weight_food_code = (char*)sqlite3_column_text(stmt, 28);
+			newFood.jiagong_type = (char*)sqlite3_column_text(stmt, 29);
+			newFood.cost_mode = (char*)sqlite3_column_text(stmt, 30);
+			newFood.member_price_json = (char*)sqlite3_column_text(stmt, 31);
 		}
 
 		sqlite3_finalize(stmt);
@@ -1597,11 +1617,16 @@ bool CSqlite3::GetFoodByPluBianma(std::string barcode, CFood& newFood)
 			newFood.stockvalid = (char*)sqlite3_column_text(stmt, 19);
 			newFood.stock_warning = (char*)sqlite3_column_text(stmt, 20);
 			newFood.is_shouyinji_show = (char*)sqlite3_column_text(stmt, 21);
-			newFood.expiration_date = (char*)sqlite3_column_text(stmt, 22);
-			newFood.is_weight = (char*)sqlite3_column_text(stmt, 23);
-			newFood.weight_plu_code = (char*)sqlite3_column_text(stmt, 24);
-			newFood.weight_food_code = (char*)sqlite3_column_text(stmt, 25);
-			newFood.member_price_json = (char*)sqlite3_column_text(stmt, 26);
+			newFood.is_waimai_show = (char*)sqlite3_column_text(stmt, 22);
+			newFood.is_tangshi_show = (char*)sqlite3_column_text(stmt, 23);
+			newFood.is_zhengcan_show = (char*)sqlite3_column_text(stmt, 24);
+			newFood.expiration_date = (char*)sqlite3_column_text(stmt, 25);
+			newFood.is_weight = (char*)sqlite3_column_text(stmt, 26);
+			newFood.weight_plu_code = (char*)sqlite3_column_text(stmt, 27);
+			newFood.weight_food_code = (char*)sqlite3_column_text(stmt, 28);
+			newFood.jiagong_type = (char*)sqlite3_column_text(stmt, 29);
+			newFood.cost_mode = (char*)sqlite3_column_text(stmt, 30);
+			newFood.member_price_json = (char*)sqlite3_column_text(stmt, 31);
 		}
 
 		sqlite3_finalize(stmt);

+ 2 - 0
zhipuzi_pos_windows/zhipuzi/CFood.h

@@ -36,6 +36,8 @@ public:
 	std::string member_price_json;
 	std::string weight_plu_code;
 	std::string weight_food_code;
+	std::string jiagong_type;
+	std::string cost_mode;
 
 	//获得图片完整的下载地址
 	std::wstring getImageUrl()