|
@@ -21,6 +21,7 @@ class DocumentFragment : BaseFragment<FragmentDocumentBinding>(), OnClickListene
|
|
|
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
|
|
super.onViewCreated(view, savedInstanceState)
|
|
|
|
|
|
+ initViews()
|
|
|
initEvents()
|
|
|
}
|
|
|
|
|
@@ -49,146 +50,156 @@ class DocumentFragment : BaseFragment<FragmentDocumentBinding>(), OnClickListene
|
|
|
binding.reimbursementForm.setOnClickListener(this)
|
|
|
}
|
|
|
|
|
|
-// override fun initViews() {
|
|
|
-//
|
|
|
-// for (item in OASystem.authData) {
|
|
|
-// when (item.pageId) {
|
|
|
-//
|
|
|
-// OASystem.HOTEL_PREDETERMINE -> {
|
|
|
-// if (OASystem.authorization(OASystem.HOTEL_PREDETERMINE, OASystem.DOWNLOAD)) {
|
|
|
-// if (binding.groupHotel.visibility == View.GONE) {
|
|
|
-// binding.groupHotel.visibility = View.VISIBLE
|
|
|
-// }
|
|
|
-//
|
|
|
-// binding.voucher.setOnClickListener(this)
|
|
|
-// binding.confirmList.setOnClickListener(this)
|
|
|
-// binding.predetermineCost.setOnClickListener(this)
|
|
|
-//
|
|
|
-// if (OASystem.userInfo.depName == "市场部") {
|
|
|
-// binding.predetermineCost.visibility = View.GONE
|
|
|
-// }
|
|
|
-// }
|
|
|
-// }
|
|
|
-//
|
|
|
-// OASystem.AIRPLANE_PAYMENT_INSERT -> {
|
|
|
-// if (OASystem.authorization(OASystem.AIRPLANE_PAYMENT_INSERT, OASystem.DOWNLOAD)) {
|
|
|
-// if (binding.groupAirplaneTicket.visibility == View.GONE) {
|
|
|
-// binding.groupAirplaneTicket.visibility = View.VISIBLE
|
|
|
-// }
|
|
|
-//
|
|
|
-// binding.airplaneReportForm.setOnClickListener(this)
|
|
|
-// binding.chTravelItinerary.setOnClickListener(this)
|
|
|
-// binding.enTravelItinerary.setOnClickListener(this)
|
|
|
-//
|
|
|
-// if (OASystem.userInfo.depName == "市场部") {
|
|
|
-// binding.airplaneReportForm.visibility = View.GONE
|
|
|
-// }
|
|
|
-// }
|
|
|
-// }
|
|
|
-//
|
|
|
-// OASystem.OP_TRAVEL_ITINERARY -> {
|
|
|
-// if (OASystem.authorization(OASystem.OP_TRAVEL_ITINERARY, OASystem.DOWNLOAD)) {
|
|
|
-// if (binding.groupOp.visibility == View.GONE) {
|
|
|
-// binding.groupOp.visibility = View.VISIBLE
|
|
|
-// }
|
|
|
-//
|
|
|
-// binding.opTravelItineraryWord.setOnClickListener(this)
|
|
|
-// binding.opTravelItineraryPdf.setOnClickListener(this)
|
|
|
-// }
|
|
|
-// }
|
|
|
-//
|
|
|
-// OASystem.GROUP_CLIENT_LIST -> {
|
|
|
-// if (OASystem.authorization(OASystem.GROUP_CLIENT_LIST, OASystem.DOWNLOAD)) {
|
|
|
-// if (binding.groupManager.visibility == View.GONE) {
|
|
|
-// binding.groupManager.visibility = View.VISIBLE
|
|
|
-// }
|
|
|
-//
|
|
|
-// binding.groupCustomerListCh.visibility = View.VISIBLE
|
|
|
-// binding.groupCustomerListCh.setOnClickListener(this)
|
|
|
-//
|
|
|
-// binding.groupCustomerListEn.visibility = View.VISIBLE
|
|
|
-// binding.groupCustomerListEn.setOnClickListener(this)
|
|
|
-// }
|
|
|
-// }
|
|
|
-//
|
|
|
-// OASystem.REVERSE_TABLE -> {
|
|
|
-// if (OASystem.authorization(OASystem.REVERSE_TABLE, OASystem.DOWNLOAD)) {
|
|
|
-// if (binding.groupManager.visibility == View.GONE) {
|
|
|
-// binding.groupManager.visibility = View.VISIBLE
|
|
|
-// }
|
|
|
-//
|
|
|
-// binding.reverseTable.visibility = View.VISIBLE
|
|
|
-// binding.reverseTable.setOnClickListener(this)
|
|
|
-// }
|
|
|
-// }
|
|
|
-//
|
|
|
-// OASystem.ENTER_AND_LEAVE_PAYMENT_DETAIL -> {
|
|
|
-// if (OASystem.authorization(OASystem.ENTER_AND_LEAVE_PAYMENT_DETAIL, OASystem.DOWNLOAD)) {
|
|
|
-// if (binding.groupManager.visibility == View.GONE) {
|
|
|
-// binding.groupManager.visibility = View.VISIBLE
|
|
|
-// }
|
|
|
-//
|
|
|
-// binding.foundsExamineForm.visibility = View.VISIBLE
|
|
|
-// binding.foundsExamineForm.setOnClickListener(this)
|
|
|
-//
|
|
|
-// binding.foundsCalculateForm.visibility = View.VISIBLE
|
|
|
-// binding.foundsCalculateForm.setOnClickListener(this)
|
|
|
-//
|
|
|
-// binding.provinceExamineForm.visibility = View.VISIBLE
|
|
|
-// binding.provinceExamineForm.setOnClickListener(this)
|
|
|
-//
|
|
|
-// binding.cityExamineForm.visibility = View.VISIBLE
|
|
|
-// binding.cityExamineForm.setOnClickListener(this)
|
|
|
-//
|
|
|
-// binding.leaveExamineForm.visibility = View.VISIBLE
|
|
|
-// binding.leaveExamineForm.setOnClickListener(this)
|
|
|
-//
|
|
|
-// binding.reimbursementForm.visibility = View.VISIBLE
|
|
|
-// binding.reimbursementForm.setOnClickListener(this)
|
|
|
-// }
|
|
|
-// }
|
|
|
-// }
|
|
|
-// }
|
|
|
-// }
|
|
|
+ override fun initViews() {
|
|
|
+
|
|
|
+ for (item in OASystem.authData) {
|
|
|
+ when (item.pageId) {
|
|
|
+
|
|
|
+ OASystem.HOTEL_PREDETERMINE -> {
|
|
|
+ if (OASystem.authorization(OASystem.HOTEL_PREDETERMINE, OASystem.DOWNLOAD)) {
|
|
|
+ if (binding.groupHotel.visibility == View.GONE) {
|
|
|
+ binding.groupHotel.visibility = View.VISIBLE
|
|
|
+ }
|
|
|
+
|
|
|
+ binding.voucher.setOnClickListener(this)
|
|
|
+ binding.confirmList.setOnClickListener(this)
|
|
|
+ binding.predetermineCost.setOnClickListener(this)
|
|
|
+
|
|
|
+ if (isShownHotelCost()) {
|
|
|
+ binding.predetermineCost.visibility = View.VISIBLE
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ OASystem.AIRPLANE_PAYMENT_INSERT -> {
|
|
|
+ if (OASystem.authorization(OASystem.AIRPLANE_PAYMENT_INSERT, OASystem.DOWNLOAD)) {
|
|
|
+ if (binding.groupAirplaneTicket.visibility == View.GONE) {
|
|
|
+ binding.groupAirplaneTicket.visibility = View.VISIBLE
|
|
|
+ }
|
|
|
+
|
|
|
+ binding.airplaneReportForm.setOnClickListener(this)
|
|
|
+ binding.chTravelItinerary.setOnClickListener(this)
|
|
|
+ binding.enTravelItinerary.setOnClickListener(this)
|
|
|
+
|
|
|
+ if (isShownAirplaneCost()) {
|
|
|
+ binding.airplaneReportForm.visibility = View.VISIBLE
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ OASystem.OP_TRAVEL_ITINERARY -> {
|
|
|
+ if (OASystem.authorization(OASystem.OP_TRAVEL_ITINERARY, OASystem.DOWNLOAD)) {
|
|
|
+ if (binding.groupOp.visibility == View.GONE) {
|
|
|
+ binding.groupOp.visibility = View.VISIBLE
|
|
|
+ }
|
|
|
+
|
|
|
+ binding.opTravelItineraryWord.setOnClickListener(this)
|
|
|
+ binding.opTravelItineraryPdf.setOnClickListener(this)
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ OASystem.GROUP_CLIENT_LIST -> {
|
|
|
+ if (OASystem.authorization(OASystem.GROUP_CLIENT_LIST, OASystem.DOWNLOAD)) {
|
|
|
+ if (binding.groupManager.visibility == View.GONE) {
|
|
|
+ binding.groupManager.visibility = View.VISIBLE
|
|
|
+ }
|
|
|
+
|
|
|
+ binding.groupCustomerListCh.visibility = View.VISIBLE
|
|
|
+ binding.groupCustomerListCh.setOnClickListener(this)
|
|
|
+
|
|
|
+ binding.groupCustomerListEn.visibility = View.VISIBLE
|
|
|
+ binding.groupCustomerListEn.setOnClickListener(this)
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ OASystem.REVERSE_TABLE -> {
|
|
|
+ if (OASystem.authorization(OASystem.REVERSE_TABLE, OASystem.DOWNLOAD)) {
|
|
|
+ if (binding.groupManager.visibility == View.GONE) {
|
|
|
+ binding.groupManager.visibility = View.VISIBLE
|
|
|
+ }
|
|
|
+
|
|
|
+ binding.reverseTable.visibility = View.VISIBLE
|
|
|
+ binding.reverseTable.setOnClickListener(this)
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ OASystem.ENTER_AND_LEAVE_PAYMENT_DETAIL -> {
|
|
|
+ if (OASystem.authorization(OASystem.ENTER_AND_LEAVE_PAYMENT_DETAIL, OASystem.DOWNLOAD)) {
|
|
|
+ if (binding.groupManager.visibility == View.GONE) {
|
|
|
+ binding.groupManager.visibility = View.VISIBLE
|
|
|
+ }
|
|
|
+
|
|
|
+ binding.foundsExamineForm.visibility = View.VISIBLE
|
|
|
+ binding.foundsExamineForm.setOnClickListener(this)
|
|
|
+
|
|
|
+ binding.foundsCalculateForm.visibility = View.VISIBLE
|
|
|
+ binding.foundsCalculateForm.setOnClickListener(this)
|
|
|
+
|
|
|
+ binding.provinceExamineForm.visibility = View.VISIBLE
|
|
|
+ binding.provinceExamineForm.setOnClickListener(this)
|
|
|
+
|
|
|
+ binding.cityExamineForm.visibility = View.VISIBLE
|
|
|
+ binding.cityExamineForm.setOnClickListener(this)
|
|
|
+
|
|
|
+ binding.leaveExamineForm.visibility = View.VISIBLE
|
|
|
+ binding.leaveExamineForm.setOnClickListener(this)
|
|
|
+
|
|
|
+ binding.reimbursementForm.visibility = View.VISIBLE
|
|
|
+ binding.reimbursementForm.setOnClickListener(this)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
override fun onClick(view: View) {
|
|
|
|
|
|
val intent = Intent(OASystem.context, DocumentGroupListActivity::class.java)
|
|
|
|
|
|
var tag = ""
|
|
|
+ var cTable = 0
|
|
|
|
|
|
when(view.id) {
|
|
|
binding.voucher.id -> {
|
|
|
tag = "voucher"
|
|
|
-
|
|
|
+ cTable = OASystem.C_TABLE_HOTEL_PREDETERMINE
|
|
|
}
|
|
|
|
|
|
binding.confirmList.id -> {
|
|
|
tag = "confirmList"
|
|
|
+ cTable = OASystem.C_TABLE_HOTEL_PREDETERMINE
|
|
|
}
|
|
|
|
|
|
binding.predetermineCost.id -> {
|
|
|
tag = "predetermineCost"
|
|
|
+ cTable = OASystem.C_TABLE_HOTEL_PREDETERMINE
|
|
|
}
|
|
|
|
|
|
binding.airplaneReportForm.id -> {
|
|
|
tag = "airplaneReportForm"
|
|
|
+ cTable = OASystem.C_TABLE_AIRPLANE_TICKET
|
|
|
}
|
|
|
|
|
|
binding.chTravelItinerary.id -> {
|
|
|
tag = "chTravelItinerary"
|
|
|
+ cTable = OASystem.C_TABLE_AIRPLANE_TICKET
|
|
|
+
|
|
|
}
|
|
|
|
|
|
binding.enTravelItinerary.id -> {
|
|
|
tag = "enTravelItinerary"
|
|
|
+ cTable = OASystem.C_TABLE_AIRPLANE_TICKET
|
|
|
}
|
|
|
|
|
|
binding.opTravelItineraryWord.id -> {
|
|
|
tag = "opTravelItineraryWord"
|
|
|
+ cTable = OASystem.C_TABLE_GROUND_CONVEY
|
|
|
}
|
|
|
|
|
|
binding.opTravelItineraryPdf.id -> {
|
|
|
tag = "opTravelItineraryPdf"
|
|
|
+ cTable = OASystem.C_TABLE_GROUND_CONVEY
|
|
|
+
|
|
|
}
|
|
|
|
|
|
binding.groupCustomerListCh.id -> {
|
|
@@ -229,7 +240,24 @@ class DocumentFragment : BaseFragment<FragmentDocumentBinding>(), OnClickListene
|
|
|
}
|
|
|
|
|
|
intent.putExtra("tag", tag)
|
|
|
+ intent.putExtra("cTable", cTable)
|
|
|
|
|
|
startActivity(intent)
|
|
|
}
|
|
|
+
|
|
|
+ private fun isShownHotelCost(): Boolean {
|
|
|
+ return if (OASystem.userInfo.depName == "国交部") {
|
|
|
+ OASystem.userInfo.jobName == "酒店" || OASystem.userInfo.jobName == "经理" || OASystem.userInfo.jobName == "主管"
|
|
|
+ } else {
|
|
|
+ OASystem.userInfo.userId == 21
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private fun isShownAirplaneCost(): Boolean {
|
|
|
+ return if (OASystem.userInfo.depName == "国交部") {
|
|
|
+ OASystem.userInfo.jobName == "机票" || OASystem.userInfo.jobName == "经理" || OASystem.userInfo.jobName == "主管"
|
|
|
+ } else {
|
|
|
+ OASystem.userInfo.userId == 21
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|