|
@@ -6,6 +6,7 @@ import com.google.android.material.card.MaterialCardView
|
|
|
import com.grkj.iscs.R
|
|
import com.grkj.iscs.R
|
|
|
import com.grkj.iscs.databinding.FragmentStepBinding
|
|
import com.grkj.iscs.databinding.FragmentStepBinding
|
|
|
import com.grkj.iscs.model.bo.PageChangeBO
|
|
import com.grkj.iscs.model.bo.PageChangeBO
|
|
|
|
|
+import com.grkj.iscs.model.vo.ticket.LotoMapRespVO
|
|
|
import com.grkj.iscs.model.vo.ticket.StepDetailRespVO
|
|
import com.grkj.iscs.model.vo.ticket.StepDetailRespVO
|
|
|
import com.grkj.iscs.util.log.LogUtil
|
|
import com.grkj.iscs.util.log.LogUtil
|
|
|
import com.grkj.iscs.view.base.BaseMvpFragment
|
|
import com.grkj.iscs.view.base.BaseMvpFragment
|
|
@@ -17,9 +18,11 @@ import com.zhy.adapter.recyclerview.base.ViewHolder
|
|
|
/**
|
|
/**
|
|
|
* 作业票执行步骤页 - 八大步骤
|
|
* 作业票执行步骤页 - 八大步骤
|
|
|
*/
|
|
*/
|
|
|
-class StepFragment(val goBack: () -> Unit, val changePage: (PageChangeBO) -> Unit) : BaseMvpFragment<IStepView, StepPresenter, FragmentStepBinding>() {
|
|
|
|
|
|
|
+class StepFragment(val goBack: () -> Unit, val changePage: (PageChangeBO) -> Unit) :
|
|
|
|
|
+ BaseMvpFragment<IStepView, StepPresenter, FragmentStepBinding>() {
|
|
|
|
|
|
|
|
private lateinit var mStepList: MutableList<StepBO>
|
|
private lateinit var mStepList: MutableList<StepBO>
|
|
|
|
|
+ private var mLotoList = mutableListOf<LotoMapRespVO>()
|
|
|
|
|
|
|
|
override val viewBinding: FragmentStepBinding
|
|
override val viewBinding: FragmentStepBinding
|
|
|
get() = FragmentStepBinding.inflate(layoutInflater)
|
|
get() = FragmentStepBinding.inflate(layoutInflater)
|
|
@@ -53,22 +56,22 @@ class StepFragment(val goBack: () -> Unit, val changePage: (PageChangeBO) -> Uni
|
|
|
holder.getView<ImageView>(R.id.iv_status).setImageResource(if (step.stepDetail?.stepStatus == "1") R.mipmap.step_executed else R.mipmap.step_not_executed)
|
|
holder.getView<ImageView>(R.id.iv_status).setImageResource(if (step.stepDetail?.stepStatus == "1") R.mipmap.step_executed else R.mipmap.step_not_executed)
|
|
|
holder.setText(R.id.tv_status,
|
|
holder.setText(R.id.tv_status,
|
|
|
if (step.stepDetail?.stepStatus == "1") {
|
|
if (step.stepDetail?.stepStatus == "1") {
|
|
|
- if (step.index == 3) {
|
|
|
|
|
- getString(R.string.allocated)
|
|
|
|
|
- } else {
|
|
|
|
|
- getString(R.string.executed)
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ if (step.index == 3) getString(R.string.allocated) else getString(R.string.executed)
|
|
|
} else {
|
|
} else {
|
|
|
- if (step.index == 3) {
|
|
|
|
|
- getString(R.string.not_allocated)
|
|
|
|
|
- } else {
|
|
|
|
|
- getString(R.string.not_executed)
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ if (step.index == 3) getString(R.string.not_allocated) else getString(R.string.not_executed)
|
|
|
}
|
|
}
|
|
|
)
|
|
)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ mBinding?.rvLoto?.adapter = object : CommonAdapter<LotoMapRespVO>(requireContext(), R.layout.item_rv_loto, mLotoList) {
|
|
|
|
|
+ override fun convert(holder: ViewHolder, loto: LotoMapRespVO, position: Int) {
|
|
|
|
|
+ Glide.with(this@StepFragment).load(loto.pointIcon).into(holder.getView(R.id.iv_icon))
|
|
|
|
|
+ holder.setText(R.id.tv_name, loto.pointName)
|
|
|
|
|
+ holder.setVisible(R.id.rl_cover, loto.state == true)
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
mBinding?.cbBack?.setOnClickListener {
|
|
mBinding?.cbBack?.setOnClickListener {
|
|
|
goBack()
|
|
goBack()
|
|
|
}
|
|
}
|
|
@@ -90,8 +93,13 @@ class StepFragment(val goBack: () -> Unit, val changePage: (PageChangeBO) -> Uni
|
|
|
}
|
|
}
|
|
|
mBinding?.rvStep?.adapter?.notifyDataSetChanged()
|
|
mBinding?.rvStep?.adapter?.notifyDataSetChanged()
|
|
|
}
|
|
}
|
|
|
- presenter?.getMachineryDetail(changeBO.machineryId!!) {
|
|
|
|
|
- Glide.with(this).load(it?.machineryImg).into(mBinding?.ivMachinery!!)
|
|
|
|
|
|
|
+ presenter?.getMachineryDetail(changeBO.machineryId!!,
|
|
|
|
|
+ { Glide.with(this).load(it?.machineryImg).into(mBinding?.ivMachinery!!) }) { itList ->
|
|
|
|
|
+ itList?.let {
|
|
|
|
|
+ mLotoList.clear()
|
|
|
|
|
+ mLotoList.addAll(it)
|
|
|
|
|
+ } ?: mLotoList.clear()
|
|
|
|
|
+ mBinding?.rvLoto?.adapter?.notifyDataSetChanged()
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|