d
This commit is contained in:
@@ -13,6 +13,7 @@ import com.fenghoo.seven.dialog.BaseTipsDialog;
|
|||||||
import com.fenghoo.seven.main.find.entity.privateListBean;
|
import com.fenghoo.seven.main.find.entity.privateListBean;
|
||||||
import com.fenghoo.seven.main.kehu.Bean.addCustomerBean;
|
import com.fenghoo.seven.main.kehu.Bean.addCustomerBean;
|
||||||
import com.fenghoo.seven.utils.AbStrUtil;
|
import com.fenghoo.seven.utils.AbStrUtil;
|
||||||
|
import com.fenghoo.seven.utils.ToastUtils;
|
||||||
import com.fenghoo.seven.widget.TitleBar;
|
import com.fenghoo.seven.widget.TitleBar;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@@ -58,8 +59,6 @@ public class ConversationActivity extends BaseActivity {
|
|||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
goback();
|
goback();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -78,6 +77,11 @@ public class ConversationActivity extends BaseActivity {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!AbStrUtil.isEmpty(addCustomerBean.getDecoration())) {
|
||||||
|
//弹出对话框
|
||||||
|
alert();
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (!AbStrUtil.isEmpty(addCustomerBean.getName())) {
|
if (!AbStrUtil.isEmpty(addCustomerBean.getName())) {
|
||||||
//弹出对话框
|
//弹出对话框
|
||||||
alert();
|
alert();
|
||||||
|
|||||||
@@ -158,14 +158,14 @@ public class AddCusFragment extends MobanFragment implements View.OnClickListene
|
|||||||
//3代表从会话列表进入
|
//3代表从会话列表进入
|
||||||
if(pagetype.equals("0")||pagetype.equals("1")||pagetype.equals("2")||pagetype.equals("3")){
|
if(pagetype.equals("0")||pagetype.equals("1")||pagetype.equals("2")||pagetype.equals("3")){
|
||||||
//添加客户
|
//添加客户
|
||||||
label = addData("1","0","0");
|
label = addData("0","0","0");
|
||||||
if(pagetype.equals("3")){
|
if(pagetype.equals("3")){
|
||||||
//从数据库里取
|
//从数据库里取
|
||||||
ArrayList<com.fenghoo.seven.main.kehu.Bean.addCustomerBean> addCustomerBeans = addCustomerdao.queryAll();
|
ArrayList<addCustomerBean> addCustomerBeans = addCustomerdao.queryAll();
|
||||||
if(addCustomerBeans.size()>0){
|
if(addCustomerBeans.size()>0){
|
||||||
|
|
||||||
|
|
||||||
com.fenghoo.seven.main.kehu.Bean.addCustomerBean addCustomerBean = addCustomerBeans.get(0);
|
addCustomerBean addCustomerBean = addCustomerBeans.get(0);
|
||||||
Log.e("数据的个数==", addCustomerBeans.size()+"");
|
Log.e("数据的个数==", addCustomerBeans.size()+"");
|
||||||
WidgetTools.setTextsix(textView0, "", addCustomerBean.getName());
|
WidgetTools.setTextsix(textView0, "", addCustomerBean.getName());
|
||||||
WidgetTools.setTextsix(textView4, "", addCustomerBean.getPhone());
|
WidgetTools.setTextsix(textView4, "", addCustomerBean.getPhone());
|
||||||
@@ -238,6 +238,11 @@ public class AddCusFragment extends MobanFragment implements View.OnClickListene
|
|||||||
addCustomerBean.setDecoration(labelBean.getDecorationid());
|
addCustomerBean.setDecoration(labelBean.getDecorationid());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(isSelect(label)){
|
||||||
|
ToastUtils.showToast(mContext, "请选择家装阶段");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if( AbStrUtil.isEmpty(addCustomerBean.getName())){
|
if( AbStrUtil.isEmpty(addCustomerBean.getName())){
|
||||||
ToastUtils.showToast(mContext, "请输入客户姓名");
|
ToastUtils.showToast(mContext, "请输入客户姓名");
|
||||||
return;
|
return;
|
||||||
@@ -314,31 +319,78 @@ public class AddCusFragment extends MobanFragment implements View.OnClickListene
|
|||||||
@Override
|
@Override
|
||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
//selectType 1为单选 2为多选
|
//selectType 1为单选 2为多选
|
||||||
if (selectType.equals("1")) {
|
// if (selectType.equals("1")) {
|
||||||
//先清除上次选中状态
|
// //先清除上次选中状态
|
||||||
for (int i = 0; i < label.size(); i++) {
|
// for (int i = 0; i < label.size(); i++) {
|
||||||
String isselect = label.get(i).getIf_sel_del();
|
// String isselect = label.get(i).getIf_sel_del();
|
||||||
if (isselect.equals("1")) {
|
// if (isselect.equals("1")) {
|
||||||
label.get(i).setIf_sel_del("0");
|
// label.get(i).setIf_sel_del("0");
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// item.setIf_sel_del("1");
|
||||||
|
|
||||||
|
int childposition = helper.getAdapterPosition();
|
||||||
|
//本次选择
|
||||||
|
if (IsSelecet(childposition)) {
|
||||||
|
cancalchoose(childposition);
|
||||||
|
} else {
|
||||||
|
//selectType 1为单选 2为多选
|
||||||
|
if (selectType.equals("1")) {
|
||||||
|
//先清除上次选中状态
|
||||||
|
for (int i = 0; i < label.size(); i++) {
|
||||||
|
String s = label.get(i).getIf_sel_del();
|
||||||
|
if (s.equals("1")) {
|
||||||
|
cancalchoose(i);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
selecttrue(childposition);
|
||||||
}
|
}
|
||||||
item.setIf_sel_del("1");
|
|
||||||
notifyDataSetChanged();
|
notifyDataSetChanged();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* 选中(单选)
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
private void selecttrue(int childposition) {
|
||||||
|
label.get(childposition).setIf_sel_del("1");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 当前条目是否选中
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public boolean IsSelecet(int childposition) {
|
||||||
|
|
||||||
|
if (label.get(childposition).getIf_sel_del().equals("1")) {
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 取消
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
private void cancalchoose(int childposition) {
|
||||||
|
label.get(childposition).setIf_sel_del("0");
|
||||||
|
}
|
||||||
private boolean isSelect(List<LabelBean> label) {
|
private boolean isSelect(List<LabelBean> label) {
|
||||||
boolean isselect=true;
|
boolean isselect=true;
|
||||||
for(int i=0;i<label.size();i++){
|
for(int i=0;i<label.size();i++){
|
||||||
String if_sel_del = label.get(i).getIf_sel_del();
|
String if_sel_del = label.get(i).getIf_sel_del();
|
||||||
if(if_sel_del.equals("1")){
|
if(if_sel_del.equals("1")){
|
||||||
isselect=false;
|
isselect=false;
|
||||||
}else {
|
|
||||||
isselect=true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return isselect;
|
return isselect;
|
||||||
@@ -492,6 +544,10 @@ public class AddCusFragment extends MobanFragment implements View.OnClickListene
|
|||||||
addCustomerBean.setDecoration(labelBean.getDecorationid());
|
addCustomerBean.setDecoration(labelBean.getDecorationid());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(isSelect(label)){
|
||||||
|
addCustomerBean.setDecoration("");
|
||||||
|
}
|
||||||
|
|
||||||
if (null != addCustomerdao.queryByCustom("Id", addCustomerBean.getId()) && addCustomerdao.queryByCustom("Id", addCustomerBean.getId()).size() > 0) {
|
if (null != addCustomerdao.queryByCustom("Id", addCustomerBean.getId()) && addCustomerdao.queryByCustom("Id", addCustomerBean.getId()).size() > 0) {
|
||||||
addCustomerdao.updateData(addCustomerBean);
|
addCustomerdao.updateData(addCustomerBean);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user