|
|
@@ -229,7 +229,7 @@ public class ExpenseReimbursementActivity extends BaseActivity implements View.O
|
|
|
break;
|
|
|
case 0x08:
|
|
|
if (!StringUtils.isEmpty(result)){
|
|
|
- Log.i("0x08result", result);
|
|
|
+ Log.i("0x08reasult", result);
|
|
|
keyValue = formid;
|
|
|
sendPicture();
|
|
|
}
|
|
|
@@ -241,9 +241,10 @@ public class ExpenseReimbursementActivity extends BaseActivity implements View.O
|
|
|
if (!ListUtils.isEmpty(selected_detailsData))
|
|
|
selected_detailsData.remove(cd_table_position);
|
|
|
|
|
|
- if (costFormModel_list.size() == 0)
|
|
|
+ if (costFormModel_list.size() == 0){
|
|
|
detail_table_ll.setVisibility(View.GONE);
|
|
|
-
|
|
|
+ sum_money_tv.setText(null);
|
|
|
+ }
|
|
|
dtAdapter.notifyDataSetChanged();
|
|
|
}
|
|
|
break;
|
|
|
@@ -1101,6 +1102,7 @@ public class ExpenseReimbursementActivity extends BaseActivity implements View.O
|
|
|
dtAdapter.setModels(null);
|
|
|
dtAdapter.notifyDataSetChanged();
|
|
|
detail_table_ll.setVisibility(View.GONE);
|
|
|
+ sum_money_tv.setText(null);
|
|
|
closePopupWindow();
|
|
|
return;
|
|
|
}
|
|
|
@@ -1315,6 +1317,7 @@ public class ExpenseReimbursementActivity extends BaseActivity implements View.O
|
|
|
}
|
|
|
if (ListUtils.isEmpty(models)) {
|
|
|
detail_table_ll.setVisibility(View.GONE);
|
|
|
+ sum_money_tv.setText(null);
|
|
|
}
|
|
|
notifyDataSetChanged();
|
|
|
}
|
|
|
@@ -1334,10 +1337,12 @@ public class ExpenseReimbursementActivity extends BaseActivity implements View.O
|
|
|
@Override
|
|
|
public void afterTextChanged(Editable s) {
|
|
|
if (StringUtils.isEmpty(s.toString())) return;
|
|
|
- if (!finalViewHolder.details_money.testValidity()) return;
|
|
|
- money_editString = s.toString();
|
|
|
- models.get(position).setCost_money(Double.valueOf(money_editString));
|
|
|
- doAutoCalculateJudge();
|
|
|
+ if (finalViewHolder.details_money.testValidity()){
|
|
|
+ money_editString = s.toString();
|
|
|
+ models.get(position).setCost_money(Double.valueOf(money_editString));
|
|
|
+ doAutoCalculateJudge();
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
});
|
|
|
return convertView;
|
|
|
@@ -1579,7 +1584,7 @@ public class ExpenseReimbursementActivity extends BaseActivity implements View.O
|
|
|
@Override
|
|
|
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
|
|
|
int viewType = mAdapter.getItemViewType(position);
|
|
|
-
|
|
|
+ position = (int) parent.getItemIdAtPosition(position);
|
|
|
if (viewType == 1) {
|
|
|
showSelectPictureDialog();//第一个
|
|
|
//TODO 选择图片页面
|
|
|
@@ -1627,9 +1632,39 @@ public class ExpenseReimbursementActivity extends BaseActivity implements View.O
|
|
|
builder.show();
|
|
|
}
|
|
|
private void deletePhoto(final int position) {
|
|
|
+ if (!StringUtils.isEmpty(fb_attach)) {
|
|
|
+ doDeletePAttach(position);
|
|
|
+ LogUtil.prinlnLongMsg("fb_attach",fb_attach);
|
|
|
+ }
|
|
|
mPhotoList.remove(position);
|
|
|
mAdapter.notifyDataSetInvalidated();
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 删除服务器中传来的图片,需要删除fb_attach中的id;
|
|
|
+ * @param fb_attach
|
|
|
+ * @param posi
|
|
|
+ */
|
|
|
+ private List<String> fb_attach_list;
|
|
|
+ private void doDeletePAttach(int posi) {
|
|
|
+ fb_attach_list = new ArrayList<>();
|
|
|
+ String[] split = fb_attach.split(";");
|
|
|
+ if (posi < split.length) {
|
|
|
+ for (int i = 0; i < split.length; i++) {
|
|
|
+ fb_attach_list.add(split[i]);
|
|
|
+ if (i == (split.length-1)){
|
|
|
+ fb_attach_list.remove(posi);
|
|
|
+ fb_attach = "";
|
|
|
+ for (int j = 0; j < fb_attach_list.size(); j++) {
|
|
|
+ fb_attach = fb_attach_list.get(j)+";";
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ Log.i("now_fb_attach", fb_attach.toString());
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
private void takePhoto() {
|
|
|
mNewPhotoUri = CameraUtil.getOutputMediaFileUri(this, CameraUtil.MEDIA_TYPE_IMAGE);
|
|
|
CameraUtil.captureImage(this, mNewPhotoUri, REQUEST_CODE_CAPTURE_PHOTO);
|
|
|
@@ -1692,10 +1727,11 @@ public class ExpenseReimbursementActivity extends BaseActivity implements View.O
|
|
|
for (int i = 0; i < mPhotoList.size(); i++) {
|
|
|
String path = mPhotoList.get(i);
|
|
|
sendPictureRequest(path);
|
|
|
+ now_p = i;
|
|
|
}
|
|
|
|
|
|
}
|
|
|
-
|
|
|
+ private int now_p = 0;
|
|
|
private Boolean platform = ApiUtils.getApiModel() instanceof ApiPlatform;
|
|
|
private int sended_p = 0;
|
|
|
private String update = "";
|
|
|
@@ -1704,8 +1740,13 @@ public class ExpenseReimbursementActivity extends BaseActivity implements View.O
|
|
|
if (com.xzjmyk.pm.activity.ui.erp.util.StringUtils.isEmpty(path)) return;
|
|
|
File waterBitmapToFile= new File(path);
|
|
|
if (!waterBitmapToFile.isFile()){
|
|
|
- commitSuccess(keyValue); // 重新提交请求获取来的图片,不发送直接跳转
|
|
|
- return;
|
|
|
+ if (now_p == mPhotoList.size()-1 && now_p > 0){
|
|
|
+ doUpdateId(update);
|
|
|
+ }else if (now_p == mPhotoList.size()-1 && now_p == 0){
|
|
|
+ commitSuccess(keyValue);
|
|
|
+ }else if (now_p < mPhotoList.size()-1){
|
|
|
+ return;
|
|
|
+ }
|
|
|
}
|
|
|
RequestParams params = new RequestParams();
|
|
|
if (platform){
|
|
|
@@ -1744,7 +1785,7 @@ public class ExpenseReimbursementActivity extends BaseActivity implements View.O
|
|
|
sended_p ++;
|
|
|
update = update + getID(JSON.parseObject(responseInfo.result).getString("id"))+";";
|
|
|
Log.i("update_cb_attch",update+"");
|
|
|
- if (sended_p == mPhotoList.size()){
|
|
|
+ if (now_p == mPhotoList.size()-1){
|
|
|
//TODO 更新附件ID接口
|
|
|
doUpdateId(update);
|
|
|
}
|
|
|
@@ -1781,6 +1822,9 @@ public class ExpenseReimbursementActivity extends BaseActivity implements View.O
|
|
|
Map<String,Object> params = new HashMap<>();
|
|
|
params.put("caller",caller);
|
|
|
params.put("table","FeePlease");
|
|
|
+ if (!StringUtils.isEmpty(fb_attach)){
|
|
|
+ update = fb_attach+update;
|
|
|
+ }
|
|
|
params.put("update","fb_attach='"+update+"'"); // TODO 附件字段fb_attach
|
|
|
params.put("condition","fp_id = '"+keyValue+"'");
|
|
|
params.put("type","添加附件");
|
|
|
@@ -1871,5 +1915,4 @@ public class ExpenseReimbursementActivity extends BaseActivity implements View.O
|
|
|
headers.put("Cookie", "JSESSIONID=" + CommonUtil.getSharedPreferences(ct, "sessionId"));
|
|
|
ViewUtil.httpSendRequest(ct, url, param, erhandler, headers, 0x13, null, null, "post");
|
|
|
}
|
|
|
-
|
|
|
}
|