|
@@ -101,7 +101,7 @@ class AddContractActivity : BaseActivity<ContractViewModel>() {
|
|
|
/**
|
|
/**
|
|
|
* 选择的业务类型
|
|
* 选择的业务类型
|
|
|
*/
|
|
*/
|
|
|
- val businessTypes : MutableLiveData<SelectData> = MutableLiveData()
|
|
|
|
|
|
|
+ val businessTypes: MutableLiveData<SelectData> = MutableLiveData()
|
|
|
|
|
|
|
|
/** 选择的客户 */
|
|
/** 选择的客户 */
|
|
|
val selectCustomer: MutableLiveData<SelectData> = MutableLiveData()
|
|
val selectCustomer: MutableLiveData<SelectData> = MutableLiveData()
|
|
@@ -119,23 +119,26 @@ class AddContractActivity : BaseActivity<ContractViewModel>() {
|
|
|
val selectGoodsList: MutableLiveData<SelectData> = MutableLiveData()
|
|
val selectGoodsList: MutableLiveData<SelectData> = MutableLiveData()
|
|
|
|
|
|
|
|
/** 选择的跟单员 **/
|
|
/** 选择的跟单员 **/
|
|
|
- val selectMerchandiser : MutableLiveData<SelectData> = MutableLiveData()
|
|
|
|
|
|
|
+ val selectMerchandiser: MutableLiveData<SelectData> = MutableLiveData()
|
|
|
|
|
+
|
|
|
|
|
+ /** 选择的交易主体 ***/
|
|
|
|
|
+ val selectTradeMain: MutableLiveData<SelectData> = MutableLiveData()
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 选择的业务员
|
|
* 选择的业务员
|
|
|
*/
|
|
*/
|
|
|
- val selectSalesman : MutableLiveData<SelectData> = MutableLiveData()
|
|
|
|
|
|
|
+ val selectSalesman: MutableLiveData<SelectData> = MutableLiveData()
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 选择的交易用户
|
|
* 选择的交易用户
|
|
|
*/
|
|
*/
|
|
|
- val selectTradingData : MutableLiveData<SelectData> = MutableLiveData()
|
|
|
|
|
|
|
+ val selectTradingData: MutableLiveData<SelectData> = MutableLiveData()
|
|
|
|
|
|
|
|
// /** 选择的期货账户 **/
|
|
// /** 选择的期货账户 **/
|
|
|
// val selectFuturesAccount : MutableLiveData<SelectData> = MutableLiveData()//暂时不用了
|
|
// val selectFuturesAccount : MutableLiveData<SelectData> = MutableLiveData()//暂时不用了
|
|
|
|
|
|
|
|
/** 选择的币种 ***/
|
|
/** 选择的币种 ***/
|
|
|
- val selelctCurreryId : MutableLiveData<SelectData> = MutableLiveData()
|
|
|
|
|
|
|
+ val selelctCurreryId: MutableLiveData<SelectData> = MutableLiveData()
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 点价类型列表
|
|
* 点价类型列表
|
|
@@ -156,7 +159,12 @@ class AddContractActivity : BaseActivity<ContractViewModel>() {
|
|
|
|
|
|
|
|
fun initData() {
|
|
fun initData() {
|
|
|
if (operationtype == "1") {//新增合同市需要初始化的数据
|
|
if (operationtype == "1") {//新增合同市需要初始化的数据
|
|
|
- businessTypes.postValue(SelectData(id = MTPEnums.BUSINESS_TYPE_HEDGE.toString(),value = "套保"))
|
|
|
|
|
|
|
+ businessTypes.postValue(
|
|
|
|
|
+ SelectData(
|
|
|
|
|
+ id = MTPEnums.BUSINESS_TYPE_HEDGE.toString(),
|
|
|
|
|
+ value = "套保"
|
|
|
|
|
+ )
|
|
|
|
|
+ )
|
|
|
contractType.postValue(
|
|
contractType.postValue(
|
|
|
SelectData(
|
|
SelectData(
|
|
|
id = MTPEnums.CONTRACT_TYPE_BUY.toString(),
|
|
id = MTPEnums.CONTRACT_TYPE_BUY.toString(),
|
|
@@ -165,20 +173,28 @@ class AddContractActivity : BaseActivity<ContractViewModel>() {
|
|
|
)//初始化一个合同类型
|
|
)//初始化一个合同类型
|
|
|
viewModel.pricingType.postValue(SelectData(id = "1", value = "一口价"))//初始化一个价格类型
|
|
viewModel.pricingType.postValue(SelectData(id = "1", value = "一口价"))//初始化一个价格类型
|
|
|
} else {//修改或者重新提交时需要初始化的数据
|
|
} else {//修改或者重新提交时需要初始化的数据
|
|
|
- selectCustomer.postValue(SelectData(id = if (data.contracttype == "1"){
|
|
|
|
|
- data.selluserid.toString()
|
|
|
|
|
- }else{
|
|
|
|
|
- data.buyuserid.toString()
|
|
|
|
|
- },value = if (data.contracttype == "1"){
|
|
|
|
|
- data.sellusername.toString()
|
|
|
|
|
- }else{
|
|
|
|
|
- data.buyusername.toString()
|
|
|
|
|
- }))
|
|
|
|
|
- businessTypes.postValue(SelectData(id = data.biztype.toString(),value = if (data.biztype == "1"){
|
|
|
|
|
- "套保"
|
|
|
|
|
- }else{
|
|
|
|
|
- "套利"
|
|
|
|
|
- }))
|
|
|
|
|
|
|
+ selectCustomer.postValue(
|
|
|
|
|
+ SelectData(
|
|
|
|
|
+ id = if (data.contracttype == "1") {
|
|
|
|
|
+ data.selluserid.toString()
|
|
|
|
|
+ } else {
|
|
|
|
|
+ data.buyuserid.toString()
|
|
|
|
|
+ }, value = if (data.contracttype == "1") {
|
|
|
|
|
+ data.sellusername.toString()
|
|
|
|
|
+ } else {
|
|
|
|
|
+ data.buyusername.toString()
|
|
|
|
|
+ }
|
|
|
|
|
+ )
|
|
|
|
|
+ )
|
|
|
|
|
+ businessTypes.postValue(
|
|
|
|
|
+ SelectData(
|
|
|
|
|
+ id = data.biztype.toString(), value = if (data.biztype == "1") {
|
|
|
|
|
+ "套保"
|
|
|
|
|
+ } else {
|
|
|
|
|
+ "套利"
|
|
|
|
|
+ }
|
|
|
|
|
+ )
|
|
|
|
|
+ )
|
|
|
contractType.postValue(
|
|
contractType.postValue(
|
|
|
SelectData(
|
|
SelectData(
|
|
|
id = data.contracttype.toString(), value = if (data.contracttype == "1") {
|
|
id = data.contracttype.toString(), value = if (data.contracttype == "1") {
|
|
@@ -201,24 +217,67 @@ class AddContractActivity : BaseActivity<ContractViewModel>() {
|
|
|
deliverygoodsid = data.deliverygoodsid.toString()
|
|
deliverygoodsid = data.deliverygoodsid.toString()
|
|
|
)
|
|
)
|
|
|
)
|
|
)
|
|
|
|
|
+ selectTradeMain.postValue(
|
|
|
|
|
+ SelectData(
|
|
|
|
|
+ id = data.subjectid ?: "",
|
|
|
|
|
+ value = data.subjectname ?: ""
|
|
|
|
|
+ )
|
|
|
|
|
+ )
|
|
|
|
|
+
|
|
|
viewModel.queryWrStandardDetail(data.wrstandardid ?: "")
|
|
viewModel.queryWrStandardDetail(data.wrstandardid ?: "")
|
|
|
viewModel.queryDeliveryGoodsDetail(data.deliverygoodsid ?: "")
|
|
viewModel.queryDeliveryGoodsDetail(data.deliverygoodsid ?: "")
|
|
|
- selectWrStandModel.postValue(SelectData(id = data.wrstandardid.toString(),value = data.wrstandardname.toString(),convertfactor = data.convertfactor.toString()))
|
|
|
|
|
- selectWrStandBrand.postValue(SelectData(id = data.spotgoodsbrandid.toString(),value = data.brandname.toString()))
|
|
|
|
|
- selelctCurreryId.postValue(SelectData(id = data.currencyid.toString(),value = data.currencyname.toString()))
|
|
|
|
|
- if (data.startdate.isNullOrEmpty().not()){
|
|
|
|
|
|
|
+ selectWrStandModel.postValue(
|
|
|
|
|
+ SelectData(
|
|
|
|
|
+ id = data.wrstandardid.toString(),
|
|
|
|
|
+ value = data.wrstandardname.toString(),
|
|
|
|
|
+ convertfactor = data.convertfactor.toString()
|
|
|
|
|
+ )
|
|
|
|
|
+ )
|
|
|
|
|
+ selectWrStandBrand.postValue(
|
|
|
|
|
+ SelectData(
|
|
|
|
|
+ id = data.spotgoodsbrandid.toString(),
|
|
|
|
|
+ value = data.brandname.toString()
|
|
|
|
|
+ )
|
|
|
|
|
+ )
|
|
|
|
|
+ selelctCurreryId.postValue(
|
|
|
|
|
+ SelectData(
|
|
|
|
|
+ id = data.currencyid.toString(),
|
|
|
|
|
+ value = data.currencyname.toString()
|
|
|
|
|
+ )
|
|
|
|
|
+ )
|
|
|
|
|
+ if (data.startdate.isNullOrEmpty().not()) {
|
|
|
midpointsPeriodTime.postValue(data.startdate + "~" + data.enddate)
|
|
midpointsPeriodTime.postValue(data.startdate + "~" + data.enddate)
|
|
|
}
|
|
}
|
|
|
- if (data.saleuserid != "0"){
|
|
|
|
|
- selectSalesman.postValue(SelectData(id = data.saleuserid.toString(),value = data.saleusername.toString()))
|
|
|
|
|
|
|
+ if (data.saleuserid != "0") {
|
|
|
|
|
+ selectSalesman.postValue(
|
|
|
|
|
+ SelectData(
|
|
|
|
|
+ id = data.saleuserid.toString(),
|
|
|
|
|
+ value = data.saleusername.toString()
|
|
|
|
|
+ )
|
|
|
|
|
+ )
|
|
|
}
|
|
}
|
|
|
- if (data.tradeuserid != "0"){
|
|
|
|
|
- selectTradingData.postValue(SelectData(id = data.tradeuserid.toString(),value = data.tradeusername.toString()))
|
|
|
|
|
|
|
+ if (data.tradeuserid != "0") {
|
|
|
|
|
+ selectTradingData.postValue(
|
|
|
|
|
+ SelectData(
|
|
|
|
|
+ id = data.tradeuserid.toString(),
|
|
|
|
|
+ value = data.tradeusername.toString()
|
|
|
|
|
+ )
|
|
|
|
|
+ )
|
|
|
}
|
|
}
|
|
|
- if (data.meruserid != "0"){
|
|
|
|
|
- selectMerchandiser.postValue(SelectData(id = data.meruserid.toString(),value = data.merusername.toString()))
|
|
|
|
|
|
|
+ if (data.meruserid != "0") {
|
|
|
|
|
+ selectMerchandiser.postValue(
|
|
|
|
|
+ SelectData(
|
|
|
|
|
+ id = data.meruserid.toString(),
|
|
|
|
|
+ value = data.merusername.toString()
|
|
|
|
|
+ )
|
|
|
|
|
+ )
|
|
|
}
|
|
}
|
|
|
- selectGoodsList.postValue(SelectData(id = data.goodsid.toString(),value = data.goodsname.toString()))
|
|
|
|
|
|
|
+ selectGoodsList.postValue(
|
|
|
|
|
+ SelectData(
|
|
|
|
|
+ id = data.goodsid.toString(),
|
|
|
|
|
+ value = data.goodsname.toString()
|
|
|
|
|
+ )
|
|
|
|
|
+ )
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
}
|
|
@@ -231,6 +290,7 @@ class AddContractActivity : BaseActivity<ContractViewModel>() {
|
|
|
background = resources.getDrawable(R.color.segtabment_bg_color)
|
|
background = resources.getDrawable(R.color.segtabment_bg_color)
|
|
|
viewModel.queryUserInfo()
|
|
viewModel.queryUserInfo()
|
|
|
viewModel.queryRootUserAccount()
|
|
viewModel.queryRootUserAccount()
|
|
|
|
|
+ viewModel.getNormalDataList()//查询正常状态下的交易主体
|
|
|
viewModel.queryDeliveryGoods()//进入页面查询现货品种
|
|
viewModel.queryDeliveryGoods()//进入页面查询现货品种
|
|
|
viewModel.queryAccMgrLoginUser()//查询登录账号
|
|
viewModel.queryAccMgrLoginUser()//查询登录账号
|
|
|
// viewModel.queryAccMgrTaaccount()//查询期货账户
|
|
// viewModel.queryAccMgrTaaccount()//查询期货账户
|
|
@@ -239,9 +299,9 @@ class AddContractActivity : BaseActivity<ContractViewModel>() {
|
|
|
topBar {
|
|
topBar {
|
|
|
commonLeftButton()
|
|
commonLeftButton()
|
|
|
commonTitle {
|
|
commonTitle {
|
|
|
- if (operationtype == "1"){
|
|
|
|
|
|
|
+ if (operationtype == "1") {
|
|
|
text = "新增合同"
|
|
text = "新增合同"
|
|
|
- }else{
|
|
|
|
|
|
|
+ } else {
|
|
|
text = "修改"
|
|
text = "修改"
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -273,7 +333,7 @@ class AddContractActivity : BaseActivity<ContractViewModel>() {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
editText {
|
|
editText {
|
|
|
- if (operationtype == "2"){
|
|
|
|
|
|
|
+ if (operationtype == "2") {
|
|
|
setText(data.contractno)
|
|
setText(data.contractno)
|
|
|
}
|
|
}
|
|
|
contractNo = this
|
|
contractNo = this
|
|
@@ -345,7 +405,7 @@ class AddContractActivity : BaseActivity<ContractViewModel>() {
|
|
|
}
|
|
}
|
|
|
}.lparams(matchParent, autoSize(132))
|
|
}.lparams(matchParent, autoSize(132))
|
|
|
|
|
|
|
|
- viewItemUI()
|
|
|
|
|
|
|
+ viewItemUI()
|
|
|
|
|
|
|
|
linearLayout {
|
|
linearLayout {
|
|
|
background = resources.getDrawable(R.color.white)
|
|
background = resources.getDrawable(R.color.white)
|
|
@@ -451,8 +511,8 @@ class AddContractActivity : BaseActivity<ContractViewModel>() {
|
|
|
"请选择客户"
|
|
"请选择客户"
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- viewModel.rootUserAccountData.bindOptional(context){
|
|
|
|
|
- if (contractType.value?.id == "1"){
|
|
|
|
|
|
|
+ viewModel.rootUserAccountData.bindOptional(context) {
|
|
|
|
|
+ if (contractType.value?.id == "1") {
|
|
|
text = it?.accountname
|
|
text = it?.accountname
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -528,16 +588,16 @@ class AddContractActivity : BaseActivity<ContractViewModel>() {
|
|
|
text = if (it?.id == "-1") {
|
|
text = if (it?.id == "-1") {
|
|
|
viewModel.rootUserAccountData.value?.accountname
|
|
viewModel.rootUserAccountData.value?.accountname
|
|
|
} else {
|
|
} else {
|
|
|
- if (operationtype == "2"){
|
|
|
|
|
|
|
+ if (operationtype == "2") {
|
|
|
data.sellusername
|
|
data.sellusername
|
|
|
- }else{
|
|
|
|
|
|
|
+ } else {
|
|
|
"请选择客户"
|
|
"请选择客户"
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- viewModel.rootUserAccountData.bindOptional(context){
|
|
|
|
|
- if (contractType.value?.id == "-1"){
|
|
|
|
|
|
|
+ viewModel.rootUserAccountData.bindOptional(context) {
|
|
|
|
|
+ if (contractType.value?.id == "-1") {
|
|
|
text = it?.accountname
|
|
text = it?.accountname
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -574,6 +634,58 @@ class AddContractActivity : BaseActivity<ContractViewModel>() {
|
|
|
linearLayout {
|
|
linearLayout {
|
|
|
background = resources.getDrawable(R.color.white)
|
|
background = resources.getDrawable(R.color.white)
|
|
|
gravity = Gravity.CENTER_VERTICAL
|
|
gravity = Gravity.CENTER_VERTICAL
|
|
|
|
|
+ onThrottleFirstClick {
|
|
|
|
|
+ creatBottomSheetDialog(
|
|
|
|
|
+ "请选择交易主体",
|
|
|
|
|
+ viewModel.selectTradeMainList(
|
|
|
|
|
+ viewModel.normalTradeDataList.value ?: arrayListOf()
|
|
|
|
|
+ )
|
|
|
|
|
+ ) {
|
|
|
|
|
+ selectTradeMain.postValue(this)
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ textView {
|
|
|
|
|
+ text = "*"
|
|
|
|
|
+ textColorInt = R.color.rma_star_color
|
|
|
|
|
+ textSizeAuto = 31
|
|
|
|
|
+ }.lparams(wrapContent, wrapContent) {
|
|
|
|
|
+ marginStart = autoSize(37)
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ textView {
|
|
|
|
|
+ text = "交易主体"
|
|
|
|
|
+ textSizeAuto = 31
|
|
|
|
|
+ textColorInt = R.color.rma_black_33
|
|
|
|
|
+ }.lparams(wrapContent, wrapContent) {
|
|
|
|
|
+ marginStart = autoSize(10)
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ textView {
|
|
|
|
|
+ selectTradeMain.bindOptional(context) {
|
|
|
|
|
+ text = it?.value
|
|
|
|
|
+ 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))
|
|
|
|
|
+
|
|
|
|
|
+ viewItemUI()
|
|
|
|
|
+
|
|
|
|
|
+ linearLayout {
|
|
|
|
|
+ background = resources.getDrawable(R.color.white)
|
|
|
|
|
+ gravity = Gravity.CENTER_VERTICAL
|
|
|
|
|
|
|
|
textView {
|
|
textView {
|
|
|
text = "合同附件"
|
|
text = "合同附件"
|
|
@@ -780,48 +892,6 @@ class AddContractActivity : BaseActivity<ContractViewModel>() {
|
|
|
}
|
|
}
|
|
|
}.lparams(matchParent, autoSize(132))
|
|
}.lparams(matchParent, autoSize(132))
|
|
|
|
|
|
|
|
- viewItemUI()
|
|
|
|
|
-
|
|
|
|
|
- linearLayout {
|
|
|
|
|
- background = resources.getDrawable(R.color.white)
|
|
|
|
|
- gravity = Gravity.CENTER_VERTICAL
|
|
|
|
|
- textView {
|
|
|
|
|
- text = "*"
|
|
|
|
|
- textColorInt = R.color.rma_star_color
|
|
|
|
|
- textSizeAuto = 31
|
|
|
|
|
- }.lparams(wrapContent, wrapContent) {
|
|
|
|
|
- marginStart = autoSize(37)
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- textView {
|
|
|
|
|
- text = "标仓系数"
|
|
|
|
|
- textSizeAuto = 31
|
|
|
|
|
- textColorInt = R.color.rma_black_33
|
|
|
|
|
- }.lparams(wrapContent, wrapContent) {
|
|
|
|
|
- marginStart = autoSize(10)
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- editText {
|
|
|
|
|
- isEnabled = false
|
|
|
|
|
- coefficientWarehouse = this
|
|
|
|
|
- if (data.convertfactor?.isNotEmpty() == true) {
|
|
|
|
|
- coefficientWarehouse.setText(data.convertfactor.toString())
|
|
|
|
|
- }
|
|
|
|
|
- selectWrStandModel.bindOptional(context) {
|
|
|
|
|
- setText(it?.convertfactor)
|
|
|
|
|
- }
|
|
|
|
|
- hint = "选择品类后自动填入"
|
|
|
|
|
- background = null
|
|
|
|
|
- inputType = EditorInfo.TYPE_CLASS_NUMBER
|
|
|
|
|
- setDecimalInputType()
|
|
|
|
|
- hintColorStr = "#CCCCCC"
|
|
|
|
|
- textSizeAuto = 31
|
|
|
|
|
- textColorStr = "#333333"
|
|
|
|
|
- }.lparams(matchParent, autoSize(132)) {
|
|
|
|
|
- marginStart = autoSize(80)
|
|
|
|
|
- }
|
|
|
|
|
- }.lparams(matchParent, autoSize(132))
|
|
|
|
|
-
|
|
|
|
|
viewItemUI()
|
|
viewItemUI()
|
|
|
|
|
|
|
|
linearLayout {
|
|
linearLayout {
|
|
@@ -898,8 +968,8 @@ class AddContractActivity : BaseActivity<ContractViewModel>() {
|
|
|
|
|
|
|
|
editText {
|
|
editText {
|
|
|
productSpecifications = this
|
|
productSpecifications = this
|
|
|
- selectWrStandardData.bindOptional(context){
|
|
|
|
|
- if (it?.id?.isNotEmpty() == true){
|
|
|
|
|
|
|
+ selectWrStandardData.bindOptional(context) {
|
|
|
|
|
+ if (it?.id?.isNotEmpty() == true) {
|
|
|
setText("默认")
|
|
setText("默认")
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -965,7 +1035,10 @@ class AddContractActivity : BaseActivity<ContractViewModel>() {
|
|
|
background = resources.getDrawable(R.color.white)
|
|
background = resources.getDrawable(R.color.white)
|
|
|
gravity = Gravity.CENTER_VERTICAL
|
|
gravity = Gravity.CENTER_VERTICAL
|
|
|
onThrottleFirstClick {
|
|
onThrottleFirstClick {
|
|
|
- creatBottomSheetDialog("请选择结算币种", viewModel.getSelectCurreryIdData()) {
|
|
|
|
|
|
|
+ creatBottomSheetDialog(
|
|
|
|
|
+ "请选择结算币种",
|
|
|
|
|
+ viewModel.getSelectCurreryIdData()
|
|
|
|
|
+ ) {
|
|
|
selelctCurreryId.postValue(this)
|
|
selelctCurreryId.postValue(this)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -1131,8 +1204,8 @@ class AddContractActivity : BaseActivity<ContractViewModel>() {
|
|
|
// text = it?.value + "/" + selectWrStandModel.value?.enumdicname
|
|
// text = it?.value + "/" + selectWrStandModel.value?.enumdicname
|
|
|
// }
|
|
// }
|
|
|
// }
|
|
// }
|
|
|
- selectWrStandModel.bindOptional(context){
|
|
|
|
|
- text = "元/" + it?.enumdicname
|
|
|
|
|
|
|
+ selectWrStandModel.bindOptional(context) {
|
|
|
|
|
+ text = "元/" + it?.enumdicname
|
|
|
}
|
|
}
|
|
|
text = "元"
|
|
text = "元"
|
|
|
textSizeAuto = 31
|
|
textSizeAuto = 31
|
|
@@ -1317,7 +1390,7 @@ class AddContractActivity : BaseActivity<ContractViewModel>() {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
editText {
|
|
editText {
|
|
|
- if (operationtype == "2"){
|
|
|
|
|
|
|
+ if (operationtype == "2") {
|
|
|
setText(data.pricemove)
|
|
setText(data.pricemove)
|
|
|
}
|
|
}
|
|
|
liter_discount_edittext = this
|
|
liter_discount_edittext = this
|
|
@@ -1457,7 +1530,7 @@ class AddContractActivity : BaseActivity<ContractViewModel>() {
|
|
|
hintColorStr = "#CCCCCC"
|
|
hintColorStr = "#CCCCCC"
|
|
|
textSizeAuto = 31
|
|
textSizeAuto = 31
|
|
|
textColorStr = "#333333"
|
|
textColorStr = "#333333"
|
|
|
- }.lparams(0, autoSize(132),1f) {
|
|
|
|
|
|
|
+ }.lparams(0, autoSize(132), 1f) {
|
|
|
marginStart = autoSize(80)
|
|
marginStart = autoSize(80)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -1683,23 +1756,23 @@ class AddContractActivity : BaseActivity<ContractViewModel>() {
|
|
|
if (checkUpdate().not()) {
|
|
if (checkUpdate().not()) {
|
|
|
return@onThrottleFirstClick
|
|
return@onThrottleFirstClick
|
|
|
}
|
|
}
|
|
|
- if (data.spotcontractid.isNullOrEmpty()){
|
|
|
|
|
|
|
+ if (data.spotcontractid.isNullOrEmpty()) {
|
|
|
viewModel.orderContract(
|
|
viewModel.orderContract(
|
|
|
- contractInfo = getContractInfo(),
|
|
|
|
|
- OperateType = "2",
|
|
|
|
|
- Remark = remask_edittext.text.toString()
|
|
|
|
|
- ) {
|
|
|
|
|
- finish()
|
|
|
|
|
- }
|
|
|
|
|
- }else{
|
|
|
|
|
|
|
+ contractInfo = getContractInfo(),
|
|
|
|
|
+ OperateType = "2",
|
|
|
|
|
+ Remark = remask_edittext.text.toString()
|
|
|
|
|
+ ) {
|
|
|
|
|
+ finish()
|
|
|
|
|
+ }
|
|
|
|
|
+ } else {
|
|
|
viewModel.orderContract(
|
|
viewModel.orderContract(
|
|
|
- contractInfo = getContractInfo(),
|
|
|
|
|
- OperateType = "2",
|
|
|
|
|
- Remark = remask_edittext.text.toString(),
|
|
|
|
|
- SpotContractID = data.spotcontractid ?: ""
|
|
|
|
|
- ) {
|
|
|
|
|
- finish()
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ contractInfo = getContractInfo(),
|
|
|
|
|
+ OperateType = "2",
|
|
|
|
|
+ Remark = remask_edittext.text.toString(),
|
|
|
|
|
+ SpotContractID = data.spotcontractid ?: ""
|
|
|
|
|
+ ) {
|
|
|
|
|
+ finish()
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
}
|
|
}
|
|
@@ -1740,16 +1813,19 @@ class AddContractActivity : BaseActivity<ContractViewModel>() {
|
|
|
if (margin_edittext.text.toString().isNotEmpty()) {
|
|
if (margin_edittext.text.toString().isNotEmpty()) {
|
|
|
contractInfo.ContractMargin = margin_edittext.text.toString().toDouble()
|
|
contractInfo.ContractMargin = margin_edittext.text.toString().toDouble()
|
|
|
}
|
|
}
|
|
|
- if (selectMerchandiser.value?.id?.isNotEmpty() == true){
|
|
|
|
|
|
|
+ if (selectMerchandiser.value?.id?.isNotEmpty() == true) {
|
|
|
contractInfo.MerUserID = selectMerchandiser.value?.id?.toLong() ?: 0
|
|
contractInfo.MerUserID = selectMerchandiser.value?.id?.toLong() ?: 0
|
|
|
}
|
|
}
|
|
|
- if (selectSalesman.value?.id?.isNotEmpty() == true){
|
|
|
|
|
|
|
+ if (selectSalesman.value?.id?.isNotEmpty() == true) {
|
|
|
contractInfo.SaleUserID = selectSalesman.value?.id?.toLong() ?: 0
|
|
contractInfo.SaleUserID = selectSalesman.value?.id?.toLong() ?: 0
|
|
|
}
|
|
}
|
|
|
|
|
+ if (selectTradeMain.value?.id?.isNotEmpty() == true) {
|
|
|
|
|
+ contractInfo.SubjectID = selectTradeMain.value?.id?.toLong() ?: 0
|
|
|
|
|
+ }
|
|
|
// if (selectFuturesAccount.value?.id?.isNotEmpty() == true){
|
|
// if (selectFuturesAccount.value?.id?.isNotEmpty() == true){
|
|
|
// contractInfo.AccountID = selectFuturesAccount.value?.id?.toLong() ?: 0
|
|
// contractInfo.AccountID = selectFuturesAccount.value?.id?.toLong() ?: 0
|
|
|
// }
|
|
// }
|
|
|
- if (selectTradingData.value?.id.isNullOrEmpty().not()){
|
|
|
|
|
|
|
+ if (selectTradingData.value?.id.isNullOrEmpty().not()) {
|
|
|
contractInfo.TradeUserID = selectTradingData.value?.id?.toLong() ?: 0
|
|
contractInfo.TradeUserID = selectTradingData.value?.id?.toLong() ?: 0
|
|
|
}
|
|
}
|
|
|
contractInfo.BizType = businessTypes.value?.id?.toInt() ?: 0//业务类型
|
|
contractInfo.BizType = businessTypes.value?.id?.toInt() ?: 0//业务类型
|
|
@@ -1757,7 +1833,8 @@ class AddContractActivity : BaseActivity<ContractViewModel>() {
|
|
|
contractInfo.WrStandardID = selectWrStandModel.value?.id?.toLong()!!//品类
|
|
contractInfo.WrStandardID = selectWrStandModel.value?.id?.toLong()!!//品类
|
|
|
contractInfo.SpotGoodsBrandID = selectWrStandBrand.value?.id?.toLong()!!//品牌
|
|
contractInfo.SpotGoodsBrandID = selectWrStandBrand.value?.id?.toLong()!!//品牌
|
|
|
contractInfo.ProductType = 1//三期版本写死为1:标准仓单
|
|
contractInfo.ProductType = 1//三期版本写死为1:标准仓单
|
|
|
- contractInfo.ConvertFactor = coefficientWarehouse.text.toString().toDouble()
|
|
|
|
|
|
|
+ //2021年9月改版去掉了标仓系数
|
|
|
|
|
+// contractInfo.ConvertFactor = coefficientWarehouse.text.toString().toDouble()
|
|
|
contractInfo.SpotGoodsModelID = selectWrStandModel.value?.id?.toInt()!!
|
|
contractInfo.SpotGoodsModelID = selectWrStandModel.value?.id?.toInt()!!
|
|
|
contractInfo.PriceType = viewModel.pricingType.value?.id?.toInt()!!//定价类型
|
|
contractInfo.PriceType = viewModel.pricingType.value?.id?.toInt()!!//定价类型
|
|
|
contractInfo.Qty = number_Edittext.text.toString().toDouble()
|
|
contractInfo.Qty = number_Edittext.text.toString().toDouble()
|
|
@@ -1769,7 +1846,8 @@ class AddContractActivity : BaseActivity<ContractViewModel>() {
|
|
|
.times(number_Edittext.text.toString().toDouble())
|
|
.times(number_Edittext.text.toString().toDouble())
|
|
|
} else if (viewModel.pricingType.value?.id == "3") {//暂定价时price为暂定价
|
|
} else if (viewModel.pricingType.value?.id == "3") {//暂定价时price为暂定价
|
|
|
contractInfo.Price = temperary_edittext.text.toString().toDouble()
|
|
contractInfo.Price = temperary_edittext.text.toString().toDouble()
|
|
|
- contractInfo.Amount = temperary_edittext.text.toString().toDouble().times(number_Edittext.text.toString().toDouble())
|
|
|
|
|
|
|
+ contractInfo.Amount = temperary_edittext.text.toString().toDouble()
|
|
|
|
|
+ .times(number_Edittext.text.toString().toDouble())
|
|
|
contractInfo.GoodsID = selectGoodsList.value?.id?.toLong() ?: 0//点价合约在点价和暂定价是需要传值
|
|
contractInfo.GoodsID = selectGoodsList.value?.id?.toLong() ?: 0//点价合约在点价和暂定价是需要传值
|
|
|
} else {
|
|
} else {
|
|
|
contractInfo.GoodsID = selectGoodsList.value?.id?.toLong() ?: 0//暂时写死一个
|
|
contractInfo.GoodsID = selectGoodsList.value?.id?.toLong() ?: 0//暂时写死一个
|
|
@@ -1807,15 +1885,20 @@ class AddContractActivity : BaseActivity<ContractViewModel>() {
|
|
|
return false
|
|
return false
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- if (businessTypes.value?.id.isNullOrEmpty()){
|
|
|
|
|
|
|
+ if (businessTypes.value?.id.isNullOrEmpty()) {
|
|
|
ToastUtils.showLong("请选择业务类型")
|
|
ToastUtils.showLong("请选择业务类型")
|
|
|
return false
|
|
return false
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- if (coefficientWarehouse.text.toString().isNullOrEmpty()) {
|
|
|
|
|
- ToastUtils.showLong("请输入标仓系数")
|
|
|
|
|
|
|
+ if (selectTradeMain.value?.id.isNullOrEmpty()) {
|
|
|
|
|
+ ToastUtils.showLong("请选择交易主体")
|
|
|
return false
|
|
return false
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+// if (coefficientWarehouse.text.toString().isNullOrEmpty()) {
|
|
|
|
|
+// ToastUtils.showLong("请输入标仓系数")
|
|
|
|
|
+// return false
|
|
|
|
|
+// }
|
|
|
if (selectWrStandModel.value?.id.isNullOrEmpty()) {
|
|
if (selectWrStandModel.value?.id.isNullOrEmpty()) {
|
|
|
ToastUtils.showLong("请选择型号")
|
|
ToastUtils.showLong("请选择型号")
|
|
|
return false
|
|
return false
|
|
@@ -1867,7 +1950,7 @@ class AddContractActivity : BaseActivity<ContractViewModel>() {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- if (selelctCurreryId.value?.id.isNullOrEmpty()){
|
|
|
|
|
|
|
+ if (selelctCurreryId.value?.id.isNullOrEmpty()) {
|
|
|
ToastUtils.showLong("请选择结算币种")
|
|
ToastUtils.showLong("请选择结算币种")
|
|
|
return false
|
|
return false
|
|
|
}
|
|
}
|