|
@@ -87,7 +87,8 @@ import java.util.Map;
|
|
|
public class JLTStorageInBarcodeFragment extends BaseFragment implements View.OnClickListener {
|
|
public class JLTStorageInBarcodeFragment extends BaseFragment implements View.OnClickListener {
|
|
|
private String DIALOG_DATE = "DialogDate";
|
|
private String DIALOG_DATE = "DialogDate";
|
|
|
private static final int REQUEST_DATE = 11;
|
|
private static final int REQUEST_DATE = 11;
|
|
|
- private static final int SCAN_BARCODE_CODE = 101;
|
|
|
|
|
|
|
+ private static final int SCAN_BARCODE_CODE = 101; //条码框
|
|
|
|
|
+ private static final int SCAN_STORAGE_CODE = 103; //仓位框
|
|
|
private static final int SCAN_MODEL_CODE = 102;
|
|
private static final int SCAN_MODEL_CODE = 102;
|
|
|
private Button mMoreButton, mSaveButton, mNextButton;
|
|
private Button mMoreButton, mSaveButton, mNextButton;
|
|
|
private PopupWindow mMenuPopupWindow;
|
|
private PopupWindow mMenuPopupWindow;
|
|
@@ -137,6 +138,8 @@ public class JLTStorageInBarcodeFragment extends BaseFragment implements View.On
|
|
|
private Spinner sp_origin; //产地
|
|
private Spinner sp_origin; //产地
|
|
|
private List<String> originList;
|
|
private List<String> originList;
|
|
|
private String cco;
|
|
private String cco;
|
|
|
|
|
+ private CheckBox cb_auto_save;
|
|
|
|
|
+ private ImageView iv_storage_scanning_code;
|
|
|
|
|
|
|
|
public void setOnFinishListener(OnFinishListener onFinishListener) {
|
|
public void setOnFinishListener(OnFinishListener onFinishListener) {
|
|
|
mOnFinishListener = onFinishListener;
|
|
mOnFinishListener = onFinishListener;
|
|
@@ -171,8 +174,7 @@ public class JLTStorageInBarcodeFragment extends BaseFragment implements View.On
|
|
|
mNextButton = root.findViewById(R.id.jlt_storage_in_barcode_next_btn);
|
|
mNextButton = root.findViewById(R.id.jlt_storage_in_barcode_next_btn);
|
|
|
mPoCheckBox = root.findViewById(R.id.jlt_storage_in_barcode_po_cb);
|
|
mPoCheckBox = root.findViewById(R.id.jlt_storage_in_barcode_po_cb);
|
|
|
mResultTextView = root.findViewById(R.id.material_in_collect_result_tv);
|
|
mResultTextView = root.findViewById(R.id.material_in_collect_result_tv);
|
|
|
- // mModelEditText.requestFocus();
|
|
|
|
|
- mBarcodeEditText.requestFocus();
|
|
|
|
|
|
|
+
|
|
|
mEnclosureEditText = root.findViewById(R.id.jlt_storage_in_barcode_enclosure_et);
|
|
mEnclosureEditText = root.findViewById(R.id.jlt_storage_in_barcode_enclosure_et);
|
|
|
mEnclosureFitlerIv = root.findViewById(R.id.jlt_storage_in_barcode_enclosure_filter_iv);
|
|
mEnclosureFitlerIv = root.findViewById(R.id.jlt_storage_in_barcode_enclosure_filter_iv);
|
|
|
|
|
|
|
@@ -185,6 +187,7 @@ public class JLTStorageInBarcodeFragment extends BaseFragment implements View.On
|
|
|
mInfoRadioButton = root.findViewById(R.id.jlt_pick_material_out_scan_info_rb);
|
|
mInfoRadioButton = root.findViewById(R.id.jlt_pick_material_out_scan_info_rb);
|
|
|
mSignRadioButton = root.findViewById(R.id.jlt_pick_material_out_scan_sign_rb);
|
|
mSignRadioButton = root.findViewById(R.id.jlt_pick_material_out_scan_sign_rb);
|
|
|
jlt_line_edit = root.findViewById(R.id.jlt_line_edit);
|
|
jlt_line_edit = root.findViewById(R.id.jlt_line_edit);
|
|
|
|
|
+ cb_auto_save = root.findViewById(R.id.cb_auto_save);
|
|
|
|
|
|
|
|
//输入框
|
|
//输入框
|
|
|
//LotNo
|
|
//LotNo
|
|
@@ -233,11 +236,15 @@ public class JLTStorageInBarcodeFragment extends BaseFragment implements View.On
|
|
|
|
|
|
|
|
mTypeTextView = root.findViewById(R.id.jlt_storage_in_todo_list_tv);
|
|
mTypeTextView = root.findViewById(R.id.jlt_storage_in_todo_list_tv);
|
|
|
mRecyclerView = root.findViewById(R.id.jlt_storage_in_todo_list_rv);
|
|
mRecyclerView = root.findViewById(R.id.jlt_storage_in_todo_list_rv);
|
|
|
|
|
+ iv_storage_scanning_code = root.findViewById(R.id.iv_storage_scanning_code);
|
|
|
|
|
+
|
|
|
mRecyclerView.setLayoutManager(new LinearLayoutManager(mActivity));
|
|
mRecyclerView.setLayoutManager(new LinearLayoutManager(mActivity));
|
|
|
mRecyclerView.addItemDecoration(new RecyclerItemDecoration(2));
|
|
mRecyclerView.addItemDecoration(new RecyclerItemDecoration(2));
|
|
|
mStorageInTodoAdapter = new NewJLTStorageInTodoAdapter(mActivity);
|
|
mStorageInTodoAdapter = new NewJLTStorageInTodoAdapter(mActivity);
|
|
|
- mFocusId = root.findFocus().getId();
|
|
|
|
|
|
|
+
|
|
|
CheckBoxData();
|
|
CheckBoxData();
|
|
|
|
|
+
|
|
|
|
|
+ mLotEditText.requestFocus();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -250,6 +257,7 @@ public class JLTStorageInBarcodeFragment extends BaseFragment implements View.On
|
|
|
mNextButton.setOnClickListener(this);
|
|
mNextButton.setOnClickListener(this);
|
|
|
mEnclosureEditText.setOnClickListener(this);
|
|
mEnclosureEditText.setOnClickListener(this);
|
|
|
mEnclosureFitlerIv.setOnClickListener(this);
|
|
mEnclosureFitlerIv.setOnClickListener(this);
|
|
|
|
|
+ iv_storage_scanning_code.setOnClickListener(this);
|
|
|
|
|
|
|
|
mModelEditText.addTextChangedListener(new MyTextWatcher(mModelEditText));
|
|
mModelEditText.addTextChangedListener(new MyTextWatcher(mModelEditText));
|
|
|
mQuantityEditText.addTextChangedListener(new MyTextWatcher(mQuantityEditText));
|
|
mQuantityEditText.addTextChangedListener(new MyTextWatcher(mQuantityEditText));
|
|
@@ -495,7 +503,6 @@ public class JLTStorageInBarcodeFragment extends BaseFragment implements View.On
|
|
|
mBarcodeParseBean.setOUTBOX(mBoxNum);
|
|
mBarcodeParseBean.setOUTBOX(mBoxNum);
|
|
|
|
|
|
|
|
mTypeTextView.setText(mPiClass);
|
|
mTypeTextView.setText(mPiClass);
|
|
|
-
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@@ -804,6 +811,9 @@ public class JLTStorageInBarcodeFragment extends BaseFragment implements View.On
|
|
|
case R.id.jlt_storage_in_barcode_scan_iv:
|
|
case R.id.jlt_storage_in_barcode_scan_iv:
|
|
|
CommonUtil.scanBarcode(mActivity, JLTStorageInBarcodeFragment.this, SCAN_BARCODE_CODE);
|
|
CommonUtil.scanBarcode(mActivity, JLTStorageInBarcodeFragment.this, SCAN_BARCODE_CODE);
|
|
|
break;
|
|
break;
|
|
|
|
|
+ case R.id.iv_storage_scanning_code:
|
|
|
|
|
+ CommonUtil.scanBarcode(mActivity, JLTStorageInBarcodeFragment.this, SCAN_STORAGE_CODE);
|
|
|
|
|
+ break;
|
|
|
case R.id.jlt_storage_in_barcode_model_scan_iv:
|
|
case R.id.jlt_storage_in_barcode_model_scan_iv:
|
|
|
CommonUtil.scanBarcode(mActivity, JLTStorageInBarcodeFragment.this, SCAN_MODEL_CODE);
|
|
CommonUtil.scanBarcode(mActivity, JLTStorageInBarcodeFragment.this, SCAN_MODEL_CODE);
|
|
|
break;
|
|
break;
|
|
@@ -878,7 +888,9 @@ public class JLTStorageInBarcodeFragment extends BaseFragment implements View.On
|
|
|
jlt_edit_dc.requestFocus();
|
|
jlt_edit_dc.requestFocus();
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
- clearableedittextjudge();
|
|
|
|
|
|
|
+ if (cb_auto_save.isChecked()) { //自动保存
|
|
|
|
|
+ clearableedittextjudge();
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public void newlinemLotEnter() {
|
|
public void newlinemLotEnter() {
|
|
@@ -897,7 +909,9 @@ public class JLTStorageInBarcodeFragment extends BaseFragment implements View.On
|
|
|
jlt_edit_dc.requestFocus();
|
|
jlt_edit_dc.requestFocus();
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
- clearableedittextjudge();
|
|
|
|
|
|
|
+ if (cb_auto_save.isChecked()) { //自动保存
|
|
|
|
|
+ clearableedittextjudge();
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public void newlinemLotonEnter() {
|
|
public void newlinemLotonEnter() {
|
|
@@ -911,7 +925,9 @@ public class JLTStorageInBarcodeFragment extends BaseFragment implements View.On
|
|
|
jlt_edit_dc.requestFocus();
|
|
jlt_edit_dc.requestFocus();
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
- clearableedittextjudge();
|
|
|
|
|
|
|
+ if (cb_auto_save.isChecked()) { //自动保存
|
|
|
|
|
+ clearableedittextjudge();
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public void newlinemdateEnter() {
|
|
public void newlinemdateEnter() {
|
|
@@ -920,7 +936,9 @@ public class JLTStorageInBarcodeFragment extends BaseFragment implements View.On
|
|
|
jlt_edit_dc.requestFocus();
|
|
jlt_edit_dc.requestFocus();
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
- clearableedittextjudge();
|
|
|
|
|
|
|
+ if (cb_auto_save.isChecked()) { //自动保存
|
|
|
|
|
+ clearableedittextjudge();
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public void clearableedittextjudge() {
|
|
public void clearableedittextjudge() {
|
|
@@ -1144,7 +1162,9 @@ public class JLTStorageInBarcodeFragment extends BaseFragment implements View.On
|
|
|
} else {
|
|
} else {
|
|
|
//newlinebarcodeEnter();
|
|
//newlinebarcodeEnter();
|
|
|
}
|
|
}
|
|
|
- clearableedittextjudge();
|
|
|
|
|
|
|
+ if (cb_auto_save.isChecked()) { //自动保存
|
|
|
|
|
+ clearableedittextjudge();
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -1182,7 +1202,11 @@ public class JLTStorageInBarcodeFragment extends BaseFragment implements View.On
|
|
|
if (resultCode != Activity.RESULT_OK) {
|
|
if (resultCode != Activity.RESULT_OK) {
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+ try {
|
|
|
|
|
+ mFocusId = root.findFocus().getId();
|
|
|
|
|
+ }catch (Exception e) {
|
|
|
|
|
+ e.printStackTrace();
|
|
|
|
|
+ }
|
|
|
if (requestCode == REQUEST_DATE) {
|
|
if (requestCode == REQUEST_DATE) {
|
|
|
try {
|
|
try {
|
|
|
Date date = (Date) data.getSerializableExtra("extra_date");
|
|
Date date = (Date) data.getSerializableExtra("extra_date");
|
|
@@ -1202,6 +1226,14 @@ public class JLTStorageInBarcodeFragment extends BaseFragment implements View.On
|
|
|
barcodeParse(result);
|
|
barcodeParse(result);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ if (requestCode == SCAN_STORAGE_CODE && data != null) {
|
|
|
|
|
+ if (data.getExtras() != null) {
|
|
|
|
|
+ String result = data.getExtras().getString(CodeUtils.RESULT_STRING);
|
|
|
|
|
+ mLotEditText.setText(result);
|
|
|
|
|
+ mLotEditText.setSelection(result.length());
|
|
|
|
|
+ mBarcodeEditText.requestFocus();
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
if (requestCode == SCAN_MODEL_CODE && data != null) {
|
|
if (requestCode == SCAN_MODEL_CODE && data != null) {
|
|
|
if (data.getExtras() != null) {
|
|
if (data.getExtras() != null) {
|
|
|
String result = data.getExtras().getString(CodeUtils.RESULT_STRING);
|
|
String result = data.getExtras().getString(CodeUtils.RESULT_STRING);
|