Browse Source

工单增加查询按钮和调整接口查询方式

songw 3 months ago
parent
commit
2d4d90ceb6

+ 25 - 3
app/src/main/java/com/uas/lg_smart/fragment/SolderChargingFragment.java

@@ -58,6 +58,7 @@ public class SolderChargingFragment extends BaseFragment {
     private ClearableEditText ct_id;
     private ClearableEditText ct_id;
     private ClearableEditText tv_pr_code;
     private ClearableEditText tv_pr_code;
     private ClearableEditText tv_pr_detail;
     private ClearableEditText tv_pr_detail;
+    private Button bt_query_work_order_no;
 
 
     @Override
     @Override
     protected int getLayout() {
     protected int getLayout() {
@@ -81,6 +82,7 @@ public class SolderChargingFragment extends BaseFragment {
         ct_id = root.findViewById(R.id.ct_id);
         ct_id = root.findViewById(R.id.ct_id);
         tv_pr_code = root.findViewById(R.id.tv_pr_code);
         tv_pr_code = root.findViewById(R.id.tv_pr_code);
         tv_pr_detail = root.findViewById(R.id.tv_pr_detail);
         tv_pr_detail = root.findViewById(R.id.tv_pr_detail);
+        bt_query_work_order_no = root.findViewById(R.id.bt_query_work_order_no);
         mRecyclerView.setLayoutManager(new LinearLayoutManager(mActivity));
         mRecyclerView.setLayoutManager(new LinearLayoutManager(mActivity));
         mCaptionValueBeans = new ArrayList<>();
         mCaptionValueBeans = new ArrayList<>();
         initFormList();
         initFormList();
@@ -131,7 +133,12 @@ public class SolderChargingFragment extends BaseFragment {
                     CommonUtil.toastNoRepeat(mActivity, "请采集条码号");
                     CommonUtil.toastNoRepeat(mActivity, "请采集条码号");
                     return;
                     return;
                 }
                 }
-                confirmCharging(barcode);
+                if (TextUtils.isEmpty(mMacodeEditText.getText().toString().trim())) {
+                    String va_code = ct_id.getText().toString().trim();
+                    getfuzzySearchData(va_code,"getData");
+                }else {
+                    confirmCharging(barcode);
+                }
             }
             }
         });
         });
 
 
@@ -163,6 +170,14 @@ public class SolderChargingFragment extends BaseFragment {
                 return false;
                 return false;
             }
             }
         });
         });
+
+        bt_query_work_order_no.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                String va_code = ct_id.getText().toString().trim();
+                getfuzzySearchData(va_code,"");
+            }
+        });
     }
     }
 
 
     public void getfuzzySearchData(String inoutNo,String stop){
     public void getfuzzySearchData(String inoutNo,String stop){
@@ -188,11 +203,18 @@ public class SolderChargingFragment extends BaseFragment {
                     }
                     }
                     mLinecodeEditText.requestFocus();
                     mLinecodeEditText.requestFocus();
                     mLinecodeEditText.setSelection(mLinecodeEditText.getText().toString().length());
                     mLinecodeEditText.setSelection(mLinecodeEditText.getText().toString().length());
+                    if (!TextUtils.isEmpty(stop) && stop.equals("getData")) {
+                        String barcode = mBarcodeEditText.getText().toString().trim();
+                        barcode = CommonUtil.deleteBarcodeSymbol(barcode);
+                        if (TextUtils.isEmpty(barcode)) {
+                            CommonUtil.toastNoRepeat(mActivity, "请采集条码号");
+                            return;
+                        }
+                        confirmCharging(barcode);
+                    }
                 } catch (Exception e) {
                 } catch (Exception e) {
                     e.printStackTrace();
                     e.printStackTrace();
                 }
                 }
-
-
             }
             }
 
 
             @Override
             @Override

+ 11 - 0
app/src/main/res/layout/fragment_solder_charging.xml

@@ -48,7 +48,18 @@
         <com.uas.lg_smart.view.ClearableEditText
         <com.uas.lg_smart.view.ClearableEditText
             android:id="@+id/ct_id"
             android:id="@+id/ct_id"
             style="@style/inputItemValue"
             style="@style/inputItemValue"
+            android:layout_gravity="center_vertical"
             android:hint="请采集工单ID" />
             android:hint="请采集工单ID" />
+
+        <Button
+            android:id="@+id/bt_query_work_order_no"
+            android:layout_width="65dp"
+            android:layout_height="35dp"
+            android:text="查询"
+            android:background="@drawable/bg_button"
+            android:layout_gravity="center_vertical"
+            />
+
     </LinearLayout>
     </LinearLayout>
     <LinearLayout
     <LinearLayout
         android:layout_width="match_parent"
         android:layout_width="match_parent"

+ 2 - 2
build.gradle

@@ -54,8 +54,8 @@ ext {
             targetSdkVersion : 28,
             targetSdkVersion : 28,
             compileSdkVersion: 28,
             compileSdkVersion: 28,
             buildToolsVersion: "28.0.3",
             buildToolsVersion: "28.0.3",
-            versionCode      : 14,
-            versionName      : "v1.1.3"
+            versionCode      : 15,
+            versionName      : "v1.1.4"
     ]
     ]
 
 
     depsVersion = [
     depsVersion = [