|
|
@@ -170,6 +170,30 @@ public class JLTStorageInBarcodeFragment extends BaseFragment implements View.On
|
|
|
}
|
|
|
});
|
|
|
|
|
|
+ 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);
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ CommonUtil.setEditorActionListener(mMpqEditText, new MyEditorActionListener() {
|
|
|
+ @Override
|
|
|
+ public void MyEditorAction(String text, int actionId, KeyEvent event) {
|
|
|
+ mBrandEditText.postDelayed(new Runnable() {
|
|
|
+ @Override
|
|
|
+ public void run() {
|
|
|
+ mBrandEditText.requestFocus();
|
|
|
+ }
|
|
|
+ }, 100);
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
mPoCheckBox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
|
|
@Override
|
|
|
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
|
|
@@ -226,6 +250,20 @@ public class JLTStorageInBarcodeFragment extends BaseFragment implements View.On
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
+
|
|
|
+ CommonUtil.setEditorActionListener(mQuantityEditText, new MyEditorActionListener() {
|
|
|
+ @Override
|
|
|
+ public void MyEditorAction(String text, int actionId, KeyEvent event) {
|
|
|
+ String mpq = mMpqEditText.getText().toString().trim();
|
|
|
+ String qty = mQuantityEditText.getText().toString().trim();
|
|
|
+
|
|
|
+ if (TextUtils.isEmpty(mpq)) {
|
|
|
+ mMpqEditText.setText(qty);
|
|
|
+ }
|
|
|
+ mMpqEditText.requestFocus();
|
|
|
+ mMpqEditText.setSelection(mMpqEditText.getText().toString().trim().length());
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@@ -396,7 +434,7 @@ public class JLTStorageInBarcodeFragment extends BaseFragment implements View.On
|
|
|
String po = mPoEditText.getText().toString().trim();
|
|
|
mPoCheckBox.setChecked(!TextUtils.isEmpty(po));
|
|
|
double qty = brandEntity.getQTY();
|
|
|
- if (qty != -1) {
|
|
|
+ if (qty > 0) {
|
|
|
mQuantityEditText.setText(CommonUtil.doubleFormat(qty));
|
|
|
}
|
|
|
setValuableText(mDateEditText,
|
|
|
@@ -429,6 +467,9 @@ public class JLTStorageInBarcodeFragment extends BaseFragment implements View.On
|
|
|
isMpqDiv = pkgEntity.getPR_FBBZL_USER() == 0;
|
|
|
|
|
|
List<JLTMpqEntity> mpqlist = pkgEntity.getMPQLIST();
|
|
|
+ if (mpqlist == null) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
List<JLTMpqEntity> requireMpqs = new ArrayList<>();
|
|
|
for (int i = 0; i < mpqlist.size(); i++) {
|
|
|
JLTMpqEntity mpqEntity = mpqlist.get(i);
|
|
|
@@ -479,14 +520,6 @@ public class JLTStorageInBarcodeFragment extends BaseFragment implements View.On
|
|
|
} else {
|
|
|
mPanEditText.setText(CommonUtil.doubleFormat(Math.ceil(pan)));
|
|
|
mMpqEditText.setText(CommonUtil.doubleFormat(mpq));
|
|
|
- if (!CommonUtil.isIntegerForDouble(pan)) {
|
|
|
- new AlertDialog.Builder(mActivity)
|
|
|
- .setTitle("提示")
|
|
|
- .setMessage("入库数量:" + CommonUtil.doubleFormat(qty)
|
|
|
- + "不满足MPQ:" + mpq)
|
|
|
- .setPositiveButton("我知道了", null)
|
|
|
- .create().show();
|
|
|
- }
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
mPanEditText.setText(0);
|
|
|
@@ -533,7 +566,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;
|
|
|
@@ -896,12 +929,49 @@ public class JLTStorageInBarcodeFragment extends BaseFragment implements View.On
|
|
|
try {
|
|
|
double qty = Double.parseDouble(text);
|
|
|
mBarcodeParseBean.setQTY(qty);
|
|
|
+ String mpq = mMpqEditText.getText().toString().trim();
|
|
|
+ try {
|
|
|
+ if (!TextUtils.isEmpty(mpq)) {
|
|
|
+ double mpqNum = Double.parseDouble(mpq);
|
|
|
+ if (mpqNum <= 0) {
|
|
|
+ mPanEditText.setText("0");
|
|
|
+ } else {
|
|
|
+ double pan = qty / mpqNum;
|
|
|
+ mPanEditText.setText(CommonUtil.doubleFormat(Math.ceil(pan)));
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ mPanEditText.setText("0");
|
|
|
+ }
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ mPanEditText.setText("0");
|
|
|
+ }
|
|
|
} catch (Exception e) {
|
|
|
mBarcodeParseBean.setQTY(0);
|
|
|
+ mBarcodeParseBean.setPAN(0);
|
|
|
}
|
|
|
break;
|
|
|
case R.id.jlt_storage_in_barcode_mpq_et:
|
|
|
mBarcodeParseBean.setMPQ(text);
|
|
|
+ String qty = mQuantityEditText.getText().toString().trim();
|
|
|
+ try {
|
|
|
+ if (!TextUtils.isEmpty(qty)) {
|
|
|
+ double qtyNum = Double.parseDouble(qty);
|
|
|
+ double mpqNum = Double.parseDouble(text);
|
|
|
+ if (mpqNum <= 0) {
|
|
|
+ mPanEditText.setText("0");
|
|
|
+ } else {
|
|
|
+ double pan = qtyNum / mpqNum;
|
|
|
+ mPanEditText.setText(CommonUtil.doubleFormat(Math.ceil(pan)));
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ mPanEditText.setText("0");
|
|
|
+ }
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ mPanEditText.setText("0");
|
|
|
+ mBarcodeParseBean.setPAN(0);
|
|
|
+ }
|
|
|
break;
|
|
|
case R.id.jlt_storage_in_barcode_date_et:
|
|
|
mBarcodeParseBean.setDATECODE(text);
|