|
|
@@ -3,6 +3,7 @@ package cn.muchinfo.rma.view.base.report
|
|
|
import android.os.Build
|
|
|
import android.view.Gravity
|
|
|
import android.view.MotionEvent
|
|
|
+import android.widget.EditText
|
|
|
import android.widget.TextView
|
|
|
import androidx.annotation.RequiresApi
|
|
|
import androidx.appcompat.app.AppCompatActivity
|
|
|
@@ -10,13 +11,11 @@ import androidx.lifecycle.MutableLiveData
|
|
|
import androidx.recyclerview.widget.LinearLayoutManager
|
|
|
import androidx.recyclerview.widget.RecyclerView
|
|
|
import cn.muchinfo.rma.R
|
|
|
-import cn.muchinfo.rma.global.GlobalDataCollection
|
|
|
import cn.muchinfo.rma.lifecycle.bindOptional
|
|
|
import cn.muchinfo.rma.view.autoWidget.*
|
|
|
import cn.muchinfo.rma.view.base.app.Constant
|
|
|
import cn.muchinfo.rma.view.base.home.contract.emptyView
|
|
|
import cn.muchinfo.rma.view.base.home.reportquery.ReportQueryViewModel
|
|
|
-import cn.muchinfo.rma.view.base.home.reportquery.adapter.SpotReportContentAdapter
|
|
|
import cn.muchinfo.rma.view.base.procurement.TopTabAdpater
|
|
|
import com.blankj.utilcode.util.SizeUtils
|
|
|
import com.blankj.utilcode.util.TimeUtils
|
|
|
@@ -67,6 +66,8 @@ class PricingReportUI(
|
|
|
if (null != horScrollview) horScrollview.onTouchEvent(event)
|
|
|
}
|
|
|
|
|
|
+ lateinit var contract_number : EditText
|
|
|
+
|
|
|
init {
|
|
|
viewModel.queryContract()
|
|
|
dateType.postValue(SelectData(id = "1",value = "日报表"))
|
|
|
@@ -139,23 +140,38 @@ class PricingReportUI(
|
|
|
|
|
|
|
|
|
linearLayout {
|
|
|
- textView {
|
|
|
- backgroundResource = R.drawable.rma_time_click_bg
|
|
|
- onThrottleFirstClick {
|
|
|
- activity.creatBottomSheetDialog("请选择现货合同编号", viewModel.getAvailableSelectContract()) {
|
|
|
- viewModel.selectSpotContractId.postValue(this)
|
|
|
+ linearLayout {
|
|
|
|
|
|
- }
|
|
|
- }
|
|
|
- viewModel.selectSpotContractId.bindOptional(context){
|
|
|
- text = it?.value
|
|
|
-// contentAdapter.setTransaction(it?.value)
|
|
|
-// contentAdapter.setTransactionUserid(it?.id)
|
|
|
+ gravity = Gravity.CENTER_VERTICAL
|
|
|
+ backgroundResource = R.drawable.qyfg_search_item_bg
|
|
|
+ editText {
|
|
|
+ contract_number = this
|
|
|
+ hint = "输入合同编号"
|
|
|
+ background = null
|
|
|
+// inputType = EditorInfo.TYPE_CLASS_NUMBER or EditorInfo.TYPE_NUMBER_FLAG_DECIMAL or EditorInfo.TYPE_NUMBER_FLAG_SIGNED
|
|
|
+// setDecimalInputType()
|
|
|
+ hintColorStr = "#CCCCCC"
|
|
|
+ textSizeAuto = 31
|
|
|
+ textColorStr = "#333333"
|
|
|
+ }.lparams(matchParent, autoSize(90)) {
|
|
|
+ marginStart = autoSize(20)
|
|
|
}
|
|
|
- gravity = Gravity.CENTER
|
|
|
- text = "请选择现货合同编号"
|
|
|
- textColorInt = R.color.rma_black_33
|
|
|
- textSizeAuto = 31
|
|
|
+// backgroundResource = R.drawable.rma_time_click_bg
|
|
|
+// onThrottleFirstClick {
|
|
|
+// activity.creatBottomSheetDialog("请选择现货合同编号", viewModel.getAvailableSelectContract()) {
|
|
|
+// viewModel.selectSpotContractId.postValue(this)
|
|
|
+//
|
|
|
+// }
|
|
|
+// }
|
|
|
+// viewModel.selectSpotContractId.bindOptional(context){
|
|
|
+// text = it?.value
|
|
|
+//// contentAdapter.setTransaction(it?.value)
|
|
|
+//// contentAdapter.setTransactionUserid(it?.id)
|
|
|
+// }
|
|
|
+// gravity = Gravity.CENTER
|
|
|
+// text = "请选择现货合同编号"
|
|
|
+// textColorInt = R.color.rma_black_33
|
|
|
+// textSizeAuto = 31
|
|
|
}.lparams(0, autoSize(67),1f){
|
|
|
marginStart = autoSize(36)
|
|
|
}
|
|
|
@@ -163,11 +179,11 @@ class PricingReportUI(
|
|
|
backgroundDrawable = createCommonBottomRoundBg(color = "#2481DD", corner = 5)
|
|
|
onThrottleFirstClick {
|
|
|
if (dateType.value?.id == "1"){//日报表
|
|
|
- viewModel.qrySCMiddleGoodsReport(tradedate = tradedate.replace("-", ""),cycletype = "0",spotcontractid = viewModel.selectSpotContractId.value?.id ?: "")
|
|
|
+ viewModel.qrySCMiddleGoodsReport(tradedate = tradedate.replace("-", ""),cycletype = "0",contractno = contract_number.text.toString())
|
|
|
}else if (dateType.value?.id == "2"){//月报表
|
|
|
- viewModel.qrySCMiddleGoodsReport(tradedate = tradedate.replace("-", ""),cycletype = "1",spotcontractid = viewModel.selectSpotContractId.value?.id ?: "")
|
|
|
+ viewModel.qrySCMiddleGoodsReport(tradedate = tradedate.replace("-", ""),cycletype = "1",contractno = contract_number.text.toString())
|
|
|
}else if (dateType.value?.id == "3"){//周报表
|
|
|
- viewModel.qrySCMiddleGoodsReport(tradedate = tradedate.replace("-", ""),cycletype = "4",spotcontractid = viewModel.selectSpotContractId.value?.id ?: "")
|
|
|
+ viewModel.qrySCMiddleGoodsReport(tradedate = tradedate.replace("-", ""),cycletype = "4",contractno = contract_number.text.toString())
|
|
|
}
|
|
|
}
|
|
|
gravity = Gravity.CENTER
|
|
|
@@ -178,10 +194,8 @@ class PricingReportUI(
|
|
|
marginStart = autoSize(36)
|
|
|
marginEnd = autoSize(36)
|
|
|
}
|
|
|
-
|
|
|
}.lparams(matchParent, autoSize(100))
|
|
|
|
|
|
-// viewModel.queryTitle(tableKey = Constant.table_mobile_report_expose, cycletime = tradedate.replace("-", ""),cycletype = "",userid = selectTransactionUser.value?.id ?: "",querytype = "1")
|
|
|
contentAdapter.setOnContentScrollListener(this@PricingReportUI)
|
|
|
linearLayout {
|
|
|
linearLayout {
|
|
|
@@ -199,7 +213,7 @@ class PricingReportUI(
|
|
|
|
|
|
inflateLayout<CustomHorizontalScrollView>(R.layout.scrollview) {
|
|
|
horScrollview = this
|
|
|
- setOnCustomScrollChangeListener { listener, scrollX, scrollY, oldScrollX, oldScrollY -> //代码重复,可以抽取/////
|
|
|
+ setOnCustomScrollChangeListener { _, scrollX, _, _, _ -> //代码重复,可以抽取/////
|
|
|
contentAdapter.offestX = scrollX
|
|
|
val viewHolderCacheList: List<PricingReportContentAdapter.ItemViewHolder> =
|
|
|
contentAdapter.viewHolderCacheList
|
|
|
@@ -245,13 +259,12 @@ class PricingReportUI(
|
|
|
* 下拉刷新
|
|
|
*/
|
|
|
if (dateType.value?.id == "1"){//日报表
|
|
|
- viewModel.qrySCMiddleGoodsReport(tradedate = tradedate.replace("-", ""),cycletype = "0",spotcontractid = viewModel.selectSpotContractId.value?.id ?: "")
|
|
|
+ viewModel.qrySCMiddleGoodsReport(tradedate = tradedate.replace("-", ""),cycletype = "0",contractno = contract_number.text.toString())
|
|
|
}else if (dateType.value?.id == "2"){//月报表
|
|
|
- viewModel.qrySCMiddleGoodsReport(tradedate = tradedate.replace("-", ""),cycletype = "1",spotcontractid = viewModel.selectSpotContractId.value?.id ?: "")
|
|
|
+ viewModel.qrySCMiddleGoodsReport(tradedate = tradedate.replace("-", ""),cycletype = "1",contractno = contract_number.text.toString())
|
|
|
}else if (dateType.value?.id == "3"){//周报表
|
|
|
- viewModel.qrySCMiddleGoodsReport(tradedate = tradedate.replace("-", ""),cycletype = "4",spotcontractid = viewModel.selectSpotContractId.value?.id ?: "")
|
|
|
+ viewModel.qrySCMiddleGoodsReport(tradedate = tradedate.replace("-", ""),cycletype = "4",contractno = contract_number.text.toString())
|
|
|
}
|
|
|
-// viewModel.qryReportAreaExpourse(cycletime = tradedate.replace("-", ""),cycletype = "",userid = selectTransactionUser.value?.id ?: "")
|
|
|
}
|
|
|
setEnableScrollContentWhenLoaded(false)
|
|
|
setEnableLoadMoreWhenContentNotFull(false)
|