|
@@ -43,6 +43,7 @@ import com.fxy.baselibrary.util.JsonUtil;
|
|
|
import com.fxy.baselibrary.views.MarqueeTextView;
|
|
|
import com.fxy.bean.ActionBean;
|
|
|
import com.fxy.bean.ScanBean;
|
|
|
+import com.fxy.common.CommonDialog;
|
|
|
import com.fxy.common.PictureSelectorUpload;
|
|
|
import com.fxy.constant.BaseConfig;
|
|
|
import com.fxy.constant.EventCode;
|
|
@@ -121,6 +122,14 @@ public class SortationMainActivity extends BaseActivity implements StoJNI.ScanC
|
|
|
|
|
|
private PictureSelectorUpload pictureSelectorUpload;
|
|
|
|
|
|
+ private CommonDialog commonDialog;
|
|
|
+
|
|
|
+ //是否需要显示客户
|
|
|
+ private boolean needCustomer;
|
|
|
+
|
|
|
+ //客户名称
|
|
|
+ private String customerCode="";
|
|
|
+
|
|
|
//这个表示需要调拍照功能
|
|
|
private boolean needPictures;
|
|
|
|
|
@@ -196,6 +205,7 @@ public class SortationMainActivity extends BaseActivity implements StoJNI.ScanC
|
|
|
setTitleName("入库分拣");
|
|
|
|
|
|
initData();
|
|
|
+ initDialog();
|
|
|
initEdit();
|
|
|
//监听浮动按钮
|
|
|
iv_drag.setOnClickListener(new View.OnClickListener() {
|
|
@@ -240,6 +250,28 @@ public class SortationMainActivity extends BaseActivity implements StoJNI.ScanC
|
|
|
}
|
|
|
|
|
|
|
|
|
+ private void initDialog(){
|
|
|
+ commonDialog = new CommonDialog(mContext, R.style.dialog, "need_customer", new CommonDialog.OnCloseListener() {
|
|
|
+ @Override
|
|
|
+ public void onClickCancel(Dialog dialog, boolean confirm) {
|
|
|
+ customerCode = "" ;
|
|
|
+ dialog.dismiss();
|
|
|
+ }
|
|
|
+ @Override
|
|
|
+ public void onClickSubmit(Dialog dialog, boolean confirm) {
|
|
|
+ String string = commonDialog.contentTxt.getText().toString().trim();
|
|
|
+ if (commonDialog.getTypeCode().equals("need_customer")){
|
|
|
+ customerCode = string;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ doPutIn();
|
|
|
+
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
|
@@ -429,6 +461,7 @@ public class SortationMainActivity extends BaseActivity implements StoJNI.ScanC
|
|
|
}
|
|
|
|
|
|
public void firstPutIn(){
|
|
|
+ clearData(false);
|
|
|
if(!checkNull(etOrderNo)){
|
|
|
setEditTextFocused(etOrderNo,true);
|
|
|
showWarningToast(etOrderNo.getHint().toString());
|
|
@@ -462,6 +495,10 @@ public class SortationMainActivity extends BaseActivity implements StoJNI.ScanC
|
|
|
param.put("is_hold",isHold);
|
|
|
}
|
|
|
|
|
|
+ if (needCustomer){
|
|
|
+ param.put("customer_code","FX"+customerCode);
|
|
|
+ }
|
|
|
+
|
|
|
if (!checkRepeat(Urls.FXY_GROUP_PCS+(param.toString()))){return;}
|
|
|
|
|
|
OkGo.<String>post(Urls.getServiceAddress(this) + Urls.FXY_GROUP_PCS)
|
|
@@ -482,7 +519,9 @@ public class SortationMainActivity extends BaseActivity implements StoJNI.ScanC
|
|
|
if(bean.code == 1){
|
|
|
showSuccessToast(bean.msg,voiceName);
|
|
|
llPicturesBox.setVisibility(View.GONE);
|
|
|
- clearData(false);
|
|
|
+
|
|
|
+ clearData(true);
|
|
|
+
|
|
|
}else{
|
|
|
|
|
|
showWarningToast(bean.msg,voiceName);
|
|
@@ -497,6 +536,9 @@ public class SortationMainActivity extends BaseActivity implements StoJNI.ScanC
|
|
|
llPicturesBox.setVisibility(View.VISIBLE);
|
|
|
pictureSelectorUpload.authCamera();
|
|
|
|
|
|
+ }else if (result.has("tag") && result.getString("tag").equals("input_customer_code")){
|
|
|
+ needCustomer = true;
|
|
|
+ commonDialog.setTitle("客户编号","请输入客户编号").setContent("").show();
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -529,6 +571,17 @@ public class SortationMainActivity extends BaseActivity implements StoJNI.ScanC
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ if (needCustomer) {
|
|
|
+ if (customerCode.isEmpty()){
|
|
|
+ commonDialog.setTitle("客户编号","请输入客户编号")
|
|
|
+ .setTypeCode("need_customer")
|
|
|
+ .setContent("")
|
|
|
+ .show();
|
|
|
+ showWarningToast("请输入客户编号");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
return true;
|
|
|
}
|
|
|
|
|
@@ -557,19 +610,28 @@ public class SortationMainActivity extends BaseActivity implements StoJNI.ScanC
|
|
|
}
|
|
|
//清除订单信息
|
|
|
private void clearData(boolean isAll) {
|
|
|
- etOrderNo.setText("");
|
|
|
+ if (isAll){
|
|
|
+ etOrderNo.setText("");
|
|
|
+ }
|
|
|
+ if (needCustomer){
|
|
|
+ commonDialog.closeDialog(false);
|
|
|
+ }
|
|
|
+
|
|
|
needPictures = false;
|
|
|
+ needCustomer = false;
|
|
|
+ customerCode = "";
|
|
|
isHold = 0;
|
|
|
- setEditTextNormal(etOrderNo,true);
|
|
|
pictureSelectorUpload.emptyRemake();//清空图片
|
|
|
cbIsHold.setChecked(false);
|
|
|
photoList.clear();
|
|
|
}
|
|
|
|
|
|
- @OnClick({})
|
|
|
+ @OnClick({R.id.add_tally})
|
|
|
public void onViewClicked(View view) {
|
|
|
Bundle bundle = new Bundle();
|
|
|
switch (view.getId()) {
|
|
|
+ case R.id.add_tally:
|
|
|
+ doPutIn();
|
|
|
default:
|
|
|
break;
|
|
|
}
|