feat: ui opt

This commit is contained in:
2025-11-26 17:56:00 +08:00
parent a01b17dd8f
commit 4a3b8a85eb
2 changed files with 354 additions and 347 deletions

View File

@@ -3,6 +3,7 @@
xmlns:tools="http://schemas.android.com/tools">
<data>
<import type="com.lukouguoji.module_base.ui.weight.data.layout.DataLayoutType" />
<variable
@@ -21,391 +22,397 @@
<!-- 主内容区域 -->
<ScrollView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:padding="15dp">
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/bg_white_radius_8"
android:orientation="vertical"
android:padding="20dp">
android:padding="15dp">
<!-- 第一部分前2行表单左侧2列+ 地磅称重(右侧) -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
android:background="@drawable/bg_white_radius_8"
android:orientation="vertical"
android:padding="20dp">
<!-- 左侧前2行表单2列 -->
<!-- 第一部分前2行表单左侧2列+ 地磅称重(右侧 -->
<LinearLayout
android:layout_width="0dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="2"
android:orientation="vertical">
android:orientation="horizontal">
<!-- 第1行架子车号、通道号 -->
<!-- 左侧前2行表单2列 -->
<LinearLayout
android:layout_width="match_parent"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:orientation="horizontal">
android:layout_weight="2"
android:orientation="vertical">
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
android:layout_width="0dp"
<!-- 第1行架子车号、通道号 -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
hint='@{"请输入架子车号"}'
title='@{"架子车号:"}'
titleLength="@{5}"
type="@{DataLayoutType.INPUT}"
value='@={viewModel.dataBean.carId}' />
android:orientation="horizontal">
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
android:layout_width="0dp"
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
hint='@{"请输入架子车号"}'
title='@{"架子车号"}'
titleLength="@{5}"
type="@{DataLayoutType.INPUT}"
value='@={viewModel.dataBean.carId}'
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
hint='@{"请选择通道号"}'
list="@{viewModel.passagewayList}"
title='@{"通道号"}'
titleLength="@{5}"
type="@{DataLayoutType.SPINNER}"
value='@={viewModel.channel}'
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="15dp"
android:layout_weight="1" />
</LinearLayout>
<!-- 第2行ULD编号、IMP代码 -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="15dp"
android:layout_weight="1"
hint='@{"请选择通道号"}'
list="@{viewModel.passagewayList}"
title='@{"通道号:"}'
titleLength="@{4}"
type="@{DataLayoutType.SPINNER}"
value='@={viewModel.channel}' />
android:layout_marginTop="15dp"
android:orientation="horizontal">
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
hint='@{"请输入ULD编号"}'
title='@{"ULD编号"}'
titleLength="@{5}"
type="@{DataLayoutType.INPUT}"
value='@={viewModel.dataBean.uld}'
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
hint='@{"请输入IMP代码"}'
title='@{"IMP代码"}'
titleLength="@{5}"
type="@{DataLayoutType.INPUT}"
value='@={viewModel.dataBean.dgrCode}'
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="15dp"
android:layout_weight="1" />
</LinearLayout>
</LinearLayout>
<!-- 第2行ULD编号、IMP代码 -->
<!-- 右侧:地磅称重区域 -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:orientation="horizontal">
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
hint='@{"请输入ULD编号"}'
title='@{"ULD编号"}'
titleLength="@{6}"
type="@{DataLayoutType.INPUT}"
value='@={viewModel.dataBean.uld}' />
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="15dp"
android:layout_weight="1"
hint='@{"请输入IMP代码"}'
title='@{"IMP代码"}'
titleLength="@{6}"
type="@{DataLayoutType.INPUT}"
value='@={viewModel.dataBean.dgrCode}' />
</LinearLayout>
</LinearLayout>
<!-- 右侧:地磅称重区域 -->
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginStart="15dp"
android:layout_weight="1"
android:orientation="vertical">
<!-- 黄色标题栏 -->
<TextView
android:layout_width="match_parent"
android:layout_height="50dp"
android:background="@drawable/bg_shouyun_dbcz"
android:gravity="center"
android:text="地磅称重"
android:textColor="@color/black"
android:textSize="20sp"
android:textStyle="bold" />
<!-- 青色重量显示区域 -->
<RelativeLayout
android:layout_width="match_parent"
android:layout_width="0dp"
android:layout_height="match_parent"
android:background="@drawable/bg_shouyun_dbzl"
android:minHeight="150dp"
android:padding="8dp">
android:layout_marginStart="15dp"
android:layout_weight="1"
android:orientation="vertical">
<!-- 黄色标题栏 -->
<TextView
android:id="@+id/tvWeight"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_centerInParent="true"
android:text="@{viewModel.totalWeight}"
android:textColor="@color/text_red"
android:textSize="45sp"
android:textStyle="bold"
tools:text="1655" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="@id/tvWeight"
android:layout_marginStart="8dp"
android:layout_toEndOf="@id/tvWeight"
android:text="kg"
android:textStyle="bold"
android:layout_width="match_parent"
android:layout_height="50dp"
android:background="@drawable/bg_shouyun_dbcz"
android:gravity="center"
android:text="地磅称重"
android:textColor="@color/black"
android:textSize="24sp" />
android:textSize="20sp"
android:textStyle="bold" />
</RelativeLayout>
<!-- 青色重量显示区域 -->
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/bg_shouyun_dbzl"
android:minHeight="150dp"
android:padding="8dp">
<TextView
android:id="@+id/tvWeight"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_centerInParent="true"
android:text="@{viewModel.totalWeight}"
android:textColor="@color/text_red"
android:textSize="45sp"
android:textStyle="bold"
tools:text="1655" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="@id/tvWeight"
android:layout_marginStart="8dp"
android:layout_toEndOf="@id/tvWeight"
android:text="kg"
android:textColor="@color/text_red"
android:textSize="24sp"
android:textStyle="bold" />
</RelativeLayout>
</LinearLayout>
</LinearLayout>
<!-- 第3行板型、高度、总重红色只读 -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:orientation="horizontal">
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
hint='@{"请输入板型"}'
title='@{"板型"}'
titleLength="@{5}"
type="@{DataLayoutType.INPUT}"
value='@={viewModel.dataBean.boardType}'
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
hint='@{"请输入高度"}'
title='@{"高度"}'
titleLength="@{5}"
type="@{DataLayoutType.INPUT}"
value='@={viewModel.dataBean.height}'
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="15dp"
android:layout_weight="1" />
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
enable="@{false}"
title='@{"总重"}'
titleLength="@{5}"
type="@{DataLayoutType.INPUT}"
value='@{viewModel.totalWeight}'
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="15dp"
android:layout_weight="1" />
</LinearLayout>
<!-- 第4行探板收口、探板尺寸、装机重蓝色只读 -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:orientation="horizontal">
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
hint='@{"请选择探板收口"}'
list="@{viewModel.piCloseList}"
title='@{"探板收口"}'
titleLength="@{5}"
type="@{DataLayoutType.SPINNER}"
value='@={viewModel.dataBean.piClose}'
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
hint='@{"请输入探板尺寸"}'
title='@{"探板尺寸"}'
titleLength="@{5}"
type="@{DataLayoutType.INPUT}"
value='@={viewModel.dataBean.piCloseSize}'
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="15dp"
android:layout_weight="1" />
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
enable="@{false}"
title='@{"装机重"}'
titleLength="@{5}"
type="@{DataLayoutType.INPUT}"
value='@{viewModel.netWeight}'
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="15dp"
android:layout_weight="1" />
</LinearLayout>
<!-- 第5行架子车自重、ULD自重、货重绿色只读 -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:orientation="horizontal">
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
enable="@{false}"
title='@{"架子车自重"}'
titleLength="@{5}"
type="@{DataLayoutType.INPUT}"
value='@{String.valueOf(viewModel.dataBean.carWeight)}'
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
enable="@{false}"
title='@{"ULD自重"}'
titleLength="@{5}"
type="@{DataLayoutType.INPUT}"
value='@{String.valueOf(viewModel.dataBean.uldWeight)}'
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="15dp"
android:layout_weight="1" />
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
enable="@{false}"
title='@{"货重"}'
titleLength="@{5}"
type="@{DataLayoutType.INPUT}"
value='@{viewModel.cargoWeight}'
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="15dp"
android:layout_weight="1" />
</LinearLayout>
<!-- 第6行航班日期、航班号、目的港 -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:orientation="horizontal">
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
title='@{"航班日期"}'
titleLength="@{5}"
type="@{DataLayoutType.DATE}"
value='@={viewModel.dataBean.fdate}'
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
hint='@{"请输入航班号"}'
title='@{"航班号"}'
titleLength="@{5}"
type="@{DataLayoutType.INPUT}"
value='@={viewModel.dataBean.fno}'
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="15dp"
android:layout_weight="1" />
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
hint='@{"请输入目的港"}'
title='@{"目的港"}'
titleLength="@{5}"
type="@{DataLayoutType.INPUT}"
value='@={viewModel.dataBean.fdest}'
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="15dp"
android:layout_weight="1" />
</LinearLayout>
<!-- 第7行件数、备注、空 -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:orientation="horizontal">
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
hint='@{"请输入件数"}'
title='@{"件数"}'
titleLength="@{5}"
type="@{DataLayoutType.INPUT}"
value='@={viewModel.dataBean.pieces}'
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
hint='@{"请输入备注"}'
title='@{"备注"}'
titleLength="@{5}"
type="@{DataLayoutType.INPUT}"
value='@={viewModel.dataBean.remark}'
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="15dp"
android:layout_weight="2" />
</LinearLayout>
</LinearLayout>
<!-- 第3行板型、高度、总重红色只读 -->
<LinearLayout
<!-- 底部操作栏 -->
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:orientation="horizontal">
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
hint='@{"请输入板型"}'
title='@{"板型:"}'
titleLength="@{3}"
type="@{DataLayoutType.INPUT}"
value='@={viewModel.dataBean.boardType}' />
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="15dp"
android:layout_weight="1"
hint='@{"请输入高度"}'
title='@{"高度:"}'
titleLength="@{3}"
type="@{DataLayoutType.INPUT}"
value='@={viewModel.dataBean.height}' />
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="15dp"
android:layout_weight="1"
enable="@{false}"
title='@{"总重:"}'
titleLength="@{3}"
type="@{DataLayoutType.INPUT}"
value='@{viewModel.totalWeight}' />
</LinearLayout>
<!-- 第4行探板收口、探板尺寸、装机重蓝色只读 -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:orientation="horizontal">
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
hint='@{"请选择探板收口"}'
list="@{viewModel.piCloseList}"
title='@{"探板收口:"}'
titleLength="@{5}"
type="@{DataLayoutType.SPINNER}"
value='@={viewModel.dataBean.piClose}' />
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="15dp"
android:layout_weight="1"
hint='@{"请输入探板尺寸"}'
title='@{"探板尺寸:"}'
titleLength="@{5}"
type="@{DataLayoutType.INPUT}"
value='@={viewModel.dataBean.piCloseSize}' />
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="15dp"
android:layout_weight="1"
enable="@{false}"
title='@{"装机重:"}'
titleLength="@{4}"
type="@{DataLayoutType.INPUT}"
value='@{viewModel.netWeight}' />
</LinearLayout>
<!-- 第5行架子车自重、ULD自重、货重绿色只读 -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:orientation="horizontal">
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
enable="@{false}"
title='@{"架子车自重:"}'
titleLength="@{6}"
type="@{DataLayoutType.INPUT}"
value='@{String.valueOf(viewModel.dataBean.carWeight)}' />
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="15dp"
android:layout_weight="1"
enable="@{false}"
title='@{"ULD自重"}'
titleLength="@{6}"
type="@{DataLayoutType.INPUT}"
value='@{String.valueOf(viewModel.dataBean.uldWeight)}' />
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="15dp"
android:layout_weight="1"
enable="@{false}"
title='@{"货重:"}'
titleLength="@{3}"
type="@{DataLayoutType.INPUT}"
value='@{viewModel.cargoWeight}' />
</LinearLayout>
<!-- 第6行航班日期、航班号、目的港 -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:orientation="horizontal">
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
title='@{"航班日期:"}'
titleLength="@{5}"
type="@{DataLayoutType.DATE}"
value='@={viewModel.dataBean.fdate}' />
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="15dp"
android:layout_weight="1"
hint='@{"请输入航班号"}'
title='@{"航班号:"}'
titleLength="@{4}"
type="@{DataLayoutType.INPUT}"
value='@={viewModel.dataBean.fno}' />
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="15dp"
android:layout_weight="1"
hint='@{"请输入目的港"}'
title='@{"目的港:"}'
titleLength="@{4}"
type="@{DataLayoutType.INPUT}"
value='@={viewModel.dataBean.fdest}' />
</LinearLayout>
<!-- 第7行件数、备注、空 -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:orientation="horizontal">
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
hint='@{"请输入件数"}'
title='@{"件数:"}'
titleLength="@{3}"
type="@{DataLayoutType.INPUT}"
value='@={viewModel.dataBean.pieces}' />
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="15dp"
android:layout_weight="1"
hint='@{"请输入备注"}'
title='@{"备注:"}'
titleLength="@{3}"
type="@{DataLayoutType.INPUT}"
value='@={viewModel.dataBean.remark}' />
android:layout_marginTop="24dp"
android:padding="15dp">
<Space
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_weight="1" />
android:id="@+id/sCenter"
android:layout_width="32dp"
android:layout_height="wrap_content"
android:layout_centerInParent="true"/>
</LinearLayout>
<CheckBox
android:layout_toStartOf="@+id/btnReset"
android:id="@+id/cbPrint"
android:layout_centerVertical="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="32dp"
android:checked="@={viewModel.printTag}"
android:text="打印挂签"
android:textColor="@color/black"
android:textSize="18sp" />
<TextView
android:id="@+id/btnReset"
android:layout_toStartOf="@+id/sCenter"
android:layout_width="120dp"
android:layout_height="50dp"
android:background="@drawable/bg_primary_radius_4"
android:gravity="center"
android:onClick="@{(v)-> viewModel.resetClick()}"
android:text="重置"
android:textColor="@color/white"
android:textSize="18sp" />
<TextView
android:layout_toEndOf="@+id/sCenter"
android:layout_width="120dp"
android:layout_height="50dp"
android:background="@drawable/bg_primary_radius_4"
android:gravity="center"
android:onClick="@{(v)-> viewModel.confirmClick()}"
android:text="确定"
android:textColor="@color/white"
android:textSize="18sp" />
</RelativeLayout>
</LinearLayout>
</ScrollView>
<!-- 底部操作栏 -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:gravity="center_vertical"
android:orientation="horizontal"
android:padding="15dp">
<CheckBox
android:id="@+id/cbPrint"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:checked="@={viewModel.printTag}"
android:text="打印挂签"
android:textColor="@color/black"
android:textSize="18sp" />
<TextView
android:layout_width="120dp"
android:layout_height="50dp"
android:layout_marginEnd="15dp"
android:background="@drawable/bg_gray_radius_4"
android:gravity="center"
android:onClick="@{(v)-> viewModel.resetClick()}"
android:text="重置"
android:textColor="@color/white"
android:textSize="18sp" />
<TextView
android:layout_width="120dp"
android:layout_height="50dp"
android:background="@drawable/bg_primary_radius_4"
android:gravity="center"
android:onClick="@{(v)-> viewModel.confirmClick()}"
android:text="确定"
android:textColor="@color/white"
android:textSize="18sp" />
</LinearLayout>
</LinearLayout>
</layout>

View File

@@ -217,7 +217,7 @@
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
enable="@{false}"
title='@{"业务类型"}'
title='@{"业务类型"}'
titleLength="@{5}"
type="@{DataLayoutType.INPUT}"
value='@{viewModel.dataBean.businessName}'
@@ -277,7 +277,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:minWidth="80dp"
android:text="附件"
android:text="附件"
android:textColor="@color/text_gray"
android:textSize="14sp" />