|
@@ -72,10 +72,6 @@ import java.util.Iterator;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
|
|
|
-import butterknife.Bind;
|
|
|
-import butterknife.ButterKnife;
|
|
|
-import butterknife.OnClick;
|
|
|
-
|
|
|
/**
|
|
|
* 材料出库页面
|
|
|
*/
|
|
@@ -83,18 +79,6 @@ public class IOCOutMakeMaterial extends BaseFragment {
|
|
|
|
|
|
private static String TAG = "IOCOutMakeMaterial";
|
|
|
private Button mMenuButton;
|
|
|
- @Bind(R.id.in_out_no)
|
|
|
- AutoCompleteTextView inOutNo;
|
|
|
- @Bind(R.id.clean_iv)
|
|
|
- ImageView cleanIv;
|
|
|
- @Bind(R.id.wh_code)
|
|
|
- ClearableEditText whCode;
|
|
|
- @Bind(R.id.submit_btn)
|
|
|
- Button submitBtn;
|
|
|
- @Bind(R.id.list_in_out)
|
|
|
- ListView listInOut;
|
|
|
- @Bind(R.id.iocout_material_multiple_tv)
|
|
|
- TextView mMultipleTextView;
|
|
|
|
|
|
private IOCOutMakeMaterialFuzzySearch fuzzySearchData;
|
|
|
private MyArrayAdapter<String> autoStringAdapter;
|
|
@@ -114,6 +98,12 @@ public class IOCOutMakeMaterial extends BaseFragment {
|
|
|
private Button btn_add;
|
|
|
private PopupWindow mMenuPopupWindow;
|
|
|
private Fragment mFragment;
|
|
|
+ private AutoCompleteTextView inOutNo;
|
|
|
+ private ImageView cleanIv;
|
|
|
+ private Button submitBtn;
|
|
|
+ private ClearableEditText whCode;
|
|
|
+ private ListView listInOut;
|
|
|
+ private TextView mMultipleTextView;
|
|
|
|
|
|
@Override
|
|
|
protected int getLayout() {
|
|
@@ -123,7 +113,16 @@ public class IOCOutMakeMaterial extends BaseFragment {
|
|
|
@Override
|
|
|
protected void initViews() {
|
|
|
((FunctionActivity) getActivity()).setMoreBtnVisible(true);
|
|
|
- ButterKnife.bind(this, root);
|
|
|
+
|
|
|
+ inOutNo = root.findViewById(R.id.in_out_no);
|
|
|
+ cleanIv = root.findViewById(R.id.clean_iv);
|
|
|
+ whCode = root.findViewById(R.id.wh_code);
|
|
|
+ submitBtn = root.findViewById(R.id.submit_btn);
|
|
|
+ listInOut = root.findViewById(R.id.list_in_out);
|
|
|
+ mMultipleTextView = root.findViewById(R.id.iocout_material_multiple_tv);
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
mDbManager = new DBManager(getActivity());
|
|
|
((TextView) (getActivity().findViewById(R.id.tv_actionbar_withback))).setText("出库单");
|
|
|
btn_add = root.findViewById(R.id.btn_add);
|
|
@@ -277,6 +276,40 @@ public class IOCOutMakeMaterial extends BaseFragment {
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
+ cleanIv.setOnClickListener(new View.OnClickListener() {
|
|
|
+ @Override
|
|
|
+ public void onClick(View v) {
|
|
|
+ inOutNo.getText().clear();
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ submitBtn.setOnClickListener(new View.OnClickListener() {
|
|
|
+ @Override
|
|
|
+ public void onClick(View v) {
|
|
|
+ if (TextUtils.isEmpty(inOutNo.getText().toString().trim())) {
|
|
|
+ CommonUtil.toastNoRepeat(getActivity(), "请输入出库单号");
|
|
|
+ } else if (CommonUtil.isStringContainsSpecialChar(inOutNo.getText().toString().trim())) {
|
|
|
+ CommonUtil.toastNoRepeat(getActivity(), getResources().getString(R.string.barcode_cannot_contain_special));
|
|
|
+ } else if (CommonUtil.isStringContainsSpecialChar(whCode.getText().toString().trim())) {
|
|
|
+ CommonUtil.toastNoRepeat(getActivity(), getResources().getString(R.string.whcode_cannot_contain_special));
|
|
|
+ } else {
|
|
|
+ //判断单号和仓库组合是否已经存在于变量orders中
|
|
|
+ boolean isExist = false;
|
|
|
+ for (int i = 0; i < dataList.size(); i++) {
|
|
|
+ if ((dataList.get(i).getPI_INOUTNO()).equals(inOutNo.getText().toString().trim()) && (dataList.get(i).getPD_WHCODE()).equals(whCode.getText().toString().trim())) {
|
|
|
+ isExist = true;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (isExist) {
|
|
|
+ Toast.makeText(getActivity(), "单号重复", Toast.LENGTH_SHORT).show();
|
|
|
+ reset();
|
|
|
+ } else {
|
|
|
+ submitBtnClick();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -419,7 +452,6 @@ public class IOCOutMakeMaterial extends BaseFragment {
|
|
|
CommonUtil.closeKeybord(((EditText) inOutNo), mActivity);
|
|
|
CommonUtil.closeKeybord(whCode, mActivity);
|
|
|
((TextView) (getActivity().findViewById(R.id.tv_actionbar_withback))).setText(getString(R.string.out_management));
|
|
|
- ButterKnife.unbind(this);
|
|
|
PdaApplication.putDataCache2Map(Constants.FLAG.MATERIAL_OUT_CACHE, dataList);
|
|
|
mDbManager.closeDB();
|
|
|
}
|
|
@@ -516,41 +548,6 @@ public class IOCOutMakeMaterial extends BaseFragment {
|
|
|
PdaApplication.mRequestQueue.add(stringRequest);
|
|
|
}
|
|
|
|
|
|
- @OnClick({R.id.clean_iv, R.id.submit_btn})
|
|
|
- public void onClick(View view) {
|
|
|
- switch (view.getId()) {
|
|
|
- case R.id.clean_iv:
|
|
|
- inOutNo.getText().clear();
|
|
|
- break;
|
|
|
- case R.id.submit_btn:
|
|
|
- if (TextUtils.isEmpty(inOutNo.getText().toString().trim())) {
|
|
|
- CommonUtil.toastNoRepeat(getActivity(), "请输入出库单号");
|
|
|
- } else if (CommonUtil.isStringContainsSpecialChar(inOutNo.getText().toString().trim())) {
|
|
|
- CommonUtil.toastNoRepeat(getActivity(), getResources().getString(R.string.barcode_cannot_contain_special));
|
|
|
- } else if (CommonUtil.isStringContainsSpecialChar(whCode.getText().toString().trim())) {
|
|
|
- CommonUtil.toastNoRepeat(getActivity(), getResources().getString(R.string.whcode_cannot_contain_special));
|
|
|
- } else {
|
|
|
- //判断单号和仓库组合是否已经存在于变量orders中
|
|
|
- boolean isExist = false;
|
|
|
- for (int i = 0; i < dataList.size(); i++) {
|
|
|
- if ((dataList.get(i).getPI_INOUTNO()).equals(inOutNo.getText().toString().trim()) && (dataList.get(i).getPD_WHCODE()).equals(whCode.getText().toString().trim())) {
|
|
|
- isExist = true;
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
- if (isExist) {
|
|
|
- Toast.makeText(getActivity(), "单号重复", Toast.LENGTH_SHORT).show();
|
|
|
- reset();
|
|
|
- } else {
|
|
|
- submitBtnClick();
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
private void submitBtnClick() {
|
|
|
progressDialog.show();
|
|
|
String inOutNoString = inOutNo.getText().toString();
|