|
@@ -56,15 +56,18 @@ class MaterialManualReplacementFragment :
|
|
|
|
|
|
|
|
// 新
|
|
// 新
|
|
|
val ciName = holder.getView<SelectableInput>(R.id.ci_name_new)
|
|
val ciName = holder.getView<SelectableInput>(R.id.ci_name_new)
|
|
|
|
|
+ ciName.setEnableStatus(!vo.isDone)
|
|
|
ciName.setText(vo.newName)
|
|
ciName.setText(vo.newName)
|
|
|
ciName.setOnTextChangeListener(object : SelectableInput.OnTextChangeListener {
|
|
ciName.setOnTextChangeListener(object : SelectableInput.OnTextChangeListener {
|
|
|
override fun onTextChange(str: String?) {
|
|
override fun onTextChange(str: String?) {
|
|
|
vo.newName = str
|
|
vo.newName = str
|
|
|
|
|
+ presenter?.syncData(mMaterialList, vo)
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
// 类型
|
|
// 类型
|
|
|
val ciType = holder.getView<SelectableInput>(R.id.ci_type_new)
|
|
val ciType = holder.getView<SelectableInput>(R.id.ci_type_new)
|
|
|
|
|
+ ciType.setEnableStatus(!vo.isDone)
|
|
|
ciType.setOptionList(mTypeList.map { it.materialsTypeName!! }.toMutableList())
|
|
ciType.setOptionList(mTypeList.map { it.materialsTypeName!! }.toMutableList())
|
|
|
ciType.setText(mTypeList.find { it.materialsTypeId == vo.selectedTypeId }?.materialsTypeName)
|
|
ciType.setText(mTypeList.find { it.materialsTypeId == vo.selectedTypeId }?.materialsTypeName)
|
|
|
ciType.setOnSpinnerSelectListener(object :
|
|
ciType.setOnSpinnerSelectListener(object :
|
|
@@ -75,11 +78,13 @@ class MaterialManualReplacementFragment :
|
|
|
}
|
|
}
|
|
|
vo.selectedTypeId = mTypeList[index].materialsTypeId
|
|
vo.selectedTypeId = mTypeList[index].materialsTypeId
|
|
|
mBinding?.rvReplacement?.adapter?.notifyItemChanged(position)
|
|
mBinding?.rvReplacement?.adapter?.notifyItemChanged(position)
|
|
|
|
|
+ presenter?.syncData(mMaterialList, vo)
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
// 型号
|
|
// 型号
|
|
|
val ciModel = holder.getView<SelectableInput>(R.id.ci_model_new)
|
|
val ciModel = holder.getView<SelectableInput>(R.id.ci_model_new)
|
|
|
|
|
+ ciModel.setEnableStatus(!vo.isDone)
|
|
|
ciModel.setOptionList(mPropertyList
|
|
ciModel.setOptionList(mPropertyList
|
|
|
.filter {
|
|
.filter {
|
|
|
it.propertyId.toString() ==
|
|
it.propertyId.toString() ==
|
|
@@ -92,22 +97,27 @@ class MaterialManualReplacementFragment :
|
|
|
SelectableInput.OnSpinnerSelectListener {
|
|
SelectableInput.OnSpinnerSelectListener {
|
|
|
override fun onSelect(str: String?, index: Int) {
|
|
override fun onSelect(str: String?, index: Int) {
|
|
|
vo.selectedModelId = mPropertyList[index].recordId
|
|
vo.selectedModelId = mPropertyList[index].recordId
|
|
|
|
|
+ presenter?.syncData(mMaterialList, vo)
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
val ciRfid = holder.getView<SelectableInput>(R.id.ci_rfid_new)
|
|
val ciRfid = holder.getView<SelectableInput>(R.id.ci_rfid_new)
|
|
|
|
|
+ ciRfid.setEnableStatus(!vo.isDone)
|
|
|
ciRfid.setText(vo.newRfid)
|
|
ciRfid.setText(vo.newRfid)
|
|
|
ciRfid.setOnTextChangeListener(object : SelectableInput.OnTextChangeListener {
|
|
ciRfid.setOnTextChangeListener(object : SelectableInput.OnTextChangeListener {
|
|
|
override fun onTextChange(str: String?) {
|
|
override fun onTextChange(str: String?) {
|
|
|
vo.newRfid = str
|
|
vo.newRfid = str
|
|
|
|
|
+ presenter?.syncData(mMaterialList, vo)
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
val ciDate = holder.getView<SelectableInput>(R.id.ci_date_new)
|
|
val ciDate = holder.getView<SelectableInput>(R.id.ci_date_new)
|
|
|
|
|
+ ciDate.setEnableStatus(!vo.isDone)
|
|
|
ciDate.setText(vo.newDate)
|
|
ciDate.setText(vo.newDate)
|
|
|
ciDate.setOnTextChangeListener(object : SelectableInput.OnTextChangeListener {
|
|
ciDate.setOnTextChangeListener(object : SelectableInput.OnTextChangeListener {
|
|
|
override fun onTextChange(str: String?) {
|
|
override fun onTextChange(str: String?) {
|
|
|
vo.newDate = str
|
|
vo.newDate = str
|
|
|
|
|
+ presenter?.syncData(mMaterialList, vo)
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
|
|
|
|
@@ -116,14 +126,18 @@ class MaterialManualReplacementFragment :
|
|
|
.into(holder.getView(R.id.iv_new))
|
|
.into(holder.getView(R.id.iv_new))
|
|
|
|
|
|
|
|
// 按钮
|
|
// 按钮
|
|
|
|
|
+ holder.setVisible(R.id.tv_reset, vo.isDone)
|
|
|
holder.setOnClickListener(R.id.tv_reset) {
|
|
holder.setOnClickListener(R.id.tv_reset) {
|
|
|
- vo.selectedTypeId = vo.materialsTypeId
|
|
|
|
|
- vo.selectedModelId = vo.propertiesValueId?.toLong()
|
|
|
|
|
|
|
+ vo.isDone = false
|
|
|
mBinding?.rvReplacement?.adapter?.notifyItemChanged(position)
|
|
mBinding?.rvReplacement?.adapter?.notifyItemChanged(position)
|
|
|
|
|
+ presenter?.syncData(mMaterialList, vo)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ holder.setVisible(R.id.tv_confirm, !vo.isDone)
|
|
|
holder.setOnClickListener(R.id.tv_confirm) {
|
|
holder.setOnClickListener(R.id.tv_confirm) {
|
|
|
- // TODO 确定更换
|
|
|
|
|
|
|
+ vo.isDone = true
|
|
|
|
|
+ mBinding?.rvReplacement?.adapter?.notifyItemChanged(position)
|
|
|
|
|
+ presenter?.syncData(mMaterialList, vo)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -141,6 +155,15 @@ class MaterialManualReplacementFragment :
|
|
|
presenter?.getManualReplacementList {
|
|
presenter?.getManualReplacementList {
|
|
|
it?.let {
|
|
it?.let {
|
|
|
mMaterialList.addAll(it)
|
|
mMaterialList.addAll(it)
|
|
|
|
|
+ mMaterialList.forEach {
|
|
|
|
|
+ it.materials?.forEach { itDetail ->
|
|
|
|
|
+ itDetail.newName = itDetail.materialsName
|
|
|
|
|
+ itDetail.newRfid = itDetail.materialsRfid
|
|
|
|
|
+ itDetail.newDate = itDetail.expirationDate
|
|
|
|
|
+ itDetail.selectedTypeId = itDetail.materialsTypeId
|
|
|
|
|
+ itDetail.selectedModelId = itDetail.propertiesValueId?.toLong()
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
val list = mutableListOf<ExpandableTabLayout.ItemData>()
|
|
val list = mutableListOf<ExpandableTabLayout.ItemData>()
|
|
|
it?.forEach { itData ->
|
|
it?.forEach { itData ->
|
|
@@ -158,13 +181,6 @@ class MaterialManualReplacementFragment :
|
|
|
mMaterialList[0].materials?.let {
|
|
mMaterialList[0].materials?.let {
|
|
|
mDetailList.addAll(it)
|
|
mDetailList.addAll(it)
|
|
|
}
|
|
}
|
|
|
- mDetailList.forEach {
|
|
|
|
|
- it.newName = it.materialsName
|
|
|
|
|
- it.newRfid = it.materialsRfid
|
|
|
|
|
- it.newDate = it.expirationDate
|
|
|
|
|
- it.selectedTypeId = it.materialsTypeId
|
|
|
|
|
- it.selectedModelId = it.propertiesValueId?.toLong()
|
|
|
|
|
- }
|
|
|
|
|
}
|
|
}
|
|
|
mBinding?.rvReplacement?.adapter?.notifyDataSetChanged()
|
|
mBinding?.rvReplacement?.adapter?.notifyDataSetChanged()
|
|
|
}
|
|
}
|