فهرست منبع

预加工报工增加打印模板选项

ChengJH 1 ماه پیش
والد
کامیت
453fa72335

+ 27 - 4
app/src/main/java/com/uas/ruiziuasmes/fragment/PreProcessingReportFragment.java

@@ -24,6 +24,8 @@ import android.widget.ImageView;
 import android.widget.LinearLayout;
 import android.widget.ListView;
 import android.widget.PopupWindow;
+import android.widget.RadioButton;
+import android.widget.RadioGroup;
 import android.widget.TextView;
 
 import com.alibaba.fastjson.JSON;
@@ -86,6 +88,9 @@ public class PreProcessingReportFragment extends BaseFragment implements View.On
     private String macode;
     private String mouldcode;
     private String stringlotno;
+    private RadioGroup rg_hui;
+    private RadioButton rb_ok;
+    private RadioButton rb_no;
 
     @Override
     protected int getLayout() {
@@ -103,6 +108,9 @@ public class PreProcessingReportFragment extends BaseFragment implements View.On
         btn_oneprint = root.findViewById(R.id.btn_oneprint);
         ol_remark_et = root.findViewById(R.id.ol_remark_et);
         iv_search = root.findViewById(R.id.iv_search);
+        rg_hui = root.findViewById(R.id.rg_hui);
+        rb_ok = root.findViewById(R.id.rb_ok);
+        rb_no = root.findViewById(R.id.rb_no);
         jlt_storage_in_barcode_save_btn = root.findViewById(R.id.jlt_storage_in_barcode_save_btn);
     }
 
@@ -120,8 +128,8 @@ public class PreProcessingReportFragment extends BaseFragment implements View.On
         macode = arguments.getString(Constants.FLAG.MA_CODE);
         mouldcode = arguments.getString(Constants.FLAG.MOULDCODE);
 
-
-        getPrintTemplate();
+        rb_ok.setChecked(true);
+        getPrintTemplate("Lotno!PDAPrint");
         btn_oneprint.setOnClickListener(new View.OnClickListener() {
             @Override
             public void onClick(View v) {
@@ -169,6 +177,21 @@ public class PreProcessingReportFragment extends BaseFragment implements View.On
         });
         ma_code = SharedPreUtil.getString(mActivity, "MA_CODE", null);
         sc_code = SharedPreUtil.getString(mActivity, "SC_CODE", null);
+        rg_hui.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
+            @SuppressLint("NonConstantResourceId")
+            @Override
+            public void onCheckedChanged(RadioGroup radioGroup, int checkid) {
+                switch (checkid){
+                    case R.id.rb_ok:
+                        getPrintTemplate("Lotno!PDAPrint");
+                        break;
+                    case R.id.rb_no:
+                        getPrintTemplate("PreBarcode");
+                        break;
+
+                }
+            }
+        });
 //        tv_ma_code.setText(ma_code);
     }
 
@@ -380,14 +403,14 @@ public class PreProcessingReportFragment extends BaseFragment implements View.On
             CommonUtil.setBackgroundAlpha(mActivity, 1f);
         }
     }
-    private void getPrintTemplate() {
+    private void getPrintTemplate(String caller) {
         VolleyRequest.getInstance().stringRequest(mStringRequest,
                 new HttpParams.Builder()
                         .url(GloableParams.ADDRESS_BARINFO_PRINTMODEL)
                         .method(Request.Method.GET)
                         .flag(0)
                         .tag("barinfoPrint")
-                        .addParam("caller", "PreBarcode")//Barcode!PDAPrint仓库
+                        .addParam("caller", caller)//Barcode!PDAPrint仓库
                         .build(), new HttpCallback() {
                     @Override
                     public void onSuccess(int flag, Object o) throws Exception {

+ 39 - 6
app/src/main/res/layout/fragment_pre_processing_report.xml

@@ -5,12 +5,45 @@
     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>
+    <LinearLayout
+        android:orientation="horizontal"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content">
+        <Button
+            android:id="@+id/btn_oneprint"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text="打印">
+        </Button>
+        <RadioGroup
+            android:id="@+id/rg_hui"
+            android:orientation="horizontal"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_gravity="center"
+            android:gravity="center">
+            <RadioButton
+                android:id="@+id/rb_ok"
+                android:text="报工"
+                android:layout_gravity="center"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_marginRight="@dimen/dp_10"
+                android:layout_marginLeft="@dimen/dp_10"
+                android:textSize="@dimen/sp_14">
+            </RadioButton>
+            <RadioButton
+                android:id="@+id/rb_no"
+                android:text="预加工"
+                android:layout_gravity="center"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_marginLeft="@dimen/dp_10"
+                android:layout_marginRight="@dimen/dp_10">
+            </RadioButton>
+        </RadioGroup>
+    </LinearLayout>
+
     <LinearLayout
         android:layout_weight="1"
         android:orientation="vertical"

+ 2 - 2
build.gradle

@@ -51,8 +51,8 @@ ext {
             targetSdkVersion : 28,
             compileSdkVersion: 28,
             buildToolsVersion: "28.0.3",
-            versionCode      : 21,
-            versionName      : "v1.1.1"
+            versionCode      : 22,
+            versionName      : "v1.1.2"
     ]
 
     depsVersion = [