Compare commits
3 Commits
9363717224
...
5e1ccc9e8a
| Author | SHA1 | Date | |
|---|---|---|---|
| 5e1ccc9e8a | |||
| 89d4812d9f | |||
| 8af644288d |
@@ -102,7 +102,8 @@
|
|||||||
"mcp__apifox__refresh_project_oas_kcl8s7",
|
"mcp__apifox__refresh_project_oas_kcl8s7",
|
||||||
"mcp__apifox__read_project_oas_ref_resources_kcl8s7",
|
"mcp__apifox__read_project_oas_ref_resources_kcl8s7",
|
||||||
"mcp__apifox__read_project_oas_x3v6fh",
|
"mcp__apifox__read_project_oas_x3v6fh",
|
||||||
"mcp__apifox__read_project_oas_ref_resources_x3v6fh"
|
"mcp__apifox__read_project_oas_ref_resources_x3v6fh",
|
||||||
|
"mcp__plugin_claude-mem_mcp-search__smart_outline"
|
||||||
],
|
],
|
||||||
"deny": [],
|
"deny": [],
|
||||||
"ask": []
|
"ask": []
|
||||||
|
|||||||
19
CLAUDE.md
19
CLAUDE.md
@@ -383,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`
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|||||||
@@ -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(
|
||||||
|
|||||||
@@ -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
|
||||||
@@ -23,6 +23,14 @@ class GjjManifestAddActivity :
|
|||||||
override fun initOnCreate(savedInstanceState: Bundle?) {
|
override fun initOnCreate(savedInstanceState: Bundle?) {
|
||||||
binding.viewModel = viewModel
|
binding.viewModel = viewModel
|
||||||
binding.flightNoInput.et.setUpperCaseAlphanumericFilter()
|
binding.flightNoInput.et.setUpperCaseAlphanumericFilter()
|
||||||
|
|
||||||
|
// 件数只允许输入整数
|
||||||
|
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)
|
viewModel.initOnCreated(intent)
|
||||||
|
|
||||||
// 动态设置标题(必须在 initOnCreated 之后,pageType 已从 Intent 解析)
|
// 动态设置标题(必须在 initOnCreated 之后,pageType 已从 Intent 解析)
|
||||||
|
|||||||
@@ -12,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
|
||||||
@@ -20,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() {
|
||||||
@@ -33,8 +35,8 @@ 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("")
|
||||||
@@ -173,6 +175,12 @@ 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.getShouYunPackageTypeList {
|
DictUtils.getShouYunPackageTypeList {
|
||||||
packageTypeList.postValue(listOf(KeyValue("", "")) + it)
|
packageTypeList.postValue(listOf(KeyValue("", "")) + it)
|
||||||
@@ -273,11 +281,37 @@ 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("请输入实到数量")
|
|| actualNum.value.verifyNullOrEmpty("请输入实到数量")
|
||||||
|
|||||||
@@ -193,6 +193,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/waybillNumInput"
|
||||||
hint='@{"请输入总件数"}'
|
hint='@{"请输入总件数"}'
|
||||||
required="@{false}"
|
required="@{false}"
|
||||||
title='@{"总 件 数"}'
|
title='@{"总 件 数"}'
|
||||||
@@ -204,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='@{"实到件数"}'
|
||||||
@@ -216,6 +218,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/actualWeightInput"
|
||||||
hint='@{"请输入实到重量"}'
|
hint='@{"请输入实到重量"}'
|
||||||
required="@{false}"
|
required="@{false}"
|
||||||
title='@{"实到重量"}'
|
title='@{"实到重量"}'
|
||||||
@@ -237,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='@{"计费重量"}'
|
||||||
|
|||||||
@@ -27,8 +27,8 @@
|
|||||||
android:layout_height="20dp"
|
android:layout_height="20dp"
|
||||||
android:layout_gravity="center_vertical"
|
android:layout_gravity="center_vertical"
|
||||||
android:layout_weight="0.5"
|
android:layout_weight="0.5"
|
||||||
loadImage="@{bean.checked.get() ? @drawable/radiobtn_checked_gray : @drawable/radiobtn_unchecked_gray}"
|
loadImage="@{bean.checked.get() ? @drawable/radiobtn_checked_style : @drawable/radiobtn_unchecked_style}"
|
||||||
android:src="@drawable/radiobtn_unchecked_gray" />
|
android:src="@drawable/radiobtn_unchecked_style" />
|
||||||
|
|
||||||
<!-- 分单号 -->
|
<!-- 分单号 -->
|
||||||
<TextView
|
<TextView
|
||||||
|
|||||||
@@ -27,8 +27,8 @@
|
|||||||
android:layout_height="20dp"
|
android:layout_height="20dp"
|
||||||
android:layout_gravity="center_vertical"
|
android:layout_gravity="center_vertical"
|
||||||
android:layout_weight="0.5"
|
android:layout_weight="0.5"
|
||||||
loadImage="@{bean.checked.get() ? @drawable/radiobtn_checked_gray : @drawable/radiobtn_unchecked_gray}"
|
loadImage="@{bean.checked.get() ? @drawable/radiobtn_checked_style : @drawable/radiobtn_unchecked_style}"
|
||||||
android:src="@drawable/radiobtn_unchecked_gray" />
|
android:src="@drawable/radiobtn_unchecked_style" />
|
||||||
|
|
||||||
<!-- 运单号 -->
|
<!-- 运单号 -->
|
||||||
<TextView
|
<TextView
|
||||||
|
|||||||
@@ -27,7 +27,7 @@
|
|||||||
android:layout_height="20dp"
|
android:layout_height="20dp"
|
||||||
android:layout_gravity="center_vertical"
|
android:layout_gravity="center_vertical"
|
||||||
android:layout_weight="0.5"
|
android:layout_weight="0.5"
|
||||||
loadImage="@{bean.checked.get() ? @drawable/radiobtn_checked_gray : @drawable/radiobtn_unchecked_gray}"
|
loadImage="@{bean.checked.get() ? @drawable/radiobtn_checked_style : @drawable/radiobtn_unchecked_style}"
|
||||||
android:src="@drawable/radiobtn_unchecked_style" />
|
android:src="@drawable/radiobtn_unchecked_style" />
|
||||||
|
|
||||||
<!-- 库位号 -->
|
<!-- 库位号 -->
|
||||||
|
|||||||
@@ -27,7 +27,7 @@
|
|||||||
android:layout_height="20dp"
|
android:layout_height="20dp"
|
||||||
android:layout_gravity="center_vertical"
|
android:layout_gravity="center_vertical"
|
||||||
android:layout_weight="0.5"
|
android:layout_weight="0.5"
|
||||||
loadImage="@{bean.checked.get() ? @drawable/radiobtn_checked_gray : @drawable/radiobtn_unchecked_gray}"
|
loadImage="@{bean.checked.get() ? @drawable/radiobtn_checked_style : @drawable/radiobtn_unchecked_style}"
|
||||||
android:src="@drawable/radiobtn_unchecked_style" />
|
android:src="@drawable/radiobtn_unchecked_style" />
|
||||||
|
|
||||||
<!-- 分单号 -->
|
<!-- 分单号 -->
|
||||||
|
|||||||
Reference in New Issue
Block a user