feat: 国际出港收运检查列表 pass/back
This commit is contained in:
@@ -380,6 +380,20 @@ interface Api {
|
||||
@POST("IntExpCheckInCheck/audit")
|
||||
suspend fun auditGjcInspection(@Body data: RequestBody): BaseResultBean<SimpleResultBean>
|
||||
|
||||
/**
|
||||
* 国际出港收运审核-通过(运单列表maWbId、wbNo必填)
|
||||
* 接口路径: /IntExpCheckInCheck/pass
|
||||
*/
|
||||
@POST("IntExpCheckInCheck/pass")
|
||||
suspend fun passGjcInspection(@Body data: RequestBody): BaseResultBean<Boolean>
|
||||
|
||||
/**
|
||||
* 国际出港收运审核-退回(运单列表maWbId、wbNo必填)
|
||||
* 接口路径: /IntExpCheckInCheck/back
|
||||
*/
|
||||
@POST("IntExpCheckInCheck/back")
|
||||
suspend fun backGjcInspection(@Body data: RequestBody): BaseResultBean<Boolean>
|
||||
|
||||
/**
|
||||
* 条件查询-国际出港-收运审核-统计数据(总件数、总重量、运单总数)
|
||||
* 接口路径: /IntExpCheckInCheck/pageQueryTotal
|
||||
|
||||
@@ -65,7 +65,7 @@ class GjcInspectionViewModel : BasePageViewModel() {
|
||||
|
||||
init {
|
||||
// 设置航班日期默认值为当前日期
|
||||
flightDate.value = Date().formatDate()
|
||||
// flightDate.value = Date().formatDate()
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
@@ -183,16 +183,24 @@ class GjcInspectionViewModel : BasePageViewModel() {
|
||||
* @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()
|
||||
// 构建请求参数:数组对象,包含 maWbId 和 wbNo
|
||||
val requestData = items.map {
|
||||
mapOf(
|
||||
"maWbId" to it.maWbId,
|
||||
"wbNo" to it.wbNo
|
||||
)
|
||||
}.toRequestBody()
|
||||
|
||||
// 根据审核状态调用不同接口
|
||||
launchLoadingCollect({
|
||||
if (status == "1") {
|
||||
NetApply.api.passGjcInspection(requestData)
|
||||
} else {
|
||||
NetApply.api.backGjcInspection(requestData)
|
||||
}
|
||||
}) {
|
||||
onSuccess = {
|
||||
showToast(it.msg.noNull("${action}成功"))
|
||||
showToast("${action}成功")
|
||||
viewModelScope.launch {
|
||||
FlowBus.with<String>(ConstantEvent.EVENT_REFRESH).emit("refresh")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user