|
|
@@ -254,7 +254,7 @@ public class ExpenseReimbursementActivity extends BaseActivity implements View.O
|
|
|
try {
|
|
|
JSONObject resultObject = JSON.parseObject(result);
|
|
|
if (resultObject != null){
|
|
|
- CostUpdatePModel mCostUpdatePModel = new CostUpdatePModel();
|
|
|
+ mCostUpdatePModel = new CostUpdatePModel();
|
|
|
mCostUpdatePModel = JSON.parseObject(JSON.toJSONString(resultObject),CostUpdatePModel.class);
|
|
|
doShowUpP(mCostUpdatePModel);
|
|
|
}
|
|
|
@@ -329,8 +329,7 @@ public class ExpenseReimbursementActivity extends BaseActivity implements View.O
|
|
|
}
|
|
|
}
|
|
|
};
|
|
|
-
|
|
|
-
|
|
|
+ private CostUpdatePModel mCostUpdatePModel;
|
|
|
|
|
|
|
|
|
private void doShowUpP(CostUpdatePModel mCostUpdatePModel) {
|
|
|
@@ -607,7 +606,6 @@ public class ExpenseReimbursementActivity extends BaseActivity implements View.O
|
|
|
|
|
|
private void doShowFormData(JSONArray formdataArray, List<CommonDocAMBean.DatasBean.FormconfigsBean> mFormconfigsList) {
|
|
|
if (!ListUtils.isEmpty(mFormconfigsList) && !ListUtils.isEmpty(formdataArray)){
|
|
|
- Log.i("fb_attach_ss",fb_attach+"?");
|
|
|
for (int i = 0; i < mFormconfigsList.size(); i++) {
|
|
|
String key = mFormconfigsList.get(i).getFD_FIELD();
|
|
|
if (StringUtils.isEmpty(key)) return;
|
|
|
@@ -630,6 +628,7 @@ public class ExpenseReimbursementActivity extends BaseActivity implements View.O
|
|
|
}
|
|
|
|
|
|
fb_attach = formdataArray.getJSONObject(0).getString("fb_attach");
|
|
|
+ Log.i("fb_attach_ss",fb_attach+"?");
|
|
|
if (!StringUtils.isEmpty(fb_attach)) {
|
|
|
getUpdatePicture(); //获取发票图片
|
|
|
}else {
|
|
|
@@ -1599,14 +1598,16 @@ 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);
|
|
|
+ int mPosition = (int) parent.getItemIdAtPosition(position);
|
|
|
if (viewType == 1) {
|
|
|
showSelectPictureDialog();//第一个
|
|
|
//TODO 选择图片页面
|
|
|
// startActivityForResult(new Intent(ct, PhoneSelectActivity.class), 222);
|
|
|
} else {
|
|
|
- showPictureActionDialog(position);
|
|
|
+ showPictureActionDialog(mPosition);
|
|
|
}
|
|
|
+
|
|
|
+ Log.i("P_position",mPosition+"");
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
@@ -1626,20 +1627,21 @@ public class ExpenseReimbursementActivity extends BaseActivity implements View.O
|
|
|
});
|
|
|
builder.show();
|
|
|
}
|
|
|
- private void showPictureActionDialog(final int position) {
|
|
|
+ private void showPictureActionDialog(final int mPosition) {
|
|
|
String[] items = new String[]{getString(R.string.look_over), getString(R.string.common_delete)};
|
|
|
AlertDialog.Builder builder = new AlertDialog.Builder(this).setTitle(R.string.pictures)
|
|
|
.setSingleChoiceItems(items, 0, new DialogInterface.OnClickListener() {
|
|
|
@Override
|
|
|
public void onClick(DialogInterface dialog, int which) {
|
|
|
+ Log.i("dP_position",mPosition+"");
|
|
|
if (which == 0) {// 查看
|
|
|
Intent intent = new Intent(ct, MultiImagePreviewActivity.class);
|
|
|
intent.putExtra(AppConstant.EXTRA_IMAGES, mPhotoList);
|
|
|
- intent.putExtra(AppConstant.EXTRA_POSITION, position);
|
|
|
+ intent.putExtra(AppConstant.EXTRA_POSITION, mPosition);
|
|
|
intent.putExtra(AppConstant.EXTRA_CHANGE_SELECTED, false);
|
|
|
startActivity(intent);
|
|
|
} else {// 删除
|
|
|
- deletePhoto(position);
|
|
|
+ deletePhoto(mPosition);
|
|
|
}
|
|
|
dialog.dismiss();
|
|
|
}
|
|
|
@@ -1649,10 +1651,10 @@ public class ExpenseReimbursementActivity extends BaseActivity implements View.O
|
|
|
private void deletePhoto(final int position) {
|
|
|
if (!StringUtils.isEmpty(fb_attach)) {
|
|
|
doDeletePAttach(position);
|
|
|
- LogUtil.prinlnLongMsg("fb_attach",fb_attach);
|
|
|
+ LogUtil.prinlnLongMsg("dfb_attach",fb_attach);
|
|
|
}
|
|
|
- mPhotoList.remove(position);
|
|
|
- mAdapter.notifyDataSetInvalidated();
|
|
|
+ mPhotoList.remove(position);
|
|
|
+ mAdapter.notifyDataSetInvalidated();
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -1666,18 +1668,26 @@ public class ExpenseReimbursementActivity extends BaseActivity implements View.O
|
|
|
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);
|
|
|
+ if (i != posi){
|
|
|
+ fb_attach_list.add(split[i]);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (i == split.length-1){
|
|
|
fb_attach = "";
|
|
|
for (int j = 0; j < fb_attach_list.size(); j++) {
|
|
|
- fb_attach = fb_attach_list.get(j)+";";
|
|
|
+ fb_attach = fb_attach +fb_attach_list.get(j)+";";
|
|
|
+
|
|
|
+ if (j == fb_attach_list.size()-1){
|
|
|
+ Log.i("now_fb_attach", fb_attach.toString());
|
|
|
+ mCostUpdatePModel.getFiles().remove(posi);
|
|
|
+ mAdapter.notifyDataSetInvalidated();
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ }else {
|
|
|
+ return;
|
|
|
}
|
|
|
- Log.i("now_fb_attach", fb_attach.toString());
|
|
|
-
|
|
|
}
|
|
|
|
|
|
private void takePhoto() {
|
|
|
@@ -1730,7 +1740,7 @@ public class ExpenseReimbursementActivity extends BaseActivity implements View.O
|
|
|
|
|
|
private void sendPicture() {
|
|
|
if (ListUtils.isEmpty(mPhotoList)) {
|
|
|
- if (!StringUtils.isEmpty(fb_attach) && formid != 0){//TODO 跟新操作时带有图片过去却被删掉了,做删除图片附件操作
|
|
|
+ if (!StringUtils.isEmpty(fb_attach) && formid != 0){//TODO 更新操作时带有图片过去却被删掉了,做删除图片附件操作
|
|
|
doDeleteUp_fb_attach();
|
|
|
}else {
|
|
|
// commitSuccess(keyValue);
|
|
|
@@ -1755,13 +1765,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()){
|
|
|
- if (now_p == mPhotoList.size()-1 && now_p > 0){
|
|
|
+ Log.i("now_p",now_p+"");
|
|
|
+ if (now_p == mPhotoList.size()-1){
|
|
|
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){
|