feat(出港运抵): Tab 改服务端 arrivalStatus 过滤,移除补充信息页(问题清单 #19/#20)
- #20 待运抵/已运抵 Tab 改为入参 arrivalStatus=0/1 服务端过滤(与平板运抵状态筛选一致), 角标为同条件 pageQueryTotal 全量票数;删除客户端拆分逻辑与 GjcMaWb.isPending (口径变化:申报状态 E 等异常态归入「待运抵」,以后端 arrivalStatus 为准) - #19 后端确认目前无需「补充信息」页:删除 IntExpArriveSupplementActivity/ViewModel/布局与清单注册, 待运抵卡片不再弹长按浮层(已运抵保留 重置/回执) - 筛选移除「代理」:内网实测 IntExpArrive/pageQuery 忽略 agentCode,与平板查询参数对齐 - 内网实测:全量 待运抵 6 / 已运抵 2,与 pageQuery total 一致 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -98,12 +98,6 @@
|
|||||||
android:exported="true"
|
android:exported="true"
|
||||||
tools:replace="android:exported" />
|
tools:replace="android:exported" />
|
||||||
|
|
||||||
<!-- 出港运抵-补充信息(手机版适配验证页) -->
|
|
||||||
<activity
|
|
||||||
android:name="com.lukouguoji.gjc.activity.IntExpArriveSupplementActivity"
|
|
||||||
android:exported="true"
|
|
||||||
tools:replace="android:exported" />
|
|
||||||
|
|
||||||
<!-- 出港查询(手机版适配验证页) -->
|
<!-- 出港查询(手机版适配验证页) -->
|
||||||
<activity
|
<activity
|
||||||
android:name="com.lukouguoji.gjc.activity.GjcQueryActivity"
|
android:name="com.lukouguoji.gjc.activity.GjcQueryActivity"
|
||||||
|
|||||||
@@ -157,12 +157,6 @@
|
|||||||
android:configChanges="orientation|keyboardHidden"
|
android:configChanges="orientation|keyboardHidden"
|
||||||
android:exported="false"
|
android:exported="false"
|
||||||
android:screenOrientation="unspecified" />
|
android:screenOrientation="unspecified" />
|
||||||
<!-- 国际出港运抵-补充信息(5.5寸手机版专属页面) -->
|
|
||||||
<activity
|
|
||||||
android:name="com.lukouguoji.gjc.activity.IntExpArriveSupplementActivity"
|
|
||||||
android:configChanges="orientation|keyboardHidden"
|
|
||||||
android:exported="false"
|
|
||||||
android:screenOrientation="unspecified" />
|
|
||||||
<!-- 国际出港仓库 -->
|
<!-- 国际出港仓库 -->
|
||||||
<activity
|
<activity
|
||||||
android:name="com.lukouguoji.gjc.activity.IntExpStorageUseActivity"
|
android:name="com.lukouguoji.gjc.activity.IntExpStorageUseActivity"
|
||||||
|
|||||||
@@ -131,13 +131,6 @@ data class GjcMaWb(
|
|||||||
get() = checked.get()
|
get() = checked.get()
|
||||||
set(value) = checked.set(value)
|
set(value) = checked.set(value)
|
||||||
|
|
||||||
/**
|
|
||||||
* 5.5寸手机版:是否处于「待运抵」Tab(申报状态为空)。
|
|
||||||
* 接口无按申报状态区分的查询参数,Tab 由客户端对已加载数据拆分。
|
|
||||||
*/
|
|
||||||
val isPending: Boolean
|
|
||||||
get() = declareStatus.isNullOrEmpty()
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 5.5寸手机版:申报状态三色标签的着色分类(01=绿/W=靛蓝/其余非空=琥珀)。
|
* 5.5寸手机版:申报状态三色标签的着色分类(01=绿/W=靛蓝/其余非空=琥珀)。
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -96,8 +96,12 @@ class IntExpArriveActivity :
|
|||||||
viewModel.onTabChangedPhone()
|
viewModel.onTabChangedPhone()
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 卡片长按:展开操作浮层(View.OnLongClickListener 要求返回 Boolean) */
|
/**
|
||||||
|
* 卡片长按:展开操作浮层(View.OnLongClickListener 要求返回 Boolean)。
|
||||||
|
* 仅已运抵 Tab 有操作(重置 / 回执);待运抵 Tab 的「补充信息」页后端确认暂不需要,已移除。
|
||||||
|
*/
|
||||||
fun showCardActionPhone(bean: GjcMaWb): Boolean {
|
fun showCardActionPhone(bean: GjcMaWb): Boolean {
|
||||||
|
if (viewModel.currentTab.value != "shipped") return false
|
||||||
bean.actionMenuVisible.set(true)
|
bean.actionMenuVisible.set(true)
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
@@ -121,7 +125,6 @@ class IntExpArriveActivity :
|
|||||||
fun resetFilter() {
|
fun resetFilter() {
|
||||||
viewModel.flightDate.value = ""
|
viewModel.flightDate.value = ""
|
||||||
viewModel.flightNo.value = ""
|
viewModel.flightNo.value = ""
|
||||||
viewModel.agentCodePhone.value = ""
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 手机版筛选:确认 */
|
/** 手机版筛选:确认 */
|
||||||
@@ -147,16 +150,6 @@ class IntExpArriveActivity :
|
|||||||
IntExpArriveReceiptActivity.start(this, bean.wbNo.orEmpty(), list)
|
IntExpArriveReceiptActivity.start(this, bean.wbNo.orEmpty(), list)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 进入「补充信息」页(手机专属新页):对该运单整个 haWbList 批量应用(参照 Pad 端国际进港
|
|
||||||
* IntArrSupplementInfoViewModel 的批量复制模式)。后端暂无保存接口,见接口问题清单。
|
|
||||||
*/
|
|
||||||
fun openSupplement(bean: GjcMaWb) {
|
|
||||||
bean.actionMenuVisible.set(false)
|
|
||||||
val list = ArrayList<GjcHaWb>(bean.haWbList.orEmpty())
|
|
||||||
IntExpArriveSupplementActivity.start(this, bean.wbNo.orEmpty(), list)
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
|
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
|
||||||
super.onActivityResult(requestCode, resultCode, data)
|
super.onActivityResult(requestCode, resultCode, data)
|
||||||
when (requestCode) {
|
when (requestCode) {
|
||||||
|
|||||||
@@ -1,41 +0,0 @@
|
|||||||
package com.lukouguoji.gjc.activity
|
|
||||||
|
|
||||||
import android.content.Context
|
|
||||||
import android.content.Intent
|
|
||||||
import android.os.Bundle
|
|
||||||
import com.lukouguoji.gjc.R
|
|
||||||
import com.lukouguoji.gjc.databinding.ActivityIntExpArriveSupplementBinding
|
|
||||||
import com.lukouguoji.gjc.viewModel.IntExpArriveSupplementViewModel
|
|
||||||
import com.lukouguoji.module_base.base.BaseBindingActivity
|
|
||||||
import com.lukouguoji.module_base.bean.GjcHaWb
|
|
||||||
import com.lukouguoji.module_base.common.Constant
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 国际出港运抵-补充信息页(5.5寸手机版专属新页,平板端无对应页面)
|
|
||||||
*
|
|
||||||
* 参照 Pad 端国际进港「收发货人信息」补充页的批量应用模式:对该运单整个 haWbList 批量应用
|
|
||||||
* 同一份收发货人表单。后端暂无保存接口,见 IntExpArriveSupplementViewModel 顶部注释。
|
|
||||||
* 对应设计稿 documents/5.5寸手持端设计文件/04_出港运抵/supplement.html。
|
|
||||||
*/
|
|
||||||
class IntExpArriveSupplementActivity :
|
|
||||||
BaseBindingActivity<ActivityIntExpArriveSupplementBinding, IntExpArriveSupplementViewModel>() {
|
|
||||||
|
|
||||||
override fun layoutId() = R.layout.activity_int_exp_arrive_supplement
|
|
||||||
override fun viewModelClass() = IntExpArriveSupplementViewModel::class.java
|
|
||||||
|
|
||||||
override fun initOnCreate(savedInstanceState: Bundle?) {
|
|
||||||
setBackArrow("补充信息")
|
|
||||||
binding.viewModel = viewModel
|
|
||||||
viewModel.initOnCreated(intent)
|
|
||||||
}
|
|
||||||
|
|
||||||
companion object {
|
|
||||||
@JvmStatic
|
|
||||||
fun start(context: Context, wbNo: String, haWbList: ArrayList<GjcHaWb>) {
|
|
||||||
val starter = Intent(context, IntExpArriveSupplementActivity::class.java)
|
|
||||||
.putExtra(Constant.Key.CODE, wbNo)
|
|
||||||
.putExtra(Constant.Key.DATA, haWbList)
|
|
||||||
context.startActivity(starter)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,119 +0,0 @@
|
|||||||
package com.lukouguoji.gjc.viewModel
|
|
||||||
|
|
||||||
import android.content.Intent
|
|
||||||
import androidx.lifecycle.MutableLiveData
|
|
||||||
import com.lukouguoji.module_base.base.BaseViewModel
|
|
||||||
import com.lukouguoji.module_base.bean.GjcHaWb
|
|
||||||
import com.lukouguoji.module_base.common.Constant
|
|
||||||
import com.lukouguoji.module_base.http.net.NetApply
|
|
||||||
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.ktx.verifyNullOrEmpty
|
|
||||||
import dev.utils.app.info.KeyValue
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 国际出港运抵-补充信息 ViewModel(5.5寸手机版专属新页)
|
|
||||||
*
|
|
||||||
* 参照 Pad 端国际进港 [com.lukouguoji.gjj.viewModel.IntArrSupplementInfoViewModel] 的
|
|
||||||
* 「单一表单批量复制到选中列表」模式:对该运单的整个 haWbList 批量应用同一份收发货人信息。
|
|
||||||
*
|
|
||||||
* ⚠️ 后端暂无保存接口,见 [com.lukouguoji.module_base.http.net.Api.supplementArriveHaWb] 注释
|
|
||||||
* 与 documents/后端接口对接问题清单.xlsx。
|
|
||||||
*/
|
|
||||||
class IntExpArriveSupplementViewModel : BaseViewModel() {
|
|
||||||
|
|
||||||
// 表单编辑用数据对象(取首个分单填充,让用户看到已有数据)
|
|
||||||
val dataBean = MutableLiveData(GjcHaWb())
|
|
||||||
|
|
||||||
// 批量应用的目标分单列表
|
|
||||||
private var haWbList: List<GjcHaWb> = emptyList()
|
|
||||||
|
|
||||||
// 国家代码下拉列表
|
|
||||||
val countryCodeList = MutableLiveData<List<KeyValue>>(emptyList())
|
|
||||||
|
|
||||||
// 通讯方式下拉列表
|
|
||||||
val comTypeList = MutableLiveData<List<KeyValue>>(emptyList())
|
|
||||||
|
|
||||||
@Suppress("UNCHECKED_CAST")
|
|
||||||
fun initOnCreated(intent: Intent) {
|
|
||||||
val list = intent.getSerializableExtra(Constant.Key.DATA) as? ArrayList<GjcHaWb>
|
|
||||||
// .copy() 补上被 Java 序列化跳过的 @Transient 字段(checked 等),见分单明细页同款注释
|
|
||||||
haWbList = (list ?: emptyList()).map { it.copy() }
|
|
||||||
dataBean.value = haWbList.firstOrNull()?.copy() ?: GjcHaWb()
|
|
||||||
|
|
||||||
loadCountryCodeList()
|
|
||||||
loadComTypeList()
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun loadCountryCodeList() {
|
|
||||||
launchCollect({ NetApply.api.getCountryCodeList() }) {
|
|
||||||
onSuccess = { result ->
|
|
||||||
countryCodeList.value = result.data?.mapNotNull { bean ->
|
|
||||||
if (bean.code != null && bean.name != null) KeyValue(bean.name, bean.code) else null
|
|
||||||
} ?: emptyList()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun loadComTypeList() {
|
|
||||||
launchCollect({ NetApply.api.getCommunicateTypeList() }) {
|
|
||||||
onSuccess = { result ->
|
|
||||||
comTypeList.value = result.data?.mapNotNull { bean ->
|
|
||||||
if (bean.code != null && bean.name != null) KeyValue(bean.name, bean.code) else null
|
|
||||||
} ?: emptyList()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fun cancel() {
|
|
||||||
getTopActivity().finish()
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 保存按钮点击 - 将表单信息复制到该运单的所有分单,批量提交。
|
|
||||||
*/
|
|
||||||
fun save() {
|
|
||||||
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 (haWbList.isEmpty()) {
|
|
||||||
showToast("无可保存的分单数据")
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
val updatedList = haWbList.map { haWb ->
|
|
||||||
haWb.copy(
|
|
||||||
consigneeName = formBean.consigneeName,
|
|
||||||
consigneeCountryCode = formBean.consigneeCountryCode,
|
|
||||||
consigneeComType = formBean.consigneeComType,
|
|
||||||
consigneePnum = formBean.consigneePnum,
|
|
||||||
consigneeAddress = formBean.consigneeAddress,
|
|
||||||
consignorName = formBean.consignorName,
|
|
||||||
consignorCountryCode = formBean.consignorCountryCode,
|
|
||||||
consignorComType = formBean.consignorComType,
|
|
||||||
consignorPnum = formBean.consignorPnum,
|
|
||||||
consignorAddress = formBean.consignorAddress
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
launchLoadingCollect({ NetApply.api.supplementArriveHaWb(updatedList.toRequestBody()) }) {
|
|
||||||
onSuccess = {
|
|
||||||
showToast("保存成功")
|
|
||||||
getTopActivity().finish()
|
|
||||||
}
|
|
||||||
onFailed = { code, msg ->
|
|
||||||
showToast("保存失败:$msg(后端接口暂未支持,见接口问题清单)")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -56,7 +56,7 @@ class IntExpArriveViewModel : BasePageViewModel() {
|
|||||||
|
|
||||||
// ========== 5.5寸手机版专属(平板布局不引用,零影响) ==========
|
// ========== 5.5寸手机版专属(平板布局不引用,零影响) ==========
|
||||||
|
|
||||||
/** 当前 Tab:"pending"(待运抵) / "shipped"(已运抵)。接口无申报状态查询参数,Tab 由客户端对已加载数据拆分 */
|
/** 当前 Tab:"pending"(待运抵) / "shipped"(已运抵)。查询时映射为入参 arrivalStatus=0/1(与平板端运抵状态筛选一致) */
|
||||||
val currentTab = MutableLiveData("pending")
|
val currentTab = MutableLiveData("pending")
|
||||||
|
|
||||||
/** Tab 配置 */
|
/** Tab 配置 */
|
||||||
@@ -64,7 +64,7 @@ class IntExpArriveViewModel : BasePageViewModel() {
|
|||||||
listOf(KeyValue("待运抵", "pending"), KeyValue("已运抵", "shipped"))
|
listOf(KeyValue("待运抵", "pending"), KeyValue("已运抵", "shipped"))
|
||||||
)
|
)
|
||||||
|
|
||||||
/** 两个 Tab 的角标计数(当前已加载数据的客户端统计,非全量,见接口问题清单) */
|
/** 两个 Tab 的角标计数(同条件 + arrivalStatus=0/1 各调一次 pageQueryTotal 取 wbNumber,全量口径) */
|
||||||
val arriveTabCounts = MutableLiveData(listOf("0", "0"))
|
val arriveTabCounts = MutableLiveData(listOf("0", "0"))
|
||||||
|
|
||||||
/** 手机版空态(当前 Tab 过滤后无数据时显示,对应设计稿 empty-pending) */
|
/** 手机版空态(当前 Tab 过滤后无数据时显示,对应设计稿 empty-pending) */
|
||||||
@@ -77,61 +77,51 @@ class IntExpArriveViewModel : BasePageViewModel() {
|
|||||||
/** 手机版已选数量(底部操作条「已选 N 项」) */
|
/** 手机版已选数量(底部操作条「已选 N 项」) */
|
||||||
val selectedCountPhone = MutableLiveData("0")
|
val selectedCountPhone = MutableLiveData("0")
|
||||||
|
|
||||||
/** 手机版筛选弹层「代理」(后端 pageQuery 支持 agentCode 入参,复用既有 agentCode 语义查询) */
|
|
||||||
val agentCodePhone = MutableLiveData("")
|
|
||||||
val agentListPhone = MutableLiveData<List<KeyValue>>(emptyList())
|
|
||||||
|
|
||||||
private var phoneExtrasEnabled = false
|
private var phoneExtrasEnabled = false
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 完整已加载列表(跨分页累计,未按 Tab 过滤)。
|
* 开启手机版专属数据:Tab(arrivalStatus)与角标统计。仅由手机形态的 Activity 调用。
|
||||||
*
|
* 筛选弹层与平板端查询参数一致(航班日期/航班号),agentCode 内网实测被后端忽略,已移除「代理」。
|
||||||
* ⚠️ RecyclerView/LinearLayoutManager 不会像普通 ViewGroup 那样让 `View.GONE` 的子项
|
|
||||||
* 自动塌陷为 0 高度——它仍按子项的测量高度参与滚动区域计算,导致"隐藏"的卡片在列表里
|
|
||||||
* 留下一段空白(已实机截图验证)。因此 Tab 切换不能靠给 item 加 visibility 绑定,
|
|
||||||
* 必须真正地把适配器的数据集替换成过滤后的子集([applyTabFilterPhone])。
|
|
||||||
*/
|
|
||||||
private var allLoadedList: List<GjcMaWb> = emptyList()
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 开启手机版专属数据:加载「代理」筛选下拉。仅由手机形态的 Activity 调用。
|
|
||||||
*/
|
*/
|
||||||
fun initPhoneExtras() {
|
fun initPhoneExtras() {
|
||||||
phoneExtrasEnabled = true
|
phoneExtrasEnabled = true
|
||||||
launchCollect({ NetApply.api.getIntExpAgentList() }) {
|
|
||||||
onSuccess = { result ->
|
|
||||||
agentListPhone.postValue(
|
|
||||||
listOf(KeyValue("全部", "")) + (result.data ?: emptyList()).map { KeyValue(it.name ?: "", it.code ?: "") }
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 手机版 Tab 切换:将适配器数据集替换为过滤后的子集(不重新请求)。
|
* 手机版 Tab 切换:按 arrivalStatus 重新查询(服务端过滤,分页与角标均为全量口径)。
|
||||||
* 由 Activity 在 [com.lukouguoji.module_base.ui.weight.phone.PhoneStatusTab] 的
|
* 由 Activity 在 [com.lukouguoji.module_base.ui.weight.phone.PhoneStatusTab] 的
|
||||||
* 双向绑定写入 currentTab 后调用。
|
* 双向绑定写入 currentTab 后调用。
|
||||||
*/
|
*/
|
||||||
fun onTabChangedPhone() {
|
fun onTabChangedPhone() {
|
||||||
applyTabFilterPhone()
|
refresh()
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun applyTabFilterPhone() {
|
/** 当前 Tab 对应的运抵状态入参:待运抵=0 / 已运抵=1 */
|
||||||
val isPendingTab = currentTab.value == "pending"
|
private fun currentArrivalStatus(): String =
|
||||||
val filtered = allLoadedList.filter { it.isPending == isPendingTab }
|
if (currentTab.value == "shipped") "1" else "0"
|
||||||
pageModel.rv?.commonAdapter()?.refresh(filtered)
|
|
||||||
emptyVisiblePhone.value = filtered.isEmpty()
|
/** 列表加载完成后刷新空态文案(服务端已按 Tab 过滤,adapter 即当前 Tab 数据) */
|
||||||
|
private fun updateEmptyStatePhone() {
|
||||||
|
val isPendingTab = currentTab.value != "shipped"
|
||||||
|
emptyVisiblePhone.value = pageModel.rv?.commonAdapter()?.items.isNullOrEmpty()
|
||||||
emptyTextPhone.value = if (isPendingTab) "暂无待运抵的运单" else "暂无已运抵的运单"
|
emptyTextPhone.value = if (isPendingTab) "暂无待运抵的运单" else "暂无已运抵的运单"
|
||||||
updateCheckAllStatusPhone()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据完整已加载列表重新计算 Tab 角标计数(每次数据变化后调用)。
|
* 加载 Tab 角标:同条件 + arrivalStatus=0/1 各调一次 pageQueryTotal,取 wbNumber。
|
||||||
*/
|
*/
|
||||||
private fun updatePhoneTabCounts() {
|
private fun loadPhoneTabCounts(filterParams: Map<String, Any?>) {
|
||||||
val pending = allLoadedList.count { it.isPending }.toString()
|
listOf("0", "1").forEachIndexed { index, status ->
|
||||||
val shipped = allLoadedList.count { !it.isPending }.toString()
|
launchCollect({
|
||||||
arriveTabCounts.value = listOf(pending, shipped)
|
NetApply.api.getIntExpArriveTotal((filterParams + mapOf("arrivalStatus" to status)).toRequestBody())
|
||||||
|
}) {
|
||||||
|
onSuccess = { result ->
|
||||||
|
val current = arriveTabCounts.value?.toMutableList() ?: mutableListOf("0", "0")
|
||||||
|
current[index] = (result.data?.wbNumber ?: 0).toString()
|
||||||
|
arriveTabCounts.value = current
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -439,33 +429,30 @@ class IntExpArriveViewModel : BasePageViewModel() {
|
|||||||
filterParams["wbNo"] = null
|
filterParams["wbNo"] = null
|
||||||
filterParams["likeNo"] = key
|
filterParams["likeNo"] = key
|
||||||
}
|
}
|
||||||
filterParams["agentCode"] = agentCodePhone.value?.ifEmpty { null }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 手机版 Tab 维度(运抵状态),角标需在不含该条件的基础上分别统计
|
||||||
|
val tabParams = if (phoneExtrasEnabled) {
|
||||||
|
filterParams + mapOf("arrivalStatus" to currentArrivalStatus())
|
||||||
|
} else filterParams
|
||||||
|
|
||||||
// 列表参数 (含分页)
|
// 列表参数 (含分页)
|
||||||
val listParams = (filterParams + mapOf(
|
val listParams = (tabParams + mapOf(
|
||||||
"pageNum" to pageModel.page,
|
"pageNum" to pageModel.page,
|
||||||
"pageSize" to pageModel.limit
|
"pageSize" to pageModel.limit
|
||||||
)).toRequestBody()
|
)).toRequestBody()
|
||||||
|
|
||||||
// 统计参数 (无分页)
|
// 统计参数 (无分页)
|
||||||
val totalParams = filterParams.toRequestBody()
|
val totalParams = tabParams.toRequestBody()
|
||||||
|
|
||||||
// 获取列表 (带Loading)
|
// 获取列表 (带Loading)
|
||||||
launchLoadingCollect({ NetApply.api.getIntExpArriveList(listParams) }) {
|
launchLoadingCollect({ NetApply.api.getIntExpArriveList(listParams) }) {
|
||||||
onSuccess = { result ->
|
onSuccess = { result ->
|
||||||
// 手机版:自行维护完整累计列表(不依赖 adapter.items 的历史状态,见 allLoadedList 注释)
|
|
||||||
if (phoneExtrasEnabled) {
|
|
||||||
val newPageItems = result.list ?: emptyList()
|
|
||||||
allLoadedList = if (pageModel.page <= 1) newPageItems else allLoadedList + newPageItems
|
|
||||||
}
|
|
||||||
|
|
||||||
pageModel.handleListBean(result) {
|
pageModel.handleListBean(result) {
|
||||||
updateCheckAllStatus()
|
updateCheckAllStatus()
|
||||||
if (phoneExtrasEnabled) {
|
if (phoneExtrasEnabled) {
|
||||||
// 用完整列表强制覆盖 adapter 数据集为当前 Tab 的过滤子集
|
updateEmptyStatePhone()
|
||||||
applyTabFilterPhone()
|
updateCheckAllStatusPhone()
|
||||||
updatePhoneTabCounts()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 数据加载完成后,重置全局展开状态为收起
|
// 数据加载完成后,重置全局展开状态为收起
|
||||||
@@ -482,5 +469,10 @@ class IntExpArriveViewModel : BasePageViewModel() {
|
|||||||
totalWeight.value = (data?.totalWeight ?: 0.0).toString()
|
totalWeight.value = (data?.totalWeight ?: 0.0).toString()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 手机版 Tab 角标(平板不触发)
|
||||||
|
if (phoneExtrasEnabled) {
|
||||||
|
loadPhoneTabCounts(filterParams)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -177,15 +177,6 @@
|
|||||||
type="@{com.lukouguoji.module_base.ui.weight.phone.PhoneDataLayoutType.INPUT}"
|
type="@{com.lukouguoji.module_base.ui.weight.phone.PhoneDataLayoutType.INPUT}"
|
||||||
value="@={viewModel.flightNo}" />
|
value="@={viewModel.flightNo}" />
|
||||||
|
|
||||||
<com.lukouguoji.module_base.ui.weight.phone.PhoneDataLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
hint='@{"请选择代理"}'
|
|
||||||
list="@{viewModel.agentListPhone}"
|
|
||||||
title='@{"代理"}'
|
|
||||||
type="@{com.lukouguoji.module_base.ui.weight.phone.PhoneDataLayoutType.SPINNER}"
|
|
||||||
value="@={viewModel.agentCodePhone}" />
|
|
||||||
|
|
||||||
</com.lukouguoji.module_base.ui.weight.phone.PhoneFilterPanel>
|
</com.lukouguoji.module_base.ui.weight.phone.PhoneFilterPanel>
|
||||||
|
|
||||||
</FrameLayout>
|
</FrameLayout>
|
||||||
|
|||||||
@@ -1,219 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<!--
|
|
||||||
国际出港运抵-补充信息 —— 5.5 寸手机版专属新页(平板端无对应页面)
|
|
||||||
|
|
||||||
参照 Pad 端国际进港「收发货人信息」补充页(IntArrSupplementInfoActivity)的批量应用模式:
|
|
||||||
对该运单整个 haWbList 批量应用同一份表单。后端暂无保存接口,见 ViewModel 顶部注释与
|
|
||||||
documents/后端接口对接问题清单.xlsx。对应设计稿 04_出港运抵/supplement.html。
|
|
||||||
-->
|
|
||||||
<layout xmlns:android="http://schemas.android.com/apk/res/android">
|
|
||||||
|
|
||||||
<data>
|
|
||||||
|
|
||||||
<import type="com.lukouguoji.module_base.ui.weight.phone.PhoneFormRowType" />
|
|
||||||
|
|
||||||
<variable
|
|
||||||
name="viewModel"
|
|
||||||
type="com.lukouguoji.gjc.viewModel.IntExpArriveSupplementViewModel" />
|
|
||||||
</data>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:background="@color/phone_page_bg"
|
|
||||||
android:orientation="vertical">
|
|
||||||
|
|
||||||
<include layout="@layout/title_tool_bar" />
|
|
||||||
|
|
||||||
<ScrollView
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="0dp"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:fillViewport="true"
|
|
||||||
android:overScrollMode="never">
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:orientation="vertical"
|
|
||||||
android:padding="16dp">
|
|
||||||
|
|
||||||
<!-- 收货人信息 -->
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:background="@drawable/bg_phone_card"
|
|
||||||
android:orientation="vertical"
|
|
||||||
android:padding="14dp">
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:gravity="center_vertical"
|
|
||||||
android:orientation="horizontal">
|
|
||||||
|
|
||||||
<View
|
|
||||||
android:layout_width="4dp"
|
|
||||||
android:layout_height="16dp"
|
|
||||||
android:background="@color/phone_primary" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginStart="8dp"
|
|
||||||
android:text="收货人信息"
|
|
||||||
android:textColor="@color/phone_text_strong"
|
|
||||||
android:textSize="15sp"
|
|
||||||
android:textStyle="bold" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<com.lukouguoji.module_base.ui.weight.phone.PhoneFormRow
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginTop="6dp"
|
|
||||||
hint='@{"请输入收货人名称"}'
|
|
||||||
required="@{true}"
|
|
||||||
title='@{"收货人名称"}'
|
|
||||||
type="@{PhoneFormRowType.INPUT}"
|
|
||||||
value="@={viewModel.dataBean.consigneeName}" />
|
|
||||||
|
|
||||||
<com.lukouguoji.module_base.ui.weight.phone.PhoneFormRow
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
hint='@{"请选择国家代码"}'
|
|
||||||
list="@{viewModel.countryCodeList}"
|
|
||||||
required="@{true}"
|
|
||||||
title='@{"国家代码"}'
|
|
||||||
type="@{PhoneFormRowType.SELECT}"
|
|
||||||
value="@={viewModel.dataBean.consigneeCountryCode}" />
|
|
||||||
|
|
||||||
<com.lukouguoji.module_base.ui.weight.phone.PhoneFormRow
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
hint='@{"请选择"}'
|
|
||||||
list="@{viewModel.comTypeList}"
|
|
||||||
required="@{true}"
|
|
||||||
title='@{"通讯方式"}'
|
|
||||||
type="@{PhoneFormRowType.SELECT}"
|
|
||||||
value="@={viewModel.dataBean.consigneeComType}" />
|
|
||||||
|
|
||||||
<com.lukouguoji.module_base.ui.weight.phone.PhoneFormRow
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
hint='@{"请输入联系号码"}'
|
|
||||||
required="@{true}"
|
|
||||||
title='@{"联系号码"}'
|
|
||||||
type="@{PhoneFormRowType.INPUT}"
|
|
||||||
value="@={viewModel.dataBean.consigneePnum}" />
|
|
||||||
|
|
||||||
<com.lukouguoji.module_base.ui.weight.phone.PhoneFormRow
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
hint='@{"请输入地址"}'
|
|
||||||
title='@{"地址"}'
|
|
||||||
type="@{PhoneFormRowType.INPUT}"
|
|
||||||
value="@={viewModel.dataBean.consigneeAddress}" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<!-- 发货人信息 -->
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginTop="12dp"
|
|
||||||
android:background="@drawable/bg_phone_card"
|
|
||||||
android:orientation="vertical"
|
|
||||||
android:padding="14dp">
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:gravity="center_vertical"
|
|
||||||
android:orientation="horizontal">
|
|
||||||
|
|
||||||
<View
|
|
||||||
android:layout_width="4dp"
|
|
||||||
android:layout_height="16dp"
|
|
||||||
android:background="@color/phone_primary" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginStart="8dp"
|
|
||||||
android:text="发货人信息"
|
|
||||||
android:textColor="@color/phone_text_strong"
|
|
||||||
android:textSize="15sp"
|
|
||||||
android:textStyle="bold" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<com.lukouguoji.module_base.ui.weight.phone.PhoneFormRow
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginTop="6dp"
|
|
||||||
hint='@{"请输入发货人名称"}'
|
|
||||||
required="@{true}"
|
|
||||||
title='@{"发货人名称"}'
|
|
||||||
type="@{PhoneFormRowType.INPUT}"
|
|
||||||
value="@={viewModel.dataBean.consignorName}" />
|
|
||||||
|
|
||||||
<com.lukouguoji.module_base.ui.weight.phone.PhoneFormRow
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
hint='@{"请选择国家代码"}'
|
|
||||||
list="@{viewModel.countryCodeList}"
|
|
||||||
required="@{true}"
|
|
||||||
title='@{"国家代码"}'
|
|
||||||
type="@{PhoneFormRowType.SELECT}"
|
|
||||||
value="@={viewModel.dataBean.consignorCountryCode}" />
|
|
||||||
|
|
||||||
<com.lukouguoji.module_base.ui.weight.phone.PhoneFormRow
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
hint='@{"请选择"}'
|
|
||||||
list="@{viewModel.comTypeList}"
|
|
||||||
required="@{true}"
|
|
||||||
title='@{"通讯方式"}'
|
|
||||||
type="@{PhoneFormRowType.SELECT}"
|
|
||||||
value="@={viewModel.dataBean.consignorComType}" />
|
|
||||||
|
|
||||||
<com.lukouguoji.module_base.ui.weight.phone.PhoneFormRow
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
hint='@{"请输入联系号码"}'
|
|
||||||
required="@{true}"
|
|
||||||
title='@{"联系号码"}'
|
|
||||||
type="@{PhoneFormRowType.INPUT}"
|
|
||||||
value="@={viewModel.dataBean.consignorPnum}" />
|
|
||||||
|
|
||||||
<com.lukouguoji.module_base.ui.weight.phone.PhoneFormRow
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
hint='@{"请输入地址"}'
|
|
||||||
title='@{"地址"}'
|
|
||||||
type="@{PhoneFormRowType.INPUT}"
|
|
||||||
value="@={viewModel.dataBean.consignorAddress}" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
</ScrollView>
|
|
||||||
|
|
||||||
<!-- 确定 -->
|
|
||||||
<TextView
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="48dp"
|
|
||||||
android:layout_margin="16dp"
|
|
||||||
android:background="@drawable/bg_phone_btn_primary"
|
|
||||||
android:gravity="center"
|
|
||||||
android:onClick="@{()-> viewModel.save()}"
|
|
||||||
android:text="确定"
|
|
||||||
android:textColor="@color/white"
|
|
||||||
android:textSize="16sp"
|
|
||||||
android:textStyle="bold" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
</layout>
|
|
||||||
@@ -217,19 +217,6 @@
|
|||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
|
|
||||||
<!-- 补充(仅待运抵) -->
|
|
||||||
<TextView
|
|
||||||
android:layout_width="56dp"
|
|
||||||
android:layout_height="56dp"
|
|
||||||
android:background="@drawable/bg_phone_fab_purple"
|
|
||||||
android:gravity="center"
|
|
||||||
android:onClick="@{()-> activity.openSupplement(bean)}"
|
|
||||||
android:text="补充"
|
|
||||||
android:textColor="@color/white"
|
|
||||||
android:textSize="12sp"
|
|
||||||
android:textStyle="bold"
|
|
||||||
android:visibility="@{`pending`.equals(viewModel.currentTab) ? View.VISIBLE : View.GONE}" />
|
|
||||||
|
|
||||||
<!-- 重置(仅已运抵) -->
|
<!-- 重置(仅已运抵) -->
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="56dp"
|
android:layout_width="56dp"
|
||||||
|
|||||||
Reference in New Issue
Block a user