|
@@ -13,7 +13,6 @@ import android.text.Editable;
|
|
|
import android.text.TextUtils;
|
|
|
import android.text.TextWatcher;
|
|
|
import android.text.format.DateFormat;
|
|
|
-import android.util.Log;
|
|
|
import android.view.KeyEvent;
|
|
|
import android.view.View;
|
|
|
import android.view.inputmethod.EditorInfo;
|
|
@@ -231,7 +230,59 @@ public class MaterialInCollectFragment extends BaseFragment implements View.OnCl
|
|
|
mDcTableRow.setVisibility(View.GONE);
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+ private void setPageDisplays() {
|
|
|
+ mSetString = SharedPreUtil.getString(mActivity, Constants.FLAG.MATERIAL_IN_COLLECT_SET, null);
|
|
|
+ if (mSetString != null) {
|
|
|
+ try {
|
|
|
+ JSONObject setJsonObject = new JSONObject(mSetString);
|
|
|
+ mLotnoCheck = setJsonObject.optBoolean("lotno");
|
|
|
+ mDateCodeCheck = setJsonObject.optBoolean("datecode");
|
|
|
+ mNumCheck = setJsonObject.optBoolean("num");
|
|
|
+ mOldCheck = setJsonObject.optBoolean("old");
|
|
|
+ mLocationCheck = setJsonObject.optBoolean("location");
|
|
|
+ mDcCheck = setJsonObject.optBoolean("dc");
|
|
|
+ } catch (JSONException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ mLotnoCheck = true;
|
|
|
+ mDateCodeCheck = true;
|
|
|
+ mNumCheck = true;
|
|
|
+ mOldCheck = false;
|
|
|
+ mLocationCheck = true;
|
|
|
+ mDcCheck = true;
|
|
|
+ }
|
|
|
+ if (mLotnoCheck) {
|
|
|
+ mLotNoTableRow.setVisibility(View.VISIBLE);
|
|
|
+ } else {
|
|
|
+ mLotNoTableRow.setVisibility(View.GONE);
|
|
|
+ }
|
|
|
+ if (mDateCodeCheck) {
|
|
|
+ mDateCodeTableRow.setVisibility(View.VISIBLE);
|
|
|
+ } else {
|
|
|
+ mDateCodeTableRow.setVisibility(View.GONE);
|
|
|
+ }
|
|
|
+ if (mNumCheck) {
|
|
|
+ mNumTableRow.setVisibility(View.VISIBLE);
|
|
|
+ } else {
|
|
|
+ mNumTableRow.setVisibility(View.GONE);
|
|
|
+ }
|
|
|
+ if (mOldCheck) {
|
|
|
+ mOldTableRow.setVisibility(View.VISIBLE);
|
|
|
+ } else {
|
|
|
+ mOldTableRow.setVisibility(View.GONE);
|
|
|
+ }
|
|
|
+ if (mLocationCheck) {
|
|
|
+ mLocationTableRow.setVisibility(View.VISIBLE);
|
|
|
+ } else {
|
|
|
+ mLocationTableRow.setVisibility(View.GONE);
|
|
|
+ }
|
|
|
+ if (mDcCheck) {
|
|
|
+ mDcTableRow.setVisibility(View.VISIBLE);
|
|
|
+ } else {
|
|
|
+ mDcTableRow.setVisibility(View.GONE);
|
|
|
+ }
|
|
|
+ }
|
|
|
@Override
|
|
|
protected void initEvents() {
|
|
|
mMoreMenuButton.setOnClickListener(this);
|
|
@@ -450,7 +501,6 @@ public class MaterialInCollectFragment extends BaseFragment implements View.OnCl
|
|
|
* 获取相应条码号或箱号的物料信息
|
|
|
*/
|
|
|
private void getCodeData() {
|
|
|
- Log.e("xxxxxx","进入方法");
|
|
|
mBarcodeEditText.setEnabled(false);
|
|
|
String barcode = mBarcodeEditText.getText().toString().trim();
|
|
|
if (TextUtils.isEmpty(barcode)) {
|
|
@@ -485,32 +535,26 @@ public class MaterialInCollectFragment extends BaseFragment implements View.OnCl
|
|
|
url = GloableParams.ADDRESS_INMATERIAL_GETCODEDATA + "?type=barcode&pi_id=" + mPiid
|
|
|
+ "&whcode=" + URLEncoder.encode(mWhcode, "utf-8")
|
|
|
+ "&code=" + URLEncoder.encode(mBarcodeEditText.getText().toString().trim(), "utf-8");
|
|
|
- Log.e("xxxxxx","进入拼接1");
|
|
|
if ("barcode".equals(mCollectType)) {
|
|
|
url = GloableParams.ADDRESS_INMATERIAL_GETCODEDATA + "?type=barcode&pi_id=" + mPiid
|
|
|
+ "&whcode=" + URLEncoder.encode(mWhcode, "utf-8")
|
|
|
+ "&code=" + URLEncoder.encode(mBarcodeEditText.getText().toString().trim(), "utf-8")
|
|
|
+"&datas="+URLEncoder.encode(datasJson, "utf-8");
|
|
|
- Log.e("xxxxxx","进入拼接2");
|
|
|
} else if ("package".equals(mCollectType)) {
|
|
|
url = GloableParams.ADDRESS_INMATERIAL_GETCODEDATA + "?type=package&pi_id=" + mPiid
|
|
|
+ "&whcode=" + URLEncoder.encode(mWhcode, "utf-8")
|
|
|
+ "&code=" + URLEncoder.encode(mBarcodeEditText.getText().toString().trim(), "utf-8")
|
|
|
+"&datas="+URLEncoder.encode(datasJson, "utf-8");
|
|
|
- Log.e("xxxxxx","进入拼接3");
|
|
|
}
|
|
|
} catch (UnsupportedEncodingException e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
mResultTextView.setText(null);
|
|
|
- Log.e("xxxxxx","展厅1");
|
|
|
PdaApplication.mRequestQueue.cancelAll(TAG + "codedata");
|
|
|
- Log.e("xxxxxx","展厅2");
|
|
|
mStringRequest = new StringRequest(Request.Method.GET, url,
|
|
|
new Response.Listener<String>() {
|
|
|
@Override
|
|
|
public void onResponse(String s) {
|
|
|
- Log.d("materialin", s);
|
|
|
mBarcodeEditText.setEnabled(true);
|
|
|
mResultTextView.setVisibility(View.GONE);
|
|
|
try {
|
|
@@ -541,49 +585,25 @@ public class MaterialInCollectFragment extends BaseFragment implements View.OnCl
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- mBarcodeEditText.requestFocus();
|
|
|
- mBarcodeEditText.setSelection(mBarcodeEditText.getText().toString().length());
|
|
|
-// if (isAllEdit()) {
|
|
|
-// confirmEvent();
|
|
|
-// } else {
|
|
|
-// if (mNumCheck) {
|
|
|
-// mNumEditText.requestFocus();
|
|
|
-// if(!TextUtils.isEmpty(mNumEditText.getText().toString())){
|
|
|
-// mNumEditText.setSelection(mNumEditText.getText().toString().length());
|
|
|
-// }
|
|
|
-//
|
|
|
-// } else if (mLotnoCheck) {
|
|
|
-// mLotNoEditText.requestFocus();
|
|
|
-// if(!TextUtils.isEmpty(mLotNoEditText.getText().toString())){
|
|
|
-// mLotNoEditText.setSelection(mLotNoEditText.getText().toString().length());
|
|
|
-// }
|
|
|
-// } else if (mDateCodeCheck) {
|
|
|
-// mDateCodeEditText.requestFocus();
|
|
|
-// if(!TextUtils.isEmpty(mDateCodeEditText.getText().toString())){
|
|
|
-// mDateCodeEditText.setSelection(mDateCodeEditText.getText().toString().length());
|
|
|
-// }
|
|
|
-// } else if (mOldCheck) {
|
|
|
-// mOldEditText.requestFocus();
|
|
|
-// if(!TextUtils.isEmpty(mOldEditText.getText().toString())){
|
|
|
-// mOldEditText.setSelection(mOldEditText.getText().toString().length());
|
|
|
-// }
|
|
|
-// } else if (mLocationCheck) {
|
|
|
-// mLocationEditText.requestFocus();
|
|
|
-// if(!TextUtils.isEmpty(mLocationEditText.getText().toString())){
|
|
|
-// mLocationEditText.setSelection(mLocationEditText.getText().toString().length());
|
|
|
-// }
|
|
|
-// } else if (mDcCheck) {
|
|
|
-// mDcEditText.requestFocus();
|
|
|
-// if(!TextUtils.isEmpty(mDcEditText.getText().toString())){
|
|
|
-// mDcEditText.setSelection(mDcEditText.getText().toString().length());
|
|
|
-// }
|
|
|
-// }
|
|
|
-// }
|
|
|
+// mBarcodeEditText.requestFocus();
|
|
|
+// mBarcodeEditText.setSelection(mBarcodeEditText.getText().toString().length());
|
|
|
+ if (mLotnoCheck){
|
|
|
+ mLotNoEditText.requestFocus();
|
|
|
+ }else if (mDateCodeCheck) {
|
|
|
+ mDateCodeEditText.requestFocus();
|
|
|
+ mDateCodeEditText.setSelection(mDateCodeEditText.getText().toString().trim().length());
|
|
|
+ } else if (mLocationCheck) {
|
|
|
+ mLocationEditText.requestFocus();
|
|
|
+ mLocationEditText.setSelection(mLocationEditText.getText().toString().trim().length());
|
|
|
+ } else if (mDcCheck) {
|
|
|
+ mDcEditText.requestFocus();
|
|
|
+ mDcEditText.setSelection(mDcEditText.getText().toString().trim().length());
|
|
|
+ }
|
|
|
+
|
|
|
} catch (JSONException e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
mIgnoreFocusChange = false;
|
|
|
- Log.e("xxxxxx","请求成功");
|
|
|
}
|
|
|
},
|
|
|
new Response.ErrorListener() {
|
|
@@ -596,7 +616,6 @@ public class MaterialInCollectFragment extends BaseFragment implements View.OnCl
|
|
|
mBarcodeEditText.setText(null);
|
|
|
mBarcodeEditText.requestFocus();
|
|
|
mIgnoreFocusChange = false;
|
|
|
- Log.e("xxxxxx","请求失败");
|
|
|
}
|
|
|
}) {
|
|
|
@Override
|