|
|
@@ -11,15 +11,13 @@ import android.view.ViewGroup
|
|
|
import android.widget.TextView
|
|
|
import androidx.annotation.RequiresApi
|
|
|
import androidx.appcompat.app.AppCompatActivity
|
|
|
+import androidx.lifecycle.MutableLiveData
|
|
|
import androidx.recyclerview.widget.LinearLayoutManager
|
|
|
import androidx.recyclerview.widget.RecyclerView
|
|
|
import androidx.viewpager.widget.PagerAdapter
|
|
|
import androidx.viewpager.widget.ViewPager
|
|
|
import cn.muchinfo.rma.R
|
|
|
-import cn.muchinfo.rma.global.data.ExposureReportData
|
|
|
-import cn.muchinfo.rma.global.data.FinancialManageData
|
|
|
-import cn.muchinfo.rma.global.data.FinancialReportData
|
|
|
-import cn.muchinfo.rma.global.data.SpotReportData
|
|
|
+import cn.muchinfo.rma.global.data.*
|
|
|
import cn.muchinfo.rma.global.isBlankString
|
|
|
import cn.muchinfo.rma.lifecycle.bindOptional
|
|
|
import cn.muchinfo.rma.view.autoWidget.*
|
|
|
@@ -29,6 +27,7 @@ import cn.muchinfo.rma.view.base.exposure.ExposureContentAdapter
|
|
|
import cn.muchinfo.rma.view.base.home.contract.emptyView
|
|
|
import cn.muchinfo.rma.view.base.home.financial.FinancialViewholder
|
|
|
import cn.muchinfo.rma.view.base.home.financial.InvoiceRegisterActivity
|
|
|
+import cn.muchinfo.rma.view.base.home.inventory.inventorymanager.adapter.ApplyRecordAdapter
|
|
|
import cn.muchinfo.rma.view.base.procurement.ContentAdapter
|
|
|
import cn.muchinfo.rma.view.base.procurement.TopTabAdpater
|
|
|
import com.blankj.utilcode.util.*
|
|
|
@@ -36,7 +35,11 @@ import com.qmuiteam.qmui.util.QMUIDisplayHelper
|
|
|
import com.qmuiteam.qmui.widget.tab.QMUITabIndicator
|
|
|
import com.qmuiteam.qmui.widget.tab.QMUITabSegment
|
|
|
import mtp.polymer.com.autowidget.adapter.BaseAdapter
|
|
|
+import mtp.polymer.com.autowidget.dialog.SelectData
|
|
|
+import mtp.polymer.com.autowidget.dialog.creatBottomSheetDialog
|
|
|
+import mtp.polymer.com.autowidget.dialog.createLoadingDialog
|
|
|
import mtp.polymer.com.autowidget.dialog.showDataSelectDialog
|
|
|
+import mtp.polymer.com.autowidget.utils.bindTaskStatus
|
|
|
import org.jetbrains.anko.*
|
|
|
import org.jetbrains.anko.support.v4.viewPager
|
|
|
import java.text.SimpleDateFormat
|
|
|
@@ -52,7 +55,7 @@ class ReportQueryActivity : BaseActivity<ReportQueryViewModel>() {
|
|
|
|
|
|
/** tab标题 **/
|
|
|
private val tabsArray: List<String> by lazy {
|
|
|
- arrayListOf("财务报表", "敞口报表", "现货报表","库存报表")
|
|
|
+ arrayListOf("财务报表", "敞口报表", "现货报表", "库存报表")
|
|
|
}
|
|
|
|
|
|
/** 财务报表 **/
|
|
|
@@ -65,7 +68,7 @@ class ReportQueryActivity : BaseActivity<ReportQueryViewModel>() {
|
|
|
private val spotReportUI by lazy { SpotReportUI(this, viewModel) }
|
|
|
|
|
|
/** 库存报表 ***/
|
|
|
- private val invertoryReportUI by lazy { InvertoryReportUI(this,viewModel) }
|
|
|
+ private val invertoryReportUI by lazy { InvertoryReportUI(this, viewModel) }
|
|
|
|
|
|
private val pagerAdapter: PagerAdapter by lazy {
|
|
|
object : PagerAdapter() {
|
|
|
@@ -121,9 +124,14 @@ class ReportQueryActivity : BaseActivity<ReportQueryViewModel>() {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ private val dialog by lazy { createLoadingDialog(hintStr = "请求中...") }
|
|
|
+
|
|
|
+
|
|
|
override fun onCreate(savedInstanceState: Bundle?) {
|
|
|
super.onCreate(savedInstanceState)
|
|
|
verticalLayout {
|
|
|
+ dialog.bindTaskStatus(context, viewModel.loadingDialogStatus)
|
|
|
topBar {
|
|
|
commonLeftButton()
|
|
|
commonTitle {
|
|
|
@@ -200,7 +208,10 @@ class FinancialReportUI(
|
|
|
/**
|
|
|
* 查询所用的date 注意(页面显示时间规则yyyy-MM-dd,而接口请求规则yyyyMMdd,简直无fuck可说)
|
|
|
*/
|
|
|
- var tradedate: String = TimeUtils.millis2String(TimeUtils.getNowMills().minus(86400000),SimpleDateFormat("yyyy-MM-dd"))
|
|
|
+ var tradedate: String = TimeUtils.millis2String(
|
|
|
+ TimeUtils.getNowMills().minus(86400000),
|
|
|
+ SimpleDateFormat("yyyy-MM-dd")
|
|
|
+ )
|
|
|
|
|
|
/** 查询时间textview **/
|
|
|
lateinit var tradedatetextview: TextView
|
|
|
@@ -262,24 +273,24 @@ class FinancialReportUI(
|
|
|
@RequiresApi(Build.VERSION_CODES.N)
|
|
|
val root = _FrameLayout(activity).apply {
|
|
|
verticalLayout {
|
|
|
- viewModel.qryReportDayFinance(tradedate = tradedate.replace("-",""))
|
|
|
+ viewModel.qryReportDayFinance(tradedate = tradedate.replace("-", ""))
|
|
|
linearLayout {
|
|
|
gravity = Gravity.CENTER_VERTICAL
|
|
|
linearLayout {
|
|
|
onThrottleFirstClick {
|
|
|
- if (viewModel.isselectFinancialMonthOrDay.value == "1"){
|
|
|
+ if (viewModel.isselectFinancialMonthOrDay.value == "1") {
|
|
|
viewModel.isselectFinancialMonthOrDay.postValue("2")
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
viewModel.isselectFinancialMonthOrDay.postValue("1")
|
|
|
}
|
|
|
}
|
|
|
backgroundResource = R.drawable.rma_time_click_bg
|
|
|
gravity = Gravity.CENTER_VERTICAL
|
|
|
textView {
|
|
|
- viewModel.isselectFinancialMonthOrDay.bindOptional(context){
|
|
|
- if (it == "1"){
|
|
|
+ viewModel.isselectFinancialMonthOrDay.bindOptional(context) {
|
|
|
+ if (it == "1") {
|
|
|
text = "日报表"
|
|
|
- }else if (it == "2"){
|
|
|
+ } else if (it == "2") {
|
|
|
text = "月报表"
|
|
|
}
|
|
|
}
|
|
|
@@ -311,7 +322,10 @@ class FinancialReportUI(
|
|
|
gravity = Gravity.CENTER_VERTICAL
|
|
|
textView {
|
|
|
tradedatetextview = this
|
|
|
- text = TimeUtils.millis2String(TimeUtils.getNowMills().minus(86400000),SimpleDateFormat("yyyy-MM-dd"))
|
|
|
+ text = TimeUtils.millis2String(
|
|
|
+ TimeUtils.getNowMills().minus(86400000),
|
|
|
+ SimpleDateFormat("yyyy-MM-dd")
|
|
|
+ )
|
|
|
textColorInt = R.color.rma_hint_text_color_ccc
|
|
|
textSizeAuto = 31
|
|
|
}.lparams(wrapContent, wrapContent) {
|
|
|
@@ -329,13 +343,13 @@ class FinancialReportUI(
|
|
|
|
|
|
textView {
|
|
|
onThrottleFirstClick {
|
|
|
- if (viewModel.isselectFinancialMonthOrDay.value == "1"){//日报表数据请求
|
|
|
- viewModel.qryReportDayFinance(tradedate = tradedate.replace("-",""))
|
|
|
+ if (viewModel.isselectFinancialMonthOrDay.value == "1") {//日报表数据请求
|
|
|
+ viewModel.qryReportDayFinance(tradedate = tradedate.replace("-", ""))
|
|
|
// viewModel.qryReportDayFinance(tradedate = "20210310")
|
|
|
financialPaymentUI.queryRefrashByTime(tradeDate = tradedate)
|
|
|
financialInvoiceUI.queryRefrashByTime(tradeDate = tradedate)
|
|
|
- }else{//月报表数据请求
|
|
|
- viewModel.qryReportMonthFinance(cycletime = tradedate)
|
|
|
+ } else {//月报表数据请求
|
|
|
+ viewModel.qryReportMonthFinance(cycletime = tradedate.replace("-", ""))
|
|
|
}
|
|
|
}
|
|
|
gravity = Gravity.CENTER
|
|
|
@@ -418,9 +432,9 @@ class FinancialReportUI(
|
|
|
gravity = Gravity.START
|
|
|
textView {
|
|
|
viewModel.financialReportTitleData.bindOptional(context) {
|
|
|
- if (it?.collectmoneycount.isNullOrEmpty()){
|
|
|
+ if (it?.collectmoneycount.isNullOrEmpty()) {
|
|
|
text = "--"
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
text = it?.collectmoneycount?.isBlankString() + "笔"
|
|
|
}
|
|
|
|
|
|
@@ -437,9 +451,9 @@ class FinancialReportUI(
|
|
|
gravity = Gravity.START
|
|
|
textView {
|
|
|
viewModel.financialReportTitleData.bindOptional(context) {
|
|
|
- if (it?.paymoneycount.isNullOrEmpty()){
|
|
|
+ if (it?.paymoneycount.isNullOrEmpty()) {
|
|
|
text = "--"
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
text = it?.paymoneycount?.isBlankString() + "笔"
|
|
|
}
|
|
|
|
|
|
@@ -457,9 +471,9 @@ class FinancialReportUI(
|
|
|
gravity = Gravity.START
|
|
|
textView {
|
|
|
viewModel.financialReportTitleData.bindOptional(context) {
|
|
|
- if (it?.collectinvoicecount.isNullOrEmpty()){
|
|
|
+ if (it?.collectinvoicecount.isNullOrEmpty()) {
|
|
|
text = "--"
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
text = it?.collectinvoicecount?.isBlankString() + "笔"
|
|
|
}
|
|
|
|
|
|
@@ -476,9 +490,9 @@ class FinancialReportUI(
|
|
|
gravity = Gravity.START
|
|
|
textView {
|
|
|
viewModel.financialReportTitleData.bindOptional(context) {
|
|
|
- if (it?.payinvoicecount.isNullOrEmpty()){
|
|
|
+ if (it?.payinvoicecount.isNullOrEmpty()) {
|
|
|
text = "--"
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
text = it?.payinvoicecount?.isBlankString() + "笔"
|
|
|
}
|
|
|
|
|
|
@@ -557,10 +571,10 @@ class FinancialReportUI(
|
|
|
}
|
|
|
/** 在选择日报表时显示此页面 **/
|
|
|
verticalLayout {
|
|
|
- viewModel.isselectFinancialMonthOrDay.bindOptional(context){
|
|
|
- visibility = if (it == "1"){
|
|
|
+ viewModel.isselectFinancialMonthOrDay.bindOptional(context) {
|
|
|
+ visibility = if (it == "1") {
|
|
|
View.VISIBLE
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
View.GONE
|
|
|
}
|
|
|
}
|
|
|
@@ -599,10 +613,10 @@ class FinancialReportUI(
|
|
|
|
|
|
/** 在选择月报表时显示此页面 **/
|
|
|
verticalLayout {
|
|
|
- viewModel.isselectFinancialMonthOrDay.bindOptional(context){
|
|
|
- visibility = if (it == "2"){
|
|
|
+ viewModel.isselectFinancialMonthOrDay.bindOptional(context) {
|
|
|
+ visibility = if (it == "2") {
|
|
|
View.VISIBLE
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
View.GONE
|
|
|
}
|
|
|
}
|
|
|
@@ -629,7 +643,17 @@ class FinancialReportUI(
|
|
|
emptyView(hint = resources.getString(R.string.now_no_data))
|
|
|
}).lparams(matchParent, matchParent)
|
|
|
|
|
|
-
|
|
|
+ viewModel.financialReportMonthDataList.bindOptional(context) {
|
|
|
+ if (it?.isEmpty() == true || it?.size == 0) {
|
|
|
+ statusLayout.showEmpty()
|
|
|
+ } else {
|
|
|
+ if (swipeToLayout.getIsRefreshing()) {
|
|
|
+ swipeToLayout.finishRefresh()
|
|
|
+ }
|
|
|
+ statusLayout.showSuccess()
|
|
|
+ financialReportMonthAdapter.setNewData(it)
|
|
|
+ }
|
|
|
+ }
|
|
|
}.lparams(matchParent, matchParent)
|
|
|
}
|
|
|
}
|
|
|
@@ -644,7 +668,7 @@ class FinancialReportUI(
|
|
|
class ExposureReportUI(
|
|
|
private val activity: AppCompatActivity,
|
|
|
private val viewModel: ReportQueryViewModel
|
|
|
-): ExposureReportContentAdapter.OnContentScrollListener {
|
|
|
+) : ExposureReportContentAdapter.OnContentScrollListener {
|
|
|
|
|
|
// private lateinit var swipeToLayout: SwipeToLoadLayout
|
|
|
// private lateinit var statusLayout: StatusLayout
|
|
|
@@ -667,7 +691,10 @@ class ExposureReportUI(
|
|
|
/**
|
|
|
* 查询所用的date 注意(页面显示时间规则yyyy-MM-dd,而接口请求规则yyyyMMdd,简直无fuck可说)
|
|
|
*/
|
|
|
- var tradedate: String = TimeUtils.millis2String(TimeUtils.getNowMills().minus(86400000),SimpleDateFormat("yyyy-MM-dd"))
|
|
|
+ var tradedate: String = TimeUtils.millis2String(
|
|
|
+ TimeUtils.getNowMills().minus(86400000),
|
|
|
+ SimpleDateFormat("yyyy-MM-dd")
|
|
|
+ )
|
|
|
|
|
|
/** 查询时间textview **/
|
|
|
lateinit var tradedatetextview: TextView
|
|
|
@@ -678,7 +705,6 @@ class ExposureReportUI(
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
@RequiresApi(Build.VERSION_CODES.N)
|
|
|
val root = _FrameLayout(activity).apply {
|
|
|
verticalLayout {
|
|
|
@@ -712,7 +738,10 @@ class ExposureReportUI(
|
|
|
gravity = Gravity.CENTER_VERTICAL
|
|
|
textView {
|
|
|
tradedatetextview = this
|
|
|
- text = TimeUtils.millis2String(TimeUtils.getNowMills().minus(86400000),SimpleDateFormat("yyyy-MM-dd"))
|
|
|
+ text = TimeUtils.millis2String(
|
|
|
+ TimeUtils.getNowMills().minus(86400000),
|
|
|
+ SimpleDateFormat("yyyy-MM-dd")
|
|
|
+ )
|
|
|
textColorInt = R.color.rma_hint_text_color_ccc
|
|
|
textSizeAuto = 31
|
|
|
}.lparams(wrapContent, wrapContent) {
|
|
|
@@ -730,7 +759,7 @@ class ExposureReportUI(
|
|
|
|
|
|
textView {
|
|
|
onThrottleFirstClick {
|
|
|
- viewModel.qryReportDayExposure(tradedate = tradedate.replace("-",""))
|
|
|
+ viewModel.qryReportDayExposure(tradedate = tradedate.replace("-", ""))
|
|
|
}
|
|
|
gravity = Gravity.CENTER
|
|
|
backgroundDrawable = createCommonBottomRoundBg(color = "#2481DD", corner = 5)
|
|
|
@@ -742,7 +771,7 @@ class ExposureReportUI(
|
|
|
}
|
|
|
|
|
|
}.lparams(matchParent, autoSize(100))
|
|
|
- viewModel.queryTitle(Constant.table_mobile_report_expose,tradedate.replace("-",""))
|
|
|
+ viewModel.queryTitle(Constant.table_mobile_report_expose, tradedate.replace("-", ""))
|
|
|
contentAdapter.setOnContentScrollListener(this@ExposureReportUI)
|
|
|
linearLayout {
|
|
|
linearLayout {
|
|
|
@@ -753,7 +782,7 @@ class ExposureReportUI(
|
|
|
}
|
|
|
textColorStr = "#AAAAAA"
|
|
|
textSizeAuto = 24
|
|
|
- }.lparams(wrapContent, wrapContent){
|
|
|
+ }.lparams(wrapContent, wrapContent) {
|
|
|
marginStart = autoSize(30)
|
|
|
}
|
|
|
}.lparams(autoSize(SizeUtils.dp2px(135f)), autoSize(100))
|
|
|
@@ -805,7 +834,7 @@ class ExposureReportUI(
|
|
|
/**
|
|
|
* 下拉刷新
|
|
|
*/
|
|
|
- viewModel.qryReportDayExposure(tradedate = tradedate.replace("-",""))
|
|
|
+ viewModel.qryReportDayExposure(tradedate = tradedate.replace("-", ""))
|
|
|
}
|
|
|
setEnableScrollContentWhenLoaded(false)
|
|
|
setEnableLoadMoreWhenContentNotFull(false)
|
|
|
@@ -976,7 +1005,10 @@ class SpotReportUI(
|
|
|
/**
|
|
|
* 查询所用的date 注意(页面显示时间规则yyyy-MM-dd,而接口请求规则yyyyMMdd,简直无fuck可说)
|
|
|
*/
|
|
|
- var tradedate: String = TimeUtils.millis2String(TimeUtils.getNowMills().minus(86400000),SimpleDateFormat("yyyy-MM-dd"))
|
|
|
+ var tradedate: String = TimeUtils.millis2String(
|
|
|
+ TimeUtils.getNowMills().minus(86400000),
|
|
|
+ SimpleDateFormat("yyyy-MM-dd")
|
|
|
+ )
|
|
|
|
|
|
/** 查询时间textview **/
|
|
|
lateinit var tradedatetextview: TextView
|
|
|
@@ -984,24 +1016,24 @@ class SpotReportUI(
|
|
|
@RequiresApi(Build.VERSION_CODES.N)
|
|
|
val root = _FrameLayout(activity).apply {
|
|
|
verticalLayout {
|
|
|
- viewModel.qryReportDaySpot(tradedate = tradedate.replace("-",""))
|
|
|
+ viewModel.qryReportDaySpot(tradedate = tradedate.replace("-", ""))
|
|
|
linearLayout {
|
|
|
gravity = Gravity.CENTER_VERTICAL
|
|
|
linearLayout {
|
|
|
onThrottleFirstClick {
|
|
|
- if (viewModel.isselectSpotMonthOrDay.value == "1"){
|
|
|
+ if (viewModel.isselectSpotMonthOrDay.value == "1") {
|
|
|
viewModel.isselectSpotMonthOrDay.postValue("2")
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
viewModel.isselectSpotMonthOrDay.postValue("1")
|
|
|
}
|
|
|
}
|
|
|
backgroundResource = R.drawable.rma_time_click_bg
|
|
|
gravity = Gravity.CENTER_VERTICAL
|
|
|
textView {
|
|
|
- viewModel.isselectSpotMonthOrDay.bindOptional(context){
|
|
|
- if (it == "1"){
|
|
|
+ viewModel.isselectSpotMonthOrDay.bindOptional(context) {
|
|
|
+ if (it == "1") {
|
|
|
text = "日报表"
|
|
|
- }else if (it == "2"){
|
|
|
+ } else if (it == "2") {
|
|
|
text = "月报表"
|
|
|
}
|
|
|
}
|
|
|
@@ -1033,7 +1065,10 @@ class SpotReportUI(
|
|
|
gravity = Gravity.CENTER_VERTICAL
|
|
|
textView {
|
|
|
tradedatetextview = this
|
|
|
- text = TimeUtils.millis2String(TimeUtils.getNowMills().minus(86400000),SimpleDateFormat("yyyy-MM-dd"))
|
|
|
+ text = TimeUtils.millis2String(
|
|
|
+ TimeUtils.getNowMills().minus(86400000),
|
|
|
+ SimpleDateFormat("yyyy-MM-dd")
|
|
|
+ )
|
|
|
textColorInt = R.color.rma_hint_text_color_ccc
|
|
|
textSizeAuto = 31
|
|
|
}.lparams(wrapContent, wrapContent) {
|
|
|
@@ -1051,10 +1086,10 @@ class SpotReportUI(
|
|
|
|
|
|
textView {
|
|
|
onThrottleFirstClick {
|
|
|
- if (viewModel.isselectSpotMonthOrDay.value == "1"){
|
|
|
- viewModel.qryReportDaySpot(tradedate = tradedate.replace("-",""))
|
|
|
- }else{
|
|
|
- viewModel.qryReportMonthSpot(tradedate = tradedate.replace("-",""))
|
|
|
+ if (viewModel.isselectSpotMonthOrDay.value == "1") {
|
|
|
+ viewModel.qryReportDaySpot(tradedate = tradedate.replace("-", ""))
|
|
|
+ } else {
|
|
|
+ viewModel.qryReportMonthSpot(tradedate = tradedate.replace("-", ""))
|
|
|
}
|
|
|
}
|
|
|
gravity = Gravity.CENTER
|
|
|
@@ -1075,7 +1110,7 @@ class SpotReportUI(
|
|
|
text = "现货品种"
|
|
|
textSizeAuto = 24
|
|
|
textColorInt = R.color.hint_text_color
|
|
|
- }.lparams(wrapContent, wrapContent){
|
|
|
+ }.lparams(wrapContent, wrapContent) {
|
|
|
marginStart = autoSize(36)
|
|
|
topMargin = autoSize(15)
|
|
|
}
|
|
|
@@ -1117,7 +1152,7 @@ class SpotReportUI(
|
|
|
text = "采购入库量"
|
|
|
textSizeAuto = 24
|
|
|
textColorInt = R.color.hint_text_color
|
|
|
- }.lparams(wrapContent, wrapContent){
|
|
|
+ }.lparams(wrapContent, wrapContent) {
|
|
|
marginEnd = autoSize(36)
|
|
|
topMargin = autoSize(15)
|
|
|
}
|
|
|
@@ -1126,7 +1161,7 @@ class SpotReportUI(
|
|
|
text = "销售出库量"
|
|
|
textSizeAuto = 24
|
|
|
textColorInt = R.color.hint_text_color
|
|
|
- }.lparams(wrapContent, wrapContent){
|
|
|
+ }.lparams(wrapContent, wrapContent) {
|
|
|
marginEnd = autoSize(36)
|
|
|
}
|
|
|
}.lparams(autoSize(225), autoSize(97))
|
|
|
@@ -1140,10 +1175,10 @@ class SpotReportUI(
|
|
|
setEnableRefresh(true)
|
|
|
setEnableLoadMore(false)
|
|
|
setOnRefreshListener {
|
|
|
- if (viewModel.isselectSpotMonthOrDay.value == "1"){
|
|
|
- viewModel.qryReportDaySpot(tradedate = tradedate.replace("-",""))
|
|
|
- }else{
|
|
|
- viewModel.qryReportMonthSpot(tradedate = tradedate.replace("-",""))
|
|
|
+ if (viewModel.isselectSpotMonthOrDay.value == "1") {
|
|
|
+ viewModel.qryReportDaySpot(tradedate = tradedate.replace("-", ""))
|
|
|
+ } else {
|
|
|
+ viewModel.qryReportMonthSpot(tradedate = tradedate.replace("-", ""))
|
|
|
}
|
|
|
}
|
|
|
setEnableScrollContentWhenLoaded(false)
|
|
|
@@ -1157,11 +1192,11 @@ class SpotReportUI(
|
|
|
emptyView(hint = resources.getString(R.string.now_no_data))
|
|
|
}).lparams(matchParent, matchParent)
|
|
|
|
|
|
- viewModel.spotReportDataList.bindOptional(context){
|
|
|
- if (it?.isEmpty() == true || it?.size == 0){
|
|
|
+ viewModel.spotReportDataList.bindOptional(context) {
|
|
|
+ if (it?.isEmpty() == true || it?.size == 0) {
|
|
|
statusLayout.showEmpty()
|
|
|
- }else {
|
|
|
- if (swipeToLayout.getIsRefreshing()){
|
|
|
+ } else {
|
|
|
+ if (swipeToLayout.getIsRefreshing()) {
|
|
|
swipeToLayout.finishRefresh()
|
|
|
}
|
|
|
statusLayout.showSuccess()
|
|
|
@@ -1181,16 +1216,51 @@ class SpotReportUI(
|
|
|
class InvertoryReportUI(
|
|
|
private val activity: AppCompatActivity,
|
|
|
private val viewModel: ReportQueryViewModel
|
|
|
-){
|
|
|
+) : InventoryRecordAdapter.OnContentScrollListener {
|
|
|
+
|
|
|
+ private lateinit var swipeToLayout: SwipeToLoadLayout
|
|
|
+ private lateinit var statusLayout: StatusLayout
|
|
|
+ lateinit var horScrollview: CustomHorizontalScrollView
|
|
|
+ lateinit var recyclerView: RecyclerView
|
|
|
+
|
|
|
+ //列表头部的数据adapter
|
|
|
+ val topAdapter by lazy {
|
|
|
+ TopTabAdpater(activity)
|
|
|
+ }
|
|
|
+
|
|
|
+ //列表adapter
|
|
|
+ val exposureContentAdapter by lazy {
|
|
|
+ InventoryRecordAdapter(activity)
|
|
|
+ }
|
|
|
+
|
|
|
+ /** 选择的现货商品类型 */
|
|
|
+ private val selectWrStandardData: MutableLiveData<SelectData> = MutableLiveData<SelectData>().apply { value = SelectData(id = "",value = "") }
|
|
|
+
|
|
|
+ /** 选择的型号类型/品类 **/
|
|
|
+ private val selectWrStandModel: MutableLiveData<SelectData> = MutableLiveData<SelectData>().apply { value = SelectData(id = "",value = "") }
|
|
|
+
|
|
|
+ /** 选择的品牌 ***/
|
|
|
+ private val selectWrStandBrand: MutableLiveData<SelectData> = MutableLiveData<SelectData>().apply { value = SelectData(id = "",value = "") }
|
|
|
+
|
|
|
+ /** 选择的仓库 **/
|
|
|
+ private val selectWareHouse: MutableLiveData<SelectData> = MutableLiveData<SelectData>().apply { value = SelectData(id = "",value = "") }
|
|
|
|
|
|
/**
|
|
|
* 查询所用的date 注意(页面显示时间规则yyyy-MM-dd,而接口请求规则yyyyMMdd,简直无fuck可说)
|
|
|
*/
|
|
|
- var tradedate: String = TimeUtils.millis2String(TimeUtils.getNowMills().minus(86400000),SimpleDateFormat("yyyy-MM-dd"))
|
|
|
+ var tradedate: String = TimeUtils.millis2String(
|
|
|
+ TimeUtils.getNowMills().minus(86400000),
|
|
|
+ SimpleDateFormat("yyyy-MM-dd")
|
|
|
+ )
|
|
|
|
|
|
/** 查询时间textview **/
|
|
|
lateinit var tradedatetextview: TextView
|
|
|
|
|
|
+ init {
|
|
|
+ viewModel.queryWrStandardList()//查询现货列表
|
|
|
+ viewModel.queryWarehouseInfo()//查询可选择的仓库信息
|
|
|
+ }
|
|
|
+
|
|
|
@RequiresApi(Build.VERSION_CODES.N)
|
|
|
val root = _FrameLayout(activity).apply {
|
|
|
verticalLayout {
|
|
|
@@ -1198,20 +1268,22 @@ class InvertoryReportUI(
|
|
|
gravity = Gravity.CENTER_VERTICAL
|
|
|
linearLayout {
|
|
|
onThrottleFirstClick {
|
|
|
- if (viewModel.isselectSpotMonthOrDay.value == "1"){
|
|
|
- viewModel.isselectSpotMonthOrDay.postValue("2")
|
|
|
- }else{
|
|
|
- viewModel.isselectSpotMonthOrDay.postValue("1")
|
|
|
+ if (viewModel.isSelectInventoryMonthOrDay.value == "1") {
|
|
|
+ viewModel.isSelectInventoryMonthOrDay.postValue("2")
|
|
|
+ } else {
|
|
|
+ viewModel.isSelectInventoryMonthOrDay.postValue("1")
|
|
|
}
|
|
|
}
|
|
|
backgroundResource = R.drawable.rma_time_click_bg
|
|
|
gravity = Gravity.CENTER_VERTICAL
|
|
|
textView {
|
|
|
- viewModel.isselectSpotMonthOrDay.bindOptional(context){
|
|
|
- if (it == "1"){
|
|
|
+ viewModel.isSelectInventoryMonthOrDay.bindOptional(context) {
|
|
|
+ if (it == "1") {
|
|
|
text = "日报表"
|
|
|
- }else if (it == "2"){
|
|
|
+ exposureContentAdapter.setquerytype("1")
|
|
|
+ } else if (it == "2") {
|
|
|
text = "月报表"
|
|
|
+ exposureContentAdapter.setquerytype("2")
|
|
|
}
|
|
|
}
|
|
|
text = "日报表"
|
|
|
@@ -1225,7 +1297,9 @@ class InvertoryReportUI(
|
|
|
|
|
|
imageView {
|
|
|
imageResource = R.mipmap.rma_down
|
|
|
- }.lparams(autoSize(25), autoSize(25))
|
|
|
+ }.lparams(autoSize(25), autoSize(25)){
|
|
|
+ marginEnd = autoSize(10)
|
|
|
+ }
|
|
|
|
|
|
}.lparams(autoSize(264), autoSize(67)) {
|
|
|
marginStart = autoSize(36)
|
|
|
@@ -1235,6 +1309,7 @@ class InvertoryReportUI(
|
|
|
onThrottleFirstClick {
|
|
|
activity.showDataSelectDialog(type = viewModel.isselectSpotMonthOrDay.value.toString()) {
|
|
|
tradedate = this
|
|
|
+ exposureContentAdapter.setquerydate(this)
|
|
|
tradedatetextview.text = this
|
|
|
}
|
|
|
}
|
|
|
@@ -1242,7 +1317,10 @@ class InvertoryReportUI(
|
|
|
gravity = Gravity.CENTER_VERTICAL
|
|
|
textView {
|
|
|
tradedatetextview = this
|
|
|
- text = TimeUtils.millis2String(TimeUtils.getNowMills().minus(86400000),SimpleDateFormat("yyyy-MM-dd"))
|
|
|
+ text = TimeUtils.millis2String(
|
|
|
+ TimeUtils.getNowMills().minus(86400000),
|
|
|
+ SimpleDateFormat("yyyy-MM-dd")
|
|
|
+ )
|
|
|
textColorInt = R.color.rma_hint_text_color_ccc
|
|
|
textSizeAuto = 31
|
|
|
}.lparams(wrapContent, wrapContent) {
|
|
|
@@ -1253,22 +1331,32 @@ class InvertoryReportUI(
|
|
|
|
|
|
imageView {
|
|
|
imageResource = R.mipmap.rma_search_by_time
|
|
|
- }.lparams(autoSize(38), autoSize(38))
|
|
|
+ }.lparams(autoSize(38), autoSize(38)){
|
|
|
+ marginEnd = autoSize(10)
|
|
|
+ }
|
|
|
}.lparams(autoSize(264), autoSize(67)) {
|
|
|
marginStart = autoSize(12)
|
|
|
}
|
|
|
|
|
|
linearLayout {
|
|
|
onThrottleFirstClick {
|
|
|
- activity.showDataSelectDialog(type = viewModel.isselectSpotMonthOrDay.value.toString()) {
|
|
|
- tradedate = this
|
|
|
- tradedatetextview.text = this
|
|
|
+ activity.creatBottomSheetDialog(
|
|
|
+ "请选择现货品种",
|
|
|
+ viewModel.selectSpotVarietiesList(
|
|
|
+ viewModel.wrStandardDataList.value ?: arrayListOf()
|
|
|
+ )
|
|
|
+ ) {
|
|
|
+ selectWrStandardData.postValue(this)
|
|
|
+ viewModel.queryWrStandardDetail(this.id)
|
|
|
}
|
|
|
}
|
|
|
backgroundResource = R.drawable.rma_time_click_bg
|
|
|
gravity = Gravity.CENTER_VERTICAL
|
|
|
textView {
|
|
|
- tradedatetextview = this
|
|
|
+ selectWrStandardData.bindOptional(context) {
|
|
|
+ text = it?.value
|
|
|
+ textColorInt = R.color.rma_black_33
|
|
|
+ }
|
|
|
text = "现货品种"
|
|
|
textColorInt = R.color.rma_hint_text_color_ccc
|
|
|
textSizeAuto = 31
|
|
|
@@ -1279,37 +1367,281 @@ class InvertoryReportUI(
|
|
|
emptyView()
|
|
|
|
|
|
imageView {
|
|
|
- imageResource = R.mipmap.rma_search_by_time
|
|
|
- }.lparams(autoSize(38), autoSize(38))
|
|
|
+ imageResource = R.mipmap.rma_down
|
|
|
+ }.lparams(autoSize(38), autoSize(38)){
|
|
|
+ marginEnd = autoSize(10)
|
|
|
+ }
|
|
|
}.lparams(autoSize(264), autoSize(67)) {
|
|
|
marginStart = autoSize(12)
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ }.lparams(matchParent, autoSize(100))
|
|
|
+
|
|
|
+ linearLayout {
|
|
|
+ linearLayout {
|
|
|
+ onThrottleFirstClick {
|
|
|
+ activity.creatBottomSheetDialog(
|
|
|
+ "请选择品类",
|
|
|
+ viewModel.selectWrStandardModel(
|
|
|
+ viewModel.wrStandardDataDetail.value
|
|
|
+ ?: WrStandardDetail()
|
|
|
+ )
|
|
|
+ ) {
|
|
|
+ selectWrStandModel.postValue(this)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ backgroundResource = R.drawable.rma_time_click_bg
|
|
|
+ gravity = Gravity.CENTER_VERTICAL
|
|
|
+ textView {
|
|
|
+ selectWrStandModel.bindOptional(context) {
|
|
|
+ text = it?.value
|
|
|
+ textColorInt = R.color.rma_black_33
|
|
|
+ }
|
|
|
+ text = "品类"
|
|
|
+ textColorInt = R.color.rma_hint_text_color_ccc
|
|
|
+ textSizeAuto = 31
|
|
|
+ }.lparams(wrapContent, wrapContent) {
|
|
|
+ marginStart = autoSize(18)
|
|
|
+ }
|
|
|
+
|
|
|
+ emptyView()
|
|
|
+
|
|
|
+ imageView {
|
|
|
+ imageResource = R.mipmap.rma_down
|
|
|
+ }.lparams(autoSize(38), autoSize(38)){
|
|
|
+ marginEnd = autoSize(10)
|
|
|
+ }
|
|
|
+ }.lparams(0, autoSize(67), 1f) {
|
|
|
+ marginStart = autoSize(12)
|
|
|
+ }
|
|
|
+ linearLayout {
|
|
|
+ onThrottleFirstClick {
|
|
|
+ activity.creatBottomSheetDialog(
|
|
|
+ "请选择品牌",
|
|
|
+ viewModel.selectWrStandardBrand(
|
|
|
+ viewModel.wrStandardDataDetail.value
|
|
|
+ ?: WrStandardDetail()
|
|
|
+ )
|
|
|
+ ) {
|
|
|
+ selectWrStandBrand.postValue(this)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ backgroundResource = R.drawable.rma_time_click_bg
|
|
|
+ gravity = Gravity.CENTER_VERTICAL
|
|
|
+ textView {
|
|
|
+ selectWrStandBrand.bindOptional(context) {
|
|
|
+ text = it?.value
|
|
|
+ textColorInt = R.color.rma_black_33
|
|
|
+ }
|
|
|
+ text = "品牌"
|
|
|
+ textColorInt = R.color.rma_hint_text_color_ccc
|
|
|
+ textSizeAuto = 31
|
|
|
+ }.lparams(wrapContent, wrapContent) {
|
|
|
+ marginStart = autoSize(18)
|
|
|
+ }
|
|
|
+
|
|
|
+ emptyView()
|
|
|
+
|
|
|
+ imageView {
|
|
|
+ imageResource = R.mipmap.rma_down
|
|
|
+ }.lparams(autoSize(38), autoSize(38)){
|
|
|
+ marginEnd = autoSize(10)
|
|
|
+ }
|
|
|
+ }.lparams(0, autoSize(67), 1f) {
|
|
|
+ marginStart = autoSize(12)
|
|
|
+ }
|
|
|
+ linearLayout {
|
|
|
+ onThrottleFirstClick {
|
|
|
+ val selectDataList = viewModel.setSelectWarehouseList(
|
|
|
+ viewModel.normalWarehouseInfo.value ?: arrayListOf()
|
|
|
+ )
|
|
|
+ activity.creatBottomSheetDialog("请选择仓库", selectDataList) {
|
|
|
+ selectWareHouse.postValue(this)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ backgroundResource = R.drawable.rma_time_click_bg
|
|
|
+ gravity = Gravity.CENTER_VERTICAL
|
|
|
+ textView {
|
|
|
+ selectWareHouse.bindOptional(context) {
|
|
|
+ text = it?.value
|
|
|
+ textColorInt = R.color.rma_black_33
|
|
|
+ }
|
|
|
+ text = "仓库"
|
|
|
+ textColorInt = R.color.rma_hint_text_color_ccc
|
|
|
+ textSizeAuto = 31
|
|
|
+ }.lparams(wrapContent, wrapContent) {
|
|
|
+ marginStart = autoSize(18)
|
|
|
+ }
|
|
|
+
|
|
|
+ emptyView()
|
|
|
+
|
|
|
+ imageView {
|
|
|
+ imageResource = R.mipmap.rma_down
|
|
|
+ }.lparams(autoSize(38), autoSize(38)){
|
|
|
+ marginEnd = autoSize(10)
|
|
|
+ }
|
|
|
+ }.lparams(0, autoSize(67), 1f) {
|
|
|
+ marginStart = autoSize(12)
|
|
|
+ }
|
|
|
+
|
|
|
textView {
|
|
|
- visibility = View.GONE
|
|
|
onThrottleFirstClick {
|
|
|
- if (viewModel.isselectSpotMonthOrDay.value == "1"){
|
|
|
- viewModel.qryReportDaySpot(tradedate = tradedate.replace("-",""))
|
|
|
- }else{
|
|
|
- viewModel.qryReportMonthSpot(tradedate = tradedate.replace("-",""))
|
|
|
+ var querydate = ""
|
|
|
+ if (viewModel.isSelectInventoryMonthOrDay.value == "1"){//日报表
|
|
|
+ querydate = tradedate.replace("-", "")
|
|
|
+ }else{//月报表
|
|
|
+ querydate = tradedate.replace("-", "")
|
|
|
}
|
|
|
+ viewModel.queryAreaStockReport(
|
|
|
+ querytype = viewModel.isSelectInventoryMonthOrDay.value ?: "1",
|
|
|
+ querydate = querydate,
|
|
|
+ wrstandardid = selectWrStandardData.value?.id ?: "",
|
|
|
+ spotgoodsbrandid = selectWrStandBrand.value?.id ?: "",
|
|
|
+ spotgoodsmodelid = selectWrStandModel.value?.id ?: "",
|
|
|
+ warehouseinfoid = selectWareHouse.value?.id ?: ""
|
|
|
+ )
|
|
|
}
|
|
|
gravity = Gravity.CENTER
|
|
|
backgroundDrawable = createCommonBottomRoundBg(color = "#2481DD", corner = 5)
|
|
|
text = "查询"
|
|
|
textSizeAuto = 31
|
|
|
textColorInt = R.color.white
|
|
|
- }.lparams(autoSize(144), autoSize(67)) {
|
|
|
+ }.lparams(autoSize(122), autoSize(67)) {
|
|
|
marginStart = autoSize(12)
|
|
|
}
|
|
|
-
|
|
|
}.lparams(matchParent, autoSize(100))
|
|
|
-
|
|
|
+ //初始化数据进行头部数据请求
|
|
|
+ viewModel.queryInventoryTitle(
|
|
|
+ querytype = viewModel.isSelectInventoryMonthOrDay.value ?: "1",
|
|
|
+ querydate = tradedate.replace("-", "")
|
|
|
+ )
|
|
|
+ exposureContentAdapter.setOnContentScrollListener(this@InvertoryReportUI)
|
|
|
linearLayout {
|
|
|
+ linearLayout {
|
|
|
+ gravity = Gravity.LEFT or Gravity.CENTER_VERTICAL
|
|
|
+ textView {//头部右侧数据
|
|
|
+ viewModel.inventoryRecordTitle.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<InventoryRecordAdapter.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.inventoryRecordTitle.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 {
|
|
|
+ var querydate = ""
|
|
|
+ if (viewModel.isSelectInventoryMonthOrDay.value == "1"){//日报表
|
|
|
+ querydate = tradedate.replace("-", "")
|
|
|
+ }else{//月报表
|
|
|
+ querydate = tradedate.replace("-", "")
|
|
|
+ }
|
|
|
+ /**
|
|
|
+ * 下拉刷新
|
|
|
+ */
|
|
|
+ viewModel.queryAreaStockReport(
|
|
|
+ querytype = viewModel.isSelectInventoryMonthOrDay.value ?: "1",
|
|
|
+ querydate = querydate,
|
|
|
+ wrstandardid = selectWrStandardData.value?.id ?: "",
|
|
|
+ spotgoodsbrandid = selectWrStandBrand.value?.id ?: "",
|
|
|
+ spotgoodsmodelid = selectWrStandModel.value?.id ?: "",
|
|
|
+ warehouseinfoid = selectWareHouse.value?.id ?: ""
|
|
|
+
|
|
|
+ )
|
|
|
+ }
|
|
|
+ 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<InventoryRecordAdapter.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.inventoryDetailsDataList.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)
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -1326,10 +1658,10 @@ class FinancialPaymentUI(
|
|
|
private lateinit var swipeToLayout: SwipeToLoadLayout
|
|
|
private lateinit var statusLayout: StatusLayout
|
|
|
private val financialReportDayAdapter: BaseAdapter<FinancialReportData, FinancialDayViewHolder> =
|
|
|
- BaseAdapter { _, _ -> FinancialDayViewHolder(activity, viewModel,"1") }
|
|
|
+ BaseAdapter { _, _ -> FinancialDayViewHolder(activity, viewModel, "1") }
|
|
|
|
|
|
- fun queryRefrashByTime(tradeDate : String){
|
|
|
- viewModel.qryReportDayFinanceKx(tradedate = tradeDate.replace("-",""))
|
|
|
+ fun queryRefrashByTime(tradeDate: String) {
|
|
|
+ viewModel.qryReportDayFinanceKx(tradedate = tradeDate.replace("-", ""))
|
|
|
}
|
|
|
|
|
|
val root = _FrameLayout(activity).apply {
|
|
|
@@ -1357,11 +1689,11 @@ class FinancialPaymentUI(
|
|
|
emptyView(hint = resources.getString(R.string.now_no_data))
|
|
|
}).lparams(matchParent, matchParent)
|
|
|
|
|
|
- viewModel.financialReportDayPaymentDataList.bindOptional(context){
|
|
|
- if (it?.isEmpty() == true || it?.size == 0){
|
|
|
+ viewModel.financialReportDayPaymentDataList.bindOptional(context) {
|
|
|
+ if (it?.isEmpty() == true || it?.size == 0) {
|
|
|
statusLayout.showEmpty()
|
|
|
- }else {
|
|
|
- if (swipeToLayout.getIsRefreshing()){
|
|
|
+ } else {
|
|
|
+ if (swipeToLayout.getIsRefreshing()) {
|
|
|
swipeToLayout.finishRefresh()
|
|
|
}
|
|
|
statusLayout.showSuccess()
|
|
|
@@ -1386,10 +1718,10 @@ class FinancialInvoiceUI(
|
|
|
private lateinit var swipeToLayout: SwipeToLoadLayout
|
|
|
private lateinit var statusLayout: StatusLayout
|
|
|
private val financialReportDayAdapter: BaseAdapter<FinancialReportData, FinancialDayViewHolder> =
|
|
|
- BaseAdapter { _, _ -> FinancialDayViewHolder(activity, viewModel,"1") }
|
|
|
+ BaseAdapter { _, _ -> FinancialDayViewHolder(activity, viewModel, "1") }
|
|
|
|
|
|
- fun queryRefrashByTime(tradeDate : String){
|
|
|
- viewModel.qryReportDayFinanceFp(tradedate = tradeDate.replace("-",""))
|
|
|
+ fun queryRefrashByTime(tradeDate: String) {
|
|
|
+ viewModel.qryReportDayFinanceFp(tradedate = tradeDate.replace("-", ""))
|
|
|
}
|
|
|
|
|
|
val root = _FrameLayout(activity).apply {
|
|
|
@@ -1417,11 +1749,11 @@ class FinancialInvoiceUI(
|
|
|
emptyView(hint = resources.getString(R.string.now_no_data))
|
|
|
}).lparams(matchParent, matchParent)
|
|
|
|
|
|
- viewModel.financialReportDayInvoiceDataList.bindOptional(context){
|
|
|
- if (it?.isEmpty() == true || it?.size == 0){
|
|
|
+ viewModel.financialReportDayInvoiceDataList.bindOptional(context) {
|
|
|
+ if (it?.isEmpty() == true || it?.size == 0) {
|
|
|
statusLayout.showEmpty()
|
|
|
- }else {
|
|
|
- if (swipeToLayout.getIsRefreshing()){
|
|
|
+ } else {
|
|
|
+ if (swipeToLayout.getIsRefreshing()) {
|
|
|
swipeToLayout.finishRefresh()
|
|
|
}
|
|
|
statusLayout.showSuccess()
|
|
|
@@ -1433,20 +1765,23 @@ class FinancialInvoiceUI(
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
/**
|
|
|
* 财务报表日报表头部
|
|
|
* type 1 款项 2 发票
|
|
|
*/
|
|
|
-fun _LinearLayout.FinanciclReportDayTitleUI(type : String){
|
|
|
+fun _LinearLayout.FinanciclReportDayTitleUI(type: String) {
|
|
|
linearLayout {
|
|
|
verticalLayout {
|
|
|
gravity = Gravity.START
|
|
|
textView {
|
|
|
- text = if (type == "1"){ "款项发生时间" }else{ "发票发生时间" }
|
|
|
+ text = if (type == "1") {
|
|
|
+ "款项发生时间"
|
|
|
+ } else {
|
|
|
+ "发票发生时间"
|
|
|
+ }
|
|
|
textSizeAuto = 24
|
|
|
textColorInt = R.color.hint_text_color
|
|
|
- }.lparams(wrapContent, wrapContent){
|
|
|
+ }.lparams(wrapContent, wrapContent) {
|
|
|
marginStart = autoSize(36)
|
|
|
topMargin = autoSize(15)
|
|
|
}
|
|
|
@@ -1486,7 +1821,7 @@ fun _LinearLayout.FinanciclReportDayTitleUI(type : String){
|
|
|
text = "操作人"
|
|
|
textSizeAuto = 24
|
|
|
textColorInt = R.color.hint_text_color
|
|
|
- }.lparams(wrapContent, wrapContent){
|
|
|
+ }.lparams(wrapContent, wrapContent) {
|
|
|
marginEnd = autoSize(36)
|
|
|
topMargin = autoSize(15)
|
|
|
}
|
|
|
@@ -1501,6 +1836,7 @@ fun _LinearLayout.FinanciclReportDayTitleUI(type : String){
|
|
|
fun _LinearLayout.FinancialReportUiTitle() {
|
|
|
linearLayout {
|
|
|
verticalLayout {
|
|
|
+ gravity = Gravity.CENTER
|
|
|
textView {
|
|
|
text = "日期"
|
|
|
textSizeAuto = 24
|
|
|
@@ -1559,13 +1895,17 @@ fun _LinearLayout.FinancialReportUiTitle() {
|
|
|
text = "开票笔数"
|
|
|
textSizeAuto = 24
|
|
|
textColorInt = R.color.text_hit_color
|
|
|
- }.lparams(wrapContent, wrapContent)
|
|
|
+ }.lparams(wrapContent, wrapContent){
|
|
|
+ marginEnd = autoSize(30)
|
|
|
+ }
|
|
|
|
|
|
textView {
|
|
|
text = "开票金额"
|
|
|
textSizeAuto = 24
|
|
|
textColorInt = R.color.text_hit_color
|
|
|
- }.lparams(wrapContent, wrapContent)
|
|
|
+ }.lparams(wrapContent, wrapContent){
|
|
|
+ marginEnd = autoSize(30)
|
|
|
+ }
|
|
|
}.lparams(autoSize(180), autoSize(97))
|
|
|
}.lparams(matchParent, autoSize(97))
|
|
|
}
|