|
@@ -1,6 +1,7 @@
|
|
|
package com.pan_american.android.ui.group_management.department_process
|
|
package com.pan_american.android.ui.group_management.department_process
|
|
|
|
|
|
|
|
import android.os.Bundle
|
|
import android.os.Bundle
|
|
|
|
|
+import android.util.Log
|
|
|
import android.view.Gravity
|
|
import android.view.Gravity
|
|
|
import android.view.View
|
|
import android.view.View
|
|
|
import android.view.ViewGroup
|
|
import android.view.ViewGroup
|
|
@@ -14,6 +15,7 @@ import androidx.core.content.res.ResourcesCompat
|
|
|
import androidx.core.widget.addTextChangedListener
|
|
import androidx.core.widget.addTextChangedListener
|
|
|
import androidx.recyclerview.widget.LinearLayoutManager
|
|
import androidx.recyclerview.widget.LinearLayoutManager
|
|
|
import androidx.recyclerview.widget.RecyclerView
|
|
import androidx.recyclerview.widget.RecyclerView
|
|
|
|
|
+import com.google.gson.Gson
|
|
|
import com.pan_american.android.OASystem
|
|
import com.pan_american.android.OASystem
|
|
|
import com.pan_american.android.R
|
|
import com.pan_american.android.R
|
|
|
import com.pan_american.android.base.BaseActivity
|
|
import com.pan_american.android.base.BaseActivity
|
|
@@ -27,6 +29,8 @@ import com.pan_american.android.data.model.group_management.department_process.e
|
|
|
import com.pan_american.android.data.model.group_management.department_process.entity.TaskDetail
|
|
import com.pan_american.android.data.model.group_management.department_process.entity.TaskDetail
|
|
|
import com.pan_american.android.data.model.group_management.department_process.network.GetDepartmentProcessDetailRequest
|
|
import com.pan_american.android.data.model.group_management.department_process.network.GetDepartmentProcessDetailRequest
|
|
|
import com.pan_american.android.data.model.group_management.department_process.network.GetDepartmentProcessDetailResponse
|
|
import com.pan_american.android.data.model.group_management.department_process.network.GetDepartmentProcessDetailResponse
|
|
|
|
|
+import com.pan_american.android.data.model.group_management.department_process.network.InitDepartmentBaseDataRequest
|
|
|
|
|
+import com.pan_american.android.data.model.group_management.department_process.network.InitDepartmentBaseDataResponse
|
|
|
import com.pan_american.android.databinding.ActivityDepartmentProcessDetailBinding
|
|
import com.pan_american.android.databinding.ActivityDepartmentProcessDetailBinding
|
|
|
import com.pan_american.android.databinding.LayoutTitleBinding
|
|
import com.pan_american.android.databinding.LayoutTitleBinding
|
|
|
import com.pan_american.android.util.ScrollEditText
|
|
import com.pan_american.android.util.ScrollEditText
|
|
@@ -40,6 +44,8 @@ class DepartmentProcessDetailActivity : BaseActivity<ActivityDepartmentProcessDe
|
|
|
|
|
|
|
|
private var fromList = false
|
|
private var fromList = false
|
|
|
|
|
|
|
|
|
|
+ private var editable = false
|
|
|
|
|
+
|
|
|
private var taskId = 0
|
|
private var taskId = 0
|
|
|
|
|
|
|
|
private val groupList = ArrayList<Selector>()
|
|
private val groupList = ArrayList<Selector>()
|
|
@@ -50,7 +56,7 @@ class DepartmentProcessDetailActivity : BaseActivity<ActivityDepartmentProcessDe
|
|
|
|
|
|
|
|
private val userList = ArrayList<Selector>()
|
|
private val userList = ArrayList<Selector>()
|
|
|
|
|
|
|
|
- private lateinit var departmentProcessDetail: DepartmentProcessDetail
|
|
|
|
|
|
|
+ private var departmentProcessDetail = DepartmentProcessDetail()
|
|
|
|
|
|
|
|
override fun getViewBinding() = ActivityDepartmentProcessDetailBinding.inflate(layoutInflater)
|
|
override fun getViewBinding() = ActivityDepartmentProcessDetailBinding.inflate(layoutInflater)
|
|
|
|
|
|
|
@@ -62,6 +68,9 @@ class DepartmentProcessDetailActivity : BaseActivity<ActivityDepartmentProcessDe
|
|
|
|
|
|
|
|
if (fromList) {
|
|
if (fromList) {
|
|
|
taskId = getIntExtra("task_id", 0)
|
|
taskId = getIntExtra("task_id", 0)
|
|
|
|
|
+ editable = getBooleanExtra("can_process", false)
|
|
|
|
|
+ } else {
|
|
|
|
|
+ editable = true
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -76,12 +85,43 @@ class DepartmentProcessDetailActivity : BaseActivity<ActivityDepartmentProcessDe
|
|
|
titleBinding = LayoutTitleBinding.bind(binding.root).apply {
|
|
titleBinding = LayoutTitleBinding.bind(binding.root).apply {
|
|
|
titleText.text = resources.getString(R.string.visa_process)
|
|
titleText.text = resources.getString(R.string.visa_process)
|
|
|
|
|
|
|
|
- rightTextField.visibility = View.VISIBLE
|
|
|
|
|
|
|
+ if (editable) {
|
|
|
|
|
+ rightTextField.visibility = View.VISIBLE
|
|
|
|
|
+
|
|
|
|
|
+ rightTextField.setText(R.string.save)
|
|
|
|
|
+
|
|
|
|
|
+ rightTextField.setOnClickListener {
|
|
|
|
|
+ if (binding.processName.text.isNullOrBlank()) {
|
|
|
|
|
+ showMessage(resources.getString(R.string.process_name_input_hint))
|
|
|
|
|
+ return@setOnClickListener
|
|
|
|
|
+ } else {
|
|
|
|
|
+ departmentProcessDetail.workOrder.name = binding.processName.text.toString()
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- rightTextField.setText(R.string.save)
|
|
|
|
|
|
|
+ if (binding.startTime.text.isNullOrBlank()) {
|
|
|
|
|
+ showMessage(resources.getString(R.string.start_time_select_hint))
|
|
|
|
|
+ return@setOnClickListener
|
|
|
|
|
+ } else {
|
|
|
|
|
+ departmentProcessDetail.workOrder.startTime =
|
|
|
|
|
+ binding.startTime.text.toString()
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (departmentProcessDetail.workOrder.groupId == 0) {
|
|
|
|
|
+ showMessage(resources.getString(R.string.association_group_selected_hint))
|
|
|
|
|
+ return@setOnClickListener
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (departmentProcessDetail.workOrder.assignedUserId == 0) {
|
|
|
|
|
+ showMessage(resources.getString(R.string.director_select_hint))
|
|
|
|
|
+ return@setOnClickListener
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- rightTextField.setOnClickListener {
|
|
|
|
|
- updateDepartmentProcess()
|
|
|
|
|
|
|
+ if (departmentProcessDetail.workOrder.foreignOptionId == 0) {
|
|
|
|
|
+ showMessage(resources.getString(R.string.foreign_affairs_select_hint))
|
|
|
|
|
+ return@setOnClickListener
|
|
|
|
|
+ }
|
|
|
|
|
+ updateDepartmentProcess()
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
backButton.setOnClickListener {
|
|
backButton.setOnClickListener {
|
|
@@ -96,6 +136,18 @@ class DepartmentProcessDetailActivity : BaseActivity<ActivityDepartmentProcessDe
|
|
|
} else {
|
|
} else {
|
|
|
getAddBaseData()
|
|
getAddBaseData()
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ if (!editable) {
|
|
|
|
|
+
|
|
|
|
|
+ binding.processName.isEnabled = false
|
|
|
|
|
+ binding.startTime.isEnabled = false
|
|
|
|
|
+ binding.associationGroup.isEnabled = false
|
|
|
|
|
+ binding.director.isEnabled = false
|
|
|
|
|
+ binding.foreignAffairsOption.isEnabled = false
|
|
|
|
|
+
|
|
|
|
|
+ binding.addMainMission.visibility = View.GONE
|
|
|
|
|
+ binding.addExtraMission.visibility = View.GONE
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
override fun initEvents() {
|
|
override fun initEvents() {
|
|
@@ -127,7 +179,9 @@ class DepartmentProcessDetailActivity : BaseActivity<ActivityDepartmentProcessDe
|
|
|
showDateAndTimePicker(
|
|
showDateAndTimePicker(
|
|
|
resources.getString(R.string.start_time_select_hint),
|
|
resources.getString(R.string.start_time_select_hint),
|
|
|
binding.startTime
|
|
binding.startTime
|
|
|
- )
|
|
|
|
|
|
|
+ ) {
|
|
|
|
|
+ departmentProcessDetail.workOrder.startTime = binding.startTime.text.toString()
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
binding.associationGroup.setOnClickListener {
|
|
binding.associationGroup.setOnClickListener {
|
|
@@ -176,7 +230,7 @@ class DepartmentProcessDetailActivity : BaseActivity<ActivityDepartmentProcessDe
|
|
|
)
|
|
)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- text = data.country
|
|
|
|
|
|
|
+ text = data.teamName
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}.create()
|
|
}.create()
|
|
@@ -189,6 +243,9 @@ class DepartmentProcessDetailActivity : BaseActivity<ActivityDepartmentProcessDe
|
|
|
|
|
|
|
|
binding.associationGroup.text = selectDataSource[position].teamName
|
|
binding.associationGroup.text = selectDataSource[position].teamName
|
|
|
|
|
|
|
|
|
|
+ departmentProcessDetail.workOrder.groupId =
|
|
|
|
|
+ selectDataSource[position].id
|
|
|
|
|
+
|
|
|
popupWindow.dismiss()
|
|
popupWindow.dismiss()
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -257,7 +314,7 @@ class DepartmentProcessDetailActivity : BaseActivity<ActivityDepartmentProcessDe
|
|
|
)
|
|
)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- text = data.country
|
|
|
|
|
|
|
+ text = data.cnName
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}.create()
|
|
}.create()
|
|
@@ -270,6 +327,9 @@ class DepartmentProcessDetailActivity : BaseActivity<ActivityDepartmentProcessDe
|
|
|
|
|
|
|
|
binding.director.text = selectDataSource[position].cnName
|
|
binding.director.text = selectDataSource[position].cnName
|
|
|
|
|
|
|
|
|
|
+ departmentProcessDetail.workOrder.assignedUserId =
|
|
|
|
|
+ selectDataSource[position].id
|
|
|
|
|
+
|
|
|
popupWindow.dismiss()
|
|
popupWindow.dismiss()
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -328,7 +388,7 @@ class DepartmentProcessDetailActivity : BaseActivity<ActivityDepartmentProcessDe
|
|
|
object : ListAdapter.OnRecyclerViewItemClick {
|
|
object : ListAdapter.OnRecyclerViewItemClick {
|
|
|
override fun onItemClick(position: Int) {
|
|
override fun onItemClick(position: Int) {
|
|
|
|
|
|
|
|
- OASystem.weight[position].apply {
|
|
|
|
|
|
|
+ foreignSelectionList[position].apply {
|
|
|
binding.foreignAffairsOption.text = name
|
|
binding.foreignAffairsOption.text = name
|
|
|
departmentProcessDetail.workOrder.foreignOptionId = id
|
|
departmentProcessDetail.workOrder.foreignOptionId = id
|
|
|
}
|
|
}
|
|
@@ -349,7 +409,58 @@ class DepartmentProcessDetailActivity : BaseActivity<ActivityDepartmentProcessDe
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private fun getAddBaseData() {
|
|
private fun getAddBaseData() {
|
|
|
|
|
+ OASystem.apiService.initDepartmentBaseData(InitDepartmentBaseDataRequest())
|
|
|
|
|
+ .enqueue(object : Callback<InitDepartmentBaseDataResponse> {
|
|
|
|
|
+ override fun onResponse(
|
|
|
|
|
+ call: Call<InitDepartmentBaseDataResponse?>,
|
|
|
|
|
+ response: Response<InitDepartmentBaseDataResponse?>
|
|
|
|
|
+ ) {
|
|
|
|
|
+ val dataResponse = response.body()
|
|
|
|
|
+
|
|
|
|
|
+ if (dataResponse != null) {
|
|
|
|
|
|
|
|
|
|
+ if (dataResponse.code == 200) {
|
|
|
|
|
+
|
|
|
|
|
+ for (item in dataResponse.data.groupList) {
|
|
|
|
|
+ groupList.add(item)
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ for (item in dataResponse.data.taskLv) {
|
|
|
|
|
+ taskLevelList.add(item)
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ for (item in dataResponse.data.foreignLv) {
|
|
|
|
|
+ foreignSelectionList.add(item)
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ for (item in dataResponse.data.users) {
|
|
|
|
|
+ userList.add(item)
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ for (item in dataResponse.data.defaultTask) {
|
|
|
|
|
+ departmentProcessDetail.mainTask.add(item)
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ initDetailView()
|
|
|
|
|
+
|
|
|
|
|
+ } else {
|
|
|
|
|
+ showErrorInfo(R.string.base_resource_data_get_failed)
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ } else {
|
|
|
|
|
+ showErrorInfo(R.string.interface_request_error)
|
|
|
|
|
+ finish()
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ override fun onFailure(
|
|
|
|
|
+ call: Call<InitDepartmentBaseDataResponse?>,
|
|
|
|
|
+ t: Throwable
|
|
|
|
|
+ ) {
|
|
|
|
|
+ showErrorInfo(R.string.network_error)
|
|
|
|
|
+ finish()
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private fun getProcessDetail(taskId: Int) {
|
|
private fun getProcessDetail(taskId: Int) {
|
|
@@ -433,13 +544,13 @@ class DepartmentProcessDetailActivity : BaseActivity<ActivityDepartmentProcessDe
|
|
|
departmentProcessDetail.mainTask,
|
|
departmentProcessDetail.mainTask,
|
|
|
priorityList = taskLevelList,
|
|
priorityList = taskLevelList,
|
|
|
directorList = userList,
|
|
directorList = userList,
|
|
|
- assignedUserId = departmentProcessDetail.workOrder.assignedUserId
|
|
|
|
|
|
|
+ editable = editable
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
val extraAdapter = CardAdapter.Builder<TaskDetail>().apply {
|
|
val extraAdapter = CardAdapter.Builder<TaskDetail>().apply {
|
|
|
setData(departmentProcessDetail.extraTask)
|
|
setData(departmentProcessDetail.extraTask)
|
|
|
setLayoutId(R.layout.item_mission_detail_list)
|
|
setLayoutId(R.layout.item_mission_detail_list)
|
|
|
- setCanDelete(departmentProcessDetail.workOrder.assignedUserId == OASystem.userInfo.userId)
|
|
|
|
|
|
|
+ setCanDelete(editable)
|
|
|
addBindView { itemView, data ->
|
|
addBindView { itemView, data ->
|
|
|
itemView.findViewById<TextView>(R.id.mission_name).text = data.name
|
|
itemView.findViewById<TextView>(R.id.mission_name).text = data.name
|
|
|
itemView.findViewById<TextView>(R.id.priority).apply {
|
|
itemView.findViewById<TextView>(R.id.priority).apply {
|
|
@@ -520,7 +631,9 @@ class DepartmentProcessDetailActivity : BaseActivity<ActivityDepartmentProcessDe
|
|
|
|
|
|
|
|
extraAdapter.onRecyclerViewItemClick = object : CardAdapter.OnRecyclerViewItemClick {
|
|
extraAdapter.onRecyclerViewItemClick = object : CardAdapter.OnRecyclerViewItemClick {
|
|
|
override fun onItemClick(position: Int) {
|
|
override fun onItemClick(position: Int) {
|
|
|
- updateExtraTask(position)
|
|
|
|
|
|
|
+ if (editable) {
|
|
|
|
|
+ updateExtraTask(position)
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
override fun onItemDelete(position: Int) {
|
|
override fun onItemDelete(position: Int) {
|
|
@@ -755,7 +868,7 @@ class DepartmentProcessDetailActivity : BaseActivity<ActivityDepartmentProcessDe
|
|
|
|
|
|
|
|
val searchSelectorView =
|
|
val searchSelectorView =
|
|
|
View.inflate(OASystem.context, R.layout.popup_list_selector_with_search, null)
|
|
View.inflate(OASystem.context, R.layout.popup_list_selector_with_search, null)
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// 创建嵌套的 popupWindow,使用局部变量
|
|
// 创建嵌套的 popupWindow,使用局部变量
|
|
|
val nestedPopupWindow = PopupWindow(
|
|
val nestedPopupWindow = PopupWindow(
|
|
|
searchSelectorView,
|
|
searchSelectorView,
|
|
@@ -773,7 +886,7 @@ class DepartmentProcessDetailActivity : BaseActivity<ActivityDepartmentProcessDe
|
|
|
animationStyle = R.style.AnimationBottomPopup
|
|
animationStyle = R.style.AnimationBottomPopup
|
|
|
isOutsideTouchable = true
|
|
isOutsideTouchable = true
|
|
|
isFocusable = true
|
|
isFocusable = true
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
setOnDismissListener {
|
|
setOnDismissListener {
|
|
|
// 嵌套窗口关闭时,恢复主窗口的外部点击关闭功能
|
|
// 嵌套窗口关闭时,恢复主窗口的外部点击关闭功能
|
|
|
mainPopupWindow.isOutsideTouchable = wasMainWindowOutsideTouchable
|
|
mainPopupWindow.isOutsideTouchable = wasMainWindowOutsideTouchable
|
|
@@ -851,24 +964,26 @@ class DepartmentProcessDetailActivity : BaseActivity<ActivityDepartmentProcessDe
|
|
|
// 保存主 popupWindow 的引用和状态,避免被嵌套窗口覆盖
|
|
// 保存主 popupWindow 的引用和状态,避免被嵌套窗口覆盖
|
|
|
val savedMainPopupWindow = mainPopupWindow
|
|
val savedMainPopupWindow = mainPopupWindow
|
|
|
val wasMainWindowOutsideTouchable = mainPopupWindow.isOutsideTouchable
|
|
val wasMainWindowOutsideTouchable = mainPopupWindow.isOutsideTouchable
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// 临时禁用主窗口的外部点击关闭功能,避免嵌套窗口关闭时主窗口也被关闭
|
|
// 临时禁用主窗口的外部点击关闭功能,避免嵌套窗口关闭时主窗口也被关闭
|
|
|
mainPopupWindow.isOutsideTouchable = false
|
|
mainPopupWindow.isOutsideTouchable = false
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
showDateAndTimePicker(
|
|
showDateAndTimePicker(
|
|
|
resources.getString(R.string.start_time_select_hint),
|
|
resources.getString(R.string.start_time_select_hint),
|
|
|
startTime
|
|
startTime
|
|
|
- )
|
|
|
|
|
-
|
|
|
|
|
|
|
+ ) {
|
|
|
|
|
+ taskDetail.startTime = startTime.text.toString() + ":00"
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
// showDateAndTimePicker 内部会调用 showPopupWindow,覆盖 popupWindow
|
|
// showDateAndTimePicker 内部会调用 showPopupWindow,覆盖 popupWindow
|
|
|
// showPopupWindow 在 block 执行前就设置了 dismiss 监听器,会将窗口 alpha 恢复为 1f
|
|
// showPopupWindow 在 block 执行前就设置了 dismiss 监听器,会将窗口 alpha 恢复为 1f
|
|
|
- // 我们需要立即重新设置 dismiss 监听器,确保遮罩层(主窗口的 alpha)不被恢复
|
|
|
|
|
|
|
+ // 立即重新设置 dismiss 监听器,确保遮罩层(主窗口的 alpha)不被恢复
|
|
|
val nestedDatePickerWindow = popupWindow
|
|
val nestedDatePickerWindow = popupWindow
|
|
|
// 立即重新设置 dismiss 监听器,覆盖 showPopupWindow 设置的监听器
|
|
// 立即重新设置 dismiss 监听器,覆盖 showPopupWindow 设置的监听器
|
|
|
nestedDatePickerWindow.setOnDismissListener {
|
|
nestedDatePickerWindow.setOnDismissListener {
|
|
|
// 注意:不要恢复窗口 alpha,因为遮罩层是主窗口的 alpha,应该保持 0.4f
|
|
// 注意:不要恢复窗口 alpha,因为遮罩层是主窗口的 alpha,应该保持 0.4f
|
|
|
// 只有当主窗口关闭时,才应该恢复窗口 alpha
|
|
// 只有当主窗口关闭时,才应该恢复窗口 alpha
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// 嵌套窗口关闭时,恢复主窗口的外部点击关闭功能和引用
|
|
// 嵌套窗口关闭时,恢复主窗口的外部点击关闭功能和引用
|
|
|
mainPopupWindow.isOutsideTouchable = wasMainWindowOutsideTouchable
|
|
mainPopupWindow.isOutsideTouchable = wasMainWindowOutsideTouchable
|
|
|
popupWindow = savedMainPopupWindow
|
|
popupWindow = savedMainPopupWindow
|
|
@@ -879,21 +994,23 @@ class DepartmentProcessDetailActivity : BaseActivity<ActivityDepartmentProcessDe
|
|
|
// 保存主 popupWindow 的引用和状态,避免被嵌套窗口覆盖
|
|
// 保存主 popupWindow 的引用和状态,避免被嵌套窗口覆盖
|
|
|
val savedMainPopupWindow = mainPopupWindow
|
|
val savedMainPopupWindow = mainPopupWindow
|
|
|
val wasMainWindowOutsideTouchable = mainPopupWindow.isOutsideTouchable
|
|
val wasMainWindowOutsideTouchable = mainPopupWindow.isOutsideTouchable
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// 临时禁用主窗口的外部点击关闭功能,避免嵌套窗口关闭时主窗口也被关闭
|
|
// 临时禁用主窗口的外部点击关闭功能,避免嵌套窗口关闭时主窗口也被关闭
|
|
|
mainPopupWindow.isOutsideTouchable = false
|
|
mainPopupWindow.isOutsideTouchable = false
|
|
|
-
|
|
|
|
|
- showDateAndTimePicker(resources.getString(R.string.end_time_select_hint), endTime)
|
|
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
|
|
+ showDateAndTimePicker(resources.getString(R.string.end_time_select_hint), endTime) {
|
|
|
|
|
+ taskDetail.endTime = endTime.text.toString() + ":00"
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
// showDateAndTimePicker 内部会调用 showPopupWindow,覆盖 popupWindow
|
|
// showDateAndTimePicker 内部会调用 showPopupWindow,覆盖 popupWindow
|
|
|
// showPopupWindow 在 block 执行前就设置了 dismiss 监听器,会将窗口 alpha 恢复为 1f
|
|
// showPopupWindow 在 block 执行前就设置了 dismiss 监听器,会将窗口 alpha 恢复为 1f
|
|
|
- // 我们需要立即重新设置 dismiss 监听器,确保遮罩层(主窗口的 alpha)不被恢复
|
|
|
|
|
|
|
+ // 重新设置 dismiss 监听器,确保遮罩层(主窗口的 alpha)不被恢复
|
|
|
val nestedDatePickerWindow = popupWindow
|
|
val nestedDatePickerWindow = popupWindow
|
|
|
// 立即重新设置 dismiss 监听器,覆盖 showPopupWindow 设置的监听器
|
|
// 立即重新设置 dismiss 监听器,覆盖 showPopupWindow 设置的监听器
|
|
|
nestedDatePickerWindow.setOnDismissListener {
|
|
nestedDatePickerWindow.setOnDismissListener {
|
|
|
// 注意:不要恢复窗口 alpha,因为遮罩层是主窗口的 alpha,应该保持 0.4f
|
|
// 注意:不要恢复窗口 alpha,因为遮罩层是主窗口的 alpha,应该保持 0.4f
|
|
|
// 只有当主窗口关闭时,才应该恢复窗口 alpha
|
|
// 只有当主窗口关闭时,才应该恢复窗口 alpha
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// 嵌套窗口关闭时,恢复主窗口的外部点击关闭功能和引用
|
|
// 嵌套窗口关闭时,恢复主窗口的外部点击关闭功能和引用
|
|
|
mainPopupWindow.isOutsideTouchable = wasMainWindowOutsideTouchable
|
|
mainPopupWindow.isOutsideTouchable = wasMainWindowOutsideTouchable
|
|
|
popupWindow = savedMainPopupWindow
|
|
popupWindow = savedMainPopupWindow
|
|
@@ -905,10 +1022,42 @@ class DepartmentProcessDetailActivity : BaseActivity<ActivityDepartmentProcessDe
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
confirm.setOnClickListener {
|
|
confirm.setOnClickListener {
|
|
|
|
|
+
|
|
|
|
|
+ if (missionName.text.isNullOrBlank()) {
|
|
|
|
|
+ showMessage(resources.getString(R.string.single_mission_name_input_hint))
|
|
|
|
|
+ return@setOnClickListener
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (taskDetail.priorityId == 0) {
|
|
|
|
|
+ showMessage(resources.getString(R.string.priority_select_hint))
|
|
|
|
|
+ return@setOnClickListener
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (taskDetail.assignedUserId == 0) {
|
|
|
|
|
+ showMessage(resources.getString(R.string.director_select_hint))
|
|
|
|
|
+ return@setOnClickListener
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (startTime.text.isNullOrBlank()) {
|
|
|
|
|
+ showMessage(resources.getString(R.string.start_time_select_hint))
|
|
|
|
|
+ return@setOnClickListener
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (endTime.text.isNullOrBlank()) {
|
|
|
|
|
+ showMessage(resources.getString(R.string.end_time_select_hint))
|
|
|
|
|
+ return@setOnClickListener
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (hours.text.isNullOrBlank()) {
|
|
|
|
|
+ showMessage(resources.getString(R.string.mission_finish_hours_input_hint))
|
|
|
|
|
+ return@setOnClickListener
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
taskDetail.apply {
|
|
taskDetail.apply {
|
|
|
name = missionName.text.toString()
|
|
name = missionName.text.toString()
|
|
|
durationHours = hours.text.toString().toDouble()
|
|
durationHours = hours.text.toString().toDouble()
|
|
|
this.remark = remark.getText()
|
|
this.remark = remark.getText()
|
|
|
|
|
+ workOrderId = taskId
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
mainPopupWindow.dismiss()
|
|
mainPopupWindow.dismiss()
|
|
@@ -931,6 +1080,8 @@ class DepartmentProcessDetailActivity : BaseActivity<ActivityDepartmentProcessDe
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ Log.e("request body", Gson().toJson(updateDepartmentProcessRequest))
|
|
|
|
|
+
|
|
|
OASystem.apiService.updateDepartmentProcess(updateDepartmentProcessRequest = updateDepartmentProcessRequest)
|
|
OASystem.apiService.updateDepartmentProcess(updateDepartmentProcessRequest = updateDepartmentProcessRequest)
|
|
|
.enqueue(object : Callback<BaseResponse> {
|
|
.enqueue(object : Callback<BaseResponse> {
|
|
|
override fun onResponse(
|
|
override fun onResponse(
|