|
|
@@ -1,6 +1,7 @@
|
|
|
package cn.muchinfo.rma.view.base.warehousereceipt
|
|
|
|
|
|
import android.annotation.SuppressLint
|
|
|
+import android.content.Intent
|
|
|
import android.graphics.Color
|
|
|
import android.os.Build
|
|
|
import android.view.Gravity
|
|
|
@@ -21,6 +22,7 @@ import cn.muchinfo.rma.global.GlobalDataCollection
|
|
|
import cn.muchinfo.rma.global.data.AccountData
|
|
|
import cn.muchinfo.rma.global.data.HoldLBData
|
|
|
import cn.muchinfo.rma.global.data.OrderQuoteData
|
|
|
+import cn.muchinfo.rma.global.data.PermancePlanTmpData
|
|
|
import cn.muchinfo.rma.global.utils.TimeUtils
|
|
|
import cn.muchinfo.rma.lifecycle.bindOptional
|
|
|
import cn.muchinfo.rma.protobuf.protoclasses.WarehouseTradeMI1
|
|
|
@@ -28,6 +30,7 @@ import cn.muchinfo.rma.view.autoWidget.*
|
|
|
import cn.muchinfo.rma.view.autoWidget.utils.NumberUtils
|
|
|
import cn.muchinfo.rma.view.autoWidget.view.MangeNumberEditText2
|
|
|
import cn.muchinfo.rma.view.base.future.trade.itemView
|
|
|
+import cn.muchinfo.rma.view.base.hnstmain.performancetemplate.SelectPerformanceTemplateActivity
|
|
|
import cn.muchinfo.rma.view.base.home.contract.emptyView
|
|
|
import cn.muchinfo.rma.view.base.home.contract.verticalEmptyView
|
|
|
import com.blankj.utilcode.util.ConvertUtils
|
|
|
@@ -173,6 +176,7 @@ fun AppCompatActivity.OneListedDialog(
|
|
|
}
|
|
|
|
|
|
//一口价卖挂牌
|
|
|
+@Suppress("DEPRECATION")
|
|
|
class OneSellListedUI(
|
|
|
private val activity: AppCompatActivity,
|
|
|
private val viewModel: BusinessHallViewModel,
|
|
|
@@ -258,6 +262,46 @@ class OneSellListedUI(
|
|
|
itemView()
|
|
|
|
|
|
linearLayout {
|
|
|
+ background = resources.getDrawable(R.color.white)
|
|
|
+ gravity = Gravity.CENTER_VERTICAL
|
|
|
+ onThrottleFirstClick {
|
|
|
+ val intent = Intent()
|
|
|
+ intent.setClass(context, SelectPerformanceTemplateActivity::class.java)
|
|
|
+ activity.startActivityForResult(intent,1004)
|
|
|
+ }
|
|
|
+
|
|
|
+ textView {
|
|
|
+ text = "履约模版"
|
|
|
+ textSizeAuto = 34
|
|
|
+ textColorInt = R.color.rma_hint_text_color_ccc
|
|
|
+ }.lparams(wrapContent, wrapContent) {
|
|
|
+ marginStart = autoSize(36)
|
|
|
+ }
|
|
|
+
|
|
|
+ textView {
|
|
|
+ viewModel.selectPerformanceStepData.bindOptional(context) {
|
|
|
+ text = it?.templatename
|
|
|
+ textColorInt = R.color.rma_black_33
|
|
|
+ }
|
|
|
+ text = "请选择履约模版"
|
|
|
+ textSizeAuto = 31
|
|
|
+ textColorInt = R.color.rma_hint_text_color_ccc
|
|
|
+ }.lparams(wrapContent, wrapContent) {
|
|
|
+ marginStart = autoSize(80)
|
|
|
+ }
|
|
|
+
|
|
|
+ emptyView()
|
|
|
+
|
|
|
+ imageView {
|
|
|
+ imageResource = R.mipmap.rma_more
|
|
|
+ }.lparams(autoSize(36), autoSize(36)) {
|
|
|
+ marginEnd = autoSize(25)
|
|
|
+ }
|
|
|
+ }.lparams(matchParent, autoSize(132))
|
|
|
+
|
|
|
+ itemView()
|
|
|
+
|
|
|
+ linearLayout {
|
|
|
gravity = Gravity.CENTER_VERTICAL
|
|
|
linearLayout {
|
|
|
textView {
|
|
|
@@ -573,6 +617,11 @@ class OneSellListedUI(
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ if (viewModel.selectPerformanceStepData.value?.autoid.isNullOrEmpty()){
|
|
|
+ ToastUtils.showLong("请选择履约模版")
|
|
|
+ return@onThrottleFirstClick
|
|
|
+ }
|
|
|
+
|
|
|
if (onePriceInputEdittext.text.toString().isNullOrEmpty()) {
|
|
|
ToastUtils.showLong("请输入挂牌价格")
|
|
|
return@onThrottleFirstClick
|
|
|
@@ -620,7 +669,7 @@ class OneSellListedUI(
|
|
|
WRTradeGoods = WarehouseTradeMI1.WRGoodsInfo.newBuilder().build(),
|
|
|
TimevalidType = 4,
|
|
|
FirstRatio = 0.0,
|
|
|
- PerformanceTemplateID = 0,
|
|
|
+ PerformanceTemplateID = viewModel.selectPerformanceStepData.value?.autoid?.toLong() ?: 0,
|
|
|
BuyOrSell = 1,
|
|
|
PriceDisplayMode = 1,
|
|
|
CanBargain = 0,
|
|
|
@@ -631,6 +680,7 @@ class OneSellListedUI(
|
|
|
WRStandardID = data.wrstandardid?.toInt() ?: 0
|
|
|
) {
|
|
|
viewModel.controlDialogDisappear.postValue(true)
|
|
|
+ viewModel.selectPerformanceStepData.postValue(PermancePlanTmpData())
|
|
|
}
|
|
|
} else {
|
|
|
viewModel.requeryWRListingOrderReq(
|
|
|
@@ -649,7 +699,7 @@ class OneSellListedUI(
|
|
|
WRTradeGoods = WarehouseTradeMI1.WRGoodsInfo.newBuilder().build(),
|
|
|
TimevalidType = 4,
|
|
|
FirstRatio = 0.0,
|
|
|
- PerformanceTemplateID = 0,
|
|
|
+ PerformanceTemplateID = viewModel.selectPerformanceStepData.value?.autoid?.toLong() ?: 0,
|
|
|
BuyOrSell = 1,
|
|
|
PriceDisplayMode = 1,
|
|
|
CanBargain = 0,
|
|
|
@@ -660,6 +710,7 @@ class OneSellListedUI(
|
|
|
WRStandardID = data.wrstandardid?.toInt() ?: 0
|
|
|
) {
|
|
|
viewModel.controlDialogDisappear.postValue(true)
|
|
|
+ viewModel.selectPerformanceStepData.postValue(PermancePlanTmpData())
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -779,6 +830,46 @@ class OneBuyListedUI(
|
|
|
itemView()
|
|
|
|
|
|
linearLayout {
|
|
|
+ background = resources.getDrawable(R.color.white)
|
|
|
+ gravity = Gravity.CENTER_VERTICAL
|
|
|
+ onThrottleFirstClick {
|
|
|
+ val intent = Intent()
|
|
|
+ intent.setClass(context, SelectPerformanceTemplateActivity::class.java)
|
|
|
+ activity.startActivityForResult(intent,1004)
|
|
|
+ }
|
|
|
+
|
|
|
+ textView {
|
|
|
+ text = "履约模版"
|
|
|
+ textSizeAuto = 34
|
|
|
+ textColorInt = R.color.rma_hint_text_color_ccc
|
|
|
+ }.lparams(wrapContent, wrapContent) {
|
|
|
+ marginStart = autoSize(36)
|
|
|
+ }
|
|
|
+
|
|
|
+ textView {
|
|
|
+ viewModel.selectPerformanceStepData.bindOptional(context) {
|
|
|
+ text = it?.templatename
|
|
|
+ textColorInt = R.color.rma_black_33
|
|
|
+ }
|
|
|
+ text = "请选择履约模版"
|
|
|
+ textSizeAuto = 31
|
|
|
+ textColorInt = R.color.rma_hint_text_color_ccc
|
|
|
+ }.lparams(wrapContent, wrapContent) {
|
|
|
+ marginStart = autoSize(80)
|
|
|
+ }
|
|
|
+
|
|
|
+ emptyView()
|
|
|
+
|
|
|
+ imageView {
|
|
|
+ imageResource = R.mipmap.rma_more
|
|
|
+ }.lparams(autoSize(36), autoSize(36)) {
|
|
|
+ marginEnd = autoSize(25)
|
|
|
+ }
|
|
|
+ }.lparams(matchParent, autoSize(132))
|
|
|
+
|
|
|
+ itemView()
|
|
|
+
|
|
|
+ linearLayout {
|
|
|
gravity = Gravity.CENTER_VERTICAL
|
|
|
linearLayout {
|
|
|
textView {
|
|
|
@@ -1061,6 +1152,12 @@ class OneBuyListedUI(
|
|
|
ToastUtils.showLong("请输入挂牌价格")
|
|
|
return@onThrottleFirstClick
|
|
|
}
|
|
|
+
|
|
|
+ if (viewModel.selectPerformanceStepData.value?.autoid.isNullOrEmpty()){
|
|
|
+ ToastUtils.showLong("请选择履约模版")
|
|
|
+ return@onThrottleFirstClick
|
|
|
+ }
|
|
|
+
|
|
|
if (onePriceInputEdittext.text.toString().toDouble() == 0.0) {
|
|
|
ToastUtils.showLong("挂牌价格不能为零")
|
|
|
return@onThrottleFirstClick
|
|
|
@@ -1101,7 +1198,7 @@ class OneBuyListedUI(
|
|
|
WRTradeGoods = WarehouseTradeMI1.WRGoodsInfo.newBuilder().build(),
|
|
|
TimevalidType = 4,
|
|
|
FirstRatio = 0.0,
|
|
|
- PerformanceTemplateID = 0,
|
|
|
+ PerformanceTemplateID = viewModel.selectPerformanceStepData.value?.autoid?.toLong() ?: 0,
|
|
|
BuyOrSell = 0,
|
|
|
PriceDisplayMode = 1,
|
|
|
CanBargain = 0,
|
|
|
@@ -1112,6 +1209,7 @@ class OneBuyListedUI(
|
|
|
WRStandardID = data.wrstandardid?.toInt() ?: 0
|
|
|
) {
|
|
|
viewModel.controlDialogDisappear.postValue(true)
|
|
|
+ viewModel.selectPerformanceStepData.postValue(PermancePlanTmpData())
|
|
|
}
|
|
|
} else {
|
|
|
viewModel.requeryWRListingOrderReq(
|
|
|
@@ -1128,7 +1226,7 @@ class OneBuyListedUI(
|
|
|
WRTradeGoods = WarehouseTradeMI1.WRGoodsInfo.newBuilder().build(),
|
|
|
TimevalidType = 4,
|
|
|
FirstRatio = 0.0,
|
|
|
- PerformanceTemplateID = 0,
|
|
|
+ PerformanceTemplateID = viewModel.selectPerformanceStepData.value?.autoid?.toLong() ?: 0,
|
|
|
BuyOrSell = 0,
|
|
|
PriceDisplayMode = 1,
|
|
|
CanBargain = 0,
|
|
|
@@ -1139,6 +1237,7 @@ class OneBuyListedUI(
|
|
|
WRStandardID = data.wrstandardid?.toInt() ?: 0
|
|
|
) {
|
|
|
viewModel.controlDialogDisappear.postValue(true)
|
|
|
+ viewModel.selectPerformanceStepData.postValue(PermancePlanTmpData())
|
|
|
}
|
|
|
}
|
|
|
|