|
|
@@ -86,28 +86,41 @@ public class VisitReportAddActivity extends BaseActivity implements View.OnClick
|
|
|
}
|
|
|
|
|
|
private void initListener() {
|
|
|
- if (getIntent().getBooleanExtra("isMe", true)) {
|
|
|
- tv_date_start.setOnClickListener(this);
|
|
|
- tv_date_end.setOnClickListener(this);
|
|
|
- tv_date_start.setKeyListener(null);
|
|
|
- tv_date_end.setKeyListener(null);
|
|
|
- tv_customer_login.setOnClickListener(this);
|
|
|
- tv_visit_steps.setKeyListener(null);
|
|
|
- tv_relate_business.setKeyListener(null);
|
|
|
- tv_visit_steps.setOnClickListener(this);
|
|
|
- tv_relate_business.setOnClickListener(this);
|
|
|
- } else {
|
|
|
- //当不可编辑tv_date_end
|
|
|
- tv_date_start.setFocusable(false);
|
|
|
- tv_date_end.setFocusable(false);
|
|
|
- tv_customer_login.setFocusable(false);
|
|
|
- tv_visit_steps.setFocusable(false);
|
|
|
- tv_relate_business.setFocusable(false);
|
|
|
- tv_visit_content.setFocusable(false);
|
|
|
- tv_visit_theme.setFocusable(false);
|
|
|
- tv_address_login.setFocusable(false);
|
|
|
- tv_linksman_login.setFocusable(false);
|
|
|
- }
|
|
|
+ boolean isMe = getIntent().getBooleanExtra("isMe", true);
|
|
|
+ setFocusable(tv_date_start, isMe);
|
|
|
+ setFocusable(tv_date_end, isMe);
|
|
|
+ setFocusable(tv_customer_login, isMe);
|
|
|
+ setFocusable(tv_visit_steps, isMe);
|
|
|
+ setFocusable(tv_relate_business, isMe);
|
|
|
+
|
|
|
+ setFocusable(tv_visit_content, isMe);
|
|
|
+ setFocusable(tv_visit_theme, isMe);
|
|
|
+ setFocusable(tv_address_login, isMe);
|
|
|
+ setFocusable(tv_linksman_login, isMe);
|
|
|
+
|
|
|
+
|
|
|
+// if () {
|
|
|
+// tv_date_start.setOnClickListener(this);
|
|
|
+// tv_date_end.setOnClickListener(this);
|
|
|
+// tv_date_start.setKeyListener(null);
|
|
|
+// tv_date_end.setKeyListener(null);
|
|
|
+// tv_customer_login.setOnClickListener(this);
|
|
|
+// tv_visit_steps.setKeyListener(null);
|
|
|
+// tv_relate_business.setKeyListener(null);
|
|
|
+// tv_visit_steps.setOnClickListener(this);
|
|
|
+// tv_relate_business.setOnClickListener(this);
|
|
|
+// } else {
|
|
|
+// //当不可编辑tv_date_end
|
|
|
+// tv_date_start.setFocusable(false);
|
|
|
+// tv_date_end.setFocusable(false);
|
|
|
+// tv_customer_login.setFocusable(false);
|
|
|
+// tv_visit_steps.setFocusable(false);
|
|
|
+// tv_relate_business.setFocusable(false);
|
|
|
+// tv_visit_content.setFocusable(false);
|
|
|
+// tv_visit_theme.setFocusable(false);
|
|
|
+// tv_address_login.setFocusable(false);
|
|
|
+// tv_linksman_login.setFocusable(false);
|
|
|
+// }
|
|
|
}
|
|
|
|
|
|
private void initData() {
|
|
|
@@ -151,19 +164,36 @@ public class VisitReportAddActivity extends BaseActivity implements View.OnClick
|
|
|
nichecode = object.getString(getJSONString(object, "vr_nichecode"));
|
|
|
tv_relate_business.setText(getJSONString(object, "vr_nichename"));
|
|
|
// tv_visit_content.setText(getJSONString(object, "vr_detail"));
|
|
|
- Log.i("VisitRecord2", chche);
|
|
|
} else if (type == 3) {
|
|
|
//1.开始日期==预计拜访时间 2.客户名称==公司名称 客户地址
|
|
|
+
|
|
|
String chche = getIntent().getStringExtra("data");
|
|
|
JSONObject object = JSON.parseObject(chche);
|
|
|
+ vp_id = object.containsKey("object") ? object.getInteger("object") : -1;
|
|
|
tv_date_start.setText(getJSONString(object, "mpd_actdate"));
|
|
|
tv_date_end.setText(getJSONString(object, "mpd_outdate"));
|
|
|
tv_customer_login.setText(getJSONString(object, "mpd_company"));
|
|
|
tv_address_login.setText(getJSONString(object, "mpd_address"));
|
|
|
- Log.i("gongpengming", chche);
|
|
|
+ tv_visit_theme.setText(getJSONString(object, "mpd_remark"));
|
|
|
+ boolean isMe = getIntent().getBooleanExtra("isMe", true);
|
|
|
+ setFocusable(tv_date_start, isMe && TextUtils.isEmpty(tv_date_start.getText()));
|
|
|
+ setFocusable(tv_date_end, isMe && TextUtils.isEmpty(tv_date_end.getText()));
|
|
|
+ setFocusable(tv_customer_login, isMe && TextUtils.isEmpty(tv_customer_login.getText()));
|
|
|
+ setFocusable(tv_address_login, isMe && TextUtils.isEmpty(tv_address_login.getText()));
|
|
|
+ setFocusable(tv_visit_theme, isMe && TextUtils.isEmpty(tv_visit_theme.getText()));
|
|
|
+ Log.i("gongpengming", "vp_id=" + vp_id);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ private void setFocusable(FormEditText v, boolean focusable) {
|
|
|
+ if (focusable) {
|
|
|
+ v.setOnClickListener(this);
|
|
|
+ v.setKeyListener(null);
|
|
|
+ } else
|
|
|
+ v.setFocusable(focusable);
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
private String getJSONString(JSONObject object, String key) {
|
|
|
if (object.containsKey(key) && !StringUtils.isEmpty(object.getString(key))) {
|
|
|
return object.getString(key);
|