完成 移库申请

master
wangh 8 months ago
parent 24f3629bba
commit 2dfe874e55

@ -7,31 +7,39 @@ import androidx.databinding.BaseObservable;
* @date 2024/4/1 16:54 * @date 2024/4/1 16:54
*/ */
public class RelocationApplyBeen extends BaseObservable { public class RelocationApplyBeen extends BaseObservable {
private String targetLocationCode; private String targetLocationCode;
private String oriLocationCode; private String oriLocationCode;
private String moveType; private String moveType;
public String getTargetLocationCode() { public String getTargetLocationCode() {
return targetLocationCode; return targetLocationCode;
} }
public void setTargetLocationCode(String targetLocationCode) { public void setTargetLocationCode(String targetLocationCode) {
this.targetLocationCode = targetLocationCode; this.targetLocationCode = targetLocationCode;
} }
public String getOriLocationCode() { public String getOriLocationCode() {
return oriLocationCode; return oriLocationCode;
} }
public void setOriLocationCode(String oriLocationCode) { public void setOriLocationCode(String oriLocationCode) {
this.oriLocationCode = oriLocationCode; this.oriLocationCode = oriLocationCode;
} }
public String getMoveType() { public String getMoveType() {
return moveType; return moveType;
} }
public void setMoveType(String moveType) {
this.moveType = moveType;
}
public void clear() {
this.targetLocationCode = null;
this.oriLocationCode = null;
notifyChange();
}
public void setMoveType(String moveType) {
this.moveType = moveType;
}
} }

@ -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