Compare commits
54 Commits
fada4b3231
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 5981a60d68 | |||
| 9ed6a4e494 | |||
| 26e7c040b3 | |||
| b2daabe2ab | |||
| de69eeefd8 | |||
| 56090e5092 | |||
| 59138535da | |||
| c7bf51bd9a | |||
| d2a0648238 | |||
| 0ae77ffbf8 | |||
| 78238907b0 | |||
| 5e1ccc9e8a | |||
| 89d4812d9f | |||
| 8af644288d | |||
| 9363717224 | |||
| df5fa2ea74 | |||
| 3c413833cf | |||
| 072df758db | |||
| 6c4e97945b | |||
| a663609eeb | |||
| 74e9f5a827 | |||
| d6f72186a3 | |||
| b2ea79512c | |||
| 8b666364ae | |||
| aac2c860c6 | |||
| c2b5e74156 | |||
| 093314d601 | |||
| 9b089d51b1 | |||
| 8ced5be7a9 | |||
| da50aa9794 | |||
| 47cef6ee59 | |||
| baaa9c5615 | |||
| edb1f576b7 | |||
| 8b0043d2f5 | |||
| 5ccb971c61 | |||
| 6278d9738d | |||
| 0b25e9c68c | |||
| a4095d6e72 | |||
| d31e78ff49 | |||
| 43b1b6f44f | |||
| f4d5904003 | |||
| 4b3c31252b | |||
| f61302a1f6 | |||
| a64b963d03 | |||
| 634dd96ac6 | |||
| 93939ed411 | |||
| 06d0244e24 | |||
| f04cf81ff2 | |||
| d31a408ddc | |||
| ce080f04a7 | |||
| 5a9dd6f97a | |||
| 8c774ef3a3 | |||
| af49cf4fb6 | |||
| 76f55597db |
@@ -72,7 +72,44 @@
|
|||||||
"mcp__apifox__refresh_project_oas_ukz3j4",
|
"mcp__apifox__refresh_project_oas_ukz3j4",
|
||||||
"mcp__playwright__browser_click",
|
"mcp__playwright__browser_click",
|
||||||
"mcp__playwright__browser_take_screenshot",
|
"mcp__playwright__browser_take_screenshot",
|
||||||
"mcp__playwright__browser_snapshot"
|
"mcp__playwright__browser_snapshot",
|
||||||
|
"Bash(/tmp/communicate_type_findings.md:*)",
|
||||||
|
"Read(//tmp/**)",
|
||||||
|
"mcp__apifox__read_project_oas_3gn3lx",
|
||||||
|
"mcp__apifox__read_project_oas_ref_resources_3gn3lx",
|
||||||
|
"mcp__apifox__refresh_project_oas_3gn3lx",
|
||||||
|
"Bash(cp \"/var/folders/qz/qk20ny650h1fhmxrx46gdfhr0000gn/T/images/Warp 2026-03-13 09.54.13.tiff\" /tmp/screenshot.png)",
|
||||||
|
"Read(//private/var/folders/qz/qk20ny650h1fhmxrx46gdfhr0000gn/T/images/**)",
|
||||||
|
"mcp__apifox__read_project_oas_2s2uhx",
|
||||||
|
"mcp__apifox__read_project_oas_ref_resources_2s2uhx",
|
||||||
|
"mcp__apifox__refresh_project_oas_2s2uhx",
|
||||||
|
"Bash(find /Users/kid/Development/Fusion/Projects/aerologic-app -path \"*/build\" -prune -o -type f \\\\\\( -name \"*manifest*\" -o -name \"*bean*\" \\\\\\) | grep -i \"gjj\\\\|tally\" | grep -E \"\\\\.\\(kt\\)$\" | sort)",
|
||||||
|
"mcp__apifox__read_project_oas_9otrai",
|
||||||
|
"mcp__apifox__read_project_oas_ref_resources_9otrai",
|
||||||
|
"Bash(cd:*)",
|
||||||
|
"mcp__apifox__read_project_oas_tua249",
|
||||||
|
"mcp__apifox__read_project_oas_ref_resources_tua249",
|
||||||
|
"mcp__apifox__read_project_oas_heib77",
|
||||||
|
"mcp__apifox__read_project_oas_ref_resources_heib77",
|
||||||
|
"Bash(export JAVA_HOME=\"/Applications/Android Studio.app/Contents/jbr/Contents/Home\")",
|
||||||
|
"Bash(export PATH=\"$JAVA_HOME/bin:$PATH\")",
|
||||||
|
"Read(//Library/Java/JavaVirtualMachines/**)",
|
||||||
|
"Read(//usr/local/**)",
|
||||||
|
"Read(//opt/homebrew/opt/**)",
|
||||||
|
"Bash(/Users/kid/.vfox/sdks/java/bin/java -version 2>&1)",
|
||||||
|
"Bash(export JAVA_HOME=/Users/kid/.vfox/sdks/java)",
|
||||||
|
"mcp__apifox__read_project_oas_kcl8s7",
|
||||||
|
"mcp__apifox__refresh_project_oas_kcl8s7",
|
||||||
|
"mcp__apifox__read_project_oas_ref_resources_kcl8s7",
|
||||||
|
"mcp__apifox__read_project_oas_x3v6fh",
|
||||||
|
"mcp__apifox__read_project_oas_ref_resources_x3v6fh",
|
||||||
|
"mcp__plugin_claude-mem_mcp-search__smart_outline",
|
||||||
|
"Bash(find /Users/kid/Development/Fusion/Projects/aerologic-app/module_gjj/src/main -type f \\\\\\(-name *IntImpAccidentVisa* -o -name *AccidentVisa* \\\\\\))",
|
||||||
|
"mcp__apifox__read_project_oas_g3xqex",
|
||||||
|
"mcp__apifox__read_project_oas_ref_resources_g3xqex",
|
||||||
|
"mcp__apifox__refresh_project_oas_g3xqex",
|
||||||
|
"mcp__apifox__read_project_oas_4h0w3b",
|
||||||
|
"mcp__apifox__read_project_oas_ref_resources_4h0w3b"
|
||||||
],
|
],
|
||||||
"deny": [],
|
"deny": [],
|
||||||
"ask": []
|
"ask": []
|
||||||
|
|||||||
2
.gitignore
vendored
2
.gitignore
vendored
@@ -192,6 +192,7 @@ fabric.properties
|
|||||||
|
|
||||||
# End of https://www.toptal.com/developers/gitignore/api/androidstudio,gradle,java,kotlin
|
# End of https://www.toptal.com/developers/gitignore/api/androidstudio,gradle,java,kotlin
|
||||||
.vfox/
|
.vfox/
|
||||||
|
.vfox/sdks/java
|
||||||
|
|
||||||
# Auto Claude data directory
|
# Auto Claude data directory
|
||||||
.auto-claude/
|
.auto-claude/
|
||||||
@@ -203,3 +204,4 @@ fabric.properties
|
|||||||
.worktrees/
|
.worktrees/
|
||||||
.security-key
|
.security-key
|
||||||
logs/security/
|
logs/security/
|
||||||
|
.playwright-mcp/
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 106 KiB |
@@ -1,2 +1,2 @@
|
|||||||
[tools]
|
[tools]
|
||||||
java = "17.0.17+10-amzn"
|
java = "17+35-amzn"
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
/Users/kid/.version-fox/cache/java/v-17.0.17+10-amzn/java-17.0.17+10-amzn
|
|
||||||
23
CLAUDE.md
23
CLAUDE.md
@@ -124,11 +124,12 @@ class XxxViewModel : BasePageViewModel() {
|
|||||||
<LinearLayout orientation="vertical">
|
<LinearLayout orientation="vertical">
|
||||||
<include layout="@layout/title_tool_bar" />
|
<include layout="@layout/title_tool_bar" />
|
||||||
|
|
||||||
<!-- 搜索区:PadSearchLayout 横排 -->
|
<!-- 搜索区:PadSearchLayout 横排 + 操作按钮(如有) -->
|
||||||
<LinearLayout orientation="horizontal">
|
<LinearLayout orientation="horizontal">
|
||||||
<PadSearchLayout type="@{SearchLayoutType.DATE}" value="@={viewModel.flightDate}" />
|
<PadSearchLayout type="@{SearchLayoutType.DATE}" value="@={viewModel.flightDate}" />
|
||||||
<PadSearchLayout type="@{SearchLayoutType.INPUT}" value="@={viewModel.flightNo}" />
|
<PadSearchLayout type="@{SearchLayoutType.INPUT}" value="@={viewModel.flightNo}" />
|
||||||
<ImageView style="@style/iv_search_action" android:onClick="@{()-> viewModel.searchClick()}" />
|
<ImageView style="@style/iv_search_action" android:onClick="@{()-> viewModel.searchClick()}" />
|
||||||
|
<!-- 如需新增/删除按钮,尺寸规范见「开发原则」工具栏图标尺寸规范 -->
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<!-- 分页列表 -->
|
<!-- 分页列表 -->
|
||||||
@@ -382,6 +383,25 @@ fun toggleAllExpand() {
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
4. **子列表项 checkbox 样式**(必须使用 `_style` 系列,禁止使用 `_gray` 系列):
|
||||||
|
```xml
|
||||||
|
<!-- 子列表项 item_xxx_sub.xml 中的 iv_checkbox -->
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/iv_checkbox"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="20dp"
|
||||||
|
android:layout_gravity="center_vertical"
|
||||||
|
android:layout_weight="0.5"
|
||||||
|
loadImage="@{bean.checked.get() ? @drawable/radiobtn_checked_style : @drawable/radiobtn_unchecked_style}"
|
||||||
|
android:src="@drawable/radiobtn_unchecked_style" />
|
||||||
|
```
|
||||||
|
|
||||||
|
| 资源 | 含义 | 外观 |
|
||||||
|
|------|------|------|
|
||||||
|
| `radiobtn_checked_style` | 选中 | colorPrimary 蓝色实心圆 + 白色内环 |
|
||||||
|
| `radiobtn_unchecked_style` | 未选中 | 透明 + 黑色边框圆 |
|
||||||
|
| ~~`radiobtn_checked_gray`~~ | ❌ 禁用 | 灰色实心圆(错误样式) |
|
||||||
|
|
||||||
**参考文件**: `module_gjc/.../IntExpStorageUseActivity.kt`、`IntExpStorageUseViewModel.kt`
|
**参考文件**: `module_gjc/.../IntExpStorageUseActivity.kt`、`IntExpStorageUseViewModel.kt`
|
||||||
|
|
||||||
---
|
---
|
||||||
@@ -842,6 +862,7 @@ companion object {
|
|||||||
- 标题栏统一用 `title_tool_bar` — 禁止手动编写 Toolbar
|
- 标题栏统一用 `title_tool_bar` — 禁止手动编写 Toolbar
|
||||||
- 优先使用 PadDataLayoutNew 和 PadSearchLayout 组件
|
- 优先使用 PadDataLayoutNew 和 PadSearchLayout 组件
|
||||||
- 在每个页面布局时,如有截图,务必尽可能还原图片上的页面设计,而不是推测假想。如有困难一律要询问,禁止自己想象
|
- 在每个页面布局时,如有截图,务必尽可能还原图片上的页面设计,而不是推测假想。如有困难一律要询问,禁止自己想象
|
||||||
|
- 工具栏图标尺寸规范: `img_search` 36dp + padding 2dp;`img_add` 40dp 无 padding(使用 `drawable/img_add.xml` 矢量图,`drawable-xhdpi/img_add.png` 已废弃删除)
|
||||||
- 常用资源: `bg_white_radius_8`、`colorPrimary`、`text_normal`、`text_gray`、`color_bottom_layout`
|
- 常用资源: `bg_white_radius_8`、`colorPrimary`、`text_normal`、`text_gray`、`color_bottom_layout`
|
||||||
|
|
||||||
### 环境配置
|
### 环境配置
|
||||||
|
|||||||
@@ -425,6 +425,20 @@
|
|||||||
android:exported="false"
|
android:exported="false"
|
||||||
android:screenOrientation="userLandscape" />
|
android:screenOrientation="userLandscape" />
|
||||||
|
|
||||||
|
<!-- 国际进港-进港舱单分单编辑 -->
|
||||||
|
<activity
|
||||||
|
android:name="com.lukouguoji.gjj.activity.IntImpManifestSubEditActivity"
|
||||||
|
android:configChanges="orientation|keyboardHidden"
|
||||||
|
android:exported="false"
|
||||||
|
android:screenOrientation="userLandscape" />
|
||||||
|
|
||||||
|
<!-- 国际进港-进港舱单详情 -->
|
||||||
|
<activity
|
||||||
|
android:name="com.lukouguoji.gjj.activity.IntImpManifestDetailsActivity"
|
||||||
|
android:configChanges="orientation|keyboardHidden"
|
||||||
|
android:exported="false"
|
||||||
|
android:screenOrientation="userLandscape" />
|
||||||
|
|
||||||
<!-- 国际进港-装机单(分拣理货) -->
|
<!-- 国际进港-装机单(分拣理货) -->
|
||||||
<activity
|
<activity
|
||||||
android:name="com.lukouguoji.gjj.activity.IntImpLoadingListActivity"
|
android:name="com.lukouguoji.gjj.activity.IntImpLoadingListActivity"
|
||||||
@@ -432,6 +446,13 @@
|
|||||||
android:exported="false"
|
android:exported="false"
|
||||||
android:screenOrientation="userLandscape" />
|
android:screenOrientation="userLandscape" />
|
||||||
|
|
||||||
|
<!-- 国际进港-装机单编辑 -->
|
||||||
|
<activity
|
||||||
|
android:name="com.lukouguoji.gjj.activity.IntImpLoadingListEditActivity"
|
||||||
|
android:configChanges="orientation|keyboardHidden"
|
||||||
|
android:exported="false"
|
||||||
|
android:screenOrientation="userLandscape" />
|
||||||
|
|
||||||
<!-- 国际进港-理货报告 -->
|
<!-- 国际进港-理货报告 -->
|
||||||
<activity
|
<activity
|
||||||
android:name="com.lukouguoji.gjj.activity.IntImpTallyActivity"
|
android:name="com.lukouguoji.gjj.activity.IntImpTallyActivity"
|
||||||
@@ -439,6 +460,12 @@
|
|||||||
android:exported="false"
|
android:exported="false"
|
||||||
android:screenOrientation="userLandscape" />
|
android:screenOrientation="userLandscape" />
|
||||||
|
|
||||||
|
<activity
|
||||||
|
android:name="com.lukouguoji.gjj.activity.IntImpTallyDetailsActivity"
|
||||||
|
android:configChanges="orientation|keyboardHidden"
|
||||||
|
android:exported="false"
|
||||||
|
android:screenOrientation="userLandscape" />
|
||||||
|
|
||||||
<!-- 国际进港-仓库 -->
|
<!-- 国际进港-仓库 -->
|
||||||
<activity
|
<activity
|
||||||
android:name="com.lukouguoji.gjj.activity.IntImpStorageUseActivity"
|
android:name="com.lukouguoji.gjj.activity.IntImpStorageUseActivity"
|
||||||
@@ -460,6 +487,13 @@
|
|||||||
android:exported="false"
|
android:exported="false"
|
||||||
android:screenOrientation="userLandscape" />
|
android:screenOrientation="userLandscape" />
|
||||||
|
|
||||||
|
<!-- 国际进港-费用修改 -->
|
||||||
|
<activity
|
||||||
|
android:name="com.lukouguoji.gjj.activity.IntImpPickUpChargeEditActivity"
|
||||||
|
android:configChanges="orientation|keyboardHidden"
|
||||||
|
android:exported="false"
|
||||||
|
android:screenOrientation="userLandscape" />
|
||||||
|
|
||||||
<!-- 国际进港-提取出库 -->
|
<!-- 国际进港-提取出库 -->
|
||||||
<activity
|
<activity
|
||||||
android:name="com.lukouguoji.gjj.activity.IntImpPickUpDLVActivity"
|
android:name="com.lukouguoji.gjj.activity.IntImpPickUpDLVActivity"
|
||||||
@@ -474,6 +508,20 @@
|
|||||||
android:exported="false"
|
android:exported="false"
|
||||||
android:screenOrientation="userLandscape" />
|
android:screenOrientation="userLandscape" />
|
||||||
|
|
||||||
|
<!-- 国际进港-查询详情 -->
|
||||||
|
<activity
|
||||||
|
android:name="com.lukouguoji.gjj.activity.IntImpQueryDetailsActivity"
|
||||||
|
android:configChanges="orientation|keyboardHidden"
|
||||||
|
android:exported="false"
|
||||||
|
android:screenOrientation="userLandscape" />
|
||||||
|
|
||||||
|
<!-- 国际进港-运单修改 -->
|
||||||
|
<activity
|
||||||
|
android:name="com.lukouguoji.gjj.activity.IntImpQueryEditActivity"
|
||||||
|
android:configChanges="orientation|keyboardHidden"
|
||||||
|
android:exported="false"
|
||||||
|
android:screenOrientation="userLandscape" />
|
||||||
|
|
||||||
<!-- 国际进港-事故签证 -->
|
<!-- 国际进港-事故签证 -->
|
||||||
<activity
|
<activity
|
||||||
android:name="com.lukouguoji.gjj.activity.IntImpAccidentVisaActivity"
|
android:name="com.lukouguoji.gjj.activity.IntImpAccidentVisaActivity"
|
||||||
@@ -481,6 +529,12 @@
|
|||||||
android:exported="false"
|
android:exported="false"
|
||||||
android:screenOrientation="userLandscape" />
|
android:screenOrientation="userLandscape" />
|
||||||
|
|
||||||
|
<activity
|
||||||
|
android:name="com.lukouguoji.gjj.activity.IntImpAccidentVisaEditActivity"
|
||||||
|
android:configChanges="orientation|keyboardHidden"
|
||||||
|
android:exported="false"
|
||||||
|
android:screenOrientation="userLandscape" />
|
||||||
|
|
||||||
<service android:name="com.huitao.printer.service.PrinterService" />
|
<service android:name="com.huitao.printer.service.PrinterService" />
|
||||||
<service android:name="com.lukouguoji.gnc.bluetooth.service.AncillaryService" />
|
<service android:name="com.lukouguoji.gnc.bluetooth.service.AncillaryService" />
|
||||||
<service android:name="com.lukouguoji.gnc.bluetooth.service.MyService" />
|
<service android:name="com.lukouguoji.gnc.bluetooth.service.MyService" />
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ class FlightQueryListViewModel : BasePageViewModel() {
|
|||||||
val serviceType = MutableLiveData("")
|
val serviceType = MutableLiveData("")
|
||||||
|
|
||||||
val addressTypeList = MutableLiveData(listOf(KeyValue("全部", ""))).apply {
|
val addressTypeList = MutableLiveData(listOf(KeyValue("全部", ""))).apply {
|
||||||
DictUtils.getAreaTypeList {
|
DictUtils.getCountryTypeList {
|
||||||
value = it
|
value = it
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,10 +38,10 @@ class LogDetailActivity : BaseBindingActivity<ActivityLogDetailBinding, LogDetai
|
|||||||
// 配置操作详情 RecyclerView(垂直时间线)
|
// 配置操作详情 RecyclerView(垂直时间线)
|
||||||
binding.rvTimeline.adapter = timelineAdapter
|
binding.rvTimeline.adapter = timelineAdapter
|
||||||
|
|
||||||
// 观察流转状态变化,程序化构建步骤进度条
|
// 观察数据变化,重新构建步骤进度条
|
||||||
viewModel.currentStepIndex.observe(this) { index ->
|
viewModel.allSteps.observe(this) { rebuildSteps() }
|
||||||
buildStepProgressBar(viewModel.allSteps, index)
|
viewModel.activeStepCodes.observe(this) { rebuildSteps() }
|
||||||
}
|
viewModel.latestStepCode.observe(this) { rebuildSteps() }
|
||||||
|
|
||||||
viewModel.statusLogList.observe(this) { list ->
|
viewModel.statusLogList.observe(this) { list ->
|
||||||
timelineAdapter.setData(list)
|
timelineAdapter.setData(list)
|
||||||
@@ -50,7 +50,19 @@ class LogDetailActivity : BaseBindingActivity<ActivityLogDetailBinding, LogDetai
|
|||||||
viewModel.initOnCreated(intent)
|
viewModel.initOnCreated(intent)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun buildStepProgressBar(steps: List<String>, currentIndex: Int) {
|
private fun rebuildSteps() {
|
||||||
|
val steps = viewModel.allSteps.value ?: return
|
||||||
|
val activeCodes = viewModel.activeStepCodes.value ?: emptySet()
|
||||||
|
val latestCode = viewModel.latestStepCode.value ?: ""
|
||||||
|
if (steps.isEmpty()) return
|
||||||
|
buildStepProgressBar(steps, activeCodes, latestCode)
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun buildStepProgressBar(
|
||||||
|
steps: List<StepInfo>,
|
||||||
|
activeCodes: Set<String>,
|
||||||
|
latestCode: String
|
||||||
|
) {
|
||||||
val container = binding.llSteps
|
val container = binding.llSteps
|
||||||
container.removeAllViews()
|
container.removeAllViews()
|
||||||
|
|
||||||
@@ -60,30 +72,38 @@ class LogDetailActivity : BaseBindingActivity<ActivityLogDetailBinding, LogDetai
|
|||||||
val dotSize = dp(10)
|
val dotSize = dp(10)
|
||||||
val lineHeight = dp(2)
|
val lineHeight = dp(2)
|
||||||
|
|
||||||
|
// 计算每个节点宽度:屏幕宽度的 80% 均分给所有节点
|
||||||
|
val screenWidth = resources!!.displayMetrics.widthPixels
|
||||||
|
val stepWidth = (screenWidth * 0.8 / steps.size).toInt()
|
||||||
|
|
||||||
|
// 找到最新节点在步骤列表中的索引
|
||||||
|
val latestIndex = steps.indexOfFirst { it.code == latestCode }
|
||||||
|
|
||||||
for (i in steps.indices) {
|
for (i in steps.indices) {
|
||||||
val isCompleted = i <= currentIndex
|
val step = steps[i]
|
||||||
val isCurrent = i == currentIndex
|
val isActive = step.code in activeCodes
|
||||||
|
val isLatest = step.code == latestCode
|
||||||
val isFirst = i == 0
|
val isFirst = i == 0
|
||||||
val isLast = i == steps.size - 1
|
val isLast = i == steps.size - 1
|
||||||
|
|
||||||
// 每个步骤的根容器(等宽)
|
// 每个步骤的根容器
|
||||||
val stepLayout = LinearLayout(this).apply {
|
val stepLayout = LinearLayout(this).apply {
|
||||||
orientation = LinearLayout.VERTICAL
|
orientation = LinearLayout.VERTICAL
|
||||||
gravity = Gravity.CENTER_HORIZONTAL
|
gravity = Gravity.CENTER_HORIZONTAL
|
||||||
layoutParams = LinearLayout.LayoutParams(0, LinearLayout.LayoutParams.WRAP_CONTENT, 1f)
|
layoutParams = LinearLayout.LayoutParams(stepWidth, LinearLayout.LayoutParams.WRAP_CONTENT)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 步骤名称(所有步骤统一 padding 确保高度一致)
|
// 步骤名称(所有步骤统一 padding 确保高度一致)
|
||||||
val tvName = TextView(this).apply {
|
val tvName = TextView(this).apply {
|
||||||
text = steps[i]
|
text = step.name
|
||||||
setTextSize(TypedValue.COMPLEX_UNIT_SP, 13f)
|
setTextSize(TypedValue.COMPLEX_UNIT_SP, 13f)
|
||||||
gravity = Gravity.CENTER
|
gravity = Gravity.CENTER
|
||||||
setPadding(dp(6), dp(2), dp(6), dp(2))
|
setPadding(dp(6), dp(2), dp(6), dp(2))
|
||||||
if (isCurrent) {
|
if (isLatest) {
|
||||||
setBackgroundResource(R.drawable.bg_step_current_badge)
|
setBackgroundResource(R.drawable.bg_step_current_badge)
|
||||||
setTextColor(0xFFFFFFFF.toInt())
|
setTextColor(0xFFFFFFFF.toInt())
|
||||||
} else {
|
} else {
|
||||||
setTextColor(if (isCompleted) 0xFF333333.toInt() else 0xFF999999.toInt())
|
setTextColor(if (isActive) 0xFF333333.toInt() else 0xFF999999.toInt())
|
||||||
}
|
}
|
||||||
layoutParams = LinearLayout.LayoutParams(
|
layoutParams = LinearLayout.LayoutParams(
|
||||||
LinearLayout.LayoutParams.WRAP_CONTENT,
|
LinearLayout.LayoutParams.WRAP_CONTENT,
|
||||||
@@ -99,10 +119,12 @@ class LogDetailActivity : BaseBindingActivity<ActivityLogDetailBinding, LogDetai
|
|||||||
).apply { topMargin = dp(8) }
|
).apply { topMargin = dp(8) }
|
||||||
}
|
}
|
||||||
|
|
||||||
// 左半连线(从左边缘到中心,略超过中心以避免断层)
|
// 左半连线(从左边缘到中心)
|
||||||
if (!isFirst) {
|
if (!isFirst) {
|
||||||
|
// 如果当前节点索引 <= latestIndex,左半线为蓝色;否则为浅灰色
|
||||||
|
val leftLineColor = if (latestIndex >= 0 && i <= latestIndex) colorBlue else colorGray
|
||||||
val lineLeft = View(this).apply {
|
val lineLeft = View(this).apply {
|
||||||
setBackgroundColor(if (isCompleted) colorBlue else colorGray)
|
setBackgroundColor(leftLineColor)
|
||||||
layoutParams = FrameLayout.LayoutParams(0, lineHeight).apply {
|
layoutParams = FrameLayout.LayoutParams(0, lineHeight).apply {
|
||||||
gravity = Gravity.CENTER_VERTICAL or Gravity.START
|
gravity = Gravity.CENTER_VERTICAL or Gravity.START
|
||||||
}
|
}
|
||||||
@@ -115,9 +137,10 @@ class LogDetailActivity : BaseBindingActivity<ActivityLogDetailBinding, LogDetai
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 右半连线(从中心到右边缘,略超过中心以避免断层)
|
// 右半连线(从中心到右边缘)
|
||||||
if (!isLast) {
|
if (!isLast) {
|
||||||
val rightLineColor = if (isCompleted && !isCurrent) colorBlue else colorGray
|
// 如果当前节点索引 < latestIndex,右半线为蓝色;否则为浅灰色
|
||||||
|
val rightLineColor = if (latestIndex >= 0 && i < latestIndex) colorBlue else colorGray
|
||||||
val lineRight = View(this).apply {
|
val lineRight = View(this).apply {
|
||||||
setBackgroundColor(rightLineColor)
|
setBackgroundColor(rightLineColor)
|
||||||
layoutParams = FrameLayout.LayoutParams(0, lineHeight).apply {
|
layoutParams = FrameLayout.LayoutParams(0, lineHeight).apply {
|
||||||
@@ -136,8 +159,8 @@ class LogDetailActivity : BaseBindingActivity<ActivityLogDetailBinding, LogDetai
|
|||||||
val dot = View(this).apply {
|
val dot = View(this).apply {
|
||||||
setBackgroundResource(
|
setBackgroundResource(
|
||||||
when {
|
when {
|
||||||
isCurrent -> R.drawable.bg_step_dot_green
|
isLatest -> R.drawable.bg_step_dot_green
|
||||||
isCompleted -> R.drawable.bg_step_dot_blue
|
isActive -> R.drawable.bg_step_dot_blue
|
||||||
else -> R.drawable.bg_step_dot_gray
|
else -> R.drawable.bg_step_dot_gray
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -2,14 +2,19 @@ package com.lukouguoji.aerologic.page.log.detail
|
|||||||
|
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import androidx.lifecycle.MutableLiveData
|
import androidx.lifecycle.MutableLiveData
|
||||||
|
import androidx.lifecycle.viewModelScope
|
||||||
import com.google.gson.Gson
|
import com.google.gson.Gson
|
||||||
import com.lukouguoji.module_base.base.BaseViewModel
|
import com.lukouguoji.module_base.base.BaseViewModel
|
||||||
import com.lukouguoji.module_base.bean.LogBean
|
import com.lukouguoji.module_base.bean.LogBean
|
||||||
import com.lukouguoji.module_base.bean.StatusLogBean
|
import com.lukouguoji.module_base.bean.StatusLogBean
|
||||||
import com.lukouguoji.module_base.common.Constant
|
import com.lukouguoji.module_base.common.Constant
|
||||||
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.toRequestBody
|
import com.lukouguoji.module_base.ktx.toRequestBody
|
||||||
|
import kotlinx.coroutines.Dispatchers
|
||||||
|
import kotlinx.coroutines.launch
|
||||||
|
import kotlinx.coroutines.withContext
|
||||||
|
|
||||||
|
data class StepInfo(val code: String, val name: String)
|
||||||
|
|
||||||
class LogDetailViewModel : BaseViewModel() {
|
class LogDetailViewModel : BaseViewModel() {
|
||||||
|
|
||||||
@@ -18,71 +23,100 @@ class LogDetailViewModel : BaseViewModel() {
|
|||||||
|
|
||||||
val statusLogList = MutableLiveData<List<StatusLogBean>>(emptyList())
|
val statusLogList = MutableLiveData<List<StatusLogBean>>(emptyList())
|
||||||
|
|
||||||
// 流转状态步骤定义
|
// 流转状态步骤(根据运单类型动态设置)
|
||||||
val allSteps = listOf(
|
val allSteps = MutableLiveData<List<StepInfo>>(emptyList())
|
||||||
"预录入", "完成收运", "运抵申报", "海关放行",
|
|
||||||
"完成组装", "完成复磅", "装载申报", "航班关闭", "理货申报"
|
|
||||||
)
|
|
||||||
|
|
||||||
// 当前完成到哪一步(索引)
|
// 操作详情中出现的步骤 code 集合
|
||||||
|
val activeStepCodes = MutableLiveData<Set<String>>(emptySet())
|
||||||
|
|
||||||
|
// 最新步骤的 code
|
||||||
|
val latestStepCode = MutableLiveData("")
|
||||||
|
|
||||||
|
// 当前完成到哪一步(索引),用于线条着色
|
||||||
val currentStepIndex = MutableLiveData(-1)
|
val currentStepIndex = MutableLiveData(-1)
|
||||||
|
|
||||||
|
private var awbType = ""
|
||||||
|
|
||||||
|
// 国际出港步骤(来自 AwbGjcStatus.java)
|
||||||
|
private val gjcSteps = listOf(
|
||||||
|
StepInfo("1", "预录入"), StepInfo("2", "收运完成"),
|
||||||
|
StepInfo("3", "运抵申报"), StepInfo("4", "海关放行"),
|
||||||
|
StepInfo("5", "组装完成"), StepInfo("6", "复磅完成"),
|
||||||
|
StepInfo("7", "装载申报"), StepInfo("8", "航班关闭"),
|
||||||
|
StepInfo("9", "理货申报")
|
||||||
|
)
|
||||||
|
|
||||||
|
// 国际进港步骤(来自 AwbGjjStatus.java)
|
||||||
|
private val gjjSteps = listOf(
|
||||||
|
StepInfo("1", "原始舱单"), StepInfo("2", "分拣理货"),
|
||||||
|
StepInfo("3", "理货申报"), StepInfo("4", "海关放行"),
|
||||||
|
StepInfo("5", "柜台办结"), StepInfo("6", "提取出库")
|
||||||
|
)
|
||||||
|
|
||||||
fun initOnCreated(intent: Intent) {
|
fun initOnCreated(intent: Intent) {
|
||||||
val json = intent.getStringExtra(Constant.Key.DATA) ?: ""
|
// 优先从 ARouter 参数获取
|
||||||
if (json.isNotEmpty()) {
|
val key = intent.getStringExtra(Constant.Key.KEY) ?: ""
|
||||||
val bean = Gson().fromJson(json, LogBean::class.java)
|
awbType = intent.getStringExtra(Constant.Key.AWB_TYPE) ?: ""
|
||||||
waybillNo.value = bean.key
|
|
||||||
waybillType.value = getAwbTypeName(bean.logType)
|
// 如果没有 ARouter 参数,尝试从 LogBean 解析
|
||||||
loadStatusList(bean.key, bean.logType)
|
if (key.isEmpty()) {
|
||||||
|
val json = intent.getStringExtra(Constant.Key.DATA) ?: ""
|
||||||
|
if (json.isNotEmpty()) {
|
||||||
|
val bean = Gson().fromJson(json, LogBean::class.java)
|
||||||
|
waybillNo.value = bean.key
|
||||||
|
awbType = bean.logType
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
waybillNo.value = key
|
||||||
|
}
|
||||||
|
|
||||||
|
waybillType.value = getAwbTypeName(awbType)
|
||||||
|
allSteps.value = if (awbType == "II") gjjSteps else gjcSteps
|
||||||
|
|
||||||
|
if (waybillNo.value?.isNotEmpty() == true) {
|
||||||
|
loadStatusList(waybillNo.value!!, awbType)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun loadStatusList(key: String, logType: String) {
|
private fun loadStatusList(key: String, logType: String) {
|
||||||
if (key.isEmpty()) {
|
viewModelScope.launch {
|
||||||
loadMockData()
|
try {
|
||||||
return
|
// 注意:SelfLoginInterceptor 会把裸数组 [...] 包装成 {"data": [...]}
|
||||||
}
|
// 所以 API 返回类型必须是 BaseResultBean,从 .data 取实际列表
|
||||||
launchCollect({
|
val result = withContext(Dispatchers.IO) {
|
||||||
NetApply.api.getLogStatusList(
|
NetApply.api.getLogStatusList(
|
||||||
mapOf(
|
mapOf(
|
||||||
"key" to key,
|
"key" to key,
|
||||||
"awbType" to logType
|
"awbType" to logType
|
||||||
).toRequestBody()
|
).toRequestBody()
|
||||||
)
|
)
|
||||||
}) {
|
|
||||||
onSuccess = {
|
|
||||||
val list = it.data ?: emptyList()
|
|
||||||
if (list.isNotEmpty()) {
|
|
||||||
statusLogList.value = list
|
|
||||||
val lastStatus = list.last().content
|
|
||||||
val index = allSteps.indexOfFirst { step ->
|
|
||||||
lastStatus.contains(step)
|
|
||||||
}
|
|
||||||
currentStepIndex.value = if (index >= 0) index else list.size - 1
|
|
||||||
} else {
|
|
||||||
loadMockData()
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
onFailed = { _, _ ->
|
val list = result.data ?: emptyList()
|
||||||
loadMockData()
|
statusLogList.value = list
|
||||||
|
|
||||||
|
if (list.isNotEmpty()) {
|
||||||
|
// 提取所有出现的 status code(用 status 字段匹配)
|
||||||
|
val codes = list.mapNotNull { item ->
|
||||||
|
item.status.ifEmpty { null }
|
||||||
|
}.toSet()
|
||||||
|
activeStepCodes.value = codes
|
||||||
|
|
||||||
|
// 最新节点 = 列表最后一条的 status
|
||||||
|
val latestCode = list.last().status
|
||||||
|
latestStepCode.value = latestCode
|
||||||
|
|
||||||
|
// 计算最新节点在步骤列表中的索引
|
||||||
|
val steps = allSteps.value ?: emptyList()
|
||||||
|
val index = steps.indexOfFirst { step -> step.code == latestCode }
|
||||||
|
currentStepIndex.value = if (index >= 0) index else -1
|
||||||
|
}
|
||||||
|
} catch (e: Exception) {
|
||||||
|
e.printStackTrace()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun loadMockData() {
|
|
||||||
// Mock 数据:模拟到"装载申报"步骤
|
|
||||||
currentStepIndex.value = 6 // "装载申报" 在 allSteps 中的索引
|
|
||||||
|
|
||||||
statusLogList.value = listOf(
|
|
||||||
StatusLogBean(content = "托书录入", opDate = "2017-04-01 12:00:00"),
|
|
||||||
StatusLogBean(content = "完成收运", opDate = "2017-04-01 12:00:00"),
|
|
||||||
StatusLogBean(content = "完成组装", opDate = "2017-04-01 12:00:00"),
|
|
||||||
StatusLogBean(content = "已复磅", opDate = "2017-04-01 12:00:00"),
|
|
||||||
StatusLogBean(content = "海关已放行", opDate = "2017-04-01 12:00:00"),
|
|
||||||
StatusLogBean(content = "装载申报", opDate = "2017-04-01 12:00:00")
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun getAwbTypeName(logType: String): String {
|
private fun getAwbTypeName(logType: String): String {
|
||||||
return when (logType) {
|
return when (logType) {
|
||||||
"CI" -> "国内进港"
|
"CI" -> "国内进港"
|
||||||
|
|||||||
@@ -11,8 +11,5 @@ class LogQueryViewHolder(view: View) : BaseViewHolder<LogBean, ItemLogQueryBindi
|
|||||||
override fun onBind(item: Any?, position: Int) {
|
override fun onBind(item: Any?, position: Int) {
|
||||||
val bean = getItemBean(item)
|
val bean = getItemBean(item)
|
||||||
binding.bean = bean
|
binding.bean = bean
|
||||||
itemView.setOnClickListener {
|
|
||||||
bean?.let { LogDetailActivity.start(itemView.context, it) }
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -825,16 +825,16 @@ class HomeFragment : Fragment() {
|
|||||||
)
|
)
|
||||||
list.add(
|
list.add(
|
||||||
RightMenu(
|
RightMenu(
|
||||||
Constant.AuthName.IntArrAirManifest,
|
Constant.AuthName.IntImpManifest,
|
||||||
R.mipmap.img_bwjx,
|
R.mipmap.img_bwjx,
|
||||||
"原始舱单"
|
"进港舱单"
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
list.add(
|
list.add(
|
||||||
RightMenu(
|
RightMenu(
|
||||||
Constant.AuthName.IntImpManifest,
|
Constant.AuthName.IntArrAirManifest,
|
||||||
R.mipmap.img_bwjx,
|
R.mipmap.img_bwjx,
|
||||||
"进港舱单"
|
"原始舱单"
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
list.add(
|
list.add(
|
||||||
@@ -970,13 +970,6 @@ class HomeFragment : Fragment() {
|
|||||||
"ULD管理"
|
"ULD管理"
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
list.add(
|
|
||||||
RightMenu(
|
|
||||||
Constant.AuthName.ComprehensiveColdStorage,
|
|
||||||
com.lukouguoji.module_base.R.mipmap.gnc_cangku,
|
|
||||||
"冷库登记"
|
|
||||||
)
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
else -> {
|
else -> {
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
<include layout="@layout/title_tool_bar" />
|
<include layout="@layout/title_tool_bar" />
|
||||||
|
|
||||||
<ScrollView
|
<androidx.core.widget.NestedScrollView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:fillViewport="true">
|
android:fillViewport="true">
|
||||||
@@ -59,7 +59,7 @@
|
|||||||
<TextView
|
<TextView
|
||||||
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="#666666"
|
android:textColor="#666666"
|
||||||
android:textSize="14sp" />
|
android:textSize="14sp" />
|
||||||
|
|
||||||
@@ -81,7 +81,7 @@
|
|||||||
<TextView
|
<TextView
|
||||||
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="#666666"
|
android:textColor="#666666"
|
||||||
android:textSize="14sp" />
|
android:textSize="14sp" />
|
||||||
|
|
||||||
@@ -153,7 +153,7 @@
|
|||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</ScrollView>
|
</androidx.core.widget.NestedScrollView>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</layout>
|
</layout>
|
||||||
|
|||||||
@@ -32,7 +32,7 @@
|
|||||||
value="@={viewModel.status}"
|
value="@={viewModel.status}"
|
||||||
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="0.33" />
|
||||||
|
|
||||||
<com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayout
|
<com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayout
|
||||||
hint='@{"选择所属航司"}'
|
hint='@{"选择所属航司"}'
|
||||||
@@ -41,7 +41,7 @@
|
|||||||
value="@={viewModel.uldSuffix}"
|
value="@={viewModel.uldSuffix}"
|
||||||
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="0.33" />
|
||||||
|
|
||||||
<com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayout
|
<com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayout
|
||||||
hint='@{"请输入ULD编号"}'
|
hint='@{"请输入ULD编号"}'
|
||||||
@@ -51,7 +51,7 @@
|
|||||||
value="@={viewModel.uldNo}"
|
value="@={viewModel.uldNo}"
|
||||||
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="0.33" />
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
@@ -69,11 +69,10 @@
|
|||||||
android:src="@drawable/img_search" />
|
android:src="@drawable/img_search" />
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:layout_width="36dp"
|
android:layout_width="40dp"
|
||||||
android:layout_height="36dp"
|
android:layout_height="40dp"
|
||||||
android:layout_marginLeft="16dp"
|
android:layout_marginLeft="16dp"
|
||||||
android:onClick="@{()-> viewModel.onAddClick()}"
|
android:onClick="@{()-> viewModel.onAddClick()}"
|
||||||
android:padding="4dp"
|
|
||||||
android:src="@drawable/img_add" />
|
android:src="@drawable/img_add" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|||||||
@@ -6,7 +6,17 @@
|
|||||||
# http://www.gradle.org/docs/current/userguide/build_environment.html
|
# http://www.gradle.org/docs/current/userguide/build_environment.html
|
||||||
# Specifies the JVM arguments used for the daemon process.
|
# Specifies the JVM arguments used for the daemon process.
|
||||||
# The setting is particularly useful for tweaking memory settings.
|
# The setting is particularly useful for tweaking memory settings.
|
||||||
org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
|
org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8 \
|
||||||
|
--add-opens=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED \
|
||||||
|
--add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED \
|
||||||
|
--add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED \
|
||||||
|
--add-opens=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED \
|
||||||
|
--add-opens=jdk.compiler/com.sun.tools.javac.jvm=ALL-UNNAMED \
|
||||||
|
--add-opens=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED \
|
||||||
|
--add-opens=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED \
|
||||||
|
--add-opens=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED \
|
||||||
|
--add-opens=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED \
|
||||||
|
--add-opens=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED
|
||||||
kapt.use.worker.api=false
|
kapt.use.worker.api=false
|
||||||
kapt.include.compile.classpath=false
|
kapt.include.compile.classpath=false
|
||||||
# When configured, Gradle will run in incubating parallel mode.
|
# When configured, Gradle will run in incubating parallel mode.
|
||||||
|
|||||||
@@ -0,0 +1,26 @@
|
|||||||
|
package com.lukouguoji.module_base.bean
|
||||||
|
|
||||||
|
class GjAccidentVisaEditBean {
|
||||||
|
var id: Long = 0
|
||||||
|
var fdate: String = "" // 航班日期
|
||||||
|
var fno: String = "" // 航班号
|
||||||
|
var dep: String = "" // 始发站
|
||||||
|
var dest: String = "" // 目的站
|
||||||
|
var wbNo: String = "" // 运单号
|
||||||
|
var dpc: String = "" // 不正常件数
|
||||||
|
var pc: String = "" // 运单总件数
|
||||||
|
var weight: String = "" // 运单总重量
|
||||||
|
var reweight: String = "" // 复称重量
|
||||||
|
var goods: String = "" // 品名
|
||||||
|
var opacking: String = "" // 外包装
|
||||||
|
var damage: String = "" // 包装破损情况
|
||||||
|
var condition: String = "" // 内容物情况
|
||||||
|
var problem: String = "" // 不正常类型
|
||||||
|
var seachDate: String = "" // 发现时间
|
||||||
|
var photo: String = "" // 图片是否留底
|
||||||
|
var remarks: String = "" // 备注
|
||||||
|
var pic: String = "" // 缩略图
|
||||||
|
var originalPic: String = "" // 原图
|
||||||
|
var picNumber: String = "" // 图片数量
|
||||||
|
var idFlag: String = "1" // 国际标志(固定为1=国际)
|
||||||
|
}
|
||||||
@@ -85,6 +85,7 @@ data class GjcMaWb(
|
|||||||
|
|
||||||
// ==================== 操作信息 ====================
|
// ==================== 操作信息 ====================
|
||||||
var opDate: String? = null, // 操作时间(入库时间)
|
var opDate: String? = null, // 操作时间(入库时间)
|
||||||
|
var inDate: String? = null, // 入库时间
|
||||||
var opId: String? = null, // 操作员id
|
var opId: String? = null, // 操作员id
|
||||||
var paperTime: Date? = null, // 单证时间
|
var paperTime: Date? = null, // 单证时间
|
||||||
|
|
||||||
|
|||||||
@@ -50,7 +50,11 @@ class GjjWarehouse(
|
|||||||
var volume: String? = "",
|
var volume: String? = "",
|
||||||
var wbNo: String? = "",
|
var wbNo: String? = "",
|
||||||
var weight: String? = "",
|
var weight: String? = "",
|
||||||
var whid: String? = ""
|
var whid: String? = "",
|
||||||
|
var splitFlag: String? = "",
|
||||||
|
var inDate: String? = "",
|
||||||
|
var clearNormal: String? = "",
|
||||||
|
var range: String? = ""
|
||||||
) {
|
) {
|
||||||
|
|
||||||
fun getWaybillCode() = "${prefix}${no}"
|
fun getWaybillCode() = "${prefix}${no}"
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ data class GjjHaWb(
|
|||||||
var volume: Double = 0.0,
|
var volume: Double = 0.0,
|
||||||
var cashWeight: Double = 0.0,
|
var cashWeight: Double = 0.0,
|
||||||
var goods: String = "",
|
var goods: String = "",
|
||||||
|
var goodsCn: String = "",
|
||||||
var spCode: String = "",
|
var spCode: String = "",
|
||||||
var mftStatus: String = "",
|
var mftStatus: String = "",
|
||||||
var lastMftStatus: String = "",
|
var lastMftStatus: String = "",
|
||||||
|
|||||||
@@ -47,10 +47,14 @@ data class GjjImportManifest(
|
|||||||
var dgrContactMame: String = "",
|
var dgrContactMame: String = "",
|
||||||
// 危险品收货人通讯方式
|
// 危险品收货人通讯方式
|
||||||
var dgrContactNumber: String = "",
|
var dgrContactNumber: String = "",
|
||||||
|
// 航班日期
|
||||||
|
var fdate: String = "",
|
||||||
// 航班起始站
|
// 航班起始站
|
||||||
var fdep: String = "",
|
var fdep: String = "",
|
||||||
// 航班目的站
|
// 航班目的站
|
||||||
var fdest: String = "",
|
var fdest: String = "",
|
||||||
|
// 航班号
|
||||||
|
var fno: String = "",
|
||||||
// 航班id
|
// 航班id
|
||||||
var fid: Long = 0,
|
var fid: Long = 0,
|
||||||
// 运费支付方式
|
// 运费支付方式
|
||||||
@@ -114,6 +118,15 @@ data class GjjImportManifest(
|
|||||||
// 重量
|
// 重量
|
||||||
var weight: Double = 0.0
|
var weight: Double = 0.0
|
||||||
) : Serializable {
|
) : Serializable {
|
||||||
|
// 获取航班信息(日期去横杠/航班号)
|
||||||
|
fun getFlightSplit(): String {
|
||||||
|
if (fdate != "" && fno != "") {
|
||||||
|
val (year, mon, day) = fdate.split("-")
|
||||||
|
return "${year}${mon}${day}/${fno}"
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
// ========== UI扩展字段 ==========
|
// ========== UI扩展字段 ==========
|
||||||
// 选中状态
|
// 选中状态
|
||||||
@Transient
|
@Transient
|
||||||
|
|||||||
@@ -74,7 +74,27 @@ data class GjjImportTally(
|
|||||||
// 体积(m³)
|
// 体积(m³)
|
||||||
var volume: Double = 0.0,
|
var volume: Double = 0.0,
|
||||||
// 重量(kg)
|
// 重量(kg)
|
||||||
var weight: Double = 0.0
|
var weight: Double = 0.0,
|
||||||
|
// 品名(中文)
|
||||||
|
var goodsCn: String = "",
|
||||||
|
// 品名(英文)
|
||||||
|
var goodsEn: String = "",
|
||||||
|
// 放行模式(代码)
|
||||||
|
var relMode: String = "",
|
||||||
|
// 放行模式(名称)
|
||||||
|
var releaseMode: String = "",
|
||||||
|
// 放行时间(perDate)
|
||||||
|
var perDate: String = "",
|
||||||
|
// 放行时间
|
||||||
|
var releaseTime: String = "",
|
||||||
|
// 指令类型(comType)
|
||||||
|
var comType: String = "",
|
||||||
|
// 指令类型
|
||||||
|
var instructionType: String = "",
|
||||||
|
// 放行备注
|
||||||
|
var relRemark: String = "",
|
||||||
|
// 备注
|
||||||
|
var remark: String = ""
|
||||||
) : Serializable {
|
) : Serializable {
|
||||||
// 选中状态(用于多选功能)- 不参与序列化
|
// 选中状态(用于多选功能)- 不参与序列化
|
||||||
@Transient
|
@Transient
|
||||||
@@ -85,7 +105,24 @@ data class GjjImportTally(
|
|||||||
get() = checked.get()
|
get() = checked.get()
|
||||||
set(value) = checked.set(value)
|
set(value) = checked.set(value)
|
||||||
|
|
||||||
|
// 展开/折叠状态 - 不参与序列化
|
||||||
|
@Transient
|
||||||
|
val showMore: ObservableBoolean = ObservableBoolean(false)
|
||||||
|
|
||||||
|
// 已加载的分单数据 - 不参与序列化
|
||||||
|
@Transient
|
||||||
|
var haWbList: MutableList<GjjImportTally>? = null
|
||||||
|
|
||||||
// 获取完整运单号
|
// 获取完整运单号
|
||||||
fun getWaybillNo() = "$prefix$no"
|
fun getWaybillNo() = "$prefix$no"
|
||||||
|
|
||||||
|
// 获取航班信息(日期去横杠/航班号)
|
||||||
|
fun getFlightSplit(): String {
|
||||||
|
if (fdate != "" && fno != "") {
|
||||||
|
val (year, mon, day) = fdate.split("-")
|
||||||
|
return "${year}${mon}${day}/${fno}"
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,23 @@
|
|||||||
|
package com.lukouguoji.module_base.bean
|
||||||
|
|
||||||
|
import java.io.Serializable
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 国际进港-库位使用记录Bean
|
||||||
|
* 对应接口: /IntImpSearch/detail 返回的 storageUseList 项
|
||||||
|
*/
|
||||||
|
data class GjjStorageUse(
|
||||||
|
var id: Long? = null, // 主键
|
||||||
|
var maWbId: Long? = null, // 运单id
|
||||||
|
var prefix: String? = null, // 运单前缀
|
||||||
|
var no: String? = null, // 运单号
|
||||||
|
var location: String? = null, // 库位号
|
||||||
|
var locationId: Long? = null, // 库位id
|
||||||
|
var inDate: String? = null, // 入库时间
|
||||||
|
var inOpId: String? = null, // 入库人ID
|
||||||
|
var inOpName: String? = null, // 入库人姓名
|
||||||
|
var outDate: String? = null, // 出库时间
|
||||||
|
var outOpId: String? = null, // 出库人ID
|
||||||
|
var outOpName: String? = null, // 出库人姓名
|
||||||
|
var cargoStatus: String? = null // 货物状态
|
||||||
|
) : Serializable
|
||||||
@@ -23,6 +23,7 @@ class IntImpPickUpDLVBean : Serializable {
|
|||||||
var cashWeight: Double = 0.0 // 计费重量
|
var cashWeight: Double = 0.0 // 计费重量
|
||||||
var pkId: String = "" // 提货编号(提货单号)
|
var pkId: String = "" // 提货编号(提货单号)
|
||||||
var location: String = "" // 库位
|
var location: String = "" // 库位
|
||||||
|
var locationInStore: String = "" // 入库库位
|
||||||
var chargeTime: String = "" // 缴费时间(提取时间)
|
var chargeTime: String = "" // 缴费时间(提取时间)
|
||||||
var dlvTime: String = "" // 出库时间
|
var dlvTime: String = "" // 出库时间
|
||||||
var goods: String = "" // 品名
|
var goods: String = "" // 品名
|
||||||
@@ -38,6 +39,8 @@ class IntImpPickUpDLVBean : Serializable {
|
|||||||
var efrCharge: Double = 0.0 // 冷藏费
|
var efrCharge: Double = 0.0 // 冷藏费
|
||||||
var svlCharge: Double = 0.0 // 铲车费
|
var svlCharge: Double = 0.0 // 铲车费
|
||||||
var tallyCharge: Double = 0.0 // 理货费
|
var tallyCharge: Double = 0.0 // 理货费
|
||||||
|
var pipFee: Double = 0.0 // 精密仪器处理费
|
||||||
|
var lapFee: Double = 0.0 // 活体动物处理费
|
||||||
var chargeId: String = "" // 收费员
|
var chargeId: String = "" // 收费员
|
||||||
var chargeName: String = "" // 收费员名称
|
var chargeName: String = "" // 收费员名称
|
||||||
var dlvId: String = ""
|
var dlvId: String = ""
|
||||||
@@ -54,6 +57,18 @@ class IntImpPickUpDLVBean : Serializable {
|
|||||||
var awbPc: Long = 0
|
var awbPc: Long = 0
|
||||||
|
|
||||||
// ========== UI扩展字段 ==========
|
// ========== UI扩展字段 ==========
|
||||||
|
/**
|
||||||
|
* 航班信息展示:优先使用 flight 字段,否则用 fdate(去杠)/fno 拼接
|
||||||
|
* 格式示例:20240204/MU2023
|
||||||
|
*/
|
||||||
|
val flightInfo: String
|
||||||
|
get() {
|
||||||
|
if (!flight.isNullOrEmpty()) return flight
|
||||||
|
val dateStr = fdate?.replace("-", "")?.take(8) ?: ""
|
||||||
|
val noStr = fno ?: ""
|
||||||
|
return if (dateStr.isNotEmpty() || noStr.isNotEmpty()) "$dateStr/$noStr" else ""
|
||||||
|
}
|
||||||
|
|
||||||
val checked: ObservableBoolean = ObservableBoolean(false)
|
val checked: ObservableBoolean = ObservableBoolean(false)
|
||||||
|
|
||||||
var isSelected: Boolean
|
var isSelected: Boolean
|
||||||
|
|||||||
@@ -5,28 +5,35 @@ import java.io.Serializable
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 国际进港提取记录-列表数据Bean
|
* 国际进港提取记录-列表数据Bean
|
||||||
* 对应API: IntImpPickUpRecord/pageQuery
|
* 对应API: IntImpPickup/pageQuery
|
||||||
*/
|
*/
|
||||||
class IntImpPickUpRecordBean : Serializable {
|
class IntImpPickUpRecordBean : Serializable {
|
||||||
var id: Long = 0 // 主键ID
|
var id: Long = 0 // 主键ID
|
||||||
var wbNo: String = "" // 运单号
|
var wbNo: String = "" // 运单号
|
||||||
|
var no: String = "" // 主单号
|
||||||
|
var prefix: String = "" // 前缀
|
||||||
|
var hno: String = "" // 分单号
|
||||||
|
var serialNo: String = "" // 序号
|
||||||
var pc: Int = 0 // 件数
|
var pc: Int = 0 // 件数
|
||||||
var weight: Double = 0.0 // 重量
|
var weight: Double = 0.0 // 重量
|
||||||
var checkWeight: Double = 0.0 // 计重重量
|
var cashWeight: Double = 0.0 // 计费重量
|
||||||
var agentCode: String = "" // 代理人
|
var agentCode: String = "" // 代理人
|
||||||
var spCode: String = "" // 特码
|
var spCode: String = "" // 特码
|
||||||
var serviceFee: Double = 0.0 // 服务费
|
var optCharge: Double = 0.0 // 服务费
|
||||||
var storageFee: Double = 0.0 // 仓储费
|
var whsCharge: Double = 0.0 // 仓储费
|
||||||
var totalAmount: Double = 0.0 // 总金额
|
var amount: Double = 0.0 // 总金额
|
||||||
var pickUpTime: String = "" // 提取时间
|
var chargeTime: String = "" // 缴费时间/提取时间
|
||||||
var pickUpNo: String = "" // 提货编号
|
var pkId: String = "" // 提货编号
|
||||||
var infoFee: Double = 0.0 // 信息费
|
var tranCharge: Double = 0.0 // 信息费
|
||||||
var drawFee: Double = 0.0 // 抽单费
|
var drawBillCharge: Double = 0.0 // 抽单费
|
||||||
var coldFee: Double = 0.0 // 冷藏费
|
var efrCharge: Double = 0.0 // 冷藏费
|
||||||
var forkliftFee: Double = 0.0 // 铲车费
|
var svlCharge: Double = 0.0 // 铲车费
|
||||||
var tallyFee: Double = 0.0 // 理货费
|
var tallyCharge: Double = 0.0 // 理货费
|
||||||
var operator: String = "" // 办理人
|
var pipFee: Double = 0.0 // 精密仪器处理费
|
||||||
var outTime: String = "" // 出库时间
|
var lapFee: Double = 0.0 // 活体动物处理费
|
||||||
|
var chargeName: String = "" // 办理人名称
|
||||||
|
var chargeId: String = "" // 收费员ID
|
||||||
|
var dlvTime: String = "" // 出库时间
|
||||||
|
|
||||||
// ========== UI扩展字段 ==========
|
// ========== UI扩展字段 ==========
|
||||||
val checked: ObservableBoolean = ObservableBoolean(false)
|
val checked: ObservableBoolean = ObservableBoolean(false)
|
||||||
|
|||||||
@@ -0,0 +1,53 @@
|
|||||||
|
package com.lukouguoji.module_base.bean
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 国际进港运单修改-数据模型
|
||||||
|
* 对应接口:/IntImpSearch/modifyMaWb 的请求体 (GjjMaWb)
|
||||||
|
* 详情数据来源:/IntImpSearch/detail 返回的 maWb + maWbM + warehouseList
|
||||||
|
*/
|
||||||
|
data class IntImpQueryEditBean(
|
||||||
|
// ==================== 主键 ====================
|
||||||
|
var maWbId: Long? = null, // 主单主键ID
|
||||||
|
var activeId: Long? = null, // 有效值
|
||||||
|
|
||||||
|
// ==================== 运单号(禁用) ====================
|
||||||
|
var wbNo: String? = null, // 运单号(组合: prefix + no)
|
||||||
|
var prefix: String? = null, // 运单号前缀
|
||||||
|
var no: String? = null, // 运单号主体
|
||||||
|
|
||||||
|
// ==================== 可编辑字段 ====================
|
||||||
|
var agentCode: String? = null, // 代理人code(提交用)
|
||||||
|
var agentName: String? = null, // 代理人名称(显示用)
|
||||||
|
var spCode: String? = null, // 特码
|
||||||
|
var packageType: String? = null, // 包装类型
|
||||||
|
var awbType: String? = null, // 运单类型code
|
||||||
|
var lockState: String? = null, // 锁定状态("0":未锁, "1":锁定)
|
||||||
|
var remark: String? = null, // 备注
|
||||||
|
|
||||||
|
// ==================== 禁用字段(仅显示) ====================
|
||||||
|
var awbPc: Long? = null, // 运单件数(对应API: pc)
|
||||||
|
var awbWeight: Double? = null, // 运单重量(对应API: weight)
|
||||||
|
var businessType: String? = null, // 业务类型code
|
||||||
|
var businessName: String? = null, // 业务类型名称
|
||||||
|
var inPc: Long? = null, // 入库件数
|
||||||
|
var inWeight: Double? = null, // 入库重量
|
||||||
|
var cashWeight: Double? = null, // 计费重量
|
||||||
|
var by1: String? = null, // 承运人
|
||||||
|
var range: String? = null, // 航程
|
||||||
|
var goodsCn: String? = null, // 品名(中)
|
||||||
|
var goods: String? = null, // 品名(英)
|
||||||
|
var unNumber: String? = null, // UN编号
|
||||||
|
|
||||||
|
// ==================== 提交时需要的额外字段 ====================
|
||||||
|
var fno: String? = null, // 航班号
|
||||||
|
var fdate: String? = null, // 航班日期
|
||||||
|
var flight: String? = null, // 航班
|
||||||
|
var pc: Long? = null, // 件数(API用)
|
||||||
|
var weight: Double? = null, // 重量(API用)
|
||||||
|
var volume: Double? = null, // 体积
|
||||||
|
var origin: String? = null, // 货源地
|
||||||
|
var dest: String? = null, // 目的地
|
||||||
|
var cargoType: String? = null, // 货物类型
|
||||||
|
var subCode: String? = null, // 子码
|
||||||
|
var carId: String? = null // 车牌号
|
||||||
|
)
|
||||||
@@ -395,5 +395,11 @@ interface Constant {
|
|||||||
|
|
||||||
// Bean对象传递
|
// Bean对象传递
|
||||||
const val BEAN = "bean"
|
const val BEAN = "bean"
|
||||||
|
|
||||||
|
// 运单号(日志详情)
|
||||||
|
const val KEY = "key"
|
||||||
|
|
||||||
|
// 运单类型
|
||||||
|
const val AWB_TYPE = "awbType"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -51,6 +51,7 @@ import com.lukouguoji.module_base.bean.GjjGoodsDetailsBean
|
|||||||
import com.lukouguoji.module_base.bean.GjjGoodsTypeBean
|
import com.lukouguoji.module_base.bean.GjjGoodsTypeBean
|
||||||
import com.lukouguoji.module_base.bean.GjjHandoverRecordBean
|
import com.lukouguoji.module_base.bean.GjjHandoverRecordBean
|
||||||
import com.lukouguoji.module_base.bean.GjjImportTally
|
import com.lukouguoji.module_base.bean.GjjImportTally
|
||||||
|
import com.lukouguoji.module_base.bean.GjAccidentVisaEditBean
|
||||||
import com.lukouguoji.module_base.bean.IntImpAccidentVisaBean
|
import com.lukouguoji.module_base.bean.IntImpAccidentVisaBean
|
||||||
import com.lukouguoji.module_base.bean.IntImpPickUpDLVBean
|
import com.lukouguoji.module_base.bean.IntImpPickUpDLVBean
|
||||||
import com.lukouguoji.module_base.bean.IntImpPickUpRecordBean
|
import com.lukouguoji.module_base.bean.IntImpPickUpRecordBean
|
||||||
@@ -299,7 +300,19 @@ interface Api {
|
|||||||
* 获取地区类型
|
* 获取地区类型
|
||||||
*/
|
*/
|
||||||
@POST("typeCode/countryType")
|
@POST("typeCode/countryType")
|
||||||
suspend fun getAreaTypeList(): DictListBean
|
suspend fun getCountryTypeList(): DictListBean
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取国家代码
|
||||||
|
*/
|
||||||
|
@POST("typeCode/countryCode")
|
||||||
|
suspend fun getCountryCodeList(): DictListBean
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取通讯方式类型
|
||||||
|
*/
|
||||||
|
@POST("typeCode/communicateType")
|
||||||
|
suspend fun getCommunicateTypeList(): DictListBean
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询平板车信息
|
* 查询平板车信息
|
||||||
@@ -906,73 +919,73 @@ interface Api {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 国际进港仓库-分页查询
|
* 国际进港仓库-分页查询
|
||||||
* 接口路径: /IntImpStorageUse/pageQuery
|
* 接口路径: /IntImpStorage/pageQuery
|
||||||
*/
|
*/
|
||||||
@POST("IntImpStorageUse/pageQuery")
|
@POST("IntImpStorage/pageQuery")
|
||||||
suspend fun getIntImpStorageUseList(@Body data: RequestBody): PageInfo<GjcMaWb>
|
suspend fun getIntImpStorageUseList(@Body data: RequestBody): PageInfo<GjcMaWb>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 国际进港仓库-分页合计
|
* 国际进港仓库-分页合计
|
||||||
* 接口路径: /IntImpStorageUse/pageQueryTotal
|
* 接口路径: /IntImpStorage/pageQueryTotal
|
||||||
*/
|
*/
|
||||||
@POST("IntImpStorageUse/pageQueryTotal")
|
@POST("IntImpStorage/pageQueryTotal")
|
||||||
suspend fun getIntImpStorageUseTotal(@Body data: RequestBody): BaseResultBean<ManifestTotalDto>
|
suspend fun getIntImpStorageUseTotal(@Body data: RequestBody): BaseResultBean<ManifestTotalDto>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 国际进港库位操作-清仓
|
* 国际进港库位操作-清仓
|
||||||
* 接口路径: /IntImpStorageUse/updateClear
|
* 接口路径: /IntImpStorage/updateClear
|
||||||
*/
|
*/
|
||||||
@POST("IntImpStorageUse/updateClear")
|
@POST("IntImpStorage/updateClear")
|
||||||
suspend fun clearIntImpStorage(@Body data: RequestBody): BaseResultBean<Boolean>
|
suspend fun clearIntImpStorage(@Query("clearNormal") clearNormal: String, @Body data: RequestBody): BaseResultBean<Boolean>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 国际进港库位操作-修改库位
|
* 国际进港库位操作-修改库位
|
||||||
* 接口路径: /IntImpStorageUse/modifyStorage
|
* 接口路径: /IntImpStorage/modifyStorage
|
||||||
*/
|
*/
|
||||||
@POST("IntImpStorageUse/modifyStorage")
|
@POST("IntImpStorage/modifyStorage")
|
||||||
suspend fun modifyIntImpStorage(@Body data: RequestBody): BaseResultBean<Boolean>
|
suspend fun modifyIntImpStorage(@Body data: RequestBody): BaseResultBean<Boolean>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 国际进港库位操作-出库
|
* 国际进港库位操作-出库
|
||||||
* 接口路径: /IntImpStorageUse/outStorage
|
* 接口路径: /IntImpStorage/outStorage
|
||||||
*/
|
*/
|
||||||
@POST("IntImpStorageUse/outStorage")
|
@POST("IntImpStorage/outStorage")
|
||||||
suspend fun outIntImpStorage(@Body data: RequestBody): BaseResultBean<Boolean>
|
suspend fun outIntImpStorage(@Body data: RequestBody): BaseResultBean<Boolean>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 国际进港库位操作-入库
|
* 国际进港库位操作-入库
|
||||||
* 接口路径: /IntImpStorageUse/inStorage
|
* 接口路径: /IntImpStorage/inStorage
|
||||||
*/
|
*/
|
||||||
@POST("IntImpStorageUse/inStorage")
|
@POST("IntImpStorage/inStorage")
|
||||||
suspend fun inIntImpStorage(@Body data: RequestBody): BaseResultBean<Boolean>
|
suspend fun inIntImpStorage(@Query("location") location: String, @Body data: RequestBody): BaseResultBean<Boolean>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 国际进港提取记录-分页查询
|
* 国际进港提取记录-分页查询
|
||||||
* 接口路径: /IntImpPickUpRecord/pageQuery
|
* 接口路径: /IntImpPickup/pageQuery
|
||||||
*/
|
*/
|
||||||
@POST("IntImpPickUpRecord/pageQuery")
|
@POST("IntImpPickup/pageQuery")
|
||||||
suspend fun getIntImpPickUpRecordList(@Body data: RequestBody): PageInfo<IntImpPickUpRecordBean>
|
suspend fun getIntImpPickUpRecordList(@Body data: RequestBody): PageInfo<IntImpPickUpRecordBean>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 国际进港提取记录-分页合计
|
* 国际进港提取记录-分页合计
|
||||||
* 接口路径: /IntImpPickUpRecord/pageQueryTotal
|
* 接口路径: /IntImpPickup/pageQueryTotal
|
||||||
*/
|
*/
|
||||||
@POST("IntImpPickUpRecord/pageQueryTotal")
|
@POST("IntImpPickup/pageQueryTotal")
|
||||||
suspend fun getIntImpPickUpRecordTotal(@Body data: RequestBody): BaseResultBean<ManifestTotalDto>
|
suspend fun getIntImpPickUpRecordTotal(@Body data: RequestBody): BaseResultBean<ManifestTotalDto>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 国际进港提取记录-清除提货
|
* 国际进港提取记录-清除提货
|
||||||
* 接口路径: /IntImpPickUpRecord/clearPickUp
|
* 接口路径: /IntImpPickup/clearPickup
|
||||||
*/
|
*/
|
||||||
@POST("IntImpPickUpRecord/clearPickUp")
|
@POST("IntImpPickup/clearPickup")
|
||||||
suspend fun clearIntImpPickUp(@Body data: RequestBody): BaseResultBean<Boolean>
|
suspend fun clearIntImpPickUp(@Body data: RequestBody): BaseResultBean<String>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 国际进港提取记录-详情
|
* 国际进港提取记录-修改费用
|
||||||
* 接口路径: /IntImpPickUpRecord/getDetails
|
* 接口路径: /IntImpPickup/modifyCharge
|
||||||
*/
|
*/
|
||||||
@POST("IntImpPickUpRecord/getDetails")
|
@POST("IntImpPickup/modifyCharge")
|
||||||
suspend fun getIntImpPickUpRecordDetails(@Body data: RequestBody): BaseResultBean<IntImpPickUpRecordBean>
|
suspend fun modifyIntImpPickUpCharge(@Body data: RequestBody): BaseResultBean<String>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 国际进港提取出库-分页查询
|
* 国际进港提取出库-分页查询
|
||||||
@@ -1009,6 +1022,20 @@ interface Api {
|
|||||||
@POST("IntImpSearch/pageQueryTotal")
|
@POST("IntImpSearch/pageQueryTotal")
|
||||||
suspend fun getIntImpQueryTotal(@Body data: RequestBody): BaseResultBean<ManifestTotalDto>
|
suspend fun getIntImpQueryTotal(@Body data: RequestBody): BaseResultBean<ManifestTotalDto>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 国际进港查询-详情
|
||||||
|
* 接口路径: /IntImpSearch/detail
|
||||||
|
*/
|
||||||
|
@POST("IntImpSearch/detail")
|
||||||
|
suspend fun getIntImpQueryDetails(@Body data: RequestBody): BaseResultBean<Map<String, Any>>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 国际进港查询-修改运单
|
||||||
|
* 接口路径: /IntImpSearch/modifyMaWb
|
||||||
|
*/
|
||||||
|
@POST("IntImpSearch/modifyMaWb")
|
||||||
|
suspend fun modifyIntImpMaWb(@Body data: RequestBody): BaseResultBean<String>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 国际出港待计重-分页搜索
|
* 国际出港待计重-分页搜索
|
||||||
* 接口路径: /IntExpCheckIn/pageQuery
|
* 接口路径: /IntExpCheckIn/pageQuery
|
||||||
@@ -1248,21 +1275,21 @@ interface Api {
|
|||||||
suspend fun getGjjManifestDetail(@Query("id") id: String): BaseResultBean<GjjManifestBean>
|
suspend fun getGjjManifestDetail(@Query("id") id: String): BaseResultBean<GjjManifestBean>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除-国际进-舱单-列表
|
* 批量删除-国际进港舱单(请求体为 mfId 数组,如 [1,2,3])
|
||||||
*/
|
*/
|
||||||
@POST("IntImpManiFest/deleteFestList")
|
@POST("IntImpManiFest/deleteFestList")
|
||||||
suspend fun gjjManifestDelete(@Body data: RequestBody): BaseResultBean<Any>
|
suspend fun gjjManifestDeleteBatch(@Body data: RequestBody): BaseResultBean<Any>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增-国际进-舱单
|
* 新增-国际进港舱单
|
||||||
*/
|
*/
|
||||||
@POST("IntImpManiFest/saveFest")
|
@POST("IntImpManifest/addManifest")
|
||||||
suspend fun gjjManifestInsert(@Body data: RequestBody): BaseResultBean<Any>
|
suspend fun gjjManifestInsert(@Body data: RequestBody): BaseResultBean<Any>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新-国际进-舱单
|
* 修改-国际进港舱单
|
||||||
*/
|
*/
|
||||||
@POST("IntImpManiFest/updateFest")
|
@POST("IntImpManifest/modifyManifest")
|
||||||
suspend fun gjjManifestUpdate(@Body data: RequestBody): BaseResultBean<Any>
|
suspend fun gjjManifestUpdate(@Body data: RequestBody): BaseResultBean<Any>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1814,7 +1841,7 @@ interface Api {
|
|||||||
* 国际进港舱单-分页查询
|
* 国际进港舱单-分页查询
|
||||||
*/
|
*/
|
||||||
@POST("IntImpManifest/pageQuery")
|
@POST("IntImpManifest/pageQuery")
|
||||||
suspend fun getIntImpManifestList(@Body data: RequestBody): BaseResultBean<PageInfo<GjjManifest>>
|
suspend fun getIntImpManifestList(@Body data: RequestBody): PageInfo<GjjManifest>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 国际进港舱单-分页合计
|
* 国际进港舱单-分页合计
|
||||||
@@ -1828,11 +1855,29 @@ interface Api {
|
|||||||
@POST("IntImpManifest/listHaWbByManifest")
|
@POST("IntImpManifest/listHaWbByManifest")
|
||||||
suspend fun getIntImpManifestHaWbList(@Body data: RequestBody): BaseResultBean<List<GjjHaWb>>
|
suspend fun getIntImpManifestHaWbList(@Body data: RequestBody): BaseResultBean<List<GjjHaWb>>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 国际进港舱单-新增分单
|
||||||
|
*/
|
||||||
|
@POST("IntImpManifest/addHaWb")
|
||||||
|
suspend fun intImpManifestAddHaWb(@Body data: RequestBody): BaseResultBean<String>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 国际进港舱单-修改分单
|
||||||
|
*/
|
||||||
|
@POST("IntImpManifest/modifyHaWb")
|
||||||
|
suspend fun intImpManifestModifyHaWb(@Body data: RequestBody): BaseResultBean<String>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 国际进港舱单-获取主单减去分单的件数重量
|
||||||
|
*/
|
||||||
|
@POST("IntImpManifest/getMaWbMinusHaWb")
|
||||||
|
suspend fun getMaWbMinusHaWb(@Body data: RequestBody): BaseResultBean<GjjHaWb>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 国际进港舱单-分拣理货(装机单)-分页查询
|
* 国际进港舱单-分拣理货(装机单)-分页查询
|
||||||
*/
|
*/
|
||||||
@POST("IntImpManifest/pageQueryAir")
|
@POST("IntImpManifest/pageQueryAir")
|
||||||
suspend fun getIntImpLoadingList(@Body data: RequestBody): BaseResultBean<PageInfo<GjjManifest>>
|
suspend fun getIntImpLoadingList(@Body data: RequestBody): PageInfo<GjjManifest>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 国际进港舱单-分拣理货(装机单)-分页合计
|
* 国际进港舱单-分拣理货(装机单)-分页合计
|
||||||
@@ -1840,6 +1885,26 @@ interface Api {
|
|||||||
@POST("IntImpManifest/pageQueryAirTotal")
|
@POST("IntImpManifest/pageQueryAirTotal")
|
||||||
suspend fun getIntImpLoadingTotal(@Body data: RequestBody): BaseResultBean<ManifestTotalDto>
|
suspend fun getIntImpLoadingTotal(@Body data: RequestBody): BaseResultBean<ManifestTotalDto>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 国际进港舱单-分拣理货(装机单)-修改装机单
|
||||||
|
*/
|
||||||
|
@POST("IntImpManifest/modifyManifestAir")
|
||||||
|
suspend fun modifyIntImpLoadingList(@Body data: RequestBody): BaseResultBean<String>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 国际进港舱单-分拣理货(装机单)-修改库位
|
||||||
|
* 接口路径: /IntImpManifest/modifyStorage
|
||||||
|
*/
|
||||||
|
@POST("IntImpManifest/modifyStorage")
|
||||||
|
suspend fun modifyIntImpLoadingStorage(@Body data: RequestBody): BaseResultBean<Boolean>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 国际进港舱单-分拣理货(装机单)-入库
|
||||||
|
* 接口路径: /IntImpManifest/inStorage
|
||||||
|
*/
|
||||||
|
@POST("IntImpManifest/inStorage")
|
||||||
|
suspend fun inIntImpLoadingStorage(@Body data: RequestBody): BaseResultBean<Boolean>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 国际进港理货报告-分页查询
|
* 国际进港理货报告-分页查询
|
||||||
*/
|
*/
|
||||||
@@ -1852,6 +1917,42 @@ interface Api {
|
|||||||
@POST("IntImpTally/pageQueryTotal")
|
@POST("IntImpTally/pageQueryTotal")
|
||||||
suspend fun getIntImpTallyTotal(@Body data: RequestBody): BaseResultBean<ManifestTotalDto>
|
suspend fun getIntImpTallyTotal(@Body data: RequestBody): BaseResultBean<ManifestTotalDto>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 国际进港理货报告-查询分单列表
|
||||||
|
*/
|
||||||
|
@POST("IntImpTally/listHaWb")
|
||||||
|
suspend fun getIntImpTallySubList(@Body data: RequestBody): BaseResultBean<List<GjjImportTally>>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 国际进港理货-人工放行
|
||||||
|
*/
|
||||||
|
@POST("IntImpTally/customCommand")
|
||||||
|
suspend fun intImpTallyCustomCommand(@Body data: RequestBody): BaseResultBean<Boolean>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 国际进港理货-状态重置
|
||||||
|
*/
|
||||||
|
@POST("IntImpTally/resetDeclare")
|
||||||
|
suspend fun intImpTallyResetDeclare(@Body data: RequestBody): BaseResultBean<Boolean>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 国际进港理货-删除申报
|
||||||
|
*/
|
||||||
|
@POST("IntImpTally/deleteDeclare")
|
||||||
|
suspend fun intImpTallyDeleteDeclare(@Body data: RequestBody): BaseResultBean<Boolean>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 国际进港理货-理货申报
|
||||||
|
*/
|
||||||
|
@POST("IntImpTally/declare")
|
||||||
|
suspend fun intImpTallyDeclare(@Body data: RequestBody): BaseResultBean<Boolean>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 国际进港舱单-货物发放
|
||||||
|
*/
|
||||||
|
@POST("IntImpManifest/putUpCargo")
|
||||||
|
suspend fun intImpManifestPutUpCargo(@Body data: RequestBody): BaseResultBean<String>
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
// 国际进港-事故签证
|
// 国际进港-事故签证
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
@@ -1868,6 +1969,42 @@ interface Api {
|
|||||||
@POST("GjAccidentVisa/delete")
|
@POST("GjAccidentVisa/delete")
|
||||||
suspend fun deleteIntImpAccidentVisa(@Body data: RequestBody): BaseResultBean<String>
|
suspend fun deleteIntImpAccidentVisa(@Body data: RequestBody): BaseResultBean<String>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 国际事故签证-新增
|
||||||
|
*/
|
||||||
|
@POST("GjAccidentVisa/saveVisa")
|
||||||
|
suspend fun saveGjAccidentVisa(@Body data: RequestBody): BaseResultBean<String>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 国际事故签证-修改
|
||||||
|
*/
|
||||||
|
@POST("GjAccidentVisa/modifyVisa")
|
||||||
|
suspend fun modifyGjAccidentVisa(@Body data: RequestBody): BaseResultBean<String>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 国际事故签证-详情
|
||||||
|
*/
|
||||||
|
@POST("GjAccidentVisa/detail")
|
||||||
|
suspend fun getGjAccidentVisaDetail(@Query("id") id: Long): BaseResultBean<GjAccidentVisaEditBean>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 字典-破损情况
|
||||||
|
*/
|
||||||
|
@POST("typeCode/damageType")
|
||||||
|
suspend fun getDamageTypeList(): DictListBean
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 字典-内容物情况
|
||||||
|
*/
|
||||||
|
@POST("typeCode/contentType")
|
||||||
|
suspend fun getContentTypeList(): DictListBean
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 字典-不正常类型
|
||||||
|
*/
|
||||||
|
@POST("typeCode/unusualType")
|
||||||
|
suspend fun getUnusualTypeList(): DictListBean
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
// ULD管理
|
// ULD管理
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
|
|||||||
@@ -57,3 +57,42 @@ class UpperCaseAlphanumericInputFilter : InputFilter {
|
|||||||
fun EditText.setUpperCaseAlphanumericFilter() {
|
fun EditText.setUpperCaseAlphanumericFilter() {
|
||||||
this.filters = arrayOf(UpperCaseAlphanumericInputFilter())
|
this.filters = arrayOf(UpperCaseAlphanumericInputFilter())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 大写字母输入过滤器
|
||||||
|
* 只允许输入大写字母(A-Z),小写字母自动转为大写
|
||||||
|
*/
|
||||||
|
class UpperCaseLetterInputFilter : InputFilter {
|
||||||
|
override fun filter(
|
||||||
|
source: CharSequence?,
|
||||||
|
start: Int,
|
||||||
|
end: Int,
|
||||||
|
dest: Spanned?,
|
||||||
|
dstart: Int,
|
||||||
|
dend: Int
|
||||||
|
): CharSequence? {
|
||||||
|
if (source.isNullOrEmpty()) return null
|
||||||
|
|
||||||
|
val filtered = StringBuilder()
|
||||||
|
for (i in start until end) {
|
||||||
|
val char = source[i]
|
||||||
|
if (char in 'A'..'Z' || char in 'a'..'z') {
|
||||||
|
filtered.append(char.uppercaseChar())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return if (filtered.toString() == source.subSequence(start, end).toString()) {
|
||||||
|
null
|
||||||
|
} else {
|
||||||
|
filtered.toString()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 为 EditText 设置大写字母输入过滤器
|
||||||
|
* 使用方式: editText.setUpperCaseLetterFilter()
|
||||||
|
*/
|
||||||
|
fun EditText.setUpperCaseLetterFilter() {
|
||||||
|
this.filters = arrayOf(UpperCaseLetterInputFilter())
|
||||||
|
}
|
||||||
@@ -175,6 +175,7 @@ object ARouterConstants {
|
|||||||
const val ACTIVITY_URL_INT_ARR_AIR_MANIFEST_DETAILS = "/gjj/IntArrAirManifestDetailsActivity" //国际进港 原始舱单详情
|
const val ACTIVITY_URL_INT_ARR_AIR_MANIFEST_DETAILS = "/gjj/IntArrAirManifestDetailsActivity" //国际进港 原始舱单详情
|
||||||
const val ACTIVITY_URL_INT_ARR_SUPPLEMENT_INFO = "/gjj/IntArrSupplementInfoActivity" //国际进港 补充信息
|
const val ACTIVITY_URL_INT_ARR_SUPPLEMENT_INFO = "/gjj/IntArrSupplementInfoActivity" //国际进港 补充信息
|
||||||
const val ACTIVITY_URL_INT_IMP_MANIFEST = "/gjj/IntImpManifestActivity" //国际进港 进港舱单
|
const val ACTIVITY_URL_INT_IMP_MANIFEST = "/gjj/IntImpManifestActivity" //国际进港 进港舱单
|
||||||
|
const val ACTIVITY_URL_INT_IMP_MANIFEST_DETAILS = "/gjj/IntImpManifestDetailsActivity" //国际进港 进港舱单详情
|
||||||
const val ACTIVITY_URL_INT_IMP_LOADING_LIST = "/gjj/IntImpLoadingListActivity" //国际进港 装机单(分拣理货)
|
const val ACTIVITY_URL_INT_IMP_LOADING_LIST = "/gjj/IntImpLoadingListActivity" //国际进港 装机单(分拣理货)
|
||||||
const val ACTIVITY_URL_INT_IMP_TALLY = "/gjj/IntImpTallyActivity" //国际进港 理货报告
|
const val ACTIVITY_URL_INT_IMP_TALLY = "/gjj/IntImpTallyActivity" //国际进港 理货报告
|
||||||
const val ACTIVITY_URL_INT_IMP_PICK_UP_DLV = "/gjj/IntImpPickUpDLVActivity" //国际进港 提取出库
|
const val ACTIVITY_URL_INT_IMP_PICK_UP_DLV = "/gjj/IntImpPickUpDLVActivity" //国际进港 提取出库
|
||||||
|
|||||||
@@ -47,7 +47,9 @@ fun setDataLayoutData(
|
|||||||
hint?.let {
|
hint?.let {
|
||||||
dataLayout.hint = hint
|
dataLayout.hint = hint
|
||||||
}
|
}
|
||||||
dataLayout.icon = icon
|
icon?.let {
|
||||||
|
dataLayout.icon = it
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -189,7 +191,9 @@ fun setDataLayoutDataNew(
|
|||||||
hint?.let {
|
hint?.let {
|
||||||
dataLayout.hint = hint
|
dataLayout.hint = hint
|
||||||
}
|
}
|
||||||
dataLayout.icon = icon
|
icon?.let {
|
||||||
|
dataLayout.icon = it
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -212,6 +212,11 @@ class PadDataLayout : FrameLayout {
|
|||||||
et.visibility = GONE
|
et.visibility = GONE
|
||||||
spinner.visibility = GONE
|
spinner.visibility = GONE
|
||||||
tvSpinner.visibility = GONE
|
tvSpinner.visibility = GONE
|
||||||
|
iv.visibility = VISIBLE
|
||||||
|
iv.setImageResource(R.mipmap.img_date)
|
||||||
|
val dp20 = dev.utils.app.SizeUtils.dp2px(20f)
|
||||||
|
iv.layoutParams.width = dp20
|
||||||
|
iv.layoutParams.height = dp20
|
||||||
|
|
||||||
setOnClickListener(dateClick)
|
setOnClickListener(dateClick)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -96,6 +96,7 @@ class PadDataLayoutNew : FrameLayout {
|
|||||||
field = value
|
field = value
|
||||||
|
|
||||||
et.hint = value
|
et.hint = value
|
||||||
|
tv.hint = value
|
||||||
bindAdapter(spinner, list, hint)
|
bindAdapter(spinner, list, hint)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -239,6 +240,11 @@ class PadDataLayoutNew : FrameLayout {
|
|||||||
et.visibility = GONE
|
et.visibility = GONE
|
||||||
spinner.visibility = GONE
|
spinner.visibility = GONE
|
||||||
tvSpinner.visibility = GONE
|
tvSpinner.visibility = GONE
|
||||||
|
iv.visibility = VISIBLE
|
||||||
|
iv.setImageResource(R.mipmap.img_date)
|
||||||
|
val dp20 = dev.utils.app.SizeUtils.dp2px(20f)
|
||||||
|
iv.layoutParams.width = dp20
|
||||||
|
iv.layoutParams.height = dp20
|
||||||
|
|
||||||
setOnClickListener(dateClick)
|
setOnClickListener(dateClick)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -102,6 +102,24 @@ object DictUtils {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取国际进港代理列表
|
||||||
|
*/
|
||||||
|
fun getIntImpAgentList(
|
||||||
|
addAll: Boolean = true,
|
||||||
|
checkedValue: String? = null,
|
||||||
|
callBack: (List<KeyValue>) -> Unit
|
||||||
|
) {
|
||||||
|
launchCollect({
|
||||||
|
NetApply.api
|
||||||
|
.getIntImpAgentList()
|
||||||
|
}) {
|
||||||
|
onSuccess = {
|
||||||
|
handleCallBack(it, checkedValue, addAll, callBack)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取仓管列表
|
* 获取仓管列表
|
||||||
*/
|
*/
|
||||||
@@ -439,14 +457,14 @@ object DictUtils {
|
|||||||
/**
|
/**
|
||||||
* 地区类型
|
* 地区类型
|
||||||
*/
|
*/
|
||||||
fun getAreaTypeList(
|
fun getCountryTypeList(
|
||||||
addAll: Boolean = true,
|
addAll: Boolean = true,
|
||||||
checkedValue: String? = null,
|
checkedValue: String? = null,
|
||||||
callBack: (List<KeyValue>) -> Unit
|
callBack: (List<KeyValue>) -> Unit
|
||||||
) {
|
) {
|
||||||
launchCollect({
|
launchCollect({
|
||||||
NetApply.api
|
NetApply.api
|
||||||
.getAreaTypeList()
|
.getCountryTypeList()
|
||||||
}) {
|
}) {
|
||||||
onSuccess = {
|
onSuccess = {
|
||||||
handleCallBack(it, checkedValue, addAll, callBack)
|
handleCallBack(it, checkedValue, addAll, callBack)
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 775 B |
BIN
module_base/src/main/res/drawable-xhdpi/img_log.png
Normal file
BIN
module_base/src/main/res/drawable-xhdpi/img_log.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.0 KiB |
@@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:width="24dp"
|
android:width="200dp"
|
||||||
android:height="24dp"
|
android:height="200dp"
|
||||||
android:viewportWidth="24"
|
android:viewportWidth="24"
|
||||||
android:viewportHeight="24">
|
android:viewportHeight="24">
|
||||||
<path
|
<path
|
||||||
|
|||||||
@@ -10,9 +10,9 @@
|
|||||||
|
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
android:id="@+id/rl"
|
android:id="@+id/rl"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="100dp"
|
||||||
android:layout_height="150dp"
|
android:layout_height="100dp"
|
||||||
android:layout_margin="10dp"
|
android:layout_margin="5dp"
|
||||||
android:background="@color/white">
|
android:background="@color/white">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
|
|||||||
@@ -3,7 +3,12 @@ package com.lukouguoji.gjc.activity
|
|||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
|
import android.view.Gravity
|
||||||
|
import android.widget.ImageView
|
||||||
|
import android.widget.LinearLayout
|
||||||
|
import androidx.appcompat.widget.Toolbar
|
||||||
import com.alibaba.android.arouter.facade.annotation.Route
|
import com.alibaba.android.arouter.facade.annotation.Route
|
||||||
|
import com.alibaba.android.arouter.launcher.ARouter
|
||||||
import com.lukouguoji.gjc.R
|
import com.lukouguoji.gjc.R
|
||||||
import com.lukouguoji.gjc.databinding.ActivityGjcQueryDetailsBinding
|
import com.lukouguoji.gjc.databinding.ActivityGjcQueryDetailsBinding
|
||||||
import com.lukouguoji.gjc.viewModel.GjcQueryDetailsViewModel
|
import com.lukouguoji.gjc.viewModel.GjcQueryDetailsViewModel
|
||||||
@@ -43,10 +48,37 @@ class GjcQueryDetailsActivity :
|
|||||||
binding.vp.setCurrentItem(it, false) // false:无动画
|
binding.vp.setCurrentItem(it, false) // false:无动画
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 标题栏右侧添加日志查询图标
|
||||||
|
val toolbar = findViewById<Toolbar>(com.lukouguoji.module_base.R.id.toolbar)
|
||||||
|
val logIcon = ImageView(this).apply {
|
||||||
|
setImageResource(com.lukouguoji.module_base.R.drawable.img_log)
|
||||||
|
layoutParams = Toolbar.LayoutParams(
|
||||||
|
LinearLayout.LayoutParams.WRAP_CONTENT,
|
||||||
|
LinearLayout.LayoutParams.WRAP_CONTENT
|
||||||
|
).apply {
|
||||||
|
gravity = Gravity.END or Gravity.CENTER_VERTICAL
|
||||||
|
marginEnd = 15
|
||||||
|
width = 30.dp
|
||||||
|
height = 30.dp
|
||||||
|
}
|
||||||
|
setOnClickListener {
|
||||||
|
val wbNo = viewModel.maWbData.value?.get("wbNo") as? String ?: ""
|
||||||
|
ARouter.getInstance()
|
||||||
|
.build(ARouterConstants.ACTIVITY_URL_LOG_DETAIL)
|
||||||
|
.withString(Constant.Key.KEY, wbNo)
|
||||||
|
.withString(Constant.Key.AWB_TYPE, "IO")
|
||||||
|
.navigation()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
toolbar.addView(logIcon)
|
||||||
|
|
||||||
// 加载详情数据
|
// 加载详情数据
|
||||||
viewModel.loadDetails()
|
viewModel.loadDetails()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private val Int.dp: Int
|
||||||
|
get() = (this * resources!!.displayMetrics.density).toInt()
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
@JvmStatic
|
@JvmStatic
|
||||||
fun start(context: Context, maWbId: Long?) {
|
fun start(context: Context, maWbId: Long?) {
|
||||||
|
|||||||
@@ -100,11 +100,10 @@
|
|||||||
|
|
||||||
<!-- 添加按钮 -->
|
<!-- 添加按钮 -->
|
||||||
<ImageView
|
<ImageView
|
||||||
android:layout_width="36dp"
|
android:layout_width="40dp"
|
||||||
android:layout_height="36dp"
|
android:layout_height="40dp"
|
||||||
android:layout_marginLeft="16dp"
|
android:layout_marginLeft="16dp"
|
||||||
android:onClick="@{()-> viewModel.addClick()}"
|
android:onClick="@{()-> viewModel.addClick()}"
|
||||||
android:padding="4dp"
|
|
||||||
android:src="@drawable/img_add" />
|
android:src="@drawable/img_add" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|||||||
@@ -104,11 +104,10 @@
|
|||||||
|
|
||||||
<!-- 添加按钮 -->
|
<!-- 添加按钮 -->
|
||||||
<ImageView
|
<ImageView
|
||||||
android:layout_width="36dp"
|
android:layout_width="40dp"
|
||||||
android:layout_height="36dp"
|
android:layout_height="40dp"
|
||||||
android:layout_marginLeft="16dp"
|
android:layout_marginLeft="16dp"
|
||||||
android:onClick="@{()-> viewModel.addClick()}"
|
android:onClick="@{()-> viewModel.addClick()}"
|
||||||
android:padding="4dp"
|
|
||||||
android:src="@drawable/img_add" />
|
android:src="@drawable/img_add" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|||||||
@@ -97,11 +97,10 @@
|
|||||||
|
|
||||||
<!-- 新<><E696B0><EFBFBD>按钮 -->
|
<!-- 新<><E696B0><EFBFBD>按钮 -->
|
||||||
<ImageView
|
<ImageView
|
||||||
android:layout_width="36dp"
|
android:layout_width="40dp"
|
||||||
android:layout_height="36dp"
|
android:layout_height="40dp"
|
||||||
android:layout_marginLeft="16dp"
|
android:layout_marginLeft="16dp"
|
||||||
android:onClick="@{()-> viewModel.onAddClick()}"
|
android:onClick="@{()-> viewModel.onAddClick()}"
|
||||||
android:padding="4dp"
|
|
||||||
android:src="@drawable/img_add" />
|
android:src="@drawable/img_add" />
|
||||||
|
|
||||||
<!-- 删除按钮 -->
|
<!-- 删除按钮 -->
|
||||||
|
|||||||
@@ -2,8 +2,8 @@ package com.lukouguoji.gjj.activity
|
|||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import androidx.appcompat.app.AppCompatActivity
|
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
|
import android.text.InputType
|
||||||
import com.lukouguoji.gjj.R
|
import com.lukouguoji.gjj.R
|
||||||
import com.lukouguoji.gjj.databinding.ActivityGjjManifestAddBinding
|
import com.lukouguoji.gjj.databinding.ActivityGjjManifestAddBinding
|
||||||
import com.lukouguoji.gjj.viewModel.GjjManifestAddViewModel
|
import com.lukouguoji.gjj.viewModel.GjjManifestAddViewModel
|
||||||
@@ -11,6 +11,7 @@ import com.lukouguoji.module_base.base.BaseBindingActivity
|
|||||||
import com.lukouguoji.module_base.common.Constant
|
import com.lukouguoji.module_base.common.Constant
|
||||||
import com.lukouguoji.module_base.common.DetailsPageType
|
import com.lukouguoji.module_base.common.DetailsPageType
|
||||||
import com.lukouguoji.module_base.ktx.noNull
|
import com.lukouguoji.module_base.ktx.noNull
|
||||||
|
import com.lukouguoji.module_base.ktx.setUpperCaseAlphanumericFilter
|
||||||
|
|
||||||
class GjjManifestAddActivity :
|
class GjjManifestAddActivity :
|
||||||
BaseBindingActivity<ActivityGjjManifestAddBinding, GjjManifestAddViewModel>() {
|
BaseBindingActivity<ActivityGjjManifestAddBinding, GjjManifestAddViewModel>() {
|
||||||
@@ -20,15 +21,24 @@ class GjjManifestAddActivity :
|
|||||||
override fun viewModelClass() = GjjManifestAddViewModel::class.java
|
override fun viewModelClass() = GjjManifestAddViewModel::class.java
|
||||||
|
|
||||||
override fun initOnCreate(savedInstanceState: Bundle?) {
|
override fun initOnCreate(savedInstanceState: Bundle?) {
|
||||||
// 动态设置标题
|
binding.viewModel = viewModel
|
||||||
val title = when {
|
binding.flightNoInput.et.setUpperCaseAlphanumericFilter()
|
||||||
viewModel.pageType.value == DetailsPageType.Modify -> "国际进港舱单编辑"
|
|
||||||
|
// 件数只允许输入整数
|
||||||
|
binding.waybillNumInput.inputType = InputType.TYPE_CLASS_NUMBER
|
||||||
|
binding.actualNumInput.inputType = InputType.TYPE_CLASS_NUMBER
|
||||||
|
// 重量允许输入小数
|
||||||
|
binding.actualWeightInput.inputType = InputType.TYPE_CLASS_NUMBER or InputType.TYPE_NUMBER_FLAG_DECIMAL
|
||||||
|
binding.billingWeightInput.inputType = InputType.TYPE_CLASS_NUMBER or InputType.TYPE_NUMBER_FLAG_DECIMAL
|
||||||
|
|
||||||
|
viewModel.initOnCreated(intent)
|
||||||
|
|
||||||
|
// 动态设置标题(必须在 initOnCreated 之后,pageType 已从 Intent 解析)
|
||||||
|
val title = when (viewModel.pageType.value) {
|
||||||
|
DetailsPageType.Modify -> "国际进港舱单编辑"
|
||||||
else -> "国际进港舱单新增"
|
else -> "国际进港舱单新增"
|
||||||
}
|
}
|
||||||
setBackArrow(title)
|
setBackArrow(title)
|
||||||
|
|
||||||
binding.viewModel = viewModel
|
|
||||||
viewModel.initOnCreated(intent)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
@@ -36,12 +46,21 @@ class GjjManifestAddActivity :
|
|||||||
* 新增舱单
|
* 新增舱单
|
||||||
*/
|
*/
|
||||||
@JvmStatic
|
@JvmStatic
|
||||||
fun start(context: Context, fid: String = "", dep: String, dest: String) {
|
fun start(
|
||||||
|
context: Context,
|
||||||
|
fid: String = "",
|
||||||
|
dep: String,
|
||||||
|
dest: String,
|
||||||
|
flightDate: String = "",
|
||||||
|
flightNo: String = ""
|
||||||
|
) {
|
||||||
val starter = Intent(context, GjjManifestAddActivity::class.java)
|
val starter = Intent(context, GjjManifestAddActivity::class.java)
|
||||||
.putExtra(Constant.Key.PAGE_TYPE, DetailsPageType.Add.name)
|
.putExtra(Constant.Key.PAGE_TYPE, DetailsPageType.Add.name)
|
||||||
.putExtra(Constant.Key.ID, fid)
|
.putExtra(Constant.Key.ID, fid)
|
||||||
.putExtra(Constant.Key.DEPARTURE, dep)
|
.putExtra(Constant.Key.DEPARTURE, dep)
|
||||||
.putExtra(Constant.Key.DESTINATION, dest)
|
.putExtra(Constant.Key.DESTINATION, dest)
|
||||||
|
.putExtra("flightDate", flightDate)
|
||||||
|
.putExtra("flightNo", flightNo)
|
||||||
context.startActivity(starter)
|
context.startActivity(starter)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -49,10 +68,17 @@ class GjjManifestAddActivity :
|
|||||||
* 编辑舱单(通过Bean对象)
|
* 编辑舱单(通过Bean对象)
|
||||||
*/
|
*/
|
||||||
@JvmStatic
|
@JvmStatic
|
||||||
fun startForEdit(context: Context, bean: com.lukouguoji.module_base.bean.GjjManifest) {
|
fun startForEdit(
|
||||||
|
context: Context,
|
||||||
|
bean: com.lukouguoji.module_base.bean.GjjManifest,
|
||||||
|
flightDate: String = "",
|
||||||
|
flightNo: String = ""
|
||||||
|
) {
|
||||||
val starter = Intent(context, GjjManifestAddActivity::class.java)
|
val starter = Intent(context, GjjManifestAddActivity::class.java)
|
||||||
.putExtra(Constant.Key.PAGE_TYPE, DetailsPageType.Modify.name)
|
.putExtra(Constant.Key.PAGE_TYPE, DetailsPageType.Modify.name)
|
||||||
.putExtra(Constant.Key.BEAN, bean)
|
.putExtra(Constant.Key.BEAN, bean)
|
||||||
|
.putExtra("flightDate", flightDate)
|
||||||
|
.putExtra("flightNo", flightNo)
|
||||||
context.startActivity(starter)
|
context.startActivity(starter)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ import com.lukouguoji.module_base.BaseActivity
|
|||||||
import com.lukouguoji.module_base.common.Constant
|
import com.lukouguoji.module_base.common.Constant
|
||||||
import com.lukouguoji.module_base.router.ARouterConstants
|
import com.lukouguoji.module_base.router.ARouterConstants
|
||||||
|
|
||||||
@Route(path = ARouterConstants.ACTIVITY_URL_GJJ_QUERY_INFO)
|
// @Route(path = ARouterConstants.ACTIVITY_URL_GJJ_QUERY_INFO) // 已替换为 IntImpQueryDetailsActivity
|
||||||
class GjjQueryInfoActivity : BaseActivity(), View.OnClickListener {
|
class GjjQueryInfoActivity : BaseActivity(), View.OnClickListener {
|
||||||
|
|
||||||
private lateinit var viewModel: GjjQueryInfoViewModel
|
private lateinit var viewModel: GjjQueryInfoViewModel
|
||||||
|
|||||||
@@ -8,10 +8,14 @@ import com.lukouguoji.gjj.R
|
|||||||
import com.lukouguoji.gjj.databinding.ActivityIntImpAccidentVisaBinding
|
import com.lukouguoji.gjj.databinding.ActivityIntImpAccidentVisaBinding
|
||||||
import com.lukouguoji.gjj.viewModel.IntImpAccidentVisaViewModel
|
import com.lukouguoji.gjj.viewModel.IntImpAccidentVisaViewModel
|
||||||
import com.lukouguoji.module_base.base.BaseBindingActivity
|
import com.lukouguoji.module_base.base.BaseBindingActivity
|
||||||
|
import com.lukouguoji.module_base.bean.IntImpAccidentVisaBean
|
||||||
import com.lukouguoji.module_base.common.Constant
|
import com.lukouguoji.module_base.common.Constant
|
||||||
import com.lukouguoji.module_base.common.ConstantEvent
|
import com.lukouguoji.module_base.common.ConstantEvent
|
||||||
import com.lukouguoji.module_base.impl.FlowBus
|
import com.lukouguoji.module_base.impl.FlowBus
|
||||||
import com.lukouguoji.module_base.impl.observe
|
import com.lukouguoji.module_base.impl.observe
|
||||||
|
import com.lukouguoji.module_base.interfaces.IOnItemClickListener
|
||||||
|
import com.lukouguoji.module_base.ktx.addOnItemClickListener
|
||||||
|
import com.lukouguoji.module_base.ktx.commonAdapter
|
||||||
import com.lukouguoji.module_base.router.ARouterConstants
|
import com.lukouguoji.module_base.router.ARouterConstants
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -19,7 +23,8 @@ import com.lukouguoji.module_base.router.ARouterConstants
|
|||||||
*/
|
*/
|
||||||
@Route(path = ARouterConstants.ACTIVITY_URL_INT_IMP_ACCIDENT_VISA)
|
@Route(path = ARouterConstants.ACTIVITY_URL_INT_IMP_ACCIDENT_VISA)
|
||||||
class IntImpAccidentVisaActivity :
|
class IntImpAccidentVisaActivity :
|
||||||
BaseBindingActivity<ActivityIntImpAccidentVisaBinding, IntImpAccidentVisaViewModel>() {
|
BaseBindingActivity<ActivityIntImpAccidentVisaBinding, IntImpAccidentVisaViewModel>(),
|
||||||
|
IOnItemClickListener {
|
||||||
|
|
||||||
override fun layoutId() = R.layout.activity_int_imp_accident_visa
|
override fun layoutId() = R.layout.activity_int_imp_accident_visa
|
||||||
override fun viewModelClass() = IntImpAccidentVisaViewModel::class.java
|
override fun viewModelClass() = IntImpAccidentVisaViewModel::class.java
|
||||||
@@ -34,6 +39,8 @@ class IntImpAccidentVisaActivity :
|
|||||||
|
|
||||||
viewModel.pageModel.bindSmartRefreshLayout(binding.srl, binding.rv, viewModel, this)
|
viewModel.pageModel.bindSmartRefreshLayout(binding.srl, binding.rv, viewModel, this)
|
||||||
|
|
||||||
|
binding.rv.addOnItemClickListener(this)
|
||||||
|
|
||||||
FlowBus.with<String>(ConstantEvent.EVENT_REFRESH).observe(this) {
|
FlowBus.with<String>(ConstantEvent.EVENT_REFRESH).observe(this) {
|
||||||
viewModel.refresh()
|
viewModel.refresh()
|
||||||
}
|
}
|
||||||
@@ -48,4 +55,23 @@ class IntImpAccidentVisaActivity :
|
|||||||
viewModel.searchClick()
|
viewModel.searchClick()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun onItemClick(position: Int, type: Int) {
|
||||||
|
val bean = binding.rv.commonAdapter()?.getItem(position) as? IntImpAccidentVisaBean
|
||||||
|
?: return
|
||||||
|
when (type) {
|
||||||
|
1000 -> {
|
||||||
|
// 点击列表项 - 查看详情
|
||||||
|
IntImpAccidentVisaEditActivity.start(this, bean.id, isDetail = true)
|
||||||
|
}
|
||||||
|
2000 -> {
|
||||||
|
// 侧滑菜单 - 修改
|
||||||
|
IntImpAccidentVisaEditActivity.start(this, bean.id)
|
||||||
|
}
|
||||||
|
3000 -> {
|
||||||
|
// 侧滑菜单 - 删除
|
||||||
|
viewModel.singleDelete(bean)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,58 @@
|
|||||||
|
package com.lukouguoji.gjj.activity
|
||||||
|
|
||||||
|
import android.content.Context
|
||||||
|
import android.content.Intent
|
||||||
|
import android.os.Bundle
|
||||||
|
import com.lukouguoji.gjj.R
|
||||||
|
import com.lukouguoji.gjj.databinding.ActivityIntImpAccidentVisaEditBinding
|
||||||
|
import com.lukouguoji.gjj.viewModel.IntImpAccidentVisaEditViewModel
|
||||||
|
import com.lukouguoji.module_base.base.BaseBindingActivity
|
||||||
|
import com.lukouguoji.module_base.common.Constant
|
||||||
|
import com.lukouguoji.module_base.common.DetailsPageType
|
||||||
|
import com.lukouguoji.module_base.ktx.addOnItemClickListener
|
||||||
|
import com.lukouguoji.module_base.ktx.setUpperCaseAlphanumericFilter
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 国际进港-事故签证新增/编辑
|
||||||
|
*/
|
||||||
|
class IntImpAccidentVisaEditActivity :
|
||||||
|
BaseBindingActivity<ActivityIntImpAccidentVisaEditBinding, IntImpAccidentVisaEditViewModel>() {
|
||||||
|
|
||||||
|
override fun layoutId() = R.layout.activity_int_imp_accident_visa_edit
|
||||||
|
override fun viewModelClass() = IntImpAccidentVisaEditViewModel::class.java
|
||||||
|
|
||||||
|
override fun initOnCreate(savedInstanceState: Bundle?) {
|
||||||
|
binding.viewModel = viewModel
|
||||||
|
|
||||||
|
// 航班号:大写字母+数字
|
||||||
|
binding.fnoInput.et.setUpperCaseAlphanumericFilter()
|
||||||
|
// 运单号:大写字母+数字
|
||||||
|
binding.wbNoInput.et.setUpperCaseAlphanumericFilter()
|
||||||
|
|
||||||
|
viewModel.rv = binding.rv
|
||||||
|
binding.rv.addOnItemClickListener(viewModel)
|
||||||
|
viewModel.initOnCreate(intent)
|
||||||
|
|
||||||
|
viewModel.pageType.observe(this) {
|
||||||
|
val title = when (it) {
|
||||||
|
DetailsPageType.Add -> "国际事故签证新增"
|
||||||
|
DetailsPageType.Details -> "国际事故签证详情"
|
||||||
|
else -> "国际事故签证修改"
|
||||||
|
}
|
||||||
|
setBackArrow(title)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
private const val KEY_IS_DETAIL = "is_detail"
|
||||||
|
|
||||||
|
@JvmStatic
|
||||||
|
fun start(context: Context, id: Long = 0, isDetail: Boolean = false) {
|
||||||
|
context.startActivity(
|
||||||
|
Intent(context, IntImpAccidentVisaEditActivity::class.java)
|
||||||
|
.putExtra(Constant.Key.ID, id)
|
||||||
|
.putExtra(KEY_IS_DETAIL, isDetail)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -51,10 +51,19 @@ class IntImpLoadingListActivity :
|
|||||||
viewModel.refresh()
|
viewModel.refresh()
|
||||||
}
|
}
|
||||||
|
|
||||||
// 接收从进港舱单传递的参数
|
// 设置运单号自动查询的额外参数(FID、FDGP)
|
||||||
|
binding.pslWaybillNo.autoQueryConfig.extraParamsProvider = {
|
||||||
|
mapOf(
|
||||||
|
"fid" to viewModel.fid,
|
||||||
|
"fdep" to viewModel.fdep
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 接收从进港舱单传递的参数(FID和FDGP用于查询,fdate/fno/fdest用于界面显示)
|
||||||
|
intent.getStringExtra("fid")?.let { if (it.isNotEmpty()) viewModel.fid = it }
|
||||||
|
intent.getStringExtra("fdep")?.let { if (it.isNotEmpty()) viewModel.fdep = it }
|
||||||
intent.getStringExtra("fdate")?.let { if (it.isNotEmpty()) viewModel.flightDate.value = it }
|
intent.getStringExtra("fdate")?.let { if (it.isNotEmpty()) viewModel.flightDate.value = it }
|
||||||
intent.getStringExtra("fno")?.let { if (it.isNotEmpty()) viewModel.flightNo.value = it }
|
intent.getStringExtra("fno")?.let { if (it.isNotEmpty()) viewModel.flightNo.value = it }
|
||||||
intent.getStringExtra("sendAddress")?.let { if (it.isNotEmpty()) viewModel.sendAddress.value = it }
|
|
||||||
intent.getStringExtra("fdest")?.let { if (it.isNotEmpty()) viewModel.fdest.value = it }
|
intent.getStringExtra("fdest")?.let { if (it.isNotEmpty()) viewModel.fdest.value = it }
|
||||||
|
|
||||||
// 如果收到了航班号和日期参数,触发航班查询来构建始发站下拉列表
|
// 如果收到了航班号和日期参数,触发航班查询来构建始发站下拉列表
|
||||||
|
|||||||
@@ -0,0 +1,37 @@
|
|||||||
|
package com.lukouguoji.gjj.activity
|
||||||
|
|
||||||
|
import android.content.Context
|
||||||
|
import android.content.Intent
|
||||||
|
import android.os.Bundle
|
||||||
|
import com.google.gson.Gson
|
||||||
|
import com.lukouguoji.gjj.R
|
||||||
|
import com.lukouguoji.gjj.databinding.ActivityIntImpLoadingListEditBinding
|
||||||
|
import com.lukouguoji.gjj.viewModel.IntImpLoadingListEditViewModel
|
||||||
|
import com.lukouguoji.module_base.base.BaseBindingActivity
|
||||||
|
import com.lukouguoji.module_base.bean.GjjManifest
|
||||||
|
import com.lukouguoji.module_base.common.Constant
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 国际进港-装机单编辑页面
|
||||||
|
*/
|
||||||
|
class IntImpLoadingListEditActivity :
|
||||||
|
BaseBindingActivity<ActivityIntImpLoadingListEditBinding, IntImpLoadingListEditViewModel>() {
|
||||||
|
|
||||||
|
override fun layoutId() = R.layout.activity_int_imp_loading_list_edit
|
||||||
|
override fun viewModelClass() = IntImpLoadingListEditViewModel::class.java
|
||||||
|
|
||||||
|
override fun initOnCreate(savedInstanceState: Bundle?) {
|
||||||
|
setBackArrow("装机单编辑")
|
||||||
|
binding.viewModel = viewModel
|
||||||
|
viewModel.initOnCreated(intent)
|
||||||
|
}
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
@JvmStatic
|
||||||
|
fun start(context: Context, bean: GjjManifest) {
|
||||||
|
val starter = Intent(context, IntImpLoadingListEditActivity::class.java)
|
||||||
|
.putExtra(Constant.Key.DATA, Gson().toJson(bean))
|
||||||
|
context.startActivity(starter)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -44,6 +44,14 @@ class IntImpManifestActivity :
|
|||||||
FlowBus.with<String>(ConstantEvent.EVENT_REFRESH).observe(this) {
|
FlowBus.with<String>(ConstantEvent.EVENT_REFRESH).observe(this) {
|
||||||
viewModel.refresh()
|
viewModel.refresh()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 设置运单号自动查询的额外参数(FID、FDGP)
|
||||||
|
binding.pslWaybillNo.autoQueryConfig.extraParamsProvider = {
|
||||||
|
mapOf(
|
||||||
|
"fid" to viewModel.fid,
|
||||||
|
"fdep" to viewModel.fdep
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
|
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
|
||||||
|
|||||||
@@ -0,0 +1,39 @@
|
|||||||
|
package com.lukouguoji.gjj.activity
|
||||||
|
|
||||||
|
import android.content.Context
|
||||||
|
import android.content.Intent
|
||||||
|
import android.os.Bundle
|
||||||
|
import com.alibaba.android.arouter.facade.annotation.Route
|
||||||
|
import com.lukouguoji.gjj.R
|
||||||
|
import com.lukouguoji.gjj.databinding.ActivityIntImpManifestDetailsBinding
|
||||||
|
import com.lukouguoji.gjj.viewModel.IntImpManifestDetailsViewModel
|
||||||
|
import com.lukouguoji.module_base.base.BaseBindingActivity
|
||||||
|
import com.lukouguoji.module_base.bean.GjjManifest
|
||||||
|
import com.lukouguoji.module_base.common.Constant
|
||||||
|
import com.lukouguoji.module_base.router.ARouterConstants
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 国际进港舱单详情
|
||||||
|
*/
|
||||||
|
@Route(path = ARouterConstants.ACTIVITY_URL_INT_IMP_MANIFEST_DETAILS)
|
||||||
|
class IntImpManifestDetailsActivity :
|
||||||
|
BaseBindingActivity<ActivityIntImpManifestDetailsBinding, IntImpManifestDetailsViewModel>() {
|
||||||
|
|
||||||
|
override fun layoutId() = R.layout.activity_int_imp_manifest_details
|
||||||
|
override fun viewModelClass() = IntImpManifestDetailsViewModel::class.java
|
||||||
|
|
||||||
|
override fun initOnCreate(savedInstanceState: Bundle?) {
|
||||||
|
setBackArrow("进港舱单详情")
|
||||||
|
binding.viewModel = viewModel
|
||||||
|
viewModel.initOnCreated(intent)
|
||||||
|
}
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
@JvmStatic
|
||||||
|
fun start(context: Context, manifest: GjjManifest) {
|
||||||
|
val starter = Intent(context, IntImpManifestDetailsActivity::class.java)
|
||||||
|
.putExtra(Constant.Key.DATA, manifest)
|
||||||
|
context.startActivity(starter)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,80 @@
|
|||||||
|
package com.lukouguoji.gjj.activity
|
||||||
|
|
||||||
|
import android.content.Context
|
||||||
|
import android.content.Intent
|
||||||
|
import android.os.Bundle
|
||||||
|
import com.lukouguoji.gjj.R
|
||||||
|
import com.lukouguoji.gjj.databinding.ActivityIntImpManifestSubEditBinding
|
||||||
|
import com.lukouguoji.gjj.viewModel.IntImpManifestSubEditViewModel
|
||||||
|
import com.lukouguoji.module_base.base.BaseBindingActivity
|
||||||
|
import com.lukouguoji.module_base.bean.GjjHaWb
|
||||||
|
import com.lukouguoji.module_base.bean.GjjManifest
|
||||||
|
import com.lukouguoji.module_base.common.Constant
|
||||||
|
import com.lukouguoji.module_base.common.DetailsPageType
|
||||||
|
|
||||||
|
class IntImpManifestSubEditActivity :
|
||||||
|
BaseBindingActivity<ActivityIntImpManifestSubEditBinding, IntImpManifestSubEditViewModel>() {
|
||||||
|
|
||||||
|
override fun layoutId() = R.layout.activity_int_imp_manifest_sub_edit
|
||||||
|
|
||||||
|
override fun viewModelClass() = IntImpManifestSubEditViewModel::class.java
|
||||||
|
|
||||||
|
override fun initOnCreate(savedInstanceState: Bundle?) {
|
||||||
|
binding.viewModel = viewModel
|
||||||
|
viewModel.initOnCreated(intent)
|
||||||
|
|
||||||
|
val title = when (viewModel.pageType.value) {
|
||||||
|
DetailsPageType.Modify -> "分单编辑"
|
||||||
|
else -> "分单新增"
|
||||||
|
}
|
||||||
|
setBackArrow(title)
|
||||||
|
}
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
const val KEY_MAIN_PC = "mainPc"
|
||||||
|
const val KEY_MAIN_WEIGHT = "mainWeight"
|
||||||
|
const val KEY_OTHER_SUB_PC = "otherSubPc"
|
||||||
|
const val KEY_OTHER_SUB_WEIGHT = "otherSubWeight"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增分单
|
||||||
|
*/
|
||||||
|
@JvmStatic
|
||||||
|
fun startForAdd(context: Context, manifest: GjjManifest) {
|
||||||
|
// 新增模式:其他分单之和 = 所有已有分单之和
|
||||||
|
val otherSubPc = manifest.haWbList?.sumOf { it.pc } ?: 0L
|
||||||
|
val otherSubWeight = manifest.haWbList?.sumOf { it.weight } ?: 0.0
|
||||||
|
|
||||||
|
context.startActivity(
|
||||||
|
Intent(context, IntImpManifestSubEditActivity::class.java)
|
||||||
|
.putExtra(Constant.Key.PAGE_TYPE, DetailsPageType.Add.name)
|
||||||
|
.putExtra(Constant.Key.BEAN, manifest)
|
||||||
|
.putExtra(KEY_MAIN_PC, manifest.pc)
|
||||||
|
.putExtra(KEY_MAIN_WEIGHT, manifest.weight)
|
||||||
|
.putExtra(KEY_OTHER_SUB_PC, otherSubPc)
|
||||||
|
.putExtra(KEY_OTHER_SUB_WEIGHT, otherSubWeight)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改分单
|
||||||
|
*/
|
||||||
|
@JvmStatic
|
||||||
|
fun startForModify(context: Context, manifest: GjjManifest, haWb: GjjHaWb) {
|
||||||
|
// 修改模式:其他分单之和 = 所有分单之和 - 当前编辑的分单
|
||||||
|
val otherSubPc = (manifest.haWbList?.sumOf { it.pc } ?: 0L) - haWb.pc
|
||||||
|
val otherSubWeight = (manifest.haWbList?.sumOf { it.weight } ?: 0.0) - haWb.weight
|
||||||
|
|
||||||
|
context.startActivity(
|
||||||
|
Intent(context, IntImpManifestSubEditActivity::class.java)
|
||||||
|
.putExtra(Constant.Key.PAGE_TYPE, DetailsPageType.Modify.name)
|
||||||
|
.putExtra(Constant.Key.BEAN, manifest)
|
||||||
|
.putExtra("haWb", haWb)
|
||||||
|
.putExtra(KEY_MAIN_PC, manifest.pc)
|
||||||
|
.putExtra(KEY_MAIN_WEIGHT, manifest.weight)
|
||||||
|
.putExtra(KEY_OTHER_SUB_PC, otherSubPc)
|
||||||
|
.putExtra(KEY_OTHER_SUB_WEIGHT, otherSubWeight)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
package com.lukouguoji.gjj.activity
|
||||||
|
|
||||||
|
import android.content.Context
|
||||||
|
import android.content.Intent
|
||||||
|
import android.os.Bundle
|
||||||
|
import com.google.gson.Gson
|
||||||
|
import com.lukouguoji.gjj.R
|
||||||
|
import com.lukouguoji.gjj.databinding.ActivityIntImpPickUpChargeEditBinding
|
||||||
|
import com.lukouguoji.gjj.viewModel.IntImpPickUpChargeEditViewModel
|
||||||
|
import com.lukouguoji.module_base.base.BaseBindingActivity
|
||||||
|
import com.lukouguoji.module_base.bean.IntImpPickUpRecordBean
|
||||||
|
import com.lukouguoji.module_base.common.Constant
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 国际进港-费用修改
|
||||||
|
*/
|
||||||
|
class IntImpPickUpChargeEditActivity :
|
||||||
|
BaseBindingActivity<ActivityIntImpPickUpChargeEditBinding, IntImpPickUpChargeEditViewModel>() {
|
||||||
|
|
||||||
|
override fun layoutId() = R.layout.activity_int_imp_pick_up_charge_edit
|
||||||
|
override fun viewModelClass() = IntImpPickUpChargeEditViewModel::class.java
|
||||||
|
|
||||||
|
override fun initOnCreate(savedInstanceState: Bundle?) {
|
||||||
|
setBackArrow("国际进港费用修改")
|
||||||
|
binding.viewModel = viewModel
|
||||||
|
viewModel.initOnCreated(intent)
|
||||||
|
}
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
@JvmStatic
|
||||||
|
fun start(context: Context, bean: IntImpPickUpRecordBean) {
|
||||||
|
val starter = Intent(context, IntImpPickUpChargeEditActivity::class.java)
|
||||||
|
.putExtra(Constant.Key.DATA, Gson().toJson(bean))
|
||||||
|
context.startActivity(starter)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -3,7 +3,6 @@ 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 androidx.appcompat.app.AlertDialog
|
|
||||||
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.ActivityIntImpPickUpRecordBinding
|
import com.lukouguoji.gjj.databinding.ActivityIntImpPickUpRecordBinding
|
||||||
@@ -14,8 +13,11 @@ import com.lukouguoji.module_base.common.Constant
|
|||||||
import com.lukouguoji.module_base.common.ConstantEvent
|
import com.lukouguoji.module_base.common.ConstantEvent
|
||||||
import com.lukouguoji.module_base.impl.FlowBus
|
import com.lukouguoji.module_base.impl.FlowBus
|
||||||
import com.lukouguoji.module_base.impl.observe
|
import com.lukouguoji.module_base.impl.observe
|
||||||
|
import com.lukouguoji.module_base.interfaces.IOnItemClickListener
|
||||||
|
import com.lukouguoji.module_base.ktx.addOnItemClickListener
|
||||||
import com.lukouguoji.module_base.ktx.commonAdapter
|
import com.lukouguoji.module_base.ktx.commonAdapter
|
||||||
import com.lukouguoji.module_base.ktx.showToast
|
import com.lukouguoji.module_base.ktx.showToast
|
||||||
|
import com.lukouguoji.module_base.model.ConfirmDialogModel
|
||||||
import com.lukouguoji.module_base.router.ARouterConstants
|
import com.lukouguoji.module_base.router.ARouterConstants
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -41,11 +43,35 @@ class IntImpPickUpRecordActivity :
|
|||||||
// 绑定分页
|
// 绑定分页
|
||||||
viewModel.pageModel.bindSmartRefreshLayout(binding.srl, binding.rv, viewModel, this)
|
viewModel.pageModel.bindSmartRefreshLayout(binding.srl, binding.rv, viewModel, this)
|
||||||
|
|
||||||
|
// 设置列表项点击回调(侧滑修改按钮)
|
||||||
|
binding.rv.addOnItemClickListener(object : IOnItemClickListener {
|
||||||
|
override fun onItemClick(position: Int, type: Int) {
|
||||||
|
when (type) {
|
||||||
|
2000 -> {
|
||||||
|
// 侧滑修改操作
|
||||||
|
val list = viewModel.pageModel.rv?.commonAdapter()?.items as? List<*> ?: return
|
||||||
|
val bean = list.getOrNull(position) as? IntImpPickUpRecordBean ?: return
|
||||||
|
IntImpPickUpChargeEditActivity.start(this@IntImpPickUpRecordActivity, bean)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
// 监听刷新事件
|
// 监听刷新事件
|
||||||
FlowBus.with<String>(ConstantEvent.EVENT_REFRESH).observe(this) {
|
FlowBus.with<String>(ConstantEvent.EVENT_REFRESH).observe(this) {
|
||||||
viewModel.refresh()
|
viewModel.refresh()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 运单号自动查询额外参数
|
||||||
|
binding.pslWbNo.autoQueryConfig.extraParamsProvider = {
|
||||||
|
mapOf(
|
||||||
|
"beginDate" to viewModel.paymentDateStart.value,
|
||||||
|
"endDate" to viewModel.paymentDateEnd.value,
|
||||||
|
"agentCode" to viewModel.agentCode.value,
|
||||||
|
"spCode" to viewModel.spCode.value
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
// 初始化下拉列表
|
// 初始化下拉列表
|
||||||
viewModel.initAgentList()
|
viewModel.initAgentList()
|
||||||
viewModel.initSpecialCodeList()
|
viewModel.initSpecialCodeList()
|
||||||
@@ -68,14 +94,12 @@ class IntImpPickUpRecordActivity :
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
AlertDialog.Builder(this)
|
ConfirmDialogModel(
|
||||||
.setTitle("清除提货确认")
|
message = "确定要清除选中的 ${selectedItems.size} 条提货记录吗?",
|
||||||
.setMessage("确定要清除选中的 ${selectedItems.size} 条提货记录吗?")
|
title = "清除提货确认"
|
||||||
.setPositiveButton("确定") { _, _ ->
|
) {
|
||||||
viewModel.clearPickUp(selectedItems)
|
viewModel.clearPickUp(selectedItems)
|
||||||
}
|
}.show(this)
|
||||||
.setNegativeButton("取消", null)
|
|
||||||
.show()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
|
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
|
||||||
|
|||||||
@@ -3,10 +3,12 @@ package com.lukouguoji.gjj.activity
|
|||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
|
import com.google.gson.Gson
|
||||||
import com.lukouguoji.gjj.R
|
import com.lukouguoji.gjj.R
|
||||||
import com.lukouguoji.gjj.databinding.ActivityIntImpPickUpRecordDetailsBinding
|
import com.lukouguoji.gjj.databinding.ActivityIntImpPickUpRecordDetailsBinding
|
||||||
import com.lukouguoji.gjj.viewModel.IntImpPickUpRecordDetailsViewModel
|
import com.lukouguoji.gjj.viewModel.IntImpPickUpRecordDetailsViewModel
|
||||||
import com.lukouguoji.module_base.base.BaseBindingActivity
|
import com.lukouguoji.module_base.base.BaseBindingActivity
|
||||||
|
import com.lukouguoji.module_base.bean.IntImpPickUpRecordBean
|
||||||
import com.lukouguoji.module_base.common.Constant
|
import com.lukouguoji.module_base.common.Constant
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -26,9 +28,9 @@ class IntImpPickUpRecordDetailsActivity :
|
|||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
@JvmStatic
|
@JvmStatic
|
||||||
fun start(context: Context, id: Long) {
|
fun start(context: Context, bean: IntImpPickUpRecordBean) {
|
||||||
val starter = Intent(context, IntImpPickUpRecordDetailsActivity::class.java)
|
val starter = Intent(context, IntImpPickUpRecordDetailsActivity::class.java)
|
||||||
.putExtra(Constant.Key.ID, id)
|
.putExtra(Constant.Key.DATA, Gson().toJson(bean))
|
||||||
context.startActivity(starter)
|
context.startActivity(starter)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,9 @@ package com.lukouguoji.gjj.activity
|
|||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
|
import android.view.Gravity
|
||||||
|
import android.view.View
|
||||||
|
import android.widget.FrameLayout
|
||||||
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.ActivityIntImpQueryBinding
|
import com.lukouguoji.gjj.databinding.ActivityIntImpQueryBinding
|
||||||
@@ -11,7 +14,10 @@ import com.lukouguoji.module_base.base.BaseBindingActivity
|
|||||||
import com.lukouguoji.module_base.common.ConstantEvent
|
import com.lukouguoji.module_base.common.ConstantEvent
|
||||||
import com.lukouguoji.module_base.impl.FlowBus
|
import com.lukouguoji.module_base.impl.FlowBus
|
||||||
import com.lukouguoji.module_base.impl.observe
|
import com.lukouguoji.module_base.impl.observe
|
||||||
|
import com.lukouguoji.module_base.ktx.addOnItemClickListener
|
||||||
import com.lukouguoji.module_base.ktx.getLifecycleOwner
|
import com.lukouguoji.module_base.ktx.getLifecycleOwner
|
||||||
|
import com.lukouguoji.module_base.ktx.setUpperCaseAlphanumericFilter
|
||||||
|
import com.lukouguoji.module_base.ktx.setUpperCaseLetterFilter
|
||||||
import com.lukouguoji.module_base.router.ARouterConstants
|
import com.lukouguoji.module_base.router.ARouterConstants
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -33,15 +39,80 @@ class IntImpQueryActivity :
|
|||||||
viewModel.pageModel
|
viewModel.pageModel
|
||||||
.bindSmartRefreshLayout(binding.srl, binding.rv, viewModel, getLifecycleOwner())
|
.bindSmartRefreshLayout(binding.srl, binding.rv, viewModel, getLifecycleOwner())
|
||||||
|
|
||||||
|
// 注册列表项点击事件
|
||||||
|
binding.rv.addOnItemClickListener(viewModel)
|
||||||
|
|
||||||
FlowBus.with<String>(ConstantEvent.EVENT_REFRESH).observe(this) {
|
FlowBus.with<String>(ConstantEvent.EVENT_REFRESH).observe(this) {
|
||||||
viewModel.refresh()
|
viewModel.refresh()
|
||||||
}
|
}
|
||||||
|
|
||||||
viewModel.initAgentList()
|
viewModel.initAgentList()
|
||||||
|
viewModel.initSpecialCodeList()
|
||||||
|
viewModel.initFilterLists()
|
||||||
|
|
||||||
|
// 观察筛选面板显示状态
|
||||||
|
viewModel.filterVisible.observe(this) { visible ->
|
||||||
|
if (visible) showFilterPanel() else hideFilterPanel()
|
||||||
|
}
|
||||||
|
|
||||||
|
// 航班号:大写字母+数字
|
||||||
|
binding.filterPanel.filterFlightNo.et.setUpperCaseAlphanumericFilter()
|
||||||
|
// 始发港:仅大写字母
|
||||||
|
binding.filterPanel.filterOrigin.et.setUpperCaseLetterFilter()
|
||||||
|
|
||||||
viewModel.refresh()
|
viewModel.refresh()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun showFilterPanel() {
|
||||||
|
val panel = binding.filterPanel.root
|
||||||
|
val overlay = binding.filterOverlay
|
||||||
|
val panelWidth = window.decorView.width / 3
|
||||||
|
|
||||||
|
panel.layoutParams = (panel.layoutParams as FrameLayout.LayoutParams).apply {
|
||||||
|
width = panelWidth
|
||||||
|
gravity = Gravity.END
|
||||||
|
}
|
||||||
|
|
||||||
|
// 先 INVISIBLE 完成测量,避免第一次显示时闪烁
|
||||||
|
panel.visibility = View.INVISIBLE
|
||||||
|
panel.translationX = panelWidth.toFloat()
|
||||||
|
overlay.visibility = View.VISIBLE
|
||||||
|
overlay.alpha = 0f
|
||||||
|
|
||||||
|
panel.post {
|
||||||
|
panel.visibility = View.VISIBLE
|
||||||
|
panel.animate().translationX(0f).setDuration(250).start()
|
||||||
|
overlay.animate().alpha(1f).setDuration(250).start()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun hideFilterPanel() {
|
||||||
|
val panel = binding.filterPanel.root
|
||||||
|
val overlay = binding.filterOverlay
|
||||||
|
|
||||||
|
if (panel.visibility != View.VISIBLE) return
|
||||||
|
|
||||||
|
panel.animate()
|
||||||
|
.translationX(panel.width.toFloat())
|
||||||
|
.setDuration(250)
|
||||||
|
.withEndAction { panel.visibility = View.GONE }
|
||||||
|
.start()
|
||||||
|
|
||||||
|
overlay.animate()
|
||||||
|
.alpha(0f)
|
||||||
|
.setDuration(250)
|
||||||
|
.withEndAction { overlay.visibility = View.GONE }
|
||||||
|
.start()
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onBackPressed() {
|
||||||
|
if (viewModel.filterVisible.value == true) {
|
||||||
|
viewModel.closeFilter()
|
||||||
|
} else {
|
||||||
|
super.onBackPressed()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
@JvmStatic
|
@JvmStatic
|
||||||
fun start(context: Context) {
|
fun start(context: Context) {
|
||||||
|
|||||||
@@ -0,0 +1,91 @@
|
|||||||
|
package com.lukouguoji.gjj.activity
|
||||||
|
|
||||||
|
import android.content.Context
|
||||||
|
import android.content.Intent
|
||||||
|
import android.os.Bundle
|
||||||
|
import android.view.Gravity
|
||||||
|
import android.widget.ImageView
|
||||||
|
import android.widget.LinearLayout
|
||||||
|
import androidx.appcompat.widget.Toolbar
|
||||||
|
import com.alibaba.android.arouter.facade.annotation.Route
|
||||||
|
import com.alibaba.android.arouter.launcher.ARouter
|
||||||
|
import com.lukouguoji.gjj.R
|
||||||
|
import com.lukouguoji.gjj.databinding.ActivityIntImpQueryDetailsBinding
|
||||||
|
import com.lukouguoji.gjj.viewModel.IntImpQueryDetailsViewModel
|
||||||
|
import com.lukouguoji.module_base.base.BaseBindingActivity
|
||||||
|
import com.lukouguoji.module_base.base.CustomVP2Adapter
|
||||||
|
import com.lukouguoji.module_base.common.Constant
|
||||||
|
import com.lukouguoji.module_base.router.ARouterConstants
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 国际进港查询详情页面
|
||||||
|
*/
|
||||||
|
@Route(path = ARouterConstants.ACTIVITY_URL_GJJ_QUERY_INFO)
|
||||||
|
class IntImpQueryDetailsActivity :
|
||||||
|
BaseBindingActivity<ActivityIntImpQueryDetailsBinding, IntImpQueryDetailsViewModel>() {
|
||||||
|
|
||||||
|
override fun layoutId() = R.layout.activity_int_imp_query_details
|
||||||
|
override fun viewModelClass() = IntImpQueryDetailsViewModel::class.java
|
||||||
|
|
||||||
|
override fun initOnCreate(savedInstanceState: Bundle?) {
|
||||||
|
setBackArrow("国际进港查询详情")
|
||||||
|
binding.viewModel = viewModel
|
||||||
|
|
||||||
|
// 初始化ViewModel(传入maWbId)
|
||||||
|
viewModel.initOnCreated(intent)
|
||||||
|
|
||||||
|
// 配置ViewPager2
|
||||||
|
binding.vp.adapter = CustomVP2Adapter(
|
||||||
|
viewModel.fragmentList,
|
||||||
|
supportFragmentManager,
|
||||||
|
lifecycle
|
||||||
|
)
|
||||||
|
binding.vp.isUserInputEnabled = false // 禁用滑动
|
||||||
|
binding.vp.offscreenPageLimit = 3 // 预加载3个Fragment
|
||||||
|
|
||||||
|
// 监听Tab索引变化,切换Fragment
|
||||||
|
viewModel.currentTab.observe(this) {
|
||||||
|
binding.vp.setCurrentItem(it, false)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 标题栏右侧添加日志查询图标
|
||||||
|
val toolbar = findViewById<Toolbar>(com.lukouguoji.module_base.R.id.toolbar)
|
||||||
|
val logIcon = ImageView(this).apply {
|
||||||
|
setImageResource(com.lukouguoji.module_base.R.drawable.img_log)
|
||||||
|
layoutParams = Toolbar.LayoutParams(
|
||||||
|
LinearLayout.LayoutParams.WRAP_CONTENT,
|
||||||
|
LinearLayout.LayoutParams.WRAP_CONTENT
|
||||||
|
).apply {
|
||||||
|
gravity = Gravity.END or Gravity.CENTER_VERTICAL
|
||||||
|
marginEnd = 15
|
||||||
|
width = 30.dp
|
||||||
|
height = 30.dp
|
||||||
|
}
|
||||||
|
setOnClickListener {
|
||||||
|
val wbNo = viewModel.maWbData.value?.get("wbNo") as? String ?: ""
|
||||||
|
ARouter.getInstance()
|
||||||
|
.build(ARouterConstants.ACTIVITY_URL_LOG_DETAIL)
|
||||||
|
.withString(Constant.Key.KEY, wbNo)
|
||||||
|
.withString(Constant.Key.AWB_TYPE, "II")
|
||||||
|
.navigation()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
toolbar.addView(logIcon)
|
||||||
|
|
||||||
|
// 加载详情数据
|
||||||
|
viewModel.loadDetails()
|
||||||
|
}
|
||||||
|
|
||||||
|
private val Int.dp: Int
|
||||||
|
get() = (this * resources!!.displayMetrics.density).toInt()
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
@JvmStatic
|
||||||
|
fun start(context: Context, prefix: String?, no: String?) {
|
||||||
|
val starter = Intent(context, IntImpQueryDetailsActivity::class.java)
|
||||||
|
.putExtra("prefix", prefix ?: "")
|
||||||
|
.putExtra("no", no ?: "")
|
||||||
|
context.startActivity(starter)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
package com.lukouguoji.gjj.activity
|
||||||
|
|
||||||
|
import android.content.Context
|
||||||
|
import android.content.Intent
|
||||||
|
import android.os.Bundle
|
||||||
|
import com.lukouguoji.gjj.R
|
||||||
|
import com.lukouguoji.gjj.databinding.ActivityIntImpQueryEditBinding
|
||||||
|
import com.lukouguoji.gjj.viewModel.IntImpQueryEditViewModel
|
||||||
|
import com.lukouguoji.module_base.base.BaseBindingActivity
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 国际进港运单修改页面
|
||||||
|
*/
|
||||||
|
class IntImpQueryEditActivity :
|
||||||
|
BaseBindingActivity<ActivityIntImpQueryEditBinding, IntImpQueryEditViewModel>() {
|
||||||
|
|
||||||
|
override fun layoutId() = R.layout.activity_int_imp_query_edit
|
||||||
|
|
||||||
|
override fun viewModelClass() = IntImpQueryEditViewModel::class.java
|
||||||
|
|
||||||
|
override fun initOnCreate(savedInstanceState: Bundle?) {
|
||||||
|
setBackArrow("国际进港运单修改")
|
||||||
|
binding.viewModel = viewModel
|
||||||
|
viewModel.initOnCreated(intent)
|
||||||
|
}
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
@JvmStatic
|
||||||
|
fun start(context: Context, maWbId: Long?, prefix: String?, no: String?) {
|
||||||
|
val starter = Intent(context, IntImpQueryEditActivity::class.java)
|
||||||
|
.putExtra("maWbId", maWbId ?: 0L)
|
||||||
|
.putExtra("prefix", prefix ?: "")
|
||||||
|
.putExtra("no", no ?: "")
|
||||||
|
context.startActivity(starter)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -3,7 +3,7 @@ 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 androidx.appcompat.app.AlertDialog
|
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
|
||||||
@@ -60,12 +60,17 @@ class IntImpStorageUseActivity :
|
|||||||
val allItems = list.filterIsInstance<com.lukouguoji.module_base.bean.GjcMaWb>()
|
val allItems = list.filterIsInstance<com.lukouguoji.module_base.bean.GjcMaWb>()
|
||||||
|
|
||||||
val maWbListForClear = allItems.mapNotNull { maWb ->
|
val maWbListForClear = allItems.mapNotNull { maWb ->
|
||||||
val selectedStorageList = maWb.storageUseList?.filter { it.isSelected } ?: emptyList()
|
if (maWb.isSelected) {
|
||||||
|
// 勾选运单号 → 默认全选该运单号下的所有库位
|
||||||
if (selectedStorageList.isNotEmpty() || maWb.isSelected) {
|
maWb.copy(storageUseList = maWb.storageUseList ?: emptyList())
|
||||||
maWb.copy(storageUseList = selectedStorageList)
|
|
||||||
} else {
|
} else {
|
||||||
null
|
// 勾选库位号 → 只对选择的库位进行操作
|
||||||
|
val selectedStorageList = maWb.storageUseList?.filter { it.isSelected } ?: emptyList()
|
||||||
|
if (selectedStorageList.isNotEmpty()) {
|
||||||
|
maWb.copy(storageUseList = selectedStorageList)
|
||||||
|
} else {
|
||||||
|
null
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -105,7 +110,16 @@ class IntImpStorageUseActivity :
|
|||||||
|
|
||||||
val selectedStorage = selectedStorageUseList[0]
|
val selectedStorage = selectedStorageUseList[0]
|
||||||
|
|
||||||
IntImpModifyStorageDialogModel { dialog ->
|
// 已出库的分单不允许修改库位
|
||||||
|
if (!selectedStorage.outOpId.isNullOrEmpty() || !selectedStorage.outDate.isNullOrEmpty()) {
|
||||||
|
showToast("该分单已出库,不允许修改库位")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// 弹出库位选择弹框,选择后再调用接口,传入当前库位ID以预填充
|
||||||
|
IntImpModifyStorageDialogModel(
|
||||||
|
currentLocationId = selectedStorage.locationId?.toString() ?: ""
|
||||||
|
) { dialog ->
|
||||||
val locationName = dialog.locationName
|
val locationName = dialog.locationName
|
||||||
val locationId = dialog.locationId
|
val locationId = dialog.locationId
|
||||||
viewModel.performModifyStorage(locationName, locationId, selectedStorage)
|
viewModel.performModifyStorage(locationName, locationId, selectedStorage)
|
||||||
@@ -119,24 +133,32 @@ class IntImpStorageUseActivity :
|
|||||||
val list = viewModel.pageModel.rv?.commonAdapter()?.items as? List<*> ?: return
|
val list = viewModel.pageModel.rv?.commonAdapter()?.items as? List<*> ?: return
|
||||||
val allItems = list.filterIsInstance<com.lukouguoji.module_base.bean.GjcMaWb>()
|
val allItems = list.filterIsInstance<com.lukouguoji.module_base.bean.GjcMaWb>()
|
||||||
|
|
||||||
val selectedStorageUseList = mutableListOf<com.lukouguoji.module_base.bean.GjcStorageUse>()
|
val maWbListForOutStorage = allItems.mapNotNull { maWb ->
|
||||||
allItems.forEach { maWb ->
|
if (maWb.isSelected) {
|
||||||
maWb.storageUseList?.filter { it.isSelected }?.let { selectedStorageUseList.addAll(it) }
|
// 勾选运单号 → 默认全选该运单号下的所有库位
|
||||||
|
maWb.copy(storageUseList = maWb.storageUseList ?: emptyList())
|
||||||
|
} else {
|
||||||
|
// 勾选库位号 → 只对选择的库位进行操作
|
||||||
|
val selectedStorageList = maWb.storageUseList?.filter { it.isSelected } ?: emptyList()
|
||||||
|
if (selectedStorageList.isNotEmpty()) {
|
||||||
|
maWb.copy(storageUseList = selectedStorageList)
|
||||||
|
} else {
|
||||||
|
null
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (selectedStorageUseList.isEmpty()) {
|
if (maWbListForOutStorage.isEmpty()) {
|
||||||
showToast("请选择要出库的库位")
|
showToast("请选择要出库的库位")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
AlertDialog.Builder(this)
|
ConfirmDialogModel(
|
||||||
.setTitle("出库确认")
|
message = "是否确认出库?",
|
||||||
.setMessage("确定要将选中的 ${selectedStorageUseList.size} 个库位执行出库操作吗?")
|
title = "出库确认"
|
||||||
.setPositiveButton("确定") { _, _ ->
|
) {
|
||||||
viewModel.performOutStorage(selectedStorageUseList)
|
viewModel.performOutStorage(maWbListForOutStorage)
|
||||||
}
|
}.show(this)
|
||||||
.setNegativeButton("取消", null)
|
|
||||||
.show()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -147,12 +169,17 @@ class IntImpStorageUseActivity :
|
|||||||
val allItems = list.filterIsInstance<com.lukouguoji.module_base.bean.GjcMaWb>()
|
val allItems = list.filterIsInstance<com.lukouguoji.module_base.bean.GjcMaWb>()
|
||||||
|
|
||||||
val maWbListForInStorage = allItems.mapNotNull { maWb ->
|
val maWbListForInStorage = allItems.mapNotNull { maWb ->
|
||||||
val selectedStorageList = maWb.storageUseList?.filter { it.isSelected } ?: emptyList()
|
if (maWb.isSelected) {
|
||||||
|
// 勾选运单号 → 默认全选该运单号下的所有库位
|
||||||
if (selectedStorageList.isNotEmpty() || maWb.isSelected) {
|
maWb.copy(storageUseList = maWb.storageUseList ?: emptyList())
|
||||||
maWb.copy(storageUseList = selectedStorageList)
|
|
||||||
} else {
|
} else {
|
||||||
null
|
// 勾选库位号 → 只对选择的库位进行操作
|
||||||
|
val selectedStorageList = maWb.storageUseList?.filter { it.isSelected } ?: emptyList()
|
||||||
|
if (selectedStorageList.isNotEmpty()) {
|
||||||
|
maWb.copy(storageUseList = selectedStorageList)
|
||||||
|
} else {
|
||||||
|
null
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,36 @@
|
|||||||
|
package com.lukouguoji.gjj.activity
|
||||||
|
|
||||||
|
import android.content.Context
|
||||||
|
import android.content.Intent
|
||||||
|
import android.os.Bundle
|
||||||
|
import com.lukouguoji.gjj.R
|
||||||
|
import com.lukouguoji.gjj.databinding.ActivityIntImpTallyDetailsBinding
|
||||||
|
import com.lukouguoji.gjj.viewModel.IntImpTallyDetailsViewModel
|
||||||
|
import com.lukouguoji.module_base.base.BaseBindingActivity
|
||||||
|
import com.lukouguoji.module_base.bean.GjjImportTally
|
||||||
|
import com.lukouguoji.module_base.common.Constant
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 国际进港理货报告详情
|
||||||
|
*/
|
||||||
|
class IntImpTallyDetailsActivity :
|
||||||
|
BaseBindingActivity<ActivityIntImpTallyDetailsBinding, IntImpTallyDetailsViewModel>() {
|
||||||
|
|
||||||
|
override fun layoutId() = R.layout.activity_int_imp_tally_details
|
||||||
|
override fun viewModelClass() = IntImpTallyDetailsViewModel::class.java
|
||||||
|
|
||||||
|
override fun initOnCreate(savedInstanceState: Bundle?) {
|
||||||
|
setBackArrow("理货报告详情")
|
||||||
|
binding.viewModel = viewModel
|
||||||
|
viewModel.initOnCreated(intent)
|
||||||
|
}
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
@JvmStatic
|
||||||
|
fun start(context: Context, tally: GjjImportTally) {
|
||||||
|
val starter = Intent(context, IntImpTallyDetailsActivity::class.java)
|
||||||
|
.putExtra(Constant.Key.DATA, tally)
|
||||||
|
context.startActivity(starter)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -50,7 +50,7 @@ class IntImpInStorageDialogModel(
|
|||||||
* 加载库位列表
|
* 加载库位列表
|
||||||
*/
|
*/
|
||||||
private fun loadLocationList() {
|
private fun loadLocationList() {
|
||||||
launchCollect({ NetApply.api.getLocationList(flag = 4) }) {
|
launchCollect({ NetApply.api.getLocationList(flag = 3) }) {
|
||||||
onSuccess = { result ->
|
onSuccess = { result ->
|
||||||
val list = result.data?.map { it.toKeyValue() } ?: emptyList()
|
val list = result.data?.map { it.toKeyValue() } ?: emptyList()
|
||||||
locationList.value = list
|
locationList.value = list
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import dev.utils.app.info.KeyValue
|
|||||||
* 国际进港 - 修改库位对话框
|
* 国际进港 - 修改库位对话框
|
||||||
*/
|
*/
|
||||||
class IntImpModifyStorageDialogModel(
|
class IntImpModifyStorageDialogModel(
|
||||||
|
private val currentLocationId: String = "",
|
||||||
private val callback: (IntImpModifyStorageDialogModel) -> Unit
|
private val callback: (IntImpModifyStorageDialogModel) -> Unit
|
||||||
) : BaseDialogModel<DialogIntImpModifyStorageBinding>(DIALOG_TYPE_CENTER) {
|
) : BaseDialogModel<DialogIntImpModifyStorageBinding>(DIALOG_TYPE_CENTER) {
|
||||||
|
|
||||||
@@ -50,10 +51,14 @@ class IntImpModifyStorageDialogModel(
|
|||||||
* 加载库位列表
|
* 加载库位列表
|
||||||
*/
|
*/
|
||||||
private fun loadLocationList() {
|
private fun loadLocationList() {
|
||||||
launchCollect({ NetApply.api.getLocationList(flag = 4) }) {
|
launchCollect({ NetApply.api.getLocationList(flag = 3) }) {
|
||||||
onSuccess = { result ->
|
onSuccess = { result ->
|
||||||
val list = result.data?.map { it.toKeyValue() } ?: emptyList()
|
val list = result.data?.map { it.toKeyValue() } ?: emptyList()
|
||||||
locationList.value = list
|
locationList.value = list
|
||||||
|
// 列表加载完成后,预选当前库位
|
||||||
|
if (currentLocationId.isNotEmpty()) {
|
||||||
|
selectedLocationCode.value = currentLocationId
|
||||||
|
}
|
||||||
}
|
}
|
||||||
onFailed = { _, msg ->
|
onFailed = { _, msg ->
|
||||||
showToast(msg ?: "加载库位列表失败")
|
showToast(msg ?: "加载库位列表失败")
|
||||||
|
|||||||
@@ -1,87 +0,0 @@
|
|||||||
package com.lukouguoji.gjj.dialog
|
|
||||||
|
|
||||||
import android.content.Context
|
|
||||||
import android.content.res.ColorStateList
|
|
||||||
import android.graphics.Color
|
|
||||||
import android.view.View
|
|
||||||
import android.widget.ImageView
|
|
||||||
import android.widget.TextView
|
|
||||||
import androidx.lifecycle.MutableLiveData
|
|
||||||
import com.lukouguoji.gjj.R
|
|
||||||
import com.lukouguoji.gjj.databinding.DialogIntImpQueryFilterBinding
|
|
||||||
import com.lukouguoji.module_base.base.BaseDialogModel
|
|
||||||
import com.lxj.xpopup.XPopup
|
|
||||||
import com.lxj.xpopup.enums.PopupPosition
|
|
||||||
import dev.DevUtils
|
|
||||||
import dev.utils.app.info.KeyValue
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 国际进港查询筛选抽屉
|
|
||||||
*/
|
|
||||||
class IntImpQueryFilterDialogModel(
|
|
||||||
val spCode: MutableLiveData<String>,
|
|
||||||
val flightNo: MutableLiveData<String>,
|
|
||||||
val dest: MutableLiveData<String>,
|
|
||||||
val awbType: MutableLiveData<String>,
|
|
||||||
val businessType: MutableLiveData<String>,
|
|
||||||
val goodsCn: MutableLiveData<String>,
|
|
||||||
private val onConfirm: () -> Unit
|
|
||||||
) : BaseDialogModel<DialogIntImpQueryFilterBinding>(DIALOG_TYPE_DRAWER) {
|
|
||||||
|
|
||||||
val awbTypeList = MutableLiveData(
|
|
||||||
listOf(
|
|
||||||
KeyValue("全部", ""),
|
|
||||||
KeyValue("主单", "1"),
|
|
||||||
KeyValue("分单", "2")
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
val businessTypeList = MutableLiveData(
|
|
||||||
listOf(
|
|
||||||
KeyValue("全部", ""),
|
|
||||||
KeyValue("普货", "1"),
|
|
||||||
KeyValue("特货", "2")
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
override fun layoutId() = R.layout.dialog_int_imp_query_filter
|
|
||||||
|
|
||||||
override fun onBuild(builder: XPopup.Builder) {
|
|
||||||
super.onBuild(builder)
|
|
||||||
builder.popupPosition(PopupPosition.Right)
|
|
||||||
val activity = DevUtils.getTopActivity()
|
|
||||||
val activityWidth = activity.window.decorView.width
|
|
||||||
builder.maxWidth(activityWidth / 3)
|
|
||||||
builder.popupWidth(activityWidth / 3)
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onDialogCreated(context: Context) {
|
|
||||||
binding.model = this
|
|
||||||
binding.lifecycleOwner = context as? androidx.lifecycle.LifecycleOwner
|
|
||||||
|
|
||||||
val titleColor = Color.parseColor("#666666")
|
|
||||||
binding.root.findViewById<TextView>(R.id.title_name)?.text = "筛选条件"
|
|
||||||
binding.root.findViewById<TextView>(R.id.title_name)?.setTextColor(titleColor)
|
|
||||||
binding.root.findViewById<TextView>(R.id.tool_tv_back)?.setTextColor(titleColor)
|
|
||||||
binding.root.findViewById<ImageView>(R.id.tool_iv_back)?.imageTintList = ColorStateList.valueOf(titleColor)
|
|
||||||
binding.root.findViewById<View>(R.id.toolbar)?.setBackgroundColor(Color.WHITE)
|
|
||||||
|
|
||||||
binding.root.findViewById<View>(R.id.tool_back)?.setOnClickListener {
|
|
||||||
dismiss()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fun onResetClick() {
|
|
||||||
spCode.value = ""
|
|
||||||
flightNo.value = ""
|
|
||||||
dest.value = ""
|
|
||||||
awbType.value = ""
|
|
||||||
businessType.value = ""
|
|
||||||
goodsCn.value = ""
|
|
||||||
}
|
|
||||||
|
|
||||||
fun onConfirmClick() {
|
|
||||||
dismiss()
|
|
||||||
onConfirm()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,58 @@
|
|||||||
|
package com.lukouguoji.gjj.dialog
|
||||||
|
|
||||||
|
import android.content.Context
|
||||||
|
import androidx.lifecycle.MutableLiveData
|
||||||
|
import com.lukouguoji.gjj.R
|
||||||
|
import com.lukouguoji.gjj.databinding.DialogIntImpTallyDeleteBinding
|
||||||
|
import com.lukouguoji.module_base.base.BaseDialogModel
|
||||||
|
import com.lukouguoji.module_base.ktx.verifyNullOrEmpty
|
||||||
|
import dev.utils.app.info.KeyValue
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 国际进港理货 - 删除申报对话框
|
||||||
|
*/
|
||||||
|
class IntImpTallyDeleteDialogModel(
|
||||||
|
val changeReasonList: List<KeyValue>, // 变更原因列表
|
||||||
|
private val callback: (IntImpTallyDeleteDialogModel) -> Unit
|
||||||
|
) : BaseDialogModel<DialogIntImpTallyDeleteBinding>(DIALOG_TYPE_CENTER) {
|
||||||
|
|
||||||
|
// 变更原因代码(存储的是 code)
|
||||||
|
val changeReason = MutableLiveData("")
|
||||||
|
|
||||||
|
// 联系人姓名
|
||||||
|
val contactName = MutableLiveData("")
|
||||||
|
|
||||||
|
// 联系人电话
|
||||||
|
val contactPhone = MutableLiveData("")
|
||||||
|
|
||||||
|
override fun layoutId(): Int {
|
||||||
|
return R.layout.dialog_int_imp_tally_delete
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onDialogCreated(context: Context) {
|
||||||
|
binding.model = this
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 确认按钮点击
|
||||||
|
*/
|
||||||
|
fun onConfirmClick() {
|
||||||
|
// 验证变更原因
|
||||||
|
if (changeReason.value.verifyNullOrEmpty("请选择变更原因")) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// 验证联系人姓名
|
||||||
|
if (contactName.value.verifyNullOrEmpty("请输入联系人姓名")) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// 验证联系人电话
|
||||||
|
if (contactPhone.value.verifyNullOrEmpty("请输入联系人电话")) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
dismiss()
|
||||||
|
callback(this)
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,66 @@
|
|||||||
|
package com.lukouguoji.gjj.dialog
|
||||||
|
|
||||||
|
import android.content.Context
|
||||||
|
import androidx.lifecycle.MutableLiveData
|
||||||
|
import com.lukouguoji.gjj.R
|
||||||
|
import com.lukouguoji.gjj.databinding.DialogIntImpTallyResetBinding
|
||||||
|
import com.lukouguoji.module_base.base.BaseDialogModel
|
||||||
|
import com.lukouguoji.module_base.ktx.verifyNullOrEmpty
|
||||||
|
import dev.utils.app.info.KeyValue
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 国际进港理货 - 状态重置对话框
|
||||||
|
*/
|
||||||
|
class IntImpTallyResetDialogModel(
|
||||||
|
private val callback: (IntImpTallyResetDialogModel) -> Unit
|
||||||
|
) : BaseDialogModel<DialogIntImpTallyResetBinding>(DIALOG_TYPE_CENTER) {
|
||||||
|
|
||||||
|
// 重置状态列表
|
||||||
|
val resetStatusList = MutableLiveData<List<KeyValue>>()
|
||||||
|
|
||||||
|
// 选中的重置状态(存储的是value)
|
||||||
|
val selectedResetStatus = MutableLiveData("")
|
||||||
|
|
||||||
|
// 重置状态code (传给后端的restStatus参数)
|
||||||
|
var resetStatusCode: String? = null
|
||||||
|
|
||||||
|
override fun layoutId(): Int {
|
||||||
|
return R.layout.dialog_int_imp_tally_reset
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onDialogCreated(context: Context) {
|
||||||
|
binding.model = this
|
||||||
|
initResetStatusList()
|
||||||
|
|
||||||
|
// 监听选择变化,更新resetStatusCode
|
||||||
|
selectedResetStatus.observeForever { value ->
|
||||||
|
resetStatusCode = when (value) {
|
||||||
|
"01" -> "01" // 正常
|
||||||
|
"02" -> null // 未申报
|
||||||
|
else -> null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 初始化重置状态列表
|
||||||
|
*/
|
||||||
|
private fun initResetStatusList() {
|
||||||
|
val list = listOf(
|
||||||
|
KeyValue("正常", "01"),
|
||||||
|
KeyValue("未申报", "02")
|
||||||
|
)
|
||||||
|
resetStatusList.value = list
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存按钮点击
|
||||||
|
*/
|
||||||
|
fun onSaveClick() {
|
||||||
|
if (selectedResetStatus.value.verifyNullOrEmpty("请选择重置状态")) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
dismiss()
|
||||||
|
callback(this)
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,89 @@
|
|||||||
|
package com.lukouguoji.gjj.fragment
|
||||||
|
|
||||||
|
import android.os.Bundle
|
||||||
|
import android.view.LayoutInflater
|
||||||
|
import android.view.View
|
||||||
|
import android.view.ViewGroup
|
||||||
|
import androidx.databinding.DataBindingUtil
|
||||||
|
import androidx.fragment.app.Fragment
|
||||||
|
import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
|
import com.lukouguoji.gjj.R
|
||||||
|
import com.lukouguoji.gjj.databinding.FragmentIntImpQueryStorageBinding
|
||||||
|
import com.lukouguoji.gjj.holder.IntImpQueryStorageViewHolder
|
||||||
|
import com.lukouguoji.gjj.viewModel.IntImpQueryDetailsViewModel
|
||||||
|
import com.lukouguoji.module_base.base.CommonAdapter
|
||||||
|
import com.lukouguoji.module_base.bean.GjjStorageUse
|
||||||
|
import com.lukouguoji.module_base.http.net.NetApply
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 国际进港查询详情 - 库位信息Fragment
|
||||||
|
*/
|
||||||
|
class IntImpQueryStorageFragment : Fragment() {
|
||||||
|
|
||||||
|
private lateinit var binding: FragmentIntImpQueryStorageBinding
|
||||||
|
private lateinit var viewModel: IntImpQueryDetailsViewModel
|
||||||
|
private lateinit var adapter: CommonAdapter
|
||||||
|
|
||||||
|
override fun onCreateView(
|
||||||
|
inflater: LayoutInflater,
|
||||||
|
container: ViewGroup?,
|
||||||
|
savedInstanceState: Bundle?
|
||||||
|
): View {
|
||||||
|
binding = DataBindingUtil.inflate(
|
||||||
|
inflater,
|
||||||
|
R.layout.fragment_int_imp_query_storage,
|
||||||
|
container,
|
||||||
|
false
|
||||||
|
)
|
||||||
|
binding.lifecycleOwner = viewLifecycleOwner
|
||||||
|
|
||||||
|
initRecyclerView()
|
||||||
|
observeData()
|
||||||
|
|
||||||
|
return binding.root
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun initRecyclerView() {
|
||||||
|
adapter = CommonAdapter(
|
||||||
|
requireContext(),
|
||||||
|
R.layout.item_int_imp_query_storage,
|
||||||
|
IntImpQueryStorageViewHolder::class.java
|
||||||
|
)
|
||||||
|
|
||||||
|
binding.rvStorageList.apply {
|
||||||
|
layoutManager = LinearLayoutManager(requireContext())
|
||||||
|
adapter = this@IntImpQueryStorageFragment.adapter
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun observeData() {
|
||||||
|
viewModel.storageUseList.observe(viewLifecycleOwner) { mapList ->
|
||||||
|
if (mapList.isEmpty()) {
|
||||||
|
binding.rvStorageList.visibility = View.GONE
|
||||||
|
binding.llEmpty.visibility = View.VISIBLE
|
||||||
|
} else {
|
||||||
|
val beanList = mapList.map { map ->
|
||||||
|
try {
|
||||||
|
val json = NetApply.gson.toJson(map)
|
||||||
|
NetApply.gson.fromJson(json, GjjStorageUse::class.java)
|
||||||
|
} catch (e: Exception) {
|
||||||
|
e.printStackTrace()
|
||||||
|
GjjStorageUse()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
binding.rvStorageList.visibility = View.VISIBLE
|
||||||
|
binding.llEmpty.visibility = View.GONE
|
||||||
|
adapter.refresh(beanList)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
@JvmStatic
|
||||||
|
fun newInstance(vm: IntImpQueryDetailsViewModel) =
|
||||||
|
IntImpQueryStorageFragment().apply {
|
||||||
|
viewModel = vm
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,89 @@
|
|||||||
|
package com.lukouguoji.gjj.fragment
|
||||||
|
|
||||||
|
import android.os.Bundle
|
||||||
|
import android.view.LayoutInflater
|
||||||
|
import android.view.View
|
||||||
|
import android.view.ViewGroup
|
||||||
|
import androidx.databinding.DataBindingUtil
|
||||||
|
import androidx.fragment.app.Fragment
|
||||||
|
import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
|
import com.lukouguoji.gjj.R
|
||||||
|
import com.lukouguoji.gjj.databinding.FragmentIntImpQueryWarehouseBinding
|
||||||
|
import com.lukouguoji.gjj.holder.IntImpQueryWarehouseViewHolder
|
||||||
|
import com.lukouguoji.gjj.viewModel.IntImpQueryDetailsViewModel
|
||||||
|
import com.lukouguoji.module_base.base.CommonAdapter
|
||||||
|
import com.lukouguoji.module_base.bean.GjjWarehouse
|
||||||
|
import com.lukouguoji.module_base.http.net.NetApply
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 国际进港查询详情 - 仓库信息Fragment
|
||||||
|
*/
|
||||||
|
class IntImpQueryWarehouseFragment : Fragment() {
|
||||||
|
|
||||||
|
private lateinit var binding: FragmentIntImpQueryWarehouseBinding
|
||||||
|
private lateinit var viewModel: IntImpQueryDetailsViewModel
|
||||||
|
private lateinit var adapter: CommonAdapter
|
||||||
|
|
||||||
|
override fun onCreateView(
|
||||||
|
inflater: LayoutInflater,
|
||||||
|
container: ViewGroup?,
|
||||||
|
savedInstanceState: Bundle?
|
||||||
|
): View {
|
||||||
|
binding = DataBindingUtil.inflate(
|
||||||
|
inflater,
|
||||||
|
R.layout.fragment_int_imp_query_warehouse,
|
||||||
|
container,
|
||||||
|
false
|
||||||
|
)
|
||||||
|
binding.lifecycleOwner = viewLifecycleOwner
|
||||||
|
|
||||||
|
initRecyclerView()
|
||||||
|
observeData()
|
||||||
|
|
||||||
|
return binding.root
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun initRecyclerView() {
|
||||||
|
adapter = CommonAdapter(
|
||||||
|
requireContext(),
|
||||||
|
R.layout.item_int_imp_query_warehouse,
|
||||||
|
IntImpQueryWarehouseViewHolder::class.java
|
||||||
|
)
|
||||||
|
|
||||||
|
binding.rvWarehouseList.apply {
|
||||||
|
layoutManager = LinearLayoutManager(requireContext())
|
||||||
|
adapter = this@IntImpQueryWarehouseFragment.adapter
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun observeData() {
|
||||||
|
viewModel.warehouseList.observe(viewLifecycleOwner) { mapList ->
|
||||||
|
if (mapList.isEmpty()) {
|
||||||
|
binding.rvWarehouseList.visibility = View.GONE
|
||||||
|
binding.llEmpty.visibility = View.VISIBLE
|
||||||
|
} else {
|
||||||
|
val beanList = mapList.map { map ->
|
||||||
|
try {
|
||||||
|
val json = NetApply.gson.toJson(map)
|
||||||
|
NetApply.gson.fromJson(json, GjjWarehouse::class.java)
|
||||||
|
} catch (e: Exception) {
|
||||||
|
e.printStackTrace()
|
||||||
|
GjjWarehouse()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
binding.rvWarehouseList.visibility = View.VISIBLE
|
||||||
|
binding.llEmpty.visibility = View.GONE
|
||||||
|
adapter.refresh(beanList)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
@JvmStatic
|
||||||
|
fun newInstance(vm: IntImpQueryDetailsViewModel) =
|
||||||
|
IntImpQueryWarehouseFragment().apply {
|
||||||
|
viewModel = vm
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
package com.lukouguoji.gjj.fragment
|
||||||
|
|
||||||
|
import android.os.Bundle
|
||||||
|
import android.view.LayoutInflater
|
||||||
|
import android.view.View
|
||||||
|
import android.view.ViewGroup
|
||||||
|
import androidx.databinding.DataBindingUtil
|
||||||
|
import androidx.fragment.app.Fragment
|
||||||
|
import com.lukouguoji.gjj.R
|
||||||
|
import com.lukouguoji.gjj.databinding.FragmentIntImpQueryWaybillBinding
|
||||||
|
import com.lukouguoji.gjj.viewModel.IntImpQueryDetailsViewModel
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 国际进港查询详情 - 运单信息Fragment
|
||||||
|
*/
|
||||||
|
class IntImpQueryWaybillFragment : Fragment() {
|
||||||
|
|
||||||
|
private lateinit var binding: FragmentIntImpQueryWaybillBinding
|
||||||
|
private lateinit var viewModel: IntImpQueryDetailsViewModel
|
||||||
|
|
||||||
|
override fun onCreateView(
|
||||||
|
inflater: LayoutInflater,
|
||||||
|
container: ViewGroup?,
|
||||||
|
savedInstanceState: Bundle?
|
||||||
|
): View {
|
||||||
|
binding = DataBindingUtil.inflate(
|
||||||
|
inflater,
|
||||||
|
R.layout.fragment_int_imp_query_waybill,
|
||||||
|
container,
|
||||||
|
false
|
||||||
|
)
|
||||||
|
binding.lifecycleOwner = viewLifecycleOwner
|
||||||
|
binding.viewModel = viewModel
|
||||||
|
return binding.root
|
||||||
|
}
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
@JvmStatic
|
||||||
|
fun newInstance(vm: IntImpQueryDetailsViewModel) =
|
||||||
|
IntImpQueryWaybillFragment().apply {
|
||||||
|
viewModel = vm
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,10 +1,8 @@
|
|||||||
package com.lukouguoji.gjj.holder
|
package com.lukouguoji.gjj.holder
|
||||||
|
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import androidx.recyclerview.widget.RecyclerView
|
|
||||||
import com.lukouguoji.gjj.databinding.ItemIntArrAirManifestSubBinding
|
import com.lukouguoji.gjj.databinding.ItemIntArrAirManifestSubBinding
|
||||||
import com.lukouguoji.module_base.base.BaseViewHolder
|
import com.lukouguoji.module_base.base.BaseViewHolder
|
||||||
import com.lukouguoji.module_base.bean.GjjAirManifest
|
|
||||||
import com.lukouguoji.module_base.bean.GjjImportManifest
|
import com.lukouguoji.module_base.bean.GjjImportManifest
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -19,18 +17,10 @@ class IntArrAirManifestSubViewHolder(view: View) :
|
|||||||
binding.position = position
|
binding.position = position
|
||||||
binding.executePendingBindings()
|
binding.executePendingBindings()
|
||||||
|
|
||||||
// 单选框点击切换选择状态
|
// 单选框点击切换选择状态(独立选择,不联动主列表)
|
||||||
binding.ivCheckbox.setOnClickListener {
|
binding.ivCheckbox.setOnClickListener {
|
||||||
val newCheckedState = !bean.checked.get()
|
bean.checked.set(!bean.checked.get())
|
||||||
bean.checked.set(newCheckedState)
|
|
||||||
binding.executePendingBindings()
|
binding.executePendingBindings()
|
||||||
|
|
||||||
// 反向联动主列表项(勾选子项时自动勾选父项)
|
|
||||||
if (newCheckedState) {
|
|
||||||
val recyclerView = itemView.parent as? RecyclerView ?: return@setOnClickListener
|
|
||||||
val parentBean = recyclerView.tag as? GjjAirManifest ?: return@setOnClickListener
|
|
||||||
parentBean.checked.set(true)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,14 +26,10 @@ class IntArrAirManifestViewHolder(view: View) :
|
|||||||
// 整卡点击 - 跳转详情页
|
// 整卡点击 - 跳转详情页
|
||||||
notifyItemClick(position, binding.ll)
|
notifyItemClick(position, binding.ll)
|
||||||
|
|
||||||
// 图标点击 - 切换选择状态(联动子列表)
|
// 图标点击 - 切换选择状态(独立选择,不联动子列表)
|
||||||
binding.ivIcon.setOnClickListener {
|
binding.ivIcon.setOnClickListener {
|
||||||
val newCheckedState = !bean.checked.get()
|
bean.checked.set(!bean.checked.get())
|
||||||
bean.checked.set(newCheckedState)
|
|
||||||
// 联动子列表选中状态
|
|
||||||
bean.haWbList?.forEach { sub -> sub.checked.set(newCheckedState) }
|
|
||||||
binding.executePendingBindings()
|
binding.executePendingBindings()
|
||||||
binding.rvSub.adapter?.notifyDataSetChanged()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 展开按钮点击事件
|
// 展开按钮点击事件
|
||||||
@@ -48,7 +44,6 @@ class IntArrAirManifestViewHolder(view: View) :
|
|||||||
R.layout.item_int_arr_air_manifest_sub
|
R.layout.item_int_arr_air_manifest_sub
|
||||||
)
|
)
|
||||||
|
|
||||||
// 设置父Bean引用(用于子列表反向联动)
|
|
||||||
binding.rvSub.tag = bean
|
binding.rvSub.tag = bean
|
||||||
binding.rvSub.refresh(bean.haWbList ?: emptyList())
|
binding.rvSub.refresh(bean.haWbList ?: emptyList())
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,5 +21,22 @@ class IntImpAccidentVisaViewHolder(view: View) :
|
|||||||
bean.checked.set(!bean.checked.get())
|
bean.checked.set(!bean.checked.get())
|
||||||
binding.executePendingBindings()
|
binding.executePendingBindings()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 点击列表项 - 进入详情
|
||||||
|
binding.ll.setOnClickListener {
|
||||||
|
clickListener?.onItemClick(position, 1000) // type=1000表示查看详情
|
||||||
|
}
|
||||||
|
|
||||||
|
// 侧滑菜单 - 修改按钮
|
||||||
|
binding.btnEdit.setOnClickListener {
|
||||||
|
binding.swipeMenu.quickClose()
|
||||||
|
clickListener?.onItemClick(position, 2000) // type=2000表示修改操作
|
||||||
|
}
|
||||||
|
|
||||||
|
// 侧滑菜单 - 删除按钮
|
||||||
|
binding.btnDelete.setOnClickListener {
|
||||||
|
binding.swipeMenu.quickClose()
|
||||||
|
clickListener?.onItemClick(position, 3000) // type=3000表示删除操作
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,5 +22,11 @@ class IntImpLoadingListViewHolder(view: View) :
|
|||||||
bean.checked.set(!bean.checked.get())
|
bean.checked.set(!bean.checked.get())
|
||||||
binding.executePendingBindings()
|
binding.executePendingBindings()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 侧滑菜单 - 编辑按钮
|
||||||
|
binding.btnEdit.setOnClickListener {
|
||||||
|
binding.swipeMenu.quickClose()
|
||||||
|
clickListener?.onItemClick(position, 2000)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,6 +30,9 @@ class IntImpManifestViewHolder(view: View) :
|
|||||||
binding.rvSub.adapter?.notifyDataSetChanged()
|
binding.rvSub.adapter?.notifyDataSetChanged()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 整卡点击 - 跳转详情页
|
||||||
|
notifyItemClick(position, binding.llContent)
|
||||||
|
|
||||||
// 编辑按钮点击
|
// 编辑按钮点击
|
||||||
binding.btnEdit.setOnClickListener {
|
binding.btnEdit.setOnClickListener {
|
||||||
clickListener?.onItemClick(position, 101) // 101=编辑
|
clickListener?.onItemClick(position, 101) // 101=编辑
|
||||||
@@ -40,9 +43,14 @@ class IntImpManifestViewHolder(view: View) :
|
|||||||
clickListener?.onItemClick(position, 102) // 102=删除
|
clickListener?.onItemClick(position, 102) // 102=删除
|
||||||
}
|
}
|
||||||
|
|
||||||
// 展开按钮点击事件
|
// 展开按钮点击事件 - 先加载分单数据,再切换展开状态
|
||||||
binding.ivShow.setOnClickListener {
|
binding.ivShow.setOnClickListener {
|
||||||
bean.showMore.set(!bean.showMore.get())
|
if (!bean.showMore.get() && bean.haWbList.isNullOrEmpty()) {
|
||||||
|
// 首次展开且无数据,通知 ViewModel 加载分单
|
||||||
|
clickListener?.onItemClick(position, 103) // 103=加载分单
|
||||||
|
} else {
|
||||||
|
bean.showMore.set(!bean.showMore.get())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 初始化分单子列表 RecyclerView
|
// 初始化分单子列表 RecyclerView
|
||||||
@@ -54,6 +62,29 @@ class IntImpManifestViewHolder(view: View) :
|
|||||||
|
|
||||||
// 设置父Bean引用(用于子列表反向联动)
|
// 设置父Bean引用(用于子列表反向联动)
|
||||||
binding.rvSub.tag = bean
|
binding.rvSub.tag = bean
|
||||||
binding.rvSub.refresh(bean.haWbList ?: emptyList())
|
val subList = bean.haWbList ?: emptyList()
|
||||||
|
binding.rvSub.refresh(subList)
|
||||||
|
updateSubListVisibility(bean.haWbList != null, subList.isNotEmpty())
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据分单数据状态,切换表头/列表与空数据提示的显隐
|
||||||
|
* @param loaded 是否已加载过数据(haWbList != null)
|
||||||
|
* @param hasData 是否有数据
|
||||||
|
*/
|
||||||
|
private fun updateSubListVisibility(loaded: Boolean, hasData: Boolean) {
|
||||||
|
if (!loaded || hasData) {
|
||||||
|
// 未加载或有数据:显示表头+列表,隐藏空提示
|
||||||
|
binding.llHeader.visibility = View.VISIBLE
|
||||||
|
binding.dividerHeader.visibility = View.VISIBLE
|
||||||
|
binding.rvSub.visibility = View.VISIBLE
|
||||||
|
binding.tvEmpty.visibility = View.GONE
|
||||||
|
} else {
|
||||||
|
// 已加载但无数据:隐藏表头+列表,显示空提示
|
||||||
|
binding.llHeader.visibility = View.GONE
|
||||||
|
binding.dividerHeader.visibility = View.GONE
|
||||||
|
binding.rvSub.visibility = View.GONE
|
||||||
|
binding.tvEmpty.visibility = View.VISIBLE
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,8 +25,14 @@ class IntImpPickUpRecordViewHolder(view: View) :
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 列表项点击进入提取详情
|
// 列表项点击进入提取详情
|
||||||
itemView.setOnClickListener {
|
binding.ll.setOnClickListener {
|
||||||
IntImpPickUpRecordDetailsActivity.start(itemView.context, bean.id)
|
IntImpPickUpRecordDetailsActivity.start(itemView.context, bean)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 侧滑菜单 - 修改按钮
|
||||||
|
binding.btnEdit.setOnClickListener {
|
||||||
|
binding.swipeMenu.quickClose()
|
||||||
|
clickListener?.onItemClick(position, 2000) // type=2000表示修改操作
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package com.lukouguoji.gjj.holder
|
||||||
|
|
||||||
|
import android.view.View
|
||||||
|
import com.lukouguoji.gjj.databinding.ItemIntImpQueryStorageBinding
|
||||||
|
import com.lukouguoji.module_base.base.BaseViewHolder
|
||||||
|
import com.lukouguoji.module_base.bean.GjjStorageUse
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 国际进港查询详情-库位信息ViewHolder
|
||||||
|
*/
|
||||||
|
class IntImpQueryStorageViewHolder(view: View) :
|
||||||
|
BaseViewHolder<GjjStorageUse, ItemIntImpQueryStorageBinding>(view) {
|
||||||
|
|
||||||
|
override fun onBind(item: Any?, position: Int) {
|
||||||
|
val bean = getItemBean(item) ?: return
|
||||||
|
binding.bean = bean
|
||||||
|
binding.position = position
|
||||||
|
binding.executePendingBindings()
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -15,5 +15,14 @@ class IntImpQueryViewHolder(view: View) :
|
|||||||
val bean = getItemBean(item)!!
|
val bean = getItemBean(item)!!
|
||||||
binding.bean = bean
|
binding.bean = bean
|
||||||
binding.executePendingBindings()
|
binding.executePendingBindings()
|
||||||
|
|
||||||
|
// 注册整行点击事件
|
||||||
|
notifyItemClick(position, binding.ll)
|
||||||
|
|
||||||
|
// 侧滑菜单 - 修改按钮
|
||||||
|
binding.btnEdit.setOnClickListener {
|
||||||
|
binding.swipeMenu.quickClose()
|
||||||
|
clickListener?.onItemClick(position, 2000) // type=2000表示修改操作
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package com.lukouguoji.gjj.holder
|
||||||
|
|
||||||
|
import android.view.View
|
||||||
|
import com.lukouguoji.gjj.databinding.ItemIntImpQueryWarehouseBinding
|
||||||
|
import com.lukouguoji.module_base.base.BaseViewHolder
|
||||||
|
import com.lukouguoji.module_base.bean.GjjWarehouse
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 国际进港查询详情-仓库信息ViewHolder
|
||||||
|
*/
|
||||||
|
class IntImpQueryWarehouseViewHolder(view: View) :
|
||||||
|
BaseViewHolder<GjjWarehouse, ItemIntImpQueryWarehouseBinding>(view) {
|
||||||
|
|
||||||
|
override fun onBind(item: Any?, position: Int) {
|
||||||
|
val bean = getItemBean(item) ?: return
|
||||||
|
binding.bean = bean
|
||||||
|
binding.position = position
|
||||||
|
binding.executePendingBindings()
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
package com.lukouguoji.gjj.holder
|
||||||
|
|
||||||
|
import android.view.View
|
||||||
|
import androidx.recyclerview.widget.RecyclerView
|
||||||
|
import com.lukouguoji.gjj.databinding.ItemIntImpTallySubBinding
|
||||||
|
import com.lukouguoji.module_base.base.BaseViewHolder
|
||||||
|
import com.lukouguoji.module_base.bean.GjjImportTally
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 国际进港理货报告 分单子列表 ViewHolder
|
||||||
|
*/
|
||||||
|
class IntImpTallySubViewHolder(view: View) :
|
||||||
|
BaseViewHolder<GjjImportTally, ItemIntImpTallySubBinding>(view) {
|
||||||
|
|
||||||
|
override fun onBind(item: Any?, position: Int) {
|
||||||
|
val bean = getItemBean(item) ?: return
|
||||||
|
binding.bean = bean
|
||||||
|
binding.position = position
|
||||||
|
binding.executePendingBindings()
|
||||||
|
|
||||||
|
// 单选框点击切换选择状态(反向联动主列表)
|
||||||
|
binding.ivCheckbox.setOnClickListener {
|
||||||
|
val newCheckedState = !bean.checked.get()
|
||||||
|
bean.checked.set(newCheckedState)
|
||||||
|
binding.executePendingBindings()
|
||||||
|
|
||||||
|
// 反向联动主列表项(勾选时联动主项也勾选)
|
||||||
|
updateParentCheckState(newCheckedState)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新父列表项的选择状态
|
||||||
|
*/
|
||||||
|
private fun updateParentCheckState(newCheckedState: Boolean) {
|
||||||
|
val recyclerView = itemView.parent as? RecyclerView ?: return
|
||||||
|
val parentBean = recyclerView.tag as? GjjImportTally ?: return
|
||||||
|
|
||||||
|
if (newCheckedState) {
|
||||||
|
parentBean.checked.set(true)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,9 +1,17 @@
|
|||||||
package com.lukouguoji.gjj.holder
|
package com.lukouguoji.gjj.holder
|
||||||
|
|
||||||
import android.view.View
|
import android.view.View
|
||||||
|
import com.lukouguoji.gjj.R
|
||||||
import com.lukouguoji.gjj.databinding.ItemIntImpTallyBinding
|
import com.lukouguoji.gjj.databinding.ItemIntImpTallyBinding
|
||||||
|
import com.lukouguoji.gjj.activity.IntImpTallyDetailsActivity
|
||||||
|
import com.lukouguoji.module_base.adapter.setCommonAdapter
|
||||||
import com.lukouguoji.module_base.base.BaseViewHolder
|
import com.lukouguoji.module_base.base.BaseViewHolder
|
||||||
import com.lukouguoji.module_base.bean.GjjImportTally
|
import com.lukouguoji.module_base.bean.GjjImportTally
|
||||||
|
import com.google.gson.Gson
|
||||||
|
import com.lukouguoji.module_base.http.net.NetApply
|
||||||
|
import com.lukouguoji.module_base.ktx.launchCollect
|
||||||
|
import com.lukouguoji.module_base.ktx.refresh
|
||||||
|
import com.lukouguoji.module_base.ktx.toRequestBody
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 国际进港理货报告 ViewHolder
|
* 国际进港理货报告 ViewHolder
|
||||||
@@ -17,10 +25,84 @@ class IntImpTallyViewHolder(view: View) :
|
|||||||
binding.position = position
|
binding.position = position
|
||||||
binding.executePendingBindings()
|
binding.executePendingBindings()
|
||||||
|
|
||||||
// 选中图标点击 - 切换选择状态
|
// 选中图标点击 - 切换选择状态(联动子列表)
|
||||||
binding.ivIcon.setOnClickListener {
|
binding.ivIcon.setOnClickListener {
|
||||||
bean.checked.set(!bean.checked.get())
|
val newCheckedState = !bean.checked.get()
|
||||||
|
bean.checked.set(newCheckedState)
|
||||||
|
|
||||||
|
// 联动勾选/取消所有子列表项
|
||||||
|
bean.haWbList?.forEach { sub ->
|
||||||
|
sub.checked.set(newCheckedState)
|
||||||
|
}
|
||||||
|
|
||||||
binding.executePendingBindings()
|
binding.executePendingBindings()
|
||||||
|
binding.rvSub.adapter?.notifyDataSetChanged()
|
||||||
|
}
|
||||||
|
|
||||||
|
// 整个内容区域点击 - 跳转到详情页
|
||||||
|
binding.llContent.setOnClickListener {
|
||||||
|
IntImpTallyDetailsActivity.start(it.context, bean)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 展开按钮点击事件
|
||||||
|
binding.ivShow.setOnClickListener {
|
||||||
|
if (bean.haWbList != null) {
|
||||||
|
// 已加载过数据,直接切换显隐
|
||||||
|
bean.showMore.set(!bean.showMore.get())
|
||||||
|
} else {
|
||||||
|
// 首次展开,调用接口加载分单数据
|
||||||
|
loadSubList(bean)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 初始化分单子列表 RecyclerView
|
||||||
|
setCommonAdapter(
|
||||||
|
binding.rvSub,
|
||||||
|
IntImpTallySubViewHolder::class.java,
|
||||||
|
R.layout.item_int_imp_tally_sub
|
||||||
|
)
|
||||||
|
|
||||||
|
// 刷新分单数据(传递父Bean引用用于反向联动)
|
||||||
|
binding.rvSub.tag = bean
|
||||||
|
val subList = bean.haWbList ?: emptyList()
|
||||||
|
binding.rvSub.refresh(subList)
|
||||||
|
updateSubListVisibility(subList.isNotEmpty())
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 加载分单列表数据(将主单整体作为请求参数)
|
||||||
|
*/
|
||||||
|
private fun loadSubList(bean: GjjImportTally) {
|
||||||
|
// 将 bean 转为 Map 并补充 wbNo 字段(prefix + no)
|
||||||
|
val map = Gson().fromJson(Gson().toJson(bean), HashMap::class.java) as HashMap<String, Any?>
|
||||||
|
map["wbNo"] = bean.getWaybillNo()
|
||||||
|
val params = map.toRequestBody()
|
||||||
|
|
||||||
|
launchCollect({ NetApply.api.getIntImpTallySubList(params) }) {
|
||||||
|
onSuccess = { result ->
|
||||||
|
val list = result.data?.toMutableList() ?: mutableListOf()
|
||||||
|
bean.haWbList = list
|
||||||
|
bean.showMore.set(true)
|
||||||
|
binding.rvSub.refresh(list)
|
||||||
|
updateSubListVisibility(list.isNotEmpty())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据分单数据是否为空,切换表头/列表与空数据提示的显隐
|
||||||
|
*/
|
||||||
|
private fun updateSubListVisibility(hasData: Boolean) {
|
||||||
|
if (hasData) {
|
||||||
|
binding.llHeader.visibility = View.VISIBLE
|
||||||
|
binding.dividerHeader.visibility = View.VISIBLE
|
||||||
|
binding.rvSub.visibility = View.VISIBLE
|
||||||
|
binding.tvEmpty.visibility = View.GONE
|
||||||
|
} else {
|
||||||
|
binding.llHeader.visibility = View.GONE
|
||||||
|
binding.dividerHeader.visibility = View.GONE
|
||||||
|
binding.rvSub.visibility = View.GONE
|
||||||
|
binding.tvEmpty.visibility = View.VISIBLE
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package com.lukouguoji.gjj.viewModel
|
|||||||
|
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import android.view.View
|
import android.view.View
|
||||||
|
import androidx.lifecycle.MediatorLiveData
|
||||||
import androidx.lifecycle.MutableLiveData
|
import androidx.lifecycle.MutableLiveData
|
||||||
import androidx.lifecycle.viewModelScope
|
import androidx.lifecycle.viewModelScope
|
||||||
import com.lukouguoji.module_base.base.BaseViewModel
|
import com.lukouguoji.module_base.base.BaseViewModel
|
||||||
@@ -11,6 +12,7 @@ import com.lukouguoji.module_base.common.DetailsPageType
|
|||||||
import com.lukouguoji.module_base.http.net.NetApply
|
import com.lukouguoji.module_base.http.net.NetApply
|
||||||
import com.lukouguoji.module_base.impl.FlowBus
|
import com.lukouguoji.module_base.impl.FlowBus
|
||||||
import com.lukouguoji.module_base.ktx.finish
|
import com.lukouguoji.module_base.ktx.finish
|
||||||
|
import com.lukouguoji.module_base.ktx.formatDate
|
||||||
import com.lukouguoji.module_base.ktx.launchCollect
|
import com.lukouguoji.module_base.ktx.launchCollect
|
||||||
import com.lukouguoji.module_base.ktx.launchLoadingCollect
|
import com.lukouguoji.module_base.ktx.launchLoadingCollect
|
||||||
import com.lukouguoji.module_base.ktx.noNull
|
import com.lukouguoji.module_base.ktx.noNull
|
||||||
@@ -19,6 +21,7 @@ import com.lukouguoji.module_base.ktx.toRequestBody
|
|||||||
import com.lukouguoji.module_base.ktx.verifyNullOrEmpty
|
import com.lukouguoji.module_base.ktx.verifyNullOrEmpty
|
||||||
import com.lukouguoji.module_base.util.DictUtils
|
import com.lukouguoji.module_base.util.DictUtils
|
||||||
import dev.utils.app.info.KeyValue
|
import dev.utils.app.info.KeyValue
|
||||||
|
import dev.utils.common.DateUtils
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
|
|
||||||
class GjjManifestAddViewModel : BaseViewModel() {
|
class GjjManifestAddViewModel : BaseViewModel() {
|
||||||
@@ -32,18 +35,66 @@ class GjjManifestAddViewModel : BaseViewModel() {
|
|||||||
// 航班ID
|
// 航班ID
|
||||||
var fid: String = ""
|
var fid: String = ""
|
||||||
|
|
||||||
// 航班日期
|
// 航班日期(新增模式默认今天)
|
||||||
val flightDate = MutableLiveData("")
|
val flightDate = MutableLiveData(DateUtils.getCurrentTime().formatDate())
|
||||||
|
|
||||||
// 航班号
|
// 航班号
|
||||||
val flightNo = MutableLiveData("")
|
val flightNo = MutableLiveData("")
|
||||||
|
|
||||||
// 航程
|
|
||||||
val range = MutableLiveData("")
|
|
||||||
|
|
||||||
// 运单号
|
// 运单号
|
||||||
val waybillNo = MutableLiveData("")
|
val waybillNo = MutableLiveData("")
|
||||||
|
|
||||||
|
// ========== 航班级联查询 ==========
|
||||||
|
private var lastQueriedFlight = ""
|
||||||
|
|
||||||
|
fun onFlightDateInputComplete() {
|
||||||
|
lastQueriedFlight = ""
|
||||||
|
queryFlightIfReady()
|
||||||
|
}
|
||||||
|
|
||||||
|
fun onFlightNoInputComplete() {
|
||||||
|
queryFlightIfReady()
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun queryFlightIfReady() {
|
||||||
|
val fdate = flightDate.value
|
||||||
|
val fno = flightNo.value
|
||||||
|
if (fdate.isNullOrEmpty() || fno.isNullOrEmpty()) return
|
||||||
|
|
||||||
|
val key = "$fdate-$fno"
|
||||||
|
if (key == lastQueriedFlight) return
|
||||||
|
lastQueriedFlight = key
|
||||||
|
|
||||||
|
launchCollect({
|
||||||
|
NetApply.api.getGjFlightBean(
|
||||||
|
mapOf(
|
||||||
|
"fdate" to fdate,
|
||||||
|
"fno" to fno,
|
||||||
|
"ieFlag" to "I",
|
||||||
|
).toRequestBody()
|
||||||
|
)
|
||||||
|
}) {
|
||||||
|
onSuccess = {
|
||||||
|
if (it.verifySuccess() && it.data != null) {
|
||||||
|
val flight = it.data!!
|
||||||
|
fid = flight.fid.noNull()
|
||||||
|
departure.value = flight.fdep.noNull()
|
||||||
|
destination.value = flight.fdest.noNull()
|
||||||
|
} else {
|
||||||
|
fid = ""
|
||||||
|
departure.value = ""
|
||||||
|
destination.value = ""
|
||||||
|
showToast(it.msg.noNull("获取航班信息失败"))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
onFailed = { _, _ ->
|
||||||
|
fid = ""
|
||||||
|
departure.value = ""
|
||||||
|
destination.value = ""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// UN编号
|
// UN编号
|
||||||
val unNumber = MutableLiveData("")
|
val unNumber = MutableLiveData("")
|
||||||
|
|
||||||
@@ -65,6 +116,17 @@ class GjjManifestAddViewModel : BaseViewModel() {
|
|||||||
// 目的港
|
// 目的港
|
||||||
val destination = MutableLiveData("")
|
val destination = MutableLiveData("")
|
||||||
|
|
||||||
|
// 航程(自动拼接:始发站-目的站)
|
||||||
|
val range = MediatorLiveData<String>().apply {
|
||||||
|
val update = {
|
||||||
|
val dep = departure.value ?: ""
|
||||||
|
val dest = destination.value ?: ""
|
||||||
|
value = if (dep.isNotEmpty() || dest.isNotEmpty()) "$dep-$dest" else ""
|
||||||
|
}
|
||||||
|
addSource(departure) { update() }
|
||||||
|
addSource(destination) { update() }
|
||||||
|
}
|
||||||
|
|
||||||
// 品名(中)
|
// 品名(中)
|
||||||
val goodsNameCn = MutableLiveData("")
|
val goodsNameCn = MutableLiveData("")
|
||||||
|
|
||||||
@@ -100,10 +162,10 @@ class GjjManifestAddViewModel : BaseViewModel() {
|
|||||||
val waybillType = MutableLiveData("")
|
val waybillType = MutableLiveData("")
|
||||||
|
|
||||||
init {
|
init {
|
||||||
DictUtils.getAgentList(addAll = false) {
|
DictUtils.getIntImpAgentList(addAll = false) {
|
||||||
agentList.postValue(listOf(KeyValue("", "")) + it)
|
agentList.postValue(listOf(KeyValue("", "")) + it)
|
||||||
}
|
}
|
||||||
DictUtils.getSpecialCodeList(addAll = false, flag = 1, ieFlag = "I") {
|
DictUtils.getSpecialCodeList(addAll = false, flag = 1, ieFlag = "") {
|
||||||
val list = arrayListOf<KeyValue>()
|
val list = arrayListOf<KeyValue>()
|
||||||
it.find { b -> b.key.contains("普通货物") }?.let { b ->
|
it.find { b -> b.key.contains("普通货物") }?.let { b ->
|
||||||
list.add(b)
|
list.add(b)
|
||||||
@@ -113,8 +175,14 @@ class GjjManifestAddViewModel : BaseViewModel() {
|
|||||||
}
|
}
|
||||||
DictUtils.getBusinessTypeList(addAll = false) {
|
DictUtils.getBusinessTypeList(addAll = false) {
|
||||||
businessTypeList.postValue(it)
|
businessTypeList.postValue(it)
|
||||||
|
// 新增模式下默认选中"普通货物运输"
|
||||||
|
if (pageType.value == DetailsPageType.Add && businessType.value.isNullOrEmpty()) {
|
||||||
|
it.find { b -> b.key.contains("普通货物运输") }?.let { b ->
|
||||||
|
businessType.postValue(b.value)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
DictUtils.getGjjPackageTypeList(addAll = false) {
|
DictUtils.getShouYunPackageTypeList {
|
||||||
packageTypeList.postValue(listOf(KeyValue("", "")) + it)
|
packageTypeList.postValue(listOf(KeyValue("", "")) + it)
|
||||||
}
|
}
|
||||||
DictUtils.getGjjGoodsTypeList(addAll = false) {
|
DictUtils.getGjjGoodsTypeList(addAll = false) {
|
||||||
@@ -144,6 +212,20 @@ class GjjManifestAddViewModel : BaseViewModel() {
|
|||||||
departure.value = intent.getStringExtra(Constant.Key.DEPARTURE).noNull()
|
departure.value = intent.getStringExtra(Constant.Key.DEPARTURE).noNull()
|
||||||
destination.value = intent.getStringExtra(Constant.Key.DESTINATION).noNull()
|
destination.value = intent.getStringExtra(Constant.Key.DESTINATION).noNull()
|
||||||
|
|
||||||
|
// 回填航班日期和航班号(从列表页传入)
|
||||||
|
val passedFlightDate = intent.getStringExtra("flightDate").noNull()
|
||||||
|
val passedFlightNo = intent.getStringExtra("flightNo").noNull()
|
||||||
|
if (passedFlightDate.isNotEmpty()) {
|
||||||
|
flightDate.value = passedFlightDate
|
||||||
|
}
|
||||||
|
if (passedFlightNo.isNotEmpty()) {
|
||||||
|
flightNo.value = passedFlightNo
|
||||||
|
}
|
||||||
|
// 如果航班日期和航班号都有值且已从列表页获得航班信息,标记已查询避免重复请求
|
||||||
|
if (passedFlightDate.isNotEmpty() && passedFlightNo.isNotEmpty() && fid.isNotEmpty()) {
|
||||||
|
lastQueriedFlight = "$passedFlightDate-$passedFlightNo"
|
||||||
|
}
|
||||||
|
|
||||||
// 编辑模式:从Bean对象加载数据
|
// 编辑模式:从Bean对象加载数据
|
||||||
if (pageType.value == DetailsPageType.Modify) {
|
if (pageType.value == DetailsPageType.Modify) {
|
||||||
val bean = intent.getSerializableExtra(Constant.Key.BEAN)
|
val bean = intent.getSerializableExtra(Constant.Key.BEAN)
|
||||||
@@ -209,17 +291,45 @@ class GjjManifestAddViewModel : BaseViewModel() {
|
|||||||
waybillType.value = manifest.awbType
|
waybillType.value = manifest.awbType
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 校验运单号格式
|
||||||
|
* 规则:纯数字,固定11位,后8位中前7位 mod 7 == 最后一位
|
||||||
|
*/
|
||||||
|
private fun verifyWaybillNo(wbNo: String?): Boolean {
|
||||||
|
if (wbNo.isNullOrEmpty()) return false
|
||||||
|
if (wbNo.length != 11) {
|
||||||
|
showToast("运单号必须为11位数字")
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
if (!wbNo.all { it.isDigit() }) {
|
||||||
|
showToast("运单号必须为纯数字")
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
// 后8位:前7位 mod 7 == 最后一位
|
||||||
|
val last8 = wbNo.substring(3) // 后8位
|
||||||
|
val first7ofLast8 = last8.substring(0, 7).toLong()
|
||||||
|
val lastDigit = last8.last().toString().toInt()
|
||||||
|
if (first7ofLast8 % 7 != lastDigit.toLong()) {
|
||||||
|
showToast("运单号校验位不正确")
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 保存点击
|
* 保存点击
|
||||||
*/
|
*/
|
||||||
fun onSaveClick(view: View) {
|
fun onSaveClick(view: View) {
|
||||||
if ((waybillNo.value.verifyNullOrEmpty("请输入运单号")
|
if ((waybillNo.value.verifyNullOrEmpty("请输入运单号")
|
||||||
|
|| verifyWaybillNo(waybillNo.value)
|
||||||
|| agent.value.verifyNullOrEmpty("请选择代理")
|
|| agent.value.verifyNullOrEmpty("请选择代理")
|
||||||
|| waybillNum.value.verifyNullOrEmpty("请输入运单件数")
|
|| waybillNum.value.verifyNullOrEmpty("请输入运单件数")
|
||||||
|| actualNum.value.verifyNullOrEmpty("请输入实到数量")
|
|
||||||
|| goodsNameEn.value.verifyNullOrEmpty("请输入品名(英)")
|
|
||||||
|| actualWeight.value.verifyNullOrEmpty("请输入实到重量")
|
|| actualWeight.value.verifyNullOrEmpty("请输入实到重量")
|
||||||
|| packageType.value.verifyNullOrEmpty("请选择包装类型")
|
|| goodsNameEn.value.verifyNullOrEmpty("请输入品名(英)")
|
||||||
|
|| waybillType.value.verifyNullOrEmpty("请选择运单类型")
|
||||||
|
|| businessType.value.verifyNullOrEmpty("请选择业务类型")
|
||||||
|
|| departure.value.verifyNullOrEmpty("请输入始发站")
|
||||||
|
|| destination.value.verifyNullOrEmpty("请输入目的站")
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
return
|
return
|
||||||
@@ -229,15 +339,14 @@ class GjjManifestAddViewModel : BaseViewModel() {
|
|||||||
"mfId" to if (pageType.value == DetailsPageType.Modify) mfId else null,
|
"mfId" to if (pageType.value == DetailsPageType.Modify) mfId else null,
|
||||||
"fid" to fid,
|
"fid" to fid,
|
||||||
"wbNo" to waybillNo.value,
|
"wbNo" to waybillNo.value,
|
||||||
"agent" to agent.value,
|
"agentCode" to agent.value,
|
||||||
"spCode" to specialCode.value,
|
"spCode" to specialCode.value.let { if (it.isNullOrEmpty()) "NOR" else it },
|
||||||
"businessType" to businessType.value,
|
"businessType" to businessType.value,
|
||||||
"awbpc" to waybillNum.value,
|
"totalPc" to waybillNum.value,
|
||||||
"pc" to actualNum.value,
|
"pc" to actualNum.value,
|
||||||
"weight" to actualWeight.value,
|
"weight" to actualWeight.value,
|
||||||
"planweight" to billingWeight.value,
|
"cashWeight" to billingWeight.value,
|
||||||
"packagecode" to packageType.value,
|
"packageType" to packageType.value,
|
||||||
"dep" to departure.value,
|
|
||||||
"origin" to departure.value,
|
"origin" to departure.value,
|
||||||
"dest" to destination.value,
|
"dest" to destination.value,
|
||||||
"goods" to goodsNameEn.value,
|
"goods" to goodsNameEn.value,
|
||||||
|
|||||||
@@ -110,7 +110,7 @@ class GjjManifestDetailsViewModel : BaseViewModel(), IGetData {
|
|||||||
DictUtils.getAgentList(addAll = false, checkedValue = data.agent) {
|
DictUtils.getAgentList(addAll = false, checkedValue = data.agent) {
|
||||||
agentList.postValue(it)
|
agentList.postValue(it)
|
||||||
}
|
}
|
||||||
DictUtils.getSpecialCodeList(addAll = false, flag = 1, ieFlag = "I", checkedValue = data.spCode) {
|
DictUtils.getSpecialCodeList(addAll = false, flag = 1, ieFlag = "", checkedValue = data.spCode) {
|
||||||
specialCodeList.postValue(it)
|
specialCodeList.postValue(it)
|
||||||
}
|
}
|
||||||
DictUtils.getBusinessTypeList(
|
DictUtils.getBusinessTypeList(
|
||||||
|
|||||||
@@ -266,7 +266,7 @@ class GjjManifestListViewModel : BasePageViewModel(), IOnItemClickListener {
|
|||||||
private fun onDelete(list: List<GjjManifestBean>) {
|
private fun onDelete(list: List<GjjManifestBean>) {
|
||||||
showLoading()
|
showLoading()
|
||||||
launchCollect({
|
launchCollect({
|
||||||
NetApply.api.gjjManifestDelete(
|
NetApply.api.gjjManifestDeleteBatch(
|
||||||
list.map { it.mfId }.toRequestBody()
|
list.map { it.mfId }.toRequestBody()
|
||||||
)
|
)
|
||||||
}) {
|
}) {
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ import com.lukouguoji.module_base.bean.GjjDeclareParam
|
|||||||
import com.lukouguoji.module_base.bean.GjjImportManifest
|
import com.lukouguoji.module_base.bean.GjjImportManifest
|
||||||
import com.lukouguoji.module_base.common.Constant
|
import com.lukouguoji.module_base.common.Constant
|
||||||
import com.lukouguoji.module_base.common.ConstantEvent
|
import com.lukouguoji.module_base.common.ConstantEvent
|
||||||
|
import com.lukouguoji.gjj.dialog.IntImpTallyResetDialogModel
|
||||||
import com.lukouguoji.module_base.http.net.NetApply
|
import com.lukouguoji.module_base.http.net.NetApply
|
||||||
import com.lukouguoji.module_base.impl.FlowBus
|
import com.lukouguoji.module_base.impl.FlowBus
|
||||||
import com.lukouguoji.module_base.ktx.commonAdapter
|
import com.lukouguoji.module_base.ktx.commonAdapter
|
||||||
@@ -114,64 +115,62 @@ class IntArrAirManifestViewModel : BasePageViewModel() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 状态重置按钮点击
|
* 收集选中的主单和分单(独立选择,互不影响)
|
||||||
|
* @return Pair<主单列表, 分单列表>,如果无任何选中返回 null
|
||||||
*/
|
*/
|
||||||
fun resetStatusClick() {
|
private fun getSelectedItems(emptyMsg: String): Pair<List<GjjImportManifest>, List<GjjImportManifest>>? {
|
||||||
val list = pageModel.rv?.commonAdapter()?.items as? List<GjjAirManifest> ?: return
|
val list = pageModel.rv?.commonAdapter()?.items as? List<GjjAirManifest> ?: return null
|
||||||
val selectedItems = list.filter { it.isSelected }
|
val maWbList = list.filter { it.isSelected }.mapNotNull { it.maWb }
|
||||||
|
val haWbList = list.flatMap { it.haWbList ?: emptyList() }.filter { it.isSelected }
|
||||||
if (selectedItems.isEmpty()) {
|
if (maWbList.isEmpty() && haWbList.isEmpty()) {
|
||||||
showToast("请选择要重置的舱单")
|
showToast(emptyMsg)
|
||||||
return
|
return null
|
||||||
}
|
|
||||||
|
|
||||||
// 提取主单和分单
|
|
||||||
val maWbList = mutableListOf<GjjImportManifest>()
|
|
||||||
val haWbList = mutableListOf<GjjImportManifest>()
|
|
||||||
|
|
||||||
selectedItems.forEach { airManifest ->
|
|
||||||
airManifest.maWb?.let { maWbList.add(it) }
|
|
||||||
airManifest.haWbList?.let { haWbList.addAll(it) }
|
|
||||||
}
|
|
||||||
|
|
||||||
val param = GjjDeclareParam(
|
|
||||||
maWbList = maWbList,
|
|
||||||
haWbList = haWbList,
|
|
||||||
restStatus = null, // 未申报状态
|
|
||||||
resetReason = "状态重置"
|
|
||||||
)
|
|
||||||
|
|
||||||
launchLoadingCollect({ NetApply.api.resetIntArrManifestStatus(param.toRequestBody()) }) {
|
|
||||||
onSuccess = {
|
|
||||||
showToast("状态重置成功")
|
|
||||||
viewModelScope.launch {
|
|
||||||
FlowBus.with<String>(ConstantEvent.EVENT_REFRESH).emit("refresh")
|
|
||||||
}
|
|
||||||
refresh()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
return Pair(maWbList, haWbList)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 补充信息按钮点击
|
* 状态重置按钮点击
|
||||||
|
*/
|
||||||
|
fun resetStatusClick() {
|
||||||
|
val (maWbList, haWbList) = getSelectedItems("请选择要重置的舱单") ?: return
|
||||||
|
|
||||||
|
val dialog = IntImpTallyResetDialogModel { dialogModel ->
|
||||||
|
val param = GjjDeclareParam(
|
||||||
|
maWbList = maWbList,
|
||||||
|
haWbList = haWbList,
|
||||||
|
restStatus = dialogModel.resetStatusCode
|
||||||
|
)
|
||||||
|
|
||||||
|
launchLoadingCollect({ NetApply.api.resetIntArrManifestStatus(param.toRequestBody()) }) {
|
||||||
|
onSuccess = {
|
||||||
|
showToast("状态重置成功")
|
||||||
|
viewModelScope.launch {
|
||||||
|
FlowBus.with<String>(ConstantEvent.EVENT_REFRESH).emit("refresh")
|
||||||
|
}
|
||||||
|
refresh()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
dialog.show()
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 补充信息按钮点击(只针对主单)
|
||||||
*/
|
*/
|
||||||
fun supplementInfoClick() {
|
fun supplementInfoClick() {
|
||||||
val list = pageModel.rv?.commonAdapter()?.items as? List<GjjAirManifest> ?: return
|
val list = pageModel.rv?.commonAdapter()?.items as? List<GjjAirManifest> ?: return
|
||||||
val selectedItems = list.filter { it.isSelected }
|
val selectedMainItems = list.filter { it.isSelected }.mapNotNull { it.maWb }
|
||||||
|
|
||||||
if (selectedItems.isEmpty()) {
|
if (selectedMainItems.isEmpty()) {
|
||||||
showToast("请选择要补充信息的舱单")
|
showToast("请选择要补充信息的主单")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// 收集所有选中项的主单数据
|
|
||||||
val manifestList = ArrayList(selectedItems.mapNotNull { it.maWb })
|
|
||||||
if (manifestList.isEmpty()) return
|
|
||||||
|
|
||||||
// 跳转到补充信息页面(传递完整列表)
|
|
||||||
com.lukouguoji.gjj.activity.IntArrSupplementInfoActivity.start(
|
com.lukouguoji.gjj.activity.IntArrSupplementInfoActivity.start(
|
||||||
getTopActivity(),
|
getTopActivity(),
|
||||||
manifestList
|
ArrayList(selectedMainItems)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -179,31 +178,14 @@ class IntArrAirManifestViewModel : BasePageViewModel() {
|
|||||||
* 删除申报按钮点击
|
* 删除申报按钮点击
|
||||||
*/
|
*/
|
||||||
fun deleteDeclarationClick() {
|
fun deleteDeclarationClick() {
|
||||||
val list = pageModel.rv?.commonAdapter()?.items as? List<GjjAirManifest> ?: return
|
val (maWbList, haWbList) = getSelectedItems("请选择要删除申报的舱单") ?: return
|
||||||
val selectedItems = list.filter { it.isSelected }
|
|
||||||
|
|
||||||
if (selectedItems.isEmpty()) {
|
|
||||||
showToast("请选择要删除申报的舱单")
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// 从接口获取删除原因列表
|
// 从接口获取删除原因列表
|
||||||
launchLoadingCollect({ NetApply.api.getDelReasonList() }) {
|
launchLoadingCollect({ NetApply.api.getDelReasonList() }) {
|
||||||
onSuccess = { result ->
|
onSuccess = { result ->
|
||||||
val deleteReasonList = result.data?.map { it.toKeyValue() } ?: emptyList()
|
val deleteReasonList = result.data?.map { it.toKeyValue() } ?: emptyList()
|
||||||
|
|
||||||
// 创建并显示弹框
|
|
||||||
val dialog = com.lukouguoji.gjj.dialog.IntArrManifestDeleteDialogModel(deleteReasonList) { dialogModel ->
|
val dialog = com.lukouguoji.gjj.dialog.IntArrManifestDeleteDialogModel(deleteReasonList) { dialogModel ->
|
||||||
// 弹框确认后的回调
|
|
||||||
// 提取主单和分单
|
|
||||||
val maWbList = mutableListOf<GjjImportManifest>()
|
|
||||||
val haWbList = mutableListOf<GjjImportManifest>()
|
|
||||||
|
|
||||||
selectedItems.forEach { airManifest ->
|
|
||||||
airManifest.maWb?.let { maWbList.add(it) }
|
|
||||||
airManifest.haWbList?.let { haWbList.addAll(it) }
|
|
||||||
}
|
|
||||||
|
|
||||||
val param = GjjDeclareParam(
|
val param = GjjDeclareParam(
|
||||||
dcode = dialogModel.deleteReason.value ?: "",
|
dcode = dialogModel.deleteReason.value ?: "",
|
||||||
dcontactsName = dialogModel.contactName.value ?: "",
|
dcontactsName = dialogModel.contactName.value ?: "",
|
||||||
@@ -212,10 +194,7 @@ class IntArrAirManifestViewModel : BasePageViewModel() {
|
|||||||
haWbList = haWbList
|
haWbList = haWbList
|
||||||
)
|
)
|
||||||
|
|
||||||
val requestData = param.toRequestBody()
|
launchLoadingCollect({ NetApply.api.deleteIntArrManifestDeclare(param.toRequestBody()) }) {
|
||||||
|
|
||||||
// 调用删除接口
|
|
||||||
launchLoadingCollect({ NetApply.api.deleteIntArrManifestDeclare(requestData) }) {
|
|
||||||
onSuccess = {
|
onSuccess = {
|
||||||
showToast("删除申报成功")
|
showToast("删除申报成功")
|
||||||
viewModelScope.launch {
|
viewModelScope.launch {
|
||||||
@@ -235,27 +214,9 @@ class IntArrAirManifestViewModel : BasePageViewModel() {
|
|||||||
* 舱单申报按钮点击
|
* 舱单申报按钮点击
|
||||||
*/
|
*/
|
||||||
fun declareClick() {
|
fun declareClick() {
|
||||||
val list = pageModel.rv?.commonAdapter()?.items as? List<GjjAirManifest> ?: return
|
val (maWbList, haWbList) = getSelectedItems("请选择要申报的舱单") ?: return
|
||||||
val selectedItems = list.filter { it.isSelected }
|
|
||||||
|
|
||||||
if (selectedItems.isEmpty()) {
|
val param = GjjDeclareParam(maWbList = maWbList, haWbList = haWbList)
|
||||||
showToast("请选择要申报的舱单")
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// 提取主单和分单
|
|
||||||
val maWbList = mutableListOf<GjjImportManifest>()
|
|
||||||
val haWbList = mutableListOf<GjjImportManifest>()
|
|
||||||
|
|
||||||
selectedItems.forEach { airManifest ->
|
|
||||||
airManifest.maWb?.let { maWbList.add(it) }
|
|
||||||
airManifest.haWbList?.let { haWbList.addAll(it) }
|
|
||||||
}
|
|
||||||
|
|
||||||
val param = GjjDeclareParam(
|
|
||||||
maWbList = maWbList,
|
|
||||||
haWbList = haWbList
|
|
||||||
)
|
|
||||||
|
|
||||||
launchLoadingCollect({ NetApply.api.declareIntArrManifest(param.toRequestBody()) }) {
|
launchLoadingCollect({ NetApply.api.declareIntArrManifest(param.toRequestBody()) }) {
|
||||||
onSuccess = {
|
onSuccess = {
|
||||||
@@ -293,6 +254,19 @@ class IntArrAirManifestViewModel : BasePageViewModel() {
|
|||||||
launchLoadingCollect({ NetApply.api.getIntArrAirManifestList(listParams) }) {
|
launchLoadingCollect({ NetApply.api.getIntArrAirManifestList(listParams) }) {
|
||||||
onSuccess = { result ->
|
onSuccess = { result ->
|
||||||
isAllExpanded.value = false
|
isAllExpanded.value = false
|
||||||
|
// 如果接口未返回航班日期/航班号,用筛选条件填充
|
||||||
|
val fd = flightDate.value ?: ""
|
||||||
|
val fn = flightNo.value ?: ""
|
||||||
|
result.list?.forEach { airManifest ->
|
||||||
|
airManifest.maWb?.let {
|
||||||
|
if (it.fdate.isEmpty()) it.fdate = fd
|
||||||
|
if (it.fno.isEmpty()) it.fno = fn
|
||||||
|
}
|
||||||
|
airManifest.haWbList?.forEach {
|
||||||
|
if (it.fdate.isEmpty()) it.fdate = fd
|
||||||
|
if (it.fno.isEmpty()) it.fno = fn
|
||||||
|
}
|
||||||
|
}
|
||||||
pageModel.handleListBean(result.toBaseListBean())
|
pageModel.handleListBean(result.toBaseListBean())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import com.lukouguoji.module_base.ktx.launchCollect
|
|||||||
import com.lukouguoji.module_base.ktx.launchLoadingCollect
|
import com.lukouguoji.module_base.ktx.launchLoadingCollect
|
||||||
import com.lukouguoji.module_base.ktx.showToast
|
import com.lukouguoji.module_base.ktx.showToast
|
||||||
import com.lukouguoji.module_base.ktx.toRequestBody
|
import com.lukouguoji.module_base.ktx.toRequestBody
|
||||||
|
import com.lukouguoji.module_base.ktx.verifyNullOrEmpty
|
||||||
import dev.utils.app.info.KeyValue
|
import dev.utils.app.info.KeyValue
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
|
|
||||||
@@ -56,7 +57,7 @@ class IntArrSupplementInfoViewModel : BaseViewModel() {
|
|||||||
* 加载国家代码下拉列表
|
* 加载国家代码下拉列表
|
||||||
*/
|
*/
|
||||||
private fun loadCountryCodeList() {
|
private fun loadCountryCodeList() {
|
||||||
launchCollect({ NetApply.api.getAreaTypeList() }) {
|
launchCollect({ NetApply.api.getCountryCodeList() }) {
|
||||||
onSuccess = { result ->
|
onSuccess = { result ->
|
||||||
val keyValueList = result.data?.mapNotNull { bean ->
|
val keyValueList = result.data?.mapNotNull { bean ->
|
||||||
if (bean.code != null && bean.name != null) {
|
if (bean.code != null && bean.name != null) {
|
||||||
@@ -69,13 +70,18 @@ class IntArrSupplementInfoViewModel : BaseViewModel() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 加载通讯方式下拉列表(本地固定值)
|
* 加载通讯方式下拉列表
|
||||||
*/
|
*/
|
||||||
private fun loadComTypeList() {
|
private fun loadComTypeList() {
|
||||||
comTypeList.value = listOf(
|
launchCollect({ NetApply.api.getCommunicateTypeList() }) {
|
||||||
KeyValue("电话(TE)", "TE"),
|
onSuccess = { result ->
|
||||||
KeyValue("传真(FX)", "FX")
|
comTypeList.value = result.data?.mapNotNull { bean ->
|
||||||
)
|
if (bean.code != null && bean.name != null) {
|
||||||
|
KeyValue(bean.name, bean.code)
|
||||||
|
} else null
|
||||||
|
} ?: emptyList()
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -91,6 +97,17 @@ class IntArrSupplementInfoViewModel : BaseViewModel() {
|
|||||||
fun save() {
|
fun save() {
|
||||||
val formBean = dataBean.value ?: return
|
val formBean = dataBean.value ?: return
|
||||||
|
|
||||||
|
// 收货人必填校验
|
||||||
|
if (formBean.consigneeName.verifyNullOrEmpty("收货人名称不能为空")) return
|
||||||
|
if (formBean.consigneeCountryCode.verifyNullOrEmpty("收货人国家代码不能为空")) return
|
||||||
|
if (formBean.consigneeComType.verifyNullOrEmpty("收货人通讯方式不能为空")) return
|
||||||
|
if (formBean.consigneePNum.verifyNullOrEmpty("收货人联系号码不能为空")) return
|
||||||
|
// 发货人必填校验
|
||||||
|
if (formBean.consignorName.verifyNullOrEmpty("发货人名称不能为空")) return
|
||||||
|
if (formBean.consignorCountryCode.verifyNullOrEmpty("发货人国家代码不能为空")) return
|
||||||
|
if (formBean.consignorComType.verifyNullOrEmpty("发货人通讯方式不能为空")) return
|
||||||
|
if (formBean.consignorPNum.verifyNullOrEmpty("发货人联系号码不能为空")) return
|
||||||
|
|
||||||
if (manifestList.isEmpty()) {
|
if (manifestList.isEmpty()) {
|
||||||
showToast("无可保存的数据")
|
showToast("无可保存的数据")
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -0,0 +1,296 @@
|
|||||||
|
package com.lukouguoji.gjj.viewModel
|
||||||
|
|
||||||
|
import android.content.Intent
|
||||||
|
import androidx.lifecycle.LifecycleOwner
|
||||||
|
import androidx.lifecycle.MutableLiveData
|
||||||
|
import androidx.lifecycle.viewModelScope
|
||||||
|
import androidx.recyclerview.widget.RecyclerView
|
||||||
|
import com.lukouguoji.gjj.R
|
||||||
|
import com.lukouguoji.module_base.base.BaseViewModel
|
||||||
|
import com.lukouguoji.module_base.bean.FileBean
|
||||||
|
import com.lukouguoji.module_base.bean.GjAccidentVisaEditBean
|
||||||
|
import com.lukouguoji.module_base.common.Constant
|
||||||
|
import com.lukouguoji.module_base.common.ConstantEvent
|
||||||
|
import com.lukouguoji.module_base.common.DetailsPageType
|
||||||
|
import com.lukouguoji.module_base.http.net.NetApply
|
||||||
|
import com.lukouguoji.module_base.impl.FlowBus
|
||||||
|
import com.lukouguoji.module_base.impl.ImageSelectViewHolder
|
||||||
|
import com.lukouguoji.module_base.interfaces.IOnItemClickListener
|
||||||
|
import com.lukouguoji.module_base.ktx.commonAdapter
|
||||||
|
import com.lukouguoji.module_base.ktx.formatDate
|
||||||
|
import com.lukouguoji.module_base.ktx.launchCollect
|
||||||
|
import com.lukouguoji.module_base.ktx.launchLoadingCollect
|
||||||
|
import com.lukouguoji.module_base.ktx.noNull
|
||||||
|
import com.lukouguoji.module_base.ktx.showToast
|
||||||
|
import com.lukouguoji.module_base.ktx.toRequestBody
|
||||||
|
import com.lukouguoji.module_base.ktx.verifyNullOrEmpty
|
||||||
|
import com.lukouguoji.module_base.util.MediaUtil
|
||||||
|
import com.lukouguoji.module_base.util.UploadUtil
|
||||||
|
import dev.utils.app.info.KeyValue
|
||||||
|
import dev.utils.common.DateUtils
|
||||||
|
import kotlinx.coroutines.Dispatchers
|
||||||
|
import kotlinx.coroutines.flow.asFlow
|
||||||
|
import kotlinx.coroutines.flow.catch
|
||||||
|
import kotlinx.coroutines.flow.filter
|
||||||
|
import kotlinx.coroutines.flow.flowOn
|
||||||
|
import kotlinx.coroutines.flow.launchIn
|
||||||
|
import kotlinx.coroutines.flow.map
|
||||||
|
import kotlinx.coroutines.flow.onCompletion
|
||||||
|
import kotlinx.coroutines.flow.onEach
|
||||||
|
import kotlinx.coroutines.flow.onStart
|
||||||
|
import kotlinx.coroutines.launch
|
||||||
|
|
||||||
|
class IntImpAccidentVisaEditViewModel : BaseViewModel(), IOnItemClickListener {
|
||||||
|
|
||||||
|
var id: Long = 0
|
||||||
|
|
||||||
|
val pageType = MutableLiveData(DetailsPageType.Add)
|
||||||
|
|
||||||
|
val dataBean = MutableLiveData(GjAccidentVisaEditBean())
|
||||||
|
|
||||||
|
// 图片列表
|
||||||
|
val itemLayoutId = R.layout.item_image_select
|
||||||
|
val itemViewHolder = ImageSelectViewHolder::class.java
|
||||||
|
var rv: RecyclerView? = null
|
||||||
|
|
||||||
|
// 下拉列表
|
||||||
|
val outerPackageList = MutableLiveData<List<KeyValue>>(emptyList())
|
||||||
|
val damageTypeList = MutableLiveData<List<KeyValue>>(emptyList())
|
||||||
|
val contentTypeList = MutableLiveData<List<KeyValue>>(emptyList())
|
||||||
|
val unusualTypeList = MutableLiveData<List<KeyValue>>(emptyList())
|
||||||
|
val photoList = MutableLiveData(
|
||||||
|
listOf(KeyValue("是", "是"), KeyValue("否", "否"))
|
||||||
|
)
|
||||||
|
|
||||||
|
// 航班级联查询
|
||||||
|
private var lastQueriedFlight = ""
|
||||||
|
|
||||||
|
///////////////////////////////////////////////////////////////////////////
|
||||||
|
// 初始化
|
||||||
|
///////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
// 是否为详情模式(只读)
|
||||||
|
val isDetailMode = MutableLiveData(false)
|
||||||
|
|
||||||
|
fun initOnCreate(intent: Intent) {
|
||||||
|
id = intent.getLongExtra(Constant.Key.ID, 0)
|
||||||
|
val isDetail = intent.getBooleanExtra("is_detail", false)
|
||||||
|
|
||||||
|
pageType.value = when {
|
||||||
|
isDetail && id != 0L -> DetailsPageType.Details
|
||||||
|
id == 0L -> DetailsPageType.Add
|
||||||
|
else -> DetailsPageType.Modify
|
||||||
|
}
|
||||||
|
isDetailMode.value = pageType.value == DetailsPageType.Details
|
||||||
|
|
||||||
|
// 新增模式下默认航班日期为今天
|
||||||
|
if (pageType.value == DetailsPageType.Add) {
|
||||||
|
val bean = dataBean.value ?: GjAccidentVisaEditBean()
|
||||||
|
bean.fdate = DateUtils.getCurrentTime().formatDate()
|
||||||
|
dataBean.value = bean
|
||||||
|
}
|
||||||
|
|
||||||
|
loadDropdownLists()
|
||||||
|
|
||||||
|
if (id != 0L) {
|
||||||
|
loadDetail()
|
||||||
|
}
|
||||||
|
|
||||||
|
// 详情模式不添加空白占位图片
|
||||||
|
if (!isDetail) {
|
||||||
|
rv?.post {
|
||||||
|
rv?.commonAdapter()?.addItem(FileBean())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun loadDropdownLists() {
|
||||||
|
launchCollect({ NetApply.api.getPackTypeList() }) {
|
||||||
|
onSuccess = { result ->
|
||||||
|
outerPackageList.value = result.data?.mapNotNull { bean ->
|
||||||
|
bean.name?.let { name -> KeyValue(name, name) }
|
||||||
|
} ?: emptyList()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
launchCollect({ NetApply.api.getDamageTypeList() }) {
|
||||||
|
onSuccess = { result ->
|
||||||
|
damageTypeList.value = result.data?.mapNotNull { bean ->
|
||||||
|
bean.name?.let { name -> KeyValue(name, name) }
|
||||||
|
} ?: emptyList()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
launchCollect({ NetApply.api.getContentTypeList() }) {
|
||||||
|
onSuccess = { result ->
|
||||||
|
contentTypeList.value = result.data?.mapNotNull { bean ->
|
||||||
|
bean.name?.let { name -> KeyValue(name, name) }
|
||||||
|
} ?: emptyList()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
launchCollect({ NetApply.api.getUnusualTypeList() }) {
|
||||||
|
onSuccess = { result ->
|
||||||
|
unusualTypeList.value = result.data?.mapNotNull { bean ->
|
||||||
|
bean.name?.let { name -> KeyValue(name, name) }
|
||||||
|
} ?: emptyList()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun loadDetail() {
|
||||||
|
launchLoadingCollect({ NetApply.api.getGjAccidentVisaDetail(id) }) {
|
||||||
|
onSuccess = {
|
||||||
|
dataBean.value = it.data ?: GjAccidentVisaEditBean()
|
||||||
|
|
||||||
|
// 渲染图片
|
||||||
|
val bean = dataBean.value!!
|
||||||
|
val picList = bean.pic.split(",")
|
||||||
|
.filter { url -> url.isNotEmpty() }
|
||||||
|
.map { url -> FileBean(MediaUtil.fillUrl(url), url) }
|
||||||
|
val originalList = bean.originalPic.split(",")
|
||||||
|
.filter { url -> url.isNotEmpty() }
|
||||||
|
.map { url -> FileBean(MediaUtil.fillUrl(url)) }
|
||||||
|
for ((index, fileBean) in picList.withIndex()) {
|
||||||
|
if (index < originalList.size) {
|
||||||
|
picList[index].originalPic = originalList[index].path
|
||||||
|
}
|
||||||
|
}
|
||||||
|
rv?.commonAdapter()?.loadMore(picList)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
///////////////////////////////////////////////////////////////////////////
|
||||||
|
// 航班级联查询
|
||||||
|
///////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
fun onFlightDateInputComplete() {
|
||||||
|
lastQueriedFlight = ""
|
||||||
|
queryFlightIfReady()
|
||||||
|
}
|
||||||
|
|
||||||
|
fun onFlightNoInputComplete() {
|
||||||
|
queryFlightIfReady()
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun queryFlightIfReady() {
|
||||||
|
val bean = dataBean.value ?: return
|
||||||
|
val fdate = bean.fdate
|
||||||
|
val fno = bean.fno
|
||||||
|
if (fdate.isEmpty() || fno.isEmpty()) return
|
||||||
|
|
||||||
|
val key = "$fdate-$fno"
|
||||||
|
if (key == lastQueriedFlight) return
|
||||||
|
lastQueriedFlight = key
|
||||||
|
|
||||||
|
launchCollect({
|
||||||
|
NetApply.api.getGjFlightBean(
|
||||||
|
mapOf(
|
||||||
|
"fdate" to fdate,
|
||||||
|
"fno" to fno,
|
||||||
|
"ieFlag" to "I",
|
||||||
|
).toRequestBody()
|
||||||
|
)
|
||||||
|
}) {
|
||||||
|
onSuccess = {
|
||||||
|
if (it.verifySuccess() && it.data != null) {
|
||||||
|
val flight = it.data!!
|
||||||
|
val b = dataBean.value ?: GjAccidentVisaEditBean()
|
||||||
|
b.dep = flight.fdep.noNull()
|
||||||
|
b.dest = flight.fdest.noNull()
|
||||||
|
dataBean.value = b
|
||||||
|
} else {
|
||||||
|
val b = dataBean.value ?: GjAccidentVisaEditBean()
|
||||||
|
b.dep = ""
|
||||||
|
b.dest = ""
|
||||||
|
dataBean.value = b
|
||||||
|
showToast(it.msg.noNull("获取航班信息失败"))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
onFailed = { _, _ ->
|
||||||
|
val b = dataBean.value ?: GjAccidentVisaEditBean()
|
||||||
|
b.dep = ""
|
||||||
|
b.dest = ""
|
||||||
|
dataBean.value = b
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
///////////////////////////////////////////////////////////////////////////
|
||||||
|
// 保存
|
||||||
|
///////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
fun onSaveClick() {
|
||||||
|
val bean = dataBean.value ?: return
|
||||||
|
if (bean.fdate.verifyNullOrEmpty("请输入航班日期")) return
|
||||||
|
if (bean.fno.verifyNullOrEmpty("请输入航班号")) return
|
||||||
|
if (bean.wbNo.verifyNullOrEmpty("请输入运单号")) return
|
||||||
|
|
||||||
|
(rv?.commonAdapter()?.items ?: emptyList())
|
||||||
|
.asFlow()
|
||||||
|
.map { it as FileBean }
|
||||||
|
.filter { it.path.isNotEmpty() && it.url.isEmpty() }
|
||||||
|
.onEach {
|
||||||
|
val data = UploadUtil.upload(it.path).data
|
||||||
|
it.url = data?.newName ?: ""
|
||||||
|
it.originalPic = data?.zipFileName ?: ""
|
||||||
|
}
|
||||||
|
.flowOn(Dispatchers.IO)
|
||||||
|
.onStart { showLoading() }
|
||||||
|
.catch {
|
||||||
|
showToast(it.message.noNull("上传图片失败"))
|
||||||
|
dismissLoading()
|
||||||
|
}
|
||||||
|
.onCompletion {
|
||||||
|
launchLoadingCollect({
|
||||||
|
val list = (rv?.commonAdapter()?.items as List<FileBean>)
|
||||||
|
.filter { it.path.isNotEmpty() }
|
||||||
|
bean.picNumber = list.size.toString()
|
||||||
|
bean.originalPic = list.joinToString(separator = ",") { MediaUtil.removeUrl(it.url) }
|
||||||
|
bean.pic = list.joinToString(separator = ",") { MediaUtil.removeUrl(it.originalPic) }
|
||||||
|
bean.idFlag = "1"
|
||||||
|
|
||||||
|
if (pageType.value == DetailsPageType.Add) {
|
||||||
|
NetApply.api.saveGjAccidentVisa(bean.toRequestBody())
|
||||||
|
} else {
|
||||||
|
NetApply.api.modifyGjAccidentVisa(bean.toRequestBody())
|
||||||
|
}
|
||||||
|
}) {
|
||||||
|
onSuccess = {
|
||||||
|
showToast(it.msg.noNull("${pageType.value!!.title}成功"))
|
||||||
|
viewModelScope.launch {
|
||||||
|
FlowBus.with<String>(ConstantEvent.EVENT_REFRESH).emit("refresh")
|
||||||
|
}
|
||||||
|
getTopActivity().finish()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.launchIn(viewModelScope)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun onCancelClick() {
|
||||||
|
getTopActivity().finish()
|
||||||
|
}
|
||||||
|
|
||||||
|
///////////////////////////////////////////////////////////////////////////
|
||||||
|
// 图片操作
|
||||||
|
///////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
override fun onItemClick(position: Int, type: Int) {
|
||||||
|
// 详情模式下不允许长按删除操作
|
||||||
|
if (isDetailMode.value == true) return
|
||||||
|
|
||||||
|
val adapter = rv!!.commonAdapter()!!
|
||||||
|
val bean = adapter.getItem(position) as FileBean
|
||||||
|
when (type) {
|
||||||
|
R.id.rl -> {
|
||||||
|
bean.canDelete.set(!bean.canDelete.get())
|
||||||
|
}
|
||||||
|
|
||||||
|
R.id.iv_delete -> {
|
||||||
|
adapter.removeItem(position)
|
||||||
|
}
|
||||||
|
|
||||||
|
else -> {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -17,6 +17,7 @@ import com.lukouguoji.module_base.ktx.launchLoadingCollect
|
|||||||
import com.lukouguoji.module_base.ktx.noNull
|
import com.lukouguoji.module_base.ktx.noNull
|
||||||
import com.lukouguoji.module_base.ktx.showToast
|
import com.lukouguoji.module_base.ktx.showToast
|
||||||
import com.lukouguoji.module_base.ktx.toRequestBody
|
import com.lukouguoji.module_base.ktx.toRequestBody
|
||||||
|
import com.lukouguoji.module_base.model.ConfirmDialogModel
|
||||||
import com.lukouguoji.module_base.model.ScanModel
|
import com.lukouguoji.module_base.model.ScanModel
|
||||||
import dev.utils.app.info.KeyValue
|
import dev.utils.app.info.KeyValue
|
||||||
import dev.utils.common.DateUtils
|
import dev.utils.common.DateUtils
|
||||||
@@ -123,6 +124,10 @@ class IntImpAccidentVisaViewModel : BasePageViewModel() {
|
|||||||
ScanModel.startScan(getTopActivity(), Constant.RequestCode.WAYBILL)
|
ScanModel.startScan(getTopActivity(), Constant.RequestCode.WAYBILL)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun addClick() {
|
||||||
|
com.lukouguoji.gjj.activity.IntImpAccidentVisaEditActivity.start(getTopActivity())
|
||||||
|
}
|
||||||
|
|
||||||
fun searchClick() {
|
fun searchClick() {
|
||||||
refresh()
|
refresh()
|
||||||
}
|
}
|
||||||
@@ -142,7 +147,25 @@ class IntImpAccidentVisaViewModel : BasePageViewModel() {
|
|||||||
showToast("请选择要删除的数据")
|
showToast("请选择要删除的数据")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
launchLoadingCollect({ NetApply.api.deleteIntImpAccidentVisa(selected.toRequestBody()) }) {
|
ConfirmDialogModel(
|
||||||
|
message = "确定要删除选中的 ${selected.size} 条数据吗?",
|
||||||
|
title = "提示"
|
||||||
|
) {
|
||||||
|
doDelete(selected)
|
||||||
|
}.show()
|
||||||
|
}
|
||||||
|
|
||||||
|
fun singleDelete(bean: IntImpAccidentVisaBean) {
|
||||||
|
ConfirmDialogModel(
|
||||||
|
message = "确定要删除运单号 ${bean.wbNo} 的事故签证吗?",
|
||||||
|
title = "提示"
|
||||||
|
) {
|
||||||
|
doDelete(listOf(bean))
|
||||||
|
}.show()
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun doDelete(list: List<IntImpAccidentVisaBean>) {
|
||||||
|
launchLoadingCollect({ NetApply.api.deleteIntImpAccidentVisa(list.toRequestBody()) }) {
|
||||||
onSuccess = {
|
onSuccess = {
|
||||||
showToast("删除成功")
|
showToast("删除成功")
|
||||||
viewModelScope.launch {
|
viewModelScope.launch {
|
||||||
|
|||||||
@@ -0,0 +1,86 @@
|
|||||||
|
package com.lukouguoji.gjj.viewModel
|
||||||
|
|
||||||
|
import android.content.Intent
|
||||||
|
import androidx.lifecycle.MutableLiveData
|
||||||
|
import androidx.lifecycle.viewModelScope
|
||||||
|
import com.google.gson.Gson
|
||||||
|
import com.lukouguoji.module_base.base.BaseViewModel
|
||||||
|
import com.lukouguoji.module_base.bean.GjjManifest
|
||||||
|
import com.lukouguoji.module_base.common.Constant
|
||||||
|
import com.lukouguoji.module_base.common.ConstantEvent
|
||||||
|
import com.lukouguoji.module_base.http.net.NetApply
|
||||||
|
import com.lukouguoji.module_base.impl.FlowBus
|
||||||
|
import com.lukouguoji.module_base.ktx.launchLoadingCollect
|
||||||
|
import com.lukouguoji.module_base.ktx.showToast
|
||||||
|
import com.lukouguoji.module_base.ktx.toRequestBody
|
||||||
|
import kotlinx.coroutines.launch
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 国际进港装机单编辑 ViewModel
|
||||||
|
*/
|
||||||
|
class IntImpLoadingListEditViewModel : BaseViewModel() {
|
||||||
|
|
||||||
|
val dataBean = MutableLiveData(GjjManifest())
|
||||||
|
|
||||||
|
// 可编辑数值字段(String 用于双向绑定)
|
||||||
|
val location = MutableLiveData("")
|
||||||
|
val totalPcStr = MutableLiveData("")
|
||||||
|
val pcStr = MutableLiveData("")
|
||||||
|
val weightStr = MutableLiveData("")
|
||||||
|
val cashWeightStr = MutableLiveData("")
|
||||||
|
|
||||||
|
fun initOnCreated(intent: Intent) {
|
||||||
|
val jsonData = intent.getStringExtra(Constant.Key.DATA) ?: ""
|
||||||
|
if (jsonData.isNotEmpty()) {
|
||||||
|
try {
|
||||||
|
val bean = Gson().fromJson(jsonData, GjjManifest::class.java)
|
||||||
|
dataBean.value = bean
|
||||||
|
// 初始化可编辑字段
|
||||||
|
location.value = bean.location
|
||||||
|
totalPcStr.value = bean.totalPc.toString()
|
||||||
|
pcStr.value = bean.pc.toString()
|
||||||
|
weightStr.value = bean.weight.toString()
|
||||||
|
cashWeightStr.value = bean.cashWeight.toString()
|
||||||
|
} catch (e: Exception) {
|
||||||
|
showToast("数据解析失败")
|
||||||
|
getTopActivity().finish()
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
showToast("未接收到数据")
|
||||||
|
getTopActivity().finish()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存修改
|
||||||
|
*/
|
||||||
|
fun submit() {
|
||||||
|
val bean = dataBean.value ?: return
|
||||||
|
|
||||||
|
// 同步可编辑字段回 bean
|
||||||
|
bean.location = location.value ?: ""
|
||||||
|
bean.totalPc = totalPcStr.value?.toLongOrNull() ?: 0
|
||||||
|
bean.pc = pcStr.value?.toLongOrNull() ?: 0
|
||||||
|
bean.weight = weightStr.value?.toDoubleOrNull() ?: 0.0
|
||||||
|
bean.cashWeight = cashWeightStr.value?.toDoubleOrNull() ?: 0.0
|
||||||
|
|
||||||
|
launchLoadingCollect({
|
||||||
|
NetApply.api.modifyIntImpLoadingList(bean.toRequestBody())
|
||||||
|
}) {
|
||||||
|
onSuccess = {
|
||||||
|
showToast("修改成功")
|
||||||
|
viewModelScope.launch {
|
||||||
|
FlowBus.with<String>(ConstantEvent.EVENT_REFRESH).emit("refresh")
|
||||||
|
}
|
||||||
|
getTopActivity().finish()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 取消
|
||||||
|
*/
|
||||||
|
fun cancel() {
|
||||||
|
getTopActivity().finish()
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -10,6 +10,7 @@ import com.lukouguoji.module_base.common.Constant
|
|||||||
import com.lukouguoji.module_base.common.ConstantEvent
|
import com.lukouguoji.module_base.common.ConstantEvent
|
||||||
import com.lukouguoji.module_base.http.net.NetApply
|
import com.lukouguoji.module_base.http.net.NetApply
|
||||||
import com.lukouguoji.module_base.impl.FlowBus
|
import com.lukouguoji.module_base.impl.FlowBus
|
||||||
|
import com.lukouguoji.module_base.interfaces.IOnItemClickListener
|
||||||
import com.lukouguoji.module_base.ktx.commonAdapter
|
import com.lukouguoji.module_base.ktx.commonAdapter
|
||||||
import com.lukouguoji.module_base.ktx.launchCollect
|
import com.lukouguoji.module_base.ktx.launchCollect
|
||||||
import com.lukouguoji.module_base.ktx.launchLoadingCollect
|
import com.lukouguoji.module_base.ktx.launchLoadingCollect
|
||||||
@@ -23,7 +24,7 @@ import kotlinx.coroutines.launch
|
|||||||
/**
|
/**
|
||||||
* 国际进港装机单 ViewModel
|
* 国际进港装机单 ViewModel
|
||||||
*/
|
*/
|
||||||
class IntImpLoadingListViewModel : BasePageViewModel() {
|
class IntImpLoadingListViewModel : BasePageViewModel(), IOnItemClickListener {
|
||||||
|
|
||||||
// ========== 搜索条件 ==========
|
// ========== 搜索条件 ==========
|
||||||
val flightDate = MutableLiveData("") // 航班日期
|
val flightDate = MutableLiveData("") // 航班日期
|
||||||
@@ -35,7 +36,8 @@ class IntImpLoadingListViewModel : BasePageViewModel() {
|
|||||||
|
|
||||||
// ========== 航班级联查询 ==========
|
// ========== 航班级联查询 ==========
|
||||||
private var lastQueriedFlight = ""
|
private var lastQueriedFlight = ""
|
||||||
private var fid = ""
|
var fid = ""
|
||||||
|
var fdep = ""
|
||||||
|
|
||||||
fun onFlightDateInputComplete() {
|
fun onFlightDateInputComplete() {
|
||||||
lastQueriedFlight = ""
|
lastQueriedFlight = ""
|
||||||
@@ -68,6 +70,7 @@ class IntImpLoadingListViewModel : BasePageViewModel() {
|
|||||||
if (it.verifySuccess() && it.data != null) {
|
if (it.verifySuccess() && it.data != null) {
|
||||||
val flight = it.data!!
|
val flight = it.data!!
|
||||||
fid = flight.fid.noNull()
|
fid = flight.fid.noNull()
|
||||||
|
fdep = flight.fdep.noNull()
|
||||||
fdest.value = flight.fdest.noNull()
|
fdest.value = flight.fdest.noNull()
|
||||||
|
|
||||||
// 构建始发站下拉列表:fdep + jtz(经停港)
|
// 构建始发站下拉列表:fdep + jtz(经停港)
|
||||||
@@ -81,6 +84,7 @@ class IntImpLoadingListViewModel : BasePageViewModel() {
|
|||||||
sendAddress.value = flight.fdep.noNull()
|
sendAddress.value = flight.fdep.noNull()
|
||||||
} else {
|
} else {
|
||||||
fid = ""
|
fid = ""
|
||||||
|
fdep = ""
|
||||||
fdest.value = ""
|
fdest.value = ""
|
||||||
sendAddressList.value = emptyList()
|
sendAddressList.value = emptyList()
|
||||||
sendAddress.value = ""
|
sendAddress.value = ""
|
||||||
@@ -90,6 +94,7 @@ class IntImpLoadingListViewModel : BasePageViewModel() {
|
|||||||
|
|
||||||
onFailed = { _, _ ->
|
onFailed = { _, _ ->
|
||||||
fid = ""
|
fid = ""
|
||||||
|
fdep = ""
|
||||||
fdest.value = ""
|
fdest.value = ""
|
||||||
sendAddressList.value = emptyList()
|
sendAddressList.value = emptyList()
|
||||||
sendAddress.value = ""
|
sendAddress.value = ""
|
||||||
@@ -120,9 +125,66 @@ class IntImpLoadingListViewModel : BasePageViewModel() {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 搜索按钮点击
|
* 搜索按钮点击
|
||||||
|
* 先查询航班信息获取FID,再刷新列表(与父页面逻辑保持一致)
|
||||||
*/
|
*/
|
||||||
fun searchClick() {
|
fun searchClick() {
|
||||||
refresh()
|
val fdate = flightDate.value
|
||||||
|
val fno = flightNo.value
|
||||||
|
if (!fdate.isNullOrEmpty() && !fno.isNullOrEmpty()) {
|
||||||
|
val key = "$fdate-$fno"
|
||||||
|
if (key != lastQueriedFlight || fid.isEmpty()) {
|
||||||
|
// 先查询航班信息获取FID
|
||||||
|
lastQueriedFlight = key
|
||||||
|
launchLoadingCollect({
|
||||||
|
NetApply.api.getGjFlightBean(
|
||||||
|
mapOf(
|
||||||
|
"fdate" to fdate,
|
||||||
|
"fno" to fno,
|
||||||
|
"ieFlag" to "I",
|
||||||
|
).toRequestBody()
|
||||||
|
)
|
||||||
|
}) {
|
||||||
|
onSuccess = {
|
||||||
|
if (it.verifySuccess() && it.data != null) {
|
||||||
|
val flight = it.data!!
|
||||||
|
fid = flight.fid.noNull()
|
||||||
|
fdep = flight.fdep.noNull()
|
||||||
|
fdest.value = flight.fdest.noNull()
|
||||||
|
val list = mutableListOf(
|
||||||
|
KeyValue(flight.fdep.noNull(), flight.fdep.noNull()),
|
||||||
|
)
|
||||||
|
if (!flight.jtz.isNullOrEmpty()) {
|
||||||
|
list.add(KeyValue(flight.jtz.noNull(), flight.jtz.noNull()))
|
||||||
|
}
|
||||||
|
sendAddressList.value = list
|
||||||
|
sendAddress.value = flight.fdep.noNull()
|
||||||
|
} else {
|
||||||
|
fid = ""
|
||||||
|
fdep = ""
|
||||||
|
fdest.value = ""
|
||||||
|
sendAddressList.value = emptyList()
|
||||||
|
sendAddress.value = ""
|
||||||
|
showToast(it.msg.noNull("获取航班信息失败"))
|
||||||
|
}
|
||||||
|
refresh()
|
||||||
|
}
|
||||||
|
onFailed = { _, _ ->
|
||||||
|
fid = ""
|
||||||
|
fdep = ""
|
||||||
|
fdest.value = ""
|
||||||
|
sendAddressList.value = emptyList()
|
||||||
|
sendAddress.value = ""
|
||||||
|
refresh()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
refresh()
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
fid = ""
|
||||||
|
fdep = ""
|
||||||
|
refresh()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -165,7 +227,7 @@ class IntImpLoadingListViewModel : BasePageViewModel() {
|
|||||||
"manifestList" to selectedItems
|
"manifestList" to selectedItems
|
||||||
).toRequestBody()
|
).toRequestBody()
|
||||||
|
|
||||||
launchLoadingCollect({ NetApply.api.modifyIntImpStorage(params) }) {
|
launchLoadingCollect({ NetApply.api.modifyIntImpLoadingStorage(params) }) {
|
||||||
onSuccess = {
|
onSuccess = {
|
||||||
showToast("修改库位成功")
|
showToast("修改库位成功")
|
||||||
viewModelScope.launch {
|
viewModelScope.launch {
|
||||||
@@ -203,7 +265,7 @@ class IntImpLoadingListViewModel : BasePageViewModel() {
|
|||||||
"manifestList" to selectedItems
|
"manifestList" to selectedItems
|
||||||
).toRequestBody()
|
).toRequestBody()
|
||||||
|
|
||||||
launchLoadingCollect({ NetApply.api.inIntImpStorage(params) }) {
|
launchLoadingCollect({ NetApply.api.inIntImpLoadingStorage(params) }) {
|
||||||
onSuccess = {
|
onSuccess = {
|
||||||
showToast("入库成功")
|
showToast("入库成功")
|
||||||
viewModelScope.launch {
|
viewModelScope.launch {
|
||||||
@@ -217,16 +279,29 @@ class IntImpLoadingListViewModel : BasePageViewModel() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 列表项点击回调(侧滑菜单)
|
||||||
|
*/
|
||||||
|
override fun onItemClick(position: Int, type: Int) {
|
||||||
|
when (type) {
|
||||||
|
2000 -> {
|
||||||
|
// 编辑操作
|
||||||
|
val list = pageModel.rv?.commonAdapter()?.items as? List<GjjManifest> ?: return
|
||||||
|
val bean = list.getOrNull(position) ?: return
|
||||||
|
com.lukouguoji.gjj.activity.IntImpLoadingListEditActivity.start(getTopActivity(), bean)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取数据(重写BasePageViewModel)
|
* 获取数据(重写BasePageViewModel)
|
||||||
|
* 查询参数与父页面(国际进港舱单)保持一致:使用FID和FDGP
|
||||||
*/
|
*/
|
||||||
override fun getData() {
|
override fun getData() {
|
||||||
// 构建搜索条件
|
// 构建搜索条件(与父页面一致:fid + fdep + wbNo)
|
||||||
val filterParams = mapOf(
|
val filterParams = mapOf(
|
||||||
"fdate" to flightDate.value?.ifEmpty { null },
|
"fid" to fid.ifEmpty { null },
|
||||||
"fno" to flightNo.value?.ifEmpty { null },
|
"fdep" to fdep.ifEmpty { null },
|
||||||
"sendAddress" to sendAddress.value?.ifEmpty { null },
|
|
||||||
"fdest" to fdest.value?.ifEmpty { null },
|
|
||||||
"wbNo" to waybillNo.value?.ifEmpty { null }
|
"wbNo" to waybillNo.value?.ifEmpty { null }
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -242,19 +317,7 @@ class IntImpLoadingListViewModel : BasePageViewModel() {
|
|||||||
// 获取列表(带Loading)
|
// 获取列表(带Loading)
|
||||||
launchLoadingCollect({ NetApply.api.getIntImpLoadingList(listParams) }) {
|
launchLoadingCollect({ NetApply.api.getIntImpLoadingList(listParams) }) {
|
||||||
onSuccess = { result ->
|
onSuccess = { result ->
|
||||||
// 处理PageInfo结构
|
pageModel.handleListBean(result.toBaseListBean())
|
||||||
val pageInfo = result.data
|
|
||||||
if (pageInfo != null) {
|
|
||||||
val list = pageInfo.list ?: emptyList()
|
|
||||||
val pages = pageInfo.pages ?: 1
|
|
||||||
|
|
||||||
// 处理分页数据
|
|
||||||
pageModel.handleDataList(list)
|
|
||||||
pageModel.haveMore.postValue(pages > pageModel.page)
|
|
||||||
} else {
|
|
||||||
pageModel.handleDataList(emptyList())
|
|
||||||
pageModel.haveMore.postValue(false)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,26 @@
|
|||||||
|
package com.lukouguoji.gjj.viewModel
|
||||||
|
|
||||||
|
import android.content.Intent
|
||||||
|
import androidx.lifecycle.MutableLiveData
|
||||||
|
import com.lukouguoji.module_base.base.BaseViewModel
|
||||||
|
import com.lukouguoji.module_base.bean.GjjManifest
|
||||||
|
import com.lukouguoji.module_base.common.Constant
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 国际进港舱单详情 ViewModel
|
||||||
|
*/
|
||||||
|
class IntImpManifestDetailsViewModel : BaseViewModel() {
|
||||||
|
|
||||||
|
// 舱单数据
|
||||||
|
val dataBean = MutableLiveData(GjjManifest())
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 初始化数据(从列表项携带的数据)
|
||||||
|
*/
|
||||||
|
fun initOnCreated(intent: Intent) {
|
||||||
|
val manifest = intent.getSerializableExtra(Constant.Key.DATA) as? GjjManifest
|
||||||
|
if (manifest != null) {
|
||||||
|
dataBean.value = manifest
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,193 @@
|
|||||||
|
package com.lukouguoji.gjj.viewModel
|
||||||
|
|
||||||
|
import android.content.Intent
|
||||||
|
import androidx.lifecycle.MutableLiveData
|
||||||
|
import androidx.lifecycle.viewModelScope
|
||||||
|
import com.lukouguoji.gjj.activity.IntImpManifestSubEditActivity
|
||||||
|
import com.lukouguoji.module_base.base.BaseViewModel
|
||||||
|
import com.lukouguoji.module_base.bean.GjjHaWb
|
||||||
|
import com.lukouguoji.module_base.bean.GjjManifest
|
||||||
|
import com.lukouguoji.module_base.common.Constant
|
||||||
|
import com.lukouguoji.module_base.common.ConstantEvent
|
||||||
|
import com.lukouguoji.module_base.common.DetailsPageType
|
||||||
|
import com.lukouguoji.module_base.http.net.NetApply
|
||||||
|
import com.lukouguoji.module_base.impl.FlowBus
|
||||||
|
import com.lukouguoji.module_base.ktx.launchLoadingCollect
|
||||||
|
import com.lukouguoji.module_base.ktx.noNull
|
||||||
|
import com.lukouguoji.module_base.ktx.showToast
|
||||||
|
import com.lukouguoji.module_base.ktx.toRequestBody
|
||||||
|
import kotlinx.coroutines.launch
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 国际进港舱单-分单编辑 ViewModel
|
||||||
|
*/
|
||||||
|
class IntImpManifestSubEditViewModel : BaseViewModel() {
|
||||||
|
|
||||||
|
// 页面类型
|
||||||
|
val pageType = MutableLiveData(DetailsPageType.Add)
|
||||||
|
|
||||||
|
// 分单ID(编辑时使用)
|
||||||
|
var hawbId: Long = 0
|
||||||
|
|
||||||
|
// 主单ID
|
||||||
|
var mfId: Long = 0
|
||||||
|
|
||||||
|
// 运单号前缀和编号(从主单获取,保存时需传给接口)
|
||||||
|
var prefix: String = ""
|
||||||
|
var no: String = ""
|
||||||
|
|
||||||
|
// 表单字段
|
||||||
|
val waybillNo = MutableLiveData("") // 运单号(只读)
|
||||||
|
val mainSubCheck = MutableLiveData("") // 主分校验(只读)
|
||||||
|
val subNo = MutableLiveData("") // 分单号
|
||||||
|
val pc = MutableLiveData("") // 件数
|
||||||
|
val weight = MutableLiveData("") // 重量
|
||||||
|
val goodsCn = MutableLiveData("") // 品名(中)
|
||||||
|
|
||||||
|
// 主单件数/重量
|
||||||
|
private var mainPc: Long = 0
|
||||||
|
private var mainWeight: Double = 0.0
|
||||||
|
|
||||||
|
// 其他分单件数/重量之和(不含当前编辑的分单)
|
||||||
|
private var otherSubPc: Long = 0
|
||||||
|
private var otherSubWeight: Double = 0.0
|
||||||
|
|
||||||
|
// 主分校验是否通过(true=绿色允许保存,false=红色不允许保存)
|
||||||
|
val isCheckValid = MutableLiveData(true)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 初始化(从Intent获取参数)
|
||||||
|
*/
|
||||||
|
fun initOnCreated(intent: Intent) {
|
||||||
|
pageType.value = DetailsPageType.valueOf(
|
||||||
|
intent.getStringExtra(Constant.Key.PAGE_TYPE) ?: DetailsPageType.Add.name
|
||||||
|
)
|
||||||
|
|
||||||
|
// 获取主单信息
|
||||||
|
val manifest = intent.getSerializableExtra(Constant.Key.BEAN) as? GjjManifest
|
||||||
|
if (manifest != null) {
|
||||||
|
mfId = manifest.mfId
|
||||||
|
prefix = manifest.prefix
|
||||||
|
no = manifest.no
|
||||||
|
waybillNo.value = manifest.getWaybillNo()
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取主分校验参数
|
||||||
|
mainPc = intent.getLongExtra(IntImpManifestSubEditActivity.KEY_MAIN_PC, 0)
|
||||||
|
mainWeight = intent.getDoubleExtra(IntImpManifestSubEditActivity.KEY_MAIN_WEIGHT, 0.0)
|
||||||
|
otherSubPc = intent.getLongExtra(IntImpManifestSubEditActivity.KEY_OTHER_SUB_PC, 0)
|
||||||
|
otherSubWeight = intent.getDoubleExtra(IntImpManifestSubEditActivity.KEY_OTHER_SUB_WEIGHT, 0.0)
|
||||||
|
|
||||||
|
// 编辑模式:回填分单数据
|
||||||
|
if (pageType.value == DetailsPageType.Modify) {
|
||||||
|
val haWb = intent.getSerializableExtra("haWb") as? GjjHaWb
|
||||||
|
if (haWb != null) {
|
||||||
|
hawbId = haWb.hawbId
|
||||||
|
subNo.value = haWb.hno
|
||||||
|
pc.value = if (haWb.pc > 0) haWb.pc.toString() else ""
|
||||||
|
weight.value = if (haWb.weight > 0) haWb.weight.toString() else ""
|
||||||
|
goodsCn.value = haWb.goodsCn.ifEmpty { haWb.goods }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 计算主分校验
|
||||||
|
updateMainSubCheck()
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 件数输入完成回调
|
||||||
|
*/
|
||||||
|
fun onPcInputComplete() {
|
||||||
|
updateMainSubCheck()
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 重量输入完成回调
|
||||||
|
*/
|
||||||
|
fun onWeightInputComplete() {
|
||||||
|
updateMainSubCheck()
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 实时计算主分校验
|
||||||
|
* 格式:分单之和件数/主单件数 分单之和重量/主单重量KG
|
||||||
|
* 颜色:分单之和 > 主单 → 红色(不允许保存),否则 → 绿色
|
||||||
|
*/
|
||||||
|
private fun updateMainSubCheck() {
|
||||||
|
val currentPc = pc.value?.toLongOrNull() ?: 0
|
||||||
|
val currentWeight = weight.value?.toDoubleOrNull() ?: 0.0
|
||||||
|
|
||||||
|
val totalSubPc = otherSubPc + currentPc
|
||||||
|
val totalSubWeight = otherSubWeight + currentWeight
|
||||||
|
|
||||||
|
mainSubCheck.value = "${totalSubPc}/${mainPc} ${formatWeight(totalSubWeight)}/${formatWeight(mainWeight)}KG"
|
||||||
|
|
||||||
|
// 件数或重量任一超过主单则校验不通过
|
||||||
|
isCheckValid.value = totalSubPc <= mainPc && totalSubWeight <= mainWeight
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 格式化重量显示(整数不显示小数位)
|
||||||
|
*/
|
||||||
|
private fun formatWeight(value: Double): String {
|
||||||
|
return if (value % 1.0 == 0.0) {
|
||||||
|
value.toLong().toString()
|
||||||
|
} else {
|
||||||
|
value.toString()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存
|
||||||
|
*/
|
||||||
|
fun onSaveClick() {
|
||||||
|
// 主分校验不通过时禁止保存
|
||||||
|
if (isCheckValid.value == false) {
|
||||||
|
showToast("分单之和超过主单,不允许保存")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
val params = mutableMapOf<String, Any?>(
|
||||||
|
"mfId" to mfId,
|
||||||
|
"prefix" to prefix,
|
||||||
|
"no" to no,
|
||||||
|
"hno" to subNo.value,
|
||||||
|
"pc" to pc.value?.toLongOrNull(),
|
||||||
|
"weight" to weight.value?.toDoubleOrNull(),
|
||||||
|
"goodsCn" to goodsCn.value,
|
||||||
|
"goods" to goodsCn.value
|
||||||
|
)
|
||||||
|
|
||||||
|
if (pageType.value == DetailsPageType.Modify) {
|
||||||
|
params["hawbId"] = hawbId
|
||||||
|
}
|
||||||
|
|
||||||
|
launchLoadingCollect({
|
||||||
|
if (pageType.value == DetailsPageType.Modify) {
|
||||||
|
NetApply.api.intImpManifestModifyHaWb(params.toRequestBody())
|
||||||
|
} else {
|
||||||
|
NetApply.api.intImpManifestAddHaWb(params.toRequestBody())
|
||||||
|
}
|
||||||
|
}) {
|
||||||
|
onSuccess = {
|
||||||
|
if (it.verifySuccess()) {
|
||||||
|
val msg = if (pageType.value == DetailsPageType.Modify) "修改成功" else "新增成功"
|
||||||
|
showToast(msg)
|
||||||
|
viewModelScope.launch {
|
||||||
|
FlowBus.with<String>(ConstantEvent.EVENT_REFRESH).emit("refresh")
|
||||||
|
}
|
||||||
|
getTopActivity().finish()
|
||||||
|
} else {
|
||||||
|
showToast(it.msg.noNull("保存失败"))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 取消
|
||||||
|
*/
|
||||||
|
fun onCancelClick() {
|
||||||
|
getTopActivity().finish()
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -6,6 +6,7 @@ import com.lukouguoji.gjj.R
|
|||||||
import dev.utils.common.DateUtils
|
import dev.utils.common.DateUtils
|
||||||
import com.lukouguoji.module_base.ktx.formatDate
|
import com.lukouguoji.module_base.ktx.formatDate
|
||||||
import com.lukouguoji.gjj.activity.GjjManifestAddActivity
|
import com.lukouguoji.gjj.activity.GjjManifestAddActivity
|
||||||
|
import com.lukouguoji.gjj.activity.IntImpManifestSubEditActivity
|
||||||
import com.lukouguoji.gjj.holder.IntImpManifestViewHolder
|
import com.lukouguoji.gjj.holder.IntImpManifestViewHolder
|
||||||
import com.lukouguoji.module_base.base.BasePageViewModel
|
import com.lukouguoji.module_base.base.BasePageViewModel
|
||||||
import com.lukouguoji.module_base.bean.GjjManifest
|
import com.lukouguoji.module_base.bean.GjjManifest
|
||||||
@@ -19,6 +20,7 @@ import com.lukouguoji.module_base.ktx.launchLoadingCollect
|
|||||||
import com.lukouguoji.module_base.ktx.noNull
|
import com.lukouguoji.module_base.ktx.noNull
|
||||||
import com.lukouguoji.module_base.ktx.showToast
|
import com.lukouguoji.module_base.ktx.showToast
|
||||||
import com.lukouguoji.module_base.ktx.toRequestBody
|
import com.lukouguoji.module_base.ktx.toRequestBody
|
||||||
|
import com.lukouguoji.gjj.dialog.IntImpModifyStorageDialogModel
|
||||||
import com.lukouguoji.module_base.model.ConfirmDialogModel
|
import com.lukouguoji.module_base.model.ConfirmDialogModel
|
||||||
import dev.utils.app.info.KeyValue
|
import dev.utils.app.info.KeyValue
|
||||||
import com.lukouguoji.module_base.model.ScanModel
|
import com.lukouguoji.module_base.model.ScanModel
|
||||||
@@ -34,12 +36,13 @@ class IntImpManifestViewModel : BasePageViewModel() {
|
|||||||
val flightNo = MutableLiveData("") // 航班号
|
val flightNo = MutableLiveData("") // 航班号
|
||||||
val sendAddress = MutableLiveData("") // 始发站
|
val sendAddress = MutableLiveData("") // 始发站
|
||||||
val sendAddressList = MutableLiveData<List<KeyValue>>(emptyList())
|
val sendAddressList = MutableLiveData<List<KeyValue>>(emptyList())
|
||||||
val fdep = MutableLiveData("") // 目的站
|
val fdest = MutableLiveData("") // 目的站
|
||||||
val waybillNo = MutableLiveData("") // 运单号
|
val waybillNo = MutableLiveData("") // 运单号
|
||||||
|
|
||||||
// ========== 航班级联查询 ==========
|
// ========== 航班级联查询 ==========
|
||||||
private var lastQueriedFlight = ""
|
private var lastQueriedFlight = ""
|
||||||
private var fid = ""
|
var fid = ""
|
||||||
|
var fdep = "" // 航班始发港(用于列表查询参数)
|
||||||
|
|
||||||
fun onFlightDateInputComplete() {
|
fun onFlightDateInputComplete() {
|
||||||
lastQueriedFlight = ""
|
lastQueriedFlight = ""
|
||||||
@@ -72,7 +75,8 @@ class IntImpManifestViewModel : BasePageViewModel() {
|
|||||||
if (it.verifySuccess() && it.data != null) {
|
if (it.verifySuccess() && it.data != null) {
|
||||||
val flight = it.data!!
|
val flight = it.data!!
|
||||||
fid = flight.fid.noNull()
|
fid = flight.fid.noNull()
|
||||||
fdep.value = flight.fdest.noNull()
|
fdep = flight.fdep.noNull()
|
||||||
|
fdest.value = flight.fdest.noNull()
|
||||||
|
|
||||||
// 构建始发站下拉列表:fdep + jtz(经停港)
|
// 构建始发站下拉列表:fdep + jtz(经停港)
|
||||||
val list = mutableListOf(
|
val list = mutableListOf(
|
||||||
@@ -85,7 +89,8 @@ class IntImpManifestViewModel : BasePageViewModel() {
|
|||||||
sendAddress.value = flight.fdep.noNull()
|
sendAddress.value = flight.fdep.noNull()
|
||||||
} else {
|
} else {
|
||||||
fid = ""
|
fid = ""
|
||||||
fdep.value = ""
|
fdep = ""
|
||||||
|
fdest.value = ""
|
||||||
sendAddressList.value = emptyList()
|
sendAddressList.value = emptyList()
|
||||||
sendAddress.value = ""
|
sendAddress.value = ""
|
||||||
showToast(it.msg.noNull("获取航班信息失败"))
|
showToast(it.msg.noNull("获取航班信息失败"))
|
||||||
@@ -94,7 +99,8 @@ class IntImpManifestViewModel : BasePageViewModel() {
|
|||||||
|
|
||||||
onFailed = { _, _ ->
|
onFailed = { _, _ ->
|
||||||
fid = ""
|
fid = ""
|
||||||
fdep.value = ""
|
fdep = ""
|
||||||
|
fdest.value = ""
|
||||||
sendAddressList.value = emptyList()
|
sendAddressList.value = emptyList()
|
||||||
sendAddress.value = ""
|
sendAddress.value = ""
|
||||||
}
|
}
|
||||||
@@ -112,6 +118,9 @@ class IntImpManifestViewModel : BasePageViewModel() {
|
|||||||
// ========== 展开/收起 ==========
|
// ========== 展开/收起 ==========
|
||||||
val isAllExpanded = MutableLiveData(false)
|
val isAllExpanded = MutableLiveData(false)
|
||||||
|
|
||||||
|
// ========== 分单管理模式 ==========
|
||||||
|
val isSubManagementMode = MutableLiveData(false)
|
||||||
|
|
||||||
init {
|
init {
|
||||||
// 监听全选状态,自动更新所有列表项(联动子列表)
|
// 监听全选状态,自动更新所有列表项(联动子列表)
|
||||||
isAllChecked.observeForever { checked ->
|
isAllChecked.observeForever { checked ->
|
||||||
@@ -130,9 +139,66 @@ class IntImpManifestViewModel : BasePageViewModel() {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 搜索按钮点击
|
* 搜索按钮点击
|
||||||
|
* 先查询航班信息获取FID,再刷新列表
|
||||||
*/
|
*/
|
||||||
fun searchClick() {
|
fun searchClick() {
|
||||||
refresh()
|
val fdate = flightDate.value
|
||||||
|
val fno = flightNo.value
|
||||||
|
if (!fdate.isNullOrEmpty() && !fno.isNullOrEmpty()) {
|
||||||
|
val key = "$fdate-$fno"
|
||||||
|
if (key != lastQueriedFlight || fid.isEmpty()) {
|
||||||
|
// 先查询航班信息获取FID
|
||||||
|
lastQueriedFlight = key
|
||||||
|
launchLoadingCollect({
|
||||||
|
NetApply.api.getGjFlightBean(
|
||||||
|
mapOf(
|
||||||
|
"fdate" to fdate,
|
||||||
|
"fno" to fno,
|
||||||
|
"ieFlag" to "I",
|
||||||
|
).toRequestBody()
|
||||||
|
)
|
||||||
|
}) {
|
||||||
|
onSuccess = {
|
||||||
|
if (it.verifySuccess() && it.data != null) {
|
||||||
|
val flight = it.data!!
|
||||||
|
fid = flight.fid.noNull()
|
||||||
|
fdep = flight.fdep.noNull()
|
||||||
|
fdest.value = flight.fdest.noNull()
|
||||||
|
val list = mutableListOf(
|
||||||
|
KeyValue(flight.fdep.noNull(), flight.fdep.noNull()),
|
||||||
|
)
|
||||||
|
if (!flight.jtz.isNullOrEmpty()) {
|
||||||
|
list.add(KeyValue(flight.jtz.noNull(), flight.jtz.noNull()))
|
||||||
|
}
|
||||||
|
sendAddressList.value = list
|
||||||
|
sendAddress.value = flight.fdep.noNull()
|
||||||
|
} else {
|
||||||
|
fid = ""
|
||||||
|
fdep = ""
|
||||||
|
fdest.value = ""
|
||||||
|
sendAddressList.value = emptyList()
|
||||||
|
sendAddress.value = ""
|
||||||
|
showToast(it.msg.noNull("获取航班信息失败"))
|
||||||
|
}
|
||||||
|
refresh()
|
||||||
|
}
|
||||||
|
onFailed = { _, _ ->
|
||||||
|
fid = ""
|
||||||
|
fdep = ""
|
||||||
|
fdest.value = ""
|
||||||
|
sendAddressList.value = emptyList()
|
||||||
|
sendAddress.value = ""
|
||||||
|
refresh()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
refresh()
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
fid = ""
|
||||||
|
fdep = ""
|
||||||
|
refresh()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -159,10 +225,19 @@ class IntImpManifestViewModel : BasePageViewModel() {
|
|||||||
val shouldExpand = !isAllExpanded.value!!
|
val shouldExpand = !isAllExpanded.value!!
|
||||||
isAllExpanded.value = shouldExpand
|
isAllExpanded.value = shouldExpand
|
||||||
val list = pageModel.rv?.commonAdapter()?.items as? List<GjjManifest> ?: return
|
val list = pageModel.rv?.commonAdapter()?.items as? List<GjjManifest> ?: return
|
||||||
list.forEach {
|
|
||||||
if (!it.haWbList.isNullOrEmpty()) {
|
if (shouldExpand) {
|
||||||
it.showMore.set(shouldExpand)
|
// 展开:对没有分单数据的项按需加载
|
||||||
|
list.forEach { bean ->
|
||||||
|
if (bean.haWbList.isNullOrEmpty()) {
|
||||||
|
loadHaWbList(bean)
|
||||||
|
} else {
|
||||||
|
bean.showMore.set(true)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
// 收起
|
||||||
|
list.forEach { it.showMore.set(false) }
|
||||||
}
|
}
|
||||||
pageModel.rv?.commonAdapter()?.notifyDataSetChanged()
|
pageModel.rv?.commonAdapter()?.notifyDataSetChanged()
|
||||||
}
|
}
|
||||||
@@ -182,51 +257,53 @@ class IntImpManifestViewModel : BasePageViewModel() {
|
|||||||
context = getTopActivity(),
|
context = getTopActivity(),
|
||||||
fid = fid,
|
fid = fid,
|
||||||
dep = sendAddress.value ?: "",
|
dep = sendAddress.value ?: "",
|
||||||
dest = fdep.value ?: ""
|
dest = fdest.value ?: "",
|
||||||
|
flightDate = flightDate.value ?: "",
|
||||||
|
flightNo = flightNo.value ?: ""
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Item点击处理(侧滑按钮)
|
* Item点击处理(侧滑按钮 + 列表项点击)
|
||||||
*/
|
*/
|
||||||
override fun onItemClick(position: Int, type: Int) {
|
override fun onItemClick(position: Int, type: Int) {
|
||||||
val bean = pageModel.rv?.commonAdapter()?.getItem(position) as? GjjManifest ?: return
|
val bean = pageModel.rv?.commonAdapter()?.getItem(position) as? GjjManifest ?: return
|
||||||
|
|
||||||
when (type) {
|
when (type) {
|
||||||
101 -> {
|
101 -> {
|
||||||
// 编辑(传递整个Bean对象)
|
// 编辑(传递整个Bean对象 + 当前筛选的航班日期和航班号)
|
||||||
GjjManifestAddActivity.startForEdit(getTopActivity(), bean)
|
GjjManifestAddActivity.startForEdit(
|
||||||
|
getTopActivity(), bean,
|
||||||
|
flightDate = flightDate.value ?: "",
|
||||||
|
flightNo = flightNo.value ?: ""
|
||||||
|
)
|
||||||
}
|
}
|
||||||
102 -> {
|
102 -> {
|
||||||
// 删除
|
// 删除
|
||||||
deleteManifest(bean)
|
deleteManifest(bean)
|
||||||
}
|
}
|
||||||
|
103 -> {
|
||||||
|
// 展开 - 加载分单数据
|
||||||
|
loadHaWbList(bean)
|
||||||
|
}
|
||||||
|
else -> {
|
||||||
|
// 列表项点击 - 跳转详情页
|
||||||
|
com.lukouguoji.gjj.activity.IntImpManifestDetailsActivity.start(
|
||||||
|
getTopActivity(), bean
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除单个舱单
|
* 删除单个舱单(通过批量删除接口,传单元素数组)
|
||||||
*/
|
*/
|
||||||
private fun deleteManifest(bean: GjjManifest) {
|
private fun deleteManifest(bean: GjjManifest) {
|
||||||
ConfirmDialogModel(
|
ConfirmDialogModel(
|
||||||
message = "确定要删除运单号 ${bean.getWaybillNo()} 的舱单吗?",
|
message = "确定要删除运单号 ${bean.getWaybillNo()} 的舱单吗?",
|
||||||
title = "提示"
|
title = "提示"
|
||||||
) {
|
) {
|
||||||
val params = mapOf("mfId" to bean.mfId).toRequestBody()
|
doDeleteByIds(listOf(bean.mfId))
|
||||||
|
|
||||||
launchLoadingCollect({ NetApply.api.gjjManifestDelete(params) }) {
|
|
||||||
onSuccess = {
|
|
||||||
if (it.verifySuccess()) {
|
|
||||||
showToast("删除成功")
|
|
||||||
viewModelScope.launch {
|
|
||||||
FlowBus.with<String>(ConstantEvent.EVENT_REFRESH).emit("refresh")
|
|
||||||
}
|
|
||||||
refresh()
|
|
||||||
} else {
|
|
||||||
showToast(it.msg.noNull("删除失败"))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}.show()
|
}.show()
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -242,14 +319,105 @@ class IntImpManifestViewModel : BasePageViewModel() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
showToast("删除功能开发中")
|
ConfirmDialogModel(
|
||||||
|
message = "确定要删除选中的 ${selectedItems.size} 条舱单吗?",
|
||||||
|
title = "批量删除确认"
|
||||||
|
) {
|
||||||
|
doDeleteByIds(selectedItems.map { it.mfId })
|
||||||
|
}.show()
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 分单管理(暂不实现)
|
* 执行批量删除(统一接口,请求体为 mfId 数组)
|
||||||
|
*/
|
||||||
|
private fun doDeleteByIds(mfIds: List<Long>) {
|
||||||
|
launchLoadingCollect({ NetApply.api.gjjManifestDeleteBatch(mfIds.toRequestBody()) }) {
|
||||||
|
onSuccess = {
|
||||||
|
if (it.verifySuccess()) {
|
||||||
|
showToast("删除成功")
|
||||||
|
isAllChecked.value = false
|
||||||
|
viewModelScope.launch {
|
||||||
|
FlowBus.with<String>(ConstantEvent.EVENT_REFRESH).emit("refresh")
|
||||||
|
}
|
||||||
|
refresh()
|
||||||
|
} else {
|
||||||
|
showToast(it.msg.noNull("删除失败"))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分单管理按钮点击 - 进入分单管理模式
|
||||||
*/
|
*/
|
||||||
fun subManagementClick() {
|
fun subManagementClick() {
|
||||||
showToast("分单管理功能开发中")
|
isSubManagementMode.value = true
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分单管理模式 - 返回按钮点击
|
||||||
|
*/
|
||||||
|
fun subManagementBackClick() {
|
||||||
|
isSubManagementMode.value = false
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增分单 - 选中一个主单后打开新增页面
|
||||||
|
*/
|
||||||
|
fun addSubWaybillClick() {
|
||||||
|
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 manifest = selectedItems[0]
|
||||||
|
if (manifest.haWbList == null) {
|
||||||
|
// 分单列表未加载,先加载再跳转
|
||||||
|
launchLoadingCollect({ NetApply.api.getIntImpManifestHaWbList(manifest.toRequestBody()) }) {
|
||||||
|
onSuccess = { result ->
|
||||||
|
manifest.haWbList = result.data ?: emptyList()
|
||||||
|
IntImpManifestSubEditActivity.startForAdd(getTopActivity(), manifest)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
IntImpManifestSubEditActivity.startForAdd(getTopActivity(), manifest)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改分单 - 选中一个分单后打开编辑页面
|
||||||
|
*/
|
||||||
|
fun modifySubWaybillClick() {
|
||||||
|
val list = pageModel.rv?.commonAdapter()?.items as? List<GjjManifest> ?: return
|
||||||
|
|
||||||
|
// 收集所有已选中的分单及其所属主单
|
||||||
|
val selectedPairs = mutableListOf<Pair<GjjManifest, com.lukouguoji.module_base.bean.GjjHaWb>>()
|
||||||
|
list.forEach { manifest ->
|
||||||
|
manifest.haWbList?.forEach { haWb ->
|
||||||
|
if (haWb.isSelected) {
|
||||||
|
selectedPairs.add(manifest to haWb)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (selectedPairs.isEmpty()) {
|
||||||
|
showToast("请选择一个分单")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (selectedPairs.size > 1) {
|
||||||
|
showToast("只能选择一个分单")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
val (parentManifest, selectedHaWb) = selectedPairs[0]
|
||||||
|
IntImpManifestSubEditActivity.startForModify(getTopActivity(), parentManifest, selectedHaWb)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -258,30 +426,55 @@ class IntImpManifestViewModel : BasePageViewModel() {
|
|||||||
fun sortingTallyClick() {
|
fun sortingTallyClick() {
|
||||||
com.alibaba.android.arouter.launcher.ARouter.getInstance()
|
com.alibaba.android.arouter.launcher.ARouter.getInstance()
|
||||||
.build(com.lukouguoji.module_base.router.ARouterConstants.ACTIVITY_URL_INT_IMP_LOADING_LIST)
|
.build(com.lukouguoji.module_base.router.ARouterConstants.ACTIVITY_URL_INT_IMP_LOADING_LIST)
|
||||||
|
.withString("fid", fid)
|
||||||
|
.withString("fdep", fdep)
|
||||||
.withString("fdate", flightDate.value ?: "")
|
.withString("fdate", flightDate.value ?: "")
|
||||||
.withString("fno", flightNo.value ?: "")
|
.withString("fno", flightNo.value ?: "")
|
||||||
.withString("sendAddress", sendAddress.value ?: "")
|
.withString("fdest", fdest.value ?: "")
|
||||||
.withString("fdest", fdep.value ?: "")
|
|
||||||
.navigation()
|
.navigation()
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 货物发放(暂不实现)
|
* 货物发放
|
||||||
*/
|
*/
|
||||||
fun cargoReleaseClick() {
|
fun cargoReleaseClick() {
|
||||||
showToast("货物发放功能开发中")
|
val list = pageModel.rv?.commonAdapter()?.items as? List<GjjManifest> ?: return
|
||||||
|
val selectedItems = list.filter { it.isSelected }
|
||||||
|
|
||||||
|
if (selectedItems.isEmpty()) {
|
||||||
|
showToast("请选择要发放的运单")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
IntImpModifyStorageDialogModel { dialog ->
|
||||||
|
val params = mapOf(
|
||||||
|
"location" to dialog.locationName,
|
||||||
|
"locationId" to dialog.locationId.toLongOrNull(),
|
||||||
|
"manifestList" to selectedItems
|
||||||
|
).toRequestBody()
|
||||||
|
|
||||||
|
launchLoadingCollect({ NetApply.api.intImpManifestPutUpCargo(params) }) {
|
||||||
|
onSuccess = {
|
||||||
|
if (it.verifySuccess()) {
|
||||||
|
showToast(it.msg.noNull("货物发放成功"))
|
||||||
|
refresh()
|
||||||
|
} else {
|
||||||
|
showToast(it.msg.noNull("货物发放失败"))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}.show()
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取数据(重写BasePageViewModel)
|
* 获取数据(重写BasePageViewModel)
|
||||||
|
* 通过FID查询列表,而不是直接通过航班号和航班日期
|
||||||
*/
|
*/
|
||||||
override fun getData() {
|
override fun getData() {
|
||||||
// 构建搜索条件
|
// 构建搜索条件(使用FID代替fdate/fno)
|
||||||
val filterParams = mapOf(
|
val filterParams = mapOf(
|
||||||
"fdate" to flightDate.value?.ifEmpty { null },
|
"fid" to fid.ifEmpty { null },
|
||||||
"fno" to flightNo.value?.ifEmpty { null },
|
"fdep" to fdep.ifEmpty { null },
|
||||||
"sendAddress" to sendAddress.value?.ifEmpty { null },
|
|
||||||
"fdep" to fdep.value?.ifEmpty { null },
|
|
||||||
"wbNo" to waybillNo.value?.ifEmpty { null }
|
"wbNo" to waybillNo.value?.ifEmpty { null }
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -297,15 +490,7 @@ class IntImpManifestViewModel : BasePageViewModel() {
|
|||||||
// 获取列表(带Loading)
|
// 获取列表(带Loading)
|
||||||
launchLoadingCollect({ NetApply.api.getIntImpManifestList(listParams) }) {
|
launchLoadingCollect({ NetApply.api.getIntImpManifestList(listParams) }) {
|
||||||
onSuccess = { result ->
|
onSuccess = { result ->
|
||||||
pageModel.handleListBean(result.data?.toBaseListBean())
|
pageModel.handleListBean(result.toBaseListBean())
|
||||||
|
|
||||||
// 列表加载完成后,加载分单数据
|
|
||||||
val items = pageModel.rv?.commonAdapter()?.items as? List<GjjManifest>
|
|
||||||
items?.forEach { bean ->
|
|
||||||
if (bean.haWbNum > 0) {
|
|
||||||
loadHaWbList(bean)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -321,19 +506,16 @@ class IntImpManifestViewModel : BasePageViewModel() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 加载主单下的分单列表
|
* 加载主单下的分单列表(按需加载,加载完成后自动展开)
|
||||||
*/
|
*/
|
||||||
private fun loadHaWbList(bean: GjjManifest) {
|
private fun loadHaWbList(bean: GjjManifest) {
|
||||||
val params = mapOf(
|
val params = bean.toRequestBody()
|
||||||
"mfId" to bean.mfId
|
|
||||||
).toRequestBody()
|
|
||||||
|
|
||||||
launchCollect({ NetApply.api.getIntImpManifestHaWbList(params) }) {
|
launchLoadingCollect({ NetApply.api.getIntImpManifestHaWbList(params) }) {
|
||||||
onSuccess = { result ->
|
onSuccess = { result ->
|
||||||
if (result.verifySuccess() && !result.data.isNullOrEmpty()) {
|
bean.haWbList = result.data ?: emptyList()
|
||||||
bean.haWbList = result.data
|
bean.showMore.set(true)
|
||||||
pageModel.rv?.commonAdapter()?.notifyDataSetChanged()
|
pageModel.rv?.commonAdapter()?.notifyDataSetChanged()
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,133 @@
|
|||||||
|
package com.lukouguoji.gjj.viewModel
|
||||||
|
|
||||||
|
import android.content.Intent
|
||||||
|
import androidx.lifecycle.MutableLiveData
|
||||||
|
import androidx.lifecycle.Observer
|
||||||
|
import androidx.lifecycle.viewModelScope
|
||||||
|
import com.google.gson.Gson
|
||||||
|
import com.lukouguoji.module_base.base.BaseViewModel
|
||||||
|
import com.lukouguoji.module_base.bean.IntImpPickUpRecordBean
|
||||||
|
import com.lukouguoji.module_base.common.Constant
|
||||||
|
import com.lukouguoji.module_base.common.ConstantEvent
|
||||||
|
import com.lukouguoji.module_base.http.net.NetApply
|
||||||
|
import com.lukouguoji.module_base.impl.FlowBus
|
||||||
|
import com.lukouguoji.module_base.ktx.launchLoadingCollect
|
||||||
|
import com.lukouguoji.module_base.ktx.showToast
|
||||||
|
import com.lukouguoji.module_base.ktx.toRequestBody
|
||||||
|
import kotlinx.coroutines.launch
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 国际进港费用修改 ViewModel
|
||||||
|
*/
|
||||||
|
class IntImpPickUpChargeEditViewModel : BaseViewModel() {
|
||||||
|
|
||||||
|
val dataBean = MutableLiveData(IntImpPickUpRecordBean())
|
||||||
|
|
||||||
|
// 可编辑费用字段(String 用于双向绑定)
|
||||||
|
val tranChargeStr = MutableLiveData("") // 信息费
|
||||||
|
val whsChargeStr = MutableLiveData("") // 仓储费
|
||||||
|
val drawBillChargeStr = MutableLiveData("") // 文件处理费
|
||||||
|
val svlChargeStr = MutableLiveData("") // 叉车费
|
||||||
|
val tallyChargeStr = MutableLiveData("") // 理货费
|
||||||
|
val pipFeeStr = MutableLiveData("") // 精密仪器处理费
|
||||||
|
val lapFeeStr = MutableLiveData("") // 活体动物处理费
|
||||||
|
val totalAmountStr = MutableLiveData("") // 总费用(实时计算)
|
||||||
|
|
||||||
|
// 总费用计算观察者
|
||||||
|
private val totalCalculator = Observer<String> { calculateTotal() }
|
||||||
|
|
||||||
|
private fun calculateTotal() {
|
||||||
|
val total = (tranChargeStr.value?.toDoubleOrNull() ?: 0.0) +
|
||||||
|
(whsChargeStr.value?.toDoubleOrNull() ?: 0.0) +
|
||||||
|
(drawBillChargeStr.value?.toDoubleOrNull() ?: 0.0) +
|
||||||
|
(svlChargeStr.value?.toDoubleOrNull() ?: 0.0) +
|
||||||
|
(tallyChargeStr.value?.toDoubleOrNull() ?: 0.0) +
|
||||||
|
(dataBean.value?.optCharge ?: 0.0) +
|
||||||
|
(pipFeeStr.value?.toDoubleOrNull() ?: 0.0) +
|
||||||
|
(lapFeeStr.value?.toDoubleOrNull() ?: 0.0)
|
||||||
|
totalAmountStr.value = if (total != 0.0) total.toString() else ""
|
||||||
|
}
|
||||||
|
|
||||||
|
fun initOnCreated(intent: Intent) {
|
||||||
|
val jsonData = intent.getStringExtra(Constant.Key.DATA) ?: ""
|
||||||
|
if (jsonData.isNotEmpty()) {
|
||||||
|
try {
|
||||||
|
val bean = Gson().fromJson(jsonData, IntImpPickUpRecordBean::class.java)
|
||||||
|
dataBean.value = bean
|
||||||
|
// 初始化可编辑费用字段
|
||||||
|
tranChargeStr.value = if (bean.tranCharge != 0.0) bean.tranCharge.toString() else ""
|
||||||
|
whsChargeStr.value = if (bean.whsCharge != 0.0) bean.whsCharge.toString() else ""
|
||||||
|
drawBillChargeStr.value = if (bean.drawBillCharge != 0.0) bean.drawBillCharge.toString() else ""
|
||||||
|
svlChargeStr.value = if (bean.svlCharge != 0.0) bean.svlCharge.toString() else ""
|
||||||
|
tallyChargeStr.value = if (bean.tallyCharge != 0.0) bean.tallyCharge.toString() else ""
|
||||||
|
pipFeeStr.value = if (bean.pipFee != 0.0) bean.pipFee.toString() else ""
|
||||||
|
lapFeeStr.value = if (bean.lapFee != 0.0) bean.lapFee.toString() else ""
|
||||||
|
|
||||||
|
// 注册总费用实时计算
|
||||||
|
tranChargeStr.observeForever(totalCalculator)
|
||||||
|
whsChargeStr.observeForever(totalCalculator)
|
||||||
|
drawBillChargeStr.observeForever(totalCalculator)
|
||||||
|
svlChargeStr.observeForever(totalCalculator)
|
||||||
|
tallyChargeStr.observeForever(totalCalculator)
|
||||||
|
pipFeeStr.observeForever(totalCalculator)
|
||||||
|
lapFeeStr.observeForever(totalCalculator)
|
||||||
|
|
||||||
|
// 初始计算一次
|
||||||
|
calculateTotal()
|
||||||
|
} catch (e: Exception) {
|
||||||
|
showToast("数据解析失败")
|
||||||
|
getTopActivity().finish()
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
showToast("未接收到数据")
|
||||||
|
getTopActivity().finish()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存修改
|
||||||
|
*/
|
||||||
|
fun submit() {
|
||||||
|
val bean = dataBean.value ?: return
|
||||||
|
|
||||||
|
// 同步可编辑费用字段回 bean
|
||||||
|
bean.tranCharge = tranChargeStr.value?.toDoubleOrNull() ?: 0.0
|
||||||
|
bean.whsCharge = whsChargeStr.value?.toDoubleOrNull() ?: 0.0
|
||||||
|
bean.drawBillCharge = drawBillChargeStr.value?.toDoubleOrNull() ?: 0.0
|
||||||
|
bean.svlCharge = svlChargeStr.value?.toDoubleOrNull() ?: 0.0
|
||||||
|
bean.tallyCharge = tallyChargeStr.value?.toDoubleOrNull() ?: 0.0
|
||||||
|
bean.pipFee = pipFeeStr.value?.toDoubleOrNull() ?: 0.0
|
||||||
|
bean.lapFee = lapFeeStr.value?.toDoubleOrNull() ?: 0.0
|
||||||
|
bean.amount = totalAmountStr.value?.toDoubleOrNull() ?: 0.0
|
||||||
|
|
||||||
|
launchLoadingCollect({
|
||||||
|
NetApply.api.modifyIntImpPickUpCharge(bean.toRequestBody())
|
||||||
|
}) {
|
||||||
|
onSuccess = {
|
||||||
|
showToast("修改成功")
|
||||||
|
viewModelScope.launch {
|
||||||
|
FlowBus.with<String>(ConstantEvent.EVENT_REFRESH).emit("refresh")
|
||||||
|
}
|
||||||
|
getTopActivity().finish()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 取消
|
||||||
|
*/
|
||||||
|
fun cancel() {
|
||||||
|
getTopActivity().finish()
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onCleared() {
|
||||||
|
super.onCleared()
|
||||||
|
tranChargeStr.removeObserver(totalCalculator)
|
||||||
|
whsChargeStr.removeObserver(totalCalculator)
|
||||||
|
drawBillChargeStr.removeObserver(totalCalculator)
|
||||||
|
svlChargeStr.removeObserver(totalCalculator)
|
||||||
|
tallyChargeStr.removeObserver(totalCalculator)
|
||||||
|
pipFeeStr.removeObserver(totalCalculator)
|
||||||
|
lapFeeStr.removeObserver(totalCalculator)
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -16,9 +16,12 @@ import com.lukouguoji.module_base.ktx.commonAdapter
|
|||||||
import com.lukouguoji.module_base.ktx.launchCollect
|
import com.lukouguoji.module_base.ktx.launchCollect
|
||||||
import com.lukouguoji.module_base.ktx.launchLoadingCollect
|
import com.lukouguoji.module_base.ktx.launchLoadingCollect
|
||||||
import com.lukouguoji.module_base.ktx.showToast
|
import com.lukouguoji.module_base.ktx.showToast
|
||||||
|
import com.lukouguoji.module_base.ktx.formatDate
|
||||||
import com.lukouguoji.module_base.ktx.toRequestBody
|
import com.lukouguoji.module_base.ktx.toRequestBody
|
||||||
|
import com.lukouguoji.module_base.model.ConfirmDialogModel
|
||||||
import com.lukouguoji.module_base.model.ScanModel
|
import com.lukouguoji.module_base.model.ScanModel
|
||||||
import dev.utils.app.info.KeyValue
|
import dev.utils.app.info.KeyValue
|
||||||
|
import dev.utils.common.DateUtils
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -27,7 +30,7 @@ import kotlinx.coroutines.launch
|
|||||||
class IntImpPickUpDLVViewModel : BasePageViewModel() {
|
class IntImpPickUpDLVViewModel : BasePageViewModel() {
|
||||||
|
|
||||||
// ========== 搜索条件 ==========
|
// ========== 搜索条件 ==========
|
||||||
val paymentDateStart = MutableLiveData("") // 缴费日期起
|
val paymentDateStart = MutableLiveData(DateUtils.getCurrentTime().formatDate()) // 缴费日期起
|
||||||
val paymentDateEnd = MutableLiveData("") // 缴费日期止
|
val paymentDateEnd = MutableLiveData("") // 缴费日期止
|
||||||
val agentCode = MutableLiveData("") // 代理人
|
val agentCode = MutableLiveData("") // 代理人
|
||||||
val wbNo = MutableLiveData("") // 运单号
|
val wbNo = MutableLiveData("") // 运单号
|
||||||
@@ -116,15 +119,20 @@ class IntImpPickUpDLVViewModel : BasePageViewModel() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
launchLoadingCollect({ NetApply.api.confirmIntImpPickUpDLV(selectedItems.toRequestBody()) }) {
|
ConfirmDialogModel(
|
||||||
onSuccess = {
|
message = "确定要将选中的${selectedItems.size}条记录确认出库吗?",
|
||||||
showToast("确认出库成功")
|
title = "确认出库"
|
||||||
viewModelScope.launch {
|
) {
|
||||||
FlowBus.with<String>(ConstantEvent.EVENT_REFRESH).emit("refresh")
|
launchLoadingCollect({ NetApply.api.confirmIntImpPickUpDLV(selectedItems.toRequestBody()) }) {
|
||||||
|
onSuccess = {
|
||||||
|
showToast("确认出库成功")
|
||||||
|
viewModelScope.launch {
|
||||||
|
FlowBus.with<String>(ConstantEvent.EVENT_REFRESH).emit("refresh")
|
||||||
|
}
|
||||||
|
refresh()
|
||||||
}
|
}
|
||||||
refresh()
|
|
||||||
}
|
}
|
||||||
}
|
}.show()
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -2,41 +2,26 @@ package com.lukouguoji.gjj.viewModel
|
|||||||
|
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import androidx.lifecycle.MutableLiveData
|
import androidx.lifecycle.MutableLiveData
|
||||||
|
import com.google.gson.Gson
|
||||||
import com.lukouguoji.module_base.base.BaseViewModel
|
import com.lukouguoji.module_base.base.BaseViewModel
|
||||||
import com.lukouguoji.module_base.bean.IntImpPickUpRecordBean
|
import com.lukouguoji.module_base.bean.IntImpPickUpRecordBean
|
||||||
import com.lukouguoji.module_base.common.Constant
|
import com.lukouguoji.module_base.common.Constant
|
||||||
import com.lukouguoji.module_base.http.net.NetApply
|
|
||||||
import com.lukouguoji.module_base.ktx.launchLoadingCollect
|
|
||||||
import com.lukouguoji.module_base.ktx.showToast
|
import com.lukouguoji.module_base.ktx.showToast
|
||||||
import com.lukouguoji.module_base.ktx.toRequestBody
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 国际进港提取详情 ViewModel
|
* 国际进港提取详情 ViewModel
|
||||||
*/
|
*/
|
||||||
class IntImpPickUpRecordDetailsViewModel : BaseViewModel() {
|
class IntImpPickUpRecordDetailsViewModel : BaseViewModel() {
|
||||||
|
|
||||||
var recordId: Long = 0
|
|
||||||
|
|
||||||
val dataBean = MutableLiveData(IntImpPickUpRecordBean())
|
val dataBean = MutableLiveData(IntImpPickUpRecordBean())
|
||||||
|
|
||||||
fun initOnCreated(intent: Intent) {
|
fun initOnCreated(intent: Intent) {
|
||||||
recordId = intent.getLongExtra(Constant.Key.ID, 0)
|
val json = intent.getStringExtra(Constant.Key.DATA) ?: ""
|
||||||
if (recordId > 0) {
|
if (json.isNotEmpty()) {
|
||||||
getData()
|
dataBean.value = Gson().fromJson(json, IntImpPickUpRecordBean::class.java)
|
||||||
} else {
|
} else {
|
||||||
showToast("参数错误")
|
showToast("参数错误")
|
||||||
getTopActivity().finish()
|
getTopActivity().finish()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun getData() {
|
|
||||||
val params = mapOf("id" to recordId).toRequestBody()
|
|
||||||
launchLoadingCollect({
|
|
||||||
NetApply.api.getIntImpPickUpRecordDetails(params)
|
|
||||||
}) {
|
|
||||||
onSuccess = {
|
|
||||||
dataBean.value = it.data ?: IntImpPickUpRecordBean()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,8 +18,10 @@ import com.lukouguoji.module_base.ktx.launchLoadingCollect
|
|||||||
import com.lukouguoji.module_base.ktx.noNull
|
import com.lukouguoji.module_base.ktx.noNull
|
||||||
import com.lukouguoji.module_base.ktx.showToast
|
import com.lukouguoji.module_base.ktx.showToast
|
||||||
import com.lukouguoji.module_base.ktx.toRequestBody
|
import com.lukouguoji.module_base.ktx.toRequestBody
|
||||||
|
import com.lukouguoji.module_base.ktx.formatDate
|
||||||
import com.lukouguoji.module_base.model.ScanModel
|
import com.lukouguoji.module_base.model.ScanModel
|
||||||
import com.lukouguoji.module_base.util.DictUtils
|
import com.lukouguoji.module_base.util.DictUtils
|
||||||
|
import dev.utils.common.DateUtils
|
||||||
import dev.utils.app.info.KeyValue
|
import dev.utils.app.info.KeyValue
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
|
|
||||||
@@ -29,7 +31,7 @@ import kotlinx.coroutines.launch
|
|||||||
class IntImpPickUpRecordViewModel : BasePageViewModel() {
|
class IntImpPickUpRecordViewModel : BasePageViewModel() {
|
||||||
|
|
||||||
// ========== 筛选条件 ==========
|
// ========== 筛选条件 ==========
|
||||||
val paymentDateStart = MutableLiveData("") // 缴费日期起
|
val paymentDateStart = MutableLiveData(DateUtils.getCurrentTime().formatDate()) // 缴费日期起
|
||||||
val paymentDateEnd = MutableLiveData("") // 缴费日期止
|
val paymentDateEnd = MutableLiveData("") // 缴费日期止
|
||||||
val agentCode = MutableLiveData("") // 代理人
|
val agentCode = MutableLiveData("") // 代理人
|
||||||
val spCode = MutableLiveData("") // 特码
|
val spCode = MutableLiveData("") // 特码
|
||||||
@@ -81,7 +83,7 @@ class IntImpPickUpRecordViewModel : BasePageViewModel() {
|
|||||||
fun initSpecialCodeList() {
|
fun initSpecialCodeList() {
|
||||||
DictUtils.getSpecialCodeList(
|
DictUtils.getSpecialCodeList(
|
||||||
flag = 1, // 国际
|
flag = 1, // 国际
|
||||||
ieFlag = "I", // 进港
|
ieFlag = "",
|
||||||
parentcode = ""
|
parentcode = ""
|
||||||
) {
|
) {
|
||||||
spCodeList.value = it
|
spCodeList.value = it
|
||||||
@@ -144,16 +146,16 @@ class IntImpPickUpRecordViewModel : BasePageViewModel() {
|
|||||||
*/
|
*/
|
||||||
override fun getData() {
|
override fun getData() {
|
||||||
val filterParams = mapOf(
|
val filterParams = mapOf(
|
||||||
"paymentDateStart" to paymentDateStart.value?.ifEmpty { null },
|
"beginDate" to paymentDateStart.value?.ifEmpty { null },
|
||||||
"paymentDateEnd" to paymentDateEnd.value?.ifEmpty { null },
|
"endDate" to paymentDateEnd.value?.ifEmpty { null },
|
||||||
"agentCode" to agentCode.value?.ifEmpty { null },
|
"agentCode" to agentCode.value?.ifEmpty { null },
|
||||||
"spCode" to spCode.value?.ifEmpty { null },
|
"spCode" to spCode.value?.ifEmpty { null },
|
||||||
"wbNo" to wbNo.value?.ifEmpty { null }
|
"wbNo" to wbNo.value?.ifEmpty { null }
|
||||||
)
|
)
|
||||||
|
|
||||||
val listParams = (filterParams + mapOf(
|
val listParams = (filterParams + mapOf(
|
||||||
"pageNum" to pageModel.page,
|
"page" to pageModel.page,
|
||||||
"pageSize" to pageModel.limit
|
"limit" to pageModel.limit
|
||||||
)).toRequestBody()
|
)).toRequestBody()
|
||||||
|
|
||||||
val totalParams = filterParams.toRequestBody()
|
val totalParams = filterParams.toRequestBody()
|
||||||
|
|||||||
@@ -0,0 +1,124 @@
|
|||||||
|
package com.lukouguoji.gjj.viewModel
|
||||||
|
|
||||||
|
import android.content.Intent
|
||||||
|
import androidx.lifecycle.MutableLiveData
|
||||||
|
import com.lukouguoji.gjj.fragment.IntImpQueryStorageFragment
|
||||||
|
import com.lukouguoji.gjj.fragment.IntImpQueryWarehouseFragment
|
||||||
|
import com.lukouguoji.gjj.fragment.IntImpQueryWaybillFragment
|
||||||
|
import com.lukouguoji.module_base.base.BaseViewModel
|
||||||
|
import com.lukouguoji.module_base.http.net.NetApply
|
||||||
|
import com.lukouguoji.module_base.ktx.launchLoadingCollect
|
||||||
|
import com.lukouguoji.module_base.ktx.showToast
|
||||||
|
import com.lukouguoji.module_base.ktx.toRequestBody
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 国际进港查询详情-ViewModel
|
||||||
|
*/
|
||||||
|
class IntImpQueryDetailsViewModel : BaseViewModel() {
|
||||||
|
|
||||||
|
// ==================== 基础数据 ====================
|
||||||
|
var prefix: String = "" // 运单号前缀
|
||||||
|
var no: String = "" // 运单号主体
|
||||||
|
|
||||||
|
// ==================== Tab管理 ====================
|
||||||
|
val currentTab = MutableLiveData(0) // 当前Tab索引 (0/1/2)
|
||||||
|
|
||||||
|
// ==================== 详情数据 ====================
|
||||||
|
val detailData = MutableLiveData<Map<String, Any>>(emptyMap())
|
||||||
|
|
||||||
|
// 运单信息 (maWb)
|
||||||
|
val maWbData = MutableLiveData<Map<String, Any>>(emptyMap())
|
||||||
|
|
||||||
|
// 仓库列表 (warehouseList)
|
||||||
|
val warehouseList = MutableLiveData<List<Map<String, Any>>>(emptyList())
|
||||||
|
|
||||||
|
// 库位列表 (storageUseList)
|
||||||
|
val storageUseList = MutableLiveData<List<Map<String, Any>>>(emptyList())
|
||||||
|
|
||||||
|
// ==================== Fragment列表 ====================
|
||||||
|
val fragmentList by lazy {
|
||||||
|
listOf(
|
||||||
|
IntImpQueryWaybillFragment.newInstance(this), // 运单信息
|
||||||
|
IntImpQueryWarehouseFragment.newInstance(this), // 仓库信息
|
||||||
|
IntImpQueryStorageFragment.newInstance(this) // 库位信息
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
// ==================== 方法区 ====================
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 初始化(从Intent获取maWbId)
|
||||||
|
*/
|
||||||
|
fun initOnCreated(intent: Intent) {
|
||||||
|
prefix = intent.getStringExtra("prefix") ?: ""
|
||||||
|
no = intent.getStringExtra("no") ?: ""
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Tab点击事件
|
||||||
|
*/
|
||||||
|
fun onTabClick(index: Int) {
|
||||||
|
currentTab.value = index
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 加载详情数据
|
||||||
|
*/
|
||||||
|
fun loadDetails() {
|
||||||
|
if (prefix.isEmpty() || no.isEmpty()) {
|
||||||
|
showToast("运单号参数为空")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
val params = mapOf("prefix" to prefix, "no" to no).toRequestBody()
|
||||||
|
|
||||||
|
launchLoadingCollect({ NetApply.api.getIntImpQueryDetails(params) }) {
|
||||||
|
onSuccess = { result ->
|
||||||
|
val data = result.data ?: emptyMap()
|
||||||
|
detailData.value = data
|
||||||
|
|
||||||
|
// 解析 maWb 对象
|
||||||
|
@Suppress("UNCHECKED_CAST")
|
||||||
|
val maWb = data["maWb"] as? Map<String, Any> ?: emptyMap()
|
||||||
|
|
||||||
|
// 合并数据并添加组合字段
|
||||||
|
val mergedData = mutableMapOf<String, Any>()
|
||||||
|
mergedData.putAll(maWb)
|
||||||
|
|
||||||
|
// 添加组合字段: wbNo = prefix + no
|
||||||
|
val prefix = maWb["prefix"] as? String ?: ""
|
||||||
|
val no = maWb["no"] as? String ?: ""
|
||||||
|
if (prefix.isNotEmpty() || no.isNotEmpty()) {
|
||||||
|
mergedData["wbNo"] = "$prefix$no"
|
||||||
|
}
|
||||||
|
|
||||||
|
// 锁定状态转中文
|
||||||
|
val lockState = maWb["lockState"]
|
||||||
|
if (lockState != null) {
|
||||||
|
val lockStateInt = when (lockState) {
|
||||||
|
is Double -> lockState.toInt()
|
||||||
|
is Int -> lockState
|
||||||
|
else -> null
|
||||||
|
}
|
||||||
|
mergedData["lockStateText"] = when (lockStateInt) {
|
||||||
|
0 -> "未锁定"
|
||||||
|
1 -> "已锁定"
|
||||||
|
else -> ""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
maWbData.value = mergedData
|
||||||
|
|
||||||
|
// 解析 warehouseList 列表
|
||||||
|
@Suppress("UNCHECKED_CAST")
|
||||||
|
val whList = data["warehouseList"] as? List<Map<String, Any>> ?: emptyList()
|
||||||
|
warehouseList.value = whList
|
||||||
|
|
||||||
|
// 解析 storageUseList 列表
|
||||||
|
@Suppress("UNCHECKED_CAST")
|
||||||
|
val suList = data["storageUseList"] as? List<Map<String, Any>> ?: emptyList()
|
||||||
|
storageUseList.value = suList
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,362 @@
|
|||||||
|
package com.lukouguoji.gjj.viewModel
|
||||||
|
|
||||||
|
import android.content.Intent
|
||||||
|
import androidx.lifecycle.MutableLiveData
|
||||||
|
import androidx.lifecycle.viewModelScope
|
||||||
|
import com.google.gson.Gson
|
||||||
|
import com.lukouguoji.module_base.base.BaseViewModel
|
||||||
|
import com.lukouguoji.module_base.bean.IntImpQueryEditBean
|
||||||
|
import com.lukouguoji.module_base.common.ConstantEvent
|
||||||
|
import com.lukouguoji.module_base.http.net.NetApply
|
||||||
|
import com.lukouguoji.module_base.impl.FlowBus
|
||||||
|
import com.lukouguoji.module_base.ktx.launchCollect
|
||||||
|
import com.lukouguoji.module_base.ktx.launchLoadingCollect
|
||||||
|
import com.lukouguoji.module_base.ktx.showToast
|
||||||
|
import com.lukouguoji.module_base.ktx.toRequestBody
|
||||||
|
import com.lukouguoji.module_base.util.DictUtils
|
||||||
|
import dev.utils.app.info.KeyValue
|
||||||
|
import kotlinx.coroutines.launch
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 国际进港运单修改 ViewModel
|
||||||
|
*/
|
||||||
|
class IntImpQueryEditViewModel : BaseViewModel() {
|
||||||
|
|
||||||
|
// 数据Bean
|
||||||
|
val dataBean = MutableLiveData(IntImpQueryEditBean())
|
||||||
|
|
||||||
|
// 运单标识
|
||||||
|
var maWbId: Long = 0
|
||||||
|
var prefix: String = ""
|
||||||
|
var no: String = ""
|
||||||
|
|
||||||
|
// ==================== 下拉列表 ====================
|
||||||
|
val agentList = MutableLiveData<List<KeyValue>>(emptyList())
|
||||||
|
val spCodeList = MutableLiveData<List<KeyValue>>(emptyList())
|
||||||
|
val packageTypeList = MutableLiveData<List<KeyValue>>(emptyList())
|
||||||
|
val waybillTypeList = MutableLiveData<List<KeyValue>>(emptyList())
|
||||||
|
val lockStateList = MutableLiveData(
|
||||||
|
listOf(
|
||||||
|
KeyValue("未锁", "0"),
|
||||||
|
KeyValue("锁定", "1")
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 初始化数据
|
||||||
|
*/
|
||||||
|
fun initOnCreated(intent: Intent) {
|
||||||
|
maWbId = intent.getLongExtra("maWbId", 0L)
|
||||||
|
prefix = intent.getStringExtra("prefix") ?: ""
|
||||||
|
no = intent.getStringExtra("no") ?: ""
|
||||||
|
|
||||||
|
if (prefix.isEmpty() || no.isEmpty()) {
|
||||||
|
showToast("运单号参数为空")
|
||||||
|
getTopActivity().finish()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// 加载下拉列表
|
||||||
|
loadAgentList()
|
||||||
|
loadSpCodeList()
|
||||||
|
loadPackageTypeList()
|
||||||
|
loadWaybillTypeList()
|
||||||
|
|
||||||
|
// 加载详情
|
||||||
|
loadDetails()
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 加载代理人下拉列表
|
||||||
|
*/
|
||||||
|
private fun loadAgentList() {
|
||||||
|
launchCollect({ NetApply.api.getIntImpAgentList() }) {
|
||||||
|
onSuccess = { result ->
|
||||||
|
val list = result.data?.mapNotNull { bean ->
|
||||||
|
if (bean.name != null && bean.code != null) {
|
||||||
|
KeyValue(bean.name, bean.code)
|
||||||
|
} else null
|
||||||
|
} ?: emptyList()
|
||||||
|
agentList.value = list
|
||||||
|
// 详情已加载时匹配代理人
|
||||||
|
matchAgent()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 加载特码下拉列表
|
||||||
|
* flag=1(国际), ieFlag=I(进港)
|
||||||
|
*/
|
||||||
|
private fun loadSpCodeList() {
|
||||||
|
launchCollect({ NetApply.api.getSpecialCodeList(1, "", "") }) {
|
||||||
|
onSuccess = { result ->
|
||||||
|
val list = result.data?.mapNotNull { bean ->
|
||||||
|
if (bean.name != null && bean.code != null) {
|
||||||
|
KeyValue(bean.name, bean.code)
|
||||||
|
} else null
|
||||||
|
} ?: emptyList()
|
||||||
|
spCodeList.value = list
|
||||||
|
matchSpCode()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 加载包装类型下拉列表(收运包装类型)
|
||||||
|
*/
|
||||||
|
private fun loadPackageTypeList() {
|
||||||
|
DictUtils.getShouYunPackageTypeList(checkedValue = dataBean.value?.packageType) {
|
||||||
|
packageTypeList.postValue(it)
|
||||||
|
matchPackageType()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 加载运单类型下拉列表
|
||||||
|
* type=II(国际进港)
|
||||||
|
*/
|
||||||
|
private fun loadWaybillTypeList() {
|
||||||
|
launchCollect({ NetApply.api.getWaybillTypeList("II") }) {
|
||||||
|
onSuccess = { result ->
|
||||||
|
val list = result.data?.mapNotNull { bean ->
|
||||||
|
if (bean.name != null && bean.code != null) {
|
||||||
|
KeyValue(bean.name, bean.code)
|
||||||
|
} else null
|
||||||
|
} ?: emptyList()
|
||||||
|
waybillTypeList.value = list
|
||||||
|
matchWaybillType()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 加载运单详情数据
|
||||||
|
*/
|
||||||
|
private fun loadDetails() {
|
||||||
|
val params = mapOf("prefix" to prefix, "no" to no).toRequestBody()
|
||||||
|
|
||||||
|
launchLoadingCollect({ NetApply.api.getIntImpQueryDetails(params) }) {
|
||||||
|
onSuccess = { result ->
|
||||||
|
val data = result.data ?: emptyMap()
|
||||||
|
|
||||||
|
// 提取 maWb 对象
|
||||||
|
val maWb = data["maWb"] as? Map<String, Any> ?: emptyMap()
|
||||||
|
// 提取 maWbM 对象
|
||||||
|
val maWbM = data["maWbM"] as? Map<String, Any> ?: emptyMap()
|
||||||
|
// 提取 warehouseList(用于计算入库件数和入库重量)
|
||||||
|
val warehouseList = data["warehouseList"] as? List<Map<String, Any>> ?: emptyList()
|
||||||
|
|
||||||
|
// 合并数据
|
||||||
|
val mergedData = mutableMapOf<String, Any>()
|
||||||
|
mergedData.putAll(maWb)
|
||||||
|
mergedData.putAll(maWbM)
|
||||||
|
|
||||||
|
// 运单号: 组合 prefix + no
|
||||||
|
val prefix = maWb["prefix"] as? String ?: ""
|
||||||
|
val no = maWb["no"] as? String ?: ""
|
||||||
|
if (prefix.isNotEmpty() && no.isNotEmpty()) {
|
||||||
|
mergedData["wbNo"] = "$prefix$no"
|
||||||
|
}
|
||||||
|
|
||||||
|
// 代理人名称
|
||||||
|
if (!mergedData.containsKey("agentName") || (mergedData["agentName"] as? String).isNullOrEmpty()) {
|
||||||
|
maWb["agentCode"]?.let { mergedData["agentName"] = it }
|
||||||
|
}
|
||||||
|
|
||||||
|
// 运单件数/重量映射
|
||||||
|
val pc = maWb["pc"]
|
||||||
|
when (pc) {
|
||||||
|
is Number -> mergedData["awbPc"] = pc.toLong()
|
||||||
|
is String -> mergedData["awbPc"] = pc.toLongOrNull() ?: 0L
|
||||||
|
}
|
||||||
|
val weight = maWb["weight"]
|
||||||
|
when (weight) {
|
||||||
|
is Number -> mergedData["awbWeight"] = weight.toDouble()
|
||||||
|
is String -> mergedData["awbWeight"] = weight.toDoubleOrNull() ?: 0.0
|
||||||
|
}
|
||||||
|
|
||||||
|
// 入库件数和入库重量: 从 warehouseList 计算总和
|
||||||
|
if (warehouseList.isNotEmpty()) {
|
||||||
|
var totalPc = 0L
|
||||||
|
var totalWeight = 0.0
|
||||||
|
warehouseList.forEach { warehouse ->
|
||||||
|
val wPc = warehouse["pc"]
|
||||||
|
when (wPc) {
|
||||||
|
is Number -> totalPc += wPc.toLong()
|
||||||
|
is String -> totalPc += wPc.toLongOrNull() ?: 0L
|
||||||
|
}
|
||||||
|
val wWeight = warehouse["weight"]
|
||||||
|
when (wWeight) {
|
||||||
|
is Number -> totalWeight += wWeight.toDouble()
|
||||||
|
is String -> totalWeight += wWeight.toDoubleOrNull() ?: 0.0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
mergedData["inPc"] = totalPc
|
||||||
|
mergedData["inWeight"] = totalWeight
|
||||||
|
}
|
||||||
|
|
||||||
|
// lockState 转换为 String(SPINNER 绑定用)
|
||||||
|
val lockState = mergedData["lockState"]
|
||||||
|
when (lockState) {
|
||||||
|
is Number -> mergedData["lockState"] = lockState.toInt().toString()
|
||||||
|
is String -> mergedData["lockState"] = lockState
|
||||||
|
}
|
||||||
|
|
||||||
|
// 转换为 Bean
|
||||||
|
val bean = Gson().fromJson(Gson().toJson(mergedData), IntImpQueryEditBean::class.java)
|
||||||
|
|
||||||
|
// 匹配下拉列表
|
||||||
|
matchAgent(bean)
|
||||||
|
matchSpCode(bean)
|
||||||
|
matchPackageType(bean)
|
||||||
|
matchWaybillType(bean)
|
||||||
|
matchLockState(bean)
|
||||||
|
|
||||||
|
dataBean.value = bean
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 匹配代理人
|
||||||
|
*/
|
||||||
|
private fun matchAgent(bean: IntImpQueryEditBean? = dataBean.value) {
|
||||||
|
bean ?: return
|
||||||
|
val currentCode = bean.agentCode
|
||||||
|
if (currentCode.isNullOrEmpty()) return
|
||||||
|
|
||||||
|
val list = agentList.value ?: return
|
||||||
|
if (list.isEmpty()) return
|
||||||
|
|
||||||
|
val match = list.find { it.value == currentCode }
|
||||||
|
if (match != null) {
|
||||||
|
bean.agentName = match.key
|
||||||
|
bean.agentCode = match.value
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 匹配特码
|
||||||
|
*/
|
||||||
|
private fun matchSpCode(bean: IntImpQueryEditBean? = dataBean.value) {
|
||||||
|
bean ?: return
|
||||||
|
val currentCode = bean.spCode
|
||||||
|
if (currentCode.isNullOrEmpty()) return
|
||||||
|
|
||||||
|
val list = spCodeList.value ?: return
|
||||||
|
if (list.isEmpty()) return
|
||||||
|
|
||||||
|
val match = list.find { it.value == currentCode }
|
||||||
|
if (match != null) {
|
||||||
|
bean.spCode = match.value
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 匹配包装类型
|
||||||
|
*/
|
||||||
|
private fun matchPackageType(bean: IntImpQueryEditBean? = dataBean.value) {
|
||||||
|
bean ?: return
|
||||||
|
val currentType = bean.packageType
|
||||||
|
if (currentType.isNullOrEmpty()) return
|
||||||
|
|
||||||
|
val list = packageTypeList.value ?: return
|
||||||
|
if (list.isEmpty()) return
|
||||||
|
|
||||||
|
val match = list.find { it.value?.contains(currentType) == true }
|
||||||
|
if (match != null) {
|
||||||
|
bean.packageType = match.value
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 匹配运单类型
|
||||||
|
*/
|
||||||
|
private fun matchWaybillType(bean: IntImpQueryEditBean? = dataBean.value) {
|
||||||
|
bean ?: return
|
||||||
|
val currentCode = bean.awbType
|
||||||
|
if (currentCode.isNullOrEmpty()) return
|
||||||
|
|
||||||
|
val list = waybillTypeList.value ?: return
|
||||||
|
if (list.isEmpty()) return
|
||||||
|
|
||||||
|
val match = list.find { it.value == currentCode }
|
||||||
|
if (match != null) {
|
||||||
|
bean.awbType = match.value
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 匹配锁定状态
|
||||||
|
*/
|
||||||
|
private fun matchLockState(bean: IntImpQueryEditBean? = dataBean.value) {
|
||||||
|
bean ?: return
|
||||||
|
val currentState = bean.lockState
|
||||||
|
if (currentState.isNullOrEmpty()) return
|
||||||
|
|
||||||
|
val list = lockStateList.value ?: return
|
||||||
|
val match = list.find { it.value == currentState }
|
||||||
|
if (match != null) {
|
||||||
|
bean.lockState = match.value
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存修改
|
||||||
|
*/
|
||||||
|
fun submit() {
|
||||||
|
val bean = dataBean.value ?: return
|
||||||
|
|
||||||
|
// 构建提交数据(只提交需要的字段)
|
||||||
|
val submitData = mutableMapOf<String, Any?>()
|
||||||
|
submitData["maWbId"] = if (maWbId != 0L) maWbId else bean.maWbId
|
||||||
|
submitData["activeId"] = bean.activeId
|
||||||
|
submitData["prefix"] = bean.prefix
|
||||||
|
submitData["no"] = bean.no
|
||||||
|
submitData["wbNo"] = bean.wbNo
|
||||||
|
submitData["agentCode"] = bean.agentCode
|
||||||
|
submitData["spCode"] = bean.spCode
|
||||||
|
submitData["packageType"] = bean.packageType
|
||||||
|
submitData["awbType"] = bean.awbType
|
||||||
|
submitData["lockState"] = bean.lockState?.toIntOrNull()
|
||||||
|
submitData["remark"] = bean.remark
|
||||||
|
submitData["fno"] = bean.fno
|
||||||
|
submitData["fdate"] = bean.fdate
|
||||||
|
submitData["flight"] = bean.flight
|
||||||
|
submitData["pc"] = bean.pc
|
||||||
|
submitData["weight"] = bean.weight
|
||||||
|
submitData["volume"] = bean.volume
|
||||||
|
submitData["origin"] = bean.origin
|
||||||
|
submitData["dest"] = bean.dest
|
||||||
|
submitData["range"] = bean.range
|
||||||
|
submitData["goods"] = bean.goods
|
||||||
|
submitData["goodsCn"] = bean.goodsCn
|
||||||
|
submitData["cargoType"] = bean.cargoType
|
||||||
|
submitData["by1"] = bean.by1
|
||||||
|
submitData["subCode"] = bean.subCode
|
||||||
|
submitData["cashWeight"] = bean.cashWeight
|
||||||
|
submitData["unNumber"] = bean.unNumber
|
||||||
|
submitData["businessType"] = bean.businessType
|
||||||
|
submitData["carId"] = bean.carId
|
||||||
|
|
||||||
|
launchLoadingCollect({
|
||||||
|
NetApply.api.modifyIntImpMaWb(submitData.toRequestBody())
|
||||||
|
}) {
|
||||||
|
onSuccess = {
|
||||||
|
showToast("修改成功")
|
||||||
|
viewModelScope.launch {
|
||||||
|
FlowBus.with<String>(ConstantEvent.EVENT_REFRESH).emit("refresh")
|
||||||
|
}
|
||||||
|
getTopActivity().finish()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 取消
|
||||||
|
*/
|
||||||
|
fun cancel() {
|
||||||
|
getTopActivity().finish()
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -4,16 +4,21 @@ import android.app.Activity
|
|||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import androidx.lifecycle.MutableLiveData
|
import androidx.lifecycle.MutableLiveData
|
||||||
import com.lukouguoji.gjj.R
|
import com.lukouguoji.gjj.R
|
||||||
import com.lukouguoji.gjj.dialog.IntImpQueryFilterDialogModel
|
import com.lukouguoji.gjj.activity.IntImpQueryEditActivity
|
||||||
import com.lukouguoji.gjj.holder.IntImpQueryViewHolder
|
import com.lukouguoji.gjj.holder.IntImpQueryViewHolder
|
||||||
|
import com.lukouguoji.gjj.activity.IntImpQueryDetailsActivity
|
||||||
import com.lukouguoji.module_base.base.BasePageViewModel
|
import com.lukouguoji.module_base.base.BasePageViewModel
|
||||||
|
import com.lukouguoji.module_base.bean.IntImpQueryBean
|
||||||
import com.lukouguoji.module_base.common.Constant
|
import com.lukouguoji.module_base.common.Constant
|
||||||
import com.lukouguoji.module_base.http.net.NetApply
|
import com.lukouguoji.module_base.http.net.NetApply
|
||||||
|
import com.lukouguoji.module_base.interfaces.IOnItemClickListener
|
||||||
|
import com.lukouguoji.module_base.ktx.commonAdapter
|
||||||
import com.lukouguoji.module_base.ktx.launchCollect
|
import com.lukouguoji.module_base.ktx.launchCollect
|
||||||
import com.lukouguoji.module_base.ktx.launchLoadingCollect
|
import com.lukouguoji.module_base.ktx.launchLoadingCollect
|
||||||
import com.lukouguoji.module_base.ktx.showToast
|
import com.lukouguoji.module_base.ktx.showToast
|
||||||
import com.lukouguoji.module_base.ktx.toRequestBody
|
import com.lukouguoji.module_base.ktx.toRequestBody
|
||||||
import com.lukouguoji.module_base.model.ScanModel
|
import com.lukouguoji.module_base.model.ScanModel
|
||||||
|
import com.lukouguoji.module_base.util.DictUtils
|
||||||
import dev.utils.app.info.KeyValue
|
import dev.utils.app.info.KeyValue
|
||||||
import dev.utils.common.DateUtils
|
import dev.utils.common.DateUtils
|
||||||
import com.lukouguoji.module_base.ktx.formatDate
|
import com.lukouguoji.module_base.ktx.formatDate
|
||||||
@@ -21,7 +26,7 @@ import com.lukouguoji.module_base.ktx.formatDate
|
|||||||
/**
|
/**
|
||||||
* 国际进港查询ViewModel
|
* 国际进港查询ViewModel
|
||||||
*/
|
*/
|
||||||
class IntImpQueryViewModel : BasePageViewModel() {
|
class IntImpQueryViewModel : BasePageViewModel(), IOnItemClickListener {
|
||||||
|
|
||||||
// ==================== 搜索条件 ====================
|
// ==================== 搜索条件 ====================
|
||||||
val flightDateStart = MutableLiveData<String>(DateUtils.getCurrentTime().formatDate())
|
val flightDateStart = MutableLiveData<String>(DateUtils.getCurrentTime().formatDate())
|
||||||
@@ -50,10 +55,18 @@ class IntImpQueryViewModel : BasePageViewModel() {
|
|||||||
val totalPc = MutableLiveData("0")
|
val totalPc = MutableLiveData("0")
|
||||||
val totalWeight = MutableLiveData("0")
|
val totalWeight = MutableLiveData("0")
|
||||||
|
|
||||||
|
// ==================== 特码下拉 ====================
|
||||||
|
val spCodeList = MutableLiveData<List<KeyValue>>(emptyList())
|
||||||
|
|
||||||
|
// ==================== 筛选面板 ====================
|
||||||
|
val filterVisible = MutableLiveData(false)
|
||||||
|
val awbTypeList = MutableLiveData<List<KeyValue>>(emptyList())
|
||||||
|
val businessTypeList = MutableLiveData<List<KeyValue>>(emptyList())
|
||||||
|
|
||||||
// ==================== 筛选条件 ====================
|
// ==================== 筛选条件 ====================
|
||||||
val spCode = MutableLiveData("")
|
val spCode = MutableLiveData("")
|
||||||
val flightNo = MutableLiveData("")
|
val flightNo = MutableLiveData("")
|
||||||
val dest = MutableLiveData("")
|
val origin = MutableLiveData("")
|
||||||
val awbType = MutableLiveData("")
|
val awbType = MutableLiveData("")
|
||||||
val businessType = MutableLiveData("")
|
val businessType = MutableLiveData("")
|
||||||
val goodsCn = MutableLiveData("")
|
val goodsCn = MutableLiveData("")
|
||||||
@@ -71,22 +84,40 @@ class IntImpQueryViewModel : BasePageViewModel() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun filterClick() {
|
fun filterClick() {
|
||||||
val filterDialog = IntImpQueryFilterDialogModel(
|
filterVisible.value = true
|
||||||
spCode = spCode,
|
}
|
||||||
flightNo = flightNo,
|
|
||||||
dest = dest,
|
fun closeFilter() {
|
||||||
awbType = awbType,
|
filterVisible.value = false
|
||||||
businessType = businessType,
|
}
|
||||||
goodsCn = goodsCn,
|
|
||||||
onConfirm = { refresh() }
|
fun resetFilter() {
|
||||||
)
|
spCode.value = ""
|
||||||
filterDialog.show()
|
flightNo.value = ""
|
||||||
|
origin.value = ""
|
||||||
|
awbType.value = ""
|
||||||
|
businessType.value = ""
|
||||||
|
goodsCn.value = ""
|
||||||
|
}
|
||||||
|
|
||||||
|
fun confirmFilter() {
|
||||||
|
filterVisible.value = false
|
||||||
|
refresh()
|
||||||
|
}
|
||||||
|
|
||||||
|
fun initFilterLists() {
|
||||||
|
DictUtils.getWaybillTypeList(type = "II", addAll = true, checkedValue = awbType.value) {
|
||||||
|
awbTypeList.postValue(it)
|
||||||
|
}
|
||||||
|
DictUtils.getBusinessTypeList(type = "II", addAll = true, checkedValue = businessType.value) {
|
||||||
|
businessTypeList.postValue(it)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun getData() {
|
override fun getData() {
|
||||||
val listParams = mapOf(
|
val listParams = mapOf(
|
||||||
"pageNum" to pageModel.page,
|
"page" to pageModel.page,
|
||||||
"pageSize" to pageModel.limit,
|
"limit" to pageModel.limit,
|
||||||
"beginDate" to flightDateStart.value!!.ifEmpty { null },
|
"beginDate" to flightDateStart.value!!.ifEmpty { null },
|
||||||
"endDate" to flightDateEnd.value!!.ifEmpty { null },
|
"endDate" to flightDateEnd.value!!.ifEmpty { null },
|
||||||
"agentCode" to agentId.value!!.ifEmpty { null },
|
"agentCode" to agentId.value!!.ifEmpty { null },
|
||||||
@@ -94,7 +125,7 @@ class IntImpQueryViewModel : BasePageViewModel() {
|
|||||||
"wbNo" to waybillNo.value!!.ifEmpty { null },
|
"wbNo" to waybillNo.value!!.ifEmpty { null },
|
||||||
"spCode" to spCode.value!!.ifEmpty { null },
|
"spCode" to spCode.value!!.ifEmpty { null },
|
||||||
"fno" to flightNo.value!!.ifEmpty { null },
|
"fno" to flightNo.value!!.ifEmpty { null },
|
||||||
"dest" to dest.value!!.ifEmpty { null },
|
"origin" to origin.value!!.ifEmpty { null },
|
||||||
"awbType" to awbType.value!!.ifEmpty { null },
|
"awbType" to awbType.value!!.ifEmpty { null },
|
||||||
"businessType" to businessType.value!!.ifEmpty { null },
|
"businessType" to businessType.value!!.ifEmpty { null },
|
||||||
"goods" to goodsCn.value!!.ifEmpty { null }
|
"goods" to goodsCn.value!!.ifEmpty { null }
|
||||||
@@ -108,7 +139,7 @@ class IntImpQueryViewModel : BasePageViewModel() {
|
|||||||
"wbNo" to waybillNo.value!!.ifEmpty { null },
|
"wbNo" to waybillNo.value!!.ifEmpty { null },
|
||||||
"spCode" to spCode.value!!.ifEmpty { null },
|
"spCode" to spCode.value!!.ifEmpty { null },
|
||||||
"fno" to flightNo.value!!.ifEmpty { null },
|
"fno" to flightNo.value!!.ifEmpty { null },
|
||||||
"dest" to dest.value!!.ifEmpty { null },
|
"origin" to origin.value!!.ifEmpty { null },
|
||||||
"awbType" to awbType.value!!.ifEmpty { null },
|
"awbType" to awbType.value!!.ifEmpty { null },
|
||||||
"businessType" to businessType.value!!.ifEmpty { null },
|
"businessType" to businessType.value!!.ifEmpty { null },
|
||||||
"goods" to goodsCn.value!!.ifEmpty { null }
|
"goods" to goodsCn.value!!.ifEmpty { null }
|
||||||
@@ -145,6 +176,32 @@ class IntImpQueryViewModel : BasePageViewModel() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun onItemClick(position: Int, type: Int) {
|
||||||
|
val list = pageModel.rv?.commonAdapter()?.items as? List<IntImpQueryBean> ?: return
|
||||||
|
val bean = list.getOrNull(position) ?: return
|
||||||
|
|
||||||
|
when (type) {
|
||||||
|
2000 -> {
|
||||||
|
// 侧滑菜单 - 修改操作
|
||||||
|
IntImpQueryEditActivity.start(getTopActivity(), bean.maWbId, bean.prefix, bean.no)
|
||||||
|
}
|
||||||
|
else -> {
|
||||||
|
// 默认点击 - 进入详情
|
||||||
|
IntImpQueryDetailsActivity.start(getTopActivity(), bean.prefix, bean.no)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun initSpecialCodeList() {
|
||||||
|
DictUtils.getSpecialCodeList(
|
||||||
|
flag = 1,
|
||||||
|
ieFlag = "",
|
||||||
|
parentcode = ""
|
||||||
|
) {
|
||||||
|
spCodeList.value = it
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
fun initAgentList() {
|
fun initAgentList() {
|
||||||
launchCollect({
|
launchCollect({
|
||||||
NetApply.api.getIntImpAgentList()
|
NetApply.api.getIntImpAgentList()
|
||||||
|
|||||||
@@ -124,12 +124,9 @@ class IntImpStorageUseViewModel : BasePageViewModel() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
val params = mapOf(
|
val body = maWbListForClear.toRequestBody()
|
||||||
"clearNormal" to clearNormal,
|
|
||||||
"maWbList" to maWbListForClear
|
|
||||||
).toRequestBody()
|
|
||||||
|
|
||||||
launchLoadingCollect({ NetApply.api.clearIntImpStorage(params) }) {
|
launchLoadingCollect({ NetApply.api.clearIntImpStorage(clearNormal, body) }) {
|
||||||
onSuccess = {
|
onSuccess = {
|
||||||
showToast("清仓成功")
|
showToast("清仓成功")
|
||||||
viewModelScope.launch {
|
viewModelScope.launch {
|
||||||
@@ -188,13 +185,13 @@ class IntImpStorageUseViewModel : BasePageViewModel() {
|
|||||||
/**
|
/**
|
||||||
* 执行出库操作
|
* 执行出库操作
|
||||||
*/
|
*/
|
||||||
fun performOutStorage(selectedStorageList: List<com.lukouguoji.module_base.bean.GjcStorageUse>) {
|
fun performOutStorage(maWbListForOutStorage: List<GjcMaWb>) {
|
||||||
if (selectedStorageList.isEmpty()) {
|
if (maWbListForOutStorage.isEmpty()) {
|
||||||
showToast("请选择要出库的库位")
|
showToast("请选择要出库的库位")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
val params = selectedStorageList.toRequestBody()
|
val params = maWbListForOutStorage.toRequestBody()
|
||||||
|
|
||||||
launchLoadingCollect({ NetApply.api.outIntImpStorage(params) }) {
|
launchLoadingCollect({ NetApply.api.outIntImpStorage(params) }) {
|
||||||
onSuccess = {
|
onSuccess = {
|
||||||
@@ -232,13 +229,9 @@ class IntImpStorageUseViewModel : BasePageViewModel() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
val params = mapOf(
|
val body = maWbListForInStorage.toRequestBody()
|
||||||
"location" to locationName,
|
|
||||||
"locationId" to locationId.toLongOrNull(),
|
|
||||||
"maWbList" to maWbListForInStorage
|
|
||||||
).toRequestBody()
|
|
||||||
|
|
||||||
launchLoadingCollect({ NetApply.api.inIntImpStorage(params) }) {
|
launchLoadingCollect({ NetApply.api.inIntImpStorage(locationName, body) }) {
|
||||||
onSuccess = {
|
onSuccess = {
|
||||||
showToast("入库成功")
|
showToast("入库成功")
|
||||||
viewModelScope.launch {
|
viewModelScope.launch {
|
||||||
@@ -257,7 +250,8 @@ class IntImpStorageUseViewModel : BasePageViewModel() {
|
|||||||
"fdate" to flightDate.value?.ifEmpty { null },
|
"fdate" to flightDate.value?.ifEmpty { null },
|
||||||
"fno" to flightNo.value?.ifEmpty { null },
|
"fno" to flightNo.value?.ifEmpty { null },
|
||||||
"wbNo" to wbNo.value?.ifEmpty { null },
|
"wbNo" to wbNo.value?.ifEmpty { null },
|
||||||
"location" to location.value?.ifEmpty { null }
|
"location" to location.value?.ifEmpty { null },
|
||||||
|
"clearNormal" to clearResult.value?.ifEmpty { null }
|
||||||
)
|
)
|
||||||
|
|
||||||
val listParams = (filterParams + mapOf(
|
val listParams = (filterParams + mapOf(
|
||||||
|
|||||||
@@ -0,0 +1,26 @@
|
|||||||
|
package com.lukouguoji.gjj.viewModel
|
||||||
|
|
||||||
|
import android.content.Intent
|
||||||
|
import androidx.lifecycle.MutableLiveData
|
||||||
|
import com.lukouguoji.module_base.base.BaseViewModel
|
||||||
|
import com.lukouguoji.module_base.bean.GjjImportTally
|
||||||
|
import com.lukouguoji.module_base.common.Constant
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 国际进港理货报告详情 ViewModel
|
||||||
|
*/
|
||||||
|
class IntImpTallyDetailsViewModel : BaseViewModel() {
|
||||||
|
|
||||||
|
// 理货数据
|
||||||
|
val dataBean = MutableLiveData(GjjImportTally())
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 初始化数据(从列表项携带的数据)
|
||||||
|
*/
|
||||||
|
fun initOnCreated(intent: Intent) {
|
||||||
|
val tally = intent.getSerializableExtra(Constant.Key.DATA) as? GjjImportTally
|
||||||
|
if (tally != null) {
|
||||||
|
dataBean.value = tally
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -3,10 +3,13 @@ package com.lukouguoji.gjj.viewModel
|
|||||||
import androidx.lifecycle.MutableLiveData
|
import androidx.lifecycle.MutableLiveData
|
||||||
import androidx.lifecycle.viewModelScope
|
import androidx.lifecycle.viewModelScope
|
||||||
import com.lukouguoji.gjj.R
|
import com.lukouguoji.gjj.R
|
||||||
|
import com.lukouguoji.gjj.dialog.IntImpTallyDeleteDialogModel
|
||||||
|
import com.lukouguoji.gjj.dialog.IntImpTallyResetDialogModel
|
||||||
import dev.utils.common.DateUtils
|
import dev.utils.common.DateUtils
|
||||||
import com.lukouguoji.module_base.ktx.formatDate
|
import com.lukouguoji.module_base.ktx.formatDate
|
||||||
import com.lukouguoji.gjj.holder.IntImpTallyViewHolder
|
import com.lukouguoji.gjj.holder.IntImpTallyViewHolder
|
||||||
import com.lukouguoji.module_base.base.BasePageViewModel
|
import com.lukouguoji.module_base.base.BasePageViewModel
|
||||||
|
import com.lukouguoji.module_base.bean.GjjDeclareParam
|
||||||
import com.lukouguoji.module_base.bean.GjjImportTally
|
import com.lukouguoji.module_base.bean.GjjImportTally
|
||||||
import com.lukouguoji.module_base.common.Constant
|
import com.lukouguoji.module_base.common.Constant
|
||||||
import com.lukouguoji.module_base.common.ConstantEvent
|
import com.lukouguoji.module_base.common.ConstantEvent
|
||||||
@@ -40,10 +43,13 @@ class IntImpTallyViewModel : BasePageViewModel() {
|
|||||||
val isAllChecked = MutableLiveData(false)
|
val isAllChecked = MutableLiveData(false)
|
||||||
|
|
||||||
init {
|
init {
|
||||||
// 监听全选状态,自动更新所有列表项
|
// 监听全选状态,自动更新所有列表项(联动子列表)
|
||||||
isAllChecked.observeForever { checked ->
|
isAllChecked.observeForever { checked ->
|
||||||
val list = pageModel.rv?.commonAdapter()?.items as? List<GjjImportTally> ?: return@observeForever
|
val list = pageModel.rv?.commonAdapter()?.items as? List<GjjImportTally> ?: return@observeForever
|
||||||
list.forEach { it.checked.set(checked) }
|
list.forEach {
|
||||||
|
it.checked.set(checked)
|
||||||
|
it.haWbList?.forEach { sub -> sub.checked.set(checked) }
|
||||||
|
}
|
||||||
pageModel.rv?.commonAdapter()?.notifyDataSetChanged()
|
pageModel.rv?.commonAdapter()?.notifyDataSetChanged()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -65,9 +71,12 @@ class IntImpTallyViewModel : BasePageViewModel() {
|
|||||||
fun checkAllClick() {
|
fun checkAllClick() {
|
||||||
val list = pageModel.rv?.commonAdapter()?.items as? List<GjjImportTally> ?: return
|
val list = pageModel.rv?.commonAdapter()?.items as? List<GjjImportTally> ?: return
|
||||||
|
|
||||||
// 切换全选状态
|
// 切换全选状态(联动子列表)
|
||||||
val shouldCheckAll = !isAllChecked.value!!
|
val shouldCheckAll = !isAllChecked.value!!
|
||||||
list.forEach { it.checked.set(shouldCheckAll) }
|
list.forEach {
|
||||||
|
it.checked.set(shouldCheckAll)
|
||||||
|
it.haWbList?.forEach { sub -> sub.checked.set(shouldCheckAll) }
|
||||||
|
}
|
||||||
isAllChecked.value = shouldCheckAll
|
isAllChecked.value = shouldCheckAll
|
||||||
|
|
||||||
pageModel.rv?.commonAdapter()?.notifyDataSetChanged()
|
pageModel.rv?.commonAdapter()?.notifyDataSetChanged()
|
||||||
@@ -88,63 +97,158 @@ class IntImpTallyViewModel : BasePageViewModel() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 人工放行(暂不实现)
|
* 收集选中的主单和分单
|
||||||
|
*/
|
||||||
|
private fun getSelectedData(): Pair<List<GjjImportTally>, List<GjjImportTally>> {
|
||||||
|
val list = pageModel.rv?.commonAdapter()?.items as? List<GjjImportTally>
|
||||||
|
?: return Pair(emptyList(), emptyList())
|
||||||
|
val selectedMaWb = list.filter { it.isSelected }
|
||||||
|
val selectedHaWb = mutableListOf<GjjImportTally>()
|
||||||
|
list.forEach { maWb ->
|
||||||
|
maWb.haWbList?.forEach { haWb ->
|
||||||
|
if (haWb.isSelected) selectedHaWb.add(haWb)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return Pair(selectedMaWb, selectedHaWb)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 人工放行
|
||||||
*/
|
*/
|
||||||
fun manualReleaseClick() {
|
fun manualReleaseClick() {
|
||||||
val list = pageModel.rv?.commonAdapter()?.items as? List<GjjImportTally> ?: return
|
val (selectedMaWb, selectedHaWb) = getSelectedData()
|
||||||
val selectedItems = list.filter { it.isSelected }
|
|
||||||
|
|
||||||
if (selectedItems.isEmpty()) {
|
if (selectedMaWb.isEmpty() && selectedHaWb.isEmpty()) {
|
||||||
showToast("请选择要放行的记录")
|
showToast("请选择要放行的记录")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
showToast("人工放行功能开发中")
|
val param = GjjDeclareParam(
|
||||||
|
mtallyList = if (selectedMaWb.isNotEmpty()) selectedMaWb else null,
|
||||||
|
htallyList = if (selectedHaWb.isNotEmpty()) selectedHaWb else null
|
||||||
|
)
|
||||||
|
|
||||||
|
launchLoadingCollect({ NetApply.api.intImpTallyCustomCommand(param.toRequestBody()) }) {
|
||||||
|
onSuccess = {
|
||||||
|
showToast("人工放行成功")
|
||||||
|
viewModelScope.launch {
|
||||||
|
FlowBus.with<String>(ConstantEvent.EVENT_REFRESH).emit("refresh")
|
||||||
|
}
|
||||||
|
refresh()
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 状态重置(暂不实现)
|
* 状态重置
|
||||||
*/
|
*/
|
||||||
fun statusResetClick() {
|
fun statusResetClick() {
|
||||||
val list = pageModel.rv?.commonAdapter()?.items as? List<GjjImportTally> ?: return
|
val (selectedMaWb, selectedHaWb) = getSelectedData()
|
||||||
val selectedItems = list.filter { it.isSelected }
|
|
||||||
|
|
||||||
if (selectedItems.isEmpty()) {
|
if (selectedMaWb.isEmpty() && selectedHaWb.isEmpty()) {
|
||||||
showToast("请选择要重置的记录")
|
showToast("请选择要重置的记录")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
showToast("状态重置功能开发中")
|
val dialog = IntImpTallyResetDialogModel { dialogModel ->
|
||||||
|
val param = GjjDeclareParam(
|
||||||
|
mtallyList = if (selectedMaWb.isNotEmpty()) selectedMaWb else null,
|
||||||
|
htallyList = if (selectedHaWb.isNotEmpty()) selectedHaWb else null,
|
||||||
|
restStatus = dialogModel.resetStatusCode
|
||||||
|
)
|
||||||
|
|
||||||
|
launchLoadingCollect({ NetApply.api.intImpTallyResetDeclare(param.toRequestBody()) }) {
|
||||||
|
onSuccess = {
|
||||||
|
showToast("状态重置成功")
|
||||||
|
viewModelScope.launch {
|
||||||
|
FlowBus.with<String>(ConstantEvent.EVENT_REFRESH).emit("refresh")
|
||||||
|
}
|
||||||
|
refresh()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
dialog.show()
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除理货(暂不实现)
|
* 删除理货
|
||||||
*/
|
*/
|
||||||
fun deleteTallyClick() {
|
fun deleteTallyClick() {
|
||||||
val list = pageModel.rv?.commonAdapter()?.items as? List<GjjImportTally> ?: return
|
val (selectedMaWb, selectedHaWb) = getSelectedData()
|
||||||
val selectedItems = list.filter { it.isSelected }
|
|
||||||
|
|
||||||
if (selectedItems.isEmpty()) {
|
if (selectedMaWb.isEmpty() && selectedHaWb.isEmpty()) {
|
||||||
showToast("请选择要删除的记录")
|
showToast("请选择要删除的记录")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
showToast("删除理货功能开发中")
|
// 校验所选单据状态是否为 01(已申报)
|
||||||
|
val invalidMaWb = selectedMaWb.firstOrNull { it.status != "01" }
|
||||||
|
if (invalidMaWb != null) {
|
||||||
|
showToast("运单 ${invalidMaWb.getWaybillNo()} 理货未申报,不允许删除理货")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
val invalidHaWb = selectedHaWb.firstOrNull { it.status != "01" }
|
||||||
|
if (invalidHaWb != null) {
|
||||||
|
showToast("运单 ${invalidHaWb.getWaybillNo()} 理货未申报,不允许删除理货")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// 从接口获取删除原因列表
|
||||||
|
launchLoadingCollect({ NetApply.api.getDelReasonList() }) {
|
||||||
|
onSuccess = { result ->
|
||||||
|
val changeReasonList = result.data?.map { it.toKeyValue() } ?: emptyList()
|
||||||
|
|
||||||
|
val dialog = IntImpTallyDeleteDialogModel(changeReasonList) { dialogModel ->
|
||||||
|
val param = GjjDeclareParam(
|
||||||
|
dcode = dialogModel.changeReason.value ?: "",
|
||||||
|
dcontactsName = dialogModel.contactName.value ?: "",
|
||||||
|
dcontactsTel = dialogModel.contactPhone.value ?: "",
|
||||||
|
mtallyList = if (selectedMaWb.isNotEmpty()) selectedMaWb else null,
|
||||||
|
htallyList = if (selectedHaWb.isNotEmpty()) selectedHaWb else null
|
||||||
|
)
|
||||||
|
|
||||||
|
launchLoadingCollect({ NetApply.api.intImpTallyDeleteDeclare(param.toRequestBody()) }) {
|
||||||
|
onSuccess = {
|
||||||
|
showToast("删除申报成功")
|
||||||
|
viewModelScope.launch {
|
||||||
|
FlowBus.with<String>(ConstantEvent.EVENT_REFRESH).emit("refresh")
|
||||||
|
}
|
||||||
|
refresh()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
dialog.show()
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 理货申报(暂不实现)
|
* 理货申报
|
||||||
*/
|
*/
|
||||||
fun tallyDeclareClick() {
|
fun tallyDeclareClick() {
|
||||||
val list = pageModel.rv?.commonAdapter()?.items as? List<GjjImportTally> ?: return
|
val (selectedMaWb, selectedHaWb) = getSelectedData()
|
||||||
val selectedItems = list.filter { it.isSelected }
|
|
||||||
|
|
||||||
if (selectedItems.isEmpty()) {
|
if (selectedMaWb.isEmpty() && selectedHaWb.isEmpty()) {
|
||||||
showToast("请选择要申报的记录")
|
showToast("请选择要申报的记录")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
showToast("理货申报功能开发中")
|
val param = GjjDeclareParam(
|
||||||
|
mtallyList = if (selectedMaWb.isNotEmpty()) selectedMaWb else null,
|
||||||
|
htallyList = if (selectedHaWb.isNotEmpty()) selectedHaWb else null
|
||||||
|
)
|
||||||
|
|
||||||
|
launchLoadingCollect({ NetApply.api.intImpTallyDeclare(param.toRequestBody()) }) {
|
||||||
|
onSuccess = {
|
||||||
|
showToast("理货申报成功")
|
||||||
|
viewModelScope.launch {
|
||||||
|
FlowBus.with<String>(ConstantEvent.EVENT_REFRESH).emit("refresh")
|
||||||
|
}
|
||||||
|
refresh()
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -44,16 +44,17 @@
|
|||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:padding="8dp">
|
android:padding="8dp">
|
||||||
|
|
||||||
<!-- 第1行:航班日期、航班号、航程(全部禁止编辑) -->
|
<!-- 第1行:航班日期、航班号、航程(新增可编辑,编辑禁止) -->
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
|
|
||||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
|
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
|
||||||
enable="@{false}"
|
enable="@{viewModel.pageType == DetailsPageType.Add}"
|
||||||
hint='@{"请选择航班日期"}'
|
hint='@{"请选择航班日期"}'
|
||||||
required="@{false}"
|
required="@{false}"
|
||||||
|
setRefreshCallBack="@{viewModel::onFlightDateInputComplete}"
|
||||||
title='@{"航班日期"}'
|
title='@{"航班日期"}'
|
||||||
titleLength="@{5}"
|
titleLength="@{5}"
|
||||||
type="@{DataLayoutType.DATE}"
|
type="@{DataLayoutType.DATE}"
|
||||||
@@ -63,9 +64,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
|
||||||
enable="@{false}"
|
android:id="@+id/flightNoInput"
|
||||||
|
enable="@{viewModel.pageType == DetailsPageType.Add}"
|
||||||
hint='@{"请输入航班号"}'
|
hint='@{"请输入航班号"}'
|
||||||
required="@{false}"
|
required="@{false}"
|
||||||
|
setRefreshCallBack="@{viewModel::onFlightNoInputComplete}"
|
||||||
title='@{"航 班 号"}'
|
title='@{"航 班 号"}'
|
||||||
titleLength="@{5}"
|
titleLength="@{5}"
|
||||||
type="@{DataLayoutType.INPUT}"
|
type="@{DataLayoutType.INPUT}"
|
||||||
@@ -77,12 +80,12 @@
|
|||||||
|
|
||||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
|
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
|
||||||
enable="@{false}"
|
enable="@{false}"
|
||||||
hint='@{"请输入航程"}'
|
hint='@{"自动填充"}'
|
||||||
required="@{false}"
|
required="@{false}"
|
||||||
title='@{"航 程"}'
|
title='@{"航 程"}'
|
||||||
titleLength="@{5}"
|
titleLength="@{5}"
|
||||||
type="@{DataLayoutType.INPUT}"
|
type="@{DataLayoutType.INPUT}"
|
||||||
value='@={viewModel.range}'
|
value='@{viewModel.range}'
|
||||||
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"
|
||||||
@@ -90,7 +93,7 @@
|
|||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<!-- 第2行:运单号(禁止编辑)、代理、特码 -->
|
<!-- 第2行:运单号(新增可编辑,编辑禁止)、代理、特码 -->
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
@@ -98,9 +101,9 @@
|
|||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
|
|
||||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
|
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
|
||||||
enable="@{false}"
|
enable="@{viewModel.pageType == DetailsPageType.Add}"
|
||||||
hint='@{"请输入运单号"}'
|
hint='@{"请输入运单号"}'
|
||||||
required="@{false}"
|
required="@{true}"
|
||||||
title='@{"运 单 号"}'
|
title='@{"运 单 号"}'
|
||||||
titleLength="@{5}"
|
titleLength="@{5}"
|
||||||
type="@{DataLayoutType.INPUT}"
|
type="@{DataLayoutType.INPUT}"
|
||||||
@@ -112,7 +115,7 @@
|
|||||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
|
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
|
||||||
hint='@{"请选择代理"}'
|
hint='@{"请选择代理"}'
|
||||||
list="@{viewModel.agentList}"
|
list="@{viewModel.agentList}"
|
||||||
required="@{false}"
|
required="@{true}"
|
||||||
title='@{"代 理"}'
|
title='@{"代 理"}'
|
||||||
titleLength="@{5}"
|
titleLength="@{5}"
|
||||||
type="@{DataLayoutType.SPINNER}"
|
type="@{DataLayoutType.SPINNER}"
|
||||||
@@ -146,7 +149,7 @@
|
|||||||
|
|
||||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
|
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
|
||||||
hint='@{"请输入始发站"}'
|
hint='@{"请输入始发站"}'
|
||||||
required="@{false}"
|
required="@{true}"
|
||||||
title='@{"始 发 站"}'
|
title='@{"始 发 站"}'
|
||||||
titleLength="@{5}"
|
titleLength="@{5}"
|
||||||
type="@{DataLayoutType.INPUT}"
|
type="@{DataLayoutType.INPUT}"
|
||||||
@@ -157,7 +160,7 @@
|
|||||||
|
|
||||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
|
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
|
||||||
hint='@{"请输入目的站"}'
|
hint='@{"请输入目的站"}'
|
||||||
required="@{false}"
|
required="@{true}"
|
||||||
title='@{"目 的 站"}'
|
title='@{"目 的 站"}'
|
||||||
titleLength="@{5}"
|
titleLength="@{5}"
|
||||||
type="@{DataLayoutType.INPUT}"
|
type="@{DataLayoutType.INPUT}"
|
||||||
@@ -170,7 +173,7 @@
|
|||||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
|
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
|
||||||
hint='@{"请选择运单类型"}'
|
hint='@{"请选择运单类型"}'
|
||||||
list="@{viewModel.waybillTypeList}"
|
list="@{viewModel.waybillTypeList}"
|
||||||
required="@{false}"
|
required="@{true}"
|
||||||
title='@{"运单类型"}'
|
title='@{"运单类型"}'
|
||||||
titleLength="@{5}"
|
titleLength="@{5}"
|
||||||
type="@{DataLayoutType.SPINNER}"
|
type="@{DataLayoutType.SPINNER}"
|
||||||
@@ -190,8 +193,9 @@
|
|||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
|
|
||||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
|
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
|
||||||
|
android:id="@+id/waybillNumInput"
|
||||||
hint='@{"请输入总件数"}'
|
hint='@{"请输入总件数"}'
|
||||||
required="@{false}"
|
required="@{true}"
|
||||||
title='@{"总 件 数"}'
|
title='@{"总 件 数"}'
|
||||||
titleLength="@{5}"
|
titleLength="@{5}"
|
||||||
type="@{DataLayoutType.INPUT}"
|
type="@{DataLayoutType.INPUT}"
|
||||||
@@ -201,6 +205,7 @@
|
|||||||
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
|
||||||
|
android:id="@+id/actualNumInput"
|
||||||
hint='@{"请输入实到件数"}'
|
hint='@{"请输入实到件数"}'
|
||||||
required="@{false}"
|
required="@{false}"
|
||||||
title='@{"实到件数"}'
|
title='@{"实到件数"}'
|
||||||
@@ -213,8 +218,9 @@
|
|||||||
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
|
||||||
|
android:id="@+id/actualWeightInput"
|
||||||
hint='@{"请输入实到重量"}'
|
hint='@{"请输入实到重量"}'
|
||||||
required="@{false}"
|
required="@{true}"
|
||||||
title='@{"实到重量"}'
|
title='@{"实到重量"}'
|
||||||
titleLength="@{5}"
|
titleLength="@{5}"
|
||||||
type="@{DataLayoutType.INPUT}"
|
type="@{DataLayoutType.INPUT}"
|
||||||
@@ -234,6 +240,7 @@
|
|||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
|
|
||||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
|
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
|
||||||
|
android:id="@+id/billingWeightInput"
|
||||||
hint='@{"请输入计费重量"}'
|
hint='@{"请输入计费重量"}'
|
||||||
required="@{false}"
|
required="@{false}"
|
||||||
title='@{"计费重量"}'
|
title='@{"计费重量"}'
|
||||||
@@ -258,7 +265,7 @@
|
|||||||
|
|
||||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
|
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
|
||||||
hint='@{"请输入品名(英)"}'
|
hint='@{"请输入品名(英)"}'
|
||||||
required="@{false}"
|
required="@{true}"
|
||||||
title='@{"品名(英)"}'
|
title='@{"品名(英)"}'
|
||||||
titleLength="@{5}"
|
titleLength="@{5}"
|
||||||
type="@{DataLayoutType.INPUT}"
|
type="@{DataLayoutType.INPUT}"
|
||||||
@@ -292,7 +299,7 @@
|
|||||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
|
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
|
||||||
hint='@{"请选择业务类型"}'
|
hint='@{"请选择业务类型"}'
|
||||||
list="@{viewModel.businessTypeList}"
|
list="@{viewModel.businessTypeList}"
|
||||||
required="@{false}"
|
required="@{true}"
|
||||||
title='@{"业务类型"}'
|
title='@{"业务类型"}'
|
||||||
titleLength="@{5}"
|
titleLength="@{5}"
|
||||||
type="@{DataLayoutType.SPINNER}"
|
type="@{DataLayoutType.SPINNER}"
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user