|
@@ -2,12 +2,14 @@ package com.jiaju.adapter;
|
|
|
|
|
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
|
|
|
-import com.jiaju.activity.R;
|
|
|
|
|
|
|
+import com.jiaju.activity.R;
|
|
|
|
|
+import com.jiaju.activity.SendOutGoods;
|
|
|
import com.jiaju.model.DefectDataDetailModel;
|
|
import com.jiaju.model.DefectDataDetailModel;
|
|
|
import com.jiaju.model.DeliveryNoteInquiryItemModel;
|
|
import com.jiaju.model.DeliveryNoteInquiryItemModel;
|
|
|
-
|
|
|
|
|
|
|
+import android.annotation.SuppressLint;
|
|
|
import android.app.Activity;
|
|
import android.app.Activity;
|
|
|
import android.content.Context;
|
|
import android.content.Context;
|
|
|
|
|
+import android.content.Intent;
|
|
|
import android.view.LayoutInflater;
|
|
import android.view.LayoutInflater;
|
|
|
import android.view.View;
|
|
import android.view.View;
|
|
|
import android.view.ViewGroup;
|
|
import android.view.ViewGroup;
|
|
@@ -43,6 +45,7 @@ public class DeliveryNoteInquiryItemAdapter extends BaseAdapter{
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ @SuppressLint("ResourceAsColor")
|
|
|
@Override
|
|
@Override
|
|
|
public View getView(final int position, View convertView, ViewGroup parent) {
|
|
public View getView(final int position, View convertView, ViewGroup parent) {
|
|
|
DeliveryNoteInquiryItemModel deliverynoteInquiryitemModel = null;
|
|
DeliveryNoteInquiryItemModel deliverynoteInquiryitemModel = null;
|
|
@@ -65,6 +68,7 @@ public class DeliveryNoteInquiryItemAdapter extends BaseAdapter{
|
|
|
viewHolder.RevokeTv = (TextView) convertView.findViewById(R.id.revoke);
|
|
viewHolder.RevokeTv = (TextView) convertView.findViewById(R.id.revoke);
|
|
|
viewHolder.linQINQI = (LinearLayout) convertView.findViewById(R.id.lin_jump);
|
|
viewHolder.linQINQI = (LinearLayout) convertView.findViewById(R.id.lin_jump);
|
|
|
viewHolder.CheckBoxDetail = (CheckBox) convertView.findViewById(R.id.checkBox_detail);
|
|
viewHolder.CheckBoxDetail = (CheckBox) convertView.findViewById(R.id.checkBox_detail);
|
|
|
|
|
+ viewHolder.backgroundcolor= (LinearLayout) convertView.findViewById(R.id.backgroundcolor);
|
|
|
convertView.setTag(viewHolder);
|
|
convertView.setTag(viewHolder);
|
|
|
} else {
|
|
} else {
|
|
|
viewHolder = (ViewHolder) convertView.getTag();
|
|
viewHolder = (ViewHolder) convertView.getTag();
|
|
@@ -77,23 +81,40 @@ public class DeliveryNoteInquiryItemAdapter extends BaseAdapter{
|
|
|
viewHolder.PostingDateTv.setText(deliverynoteInquiryitemModel.getPostingDate());
|
|
viewHolder.PostingDateTv.setText(deliverynoteInquiryitemModel.getPostingDate());
|
|
|
viewHolder.DeliveryDateTv.setText(deliverynoteInquiryitemModel.getDeliveryDate());
|
|
viewHolder.DeliveryDateTv.setText(deliverynoteInquiryitemModel.getDeliveryDate());
|
|
|
viewHolder.SynchronizationStatusTv.setText(deliverynoteInquiryitemModel.getSynchronizationStatus());
|
|
viewHolder.SynchronizationStatusTv.setText(deliverynoteInquiryitemModel.getSynchronizationStatus());
|
|
|
- viewHolder.RevokeTv.setText(deliverynoteInquiryitemModel.getRevoke());
|
|
|
|
|
|
|
+ viewHolder.RevokeTv.setText(deliverynoteInquiryitemModel.getRevoke());
|
|
|
|
|
+ viewHolder.backgroundcolor.setOnClickListener(new View.OnClickListener() {
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void onClick(View v) {
|
|
|
|
|
+ //椤甸潰璺宠浆
|
|
|
|
|
+// Toast.makeText(mContext, "杩欐槸涓€鏉�oast鎻愮ず淇℃伅"+ list.get(position).getSendoutCode(), Toast.LENGTH_SHORT).show();
|
|
|
|
|
+ Intent intent = new Intent();
|
|
|
|
|
+ intent.setClass(mContext, SendOutGoods.class);
|
|
|
|
|
+ intent.putExtra("sendoutCode", list.get(position).getSendoutCode());
|
|
|
|
|
+ mContext.startActivity(intent);
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ //鍚屾�鐘舵€佷负澶辫触
|
|
|
|
|
+ if (deliverynoteInquiryitemModel.getAmendsState()=="2") {
|
|
|
|
|
+ //璁剧疆鑳屾櫙棰滆壊涓洪粍鑹�
|
|
|
|
|
+ convertView.setBackgroundColor(mContext.getResources().getColor(R.color.yellow));
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
viewHolder.CheckBoxDetail.setOnClickListener(new View.OnClickListener() {
|
|
viewHolder.CheckBoxDetail.setOnClickListener(new View.OnClickListener() {
|
|
|
@Override
|
|
@Override
|
|
|
public void onClick(View v) {
|
|
public void onClick(View v) {
|
|
|
ViewHolder holder = (ViewHolder) ((View) v.getParent()).getTag();
|
|
ViewHolder holder = (ViewHolder) ((View) v.getParent()).getTag();
|
|
|
|
|
|
|
|
- // 获取数据集合
|
|
|
|
|
|
|
+ // 鑾峰彇鏁版嵁闆嗗悎
|
|
|
List<DeliveryNoteInquiryItemModel> dataList = list ;
|
|
List<DeliveryNoteInquiryItemModel> dataList = list ;
|
|
|
- // 修改对应位置的数据的CheckBoxFlag属性值
|
|
|
|
|
|
|
+ // 淇�敼瀵瑰簲浣嶇疆鐨勬暟鎹�殑CheckBoxFlag灞炴€у€�
|
|
|
dataList.get(position).setCheckBoxFlag(((CheckBox) v).isChecked());
|
|
dataList.get(position).setCheckBoxFlag(((CheckBox) v).isChecked());
|
|
|
- // 通知ListView数据已更改,以便更新界面显示
|
|
|
|
|
|
|
+ // 閫氱煡ListView鏁版嵁宸叉洿鏀癸紝浠ヤ究鏇存柊鐣岄潰鏄剧ず
|
|
|
notifyDataSetChanged();
|
|
notifyDataSetChanged();
|
|
|
// if (((CheckBox) v).isChecked()) {
|
|
// if (((CheckBox) v).isChecked()) {
|
|
|
-// Toast.makeText(mContext, "复选框已选中", Toast.LENGTH_SHORT).show();
|
|
|
|
|
|
|
+// Toast.makeText(mContext, "澶嶉€夋�宸查€変腑", Toast.LENGTH_SHORT).show();
|
|
|
//
|
|
//
|
|
|
// } else {
|
|
// } else {
|
|
|
-// Toast.makeText(mContext, "复选框已取消选中", Toast.LENGTH_SHORT).show();
|
|
|
|
|
|
|
+// Toast.makeText(mContext, "澶嶉€夋�宸插彇娑堥€変腑", Toast.LENGTH_SHORT).show();
|
|
|
// }
|
|
// }
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
@@ -102,27 +123,28 @@ public class DeliveryNoteInquiryItemAdapter extends BaseAdapter{
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private class ViewHolder {
|
|
private class ViewHolder {
|
|
|
- /**发货单号*/
|
|
|
|
|
|
|
+ /**鍙戣揣鍗曞彿*/
|
|
|
TextView SendoutCodeTv;
|
|
TextView SendoutCodeTv;
|
|
|
- /**发出仓库*/
|
|
|
|
|
|
|
+ /**鍙戝嚭浠撳簱*/
|
|
|
TextView SendOutWarehouseTv;
|
|
TextView SendOutWarehouseTv;
|
|
|
- /**接收仓库*/
|
|
|
|
|
|
|
+ /**鎺ユ敹浠撳簱*/
|
|
|
TextView ReceivingWarehouseTv;
|
|
TextView ReceivingWarehouseTv;
|
|
|
- /**车牌号*/
|
|
|
|
|
|
|
+ /**杞︾墝鍙�*/
|
|
|
TextView LicensePlateNumberTv;
|
|
TextView LicensePlateNumberTv;
|
|
|
- /**记账日期*/
|
|
|
|
|
|
|
+ /**璁拌处鏃ユ湡*/
|
|
|
TextView PostingDateTv;
|
|
TextView PostingDateTv;
|
|
|
- /**送货日期*/
|
|
|
|
|
|
|
+ /**閫佽揣鏃ユ湡*/
|
|
|
TextView DeliveryDateTv;
|
|
TextView DeliveryDateTv;
|
|
|
- /**同步状态*/
|
|
|
|
|
|
|
+ /**鍚屾�鐘舵€�*/
|
|
|
TextView SynchronizationStatusTv;
|
|
TextView SynchronizationStatusTv;
|
|
|
- /**撤销状态*/
|
|
|
|
|
|
|
+ /**鎾ら攢鐘舵€�*/
|
|
|
TextView RevokeTv;
|
|
TextView RevokeTv;
|
|
|
- /**多选按钮*/
|
|
|
|
|
|
|
+ /**澶氶€夋寜閽�*/
|
|
|
CheckBox CheckBoxDetail;
|
|
CheckBox CheckBoxDetail;
|
|
|
- /**点击布局*/
|
|
|
|
|
|
|
+ /**鐐瑰嚮甯冨眬*/
|
|
|
LinearLayout linQINQI;
|
|
LinearLayout linQINQI;
|
|
|
-
|
|
|
|
|
|
|
+ /**鑳屾櫙棰滆壊*/
|
|
|
|
|
+ LinearLayout backgroundcolor;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
}
|
|
}
|