|
|
@@ -1,5 +1,6 @@
|
|
|
package com.uas.pda_wms.fragment;
|
|
|
|
|
|
+import android.app.Activity;
|
|
|
import android.content.Intent;
|
|
|
import android.text.TextUtils;
|
|
|
import android.view.KeyEvent;
|
|
|
@@ -8,11 +9,16 @@ import android.widget.Button;
|
|
|
import android.widget.ImageView;
|
|
|
import android.widget.TextView;
|
|
|
|
|
|
+import com.android.volley.Request;
|
|
|
import com.uas.pda_wms.R;
|
|
|
+import com.uas.pda_wms.global.GloableParams;
|
|
|
import com.uas.pda_wms.listener.MyEditorActionListener;
|
|
|
import com.uas.pda_wms.tools.RegexUtil;
|
|
|
import com.uas.pda_wms.util.CommonUtil;
|
|
|
import com.uas.pda_wms.util.Constants;
|
|
|
+import com.uas.pda_wms.util.HttpCallback;
|
|
|
+import com.uas.pda_wms.util.HttpParams;
|
|
|
+import com.uas.pda_wms.util.VolleyRequest;
|
|
|
import com.uas.pda_wms.view.ClearableEditText;
|
|
|
|
|
|
/**
|
|
|
@@ -76,22 +82,68 @@ public class BarcodeQtyModifyFragment extends BaseFragment {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
- private void modifyConfirm(String barcode, String qty) {
|
|
|
- // TODO: 2019/8/7 条码修改
|
|
|
+ @Override
|
|
|
+ protected void initDatas() {
|
|
|
+
|
|
|
}
|
|
|
|
|
|
private void barcodeParse(String barcode) {
|
|
|
- // TODO: 2019/8/7 条码解析
|
|
|
+ if (TextUtils.isEmpty(barcode)) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ progressDialog.show();
|
|
|
+ mResultTextView.setText("");
|
|
|
+ VolleyRequest.getInstance().stringRequest(new HttpParams.Builder()
|
|
|
+ .url(GloableParams.ADDRESS_WHMGT_CHECKMODIFYBARCODE)
|
|
|
+ .method(Request.Method.GET)
|
|
|
+ .tag(TAG + "checkbarcode")
|
|
|
+ .flag(0)
|
|
|
+ .addParam("barcode", barcode)
|
|
|
+ .build(), new HttpCallback() {
|
|
|
+ @Override
|
|
|
+ public void onSuccess(int flag, Object o) throws Exception {
|
|
|
+ progressDialog.dismiss();
|
|
|
+ mResultTextView.setText("");
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void onFail(int flag, String failStr) throws Exception {
|
|
|
+ progressDialog.dismiss();
|
|
|
+ CommonUtil.toastNoRepeat(mActivity, failStr);
|
|
|
+ mResultTextView.setText(failStr);
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
- @Override
|
|
|
- protected void initDatas() {
|
|
|
+ private void modifyConfirm(String barcode, String qty) {
|
|
|
+ progressDialog.show();
|
|
|
+ VolleyRequest.getInstance().stringRequest(new HttpParams.Builder()
|
|
|
+ .url(GloableParams.ADDRESS_WHMGT_MODIFYBARCODE)
|
|
|
+ .method(Request.Method.POST)
|
|
|
+ .addParam("barcode", barcode)
|
|
|
+ .addParam("newqty", qty)
|
|
|
+ .build(), new HttpCallback() {
|
|
|
+ @Override
|
|
|
+ public void onSuccess(int flag, Object o) throws Exception {
|
|
|
+ progressDialog.dismiss();
|
|
|
+ mResultTextView.setText("");
|
|
|
+ mBarcodeEditText.setText("");
|
|
|
+ mQtyEditText.setText("");
|
|
|
+ CommonUtil.toastNoRepeat(mActivity, "条码修改成功");
|
|
|
+ }
|
|
|
|
|
|
+ @Override
|
|
|
+ public void onFail(int flag, String failStr) throws Exception {
|
|
|
+ progressDialog.dismiss();
|
|
|
+ CommonUtil.toastNoRepeat(mActivity, failStr);
|
|
|
+ mResultTextView.setText(failStr);
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public void onActivityResult(int requestCode, int resultCode, Intent data) {
|
|
|
- if (requestCode == 0x11) {
|
|
|
+ if (requestCode == 0x11 && resultCode == Activity.RESULT_OK) {
|
|
|
String scanResult = CommonUtil.getScanResult(data);
|
|
|
mBarcodeEditText.setText(scanResult);
|
|
|
mBarcodeEditText.setSelection(scanResult.length());
|