添加货物列表,删除,编辑,新增功能
This commit is contained in:
parent
f0c13cba15
commit
94b8b36b7b
@ -3,7 +3,20 @@
|
|||||||
<component name="deploymentTargetDropDown">
|
<component name="deploymentTargetDropDown">
|
||||||
<value>
|
<value>
|
||||||
<entry key="app">
|
<entry key="app">
|
||||||
<State />
|
<State>
|
||||||
|
<targetSelectedWithDropDown>
|
||||||
|
<Target>
|
||||||
|
<type value="QUICK_BOOT_TARGET" />
|
||||||
|
<deviceKey>
|
||||||
|
<Key>
|
||||||
|
<type value="VIRTUAL_DEVICE_PATH" />
|
||||||
|
<value value="C:\Users\用户\.android\avd\7501620.avd" />
|
||||||
|
</Key>
|
||||||
|
</deviceKey>
|
||||||
|
</Target>
|
||||||
|
</targetSelectedWithDropDown>
|
||||||
|
<timeTargetWasSelectedWithDropDown value="2024-11-04T01:53:06.184191100Z" />
|
||||||
|
</State>
|
||||||
</entry>
|
</entry>
|
||||||
</value>
|
</value>
|
||||||
</component>
|
</component>
|
||||||
|
@ -127,6 +127,11 @@
|
|||||||
android:configChanges="keyboardHidden|orientation|locale"
|
android:configChanges="keyboardHidden|orientation|locale"
|
||||||
android:screenOrientation="portrait"
|
android:screenOrientation="portrait"
|
||||||
android:windowSoftInputMode="adjustPan|stateHidden" />
|
android:windowSoftInputMode="adjustPan|stateHidden" />
|
||||||
|
<activity
|
||||||
|
android:name=".ui.home.activtiy.GoodsInfoListActivity"
|
||||||
|
android:configChanges="keyboardHidden|orientation|locale"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
|
android:windowSoftInputMode="adjustPan|stateHidden" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".ui.home.activtiy.GoodsListActivity"
|
android:name=".ui.home.activtiy.GoodsListActivity"
|
||||||
android:configChanges="keyboardHidden|orientation|locale"
|
android:configChanges="keyboardHidden|orientation|locale"
|
||||||
|
@ -0,0 +1,78 @@
|
|||||||
|
package com.dhsd.glowner.adapter
|
||||||
|
|
||||||
|
import android.content.Context
|
||||||
|
import android.view.ViewGroup
|
||||||
|
import androidx.recyclerview.widget.GridLayoutManager
|
||||||
|
import androidx.recyclerview.widget.RecyclerView
|
||||||
|
import com.chad.library.adapter4.BaseQuickAdapter
|
||||||
|
import com.chad.library.adapter4.viewholder.QuickViewHolder
|
||||||
|
import com.dahe.mylibrary.weight.FullyGridLayoutManager
|
||||||
|
import com.dhsd.glowner.R
|
||||||
|
import com.dhsd.glowner.R.id.recycler
|
||||||
|
import com.dhsd.glowner.bean.DictBean
|
||||||
|
import com.dhsd.glowner.bean.GoodBean
|
||||||
|
import com.luck.picture.lib.decoration.GridSpacingItemDecoration
|
||||||
|
import com.luck.picture.lib.utils.DensityUtil
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName GoodListAdapter
|
||||||
|
* @Author john
|
||||||
|
* @Date 2024/11/4 10:28
|
||||||
|
* @Description 新增货物适配器
|
||||||
|
*/
|
||||||
|
class GoodListAdapter : BaseQuickAdapter<GoodBean, QuickViewHolder>(){
|
||||||
|
|
||||||
|
override fun onBindViewHolder(holder: QuickViewHolder, position: Int, item: GoodBean?) {
|
||||||
|
val recyBz = holder.getView<RecyclerView>(recycler)
|
||||||
|
recyBz.run {
|
||||||
|
layoutManager =
|
||||||
|
FullyGridLayoutManager(context, 3, GridLayoutManager.VERTICAL, false)
|
||||||
|
addItemDecoration(
|
||||||
|
GridSpacingItemDecoration(
|
||||||
|
3,
|
||||||
|
DensityUtil.dip2px(context, 8f), false
|
||||||
|
)
|
||||||
|
)
|
||||||
|
adapter = PackingTypeAdapter2(item!!.goodBz)
|
||||||
|
adapter as PackingTypeAdapter2
|
||||||
|
}.apply {
|
||||||
|
setOnItemClickListener{adapter ,_, position ->
|
||||||
|
val itemBz = adapter.items
|
||||||
|
val indexOfFirst = itemBz.indexOfFirst { it.isCheck }
|
||||||
|
if (indexOfFirst>-1){
|
||||||
|
if (indexOfFirst==position){
|
||||||
|
itemBz[position].isCheck = !itemBz[position].isCheck
|
||||||
|
}else{
|
||||||
|
itemBz[indexOfFirst].isCheck = false
|
||||||
|
itemBz[position].isCheck = true
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
itemBz[position].isCheck = !itemBz[position].isCheck
|
||||||
|
}
|
||||||
|
adapter.notifyDataSetChanged()
|
||||||
|
|
||||||
|
// if (indexOfFirst > -1 && indexOfFirst != position) {
|
||||||
|
// itemBz[indexOfFirst].isCheck = false
|
||||||
|
// itemBz[position].isCheck = !itemBz[position].isCheck
|
||||||
|
// notifyItemChanged(indexOfFirst)
|
||||||
|
// notifyItemChanged(position)
|
||||||
|
// } else {
|
||||||
|
// itemBz[position].isCheck = !itemBz[position].isCheck
|
||||||
|
// notifyItemChanged(position)
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
item?.let {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onCreateViewHolder(
|
||||||
|
context: Context,
|
||||||
|
parent: ViewGroup,
|
||||||
|
viewType: Int
|
||||||
|
): QuickViewHolder {
|
||||||
|
return QuickViewHolder(R.layout.item_add_good, parent)
|
||||||
|
}
|
||||||
|
}
|
@ -18,7 +18,7 @@ class GoodsAdapter : BaseQuickAdapter<GoodBean, QuickViewHolder>() {
|
|||||||
item?.let {
|
item?.let {
|
||||||
holder.run {
|
holder.run {
|
||||||
setText(R.id.tvAddress, it.goodName)
|
setText(R.id.tvAddress, it.goodName)
|
||||||
setText(R.id.tvName, it.goodsPropertyTypeCode)
|
setText(R.id.tvName, """${it.jttGoodsCategoryName} ${it.packName}""")
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,36 @@
|
|||||||
|
package com.dhsd.glowner.adapter
|
||||||
|
|
||||||
|
import android.content.Context
|
||||||
|
import android.view.ViewGroup
|
||||||
|
import android.widget.RadioButton
|
||||||
|
import android.widget.TextView
|
||||||
|
import com.chad.library.adapter4.BaseQuickAdapter
|
||||||
|
import com.chad.library.adapter4.QuickAdapterHelper
|
||||||
|
import com.chad.library.adapter4.viewholder.QuickViewHolder
|
||||||
|
import com.dahe.glex.bean.WayBillBean
|
||||||
|
import com.dhsd.glowner.R
|
||||||
|
import com.dhsd.glowner.bean.DictBean
|
||||||
|
import com.dhsd.glowner.bean.PackTypeBean
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName PackingTypeAdapter
|
||||||
|
* @Author john
|
||||||
|
* @Date 2024/2/4 14:49
|
||||||
|
* @Description TODO
|
||||||
|
*/
|
||||||
|
class PackingTypeAdapter2(datas:MutableList<DictBean>) : BaseQuickAdapter<DictBean,QuickViewHolder>() {
|
||||||
|
init {
|
||||||
|
items = datas
|
||||||
|
}
|
||||||
|
override fun onBindViewHolder(holder: QuickViewHolder, position: Int, item: DictBean?) {
|
||||||
|
holder.getView<TextView>(R.id.rbWord).isSelected = item?.isCheck == true
|
||||||
|
// holder.getView<RadioButton>(R.id.rbWord).isChecked = item?.isCheck == true
|
||||||
|
holder.setText(R.id.rbWord,item?.dictValue)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onCreateViewHolder(
|
||||||
|
context: Context,
|
||||||
|
parent: ViewGroup,
|
||||||
|
viewType: Int
|
||||||
|
) = QuickViewHolder(R.layout.item_packing_type,parent)
|
||||||
|
}
|
@ -1,17 +1,25 @@
|
|||||||
package com.dhsd.glowner.bean
|
package com.dhsd.glowner.bean
|
||||||
|
|
||||||
data class GoodBean(
|
data class GoodBean(
|
||||||
val cargoTypeClassificationCode: String,
|
var cargoTypeClassificationCode: String,
|
||||||
val commonGoodsId: Int,
|
var commonGoodsId: String,
|
||||||
val createBy: String,
|
var createBy: String,
|
||||||
val createTime: String,
|
var createTime: String,
|
||||||
val goodName: String,
|
var goodName: String,
|
||||||
val goodsPropertyTypeCode: String,
|
var goodsPropertyTypeCode: String,
|
||||||
val isDeleted: String,
|
var jttGoodsCategoryName: String,
|
||||||
val packName: String,
|
var alctGoodsCategoryCode: String,
|
||||||
val remark: String,
|
var isDeleted: String,
|
||||||
val shipperId: Int,
|
var packName: String,
|
||||||
val sortValue: String,
|
var remark: String,
|
||||||
val updateBy: String,
|
var shipperId: String,
|
||||||
val updateTime: String
|
var sortValue: String,
|
||||||
)
|
var updateBy: String,
|
||||||
|
var updateTime: String,
|
||||||
|
var goodCube: String,//货物体积
|
||||||
|
var goodItemGrossWeight: String,//货物重量(吨)
|
||||||
|
var goodPrice: String,//货物价值
|
||||||
|
var goodBz:MutableList<DictBean>
|
||||||
|
){
|
||||||
|
constructor():this("","","","","","","","","","","","","","","","","","", mutableListOf())
|
||||||
|
}
|
@ -136,7 +136,7 @@ interface Api {
|
|||||||
* 获取货主常用货物类型列表
|
* 获取货主常用货物类型列表
|
||||||
* @return Observable<CommonResponseBean<MutableList<DictBean>>>
|
* @return Observable<CommonResponseBean<MutableList<DictBean>>>
|
||||||
*/
|
*/
|
||||||
@GET(BASE_URL + "devApi//business/shipper/common/goods/list")
|
@GET(BASE_URL + "devApi/business/shipper/common/goods/list")
|
||||||
fun getGoodsList(): Observable<CommonResponseBean<OrderListBean<GoodBean>>>
|
fun getGoodsList(): Observable<CommonResponseBean<OrderListBean<GoodBean>>>
|
||||||
|
|
||||||
|
|
||||||
|
@ -3,10 +3,13 @@ package com.dhsd.glowner.ui.home.activtiy
|
|||||||
import BaseObserver
|
import BaseObserver
|
||||||
import DataManager
|
import DataManager
|
||||||
import RxHttpCallBack
|
import RxHttpCallBack
|
||||||
|
import android.content.Intent
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
|
import android.text.TextUtils
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.View.OnClickListener
|
import android.view.View.OnClickListener
|
||||||
import androidx.recyclerview.widget.GridLayoutManager
|
import androidx.recyclerview.widget.GridLayoutManager
|
||||||
|
import com.dahe.gldriver.base.AppConfig
|
||||||
import com.dahe.mylibrary.base.BaseActivity
|
import com.dahe.mylibrary.base.BaseActivity
|
||||||
import com.dahe.mylibrary.net.CommonResponseBean
|
import com.dahe.mylibrary.net.CommonResponseBean
|
||||||
import com.dahe.mylibrary.utils.PickerUtils
|
import com.dahe.mylibrary.utils.PickerUtils
|
||||||
@ -15,12 +18,14 @@ import com.dhsd.glowner.R
|
|||||||
import com.dhsd.glowner.adapter.PackingTypeAdapter
|
import com.dhsd.glowner.adapter.PackingTypeAdapter
|
||||||
import com.dhsd.glowner.bean.AddressBean
|
import com.dhsd.glowner.bean.AddressBean
|
||||||
import com.dhsd.glowner.bean.DictBean
|
import com.dhsd.glowner.bean.DictBean
|
||||||
|
import com.dhsd.glowner.bean.GoodBean
|
||||||
import com.dhsd.glowner.bean.GoodTypeBean
|
import com.dhsd.glowner.bean.GoodTypeBean
|
||||||
import com.dhsd.glowner.bean.PackTypeBean
|
import com.dhsd.glowner.bean.PackTypeBean
|
||||||
import com.dhsd.glowner.databinding.ActivityGoodsInfoBinding
|
import com.dhsd.glowner.databinding.ActivityGoodsInfoBinding
|
||||||
import com.dhsd.glowner.utils.OnLimitClickHelper
|
import com.dhsd.glowner.utils.OnLimitClickHelper
|
||||||
import com.dhsd.glowner.utils.OnLimitClickListener
|
import com.dhsd.glowner.utils.OnLimitClickListener
|
||||||
import com.github.gzuliyujiang.wheelpicker.contract.OnOptionPickedListener
|
import com.github.gzuliyujiang.wheelpicker.contract.OnOptionPickedListener
|
||||||
|
import com.google.gson.Gson
|
||||||
import com.luck.picture.lib.decoration.GridSpacingItemDecoration
|
import com.luck.picture.lib.decoration.GridSpacingItemDecoration
|
||||||
import com.luck.picture.lib.utils.DensityUtil
|
import com.luck.picture.lib.utils.DensityUtil
|
||||||
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers
|
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers
|
||||||
@ -38,6 +43,10 @@ class GoodsInfoActivity : BaseActivity<ActivityGoodsInfoBinding>(),
|
|||||||
private var unitType = 1 //1:重量,2:体积
|
private var unitType = 1 //1:重量,2:体积
|
||||||
|
|
||||||
lateinit var adapter: PackingTypeAdapter
|
lateinit var adapter: PackingTypeAdapter
|
||||||
|
|
||||||
|
private lateinit var currGoodTypeBean: GoodTypeBean
|
||||||
|
|
||||||
|
lateinit var preBean: GoodBean
|
||||||
override fun initView(savedInstanceState: Bundle?) {
|
override fun initView(savedInstanceState: Bundle?) {
|
||||||
setStatusBarColor(R.color.white)
|
setStatusBarColor(R.color.white)
|
||||||
setTitleBar("货物信息", true)
|
setTitleBar("货物信息", true)
|
||||||
@ -73,14 +82,38 @@ class GoodsInfoActivity : BaseActivity<ActivityGoodsInfoBinding>(),
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tvGoodType.setOnClickListener(OnLimitClickHelper(this@GoodsInfoActivity))
|
||||||
|
btnRight.setOnClickListener(OnLimitClickHelper(this@GoodsInfoActivity))
|
||||||
|
tvChange.setOnClickListener(this@GoodsInfoActivity)
|
||||||
|
}
|
||||||
|
intent.extras?.run {
|
||||||
|
val string = getString(AppConfig.BEAN)
|
||||||
|
preBean = Gson().fromJson(string, GoodBean::class.java)
|
||||||
|
binding?.run {
|
||||||
|
tvGood.setText(preBean.goodName)
|
||||||
|
tvGoodType.text = preBean.jttGoodsCategoryName
|
||||||
|
etMoney.setText(preBean.goodPrice)
|
||||||
|
if (!TextUtils.isEmpty(preBean.goodItemGrossWeight)) {
|
||||||
|
unitType = 1
|
||||||
|
etWeight.setText(preBean.goodItemGrossWeight)
|
||||||
|
etWeight.hint = "请填写总重量(吨)"
|
||||||
|
tvUnit.text = "重量(吨)"
|
||||||
|
} else if (!TextUtils.isEmpty(preBean.goodCube)) {
|
||||||
|
unitType = 2
|
||||||
|
etWeight.setText(preBean.goodCube)
|
||||||
|
etWeight.hint = "请填写总体积(m³)"
|
||||||
|
binding.tvUnit.text = "体积(m³)"
|
||||||
}
|
}
|
||||||
|
|
||||||
binding.run {
|
adapter.items.find { it.dictValue == preBean.packName }?.let {
|
||||||
tvGood.setOnClickListener(OnLimitClickHelper(this@GoodsInfoActivity))
|
it.isCheck = true
|
||||||
tvGoodType.setOnClickListener(OnLimitClickHelper(this@GoodsInfoActivity))
|
adapter.notifyDataSetChanged()
|
||||||
tvChange.setOnClickListener(this@GoodsInfoActivity)
|
|
||||||
// tvChange.setOnClickListener(OnLimitClickHelper(this@GoodsInfoActivity))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun initDate() {
|
override fun initDate() {
|
||||||
@ -89,6 +122,10 @@ class GoodsInfoActivity : BaseActivity<ActivityGoodsInfoBinding>(),
|
|||||||
.subscribe(BaseObserver(mContext, object : RxHttpCallBack<MutableList<DictBean>>() {
|
.subscribe(BaseObserver(mContext, object : RxHttpCallBack<MutableList<DictBean>>() {
|
||||||
override fun onSuccess(t: CommonResponseBean<MutableList<DictBean>>) {
|
override fun onSuccess(t: CommonResponseBean<MutableList<DictBean>>) {
|
||||||
super.onSuccess(t)
|
super.onSuccess(t)
|
||||||
|
if (::preBean.isInitialized) {
|
||||||
|
val packName = preBean.packName
|
||||||
|
t.data.find { it.dictValue == packName }?.isCheck = true
|
||||||
|
}
|
||||||
initList(t.data)
|
initList(t.data)
|
||||||
}
|
}
|
||||||
}))
|
}))
|
||||||
@ -97,13 +134,17 @@ class GoodsInfoActivity : BaseActivity<ActivityGoodsInfoBinding>(),
|
|||||||
override fun onClick(view: View?) {
|
override fun onClick(view: View?) {
|
||||||
super.onClick(view)
|
super.onClick(view)
|
||||||
when (view?.id) {
|
when (view?.id) {
|
||||||
R.id.tvGood -> {
|
R.id.btnRight -> {
|
||||||
var datas = mutableListOf("螺纹钢", "螺纹钢1", "螺纹钢2")
|
submit()
|
||||||
PickerUtils.getInstance().showSingleSelect(
|
|
||||||
this, "请选择货物", datas
|
|
||||||
) { position, item ->
|
|
||||||
showToast(item as String)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
R.id.tvGood -> {
|
||||||
|
// var datas = mutableListOf("螺纹钢", "螺纹钢1", "螺纹钢2")
|
||||||
|
// PickerUtils.getInstance().showSingleSelect(
|
||||||
|
// this, "请选择货物", datas
|
||||||
|
// ) { position, item ->
|
||||||
|
// showToast(item as String)
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
R.id.tvGoodType -> {
|
R.id.tvGoodType -> {
|
||||||
@ -140,7 +181,7 @@ class GoodsInfoActivity : BaseActivity<ActivityGoodsInfoBinding>(),
|
|||||||
this@GoodsInfoActivity, "请选择货物类型",
|
this@GoodsInfoActivity, "请选择货物类型",
|
||||||
"", t.data
|
"", t.data
|
||||||
) { position, item ->
|
) { position, item ->
|
||||||
item as GoodTypeBean
|
currGoodTypeBean = item as GoodTypeBean
|
||||||
binding.tvGoodType.text = item.jttGoodsCategoryName
|
binding.tvGoodType.text = item.jttGoodsCategoryName
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -168,4 +209,52 @@ class GoodsInfoActivity : BaseActivity<ActivityGoodsInfoBinding>(),
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private fun submit() {
|
||||||
|
binding.run {
|
||||||
|
|
||||||
|
if (tvGood.text.isEmpty() || tvGoodType.text.isEmpty() || etWeight.text.isEmpty()) {
|
||||||
|
showToast("请完善货物信息")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!::preBean.isInitialized) {
|
||||||
|
if (!::currGoodTypeBean.isInitialized) {
|
||||||
|
showToast("请选择货物类型")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
val adapterBz = adapter.items.filter { it.isCheck }
|
||||||
|
if (adapterBz.isEmpty()) {
|
||||||
|
showToast("请选包装方式")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
val goodBean = GoodBean().apply {
|
||||||
|
goodName = tvGood.text.toString().trim()
|
||||||
|
cargoTypeClassificationCode =
|
||||||
|
if (::preBean.isInitialized && !::currGoodTypeBean.isInitialized) preBean.cargoTypeClassificationCode else currGoodTypeBean.jttGoodsCategoryCode.toString()
|
||||||
|
goodsPropertyTypeCode =
|
||||||
|
if (::preBean.isInitialized && !::currGoodTypeBean.isInitialized) preBean.alctGoodsCategoryCode else currGoodTypeBean.alctGoodsCategoryCode.toString()
|
||||||
|
jttGoodsCategoryName = tvGoodType.text.toString()
|
||||||
|
packName = adapterBz.find { it.isCheck }!!.dictValue
|
||||||
|
goodPrice = etMoney.text.toString().trim()
|
||||||
|
if (unitType == 1) {
|
||||||
|
goodItemGrossWeight = etWeight.text.toString()
|
||||||
|
} else {
|
||||||
|
goodCube = etWeight.text.toString()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
setResult(RESULT_OK, Intent().apply {
|
||||||
|
putExtra(AppConfig.BEAN, Gson().toJson(goodBean))
|
||||||
|
})
|
||||||
|
finish()
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -0,0 +1,190 @@
|
|||||||
|
package com.dhsd.glowner.ui.home.activtiy
|
||||||
|
|
||||||
|
import BaseObserver
|
||||||
|
import DataManager
|
||||||
|
import Good
|
||||||
|
import RxHttpCallBack
|
||||||
|
import android.content.Intent
|
||||||
|
import android.graphics.Color
|
||||||
|
import android.os.Bundle
|
||||||
|
import android.view.View
|
||||||
|
import android.view.View.OnClickListener
|
||||||
|
import android.widget.LinearLayout
|
||||||
|
import androidx.activity.result.contract.ActivityResultContracts
|
||||||
|
import androidx.appcompat.app.AppCompatActivity
|
||||||
|
import androidx.recyclerview.widget.GridLayoutManager
|
||||||
|
import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
|
import com.dahe.gldriver.base.AppConfig
|
||||||
|
import com.dahe.mylibrary.base.BaseActivity
|
||||||
|
import com.dahe.mylibrary.net.CommonResponseBean
|
||||||
|
import com.dahe.mylibrary.recycleviewswipe.RecycleViewDivider
|
||||||
|
import com.dahe.mylibrary.utils.ActivityUtils
|
||||||
|
import com.dahe.mylibrary.utils.ConvertUtils
|
||||||
|
import com.dahe.mylibrary.utils.PickerUtils
|
||||||
|
import com.dahe.mylibrary.weight.FullyGridLayoutManager
|
||||||
|
import com.dhsd.glowner.R
|
||||||
|
import com.dhsd.glowner.adapter.GoodListAdapter
|
||||||
|
import com.dhsd.glowner.adapter.GoodsAdapter
|
||||||
|
import com.dhsd.glowner.adapter.PackingTypeAdapter
|
||||||
|
import com.dhsd.glowner.bean.AddressBean
|
||||||
|
import com.dhsd.glowner.bean.DictBean
|
||||||
|
import com.dhsd.glowner.bean.GoodBean
|
||||||
|
import com.dhsd.glowner.bean.GoodTypeBean
|
||||||
|
import com.dhsd.glowner.bean.PackTypeBean
|
||||||
|
import com.dhsd.glowner.databinding.ActivityGoodsInfoBinding
|
||||||
|
import com.dhsd.glowner.databinding.ActivityGoodsInfoListBinding
|
||||||
|
import com.dhsd.glowner.utils.OnLimitClickHelper
|
||||||
|
import com.dhsd.glowner.utils.OnLimitClickListener
|
||||||
|
import com.github.gzuliyujiang.wheelpicker.contract.OnOptionPickedListener
|
||||||
|
import com.google.gson.Gson
|
||||||
|
import com.luck.picture.lib.decoration.GridSpacingItemDecoration
|
||||||
|
import com.luck.picture.lib.utils.DensityUtil
|
||||||
|
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers
|
||||||
|
import io.reactivex.rxjava3.schedulers.Schedulers
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName GoodsInfoActivity
|
||||||
|
* @Author john
|
||||||
|
* @Date 2024/2/4 11:09
|
||||||
|
* @Description 新增货物信息列表
|
||||||
|
*/
|
||||||
|
class GoodsInfoListActivity : BaseActivity<ActivityGoodsInfoListBinding>(),
|
||||||
|
OnLimitClickListener, OnClickListener {
|
||||||
|
private var editPosition: Int = -1
|
||||||
|
|
||||||
|
// private val launcher =
|
||||||
|
// registerForActivityResult(ActivityResultContracts.StartActivityForResult()) { result ->
|
||||||
|
// if (result.resultCode == AppCompatActivity.RESULT_OK) {
|
||||||
|
// result.data?.let {
|
||||||
|
// val serializableExtra = it.getSerializableExtra(AppConfig.BEAN)
|
||||||
|
// Gson().fromJson()
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
lateinit var adapter: GoodsAdapter
|
||||||
|
|
||||||
|
override fun initView(savedInstanceState: Bundle?) {
|
||||||
|
setStatusBarColor(R.color.white)
|
||||||
|
setTitleBar("货物信息", { finish() }, true, "常用货物") {
|
||||||
|
// launcher.launch(Intent(mContext,GoodsListActivity::class.java))
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
binding.run {
|
||||||
|
adapter = recycler.run {
|
||||||
|
layoutManager = LinearLayoutManager(mContext, LinearLayoutManager.VERTICAL, false)
|
||||||
|
addItemDecoration(
|
||||||
|
RecycleViewDivider(
|
||||||
|
LinearLayout.VERTICAL,
|
||||||
|
ConvertUtils.dp2px(10.0f),
|
||||||
|
Color.TRANSPARENT
|
||||||
|
)
|
||||||
|
)
|
||||||
|
adapter = GoodsAdapter()
|
||||||
|
adapter as GoodsAdapter
|
||||||
|
}.apply {
|
||||||
|
isStateViewEnable = true
|
||||||
|
submitList(null)
|
||||||
|
setStateViewLayout(mContext, R.layout.empty_view)
|
||||||
|
addOnItemChildClickListener(R.id.tvDel) { adapter, _, position ->
|
||||||
|
adapter.removeAt(position)
|
||||||
|
}
|
||||||
|
|
||||||
|
addOnItemChildClickListener(R.id.tvEdit) { adapter, _, position ->
|
||||||
|
val goodBean = adapter.items[position]
|
||||||
|
editPosition = position
|
||||||
|
ActivityUtils.startActivityForResult(
|
||||||
|
this@GoodsInfoListActivity,
|
||||||
|
GoodsInfoActivity::class.java,
|
||||||
|
Bundle().apply {
|
||||||
|
putString(AppConfig.BEAN, Gson().toJson(goodBean))
|
||||||
|
},
|
||||||
|
1
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
btnLeft.setOnClickListener(OnLimitClickHelper(this@GoodsInfoListActivity))
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun initDate() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onClick(view: View?) {
|
||||||
|
super.onClick(view)
|
||||||
|
when (view?.id) {
|
||||||
|
R.id.tvGood -> {
|
||||||
|
var datas = mutableListOf("螺纹钢", "螺纹钢1", "螺纹钢2")
|
||||||
|
PickerUtils.getInstance().showSingleSelect(
|
||||||
|
this, "请选择货物", datas
|
||||||
|
) { position, item ->
|
||||||
|
showToast(item as String)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
R.id.tvGoodType -> {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
R.id.tvChange -> {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
R.id.btnLeft -> {
|
||||||
|
//新增货物需要初始化编辑货物标志
|
||||||
|
editPosition = -1
|
||||||
|
ActivityUtils.startActivityForResult(
|
||||||
|
this@GoodsInfoListActivity,
|
||||||
|
GoodsInfoActivity::class.java,
|
||||||
|
1
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
|
||||||
|
super.onActivityResult(requestCode, resultCode, data)
|
||||||
|
if (resultCode == RESULT_OK) {
|
||||||
|
when (requestCode) {
|
||||||
|
1 -> {
|
||||||
|
val serializableExtra = data?.getStringExtra(AppConfig.BEAN)
|
||||||
|
if (serializableExtra != null) {
|
||||||
|
val goodBean = Gson().fromJson(serializableExtra, GoodBean::class.java)
|
||||||
|
val items = adapter.items
|
||||||
|
if (items.isEmpty()) {
|
||||||
|
adapter.submitList(mutableListOf(goodBean))
|
||||||
|
} else {
|
||||||
|
if (editPosition != -1) {
|
||||||
|
adapter[editPosition] = goodBean
|
||||||
|
} else {
|
||||||
|
adapter.add(goodBean)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
// adapter.notifyDataSetChanged()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun initList(rows: List<GoodBean>) {
|
||||||
|
if (rows.isEmpty()) {
|
||||||
|
adapter.submitList(null)
|
||||||
|
adapter.setStateViewLayout(mContext, R.layout.empty_view)
|
||||||
|
} else {
|
||||||
|
if (mRefreshPage === 1) {
|
||||||
|
adapter?.submitList(rows)
|
||||||
|
} else {
|
||||||
|
adapter?.addAll(rows)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,160 @@
|
|||||||
|
package com.dhsd.glowner.ui.home.activtiy
|
||||||
|
|
||||||
|
import BaseObserver
|
||||||
|
import DataManager
|
||||||
|
import Good
|
||||||
|
import RxHttpCallBack
|
||||||
|
import android.graphics.Color
|
||||||
|
import android.os.Bundle
|
||||||
|
import android.view.View
|
||||||
|
import android.view.View.OnClickListener
|
||||||
|
import android.widget.LinearLayout
|
||||||
|
import androidx.recyclerview.widget.GridLayoutManager
|
||||||
|
import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
|
import com.dahe.mylibrary.base.BaseActivity
|
||||||
|
import com.dahe.mylibrary.net.CommonResponseBean
|
||||||
|
import com.dahe.mylibrary.recycleviewswipe.RecycleViewDivider
|
||||||
|
import com.dahe.mylibrary.utils.ConvertUtils
|
||||||
|
import com.dahe.mylibrary.utils.PickerUtils
|
||||||
|
import com.dahe.mylibrary.weight.FullyGridLayoutManager
|
||||||
|
import com.dhsd.glowner.R
|
||||||
|
import com.dhsd.glowner.adapter.GoodListAdapter
|
||||||
|
import com.dhsd.glowner.adapter.PackingTypeAdapter
|
||||||
|
import com.dhsd.glowner.bean.AddressBean
|
||||||
|
import com.dhsd.glowner.bean.DictBean
|
||||||
|
import com.dhsd.glowner.bean.GoodBean
|
||||||
|
import com.dhsd.glowner.bean.GoodTypeBean
|
||||||
|
import com.dhsd.glowner.bean.PackTypeBean
|
||||||
|
import com.dhsd.glowner.databinding.ActivityGoodsInfoBinding
|
||||||
|
import com.dhsd.glowner.databinding.ActivityGoodsInfoListBinding
|
||||||
|
import com.dhsd.glowner.utils.OnLimitClickHelper
|
||||||
|
import com.dhsd.glowner.utils.OnLimitClickListener
|
||||||
|
import com.github.gzuliyujiang.wheelpicker.contract.OnOptionPickedListener
|
||||||
|
import com.luck.picture.lib.decoration.GridSpacingItemDecoration
|
||||||
|
import com.luck.picture.lib.utils.DensityUtil
|
||||||
|
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers
|
||||||
|
import io.reactivex.rxjava3.schedulers.Schedulers
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName GoodsInfoActivity
|
||||||
|
* @Author john
|
||||||
|
* @Date 2024/2/4 11:09
|
||||||
|
* @Description 新增货物信息列表
|
||||||
|
*/
|
||||||
|
class GoodsInfoListActivityBack : BaseActivity<ActivityGoodsInfoListBinding>(),
|
||||||
|
OnLimitClickListener, OnClickListener {
|
||||||
|
|
||||||
|
lateinit var adapter: GoodListAdapter
|
||||||
|
lateinit var datas: MutableList<GoodBean>
|
||||||
|
lateinit var goodBzs : MutableList<DictBean>
|
||||||
|
override fun initView(savedInstanceState: Bundle?) {
|
||||||
|
setStatusBarColor(R.color.white)
|
||||||
|
setTitleBar("货物信息", true)
|
||||||
|
|
||||||
|
|
||||||
|
binding.run {
|
||||||
|
adapter = recycler.run {
|
||||||
|
layoutManager = LinearLayoutManager(mContext, LinearLayoutManager.VERTICAL, false)
|
||||||
|
addItemDecoration(
|
||||||
|
RecycleViewDivider(
|
||||||
|
LinearLayout.VERTICAL,
|
||||||
|
ConvertUtils.dp2px(10.0f),
|
||||||
|
Color.TRANSPARENT
|
||||||
|
)
|
||||||
|
)
|
||||||
|
adapter = GoodListAdapter()
|
||||||
|
adapter as GoodListAdapter
|
||||||
|
}.apply {
|
||||||
|
|
||||||
|
addOnItemChildClickListener(R.id.tvChange) { adapter, view, position ->
|
||||||
|
|
||||||
|
showToast("点击了$position")
|
||||||
|
|
||||||
|
val items = adapter.items
|
||||||
|
// val indexOfFirst = items.indexOfFirst { it.isCheck }
|
||||||
|
//
|
||||||
|
// if (indexOfFirst > -1 && indexOfFirst != position) {
|
||||||
|
// items[indexOfFirst].isCheck = false
|
||||||
|
// items[position].isCheck = !items[position].isCheck
|
||||||
|
// notifyItemChanged(indexOfFirst)
|
||||||
|
// notifyItemChanged(position)
|
||||||
|
// } else {
|
||||||
|
// items[position].isCheck = !items[position].isCheck
|
||||||
|
// notifyItemChanged(position)
|
||||||
|
// }
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
btnLeft.setOnClickListener(OnLimitClickHelper(this@GoodsInfoListActivityBack))
|
||||||
|
}
|
||||||
|
datas = mutableListOf(GoodBean())
|
||||||
|
adapter.submitList(datas)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun initDate() {
|
||||||
|
DataManager.getInstance().getDictData("packaging_method")
|
||||||
|
.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(BaseObserver(mContext, object : RxHttpCallBack<MutableList<DictBean>>() {
|
||||||
|
override fun onSuccess(t: CommonResponseBean<MutableList<DictBean>>) {
|
||||||
|
super.onSuccess(t)
|
||||||
|
goodBzs = t.data
|
||||||
|
adapter.items.forEach {
|
||||||
|
it.goodBz = goodBzs
|
||||||
|
}
|
||||||
|
adapter.notifyDataSetChanged()
|
||||||
|
// adapter.setGoodBz(t.data)
|
||||||
|
// initList(t.data)
|
||||||
|
}
|
||||||
|
}))
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onClick(view: View?) {
|
||||||
|
super.onClick(view)
|
||||||
|
when (view?.id) {
|
||||||
|
R.id.tvGood -> {
|
||||||
|
var datas = mutableListOf("螺纹钢", "螺纹钢1", "螺纹钢2")
|
||||||
|
PickerUtils.getInstance().showSingleSelect(
|
||||||
|
this, "请选择货物", datas
|
||||||
|
) { position, item ->
|
||||||
|
showToast(item as String)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
R.id.tvGoodType -> {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
R.id.tvChange -> {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
R.id.btnLeft -> {
|
||||||
|
datas.add(GoodBean().apply {
|
||||||
|
goodBzs.forEach {
|
||||||
|
it.isCheck = false
|
||||||
|
}
|
||||||
|
goodBz = goodBzs
|
||||||
|
})
|
||||||
|
adapter.notifyItemInserted(datas.size - 1)
|
||||||
|
binding.recycler.scrollToPosition(datas.size - 1)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun initList(rows: List<GoodBean>) {
|
||||||
|
if (rows.isEmpty()) {
|
||||||
|
adapter.submitList(null)
|
||||||
|
adapter.setStateViewLayout(mContext, R.layout.empty_view)
|
||||||
|
} else {
|
||||||
|
if (mRefreshPage === 1) {
|
||||||
|
adapter?.submitList(rows)
|
||||||
|
} else {
|
||||||
|
adapter?.addAll(rows)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -25,7 +25,7 @@ import io.reactivex.rxjava3.schedulers.Schedulers
|
|||||||
* @ClassName GoodsListActivity
|
* @ClassName GoodsListActivity
|
||||||
* @Author john
|
* @Author john
|
||||||
* @Date 2024/11/1 16:36
|
* @Date 2024/11/1 16:36
|
||||||
* @Description 常用货物
|
* @Description 货物列表
|
||||||
*/
|
*/
|
||||||
class GoodsListActivity : BaseActivity<ActivityGoodsListBinding>(), RefreshCallBack {
|
class GoodsListActivity : BaseActivity<ActivityGoodsListBinding>(), RefreshCallBack {
|
||||||
lateinit var adapter: GoodsAdapter
|
lateinit var adapter: GoodsAdapter
|
||||||
@ -47,14 +47,14 @@ class GoodsListActivity : BaseActivity<ActivityGoodsListBinding>(), RefreshCallB
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun initDate() {
|
override fun initDate() {
|
||||||
DataManager.getInstance().getGoodsList()
|
// DataManager.getInstance().getGoodsList()
|
||||||
.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread())
|
// .subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread())
|
||||||
.subscribe(BaseObserver(mContext,object : RxHttpCallBack<OrderListBean<GoodBean>>(){
|
// .subscribe(BaseObserver(mContext,object : RxHttpCallBack<OrderListBean<GoodBean>>(){
|
||||||
override fun onSuccess(t: CommonResponseBean<OrderListBean<GoodBean>>) {
|
// override fun onSuccess(t: CommonResponseBean<OrderListBean<GoodBean>>) {
|
||||||
super.onSuccess(t)
|
// super.onSuccess(t)
|
||||||
initList(t.data.rows)
|
// initList(t.data.rows)
|
||||||
}
|
// }
|
||||||
}))
|
// }))
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun getRefreshDate(stat: Int, page: Int, count: Int) {
|
override fun getRefreshDate(stat: Int, page: Int, count: Int) {
|
||||||
|
@ -45,7 +45,9 @@ class SendGoodsActivity : BaseActivity<ActivitySendGoodsBinding>() {
|
|||||||
)
|
)
|
||||||
|
|
||||||
binding.llGoods.setOnClickListener {
|
binding.llGoods.setOnClickListener {
|
||||||
ActivityUtils.startActivity(mContext, GoodsInfoActivity::class.java)
|
// ActivityUtils.startActivity(mContext, GoodsInfoActivity::class.java)
|
||||||
|
// ActivityUtils.startActivity(mContext, GoodsInfoListActivity::class.java)
|
||||||
|
ActivityUtils.startActivity(mContext, GoodsInfoListActivity::class.java)
|
||||||
}
|
}
|
||||||
binding.llCarType.setOnClickListener {
|
binding.llCarType.setOnClickListener {
|
||||||
ActivityUtils.startActivity(mContext, CarTypeActivity::class.java)
|
ActivityUtils.startActivity(mContext, CarTypeActivity::class.java)
|
||||||
|
@ -261,6 +261,7 @@
|
|||||||
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
|
android:visibility="gone"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="@dimen/dp_18"
|
android:layout_marginTop="@dimen/dp_18"
|
||||||
@ -297,6 +298,7 @@
|
|||||||
android:paddingRight="@dimen/dp_15">
|
android:paddingRight="@dimen/dp_15">
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
|
android:visibility="gone"
|
||||||
android:id="@+id/btnLeft"
|
android:id="@+id/btnLeft"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
@ -310,7 +312,7 @@
|
|||||||
android:id="@+id/btnRight"
|
android:id="@+id/btnRight"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginLeft="@dimen/dp_16"
|
|
||||||
android:layout_weight="2"
|
android:layout_weight="2"
|
||||||
android:background="@drawable/bg_btn"
|
android:background="@drawable/bg_btn"
|
||||||
android:text="确定"
|
android:text="确定"
|
||||||
|
47
app/src/main/res/layout/activity_goods_info_list.xml
Normal file
47
app/src/main/res/layout/activity_goods_info_list.xml
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<include layout="@layout/common_toolbar"></include>
|
||||||
|
|
||||||
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
android:id="@+id/recycler"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_weight="1" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="@dimen/dp_70"
|
||||||
|
android:layout_marginTop="@dimen/dp_10"
|
||||||
|
android:background="@color/white"
|
||||||
|
android:gravity="center"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:paddingLeft="@dimen/dp_15"
|
||||||
|
android:paddingRight="@dimen/dp_15">
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/btnLeft"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:background="@drawable/bg_left_btn"
|
||||||
|
android:text="添加货物"
|
||||||
|
android:textColor="#FF5F20"
|
||||||
|
android:textSize="@dimen/sp_17" />
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/btnRight"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="@dimen/dp_16"
|
||||||
|
android:layout_weight="2"
|
||||||
|
android:background="@drawable/bg_btn"
|
||||||
|
android:text="确定"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="@dimen/sp_17" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
</LinearLayout>
|
262
app/src/main/res/layout/item_add_good.xml
Normal file
262
app/src/main/res/layout/item_add_good.xml
Normal file
@ -0,0 +1,262 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="@dimen/dp_15"
|
||||||
|
android:layout_marginTop="@dimen/dp_13"
|
||||||
|
android:layout_marginRight="@dimen/dp_15"
|
||||||
|
android:background="@drawable/shape_white_8"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:paddingLeft="@dimen/dp_14"
|
||||||
|
android:paddingTop="@dimen/dp_16"
|
||||||
|
android:paddingRight="@dimen/dp_14"
|
||||||
|
android:paddingBottom="@dimen/dp_16">
|
||||||
|
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
|
||||||
|
android:drawableLeft="@drawable/start"
|
||||||
|
android:text="货物名称"
|
||||||
|
android:textColor="@color/black"
|
||||||
|
android:textSize="@dimen/sp_16" />
|
||||||
|
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/tvGood"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:background="@null"
|
||||||
|
android:drawableRight="@drawable/right"
|
||||||
|
android:drawablePadding="@dimen/dp_6"
|
||||||
|
android:gravity="right"
|
||||||
|
android:inputType="text"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:text="螺纹钢"
|
||||||
|
android:textColor="@color/black"
|
||||||
|
android:textSize="@dimen/sp_16" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="@dimen/dp_1"
|
||||||
|
android:layout_marginTop="@dimen/dp_16"
|
||||||
|
android:background="@color/color_E1" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="@dimen/dp_16"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:drawableLeft="@drawable/start"
|
||||||
|
android:text="货物类型"
|
||||||
|
android:textColor="@color/black"
|
||||||
|
android:textSize="@dimen/sp_16" />
|
||||||
|
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tvGoodType"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:drawableRight="@drawable/right"
|
||||||
|
android:drawablePadding="@dimen/dp_6"
|
||||||
|
android:gravity="right"
|
||||||
|
android:hint="请选择货物类型"
|
||||||
|
android:textColor="@color/black"
|
||||||
|
android:textSize="@dimen/sp_16" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="@dimen/dp_1"
|
||||||
|
android:layout_marginTop="@dimen/dp_16"
|
||||||
|
android:background="@color/color_E1" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="@dimen/dp_16"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:drawableLeft="@drawable/start"
|
||||||
|
android:text="包装方式"
|
||||||
|
android:textColor="@color/black"
|
||||||
|
android:textSize="@dimen/sp_16" />
|
||||||
|
|
||||||
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
android:id="@+id/recycler"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="@dimen/dp_5"
|
||||||
|
android:layout_marginRight="@dimen/dp_5"
|
||||||
|
android:background="@drawable/shape_white_8"
|
||||||
|
android:paddingTop="@dimen/dp_10"
|
||||||
|
android:paddingBottom="@dimen/dp_10" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="@dimen/dp_1"
|
||||||
|
android:layout_marginTop="@dimen/dp_6"
|
||||||
|
android:background="@color/color_E1" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="@dimen/dp_16"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:drawableLeft="@drawable/start"
|
||||||
|
android:text="总重量/体积"
|
||||||
|
android:textColor="@color/black"
|
||||||
|
android:textSize="@dimen/sp_16" />
|
||||||
|
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tvChange"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="切换单位"
|
||||||
|
android:textColor="@color/black"
|
||||||
|
android:textSize="@dimen/sp_16" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="@dimen/dp_14"
|
||||||
|
android:background="@drawable/shape_gray_5"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:padding="@dimen/dp_11">
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/etWeight"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="2.5"
|
||||||
|
android:background="@null"
|
||||||
|
android:hint="请填写总质量(吨)"
|
||||||
|
android:inputType="numberDecimal"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:textColor="@color/black"
|
||||||
|
android:textSize="@dimen/sp_16" />
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="@dimen/dp_1"
|
||||||
|
android:layout_height="@dimen/dp_20"
|
||||||
|
android:layout_marginRight="@dimen/dp_12"
|
||||||
|
android:background="@color/color_c" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tvUnit"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="重量(吨)"
|
||||||
|
android:textColor="@color/black"
|
||||||
|
android:textSize="@dimen/sp_16" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="@dimen/dp_16"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:text="货物价值(非必填)"
|
||||||
|
android:textColor="@color/black"
|
||||||
|
android:textSize="@dimen/sp_16" />
|
||||||
|
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="@dimen/dp_14"
|
||||||
|
android:background="@drawable/shape_gray_5"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:padding="@dimen/dp_11">
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/etMoney"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="2.5"
|
||||||
|
android:background="@null"
|
||||||
|
android:hint="请填写货物价值"
|
||||||
|
android:inputType="numberDecimal"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:textColor="@color/black"
|
||||||
|
android:textSize="@dimen/sp_16" />
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="@dimen/dp_1"
|
||||||
|
android:layout_height="@dimen/dp_20"
|
||||||
|
android:layout_marginRight="@dimen/dp_12"
|
||||||
|
android:background="@color/color_c" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="元"
|
||||||
|
android:textColor="@color/black"
|
||||||
|
android:textSize="@dimen/sp_16" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="@dimen/dp_18"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:text="是否保存为常用货物" />
|
||||||
|
|
||||||
|
<com.dahe.mylibrary.weight.SwitchView
|
||||||
|
android:layout_width="@dimen/dp_40"
|
||||||
|
android:layout_height="@dimen/dp_20"></com.dahe.mylibrary.weight.SwitchView>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
|
</LinearLayout>
|
Loading…
Reference in New Issue
Block a user