Просмотр исходного кода

增加 规格色号等级 仓位

姜永辉 4 месяцев назад
Родитель
Сommit
3ad43fcb41

+ 94 - 5
res/layout/drawerlayout_item_inventory.xml

@@ -97,7 +97,7 @@
                     android:textColorHint="@color/gray"
                     android:textSize="14sp" />
             </RelativeLayout>
-            
+
             <TextView
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
@@ -106,7 +106,7 @@
                 android:text="商品名称"
                 android:textColor="@color/black"
                 android:textSize="15sp" />
-            
+
             <RelativeLayout
                 android:id="@+id/rl_goods_name"
                 android:layout_width="match_parent"
@@ -126,7 +126,8 @@
                     android:textColorHint="@color/gray"
                     android:textSize="14sp" />
             </RelativeLayout>
-              <TextView
+
+            <TextView
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
                 android:layout_marginLeft="10dp"
@@ -134,7 +135,8 @@
                 android:text="商品规格"
                 android:textColor="@color/black"
                 android:textSize="15sp" />
-             <RelativeLayout
+
+            <RelativeLayout
                 android:id="@+id/rl_goods_specification"
                 android:layout_width="match_parent"
                 android:layout_height="45dp"
@@ -159,6 +161,35 @@
                 android:layout_height="wrap_content"
                 android:layout_marginLeft="10dp"
                 android:layout_marginTop="20dp"
+                android:text="色        号"
+                android:textColor="@color/black"
+                android:textSize="15sp" />
+
+            <RelativeLayout
+                android:id="@+id/rl_goods_colornumber"
+                android:layout_width="match_parent"
+                android:layout_height="45dp"
+                android:layout_marginTop="10dp"
+                android:background="@drawable/background_line_shape"
+                android:focusable="true" >
+
+                <EditText
+                    android:id="@+id/et_goods_colornumber"
+                    android:layout_width="100dp"
+                    android:layout_height="wrap_content"
+                    android:layout_centerInParent="true"
+                    android:background="@color/white"
+                    android:gravity="center"
+                    android:hint="请输入色号"
+                    android:textColorHint="@color/gray"
+                    android:textSize="14sp" />
+            </RelativeLayout>
+
+            <TextView
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginLeft="10dp"
+                android:layout_marginTop="20dp"
                 android:text="库        区"
                 android:textColor="@color/black"
                 android:textSize="15sp" />
@@ -207,7 +238,8 @@
                     android:textColor="@color/gray"
                     android:textSize="14sp" />
             </RelativeLayout>
- <TextView
+
+            <TextView
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
                 android:layout_marginLeft="10dp"
@@ -233,6 +265,63 @@
                     android:textColor="@color/gray"
                     android:textSize="14sp" />
             </RelativeLayout>
+            
+            <TextView
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginLeft="10dp"
+                android:layout_marginTop="20dp"
+                android:text="等        级"
+                android:textColor="@color/black"
+                android:textSize="15sp" />
+
+            <RelativeLayout
+                android:id="@+id/rl_grade"
+                android:layout_width="match_parent"
+                android:layout_height="45dp"
+                android:layout_marginTop="10dp"
+                android:background="@drawable/background_line_shape" >
+
+                <TextView
+                    android:id="@+id/tv_grade"
+                    android:layout_width="100dp"
+                    android:layout_height="wrap_content"
+                    android:layout_centerInParent="true"
+                    android:gravity="center"
+                    android:text="请选择等级"
+                    android:textColor="@color/gray"
+                    android:textSize="14sp" />
+            </RelativeLayout>
+            
+            <TextView
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginLeft="10dp"
+                android:layout_marginTop="20dp"
+                android:text="仓        位"
+                android:textColor="@color/black"
+                android:textSize="15sp" />
+
+            <RelativeLayout
+                android:id="@+id/rl_goods_positionnumber"
+                android:layout_width="match_parent"
+                android:layout_height="45dp"
+                android:layout_marginTop="10dp"
+                android:background="@drawable/background_line_shape"
+                android:focusable="true" >
+
+                <EditText
+                    android:id="@+id/et_goods_positionnumber"
+                    android:layout_width="100dp"
+                    android:layout_height="wrap_content"
+                    android:layout_centerInParent="true"
+                    android:background="@color/white"
+                    android:gravity="center"
+                    android:hint="请输入仓位"
+                    android:textColorHint="@color/gray"
+                    android:textSize="14sp" />
+            </RelativeLayout>
+
             <TextView
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"

+ 79 - 4
src/com/dongkesoft/ibossmini/activity/report/InventoryListActivity.java

@@ -47,6 +47,7 @@ import com.dongkesoft.ibossmini.adapter.InventorysearchAdapter;
 import com.dongkesoft.ibossmini.constant.Comment;
 import com.dongkesoft.ibossmini.constant.Constants;
 import com.dongkesoft.ibossmini.model.BrandInfo;
+import com.dongkesoft.ibossmini.model.GradeBean;
 import com.dongkesoft.ibossmini.model.InventoryInfo;
 import com.dongkesoft.ibossmini.model.SearchInfo;
 import com.dongkesoft.ibossmini.model.VarietyBean;
@@ -74,9 +75,11 @@ public class InventoryListActivity extends IBossBaseActivity implements
 	/**
 	 * 仓库号,品牌ID
 	 */
-	private String WarehouseCode, BrandID;
+	private String WarehouseCode, BrandID, GradeID;
 //	规格
 	private String specification = "";
+	private String colornumber = "";
+	private String positionnumber = "";
 	/**
 	 * 商品编码,唯一编码
 	 */
@@ -154,6 +157,8 @@ public class InventoryListActivity extends IBossBaseActivity implements
 	 */
 	private List<InventoryInfo> listData;
 	private List<VarietyBean> varietyListFilters;
+	private List<GradeBean> gradeListFilters;
+	private List<GradeBean> gradeList = new ArrayList<GradeBean>();
 	/**
 	 * 库区数据
 	 */
@@ -184,6 +189,8 @@ public class InventoryListActivity extends IBossBaseActivity implements
 	private RelativeLayout rlOnlyCode;
 	private EditText etOnlyCode;
 	private EditText etSpecification;
+	private EditText etColorNumber;
+	private EditText etPositionNumber;
 	private EditText goodsName;
 	/**
 	 * 库存
@@ -195,6 +202,8 @@ public class InventoryListActivity extends IBossBaseActivity implements
 	 */
 	private RelativeLayout rlBrand;
 	private TextView tvBrand;
+	private RelativeLayout rlGrade;
+	private TextView tvGrade;
 	/**
 	 * 品种
 	 */
@@ -279,6 +288,9 @@ public class InventoryListActivity extends IBossBaseActivity implements
 		case R.id.rl_variety:
 			loadData("T_MST_Goods_Variety");
 			break;
+		case R.id.rl_grade:
+			loadData("T_MST_Goods_Grade");
+			break;
 		/**
 		 * 重置
 		 */
@@ -288,8 +300,14 @@ public class InventoryListActivity extends IBossBaseActivity implements
 			etOnlyCode.setText("");
 			goodsName.setText("");
 			etSpecification.setText("");
+			etColorNumber.setText("");
+			etPositionNumber.setText("");
 			tvBrand.setText("请选择品牌");
 			tvBrand.setTextColor(Color.parseColor("#808080"));
+			tvVariety.setText("请选择品种");
+			tvVariety.setTextColor(Color.parseColor("#808080"));
+			tvGrade.setText("请选择等级");
+			tvGrade.setTextColor(Color.parseColor("#808080"));			
 			tvReservoir.setText("请选择库区");
 			tvReservoir.setTextColor(Color.parseColor("#808080"));
 			break;
@@ -313,10 +331,18 @@ public class InventoryListActivity extends IBossBaseActivity implements
 			if (tvBrand.getText().toString().equals("请选择品牌")) {
 				BrandID = "";
 			}
+			if (tvVariety.getText().toString().equals("请选择品种")) {
+				variety = "";
+			}
+			if (tvGrade.getText().toString().equals("请选择等级")) {
+				GradeID = "";
+			}
 			if (tvReservoir.getText().toString().equals("请选择库区")) {
 				WarehouseCode = "";
 			}
 			specification = etSpecification.getText().toString();
+			colornumber = etColorNumber.getText().toString();
+			positionnumber = etPositionNumber.getText().toString();
 			mSearchInfoList = new ArrayList<SearchInfo>();
 			mCurrentPage = "1";
 			mInventorysearchAdapter = null;
@@ -353,6 +379,7 @@ public class InventoryListActivity extends IBossBaseActivity implements
 		super.onCreate(savedInstanceState);
 
 		BrandID = "";
+		GradeID = "";
 		WarehouseCode = "";
 		commodityCode = "";
 		distinguishedEncodingRules = "";
@@ -385,8 +412,10 @@ public class InventoryListActivity extends IBossBaseActivity implements
 		btnSure = (TextView) view.findViewById(R.id.btn_sure);
 		tvClose = (TextView) view.findViewById(R.id.tv_close);
 		tvBrand = (TextView) view.findViewById(R.id.tv_brand);
+		tvGrade = (TextView) view.findViewById(R.id.tv_grade);		
 		tvReservoir = (TextView) view.findViewById(R.id.tv_reservoir);
 		rlBrand = (RelativeLayout) view.findViewById(R.id.rl_brand);
+		rlGrade = (RelativeLayout) view.findViewById(R.id.rl_grade);
 		rlReservoir = (RelativeLayout) view.findViewById(R.id.rl_reservoir);
 		rlOnlyCode = (RelativeLayout) view.findViewById(R.id.rl_only_code);
 		rlCommodityCode = (RelativeLayout) view
@@ -396,6 +425,8 @@ public class InventoryListActivity extends IBossBaseActivity implements
 		etOnlyCode = (EditText) view.findViewById(R.id.et_only_code);
 		goodsName = (EditText) view.findViewById(R.id.et_goods_name);
 		etSpecification = (EditText) view.findViewById(R.id.et_goods_specification);
+		etColorNumber = (EditText) view.findViewById(R.id.et_goods_colornumber);
+		etPositionNumber = (EditText) view.findViewById(R.id.et_goods_positionnumber);
 		
 		etOnlyCode.setOnFocusChangeListener(mOnFocusChangeListener);
 		etCommodityCode = (EditText) view.findViewById(R.id.et_commodity_code);
@@ -514,6 +545,7 @@ public class InventoryListActivity extends IBossBaseActivity implements
 		rlOnlyCode.setOnClickListener(this);
 		rlReservoir.setOnClickListener(this);
 		rlBrand.setOnClickListener(this);
+		rlGrade.setOnClickListener(this);
 		btnReset.setOnClickListener(this);
 		btnSure.setOnClickListener(this);
 		rlZeroInventory.setOnClickListener(this);
@@ -628,6 +660,21 @@ public class InventoryListActivity extends IBossBaseActivity implements
 									Comment.varietyInfos = varietyList;
 									showltDialog(string);
 								}
+								if (string.equals("T_MST_Goods_Grade")) {
+									for (int i = 0; i < array.length(); i++) {
+										JSONObject jsonObjectGoods = new JSONObject(
+												array.getString(i));
+										// VarietyName VarietyID
+										GradeBean info = new GradeBean();
+										info.setGradeID(jsonObjectGoods
+												.getString("GradeID"));
+										info.setGradeName(jsonObjectGoods
+												.getString("GradeName"));
+										gradeList.add(info);
+									}
+									Comment.gradeBeanInfos = gradeList;
+									showltDialog(string);
+								}
 							}
 
 							else if (jsonObject.getInt("Status") == Constants.ACTION_RESULT_STATUS
@@ -687,10 +734,11 @@ public class InventoryListActivity extends IBossBaseActivity implements
 		Comment.inventoryInfos = Comment.list;
 		Comment.brandLists = Comment.brandInfos;
 		Comment.varietyLists=Comment.varietyInfos;
+		Comment.gradeBeanLists=Comment.gradeBeanInfos;
 		lvDialogSelect = (ListView) view.findViewById(R.id.select_list);
 		etDialogSearch = (EditText) view.findViewById(R.id.et_search);
 		InventoryAdapter adapter = new InventoryAdapter(Comment.inventoryInfos,
-				Comment.brandLists, Comment.varietyInfos, InventoryListActivity.this, string);
+				Comment.brandLists, Comment.varietyInfos,Comment.gradeBeanInfos, InventoryListActivity.this, string);
 		lvDialogSelect.setAdapter(adapter);
 		etDialogSearch.addTextChangedListener(new TextWatcher() {
 			@Override
@@ -708,6 +756,7 @@ public class InventoryListActivity extends IBossBaseActivity implements
 				listData = new ArrayList<InventoryInfo>();
 				brandListFilters = new ArrayList<BrandInfo>();
 				varietyListFilters = new ArrayList<VarietyBean>();
+				gradeListFilters = new ArrayList<GradeBean>();
 				if (string.equals("T_MST_Warehouse")) {
 					for (int i = 0; i < Comment.list.size(); i++) {
 						if ((Comment.list.get(i).getWarehouseName().toString()
@@ -737,7 +786,24 @@ public class InventoryListActivity extends IBossBaseActivity implements
 							InventoryListActivity.this, string);
 					lvDialogSelect.setAdapter(adapter);
 
-				} else {
+				} 
+				else if (string.equals("T_MST_Goods_Grade")) {
+
+					for (int i = 0; i < Comment.gradeBeanInfos.size(); i++) {
+						if ((Comment.gradeBeanInfos.get(i).getGradeName()
+								.toString().indexOf(etDialogSearch.getText()
+								.toString())) >= 0) {
+							gradeListFilters.add(Comment.gradeBeanInfos.get(i));
+						}
+					}
+					Comment.gradeBeanLists = gradeListFilters;
+
+					InventoryAdapter adapter = new InventoryAdapter(
+							Comment.inventoryInfos, Comment.brandLists, Comment.varietyLists,Comment.gradeBeanLists,
+							InventoryListActivity.this, string);
+					lvDialogSelect.setAdapter(adapter);
+
+				}else {
 					for (int i = 0; i < Comment.brandInfos.size(); i++) {
 						if ((Comment.brandInfos.get(i).getBrandName()
 								.toString().indexOf(etDialogSearch.getText()
@@ -774,7 +840,13 @@ public class InventoryListActivity extends IBossBaseActivity implements
 							.getVarietyName().toString());
 					variety = Comment.varietyLists.get(arg2).getVarietyID();
 
-				} else {
+				} else if (string.equals("T_MST_Goods_Grade")) {
+					tvGrade.setTextColor(Color.parseColor("#000000"));
+					tvGrade.setText(Comment.gradeBeanLists.get(arg2).getGradeName()
+							.toString());
+					GradeID = Comment.gradeBeanLists.get(arg2).getGradeID();
+				}
+				else {
 					tvBrand.setTextColor(Color.parseColor("#000000"));
 					tvBrand.setText(Comment.brandLists.get(arg2).getBrandName()
 							.toString());
@@ -841,12 +913,15 @@ public class InventoryListActivity extends IBossBaseActivity implements
 		params.put("WarehouseCode", WarehouseCode + "");
 		params.put("VarietyID", variety + "");
 		params.put("BrandID", BrandID + "");
+		params.put("GradeID", GradeID + "");
 		params.put("PageSize", size);
 		params.put("PageNum", page);
 		params.put("isfilterQuantityEqZero",
 				String.valueOf(isFilterQuantityEqZero));
 		
 		params.put("Specification", specification);
+		params.put("ColorNumber", colornumber);
+		params.put("PositionNumber", positionnumber);
 
 		client.post(String.format(Constants.URL, mServerAddressIp,
 				mServerAddressPort), params, new AsyncHttpResponseHandler(

+ 27 - 12
src/com/dongkesoft/ibossmini/adapter/InventoryAdapter.java

@@ -12,6 +12,7 @@ import android.widget.TextView;
 
 import com.dongkesoft.ibossmini.R;
 import com.dongkesoft.ibossmini.model.BrandInfo;
+import com.dongkesoft.ibossmini.model.GradeBean;
 import com.dongkesoft.ibossmini.model.InventoryInfo;
 import com.dongkesoft.ibossmini.model.VarietyBean;
 
@@ -23,7 +24,8 @@ public class InventoryAdapter extends BaseAdapter {
 
 	private List<InventoryInfo> mInventoryInfos = new ArrayList<InventoryInfo>();
 	private List<BrandInfo> mBrandInfos = new ArrayList<BrandInfo>();
-	private List<VarietyBean> mVarietyInfo=new ArrayList<VarietyBean>();
+	private List<VarietyBean> mVarietyInfo = new ArrayList<VarietyBean>();
+	private List<GradeBean> gradeBeanInfos = new ArrayList<GradeBean>();
 	private LayoutInflater mInflater;
 	private String string;
 
@@ -32,21 +34,34 @@ public class InventoryAdapter extends BaseAdapter {
 
 		if (string.equals("T_MST_Warehouse")) {
 			return mInventoryInfos.size();
-		}else if(string.equals("T_MST_Goods_Variety")){
+		} else if (string.equals("T_MST_Goods_Variety")) {
 			return mVarietyInfo.size();
 		} 
-		else {
+		else if (string.equals("T_MST_Goods_Grade")) {
+			return gradeBeanInfos.size();
+		}else {
 			return mBrandInfos.size();
 		}
 
 	}
 
-	public InventoryAdapter(List<InventoryInfo> mInventoryInfos,
-			List<BrandInfo> mBrandInfos,List<VarietyBean> mVarietyInfo, Context context, String string) {
+	public InventoryAdapter(List<InventoryInfo> mInventoryInfos, List<BrandInfo> mBrandInfos,
+			List<VarietyBean> mVarietyInfo, Context context, String string) {
 		super();
 		this.mInventoryInfos = mInventoryInfos;
 		this.mBrandInfos = mBrandInfos;
-		this.mVarietyInfo=mVarietyInfo;
+		this.mVarietyInfo = mVarietyInfo;
+		this.mInflater = LayoutInflater.from(context);
+		this.string = string;
+	}
+
+	public InventoryAdapter(List<InventoryInfo> mInventoryInfos, List<BrandInfo> mBrandInfos,
+			List<VarietyBean> mVarietyInfo, List<GradeBean> mGreadeInfos, Context context, String string) {
+		super();
+		this.mInventoryInfos = mInventoryInfos;
+		this.mBrandInfos = mBrandInfos;
+		this.mVarietyInfo = mVarietyInfo;
+		this.gradeBeanInfos = mGreadeInfos;
 		this.mInflater = LayoutInflater.from(context);
 		this.string = string;
 	}
@@ -66,13 +81,13 @@ public class InventoryAdapter extends BaseAdapter {
 		View view = mInflater.inflate(R.layout.inventory_adapter_item, null);
 		TextView tv = (TextView) view.findViewById(R.id.tv_inventory_item);
 		if (string.equals("T_MST_Warehouse")) {
-			tv.setText(mInventoryInfos.get(position).getWarehouseName()
-					.toString());
-		}else if(string.equals("T_MST_Goods_Variety")){
-			tv.setText(mVarietyInfo.get(position).getVarietyName()
-					.toString());
+			tv.setText(mInventoryInfos.get(position).getWarehouseName().toString());
+		} else if (string.equals("T_MST_Goods_Variety")) {
+			tv.setText(mVarietyInfo.get(position).getVarietyName().toString());
 		} 
-		else {
+		else if (string.equals("T_MST_Goods_Grade")) {
+			tv.setText(gradeBeanInfos.get(position).getGradeName().toString());
+		}else {
 			tv.setText(mBrandInfos.get(position).getBrandName().toString());
 		}
 

+ 3 - 0
src/com/dongkesoft/ibossmini/constant/Comment.java

@@ -15,6 +15,7 @@ import com.dongkesoft.ibossmini.model.DayAccountSearchInfo;
 import com.dongkesoft.ibossmini.model.DictionaryBean;
 import com.dongkesoft.ibossmini.model.EarnestModel;
 import com.dongkesoft.ibossmini.model.EducationInfo;
+import com.dongkesoft.ibossmini.model.GradeBean;
 import com.dongkesoft.ibossmini.model.InventoryInfo;
 import com.dongkesoft.ibossmini.model.KindBean;
 import com.dongkesoft.ibossmini.model.LogAddAuthorityInfo;
@@ -39,6 +40,8 @@ public class Comment {
 	public static List<InventoryInfo> inventoryInfos = new ArrayList<InventoryInfo>();
 	public static List<VarietyBean> varietyInfos = new ArrayList<VarietyBean>();
 	public static List<VarietyBean> varietyLists = new ArrayList<VarietyBean>();
+	public static List<GradeBean> gradeBeanInfos = new ArrayList<GradeBean>();
+	public static List<GradeBean> gradeBeanLists = new ArrayList<GradeBean>();	
 	public static List<BrandInfo> brandInfos = new ArrayList<BrandInfo>();
 	public static List<BrandInfo> brandLists = new ArrayList<BrandInfo>();
 	public static List<ApproveInfo> approveInfos = new ArrayList<ApproveInfo>();