feat: dev
This commit is contained in:
@@ -17,7 +17,8 @@
|
|||||||
"Bash(tee:*)",
|
"Bash(tee:*)",
|
||||||
"Bash(git stash:*)",
|
"Bash(git stash:*)",
|
||||||
"Bash(jar tf:*)",
|
"Bash(jar tf:*)",
|
||||||
"Bash(xargs -I {} sh -c 'echo \"\"\"\"=== {} ===\"\"\"\" && jar tf {} 2>/dev/null | grep -i \"\"\"\"gprinter\"\"\"\" | head -5')"
|
"Bash(xargs -I {} sh -c 'echo \"\"\"\"=== {} ===\"\"\"\" && jar tf {} 2>/dev/null | grep -i \"\"\"\"gprinter\"\"\"\" | head -5')",
|
||||||
|
"Bash(xmllint:*)"
|
||||||
],
|
],
|
||||||
"deny": [],
|
"deny": [],
|
||||||
"ask": []
|
"ask": []
|
||||||
|
|||||||
13
.idea/deviceManager.xml
generated
Normal file
13
.idea/deviceManager.xml
generated
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="DeviceTable">
|
||||||
|
<option name="columnSorters">
|
||||||
|
<list>
|
||||||
|
<ColumnSorterState>
|
||||||
|
<option name="column" value="Name" />
|
||||||
|
<option name="order" value="ASCENDING" />
|
||||||
|
</ColumnSorterState>
|
||||||
|
</list>
|
||||||
|
</option>
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
@@ -94,6 +94,11 @@
|
|||||||
android:configChanges="orientation|keyboardHidden"
|
android:configChanges="orientation|keyboardHidden"
|
||||||
android:exported="false"
|
android:exported="false"
|
||||||
android:screenOrientation="userLandscape" />
|
android:screenOrientation="userLandscape" />
|
||||||
|
<activity
|
||||||
|
android:name="com.lukouguoji.gjc.activity.GjcInspectionActivity"
|
||||||
|
android:configChanges="orientation|keyboardHidden"
|
||||||
|
android:exported="false"
|
||||||
|
android:screenOrientation="userLandscape" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".MineActivity"
|
android:name=".MineActivity"
|
||||||
android:configChanges="orientation|keyboardHidden"
|
android:configChanges="orientation|keyboardHidden"
|
||||||
|
|||||||
@@ -173,14 +173,14 @@ class HomeFragment : Fragment() {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 左侧菜单 权限过滤
|
* 左侧菜单 权限过滤
|
||||||
* todo
|
* TODO: 暂时关闭权限筛选,方便开发调试
|
||||||
*/
|
*/
|
||||||
getAuthsObj()?.let {
|
// getAuthsObj()?.let {
|
||||||
val authsFilter = list.filter { m ->
|
// val authsFilter = list.filter { m ->
|
||||||
it.getJSONArray(m.id) != null && it.getJSONArray(m.id).size > 0
|
// it.getJSONArray(m.id) != null && it.getJSONArray(m.id).size > 0
|
||||||
}
|
// }
|
||||||
list = authsFilter as ArrayList<LeftMenu>
|
// list = authsFilter as ArrayList<LeftMenu>
|
||||||
}
|
// }
|
||||||
return list
|
return list
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -267,6 +267,7 @@ class HomeFragment : Fragment() {
|
|||||||
Constant.AuthName.AppDomExpDeposit -> {
|
Constant.AuthName.AppDomExpDeposit -> {
|
||||||
GncDepositListActivity.start(requireContext())
|
GncDepositListActivity.start(requireContext())
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 国内进港
|
* 国内进港
|
||||||
*/
|
*/
|
||||||
@@ -337,6 +338,11 @@ class HomeFragment : Fragment() {
|
|||||||
ARouter.getInstance().build(ARouterConstants.ACTIVITY_URL_GJC_GOODS_LIST)
|
ARouter.getInstance().build(ARouterConstants.ACTIVITY_URL_GJC_GOODS_LIST)
|
||||||
.navigation()
|
.navigation()
|
||||||
}
|
}
|
||||||
|
// 收运检查
|
||||||
|
Constant.AuthName.GjcInspectionActivity -> {
|
||||||
|
ARouter.getInstance().build(ARouterConstants.ACTIVITY_URL_GJC_INSPECTION)
|
||||||
|
.navigation()
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* 国际进港
|
* 国际进港
|
||||||
*/
|
*/
|
||||||
@@ -629,6 +635,13 @@ class HomeFragment : Fragment() {
|
|||||||
"货物交接"
|
"货物交接"
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
list.add(
|
||||||
|
RightMenu(
|
||||||
|
Constant.AuthName.GjcInspectionActivity,
|
||||||
|
R.mipmap.gnc_cha,
|
||||||
|
"收运检查"
|
||||||
|
)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
Constant.AuthName.IntImp -> {
|
Constant.AuthName.IntImp -> {
|
||||||
@@ -775,11 +788,11 @@ class HomeFragment : Fragment() {
|
|||||||
/**
|
/**
|
||||||
* 右侧菜单 权限过滤
|
* 右侧菜单 权限过滤
|
||||||
*/
|
*/
|
||||||
val authsFilter = list.filter { m ->
|
|
||||||
SharedPreferenceUtil.getString(Constant.Share.authList).contains(m.id)
|
|
||||||
}
|
|
||||||
// TODO: 暂时关闭权限筛选
|
// TODO: 暂时关闭权限筛选
|
||||||
list = authsFilter as ArrayList<RightMenu>
|
// val authsFilter = list.filter { m ->
|
||||||
|
// SharedPreferenceUtil.getString(Constant.Share.authList).contains(m.id)
|
||||||
|
// }
|
||||||
|
// list = authsFilter as ArrayList<RightMenu>
|
||||||
return list
|
return list
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,75 @@
|
|||||||
|
package com.lukouguoji.module_base.bean
|
||||||
|
|
||||||
|
import androidx.databinding.ObservableBoolean
|
||||||
|
import com.lukouguoji.module_base.interfaces.ICheck
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 国际出港收运检查数据Bean
|
||||||
|
* 对应后端 GjcMaWb 对象
|
||||||
|
*/
|
||||||
|
class GjcInspectionBean : ICheck {
|
||||||
|
var maWbId: Long = 0 // 主键ID GJC_MAWB.MAWBID
|
||||||
|
var wbNo: String = "" // 11位运单号
|
||||||
|
var no: String = "" // 运单号(含前缀)
|
||||||
|
var prefix: String = "" // 运单前缀
|
||||||
|
|
||||||
|
var agentCode: String = "" // 代理人
|
||||||
|
var agentName: String = "" // 代理人名称
|
||||||
|
var spCode: String = "" // 特码
|
||||||
|
var pc: Long = 0 // 预配件数
|
||||||
|
var weight: Double = 0.0 // 预配重量
|
||||||
|
var volume: Double = 0.0 // 预配体积
|
||||||
|
|
||||||
|
var flight: String = "" // 航班(格式: 航班日期/航班号)
|
||||||
|
var fdate: String = "" // 航班日期
|
||||||
|
var fno: String = "" // 航班号
|
||||||
|
var range: String = "" // 航程
|
||||||
|
var dep: String = "" // 始发站
|
||||||
|
var dest: String = "" // 最终目的站
|
||||||
|
var scheduledTackOff: String = "" // 计划起飞时间
|
||||||
|
var scheduledArrival: String = "" // 预计到达时间
|
||||||
|
|
||||||
|
var businessType: String = "" // 业务类型
|
||||||
|
var businessName: String = "" // 业务类型名称(中)
|
||||||
|
var awbType: String = "" // 运单类型
|
||||||
|
var awbName: String = "" // 运单类型名称(中)
|
||||||
|
|
||||||
|
var reviewStatus: String = "" // 审核状态(0:未审核;1:通过;2:退回)
|
||||||
|
var checkIn: String = "" // 收运状态(0:待收运,1:已收运,2:收运中)
|
||||||
|
|
||||||
|
var goods: String = "" // 品名(英)
|
||||||
|
var goodsCn: String = "" // 品名(中)
|
||||||
|
var origin: String = "" // 货源地
|
||||||
|
var consignee: String = "" // 收货人
|
||||||
|
var remark: String = "" // 备注
|
||||||
|
|
||||||
|
// 多选状态绑定
|
||||||
|
val checked = ObservableBoolean(false)
|
||||||
|
|
||||||
|
override fun getCheckObservable(): ObservableBoolean {
|
||||||
|
return checked
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取审核状态名称
|
||||||
|
*/
|
||||||
|
fun getReviewStatusName(): String {
|
||||||
|
return when (reviewStatus) {
|
||||||
|
"1" -> "已通过"
|
||||||
|
"2" -> "退回"
|
||||||
|
"0" -> "未审核"
|
||||||
|
else -> "未知"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取审核状态颜色
|
||||||
|
*/
|
||||||
|
fun getReviewStatusColor(): String {
|
||||||
|
return when (reviewStatus) {
|
||||||
|
"1" -> "#4CAF50" // 绿色-已通过
|
||||||
|
"2" -> "#F44336" // 红色-退回
|
||||||
|
else -> "#9E9E9E" // 灰色-未审核
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,47 @@
|
|||||||
|
package com.lukouguoji.module_base.bean
|
||||||
|
|
||||||
|
import androidx.databinding.ObservableBoolean
|
||||||
|
import com.lukouguoji.module_base.interfaces.ICheck
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 国内出港收运检查数据Bean
|
||||||
|
*/
|
||||||
|
class GncInspectionBean : ICheck {
|
||||||
|
var id: String = "" // 主键ID
|
||||||
|
var mawbId: String = "" // 主运单ID
|
||||||
|
var wbNo: String = "" // 运单号
|
||||||
|
var agentCode: String = "" // 代理人
|
||||||
|
var spCode: String = "" // 特码
|
||||||
|
var apc: String = "" // 预配件数
|
||||||
|
var weight: String = "" // 预配重量(kg)
|
||||||
|
var flight: String = "" // 计划航班(格式: 20240216/MU2026)
|
||||||
|
var fdate: String = "" // 航班日期
|
||||||
|
var fno: String = "" // 航班号
|
||||||
|
var route: String = "" // 航程(格式: HFE - PEK)
|
||||||
|
var origin: String = "" // 始发港
|
||||||
|
var dest: String = "" // 目的港
|
||||||
|
var scheduledTackOff: String = "" // 预计起飞时间
|
||||||
|
var businessType: String = "" // 业务类型
|
||||||
|
var auditStatus: String = "" // 审核状态编码
|
||||||
|
var auditStatusName: String = "" // 审核状态名称(已通过/退回/未审核)
|
||||||
|
var remark: String = "" // 备注
|
||||||
|
|
||||||
|
// 多选状态绑定
|
||||||
|
val checked = ObservableBoolean(false)
|
||||||
|
|
||||||
|
override fun getCheckObservable(): ObservableBoolean {
|
||||||
|
return checked
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取审核状态颜色
|
||||||
|
* 已通过=绿色、退回=红色、未审核=灰色
|
||||||
|
*/
|
||||||
|
fun getAuditStatusColor(): String {
|
||||||
|
return when (auditStatusName) {
|
||||||
|
"已通过" -> "#4CAF50" // 绿色
|
||||||
|
"退回" -> "#F44336" // 红色
|
||||||
|
else -> "#9E9E9E" // 灰色
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
package com.lukouguoji.module_base.bean
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 统计数据Bean
|
||||||
|
*/
|
||||||
|
class StatisticsBean {
|
||||||
|
var totalCount: String = "" // 合计票数
|
||||||
|
var totalPc: String = "" // 总件数
|
||||||
|
var totalWeight: String = "" // 总重量
|
||||||
|
}
|
||||||
@@ -211,6 +211,7 @@ interface Constant {
|
|||||||
const val AppDomExpAssemble = "AppDomExpAssemble"//国内出港 组装
|
const val AppDomExpAssemble = "AppDomExpAssemble"//国内出港 组装
|
||||||
const val AppDomExpDistribution = "AppDomExpDistribution"//国内出港 分配
|
const val AppDomExpDistribution = "AppDomExpDistribution"//国内出港 分配
|
||||||
const val AppDomExpDeposit = "AppDomExpDeposit"//国内出港 存放
|
const val AppDomExpDeposit = "AppDomExpDeposit"//国内出港 存放
|
||||||
|
const val AppDomExpInspection = "AppDomExpInspection"//国内出港 收运检查
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 国内进港
|
* 国内进港
|
||||||
@@ -238,6 +239,7 @@ interface Constant {
|
|||||||
|
|
||||||
const val GjcBanXListActivity = "AppIntExpBox" //板箱
|
const val GjcBanXListActivity = "AppIntExpBox" //板箱
|
||||||
const val GjcGoodsListActivity = "AppIntExpGoods" //货物交接
|
const val GjcGoodsListActivity = "AppIntExpGoods" //货物交接
|
||||||
|
const val GjcInspectionActivity = "AppIntExpInspection" //收运检查
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 国际进港
|
* 国际进港
|
||||||
|
|||||||
@@ -34,4 +34,7 @@ object ConstantEvent {
|
|||||||
|
|
||||||
// 国内进港移库列表刷新
|
// 国内进港移库列表刷新
|
||||||
const val EVENT_REFRESH_GNJ_YIKU_LIST = "event_refresh_gnj_yiku_list"
|
const val EVENT_REFRESH_GNJ_YIKU_LIST = "event_refresh_gnj_yiku_list"
|
||||||
|
|
||||||
|
// 通用刷新事件
|
||||||
|
const val EVENT_REFRESH = "event_refresh"
|
||||||
}
|
}
|
||||||
@@ -42,6 +42,8 @@ import com.lukouguoji.module_base.bean.GncAssembleListBean
|
|||||||
import com.lukouguoji.module_base.bean.GncCunFangBean
|
import com.lukouguoji.module_base.bean.GncCunFangBean
|
||||||
import com.lukouguoji.module_base.bean.GncDistributionBean
|
import com.lukouguoji.module_base.bean.GncDistributionBean
|
||||||
import com.lukouguoji.module_base.bean.GncFuBangBean
|
import com.lukouguoji.module_base.bean.GncFuBangBean
|
||||||
|
import com.lukouguoji.module_base.bean.GjcInspectionBean
|
||||||
|
import com.lukouguoji.module_base.bean.GncInspectionBean
|
||||||
import com.lukouguoji.module_base.bean.GncQueryBean
|
import com.lukouguoji.module_base.bean.GncQueryBean
|
||||||
import com.lukouguoji.module_base.bean.GncQueryDetailsBean
|
import com.lukouguoji.module_base.bean.GncQueryDetailsBean
|
||||||
import com.lukouguoji.module_base.bean.GncShouYunBean
|
import com.lukouguoji.module_base.bean.GncShouYunBean
|
||||||
@@ -61,6 +63,7 @@ import com.lukouguoji.module_base.bean.PackageBean
|
|||||||
import com.lukouguoji.module_base.bean.SYWaybillBean
|
import com.lukouguoji.module_base.bean.SYWaybillBean
|
||||||
import com.lukouguoji.module_base.bean.ShouYunSyncBean
|
import com.lukouguoji.module_base.bean.ShouYunSyncBean
|
||||||
import com.lukouguoji.module_base.bean.SimpleResultBean
|
import com.lukouguoji.module_base.bean.SimpleResultBean
|
||||||
|
import com.lukouguoji.module_base.bean.StatisticsBean
|
||||||
import com.lukouguoji.module_base.bean.TelegramBean
|
import com.lukouguoji.module_base.bean.TelegramBean
|
||||||
import com.lukouguoji.module_base.bean.TransportLogBean
|
import com.lukouguoji.module_base.bean.TransportLogBean
|
||||||
import com.lukouguoji.module_base.bean.ULDBean
|
import com.lukouguoji.module_base.bean.ULDBean
|
||||||
@@ -353,6 +356,23 @@ interface Api {
|
|||||||
@PartMap map: MutableMap<String, RequestBody>? = null
|
@PartMap map: MutableMap<String, RequestBody>? = null
|
||||||
): BaseResultBean<Any>
|
): BaseResultBean<Any>
|
||||||
|
|
||||||
|
///////////////////////////////////////////////////////////////////////////
|
||||||
|
// 国际出 - 收运检查
|
||||||
|
///////////////////////////////////////////////////////////////////////////
|
||||||
|
/**
|
||||||
|
* 获取-国际出港-收运检查-列表(分页)
|
||||||
|
* 接口路径: /IntExpCheckInCheck/pageQuery
|
||||||
|
*/
|
||||||
|
@POST("IntExpCheckInCheck/pageQuery")
|
||||||
|
suspend fun getGjcInspectionList(@Body data: RequestBody): BaseListBean<GjcInspectionBean>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量审核-国际出港-收运检查(通过/退回)
|
||||||
|
* TODO: 需要确认审核接口路径
|
||||||
|
*/
|
||||||
|
@POST("IntExpCheckInCheck/audit")
|
||||||
|
suspend fun auditGjcInspection(@Body data: RequestBody): BaseResultBean<SimpleResultBean>
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
// 国际进-电报解析
|
// 国际进-电报解析
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
@@ -893,6 +913,24 @@ interface Api {
|
|||||||
@POST("DomExpSearch/searchById")
|
@POST("DomExpSearch/searchById")
|
||||||
suspend fun getGncQueryDetails(@Query("id") id: String): BaseResultBean<GncQueryDetailsBean>
|
suspend fun getGncQueryDetails(@Query("id") id: String): BaseResultBean<GncQueryDetailsBean>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取-国内出港-收运检查-列表
|
||||||
|
*/
|
||||||
|
@POST("DomExpInspection/search")
|
||||||
|
suspend fun getGncInspectionList(@Body data: RequestBody): BaseListBean<GncInspectionBean>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取-国内出港-收运检查-统计数据
|
||||||
|
*/
|
||||||
|
@POST("DomExpInspection/statistics")
|
||||||
|
suspend fun getGncInspectionStatistics(@Body data: RequestBody): BaseResultBean<StatisticsBean>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量审核-国内出港-收运检查(通过/退回)
|
||||||
|
*/
|
||||||
|
@POST("DomExpInspection/audit")
|
||||||
|
suspend fun auditGncInspection(@Body data: RequestBody): BaseResultBean<SimpleResultBean>
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取-国内出港-查询-根据主运单Id查询运单详细信息,带入库重量、入库件数
|
* 获取-国内出港-查询-根据主运单Id查询运单详细信息,带入库重量、入库件数
|
||||||
|
|||||||
@@ -80,6 +80,9 @@ object ARouterConstants {
|
|||||||
// 存放
|
// 存放
|
||||||
const val ACTIVITY_URL_GNC_DEPOSIT = "/gnc/GncDepositListActivity"
|
const val ACTIVITY_URL_GNC_DEPOSIT = "/gnc/GncDepositListActivity"
|
||||||
|
|
||||||
|
// 收运检查
|
||||||
|
const val ACTIVITY_URL_GNC_INSPECTION = "/gnc/GncInspectionActivity"
|
||||||
|
|
||||||
///////////////////// 国内进港模块
|
///////////////////// 国内进港模块
|
||||||
/**
|
/**
|
||||||
* 国内进港模块
|
* 国内进港模块
|
||||||
@@ -121,7 +124,8 @@ object ARouterConstants {
|
|||||||
|
|
||||||
const val ACTIVITY_URL_GJC_YI_KU = "/gjc/GjcYiKuListActivity" //国际出港 移库
|
const val ACTIVITY_URL_GJC_YI_KU = "/gjc/GjcYiKuListActivity" //国际出港 移库
|
||||||
const val ACTIVITY_URL_GJC_BOX_ASSEMBLE = "/gjc/GjcBoxAssembleListActivity" //国际出港 板箱组装
|
const val ACTIVITY_URL_GJC_BOX_ASSEMBLE = "/gjc/GjcBoxAssembleListActivity" //国际出港 板箱组装
|
||||||
const val ACTIVITY_URL_GJC_GOODS_LIST = "/gjc/GjcGoodsListActivity" //国际出港 板箱组装
|
const val ACTIVITY_URL_GJC_GOODS_LIST = "/gjc/GjcGoodsListActivity" //国际出港 货物交接
|
||||||
|
const val ACTIVITY_URL_GJC_INSPECTION = "/gjc/GjcInspectionActivity" //国际出港 收运检查
|
||||||
|
|
||||||
///////////////// 国际进港模块
|
///////////////// 国际进港模块
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -0,0 +1,57 @@
|
|||||||
|
package com.lukouguoji.gjc.activity
|
||||||
|
|
||||||
|
import android.content.Context
|
||||||
|
import android.content.Intent
|
||||||
|
import android.os.Bundle
|
||||||
|
import com.alibaba.android.arouter.facade.annotation.Route
|
||||||
|
import com.lukouguoji.gjc.R
|
||||||
|
import com.lukouguoji.gjc.databinding.ActivityGjcInspectionBinding
|
||||||
|
import com.lukouguoji.gjc.viewModel.GjcInspectionViewModel
|
||||||
|
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_GJC_INSPECTION)
|
||||||
|
class GjcInspectionActivity :
|
||||||
|
BaseBindingActivity<ActivityGjcInspectionBinding, GjcInspectionViewModel>() {
|
||||||
|
|
||||||
|
override fun layoutId() = R.layout.activity_gjc_inspection
|
||||||
|
|
||||||
|
override fun viewModelClass() = GjcInspectionViewModel::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)
|
||||||
|
.observe(this) {
|
||||||
|
viewModel.refresh()
|
||||||
|
}
|
||||||
|
|
||||||
|
// 初始化代理列表
|
||||||
|
viewModel.initAgentList()
|
||||||
|
|
||||||
|
// 初始加载
|
||||||
|
viewModel.refresh()
|
||||||
|
}
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
@JvmStatic
|
||||||
|
fun start(context: Context) {
|
||||||
|
val starter = Intent(context, GjcInspectionActivity::class.java)
|
||||||
|
context.startActivity(starter)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
package com.lukouguoji.gjc.holder
|
||||||
|
|
||||||
|
import android.graphics.Color
|
||||||
|
import android.view.View
|
||||||
|
import com.lukouguoji.gjc.databinding.ItemGjcInspectionBinding
|
||||||
|
import com.lukouguoji.module_base.base.BaseViewHolder
|
||||||
|
import com.lukouguoji.module_base.bean.GjcInspectionBean
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 国际出港收运检查列表 ViewHolder
|
||||||
|
*/
|
||||||
|
class GjcInspectionViewHolder(view: View) :
|
||||||
|
BaseViewHolder<GjcInspectionBean, ItemGjcInspectionBinding>(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())
|
||||||
|
}
|
||||||
|
|
||||||
|
// 设置审核状态文本和颜色
|
||||||
|
binding.tvStatus.text = bean.getReviewStatusName()
|
||||||
|
binding.tvStatus.setTextColor(Color.parseColor(bean.getReviewStatusColor()))
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,197 @@
|
|||||||
|
package com.lukouguoji.gjc.viewModel
|
||||||
|
|
||||||
|
import android.app.Activity
|
||||||
|
import android.content.Intent
|
||||||
|
import androidx.lifecycle.MutableLiveData
|
||||||
|
import androidx.lifecycle.viewModelScope
|
||||||
|
import com.lukouguoji.gjc.R
|
||||||
|
import com.lukouguoji.gjc.holder.GjcInspectionViewHolder
|
||||||
|
import com.lukouguoji.module_base.base.BasePageViewModel
|
||||||
|
import com.lukouguoji.module_base.bean.GjcInspectionBean
|
||||||
|
import com.lukouguoji.module_base.bean.StatisticsBean
|
||||||
|
import com.lukouguoji.module_base.common.Constant
|
||||||
|
import com.lukouguoji.module_base.common.ConstantEvent
|
||||||
|
import com.lukouguoji.module_base.http.net.NetApply
|
||||||
|
import com.lukouguoji.module_base.impl.FlowBus
|
||||||
|
import com.lukouguoji.module_base.ktx.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.toRequestBody
|
||||||
|
import com.lukouguoji.module_base.model.ScanModel
|
||||||
|
import com.lukouguoji.module_base.util.CheckUtil
|
||||||
|
import dev.utils.app.info.KeyValue
|
||||||
|
import kotlinx.coroutines.launch
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 国际出港收运检查 ViewModel
|
||||||
|
*/
|
||||||
|
class GjcInspectionViewModel : BasePageViewModel() {
|
||||||
|
|
||||||
|
// 搜索条件
|
||||||
|
val flightDate = MutableLiveData("") // 航班日期
|
||||||
|
val flightNo = MutableLiveData("") // 航班号
|
||||||
|
val agentId = MutableLiveData("") // 代理ID
|
||||||
|
val auditStatus = MutableLiveData("") // 审核状态
|
||||||
|
val waybillNo = MutableLiveData("") // 运单号
|
||||||
|
|
||||||
|
// 代理下拉列表(需要从API获取,暂时用空列表)
|
||||||
|
val agentList = MutableLiveData(listOf(KeyValue("全部", "")))
|
||||||
|
|
||||||
|
// 审核状态下拉列表
|
||||||
|
val auditStatusList = MutableLiveData(
|
||||||
|
listOf(
|
||||||
|
KeyValue("全部", ""),
|
||||||
|
KeyValue("已通过", "1"),
|
||||||
|
KeyValue("退回", "2"),
|
||||||
|
KeyValue("未审核", "0"),
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
// 适配器配置
|
||||||
|
val itemViewHolder = GjcInspectionViewHolder::class.java
|
||||||
|
val itemLayoutId = R.layout.item_gjc_inspection
|
||||||
|
|
||||||
|
// 统计数据
|
||||||
|
val totalCount = MutableLiveData("0") // 合计票数
|
||||||
|
val totalPc = MutableLiveData("0") // 总件数
|
||||||
|
val totalWeight = MutableLiveData("0") // 总重量
|
||||||
|
|
||||||
|
///////////////////////////////////////////////////////////////////////////
|
||||||
|
// 方法区
|
||||||
|
///////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 扫码输入运单号
|
||||||
|
*/
|
||||||
|
fun waybillScanClick() {
|
||||||
|
ScanModel.startScan(getTopActivity(), Constant.RequestCode.WAYBILL)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 搜索按钮点击
|
||||||
|
*/
|
||||||
|
fun searchClick() {
|
||||||
|
refresh()
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取列表数据
|
||||||
|
*/
|
||||||
|
override fun getData() {
|
||||||
|
val body = mapOf(
|
||||||
|
"pageNum" to pageModel.page,
|
||||||
|
"pageSize" to pageModel.limit,
|
||||||
|
"fdate" to flightDate.value!!.ifEmpty { null },
|
||||||
|
"fno" to flightNo.value!!.ifEmpty { null },
|
||||||
|
"agentCode" to agentId.value!!.ifEmpty { null },
|
||||||
|
"reviewStatus" to auditStatus.value!!.ifEmpty { null },
|
||||||
|
"wbNo" to waybillNo.value!!.ifEmpty { null },
|
||||||
|
).toRequestBody()
|
||||||
|
|
||||||
|
launchLoadingCollect({
|
||||||
|
NetApply.api.getGjcInspectionList(body)
|
||||||
|
}) {
|
||||||
|
onSuccess = {
|
||||||
|
pageModel.handleListBean(it)
|
||||||
|
// 更新统计数据(包含在返回结果中)
|
||||||
|
totalCount.value = (it.total ?: 0).toString()
|
||||||
|
totalPc.value = (it.totalPc ?: 0).toString()
|
||||||
|
totalWeight.value = (it.totalWeight ?: 0.0).toString()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 处理扫码结果
|
||||||
|
*/
|
||||||
|
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 auditPassClick() {
|
||||||
|
val list = pageModel.rv!!.commonAdapter()!!.items as List<GjcInspectionBean>
|
||||||
|
val filter = list.filter { it.checked.get() }
|
||||||
|
if (filter.isEmpty()) {
|
||||||
|
showToast("请选择数据")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
getTopActivity().showConfirmDialog("确定要通过选中的 ${filter.size} 条数据吗?") {
|
||||||
|
performAudit(filter, "1", "通过")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量审核 - 退回
|
||||||
|
*/
|
||||||
|
fun auditRejectClick() {
|
||||||
|
val list = pageModel.rv!!.commonAdapter()!!.items as List<GjcInspectionBean>
|
||||||
|
val filter = list.filter { it.checked.get() }
|
||||||
|
if (filter.isEmpty()) {
|
||||||
|
showToast("请选择数据")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
getTopActivity().showConfirmDialog("确定要退回选中的 ${filter.size} 条数据吗?") {
|
||||||
|
performAudit(filter, "2", "退回")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 执行审核操作
|
||||||
|
* @param items 选中的数据列表
|
||||||
|
* @param status 审核状态(1:通过, 2:退回)
|
||||||
|
* @param action 操作名称(用于提示)
|
||||||
|
*/
|
||||||
|
private fun performAudit(items: List<GjcInspectionBean>, status: String, action: String) {
|
||||||
|
launchLoadingCollect({
|
||||||
|
NetApply.api.auditGjcInspection(
|
||||||
|
mapOf(
|
||||||
|
"ids" to items.map { it.maWbId },
|
||||||
|
"reviewStatus" to status,
|
||||||
|
).toRequestBody()
|
||||||
|
)
|
||||||
|
}) {
|
||||||
|
onSuccess = {
|
||||||
|
showToast(it.msg.noNull("${action}成功"))
|
||||||
|
viewModelScope.launch {
|
||||||
|
FlowBus.with<String>(ConstantEvent.EVENT_REFRESH).emit("refresh")
|
||||||
|
}
|
||||||
|
refresh()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 全选/全不选
|
||||||
|
*/
|
||||||
|
fun checkAllClick() {
|
||||||
|
val list = pageModel.rv!!.commonAdapter()!!.items as List<GjcInspectionBean>
|
||||||
|
CheckUtil.handleAllCheck(list)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 初始化代理下拉列表(从API获取)
|
||||||
|
*/
|
||||||
|
fun initAgentList() {
|
||||||
|
// TODO: 调用API获取代理列表
|
||||||
|
// 暂时使用模拟数据
|
||||||
|
agentList.value = listOf(
|
||||||
|
KeyValue("全部", ""),
|
||||||
|
KeyValue("SF", "SF"),
|
||||||
|
KeyValue("YTO", "YTO"),
|
||||||
|
KeyValue("ZTO", "ZTO"),
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
171
module_gjc/src/main/res/layout/activity_gjc_inspection.xml
Normal file
171
module_gjc/src/main/res/layout/activity_gjc_inspection.xml
Normal file
@@ -0,0 +1,171 @@
|
|||||||
|
<?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.gjc.viewModel.GjcInspectionViewModel" />
|
||||||
|
</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"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<!-- 航班日期 -->
|
||||||
|
<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_date}"
|
||||||
|
type="@{SearchLayoutType.DATE}"
|
||||||
|
value="@={viewModel.flightDate}" />
|
||||||
|
|
||||||
|
<!-- 航班号 -->
|
||||||
|
<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.flightNo}" />
|
||||||
|
|
||||||
|
<!-- 代理 -->
|
||||||
|
<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.agentList}"
|
||||||
|
type="@{SearchLayoutType.SPINNER}"
|
||||||
|
value="@={viewModel.agentId}" />
|
||||||
|
|
||||||
|
<!-- 审核状态 -->
|
||||||
|
<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.auditStatusList}"
|
||||||
|
type="@{SearchLayoutType.SPINNER}"
|
||||||
|
value="@={viewModel.auditStatus}" />
|
||||||
|
|
||||||
|
<!-- 运单号 -->
|
||||||
|
<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}"
|
||||||
|
setOnIconClickListener="@{()-> viewModel.waybillScanClick()}"
|
||||||
|
type="@{SearchLayoutType.INPUT}"
|
||||||
|
value="@={viewModel.waybillNo}" />
|
||||||
|
|
||||||
|
<!-- 搜索按钮 -->
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
style="@style/iv_search_action"
|
||||||
|
android:onClick="@{()-> viewModel.searchClick()}"
|
||||||
|
android:src="@drawable/img_search" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</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_gjc_inspection" />
|
||||||
|
|
||||||
|
</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.totalCount+"票,总件数:"+viewModel.totalPc+",总重量:"+viewModel.totalWeight}'
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="18sp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
tools:text="合计:1票,总件数:100,总重量:100" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
style="@style/tv_bottom_btn"
|
||||||
|
android:onClick="@{()-> viewModel.auditRejectClick()}"
|
||||||
|
android:text="退回"
|
||||||
|
android:layout_marginRight="10dp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
style="@style/tv_bottom_btn"
|
||||||
|
android:onClick="@{()-> viewModel.auditPassClick()}"
|
||||||
|
android:text="通过" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
</layout>
|
||||||
277
module_gjc/src/main/res/layout/item_gjc_inspection.xml
Normal file
277
module_gjc/src/main/res/layout/item_gjc_inspection.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>
|
||||||
|
|
||||||
|
<variable
|
||||||
|
name="bean"
|
||||||
|
type="com.lukouguoji.module_base.bean.GjcInspectionBean" />
|
||||||
|
</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="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
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.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.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.agentCode}'
|
||||||
|
tools:text="SF" />
|
||||||
|
|
||||||
|
</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
|
||||||
|
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="NOR" />
|
||||||
|
|
||||||
|
</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='@{String.valueOf(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"
|
||||||
|
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='@{String.valueOf(bean.weight)}'
|
||||||
|
tools:text="12" />
|
||||||
|
|
||||||
|
</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.2"
|
||||||
|
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.flight}"
|
||||||
|
tools:text="20240216/MU2026" />
|
||||||
|
|
||||||
|
</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.range}'
|
||||||
|
tools:text="HFE - 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="@{5}"
|
||||||
|
android:text="预计起飞:" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@{bean.scheduledTackOff}"
|
||||||
|
tools:text="09:12" />
|
||||||
|
|
||||||
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
|
<!-- 业务类型 -->
|
||||||
|
<androidx.appcompat.widget.LinearLayoutCompat
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1.3"
|
||||||
|
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.businessName}'
|
||||||
|
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="@{5}"
|
||||||
|
android:text="审核状态:" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_status"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textStyle="bold"
|
||||||
|
tools:text="已通过" />
|
||||||
|
|
||||||
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<!-- 右侧箭头 -->
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="30dp"
|
||||||
|
android:layout_height="30dp"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:src="@mipmap/right_icon"
|
||||||
|
android:layout_marginLeft="10dp" />
|
||||||
|
|
||||||
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
</layout>
|
||||||
@@ -0,0 +1,56 @@
|
|||||||
|
package com.lukouguoji.gnc.page.inspection
|
||||||
|
|
||||||
|
import android.content.Context
|
||||||
|
import android.content.Intent
|
||||||
|
import android.os.Bundle
|
||||||
|
import com.alibaba.android.arouter.facade.annotation.Route
|
||||||
|
import com.lukouguoji.gnc.R
|
||||||
|
import com.lukouguoji.gnc.databinding.ActivityGncInspectionBinding
|
||||||
|
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_GNC_INSPECTION)
|
||||||
|
class GncInspectionActivity :
|
||||||
|
BaseBindingActivity<ActivityGncInspectionBinding, GncInspectionViewModel>() {
|
||||||
|
|
||||||
|
override fun layoutId() = R.layout.activity_gnc_inspection
|
||||||
|
|
||||||
|
override fun viewModelClass() = GncInspectionViewModel::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)
|
||||||
|
.observe(this) {
|
||||||
|
viewModel.refresh()
|
||||||
|
}
|
||||||
|
|
||||||
|
// 初始化代理列表
|
||||||
|
viewModel.initAgentList()
|
||||||
|
|
||||||
|
// 初始加载
|
||||||
|
viewModel.refresh()
|
||||||
|
}
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
@JvmStatic
|
||||||
|
fun start(context: Context) {
|
||||||
|
val starter = Intent(context, GncInspectionActivity::class.java)
|
||||||
|
context.startActivity(starter)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
package com.lukouguoji.gnc.page.inspection
|
||||||
|
|
||||||
|
import android.graphics.Color
|
||||||
|
import android.view.View
|
||||||
|
import com.lukouguoji.gnc.databinding.ItemGncInspectionBinding
|
||||||
|
import com.lukouguoji.module_base.base.BaseViewHolder
|
||||||
|
import com.lukouguoji.module_base.bean.GncInspectionBean
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 国内出港收运检查列表 ViewHolder
|
||||||
|
*/
|
||||||
|
class GncInspectionViewHolder(view: View) :
|
||||||
|
BaseViewHolder<GncInspectionBean, ItemGncInspectionBinding>(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())
|
||||||
|
}
|
||||||
|
|
||||||
|
// 根据审核状态设置颜色
|
||||||
|
when (bean.auditStatusName) {
|
||||||
|
"已通过" -> binding.tvStatus.setTextColor(Color.parseColor("#4CAF50")) // 绿色
|
||||||
|
"退回" -> binding.tvStatus.setTextColor(Color.parseColor("#F44336")) // 红色
|
||||||
|
else -> binding.tvStatus.setTextColor(Color.parseColor("#9E9E9E")) // 灰色
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,206 @@
|
|||||||
|
package com.lukouguoji.gnc.page.inspection
|
||||||
|
|
||||||
|
import android.app.Activity
|
||||||
|
import android.content.Intent
|
||||||
|
import androidx.lifecycle.MutableLiveData
|
||||||
|
import androidx.lifecycle.viewModelScope
|
||||||
|
import com.lukouguoji.gnc.R
|
||||||
|
import com.lukouguoji.module_base.base.BasePageViewModel
|
||||||
|
import com.lukouguoji.module_base.bean.GncInspectionBean
|
||||||
|
import com.lukouguoji.module_base.bean.StatisticsBean
|
||||||
|
import com.lukouguoji.module_base.common.Constant
|
||||||
|
import com.lukouguoji.module_base.common.ConstantEvent
|
||||||
|
import com.lukouguoji.module_base.http.net.NetApply
|
||||||
|
import com.lukouguoji.module_base.impl.FlowBus
|
||||||
|
import com.lukouguoji.module_base.ktx.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.toRequestBody
|
||||||
|
import com.lukouguoji.module_base.model.ScanModel
|
||||||
|
import com.lukouguoji.module_base.util.CheckUtil
|
||||||
|
import dev.utils.app.info.KeyValue
|
||||||
|
import kotlinx.coroutines.launch
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 国内出港收运检查 ViewModel
|
||||||
|
*/
|
||||||
|
class GncInspectionViewModel : BasePageViewModel() {
|
||||||
|
|
||||||
|
// 搜索条件
|
||||||
|
val flightDate = MutableLiveData("") // 航班日期
|
||||||
|
val flightNo = MutableLiveData("") // 航班号
|
||||||
|
val agentId = MutableLiveData("") // 代理ID
|
||||||
|
val auditStatus = MutableLiveData("") // 审核状态
|
||||||
|
val waybillNo = MutableLiveData("") // 运单号
|
||||||
|
|
||||||
|
// 代理下拉列表(需要从API获取,暂时用空列表)
|
||||||
|
val agentList = MutableLiveData(listOf(KeyValue("全部", "")))
|
||||||
|
|
||||||
|
// 审核状态下拉列表
|
||||||
|
val auditStatusList = MutableLiveData(
|
||||||
|
listOf(
|
||||||
|
KeyValue("全部", ""),
|
||||||
|
KeyValue("已通过", "1"),
|
||||||
|
KeyValue("退回", "2"),
|
||||||
|
KeyValue("未审核", "0"),
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
// 适配器配置
|
||||||
|
val itemViewHolder = GncInspectionViewHolder::class.java
|
||||||
|
val itemLayoutId = R.layout.item_gnc_inspection
|
||||||
|
|
||||||
|
// 统计数据
|
||||||
|
val totalCount = MutableLiveData("0") // 合计票数
|
||||||
|
val totalPc = MutableLiveData("0") // 总件数
|
||||||
|
val totalWeight = MutableLiveData("0") // 总重量
|
||||||
|
|
||||||
|
///////////////////////////////////////////////////////////////////////////
|
||||||
|
// 方法区
|
||||||
|
///////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 扫码输入运单号
|
||||||
|
*/
|
||||||
|
fun waybillScanClick() {
|
||||||
|
ScanModel.startScan(getTopActivity(), Constant.RequestCode.WAYBILL)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 搜索按钮点击
|
||||||
|
*/
|
||||||
|
fun searchClick() {
|
||||||
|
refresh()
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取列表数据
|
||||||
|
*/
|
||||||
|
override fun getData() {
|
||||||
|
val body = mapOf(
|
||||||
|
"page" to pageModel.page,
|
||||||
|
"limit" to pageModel.limit,
|
||||||
|
"flightDate" to flightDate.value!!.ifEmpty { null },
|
||||||
|
"flightNo" to flightNo.value!!.ifEmpty { null },
|
||||||
|
"agentId" to agentId.value!!.ifEmpty { null },
|
||||||
|
"auditStatus" to auditStatus.value!!.ifEmpty { null },
|
||||||
|
"waybillNo" to waybillNo.value!!.ifEmpty { null },
|
||||||
|
).toRequestBody()
|
||||||
|
|
||||||
|
launchLoadingCollect({
|
||||||
|
NetApply.api.getGncInspectionList(body)
|
||||||
|
}) {
|
||||||
|
onSuccess = {
|
||||||
|
pageModel.handleListBean(it)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
getStatistics(body)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取统计数据
|
||||||
|
*/
|
||||||
|
private fun getStatistics(body: okhttp3.RequestBody) {
|
||||||
|
launchCollect({
|
||||||
|
NetApply.api.getGncInspectionStatistics(body)
|
||||||
|
}) {
|
||||||
|
onSuccess = {
|
||||||
|
val stats = it.data ?: StatisticsBean()
|
||||||
|
totalCount.value = stats.totalCount.noNull("0")
|
||||||
|
totalPc.value = stats.totalPc.noNull("0")
|
||||||
|
totalWeight.value = stats.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 auditPassClick() {
|
||||||
|
val list = pageModel.rv!!.commonAdapter()!!.items as List<GncInspectionBean>
|
||||||
|
val filter = list.filter { it.checked.get() }
|
||||||
|
if (filter.isEmpty()) {
|
||||||
|
showToast("请选择数据")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
getTopActivity().showConfirmDialog("确定要通过选中的 ${filter.size} 条数据吗?") {
|
||||||
|
performAudit(filter, "1", "通过")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量审核 - 退回
|
||||||
|
*/
|
||||||
|
fun auditRejectClick() {
|
||||||
|
val list = pageModel.rv!!.commonAdapter()!!.items as List<GncInspectionBean>
|
||||||
|
val filter = list.filter { it.checked.get() }
|
||||||
|
if (filter.isEmpty()) {
|
||||||
|
showToast("请选择数据")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
getTopActivity().showConfirmDialog("确定要退回选中的 ${filter.size} 条数据吗?") {
|
||||||
|
performAudit(filter, "2", "退回")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 执行审核操作
|
||||||
|
*/
|
||||||
|
private fun performAudit(items: List<GncInspectionBean>, status: String, action: String) {
|
||||||
|
launchLoadingCollect({
|
||||||
|
NetApply.api.auditGncInspection(
|
||||||
|
mapOf(
|
||||||
|
"ids" to items.map { it.id },
|
||||||
|
"auditStatus" to status,
|
||||||
|
).toRequestBody()
|
||||||
|
)
|
||||||
|
}) {
|
||||||
|
onSuccess = {
|
||||||
|
showToast(it.msg.noNull("${action}成功"))
|
||||||
|
viewModelScope.launch {
|
||||||
|
FlowBus.with<String>(ConstantEvent.EVENT_REFRESH).emit("refresh")
|
||||||
|
}
|
||||||
|
refresh()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 全选/全不选
|
||||||
|
*/
|
||||||
|
fun checkAllClick() {
|
||||||
|
val list = pageModel.rv!!.commonAdapter()!!.items as List<GncInspectionBean>
|
||||||
|
CheckUtil.handleAllCheck(list)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 初始化代理下拉列表(从API获取)
|
||||||
|
*/
|
||||||
|
fun initAgentList() {
|
||||||
|
// TODO: 调用API获取代理列表
|
||||||
|
// 暂时使用模拟数据
|
||||||
|
agentList.value = listOf(
|
||||||
|
KeyValue("全部", ""),
|
||||||
|
KeyValue("SF", "SF"),
|
||||||
|
KeyValue("YTO", "YTO"),
|
||||||
|
KeyValue("ZTO", "ZTO"),
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
171
module_gnc/src/main/res/layout/activity_gnc_inspection.xml
Normal file
171
module_gnc/src/main/res/layout/activity_gnc_inspection.xml
Normal file
@@ -0,0 +1,171 @@
|
|||||||
|
<?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.gnc.page.inspection.GncInspectionViewModel" />
|
||||||
|
</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"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<!-- 航班日期 -->
|
||||||
|
<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_date}"
|
||||||
|
type="@{SearchLayoutType.DATE}"
|
||||||
|
value="@={viewModel.flightDate}" />
|
||||||
|
|
||||||
|
<!-- 航班号 -->
|
||||||
|
<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.flightNo}" />
|
||||||
|
|
||||||
|
<!-- 代理 -->
|
||||||
|
<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.agentList}"
|
||||||
|
type="@{SearchLayoutType.SPINNER}"
|
||||||
|
value="@={viewModel.agentId}" />
|
||||||
|
|
||||||
|
<!-- 审核状态 -->
|
||||||
|
<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.auditStatusList}"
|
||||||
|
type="@{SearchLayoutType.SPINNER}"
|
||||||
|
value="@={viewModel.auditStatus}" />
|
||||||
|
|
||||||
|
<!-- 运单号 -->
|
||||||
|
<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}"
|
||||||
|
setOnIconClickListener="@{()-> viewModel.waybillScanClick()}"
|
||||||
|
type="@{SearchLayoutType.INPUT}"
|
||||||
|
value="@={viewModel.waybillNo}" />
|
||||||
|
|
||||||
|
<!-- 搜索按钮 -->
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
style="@style/iv_search_action"
|
||||||
|
android:onClick="@{()-> viewModel.searchClick()}"
|
||||||
|
android:src="@drawable/img_search" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</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_gnc_inspection" />
|
||||||
|
|
||||||
|
</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.totalCount+"票,总件数:"+viewModel.totalPc+",总重量:"+viewModel.totalWeight}'
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="18sp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
tools:text="合计:1票,总件数:100,总重量:100" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
style="@style/tv_bottom_btn"
|
||||||
|
android:onClick="@{()-> viewModel.auditRejectClick()}"
|
||||||
|
android:text="退回"
|
||||||
|
android:layout_marginRight="10dp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
style="@style/tv_bottom_btn"
|
||||||
|
android:onClick="@{()-> viewModel.auditPassClick()}"
|
||||||
|
android:text="通过" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
</layout>
|
||||||
278
module_gnc/src/main/res/layout/item_gnc_inspection.xml
Normal file
278
module_gnc/src/main/res/layout/item_gnc_inspection.xml
Normal file
@@ -0,0 +1,278 @@
|
|||||||
|
<?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.GncInspectionBean" />
|
||||||
|
</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="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
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.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.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.agentCode}'
|
||||||
|
tools:text="SF" />
|
||||||
|
|
||||||
|
</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
|
||||||
|
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="NOR" />
|
||||||
|
|
||||||
|
</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.apc}'
|
||||||
|
tools:text="11" />
|
||||||
|
|
||||||
|
</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.weight}'
|
||||||
|
tools:text="12" />
|
||||||
|
|
||||||
|
</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.2"
|
||||||
|
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.flight}"
|
||||||
|
tools:text="20240216/MU2026" />
|
||||||
|
|
||||||
|
</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.route}'
|
||||||
|
tools:text="HFE - 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="@{5}"
|
||||||
|
android:text="预计起飞:" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@{bean.scheduledTackOff}"
|
||||||
|
tools:text="09:12" />
|
||||||
|
|
||||||
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
|
<!-- 业务类型 -->
|
||||||
|
<androidx.appcompat.widget.LinearLayoutCompat
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1.3"
|
||||||
|
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.businessType}'
|
||||||
|
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="@{5}"
|
||||||
|
android:text="审核状态:" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_status"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text='@{bean.auditStatusName}'
|
||||||
|
android:textStyle="bold"
|
||||||
|
tools:text="已通过" />
|
||||||
|
|
||||||
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<!-- 右侧箭头 -->
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="30dp"
|
||||||
|
android:layout_height="30dp"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:src="@mipmap/right_icon"
|
||||||
|
android:layout_marginLeft="10dp" />
|
||||||
|
|
||||||
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
</layout>
|
||||||
Reference in New Issue
Block a user