feat: 国际进港查询详情页面(三Tab:运单/仓库/库位信息)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-16 11:34:20 +08:00
parent edb1f576b7
commit baaa9c5615
21 changed files with 1417 additions and 3 deletions

View File

@@ -508,6 +508,13 @@
android:exported="false"
android:screenOrientation="userLandscape" />
<!-- 国际进港-查询详情 -->
<activity
android:name="com.lukouguoji.gjj.activity.IntImpQueryDetailsActivity"
android:configChanges="orientation|keyboardHidden"
android:exported="false"
android:screenOrientation="userLandscape" />
<!-- 国际进港-事故签证 -->
<activity
android:name="com.lukouguoji.gjj.activity.IntImpAccidentVisaActivity"

View File

@@ -50,7 +50,11 @@ class GjjWarehouse(
var volume: String? = "",
var wbNo: String? = "",
var weight: String? = "",
var whid: String? = ""
var whid: String? = "",
var splitFlag: String? = "",
var inDate: String? = "",
var clearNormal: String? = "",
var range: String? = ""
) {
fun getWaybillCode() = "${prefix}${no}"

View File

@@ -0,0 +1,23 @@
package com.lukouguoji.module_base.bean
import java.io.Serializable
/**
* 国际进港-库位使用记录Bean
* 对应接口: /IntImpSearch/detail 返回的 storageUseList 项
*/
data class GjjStorageUse(
var id: Long? = null, // 主键
var maWbId: Long? = null, // 运单id
var prefix: String? = null, // 运单前缀
var no: String? = null, // 运单号
var location: String? = null, // 库位号
var locationId: Long? = null, // 库位id
var inDate: String? = null, // 入库时间
var inOpId: String? = null, // 入库人ID
var inOpName: String? = null, // 入库人姓名
var outDate: String? = null, // 出库时间
var outOpId: String? = null, // 出库人ID
var outOpName: String? = null, // 出库人姓名
var cargoStatus: String? = null // 货物状态
) : Serializable

View File

@@ -1015,6 +1015,13 @@ interface Api {
@POST("IntImpSearch/pageQueryTotal")
suspend fun getIntImpQueryTotal(@Body data: RequestBody): BaseResultBean<ManifestTotalDto>
/**
* 国际进港查询-详情
* 接口路径: /IntImpSearch/detail
*/
@POST("IntImpSearch/detail")
suspend fun getIntImpQueryDetails(@Body data: RequestBody): BaseResultBean<Map<String, Any>>
/**
* 国际出港待计重-分页搜索
* 接口路径: /IntExpCheckIn/pageQuery

View File

@@ -24,7 +24,7 @@ import com.lukouguoji.module_base.BaseActivity
import com.lukouguoji.module_base.common.Constant
import com.lukouguoji.module_base.router.ARouterConstants
@Route(path = ARouterConstants.ACTIVITY_URL_GJJ_QUERY_INFO)
// @Route(path = ARouterConstants.ACTIVITY_URL_GJJ_QUERY_INFO) // 已替换为 IntImpQueryDetailsActivity
class GjjQueryInfoActivity : BaseActivity(), View.OnClickListener {
private lateinit var viewModel: GjjQueryInfoViewModel

View File

@@ -11,6 +11,7 @@ import com.lukouguoji.module_base.base.BaseBindingActivity
import com.lukouguoji.module_base.common.ConstantEvent
import com.lukouguoji.module_base.impl.FlowBus
import com.lukouguoji.module_base.impl.observe
import com.lukouguoji.module_base.ktx.addOnItemClickListener
import com.lukouguoji.module_base.ktx.getLifecycleOwner
import com.lukouguoji.module_base.router.ARouterConstants
@@ -33,6 +34,9 @@ class IntImpQueryActivity :
viewModel.pageModel
.bindSmartRefreshLayout(binding.srl, binding.rv, viewModel, getLifecycleOwner())
// 注册列表项点击事件
binding.rv.addOnItemClickListener(viewModel)
FlowBus.with<String>(ConstantEvent.EVENT_REFRESH).observe(this) {
viewModel.refresh()
}

View File

@@ -0,0 +1,58 @@
package com.lukouguoji.gjj.activity
import android.content.Context
import android.content.Intent
import android.os.Bundle
import com.alibaba.android.arouter.facade.annotation.Route
import com.lukouguoji.gjj.R
import com.lukouguoji.gjj.databinding.ActivityIntImpQueryDetailsBinding
import com.lukouguoji.gjj.viewModel.IntImpQueryDetailsViewModel
import com.lukouguoji.module_base.base.BaseBindingActivity
import com.lukouguoji.module_base.base.CustomVP2Adapter
import com.lukouguoji.module_base.common.Constant
import com.lukouguoji.module_base.router.ARouterConstants
/**
* 国际进港查询详情页面
*/
@Route(path = ARouterConstants.ACTIVITY_URL_GJJ_QUERY_INFO)
class IntImpQueryDetailsActivity :
BaseBindingActivity<ActivityIntImpQueryDetailsBinding, IntImpQueryDetailsViewModel>() {
override fun layoutId() = R.layout.activity_int_imp_query_details
override fun viewModelClass() = IntImpQueryDetailsViewModel::class.java
override fun initOnCreate(savedInstanceState: Bundle?) {
setBackArrow("国际进港查询详情")
binding.viewModel = viewModel
// 初始化ViewModel(传入maWbId)
viewModel.initOnCreated(intent)
// 配置ViewPager2
binding.vp.adapter = CustomVP2Adapter(
viewModel.fragmentList,
supportFragmentManager,
lifecycle
)
binding.vp.isUserInputEnabled = false // 禁用滑动
binding.vp.offscreenPageLimit = 3 // 预加载3个Fragment
// 监听Tab索引变化,切换Fragment
viewModel.currentTab.observe(this) {
binding.vp.setCurrentItem(it, false)
}
// 加载详情数据
viewModel.loadDetails()
}
companion object {
@JvmStatic
fun start(context: Context, maWbId: Long?) {
val starter = Intent(context, IntImpQueryDetailsActivity::class.java)
.putExtra(Constant.Key.ID, maWbId?.toString() ?: "")
context.startActivity(starter)
}
}
}

View File

@@ -0,0 +1,89 @@
package com.lukouguoji.gjj.fragment
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.databinding.DataBindingUtil
import androidx.fragment.app.Fragment
import androidx.recyclerview.widget.LinearLayoutManager
import com.lukouguoji.gjj.R
import com.lukouguoji.gjj.databinding.FragmentIntImpQueryStorageBinding
import com.lukouguoji.gjj.holder.IntImpQueryStorageViewHolder
import com.lukouguoji.gjj.viewModel.IntImpQueryDetailsViewModel
import com.lukouguoji.module_base.base.CommonAdapter
import com.lukouguoji.module_base.bean.GjjStorageUse
import com.lukouguoji.module_base.http.net.NetApply
/**
* 国际进港查询详情 - 库位信息Fragment
*/
class IntImpQueryStorageFragment : Fragment() {
private lateinit var binding: FragmentIntImpQueryStorageBinding
private lateinit var viewModel: IntImpQueryDetailsViewModel
private lateinit var adapter: CommonAdapter
override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
savedInstanceState: Bundle?
): View {
binding = DataBindingUtil.inflate(
inflater,
R.layout.fragment_int_imp_query_storage,
container,
false
)
binding.lifecycleOwner = viewLifecycleOwner
initRecyclerView()
observeData()
return binding.root
}
private fun initRecyclerView() {
adapter = CommonAdapter(
requireContext(),
R.layout.item_int_imp_query_storage,
IntImpQueryStorageViewHolder::class.java
)
binding.rvStorageList.apply {
layoutManager = LinearLayoutManager(requireContext())
adapter = this@IntImpQueryStorageFragment.adapter
}
}
private fun observeData() {
viewModel.storageUseList.observe(viewLifecycleOwner) { mapList ->
if (mapList.isEmpty()) {
binding.rvStorageList.visibility = View.GONE
binding.llEmpty.visibility = View.VISIBLE
} else {
val beanList = mapList.map { map ->
try {
val json = NetApply.gson.toJson(map)
NetApply.gson.fromJson(json, GjjStorageUse::class.java)
} catch (e: Exception) {
e.printStackTrace()
GjjStorageUse()
}
}
binding.rvStorageList.visibility = View.VISIBLE
binding.llEmpty.visibility = View.GONE
adapter.refresh(beanList)
}
}
}
companion object {
@JvmStatic
fun newInstance(vm: IntImpQueryDetailsViewModel) =
IntImpQueryStorageFragment().apply {
viewModel = vm
}
}
}

View File

@@ -0,0 +1,89 @@
package com.lukouguoji.gjj.fragment
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.databinding.DataBindingUtil
import androidx.fragment.app.Fragment
import androidx.recyclerview.widget.LinearLayoutManager
import com.lukouguoji.gjj.R
import com.lukouguoji.gjj.databinding.FragmentIntImpQueryWarehouseBinding
import com.lukouguoji.gjj.holder.IntImpQueryWarehouseViewHolder
import com.lukouguoji.gjj.viewModel.IntImpQueryDetailsViewModel
import com.lukouguoji.module_base.base.CommonAdapter
import com.lukouguoji.module_base.bean.GjjWarehouse
import com.lukouguoji.module_base.http.net.NetApply
/**
* 国际进港查询详情 - 仓库信息Fragment
*/
class IntImpQueryWarehouseFragment : Fragment() {
private lateinit var binding: FragmentIntImpQueryWarehouseBinding
private lateinit var viewModel: IntImpQueryDetailsViewModel
private lateinit var adapter: CommonAdapter
override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
savedInstanceState: Bundle?
): View {
binding = DataBindingUtil.inflate(
inflater,
R.layout.fragment_int_imp_query_warehouse,
container,
false
)
binding.lifecycleOwner = viewLifecycleOwner
initRecyclerView()
observeData()
return binding.root
}
private fun initRecyclerView() {
adapter = CommonAdapter(
requireContext(),
R.layout.item_int_imp_query_warehouse,
IntImpQueryWarehouseViewHolder::class.java
)
binding.rvWarehouseList.apply {
layoutManager = LinearLayoutManager(requireContext())
adapter = this@IntImpQueryWarehouseFragment.adapter
}
}
private fun observeData() {
viewModel.warehouseList.observe(viewLifecycleOwner) { mapList ->
if (mapList.isEmpty()) {
binding.rvWarehouseList.visibility = View.GONE
binding.llEmpty.visibility = View.VISIBLE
} else {
val beanList = mapList.map { map ->
try {
val json = NetApply.gson.toJson(map)
NetApply.gson.fromJson(json, GjjWarehouse::class.java)
} catch (e: Exception) {
e.printStackTrace()
GjjWarehouse()
}
}
binding.rvWarehouseList.visibility = View.VISIBLE
binding.llEmpty.visibility = View.GONE
adapter.refresh(beanList)
}
}
}
companion object {
@JvmStatic
fun newInstance(vm: IntImpQueryDetailsViewModel) =
IntImpQueryWarehouseFragment().apply {
viewModel = vm
}
}
}

View File

@@ -0,0 +1,44 @@
package com.lukouguoji.gjj.fragment
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.databinding.DataBindingUtil
import androidx.fragment.app.Fragment
import com.lukouguoji.gjj.R
import com.lukouguoji.gjj.databinding.FragmentIntImpQueryWaybillBinding
import com.lukouguoji.gjj.viewModel.IntImpQueryDetailsViewModel
/**
* 国际进港查询详情 - 运单信息Fragment
*/
class IntImpQueryWaybillFragment : Fragment() {
private lateinit var binding: FragmentIntImpQueryWaybillBinding
private lateinit var viewModel: IntImpQueryDetailsViewModel
override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
savedInstanceState: Bundle?
): View {
binding = DataBindingUtil.inflate(
inflater,
R.layout.fragment_int_imp_query_waybill,
container,
false
)
binding.lifecycleOwner = viewLifecycleOwner
binding.viewModel = viewModel
return binding.root
}
companion object {
@JvmStatic
fun newInstance(vm: IntImpQueryDetailsViewModel) =
IntImpQueryWaybillFragment().apply {
viewModel = vm
}
}
}

View File

@@ -0,0 +1,20 @@
package com.lukouguoji.gjj.holder
import android.view.View
import com.lukouguoji.gjj.databinding.ItemIntImpQueryStorageBinding
import com.lukouguoji.module_base.base.BaseViewHolder
import com.lukouguoji.module_base.bean.GjjStorageUse
/**
* 国际进港查询详情-库位信息ViewHolder
*/
class IntImpQueryStorageViewHolder(view: View) :
BaseViewHolder<GjjStorageUse, ItemIntImpQueryStorageBinding>(view) {
override fun onBind(item: Any?, position: Int) {
val bean = getItemBean(item) ?: return
binding.bean = bean
binding.position = position
binding.executePendingBindings()
}
}

View File

@@ -15,5 +15,8 @@ class IntImpQueryViewHolder(view: View) :
val bean = getItemBean(item)!!
binding.bean = bean
binding.executePendingBindings()
// 注册整行点击事件
notifyItemClick(position, binding.ll)
}
}

View File

@@ -0,0 +1,20 @@
package com.lukouguoji.gjj.holder
import android.view.View
import com.lukouguoji.gjj.databinding.ItemIntImpQueryWarehouseBinding
import com.lukouguoji.module_base.base.BaseViewHolder
import com.lukouguoji.module_base.bean.GjjWarehouse
/**
* 国际进港查询详情-仓库信息ViewHolder
*/
class IntImpQueryWarehouseViewHolder(view: View) :
BaseViewHolder<GjjWarehouse, ItemIntImpQueryWarehouseBinding>(view) {
override fun onBind(item: Any?, position: Int) {
val bean = getItemBean(item) ?: return
binding.bean = bean
binding.position = position
binding.executePendingBindings()
}
}

View File

@@ -0,0 +1,129 @@
package com.lukouguoji.gjj.viewModel
import android.content.Intent
import androidx.lifecycle.MutableLiveData
import com.lukouguoji.gjj.fragment.IntImpQueryStorageFragment
import com.lukouguoji.gjj.fragment.IntImpQueryWarehouseFragment
import com.lukouguoji.gjj.fragment.IntImpQueryWaybillFragment
import com.lukouguoji.module_base.base.BaseViewModel
import com.lukouguoji.module_base.common.Constant
import com.lukouguoji.module_base.http.net.NetApply
import com.lukouguoji.module_base.ktx.launchLoadingCollect
import com.lukouguoji.module_base.ktx.showToast
import com.lukouguoji.module_base.ktx.toRequestBody
/**
* 国际进港查询详情-ViewModel
*/
class IntImpQueryDetailsViewModel : BaseViewModel() {
// ==================== 基础数据 ====================
var maWbId: String = "" // 运单主键ID
// ==================== Tab管理 ====================
val currentTab = MutableLiveData(0) // 当前Tab索引 (0/1/2)
// ==================== 详情数据 ====================
val detailData = MutableLiveData<Map<String, Any>>(emptyMap())
// 运单信息 (maWb)
val maWbData = MutableLiveData<Map<String, Any>>(emptyMap())
// 仓库列表 (warehouseList)
val warehouseList = MutableLiveData<List<Map<String, Any>>>(emptyList())
// 库位列表 (storageUseList)
val storageUseList = MutableLiveData<List<Map<String, Any>>>(emptyList())
// ==================== Fragment列表 ====================
val fragmentList by lazy {
listOf(
IntImpQueryWaybillFragment.newInstance(this), // 运单信息
IntImpQueryWarehouseFragment.newInstance(this), // 仓库信息
IntImpQueryStorageFragment.newInstance(this) // 库位信息
)
}
// ==================== 方法区 ====================
/**
* 初始化(从Intent获取maWbId)
*/
fun initOnCreated(intent: Intent) {
maWbId = intent.getStringExtra(Constant.Key.ID) ?: ""
}
/**
* Tab点击事件
*/
fun onTabClick(index: Int) {
currentTab.value = index
}
/**
* 加载详情数据
*/
fun loadDetails() {
if (maWbId.isEmpty()) {
showToast("运单ID为空")
return
}
val maWbIdValue = maWbId.toLongOrNull()
if (maWbIdValue == null) {
showToast("运单ID格式错误")
return
}
val params = mapOf("maWbId" to maWbIdValue).toRequestBody()
launchLoadingCollect({ NetApply.api.getIntImpQueryDetails(params) }) {
onSuccess = { result ->
val data = result.data ?: emptyMap()
detailData.value = data
// 解析 maWb 对象
@Suppress("UNCHECKED_CAST")
val maWb = data["maWb"] as? Map<String, Any> ?: emptyMap()
// 合并数据并添加组合字段
val mergedData = mutableMapOf<String, Any>()
mergedData.putAll(maWb)
// 添加组合字段: wbNo = prefix + no
val prefix = maWb["prefix"] as? String ?: ""
val no = maWb["no"] as? String ?: ""
if (prefix.isNotEmpty() || no.isNotEmpty()) {
mergedData["wbNo"] = "$prefix$no"
}
// 锁定状态转中文
val lockState = maWb["lockState"]
if (lockState != null) {
val lockStateInt = when (lockState) {
is Double -> lockState.toInt()
is Int -> lockState
else -> null
}
mergedData["lockStateText"] = when (lockStateInt) {
0 -> "未锁定"
1 -> "已锁定"
else -> ""
}
}
maWbData.value = mergedData
// 解析 warehouseList 列表
@Suppress("UNCHECKED_CAST")
val whList = data["warehouseList"] as? List<Map<String, Any>> ?: emptyList()
warehouseList.value = whList
// 解析 storageUseList 列表
@Suppress("UNCHECKED_CAST")
val suList = data["storageUseList"] as? List<Map<String, Any>> ?: emptyList()
storageUseList.value = suList
}
}
}
}

View File

@@ -6,9 +6,13 @@ import androidx.lifecycle.MutableLiveData
import com.lukouguoji.gjj.R
import com.lukouguoji.gjj.dialog.IntImpQueryFilterDialogModel
import com.lukouguoji.gjj.holder.IntImpQueryViewHolder
import com.lukouguoji.gjj.activity.IntImpQueryDetailsActivity
import com.lukouguoji.module_base.base.BasePageViewModel
import com.lukouguoji.module_base.bean.IntImpQueryBean
import com.lukouguoji.module_base.common.Constant
import com.lukouguoji.module_base.http.net.NetApply
import com.lukouguoji.module_base.interfaces.IOnItemClickListener
import com.lukouguoji.module_base.ktx.commonAdapter
import com.lukouguoji.module_base.ktx.launchCollect
import com.lukouguoji.module_base.ktx.launchLoadingCollect
import com.lukouguoji.module_base.ktx.showToast
@@ -21,7 +25,7 @@ import com.lukouguoji.module_base.ktx.formatDate
/**
* 国际进港查询ViewModel
*/
class IntImpQueryViewModel : BasePageViewModel() {
class IntImpQueryViewModel : BasePageViewModel(), IOnItemClickListener {
// ==================== 搜索条件 ====================
val flightDateStart = MutableLiveData<String>(DateUtils.getCurrentTime().formatDate())
@@ -145,6 +149,12 @@ class IntImpQueryViewModel : BasePageViewModel() {
}
}
override fun onItemClick(position: Int, type: Int) {
val list = pageModel.rv?.commonAdapter()?.items as? List<IntImpQueryBean> ?: return
val bean = list.getOrNull(position) ?: return
IntImpQueryDetailsActivity.start(getTopActivity(), bean.maWbId)
}
fun initAgentList() {
launchCollect({
NetApply.api.getIntImpAgentList()

View File

@@ -0,0 +1,124 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<data>
<import type="android.view.View" />
<variable
name="viewModel"
type="com.lukouguoji.gjj.viewModel.IntImpQueryDetailsViewModel" />
</data>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/color_f2"
android:orientation="vertical">
<!-- 标题栏 -->
<include layout="@layout/title_tool_bar" />
<!-- Tab栏 (自定义,文字Tab + 底线) -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_marginHorizontal="15dp"
android:layout_marginTop="15dp"
android:background="@drawable/bg_white_radius_top_8"
android:orientation="horizontal">
<!-- Tab1: 运单信息 -->
<LinearLayout
android:layout_width="100dp"
android:layout_height="match_parent"
android:gravity="center"
android:onClick="@{()->viewModel.onTabClick(0)}"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_weight="1"
android:gravity="center"
android:text="运单信息"
android:textStyle="bold"
android:textColor="@{viewModel.currentTab == 0 ? @color/colorPrimary : @color/text_gray}"
android:textSize="16sp" />
<View
android:layout_width="60dp"
android:layout_height="3dp"
android:background="@{viewModel.currentTab == 0 ? @color/colorPrimary : @color/transparent}"
android:visibility="@{viewModel.currentTab == 0 ? View.VISIBLE : View.INVISIBLE}" />
</LinearLayout>
<!-- Tab2: 仓库信息 -->
<LinearLayout
android:layout_width="100dp"
android:layout_height="match_parent"
android:gravity="center"
android:onClick="@{()->viewModel.onTabClick(1)}"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_weight="1"
android:gravity="center"
android:text="仓库信息"
android:textStyle="bold"
android:textColor="@{viewModel.currentTab == 1 ? @color/colorPrimary : @color/text_gray}"
android:textSize="16sp" />
<View
android:layout_width="60dp"
android:layout_height="3dp"
android:background="@{viewModel.currentTab == 1 ? @color/colorPrimary : @color/transparent}"
android:visibility="@{viewModel.currentTab == 1 ? View.VISIBLE : View.INVISIBLE}" />
</LinearLayout>
<!-- Tab3: 库位信息 -->
<LinearLayout
android:layout_width="100dp"
android:layout_height="match_parent"
android:gravity="center"
android:onClick="@{()->viewModel.onTabClick(2)}"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_weight="1"
android:gravity="center"
android:text="库位信息"
android:textStyle="bold"
android:textColor="@{viewModel.currentTab == 2 ? @color/colorPrimary : @color/text_gray}"
android:textSize="16sp" />
<View
android:layout_width="60dp"
android:layout_height="3dp"
android:background="@{viewModel.currentTab == 2 ? @color/colorPrimary : @color/transparent}"
android:visibility="@{viewModel.currentTab == 2 ? View.VISIBLE : View.INVISIBLE}" />
</LinearLayout>
</LinearLayout>
<com.google.android.material.divider.MaterialDivider
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginStart="15dp"
android:layout_marginEnd="23dp"
android:background="@color/color_f2" />
<!-- ViewPager2 -->
<androidx.viewpager2.widget.ViewPager2
android:id="@+id/vp"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1" />
</LinearLayout>
</layout>

View File

@@ -0,0 +1,125 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<data>
<import type="android.view.View" />
</data>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:paddingHorizontal="15dp"
android:paddingBottom="15dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/bg_white_radius_bottom_8"
android:orientation="vertical"
android:paddingEnd="8dp">
<!-- 表头 -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="40dp"
android:background="@color/color_f2"
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingHorizontal="10dp">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.5"
android:gravity="center"
android:text="序号"
android:textColor="@color/black"
android:textSize="14sp"
android:textStyle="bold" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1.5"
android:gravity="center"
android:text="库位号"
android:textColor="@color/black"
android:textSize="14sp"
android:textStyle="bold" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:text="入库人"
android:textColor="@color/black"
android:textSize="14sp"
android:textStyle="bold" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1.5"
android:gravity="center"
android:text="入库时间"
android:textColor="@color/black"
android:textSize="14sp"
android:textStyle="bold" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:text="出库人"
android:textColor="@color/black"
android:textSize="14sp"
android:textStyle="bold" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1.5"
android:gravity="center"
android:text="出库时间"
android:textColor="@color/black"
android:textSize="14sp"
android:textStyle="bold" />
</LinearLayout>
<!-- 数据列表 -->
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_storage_list"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:nestedScrollingEnabled="true"
android:overScrollMode="never"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" />
<!-- 暂无数据提示 -->
<LinearLayout
android:id="@+id/ll_empty"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical"
android:visibility="gone">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="暂无数据"
android:textColor="@color/text_gray"
android:textSize="16sp" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</layout>

View File

@@ -0,0 +1,135 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<data>
<import type="android.view.View" />
</data>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:paddingHorizontal="15dp"
android:paddingBottom="15dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/bg_white_radius_bottom_8"
android:orientation="vertical"
android:paddingEnd="8dp">
<!-- 表头 -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="40dp"
android:background="@color/color_f2"
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingHorizontal="10dp">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.5"
android:gravity="center"
android:text="序号"
android:textColor="@color/black"
android:textSize="14sp"
android:textStyle="bold" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.8"
android:gravity="center"
android:text="件数"
android:textColor="@color/black"
android:textSize="14sp"
android:textStyle="bold" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.8"
android:gravity="center"
android:text="重量"
android:textColor="@color/black"
android:textSize="14sp"
android:textStyle="bold" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:text="航班日期"
android:textColor="@color/black"
android:textSize="14sp"
android:textStyle="bold" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:text="航班号"
android:textColor="@color/black"
android:textSize="14sp"
android:textStyle="bold" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.6"
android:gravity="center"
android:text="分批"
android:textColor="@color/black"
android:textSize="14sp"
android:textStyle="bold" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1.3"
android:gravity="center"
android:text="入库时间"
android:textColor="@color/black"
android:textSize="14sp"
android:textStyle="bold" />
</LinearLayout>
<!-- 数据列表 -->
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_warehouse_list"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:nestedScrollingEnabled="true"
android:overScrollMode="never"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" />
<!-- 暂无数据提示 -->
<LinearLayout
android:id="@+id/ll_empty"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical"
android:visibility="gone">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="暂无数据"
android:textColor="@color/text_gray"
android:textSize="16sp" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</layout>

View File

@@ -0,0 +1,341 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android">
<data>
<import type="com.lukouguoji.module_base.ui.weight.data.layout.DataLayoutType" />
<import type="android.view.View" />
<variable
name="viewModel"
type="com.lukouguoji.gjj.viewModel.IntImpQueryDetailsViewModel" />
</data>
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/color_f2"
android:fillViewport="true">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingHorizontal="15dp"
android:paddingBottom="15dp">
<!-- 运单信息卡片 -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/bg_white_radius_bottom_8"
android:orientation="vertical"
android:padding="15dp">
<!-- 第1行: 运单号、代理人、特码 -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
enable="@{false}"
title='@{"运单号"}'
titleLength="@{5}"
type="@{DataLayoutType.INPUT}"
value='@{(String)viewModel.maWbData.get("wbNo")}' />
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
enable="@{false}"
title='@{"代理人"}'
titleLength="@{5}"
type="@{DataLayoutType.INPUT}"
value='@{(String)viewModel.maWbData.get("agentCode")}' />
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
enable="@{false}"
title='@{"特码"}'
titleLength="@{5}"
type="@{DataLayoutType.INPUT}"
value='@{(String)viewModel.maWbData.get("spCode")}' />
</LinearLayout>
<!-- 第2行: 运单件数、运单重量、业务类型 -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:orientation="horizontal">
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
enable="@{false}"
title='@{"运单件数"}'
titleLength="@{5}"
type="@{DataLayoutType.INPUT}"
value='@{viewModel.maWbData.get("pc") != null ? String.valueOf((int)Math.round(((Double)viewModel.maWbData.get("pc")))) : ``}' />
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
enable="@{false}"
title='@{"运单重量"}'
titleLength="@{5}"
type="@{DataLayoutType.INPUT}"
value='@{viewModel.maWbData.get("weight") != null ? String.valueOf(viewModel.maWbData.get("weight")) : ``}' />
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
enable="@{false}"
title='@{"业务类型"}'
titleLength="@{5}"
type="@{DataLayoutType.INPUT}"
value='@{(String)viewModel.maWbData.get("businessName")}' />
</LinearLayout>
<!-- 第3行: 入库件数、入库重量、计费重量 -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:orientation="horizontal">
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
enable="@{false}"
title='@{"入库件数"}'
titleLength="@{5}"
type="@{DataLayoutType.INPUT}"
value='@{viewModel.maWbData.get("inPc") != null ? String.valueOf((int)Math.round(((Double)viewModel.maWbData.get("inPc")))) : ``}' />
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
enable="@{false}"
title='@{"入库重量"}'
titleLength="@{5}"
type="@{DataLayoutType.INPUT}"
value='@{viewModel.maWbData.get("inWeight") != null ? String.valueOf(viewModel.maWbData.get("inWeight")) : ``}' />
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
enable="@{false}"
title='@{"计费重量"}'
titleLength="@{5}"
type="@{DataLayoutType.INPUT}"
value='@{viewModel.maWbData.get("cashWeight") != null ? String.valueOf(viewModel.maWbData.get("cashWeight")) : ``}' />
</LinearLayout>
<!-- 第4行: 承运人、航程、包装类型 -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:orientation="horizontal">
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
enable="@{false}"
title='@{"承运人"}'
titleLength="@{5}"
type="@{DataLayoutType.INPUT}"
value='@{(String)viewModel.maWbData.get("by1")}' />
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
enable="@{false}"
title='@{"航程"}'
titleLength="@{5}"
type="@{DataLayoutType.INPUT}"
value='@{(String)viewModel.maWbData.get("range")}' />
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
enable="@{false}"
title='@{"包装类型"}'
titleLength="@{5}"
type="@{DataLayoutType.INPUT}"
value='@{(String)viewModel.maWbData.get("packageType")}' />
</LinearLayout>
<!-- 第5行: 运单类型、库位、UN编号 -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:orientation="horizontal">
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
enable="@{false}"
title='@{"运单类型"}'
titleLength="@{5}"
type="@{DataLayoutType.INPUT}"
value='@{(String)viewModel.maWbData.get("awbName")}' />
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
enable="@{false}"
title='@{"库位"}'
titleLength="@{5}"
type="@{DataLayoutType.INPUT}"
value='@{(String)viewModel.maWbData.get("location")}' />
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
enable="@{false}"
title='@{"UN编号"}'
titleLength="@{5}"
type="@{DataLayoutType.INPUT}"
value='@{(String)viewModel.maWbData.get("unNumber")}' />
</LinearLayout>
<!-- 第6行: 品名(中)占2列、锁定状态占1列 -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:orientation="horizontal">
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="2"
enable="@{false}"
title='@{"品名(中)"}'
titleLength="@{5}"
type="@{DataLayoutType.INPUT}"
value='@{(String)viewModel.maWbData.get("goodsCn")}' />
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
enable="@{false}"
title='@{"锁定状态"}'
titleLength="@{5}"
type="@{DataLayoutType.INPUT}"
value='@{(String)viewModel.maWbData.get("lockStateText")}' />
</LinearLayout>
<!-- 第7行: 品名(英)占2列、出库时间占1列 -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:orientation="horizontal">
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="2"
enable="@{false}"
title='@{"品名(英)"}'
titleLength="@{5}"
type="@{DataLayoutType.INPUT}"
value='@{(String)viewModel.maWbData.get("goods")}' />
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
enable="@{false}"
title='@{"出库时间"}'
titleLength="@{5}"
type="@{DataLayoutType.INPUT}"
value='@{(String)viewModel.maWbData.get("dlvTime")}' />
</LinearLayout>
<!-- 第8行: 原始舱单、理货报告、海关放行 -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:orientation="horizontal">
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
enable="@{false}"
title='@{"原始舱单"}'
titleLength="@{5}"
type="@{DataLayoutType.INPUT}"
value='@{(String)viewModel.maWbData.get("mftStatus")}' />
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
enable="@{false}"
title='@{"理货报告"}'
titleLength="@{5}"
type="@{DataLayoutType.INPUT}"
value='@{(String)viewModel.maWbData.get("tallyStatus")}' />
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
enable="@{false}"
title='@{"海关放行"}'
titleLength="@{5}"
type="@{DataLayoutType.INPUT}"
value='@{(String)viewModel.maWbData.get("command")}' />
</LinearLayout>
<!-- 第9行: 备注 - 多行输入 -->
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
enable="@{false}"
inputHeight="@{80}"
title='@{"备注"}'
titleLength="@{5}"
type="@{DataLayoutType.INPUT}"
value='@{(String)viewModel.maWbData.get("remark")}' />
</LinearLayout>
</LinearLayout>
</ScrollView>
</layout>

View File

@@ -0,0 +1,86 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android">
<data>
<variable
name="bean"
type="com.lukouguoji.module_base.bean.GjjStorageUse" />
<variable
name="position"
type="Integer" />
</data>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@{position % 2 == 0 ? @color/white : @color/color_f2}"
android:gravity="center_vertical"
android:minHeight="40dp"
android:orientation="horizontal"
android:paddingHorizontal="10dp"
android:paddingVertical="8dp">
<!-- 序号 -->
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.5"
android:gravity="center"
android:text="@{String.valueOf(position + 1)}"
android:textColor="@android:color/black"
android:textSize="14sp" />
<!-- 库位号 -->
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1.5"
android:gravity="center"
android:text="@{bean.location ?? `--`}"
android:textColor="@android:color/black"
android:textSize="14sp" />
<!-- 入库人 -->
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:text="@{bean.inOpName != null ? bean.inOpName : (bean.inOpId ?? `--`)}"
android:textColor="@android:color/black"
android:textSize="14sp" />
<!-- 入库时间 -->
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1.5"
android:gravity="center"
android:text="@{bean.inDate != null &amp;&amp; bean.inDate.length() >= 16 ? bean.inDate.substring(0, 16) : (bean.inDate != null &amp;&amp; bean.inDate.length() > 0 ? bean.inDate : `--`)}"
android:textColor="@android:color/black"
android:textSize="14sp" />
<!-- 出库人 -->
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:text="@{bean.outOpName != null ? bean.outOpName : (bean.outOpId ?? `--`)}"
android:textColor="@android:color/black"
android:textSize="14sp" />
<!-- 出库时间 -->
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1.5"
android:gravity="center"
android:text="@{bean.outDate != null &amp;&amp; bean.outDate.length() >= 16 ? bean.outDate.substring(0, 16) : (bean.outDate != null &amp;&amp; bean.outDate.length() > 0 ? bean.outDate : `--`)}"
android:textColor="@android:color/black"
android:textSize="14sp" />
</LinearLayout>
</layout>

View File

@@ -0,0 +1,96 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android">
<data>
<variable
name="bean"
type="com.lukouguoji.module_base.bean.GjjWarehouse" />
<variable
name="position"
type="Integer" />
</data>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@{position % 2 == 0 ? @color/white : @color/color_f2}"
android:gravity="center_vertical"
android:minHeight="40dp"
android:orientation="horizontal"
android:paddingHorizontal="10dp"
android:paddingVertical="8dp">
<!-- 序号 -->
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.5"
android:gravity="center"
android:text="@{String.valueOf(position + 1)}"
android:textColor="@android:color/black"
android:textSize="14sp" />
<!-- 件数 -->
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.8"
android:gravity="center"
android:text="@{bean.pc != null ? String.valueOf(bean.pc) : ``}"
android:textColor="@android:color/black"
android:textSize="14sp" />
<!-- 重量 -->
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.8"
android:gravity="center"
android:text="@{bean.weight ?? ``}"
android:textColor="@android:color/black"
android:textSize="14sp" />
<!-- 航班日期 -->
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:text="@{bean.fdate ?? ``}"
android:textColor="@android:color/black"
android:textSize="14sp" />
<!-- 航班号 -->
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:text="@{bean.fno ?? ``}"
android:textColor="@android:color/black"
android:textSize="14sp" />
<!-- 分批 -->
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.6"
android:gravity="center"
android:text="@{bean.splitFlag != null &amp;&amp; bean.splitFlag.length() > 0 ? bean.splitFlag : `1`}"
android:textColor="@android:color/black"
android:textSize="14sp" />
<!-- 入库时间 -->
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1.3"
android:gravity="center"
android:text="@{bean.inDate != null &amp;&amp; bean.inDate.length() >= 16 ? bean.inDate.substring(0, 16) : (bean.inDate ?? ``)}"
android:textColor="@android:color/black"
android:textSize="14sp" />
</LinearLayout>
</layout>