|
|
@@ -2,10 +2,13 @@ package cn.muchinfo.rma.view.base.home.reviewset
|
|
|
|
|
|
import android.os.Bundle
|
|
|
import android.view.Gravity
|
|
|
+import androidx.lifecycle.MutableLiveData
|
|
|
import cn.muchinfo.rma.R
|
|
|
import cn.muchinfo.rma.lifecycle.bindOptional
|
|
|
import cn.muchinfo.rma.view.autoWidget.*
|
|
|
import cn.muchinfo.rma.view.base.BaseActivity
|
|
|
+import cn.muchinfo.rma.view.base.future.trade.itemView
|
|
|
+import cn.muchinfo.rma.view.base.home.contract.emptyView
|
|
|
import com.blankj.utilcode.util.ToastUtils
|
|
|
import mtp.polymer.com.autowidget.adapter.BaseAdapter
|
|
|
import org.jetbrains.anko.*
|
|
|
@@ -15,22 +18,53 @@ import org.jetbrains.anko.*
|
|
|
*/
|
|
|
class ReviewSettingActivity : BaseActivity<ReviewSettingViewModel>(){
|
|
|
|
|
|
- // 下拉刷新
|
|
|
- private lateinit var swipeToLayout: SwipeToLoadLayout
|
|
|
- private lateinit var statusLayout: StatusLayout
|
|
|
+ /** 客户资料审核 **/
|
|
|
+ val literature_review : MutableLiveData<Int> = MutableLiveData()
|
|
|
|
|
|
- private val tradeNormaladapter: BaseAdapter<String, ReviewSettingViewHolder> =
|
|
|
- BaseAdapter { _, _ ->
|
|
|
- ReviewSettingViewHolder(
|
|
|
- this,
|
|
|
- viewModel
|
|
|
- )
|
|
|
- }
|
|
|
+ /** 现货合同审核 **/
|
|
|
+ val spot_contract_review : MutableLiveData<Int> = MutableLiveData()
|
|
|
+
|
|
|
+ /** 点价审核 **/
|
|
|
+ val midpoints_audit_review : MutableLiveData<Int> = MutableLiveData()
|
|
|
+
|
|
|
+ /** 交收审核 ***/
|
|
|
+ val settlement_audit_review : MutableLiveData<Int> = MutableLiveData()
|
|
|
+
|
|
|
+ /** 发票审核 ***/
|
|
|
+ val audit_invoice_review : MutableLiveData<Int> = MutableLiveData()
|
|
|
+
|
|
|
+ /** 款项审核 **/
|
|
|
+ val payment_review : MutableLiveData<Int> = MutableLiveData()
|
|
|
+
|
|
|
+ /** 入库审核 ***/
|
|
|
+ val warehousing_audit_review : MutableLiveData<Int> = MutableLiveData()
|
|
|
+
|
|
|
+ /** 出库审核 **/
|
|
|
+ val outbound_review : MutableLiveData<Int> = MutableLiveData()
|
|
|
+
|
|
|
+ /** 生产入库审核 ***/
|
|
|
+ val production_inventory_audit : MutableLiveData<Int> = MutableLiveData()
|
|
|
+
|
|
|
+ /** 生产出库审核 ***/
|
|
|
+ val production_outgoing_audit : MutableLiveData<Int> = MutableLiveData()
|
|
|
|
|
|
override fun onCreate(savedInstanceState: Bundle?) {
|
|
|
super.onCreate(savedInstanceState)
|
|
|
verticalLayout {
|
|
|
viewModel.getSettingDataList()
|
|
|
+ viewModel.settingDataList.bindOptional(context){
|
|
|
+ literature_review.postValue(it?.customerauditflag)
|
|
|
+ spot_contract_review.postValue(it?.spotcontractauditflag)
|
|
|
+ midpoints_audit_review.postValue(it?.pointpriceauditflag)
|
|
|
+ settlement_audit_review.postValue(it?.deliveryauditflag)
|
|
|
+ audit_invoice_review.postValue(it?.invoiceauditflag)
|
|
|
+ payment_review.postValue(it?.moneyauditflag)
|
|
|
+ warehousing_audit_review.postValue(it?.buyinauditflag)
|
|
|
+ outbound_review.postValue(it?.selloutauditflag)
|
|
|
+ production_inventory_audit.postValue(it?.produceinauditflag)
|
|
|
+ production_outgoing_audit.postValue(it?.produceoutauditflag)
|
|
|
+
|
|
|
+ }
|
|
|
topBar {
|
|
|
commonLeftButton()
|
|
|
commonTitle {
|
|
|
@@ -41,43 +75,323 @@ class ReviewSettingActivity : BaseActivity<ReviewSettingViewModel>(){
|
|
|
frameLayout {
|
|
|
scrollView {
|
|
|
verticalLayout {
|
|
|
- statusLayout(contentBlock = {
|
|
|
- statusLayout = this
|
|
|
-// bindTaskStatus(viewModule.status)
|
|
|
- setRetryAction {
|
|
|
- viewModel.getSettingDataList()
|
|
|
- }
|
|
|
- swipeToLoadLayout {
|
|
|
- swipeToLayout = this
|
|
|
- setEnableRefresh(true)
|
|
|
- setEnableLoadMore(false)
|
|
|
- setOnRefreshListener {
|
|
|
- viewModel.getSettingDataList()
|
|
|
- }
|
|
|
- setEnableScrollContentWhenLoaded(false)
|
|
|
- setEnableLoadMoreWhenContentNotFull(false)
|
|
|
-
|
|
|
- // 未提交列表
|
|
|
- recyclerView {
|
|
|
- background = resources.getDrawable(R.color.white)
|
|
|
- adapter = tradeNormaladapter
|
|
|
- }.lparams(matchParent, matchParent)
|
|
|
- }
|
|
|
- }, emptyBlock = {
|
|
|
- emptyView(hint = resources.getString(R.string.now_no_data))
|
|
|
- }).lparams(matchParent, matchParent)
|
|
|
-
|
|
|
- viewModel.settingDataList.bindOptional(context) {
|
|
|
- if (it?.isEmpty() == true || it?.size == 0) {
|
|
|
- statusLayout.showEmpty()
|
|
|
- } else {
|
|
|
- if (swipeToLayout.getIsRefreshing()) {
|
|
|
- swipeToLayout.finishRefresh()
|
|
|
- }
|
|
|
- statusLayout.showSuccess()
|
|
|
- tradeNormaladapter.setNewData(it)
|
|
|
+ linearLayout {
|
|
|
+ gravity = Gravity.CENTER_VERTICAL
|
|
|
+ textView {
|
|
|
+ text = "客户资料审核"
|
|
|
+ textSizeAuto = 31
|
|
|
+ textColorInt = R.color.rma_black_33
|
|
|
+ }.lparams(wrapContent, wrapContent){
|
|
|
+ marginStart = autoSize(36)
|
|
|
}
|
|
|
- }
|
|
|
+
|
|
|
+ emptyView()
|
|
|
+
|
|
|
+ checkBox {
|
|
|
+ viewModel.settingDataList.bindOptional(context){
|
|
|
+ isChecked = it?.customerauditflag != 0
|
|
|
+ }
|
|
|
+ buttonDrawable = null
|
|
|
+ background = resources.getDrawable(R.drawable.checkbox_switch_selector)
|
|
|
+ setOnCheckedChangeListener { _, b ->
|
|
|
+ if (b){
|
|
|
+ literature_review.postValue(1)
|
|
|
+ }else{
|
|
|
+ literature_review.postValue(0)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }.lparams(autoSize(100), autoSize(100)) {
|
|
|
+ marginStart = autoSize(36)
|
|
|
+ }
|
|
|
+ }.lparams(matchParent, autoSize(100))
|
|
|
+
|
|
|
+ itemView()
|
|
|
+
|
|
|
+ linearLayout {
|
|
|
+ gravity = Gravity.CENTER_VERTICAL
|
|
|
+ textView {
|
|
|
+ text = "现货合同审核"
|
|
|
+ textSizeAuto = 31
|
|
|
+ textColorInt = R.color.rma_black_33
|
|
|
+ }.lparams(wrapContent, wrapContent){
|
|
|
+ marginStart = autoSize(36)
|
|
|
+ }
|
|
|
+
|
|
|
+ emptyView()
|
|
|
+
|
|
|
+ checkBox {
|
|
|
+ buttonDrawable = null
|
|
|
+ viewModel.settingDataList.bindOptional(context){
|
|
|
+ isChecked = it?.spotcontractauditflag != 0
|
|
|
+ }
|
|
|
+ background = resources.getDrawable(R.drawable.checkbox_switch_selector)
|
|
|
+ setOnCheckedChangeListener { _, b ->
|
|
|
+ if (b){
|
|
|
+ spot_contract_review.postValue(1)
|
|
|
+ }else{
|
|
|
+ spot_contract_review.postValue(0)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }.lparams(autoSize(100), autoSize(100)) {
|
|
|
+ marginStart = autoSize(36)
|
|
|
+ }
|
|
|
+ }.lparams(matchParent, autoSize(100))
|
|
|
+
|
|
|
+ itemView()
|
|
|
+
|
|
|
+ linearLayout {
|
|
|
+ gravity = Gravity.CENTER_VERTICAL
|
|
|
+ textView {
|
|
|
+ text = "点价审核"
|
|
|
+ textSizeAuto = 31
|
|
|
+ textColorInt = R.color.rma_black_33
|
|
|
+ }.lparams(wrapContent, wrapContent){
|
|
|
+ marginStart = autoSize(36)
|
|
|
+ }
|
|
|
+
|
|
|
+ emptyView()
|
|
|
+
|
|
|
+ checkBox {
|
|
|
+ buttonDrawable = null
|
|
|
+ viewModel.settingDataList.bindOptional(context){
|
|
|
+ isChecked = it?.pointpriceauditflag != 0
|
|
|
+ }
|
|
|
+ background = resources.getDrawable(R.drawable.checkbox_switch_selector)
|
|
|
+ setOnCheckedChangeListener { _, b ->
|
|
|
+ if (b){
|
|
|
+ midpoints_audit_review.postValue(1)
|
|
|
+ }else{
|
|
|
+ midpoints_audit_review.postValue(0)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }.lparams(autoSize(100), autoSize(100)) {
|
|
|
+ marginStart = autoSize(36)
|
|
|
+ }
|
|
|
+ }.lparams(matchParent, autoSize(100))
|
|
|
+
|
|
|
+ itemView()
|
|
|
+
|
|
|
+ linearLayout {
|
|
|
+ gravity = Gravity.CENTER_VERTICAL
|
|
|
+ textView {
|
|
|
+ text = "交收审核"
|
|
|
+ textSizeAuto = 31
|
|
|
+ textColorInt = R.color.rma_black_33
|
|
|
+ }.lparams(wrapContent, wrapContent){
|
|
|
+ marginStart = autoSize(36)
|
|
|
+ }
|
|
|
+
|
|
|
+ emptyView()
|
|
|
+
|
|
|
+ checkBox {
|
|
|
+ buttonDrawable = null
|
|
|
+ viewModel.settingDataList.bindOptional(context){
|
|
|
+ isChecked = it?.deliveryauditflag != 0
|
|
|
+ }
|
|
|
+ background = resources.getDrawable(R.drawable.checkbox_switch_selector)
|
|
|
+ setOnCheckedChangeListener { _, b ->
|
|
|
+ if (b){
|
|
|
+ settlement_audit_review.postValue(1)
|
|
|
+ }else{
|
|
|
+ settlement_audit_review.postValue(0)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }.lparams(autoSize(100), autoSize(100)) {
|
|
|
+ marginStart = autoSize(36)
|
|
|
+ }
|
|
|
+ }.lparams(matchParent, autoSize(100))
|
|
|
+
|
|
|
+ itemView()
|
|
|
+
|
|
|
+ linearLayout {
|
|
|
+ gravity = Gravity.CENTER_VERTICAL
|
|
|
+ textView {
|
|
|
+ text = "发票审核"
|
|
|
+ textSizeAuto = 31
|
|
|
+ textColorInt = R.color.rma_black_33
|
|
|
+ }.lparams(wrapContent, wrapContent){
|
|
|
+ marginStart = autoSize(36)
|
|
|
+ }
|
|
|
+
|
|
|
+ emptyView()
|
|
|
+
|
|
|
+ checkBox {
|
|
|
+ viewModel.settingDataList.bindOptional(context){
|
|
|
+ isChecked = it?.deliveryauditflag != 0
|
|
|
+ }
|
|
|
+ buttonDrawable = null
|
|
|
+ background = resources.getDrawable(R.drawable.checkbox_switch_selector)
|
|
|
+ setOnCheckedChangeListener { _, b ->
|
|
|
+ if (b){
|
|
|
+ audit_invoice_review.postValue(1)
|
|
|
+ }else{
|
|
|
+ audit_invoice_review.postValue(0)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }.lparams(autoSize(100), autoSize(100)) {
|
|
|
+ marginStart = autoSize(36)
|
|
|
+ }
|
|
|
+ }.lparams(matchParent, autoSize(100))
|
|
|
+
|
|
|
+ itemView()
|
|
|
+
|
|
|
+ linearLayout {
|
|
|
+ gravity = Gravity.CENTER_VERTICAL
|
|
|
+ textView {
|
|
|
+ text = "款项审核"
|
|
|
+ textSizeAuto = 31
|
|
|
+ textColorInt = R.color.rma_black_33
|
|
|
+ }.lparams(wrapContent, wrapContent){
|
|
|
+ marginStart = autoSize(36)
|
|
|
+ }
|
|
|
+
|
|
|
+ emptyView()
|
|
|
+
|
|
|
+ checkBox {
|
|
|
+ viewModel.settingDataList.bindOptional(context){
|
|
|
+ isChecked = it?.moneyauditflag != 0
|
|
|
+ }
|
|
|
+ buttonDrawable = null
|
|
|
+ background = resources.getDrawable(R.drawable.checkbox_switch_selector)
|
|
|
+ setOnCheckedChangeListener { _, b ->
|
|
|
+ if (b){
|
|
|
+ payment_review.postValue(1)
|
|
|
+ }else{
|
|
|
+ payment_review.postValue(0)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }.lparams(autoSize(100), autoSize(100)) {
|
|
|
+ marginStart = autoSize(36)
|
|
|
+ }
|
|
|
+ }.lparams(matchParent, autoSize(100))
|
|
|
+
|
|
|
+ itemView()
|
|
|
+
|
|
|
+ linearLayout {
|
|
|
+ gravity = Gravity.CENTER_VERTICAL
|
|
|
+ textView {
|
|
|
+ text = "入库审核"
|
|
|
+ textSizeAuto = 31
|
|
|
+ textColorInt = R.color.rma_black_33
|
|
|
+ }.lparams(wrapContent, wrapContent){
|
|
|
+ marginStart = autoSize(36)
|
|
|
+ }
|
|
|
+
|
|
|
+ emptyView()
|
|
|
+
|
|
|
+ checkBox {
|
|
|
+ viewModel.settingDataList.bindOptional(context){
|
|
|
+ isChecked = it?.buyinauditflag != 0
|
|
|
+ }
|
|
|
+ buttonDrawable = null
|
|
|
+ background = resources.getDrawable(R.drawable.checkbox_switch_selector)
|
|
|
+ setOnCheckedChangeListener { _, b ->
|
|
|
+ if (b){
|
|
|
+ warehousing_audit_review.postValue(1)
|
|
|
+ }else{
|
|
|
+ warehousing_audit_review.postValue(0)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }.lparams(autoSize(100), autoSize(100)) {
|
|
|
+ marginStart = autoSize(36)
|
|
|
+ }
|
|
|
+ }.lparams(matchParent, autoSize(100))
|
|
|
+
|
|
|
+ itemView()
|
|
|
+
|
|
|
+ linearLayout {
|
|
|
+ gravity = Gravity.CENTER_VERTICAL
|
|
|
+ textView {
|
|
|
+ text = "出库审核"
|
|
|
+ textSizeAuto = 31
|
|
|
+ textColorInt = R.color.rma_black_33
|
|
|
+ }.lparams(wrapContent, wrapContent){
|
|
|
+ marginStart = autoSize(36)
|
|
|
+ }
|
|
|
+
|
|
|
+ emptyView()
|
|
|
+
|
|
|
+ checkBox {
|
|
|
+ viewModel.settingDataList.bindOptional(context){
|
|
|
+ isChecked = it?.selloutauditflag != 0
|
|
|
+ }
|
|
|
+ buttonDrawable = null
|
|
|
+ background = resources.getDrawable(R.drawable.checkbox_switch_selector)
|
|
|
+ setOnCheckedChangeListener { _, b ->
|
|
|
+ if (b){
|
|
|
+ outbound_review.postValue(1)
|
|
|
+ }else{
|
|
|
+ outbound_review.postValue(0)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }.lparams(autoSize(100), autoSize(100)) {
|
|
|
+ marginStart = autoSize(36)
|
|
|
+ }
|
|
|
+ }.lparams(matchParent, autoSize(100))
|
|
|
+
|
|
|
+ itemView()
|
|
|
+
|
|
|
+ linearLayout {
|
|
|
+ gravity = Gravity.CENTER_VERTICAL
|
|
|
+ textView {
|
|
|
+ text = "生产入库审核"
|
|
|
+ textSizeAuto = 31
|
|
|
+ textColorInt = R.color.rma_black_33
|
|
|
+ }.lparams(wrapContent, wrapContent){
|
|
|
+ marginStart = autoSize(36)
|
|
|
+ }
|
|
|
+
|
|
|
+ emptyView()
|
|
|
+
|
|
|
+ checkBox {
|
|
|
+ viewModel.settingDataList.bindOptional(context){
|
|
|
+ isChecked = it?.produceinauditflag != 0
|
|
|
+ }
|
|
|
+ buttonDrawable = null
|
|
|
+ background = resources.getDrawable(R.drawable.checkbox_switch_selector)
|
|
|
+ setOnCheckedChangeListener { _, b ->
|
|
|
+ if (b){
|
|
|
+ production_inventory_audit.postValue(1)
|
|
|
+ }else{
|
|
|
+ production_inventory_audit.postValue(0)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }.lparams(autoSize(100), autoSize(100)) {
|
|
|
+ marginStart = autoSize(36)
|
|
|
+ }
|
|
|
+ }.lparams(matchParent, autoSize(100))
|
|
|
+
|
|
|
+ itemView()
|
|
|
+
|
|
|
+ linearLayout {
|
|
|
+ gravity = Gravity.CENTER_VERTICAL
|
|
|
+ textView {
|
|
|
+ text = "生产出库审核"
|
|
|
+ textSizeAuto = 31
|
|
|
+ textColorInt = R.color.rma_black_33
|
|
|
+ }.lparams(wrapContent, wrapContent){
|
|
|
+ marginStart = autoSize(36)
|
|
|
+ }
|
|
|
+
|
|
|
+ emptyView()
|
|
|
+
|
|
|
+ checkBox {
|
|
|
+ viewModel.settingDataList.bindOptional(context){
|
|
|
+ isChecked = it?.produceoutauditflag != 0
|
|
|
+ }
|
|
|
+ buttonDrawable = null
|
|
|
+ background = resources.getDrawable(R.drawable.checkbox_switch_selector)
|
|
|
+ setOnCheckedChangeListener { _, b ->
|
|
|
+ if (b){
|
|
|
+ production_outgoing_audit.postValue(1)
|
|
|
+ }else{
|
|
|
+ production_outgoing_audit.postValue(0)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }.lparams(autoSize(100), autoSize(100)) {
|
|
|
+ marginStart = autoSize(36)
|
|
|
+ }
|
|
|
+ }.lparams(matchParent, autoSize(100))
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -99,7 +413,20 @@ class ReviewSettingActivity : BaseActivity<ReviewSettingViewModel>(){
|
|
|
|
|
|
textView {
|
|
|
onThrottleFirstClick {
|
|
|
-
|
|
|
+ viewModel.areaAuditConfigOperateReq(
|
|
|
+ CustomerAuditFlag = literature_review.value.toString(),
|
|
|
+ SpotContractAuditFlag = spot_contract_review.value.toString(),
|
|
|
+ PointPriceAuditFlag = midpoints_audit_review.value.toString(),
|
|
|
+ DeliveryAuditFlag = settlement_audit_review.value.toString(),
|
|
|
+ MoneyAuditFlag = payment_review.value.toString(),
|
|
|
+ InvoiceAuditFlag = audit_invoice_review.value.toString(),
|
|
|
+ BuyInAuditFlag = warehousing_audit_review.value.toString(),
|
|
|
+ SellOutAuditFlag = outbound_review.value.toString(),
|
|
|
+ ProduceInAuditFlag = production_inventory_audit.value.toString(),
|
|
|
+ ProduceOutAuditFlag = production_outgoing_audit.value.toString()
|
|
|
+ ){
|
|
|
+ finish()
|
|
|
+ }
|
|
|
}
|
|
|
gravity = Gravity.CENTER
|
|
|
backgroundResource = R.mipmap.rma_submit_bg
|