|
@@ -13,6 +13,7 @@ import android.widget.TextView
|
|
|
import androidx.lifecycle.MutableLiveData
|
|
import androidx.lifecycle.MutableLiveData
|
|
|
import cn.muchinfo.rma.R
|
|
import cn.muchinfo.rma.R
|
|
|
import cn.muchinfo.rma.global.GlobalDataCollection
|
|
import cn.muchinfo.rma.global.GlobalDataCollection
|
|
|
|
|
+import cn.muchinfo.rma.global.MTPEnums
|
|
|
import cn.muchinfo.rma.global.data.UserInfoData
|
|
import cn.muchinfo.rma.global.data.UserInfoData
|
|
|
import cn.muchinfo.rma.global.database.DataBase
|
|
import cn.muchinfo.rma.global.database.DataBase
|
|
|
import cn.muchinfo.rma.global.isBlankString
|
|
import cn.muchinfo.rma.global.isBlankString
|
|
@@ -26,6 +27,9 @@ import cn.muchinfo.rma.view.autoWidget.addressDialog.AddressItemData
|
|
|
import cn.muchinfo.rma.view.autoWidget.photopicter.PhotoUtils
|
|
import cn.muchinfo.rma.view.autoWidget.photopicter.PhotoUtils
|
|
|
import cn.muchinfo.rma.view.base.BaseActivity
|
|
import cn.muchinfo.rma.view.base.BaseActivity
|
|
|
import cn.muchinfo.rma.view.base.app.Constant
|
|
import cn.muchinfo.rma.view.base.app.Constant
|
|
|
|
|
+import cn.muchinfo.rma.view.base.home.contract.emptyView
|
|
|
|
|
+import cn.muchinfo.rma.view.base.home.contract.verticalEmptyView
|
|
|
|
|
+import cn.muchinfo.rma.view.base.home.contract.viewItemUI
|
|
|
import com.alibaba.fastjson.JSON
|
|
import com.alibaba.fastjson.JSON
|
|
|
import com.blankj.utilcode.util.LogUtils
|
|
import com.blankj.utilcode.util.LogUtils
|
|
|
import com.blankj.utilcode.util.SPUtils
|
|
import com.blankj.utilcode.util.SPUtils
|
|
@@ -113,6 +117,16 @@ class AddCustomerDataActivity : BaseActivity<CustomerDataViewModel>() {
|
|
|
lateinit var enterprise_name: EditText
|
|
lateinit var enterprise_name: EditText
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
|
|
+ * 登录账号
|
|
|
|
|
+ */
|
|
|
|
|
+ lateinit var login_name: EditText
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 登录密码
|
|
|
|
|
+ */
|
|
|
|
|
+ lateinit var login_psw: EditText
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
* 证件号码
|
|
* 证件号码
|
|
|
*/
|
|
*/
|
|
|
lateinit var card_umber: EditText
|
|
lateinit var card_umber: EditText
|
|
@@ -147,6 +161,11 @@ class AddCustomerDataActivity : BaseActivity<CustomerDataViewModel>() {
|
|
|
*/
|
|
*/
|
|
|
val cardType: MutableLiveData<SelectData> = MutableLiveData()
|
|
val cardType: MutableLiveData<SelectData> = MutableLiveData()
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 选择的所属机构
|
|
|
|
|
+ */
|
|
|
|
|
+ val selectPresentData : MutableLiveData<SelectData> = MutableLiveData()
|
|
|
|
|
+
|
|
|
private val dialog by lazy { createLoadingDialog(hintStr = "正在提交") }
|
|
private val dialog by lazy { createLoadingDialog(hintStr = "正在提交") }
|
|
|
|
|
|
|
|
private var addressDialog //地址选择控件
|
|
private var addressDialog //地址选择控件
|
|
@@ -179,6 +198,12 @@ class AddCustomerDataActivity : BaseActivity<CustomerDataViewModel>() {
|
|
|
value = data.cardtypename ?: ""
|
|
value = data.cardtypename ?: ""
|
|
|
)
|
|
)
|
|
|
)
|
|
)
|
|
|
|
|
+ selectPresentData.postValue(
|
|
|
|
|
+ SelectData(
|
|
|
|
|
+ id = data.parentuserid.toString(),
|
|
|
|
|
+ value = data.parentusername ?: ""
|
|
|
|
|
+ )
|
|
|
|
|
+ )
|
|
|
val addressList = arrayListOf<AddressItemData>()
|
|
val addressList = arrayListOf<AddressItemData>()
|
|
|
if (data.provinceid != 0) {
|
|
if (data.provinceid != 0) {
|
|
|
val provinceidData = AddressItemData()
|
|
val provinceidData = AddressItemData()
|
|
@@ -205,6 +230,7 @@ class AddCustomerDataActivity : BaseActivity<CustomerDataViewModel>() {
|
|
|
dialog.bindTaskStatus(context = this, taskUiModelData = viewModel.loadingDialogStatus)
|
|
dialog.bindTaskStatus(context = this, taskUiModelData = viewModel.loadingDialogStatus)
|
|
|
|
|
|
|
|
verticalLayout {
|
|
verticalLayout {
|
|
|
|
|
+ viewModel.queryParentAreaList()
|
|
|
loadingDialog = createLoadingDialog(hintStr = "请求中")
|
|
loadingDialog = createLoadingDialog(hintStr = "请求中")
|
|
|
loadingDialog?.bindTaskStatus(context, viewModel.loadingDialogStatus)
|
|
loadingDialog?.bindTaskStatus(context, viewModel.loadingDialogStatus)
|
|
|
topBar {
|
|
topBar {
|
|
@@ -239,6 +265,162 @@ class AddCustomerDataActivity : BaseActivity<CustomerDataViewModel>() {
|
|
|
frameLayout {
|
|
frameLayout {
|
|
|
scrollView {
|
|
scrollView {
|
|
|
verticalLayout {
|
|
verticalLayout {
|
|
|
|
|
+
|
|
|
|
|
+ linearLayout {
|
|
|
|
|
+ if (SPUtils.getInstance().getString(Constant.oem) == "qhj"){
|
|
|
|
|
+ visibility = View.VISIBLE
|
|
|
|
|
+ }else{
|
|
|
|
|
+ visibility = View.GONE
|
|
|
|
|
+ }
|
|
|
|
|
+ background = resources.getDrawable(R.color.white)
|
|
|
|
|
+ gravity = Gravity.CENTER_VERTICAL
|
|
|
|
|
+ onThrottleFirstClick {
|
|
|
|
|
+ creatBottomSheetDialog("请选择合同类型", viewModel.getSelectPresentList()) {
|
|
|
|
|
+ selectPresentData.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 {
|
|
|
|
|
+ text = "请选择所属机构"
|
|
|
|
|
+ selectPresentData.bindOptional(context) {
|
|
|
|
|
+ text = it?.value
|
|
|
|
|
+ textColorInt = R.color.rma_black_33
|
|
|
|
|
+ }
|
|
|
|
|
+ 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 {
|
|
|
|
|
+ if (SPUtils.getInstance().getString(Constant.oem) == "qhj"){
|
|
|
|
|
+ visibility = View.VISIBLE
|
|
|
|
|
+ }else{
|
|
|
|
|
+ visibility = View.GONE
|
|
|
|
|
+ }
|
|
|
|
|
+ gravity = Gravity.CENTER_VERTICAL
|
|
|
|
|
+
|
|
|
|
|
+ textView {
|
|
|
|
|
+ if (status == "6") {
|
|
|
|
|
+ visibility = View.INVISIBLE
|
|
|
|
|
+ } else {
|
|
|
|
|
+ visibility = View.VISIBLE
|
|
|
|
|
+ }
|
|
|
|
|
+ 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 {
|
|
|
|
|
+ if (status != "1") {
|
|
|
|
|
+ setText(data.logincode)
|
|
|
|
|
+ }
|
|
|
|
|
+ if (status != "1" && status != "2") {
|
|
|
|
|
+ isEnabled = false
|
|
|
|
|
+ }
|
|
|
|
|
+ login_name = this
|
|
|
|
|
+ hint = "请输入登录账号"
|
|
|
|
|
+ background = null
|
|
|
|
|
+ inputType = EditorInfo.TYPE_CLASS_TEXT
|
|
|
|
|
+ hintColorStr = "#CCCCCC"
|
|
|
|
|
+ textSizeAuto = 31
|
|
|
|
|
+ textColorStr = "#333333"
|
|
|
|
|
+ }.lparams(autoSize(500), wrapContent) {
|
|
|
|
|
+ marginStart = autoSize(86)
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ }.lparams(matchParent, autoSize(136))
|
|
|
|
|
+
|
|
|
|
|
+ viewItemUI()
|
|
|
|
|
+
|
|
|
|
|
+ // 千海金 登录密码
|
|
|
|
|
+ linearLayout {
|
|
|
|
|
+ if (SPUtils.getInstance().getString(Constant.oem) == "qhj"){
|
|
|
|
|
+ visibility = View.VISIBLE
|
|
|
|
|
+ }else{
|
|
|
|
|
+ visibility = View.GONE
|
|
|
|
|
+ }
|
|
|
|
|
+ gravity = Gravity.CENTER_VERTICAL
|
|
|
|
|
+
|
|
|
|
|
+ textView {
|
|
|
|
|
+ if (status == "6") {
|
|
|
|
|
+ visibility = View.INVISIBLE
|
|
|
|
|
+ } else {
|
|
|
|
|
+ visibility = View.VISIBLE
|
|
|
|
|
+ }
|
|
|
|
|
+ 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 {
|
|
|
|
|
+// if (status != "1") {
|
|
|
|
|
+// setText(data.customername)
|
|
|
|
|
+// }
|
|
|
|
|
+ if (status != "1" && status != "2") {
|
|
|
|
|
+ isEnabled = false
|
|
|
|
|
+ }
|
|
|
|
|
+ login_psw = this
|
|
|
|
|
+ hint = "请输入登录密码"
|
|
|
|
|
+ background = null
|
|
|
|
|
+ inputType = EditorInfo.TYPE_CLASS_TEXT
|
|
|
|
|
+ hintColorStr = "#CCCCCC"
|
|
|
|
|
+ textSizeAuto = 31
|
|
|
|
|
+ textColorStr = "#333333"
|
|
|
|
|
+ }.lparams(autoSize(500), wrapContent) {
|
|
|
|
|
+ marginStart = autoSize(86)
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ }.lparams(matchParent, autoSize(136))
|
|
|
|
|
+
|
|
|
|
|
+ viewItemUI()
|
|
|
// 客户类型
|
|
// 客户类型
|
|
|
linearLayout {
|
|
linearLayout {
|
|
|
// 客户类型点击
|
|
// 客户类型点击
|
|
@@ -1245,6 +1427,8 @@ class AddCustomerDataActivity : BaseActivity<CustomerDataViewModel>() {
|
|
|
}.lparams(matchParent, autoSize(136)) {
|
|
}.lparams(matchParent, autoSize(136)) {
|
|
|
bottomMargin = autoSize(200)
|
|
bottomMargin = autoSize(200)
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ verticalEmptyView()
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -1456,6 +1640,21 @@ class AddCustomerDataActivity : BaseActivity<CustomerDataViewModel>() {
|
|
|
*/
|
|
*/
|
|
|
private fun checkInput(): Boolean {
|
|
private fun checkInput(): Boolean {
|
|
|
|
|
|
|
|
|
|
+ if (SPUtils.getInstance().getString(Constant.oem) == "qhj"){
|
|
|
|
|
+ if (selectPresentData.value?.id.isNullOrEmpty()){
|
|
|
|
|
+ ToastUtils.showLong("请选择所属机构")
|
|
|
|
|
+ return false
|
|
|
|
|
+ }
|
|
|
|
|
+ if (login_name.text.toString().isNullOrEmpty()){
|
|
|
|
|
+ ToastUtils.showLong("请输入登录账号")
|
|
|
|
|
+ return false
|
|
|
|
|
+ }
|
|
|
|
|
+ if (login_psw.text.toString().isNullOrEmpty()){
|
|
|
|
|
+ ToastUtils.showLong("请输入登录密码")
|
|
|
|
|
+ return false
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
if (customerType.value?.id == "1"){//判断个人的必填项
|
|
if (customerType.value?.id == "1"){//判断个人的必填项
|
|
|
if (enterprise_name.text.isNullOrEmpty()) {
|
|
if (enterprise_name.text.isNullOrEmpty()) {
|
|
|
ToastUtils.showLong("请输入姓名")
|
|
ToastUtils.showLong("请输入姓名")
|
|
@@ -1477,7 +1676,6 @@ class AddCustomerDataActivity : BaseActivity<CustomerDataViewModel>() {
|
|
|
return false
|
|
return false
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
return true
|
|
return true
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -1493,118 +1691,128 @@ class AddCustomerDataActivity : BaseActivity<CustomerDataViewModel>() {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private fun addUserInfo(isDraft: Boolean) {
|
|
private fun addUserInfo(isDraft: Boolean) {
|
|
|
|
|
+ val data = updataCustomerData()
|
|
|
// 客户资料参数
|
|
// 客户资料参数
|
|
|
- val params = mutableMapOf<String, Any>()
|
|
|
|
|
- if (data.userid?.toInt() == 0) {
|
|
|
|
|
- params["userid"] = 1
|
|
|
|
|
|
|
+
|
|
|
|
|
+ if (data.userid.toInt() == 0) {
|
|
|
|
|
+ data.userid = 0
|
|
|
|
|
+ data.operatetype = 1
|
|
|
} else {
|
|
} else {
|
|
|
- params["userid"] = data.userid ?: 1
|
|
|
|
|
|
|
+ data.operatetype = 2
|
|
|
|
|
+ data.userid = data.userid
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- params["userinfotype"] = customerType.value?.id?.toInt() ?: 0
|
|
|
|
|
- // 企业名称
|
|
|
|
|
- params["customername"] = enterprise_name.text.toString()
|
|
|
|
|
- params["username"] = enterprise_name.text.toString()
|
|
|
|
|
- // 开户状态:1 - 未提交;2 - 待初审
|
|
|
|
|
- params["userstate"] = if (isDraft) 1 else 2
|
|
|
|
|
|
|
+ if (SPUtils.getInstance().getString(Constant.oem) == "qhj"){
|
|
|
|
|
+ data.areaid = selectPresentData.value?.id?.toLong() ?: 0
|
|
|
|
|
+ data.logincode = login_name.text.toString()
|
|
|
|
|
+ data.loginpwd = login_psw.text.toString()
|
|
|
|
|
+ }else{
|
|
|
|
|
+ data.areaid = GlobalDataCollection.instance?.loginRsp?.userID?.toLong() ?: 0
|
|
|
|
|
+ }
|
|
|
|
|
+ data.userinfotype = customerType.value?.id?.toInt() ?: 0
|
|
|
|
|
+ data.username = enterprise_name.text.toString()
|
|
|
|
|
+ data.userstate = if (isDraft) 1 else 2
|
|
|
// 所属机构
|
|
// 所属机构
|
|
|
- // FIXME: - 这里应该判断一下UserID是否为0
|
|
|
|
|
- params["memberareaid"] = GlobalDataCollection.instance?.loginRsp?.userID ?: 0
|
|
|
|
|
|
|
+// // FIXME: - 这里应该判断一下UserID是否为0
|
|
|
|
|
+// params["memberareaid"] = GlobalDataCollection.instance?.loginRsp?.userID ?: 0
|
|
|
|
|
|
|
|
// 证件类型
|
|
// 证件类型
|
|
|
if (cardType.value?.id?.isNullOrEmpty() == false) {
|
|
if (cardType.value?.id?.isNullOrEmpty() == false) {
|
|
|
// FIXME: - 证件类型要从数据库枚举中获取
|
|
// FIXME: - 证件类型要从数据库枚举中获取
|
|
|
- params["cardtype"] = cardType.value?.id?.toInt() ?: 0
|
|
|
|
|
- } else {
|
|
|
|
|
- params["cardtype"] = -1
|
|
|
|
|
|
|
+ data.cardtype = cardType.value?.id?.toInt() ?: 0
|
|
|
}
|
|
}
|
|
|
// 证件号码
|
|
// 证件号码
|
|
|
if (!card_umber.text.isNullOrEmpty()) {
|
|
if (!card_umber.text.isNullOrEmpty()) {
|
|
|
- params["cardnum"] = card_umber.text.toString()
|
|
|
|
|
|
|
+ data.cardnum = card_umber.text.toString()
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if (customerType.value?.id == "1"){//个人
|
|
if (customerType.value?.id == "1"){//个人
|
|
|
// 身份证正面照
|
|
// 身份证正面照
|
|
|
if (!frontIdCarduploadFile.isNullOrEmpty()) {
|
|
if (!frontIdCarduploadFile.isNullOrEmpty()) {
|
|
|
- params["cardfrontphotourl"] = frontIdCarduploadFile
|
|
|
|
|
|
|
+ data.cardfrontphotourl = frontIdCarduploadFile
|
|
|
}
|
|
}
|
|
|
//身份证背面照
|
|
//身份证背面照
|
|
|
if (!backIdCarduploadFile.isNullOrEmpty()) {
|
|
if (!backIdCarduploadFile.isNullOrEmpty()) {
|
|
|
- params["cardbackphotourl"] = backIdCarduploadFile
|
|
|
|
|
|
|
+ data.cardbackphotourl = backIdCarduploadFile
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ data.nickname = enterprise_name.text.toString()
|
|
|
}else{//企业
|
|
}else{//企业
|
|
|
// 营业执照
|
|
// 营业执照
|
|
|
if (!uploadFile.isNullOrEmpty()) {
|
|
if (!uploadFile.isNullOrEmpty()) {
|
|
|
- params["cardfrontphotourl"] = uploadFile
|
|
|
|
|
|
|
+ data.proxystatementurl = uploadFile
|
|
|
}
|
|
}
|
|
|
//企业简称
|
|
//企业简称
|
|
|
if (enterprise_referred.text.toString().isNotEmpty()){
|
|
if (enterprise_referred.text.toString().isNotEmpty()){
|
|
|
- params["nickname"] = enterprise_referred.text.toString()
|
|
|
|
|
|
|
+ data.nickname = enterprise_referred.text.toString()
|
|
|
}
|
|
}
|
|
|
//法定代表人
|
|
//法定代表人
|
|
|
if (legal_representative.text.toString().isNotEmpty()){
|
|
if (legal_representative.text.toString().isNotEmpty()){
|
|
|
- params["legalpersonname"] = legal_representative.text.toString()
|
|
|
|
|
|
|
+ data.legalpersonname = legal_representative.text.toString()
|
|
|
}
|
|
}
|
|
|
//纳税人识别号
|
|
//纳税人识别号
|
|
|
if (identification_number.text.toString().isNotEmpty()){
|
|
if (identification_number.text.toString().isNotEmpty()){
|
|
|
- params["taxpayernum"] = identification_number.text.toString()
|
|
|
|
|
|
|
+ data.taxpayernum = identification_number.text.toString()
|
|
|
}
|
|
}
|
|
|
//联系人
|
|
//联系人
|
|
|
if (the_contact.text.toString().isNotEmpty()){
|
|
if (the_contact.text.toString().isNotEmpty()){
|
|
|
- params["contactname"] = the_contact.text.toString()
|
|
|
|
|
|
|
+ data.contactname = the_contact.text.toString()
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 手机号码
|
|
// 手机号码
|
|
|
if (!phone_number.text.isNullOrEmpty()) {
|
|
if (!phone_number.text.isNullOrEmpty()) {
|
|
|
- params["mobilephone"] = phone_number.text.toString()
|
|
|
|
|
|
|
+ data.mobilephone = phone_number.text.toString()
|
|
|
}
|
|
}
|
|
|
// 联系电话
|
|
// 联系电话
|
|
|
if (!contact_number.text.isNullOrEmpty()) {
|
|
if (!contact_number.text.isNullOrEmpty()) {
|
|
|
- params["telphone"] = contact_number.text.toString()
|
|
|
|
|
|
|
+ data.telphone = contact_number.text.toString()
|
|
|
}
|
|
}
|
|
|
// 通讯地址
|
|
// 通讯地址
|
|
|
if (mData.value.isNullOrEmpty().not()) {
|
|
if (mData.value.isNullOrEmpty().not()) {
|
|
|
- params["countryid"] = 0
|
|
|
|
|
- params["provinceid"] = mData.value?.get(0)?.autoid?.toInt()!!
|
|
|
|
|
- params["cityid"] = mData.value?.get(1)?.autoid?.toInt()!!
|
|
|
|
|
- params["districtid"] = mData.value?.get(2)?.autoid?.toInt()!!
|
|
|
|
|
|
|
+ data.provinceid = mData.value?.get(0)?.autoid?.toLong()!!
|
|
|
|
|
+ data.cityid = mData.value?.get(1)?.autoid?.toLong()!!
|
|
|
|
|
+ data.districtid = mData.value?.get(2)?.autoid?.toLong()!!
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if (detailed_address.text.toString().isNullOrEmpty().not()) {
|
|
if (detailed_address.text.toString().isNullOrEmpty().not()) {
|
|
|
- params["cardaddress"] = detailed_address.text.toString()
|
|
|
|
|
|
|
+ data.ipaddress = detailed_address.text.toString()
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 备注
|
|
// 备注
|
|
|
if (!remark.text.isNullOrEmpty()) {
|
|
if (!remark.text.isNullOrEmpty()) {
|
|
|
- params["remark"] = remark.text.toString()
|
|
|
|
|
|
|
+ data.remark = remark.text.toString()
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- // 提交申请
|
|
|
|
|
- viewModel.loadingDialogStatus.value = TaskUiModel.inFlight()
|
|
|
|
|
- if (status == "2") {//修改
|
|
|
|
|
- viewModel.modifyUserInfoApply(params) { isCompleted, err ->
|
|
|
|
|
- if (!isCompleted) {
|
|
|
|
|
- viewModel.loadingDialogStatus.value =
|
|
|
|
|
- TaskUiModel.failed(InteractiveException(err?.message ?: ""))
|
|
|
|
|
- return@modifyUserInfoApply
|
|
|
|
|
- }
|
|
|
|
|
- viewModel.loadingDialogStatus.value = TaskUiModel.success(msg = "提交成功")
|
|
|
|
|
- finish()
|
|
|
|
|
- }
|
|
|
|
|
- } else if (status == "1") {//新增
|
|
|
|
|
- viewModel.addUserInfoApply(params) { isCompleted, err ->
|
|
|
|
|
- if (!isCompleted) {
|
|
|
|
|
- viewModel.loadingDialogStatus.value =
|
|
|
|
|
- TaskUiModel.failed(InteractiveException(err?.message ?: ""))
|
|
|
|
|
- return@addUserInfoApply
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- viewModel.loadingDialogStatus.value = TaskUiModel.success(msg = "提交成功")
|
|
|
|
|
- SPUtils.getInstance().put(Constant.SUCCESS_ADD_CUSTOMER,1)//记录申请成功了
|
|
|
|
|
- finish()
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ viewModel.customerInfoOperateReq(data = data){
|
|
|
|
|
+ finish()
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+// // 提交申请
|
|
|
|
|
+// viewModel.loadingDialogStatus.value = TaskUiModel.inFlight()
|
|
|
|
|
+// if (status == "2") {//修改
|
|
|
|
|
+// viewModel.modifyUserInfoApply(params) { isCompleted, err ->
|
|
|
|
|
+// if (!isCompleted) {
|
|
|
|
|
+// viewModel.loadingDialogStatus.value =
|
|
|
|
|
+// TaskUiModel.failed(InteractiveException(err?.message ?: ""))
|
|
|
|
|
+// return@modifyUserInfoApply
|
|
|
|
|
+// }
|
|
|
|
|
+// viewModel.loadingDialogStatus.value = TaskUiModel.success(msg = "提交成功")
|
|
|
|
|
+// finish()
|
|
|
|
|
+// }
|
|
|
|
|
+// } else if (status == "1") {//新增
|
|
|
|
|
+// viewModel.addUserInfoApply(params) { isCompleted, err ->
|
|
|
|
|
+// if (!isCompleted) {
|
|
|
|
|
+// viewModel.loadingDialogStatus.value =
|
|
|
|
|
+// TaskUiModel.failed(InteractiveException(err?.message ?: ""))
|
|
|
|
|
+// return@addUserInfoApply
|
|
|
|
|
+// }
|
|
|
|
|
+//
|
|
|
|
|
+// viewModel.loadingDialogStatus.value = TaskUiModel.success(msg = "提交成功")
|
|
|
|
|
+// SPUtils.getInstance().put(Constant.SUCCESS_ADD_CUSTOMER,1)//记录申请成功了
|
|
|
|
|
+// finish()
|
|
|
|
|
+// }
|
|
|
|
|
+// }
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|