添加采购单位添加后同步
This commit is contained in:
@@ -119,8 +119,8 @@ class RemoteRepository @Inject constructor(
|
||||
|
||||
suspend fun searchGoodsInfoList(
|
||||
goodsName: String,
|
||||
pageNo: Int,
|
||||
pageSize: Int
|
||||
pageNo: Int = 1,
|
||||
pageSize: Int = 10
|
||||
): ApiResponse<SearchGoodsInfo> {
|
||||
return safeApiCall {
|
||||
apiService.searchGoodsInfoList(goodsName, pageNo, pageSize)
|
||||
|
||||
@@ -360,6 +360,20 @@ class SelfProcurementViewModel @Inject constructor(
|
||||
_goodsAddUnitParam.value = GoodsPurchaseUnitParam()
|
||||
// _addGoodsPurchaseUnitResult.value = true
|
||||
ToastUtils.showToast("采购单位添加成功")
|
||||
|
||||
// 通过id搜索物品,补充采购单位
|
||||
val response = repository.searchGoodsInfoList(
|
||||
goodsName = "${_selectedItem.value?.goodsId}"
|
||||
)
|
||||
if (parseResponse(response)) {
|
||||
val searchList: List<SearchGoodsInfo.Record> =
|
||||
response.result?.records ?: emptyList()
|
||||
if (searchList.isNotEmpty()) {
|
||||
_selectedItem.value = _selectedItem.value?.copy(
|
||||
unitList = searchList[0].unitVoList
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user