|
@@ -2,9 +2,12 @@ package cn.muchinfo.rma.view.base.procurement
|
|
|
|
|
|
|
|
import android.os.Bundle
|
|
import android.os.Bundle
|
|
|
import android.view.Gravity
|
|
import android.view.Gravity
|
|
|
|
|
+import android.view.MotionEvent
|
|
|
import android.view.View
|
|
import android.view.View
|
|
|
import android.view.ViewGroup
|
|
import android.view.ViewGroup
|
|
|
import androidx.appcompat.app.AppCompatActivity
|
|
import androidx.appcompat.app.AppCompatActivity
|
|
|
|
|
+import androidx.recyclerview.widget.LinearLayoutManager
|
|
|
|
|
+import androidx.recyclerview.widget.RecyclerView
|
|
|
import androidx.viewpager.widget.PagerAdapter
|
|
import androidx.viewpager.widget.PagerAdapter
|
|
|
import androidx.viewpager.widget.ViewPager
|
|
import androidx.viewpager.widget.ViewPager
|
|
|
import cn.muchinfo.rma.R
|
|
import cn.muchinfo.rma.R
|
|
@@ -18,15 +21,18 @@ import cn.muchinfo.rma.global.isShowTimeString
|
|
|
import cn.muchinfo.rma.lifecycle.bindOptional
|
|
import cn.muchinfo.rma.lifecycle.bindOptional
|
|
|
import cn.muchinfo.rma.view.autoWidget.*
|
|
import cn.muchinfo.rma.view.autoWidget.*
|
|
|
import cn.muchinfo.rma.view.base.BaseActivity
|
|
import cn.muchinfo.rma.view.base.BaseActivity
|
|
|
|
|
+import cn.muchinfo.rma.view.base.app.Constant
|
|
|
import cn.muchinfo.rma.view.base.home.business.BusinessManagementViewholder
|
|
import cn.muchinfo.rma.view.base.home.business.BusinessManagementViewholder
|
|
|
import cn.muchinfo.rma.view.base.home.commodity.viewholder.ChangeLogViewHolder
|
|
import cn.muchinfo.rma.view.base.home.commodity.viewholder.ChangeLogViewHolder
|
|
|
import cn.muchinfo.rma.view.base.home.contract.viewItemUI
|
|
import cn.muchinfo.rma.view.base.home.contract.viewItemUI
|
|
|
|
|
+import cn.muchinfo.rma.view.base.home.inventory.inventorymanager.adapter.ApplyRecordAdapter
|
|
|
import cn.muchinfo.rma.view.base.procurement.data.ContractDetailsData
|
|
import cn.muchinfo.rma.view.base.procurement.data.ContractDetailsData
|
|
|
import cn.muchinfo.rma.view.base.procurement.detailsviewholder.ChangeRecordViewHolder
|
|
import cn.muchinfo.rma.view.base.procurement.detailsviewholder.ChangeRecordViewHolder
|
|
|
import cn.muchinfo.rma.view.base.procurement.detailsviewholder.ContractDetailsViewHolder
|
|
import cn.muchinfo.rma.view.base.procurement.detailsviewholder.ContractDetailsViewHolder
|
|
|
import cn.muchinfo.rma.view.base.procurement.detailsviewholder.InvoiceRecordViewHolder
|
|
import cn.muchinfo.rma.view.base.procurement.detailsviewholder.InvoiceRecordViewHolder
|
|
|
import cn.muchinfo.rma.view.base.procurement.detailsviewholder.PriceRecordViewHolder
|
|
import cn.muchinfo.rma.view.base.procurement.detailsviewholder.PriceRecordViewHolder
|
|
|
import com.blankj.utilcode.util.ConvertUtils
|
|
import com.blankj.utilcode.util.ConvertUtils
|
|
|
|
|
+import com.blankj.utilcode.util.SizeUtils
|
|
|
import com.qmuiteam.qmui.util.QMUIDisplayHelper
|
|
import com.qmuiteam.qmui.util.QMUIDisplayHelper
|
|
|
import com.qmuiteam.qmui.widget.tab.QMUITabIndicator
|
|
import com.qmuiteam.qmui.widget.tab.QMUITabIndicator
|
|
|
import com.qmuiteam.qmui.widget.tab.QMUITabSegment
|
|
import com.qmuiteam.qmui.widget.tab.QMUITabSegment
|
|
@@ -47,8 +53,16 @@ class ContractDetailActivity : BaseActivity<ProcurementViewModel>() {
|
|
|
intent.getParcelableExtra<ContractData>("data") as ContractData
|
|
intent.getParcelableExtra<ContractData>("data") as ContractData
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ // type 1 采购 2 销售
|
|
|
|
|
+ private val type by lazy { intent.getStringExtra("type") }
|
|
|
|
|
+
|
|
|
private val tabsArray: List<String> by lazy {
|
|
private val tabsArray: List<String> by lazy {
|
|
|
- arrayListOf("合同详情", "点价登记", "结算登记", "款项登记", "发票登记", "变更记录")
|
|
|
|
|
|
|
+ if (type == "1") {
|
|
|
|
|
+ arrayListOf("合同详情", "点价登记", "结算登记", "款项登记", "发票登记","入库登记", "变更记录")
|
|
|
|
|
+ } else {
|
|
|
|
|
+ arrayListOf("合同详情", "点价登记", "结算登记", "款项登记", "发票登记","出库登记", "变更记录")
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//合同详情
|
|
//合同详情
|
|
@@ -66,6 +80,9 @@ class ContractDetailActivity : BaseActivity<ProcurementViewModel>() {
|
|
|
//发票登记
|
|
//发票登记
|
|
|
private val invoiceRecordUI by lazy { InvoiceRecordUI(this, viewModel, data) }
|
|
private val invoiceRecordUI by lazy { InvoiceRecordUI(this, viewModel, data) }
|
|
|
|
|
|
|
|
|
|
+ //出入库记录
|
|
|
|
|
+ private val inventoryRecordUI by lazy { InventoryRecordUI(this, viewModel, data, type ?: "1") }
|
|
|
|
|
+
|
|
|
//变更登记
|
|
//变更登记
|
|
|
private val changeRecordUI by lazy { ChangeRecordUI(this, viewModel, data) }
|
|
private val changeRecordUI by lazy { ChangeRecordUI(this, viewModel, data) }
|
|
|
|
|
|
|
@@ -117,6 +134,14 @@ class ContractDetailActivity : BaseActivity<ProcurementViewModel>() {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
5 -> {
|
|
5 -> {
|
|
|
|
|
+ return inventoryRecordUI.root.apply {
|
|
|
|
|
+ container.addView(
|
|
|
|
|
+ this,
|
|
|
|
|
+ ViewGroup.LayoutParams(matchParent, matchParent)
|
|
|
|
|
+ )
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ 6 -> {
|
|
|
return changeRecordUI.root.apply {
|
|
return changeRecordUI.root.apply {
|
|
|
container.addView(
|
|
container.addView(
|
|
|
this,
|
|
this,
|
|
@@ -163,6 +188,7 @@ class ContractDetailActivity : BaseActivity<ProcurementViewModel>() {
|
|
|
selectedTabIndex = index
|
|
selectedTabIndex = index
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
|
|
+ mode = QMUITabSegment.MODE_FIXED
|
|
|
setIndicator(
|
|
setIndicator(
|
|
|
QMUITabIndicator(
|
|
QMUITabIndicator(
|
|
|
QMUIDisplayHelper.dp2px(context, 2),
|
|
QMUIDisplayHelper.dp2px(context, 2),
|
|
@@ -209,7 +235,8 @@ class ContractDetailsUI(
|
|
|
private val data: ContractData
|
|
private val data: ContractData
|
|
|
) {
|
|
) {
|
|
|
|
|
|
|
|
- private val unSubmitAdapter: BaseAdapter<ContractDetailsData, ContractDetailsViewHolder> = BaseAdapter { _, _ -> ContractDetailsViewHolder(activity) }
|
|
|
|
|
|
|
+ private val unSubmitAdapter: BaseAdapter<ContractDetailsData, ContractDetailsViewHolder> =
|
|
|
|
|
+ BaseAdapter { _, _ -> ContractDetailsViewHolder(activity) }
|
|
|
val root = _FrameLayout(activity).apply {
|
|
val root = _FrameLayout(activity).apply {
|
|
|
verticalLayout {
|
|
verticalLayout {
|
|
|
|
|
|
|
@@ -219,19 +246,49 @@ class ContractDetailsUI(
|
|
|
}.lparams(matchParent, autoSize(1600))
|
|
}.lparams(matchParent, autoSize(1600))
|
|
|
|
|
|
|
|
val datalist = arrayListOf<ContractDetailsData>(
|
|
val datalist = arrayListOf<ContractDetailsData>(
|
|
|
- ContractDetailsData(title = ViewEnumUtils.getContractType(data.contracttype ?: "") + "-" + ViewEnumUtils.getPriceType(data.pricetype ?: "") + "合同",content = data.contractno?.isBlankString() ?: ""),
|
|
|
|
|
- ContractDetailsData(title = if (data.contracttype == "1") { "销售方" }else{ "采购方" },content = data.accountname ?: "" ),
|
|
|
|
|
- ContractDetailsData(title = "现货品种",content = data.deliverygoodsname ?: ""),
|
|
|
|
|
- ContractDetailsData(title = "产品类型",content = ViewEnumUtils.getProductType(data.producttype ?: "")),
|
|
|
|
|
- ContractDetailsData(title = "产品规格",content = data.spotgoodsdesc ?: ""),
|
|
|
|
|
- ContractDetailsData(title = "定价类型",content = ViewEnumUtils.getPriceType(data.pricetype ?: "")),
|
|
|
|
|
- ContractDetailsData(title = "期货合约",content = data.goodsname ?: ""),
|
|
|
|
|
- ContractDetailsData(title = "升贴水",content = data.pricemove ?: ""),
|
|
|
|
|
- ContractDetailsData(title = "标仓系数",content = data.convertfactor ?: ""),
|
|
|
|
|
- ContractDetailsData(title = "点价期",content = data.startdate?.isShowTimeString("MM-dd") + "~" + data.enddate?.isShowTimeString("MM-dd")),
|
|
|
|
|
- ContractDetailsData(title = "交收期",content = data.deliverystartdate?.isShowTimeString("MM-dd") + "~" + data.deliveryenddate?.isShowTimeString("MM-dd")),
|
|
|
|
|
- ContractDetailsData(title = "合同量",content = data.qty ?: "" + data.enumdicname ?: ""),
|
|
|
|
|
- ContractDetailsData(title = "初始保证金",content = data.margin ?: "")
|
|
|
|
|
|
|
+ ContractDetailsData(
|
|
|
|
|
+ title = ViewEnumUtils.getContractType(
|
|
|
|
|
+ data.contracttype ?: ""
|
|
|
|
|
+ ) + "-" + ViewEnumUtils.getPriceType(data.pricetype ?: "") + "合同",
|
|
|
|
|
+ content = data.contractno?.isBlankString() ?: ""
|
|
|
|
|
+ ),
|
|
|
|
|
+ ContractDetailsData(
|
|
|
|
|
+ title = if (data.contracttype == "1") {
|
|
|
|
|
+ "销售方"
|
|
|
|
|
+ } else {
|
|
|
|
|
+ "采购方"
|
|
|
|
|
+ }, content = data.accountname ?: ""
|
|
|
|
|
+ ),
|
|
|
|
|
+ ContractDetailsData(title = "现货品种", content = data.deliverygoodsname ?: ""),
|
|
|
|
|
+ ContractDetailsData(
|
|
|
|
|
+ title = "产品类型",
|
|
|
|
|
+ content = ViewEnumUtils.getProductType(data.producttype ?: "")
|
|
|
|
|
+ ),
|
|
|
|
|
+ ContractDetailsData(title = "产品规格", content = data.spotgoodsdesc ?: ""),
|
|
|
|
|
+ ContractDetailsData(
|
|
|
|
|
+ title = "定价类型",
|
|
|
|
|
+ content = ViewEnumUtils.getPriceType(data.pricetype ?: "")
|
|
|
|
|
+ ),
|
|
|
|
|
+ ContractDetailsData(title = "期货合约", content = data.goodsname ?: ""),
|
|
|
|
|
+ ContractDetailsData(title = "升贴水", content = data.pricemove ?: ""),
|
|
|
|
|
+ ContractDetailsData(title = "标仓系数", content = data.convertfactor ?: ""),
|
|
|
|
|
+ ContractDetailsData(
|
|
|
|
|
+ title = "点价期",
|
|
|
|
|
+ content = data.startdate?.isShowTimeString("MM-dd") + "~" + data.enddate?.isShowTimeString(
|
|
|
|
|
+ "MM-dd"
|
|
|
|
|
+ )
|
|
|
|
|
+ ),
|
|
|
|
|
+ ContractDetailsData(
|
|
|
|
|
+ title = "交收期",
|
|
|
|
|
+ content = data.deliverystartdate?.isShowTimeString("MM-dd") + "~" + data.deliveryenddate?.isShowTimeString(
|
|
|
|
|
+ "MM-dd"
|
|
|
|
|
+ )
|
|
|
|
|
+ ),
|
|
|
|
|
+ ContractDetailsData(
|
|
|
|
|
+ title = "合同量",
|
|
|
|
|
+ content = data.qty ?: "" + data.enumdicname ?: ""
|
|
|
|
|
+ ),
|
|
|
|
|
+ ContractDetailsData(title = "初始保证金", content = data.margin ?: "")
|
|
|
)
|
|
)
|
|
|
unSubmitAdapter.setNewData(datalist)
|
|
unSubmitAdapter.setNewData(datalist)
|
|
|
|
|
|
|
@@ -273,8 +330,9 @@ class ContractDetailsUI(
|
|
|
}.lparams(matchParent, matchParent)
|
|
}.lparams(matchParent, matchParent)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
//合同详情的item
|
|
//合同详情的item
|
|
|
-fun _LinearLayout.contentItem(itemTile : String,itemContent : String){
|
|
|
|
|
|
|
+fun _LinearLayout.contentItem(itemTile: String, itemContent: String) {
|
|
|
linearLayout {
|
|
linearLayout {
|
|
|
gravity = Gravity.CENTER_VERTICAL
|
|
gravity = Gravity.CENTER_VERTICAL
|
|
|
background = resources.getDrawable(R.color.white)
|
|
background = resources.getDrawable(R.color.white)
|
|
@@ -284,7 +342,7 @@ fun _LinearLayout.contentItem(itemTile : String,itemContent : String){
|
|
|
text = itemTile
|
|
text = itemTile
|
|
|
textSizeAuto = 31
|
|
textSizeAuto = 31
|
|
|
textColorInt = R.color.rma_gray_color
|
|
textColorInt = R.color.rma_gray_color
|
|
|
- }.lparams(wrapContent, wrapContent){
|
|
|
|
|
|
|
+ }.lparams(wrapContent, wrapContent) {
|
|
|
marginStart = autoSize(35)
|
|
marginStart = autoSize(35)
|
|
|
}
|
|
}
|
|
|
}.lparams(autoSize(250), autoSize(120))
|
|
}.lparams(autoSize(250), autoSize(120))
|
|
@@ -293,7 +351,7 @@ fun _LinearLayout.contentItem(itemTile : String,itemContent : String){
|
|
|
text = itemContent
|
|
text = itemContent
|
|
|
textSizeAuto = 31
|
|
textSizeAuto = 31
|
|
|
textColorInt = R.color.rma_black_33
|
|
textColorInt = R.color.rma_black_33
|
|
|
- }.lparams(wrapContent, wrapContent){
|
|
|
|
|
|
|
+ }.lparams(wrapContent, wrapContent) {
|
|
|
marginStart = autoSize(35)
|
|
marginStart = autoSize(35)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -316,7 +374,8 @@ class PriceRecordUI(
|
|
|
private lateinit var swipeToLayout: SwipeToLoadLayout
|
|
private lateinit var swipeToLayout: SwipeToLoadLayout
|
|
|
private lateinit var statusLayout: StatusLayout
|
|
private lateinit var statusLayout: StatusLayout
|
|
|
|
|
|
|
|
- private val unSubmitAdapter: BaseAdapter<BusinessData, PriceRecordViewHolder> = BaseAdapter { _, _ -> PriceRecordViewHolder(activity,"1") }
|
|
|
|
|
|
|
+ private val unSubmitAdapter: BaseAdapter<BusinessData, PriceRecordViewHolder> =
|
|
|
|
|
+ BaseAdapter { _, _ -> PriceRecordViewHolder(activity, "1") }
|
|
|
|
|
|
|
|
init {
|
|
init {
|
|
|
viewModel.queryBusinessDJ(relatedid = data.spotcontractid ?: "")
|
|
viewModel.queryBusinessDJ(relatedid = data.spotcontractid ?: "")
|
|
@@ -346,11 +405,11 @@ class PriceRecordUI(
|
|
|
emptyView(hint = resources.getString(R.string.now_no_data))
|
|
emptyView(hint = resources.getString(R.string.now_no_data))
|
|
|
}).lparams(matchParent, matchParent)
|
|
}).lparams(matchParent, matchParent)
|
|
|
|
|
|
|
|
- viewModel.somePriceList.bindOptional(context){
|
|
|
|
|
- if (it?.isEmpty() == true || it?.size == 0){
|
|
|
|
|
|
|
+ viewModel.somePriceList.bindOptional(context) {
|
|
|
|
|
+ if (it?.isEmpty() == true || it?.size == 0) {
|
|
|
statusLayout.showEmpty()
|
|
statusLayout.showEmpty()
|
|
|
- }else {
|
|
|
|
|
- if (swipeToLayout.getIsRefreshing()){
|
|
|
|
|
|
|
+ } else {
|
|
|
|
|
+ if (swipeToLayout.getIsRefreshing()) {
|
|
|
swipeToLayout.finishRefresh()
|
|
swipeToLayout.finishRefresh()
|
|
|
}
|
|
}
|
|
|
statusLayout.showSuccess()
|
|
statusLayout.showSuccess()
|
|
@@ -378,7 +437,8 @@ class SettlementRecordUI(
|
|
|
private lateinit var swipeToLayout: SwipeToLoadLayout
|
|
private lateinit var swipeToLayout: SwipeToLoadLayout
|
|
|
private lateinit var statusLayout: StatusLayout
|
|
private lateinit var statusLayout: StatusLayout
|
|
|
|
|
|
|
|
- private val unSubmitAdapter: BaseAdapter<BusinessData, PriceRecordViewHolder> = BaseAdapter { _, _ -> PriceRecordViewHolder(activity,"2") }
|
|
|
|
|
|
|
+ private val unSubmitAdapter: BaseAdapter<BusinessData, PriceRecordViewHolder> =
|
|
|
|
|
+ BaseAdapter { _, _ -> PriceRecordViewHolder(activity, "2") }
|
|
|
|
|
|
|
|
init {
|
|
init {
|
|
|
viewModel.queryBusinessJS(relatedid = data.spotcontractid ?: "")
|
|
viewModel.queryBusinessJS(relatedid = data.spotcontractid ?: "")
|
|
@@ -409,11 +469,11 @@ class SettlementRecordUI(
|
|
|
emptyView(hint = resources.getString(R.string.now_no_data))
|
|
emptyView(hint = resources.getString(R.string.now_no_data))
|
|
|
}).lparams(matchParent, matchParent)
|
|
}).lparams(matchParent, matchParent)
|
|
|
|
|
|
|
|
- viewModel.settlementList.bindOptional(context){
|
|
|
|
|
- if (it?.isEmpty() == true || it?.size == 0){
|
|
|
|
|
|
|
+ viewModel.settlementList.bindOptional(context) {
|
|
|
|
|
+ if (it?.isEmpty() == true || it?.size == 0) {
|
|
|
statusLayout.showEmpty()
|
|
statusLayout.showEmpty()
|
|
|
- }else {
|
|
|
|
|
- if (swipeToLayout.getIsRefreshing()){
|
|
|
|
|
|
|
+ } else {
|
|
|
|
|
+ if (swipeToLayout.getIsRefreshing()) {
|
|
|
swipeToLayout.finishRefresh()
|
|
swipeToLayout.finishRefresh()
|
|
|
}
|
|
}
|
|
|
statusLayout.showSuccess()
|
|
statusLayout.showSuccess()
|
|
@@ -441,7 +501,8 @@ class PaymentRecordUI(
|
|
|
private lateinit var swipeToLayout: SwipeToLoadLayout
|
|
private lateinit var swipeToLayout: SwipeToLoadLayout
|
|
|
private lateinit var statusLayout: StatusLayout
|
|
private lateinit var statusLayout: StatusLayout
|
|
|
|
|
|
|
|
- private val unSubmitAdapter: BaseAdapter<FinancialManageData, InvoiceRecordViewHolder> = BaseAdapter { _, _ -> InvoiceRecordViewHolder(activity,"1") }
|
|
|
|
|
|
|
+ private val unSubmitAdapter: BaseAdapter<FinancialManageData, InvoiceRecordViewHolder> =
|
|
|
|
|
+ BaseAdapter { _, _ -> InvoiceRecordViewHolder(activity, "1") }
|
|
|
|
|
|
|
|
init {
|
|
init {
|
|
|
viewModel.queryBusinessKx(relatedid = data.spotcontractid ?: "")
|
|
viewModel.queryBusinessKx(relatedid = data.spotcontractid ?: "")
|
|
@@ -472,11 +533,11 @@ class PaymentRecordUI(
|
|
|
emptyView(hint = resources.getString(R.string.now_no_data))
|
|
emptyView(hint = resources.getString(R.string.now_no_data))
|
|
|
}).lparams(matchParent, matchParent)
|
|
}).lparams(matchParent, matchParent)
|
|
|
|
|
|
|
|
- viewModel.paymentList.bindOptional(context){
|
|
|
|
|
- if (it?.isEmpty() == true || it?.size == 0){
|
|
|
|
|
|
|
+ viewModel.paymentList.bindOptional(context) {
|
|
|
|
|
+ if (it?.isEmpty() == true || it?.size == 0) {
|
|
|
statusLayout.showEmpty()
|
|
statusLayout.showEmpty()
|
|
|
- }else {
|
|
|
|
|
- if (swipeToLayout.getIsRefreshing()){
|
|
|
|
|
|
|
+ } else {
|
|
|
|
|
+ if (swipeToLayout.getIsRefreshing()) {
|
|
|
swipeToLayout.finishRefresh()
|
|
swipeToLayout.finishRefresh()
|
|
|
}
|
|
}
|
|
|
statusLayout.showSuccess()
|
|
statusLayout.showSuccess()
|
|
@@ -488,6 +549,159 @@ class PaymentRecordUI(
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
|
|
+ * 出入库记录
|
|
|
|
|
+ * @property activity AppCompatActivity
|
|
|
|
|
+ * @property viewModel ProcurementViewModel
|
|
|
|
|
+ * @property type String
|
|
|
|
|
+ * @property root _FrameLayout
|
|
|
|
|
+ * @constructor
|
|
|
|
|
+ */
|
|
|
|
|
+class InventoryRecordUI(
|
|
|
|
|
+ private val activity: AppCompatActivity,
|
|
|
|
|
+ private val viewModel: ProcurementViewModel,
|
|
|
|
|
+ private val data: ContractData,
|
|
|
|
|
+ private val type: String
|
|
|
|
|
+) : ApplyRecordAdapter.OnContentScrollListener {
|
|
|
|
|
+
|
|
|
|
|
+ private lateinit var swipeToLayout: SwipeToLoadLayout
|
|
|
|
|
+ private lateinit var statusLayout: StatusLayout
|
|
|
|
|
+ lateinit var horScrollview: CustomHorizontalScrollView
|
|
|
|
|
+ lateinit var recyclerView: RecyclerView
|
|
|
|
|
+
|
|
|
|
|
+ val topAdapter by lazy {
|
|
|
|
|
+ TopTabAdpater(activity)
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ val exposureContentAdapter by lazy {
|
|
|
|
|
+ ApplyRecordAdapter(activity)
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ fun refresh() {
|
|
|
|
|
+ viewModel.queryAreaStockApply(type = type)
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ val root = _FrameLayout(activity).apply {
|
|
|
|
|
+ verticalLayout {
|
|
|
|
|
+ viewModel.queryInventoryTitle(title = Constant.table_mobile_stock_manage_applylog, type = type)
|
|
|
|
|
+ exposureContentAdapter.setOnContentScrollListener(this@InventoryRecordUI)
|
|
|
|
|
+
|
|
|
|
|
+ linearLayout {
|
|
|
|
|
+ linearLayout {
|
|
|
|
|
+ gravity = Gravity.LEFT or Gravity.CENTER_VERTICAL
|
|
|
|
|
+ textView {//头部右侧数据
|
|
|
|
|
+ viewModel.applyRecordTitle.bindOptional(context) {
|
|
|
|
|
+ text = it?.get(0)?.columntitle?.replace("\\n", "\n") ?: ""
|
|
|
|
|
+ }
|
|
|
|
|
+ textColorStr = "#AAAAAA"
|
|
|
|
|
+ textSizeAuto = 24
|
|
|
|
|
+ }.lparams(wrapContent, wrapContent) {
|
|
|
|
|
+ marginStart = autoSize(30)
|
|
|
|
|
+ }
|
|
|
|
|
+ }.lparams(autoSize(SizeUtils.dp2px(90f)), autoSize(100))
|
|
|
|
|
+
|
|
|
|
|
+ inflateLayout<CustomHorizontalScrollView>(R.layout.scrollview) {
|
|
|
|
|
+ horScrollview = this
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 用来同步内容列表的item左右滑动
|
|
|
|
|
+ */
|
|
|
|
|
+ setOnCustomScrollChangeListener { listener, scrollX, scrollY, oldScrollX, oldScrollY ->
|
|
|
|
|
+ exposureContentAdapter.offestX = scrollX
|
|
|
|
|
+ val viewHolderCacheList: List<ApplyRecordAdapter.ItemViewHolder> =
|
|
|
|
|
+ exposureContentAdapter.viewHolderCacheList
|
|
|
|
|
+ if (null != viewHolderCacheList) {
|
|
|
|
|
+ val size = viewHolderCacheList.size
|
|
|
|
|
+ for (i in 0 until size) {
|
|
|
|
|
+ viewHolderCacheList[i].exposure_horItemScrollview.scrollTo(
|
|
|
|
|
+ scrollX,
|
|
|
|
|
+ 0
|
|
|
|
|
+ )
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ relativeLayout {
|
|
|
|
|
+ recyclerView {//头部右侧数据
|
|
|
|
|
+ val linearLayoutManager = LinearLayoutManager(context)
|
|
|
|
|
+ linearLayoutManager.orientation = LinearLayoutManager.HORIZONTAL
|
|
|
|
|
+ layoutManager = linearLayoutManager
|
|
|
|
|
+ background = resources.getDrawable(R.color.white)
|
|
|
|
|
+ adapter = topAdapter
|
|
|
|
|
+ }
|
|
|
|
|
+ viewModel.applyRecordTitle.bindOptional(context) {
|
|
|
|
|
+ val titleStringList = arrayListOf<String>()
|
|
|
|
|
+ it?.subList(1, it.size)?.forEach { data ->
|
|
|
|
|
+ titleStringList.add(data.columntitle?.replace("\\n", "\n") ?: "")
|
|
|
|
|
+ }
|
|
|
|
|
+ topAdapter.setDatas(titleStringList)
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }.lparams(matchParent, matchParent)
|
|
|
|
|
+ }.lparams(matchParent, autoSize(100))
|
|
|
|
|
+
|
|
|
|
|
+ statusLayout(contentBlock = {
|
|
|
|
|
+ statusLayout = this
|
|
|
|
|
+// bindTaskStatus(viewModule.status)
|
|
|
|
|
+ swipeToLoadLayout {
|
|
|
|
|
+ swipeToLayout = this
|
|
|
|
|
+ setEnableRefresh(true)
|
|
|
|
|
+ setEnableLoadMore(false)
|
|
|
|
|
+ setOnRefreshListener {
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 下拉刷新
|
|
|
|
|
+ */
|
|
|
|
|
+ viewModel.queryAreaStockApply(type = type)
|
|
|
|
|
+ }
|
|
|
|
|
+ setEnableScrollContentWhenLoaded(false)
|
|
|
|
|
+ setEnableLoadMoreWhenContentNotFull(false)
|
|
|
|
|
+
|
|
|
|
|
+ recyclerView {
|
|
|
|
|
+ background = resources.getDrawable(R.color.white)
|
|
|
|
|
+ adapter = exposureContentAdapter
|
|
|
|
|
+ addOnScrollListener(object : RecyclerView.OnScrollListener() {
|
|
|
|
|
+ override fun onScrolled(recyclerView: RecyclerView, dx: Int, dy: Int) {
|
|
|
|
|
+ super.onScrolled(recyclerView, dx, dy)
|
|
|
|
|
+ val viewHolderCacheList: List<ApplyRecordAdapter.ItemViewHolder> =
|
|
|
|
|
+ exposureContentAdapter.viewHolderCacheList
|
|
|
|
|
+ if (null != viewHolderCacheList) {
|
|
|
|
|
+ val size = viewHolderCacheList.size
|
|
|
|
|
+ for (i in 0 until size) {
|
|
|
|
|
+ viewHolderCacheList[i].exposure_horItemScrollview.scrollTo(
|
|
|
|
|
+ exposureContentAdapter.getOffestX(),
|
|
|
|
|
+ 0
|
|
|
|
|
+ )
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }, emptyBlock = {
|
|
|
|
|
+ emptyView(hint = resources.getString(R.string.now_no_data))
|
|
|
|
|
+ }).lparams(matchParent, matchParent)
|
|
|
|
|
+
|
|
|
|
|
+ viewModel.applyRecordDataList.bindOptional(context) {
|
|
|
|
|
+
|
|
|
|
|
+ if (it?.isEmpty() == true || it?.size == 0) {
|
|
|
|
|
+ statusLayout.showEmpty()
|
|
|
|
|
+ } else {
|
|
|
|
|
+ if (swipeToLayout.getIsRefreshing()) {
|
|
|
|
|
+ swipeToLayout.finishRefresh()
|
|
|
|
|
+ }
|
|
|
|
|
+ statusLayout.showSuccess()
|
|
|
|
|
+ exposureContentAdapter.setDatas(it)
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ override fun onScroll(event: MotionEvent?) {
|
|
|
|
|
+ //处理单个item滚动时,顶部tab需要联动
|
|
|
|
|
+ if (null != horScrollview) horScrollview.onTouchEvent(event)
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+/**
|
|
|
* 发票记录
|
|
* 发票记录
|
|
|
* @property activity AppCompatActivity
|
|
* @property activity AppCompatActivity
|
|
|
* @property viewModel ProcurementViewModel
|
|
* @property viewModel ProcurementViewModel
|
|
@@ -505,7 +719,8 @@ class InvoiceRecordUI(
|
|
|
private lateinit var swipeToLayout: SwipeToLoadLayout
|
|
private lateinit var swipeToLayout: SwipeToLoadLayout
|
|
|
private lateinit var statusLayout: StatusLayout
|
|
private lateinit var statusLayout: StatusLayout
|
|
|
|
|
|
|
|
- private val unSubmitAdapter: BaseAdapter<FinancialManageData, InvoiceRecordViewHolder> = BaseAdapter { _, _ -> InvoiceRecordViewHolder(activity,"2") }
|
|
|
|
|
|
|
+ private val unSubmitAdapter: BaseAdapter<FinancialManageData, InvoiceRecordViewHolder> =
|
|
|
|
|
+ BaseAdapter { _, _ -> InvoiceRecordViewHolder(activity, "2") }
|
|
|
|
|
|
|
|
init {
|
|
init {
|
|
|
viewModel.queryBusinessFp(relatedid = data.spotcontractid ?: "")
|
|
viewModel.queryBusinessFp(relatedid = data.spotcontractid ?: "")
|
|
@@ -536,11 +751,11 @@ class InvoiceRecordUI(
|
|
|
emptyView(hint = resources.getString(R.string.now_no_data))
|
|
emptyView(hint = resources.getString(R.string.now_no_data))
|
|
|
}).lparams(matchParent, matchParent)
|
|
}).lparams(matchParent, matchParent)
|
|
|
|
|
|
|
|
- viewModel.paymentList.bindOptional(context){
|
|
|
|
|
- if (it?.isEmpty() == true || it?.size == 0){
|
|
|
|
|
|
|
+ viewModel.paymentList.bindOptional(context) {
|
|
|
|
|
+ if (it?.isEmpty() == true || it?.size == 0) {
|
|
|
statusLayout.showEmpty()
|
|
statusLayout.showEmpty()
|
|
|
- }else {
|
|
|
|
|
- if (swipeToLayout.getIsRefreshing()){
|
|
|
|
|
|
|
+ } else {
|
|
|
|
|
+ if (swipeToLayout.getIsRefreshing()) {
|
|
|
swipeToLayout.finishRefresh()
|
|
swipeToLayout.finishRefresh()
|
|
|
}
|
|
}
|
|
|
statusLayout.showSuccess()
|
|
statusLayout.showSuccess()
|
|
@@ -568,7 +783,8 @@ class ChangeRecordUI(
|
|
|
private lateinit var swipeToLayout: SwipeToLoadLayout
|
|
private lateinit var swipeToLayout: SwipeToLoadLayout
|
|
|
private lateinit var statusLayout: StatusLayout
|
|
private lateinit var statusLayout: StatusLayout
|
|
|
|
|
|
|
|
- private val spotVarietiesNormalAdapter: BaseAdapter<ChangeLogData, ChangeRecordViewHolder> = BaseAdapter { _, _ -> ChangeRecordViewHolder(activity) }
|
|
|
|
|
|
|
+ private val spotVarietiesNormalAdapter: BaseAdapter<ChangeLogData, ChangeRecordViewHolder> =
|
|
|
|
|
+ BaseAdapter { _, _ -> ChangeRecordViewHolder(activity) }
|
|
|
|
|
|
|
|
init {
|
|
init {
|
|
|
viewModel.queryChangeLog(RelatedId = data.spotcontractid ?: "")
|
|
viewModel.queryChangeLog(RelatedId = data.spotcontractid ?: "")
|
|
@@ -622,11 +838,11 @@ class ChangeRecordUI(
|
|
|
emptyView(hint = resources.getString(R.string.now_no_data))
|
|
emptyView(hint = resources.getString(R.string.now_no_data))
|
|
|
}).lparams(matchParent, matchParent)
|
|
}).lparams(matchParent, matchParent)
|
|
|
|
|
|
|
|
- viewModel.changeLogDataList.bindOptional(context){
|
|
|
|
|
- if (it?.isEmpty() == true || it?.size == 0){
|
|
|
|
|
|
|
+ viewModel.changeLogDataList.bindOptional(context) {
|
|
|
|
|
+ if (it?.isEmpty() == true || it?.size == 0) {
|
|
|
statusLayout.showEmpty()
|
|
statusLayout.showEmpty()
|
|
|
- }else {
|
|
|
|
|
- if (swipeToLayout.getIsRefreshing()){
|
|
|
|
|
|
|
+ } else {
|
|
|
|
|
+ if (swipeToLayout.getIsRefreshing()) {
|
|
|
swipeToLayout.finishRefresh()
|
|
swipeToLayout.finishRefresh()
|
|
|
}
|
|
}
|
|
|
statusLayout.showSuccess()
|
|
statusLayout.showSuccess()
|