فهرست منبع

出库采集增加打印按钮

ChengJH 2 ماه پیش
والد
کامیت
7219078cb4

+ 16 - 2
app/src/main/java/com/uas/pda_smart_com/fragment/IOCOutMakeMaterialOper.java

@@ -416,6 +416,8 @@ public class IOCOutMakeMaterialOper extends BaseFragment implements View.OnClick
     private Spinner mTypeSpinner;
     private TextView mMaterialInforTextView;
     private TextView mCollectResultTextView;
+    private Button btn_oneprint;
+    private JSONArray listArray;
 
     @Override
     protected int getLayout() {
@@ -455,7 +457,7 @@ public class IOCOutMakeMaterialOper extends BaseFragment implements View.OnClick
         mTypeSpinner = mActivity.findViewById(R.id.iocout_material_type_sp);
         mMaterialInforTextView = mActivity.findViewById(R.id.iocout_next_material_information);
         mCollectResultTextView = mActivity.findViewById(R.id.iocout_collect_result);
-
+        btn_oneprint = root.findViewById(R.id.btn_oneprint);
 
         mDbManager = new DBManager(getActivity().getApplicationContext());
         mOkHttpClient = new OkHttpClient.Builder()
@@ -570,6 +572,18 @@ public class IOCOutMakeMaterialOper extends BaseFragment implements View.OnClick
 
             }
         });
+        btn_oneprint.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+
+
+                if (listArray != null && listArray.length() > 0) {
+                    printEvent(listArray);
+                }else {
+                    CommonUtil.toastNoRepeat(mActivity, "数据为空");
+                }
+            }
+        });
     }
 
     /**
@@ -1592,7 +1606,7 @@ public class IOCOutMakeMaterialOper extends BaseFragment implements View.OnClick
                         mCollectResultTextView.setVisibility(View.VISIBLE);
                         mCollectResultTextView.setTextColor(getResources().getColor(R.color.green));
                         mCollectResultTextView.setText(null);
-                        JSONArray listArray = dataObject.optJSONArray("nolist");
+                        listArray = dataObject.optJSONArray("nolist");
                         if (mCollectType.equals("byBarcode") || mCollectType.equals("byBatchcode")) {
                             String barcodeResult = "采集成功;" + JsonUtils.optStringNotNull(dataObject, "finishno")
                                     + "\n条码:" + JsonUtils.optStringNotNull(messageObject, "BAR_CODE")

+ 6 - 0
app/src/main/res/layout/fragment_iocout_make_material_oper.xml

@@ -11,6 +11,12 @@
         android:layout_width="match_parent"
         android:layout_height="match_parent"
         android:orientation="vertical">
+        <Button
+            android:id="@+id/btn_oneprint"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text="打印">
+        </Button>
         <!--no use-->
         <LinearLayout
             android:layout_width="match_parent"

+ 2 - 2
build.gradle

@@ -50,8 +50,8 @@ ext {
             targetSdkVersion : 28,
             compileSdkVersion: 28,
             buildToolsVersion: "28.0.3",
-            versionCode      : 27,
-            versionName      : "v2.2.5"
+            versionCode      : 28,
+            versionName      : "v2.2.6"
     ]
 
     depsVersion = [