Compare commits
2 Commits
1fa0f6dde4
...
4117cbb489
| Author | SHA1 | Date | |
|---|---|---|---|
| 4117cbb489 | |||
| 4451b790de |
@@ -29,7 +29,8 @@ data class GjjHaWb(
|
|||||||
var opDate: String = "",
|
var opDate: String = "",
|
||||||
var billsNo: String = "",
|
var billsNo: String = "",
|
||||||
var remark: String = "",
|
var remark: String = "",
|
||||||
var response: String = ""
|
var response: String = "",
|
||||||
|
var tallyStatus: String = ""
|
||||||
) : Serializable {
|
) : Serializable {
|
||||||
@Transient
|
@Transient
|
||||||
val checked: ObservableBoolean = ObservableBoolean(false)
|
val checked: ObservableBoolean = ObservableBoolean(false)
|
||||||
|
|||||||
@@ -963,7 +963,7 @@ interface Api {
|
|||||||
* 接口路径: /IntImpStorage/inStorage
|
* 接口路径: /IntImpStorage/inStorage
|
||||||
*/
|
*/
|
||||||
@POST("IntImpStorage/inStorage")
|
@POST("IntImpStorage/inStorage")
|
||||||
suspend fun inIntImpStorage(@Query("location") location: String, @Body data: RequestBody): BaseResultBean<Boolean>
|
suspend fun inIntImpStorage(@Body data: RequestBody): BaseResultBean<Boolean>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 国际进港提取记录-分页查询
|
* 国际进港提取记录-分页查询
|
||||||
|
|||||||
@@ -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.ItemIntImpStorageUseSubBinding
|
import com.lukouguoji.gjj.databinding.ItemIntImpStorageUseSubBinding
|
||||||
import com.lukouguoji.module_base.base.BaseViewHolder
|
import com.lukouguoji.module_base.base.BaseViewHolder
|
||||||
import com.lukouguoji.module_base.bean.GjcMaWb
|
|
||||||
import com.lukouguoji.module_base.bean.GjcStorageUse
|
import com.lukouguoji.module_base.bean.GjcStorageUse
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -19,27 +17,10 @@ class IntImpStorageUseSubViewHolder(view: View) :
|
|||||||
binding.position = position
|
binding.position = position
|
||||||
binding.executePendingBindings()
|
binding.executePendingBindings()
|
||||||
|
|
||||||
// 单选框点击切换选择状态(反向联动主列表)
|
// 单选框点击切换选择状态
|
||||||
binding.ivCheckbox.setOnClickListener {
|
binding.ivCheckbox.setOnClickListener {
|
||||||
// 切换子列表项的选择状态
|
bean.checked.set(!bean.checked.get())
|
||||||
val newCheckedState = !bean.checked.get()
|
|
||||||
bean.checked.set(newCheckedState)
|
|
||||||
binding.executePendingBindings()
|
binding.executePendingBindings()
|
||||||
|
|
||||||
// 反向联动主列表项(仅在勾选时联动)
|
|
||||||
updateParentCheckState(newCheckedState)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 更新父列表项的选择状态
|
|
||||||
*/
|
|
||||||
private fun updateParentCheckState(newCheckedState: Boolean) {
|
|
||||||
val recyclerView = itemView.parent as? RecyclerView ?: return
|
|
||||||
val parentBean = recyclerView.tag as? GjcMaWb ?: return
|
|
||||||
|
|
||||||
if (newCheckedState) {
|
|
||||||
parentBean.checked.set(true)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,18 +20,10 @@ class IntImpStorageUseViewHolder(view: View) :
|
|||||||
binding.position = position
|
binding.position = position
|
||||||
binding.executePendingBindings()
|
binding.executePendingBindings()
|
||||||
|
|
||||||
// 图标点击切换选择状态(联动子列表)
|
// 图标点击切换选择状态
|
||||||
binding.ivIcon.setOnClickListener {
|
binding.ivIcon.setOnClickListener {
|
||||||
val newCheckedState = !bean.checked.get()
|
bean.checked.set(!bean.checked.get())
|
||||||
bean.checked.set(newCheckedState)
|
|
||||||
|
|
||||||
// 联动勾选/取消所有子列表项
|
|
||||||
bean.storageUseList?.forEach { storageUse ->
|
|
||||||
storageUse.checked.set(newCheckedState)
|
|
||||||
}
|
|
||||||
|
|
||||||
binding.executePendingBindings()
|
binding.executePendingBindings()
|
||||||
binding.rvSub.adapter?.notifyDataSetChanged()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 展开按钮点击事件
|
// 展开按钮点击事件
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ class IntImpLoadingListEditViewModel : BaseViewModel() {
|
|||||||
val bean = Gson().fromJson(jsonData, GjjManifest::class.java)
|
val bean = Gson().fromJson(jsonData, GjjManifest::class.java)
|
||||||
dataBean.value = bean
|
dataBean.value = bean
|
||||||
// 初始化可编辑字段
|
// 初始化可编辑字段
|
||||||
location.value = bean.location
|
location.value = bean.locationTally
|
||||||
totalPcStr.value = bean.totalPc.toString()
|
totalPcStr.value = bean.totalPc.toString()
|
||||||
pcStr.value = bean.pc.toString()
|
pcStr.value = bean.pc.toString()
|
||||||
weightStr.value = bean.weight.toString()
|
weightStr.value = bean.weight.toString()
|
||||||
@@ -58,7 +58,6 @@ class IntImpLoadingListEditViewModel : BaseViewModel() {
|
|||||||
val bean = dataBean.value ?: return
|
val bean = dataBean.value ?: return
|
||||||
|
|
||||||
// 同步可编辑字段回 bean
|
// 同步可编辑字段回 bean
|
||||||
bean.location = location.value ?: ""
|
|
||||||
bean.totalPc = totalPcStr.value?.toLongOrNull() ?: 0
|
bean.totalPc = totalPcStr.value?.toLongOrNull() ?: 0
|
||||||
bean.pc = pcStr.value?.toLongOrNull() ?: 0
|
bean.pc = pcStr.value?.toLongOrNull() ?: 0
|
||||||
bean.weight = weightStr.value?.toDoubleOrNull() ?: 0.0
|
bean.weight = weightStr.value?.toDoubleOrNull() ?: 0.0
|
||||||
|
|||||||
@@ -230,9 +230,13 @@ class IntImpStorageUseViewModel : BasePageViewModel() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
val body = maWbListForInStorage.toRequestBody()
|
val body = mapOf(
|
||||||
|
"location" to locationName,
|
||||||
|
"locationId" to locationId.toLongOrNull(),
|
||||||
|
"warehouseList" to maWbListForInStorage
|
||||||
|
).toRequestBody()
|
||||||
|
|
||||||
launchLoadingCollect({ NetApply.api.inIntImpStorage(locationName, body) }) {
|
launchLoadingCollect({ NetApply.api.inIntImpStorage(body) }) {
|
||||||
onSuccess = {
|
onSuccess = {
|
||||||
showToast("入库成功")
|
showToast("入库成功")
|
||||||
viewModelScope.launch {
|
viewModelScope.launch {
|
||||||
|
|||||||
@@ -83,7 +83,7 @@
|
|||||||
title='@{"运单件数"}'
|
title='@{"运单件数"}'
|
||||||
titleLength="@{5}"
|
titleLength="@{5}"
|
||||||
type="@{DataLayoutType.INPUT}"
|
type="@{DataLayoutType.INPUT}"
|
||||||
value='@{viewModel.maWbData.get("pc") != null ? String.valueOf((int)Math.round(((Double)viewModel.maWbData.get("pc")))) : ``}' />
|
value='@{viewModel.maWbData.get("awbPc") != null ? String.valueOf((int)Math.round(((Double)viewModel.maWbData.get("awbPc")))) : ``}' />
|
||||||
|
|
||||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
|
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
@@ -93,7 +93,7 @@
|
|||||||
title='@{"运单重量"}'
|
title='@{"运单重量"}'
|
||||||
titleLength="@{5}"
|
titleLength="@{5}"
|
||||||
type="@{DataLayoutType.INPUT}"
|
type="@{DataLayoutType.INPUT}"
|
||||||
value='@{viewModel.maWbData.get("weight") != null ? String.valueOf(viewModel.maWbData.get("weight")) : ``}' />
|
value='@{viewModel.maWbData.get("awbWeight") != null ? String.valueOf(viewModel.maWbData.get("awbWeight")) : ``}' />
|
||||||
|
|
||||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
|
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
|
|||||||
@@ -104,7 +104,7 @@
|
|||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:maxLines="1"
|
android:maxLines="1"
|
||||||
android:ellipsize="end"
|
android:ellipsize="end"
|
||||||
android:text="@{bean.lastMftStatus ?? ``}"
|
android:text="@{bean.tallyStatus ?? ``}"
|
||||||
android:textColor="@color/colorPrimary"
|
android:textColor="@color/colorPrimary"
|
||||||
android:textSize="14sp" />
|
android:textSize="14sp" />
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user