package com.lukouguoji.module_base.bean

import androidx.databinding.BaseObservable
import androidx.databinding.Bindable
import androidx.databinding.ObservableBoolean
import com.lukouguoji.module_base.BR

class FlatcarBean : BaseObservable() {

    // 购买日期
    @Bindable
    var buyDate: String = ""
        set(value) {
            field = value
            notifyPropertyChanged(BR.buyDate)
        }

    // 平板车号
    @Bindable
    var carId: String = ""
        set(value) {
            field = value
            notifyPropertyChanged(BR.carId)
        }

    // 自重
    @Bindable
    var carWeight: String = ""
        set(value) {
            field = value
            notifyPropertyChanged(BR.carWeight)
        }

    // 最大载重
    @Bindable
    var maxWeight: String = ""
        set(value) {
            field = value
            notifyPropertyChanged(BR.maxWeight)
        }

    // 组织机构代码
    @Bindable
    var organizationCode: String = ""
        set(value) {
            field = value
            notifyPropertyChanged(BR.organizationCode)
        }

    // 生产商
    @Bindable
    var producers: String = ""
        set(value) {
            field = value
            notifyPropertyChanged(BR.producers)
        }

    // 备注
    @Bindable
    var remark: String = ""
        set(value) {
            field = value
            notifyPropertyChanged(BR.remark)
        }

    // 标重
    @Bindable
    var signWeight: String = ""
        set(value) {
            field = value
            notifyPropertyChanged(BR.signWeight)
        }

    // 状态 0:正常  1:故障
    @Bindable
    var status: String = ""
        set(value) {
            field = value
            notifyPropertyChanged(BR.status)
        }

    // 位置
    @Bindable
    var position: String = ""
        set(value) {
            field = value
            notifyPropertyChanged(BR.position)
        }

    @Bindable
    var positionName: String = ""
        set(value) {
            field = value
            notifyPropertyChanged(BR.positionName)
        }


    fun getStatusName() = when (status) {
        "0" -> "正常"
        "1" -> "故障"
        else -> ""
    }

    val checked = ObservableBoolean(false)

    //是否需要新增
    var addFalg = true
    //卸机id
    var xieJiId : String = ""
}