调整了餐盘柜3种情况处理
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
package com.sw.platecabinet.viewmodel
|
||||
|
||||
import com.sw.inbound.utils.DateTimeUtils
|
||||
import com.sw.plate.utils.ToastUtils
|
||||
import com.sw.platecabinet.GlobalData
|
||||
import com.sw.platecabinet.GlobalData.globalEquipmentCode
|
||||
import com.sw.platecabinet.model.ErrorInfo
|
||||
@@ -96,13 +95,7 @@ class SettingViewModel : BaseViewModel() {
|
||||
val response = repository.bindEquipment(bindParam)
|
||||
if (parseResponse(response)) {
|
||||
val userInfo = response.data
|
||||
userInfo?.let {
|
||||
if (it.isOtherEquipment()) {
|
||||
ToastUtils.showToast("餐盘已在${it.equipmentName}绑定")
|
||||
return@launchWithLoading
|
||||
}
|
||||
}
|
||||
_bindStateChange.value = true to ErrorInfo()
|
||||
_bindStateChange.value = true to ErrorInfo(equipmentUserInfo = userInfo)
|
||||
} else {
|
||||
_bindStateChange.value = true to ErrorInfo(response.code, response.msg.toString())
|
||||
}
|
||||
@@ -140,14 +133,6 @@ class SettingViewModel : BaseViewModel() {
|
||||
)
|
||||
val response = repository.findByPlateNumber(bindParam)
|
||||
if (response.code == 200) {
|
||||
val userInfo = response.data
|
||||
userInfo?.let {
|
||||
if (it.isOtherEquipment()) {
|
||||
ToastUtils.showToast("餐盘已在${it.equipmentName}绑定")
|
||||
return@launchWithLoading
|
||||
}
|
||||
}
|
||||
|
||||
_searchUserInfo.value = response.data
|
||||
} else {
|
||||
_searchUserInfo.value = EquipmentUserInfo(
|
||||
|
||||
Reference in New Issue
Block a user