feat:轮胎卸车原因选择

asv2022.3.1
wanghao 1 week ago
parent 163bb6640a
commit a573b2723f

@ -74,7 +74,7 @@ public class DownActivity extends AllBaseActivity {
private Toast mToast; private Toast mToast;
private Toast toast; private Toast toast;
private KeyReceiver keyReceiver; private KeyReceiver keyReceiver;
private CommonDialog commonDialog;
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
@ -91,6 +91,7 @@ public class DownActivity extends AllBaseActivity {
} }
private void bindViews() { private void bindViews() {
commonDialog = new CommonDialog(DownActivity.this);
EPC = binding.epc; EPC = binding.epc;
car = binding.car; car = binding.car;
start = binding.start; start = binding.start;
@ -100,6 +101,21 @@ public class DownActivity extends AllBaseActivity {
th = binding.th; th = binding.th;
zbh = binding.zbh; zbh = binding.zbh;
patternDepth = binding.patternDepth; patternDepth = binding.patternDepth;
binding.unloadingReason.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
if(position==5){
binding.unloadingReasonRemark.setVisibility(View.VISIBLE);
}else{
binding.unloadingReasonRemark.setVisibility(View.GONE);
}
}
@Override
public void onNothingSelected(AdapterView<?> parent) {
}
});
} }
private void setupClickListeners() { private void setupClickListeners() {
@ -111,22 +127,22 @@ public class DownActivity extends AllBaseActivity {
String depth = patternDepth.getText().toString(); String depth = patternDepth.getText().toString();
if (rfid == null || rfid.isEmpty()) if (rfid == null || rfid.isEmpty())
{ {
new CommonDialog(DownActivity.this).setMessage("请扫描轮胎!").show(); commonDialog.setMessage("请扫描轮胎!").show();
return; return;
} }
if (carNo == null || carNo.isEmpty()) if (carNo == null || carNo.isEmpty())
{ {
new CommonDialog(DownActivity.this).setMessage("该轮胎未安装!").show(); commonDialog.setMessage("该轮胎未安装!").show();
return; return;
} }
if (millage == null || millage.isEmpty()) if (millage == null || millage.isEmpty())
{ {
new CommonDialog(DownActivity.this).setMessage("请输入卸胎里程!").show(); commonDialog.setMessage("请输入卸胎里程!").show();
return; return;
} }
if (wheel == null || wheel.isEmpty()) if (wheel == null || wheel.isEmpty())
{ {
new CommonDialog(DownActivity.this).setMessage("该轮胎未安装!").show(); commonDialog.setMessage("该轮胎未安装!").show();
return; return;
} }
showLoadingDialog(); showLoadingDialog();
@ -327,7 +343,7 @@ public class DownActivity extends AllBaseActivity {
car.setText(carNo); car.setText(carNo);
azlw.setText(wheel); azlw.setText(wheel);
}else { }else {
new CommonDialog(DownActivity.this).setMessage("系统无此轮胎!").show(); commonDialog.setMessage("系统无此轮胎!").show();
th.setText(""); th.setText("");
zbh.setText(""); zbh.setText("");
} }
@ -343,6 +359,15 @@ public class DownActivity extends AllBaseActivity {
} }
// 删除实时表、卸车记录表 // 删除实时表、卸车记录表
private void down_insert(String rfid,String carNo,String millage,String wheel,String patternDepth) { private void down_insert(String rfid,String carNo,String millage,String wheel,String patternDepth) {
String reason = binding.unloadingReason.getSelectedItem().toString();
if (reason.isEmpty()){
commonDialog.setMessage("请选择卸胎原因!").show();
return;
}
if (reason.equals("自定义")){
reason=binding.unloadingReasonRemark.getText().toString().trim();
}
OkGo.<String>post(MyUrl.url + "/tyre/install/PdaUnInstallTyre").tag(this) OkGo.<String>post(MyUrl.url + "/tyre/install/PdaUnInstallTyre").tag(this)
.params("tyreRfid", rfid) .params("tyreRfid", rfid)
.params("mileage", millage) .params("mileage", millage)

@ -5,293 +5,257 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical" android:orientation="vertical"
android:background="@color/allbg"
tools:context="com.example.tyre.DownActivity"> tools:context="com.example.tyre.DownActivity">
<TextView <TextView
android:id="@+id/textView2"
style="@style/tablebarStyleTwo" style="@style/tablebarStyleTwo"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="30dp" android:layout_height="55dp"
android:text="轮胎卸车" android:text="轮胎卸车" />
app:layout_constraintTop_toTopOf="parent" />
<LinearLayout <LinearLayout
android:id="@+id/linearLayout2"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="40dp" android:layout_height="45dp"
android:layout_marginStart="8dp" style="@style/layout_t12_s8_style">
android:layout_marginTop="20dp"
android:layout_marginEnd="8dp"
android:orientation="horizontal"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/linearLayout3">
<TextView <TextView
style="@style/alltext" style="@style/alltext"
android:layout_width="80dp" android:layout_width="80dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="@color/blue2" android:text="扫描EPC:" />
android:text="EPC:" />
<TextView <TextView
android:id="@+id/epc" android:id="@+id/epc"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginStart="8dp" style="@style/scanTextStyle"
android:layout_weight="1" />
android:textSize="15sp"
android:textColor="@color/black"
android:background="@drawable/bg_santex_coppy"
android:gravity="center" />
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="40dp" android:layout_height="45dp"
android:layout_marginStart="8dp" style="@style/layout_t12_s8_style">
android:layout_marginTop="20dp"
android:layout_marginEnd="8dp"
android:orientation="horizontal"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/linearLayout3">
<TextView <TextView
style="@style/alltext" style="@style/alltext"
android:layout_width="80dp" android:layout_width="80dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="@color/blue2"
android:text="胎号:" /> android:text="胎号:" />
<TextView <TextView
android:id="@+id/th" android:id="@+id/th"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginStart="8dp" style="@style/textView_info_style"
android:layout_weight="1" />
android:textSize="15sp"
android:textColor="@color/black"
android:background="@drawable/bg_santex_coppy"
android:gravity="center" />
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="40dp" android:layout_height="45dp"
android:layout_marginStart="8dp" style="@style/layout_t12_s8_style">
android:layout_marginTop="20dp"
android:layout_marginEnd="8dp"
android:orientation="horizontal"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/linearLayout3">
<TextView <TextView
style="@style/alltext" style="@style/alltext"
android:layout_width="80dp" android:layout_width="80dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="@color/blue2"
android:text="自编号:" /> android:text="自编号:" />
<TextView <TextView
android:id="@+id/zbh" android:id="@+id/zbh"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginStart="8dp" style="@style/textView_info_style" />
android:layout_weight="1"
android:textSize="15sp"
android:textColor="@color/black"
android:background="@drawable/bg_santex_coppy"
android:gravity="center" />
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout
android:id="@+id/linearLayout4" android:id="@+id/linearLayout4"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="40dp" android:layout_height="45dp"
android:layout_marginStart="8dp" style="@style/layout_t12_s8_style">
android:layout_marginTop="20dp"
android:layout_marginEnd="8dp"
android:orientation="horizontal"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/linearLayout3">
<TextView <TextView
style="@style/alltext" style="@style/alltext"
android:layout_width="80dp" android:layout_width="80dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="@color/blue2"
android:text="车牌号:" /> android:text="车牌号:" />
<TextView <TextView
android:id="@+id/car" android:id="@+id/car"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginStart="8dp" style="@style/textView_info_style" />
android:layout_weight="1"
android:textSize="22sp"
android:textColor="@color/black"
android:background="@drawable/bg_santex_coppy"
android:gravity="center" />
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout
android:id="@+id/linearLayout1" android:id="@+id/linearLayout1"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="40dp" android:layout_height="45dp"
android:layout_marginStart="8dp" style="@style/layout_t12_s8_style">
android:layout_marginTop="20dp"
android:layout_marginEnd="8dp"
android:orientation="horizontal"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/linearLayout3">
<TextView <TextView
style="@style/alltext" style="@style/alltext"
android:layout_width="80dp" android:layout_width="80dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="@color/blue2"
android:text="终止里程:" /> android:text="终止里程:" />
<EditText <EditText
android:id="@+id/start" android:id="@+id/start"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginStart="8dp" android:inputType="number"
android:layout_weight="1" style="@style/scanTextStyle"
android:textSize="22sp" android:hint="输入终止里程"/>
android:textColor="@color/black"
android:background="@drawable/bg_santex_coppy"
android:gravity="center"
android:inputType="number"/>
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout
android:id="@+id/linearLayout5" android:id="@+id/linearLayout5"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="40dp" android:layout_height="45dp"
android:layout_marginStart="8dp" style="@style/layout_t12_s8_style">
android:layout_marginTop="20dp"
android:layout_marginEnd="8dp"
android:orientation="horizontal"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/linearLayout3">
<TextView <TextView
style="@style/alltext" style="@style/alltext"
android:layout_width="80dp" android:layout_width="80dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="@color/blue2"
android:text="拆下轮位:" /> android:text="拆下轮位:" />
<TextView <TextView
android:id="@+id/azlw" android:id="@+id/azlw"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginStart="8dp" style="@style/textView_info_style" />
android:layout_weight="1"
android:textSize="22sp"
android:textColor="@color/black"
android:background="@drawable/bg_santex_coppy"
android:gravity="center" />
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout
android:id="@+id/linearLayout7" android:id="@+id/linearLayout7"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="40dp" android:layout_height="45dp"
android:layout_marginStart="8dp" style="@style/layout_t12_s8_style">
android:layout_marginTop="20dp"
android:layout_marginEnd="8dp"
android:orientation="horizontal"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/linearLayout3">
<TextView <TextView
style="@style/alltext" style="@style/alltext"
android:layout_width="80dp" android:layout_width="80dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="@color/blue2"
android:text="花纹深度:" /> android:text="花纹深度:" />
<EditText <EditText
android:id="@+id/patternDepth" android:id="@+id/patternDepth"
android:layout_width="0dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="1" android:layout_weight="1"
android:textSize="22sp" style="@style/textView_info_style"
android:textColor="@color/black"
android:background="@drawable/bg_santex_coppy"
android:gravity="center"
android:inputType="numberDecimal"
android:imeOptions="actionDone" android:imeOptions="actionDone"
android:paddingEnd="4dp" /> android:inputType="numberDecimal"
/>
<!-- 单位文本:固定宽度或包裹内容 --> <!-- 单位文本:固定宽度或包裹内容 -->
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="40dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:text="毫米" android:layout_marginStart="4dp"
android:textSize="22sp"
android:textColor="@color/black"
android:gravity="center" android:gravity="center"
android:layout_marginStart="4dp" /> android:text="mm"
android:textColor="@color/black"
android:textSize="15sp" />
</LinearLayout> </LinearLayout>
<!--<LinearLayout-->
<!--android:layout_width="match_parent"-->
<!--android:layout_height="40dp"-->
<!--android:layout_marginStart="8dp"-->
<!--android:layout_marginTop="20dp"-->
<!--android:layout_marginEnd="8dp"-->
<!--android:orientation="horizontal"-->
<!--app:layout_constraintEnd_toEndOf="parent"-->
<!--app:layout_constraintStart_toStartOf="parent"-->
<!--app:layout_constraintTop_toBottomOf="@+id/linearLayout3">-->
<!--<TextView-->
<!--style="@style/alltext"-->
<!--android:layout_width="80dp"-->
<!--android:layout_height="match_parent"-->
<!--android:background="@color/blue2"-->
<!--android:text="操作人:" />-->
<!--<TextView--> <LinearLayout
<!--android:id="@+id/czr"--> android:layout_width="match_parent"
<!--android:layout_width="match_parent"--> android:layout_height="45dp"
<!--android:layout_height="match_parent"--> style="@style/layout_t12_s8_style">
<!--android:layout_marginStart="8dp"-->
<!--android:layout_weight="1"--> <TextView
<!--android:textSize="22sp"--> style="@style/alltext"
<!--android:textColor="@color/black"--> android:layout_width="80dp"
<!--android:background="@drawable/bg_santex_coppy"--> android:layout_height="match_parent"
<!--android:gravity="center" />--> android:text="卸胎原因:" />
<!--<Spinner-->
<!--android:id="@+id/spinner2"--> <Spinner
<!--android:entries="@array/user"--> android:id="@+id/unloading_reason"
<!--android:layout_width="30dp"--> android:layout_width="match_parent"
<!--android:layout_height="match_parent"></Spinner>--> android:layout_height="match_parent"
android:entries="@array/xietai"
android:textAlignment="center"/>
</LinearLayout>
<EditText
android:id="@+id/unloading_reason_remark"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="88dp"
android:layout_marginEnd="8dp"
style="@style/textView_info_style"
android:gravity="top"
android:hint="输入卸胎原因"
android:minHeight="50dp"
android:padding="8dp"
android:textColor="@color/textColor1"
android:textSize="15sp" />
<!--<LinearLayout-->
<!--android:layout_width="match_parent"-->
<!--android:layout_height="40dp"-->
<!--android:layout_marginStart="8dp"-->
<!--android:layout_marginTop="20dp"-->
<!--android:layout_marginEnd="8dp"-->
<!--android:orientation="horizontal"-->
<!--app:layout_constraintEnd_toEndOf="parent"-->
<!--app:layout_constraintStart_toStartOf="parent"-->
<!--app:layout_constraintTop_toBottomOf="@+id/linearLayout3">-->
<!--<TextView-->
<!--style="@style/alltext"-->
<!--android:layout_width="80dp"-->
<!--android:layout_height="match_parent"-->
<!--android:background="@color/blue2"-->
<!--android:text="操作人:" />-->
<!--<TextView-->
<!--android:id="@+id/czr"-->
<!--android:layout_width="match_parent"-->
<!--android:layout_height="match_parent"-->
<!--android:layout_marginStart="8dp"-->
<!--android:layout_weight="1"-->
<!--android:textSize="22sp"-->
<!--android:textColor="@color/black"-->
<!--android:background="@drawable/bg_santex_coppy"-->
<!--android:gravity="center" />-->
<!--<Spinner-->
<!--android:id="@+id/spinner2"-->
<!--android:entries="@array/user"-->
<!--android:layout_width="30dp"-->
<!--android:layout_height="match_parent"></Spinner>-->
<!--</LinearLayout>--> <!--</LinearLayout>-->
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="50dp" android:layout_height="50dp"
android:layout_marginTop="50dp" style="@style/layout_t12_s8_style"
android:orientation="horizontal"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent">
android:layout_marginStart="50dp"
android:layout_marginEnd="50dp"
android:orientation="horizontal">
<Button <Button
android:id="@+id/ok" android:id="@+id/ok"
style="@style/buttonStyle"
android:layout_width="150dp" android:layout_width="150dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="1" android:layout_weight="1"
android:text="完成" android:text="完成" />
style="@style/buttonStyle"/>
<View <View
android:layout_width="50dp" android:layout_width="50dp"
android:layout_height="match_parent" android:layout_height="match_parent" />
/>
<Button <Button
android:id="@+id/back" android:id="@+id/back"
style="@style/buttonStyle"
android:layout_width="150dp" android:layout_width="150dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="1" android:layout_weight="1"
android:text="返回" android:text="返回" />
style="@style/buttonStyle"/>
</LinearLayout> </LinearLayout>

@ -46,4 +46,12 @@
<item>轮胎修补</item> <item>轮胎修补</item>
<item>轮胎报废</item> <item>轮胎报废</item>
</string-array> </string-array>
<string-array name="xietai">
<item>正常</item>
<item>裂口</item>
<item>光头</item>
<item>胎损</item>
<item>索赔</item>
<item>自定义</item>
</string-array>
</resources> </resources>

@ -73,8 +73,28 @@
<item name="android:gravity">center</item> <item name="android:gravity">center</item>
<item name="android:textColor">@color/chip_text_color</item> <item name="android:textColor">@color/chip_text_color</item>
<item name="android:background">@drawable/bg_block_selector</item> <item name="android:background">@drawable/bg_block_selector</item>
</style> </style>
<style name="scanTextStyle">
<item name="android:background">@drawable/bg_santext</item>
<item name="android:gravity">center</item>
<item name="android:textColor">@color/black</item>
<item name="android:textSize">15sp</item>
</style>
<style name="textView_info_style">
<item name="android:background">@drawable/bg_santex_coppy</item>
<item name="android:gravity">center</item>
<item name="android:textColor">@color/black</item>
<item name="android:textSize">15sp</item>
</style>
<style name="layout_t12_s8_style">
<item name="android:layout_marginTop">12dp</item>
<item name="android:layout_marginStart">8dp</item>
<item name="android:layout_marginEnd">8dp</item>
</style>
<!-- <style name="MyMiddleDialogStyle" parent="@android:style/Theme.Holo.Light.Dialog">--> <!-- <style name="MyMiddleDialogStyle" parent="@android:style/Theme.Holo.Light.Dialog">-->
<style name="MyMiddleDialogStyle" parent="@style/MaterialComponents_style"> <style name="MyMiddleDialogStyle" parent="@style/MaterialComponents_style">

Loading…
Cancel
Save