|
|
@@ -72,8 +72,8 @@ public class JLTStorageInBarcodeFragment extends BaseFragment implements View.On
|
|
|
private PopupWindow mMenuPopupWindow;
|
|
|
private View mMenuView;
|
|
|
private TextView mBoxTextView, mPanEditText;
|
|
|
- private ImageView mCalendarImageView, mScanImageView, mEnclosureFitlerIv, mModelScanIv;
|
|
|
- private ClearableEditText mDateEditText, mBarcodeEditText, mModelEditText, mQuantityEditText,
|
|
|
+ private ImageView mCalendarImageView, mEnclosureFitlerIv, mModelScanIv;
|
|
|
+ private ClearableEditText mDateEditText, mModelEditText, mQuantityEditText,
|
|
|
mLotEditText, mPoEditText, mEnclosureEditText, mMpqEditText, mBrandEditText;
|
|
|
private CheckBox mPoCheckBox;
|
|
|
private String mBoxNum, mPiInoutno, mPiid, mPiClass, mRealBoxNum, mDatecodebyparse;
|
|
|
@@ -109,8 +109,8 @@ public class JLTStorageInBarcodeFragment extends BaseFragment implements View.On
|
|
|
mModelScanIv = root.findViewById(R.id.jlt_storage_in_barcode_model_scan_iv);
|
|
|
mDateEditText = root.findViewById(R.id.jlt_storage_in_barcode_date_et);
|
|
|
mBoxTextView = root.findViewById(R.id.jlt_storage_in_barcode_box_tv);
|
|
|
- mScanImageView = root.findViewById(R.id.jlt_storage_in_barcode_scan_iv);
|
|
|
- mBarcodeEditText = root.findViewById(R.id.jlt_storage_in_barcode_barcode_et);
|
|
|
+// mScanImageView = root.findViewById(R.id.jlt_storage_in_barcode_scan_iv);
|
|
|
+// mBarcodeEditText = root.findViewById(R.id.jlt_storage_in_barcode_barcode_et);
|
|
|
mModelEditText = root.findViewById(R.id.jlt_storage_in_barcode_model_et);
|
|
|
mQuantityEditText = root.findViewById(R.id.jlt_storage_in_barcode_quantity_et);
|
|
|
mMpqEditText = root.findViewById(R.id.jlt_storage_in_barcode_mpq_et);
|
|
|
@@ -121,7 +121,8 @@ public class JLTStorageInBarcodeFragment extends BaseFragment implements View.On
|
|
|
mSaveButton = root.findViewById(R.id.jlt_storage_in_barcode_save_btn);
|
|
|
mNextButton = root.findViewById(R.id.jlt_storage_in_barcode_next_btn);
|
|
|
mPoCheckBox = root.findViewById(R.id.jlt_storage_in_barcode_po_cb);
|
|
|
- mBarcodeEditText.requestFocus();
|
|
|
+ mModelEditText.requestFocus();
|
|
|
+// mBarcodeEditText.requestFocus();
|
|
|
mEnclosureEditText = root.findViewById(R.id.jlt_storage_in_barcode_enclosure_et);
|
|
|
mEnclosureFitlerIv = root.findViewById(R.id.jlt_storage_in_barcode_enclosure_filter_iv);
|
|
|
|
|
|
@@ -146,7 +147,7 @@ public class JLTStorageInBarcodeFragment extends BaseFragment implements View.On
|
|
|
protected void initEvents() {
|
|
|
mMoreButton.setOnClickListener(this);
|
|
|
mCalendarImageView.setOnClickListener(this);
|
|
|
- mScanImageView.setOnClickListener(this);
|
|
|
+// mScanImageView.setOnClickListener(this);
|
|
|
mModelScanIv.setOnClickListener(this);
|
|
|
mSaveButton.setOnClickListener(this);
|
|
|
mNextButton.setOnClickListener(this);
|
|
|
@@ -163,22 +164,17 @@ public class JLTStorageInBarcodeFragment extends BaseFragment implements View.On
|
|
|
mBrandEditText.addTextChangedListener(new MyTextWatcher(mBrandEditText));
|
|
|
mEnclosureEditText.addTextChangedListener(new MyTextWatcher(mEnclosureEditText));
|
|
|
|
|
|
- CommonUtil.setEditorActionListener(mBarcodeEditText, new MyEditorActionListener() {
|
|
|
- @Override
|
|
|
- public void MyEditorAction(String text, int actionId, KeyEvent event) {
|
|
|
- barcodeParse();
|
|
|
- }
|
|
|
- });
|
|
|
+// CommonUtil.setEditorActionListener(mBarcodeEditText, new MyEditorActionListener() {
|
|
|
+// @Override
|
|
|
+// public void MyEditorAction(String text, int actionId, KeyEvent event) {
|
|
|
+// barcodeParse();
|
|
|
+// }
|
|
|
+// });
|
|
|
|
|
|
CommonUtil.setEditorActionListener(mModelEditText, new MyEditorActionListener() {
|
|
|
@Override
|
|
|
public void MyEditorAction(String text, int actionId, KeyEvent event) {
|
|
|
- mQuantityEditText.postDelayed(new Runnable() {
|
|
|
- @Override
|
|
|
- public void run() {
|
|
|
- mQuantityEditText.requestFocus();
|
|
|
- }
|
|
|
- }, 100);
|
|
|
+ barcodeParse();
|
|
|
}
|
|
|
});
|
|
|
|
|
|
@@ -283,11 +279,11 @@ public class JLTStorageInBarcodeFragment extends BaseFragment implements View.On
|
|
|
private void barcodeParse() {
|
|
|
mEnclosureList.clear();
|
|
|
mEnclosureEditText.setText("");
|
|
|
- String barcode = mBarcodeEditText.getText().toString().trim();
|
|
|
- if (TextUtils.isEmpty(barcode)) {
|
|
|
+ String model = mModelEditText.getText().toString().trim();
|
|
|
+ if (TextUtils.isEmpty(model)) {
|
|
|
return;
|
|
|
}
|
|
|
- mBarcodeParseBean.setDATA(barcode);
|
|
|
+ mBarcodeParseBean.setDATA(model);
|
|
|
|
|
|
progressDialog.show();
|
|
|
|
|
|
@@ -295,15 +291,14 @@ public class JLTStorageInBarcodeFragment extends BaseFragment implements View.On
|
|
|
.url(GloableParams.ADDRESS_JLT_RECEIVING_BARCODEPARSE)
|
|
|
.method(Request.Method.POST)
|
|
|
.tag(TAG + "barcodeparse")
|
|
|
- .addParam("data", barcode)
|
|
|
+ .addParam("data", model)
|
|
|
.addParam("pi_ids", mPiid)
|
|
|
.build(), new HttpCallback() {
|
|
|
@Override
|
|
|
public void onSuccess(int flag, Object o) throws Exception {
|
|
|
progressDialog.dismiss();
|
|
|
try {
|
|
|
- mBarcodeEditText.setText("");
|
|
|
- mBarcodeEditText.requestFocus();
|
|
|
+ mQuantityEditText.requestFocus();
|
|
|
String result = o.toString();
|
|
|
JSONObject resultObject = JSON.parseObject(result);
|
|
|
JSONObject dataObject = resultObject.getJSONObject("data");
|
|
|
@@ -414,8 +409,8 @@ public class JLTStorageInBarcodeFragment extends BaseFragment implements View.On
|
|
|
public void onFail(int flag, String failStr) throws Exception {
|
|
|
progressDialog.dismiss();
|
|
|
|
|
|
- mBarcodeEditText.setText("");
|
|
|
- mBarcodeEditText.requestFocus();
|
|
|
+ mModelEditText.setText("");
|
|
|
+ mModelEditText.requestFocus();
|
|
|
mSearchEnclosureAdapter.notifyDataSetChanged();
|
|
|
CommonUtil.toastNoRepeat(mActivity, failStr);
|
|
|
}
|
|
|
@@ -539,9 +534,9 @@ public class JLTStorageInBarcodeFragment extends BaseFragment implements View.On
|
|
|
dialog.setTargetFragment(JLTStorageInBarcodeFragment.this, REQUEST_DATE);
|
|
|
dialog.show(fragmentManager, DIALOG_DATE);
|
|
|
break;
|
|
|
- case R.id.jlt_storage_in_barcode_scan_iv:
|
|
|
- CommonUtil.scanBarcode(mActivity, JLTStorageInBarcodeFragment.this, SCAN_BARCODE_CODE);
|
|
|
- break;
|
|
|
+// case R.id.jlt_storage_in_barcode_scan_iv:
|
|
|
+// CommonUtil.scanBarcode(mActivity, JLTStorageInBarcodeFragment.this, SCAN_BARCODE_CODE);
|
|
|
+// break;
|
|
|
case R.id.jlt_storage_in_barcode_model_scan_iv:
|
|
|
CommonUtil.scanBarcode(mActivity, JLTStorageInBarcodeFragment.this, SCAN_MODEL_CODE);
|
|
|
break;
|
|
|
@@ -566,7 +561,7 @@ public class JLTStorageInBarcodeFragment extends BaseFragment implements View.On
|
|
|
|
|
|
private void saveBarcode(boolean exist, boolean checkDate) {
|
|
|
if (TextUtils.isEmpty(mBarcodeParseBean.getPN()) ||
|
|
|
-// TextUtils.isEmpty(mBarcodeParseBean.getBRAND()) ||
|
|
|
+ TextUtils.isEmpty(mBarcodeParseBean.getBRAND()) ||
|
|
|
TextUtils.isEmpty(mBarcodeParseBean.getMPQ())) {
|
|
|
CommonUtil.toastNoRepeat(mActivity, "请采集条码获取必填数据");
|
|
|
return;
|
|
|
@@ -706,7 +701,6 @@ public class JLTStorageInBarcodeFragment extends BaseFragment implements View.On
|
|
|
}
|
|
|
|
|
|
private void resetState() {
|
|
|
- mBarcodeEditText.setText("");
|
|
|
mModelEditText.setText("");
|
|
|
mQuantityEditText.setText("");
|
|
|
mMpqEditText.setText("");
|
|
|
@@ -717,7 +711,7 @@ public class JLTStorageInBarcodeFragment extends BaseFragment implements View.On
|
|
|
mBrandEditText.setText("");
|
|
|
mEnclosureEditText.setText("");
|
|
|
|
|
|
- mBarcodeEditText.requestFocus();
|
|
|
+ mModelEditText.requestFocus();
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -737,18 +731,19 @@ public class JLTStorageInBarcodeFragment extends BaseFragment implements View.On
|
|
|
mDateEditText.setText("");
|
|
|
}
|
|
|
}
|
|
|
- if (requestCode == SCAN_BARCODE_CODE && data != null) {
|
|
|
+ /*if (requestCode == SCAN_BARCODE_CODE && data != null) {
|
|
|
if (data.getExtras() != null) {
|
|
|
String result = data.getExtras().getString(CodeUtils.RESULT_STRING);
|
|
|
mBarcodeEditText.setText(result);
|
|
|
mBarcodeEditText.setSelection(result.length());
|
|
|
}
|
|
|
- }
|
|
|
+ }*/
|
|
|
if (requestCode == SCAN_MODEL_CODE && data != null) {
|
|
|
if (data.getExtras() != null) {
|
|
|
String result = data.getExtras().getString(CodeUtils.RESULT_STRING);
|
|
|
mModelEditText.setText(result);
|
|
|
mModelEditText.setSelection(result.length());
|
|
|
+ barcodeParse();
|
|
|
}
|
|
|
}
|
|
|
}
|