|
|
@@ -312,7 +312,7 @@ public class JLTStorageInBarcodeFragment extends BaseFragment implements View.On
|
|
|
.setView(mMpqView)
|
|
|
.enableBackgroundDark(true)
|
|
|
.enableOutsideTouchableDissmiss(false)
|
|
|
- .size(mMpqView.getWidth(),mMpqView.getHeight())
|
|
|
+ .size(mMpqView.getWidth(), mMpqView.getHeight())
|
|
|
.create();
|
|
|
mMpqPopWindow.showAtLocation(mActivity.getWindow().getDecorView(),
|
|
|
Gravity.CENTER, 0, 0);
|
|
|
@@ -387,10 +387,10 @@ public class JLTStorageInBarcodeFragment extends BaseFragment implements View.On
|
|
|
mMpqPopWindow.dissmiss();
|
|
|
break;
|
|
|
case R.id.jlt_storage_in_barcode_save_btn:
|
|
|
- saveBarcode(false);
|
|
|
+ saveBarcode(false, true);
|
|
|
break;
|
|
|
case R.id.jlt_storage_in_barcode_next_btn:
|
|
|
- saveBarcode(true);
|
|
|
+ saveBarcode(true, true);
|
|
|
break;
|
|
|
case R.id.jlt_storage_in_barcode_enclosure_et:
|
|
|
case R.id.jlt_storage_in_barcode_enclosure_filter_iv:
|
|
|
@@ -405,7 +405,7 @@ public class JLTStorageInBarcodeFragment extends BaseFragment implements View.On
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private void saveBarcode(boolean exist) {
|
|
|
+ private void saveBarcode(boolean exist, boolean checkDate) {
|
|
|
if (TextUtils.isEmpty(mBarcodeParseBean.getPN()) ||
|
|
|
TextUtils.isEmpty(mBarcodeParseBean.getBRAND())) {
|
|
|
CommonUtil.toastNoRepeat(mActivity, "请采集条码获取必填数据");
|
|
|
@@ -419,32 +419,37 @@ public class JLTStorageInBarcodeFragment extends BaseFragment implements View.On
|
|
|
CommonUtil.toastNoRepeat(mActivity, "当前采集的条码不属于当前箱号");
|
|
|
return;
|
|
|
}*/
|
|
|
- if (TextUtils.isEmpty(mBarcodeParseBean.getPR_PKG())) {
|
|
|
+ if (mEnclosureList.size() > 0 && TextUtils.isEmpty(mBarcodeParseBean.getPR_PKG())) {
|
|
|
CommonUtil.toastNoRepeat(mActivity, "请选择封装形式");
|
|
|
return;
|
|
|
}
|
|
|
- long limitDays = SharedPreUtil.getInt(mActivity, Constants.FLAG.JLT_VALID_DAYS_CACHE, 0);
|
|
|
- int daysInterval = DateFormatUtil.getDaysInterval(mDatecodebyparse, DateFormatUtil.long2Str("yyyyMMdd")
|
|
|
- , DateFormatUtil.getFormat("yyyyMMdd"));
|
|
|
-
|
|
|
- if (limitDays != 0 && daysInterval > limitDays) {
|
|
|
- new AlertDialog.Builder(mActivity)
|
|
|
- .setTitle("提示")
|
|
|
- .setMessage("入库校验 生产日期(" + mDatecodebyparse
|
|
|
- + ")+ 有效天数(" + limitDays
|
|
|
- + ")<当天,是否确认入库?")
|
|
|
- .setPositiveButton("确认", new DialogInterface.OnClickListener() {
|
|
|
- @Override
|
|
|
- public void onClick(DialogInterface dialog, int which) {
|
|
|
- confirmRequest(exist);
|
|
|
- }
|
|
|
- })
|
|
|
- .setNegativeButton("取消", new DialogInterface.OnClickListener() {
|
|
|
- @Override
|
|
|
- public void onClick(DialogInterface dialog, int which) {
|
|
|
- resetState();
|
|
|
- }
|
|
|
- }).create().show();
|
|
|
+
|
|
|
+ if (checkDate) {
|
|
|
+ long limitDays = SharedPreUtil.getInt(mActivity, Constants.FLAG.JLT_VALID_DAYS_CACHE, 0);
|
|
|
+ int daysInterval = DateFormatUtil.getDaysInterval(mDatecodebyparse, DateFormatUtil.long2Str("yyyyMMdd")
|
|
|
+ , DateFormatUtil.getFormat("yyyyMMdd"));
|
|
|
+
|
|
|
+ if (limitDays != 0 && daysInterval > limitDays) {
|
|
|
+ new AlertDialog.Builder(mActivity)
|
|
|
+ .setTitle("提示")
|
|
|
+ .setMessage("入库校验 生产日期(" + mDatecodebyparse
|
|
|
+ + ")+ 有效天数(" + limitDays
|
|
|
+ + ")<当天,是否确认入库?")
|
|
|
+ .setPositiveButton("确认", new DialogInterface.OnClickListener() {
|
|
|
+ @Override
|
|
|
+ public void onClick(DialogInterface dialog, int which) {
|
|
|
+ confirmRequest(exist);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .setNegativeButton("取消", new DialogInterface.OnClickListener() {
|
|
|
+ @Override
|
|
|
+ public void onClick(DialogInterface dialog, int which) {
|
|
|
+ resetState();
|
|
|
+ }
|
|
|
+ }).create().show();
|
|
|
+ } else {
|
|
|
+ confirmRequest(exist);
|
|
|
+ }
|
|
|
} else {
|
|
|
confirmRequest(exist);
|
|
|
}
|
|
|
@@ -478,7 +483,7 @@ public class JLTStorageInBarcodeFragment extends BaseFragment implements View.On
|
|
|
@Override
|
|
|
public void onClick(DialogInterface dialog, int which) {
|
|
|
mPoCheckBox.setChecked(false);
|
|
|
- saveBarcode(exist);
|
|
|
+ saveBarcode(exist, false);
|
|
|
}
|
|
|
}).create().show();
|
|
|
return;
|
|
|
@@ -542,7 +547,9 @@ public class JLTStorageInBarcodeFragment extends BaseFragment implements View.On
|
|
|
if (requestCode == REQUEST_DATE) {
|
|
|
try {
|
|
|
Date date = (Date) data.getSerializableExtra("extra_date");
|
|
|
- mDateEditText.setText(DateFormat.format("yyyyMMdd", date));
|
|
|
+ String formatDate = DateFormat.format("yyyyMMdd", date).toString();
|
|
|
+ mDateEditText.setText(formatDate);
|
|
|
+ mDatecodebyparse = formatDate;
|
|
|
} catch (Exception e) {
|
|
|
mDateEditText.setText("");
|
|
|
}
|