wuhb hace 1 año
padre
commit
83dd66fb6b

+ 11 - 0
app/src/main/java/com/ygtx/emcs/activity/adapter/StockInListViewAdapter.java

@@ -14,6 +14,7 @@ import com.ygtx.emcs.R;
 import com.ygtx.emcs.activity.model.StockLineModel;
 import com.ygtx.emcs.util.StringUtils;
 
+import java.math.BigDecimal;
 import java.util.ArrayList;
 
 public class StockInListViewAdapter extends BaseAdapter {
@@ -59,6 +60,8 @@ public class StockInListViewAdapter extends BaseAdapter {
             mainHolder.tv_automatic = view.findViewById(R.id.tv_automatic);
             mainHolder.tv_box_code = view.findViewById(R.id.tv_box_code);
             mainHolder.tv_box_code_tip = view.findViewById(R.id.tv_box_code_tip);
+            mainHolder.tv_other_num = view.findViewById(R.id.tv_other_num);
+            mainHolder.tv_other_num_tips = view.findViewById(R.id.tv_other_num_tips);
             view.setTag(mainHolder);
         }else{
             mainHolder= (MainHolder) view.getTag();
@@ -85,6 +88,12 @@ public class StockInListViewAdapter extends BaseAdapter {
             mainHolder.tv_stock_status.setTextColor(Color.RED);
             mainHolder.tv_stock_status.setText("待入库");
         }
+        BigDecimal orderQty = stockLineModel.getOrderQuantity();
+        if(orderQty == null){
+            stockLineModel.setOrderQuantity(BigDecimal.ZERO);
+        }
+        mainHolder.tv_other_num_tips.setText("总量:");
+        mainHolder.tv_other_num.setText(orderQty.toString());
         return view;
     }
 
@@ -97,6 +106,8 @@ public class StockInListViewAdapter extends BaseAdapter {
         public TextView tv_automatic;
         public TextView tv_box_code;
         public TextView tv_box_code_tip;
+        public TextView tv_other_num;
+        public TextView tv_other_num_tips;
     }
 
 }

+ 11 - 0
app/src/main/java/com/ygtx/emcs/activity/adapter/StockOutListViewAdapter.java

@@ -18,6 +18,7 @@ import com.ygtx.emcs.R;
 import com.ygtx.emcs.activity.model.StockLineModel;
 import com.ygtx.emcs.util.StringUtils;
 
+import java.math.BigDecimal;
 import java.util.ArrayList;
 
 public class StockOutListViewAdapter extends BaseAdapter {
@@ -65,6 +66,8 @@ public class StockOutListViewAdapter extends BaseAdapter {
             mainHolder.tv_box_code = view.findViewById(R.id.tv_box_code);
             mainHolder.ll_item_spec = view.findViewById(R.id.ll_item_spec);
             mainHolder.ll_product_name = view.findViewById(R.id.ll_product_name);
+            mainHolder.tv_other_num = view.findViewById(R.id.tv_other_num);
+            mainHolder.tv_other_num_tips = view.findViewById(R.id.tv_other_num_tips);
             view.setTag(mainHolder);
         }else{
             mainHolder= (MainHolder) view.getTag();
@@ -106,6 +109,12 @@ public class StockOutListViewAdapter extends BaseAdapter {
         mainHolder.qty.setText(stockLineModel.getQuantity());
         mainHolder.tv_product_name.setText(stockLineModel.getItemName());
         mainHolder.tv_box_code.setText(stockLineModel.getBoxCode());
+        mainHolder.tv_other_num_tips.setText("剩余:");
+        BigDecimal boxQty = stockLineModel.getBoxItemQuantity();
+        if(boxQty == null){
+            stockLineModel.setBoxItemQuantity(BigDecimal.ZERO);
+        }
+        mainHolder.tv_other_num.setText(boxQty.toString());
         return view;
     }
 
@@ -120,6 +129,8 @@ public class StockOutListViewAdapter extends BaseAdapter {
         public TextView tv_box_code;
         public LinearLayout ll_item_spec;
         public LinearLayout ll_product_name;
+        public TextView tv_other_num;
+        public TextView tv_other_num_tips;
     }
 
 }

+ 9 - 0
app/src/main/java/com/ygtx/emcs/activity/model/StockLineModel.java

@@ -34,6 +34,7 @@ public class StockLineModel implements Serializable {
     private Integer outMode;
     private String outCheck;
     private String sel;
+    private BigDecimal boxItemQuantity;
 
 
     public Long getLineId() {
@@ -275,4 +276,12 @@ public class StockLineModel implements Serializable {
     public void setSel(String sel) {
         this.sel = sel;
     }
+
+    public BigDecimal getBoxItemQuantity() {
+        return boxItemQuantity;
+    }
+
+    public void setBoxItemQuantity(BigDecimal boxItemQuantity) {
+        this.boxItemQuantity = boxItemQuantity;
+    }
 }

+ 55 - 27
app/src/main/res/layout/ygtx_stock_product_item.xml

@@ -74,7 +74,7 @@
         android:id="@+id/ll_stock_type"
         app:layout_constraintLeft_toLeftOf="parent"
         app:layout_constraintRight_toRightOf="parent"
-        app:layout_constraintTop_toBottomOf="@+id/ll_product_name"
+        app:layout_constraintTop_toBottomOf="@+id/ll_product_code"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:background="@color/white"
@@ -91,7 +91,7 @@
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
             android:id="@+id/tv_automatic"
-            android:layout_weight="1"
+            android:layout_weight="1.3"
             android:paddingStart="5dp"
             android:textSize="18dp"
             />
@@ -115,8 +115,8 @@
     </LinearLayout>
     <LinearLayout
         android:id="@+id/ll_product_code"
-        app:layout_constraintTop_toBottomOf="@+id/ll_stock_type"
-        app:layout_constraintRight_toLeftOf="@+id/tv_qty_tips"
+        app:layout_constraintTop_toBottomOf="@+id/ll_product_name"
+        app:layout_constraintRight_toRightOf="parent"
         app:layout_constraintLeft_toLeftOf="parent"
         android:layout_width="0dp"
         android:layout_height="wrap_content"
@@ -137,32 +137,60 @@
             android:textSize="18dp"
             />
     </LinearLayout>
-    <TextView
-        android:layout_width="50dp"
-        android:layout_height="wrap_content"
-        app:layout_constraintTop_toBottomOf="@+id/ll_stock_type"
-        app:layout_constraintRight_toLeftOf="@+id/tv_qty"
-        android:id="@+id/tv_qty_tips"
-        android:hint="0"
-        android:gravity="center"
-        android:textSize="18dp"
-        android:paddingBottom="5dp"
-        android:text="数量:"
-        android:background="@color/white"
-        />
-    <TextView
-        android:layout_width="wrap_content"
-        android:minWidth="50dp"
-        android:layout_height="wrap_content"
+
+    <LinearLayout
+        android:id="@+id/ll_other_num"
         app:layout_constraintTop_toBottomOf="@+id/ll_stock_type"
         app:layout_constraintRight_toRightOf="parent"
-        android:id="@+id/tv_qty"
-        android:hint="0"
-        android:gravity="center"
-        android:textSize="18dp"
-        android:paddingBottom="5dp"
+        app:layout_constraintLeft_toLeftOf="parent"
+        android:layout_width="0dp"
+        android:layout_height="wrap_content"
         android:background="@color/white"
-        />
+        android:orientation="horizontal">
+        <TextView
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:paddingTop="5dp"
+            android:paddingStart="5dp"
+            android:id="@+id/tv_other_num_tips"
+            android:textSize="18dp"
+            android:text="剩余:"/>
+        <TextView
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:id="@+id/tv_other_num"
+            android:gravity="center"
+            android:layout_weight="1"
+            android:text="0"
+            android:textSize="18dp"
+            />
+        <TextView
+            android:layout_width="50dp"
+            android:layout_height="wrap_content"
+            app:layout_constraintTop_toBottomOf="@+id/ll_product_code"
+            app:layout_constraintRight_toLeftOf="@+id/tv_qty"
+            android:id="@+id/tv_qty_tips"
+            android:hint="0"
+            android:gravity="center"
+            android:textSize="18dp"
+            android:paddingBottom="5dp"
+            android:text="数量:"
+            android:background="@color/white"
+            />
+
+        <TextView
+            android:layout_width="match_parent"
+            android:minWidth="50dp"
+            android:layout_height="wrap_content"
+            android:id="@+id/tv_qty"
+            android:layout_weight="1"
+            android:hint="0"
+            android:gravity="center"
+            android:textSize="18dp"
+            android:paddingBottom="5dp"
+            android:background="@color/white"
+            />
+    </LinearLayout>
     <ImageView
         android:layout_width="50dp"
         android:layout_height="50dp"