feat: 板箱过磅

This commit is contained in:
2025-11-21 13:56:07 +08:00
parent cd670552e6
commit 8a1e6bc208
20 changed files with 1855 additions and 2 deletions

View File

@@ -104,6 +104,21 @@
android:configChanges="orientation|keyboardHidden"
android:exported="false"
android:screenOrientation="userLandscape" />
<activity
android:name="com.lukouguoji.gjc.activity.GjcBoxWeighingActivity"
android:configChanges="orientation|keyboardHidden"
android:exported="false"
android:screenOrientation="userLandscape" />
<activity
android:name="com.lukouguoji.gjc.activity.GjcBoxWeighingDetailsActivity"
android:configChanges="orientation|keyboardHidden"
android:exported="false"
android:screenOrientation="userLandscape" />
<activity
android:name="com.lukouguoji.gjc.activity.GjcBoxWeighingAddActivity"
android:configChanges="orientation|keyboardHidden"
android:exported="false"
android:screenOrientation="userLandscape" />
<activity
android:name="com.lukouguoji.gjc.activity.GjcHandoverActivity"
android:configChanges="orientation|keyboardHidden"

View File

@@ -308,9 +308,14 @@ class HomeFragment : Fragment() {
ARouter.getInstance().build(ARouterConstants.ACTIVITY_URL_GJC_RECEIVE_LIST)
.navigation()
}
//复磅
//复磅(板箱过磅)
Constant.AuthName.GjcFuBangActivity -> {
ARouter.getInstance().build(ARouterConstants.ACTIVITY_URL_GJC_FU_BANG)
// TODO: 2025-11-21 旧版跳转,已改为新的列表页面
// ARouter.getInstance().build(ARouterConstants.ACTIVITY_URL_GJC_FU_BANG)
// .navigation()
// 新版板箱过磅列表页面
ARouter.getInstance().build(ARouterConstants.ACTIVITY_URL_GJC_BOX_WEIGHING)
.navigation()
}
//仓库

View File

@@ -0,0 +1,12 @@
package com.lukouguoji.module_base.bean
/**
* 国际出港板箱过磅-统计数据Bean
* 对应API: IntExpWeighting/pageQueryTotal
*/
class GjcBoxWeighingStatisticsBean {
var wbNumber: Int = 0 // 运单票数/总票数
var totalPc: Long = 0 // 总件数
var totalWeight: Double = 0.0 // 总重量
var cargoWeight: Double = 0.0 // 总货重
}

View File

@@ -0,0 +1,54 @@
package com.lukouguoji.module_base.bean
/**
* 国际出港板箱过磅-ULD使用记录Bean
* 对应API: IntExpWeighting/pageQuery
*/
class GjcUldUseBean {
var useId: Long = 0 // 使用id
var uld: String = "" // uld编号
var carId: String = "" // 板车号
var carWeight: Double = 0.0 // 板车重量
var cargoType: String = "" // 货物类型
var cargoWeight: Double = 0.0 // 货重
var netWeight: Double = 0.0 // 装机重量
var totalWeight: Double = 0.0 // 总重
var uldWeight: Double = 0.0 // uld重量
var volume: Double = 0.0 // 体积
var maxVolume: Double = 0.0 // uld最大容积
var maxWeight: Double = 0.0 // uld最大载重
var fdate: String = "" // 航班日期
var fno: String = "" // 航班号
var fdep: String = "" // 起始站
var fdest: String = "" // 目的港
var fClose: String = "" // 航班关闭时间
var wtId: String = "" // 过磅人ID
var wtUsername: String = "" // 过磅人
var wtDate: String = "" // 过磅时间
var ldId: String = "" // 组装人ID
var ldUserName: String = "" // 组装人
var ldDate: String = "" // 组装时间
var hoId: String = "" // 交接人ID
var hoUserName: String = "" // 交接人
var hoDate: String = "" // 交接时间
var boardType: String = "" // 板型
var uldCarrier: String = "" // uld所属航司
var uldFlag: String = "" // uld分类
var status: String = "" // uld状态0正常1故障
var dgrCode: String = "" // IMP代码
var height: String = "" // 高度
var passageway: String = "" // 通道号
var passagewayName: String = "" // 通道号(中文)
var piClose: String = "" // 探板/收口
var piCloseSize: String = "" // 探板尺寸(CM)
var location: String = "" // 位置
var pieces: String = "" // 件数
var remark: String = "" // 备注
var checkFlag: String = "" // 检查标记
var emptyUld: String = "" // 空ULD
}

View File

@@ -127,6 +127,9 @@ interface Constant {
// ULD
const val ULD = 10001
// 航班号
const val FLIGHT_NO = 10005
// 运单
const val WAYBILL = 10002

View File

@@ -22,9 +22,11 @@ import com.lukouguoji.module_base.bean.GbCarOrUldBean
import com.lukouguoji.module_base.bean.GjcBoxAddInsertBean
import com.lukouguoji.module_base.bean.GjcBoxAssembleBean
import com.lukouguoji.module_base.bean.GjcBoxDetailsBean
import com.lukouguoji.module_base.bean.GjcBoxWeighingStatisticsBean
import com.lukouguoji.module_base.bean.GjcGoodsAddBean
import com.lukouguoji.module_base.bean.GjcGoodsBean
import com.lukouguoji.module_base.bean.GjcGoodsDetailsBean
import com.lukouguoji.module_base.bean.GjcUldUseBean
import com.lukouguoji.module_base.bean.GjcWaybillBean
import com.lukouguoji.module_base.bean.GjcWaybillDataBean
import com.lukouguoji.module_base.bean.GjjGoodsBean
@@ -409,6 +411,34 @@ interface Api {
@POST("IntExpCheckInCheck/pageQueryTotal")
suspend fun getGjcInspectionTotal(@Body data: RequestBody): BaseResultBean<ManifestTotalDto>
/**
* 国际出港板箱过磅-分页搜索
* 接口路径: /IntExpWeighting/pageQuery
*/
@POST("IntExpWeighting/pageQuery")
suspend fun getGjcBoxWeighingList(@Body data: RequestBody): BaseListBean<GjcUldUseBean>
/**
* 国际出港板箱过磅-分页下的合计
* 接口路径: /IntExpWeighting/pageQueryTotal
*/
@POST("IntExpWeighting/pageQueryTotal")
suspend fun getGjcBoxWeighingStatistics(@Body data: RequestBody): BaseResultBean<GjcBoxWeighingStatisticsBean>
/**
* 国际出港板箱过磅-详情
* 接口路径: /IntExpWeighting/queryByUseId
*/
@GET("IntExpWeighting/queryByUseId")
suspend fun getGjcBoxWeighingDetails(@Query("useId") useId: Long): BaseResultBean<GjcUldUseBean>
/**
* 国际出港板箱过磅-提交过磅数据
* 接口路径: /IntExpWeighting/weight
*/
@POST("IntExpWeighting/weight")
suspend fun submitGjcBoxWeighing(@Body data: RequestBody): BaseResultBean<SimpleResultBean>
///////////////////////////////////////////////////////////////////////////
// 国际进-电报解析
///////////////////////////////////////////////////////////////////////////

View File

@@ -115,6 +115,9 @@ object ARouterConstants {
const val ACTIVITY_URL_GJC_START_RECEIVE = "/gjc/GjcStartReceiveActivity" //国际出港模块 开始收运
const val ACTIVITY_URL_GJC_FU_BANG = "/gjc/GjcFuBangActivity" //国际出港模块 复磅
const val ACTIVITY_URL_GJC_BOX_WEIGHING = "/gjc/GjcBoxWeighingActivity" //国际出港模块 板箱过磅
const val ACTIVITY_URL_GJC_BOX_WEIGHING_DETAILS = "/gjc/GjcBoxWeighingDetailsActivity" //国际出港模块 板箱过磅详情
const val ACTIVITY_URL_GJC_BOX_WEIGHING_ADD = "/gjc/GjcBoxWeighingAddActivity" //国际出港模块 添加过磅
const val ACTIVITY_URL_GJC_WARE_HOUSE = "/gjc/GjcWareHouseActivity" //国际出港模块 仓库
const val ACTIVITY_URL_GJC_WARE_HOUSE_INFO = "/gjc/GjcWareHouseInfoActivity" //国际出港模块 仓库详情

View File

@@ -30,7 +30,10 @@
<color name="text_system">#8A000000</color>
<color name="text_blue">#3CB5F3</color>
<color name="text_pink">#EA6BE1</color>
<color name="text_red">#d9001b</color>
<color name="text_green">#4CAF50</color>
<color name="color_bottom_layout">#5c6890</color>
<color name="color_f2">#F2F2F2</color>
</resources>

View File

@@ -0,0 +1,54 @@
package com.lukouguoji.gjc.activity
import android.content.Context
import android.content.Intent
import android.os.Bundle
import com.alibaba.android.arouter.facade.annotation.Route
import com.lukouguoji.gjc.R
import com.lukouguoji.gjc.databinding.ActivityGjcBoxWeighingBinding
import com.lukouguoji.gjc.viewModel.GjcBoxWeighingViewModel
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.getLifecycleOwner
import com.lukouguoji.module_base.router.ARouterConstants
/**
* 国际出港板箱过磅列表页
*/
@Route(path = ARouterConstants.ACTIVITY_URL_GJC_BOX_WEIGHING)
class GjcBoxWeighingActivity :
BaseBindingActivity<ActivityGjcBoxWeighingBinding, GjcBoxWeighingViewModel>() {
override fun layoutId() = R.layout.activity_gjc_box_weighing
override fun viewModelClass() = GjcBoxWeighingViewModel::class.java
override fun initOnCreate(savedInstanceState: Bundle?) {
setBackArrow("板箱过磅")
binding.viewModel = viewModel
// 绑定分页逻辑
viewModel.pageModel
.bindSmartRefreshLayout(binding.srl, binding.rv, viewModel, getLifecycleOwner())
// 监听刷新事件
FlowBus.with<String>(ConstantEvent.EVENT_REFRESH)
.observe(this) {
viewModel.refresh()
}
// 初始加载
viewModel.refresh()
}
companion object {
@JvmStatic
fun start(context: Context) {
val starter = Intent(context, GjcBoxWeighingActivity::class.java)
context.startActivity(starter)
}
}
}

View File

@@ -0,0 +1,34 @@
package com.lukouguoji.gjc.activity
import android.content.Context
import android.content.Intent
import android.os.Bundle
import com.lukouguoji.gjc.R
import com.lukouguoji.gjc.databinding.ActivityGjcBoxWeighingAddBinding
import com.lukouguoji.gjc.viewModel.GjcBoxWeighingAddViewModel
import com.lukouguoji.module_base.base.BaseBindingActivity
/**
* 国际出港板箱过磅添加页面
*/
class GjcBoxWeighingAddActivity :
BaseBindingActivity<ActivityGjcBoxWeighingAddBinding, GjcBoxWeighingAddViewModel>() {
override fun layoutId() = R.layout.activity_gjc_box_weighing_add
override fun viewModelClass() = GjcBoxWeighingAddViewModel::class.java
override fun initOnCreate(savedInstanceState: Bundle?) {
setBackArrow("板箱过磅")
binding.viewModel = viewModel
viewModel.initOnCreated(this)
}
companion object {
@JvmStatic
fun startForAdd(context: Context) {
val starter = Intent(context, GjcBoxWeighingAddActivity::class.java)
context.startActivity(starter)
}
}
}

View File

@@ -0,0 +1,42 @@
package com.lukouguoji.gjc.activity
import android.content.Context
import android.content.Intent
import android.os.Bundle
import com.alibaba.android.arouter.facade.annotation.Route
import com.lukouguoji.gjc.R
import com.lukouguoji.gjc.databinding.ActivityGjcBoxWeighingDetailsBinding
import com.lukouguoji.gjc.viewModel.GjcBoxWeighingDetailsViewModel
import com.lukouguoji.module_base.base.BaseBindingActivity
import com.lukouguoji.module_base.common.Constant
import com.lukouguoji.module_base.router.ARouterConstants
/**
* 国际出港板箱过磅详情页
*/
@Route(path = ARouterConstants.ACTIVITY_URL_GJC_BOX_WEIGHING_DETAILS)
class GjcBoxWeighingDetailsActivity :
BaseBindingActivity<ActivityGjcBoxWeighingDetailsBinding, GjcBoxWeighingDetailsViewModel>() {
override fun layoutId() = R.layout.activity_gjc_box_weighing_details
override fun viewModelClass() = GjcBoxWeighingDetailsViewModel::class.java
override fun initOnCreate(savedInstanceState: Bundle?) {
setBackArrow("板箱过磅详情")
binding.viewModel = viewModel
// 初始化数据从Intent获取参数
viewModel.initOnCreated(intent)
}
companion object {
@JvmStatic
fun start(context: Context, useId: Long) {
val starter = Intent(context, GjcBoxWeighingDetailsActivity::class.java)
.putExtra(Constant.Key.ID, useId)
context.startActivity(starter)
}
}
}

View File

@@ -0,0 +1,24 @@
package com.lukouguoji.gjc.holder
import android.view.View
import com.lukouguoji.gjc.activity.GjcBoxWeighingDetailsActivity
import com.lukouguoji.gjc.databinding.ItemGjcBoxWeighingBinding
import com.lukouguoji.module_base.base.BaseViewHolder
import com.lukouguoji.module_base.bean.GjcUldUseBean
/**
* 国际出港板箱过磅列表 ViewHolder
*/
class GjcBoxWeighingViewHolder(view: View) :
BaseViewHolder<GjcUldUseBean, ItemGjcBoxWeighingBinding>(view) {
override fun onBind(item: Any?, position: Int) {
val bean = getItemBean(item)!!
binding.bean = bean
// 整行点击跳转到详情页
binding.ll.setOnClickListener {
GjcBoxWeighingDetailsActivity.start(it.context, bean.useId)
}
}
}

View File

@@ -0,0 +1,235 @@
package com.lukouguoji.gjc.viewModel
import android.app.Activity
import android.content.Intent
import android.view.View
import androidx.lifecycle.LifecycleOwner
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.viewModelScope
import com.lukouguoji.module_base.base.BaseViewModel
import com.lukouguoji.module_base.bean.GjcUldUseBean
import com.lukouguoji.module_base.common.Constant
import com.lukouguoji.module_base.common.ConstantEvent
import com.lukouguoji.module_base.http.net.DiBangWeightModel
import com.lukouguoji.module_base.http.net.NetApply
import com.lukouguoji.module_base.impl.FlowBus
import com.lukouguoji.module_base.ktx.formatDate
import com.lukouguoji.module_base.ktx.getActivity
import com.lukouguoji.module_base.ktx.launchLoadingCollect
import com.lukouguoji.module_base.ktx.noNull
import com.lukouguoji.module_base.ktx.showToast
import com.lukouguoji.module_base.ktx.toRequestBody
import com.lukouguoji.module_base.ktx.verifyNullOrEmpty
import com.lukouguoji.module_base.model.ScanModel
import com.lukouguoji.module_base.util.Common
import com.lukouguoji.module_base.util.DictUtils
import dev.utils.app.info.KeyValue
import kotlinx.coroutines.launch
import java.util.Calendar
import java.util.Date
/**
* 国际出港板箱过磅添加 ViewModel
*/
class GjcBoxWeighingAddViewModel : BaseViewModel() {
// 数据Bean
val dataBean = MutableLiveData(GjcUldUseBean())
// 地磅集成 - 暂时注释
// val diBangModel = DiBangWeightModel()
val channel = MutableLiveData("") // 通道号用于控制地磅key
// 计算字段显示
val totalWeight = MutableLiveData("0") // 总重(红色)
val netWeight = MutableLiveData("0") // 装机重(蓝色)
val cargoWeight = MutableLiveData("0") // 货重(绿色)
// 下拉选择数据源
val passagewayList = MutableLiveData<List<KeyValue>>() // 通道号列表
val piCloseList = MutableLiveData<List<KeyValue>>() // 探板收口列表
// 打印挂签
val printTag = MutableLiveData(false)
/**
* 初始化
*/
fun initOnCreated(activity: Activity) {
// 监听地磅重量变化 - 暂时注释
// diBangModel.weight.observe(activity as LifecycleOwner) { weight ->
// val w = weight?.toDoubleOrNull() ?: 0.0
// totalWeight.value = w.toString()
// dataBean.value?.totalWeight = w
// // 实时计算装机重和货重
// calculateWeights()
// }
// 监听通道号变化设置地磅的key - 暂时注释
// channel.observe(activity as LifecycleOwner) {
// diBangModel.key = it ?: ""
// }
// 加载下拉列表数据
loadPassagewayList()
loadPiCloseList()
// 初始化航班日期为今天
dataBean.value?.fdate = Date().formatDate()
}
/**
* 加载通道号列表
*/
private fun loadPassagewayList() {
DictUtils.getChannelList {
passagewayList.value = it
}
}
/**
* 加载探板收口列表
*/
private fun loadPiCloseList() {
// 探板收口选项(是/否)
piCloseList.value = listOf(
KeyValue("1", ""),
KeyValue("0", "")
)
}
/**
* 计算重量字段
* 装机重 = 总重 - 架子车自重
* 货重 = 装机重 - ULD自重
*/
private fun calculateWeights() {
val total = totalWeight.value?.toDoubleOrNull() ?: 0.0
val carW = dataBean.value?.carWeight ?: 0.0
val uldW = dataBean.value?.uldWeight ?: 0.0
val net = total - carW
val cargo = net - uldW
netWeight.value = if (net > 0) net.toString() else "0"
cargoWeight.value = if (cargo > 0) cargo.toString() else "0"
dataBean.value?.netWeight = if (net > 0) net else 0.0
dataBean.value?.cargoWeight = if (cargo > 0) cargo else 0.0
}
/**
* 航班日期点击
*/
fun flightDateClick(view: View) {
Common.onYearMonthDay(view.context.getActivity(), dataBean.value?.fdate) { year, month, day ->
val calendar = Calendar.getInstance()
calendar.set(year, month - 1, day)
val date = calendar.time.formatDate()
dataBean.value = dataBean.value?.apply { fdate = date }
}
}
/**
* ULD编号扫码
*/
fun uldScanClick() {
ScanModel.startScan(getTopActivity(), Constant.RequestCode.ULD)
}
/**
* 架子车号扫码
*/
fun carIdScanClick() {
ScanModel.startScan(getTopActivity(), Constant.RequestCode.CAR)
}
/**
* 重置按钮点击
*/
fun resetClick() {
dataBean.value = GjcUldUseBean().apply {
fdate = Date().formatDate()
}
totalWeight.value = "0"
netWeight.value = "0"
cargoWeight.value = "0"
channel.value = ""
printTag.value = false
}
/**
* 确定按钮点击
*/
fun confirmClick() {
val bean = dataBean.value ?: return
// 验证必填字段
if (bean.carId.verifyNullOrEmpty("请输入架子车号")) return
if (bean.uld.verifyNullOrEmpty("请输入ULD编号")) return
// 提交数据
val params = mapOf(
"carId" to bean.carId,
"passageway" to bean.passageway,
"uld" to bean.uld,
"dgrCode" to bean.dgrCode,
"boardType" to bean.boardType,
"height" to bean.height,
"piClose" to bean.piClose,
"piCloseSize" to bean.piCloseSize,
"carWeight" to bean.carWeight,
"uldWeight" to bean.uldWeight,
"fdate" to bean.fdate,
"fno" to bean.fno,
"fdest" to bean.fdest,
"remark" to bean.remark,
"totalWeight" to bean.totalWeight,
"netWeight" to bean.netWeight,
"cargoWeight" to bean.cargoWeight,
"printTag" to printTag.value
).toRequestBody(removeEmptyOrNull = true)
launchLoadingCollect({
NetApply.api.submitGjcBoxWeighing(params)
}) {
onSuccess = { result ->
if (result.verifySuccess()) {
showToast("添加成功")
// 发送刷新事件
viewModelScope.launch {
FlowBus.with<String>(ConstantEvent.EVENT_REFRESH).emit("refresh")
}
getTopActivity().finish()
} else {
showToast(result.msg.noNull("添加失败"))
}
}
}
}
/**
* 处理扫码结果
*/
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
if (resultCode == Activity.RESULT_OK && data != null) {
val content = data.getStringExtra(Constant.Result.CODED_CONTENT).noNull()
when (requestCode) {
Constant.RequestCode.ULD -> {
dataBean.value = dataBean.value?.apply { uld = content }
}
Constant.RequestCode.CAR -> {
dataBean.value = dataBean.value?.apply { carId = content }
}
}
}
}
/**
* 清理资源
*/
override fun onCleared() {
super.onCleared()
// diBangModel.cancelLooperGet() // 暂时注释
}
}

View File

@@ -0,0 +1,48 @@
package com.lukouguoji.gjc.viewModel
import android.content.Intent
import androidx.lifecycle.MutableLiveData
import com.lukouguoji.module_base.base.BaseViewModel
import com.lukouguoji.module_base.bean.GjcUldUseBean
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
/**
* 国际出港板箱过磅详情 ViewModel
*/
class GjcBoxWeighingDetailsViewModel : BaseViewModel() {
// 主键ID从Intent接收
var useId: Long = 0
// 详情数据
val dataBean = MutableLiveData(GjcUldUseBean())
/**
* 初始化数据
*/
fun initOnCreated(intent: Intent) {
useId = intent.getLongExtra(Constant.Key.ID, 0)
if (useId > 0) {
getData()
} else {
showToast("参数错误")
getTopActivity().finish()
}
}
/**
* 获取详情数据
*/
private fun getData() {
launchLoadingCollect({
NetApply.api.getGjcBoxWeighingDetails(useId)
}) {
onSuccess = {
dataBean.value = it.data ?: GjcUldUseBean()
}
}
}
}

View File

@@ -0,0 +1,152 @@
package com.lukouguoji.gjc.viewModel
import android.app.Activity
import android.content.Intent
import androidx.lifecycle.MutableLiveData
import com.lukouguoji.gjc.R
import com.lukouguoji.gjc.holder.GjcBoxWeighingViewHolder
import com.lukouguoji.module_base.base.BasePageViewModel
import com.lukouguoji.module_base.common.Constant
import com.lukouguoji.module_base.http.net.NetApply
import com.lukouguoji.module_base.ktx.launchCollect
import com.lukouguoji.module_base.ktx.launchLoadingCollect
import com.lukouguoji.module_base.ktx.toRequestBody
import com.lukouguoji.module_base.model.ScanModel
/**
* 国际出港板箱过磅 ViewModel
*/
class GjcBoxWeighingViewModel : BasePageViewModel() {
// 搜索条件
val flightDate = MutableLiveData("") // 航班日期
val flightNo = MutableLiveData("") // 航班号
val dest = MutableLiveData("") // 目的站
val carId = MutableLiveData("") // 架子车号
val uld = MutableLiveData("") // ULD编号
// 适配器配置
val itemViewHolder = GjcBoxWeighingViewHolder::class.java
val itemLayoutId = R.layout.item_gjc_box_weighing
// 统计数据
val totalCount = MutableLiveData("0") // 合计票数
val totalPc = MutableLiveData("0") // 总件数
val totalWeight = MutableLiveData("0") // 总重量
val cargoWeight = MutableLiveData("0") // 总货重
///////////////////////////////////////////////////////////////////////////
// 方法区
///////////////////////////////////////////////////////////////////////////
/**
* 扫码输入航班号
*/
fun flightNoScanClick() {
ScanModel.startScan(getTopActivity(), Constant.RequestCode.FLIGHT_NO)
}
/**
* 扫码输入架子车号
*/
fun carIdScanClick() {
ScanModel.startScan(getTopActivity(), Constant.RequestCode.CAR)
}
/**
* 扫码输入ULD编号
*/
fun uldScanClick() {
ScanModel.startScan(getTopActivity(), Constant.RequestCode.ULD)
}
/**
* 搜索按钮点击
*/
fun searchClick() {
refresh()
}
/**
* 添加按钮点击
*/
fun addClick() {
com.lukouguoji.gjc.activity.GjcBoxWeighingAddActivity.startForAdd(getTopActivity())
}
/**
* 挂签打印按钮点击
*/
fun printClick() {
// TODO: 实现挂签打印功能
}
/**
* 获取列表数据
*/
override fun getData() {
// 构建查询参数(列表接口)
val listParams = mapOf(
"pageNum" to pageModel.page,
"pageSize" to pageModel.limit,
"fdate" to flightDate.value!!.ifEmpty { null },
"fno" to flightNo.value!!.ifEmpty { null },
"fdest" to dest.value!!.ifEmpty { null },
"carId" to carId.value!!.ifEmpty { null },
"uld" to uld.value!!.ifEmpty { null },
).toRequestBody()
// 构建查询参数(统计接口 - 使用相同的搜索条件)
val totalParams = mapOf(
"fdate" to flightDate.value!!.ifEmpty { null },
"fno" to flightNo.value!!.ifEmpty { null },
"fdest" to dest.value!!.ifEmpty { null },
"carId" to carId.value!!.ifEmpty { null },
"uld" to uld.value!!.ifEmpty { null },
).toRequestBody()
// 获取列表数据显示loading
launchLoadingCollect({
NetApply.api.getGjcBoxWeighingList(listParams)
}) {
onSuccess = {
pageModel.handleListBean(it)
}
}
// 获取统计数据后台调用不显示loading
launchCollect({
NetApply.api.getGjcBoxWeighingStatistics(totalParams)
}) {
onSuccess = { result ->
val data = result.data
totalCount.value = (data?.wbNumber ?: 0).toString()
totalPc.value = (data?.totalPc ?: 0).toString()
totalWeight.value = (data?.totalWeight ?: 0.0).toString()
cargoWeight.value = (data?.cargoWeight ?: 0.0).toString()
}
}
}
/**
* 处理扫码结果
*/
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
if (resultCode == Activity.RESULT_OK && data != null) {
when (requestCode) {
Constant.RequestCode.FLIGHT_NO -> {
flightNo.value = data.getStringExtra(Constant.Result.CODED_CONTENT)
refresh()
}
Constant.RequestCode.CAR -> {
carId.value = data.getStringExtra(Constant.Result.CODED_CONTENT)
refresh()
}
Constant.RequestCode.ULD -> {
uld.value = data.getStringExtra(Constant.Result.CODED_CONTENT)
refresh()
}
}
}
}
}

View File

@@ -0,0 +1,193 @@
<?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"
xmlns:tools="http://schemas.android.com/tools">
<data>
<import type="com.lukouguoji.module_base.ui.weight.search.layout.SearchLayoutType" />
<variable
name="viewModel"
type="com.lukouguoji.gjc.viewModel.GjcBoxWeighingViewModel" />
</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" />
<!-- 搜索区域 -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="10dp"
android:layout_marginTop="10dp"
android:gravity="center_vertical"
android:orientation="horizontal">
<!-- 航班日期 -->
<com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
hint='@{"请选择航班日期"}'
icon="@{@drawable/img_date}"
type="@{SearchLayoutType.DATE}"
value="@={viewModel.flightDate}" />
<!-- 航班号 -->
<com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
hint='@{"请输入航班号"}'
icon="@{@drawable/img_scan}"
setOnIconClickListener="@{()-> viewModel.flightNoScanClick()}"
type="@{SearchLayoutType.INPUT}"
value="@={viewModel.flightNo}" />
<!-- 目的站 -->
<com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
hint='@{"请输入目的站"}'
type="@{SearchLayoutType.INPUT}"
value="@={viewModel.dest}" />
<!-- 架子车号 -->
<com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
hint='@{"请输入架子车号"}'
icon="@{@drawable/img_scan}"
setOnIconClickListener="@{()-> viewModel.carIdScanClick()}"
type="@{SearchLayoutType.INPUT}"
value="@={viewModel.carId}" />
<!-- ULD编号 -->
<com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
hint='@{"请输入ULD编号"}'
icon="@{@drawable/img_scan}"
setOnIconClickListener="@{()-> viewModel.uldScanClick()}"
type="@{SearchLayoutType.INPUT}"
value="@={viewModel.uld}" />
<!-- 搜索按钮 -->
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center">
<ImageView
style="@style/iv_search_action"
android:onClick="@{()-> viewModel.searchClick()}"
android:src="@drawable/img_search" />
<!-- 添加按钮 -->
<ImageView
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_marginLeft="10dp"
android:onClick="@{()-> viewModel.addClick()}"
android:padding="5dp"
android:src="@drawable/img_add" />
</LinearLayout>
</LinearLayout>
<!-- 列表 -->
<com.scwang.smart.refresh.layout.SmartRefreshLayout
android:id="@+id/srl"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv"
android:layout_width="match_parent"
android:layout_height="match_parent"
itemLayoutId="@{viewModel.itemLayoutId}"
viewHolder="@{viewModel.itemViewHolder}"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
tools:listitem="@layout/item_gjc_box_weighing" />
</com.scwang.smart.refresh.layout.SmartRefreshLayout>
<!-- 底部统计和打印按钮 -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:background="@color/color_bottom_layout"
android:gravity="center_vertical"
android:paddingHorizontal="15dp">
<!-- 统计信息 -->
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text='@{"合计:"+viewModel.totalCount+"票"}'
android:textColor="@color/white"
android:textSize="18sp"
android:textStyle="bold"
tools:text="合计1票" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:text='@{"总件数:"+viewModel.totalPc}'
android:textColor="@color/white"
android:textSize="18sp"
android:textStyle="bold"
tools:text="总件数100" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:text='@{"总重量:"+viewModel.totalWeight}'
android:textColor="@color/white"
android:textSize="18sp"
android:textStyle="bold"
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/white"
android:textSize="18sp"
android:textStyle="bold"
tools:text="总货重150" />
</LinearLayout>
<!-- 挂签打印按钮 -->
<TextView
style="@style/tv_bottom_btn"
android:onClick="@{()-> viewModel.printClick()}"
android:text="挂签打印" />
</LinearLayout>
</LinearLayout>
</layout>

View File

@@ -0,0 +1,396 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<data>
<import type="com.lukouguoji.module_base.ui.weight.data.layout.DataLayoutType" />
<variable
name="viewModel"
type="com.lukouguoji.gjc.viewModel.GjcBoxWeighingAddViewModel" />
</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" />
<!-- 主内容区域 -->
<ScrollView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:padding="15dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/bg_white_radius_8"
android:orientation="vertical"
android:padding="20dp">
<!-- 第一部分前2行表单左侧2列+ 地磅称重(右侧) -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<!-- 左侧前2行表单2列 -->
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="2"
android:orientation="vertical">
<!-- 第1行架子车号、通道号 -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
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.INPUT}"
value='@={viewModel.dataBean.carId}' />
<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"
title='@{"通道号:"}'
titleLength="@{4}"
type="@{DataLayoutType.INPUT}"
value='@={viewModel.channel}' />
</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"
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"
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_height="match_parent"
android:background="@drawable/bg_shouyun_dbzl"
android:minHeight="120dp"
android:padding="20dp">
<TextView
android:id="@+id/tvWeight"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:text="@{viewModel.totalWeight}"
android:textColor="@color/text_red"
android:textSize="50sp"
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/black"
android:textSize="20sp" />
</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.PadDataLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
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"
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"
title='@{"探板收口:"}'
titleLength="@{5}"
type="@{DataLayoutType.INPUT}"
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"
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"
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"
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"
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"
title='@{"备注:"}'
titleLength="@{3}"
type="@{DataLayoutType.INPUT}"
value='@={viewModel.dataBean.remark}' />
<Space
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_weight="1" />
</LinearLayout>
</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

@@ -0,0 +1,265 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<data>
<import type="com.lukouguoji.module_base.ui.weight.data.layout.DataLayoutType" />
<variable
name="viewModel"
type="com.lukouguoji.gjc.viewModel.GjcBoxWeighingDetailsViewModel" />
</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" />
<!-- 内容区域 -->
<ScrollView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:padding="10dp">
<!-- 白色圆角卡片 -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/bg_white_radius_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.PadDataLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
enable="@{false}"
title='@{"架子车号"}'
titleLength="@{5}"
type="@{DataLayoutType.INPUT}"
value='@{viewModel.dataBean.carId}' />
<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="@{4}"
type="@{DataLayoutType.INPUT}"
value='@{viewModel.dataBean.passagewayName}' />
<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="@{3}"
type="@{DataLayoutType.INPUT}"
value='@{String.valueOf(viewModel.dataBean.totalWeight)}' />
</LinearLayout>
<!-- 第2行ULD编号、IMP代码、装机重 -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
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='@{"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_weight="1"
enable="@{false}"
title='@{"IMP代码"}'
titleLength="@{6}"
type="@{DataLayoutType.INPUT}"
value='@{viewModel.dataBean.dgrCode}' />
<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="@{4}"
type="@{DataLayoutType.INPUT}"
value='@{String.valueOf(viewModel.dataBean.netWeight)}' />
</LinearLayout>
<!-- 第3行板型、高度、货重 -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
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="@{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_weight="1"
enable="@{false}"
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_weight="1"
enable="@{false}"
title='@{"货重"}'
titleLength="@{3}"
type="@{DataLayoutType.INPUT}"
value='@{String.valueOf(viewModel.dataBean.cargoWeight)}' />
</LinearLayout>
<!-- 第4行探板收口、探板尺寸、ULD自重 -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
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="@{5}"
type="@{DataLayoutType.INPUT}"
value='@{viewModel.dataBean.piClose}' />
<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="@{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_weight="1"
enable="@{false}"
title='@{"ULD自重"}'
titleLength="@{6}"
type="@{DataLayoutType.INPUT}"
value='@{String.valueOf(viewModel.dataBean.uldWeight)}' />
</LinearLayout>
<!-- 第5行航班日期、目的港、架子车自重 -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
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="@{5}"
type="@{DataLayoutType.INPUT}"
value='@{viewModel.dataBean.fdate}' />
<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="@{4}"
type="@{DataLayoutType.INPUT}"
value='@{viewModel.dataBean.fdest}' />
<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)}' />
</LinearLayout>
<!-- 第6行件数、备注 -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
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="@{3}"
type="@{DataLayoutType.INPUT}"
value='@{viewModel.dataBean.remark}' />
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="2"
enable="@{false}"
title='@{"备注"}'
titleLength="@{3}"
type="@{DataLayoutType.INPUT}"
value='@{viewModel.dataBean.remark}' />
</LinearLayout>
</LinearLayout>
</ScrollView>
</LinearLayout>
</layout>

View File

@@ -0,0 +1,274 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<data>
<variable
name="bean"
type="com.lukouguoji.module_base.bean.GjcUldUseBean" />
</data>
<androidx.appcompat.widget.LinearLayoutCompat
android:id="@+id/ll"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="15dp"
android:layout_marginVertical="5dp"
android:background="@drawable/bg_item"
android:orientation="horizontal"
android:padding="10dp">
<!-- 飞机图标 -->
<ImageView
android:id="@+id/iv_icon"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_gravity="center"
android:src="@drawable/img_plane" />
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_marginLeft="10dp"
android:orientation="vertical">
<!-- 第一行数据 -->
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="wrap_content">
<!-- ULD编号 -->
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1.2"
android:gravity="center_vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
completeSpace="@{6}"
android:text="ULD编号" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@{bean.uld}"
android:textColor="@color/colorPrimary"
tools:text="PMC12345MU" />
</androidx.appcompat.widget.LinearLayoutCompat>
<!-- 架子车号 -->
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center_vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
completeSpace="@{5}"
android:text="架子车号:" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text='@{bean.carId}'
tools:text="527" />
</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="@{4}"
android:text="总重:" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@{String.valueOf(bean.totalWeight)}"
tools:text="200" />
</androidx.appcompat.widget.LinearLayoutCompat>
<!-- 装机重量 -->
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center_vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
completeSpace="@{5}"
android:text="装机重量:" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text='@{String.valueOf(bean.netWeight)}'
tools:text="150" />
</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="@{4}"
android:text="货重:" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text='@{String.valueOf(bean.cargoWeight)}'
tools:text="150" />
</androidx.appcompat.widget.LinearLayoutCompat>
</androidx.appcompat.widget.LinearLayoutCompat>
<!-- 第二行数据 -->
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp">
<!-- 航班日期 -->
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1.2"
android:gravity="center_vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
completeSpace="@{5}"
android:text="航班日期:" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@{bean.fdate}"
tools:text="2025-09-05" />
</androidx.appcompat.widget.LinearLayoutCompat>
<!-- 航班号 -->
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center_vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
completeSpace="@{4}"
android:text="航班号:" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text='@{bean.fno}'
tools:text="MU2023" />
</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="@{4}"
android:text="目的港:" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@{bean.fdest}"
tools:text="PEK" />
</androidx.appcompat.widget.LinearLayoutCompat>
<!-- 过磅人 -->
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center_vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
completeSpace="@{4}"
android:text="过磅人:" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text='@{bean.wtUsername}'
tools:text="张三" />
</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}"
android:text="过磅时间:" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text='@{bean.wtDate}'
tools:text="2024-01-15 14:27:12" />
</androidx.appcompat.widget.LinearLayoutCompat>
</androidx.appcompat.widget.LinearLayoutCompat>
</LinearLayout>
<!-- 右侧箭头 -->
<ImageView
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_gravity="center"
android:src="@drawable/img_pda_right"
android:layout_marginLeft="10dp" />
</androidx.appcompat.widget.LinearLayoutCompat>
</layout>

11
nohup.out Normal file
View File

@@ -0,0 +1,11 @@
/opt/homebrew/Cellar/scrcpy/3.3.3/share/scrcpy/scrcpy-server: 1 file pushed, 0 skipped. 171.0 MB/s (90164 bytes in 0.001s)
[server] INFO: Device: [CENAVA] CENAVA A80ST (Android 10)
[server] WARN: Audio disabled: it is not supported before Android 11
WARN: Demuxer 'audio': stream explicitly disabled by the device
2025-11-21 13:21:03.514 scrcpy[46548:5077376] TSM AdjustCapsLockLEDForKeyTransitionHandling - _ISSetPhysicalKeyboardCapsLockLED Inhibit
WARN: Device disconnected
scrcpy 3.3.3 <https://github.com/Genymobile/scrcpy>
INFO: ADB device found:
INFO: --> (usb) 80STHZCHDLL4311422 device A80ST
INFO: Renderer: metal
INFO: Texture: 1280x800