瀏覽代碼

修复盘点作业问题

songw 3 月之前
父節點
當前提交
1f90b8c9d9

+ 98 - 73
app/src/main/java/com/uas/jc_wms/fragment/InventoryCollectFragment.java

@@ -1,6 +1,7 @@
 package com.uas.jc_wms.fragment;
 
 import android.app.Activity;
+import android.content.DialogInterface;
 import android.content.Intent;
 import android.graphics.drawable.BitmapDrawable;
 import android.os.Bundle;
@@ -67,6 +68,7 @@ public class InventoryCollectFragment extends BaseFragment implements View.OnCli
     private List<InventoryCollctBean> mStockTaskMultipleBeans;
     private CheckBox mCheckBox;
     private String bar_remain;
+    private AlertDialog alertDialog;
 
     @Override
     protected int getLayout() {
@@ -86,6 +88,8 @@ public class InventoryCollectFragment extends BaseFragment implements View.OnCli
         mNumTextView = root.findViewById(R.id.inventory_collect_num_tv);
         mClassTextView = root.findViewById(R.id.inventory_collect_class_tv);
         cb_caiji=root.findViewById(R.id.cb_caiji);
+        tvPiInoutno=root.findViewById(R.id.tv_pi_inoutno);
+
 
         mBarcodeEditText.requestFocus();
 
@@ -214,6 +218,7 @@ public class InventoryCollectFragment extends BaseFragment implements View.OnCli
                             .tag(TAG + "getbarcodeinfo")
                             .flag(0)
                             .addParam("barcode", barcode)
+//                            .addParam("code", pi_inoutno)
                             .build(), new HttpCallback() {
                         @Override
                         public void onSuccess(int flag, Object o) throws Exception {
@@ -229,89 +234,109 @@ public class InventoryCollectFragment extends BaseFragment implements View.OnCli
 
                                 View dialogView = View.inflate(getActivity(), R.layout.dialog_confirm_quantity, null);
                                 final EditText modifyEditText = dialogView.findViewById(R.id.recharge_modify_et);
-                                final AlertDialog alertDialog = new AlertDialog.Builder(getActivity()).setTitle("确认数量")
+
+//                                TextView tv_uninventoried_quantity = dialogView.findViewById(R.id.tv_uninventoried_quantity);
+//                                TextView tv_material_no = dialogView.findViewById(R.id.tv_material_no);
+//                                TextView tv_material_name = dialogView.findViewById(R.id.tv_material_name);
+//                                TextView tv_material_specification = dialogView.findViewById(R.id.tv_material_specification);
+//
+//                                tv_uninventoried_quantity.setText(FastjsonUtil.getText(dataObject, "UNQTY"));
+//                                tv_material_no.setText(FastjsonUtil.getText(dataObject, "BAR_PRODCODE"));
+//                                tv_material_name.setText(FastjsonUtil.getText(dataObject, "PR_DETAIL"));
+//                                tv_material_specification.setText(FastjsonUtil.getText(dataObject, "PR_SPEC"));
+
+                                alertDialog = new AlertDialog.Builder(getActivity()).setTitle("确认数量")
                                         .setView(dialogView)
                                         .setNegativeButton(R.string.cancel, null)
-                                        .setPositiveButton(R.string.confirm, null).create();
-                                alertDialog.show();
-                                modifyEditText.setText(bar_remain);
-                                modifyEditText.setSelection(modifyEditText.getText().length());
-                                alertDialog.getButton(AlertDialog.BUTTON_POSITIVE).setOnClickListener(new View.OnClickListener() {
-                                    @Override
-                                    public void onClick(View view) {
-                                        if (StringUtil.isEmpty(modifyEditText.getText().toString().trim())) {
-                                            CommonUtil.toastNoRepeat(getActivity(), "请输入条码数量");
-                                            return;
-                                        }
-                                        double quantity = -1;
-                                        try {
-                                            quantity = Double.parseDouble(modifyEditText.getText().toString().trim());
-                                        } catch (Exception e) {
-                                            CommonUtil.toastNoRepeat(getActivity(), "请输入正确的数字");
-                                            return;
-                                        }
-                                        if (quantity <= 0) {
-                                            CommonUtil.toastNoRepeat(getActivity(), "数量必须大于0");
-                                            return;
-                                        }
-                                        VolleyRequest.getInstance().stringRequest(new HttpParams.Builder()
-                                                .url(GloableParams.ADDRESS_BARSTOCK_GETBARCODEINFO)
-                                                .method(Request.Method.GET)
-                                                .tag(TAG + "getbarcodeinfo")
-                                                .flag(0)
-                                                .addParam("inoutno", pi_inoutno)
-                                                //.addParam("deadline", deadLine)
-                                                .addParam("barcode", barcode)
-                                                .addParam("iscancel", isChecked + "")
-                                                .addParam("bar_remain", modifyEditText.getText().toString().trim())
-                                                .build(), new HttpCallback() {
+                                        .setPositiveButton(R.string.confirm, new DialogInterface.OnClickListener() {
                                             @Override
-                                            public void onSuccess(int flag, Object o) throws Exception {
-                                                alertDialog.dismiss();
+                                            public void onClick(DialogInterface dialog, int which) {
+                                                if (StringUtil.isEmpty(modifyEditText.getText().toString().trim())) {
+                                                    CommonUtil.toastNoRepeat(getActivity(), "请输入条码数量");
+                                                    return;
+                                                }
+                                                double quantity = -1;
                                                 try {
-                                                    mBarcodeEditText.setText("");
-                                                    String result = o.toString();
-                                                    JSONObject resultObject = JSON.parseObject(result);
-                                                    JSONObject dataObject = resultObject.getJSONObject("data");
-                                                    if (dataObject != null) {
-                                                        String type = FastjsonUtil.getText(dataObject, "BI_TYPE");
-                                                        String prompt = "采集成功!";
-                                                        if (!"超期".equals(type)) {
-                                                            mResultTextView.setTextColor(mActivity.getResources().getColor(R.color.black));
-                                                            prompt = "采集成功!";
-                                                        } else {
-                                                            mResultTextView.setTextColor(mActivity.getResources().getColor(R.color.red));
-                                                            prompt = "采集成功!已超期";
+                                                    quantity = Double.parseDouble(modifyEditText.getText().toString().trim());
+                                                } catch (Exception e) {
+                                                    CommonUtil.toastNoRepeat(getActivity(), "请输入正确的数字");
+                                                    return;
+                                                }
+                                                if (quantity <= 0) {
+                                                    CommonUtil.toastNoRepeat(getActivity(), "数量必须大于0");
+                                                    return;
+                                                }
+                                                VolleyRequest.getInstance().stringRequest(new HttpParams.Builder()
+                                                        .url(GloableParams.ADDRESS_BARSTOCK_GETBARCODEINFO)
+                                                        .method(Request.Method.GET)
+                                                        .tag(TAG + "getbarcodeinfo")
+                                                        .flag(0)
+                                                        .addParam("inoutno", pi_inoutno)
+                                                        //.addParam("deadline", deadLine)
+                                                        .addParam("barcode", barcode)
+                                                        .addParam("iscancel", isChecked + "")
+                                                        .addParam("bar_remain", modifyEditText.getText().toString().trim())
+                                                        .build(), new HttpCallback() {
+                                                    @Override
+                                                    public void onSuccess(int flag, Object o) throws Exception {
+                                                        alertDialog.dismiss();
+                                                        try {
+                                                            mBarcodeEditText.setText("");
+                                                            String result = o.toString();
+                                                            JSONObject resultObject = JSON.parseObject(result);
+                                                            JSONObject dataObject = resultObject.getJSONObject("data");
+                                                            if (dataObject != null) {
+                                                                String type = FastjsonUtil.getText(dataObject, "BI_TYPE");
+                                                                String prompt = "采集成功!";
+                                                                if (!"超期".equals(type)) {
+                                                                    mResultTextView.setTextColor(mActivity.getResources().getColor(R.color.black));
+                                                                    prompt = "采集成功!";
+                                                                } else {
+                                                                    mResultTextView.setTextColor(mActivity.getResources().getColor(R.color.red));
+                                                                    prompt = "采集成功!已超期";
+                                                                }
+
+                                                                mResultTextView.setVisibility(View.VISIBLE);
+                                                                mResultTextView.setText(prompt
+                                                                        + "\n物料:" + FastjsonUtil.getText(dataObject, "BI_PRODCODE")
+                                                                        //                                        + "\n品牌:" + FastjsonUtil.getText(dataObject, "BI_BRAND")
+                                                                        //                                        + "\nLOTNO:" + FastjsonUtil.getText(dataObject, "BI_LOTNO")
+                                                                        //                                        + "\nDC:" + FastjsonUtil.getText(dataObject, "BI_DATECODE")
+                                                                        + "\n型号:" + FastjsonUtil.getText(dataObject, "PR_ORISPECCODE")
+                                                                        + "\n条码号:" + FastjsonUtil.getText(dataObject, "BI_BARCODE")
+                                                                        + "\n数量:" + FastjsonUtil.getText(dataObject, "BI_INQTY")
+                                                                );
+                                                            }
+                                                        } catch (Exception e) {
+                                                            e.printStackTrace();
                                                         }
+                                                    }
 
+                                                    @Override
+                                                    public void onFail(int flag, String failStr) throws Exception {
+                                                        alertDialog.dismiss();
+                                                        mBarcodeEditText.setText("");
+                                                        progressDialog.dismiss();
+                                                        CommonUtil.toastNoRepeat(mActivity, failStr);
                                                         mResultTextView.setVisibility(View.VISIBLE);
-                                                        mResultTextView.setText(prompt
-                                                                + "\n物料:" + FastjsonUtil.getText(dataObject, "BI_PRODCODE")
-                                                                //                                        + "\n品牌:" + FastjsonUtil.getText(dataObject, "BI_BRAND")
-                                                                //                                        + "\nLOTNO:" + FastjsonUtil.getText(dataObject, "BI_LOTNO")
-                                                                //                                        + "\nDC:" + FastjsonUtil.getText(dataObject, "BI_DATECODE")
-                                                                + "\n型号:" + FastjsonUtil.getText(dataObject, "PR_ORISPECCODE")
-                                                                + "\n条码号:" + FastjsonUtil.getText(dataObject, "BI_BARCODE")
-                                                                + "\n数量:" + FastjsonUtil.getText(dataObject, "BI_INQTY")
-                                                        );
+                                                        mResultTextView.setText(failStr);
                                                     }
-                                                } catch (Exception e) {
-                                                    e.printStackTrace();
-                                                }
+                                                });
                                             }
+                                        }).create();
+                                modifyEditText.setText(bar_remain);
+                                modifyEditText.setSelection(modifyEditText.getText().length());
+//                                alertDialog.getButton(AlertDialog.BUTTON_POSITIVE).setOnClickListener(new View.OnClickListener() {
+//                                    @Override
+//                                    public void onClick(View view) {
+//
+//                                    }
+//                                });
 
-                                            @Override
-                                            public void onFail(int flag, String failStr) throws Exception {
-                                                alertDialog.dismiss();
-                                                mBarcodeEditText.setText("");
-                                                progressDialog.dismiss();
-                                                CommonUtil.toastNoRepeat(mActivity, failStr);
-                                                mResultTextView.setVisibility(View.VISIBLE);
-                                                mResultTextView.setText(failStr);
-                                            }
-                                        });
-                                    }
-                                });
+                                // 禁用屏幕外点击
+                                alertDialog.setCancelable(false);
+                                alertDialog.setCanceledOnTouchOutside(false);
+                                alertDialog.show();
                             } catch (Exception e) {
                                 e.printStackTrace();
                             }

+ 101 - 1
app/src/main/res/layout/dialog_confirm_quantity.xml

@@ -13,19 +13,119 @@
         android:layout_height="wrap_content"
         android:orientation="horizontal">
 
+        <TextView
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:textSize="13sp"
+            android:text="条码数量:"/>
+
         <EditText
             android:id="@+id/recharge_modify_et"
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
+            android:layout_marginStart="5dp"
             android:background="@drawable/bg_line_edittext"
             android:inputType="numberDecimal"
             android:padding="10dp" />
 
+    </LinearLayout>
+<!--
+    <LinearLayout
+        android:layout_marginTop="10dp"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:orientation="horizontal">
+
+        <TextView
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text="未盘点数量:"
+            android:textSize="13sp"
+             />
+
+        <TextView
+            android:id="@+id/tv_uninventoried_quantity"
+            android:layout_marginStart="5dp"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text=""
+            android:textSize="13sp"
+            />
+
+    </LinearLayout>
+
+    <LinearLayout
+        android:layout_marginTop="10dp"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:orientation="horizontal">
+
+        <TextView
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text="物料编号:"
+            android:textSize="13sp"
+            />
+
         <TextView
+            android:id="@+id/tv_material_no"
+            android:layout_marginStart="5dp"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
-            android:text="条码数量"/>
+            android:text=""
+            android:textSize="13sp"
+            />
 
     </LinearLayout>
 
+    <LinearLayout
+        android:layout_marginTop="10dp"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:orientation="horizontal">
+
+        <TextView
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text="物料名称:"
+            android:textSize="13sp"
+            />
+
+        <TextView
+            android:id="@+id/tv_material_name"
+            android:layout_marginStart="5dp"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text=""
+            android:textSize="13sp"
+            />
+
+    </LinearLayout>
+
+    <LinearLayout
+        android:layout_marginTop="10dp"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:orientation="horizontal"
+        android:layout_marginBottom="10dp"
+        >
+
+        <TextView
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text="物料规格:"
+            android:textSize="13sp"
+            />
+
+        <TextView
+            android:id="@+id/tv_material_specification"
+            android:layout_marginStart="5dp"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text=""
+            android:textSize="13sp"
+            />
+
+    </LinearLayout>-->
+
 </LinearLayout>

+ 2 - 2
build.gradle

@@ -55,8 +55,8 @@ ext {
             targetSdkVersion : 28,
             compileSdkVersion: 28,
             buildToolsVersion: "28.0.3",
-            versionCode      : 36,
-            versionName      : "v2.5.0"
+            versionCode      : 37,
+            versionName      : "v2.5.1"
     ]
 
     depsVersion = [