feat: 国内进港移库 ui
This commit is contained in:
26
module_gnj/src/main/AndroidManifest.xml
Normal file
26
module_gnj/src/main/AndroidManifest.xml
Normal file
@@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.lukouguoji.gnj">
|
||||
|
||||
<application>
|
||||
<!-- 国内进港移库 - 新增的三个 Activity -->
|
||||
<activity
|
||||
android:name=".page.yiku.list.GnjYiKuListActivity"
|
||||
android:configChanges="orientation|keyboardHidden"
|
||||
android:exported="false"
|
||||
android:screenOrientation="userLandscape" />
|
||||
|
||||
<activity
|
||||
android:name=".page.yiku.details.GnjYiKuDetailsActivity"
|
||||
android:configChanges="orientation|keyboardHidden"
|
||||
android:exported="false"
|
||||
android:screenOrientation="userLandscape" />
|
||||
|
||||
<activity
|
||||
android:name=".page.yiku.edit.GnjYiKuEditActivity"
|
||||
android:configChanges="orientation|keyboardHidden"
|
||||
android:exported="false"
|
||||
android:screenOrientation="userLandscape" />
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
@@ -20,6 +20,25 @@
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
<!-- 国内进港移库 - 新增的三个 Activity -->
|
||||
<activity
|
||||
android:name=".page.yiku.list.GnjYiKuListActivity"
|
||||
android:configChanges="orientation|keyboardHidden"
|
||||
android:exported="false"
|
||||
android:screenOrientation="userLandscape" />
|
||||
|
||||
<activity
|
||||
android:name=".page.yiku.details.GnjYiKuDetailsActivity"
|
||||
android:configChanges="orientation|keyboardHidden"
|
||||
android:exported="false"
|
||||
android:screenOrientation="userLandscape" />
|
||||
|
||||
<activity
|
||||
android:name=".page.yiku.edit.GnjYiKuEditActivity"
|
||||
android:configChanges="orientation|keyboardHidden"
|
||||
android:exported="false"
|
||||
android:screenOrientation="userLandscape" />
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
@@ -0,0 +1,45 @@
|
||||
package com.lukouguoji.gnj.page.yiku.details
|
||||
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.lukouguoji.gnj.R
|
||||
import com.lukouguoji.gnj.databinding.ActivityGnjYikuDetailsBinding
|
||||
import com.lukouguoji.module_base.base.BaseBindingActivity
|
||||
import com.lukouguoji.module_base.common.Constant
|
||||
import com.lukouguoji.module_base.ktx.commonAdapter
|
||||
import com.lukouguoji.module_base.router.ARouterConstants
|
||||
|
||||
/**
|
||||
* 国内进港移库详情页
|
||||
*/
|
||||
@Route(path = ARouterConstants.ACTIVITY_URL_GNJ_YIKU_DETAILS)
|
||||
class GnjYiKuDetailsActivity :
|
||||
BaseBindingActivity<ActivityGnjYikuDetailsBinding, GnjYiKuDetailsViewModel>() {
|
||||
|
||||
override fun layoutId() = R.layout.activity_gnj_yiku_details
|
||||
|
||||
override fun viewModelClass() = GnjYiKuDetailsViewModel::class.java
|
||||
|
||||
override fun initOnCreate(savedInstanceState: Bundle?) {
|
||||
setBackArrow("国内进港移库记录")
|
||||
|
||||
viewModel.initOnCreated(intent)
|
||||
binding.viewModel = viewModel
|
||||
|
||||
// 监听图片列表变化并更新adapter
|
||||
viewModel.imageList.observe(this) { images ->
|
||||
binding.rvImages.commonAdapter()?.refresh(images)
|
||||
}
|
||||
}
|
||||
|
||||
companion object {
|
||||
@JvmStatic
|
||||
fun start(context: Context, id: String) {
|
||||
val starter = Intent(context, GnjYiKuDetailsActivity::class.java)
|
||||
.putExtra(Constant.Key.ID, id)
|
||||
context.startActivity(starter)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
package com.lukouguoji.gnj.page.yiku.details
|
||||
|
||||
import android.content.Intent
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import com.lukouguoji.gnj.R
|
||||
import com.lukouguoji.module_base.base.BaseViewModel
|
||||
import com.lukouguoji.module_base.bean.FileBean
|
||||
import com.lukouguoji.module_base.bean.GnjYiKuBean
|
||||
import com.lukouguoji.module_base.common.Constant
|
||||
import com.lukouguoji.module_base.http.net.NetApply
|
||||
import com.lukouguoji.module_base.impl.ImageSelectViewHolder
|
||||
import com.lukouguoji.module_base.ktx.launchLoadingCollect
|
||||
|
||||
/**
|
||||
* 国内进港移库详情 ViewModel
|
||||
*/
|
||||
class GnjYiKuDetailsViewModel : BaseViewModel() {
|
||||
|
||||
var id = ""
|
||||
|
||||
val dataBean = MutableLiveData<GnjYiKuBean>()
|
||||
|
||||
// 图片列表
|
||||
val imageList = MutableLiveData<MutableList<FileBean>>(mutableListOf())
|
||||
|
||||
// 图片适配器配置
|
||||
val imageItemLayoutId = R.layout.item_image_select
|
||||
val imageItemViewHolder = ImageSelectViewHolder::class.java
|
||||
|
||||
fun initOnCreated(intent: Intent) {
|
||||
id = intent.getStringExtra(Constant.Key.ID) ?: ""
|
||||
getData()
|
||||
}
|
||||
|
||||
private fun getData() {
|
||||
launchLoadingCollect({
|
||||
NetApply.api.getGnjYiKuDetails(id)
|
||||
}) {
|
||||
onSuccess = {
|
||||
val bean = it.data ?: GnjYiKuBean()
|
||||
dataBean.value = bean
|
||||
|
||||
// 处理图片列表
|
||||
val images = bean.getImageList().map { url ->
|
||||
FileBean(path = url)
|
||||
}
|
||||
imageList.value = images.toMutableList()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
package com.lukouguoji.gnj.page.yiku.edit
|
||||
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.lukouguoji.gnj.R
|
||||
import com.lukouguoji.gnj.databinding.ActivityGnjYikuEditBinding
|
||||
import com.lukouguoji.module_base.base.BaseBindingActivity
|
||||
import com.lukouguoji.module_base.common.Constant
|
||||
import com.lukouguoji.module_base.common.DetailsPageType
|
||||
import com.lukouguoji.module_base.ktx.addOnItemClickListener
|
||||
import com.lukouguoji.module_base.ktx.commonAdapter
|
||||
import com.lukouguoji.module_base.router.ARouterConstants
|
||||
|
||||
/**
|
||||
* 国内进港移库编辑页
|
||||
*/
|
||||
@Route(path = ARouterConstants.ACTIVITY_URL_GNJ_YIKU_EDIT)
|
||||
class GnjYiKuEditActivity :
|
||||
BaseBindingActivity<ActivityGnjYikuEditBinding, GnjYiKuEditViewModel>() {
|
||||
|
||||
override fun layoutId() = R.layout.activity_gnj_yiku_edit
|
||||
|
||||
override fun viewModelClass() = GnjYiKuEditViewModel::class.java
|
||||
|
||||
override fun initOnCreate(savedInstanceState: Bundle?) {
|
||||
viewModel.initOnCreated(intent)
|
||||
|
||||
// 根据页面类型设置标题
|
||||
when (viewModel.pageType.value) {
|
||||
DetailsPageType.Add -> setBackArrow("国内进港移库新增")
|
||||
DetailsPageType.Modify -> setBackArrow("国内进港移库编辑")
|
||||
DetailsPageType.Details -> setBackArrow("国内进港移库详情")
|
||||
}
|
||||
|
||||
binding.viewModel = viewModel
|
||||
|
||||
// 绑定图片列表点击事件
|
||||
binding.rvImages.addOnItemClickListener(viewModel)
|
||||
|
||||
// 监听图片列表变化并更新adapter
|
||||
viewModel.imageList.observe(this) { images ->
|
||||
binding.rvImages.commonAdapter()?.refresh(images)
|
||||
}
|
||||
}
|
||||
|
||||
companion object {
|
||||
@JvmStatic
|
||||
fun startForAdd(context: Context) {
|
||||
val starter = Intent(context, GnjYiKuEditActivity::class.java)
|
||||
.putExtra(Constant.Key.PAGE_TYPE, DetailsPageType.Add.name)
|
||||
context.startActivity(starter)
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun startForEdit(context: Context, id: String) {
|
||||
val starter = Intent(context, GnjYiKuEditActivity::class.java)
|
||||
.putExtra(Constant.Key.PAGE_TYPE, DetailsPageType.Modify.name)
|
||||
.putExtra(Constant.Key.ID, id)
|
||||
context.startActivity(starter)
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun startForDetails(context: Context, id: String) {
|
||||
val starter = Intent(context, GnjYiKuEditActivity::class.java)
|
||||
.putExtra(Constant.Key.PAGE_TYPE, DetailsPageType.Details.name)
|
||||
.putExtra(Constant.Key.ID, id)
|
||||
context.startActivity(starter)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,168 @@
|
||||
package com.lukouguoji.gnj.page.yiku.edit
|
||||
|
||||
import android.content.Intent
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import androidx.lifecycle.viewModelScope
|
||||
import com.lukouguoji.gnj.R
|
||||
import com.lukouguoji.module_base.base.BaseViewModel
|
||||
import com.lukouguoji.module_base.bean.FileBean
|
||||
import com.lukouguoji.module_base.bean.GnjYiKuBean
|
||||
import com.lukouguoji.module_base.common.Constant
|
||||
import com.lukouguoji.module_base.common.ConstantEvent
|
||||
import com.lukouguoji.module_base.common.DetailsPageType
|
||||
import com.lukouguoji.module_base.http.net.NetApply
|
||||
import com.lukouguoji.module_base.impl.FlowBus
|
||||
import com.lukouguoji.module_base.impl.ImageSelectViewHolder
|
||||
import com.lukouguoji.module_base.interfaces.IOnItemClickListener
|
||||
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 com.lukouguoji.module_base.util.UploadUtil
|
||||
import dev.utils.app.info.KeyValue
|
||||
import kotlinx.coroutines.launch
|
||||
|
||||
/**
|
||||
* 国内进港移库编辑 ViewModel
|
||||
*/
|
||||
class GnjYiKuEditViewModel : BaseViewModel(), IOnItemClickListener {
|
||||
|
||||
val pageType = MutableLiveData(DetailsPageType.Add)
|
||||
var id = ""
|
||||
|
||||
val dataBean = MutableLiveData(GnjYiKuBean())
|
||||
|
||||
// 运单类型下拉列表
|
||||
val waybillTypeList = MutableLiveData(
|
||||
listOf(
|
||||
KeyValue("转国际进港", "CIII"),
|
||||
KeyValue("转国内出港", "CICO"),
|
||||
KeyValue("转国际出港", "CIIO"),
|
||||
)
|
||||
)
|
||||
|
||||
// 图片列表(初始添加一个空的FileBean用于显示"添加图片"按钮)
|
||||
val imageList = MutableLiveData<MutableList<FileBean>>(
|
||||
mutableListOf(FileBean())
|
||||
)
|
||||
|
||||
// 图片适配器配置
|
||||
val imageItemLayoutId = R.layout.item_image_select
|
||||
val imageItemViewHolder = ImageSelectViewHolder::class.java
|
||||
|
||||
fun initOnCreated(intent: Intent) {
|
||||
// 获取页面类型
|
||||
pageType.value = DetailsPageType.valueOf(
|
||||
intent.getStringExtra(Constant.Key.PAGE_TYPE) ?: DetailsPageType.Add.name
|
||||
)
|
||||
|
||||
// 如果是编辑或详情,加载数据
|
||||
if (pageType.value != DetailsPageType.Add) {
|
||||
id = intent.getStringExtra(Constant.Key.ID) ?: ""
|
||||
loadData()
|
||||
}
|
||||
}
|
||||
|
||||
private fun loadData() {
|
||||
launchLoadingCollect({
|
||||
NetApply.api.getGnjYiKuDetails(id)
|
||||
}) {
|
||||
onSuccess = {
|
||||
val bean = it.data ?: GnjYiKuBean()
|
||||
dataBean.value = bean
|
||||
|
||||
// 处理图片列表
|
||||
val images = bean.getImageList().map { url ->
|
||||
FileBean(path = url)
|
||||
}.toMutableList()
|
||||
|
||||
// 如果是编辑模式,添加一个空的FileBean用于添加新图片
|
||||
if (pageType.value == DetailsPageType.Modify) {
|
||||
images.add(FileBean())
|
||||
}
|
||||
|
||||
imageList.value = images
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 提交保存
|
||||
*/
|
||||
fun submit() {
|
||||
val bean = dataBean.value ?: return
|
||||
|
||||
// 验证必填项
|
||||
if (bean.wbNo.verifyNullOrEmpty("请输入运单号")) return
|
||||
if (bean.pc.verifyNullOrEmpty("请输入件数")) return
|
||||
if (bean.weight.verifyNullOrEmpty("请输入重量")) return
|
||||
|
||||
// 获取所有非空图片
|
||||
val images = imageList.value!!.filter { it.path.isNotEmpty() }
|
||||
|
||||
// 检查图片数量限制(最多7张)
|
||||
if (images.size > 7) {
|
||||
showToast("最多上传7张图片")
|
||||
return
|
||||
}
|
||||
|
||||
launchLoadingCollect({
|
||||
// 1. 上传图片
|
||||
val uploadedUrls = mutableListOf<String>()
|
||||
images.forEach { fileBean ->
|
||||
// 判断是否为已上传的图片(在线URL)
|
||||
if (fileBean.path.startsWith("http")) {
|
||||
uploadedUrls.add(fileBean.path)
|
||||
} else {
|
||||
// 本地图片需要上传
|
||||
val result = UploadUtil.upload(fileBean.path)
|
||||
if (result.verifySuccess()) {
|
||||
uploadedUrls.add(result.data?.newName ?: "")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 2. 提交表单数据
|
||||
val params = mapOf(
|
||||
"id" to id,
|
||||
"wbNo" to bean.wbNo,
|
||||
"pc" to bean.pc,
|
||||
"weight" to bean.weight,
|
||||
"spCode" to bean.spCode,
|
||||
"agentCode" to bean.agentCode,
|
||||
"goods" to bean.goods,
|
||||
"flight" to bean.flight,
|
||||
"route" to bean.route,
|
||||
"awbType" to bean.awbType,
|
||||
"telegramNo" to bean.telegramNo,
|
||||
"remark" to bean.remark,
|
||||
"images" to uploadedUrls.joinToString(","),
|
||||
).toRequestBody(removeEmptyOrNull = true)
|
||||
|
||||
NetApply.api.saveGnjYiKu(params)
|
||||
}) {
|
||||
onSuccess = {
|
||||
showToast(if (pageType.value == DetailsPageType.Add) "新增成功" else "保存成功")
|
||||
|
||||
// 发送刷新事件
|
||||
viewModelScope.launch {
|
||||
FlowBus.with<String>(ConstantEvent.EVENT_REFRESH_GNJ_YIKU_LIST).emit("refresh")
|
||||
}
|
||||
|
||||
// 关闭页面
|
||||
getTopActivity().finish()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理图片删除点击事件
|
||||
*/
|
||||
override fun onItemClick(position: Int, type: Int) {
|
||||
val list = imageList.value!!
|
||||
if (type == R.id.iv_delete && position < list.size) {
|
||||
list.removeAt(position)
|
||||
imageList.value = list
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
package com.lukouguoji.gnj.page.yiku.list
|
||||
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.lukouguoji.gnj.R
|
||||
import com.lukouguoji.gnj.databinding.ActivityGnjYikuListBinding
|
||||
import com.lukouguoji.module_base.base.BaseBindingActivity
|
||||
import com.lukouguoji.module_base.common.ConstantEvent
|
||||
import com.lukouguoji.module_base.impl.FlowBus
|
||||
import com.lukouguoji.module_base.impl.observe
|
||||
import com.lukouguoji.module_base.ktx.getLifecycleOwner
|
||||
import com.lukouguoji.module_base.router.ARouterConstants
|
||||
|
||||
/**
|
||||
* 国内进港移库列表页
|
||||
*/
|
||||
@Route(path = ARouterConstants.ACTIVITY_URL_GNJ_YIKU_LIST)
|
||||
class GnjYiKuListActivity :
|
||||
BaseBindingActivity<ActivityGnjYikuListBinding, GnjYiKuListViewModel>() {
|
||||
|
||||
override fun layoutId() = R.layout.activity_gnj_yiku_list
|
||||
|
||||
override fun viewModelClass() = GnjYiKuListViewModel::class.java
|
||||
|
||||
override fun initOnCreate(savedInstanceState: Bundle?) {
|
||||
setBackArrow("国内进港移库")
|
||||
|
||||
binding.viewModel = viewModel
|
||||
|
||||
// 绑定分页逻辑
|
||||
viewModel.pageModel
|
||||
.bindSmartRefreshLayout(binding.srl, binding.rv, viewModel, getLifecycleOwner())
|
||||
|
||||
// 监听刷新事件
|
||||
FlowBus.with<String>(ConstantEvent.EVENT_REFRESH_GNJ_YIKU_LIST)
|
||||
.observe(this) {
|
||||
viewModel.refresh()
|
||||
}
|
||||
|
||||
// 初始加载
|
||||
viewModel.refresh()
|
||||
}
|
||||
|
||||
companion object {
|
||||
@JvmStatic
|
||||
fun start(context: Context) {
|
||||
val starter = Intent(context, GnjYiKuListActivity::class.java)
|
||||
context.startActivity(starter)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.lukouguoji.gnj.page.yiku.list
|
||||
|
||||
import android.view.View
|
||||
import com.lukouguoji.gnj.databinding.ItemGnjYikuListBinding
|
||||
import com.lukouguoji.module_base.base.BaseViewHolder
|
||||
import com.lukouguoji.module_base.bean.GnjYiKuBean
|
||||
|
||||
/**
|
||||
* 国内进港移库列表 ViewHolder
|
||||
*/
|
||||
class GnjYiKuListViewHolder(view: View) :
|
||||
BaseViewHolder<GnjYiKuBean, ItemGnjYikuListBinding>(view) {
|
||||
|
||||
override fun onBind(item: Any?, position: Int) {
|
||||
val bean = getItemBean(item)!!
|
||||
binding.bean = bean
|
||||
|
||||
// 点击checkbox切换选中状态
|
||||
binding.ivIcon.setOnClickListener {
|
||||
bean.checked.set(!bean.checked.get())
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,223 @@
|
||||
package com.lukouguoji.gnj.page.yiku.list
|
||||
|
||||
import android.app.Activity
|
||||
import android.content.Intent
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import com.alibaba.fastjson.JSONArray
|
||||
import com.lukouguoji.gnj.R
|
||||
import com.lukouguoji.module_base.base.BasePageViewModel
|
||||
import com.lukouguoji.module_base.bean.GnjYiKuBean
|
||||
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.launchCollect
|
||||
import com.lukouguoji.module_base.ktx.launchLoadingCollect
|
||||
import com.lukouguoji.module_base.ktx.noNull
|
||||
import com.lukouguoji.module_base.ktx.showConfirmDialog
|
||||
import com.lukouguoji.module_base.ktx.showToast
|
||||
import com.lukouguoji.module_base.ktx.toJson
|
||||
import com.lukouguoji.module_base.ktx.toRequestBody
|
||||
import com.lukouguoji.module_base.model.ScanModel
|
||||
import com.lukouguoji.module_base.util.CheckUtil
|
||||
import com.lukouguoji.module_base.util.Common
|
||||
import dev.DevUtils
|
||||
import dev.utils.app.info.KeyValue
|
||||
import okhttp3.RequestBody
|
||||
|
||||
/**
|
||||
* 国内进港移库列表 ViewModel
|
||||
*/
|
||||
class GnjYiKuListViewModel : BasePageViewModel() {
|
||||
|
||||
// 搜索条件
|
||||
val waybillType = MutableLiveData("") // 运单类型
|
||||
val carrier = MutableLiveData("") // 承运人
|
||||
val waybillNo = MutableLiveData("") // 运单号
|
||||
val handoverStatus = MutableLiveData("") // 移交状态
|
||||
|
||||
// 运单号列表(用于多条结果选择)
|
||||
val wbNoList = MutableLiveData<List<String>>()
|
||||
|
||||
// 运单类型下拉列表
|
||||
val waybillTypeList = MutableLiveData(
|
||||
listOf(
|
||||
KeyValue("全部", ""),
|
||||
KeyValue("转国际进港", "CIII"),
|
||||
KeyValue("转国内出港", "CICO"),
|
||||
KeyValue("转国际出港", "CIIO"),
|
||||
)
|
||||
)
|
||||
|
||||
// 移交状态下拉列表
|
||||
val handoverStatusList = MutableLiveData(
|
||||
listOf(
|
||||
KeyValue("全部", ""),
|
||||
KeyValue("未移交", "0"),
|
||||
KeyValue("已移交", "1"),
|
||||
)
|
||||
)
|
||||
|
||||
// 适配器配置
|
||||
val itemViewHolder = GnjYiKuListViewHolder::class.java
|
||||
val itemLayoutId = R.layout.item_gnj_yiku_list
|
||||
|
||||
// 统计数据
|
||||
val count = MutableLiveData(0) // 总票数
|
||||
val totalPc = MutableLiveData("0") // 总件数
|
||||
val totalWeight = MutableLiveData("0") // 总重量
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// 方法区
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/**
|
||||
* 扫码输入运单号
|
||||
*/
|
||||
fun waybillScanClick() {
|
||||
ScanModel.startScan(getTopActivity(), Constant.RequestCode.WAYBILL)
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取运单号列表(用于扫码或输入后模糊查询)
|
||||
*/
|
||||
fun getWayBillList() {
|
||||
val requestBody = mapOf(
|
||||
"page" to pageModel.page,
|
||||
"limit" to pageModel.limit,
|
||||
"awbType" to waybillType.value!!.ifEmpty { null },
|
||||
"wbNo" to waybillNo.value!!.ifEmpty { null },
|
||||
"carrier" to carrier.value!!.ifEmpty { null },
|
||||
"handoverStatus" to handoverStatus.value!!.ifEmpty { null },
|
||||
).toRequestBody()
|
||||
|
||||
launchCollect({
|
||||
NetApply.api.getGnjMoveStashWbNoList(requestBody)
|
||||
}) {
|
||||
onSuccess = {
|
||||
val results = it.data!!
|
||||
when {
|
||||
results.size == 1 -> {
|
||||
waybillNo.value = results[0]
|
||||
wbNoList.value = emptyList()
|
||||
}
|
||||
results.size > 1 -> {
|
||||
wbNoList.value = results
|
||||
showWbNoListSelect()
|
||||
}
|
||||
else -> {
|
||||
wbNoList.value = emptyList()
|
||||
}
|
||||
}
|
||||
}
|
||||
onFailed = { i: Int, s: String ->
|
||||
wbNoList.value = emptyList()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取列表数据
|
||||
*/
|
||||
override fun getData() {
|
||||
val body = mapOf(
|
||||
"page" to pageModel.page,
|
||||
"limit" to pageModel.limit,
|
||||
"awbType" to waybillType.value!!.ifEmpty { null },
|
||||
"wbNo" to waybillNo.value!!.ifEmpty { null },
|
||||
"carrier" to carrier.value!!.ifEmpty { null },
|
||||
"handoverStatus" to handoverStatus.value!!.ifEmpty { null },
|
||||
).toRequestBody()
|
||||
|
||||
launchLoadingCollect({
|
||||
NetApply.api.getGnjMoveStashList(body)
|
||||
}) {
|
||||
onSuccess = {
|
||||
pageModel.handleListBean(it)
|
||||
count.value = it.total
|
||||
}
|
||||
}
|
||||
getCountData(body)
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取统计数据
|
||||
*/
|
||||
private fun getCountData(body: RequestBody) {
|
||||
launchCollect({
|
||||
NetApply.api.simplePost("DomImpMove/searchTotal", body)
|
||||
}) {
|
||||
onSuccess = {
|
||||
totalPc.value = it.data?.totalPc.noNull("0")
|
||||
totalWeight.value = it.data?.totalWeight.noNull("0")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理扫码结果
|
||||
*/
|
||||
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
|
||||
if (resultCode == Activity.RESULT_OK && data != null) {
|
||||
when (requestCode) {
|
||||
Constant.RequestCode.WAYBILL -> {
|
||||
waybillNo.value = data.getStringExtra(Constant.Result.CODED_CONTENT)
|
||||
refresh()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量移库操作
|
||||
*/
|
||||
fun moveStashClick() {
|
||||
val list = pageModel.rv!!.commonAdapter()!!.items as List<GnjYiKuBean>
|
||||
val filter = list.filter { it.checked.get() }
|
||||
if (filter.isEmpty()) {
|
||||
showToast("请选择数据")
|
||||
return
|
||||
}
|
||||
getTopActivity().showConfirmDialog("确定要移库选中的 ${filter.size} 条数据吗?") {
|
||||
launchLoadingCollect({
|
||||
NetApply.api.transferGnjYiKu(
|
||||
mapOf(
|
||||
"fid" to "0",
|
||||
"ids" to filter.map { it.mawbId },
|
||||
).toRequestBody()
|
||||
)
|
||||
}) {
|
||||
onSuccess = {
|
||||
showToast(it.msg.noNull("移库成功"))
|
||||
refresh()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 全选/全不选
|
||||
*/
|
||||
fun checkAllClick() {
|
||||
val list = pageModel.rv!!.commonAdapter()!!.items as List<GnjYiKuBean>
|
||||
CheckUtil.handleAllCheck(list)
|
||||
}
|
||||
|
||||
/**
|
||||
* 运单号选择弹窗
|
||||
*/
|
||||
private fun showWbNoListSelect() {
|
||||
Common.singleSelect(
|
||||
DevUtils.getTopActivity(),
|
||||
"选择运单号",
|
||||
JSONArray.parseArray(wbNoList.value!!.map {
|
||||
mapOf(
|
||||
"name" to it,
|
||||
"code" to it,
|
||||
)
|
||||
}.toList().toJson(false)),
|
||||
null
|
||||
) { position, _ ->
|
||||
waybillNo.value = wbNoList.value!![position]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -62,6 +62,25 @@
|
||||
android:configChanges="orientation|keyboardHidden"
|
||||
android:screenOrientation="userLandscape"
|
||||
android:exported="true" />
|
||||
|
||||
<!-- 国内进港移库 - 新增的三个 Activity -->
|
||||
<activity
|
||||
android:name=".page.yiku.list.GnjYiKuListActivity"
|
||||
android:configChanges="orientation|keyboardHidden"
|
||||
android:exported="false"
|
||||
android:screenOrientation="userLandscape" />
|
||||
|
||||
<activity
|
||||
android:name=".page.yiku.details.GnjYiKuDetailsActivity"
|
||||
android:configChanges="orientation|keyboardHidden"
|
||||
android:exported="false"
|
||||
android:screenOrientation="userLandscape" />
|
||||
|
||||
<activity
|
||||
android:name=".page.yiku.edit.GnjYiKuEditActivity"
|
||||
android:configChanges="orientation|keyboardHidden"
|
||||
android:exported="false"
|
||||
android:screenOrientation="userLandscape" />
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
338
module_gnj/src/main/res/layout/activity_gnj_yiku_details.xml
Normal file
338
module_gnj/src/main/res/layout/activity_gnj_yiku_details.xml
Normal file
@@ -0,0 +1,338 @@
|
||||
<?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>
|
||||
|
||||
<variable
|
||||
name="viewModel"
|
||||
type="com.lukouguoji.gnj.page.yiku.details.GnjYiKuDetailsViewModel" />
|
||||
</data>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/backgroud_gray"
|
||||
android:orientation="vertical">
|
||||
|
||||
<include layout="@layout/title_tool_bar" />
|
||||
|
||||
<ScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:padding="15dp">
|
||||
|
||||
<!-- 基本信息标题 -->
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="基本信息"
|
||||
android:textColor="@color/text_normal"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:background="@drawable/bg_white_radius_8"
|
||||
android:orientation="vertical"
|
||||
android:padding="15dp">
|
||||
|
||||
<!-- 第一行 -->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<!-- 运单号 -->
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
style="@style/tv_manifest_details_label"
|
||||
android:text="运单号:" />
|
||||
|
||||
<TextView
|
||||
style="@style/tv_manifest_details_value"
|
||||
android:text="@{viewModel.dataBean.wbNo}"
|
||||
tools:text="78109081212" />
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 件数 -->
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
style="@style/tv_manifest_details_label"
|
||||
android:text="件数:" />
|
||||
|
||||
<TextView
|
||||
style="@style/tv_manifest_details_value"
|
||||
android:text="@{viewModel.dataBean.pc}"
|
||||
tools:text="11" />
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 重量 -->
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
style="@style/tv_manifest_details_label"
|
||||
android:text="重量:" />
|
||||
|
||||
<TextView
|
||||
style="@style/tv_manifest_details_value"
|
||||
android:text='@{viewModel.dataBean.weight + "kg"}'
|
||||
tools:text="200kg" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="@color/list_bg" />
|
||||
|
||||
<!-- 第二行 -->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<!-- 特码 -->
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
style="@style/tv_manifest_details_label"
|
||||
android:text="特码:" />
|
||||
|
||||
<TextView
|
||||
style="@style/tv_manifest_details_value"
|
||||
android:text="@{viewModel.dataBean.spCode}"
|
||||
tools:text="PEK" />
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 代理 -->
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
style="@style/tv_manifest_details_label"
|
||||
android:text="代理:" />
|
||||
|
||||
<TextView
|
||||
style="@style/tv_manifest_details_value"
|
||||
android:text="@{viewModel.dataBean.agentCode}"
|
||||
tools:text="SF" />
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 品名 -->
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
style="@style/tv_manifest_details_label"
|
||||
android:text="品名:" />
|
||||
|
||||
<TextView
|
||||
style="@style/tv_manifest_details_value"
|
||||
android:text="@{viewModel.dataBean.goods}"
|
||||
tools:text="苹果" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="@color/list_bg" />
|
||||
|
||||
<!-- 第三行 -->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<!-- 进港航班 -->
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
style="@style/tv_manifest_details_label"
|
||||
android:text="进港航班:" />
|
||||
|
||||
<TextView
|
||||
style="@style/tv_manifest_details_value"
|
||||
android:text="@{viewModel.dataBean.flight}"
|
||||
tools:text="20240712/MU2023" />
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 航程 -->
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
style="@style/tv_manifest_details_label"
|
||||
android:text="航程:" />
|
||||
|
||||
<TextView
|
||||
style="@style/tv_manifest_details_value"
|
||||
android:text="@{viewModel.dataBean.route}"
|
||||
tools:text="LAX-PEK-HFE" />
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 运单类型 -->
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
style="@style/tv_manifest_details_label"
|
||||
android:text="运单类型:" />
|
||||
|
||||
<TextView
|
||||
style="@style/tv_manifest_details_value"
|
||||
android:text="@{viewModel.dataBean.awbType}"
|
||||
tools:text="转国际进港" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="@color/list_bg" />
|
||||
|
||||
<!-- 第四行 -->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<!-- 电报号 -->
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
style="@style/tv_manifest_details_label"
|
||||
android:text="电报号:" />
|
||||
|
||||
<TextView
|
||||
style="@style/tv_manifest_details_value"
|
||||
android:text="@{viewModel.dataBean.telegramNo}"
|
||||
tools:text="TG20240712001" />
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 移交状态 -->
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
style="@style/tv_manifest_details_label"
|
||||
android:text="移交状态:" />
|
||||
|
||||
<TextView
|
||||
style="@style/tv_manifest_details_value"
|
||||
android:text="@{viewModel.dataBean.handoverStatus}"
|
||||
tools:text="未移交" />
|
||||
</LinearLayout>
|
||||
|
||||
<Space
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1" />
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="@color/list_bg" />
|
||||
|
||||
<!-- 备注 -->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
style="@style/tv_manifest_details_label"
|
||||
android:text="备注:" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/white"
|
||||
android:gravity="center_vertical"
|
||||
android:minHeight="40dp"
|
||||
android:text="@{viewModel.dataBean.remark}"
|
||||
android:textColor="#333333"
|
||||
android:textSize="16sp"
|
||||
tools:text="这是备注信息" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 交接图片标题 -->
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="20dp"
|
||||
android:text="交接图片"
|
||||
android:textColor="@color/text_normal"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<!-- 图片展示区域 -->
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rv_images"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:overScrollMode="never"
|
||||
itemLayoutId="@{viewModel.imageItemLayoutId}"
|
||||
viewHolder="@{viewModel.imageItemViewHolder}"
|
||||
app:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
|
||||
app:spanCount="3" />
|
||||
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
|
||||
</LinearLayout>
|
||||
</layout>
|
||||
277
module_gnj/src/main/res/layout/activity_gnj_yiku_edit.xml
Normal file
277
module_gnj/src/main/res/layout/activity_gnj_yiku_edit.xml
Normal file
@@ -0,0 +1,277 @@
|
||||
<?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" />
|
||||
|
||||
<import type="com.lukouguoji.module_base.common.DetailsPageType" />
|
||||
|
||||
<import type="android.view.View" />
|
||||
|
||||
<variable
|
||||
name="viewModel"
|
||||
type="com.lukouguoji.gnj.page.yiku.edit.GnjYiKuEditViewModel" />
|
||||
</data>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/backgroud_gray"
|
||||
android:orientation="vertical">
|
||||
|
||||
<include layout="@layout/title_tool_bar" />
|
||||
|
||||
<ScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1">
|
||||
|
||||
<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:orientation="horizontal">
|
||||
|
||||
<!-- 运单号 -->
|
||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
enable="@{viewModel.pageType != DetailsPageType.Details}"
|
||||
required="@{viewModel.pageType != DetailsPageType.Details}"
|
||||
title='@{"运单号:"}'
|
||||
titleLength="@{5}"
|
||||
type="@{DataLayoutType.INPUT}"
|
||||
value='@={viewModel.dataBean.wbNo}' />
|
||||
|
||||
<Space
|
||||
android:layout_width="10dp"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
<!-- 件数 -->
|
||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
enable="@{viewModel.pageType != DetailsPageType.Details}"
|
||||
required="@{viewModel.pageType != DetailsPageType.Details}"
|
||||
title='@{"件数:"}'
|
||||
titleLength="@{5}"
|
||||
type="@{DataLayoutType.INPUT}"
|
||||
value='@={viewModel.dataBean.pc}' />
|
||||
|
||||
<Space
|
||||
android:layout_width="10dp"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
<!-- 重量 -->
|
||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
enable="@{viewModel.pageType != DetailsPageType.Details}"
|
||||
required="@{viewModel.pageType != DetailsPageType.Details}"
|
||||
title='@{"重量(kg):"}'
|
||||
titleLength="@{5}"
|
||||
type="@{DataLayoutType.INPUT}"
|
||||
value='@={viewModel.dataBean.weight}' />
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 第二行 -->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<!-- 特码 -->
|
||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
enable="@{viewModel.pageType != DetailsPageType.Details}"
|
||||
title='@{"特码:"}'
|
||||
titleLength="@{5}"
|
||||
type="@{DataLayoutType.INPUT}"
|
||||
value='@={viewModel.dataBean.spCode}' />
|
||||
|
||||
<Space
|
||||
android:layout_width="10dp"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
<!-- 代理 -->
|
||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
enable="@{viewModel.pageType != DetailsPageType.Details}"
|
||||
title='@{"代理:"}'
|
||||
titleLength="@{5}"
|
||||
type="@{DataLayoutType.INPUT}"
|
||||
value='@={viewModel.dataBean.agentCode}' />
|
||||
|
||||
<Space
|
||||
android:layout_width="10dp"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
<!-- 品名 -->
|
||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
enable="@{viewModel.pageType != DetailsPageType.Details}"
|
||||
title='@{"品名:"}'
|
||||
titleLength="@{5}"
|
||||
type="@{DataLayoutType.INPUT}"
|
||||
value='@={viewModel.dataBean.goods}' />
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 第三行 -->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<!-- 进港航班 -->
|
||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
enable="@{viewModel.pageType != DetailsPageType.Details}"
|
||||
title='@{"进港航班:"}'
|
||||
titleLength="@{5}"
|
||||
type="@{DataLayoutType.INPUT}"
|
||||
value='@={viewModel.dataBean.flight}' />
|
||||
|
||||
<Space
|
||||
android:layout_width="10dp"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
<!-- 航程 -->
|
||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
enable="@{viewModel.pageType != DetailsPageType.Details}"
|
||||
title='@{"航程:"}'
|
||||
titleLength="@{5}"
|
||||
type="@{DataLayoutType.INPUT}"
|
||||
value='@={viewModel.dataBean.route}' />
|
||||
|
||||
<Space
|
||||
android:layout_width="10dp"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
<!-- 运单类型 -->
|
||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
enable="@{viewModel.pageType != DetailsPageType.Details}"
|
||||
list="@{viewModel.waybillTypeList}"
|
||||
title='@{"运单类型:"}'
|
||||
titleLength="@{5}"
|
||||
type="@{DataLayoutType.SPINNER}"
|
||||
value='@={viewModel.dataBean.awbType}' />
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 第四行 -->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<!-- 电报号 -->
|
||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
enable="@{viewModel.pageType != DetailsPageType.Details}"
|
||||
title='@{"电报号:"}'
|
||||
titleLength="@{5}"
|
||||
type="@{DataLayoutType.INPUT}"
|
||||
value='@={viewModel.dataBean.telegramNo}' />
|
||||
|
||||
<Space
|
||||
android:layout_width="10dp"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
<!-- 备注 -->
|
||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="2"
|
||||
enable="@{viewModel.pageType != DetailsPageType.Details}"
|
||||
hint='@{"请输入备注"}'
|
||||
inputHeight="@{100}"
|
||||
title='@{"备注:"}'
|
||||
titleLength="@{5}"
|
||||
type="@{DataLayoutType.INPUT}"
|
||||
value='@={viewModel.dataBean.remark}' />
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 交接图片标题 -->
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="20dp"
|
||||
android:text="交接图片(最多7张)"
|
||||
android:textColor="@color/text_normal"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<!-- 图片上传区域 -->
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rv_images"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:overScrollMode="never"
|
||||
itemLayoutId="@{viewModel.imageItemLayoutId}"
|
||||
viewHolder="@{viewModel.imageItemViewHolder}"
|
||||
app:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
|
||||
app:spanCount="3" />
|
||||
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
|
||||
<!-- 底部按钮(详情页不显示) -->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="60dp"
|
||||
android:background="@color/white"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal"
|
||||
visible="@{viewModel.pageType != DetailsPageType.Details}">
|
||||
|
||||
<TextView
|
||||
android:layout_width="150dp"
|
||||
android:layout_height="50dp"
|
||||
android:layout_marginRight="20dp"
|
||||
android:background="@drawable/bg_gray_radius_4"
|
||||
android:gravity="center"
|
||||
android:onClick="@{()-> viewModel.getTopActivity().finish()}"
|
||||
android:text="取消"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="18sp" />
|
||||
|
||||
<TextView
|
||||
style="@style/tv_bottom_btn_lg"
|
||||
android:onClick="@{()-> viewModel.submit()}"
|
||||
android:text="@{viewModel.pageType == DetailsPageType.Add ? `提交` : `保存`}" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
</layout>
|
||||
162
module_gnj/src/main/res/layout/activity_gnj_yiku_list.xml
Normal file
162
module_gnj/src/main/res/layout/activity_gnj_yiku_list.xml
Normal file
@@ -0,0 +1,162 @@
|
||||
<?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.gnj.page.yiku.list.GnjYiKuListViewModel" />
|
||||
</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
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
hint='@{"请选择运单类型"}'
|
||||
list="@{viewModel.waybillTypeList}"
|
||||
type="@{SearchLayoutType.SPINNER}"
|
||||
value="@={viewModel.waybillType}" />
|
||||
|
||||
<!-- 承运人 -->
|
||||
<com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
hint='@{"请输入承运人"}'
|
||||
type="@{SearchLayoutType.INPUT}"
|
||||
value="@={viewModel.carrier}" />
|
||||
|
||||
<!-- 运单号 -->
|
||||
<com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
hint='@{"请输入运单号"}'
|
||||
icon="@{@drawable/img_scan}"
|
||||
setInputWaybill="@{true}"
|
||||
setOnIconClickListener="@{()-> viewModel.waybillScanClick()}"
|
||||
setRefreshCallBack="@{viewModel::refresh}"
|
||||
setSearchListRefresh="@{viewModel::getWayBillList}"
|
||||
type="@{SearchLayoutType.INPUT}"
|
||||
value="@={viewModel.waybillNo}" />
|
||||
|
||||
<!-- 移交状态 -->
|
||||
<com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
hint='@{"请选择移交状态"}'
|
||||
list="@{viewModel.handoverStatusList}"
|
||||
type="@{SearchLayoutType.SPINNER}"
|
||||
value="@={viewModel.handoverStatus}" />
|
||||
|
||||
<!-- 搜索按钮 -->
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1">
|
||||
|
||||
<ImageView
|
||||
style="@style/iv_search_action"
|
||||
android:onClick="@{()-> viewModel.refresh()}"
|
||||
android:src="@drawable/img_search" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 全选按钮 -->
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingTop="10dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="15dp"
|
||||
android:onClick="@{()->viewModel.checkAllClick()}"
|
||||
android:text="全选" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/checkIcon"
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:onClick="@{()->viewModel.checkAllClick()}"
|
||||
android:src="@drawable/img_check_all" />
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
<!-- 列表 -->
|
||||
<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"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
itemLayoutId="@{viewModel.itemLayoutId}"
|
||||
viewHolder="@{viewModel.itemViewHolder}"
|
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
||||
tools:listitem="@layout/item_gnj_yiku_list" />
|
||||
|
||||
</com.scwang.smart.refresh.layout.SmartRefreshLayout>
|
||||
|
||||
<!-- 底部统计和移库按钮 -->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:background="@color/color_bottom_layout"
|
||||
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+",总件数:"+viewModel.totalPc+",总重量:"+viewModel.totalWeight+"KG"}'
|
||||
android:textColor="@color/white"
|
||||
android:textSize="18sp"
|
||||
android:textStyle="bold"
|
||||
tools:text="合计票数:1,总件数:100,总重量:200KG" />
|
||||
|
||||
<TextView
|
||||
style="@style/tv_bottom_btn"
|
||||
android:onClick="@{()-> viewModel.moveStashClick()}"
|
||||
android:text="移库" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
</layout>
|
||||
267
module_gnj/src/main/res/layout/item_gnj_yiku_list.xml
Normal file
267
module_gnj/src/main/res/layout/item_gnj_yiku_list.xml
Normal file
@@ -0,0 +1,267 @@
|
||||
<?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>
|
||||
|
||||
<variable
|
||||
name="bean"
|
||||
type="com.lukouguoji.module_base.bean.GnjYiKuBean" />
|
||||
</data>
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:id="@+id/ll"
|
||||
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"
|
||||
loadImage="@{bean.checked ? @drawable/img_plane_s : @drawable/img_plane}"
|
||||
android:src="@drawable/img_plane" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<!-- 第一行数据 -->
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<!-- 运单号 -->
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1.1"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
completeSpace="@{4}"
|
||||
android:text="运单号:" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@{bean.wbNo}"
|
||||
android:textColor="@color/colorPrimary"
|
||||
tools:text="78109081212" />
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
<!-- 件数 -->
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
completeSpace="@{4}"
|
||||
android:text="件数:" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text='@{bean.pc}'
|
||||
tools:text="11" />
|
||||
|
||||
</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
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
completeSpace="@{4}"
|
||||
android:text="航班:" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@{bean.flight}"
|
||||
tools:text="20240712/MU2023" />
|
||||
|
||||
</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
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
completeSpace="@{4}"
|
||||
android:text="航程:" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@{bean.route}"
|
||||
tools:text="LAX-PEK-HFE" />
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
<!-- 移交状态 -->
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
completeSpace="@{5}"
|
||||
android:text="移交状态:" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text='@{bean.handoverStatus}'
|
||||
tools:text="未移交" />
|
||||
|
||||
</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.1"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
completeSpace="@{5}"
|
||||
android:text="运单类型:" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@{bean.awbType}"
|
||||
tools:text="转国际进港" />
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
<!-- 品名 -->
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
completeSpace="@{4}"
|
||||
android:text="品名:" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@{bean.goods}"
|
||||
tools:text="苹果" />
|
||||
|
||||
</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
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
completeSpace="@{4}"
|
||||
android:text="代理人:" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text='@{bean.agentCode}'
|
||||
tools:text="SF" />
|
||||
|
||||
</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
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
completeSpace="@{4}"
|
||||
android:text="特码:" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@{bean.spCode}"
|
||||
tools:text="PEK" />
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
<!-- 重量 -->
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
completeSpace="@{4}"
|
||||
android:text="重量:" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@{bean.weight}"
|
||||
tools:text="200" />
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
</layout>
|
||||
Reference in New Issue
Block a user