|
|
@@ -84,6 +84,7 @@ public class SCSMTFragment extends BaseFragment implements View.OnClickListener,
|
|
|
private boolean mIgnoreFocusChange = false;
|
|
|
private String mCacheLine = "";
|
|
|
private String isPasteBarcode = "";
|
|
|
+ private String line = ""; //线别
|
|
|
|
|
|
@Override
|
|
|
protected int getLayout() {
|
|
|
@@ -160,25 +161,27 @@ public class SCSMTFragment extends BaseFragment implements View.OnClickListener,
|
|
|
}
|
|
|
});
|
|
|
|
|
|
- etLineCode.setOnFocusChangeListener(new View.OnFocusChangeListener() {
|
|
|
- @Override
|
|
|
- public void onFocusChange(View v, boolean hasFocus) {
|
|
|
- if (!hasFocus && isVisible() && !mIgnoreFocusChange) {
|
|
|
- String lineCode = etLineCode.getText().toString().trim();
|
|
|
- if (TextUtils.isEmpty(lineCode)) {
|
|
|
- CommonUtil.toastNoRepeat(mActivity, "请输入线别");
|
|
|
- etLineCode.postDelayed(new Runnable() {
|
|
|
- @Override
|
|
|
- public void run() {
|
|
|
- etLineCode.requestFocus();
|
|
|
- }
|
|
|
- }, 100);
|
|
|
- } else {
|
|
|
- getLineInfo(lineCode);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
+// etLineCode.setOnFocusChangeListener(new View.OnFocusChangeListener() {
|
|
|
+// @Override
|
|
|
+// public void onFocusChange(View v, boolean hasFocus) {
|
|
|
+// if (!hasFocus && isVisible() && !mIgnoreFocusChange) {
|
|
|
+// String lineCode = etLineCode.getText().toString().trim();
|
|
|
+// line = lineCode;
|
|
|
+// if (TextUtils.isEmpty(lineCode)) {
|
|
|
+// CommonUtil.toastNoRepeat(mActivity, "请输入线别");
|
|
|
+// etLineCode.postDelayed(new Runnable() {
|
|
|
+// @Override
|
|
|
+// public void run() {
|
|
|
+// etLineCode.requestFocus();
|
|
|
+// }
|
|
|
+// }, 100);
|
|
|
+// } else {
|
|
|
+// getLineInfo(lineCode);
|
|
|
+// getPasteBarcodeData(lineCode,"","");
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+// });
|
|
|
|
|
|
etLineCode.setOnEditorActionListener(new TextView.OnEditorActionListener() {
|
|
|
@Override
|
|
|
@@ -188,11 +191,13 @@ public class SCSMTFragment extends BaseFragment implements View.OnClickListener,
|
|
|
|| actionId == EditorInfo.IME_ACTION_GO
|
|
|
|| (event != null && event.getAction() == KeyEvent.ACTION_DOWN && event.getKeyCode() == KeyEvent.KEYCODE_ENTER)) {
|
|
|
String devCode = etLineCode.getText().toString().trim();
|
|
|
+ line = devCode;
|
|
|
if (TextUtils.isEmpty(devCode)) {
|
|
|
CommonUtil.toastNoRepeat(mActivity, "请输入线别");
|
|
|
} else {
|
|
|
mIgnoreFocusChange = true;
|
|
|
getLineInfo(devCode);
|
|
|
+ getPasteBarcodeData(devCode,"","");
|
|
|
}
|
|
|
return true;
|
|
|
}
|
|
|
@@ -209,7 +214,7 @@ public class SCSMTFragment extends BaseFragment implements View.OnClickListener,
|
|
|
|| (event != null && event.getAction() == KeyEvent.ACTION_DOWN && event.getKeyCode() == KeyEvent.KEYCODE_ENTER)) {
|
|
|
//disposeClick();
|
|
|
String trim = etJobCode.getText().toString().trim();
|
|
|
- getPasteBarcodeData(trim,isPasteBarcode);
|
|
|
+ getPasteBarcodeData("",trim,"");
|
|
|
return true;
|
|
|
}
|
|
|
return false;
|
|
|
@@ -234,12 +239,13 @@ public class SCSMTFragment extends BaseFragment implements View.OnClickListener,
|
|
|
});
|
|
|
}
|
|
|
|
|
|
- private void getPasteBarcodeData(String wo,String isPasteBarcode) {
|
|
|
+ private void getPasteBarcodeData(String line,String wo,String isPasteBarcode) {
|
|
|
progressDialog.show();
|
|
|
VolleyRequest.getInstance().stringRequest(mStringRequest,
|
|
|
new HttpParams.Builder()
|
|
|
.url(GloableParams.ADDRESS_GET_PASTE_BARCODE)
|
|
|
.method(Request.Method.POST)
|
|
|
+ .addParam("line",line)
|
|
|
.addParam("wo",wo)
|
|
|
.addParam("res", isPasteBarcode)
|
|
|
.build(), new HttpCallback() {
|
|
|
@@ -249,8 +255,10 @@ public class SCSMTFragment extends BaseFragment implements View.OnClickListener,
|
|
|
com.alibaba.fastjson.JSONObject resultObject = JSON.parseObject(result);
|
|
|
com.alibaba.fastjson.JSONObject dataObject = resultObject.getJSONObject("data");
|
|
|
if (dataObject != null) {
|
|
|
- String pr_tm_user = dataObject.getString("PR_TM_USER");
|
|
|
- if (pr_tm_user.equals("是")) {
|
|
|
+ String pr_tm_user = dataObject.getString("pr_tm_user");
|
|
|
+ if(TextUtils.isEmpty(pr_tm_user)) {
|
|
|
+ rg_tietiaoma.check(R.id.rb_no);
|
|
|
+ }else if (pr_tm_user.equals("是")) {
|
|
|
rg_tietiaoma.check(R.id.rb_ok);
|
|
|
}else if (pr_tm_user.equals("否")){
|
|
|
rg_tietiaoma.check(R.id.rb_no);
|
|
|
@@ -319,7 +327,7 @@ public class SCSMTFragment extends BaseFragment implements View.OnClickListener,
|
|
|
mLineInfo.setDL_PRODCODE(JsonUtils.optStringNotNull(dataObject, "DL_PRODCODE"));
|
|
|
|
|
|
PdaApplication.putDataCache2Map(Constants.FLAG.SMT_DEVICE_LINE_CACHE, mLineInfo);
|
|
|
- gotoSMTContentFragment();
|
|
|
+ //gotoSMTContentFragment();
|
|
|
} else {
|
|
|
CommonUtil.toastNoRepeat(mActivity, "请录入工单号或产品代码!");
|
|
|
etJobCode.requestFocus();
|
|
|
@@ -479,7 +487,7 @@ public class SCSMTFragment extends BaseFragment implements View.OnClickListener,
|
|
|
//如果prepare为null
|
|
|
if (isPrepareNull) {
|
|
|
//跳转页面
|
|
|
- gotoSMTContentFragment();
|
|
|
+// gotoSMTContentFragment();
|
|
|
return;
|
|
|
}
|
|
|
//如果prepare不为null,获取备料单
|
|
|
@@ -546,7 +554,7 @@ public class SCSMTFragment extends BaseFragment implements View.OnClickListener,
|
|
|
return;
|
|
|
} else {
|
|
|
//如果取消
|
|
|
- gotoSMTContentFragment();
|
|
|
+// gotoSMTContentFragment();
|
|
|
closeConfirmDialog();
|
|
|
}
|
|
|
}
|
|
|
@@ -614,7 +622,7 @@ public class SCSMTFragment extends BaseFragment implements View.OnClickListener,
|
|
|
//导入备料单数据
|
|
|
case VolleyUtil.FRAGMENT_SCMAKE_SMTMPDATA:
|
|
|
closeConfirmDialog();
|
|
|
- gotoSMTContentFragment();
|
|
|
+// gotoSMTContentFragment();
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
@@ -629,11 +637,12 @@ public class SCSMTFragment extends BaseFragment implements View.OnClickListener,
|
|
|
@Override
|
|
|
public void onClick(View v) {
|
|
|
String trim = etJobCode.getText().toString().trim();
|
|
|
- getPasteBarcodeData(trim,isPasteBarcode);
|
|
|
+ getPasteBarcodeData(line,trim,isPasteBarcode);
|
|
|
// disposeClick();
|
|
|
// confirmDevice();
|
|
|
String lineCode = etLineCode.getText().toString().trim();
|
|
|
getLineInfo(lineCode);
|
|
|
+ gotoSMTContentFragment();
|
|
|
}
|
|
|
|
|
|
private void confirmDevice() {
|
|
|
@@ -679,7 +688,7 @@ public class SCSMTFragment extends BaseFragment implements View.OnClickListener,
|
|
|
mLineInfo.setDL_PRODCODE(JsonUtils.optStringNotNull(dataObject, "DL_PRODCODE"));
|
|
|
|
|
|
PdaApplication.putDataCache2Map(Constants.FLAG.SMT_DEVICE_LINE_CACHE, mLineInfo);
|
|
|
- gotoSMTContentFragment();
|
|
|
+// gotoSMTContentFragment();
|
|
|
} else {
|
|
|
etJobCode.requestFocus();
|
|
|
}
|