优化
This commit is contained in:
@@ -1,17 +1,16 @@
|
||||
package com.sw.inbound.activity
|
||||
|
||||
import android.util.Log
|
||||
import android.annotation.SuppressLint
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import com.sw.inbound.R
|
||||
import com.sw.inbound.adapter.SelfProcurementAdapter
|
||||
import com.sw.inbound.dialog.WarnDialog
|
||||
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 {
|
||||
@@ -26,12 +25,13 @@ class SelfProcurementActivity : GoodsListActivity() {
|
||||
///删除行数据弹窗
|
||||
showWarnDialog(content = "请确认是否删除该条入库数据,删除后将无法恢复?") {
|
||||
removeAt(position)
|
||||
userViewModel.putGoodsData(localGoodsKey, goodsList.toJsonString())
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun showWarnDialog(content:String, callback:()-> Unit) {
|
||||
private fun showWarnDialog(content: String, callback: () -> Unit) {
|
||||
WarnDialog(context = this, content = content, confirmBlock = callback).show()
|
||||
}
|
||||
|
||||
@@ -42,11 +42,19 @@ class SelfProcurementActivity : GoodsListActivity() {
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressLint("NotifyDataSetChanged")
|
||||
override fun initView() {
|
||||
binding.tvPurchaseNo.text = "自采入库"
|
||||
binding.btnConfirmReceipt.setOnClickListener {
|
||||
selfProcurementSubmit()
|
||||
}
|
||||
|
||||
val localGodsList = userViewModel.getGoodsList(localGoodsKey)
|
||||
if (localGodsList.isNullOrEmpty().not()) {
|
||||
//本地数据为空则加载本地数据
|
||||
goodsList.addAll(localGodsList)
|
||||
adapter.notifyDataSetChanged()
|
||||
}
|
||||
}
|
||||
|
||||
override fun getWarehouseList(): List<DictType> {
|
||||
|
||||
Reference in New Issue
Block a user