修改 维修修改提交

master
wanghao 5 days ago
parent ec8306895f
commit 0d004ae3ee

@ -67,8 +67,10 @@ public class DeviceRepairInfoActivity extends BaseActivity implements DisposalFi
faultTypeLpw = new ListPopupWindow(context);
faultTypeLpw.setAnchorView(binding.faultType);
faultTypeLpw.setOnItemClickListener((parent, view, position, id) -> {
deviceRepair.setFaultSourceTypeName(faultList.get(position).getDictLabel());
deviceRepair.setFaultSourceType(faultList.get(position).getDictValue());
Dict dict = faultList.get(position);
deviceRepair.setFaultSourceTypeName(dict.getDictLabel());
Log.e("TAG", "onCreate:" + dict.getDictValue());
deviceRepair.setFaultSourceType(dict.getDictValue());
faultTypeLpw.dismiss();
});
opeLpw = new ListPopupWindow(context);
@ -288,14 +290,15 @@ public class DeviceRepairInfoActivity extends BaseActivity implements DisposalFi
// 提交修改 维修工单
public void submitUpdateRepair(View view){
Log.e("TAG", "submitUpdateRepair:" + deviceRepair.getInstanceActivityId());
int repairType = deviceRepair.getRepairType();
OkGo.<MyResult>post(url + "/dms/mobile/updateFaultInstanceActivity")
.headers("Authorization", SharedPreferencesUtils.getstring("access_token", ""))
.params("instanceActivityld", deviceRepair.getInstanceActivityId())
.params("faultType", deviceRepair.getFaultType())
.params("instanceActivityId", deviceRepair.getInstanceActivityId())
.params("faultType", deviceRepair.getFaultSourceType())
.params("faultDescription", deviceRepair.getFaultDescription())
.params("designOperations", deviceRepair.getDesignOperations())
.params("repairType", deviceRepair.getRepairType())
.params("outsrcld", deviceRepair.getOutsrcId())
.params("repairType", repairType)
.params("outsrcld",deviceRepair.getOutsrcId())
.addFileParams("files", submitFileList)
.execute(new MyRecultCall(dialog, this) {
@Override

@ -1,5 +1,6 @@
package com.example.jingyuan_mes.entity.device;
import android.util.Log;
import android.view.View;
import android.widget.AdapterView;
@ -87,6 +88,7 @@ public class DeviceRepair extends BaseObservable {
private List<Outsourcing> outsourcingList;
private List<String> outsourcingNameList;
private int outsrcId;
private int outsrcIdIndex;
private String outsrcName;
public List<String> getOutsourcingNameList() {
@ -105,16 +107,30 @@ public class DeviceRepair extends BaseObservable {
public void setOutsourcingList(List<Outsourcing> outsourcingList) {
this.outsourcingList = outsourcingList;
outsourcingNameList=new ArrayList<>(outsourcingList.size());
outsourcingList.forEach(t->{
outsourcingNameList.add(t.getOutsrcName());
if (t.getOutsrcId()==outsrcId){
this.outsrcName=t.getOutsrcName();
for (int i = 0; i < outsourcingList.size(); i++) {
Outsourcing outsourcing = outsourcingList.get(i);
outsourcingNameList.add(outsourcing.getOutsrcName());
if (outsourcing.getOutsrcId()==outsrcId){
// this.outsrcName=t.getOutsrcName();
this.outsrcIdIndex = i;
Log.e("TAG", "setOutsourcingList:" + i);
}
});
}
/* (t->{
;
});*/
notifyChange();
}
public int getOutsrcIdIndex() {
return outsrcIdIndex;
}
public void selectOutSourcingID(AdapterView<?> parent, View view, int position, long id) {
this.outsrcId = outsourcingList.get(position).getOutsrcId();
this.outsrcIdIndex = position;
}
public String getOutsrcName() {
@ -139,6 +155,11 @@ public class DeviceRepair extends BaseObservable {
return repairType;
}
public void setOutsrcIdIndex(int outsrcIdIndex) {
this.outsrcIdIndex = outsrcIdIndex;
notifyChange();
}
public void setRepairType(int repairType) {
this.repairType = repairType;
}
@ -149,6 +170,7 @@ public class DeviceRepair extends BaseObservable {
repairType = type;
// radioState = (type == 2);
if (type==1){
setRadioState1(true);
setRadioState2(false);
}else {
@ -238,6 +260,7 @@ public class DeviceRepair extends BaseObservable {
public void setFaultSourceType(String faultSourceType) {
this.faultSourceType = faultSourceType;
}
public Long getFaultSourceId() {

@ -242,7 +242,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:enabled="@{visState}"
android:text="@{vm.faultDescription}" />
android:text="@={vm.faultDescription}" />
</LinearLayout>
@ -329,8 +329,9 @@
android:entries="@{vm.outsourcingNameList}"
android:onItemSelected="@{vm.selectOutSourcingID}"
android:spinnerMode="dropdown"
android:selection="@{vm.outsrcIdIndex}"
android:textAlignment="center" />
<!-- android:selection="@{vm.outsourcingNameList.indexOf(vm.outsrcId)}"-->
<!-- -->
</LinearLayout>
<TextView

Loading…
Cancel
Save