Compare commits

..

8 Commits

Author SHA1 Message Date
9b820ba8ef style: 国际进出港分单复选框统一复用全选图标资源
出港运抵、出港理货、出港仓库、进港舱单、原始舱单、进港理货、进港仓库
七个页面展开子列表的复选框由 radiobtn_*_style 改为 img_check_all_*,
高度保持 20dp;同步更新 CLAUDE.md 中的子列表复选框规范。

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-09-24 17:21:54 +08:00
74f1280896 feat: 国际进港仓库入库/出库支持填写件数重量
- 入库弹窗新增件数、重量输入,默认取选中运单件数重量(装机单入库不显示)
- 出库改用出库弹窗(替换确认框),新增件数、重量输入,默认取库位入库件数重量
- 出库接口请求体由数组改为对象,选中库位放入 storageUseList
- 库位子列表新增入库件数/重量、出库件数/重量四列

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-24 11:32:43 +08:00
2dc86bcae5 feat: 国际出港仓库入库/出库支持填写件数重量
- 入库弹窗新增件数、重量输入,默认取选中运单件数重量
- 出库改用自定义弹窗(替换 AlertDialog),新增件数、重量输入,默认取库位入库件数重量
- 出库接口请求体由数组改为对象,选中库位放入 storageUseList
- 库位子列表新增入库件数/重量、出库件数/重量四列

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-24 10:47:03 +08:00
aebf1b1090 style: 调整出港仓库列表项与开始计重表单的字段位置
出港仓库列表项中品名与件数互换位置;开始计重页运抵行与托盘行互换,
业务类型移至托盘自重之后,备注改为平板车自重后的三分之一列,不再独占一行。

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-20 15:29:00 +08:00
698046c9fb style: 国际进港事故签证列表项按内容宽度重排列 weight
按各列实际内容宽度重新分配五列 weight(1.1/0.75/1.0/1.0/1.15),
使列间距均匀一致,避免原来疏密不均的问题。

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-20 15:13:30 +08:00
94508f8c40 feat: 国际出港开始组装 ULD 触发板型查询后自动选中首项
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-20 15:03:56 +08:00
d54e1e429d feat: 航班详情页去掉航程表单项
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-20 14:56:34 +08:00
b7a2be0f35 style: 出港运抵标签改为运抵模式,进港理货报告更名为进港理货
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-20 14:54:32 +08:00
31 changed files with 908 additions and 151 deletions

View File

@@ -383,7 +383,7 @@ fun toggleAllExpand() {
} }
``` ```
4. **子列表项 checkbox 样式**(必须使用 `_style` 系列,禁止使用 `_gray` 系列): 4. **子列表项 checkbox 样式**(必须复用底部“全选”的 `img_check_all_*` 资源,高度 20dp):
```xml ```xml
<!-- 子列表项 item_xxx_sub.xml 中的 iv_checkbox --> <!-- 子列表项 item_xxx_sub.xml 中的 iv_checkbox -->
<ImageView <ImageView
@@ -392,14 +392,15 @@ fun toggleAllExpand() {
android:layout_height="20dp" android:layout_height="20dp"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:layout_weight="0.5" android:layout_weight="0.5"
loadImage="@{bean.checked.get() ? @drawable/radiobtn_checked_style : @drawable/radiobtn_unchecked_style}" loadImage="@{bean.checked.get() ? @drawable/img_check_all_checked : @drawable/img_check_all_unchecked}"
android:src="@drawable/radiobtn_unchecked_style" /> android:src="@drawable/img_check_all_unchecked" />
``` ```
| 资源 | 含义 | 外观 | | 资源 | 含义 | 外观 |
|------|------|------| |------|------|------|
| `radiobtn_checked_style` | 选中 | colorPrimary 蓝色实心圆 + 白色内环 | | `img_check_all_checked` | 选中 | `#1C8CF5` 蓝色实心圆 + 白色对勾(与底部“全选”相同)|
| `radiobtn_unchecked_style` | 未选中 | 透明 + 黑色边框圆 | | `img_check_all_unchecked` | 未选中 | `#707070` 灰色细圆环(与底部“全选”相同)|
| ~~`radiobtn_checked_style` / `radiobtn_unchecked_style`~~ | ❌ 已废弃 | 旧版分单复选框,不再使用 |
| ~~`radiobtn_checked_gray`~~ | ❌ 禁用 | 灰色实心圆(错误样式) | | ~~`radiobtn_checked_gray`~~ | ❌ 禁用 | 灰色实心圆(错误样式) |
#### 列表项 UI 规范(以 `item_int_exp_arrive / assemble / load / tally.xml` 四个基准页为准) #### 列表项 UI 规范(以 `item_int_exp_arrive / assemble / load / tally.xml` 四个基准页为准)
@@ -455,11 +456,11 @@ fun toggleAllExpand() {
android:layout_height="20dp" android:layout_height="20dp"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:layout_weight="0.5" android:layout_weight="0.5"
loadImage="@{bean.checked.get() ? @drawable/radiobtn_checked_style : @drawable/radiobtn_unchecked_style}" loadImage="@{bean.checked.get() ? @drawable/img_check_all_checked : @drawable/img_check_all_unchecked}"
android:src="@drawable/radiobtn_unchecked_style" /> android:src="@drawable/img_check_all_unchecked" />
``` ```
> `loadImage` 和 `android:src` **均须**使用 `_style` 系列,**禁止**使用 `_gray` 系列(参见上方复选框样式表) > `loadImage` 和 `android:src` **均须**使用 `img_check_all_checked`/`img_check_all_unchecked`(与底部“全选”同源),高度固定 **20dp**;**禁止**再使用 `radiobtn_*_style`/`radiobtn_*_gray`(参见上方复选框样式表)
**参考文件**: `module_gjc/.../IntExpStorageUseActivity.kt`、`IntExpStorageUseViewModel.kt` **参考文件**: `module_gjc/.../IntExpStorageUseActivity.kt`、`IntExpStorageUseViewModel.kt`

View File

@@ -456,7 +456,7 @@ class HomeFragment : Fragment() {
.navigation() .navigation()
} }
// 理货报告 // 进港理货
Constant.AuthName.IntImpTally -> { Constant.AuthName.IntImpTally -> {
ARouter.getInstance().build(ARouterConstants.ACTIVITY_URL_INT_IMP_TALLY) ARouter.getInstance().build(ARouterConstants.ACTIVITY_URL_INT_IMP_TALLY)
.navigation() .navigation()
@@ -847,7 +847,7 @@ class HomeFragment : Fragment() {
RightMenu( RightMenu(
Constant.AuthName.IntImpTally, Constant.AuthName.IntImpTally,
R.mipmap.gjj_li_huo_bao_gao_icon, R.mipmap.gjj_li_huo_bao_gao_icon,
"理货报告" "进港理货"
) )
) )
list.add( list.add(

View File

@@ -114,23 +114,13 @@
</LinearLayout> </LinearLayout>
<!-- 第3行:航程、地区类型、服务类型 --> <!-- 第3行:地区类型、服务类型 -->
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="8dp" android:layout_marginTop="8dp"
android:orientation="horizontal"> android:orientation="horizontal">
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
enable="@{false}"
title='@{"航程"}'
titleLength="@{4}"
type="@{DataLayoutType.INPUT}"
value='@{viewModel.dataBean.range}' />
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew <com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
@@ -151,6 +141,11 @@
type="@{DataLayoutType.INPUT}" type="@{DataLayoutType.INPUT}"
value='@{viewModel.serviceTypeText}' /> value='@{viewModel.serviceTypeText}' />
<Space
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
</LinearLayout> </LinearLayout>
<!-- 第4行:飞行状态、航班状态、延误原因 --> <!-- 第4行:飞行状态、航班状态、延误原因 -->

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 com.lukouguoji.module_base.ktx.toPlainText
import java.text.SimpleDateFormat import java.text.SimpleDateFormat
import java.util.Date import java.util.Date
import java.util.Locale import java.util.Locale
@@ -320,12 +321,21 @@ data class GjcStorageUse(
var outDate: String? = null, // 出库时间 var outDate: String? = null, // 出库时间
var outOpId: String? = null, // 出库人 var outOpId: String? = null, // 出库人
var outId: String? = null, // 出库人(兼容字段) var outId: String? = null, // 出库人(兼容字段)
var cargoStatus: String? = null // 货物状态 var cargoStatus: String? = null, // 货物状态
var inPc: Long? = null, // 入库件数
var inWeight: Double? = null, // 入库重量
var outPc: Long? = null, // 出库件数
var outWeight: Double? = null // 出库重量
) { ) {
// ==================== UI扩展字段 ==================== // ==================== UI扩展字段 ====================
@Transient @Transient
val checked: ObservableBoolean = ObservableBoolean(false) // 选中状态 val checked: ObservableBoolean = ObservableBoolean(false) // 选中状态
val inPcText: String get() = inPc?.toString() ?: ""
val inWeightText: String get() = inWeight?.toPlainText() ?: ""
val outPcText: String get() = outPc?.toString() ?: ""
val outWeightText: String get() = outWeight?.toPlainText() ?: ""
// 兼容现有API的isSelected属性 // 兼容现有API的isSelected属性
var isSelected: Boolean var isSelected: Boolean
get() = checked.get() get() = checked.get()

View File

@@ -14,3 +14,9 @@ fun Number.limit(count: Int = 2): String {
} }
return DecimalFormat(pattern.toString()).format(this) return DecimalFormat(pattern.toString()).format(this)
} }
/**
* 去掉无意义的小数位:12.0 -> "12",12.50 -> "12.5"
*/
fun Double.toPlainText(): String =
if (this % 1.0 == 0.0) toLong().toString() else toBigDecimal().stripTrailingZeros().toPlainString()

View File

@@ -3,13 +3,13 @@ package com.lukouguoji.gjc.activity
import android.app.Activity import android.app.Activity
import android.content.Intent import android.content.Intent
import android.os.Bundle import android.os.Bundle
import androidx.appcompat.app.AlertDialog
import com.alibaba.android.arouter.facade.annotation.Route import com.alibaba.android.arouter.facade.annotation.Route
import com.lukouguoji.gjc.R import com.lukouguoji.gjc.R
import com.lukouguoji.gjc.databinding.ActivityIntExpStorageUseBinding import com.lukouguoji.gjc.databinding.ActivityIntExpStorageUseBinding
import com.lukouguoji.gjc.dialog.IntExpMoveClearDialogModel import com.lukouguoji.gjc.dialog.IntExpMoveClearDialogModel
import com.lukouguoji.gjc.dialog.IntExpModifyStorageDialogModel import com.lukouguoji.gjc.dialog.IntExpModifyStorageDialogModel
import com.lukouguoji.gjc.dialog.IntExpInStorageDialogModel import com.lukouguoji.gjc.dialog.IntExpInStorageDialogModel
import com.lukouguoji.gjc.dialog.IntExpOutStorageDialogModel
import com.lukouguoji.gjc.viewModel.IntExpStorageUseViewModel import com.lukouguoji.gjc.viewModel.IntExpStorageUseViewModel
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
@@ -121,7 +121,7 @@ class IntExpStorageUseActivity :
} }
/** /**
* 显示出库二次确认对话框 * 显示出库操作对话框
*/ */
fun showOutStorageDialog() { fun showOutStorageDialog() {
val list = viewModel.pageModel.rv?.commonAdapter()?.items as? List<*> ?: return val list = viewModel.pageModel.rv?.commonAdapter()?.items as? List<*> ?: return
@@ -139,16 +139,19 @@ class IntExpStorageUseActivity :
return return
} }
// 显示二次确认对话框 // 显示出库对话框,件数/重量默认取选中库位的入库件数/重量
AlertDialog.Builder(this) IntExpOutStorageDialogModel(
.setTitle("出库确认") storageCount = selectedStorageUseList.size,
.setMessage("确定要将选中的 ${selectedStorageUseList.size} 个库位执行出库操作吗?") defaultPc = selectedStorageUseList.mapNotNull { it.inPc }.takeIf { it.isNotEmpty() }?.sum(),
.setPositiveButton("确定") { _, _ -> defaultWeight = selectedStorageUseList.mapNotNull { it.inWeight }.takeIf { it.isNotEmpty() }?.sum()
// 用户确认后,执行出库操作 ) { dialog ->
viewModel.performOutStorage(selectedStorageUseList) // 用户点击确定后,执行出库操作
} viewModel.performOutStorage(
.setNegativeButton("取消", null) dialog.pc.value?.toLongOrNull(),
.show() dialog.weight.value?.toDoubleOrNull(),
selectedStorageUseList
)
}.show(this)
} }
/** /**
@@ -177,12 +180,19 @@ class IntExpStorageUseActivity :
return return
} }
// 显示入库对话框 // 显示入库对话框,件数/重量默认取选中运单的件数/重量
IntExpInStorageDialogModel { dialog -> IntExpInStorageDialogModel(
defaultPc = maWbListForInStorage.mapNotNull { it.pc }.takeIf { it.isNotEmpty() }?.sum(),
defaultWeight = maWbListForInStorage.mapNotNull { it.weight }.takeIf { it.isNotEmpty() }?.sum()
) { dialog ->
// 用户点击保存后,执行入库操作 // 用户点击保存后,执行入库操作
val locationName = dialog.locationName viewModel.performInStorage(
val locationId = dialog.locationId dialog.locationName,
viewModel.performInStorage(locationName, locationId, maWbListForInStorage) dialog.locationId,
dialog.pc.value?.toLongOrNull(),
dialog.weight.value?.toDoubleOrNull(),
maWbListForInStorage
)
}.show(this) }.show(this)
} }

View File

@@ -1,6 +1,7 @@
package com.lukouguoji.gjc.dialog package com.lukouguoji.gjc.dialog
import android.content.Context import android.content.Context
import android.text.InputType
import androidx.lifecycle.MutableLiveData import androidx.lifecycle.MutableLiveData
import com.lukouguoji.gjc.R import com.lukouguoji.gjc.R
import com.lukouguoji.gjc.databinding.DialogIntExpInStorageBinding import com.lukouguoji.gjc.databinding.DialogIntExpInStorageBinding
@@ -8,13 +9,18 @@ import com.lukouguoji.module_base.base.BaseDialogModel
import com.lukouguoji.module_base.http.net.NetApply import com.lukouguoji.module_base.http.net.NetApply
import com.lukouguoji.module_base.ktx.launchCollect import com.lukouguoji.module_base.ktx.launchCollect
import com.lukouguoji.module_base.ktx.showToast import com.lukouguoji.module_base.ktx.showToast
import com.lukouguoji.module_base.ktx.toPlainText
import com.lukouguoji.module_base.ktx.verifyNullOrEmpty import com.lukouguoji.module_base.ktx.verifyNullOrEmpty
import dev.utils.app.info.KeyValue import dev.utils.app.info.KeyValue
/** /**
* 国际出港仓库 - 入库操作对话框 * 国际出港仓库 - 入库操作对话框
* @param defaultPc 默认件数(选中运单的件数)
* @param defaultWeight 默认重量(选中运单的重量)
*/ */
class IntExpInStorageDialogModel( class IntExpInStorageDialogModel(
defaultPc: Long?,
defaultWeight: Double?,
private val callback: (IntExpInStorageDialogModel) -> Unit private val callback: (IntExpInStorageDialogModel) -> Unit
) : BaseDialogModel<DialogIntExpInStorageBinding>(DIALOG_TYPE_CENTER) { ) : BaseDialogModel<DialogIntExpInStorageBinding>(DIALOG_TYPE_CENTER) {
@@ -30,12 +36,20 @@ class IntExpInStorageDialogModel(
// 库位名称 (后端需要的name) // 库位名称 (后端需要的name)
var locationName: String = "" var locationName: String = ""
// 入库件数
val pc = MutableLiveData(defaultPc?.toString() ?: "")
// 入库重量
val weight = MutableLiveData(defaultWeight?.toPlainText() ?: "")
override fun layoutId(): Int { override fun layoutId(): Int {
return R.layout.dialog_int_exp_in_storage return R.layout.dialog_int_exp_in_storage
} }
override fun onDialogCreated(context: Context) { override fun onDialogCreated(context: Context) {
binding.model = this binding.model = this
binding.pcInput.et.inputType = InputType.TYPE_CLASS_NUMBER
binding.weightInput.et.inputType = InputType.TYPE_CLASS_NUMBER or InputType.TYPE_NUMBER_FLAG_DECIMAL
loadLocationList() loadLocationList()
// 监听选择变化,更新locationId和locationName // 监听选择变化,更新locationId和locationName
@@ -68,6 +82,14 @@ class IntExpInStorageDialogModel(
if (selectedLocationCode.value.verifyNullOrEmpty("请选择库位")) { if (selectedLocationCode.value.verifyNullOrEmpty("请选择库位")) {
return return
} }
if (pc.value?.toLongOrNull() == null) {
showToast("请输入正确的件数")
return
}
if (weight.value?.toDoubleOrNull() == null) {
showToast("请输入正确的重量")
return
}
dismiss() dismiss()
callback(this) callback(this)
} }

View File

@@ -0,0 +1,58 @@
package com.lukouguoji.gjc.dialog
import android.content.Context
import android.text.InputType
import androidx.lifecycle.MutableLiveData
import com.lukouguoji.gjc.R
import com.lukouguoji.gjc.databinding.DialogIntExpOutStorageBinding
import com.lukouguoji.module_base.base.BaseDialogModel
import com.lukouguoji.module_base.ktx.showToast
import com.lukouguoji.module_base.ktx.toPlainText
/**
* 国际出港仓库 - 出库操作对话框
* @param storageCount 选中的库位数
* @param defaultPc 默认件数(选中库位的入库件数)
* @param defaultWeight 默认重量(选中库位的入库重量)
*/
class IntExpOutStorageDialogModel(
storageCount: Int,
defaultPc: Long?,
defaultWeight: Double?,
private val callback: (IntExpOutStorageDialogModel) -> Unit
) : BaseDialogModel<DialogIntExpOutStorageBinding>(DIALOG_TYPE_CENTER) {
val tip = "已选择 $storageCount 个库位执行出库操作"
// 出库件数
val pc = MutableLiveData(defaultPc?.toString() ?: "")
// 出库重量
val weight = MutableLiveData(defaultWeight?.toPlainText() ?: "")
override fun layoutId(): Int {
return R.layout.dialog_int_exp_out_storage
}
override fun onDialogCreated(context: Context) {
binding.model = this
binding.pcInput.et.inputType = InputType.TYPE_CLASS_NUMBER
binding.weightInput.et.inputType = InputType.TYPE_CLASS_NUMBER or InputType.TYPE_NUMBER_FLAG_DECIMAL
}
/**
* 确定按钮点击
*/
fun onSaveClick() {
if (pc.value?.toLongOrNull() == null) {
showToast("请输入正确的件数")
return
}
if (weight.value?.toDoubleOrNull() == null) {
showToast("请输入正确的重量")
return
}
dismiss()
callback(this)
}
}

View File

@@ -414,9 +414,13 @@ class IntExpAssembleStartViewModel : BaseViewModel() {
/** /**
* 加载板型选项列表 * 加载板型选项列表
* @param carrier 承运人二字码(ULD 编号后两位);进入页面时不传取全量,ULD 信息查询成功后按承运人重新加载并覆盖数据源 * @param carrier 承运人二字码(ULD 编号后两位);进入页面时不传取全量,ULD 信息查询成功后按承运人重新加载并覆盖数据源
* @param autoSelectFirst 查询结果不为空时是否自动选中第一项回填到板型输入框;仅 ULD 触发的按承运人查询传 true,进入页面的全量查询不自动选择
*/ */
fun loadBoardTypeList(carrier: String? = null) { fun loadBoardTypeList(carrier: String? = null, autoSelectFirst: Boolean = false) {
DictUtils.getBoardTypeList(carrier) { boardTypeList.value = it } DictUtils.getBoardTypeList(carrier) {
boardTypeList.value = it
if (autoSelectFirst && it.isNotEmpty()) onBoardTypeSelected(0)
}
} }
/** /**
@@ -472,7 +476,7 @@ class IntExpAssembleStartViewModel : BaseViewModel() {
// 按 ULD 编号后两位(承运人二字码)重新加载板型选项,覆盖下拉数据源 // 按 ULD 编号后两位(承运人二字码)重新加载板型选项,覆盖下拉数据源
val carrier = uldNo.trim().takeLast(2) val carrier = uldNo.trim().takeLast(2)
if (carrier.length == 2) loadBoardTypeList(carrier) if (carrier.length == 2) loadBoardTypeList(carrier, autoSelectFirst = true)
// 【新增】从ULD信息提取航班信息 // 【新增】从ULD信息提取航班信息
if (uldBean.fno.isNotEmpty() && uldBean.fdate.isNotEmpty()) { if (uldBean.fno.isNotEmpty() && uldBean.fdate.isNotEmpty()) {

View File

@@ -225,16 +225,26 @@ class IntExpStorageUseViewModel : BasePageViewModel() {
/** /**
* 执行出库操作 * 执行出库操作
* @param pc 出库件数
* @param weight 出库重量
* @param selectedStorageList 选中的子列表项(库位) * @param selectedStorageList 选中的子列表项(库位)
*/ */
fun performOutStorage(selectedStorageList: List<com.lukouguoji.module_base.bean.GjcStorageUse>) { fun performOutStorage(
pc: Long?,
weight: Double?,
selectedStorageList: List<com.lukouguoji.module_base.bean.GjcStorageUse>
) {
if (selectedStorageList.isEmpty()) { if (selectedStorageList.isEmpty()) {
showToast("请选择要出库的库位") showToast("请选择要出库的库位")
return return
} }
// 将选中的子列表项转换为RequestBody // 构建请求参数:出库件数 + 出库重量 + 选中的子列表项
val params = selectedStorageList.toRequestBody() val params = mapOf(
"pc" to pc,
"weight" to weight,
"storageUseList" to selectedStorageList
).toRequestBody()
launchLoadingCollect({ NetApply.api.outIntExpStorage(params) }) { launchLoadingCollect({ NetApply.api.outIntExpStorage(params) }) {
onSuccess = { onSuccess = {
@@ -261,11 +271,15 @@ class IntExpStorageUseViewModel : BasePageViewModel() {
* 执行入库操作 * 执行入库操作
* @param locationName 库位名称 (后端的location字段) * @param locationName 库位名称 (后端的location字段)
* @param locationId 库位ID (后端的locationId字段) * @param locationId 库位ID (后端的locationId字段)
* @param pc 入库件数
* @param weight 入库重量
* @param maWbListForInStorage 包含选中子列表项的主列表数据 * @param maWbListForInStorage 包含选中子列表项的主列表数据
*/ */
fun performInStorage( fun performInStorage(
locationName: String, locationName: String,
locationId: String, locationId: String,
pc: Long?,
weight: Double?,
maWbListForInStorage: List<GjcMaWb> maWbListForInStorage: List<GjcMaWb>
) { ) {
if (maWbListForInStorage.isEmpty()) { if (maWbListForInStorage.isEmpty()) {
@@ -278,10 +292,12 @@ class IntExpStorageUseViewModel : BasePageViewModel() {
return return
} }
// 构建请求参数:库位名称 + 库位ID + 完整的主子列表结构 // 构建请求参数:库位名称 + 库位ID + 入库件数 + 入库重量 + 完整的主子列表结构
val params = mapOf( val params = mapOf(
"location" to locationName, "location" to locationName,
"locationId" to locationId.toLongOrNull(), "locationId" to locationId.toLongOrNull(),
"pc" to pc,
"weight" to weight,
"maWbList" to maWbListForInStorage "maWbList" to maWbListForInStorage
).toRequestBody() ).toRequestBody()

View File

@@ -313,45 +313,7 @@
</LinearLayout> </LinearLayout>
<!-- 第6行:托盘数量、托盘自重(用于自动计算运抵重量) --> <!-- 第6行:运抵件数、运抵重量、运抵体积 -->
<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='@{"请输入托盘数量"}'
inputType="@{android.text.InputType.TYPE_CLASS_NUMBER}"
title='@{"托盘数量"}'
titleLength="@{5}"
type="@{DataLayoutType.INPUT}"
value='@={viewModel.trayNumber}'
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
hint='@{"请输入托盘自重"}'
inputType="@{android.text.InputType.TYPE_CLASS_NUMBER | android.text.InputType.TYPE_NUMBER_FLAG_DECIMAL}"
title='@{"托盘自重"}'
titleLength="@{5}"
type="@{DataLayoutType.INPUT}"
value='@={viewModel.trayWeight}'
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="15dp"
android:layout_weight="1" />
<View
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="15dp"
android:layout_weight="1" />
</LinearLayout>
<!-- 第7行:运抵件数、运抵重量、运抵体积 -->
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
@@ -394,7 +356,51 @@
</LinearLayout> </LinearLayout>
<!-- 第8行:平板车、平板车自重、业务类型 --> <!-- 第7行:托盘数量、托盘自重(用于自动计算运抵重量)、业务类型 -->
<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='@{"请输入托盘数量"}'
inputType="@{android.text.InputType.TYPE_CLASS_NUMBER}"
title='@{"托盘数量"}'
titleLength="@{5}"
type="@{DataLayoutType.INPUT}"
value='@={viewModel.trayNumber}'
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
hint='@{"请输入托盘自重"}'
inputType="@{android.text.InputType.TYPE_CLASS_NUMBER | android.text.InputType.TYPE_NUMBER_FLAG_DECIMAL}"
title='@{"托盘自重"}'
titleLength="@{5}"
type="@{DataLayoutType.INPUT}"
value='@={viewModel.trayWeight}'
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.businessTypeList}"
title='@{"业务类型"}'
titleLength="@{5}"
type="@{DataLayoutType.SPINNER}"
value='@={viewModel.maWbBean.businessType}'
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="15dp"
android:layout_weight="1" />
</LinearLayout>
<!-- 第8行:平板车、平板车自重、备注 -->
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
@@ -424,12 +430,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='@{"请选择业务类型"}' hint='@{"请输入备注"}'
list="@{viewModel.businessTypeList}" title='@{"备 注"}'
title='@{"业务类型"}'
titleLength="@{5}" titleLength="@{5}"
type="@{DataLayoutType.SPINNER}" type="@{DataLayoutType.INPUT}"
value='@={viewModel.maWbBean.businessType}' value='@={viewModel.pageRemark}'
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"
@@ -437,18 +442,6 @@
</LinearLayout> </LinearLayout>
<!-- 第9行:备注 -->
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
hint='@{"请输入备注"}'
inputHeight="@{80}"
title='@{"备 注"}'
titleLength="@{5}"
type="@{DataLayoutType.INPUT}"
value='@={viewModel.pageRemark}'
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp" />
</LinearLayout> </LinearLayout>
<!-- 底部操作栏 --> <!-- 底部操作栏 -->

View File

@@ -62,6 +62,60 @@
</LinearLayout> </LinearLayout>
<!-- 件数 -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
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" />
<com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayout
android:id="@+id/pc_input"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
type="@{SearchLayoutType.INPUT}"
hint='@{"请输入件数"}'
value="@={model.pc}" />
</LinearLayout>
<!-- 重量 -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
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" />
<com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayout
android:id="@+id/weight_input"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
type="@{SearchLayoutType.INPUT}"
hint='@{"请输入重量"}'
value="@={model.weight}" />
</LinearLayout>
</LinearLayout> </LinearLayout>
<!-- 底部按钮 --> <!-- 底部按钮 -->

View File

@@ -0,0 +1,123 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android">
<data>
<import type="com.lukouguoji.module_base.ui.weight.search.layout.SearchLayoutType"/>
<variable
name="model"
type="com.lukouguoji.gjc.dialog.IntExpOutStorageDialogModel" />
</data>
<LinearLayout
android:layout_width="480dp"
android:layout_height="wrap_content"
android:background="@drawable/bg_dialog_f2_radius_10"
android:gravity="center_horizontal"
android:orientation="vertical">
<!-- 标题栏 -->
<TextView
android:layout_width="match_parent"
android:layout_height="50dp"
android:background="@drawable/bg_primary_radius_top_10"
android:gravity="center"
android:text="出库操作"
android:textColor="@color/white"
android:textSize="18sp"
android:textStyle="bold" />
<!-- 表单内容 -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="30dp"
android:layout_marginTop="30dp"
android:orientation="vertical">
<!-- 提示 -->
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@{model.tip}"
android:textColor="@color/text_normal"
android:textSize="16sp" />
<!-- 件数 -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
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" />
<com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayout
android:id="@+id/pc_input"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
type="@{SearchLayoutType.INPUT}"
hint='@{"请输入件数"}'
value="@={model.pc}" />
</LinearLayout>
<!-- 重量 -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
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" />
<com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayout
android:id="@+id/weight_input"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
type="@{SearchLayoutType.INPUT}"
hint='@{"请输入重量"}'
value="@={model.weight}" />
</LinearLayout>
</LinearLayout>
<!-- 底部按钮 -->
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="40dp"
android:layout_marginBottom="20dp">
<TextView
style="@style/tv_bottom_btn"
android:onClick="@{()->model.dismiss()}"
android:text="取消" />
<TextView
style="@style/tv_bottom_btn"
android:onClick="@{()->model.onSaveClick()}"
android:text="确定" />
</LinearLayout>
</LinearLayout>
</layout>

View File

@@ -204,7 +204,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"
@@ -262,7 +262,7 @@
</LinearLayout> </LinearLayout>
<!-- 运抵状态 --> <!-- 运抵模式 -->
<LinearLayout <LinearLayout
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
@@ -274,7 +274,7 @@
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" />

View File

@@ -31,12 +31,12 @@
<!-- 选项 - 圆形checkbox --> <!-- 选项 - 圆形checkbox -->
<ImageView <ImageView
android:id="@+id/iv_checkbox" android:id="@+id/iv_checkbox"
loadImage="@{bean.checked.get() ? @drawable/radiobtn_checked_style : @drawable/radiobtn_unchecked_style}" loadImage="@{bean.checked.get() ? @drawable/img_check_all_checked : @drawable/img_check_all_unchecked}"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="20dp" android:layout_height="20dp"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:layout_weight="0.5" android:layout_weight="0.5"
android:src="@drawable/radiobtn_unchecked_style" /> android:src="@drawable/img_check_all_unchecked" />
<!-- 分单号 (前缀-编号-H编号) --> <!-- 分单号 (前缀-编号-H编号) -->
<TextView <TextView

View File

@@ -57,7 +57,7 @@
android:orientation="vertical" android:orientation="vertical"
android:layout_marginLeft="15dp"> android:layout_marginLeft="15dp">
<!-- 第一行:运单号、航班信息、航程、品名、重量 --> <!-- 第一行:运单号、航班信息、航程、件数、重量 -->
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
@@ -136,7 +136,7 @@
</LinearLayout> </LinearLayout>
<!-- 品名(英) --> <!-- 件数 -->
<LinearLayout <LinearLayout
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
@@ -147,16 +147,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="件数:"
android:textSize="15sp" android:textSize="15sp"
android:textColor="@color/text_normal" /> android:textColor="@color/text_normal" />
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:ellipsize="end" android:text="@{String.valueOf(bean.pc)}"
android:maxLines="1"
android:text="@{bean.goods}"
android:textSize="15sp" android:textSize="15sp"
android:textColor="@color/text_normal" /> android:textColor="@color/text_normal" />
@@ -188,7 +186,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"
@@ -219,7 +217,7 @@
</LinearLayout> </LinearLayout>
<!-- 件数 --> <!-- 品名(英) -->
<LinearLayout <LinearLayout
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
@@ -230,14 +228,16 @@
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:textSize="15sp" android:textSize="15sp"
android:textColor="@color/text_normal" /> android:textColor="@color/text_normal" />
<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:ellipsize="end"
android:maxLines="1"
android:text="@{bean.goods}"
android:textSize="15sp" android:textSize="15sp"
android:textColor="@color/text_normal" /> android:textColor="@color/text_normal" />
@@ -402,6 +402,26 @@
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.8"
android:gravity="center"
android:text="入库件数"
android:textColor="@color/text_normal"
android:textSize="14sp"
android:textStyle="bold" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.8"
android:gravity="center"
android:text="入库重量"
android:textColor="@color/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"
@@ -422,6 +442,26 @@
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.8"
android:gravity="center"
android:text="出库件数"
android:textColor="@color/text_normal"
android:textSize="14sp"
android:textStyle="bold" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.8"
android:gravity="center"
android:text="出库重量"
android:textColor="@color/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"

View File

@@ -33,8 +33,8 @@
android:layout_height="20dp" android:layout_height="20dp"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:layout_weight="0.5" android:layout_weight="0.5"
loadImage="@{bean.checked.get() ? @drawable/radiobtn_checked_style : @drawable/radiobtn_unchecked_style}" loadImage="@{bean.checked.get() ? @drawable/img_check_all_checked : @drawable/img_check_all_unchecked}"
android:src="@drawable/radiobtn_unchecked_style" /> android:src="@drawable/img_check_all_unchecked" />
<!-- 库位号 --> <!-- 库位号 -->
<TextView <TextView
@@ -47,6 +47,28 @@
android:textColor="@color/text_normal" android:textColor="@color/text_normal"
android:textSize="14sp" /> android:textSize="14sp" />
<!-- 入库件数 -->
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_weight="0.8"
android:gravity="center"
android:text="@{bean.inPcText}"
android:textColor="@color/text_normal"
android:textSize="14sp" />
<!-- 入库重量 -->
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_weight="0.8"
android:gravity="center"
android:text="@{bean.inWeightText}"
android:textColor="@color/text_normal"
android:textSize="14sp" />
<!-- 入库人 --> <!-- 入库人 -->
<TextView <TextView
android:layout_width="0dp" android:layout_width="0dp"
@@ -69,6 +91,28 @@
android:textColor="@color/text_normal" android:textColor="@color/text_normal"
android:textSize="14sp" /> android:textSize="14sp" />
<!-- 出库件数 -->
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_weight="0.8"
android:gravity="center"
android:text="@{bean.outPcText}"
android:textColor="@color/text_normal"
android:textSize="14sp" />
<!-- 出库重量 -->
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_weight="0.8"
android:gravity="center"
android:text="@{bean.outWeightText}"
android:textColor="@color/text_normal"
android:textSize="14sp" />
<!-- 出库人 --> <!-- 出库人 -->
<TextView <TextView
android:layout_width="0dp" android:layout_width="0dp"

View File

@@ -31,12 +31,12 @@
<!-- 选项 - 圆形checkbox --> <!-- 选项 - 圆形checkbox -->
<ImageView <ImageView
android:id="@+id/iv_checkbox" android:id="@+id/iv_checkbox"
loadImage="@{bean.checked.get() ? @drawable/radiobtn_checked_style : @drawable/radiobtn_unchecked_style}" loadImage="@{bean.checked.get() ? @drawable/img_check_all_checked : @drawable/img_check_all_unchecked}"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="20dp" android:layout_height="20dp"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:layout_weight="0.5" android:layout_weight="0.5"
android:src="@drawable/radiobtn_unchecked_style" /> android:src="@drawable/img_check_all_unchecked" />
<!-- 分单号 (前缀-编号-H编号) --> <!-- 分单号 (前缀-编号-H编号) -->
<TextView <TextView

View File

@@ -3,13 +3,13 @@ package com.lukouguoji.gjj.activity
import android.app.Activity import android.app.Activity
import android.content.Intent import android.content.Intent
import android.os.Bundle import android.os.Bundle
import com.lukouguoji.module_base.model.ConfirmDialogModel
import com.alibaba.android.arouter.facade.annotation.Route import com.alibaba.android.arouter.facade.annotation.Route
import com.lukouguoji.gjj.R import com.lukouguoji.gjj.R
import com.lukouguoji.gjj.databinding.ActivityIntImpStorageUseBinding import com.lukouguoji.gjj.databinding.ActivityIntImpStorageUseBinding
import com.lukouguoji.gjj.dialog.IntImpMoveClearDialogModel import com.lukouguoji.gjj.dialog.IntImpMoveClearDialogModel
import com.lukouguoji.gjj.dialog.IntImpModifyStorageDialogModel import com.lukouguoji.gjj.dialog.IntImpModifyStorageDialogModel
import com.lukouguoji.gjj.dialog.IntImpInStorageDialogModel import com.lukouguoji.gjj.dialog.IntImpInStorageDialogModel
import com.lukouguoji.gjj.dialog.IntImpOutStorageDialogModel
import com.lukouguoji.gjj.viewModel.IntImpStorageUseViewModel import com.lukouguoji.gjj.viewModel.IntImpStorageUseViewModel
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
@@ -141,11 +141,17 @@ class IntImpStorageUseActivity :
return return
} }
ConfirmDialogModel( // 显示出库对话框,件数/重量默认取选中库位的入库件数/重量
message = "是否确认出库?", IntImpOutStorageDialogModel(
title = "出库确认" storageCount = selectedStorageList.size,
) { defaultPc = selectedStorageList.mapNotNull { it.inPc }.takeIf { it.isNotEmpty() }?.sum(),
viewModel.performOutStorage(selectedStorageList) defaultWeight = selectedStorageList.mapNotNull { it.inWeight }.takeIf { it.isNotEmpty() }?.sum()
) { dialog ->
viewModel.performOutStorage(
dialog.pc.value?.toLongOrNull(),
dialog.weight.value?.toDoubleOrNull(),
selectedStorageList
)
}.show(this) }.show(this)
} }
@@ -176,10 +182,19 @@ class IntImpStorageUseActivity :
return return
} }
IntImpInStorageDialogModel { dialog -> // 显示入库对话框,件数/重量默认取选中运单的件数/重量
val locationName = dialog.locationName IntImpInStorageDialogModel(
val locationId = dialog.locationId showPcWeight = true,
viewModel.performInStorage(locationName, locationId, maWbListForInStorage) defaultPc = maWbListForInStorage.mapNotNull { it.pc }.takeIf { it.isNotEmpty() }?.sum(),
defaultWeight = maWbListForInStorage.mapNotNull { it.weight }.takeIf { it.isNotEmpty() }?.sum()
) { dialog ->
viewModel.performInStorage(
dialog.locationName,
dialog.locationId,
dialog.pc.value?.toLongOrNull(),
dialog.weight.value?.toDoubleOrNull(),
maWbListForInStorage
)
}.show(this) }.show(this)
} }

View File

@@ -26,7 +26,7 @@ class IntImpTallyActivity :
override fun viewModelClass() = IntImpTallyViewModel::class.java override fun viewModelClass() = IntImpTallyViewModel::class.java
override fun initOnCreate(savedInstanceState: Bundle?) { override fun initOnCreate(savedInstanceState: Bundle?) {
setBackArrow("国际进港理货报告") setBackArrow("国际进港理货")
binding.viewModel = viewModel binding.viewModel = viewModel
// 绑定分页 // 绑定分页

View File

@@ -1,6 +1,7 @@
package com.lukouguoji.gjj.dialog package com.lukouguoji.gjj.dialog
import android.content.Context import android.content.Context
import android.text.InputType
import androidx.lifecycle.MutableLiveData import androidx.lifecycle.MutableLiveData
import com.lukouguoji.gjj.R import com.lukouguoji.gjj.R
import com.lukouguoji.gjj.databinding.DialogIntImpInStorageBinding import com.lukouguoji.gjj.databinding.DialogIntImpInStorageBinding
@@ -8,13 +9,20 @@ import com.lukouguoji.module_base.base.BaseDialogModel
import com.lukouguoji.module_base.http.net.NetApply import com.lukouguoji.module_base.http.net.NetApply
import com.lukouguoji.module_base.ktx.launchCollect import com.lukouguoji.module_base.ktx.launchCollect
import com.lukouguoji.module_base.ktx.showToast import com.lukouguoji.module_base.ktx.showToast
import com.lukouguoji.module_base.ktx.toPlainText
import com.lukouguoji.module_base.ktx.verifyNullOrEmpty import com.lukouguoji.module_base.ktx.verifyNullOrEmpty
import dev.utils.app.info.KeyValue import dev.utils.app.info.KeyValue
/** /**
* 国际进港仓库 - 入库操作对话框 * 国际进港仓库 - 入库操作对话框
* @param showPcWeight 是否显示件数/重量输入(仓库页入库显示,装机单入库不显示)
* @param defaultPc 默认件数(选中运单的件数)
* @param defaultWeight 默认重量(选中运单的重量)
*/ */
class IntImpInStorageDialogModel( class IntImpInStorageDialogModel(
val showPcWeight: Boolean = false,
defaultPc: Long? = null,
defaultWeight: Double? = null,
private val callback: (IntImpInStorageDialogModel) -> Unit private val callback: (IntImpInStorageDialogModel) -> Unit
) : BaseDialogModel<DialogIntImpInStorageBinding>(DIALOG_TYPE_CENTER) { ) : BaseDialogModel<DialogIntImpInStorageBinding>(DIALOG_TYPE_CENTER) {
@@ -30,12 +38,20 @@ class IntImpInStorageDialogModel(
// 库位名称 (后端需要的name) // 库位名称 (后端需要的name)
var locationName: String = "" var locationName: String = ""
// 入库件数
val pc = MutableLiveData(defaultPc?.toString() ?: "")
// 入库重量
val weight = MutableLiveData(defaultWeight?.toPlainText() ?: "")
override fun layoutId(): Int { override fun layoutId(): Int {
return R.layout.dialog_int_imp_in_storage return R.layout.dialog_int_imp_in_storage
} }
override fun onDialogCreated(context: Context) { override fun onDialogCreated(context: Context) {
binding.model = this binding.model = this
binding.pcInput.et.inputType = InputType.TYPE_CLASS_NUMBER
binding.weightInput.et.inputType = InputType.TYPE_CLASS_NUMBER or InputType.TYPE_NUMBER_FLAG_DECIMAL
loadLocationList() loadLocationList()
// 监听选择变化,更新locationId和locationName // 监听选择变化,更新locationId和locationName
@@ -68,6 +84,16 @@ class IntImpInStorageDialogModel(
if (selectedLocationCode.value.verifyNullOrEmpty("请选择库位")) { if (selectedLocationCode.value.verifyNullOrEmpty("请选择库位")) {
return return
} }
if (showPcWeight) {
if (pc.value?.toLongOrNull() == null) {
showToast("请输入正确的件数")
return
}
if (weight.value?.toDoubleOrNull() == null) {
showToast("请输入正确的重量")
return
}
}
dismiss() dismiss()
callback(this) callback(this)
} }

View File

@@ -0,0 +1,58 @@
package com.lukouguoji.gjj.dialog
import android.content.Context
import android.text.InputType
import androidx.lifecycle.MutableLiveData
import com.lukouguoji.gjj.R
import com.lukouguoji.gjj.databinding.DialogIntImpOutStorageBinding
import com.lukouguoji.module_base.base.BaseDialogModel
import com.lukouguoji.module_base.ktx.showToast
import com.lukouguoji.module_base.ktx.toPlainText
/**
* 国际进港仓库 - 出库操作对话框
* @param storageCount 选中的库位数
* @param defaultPc 默认件数(选中库位的入库件数)
* @param defaultWeight 默认重量(选中库位的入库重量)
*/
class IntImpOutStorageDialogModel(
storageCount: Int,
defaultPc: Long?,
defaultWeight: Double?,
private val callback: (IntImpOutStorageDialogModel) -> Unit
) : BaseDialogModel<DialogIntImpOutStorageBinding>(DIALOG_TYPE_CENTER) {
val tip = "已选择 $storageCount 个库位执行出库操作"
// 出库件数
val pc = MutableLiveData(defaultPc?.toString() ?: "")
// 出库重量
val weight = MutableLiveData(defaultWeight?.toPlainText() ?: "")
override fun layoutId(): Int {
return R.layout.dialog_int_imp_out_storage
}
override fun onDialogCreated(context: Context) {
binding.model = this
binding.pcInput.et.inputType = InputType.TYPE_CLASS_NUMBER
binding.weightInput.et.inputType = InputType.TYPE_CLASS_NUMBER or InputType.TYPE_NUMBER_FLAG_DECIMAL
}
/**
* 确定按钮点击
*/
fun onSaveClick() {
if (pc.value?.toLongOrNull() == null) {
showToast("请输入正确的件数")
return
}
if (weight.value?.toDoubleOrNull() == null) {
showToast("请输入正确的重量")
return
}
dismiss()
callback(this)
}
}

View File

@@ -192,14 +192,20 @@ class IntImpStorageUseViewModel : BasePageViewModel() {
/** /**
* 执行出库操作 * 执行出库操作
* @param pc 出库件数
* @param weight 出库重量
*/ */
fun performOutStorage(storageUseList: List<GjcStorageUse>) { fun performOutStorage(pc: Long?, weight: Double?, storageUseList: List<GjcStorageUse>) {
if (storageUseList.isEmpty()) { if (storageUseList.isEmpty()) {
showToast("请选择要出库的库位") showToast("请选择要出库的库位")
return return
} }
val params = storageUseList.toRequestBody() val params = mapOf(
"pc" to pc,
"weight" to weight,
"storageUseList" to storageUseList
).toRequestBody()
launchLoadingCollect({ NetApply.api.outIntImpStorage(params) }) { launchLoadingCollect({ NetApply.api.outIntImpStorage(params) }) {
onSuccess = { onSuccess = {
@@ -221,10 +227,14 @@ class IntImpStorageUseViewModel : BasePageViewModel() {
/** /**
* 执行入库操作 * 执行入库操作
* @param pc 入库件数
* @param weight 入库重量
*/ */
fun performInStorage( fun performInStorage(
locationName: String, locationName: String,
locationId: String, locationId: String,
pc: Long?,
weight: Double?,
maWbListForInStorage: List<GjcMaWb> maWbListForInStorage: List<GjcMaWb>
) { ) {
if (maWbListForInStorage.isEmpty()) { if (maWbListForInStorage.isEmpty()) {
@@ -240,6 +250,8 @@ class IntImpStorageUseViewModel : BasePageViewModel() {
val body = mapOf( val body = mapOf(
"location" to locationName, "location" to locationName,
"locationId" to locationId.toLongOrNull(), "locationId" to locationId.toLongOrNull(),
"pc" to pc,
"weight" to weight,
"warehouseList" to maWbListForInStorage "warehouseList" to maWbListForInStorage
).toRequestBody() ).toRequestBody()

View File

@@ -62,6 +62,69 @@
</LinearLayout> </LinearLayout>
<!-- 件数/重量(仅仓库页入库显示) -->
<LinearLayout
visible="@{model.showPcWeight}"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<!-- 件数 -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
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" />
<com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayout
android:id="@+id/pc_input"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
type="@{SearchLayoutType.INPUT}"
hint='@{"请输入件数"}'
value="@={model.pc}" />
</LinearLayout>
<!-- 重量 -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
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" />
<com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayout
android:id="@+id/weight_input"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
type="@{SearchLayoutType.INPUT}"
hint='@{"请输入重量"}'
value="@={model.weight}" />
</LinearLayout>
</LinearLayout>
</LinearLayout> </LinearLayout>
<!-- 底部按钮 --> <!-- 底部按钮 -->

View File

@@ -0,0 +1,123 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android">
<data>
<import type="com.lukouguoji.module_base.ui.weight.search.layout.SearchLayoutType"/>
<variable
name="model"
type="com.lukouguoji.gjj.dialog.IntImpOutStorageDialogModel" />
</data>
<LinearLayout
android:layout_width="480dp"
android:layout_height="wrap_content"
android:background="@drawable/bg_dialog_f2_radius_10"
android:gravity="center_horizontal"
android:orientation="vertical">
<!-- 标题栏 -->
<TextView
android:layout_width="match_parent"
android:layout_height="50dp"
android:background="@drawable/bg_primary_radius_top_10"
android:gravity="center"
android:text="出库操作"
android:textColor="@color/white"
android:textSize="18sp"
android:textStyle="bold" />
<!-- 表单内容 -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="30dp"
android:layout_marginTop="30dp"
android:orientation="vertical">
<!-- 提示 -->
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@{model.tip}"
android:textColor="@color/text_normal"
android:textSize="16sp" />
<!-- 件数 -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
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" />
<com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayout
android:id="@+id/pc_input"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
type="@{SearchLayoutType.INPUT}"
hint='@{"请输入件数"}'
value="@={model.pc}" />
</LinearLayout>
<!-- 重量 -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
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" />
<com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayout
android:id="@+id/weight_input"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
type="@{SearchLayoutType.INPUT}"
hint='@{"请输入重量"}'
value="@={model.weight}" />
</LinearLayout>
</LinearLayout>
<!-- 底部按钮 -->
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="40dp"
android:layout_marginBottom="20dp">
<TextView
style="@style/tv_bottom_btn"
android:onClick="@{()->model.dismiss()}"
android:text="取消" />
<TextView
style="@style/tv_bottom_btn"
android:onClick="@{()->model.onSaveClick()}"
android:text="确定" />
</LinearLayout>
</LinearLayout>
</layout>

View File

@@ -32,8 +32,8 @@
android:layout_height="20dp" android:layout_height="20dp"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:layout_weight="0.5" android:layout_weight="0.5"
loadImage="@{bean.checked.get() ? @drawable/radiobtn_checked_style : @drawable/radiobtn_unchecked_style}" loadImage="@{bean.checked.get() ? @drawable/img_check_all_checked : @drawable/img_check_all_unchecked}"
android:src="@drawable/radiobtn_unchecked_style" /> android:src="@drawable/img_check_all_unchecked" />
<!-- 分单号 --> <!-- 分单号 -->
<TextView <TextView

View File

@@ -64,7 +64,7 @@
<androidx.appcompat.widget.LinearLayoutCompat <androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1.2" android:layout_weight="1.1"
android:gravity="center_vertical"> android:gravity="center_vertical">
<TextView <TextView
@@ -88,7 +88,7 @@
<androidx.appcompat.widget.LinearLayoutCompat <androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="0.7" android:layout_weight="0.75"
android:gravity="center_vertical"> android:gravity="center_vertical">
<TextView <TextView
@@ -112,7 +112,7 @@
<androidx.appcompat.widget.LinearLayoutCompat <androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="0.8" android:layout_weight="1.0"
android:gravity="center_vertical"> android:gravity="center_vertical">
<TextView <TextView
@@ -160,7 +160,7 @@
<androidx.appcompat.widget.LinearLayoutCompat <androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1.2" android:layout_weight="1.15"
android:gravity="center_vertical"> android:gravity="center_vertical">
<TextView <TextView
@@ -194,7 +194,7 @@
<androidx.appcompat.widget.LinearLayoutCompat <androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1.2" android:layout_weight="1.1"
android:gravity="center_vertical"> android:gravity="center_vertical">
<TextView <TextView
@@ -218,7 +218,7 @@
<androidx.appcompat.widget.LinearLayoutCompat <androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="0.7" android:layout_weight="0.75"
android:gravity="center_vertical"> android:gravity="center_vertical">
<TextView <TextView
@@ -242,7 +242,7 @@
<androidx.appcompat.widget.LinearLayoutCompat <androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="0.8" android:layout_weight="1.0"
android:gravity="center_vertical"> android:gravity="center_vertical">
<TextView <TextView
@@ -290,7 +290,7 @@
<androidx.appcompat.widget.LinearLayoutCompat <androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1.2" android:layout_weight="1.15"
android:gravity="center_vertical"> android:gravity="center_vertical">
<TextView <TextView

View File

@@ -35,8 +35,8 @@
android:layout_height="20dp" android:layout_height="20dp"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:layout_weight="0.5" android:layout_weight="0.5"
loadImage="@{bean.checked.get() ? @drawable/radiobtn_checked_style : @drawable/radiobtn_unchecked_style}" loadImage="@{bean.checked.get() ? @drawable/img_check_all_checked : @drawable/img_check_all_unchecked}"
android:src="@drawable/radiobtn_unchecked_style" /> android:src="@drawable/img_check_all_unchecked" />
<!-- 运单号 --> <!-- 运单号 -->
<TextView <TextView

View File

@@ -415,6 +415,26 @@
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.8"
android:gravity="center"
android:text="入库件数"
android:textColor="@color/text_normal"
android:textSize="14sp"
android:textStyle="bold" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.8"
android:gravity="center"
android:text="入库重量"
android:textColor="@color/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"
@@ -435,6 +455,26 @@
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.8"
android:gravity="center"
android:text="出库件数"
android:textColor="@color/text_normal"
android:textSize="14sp"
android:textStyle="bold" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.8"
android:gravity="center"
android:text="出库重量"
android:textColor="@color/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"

View File

@@ -33,8 +33,8 @@
android:layout_height="20dp" android:layout_height="20dp"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:layout_weight="0.5" android:layout_weight="0.5"
loadImage="@{bean.checked.get() ? @drawable/radiobtn_checked_style : @drawable/radiobtn_unchecked_style}" loadImage="@{bean.checked.get() ? @drawable/img_check_all_checked : @drawable/img_check_all_unchecked}"
android:src="@drawable/radiobtn_unchecked_style" /> android:src="@drawable/img_check_all_unchecked" />
<!-- 库位号 --> <!-- 库位号 -->
<TextView <TextView
@@ -47,6 +47,28 @@
android:textColor="@color/text_normal" android:textColor="@color/text_normal"
android:textSize="14sp" /> android:textSize="14sp" />
<!-- 入库件数 -->
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_weight="0.8"
android:gravity="center"
android:text="@{bean.inPcText}"
android:textColor="@color/text_normal"
android:textSize="14sp" />
<!-- 入库重量 -->
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_weight="0.8"
android:gravity="center"
android:text="@{bean.inWeightText}"
android:textColor="@color/text_normal"
android:textSize="14sp" />
<!-- 入库人 --> <!-- 入库人 -->
<TextView <TextView
android:layout_width="0dp" android:layout_width="0dp"
@@ -69,6 +91,28 @@
android:textColor="@color/text_normal" android:textColor="@color/text_normal"
android:textSize="14sp" /> android:textSize="14sp" />
<!-- 出库件数 -->
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_weight="0.8"
android:gravity="center"
android:text="@{bean.outPcText}"
android:textColor="@color/text_normal"
android:textSize="14sp" />
<!-- 出库重量 -->
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_weight="0.8"
android:gravity="center"
android:text="@{bean.outWeightText}"
android:textColor="@color/text_normal"
android:textSize="14sp" />
<!-- 出库人 --> <!-- 出库人 -->
<TextView <TextView
android:layout_width="0dp" android:layout_width="0dp"

View File

@@ -35,8 +35,8 @@
android:layout_height="20dp" android:layout_height="20dp"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:layout_weight="0.5" android:layout_weight="0.5"
loadImage="@{bean.checked.get() ? @drawable/radiobtn_checked_style : @drawable/radiobtn_unchecked_style}" loadImage="@{bean.checked.get() ? @drawable/img_check_all_checked : @drawable/img_check_all_unchecked}"
android:src="@drawable/radiobtn_unchecked_style" /> android:src="@drawable/img_check_all_unchecked" />
<!-- 分单号 --> <!-- 分单号 -->
<TextView <TextView