|
|
@@ -12,8 +12,6 @@ import android.os.Build;
|
|
|
import android.os.Bundle;
|
|
|
import android.os.Handler;
|
|
|
import android.os.Message;
|
|
|
-import android.text.Editable;
|
|
|
-import android.text.TextWatcher;
|
|
|
import android.util.DisplayMetrics;
|
|
|
import android.util.Log;
|
|
|
import android.view.Gravity;
|
|
|
@@ -40,7 +38,6 @@ import com.alibaba.fastjson.JSONException;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.alibaba.fastjson.serializer.PropertyFilter;
|
|
|
import com.andreabaccega.widget.FormEditText;
|
|
|
-import com.iflytek.cloud.thirdparty.V;
|
|
|
import com.lidroid.xutils.HttpUtils;
|
|
|
import com.lidroid.xutils.ViewUtils;
|
|
|
import com.lidroid.xutils.exception.HttpException;
|
|
|
@@ -162,6 +159,7 @@ public class ExpenseReimbursementActivity extends BaseActivity implements View.O
|
|
|
|
|
|
private AddCostBean mAddCostBean;
|
|
|
private List<AddCostBean> mAddCost_list; // popwindow要展示的消费明细类型
|
|
|
+ private String[] default_Cost = {"交通费","通讯费","招待费","差旅费","办公费","税费","物业费","其他"};
|
|
|
|
|
|
//点击新增需要展示的消费明数据细主表
|
|
|
private List<CostTypeSingleBean> costtypesinglebeanList;
|
|
|
@@ -280,7 +278,7 @@ public class ExpenseReimbursementActivity extends BaseActivity implements View.O
|
|
|
|
|
|
if ("S".equals(dg_type)){
|
|
|
if (cd_table_position < costFormModel_list.size())
|
|
|
- costFormModel_list.remove(cd_table_position);
|
|
|
+ costFormModel_list.remove(cd_table_position);
|
|
|
}
|
|
|
if (costFormModel_list.size() == 0){
|
|
|
detail_table_ll.setVisibility(View.GONE);
|
|
|
@@ -860,9 +858,10 @@ public class ExpenseReimbursementActivity extends BaseActivity implements View.O
|
|
|
doSingleSelect(money_combdatas,2,getString(R.string.currency),SELECT_CURRENCY);
|
|
|
break;
|
|
|
case R.id.add_details_tv:
|
|
|
- if ("S".equals(dg_type)){
|
|
|
- showEditWindow();
|
|
|
- }else if ("DF".equals(dg_type)){
|
|
|
+ if ("S".equals(dg_type)) {
|
|
|
+ showEditWindow();
|
|
|
+// }else if ("DF".equals(dg_type)){
|
|
|
+ }else {
|
|
|
showPopupWindow();
|
|
|
}
|
|
|
putDownInput();
|
|
|
@@ -891,12 +890,12 @@ public class ExpenseReimbursementActivity extends BaseActivity implements View.O
|
|
|
case R.id.c_point:
|
|
|
if (StringUtils.isEmpty(c_edit.getText().toString())) break;
|
|
|
if (!StringUtils.isEmpty(c_edit.getText().toString()) && c_edit.getText().toString().contains(".")){
|
|
|
- break;
|
|
|
- }
|
|
|
+ break;
|
|
|
+ }
|
|
|
|
|
|
- if (StringUtils.isEmpty(c_edit.getText().toString()) && StringUtils.isEmpty(c_result.getText().toString())){
|
|
|
+ if (StringUtils.isEmpty(c_edit.getText().toString()) && StringUtils.isEmpty(c_result.getText().toString())){
|
|
|
break;
|
|
|
- }
|
|
|
+ }
|
|
|
c_onclick("."); break;
|
|
|
case R.id.c_c:
|
|
|
num1=0;num2=0;
|
|
|
@@ -1214,14 +1213,10 @@ public class ExpenseReimbursementActivity extends BaseActivity implements View.O
|
|
|
if (setWindow == null) initPopupWindow();
|
|
|
setWindow.showAtLocation(getWindow().getDecorView().
|
|
|
findViewById(android.R.id.content), Gravity.BOTTOM, 0, 0);
|
|
|
-// if (VERSION_CODES < 24) // API版本太高不断刷新View亮度,会有黑缝隙bug
|
|
|
-// DisplayUtil.backgroundAlpha(this, 0.4f);
|
|
|
}
|
|
|
private void closePopupWindow() {
|
|
|
if (setWindow != null)
|
|
|
setWindow.dismiss();
|
|
|
-// if (VERSION_CODES < 24)
|
|
|
-// DisplayUtil.backgroundAlpha(this, 1f);
|
|
|
|
|
|
btn_save.setVisibility(View.VISIBLE);
|
|
|
}
|
|
|
@@ -1248,7 +1243,7 @@ public class ExpenseReimbursementActivity extends BaseActivity implements View.O
|
|
|
}
|
|
|
|
|
|
private void initAddEvent() {
|
|
|
- // 明细过长时长按,toast出明细内容
|
|
|
+ // 明细过长时长按,toast出明细内容
|
|
|
gv_details_list.setOnItemLongClickListener(new AdapterView.OnItemLongClickListener() {
|
|
|
@Override
|
|
|
public boolean onItemLongClick(AdapterView<?> parent, View view, int position, long id) {
|
|
|
@@ -1304,7 +1299,7 @@ public class ExpenseReimbursementActivity extends BaseActivity implements View.O
|
|
|
}
|
|
|
}else {
|
|
|
// for (int i = 0; i < 3; i++) {
|
|
|
- doDetailsHandle();
|
|
|
+ doDetailsHandle();
|
|
|
// }
|
|
|
}
|
|
|
|
|
|
@@ -1345,7 +1340,13 @@ public class ExpenseReimbursementActivity extends BaseActivity implements View.O
|
|
|
}
|
|
|
}
|
|
|
private void initAddDatas() {
|
|
|
- if (ListUtils.isEmpty(mAddCost_list)) return;
|
|
|
+ if (ListUtils.isEmpty(mAddCost_list)) {
|
|
|
+ for (int i = 0; i < default_Cost.length; i++) {
|
|
|
+ AddCostBean m = new AddCostBean();
|
|
|
+ m.setFcs_itemname(default_Cost[i]);
|
|
|
+ mAddCost_list.add(m);
|
|
|
+ }
|
|
|
+ }
|
|
|
if (!ListUtils.isEmpty(costFormModel_list) && ListUtils.isEmpty(selected_detailsData)){
|
|
|
for (int i = 0; i < costFormModel_list.size(); i++) {
|
|
|
selected_detailsData.add(costFormModel_list.get(i).getCost_type());
|
|
|
@@ -1879,8 +1880,8 @@ public class ExpenseReimbursementActivity extends BaseActivity implements View.O
|
|
|
doDeletePAttach(position);
|
|
|
LogUtil.prinlnLongMsg("dfb_attach",fb_attach);
|
|
|
}
|
|
|
- mPhotoList.remove(position);
|
|
|
- mAdapter.notifyDataSetInvalidated();
|
|
|
+ mPhotoList.remove(position);
|
|
|
+ mAdapter.notifyDataSetInvalidated();
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -1892,28 +1893,28 @@ public class ExpenseReimbursementActivity extends BaseActivity implements View.O
|
|
|
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++) {
|
|
|
- if (i != posi){
|
|
|
- fb_attach_list.add(split[i]);
|
|
|
- }
|
|
|
+ if (posi < split.length) {
|
|
|
+ for (int i = 0; i < split.length; i++) {
|
|
|
+ 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 +fb_attach_list.get(j)+";";
|
|
|
+ if (i == split.length-1){
|
|
|
+ fb_attach = "";
|
|
|
+ for (int j = 0; j < fb_attach_list.size(); 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();
|
|
|
- }
|
|
|
+ if (j == fb_attach_list.size()-1){
|
|
|
+ Log.i("now_fb_attach", fb_attach.toString());
|
|
|
+ mCostUpdatePModel.getFiles().remove(posi);
|
|
|
+ mAdapter.notifyDataSetInvalidated();
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- }else {
|
|
|
- return;
|
|
|
}
|
|
|
+ }else {
|
|
|
+ return;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
private void takePhoto() {
|
|
|
@@ -1958,7 +1959,7 @@ public class ExpenseReimbursementActivity extends BaseActivity implements View.O
|
|
|
}
|
|
|
if (item.getItemId() == android.R.id.home){
|
|
|
// if (formid != 0){
|
|
|
- finish();
|
|
|
+ finish();
|
|
|
// }else{
|
|
|
// startActivity(new Intent(ExpenseReimbursementActivity.this, OAActivity.class)
|
|
|
// .putExtra("WorkDailyAdd", "WorkDailyAdd"));
|
|
|
@@ -1971,7 +1972,7 @@ public class ExpenseReimbursementActivity extends BaseActivity implements View.O
|
|
|
@Override
|
|
|
public void onBackPressed() {
|
|
|
// if (formid != 0){
|
|
|
- finish();
|
|
|
+ finish();
|
|
|
// }else {
|
|
|
// startActivity(new Intent(ExpenseReimbursementActivity.this, OAActivity.class)
|
|
|
// .putExtra("WorkDailyAdd", "WorkDailyAdd"));
|
|
|
@@ -2174,7 +2175,7 @@ public class ExpenseReimbursementActivity extends BaseActivity implements View.O
|
|
|
selectApprovers(name);
|
|
|
} else {
|
|
|
progressDialog.dismiss();
|
|
|
- commitSuccess(keyValue);
|
|
|
+ commitSuccess(keyValue);
|
|
|
}
|
|
|
} else {
|
|
|
progressDialog.dismiss();
|