|
|
@@ -21,6 +21,7 @@ import cn.muchinfo.rma.global.data.*
|
|
|
import cn.muchinfo.rma.lifecycle.bindOptional
|
|
|
import cn.muchinfo.rma.view.autoWidget.*
|
|
|
import cn.muchinfo.rma.view.base.BaseActivity
|
|
|
+import cn.muchinfo.rma.view.base.app.Constant
|
|
|
import cn.muchinfo.rma.view.base.home.contract.emptyView
|
|
|
import cn.muchinfo.rma.view.base.home.financial.InvoiceRegisterActivity
|
|
|
import cn.muchinfo.rma.view.base.home.reportquery.adapter.ExposureReportContentAdapter
|
|
|
@@ -53,7 +54,7 @@ class ReportQueryActivity : BaseActivity<ReportQueryViewModel>() {
|
|
|
|
|
|
/** tab标题 **/
|
|
|
private val tabsArray: List<String> by lazy {
|
|
|
- arrayListOf("财务报表", "敞口报表", "现货报表", "库存报表","汇总损益表")
|
|
|
+ arrayListOf("财务报表", "敞口报表", "现货报表", "库存(品类)报表","库存(仓库)报表","汇总损益表")
|
|
|
}
|
|
|
|
|
|
/** 财务报表 **/
|
|
|
@@ -65,12 +66,15 @@ class ReportQueryActivity : BaseActivity<ReportQueryViewModel>() {
|
|
|
/** 现货报表 **/
|
|
|
private val spotReportUI by lazy { SpotReportUI(this, viewModel) }
|
|
|
|
|
|
- /** 库存报表 ***/
|
|
|
+ /** 库存(品类)报表 ***/
|
|
|
private val invertoryReportUI by lazy { InvertoryReportUI(this, viewModel) }
|
|
|
|
|
|
/** 现货损益报表 **/
|
|
|
private val spotEarningReportUI by lazy { SpotEarningReportUI(this,viewModel) }
|
|
|
|
|
|
+ /** 库存(仓库)报表 **/
|
|
|
+ private val invertoryWarehouseReportUI by lazy { InvertoryWarehouseReportUI(this, viewModel) }
|
|
|
+
|
|
|
private val pagerAdapter: PagerAdapter by lazy {
|
|
|
object : PagerAdapter() {
|
|
|
|
|
|
@@ -103,7 +107,7 @@ class ReportQueryActivity : BaseActivity<ReportQueryViewModel>() {
|
|
|
}
|
|
|
}
|
|
|
3 -> {
|
|
|
- return invertoryReportUI.root.apply {//库存报表
|
|
|
+ return invertoryReportUI.root.apply {//库存报表 (品类)
|
|
|
container.addView(
|
|
|
this,
|
|
|
ViewGroup.LayoutParams(matchParent, matchParent)
|
|
|
@@ -111,6 +115,14 @@ class ReportQueryActivity : BaseActivity<ReportQueryViewModel>() {
|
|
|
}
|
|
|
}
|
|
|
4 -> {
|
|
|
+ return invertoryWarehouseReportUI.root.apply {//库存报表 (仓库)
|
|
|
+ container.addView(
|
|
|
+ this,
|
|
|
+ ViewGroup.LayoutParams(matchParent, matchParent)
|
|
|
+ )
|
|
|
+ }
|
|
|
+ }
|
|
|
+ 5 -> {
|
|
|
return spotEarningReportUI.root.apply {//现货损益报表
|
|
|
container.addView(
|
|
|
this,
|
|
|
@@ -335,11 +347,11 @@ class FinancialReportUI(
|
|
|
backgroundDrawable = createCommonBottomRoundBg(color = "#2481DD", corner = 5)
|
|
|
onThrottleFirstClick {
|
|
|
if (dateType.value?.id == "1"){//日报表
|
|
|
- viewModel.qryFinanceReport(tradedate = tradedate.replace("-", ""),querytype = "1",userid = viewModel.financialSelectTransactionUser.value?.id ?: GlobalDataCollection.instance?.loginRsp?.userID.toString())
|
|
|
+ viewModel.qryFinanceReport(tradedate = tradedate.replace("-", ""),querytype = "1",userid = viewModel.financialSelectTransactionUser.value?.id ?: GlobalDataCollection.instance?.loginRsp?.userID.toString(),cycletype = "0",isFrashByUser = true)
|
|
|
}else if (dateType.value?.id == "2"){//月报表
|
|
|
- viewModel.qryFinanceReport(tradedate = tradedate.replace("-", ""),querytype = "2",userid = viewModel.financialSelectTransactionUser.value?.id ?: GlobalDataCollection.instance?.loginRsp?.userID.toString(),cycletype = "1")
|
|
|
+ viewModel.qryFinanceReport(tradedate = tradedate.replace("-", ""),querytype = "1",userid = viewModel.financialSelectTransactionUser.value?.id ?: GlobalDataCollection.instance?.loginRsp?.userID.toString(),cycletype = "1",isFrashByUser = true)
|
|
|
}else if (dateType.value?.id == "3"){//周报表
|
|
|
-
|
|
|
+ viewModel.qryFinanceReport(tradedate = tradedate.replace("-", ""),querytype = "1",userid = viewModel.financialSelectTransactionUser.value?.id ?: GlobalDataCollection.instance?.loginRsp?.userID.toString(),cycletype = "4",isFrashByUser = true)
|
|
|
}
|
|
|
|
|
|
}
|
|
|
@@ -355,7 +367,7 @@ class FinancialReportUI(
|
|
|
}.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@FinancialReportUI)
|
|
|
linearLayout {
|
|
|
linearLayout {
|
|
|
gravity = Gravity.LEFT or Gravity.CENTER_VERTICAL
|
|
|
@@ -372,7 +384,7 @@ class FinancialReportUI(
|
|
|
|
|
|
inflateLayout<CustomHorizontalScrollView>(R.layout.scrollview) {
|
|
|
horScrollview = this
|
|
|
- setOnCustomScrollChangeListener { listener, scrollX, scrollY, oldScrollX, oldScrollY -> //代码重复,可以抽取/////
|
|
|
+ setOnCustomScrollChangeListener { _, scrollX, _, _, _ ->
|
|
|
contentAdapter.offestX = scrollX
|
|
|
val viewHolderCacheList: List<FanacelReportContentAdapter.ItemViewHolder> =
|
|
|
contentAdapter.viewHolderCacheList
|
|
|
@@ -408,7 +420,6 @@ class FinancialReportUI(
|
|
|
|
|
|
statusLayout(contentBlock = {
|
|
|
statusLayout = this
|
|
|
-// bindTaskStatus(viewModule.status)
|
|
|
swipeToLoadLayout {
|
|
|
swipeToLayout = this
|
|
|
setEnableRefresh(false)
|
|
|
@@ -418,11 +429,11 @@ class FinancialReportUI(
|
|
|
* 下拉刷新
|
|
|
*/
|
|
|
if (dateType.value?.id == "1"){//日报表
|
|
|
- viewModel.qryFinanceReport(tradedate = tradedate.replace("-", ""),querytype = "1",userid = viewModel.financialSelectTransactionUser.value?.id ?: GlobalDataCollection.instance?.loginRsp?.userID.toString())
|
|
|
+ viewModel.qryFinanceReport(tradedate = tradedate.replace("-", ""),querytype = "1",userid = viewModel.financialSelectTransactionUser.value?.id ?: GlobalDataCollection.instance?.loginRsp?.userID.toString(),cycletype = "0",isFrashByUser = false)
|
|
|
}else if (dateType.value?.id == "2"){//月报表
|
|
|
- viewModel.qryFinanceReport(tradedate = tradedate.replace("-", ""),querytype = "2",userid = viewModel.financialSelectTransactionUser.value?.id ?: GlobalDataCollection.instance?.loginRsp?.userID.toString(),cycletype = "1")
|
|
|
+ viewModel.qryFinanceReport(tradedate = tradedate.replace("-", ""),querytype = "1",userid = viewModel.financialSelectTransactionUser.value?.id ?: GlobalDataCollection.instance?.loginRsp?.userID.toString(),cycletype = "1",isFrashByUser = false)
|
|
|
}else if (dateType.value?.id == "3"){//周报表
|
|
|
-
|
|
|
+ viewModel.qryFinanceReport(tradedate = tradedate.replace("-", ""),querytype = "1",userid = viewModel.financialSelectTransactionUser.value?.id ?: GlobalDataCollection.instance?.loginRsp?.userID.toString(),cycletype = "4",isFrashByUser = false)
|
|
|
}
|
|
|
}
|
|
|
setEnableScrollContentWhenLoaded(false)
|
|
|
@@ -596,7 +607,6 @@ class ExposureReportUI(
|
|
|
onThrottleFirstClick {
|
|
|
activity.creatBottomSheetDialog("请选择指定交易用户", viewModel.getCanSelectTradingAccount()) {
|
|
|
viewModel.exposureSelectTransactionUser.postValue(this)
|
|
|
-
|
|
|
}
|
|
|
}
|
|
|
viewModel.exposureSelectTransactionUser.bindOptional(context){
|
|
|
@@ -615,13 +625,12 @@ class ExposureReportUI(
|
|
|
backgroundDrawable = createCommonBottomRoundBg(color = "#2481DD", corner = 5)
|
|
|
onThrottleFirstClick {
|
|
|
if (dateType.value?.id == "1"){//日报表
|
|
|
- viewModel.qryReckonAreaExpourse(tradedate = tradedate.replace("-", ""),querytype = "1",userid = viewModel.exposureSelectTransactionUser.value?.id ?: GlobalDataCollection.instance?.loginRsp?.userID.toString())
|
|
|
+ viewModel.qryReckonAreaExpourse(tradedate = tradedate.replace("-", ""),querytype = "1",userid = viewModel.exposureSelectTransactionUser.value?.id ?: GlobalDataCollection.instance?.loginRsp?.userID.toString(),cycletype = "0",isFrashByUser = true)
|
|
|
}else if (dateType.value?.id == "2"){//月报表
|
|
|
- viewModel.qryReckonAreaExpourse(tradedate = tradedate.replace("-", ""),querytype = "2",userid = viewModel.exposureSelectTransactionUser.value?.id ?: GlobalDataCollection.instance?.loginRsp?.userID.toString(),cycletype = "1")
|
|
|
+ viewModel.qryReckonAreaExpourse(tradedate = tradedate.replace("-", ""),querytype = "1",userid = viewModel.exposureSelectTransactionUser.value?.id ?: GlobalDataCollection.instance?.loginRsp?.userID.toString(),cycletype = "1",isFrashByUser = true)
|
|
|
}else if (dateType.value?.id == "3"){//周报表
|
|
|
-
|
|
|
+ viewModel.qryReckonAreaExpourse(tradedate = tradedate.replace("-", ""),querytype = "1",userid = viewModel.exposureSelectTransactionUser.value?.id ?: GlobalDataCollection.instance?.loginRsp?.userID.toString(),cycletype = "4",isFrashByUser = true)
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
gravity = Gravity.CENTER
|
|
|
text = "查询"
|
|
|
@@ -697,7 +706,13 @@ class ExposureReportUI(
|
|
|
/**
|
|
|
* 下拉刷新
|
|
|
*/
|
|
|
-// viewModel.qryReportAreaExpourse(cycletime = tradedate.replace("-", ""),cycletype = "",userid = selectTransactionUser.value?.id ?: "")
|
|
|
+ if (dateType.value?.id == "1"){//日报表
|
|
|
+ viewModel.qryReckonAreaExpourse(tradedate = tradedate.replace("-", ""),querytype = "1",userid = viewModel.exposureSelectTransactionUser.value?.id ?: GlobalDataCollection.instance?.loginRsp?.userID.toString(),cycletype = "0",isFrashByUser = false)
|
|
|
+ }else if (dateType.value?.id == "2"){//月报表
|
|
|
+ viewModel.qryReckonAreaExpourse(tradedate = tradedate.replace("-", ""),querytype = "1",userid = viewModel.exposureSelectTransactionUser.value?.id ?: GlobalDataCollection.instance?.loginRsp?.userID.toString(),cycletype = "1",isFrashByUser = false)
|
|
|
+ }else if (dateType.value?.id == "3"){//周报表
|
|
|
+ viewModel.qryReckonAreaExpourse(tradedate = tradedate.replace("-", ""),querytype = "1",userid = viewModel.exposureSelectTransactionUser.value?.id ?: GlobalDataCollection.instance?.loginRsp?.userID.toString(),cycletype = "4",isFrashByUser = false)
|
|
|
+ }
|
|
|
}
|
|
|
setEnableScrollContentWhenLoaded(false)
|
|
|
setEnableLoadMoreWhenContentNotFull(false)
|
|
|
@@ -888,11 +903,11 @@ class SpotReportUI(
|
|
|
backgroundDrawable = createCommonBottomRoundBg(color = "#2481DD", corner = 5)
|
|
|
onThrottleFirstClick {
|
|
|
if (dateType.value?.id == "1"){//日报表
|
|
|
- viewModel.qryAreaSpotplReport(tradedate = tradedate.replace("-", ""),querytype = "1",userid = viewModel.spotSelectTransactionUser.value?.id ?: GlobalDataCollection.instance?.loginRsp?.userID.toString())
|
|
|
+ viewModel.qryAreaSpotplReport(tradedate = tradedate.replace("-", ""),querytype = "1",userid = viewModel.spotSelectTransactionUser.value?.id ?: GlobalDataCollection.instance?.loginRsp?.userID.toString(),cycletype = "0",isFrashByUser = true)
|
|
|
}else if (dateType.value?.id == "2"){//月报表
|
|
|
- viewModel.qryAreaSpotplReport(tradedate = tradedate.replace("-", ""),querytype = "2",userid = viewModel.spotSelectTransactionUser.value?.id ?: GlobalDataCollection.instance?.loginRsp?.userID.toString(),cycletype = "1")
|
|
|
+ viewModel.qryAreaSpotplReport(tradedate = tradedate.replace("-", ""),querytype = "1",userid = viewModel.spotSelectTransactionUser.value?.id ?: GlobalDataCollection.instance?.loginRsp?.userID.toString(),cycletype = "1",isFrashByUser = true)
|
|
|
}else if (dateType.value?.id == "3"){//周报表
|
|
|
-
|
|
|
+ viewModel.qryAreaSpotplReport(tradedate = tradedate.replace("-", ""),querytype = "1",userid = viewModel.spotSelectTransactionUser.value?.id ?: GlobalDataCollection.instance?.loginRsp?.userID.toString(),cycletype = "4",isFrashByUser = true)
|
|
|
}
|
|
|
|
|
|
}
|
|
|
@@ -970,6 +985,13 @@ class SpotReportUI(
|
|
|
/**
|
|
|
* 下拉刷新
|
|
|
*/
|
|
|
+ if (dateType.value?.id == "1"){//日报表
|
|
|
+ viewModel.qryAreaSpotplReport(tradedate = tradedate.replace("-", ""),querytype = "1",userid = viewModel.spotSelectTransactionUser.value?.id ?: GlobalDataCollection.instance?.loginRsp?.userID.toString(),cycletype = "0",isFrashByUser = false)
|
|
|
+ }else if (dateType.value?.id == "2"){//月报表
|
|
|
+ viewModel.qryAreaSpotplReport(tradedate = tradedate.replace("-", ""),querytype = "1",userid = viewModel.spotSelectTransactionUser.value?.id ?: GlobalDataCollection.instance?.loginRsp?.userID.toString(),cycletype = "1",isFrashByUser = false)
|
|
|
+ }else if (dateType.value?.id == "3"){//周报表
|
|
|
+ viewModel.qryAreaSpotplReport(tradedate = tradedate.replace("-", ""),querytype = "1",userid = viewModel.spotSelectTransactionUser.value?.id ?: GlobalDataCollection.instance?.loginRsp?.userID.toString(),cycletype = "4",isFrashByUser = false)
|
|
|
+ }
|
|
|
// viewModel.qryReportAreaExpourse(cycletime = tradedate.replace("-", ""),cycletype = "",userid = selectTransactionUser.value?.id ?: "")
|
|
|
}
|
|
|
setEnableScrollContentWhenLoaded(false)
|
|
|
@@ -1162,11 +1184,11 @@ class SpotEarningReportUI(
|
|
|
backgroundDrawable = createCommonBottomRoundBg(color = "#2481DD", corner = 5)
|
|
|
onThrottleFirstClick {
|
|
|
if (dateType.value?.id == "1"){//日报表
|
|
|
- viewModel.qrySummaryReport(tradedate = tradedate.replace("-", ""),querytype = "1",userid = viewModel.summarySelectTransactionUser.value?.id ?: GlobalDataCollection.instance?.loginRsp?.userID.toString())
|
|
|
+ viewModel.qrySummaryReport(tradedate = tradedate.replace("-", ""),querytype = "1",userid = viewModel.summarySelectTransactionUser.value?.id ?: GlobalDataCollection.instance?.loginRsp?.userID.toString(),cycletype = "0",isFrashByUser = true)
|
|
|
}else if (dateType.value?.id == "2"){//月报表
|
|
|
- viewModel.qrySummaryReport(tradedate = tradedate.replace("-", ""),querytype = "2",userid = viewModel.summarySelectTransactionUser.value?.id ?: GlobalDataCollection.instance?.loginRsp?.userID.toString(),cycletype = "1")
|
|
|
+ viewModel.qrySummaryReport(tradedate = tradedate.replace("-", ""),querytype = "1",userid = viewModel.summarySelectTransactionUser.value?.id ?: GlobalDataCollection.instance?.loginRsp?.userID.toString(),cycletype = "1",isFrashByUser = true)
|
|
|
}else if (dateType.value?.id == "3"){//周报表
|
|
|
-
|
|
|
+ viewModel.qrySummaryReport(tradedate = tradedate.replace("-", ""),querytype = "1",userid = viewModel.summarySelectTransactionUser.value?.id ?: GlobalDataCollection.instance?.loginRsp?.userID.toString(),cycletype = "0",isFrashByUser = true)
|
|
|
}
|
|
|
|
|
|
}
|
|
|
@@ -1244,7 +1266,13 @@ class SpotEarningReportUI(
|
|
|
/**
|
|
|
* 下拉刷新
|
|
|
*/
|
|
|
-// viewModel.qryReportAreaExpourse(cycletime = tradedate.replace("-", ""),cycletype = "",userid = selectTransactionUser.value?.id ?: "")
|
|
|
+ if (dateType.value?.id == "1"){//日报表
|
|
|
+ viewModel.qrySummaryReport(tradedate = tradedate.replace("-", ""),querytype = "1",userid = viewModel.summarySelectTransactionUser.value?.id ?: GlobalDataCollection.instance?.loginRsp?.userID.toString(),cycletype = "0",isFrashByUser = true)
|
|
|
+ }else if (dateType.value?.id == "2"){//月报表
|
|
|
+ viewModel.qrySummaryReport(tradedate = tradedate.replace("-", ""),querytype = "1",userid = viewModel.summarySelectTransactionUser.value?.id ?: GlobalDataCollection.instance?.loginRsp?.userID.toString(),cycletype = "1",isFrashByUser = true)
|
|
|
+ }else if (dateType.value?.id == "3"){//周报表
|
|
|
+ viewModel.qrySummaryReport(tradedate = tradedate.replace("-", ""),querytype = "1",userid = viewModel.summarySelectTransactionUser.value?.id ?: GlobalDataCollection.instance?.loginRsp?.userID.toString(),cycletype = "0",isFrashByUser = true)
|
|
|
+ }
|
|
|
}
|
|
|
setEnableScrollContentWhenLoaded(false)
|
|
|
setEnableLoadMoreWhenContentNotFull(false)
|
|
|
@@ -1294,7 +1322,7 @@ class SpotEarningReportUI(
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 库存报表
|
|
|
+ * 库存报表(品类)
|
|
|
* @property activity AppCompatActivity
|
|
|
* @property viewModel ReportQueryViewModel
|
|
|
* @constructor
|
|
|
@@ -1316,21 +1344,15 @@ class InvertoryReportUI(
|
|
|
|
|
|
//列表adapter
|
|
|
val exposureContentAdapter by lazy {
|
|
|
- InventoryRecordAdapter(activity)
|
|
|
+ InventoryRecordAdapter(activity,1)
|
|
|
}
|
|
|
|
|
|
- /** 选择的现货商品类型 */
|
|
|
- private val selectWrStandardData: MutableLiveData<SelectData> = MutableLiveData<SelectData>().apply { value = SelectData(id = "",value = "") }
|
|
|
+ /** 选择的现货品种 */
|
|
|
+ private val selectdeliverygoodsData: 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 = "") }
|
|
|
-
|
|
|
/**
|
|
|
* 选择的报表周期类型
|
|
|
*/
|
|
|
@@ -1351,7 +1373,7 @@ class InvertoryReportUI(
|
|
|
dateType.postValue(SelectData(id = "1",value = "日报表"))
|
|
|
viewModel.queryDeliveryGoods()//查询现货品种
|
|
|
viewModel.queryGoodsWrstandard()//查询品类
|
|
|
- viewModel.queryGoodsbrand()//查询品牌
|
|
|
+// viewModel.queryGoodsbrand()//查询品牌//第四版报表,此报表为库存品类报表
|
|
|
// viewModel.queryWarehouseInfo()//查询可选择的仓库信息(新版库存报表不用选择仓库,暂时注释掉,不知道后面要不要加回去)
|
|
|
}
|
|
|
|
|
|
@@ -1431,14 +1453,13 @@ class InvertoryReportUI(
|
|
|
"请选择现货品种",
|
|
|
viewModel.getDeliverySelectData()
|
|
|
) {
|
|
|
- selectWrStandardData.postValue(this)
|
|
|
-
|
|
|
+ selectdeliverygoodsData.postValue(this)
|
|
|
}
|
|
|
}
|
|
|
backgroundResource = R.drawable.rma_time_click_bg
|
|
|
gravity = Gravity.CENTER_VERTICAL
|
|
|
textView {
|
|
|
- selectWrStandardData.bindOptional(context) {
|
|
|
+ selectdeliverygoodsData.bindOptional(context) {
|
|
|
text = it?.value
|
|
|
textColorInt = R.color.rma_black_33
|
|
|
}
|
|
|
@@ -1497,87 +1518,32 @@ class InvertoryReportUI(
|
|
|
}.lparams(0, autoSize(67), 1f) {
|
|
|
marginStart = autoSize(12)
|
|
|
}
|
|
|
- linearLayout {
|
|
|
- onThrottleFirstClick {
|
|
|
- activity.creatBottomSheetDialog(
|
|
|
- "请选择品牌",
|
|
|
- viewModel.getGoodsBrandSelectList()
|
|
|
- ) {
|
|
|
- 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 {
|
|
|
- visibility = View.GONE
|
|
|
- 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 {
|
|
|
onThrottleFirstClick {
|
|
|
if (dateType.value?.id == "1"){//日报表
|
|
|
- viewModel.queryAreaStockReport(tradedate = tradedate.replace("-", ""),querytype = "1",wrstandardid = selectWrStandardData.value?.id ?: "",
|
|
|
- spotgoodsbrandid = selectWrStandBrand.value?.id ?: "",
|
|
|
- spotgoodsmodelid = selectWrStandModel.value?.id ?: "")
|
|
|
+ viewModel.queryAreaStockReport(tradedate = tradedate.replace("-", ""),querytype = "1",deliverygoodsid = selectdeliverygoodsData.value?.id ?: "",
|
|
|
+ cycletype = "0",
|
|
|
+ titleTab = Constant.table_mobile_report_wrstandstock,
|
|
|
+ sumfields = "1,2",
|
|
|
+ wrstandardid = selectWrStandModel.value?.id ?: "",
|
|
|
+ isFrashByUser = true)
|
|
|
}else if (dateType.value?.id == "2"){//月报表
|
|
|
- viewModel.queryAreaStockReport(tradedate = tradedate.replace("-", ""),querytype = "2",wrstandardid = selectWrStandardData.value?.id ?: "",
|
|
|
- spotgoodsbrandid = selectWrStandBrand.value?.id ?: "",
|
|
|
- spotgoodsmodelid = selectWrStandModel.value?.id ?: "",cycletype = "1")
|
|
|
+ viewModel.queryAreaStockReport(tradedate = tradedate.replace("-", ""),querytype = "2",deliverygoodsid = selectdeliverygoodsData.value?.id ?: "",
|
|
|
+ cycletype = "1",
|
|
|
+ titleTab = Constant.table_mobile_report_wrstandstock,
|
|
|
+ sumfields = "1,2",
|
|
|
+ wrstandardid = selectWrStandModel.value?.id ?: "",
|
|
|
+ isFrashByUser = true)
|
|
|
}else if (dateType.value?.id == "3"){//周报表
|
|
|
-
|
|
|
+ viewModel.queryAreaStockReport(tradedate = tradedate.replace("-", ""),querytype = "1",deliverygoodsid = selectdeliverygoodsData.value?.id ?: "",
|
|
|
+ cycletype = "4",
|
|
|
+ titleTab = Constant.table_mobile_report_wrstandstock,
|
|
|
+ sumfields = "1,2",
|
|
|
+ wrstandardid = selectWrStandModel.value?.id ?: "",
|
|
|
+ isFrashByUser = true)
|
|
|
}
|
|
|
}
|
|
|
gravity = Gravity.CENTER
|
|
|
@@ -1591,7 +1557,9 @@ class InvertoryReportUI(
|
|
|
}.lparams(matchParent, autoSize(100))
|
|
|
//初始化数据进行头部数据请求
|
|
|
viewModel.queryInventoryTitle(
|
|
|
- querytype = dateType.value?.id ?: "1",
|
|
|
+ sumfields = "1,2",
|
|
|
+ titleTab = Constant.table_mobile_report_wrstandstock,
|
|
|
+ querytype = "1",
|
|
|
tradedate = tradedate.replace("-", "")
|
|
|
)
|
|
|
exposureContentAdapter.setOnContentScrollListener(this@InvertoryReportUI)
|
|
|
@@ -1655,34 +1623,27 @@ class InvertoryReportUI(
|
|
|
setEnableLoadMore(true)
|
|
|
setOnRefreshListener {
|
|
|
if (dateType.value?.id == "1"){//日报表
|
|
|
- viewModel.queryAreaStockReport(tradedate = tradedate.replace("-", ""),querytype = "1",wrstandardid = selectWrStandardData.value?.id ?: "",
|
|
|
- spotgoodsbrandid = selectWrStandBrand.value?.id ?: "",
|
|
|
- spotgoodsmodelid = selectWrStandModel.value?.id ?: "")
|
|
|
+ viewModel.queryAreaStockReport(tradedate = tradedate.replace("-", ""),querytype = "1",deliverygoodsid = selectdeliverygoodsData.value?.id ?: "",
|
|
|
+ cycletype = "0",
|
|
|
+ titleTab = Constant.table_mobile_report_wrstandstock,
|
|
|
+ sumfields = "1,2",
|
|
|
+ wrstandardid = selectWrStandModel.value?.id ?: "",
|
|
|
+ isFrashByUser = false)
|
|
|
}else if (dateType.value?.id == "2"){//月报表
|
|
|
- viewModel.queryAreaStockReport(tradedate = tradedate.replace("-", ""),querytype = "2",wrstandardid = selectWrStandardData.value?.id ?: "",
|
|
|
- spotgoodsbrandid = selectWrStandBrand.value?.id ?: "",
|
|
|
- spotgoodsmodelid = selectWrStandModel.value?.id ?: "",cycletype = "1")
|
|
|
+ viewModel.queryAreaStockReport(tradedate = tradedate.replace("-", ""),querytype = "2",deliverygoodsid = selectdeliverygoodsData.value?.id ?: "",
|
|
|
+ cycletype = "1",
|
|
|
+ titleTab = Constant.table_mobile_report_wrstandstock,
|
|
|
+ sumfields = "1,2",
|
|
|
+ wrstandardid = selectWrStandModel.value?.id ?: "",
|
|
|
+ isFrashByUser = false)
|
|
|
}else if (dateType.value?.id == "3"){//周报表
|
|
|
-
|
|
|
+ viewModel.queryAreaStockReport(tradedate = tradedate.replace("-", ""),querytype = "1",deliverygoodsid = selectdeliverygoodsData.value?.id ?: "",
|
|
|
+ cycletype = "4",
|
|
|
+ titleTab = Constant.table_mobile_report_wrstandstock,
|
|
|
+ sumfields = "1,2",
|
|
|
+ wrstandardid = selectWrStandModel.value?.id ?: "",
|
|
|
+ isFrashByUser = false)
|
|
|
}
|
|
|
-// 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)
|
|
|
@@ -1734,111 +1695,402 @@ class InvertoryReportUI(
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 财务报表-款项UI
|
|
|
+ * 库存报表(仓库)
|
|
|
* @property activity AppCompatActivity
|
|
|
* @property viewModel ReportQueryViewModel
|
|
|
* @constructor
|
|
|
*/
|
|
|
-class FinancialPaymentUI(
|
|
|
+class InvertoryWarehouseReportUI(
|
|
|
private val activity: AppCompatActivity,
|
|
|
private val viewModel: ReportQueryViewModel
|
|
|
-) {
|
|
|
+) : InventoryRecordAdapter.OnContentScrollListener {
|
|
|
|
|
|
private lateinit var swipeToLayout: SwipeToLoadLayout
|
|
|
private lateinit var statusLayout: StatusLayout
|
|
|
- private val financialReportDayAdapter: BaseAdapter<FinancialReportData, FinancialDayViewHolder> =
|
|
|
- BaseAdapter { _, _ -> FinancialDayViewHolder(activity, viewModel, "1") }
|
|
|
+ lateinit var horScrollview: CustomHorizontalScrollView
|
|
|
+ lateinit var recyclerView: RecyclerView
|
|
|
+
|
|
|
+ //列表头部的数据adapter
|
|
|
+ val topAdapter by lazy {
|
|
|
+ TopTabAdpater(activity)
|
|
|
+ }
|
|
|
+
|
|
|
+ //列表adapter
|
|
|
+ val exposureContentAdapter by lazy {
|
|
|
+ InventoryRecordAdapter(activity,2)
|
|
|
+ }
|
|
|
+
|
|
|
+ /** 选择的现货品种 */
|
|
|
+ private val selectdeliverygoodsData: MutableLiveData<SelectData> = MutableLiveData<SelectData>().apply { value = SelectData(id = "",value = "") }
|
|
|
+
|
|
|
+ /** 选择的型号类型/品类 **/
|
|
|
+ private val selectWrStandModel: MutableLiveData<SelectData> = MutableLiveData<SelectData>().apply { value = SelectData(id = "",value = "") }
|
|
|
+
|
|
|
+ /** 选择的仓库 **/
|
|
|
+ private val selectWareHouse: MutableLiveData<SelectData> = MutableLiveData<SelectData>().apply { value = SelectData(id = "",value = "") }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 选择的报表周期类型
|
|
|
+ */
|
|
|
+ val dateType : MutableLiveData<SelectData> = MutableLiveData()
|
|
|
|
|
|
- fun queryRefrashByTime(tradeDate: String) {
|
|
|
- viewModel.qryReportDayFinanceKx(tradedate = tradeDate.replace("-", ""))
|
|
|
+ /**
|
|
|
+ * 查询所用的date 注意(页面显示时间规则yyyy-MM-dd,而接口请求规则yyyyMMdd,简直无fuck可说)
|
|
|
+ */
|
|
|
+ var tradedate: String = TimeUtils.millis2String(
|
|
|
+ TimeUtils.getNowMills().minus(86400000),
|
|
|
+ SimpleDateFormat("yyyy-MM-dd")
|
|
|
+ )
|
|
|
+
|
|
|
+ /** 查询时间textview **/
|
|
|
+ lateinit var tradedatetextview: TextView
|
|
|
+
|
|
|
+ init {
|
|
|
+ dateType.postValue(SelectData(id = "1",value = "日报表"))
|
|
|
+ viewModel.queryDeliveryGoods()//查询现货品种
|
|
|
+ viewModel.queryGoodsWrstandard()//查询品类
|
|
|
+// viewModel.queryGoodsbrand()//查询品牌
|
|
|
+ viewModel.queryWarehouseInfo()//查询可选择的仓库信
|
|
|
}
|
|
|
|
|
|
+ @RequiresApi(Build.VERSION_CODES.N)
|
|
|
val root = _FrameLayout(activity).apply {
|
|
|
verticalLayout {
|
|
|
- viewModel.qryReportDayFinanceKx(tradedate = TimeUtils.getNowString(SimpleDateFormat("yyyyMMdd")))
|
|
|
- FinanciclReportDayTitleUI(type = "1")
|
|
|
- statusLayout(contentBlock = {
|
|
|
- statusLayout = this
|
|
|
-// bindTaskStatus(viewModule.status)
|
|
|
- swipeToLoadLayout {
|
|
|
- swipeToLayout = this
|
|
|
- setEnableRefresh(false)
|
|
|
- setEnableLoadMore(false)
|
|
|
- setOnRefreshListener {
|
|
|
+ linearLayout {
|
|
|
+ gravity = Gravity.CENTER_VERTICAL
|
|
|
+ linearLayout {
|
|
|
+ onThrottleFirstClick {
|
|
|
+ activity.creatBottomSheetDialog("请选择报表周期", viewModel.getSelectDateType()) {
|
|
|
+ dateType.postValue(this)
|
|
|
+ exposureContentAdapter.setTimeType(this.id)//item设置时间类型
|
|
|
+ }
|
|
|
+ }
|
|
|
+ backgroundResource = R.drawable.rma_time_click_bg
|
|
|
+ gravity = Gravity.CENTER_VERTICAL
|
|
|
+ textView {
|
|
|
+ dateType.bindOptional(context){
|
|
|
+ text = it?.value
|
|
|
+ }
|
|
|
+ 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(25), autoSize(25)){
|
|
|
+ marginEnd = autoSize(10)
|
|
|
}
|
|
|
- setEnableScrollContentWhenLoaded(false)
|
|
|
- setEnableLoadMoreWhenContentNotFull(false)
|
|
|
- recyclerView {
|
|
|
- background = resources.getDrawable(R.color.white)
|
|
|
- adapter = financialReportDayAdapter
|
|
|
- }.lparams(matchParent, matchParent)
|
|
|
+
|
|
|
+ }.lparams(autoSize(264), autoSize(67)) {
|
|
|
+ marginStart = autoSize(36)
|
|
|
}
|
|
|
- }, emptyBlock = {
|
|
|
- emptyView(hint = resources.getString(R.string.now_no_data))
|
|
|
- }).lparams(matchParent, matchParent)
|
|
|
|
|
|
- viewModel.financialReportDayPaymentDataList.bindOptional(context) {
|
|
|
- if (it?.isEmpty() == true || it?.size == 0) {
|
|
|
- statusLayout.showEmpty()
|
|
|
- } else {
|
|
|
- if (swipeToLayout.getIsRefreshing()) {
|
|
|
- swipeToLayout.finishRefresh()
|
|
|
+ linearLayout {
|
|
|
+ onThrottleFirstClick {
|
|
|
+ activity.showDataSelectDialog(type = viewModel.isselectSpotMonthOrDay.value.toString()) {
|
|
|
+ tradedate = this
|
|
|
+ exposureContentAdapter.setTime(this)
|
|
|
+ tradedatetextview.text = this
|
|
|
+ }
|
|
|
}
|
|
|
- statusLayout.showSuccess()
|
|
|
- financialReportDayAdapter.setNewData(it)
|
|
|
+ backgroundResource = R.drawable.rma_time_click_bg
|
|
|
+ gravity = Gravity.CENTER_VERTICAL
|
|
|
+ textView {
|
|
|
+ tradedatetextview = this
|
|
|
+ text = TimeUtils.millis2String(
|
|
|
+ TimeUtils.getNowMills().minus(86400000),
|
|
|
+ SimpleDateFormat("yyyy-MM-dd")
|
|
|
+ )
|
|
|
+ textColorInt = R.color.rma_hint_text_color_ccc
|
|
|
+ textSizeAuto = 31
|
|
|
+ }.lparams(wrapContent, wrapContent) {
|
|
|
+ marginStart = autoSize(18)
|
|
|
+ }
|
|
|
+
|
|
|
+ emptyView()
|
|
|
+
|
|
|
+ imageView {
|
|
|
+ imageResource = R.mipmap.rma_search_by_time
|
|
|
+ }.lparams(autoSize(38), autoSize(38)){
|
|
|
+ marginEnd = autoSize(10)
|
|
|
+ }
|
|
|
+ }.lparams(autoSize(264), autoSize(67)) {
|
|
|
+ marginStart = autoSize(12)
|
|
|
}
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-}
|
|
|
|
|
|
-/**
|
|
|
- * 财务报表-发票UI
|
|
|
- * @property activity AppCompatActivity
|
|
|
- * @property viewModel ReportQueryViewModel
|
|
|
- * @constructor
|
|
|
- */
|
|
|
-class FinancialInvoiceUI(
|
|
|
- private val activity: AppCompatActivity,
|
|
|
- private val viewModel: ReportQueryViewModel
|
|
|
-) {
|
|
|
+ linearLayout {
|
|
|
+ onThrottleFirstClick {
|
|
|
+ activity.creatBottomSheetDialog(
|
|
|
+ "请选择现货品种",
|
|
|
+ viewModel.getDeliverySelectData()
|
|
|
+ ) {
|
|
|
+ selectdeliverygoodsData.postValue(this)
|
|
|
|
|
|
- private lateinit var swipeToLayout: SwipeToLoadLayout
|
|
|
- private lateinit var statusLayout: StatusLayout
|
|
|
- private val financialReportDayAdapter: BaseAdapter<FinancialReportData, FinancialDayViewHolder> =
|
|
|
- BaseAdapter { _, _ -> FinancialDayViewHolder(activity, viewModel, "1") }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ backgroundResource = R.drawable.rma_time_click_bg
|
|
|
+ gravity = Gravity.CENTER_VERTICAL
|
|
|
+ textView {
|
|
|
+ selectdeliverygoodsData.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)
|
|
|
+ }
|
|
|
|
|
|
- fun queryRefrashByTime(tradeDate: String) {
|
|
|
- viewModel.qryReportDayFinanceFp(tradedate = tradeDate.replace("-", ""))
|
|
|
- }
|
|
|
+ emptyView()
|
|
|
|
|
|
- val root = _FrameLayout(activity).apply {
|
|
|
- verticalLayout {
|
|
|
- viewModel.qryReportDayFinanceFp(tradedate = TimeUtils.getNowString(SimpleDateFormat("yyyyMMdd")))
|
|
|
- FinanciclReportDayTitleUI(type = "2")
|
|
|
+ imageView {
|
|
|
+ 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.getGoodsWrstandardSelectList()
|
|
|
+ ) {
|
|
|
+ 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 {
|
|
|
+ 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 {
|
|
|
+ onThrottleFirstClick {
|
|
|
+ if (dateType.value?.id == "1"){//日报表
|
|
|
+ viewModel.queryAreaStockReport(tradedate = tradedate.replace("-", ""),querytype = "1",deliverygoodsid = selectdeliverygoodsData.value?.id ?: "",
|
|
|
+ cycletype = "0",
|
|
|
+ titleTab = Constant.table_mobile_report_warehousestock,
|
|
|
+ sumfields = "1,2,4",
|
|
|
+ warehouseinfoid = selectWareHouse.value?.id ?: "",
|
|
|
+ wrstandardid = selectWrStandModel.value?.id ?: "",
|
|
|
+ isFrashByUser = true)
|
|
|
+ }else if (dateType.value?.id == "2"){//月报表
|
|
|
+ viewModel.queryAreaStockReport(tradedate = tradedate.replace("-", ""),querytype = "2",deliverygoodsid = selectdeliverygoodsData.value?.id ?: "",
|
|
|
+ cycletype = "1",
|
|
|
+ titleTab = Constant.table_mobile_report_warehousestock,
|
|
|
+ sumfields = "1,2,4",
|
|
|
+ warehouseinfoid = selectWareHouse.value?.id ?: "",
|
|
|
+ wrstandardid = selectWrStandModel.value?.id ?: "",
|
|
|
+ isFrashByUser = true)
|
|
|
+ }else if (dateType.value?.id == "3"){//周报表
|
|
|
+ viewModel.queryAreaStockReport(tradedate = tradedate.replace("-", ""),querytype = "1",deliverygoodsid = selectdeliverygoodsData.value?.id ?: "",
|
|
|
+ cycletype = "4",
|
|
|
+ titleTab = Constant.table_mobile_report_warehousestock,
|
|
|
+ sumfields = "1,2,4",
|
|
|
+ warehouseinfoid = selectWareHouse.value?.id ?: "",
|
|
|
+ wrstandardid = selectWrStandModel.value?.id ?: "",
|
|
|
+ isFrashByUser = true)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ gravity = Gravity.CENTER
|
|
|
+ backgroundDrawable = createCommonBottomRoundBg(color = "#2481DD", corner = 5)
|
|
|
+ text = "查询"
|
|
|
+ textSizeAuto = 31
|
|
|
+ textColorInt = R.color.white
|
|
|
+ }.lparams(autoSize(122), autoSize(67)) {
|
|
|
+ marginStart = autoSize(12)
|
|
|
+ }
|
|
|
+ }.lparams(matchParent, autoSize(100))
|
|
|
+ //初始化数据进行头部数据请求
|
|
|
+ viewModel.queryInventoryTitle(
|
|
|
+ sumfields = "1,2,4",
|
|
|
+ titleTab = Constant.table_mobile_report_warehousestock,
|
|
|
+ querytype = "1",
|
|
|
+ tradedate = tradedate.replace("-", "")
|
|
|
+ )
|
|
|
+ exposureContentAdapter.setOnContentScrollListener(this@InvertoryWarehouseReportUI)
|
|
|
+ linearLayout {
|
|
|
+ linearLayout {
|
|
|
+ gravity = Gravity.LEFT or Gravity.CENTER_VERTICAL
|
|
|
+ textView {//头部右侧数据
|
|
|
+ viewModel.inventoryWarehouseRecordTitle.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.inventoryWarehouseRecordTitle.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(false)
|
|
|
- setEnableLoadMore(false)
|
|
|
+ setEnableRefresh(true)
|
|
|
+ setEnableLoadMore(true)
|
|
|
setOnRefreshListener {
|
|
|
-
|
|
|
+ if (dateType.value?.id == "1"){//日报表
|
|
|
+ viewModel.queryAreaStockReport(tradedate = tradedate.replace("-", ""),querytype = "1",deliverygoodsid = selectdeliverygoodsData.value?.id ?: "",
|
|
|
+ cycletype = "0",
|
|
|
+ titleTab = Constant.table_mobile_report_warehousestock,
|
|
|
+ sumfields = "1,2,4",
|
|
|
+ warehouseinfoid = selectWareHouse.value?.id ?: "",
|
|
|
+ wrstandardid = selectWrStandModel.value?.id ?: "",
|
|
|
+ isFrashByUser = false)
|
|
|
+ }else if (dateType.value?.id == "2"){//月报表
|
|
|
+ viewModel.queryAreaStockReport(tradedate = tradedate.replace("-", ""),querytype = "2",deliverygoodsid = selectdeliverygoodsData.value?.id ?: "",
|
|
|
+ cycletype = "1",
|
|
|
+ titleTab = Constant.table_mobile_report_warehousestock,
|
|
|
+ sumfields = "1,2,4",
|
|
|
+ warehouseinfoid = selectWareHouse.value?.id ?: "",
|
|
|
+ wrstandardid = selectWrStandModel.value?.id ?: "",
|
|
|
+ isFrashByUser = false)
|
|
|
+ }else if (dateType.value?.id == "3"){//周报表
|
|
|
+ viewModel.queryAreaStockReport(tradedate = tradedate.replace("-", ""),querytype = "1",deliverygoodsid = selectdeliverygoodsData.value?.id ?: "",
|
|
|
+ cycletype = "4",
|
|
|
+ titleTab = Constant.table_mobile_report_warehousestock,
|
|
|
+ sumfields = "1,2,4",
|
|
|
+ warehouseinfoid = selectWareHouse.value?.id ?: "",
|
|
|
+ wrstandardid = selectWrStandModel.value?.id ?: "",
|
|
|
+ isFrashByUser = false)
|
|
|
+ }
|
|
|
}
|
|
|
setEnableScrollContentWhenLoaded(false)
|
|
|
setEnableLoadMoreWhenContentNotFull(false)
|
|
|
+
|
|
|
recyclerView {
|
|
|
background = resources.getDrawable(R.color.white)
|
|
|
- adapter = financialReportDayAdapter
|
|
|
- }.lparams(matchParent, matchParent)
|
|
|
+ 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.financialReportDayInvoiceDataList.bindOptional(context) {
|
|
|
+ viewModel.inventoryWarehouseDetailsDataList.bindOptional(context) {
|
|
|
+
|
|
|
if (it?.isEmpty() == true || it?.size == 0) {
|
|
|
statusLayout.showEmpty()
|
|
|
} else {
|
|
|
@@ -1846,155 +2098,14 @@ class FinancialInvoiceUI(
|
|
|
swipeToLayout.finishRefresh()
|
|
|
}
|
|
|
statusLayout.showSuccess()
|
|
|
- financialReportDayAdapter.setNewData(it)
|
|
|
+ exposureContentAdapter.setDatas(it)
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-}
|
|
|
-
|
|
|
-
|
|
|
-/**
|
|
|
- * 财务报表日报表头部
|
|
|
- * type 1 款项 2 发票
|
|
|
- */
|
|
|
-fun _LinearLayout.FinanciclReportDayTitleUI(type: String) {
|
|
|
- linearLayout {
|
|
|
- verticalLayout {
|
|
|
- gravity = Gravity.START
|
|
|
- textView {
|
|
|
- text = if (type == "1") {
|
|
|
- "款项发生时间"
|
|
|
- } else {
|
|
|
- "发票发生时间"
|
|
|
- }
|
|
|
- textSizeAuto = 24
|
|
|
- textColorInt = R.color.hint_text_color
|
|
|
- }.lparams(wrapContent, wrapContent) {
|
|
|
- marginStart = autoSize(36)
|
|
|
- topMargin = autoSize(15)
|
|
|
- }
|
|
|
- }.lparams(autoSize(225), autoSize(97))
|
|
|
-
|
|
|
- verticalLayout {
|
|
|
- gravity = Gravity.CENTER
|
|
|
- textView {
|
|
|
- text = "合同类型"
|
|
|
- textSizeAuto = 24
|
|
|
- textColorInt = R.color.hint_text_color
|
|
|
- }.lparams(wrapContent, wrapContent)
|
|
|
- textView {
|
|
|
- text = "合同编号"
|
|
|
- textSizeAuto = 24
|
|
|
- textColorInt = R.color.hint_text_color
|
|
|
- }.lparams(wrapContent, wrapContent)
|
|
|
- }.lparams(autoSize(225), autoSize(97))
|
|
|
-
|
|
|
- verticalLayout {
|
|
|
- gravity = Gravity.CENTER
|
|
|
- textView {
|
|
|
- text = "类型"
|
|
|
- textSizeAuto = 24
|
|
|
- textColorInt = R.color.hint_text_color
|
|
|
- }.lparams(wrapContent, wrapContent)
|
|
|
- textView {
|
|
|
- text = "金额"
|
|
|
- textSizeAuto = 24
|
|
|
- textColorInt = R.color.hint_text_color
|
|
|
- }.lparams(wrapContent, wrapContent)
|
|
|
- }.lparams(autoSize(225), autoSize(97))
|
|
|
-
|
|
|
- verticalLayout {
|
|
|
- gravity = Gravity.END
|
|
|
- textView {
|
|
|
- text = "操作人"
|
|
|
- textSizeAuto = 24
|
|
|
- textColorInt = R.color.hint_text_color
|
|
|
- }.lparams(wrapContent, wrapContent) {
|
|
|
- marginEnd = autoSize(36)
|
|
|
- topMargin = autoSize(15)
|
|
|
- }
|
|
|
- }.lparams(autoSize(225), autoSize(97))
|
|
|
- }.lparams(matchParent, autoSize(97))
|
|
|
-}
|
|
|
-
|
|
|
-/**
|
|
|
- * 财务报表月报表头部
|
|
|
- * @receiver _LinearLayout
|
|
|
- */
|
|
|
-fun _LinearLayout.FinancialReportUiTitle() {
|
|
|
- linearLayout {
|
|
|
- verticalLayout {
|
|
|
- gravity = Gravity.CENTER
|
|
|
- textView {
|
|
|
- text = "日期"
|
|
|
- textSizeAuto = 24
|
|
|
- textColorInt = R.color.text_hit_color
|
|
|
- }.lparams(wrapContent, wrapContent)
|
|
|
- }.lparams(autoSize(180), autoSize(97))
|
|
|
|
|
|
- verticalLayout {
|
|
|
- gravity = Gravity.END
|
|
|
- textView {
|
|
|
- text = "收款笔数"
|
|
|
- textSizeAuto = 24
|
|
|
- textColorInt = R.color.text_hit_color
|
|
|
- }.lparams(wrapContent, wrapContent)
|
|
|
-
|
|
|
- textView {
|
|
|
- text = "收款金额"
|
|
|
- textSizeAuto = 24
|
|
|
- textColorInt = R.color.text_hit_color
|
|
|
- }.lparams(wrapContent, wrapContent)
|
|
|
- }.lparams(autoSize(180), autoSize(97))
|
|
|
-
|
|
|
- verticalLayout {
|
|
|
- gravity = Gravity.END
|
|
|
- textView {
|
|
|
- text = "付款笔数"
|
|
|
- textSizeAuto = 24
|
|
|
- textColorInt = R.color.text_hit_color
|
|
|
- }.lparams(wrapContent, wrapContent)
|
|
|
-
|
|
|
- textView {
|
|
|
- text = "付款金额"
|
|
|
- textSizeAuto = 24
|
|
|
- textColorInt = R.color.text_hit_color
|
|
|
- }.lparams(wrapContent, wrapContent)
|
|
|
- }.lparams(autoSize(180), autoSize(97))
|
|
|
-
|
|
|
- verticalLayout {
|
|
|
- gravity = Gravity.END
|
|
|
- textView {
|
|
|
- text = "收票笔数"
|
|
|
- textSizeAuto = 24
|
|
|
- textColorInt = R.color.text_hit_color
|
|
|
- }.lparams(wrapContent, wrapContent)
|
|
|
-
|
|
|
- textView {
|
|
|
- text = "收票金额"
|
|
|
- textSizeAuto = 24
|
|
|
- textColorInt = R.color.text_hit_color
|
|
|
- }.lparams(wrapContent, wrapContent)
|
|
|
- }.lparams(autoSize(180), autoSize(97))
|
|
|
-
|
|
|
- verticalLayout {
|
|
|
- gravity = Gravity.END
|
|
|
- textView {
|
|
|
- text = "开票笔数"
|
|
|
- textSizeAuto = 24
|
|
|
- textColorInt = R.color.text_hit_color
|
|
|
- }.lparams(wrapContent, wrapContent){
|
|
|
- marginEnd = autoSize(30)
|
|
|
- }
|
|
|
-
|
|
|
- textView {
|
|
|
- text = "开票金额"
|
|
|
- textSizeAuto = 24
|
|
|
- textColorInt = R.color.text_hit_color
|
|
|
- }.lparams(wrapContent, wrapContent){
|
|
|
- marginEnd = autoSize(30)
|
|
|
- }
|
|
|
- }.lparams(autoSize(180), autoSize(97))
|
|
|
- }.lparams(matchParent, autoSize(97))
|
|
|
+ override fun onScroll(event: MotionEvent?) {
|
|
|
+ //处理单个item滚动时,顶部tab需要联动
|
|
|
+ if (null != horScrollview) horScrollview.onTouchEvent(event)
|
|
|
+ }
|
|
|
}
|