feat: 国际进港查询运单修改页面及列表侧滑菜单
- 新增运单修改页面(编辑表单:代理人/特码/包装类型/运单类型/锁定状态/备注) - 查询列表添加侧滑"修改"按钮入口 - 详情和修改页接口传参改用 prefix+no - 详情页和修改页移除"库位"表单项 - 仓库信息入库时间取值改为 opDate Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -515,6 +515,13 @@
|
||||
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
|
||||
android:name="com.lukouguoji.gjj.activity.IntImpAccidentVisaActivity"
|
||||
|
||||
@@ -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 // 车牌号
|
||||
)
|
||||
@@ -1022,6 +1022,13 @@ interface Api {
|
||||
@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
|
||||
|
||||
@@ -9,7 +9,6 @@ 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
|
||||
|
||||
/**
|
||||
@@ -49,9 +48,10 @@ class IntImpQueryDetailsActivity :
|
||||
|
||||
companion object {
|
||||
@JvmStatic
|
||||
fun start(context: Context, maWbId: Long?) {
|
||||
fun start(context: Context, prefix: String?, no: String?) {
|
||||
val starter = Intent(context, IntImpQueryDetailsActivity::class.java)
|
||||
.putExtra(Constant.Key.ID, maWbId?.toString() ?: "")
|
||||
.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)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -18,5 +18,11 @@ class IntImpQueryViewHolder(view: View) :
|
||||
|
||||
// 注册整行点击事件
|
||||
notifyItemClick(position, binding.ll)
|
||||
|
||||
// 侧滑菜单 - 修改按钮
|
||||
binding.btnEdit.setOnClickListener {
|
||||
binding.swipeMenu.quickClose()
|
||||
clickListener?.onItemClick(position, 2000) // type=2000表示修改操作
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,6 @@ 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.common.Constant
|
||||
import com.lukouguoji.module_base.http.net.NetApply
|
||||
import com.lukouguoji.module_base.ktx.launchLoadingCollect
|
||||
import com.lukouguoji.module_base.ktx.showToast
|
||||
@@ -18,7 +17,8 @@ import com.lukouguoji.module_base.ktx.toRequestBody
|
||||
class IntImpQueryDetailsViewModel : BaseViewModel() {
|
||||
|
||||
// ==================== 基础数据 ====================
|
||||
var maWbId: String = "" // 运单主键ID
|
||||
var prefix: String = "" // 运单号前缀
|
||||
var no: String = "" // 运单号主体
|
||||
|
||||
// ==================== Tab管理 ====================
|
||||
val currentTab = MutableLiveData(0) // 当前Tab索引 (0/1/2)
|
||||
@@ -50,7 +50,8 @@ class IntImpQueryDetailsViewModel : BaseViewModel() {
|
||||
* 初始化(从Intent获取maWbId)
|
||||
*/
|
||||
fun initOnCreated(intent: Intent) {
|
||||
maWbId = intent.getStringExtra(Constant.Key.ID) ?: ""
|
||||
prefix = intent.getStringExtra("prefix") ?: ""
|
||||
no = intent.getStringExtra("no") ?: ""
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -64,18 +65,12 @@ class IntImpQueryDetailsViewModel : BaseViewModel() {
|
||||
* 加载详情数据
|
||||
*/
|
||||
fun loadDetails() {
|
||||
if (maWbId.isEmpty()) {
|
||||
showToast("运单ID为空")
|
||||
if (prefix.isEmpty() || no.isEmpty()) {
|
||||
showToast("运单号参数为空")
|
||||
return
|
||||
}
|
||||
|
||||
val maWbIdValue = maWbId.toLongOrNull()
|
||||
if (maWbIdValue == null) {
|
||||
showToast("运单ID格式错误")
|
||||
return
|
||||
}
|
||||
|
||||
val params = mapOf("maWbId" to maWbIdValue).toRequestBody()
|
||||
val params = mapOf("prefix" to prefix, "no" to no).toRequestBody()
|
||||
|
||||
launchLoadingCollect({ NetApply.api.getIntImpQueryDetails(params) }) {
|
||||
onSuccess = { result ->
|
||||
|
||||
@@ -0,0 +1,368 @@
|
||||
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 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, "I", "") }) {
|
||||
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() {
|
||||
launchCollect({ NetApply.api.getGjjPackTypeList() }) {
|
||||
onSuccess = { result ->
|
||||
val list = result.data?.mapNotNull { bean ->
|
||||
if (bean.packageName.isNotEmpty()) {
|
||||
KeyValue(bean.packageName, bean.packageName)
|
||||
} else null
|
||||
} ?: emptyList()
|
||||
packageTypeList.value = list
|
||||
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,6 +4,7 @@ import android.app.Activity
|
||||
import android.content.Intent
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import com.lukouguoji.gjj.R
|
||||
import com.lukouguoji.gjj.activity.IntImpQueryEditActivity
|
||||
import com.lukouguoji.gjj.dialog.IntImpQueryFilterDialogModel
|
||||
import com.lukouguoji.gjj.holder.IntImpQueryViewHolder
|
||||
import com.lukouguoji.gjj.activity.IntImpQueryDetailsActivity
|
||||
@@ -152,7 +153,17 @@ class IntImpQueryViewModel : BasePageViewModel(), IOnItemClickListener {
|
||||
override fun onItemClick(position: Int, type: Int) {
|
||||
val list = pageModel.rv?.commonAdapter()?.items as? List<IntImpQueryBean> ?: return
|
||||
val bean = list.getOrNull(position) ?: return
|
||||
IntImpQueryDetailsActivity.start(getTopActivity(), bean.maWbId)
|
||||
|
||||
when (type) {
|
||||
2000 -> {
|
||||
// 侧滑菜单 - 修改操作
|
||||
IntImpQueryEditActivity.start(getTopActivity(), bean.maWbId, bean.prefix, bean.no)
|
||||
}
|
||||
else -> {
|
||||
// 默认点击 - 进入详情
|
||||
IntImpQueryDetailsActivity.start(getTopActivity(), bean.prefix, bean.no)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun initAgentList() {
|
||||
|
||||
326
module_gjj/src/main/res/layout/activity_int_imp_query_edit.xml
Normal file
326
module_gjj/src/main/res/layout/activity_int_imp_query_edit.xml
Normal file
@@ -0,0 +1,326 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<data>
|
||||
<import type="com.lukouguoji.module_base.ui.weight.data.layout.DataLayoutType" />
|
||||
|
||||
<variable
|
||||
name="viewModel"
|
||||
type="com.lukouguoji.gjj.viewModel.IntImpQueryEditViewModel" />
|
||||
</data>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/color_f2"
|
||||
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">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:padding="15dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/bg_white_radius_8"
|
||||
android:orientation="vertical"
|
||||
android:padding="15dp">
|
||||
|
||||
<!-- 第1行:运单号(禁用)| 代理人(SPINNER)| 特码(SPINNER)-->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
enable="@{false}"
|
||||
title='@{"运单号"}'
|
||||
titleLength="@{5}"
|
||||
type="@{DataLayoutType.INPUT}"
|
||||
value='@{viewModel.dataBean.wbNo}' />
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
enable="@{true}"
|
||||
hint='@{"请选择代理人"}'
|
||||
list="@{viewModel.agentList}"
|
||||
title='@{"代理人"}'
|
||||
titleLength="@{5}"
|
||||
type="@{DataLayoutType.SPINNER}"
|
||||
value='@={viewModel.dataBean.agentCode}' />
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
enable="@{true}"
|
||||
hint='@{"请选择特码"}'
|
||||
list="@{viewModel.spCodeList}"
|
||||
title='@{"特码"}'
|
||||
titleLength="@{5}"
|
||||
type="@{DataLayoutType.SPINNER}"
|
||||
value='@={viewModel.dataBean.spCode}' />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 第2行:运单件数(禁用)| 运单重量(禁用)| 业务类型(禁用)-->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
enable="@{false}"
|
||||
title='@{"运单件数"}'
|
||||
titleLength="@{5}"
|
||||
type="@{DataLayoutType.INPUT}"
|
||||
value='@{viewModel.dataBean.awbPc != null ? String.valueOf(viewModel.dataBean.awbPc) : ``}' />
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
enable="@{false}"
|
||||
title='@{"运单重量"}'
|
||||
titleLength="@{5}"
|
||||
type="@{DataLayoutType.INPUT}"
|
||||
value='@{viewModel.dataBean.awbWeight != null ? String.valueOf(viewModel.dataBean.awbWeight) : ``}' />
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
enable="@{false}"
|
||||
title='@{"业务类型"}'
|
||||
titleLength="@{5}"
|
||||
type="@{DataLayoutType.INPUT}"
|
||||
value='@{viewModel.dataBean.businessName}' />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 第3行:入库件数(禁用)| 入库重量(禁用)| 计费重量(禁用)-->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
enable="@{false}"
|
||||
title='@{"入库件数"}'
|
||||
titleLength="@{5}"
|
||||
type="@{DataLayoutType.INPUT}"
|
||||
value='@{viewModel.dataBean.inPc != null ? String.valueOf(viewModel.dataBean.inPc) : ``}' />
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
enable="@{false}"
|
||||
title='@{"入库重量"}'
|
||||
titleLength="@{5}"
|
||||
type="@{DataLayoutType.INPUT}"
|
||||
value='@{viewModel.dataBean.inWeight != null ? String.valueOf(viewModel.dataBean.inWeight) : ``}' />
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
enable="@{false}"
|
||||
title='@{"计费重量"}'
|
||||
titleLength="@{5}"
|
||||
type="@{DataLayoutType.INPUT}"
|
||||
value='@{viewModel.dataBean.cashWeight != null ? String.valueOf(viewModel.dataBean.cashWeight) : ``}' />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 第4行:承运人(禁用)| 航程(禁用)| 包装类型(SPINNER)-->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
enable="@{false}"
|
||||
title='@{"承运人"}'
|
||||
titleLength="@{5}"
|
||||
type="@{DataLayoutType.INPUT}"
|
||||
value='@{viewModel.dataBean.by1}' />
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
enable="@{false}"
|
||||
title='@{"航程"}'
|
||||
titleLength="@{5}"
|
||||
type="@{DataLayoutType.INPUT}"
|
||||
value='@{viewModel.dataBean.range}' />
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
enable="@{true}"
|
||||
hint='@{"请选择包装类型"}'
|
||||
list="@{viewModel.packageTypeList}"
|
||||
title='@{"包装类型"}'
|
||||
titleLength="@{5}"
|
||||
type="@{DataLayoutType.SPINNER}"
|
||||
value='@={viewModel.dataBean.packageType}' />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 第5行:品名(中)(禁用)| 品名(英)(禁用)| UN编号(禁用)-->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
enable="@{false}"
|
||||
title='@{"品名(中)"}'
|
||||
titleLength="@{5}"
|
||||
type="@{DataLayoutType.INPUT}"
|
||||
value='@{viewModel.dataBean.goodsCn}' />
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
enable="@{false}"
|
||||
title='@{"品名(英)"}'
|
||||
titleLength="@{5}"
|
||||
type="@{DataLayoutType.INPUT}"
|
||||
value='@{viewModel.dataBean.goods}' />
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
enable="@{false}"
|
||||
title='@{"UN编号"}'
|
||||
titleLength="@{5}"
|
||||
type="@{DataLayoutType.INPUT}"
|
||||
value='@{viewModel.dataBean.unNumber}' />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 第6行:运单类型(SPINNER)| 锁定状态(SPINNER)-->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
enable="@{true}"
|
||||
hint='@{"请选择运单类型"}'
|
||||
list="@{viewModel.waybillTypeList}"
|
||||
title='@{"运单类型"}'
|
||||
titleLength="@{5}"
|
||||
type="@{DataLayoutType.SPINNER}"
|
||||
value='@={viewModel.dataBean.awbType}' />
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
enable="@{true}"
|
||||
hint='@{"请选择锁定状态"}'
|
||||
list="@{viewModel.lockStateList}"
|
||||
title='@{"锁定状态"}'
|
||||
titleLength="@{5}"
|
||||
type="@{DataLayoutType.SPINNER}"
|
||||
value='@={viewModel.dataBean.lockState}' />
|
||||
|
||||
<Space
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 第7行:备注(多行输入) -->
|
||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
enable="@{true}"
|
||||
hint='@{"请输入备注"}'
|
||||
inputHeight="@{80}"
|
||||
title='@{"备注"}'
|
||||
titleLength="@{5}"
|
||||
type="@{DataLayoutType.INPUT}"
|
||||
value='@={viewModel.dataBean.remark}' />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 底部操作按钮 -->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="56dp"
|
||||
android:layout_marginTop="24dp"
|
||||
android:gravity="center"
|
||||
android:paddingHorizontal="15dp">
|
||||
|
||||
<!-- 取消按钮 -->
|
||||
<TextView
|
||||
style="@style/tv_bottom_btn"
|
||||
android:layout_width="120dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:onClick="@{()-> viewModel.cancel()}"
|
||||
android:text="取消" />
|
||||
|
||||
<!-- 保存按钮 -->
|
||||
<TextView
|
||||
style="@style/tv_bottom_btn"
|
||||
android:layout_width="120dp"
|
||||
android:onClick="@{()-> viewModel.submit()}"
|
||||
android:text="保存" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</ScrollView>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</layout>
|
||||
@@ -185,7 +185,7 @@
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 第5行: 运单类型、库位、UN编号 -->
|
||||
<!-- 第5行: 运单类型、UN编号 -->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
@@ -202,16 +202,6 @@
|
||||
type="@{DataLayoutType.INPUT}"
|
||||
value='@{(String)viewModel.maWbData.get("awbName")}' />
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
enable="@{false}"
|
||||
title='@{"库位"}'
|
||||
titleLength="@{5}"
|
||||
type="@{DataLayoutType.INPUT}"
|
||||
value='@{(String)viewModel.maWbData.get("location")}' />
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
@@ -222,6 +212,11 @@
|
||||
type="@{DataLayoutType.INPUT}"
|
||||
value='@{(String)viewModel.maWbData.get("unNumber")}' />
|
||||
|
||||
<Space
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 第6行: 品名(中)占2列、锁定状态占1列 -->
|
||||
|
||||
@@ -8,15 +8,28 @@
|
||||
type="com.lukouguoji.module_base.bean.IntImpQueryBean" />
|
||||
</data>
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:id="@+id/ll"
|
||||
<!-- 外层容器承载间距 -->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="15dp"
|
||||
android:layout_marginVertical="5dp"
|
||||
android:background="@drawable/bg_item"
|
||||
android:orientation="horizontal"
|
||||
android:padding="10dp">
|
||||
android:orientation="vertical">
|
||||
|
||||
<!-- 侧滑布局 -->
|
||||
<com.mcxtzhang.swipemenulib.SwipeMenuLayout
|
||||
android:id="@+id/swipe_menu"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<!-- 主列表项容器 -->
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:id="@+id/ll"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/bg_item"
|
||||
android:orientation="horizontal"
|
||||
android:padding="10dp">
|
||||
|
||||
<!-- 左侧图标 -->
|
||||
<ImageView
|
||||
@@ -260,14 +273,33 @@
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 右侧箭头 -->
|
||||
<ImageView
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:src="@drawable/img_pda_right" />
|
||||
<!-- 右侧箭头 -->
|
||||
<ImageView
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:src="@drawable/img_pda_right" />
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
<!-- 侧滑菜单按钮区 -->
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<!-- 修改按钮 -->
|
||||
<TextView
|
||||
android:id="@+id/btn_edit"
|
||||
style="@style/tv_item_action"
|
||||
android:background="@color/colorPrimary"
|
||||
android:text="修改" />
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
</com.mcxtzhang.swipemenulib.SwipeMenuLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</layout>
|
||||
|
||||
@@ -82,13 +82,13 @@
|
||||
android:textColor="@android:color/black"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<!-- 入库时间 -->
|
||||
<!-- 入库时间(取 opDate) -->
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1.3"
|
||||
android:gravity="center"
|
||||
android:text="@{bean.inDate != null && bean.inDate.length() >= 16 ? bean.inDate.substring(0, 16) : (bean.inDate ?? ``)}"
|
||||
android:text="@{bean.opDate != null && bean.opDate.length() >= 16 ? bean.opDate.substring(0, 16) : (bean.opDate ?? ``)}"
|
||||
android:textColor="@android:color/black"
|
||||
android:textSize="14sp" />
|
||||
|
||||
|
||||
Reference in New Issue
Block a user