完成 废品入库

idata
wangh 12 months ago
parent a58248d9ba
commit 7cdc1bedff

@ -4,6 +4,7 @@ import androidx.appcompat.app.AppCompatActivity;
import androidx.databinding.DataBindingUtil;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Toast;
@ -44,6 +45,7 @@ public class FpInActivity extends BaseActivity {
if (body.getCode()==0){
LedgerRfid ledgerRfid=gson.fromJson(body.getData().toString(),LedgerRfid.class);
vm.setBichCode(ledgerRfid.getBatchCode());
vm.setLocation(ledgerRfid.getLocationType());
vm.setLocationCode(ledgerRfid.getLocationCode());
vm.setState(ledgerRfid.getDictLabel());
@ -56,12 +58,14 @@ public class FpInActivity extends BaseActivity {
}
public void fpin_submit(View view){
Log.e("TAG", "onSuccess:" +vm.toString() );
var state = vm.getState();
if (!state.equals("报废")){
Toast.makeText(this, "轮挡状态:"+state+",不能使用废品入库功能", Toast.LENGTH_SHORT).show();
return;
}
if (!vm.getLocation().equals("仓库")){
if (vm.getLocation().equals("仓库")){
Toast.makeText(this, "轮挡状态已在仓库", Toast.LENGTH_SHORT).show();
return;
}

@ -97,4 +97,18 @@ public class FpInVm extends BaseObservable {
this.time = time;
notifyChange();
}
@Override
public String toString() {
return "FpInVm{" +
"epc='" + epc + '\'' +
", bichCode='" + bichCode + '\'' +
", location='" + location + '\'' +
", locationCode='" + locationCode + '\'' +
", state='" + state + '\'' +
", time='" + time + '\'' +
", submitCode='" + submitCode + '\'' +
", list=" + list +
'}';
}
}

@ -168,6 +168,7 @@
android:layout_height="45dp"
android:textAlignment="center"
android:entries="@{vm.list}"
android:onItemSelected="@{vm.selectLocation}"
/>
</LinearLayout>

Loading…
Cancel
Save