|
|
@@ -12,7 +12,6 @@ import android.text.TextUtils;
|
|
|
import android.util.Log;
|
|
|
import android.view.KeyEvent;
|
|
|
import android.view.View;
|
|
|
-import android.view.inputmethod.EditorInfo;
|
|
|
import android.widget.AdapterView;
|
|
|
import android.widget.Button;
|
|
|
import android.widget.ImageView;
|
|
|
@@ -44,6 +43,7 @@ import uas.erp.jiaweisi_wms.adapter.WarehouseCacheAdapter;
|
|
|
import uas.erp.jiaweisi_wms.bean.CaptionValueBean;
|
|
|
import uas.erp.jiaweisi_wms.bean.WarehouseCacheBean;
|
|
|
import uas.erp.jiaweisi_wms.global.GloableParams;
|
|
|
+import uas.erp.jiaweisi_wms.listener.MyEditorActionListener;
|
|
|
import uas.erp.jiaweisi_wms.tools.SharedPreUtil;
|
|
|
import uas.erp.jiaweisi_wms.util.CameraUtil;
|
|
|
import uas.erp.jiaweisi_wms.util.CommonUtil;
|
|
|
@@ -83,7 +83,7 @@ public class StorageTwoIQCInFragment extends BaseFragment implements View.OnClic
|
|
|
private WarehouseCacheAdapter mWarehouseCacheAdapter;
|
|
|
private View mPopView;
|
|
|
private int mVeId = 0;
|
|
|
- private String text_rb= "合格";
|
|
|
+ private String text_rb = "合格";
|
|
|
|
|
|
private StringRequest mStringRequest;
|
|
|
private PopupWindow mMenuPopupWindow;
|
|
|
@@ -111,6 +111,9 @@ public class StorageTwoIQCInFragment extends BaseFragment implements View.OnClic
|
|
|
private RadioButton rb_no;
|
|
|
private Button btn_shen;
|
|
|
private String datastring;
|
|
|
+ private ClearableEditText cet_barcode;
|
|
|
+ private ImageView iv_bar_scan;
|
|
|
+
|
|
|
|
|
|
@Override
|
|
|
public void onDestroyView() {
|
|
|
@@ -165,6 +168,8 @@ public class StorageTwoIQCInFragment extends BaseFragment implements View.OnClic
|
|
|
rb_yse = root.findViewById(R.id.rb_yse);
|
|
|
rb_no = root.findViewById(R.id.rb_no);
|
|
|
btn_shen = root.findViewById(R.id.btn_shen);
|
|
|
+ cet_barcode = root.findViewById(R.id.cet_barcode);
|
|
|
+ iv_bar_scan = root.findViewById(R.id.iv_bar_scan);
|
|
|
|
|
|
mCaptionValueBeans = new ArrayList<>();
|
|
|
mCaptionValueItemAdapter = new CaptionValueItemAdapter(mActivity, mCaptionValueBeans);
|
|
|
@@ -184,32 +189,35 @@ public class StorageTwoIQCInFragment extends BaseFragment implements View.OnClic
|
|
|
protected void initEvents() {
|
|
|
mMenuButton.setOnClickListener(this);
|
|
|
mScanImageView.setOnClickListener(this);
|
|
|
-// mBadImageView.setOnClickListener(this);
|
|
|
-// mBadEditText.setOnClickListener(this);
|
|
|
+ // mBadImageView.setOnClickListener(this);
|
|
|
+ // mBadEditText.setOnClickListener(this);
|
|
|
mGoodImageView.setOnClickListener(this);
|
|
|
mGoodEditText.setOnClickListener(this);
|
|
|
mCommitButton.setOnClickListener(this);
|
|
|
|
|
|
- mBarcodeEditText.setOnEditorActionListener(new TextView.OnEditorActionListener() {
|
|
|
+
|
|
|
+ CommonUtil.setEditorActionListener(mBarcodeEditText, new MyEditorActionListener() {
|
|
|
@Override
|
|
|
- public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
|
|
|
- if (actionId == EditorInfo.IME_ACTION_DONE
|
|
|
- || actionId == EditorInfo.IME_ACTION_SEND
|
|
|
- || (event != null && event.getAction() == KeyEvent.ACTION_DOWN && event.getKeyCode() == KeyEvent.KEYCODE_ENTER)) {
|
|
|
- String barcode = mBarcodeEditText.getText().toString().trim();
|
|
|
- getDataByBarcode(barcode);
|
|
|
- return true;
|
|
|
- }
|
|
|
- return false;
|
|
|
+ public void MyEditorAction(String text, int actionId, KeyEvent event) {
|
|
|
+ getDataByBarcode(text);
|
|
|
}
|
|
|
});
|
|
|
+
|
|
|
+ CommonUtil.setEditorActionListener(cet_barcode, new MyEditorActionListener() {
|
|
|
+ @Override
|
|
|
+ public void MyEditorAction(String text, int actionId, KeyEvent event) {
|
|
|
+ String code = mBarcodeEditText.getText().toString().trim();
|
|
|
+ getDataByBar(code,text);
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
rg_yesorno.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
|
|
|
@Override
|
|
|
public void onCheckedChanged(RadioGroup group, int checkedId) {
|
|
|
if (checkedId == R.id.rb_yse) {
|
|
|
- text_rb="合格";
|
|
|
+ text_rb = "合格";
|
|
|
} else if (checkedId == R.id.rb_no) {
|
|
|
- text_rb="不合格";
|
|
|
+ text_rb = "不合格";
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
@@ -230,21 +238,51 @@ public class StorageTwoIQCInFragment extends BaseFragment implements View.OnClic
|
|
|
dialog.dismiss();
|
|
|
}
|
|
|
}).create().show();
|
|
|
-
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
+
|
|
|
+ private void getDataByBar(String code,String code1) {
|
|
|
+ progressDialog.show();
|
|
|
+ VolleyRequest.getInstance().stringRequest(null,
|
|
|
+ new HttpParams.Builder()
|
|
|
+ .url(GloableParams.ADDRESS_DOCUMENTLIBRARY_AUTIQC)
|
|
|
+ .method(Request.Method.GET)
|
|
|
+ .tag(GloableParams.ADDRESS_DOCUMENTLIBRARY_AUTIQC)
|
|
|
+ .flag(0)
|
|
|
+ .addParam("bar_code",code)
|
|
|
+ .addParam("bar_code1", code1)
|
|
|
+ .build(), new HttpCallback() {
|
|
|
+ @Override
|
|
|
+ public void onSuccess(int flag, Object o) throws Exception {
|
|
|
+ progressDialog.dismiss();
|
|
|
+ String result = o.toString();
|
|
|
+ JSONObject resultObject = JSON.parseObject(result);
|
|
|
+ if (resultObject != null) {
|
|
|
+ CommonUtil.toastNoRepeat(mActivity, "绑定成功");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void onFail(int flag, String failStr) throws Exception {
|
|
|
+ progressDialog.dismiss();
|
|
|
+ CommonUtil.toastNoRepeat(mActivity, failStr);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
private static final int FLAG_UPDATEANDINQTY = 0x05;
|
|
|
- public void Yessehn(){
|
|
|
+
|
|
|
+ public void Yessehn() {
|
|
|
if (mVeId == 0) {
|
|
|
CommonUtil.toastNoRepeat(mActivity, "单据id获取失败,请重新获取条码信息");
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
-// if (TextUtils.isEmpty(mGoodWarehouse) && mOkQty > 0) {
|
|
|
-// CommonUtil.toastNoRepeat(mActivity, "该检验单存在合格数,良品仓必填\n");
|
|
|
-// return;
|
|
|
-// }
|
|
|
+ // if (TextUtils.isEmpty(mGoodWarehouse) && mOkQty > 0) {
|
|
|
+ // CommonUtil.toastNoRepeat(mActivity, "该检验单存在合格数,良品仓必填\n");
|
|
|
+ // return;
|
|
|
+ // }
|
|
|
progressDialog.show();
|
|
|
VolleyRequest.getInstance().stringRequest(mStringRequest,
|
|
|
new HttpParams.Builder()
|
|
|
@@ -252,7 +290,7 @@ public class StorageTwoIQCInFragment extends BaseFragment implements View.OnClic
|
|
|
.method(Request.Method.POST)
|
|
|
.tag(TAG + "updateandinqty")
|
|
|
.flag(FLAG_UPDATEANDINQTY)
|
|
|
- .addParam("ve_id", mVeId+"")
|
|
|
+ .addParam("ve_id", mVeId + "")
|
|
|
.addParam("ve_result", text_rb)
|
|
|
.addParam("bar_code", text_rb)
|
|
|
.build(), new HttpCallback() {
|
|
|
@@ -263,8 +301,8 @@ public class StorageTwoIQCInFragment extends BaseFragment implements View.OnClic
|
|
|
JSONObject resultObject = JSON.parseObject(result);
|
|
|
datastring = FastjsonUtil.getText(resultObject, "data");
|
|
|
CommonUtil.toastNoRepeat(mActivity, datastring);
|
|
|
-// mDataLinearLayout.setVisibility(View.GONE);
|
|
|
-// mErrorScrollView.setVisibility(View.VISIBLE);
|
|
|
+ // mDataLinearLayout.setVisibility(View.GONE);
|
|
|
+ // mErrorScrollView.setVisibility(View.VISIBLE);
|
|
|
if (!CommonUtil.isNetWorkConnected(mActivity)) {
|
|
|
CommonUtil.toastNoRepeat(mActivity, mActivity.getString(R.string.net_not_connect));
|
|
|
} else {
|
|
|
@@ -285,7 +323,8 @@ public class StorageTwoIQCInFragment extends BaseFragment implements View.OnClic
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
- public void YessehnSTORAGE(){
|
|
|
+
|
|
|
+ public void YessehnSTORAGE() {
|
|
|
progressDialog.show();
|
|
|
VolleyRequest.getInstance().stringRequest(mStringRequest,
|
|
|
new HttpParams.Builder()
|
|
|
@@ -304,9 +343,9 @@ public class StorageTwoIQCInFragment extends BaseFragment implements View.OnClic
|
|
|
String result = o.toString();
|
|
|
JSONObject resultObject = JSON.parseObject(result);
|
|
|
JSONObject dataObject = resultObject.getJSONObject("data");
|
|
|
- Log.e("dataObject===",dataObject.toString());
|
|
|
+ Log.e("dataObject===", dataObject.toString());
|
|
|
if (dataObject != null) {
|
|
|
- CommonUtil.toastNoRepeat(mActivity, "入库单"+FastjsonUtil.getText(dataObject, "okNO")+"生成成功");
|
|
|
+ CommonUtil.toastNoRepeat(mActivity, "入库单" + FastjsonUtil.getText(dataObject, "okNO") + "生成成功");
|
|
|
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
@@ -321,10 +360,11 @@ public class StorageTwoIQCInFragment extends BaseFragment implements View.OnClic
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
+
|
|
|
@Override
|
|
|
protected void initDatas() {
|
|
|
// mBadWarehouse = SharedPreUtil.getString(mActivity
|
|
|
-// , Constants.FLAG.CACHE_DEFAULT_REJECTS_WAREHOUSE + CommonUtil.getUserName(mActivity), null);
|
|
|
+ // , Constants.FLAG.CACHE_DEFAULT_REJECTS_WAREHOUSE + CommonUtil.getUserName(mActivity), null);
|
|
|
|
|
|
mSpanUtils = new SpanUtils();
|
|
|
SpannableStringBuilder badWareHouse = mSpanUtils.append("IQC").setForegroundColor(Color.BLACK)
|
|
|
@@ -501,10 +541,10 @@ public class StorageTwoIQCInFragment extends BaseFragment implements View.OnClic
|
|
|
if (!CommonUtil.isRepeatClick()) {
|
|
|
String good = mGoodEditText.getText().toString().trim();
|
|
|
String bad = mBadEditText.getText().toString().trim();
|
|
|
-// if (TextUtils.isEmpty(mGoodWarehouse) && mOkQty > 0) {
|
|
|
-// CommonUtil.toastNoRepeat(mActivity, "该检验单存在合格数,良品仓必填\n");
|
|
|
-// return;
|
|
|
-// }
|
|
|
+ // if (TextUtils.isEmpty(mGoodWarehouse) && mOkQty > 0) {
|
|
|
+ // CommonUtil.toastNoRepeat(mActivity, "该检验单存在合格数,良品仓必填\n");
|
|
|
+ // return;
|
|
|
+ // }
|
|
|
hideAllViews();
|
|
|
progressDialog.show();
|
|
|
VolleyRequest.getInstance().stringRequest(mStringRequest,
|
|
|
@@ -570,13 +610,13 @@ public class StorageTwoIQCInFragment extends BaseFragment implements View.OnClic
|
|
|
tv_testMethod.setText(testMethod);
|
|
|
tv_vadQty.setText(vadQty);
|
|
|
tv_checkQty.setText(checkQty);
|
|
|
- tv_mOkQty.setText(mOkQty+"");
|
|
|
+ tv_mOkQty.setText(mOkQty + "");
|
|
|
tv_ngQty.setText(ngQty);
|
|
|
tv_status.setText(status);
|
|
|
}
|
|
|
mErrorScrollView.setVisibility(View.GONE);
|
|
|
mDataLinearLayout.setVisibility(View.VISIBLE);
|
|
|
-// analysisGetBarcode(result);
|
|
|
+ // analysisGetBarcode(result);
|
|
|
} catch (Exception e) {
|
|
|
mDataLinearLayout.setVisibility(View.GONE);
|
|
|
mErrorTextView.setText("条码数据获取异常,请重新获取");
|
|
|
@@ -589,7 +629,7 @@ public class StorageTwoIQCInFragment extends BaseFragment implements View.OnClic
|
|
|
String result = o.toString();
|
|
|
JSONObject resultObject = JSON.parseObject(result);
|
|
|
JSONObject dataObject = resultObject.getJSONObject("data");
|
|
|
- Log.e("dataObject===",dataObject.toString());
|
|
|
+ Log.e("dataObject===", dataObject.toString());
|
|
|
if (dataObject != null) {
|
|
|
final JSONObject okNoObject = dataObject.getJSONObject("okNO");
|
|
|
if (okNoObject == null) {
|
|
|
@@ -762,7 +802,7 @@ public class StorageTwoIQCInFragment extends BaseFragment implements View.OnClic
|
|
|
mErrorTextView.setText("");
|
|
|
mErrorScrollView.setVisibility(View.GONE);
|
|
|
mCaptionValueBeans.clear();
|
|
|
-// mCaptionValueItemAdapter.notifyDataSetChanged();
|
|
|
+ // mCaptionValueItemAdapter.notifyDataSetChanged();
|
|
|
}
|
|
|
|
|
|
@Override
|