|
@@ -43,6 +43,7 @@ import com.pan_american.android.data.model.group_invite_official.official_visits
|
|
|
import com.pan_american.android.data.model.group_invite_official.official_visits.network.DeleteOfficialVisitPic
|
|
|
import com.pan_american.android.data.model.group_invite_official.official_visits.network.GetOfficialVisitDetailRequest
|
|
|
import com.pan_american.android.data.model.group_invite_official.official_visits.network.GetOfficialVisitDetailResponse
|
|
|
+import com.pan_american.android.data.model.group_invite_official.official_visits.network.UpdateOfficialVisitCheckCommitRequest
|
|
|
import com.pan_american.android.data.model.group_invite_official.official_visits.network.UpdateOfficialVisitRequest
|
|
|
import com.pan_american.android.data.model.group_invite_official.official_visits.network.UpdateOfficialVisitResponse
|
|
|
import com.pan_american.android.data.network.APIService
|
|
@@ -86,6 +87,8 @@ class AddOfficialVisitsActivity : BaseActivity<ActivityAddOfficialVisitsBinding>
|
|
|
|
|
|
private var officialTypeId = 0
|
|
|
|
|
|
+ private var checkCommitType = 0
|
|
|
+
|
|
|
private val updateOfficialVisitRequest = UpdateOfficialVisitRequest()
|
|
|
|
|
|
//监听相册事件回调
|
|
@@ -152,9 +155,51 @@ class AddOfficialVisitsActivity : BaseActivity<ActivityAddOfficialVisitsBinding>
|
|
|
override fun initViews() {
|
|
|
if (fromList) {
|
|
|
getOfficialVisitsDetail()
|
|
|
+
|
|
|
+ if (!OASystem.authorization(OASystem.OFFICIAL_VISITS, OASystem.EDIT)) {
|
|
|
+ binding.apply {
|
|
|
+ country.isEnabled = false
|
|
|
+ area.isEnabled = false
|
|
|
+ officialDepartment.isEnabled(false)
|
|
|
+ officialDate.isEnabled = false
|
|
|
+ officialTime.isEnabled = false
|
|
|
+ invitor.isEnabled = false
|
|
|
+ officialContactJob.isEnabled(false)
|
|
|
+ officialContact.isEnabled = false
|
|
|
+ phone.isEnabled = false
|
|
|
+ officialType.isEnabled = false
|
|
|
+ dressDemand.isEnabled = false
|
|
|
+ industry.isEnabled = false
|
|
|
+ needTranslatorYes.isEnabled = false
|
|
|
+ needTranslatorNo.isEnabled = false
|
|
|
+ translator.isEnabled = false
|
|
|
+ translateLanguage.isEnabled = false
|
|
|
+ isPayYes.isEnabled = false
|
|
|
+ isPayNo.isEnabled = false
|
|
|
+ isApprovalYes.isEnabled = false
|
|
|
+ isApprovalNo.isEnabled = false
|
|
|
+ officialLocation.isEnabled(false)
|
|
|
+ officialBackground.isEnabled(false)
|
|
|
+ officialRequestExample.isEnabled(false)
|
|
|
+ provisionalAgenda.isEnabled(false)
|
|
|
+ participationMember.isEnabled(false)
|
|
|
+ addEmailScreenshot.visibility = View.GONE
|
|
|
+ commit.setText(resources.getString(R.string.back))
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ when(checkCommitType) {
|
|
|
+ 0 -> {
|
|
|
+ binding.checkCommit.setText(resources.getString(R.string.check_commit))
|
|
|
+ }
|
|
|
+
|
|
|
+ 1 -> {
|
|
|
+ binding.checkCommit.setText(resources.getString(R.string.check_cancel))
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
- binding.checkCommit.setText(resources.getString(R.string.check_commit))
|
|
|
+
|
|
|
binding.commit.setText(resources.getString(R.string.save))
|
|
|
|
|
|
if (OASystem.authorization(OASystem.OFFICIAL_VISITS, OASystem.PROCESS)) {
|
|
@@ -264,6 +309,12 @@ class AddOfficialVisitsActivity : BaseActivity<ActivityAddOfficialVisitsBinding>
|
|
|
}
|
|
|
|
|
|
binding.commit.setOnClickListener {
|
|
|
+
|
|
|
+ if (!OASystem.authorization(OASystem.OFFICIAL_VISITS, OASystem.EDIT)) {
|
|
|
+ back()
|
|
|
+ return@setOnClickListener
|
|
|
+ }
|
|
|
+
|
|
|
binding.country.text.apply {
|
|
|
if (isNotBlank()) {
|
|
|
updateOfficialVisitRequest.country = this.toString()
|
|
@@ -470,6 +521,10 @@ class AddOfficialVisitsActivity : BaseActivity<ActivityAddOfficialVisitsBinding>
|
|
|
|
|
|
updateOfficialVisitData()
|
|
|
}
|
|
|
+
|
|
|
+ binding.checkCommit.setOnClickListener {
|
|
|
+ updateOfficialVisitCheckStatus()
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
override fun onRequestPermissionsResult(
|
|
@@ -545,6 +600,7 @@ class AddOfficialVisitsActivity : BaseActivity<ActivityAddOfficialVisitsBinding>
|
|
|
binding.country.setText(country)
|
|
|
binding.area.setText(area)
|
|
|
binding.officialDepartment.setText(client)
|
|
|
+ checkCommitType = confirmTheInvitation
|
|
|
binding.officialDate.text = date
|
|
|
binding.officialTime.text = time
|
|
|
|
|
@@ -954,6 +1010,40 @@ class AddOfficialVisitsActivity : BaseActivity<ActivityAddOfficialVisitsBinding>
|
|
|
})
|
|
|
}
|
|
|
|
|
|
+ private fun updateOfficialVisitCheckStatus() {
|
|
|
+ apiService.updateOfficialVisitCheckCommit(UpdateOfficialVisitCheckCommitRequest(officialVisitId, checkCommitType)).enqueue(object : Callback<BaseResponse> {
|
|
|
+ override fun onResponse(call: Call<BaseResponse>, response: Response<BaseResponse>) {
|
|
|
+
|
|
|
+ val updateResponse = response.body()
|
|
|
+
|
|
|
+ if (updateResponse != null) {
|
|
|
+ if (updateResponse.code == 200) {
|
|
|
+ showMessage(resources.getString(R.string.confirm_success))
|
|
|
+
|
|
|
+ when(checkCommitType) {
|
|
|
+ 0 -> {
|
|
|
+ checkCommitType = 1
|
|
|
+ binding.checkCommit.setText(resources.getString(R.string.check_cancel))
|
|
|
+ }
|
|
|
+
|
|
|
+ 1 -> {
|
|
|
+ checkCommitType = 0
|
|
|
+ binding.checkCommit.setText(resources.getString(R.string.check_commit))
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ } else {
|
|
|
+ showMessage(updateResponse.msg)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ override fun onFailure(p0: Call<BaseResponse>, p1: Throwable) {
|
|
|
+ showErrorInfo(R.string.interface_request_error)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
private fun uploadPic() {
|
|
|
|
|
|
if (fromList) {
|