|
|
@@ -113,6 +113,8 @@ public class DataFormDetailActivity extends BaseActivity implements View.OnClick
|
|
|
endDate="va_endtime";
|
|
|
getSupportActionBar().setTitle("请假单");
|
|
|
} else if ("SpeAttendance".equals(caller)) {
|
|
|
+ startDate="sa_appdate";
|
|
|
+ endDate="sa_enddate";
|
|
|
formidkey = "sa_id";
|
|
|
getSupportActionBar().setTitle("特殊考勤");
|
|
|
} else if ("Workovertime".equals(caller)) {
|
|
|
@@ -775,7 +777,7 @@ public class DataFormDetailActivity extends BaseActivity implements View.OnClick
|
|
|
// if (null == convertView) {
|
|
|
convertView = inflater.inflate(R.layout.listview_item_header, null);
|
|
|
// }
|
|
|
- TextView textView = (TextView) convertView.findViewById(R.id.tv_title);
|
|
|
+ final TextView textView = (TextView) convertView.findViewById(R.id.tv_title);
|
|
|
TextView item_add = (TextView) convertView.findViewById(R.id.iv_item_add);
|
|
|
RelativeLayout header = (RelativeLayout) convertView.findViewById(R.id.rl_item_header);
|
|
|
final Data itemValue = ((Data) getItem(position));
|
|
|
@@ -910,35 +912,46 @@ public class DataFormDetailActivity extends BaseActivity implements View.OnClick
|
|
|
});
|
|
|
|
|
|
model.editText.addTextChangedListener(new TextWatcher() {
|
|
|
- private String text;
|
|
|
+ private String text="";
|
|
|
|
|
|
@Override
|
|
|
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
|
|
|
- if (!StringUtils.isEmpty(s.toString())) {
|
|
|
- text = s.toString();
|
|
|
- }
|
|
|
+ text=s.toString();
|
|
|
+ LogUtil.d(text);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
|
|
-
|
|
|
+ //text=s.toString();
|
|
|
+ LogUtil.d(s.toString());
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public void afterTextChanged(Editable s) {
|
|
|
+ LogUtil.d(s.toString());
|
|
|
String type=data.getType();
|
|
|
String length=data.getMaxlength();
|
|
|
if ("N".equals(type)&&!StringUtils.isEmpty(s.toString())){
|
|
|
- if (!RegexUtil.checkRegex(s.toString(),"^[0-9]+(.[0-9]{1})?$")){
|
|
|
- if (!StringUtils.isEmpty(s.toString()) && !StringUtils.isEmpty(text)) {
|
|
|
- if (s.toString().length() >=text.length()) {
|
|
|
- ToastMessage(data.getName() + "只能输入数值!");
|
|
|
- } else {
|
|
|
-
|
|
|
- }
|
|
|
- }
|
|
|
+ boolean falg=true;
|
|
|
+
|
|
|
+ CommonUtil.counter=0;
|
|
|
+ if (s.toString().length()==2&&CommonUtil.countStr(s.toString(),".")==1){
|
|
|
+
|
|
|
+ falg=false;
|
|
|
+ }
|
|
|
+ LogUtil.d(s.toString().length()+"");
|
|
|
+ LogUtil.d(CommonUtil.countStr(s.toString(), ".")+"");
|
|
|
+ //true&&true
|
|
|
+ if (!RegexUtil.checkRegex(s.toString(), "^[0-9]+(.[0-9]{1})?$")&&falg){
|
|
|
+ LogUtil.d("表达式验证不通过............"+s.toString());
|
|
|
+ //验证不通过的
|
|
|
+ model.editText.setText(text);
|
|
|
+
|
|
|
+ model.editText.setSelection(model.editText.getText().length());
|
|
|
+
|
|
|
+
|
|
|
}else{
|
|
|
- //限制长度
|
|
|
+ LogUtil.d("表达式验证通过............"+s.toString());
|
|
|
if (s.toString().length()>Integer.valueOf(length)){
|
|
|
ToastMessage(data.getName() + "超出限制字符长度"+Integer.valueOf(length));
|
|
|
}else{
|
|
|
@@ -948,7 +961,14 @@ public class DataFormDetailActivity extends BaseActivity implements View.OnClick
|
|
|
}else{
|
|
|
data.setValue(s.toString());
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
});
|
|
|
|
|
|
if (!StringUtils.isEmpty(data.getValue())) {
|
|
|
@@ -1155,12 +1175,12 @@ public class DataFormDetailActivity extends BaseActivity implements View.OnClick
|
|
|
* @author:Arison on 2016/11/17
|
|
|
*/
|
|
|
public void commit() {
|
|
|
- LogUtil.d("提交操作:" + JSON.toJSONString(mDatas));
|
|
|
+ //LogUtil.d("提交操作:" + JSON.toJSONString(mDatas));
|
|
|
StringBuffer forStore = new StringBuffer("{");
|
|
|
StringBuffer gridStore = new StringBuffer("[");
|
|
|
//判断是否有明细项
|
|
|
if (groupData != null) {//存在明细
|
|
|
- ArrayList<Data> items = mDatas.get(0).getDatas();
|
|
|
+ ArrayList<Data> items = mAdapter.getmListData().get(0).getDatas();
|
|
|
if (!ListUtils.isEmpty(items)) {
|
|
|
String start="";
|
|
|
String startName="";
|
|
|
@@ -1208,8 +1228,8 @@ public class DataFormDetailActivity extends BaseActivity implements View.OnClick
|
|
|
String d_start="";
|
|
|
String startName="";
|
|
|
String d_end="";
|
|
|
- for (int i = 1; i < mDatas.size(); i++) {
|
|
|
- items = mDatas.get(i).getDatas();
|
|
|
+ for (int i = 1; i < mAdapter.getmListData().size(); i++) {
|
|
|
+ items = mAdapter.getmListData().get(i).getDatas();
|
|
|
if (!ListUtils.isEmpty(items)) {
|
|
|
gridStore.append("{");
|
|
|
for (int j = 0; j < items.size(); j++) {
|
|
|
@@ -1249,7 +1269,7 @@ public class DataFormDetailActivity extends BaseActivity implements View.OnClick
|
|
|
}
|
|
|
|
|
|
}
|
|
|
- if (i == mDatas.size() - 1) {
|
|
|
+ if (i == mAdapter.getmListData().size() - 1) {
|
|
|
gridStore.append("}");
|
|
|
} else {
|
|
|
gridStore.append("},");
|
|
|
@@ -1261,7 +1281,7 @@ public class DataFormDetailActivity extends BaseActivity implements View.OnClick
|
|
|
LogUtil.d("girdStore:" + gridStore.toString());
|
|
|
saveData(forStore.toString(), gridStore.toString());
|
|
|
} else {
|
|
|
- ArrayList<Data> items = mDatas.get(0).getDatas();
|
|
|
+ ArrayList<Data> items = mAdapter.getmListData().get(0).getDatas();
|
|
|
if (!ListUtils.isEmpty(items)) {
|
|
|
String start="";
|
|
|
String startName="";
|
|
|
@@ -1459,15 +1479,15 @@ public class DataFormDetailActivity extends BaseActivity implements View.OnClick
|
|
|
* @desc:重新提交
|
|
|
* @author:Arison on 2016/12/8
|
|
|
*/
|
|
|
- public void commitAfter() {
|
|
|
- String url = Constants.getAppBaseUrl(ct) + "/mobile/commonres.action";
|
|
|
- Map<String, Object> params = new HashMap<>();
|
|
|
- params.put("caller", caller);
|
|
|
- params.put("id", formid);
|
|
|
- LinkedHashMap<String, Object> headers = new LinkedHashMap<>();
|
|
|
- headers.put("Cookie", "JSESSIONID=" + CommonUtil.getSharedPreferences(ct, "sessionId"));
|
|
|
- ViewUtil.httpSendRequest(ct, url, params, mHandler, headers, 0x20, null, null, "post");
|
|
|
- }
|
|
|
+// public void commitAfter() {
|
|
|
+// String url = Constants.getAppBaseUrl(ct) + "/mobile/commonres.action";
|
|
|
+// Map<String, Object> params = new HashMap<>();
|
|
|
+// params.put("caller", caller);
|
|
|
+// params.put("id", formid);
|
|
|
+// LinkedHashMap<String, Object> headers = new LinkedHashMap<>();
|
|
|
+// headers.put("Cookie", "JSESSIONID=" + CommonUtil.getSharedPreferences(ct, "sessionId"));
|
|
|
+// ViewUtil.httpSendRequest(ct, url, params, mHandler, headers, 0x20, null, null, "post");
|
|
|
+// }
|
|
|
|
|
|
/**
|
|
|
* 监听Back键按下事件,方法2:
|