Browse Source

写生产日报可以拿到所有值了

master
lh 8 years ago
parent
commit
1d88461775
3 changed files with 148 additions and 14 deletions
  1. +133
    -5
      app/src/main/java/com/qhclh/ytzh/work/productiondailyw/DetailsofdocumentsFragment.java
  2. +9
    -3
      app/src/main/java/com/qhclh/ytzh/work/productiondailyw/ProductiondailywActivity.java
  3. +6
    -6
      app/src/main/res/layout/fragment_detailsofdoc.xml

+ 133
- 5
app/src/main/java/com/qhclh/ytzh/work/productiondailyw/DetailsofdocumentsFragment.java View File

@ -2,17 +2,17 @@ package com.qhclh.ytzh.work.productiondailyw;
import android.content.DialogInterface; import android.content.DialogInterface;
import android.support.v7.app.AlertDialog; import android.support.v7.app.AlertDialog;
import android.text.Editable;
import android.text.TextWatcher;
import android.view.View; import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.Spinner;
import android.widget.EditText;
import android.widget.TextView; import android.widget.TextView;
import com.qhclh.ytzh.R; import com.qhclh.ytzh.R;
import com.qhclh.ytzh.base.BaseFragment; import com.qhclh.ytzh.base.BaseFragment;
import java.util.ArrayList;
import java.util.List;
import java.math.BigDecimal;
import butterknife.BindView; import butterknife.BindView;
@ -24,6 +24,19 @@ public class DetailsofdocumentsFragment extends BaseFragment {
private ProductiondailywActivity act; private ProductiondailywActivity act;
@BindView(R.id.detaild_buildinghome) @BindView(R.id.detaild_buildinghome)
TextView detaild_buildinghome; TextView detaild_buildinghome;
@BindView(R.id.detaild_dayage)
EditText detaild_dayage;
@BindView(R.id.detaild_survival)
EditText detaild_survival;
@BindView(R.id.detaild_death)
EditText detaild_death;
@BindView(R.id.detaild_eliminate)
EditText detaild_eliminate;
@BindView(R.id.detaild_water)
EditText detaild_water;
@BindView(R.id.detaild_weight)
EditText detaild_weight;
@Override @Override
protected int setLayout() { protected int setLayout() {
return R.layout.fragment_detailsofdoc; return R.layout.fragment_detailsofdoc;
@ -70,5 +83,120 @@ public class DetailsofdocumentsFragment extends BaseFragment {
} }
}); });
detaild_dayage.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {
}
@Override
public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
}
@Override
public void afterTextChanged(Editable editable) {
try {
act.setDays(Integer.parseInt(editable.toString().trim()));
} catch (NumberFormatException e) {
e.printStackTrace();
}
}
});
detaild_survival.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {
}
@Override
public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
}
@Override
public void afterTextChanged(Editable editable) {
try {
act.setCunhuolv(new BigDecimal(editable.toString().trim()));
} catch (NumberFormatException e) {
e.printStackTrace();
}
}
});
detaild_death.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {
}
@Override
public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
}
@Override
public void afterTextChanged(Editable editable) {
try {
act.setDienum(Integer.parseInt(editable.toString().trim()));
} catch (NumberFormatException e) {
e.printStackTrace();
}
}
});
detaild_eliminate.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {
}
@Override
public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
}
@Override
public void afterTextChanged(Editable editable) {
try {
act.setTaotai(Integer.parseInt(editable.toString().trim()));
} catch (NumberFormatException e) {
e.printStackTrace();
}
}
});
detaild_water.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {
}
@Override
public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
}
@Override
public void afterTextChanged(Editable editable) {
try {
act.setWater(new BigDecimal(editable.toString().trim()));
} catch (NumberFormatException e) {
e.printStackTrace();
}
}
});
detaild_weight.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {
}
@Override
public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
}
@Override
public void afterTextChanged(Editable editable) {
try {
act.setWeight(new BigDecimal(editable.toString().trim()));
} catch (NumberFormatException e) {
e.printStackTrace();
}
}
});
} }
} }

+ 9
- 3
app/src/main/java/com/qhclh/ytzh/work/productiondailyw/ProductiondailywActivity.java View File

@ -45,7 +45,7 @@ public class ProductiondailywActivity extends BaseActivity implements CalendarDi
private long houseid; private long houseid;
private int days; private int days;
private double cunhuolv;
private BigDecimal cunhuolv;
private int dienum; private int dienum;
private int taotai; private int taotai;
private BigDecimal water; private BigDecimal water;
@ -99,11 +99,11 @@ public class ProductiondailywActivity extends BaseActivity implements CalendarDi
this.days = days; this.days = days;
} }
public double getCunhuolv() {
public BigDecimal getCunhuolv() {
return cunhuolv; return cunhuolv;
} }
public void setCunhuolv(double cunhuolv) {
public void setCunhuolv(BigDecimal cunhuolv) {
this.cunhuolv = cunhuolv; this.cunhuolv = cunhuolv;
} }
@ -238,6 +238,12 @@ public class ProductiondailywActivity extends BaseActivity implements CalendarDi
System.out.println("aaa3---"+getAccountId()); System.out.println("aaa3---"+getAccountId());
System.out.println("aaa4---"+getTime()); System.out.println("aaa4---"+getTime());
System.out.println("aaa5---"+getHouseid()); System.out.println("aaa5---"+getHouseid());
System.out.println("aaa6---"+getDays());
System.out.println("aaa7---"+getCunhuolv());
System.out.println("aaa8---"+getDienum());
System.out.println("aaa9---"+getTaotai());
System.out.println("aaa10---"+getWater());
System.out.println("aaa11---"+getWeight());
break; break;
} }
return super.onOptionsItemSelected(item); return super.onOptionsItemSelected(item);


+ 6
- 6
app/src/main/res/layout/fragment_detailsofdoc.xml View File

@ -68,7 +68,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_5" android:layout_marginLeft="@dimen/dp_5"
android:layout_weight="5" android:layout_weight="5"
android:inputType="text"
android:inputType="number"
android:maxLines="1" android:maxLines="1"
android:textColor="@color/black303030" android:textColor="@color/black303030"
android:textSize="@dimen/text_size_20" /> android:textSize="@dimen/text_size_20" />
@ -97,7 +97,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_5" android:layout_marginLeft="@dimen/dp_5"
android:layout_weight="5" android:layout_weight="5"
android:inputType="text"
android:inputType="numberDecimal"
android:maxLines="1" android:maxLines="1"
android:textColor="@color/black303030" android:textColor="@color/black303030"
android:textSize="@dimen/text_size_20" /> android:textSize="@dimen/text_size_20" />
@ -126,7 +126,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_5" android:layout_marginLeft="@dimen/dp_5"
android:layout_weight="5" android:layout_weight="5"
android:inputType="text"
android:inputType="number"
android:maxLines="1" android:maxLines="1"
android:textColor="@color/black303030" android:textColor="@color/black303030"
android:textSize="@dimen/text_size_20" /> android:textSize="@dimen/text_size_20" />
@ -155,7 +155,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_5" android:layout_marginLeft="@dimen/dp_5"
android:layout_weight="5" android:layout_weight="5"
android:inputType="text"
android:inputType="number"
android:maxLines="1" android:maxLines="1"
android:textColor="@color/black303030" android:textColor="@color/black303030"
android:textSize="@dimen/text_size_20" /> android:textSize="@dimen/text_size_20" />
@ -184,7 +184,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_5" android:layout_marginLeft="@dimen/dp_5"
android:layout_weight="5" android:layout_weight="5"
android:inputType="text"
android:inputType="numberDecimal"
android:maxLines="1" android:maxLines="1"
android:textColor="@color/black303030" android:textColor="@color/black303030"
android:textSize="@dimen/text_size_20" /> android:textSize="@dimen/text_size_20" />
@ -213,7 +213,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_5" android:layout_marginLeft="@dimen/dp_5"
android:layout_weight="5" android:layout_weight="5"
android:inputType="text"
android:inputType="numberDecimal"
android:maxLines="1" android:maxLines="1"
android:textColor="@color/black303030" android:textColor="@color/black303030"
android:textSize="@dimen/text_size_20" /> android:textSize="@dimen/text_size_20" />


Loading…
Cancel
Save