Ver código fonte

2024-09-26 新增 / 修改

新增:
1. 财务模块 费用审核

修改:
1. 部分IU修改,界面逻辑修改
zhaiy 6 meses atrás
pai
commit
78a474d5e4

+ 59 - 0
app/src/main/java/com/pan_american/android/ui/financial_module/expense_approval/ExpenseApprovalActivity.kt

@@ -0,0 +1,59 @@
+package com.pan_american.android.ui.financial_module.expense_approval
+
+import android.annotation.SuppressLint
+import android.os.Bundle
+import android.webkit.JsResult
+import android.webkit.WebChromeClient
+import android.webkit.WebSettings
+import android.webkit.WebView
+import android.webkit.WebViewClient
+import com.pan_american.android.R
+import com.pan_american.android.base.BaseActivity
+import com.pan_american.android.databinding.ActivityExpenseApprovalBinding
+import com.pan_american.android.databinding.LayoutTitleBinding
+
+class ExpenseApprovalActivity : BaseActivity<ActivityExpenseApprovalBinding>() {
+
+    private lateinit var titleBinding: LayoutTitleBinding
+
+    override fun getViewBinding() = ActivityExpenseApprovalBinding.inflate(layoutInflater)
+
+    @SuppressLint("SetJavaScriptEnabled")
+    override fun onCreate(savedInstanceState: Bundle?) {
+        super.onCreate(savedInstanceState)
+
+        initTitle()
+
+        binding.expenseApproval.apply {
+            webViewClient = WebViewClient().apply {
+                settings.apply {
+                    javaScriptEnabled = true
+                    cacheMode = WebSettings.LOAD_NO_CACHE
+                    mixedContentMode = WebSettings.MIXED_CONTENT_ALWAYS_ALLOW
+                }
+                loadUrl("http://oa.pan-american-intl.com:4399/#/expenseMobile")
+            }
+        }
+
+        binding.expenseApproval.webChromeClient = object : WebChromeClient() {
+            override fun onJsAlert(
+                view: WebView?,
+                url: String?,
+                message: String?,
+                result: JsResult?
+            ): Boolean {
+                return true
+            }
+        }
+    }
+
+    override fun initTitle() {
+        titleBinding = LayoutTitleBinding.bind(binding.root).apply {
+            titleText.text = resources.getString(R.string.expense_approval)
+
+            backButton.setOnClickListener {
+                back()
+            }
+        }
+    }
+}

+ 18 - 0
app/src/main/res/layout/activity_expense_approval.xml

@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:tools="http://schemas.android.com/tools"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:orientation="vertical">
+
+    <include
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        layout="@layout/layout_title" />
+
+    <WebView
+        android:id="@+id/expense_approval"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent" />
+
+</LinearLayout>

BIN
app/src/main/res/mipmap-xxhdpi/icon_expense_approval.png