|
@@ -71,7 +71,7 @@ class DailyPaymentListActivity : BaseActivity<ActivityDaliyPaymentListBinding>()
|
|
|
dailyPaymentListRequest.pageSize = 10
|
|
|
|
|
|
initTitle()
|
|
|
-
|
|
|
+ initViews()
|
|
|
//先获取筛选列表信息,再初始化界面
|
|
|
initSiftItems()
|
|
|
}
|
|
@@ -79,7 +79,7 @@ class DailyPaymentListActivity : BaseActivity<ActivityDaliyPaymentListBinding>()
|
|
|
override fun onStart() {
|
|
|
super.onStart()
|
|
|
|
|
|
- initViews()
|
|
|
+ getDailyPaymentList()
|
|
|
}
|
|
|
|
|
|
override fun initTitle() {
|
|
@@ -106,19 +106,10 @@ class DailyPaymentListActivity : BaseActivity<ActivityDaliyPaymentListBinding>()
|
|
|
}
|
|
|
|
|
|
override fun initViews() {
|
|
|
-
|
|
|
- if (!OASystem.authorization(OASystem.DAILY_PAYMENT, OASystem.PROCESS)) {
|
|
|
- binding.createUser.text = OASystem.userInfo.cnName
|
|
|
- }
|
|
|
-
|
|
|
- binding.dailyPaymentContainer.setRefreshHeader(ClassicsHeader(OASystem.context))
|
|
|
- binding.dailyPaymentContainer.setRefreshFooter(ClassicsFooter(OASystem.context))
|
|
|
-
|
|
|
- initDailyPaymentList(1)
|
|
|
+ binding.commit.setText(resources.getString(R.string.sift))
|
|
|
}
|
|
|
|
|
|
override fun initEvents() {
|
|
|
-
|
|
|
initSiftOnClickListener()
|
|
|
}
|
|
|
|
|
@@ -197,9 +188,21 @@ class DailyPaymentListActivity : BaseActivity<ActivityDaliyPaymentListBinding>()
|
|
|
text = data.name
|
|
|
|
|
|
if (binding.paymentType.text == data.name) {
|
|
|
- setTextColor(ResourcesCompat.getColor(resources, R.color.text_color_blue, null))
|
|
|
+ setTextColor(
|
|
|
+ ResourcesCompat.getColor(
|
|
|
+ resources,
|
|
|
+ R.color.text_color_blue,
|
|
|
+ null
|
|
|
+ )
|
|
|
+ )
|
|
|
} else {
|
|
|
- setTextColor(ResourcesCompat.getColor(resources, R.color.text_color, null))
|
|
|
+ setTextColor(
|
|
|
+ ResourcesCompat.getColor(
|
|
|
+ resources,
|
|
|
+ R.color.text_color,
|
|
|
+ null
|
|
|
+ )
|
|
|
+ )
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -255,9 +258,21 @@ class DailyPaymentListActivity : BaseActivity<ActivityDaliyPaymentListBinding>()
|
|
|
text = data.name
|
|
|
|
|
|
if (binding.paymentSubType.text == data.name) {
|
|
|
- setTextColor(ResourcesCompat.getColor(resources, R.color.text_color_blue, null))
|
|
|
+ setTextColor(
|
|
|
+ ResourcesCompat.getColor(
|
|
|
+ resources,
|
|
|
+ R.color.text_color_blue,
|
|
|
+ null
|
|
|
+ )
|
|
|
+ )
|
|
|
} else {
|
|
|
- setTextColor(ResourcesCompat.getColor(resources, R.color.text_color, null))
|
|
|
+ setTextColor(
|
|
|
+ ResourcesCompat.getColor(
|
|
|
+ resources,
|
|
|
+ R.color.text_color,
|
|
|
+ null
|
|
|
+ )
|
|
|
+ )
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -305,9 +320,21 @@ class DailyPaymentListActivity : BaseActivity<ActivityDaliyPaymentListBinding>()
|
|
|
text = data.cnName
|
|
|
|
|
|
if (binding.createUser.text == data.cnName) {
|
|
|
- setTextColor(ResourcesCompat.getColor(resources, R.color.text_color_blue, null))
|
|
|
+ setTextColor(
|
|
|
+ ResourcesCompat.getColor(
|
|
|
+ resources,
|
|
|
+ R.color.text_color_blue,
|
|
|
+ null
|
|
|
+ )
|
|
|
+ )
|
|
|
} else {
|
|
|
- setTextColor(ResourcesCompat.getColor(resources, R.color.text_color, null))
|
|
|
+ setTextColor(
|
|
|
+ ResourcesCompat.getColor(
|
|
|
+ resources,
|
|
|
+ R.color.text_color,
|
|
|
+ null
|
|
|
+ )
|
|
|
+ )
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -378,11 +405,14 @@ class DailyPaymentListActivity : BaseActivity<ActivityDaliyPaymentListBinding>()
|
|
|
|
|
|
dailyPaymentCardListItems.clear()
|
|
|
|
|
|
+ binding.commit.setButtonStatus(1)
|
|
|
+
|
|
|
initDailyPaymentList(1)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
private fun initDailyPaymentList(type: Int) {
|
|
|
+
|
|
|
if (!listInit) {
|
|
|
apiService.getDailyPaymentList(dailyPaymentListRequest)
|
|
|
.enqueue(object : Callback<DailyPaymentListResponse> {
|
|
@@ -393,6 +423,7 @@ class DailyPaymentListActivity : BaseActivity<ActivityDaliyPaymentListBinding>()
|
|
|
val dailyPaymentResponse = response.body()
|
|
|
if (dailyPaymentResponse != null) {
|
|
|
if (dailyPaymentResponse.code == 200) {
|
|
|
+
|
|
|
for (item in dailyPaymentResponse.data.dataList) {
|
|
|
dailyPaymentCardListItems.add(item)
|
|
|
}
|
|
@@ -436,9 +467,12 @@ class DailyPaymentListActivity : BaseActivity<ActivityDaliyPaymentListBinding>()
|
|
|
showMessage(dailyPaymentResponse.msg)
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ binding.commit.setButtonStatus(0)
|
|
|
}
|
|
|
|
|
|
override fun onFailure(call: Call<DailyPaymentListResponse>, t: Throwable) {
|
|
|
+ binding.commit.setButtonStatus(0)
|
|
|
showMessage(resources.getString(R.string.network_error))
|
|
|
}
|
|
|
})
|
|
@@ -535,7 +569,8 @@ class DailyPaymentListActivity : BaseActivity<ActivityDaliyPaymentListBinding>()
|
|
|
text = resources.getString(R.string.not_pay)
|
|
|
setTextColor(Color.rgb(23, 171, 227))
|
|
|
}
|
|
|
- itemView.findViewById<ImageView>(R.id.is_pay_icon).setImageResource(R.mipmap.icon_wait)
|
|
|
+ itemView.findViewById<ImageView>(R.id.is_pay_icon)
|
|
|
+ .setImageResource(R.mipmap.icon_wait)
|
|
|
}
|
|
|
|
|
|
1 -> {
|
|
@@ -543,7 +578,8 @@ class DailyPaymentListActivity : BaseActivity<ActivityDaliyPaymentListBinding>()
|
|
|
text = resources.getString(R.string.paid)
|
|
|
setTextColor(Color.rgb(84, 213, 77))
|
|
|
}
|
|
|
- itemView.findViewById<ImageView>(R.id.is_pay_icon).setImageResource(R.mipmap.icon_passed)
|
|
|
+ itemView.findViewById<ImageView>(R.id.is_pay_icon)
|
|
|
+ .setImageResource(R.mipmap.icon_passed)
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -628,4 +664,15 @@ class DailyPaymentListActivity : BaseActivity<ActivityDaliyPaymentListBinding>()
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
+
|
|
|
+ private fun getDailyPaymentList() {
|
|
|
+ if (!OASystem.authorization(OASystem.DAILY_PAYMENT, OASystem.PROCESS)) {
|
|
|
+ binding.createUser.text = OASystem.userInfo.cnName
|
|
|
+ }
|
|
|
+
|
|
|
+ binding.dailyPaymentContainer.setRefreshHeader(ClassicsHeader(OASystem.context))
|
|
|
+ binding.dailyPaymentContainer.setRefreshFooter(ClassicsFooter(OASystem.context))
|
|
|
+
|
|
|
+ initDailyPaymentList(1)
|
|
|
+ }
|
|
|
}
|