|
|
@@ -82,6 +82,7 @@ public class BusinessAddActivity extends BaseActivity implements View.OnClickLis
|
|
|
private List<String> lists = new ArrayList<String>();
|
|
|
private int et_business_enterCode;
|
|
|
private int mBcId;
|
|
|
+
|
|
|
@Override
|
|
|
protected void onCreate(Bundle savedInstanceState) {
|
|
|
super.onCreate(savedInstanceState);
|
|
|
@@ -97,7 +98,7 @@ public class BusinessAddActivity extends BaseActivity implements View.OnClickLis
|
|
|
et_business_source.setOnClickListener(this);
|
|
|
et_business_enterMan.setOnClickListener(this);
|
|
|
// et_business_no.setOnClickListener(this);
|
|
|
- // et_business.setKeyListener(null);
|
|
|
+ // et_business.setKeyListener(null);
|
|
|
// et_business_no.setKeyListener(null);
|
|
|
//et_business_jieDuan.setKeyListener(null);
|
|
|
et_business_source.setKeyListener(null);
|
|
|
@@ -115,7 +116,7 @@ public class BusinessAddActivity extends BaseActivity implements View.OnClickLis
|
|
|
}
|
|
|
|
|
|
private void initData() {
|
|
|
- CommonUtil.getCommonId(this,"BUSINESSCHANCE_SEQ",mHandler,GET_BC_ID);
|
|
|
+ CommonUtil.getCommonId(this, "BUSINESSCHANCE_SEQ", mHandler, GET_BC_ID);
|
|
|
getCodeByNet();
|
|
|
}
|
|
|
|
|
|
@@ -164,7 +165,7 @@ public class BusinessAddActivity extends BaseActivity implements View.OnClickLis
|
|
|
switch (item.getItemId()) {
|
|
|
case R.id.btn_save:
|
|
|
if (et_business_name.testValidity() && et_business_source.testValidity() &&
|
|
|
- et_business.testValidity() && et_business_type.testValidity() &&
|
|
|
+ et_business.testValidity() &&
|
|
|
et_business_jieDuan.testValidity()) {
|
|
|
sendHttpResquest();
|
|
|
}
|
|
|
@@ -183,7 +184,7 @@ public class BusinessAddActivity extends BaseActivity implements View.OnClickLis
|
|
|
private static final int LOAD_MANGENJIN = 5;
|
|
|
private static final int GET_BC_ID = 6;
|
|
|
private JSONArray jsons;
|
|
|
-
|
|
|
+
|
|
|
private Handler mHandler = new Handler() {
|
|
|
@Override
|
|
|
public void handleMessage(Message msg) {
|
|
|
@@ -272,7 +273,7 @@ public class BusinessAddActivity extends BaseActivity implements View.OnClickLis
|
|
|
String resultStr = msg.getData().getString("result");
|
|
|
try {
|
|
|
JSONObject resultJsonObject = new JSONObject(resultStr);
|
|
|
- if (resultJsonObject != null && resultJsonObject.getBoolean("success")){
|
|
|
+ if (resultJsonObject != null && resultJsonObject.getBoolean("success")) {
|
|
|
mBcId = resultJsonObject.getInt("id");
|
|
|
}
|
|
|
} catch (JSONException e) {
|
|
|
@@ -313,19 +314,19 @@ public class BusinessAddActivity extends BaseActivity implements View.OnClickLis
|
|
|
String bc_remark = getEditText(et_business_remark);//备注
|
|
|
String bc_position = getEditText(et_company_position); //职位
|
|
|
String bc_type = getEditText(et_business_type); //商机类型
|
|
|
- String enterCode=null;
|
|
|
- if (et_business_enterCode==0){
|
|
|
- enterCode="";
|
|
|
- }else{
|
|
|
- enterCode=CommonUtil.getSharedPreferences(ct,"erp_username");
|
|
|
+ String enterCode = null;
|
|
|
+ if (et_business_enterCode == 0) {
|
|
|
+ enterCode = "";
|
|
|
+ } else {
|
|
|
+ enterCode = CommonUtil.getSharedPreferences(ct, "erp_username");
|
|
|
}
|
|
|
- LogUtil.e("commonbcid",mBcId+"");
|
|
|
+ LogUtil.e("commonbcid", mBcId + "");
|
|
|
String formStore =
|
|
|
"{\n" +
|
|
|
"\"bc_id\":" + mBcId + ",\n" +
|
|
|
"\"bc_code\":\"" + et_business_no.getText().toString() + "\",\n" + //商机名称
|
|
|
"\"bc_status\":\"" + "在录入" + "\",\n" +
|
|
|
- "\"bc_domancode\":\"" + enterCode+ "\",\n" +
|
|
|
+ "\"bc_domancode\":\"" + enterCode + "\",\n" +
|
|
|
"\"bc_statuscode\":\"" + "ENTERING" + "\",\n" +
|
|
|
"\"bc_description\":\"" + name + "\",\n" + //商机名称
|
|
|
"\"bc_from\":\"" + from + "\",\n" + //商机来源
|
|
|
@@ -438,17 +439,17 @@ public class BusinessAddActivity extends BaseActivity implements View.OnClickLis
|
|
|
public void onListItemClick(int position, String value) {
|
|
|
et.setText(value);
|
|
|
for (int i = 0; i < jsons.size(); i++) {
|
|
|
- if (jsons.getJSONObject(i).getString("BD_NAME").equals(value)){
|
|
|
- String bd_prop= jsons.getJSONObject(i).getString("BD_PROP");
|
|
|
- if (bd_prop.equals("公有")){
|
|
|
+ if (jsons.getJSONObject(i).getString("BD_NAME").equals(value)) {
|
|
|
+ String bd_prop = jsons.getJSONObject(i).getString("BD_PROP");
|
|
|
+ if (bd_prop.equals("公有")) {
|
|
|
//跟进人不可编辑,不可点击
|
|
|
et_business_enterMan.setClickable(false);
|
|
|
et_business_enterMan.setEnabled(false);
|
|
|
et_business_enterMan.setText("");
|
|
|
- et_business_enterCode=0;
|
|
|
- }else{
|
|
|
+ et_business_enterCode = 0;
|
|
|
+ } else {
|
|
|
//跟进人可编辑
|
|
|
- et_business_enterCode=1;
|
|
|
+ et_business_enterCode = 1;
|
|
|
et_business_enterMan.setEnabled(true);
|
|
|
et_business_enterMan.setClickable(true);
|
|
|
et_business_enterMan.setText(MyApplication.getInstance().mLoginUser.getNickName());
|