feat: 出港计重 已计重
This commit is contained in:
@@ -30,6 +30,12 @@ class GjcWeighingRecordListActivity :
|
|||||||
|
|
||||||
binding.viewModel = viewModel
|
binding.viewModel = viewModel
|
||||||
|
|
||||||
|
// 初始化代理人列表
|
||||||
|
viewModel.initAgentList()
|
||||||
|
|
||||||
|
// 初始化特码列表
|
||||||
|
viewModel.initSpecialCodeList()
|
||||||
|
|
||||||
// 绑定分页逻辑
|
// 绑定分页逻辑
|
||||||
viewModel.pageModel
|
viewModel.pageModel
|
||||||
.bindSmartRefreshLayout(binding.srl, binding.rv, viewModel, getLifecycleOwner())
|
.bindSmartRefreshLayout(binding.srl, binding.rv, viewModel, getLifecycleOwner())
|
||||||
|
|||||||
@@ -12,6 +12,8 @@ import com.lukouguoji.module_base.ktx.launchCollect
|
|||||||
import com.lukouguoji.module_base.ktx.launchLoadingCollect
|
import com.lukouguoji.module_base.ktx.launchLoadingCollect
|
||||||
import com.lukouguoji.module_base.ktx.toRequestBody
|
import com.lukouguoji.module_base.ktx.toRequestBody
|
||||||
import com.lukouguoji.module_base.model.ScanModel
|
import com.lukouguoji.module_base.model.ScanModel
|
||||||
|
import com.lukouguoji.module_base.util.DictUtils
|
||||||
|
import dev.utils.app.info.KeyValue
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 国际出港计重记录 ViewModel
|
* 国际出港计重记录 ViewModel
|
||||||
@@ -25,6 +27,10 @@ class GjcWeighingRecordViewModel : BasePageViewModel() {
|
|||||||
val spCode = MutableLiveData("") // 特码
|
val spCode = MutableLiveData("") // 特码
|
||||||
val waybillNo = MutableLiveData("") // 运单号
|
val waybillNo = MutableLiveData("") // 运单号
|
||||||
|
|
||||||
|
// 下拉列表数据源
|
||||||
|
val agentList = MutableLiveData(listOf(KeyValue("全部", "")))
|
||||||
|
val spCodeList = MutableLiveData<List<KeyValue>>(emptyList())
|
||||||
|
|
||||||
// 适配器配置
|
// 适配器配置
|
||||||
val itemViewHolder = GjcWeighingRecordViewHolder::class.java
|
val itemViewHolder = GjcWeighingRecordViewHolder::class.java
|
||||||
val itemLayoutId = R.layout.item_gjc_weighing_record
|
val itemLayoutId = R.layout.item_gjc_weighing_record
|
||||||
@@ -39,6 +45,36 @@ class GjcWeighingRecordViewModel : BasePageViewModel() {
|
|||||||
// 方法区
|
// 方法区
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 初始化代理人列表
|
||||||
|
*/
|
||||||
|
fun initAgentList() {
|
||||||
|
launchCollect({
|
||||||
|
NetApply.api.getIntExpAgentList()
|
||||||
|
}) {
|
||||||
|
onSuccess = { result ->
|
||||||
|
val list = mutableListOf(KeyValue("全部", ""))
|
||||||
|
result.data?.forEach {
|
||||||
|
list.add(KeyValue(it.name ?: "", it.code ?: ""))
|
||||||
|
}
|
||||||
|
agentList.value = list
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 初始化特码列表
|
||||||
|
*/
|
||||||
|
fun initSpecialCodeList() {
|
||||||
|
DictUtils.getSpecialCodeList(
|
||||||
|
flag = 1, // 国际
|
||||||
|
ieFlag = "", // 空字符串
|
||||||
|
parentcode = "" // 无父级
|
||||||
|
) {
|
||||||
|
spCodeList.value = it
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 扫码输入航班号
|
* 扫码输入航班号
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -56,6 +56,7 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
hint='@{"请选择代理"}'
|
hint='@{"请选择代理"}'
|
||||||
|
list="@{viewModel.agentList}"
|
||||||
type="@{SearchLayoutType.SPINNER}"
|
type="@{SearchLayoutType.SPINNER}"
|
||||||
value="@={viewModel.agentCode}" />
|
value="@={viewModel.agentCode}" />
|
||||||
|
|
||||||
@@ -65,6 +66,7 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
hint='@{"请选择特码"}'
|
hint='@{"请选择特码"}'
|
||||||
|
list="@{viewModel.spCodeList}"
|
||||||
type="@{SearchLayoutType.SPINNER}"
|
type="@{SearchLayoutType.SPINNER}"
|
||||||
value="@={viewModel.spCode}" />
|
value="@={viewModel.spCode}" />
|
||||||
|
|
||||||
@@ -84,12 +86,15 @@
|
|||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:gravity="center">
|
android:gravity="center_vertical|start"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:paddingHorizontal="24dp">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:layout_width="32dp"
|
android:layout_width="36dp"
|
||||||
android:layout_height="32dp"
|
android:layout_height="36dp"
|
||||||
android:onClick="@{()-> viewModel.searchClick()}"
|
android:onClick="@{()-> viewModel.searchClick()}"
|
||||||
|
android:padding="2dp"
|
||||||
android:src="@drawable/img_search" />
|
android:src="@drawable/img_search" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
@@ -159,16 +164,6 @@
|
|||||||
android:textStyle="bold"
|
android:textStyle="bold"
|
||||||
tools:text="总重量:100" />
|
tools:text="总重量:100" />
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginLeft="20dp"
|
|
||||||
android:text='@{"总货重:"+viewModel.cargoWeight}'
|
|
||||||
android:textColor="@color/bottom_tool_tips_text_color"
|
|
||||||
android:textSize="18sp"
|
|
||||||
android:textStyle="bold"
|
|
||||||
tools:text="总货重:100" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<!-- 运抵申报按钮 -->
|
<!-- 运抵申报按钮 -->
|
||||||
|
|||||||
@@ -30,8 +30,8 @@
|
|||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1"
|
|
||||||
android:layout_marginLeft="10dp"
|
android:layout_marginLeft="10dp"
|
||||||
|
android:layout_weight="1"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<!-- 第一行数据 -->
|
<!-- 第一行数据 -->
|
||||||
@@ -47,59 +47,59 @@
|
|||||||
android:gravity="center_vertical">
|
android:gravity="center_vertical">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
completeSpace="@{5}"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
completeSpace="@{4}"
|
|
||||||
android:text="运单号:" />
|
android:text="运单号:" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@{bean.no}"
|
android:text="@{bean.wbNo}"
|
||||||
android:textColor="@color/colorPrimary"
|
android:textColor="@color/colorPrimary"
|
||||||
tools:text="78109081212" />
|
tools:text="78109081212" />
|
||||||
|
|
||||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
<!-- 代理人 -->
|
<!-- 预配件数 -->
|
||||||
<androidx.appcompat.widget.LinearLayoutCompat
|
<androidx.appcompat.widget.LinearLayoutCompat
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="0.8"
|
android:layout_weight="1"
|
||||||
android:gravity="center_vertical">
|
android:gravity="center_vertical">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
completeSpace="@{5}"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
completeSpace="@{4}"
|
android:text="预配件数:" />
|
||||||
android:text="代理人:" />
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text='@{bean.agentName}'
|
android:text='@{String.valueOf(bean.pc)}'
|
||||||
tools:text="SF" />
|
tools:text="10" />
|
||||||
|
|
||||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
<!-- 特码 -->
|
<!-- 预配重量 -->
|
||||||
<androidx.appcompat.widget.LinearLayoutCompat
|
<androidx.appcompat.widget.LinearLayoutCompat
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="0.8"
|
android:layout_weight="1"
|
||||||
android:gravity="center_vertical">
|
android:gravity="center_vertical">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
completeSpace="@{5}"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
completeSpace="@{3}"
|
android:text="预配重量:" />
|
||||||
android:text="特码:" />
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@{bean.spCode}"
|
android:text='@{String.valueOf((int)bean.weight)}'
|
||||||
tools:text="NOR" />
|
tools:text="100" />
|
||||||
|
|
||||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
@@ -111,9 +111,9 @@
|
|||||||
android:gravity="center_vertical">
|
android:gravity="center_vertical">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
completeSpace="@{5}"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
completeSpace="@{5}"
|
|
||||||
android:text="入库件数:" />
|
android:text="入库件数:" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
@@ -132,9 +132,9 @@
|
|||||||
android:gravity="center_vertical">
|
android:gravity="center_vertical">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
completeSpace="@{5}"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
completeSpace="@{5}"
|
|
||||||
android:text="入库重量:" />
|
android:text="入库重量:" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
@@ -153,7 +153,7 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="10dp">
|
android:layout_marginTop="10dp">
|
||||||
|
|
||||||
<!-- 计划航班 -->
|
<!-- 代理人 -->
|
||||||
<androidx.appcompat.widget.LinearLayoutCompat
|
<androidx.appcompat.widget.LinearLayoutCompat
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
@@ -161,58 +161,37 @@
|
|||||||
android:gravity="center_vertical">
|
android:gravity="center_vertical">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
completeSpace="@{5}"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
completeSpace="@{5}"
|
android:text="代理人:" />
|
||||||
android:text="计划航班:" />
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@{bean.flight}"
|
android:text='@{bean.agentName}'
|
||||||
tools:text="20240216/MU2026" />
|
tools:text="顺丰" />
|
||||||
|
|
||||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
<!-- 航程 -->
|
<!-- 特码 -->
|
||||||
<androidx.appcompat.widget.LinearLayoutCompat
|
<androidx.appcompat.widget.LinearLayoutCompat
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="0.8"
|
android:layout_weight="1"
|
||||||
android:gravity="center_vertical">
|
android:gravity="center_vertical">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
completeSpace="@{3}"
|
|
||||||
android:text="航程:" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text='@{bean.range}'
|
|
||||||
tools:text="HFE - PEK" />
|
|
||||||
|
|
||||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
|
||||||
|
|
||||||
<!-- 预计起飞 -->
|
|
||||||
<androidx.appcompat.widget.LinearLayoutCompat
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="0.8"
|
|
||||||
android:gravity="center_vertical">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
completeSpace="@{5}"
|
completeSpace="@{5}"
|
||||||
android:text="预计起飞:" />
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="特码:" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@{bean.fdate}"
|
android:text='@{bean.spCode}'
|
||||||
tools:text="09:12" />
|
tools:text="NOR" />
|
||||||
|
|
||||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
@@ -224,9 +203,9 @@
|
|||||||
android:gravity="center_vertical">
|
android:gravity="center_vertical">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
completeSpace="@{5}"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
completeSpace="@{4}"
|
|
||||||
android:text="收运人:" />
|
android:text="收运人:" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
@@ -241,13 +220,13 @@
|
|||||||
<androidx.appcompat.widget.LinearLayoutCompat
|
<androidx.appcompat.widget.LinearLayoutCompat
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1"
|
android:layout_weight="2"
|
||||||
android:gravity="center_vertical">
|
android:gravity="center_vertical">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
completeSpace="@{5}"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
completeSpace="@{5}"
|
|
||||||
android:text="入库时间:" />
|
android:text="入库时间:" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
@@ -267,8 +246,8 @@
|
|||||||
android:layout_width="30dp"
|
android:layout_width="30dp"
|
||||||
android:layout_height="30dp"
|
android:layout_height="30dp"
|
||||||
android:layout_gravity="center"
|
android:layout_gravity="center"
|
||||||
android:src="@drawable/img_pda_right"
|
android:layout_marginLeft="10dp"
|
||||||
android:layout_marginLeft="10dp" />
|
android:src="@drawable/img_pda_right" />
|
||||||
|
|
||||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
</layout>
|
</layout>
|
||||||
|
|||||||
Reference in New Issue
Block a user