feat(inbound): 新增入库秤毛菜/净菜入库功能完整实现

- StoreActivity 进入时统一弹出 InboundGoodsSearchDialog,关闭后退出页面
- InboundGoodsStoreDialog 支持 goods 可空,适配无溯源码直接入库场景
- FormField 新增 extraApiKeys/extraValues 支持下拉多字段提交(供应商id+type、区域id+name)
- DictType 新增 type 字段,供应商选项携带类型信息
- FormFieldAdapter 下拉选中时按 extraApiKeys 映射写入 extraValues
- InboundApiService 使用 @JvmSuppressWildcards 修复 Retrofit Map 泛型通配符异常
- BaseActivity 改为继承 AppCompatActivity,主题切换为 MaterialComponents
- 日期格式统一为 yyyy-MM-dd HH:mm:ss(去除 ISO 8601 的 T 分隔符)
- 搜索列表选中逻辑修复,改用 notifyDataSetChanged 触发刷新
This commit is contained in:
2026-05-27 15:24:37 +08:00
parent e63078dfd0
commit aa24059caa
17 changed files with 137 additions and 124 deletions
@@ -33,9 +33,15 @@ class InboundGoodsSearchDialog(
override fun initView() {
storeActivity = getReceiptActivity() as? StoreActivity
binding.tvDialogTitle.text = if (storeActivity?.storeType == 1) "毛菜检索" else "净菜检索"
binding.ivClose.setOnClickListener { dismiss() }
binding.ivGoodsSearch.setOnClickListener { searchGoods() }
binding.etInputGoods.addOnActionSearchListener { searchGoods() }
binding.btnAddGoods.setOnClickListener {
InboundGoodsStoreDialog(context = context, goods = null) {
dismiss()
}.show()
}
binding.btnConfirm.setOnClickListener {
if (list.isEmpty()) {
context.toast("请搜索物品")
@@ -92,9 +98,10 @@ class InboundGoodsSearchDialog(
if (emptyBinding == null) {
emptyBinding = LayoutEmptySearchBinding.inflate(inflater, binding.rvSearch, false)
}
emptyBinding?.root?.let { layout ->
layout.setOnClickListener { layout.hideKeyboard() }
searchAdapter.stateView = layout
emptyBinding?.run {
tvContent.text = "请检查溯源码或稍后重试"
root.setOnClickListener { root.hideKeyboard() }
searchAdapter.stateView = root
}
}
@@ -109,7 +116,7 @@ class InboundGoodsSearchDialog(
if (list[position].isSelected) return@setOnItemClickListener
list.forEach { it.isSelected = false }
list[position].isSelected = true
submitList(list.toList())
notifyDataSetChanged()
}
}
}