浏览代码

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

Liu.bolan 4 年之前
父节点
当前提交
587418f5d6

+ 243 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/warehouse/AddWareHouseInformationActivity.kt

@@ -0,0 +1,243 @@
+package cn.muchinfo.rma.view.base.home.warehouse
+
+import android.os.Bundle
+import android.view.Gravity
+import android.view.View
+import android.view.inputmethod.EditorInfo
+import android.widget.EditText
+import cn.muchinfo.rma.R
+import cn.muchinfo.rma.global.MTPEnums
+import cn.muchinfo.rma.global.ViewEnumUtils
+import cn.muchinfo.rma.lifecycle.bindOptional
+import cn.muchinfo.rma.view.autoWidget.*
+import cn.muchinfo.rma.view.base.BaseActivity
+import cn.muchinfo.rma.view.base.future.trade.itemView
+import cn.muchinfo.rma.view.base.home.contract.baseInformationView
+import cn.muchinfo.rma.view.base.home.contract.emptyView
+import mtp.polymer.com.autowidget.dialog.SelectData
+import mtp.polymer.com.autowidget.dialog.creatBottomSheetDialog
+import org.jetbrains.anko.*
+
+class AddWareHouseInformationActivity : BaseActivity<WarehouseInformationViewModel>() {
+
+    /**
+     * type 1 : 新增  2 : 停用 3 : 恢复 4 : 详情
+     */
+    val type by lazy {
+        intent.getStringExtra("type")
+    }
+
+    /**
+     * 仓库简称
+     */
+    lateinit var warehouse_referred: EditText
+
+    /**
+     * 仓库名称
+     */
+    lateinit var warehouse_name : EditText
+
+    override fun onCreate(savedInstanceState: Bundle?) {
+        super.onCreate(savedInstanceState)
+        verticalLayout {
+            topBar {
+                // 返回
+                commonLeftButton()
+                commonTitle {
+                    text = "新增仓库"
+                }
+            }
+
+            frameLayout {
+                scrollView {
+                    verticalLayout {
+                        linearLayout {
+                            visibility = if (type == "1") {
+                                View.GONE
+                            } else {
+                                View.VISIBLE
+                            }
+                            gravity = Gravity.CENTER_VERTICAL
+                            background = if (type == "2" || type == "4") {
+                                resources.getDrawable(R.color.rma_pass_status)//rma_pass_status已通过背景色
+                            } else {
+                                resources.getDrawable(R.color.rma_details_status)//rma_pass_status未通过背景色
+                            }
+                            imageView {
+                                imageResource = if (type == "2" || type == "4") {
+                                    R.mipmap.rma_pass_status
+                                } else {
+                                    R.mipmap.rma_wait_status
+                                }
+
+                            }.lparams(autoSize(38), autoSize(38)) {
+                                marginStart = autoSize(37)
+                            }
+                            textView {
+                                text = if (type == "2" || type == "4") {
+                                    "正常"
+                                } else {
+                                    "停用"
+                                }
+                                textSizeAuto = 31
+                                textColorInt = R.color.rma_yellow_text_color
+                            }.lparams(wrapContent, wrapContent) {
+                                marginStart = autoSize(20)
+                            }
+                        }.lparams(matchParent, autoSize(60))
+
+                        baseInformationView("仓库信息")
+
+                        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 {
+                                warehouse_referred = this
+                                hint = "请输入仓库简称"
+                                background = null
+                                inputType = EditorInfo.TYPE_CLASS_TEXT
+                                hintColorStr = "#CCCCCC"
+                                textSizeAuto = 31
+                                textColorStr = "#333333"
+                            }.lparams(matchParent, autoSize(132)) {
+                                marginStart = autoSize(80)
+                            }
+                        }.lparams(matchParent, autoSize(132))
+
+                        itemView()
+
+                        linearLayout {
+                            background = resources.getDrawable(R.color.white)
+                            gravity = Gravity.CENTER_VERTICAL
+                            onThrottleFirstClick {
+
+                            }
+                            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 = "请选择仓库类型"
+                                textSizeAuto = 31
+                                textColorInt = R.color.rma_hint_text_color_ccc
+                            }.lparams(wrapContent, wrapContent) {
+                                marginStart = autoSize(80)
+                            }
+
+                            emptyView()
+
+                            imageView {
+                                imageResource = R.mipmap.rma_more
+                            }.lparams(autoSize(36), autoSize(36)) {
+                                marginEnd = autoSize(25)
+                            }
+                        }.lparams(matchParent, autoSize(132))
+
+                        itemView()
+
+                        linearLayout {
+                            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 {
+                                warehouse_referred = this
+                                hint = "请输入仓库名称"
+                                background = null
+                                inputType = EditorInfo.TYPE_CLASS_TEXT
+                                hintColorStr = "#CCCCCC"
+                                textSizeAuto = 31
+                                textColorStr = "#333333"
+                            }.lparams(matchParent, autoSize(132)) {
+                                marginStart = autoSize(80)
+                            }
+                        }.lparams(matchParent, autoSize(132))
+
+                    }
+                }
+
+                linearLayout {
+                    background = resources.getDrawable(R.color.white)
+                    gravity = Gravity.CENTER_VERTICAL
+
+                    visibility = if (type == "4") {
+                        View.GONE
+                    } else {
+                        View.VISIBLE
+                    }
+
+                    onThrottleFirstClick {
+
+                    }
+
+                    textView {
+                        when (type) {
+                            "1" -> {
+                                text = "提交"
+                            }
+                            "2" -> {
+                                text = "停用"
+                            }
+                            "3" -> {
+                                text = "恢复"
+                            }
+                        }
+                        gravity = Gravity.CENTER
+                        backgroundResource = R.mipmap.rma_save_info_bg
+                        textSizeAuto = 38
+                        textColorInt = R.color.rma_star_color
+                    }.lparams(autoSize(419), autoSize(119)) {
+                        marginStart = autoSize(24)
+                    }
+                }.lparams(matchParent, autoSize(144)) {
+                    gravity = Gravity.BOTTOM
+                }
+            }
+
+
+        }
+    }
+
+}