|
@@ -5,7 +5,6 @@ import android.content.DialogInterface;
|
|
|
import android.content.Intent;
|
|
import android.content.Intent;
|
|
|
import android.graphics.drawable.BitmapDrawable;
|
|
import android.graphics.drawable.BitmapDrawable;
|
|
|
import android.os.Bundle;
|
|
import android.os.Bundle;
|
|
|
-import android.os.Handler;
|
|
|
|
|
import android.support.v4.app.Fragment;
|
|
import android.support.v4.app.Fragment;
|
|
|
import android.support.v4.app.FragmentManager;
|
|
import android.support.v4.app.FragmentManager;
|
|
|
import android.support.v7.app.AlertDialog;
|
|
import android.support.v7.app.AlertDialog;
|
|
@@ -313,7 +312,6 @@ public class MaterialInCollectFragment extends BaseFragment implements View.OnCl
|
|
|
mLocationEditText.setEnabled(false);
|
|
mLocationEditText.setEnabled(false);
|
|
|
mDcEditText.setEnabled(false);
|
|
mDcEditText.setEnabled(false);
|
|
|
mCalendarImageView.setClickable(false);
|
|
mCalendarImageView.setClickable(false);
|
|
|
-
|
|
|
|
|
if (!mContinuousCheckBox.isChecked()) {
|
|
if (!mContinuousCheckBox.isChecked()) {
|
|
|
mLotNoEditText.setText(null);
|
|
mLotNoEditText.setText(null);
|
|
|
mNumEditText.setText(null);
|
|
mNumEditText.setText(null);
|
|
@@ -330,6 +328,7 @@ public class MaterialInCollectFragment extends BaseFragment implements View.OnCl
|
|
|
mLocationEditText.setEnabled(true);
|
|
mLocationEditText.setEnabled(true);
|
|
|
mDcEditText.setEnabled(true);
|
|
mDcEditText.setEnabled(true);
|
|
|
mCalendarImageView.setClickable(true);
|
|
mCalendarImageView.setClickable(true);
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
@@ -348,7 +347,6 @@ public class MaterialInCollectFragment extends BaseFragment implements View.OnCl
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
- mBarcodeEditText.setOnFocusChangeListener(this);
|
|
|
|
|
|
|
|
|
|
mNumEditText.setOnEditorActionListener(new TextView.OnEditorActionListener() {
|
|
mNumEditText.setOnEditorActionListener(new TextView.OnEditorActionListener() {
|
|
|
@Override
|
|
@Override
|
|
@@ -367,6 +365,7 @@ public class MaterialInCollectFragment extends BaseFragment implements View.OnCl
|
|
|
@Override
|
|
@Override
|
|
|
public void run() {
|
|
public void run() {
|
|
|
mNumEditText.requestFocus();
|
|
mNumEditText.requestFocus();
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
}, 100);
|
|
}, 100);
|
|
|
|
|
|
|
@@ -388,7 +387,6 @@ public class MaterialInCollectFragment extends BaseFragment implements View.OnCl
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
- mNumEditText.setOnFocusChangeListener(this);
|
|
|
|
|
|
|
|
|
|
mLotNoEditText.setOnEditorActionListener(new TextView.OnEditorActionListener() {
|
|
mLotNoEditText.setOnEditorActionListener(new TextView.OnEditorActionListener() {
|
|
|
@Override
|
|
@Override
|
|
@@ -509,20 +507,21 @@ public class MaterialInCollectFragment extends BaseFragment implements View.OnCl
|
|
|
* 获取相应条码号或箱号的物料信息
|
|
* 获取相应条码号或箱号的物料信息
|
|
|
*/
|
|
*/
|
|
|
private void getCodeData() {
|
|
private void getCodeData() {
|
|
|
- mBarcodeEditText.setEnabled(false);
|
|
|
|
|
|
|
+
|
|
|
String barcode = mBarcodeEditText.getText().toString().trim();
|
|
String barcode = mBarcodeEditText.getText().toString().trim();
|
|
|
if (TextUtils.isEmpty(barcode)) {
|
|
if (TextUtils.isEmpty(barcode)) {
|
|
|
if (mCollectType.equals("barcode"))
|
|
if (mCollectType.equals("barcode"))
|
|
|
CommonUtil.toastNoRepeat(mActivity, getString(R.string.please_collect_code));
|
|
CommonUtil.toastNoRepeat(mActivity, getString(R.string.please_collect_code));
|
|
|
else if (mCollectType.equals("package"))
|
|
else if (mCollectType.equals("package"))
|
|
|
CommonUtil.toastNoRepeat(mActivity, getString(R.string.please_collect_box));
|
|
CommonUtil.toastNoRepeat(mActivity, getString(R.string.please_collect_box));
|
|
|
- new Handler().postDelayed(new Runnable() {
|
|
|
|
|
- @Override
|
|
|
|
|
- public void run() {
|
|
|
|
|
- mBarcodeEditText.setEnabled(true);
|
|
|
|
|
- mBarcodeEditText.requestFocus();
|
|
|
|
|
- }
|
|
|
|
|
- }, 100);
|
|
|
|
|
|
|
+// new Handler().postDelayed(new Runnable() {
|
|
|
|
|
+// @Override
|
|
|
|
|
+// public void run() {
|
|
|
|
|
+//
|
|
|
|
|
+// }
|
|
|
|
|
+// }, 100);
|
|
|
|
|
+ mBarcodeEditText.setEnabled(true);
|
|
|
|
|
+ mBarcodeEditText.requestFocus();
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
mIgnoreFocusChange = true;
|
|
mIgnoreFocusChange = true;
|
|
@@ -545,12 +544,19 @@ public class MaterialInCollectFragment extends BaseFragment implements View.OnCl
|
|
|
}
|
|
}
|
|
|
mResultTextView.setText(null);
|
|
mResultTextView.setText(null);
|
|
|
PdaApplication.mRequestQueue.cancelAll(TAG + "codedata");
|
|
PdaApplication.mRequestQueue.cancelAll(TAG + "codedata");
|
|
|
|
|
+ mNumEditText.requestFocus();
|
|
|
mStringRequest = new StringRequest(Request.Method.GET, url,
|
|
mStringRequest = new StringRequest(Request.Method.GET, url,
|
|
|
new Response.Listener<String>() {
|
|
new Response.Listener<String>() {
|
|
|
@Override
|
|
@Override
|
|
|
public void onResponse(String s) {
|
|
public void onResponse(String s) {
|
|
|
- mNumEditText.requestFocus();
|
|
|
|
|
- mNumEditText.setSelection(mNumEditText.getText().toString().length());
|
|
|
|
|
|
|
+ mBarcodeEditText.setEnabled(false);
|
|
|
|
|
+// new Handler().postDelayed(new Runnable() {
|
|
|
|
|
+// @Override
|
|
|
|
|
+// public void run() {
|
|
|
|
|
+//
|
|
|
|
|
+// }
|
|
|
|
|
+// }, 100);
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
new Response.ErrorListener() {
|
|
new Response.ErrorListener() {
|
|
@@ -585,14 +591,14 @@ public class MaterialInCollectFragment extends BaseFragment implements View.OnCl
|
|
|
CommonUtil.toastNoRepeat(mActivity, getString(R.string.please_collect_code));
|
|
CommonUtil.toastNoRepeat(mActivity, getString(R.string.please_collect_code));
|
|
|
else if (mCollectType.equals("package"))
|
|
else if (mCollectType.equals("package"))
|
|
|
CommonUtil.toastNoRepeat(mActivity, getString(R.string.please_collect_box));
|
|
CommonUtil.toastNoRepeat(mActivity, getString(R.string.please_collect_box));
|
|
|
- new Handler().postDelayed(new Runnable() {
|
|
|
|
|
- @Override
|
|
|
|
|
- public void run() {
|
|
|
|
|
- mNumEditText.setEnabled(true);
|
|
|
|
|
- mNumEditText.requestFocus();
|
|
|
|
|
- mNumEditText.setSelection(mNumEditText.getText().toString().length());
|
|
|
|
|
- }
|
|
|
|
|
- }, 100);
|
|
|
|
|
|
|
+// new Handler().postDelayed(new Runnable() {
|
|
|
|
|
+// @Override
|
|
|
|
|
+// public void run() {
|
|
|
|
|
+//
|
|
|
|
|
+// }
|
|
|
|
|
+// }, 100);
|
|
|
|
|
+ mNumEditText.requestFocus();
|
|
|
|
|
+ mNumEditText.setSelection(mNumEditText.getText().toString().length());
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
mIgnoreFocusChange = true;
|
|
mIgnoreFocusChange = true;
|
|
@@ -612,12 +618,12 @@ public class MaterialInCollectFragment extends BaseFragment implements View.OnCl
|
|
|
try {
|
|
try {
|
|
|
if ("barcode".equals(mCollectType)) {
|
|
if ("barcode".equals(mCollectType)) {
|
|
|
url = GloableParams.ADDRESS_INMATERIAL_GETCODEDATA + "?type=barcode&pi_id=" + mPiid
|
|
url = GloableParams.ADDRESS_INMATERIAL_GETCODEDATA + "?type=barcode&pi_id=" + mPiid
|
|
|
- + "&whcode=" + URLEncoder.encode(mWhcode, "utf-8")
|
|
|
|
|
|
|
+ + "&whcode=" + URLEncoder.encode(mNumEditText.getText().toString(), "utf-8")
|
|
|
+ "&code=" + URLEncoder.encode(mBarcodeEditText.getText().toString().trim(), "utf-8")
|
|
+ "&code=" + URLEncoder.encode(mBarcodeEditText.getText().toString().trim(), "utf-8")
|
|
|
+"&datas="+URLEncoder.encode(datasJson, "utf-8");
|
|
+"&datas="+URLEncoder.encode(datasJson, "utf-8");
|
|
|
} else if ("package".equals(mCollectType)) {
|
|
} else if ("package".equals(mCollectType)) {
|
|
|
url = GloableParams.ADDRESS_INMATERIAL_GETCODEDATA + "?type=package&pi_id=" + mPiid
|
|
url = GloableParams.ADDRESS_INMATERIAL_GETCODEDATA + "?type=package&pi_id=" + mPiid
|
|
|
- + "&whcode=" + URLEncoder.encode(mWhcode, "utf-8")
|
|
|
|
|
|
|
+ + "&whcode=" + URLEncoder.encode(mNumEditText.getText().toString(), "utf-8")
|
|
|
+ "&code=" + URLEncoder.encode(mBarcodeEditText.getText().toString().trim(), "utf-8")
|
|
+ "&code=" + URLEncoder.encode(mBarcodeEditText.getText().toString().trim(), "utf-8")
|
|
|
+"&datas="+URLEncoder.encode(datasJson, "utf-8");
|
|
+"&datas="+URLEncoder.encode(datasJson, "utf-8");
|
|
|
}
|
|
}
|
|
@@ -715,8 +721,6 @@ public class MaterialInCollectFragment extends BaseFragment implements View.OnCl
|
|
|
((FunctionActivity) getActivity()).setMoreBtnVisible(true);
|
|
((FunctionActivity) getActivity()).setMoreBtnVisible(true);
|
|
|
((FunctionActivity) getActivity()).setScanIvVisible(true);
|
|
((FunctionActivity) getActivity()).setScanIvVisible(true);
|
|
|
mScanImageView.setOnClickListener(this);
|
|
mScanImageView.setOnClickListener(this);
|
|
|
- mBarcodeEditText.setOnFocusChangeListener(this);
|
|
|
|
|
- mNumEditText.setOnFocusChangeListener(this);
|
|
|
|
|
} else {
|
|
} else {
|
|
|
((FunctionActivity) getActivity()).setMoreBtnVisible(false);
|
|
((FunctionActivity) getActivity()).setMoreBtnVisible(false);
|
|
|
((FunctionActivity) getActivity()).setScanIvVisible(false);
|
|
((FunctionActivity) getActivity()).setScanIvVisible(false);
|
|
@@ -794,8 +798,6 @@ public class MaterialInCollectFragment extends BaseFragment implements View.OnCl
|
|
|
@Override
|
|
@Override
|
|
|
public void onClick(View v) {
|
|
public void onClick(View v) {
|
|
|
closeMenuPopupWindow();
|
|
closeMenuPopupWindow();
|
|
|
- mBarcodeEditText.setOnFocusChangeListener(null);
|
|
|
|
|
- mNumEditText.setOnFocusChangeListener(null);
|
|
|
|
|
((FunctionActivity) getActivity()).setMoreBtnVisible(false);
|
|
((FunctionActivity) getActivity()).setMoreBtnVisible(false);
|
|
|
// ((FunctionActivity) getActivity()).setScanIvVisible(false);
|
|
// ((FunctionActivity) getActivity()).setScanIvVisible(false);
|
|
|
Bundle bundle = new Bundle();
|
|
Bundle bundle = new Bundle();
|
|
@@ -813,8 +815,6 @@ public class MaterialInCollectFragment extends BaseFragment implements View.OnCl
|
|
|
@Override
|
|
@Override
|
|
|
public void onClick(View v) {
|
|
public void onClick(View v) {
|
|
|
closeMenuPopupWindow();
|
|
closeMenuPopupWindow();
|
|
|
- mBarcodeEditText.setOnFocusChangeListener(null);
|
|
|
|
|
- mNumEditText.setOnFocusChangeListener(null);
|
|
|
|
|
((FunctionActivity) getActivity()).setMoreBtnVisible(false);
|
|
((FunctionActivity) getActivity()).setMoreBtnVisible(false);
|
|
|
((FunctionActivity) getActivity()).setScanIvVisible(false);
|
|
((FunctionActivity) getActivity()).setScanIvVisible(false);
|
|
|
mFragment = new MaterialInCollectItemSetFragment();
|
|
mFragment = new MaterialInCollectItemSetFragment();
|
|
@@ -982,12 +982,13 @@ public class MaterialInCollectFragment extends BaseFragment implements View.OnCl
|
|
|
progressDialog.dismiss();
|
|
progressDialog.dismiss();
|
|
|
mResultTextView.setVisibility(View.VISIBLE);
|
|
mResultTextView.setVisibility(View.VISIBLE);
|
|
|
mBarcodeEditText.setText(null);
|
|
mBarcodeEditText.setText(null);
|
|
|
- mBarcodeEditText.postDelayed(new Runnable() {
|
|
|
|
|
- @Override
|
|
|
|
|
- public void run() {
|
|
|
|
|
- mBarcodeEditText.requestFocus();
|
|
|
|
|
- }
|
|
|
|
|
- }, 100);
|
|
|
|
|
|
|
+// mBarcodeEditText.postDelayed(new Runnable() {
|
|
|
|
|
+// @Override
|
|
|
|
|
+// public void run() {
|
|
|
|
|
+//
|
|
|
|
|
+// }
|
|
|
|
|
+// }, 100);
|
|
|
|
|
+ mBarcodeEditText.requestFocus();
|
|
|
try {
|
|
try {
|
|
|
JSONObject resultObject = new JSONObject(s);
|
|
JSONObject resultObject = new JSONObject(s);
|
|
|
mResultTextView.setText(resultObject.optString("data"));
|
|
mResultTextView.setText(resultObject.optString("data"));
|