|
|
@@ -60,7 +60,6 @@ class BatchOutboundFra extends BaseFragment {
|
|
|
private TextView tv_pi_inoutno;
|
|
|
private TextView tv_query;
|
|
|
private TextView tv_result;
|
|
|
- private TextView tv_search_result;
|
|
|
private TextView tv_liaohao_value, tv_daicaiji_value, tv_name_valeu, tv_spc_value,
|
|
|
tv_barcoed_value, tv_barcoed_number_value, tv_yigugxuangeshu, tv_yigouxuanshuliang;
|
|
|
private ClearableEditText cet_barcode;
|
|
|
@@ -82,7 +81,11 @@ class BatchOutboundFra extends BaseFragment {
|
|
|
private SelectAdapter myAdapter;
|
|
|
private ArrayList<InductionBean> mFeededList;
|
|
|
private ArrayList<InductionBean> mRecordList;
|
|
|
- private String barIds = "";
|
|
|
+ private String barIds = ""; //条码号
|
|
|
+ private String pi_id; //出库单
|
|
|
+ private String pd_whcode;
|
|
|
+ private String pi_class;
|
|
|
+ private String whichpage;
|
|
|
|
|
|
@Override
|
|
|
protected int getLayout() {
|
|
|
@@ -99,7 +102,6 @@ class BatchOutboundFra extends BaseFragment {
|
|
|
tv_query = root.findViewById(R.id.tv_query);
|
|
|
|
|
|
tv_result = root.findViewById(R.id.tv_result);
|
|
|
- tv_search_result = root.findViewById(R.id.tv_search_result);
|
|
|
|
|
|
tv_liaohao_value = root.findViewById(R.id.tv_liaohao_value);
|
|
|
tv_daicaiji_value = root.findViewById(R.id.tv_daicaiji_value);
|
|
|
@@ -139,11 +141,13 @@ class BatchOutboundFra extends BaseFragment {
|
|
|
bt_queren_chuku.setOnClickListener(new View.OnClickListener() {
|
|
|
@Override
|
|
|
public void onClick(View v) {
|
|
|
- if (!TextUtils.isEmpty(tv_daicaiji_value.getText().toString())) {
|
|
|
- CommonUtil.toastNoRepeat(getActivity(),"待采集数不能为空");
|
|
|
+ if (TextUtils.isEmpty(tv_daicaiji_value.getText().toString().trim())) {
|
|
|
+ CommonUtil.toastNoRepeat(getActivity(),"待采集数量不能为空");
|
|
|
+ return;
|
|
|
}
|
|
|
- if (Integer.parseInt(tv_daicaiji_value.getText().toString()) != Integer.parseInt(tv_yigouxuanshuliang.getText().toString().trim())) {
|
|
|
- CommonUtil.toastNoRepeat(getActivity(),"条码数量不等于待采集数");
|
|
|
+ if (Double.parseDouble(tv_daicaiji_value.getText().toString()) != Double.parseDouble(tv_yigouxuanshuliang.getText().toString().trim())) {
|
|
|
+ CommonUtil.toastNoRepeat(getActivity(),"已勾选数量不等于待采集数量");
|
|
|
+ return;
|
|
|
}
|
|
|
initQuerenChuku();
|
|
|
}
|
|
|
@@ -154,22 +158,31 @@ class BatchOutboundFra extends BaseFragment {
|
|
|
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
|
|
try {
|
|
|
if (buttonView.isPressed()) { //只有当用户主动点击时才处理选中状态变化
|
|
|
+ double number = 0.0;
|
|
|
+ mRecordList.clear();
|
|
|
if (isChecked) {
|
|
|
if (mFeededList.size() > 0) {
|
|
|
barIds = "";
|
|
|
for (int i = 0; i < mFeededList.size(); i++) {
|
|
|
mFeededList.get(i).setCheck(true);
|
|
|
barIds += mFeededList.get(i).getBAR_ID() + ",";
|
|
|
+ number += Double.parseDouble(mFeededList.get(i).getBAR_REMAIN());
|
|
|
+ mRecordList.add(mFeededList.get(i));
|
|
|
}
|
|
|
}
|
|
|
+ tv_yigugxuangeshu.setText(String.valueOf(mFeededList.size()));
|
|
|
} else {
|
|
|
if (mFeededList.size() > 0) {
|
|
|
barIds = "";
|
|
|
+ number = 0.0;
|
|
|
for (int i = 0; i < mFeededList.size(); i++) {
|
|
|
mFeededList.get(i).setCheck(false);
|
|
|
}
|
|
|
}
|
|
|
+ tv_yigugxuangeshu.setText("0");
|
|
|
}
|
|
|
+
|
|
|
+ tv_yigouxuanshuliang.setText(String.valueOf(number));
|
|
|
setAdapter(mFeededList);
|
|
|
myAdapter.notifyDataSetChanged();
|
|
|
}
|
|
|
@@ -188,7 +201,7 @@ class BatchOutboundFra extends BaseFragment {
|
|
|
VolleyRequest.getInstance().stringRequest(new HttpParams.Builder()
|
|
|
.url(GloableParams.ADDRESS_COFIRM_BATCH_OUT)
|
|
|
.method(Request.Method.POST)
|
|
|
- .addParam("piid", pi_inoutno)
|
|
|
+ .addParam("piid", pi_id)
|
|
|
.addParam("prodcode", pd_prodcode)
|
|
|
.addParam("barids", barIds.length() > 1 ? barIds.substring(0, barIds.length() - 1) : barIds)
|
|
|
.build(), new HttpCallback() {
|
|
|
@@ -199,7 +212,6 @@ class BatchOutboundFra extends BaseFragment {
|
|
|
tv_result.setTextColor(getResources().getColor(R.color.blue));
|
|
|
ll_query_data.setVisibility(View.GONE);
|
|
|
rl_quanxuan.setVisibility(View.GONE);
|
|
|
- tv_search_result.setVisibility(View.GONE);
|
|
|
cet_barcode.setText("");
|
|
|
try {
|
|
|
JSONObject jsonObject = new JSONObject(o.toString());
|
|
|
@@ -221,7 +233,6 @@ class BatchOutboundFra extends BaseFragment {
|
|
|
CommonUtil.toastNoRepeat(mActivity, failStr);
|
|
|
ll_query_data.setVisibility(View.GONE);
|
|
|
rl_quanxuan.setVisibility(View.GONE);
|
|
|
- tv_search_result.setVisibility(View.GONE);
|
|
|
cet_barcode.setText("");
|
|
|
tv_result.setVisibility(View.VISIBLE);
|
|
|
tv_result.setTextColor(getResources().getColor(R.color.red));
|
|
|
@@ -237,7 +248,7 @@ class BatchOutboundFra extends BaseFragment {
|
|
|
VolleyRequest.getInstance().stringRequest(new HttpParams.Builder()
|
|
|
.url(GloableParams.ADDRESS_GET_OUT_CPPROD)
|
|
|
.method(Request.Method.GET)
|
|
|
- .addParam("id", pi_inoutno)
|
|
|
+ .addParam("id", pi_id)
|
|
|
.build(), new HttpCallback() {
|
|
|
@Override
|
|
|
public void onSuccess(int flag, Object o) throws Exception {
|
|
|
@@ -248,7 +259,6 @@ class BatchOutboundFra extends BaseFragment {
|
|
|
if (success) {
|
|
|
ll_query_data.setVisibility(View.GONE);
|
|
|
rl_quanxuan.setVisibility(View.GONE);
|
|
|
- tv_search_result.setVisibility(View.GONE);
|
|
|
JSONArray dataArray = jsonObject.getJSONArray("data");
|
|
|
if (dataArray == null) {
|
|
|
CommonUtil.toastNoRepeat(mActivity, "未搜索到匹配数据");
|
|
|
@@ -265,11 +275,9 @@ class BatchOutboundFra extends BaseFragment {
|
|
|
public void onFail(int flag, String failStr) throws Exception {
|
|
|
progressDialog.dismiss();
|
|
|
CommonUtil.toastNoRepeat(mActivity, failStr);
|
|
|
-
|
|
|
ll_query_data.setVisibility(View.GONE);
|
|
|
rl_quanxuan.setVisibility(View.GONE);
|
|
|
- tv_search_result.setVisibility(View.GONE);
|
|
|
-
|
|
|
+ tv_result.setVisibility(View.VISIBLE);
|
|
|
tv_result.setTextColor(getResources().getColor(R.color.red));
|
|
|
tv_result.setText(failStr);
|
|
|
}
|
|
|
@@ -429,7 +437,7 @@ class BatchOutboundFra extends BaseFragment {
|
|
|
VolleyRequest.getInstance().stringRequest(new HttpParams.Builder()
|
|
|
.url(GloableParams.ADDRESS_GET_BARBY_CPPROD)
|
|
|
.method(Request.Method.GET)
|
|
|
- .addParam("id", pi_inoutno)
|
|
|
+ .addParam("id", pi_id)
|
|
|
.addParam("prodcode", pd_prodcode)
|
|
|
.build(), new HttpCallback() {
|
|
|
@Override
|
|
|
@@ -441,7 +449,7 @@ class BatchOutboundFra extends BaseFragment {
|
|
|
if (success) {
|
|
|
ll_query_data.setVisibility(View.VISIBLE);
|
|
|
rl_quanxuan.setVisibility(View.VISIBLE);
|
|
|
- tv_search_result.setVisibility(View.VISIBLE);
|
|
|
+ tv_result.setVisibility(View.GONE);
|
|
|
|
|
|
JSONObject data = jsonObject.getJSONObject("data");
|
|
|
|
|
|
@@ -460,14 +468,13 @@ class BatchOutboundFra extends BaseFragment {
|
|
|
tv_barcoed_value.setText("" + V_COUNT);
|
|
|
tv_barcoed_number_value.setText("" + V_REMAIN);
|
|
|
|
|
|
- tv_yigugxuangeshu.setText("" + 0);
|
|
|
- tv_yigouxuanshuliang.setText("" + 0);
|
|
|
+ tv_yigugxuangeshu.setText("0");
|
|
|
+ tv_yigouxuanshuliang.setText("0");
|
|
|
|
|
|
JSONArray dataArray = data.getJSONArray("barlist");
|
|
|
if (dataArray != null && dataArray.length() > 0) {
|
|
|
+ clearListData();
|
|
|
rl_quanxuan.setVisibility(View.VISIBLE);
|
|
|
- mFeededList.clear();
|
|
|
- barIds = "";
|
|
|
for (int i = 0; i < dataArray.length(); i++) {
|
|
|
JSONObject jsonObject1 = dataArray.getJSONObject(i);
|
|
|
InductionBean inductionBean = new InductionBean();
|
|
|
@@ -492,11 +499,9 @@ class BatchOutboundFra extends BaseFragment {
|
|
|
public void onFail(int flag, String failStr) throws Exception {
|
|
|
progressDialog.dismiss();
|
|
|
CommonUtil.toastNoRepeat(mActivity, failStr);
|
|
|
-
|
|
|
ll_query_data.setVisibility(View.GONE);
|
|
|
rl_quanxuan.setVisibility(View.GONE);
|
|
|
- tv_search_result.setVisibility(View.GONE);
|
|
|
-
|
|
|
+ tv_result.setVisibility(View.VISIBLE);
|
|
|
tv_result.setTextColor(getResources().getColor(R.color.red));
|
|
|
tv_result.setText(failStr);
|
|
|
}
|
|
|
@@ -516,7 +521,12 @@ class BatchOutboundFra extends BaseFragment {
|
|
|
protected void initDatas() {
|
|
|
Bundle bundle = getArguments();
|
|
|
if (bundle != null) {
|
|
|
+ pi_id = bundle.getString("pi_id");
|
|
|
pi_inoutno = bundle.getString("pi_inoutno");
|
|
|
+ pd_whcode = bundle.getString("pd_whcode");
|
|
|
+ //出库单
|
|
|
+ pi_class = bundle.getString("pi_class");
|
|
|
+ whichpage = bundle.getString("whichpage");
|
|
|
}
|
|
|
tv_pi_inoutno.setText(pi_inoutno);
|
|
|
|
|
|
@@ -647,12 +657,12 @@ class BatchOutboundFra extends BaseFragment {
|
|
|
@Override
|
|
|
public void onBindViewHolder(final RecyclerView.ViewHolder holder, @SuppressLint("RecyclerView") int i) {
|
|
|
//设置条目状态
|
|
|
- ((SmartShelvestFragment.SelectAdapter.ListItemViewHolder) holder).tv_date1.setText("条码:" + mList.get(i).getBAR_CODE());
|
|
|
- ((SmartShelvestFragment.SelectAdapter.ListItemViewHolder) holder).tv_date2.setText("数量:" + mList.get(i).getBAR_REMAIN());
|
|
|
+ ((SelectAdapter.ListItemViewHolder) holder).tv_date1.setText("条码:" + mList.get(i).getBAR_CODE());
|
|
|
+ ((SelectAdapter.ListItemViewHolder) holder).tv_date2.setText("数量:" + mList.get(i).getBAR_REMAIN());
|
|
|
|
|
|
- ((SmartShelvestFragment.SelectAdapter.ListItemViewHolder) holder).cb_danxuan.setChecked(mList.get(i).isCheck());
|
|
|
+ ((SelectAdapter.ListItemViewHolder) holder).cb_danxuan.setChecked(mList.get(i).isCheck());
|
|
|
|
|
|
- ((SmartShelvestFragment.SelectAdapter.ListItemViewHolder) holder).cb_danxuan.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
|
|
+ ((SelectAdapter.ListItemViewHolder) holder).cb_danxuan.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
|
|
@Override
|
|
|
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
|
|
try {
|
|
|
@@ -688,13 +698,12 @@ class BatchOutboundFra extends BaseFragment {
|
|
|
}
|
|
|
|
|
|
//添加记录统计
|
|
|
- long bar_remain = 0;
|
|
|
+ double bar_remain = 0.0;
|
|
|
for (int i1 = 0; i1 < mRecordList.size(); i1++) {
|
|
|
- bar_remain = Long.parseLong(mList.get(i1).getBAR_REMAIN());
|
|
|
- bar_remain += bar_remain;
|
|
|
+ bar_remain += Double.parseDouble(mRecordList.get(i1).getBAR_REMAIN());
|
|
|
}
|
|
|
- tv_yigugxuangeshu.setText("" + mRecordList.size());
|
|
|
- tv_yigouxuanshuliang.setText("" + bar_remain);
|
|
|
+ tv_yigugxuangeshu.setText(String.valueOf(mRecordList.size()));
|
|
|
+ tv_yigouxuanshuliang.setText(String.valueOf(bar_remain));
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
@@ -734,8 +743,12 @@ class BatchOutboundFra extends BaseFragment {
|
|
|
|
|
|
private void clearListData() {
|
|
|
rl_quanxuan.setVisibility(View.GONE);
|
|
|
+ cb_quanxuan.setChecked(false);
|
|
|
mFeededList.clear();
|
|
|
+ mRecordList.clear();
|
|
|
barIds = "";
|
|
|
+ tv_yigugxuangeshu.setText("0");
|
|
|
+ tv_yigouxuanshuliang.setText("0");
|
|
|
myAdapter.notifyDataSetChanged();
|
|
|
}
|
|
|
|