修改 原材料出入退

master
wanghao 2 months ago
parent ec2304bf0f
commit a2b1b0b120

@ -4,7 +4,6 @@
<component name="GradleSettings">
<option name="linkedExternalProjectsSettings">
<GradleProjectSettings>
<option name="delegatedBuild" value="true" />
<option name="testRunner" value="GRADLE" />
<option name="distributionType" value="LOCAL" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />

@ -43,13 +43,13 @@ import okhttp3.MediaType;
public class BaseActivity extends AppCompatActivity {
public static final int CAMERA_PHOTO = 1;
public static String url = "http://175.27.215.92:7018/prod-api";
// public static String url = "http://10.11.40.120:7018/dev-api";
// public static String url = "http://192.168.100.199:7018/dev-api";//测试
// public static String url = "http://175.27.215.92:7018/prod-api";
public static String url = "http://10.11.40.120:7018/dev-api";
public ProgressDialog dialog;
public Gson gson;
public MediaType JSON = MediaType.parse("application/json; charset=utf-8");
private MyReceiver myReceiver;
public String handle = "eyJhbGciOiJIUzUxMiJ9.eyJ1c2VyX2lkIjoxLCJzdGF0aW9uX2lkIjpudWxsLCJ1c2VyX2tleSI6IjFjNDM3NTRkLWRlMzAtNGU4Ni04MTI3LTE5ZDQ0ZTY2ODc3MCIsInVzZXJuYW1lIjoiYWRtaW4ifQ.Ao_5QTmKFUtNfdyMmWM0cpVdpbihKsae_SCmK2S57NSwse2-CXgSXeGwr_PK_zilZNhSWTaVJrYlJHXXj3cRdA";
public Context context;
@SuppressLint("SimpleDateFormat")
public SimpleDateFormat format= new SimpleDateFormat( "yyyyMMdd_HHmmss");
@ -58,10 +58,9 @@ public class BaseActivity extends AppCompatActivity {
super.onCreate(savedInstanceState);
Log.e("TAG", this.getLocalClassName() );
gson = new Gson();
// SharedPreferencesUtils.putstring("access_token",handle);
this.context=this;
initDialog();
// initSan();
initSan();
}

@ -3,6 +3,9 @@ package com.example.jingyuan_mes.store;
import androidx.databinding.DataBindingUtil;
import android.os.Bundle;
import android.text.Editable;
import android.text.TextWatcher;
import android.util.Log;
import android.view.View;
import android.widget.Toast;
@ -20,42 +23,62 @@ import okhttp3.RequestBody;
public class MaterialInActivity extends BaseActivity {
private MaterialInVm vm;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
ActivityMaterialInBinding binding = DataBindingUtil.setContentView(this, R.layout.activity_material_in);
binding.setTitle("原材料入库");
vm=new MaterialInVm();
vm.setInstockAmount(1);
vm = new MaterialInVm();
vm.setInstockAmount("1");
binding.setVm(vm);
binding.materialInGoods.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
}
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
Log.e("TAG", "start:" + start + "before:" + before + "count:" + count);
if (start == 0 && count > 10) {
binding.materialInGoods.clearFocus();
binding.materialInLocation.requestFocus();
}
}
@Override
public void afterTextChanged(Editable s) {
}
});
}
@Override
public void sanCodeCall(String code) {
var materialBarcode = vm.getMaterialBarcode();
if (materialBarcode ==null|| materialBarcode.isEmpty()){
vm.setMaterialBarcode(code);
}else {
vm.setLocationCode(code);
}
if (materialBarcode == null || materialBarcode.isEmpty()) {
vm.setMaterialBarcode(code);
} else {
vm.setLocationCode(code);
}
}
public void material_in_submit(View view){
OkGo.<MyResult>post(url+"/wms/mobile/addRawInstock")
.headers("Authorization", SharedPreferencesUtils.getstring("access_token", ""))
.upRequestBody(RequestBody.create(JSON,gson.toJson(vm)))
.execute(new MyRecultCall(dialog,this){
@Override
public void onSuccess(Response<MyResult> response) {
super.onSuccess(response);
var body = response.body();
if (body.getCode()==200){
finish();
}
Toast.makeText(MaterialInActivity.this, body.getMsg(), Toast.LENGTH_SHORT).show();
}
});
public void material_in_submit(View view) {
OkGo.<MyResult>post(url + "/wms/mobile/addRawInstock").headers("Authorization", SharedPreferencesUtils.getstring("access_token", "")).upRequestBody(RequestBody.create(JSON, gson.toJson(vm))).execute(new MyRecultCall(dialog, this) {
@Override
public void onSuccess(Response<MyResult> response) {
super.onSuccess(response);
var body = response.body();
if (body.getCode() == 200) {
finish();
}
Toast.makeText(MaterialInActivity.this, body.getMsg(), Toast.LENGTH_SHORT).show();
}
});
}

@ -3,6 +3,8 @@ package com.example.jingyuan_mes.store;
import androidx.databinding.DataBindingUtil;
import android.os.Bundle;
import android.text.Editable;
import android.text.TextWatcher;
import android.view.View;
import android.widget.Toast;
@ -37,6 +39,27 @@ public class MaterialPassActivity extends BaseActivity implements ItemClickCall
binding.setVm(vm);
passAdapter = new MaterialOutPassAdapter(this,this);
binding.setAdapter(passAdapter);
binding.materialPassGoods.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
}
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
if (start == 0 && count > 10) {
binding.materialPassGoods.clearFocus();
binding.materialPassLocation.requestFocus();
}
}
@Override
public void afterTextChanged(Editable s) {
}
});
initRequest(null);
}

@ -3,6 +3,8 @@ package com.example.jingyuan_mes.store;
import androidx.databinding.DataBindingUtil;
import android.os.Bundle;
import android.text.Editable;
import android.text.TextWatcher;
import android.view.View;
import android.widget.Toast;
@ -42,8 +44,29 @@ public class StockreturnConfirmInfoActivity extends BaseActivity {
sub.setRawReturnId(id);
sub.setReturnAmount(1);
binding.setSub(sub);
binding.stockReturnConfirmGoods.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
}
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
if (start == 0 && count > 10) {
binding.stockReturnConfirmGoods.clearFocus();
binding.stockReturnConfirmLocation.requestFocus();
}
}
@Override
public void afterTextChanged(Editable s) {
}
});
initRequest(id);
}
private void initRequest(long id) {

@ -9,7 +9,7 @@ import androidx.databinding.BaseObservable;
public class MaterialInVm extends BaseObservable {
private String materialBarcode;
private String locationCode;
private int instockAmount;
private String instockAmount;
public String getMaterialBarcode() {
return materialBarcode;
@ -29,11 +29,11 @@ public class MaterialInVm extends BaseObservable {
notifyChange();
}
public int getInstockAmount() {
public String getInstockAmount() {
return instockAmount;
}
public void setInstockAmount(int instockAmount) {
public void setInstockAmount(String instockAmount) {
this.instockAmount = instockAmount;
notifyChange();
}

@ -39,6 +39,7 @@
android:text="扫描物料:" />
<EditText
android:id="@+id/material_in_goods"
style="@style/text_san"
android:layout_width="match_parent"
android:layout_height="match_parent"
@ -59,6 +60,7 @@
android:text="扫描库位:" />
<!-- -->
<EditText
android:id="@+id/material_in_location"
style="@style/text_san"
android:layout_width="match_parent"
android:layout_height="wrap_content"
@ -85,7 +87,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:inputType="numberDecimal"
android:text='@={vm.instockAmount + "" }' />
android:text='@={vm.instockAmount }' />
</LinearLayout>

@ -66,6 +66,7 @@
android:text="扫描物料:" />
<EditText
android:id="@+id/material_pass_goods"
style="@style/text_san"
android:layout_width="match_parent"
android:layout_height="match_parent"
@ -86,6 +87,7 @@
android:text="扫描库位:" />
<!-- -->
<EditText
android:id="@+id/material_pass_location"
style="@style/text_san"
android:layout_width="match_parent"
android:layout_height="wrap_content"

@ -141,6 +141,7 @@
android:text="扫描物料:" />
<EditText
android:id="@+id/stock_return_confirm_goods"
style="@style/text_san"
android:layout_width="match_parent"
android:layout_height="match_parent"
@ -161,6 +162,7 @@
android:text="扫描库位:" />
<EditText
android:id="@+id/stock_return_confirm_location"
style="@style/text_san"
android:layout_width="match_parent"
android:layout_height="wrap_content"

Loading…
Cancel
Save