feat: 进港舱单 新增/编辑

This commit is contained in:
2025-12-29 18:20:36 +08:00
parent fc4912acee
commit ca35757864
8 changed files with 843 additions and 827 deletions

View File

@@ -1,6 +1,7 @@
package com.lukouguoji.module_base.bean package com.lukouguoji.module_base.bean
import androidx.databinding.ObservableBoolean import androidx.databinding.ObservableBoolean
import java.io.Serializable
/** /**
* 国际进港舱单Bean * 国际进港舱单Bean
@@ -54,8 +55,9 @@ data class GjjManifest(
var subCode: String = "", // 子代码 var subCode: String = "", // 子代码
var unNumber: String = "", // 危险品编号 var unNumber: String = "", // 危险品编号
var activeId: Long = 0 // 活动ID var activeId: Long = 0 // 活动ID
) { ) : Serializable {
// 选中状态(用于多选功能) // 选中状态(用于多选功能)- 不参与序列化
@Transient
val checked: ObservableBoolean = ObservableBoolean(false) val checked: ObservableBoolean = ObservableBoolean(false)
// 兼容现有API的isSelected属性 // 兼容现有API的isSelected属性

View File

@@ -370,6 +370,9 @@ interface Constant {
// 运单主键ID // 运单主键ID
const val MAWB_ID = "maWbId" const val MAWB_ID = "maWbId"
// 舱单ID
const val MF_ID = "MF_ID"
// 运单前缀 // 运单前缀
const val PREFIX = "prefix" const val PREFIX = "prefix"

View File

@@ -9,6 +9,7 @@ import com.lukouguoji.gjj.databinding.ActivityGjjManifestAddBinding
import com.lukouguoji.gjj.viewModel.GjjManifestAddViewModel import com.lukouguoji.gjj.viewModel.GjjManifestAddViewModel
import com.lukouguoji.module_base.base.BaseBindingActivity import com.lukouguoji.module_base.base.BaseBindingActivity
import com.lukouguoji.module_base.common.Constant import com.lukouguoji.module_base.common.Constant
import com.lukouguoji.module_base.common.DetailsPageType
import com.lukouguoji.module_base.ktx.noNull import com.lukouguoji.module_base.ktx.noNull
class GjjManifestAddActivity : class GjjManifestAddActivity :
@@ -19,21 +20,40 @@ class GjjManifestAddActivity :
override fun viewModelClass() = GjjManifestAddViewModel::class.java override fun viewModelClass() = GjjManifestAddViewModel::class.java
override fun initOnCreate(savedInstanceState: Bundle?) { override fun initOnCreate(savedInstanceState: Bundle?) {
setBackArrow("国际进港舱单新增") // 动态设置标题
viewModel.fid = intent.getStringExtra(Constant.Key.ID).noNull() val title = when {
viewModel.departure.value = intent.getStringExtra(Constant.Key.DEPARTURE).noNull() viewModel.pageType.value == DetailsPageType.Modify -> "国际进港舱单编辑"
viewModel.destination.value = intent.getStringExtra(Constant.Key.DESTINATION).noNull() else -> "国际进港舱单新增"
}
setBackArrow(title)
binding.viewModel = viewModel binding.viewModel = viewModel
viewModel.initOnCreated(intent)
} }
companion object { companion object {
/**
* 新增舱单
*/
@JvmStatic @JvmStatic
fun start(context: Context, fid: String = "", dep: String, dest: String) { fun start(context: Context, fid: String = "", dep: String, dest: String) {
val starter = Intent(context, GjjManifestAddActivity::class.java) val starter = Intent(context, GjjManifestAddActivity::class.java)
.putExtra(Constant.Key.PAGE_TYPE, DetailsPageType.Add.name)
.putExtra(Constant.Key.ID, fid) .putExtra(Constant.Key.ID, fid)
.putExtra(Constant.Key.DEPARTURE, dep) .putExtra(Constant.Key.DEPARTURE, dep)
.putExtra(Constant.Key.DESTINATION, dest) .putExtra(Constant.Key.DESTINATION, dest)
context.startActivity(starter) context.startActivity(starter)
} }
/**
* 编辑舱单通过Bean对象
*/
@JvmStatic
fun startForEdit(context: Context, bean: com.lukouguoji.module_base.bean.GjjManifest) {
val starter = Intent(context, GjjManifestAddActivity::class.java)
.putExtra(Constant.Key.PAGE_TYPE, DetailsPageType.Modify.name)
.putExtra(Constant.Key.BEAN, bean)
context.startActivity(starter)
}
} }
} }

View File

@@ -17,10 +17,20 @@ class IntImpManifestViewHolder(view: View) :
binding.position = position binding.position = position
binding.executePendingBindings() binding.executePendingBindings()
// 添加图标点击事件 - 切换选择状态 // 选中图标点击 - 切换选择状态
binding.ivIcon.setOnClickListener { binding.ivIcon.setOnClickListener {
bean.checked.set(!bean.checked.get()) bean.checked.set(!bean.checked.get())
binding.executePendingBindings() binding.executePendingBindings()
} }
// 编辑按钮点击
binding.btnEdit.setOnClickListener {
clickListener?.onItemClick(position, 101) // 101=编辑
}
// 删除按钮点击
binding.btnDelete.setOnClickListener {
clickListener?.onItemClick(position, 102) // 102=删除
}
} }
} }

View File

@@ -1,26 +1,52 @@
package com.lukouguoji.gjj.viewModel package com.lukouguoji.gjj.viewModel
import android.content.Intent
import android.view.View import android.view.View
import androidx.lifecycle.MutableLiveData import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.viewModelScope
import com.lukouguoji.module_base.base.BaseViewModel import com.lukouguoji.module_base.base.BaseViewModel
import com.lukouguoji.module_base.common.Constant
import com.lukouguoji.module_base.common.ConstantEvent
import com.lukouguoji.module_base.common.DetailsPageType
import com.lukouguoji.module_base.http.net.NetApply import com.lukouguoji.module_base.http.net.NetApply
import com.lukouguoji.module_base.impl.FlowBus
import com.lukouguoji.module_base.ktx.finish import com.lukouguoji.module_base.ktx.finish
import com.lukouguoji.module_base.ktx.launchCollect import com.lukouguoji.module_base.ktx.launchCollect
import com.lukouguoji.module_base.ktx.launchLoadingCollect
import com.lukouguoji.module_base.ktx.noNull import com.lukouguoji.module_base.ktx.noNull
import com.lukouguoji.module_base.ktx.showToast import com.lukouguoji.module_base.ktx.showToast
import com.lukouguoji.module_base.ktx.toRequestBody import com.lukouguoji.module_base.ktx.toRequestBody
import com.lukouguoji.module_base.ktx.verifyNullOrEmpty import com.lukouguoji.module_base.ktx.verifyNullOrEmpty
import com.lukouguoji.module_base.util.DictUtils import com.lukouguoji.module_base.util.DictUtils
import dev.utils.app.info.KeyValue import dev.utils.app.info.KeyValue
import kotlinx.coroutines.launch
class GjjManifestAddViewModel : BaseViewModel() { class GjjManifestAddViewModel : BaseViewModel() {
// 页面类型必须用LiveData
val pageType = MutableLiveData(DetailsPageType.Add)
// 舱单ID编辑时使用
var mfId: Long = 0
// 航班ID // 航班ID
var fid: String = "" var fid: String = ""
// 航班日期
val flightDate = MutableLiveData("")
// 航班号
val flightNo = MutableLiveData("")
// 航程
val range = MutableLiveData("")
// 运单号 // 运单号
val waybillNo = MutableLiveData("") val waybillNo = MutableLiveData("")
// UN编号
val unNumber = MutableLiveData("")
// 运单件数 // 运单件数
val waybillNum = MutableLiveData("") val waybillNum = MutableLiveData("")
@@ -51,27 +77,27 @@ class GjjManifestAddViewModel : BaseViewModel() {
// 业务类型 列表 // 业务类型 列表
val businessTypeList = MutableLiveData<List<KeyValue>>() val businessTypeList = MutableLiveData<List<KeyValue>>()
private var businessType = "" val businessType = MutableLiveData("")
// 包装类型 列表 // 包装类型 列表
val packageTypeList = MutableLiveData<List<KeyValue>>() val packageTypeList = MutableLiveData<List<KeyValue>>()
private var packageType = "" val packageType = MutableLiveData("")
// 代理列表 // 代理列表
val agentList = MutableLiveData<List<KeyValue>>() val agentList = MutableLiveData<List<KeyValue>>()
private var agent = "" val agent = MutableLiveData("")
// 特码列表 // 特码列表
val specialCodeList = MutableLiveData<List<KeyValue>>() val specialCodeList = MutableLiveData<List<KeyValue>>()
private var specialCode = "" val specialCode = MutableLiveData("")
// 货物类型 // 货物类型
val goodsTypeList = MutableLiveData<List<KeyValue>>() val goodsTypeList = MutableLiveData<List<KeyValue>>()
private var goodsType = "" val goodsType = MutableLiveData("")
// 运单类型 // 运单类型
val waybillTypeList = MutableLiveData<List<KeyValue>>() val waybillTypeList = MutableLiveData<List<KeyValue>>()
private var waybillType = "" val waybillType = MutableLiveData("")
init { init {
DictUtils.getAgentList(addAll = false) { DictUtils.getAgentList(addAll = false) {
@@ -105,45 +131,56 @@ class GjjManifestAddViewModel : BaseViewModel() {
} }
/** /**
* 代理点击 * 初始化从Intent获取参数
*/ */
fun onAgentSelected(position: Int) { fun initOnCreated(intent: Intent) {
agent = agentList.value?.get(position)?.value.noNull() // 获取页面类型
pageType.value = DetailsPageType.valueOf(
intent.getStringExtra(Constant.Key.PAGE_TYPE) ?: DetailsPageType.Add.name
)
// 获取航班ID
fid = intent.getStringExtra(Constant.Key.ID).noNull()
departure.value = intent.getStringExtra(Constant.Key.DEPARTURE).noNull()
destination.value = intent.getStringExtra(Constant.Key.DESTINATION).noNull()
// 编辑模式从Bean对象加载数据
if (pageType.value == DetailsPageType.Modify) {
val bean = intent.getSerializableExtra(Constant.Key.BEAN) as? com.lukouguoji.module_base.bean.GjjManifest
if (bean != null) {
loadManifestFromBean(bean)
}
}
} }
/** /**
* 特码点击 * 从Bean对象加载数据编辑模式
*/ */
fun onSpecialCodeSelected(position: Int) { private fun loadManifestFromBean(manifest: com.lukouguoji.module_base.bean.GjjManifest) {
specialCode = specialCodeList.value?.get(position)?.value.noNull() // 保存舱单ID
} mfId = manifest.mfId
fid = manifest.fid.toString()
/** // 填充表单字段
* 包装类型点击 waybillNo.value = manifest.wbNo
*/ waybillNum.value = manifest.totalPc.toString()
fun onPackageTypeSelected(position: Int) { actualNum.value = manifest.pc.toString()
packageType = packageTypeList.value?.get(position)?.value.noNull() actualWeight.value = manifest.weight.toString()
} billingWeight.value = manifest.cashWeight.toString()
departure.value = manifest.origin
destination.value = manifest.dest
goodsNameCn.value = manifest.goodsCn
goodsNameEn.value = manifest.goods
unNumber.value = manifest.unNumber
remark.value = manifest.remark
/** // 设置下拉框选中值
* 业务类型点击 agent.value = manifest.agentCode
*/ specialCode.value = manifest.spCode
fun onBusinessTypeSelected(position: Int) { packageType.value = manifest.packageType
businessType = businessTypeList.value?.get(position)?.value.noNull() businessType.value = manifest.businessType
} goodsType.value = manifest.cargoType
waybillType.value = manifest.awbType
/**
* 货物类型点击
*/
fun onGoodsTypeSelected(position: Int) {
goodsType = goodsTypeList.value?.get(position)?.value.noNull()
}
/**
* 运单类型点击
*/
fun onWaybillTypeSelected(position: Int) {
waybillType = waybillTypeList.value?.get(position)?.value.noNull()
} }
/** /**
@@ -151,53 +188,62 @@ class GjjManifestAddViewModel : BaseViewModel() {
*/ */
fun onSaveClick(view: View) { fun onSaveClick(view: View) {
if ((waybillNo.value.verifyNullOrEmpty("请输入运单号") if ((waybillNo.value.verifyNullOrEmpty("请输入运单号")
|| agent.verifyNullOrEmpty("请选择代理") || agent.value.verifyNullOrEmpty("请选择代理")
|| waybillNum.value.verifyNullOrEmpty("请输入运单件数") || waybillNum.value.verifyNullOrEmpty("请输入运单件数")
|| actualNum.value.verifyNullOrEmpty("请输入实到数量") || actualNum.value.verifyNullOrEmpty("请输入实到数量")
|| goodsNameEn.value.verifyNullOrEmpty("请输入品名(英)") || goodsNameEn.value.verifyNullOrEmpty("请输入品名(英)")
|| actualWeight.value.verifyNullOrEmpty("请输入实到重量") || actualWeight.value.verifyNullOrEmpty("请输入实到重量")
|| packageType.verifyNullOrEmpty("请选择包装类型") || packageType.value.verifyNullOrEmpty("请选择包装类型")
) )
) { ) {
return return
} }
showLoading()
launchCollect({ val params = mapOf(
NetApply.api.gjjManifestInsert( "mfId" to if (pageType.value == DetailsPageType.Modify) mfId else null,
mapOf( "fid" to fid,
"fid" to fid, "wbNo" to waybillNo.value,
"wbNo" to waybillNo.value, "agent" to agent.value,
"agent" to agent, "spCode" to specialCode.value,
"spCode" to specialCode, "businessType" to businessType.value,
"businessType" to businessType, "awbpc" to waybillNum.value,
"awbpc" to waybillNum.value, "pc" to actualNum.value,
"pc" to actualNum.value, "weight" to actualWeight.value,
"weight" to actualWeight.value, "planweight" to billingWeight.value,
"planweight" to billingWeight.value, "packagecode" to packageType.value,
"packagecode" to packageType, "dep" to departure.value,
"dep" to departure.value, "origin" to departure.value,
"origin" to departure.value, "dest" to destination.value,
"dest" to destination.value, "goods" to goodsNameEn.value,
"goods" to goodsNameEn.value, "goodsCn" to goodsNameCn.value,
"goodsCn" to goodsNameCn.value, "awbType" to waybillType.value,
"awbType" to waybillType, "cargoType" to goodsType.value,
"cargoType" to goodsType, "unNumber" to unNumber.value,
"remark" to remark.value, "remark" to remark.value,
).toRequestBody() ).toRequestBody(removeEmptyOrNull = true)
)
launchLoadingCollect({
if (pageType.value == DetailsPageType.Modify) {
NetApply.api.gjjManifestUpdate(params)
} else {
NetApply.api.gjjManifestInsert(params)
}
}) { }) {
onSuccess = { onSuccess = {
if (it.verifySuccess()) { if (it.verifySuccess()) {
showToast("保存成功") val successMsg = if (pageType.value == DetailsPageType.Modify) "修改成功" else "保存成功"
showToast(successMsg)
// 发送刷新事件
viewModelScope.launch {
FlowBus.with<String>(ConstantEvent.EVENT_REFRESH).emit("refresh")
}
view.context.finish() view.context.finish()
} else { } else {
showToast(it.msg.noNull("保存失败")) showToast(it.msg.noNull("保存失败"))
} }
} }
onComplete = {
dismissLoading()
}
} }
} }

View File

@@ -1,9 +1,11 @@
package com.lukouguoji.gjj.viewModel package com.lukouguoji.gjj.viewModel
import android.app.Activity import android.app.Activity
import androidx.appcompat.app.AlertDialog
import androidx.lifecycle.MutableLiveData import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.viewModelScope import androidx.lifecycle.viewModelScope
import com.lukouguoji.gjj.R import com.lukouguoji.gjj.R
import com.lukouguoji.gjj.activity.GjjManifestAddActivity
import com.lukouguoji.gjj.holder.IntImpManifestViewHolder import com.lukouguoji.gjj.holder.IntImpManifestViewHolder
import com.lukouguoji.module_base.base.BasePageViewModel import com.lukouguoji.module_base.base.BasePageViewModel
import com.lukouguoji.module_base.bean.GjjManifest import com.lukouguoji.module_base.bean.GjjManifest
@@ -14,6 +16,7 @@ import com.lukouguoji.module_base.impl.FlowBus
import com.lukouguoji.module_base.ktx.commonAdapter import com.lukouguoji.module_base.ktx.commonAdapter
import com.lukouguoji.module_base.ktx.launchCollect 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.noNull
import com.lukouguoji.module_base.ktx.showToast import com.lukouguoji.module_base.ktx.showToast
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
@@ -83,11 +86,73 @@ class IntImpManifestViewModel : BasePageViewModel() {
* 新增按钮点击 * 新增按钮点击
*/ */
fun onAddClick() { fun onAddClick() {
showToast("新增功能开发中") // 获取当前航班信息
val fid = getCurrentFlightId()
GjjManifestAddActivity.start(
context = getTopActivity(),
fid = fid,
dep = fdep.value ?: "",
dest = "" // 目的站暂时留空
)
} }
/** /**
* 删除按钮点击 * 获取当前航班ID从列表第一项获取
*/
private fun getCurrentFlightId(): String {
val firstItem = pageModel.rv?.commonAdapter()?.items?.firstOrNull() as? GjjManifest
return firstItem?.fid?.toString() ?: ""
}
/**
* Item点击处理侧滑按钮
*/
override fun onItemClick(position: Int, type: Int) {
val bean = pageModel.rv?.commonAdapter()?.getItem(position) as? GjjManifest ?: return
when (type) {
101 -> {
// 编辑传递整个Bean对象
GjjManifestAddActivity.startForEdit(getTopActivity(), bean)
}
102 -> {
// 删除
deleteManifest(bean)
}
}
}
/**
* 删除单个舱单
*/
private fun deleteManifest(bean: GjjManifest) {
AlertDialog.Builder(getTopActivity())
.setTitle("提示")
.setMessage("确定要删除运单号 ${bean.getWaybillNo()} 的舱单吗?")
.setPositiveButton("确定") { _, _ ->
val params = mapOf("mfId" to bean.mfId).toRequestBody()
launchLoadingCollect({ NetApply.api.gjjManifestDelete(params) }) {
onSuccess = {
if (it.verifySuccess()) {
showToast("删除成功")
viewModelScope.launch {
FlowBus.with<String>(ConstantEvent.EVENT_REFRESH).emit("refresh")
}
refresh()
} else {
showToast(it.msg.noNull("删除失败"))
}
}
}
}
.setNegativeButton("取消", null)
.show()
}
/**
* 批量删除按钮点击
*/ */
fun onDeleteClick() { fun onDeleteClick() {
val list = pageModel.rv?.commonAdapter()?.items as? List<GjjManifest> ?: return val list = pageModel.rv?.commonAdapter()?.items as? List<GjjManifest> ?: return

View File

@@ -1,532 +1,373 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android" <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"> xmlns:tools="http://schemas.android.com/tools">
<data> <data>
<import type="com.lukouguoji.module_base.ui.weight.data.layout.DataLayoutType" />
<import type="com.lukouguoji.module_base.common.DetailsPageType" />
<variable <variable
name="viewModel" name="viewModel"
type="com.lukouguoji.gjj.viewModel.GjjManifestAddViewModel" /> type="com.lukouguoji.gjj.viewModel.GjjManifestAddViewModel" />
</data> </data>
<androidx.appcompat.widget.LinearLayoutCompat <FrameLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="@color/color_f2" android:background="@color/color_f2">
android:orientation="vertical"
tools:context=".activity.GjjManifestDetailsActivity">
<RelativeLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="50dp"> android:layout_height="match_parent"
android:orientation="vertical">
<include layout="@layout/title_tool_bar" /> <include layout="@layout/title_tool_bar" />
</RelativeLayout> <!-- 主内容区域 -->
<ScrollView
<androidx.appcompat.widget.LinearLayoutCompat android:layout_width="match_parent"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="30dp"
android:layout_marginRight="15dp">
<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="15dp"
android:layout_height="wrap_content"
android:gravity="center"
android:text="*"
android:textColor="@color/red" />
<TextView
style="@style/tv_manifest_details_label"
android:text="运单号:" />
<EditText
style="@style/tv_manifest_details_value"
android:inputType="number"
android:maxLength="11"
android:text="@={viewModel.waybillNo}" />
</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="15dp"
android:layout_height="wrap_content"
android:gravity="center"
android:text="*"
android:textColor="@color/red" />
<TextView
style="@style/tv_manifest_details_label"
android:text="代理:" />
<LinearLayout style="@style/tv_manifest_details_value">
<androidx.appcompat.widget.AppCompatSpinner
items="@{viewModel.agentList}"
onSelected="@{viewModel::onAgentSelected}"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
</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="15dp"
android:layout_height="wrap_content"
android:gravity="center"
android:text="*"
android:textColor="@color/red" />
<TextView
style="@style/tv_manifest_details_label"
android:text="特码:" />
<LinearLayout style="@style/tv_manifest_details_value">
<androidx.appcompat.widget.AppCompatSpinner
items="@{viewModel.specialCodeList}"
onSelected="@{viewModel::onSpecialCodeSelected}"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
</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="30dp"
android:layout_marginRight="15dp">
<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="15dp"
android:layout_height="wrap_content"
android:gravity="center"
android:text="*"
android:textColor="@color/red" />
<TextView
style="@style/tv_manifest_details_label"
android:text="业务类型:" />
<LinearLayout style="@style/tv_manifest_details_value">
<androidx.appcompat.widget.AppCompatSpinner
items="@{viewModel.businessTypeList}"
onSelected="@{viewModel::onBusinessTypeSelected}"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
</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="15dp"
android:layout_height="wrap_content"
android:gravity="center"
android:text="*"
android:textColor="@color/red" />
<TextView
style="@style/tv_manifest_details_label"
android:text="货物类型:" />
<LinearLayout style="@style/tv_manifest_details_value">
<androidx.appcompat.widget.AppCompatSpinner
items="@{viewModel.goodsTypeList}"
onSelected="@{viewModel::onGoodsTypeSelected}"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
</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="15dp"
android:layout_height="wrap_content"
android:gravity="center"
android:text="*"
android:textColor="@color/red" />
<TextView
style="@style/tv_manifest_details_label"
android:text="运单类型:" />
<LinearLayout style="@style/tv_manifest_details_value">
<androidx.appcompat.widget.AppCompatSpinner
items="@{viewModel.waybillTypeList}"
onSelected="@{viewModel::onWaybillTypeSelected}"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
</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="30dp"
android:layout_marginRight="15dp">
<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="15dp"
android:layout_height="wrap_content"
android:gravity="center"
android:text="*"
android:textColor="@color/red" />
<TextView
style="@style/tv_manifest_details_label"
android:text="运单件数:" />
<EditText
style="@style/tv_manifest_details_value"
android:inputType="number"
android:text="@={viewModel.waybillNum}" />
</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="15dp"
android:layout_height="wrap_content"
android:gravity="center"
android:text="*"
android:textColor="@color/red" />
<TextView
style="@style/tv_manifest_details_label"
android:text="实到件数:" />
<EditText
style="@style/tv_manifest_details_value"
android:inputType="number"
android:text="@={viewModel.actualNum}" />
</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="15dp"
android:layout_height="wrap_content"
android:gravity="center"
android:text="*"
android:textColor="@color/red" />
<TextView
style="@style/tv_manifest_details_label"
android:text="实到重量:" />
<EditText
style="@style/tv_manifest_details_value"
android:inputType="numberDecimal"
android:text="@={viewModel.actualWeight}" />
</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"
android:visibility="gone">
<TextView
android:layout_width="15dp"
android:layout_height="wrap_content"
android:gravity="center"
android:text="*"
android:textColor="@color/red" />
<TextView
style="@style/tv_manifest_details_label"
android:text="计费重量:" />
<EditText
style="@style/tv_manifest_details_value"
android:inputType="numberDecimal"
android:text="@{viewModel.billingWeight}" />
</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="30dp"
android:layout_marginRight="15dp">
<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="15dp"
android:layout_height="wrap_content"
android:gravity="center"
android:text="*"
android:textColor="@color/red" />
<TextView
style="@style/tv_manifest_details_label"
android:text="包装类型:" />
<LinearLayout style="@style/tv_manifest_details_value">
<androidx.appcompat.widget.AppCompatSpinner
items="@{viewModel.packageTypeList}"
onSelected="@{viewModel::onPackageTypeSelected}"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
</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="15dp"
android:layout_height="wrap_content"
android:gravity="center"
android:text="*"
android:textColor="@color/red"
android:visibility="invisible" />
<TextView
style="@style/tv_manifest_details_label"
android:text="始发港:" />
<EditText
style="@style/tv_manifest_details_value"
android:enabled="false"
android:text="@={viewModel.departure}" />
</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="15dp"
android:layout_height="wrap_content"
android:gravity="center"
android:text="*"
android:textColor="@color/red"
android:visibility="invisible" />
<TextView
style="@style/tv_manifest_details_label"
android:text="目的港:" />
<EditText
style="@style/tv_manifest_details_value"
android:enabled="false"
android:text="@={viewModel.destination}" />
</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="30dp"
android:layout_marginRight="15dp">
<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="15dp"
android:layout_height="wrap_content"
android:gravity="center"
android:text="*"
android:textColor="@color/red" />
<TextView
style="@style/tv_manifest_details_label"
android:text="品名(英)" />
<EditText
style="@style/tv_manifest_details_value"
android:text="@={viewModel.goodsNameEn}" />
</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"
android:visibility="invisible">
<TextView
android:layout_width="15dp"
android:layout_height="wrap_content"
android:gravity="center"
android:text="*"
android:textColor="@color/red" />
<TextView
style="@style/tv_manifest_details_label"
android:text="品名(中)" />
<EditText
style="@style/tv_manifest_details_value"
android:text="@={viewModel.goodsNameCn}" />
</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">
</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="30dp"
android:layout_marginRight="15dp">
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="2"
android:gravity="center_vertical">
<TextView
android:layout_width="15dp"
android:layout_height="wrap_content"
android:gravity="center"
android:text="*"
android:textColor="@color/red"
android:visibility="invisible" />
<TextView
style="@style/tv_manifest_details_label"
android:text="备注:" />
<EditText
style="@style/tv_manifest_details_value"
android:text="@={viewModel.remark}" />
</androidx.appcompat.widget.LinearLayoutCompat>
<View
android:layout_width="0dp"
android:layout_height="0dp" android:layout_height="0dp"
android:layout_weight="1" /> android:layout_weight="1">
</androidx.appcompat.widget.LinearLayoutCompat> <LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="15dp">
<View <LinearLayout
android:layout_width="0dp" android:layout_width="match_parent"
android:layout_height="0dp" android:layout_height="wrap_content"
android:layout_weight="1" /> android:background="@drawable/bg_white_radius_8"
android:orientation="vertical"
android:padding="8dp">
<androidx.appcompat.widget.LinearLayoutCompat <!-- 第1行航班日期、航班号、航程全部禁止编辑 -->
android:layout_width="match_parent" <LinearLayout
android:layout_height="50dp" android:layout_width="match_parent"
android:background="#5c6890" android:layout_height="wrap_content"
android:gravity="end" android:orientation="horizontal">
android:paddingHorizontal="15dp">
<TextView <com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
style="@style/tv_bottom_btn" enable="@{false}"
android:onClick="@{viewModel::onCancelClick}" hint='@{"请选择航班日期"}'
android:text="取消" /> required="@{false}"
title='@{"航班日期"}'
titleLength="@{5}"
type="@{DataLayoutType.DATE}"
value='@={viewModel.flightDate}'
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
<TextView <com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
style="@style/tv_bottom_btn" enable="@{false}"
android:onClick="@{viewModel::onSaveClick}" hint='@{"请输入航班号"}'
android:text="保存" /> required="@{false}"
title='@{"航 班 号"}'
titleLength="@{5}"
type="@{DataLayoutType.INPUT}"
value='@={viewModel.flightNo}'
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="15dp"
android:layout_weight="1" />
</androidx.appcompat.widget.LinearLayoutCompat> <com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
enable="@{false}"
hint='@{"请输入航程"}'
required="@{false}"
title='@{"航 程"}'
titleLength="@{5}"
type="@{DataLayoutType.INPUT}"
value='@={viewModel.range}'
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="15dp"
android:layout_weight="1" />
</androidx.appcompat.widget.LinearLayoutCompat> </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
enable="@{false}"
hint='@{"请输入运单号"}'
required="@{false}"
title='@{"运 单 号"}'
titleLength="@{5}"
type="@{DataLayoutType.INPUT}"
value='@={viewModel.waybillNo}'
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
hint='@{"请选择代理"}'
list="@{viewModel.agentList}"
required="@{false}"
title='@{"代 理"}'
titleLength="@{5}"
type="@{DataLayoutType.SPINNER}"
value='@={viewModel.agent}'
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="15dp"
android:layout_weight="1" />
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
hint='@{"请选择特码"}'
list="@{viewModel.specialCodeList}"
required="@{false}"
title='@{"特 码"}'
titleLength="@{5}"
type="@{DataLayoutType.SPINNER}"
value='@={viewModel.specialCode}'
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="15dp"
android:layout_weight="1" />
</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
hint='@{"请输入始发站"}'
required="@{false}"
title='@{"始 发 站"}'
titleLength="@{5}"
type="@{DataLayoutType.INPUT}"
value='@={viewModel.departure}'
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
hint='@{"请输入目的站"}'
required="@{false}"
title='@{"目 的 站"}'
titleLength="@{5}"
type="@{DataLayoutType.INPUT}"
value='@={viewModel.destination}'
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="15dp"
android:layout_weight="1" />
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
hint='@{"请选择运单类型"}'
list="@{viewModel.waybillTypeList}"
required="@{false}"
title='@{"运单类型"}'
titleLength="@{5}"
type="@{DataLayoutType.SPINNER}"
value='@={viewModel.waybillType}'
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="15dp"
android:layout_weight="1" />
</LinearLayout>
<!-- 第4行总件数、实到件数、实到重量 -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:orientation="horizontal">
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
hint='@{"请输入总件数"}'
required="@{false}"
title='@{"总 件 数"}'
titleLength="@{5}"
type="@{DataLayoutType.INPUT}"
value='@={viewModel.waybillNum}'
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
hint='@{"请输入实到件数"}'
required="@{false}"
title='@{"实到件数"}'
titleLength="@{5}"
type="@{DataLayoutType.INPUT}"
value='@={viewModel.actualNum}'
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="15dp"
android:layout_weight="1" />
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
hint='@{"请输入实到重量"}'
required="@{false}"
title='@{"实到重量"}'
titleLength="@{5}"
type="@{DataLayoutType.INPUT}"
value='@={viewModel.actualWeight}'
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="15dp"
android:layout_weight="1" />
</LinearLayout>
<!-- 第5行计费重量、品名(中)、品名(英) -->
<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
hint='@{"请输入计费重量"}'
required="@{false}"
title='@{"计费重量"}'
titleLength="@{5}"
type="@{DataLayoutType.INPUT}"
value='@={viewModel.billingWeight}'
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
hint='@{"请输入品名(中)"}'
required="@{false}"
title='@{"品名(中)"}'
titleLength="@{5}"
type="@{DataLayoutType.INPUT}"
value='@={viewModel.goodsNameCn}'
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="15dp"
android:layout_weight="1" />
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
hint='@{"请输入品名(英)"}'
required="@{false}"
title='@{"品名(英)"}'
titleLength="@{5}"
type="@{DataLayoutType.INPUT}"
value='@={viewModel.goodsNameEn}'
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="15dp"
android:layout_weight="1" />
</LinearLayout>
<!-- 第6行包装类型、业务类型、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
hint='@{"请选择包装类型"}'
list="@{viewModel.packageTypeList}"
required="@{false}"
title='@{"包装类型"}'
titleLength="@{5}"
type="@{DataLayoutType.SPINNER}"
value='@={viewModel.packageType}'
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
hint='@{"请选择业务类型"}'
list="@{viewModel.businessTypeList}"
required="@{false}"
title='@{"业务类型"}'
titleLength="@{5}"
type="@{DataLayoutType.SPINNER}"
value='@={viewModel.businessType}'
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="15dp"
android:layout_weight="1" />
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
hint='@{"请输入UN编号"}'
required="@{false}"
title='@{"UN 编 号"}'
titleLength="@{5}"
type="@{DataLayoutType.INPUT}"
value='@={viewModel.unNumber}'
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="15dp"
android:layout_weight="1" />
</LinearLayout>
<!-- 第7行备注占满整行 -->
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
hint='@{"请输入备注"}'
inputHeight="@{80}"
required="@{false}"
title='@{"备 注"}'
titleLength="@{5}"
type="@{DataLayoutType.INPUT}"
value='@={viewModel.remark}'
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp" />
</LinearLayout>
<!-- 底部操作栏 -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="horizontal"
android:padding="15dp">
<TextView
android:layout_width="150dp"
android:layout_height="50dp"
android:layout_marginEnd="30dp"
android:background="@drawable/bg_primary_radius_4"
android:gravity="center"
android:onClick="@{viewModel::onCancelClick}"
android:text="取消"
android:textColor="@color/white"
android:textSize="18sp" />
<TextView
android:layout_width="150dp"
android:layout_height="50dp"
android:background="@drawable/bg_primary_radius_4"
android:gravity="center"
android:onClick="@{viewModel::onSaveClick}"
android:text="保存"
android:textColor="@color/white"
android:textSize="18sp" />
</LinearLayout>
</LinearLayout>
</ScrollView>
</LinearLayout>
</FrameLayout>
</layout> </layout>

View File

@@ -15,145 +15,41 @@
type="Integer" /> type="Integer" />
</data> </data>
<LinearLayout <com.mcxtzhang.swipemenulib.SwipeMenuLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginBottom="10dp" android:layout_marginBottom="10dp">
android:background="@drawable/bg_white_radius_8"
android:orientation="horizontal"
android:padding="15dp"
android:gravity="center_vertical">
<!-- 选中图标(飞机图标,根据选择状态切换图片) --> <!-- 主内容区 -->
<ImageView
android:id="@+id/iv_icon"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_gravity="center"
loadImage="@{bean.checked.get() ? @drawable/img_plane_s : @drawable/img_plane}"
android:src="@drawable/img_plane" />
<!-- 舱单信息区域 -->
<LinearLayout <LinearLayout
android:layout_width="0dp" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="15dp" android:background="@drawable/bg_white_radius_8"
android:layout_weight="1" android:orientation="horizontal"
android:orientation="vertical"> android:padding="15dp"
android:gravity="center_vertical">
<!-- 第一行:运单号 --> <!-- 选中图标(飞机图标,根据选择状态切换图片) -->
<ImageView
android:id="@+id/iv_icon"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_gravity="center"
loadImage="@{bean.checked.get() ? @drawable/img_plane_s : @drawable/img_plane}"
android:src="@drawable/img_plane" />
<!-- 舱单信息区域 -->
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:gravity="center_vertical" android:layout_marginLeft="15dp"
android:orientation="horizontal"> android:layout_weight="1"
android:orientation="vertical">
<TextView <!-- 第一行:运单号 -->
android:layout_width="wrap_content"
android:layout_height="wrap_content"
completeSpace="@{5}"
android:text="运单号:"
android:textColor="@color/text_normal"
android:textSize="16sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@{bean.getWaybillNo()}"
android:textColor="@color/colorPrimary"
android:textSize="18sp"
android:textStyle="bold" />
</LinearLayout>
<!-- 第二行:始发站、目的站、总件数、实到件数 -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:gravity="center_vertical"
android:orientation="horizontal">
<!-- 始发站 -->
<LinearLayout <LinearLayout
android:layout_width="0dp" android:layout_width="match_parent"
android:layout_height="wrap_content" 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"
completeSpace="@{4}"
android:text="始发站:"
android:textColor="@color/text_normal"
android:textSize="16sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@{bean.origin}"
android:textColor="@color/text_normal"
android:textSize="16sp" />
</LinearLayout>
<!-- 目的站 -->
<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"
completeSpace="@{4}"
android:text="目的站:"
android:textColor="@color/text_normal"
android:textSize="16sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@{bean.dest}"
android:textColor="@color/text_normal"
android:textSize="16sp" />
</LinearLayout>
<!-- 总件数 -->
<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"
completeSpace="@{4}"
android:text="总件数:"
android:textColor="@color/text_normal"
android:textSize="16sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@{String.valueOf(bean.totalPc)}"
android:textColor="@color/text_normal"
android:textSize="16sp" />
</LinearLayout>
<!-- 实到件数 -->
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center_vertical" android:gravity="center_vertical"
android:orientation="horizontal"> android:orientation="horizontal">
@@ -161,161 +57,272 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
completeSpace="@{5}" completeSpace="@{5}"
android:text="实到件数" android:text="运单号"
android:textColor="@color/text_normal" android:textColor="@color/text_normal"
android:textSize="16sp" /> android:textSize="16sp" />
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@{String.valueOf(bean.pc)}" android:text="@{bean.getWaybillNo()}"
android:textColor="@color/text_normal" android:textColor="@color/colorPrimary"
android:textSize="16sp" /> android:textSize="18sp"
android:textStyle="bold" />
</LinearLayout> </LinearLayout>
</LinearLayout> <!-- 第二行:始发站、目的站、总件数、实到件数 -->
<!-- 第三行:实到重量、计费重量、代理、特码、分单数 -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:gravity="center_vertical"
android:orientation="horizontal">
<!-- 实到重量 -->
<LinearLayout <LinearLayout
android:layout_width="0dp" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_marginTop="10dp"
android:gravity="center_vertical" android:gravity="center_vertical"
android:orientation="horizontal"> android:orientation="horizontal">
<TextView <!-- 始发站 -->
android:layout_width="wrap_content" <LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
completeSpace="@{5}" android:layout_weight="1"
android:text="实到重量:" android:gravity="center_vertical"
android:textColor="@color/text_normal" android:orientation="horizontal">
android:textSize="16sp" />
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content"
completeSpace="@{4}"
android:text="始发站:"
android:textColor="@color/text_normal"
android:textSize="16sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@{bean.origin}"
android:textColor="@color/text_normal"
android:textSize="16sp" />
</LinearLayout>
<!-- 目的站 -->
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@{String.valueOf((int)bean.weight)}" android:layout_weight="1"
android:textColor="@color/text_normal" android:gravity="center_vertical"
android:textSize="16sp" /> android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
completeSpace="@{4}"
android:text="目的站:"
android:textColor="@color/text_normal"
android:textSize="16sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@{bean.dest}"
android:textColor="@color/text_normal"
android:textSize="16sp" />
</LinearLayout>
<!-- 总件数 -->
<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"
completeSpace="@{4}"
android:text="总件数:"
android:textColor="@color/text_normal"
android:textSize="16sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@{String.valueOf(bean.totalPc)}"
android:textColor="@color/text_normal"
android:textSize="16sp" />
</LinearLayout>
<!-- 实到件数 -->
<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"
completeSpace="@{5}"
android:text="实到件数:"
android:textColor="@color/text_normal"
android:textSize="16sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@{String.valueOf(bean.pc)}"
android:textColor="@color/text_normal"
android:textSize="16sp" />
</LinearLayout>
</LinearLayout> </LinearLayout>
<!-- 计费重量 --> <!-- 第三行:实到重量、计费重量、代理、特码、分单数 -->
<LinearLayout <LinearLayout
android:layout_width="0dp" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_marginTop="10dp"
android:gravity="center_vertical" android:gravity="center_vertical"
android:orientation="horizontal"> android:orientation="horizontal">
<TextView <!-- 实到重量 -->
android:layout_width="wrap_content" <LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
completeSpace="@{5}" android:layout_weight="1"
android:text="计费重量:" android:gravity="center_vertical"
android:textColor="@color/text_normal" android:orientation="horizontal">
android:textSize="16sp" />
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content"
completeSpace="@{5}"
android:text="实到重量:"
android:textColor="@color/text_normal"
android:textSize="16sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@{String.valueOf((int)bean.weight)}"
android:textColor="@color/text_normal"
android:textSize="16sp" />
</LinearLayout>
<!-- 计费重量 -->
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@{String.valueOf((int)bean.cashWeight)}" android:layout_weight="1"
android:textColor="@color/text_normal" android:gravity="center_vertical"
android:textSize="16sp" /> android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
completeSpace="@{5}"
android:text="计费重量:"
android:textColor="@color/text_normal"
android:textSize="16sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@{String.valueOf((int)bean.cashWeight)}"
android:textColor="@color/text_normal"
android:textSize="16sp" />
</LinearLayout>
<!-- 代理 -->
<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"
completeSpace="@{3}"
android:text="代理:"
android:textColor="@color/text_normal"
android:textSize="16sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@{bean.agentCode}"
android:textColor="@color/text_normal"
android:textSize="16sp" />
</LinearLayout>
<!-- 特码 -->
<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"
completeSpace="@{3}"
android:text="特码:"
android:textColor="@color/text_normal"
android:textSize="16sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@{bean.spCode}"
android:textColor="@color/text_normal"
android:textSize="16sp" />
</LinearLayout>
</LinearLayout> </LinearLayout>
<!-- 代理 --> <!-- 第四行:分单数 -->
<LinearLayout <LinearLayout
android:layout_width="0dp" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_marginTop="10dp"
android:gravity="center_vertical" android:gravity="center_vertical"
android:orientation="horizontal"> android:orientation="horizontal">
<TextView <!-- 分单数 -->
android:layout_width="wrap_content" <LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
completeSpace="@{3}" android:layout_weight="1"
android:text="代理:" android:gravity="center_vertical"
android:textColor="@color/text_normal" android:orientation="horizontal">
android:textSize="16sp" />
<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.agentCode}" completeSpace="@{4}"
android:textColor="@color/text_normal" android:text="分单数:"
android:textSize="16sp" /> android:textColor="@color/text_normal"
android:textSize="16sp" />
</LinearLayout> <TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@{String.valueOf(bean.haWbNum)}"
android:textColor="@color/text_normal"
android:textSize="16sp" />
<!-- 特码 --> </LinearLayout>
<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"
completeSpace="@{3}"
android:text="特码:"
android:textColor="@color/text_normal"
android:textSize="16sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@{bean.spCode}"
android:textColor="@color/text_normal"
android:textSize="16sp" />
</LinearLayout>
</LinearLayout>
<!-- 第四行:分单数 -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:gravity="center_vertical"
android:orientation="horizontal">
<!-- 分单数 -->
<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"
completeSpace="@{4}"
android:text="分单数:"
android:textColor="@color/text_normal"
android:textSize="16sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@{String.valueOf(bean.haWbNum)}"
android:textColor="@color/text_normal"
android:textSize="16sp" />
</LinearLayout> </LinearLayout>
@@ -323,6 +330,28 @@
</LinearLayout> </LinearLayout>
</LinearLayout> <!-- 侧滑菜单区 -->
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:orientation="horizontal">
<!-- 编辑按钮 -->
<TextView
android:id="@+id/btnEdit"
style="@style/tv_item_action"
android:background="@color/colorPrimary"
android:text="编辑" />
<!-- 删除按钮 -->
<TextView
android:id="@+id/btnDelete"
style="@style/tv_item_action"
android:background="@color/red"
android:text="删除" />
</LinearLayout>
</com.mcxtzhang.swipemenulib.SwipeMenuLayout>
</layout> </layout>