|
|
|
|
@ -1,6 +1,5 @@
|
|
|
|
|
package com.example.tyre.maintenance;
|
|
|
|
|
|
|
|
|
|
import android.app.Dialog;
|
|
|
|
|
import android.content.Intent;
|
|
|
|
|
import android.graphics.Color;
|
|
|
|
|
import android.os.Bundle;
|
|
|
|
|
@ -9,7 +8,6 @@ import android.view.LayoutInflater;
|
|
|
|
|
import android.view.View;
|
|
|
|
|
import android.view.ViewGroup;
|
|
|
|
|
import android.view.Window;
|
|
|
|
|
import android.widget.AdapterView;
|
|
|
|
|
import android.widget.ArrayAdapter;
|
|
|
|
|
import android.widget.ImageView;
|
|
|
|
|
import android.widget.ListView;
|
|
|
|
|
@ -28,7 +26,6 @@ import com.example.tyre.maintenance.been.BizOrderTireDetail;
|
|
|
|
|
import com.example.tyre.maintenance.been.Order;
|
|
|
|
|
import com.example.tyre.util.MyUrl;
|
|
|
|
|
import com.google.android.material.bottomsheet.BottomSheetDialog;
|
|
|
|
|
import com.google.gson.reflect.TypeToken;
|
|
|
|
|
import com.lzy.okgo.OkGo;
|
|
|
|
|
import com.lzy.okgo.callback.StringCallback;
|
|
|
|
|
import com.lzy.okgo.model.Response;
|
|
|
|
|
@ -120,7 +117,7 @@ public class TireScrapActivity extends BaseActivity {
|
|
|
|
|
Window window = dialog.getWindow();
|
|
|
|
|
if (window != null) {
|
|
|
|
|
window.findViewById(com.google.android.material.R.id.design_bottom_sheet)
|
|
|
|
|
.setBackgroundColor(Color.TRANSPARENT);
|
|
|
|
|
.setBackgroundColor(Color.TRANSPARENT);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ImageView ivClose = view.findViewById(R.id.iv_close_dialog);
|
|
|
|
|
@ -138,46 +135,49 @@ public class TireScrapActivity extends BaseActivity {
|
|
|
|
|
subItemsMap.put("其他", new String[]{"好的或坏的修补(厂家或授权服务商)", "不满足良性修补判定", "气密层褶皱", "串气", "化学污染", "年限到期", "其他未列出原因"});
|
|
|
|
|
|
|
|
|
|
// Category Adapter
|
|
|
|
|
ArrayAdapter<String> catAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, categories) {
|
|
|
|
|
@Override
|
|
|
|
|
public View getView(int position, View convertView, ViewGroup parent) {
|
|
|
|
|
TextView tv = (TextView) super.getView(position, convertView, parent);
|
|
|
|
|
tv.setTextSize(14f);
|
|
|
|
|
tv.setTextColor(Color.parseColor("#333333"));
|
|
|
|
|
tv.setGravity(Gravity.CENTER);
|
|
|
|
|
tv.setPadding(0, 40, 0, 40);
|
|
|
|
|
return tv;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
ArrayAdapter<String> catAdapter =
|
|
|
|
|
new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, categories) {
|
|
|
|
|
@Override
|
|
|
|
|
public View getView(int position, View convertView, ViewGroup parent) {
|
|
|
|
|
TextView tv = (TextView) super.getView(position, convertView, parent);
|
|
|
|
|
tv.setTextSize(14f);
|
|
|
|
|
tv.setTextColor(Color.parseColor("#333333"));
|
|
|
|
|
tv.setGravity(Gravity.CENTER);
|
|
|
|
|
tv.setPadding(0, 40, 0, 40);
|
|
|
|
|
return tv;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
lvCategories.setAdapter(catAdapter);
|
|
|
|
|
|
|
|
|
|
// Sub Items Adapter (initially empty or first category)
|
|
|
|
|
final ArrayAdapter<String>[] subAdapter = new ArrayAdapter[]{new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, subItemsMap.get(categories[0])) {
|
|
|
|
|
@Override
|
|
|
|
|
public View getView(int position, View convertView, ViewGroup parent) {
|
|
|
|
|
TextView tv = (TextView) super.getView(position, convertView, parent);
|
|
|
|
|
tv.setTextSize(14f);
|
|
|
|
|
tv.setTextColor(Color.parseColor("#666666"));
|
|
|
|
|
tv.setPadding(0, 40, 0, 40);
|
|
|
|
|
return tv;
|
|
|
|
|
}
|
|
|
|
|
}};
|
|
|
|
|
final ArrayAdapter<String>[] subAdapter =
|
|
|
|
|
new ArrayAdapter[]{new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, subItemsMap.get(categories[0])) {
|
|
|
|
|
@Override
|
|
|
|
|
public View getView(int position, View convertView, ViewGroup parent) {
|
|
|
|
|
TextView tv = (TextView) super.getView(position, convertView, parent);
|
|
|
|
|
tv.setTextSize(14f);
|
|
|
|
|
tv.setTextColor(Color.parseColor("#666666"));
|
|
|
|
|
tv.setPadding(0, 40, 0, 40);
|
|
|
|
|
return tv;
|
|
|
|
|
}
|
|
|
|
|
}};
|
|
|
|
|
lvSubItems.setAdapter(subAdapter[0]);
|
|
|
|
|
|
|
|
|
|
final String[] currentCategory = {categories[0]};
|
|
|
|
|
|
|
|
|
|
lvCategories.setOnItemClickListener((parent, view1, position, id) -> {
|
|
|
|
|
currentCategory[0] = categories[position];
|
|
|
|
|
subAdapter[0] = new ArrayAdapter<String>(TireScrapActivity.this, android.R.layout.simple_list_item_1, subItemsMap.get(currentCategory[0])) {
|
|
|
|
|
@Override
|
|
|
|
|
public View getView(int pos, View convertView, ViewGroup p) {
|
|
|
|
|
TextView tv = (TextView) super.getView(pos, convertView, p);
|
|
|
|
|
tv.setTextSize(14f);
|
|
|
|
|
tv.setTextColor(Color.parseColor("#666666"));
|
|
|
|
|
tv.setPadding(0, 40, 0, 40);
|
|
|
|
|
return tv;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
subAdapter[0] =
|
|
|
|
|
new ArrayAdapter<String>(TireScrapActivity.this, android.R.layout.simple_list_item_1, subItemsMap.get(currentCategory[0])) {
|
|
|
|
|
@Override
|
|
|
|
|
public View getView(int pos, View convertView, ViewGroup p) {
|
|
|
|
|
TextView tv = (TextView) super.getView(pos, convertView, p);
|
|
|
|
|
tv.setTextSize(14f);
|
|
|
|
|
tv.setTextColor(Color.parseColor("#666666"));
|
|
|
|
|
tv.setPadding(0, 40, 0, 40);
|
|
|
|
|
return tv;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
lvSubItems.setAdapter(subAdapter[0]);
|
|
|
|
|
for (int i = 0; i < parent.getChildCount(); i++) {
|
|
|
|
|
parent.getChildAt(i).setBackgroundColor(Color.TRANSPARENT);
|
|
|
|
|
@ -273,7 +273,25 @@ public class TireScrapActivity extends BaseActivity {
|
|
|
|
|
scrapDetail.setTireId(selectedTire.getTyreId());
|
|
|
|
|
scrapDetail.setTireCode(selectedTire.getTyreNo());
|
|
|
|
|
scrapDetail.setPositionName(selectedTire.getWheelPostion());
|
|
|
|
|
scrapDetail.setPositionId(selectedTire.getWheelPostion());
|
|
|
|
|
String wheelPostion = selectedTire.getWheelPostion();
|
|
|
|
|
if (wheelPostion != null && !wheelPostion.isEmpty()) {
|
|
|
|
|
if (wheelPostion.equals("右内轮")) {
|
|
|
|
|
scrapDetail.setPositionId(119L);
|
|
|
|
|
} else if (wheelPostion.equals("右外轮")) {
|
|
|
|
|
scrapDetail.setPositionId(118L);
|
|
|
|
|
} else if (wheelPostion.equals("左内轮")) {
|
|
|
|
|
scrapDetail.setPositionId(120L);
|
|
|
|
|
} else if (wheelPostion.equals("左外轮")) {
|
|
|
|
|
scrapDetail.setPositionId(121L);
|
|
|
|
|
} else if (wheelPostion.equals("右前轮")) {
|
|
|
|
|
scrapDetail.setPositionId(122L);
|
|
|
|
|
} else if (wheelPostion.equals("左前轮")) {
|
|
|
|
|
scrapDetail.setPositionId(123L);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
scrapDetail.setDataType("报废");
|
|
|
|
|
|
|
|
|
|
// 暂不将两级原因结果存入数据库中,轮胎状态默认报废
|
|
|
|
|
|