|
|
@@ -1,4 +1,4 @@
|
|
|
-package com.xzjmyk.pm.activity.ui.erp.activity.crm;
|
|
|
+package com.uas.appworks.CRM.erp.activity;
|
|
|
|
|
|
import android.content.Context;
|
|
|
import android.content.Intent;
|
|
|
@@ -34,17 +34,13 @@ import com.core.dao.DBManager;
|
|
|
import com.core.model.Employees;
|
|
|
import com.core.model.EmployeesEntity;
|
|
|
import com.core.net.http.ViewUtil;
|
|
|
+import com.core.utils.CommonUtil;
|
|
|
import com.core.utils.helper.AvatarHelper;
|
|
|
import com.core.widget.EmptyLayout;
|
|
|
import com.handmark.pulltorefresh.library.PullToRefreshBase;
|
|
|
import com.handmark.pulltorefresh.library.PullToRefreshListView;
|
|
|
-import com.lidroid.xutils.ViewUtils;
|
|
|
-import com.lidroid.xutils.view.annotation.ViewInject;
|
|
|
-import com.uas.appme.settings.model.Business;
|
|
|
-import com.uas.appworks.CRM.erp.activity.CustomerAddActivity;
|
|
|
-import com.xzjmyk.pm.activity.R;
|
|
|
-import com.xzjmyk.pm.activity.ui.erp.activity.oa.UserSelectActivity;
|
|
|
-import com.xzjmyk.pm.activity.util.oa.CommonUtil;
|
|
|
+import com.uas.appworks.CRM.erp.model.Business;
|
|
|
+import com.uas.appworks.R;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.HashMap;
|
|
|
@@ -61,24 +57,14 @@ import java.util.Map;
|
|
|
public class CustomerListActivity extends BaseActivity implements View.OnClickListener {
|
|
|
private BussinessDetailAdapter mAdapter;
|
|
|
|
|
|
- @ViewInject(R.id.iv_head)
|
|
|
private ImageView iv_head;
|
|
|
-
|
|
|
- @ViewInject(R.id.tv_change)
|
|
|
private TextView tv_change;
|
|
|
- @ViewInject(R.id.tv_count_unend)
|
|
|
private TextView tv_count_unend;
|
|
|
- @ViewInject(R.id.tv_count_end)
|
|
|
private TextView tv_count_end;
|
|
|
- @ViewInject(R.id.tv_count_total)
|
|
|
private TextView tv_count_total;
|
|
|
- @ViewInject(R.id.tv_name)
|
|
|
private TextView tv_name;
|
|
|
- @ViewInject(R.id.tv_department)
|
|
|
private TextView tv_department;
|
|
|
- @ViewInject(R.id.tv_position)
|
|
|
private TextView tv_position;
|
|
|
- @ViewInject(R.id.list_business)
|
|
|
private PullToRefreshListView mlist;
|
|
|
private ArrayList<Business> mData = new ArrayList<Business>();
|
|
|
private Context ct;
|
|
|
@@ -95,14 +81,28 @@ public class CustomerListActivity extends BaseActivity implements View.OnClickLi
|
|
|
protected void onCreate(Bundle savedInstanceState) {
|
|
|
super.onCreate(savedInstanceState);
|
|
|
setContentView(R.layout.activity_customer_list);
|
|
|
+ initIds();
|
|
|
initView();
|
|
|
initData();
|
|
|
initListener();
|
|
|
}
|
|
|
|
|
|
+ private void initIds(){
|
|
|
+
|
|
|
+ iv_head = (ImageView) findViewById(R.id.iv_head);
|
|
|
+ tv_change = (TextView) findViewById(R.id.tv_change);
|
|
|
+ tv_count_unend = (TextView) findViewById(R.id.tv_count_unend);
|
|
|
+ tv_count_end = (TextView) findViewById(R.id.tv_count_end);
|
|
|
+ tv_count_total = (TextView) findViewById(R.id.tv_count_total);
|
|
|
+ tv_name = (TextView) findViewById(R.id.tv_name);
|
|
|
+ tv_department = (TextView) findViewById(R.id.tv_department);
|
|
|
+ tv_position = (TextView) findViewById(R.id.tv_position);
|
|
|
+ mlist = (PullToRefreshListView) findViewById(R.id.list_business);
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
private void initView() {
|
|
|
ct = this;
|
|
|
- ViewUtils.inject(this);
|
|
|
getSupportActionBar().setTitle(getString(R.string.crmmain_client));
|
|
|
|
|
|
loadParams(3);
|
|
|
@@ -155,11 +155,9 @@ public class CustomerListActivity extends BaseActivity implements View.OnClickLi
|
|
|
|
|
|
|
|
|
public void changeOnChange(View v) {
|
|
|
- switch (v.getId()) {
|
|
|
- case R.id.tv_change:
|
|
|
- showPopupWindow(v);
|
|
|
- break;
|
|
|
- }
|
|
|
+ if (v.getId() == R.id.tv_change){
|
|
|
+ showPopupWindow(v);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
private void initData() {
|
|
|
@@ -197,58 +195,49 @@ public class CustomerListActivity extends BaseActivity implements View.OnClickLi
|
|
|
|
|
|
@Override
|
|
|
public boolean onOptionsItemSelected(MenuItem item) {
|
|
|
- switch (item.getItemId()) {
|
|
|
- case R.id.crm_data_add:
|
|
|
- if (falg == 0) {
|
|
|
- startActivity(new Intent(ct, CustomerAddActivity.class).putExtra("type", 1));//正式
|
|
|
- } else {
|
|
|
- startActivity(new Intent(ct, CustomerAddActivity.class).putExtra("type", 0));//预录
|
|
|
- }
|
|
|
- break;
|
|
|
- case R.id.crm_data_find:
|
|
|
- startActivity(new Intent(ct, CustomerListSelectActivity.class));
|
|
|
- break;
|
|
|
-
|
|
|
- case android.R.id.home:
|
|
|
- onBackPressed();
|
|
|
- break;
|
|
|
+ if (item.getItemId() == R.id.crm_data_add){
|
|
|
+ if (falg == 0) {
|
|
|
+ startActivity(new Intent(ct, CustomerAddActivity.class).putExtra("type", 1));//正式
|
|
|
+ } else {
|
|
|
+ startActivity(new Intent(ct, CustomerAddActivity.class).putExtra("type", 0));//预录
|
|
|
+ }
|
|
|
+ }else if (item.getItemId() == R.id.crm_data_find){
|
|
|
+ startActivity(new Intent(ct, CustomerListSelectActivity.class));
|
|
|
+ }else if (item.getItemId() == android.R.id.home){
|
|
|
+ onBackPressed();
|
|
|
}
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public void onClick(View v) {
|
|
|
- switch (v.getId()) {
|
|
|
- case R.id.tv_count_unend:
|
|
|
- tv_count_total.setSelected(false);
|
|
|
- tv_count_end.setSelected(false);
|
|
|
- tv_count_unend.setSelected(true);
|
|
|
- type = 0;
|
|
|
- jsonArray.clear();
|
|
|
+ if (v.getId() == R.id.tv_count_unend){
|
|
|
+ tv_count_total.setSelected(false);
|
|
|
+ tv_count_end.setSelected(false);
|
|
|
+ tv_count_unend.setSelected(true);
|
|
|
+ type = 0;
|
|
|
+ jsonArray.clear();
|
|
|
// Crouton.makeText(this,"切换成功", 0xffff8888, 10000).show();
|
|
|
- page = 1;
|
|
|
- sendHttpResquest(Constants.HTTP_SUCCESS_INIT, kind, page, 0, "");
|
|
|
- break;
|
|
|
- case R.id.tv_count_end:
|
|
|
- tv_count_total.setSelected(false);
|
|
|
- tv_count_end.setSelected(true);
|
|
|
- tv_count_unend.setSelected(false);
|
|
|
- type = 1;
|
|
|
- page = 1;
|
|
|
- jsonArray.clear();
|
|
|
+ page = 1;
|
|
|
+ sendHttpResquest(Constants.HTTP_SUCCESS_INIT, kind, page, 0, "");
|
|
|
+ }else if (v.getId() == R.id.tv_count_end){
|
|
|
+ tv_count_total.setSelected(false);
|
|
|
+ tv_count_end.setSelected(true);
|
|
|
+ tv_count_unend.setSelected(false);
|
|
|
+ type = 1;
|
|
|
+ page = 1;
|
|
|
+ jsonArray.clear();
|
|
|
// Crouton.makeText(this,"切换成功", Style.CONFIRM).show();
|
|
|
- sendHttpResquest(Constants.HTTP_SUCCESS_INIT, kind, page, 0, "");
|
|
|
- break;
|
|
|
- case R.id.tv_count_total:
|
|
|
- tv_count_total.setSelected(true);
|
|
|
- tv_count_end.setSelected(false);
|
|
|
- tv_count_unend.setSelected(false);
|
|
|
- jsonArray.clear();
|
|
|
- type = 2;
|
|
|
- page = 1;
|
|
|
+ sendHttpResquest(Constants.HTTP_SUCCESS_INIT, kind, page, 0, "");
|
|
|
+ }else if (v.getId() == R.id.tv_count_total){
|
|
|
+ tv_count_total.setSelected(true);
|
|
|
+ tv_count_end.setSelected(false);
|
|
|
+ tv_count_unend.setSelected(false);
|
|
|
+ jsonArray.clear();
|
|
|
+ type = 2;
|
|
|
+ page = 1;
|
|
|
// Crouton.makeText(this,"切换成功", Style.CONFIRM).show();
|
|
|
- sendHttpResquest(Constants.HTTP_SUCCESS_INIT, kind, page, 0, "");
|
|
|
- break;
|
|
|
+ sendHttpResquest(Constants.HTTP_SUCCESS_INIT, kind, page, 0, "");
|
|
|
}
|
|
|
}
|
|
|
|