|
|
@@ -78,18 +78,22 @@ public class BusinessAddActivity extends BaseActivity implements View.OnClickLis
|
|
|
private FormEditText et_company_man;
|
|
|
@ViewInject(R.id.et_company_position)
|
|
|
private FormEditText et_company_position;
|
|
|
- @ViewInject(R.id.et_company_tele)
|
|
|
+ @ViewInject(R.id.et_company_tel)
|
|
|
private FormEditText et_company_tele;
|
|
|
|
|
|
@ViewInject(R.id.et_company_businesslicense)
|
|
|
private FormEditText et_company_businesslicense;
|
|
|
@ViewInject(R.id.et_company_planmoney)
|
|
|
- private FormEditText et_company_planmoney;
|
|
|
+ private FormEditText et_company_planmoney;
|
|
|
@ViewInject(R.id.et_company_plantime)
|
|
|
- private FormEditText et_company_plantime;
|
|
|
+ private FormEditText et_company_plantime;
|
|
|
@ViewInject(R.id.et_company_depart)
|
|
|
- private FormEditText et_company_depart;
|
|
|
-
|
|
|
+ private FormEditText et_company_depart;
|
|
|
+ @ViewInject(R.id.et_bc_factory)
|
|
|
+ private FormEditText et_bc_factory;
|
|
|
+ @ViewInject(R.id.et_bt_tel)
|
|
|
+ private FormEditText et_bc_tel;
|
|
|
+
|
|
|
|
|
|
private List<String> lists = new ArrayList<String>();
|
|
|
private int et_business_enterCode;
|
|
|
@@ -110,7 +114,7 @@ public class BusinessAddActivity extends BaseActivity implements View.OnClickLis
|
|
|
et_business_jieDuan.setOnClickListener(this);
|
|
|
et_business_source.setOnClickListener(this);
|
|
|
et_business_enterMan.setOnClickListener(this);
|
|
|
-
|
|
|
+
|
|
|
et_company_plantime.setOnClickListener(this);
|
|
|
// et_business_no.setOnClickListener(this);
|
|
|
// et_business.setKeyListener(null);
|
|
|
@@ -141,12 +145,12 @@ public class BusinessAddActivity extends BaseActivity implements View.OnClickLis
|
|
|
private void initView() {
|
|
|
ViewUtils.inject(this);
|
|
|
getSupportActionBar().setTitle("创建商机");
|
|
|
- if (!StringUtils.isEmpty(CommonUtil.getSharedPreferences(ct,"erp_emname"))){
|
|
|
- et_business_enterMan.setText(CommonUtil.getSharedPreferences(ct,"erp_emname"));
|
|
|
- }else{
|
|
|
+ if (!StringUtils.isEmpty(CommonUtil.getSharedPreferences(ct, "erp_emname"))) {
|
|
|
+ et_business_enterMan.setText(CommonUtil.getSharedPreferences(ct, "erp_emname"));
|
|
|
+ } else {
|
|
|
et_business_enterMan.setText(MyApplication.getInstance().mLoginUser.getNickName());
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@@ -170,8 +174,8 @@ public class BusinessAddActivity extends BaseActivity implements View.OnClickLis
|
|
|
case R.id.et_business_type:
|
|
|
onPopupButtonClick(v);
|
|
|
break;
|
|
|
- case R.id. et_company_plantime:
|
|
|
- showDateDialog((FormEditText) v.findViewById(R.id. et_company_plantime));
|
|
|
+ case R.id.et_company_plantime:
|
|
|
+ showDateDialog((FormEditText) v.findViewById(R.id.et_company_plantime));
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
@@ -187,14 +191,16 @@ public class BusinessAddActivity extends BaseActivity implements View.OnClickLis
|
|
|
public boolean onOptionsItemSelected(MenuItem item) {
|
|
|
switch (item.getItemId()) {
|
|
|
case R.id.btn_save:
|
|
|
- if (et_business_name.testValidity() &&
|
|
|
+ if (et_business_name.testValidity() &&
|
|
|
et_business_source.testValidity() &&
|
|
|
et_business.testValidity() &&
|
|
|
- et_business_jieDuan.testValidity()&&
|
|
|
- et_company_tele.testValidity()&&
|
|
|
- et_company_businesslicense.testValidity()&&
|
|
|
- et_company_address.testValidity()&&
|
|
|
- et_company_name.testValidity()) {
|
|
|
+ et_business_jieDuan.testValidity() &&
|
|
|
+ et_company_tele.testValidity() &&
|
|
|
+ et_company_businesslicense.testValidity() &&
|
|
|
+ et_company_address.testValidity() &&
|
|
|
+ et_company_name.testValidity()&&
|
|
|
+ et_bc_tel.testValidity()&&
|
|
|
+ et_bc_factory.testValidity()) {
|
|
|
sendHttpResquest();
|
|
|
}
|
|
|
break;
|
|
|
@@ -213,7 +219,7 @@ public class BusinessAddActivity extends BaseActivity implements View.OnClickLis
|
|
|
private static final int GET_BC_ID = 6;
|
|
|
private JSONArray jsons;
|
|
|
private JSONArray enterArray;
|
|
|
-
|
|
|
+
|
|
|
private Handler mHandler = new Handler() {
|
|
|
@Override
|
|
|
public void handleMessage(Message msg) {
|
|
|
@@ -231,7 +237,7 @@ public class BusinessAddActivity extends BaseActivity implements View.OnClickLis
|
|
|
public void run() {
|
|
|
finish();
|
|
|
}
|
|
|
- },3000);
|
|
|
+ }, 3000);
|
|
|
break;
|
|
|
case LOAD_BUSINESS://商机库
|
|
|
progressDialog.dismiss();
|
|
|
@@ -272,7 +278,7 @@ public class BusinessAddActivity extends BaseActivity implements View.OnClickLis
|
|
|
json = msg.getData().getString("result");
|
|
|
enterArray = JSON.parseObject(json).getJSONArray("recorders");
|
|
|
if (!enterArray.isEmpty()) {
|
|
|
- for (int i = 0; i <enterArray.size(); i++) {
|
|
|
+ for (int i = 0; i < enterArray.size(); i++) {
|
|
|
lists.add(enterArray.getJSONObject(i).getString("BC_DOMAN"));
|
|
|
}
|
|
|
}
|
|
|
@@ -340,7 +346,7 @@ public class BusinessAddActivity extends BaseActivity implements View.OnClickLis
|
|
|
// String bc_recorddate = getEditText(et_business_createTime); //创建时间
|
|
|
String bc_nichehouse = getEditText(et_business); //商机库
|
|
|
String bc_currentprocess = getEditText(et_business_jieDuan); //当前阶段
|
|
|
- String bc_recorder = CommonUtil.getSharedPreferences(mContext,"erp_emname"); //创建人
|
|
|
+ String bc_recorder = CommonUtil.getSharedPreferences(mContext, "erp_emname"); //创建人
|
|
|
String bc_address = getEditText(et_company_address); //地址
|
|
|
// String bc_lastdate = getEditText(et_business_enterTime); //最后跟进时间
|
|
|
String bc_custname = getEditText(et_company_name); //企业名称
|
|
|
@@ -349,25 +355,29 @@ 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 bc_plantime=getEditText(et_company_plantime);//预计成交时间
|
|
|
- String bc_planmoney=getEditText(et_company_planmoney);//预计成交时间
|
|
|
- String bc_depart=getEditText(et_company_depart);//部门
|
|
|
- String bc_linecse=getEditText(et_company_businesslicense);//营业执照
|
|
|
+ String bc_plantime = getEditText(et_company_plantime);//预计成交时间
|
|
|
+ String bc_planmoney = getEditText(et_company_planmoney);//预计成交时间
|
|
|
+ String bc_depart = getEditText(et_company_depart);//部门
|
|
|
+ String bc_linecse = getEditText(et_company_businesslicense);//营业执照
|
|
|
+ String bc_factory=getEditText(et_bc_factory);//工厂地址
|
|
|
+ String bc_tel=getEditText(et_bc_tel);//公司总机
|
|
|
String enterCode = null;
|
|
|
if (et_business_enterCode == 0) {//不可编辑 为空
|
|
|
enterCode = "";
|
|
|
} else {//可编辑
|
|
|
- if(StringUtils.isEmpty(enterManCode)){//跟进人编号为空
|
|
|
- enterCode = CommonUtil.getSharedPreferences(ct,"erp_username");//默认自己
|
|
|
- }else{
|
|
|
+ if (StringUtils.isEmpty(enterManCode)) {//跟进人编号为空
|
|
|
+ enterCode = CommonUtil.getSharedPreferences(ct, "erp_username");//默认自己
|
|
|
+ } else {
|
|
|
enterCode = enterManCode;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
LogUtil.e("commonbcid", mBcId + "");
|
|
|
String formStore =
|
|
|
"{\n" +
|
|
|
"\"bc_id\":" + mBcId + "," +
|
|
|
+ "\"bc_position\":\"" + bc_factory+ "\"," +//工厂地址
|
|
|
+ "\"bc_desc1\":\"" + bc_tel + "\"," +//公司总机
|
|
|
"\"bc_date7\":\"" + bc_plantime + "\"," +
|
|
|
"\"bc_desc8\":\"" + bc_planmoney + "\"," +
|
|
|
"\"bc_desc4\":\"" + bc_depart + "\"," +
|
|
|
@@ -438,7 +448,7 @@ public class BusinessAddActivity extends BaseActivity implements View.OnClickLis
|
|
|
intent.putExtra("key", "combos");
|
|
|
intent.putExtra("showKey", "DLC_VALUE");
|
|
|
intent.putExtra("action", "/mobile/crm/getBusinessChanceCombo.action");
|
|
|
- intent.putExtra("title",getString(R.string.business_from));
|
|
|
+ intent.putExtra("title", getString(R.string.business_from));
|
|
|
startActivityForResult(intent, 0x21);
|
|
|
}
|
|
|
|
|
|
@@ -468,7 +478,7 @@ public class BusinessAddActivity extends BaseActivity implements View.OnClickLis
|
|
|
intent.putExtra("key", "combos");
|
|
|
intent.putExtra("showKey", "BD_NAME");
|
|
|
intent.putExtra("action", "/mobile/crm/getNichehouse.action");
|
|
|
- intent.putExtra("title",getString(R.string.business_Library));
|
|
|
+ intent.putExtra("title", getString(R.string.business_Library));
|
|
|
startActivityForResult(intent, 0x24);
|
|
|
}
|
|
|
|
|
|
@@ -497,7 +507,7 @@ public class BusinessAddActivity extends BaseActivity implements View.OnClickLis
|
|
|
intent.putExtra("key", "stages");
|
|
|
intent.putExtra("showKey", "BS_NAME");
|
|
|
intent.putExtra("action", "/mobile/crm/getBusinessChanceStage.action");
|
|
|
- intent.putExtra("title",getString(R.string.business_stage));
|
|
|
+ intent.putExtra("title", getString(R.string.business_stage));
|
|
|
startActivityForResult(intent, 0x22);
|
|
|
}
|
|
|
|
|
|
@@ -555,15 +565,15 @@ public class BusinessAddActivity extends BaseActivity implements View.OnClickLis
|
|
|
new SingleDialog.PickDialogListener() {
|
|
|
@Override
|
|
|
public void onListItemClick(int position, String value) {
|
|
|
- if (StringUtils.isEmpty(value))return;
|
|
|
- switch (et.getId()){
|
|
|
+ if (StringUtils.isEmpty(value)) return;
|
|
|
+ switch (et.getId()) {
|
|
|
case R.id.et_business_enterMan:
|
|
|
et.setText(value);
|
|
|
for (int i = 0; i < enterArray.size(); i++) {
|
|
|
- if (value.equals(enterArray.getJSONObject(i).getString("BC_DOMAN"))){
|
|
|
- //获取跟进人编号
|
|
|
- enterManCode= enterArray.getJSONObject(i).getString("EM_CODE");
|
|
|
- }
|
|
|
+ if (value.equals(enterArray.getJSONObject(i).getString("BC_DOMAN"))) {
|
|
|
+ //获取跟进人编号
|
|
|
+ enterManCode = enterArray.getJSONObject(i).getString("EM_CODE");
|
|
|
+ }
|
|
|
}
|
|
|
break;
|
|
|
case R.id.et_business_source:
|
|
|
@@ -575,7 +585,7 @@ public class BusinessAddActivity extends BaseActivity implements View.OnClickLis
|
|
|
if (jsons.getJSONObject(i).getString("BD_NAME").equals(value)) {
|
|
|
String bd_prop = jsons.getJSONObject(i).getString("BD_PROP");
|
|
|
if (bd_prop.equals(getString(R.string.business_common))
|
|
|
- ||bd_prop.equals(getString(R.string.business_get_split))) {
|
|
|
+ || bd_prop.equals(getString(R.string.business_get_split))) {
|
|
|
//跟进人不可编辑,不可点击
|
|
|
et_business_enterMan.setClickable(false);
|
|
|
et_business_enterMan.setEnabled(false);
|
|
|
@@ -587,7 +597,7 @@ public class BusinessAddActivity extends BaseActivity implements View.OnClickLis
|
|
|
et_business_enterMan.setEnabled(true);
|
|
|
et_business_enterMan.setClickable(true);
|
|
|
jsons.getJSONObject(i).getString("BD_PROP");
|
|
|
- // et_business_enterMan.setText(MyApplication.getInstance().mLoginUser.getNickName());
|
|
|
+ // et_business_enterMan.setText(MyApplication.getInstance().mLoginUser.getNickName());
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -596,8 +606,8 @@ public class BusinessAddActivity extends BaseActivity implements View.OnClickLis
|
|
|
et.setText(value);
|
|
|
break;
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
});
|
|
|
singleDialog.show();
|
|
|
@@ -653,7 +663,6 @@ public class BusinessAddActivity extends BaseActivity implements View.OnClickLis
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
/**
|
|
|
* @desc:调转界面返回参数数据
|
|
|
* @author:Arison on 2016/11/14
|
|
|
@@ -667,15 +676,15 @@ public class BusinessAddActivity extends BaseActivity implements View.OnClickLis
|
|
|
SelectBean b = data.getParcelableExtra("data");
|
|
|
LogUtil.d(JSON.toJSONString(b));
|
|
|
if (b == null || StringUtils.isEmpty(b.getJson())) return;
|
|
|
- switch (requestCode){
|
|
|
+ switch (requestCode) {
|
|
|
case 0x21://来源
|
|
|
et_business_source.setText(b.getName());
|
|
|
break;
|
|
|
case 0x24://商机库
|
|
|
et_business.setText(b.getName());
|
|
|
|
|
|
- String bd_prop =JSON.parseObject(b.getJson()).getString("BD_PROP");
|
|
|
- if (bd_prop.equals(getString(R.string.business_common))||bd_prop.equals(getString(R.string.business_get_split))) {
|
|
|
+ String bd_prop = JSON.parseObject(b.getJson()).getString("BD_PROP");
|
|
|
+ if (bd_prop.equals(getString(R.string.business_common)) || bd_prop.equals(getString(R.string.business_get_split))) {
|
|
|
//跟进人不可编辑,不可点击
|
|
|
et_business_enterMan.setClickable(false);
|
|
|
et_business_enterMan.setEnabled(false);
|
|
|
@@ -686,13 +695,13 @@ public class BusinessAddActivity extends BaseActivity implements View.OnClickLis
|
|
|
et_business_enterCode = 1;
|
|
|
et_business_enterMan.setEnabled(true);
|
|
|
et_business_enterMan.setClickable(true);
|
|
|
- // jsons.getJSONObject(i).getString("BD_PROP");
|
|
|
+ // jsons.getJSONObject(i).getString("BD_PROP");
|
|
|
// et_business_enterMan.setText(MyApplication.getInstance().mLoginUser.getNickName());
|
|
|
}
|
|
|
break;
|
|
|
case 0x23://跟进入
|
|
|
- // enterManCode
|
|
|
- enterManCode= JSON.parseObject(b.getJson()).getString("em_code");
|
|
|
+ // enterManCode
|
|
|
+ enterManCode = JSON.parseObject(b.getJson()).getString("em_code");
|
|
|
et_business_enterMan.setText(b.getName());
|
|
|
break;
|
|
|
case 0x22://当前阶段
|