Browse Source

风险管理4月29日提交代码-liu.bolan

Liu.bolan 4 years ago
parent
commit
acef132278

+ 23 - 0
RMA/app/src/main/java/cn/muchinfo/rma/business/customer/CustomerManage.kt

@@ -97,6 +97,29 @@ class CustomerManage {
     }
 
     /**
+     * 删除客户申请
+     */
+    fun deleteUserInfoApply(
+        params: Map<String, String>,
+        callback: (isCompleted: Boolean, err: Error?) -> Unit
+    ){
+        MyOkHttpUtils().query(
+            URL = SPUtils.getInstance()
+                .getString(Constant.goCommonSearchUrl) + "/Erms3/DeleteUserInfoApply",
+            params = params,
+            type = "1",
+            callback = object : ResponseCallback<BaseResult<String>>() {
+                override fun onResponse(response: BaseResult<String>?, id: Int) {
+                    callback(true, null)
+                }
+
+                override fun onError(call: Call?, e: Exception?, id: Int) {
+                    callback(false, Error(e?.message))
+                }
+            })
+    }
+
+    /**
      * 更新用户状态
      * @param userID Int 目标用户ID
      * @param accountStatus Int 账户状态 - 4:正常 6:注销(停用)

+ 3 - 2
RMA/app/src/main/java/cn/muchinfo/rma/global/data/UserInfoData.kt

@@ -43,7 +43,7 @@ data class UserInfoData(
     val status: Int? = 0,
     val statusdesc: String? = "",
     val telphone: String? = "",
-    val userid: Int? = 0,
+    val userid: Long? = 0,
     val userinfotype: Int? = 0,
     var indexSelect: Int = 0,
     val districtid : Int = 0,
@@ -68,7 +68,7 @@ data class UserInfoData(
         parcel.readValue(Int::class.java.classLoader) as? Int,
         parcel.readString(),
         parcel.readString(),
-        parcel.readValue(Int::class.java.classLoader) as? Int,
+        parcel.readValue(Long::class.java.classLoader) as? Long,
         parcel.readValue(Int::class.java.classLoader) as? Int,
         parcel.readInt(),
         parcel.readInt(),
@@ -118,4 +118,5 @@ data class UserInfoData(
         }
     }
 
+
 }

+ 2 - 2
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/business/SettlementAuditActivity.kt

@@ -425,7 +425,7 @@ class SettlementAuditActivity : BaseActivity<BusinessManagementViewModel>() {
                         gravity = Gravity.CENTER_VERTICAL
                         textView {
                             onThrottleFirstClick {
-                                viewModel.contractOperaOrder(operateApplyID = data.operateapplyid?.toLong() ?: 0,operateType = 2,remark = ramsk_edittext.text.toString()){
+                                viewModel.contractOperaOrder(operateApplyID = data.operateapplyid?.toLong() ?: 0,operateType = 3,remark = ramsk_edittext.text.toString()){
                                     finish()
                                 }
                             }
@@ -440,7 +440,7 @@ class SettlementAuditActivity : BaseActivity<BusinessManagementViewModel>() {
 
                         textView {
                             onThrottleFirstClick {
-                                viewModel.contractOperaOrder(operateApplyID = data.operateapplyid?.toLong() ?: 0,operateType = 3,remark = ramsk_edittext.text.toString()){
+                                viewModel.contractOperaOrder(operateApplyID = data.operateapplyid?.toLong() ?: 0,operateType = 2,remark = ramsk_edittext.text.toString()){
                                     finish()
                                 }
                             }

+ 4 - 2
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/contract/ContractActivity.kt

@@ -22,6 +22,8 @@ import com.qmuiteam.qmui.util.QMUIDisplayHelper
 import com.qmuiteam.qmui.widget.tab.QMUITabIndicator
 import com.qmuiteam.qmui.widget.tab.QMUITabSegment
 import mtp.polymer.com.autowidget.adapter.BaseAdapter
+import mtp.polymer.com.autowidget.dialog.createLoadingDialog
+import mtp.polymer.com.autowidget.utils.bindTaskStatus
 import org.jetbrains.anko.*
 import org.jetbrains.anko.support.v4.viewPager
 
@@ -158,7 +160,7 @@ class ContractActivity : BaseActivity<ContractViewModel>() {
 //                        lparams(matchParent, autoSize(120,900))
 //                    }
 //                }
-
+                createLoadingDialog(hintStr = "请求中...").bindTaskStatus(context, viewModel.loadingDialogStatus)
                 background = resources.getDrawable(R.color.main_title_bg_color)
                 linearLayout {
                     gravity = Gravity.CENTER
@@ -535,7 +537,7 @@ fun _LinearLayout.creatContractHeadUI(){
 
         verticalLayout {
             textView {
-                text = "产品类型"
+                text = "业务类型"
                 textColorInt = R.color.hint_text_color
                 textSizeAuto = 24
             }.lparams(wrapContent, wrapContent)

+ 26 - 6
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/contract/ContractDataViewHolder.kt

@@ -150,16 +150,14 @@ class ContractDataViewHolder(
 
                     textView {
                         data.bindOptional(context) {
-                            when (it?.producttype) {
+                            when (it?.biztype) {
                                 "1" -> {
-                                    text = "标准仓单"
+                                    text = "套保"
                                 }
                                 "2" -> {
-                                    text = "等标"
-                                }
-                                "3" -> {
-                                    text = "非标"
+                                    text = "套利"
                                 }
+
                             }
                         }
                         textSizeAuto = 29
@@ -336,6 +334,28 @@ class ContractDataViewHolder(
 
                 textView {
                     onThrottleFirstClick {
+                        viewModel.orderContract(OperateType = "3",SpotContractID = data.value?.spotcontractid ?: ""){
+                            viewModel.queryContract("1")
+                        }
+                    }
+                    data.bindOptional(context) {
+                        visibility = if (type == "1") {
+                            View.VISIBLE
+                        } else {
+                            View.GONE
+                        }
+                    }
+                    backgroundResource = R.drawable.rma_item_click_bg
+                    gravity = Gravity.CENTER
+                    text = "删除"
+                    textColorInt = R.color.rma_item_click_color
+                    textSizeAuto = 26
+                }.lparams(autoSize(120), autoSize(48)) {
+                    marginEnd = autoSize(24)
+                }
+
+                textView {
+                    onThrottleFirstClick {
                         val intent = Intent()
                         intent.putExtra("type","1")
                         intent.putExtra("data",data.value)

+ 601 - 33
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/customerdata/AddCustomerDataActivity.kt

@@ -72,15 +72,43 @@ class AddCustomerDataActivity : BaseActivity<CustomerDataViewModel>() {
     private val imageString: MutableLiveData<String> =
         MutableLiveData<String>().apply { value = "" } // 文件地址
 
+    /**
+     * 身份证正面照片
+     */
+    private var frontIdCarduploadFile: String = "" // 上传成功后服务给的图片地址
+    private val frontIdCardimageString: MutableLiveData<String> =
+        MutableLiveData<String>().apply { value = "" } // 文件地址
+
+    /**
+     * 身份证正面照片
+     */
+    private var backIdCarduploadFile: String = "" // 上传成功后服务给的图片地址
+    private val backIdCardimageString: MutableLiveData<String> =
+        MutableLiveData<String>().apply { value = "" } // 文件地址
+
     lateinit var document_type_text: TextView
 
     private var loadingDialog: Dialog? = null
 
     lateinit var detailed_address: EditText
 
+    /**
+     * 纳税人识别号
+     */
+    lateinit var identification_number: EditText
 
     /**
-     * 企业名称
+     * 法定代表人(企业时输入)
+     */
+    lateinit var legal_representative: EditText
+
+    /**
+     * 企业简称
+     */
+    lateinit var enterprise_referred: EditText
+
+    /**
+     * 企业名称 (个人时是姓名 企业时是企业名称·)
      */
     lateinit var enterprise_name: EditText
 
@@ -90,11 +118,16 @@ class AddCustomerDataActivity : BaseActivity<CustomerDataViewModel>() {
     lateinit var card_umber: EditText
 
     /**
-     * 手机号码
+     * 手机号码/个人时为手机号码,企业时为联系人手机号码
      */
     lateinit var phone_number: EditText
 
     /**
+     * 联系人
+     */
+    lateinit var the_contact: EditText
+
+    /**
      * 联系电话
      */
     lateinit var contact_number: EditText
@@ -147,7 +180,7 @@ class AddCustomerDataActivity : BaseActivity<CustomerDataViewModel>() {
                 )
             )
             val addressList = arrayListOf<AddressItemData>()
-            if (data.provinceid != 0){
+            if (data.provinceid != 0) {
                 val provinceidData = AddressItemData()
                 provinceidData.autoid = data.provinceid.toString()
                 val cityidData = AddressItemData()
@@ -160,6 +193,8 @@ class AddCustomerDataActivity : BaseActivity<CustomerDataViewModel>() {
                 mData.postValue(addressList)
             }
 
+        }else{
+            customerType.postValue(SelectData(id = "2",value = "企业"))
         }
         // 恢复数据
     }
@@ -212,7 +247,7 @@ class AddCustomerDataActivity : BaseActivity<CustomerDataViewModel>() {
                                     return@onThrottleFirstClick
                                 }
                                 val selectDataList = arrayListOf(
-//                                    SelectData(id = "1", value = "个人"),
+                                    SelectData(id = "1", value = "个人"),
                                     SelectData(id = "2", value = "企业")
                                 )
                                 creatBottomSheetDialog("请选择客户类型", selectDataList) {
@@ -247,6 +282,7 @@ class AddCustomerDataActivity : BaseActivity<CustomerDataViewModel>() {
                                     it.let {
                                         text = it?.value
                                     }
+                                    textColorInt = R.color.rma_black_33
                                 }
                                 textResource = R.string.change_user_info_type
                                 textSizeAuto = 31
@@ -285,7 +321,13 @@ class AddCustomerDataActivity : BaseActivity<CustomerDataViewModel>() {
                             }
 
                             textView {
-                                textResource = R.string.an_enterprise_name
+                                customerType.bindOptional(context) {
+                                    if (it?.id == "1") {
+                                        text = "姓        名"
+                                    } else {
+                                        text = "企业名称"
+                                    }
+                                }
                                 textSizeAuto = 31
                                 textColorInt = R.color.rma_black_33
                             }.lparams(wrapContent, wrapContent) {
@@ -300,7 +342,67 @@ class AddCustomerDataActivity : BaseActivity<CustomerDataViewModel>() {
                                     isEnabled = false
                                 }
                                 enterprise_name = this
-                                hint = resources.getString(R.string.please_input_enterprise_name)
+                                customerType.bindOptional(context) {
+                                    if (it?.id == "1") {
+                                        hint = "请输入姓名"
+                                    } else {
+                                        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 {
+                            customerType.bindOptional(context) {
+                                if (it?.id == "1") {
+                                    visibility = View.GONE
+                                } else {
+                                    visibility = View.VISIBLE
+                                }
+                            }
+                            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
+                                }
+                                enterprise_referred = this
+                                hint = "请输入企业简称"
                                 background = null
                                 inputType = EditorInfo.TYPE_CLASS_TEXT
                                 hintColorStr = "#CCCCCC"
@@ -316,11 +418,19 @@ class AddCustomerDataActivity : BaseActivity<CustomerDataViewModel>() {
 
                         // 证件类型
                         linearLayout {
+                            customerType.bindOptional(context){
+                                if (it?.id == "1"){
+                                    visibility = View.GONE
+                                }else{
+                                    visibility = View.VISIBLE
+                                }
+                            }
                             onThrottleFirstClick {
                                 if (status != "1" && status != "2") {
                                     return@onThrottleFirstClick
                                 }
-                                val selectDataList = SelectIUtils.getCustomerDocumentType("certificatetype")
+                                val selectDataList =
+                                    SelectIUtils.getCustomerDocumentType("certificatetype")
                                 creatBottomSheetDialog("请选择证件类型", selectDataList) {
                                     cardType.postValue(this)
                                 }
@@ -366,7 +476,13 @@ class AddCustomerDataActivity : BaseActivity<CustomerDataViewModel>() {
                             gravity = Gravity.CENTER_VERTICAL
 
                             textView {
-                                textResource = R.string.card_number
+                                customerType.bindOptional(context) {
+                                    if (it?.id == "1") {
+                                        text = "身份证号码"
+                                    } else {
+                                        text = "证件号码"
+                                    }
+                                }
                                 textSizeAuto = 31
                                 textColorInt = R.color.rma_black_33
                             }.lparams(wrapContent, wrapContent) {
@@ -381,7 +497,97 @@ class AddCustomerDataActivity : BaseActivity<CustomerDataViewModel>() {
                                     isEnabled = false
                                 }
                                 card_umber = this
-                                hint = resources.getString(R.string.please_input_card_number)
+                                customerType.bindOptional(context) {
+                                    if (it?.id == "1") {
+                                        hint = "请输入身份证号码"
+                                    } else {
+                                        hint =
+                                            resources.getString(R.string.please_input_card_number)
+                                    }
+                                }
+
+                                background = null
+                                inputType = EditorInfo.TYPE_CLASS_TEXT
+//                    setDecimalInputType()
+                                hintColorStr = "#CCCCCC"
+                                textSizeAuto = 31
+                                textColorStr = "#333333"
+                            }.lparams(autoSize(500), wrapContent) {
+                                marginStart = autoSize(86)
+                            }
+
+                        }.lparams(matchParent, autoSize(136))
+
+                        viewItemUI()
+
+                        // 法定代表人
+                        linearLayout {
+                            gravity = Gravity.CENTER_VERTICAL
+                            customerType.bindOptional(context) {
+                                if (it?.id == "1") {
+                                    visibility = View.GONE
+                                } else {
+                                    visibility = View.VISIBLE
+                                }
+                            }
+                            textView {
+                                text = "法定代表人"
+                                textSizeAuto = 31
+                                textColorInt = R.color.rma_black_33
+                            }.lparams(wrapContent, wrapContent) {
+                                marginStart = autoSize(59)
+                            }
+
+                            editText {
+                                if (status != "1") {
+                                    setText(data.cardnum?.isBlankString())
+                                }
+                                if (status != "1" && status != "2") {
+                                    isEnabled = false
+                                }
+                                legal_representative = this
+                                hint = "请输入法定代表人"
+                                background = null
+                                inputType = EditorInfo.TYPE_CLASS_TEXT
+//                    setDecimalInputType()
+                                hintColorStr = "#CCCCCC"
+                                textSizeAuto = 31
+                                textColorStr = "#333333"
+                            }.lparams(autoSize(500), wrapContent) {
+                                marginStart = autoSize(86)
+                            }
+
+                        }.lparams(matchParent, autoSize(136))
+
+                        viewItemUI()
+
+                        // 纳税人识别号
+                        linearLayout {
+                            gravity = Gravity.CENTER_VERTICAL
+                            customerType.bindOptional(context) {
+                                if (it?.id == "1") {
+                                    visibility = View.GONE
+                                } else {
+                                    visibility = View.VISIBLE
+                                }
+                            }
+                            textView {
+                                text = "纳税人识别号"
+                                textSizeAuto = 31
+                                textColorInt = R.color.rma_black_33
+                            }.lparams(wrapContent, wrapContent) {
+                                marginStart = autoSize(59)
+                            }
+
+                            editText {
+                                if (status != "1") {
+                                    setText(data.cardnum?.isBlankString())
+                                }
+                                if (status != "1" && status != "2") {
+                                    isEnabled = false
+                                }
+                                identification_number = this
+                                hint = "请输入纳税人识别号"
                                 background = null
                                 inputType = EditorInfo.TYPE_CLASS_TEXT
 //                    setDecimalInputType()
@@ -400,6 +606,14 @@ class AddCustomerDataActivity : BaseActivity<CustomerDataViewModel>() {
                         linearLayout {
                             gravity = Gravity.CENTER_VERTICAL
 
+                            customerType.bindOptional(context) {
+                                if (it?.id == "1") {
+                                    visibility = View.GONE
+                                } else {
+                                    visibility = View.VISIBLE
+                                }
+                            }
+
                             textView {
                                 textResource = R.string.business_license
                                 textSizeAuto = 31
@@ -458,9 +672,6 @@ class AddCustomerDataActivity : BaseActivity<CustomerDataViewModel>() {
                                                     ) {
                                                         /*[{"originalName":"tem.jpg","fileName":"201907161657044712.jpg","fileSize":"0KB","fileType":"image/jpeg","filePath":"./uploadFile/20190716/201907161657044712.jpg","submitName":null}]*/
                                                         try {
-//                                                        if (!isFinishing) {
-//                                                            viewModel.loadingDialogStatus.value
-//                                                        }
                                                             viewModel.loadingDialogStatus.value =
                                                                 TaskUiModel.success()
                                                             val jsonArray = JSONArray(response)
@@ -479,13 +690,265 @@ class AddCustomerDataActivity : BaseActivity<CustomerDataViewModel>() {
                                                         } catch (e: JSONException) {
                                                             e.printStackTrace()
                                                         }
+                                                    }
+                                                },
+                                                10000.0,
+                                                SPUtils.getInstance().getString(Constant.uploadUrl)
+                                            )
+                                        }
+                                    }
+                                }
+                                gravity = Gravity.CENTER
+                                textResource = R.string.update
+                                textColorInt = R.color.rma_item_click_color
+                                backgroundResource = R.drawable.rma_item_text_bg
+                                textSizeAuto = 31
+                            }.lparams(autoSize(134), autoSize(53)) {
+                                marginStart = autoSize(86)
+                            }
+
+                            // 查看附件
+                            textView {
+                                onThrottleFirstClick {
+                                    val path = imageString.value.guard {
+                                        return@onThrottleFirstClick
+                                    }
+                                    PhotoUtils().showImageViewer(
+                                        this@AddCustomerDataActivity,
+                                        1,
+                                        arrayListOf(path)
+                                    )
+                                }
+                                textResource = R.string.check_the_attachment
+                                textColorInt = R.color.rma_yellow_text_color
+                                textSizeAuto = 31
+                            }.lparams(wrapContent, wrapContent) {
+                                marginStart = autoSize(86)
+                            }
+                        }.lparams(matchParent, autoSize(136))
+
+                        viewItemUI()
+
+                        // 身份证正面照
+                        linearLayout {
+                            gravity = Gravity.CENTER_VERTICAL
+
+                            customerType.bindOptional(context) {
+                                if (it?.id == "2") {
+                                    visibility = View.GONE
+                                } else {
+                                    visibility = View.VISIBLE
+                                }
+                            }
+
+                            textView {
+                                text = "身份证正面照"
+                                textSizeAuto = 31
+                                textColorInt = R.color.rma_black_33
+                            }.lparams(wrapContent, wrapContent) {
+                                marginStart = autoSize(59)
+                            }
+
+                            textView {
+                                if (status != "1" || status == "2") {
+                                    if (data.attachment1.isNullOrEmpty()) {
+                                        visibility = View.VISIBLE
+                                    } else {
+                                        visibility = View.GONE
+                                    }
+                                } else {
+                                    visibility = View.VISIBLE
+                                }
+                                frontIdCardimageString.bindOptional(context) {
+                                    visibility = if (it.isNullOrEmpty()) {
+                                        View.VISIBLE
+                                    } else {
+                                        View.GONE
+                                    }
+                                }
+                                visibility = View.VISIBLE
+                                onThrottleFirstClick {
+                                    //审核,停用,复用,详情不需要点击
+                                    if (status != "1" && status != "2") {
+                                        return@onThrottleFirstClick
+                                    }
+                                    PhotoUtils().showPicker(this@AddCustomerDataActivity) {
+                                        it.firstOrNull()?.let {
+                                            viewModel.loadingDialogStatus.value =
+                                                TaskUiModel.inFlight()
+                                            UpLoadUtils(this@AddCustomerDataActivity).uploadPicture(
+                                                File(it),
+                                                object : StringCallback() {
+                                                    override fun onError(
+                                                        call: Call,
+                                                        e: Exception,
+                                                        id: Int
+                                                    ) {
+                                                        LogUtils.e("hidahdashdsdasd", e.message)
+                                                        viewModel.loadingDialogStatus.value =
+                                                            TaskUiModel.failed(
+                                                                InteractiveException(
+                                                                    errorMessage = e.message ?: ""
+                                                                )
+                                                            )
+                                                    }
+
+                                                    override fun onResponse(
+                                                        response: String,
+                                                        id: Int
+                                                    ) {
+                                                        /*[{"originalName":"tem.jpg","fileName":"201907161657044712.jpg","fileSize":"0KB","fileType":"image/jpeg","filePath":"./uploadFile/20190716/201907161657044712.jpg","submitName":null}]*/
+                                                        try {
+                                                            viewModel.loadingDialogStatus.value =
+                                                                TaskUiModel.success()
+                                                            val jsonArray = JSONArray(response)
+                                                            LogUtils.eTag(
+                                                                "图片",
+                                                                JSON.toJSONString(jsonArray)
+                                                            )
+                                                            for (i in 0 until jsonArray.length()) {
+                                                                frontIdCarduploadFile =
+                                                                    (jsonArray.get(i) as JSONObject).getString(
+                                                                        "filePath"
+                                                                    )
+                                                                frontIdCardimageString.value = it
 
+                                                            }
+                                                        } catch (e: JSONException) {
+                                                            e.printStackTrace()
+                                                        }
                                                     }
                                                 },
                                                 10000.0,
                                                 SPUtils.getInstance().getString(Constant.uploadUrl)
                                             )
+                                        }
+                                    }
+                                }
+                                gravity = Gravity.CENTER
+                                textResource = R.string.update
+                                textColorInt = R.color.rma_item_click_color
+                                backgroundResource = R.drawable.rma_item_text_bg
+                                textSizeAuto = 31
+                            }.lparams(autoSize(134), autoSize(53)) {
+                                marginStart = autoSize(86)
+                            }
 
+                            // 查看附件
+                            textView {
+                                onThrottleFirstClick {
+                                    val path = frontIdCardimageString.value.guard {
+                                        return@onThrottleFirstClick
+                                    }
+                                    PhotoUtils().showImageViewer(
+                                        this@AddCustomerDataActivity,
+                                        1,
+                                        arrayListOf(path)
+                                    )
+                                }
+                                textResource = R.string.check_the_attachment
+                                textColorInt = R.color.rma_yellow_text_color
+                                textSizeAuto = 31
+                            }.lparams(wrapContent, wrapContent) {
+                                marginStart = autoSize(86)
+                            }
+                        }.lparams(matchParent, autoSize(136))
+
+                        viewItemUI()
+
+                        // 身份证反面照
+                        linearLayout {
+                            gravity = Gravity.CENTER_VERTICAL
+
+                            customerType.bindOptional(context) {
+                                if (it?.id == "2") {
+                                    visibility = View.GONE
+                                } else {
+                                    visibility = View.VISIBLE
+                                }
+                            }
+
+                            textView {
+                                text = "身份证反面照"
+                                textSizeAuto = 31
+                                textColorInt = R.color.rma_black_33
+                            }.lparams(wrapContent, wrapContent) {
+                                marginStart = autoSize(59)
+                            }
+
+                            textView {
+                                if (status != "1" || status == "2") {
+                                    if (data.attachment1.isNullOrEmpty()) {
+                                        visibility = View.VISIBLE
+                                    } else {
+                                        visibility = View.GONE
+                                    }
+                                } else {
+                                    visibility = View.VISIBLE
+                                }
+                                backIdCardimageString.bindOptional(context) {
+                                    visibility = if (it.isNullOrEmpty()) {
+                                        View.VISIBLE
+                                    } else {
+                                        View.GONE
+                                    }
+                                }
+                                visibility = View.VISIBLE
+                                onThrottleFirstClick {
+                                    //审核,停用,复用,详情不需要点击
+                                    if (status != "1" && status != "2") {
+                                        return@onThrottleFirstClick
+                                    }
+                                    PhotoUtils().showPicker(this@AddCustomerDataActivity) {
+                                        it.firstOrNull()?.let {
+                                            viewModel.loadingDialogStatus.value =
+                                                TaskUiModel.inFlight()
+                                            UpLoadUtils(this@AddCustomerDataActivity).uploadPicture(
+                                                File(it),
+                                                object : StringCallback() {
+                                                    override fun onError(
+                                                        call: Call,
+                                                        e: Exception,
+                                                        id: Int
+                                                    ) {
+                                                        LogUtils.e("hidahdashdsdasd", e.message)
+                                                        viewModel.loadingDialogStatus.value =
+                                                            TaskUiModel.failed(
+                                                                InteractiveException(
+                                                                    errorMessage = e.message ?: ""
+                                                                )
+                                                            )
+                                                    }
+
+                                                    override fun onResponse(
+                                                        response: String,
+                                                        id: Int
+                                                    ) {
+                                                        /*[{"originalName":"tem.jpg","fileName":"201907161657044712.jpg","fileSize":"0KB","fileType":"image/jpeg","filePath":"./uploadFile/20190716/201907161657044712.jpg","submitName":null}]*/
+                                                        try {
+                                                            viewModel.loadingDialogStatus.value =
+                                                                TaskUiModel.success()
+                                                            val jsonArray = JSONArray(response)
+                                                            LogUtils.eTag(
+                                                                "图片",
+                                                                JSON.toJSONString(jsonArray)
+                                                            )
+                                                            for (i in 0 until jsonArray.length()) {
+                                                                backIdCarduploadFile =
+                                                                    (jsonArray.get(i) as JSONObject).getString(
+                                                                        "filePath"
+                                                                    )
+                                                                backIdCardimageString.value = it
+
+                                                            }
+                                                        } catch (e: JSONException) {
+                                                            e.printStackTrace()
+                                                        }
+                                                    }
+                                                },
+                                                10000.0,
+                                                SPUtils.getInstance().getString(Constant.uploadUrl)
+                                            )
                                         }
                                     }
                                 }
@@ -501,7 +964,7 @@ class AddCustomerDataActivity : BaseActivity<CustomerDataViewModel>() {
                             // 查看附件
                             textView {
                                 onThrottleFirstClick {
-                                    val path = imageString.value.guard {
+                                    val path = backIdCardimageString.value.guard {
                                         return@onThrottleFirstClick
                                     }
                                     PhotoUtils().showImageViewer(
@@ -522,10 +985,17 @@ class AddCustomerDataActivity : BaseActivity<CustomerDataViewModel>() {
 
                         // 手机号码
                         linearLayout {
+                            customerType.bindOptional(context) {
+                                if (it?.id == "1") {
+                                    visibility = View.GONE
+                                } else {
+                                    visibility = View.VISIBLE
+                                }
+                            }
                             gravity = Gravity.CENTER_VERTICAL
 
                             textView {
-                                textResource = R.string.phone_number
+                                text = "联系人"
                                 textSizeAuto = 31
                                 textColorInt = R.color.rma_black_33
                             }.lparams(wrapContent, wrapContent) {
@@ -539,8 +1009,55 @@ class AddCustomerDataActivity : BaseActivity<CustomerDataViewModel>() {
                                 if (status != "1" && status != "2") {
                                     isEnabled = false
                                 }
+                                the_contact = this
+                                hint = "请输入联系人"
+                                background = null
+                                inputType = EditorInfo.TYPE_CLASS_PHONE
+                                hintColorStr = "#CCCCCC"
+                                textSizeAuto = 31
+                                textColorStr = "#333333"
+                            }.lparams(autoSize(500), wrapContent) {
+                                marginStart = autoSize(86)
+                            }
+
+                        }.lparams(matchParent, autoSize(136))
+
+                        viewItemUI()
+
+                        // 手机号码
+                        linearLayout {
+
+                            gravity = Gravity.CENTER_VERTICAL
+
+                            textView {
+                                customerType.bindOptional(context) {
+                                    if (it?.id == "1") {
+                                        text = "手机号码"
+                                    } else {
+                                        text = "联系人手机号码"
+                                    }
+                                }
+                                textSizeAuto = 31
+                                textColorInt = R.color.rma_black_33
+                            }.lparams(wrapContent, wrapContent) {
+                                marginStart = autoSize(59)
+                            }
+
+                            editText {
+                                if (status != "1") {
+                                    setText(data.mobile?.isBlankString())
+                                }
+                                if (status != "1" && status != "2") {
+                                    isEnabled = false
+                                }
+                                customerType.bindOptional(context) {
+                                    if (it?.id == "1") {
+                                        hint = "请输入手机号码"
+                                    } else {
+                                        hint = "请输入联系人手机号码"
+                                    }
+                                }
                                 phone_number = this
-                                hint = resources.getString(R.string.please_input_phone_number)
                                 background = null
                                 inputType = EditorInfo.TYPE_CLASS_PHONE
                                 hintColorStr = "#CCCCCC"
@@ -556,10 +1073,17 @@ class AddCustomerDataActivity : BaseActivity<CustomerDataViewModel>() {
 
                         // 联系电话
                         linearLayout {
+                            customerType.bindOptional(context) {
+                                if (it?.id == "1") {
+                                    visibility = View.GONE
+                                } else {
+                                    visibility = View.VISIBLE
+                                }
+                            }
                             gravity = Gravity.CENTER_VERTICAL
 
                             textView {
-                                textResource = R.string.contact_phone_number
+                                text = "联系电话"
                                 textSizeAuto = 31
                                 textColorInt = R.color.rma_black_33
                             }.lparams(wrapContent, wrapContent) {
@@ -574,8 +1098,7 @@ class AddCustomerDataActivity : BaseActivity<CustomerDataViewModel>() {
                                     isEnabled = false
                                 }
                                 contact_number = this
-                                hint =
-                                    resources.getString(R.string.please_input_contact_phone_number)
+                                hint = "请输入联系电话"
                                 background = null
                                 inputType = EditorInfo.TYPE_CLASS_PHONE
 //                    setDecimalInputType()
@@ -621,7 +1144,10 @@ class AddCustomerDataActivity : BaseActivity<CustomerDataViewModel>() {
                                     if (it?.get(0)?.addressName.isNullOrEmpty()) {
                                         val builder = StringBuilder()
                                         it?.forEach { data ->
-                                            builder.append(DataBase.getInstance().addressDao().getAddressData(data.autoid).divisionname)
+                                            builder.append(
+                                                DataBase.getInstance().addressDao()
+                                                    .getAddressData(data.autoid).divisionname
+                                            )
                                             builder.append(" ")
                                         }
                                         text = builder
@@ -817,7 +1343,7 @@ class AddCustomerDataActivity : BaseActivity<CustomerDataViewModel>() {
                         onThrottleFirstClick {
                             if (status == "5") {//停用
                                 viewModel.updateUserAccountStatus(
-                                    userID = data.userid ?: 0,
+                                    userID = data.userid?.toInt() ?: 0,
                                     accountStatus = 6
                                 ) { isCompleted, err ->
                                     if (!isCompleted) {
@@ -835,7 +1361,7 @@ class AddCustomerDataActivity : BaseActivity<CustomerDataViewModel>() {
                                 }
                             } else {//恢复
                                 viewModel.updateUserAccountStatus(
-                                    userID = data.userid ?: 0,
+                                    userID = data.userid?.toInt() ?: 0,
                                     accountStatus = 4
                                 ) { isCompleted, err ->
                                     if (!isCompleted) {
@@ -913,13 +1439,27 @@ class AddCustomerDataActivity : BaseActivity<CustomerDataViewModel>() {
      * @return Boolean 检验是否成功
      */
     private fun checkInput(): Boolean {
-        if (customerType.value?.id?.isNullOrEmpty() == true) {
-            ToastUtils.showLong("请选择客户类型")
-            return false
-        }
-        if (enterprise_name.text.isNullOrEmpty()) {
-            ToastUtils.showLong("请输入企业名称")
-            return false
+
+        if (customerType.value?.id == "1"){//判断个人的必填项
+            if (enterprise_name.text.isNullOrEmpty()) {
+                ToastUtils.showLong("请输入姓名")
+                return false
+            }
+
+            if (phone_number.text.toString().isNullOrEmpty()){
+                ToastUtils.showLong("请输入手机号码")
+                return false
+            }
+        }else{//判断企业的必填项
+            if (enterprise_name.text.isNullOrEmpty()) {
+                ToastUtils.showLong("请输入企业名称")
+                return false
+            }
+
+            if (enterprise_referred.text.isNullOrEmpty()){
+                ToastUtils.showLong("请输入企业简称")
+                return false
+            }
         }
 
         return true
@@ -939,13 +1479,12 @@ class AddCustomerDataActivity : BaseActivity<CustomerDataViewModel>() {
     private fun addUserInfo(isDraft: Boolean) {
         // 客户资料参数
         val params = mutableMapOf<String, Any>()
-        if (data.userid == 0) {
+        if (data.userid?.toInt() == 0) {
             params["userid"] = 1
         } else {
             params["userid"] = data.userid ?: 1
         }
 
-        // FIXME: - 客户类型暂时写死为"企业"
         params["userinfotype"] = customerType.value?.id?.toInt() ?: 0
         // 企业名称
         params["customername"] = enterprise_name.text.toString()
@@ -967,10 +1506,39 @@ class AddCustomerDataActivity : BaseActivity<CustomerDataViewModel>() {
         if (!card_umber.text.isNullOrEmpty()) {
             params["cardnum"] = card_umber.text.toString()
         }
-        // 营业执照
-        if (!uploadFile.isNullOrEmpty()) {
-            params["cardfrontphotourl"] = uploadFile
+
+        if (customerType.value?.id == "1"){//个人
+            // 身份证正面照
+            if (!frontIdCarduploadFile.isNullOrEmpty()) {
+                params["cardfrontphotourl"] = frontIdCarduploadFile
+            }
+            //身份证背面照
+            if (!backIdCarduploadFile.isNullOrEmpty()) {
+                params["cardbackphotourl"] = backIdCarduploadFile
+            }
+        }else{//企业
+            // 营业执照
+            if (!uploadFile.isNullOrEmpty()) {
+                params["cardfrontphotourl"] = uploadFile
+            }
+            //企业简称
+            if (enterprise_referred.text.toString().isNotEmpty()){
+                params["nickname"] = enterprise_referred.text.toString()
+            }
+            //法定代表人
+            if (legal_representative.text.toString().isNotEmpty()){
+                params["legalpersonname"] = legal_representative.text.toString()
+            }
+            //纳税人识别号
+            if (identification_number.text.toString().isNotEmpty()){
+                params["taxpayernum"] = identification_number.text.toString()
+            }
+            //联系人
+            if (the_contact.text.toString().isNotEmpty()){
+                params["contactname"] = the_contact.text.toString()
+            }
         }
+
         // 手机号码
         if (!phone_number.text.isNullOrEmpty()) {
             params["mobilephone"] = phone_number.text.toString()

+ 8 - 3
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/customerdata/CustomerDataActivity.kt

@@ -23,6 +23,8 @@ import com.qmuiteam.qmui.widget.tab.QMUITabIndicator
 import com.qmuiteam.qmui.widget.tab.QMUITabSegment
 
 import mtp.polymer.com.autowidget.adapter.BaseAdapter
+import mtp.polymer.com.autowidget.dialog.createLoadingDialog
+import mtp.polymer.com.autowidget.utils.bindTaskStatus
 import org.jetbrains.anko.*
 import org.jetbrains.anko.support.v4.viewPager
 
@@ -107,10 +109,13 @@ class CustomerDataActivity : BaseActivity<CustomerDataViewModel>() {
         }
     }
 
+    private val dialog by lazy { createLoadingDialog(hintStr = "正在提交") }
+
     override fun onCreate(savedInstanceState: Bundle?) {
         super.onCreate(savedInstanceState)
         verticalLayout {
             // 标题栏
+            dialog.bindTaskStatus(context = context, taskUiModelData = viewModel.loadingDialogStatus)
             topBar {
                 // 返回
                 commonLeftButton()
@@ -233,7 +238,7 @@ class UnSubmitUI(
                 }
 
                 textView {
-                    textResource = R.string.user_info_phone
+                    text = "手机号码"
                     textColorInt = R.color.hint_text_color
                     textSizeAuto = 24
                 }.lparams(wrapContent, wrapContent){
@@ -435,7 +440,7 @@ class NormalUI(
                 }
 
                 textView {
-                    textResource = R.string.user_info_phone
+                    text = "手机号码"
                     textColorInt = R.color.hint_text_color
                     textSizeAuto = 24
                 }.lparams(wrapContent, wrapContent){
@@ -534,7 +539,7 @@ class DisableUI(
                 }
 
                 textView {
-                    textResource = R.string.user_info_phone
+                    text = "手机号码"
                     textColorInt = R.color.hint_text_color
                     textSizeAuto = 24
                 }.lparams(wrapContent, wrapContent){

+ 33 - 1
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/customerdata/CustomerDataViewHolder.kt

@@ -10,10 +10,12 @@ import cn.muchinfo.rma.R
 import cn.muchinfo.rma.global.data.UserInfoData
 import cn.muchinfo.rma.global.isBlankString
 import cn.muchinfo.rma.lifecycle.bindOptional
+import cn.muchinfo.rma.netManage.base.InteractiveException
 import cn.muchinfo.rma.view.autoWidget.*
 import cn.muchinfo.rma.view.base.home.contract.emptyView
 import com.blankj.utilcode.util.ActivityUtils
 import mtp.polymer.com.autowidget.adapter.BaseViewHolder
+import mtp.polymer.com.autowidget.utils.TaskUiModel
 import org.jetbrains.anko.*
 
 /**
@@ -128,6 +130,36 @@ class CustomerDataViewHolder(
                 gravity = Gravity.CENTER_VERTICAL
 
                 emptyView()
+
+                textView {
+                    onThrottleFirstClick {
+                        viewModel.deleteUserInfoApply(data.value?.userid.toString()){isCompleted: Boolean, err: Error? ->
+                            if (isCompleted){
+                                viewModel.loadingDialogStatus.postValue(TaskUiModel.success("删除成功"))
+                                viewModel.queryUserInfo("1")
+                            }else{
+                                viewModel.loadingDialogStatus.postValue(TaskUiModel.failed(
+                                    InteractiveException(errorMessage = "删除失败")
+                                ))
+                            }
+                        }
+                    }
+                    data.bindOptional(context){
+                        if (type == "1"){
+                            visibility = View.VISIBLE
+                        }else{
+                            visibility = View.GONE
+                        }
+                    }
+                    backgroundResource = R.drawable.rma_item_click_bg
+                    gravity = Gravity.CENTER
+                    text = "删除"
+                    textColorInt = R.color.rma_item_click_color
+                    textSizeAuto = 26
+                }.lparams(autoSize(120), autoSize(48)) {
+                    marginEnd = autoSize(24)
+                }
+
                 textView {
                     onThrottleFirstClick {
                         val intent = Intent()
@@ -218,7 +250,7 @@ class CustomerDataViewHolder(
                         intent.setClass(context,AddCustomerDataActivity::class.java)
                         ActivityUtils.startActivity(intent)
                     }
-                    if (type == "1"){
+                    if (type == "1" || type == "3"){
                         visibility = View.VISIBLE
                     }else{
                         visibility = View.GONE

+ 14 - 1
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/customerdata/CustomerDataViewModel.kt

@@ -113,7 +113,7 @@ class CustomerDataViewModel : BaseViewModel() {
      */
     fun queryUserInfo(type: String) {
 //        unSubmitList.value = arrayListOf(UserInfoData(address = "1"),UserInfoData(address = "2"),UserInfoData(address = "3"))
-        loadingDialogStatus.value = TaskUiModel.inFlight()
+//        loadingDialogStatus.value = TaskUiModel.inFlight()
         val params = mutableMapOf<String, String>().apply {
             put("MemberUserID", GlobalDataCollection.instance?.loginRsp?.memberUserID.toString())
             put("queryType", type)
@@ -201,6 +201,19 @@ class CustomerDataViewModel : BaseViewModel() {
     }
 
     /**
+     * 删除客户申请
+     * @param userid String
+     * @param callback Function2<[@kotlin.ParameterName] Boolean, [@kotlin.ParameterName] Error?, Unit>
+     */
+    fun deleteUserInfoApply(userid : String,callback: (isCompleted: Boolean, err: Error?) -> Unit){
+        loadingDialogStatus.postValue(TaskUiModel.inFlight())
+        val params = mutableMapOf<String, String>().apply {
+            put("userID", userid)
+        }
+        MyApplication.getInstance()?.customerManage?.deleteUserInfoApply(params = params,callback = callback)
+    }
+
+    /**
      * 客户信息审核请求
      * @param auditflag Long 1审核通过2审核拒绝
      * @param userid Long 客户userid

+ 24 - 9
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/spotmarket/AddSpotMarketPriceActivity.kt

@@ -60,9 +60,14 @@ class AddSpotMarketPriceActivity : BaseActivity<SpotMarketPriceViewModel>(){
     private val dialog by lazy { createLoadingDialog(hintStr = "正在提交") }
 
     fun initData(){
+        if (type == "2"){
+            selectDeliveryGoods.postValue(SelectData(id = data.deliverygoodsid ?: "",value = data?.deliverygoodsname ?: ""))
+            selectCategory.postValue(SelectData(id = data.wrstandardid ?: "",value = data.wrstandardname ?: ""))
+            selectBrand.postValue(SelectData(id = data.spotgoodsbrandid ?: "",value = data.brandname ?: ""))
+        }
         viewModel.queryDeliveryGoods()
-        viewModel.queryGoodsWrstandard()
-        viewModel.queryGoodsbrand()
+//        viewModel.queryGoodsWrstandard()
+//        viewModel.queryGoodsbrand()
     }
 
     override fun onCreate(savedInstanceState: Bundle?) {
@@ -87,9 +92,13 @@ class AddSpotMarketPriceActivity : BaseActivity<SpotMarketPriceViewModel>(){
                 background = resources.getDrawable(R.color.white)
                 gravity = Gravity.CENTER_VERTICAL
                 onThrottleFirstClick {
+                    if (type == "2"){
+                        return@onThrottleFirstClick
+                    }
                     val selectDataList = viewModel.getDeliverySelectData()
                     creatBottomSheetDialog("请选择现货品种", selectDataList) {
                         selectDeliveryGoods.postValue(this)
+                        viewModel.queryDeliveryGoodsDetails(this.id)
                     }
                 }
                 textView {
@@ -128,6 +137,9 @@ class AddSpotMarketPriceActivity : BaseActivity<SpotMarketPriceViewModel>(){
                 emptyView()
 
                 imageView {
+                    if (type == "2"){
+                        visibility = View.GONE
+                    }
                     imageResource = R.mipmap.rma_more
                 }.lparams(autoSize(36), autoSize(36)) {
                     marginEnd = autoSize(25)
@@ -333,16 +345,19 @@ class AddSpotMarketPriceActivity : BaseActivity<SpotMarketPriceViewModel>(){
      * 提交数据前的校验
      */
     fun check() : Boolean{
-        if (selectDeliveryGoods.value?.id.isNullOrEmpty()){
-            ToastUtils.showLong("请选择现货品种")
-            return false
-        }
-        if (selectBrand.value?.id?.isNotEmpty() == true){//如果选择了品牌必定要选择品类
-            if (selectCategory.value?.id.isNullOrEmpty()){
-                ToastUtils.showLong("请选择品类")
+        if (type == "1"){
+            if (selectDeliveryGoods.value?.id.isNullOrEmpty()){
+                ToastUtils.showLong("请选择现货品种")
                 return false
             }
+            if (selectBrand.value?.id?.isNotEmpty() == true){//如果选择了品牌必定要选择品类
+                if (selectCategory.value?.id.isNullOrEmpty()){
+                    ToastUtils.showLong("请选择品类")
+                    return false
+                }
+            }
         }
+
         if (spot_price.text.toString().isNullOrEmpty()){
             ToastUtils.showLong("请输入")
             return false

+ 15 - 3
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/spotmarket/SpotMarketPriceViewHolder.kt

@@ -14,6 +14,7 @@ import cn.muchinfo.rma.view.autoWidget.textSizeAuto
 import cn.muchinfo.rma.view.base.home.contract.emptyView
 import com.blankj.utilcode.util.ActivityUtils
 import mtp.polymer.com.autowidget.adapter.BaseViewHolder
+import mtp.polymer.com.autowidget.dialog.createWarningDialog
 import org.jetbrains.anko.*
 
 /**
@@ -101,9 +102,20 @@ class SpotMarketPriceViewHolder(private val activity : AppCompatActivity,private
 
                 textView {
                     onThrottleFirstClick {
-                        viewModel.ErmcpSpotGoodsPriceReq(DeliveryGoodsID = data.value?.deliverygoodsid?.toLong() ?: 0,OperateType = 3,WRStandardID = data.value?.wrstandardid?.toLong() ?: 0,SpotGoodsBrandID = data.value?.spotgoodsbrandid?.toLong() ?: 0){
-                            viewModel.querySpotMarketPriceList()
-                        }
+                        activity.createWarningDialog {
+                            setTitle("温馨提示")
+                            setMessage("确定删除此现货市价吗?")
+                            addAction("取消") { dialog, _ ->
+                                dialog.dismiss()
+                            }
+                            addAction("确定") { dialog, _ ->
+                                dialog.dismiss()
+                                viewModel.ErmcpSpotGoodsPriceReq(DeliveryGoodsID = data.value?.deliverygoodsid?.toLong() ?: 0,OperateType = 3/*,WRStandardID = data.value?.wrstandardid?.toLong() ?: 0,SpotGoodsBrandID = data.value?.spotgoodsbrandid?.toLong() ?: 0*/){
+                                    viewModel.querySpotMarketPriceList()
+                                }
+                            }
+                        }.show()
+
                     }
                     backgroundResource = R.drawable.rma_item_click_bg
                     gravity = Gravity.CENTER

+ 29 - 10
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/spotmarket/SpotMarketPriceViewModel.kt

@@ -2,10 +2,7 @@ package cn.muchinfo.rma.view.base.home.spotmarket
 
 import androidx.lifecycle.MutableLiveData
 import cn.muchinfo.rma.global.GlobalDataCollection
-import cn.muchinfo.rma.global.data.DeliveryGoodsData
-import cn.muchinfo.rma.global.data.Ermcp3GoodsbrandData
-import cn.muchinfo.rma.global.data.GoodsWrstandardData
-import cn.muchinfo.rma.global.data.SpotGoodsPriceData
+import cn.muchinfo.rma.global.data.*
 import cn.muchinfo.rma.netManage.base.InteractiveException
 import cn.muchinfo.rma.view.MyApplication
 import cn.muchinfo.rma.view.autoWidget.remove
@@ -42,6 +39,12 @@ class SpotMarketPriceViewModel : BaseViewModel(){
      */
     val deliveryGoodsList : MutableLiveData<List<DeliveryGoodsData>> = MutableLiveData()
 
+
+    /**
+     * 现货商品列表
+     */
+    val deliveryGoodsDetailsData : MutableLiveData<DeliveryGoodsDetailData> = MutableLiveData()
+
     /**
      * 商品品类列表
      */
@@ -62,8 +65,7 @@ class SpotMarketPriceViewModel : BaseViewModel(){
 
         MyApplication.getInstance()?.spotManager?.querySpotGoodsPrice(params = params) { isSuccess, respData, error ->
             if (isSuccess) {
-//                spotMarketPriceDataList.postValue(respData?.remove { it.isvalid == "0" })
-                spotMarketPriceDataList.postValue(respData)
+                spotMarketPriceDataList.postValue(respData?.remove { it.isvalid == "0" })
             } else {
                 ToastUtils.showLong("数据请求失败")
             }
@@ -168,6 +170,23 @@ class SpotMarketPriceViewModel : BaseViewModel(){
     }
 
     /**
+     * /Ermcp3/QueryDeliveryGoods 查询现货商品
+     */
+    fun queryDeliveryGoodsDetails(deliverygoodsid : String){
+        val params = mutableMapOf<String, String>().apply {
+            put("areauserid", GlobalDataCollection.instance?.loginRsp?.userID.toString())
+            put("deliverygoodsid",deliverygoodsid)
+        }
+        MyApplication.getInstance()?.commodityManager?.queryDeliveryGoodsDetail(params = params) { isSuccess, respData, error ->
+            if (isSuccess) {
+                deliveryGoodsDetailsData.postValue(respData?.get(0))
+            } else {
+                ToastUtils.showLong("数据请求失败")
+            }
+        }
+    }
+
+    /**
      * /Ermcp3/QueryGoodsWrstandard查询商品品类
      */
     fun queryGoodsWrstandard(){
@@ -217,10 +236,10 @@ class SpotMarketPriceViewModel : BaseViewModel(){
      * @return List<SelectData>
      */
     fun getGoodsWrstandardSelectList() : List<SelectData>{
-        val oldList = goodsWrstandardDataList.value
+        val oldList = deliveryGoodsDetailsData.value?.gmlist
         val resultDataList = arrayListOf<SelectData>()
         oldList?.forEach {
-            resultDataList.add(SelectData(id = it?.wrstandardid ?: "",value = it.wrstandardname ?: ""))
+            resultDataList.add(SelectData(id = it.wrstandardid ?: "",value = it.wrstandardname ?: ""))
         }
         return resultDataList
     }
@@ -230,10 +249,10 @@ class SpotMarketPriceViewModel : BaseViewModel(){
      * @return List<SelectData>
      */
     fun getGoodsBrandSelectList() : List<SelectData>{
-        val oldList = ermcp3GoodsbrandDataList.value
+        val oldList = deliveryGoodsDetailsData.value?.gblist
         val resultDataList = arrayListOf<SelectData>()
         oldList?.forEach {
-            resultDataList.add(SelectData(id = it?.brandid ?: "",value = it.brandname ?: ""))
+            resultDataList.add(SelectData(id = it.brandid ?: "",value = it.brandname ?: ""))
         }
         return resultDataList
     }

+ 3 - 6
RMA/app/src/main/java/cn/muchinfo/rma/view/base/login/LoginActivity.kt

@@ -139,7 +139,6 @@ class LoginActivity : BaseActivity<LoginViewModel>() , UserPopupWindow.OnClearAc
                                     NumberUtils.getHashMapData(Constant.MTP_LOGIN_ACCOUNT)
                                 val psw =
                                     oldMap[it.toString().trim { it <= ' ' }]
-                                LogUtils.eTag("DefaultPreference.MTP_LOGIN_ACCOUNT", "==== $psw ===")
                                 if (psw != null) {
                                     if (psw.contains("-")) {
                                         val pswlist =
@@ -173,9 +172,9 @@ class LoginActivity : BaseActivity<LoginViewModel>() , UserPopupWindow.OnClearAc
                                     this@LoginActivity,
                                     true
                                 )
-                                userPopupWindow!!.setHeight(FrameLayout.LayoutParams.WRAP_CONTENT)
-                                userPopupWindow!!.setWidth(loginCodeEditText?.getMeasuredWidth() ?: 0 + 180)
-                                if (!userPopupWindow!!.isShowing()) {
+                                userPopupWindow!!.height = FrameLayout.LayoutParams.WRAP_CONTENT
+                                userPopupWindow!!.width = loginCodeEditText?.measuredWidth ?: 0 + 180
+                                if (!userPopupWindow!!.isShowing) {
                                     userPopupWindow!!.showAsDropDown(loginCodeEditText, 0, 1)
                                 }
                             }
@@ -480,8 +479,6 @@ class LoginActivity : BaseActivity<LoginViewModel>() , UserPopupWindow.OnClearAc
 
 
     private fun goHomePage() {
-
-
 //            polPreference.setAccountAndPass(mtp_login_pass.getText().toString().trim(), DefaultPreference.MTP_LOGIN_ACCOUNT);// 保存实盘账号
         val accountMa: MutableMap<String, String> =
             HashMap()