出入库功能改版
This commit is contained in:
@@ -0,0 +1,54 @@
|
||||
package com.sw.inbound.activity
|
||||
|
||||
import android.util.Log
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import com.sw.inbound.R
|
||||
import com.sw.inbound.adapter.SelfProcurementAdapter
|
||||
import com.sw.inbound.model.request.PurchaseWarehouseParam
|
||||
import com.sw.inbound.model.response.DictType
|
||||
import com.sw.inbound.utils.ext.toJsonString
|
||||
import com.sw.inbound.utils.ext.toast
|
||||
import timber.log.Timber
|
||||
import kotlin.getValue
|
||||
|
||||
class SelfProcurementActivity : GoodsListActivity() {
|
||||
|
||||
private val adapter by lazy {
|
||||
SelfProcurementAdapter(goodsList).apply {
|
||||
setOnItemClickListener { adapter, view, position ->
|
||||
goodsList[position].let {
|
||||
it.isSelected = it.isSelected.not()
|
||||
}
|
||||
notifyItemChanged(position)
|
||||
}
|
||||
addOnItemChildClickListener(R.id.ivState) { adapter, view, position ->
|
||||
removeAt(position)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun initRecyclerView() {
|
||||
binding.rvGoodsList.let {
|
||||
it.layoutManager = LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false)
|
||||
it.adapter = adapter
|
||||
}
|
||||
}
|
||||
|
||||
override fun initView() {
|
||||
binding.tvPurchaseNo.text = "自采入库"
|
||||
binding.btnConfirmReceipt.setOnClickListener {
|
||||
selfProcurementSubmit()
|
||||
}
|
||||
}
|
||||
|
||||
override fun getWarehouseList(): List<DictType> {
|
||||
return goodsList.filter {
|
||||
it.warehouseId.isNullOrBlank().not() && it.warehouseName.isNullOrBlank().not()
|
||||
}
|
||||
.distinctBy { it.warehouseId }
|
||||
.map {
|
||||
DictType(id = it.warehouseId!!, value = it.warehouseName!!)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user