完成 移库申请

master
wangh 8 months ago
parent 24f3629bba
commit 2dfe874e55

@ -34,4 +34,12 @@ public class RelocationApplyBeen extends BaseObservable {
public void setMoveType(String moveType) { public void setMoveType(String moveType) {
this.moveType = moveType; this.moveType = moveType;
} }
public void clear() {
this.targetLocationCode = null;
this.oriLocationCode = null;
notifyChange();
}
} }

@ -4,11 +4,20 @@ import androidx.appcompat.app.AppCompatActivity;
import androidx.databinding.DataBindingUtil; import androidx.databinding.DataBindingUtil;
import android.os.Bundle; import android.os.Bundle;
import android.view.View;
import android.widget.Toast;
import com.example.jingyuan_mes.R; import com.example.jingyuan_mes.R;
import com.example.jingyuan_mes.base.BaseActivity; import com.example.jingyuan_mes.base.BaseActivity;
import com.example.jingyuan_mes.base.MyRecultCall;
import com.example.jingyuan_mes.base.MyResult;
import com.example.jingyuan_mes.databinding.ActivityRelocationApplyBinding; import com.example.jingyuan_mes.databinding.ActivityRelocationApplyBinding;
import com.example.jingyuan_mes.entity.store.RelocationApplyBeen; import com.example.jingyuan_mes.entity.store.RelocationApplyBeen;
import com.example.jingyuan_mes.uitls.SharedPreferencesUtils;
import com.lzy.okgo.OkGo;
import com.lzy.okgo.model.Response;
import okhttp3.RequestBody;
public class RelocationApplyActivity extends BaseActivity { public class RelocationApplyActivity extends BaseActivity {
private RelocationApplyBeen relocationApplyBeen; private RelocationApplyBeen relocationApplyBeen;
@ -23,4 +32,21 @@ public class RelocationApplyActivity extends BaseActivity {
binding.setTitle(moveType.equals("1")?"移库申请":"合库申请"); binding.setTitle(moveType.equals("1")?"移库申请":"合库申请");
binding.setVm(relocationApplyBeen); binding.setVm(relocationApplyBeen);
} }
public void relocationApplySubmit(View view){
OkGo.<MyResult>post(url+"/wms/mobile/applyMove")
.headers("Authorization", SharedPreferencesUtils.getstring("access_token", ""))
.upRequestBody(RequestBody.create(JSON,gson.toJson(relocationApplyBeen)))
.execute(new MyRecultCall(dialog,this){
@Override
public void onSuccess(Response<MyResult> response) {
super.onSuccess(response);
var body = response.body();
if (body.getCode()==200){
relocationApplyBeen.clear();
}
Toast.makeText(context, body.getMsg(), Toast.LENGTH_SHORT).show();
}
});
}
} }

@ -62,6 +62,7 @@
android:layout_height="50dp" android:layout_height="50dp"
android:layout_marginTop="200dp" android:layout_marginTop="200dp"
android:layout_gravity="center" android:layout_gravity="center"
android:onClick="relocationApplySubmit"
android:text="提交申请"/> android:text="提交申请"/>
</LinearLayout> </LinearLayout>
</layout> </layout>
Loading…
Cancel
Save