|
@@ -0,0 +1,453 @@
|
|
|
|
|
+package com.uas.pda_smart_com_lg.fragment;
|
|
|
|
|
+
|
|
|
|
|
+import android.content.Context;
|
|
|
|
|
+import android.graphics.drawable.BitmapDrawable;
|
|
|
|
|
+import android.os.Bundle;
|
|
|
|
|
+import android.text.Editable;
|
|
|
|
|
+import android.text.TextUtils;
|
|
|
|
|
+import android.text.TextWatcher;
|
|
|
|
|
+import android.view.Gravity;
|
|
|
|
|
+import android.view.KeyEvent;
|
|
|
|
|
+import android.view.LayoutInflater;
|
|
|
|
|
+import android.view.View;
|
|
|
|
|
+import android.view.ViewGroup;
|
|
|
|
|
+import android.view.inputmethod.EditorInfo;
|
|
|
|
|
+import android.view.inputmethod.InputMethodManager;
|
|
|
|
|
+import android.widget.AdapterView;
|
|
|
|
|
+import android.widget.ArrayAdapter;
|
|
|
|
|
+import android.widget.AutoCompleteTextView;
|
|
|
|
|
+import android.widget.Button;
|
|
|
|
|
+import android.widget.EditText;
|
|
|
|
|
+import android.widget.ImageView;
|
|
|
|
|
+import android.widget.LinearLayout;
|
|
|
|
|
+import android.widget.ListView;
|
|
|
|
|
+import android.widget.PopupWindow;
|
|
|
|
|
+import android.widget.TextView;
|
|
|
|
|
+import android.widget.Toast;
|
|
|
|
|
+
|
|
|
|
|
+import com.alibaba.fastjson.JSON;
|
|
|
|
|
+import com.alibaba.fastjson.JSONArray;
|
|
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
|
|
+import com.uas.pda_smart_com_lg.R;
|
|
|
|
|
+import com.uas.pda_smart_com_lg.activity.FunctionActivity;
|
|
|
|
|
+import com.uas.pda_smart_com_lg.application.PdaApplication;
|
|
|
|
|
+import com.uas.pda_smart_com_lg.bean.IOCOutMakeMaterialFuzzySearch;
|
|
|
|
|
+import com.uas.pda_smart_com_lg.bean.StorageInBillBean;
|
|
|
|
|
+import com.uas.pda_smart_com_lg.global.GloableParams;
|
|
|
|
|
+import com.uas.pda_smart_com_lg.util.CommonUtil;
|
|
|
|
|
+import com.uas.pda_smart_com_lg.util.Constants;
|
|
|
|
|
+import com.uas.pda_smart_com_lg.util.FastjsonUtil;
|
|
|
|
|
+import com.uas.pda_smart_com_lg.util.FragmentUtils;
|
|
|
|
|
+import com.uas.pda_smart_com_lg.util.HttpCallback;
|
|
|
|
|
+import com.uas.pda_smart_com_lg.util.HttpParams;
|
|
|
|
|
+import com.uas.pda_smart_com_lg.util.JsonTools;
|
|
|
|
|
+import com.uas.pda_smart_com_lg.util.MyArrayAdapter;
|
|
|
|
|
+import com.uas.pda_smart_com_lg.util.VolleyRequest;
|
|
|
|
|
+
|
|
|
|
|
+import java.io.UnsupportedEncodingException;
|
|
|
|
|
+import java.net.URLEncoder;
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
|
|
+import java.util.List;
|
|
|
|
|
+
|
|
|
|
|
+import butterknife.ButterKnife;
|
|
|
|
|
+
|
|
|
|
|
+/**
|
|
|
|
|
+ * Created by RaoMeng on 2024/7/2
|
|
|
|
|
+ * Desc: 工单物料核对
|
|
|
|
|
+ */
|
|
|
|
|
+public class WorkOrderMaterialCheckFragment extends BaseFragment {
|
|
|
|
|
+ private AutoCompleteTextView mNumEdittext;
|
|
|
|
|
+ private ImageView mCleanIv;
|
|
|
|
|
+ private Button mSubmitButton;
|
|
|
|
|
+ private ListView mNumListView;
|
|
|
|
|
+ private InputMethodManager mInputMethodManager;
|
|
|
|
|
+ private AdapterListView adapterListView;
|
|
|
|
|
+ private IOCOutMakeMaterialFuzzySearch fuzzySearchData;
|
|
|
|
|
+ private MyArrayAdapter<String> fuzzyStringAdapter;
|
|
|
|
|
+ private List<StorageInBillBean> mBillList;
|
|
|
|
|
+ private PopupWindow listViewPopupWindow;
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ protected int getLayout() {
|
|
|
|
|
+ return R.layout.fragment_inventory_bill;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ protected void initViews() {
|
|
|
|
|
+ ((FunctionActivity) getActivity()).setTitle("工单物料核对");
|
|
|
|
|
+
|
|
|
|
|
+ mNumEdittext = root.findViewById(R.id.inventory_bill_num_et);
|
|
|
|
|
+ mCleanIv = root.findViewById(R.id.inventory_bill_clear_iv);
|
|
|
|
|
+ mSubmitButton = root.findViewById(R.id.inventory_bill_submit_btn);
|
|
|
|
|
+ mNumListView = root.findViewById(R.id.inventory_bill_list_lv);
|
|
|
|
|
+
|
|
|
|
|
+ //弹出软键盘
|
|
|
|
|
+ mInputMethodManager = (InputMethodManager) root.getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
|
|
|
|
|
+ mInputMethodManager.toggleSoftInput(0, InputMethodManager.HIDE_NOT_ALWAYS);
|
|
|
|
|
+ mNumEdittext.requestFocus();
|
|
|
|
|
+ mNumEdittext.setThreshold(1);
|
|
|
|
|
+
|
|
|
|
|
+ mBillList = (List<StorageInBillBean>) PdaApplication.getDataCacheFromMap(Constants.FLAG.INVENTORY_BILL_LIST_CACHE);
|
|
|
|
|
+ if (mBillList == null || mBillList.size() == 0) {
|
|
|
|
|
+ mBillList = new ArrayList<>();
|
|
|
|
|
+ adapterListView = new AdapterListView(getActivity(), R.layout.item_inventory_bill_list, mBillList);
|
|
|
|
|
+ mNumListView.setAdapter(adapterListView);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ adapterListView = new AdapterListView(getActivity(), R.layout.item_inventory_bill_list, mBillList);
|
|
|
|
|
+ mNumListView.setAdapter(adapterListView);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ protected void initEvents() {
|
|
|
|
|
+ mCleanIv.setOnClickListener(new View.OnClickListener() {
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void onClick(View v) {
|
|
|
|
|
+ mNumEdittext.setText("");
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ mNumListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
|
|
|
|
|
+ rowClickEvent(i);
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ mNumListView.setOnItemLongClickListener(new AdapterView.OnItemLongClickListener() {
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public boolean onItemLongClick(AdapterView<?> adapterView, View view, int i, long l) {
|
|
|
|
|
+ //把listView 的item传过去
|
|
|
|
|
+ showListPopupWindow(i);
|
|
|
|
|
+ return true;
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ mNumEdittext.addTextChangedListener(inOutNoTextWatcher);
|
|
|
|
|
+
|
|
|
|
|
+ mNumEdittext.setOnItemClickListener(new AdapterView.OnItemClickListener() {
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
|
|
|
|
|
+ getStockChecks();
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ mNumEdittext.setOnEditorActionListener(new TextView.OnEditorActionListener() {
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
|
|
|
|
|
+ if (actionId == EditorInfo.IME_ACTION_SEND
|
|
|
|
|
+ || actionId == EditorInfo.IME_ACTION_SEARCH
|
|
|
|
|
+ || actionId == EditorInfo.IME_ACTION_DONE
|
|
|
|
|
+ || (event != null && event.getAction() == KeyEvent.ACTION_DOWN && event.getKeyCode() == KeyEvent.KEYCODE_ENTER)) {
|
|
|
|
|
+ getStockChecks();
|
|
|
|
|
+ return true;
|
|
|
|
|
+ }
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ mSubmitButton.setOnClickListener(new View.OnClickListener() {
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void onClick(View v) {
|
|
|
|
|
+ getStockChecks();
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ private void getStockChecks() {
|
|
|
|
|
+ if (TextUtils.isEmpty(mNumEdittext.getText().toString().trim())) {
|
|
|
|
|
+ CommonUtil.toastNoRepeat(getActivity(), "请输入盘点单号");
|
|
|
|
|
+ } else if (CommonUtil.isStringContainsSpecialChar(mNumEdittext.getText().toString().trim())) {
|
|
|
|
|
+ CommonUtil.toastNoRepeat(getActivity(), getResources().getString(R.string.barcode_cannot_contain_special));
|
|
|
|
|
+ } else {
|
|
|
|
|
+ //判断单号和仓库组合是否已经存在于变量orders中
|
|
|
|
|
+ boolean isExist = false;
|
|
|
|
|
+ for (int i = 0; i < mBillList.size(); i++) {
|
|
|
|
|
+ if ((mBillList.get(i).getPI_INOUTNO()).equals(mNumEdittext.getText().toString().trim())) {
|
|
|
|
|
+ isExist = true;
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ if (isExist) {
|
|
|
|
|
+ Toast.makeText(getActivity(), "单号重复", Toast.LENGTH_SHORT).show();
|
|
|
|
|
+ reset();
|
|
|
|
|
+ } else {
|
|
|
|
|
+ submitBtnClick();
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ protected void initDatas() {
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ private TextWatcher inOutNoTextWatcher = new TextWatcher() {
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
|
|
|
|
|
+ //当字数超过3个,自动弹出输入提示框
|
|
|
|
|
+ if (charSequence.length() >= 3) {
|
|
|
|
|
+ if (!charSequence.toString().matches(Constants.REGEX.NO_SYMBOL)) {
|
|
|
|
|
+ CommonUtil.toastNoRepeat(getActivity(), getResources().getString(R.string.note_number_cannot_contain_special));
|
|
|
|
|
+ mNumEdittext.setText(null);
|
|
|
|
|
+ mNumEdittext.requestFocus();
|
|
|
|
|
+ } else {
|
|
|
|
|
+ fuzzySearch();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void afterTextChanged(Editable editable) {
|
|
|
|
|
+ if (mSubmitButton != null) {
|
|
|
|
|
+ if (editable.length() == 0) {
|
|
|
|
|
+ mSubmitButton.setEnabled(false);
|
|
|
|
|
+ mCleanIv.setVisibility(View.GONE);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ mSubmitButton.setEnabled(true);
|
|
|
|
|
+ mCleanIv.setVisibility(View.VISIBLE);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ //根据输入字母请求订单号,模糊搜索
|
|
|
|
|
+ private void fuzzySearch() {
|
|
|
|
|
+ String url = null;
|
|
|
|
|
+ try {
|
|
|
|
|
+ url = GloableParams.ADDRESS_OUTFUZZYSEARCH
|
|
|
|
|
+ + "?inoutNo=" + URLEncoder.encode(mNumEdittext.getText().toString().toLowerCase(), "utf-8");
|
|
|
|
|
+ } catch (UnsupportedEncodingException e) {
|
|
|
|
|
+ e.printStackTrace();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ VolleyRequest.getInstance().stringRequest(new HttpParams.Builder()
|
|
|
|
|
+ .url(url)
|
|
|
|
|
+ .tag(TAG + "fuzzysearch")
|
|
|
|
|
+ .flag(0)
|
|
|
|
|
+ .build(), new HttpCallback() {
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void onSuccess(int flag, Object o) throws Exception {
|
|
|
|
|
+ String result = o.toString();
|
|
|
|
|
+ List<String> autoStrings = new ArrayList<>();
|
|
|
|
|
+ fuzzySearchData = JsonTools.parseJsonToBean(result, IOCOutMakeMaterialFuzzySearch.class);
|
|
|
|
|
+ if (fuzzySearchData.getData() == null) {
|
|
|
|
|
+ } else {
|
|
|
|
|
+ autoStrings.clear();
|
|
|
|
|
+ fuzzyStringAdapter = new MyArrayAdapter<String>(mActivity, android.R.layout.simple_dropdown_item_1line, autoStrings);
|
|
|
|
|
+ if (mNumEdittext != null) {
|
|
|
|
|
+ mNumEdittext.setAdapter(fuzzyStringAdapter);
|
|
|
|
|
+ }
|
|
|
|
|
+ for (int i = 0; i < fuzzySearchData.getData().size(); i++) {
|
|
|
|
|
+ fuzzyStringAdapter.add(fuzzySearchData.getData().get(i).getPI_INOUTNO());
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void onFail(int flag, String failStr) throws Exception {
|
|
|
|
|
+ reset();
|
|
|
|
|
+ CommonUtil.toastNoRepeat(mActivity, failStr);
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ private void submitBtnClick() {
|
|
|
|
|
+ progressDialog.show();
|
|
|
|
|
+ String inOutNoString = mNumEdittext.getText().toString();
|
|
|
|
|
+ if (TextUtils.isEmpty(mNumEdittext.getText().toString())) {
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ //发送请求至服务器进行确认
|
|
|
|
|
+ String url = null;
|
|
|
|
|
+ try {
|
|
|
|
|
+ url = GloableParams.ADDRESS_OUTGETPRODOUT
|
|
|
|
|
+ + "?inoutNo=" + URLEncoder.encode(inOutNoString, "utf-8");
|
|
|
|
|
+ } catch (UnsupportedEncodingException e) {
|
|
|
|
|
+ url = GloableParams.ADDRESS_OUTGETPRODOUT
|
|
|
|
|
+ + "?inoutNo=" + inOutNoString;
|
|
|
|
|
+ e.printStackTrace();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ VolleyRequest.getInstance().stringRequest(new HttpParams.Builder()
|
|
|
|
|
+ .url(url)
|
|
|
|
|
+ .tag(TAG + "getprodout")
|
|
|
|
|
+ .flag(0)
|
|
|
|
|
+ .build(), new HttpCallback() {
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void onSuccess(int flag, Object o) throws Exception {
|
|
|
|
|
+ progressDialog.dismiss();
|
|
|
|
|
+ try {
|
|
|
|
|
+ String result = o.toString();
|
|
|
|
|
+ JSONObject resultObject = JSON.parseObject(result);
|
|
|
|
|
+ JSONArray dataArray = resultObject.getJSONArray("data");
|
|
|
|
|
+ if (dataArray == null || dataArray.size() <= 0) {
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ JSONObject dataObject = dataArray.getJSONObject(0);
|
|
|
|
|
+ StorageInBillBean billBean = new StorageInBillBean();
|
|
|
|
|
+ billBean.setPI_INOUTNO(FastjsonUtil.getText(dataObject, "PI_INOUTNO"));
|
|
|
|
|
+ billBean.setPI_CLASS(FastjsonUtil.getText(dataObject, "PI_CLASS"));
|
|
|
|
|
+ billBean.setPI_CARDCODE(FastjsonUtil.getText(dataObject, "PI_CARDCODE"));
|
|
|
|
|
+ billBean.setPI_ID(FastjsonUtil.getLong(dataObject, "PI_ID"));
|
|
|
|
|
+ billBean.setPI_PDASTATUS(FastjsonUtil.getText(dataObject, "PI_PDASTATUS"));
|
|
|
|
|
+ billBean.setPI_STATUS(FastjsonUtil.getText(dataObject, "PI_STATUSCODE"));
|
|
|
|
|
+
|
|
|
|
|
+ //判断单号和仓库组合是否已经存在于变量orders中
|
|
|
|
|
+ for (int i = 0; i < mBillList.size(); i++) {
|
|
|
|
|
+ if (!TextUtils.isEmpty(billBean.getPI_INOUTNO())
|
|
|
|
|
+ && billBean.getPI_INOUTNO().equals(mBillList.get(i).getPI_INOUTNO())) {
|
|
|
|
|
+ Toast.makeText(getActivity(), "单号重复", Toast.LENGTH_SHORT).show();
|
|
|
|
|
+ reset();
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ mBillList.add(0, billBean);
|
|
|
|
|
+ adapterListView.notifyDataSetChanged();
|
|
|
|
|
+ if (getActivity() != null) {
|
|
|
|
|
+ mNumEdittext.getText().clear();
|
|
|
|
|
+ CommonUtil.closeKeybord(((EditText) mNumEdittext), mActivity);
|
|
|
|
|
+ if (progressDialog.isShowing())
|
|
|
|
|
+ progressDialog.dismiss();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void onFail(int flag, String failStr) throws Exception {
|
|
|
|
|
+ progressDialog.dismiss();
|
|
|
|
|
+ if (failStr != null) {
|
|
|
|
|
+ CommonUtil.toastNoRepeat(mActivity, failStr);
|
|
|
|
|
+ }
|
|
|
|
|
+ reset();
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ private void showListPopupWindow(final int i) {
|
|
|
|
|
+ //点击删除移除ataList.get(i)数据
|
|
|
|
|
+ View view = LayoutInflater.from(getActivity()).inflate(R.layout.popupwindow_ioc_out_make_material_listview, null);
|
|
|
|
|
+ Button deleteBtn = (Button) view.findViewById(R.id.delete);
|
|
|
|
|
+ Button againBtn = (Button) view.findViewById(R.id.again);
|
|
|
|
|
+ againBtn.setVisibility(View.GONE);
|
|
|
|
|
+ deleteBtn.setOnClickListener(new View.OnClickListener() {
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void onClick(View view) {
|
|
|
|
|
+ deleteEvent(i);
|
|
|
|
|
+ closeListPopupWindow();
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ listViewPopupWindow = new PopupWindow(view, LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT, true);
|
|
|
|
|
+ listViewPopupWindow.setAnimationStyle(R.style.MenuAnimationFade);
|
|
|
|
|
+ listViewPopupWindow.setBackgroundDrawable(new BitmapDrawable());
|
|
|
|
|
+ CommonUtil.setBackgroundAlpha(mActivity, 0.5f);
|
|
|
|
|
+ listViewPopupWindow.setOnDismissListener(new PopupWindow.OnDismissListener() {
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void onDismiss() {
|
|
|
|
|
+ closeListPopupWindow();
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ listViewPopupWindow.showAtLocation(mSubmitButton, Gravity.CENTER, 0, 0);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ //关闭listView的PopupWindow
|
|
|
|
|
+ private void closeListPopupWindow() {
|
|
|
|
|
+ if (listViewPopupWindow != null) {
|
|
|
|
|
+ listViewPopupWindow.dismiss();
|
|
|
|
|
+ listViewPopupWindow = null;
|
|
|
|
|
+ CommonUtil.setBackgroundAlpha(mActivity, 1f);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 删除单据
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param position
|
|
|
|
|
+ */
|
|
|
|
|
+ private void deleteEvent(final int position) {
|
|
|
|
|
+ try {
|
|
|
|
|
+ mBillList.remove(position);
|
|
|
|
|
+ adapterListView.notifyDataSetChanged();
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
+ e.printStackTrace();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ private void rowClickEvent(final int i) {
|
|
|
|
|
+ String pi_inoutno = mBillList.get(i).getPI_INOUTNO();
|
|
|
|
|
+ long pi_id = mBillList.get(i).getPI_ID();
|
|
|
|
|
+ String pi_class = mBillList.get(i).getPI_CLASS();
|
|
|
|
|
+ WorkOrderCollectFragment collectFragment = new WorkOrderCollectFragment();
|
|
|
|
|
+
|
|
|
|
|
+ Bundle bundle = new Bundle();
|
|
|
|
|
+ bundle.putString("pi_inoutno", pi_inoutno);
|
|
|
|
|
+ bundle.putString("pi_id", pi_id + "");
|
|
|
|
|
+ bundle.putString("pi_class", pi_class);
|
|
|
|
|
+
|
|
|
|
|
+ collectFragment.setArguments(bundle);
|
|
|
|
|
+
|
|
|
|
|
+ FragmentUtils.switchFragment(WorkOrderMaterialCheckFragment.this, collectFragment);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public boolean onKeyDown(int keyCode, KeyEvent event) {
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public boolean onFragmentBackPressed() {
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void onDestroyView() {
|
|
|
|
|
+ super.onDestroyView();
|
|
|
|
|
+
|
|
|
|
|
+ CommonUtil.closeKeybord(((EditText) mNumEdittext), mActivity);
|
|
|
|
|
+ ButterKnife.unbind(this);
|
|
|
|
|
+ PdaApplication.putDataCache2Map(Constants.FLAG.INVENTORY_BILL_LIST_CACHE, mBillList);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public void reset() {
|
|
|
|
|
+ if (getActivity() != null) {
|
|
|
|
|
+ mNumEdittext.getText().clear();
|
|
|
|
|
+ CommonUtil.editTextGetFocus(mNumEdittext);
|
|
|
|
|
+ CommonUtil.openKeybord(((EditText) mNumEdittext), mActivity);
|
|
|
|
|
+ if (progressDialog.isShowing())
|
|
|
|
|
+ progressDialog.dismiss();
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 页面listview 设置适配器
|
|
|
|
|
+ */
|
|
|
|
|
+ private class AdapterListView extends ArrayAdapter<StorageInBillBean> {
|
|
|
|
|
+ private int resourceId;
|
|
|
|
|
+
|
|
|
|
|
+ public AdapterListView(Context context, int resource, List<StorageInBillBean> objects) {
|
|
|
|
|
+ super(context, resource, objects);
|
|
|
|
|
+ resourceId = resource;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public View getView(int position, View convertView, ViewGroup parent) {
|
|
|
|
|
+ StorageInBillBean data = getItem(position);
|
|
|
|
|
+ convertView = LayoutInflater.from(getContext()).inflate(resourceId, null);
|
|
|
|
|
+
|
|
|
|
|
+ ((TextView) convertView.findViewById(R.id.item_inventory_bill_num_tv)).setText(data.getPI_INOUTNO());
|
|
|
|
|
+
|
|
|
|
|
+ return convertView;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+}
|