|
|
@@ -21,6 +21,7 @@ import android.view.ViewGroup;
|
|
|
import android.widget.BaseAdapter;
|
|
|
import android.widget.Button;
|
|
|
import android.widget.EditText;
|
|
|
+import android.widget.ImageView;
|
|
|
import android.widget.LinearLayout;
|
|
|
import android.widget.RelativeLayout;
|
|
|
import android.widget.TextView;
|
|
|
@@ -42,7 +43,9 @@ import com.core.app.MyApplication;
|
|
|
import com.core.base.BaseActivity;
|
|
|
import com.core.model.SelectBean;
|
|
|
import com.core.net.http.ViewUtil;
|
|
|
+import com.core.net.utils.NetUtils;
|
|
|
import com.core.utils.CommonUtil;
|
|
|
+import com.core.utils.ToastUtil;
|
|
|
import com.core.utils.time.wheel.DateTimePicker;
|
|
|
import com.core.widget.view.Activity.SelectActivity;
|
|
|
import com.core.widget.view.ListViewInScroller;
|
|
|
@@ -52,7 +55,6 @@ import com.core.widget.view.selectcalendar.bean.Data;
|
|
|
import com.lidroid.xutils.ViewUtils;
|
|
|
import com.modular.apputils.activity.SelectNetAcitivty;
|
|
|
import com.modular.apputils.utils.PopupWindowHelper;
|
|
|
-import com.modular.apputils.utils.SwitchUtil;
|
|
|
import com.uas.appworks.OA.erp.activity.CommonDocDetailsActivity;
|
|
|
import com.uas.appworks.OA.erp.model.form.GroupData;
|
|
|
import com.uas.appworks.R;
|
|
|
@@ -1078,13 +1080,15 @@ public class TravelDataFormDetailActivity extends BaseActivity implements View.O
|
|
|
});
|
|
|
break;
|
|
|
case TYPE_ITEM:
|
|
|
- ViewModel model;
|
|
|
+ DataAdapter.ViewModel model;
|
|
|
if (true) {
|
|
|
convertView = inflater.inflate(R.layout.listitem_businessless_edit, parent, false);
|
|
|
- model = new ViewModel();
|
|
|
+ model = new DataAdapter.ViewModel();
|
|
|
model.text = (TextView) convertView.findViewById(R.id.tv_less_key);
|
|
|
model.editText = (EditText) convertView.findViewById(R.id.tv_less_value);
|
|
|
model.ll_moment = (LinearLayout) convertView.findViewById(R.id.ll_moment);
|
|
|
+ model.selectIv = convertView.findViewById(R.id.selectIv);
|
|
|
+ model.muchInputTv = convertView.findViewById(R.id.muchInputTv);
|
|
|
model.editText.setBackgroundResource(R.color.transparent);
|
|
|
convertView.setTag(model);
|
|
|
} else {
|
|
|
@@ -1095,14 +1099,15 @@ public class TravelDataFormDetailActivity extends BaseActivity implements View.O
|
|
|
final Data data = (Data) getItem(position);
|
|
|
HashMap<String, Object> results = isLastItem(position);
|
|
|
final Integer categoryIndex = (Integer) results.get("categoryIndex");
|
|
|
- final Integer groupIndex = (Integer) results.get("groupIndex");
|
|
|
-
|
|
|
model.text.setText(data.getName());
|
|
|
if ("F".equals(data.getReadonly()) || "necessaryField".equals(data.getReadonly())) {
|
|
|
- model.editText.setHint("请输入(必填)");
|
|
|
+ model.editText.setHint("请输入");
|
|
|
+ model.muchInputTv.setVisibility(View.VISIBLE);
|
|
|
} else {
|
|
|
model.editText.setHint("请输入");
|
|
|
+ model.muchInputTv.setVisibility(View.GONE);
|
|
|
}
|
|
|
+ model.selectIv.setVisibility(View.GONE);
|
|
|
if (data.getType().equals("D") ||
|
|
|
data.getType().equals("C") ||
|
|
|
data.getType().equals("MF") ||
|
|
|
@@ -1110,7 +1115,8 @@ public class TravelDataFormDetailActivity extends BaseActivity implements View.O
|
|
|
data.getType().equals("DF")) {
|
|
|
model.editText.setKeyListener(null);
|
|
|
model.editText.setFocusable(false);
|
|
|
- model.editText.setHint("F".equals(data.getReadonly())?"请选择(必选)":"请选择");
|
|
|
+ model.editText.setHint("请选择");
|
|
|
+ model.selectIv.setVisibility(View.VISIBLE);
|
|
|
}
|
|
|
if (data.isEditing()) {
|
|
|
model.editText.setEnabled(true);
|
|
|
@@ -1127,6 +1133,10 @@ public class TravelDataFormDetailActivity extends BaseActivity implements View.O
|
|
|
editText.setOnClickListener(new View.OnClickListener() {
|
|
|
@Override
|
|
|
public void onClick(View v) {
|
|
|
+ if (!NetUtils.isNetWorkConnected(ct)) {
|
|
|
+ ToastUtil.showToast(ct, R.string.networks_out);
|
|
|
+ return;
|
|
|
+ }
|
|
|
if (data.getType().equals("D")) {
|
|
|
boolean hasMenu = false;
|
|
|
if ("Ask4Leave".equals(caller)) hasMenu = true;
|
|
|
@@ -1162,6 +1172,7 @@ public class TravelDataFormDetailActivity extends BaseActivity implements View.O
|
|
|
intent.putExtras(bundle);
|
|
|
intent.putExtra("key", "combdatas");
|
|
|
intent.putExtra("showKey", "DISPLAY");
|
|
|
+// intent.putExtra("method", "get");
|
|
|
//mobile/common/getCombo.action
|
|
|
intent.putExtra("action", "mobile/common/getComboValue.action");//
|
|
|
intent.putExtra("title", data.getName());
|
|
|
@@ -1170,75 +1181,68 @@ public class TravelDataFormDetailActivity extends BaseActivity implements View.O
|
|
|
startActivityForResult(intent, categoryIndex);
|
|
|
isLeave = true;
|
|
|
}
|
|
|
-
|
|
|
- if (data.getType().equals("MF") || data.getType().equals("SF")) {
|
|
|
-// HashMap param = new HashMap<>();
|
|
|
-// String[] fields = new String[]{"sa_custname"};
|
|
|
-// if (caller.equals("StandbyApplication")) {
|
|
|
-// fields = new String[]{"sa_custname"};
|
|
|
-// }
|
|
|
-// if (caller.equals("MaterielApply")) {
|
|
|
-// fields = new String[]{"ama_customer"};
|
|
|
-// }
|
|
|
-// param.put("caller", caller);
|
|
|
-// LogUtil.d("DataFormDetailActivity", "SelectNetAcitivty:" + caller);
|
|
|
-// if (caller.equals("MainTain")) {
|
|
|
-// if ("mt_custcode".equals(data.getField())) {
|
|
|
-// fields = new String[]{"mt_custname"};
|
|
|
-// }
|
|
|
-// if ("mt_text1".equals(data.getField())) {
|
|
|
-// fields = new String[]{"mt_text2"};
|
|
|
-// }
|
|
|
-// if ("mt_ckcode".equals(data.getField())) {
|
|
|
-// fields = new String[]{"mt_row", "so_custname", "sod_jx", "sod_remark", "sod_unback"};
|
|
|
-// }
|
|
|
-// if ("mtd_procode".equals(data.getField())) {
|
|
|
-// fields = new String[]{"mtd_proname", "mtd_remark", "mtd_unit"};
|
|
|
-// param.put("caller", "sProduct");
|
|
|
-// }
|
|
|
-// } else {
|
|
|
-// //SF类型需求更改,支持联动
|
|
|
-// LogUtil.d("DataFormDetailActivity", "SelectNetAcitivty:" + caller);
|
|
|
-// startActivityForResult(new Intent(ct, SelectNetAcitivty.class)
|
|
|
-// .putExtra("fieldKey", data.getField())
|
|
|
-// .putExtra("caller", caller)
|
|
|
-// .putExtra("isForm", true)//是否是主表
|
|
|
-// , 90);
|
|
|
-// return;//不处理下面旧的处理逻辑
|
|
|
-// }
|
|
|
-// param.put("page", "1");
|
|
|
-// param.put("which", "form");
|
|
|
-// param.put("condition", "1=1");
|
|
|
-// param.put("pageSize", "30");
|
|
|
-// param.put("field", data.getField());
|
|
|
-// Bundle bundle = new Bundle();
|
|
|
-// bundle.putSerializable("param", param);
|
|
|
-// Intent intent = new Intent(ct, SelectActivity.class);
|
|
|
-// intent.putExtra("type", 1);
|
|
|
-// if (data.getType().equals("SF")) {
|
|
|
-// intent.putExtra("isSingle", true);
|
|
|
-// } else {
|
|
|
-// intent.putExtra("isSingle", false);
|
|
|
-// }
|
|
|
-//
|
|
|
-// intent.putExtra("reid", R.style.OAThemeMeet);
|
|
|
-// intent.putExtras(bundle);
|
|
|
-// intent.putExtra("key", "combdatas");
|
|
|
-// intent.putExtra("showKey", data.getField());
|
|
|
-// intent.putExtra("fields", fields);
|
|
|
-// intent.putExtra("action", "common/dbfind.action");
|
|
|
-// intent.putExtra("title", data.getName());
|
|
|
-// intent.putExtra("id", categoryIndex);
|
|
|
-// intent.putExtra("object", data);
|
|
|
-// startActivityForResult(intent, categoryIndex);
|
|
|
- clickGroupId = groupIndex;
|
|
|
+ if (data.getType().equals("SF")) {
|
|
|
startActivityForResult(new Intent(ct, SelectNetAcitivty.class)
|
|
|
.putExtra("fieldKey", data.getField())
|
|
|
.putExtra("caller", caller)
|
|
|
- .putExtra("dataForm", true)
|
|
|
- .putExtra("isForm", true)//是否是主表
|
|
|
+ .putExtra("isDevice", true)
|
|
|
+ .putExtra("device", data.getName().equals("设备编号"))
|
|
|
+ .putExtra("isForm", true)
|
|
|
, 90);
|
|
|
isLeave = true;
|
|
|
+ } else if (data.getType().equals("MF")) {
|
|
|
+
|
|
|
+ HashMap param = new HashMap<>();
|
|
|
+ String[] fields = new String[]{"sa_custname"};
|
|
|
+ if (caller.equals("StandbyApplication")) {
|
|
|
+ fields = new String[]{"sa_custname"};
|
|
|
+ }
|
|
|
+ if (caller.equals("MaterielApply")) {
|
|
|
+ fields = new String[]{"ama_customer"};
|
|
|
+ }
|
|
|
+ param.put("caller", caller);
|
|
|
+ if (caller.equals("MainTain")) {
|
|
|
+ if ("mt_custcode".equals(data.getField())) {
|
|
|
+ fields = new String[]{"mt_custname"};
|
|
|
+ }
|
|
|
+ if ("mt_text1".equals(data.getField())) {
|
|
|
+ fields = new String[]{"mt_text2"};
|
|
|
+ }
|
|
|
+ if ("mt_ckcode".equals(data.getField())) {
|
|
|
+ fields = new String[]{"mt_row", "so_custname", "sod_jx", "sod_remark", "sod_unback"};
|
|
|
+ }
|
|
|
+ if ("mtd_procode".equals(data.getField())) {
|
|
|
+ fields = new String[]{"mtd_proname", "mtd_remark", "mtd_unit"};
|
|
|
+ param.put("caller", "sProduct");
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ param.put("page", "1");
|
|
|
+ param.put("which", "form");
|
|
|
+ param.put("condition", "1=1");
|
|
|
+ param.put("pageSize", "30");
|
|
|
+ param.put("field", data.getField());
|
|
|
+ Bundle bundle = new Bundle();
|
|
|
+ bundle.putSerializable("param", param);
|
|
|
+ Intent intent = new Intent(ct, SelectActivity.class);
|
|
|
+ intent.putExtra("type", 1);
|
|
|
+ if (data.getType().equals("SF")) {
|
|
|
+ intent.putExtra("isSingle", true);
|
|
|
+ } else {
|
|
|
+ intent.putExtra("isSingle", false);
|
|
|
+ }
|
|
|
+
|
|
|
+ intent.putExtra("reid", R.style.OAThemeMeet);
|
|
|
+ intent.putExtras(bundle);
|
|
|
+ intent.putExtra("key", "combdatas");
|
|
|
+ intent.putExtra("showKey", data.getField());
|
|
|
+ intent.putExtra("fields", fields);
|
|
|
+ intent.putExtra("action", "common/dbfind.action");
|
|
|
+ intent.putExtra("title", data.getName());
|
|
|
+ intent.putExtra("id", categoryIndex);
|
|
|
+ intent.putExtra("object", data);
|
|
|
+ startActivityForResult(intent, categoryIndex);
|
|
|
+
|
|
|
isLeave = true;
|
|
|
}
|
|
|
//连带操作
|
|
|
@@ -1250,52 +1254,49 @@ public class TravelDataFormDetailActivity extends BaseActivity implements View.O
|
|
|
currentGroupId = data.getGroupId();
|
|
|
startActivityForResult(intent, 0x23);
|
|
|
} else {
|
|
|
-// HashMap param = new HashMap<>();
|
|
|
-// String[] fields = new String[]{"sa_custname"};
|
|
|
-// if (caller.equals("StandbyApplication")) {
|
|
|
-//
|
|
|
-// }
|
|
|
-// if (caller.equals("MaterielApply")) {
|
|
|
-// fields = new String[]{"amad_spec", "amad_sysname", "amad_unit"};
|
|
|
-// }
|
|
|
-// param.put("which", "form");
|
|
|
-// param.put("caller", caller);
|
|
|
-// if (caller.equals("MainTain")) {
|
|
|
-// fields = new String[]{"mtd_proname", "mtd_remark", "mtd_unit"};
|
|
|
-// param.put("caller", "sProduct");
|
|
|
-// param.put("which", "grid");
|
|
|
-// }
|
|
|
-// param.put("page", "1");
|
|
|
-// param.put("condition", "1=1");
|
|
|
-// param.put("pageSize", "3000");
|
|
|
-// param.put("field", data.getField());
|
|
|
-// Bundle bundle = new Bundle();
|
|
|
-// bundle.putSerializable("param", param);
|
|
|
-// Intent intent = new Intent(ct, SelectActivity.class);
|
|
|
-// intent.putExtra("type", 1);
|
|
|
-// intent.putExtra("reid", R.style.OAThemeMeet);
|
|
|
-// intent.putExtras(bundle);
|
|
|
-// intent.putExtra("key", "combdatas");
|
|
|
-// intent.putExtra("showKey", data.getField());
|
|
|
-// intent.putExtra("fields", fields);
|
|
|
-// intent.putExtra("action", "common/dbfind.action");
|
|
|
-// intent.putExtra("title", data.getName());
|
|
|
-// intent.putExtra("id", categoryIndex);
|
|
|
-// intent.putExtra("object", data);
|
|
|
-// startActivityForResult(intent, categoryIndex);
|
|
|
- clickGroupId = groupIndex;
|
|
|
- startActivityForResult(new Intent(ct, SelectNetAcitivty.class)
|
|
|
- .putExtra("fieldKey", data.getField())
|
|
|
- .putExtra("caller", caller)
|
|
|
- .putExtra("dataForm", true)
|
|
|
- .putExtra("isForm", true)//是否是主表
|
|
|
- , 90);
|
|
|
+ HashMap param = new HashMap<>();
|
|
|
+ String[] fields = new String[]{"sa_custname"};
|
|
|
+ if (caller.equals("StandbyApplication")) {
|
|
|
+
|
|
|
+ }
|
|
|
+ if (caller.equals("MaterielApply")) {
|
|
|
+ fields = new String[]{"amad_spec", "amad_sysname", "amad_unit"};
|
|
|
+ }
|
|
|
+ param.put("which", "form");
|
|
|
+ param.put("caller", caller);
|
|
|
+ if (caller.equals("MainTain")) {
|
|
|
+ fields = new String[]{"mtd_proname", "mtd_remark", "mtd_unit"};
|
|
|
+ param.put("caller", "sProduct");
|
|
|
+ param.put("which", "grid");
|
|
|
+ }
|
|
|
+ param.put("page", "1");
|
|
|
+ param.put("condition", "1=1");
|
|
|
+ param.put("pageSize", "30");
|
|
|
+ param.put("field", data.getField());
|
|
|
+ Bundle bundle = new Bundle();
|
|
|
+ bundle.putSerializable("param", param);
|
|
|
+ Intent intent = new Intent(ct, SelectActivity.class);
|
|
|
+ intent.putExtra("type", 1);
|
|
|
+ intent.putExtra("reid", R.style.OAThemeMeet);
|
|
|
+ intent.putExtras(bundle);
|
|
|
+ intent.putExtra("key", "combdatas");
|
|
|
+ intent.putExtra("showKey", data.getField());
|
|
|
+ intent.putExtra("fields", fields);
|
|
|
+ intent.putExtra("action", "common/dbfind.action");
|
|
|
+ intent.putExtra("title", data.getName());
|
|
|
+ intent.putExtra("id", categoryIndex);
|
|
|
+ intent.putExtra("object", data);
|
|
|
+ startActivityForResult(intent, categoryIndex);
|
|
|
isLeave = true;
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
});
|
|
|
|
|
|
+
|
|
|
editText.addTextChangedListener(new TextWatcher() {
|
|
|
private String text = "";
|
|
|
|
|
|
@@ -1350,7 +1351,9 @@ public class TravelDataFormDetailActivity extends BaseActivity implements View.O
|
|
|
|
|
|
class ViewModel {
|
|
|
TextView text;
|
|
|
+ TextView muchInputTv;
|
|
|
EditText editText;
|
|
|
+ ImageView selectIv;
|
|
|
LinearLayout ll_moment;
|
|
|
}
|
|
|
}
|