feat(pack): 优化净菜包页面布局和功能
- 调整 activity_pack.xml 中的边距和按钮布局 - 在 DateTimeUtil.kt 中添加日期格式常量 YYYY_MM_DD - 优化 list_item_form_field.xml 的输入框样式和字体大小 - 将页面标题从"菜品净菜包"改为"餐品净菜包" - 修改包装日期格式为 yyyy-MM-dd 并移除操作类型字段 - 将操作类型改为下拉选择框,支持设备自动和人工录入选项 - 将表单列表网格布局从2列改为4列显示 - 在 TaskActivity 中添加页面刷新逻辑 - 任务详情页面提交成功后返回并提示"组配成功"
This commit is contained in:
@@ -98,11 +98,10 @@ class PackActivity : BaseActivity() {
|
||||
}
|
||||
}
|
||||
|
||||
val titleText = "菜品净菜包"
|
||||
setTitleBar(titleBarAction = {
|
||||
it.visible()
|
||||
}, titleAction = {
|
||||
it.text = titleText
|
||||
it.text = "餐品净菜包"
|
||||
}, rightIconAction = {
|
||||
it.gone()
|
||||
}, backAction = {
|
||||
@@ -274,9 +273,9 @@ class PackActivity : BaseActivity() {
|
||||
//包装餐品名称
|
||||
params["mealName"] = food.foodName
|
||||
//包装日期
|
||||
params["packageDate"] = DateTimeUtil.formatDateTime(LocalDateTime.now())
|
||||
//操作类型
|
||||
params["opType"] = "设备自动"
|
||||
params["packageDate"] = DateTimeUtil.formatDateTime(dateTime = LocalDateTime.now(), pattern = DateTimeUtil.YYYY_MM_DD)
|
||||
// //操作类型
|
||||
// params["opType"] = "设备自动"
|
||||
|
||||
//食材明细列表
|
||||
params["ingredients"] = list.map {
|
||||
@@ -557,14 +556,18 @@ class PackActivity : BaseActivity() {
|
||||
required = false
|
||||
)
|
||||
fields.add(deviceField!!)
|
||||
// fields.add(
|
||||
// FormField(
|
||||
// label = "操作类型", type = FieldType.FIXED,
|
||||
// apiKey = "opType",
|
||||
// required = true,
|
||||
// value = "设备自动"
|
||||
// )
|
||||
// )
|
||||
fields.add(
|
||||
FormField(
|
||||
label = "操作类型", type = FieldType.DROPDOWN,
|
||||
apiKey = "opType",
|
||||
extraApiKeys = mapOf("opType" to "id"),
|
||||
required = true,
|
||||
options = listOf(
|
||||
DictType(id = "1", value = "设备自动"),
|
||||
DictType(id = "2", value = "人工录入")
|
||||
).toMutableList()
|
||||
)
|
||||
)
|
||||
loadDictItemsWithCallback("sup_package_method", packageMethodField!!)
|
||||
loadDeviceOptionsWithCallback(deviceField)
|
||||
}
|
||||
@@ -642,7 +645,7 @@ class PackActivity : BaseActivity() {
|
||||
private fun initRecyclerView() {
|
||||
initFormList()
|
||||
binding.rvFormList.let {
|
||||
it.layoutManager = GridLayoutManager(this, 2, GridLayoutManager.VERTICAL, false)
|
||||
it.layoutManager = GridLayoutManager(this, 4, GridLayoutManager.VERTICAL, false)
|
||||
it.adapter = formAdapter
|
||||
}
|
||||
|
||||
|
||||
@@ -65,6 +65,11 @@ class TaskActivity : BaseActivity() {
|
||||
initRecyclerView()
|
||||
initRefreshLayout()
|
||||
initSearchListener()
|
||||
}
|
||||
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
currentPage = 1
|
||||
loadTaskList()
|
||||
}
|
||||
|
||||
|
||||
@@ -291,7 +291,8 @@ class TaskDetailActivity : BaseActivity() {
|
||||
toast(msg)
|
||||
return@addComboTask
|
||||
}
|
||||
toast("上报成功")
|
||||
toast("组配成功")
|
||||
finish()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ import java.util.Date
|
||||
object DateTimeUtil {
|
||||
|
||||
const val YYYY_MM_DD_HH_MM_SS = "yyyy-MM-dd HH:mm:ss"
|
||||
const val YYYY_MM_DD = "yyyy-MM-dd"
|
||||
|
||||
fun formatDateTime(dateTime: LocalDateTime, pattern: String = YYYY_MM_DD_HH_MM_SS): String {
|
||||
val formatter = DateTimeFormatter.ofPattern(pattern)
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="20dp"
|
||||
android:layout_marginHorizontal="30dp"
|
||||
android:background="@drawable/shape_white_30_corners"
|
||||
android:orientation="vertical">
|
||||
|
||||
@@ -62,7 +62,7 @@
|
||||
android:id="@+id/rvFormList"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="20dp"
|
||||
android:layout_marginHorizontal="10dp"
|
||||
android:layout_marginVertical="10dp"
|
||||
android:overScrollMode="never" />
|
||||
</LinearLayout>
|
||||
@@ -205,7 +205,8 @@
|
||||
android:id="@+id/btnSubmit"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="90dp"
|
||||
android:layout_margin="30dp"
|
||||
android:layout_marginVertical="20dp"
|
||||
android:layout_marginHorizontal="30dp"
|
||||
android:background="@drawable/shape_green_bg"
|
||||
android:foreground="?android:attr/selectableItemBackground"
|
||||
android:gravity="center"
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
android:id="@+id/tvLabel"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="12dp"
|
||||
android:layout_marginHorizontal="6dp"
|
||||
android:layout_marginBottom="6dp"
|
||||
android:textColor="#FF141428"
|
||||
android:textSize="20sp"
|
||||
@@ -146,7 +146,7 @@
|
||||
android:id="@+id/flInputArea"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="60dp"
|
||||
android:layout_marginHorizontal="12dp"
|
||||
android:layout_marginHorizontal="6dp"
|
||||
android:visibility="gone">
|
||||
|
||||
<!-- TEXT / NUMBER / FIXED 类型:EditText -->
|
||||
@@ -160,7 +160,7 @@
|
||||
android:paddingHorizontal="20dp"
|
||||
android:textColor="#FF141428"
|
||||
android:textColorHint="#FF96A0AA"
|
||||
android:textSize="22sp"
|
||||
android:textSize="20sp"
|
||||
android:textStyle="bold"
|
||||
android:visibility="gone"
|
||||
tools:ignore="Autofill,TextFields" />
|
||||
@@ -184,7 +184,7 @@
|
||||
android:maxLines="1"
|
||||
android:textColor="#FF141428"
|
||||
android:textColorHint="#FF96A0AA"
|
||||
android:textSize="22sp"
|
||||
android:textSize="20sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<ImageView
|
||||
@@ -213,7 +213,7 @@
|
||||
android:gravity="center_vertical"
|
||||
android:textColor="#FF141428"
|
||||
android:textColorHint="#FF96A0AA"
|
||||
android:textSize="22sp"
|
||||
android:textSize="20sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<ImageView
|
||||
|
||||
Reference in New Issue
Block a user