|
@@ -40,7 +40,6 @@ import com.uas.keg_storage.bean.WhcodeBean;
|
|
|
import com.uas.keg_storage.global.GloableParams;
|
|
import com.uas.keg_storage.global.GloableParams;
|
|
|
import com.uas.keg_storage.listener.MyEditorActionListener;
|
|
import com.uas.keg_storage.listener.MyEditorActionListener;
|
|
|
import com.uas.keg_storage.tools.SharedPreUtil;
|
|
import com.uas.keg_storage.tools.SharedPreUtil;
|
|
|
-import com.uas.keg_storage.util.CameraUtil;
|
|
|
|
|
import com.uas.keg_storage.util.CommonUtil;
|
|
import com.uas.keg_storage.util.CommonUtil;
|
|
|
import com.uas.keg_storage.util.Constants;
|
|
import com.uas.keg_storage.util.Constants;
|
|
|
import com.uas.keg_storage.util.DateFormatUtil;
|
|
import com.uas.keg_storage.util.DateFormatUtil;
|
|
@@ -53,7 +52,6 @@ import com.uas.keg_storage.util.VollyRequest;
|
|
|
import com.uas.keg_storage.view.ClearableEditText;
|
|
import com.uas.keg_storage.view.ClearableEditText;
|
|
|
import com.uas.keg_storage.view.RecyclerItemDecoration;
|
|
import com.uas.keg_storage.view.RecyclerItemDecoration;
|
|
|
import com.uas.keg_storage.view.business.CommonSelectPop;
|
|
import com.uas.keg_storage.view.business.CommonSelectPop;
|
|
|
-import com.uuzuche.lib_zxing.activity.CaptureActivity;
|
|
|
|
|
import com.uuzuche.lib_zxing.activity.CodeUtils;
|
|
import com.uuzuche.lib_zxing.activity.CodeUtils;
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
@@ -73,9 +71,9 @@ public class JLTStorageInBarcodeFragment extends BaseFragment implements View.On
|
|
|
private PopupWindow mMenuPopupWindow;
|
|
private PopupWindow mMenuPopupWindow;
|
|
|
private View mMenuView;
|
|
private View mMenuView;
|
|
|
private TextView mBoxTextView, mPanEditText;
|
|
private TextView mBoxTextView, mPanEditText;
|
|
|
- private ImageView mCalendarImageView, mEnclosureFitlerIv, mModelScanIv;
|
|
|
|
|
|
|
+ private ImageView mCalendarImageView, mEnclosureFitlerIv, mModelScanIv, mBarcodeScanIv;
|
|
|
private ClearableEditText mDateEditText, mModelEditText, mQuantityEditText,
|
|
private ClearableEditText mDateEditText, mModelEditText, mQuantityEditText,
|
|
|
- mLotEditText, mPoEditText, mEnclosureEditText, mMpqEditText, mBrandEditText;
|
|
|
|
|
|
|
+ mLotEditText, mPoEditText, mEnclosureEditText, mMpqEditText, mBrandEditText, mBarcodeEditText;
|
|
|
private CheckBox mPoCheckBox;
|
|
private CheckBox mPoCheckBox;
|
|
|
private String mBoxNum, mPiInoutno, mPiid, mPiClass, mRealBoxNum, mDatecodebyparse;
|
|
private String mBoxNum, mPiInoutno, mPiid, mPiClass, mRealBoxNum, mDatecodebyparse;
|
|
|
private JLTBarcodeParseBean mBarcodeParseBean;
|
|
private JLTBarcodeParseBean mBarcodeParseBean;
|
|
@@ -110,8 +108,8 @@ public class JLTStorageInBarcodeFragment extends BaseFragment implements View.On
|
|
|
mModelScanIv = root.findViewById(R.id.jlt_storage_in_barcode_model_scan_iv);
|
|
mModelScanIv = root.findViewById(R.id.jlt_storage_in_barcode_model_scan_iv);
|
|
|
mDateEditText = root.findViewById(R.id.jlt_storage_in_barcode_date_et);
|
|
mDateEditText = root.findViewById(R.id.jlt_storage_in_barcode_date_et);
|
|
|
mBoxTextView = root.findViewById(R.id.jlt_storage_in_barcode_box_tv);
|
|
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);
|
|
|
|
|
|
|
+ mBarcodeScanIv = 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);
|
|
mModelEditText = root.findViewById(R.id.jlt_storage_in_barcode_model_et);
|
|
|
mQuantityEditText = root.findViewById(R.id.jlt_storage_in_barcode_quantity_et);
|
|
mQuantityEditText = root.findViewById(R.id.jlt_storage_in_barcode_quantity_et);
|
|
|
mMpqEditText = root.findViewById(R.id.jlt_storage_in_barcode_mpq_et);
|
|
mMpqEditText = root.findViewById(R.id.jlt_storage_in_barcode_mpq_et);
|
|
@@ -122,13 +120,13 @@ public class JLTStorageInBarcodeFragment extends BaseFragment implements View.On
|
|
|
mSaveButton = root.findViewById(R.id.jlt_storage_in_barcode_save_btn);
|
|
mSaveButton = root.findViewById(R.id.jlt_storage_in_barcode_save_btn);
|
|
|
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);
|
|
|
- mModelEditText.requestFocus();
|
|
|
|
|
-// mBarcodeEditText.requestFocus();
|
|
|
|
|
|
|
+// 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);
|
|
|
|
|
|
|
|
mBarcodeParseBean = new JLTBarcodeParseBean();
|
|
mBarcodeParseBean = new JLTBarcodeParseBean();
|
|
|
- mBarcodeParseBean.setCHECKPO("Y");
|
|
|
|
|
|
|
+ mBarcodeParseBean.setCHECKPO("N");
|
|
|
|
|
|
|
|
View enclosureView = View.inflate(mActivity, R.layout.dialog_jlt_search_whcode, null);
|
|
View enclosureView = View.inflate(mActivity, R.layout.dialog_jlt_search_whcode, null);
|
|
|
mEnclosureRecyclerView = enclosureView.findViewById(R.id.item_jlt_search_whcode_rv);
|
|
mEnclosureRecyclerView = enclosureView.findViewById(R.id.item_jlt_search_whcode_rv);
|
|
@@ -148,7 +146,7 @@ public class JLTStorageInBarcodeFragment extends BaseFragment implements View.On
|
|
|
protected void initEvents() {
|
|
protected void initEvents() {
|
|
|
mMoreButton.setOnClickListener(this);
|
|
mMoreButton.setOnClickListener(this);
|
|
|
mCalendarImageView.setOnClickListener(this);
|
|
mCalendarImageView.setOnClickListener(this);
|
|
|
-// mScanImageView.setOnClickListener(this);
|
|
|
|
|
|
|
+ mBarcodeScanIv.setOnClickListener(this);
|
|
|
mModelScanIv.setOnClickListener(this);
|
|
mModelScanIv.setOnClickListener(this);
|
|
|
mSaveButton.setOnClickListener(this);
|
|
mSaveButton.setOnClickListener(this);
|
|
|
mNextButton.setOnClickListener(this);
|
|
mNextButton.setOnClickListener(this);
|
|
@@ -165,17 +163,17 @@ public class JLTStorageInBarcodeFragment extends BaseFragment implements View.On
|
|
|
mBrandEditText.addTextChangedListener(new MyTextWatcher(mBrandEditText));
|
|
mBrandEditText.addTextChangedListener(new MyTextWatcher(mBrandEditText));
|
|
|
mEnclosureEditText.addTextChangedListener(new MyTextWatcher(mEnclosureEditText));
|
|
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(text);
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
|
|
|
CommonUtil.setEditorActionListener(mModelEditText, new MyEditorActionListener() {
|
|
CommonUtil.setEditorActionListener(mModelEditText, new MyEditorActionListener() {
|
|
|
@Override
|
|
@Override
|
|
|
public void MyEditorAction(String text, int actionId, KeyEvent event) {
|
|
public void MyEditorAction(String text, int actionId, KeyEvent event) {
|
|
|
- barcodeParse();
|
|
|
|
|
|
|
+ modelParse();
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
|
|
|
|
@@ -277,7 +275,34 @@ public class JLTStorageInBarcodeFragment extends BaseFragment implements View.On
|
|
|
mBarcodeParseBean.setOUTBOX(mBoxNum);
|
|
mBarcodeParseBean.setOUTBOX(mBoxNum);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- private void barcodeParse() {
|
|
|
|
|
|
|
+ private void barcodeParse(String barcode) {
|
|
|
|
|
+ if (TextUtils.isEmpty(barcode)) {
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ resetState();
|
|
|
|
|
+ progressDialog.show();
|
|
|
|
|
+ VolleyRequest.getInstance().stringRequest(new HttpParams.Builder()
|
|
|
|
|
+ .url(GloableParams.ADDRESS_RECEIVING_BARCODEPARSE2)
|
|
|
|
|
+ .method(Request.Method.POST)
|
|
|
|
|
+ .addParam("data", barcode)
|
|
|
|
|
+ .build(), new HttpCallback() {
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void onSuccess(int flag, Object o) throws Exception {
|
|
|
|
|
+ progressDialog.dismiss();
|
|
|
|
|
+ mModelEditText.requestFocus();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void onFail(int flag, String failStr) throws Exception {
|
|
|
|
|
+ progressDialog.dismiss();
|
|
|
|
|
+ mBarcodeEditText.setText("");
|
|
|
|
|
+ mBarcodeEditText.requestFocus();
|
|
|
|
|
+ CommonUtil.toastNoRepeat(mActivity, failStr);
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ private void modelParse() {
|
|
|
mEnclosureList.clear();
|
|
mEnclosureList.clear();
|
|
|
mEnclosureEditText.setText("");
|
|
mEnclosureEditText.setText("");
|
|
|
String model = mModelEditText.getText().toString().trim();
|
|
String model = mModelEditText.getText().toString().trim();
|
|
@@ -535,9 +560,9 @@ public class JLTStorageInBarcodeFragment extends BaseFragment implements View.On
|
|
|
dialog.setTargetFragment(JLTStorageInBarcodeFragment.this, REQUEST_DATE);
|
|
dialog.setTargetFragment(JLTStorageInBarcodeFragment.this, REQUEST_DATE);
|
|
|
dialog.show(fragmentManager, DIALOG_DATE);
|
|
dialog.show(fragmentManager, DIALOG_DATE);
|
|
|
break;
|
|
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:
|
|
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;
|
|
@@ -623,6 +648,7 @@ public class JLTStorageInBarcodeFragment extends BaseFragment implements View.On
|
|
|
.setNegativeButton("取消", new DialogInterface.OnClickListener() {
|
|
.setNegativeButton("取消", new DialogInterface.OnClickListener() {
|
|
|
@Override
|
|
@Override
|
|
|
public void onClick(DialogInterface dialog, int which) {
|
|
public void onClick(DialogInterface dialog, int which) {
|
|
|
|
|
+ mBarcodeEditText.setText("");
|
|
|
resetState();
|
|
resetState();
|
|
|
}
|
|
}
|
|
|
}).create().show();
|
|
}).create().show();
|
|
@@ -638,11 +664,12 @@ public class JLTStorageInBarcodeFragment extends BaseFragment implements View.On
|
|
|
progressDialog.show();
|
|
progressDialog.show();
|
|
|
String jsonString = JSON.toJSONString(mBarcodeParseBean);
|
|
String jsonString = JSON.toJSONString(mBarcodeParseBean);
|
|
|
VolleyRequest.getInstance().stringRequest(new HttpParams.Builder()
|
|
VolleyRequest.getInstance().stringRequest(new HttpParams.Builder()
|
|
|
- .url(GloableParams.ADDRESS_JLT_RECEIVING_SAVEBARCODE)
|
|
|
|
|
|
|
+ .url(GloableParams.ADDRESS_RECEIVING_SAVEBARCODE2)
|
|
|
.method(Request.Method.POST)
|
|
.method(Request.Method.POST)
|
|
|
.tag(TAG + "savebarcode")
|
|
.tag(TAG + "savebarcode")
|
|
|
.addParam("store", jsonString)
|
|
.addParam("store", jsonString)
|
|
|
.addParam("pi_ids", mPiid)
|
|
.addParam("pi_ids", mPiid)
|
|
|
|
|
+ .addParam("barcode", mBarcodeEditText.getText().toString().trim())
|
|
|
.build(), new HttpCallback() {
|
|
.build(), new HttpCallback() {
|
|
|
@Override
|
|
@Override
|
|
|
public void onSuccess(int flag, Object o) throws Exception {
|
|
public void onSuccess(int flag, Object o) throws Exception {
|
|
@@ -675,14 +702,17 @@ public class JLTStorageInBarcodeFragment extends BaseFragment implements View.On
|
|
|
boolean isFinish = FastjsonUtil.getBoolean(dataObject, "ISFINISH");
|
|
boolean isFinish = FastjsonUtil.getBoolean(dataObject, "ISFINISH");
|
|
|
if (isFinish) {
|
|
if (isFinish) {
|
|
|
CommonUtil.toastNoRepeat(mActivity, "该入库单最后一行已完成采集!");
|
|
CommonUtil.toastNoRepeat(mActivity, "该入库单最后一行已完成采集!");
|
|
|
- getActivity().getSupportFragmentManager().popBackStackImmediate();
|
|
|
|
|
- if (mOnFinishListener != null) {
|
|
|
|
|
- mOnFinishListener.onFinish();
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ mBarcodeEditText.setText("");
|
|
|
|
|
+ resetState();
|
|
|
|
|
+// getActivity().getSupportFragmentManager().popBackStackImmediate();
|
|
|
|
|
+// if (mOnFinishListener != null) {
|
|
|
|
|
+// mOnFinishListener.onFinish();
|
|
|
|
|
+// }
|
|
|
} else {
|
|
} else {
|
|
|
if (exist) {
|
|
if (exist) {
|
|
|
getActivity().getSupportFragmentManager().popBackStack();
|
|
getActivity().getSupportFragmentManager().popBackStack();
|
|
|
} else {
|
|
} else {
|
|
|
|
|
+ mBarcodeEditText.setText("");
|
|
|
resetState();
|
|
resetState();
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -712,7 +742,7 @@ public class JLTStorageInBarcodeFragment extends BaseFragment implements View.On
|
|
|
mBrandEditText.setText("");
|
|
mBrandEditText.setText("");
|
|
|
mEnclosureEditText.setText("");
|
|
mEnclosureEditText.setText("");
|
|
|
|
|
|
|
|
- mModelEditText.requestFocus();
|
|
|
|
|
|
|
+ mBarcodeEditText.requestFocus();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@@ -732,19 +762,20 @@ public class JLTStorageInBarcodeFragment extends BaseFragment implements View.On
|
|
|
mDateEditText.setText("");
|
|
mDateEditText.setText("");
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- /*if (requestCode == SCAN_BARCODE_CODE && data != null) {
|
|
|
|
|
|
|
+ if (requestCode == SCAN_BARCODE_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);
|
|
|
mBarcodeEditText.setText(result);
|
|
mBarcodeEditText.setText(result);
|
|
|
mBarcodeEditText.setSelection(result.length());
|
|
mBarcodeEditText.setSelection(result.length());
|
|
|
|
|
+ barcodeParse(result);
|
|
|
}
|
|
}
|
|
|
- }*/
|
|
|
|
|
|
|
+ }
|
|
|
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);
|
|
|
mModelEditText.setText(result);
|
|
mModelEditText.setText(result);
|
|
|
mModelEditText.setSelection(result.length());
|
|
mModelEditText.setSelection(result.length());
|
|
|
- barcodeParse();
|
|
|
|
|
|
|
+ modelParse();
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -762,6 +793,7 @@ public class JLTStorageInBarcodeFragment extends BaseFragment implements View.On
|
|
|
Button postBtn = (Button) mMenuView.findViewById(R.id.pop_jlt_storage_in_box_menu_4);
|
|
Button postBtn = (Button) mMenuView.findViewById(R.id.pop_jlt_storage_in_box_menu_4);
|
|
|
postBtn.setVisibility(View.VISIBLE);
|
|
postBtn.setVisibility(View.VISIBLE);
|
|
|
revokeCollectBtn.setText("确认入库");
|
|
revokeCollectBtn.setText("确认入库");
|
|
|
|
|
+ revokeCollectBtn.setVisibility(View.GONE);
|
|
|
|
|
|
|
|
todoListBtn.setOnClickListener(new View.OnClickListener() {
|
|
todoListBtn.setOnClickListener(new View.OnClickListener() {
|
|
|
@Override
|
|
@Override
|
|
@@ -819,6 +851,7 @@ public class JLTStorageInBarcodeFragment extends BaseFragment implements View.On
|
|
|
public void onSuccess(int flag, Object o) throws Exception {
|
|
public void onSuccess(int flag, Object o) throws Exception {
|
|
|
progressDialog.dismiss();
|
|
progressDialog.dismiss();
|
|
|
CommonUtil.toastNoRepeat(mActivity, "过账成功");
|
|
CommonUtil.toastNoRepeat(mActivity, "过账成功");
|
|
|
|
|
+ getActivity().getSupportFragmentManager().popBackStackImmediate();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|