Compare commits
7 Commits
2f3ae2a814
...
13c9c6f5dc
| Author | SHA1 | Date | |
|---|---|---|---|
| 13c9c6f5dc | |||
| de62b903d4 | |||
| 2d42ce9cc3 | |||
| 861ce8ca1e | |||
| f312ef866c | |||
| 6f27c15d9a | |||
| ded57554fa |
@@ -79,6 +79,7 @@ data class GjcMaWb(
|
|||||||
// ==================== 状态信息 ====================
|
// ==================== 状态信息 ====================
|
||||||
var checkIn: String? = null, // 收运状态。0:待收运,1:已收运,2:收运中
|
var checkIn: String? = null, // 收运状态。0:待收运,1:已收运,2:收运中
|
||||||
var declareStatus: String? = null, // 申报状态
|
var declareStatus: String? = null, // 申报状态
|
||||||
|
var cmdStatus: String? = null, // 海关放行(命令状态)
|
||||||
var reviewStatus: String? = null, // 审核状态(0:未审核;1:通过;2:退回)
|
var reviewStatus: String? = null, // 审核状态(0:未审核;1:通过;2:退回)
|
||||||
var tranFlag: String? = null, // 转运标志
|
var tranFlag: String? = null, // 转运标志
|
||||||
var clearNormal: String? = null, // 清仓正常(0:否,1:是)
|
var clearNormal: String? = null, // 清仓正常(0:否,1:是)
|
||||||
|
|||||||
@@ -60,6 +60,7 @@ data class GjjManifest(
|
|||||||
var unNumber: String = "", // 危险品编号
|
var unNumber: String = "", // 危险品编号
|
||||||
var activeId: Long = 0, // 活动ID
|
var activeId: Long = 0, // 活动ID
|
||||||
var locationTally: String = "", // 理货库位号
|
var locationTally: String = "", // 理货库位号
|
||||||
|
var locationTallyId: Long = 0, // 理货库位ID
|
||||||
var pic: String = "", // 交接图片缩略图路径
|
var pic: String = "", // 交接图片缩略图路径
|
||||||
var originalPic: String = "", // 交接图片原图地址
|
var originalPic: String = "", // 交接图片原图地址
|
||||||
var picNumber: String = "" // 交接图片数量
|
var picNumber: String = "" // 交接图片数量
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ class GjcAssembleWeightEditActivity :
|
|||||||
override fun viewModelClass() = GjcAssembleWeightEditViewModel::class.java
|
override fun viewModelClass() = GjcAssembleWeightEditViewModel::class.java
|
||||||
|
|
||||||
override fun initOnCreate(savedInstanceState: Bundle?) {
|
override fun initOnCreate(savedInstanceState: Bundle?) {
|
||||||
setBackArrow("国际出港修改组装重量")
|
setBackArrow("国际出港重量回填")
|
||||||
|
|
||||||
binding.viewModel = viewModel
|
binding.viewModel = viewModel
|
||||||
|
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ class GjcQueryActivity :
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 航班号:大写字母+数字
|
// 航班号:大写字母+数字
|
||||||
binding.filterPanel.filterFlightNo.et.setUpperCaseAlphanumericFilter()
|
binding.flightNoSearch.et.setUpperCaseAlphanumericFilter()
|
||||||
// 目的港:仅大写字母
|
// 目的港:仅大写字母
|
||||||
binding.filterPanel.filterDest.et.setUpperCaseLetterFilter()
|
binding.filterPanel.filterDest.et.setUpperCaseLetterFilter()
|
||||||
|
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ class GjcAssembleWeightEditViewModel : BaseViewModel() {
|
|||||||
val totalPc = MutableLiveData("") // 总件数
|
val totalPc = MutableLiveData("") // 总件数
|
||||||
val totalWeight = MutableLiveData("") // 总重量
|
val totalWeight = MutableLiveData("") // 总重量
|
||||||
val cargoWeight = MutableLiveData("") // 货重
|
val cargoWeight = MutableLiveData("") // 货重
|
||||||
|
val consumeWeight = MutableLiveData("") // 耗材重量
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
// 底部统计字段
|
// 底部统计字段
|
||||||
@@ -74,6 +75,7 @@ class GjcAssembleWeightEditViewModel : BaseViewModel() {
|
|||||||
totalPc.value = it.pc.toString()
|
totalPc.value = it.pc.toString()
|
||||||
totalWeight.value = it.totalWeight.toString()
|
totalWeight.value = it.totalWeight.toString()
|
||||||
cargoWeight.value = it.cargoWeight.toString()
|
cargoWeight.value = it.cargoWeight.toString()
|
||||||
|
consumeWeight.value = it.consumeWeight.toString()
|
||||||
|
|
||||||
// 保存参数用于API调用
|
// 保存参数用于API调用
|
||||||
useId = it.useId
|
useId = it.useId
|
||||||
|
|||||||
@@ -51,6 +51,7 @@ class GjcBoxWeighingAddViewModel : BaseViewModel() {
|
|||||||
val totalWeight = MutableLiveData("0") // 总重(红色)
|
val totalWeight = MutableLiveData("0") // 总重(红色)
|
||||||
val netWeight = MutableLiveData("0") // 装机重(蓝色)
|
val netWeight = MutableLiveData("0") // 装机重(蓝色)
|
||||||
val cargoWeight = MutableLiveData("0") // 货重(绿色)
|
val cargoWeight = MutableLiveData("0") // 货重(绿色)
|
||||||
|
val consumeWeight = MutableLiveData("0") // 耗材重量(只读,随 ULD 记录带出)
|
||||||
|
|
||||||
// 需要自动查询的独立字段(用于监听输入变化)
|
// 需要自动查询的独立字段(用于监听输入变化)
|
||||||
val carId = MutableLiveData("") // 架子车号
|
val carId = MutableLiveData("") // 架子车号
|
||||||
@@ -138,6 +139,7 @@ class GjcBoxWeighingAddViewModel : BaseViewModel() {
|
|||||||
totalWeight.value = bean.totalWeight.toString()
|
totalWeight.value = bean.totalWeight.toString()
|
||||||
netWeight.value = bean.netWeight.toString()
|
netWeight.value = bean.netWeight.toString()
|
||||||
cargoWeight.value = bean.cargoWeight.toString()
|
cargoWeight.value = bean.cargoWeight.toString()
|
||||||
|
consumeWeight.value = bean.consumeWeight.toString()
|
||||||
diBangWeight.value = bean.totalWeight.toString()
|
diBangWeight.value = bean.totalWeight.toString()
|
||||||
|
|
||||||
// 通道号 Spinner 绑定到 channel(KeyValue.value 即 passagewayId)
|
// 通道号 Spinner 绑定到 channel(KeyValue.value 即 passagewayId)
|
||||||
@@ -273,15 +275,16 @@ class GjcBoxWeighingAddViewModel : BaseViewModel() {
|
|||||||
/**
|
/**
|
||||||
* 计算重量字段
|
* 计算重量字段
|
||||||
* 装机重 = 总重 - 架子车自重
|
* 装机重 = 总重 - 架子车自重
|
||||||
* 货重 = 装机重 - ULD自重
|
* 货重 = 装机重 - ULD自重 - 耗材自重
|
||||||
*/
|
*/
|
||||||
private fun calculateWeights() {
|
private fun calculateWeights() {
|
||||||
val total = totalWeight.value?.toDoubleOrNull() ?: 0.0
|
val total = totalWeight.value?.toDoubleOrNull() ?: 0.0
|
||||||
val carW = dataBean.value?.carWeight ?: 0.0
|
val carW = dataBean.value?.carWeight ?: 0.0
|
||||||
val uldW = dataBean.value?.uldWeight ?: 0.0
|
val uldW = dataBean.value?.uldWeight ?: 0.0
|
||||||
|
val consumeW = consumeWeight.value?.toDoubleOrNull() ?: 0.0
|
||||||
|
|
||||||
val net = total - carW
|
val net = total - carW
|
||||||
val cargo = net - uldW
|
val cargo = net - uldW - consumeW
|
||||||
|
|
||||||
netWeight.value = if (net > 0) net.toString() else "0"
|
netWeight.value = if (net > 0) net.toString() else "0"
|
||||||
cargoWeight.value = if (cargo > 0) cargo.toString() else "0"
|
cargoWeight.value = if (cargo > 0) cargo.toString() else "0"
|
||||||
@@ -334,6 +337,7 @@ class GjcBoxWeighingAddViewModel : BaseViewModel() {
|
|||||||
totalWeight.value = "0"
|
totalWeight.value = "0"
|
||||||
netWeight.value = "0"
|
netWeight.value = "0"
|
||||||
cargoWeight.value = "0"
|
cargoWeight.value = "0"
|
||||||
|
consumeWeight.value = "0"
|
||||||
channel.value = ""
|
channel.value = ""
|
||||||
printTag.value = false
|
printTag.value = false
|
||||||
|
|
||||||
@@ -519,6 +523,9 @@ class GjcBoxWeighingAddViewModel : BaseViewModel() {
|
|||||||
if (usingData != null && usingData.useId > 0) {
|
if (usingData != null && usingData.useId > 0) {
|
||||||
// 保存返回的数据,用于提交时传递
|
// 保存返回的数据,用于提交时传递
|
||||||
usingUldData = usingData
|
usingUldData = usingData
|
||||||
|
// 耗材重量随该记录带回,需要重新参与货重计算
|
||||||
|
consumeWeight.value = usingData.consumeWeight.toString()
|
||||||
|
calculateWeights()
|
||||||
} else {
|
} else {
|
||||||
// 没有 useId,说明未组装,不可复磅
|
// 没有 useId,说明未组装,不可复磅
|
||||||
usingUldData = null
|
usingUldData = null
|
||||||
|
|||||||
@@ -25,13 +25,22 @@ import com.lukouguoji.module_base.ktx.formatDate
|
|||||||
class GjcQueryViewModel : BasePageViewModel() {
|
class GjcQueryViewModel : BasePageViewModel() {
|
||||||
|
|
||||||
// ==================== 搜索条件 ====================
|
// ==================== 搜索条件 ====================
|
||||||
|
val dateState = MutableLiveData("0") // 日期类型(0:入库,1:离港)
|
||||||
val flightDateStart = MutableLiveData<String>(DateUtils.getCurrentTime().formatDate()) // 航班日期起
|
val flightDateStart = MutableLiveData<String>(DateUtils.getCurrentTime().formatDate()) // 航班日期起
|
||||||
val flightDateEnd = MutableLiveData("") // 航班日期止
|
val flightDateEnd = MutableLiveData("") // 航班日期止
|
||||||
val agentId = MutableLiveData("") // 代理ID
|
val agentId = MutableLiveData("") // 代理ID
|
||||||
val outStatus = MutableLiveData("") // 出库状态
|
val flightNo = MutableLiveData("") // 航班号
|
||||||
val waybillNo = MutableLiveData("") // 运单号
|
val waybillNo = MutableLiveData("") // 运单号
|
||||||
|
|
||||||
// ==================== 下拉列表 ====================
|
// ==================== 下拉列表 ====================
|
||||||
|
// 日期类型下拉列表(对应接口 dateState)
|
||||||
|
val dateStateList = MutableLiveData(
|
||||||
|
listOf(
|
||||||
|
KeyValue("入库", "0"),
|
||||||
|
KeyValue("离港", "1")
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
// 代理下拉列表(从API获取)
|
// 代理下拉列表(从API获取)
|
||||||
val agentList = MutableLiveData(listOf(KeyValue("全部", "")))
|
val agentList = MutableLiveData(listOf(KeyValue("全部", "")))
|
||||||
|
|
||||||
@@ -49,9 +58,10 @@ class GjcQueryViewModel : BasePageViewModel() {
|
|||||||
val itemLayoutId = R.layout.item_gjc_query
|
val itemLayoutId = R.layout.item_gjc_query
|
||||||
|
|
||||||
// ==================== 统计数据 ====================
|
// ==================== 统计数据 ====================
|
||||||
val totalCount = MutableLiveData("0") // 合计票数
|
val totalCount = MutableLiveData("0") // 合计票数
|
||||||
val totalPc = MutableLiveData("0") // 总件数
|
val totalPc = MutableLiveData("0") // 总件数
|
||||||
val totalWeight = MutableLiveData("0") // 总重量
|
val totalWeight = MutableLiveData("0") // 总重量
|
||||||
|
val totalFlightNumber = MutableLiveData("0") // 航班航次
|
||||||
|
|
||||||
// ==================== 筛选面板 ====================
|
// ==================== 筛选面板 ====================
|
||||||
val filterVisible = MutableLiveData(false)
|
val filterVisible = MutableLiveData(false)
|
||||||
@@ -70,7 +80,7 @@ class GjcQueryViewModel : BasePageViewModel() {
|
|||||||
|
|
||||||
// ==================== 筛选条件 ====================
|
// ==================== 筛选条件 ====================
|
||||||
val spCode = MutableLiveData("") // 特码
|
val spCode = MutableLiveData("") // 特码
|
||||||
val flightNo = MutableLiveData("") // 航班号
|
val outStatus = MutableLiveData("") // 出库状态
|
||||||
val dest = MutableLiveData("") // 目的港
|
val dest = MutableLiveData("") // 目的港
|
||||||
val awbType = MutableLiveData("") // 运单类型
|
val awbType = MutableLiveData("") // 运单类型
|
||||||
val businessType = MutableLiveData("") // 业务类型
|
val businessType = MutableLiveData("") // 业务类型
|
||||||
@@ -79,11 +89,11 @@ class GjcQueryViewModel : BasePageViewModel() {
|
|||||||
// 是否有筛选条件(任意一个非空则为 true,用于筛选按钮红点)
|
// 是否有筛选条件(任意一个非空则为 true,用于筛选按钮红点)
|
||||||
val hasFilter: MediatorLiveData<Boolean> = MediatorLiveData<Boolean>().apply {
|
val hasFilter: MediatorLiveData<Boolean> = MediatorLiveData<Boolean>().apply {
|
||||||
val update = { _: Any? ->
|
val update = { _: Any? ->
|
||||||
value = listOf(spCode, flightNo, dest, awbType, businessType, goodsCn)
|
value = listOf(spCode, outStatus, dest, awbType, businessType, goodsCn)
|
||||||
.any { !it.value.isNullOrEmpty() }
|
.any { !it.value.isNullOrEmpty() }
|
||||||
}
|
}
|
||||||
addSource(spCode, update)
|
addSource(spCode, update)
|
||||||
addSource(flightNo, update)
|
addSource(outStatus, update)
|
||||||
addSource(dest, update)
|
addSource(dest, update)
|
||||||
addSource(awbType, update)
|
addSource(awbType, update)
|
||||||
addSource(businessType, update)
|
addSource(businessType, update)
|
||||||
@@ -127,7 +137,7 @@ class GjcQueryViewModel : BasePageViewModel() {
|
|||||||
*/
|
*/
|
||||||
fun resetFilter() {
|
fun resetFilter() {
|
||||||
spCode.value = ""
|
spCode.value = ""
|
||||||
flightNo.value = ""
|
outStatus.value = ""
|
||||||
dest.value = ""
|
dest.value = ""
|
||||||
awbType.value = ""
|
awbType.value = ""
|
||||||
businessType.value = ""
|
businessType.value = ""
|
||||||
@@ -160,39 +170,32 @@ class GjcQueryViewModel : BasePageViewModel() {
|
|||||||
* 核心方法:调用API获取数据并转换PageInfo为BaseListBean
|
* 核心方法:调用API获取数据并转换PageInfo为BaseListBean
|
||||||
*/
|
*/
|
||||||
override fun getData() {
|
override fun getData() {
|
||||||
|
// 公共查询条件(列表与统计接口共用)
|
||||||
|
val commonParams = mapOf(
|
||||||
|
// 日期类型(0:入库,1:离港)+ 日期范围
|
||||||
|
"dateState" to dateState.value?.ifEmpty { null }?.toIntOrNull(),
|
||||||
|
"beginDate" to flightDateStart.value?.ifEmpty { null },
|
||||||
|
"endDate" to flightDateEnd.value?.ifEmpty { null },
|
||||||
|
"agentCode" to agentId.value?.ifEmpty { null },
|
||||||
|
"fno" to flightNo.value?.ifEmpty { null },
|
||||||
|
"wbNo" to waybillNo.value?.ifEmpty { null },
|
||||||
|
// 筛选面板条件
|
||||||
|
"spCode" to spCode.value?.ifEmpty { null },
|
||||||
|
"outState" to outStatus.value?.ifEmpty { null }?.toIntOrNull(),
|
||||||
|
"dest" to dest.value?.ifEmpty { null },
|
||||||
|
"awbType" to awbType.value?.ifEmpty { null },
|
||||||
|
"businessType" to businessType.value?.ifEmpty { null },
|
||||||
|
"goodsCn" to goodsCn.value?.ifEmpty { null }
|
||||||
|
)
|
||||||
|
|
||||||
// 构建查询参数(列表接口)
|
// 构建查询参数(列表接口)
|
||||||
val listParams = mapOf(
|
val listParams = (commonParams + mapOf(
|
||||||
"pageNum" to pageModel.page,
|
"pageNum" to pageModel.page,
|
||||||
"pageSize" to pageModel.limit,
|
"pageSize" to pageModel.limit
|
||||||
"beginDate" to flightDateStart.value!!.ifEmpty { null },
|
)).toRequestBody()
|
||||||
"endDate" to flightDateEnd.value!!.ifEmpty { null },
|
|
||||||
"agentCode" to agentId.value!!.ifEmpty { null },
|
|
||||||
"outState" to outStatus.value!!.ifEmpty { null },
|
|
||||||
"wbNo" to waybillNo.value!!.ifEmpty { null },
|
|
||||||
// 筛选条件(暂未使用)
|
|
||||||
"spCode" to spCode.value!!.ifEmpty { null },
|
|
||||||
"fno" to flightNo.value!!.ifEmpty { null },
|
|
||||||
"dest" to dest.value!!.ifEmpty { null },
|
|
||||||
"awbType" to awbType.value!!.ifEmpty { null },
|
|
||||||
"businessType" to businessType.value!!.ifEmpty { null },
|
|
||||||
"goodsCn" to goodsCn.value!!.ifEmpty { null }
|
|
||||||
).toRequestBody()
|
|
||||||
|
|
||||||
// 构建查询参数(统计接口 - 使用相同的搜索条件)
|
// 构建查询参数(统计接口 - 使用相同的搜索条件)
|
||||||
val totalParams = mapOf(
|
val totalParams = commonParams.toRequestBody()
|
||||||
"beginDate" to flightDateStart.value!!.ifEmpty { null },
|
|
||||||
"endDate" to flightDateEnd.value!!.ifEmpty { null },
|
|
||||||
"agentCode" to agentId.value!!.ifEmpty { null },
|
|
||||||
"outState" to outStatus.value!!.ifEmpty { null },
|
|
||||||
"wbNo" to waybillNo.value!!.ifEmpty { null },
|
|
||||||
// 筛选条件
|
|
||||||
"spCode" to spCode.value!!.ifEmpty { null },
|
|
||||||
"fno" to flightNo.value!!.ifEmpty { null },
|
|
||||||
"dest" to dest.value!!.ifEmpty { null },
|
|
||||||
"awbType" to awbType.value!!.ifEmpty { null },
|
|
||||||
"businessType" to businessType.value!!.ifEmpty { null },
|
|
||||||
"goodsCn" to goodsCn.value!!.ifEmpty { null }
|
|
||||||
).toRequestBody()
|
|
||||||
|
|
||||||
// 获取列表数据(显示loading)
|
// 获取列表数据(显示loading)
|
||||||
launchLoadingCollect({
|
launchLoadingCollect({
|
||||||
@@ -213,6 +216,7 @@ class GjcQueryViewModel : BasePageViewModel() {
|
|||||||
totalCount.value = (data?.wbNumber ?: 0).toString()
|
totalCount.value = (data?.wbNumber ?: 0).toString()
|
||||||
totalPc.value = (data?.totalPc ?: 0).toString()
|
totalPc.value = (data?.totalPc ?: 0).toString()
|
||||||
totalWeight.value = (data?.totalWeight ?: 0.0).toString()
|
totalWeight.value = (data?.totalWeight ?: 0.0).toString()
|
||||||
|
totalFlightNumber.value = (data?.flightNumber ?: 0).toString()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -139,6 +139,29 @@
|
|||||||
android:textSize="16sp" />
|
android:textSize="16sp" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
<!-- 耗材重量 -->
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="10dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="耗材重量:"
|
||||||
|
android:textColor="@color/text_gray"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@{viewModel.consumeWeight}"
|
||||||
|
android:textColor="@color/text_normal"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
|||||||
@@ -259,7 +259,7 @@
|
|||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<!-- 第5行:架子车自重、ULD自重、货重(绿色只读) -->
|
<!-- 第5行:架子车自重、ULD自重、耗材重量(只读) -->
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
@@ -289,10 +289,10 @@
|
|||||||
|
|
||||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
|
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
|
||||||
enable="@{false}"
|
enable="@{false}"
|
||||||
title='@{"货重"}'
|
title='@{"耗材重量"}'
|
||||||
titleLength="@{5}"
|
titleLength="@{5}"
|
||||||
type="@{DataLayoutType.INPUT}"
|
type="@{DataLayoutType.INPUT}"
|
||||||
value='@{viewModel.cargoWeight}'
|
value='@{viewModel.consumeWeight}'
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="15dp"
|
android:layout_marginStart="15dp"
|
||||||
@@ -300,7 +300,7 @@
|
|||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<!-- 第6行:航班日期、航班号、目的港 -->
|
<!-- 第6行:航班日期、航班号、货重(绿色只读) -->
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
@@ -331,11 +331,11 @@
|
|||||||
android:layout_weight="1" />
|
android:layout_weight="1" />
|
||||||
|
|
||||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
|
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
|
||||||
hint='@{"请输入目的港"}'
|
enable="@{false}"
|
||||||
title='@{"目的港"}'
|
title='@{"货重"}'
|
||||||
titleLength="@{5}"
|
titleLength="@{5}"
|
||||||
type="@{DataLayoutType.INPUT}"
|
type="@{DataLayoutType.INPUT}"
|
||||||
value='@={viewModel.dataBean.fdest}'
|
value='@{viewModel.cargoWeight}'
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="15dp"
|
android:layout_marginStart="15dp"
|
||||||
@@ -343,7 +343,32 @@
|
|||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<!-- 第7行:备注 -->
|
<!-- 第7行:目的港(占 1/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='@{"请输入目的港"}'
|
||||||
|
title='@{"目的港"}'
|
||||||
|
titleLength="@{5}"
|
||||||
|
type="@{DataLayoutType.INPUT}"
|
||||||
|
value='@={viewModel.dataBean.fdest}'
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1" />
|
||||||
|
|
||||||
|
<!-- 占位:保持目的港与上方各行第一列同宽 -->
|
||||||
|
<Space
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_weight="2" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<!-- 第8行:备注(整行) -->
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
|||||||
@@ -42,6 +42,16 @@
|
|||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<!-- 日期类型(入库/离港) -->
|
||||||
|
<com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayout
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="0.7"
|
||||||
|
hint='@{"请选择日期类型"}'
|
||||||
|
list="@{viewModel.dateStateList}"
|
||||||
|
type="@{SearchLayoutType.SPINNER}"
|
||||||
|
value="@={viewModel.dateState}" />
|
||||||
|
|
||||||
<!-- 航班日期起 -->
|
<!-- 航班日期起 -->
|
||||||
<com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayout
|
<com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayout
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
@@ -72,15 +82,15 @@
|
|||||||
type="@{SearchLayoutType.SPINNER}"
|
type="@{SearchLayoutType.SPINNER}"
|
||||||
value="@={viewModel.agentId}" />
|
value="@={viewModel.agentId}" />
|
||||||
|
|
||||||
<!-- 出库状态 -->
|
<!-- 航班号 -->
|
||||||
<com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayout
|
<com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayout
|
||||||
|
android:id="@+id/flight_no_search"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
hint='@{"请选择出库状态"}'
|
hint='@{"请输入航班号"}'
|
||||||
list="@{viewModel.outStatusList}"
|
type="@{SearchLayoutType.INPUT}"
|
||||||
type="@{SearchLayoutType.SPINNER}"
|
value="@={viewModel.flightNo}" />
|
||||||
value="@={viewModel.outStatus}" />
|
|
||||||
|
|
||||||
<!-- 运单号 -->
|
<!-- 运单号 -->
|
||||||
<com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayout
|
<com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayout
|
||||||
@@ -204,6 +214,16 @@
|
|||||||
android:textStyle="bold"
|
android:textStyle="bold"
|
||||||
tools:text="总重量:100" />
|
tools:text="总重量:100" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="20dp"
|
||||||
|
android:text='@{`航班航次:` + viewModel.totalFlightNumber}'
|
||||||
|
android:textColor="@color/bottom_tool_tips_text_color"
|
||||||
|
android:textSize="16sp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
tools:text="航班航次:2" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|||||||
@@ -198,7 +198,7 @@
|
|||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<!-- 第二行:航程、计重状态、运抵状态、运单类型、分单数 -->
|
<!-- 第二行:航程、海关放行、运抵状态、运单类型、分单数 -->
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
@@ -231,7 +231,7 @@
|
|||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<!-- 计重状态 -->
|
<!-- 海关放行 -->
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
@@ -243,20 +243,16 @@
|
|||||||
completeSpace="@{5}"
|
completeSpace="@{5}"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="计重状态:"
|
android:text="海关放行:"
|
||||||
android:textColor="@color/text_normal"
|
android:textColor="@color/text_normal"
|
||||||
android:textSize="15sp" />
|
android:textSize="15sp" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="@{`1`.equals(bean.checkIn) ? @drawable/tag_status_green : (`2`.equals(bean.checkIn) ? @drawable/tag_status_blue : @drawable/tag_status_gray)}"
|
android:text="@{bean.cmdStatus}"
|
||||||
android:paddingHorizontal="8dp"
|
android:textColor="@color/text_normal"
|
||||||
android:paddingVertical="2dp"
|
android:textSize="15sp" />
|
||||||
android:text="@{bean.checkInText}"
|
|
||||||
android:textColor="@{`1`.equals(bean.checkIn) ? @color/text_green : (`2`.equals(bean.checkIn) ? @color/colorPrimary : @color/text_gray)}"
|
|
||||||
android:textSize="14sp"
|
|
||||||
android:visibility="@{bean.checkIn != null && !bean.checkIn.isEmpty() ? View.VISIBLE : View.GONE}" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
@@ -439,6 +435,16 @@
|
|||||||
android:textSize="14sp"
|
android:textSize="14sp"
|
||||||
android:textStyle="bold" />
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="0.9"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="海关放行"
|
||||||
|
android:textColor="@color/text_normal"
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
|||||||
@@ -90,6 +90,16 @@
|
|||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
<!-- 海关放行 -->
|
||||||
|
<TextView
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="0.9"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="@{bean.cmdStatus ?? ``}"
|
||||||
|
android:textColor="@color/text_normal"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
|
||||||
<!-- 品名(中) -->
|
<!-- 品名(中) -->
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
|
|||||||
@@ -167,7 +167,7 @@
|
|||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<!-- 第二行:目的港、库位号、复磅状态、交接人、交接时间 -->
|
<!-- 第二行:目的港、库位号、IMP代码、交接人、交接时间 -->
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
@@ -221,7 +221,7 @@
|
|||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<!-- 复磅状态 -->
|
<!-- IMP代码(非空且不是 ELI/ELM 时标红) -->
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
@@ -233,14 +233,14 @@
|
|||||||
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="IMP代码:"
|
||||||
android:textSize="15sp" />
|
android:textSize="15sp" />
|
||||||
|
|
||||||
<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.wtDate != null && !bean.wtDate.isEmpty() ? `已复磅` : `未复磅`}"
|
android:text="@{bean.dgrCode}"
|
||||||
android:textColor="@{bean.wtDate != null && !bean.wtDate.isEmpty() ? @color/text_green : @color/text_normal}"
|
android:textColor="@{bean.dgrCode != null && !bean.dgrCode.isEmpty() && !bean.dgrCode.equals(`ELI`) && !bean.dgrCode.equals(`ELM`) ? @color/text_red : @color/text_normal}"
|
||||||
android:textSize="15sp" />
|
android:textSize="15sp" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|||||||
@@ -67,17 +67,17 @@
|
|||||||
type="@{DataLayoutType.INPUT}"
|
type="@{DataLayoutType.INPUT}"
|
||||||
value='@={viewModel.spCode}' />
|
value='@={viewModel.spCode}' />
|
||||||
|
|
||||||
<!-- 航班号 -->
|
<!-- 出库状态 -->
|
||||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
|
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
|
||||||
android:id="@+id/filter_flight_no"
|
|
||||||
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"
|
||||||
hint='@{"请输入航班号"}'
|
hint='@{"请选择出库状态"}'
|
||||||
title='@{"航班号"}'
|
list="@{viewModel.outStatusList}"
|
||||||
|
title='@{"出库状态"}'
|
||||||
titleLength="@{4}"
|
titleLength="@{4}"
|
||||||
type="@{DataLayoutType.INPUT}"
|
type="@{DataLayoutType.SPINNER}"
|
||||||
value='@={viewModel.flightNo}' />
|
value='@={viewModel.outStatus}' />
|
||||||
|
|
||||||
<!-- 目的港 -->
|
<!-- 目的港 -->
|
||||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
|
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
|
||||||
|
|||||||
@@ -125,15 +125,15 @@ class IntImpManifestViewModel : BasePageViewModel() {
|
|||||||
|
|
||||||
// ========== 全选状态 ==========
|
// ========== 全选状态 ==========
|
||||||
val isAllChecked = MutableLiveData(false)
|
val isAllChecked = MutableLiveData(false)
|
||||||
|
|
||||||
fun onItemCheckChanged() {
|
fun onItemCheckChanged() {
|
||||||
updateCheckAllStatus()
|
updateCheckAllStatus()
|
||||||
}
|
}
|
||||||
|
|
||||||
fun updateCheckAllStatus() {
|
fun updateCheckAllStatus() {
|
||||||
val list = pageModel.rv?.commonAdapter()?.items as? List<GjjManifest> ?: return
|
val list = pageModel.rv?.commonAdapter()?.items as? List<GjjManifest> ?: return
|
||||||
isAllChecked.value = list.isNotEmpty() && list.all { it.checked.get() }
|
isAllChecked.value = list.isNotEmpty() && list.all { it.checked.get() }
|
||||||
}
|
}
|
||||||
|
|
||||||
// ========== 展开/收起 ==========
|
// ========== 展开/收起 ==========
|
||||||
val isAllExpanded = MutableLiveData(false)
|
val isAllExpanded = MutableLiveData(false)
|
||||||
@@ -481,6 +481,77 @@ class IntImpManifestViewModel : BasePageViewModel() {
|
|||||||
.navigation()
|
.navigation()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 开始理货(弹出修改库位对话框,提交理货库位)
|
||||||
|
*/
|
||||||
|
fun startTallyClick() {
|
||||||
|
val list = pageModel.rv?.commonAdapter()?.items as? List<GjjManifest> ?: return
|
||||||
|
val selectedItems = list.filter { it.isSelected }
|
||||||
|
|
||||||
|
if (selectedItems.isEmpty()) {
|
||||||
|
showToast("请选择要理货的运单")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (selectedItems.size > 1) {
|
||||||
|
showToast("只能选择一个运单")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// 舱单列表接口不返回理货库位,需先查装机单记录取出该运单已有的库位再弹窗回填
|
||||||
|
val selectedItem = selectedItems.first()
|
||||||
|
val queryParams = mapOf(
|
||||||
|
"fid" to fid.ifEmpty { null },
|
||||||
|
"fdep" to fdep.ifEmpty { null },
|
||||||
|
"wbNo" to selectedItem.wbNo.ifEmpty { null },
|
||||||
|
"pageNum" to 1,
|
||||||
|
"pageSize" to 1
|
||||||
|
).toRequestBody()
|
||||||
|
|
||||||
|
launchLoadingCollect({ NetApply.api.getIntImpLoadingList(queryParams) }) {
|
||||||
|
onSuccess = { result ->
|
||||||
|
val tallyRecord = result.list?.firstOrNull()
|
||||||
|
showModifyStorageDialog(
|
||||||
|
selectedItems = selectedItems,
|
||||||
|
currentLocationId = tallyRecord?.locationTallyId?.takeIf { it > 0 }?.toString() ?: "",
|
||||||
|
currentLocationName = tallyRecord?.locationTally ?: ""
|
||||||
|
)
|
||||||
|
}
|
||||||
|
// 查询失败不阻断操作,直接弹出空白库位的对话框
|
||||||
|
onFailed = { _, _ -> showModifyStorageDialog(selectedItems, "", "") }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 弹出修改库位对话框并提交(currentLocation* 用于回填该运单已有的理货库位)
|
||||||
|
*/
|
||||||
|
private fun showModifyStorageDialog(
|
||||||
|
selectedItems: List<GjjManifest>,
|
||||||
|
currentLocationId: String,
|
||||||
|
currentLocationName: String
|
||||||
|
) {
|
||||||
|
IntImpModifyStorageDialogModel(
|
||||||
|
currentLocationId = currentLocationId,
|
||||||
|
currentLocationName = currentLocationName
|
||||||
|
) { dialog ->
|
||||||
|
val params = mapOf(
|
||||||
|
"location" to dialog.locationName,
|
||||||
|
"locationId" to dialog.locationId.toLongOrNull(),
|
||||||
|
"manifestList" to selectedItems
|
||||||
|
).toRequestBody()
|
||||||
|
|
||||||
|
launchLoadingCollect({ NetApply.api.modifyIntImpLoadingStorage(params) }) {
|
||||||
|
onSuccess = {
|
||||||
|
if (it.verifySuccess()) {
|
||||||
|
showToast(it.msg.noNull("修改库位成功"))
|
||||||
|
refresh()
|
||||||
|
} else {
|
||||||
|
showToast(it.msg.noNull("修改库位失败"))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}.show()
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 货物发放
|
* 货物发放
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -143,7 +143,7 @@ class IntImpPickUpDLVViewModel : BasePageViewModel() {
|
|||||||
"beginDate" to paymentDateStart.value?.ifEmpty { null },
|
"beginDate" to paymentDateStart.value?.ifEmpty { null },
|
||||||
"endDate" to paymentDateEnd.value?.ifEmpty { null },
|
"endDate" to paymentDateEnd.value?.ifEmpty { null },
|
||||||
"agentCode" to agentCode.value?.ifEmpty { null },
|
"agentCode" to agentCode.value?.ifEmpty { null },
|
||||||
"no" to wbNo.value?.ifEmpty { null },
|
"wbNo" to wbNo.value?.ifEmpty { null },
|
||||||
"spCode" to spCode.value?.ifEmpty { null }
|
"spCode" to spCode.value?.ifEmpty { null }
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -274,9 +274,15 @@
|
|||||||
style="@style/tv_bottom_btn"
|
style="@style/tv_bottom_btn"
|
||||||
android:layout_marginEnd="15dp"
|
android:layout_marginEnd="15dp"
|
||||||
android:onClick="@{()-> viewModel.sortingTallyClick()}"
|
android:onClick="@{()-> viewModel.sortingTallyClick()}"
|
||||||
android:text="分拣理货" />
|
android:text="装机单" />
|
||||||
|
|
||||||
<!-- 货物发放按钮 (红色) -->
|
<TextView
|
||||||
|
style="@style/tv_bottom_btn"
|
||||||
|
android:layout_marginEnd="15dp"
|
||||||
|
android:onClick="@{()-> viewModel.startTallyClick()}"
|
||||||
|
android:text="开始理货" />
|
||||||
|
|
||||||
|
<!-- 理货完成按钮 (红色) -->
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="100dp"
|
android:layout_width="100dp"
|
||||||
android:layout_height="40dp"
|
android:layout_height="40dp"
|
||||||
@@ -284,7 +290,7 @@
|
|||||||
android:background="@drawable/bg_red_btn_bottom"
|
android:background="@drawable/bg_red_btn_bottom"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:onClick="@{()-> viewModel.cargoReleaseClick()}"
|
android:onClick="@{()-> viewModel.cargoReleaseClick()}"
|
||||||
android:text="货物发放"
|
android:text="理货完成"
|
||||||
android:textColor="@color/white"
|
android:textColor="@color/white"
|
||||||
android:textSize="18sp" />
|
android:textSize="18sp" />
|
||||||
|
|
||||||
|
|||||||
@@ -67,7 +67,7 @@
|
|||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
completeSpace="@{4}"
|
completeSpace="@{5}"
|
||||||
android:text="运单号:"
|
android:text="运单号:"
|
||||||
android:textSize="15sp" />
|
android:textSize="15sp" />
|
||||||
|
|
||||||
@@ -194,7 +194,7 @@
|
|||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
completeSpace="@{4}"
|
completeSpace="@{5}"
|
||||||
android:text="品名(中):"
|
android:text="品名(中):"
|
||||||
android:textSize="15sp" />
|
android:textSize="15sp" />
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user