|
|
@@ -1,5 +1,6 @@
|
|
|
package com.uas.hystorage.fragment;
|
|
|
|
|
|
+import android.annotation.SuppressLint;
|
|
|
import android.app.Activity;
|
|
|
import android.content.Context;
|
|
|
import android.content.Intent;
|
|
|
@@ -10,6 +11,7 @@ import android.support.v7.widget.LinearLayoutManager;
|
|
|
import android.support.v7.widget.RecyclerView;
|
|
|
import android.text.Editable;
|
|
|
import android.text.TextWatcher;
|
|
|
+import android.util.Log;
|
|
|
import android.view.KeyEvent;
|
|
|
import android.view.View;
|
|
|
import android.view.inputmethod.InputMethodManager;
|
|
|
@@ -20,6 +22,8 @@ import android.widget.Button;
|
|
|
import android.widget.EditText;
|
|
|
import android.widget.ImageView;
|
|
|
import android.widget.LinearLayout;
|
|
|
+import android.widget.RadioButton;
|
|
|
+import android.widget.RadioGroup;
|
|
|
import android.widget.Spinner;
|
|
|
import android.widget.TextView;
|
|
|
|
|
|
@@ -99,6 +103,15 @@ public class GdWorkSwitchFragment extends BaseFragment implements View.OnClickLi
|
|
|
private String mojucode;
|
|
|
private ImageView clean_iv;
|
|
|
private MyArrayAdapter autoStringAdapter;
|
|
|
+ private RadioGroup rg_btn;
|
|
|
+ private RadioButton alone_code;
|
|
|
+ private RadioButton all_code;
|
|
|
+ private String rb_changetext;
|
|
|
+ private String dlstr_macodes;
|
|
|
+ private TextView tv_muju;
|
|
|
+ private String listsize;
|
|
|
+ private String de_location;
|
|
|
+ private TextView tv_jitaihao;
|
|
|
|
|
|
@Override
|
|
|
protected int getLayout() {
|
|
|
@@ -121,6 +134,7 @@ public class GdWorkSwitchFragment extends BaseFragment implements View.OnClickLi
|
|
|
guigeTv = root.findViewById(R.id.guige_tv);
|
|
|
line_mju = root.findViewById(R.id.line_mju);
|
|
|
mOlIdTv = root.findViewById(R.id.ol_id_tv);
|
|
|
+ tv_jitaihao = root.findViewById(R.id.tv_jitaihao);
|
|
|
mOlNUmbersTv = root.findViewById(R.id.olun_numbers_tv);
|
|
|
mOlNameTv = root.findViewById(R.id.ol_name_tv);
|
|
|
mOlNumbersEt = root.findViewById(R.id.ol_numbers_et);
|
|
|
@@ -136,6 +150,15 @@ public class GdWorkSwitchFragment extends BaseFragment implements View.OnClickLi
|
|
|
root.findViewById(R.id.scan_code_im).setOnClickListener(this);
|
|
|
root.findViewById(R.id.ol_next_im).setOnClickListener(this);
|
|
|
tv_gangwei=root.findViewById(R.id.tv_gangwei);
|
|
|
+ tv_muju = root.findViewById(R.id.tv_muju);
|
|
|
+ rg_btn = root.findViewById(R.id.rg_btn);
|
|
|
+ alone_code = root.findViewById(R.id.alone_code);
|
|
|
+ all_code = root.findViewById(R.id.all_code);
|
|
|
+
|
|
|
+ alone_code.setChecked(true);
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
String name = SharedPreUtil.getString(mActivity, Constants.FLAG.CACHE_USER_EMNAME, null);
|
|
|
mOlNameTv.setText(name);
|
|
|
mSearch = root.findViewById(R.id.fl_search_actext);
|
|
|
@@ -160,6 +183,36 @@ public class GdWorkSwitchFragment extends BaseFragment implements View.OnClickLi
|
|
|
|
|
|
@Override
|
|
|
protected void initEvents() {
|
|
|
+ rg_btn.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
|
|
|
+ @SuppressLint("NonConstantResourceId")
|
|
|
+ @Override
|
|
|
+ public void onCheckedChanged(RadioGroup radioGroup, int checkid) {
|
|
|
+ switch (checkid){
|
|
|
+ case R.id.alone_code:
|
|
|
+ rb_changetext = mOlIdTv.getText().toString().trim();
|
|
|
+ Log.e("rb_changetext",rb_changetext);
|
|
|
+ if (listsize.equals("1")){
|
|
|
+ all_code.setVisibility(View.GONE);
|
|
|
+ ce_moju.setEnabled(true);
|
|
|
+ }else {
|
|
|
+ ce_moju.setEnabled(false);
|
|
|
+ mSearch.requestFocus();
|
|
|
+ mSearch.setSelection(mSearch.getText().length());
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case R.id.all_code:
|
|
|
+ rb_changetext = "ALL";
|
|
|
+ Log.e("rb_changetext",rb_changetext);
|
|
|
+ ce_moju.setEnabled(true);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
initUnitView();
|
|
|
mScanImageView.setOnClickListener(new View.OnClickListener() {
|
|
|
@@ -532,7 +585,7 @@ public class GdWorkSwitchFragment extends BaseFragment implements View.OnClickLi
|
|
|
.method(Request.Method.POST)
|
|
|
.tag(TAG + "changeMa")
|
|
|
.flag(0)
|
|
|
- .addParam("ma_code", mOlIdTv.getText().toString())
|
|
|
+ .addParam("ma_code", rb_changetext)
|
|
|
.addParam("sc_code", sc_code)
|
|
|
.addParam("next_macode", gongdanhaoTv.getText().toString())
|
|
|
.addParam("mouldcode",ce_moju.getText().toString().trim())
|
|
|
@@ -561,28 +614,54 @@ public class GdWorkSwitchFragment extends BaseFragment implements View.OnClickLi
|
|
|
@Override
|
|
|
protected void initDatas() {
|
|
|
ifneedmj = SharedPreUtil.getString(mActivity, Constants.FLAG.GANG_WEI_SOURCE_ifneedmj, null);
|
|
|
- if (!StringUtil.isEmpty(ifneedmj)){
|
|
|
- if (!ifneedmj.equals("0")){
|
|
|
- line_mju.setVisibility(View.VISIBLE);
|
|
|
- tv_mju.setTextColor(getResources().getColor(R.color.red));
|
|
|
- ce_moju.requestFocus();
|
|
|
- }else {
|
|
|
- line_mju.setVisibility(View.GONE);
|
|
|
- tv_mju.setTextColor(getResources().getColor(R.color.blue));
|
|
|
- mSearch.requestFocus();
|
|
|
- }
|
|
|
- }
|
|
|
|
|
|
|
|
|
Bundle bundle = getArguments();//从activity传过来的Bundle
|
|
|
if (bundle != null) {
|
|
|
sc_code = bundle.getString(Constants.FLAG.SC_CODE);
|
|
|
ma_code = bundle.getString(Constants.FLAG.MA_CODE);
|
|
|
+ dlstr_macodes = bundle.getString(Constants.FLAG.MOULDCODE);
|
|
|
+ de_location = bundle.getString("de_location");
|
|
|
+ listsize = bundle.getString(Constants.FLAG.MLIST);
|
|
|
mOlIdTv.setText(ma_code + "");
|
|
|
+ rb_changetext=ma_code+"";
|
|
|
+ Log.e("rb_changetext",rb_changetext+"----"+listsize);
|
|
|
tv_gangwei.setText(sc_code);
|
|
|
+ tv_muju.setText(dlstr_macodes);
|
|
|
+ tv_jitaihao.setText("机台号:"+de_location);
|
|
|
// getUnreportqty();
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ if (!StringUtil.isEmpty(ifneedmj)){
|
|
|
+ if (!ifneedmj.equals("0")){
|
|
|
+ if (StringUtil.isEmpty(dlstr_macodes)){
|
|
|
+ if (listsize.equals("1")){
|
|
|
+ all_code.setVisibility(View.GONE);
|
|
|
+ ce_moju.setEnabled(true);
|
|
|
+ }else {
|
|
|
+ ce_moju.setEnabled(false);
|
|
|
+ }
|
|
|
+ line_mju.setVisibility(View.VISIBLE);
|
|
|
+ tv_mju.setTextColor(getResources().getColor(R.color.red));
|
|
|
+ ce_moju.requestFocus();
|
|
|
+ }else {
|
|
|
+ line_mju.setVisibility(View.VISIBLE);
|
|
|
+ tv_mju.setTextColor(getResources().getColor(R.color.red));
|
|
|
+ ce_moju.setText(dlstr_macodes);
|
|
|
+ ce_moju.setEnabled(false);
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ }else {
|
|
|
+ line_mju.setVisibility(View.GONE);
|
|
|
+ tv_mju.setTextColor(getResources().getColor(R.color.blue));
|
|
|
+ mSearch.requestFocus();
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
|
|
|
private void initUnitView() {
|