调整了餐盘柜3种情况处理

This commit is contained in:
zxj
2025-07-25 13:35:17 +08:00
parent c89efd2d6f
commit c2bae2f3e8
14 changed files with 109 additions and 36 deletions
@@ -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(