Parcourir la source

AVG界面修改,增加下方按钮,增加下拉框选择

ChengJH il y a 2 mois
Parent
commit
d395c93e07

+ 47 - 10
app/src/main/java/com/uas/bgdq/fragment/AGVIOCOutMakeMaterialOper.java

@@ -104,16 +104,16 @@ import okhttp3.OkHttpClient;
  * Created by RaoMeng on 2016/7/27.
  * AVG出库采集页面
  */
-public class AGVIOCOutMakeMaterialOper extends BaseFragment implements View.OnClickListener, RadioGroup.OnCheckedChangeListener,  HttpCallback {
+public class AGVIOCOutMakeMaterialOper extends BaseFragment implements View.OnClickListener, RadioGroup.OnCheckedChangeListener,  HttpCallback ,AdapterView.OnItemSelectedListener{
     private static final int SCAN_BARCODE_CODE = 103;
     private static final int SPLIT_BARCODE_SUCCESS = 104;
     private static final int SPLIT_BARCODE_FAIL = 105;
     private static final int FLAG_CONFIRM_POST = 0x05;
 
-
-
+    private String maFunName = null;
+    private List<String> masterFuncList;
     private ImageView mScanImageView;
-
+    static ArrayAdapter adapter;
     private JsonObjectRequest jsonRequest;
     private static final String TAG = "IOCOutMakeMaterialOper";
     private Button btnActionbarWithback, btnActionbarRight;
@@ -423,12 +423,13 @@ public class AGVIOCOutMakeMaterialOper extends BaseFragment implements View.OnCl
     private CheckBox special_check;
     private TextView text_finishno;
     private Button btn_startoutku;
-    private Button btn_stopoutku;
+    private Button btn_deleteoutku;
+    private Spinner masterSpinner;
 
 
     @Override
     protected int getLayout() {
-        return R.layout.fragment_iocout_make_material_oper;
+        return R.layout.fragment_agviocout_make_material_oper;
     }
 
     @Override
@@ -458,8 +459,8 @@ public class AGVIOCOutMakeMaterialOper extends BaseFragment implements View.OnCl
         mCollectResultTextView = root.findViewById(R.id.iocout_collect_result);
         special_check = root.findViewById(R.id.special_check);
         btn_startoutku = root.findViewById(R.id.btn_startoutku);
-        btn_stopoutku = root.findViewById(R.id.btn_stopoutku);
-
+        btn_deleteoutku = root.findViewById(R.id.btn_deleteoutku);
+        masterSpinner = (Spinner) root.findViewById(R.id.sp_login);
         text_finishno = root.findViewById(R.id.text_finishno);
         ((TextView) (getActivity().findViewById(R.id.tv_actionbar_withback))).setText(getString(R.string.avgout_material_collect));
 //        ((FunctionActivity) getActivity()).fragment = new IOCOutMakeMaterialOper();
@@ -546,7 +547,7 @@ public class AGVIOCOutMakeMaterialOper extends BaseFragment implements View.OnCl
                 startchuku();
             }
         });
-        btn_stopoutku.setOnClickListener(new View.OnClickListener() {
+        btn_deleteoutku.setOnClickListener(new View.OnClickListener() {
             @Override
             public void onClick(View v) {
                 new AlertDialog.Builder(getActivity()).setTitle("提示")
@@ -567,11 +568,35 @@ public class AGVIOCOutMakeMaterialOper extends BaseFragment implements View.OnCl
                         .show();
             }
         });
+
+        masterFuncList = new ArrayList<String>();
+
+        getSpinnerData();
+    }
+    private void getSpinnerData(){
+        masterFuncList.clear();
+//        com.alibaba.fastjson.JSONArray dataArrayone = FastjsonUtil.getJSONArray(o.toString(),"items");
+//        if (dataArrayone == null|| dataArrayone.size() == 0){
+//            CommonUtil.toastNoRepeat(mActivity,"未搜索到匹配数据");
+//        }
+//        for(Object index:dataArrayone){
+//            com.alibaba.fastjson.JSONObject data = (com.alibaba.fastjson.JSONObject) index;
+//            masterFuncList.add(data.getString("WC_NAME"));
+//        }
+        masterFuncList.add("无");
+        masterFuncList.add("五虎上将");
+        masterFuncList.add("2");
+        masterFuncList.add("3");
+        masterFuncList.add("4");
+        masterFuncList.add("5");
+        masterFuncList.add("6");
+        adapter = new ArrayAdapter(mActivity, R.layout.item_spinner, R.id.text_spinner, masterFuncList);
+        masterSpinner.setAdapter(adapter);
     }
 
     @Override
     protected void initEvents() {
-
+        masterSpinner.setOnItemSelectedListener(this);
         btnActionbarRight.setOnClickListener(this);
         etBarCode.addTextChangedListener(watcher);
         mCollectTypeRadioGroup.setOnCheckedChangeListener(this);
@@ -1289,6 +1314,18 @@ public class AGVIOCOutMakeMaterialOper extends BaseFragment implements View.OnCl
         }
     }
 
+    @Override
+    public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
+        //获得master的name
+        maFunName = masterFuncList.get(position);
+        LogUtil.i("maname",maFunName);
+    }
+
+    @Override
+    public void onNothingSelected(AdapterView<?> parent) {
+
+    }
+
     /**
      * popupWindow 设置适配器
      */

+ 20 - 7
app/src/main/java/com/uas/bgdq/fragment/BarcodeInfoCollectFragment.java

@@ -7,6 +7,7 @@ import android.text.TextUtils;
 import android.text.TextWatcher;
 import android.view.KeyEvent;
 import android.view.View;
+import android.view.inputmethod.EditorInfo;
 import android.widget.Button;
 import android.widget.CheckBox;
 import android.widget.CompoundButton;
@@ -126,13 +127,25 @@ public class BarcodeInfoCollectFragment extends BaseFragment {
             }
         });
         //仓位回车
-        CommonUtil.setEditorActionListener(mLocationEditText, new MyEditorActionListener() {
+//        CommonUtil.setEditorActionListener(mLocationEditText, new MyEditorActionListener() {
+//            @Override
+//            public void MyEditorAction(String text, int actionId, KeyEvent event) {
+//                LocationischeckData();
+//            }
+//        });
+        mLocationEditText.setOnEditorActionListener(new TextView.OnEditorActionListener() {
             @Override
-            public void MyEditorAction(String text, int actionId, KeyEvent event) {
-                LocationischeckData();
+            public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
+                if (actionId == EditorInfo.IME_ACTION_DONE
+                        || actionId == EditorInfo.IME_ACTION_SEND
+                        || (event != null && event.getAction() == KeyEvent.ACTION_DOWN && event.getKeyCode() == KeyEvent.KEYCODE_ENTER)) {
+                    String data = mLocationEditText.getText().toString().trim();
+                    LocationischeckData();
+                    return true;
+                }
+                return false;
             }
         });
-
         String ischecheds = SharedPreUtil.getString(mActivity, Constants.BARCODECHECKBOX, null);
         if (StringUtil.isEmpty(ischecheds)){
             checkbox_barcode.setChecked(true);
@@ -472,15 +485,15 @@ public class BarcodeInfoCollectFragment extends BaseFragment {
             mBarcodeEditText.requestFocus();
             return;
         }
-        if (checkbox_barcode.isChecked()==true&&material_in_collect_old_ettrim.isEmpty()){
+        if (checkbox_barcode.isChecked()&&material_in_collect_old_ettrim.isEmpty()){
             material_in_collect_old_et.requestFocus();
             return;
         }
-        if (cellect_check.isChecked()==true&&mLotEditTexttrim.isEmpty()){
+        if (cellect_check.isChecked()&&mLotEditTexttrim.isEmpty()){
             mLotEditText.requestFocus();
             return;
         }
-        if (datecode_check.isChecked()==true&&mDateEditTexttrim.isEmpty()){
+        if (datecode_check.isChecked()&&mDateEditTexttrim.isEmpty()){
             mDateEditText.requestFocus();
             return;
         }

+ 416 - 0
app/src/main/res/layout/fragment_agviocout_make_material_oper.xml

@@ -0,0 +1,416 @@
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:tools="http://schemas.android.com/tools"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:orientation="vertical"
+    tools:context="com.uas.bgdq.fragment.IOCOutMakeMaterialOper">
+    <!--    <include
+            android:id="@+id/include_menuactionbar"
+            layout="@layout/actionbar_withback" />-->
+
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="0dp"
+        android:layout_weight="1"
+        android:orientation="vertical">
+        <!--no use-->
+        <LinearLayout
+            android:layout_width="match_parent"
+            android:layout_height="60dp"
+            android:orientation="horizontal"
+            android:padding="10dp"
+            android:visibility="gone">
+
+            <RadioGroup
+                android:id="@+id/iocout_collect_rg"
+                android:layout_width="0dp"
+                android:layout_height="40dp"
+                android:layout_weight="2"
+                android:orientation="horizontal"
+                android:visibility="gone">
+
+                <RadioButton
+                    android:id="@+id/iocout_collect_barcode_rb"
+                    android:layout_width="0dp"
+                    android:layout_height="match_parent"
+                    android:layout_weight="1"
+                    android:background="@drawable/selector_collect_type_bg"
+                    android:button="@null"
+                    android:checked="true"
+                    android:clickable="true"
+                    android:gravity="center"
+                    android:text="条码号"
+                    android:textColor="@color/selector_collect_type_text"
+                    android:textSize="18sp" />
+
+                <RadioButton
+                    android:id="@+id/iocout_collect_box_rb"
+                    android:layout_width="0dp"
+                    android:layout_height="match_parent"
+                    android:layout_weight="1"
+                    android:background="@drawable/selector_collect_type_bg"
+                    android:button="@null"
+                    android:clickable="true"
+                    android:gravity="center"
+                    android:text="外箱号"
+                    android:textColor="@color/selector_collect_type_text"
+                    android:textSize="18sp" />
+            </RadioGroup>
+
+            <Spinner
+                android:id="@+id/iocout_material_type_sp"
+                android:layout_width="0dp"
+                android:layout_height="match_parent"
+                android:layout_marginRight="10dp"
+                android:layout_weight="2"
+                android:background="@drawable/bg_blue_spinner"
+                android:gravity="center">
+
+            </Spinner>
+
+            <Button
+                android:id="@+id/iocout_collect_model_btn"
+                style="@style/ButtonStyle"
+                android:layout_width="0dp"
+                android:layout_height="match_parent"
+                android:layout_margin="0dp"
+                android:layout_weight="1"
+                android:text="在线"
+                android:visibility="gone" />
+        </LinearLayout>
+
+
+        <ScrollView
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content">
+
+            <LinearLayout
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:orientation="vertical"
+                android:padding="@dimen/padding_normal">
+
+                <LinearLayout
+                    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:textColor="@color/body_text_1"
+                        android:layout_gravity="center"
+                        android:textSize="14sp" />
+
+                    <TextView
+                        android:id="@+id/tv_pi_inoutno"
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:layout_weight="1"
+                        android:textColor="@color/body_text_1"
+                        android:textSize="14sp"
+                        android:layout_gravity="center"
+                        tools:text="YS1506002" />
+                    <TextView
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:textColor="@color/body_text_1"
+                        android:layout_gravity="center"
+                        android:textSize="14sp"
+                        tools:text="轨道编号" />
+                    <Spinner
+                        android:id="@+id/sp_login"
+                        android:layout_marginLeft="@dimen/dp_10"
+                        android:layout_marginRight="@dimen/dp_10"
+                        style="@style/SpinnerStyle"
+                        android:layout_width="70dp"
+                        android:layout_height="30dp"
+                        android:layout_marginTop="0dp"
+                        android:padding="0dp"
+                        android:gravity="center"
+                        android:paddingLeft="0dp"
+                        android:layout_gravity="top"
+                        android:background="@drawable/bg_spinner" />
+                    <CheckBox
+                        android:id="@+id/special_check"
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:layout_gravity="center"
+                        android:gravity="center"
+                        android:text="特殊出库">
+                    </CheckBox>
+
+                    <TextView
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:text="仓库:"
+                        android:textColor="@color/body_text_1"
+                        android:textSize="14sp"
+                        android:visibility="gone" />
+
+                    <TextView
+                        android:id="@+id/tv_pd_whcode"
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:layout_weight="1"
+                        android:textColor="@color/body_text_1"
+                        android:textSize="14sp"
+                        android:visibility="gone"
+                        tools:text="01" />
+
+                </LinearLayout>
+
+                <TableLayout
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_marginTop="@dimen/spacing_big"
+                    android:stretchColumns="1">
+
+                    <TableRow>
+
+                        <TextView
+                            android:id="@+id/iocout_material_type_tv"
+                            style="@style/tl_tv_style"
+                            android:layout_height="match_parent"
+                            android:background="@color/gray_light"
+                            android:drawableLeft="@drawable/switch_model"
+                            android:drawablePadding="5dp"
+                            android:gravity="center_vertical"
+                            android:padding="10dp"
+                            android:text="条码"
+                            android:textColor="@color/body_text_1"
+                            android:textSize="16sp" />
+                        <!--<TextView-->
+                        <!--android:id="@+id/iocout_material_type_tv"-->
+                        <!--style="@style/tl_tv_style"-->
+                        <!--android:layout_height="match_parent"-->
+                        <!--android:background="@color/gray_light"-->
+                        <!--android:gravity="center_vertical"-->
+                        <!--android:padding="10dp"-->
+                        <!--android:text="条码"-->
+                        <!--android:textColor="@color/body_text_1"-->
+                        <!--android:textSize="16sp" />-->
+
+                        <com.uas.bgdq.view.ClearableEditText
+                            android:id="@+id/et_bar_code"
+                            style="@style/EditTextStyle"
+                            android:focusable="true"
+                            android:focusableInTouchMode="true"
+                            android:hint="@string/please_collect_barcode"
+                            android:textColor="@color/black" />
+                    </TableRow>
+
+                </TableLayout>
+                <!--no use-->
+                <Button
+                    android:id="@+id/btn_confirm"
+                    style="@style/ButtonStyle"
+                    android:enabled="false"
+                    android:text="@string/confirm"
+                    android:visibility="gone" />
+
+                <TableLayout
+                    android:id="@+id/iocout_collect_barcode_tl"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_marginBottom="5dp"
+                    android:layout_marginTop="@dimen/spacing_big"
+                    android:background="@drawable/bg_button_enabled"
+                    android:padding="10dp"
+                    android:stretchColumns="1"
+                    android:visibility="gone"
+                    tools:visibility="visible">
+
+                    <TableRow>
+
+                        <TextView
+                            android:id="@+id/tv_barcode_collection_success"
+                            style="@style/tl_tv_style"
+                            android:layout_gravity="center_vertical"
+                            android:layout_marginLeft="10dp"
+                            android:textColor="@color/white"
+                            android:visibility="gone"
+                            tools:visibility="visible"/>
+                    </TableRow>
+
+                    <TableRow>
+
+                        <TextView
+                            style="@style/tl_tv_style"
+                            android:layout_gravity="center_vertical"
+                            android:text="@string/text_barcode_tailback" />
+
+                        <TextView
+                            android:id="@+id/iocout_bar_code_tv"
+                            style="@style/tv"
+                            android:layout_marginLeft="3dp" />
+                    </TableRow>
+
+                    <TableRow>
+
+                        <TextView
+                            style="@style/tl_tv_style"
+                            android:layout_gravity="center_vertical"
+                            android:text="@string/bar_remain" />
+
+                        <TextView
+                            android:id="@+id/iocout_bar_remain_tv"
+                            style="@style/tv"
+                            android:layout_marginLeft="3dp" />
+                    </TableRow>
+
+                    <TableRow>
+
+                        <TextView
+                            style="@style/tl_tv_style"
+                            android:layout_gravity="center_vertical"
+                            android:text="@string/text_procode_tailback" />
+
+                        <TextView
+                            android:id="@+id/iocout_bar_prodcode_tv"
+                            style="@style/tv"
+                            android:layout_marginLeft="3dp" />
+                    </TableRow>
+                </TableLayout>
+
+                <TableLayout
+                    android:id="@+id/iocout_collect_box_tl"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_marginBottom="5dp"
+                    android:layout_marginTop="@dimen/spacing_big"
+                    android:background="@drawable/bg_button_enabled"
+                    android:padding="10dp"
+                    android:stretchColumns="1"
+                    android:visibility="gone"
+                    tools:visibility="visible">
+
+                    <TableRow>
+
+                        <TextView
+                            android:id="@+id/tv_box_collection_success"
+                            style="@style/tl_tv_style"
+                            android:layout_gravity="center_vertical"
+                            android:layout_marginLeft="10dp"
+                            android:textColor="@color/white"
+                            android:visibility="gone" />
+                    </TableRow>
+
+                    <TableRow>
+
+                        <TextView
+                            style="@style/tl_tv_style"
+                            android:layout_gravity="center_vertical"
+                            android:text="箱号:" />
+
+                        <TextView
+                            android:id="@+id/iocout_box_tv"
+                            style="@style/tv"
+                            android:layout_marginLeft="3dp" />
+                    </TableRow>
+
+                    <TableRow>
+
+                        <TextView
+                            style="@style/tl_tv_style"
+                            android:layout_gravity="center_vertical"
+                            android:text="箱内总数:" />
+
+                        <TextView
+                            android:id="@+id/iocout_box_num_tv"
+                            style="@style/tv"
+                            android:layout_marginLeft="3dp" />
+                    </TableRow>
+
+                    <TableRow>
+
+                        <TextView
+                            style="@style/tl_tv_style"
+                            android:layout_gravity="center_vertical"
+                            android:text="@string/text_procode_tailback" />
+
+                        <TextView
+                            android:id="@+id/iocout_box_prodcode_tv"
+                            style="@style/tv"
+                            android:layout_marginLeft="3dp" />
+                    </TableRow>
+
+                    <TableRow>
+
+                        <TextView
+                            style="@style/tl_tv_style"
+                            android:layout_gravity="center_vertical"
+                            android:text="仓库:" />
+
+                        <TextView
+                            android:id="@+id/iocout_box_whcode_tv"
+                            style="@style/tv"
+                            android:layout_marginLeft="3dp" />
+                    </TableRow>
+                </TableLayout>
+
+                <TextView
+                    android:id="@+id/iocout_collect_result"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_marginTop="@dimen/spacing_big"
+                    android:background="@drawable/shape_msg_block"
+                    android:padding="10dp"
+                    android:visibility="gone"
+                    tools:text="boxResultboxResultboxResultboxResult"
+                    tools:visibility="visible"/>
+
+                <TextView
+                    android:id="@+id/iocout_next_material_information"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_marginTop="@dimen/spacing_big"
+                    android:background="@drawable/shape_msg_block"
+                    android:padding="10dp"
+                    tools:text="物料:PD_PRODCODE, 名称规格:PR_DETAIL || PR_SPEC未备料数: PD_RESTQTY,最小包装数:PR_ZXBZS,仓位:BAR_LOCATION,有PD_BATCHCODE 则显示批号:PD_BATCHCODE" />
+
+                <TextView
+                    android:visibility="gone"
+                    android:id="@+id/text_finishno"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_marginTop="@dimen/spacing_big"
+                    android:background="@drawable/shape_msg_block"
+                    android:padding="10dp"
+                    tools:text="" />
+            </LinearLayout>
+
+        </ScrollView>
+    </LinearLayout>
+    <LinearLayout
+        android:orientation="horizontal"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content">
+        <Button
+            android:id="@+id/btn_startoutku"
+            style="@style/ButtonStyle"
+            android:layout_width="match_parent"
+            android:layout_margin="12dp"
+            android:layout_weight="1"
+            android:text="发起"
+            />
+        <Button
+            android:id="@+id/btn_deleteoutku"
+            style="@style/ButtonStyle"
+            android:layout_width="match_parent"
+            android:layout_margin="12dp"
+            android:layout_weight="1"
+            android:text="删除"
+            />
+        <Button
+            android:id="@+id/btn_guid"
+            style="@style/ButtonStyle"
+            android:layout_width="match_parent"
+            android:layout_margin="12dp"
+            android:layout_weight="1"
+            android:text="轨道动作"
+            android:background="@drawable/bgstop_button"
+            />
+    </LinearLayout>
+</LinearLayout>