feat: 新增ULD管理功能页面
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -286,6 +286,14 @@
|
|||||||
android:name=".page.car.list.CarListActivity"
|
android:name=".page.car.list.CarListActivity"
|
||||||
android:configChanges="orientation|keyboardHidden"
|
android:configChanges="orientation|keyboardHidden"
|
||||||
android:screenOrientation="userLandscape" />
|
android:screenOrientation="userLandscape" />
|
||||||
|
<activity
|
||||||
|
android:name=".page.uld.list.UldListActivity"
|
||||||
|
android:configChanges="orientation|keyboardHidden"
|
||||||
|
android:screenOrientation="userLandscape" />
|
||||||
|
<activity
|
||||||
|
android:name=".page.uld.edit.UldEditActivity"
|
||||||
|
android:configChanges="orientation|keyboardHidden"
|
||||||
|
android:screenOrientation="userLandscape" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".page.car.add.CarDetailsActivity"
|
android:name=".page.car.add.CarDetailsActivity"
|
||||||
android:configChanges="orientation|keyboardHidden"
|
android:configChanges="orientation|keyboardHidden"
|
||||||
|
|||||||
@@ -0,0 +1,32 @@
|
|||||||
|
package com.lukouguoji.aerologic.page.uld.edit
|
||||||
|
|
||||||
|
import android.content.Context
|
||||||
|
import android.content.Intent
|
||||||
|
import android.os.Bundle
|
||||||
|
import com.lukouguoji.aerologic.R
|
||||||
|
import com.lukouguoji.aerologic.databinding.ActivityUldEditBinding
|
||||||
|
import com.lukouguoji.module_base.base.BaseBindingActivity
|
||||||
|
import com.lukouguoji.module_base.common.Constant
|
||||||
|
|
||||||
|
class UldEditActivity : BaseBindingActivity<ActivityUldEditBinding, UldEditViewModel>() {
|
||||||
|
|
||||||
|
override fun layoutId() = R.layout.activity_uld_edit
|
||||||
|
|
||||||
|
override fun viewModelClass() = UldEditViewModel::class.java
|
||||||
|
|
||||||
|
override fun initOnCreate(savedInstanceState: Bundle?) {
|
||||||
|
viewModel.initOnCreate(intent)
|
||||||
|
setBackArrow("ULD${viewModel.pageType.value!!.title}")
|
||||||
|
binding.viewModel = viewModel
|
||||||
|
}
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
@JvmStatic
|
||||||
|
fun start(context: Context, id: String = "", modify: Boolean = id.isEmpty()) {
|
||||||
|
val starter = Intent(context, UldEditActivity::class.java)
|
||||||
|
.putExtra(Constant.Key.ID, id)
|
||||||
|
.putExtra(Constant.Key.DATA, modify)
|
||||||
|
context.startActivity(starter)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,84 @@
|
|||||||
|
package com.lukouguoji.aerologic.page.uld.edit
|
||||||
|
|
||||||
|
import android.content.Intent
|
||||||
|
import androidx.lifecycle.MutableLiveData
|
||||||
|
import com.lukouguoji.module_base.base.BaseViewModel
|
||||||
|
import com.lukouguoji.module_base.bean.ULDBean
|
||||||
|
import com.lukouguoji.module_base.common.Constant
|
||||||
|
import com.lukouguoji.module_base.common.DetailsPageType
|
||||||
|
import com.lukouguoji.module_base.http.net.NetApply
|
||||||
|
import com.lukouguoji.module_base.ktx.launchLoadingCollect
|
||||||
|
import com.lukouguoji.module_base.ktx.noNull
|
||||||
|
import com.lukouguoji.module_base.ktx.showToast
|
||||||
|
import com.lukouguoji.module_base.ktx.toRequestBody
|
||||||
|
import dev.DevUtils
|
||||||
|
import dev.utils.app.info.KeyValue
|
||||||
|
|
||||||
|
class UldEditViewModel : BaseViewModel() {
|
||||||
|
|
||||||
|
var id = ""
|
||||||
|
|
||||||
|
val pageType = MutableLiveData(DetailsPageType.Add)
|
||||||
|
|
||||||
|
val uldBean = MutableLiveData(ULDBean())
|
||||||
|
|
||||||
|
val statusList = MutableLiveData<List<KeyValue>>(
|
||||||
|
listOf(
|
||||||
|
KeyValue("正常", "0"),
|
||||||
|
KeyValue("故障", "1"),
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
// 所属航司下拉列表(mock,后续替换为接口)
|
||||||
|
val carrierList = MutableLiveData<List<KeyValue>>(
|
||||||
|
listOf(
|
||||||
|
KeyValue("MU - 东方航空", "MU"),
|
||||||
|
KeyValue("CA - 国航", "CA"),
|
||||||
|
KeyValue("CZ - 南方航空", "CZ"),
|
||||||
|
KeyValue("HO - 吉祥航空", "HO"),
|
||||||
|
KeyValue("FM - 上海航空", "FM"),
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
fun initOnCreate(intent: Intent) {
|
||||||
|
id = intent.getStringExtra(Constant.Key.ID) ?: ""
|
||||||
|
val modify = intent.getBooleanExtra(Constant.Key.DATA, false)
|
||||||
|
pageType.value = if (id.isEmpty()) DetailsPageType.Add
|
||||||
|
else if (modify) DetailsPageType.Modify else DetailsPageType.Details
|
||||||
|
|
||||||
|
getData()
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun getData() {
|
||||||
|
if (id.isEmpty()) return
|
||||||
|
launchLoadingCollect({
|
||||||
|
NetApply.api.queryUldByCode(id)
|
||||||
|
}) {
|
||||||
|
onSuccess = {
|
||||||
|
uldBean.value = it.data ?: ULDBean()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun onSaveClick() {
|
||||||
|
val bean = uldBean.value ?: return
|
||||||
|
if (bean.uld.isBlank()) {
|
||||||
|
showToast("ULD编号不能为空")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
val isAdd = pageType.value == DetailsPageType.Add
|
||||||
|
launchLoadingCollect({
|
||||||
|
if (isAdd) NetApply.api.saveUld(bean.toRequestBody())
|
||||||
|
else NetApply.api.updateUld(bean.toRequestBody())
|
||||||
|
}) {
|
||||||
|
onSuccess = {
|
||||||
|
showToast(it.msg.noNull(if (isAdd) "新增成功" else "修改成功"))
|
||||||
|
if (isAdd) uldBean.value = ULDBean() else getData()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun onCancelClick() {
|
||||||
|
DevUtils.getTopActivity().finish()
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
package com.lukouguoji.aerologic.page.uld.list
|
||||||
|
|
||||||
|
import android.content.Context
|
||||||
|
import android.content.Intent
|
||||||
|
import android.os.Bundle
|
||||||
|
import com.lukouguoji.aerologic.R
|
||||||
|
import com.lukouguoji.aerologic.databinding.ActivityUldListBinding
|
||||||
|
import com.lukouguoji.module_base.base.BaseBindingActivity
|
||||||
|
import com.lukouguoji.module_base.ktx.addOnItemClickListener
|
||||||
|
import com.lukouguoji.module_base.ktx.getLifecycleOwner
|
||||||
|
|
||||||
|
class UldListActivity : BaseBindingActivity<ActivityUldListBinding, UldListViewModel>() {
|
||||||
|
|
||||||
|
override fun layoutId(): Int {
|
||||||
|
return R.layout.activity_uld_list
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun viewModelClass(): Class<UldListViewModel> {
|
||||||
|
return UldListViewModel::class.java
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun initOnCreate(savedInstanceState: Bundle?) {
|
||||||
|
setBackArrow("ULD管理")
|
||||||
|
binding.viewModel = viewModel
|
||||||
|
viewModel.pageModel.bindSmartRefreshLayout(
|
||||||
|
binding.srl,
|
||||||
|
binding.rv,
|
||||||
|
viewModel,
|
||||||
|
getLifecycleOwner()
|
||||||
|
)
|
||||||
|
binding.rv.addOnItemClickListener(viewModel)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onResume() {
|
||||||
|
super.onResume()
|
||||||
|
viewModel.refresh()
|
||||||
|
}
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
@JvmStatic
|
||||||
|
fun start(context: Context) {
|
||||||
|
context.startActivity(Intent(context, UldListActivity::class.java))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package com.lukouguoji.aerologic.page.uld.list
|
||||||
|
|
||||||
|
import android.view.View
|
||||||
|
import com.lukouguoji.aerologic.databinding.ItemUldListBinding
|
||||||
|
import com.lukouguoji.module_base.base.BaseViewHolder
|
||||||
|
import com.lukouguoji.module_base.bean.ULDBean
|
||||||
|
|
||||||
|
class UldListViewHolder(view: View) : BaseViewHolder<ULDBean, ItemUldListBinding>(view) {
|
||||||
|
override fun onBind(item: Any?, position: Int) {
|
||||||
|
val itemBean = getItemBean(item)!!
|
||||||
|
binding.bean = itemBean
|
||||||
|
notifyItemClick(position, binding.llContent)
|
||||||
|
notifyItemClick(position, binding.tvModify)
|
||||||
|
notifyItemClick(position, binding.tvDelete)
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,116 @@
|
|||||||
|
package com.lukouguoji.aerologic.page.uld.list
|
||||||
|
|
||||||
|
import android.app.Activity
|
||||||
|
import android.content.Intent
|
||||||
|
import androidx.lifecycle.MutableLiveData
|
||||||
|
import com.lukouguoji.aerologic.R
|
||||||
|
import com.lukouguoji.aerologic.page.uld.edit.UldEditActivity
|
||||||
|
import com.lukouguoji.module_base.base.BasePageViewModel
|
||||||
|
import com.lukouguoji.module_base.bean.ULDBean
|
||||||
|
import com.lukouguoji.module_base.common.Constant
|
||||||
|
import com.lukouguoji.module_base.http.net.NetApply
|
||||||
|
import com.lukouguoji.module_base.ktx.commonAdapter
|
||||||
|
import com.lukouguoji.module_base.ktx.launchLoadingCollect
|
||||||
|
import com.lukouguoji.module_base.ktx.noNull
|
||||||
|
import com.lukouguoji.module_base.ktx.showToast
|
||||||
|
import com.lukouguoji.module_base.model.ConfirmDialogModel
|
||||||
|
import com.lukouguoji.module_base.ktx.toRequestBody
|
||||||
|
import com.lukouguoji.module_base.model.ScanModel
|
||||||
|
import dev.DevUtils
|
||||||
|
import dev.utils.app.info.KeyValue
|
||||||
|
|
||||||
|
class UldListViewModel : BasePageViewModel() {
|
||||||
|
|
||||||
|
// 搜索条件
|
||||||
|
val status = MutableLiveData("")
|
||||||
|
val uldSuffix = MutableLiveData("")
|
||||||
|
val uldNo = MutableLiveData("")
|
||||||
|
|
||||||
|
// 状态下拉列表
|
||||||
|
val statusList = MutableLiveData<List<KeyValue>>(
|
||||||
|
listOf(
|
||||||
|
KeyValue("全部", ""),
|
||||||
|
KeyValue("正常", "0"),
|
||||||
|
KeyValue("故障", "1"),
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
// 所属航司下拉列表(mock,后续替换为接口)
|
||||||
|
val carrierList = MutableLiveData<List<KeyValue>>(
|
||||||
|
listOf(
|
||||||
|
KeyValue("全部", ""),
|
||||||
|
KeyValue("MU - 东方航空", "MU"),
|
||||||
|
KeyValue("CA - 国航", "CA"),
|
||||||
|
KeyValue("CZ - 南方航空", "CZ"),
|
||||||
|
KeyValue("HO - 吉祥航空", "HO"),
|
||||||
|
KeyValue("FM - 上海航空", "FM"),
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
// 合计数量
|
||||||
|
val count = MutableLiveData(0L)
|
||||||
|
|
||||||
|
val itemLayoutId = R.layout.item_uld_list
|
||||||
|
val itemViewHolder = UldListViewHolder::class.java
|
||||||
|
|
||||||
|
override fun getData() {
|
||||||
|
launchLoadingCollect({
|
||||||
|
NetApply.api.getUldList(
|
||||||
|
mapOf(
|
||||||
|
"pageNum" to pageModel.page,
|
||||||
|
"pageSize" to pageModel.limit,
|
||||||
|
"status" to status.value?.ifEmpty { null },
|
||||||
|
"uldSuffix" to uldSuffix.value?.ifEmpty { null },
|
||||||
|
"uld" to uldNo.value?.ifEmpty { null },
|
||||||
|
).toRequestBody()
|
||||||
|
)
|
||||||
|
}) {
|
||||||
|
onSuccess = {
|
||||||
|
pageModel.handleListBean(it.toBaseListBean())
|
||||||
|
count.value = it.total
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun onUldScanClick() {
|
||||||
|
ScanModel.startScan(DevUtils.getTopActivity(), Constant.RequestCode.ULD)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun onAddClick() {
|
||||||
|
UldEditActivity.start(DevUtils.getTopActivity())
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onItemClick(position: Int, type: Int) {
|
||||||
|
val bean = pageModel.rv?.commonAdapter()?.getItem(position) as? ULDBean ?: return
|
||||||
|
when (type) {
|
||||||
|
R.id.ll_content -> UldEditActivity.start(DevUtils.getTopActivity(), bean.uld)
|
||||||
|
R.id.tv_modify -> UldEditActivity.start(DevUtils.getTopActivity(), bean.uld, true)
|
||||||
|
R.id.tv_delete -> deleteUld(bean.uld)
|
||||||
|
else -> {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun deleteUld(uld: String) {
|
||||||
|
ConfirmDialogModel("是否确定删除该ULD记录?") {
|
||||||
|
launchLoadingCollect({
|
||||||
|
NetApply.api.deleteUld(uld)
|
||||||
|
}) {
|
||||||
|
onSuccess = {
|
||||||
|
showToast("删除成功")
|
||||||
|
refresh()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}.show()
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
|
||||||
|
if (resultCode == Activity.RESULT_OK && data != null) {
|
||||||
|
when (requestCode) {
|
||||||
|
Constant.RequestCode.ULD -> {
|
||||||
|
uldNo.value = data.getStringExtra(Constant.Result.CODED_CONTENT).noNull()
|
||||||
|
}
|
||||||
|
else -> {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -30,6 +30,7 @@ import com.lukouguoji.aerologic.page.telegram.list.TelegramListActivity
|
|||||||
import com.lukouguoji.aerologic.page.test.PrintActivity
|
import com.lukouguoji.aerologic.page.test.PrintActivity
|
||||||
import com.lukouguoji.aerologic.page.transport.GoodsTransportActivity
|
import com.lukouguoji.aerologic.page.transport.GoodsTransportActivity
|
||||||
import com.lukouguoji.aerologic.page.transportLog.list.TransportLogActivity
|
import com.lukouguoji.aerologic.page.transportLog.list.TransportLogActivity
|
||||||
|
import com.lukouguoji.aerologic.page.uld.list.UldListActivity
|
||||||
import com.lukouguoji.gnc.page.deposit.list.GncDepositListActivity
|
import com.lukouguoji.gnc.page.deposit.list.GncDepositListActivity
|
||||||
import com.lukouguoji.gnc.page.distribution.home.GncDistributionHomeActivity
|
import com.lukouguoji.gnc.page.distribution.home.GncDistributionHomeActivity
|
||||||
import com.lukouguoji.gnc.page.fubang.list.GncFuBangListActivity
|
import com.lukouguoji.gnc.page.fubang.list.GncFuBangListActivity
|
||||||
@@ -548,6 +549,10 @@ class HomeFragment : Fragment() {
|
|||||||
Constant.AuthName.ComprehensiveLog -> {
|
Constant.AuthName.ComprehensiveLog -> {
|
||||||
LogListActivity.start(requireContext())
|
LogListActivity.start(requireContext())
|
||||||
}
|
}
|
||||||
|
// ULD管理
|
||||||
|
Constant.AuthName.ComprehensiveUld -> {
|
||||||
|
UldListActivity.start(requireContext())
|
||||||
|
}
|
||||||
|
|
||||||
else -> {
|
else -> {
|
||||||
Toast.makeText(
|
Toast.makeText(
|
||||||
@@ -950,6 +955,13 @@ class HomeFragment : Fragment() {
|
|||||||
"转运记录"
|
"转运记录"
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
list.add(
|
||||||
|
RightMenu(
|
||||||
|
Constant.AuthName.ComprehensiveUld,
|
||||||
|
R.mipmap.cargo,
|
||||||
|
"ULD管理"
|
||||||
|
)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
else -> {
|
else -> {
|
||||||
|
|||||||
167
app/src/main/res/layout/activity_uld_edit.xml
Normal file
167
app/src/main/res/layout/activity_uld_edit.xml
Normal file
@@ -0,0 +1,167 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<layout xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
|
||||||
|
<data>
|
||||||
|
<import type="com.lukouguoji.module_base.ui.weight.data.layout.DataLayoutType" />
|
||||||
|
<import type="com.lukouguoji.module_base.common.DetailsPageType" />
|
||||||
|
<variable
|
||||||
|
name="viewModel"
|
||||||
|
type="com.lukouguoji.aerologic.page.uld.edit.UldEditViewModel" />
|
||||||
|
</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">
|
||||||
|
|
||||||
|
<!-- Row 1: ULD编号 / 状态 / 自重 -->
|
||||||
|
<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="@{viewModel.pageType == DetailsPageType.Add}"
|
||||||
|
hint='@{"请输入ULD编号"}'
|
||||||
|
title='@{"ULD编号"}'
|
||||||
|
titleLength="@{7}"
|
||||||
|
type="@{DataLayoutType.INPUT}"
|
||||||
|
value='@={viewModel.uldBean.uld}' />
|
||||||
|
|
||||||
|
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
enable="@{viewModel.pageType != DetailsPageType.Details}"
|
||||||
|
hint='@{"请选择状态"}'
|
||||||
|
list="@{viewModel.statusList}"
|
||||||
|
title='@{"状态"}'
|
||||||
|
titleLength="@{5}"
|
||||||
|
type="@{DataLayoutType.SPINNER}"
|
||||||
|
value='@={viewModel.uldBean.status}' />
|
||||||
|
|
||||||
|
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
enable="@{viewModel.pageType != DetailsPageType.Details}"
|
||||||
|
hint='@{"请输入自重"}'
|
||||||
|
title='@{"自重"}'
|
||||||
|
titleLength="@{5}"
|
||||||
|
type="@{DataLayoutType.INPUT}"
|
||||||
|
value='@={viewModel.uldBean.uldWeight}' />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<!-- Row 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="@{viewModel.pageType != DetailsPageType.Details}"
|
||||||
|
hint='@{"请输入最大装载容积"}'
|
||||||
|
title='@{"最大装载容积"}'
|
||||||
|
titleLength="@{7}"
|
||||||
|
type="@{DataLayoutType.INPUT}"
|
||||||
|
value='@={viewModel.uldBean.maxVolume}' />
|
||||||
|
|
||||||
|
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
enable="@{viewModel.pageType != DetailsPageType.Details}"
|
||||||
|
hint='@{"请输入最大载重"}'
|
||||||
|
title='@{"最大载重"}'
|
||||||
|
titleLength="@{5}"
|
||||||
|
type="@{DataLayoutType.INPUT}"
|
||||||
|
value='@={viewModel.uldBean.maxWeight}' />
|
||||||
|
|
||||||
|
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
enable="@{viewModel.pageType != DetailsPageType.Details}"
|
||||||
|
hint='@{"请选择所属航司"}'
|
||||||
|
list="@{viewModel.carrierList}"
|
||||||
|
title='@{"所属航司"}'
|
||||||
|
titleLength="@{5}"
|
||||||
|
type="@{DataLayoutType.SPINNER}"
|
||||||
|
value='@={viewModel.uldBean.carrier}' />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<!-- 备注(全行,多行输入) -->
|
||||||
|
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
|
enable="@{viewModel.pageType != DetailsPageType.Details}"
|
||||||
|
hint='@{"请输入备注"}'
|
||||||
|
inputHeight="@{80}"
|
||||||
|
title='@{"备注"}'
|
||||||
|
titleLength="@{3}"
|
||||||
|
type="@{DataLayoutType.INPUT}"
|
||||||
|
value='@={viewModel.uldBean.remark}' />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<!-- 底部操作按钮 -->
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="56dp"
|
||||||
|
android:layout_marginTop="24dp"
|
||||||
|
android:gravity="center"
|
||||||
|
visible="@{viewModel.pageType != DetailsPageType.Details}">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
style="@style/tv_bottom_btn"
|
||||||
|
android:layout_width="120dp"
|
||||||
|
android:layout_marginEnd="20dp"
|
||||||
|
android:onClick="@{()-> viewModel.onCancelClick()}"
|
||||||
|
android:text="取消" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
style="@style/tv_bottom_btn"
|
||||||
|
android:layout_width="120dp"
|
||||||
|
android:onClick="@{()-> viewModel.onSaveClick()}"
|
||||||
|
android:text="保存" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</ScrollView>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
</layout>
|
||||||
119
app/src/main/res/layout/activity_uld_list.xml
Normal file
119
app/src/main/res/layout/activity_uld_list.xml
Normal file
@@ -0,0 +1,119 @@
|
|||||||
|
<?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.search.layout.SearchLayoutType" />
|
||||||
|
<variable
|
||||||
|
name="viewModel"
|
||||||
|
type="com.lukouguoji.aerologic.page.uld.list.UldListViewModel" />
|
||||||
|
</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" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginHorizontal="10dp"
|
||||||
|
android:layout_marginTop="10dp"
|
||||||
|
android:gravity="center_vertical">
|
||||||
|
|
||||||
|
<com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayout
|
||||||
|
hint='@{"选择状态"}'
|
||||||
|
list="@{viewModel.statusList}"
|
||||||
|
type="@{SearchLayoutType.SPINNER}"
|
||||||
|
value="@={viewModel.status}"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1" />
|
||||||
|
|
||||||
|
<com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayout
|
||||||
|
hint='@{"选择所属航司"}'
|
||||||
|
list="@{viewModel.carrierList}"
|
||||||
|
type="@{SearchLayoutType.SPINNER}"
|
||||||
|
value="@={viewModel.uldSuffix}"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1" />
|
||||||
|
|
||||||
|
<com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayout
|
||||||
|
hint='@{"请输入ULD编号"}'
|
||||||
|
icon="@{@drawable/img_scan}"
|
||||||
|
setOnIconClickListener="@{()-> viewModel.onUldScanClick()}"
|
||||||
|
type="@{SearchLayoutType.INPUT}"
|
||||||
|
value="@={viewModel.uldNo}"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:gravity="center_vertical|start"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:paddingHorizontal="24dp">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="36dp"
|
||||||
|
android:layout_height="36dp"
|
||||||
|
android:onClick="@{()-> viewModel.refresh()}"
|
||||||
|
android:padding="2dp"
|
||||||
|
android:src="@drawable/img_search" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="36dp"
|
||||||
|
android:layout_height="36dp"
|
||||||
|
android:layout_marginLeft="16dp"
|
||||||
|
android:onClick="@{()-> viewModel.onAddClick()}"
|
||||||
|
android:padding="4dp"
|
||||||
|
android:src="@drawable/img_add" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<com.scwang.smart.refresh.layout.SmartRefreshLayout
|
||||||
|
android:id="@+id/srl"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_weight="1">
|
||||||
|
|
||||||
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
android:id="@+id/rv"
|
||||||
|
itemLayoutId="@{viewModel.itemLayoutId}"
|
||||||
|
viewHolder="@{viewModel.itemViewHolder}"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
||||||
|
tools:listitem="@layout/item_uld_list" />
|
||||||
|
|
||||||
|
</com.scwang.smart.refresh.layout.SmartRefreshLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="50dp"
|
||||||
|
android:background="@color/white"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:paddingHorizontal="15dp">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:text='@{"合计:" + viewModel.count + "条"}'
|
||||||
|
android:textColor="@color/bottom_tool_tips_text_color"
|
||||||
|
android:textSize="18sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
</layout>
|
||||||
240
app/src/main/res/layout/item_uld_list.xml
Normal file
240
app/src/main/res/layout/item_uld_list.xml
Normal file
@@ -0,0 +1,240 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools">
|
||||||
|
|
||||||
|
<data>
|
||||||
|
<variable
|
||||||
|
name="bean"
|
||||||
|
type="com.lukouguoji.module_base.bean.ULDBean" />
|
||||||
|
</data>
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.LinearLayoutCompat
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<com.mcxtzhang.swipemenulib.SwipeMenuLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
|
<FrameLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.LinearLayoutCompat
|
||||||
|
android:id="@+id/ll_content"
|
||||||
|
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">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/iv_icon"
|
||||||
|
android:layout_width="40dp"
|
||||||
|
android:layout_height="40dp"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:src="@drawable/img_plane"
|
||||||
|
tools:src="@drawable/img_plane" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="10dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<!-- 第一行 -->
|
||||||
|
<androidx.appcompat.widget.LinearLayoutCompat
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
|
<!-- ULD编号 -->
|
||||||
|
<androidx.appcompat.widget.LinearLayoutCompat
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1.5"
|
||||||
|
android:gravity="center_vertical">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
completeSpace="@{5}"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="ULD编号:" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@{bean.uld}"
|
||||||
|
android:textColor="@color/colorPrimary" />
|
||||||
|
|
||||||
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
|
<!-- 状态 -->
|
||||||
|
<androidx.appcompat.widget.LinearLayoutCompat
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="0.8"
|
||||||
|
android:gravity="center_vertical">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
completeSpace="@{3}"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="状态:" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@{bean.statusName()}"
|
||||||
|
android:textColor='@{bean.status.equals("0") ? @color/text_normal : @color/red}' />
|
||||||
|
|
||||||
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
|
<!-- 自重 -->
|
||||||
|
<androidx.appcompat.widget.LinearLayoutCompat
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="0.8"
|
||||||
|
android:gravity="center_vertical">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
completeSpace="@{3}"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="自重:" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@{bean.uldWeight}" />
|
||||||
|
|
||||||
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
|
<!-- 所属航司 -->
|
||||||
|
<androidx.appcompat.widget.LinearLayoutCompat
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="0.8"
|
||||||
|
android:gravity="center_vertical">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
completeSpace="@{5}"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="所属航司:" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@{bean.carrier}" />
|
||||||
|
|
||||||
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
|
<!-- 最大装载容积 -->
|
||||||
|
<androidx.appcompat.widget.LinearLayoutCompat
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1.2"
|
||||||
|
android:gravity="center_vertical">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
completeSpace="@{7}"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="最大装载容积:" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@{bean.maxVolume}" />
|
||||||
|
|
||||||
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
|
<!-- 第二行 -->
|
||||||
|
<androidx.appcompat.widget.LinearLayoutCompat
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="10dp">
|
||||||
|
|
||||||
|
<!-- 最大载重 -->
|
||||||
|
<androidx.appcompat.widget.LinearLayoutCompat
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1.5"
|
||||||
|
android:gravity="center_vertical">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
completeSpace="@{5}"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="最大载重:" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@{bean.maxWeight}" />
|
||||||
|
|
||||||
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
|
<!-- 备注 -->
|
||||||
|
<androidx.appcompat.widget.LinearLayoutCompat
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="3.6"
|
||||||
|
android:gravity="center_vertical">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
completeSpace="@{3}"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="备注:" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@{bean.remark}" />
|
||||||
|
|
||||||
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<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>
|
||||||
|
|
||||||
|
</FrameLayout>
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.LinearLayoutCompat
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_modify"
|
||||||
|
style="@style/tv_item_action"
|
||||||
|
android:background="#8313ef"
|
||||||
|
android:text="修改" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_delete"
|
||||||
|
style="@style/tv_item_action"
|
||||||
|
android:background="@color/red"
|
||||||
|
android:text="删除" />
|
||||||
|
|
||||||
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
|
</com.mcxtzhang.swipemenulib.SwipeMenuLayout>
|
||||||
|
|
||||||
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
</layout>
|
||||||
@@ -15,6 +15,16 @@ data class ULDBean(
|
|||||||
var uld: String = "",
|
var uld: String = "",
|
||||||
var uldFlag: String = "",
|
var uldFlag: String = "",
|
||||||
var uldType: String = "",
|
var uldType: String = "",
|
||||||
|
// 状态 0:正常 1:故障
|
||||||
|
var status: String = "",
|
||||||
|
// 备注
|
||||||
|
var remark: String = "",
|
||||||
){
|
){
|
||||||
val checked = ObservableBoolean(false)
|
val checked = ObservableBoolean(false)
|
||||||
|
|
||||||
|
fun statusName(): String = when (status) {
|
||||||
|
"0" -> "正常"
|
||||||
|
"1" -> "故障"
|
||||||
|
else -> status
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -328,6 +328,9 @@ interface Constant {
|
|||||||
|
|
||||||
// 日志查询
|
// 日志查询
|
||||||
const val ComprehensiveLog = "AppComprehensiveLog"
|
const val ComprehensiveLog = "AppComprehensiveLog"
|
||||||
|
|
||||||
|
// ULD管理
|
||||||
|
const val ComprehensiveUld = "AppComprehensiveUld"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1859,4 +1859,32 @@ interface Api {
|
|||||||
*/
|
*/
|
||||||
@POST("GjAccidentVisa/delete")
|
@POST("GjAccidentVisa/delete")
|
||||||
suspend fun deleteIntImpAccidentVisa(@Body data: RequestBody): BaseResultBean<String>
|
suspend fun deleteIntImpAccidentVisa(@Body data: RequestBody): BaseResultBean<String>
|
||||||
|
|
||||||
|
///////////////////////////////////////////////////////////////////////////
|
||||||
|
// ULD管理
|
||||||
|
///////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取-ULD-列表(分页)
|
||||||
|
*/
|
||||||
|
@POST("eqm/uld/pageQuery")
|
||||||
|
suspend fun getUldList(@Body data: RequestBody): PageInfo<ULDBean>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增-ULD-信息
|
||||||
|
*/
|
||||||
|
@POST("eqm/uld/saveUld")
|
||||||
|
suspend fun saveUld(@Body data: RequestBody): BaseResultBean<Any>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新-ULD-信息
|
||||||
|
*/
|
||||||
|
@POST("eqm/uld/updateUld")
|
||||||
|
suspend fun updateUld(@Body data: RequestBody): BaseResultBean<Any>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除-ULD-信息
|
||||||
|
*/
|
||||||
|
@POST("eqm/uld/deleteUld")
|
||||||
|
suspend fun deleteUld(@Query("uld") uld: String): BaseResultBean<Any>
|
||||||
}
|
}
|
||||||
@@ -36,7 +36,7 @@
|
|||||||
android:background="@null"
|
android:background="@null"
|
||||||
android:paddingStart="10dp"
|
android:paddingStart="10dp"
|
||||||
android:textColor="@color/text_normal"
|
android:textColor="@color/text_normal"
|
||||||
android:textColorHint="@color/text_gray"
|
android:textColorHint="@color/text_gray_l"
|
||||||
android:textSize="14sp" />
|
android:textSize="14sp" />
|
||||||
|
|
||||||
<Spinner
|
<Spinner
|
||||||
|
|||||||
Reference in New Issue
Block a user