init: init proj
This commit is contained in:
1
app/.gitignore
vendored
Normal file
1
app/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
/build
|
||||
85
app/build.gradle
Normal file
85
app/build.gradle
Normal file
@@ -0,0 +1,85 @@
|
||||
plugins {
|
||||
id 'com.android.application'
|
||||
id 'kotlin-android'
|
||||
id 'kotlin-kapt'
|
||||
}
|
||||
|
||||
kapt {
|
||||
arguments {
|
||||
arg("AROUTER_MODULE_NAME", project.getName())
|
||||
}
|
||||
}
|
||||
|
||||
android {
|
||||
signingConfigs {
|
||||
release {
|
||||
storeFile file('../key.jks')
|
||||
storePassword '123321'
|
||||
keyPassword '123321'
|
||||
keyAlias 'key'
|
||||
}
|
||||
}
|
||||
compileSdkVersion 31
|
||||
buildToolsVersion "30.0.3"
|
||||
|
||||
defaultConfig {
|
||||
applicationId "com.lukouguoji.aerologic"
|
||||
minSdkVersion 24
|
||||
targetSdkVersion 30
|
||||
versionCode 79
|
||||
versionName "1.7.9"
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
|
||||
javaCompileOptions {
|
||||
annotationProcessorOptions {
|
||||
arguments = [AROUTER_MODULE_NAME: project.getName()]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||
signingConfig signingConfigs.release
|
||||
}
|
||||
}
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_1_8
|
||||
targetCompatibility JavaVersion.VERSION_1_8
|
||||
}
|
||||
kotlinOptions {
|
||||
jvmTarget = '1.8'
|
||||
}
|
||||
|
||||
buildFeatures {
|
||||
dataBinding = true
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation fileTree(include: ['*.jar'], dir: 'libs')
|
||||
|
||||
implementation project(':module_gnc')
|
||||
implementation project(':module_gnj')
|
||||
implementation project(':module_gjc')
|
||||
implementation project(':module_gjj')
|
||||
implementation project(':module_hangban')
|
||||
implementation project(':module_cargo')
|
||||
implementation project(':module_mit')
|
||||
implementation project(':module_p')
|
||||
implementation project(':Printer')
|
||||
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
||||
implementation 'androidx.core:core-ktx:1.7.0'
|
||||
implementation 'androidx.appcompat:appcompat:1.3.0'
|
||||
implementation 'com.google.android.material:material:1.4.0'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
|
||||
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
|
||||
testImplementation 'junit:junit:4.13.2'
|
||||
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
|
||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
|
||||
|
||||
|
||||
kapt 'com.alibaba:arouter-compiler:1.5.2'
|
||||
}
|
||||
35
app/proguard-rules.pro
vendored
Normal file
35
app/proguard-rules.pro
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
# Add project specific ProGuard rules here.
|
||||
# You can control the set of applied configuration files using the
|
||||
# proguardFiles setting in build.gradle.
|
||||
#
|
||||
# For more details, see
|
||||
# http://developer.android.com/guide/developing/tools/proguard.html
|
||||
|
||||
# If your project uses WebView with JS, uncomment the following
|
||||
# and specify the fully qualified class name to the JavaScript interface
|
||||
# class:
|
||||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
||||
# public *;
|
||||
#}
|
||||
|
||||
# Uncomment this to preserve the line number information for
|
||||
# debugging stack traces.
|
||||
#-keepattributes SourceFile,LineNumberTable
|
||||
|
||||
# If you keep the line number information, uncomment this to
|
||||
# hide the original source file name.
|
||||
#-renamesourcefileattribute SourceFile
|
||||
|
||||
-keep public class com.alibaba.android.arouter.routes.**{*;}
|
||||
-keep public class com.alibaba.android.arouter.facade.**{*;}
|
||||
-keep class * implements com.alibaba.android.arouter.facade.template.ISyringe{*;}
|
||||
|
||||
# 如果使用了 byType 的方式获取 Service,需添加下面规则,保护接口
|
||||
-keep interface * implements com.alibaba.android.arouter.facade.template.IProvider
|
||||
|
||||
# 如果使用了 单类注入,即不定义接口实现 IProvider,需添加下面规则,保护实现
|
||||
# -keep class * implements com.alibaba.android.arouter.facade.template.IProvider
|
||||
|
||||
-keep interface * implements com.alibaba.android.arouter.facade.template.IProvider
|
||||
|
||||
-keep public class com.luck.picture.lib.basic.**{*;}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.lukouguoji.aerologic
|
||||
|
||||
import androidx.test.platform.app.InstrumentationRegistry
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4
|
||||
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
|
||||
import org.junit.Assert.*
|
||||
|
||||
/**
|
||||
* Instrumented test, which will execute on an Android device.
|
||||
*
|
||||
* See [testing documentation](http://d.android.com/tools/testing).
|
||||
*/
|
||||
@RunWith(AndroidJUnit4::class)
|
||||
class ExampleInstrumentedTest {
|
||||
@Test
|
||||
fun useAppContext() {
|
||||
// Context of the app under test.
|
||||
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
|
||||
assertEquals("com.lukouguoji.aerologic", appContext.packageName)
|
||||
}
|
||||
}
|
||||
251
app/src/main/AndroidManifest.xml
Normal file
251
app/src/main/AndroidManifest.xml
Normal file
@@ -0,0 +1,251 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
package="com.lukouguoji.aerologic">
|
||||
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.CAMERA" />
|
||||
<uses-permission android:name="android.permission.FLASHLIGHT" />
|
||||
|
||||
<uses-feature android:name="android.hardware.camera" />
|
||||
<uses-feature android:name="android.hardware.camera.autofocus" />
|
||||
|
||||
<uses-permission android:name="android.permission.VIBRATE" />
|
||||
<uses-permission android:name="android.permission.WAKE_LOCK" />
|
||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||
<uses-permission
|
||||
android:name="android.permission.WRITE_MEDIA_STORAGE"
|
||||
tools:ignore="ProtectedPermissions" />
|
||||
<uses-permission
|
||||
android:name="android.permission.WRITE_SETTINGS"
|
||||
tools:ignore="ProtectedPermissions" />
|
||||
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
|
||||
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
|
||||
<uses-permission android:name="android.permission.RECORD_AUDIO" />
|
||||
<uses-permission android:name="android.permission.BLUETOOTH" />
|
||||
|
||||
<permission-group android:name="${applicationId}.andpermission" />
|
||||
|
||||
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
|
||||
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
|
||||
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
|
||||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
|
||||
|
||||
<application
|
||||
android:name="com.lukouguoji.module_base.MyApplication"
|
||||
android:allowBackup="true"
|
||||
android:icon="@mipmap/logot"
|
||||
android:label="@string/app_name"
|
||||
android:networkSecurityConfig="@xml/network_security_config"
|
||||
android:requestLegacyExternalStorage="true"
|
||||
android:roundIcon="@mipmap/logot_round"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/Theme.Aerologic">
|
||||
<activity
|
||||
android:name=".page.test.PrintActivity"
|
||||
android:configChanges="orientation|keyboardHidden"
|
||||
android:exported="false"
|
||||
android:screenOrientation="userLandscape" />
|
||||
<!-- 国内进港 -->
|
||||
<activity
|
||||
android:name="com.lukouguoji.gnj.activity.GnjCangDanListActivity"
|
||||
android:configChanges="orientation|keyboardHidden"
|
||||
android:exported="false"
|
||||
android:screenOrientation="userLandscape" /> <!-- 国内出港 -->
|
||||
<activity
|
||||
android:name="com.lukouguoji.gnc.activity.GncQueryInfoActivity"
|
||||
android:configChanges="orientation|keyboardHidden"
|
||||
android:exported="false"
|
||||
android:screenOrientation="userLandscape" />
|
||||
<activity
|
||||
android:name="com.lukouguoji.gnc.activity.GncQueryListActivity"
|
||||
android:configChanges="orientation|keyboardHidden"
|
||||
android:exported="false"
|
||||
android:screenOrientation="userLandscape" />
|
||||
<activity
|
||||
android:name="com.lukouguoji.gnc.activity.GncWareHouseActivity"
|
||||
android:configChanges="orientation|keyboardHidden"
|
||||
android:exported="false"
|
||||
android:screenOrientation="userLandscape" />
|
||||
<activity
|
||||
android:name="com.lukouguoji.gnc.activity.GoutFuBangCotActivity"
|
||||
android:configChanges="orientation|keyboardHidden"
|
||||
android:exported="false"
|
||||
android:screenOrientation="userLandscape" />
|
||||
<activity
|
||||
android:name="com.lukouguoji.gnc.activity.GoutChuKuListActivity"
|
||||
android:configChanges="orientation|keyboardHidden"
|
||||
android:exported="false"
|
||||
android:screenOrientation="userLandscape" />
|
||||
<activity
|
||||
android:name="com.lukouguoji.gnc.activity.GncLoadListActivity"
|
||||
android:configChanges="orientation|keyboardHidden"
|
||||
android:exported="false"
|
||||
android:screenOrientation="userLandscape" />
|
||||
<activity
|
||||
android:name="com.lukouguoji.gnc.activity.GoutTransferActivity"
|
||||
android:configChanges="orientation|keyboardHidden"
|
||||
android:exported="false"
|
||||
android:screenOrientation="userLandscape" />
|
||||
<activity
|
||||
android:name="com.lukouguoji.gnc.activity.GoutFuBangActivity"
|
||||
android:configChanges="orientation|keyboardHidden"
|
||||
android:exported="false"
|
||||
android:screenOrientation="userLandscape" />
|
||||
<activity
|
||||
android:name=".MineActivity"
|
||||
android:configChanges="orientation|keyboardHidden"
|
||||
android:screenOrientation="userLandscape" />
|
||||
<activity
|
||||
android:name="com.lukouguoji.gnc.activity.GoutStartCotActivity"
|
||||
android:configChanges="orientation|keyboardHidden"
|
||||
android:screenOrientation="userLandscape" />
|
||||
<activity
|
||||
android:name="com.lukouguoji.gnc.activity.GoutCollectionActivity"
|
||||
android:configChanges="orientation|keyboardHidden"
|
||||
android:screenOrientation="userLandscape" />
|
||||
<activity
|
||||
android:name="com.lukouguoji.gnc.bluetooth.printer.PrinterActivity"
|
||||
android:configChanges="orientation|keyboardHidden"
|
||||
android:screenOrientation="userLandscape" />
|
||||
<activity
|
||||
android:name="com.lukouguoji.module_base.LoginActivity"
|
||||
android:configChanges="orientation|keyboardHidden"
|
||||
android:exported="true"
|
||||
android:windowSoftInputMode="adjustPan">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<activity
|
||||
android:name="com.lukouguoji.module_base.BaseActivity"
|
||||
android:configChanges="orientation|keyboardHidden"
|
||||
android:screenOrientation="userLandscape" />
|
||||
<activity
|
||||
android:name=".MainActivity"
|
||||
android:configChanges="orientation|keyboardHidden"
|
||||
android:screenOrientation="userLandscape" />
|
||||
<activity
|
||||
android:name=".page.message.list.MessageListActivity"
|
||||
android:configChanges="orientation|keyboardHidden"
|
||||
android:screenOrientation="userLandscape" />
|
||||
|
||||
<activity
|
||||
android:name=".page.message.details.MessageDetailsActivity"
|
||||
android:configChanges="orientation|keyboardHidden"
|
||||
android:screenOrientation="userLandscape" />
|
||||
<activity
|
||||
android:name=".page.telegram.list.TelegramListActivity"
|
||||
android:configChanges="orientation|keyboardHidden"
|
||||
android:screenOrientation="userLandscape" />
|
||||
<activity
|
||||
android:name=".page.transport.GoodsTransportActivity"
|
||||
android:configChanges="orientation|keyboardHidden"
|
||||
android:screenOrientation="userLandscape" />
|
||||
<activity
|
||||
android:name=".page.accident.visa.list.AccidentVisaListActivity"
|
||||
android:configChanges="orientation|keyboardHidden"
|
||||
android:screenOrientation="userLandscape" />
|
||||
<activity
|
||||
android:name=".page.accident.visa.details.AccidentVisaDetailsActivity"
|
||||
android:configChanges="orientation|keyboardHidden"
|
||||
android:screenOrientation="userLandscape" />
|
||||
<activity
|
||||
android:name=".page.car.list.CarListActivity"
|
||||
android:configChanges="orientation|keyboardHidden"
|
||||
android:screenOrientation="userLandscape" />
|
||||
<activity
|
||||
android:name=".page.car.add.CarDetailsActivity"
|
||||
android:configChanges="orientation|keyboardHidden"
|
||||
android:screenOrientation="userLandscape" />
|
||||
<activity
|
||||
android:name=".page.car.chart.CarChartActivity"
|
||||
android:configChanges="orientation|keyboardHidden"
|
||||
android:screenOrientation="userLandscape" />
|
||||
<activity
|
||||
android:name=".page.log.list.LogListActivity"
|
||||
android:configChanges="orientation|keyboardHidden"
|
||||
android:screenOrientation="userLandscape" />
|
||||
<activity
|
||||
android:name=".page.transportLog.list.TransportLogActivity"
|
||||
android:configChanges="orientation|keyboardHidden"
|
||||
android:screenOrientation="userLandscape" />
|
||||
<activity
|
||||
android:name=".page.gnj.manifest.list.GnjManifestListActivity"
|
||||
android:configChanges="orientation|keyboardHidden"
|
||||
android:screenOrientation="userLandscape" />
|
||||
<activity
|
||||
android:name=".page.gnj.manifest.add.GnjManifestAddActivity"
|
||||
android:configChanges="orientation|keyboardHidden"
|
||||
android:screenOrientation="userLandscape" />
|
||||
|
||||
<activity
|
||||
android:name=".page.gnj.out.stash.list.GnjOutStashListActivity"
|
||||
android:configChanges="orientation|keyboardHidden"
|
||||
android:screenOrientation="userLandscape" />
|
||||
<activity
|
||||
android:name=".page.gnj.move.stash.list.GnjMoveStashListActivity"
|
||||
android:configChanges="orientation|keyboardHidden"
|
||||
android:screenOrientation="userLandscape" />
|
||||
<activity
|
||||
android:name=".page.gnj.stash.list.GnjStashListActivity"
|
||||
android:configChanges="orientation|keyboardHidden"
|
||||
android:screenOrientation="userLandscape" />
|
||||
<activity
|
||||
android:name=".page.gnj.stash.details.GnjStashDetailsActivity"
|
||||
android:configChanges="orientation|keyboardHidden"
|
||||
android:screenOrientation="userLandscape" />
|
||||
|
||||
<activity
|
||||
android:name=".page.gnj.jiaojie.GnjHandoverListActivity"
|
||||
android:configChanges="orientation|keyboardHidden"
|
||||
android:screenOrientation="userLandscape" />
|
||||
|
||||
<activity
|
||||
android:name=".page.gnj.query.list.GnjQueryListActivity"
|
||||
android:configChanges="orientation|keyboardHidden"
|
||||
android:screenOrientation="userLandscape" />
|
||||
<activity
|
||||
android:name=".page.gnj.query.details.GnjQueryDetailsActivity"
|
||||
android:configChanges="orientation|keyboardHidden"
|
||||
android:screenOrientation="userLandscape" />
|
||||
<activity
|
||||
android:name=".page.flight.query.list.FlightQueryListActivity"
|
||||
android:configChanges="orientation|keyboardHidden"
|
||||
android:screenOrientation="userLandscape" />
|
||||
<activity
|
||||
android:name=".page.flight.query.details.FlightQueryDetailsActivity"
|
||||
android:configChanges="orientation|keyboardHidden"
|
||||
android:screenOrientation="userLandscape" />
|
||||
<activity
|
||||
android:name=".page.gnj.unload.list.GnjUnloadListActivity"
|
||||
android:configChanges="orientation|keyboardHidden"
|
||||
android:screenOrientation="userLandscape" />
|
||||
<activity
|
||||
android:name=".page.gnj.unload.add.GnjUnloadAddActivity"
|
||||
android:configChanges="orientation|keyboardHidden"
|
||||
android:screenOrientation="userLandscape" />
|
||||
|
||||
<activity
|
||||
android:name=".page.gnj.unload.detail.GnjUnloadDetailsActivity"
|
||||
android:configChanges="orientation|keyboardHidden"
|
||||
android:screenOrientation="userLandscape"/>
|
||||
|
||||
<service android:name="com.huitao.printer.service.PrinterService" />
|
||||
<service android:name="com.lukouguoji.gnc.bluetooth.service.AncillaryService" />
|
||||
<service android:name="com.lukouguoji.gnc.bluetooth.service.MyService" />
|
||||
</application>
|
||||
|
||||
<queries package="com.lukouguoji.aerologic">
|
||||
<intent>
|
||||
<action android:name="android.media.action.IMAGE_CAPTURE" />
|
||||
</intent>
|
||||
<intent>
|
||||
<action android:name="android.media.action.ACTION_VIDEO_CAPTURE" />
|
||||
</intent>
|
||||
</queries>
|
||||
</manifest>
|
||||
BIN
app/src/main/ic_launcher-playstore.png
Normal file
BIN
app/src/main/ic_launcher-playstore.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 94 KiB |
131
app/src/main/java/com/lukouguoji/aerologic/MainActivity.kt
Normal file
131
app/src/main/java/com/lukouguoji/aerologic/MainActivity.kt
Normal file
@@ -0,0 +1,131 @@
|
||||
package com.lukouguoji.aerologic
|
||||
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
import android.widget.ImageView
|
||||
import android.widget.RelativeLayout
|
||||
import android.widget.TextView
|
||||
import androidx.appcompat.widget.Toolbar
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.alibaba.android.arouter.launcher.ARouter
|
||||
import com.google.android.material.bottomnavigation.BottomNavigationView
|
||||
import com.lukouguoji.aerologic.page.message.details.MessageDetailsActivity
|
||||
import com.lukouguoji.aerologic.page.message.list.MessageListActivity
|
||||
import com.lukouguoji.aerologic.ui.fragment.HomeFragment
|
||||
import com.lukouguoji.aerologic.ui.fragment.MineFragment
|
||||
import com.lukouguoji.module_base.BaseActivity
|
||||
import com.lukouguoji.module_base.MyApplication.Companion.context
|
||||
import com.lukouguoji.module_base.bean.SocketEventBean
|
||||
import com.lukouguoji.module_base.common.Constant
|
||||
import com.lukouguoji.module_base.common.ConstantEvent
|
||||
import com.lukouguoji.module_base.db.perference.SharedPreferenceUtil
|
||||
import com.lukouguoji.module_base.http.net.NetApply
|
||||
import com.lukouguoji.module_base.impl.FlowBus
|
||||
import com.lukouguoji.module_base.impl.observe
|
||||
import com.lukouguoji.module_base.ktx.launchCollect
|
||||
import com.lukouguoji.module_base.ktx.noNull
|
||||
import com.lukouguoji.module_base.router.ARouterConstants
|
||||
import com.lukouguoji.module_base.util.WebSocketUtil
|
||||
|
||||
@Route(path = "/app/MainActivity")
|
||||
class MainActivity : BaseActivity() {
|
||||
private var lastIndex = 0
|
||||
private var mFragments = mutableListOf<Fragment>()
|
||||
private lateinit var bottomNavigationView: BottomNavigationView
|
||||
private lateinit var userName: TextView
|
||||
|
||||
private var rlMessage: RelativeLayout? = null
|
||||
private var tvMessage: TextView? = null
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
setContentView(R.layout.activity_main)
|
||||
|
||||
rlMessage = findViewById(R.id.rl_message)
|
||||
tvMessage = findViewById(R.id.tv_message)
|
||||
|
||||
initData()
|
||||
var toolbar: Toolbar = findViewById(R.id.main_toolbar)
|
||||
setSupportActionBar(toolbar)
|
||||
// 给左上角图标的左边加上一个返回的图标 。对应ActionBar.DISPLAY_HOME_AS_UP
|
||||
supportActionBar!!.setDisplayHomeAsUpEnabled(false)
|
||||
//设置actionBar的标题是否显示,对应ActionBar.DISPLAY_SHOW_TITLE。
|
||||
supportActionBar!!.setDisplayShowTitleEnabled(false)
|
||||
|
||||
var imageView: ImageView = findViewById(R.id.mine)
|
||||
imageView.setOnClickListener {
|
||||
ARouter.getInstance().build(ARouterConstants.ACTIVITY_URL_MINE).navigation()
|
||||
}
|
||||
|
||||
userName = findViewById(R.id.userName)
|
||||
userName.text = SharedPreferenceUtil.getString(Constant.Share.userName)
|
||||
|
||||
FlowBus.with<Any>(ConstantEvent.LOGOUT)
|
||||
.observe(this) {
|
||||
finish()
|
||||
}
|
||||
|
||||
FlowBus.with<SocketEventBean>(ConstantEvent.SOCKET_EVENT_CLICK)
|
||||
.observe(this) {
|
||||
MessageDetailsActivity.start(this, it.toMessageBean())
|
||||
}
|
||||
FlowBus.with<SocketEventBean>(ConstantEvent.SOCKET_EVENT)
|
||||
.observe(this) {
|
||||
queryUnHandleMessageCount()
|
||||
}
|
||||
|
||||
rlMessage?.setOnClickListener {
|
||||
MessageListActivity.start(it.context)
|
||||
}
|
||||
|
||||
WebSocketUtil.connect()
|
||||
}
|
||||
|
||||
private fun initData() {
|
||||
mFragments = ArrayList()
|
||||
mFragments.add(HomeFragment())
|
||||
mFragments.add(MineFragment())
|
||||
}
|
||||
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
queryUnHandleMessageCount()
|
||||
}
|
||||
|
||||
private fun queryUnHandleMessageCount() {
|
||||
launchCollect({
|
||||
NetApply.api.simplePost("msg/msgStateQuery")
|
||||
}) {
|
||||
onSuccess = {
|
||||
val unread = it.data?.unread.noNull("0")
|
||||
tvMessage?.text = unread
|
||||
tvMessage?.visibility = if (unread != "0") View.VISIBLE else View.GONE
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* onActivityResult 回调
|
||||
*/
|
||||
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
|
||||
super.onActivityResult(requestCode, resultCode, data)
|
||||
|
||||
if (resultCode == RESULT_OK) {
|
||||
when (requestCode) {
|
||||
Constant.RequestCode.home_left_hang_ban_query -> {
|
||||
val fragment =
|
||||
supportFragmentManager.findFragmentById(R.id.home_fragment) as HomeFragment
|
||||
val layoutManager = LinearLayoutManager(context)
|
||||
val adapt = fragment.HomeLeftAdapt(fragment.initLeftMenuData())
|
||||
val recyclerView = findViewById<RecyclerView>(R.id.left_menu_list)
|
||||
recyclerView?.layoutManager = layoutManager
|
||||
recyclerView?.adapter = adapt
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
20
app/src/main/java/com/lukouguoji/aerologic/MineActivity.kt
Normal file
20
app/src/main/java/com/lukouguoji/aerologic/MineActivity.kt
Normal file
@@ -0,0 +1,20 @@
|
||||
package com.lukouguoji.aerologic
|
||||
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.lukouguoji.module_base.BaseActivity
|
||||
import com.lukouguoji.module_base.router.ARouterConstants
|
||||
import com.lukouguoji.module_base.util.ServiceCommon
|
||||
|
||||
@Route(path = ARouterConstants.ACTIVITY_URL_MINE)
|
||||
class MineActivity : BaseActivity() {
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
setContentView(R.layout.activity_mine)
|
||||
}
|
||||
|
||||
fun exitLogin(view: View) {
|
||||
ServiceCommon.exitLogin()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package com.lukouguoji.aerologic.page.accident.visa.details
|
||||
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import com.lukouguoji.aerologic.R
|
||||
import com.lukouguoji.aerologic.databinding.ActivityAccidentVisaDetailsBinding
|
||||
import com.lukouguoji.module_base.base.BaseBindingActivity
|
||||
import com.lukouguoji.module_base.bean.FileBean
|
||||
import com.lukouguoji.module_base.common.Constant
|
||||
import com.lukouguoji.module_base.common.DetailsPageType
|
||||
import com.lukouguoji.module_base.ktx.addOnItemClickListener
|
||||
import com.lukouguoji.module_base.ktx.commonAdapter
|
||||
|
||||
class AccidentVisaDetailsActivity :
|
||||
BaseBindingActivity<ActivityAccidentVisaDetailsBinding, AccidentVisaDetailsViewModel>() {
|
||||
|
||||
override fun layoutId(): Int {
|
||||
return R.layout.activity_accident_visa_details
|
||||
}
|
||||
|
||||
override fun viewModelClass(): Class<AccidentVisaDetailsViewModel> {
|
||||
return AccidentVisaDetailsViewModel::class.java
|
||||
}
|
||||
|
||||
override fun initOnCreate(savedInstanceState: Bundle?) {
|
||||
viewModel.rv = binding.rv
|
||||
viewModel.initOnCreate(intent)
|
||||
|
||||
setBackArrow("国内事故签证${viewModel.pageType.value!!.title}")
|
||||
binding.viewModel = viewModel
|
||||
|
||||
binding.rv.addOnItemClickListener(viewModel)
|
||||
}
|
||||
|
||||
companion object {
|
||||
@JvmStatic
|
||||
fun start(context: Context, id: String = "", editable: Boolean = id.isEmpty()) {
|
||||
val starter = Intent(context, AccidentVisaDetailsActivity::class.java)
|
||||
.putExtra(Constant.Key.ID, id)
|
||||
.putExtra(Constant.Key.DATA, editable)
|
||||
context.startActivity(starter)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,166 @@
|
||||
package com.lukouguoji.aerologic.page.accident.visa.details
|
||||
|
||||
import android.content.Intent
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import androidx.lifecycle.viewModelScope
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.lukouguoji.aerologic.R
|
||||
import com.lukouguoji.module_base.base.BaseViewModel
|
||||
import com.lukouguoji.module_base.bean.AccidentVisaBean
|
||||
import com.lukouguoji.module_base.bean.FileBean
|
||||
import com.lukouguoji.module_base.common.Constant
|
||||
import com.lukouguoji.module_base.common.DetailsPageType
|
||||
import com.lukouguoji.module_base.http.net.NetApply
|
||||
import com.lukouguoji.module_base.impl.ImageSelectViewHolder
|
||||
import com.lukouguoji.module_base.interfaces.IOnItemClickListener
|
||||
import com.lukouguoji.module_base.ktx.commonAdapter
|
||||
import com.lukouguoji.module_base.ktx.launchLoadingCollect
|
||||
import com.lukouguoji.module_base.ktx.loge
|
||||
import com.lukouguoji.module_base.ktx.noNull
|
||||
import com.lukouguoji.module_base.ktx.showToast
|
||||
import com.lukouguoji.module_base.ktx.toRequestBody
|
||||
import com.lukouguoji.module_base.ktx.verifyNullOrEmpty
|
||||
import com.lukouguoji.module_base.util.MediaUtil
|
||||
import com.lukouguoji.module_base.util.UploadUtil
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.flow.asFlow
|
||||
import kotlinx.coroutines.flow.catch
|
||||
import kotlinx.coroutines.flow.filter
|
||||
import kotlinx.coroutines.flow.flowOn
|
||||
import kotlinx.coroutines.flow.launchIn
|
||||
import kotlinx.coroutines.flow.map
|
||||
import kotlinx.coroutines.flow.onCompletion
|
||||
import kotlinx.coroutines.flow.onEach
|
||||
import kotlinx.coroutines.flow.onStart
|
||||
|
||||
|
||||
class AccidentVisaDetailsViewModel : BaseViewModel(), IOnItemClickListener {
|
||||
|
||||
var id = ""
|
||||
|
||||
val pageType = MutableLiveData(DetailsPageType.Add)
|
||||
|
||||
val itemLayoutId = R.layout.item_image_select
|
||||
val itemViewHolder = ImageSelectViewHolder::class.java
|
||||
|
||||
var rv: RecyclerView? = null
|
||||
|
||||
val dataBean = MutableLiveData(AccidentVisaBean())
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// 方法区
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
fun initOnCreate(intent: Intent) {
|
||||
id = intent.getStringExtra(Constant.Key.ID) ?: ""
|
||||
val modify = intent.getBooleanExtra(Constant.Key.DATA, false)
|
||||
pageType.value = if (id.isEmpty()) DetailsPageType.Add
|
||||
else if (modify) DetailsPageType.Modify else DetailsPageType.Details
|
||||
|
||||
if (id.isNotEmpty()) {
|
||||
getData()
|
||||
}
|
||||
rv?.post {
|
||||
loge("获取页面类型 : ${pageType.value?.title}")
|
||||
if (pageType.value != DetailsPageType.Details) {
|
||||
rv?.commonAdapter()?.addItem(FileBean())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun getData() {
|
||||
launchLoadingCollect({
|
||||
NetApply.api.getGnAccidentVisaDetails(id)
|
||||
}) {
|
||||
onSuccess = {
|
||||
dataBean.value = it.data ?: AccidentVisaBean()
|
||||
|
||||
// 渲染图片
|
||||
val list = dataBean.value!!.pic.split(",")
|
||||
.filter { url -> url.isNotEmpty() }
|
||||
.map { url ->
|
||||
FileBean(MediaUtil.fillUrl(url), url)
|
||||
}
|
||||
val zipList = dataBean.value!!.originalPic.split(",")
|
||||
.filter { url -> url.isNotEmpty() }
|
||||
.map { url ->
|
||||
FileBean(MediaUtil.fillUrl(url))
|
||||
}
|
||||
for ((index, fileBean) in list.withIndex()) {
|
||||
val originalPic = zipList.get(index).path
|
||||
list.get(index).originalPic = originalPic
|
||||
}
|
||||
rv?.commonAdapter()
|
||||
?.loadMore(list)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun onSaveClick() {
|
||||
val bean = dataBean.value!!
|
||||
if (bean.fno.verifyNullOrEmpty("请输入航班号")) {
|
||||
return
|
||||
}
|
||||
|
||||
(rv?.commonAdapter()?.items ?: emptyList())
|
||||
.asFlow()
|
||||
.map {
|
||||
it as FileBean
|
||||
}
|
||||
.filter { it.path.isNotEmpty() && it.url.isEmpty() }
|
||||
.onEach {
|
||||
val data = UploadUtil.upload(it.path).data
|
||||
it.url = data?.newName ?: ""
|
||||
it.originalPic = data?.zipFileName ?: ""
|
||||
}
|
||||
.flowOn(Dispatchers.IO)
|
||||
.onStart { showLoading() }
|
||||
.catch {
|
||||
showToast(it.message.noNull("上传图片失败"))
|
||||
dismissLoading()
|
||||
}
|
||||
.onCompletion {
|
||||
launchLoadingCollect({
|
||||
val list =
|
||||
(rv?.commonAdapter()?.items as List<FileBean>).filter { it.path.isNotEmpty() }
|
||||
bean.picnumber = list.size.toString()
|
||||
bean.originalPic = list.joinToString(separator = ",") { MediaUtil.removeUrl(it.url) }
|
||||
bean.pic = list.joinToString(separator = ",") { MediaUtil.removeUrl(it.originalPic) }
|
||||
|
||||
NetApply.api.anyPost(
|
||||
url = if (pageType.value == DetailsPageType.Add) "GnAccidentVisa/saveVisa" else "GnAccidentVisa/updateVisa",
|
||||
body = bean.toRequestBody()
|
||||
)
|
||||
}) {
|
||||
onSuccess = {
|
||||
showToast(it.msg.noNull("${pageType.value!!.title}成功"))
|
||||
getTopActivity().finish()
|
||||
}
|
||||
}
|
||||
}
|
||||
.launchIn(viewModelScope)
|
||||
}
|
||||
|
||||
fun onCancelClick() {
|
||||
getTopActivity().finish()
|
||||
}
|
||||
|
||||
override fun onItemClick(position: Int, type: Int) {
|
||||
val adapter = rv!!.commonAdapter()!!
|
||||
val bean = adapter.getItem(position) as FileBean
|
||||
when (type) {
|
||||
R.id.rl -> {
|
||||
if (pageType.value != DetailsPageType.Details) {
|
||||
bean.canDelete.set(!bean.canDelete.get())
|
||||
}
|
||||
}
|
||||
|
||||
R.id.iv_delete -> {
|
||||
adapter.removeItem(position)
|
||||
}
|
||||
|
||||
else -> {}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
package com.lukouguoji.aerologic.page.accident.visa.list
|
||||
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import com.lukouguoji.aerologic.R
|
||||
import com.lukouguoji.aerologic.databinding.ActivityAccidentVisaListBinding
|
||||
import com.lukouguoji.module_base.base.BaseBindingActivity
|
||||
import com.lukouguoji.module_base.ktx.addOnItemClickListener
|
||||
import com.lukouguoji.module_base.ktx.getLifecycleOwner
|
||||
|
||||
class AccidentVisaListActivity :
|
||||
BaseBindingActivity<ActivityAccidentVisaListBinding, AccidentVisaListViewModel>() {
|
||||
|
||||
override fun layoutId(): Int {
|
||||
return R.layout.activity_accident_visa_list
|
||||
}
|
||||
|
||||
override fun viewModelClass(): Class<AccidentVisaListViewModel> {
|
||||
return AccidentVisaListViewModel::class.java
|
||||
}
|
||||
|
||||
override fun initOnCreate(savedInstanceState: Bundle?) {
|
||||
setBackArrow("国内事故签证")
|
||||
binding.viewModel = viewModel
|
||||
|
||||
viewModel.pageModel.bindSmartRefreshLayout(
|
||||
binding.srl,
|
||||
binding.rv,
|
||||
viewModel,
|
||||
getLifecycleOwner()
|
||||
)
|
||||
|
||||
binding.rv.addOnItemClickListener(viewModel)
|
||||
|
||||
}
|
||||
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
viewModel.refresh()
|
||||
}
|
||||
|
||||
companion object {
|
||||
@JvmStatic
|
||||
fun start(context: Context) {
|
||||
val starter = Intent(context, AccidentVisaListActivity::class.java)
|
||||
context.startActivity(starter)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.lukouguoji.aerologic.page.accident.visa.list
|
||||
|
||||
import android.view.View
|
||||
import com.lukouguoji.aerologic.databinding.ItemAccidentVisaListBinding
|
||||
import com.lukouguoji.module_base.base.BaseViewHolder
|
||||
import com.lukouguoji.module_base.bean.AccidentVisaBean
|
||||
|
||||
class AccidentVisaListViewHolder(view: View) :
|
||||
BaseViewHolder<AccidentVisaBean, ItemAccidentVisaListBinding>(view) {
|
||||
override fun onBind(item: Any?, position: Int) {
|
||||
val itemBean = getItemBean(item)!!
|
||||
binding.bean = itemBean
|
||||
|
||||
binding.ivIcon.setOnClickListener {
|
||||
itemBean.checked.set(!itemBean.checked.get())
|
||||
}
|
||||
|
||||
notifyItemClick(position, binding.tvModify)
|
||||
notifyItemClick(position, binding.tvDelete)
|
||||
notifyItemClick(position, binding.tvDetails)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,141 @@
|
||||
package com.lukouguoji.aerologic.page.accident.visa.list
|
||||
|
||||
import android.view.View
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import com.lukouguoji.aerologic.R
|
||||
import com.lukouguoji.aerologic.page.accident.visa.details.AccidentVisaDetailsActivity
|
||||
import com.lukouguoji.module_base.base.BasePageViewModel
|
||||
import com.lukouguoji.module_base.bean.AccidentVisaBean
|
||||
import com.lukouguoji.module_base.bean.MessageBean
|
||||
import com.lukouguoji.module_base.http.net.NetApply
|
||||
import com.lukouguoji.module_base.ktx.commonAdapter
|
||||
import com.lukouguoji.module_base.ktx.formatDate
|
||||
import com.lukouguoji.module_base.ktx.getActivity
|
||||
import com.lukouguoji.module_base.ktx.launchLoadingCollect
|
||||
import com.lukouguoji.module_base.ktx.noNull
|
||||
import com.lukouguoji.module_base.ktx.showToast
|
||||
import com.lukouguoji.module_base.ktx.toRequestBody
|
||||
import com.lukouguoji.module_base.model.ConfirmDialogModel
|
||||
import com.lukouguoji.module_base.util.Common
|
||||
import com.ninetripods.sydialoglib.IDialog
|
||||
import dev.DevUtils
|
||||
import dev.utils.common.DateUtils
|
||||
import java.util.Calendar
|
||||
|
||||
class AccidentVisaListViewModel : BasePageViewModel() {
|
||||
|
||||
// 日期
|
||||
val date = MutableLiveData(DateUtils.getCurrentTime().formatDate())
|
||||
|
||||
// 航班号
|
||||
val flightNo = MutableLiveData("")
|
||||
|
||||
// 发运站
|
||||
val dep = MutableLiveData("")
|
||||
|
||||
// 单号
|
||||
val order = MutableLiveData("")
|
||||
|
||||
// 填表人
|
||||
val name = MutableLiveData("")
|
||||
|
||||
val itemLayoutId = R.layout.item_accident_visa_list
|
||||
val itemViewHolder = AccidentVisaListViewHolder::class.java
|
||||
|
||||
// 合计数量
|
||||
val count = MutableLiveData(0)
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// 方法区
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
override fun getData() {
|
||||
launchLoadingCollect({
|
||||
NetApply.api.getGnAccidentVisaList(
|
||||
mapOf(
|
||||
"pageNum" to pageModel.page,
|
||||
"pageSize" to pageModel.limit,
|
||||
"opDate" to date.value,
|
||||
"fno" to flightNo.value,
|
||||
"dep" to dep.value,
|
||||
"mawbno" to order.value,
|
||||
"opid" to name.value,
|
||||
).toRequestBody()
|
||||
)
|
||||
}) {
|
||||
onSuccess = {
|
||||
pageModel.handleListBean(it)
|
||||
count.value = it.total
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun onAddClick() {
|
||||
AccidentVisaDetailsActivity.start(DevUtils.getTopActivity())
|
||||
}
|
||||
|
||||
fun onDeleteClick() {
|
||||
val adapter = pageModel.rv?.commonAdapter()
|
||||
val filter =
|
||||
adapter?.items?.filter { (it as AccidentVisaBean).checked.get() }
|
||||
if (filter.isNullOrEmpty()) {
|
||||
showToast("请选择需要删除的数据")
|
||||
return
|
||||
}
|
||||
ConfirmDialogModel(
|
||||
"是否确定删除选中的数据?"
|
||||
) {
|
||||
launchLoadingCollect({
|
||||
NetApply.api.anyPost(
|
||||
"GnAccidentVisa/deleteList",
|
||||
filter.map { (it as AccidentVisaBean).id }.toRequestBody()
|
||||
)
|
||||
}) {
|
||||
onSuccess = {
|
||||
showToast(it.msg.noNull("删除成功"))
|
||||
refresh()
|
||||
}
|
||||
}
|
||||
|
||||
}.show()
|
||||
}
|
||||
|
||||
fun onAllSelectClick() {
|
||||
val allChecked =
|
||||
pageModel.rv?.commonAdapter()?.items?.find { item -> !(item as AccidentVisaBean).checked.get() } == null
|
||||
pageModel.rv?.commonAdapter()?.items?.forEach {
|
||||
(it as AccidentVisaBean).checked.set(!allChecked)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onItemClick(position: Int, type: Int) {
|
||||
val adapter = pageModel.rv!!.commonAdapter()!!
|
||||
val bean = adapter.getItem(position) as AccidentVisaBean
|
||||
when (type) {
|
||||
R.id.tv_details -> {
|
||||
AccidentVisaDetailsActivity.start(DevUtils.getTopActivity(), bean.id, false)
|
||||
}
|
||||
|
||||
R.id.tv_modify -> {
|
||||
AccidentVisaDetailsActivity.start(DevUtils.getTopActivity(), bean.id, true)
|
||||
}
|
||||
|
||||
R.id.tv_delete -> {
|
||||
Common.secondConfirmDialog(
|
||||
DevUtils.getTopActivity(), "确定删除吗?"
|
||||
) {
|
||||
launchLoadingCollect({
|
||||
NetApply.api.anyPostForId("/GnAccidentVisa/deleteVisa", bean.id)
|
||||
}) {
|
||||
onSuccess = {
|
||||
showToast(it.msg.noNull("删除成功"))
|
||||
adapter.removeItem(position)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
else -> {}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package com.lukouguoji.aerologic.page.car.add
|
||||
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import com.lukouguoji.aerologic.R
|
||||
import com.lukouguoji.aerologic.databinding.ActivityCarAddBinding
|
||||
import com.lukouguoji.module_base.base.BaseBindingActivity
|
||||
import com.lukouguoji.module_base.common.Constant
|
||||
|
||||
class CarDetailsActivity : BaseBindingActivity<ActivityCarAddBinding, CarDetailsViewModel>() {
|
||||
override fun layoutId(): Int {
|
||||
return R.layout.activity_car_add
|
||||
}
|
||||
|
||||
override fun viewModelClass(): Class<CarDetailsViewModel> {
|
||||
return CarDetailsViewModel::class.java
|
||||
}
|
||||
|
||||
override fun initOnCreate(savedInstanceState: Bundle?) {
|
||||
viewModel.initOnCreate(intent)
|
||||
setBackArrow("平板车${viewModel.pageType.value!!.title}")
|
||||
|
||||
binding.viewModel = viewModel
|
||||
}
|
||||
|
||||
companion object {
|
||||
@JvmStatic
|
||||
fun start(context: Context, id: String = "", modify: Boolean = id.isEmpty()) {
|
||||
val starter = Intent(context, CarDetailsActivity::class.java)
|
||||
.putExtra(Constant.Key.ID, id)
|
||||
.putExtra(Constant.Key.DATA, modify)
|
||||
context.startActivity(starter)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
package com.lukouguoji.aerologic.page.car.add
|
||||
|
||||
import android.content.Intent
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import com.lukouguoji.module_base.base.BaseViewModel
|
||||
import com.lukouguoji.module_base.bean.CarBean
|
||||
import com.lukouguoji.module_base.bean.FlatcarBean
|
||||
import com.lukouguoji.module_base.common.Constant
|
||||
import com.lukouguoji.module_base.common.DetailsPageType
|
||||
import com.lukouguoji.module_base.http.net.NetApply
|
||||
import com.lukouguoji.module_base.ktx.launchLoadingCollect
|
||||
import com.lukouguoji.module_base.ktx.noNull
|
||||
import com.lukouguoji.module_base.ktx.showToast
|
||||
import com.lukouguoji.module_base.ktx.toRequestBody
|
||||
import com.lukouguoji.module_base.util.DictUtils
|
||||
import dev.DevUtils
|
||||
import dev.utils.app.info.KeyValue
|
||||
|
||||
class CarDetailsViewModel : BaseViewModel() {
|
||||
|
||||
var id = ""
|
||||
|
||||
val pageType = MutableLiveData(DetailsPageType.Add)
|
||||
|
||||
val carBean = MutableLiveData(FlatcarBean())
|
||||
|
||||
// 位置列表
|
||||
val locationList = MutableLiveData(listOf(KeyValue("占位", ""))).apply {
|
||||
DictUtils.getCarLocationList {
|
||||
value = listOf(KeyValue("", "")) + it
|
||||
}
|
||||
}
|
||||
|
||||
// 状态列表
|
||||
val statusList = MutableLiveData<List<KeyValue>>(
|
||||
listOf(
|
||||
KeyValue("正常", "0"),
|
||||
KeyValue("故障", "1"),
|
||||
)
|
||||
)
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// 方法区
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
fun initOnCreate(intent: Intent) {
|
||||
id = intent.getStringExtra(Constant.Key.ID) ?: ""
|
||||
val modify = intent.getBooleanExtra(Constant.Key.DATA, false)
|
||||
pageType.value = if (id.isEmpty()) DetailsPageType.Add
|
||||
else if (modify) DetailsPageType.Modify else DetailsPageType.Details
|
||||
|
||||
getData()
|
||||
|
||||
}
|
||||
|
||||
private fun getData() {
|
||||
if (id.isEmpty()) {
|
||||
return
|
||||
}
|
||||
launchLoadingCollect({
|
||||
NetApply.api.getCarDetails(id)
|
||||
}) {
|
||||
onSuccess = {
|
||||
carBean.value = it.data ?: FlatcarBean()
|
||||
carBean.value?.positionName =
|
||||
locationList.value?.find { b -> b.value == carBean.value?.position }?.key ?: ""
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun onSaveClick() {
|
||||
launchLoadingCollect({
|
||||
NetApply.api.anyPost(
|
||||
url = if (pageType.value == DetailsPageType.Add) "eqm/flatcar/insertFlatcar" else "eqm/flatcar/updateFlatcar",
|
||||
body = carBean.value!!.toRequestBody()
|
||||
)
|
||||
}) {
|
||||
onSuccess = {
|
||||
showToast(it.msg.noNull("${pageType.value!!.title}成功"))
|
||||
if (id.isNotEmpty()) {
|
||||
getData()
|
||||
} else {
|
||||
carBean.value = FlatcarBean()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun onCancelClick() {
|
||||
DevUtils.getTopActivity().finish()
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,107 @@
|
||||
package com.lukouguoji.aerologic.page.car.chart
|
||||
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import com.github.mikephil.charting.components.AxisBase
|
||||
import com.github.mikephil.charting.components.Legend
|
||||
import com.github.mikephil.charting.components.XAxis
|
||||
import com.github.mikephil.charting.data.BarData
|
||||
import com.github.mikephil.charting.data.BarDataSet
|
||||
import com.github.mikephil.charting.data.BarEntry
|
||||
import com.github.mikephil.charting.data.Entry
|
||||
import com.github.mikephil.charting.formatter.IAxisValueFormatter
|
||||
import com.github.mikephil.charting.formatter.IValueFormatter
|
||||
import com.github.mikephil.charting.interfaces.datasets.IBarDataSet
|
||||
import com.github.mikephil.charting.utils.ViewPortHandler
|
||||
import com.lukouguoji.aerologic.R
|
||||
import com.lukouguoji.aerologic.databinding.ActivityCarChartBinding
|
||||
import com.lukouguoji.module_base.base.BaseBindingActivity
|
||||
import com.lukouguoji.module_base.bean.CarBarBean
|
||||
import com.lukouguoji.module_base.ktx.loge
|
||||
import dev.utils.app.SizeUtils
|
||||
|
||||
class CarChartActivity : BaseBindingActivity<ActivityCarChartBinding, CarChartViewModel>() {
|
||||
|
||||
override fun layoutId(): Int {
|
||||
return R.layout.activity_car_chart
|
||||
}
|
||||
|
||||
override fun viewModelClass(): Class<CarChartViewModel> {
|
||||
return CarChartViewModel::class.java
|
||||
}
|
||||
|
||||
override fun initOnCreate(savedInstanceState: Bundle?) {
|
||||
setBackArrow("平板车统计")
|
||||
binding.viewModel = viewModel
|
||||
|
||||
viewModel.onCreated()
|
||||
|
||||
viewModel.carBarList.observe(this) {
|
||||
if (it == null) return@observe
|
||||
handleData(it)
|
||||
}
|
||||
}
|
||||
|
||||
private fun handleData(list: List<CarBarBean>) {
|
||||
val titleList =
|
||||
(viewModel.locationList.value?.filter { it.value.isNotEmpty() } ?: emptyList())
|
||||
// X轴设置
|
||||
binding.barChart.xAxis.let {
|
||||
it.setDrawGridLines(false)
|
||||
it.position = XAxis.XAxisPosition.BOTTOM
|
||||
it.valueFormatter =
|
||||
IAxisValueFormatter { value, _ -> titleList[value.toInt() % titleList.size].key }
|
||||
it.textSize = 14f
|
||||
it.yOffset = 10f
|
||||
}
|
||||
// Y轴设置
|
||||
binding.barChart.axisLeft.let {
|
||||
it.textSize = 14f
|
||||
}
|
||||
|
||||
binding.barChart.description.let {
|
||||
it.text = ""
|
||||
}
|
||||
binding.barChart.legend.let {
|
||||
it.textSize = SizeUtils.sp2px(16f).toFloat()
|
||||
it.verticalAlignment = Legend.LegendVerticalAlignment.TOP
|
||||
it.horizontalAlignment = Legend.LegendHorizontalAlignment.LEFT
|
||||
}
|
||||
loge("加载图表数据")
|
||||
val data = arrayListOf<IBarDataSet>()
|
||||
val values = arrayListOf<BarEntry>()
|
||||
|
||||
titleList.mapIndexed { index, bean ->
|
||||
BarEntry(
|
||||
index.toFloat(),
|
||||
(list.find { b -> b.position == bean.value }?.count ?: "0").toFloat()
|
||||
)
|
||||
}
|
||||
.forEach {
|
||||
values.add(it)
|
||||
}
|
||||
|
||||
val dataSet = BarDataSet(values, "平板车数量")
|
||||
dataSet.color = resources!!.getColor(R.color.green)
|
||||
dataSet.label
|
||||
data.add(dataSet)
|
||||
val barData = BarData(data)
|
||||
barData.setValueFormatter { value, entry, dataSetIndex, viewPortHandler ->
|
||||
value.toInt().toString()
|
||||
}
|
||||
barData.barWidth = 0.5f
|
||||
binding.barChart.data = barData
|
||||
barData.notifyDataChanged()
|
||||
binding.barChart.notifyDataSetChanged()
|
||||
binding.barChart.invalidate()
|
||||
}
|
||||
|
||||
companion object {
|
||||
@JvmStatic
|
||||
fun start(context: Context) {
|
||||
val starter = Intent(context, CarChartActivity::class.java)
|
||||
context.startActivity(starter)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package com.lukouguoji.aerologic.page.car.chart
|
||||
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import com.lukouguoji.module_base.base.BaseViewModel
|
||||
import com.lukouguoji.module_base.bean.CarBarBean
|
||||
import com.lukouguoji.module_base.http.net.NetApply
|
||||
import com.lukouguoji.module_base.ktx.launchLoadingCollect
|
||||
import com.lukouguoji.module_base.util.DictUtils
|
||||
import dev.utils.app.info.KeyValue
|
||||
|
||||
class CarChartViewModel : BaseViewModel() {
|
||||
|
||||
val location = MutableLiveData("")
|
||||
|
||||
val count = MutableLiveData(0)
|
||||
|
||||
// 位置列表
|
||||
val locationList = MutableLiveData<List<KeyValue>>()
|
||||
|
||||
val carBarList = MutableLiveData<List<CarBarBean>>()
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// 方法区
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
fun onCreated() {
|
||||
DictUtils.getCarLocationList {
|
||||
locationList.value = listOf(KeyValue("全部", "")) + it
|
||||
getData()
|
||||
}
|
||||
}
|
||||
|
||||
fun getData() {
|
||||
launchLoadingCollect({
|
||||
NetApply.api.getCarBarList(location.value!!)
|
||||
}) {
|
||||
onSuccess = {
|
||||
carBarList.value = it.data ?: emptyList()
|
||||
count.value = it.data
|
||||
?.filter { b-> b.position.isNotEmpty() }
|
||||
?.sumOf { b -> b.count.toIntOrNull() ?: 0 } ?: 0
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package com.lukouguoji.aerologic.page.car.list
|
||||
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import com.lukouguoji.aerologic.R
|
||||
import com.lukouguoji.aerologic.databinding.ActivityCarListBinding
|
||||
import com.lukouguoji.module_base.base.BaseBindingActivity
|
||||
import com.lukouguoji.module_base.ktx.addOnItemClickListener
|
||||
import com.lukouguoji.module_base.ktx.getLifecycleOwner
|
||||
|
||||
|
||||
class CarListActivity : BaseBindingActivity<ActivityCarListBinding, CarListViewModel>() {
|
||||
|
||||
override fun layoutId(): Int {
|
||||
return R.layout.activity_car_list
|
||||
}
|
||||
|
||||
override fun viewModelClass(): Class<CarListViewModel> {
|
||||
return CarListViewModel::class.java
|
||||
}
|
||||
|
||||
override fun initOnCreate(savedInstanceState: Bundle?) {
|
||||
setBackArrow("平板车管理")
|
||||
binding.viewModel = viewModel
|
||||
viewModel.pageModel.bindSmartRefreshLayout(
|
||||
binding.srl,
|
||||
binding.rv,
|
||||
viewModel,
|
||||
getLifecycleOwner()
|
||||
)
|
||||
|
||||
binding.rv.addOnItemClickListener(viewModel)
|
||||
}
|
||||
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
viewModel.refresh()
|
||||
}
|
||||
|
||||
companion object {
|
||||
@JvmStatic
|
||||
fun start(context: Context) {
|
||||
val starter = Intent(context, CarListActivity::class.java)
|
||||
context.startActivity(starter)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.lukouguoji.aerologic.page.car.list
|
||||
|
||||
import android.view.View
|
||||
import com.lukouguoji.aerologic.databinding.ItemCarListBinding
|
||||
import com.lukouguoji.module_base.base.BaseViewHolder
|
||||
import com.lukouguoji.module_base.bean.CarBean
|
||||
import com.lukouguoji.module_base.bean.FlatcarBean
|
||||
|
||||
class CarListViewHolder(view: View) : BaseViewHolder<FlatcarBean, ItemCarListBinding>(view) {
|
||||
override fun onBind(item: Any?, position: Int) {
|
||||
val itemBean = getItemBean(item)!!
|
||||
binding.bean = itemBean
|
||||
|
||||
binding.ivIcon.setOnClickListener {
|
||||
itemBean.checked.set(!itemBean.checked.get())
|
||||
}
|
||||
|
||||
notifyItemClick(position, binding.llContent)
|
||||
notifyItemClick(position, binding.tvModify)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,168 @@
|
||||
package com.lukouguoji.aerologic.page.car.list
|
||||
|
||||
import android.app.Activity
|
||||
import android.content.Intent
|
||||
import android.widget.Toast
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import com.gainscha.sdk2.e
|
||||
import com.lukouguoji.aerologic.R
|
||||
import com.lukouguoji.aerologic.page.car.add.CarDetailsActivity
|
||||
import com.lukouguoji.aerologic.page.car.chart.CarChartActivity
|
||||
import com.lukouguoji.module_base.base.BasePageViewModel
|
||||
import com.lukouguoji.module_base.bean.FlatcarBean
|
||||
import com.lukouguoji.module_base.bean.PrinterNum
|
||||
import com.lukouguoji.module_base.common.Constant
|
||||
import com.lukouguoji.module_base.http.net.NetApply
|
||||
import com.lukouguoji.module_base.ktx.commonAdapter
|
||||
import com.lukouguoji.module_base.ktx.launchLoadingCollect
|
||||
import com.lukouguoji.module_base.ktx.showToast
|
||||
import com.lukouguoji.module_base.ktx.toRequestBody
|
||||
import com.lukouguoji.module_base.model.BluetoothDialogModel
|
||||
import com.lukouguoji.module_base.model.ScanModel
|
||||
import com.lukouguoji.module_base.util.DictUtils
|
||||
import com.lukouguoji.module_base.util.PrinterUtils
|
||||
import dev.DevUtils
|
||||
import dev.utils.app.info.KeyValue
|
||||
|
||||
|
||||
class CarListViewModel : BasePageViewModel() {
|
||||
|
||||
// 位置
|
||||
val location = MutableLiveData("")
|
||||
|
||||
// 状态
|
||||
val status = MutableLiveData("")
|
||||
//打印份数
|
||||
val printNum = MutableLiveData("1")
|
||||
val dataBean = MutableLiveData(PrinterNum())
|
||||
|
||||
// 车号
|
||||
val carStart = MutableLiveData("")
|
||||
val carEnd = MutableLiveData("")
|
||||
|
||||
// 位置列表
|
||||
val locationList = MutableLiveData<List<KeyValue>>(listOf(KeyValue("占位", ""))).apply {
|
||||
DictUtils.getCarLocationList {
|
||||
value = it
|
||||
}
|
||||
}
|
||||
|
||||
// 状态列表
|
||||
val statusList = MutableLiveData<List<KeyValue>>(
|
||||
listOf(
|
||||
KeyValue("全部", ""),
|
||||
KeyValue("正常", "0"),
|
||||
KeyValue("故障", "1"),
|
||||
)
|
||||
)
|
||||
|
||||
// 合计数量
|
||||
val count = MutableLiveData(0)
|
||||
|
||||
val itemLayoutId = R.layout.item_car_list
|
||||
val itemViewHolder = CarListViewHolder::class.java
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// 方法区
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
override fun getData() {
|
||||
launchLoadingCollect({
|
||||
NetApply.api.getCarList(
|
||||
mapOf(
|
||||
"pageNum" to pageModel.page,
|
||||
"pageSize" to pageModel.limit,
|
||||
"position" to location.value,
|
||||
"status" to status.value,
|
||||
"carStart" to carStart.value,
|
||||
"carEnd" to carEnd.value,
|
||||
).toRequestBody()
|
||||
)
|
||||
}) {
|
||||
onSuccess = {
|
||||
it.list?.forEach { bean ->
|
||||
bean.positionName =
|
||||
locationList.value?.find { b -> b.value == bean.position }?.key ?: ""
|
||||
}
|
||||
pageModel.handleListBean(it)
|
||||
count.value = it.total
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun onCarScanClick() {
|
||||
ScanModel.startScan(DevUtils.getTopActivity(), Constant.RequestCode.CAR)
|
||||
}
|
||||
|
||||
fun onCarScanClickCarEnd() {
|
||||
ScanModel.startScan(DevUtils.getTopActivity(), Constant.RequestCode.CAREND)
|
||||
}
|
||||
|
||||
fun onAddClick() {
|
||||
CarDetailsActivity.start(DevUtils.getTopActivity())
|
||||
}
|
||||
|
||||
fun onPrintClick() {
|
||||
var num = printNum.value?.toIntOrNull() ?: 1
|
||||
|
||||
val list =
|
||||
(pageModel.rv?.commonAdapter()?.items?.filter { (it as FlatcarBean).checked.get() }
|
||||
?: emptyList())
|
||||
as List<FlatcarBean>
|
||||
if (list.isEmpty()) {
|
||||
showToast("请选择要打印的车辆")
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
BluetoothDialogModel()
|
||||
.showCallBack {
|
||||
var count = 0
|
||||
//打印次数
|
||||
while (count < num) {
|
||||
// 循环体
|
||||
list.forEach{
|
||||
PrinterUtils.printCar(it.carId)
|
||||
}
|
||||
count++
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
fun onChartClick() {
|
||||
CarChartActivity.start(DevUtils.getTopActivity())
|
||||
}
|
||||
|
||||
override fun onItemClick(position: Int, type: Int) {
|
||||
val bean = pageModel.rv!!.commonAdapter()!!.getItem(position) as FlatcarBean
|
||||
when (type) {
|
||||
R.id.ll_content -> {
|
||||
CarDetailsActivity.start(DevUtils.getTopActivity(), bean.carId)
|
||||
}
|
||||
|
||||
R.id.tv_modify -> {
|
||||
CarDetailsActivity.start(DevUtils.getTopActivity(), bean.carId, true)
|
||||
}
|
||||
|
||||
else -> {}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
|
||||
if (resultCode == Activity.RESULT_OK && data != null) {
|
||||
when (requestCode) {
|
||||
Constant.RequestCode.CAR -> {
|
||||
carStart.value = data.getStringExtra(Constant.Result.CODED_CONTENT)
|
||||
}
|
||||
Constant.RequestCode.CAREND -> {
|
||||
carEnd.value = data.getStringExtra(Constant.Result.CODED_CONTENT)
|
||||
}
|
||||
|
||||
else -> {}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.lukouguoji.aerologic.page.flight.query.details
|
||||
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import com.lukouguoji.aerologic.R
|
||||
import com.lukouguoji.aerologic.databinding.ActivityFlightQueryDetailsBinding
|
||||
import com.lukouguoji.aerologic.databinding.ActivityGnjStashDetailsBinding
|
||||
import com.lukouguoji.module_base.base.BaseBindingActivity
|
||||
import com.lukouguoji.module_base.common.Constant
|
||||
|
||||
class FlightQueryDetailsActivity :
|
||||
BaseBindingActivity<ActivityFlightQueryDetailsBinding, FlightQueryDetailsViewModel>() {
|
||||
|
||||
override fun layoutId() = R.layout.activity_flight_query_details
|
||||
|
||||
override fun viewModelClass() = FlightQueryDetailsViewModel::class.java
|
||||
|
||||
override fun initOnCreate(savedInstanceState: Bundle?) {
|
||||
setBackArrow("航班详情")
|
||||
viewModel.initOnCreated(intent)
|
||||
binding.viewModel = viewModel
|
||||
}
|
||||
|
||||
companion object {
|
||||
@JvmStatic
|
||||
fun start(context: Context, fid: String) {
|
||||
val starter = Intent(context, FlightQueryDetailsActivity::class.java)
|
||||
.putExtra(Constant.Key.ID, fid)
|
||||
context.startActivity(starter)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.lukouguoji.aerologic.page.flight.query.details
|
||||
|
||||
import android.content.Intent
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import com.lukouguoji.module_base.base.BaseViewModel
|
||||
import com.lukouguoji.module_base.bean.FlightBean
|
||||
import com.lukouguoji.module_base.common.Constant
|
||||
import com.lukouguoji.module_base.http.net.NetApply
|
||||
import com.lukouguoji.module_base.ktx.launchLoadingCollect
|
||||
|
||||
class FlightQueryDetailsViewModel : BaseViewModel() {
|
||||
|
||||
var id = ""
|
||||
|
||||
var dataBean = MutableLiveData<FlightBean>()
|
||||
|
||||
fun initOnCreated(intent: Intent) {
|
||||
id = intent.getStringExtra(Constant.Key.ID) ?: ""
|
||||
|
||||
getData()
|
||||
}
|
||||
|
||||
private fun getData() {
|
||||
launchLoadingCollect({
|
||||
NetApply.api.getFlightDetails(id)
|
||||
}) {
|
||||
onSuccess = {
|
||||
it.data?.let { data ->
|
||||
dataBean.value = data
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package com.lukouguoji.aerologic.page.flight.query.list
|
||||
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import com.lukouguoji.aerologic.R
|
||||
import com.lukouguoji.aerologic.databinding.ActivityFlightQueryListBinding
|
||||
import com.lukouguoji.module_base.base.BaseBindingActivity
|
||||
import com.lukouguoji.module_base.ktx.addOnItemClickListener
|
||||
import com.lukouguoji.module_base.ktx.getLifecycleOwner
|
||||
|
||||
class FlightQueryListActivity :
|
||||
BaseBindingActivity<ActivityFlightQueryListBinding, FlightQueryListViewModel>() {
|
||||
override fun layoutId() = R.layout.activity_flight_query_list
|
||||
|
||||
override fun viewModelClass() = FlightQueryListViewModel::class.java
|
||||
|
||||
override fun initOnCreate(savedInstanceState: Bundle?) {
|
||||
setBackArrow("航班管理")
|
||||
|
||||
binding.viewModel = viewModel
|
||||
viewModel.pageModel
|
||||
.bindSmartRefreshLayout(binding.srl, binding.rv, viewModel, getLifecycleOwner())
|
||||
|
||||
binding.rv.addOnItemClickListener(viewModel)
|
||||
|
||||
viewModel.refresh()
|
||||
}
|
||||
|
||||
companion object {
|
||||
@JvmStatic
|
||||
fun start(context: Context) {
|
||||
val starter = Intent(context, FlightQueryListActivity::class.java)
|
||||
context.startActivity(starter)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.lukouguoji.aerologic.page.flight.query.list
|
||||
|
||||
import android.view.View
|
||||
import com.lukouguoji.aerologic.databinding.ItemFlightQueryListBinding
|
||||
import com.lukouguoji.aerologic.databinding.ItemGnjQueryListBinding
|
||||
import com.lukouguoji.aerologic.databinding.ItemGnjStashListBinding
|
||||
import com.lukouguoji.module_base.base.BaseViewHolder
|
||||
import com.lukouguoji.module_base.bean.FlightBean
|
||||
import com.lukouguoji.module_base.bean.SimpleCheckBean
|
||||
|
||||
class FlightQueryListViewHolder(view: View) :
|
||||
BaseViewHolder<FlightBean, ItemFlightQueryListBinding>(view) {
|
||||
|
||||
override fun onBind(item: Any?, position: Int) {
|
||||
val bean = getItemBean(item)!!
|
||||
binding.bean = bean
|
||||
|
||||
notifyItemClick(position, binding.ll)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
package com.lukouguoji.aerologic.page.flight.query.list
|
||||
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import com.lukouguoji.aerologic.R
|
||||
import com.lukouguoji.aerologic.page.flight.query.details.FlightQueryDetailsActivity
|
||||
import com.lukouguoji.module_base.base.BasePageViewModel
|
||||
import com.lukouguoji.module_base.bean.FlightBean
|
||||
import com.lukouguoji.module_base.http.net.NetApply
|
||||
import com.lukouguoji.module_base.ktx.commonAdapter
|
||||
import com.lukouguoji.module_base.ktx.formatDate
|
||||
import com.lukouguoji.module_base.ktx.launchLoadingCollect
|
||||
import com.lukouguoji.module_base.ktx.toRequestBody
|
||||
import com.lukouguoji.module_base.util.DictUtils
|
||||
import dev.utils.app.info.KeyValue
|
||||
import dev.utils.common.DateUtils
|
||||
|
||||
class FlightQueryListViewModel : BasePageViewModel() {
|
||||
|
||||
val date = MutableLiveData(DateUtils.getCurrentTime().formatDate())
|
||||
val fNo = MutableLiveData("")
|
||||
val dep = MutableLiveData("")
|
||||
val dest = MutableLiveData("")
|
||||
val addressType = MutableLiveData("")
|
||||
val serviceType = MutableLiveData("")
|
||||
|
||||
val addressTypeList = MutableLiveData(listOf(KeyValue("全部", ""))).apply {
|
||||
DictUtils.getAreaTypeList {
|
||||
value = it
|
||||
}
|
||||
}
|
||||
val serviceTypeList = MutableLiveData(
|
||||
listOf(
|
||||
KeyValue("全部", ""),
|
||||
KeyValue("客机", "0"),
|
||||
KeyValue("货机", "1"),
|
||||
KeyValue("卡车", "2"),
|
||||
)
|
||||
)
|
||||
|
||||
val itemLayoutId = R.layout.item_flight_query_list
|
||||
val itemViewHolder = FlightQueryListViewHolder::class.java
|
||||
|
||||
val count = MutableLiveData(0)
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// 方法区
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
override fun getData() {
|
||||
val range = if (dep.value.isNullOrEmpty() && dest.value.isNullOrEmpty()) {
|
||||
""
|
||||
} else {
|
||||
"${dep.value}-${dest.value}"
|
||||
}
|
||||
launchLoadingCollect({
|
||||
NetApply.api.getFlightList(
|
||||
mapOf(
|
||||
"page" to pageModel.page,
|
||||
"limit" to pageModel.limit,
|
||||
"fdate" to date.value,
|
||||
"fno" to fNo.value,
|
||||
"range" to range,
|
||||
"fdep" to dep.value,
|
||||
"fdest" to dest.value,
|
||||
"countryType" to addressType.value,
|
||||
"serviceType" to serviceType.value,
|
||||
).toRequestBody()
|
||||
)
|
||||
}) {
|
||||
onSuccess = {
|
||||
pageModel.handleListBean(it)
|
||||
count.value = it.total
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onItemClick(position: Int, type: Int) {
|
||||
val bean = pageModel.rv!!.commonAdapter()!!.getItem(position) as FlightBean
|
||||
FlightQueryDetailsActivity.start(getTopActivity(), bean.fid)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package com.lukouguoji.aerologic.page.gnj.jiaojie
|
||||
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import android.widget.CheckBox
|
||||
import com.lukouguoji.aerologic.R
|
||||
import com.lukouguoji.aerologic.databinding.ActivityGnjHandoverListBinding
|
||||
import com.lukouguoji.module_base.base.BaseBindingActivity
|
||||
import com.lukouguoji.module_base.ktx.addOnItemClickListener
|
||||
import com.lukouguoji.module_base.ktx.getLifecycleOwner
|
||||
|
||||
class GnjHandoverListActivity :
|
||||
BaseBindingActivity<ActivityGnjHandoverListBinding, GnjHandoverListViewModel>() {
|
||||
|
||||
override fun layoutId() = R.layout.activity_gnj_handover_list
|
||||
|
||||
override fun viewModelClass() = GnjHandoverListViewModel::class.java
|
||||
|
||||
override fun initOnCreate(savedInstanceState: Bundle?) {
|
||||
setBackArrow("国内进港交接")
|
||||
|
||||
binding.viewModel = viewModel
|
||||
|
||||
|
||||
viewModel.pageModel.bindSmartRefreshLayout(
|
||||
binding.srl,
|
||||
binding.rv,
|
||||
viewModel,
|
||||
getLifecycleOwner()
|
||||
)
|
||||
|
||||
viewModel.refresh()
|
||||
}
|
||||
|
||||
companion object {
|
||||
@JvmStatic
|
||||
fun start(context: Context) {
|
||||
val starter = Intent(context, GnjHandoverListActivity::class.java)
|
||||
context.startActivity(starter)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,190 @@
|
||||
package com.lukouguoji.aerologic.page.gnj.jiaojie
|
||||
|
||||
import android.app.Activity
|
||||
import android.content.Intent
|
||||
import android.view.View
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import com.alibaba.fastjson.JSONArray
|
||||
import com.lukouguoji.aerologic.R
|
||||
import com.lukouguoji.aerologic.page.gnj.query.details.GnjQueryDetailsActivity
|
||||
import com.lukouguoji.module_base.base.BasePageViewModel
|
||||
import com.lukouguoji.module_base.bean.GncAssembleListBean
|
||||
import com.lukouguoji.module_base.bean.GnjQueryBean
|
||||
import com.lukouguoji.module_base.bean.GnjUnloadListBean
|
||||
import com.lukouguoji.module_base.bean.GoodsTransportBean
|
||||
import com.lukouguoji.module_base.common.Constant
|
||||
import com.lukouguoji.module_base.http.net.NetApply
|
||||
import com.lukouguoji.module_base.interfaces.ICheck
|
||||
import com.lukouguoji.module_base.ktx.commonAdapter
|
||||
import com.lukouguoji.module_base.ktx.formatDate
|
||||
import com.lukouguoji.module_base.ktx.launchCollect
|
||||
import com.lukouguoji.module_base.ktx.launchLoadingCollect
|
||||
import com.lukouguoji.module_base.ktx.noNull
|
||||
import com.lukouguoji.module_base.ktx.showToast
|
||||
import com.lukouguoji.module_base.ktx.toJson
|
||||
import com.lukouguoji.module_base.ktx.toRequestBody
|
||||
import com.lukouguoji.module_base.model.PadFilterDialogModel
|
||||
import com.lukouguoji.module_base.model.PadFilterModel
|
||||
import com.lukouguoji.module_base.model.ScanModel
|
||||
import com.lukouguoji.module_base.ui.weight.search.layout.SearchLayoutType
|
||||
import com.lukouguoji.module_base.util.CheckUtil
|
||||
import com.lukouguoji.module_base.util.Common
|
||||
import com.lukouguoji.module_base.util.DictUtils
|
||||
import dev.DevUtils
|
||||
import dev.utils.app.info.KeyValue
|
||||
import dev.utils.common.DateUtils
|
||||
|
||||
class GnjHandoverListViewModel : BasePageViewModel() {
|
||||
|
||||
val date = MutableLiveData(DateUtils.getCurrentTime().formatDate())
|
||||
|
||||
// 航班号
|
||||
val fNo = MutableLiveData("")
|
||||
|
||||
// 始发站
|
||||
val fdep = MutableLiveData("")
|
||||
|
||||
// 平板车
|
||||
val car = MutableLiveData("")
|
||||
|
||||
// 仓管交接
|
||||
val whsOpName = MutableLiveData("")
|
||||
|
||||
// 危险品描述
|
||||
val type = MutableLiveData("")
|
||||
|
||||
// 危险品库
|
||||
val status = MutableLiveData("")
|
||||
|
||||
|
||||
val whsOpNameList = MutableLiveData(listOf(KeyValue("占位", "1"))).apply {
|
||||
DictUtils.getWHSUserList { value = it }
|
||||
}
|
||||
// 类型列表
|
||||
val typeList = MutableLiveData<List<KeyValue>>(emptyList()).apply {
|
||||
DictUtils.getTransTypeList {
|
||||
value = listOf(KeyValue("全部", "")) + it.filter { i -> listOf("3","4").contains(i.value)}
|
||||
}
|
||||
}
|
||||
|
||||
// 状态列表
|
||||
val statusList = MutableLiveData<List<KeyValue>>(emptyList()).apply {
|
||||
DictUtils.getTransStatusList {
|
||||
value = listOf(KeyValue("全部", "")) + it
|
||||
}
|
||||
}
|
||||
|
||||
val itemViewHolder = GnjHanoverListViewHolder::class.java
|
||||
val itemLayoutId = R.layout.item_gnj_handover_list
|
||||
|
||||
val count = MutableLiveData(0)
|
||||
|
||||
val handoverCount = MutableLiveData(0)
|
||||
|
||||
private val filterModel by lazy {
|
||||
PadFilterDialogModel(
|
||||
getTopActivity(), listOf(
|
||||
PadFilterModel(
|
||||
type,
|
||||
"转运类型",
|
||||
"请选择转运类型",
|
||||
type = SearchLayoutType.SPINNER,
|
||||
typeList
|
||||
),
|
||||
PadFilterModel(
|
||||
status,
|
||||
"运输状态",
|
||||
"请选择运输状态",
|
||||
type = SearchLayoutType.SPINNER,
|
||||
statusList
|
||||
),
|
||||
)
|
||||
) {
|
||||
refresh()
|
||||
}
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// 方法区
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
override fun getData() {
|
||||
launchLoadingCollect({
|
||||
NetApply.api.getGnjUnloadCarWithFileList(
|
||||
mapOf(
|
||||
"page" to pageModel.page,
|
||||
"limit" to pageModel.limit,
|
||||
"fdate" to date.value,
|
||||
"fno" to fNo.value,
|
||||
"fdep" to fdep.value,
|
||||
"carId" to car.value,
|
||||
"whsOpName" to whsOpName.value,
|
||||
"transType" to type.value,
|
||||
"transStatus" to status.value
|
||||
).toRequestBody()
|
||||
)
|
||||
}) {
|
||||
onSuccess = {
|
||||
pageModel.handleListBean(it)
|
||||
count.value = it.total
|
||||
handoverCount.value = it.totalCar
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
fun handover() {
|
||||
val list = pageModel.rv!!.commonAdapter()!!.items as List<GnjUnloadListBean>
|
||||
val filter = list.filter { it.checked.get() }
|
||||
if (filter.isEmpty()) {
|
||||
showToast("请选择数据")
|
||||
return
|
||||
}
|
||||
if (filter.any { it.whsOpName.isNotEmpty() }) {
|
||||
showToast("包含已交接数据")
|
||||
return
|
||||
}
|
||||
launchLoadingCollect({
|
||||
NetApply.api.anyPost(
|
||||
"unloadingAirCraft/handover",
|
||||
mapOf(
|
||||
"idList" to filter.map { it.id },
|
||||
).toRequestBody()
|
||||
)
|
||||
}) {
|
||||
onSuccess = {
|
||||
showToast(it.msg.noNull("单证交接成功"))
|
||||
refresh()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun filterClick() {
|
||||
filterModel.show()
|
||||
}
|
||||
|
||||
fun onCarScanClick() {
|
||||
ScanModel.startScan(getTopActivity(), Constant.RequestCode.CAR)
|
||||
}
|
||||
|
||||
fun onAllSelectClick() {
|
||||
val allChecked = pageModel.rv?.commonAdapter()?.items ?.find { item -> !(item as GnjUnloadListBean).checked.get() } == null
|
||||
pageModel.rv?.commonAdapter()?.items?.forEach {
|
||||
(it as GnjUnloadListBean).checked.set(!allChecked)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
|
||||
super.onActivityResult(requestCode, resultCode, data)
|
||||
if (resultCode == Activity.RESULT_OK && data != null) {
|
||||
when (requestCode) {
|
||||
Constant.RequestCode.CAR -> {
|
||||
car.value = data.getStringExtra(Constant.Result.CODED_CONTENT)
|
||||
}
|
||||
|
||||
else -> {}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.lukouguoji.aerologic.page.gnj.jiaojie
|
||||
|
||||
import android.view.View
|
||||
import com.lukouguoji.aerologic.databinding.ItemGnjHandoverListBinding
|
||||
import com.lukouguoji.module_base.base.BaseViewHolder
|
||||
import com.lukouguoji.module_base.bean.GnjUnloadListBean
|
||||
|
||||
class GnjHanoverListViewHolder(view: View) :
|
||||
BaseViewHolder<GnjUnloadListBean, ItemGnjHandoverListBinding>(view) {
|
||||
|
||||
override fun onBind(item: Any?, position: Int) {
|
||||
val itemBean = getItemBean(item)!!
|
||||
binding.bean = itemBean
|
||||
|
||||
binding.ivIcon.setOnClickListener {
|
||||
itemBean.checked.set(!itemBean.checked.get())
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
package com.lukouguoji.aerologic.page.gnj.manifest.add
|
||||
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import android.text.InputType
|
||||
import com.lukouguoji.aerologic.R
|
||||
import com.lukouguoji.aerologic.databinding.ActivityGnjManifestAddBinding
|
||||
import com.lukouguoji.module_base.base.BaseBindingActivity
|
||||
import com.lukouguoji.module_base.common.Constant
|
||||
import com.lukouguoji.module_base.common.DetailsPageType
|
||||
import dev.utils.app.EditTextUtils
|
||||
|
||||
class GnjManifestAddActivity :
|
||||
BaseBindingActivity<ActivityGnjManifestAddBinding, GnjManifestAddViewModel>() {
|
||||
override fun layoutId() = R.layout.activity_gnj_manifest_add
|
||||
|
||||
override fun viewModelClass() = GnjManifestAddViewModel::class.java
|
||||
|
||||
override fun initOnCreate(savedInstanceState: Bundle?) {
|
||||
viewModel.initOnCreate(intent)
|
||||
|
||||
setBackArrow("国内进港舱单${viewModel.pageType.value?.title}")
|
||||
|
||||
binding.viewModel = viewModel
|
||||
|
||||
EditTextUtils.setInputType(binding.pdlWaybill.et, InputType.TYPE_CLASS_NUMBER)
|
||||
|
||||
viewModel.dataBean.observe(this) {
|
||||
if (viewModel.pageType.value == DetailsPageType.Add) {
|
||||
it.fid = intent.getStringExtra(Constant.Key.FLIGHT) ?: ""
|
||||
it.fdep = intent.getStringExtra(Constant.Key.DEPARTURE) ?: ""
|
||||
it.fdest = intent.getStringExtra(Constant.Key.DESTINATION) ?: ""
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
companion object {
|
||||
@JvmStatic
|
||||
fun start(
|
||||
context: Context,
|
||||
id: String = "",
|
||||
modify: Boolean = false,
|
||||
fid: String = "",
|
||||
dep: String = "",
|
||||
dest: String = "",
|
||||
) {
|
||||
val starter = Intent(context, GnjManifestAddActivity::class.java)
|
||||
.putExtra(Constant.Key.ID, id)
|
||||
.putExtra(Constant.Key.FLIGHT, fid)
|
||||
.putExtra(Constant.Key.DEPARTURE, dep)
|
||||
.putExtra(Constant.Key.DESTINATION, dest)
|
||||
.putExtra(Constant.Key.MODIFY, modify)
|
||||
context.startActivity(starter)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,144 @@
|
||||
package com.lukouguoji.aerologic.page.gnj.manifest.add
|
||||
|
||||
import android.content.Intent
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import com.lukouguoji.module_base.base.BaseViewModel
|
||||
import com.lukouguoji.module_base.bean.GnjManifestBean
|
||||
import com.lukouguoji.module_base.common.Constant
|
||||
import com.lukouguoji.module_base.common.DetailsPageType
|
||||
import com.lukouguoji.module_base.http.net.NetApply
|
||||
import com.lukouguoji.module_base.impl.FlowBus
|
||||
import com.lukouguoji.module_base.ktx.launchLoadingCollect
|
||||
import com.lukouguoji.module_base.ktx.loge
|
||||
import com.lukouguoji.module_base.ktx.noNull
|
||||
import com.lukouguoji.module_base.ktx.showConfirmDialog
|
||||
import com.lukouguoji.module_base.ktx.showToast
|
||||
import com.lukouguoji.module_base.ktx.toRequestBody
|
||||
import com.lukouguoji.module_base.ktx.verifyNullOrEmpty
|
||||
import com.lukouguoji.module_base.util.DictUtils
|
||||
import dev.DevUtils
|
||||
import dev.utils.app.info.KeyValue
|
||||
|
||||
class GnjManifestAddViewModel : BaseViewModel() {
|
||||
|
||||
var id = ""
|
||||
|
||||
val add = MutableLiveData(true)
|
||||
val pageType = MutableLiveData(DetailsPageType.Add)
|
||||
|
||||
val agentList = MutableLiveData<List<KeyValue>>().apply {
|
||||
DictUtils.getAgentList(addAll = false) {
|
||||
value = it
|
||||
}
|
||||
}
|
||||
val spCodeList = MutableLiveData<List<KeyValue>>().apply {
|
||||
DictUtils.getSpecialCodeList(addAll = false, flag = 0, ieFlag = "I") {
|
||||
value = it
|
||||
}
|
||||
}
|
||||
val waybillTypeList = MutableLiveData<List<KeyValue>>().apply {
|
||||
DictUtils.getWaybillTypeList2(type = "CI", addAll = false, checkedValue = "CICI1") {
|
||||
value = it
|
||||
}
|
||||
}
|
||||
val businessTypeList = MutableLiveData<List<KeyValue>>().apply {
|
||||
DictUtils.getBusinessTypeList(type = "CI", addAll = false, checkedValue = "ANR") {
|
||||
value = it
|
||||
}
|
||||
}
|
||||
val wxKuList = MutableLiveData<List<KeyValue>>().apply {
|
||||
DictUtils.getWxKuList {
|
||||
value = it
|
||||
}
|
||||
}
|
||||
val wxDescList = MutableLiveData<List<KeyValue>>().apply {
|
||||
DictUtils.getWxDescList {
|
||||
value = it
|
||||
}
|
||||
}
|
||||
|
||||
val dataBean = MutableLiveData(GnjManifestBean())
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// 方法区
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
fun initOnCreate(intent: Intent) {
|
||||
id = intent.getStringExtra(Constant.Key.ID) ?: ""
|
||||
|
||||
val modify = intent.getBooleanExtra(Constant.Key.MODIFY, false)
|
||||
pageType.value = if (id.isEmpty()) DetailsPageType.Add
|
||||
else if (modify) DetailsPageType.Modify else DetailsPageType.Details
|
||||
|
||||
if (id.isNotEmpty()) {
|
||||
getDetails()
|
||||
}
|
||||
}
|
||||
|
||||
private fun getDetails() {
|
||||
launchLoadingCollect({
|
||||
NetApply.api.getGnjManifestDetail(id)
|
||||
}) {
|
||||
onSuccess = {
|
||||
dataBean.value = it.data ?: GnjManifestBean()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun waybillChanged() {
|
||||
val wbNo = dataBean.value!!.wbNo
|
||||
if (wbNo.isEmpty()) {
|
||||
return
|
||||
}
|
||||
if (wbNo.length != 11) {
|
||||
getTopActivity().showConfirmDialog("运单号不能小于11位数字") { }
|
||||
return
|
||||
}
|
||||
if (wbNo.substring(3, 10).toInt().mod(7) != wbNo.last().toString().toInt()) {
|
||||
getTopActivity().showConfirmDialog("运单号不规范,是否强制使用!") { }
|
||||
}
|
||||
}
|
||||
|
||||
fun onSaveClick() {
|
||||
val bean = dataBean.value!!
|
||||
if ((bean.wbNo.verifyNullOrEmpty("请输入运单号")
|
||||
|| bean.agentCode.verifyNullOrEmpty("请选择代理人")
|
||||
|| bean.spCode.verifyNullOrEmpty("请选择特码")
|
||||
|| bean.totalPc.verifyNullOrEmpty("请输入运单件数")
|
||||
|| bean.pc.verifyNullOrEmpty("请输入实到件数")
|
||||
|| bean.weight.verifyNullOrEmpty("请输入实到重量")
|
||||
|| bean.cashWeight.verifyNullOrEmpty("请输入计费重量")
|
||||
|| bean.origin.verifyNullOrEmpty("请输入始发港")
|
||||
|| bean.dest.verifyNullOrEmpty("请输入目的港")
|
||||
|| bean.goods.verifyNullOrEmpty("请输入品名")
|
||||
)
|
||||
) {
|
||||
return
|
||||
}
|
||||
if (bean.origin.length != 3) {
|
||||
loge("始发港长度必须为3")
|
||||
return
|
||||
}
|
||||
if (bean.dest.length != 3) {
|
||||
loge("目的港长度必须为3")
|
||||
return
|
||||
}
|
||||
launchLoadingCollect({
|
||||
NetApply.api.anyPost(
|
||||
if (pageType.value!! == DetailsPageType.Add) "DomImpManiFest/saveFest" else "DomImpManiFest/updateFest",
|
||||
bean.toRequestBody()
|
||||
)
|
||||
}) {
|
||||
onSuccess = {
|
||||
showToast(it.msg.noNull("保存成功"))
|
||||
FlowBus.with<Any>(Constant.Key.FNJ_MANIFEST_ADD).tryEmit(1)
|
||||
getTopActivity().finish()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun onCancelClick() {
|
||||
DevUtils.getTopActivity().finish()
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package com.lukouguoji.aerologic.page.gnj.manifest.list
|
||||
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import com.lukouguoji.aerologic.R
|
||||
import com.lukouguoji.aerologic.databinding.ActivityGnjManifestListBinding
|
||||
import com.lukouguoji.module_base.base.BaseBindingActivity
|
||||
import com.lukouguoji.module_base.ktx.addOnItemClickListener
|
||||
import com.lukouguoji.module_base.ktx.getLifecycleOwner
|
||||
|
||||
class GnjManifestListActivity :
|
||||
BaseBindingActivity<ActivityGnjManifestListBinding, GnjManifestListViewModel>() {
|
||||
|
||||
override fun layoutId() = R.layout.activity_gnj_manifest_list
|
||||
|
||||
override fun viewModelClass() = GnjManifestListViewModel::class.java
|
||||
|
||||
override fun initOnCreate(savedInstanceState: Bundle?) {
|
||||
setBackArrow("国内进港舱单")
|
||||
binding.viewModel = viewModel
|
||||
|
||||
viewModel.pageModel
|
||||
.bindSmartRefreshLayout(binding.srl, binding.rv, viewModel, getLifecycleOwner())
|
||||
binding.rv.addOnItemClickListener(viewModel)
|
||||
|
||||
viewModel.onCreated()
|
||||
}
|
||||
|
||||
companion object {
|
||||
@JvmStatic
|
||||
fun start(context: Context) {
|
||||
val starter = Intent(context, GnjManifestListActivity::class.java)
|
||||
context.startActivity(starter)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.lukouguoji.aerologic.page.gnj.manifest.list
|
||||
|
||||
import android.view.View
|
||||
import com.lukouguoji.aerologic.databinding.ItemGnjManifestListBinding
|
||||
import com.lukouguoji.module_base.base.BaseViewHolder
|
||||
import com.lukouguoji.module_base.bean.GnjManifestBean
|
||||
import com.lukouguoji.module_base.bean.SimpleCheckBean
|
||||
|
||||
class GnjManifestListViewHolder(view: View) :
|
||||
BaseViewHolder<GnjManifestBean, ItemGnjManifestListBinding>(view) {
|
||||
|
||||
override fun onBind(item: Any?, position: Int) {
|
||||
val bean = getItemBean(item)!!
|
||||
binding.bean = bean
|
||||
|
||||
binding.ivIcon.setOnClickListener {
|
||||
bean.checked.set(!bean.checked.get())
|
||||
}
|
||||
|
||||
notifyItemClick(position, binding.tvModify)
|
||||
notifyItemClick(position, binding.tvDelete)
|
||||
notifyItemClick(position, binding.ll)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,212 @@
|
||||
package com.lukouguoji.aerologic.page.gnj.manifest.list
|
||||
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import androidx.lifecycle.viewModelScope
|
||||
import com.lukouguoji.aerologic.R
|
||||
import com.lukouguoji.aerologic.page.gnj.manifest.add.GnjManifestAddActivity
|
||||
import com.lukouguoji.module_base.base.BasePageViewModel
|
||||
import com.lukouguoji.module_base.bean.FlightBean
|
||||
import com.lukouguoji.module_base.bean.GnjManifestBean
|
||||
import com.lukouguoji.module_base.common.Constant
|
||||
import com.lukouguoji.module_base.http.net.NetApply
|
||||
import com.lukouguoji.module_base.impl.FlowBus
|
||||
import com.lukouguoji.module_base.ktx.commonAdapter
|
||||
import com.lukouguoji.module_base.ktx.formatDate
|
||||
import com.lukouguoji.module_base.ktx.launchCollect
|
||||
import com.lukouguoji.module_base.ktx.launchLoadingCollect
|
||||
import com.lukouguoji.module_base.ktx.noNull
|
||||
import com.lukouguoji.module_base.ktx.showToast
|
||||
import com.lukouguoji.module_base.ktx.toRequestBody
|
||||
import com.lukouguoji.module_base.ktx.verifyNullOrEmpty
|
||||
import com.lukouguoji.module_base.model.ConfirmDialogModel
|
||||
import com.lukouguoji.module_base.util.CheckUtil
|
||||
import dev.utils.common.DateUtils
|
||||
import kotlinx.coroutines.flow.launchIn
|
||||
import kotlinx.coroutines.flow.onEach
|
||||
|
||||
class GnjManifestListViewModel : BasePageViewModel() {
|
||||
|
||||
// 日期
|
||||
val date = MutableLiveData(DateUtils.getCurrentTime().formatDate())
|
||||
|
||||
// 航班号
|
||||
val fNo = MutableLiveData("")
|
||||
|
||||
val itemViewHolder = GnjManifestListViewHolder::class.java
|
||||
val itemLayoutId = R.layout.item_gnj_manifest_list
|
||||
|
||||
val count = MutableLiveData(0)
|
||||
val number = MutableLiveData("0")
|
||||
val weight = MutableLiveData("0")
|
||||
|
||||
val flightBean = MutableLiveData(FlightBean())
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// 方法区
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
fun onCreated() {
|
||||
FlowBus.with<Any>(Constant.Key.FNJ_MANIFEST_ADD)
|
||||
.onEach {
|
||||
refresh()
|
||||
}.launchIn(viewModelScope)
|
||||
}
|
||||
|
||||
override fun getData() {
|
||||
if (date.value.verifyNullOrEmpty("请选择航班日期")
|
||||
|| fNo.value.verifyNullOrEmpty("请输入航班号")
|
||||
) {
|
||||
return
|
||||
}
|
||||
launchCollect({
|
||||
NetApply.api.getGnFlightBean(
|
||||
mapOf(
|
||||
"fdate" to date.value,
|
||||
"fno" to fNo.value,
|
||||
).toRequestBody()
|
||||
)
|
||||
}) {
|
||||
onSuccess = {
|
||||
flightBean.value = it.data ?: FlightBean()
|
||||
launchLoadingCollect({
|
||||
NetApply.api.getGnjManifestList(
|
||||
mapOf(
|
||||
"page" to pageModel.page,
|
||||
"limit" to pageModel.limit,
|
||||
"fdate" to date.value,
|
||||
"fno" to fNo.value,
|
||||
"fid" to flightBean.value?.fid,
|
||||
).toRequestBody()
|
||||
)
|
||||
}) {
|
||||
onSuccess = { res ->
|
||||
pageModel.handleListBean(res)
|
||||
count.value = res.total
|
||||
|
||||
getCountData()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
onFailed = { _, message ->
|
||||
showToast(message)
|
||||
flightBean.value = FlightBean()
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private fun getCountData() {
|
||||
launchCollect({
|
||||
NetApply.api.getGnjManifestCount(flightBean.value?.fid.noNull())
|
||||
}) {
|
||||
onSuccess = {
|
||||
number.value = it.data?.totalPc.noNull("0")
|
||||
weight.value = it.data?.totalWeight.noNull("0")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询航班信息
|
||||
*/
|
||||
fun queryFlight() {
|
||||
|
||||
}
|
||||
|
||||
fun addClick() {
|
||||
if (verifyNoFlight()) {
|
||||
showToast("该航班信息不存在,请核实!")
|
||||
return
|
||||
}
|
||||
val bean = flightBean.value!!
|
||||
GnjManifestAddActivity.start(
|
||||
getTopActivity(),
|
||||
fid = bean.fid,
|
||||
dep = bean.fdep,
|
||||
dest = bean.fdest
|
||||
)
|
||||
}
|
||||
|
||||
private fun verifyNoFlight() = flightBean.value == null || flightBean.value!!.fid.isEmpty()
|
||||
|
||||
fun deleteClick() {
|
||||
pageModel.rv?.commonAdapter()?.let {
|
||||
val list =
|
||||
it.items.filter { b -> (b as GnjManifestBean).checked.get() } as List<GnjManifestBean>
|
||||
if (list.isNotEmpty()) {
|
||||
ConfirmDialogModel("确定删除选中的数据吗?") {
|
||||
launchLoadingCollect({
|
||||
NetApply.api.anyPost(
|
||||
"DomImpManiFest/deleteList",
|
||||
list.map { b -> b.mfId }.toRequestBody()
|
||||
)
|
||||
}) {
|
||||
onSuccess = { result ->
|
||||
showToast(result.msg.noNull("删除成功"))
|
||||
refresh()
|
||||
}
|
||||
}
|
||||
}.show()
|
||||
} else {
|
||||
showToast("请选择需要删除的数据")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onItemClick(position: Int, type: Int) {
|
||||
val adapter = pageModel.rv!!.commonAdapter()!!
|
||||
val bean = adapter.getItem(position) as GnjManifestBean
|
||||
when (type) {
|
||||
R.id.tv_delete -> {
|
||||
ConfirmDialogModel("是否删除该条记录?") {
|
||||
launchLoadingCollect({
|
||||
NetApply.api.anyPostForId("/DomImpManiFest/deleteFest", bean.mfId)
|
||||
}) {
|
||||
onSuccess = {
|
||||
showToast(it.msg.noNull("删除成功"))
|
||||
refresh()
|
||||
}
|
||||
}
|
||||
}.show()
|
||||
}
|
||||
|
||||
R.id.tv_modify -> {
|
||||
GnjManifestAddActivity.start(getTopActivity(), bean.mfId, modify = true)
|
||||
}
|
||||
|
||||
R.id.ll -> {
|
||||
GnjManifestAddActivity.start(getTopActivity(), bean.mfId)
|
||||
}
|
||||
|
||||
else -> {}
|
||||
}
|
||||
}
|
||||
|
||||
fun checkAllClick() {
|
||||
pageModel.rv?.commonAdapter()?.let {
|
||||
CheckUtil.handleAllCheck(it.items as List<GnjManifestBean>)
|
||||
}
|
||||
}
|
||||
|
||||
fun sendClick() {
|
||||
val list = (pageModel.rv!!.commonAdapter()!!.items as List<GnjManifestBean>).filter {
|
||||
it.checked.get()
|
||||
}
|
||||
if (list.isEmpty()) {
|
||||
showToast("请选择数据")
|
||||
return
|
||||
}
|
||||
launchLoadingCollect({
|
||||
NetApply.api.anyPost("DomImpManiFest/provide", mapOf(
|
||||
"fid" to flightBean.value?.fid,
|
||||
"ids" to list.map { b -> b.mfId }
|
||||
).toRequestBody())
|
||||
}) {
|
||||
onSuccess = {
|
||||
showToast(it.msg.noNull("货物发放成功"))
|
||||
refresh()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package com.lukouguoji.aerologic.page.gnj.move.stash.list
|
||||
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import com.lukouguoji.aerologic.R
|
||||
import com.lukouguoji.aerologic.databinding.ActivityGnjMoveStashListBinding
|
||||
import com.lukouguoji.module_base.base.BaseBindingActivity
|
||||
import com.lukouguoji.module_base.ktx.getLifecycleOwner
|
||||
|
||||
class GnjMoveStashListActivity :
|
||||
BaseBindingActivity<ActivityGnjMoveStashListBinding, GnjMoveStashListViewModel>() {
|
||||
override fun layoutId() = R.layout.activity_gnj_move_stash_list
|
||||
|
||||
override fun viewModelClass() = GnjMoveStashListViewModel::class.java
|
||||
|
||||
override fun initOnCreate(savedInstanceState: Bundle?) {
|
||||
setBackArrow("国内进港移库")
|
||||
|
||||
binding.viewModel = viewModel
|
||||
|
||||
viewModel.pageModel
|
||||
.bindSmartRefreshLayout(binding.srl, binding.rv, viewModel, getLifecycleOwner())
|
||||
|
||||
viewModel.refresh()
|
||||
}
|
||||
|
||||
companion object {
|
||||
@JvmStatic
|
||||
fun start(context: Context) {
|
||||
val starter = Intent(context, GnjMoveStashListActivity::class.java)
|
||||
context.startActivity(starter)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.lukouguoji.aerologic.page.gnj.move.stash.list
|
||||
|
||||
import android.view.View
|
||||
import com.lukouguoji.aerologic.databinding.ItemGnjMoveStashListBinding
|
||||
import com.lukouguoji.module_base.base.BaseViewHolder
|
||||
import com.lukouguoji.module_base.bean.MoveStashBean
|
||||
import com.lukouguoji.module_base.bean.SimpleCheckBean
|
||||
|
||||
class GnjMoveStashListViewHolder(view: View) :
|
||||
BaseViewHolder<MoveStashBean, ItemGnjMoveStashListBinding>(view) {
|
||||
|
||||
override fun onBind(item: Any?, position: Int) {
|
||||
val bean = getItemBean(item)!!
|
||||
binding.bean = bean
|
||||
|
||||
binding.ivIcon.setOnClickListener {
|
||||
bean.checked.set(!bean.checked.get())
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,186 @@
|
||||
package com.lukouguoji.aerologic.page.gnj.move.stash.list
|
||||
|
||||
import android.app.Activity
|
||||
import android.content.Intent
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import com.alibaba.fastjson.JSONArray
|
||||
import com.lukouguoji.aerologic.R
|
||||
import com.lukouguoji.module_base.base.BasePageViewModel
|
||||
import com.lukouguoji.module_base.bean.MoveStashBean
|
||||
import com.lukouguoji.module_base.common.Constant
|
||||
import com.lukouguoji.module_base.http.net.NetApply
|
||||
import com.lukouguoji.module_base.ktx.commonAdapter
|
||||
import com.lukouguoji.module_base.ktx.launchCollect
|
||||
import com.lukouguoji.module_base.ktx.launchLoadingCollect
|
||||
import com.lukouguoji.module_base.ktx.noNull
|
||||
import com.lukouguoji.module_base.ktx.showConfirmDialog
|
||||
import com.lukouguoji.module_base.ktx.showToast
|
||||
import com.lukouguoji.module_base.ktx.toJson
|
||||
import com.lukouguoji.module_base.ktx.toRequestBody
|
||||
import com.lukouguoji.module_base.model.ScanModel
|
||||
import com.lukouguoji.module_base.util.CheckUtil
|
||||
import com.lukouguoji.module_base.util.Common
|
||||
import com.lukouguoji.module_base.util.DictUtils
|
||||
import dev.DevUtils
|
||||
import dev.utils.app.info.KeyValue
|
||||
import okhttp3.RequestBody
|
||||
|
||||
class GnjMoveStashListViewModel : BasePageViewModel() {
|
||||
|
||||
val businessType = MutableLiveData("")
|
||||
val carrier = MutableLiveData("")
|
||||
val waybill = MutableLiveData("")
|
||||
|
||||
val wbNoList = MutableLiveData<List<String>>()
|
||||
|
||||
val businessTypeList = MutableLiveData(
|
||||
listOf(
|
||||
KeyValue("全部", ""),
|
||||
KeyValue("转国内出港", "CICO"),
|
||||
KeyValue("转国际进港", "CIII"),
|
||||
KeyValue("转国际出港", "CIIO"),
|
||||
)
|
||||
)
|
||||
|
||||
val itemViewHolder = GnjMoveStashListViewHolder::class.java
|
||||
val itemLayoutId = R.layout.item_gnj_move_stash_list
|
||||
|
||||
val count = MutableLiveData(0)
|
||||
val number = MutableLiveData("0")
|
||||
val weight = MutableLiveData("0")
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// 方法区
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
fun waybillScanClick() {
|
||||
ScanModel.startScan(getTopActivity(), Constant.RequestCode.WAYBILL)
|
||||
}
|
||||
|
||||
|
||||
fun getWayBillList() {
|
||||
val requestBody = mapOf(
|
||||
"page" to pageModel.page,
|
||||
"limit" to pageModel.limit,
|
||||
"awbType" to businessType.value!!.ifEmpty { null },
|
||||
"wbNo" to waybill.value!!.ifEmpty { null },
|
||||
"carrier" to carrier.value!!.ifEmpty { null },
|
||||
).toRequestBody()
|
||||
launchCollect({
|
||||
NetApply.api.getGnjMoveStashWbNoList(
|
||||
requestBody
|
||||
)
|
||||
}) {
|
||||
onSuccess = {
|
||||
val results = it.data!!
|
||||
when {
|
||||
results.size == 1 -> {
|
||||
waybill.value = results[0]
|
||||
wbNoList.value = emptyList()
|
||||
}
|
||||
results.size > 1 -> {
|
||||
wbNoList.value = results
|
||||
showWbNoListSelect()
|
||||
}
|
||||
else -> {
|
||||
wbNoList.value = emptyList()
|
||||
}
|
||||
}
|
||||
}
|
||||
onFailed = { i: Int, s: String ->
|
||||
wbNoList.value = emptyList()
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
override fun getData() {
|
||||
val body = mapOf(
|
||||
"page" to pageModel.page,
|
||||
"limit" to pageModel.limit,
|
||||
"awbType" to businessType.value!!.ifEmpty { null },
|
||||
"wbNo" to waybill.value!!.ifEmpty { null },
|
||||
"carrier" to carrier.value!!.ifEmpty { null },
|
||||
).toRequestBody()
|
||||
launchLoadingCollect({
|
||||
NetApply.api.getGnjMoveStashList(
|
||||
body
|
||||
)
|
||||
}) {
|
||||
onSuccess = {
|
||||
pageModel.handleListBean(it)
|
||||
count.value = it.total
|
||||
}
|
||||
}
|
||||
getCountData(body)
|
||||
}
|
||||
|
||||
private fun getCountData(body: RequestBody) {
|
||||
launchCollect({
|
||||
NetApply.api.simplePost("DomImpMove/searchTotal", body)
|
||||
}) {
|
||||
onSuccess = {
|
||||
number.value = it.data?.totalPc.noNull("0")
|
||||
weight.value = it.data?.totalWeight.noNull("0")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
|
||||
if (resultCode == Activity.RESULT_OK && data != null) {
|
||||
when (requestCode) {
|
||||
Constant.RequestCode.WAYBILL -> {
|
||||
waybill.value = data.getStringExtra(Constant.Result.CODED_CONTENT)
|
||||
refresh()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun moveStashClick() {
|
||||
val list = pageModel.rv!!.commonAdapter()!!.items as List<MoveStashBean>
|
||||
val filter = list.filter { it.checked.get() }
|
||||
if (filter.isEmpty()) {
|
||||
showToast("请选择数据")
|
||||
return
|
||||
}
|
||||
getTopActivity().showConfirmDialog("是否移库选中数据") {
|
||||
launchLoadingCollect({
|
||||
NetApply.api.anyPost(
|
||||
"DomImpMove/move", mapOf(
|
||||
"fid" to "0",
|
||||
"ids" to filter.map { it.mawbId },
|
||||
).toRequestBody()
|
||||
)
|
||||
}) {
|
||||
onSuccess = {
|
||||
showToast(it.msg.noNull("移库成功"))
|
||||
refresh()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun checkAllClick() {
|
||||
val list = pageModel.rv!!.commonAdapter()!!.items as List<MoveStashBean>
|
||||
CheckUtil.handleAllCheck(list)
|
||||
}
|
||||
|
||||
private fun showWbNoListSelect() {
|
||||
Common.singleSelect(
|
||||
DevUtils.getTopActivity(),
|
||||
"选择运单号",
|
||||
JSONArray.parseArray(wbNoList.value!!.map {
|
||||
mapOf(
|
||||
"name" to it,
|
||||
"code" to it,
|
||||
)
|
||||
}.toList().toJson(false)),
|
||||
null
|
||||
) { position, _ ->
|
||||
waybill.value = wbNoList.value!![position]
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
package com.lukouguoji.aerologic.page.gnj.query.details
|
||||
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import com.lukouguoji.aerologic.R
|
||||
import com.lukouguoji.aerologic.databinding.ActivityGnjQueryDetailsBinding
|
||||
import com.lukouguoji.aerologic.databinding.ActivityGnjStashDetailsBinding
|
||||
import com.lukouguoji.module_base.base.BaseBindingActivity
|
||||
import com.lukouguoji.module_base.common.Constant
|
||||
import com.lukouguoji.module_base.ktx.refresh
|
||||
|
||||
class GnjQueryDetailsActivity :
|
||||
BaseBindingActivity<ActivityGnjQueryDetailsBinding, GnjQueryDetailsViewModel>() {
|
||||
|
||||
override fun layoutId() = R.layout.activity_gnj_query_details
|
||||
|
||||
override fun viewModelClass() = GnjQueryDetailsViewModel::class.java
|
||||
|
||||
override fun initOnCreate(savedInstanceState: Bundle?) {
|
||||
setBackArrow("国内进港运单详情")
|
||||
binding.viewModel = viewModel
|
||||
|
||||
viewModel.initOnCreated(intent)
|
||||
|
||||
viewModel.list.observe(this) {
|
||||
binding.rv.refresh(it)
|
||||
}
|
||||
}
|
||||
|
||||
companion object {
|
||||
@JvmStatic
|
||||
fun start(context: Context, id: String) {
|
||||
val starter = Intent(context, GnjQueryDetailsActivity::class.java)
|
||||
.putExtra(Constant.Key.ID, id)
|
||||
context.startActivity(starter)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.lukouguoji.aerologic.page.gnj.query.details
|
||||
|
||||
import android.view.View
|
||||
import com.lukouguoji.aerologic.databinding.ItemGnjQueryDetailsBinding
|
||||
import com.lukouguoji.module_base.base.BaseViewHolder
|
||||
import com.lukouguoji.module_base.bean.GnjQueryDetailsBean
|
||||
|
||||
class GnjQueryDetailsViewHolder(view: View) :
|
||||
BaseViewHolder<GnjQueryDetailsBean.Wh, ItemGnjQueryDetailsBinding>(view) {
|
||||
|
||||
override fun onBind(item: Any?, position: Int) {
|
||||
binding.bean = getItemBean(item)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
package com.lukouguoji.aerologic.page.gnj.query.details
|
||||
|
||||
import android.content.Intent
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import com.alibaba.android.arouter.launcher.ARouter
|
||||
import com.lukouguoji.aerologic.R
|
||||
import com.lukouguoji.module_base.base.BaseViewModel
|
||||
import com.lukouguoji.module_base.bean.GncQueryDetailsBean
|
||||
import com.lukouguoji.module_base.bean.GnjQueryBean
|
||||
import com.lukouguoji.module_base.bean.GnjQueryDetailsBean
|
||||
import com.lukouguoji.module_base.common.Constant
|
||||
import com.lukouguoji.module_base.http.net.NetApply
|
||||
import com.lukouguoji.module_base.ktx.launchLoadingCollect
|
||||
import com.lukouguoji.module_base.router.ARouterConstants
|
||||
|
||||
class GnjQueryDetailsViewModel : BaseViewModel() {
|
||||
|
||||
var id = ""
|
||||
|
||||
val dataBean = MutableLiveData(GnjQueryBean())
|
||||
|
||||
val itemLayoutId = R.layout.item_gnj_query_details
|
||||
val viewHolder = GnjQueryDetailsViewHolder::class.java
|
||||
|
||||
val list = MutableLiveData<List<GnjQueryDetailsBean.Wh>>()
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// 方法区
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
fun initOnCreated(intent: Intent) {
|
||||
id = intent.getStringExtra(Constant.Key.ID) ?: ""
|
||||
|
||||
getData()
|
||||
}
|
||||
|
||||
private fun getData() {
|
||||
launchLoadingCollect({
|
||||
NetApply.api.getGnjQueryDetails(id)
|
||||
}) {
|
||||
onSuccess = {
|
||||
dataBean.value = it.data?.maWb ?: GnjQueryBean()
|
||||
list.value = it.data?.whList ?: emptyList()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun onFlowChartClick() {
|
||||
ARouter.getInstance().build(ARouterConstants.ACTIVITY_URL_CARGO_TRACKING)
|
||||
.withString("countryTypeParam", Constant.CargoTracking.gnStatus)
|
||||
.withString("ieFlagParam", Constant.CargoTracking.importStatus)
|
||||
.withString("wbNoParam", dataBean.value!!.wbNo)
|
||||
.navigation()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package com.lukouguoji.aerologic.page.gnj.query.list
|
||||
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import com.lukouguoji.aerologic.R
|
||||
import com.lukouguoji.aerologic.databinding.ActivityGnjQueryListBinding
|
||||
import com.lukouguoji.aerologic.databinding.ActivityGnjStashListBinding
|
||||
import com.lukouguoji.module_base.base.BaseBindingActivity
|
||||
import com.lukouguoji.module_base.ktx.addOnItemClickListener
|
||||
import com.lukouguoji.module_base.ktx.getLifecycleOwner
|
||||
import dev.utils.app.CrashUtils
|
||||
|
||||
class GnjQueryListActivity :
|
||||
BaseBindingActivity<ActivityGnjQueryListBinding, GnjQueryListViewModel>() {
|
||||
|
||||
override fun layoutId() = R.layout.activity_gnj_query_list
|
||||
|
||||
override fun viewModelClass() = GnjQueryListViewModel::class.java
|
||||
|
||||
override fun initOnCreate(savedInstanceState: Bundle?) {
|
||||
setBackArrow("国内进港查询")
|
||||
|
||||
binding.viewModel = viewModel
|
||||
|
||||
viewModel.pageModel
|
||||
.bindSmartRefreshLayout(binding.srl, binding.rv, viewModel, getLifecycleOwner())
|
||||
binding.rv.addOnItemClickListener(viewModel)
|
||||
|
||||
viewModel.refresh()
|
||||
}
|
||||
|
||||
companion object {
|
||||
@JvmStatic
|
||||
fun start(context: Context) {
|
||||
val starter = Intent(context, GnjQueryListActivity::class.java)
|
||||
context.startActivity(starter)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.lukouguoji.aerologic.page.gnj.query.list
|
||||
|
||||
import android.view.View
|
||||
import com.lukouguoji.aerologic.databinding.ItemGnjQueryListBinding
|
||||
import com.lukouguoji.aerologic.databinding.ItemGnjStashListBinding
|
||||
import com.lukouguoji.module_base.base.BaseViewHolder
|
||||
import com.lukouguoji.module_base.bean.GnjQueryBean
|
||||
import com.lukouguoji.module_base.bean.SimpleCheckBean
|
||||
|
||||
class GnjQueryListViewHolder(view: View) :
|
||||
BaseViewHolder<GnjQueryBean, ItemGnjQueryListBinding>(view) {
|
||||
|
||||
override fun onBind(item: Any?, position: Int) {
|
||||
val bean = getItemBean(item)!!
|
||||
binding.bean = bean
|
||||
|
||||
notifyItemClick(position, binding.ll)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,271 @@
|
||||
package com.lukouguoji.aerologic.page.gnj.query.list
|
||||
|
||||
import android.app.Activity
|
||||
import android.content.Intent
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import com.alibaba.fastjson.JSONArray
|
||||
import com.lukouguoji.aerologic.R
|
||||
import com.lukouguoji.aerologic.page.gnj.query.details.GnjQueryDetailsActivity
|
||||
import com.lukouguoji.module_base.base.BasePageViewModel
|
||||
import com.lukouguoji.module_base.bean.GnjQueryBean
|
||||
import com.lukouguoji.module_base.common.Constant
|
||||
import com.lukouguoji.module_base.http.net.NetApply
|
||||
import com.lukouguoji.module_base.ktx.commonAdapter
|
||||
import com.lukouguoji.module_base.ktx.formatDate
|
||||
import com.lukouguoji.module_base.ktx.launchCollect
|
||||
import com.lukouguoji.module_base.ktx.launchLoadingCollect
|
||||
import com.lukouguoji.module_base.ktx.toJson
|
||||
import com.lukouguoji.module_base.ktx.toRequestBody
|
||||
import com.lukouguoji.module_base.model.PadFilterDialogModel
|
||||
import com.lukouguoji.module_base.model.PadFilterModel
|
||||
import com.lukouguoji.module_base.model.ScanModel
|
||||
import com.lukouguoji.module_base.ui.weight.search.layout.SearchLayoutType
|
||||
import com.lukouguoji.module_base.util.Common
|
||||
import com.lukouguoji.module_base.util.DictUtils
|
||||
import dev.DevUtils
|
||||
import dev.utils.app.info.KeyValue
|
||||
import dev.utils.common.DateUtils
|
||||
|
||||
class GnjQueryListViewModel : BasePageViewModel() {
|
||||
|
||||
val date = MutableLiveData(DateUtils.getCurrentTime().formatDate())
|
||||
val dateEnd = MutableLiveData("")
|
||||
|
||||
// 代理人
|
||||
val agent = MutableLiveData("")
|
||||
|
||||
// 特码
|
||||
val spCode = MutableLiveData("")
|
||||
|
||||
// 运单号
|
||||
val waybill = MutableLiveData("")
|
||||
|
||||
// 运单号列表
|
||||
val wbNoList = MutableLiveData<List<String>>()
|
||||
|
||||
|
||||
// 航班号
|
||||
val fNo = MutableLiveData("")
|
||||
|
||||
// 始发港
|
||||
val dep = MutableLiveData("")
|
||||
|
||||
// 目的港
|
||||
val dest = MutableLiveData("")
|
||||
|
||||
// 运单类型
|
||||
val waybillType = MutableLiveData("")
|
||||
|
||||
// 业务类型
|
||||
val businessType = MutableLiveData("")
|
||||
|
||||
// 危险品描述
|
||||
val wxDesc = MutableLiveData("")
|
||||
|
||||
// 危险品库
|
||||
val wxStash = MutableLiveData("")
|
||||
|
||||
// 品名
|
||||
val goodsName = MutableLiveData("")
|
||||
|
||||
val agentList = MutableLiveData(listOf(KeyValue("占位", "1"))).apply {
|
||||
DictUtils.getAgentList { value = it }
|
||||
}
|
||||
val spCodeList = MutableLiveData(listOf(KeyValue("占位", "1"))).apply {
|
||||
DictUtils.getSpecialCodeList(flag = 0, ieFlag = "I") { value = it }
|
||||
}
|
||||
val waybillTypeList = MutableLiveData(listOf(KeyValue("占位", "1"))).apply {
|
||||
DictUtils.getWaybillTypeList2(ieFlag = "I", type = "CI") { value = it }
|
||||
}
|
||||
val businessTypeList = MutableLiveData(listOf(KeyValue("占位", "1"))).apply {
|
||||
DictUtils.getBusinessTypeList(type = "CI") { value = it }
|
||||
}
|
||||
val wxDescList = MutableLiveData(listOf(KeyValue("占位", "1"))).apply {
|
||||
DictUtils.getWxDescList { value = listOf(KeyValue("全部", "")) + it }
|
||||
}
|
||||
val wxStashList = MutableLiveData(listOf(KeyValue("占位", "1"))).apply {
|
||||
DictUtils.getWxKuList { value = listOf(KeyValue("全部", "")) + it }
|
||||
}
|
||||
|
||||
val itemViewHolder = GnjQueryListViewHolder::class.java
|
||||
val itemLayoutId = R.layout.item_gnj_query_list
|
||||
|
||||
val count = MutableLiveData(0)
|
||||
val totalPc = MutableLiveData(0)
|
||||
val totalWeight = MutableLiveData(0.0)
|
||||
|
||||
private val filterModel by lazy {
|
||||
PadFilterDialogModel(
|
||||
getTopActivity(), listOf(
|
||||
PadFilterModel(
|
||||
fNo,
|
||||
"航班号",
|
||||
"请输入航班号",
|
||||
type = SearchLayoutType.INPUT,
|
||||
forcedCap = true
|
||||
),
|
||||
PadFilterModel(
|
||||
dep,
|
||||
"始发港",
|
||||
"请输入始发港",
|
||||
type = SearchLayoutType.INPUT,
|
||||
forcedCap = true
|
||||
),
|
||||
PadFilterModel(
|
||||
waybillType,
|
||||
"运单类型",
|
||||
"请选择运单类型",
|
||||
type = SearchLayoutType.SPINNER,
|
||||
waybillTypeList
|
||||
),
|
||||
PadFilterModel(
|
||||
businessType,
|
||||
"业务类型",
|
||||
"请选择业务类型",
|
||||
type = SearchLayoutType.SPINNER,
|
||||
businessTypeList
|
||||
),
|
||||
PadFilterModel(
|
||||
wxDesc,
|
||||
"危险品描述",
|
||||
"请选择危险品描述",
|
||||
type = SearchLayoutType.SPINNER,
|
||||
wxDescList
|
||||
),
|
||||
PadFilterModel(
|
||||
wxStash,
|
||||
"危险品库",
|
||||
"请选择危险品库",
|
||||
type = SearchLayoutType.SPINNER,
|
||||
wxStashList
|
||||
),
|
||||
PadFilterModel(
|
||||
goodsName,
|
||||
"品名",
|
||||
"请输入品名",
|
||||
type = SearchLayoutType.INPUT,
|
||||
),
|
||||
)
|
||||
) {
|
||||
refresh()
|
||||
}
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// 方法区
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
fun waybillScanClick() {
|
||||
ScanModel.startScan(getTopActivity(), Constant.RequestCode.WAYBILL)
|
||||
}
|
||||
|
||||
fun getWayBillList() {
|
||||
launchCollect({
|
||||
NetApply.api.getGnjQueryWbNoList(
|
||||
mapOf(
|
||||
"page" to pageModel.page,
|
||||
"limit" to pageModel.limit,
|
||||
"beginDate" to date.value,
|
||||
"endDate" to dateEnd.value,
|
||||
"agentCode" to agent.value,
|
||||
"spCode" to spCode.value,
|
||||
"wbNo" to waybill.value,
|
||||
"fno" to fNo.value,
|
||||
"origin" to dep.value,
|
||||
"awbType" to waybillType.value,
|
||||
"businessType" to businessType.value,
|
||||
"dgrDetail" to wxDesc.value,
|
||||
"dgrLocation" to wxStash.value,
|
||||
"goods" to goodsName.value,
|
||||
).toRequestBody()
|
||||
)
|
||||
}) {
|
||||
onSuccess = {
|
||||
val results = it.data!!
|
||||
when {
|
||||
results.size == 1 -> {
|
||||
waybill.value = results[0]
|
||||
wbNoList.value = emptyList()
|
||||
}
|
||||
results.size > 1 -> {
|
||||
wbNoList.value = results
|
||||
showWbNoListSelect()
|
||||
}
|
||||
else -> {
|
||||
wbNoList.value = emptyList()
|
||||
}
|
||||
}
|
||||
}
|
||||
onFailed = { i: Int, s: String ->
|
||||
wbNoList.value = emptyList()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun getData() {
|
||||
launchLoadingCollect({
|
||||
NetApply.api.getGnjQueryList(
|
||||
mapOf(
|
||||
"page" to pageModel.page,
|
||||
"limit" to pageModel.limit,
|
||||
"beginDate" to date.value,
|
||||
"endDate" to dateEnd.value,
|
||||
"agentCode" to agent.value,
|
||||
"spCode" to spCode.value,
|
||||
"wbNo" to waybill.value,
|
||||
"fno" to fNo.value,
|
||||
"origin" to dep.value,
|
||||
"awbType" to waybillType.value,
|
||||
"businessType" to businessType.value,
|
||||
"dgrDetail" to wxDesc.value,
|
||||
"dgrLocation" to wxStash.value,
|
||||
"goods" to goodsName.value,
|
||||
).toRequestBody()
|
||||
)
|
||||
}) {
|
||||
onSuccess = {
|
||||
pageModel.handleListBean(it)
|
||||
count.value = it.total
|
||||
totalPc.value = it.totalPc
|
||||
totalWeight.value = it.totalWeight
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
|
||||
if (resultCode == Activity.RESULT_OK && data != null) {
|
||||
when (requestCode) {
|
||||
Constant.RequestCode.WAYBILL -> {
|
||||
waybill.value = data.getStringExtra(Constant.Result.CODED_CONTENT)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onItemClick(position: Int, type: Int) {
|
||||
val adapter = pageModel.rv!!.commonAdapter()!!
|
||||
val bean = adapter.getItem(position) as GnjQueryBean
|
||||
GnjQueryDetailsActivity.start(getTopActivity(), bean.mawbId)
|
||||
}
|
||||
|
||||
fun filterClick() {
|
||||
filterModel.show()
|
||||
}
|
||||
|
||||
private fun showWbNoListSelect() {
|
||||
Common.singleSelect(
|
||||
DevUtils.getTopActivity(),
|
||||
"选择运单号",
|
||||
JSONArray.parseArray(wbNoList.value!!.map {
|
||||
mapOf(
|
||||
"name" to it,
|
||||
"code" to it,
|
||||
)
|
||||
}.toList().toJson(false)),
|
||||
null
|
||||
) { position, _ ->
|
||||
waybill.value = wbNoList.value!![position]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package com.lukouguoji.aerologic.page.gnj.stash.details
|
||||
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import com.lukouguoji.aerologic.R
|
||||
import com.lukouguoji.aerologic.databinding.ActivityGnjStashDetailsBinding
|
||||
import com.lukouguoji.module_base.base.BaseBindingActivity
|
||||
import com.lukouguoji.module_base.common.Constant
|
||||
|
||||
class GnjStashDetailsActivity :
|
||||
BaseBindingActivity<ActivityGnjStashDetailsBinding, GnjStashDetailsViewModel>() {
|
||||
|
||||
override fun layoutId() = R.layout.activity_gnj_stash_details
|
||||
|
||||
override fun viewModelClass() = GnjStashDetailsViewModel::class.java
|
||||
|
||||
override fun initOnCreate(savedInstanceState: Bundle?) {
|
||||
viewModel.initOnCreated(intent)
|
||||
|
||||
setBackArrow("国内进港运单详情")
|
||||
|
||||
binding.viewModel = viewModel
|
||||
|
||||
}
|
||||
|
||||
companion object {
|
||||
@JvmStatic
|
||||
fun start(context: Context, id: String) {
|
||||
val starter = Intent(context, GnjStashDetailsActivity::class.java)
|
||||
.putExtra(Constant.Key.ID, id)
|
||||
context.startActivity(starter)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
package com.lukouguoji.aerologic.page.gnj.stash.details
|
||||
|
||||
import android.content.Intent
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import com.lukouguoji.module_base.base.BaseViewModel
|
||||
import com.lukouguoji.module_base.bean.GnjStashBean
|
||||
import com.lukouguoji.module_base.common.Constant
|
||||
import com.lukouguoji.module_base.http.net.NetApply
|
||||
import com.lukouguoji.module_base.ktx.launchLoadingCollect
|
||||
import com.lukouguoji.module_base.util.DictUtils
|
||||
import dev.utils.app.info.KeyValue
|
||||
|
||||
class GnjStashDetailsViewModel : BaseViewModel() {
|
||||
|
||||
var id = ""
|
||||
|
||||
val dataBean = MutableLiveData(GnjStashBean())
|
||||
|
||||
val agentList = MutableLiveData<List<KeyValue>>().apply {
|
||||
DictUtils.getAgentList(addAll = false) {
|
||||
value = it
|
||||
}
|
||||
}
|
||||
val spCodeList = MutableLiveData<List<KeyValue>>().apply {
|
||||
DictUtils.getSpecialCodeList(addAll = false,flag = 0, ieFlag = "I") {
|
||||
value = it
|
||||
}
|
||||
}
|
||||
val waybillTypeList = MutableLiveData<List<KeyValue>>().apply {
|
||||
DictUtils.getWaybillTypeList2(type = "CI", addAll = false) {
|
||||
value = it
|
||||
}
|
||||
}
|
||||
val businessTypeList = MutableLiveData<List<KeyValue>>().apply {
|
||||
DictUtils.getBusinessTypeList(type = "CI", addAll = false) {
|
||||
value = it
|
||||
}
|
||||
}
|
||||
val packageTypeList = MutableLiveData<List<KeyValue>>().apply {
|
||||
DictUtils.getPacketTypeList(addAll = false) {
|
||||
value = it
|
||||
}
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// 方法区
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
fun initOnCreated(intent: Intent) {
|
||||
id = intent.getStringExtra(Constant.Key.ID) ?: ""
|
||||
|
||||
if (id.isNotEmpty()) {
|
||||
getDetails()
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取详情
|
||||
*/
|
||||
private fun getDetails() {
|
||||
launchLoadingCollect({
|
||||
NetApply.api.getGnjStashDetails(id)
|
||||
}) {
|
||||
onSuccess = {
|
||||
it.data?.let { data ->
|
||||
dataBean.value = data
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
package com.lukouguoji.aerologic.page.gnj.stash.list
|
||||
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import com.lukouguoji.aerologic.R
|
||||
import com.lukouguoji.aerologic.databinding.ActivityGnjStashListBinding
|
||||
import com.lukouguoji.module_base.base.BaseBindingActivity
|
||||
import com.lukouguoji.module_base.ktx.addOnItemClickListener
|
||||
import com.lukouguoji.module_base.ktx.getLifecycleOwner
|
||||
|
||||
class GnjStashListActivity :
|
||||
BaseBindingActivity<ActivityGnjStashListBinding, GnjStashListViewModel>() {
|
||||
|
||||
override fun layoutId() = R.layout.activity_gnj_stash_list
|
||||
|
||||
override fun viewModelClass() = GnjStashListViewModel::class.java
|
||||
|
||||
override fun initOnCreate(savedInstanceState: Bundle?) {
|
||||
setBackArrow("国内进港仓库")
|
||||
|
||||
binding.viewModel = viewModel
|
||||
|
||||
viewModel.pageModel
|
||||
.bindSmartRefreshLayout(binding.srl, binding.rv, viewModel, getLifecycleOwner())
|
||||
binding.rv.addOnItemClickListener(viewModel)
|
||||
|
||||
viewModel.refresh()
|
||||
}
|
||||
|
||||
companion object {
|
||||
@JvmStatic
|
||||
fun start(context: Context) {
|
||||
val starter = Intent(context, GnjStashListActivity::class.java)
|
||||
context.startActivity(starter)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.lukouguoji.aerologic.page.gnj.stash.list
|
||||
|
||||
import android.view.View
|
||||
import com.lukouguoji.aerologic.databinding.ItemGnjStashListBinding
|
||||
import com.lukouguoji.module_base.base.BaseViewHolder
|
||||
import com.lukouguoji.module_base.bean.GnjStashBean
|
||||
import com.lukouguoji.module_base.bean.SimpleCheckBean
|
||||
|
||||
class GnjStashListViewHolder(view: View) :
|
||||
BaseViewHolder<GnjStashBean, ItemGnjStashListBinding>(view) {
|
||||
|
||||
override fun onBind(item: Any?, position: Int) {
|
||||
val bean = getItemBean(item)!!
|
||||
binding.bean = bean
|
||||
|
||||
notifyItemClick(position, binding.ll)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,210 @@
|
||||
package com.lukouguoji.aerologic.page.gnj.stash.list
|
||||
|
||||
import android.app.Activity
|
||||
import android.content.Intent
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import com.alibaba.fastjson.JSONArray
|
||||
import com.lukouguoji.aerologic.R
|
||||
import com.lukouguoji.aerologic.page.gnj.stash.details.GnjStashDetailsActivity
|
||||
import com.lukouguoji.module_base.base.BasePageViewModel
|
||||
import com.lukouguoji.module_base.bean.GnjStashBean
|
||||
import com.lukouguoji.module_base.bean.SimpleCheckBean
|
||||
import com.lukouguoji.module_base.common.Constant
|
||||
import com.lukouguoji.module_base.http.net.NetApply
|
||||
import com.lukouguoji.module_base.ktx.commonAdapter
|
||||
import com.lukouguoji.module_base.ktx.launchCollect
|
||||
import com.lukouguoji.module_base.ktx.launchLoadingCollect
|
||||
import com.lukouguoji.module_base.ktx.noNull
|
||||
import com.lukouguoji.module_base.ktx.toJson
|
||||
import com.lukouguoji.module_base.ktx.toRequestBody
|
||||
import com.lukouguoji.module_base.model.PadFilterDialogModel
|
||||
import com.lukouguoji.module_base.model.PadFilterModel
|
||||
import com.lukouguoji.module_base.model.ScanModel
|
||||
import com.lukouguoji.module_base.ui.weight.search.layout.SearchLayoutType
|
||||
import com.lukouguoji.module_base.util.Common
|
||||
import com.lukouguoji.module_base.util.DictUtils
|
||||
import dev.DevUtils
|
||||
import dev.utils.app.info.KeyValue
|
||||
import okhttp3.RequestBody
|
||||
|
||||
class GnjStashListViewModel : BasePageViewModel() {
|
||||
|
||||
val sort = MutableLiveData("0")
|
||||
|
||||
// 代理人
|
||||
val agent = MutableLiveData("")
|
||||
|
||||
// 承运人
|
||||
val carrier = MutableLiveData("")
|
||||
|
||||
// 上一航程
|
||||
val lastFlight = MutableLiveData("")
|
||||
|
||||
// 运单号
|
||||
val waybill = MutableLiveData("")
|
||||
|
||||
// 运单号列表
|
||||
val wbNoList = MutableLiveData<List<String>>()
|
||||
|
||||
|
||||
// 库位
|
||||
val stash = MutableLiveData("")
|
||||
|
||||
val sortList = MutableLiveData<List<KeyValue>>(
|
||||
listOf(
|
||||
KeyValue("全部", ""),
|
||||
KeyValue("入库时间", "0"),
|
||||
KeyValue("航程", "1"),
|
||||
KeyValue("库位", "2"),
|
||||
)
|
||||
)
|
||||
val agentList = MutableLiveData<List<KeyValue>>(listOf(KeyValue("占位", "1"))).apply {
|
||||
DictUtils.getAgentList {
|
||||
value = it
|
||||
}
|
||||
}
|
||||
|
||||
val itemViewHolder = GnjStashListViewHolder::class.java
|
||||
val itemLayoutId = R.layout.item_gnj_stash_list
|
||||
|
||||
val count = MutableLiveData("0")
|
||||
val number = MutableLiveData("0")
|
||||
val weight = MutableLiveData("0")
|
||||
|
||||
private val filterModel by lazy {
|
||||
PadFilterDialogModel(
|
||||
getTopActivity(), listOf(
|
||||
PadFilterModel(
|
||||
stash,
|
||||
"库位",
|
||||
"请输入库位",
|
||||
type = SearchLayoutType.INPUT
|
||||
)
|
||||
)
|
||||
) {
|
||||
refresh()
|
||||
}
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// 方法区
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
fun waybillScanClick() {
|
||||
ScanModel.startScan(getTopActivity(), Constant.RequestCode.WAYBILL)
|
||||
}
|
||||
|
||||
fun getWayBillList() {
|
||||
val requestBody = mapOf(
|
||||
"page" to pageModel.page,
|
||||
"limit" to pageModel.limit,
|
||||
"agentCode" to agent.value,
|
||||
"carrier" to carrier.value,
|
||||
"by1" to carrier.value,
|
||||
"fdep" to lastFlight.value,
|
||||
"wbNo" to waybill.value,
|
||||
"location" to stash.value,
|
||||
).toRequestBody()
|
||||
launchCollect({
|
||||
NetApply.api.getGnjStashWbNoList(
|
||||
requestBody
|
||||
)
|
||||
}) {
|
||||
onSuccess = {
|
||||
val results = it.data!!
|
||||
when {
|
||||
results.size == 1 -> {
|
||||
waybill.value = results[0]
|
||||
wbNoList.value = emptyList()
|
||||
}
|
||||
results.size > 1 -> {
|
||||
wbNoList.value = results
|
||||
showWbNoListSelect()
|
||||
}
|
||||
else -> {
|
||||
wbNoList.value = emptyList()
|
||||
}
|
||||
}
|
||||
}
|
||||
onFailed = { i: Int, s: String ->
|
||||
wbNoList.value = emptyList()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun getData() {
|
||||
val requestBody = mapOf(
|
||||
"page" to pageModel.page,
|
||||
"limit" to pageModel.limit,
|
||||
"orderBy" to sort.value,
|
||||
"agentCode" to agent.value,
|
||||
"carrier" to carrier.value,
|
||||
"by1" to carrier.value,
|
||||
"fdep" to lastFlight.value,
|
||||
"wbNo" to waybill.value,
|
||||
"location" to stash.value,
|
||||
).toRequestBody()
|
||||
launchLoadingCollect({
|
||||
NetApply.api.getGnjStashList(
|
||||
requestBody
|
||||
)
|
||||
}) {
|
||||
onSuccess = {
|
||||
pageModel.handleListBean(it)
|
||||
|
||||
getCountData(requestBody)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun getCountData(requestBody: RequestBody) {
|
||||
launchCollect({
|
||||
NetApply.api.simplePost("/DomImpWareHouse/total", requestBody)
|
||||
}) {
|
||||
onSuccess = {
|
||||
it.data?.let { data ->
|
||||
count.value = data.total.noNull("0")
|
||||
number.value = data.pc.noNull("0")
|
||||
weight.value = data.weight.noNull("0")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
|
||||
if (resultCode == Activity.RESULT_OK && data != null) {
|
||||
when (requestCode) {
|
||||
Constant.RequestCode.WAYBILL -> {
|
||||
waybill.value = data.getStringExtra(Constant.Result.CODED_CONTENT)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onItemClick(position: Int, type: Int) {
|
||||
val adapter = pageModel.rv!!.commonAdapter()!!
|
||||
val bean = adapter.getItem(position) as GnjStashBean
|
||||
GnjStashDetailsActivity.start(getTopActivity(), bean.whId)
|
||||
}
|
||||
|
||||
fun filterClick() {
|
||||
filterModel.show()
|
||||
}
|
||||
|
||||
|
||||
private fun showWbNoListSelect() {
|
||||
Common.singleSelect(
|
||||
DevUtils.getTopActivity(),
|
||||
"选择运单号",
|
||||
JSONArray.parseArray(wbNoList.value!!.map {
|
||||
mapOf(
|
||||
"name" to it,
|
||||
"code" to it,
|
||||
)
|
||||
}.toList().toJson(false)),
|
||||
null
|
||||
) { position, _ ->
|
||||
waybill.value = wbNoList.value!![position]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
package com.lukouguoji.aerologic.page.gnj.unload.add
|
||||
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import com.alibaba.fastjson.JSON
|
||||
import com.lukouguoji.aerologic.R
|
||||
import com.lukouguoji.aerologic.databinding.ActivityGnjUnloadAddBinding
|
||||
import com.lukouguoji.module_base.base.BaseBindingActivity
|
||||
import com.lukouguoji.module_base.bean.GnjUnloadListBean
|
||||
import com.lukouguoji.module_base.common.Constant
|
||||
import com.lukouguoji.module_base.ktx.addOnItemClickListener
|
||||
|
||||
class GnjUnloadAddActivity :
|
||||
BaseBindingActivity<ActivityGnjUnloadAddBinding, GnjUnloadAddViewModel>() {
|
||||
|
||||
override fun layoutId() = R.layout.activity_gnj_unload_add
|
||||
|
||||
override fun viewModelClass() = GnjUnloadAddViewModel::class.java
|
||||
|
||||
override fun initOnCreate(savedInstanceState: Bundle?) {
|
||||
setBackArrow("国内进港开始卸机")
|
||||
|
||||
binding.viewModel = viewModel
|
||||
viewModel.rv = binding.rv
|
||||
binding.rv.addOnItemClickListener(viewModel)
|
||||
|
||||
viewModel.initOnCreate(intent)
|
||||
}
|
||||
|
||||
companion object {
|
||||
@JvmStatic
|
||||
fun start(context: Context, data: GnjUnloadListBean) {
|
||||
val starter = Intent(context, GnjUnloadAddActivity::class.java)
|
||||
.putExtra(Constant.Key.DATA, JSON.toJSONString(data))
|
||||
context.startActivity(starter)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.lukouguoji.aerologic.page.gnj.unload.add
|
||||
|
||||
import android.view.View
|
||||
import com.lukouguoji.aerologic.databinding.ItemGnjUnloadAddBinding
|
||||
import com.lukouguoji.module_base.base.BaseViewHolder
|
||||
import com.lukouguoji.module_base.bean.FlatcarBean
|
||||
import com.lukouguoji.module_base.bean.SimpleCheckBean
|
||||
|
||||
class GnjUnloadAddViewHolder(view: View) :
|
||||
BaseViewHolder<FlatcarBean, ItemGnjUnloadAddBinding>(view) {
|
||||
|
||||
override fun onBind(item: Any?, position: Int) {
|
||||
binding.bean = getItemBean(item)
|
||||
|
||||
notifyItemClick(position, binding.tvDelete)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,382 @@
|
||||
package com.lukouguoji.aerologic.page.gnj.unload.add
|
||||
|
||||
import android.app.Activity
|
||||
import android.app.AlertDialog
|
||||
import android.content.Intent
|
||||
import android.util.Log
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.lukouguoji.aerologic.R
|
||||
import com.lukouguoji.aerologic.page.gnj.unload.add.dialog.GnjUnloadAddSetFlightDialogModel
|
||||
import com.lukouguoji.module_base.base.BaseViewModel
|
||||
import com.lukouguoji.module_base.bean.FlatcarBean
|
||||
import com.lukouguoji.module_base.bean.FlightBean
|
||||
import com.lukouguoji.module_base.bean.GnjUnloadListBean
|
||||
import com.lukouguoji.module_base.bean.SimpleCheckBean
|
||||
import com.lukouguoji.module_base.common.Constant
|
||||
import com.lukouguoji.module_base.http.net.NetApply
|
||||
import com.lukouguoji.module_base.interfaces.IOnItemClickListener
|
||||
import com.lukouguoji.module_base.ktx.commonAdapter
|
||||
import com.lukouguoji.module_base.ktx.launchCollect
|
||||
import com.lukouguoji.module_base.ktx.launchLoadingCollect
|
||||
import com.lukouguoji.module_base.ktx.noNull
|
||||
import com.lukouguoji.module_base.ktx.refresh
|
||||
import com.lukouguoji.module_base.ktx.showConfirmDialog
|
||||
import com.lukouguoji.module_base.ktx.showToast
|
||||
import com.lukouguoji.module_base.ktx.toInt
|
||||
import com.lukouguoji.module_base.ktx.toRequestBody
|
||||
import com.lukouguoji.module_base.ktx.verifyNullOrEmpty
|
||||
import com.lukouguoji.module_base.model.ScanModel
|
||||
import com.lukouguoji.module_base.util.DictUtils
|
||||
import dev.DevUtils
|
||||
import dev.utils.app.info.KeyValue
|
||||
import kotlin.properties.Delegates
|
||||
|
||||
class GnjUnloadAddViewModel : BaseViewModel(), IOnItemClickListener {
|
||||
|
||||
var rv: RecyclerView by Delegates.notNull()
|
||||
|
||||
val itemLayoutId = R.layout.item_gnj_unload_add
|
||||
val itemViewHolder = GnjUnloadAddViewHolder::class.java
|
||||
|
||||
val car = MutableLiveData("")
|
||||
|
||||
|
||||
//货物类型:0“国际货”,1“活体鲜活”,2“贵重物品”,3“其他特货”
|
||||
var cargoType = MutableLiveData("")
|
||||
|
||||
var cargoTypeString = MutableLiveData("")
|
||||
|
||||
private lateinit var checkedItems : BooleanArray
|
||||
|
||||
var clearable = MutableLiveData(false)
|
||||
|
||||
private val cargoTypeList = MutableLiveData<List<KeyValue>>()
|
||||
|
||||
|
||||
// val cargoTypeName1 = MutableLiveData(getCargoTypeName())
|
||||
|
||||
val count = MutableLiveData(0)
|
||||
|
||||
private val flightDialog = GnjUnloadAddSetFlightDialogModel {
|
||||
queryFlight()
|
||||
}
|
||||
val flight = MutableLiveData(FlightBean())
|
||||
|
||||
// 业务袋
|
||||
val check = MutableLiveData(false)
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// 方法区
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
fun initOnCreate(intent: Intent) {
|
||||
|
||||
DictUtils.getDicCargoTypeList {
|
||||
cargoTypeList.value = it
|
||||
checkedItems = BooleanArray(it.size)
|
||||
val dataBeanString = intent.getStringExtra(Constant.Key.DATA) ?: ""
|
||||
val unloadList = NetApply.gson.fromJson(dataBeanString, GnjUnloadListBean::class.java)
|
||||
if (unloadList.fid !== "") {
|
||||
flightDialog.date.value = unloadList.fdate
|
||||
flightDialog.fno.value = unloadList.fno
|
||||
queryFlight()
|
||||
}
|
||||
}
|
||||
}
|
||||
fun onCargoTypeClick() {
|
||||
showAlertDialog()
|
||||
}
|
||||
|
||||
private fun showAlertDialog() {
|
||||
val items = cargoTypeList.value
|
||||
val displayValues = items?.map { it.key }?.toTypedArray()
|
||||
val nowCheckedItems = checkedItems.clone()
|
||||
AlertDialog.Builder(getTopActivity())
|
||||
.setTitle("请选择")
|
||||
.setMultiChoiceItems(displayValues, nowCheckedItems) { _, which, isChecked ->
|
||||
// 当选项被点击时更新选中状态
|
||||
nowCheckedItems[which] = isChecked
|
||||
}
|
||||
.setPositiveButton("确定") { dialog, _ ->
|
||||
checkedItems = nowCheckedItems.clone()
|
||||
// 遍历选中的项目
|
||||
val selectedItems = items?.filterIndexed { index, _ -> checkedItems[index] } ?.joinToString(separator = ",") { it.value }
|
||||
val selectedItemsString = items?.filterIndexed { index, _ -> checkedItems[index] } ?.joinToString(separator = ",") { it.key }
|
||||
Log.i("selectedItems", selectedItems.toString())
|
||||
// 显示选择结果
|
||||
if (selectedItems != null) {
|
||||
if (selectedItems.isNotEmpty()) {
|
||||
cargoType.value = selectedItems
|
||||
cargoTypeString.value = selectedItemsString
|
||||
clearable.value = true
|
||||
}
|
||||
}
|
||||
dialog.dismiss()
|
||||
}
|
||||
.setNegativeButton("取消") { dialog, _ ->
|
||||
dialog.dismiss()
|
||||
}
|
||||
.create()
|
||||
.show()
|
||||
}
|
||||
|
||||
fun clearChecked() {
|
||||
checkedItems = cargoTypeList.value?.size?.let { BooleanArray(it) }!!
|
||||
cargoTypeString.value = ""
|
||||
cargoType.value = ""
|
||||
clearable.value = false
|
||||
}
|
||||
|
||||
fun onScanCarClick() {
|
||||
ScanModel.startScan(getTopActivity(), Constant.RequestCode.CAR)
|
||||
}
|
||||
|
||||
/**
|
||||
* 板车号输入完成
|
||||
* 焦点失去
|
||||
*/
|
||||
fun onCarInputFinished() {
|
||||
if (car.value.isNullOrEmpty()) {
|
||||
return
|
||||
}
|
||||
if (rv.commonAdapter()?.items?.find { (it as FlatcarBean).carId == car.value } != null) {
|
||||
showToast("该平板车已添加")
|
||||
return
|
||||
}
|
||||
launchLoadingCollect({
|
||||
NetApply.api.getFlatcarInfo(car.value.noNull())
|
||||
}) {
|
||||
onSuccess = {
|
||||
rv.commonAdapter()?.addItem(it.data)
|
||||
// count.value = count.value?.minus(1)
|
||||
count.value = rv.commonAdapter()?.items?.size
|
||||
}
|
||||
onComplete = {
|
||||
car.value = ""
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onItemClick(position: Int, type: Int) {
|
||||
val adapter = rv!!.commonAdapter()!!
|
||||
val bean = adapter.getItem(position) as FlatcarBean
|
||||
when (type) {
|
||||
R.id.tv_delete -> {
|
||||
getTopActivity().showConfirmDialog("是否删除该条数据?") {
|
||||
|
||||
if (bean.xieJiId.isNotBlank()){
|
||||
launchLoadingCollect({
|
||||
NetApply.api.anyGetForId(
|
||||
"unloadingAirCraft/deleteById", bean.xieJiId
|
||||
)
|
||||
}) {
|
||||
onSuccess = {
|
||||
showToast(it.msg.noNull("删除成功"))
|
||||
rv.commonAdapter()?.removeItem(position)
|
||||
count.value = count.value?.minus(1)
|
||||
}
|
||||
}
|
||||
}else{
|
||||
rv.commonAdapter()?.removeItem(position)
|
||||
count.value = count.value?.minus(1)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
else -> {}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
|
||||
if (resultCode == Activity.RESULT_OK && data != null) {
|
||||
when (requestCode) {
|
||||
Constant.RequestCode.CAR -> {
|
||||
car.value = data.getStringExtra(Constant.Result.CODED_CONTENT)
|
||||
onCarInputFinished()
|
||||
}
|
||||
|
||||
else -> {}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun setFlightClick() {
|
||||
flightDialog.show()
|
||||
}
|
||||
|
||||
private fun queryFlight() {
|
||||
|
||||
println("queryFlight...")
|
||||
launchLoadingCollect({
|
||||
NetApply.api.getGnFlightBean(
|
||||
mapOf(
|
||||
"fdate" to flightDialog.date.value,
|
||||
"fno" to flightDialog.fno.value,
|
||||
"fdest" to "HFE"
|
||||
).toRequestBody()
|
||||
)
|
||||
}) {
|
||||
onSuccess = {
|
||||
if (it.verifySuccess()) {
|
||||
flight.value = it.data
|
||||
launchLoadingCollect({
|
||||
NetApply.api.getGnjUnloadCarList(
|
||||
mapOf(
|
||||
"fdate" to flightDialog.date.value,
|
||||
"fno" to flightDialog.fno.value,
|
||||
).toRequestBody()
|
||||
)
|
||||
}) {
|
||||
onSuccess = { it ->
|
||||
// 获取单证交接--根据上面查出来的航班fid
|
||||
launchCollect({NetApply.api.getHandover(flight.value!!.fid)}){
|
||||
onSuccess = { iit ->
|
||||
check.value = iit.data != null
|
||||
}
|
||||
}
|
||||
println(it.list)
|
||||
// 根据航班查询卸机后根据第一条的货物类型来塞值
|
||||
val first = it.list?.firstOrNull()
|
||||
if (first != null) {
|
||||
cargoType.value = first.cargoType
|
||||
cargoTypeString.value = first.cargoTypeName
|
||||
checkedItems = cargoTypeList.value?.size?.let {
|
||||
BooleanArray(it) { index ->
|
||||
first.cargoType.contains(cargoTypeList.value!![index].value)
|
||||
}
|
||||
}!!
|
||||
if (first.cargoType !== "") {
|
||||
clearable.value = true
|
||||
}
|
||||
if (first.cargoTypeName === "") {
|
||||
cargoTypeString.value = cargoTypeList.value?.filter { item ->
|
||||
first.cargoType.contains(item.value)
|
||||
}
|
||||
?.joinToString(",") { it1 -> it1.key }
|
||||
}
|
||||
}
|
||||
for (item in it.list!!) {
|
||||
launchLoadingCollect({
|
||||
NetApply.api.getFlatcarInfo(item.carId)
|
||||
}) {
|
||||
onSuccess = {
|
||||
var flatcarBean = it.data as FlatcarBean
|
||||
flatcarBean.addFalg = false
|
||||
flatcarBean.xieJiId = item.id
|
||||
rv.commonAdapter()?.addItem(flatcarBean)
|
||||
count.value = count.value?.plus(1)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
showToast(it.msg.noNull("获取数据失败"))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private fun verifyHandover () {
|
||||
// 业务袋(单证交接)--勾选上则新增,不够选择删除
|
||||
if (check.value == true) {
|
||||
launchCollect({
|
||||
NetApply.api.anyPost(
|
||||
"flt/insertHandover",
|
||||
mapOf(
|
||||
"fileType" to "1",
|
||||
"fid" to flight.value!!.fid,
|
||||
"ieFlag" to "I"
|
||||
).toRequestBody()
|
||||
)
|
||||
}) {
|
||||
onSuccess = {}
|
||||
onFailed = { _: Int, _: String -> }
|
||||
}
|
||||
} else {
|
||||
launchCollect({
|
||||
NetApply.api.anyPostForId( "/flt/deleteHandoverByFid", flight.value!!.fid)
|
||||
}) {
|
||||
onSuccess = {}
|
||||
onFailed = { _: Int, _: String -> }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun confirmClick() {
|
||||
if (flight.value!!.fid.verifyNullOrEmpty("请录入航班信息")) {
|
||||
return
|
||||
}
|
||||
if (rv.commonAdapter()?.items?.isNullOrEmpty() == true) {
|
||||
showToast("请添加平板车数据")
|
||||
return
|
||||
}
|
||||
|
||||
// 业务袋(单证交接)--勾选上则新增,不选择删除
|
||||
verifyHandover()
|
||||
// addFalg为true的才新增
|
||||
var filteredList = ArrayList<FlatcarBean>()
|
||||
var airCraftIdList = ArrayList<Long>()
|
||||
for (item in rv.commonAdapter()?.items!!){
|
||||
item as FlatcarBean
|
||||
println("进港卸机id:"+item.xieJiId)
|
||||
if (item.addFalg) {
|
||||
filteredList.add(item)
|
||||
}else{
|
||||
airCraftIdList.add(item.xieJiId.toLong())
|
||||
}
|
||||
}
|
||||
|
||||
//对货物类型判空,走修改接口
|
||||
if(! cargoType.value.isNullOrEmpty() ){
|
||||
launchLoadingCollect({
|
||||
NetApply.api.anyPost(
|
||||
"unloadingAirCraft/update", mapOf(
|
||||
"cargoType" to cargoType.value,
|
||||
"airCraftIdList" to airCraftIdList,
|
||||
).toRequestBody(true)
|
||||
)
|
||||
}) {
|
||||
onSuccess = {
|
||||
println("修改货物类型成功!")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (filteredList.size == 0){
|
||||
DevUtils.getTopActivity().finish()
|
||||
// showToast("请添加平板车数据")
|
||||
return
|
||||
}
|
||||
|
||||
launchLoadingCollect({
|
||||
NetApply.api.anyPost(
|
||||
"unloadingAirCraft/completed", mapOf(
|
||||
"fdate" to flight.value!!.fdate,
|
||||
"fid" to flight.value!!.fid,
|
||||
"fno" to flight.value!!.fno,
|
||||
"cargoType" to cargoType.value,
|
||||
"flatcarList" to filteredList,
|
||||
).toRequestBody(true)
|
||||
)
|
||||
}) {
|
||||
onSuccess = {
|
||||
showToast(it.msg.noNull("确认装板成功"))
|
||||
DevUtils.getTopActivity().finish()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// fun getCargoTypeName(): String {
|
||||
// return when (cargoType) {
|
||||
// "0" -> "国际货"
|
||||
// "1" -> "活体鲜活"
|
||||
// "2" -> "贵重物品"
|
||||
// "3" -> "其他特货"
|
||||
// else -> ""
|
||||
// }
|
||||
// }
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package com.lukouguoji.aerologic.page.gnj.unload.add.dialog
|
||||
|
||||
import android.content.Context
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import com.lukouguoji.aerologic.R
|
||||
import com.lukouguoji.aerologic.databinding.DialogGnjUnloadAddBinding
|
||||
import com.lukouguoji.module_base.base.BaseDialogModel
|
||||
import com.lukouguoji.module_base.ktx.formatDate
|
||||
import com.lukouguoji.module_base.ktx.verifyNullOrEmpty
|
||||
import com.lukouguoji.module_base.util.DictUtils
|
||||
import dev.utils.common.DateUtils
|
||||
|
||||
class GnjUnloadAddSetFlightDialogModel(
|
||||
private val callBack: () -> Unit
|
||||
) : BaseDialogModel<DialogGnjUnloadAddBinding>(
|
||||
DIALOG_TYPE_CENTER
|
||||
) {
|
||||
|
||||
val date = MutableLiveData(DateUtils.getCurrentTime().formatDate())
|
||||
|
||||
val fno = MutableLiveData("")
|
||||
|
||||
//货物类型:0“国际货”,1“活体鲜活”,2“贵重物品”,3“其他特货”
|
||||
var cargoType: String = ""
|
||||
|
||||
val cargoTypeList = DictUtils.airCargoTypeList
|
||||
|
||||
override fun layoutId(): Int {
|
||||
return R.layout.dialog_gnj_unload_add
|
||||
}
|
||||
|
||||
override fun onDialogCreated(context: Context) {
|
||||
binding.model = this
|
||||
}
|
||||
|
||||
fun onConfirmClick() {
|
||||
if ((date.value.verifyNullOrEmpty("请选择航班日期")
|
||||
|| fno.value.verifyNullOrEmpty("请输入航班号"))
|
||||
) {
|
||||
return
|
||||
}
|
||||
dismiss()
|
||||
callBack()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
package com.lukouguoji.aerologic.page.gnj.unload.detail
|
||||
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import com.alibaba.fastjson.JSON
|
||||
import com.lukouguoji.aerologic.databinding.ActivityGnjUnloadDetailsBinding
|
||||
import com.lukouguoji.module_base.base.BaseBindingActivity
|
||||
import com.lukouguoji.module_base.bean.GnjUnloadListBean
|
||||
import com.lukouguoji.module_base.common.Constant
|
||||
import com.lukouguoji.module_base.ktx.addOnItemClickListener
|
||||
import com.lukouguoji.module_base.ktx.getLifecycleOwner
|
||||
|
||||
class GnjUnloadDetailsActivity :
|
||||
BaseBindingActivity<ActivityGnjUnloadDetailsBinding, GnjUnloadDetailsViewModel>() {
|
||||
|
||||
override fun layoutId() = com.lukouguoji.aerologic.R.layout.activity_gnj_unload_details
|
||||
|
||||
override fun viewModelClass() = GnjUnloadDetailsViewModel::class.java
|
||||
|
||||
override fun initOnCreate(savedInstanceState: Bundle?) {
|
||||
setBackArrow("国内进港卸机详情")
|
||||
|
||||
binding.viewModel = viewModel
|
||||
viewModel.pageModel.bindSmartRefreshLayout(
|
||||
binding.srl,
|
||||
binding.rv,
|
||||
viewModel,
|
||||
getLifecycleOwner()
|
||||
)
|
||||
viewModel.initOnCreated(intent)
|
||||
}
|
||||
|
||||
companion object {
|
||||
@JvmStatic
|
||||
fun start(context: Context, data: GnjUnloadListBean) {
|
||||
val starter = Intent(context, GnjUnloadDetailsActivity::class.java)
|
||||
.putExtra(Constant.Key.DATA, JSON.toJSONString(data))
|
||||
context.startActivity(starter)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.lukouguoji.aerologic.page.gnj.unload.detail
|
||||
|
||||
import android.view.View
|
||||
import com.lukouguoji.aerologic.databinding.ItemGnjUnloadCarBinding
|
||||
import com.lukouguoji.module_base.base.BaseViewHolder
|
||||
import com.lukouguoji.module_base.bean.GnjUnloadListBean
|
||||
|
||||
class GnjUnloadDetailsViewHolder(view: View) :
|
||||
BaseViewHolder<GnjUnloadListBean, ItemGnjUnloadCarBinding>(view) {
|
||||
|
||||
override fun onBind(item: Any?, position: Int) {
|
||||
binding.bean = getItemBean(item)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
package com.lukouguoji.aerologic.page.gnj.unload.detail
|
||||
|
||||
import android.content.Intent
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.lukouguoji.aerologic.R
|
||||
import com.lukouguoji.module_base.base.BasePageViewModel
|
||||
import com.lukouguoji.module_base.base.BaseViewModel
|
||||
import com.lukouguoji.module_base.bean.GnjUnloadListBean
|
||||
import com.lukouguoji.module_base.common.Constant
|
||||
import com.lukouguoji.module_base.http.net.NetApply
|
||||
import com.lukouguoji.module_base.ktx.launchCollect
|
||||
import com.lukouguoji.module_base.ktx.launchLoadingCollect
|
||||
import com.lukouguoji.module_base.ktx.toRequestBody
|
||||
import kotlin.properties.Delegates
|
||||
|
||||
class GnjUnloadDetailsViewModel : BasePageViewModel() {
|
||||
|
||||
// 详情信息
|
||||
val dataBean = MutableLiveData<GnjUnloadListBean>()
|
||||
|
||||
// 单证交警--类型
|
||||
val handover = MutableLiveData("")
|
||||
|
||||
val itemViewHolder = GnjUnloadDetailsViewHolder::class.java
|
||||
val itemLayoutId = R.layout.item_gnj_unload_car;
|
||||
|
||||
// val carList = MutableList(List<GnjUnloadListBean>)
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// 方法区
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
fun initOnCreated(intent: Intent) {
|
||||
val dataBeanString = intent.getStringExtra(Constant.Key.DATA) ?: ""
|
||||
dataBean.value = NetApply.gson.fromJson(dataBeanString, GnjUnloadListBean::class.java)
|
||||
refresh()
|
||||
}
|
||||
|
||||
override fun getData() {
|
||||
launchLoadingCollect({
|
||||
NetApply.api.getGnjUnloadCarList(
|
||||
mapOf(
|
||||
"fid" to dataBean.value?.fid,
|
||||
"fdate" to dataBean.value?.fdate
|
||||
).toRequestBody())
|
||||
}) {
|
||||
onSuccess = {
|
||||
launchCollect({NetApply.api.getHandover(dataBean.value!!.fid)}) {
|
||||
onSuccess = { itt ->
|
||||
if (itt.data == null) handover.value = "" else handover.value = "业务袋"
|
||||
}
|
||||
}
|
||||
pageModel.handleListBean(it)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
package com.lukouguoji.aerologic.page.gnj.unload.list
|
||||
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import android.util.Log
|
||||
import android.widget.CheckBox
|
||||
import com.lukouguoji.aerologic.R
|
||||
import com.lukouguoji.aerologic.databinding.ActivityCarListBinding
|
||||
import com.lukouguoji.aerologic.databinding.ActivityGnjUnloadListBinding
|
||||
import com.lukouguoji.module_base.base.BaseBindingActivity
|
||||
import com.lukouguoji.module_base.ktx.addOnItemClickListener
|
||||
import com.lukouguoji.module_base.ktx.getLifecycleOwner
|
||||
|
||||
class GnjUnloadListActivity :
|
||||
BaseBindingActivity<ActivityGnjUnloadListBinding, GnjUnloadListViewModel>() {
|
||||
|
||||
override fun layoutId(): Int {
|
||||
return R.layout.activity_gnj_unload_list
|
||||
}
|
||||
|
||||
override fun viewModelClass(): Class<GnjUnloadListViewModel> {
|
||||
return GnjUnloadListViewModel::class.java
|
||||
}
|
||||
|
||||
override fun initOnCreate(savedInstanceState: Bundle?) {
|
||||
setBackArrow("国内进港卸机")
|
||||
binding.viewModel = viewModel
|
||||
viewModel.pageModel.bindSmartRefreshLayout(
|
||||
binding.srl,
|
||||
binding.rv,
|
||||
viewModel,
|
||||
getLifecycleOwner()
|
||||
)
|
||||
val checkbox: CheckBox = findViewById(R.id.checkbox)
|
||||
checkbox.setOnClickListener() {_ ->
|
||||
viewModel.refresh()
|
||||
}
|
||||
binding.rv.addOnItemClickListener(viewModel)
|
||||
}
|
||||
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
viewModel.refresh()
|
||||
}
|
||||
|
||||
companion object {
|
||||
@JvmStatic
|
||||
fun start(context: Context) {
|
||||
val starter = Intent(context, GnjUnloadListActivity::class.java)
|
||||
context.startActivity(starter)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.lukouguoji.aerologic.page.gnj.unload.list
|
||||
|
||||
import android.view.View
|
||||
import com.lukouguoji.aerologic.databinding.ItemCarListBinding
|
||||
import com.lukouguoji.aerologic.databinding.ItemGnjUnloadListBinding
|
||||
import com.lukouguoji.module_base.base.BaseViewHolder
|
||||
import com.lukouguoji.module_base.bean.CarBean
|
||||
import com.lukouguoji.module_base.bean.GnjUnloadListBean
|
||||
import com.lukouguoji.module_base.bean.SimpleCheckBean
|
||||
|
||||
class GnjUnloadListViewHolder(view: View) :
|
||||
BaseViewHolder<GnjUnloadListBean, ItemGnjUnloadListBinding>(view) {
|
||||
|
||||
override fun onBind(item: Any?, position: Int) {
|
||||
val itemBean = getItemBean(item)!!
|
||||
binding.bean = itemBean
|
||||
|
||||
binding.ivIcon.setOnClickListener {
|
||||
itemBean.checked.set(!itemBean.checked.get())
|
||||
}
|
||||
|
||||
notifyItemClick(position, binding.tvDelete)
|
||||
notifyItemClick(position, binding.tvModify)
|
||||
notifyItemClick(position, binding.llContent)
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,159 @@
|
||||
package com.lukouguoji.aerologic.page.gnj.unload.list
|
||||
|
||||
import android.app.Activity
|
||||
import android.content.Intent
|
||||
import android.util.Log
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import com.lukouguoji.aerologic.R
|
||||
import com.lukouguoji.aerologic.page.car.add.CarDetailsActivity
|
||||
import com.lukouguoji.aerologic.page.car.chart.CarChartActivity
|
||||
import com.lukouguoji.aerologic.page.gnj.unload.add.GnjUnloadAddActivity
|
||||
import com.lukouguoji.aerologic.page.gnj.unload.detail.GnjUnloadDetailsActivity
|
||||
import com.lukouguoji.module_base.base.BasePageViewModel
|
||||
import com.lukouguoji.module_base.bean.CarBean
|
||||
import com.lukouguoji.module_base.bean.DictBean
|
||||
import com.lukouguoji.module_base.bean.GnjUnloadListBean
|
||||
import com.lukouguoji.module_base.bean.MessageBean
|
||||
import com.lukouguoji.module_base.bean.SimpleCheckBean
|
||||
import com.lukouguoji.module_base.common.Constant
|
||||
import com.lukouguoji.module_base.http.net.NetApply
|
||||
import com.lukouguoji.module_base.interfaces.ICheck
|
||||
import com.lukouguoji.module_base.ktx.commonAdapter
|
||||
import com.lukouguoji.module_base.ktx.formatDate
|
||||
import com.lukouguoji.module_base.ktx.launchCollect
|
||||
import com.lukouguoji.module_base.ktx.launchLoadingCollect
|
||||
import com.lukouguoji.module_base.ktx.loge
|
||||
import com.lukouguoji.module_base.ktx.logi
|
||||
import com.lukouguoji.module_base.ktx.noNull
|
||||
import com.lukouguoji.module_base.ktx.showConfirmDialog
|
||||
import com.lukouguoji.module_base.ktx.showToast
|
||||
import com.lukouguoji.module_base.ktx.toRequestBody
|
||||
import com.lukouguoji.module_base.model.ScanModel
|
||||
import com.lukouguoji.module_base.util.CheckUtil
|
||||
import dev.DevUtils
|
||||
import dev.utils.app.info.KeyValue
|
||||
import dev.utils.common.DateUtils
|
||||
import kotlin.math.log
|
||||
|
||||
class GnjUnloadListViewModel : BasePageViewModel() {
|
||||
|
||||
// 日期
|
||||
val date = MutableLiveData(DateUtils.getCurrentTime().formatDate())
|
||||
val fNo = MutableLiveData("")
|
||||
|
||||
// 车号
|
||||
val car = MutableLiveData("")
|
||||
|
||||
// 合计数量
|
||||
val count = MutableLiveData(0)
|
||||
|
||||
val onlyMe = MutableLiveData(true)
|
||||
|
||||
|
||||
val itemLayoutId = R.layout.item_gnj_unload_list
|
||||
val itemViewHolder = GnjUnloadListViewHolder::class.java
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// 方法区
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
override fun getData() {
|
||||
launchLoadingCollect({
|
||||
NetApply.api.getGnjUnloadList(
|
||||
mapOf(
|
||||
"fdate" to date.value,
|
||||
"fno" to fNo.value,
|
||||
"carId" to car.value,
|
||||
"onlyMe" to onlyMe.value
|
||||
).toRequestBody()
|
||||
)
|
||||
}) {
|
||||
onSuccess = {
|
||||
pageModel.handleListBean(it)
|
||||
count.value = it.total
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun onCarScanClick() {
|
||||
ScanModel.startScan(DevUtils.getTopActivity(), Constant.RequestCode.CAR)
|
||||
}
|
||||
|
||||
fun onAddClick() {
|
||||
GnjUnloadAddActivity.start(getTopActivity(), GnjUnloadListBean())
|
||||
}
|
||||
|
||||
fun onDeleteClick() {
|
||||
val adapter = pageModel.rv!!.commonAdapter()!!
|
||||
val filter: List<GnjUnloadListBean> =
|
||||
adapter.items.filter { (it as GnjUnloadListBean).checked.get() } as List<GnjUnloadListBean>
|
||||
if (filter.isEmpty()) {
|
||||
showToast("请选择需要删除的数据")
|
||||
} else {
|
||||
getTopActivity().showConfirmDialog("是否删除选择的航班下所有平板车信息?") {
|
||||
filter.forEach {
|
||||
adapter.removeItem(adapter.items.indexOf(it))
|
||||
}
|
||||
launchLoadingCollect({
|
||||
NetApply.api.anyPost(
|
||||
"unloadingAirCraft/deleteListByFidList",
|
||||
filter.map { b -> b.fid }.toRequestBody()
|
||||
)
|
||||
}) {
|
||||
onSuccess = {
|
||||
showToast(it.msg.noNull("删除成功"))
|
||||
refresh()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onItemClick(position: Int, type: Int) {
|
||||
val adapter = pageModel.rv!!.commonAdapter()!!
|
||||
val bean = adapter.getItem(position) as GnjUnloadListBean
|
||||
Log.i("onItemClick", "${type}")
|
||||
when (type) {
|
||||
R.id.ll_content -> {
|
||||
GnjUnloadDetailsActivity.start(DevUtils.getTopActivity(), bean)
|
||||
}
|
||||
R.id.tv_modify -> {
|
||||
GnjUnloadAddActivity.start(DevUtils.getTopActivity(), bean)
|
||||
}
|
||||
R.id.tv_delete -> {
|
||||
getTopActivity().showConfirmDialog("是否删除该航班下所有平板车信息??") {
|
||||
launchLoadingCollect({
|
||||
NetApply.api.anyGetForId(
|
||||
"unloadingAirCraft/deleteByFid", bean.fid.noNull()
|
||||
)
|
||||
}) {
|
||||
onSuccess = {
|
||||
showToast(it.msg.noNull("删除成功"))
|
||||
adapter.removeItem(position)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
else -> {}
|
||||
}
|
||||
}
|
||||
|
||||
fun onAllSelectClick() {
|
||||
val adapter = pageModel.rv!!.commonAdapter()!!
|
||||
CheckUtil.handleAllCheck(adapter.items as List<ICheck>)
|
||||
}
|
||||
|
||||
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
|
||||
if (resultCode == Activity.RESULT_OK && data != null) {
|
||||
when (requestCode) {
|
||||
Constant.RequestCode.CAR -> {
|
||||
car.value = data.getStringExtra(Constant.Result.CODED_CONTENT)
|
||||
}
|
||||
|
||||
else -> {}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.lukouguoji.aerologic.page.goods.status
|
||||
|
||||
import com.lukouguoji.module_base.base.BasePageViewModel
|
||||
|
||||
class GoodsStatusQueryViewModel : BasePageViewModel() {
|
||||
|
||||
|
||||
override fun getData() {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package com.lukouguoji.aerologic.page.log.list
|
||||
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import com.lukouguoji.aerologic.R
|
||||
import com.lukouguoji.aerologic.databinding.ActivityLogListBinding
|
||||
import com.lukouguoji.module_base.base.BaseBindingActivity
|
||||
import com.lukouguoji.module_base.ktx.getLifecycleOwner
|
||||
|
||||
class LogListActivity : BaseBindingActivity<ActivityLogListBinding, LogListViewModel>() {
|
||||
|
||||
override fun layoutId(): Int {
|
||||
return R.layout.activity_log_list
|
||||
}
|
||||
|
||||
override fun viewModelClass(): Class<LogListViewModel> {
|
||||
return LogListViewModel::class.java
|
||||
}
|
||||
|
||||
override fun initOnCreate(savedInstanceState: Bundle?) {
|
||||
setBackArrow("日志查询")
|
||||
binding.viewModel = viewModel
|
||||
viewModel.pageModel.bindSmartRefreshLayout(
|
||||
binding.srl,
|
||||
binding.rv,
|
||||
viewModel,
|
||||
getLifecycleOwner()
|
||||
)
|
||||
viewModel.refresh()
|
||||
}
|
||||
|
||||
companion object {
|
||||
@JvmStatic
|
||||
fun start(context: Context) {
|
||||
val starter = Intent(context, LogListActivity::class.java)
|
||||
context.startActivity(starter)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.lukouguoji.aerologic.page.log.list
|
||||
|
||||
import android.view.View
|
||||
import com.lukouguoji.aerologic.databinding.ItemLogListBinding
|
||||
import com.lukouguoji.module_base.base.BaseViewHolder
|
||||
import com.lukouguoji.module_base.bean.LogBean
|
||||
|
||||
class LogListViewHolder(view: View) : BaseViewHolder<LogBean, ItemLogListBinding>(view) {
|
||||
|
||||
override fun onBind(item: Any?, position: Int) {
|
||||
binding.bean = getItemBean(item)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
package com.lukouguoji.aerologic.page.log.list
|
||||
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import com.lukouguoji.aerologic.R
|
||||
import com.lukouguoji.module_base.base.BasePageViewModel
|
||||
import com.lukouguoji.module_base.bean.LogBean
|
||||
import com.lukouguoji.module_base.http.net.NetApply
|
||||
import com.lukouguoji.module_base.ktx.formatDate
|
||||
import com.lukouguoji.module_base.ktx.launchLoadingCollect
|
||||
import com.lukouguoji.module_base.ktx.toRequestBody
|
||||
import com.lukouguoji.module_base.util.Common
|
||||
import dev.DevUtils
|
||||
import dev.utils.common.DateUtils
|
||||
import java.util.Calendar
|
||||
|
||||
class LogListViewModel : BasePageViewModel() {
|
||||
|
||||
val startDate = MutableLiveData(DateUtils.getCurrentTime().formatDate())
|
||||
val endDate = MutableLiveData("")
|
||||
|
||||
val keyWord = MutableLiveData("")
|
||||
val operatorId = MutableLiveData("")
|
||||
|
||||
val count = MutableLiveData(0)
|
||||
|
||||
val itemLayoutId = R.layout.item_log_list
|
||||
val itemViewHolder = LogListViewHolder::class.java
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// 方法区
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
override fun getData() {
|
||||
launchLoadingCollect({
|
||||
NetApply.api.getLogList(
|
||||
mapOf(
|
||||
"pageNum" to pageModel.page,
|
||||
"pageSize" to pageModel.limit,
|
||||
"startTime" to startDate.value,
|
||||
"endTime" to endDate.value,
|
||||
"key" to keyWord.value,
|
||||
"opId" to operatorId.value,
|
||||
).toRequestBody()
|
||||
)
|
||||
}) {
|
||||
onSuccess = {
|
||||
pageModel.handleListBean(it)
|
||||
count.value = it.total
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
package com.lukouguoji.aerologic.page.message.details
|
||||
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import com.lukouguoji.aerologic.R
|
||||
import com.lukouguoji.aerologic.databinding.ActivityMessageDetailsBinding
|
||||
import com.lukouguoji.module_base.base.BaseBindingActivity
|
||||
import com.lukouguoji.module_base.bean.MessageBean
|
||||
import com.lukouguoji.module_base.common.Constant
|
||||
import com.lukouguoji.module_base.ktx.toJson
|
||||
|
||||
class MessageDetailsActivity :
|
||||
BaseBindingActivity<ActivityMessageDetailsBinding, MessageDetailsViewModel>() {
|
||||
|
||||
override fun layoutId(): Int {
|
||||
return R.layout.activity_message_details
|
||||
}
|
||||
|
||||
override fun viewModelClass(): Class<MessageDetailsViewModel> {
|
||||
return MessageDetailsViewModel::class.java
|
||||
}
|
||||
|
||||
override fun initOnCreate(savedInstanceState: Bundle?) {
|
||||
setBackArrow("消息展示")
|
||||
binding.viewModel = viewModel
|
||||
|
||||
viewModel.onCreated(intent)
|
||||
}
|
||||
|
||||
companion object {
|
||||
@JvmStatic
|
||||
fun start(context: Context, bean: MessageBean) {
|
||||
val starter = Intent(context, MessageDetailsActivity::class.java)
|
||||
.putExtra(Constant.Key.DATA, bean.toJson(false))
|
||||
context.startActivity(starter)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package com.lukouguoji.aerologic.page.message.details
|
||||
|
||||
import android.content.Intent
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import com.lukouguoji.module_base.base.BaseViewModel
|
||||
import com.lukouguoji.module_base.bean.MessageBean
|
||||
import com.lukouguoji.module_base.common.Constant
|
||||
import com.lukouguoji.module_base.http.net.NetApply
|
||||
import com.lukouguoji.module_base.ktx.launchLoadingCollect
|
||||
import com.lukouguoji.module_base.ktx.noNull
|
||||
import com.lukouguoji.module_base.ktx.showToast
|
||||
|
||||
class MessageDetailsViewModel : BaseViewModel() {
|
||||
|
||||
val bean = MutableLiveData(MessageBean())
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// 方法区
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
fun onCreated(intent: Intent) {
|
||||
// 获取详情
|
||||
bean.value = NetApply.gson
|
||||
.fromJson(intent.getStringExtra(Constant.Key.DATA), MessageBean::class.java)
|
||||
}
|
||||
|
||||
fun onConfirmClick() {
|
||||
launchLoadingCollect({
|
||||
NetApply.api.anyGetForId("/msg/handle", bean.value!!.id)
|
||||
}) {
|
||||
onSuccess = {
|
||||
showToast(it.msg.noNull("处理成功"))
|
||||
bean.value?.state = "1"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package com.lukouguoji.aerologic.page.message.list
|
||||
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import com.lukouguoji.aerologic.R
|
||||
import com.lukouguoji.aerologic.databinding.ActivityMessageListBinding
|
||||
import com.lukouguoji.module_base.base.BaseBindingActivity
|
||||
import com.lukouguoji.module_base.ktx.addOnItemClickListener
|
||||
import com.lukouguoji.module_base.ktx.getLifecycleOwner
|
||||
|
||||
class MessageListActivity :
|
||||
BaseBindingActivity<ActivityMessageListBinding, MessageListViewModel>() {
|
||||
override fun layoutId(): Int {
|
||||
return R.layout.activity_message_list
|
||||
}
|
||||
|
||||
override fun viewModelClass(): Class<MessageListViewModel> {
|
||||
return MessageListViewModel::class.java
|
||||
}
|
||||
|
||||
override fun initOnCreate(savedInstanceState: Bundle?) {
|
||||
setBackArrow("消息管理")
|
||||
binding.viewModel = viewModel
|
||||
viewModel.pageModel.bindSmartRefreshLayout(
|
||||
binding.srl,
|
||||
binding.rv,
|
||||
viewModel,
|
||||
getLifecycleOwner()
|
||||
)
|
||||
|
||||
binding.rv.addOnItemClickListener(viewModel)
|
||||
}
|
||||
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
viewModel.refresh()
|
||||
}
|
||||
|
||||
companion object {
|
||||
@JvmStatic
|
||||
fun start(context: Context) {
|
||||
val starter = Intent(context, MessageListActivity::class.java)
|
||||
context.startActivity(starter)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.lukouguoji.aerologic.page.message.list
|
||||
|
||||
import android.view.View
|
||||
import com.lukouguoji.aerologic.databinding.ItemMessageListBinding
|
||||
import com.lukouguoji.module_base.base.BaseViewHolder
|
||||
import com.lukouguoji.module_base.bean.MessageBean
|
||||
|
||||
class MessageListViewHolder(view: View) :
|
||||
BaseViewHolder<MessageBean, ItemMessageListBinding>(view) {
|
||||
override fun onBind(item: Any?, position: Int) {
|
||||
val itemBean = getItemBean(item)!!
|
||||
binding.bean = itemBean
|
||||
|
||||
binding.ivIcon.setOnClickListener {
|
||||
if (itemBean.state == "0") {
|
||||
itemBean.checked.set(!itemBean.checked.get())
|
||||
}
|
||||
}
|
||||
|
||||
notifyItemClick(position, binding.ll)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,123 @@
|
||||
package com.lukouguoji.aerologic.page.message.list
|
||||
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import com.lukouguoji.aerologic.R
|
||||
import com.lukouguoji.aerologic.page.message.details.MessageDetailsActivity
|
||||
import com.lukouguoji.module_base.base.BasePageViewModel
|
||||
import com.lukouguoji.module_base.bean.MessageBean
|
||||
import com.lukouguoji.module_base.http.net.NetApply
|
||||
import com.lukouguoji.module_base.ktx.commonAdapter
|
||||
import com.lukouguoji.module_base.ktx.formatDate
|
||||
import com.lukouguoji.module_base.ktx.launchCollect
|
||||
import com.lukouguoji.module_base.ktx.launchLoadingCollect
|
||||
import com.lukouguoji.module_base.ktx.noNull
|
||||
import com.lukouguoji.module_base.ktx.showToast
|
||||
import com.lukouguoji.module_base.ktx.toRequestBody
|
||||
import com.lukouguoji.module_base.util.CheckUtil
|
||||
import com.lukouguoji.module_base.util.Common
|
||||
import com.lukouguoji.module_base.util.DictUtils
|
||||
import dev.DevUtils
|
||||
import dev.utils.DevFinal
|
||||
import dev.utils.app.info.KeyValue
|
||||
import dev.utils.common.DateUtils
|
||||
import okhttp3.RequestBody
|
||||
|
||||
class MessageListViewModel : BasePageViewModel() {
|
||||
|
||||
val startDate = MutableLiveData(DateUtils.getCurrentTime().formatDate())
|
||||
|
||||
val endDate = MutableLiveData("")
|
||||
|
||||
// 搜索关键字
|
||||
val keyWord = MutableLiveData("")
|
||||
|
||||
// 处理状态
|
||||
val status = MutableLiveData("")
|
||||
|
||||
// 处理状态列表
|
||||
val statusList = listOf(
|
||||
KeyValue("全部", ""),
|
||||
KeyValue("未处理", "0"),
|
||||
KeyValue("已处理", "1"),
|
||||
)
|
||||
|
||||
val itemLayoutId = R.layout.item_message_list
|
||||
val itemViewHolder = MessageListViewHolder::class.java
|
||||
|
||||
val countDesc = MutableLiveData("合计: 0条, 未处理: 0条, 已处理: 0条")
|
||||
private var count = 0
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// 方法区
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
override fun getData() {
|
||||
val body = mapOf(
|
||||
"pageNum" to pageModel.page,
|
||||
"pageSize" to pageModel.limit,
|
||||
"beginDate" to startDate.value,
|
||||
"endDate" to endDate.value,
|
||||
"content" to keyWord.value,
|
||||
"state" to status.value,
|
||||
).toRequestBody()
|
||||
launchLoadingCollect({
|
||||
NetApply.api.getMessageList(
|
||||
body
|
||||
)
|
||||
}) {
|
||||
onSuccess = {
|
||||
pageModel.handleListBean(it)
|
||||
|
||||
count = it.total
|
||||
getCountData(body)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun getCountData(body: RequestBody) {
|
||||
launchCollect({
|
||||
NetApply.api.simplePost("msg/msgStateQuery", body)
|
||||
}) {
|
||||
onSuccess = {
|
||||
countDesc.value =
|
||||
"合计: ${count}条, " +
|
||||
"未处理: ${it.data?.unread.noNull("0")}条, " +
|
||||
"已处理: ${it.data?.read.noNull("0")}条"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun onAllSelectClick() {
|
||||
pageModel.rv?.commonAdapter()?.items?.let {
|
||||
val list = it as List<MessageBean>
|
||||
CheckUtil.handleAllCheck(list.filter { b -> b.state == "0" })
|
||||
}
|
||||
}
|
||||
|
||||
override fun onItemClick(position: Int, type: Int) {
|
||||
val bean = pageModel.rv?.commonAdapter()?.getItem(position) as MessageBean
|
||||
MessageDetailsActivity.start(DevUtils.getTopActivity(), bean)
|
||||
}
|
||||
|
||||
fun onConfirmClick() {
|
||||
val list = pageModel.rv?.commonAdapter()?.items?.filter {
|
||||
(it as MessageBean).checked.get()
|
||||
} ?: emptyList()
|
||||
if (list.isEmpty()) {
|
||||
showToast("请选择需要处理的数据")
|
||||
return
|
||||
}
|
||||
launchLoadingCollect({
|
||||
NetApply.api.anyPost(
|
||||
"msg/handleList",
|
||||
list.map { (it as MessageBean).id }.toRequestBody()
|
||||
)
|
||||
}) {
|
||||
onSuccess = {
|
||||
showToast(it.msg.noNull("处理成功"))
|
||||
refresh()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.lukouguoji.aerologic.page.telegram.dialog
|
||||
|
||||
import android.content.Context
|
||||
import com.lukouguoji.aerologic.R
|
||||
import com.lukouguoji.aerologic.databinding.DialogTelegramShowBinding
|
||||
import com.lukouguoji.module_base.base.BaseDialogModel
|
||||
|
||||
class TelegramShowDialogModel(
|
||||
val content:String
|
||||
) : BaseDialogModel<DialogTelegramShowBinding>(DIALOG_TYPE_CENTER) {
|
||||
override fun layoutId() = R.layout.dialog_telegram_show
|
||||
|
||||
override fun onDialogCreated(context: Context) {
|
||||
binding.tv.text = content
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package com.lukouguoji.aerologic.page.telegram.list
|
||||
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import com.lukouguoji.aerologic.R
|
||||
import com.lukouguoji.aerologic.databinding.ActivityTelegramListBinding
|
||||
import com.lukouguoji.module_base.base.BaseBindingActivity
|
||||
import com.lukouguoji.module_base.ktx.addOnItemClickListener
|
||||
import com.lukouguoji.module_base.ktx.getLifecycleOwner
|
||||
|
||||
|
||||
class TelegramListActivity :
|
||||
BaseBindingActivity<ActivityTelegramListBinding, TelegramListViewModel>() {
|
||||
|
||||
override fun layoutId(): Int {
|
||||
return R.layout.activity_telegram_list
|
||||
}
|
||||
|
||||
override fun viewModelClass(): Class<TelegramListViewModel> {
|
||||
return TelegramListViewModel::class.java
|
||||
}
|
||||
|
||||
override fun initOnCreate(savedInstanceState: Bundle?) {
|
||||
setBackArrow("电报管理")
|
||||
binding.viewModel = viewModel
|
||||
viewModel.pageModel.bindSmartRefreshLayout(
|
||||
binding.srl,
|
||||
binding.rv,
|
||||
viewModel,
|
||||
getLifecycleOwner()
|
||||
)
|
||||
binding.rv.addOnItemClickListener(viewModel)
|
||||
viewModel.refresh()
|
||||
}
|
||||
|
||||
companion object {
|
||||
@JvmStatic
|
||||
fun start(context: Context) {
|
||||
val starter = Intent(context, TelegramListActivity::class.java)
|
||||
context.startActivity(starter)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.lukouguoji.aerologic.page.telegram.list
|
||||
|
||||
import android.view.View
|
||||
import com.lukouguoji.aerologic.databinding.ItemTelegramListBinding
|
||||
import com.lukouguoji.module_base.base.BaseViewHolder
|
||||
import com.lukouguoji.module_base.bean.TelegramBean
|
||||
|
||||
class TelegramListViewHolder(view: View) :
|
||||
BaseViewHolder<TelegramBean, ItemTelegramListBinding>(view) {
|
||||
|
||||
override fun onBind(item: Any?, position: Int) {
|
||||
binding.bean = getItemBean(item)
|
||||
notifyItemClick(position, binding.ll)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,114 @@
|
||||
package com.lukouguoji.aerologic.page.telegram.list
|
||||
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import com.lukouguoji.aerologic.R
|
||||
import com.lukouguoji.aerologic.page.telegram.dialog.TelegramShowDialogModel
|
||||
import com.lukouguoji.module_base.base.BasePageViewModel
|
||||
import com.lukouguoji.module_base.bean.TelegramBean
|
||||
import com.lukouguoji.module_base.http.net.NetApply
|
||||
import com.lukouguoji.module_base.ktx.commonAdapter
|
||||
import com.lukouguoji.module_base.ktx.formatDate
|
||||
import com.lukouguoji.module_base.ktx.getActivity
|
||||
import com.lukouguoji.module_base.ktx.launchLoadingCollect
|
||||
import com.lukouguoji.module_base.ktx.noNull
|
||||
import com.lukouguoji.module_base.ktx.toRequestBody
|
||||
import com.lukouguoji.module_base.model.PadFilterDialogModel
|
||||
import com.lukouguoji.module_base.model.PadFilterModel
|
||||
import com.lukouguoji.module_base.util.Common
|
||||
import com.lukouguoji.module_base.util.DictUtils
|
||||
import dev.DevUtils
|
||||
import dev.utils.app.info.KeyValue
|
||||
import dev.utils.common.DateUtils
|
||||
import java.util.Calendar
|
||||
|
||||
class TelegramListViewModel : BasePageViewModel() {
|
||||
|
||||
// 开始时间
|
||||
val startDate = MutableLiveData(DateUtils.getCurrentTime().formatDate())
|
||||
|
||||
// 结束时间
|
||||
val endDate = MutableLiveData("")
|
||||
|
||||
// 报文类型
|
||||
val telegramType = MutableLiveData("")
|
||||
val telegramTypeList = MutableLiveData(listOf(KeyValue("占位", "1"))).apply {
|
||||
DictUtils.getTelegramTypeList {
|
||||
value = listOf(KeyValue("全部", "")) + it
|
||||
}
|
||||
}
|
||||
|
||||
// 流向类型
|
||||
val flowType = MutableLiveData("")
|
||||
val flowTypeList = MutableLiveData<List<KeyValue>>(
|
||||
listOf(
|
||||
KeyValue("全部", ""),
|
||||
KeyValue("接收", "0"),
|
||||
KeyValue("发送", "1"),
|
||||
)
|
||||
)
|
||||
|
||||
// 发报地址
|
||||
val address = MutableLiveData("")
|
||||
|
||||
// 检索内容
|
||||
val keyWord = MutableLiveData("")
|
||||
|
||||
val itemLayoutId = R.layout.item_telegram_list
|
||||
val itemViewHolder = TelegramListViewHolder::class.java
|
||||
|
||||
private val filterModel by lazy {
|
||||
PadFilterDialogModel(
|
||||
getTopActivity(), listOf(
|
||||
PadFilterModel(
|
||||
keyWord, title = "报文检索内容", hint = "请输入报文检索内容"
|
||||
)
|
||||
)
|
||||
) {
|
||||
refresh()
|
||||
}
|
||||
}
|
||||
|
||||
val count = MutableLiveData(0)
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// 方法区
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
override fun getData() {
|
||||
launchLoadingCollect({
|
||||
NetApply.api.getTelegramList(
|
||||
mapOf(
|
||||
"pageNum" to pageModel.page,
|
||||
"pageSize" to pageModel.limit,
|
||||
"startTime" to startDate.value,
|
||||
"endTime" to endDate.value,
|
||||
"flow" to flowType.value,
|
||||
"msgType" to telegramType.value,
|
||||
"sendAddress" to address.value,
|
||||
"teleContent" to keyWord.value,
|
||||
).toRequestBody()
|
||||
)
|
||||
}) {
|
||||
onSuccess = {
|
||||
pageModel.handleListBean(it)
|
||||
count.value = it.total
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun onFilterClick() {
|
||||
filterModel.show()
|
||||
}
|
||||
|
||||
override fun onItemClick(position: Int, type: Int) {
|
||||
val bean = pageModel.rv!!.commonAdapter()!!.getItem(position) as TelegramBean
|
||||
launchLoadingCollect({
|
||||
NetApply.api.getTelegramDetails(bean.flow, bean.id)
|
||||
}) {
|
||||
onSuccess = {
|
||||
TelegramShowDialogModel(it.msg.noNull(bean.teleContent)).show()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.lukouguoji.aerologic.page.test
|
||||
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import com.lukouguoji.aerologic.R
|
||||
import com.lukouguoji.aerologic.databinding.ActivityPrintBinding
|
||||
import com.lukouguoji.module_base.base.BaseBindingActivity
|
||||
|
||||
class PrintActivity : BaseBindingActivity<ActivityPrintBinding,PrintViewModel>() {
|
||||
|
||||
override fun layoutId() = R.layout.activity_print
|
||||
|
||||
override fun viewModelClass() = PrintViewModel::class.java
|
||||
|
||||
override fun initOnCreate(savedInstanceState: Bundle?) {
|
||||
binding.viewModel = viewModel
|
||||
}
|
||||
|
||||
companion object{
|
||||
@JvmStatic
|
||||
fun start(context: Context) {
|
||||
val starter = Intent(context, PrintActivity::class.java)
|
||||
context.startActivity(starter)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
package com.lukouguoji.aerologic.page.test
|
||||
|
||||
import com.lukouguoji.module_base.base.BaseViewModel
|
||||
import com.lukouguoji.module_base.bean.GncShouYunBean
|
||||
import com.lukouguoji.module_base.bean.SocketEventBean
|
||||
import com.lukouguoji.module_base.model.BluetoothDialogModel
|
||||
import com.lukouguoji.module_base.model.ConfirmDialogModel
|
||||
import com.lukouguoji.module_base.model.NoticeMessageDialogModel
|
||||
import com.lukouguoji.module_base.util.PrinterUtils
|
||||
import dev.DevUtils
|
||||
|
||||
class PrintViewModel : BaseViewModel() {
|
||||
|
||||
fun search() {
|
||||
// PrinterUtils.searchPrinters()
|
||||
}
|
||||
|
||||
fun printTest() {
|
||||
BluetoothDialogModel()
|
||||
.showCallBack {
|
||||
PrinterUtils.printTest()
|
||||
}
|
||||
}
|
||||
|
||||
fun printCar() {
|
||||
BluetoothDialogModel()
|
||||
.showCallBack {
|
||||
PrinterUtils.printCar("012")
|
||||
}
|
||||
}
|
||||
|
||||
fun printBox() {
|
||||
BluetoothDialogModel()
|
||||
.showCallBack {
|
||||
PrinterUtils.printBox()
|
||||
}
|
||||
}
|
||||
|
||||
fun printShouYun() {
|
||||
BluetoothDialogModel()
|
||||
.showCallBack {
|
||||
val bean = GncShouYunBean()
|
||||
bean.opDate = "2.21"
|
||||
bean.fno = "CZ8514"
|
||||
bean.dest = "PEK"
|
||||
bean.location = "167"
|
||||
bean.username = ""
|
||||
PrinterUtils.printShouYun(bean)
|
||||
}
|
||||
}
|
||||
|
||||
fun mockWebSocket() {
|
||||
NoticeMessageDialogModel.show(SocketEventBean().apply {
|
||||
content =
|
||||
"航班240625/MU2266卸机完成时间从机坪转运区到进港库区环节完成运输时间超过90分钟,该航班对应的板车:012,请尽快处理!"
|
||||
})
|
||||
}
|
||||
|
||||
fun showCommonDialog() {
|
||||
ConfirmDialogModel(message = "提示弹窗") {
|
||||
|
||||
}.show()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package com.lukouguoji.aerologic.page.transport
|
||||
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import com.lukouguoji.aerologic.R
|
||||
import com.lukouguoji.aerologic.databinding.ActivityGoodsTransportBinding
|
||||
import com.lukouguoji.module_base.base.BaseBindingActivity
|
||||
import com.lukouguoji.module_base.ktx.addOnItemClickListener
|
||||
import com.lukouguoji.module_base.ktx.getLifecycleOwner
|
||||
|
||||
class GoodsTransportActivity :
|
||||
BaseBindingActivity<ActivityGoodsTransportBinding, GoodsTransportViewModel>() {
|
||||
override fun layoutId(): Int {
|
||||
return R.layout.activity_goods_transport
|
||||
}
|
||||
|
||||
override fun viewModelClass(): Class<GoodsTransportViewModel> {
|
||||
return GoodsTransportViewModel::class.java
|
||||
}
|
||||
|
||||
override fun initOnCreate(savedInstanceState: Bundle?) {
|
||||
setBackArrow("货物转运")
|
||||
binding.viewModel = viewModel
|
||||
viewModel.pageModel.bindSmartRefreshLayout(
|
||||
binding.srl,
|
||||
binding.rv,
|
||||
viewModel,
|
||||
getLifecycleOwner()
|
||||
)
|
||||
binding.rv.addOnItemClickListener(viewModel)
|
||||
}
|
||||
|
||||
companion object {
|
||||
@JvmStatic
|
||||
fun start(context: Context) {
|
||||
val starter = Intent(context, GoodsTransportActivity::class.java)
|
||||
context.startActivity(starter)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.lukouguoji.aerologic.page.transport
|
||||
|
||||
import android.view.View
|
||||
import com.lukouguoji.aerologic.databinding.ItemGoodsTransportBinding
|
||||
import com.lukouguoji.module_base.base.BaseViewHolder
|
||||
import com.lukouguoji.module_base.bean.GoodsTransportBean
|
||||
|
||||
class GoodsTransportViewHolder(view: View) :
|
||||
BaseViewHolder<GoodsTransportBean, ItemGoodsTransportBinding>(view) {
|
||||
|
||||
override fun onBind(item: Any?, position: Int) {
|
||||
val itemBean = getItemBean(item)!!
|
||||
binding.bean = itemBean
|
||||
|
||||
notifyItemClick(position, binding.ivIcon)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,342 @@
|
||||
package com.lukouguoji.aerologic.page.transport
|
||||
|
||||
import android.app.Activity
|
||||
import android.content.Intent
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import com.lukouguoji.aerologic.R
|
||||
import com.lukouguoji.module_base.base.BasePageViewModel
|
||||
import com.lukouguoji.module_base.bean.GoodsTransportBean
|
||||
import com.lukouguoji.module_base.common.Constant
|
||||
import com.lukouguoji.module_base.http.net.NetApply
|
||||
import com.lukouguoji.module_base.interfaces.ICheck
|
||||
import com.lukouguoji.module_base.ktx.commonAdapter
|
||||
import com.lukouguoji.module_base.ktx.formatDate
|
||||
import com.lukouguoji.module_base.ktx.launchLoadingCollect
|
||||
import com.lukouguoji.module_base.ktx.loge
|
||||
import com.lukouguoji.module_base.ktx.noNull
|
||||
import com.lukouguoji.module_base.ktx.showConfirmDialog
|
||||
import com.lukouguoji.module_base.ktx.showToast
|
||||
import com.lukouguoji.module_base.ktx.toRequestBody
|
||||
import com.lukouguoji.module_base.model.GoodsTransportModifyDialogModel
|
||||
import com.lukouguoji.module_base.model.GoodsTransportReturnDialogModel
|
||||
import com.lukouguoji.module_base.model.PadFilterDialogModel
|
||||
import com.lukouguoji.module_base.model.PadFilterModel
|
||||
import com.lukouguoji.module_base.model.ScanModel
|
||||
import com.lukouguoji.module_base.ui.weight.search.layout.SearchLayoutType
|
||||
import com.lukouguoji.module_base.util.CheckUtil
|
||||
import com.lukouguoji.module_base.util.DictUtils
|
||||
import com.lukouguoji.module_base.util.HandlerUtils
|
||||
import dev.utils.app.info.KeyValue
|
||||
import dev.utils.common.DateUtils
|
||||
|
||||
class GoodsTransportViewModel : BasePageViewModel() {
|
||||
|
||||
// 日期
|
||||
val date = MutableLiveData(DateUtils.getCurrentTime().formatDate())
|
||||
|
||||
// 航班号
|
||||
val flightNo = MutableLiveData("")
|
||||
|
||||
// 司机
|
||||
val driver = MutableLiveData("")
|
||||
|
||||
// 类型
|
||||
val type = MutableLiveData("")
|
||||
|
||||
// 状态
|
||||
val status = MutableLiveData("")
|
||||
|
||||
// 板车号
|
||||
val car = MutableLiveData("")
|
||||
|
||||
// 状态列表
|
||||
val statusList = MutableLiveData<List<KeyValue>>(emptyList()).apply {
|
||||
DictUtils.getTransStatusList {
|
||||
value = listOf(KeyValue("全部", "")) + it
|
||||
}
|
||||
}
|
||||
|
||||
// 司机列表
|
||||
val driverList = MutableLiveData<List<KeyValue>>(emptyList()).apply {
|
||||
DictUtils.getDriverList {
|
||||
value = listOf(KeyValue("全部", "")) + it
|
||||
}
|
||||
}
|
||||
|
||||
// 类型列表
|
||||
val typeList = MutableLiveData<List<KeyValue>>(emptyList()).apply {
|
||||
DictUtils.getTransTypeListByRole {
|
||||
value = it
|
||||
type.value = it.firstOrNull()?.value ?: ""
|
||||
refresh()
|
||||
}
|
||||
}
|
||||
|
||||
val itemLayoutId = R.layout.item_goods_transport
|
||||
val itemViewHolder = GoodsTransportViewHolder::class.java
|
||||
|
||||
private val filterModel by lazy {
|
||||
PadFilterDialogModel(
|
||||
getTopActivity(), listOf(
|
||||
PadFilterModel(
|
||||
driver,
|
||||
title = "司机",
|
||||
list = driverList,
|
||||
type = SearchLayoutType.SPINNER,
|
||||
hint = "请选择司机"
|
||||
)
|
||||
)
|
||||
) {
|
||||
refresh()
|
||||
}
|
||||
}
|
||||
|
||||
val count = MutableLiveData("0")
|
||||
|
||||
// 补位补充是否可用
|
||||
val supplementEnable = MutableLiveData(false)
|
||||
|
||||
// 确认按钮是否可用
|
||||
val confirmEnable = MutableLiveData(true)
|
||||
|
||||
// 退回按钮是否可用
|
||||
val returnEnable = MutableLiveData(false)
|
||||
|
||||
// 确认文字
|
||||
val confirmText = MutableLiveData("开始运输")
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// 方法区
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
override fun getData() {
|
||||
if(type.value.isNullOrEmpty()){
|
||||
return
|
||||
}
|
||||
launchLoadingCollect({
|
||||
NetApply.api.getGoodsTransportList(
|
||||
mapOf(
|
||||
"pageNum" to pageModel.page,
|
||||
"pageSize" to pageModel.limit,
|
||||
"fdate" to date.value,
|
||||
"fno" to flightNo.value,
|
||||
"transStatus" to status.value,
|
||||
"transType" to type.value,
|
||||
"driver" to driver.value,
|
||||
"carId" to car.value,
|
||||
).toRequestBody()
|
||||
)
|
||||
}) {
|
||||
onSuccess = {
|
||||
pageModel.handleListBean(it)
|
||||
count.value = it.total.toString()
|
||||
HandlerUtils.postRunnable({
|
||||
computeEnableState()
|
||||
}, 100)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 平板车 扫描
|
||||
*/
|
||||
fun carScan() {
|
||||
ScanModel.startScan(getTopActivity(), Constant.RequestCode.CAR)
|
||||
}
|
||||
|
||||
/**
|
||||
* 全选
|
||||
*/
|
||||
fun onAllSelectClick() {
|
||||
val list = getAdapter().items as List<GoodsTransportBean>
|
||||
if (list.groupBy { it.transStatus }.size > 1 || list.groupBy { it.endFlag }.size > 1) {
|
||||
showToast("数据存在多种状态,无法全选")
|
||||
return
|
||||
}
|
||||
CheckUtil.handleAllCheck(pageModel.rv!!.commonAdapter()!!.items as List<ICheck>)
|
||||
computeEnableState()
|
||||
}
|
||||
|
||||
fun onFilterClick() {
|
||||
filterModel.show()
|
||||
}
|
||||
|
||||
fun onAddCargo() {
|
||||
val list = (getAdapter().items as List<GoodsTransportBean>).filter { it.checked.get() }
|
||||
if (list.isEmpty()) {
|
||||
showToast("请选中需要补充机位的平板车信息!")
|
||||
return
|
||||
}
|
||||
getTopActivity().showConfirmDialog("是否完成加货?") {
|
||||
var canAddCargo = true
|
||||
for (obj in list) {
|
||||
if (obj.addCargoFlag != "1") {
|
||||
showToast("平板车不可加货!")
|
||||
canAddCargo = false
|
||||
break
|
||||
}
|
||||
}
|
||||
if (canAddCargo) {
|
||||
launchLoadingCollect({
|
||||
NetApply.api.anyPost(
|
||||
url = "DomExpLoading/updateAddCargo",
|
||||
mapOf(
|
||||
"useIdList" to list.map { it.useId },
|
||||
).toRequestBody()
|
||||
)
|
||||
}) {
|
||||
onSuccess = {
|
||||
showToast(it.msg.noNull("完成加货成功"))
|
||||
refresh()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun returnClick() {
|
||||
val list = (getAdapter().items as List<GoodsTransportBean>).filter { it.checked.get() }
|
||||
if (list.isEmpty()) {
|
||||
showToast("请选择数据")
|
||||
return
|
||||
}
|
||||
val inOutStatus = list.first().status
|
||||
GoodsTransportReturnDialogModel(
|
||||
list.joinToString("、") { it.carId }
|
||||
) {
|
||||
launchLoadingCollect({
|
||||
NetApply.api.anyPost(
|
||||
url = if (inOutStatus == "0") "DomExpLoading/backTrans" else "unloadingAirCraft/backTrans",
|
||||
mapOf(
|
||||
"backDirection" to it.data.value,
|
||||
"transType" to list.first().transType,
|
||||
"useIdList" to list.map { it.useId }
|
||||
).toRequestBody())
|
||||
}) {
|
||||
onSuccess = {
|
||||
showToast(it.msg.noNull("退回成功"))
|
||||
refresh()
|
||||
}
|
||||
}
|
||||
}.show()
|
||||
}
|
||||
|
||||
fun onSupplementClick() {
|
||||
val adapter = pageModel.rv!!.commonAdapter()!!
|
||||
val list = (adapter.items as List<GoodsTransportBean>).filter { it.checked.get() }
|
||||
if (list.isEmpty()) {
|
||||
showToast("请选中需要补充机位的平板车信息!")
|
||||
return
|
||||
}
|
||||
val inOutStatus = list.first().status
|
||||
GoodsTransportModifyDialogModel(
|
||||
list.joinToString("、") { it.carId }
|
||||
) {
|
||||
launchLoadingCollect({
|
||||
NetApply.api.anyPost(
|
||||
url = "DomExpLoading/updateStandId",
|
||||
mapOf(
|
||||
"status" to inOutStatus,
|
||||
"standId" to it.data.value,
|
||||
"transType" to list.first().transType,
|
||||
"useIdList" to list.map { it.useId },
|
||||
).toRequestBody()
|
||||
)
|
||||
}) {
|
||||
onSuccess = {
|
||||
showToast(it.msg.noNull("补充机位成功"))
|
||||
refresh()
|
||||
}
|
||||
}
|
||||
}.show()
|
||||
}
|
||||
|
||||
fun onConfirmClick() {
|
||||
val adapter = pageModel.rv!!.commonAdapter()!!
|
||||
val list = (adapter.items as List<GoodsTransportBean>).filter { it.checked.get() }
|
||||
if (list.isEmpty()) {
|
||||
showToast("请选中需要转运的平板车信息!")
|
||||
return
|
||||
}
|
||||
val inOutStatus = list.first().status
|
||||
getTopActivity().showConfirmDialog("是否确定${confirmText.value}?") {
|
||||
launchLoadingCollect({
|
||||
NetApply.api.anyPost(
|
||||
url = if (inOutStatus == "0") {
|
||||
if (confirmText.value == "开始运输") "/DomExpLoading/startTrans" else "/DomExpLoading/finishTrans"
|
||||
} else {
|
||||
if (confirmText.value == "开始运输") "/unloadingAirCraft/startTrans" else "/unloadingAirCraft/finishTrans"
|
||||
},
|
||||
mapOf(
|
||||
"fdate" to date.value,
|
||||
"transType" to list.first().transType,
|
||||
"useIdList" to list.map { it.useId }
|
||||
).toRequestBody()
|
||||
)
|
||||
}) {
|
||||
onSuccess = {
|
||||
showToast(it.msg.noNull("操作成功"))
|
||||
refresh()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onItemClick(position: Int, type: Int) {
|
||||
val list = getAdapter().items as List<GoodsTransportBean>
|
||||
val bean = list[position]
|
||||
if (!bean.canReturn() && bean.endFlag == "1") {
|
||||
// 不能退回且已结束的数据不允许点击
|
||||
return
|
||||
}
|
||||
when (type) {
|
||||
R.id.iv_icon -> {
|
||||
val checkedStatus = list.firstOrNull { it.checked.get() }?.transStatus ?: ""
|
||||
// 没有选中,或选中状态一致,则处理逻辑
|
||||
if (checkedStatus.isEmpty() || checkedStatus == bean.transStatus) {
|
||||
bean.checked.set(!bean.checked.get())
|
||||
}
|
||||
}
|
||||
|
||||
else -> {}
|
||||
}
|
||||
computeEnableState()
|
||||
}
|
||||
|
||||
/**
|
||||
* 计算可用信息
|
||||
*/
|
||||
private fun computeEnableState() {
|
||||
val list = getAdapter().items as List<GoodsTransportBean>
|
||||
// 补充机位是否可用
|
||||
supplementEnable.value = list.firstOrNull()?.transType in listOf("2", "8", "9")
|
||||
|
||||
loge("判断补充机位是否可用 : ${supplementEnable.value}")
|
||||
// 选中结束状态的数据,则不展示
|
||||
confirmEnable.value = list.firstOrNull { it.checked.get() }?.endFlag != "1"
|
||||
// 确认是否可用
|
||||
confirmText.value = if (list.firstOrNull { it.checked.get() }?.transStatus == "1") {
|
||||
"完成运输"
|
||||
} else {
|
||||
"开始运输"
|
||||
}
|
||||
|
||||
// 退回是否可用
|
||||
// returnEnable.value = list.firstOrNull { it.checked.get() }?.canReturn() == true
|
||||
}
|
||||
|
||||
private fun getAdapter() = pageModel.rv!!.commonAdapter()!!
|
||||
|
||||
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
|
||||
super.onActivityResult(requestCode, resultCode, data)
|
||||
if (resultCode == Activity.RESULT_OK && data != null) {
|
||||
when (requestCode) {
|
||||
Constant.RequestCode.CAR -> {
|
||||
car.value = data.getStringExtra(Constant.Result.CODED_CONTENT)
|
||||
}
|
||||
|
||||
else -> {}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package com.lukouguoji.aerologic.page.transportLog.list
|
||||
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import com.lukouguoji.aerologic.R
|
||||
import com.lukouguoji.aerologic.databinding.ActivityTelegramListBinding
|
||||
import com.lukouguoji.aerologic.databinding.ActivityTransportLogListBinding
|
||||
import com.lukouguoji.module_base.base.BaseBindingActivity
|
||||
import com.lukouguoji.module_base.ktx.addOnItemClickListener
|
||||
import com.lukouguoji.module_base.ktx.getLifecycleOwner
|
||||
|
||||
|
||||
class TransportLogActivity :
|
||||
BaseBindingActivity<ActivityTransportLogListBinding, TransportLogViewModel>() {
|
||||
|
||||
override fun layoutId(): Int {
|
||||
return R.layout.activity_transport_log_list
|
||||
}
|
||||
|
||||
override fun viewModelClass(): Class<TransportLogViewModel> {
|
||||
return TransportLogViewModel::class.java
|
||||
}
|
||||
|
||||
override fun initOnCreate(savedInstanceState: Bundle?) {
|
||||
setBackArrow("转运记录")
|
||||
binding.viewModel = viewModel
|
||||
viewModel.pageModel.bindSmartRefreshLayout(
|
||||
binding.srl,
|
||||
binding.rv,
|
||||
viewModel,
|
||||
getLifecycleOwner()
|
||||
)
|
||||
binding.rv.addOnItemClickListener(viewModel)
|
||||
viewModel.refresh()
|
||||
}
|
||||
|
||||
companion object {
|
||||
@JvmStatic
|
||||
fun start(context: Context) {
|
||||
val starter = Intent(context, TransportLogActivity::class.java)
|
||||
context.startActivity(starter)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.lukouguoji.aerologic.page.transportLog.list
|
||||
|
||||
import android.view.View
|
||||
import com.lukouguoji.aerologic.databinding.ItemTransportLogListBinding
|
||||
import com.lukouguoji.module_base.base.BaseViewHolder
|
||||
import com.lukouguoji.module_base.bean.TransportLogBean
|
||||
|
||||
class TransportLogViewHolder(view: View) :
|
||||
BaseViewHolder<TransportLogBean, ItemTransportLogListBinding>(view) {
|
||||
|
||||
override fun onBind(item: Any?, position: Int) {
|
||||
binding.bean = getItemBean(item)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,97 @@
|
||||
package com.lukouguoji.aerologic.page.transportLog.list
|
||||
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import com.lukouguoji.aerologic.R
|
||||
import com.lukouguoji.module_base.base.BasePageViewModel
|
||||
import com.lukouguoji.module_base.http.net.NetApply
|
||||
import com.lukouguoji.module_base.ktx.formatDate
|
||||
import com.lukouguoji.module_base.ktx.launchLoadingCollect
|
||||
import com.lukouguoji.module_base.ktx.toRequestBody
|
||||
import com.lukouguoji.module_base.model.PadFilterDialogModel
|
||||
import com.lukouguoji.module_base.model.PadFilterModel
|
||||
import com.lukouguoji.module_base.ui.weight.search.layout.SearchLayoutType
|
||||
import com.lukouguoji.module_base.util.DictUtils
|
||||
import dev.utils.app.info.KeyValue
|
||||
import dev.utils.common.DateUtils
|
||||
|
||||
class TransportLogViewModel : BasePageViewModel() {
|
||||
val car = MutableLiveData("")
|
||||
|
||||
val date = MutableLiveData(DateUtils.getCurrentTime().formatDate())
|
||||
|
||||
val flightNo = MutableLiveData("")
|
||||
|
||||
val transportType = MutableLiveData("")
|
||||
|
||||
val transportStatus = MutableLiveData("")
|
||||
|
||||
val driver = MutableLiveData("")
|
||||
|
||||
|
||||
val count = MutableLiveData(0)
|
||||
|
||||
|
||||
val transportTypeList = MutableLiveData<List<KeyValue>>(listOf()).apply {
|
||||
DictUtils.getTransTypeListByRole {
|
||||
value = listOf(KeyValue("全部", "")) + it
|
||||
transportType.value = ""
|
||||
}
|
||||
}
|
||||
val transportStatusList = MutableLiveData<List<KeyValue>>(listOf()).apply {
|
||||
DictUtils.getTransStatusList {
|
||||
value = listOf(KeyValue("全部", "")) + it
|
||||
}
|
||||
}
|
||||
val driverList = MutableLiveData<List<KeyValue>>(listOf()).apply {
|
||||
DictUtils.getAllDriverList {
|
||||
value = listOf(KeyValue("全部", "")) + it
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
val itemLayoutId = R.layout.item_transport_log_list
|
||||
val itemViewHolder = TransportLogViewHolder::class.java
|
||||
|
||||
private val filterModel by lazy {
|
||||
PadFilterDialogModel(
|
||||
getTopActivity(), listOf(
|
||||
PadFilterModel(driver, "司机", "请选择司机", SearchLayoutType.SPINNER, driverList)
|
||||
)
|
||||
) {
|
||||
refresh()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// 方法区
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
override fun getData() {
|
||||
launchLoadingCollect({
|
||||
NetApply.api.getTransportLogList(
|
||||
mapOf(
|
||||
"pageNum" to pageModel.page,
|
||||
"pageSize" to pageModel.limit,
|
||||
"fdate" to date.value,
|
||||
"fno" to flightNo.value,
|
||||
"opId" to driver.value,
|
||||
"transType" to transportType.value,
|
||||
"transStatus" to transportStatus.value,
|
||||
"carId" to car.value,
|
||||
).toRequestBody()
|
||||
)
|
||||
}) {
|
||||
onSuccess = {
|
||||
pageModel.handleListBean(it)
|
||||
count.value = it.total
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun onFilterClick() {
|
||||
filterModel.show()
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,790 @@
|
||||
package com.lukouguoji.aerologic.ui.fragment
|
||||
|
||||
import android.content.Context
|
||||
import android.os.Bundle
|
||||
import android.util.Log
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.ImageView
|
||||
import android.widget.LinearLayout
|
||||
import android.widget.TextView
|
||||
import android.widget.Toast
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.alibaba.android.arouter.launcher.ARouter
|
||||
import com.alibaba.fastjson.JSON
|
||||
import com.alibaba.fastjson.JSONObject
|
||||
import com.bumptech.glide.Glide
|
||||
import com.bumptech.glide.load.engine.DiskCacheStrategy
|
||||
import com.bumptech.glide.request.RequestOptions
|
||||
import com.lukouguoji.aerologic.R
|
||||
import com.lukouguoji.aerologic.page.accident.visa.list.AccidentVisaListActivity
|
||||
import com.lukouguoji.aerologic.page.car.list.CarListActivity
|
||||
import com.lukouguoji.aerologic.page.flight.query.list.FlightQueryListActivity
|
||||
import com.lukouguoji.aerologic.page.gnj.jiaojie.GnjHandoverListActivity
|
||||
import com.lukouguoji.aerologic.page.gnj.out.stash.list.GnjOutStashListActivity
|
||||
import com.lukouguoji.aerologic.page.gnj.manifest.list.GnjManifestListActivity
|
||||
import com.lukouguoji.aerologic.page.gnj.stash.list.GnjStashListActivity
|
||||
import com.lukouguoji.aerologic.page.gnj.move.stash.list.GnjMoveStashListActivity
|
||||
import com.lukouguoji.aerologic.page.gnj.query.details.GnjQueryDetailsActivity
|
||||
import com.lukouguoji.aerologic.page.gnj.query.list.GnjQueryListActivity
|
||||
import com.lukouguoji.aerologic.page.gnj.unload.list.GnjUnloadListActivity
|
||||
import com.lukouguoji.aerologic.page.log.list.LogListActivity
|
||||
import com.lukouguoji.aerologic.page.message.list.MessageListActivity
|
||||
import com.lukouguoji.aerologic.page.telegram.list.TelegramListActivity
|
||||
import com.lukouguoji.aerologic.page.test.PrintActivity
|
||||
import com.lukouguoji.aerologic.page.transport.GoodsTransportActivity
|
||||
import com.lukouguoji.aerologic.page.transportLog.list.TransportLogActivity
|
||||
import com.lukouguoji.gnc.page.deposit.list.GncDepositListActivity
|
||||
import com.lukouguoji.gnc.page.distribution.home.GncDistributionHomeActivity
|
||||
import com.lukouguoji.gnc.page.fubang.list.GncFuBangListActivity
|
||||
import com.lukouguoji.gnc.page.shouyun.unlist.GncShouYunUnListActivity
|
||||
import com.lukouguoji.module_base.MyApplication
|
||||
import com.lukouguoji.module_base.adapter.loadImage
|
||||
import com.lukouguoji.module_base.common.Constant
|
||||
import com.lukouguoji.module_base.db.perference.SharedPreferenceUtil
|
||||
import com.lukouguoji.module_base.router.ARouterConstants
|
||||
import kotlin.properties.Delegates
|
||||
|
||||
|
||||
class HomeFragment : Fragment() {
|
||||
|
||||
private val TAG: String = HomeFragment::class.java.simpleName
|
||||
|
||||
private var rvLeft: RecyclerView by Delegates.notNull()
|
||||
private var rvRight: RecyclerView by Delegates.notNull()
|
||||
|
||||
override fun onCreateView(
|
||||
inflater: LayoutInflater, container: ViewGroup?,
|
||||
savedInstanceState: Bundle?
|
||||
): View? {
|
||||
val inflate = inflater.inflate(R.layout.fragment_home, container, false)
|
||||
rvLeft = inflate.findViewById(R.id.left_menu_list)
|
||||
rvRight = inflate.findViewById(R.id.right_menu_list)
|
||||
return inflate
|
||||
}
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
|
||||
val leftMenuList = initLeftMenuData()
|
||||
rvLeft.adapter = HomeLeftAdapt(leftMenuList)
|
||||
rvRight.adapter = HomeRightAdapt(getRightMenu4Id(leftMenuList.first().id))
|
||||
}
|
||||
|
||||
/////////// 左边的list循环
|
||||
inner class HomeLeftAdapt(private val leftMenuList: List<LeftMenu>) :
|
||||
RecyclerView.Adapter<HomeLeftAdapt.ViewHolder>() {
|
||||
|
||||
private var mPosition = 0
|
||||
|
||||
inner class ViewHolder(view: View) : RecyclerView.ViewHolder(view) {
|
||||
val itemLayout: LinearLayout = view.findViewById(R.id.left_item_layout)
|
||||
val itemImg: ImageView = view.findViewById(R.id.left_item_img)
|
||||
val itemText: TextView = view.findViewById(R.id.left_item_text)
|
||||
}
|
||||
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
|
||||
val view =
|
||||
LayoutInflater.from(parent.context).inflate(R.layout.home_left_item, parent, false)
|
||||
val viewHolder = ViewHolder(view)
|
||||
val leftMenu = leftMenuList[mPosition]
|
||||
viewHolder.itemView.setOnClickListener {
|
||||
val oldPosition = mPosition
|
||||
mPosition = viewHolder.adapterPosition
|
||||
val leftMenuTemp = leftMenuList[mPosition]
|
||||
|
||||
//航班查询
|
||||
if (Constant.AuthName.Flight == leftMenuTemp.id) {
|
||||
// ARouter.getInstance().build(ARouterConstants.ACTIVITY_URL_HANG_BAN_QUERY)
|
||||
// .navigation(activity, Constant.RequestCode.home_left_hang_ban_query)
|
||||
FlightQueryListActivity.start(requireContext())
|
||||
mPosition = oldPosition
|
||||
}
|
||||
//货物查询
|
||||
if (Constant.AuthName.CargoStatus == leftMenuTemp.id) {
|
||||
ARouter.getInstance().build(ARouterConstants.ACTIVITY_URL_CARGO_TRACKING)
|
||||
.navigation(activity, Constant.RequestCode.home_left_hang_ban_query)
|
||||
mPosition = oldPosition
|
||||
}
|
||||
//其他查询
|
||||
else {
|
||||
}
|
||||
refreshRight(leftMenuList[mPosition].id)
|
||||
|
||||
//更新菜单状态
|
||||
notifyDataSetChanged()
|
||||
}
|
||||
return viewHolder
|
||||
}
|
||||
|
||||
override fun onBindViewHolder(holder: ViewHolder, position: Int) {
|
||||
var item = leftMenuList[position]
|
||||
holder.itemText.text = item.text
|
||||
holder.itemImg.setImageResource(item.img)
|
||||
if (mPosition == position) {
|
||||
holder.itemLayout.setBackgroundResource(R.color.white)
|
||||
holder.itemImg.drawable.setTint(
|
||||
MyApplication.context.resources.getColor(
|
||||
R.color.colorPrimary,
|
||||
activity?.theme
|
||||
)
|
||||
)
|
||||
holder.itemText.setTextColor(
|
||||
MyApplication.context.resources.getColor(
|
||||
R.color.colorPrimary,
|
||||
activity?.theme
|
||||
)
|
||||
)
|
||||
} else {
|
||||
holder.itemLayout.setBackgroundResource(R.color.list_bg)
|
||||
holder.itemImg.drawable.setTint(
|
||||
MyApplication.context.resources.getColor(
|
||||
R.color.weak_grey,
|
||||
activity?.theme
|
||||
)
|
||||
)
|
||||
holder.itemText.setTextColor(
|
||||
MyApplication.context.resources.getColor(
|
||||
R.color.weak_grey,
|
||||
activity?.theme
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
override fun getItemCount() = leftMenuList.size
|
||||
}
|
||||
|
||||
inner class LeftMenu(val id: String, val img: Int, val text: String)
|
||||
|
||||
fun initLeftMenuData(): List<LeftMenu> {
|
||||
var list = arrayListOf<LeftMenu>()
|
||||
list.add(LeftMenu(Constant.AuthName.DomExp, R.mipmap.gncn_icon, "国内出港"))
|
||||
list.add(LeftMenu(Constant.AuthName.DomImp, R.mipmap.gnjg, "国内进港"))
|
||||
list.add(LeftMenu(Constant.AuthName.IntExp, R.mipmap.gjcn_icon, "国际出港"))
|
||||
list.add(LeftMenu(Constant.AuthName.IntImp, R.mipmap.gjjn_icon, "国际进港"))
|
||||
list.add(LeftMenu(Constant.AuthName.Flight, R.mipmap.hangban_icon, "航班查询"))
|
||||
list.add(LeftMenu(Constant.AuthName.CargoStatus, R.mipmap.huowu_icon, "货物追踪"))
|
||||
list.add(LeftMenu(Constant.AuthName.Supervision, R.mipmap.monitor_up_down_icon, "监装监卸"))
|
||||
|
||||
list.add(LeftMenu(Constant.AuthName.Comprehensive, R.mipmap.zhgl_icon, "综合管理"))
|
||||
|
||||
/**
|
||||
* 左侧菜单 权限过滤
|
||||
* todo
|
||||
*/
|
||||
getAuthsObj()?.let {
|
||||
val authsFilter = list.filter { m ->
|
||||
it.getJSONArray(m.id) != null && it.getJSONArray(m.id).size > 0
|
||||
}
|
||||
list = authsFilter as ArrayList<LeftMenu>
|
||||
}
|
||||
return list
|
||||
}
|
||||
|
||||
private fun getAuthsObj(): JSONObject? {
|
||||
val authsString = SharedPreferenceUtil.getString(Constant.Share.authList)
|
||||
if (authsString != "") {
|
||||
val authsObj = JSON.parseObject(authsString)
|
||||
return authsObj
|
||||
}
|
||||
return null
|
||||
}
|
||||
|
||||
|
||||
/////////// 右边的list循环
|
||||
inner class HomeRightAdapt(rightMenuList: List<RightMenu>) :
|
||||
RecyclerView.Adapter<HomeRightAdapt.ViewHolder>() {
|
||||
|
||||
private var rightMenuList = arrayListOf<RightMenu>().apply {
|
||||
addAll(rightMenuList)
|
||||
}
|
||||
|
||||
inner class ViewHolder(view: View) : RecyclerView.ViewHolder(view) {
|
||||
val itemImg: ImageView = view.findViewById(R.id.right_item_img)
|
||||
val itemText: TextView = view.findViewById(R.id.right_item_text)
|
||||
}
|
||||
|
||||
/**
|
||||
* 刷新
|
||||
*/
|
||||
fun refresh(list: List<RightMenu>) {
|
||||
rightMenuList.clear()
|
||||
rightMenuList.addAll(list)
|
||||
notifyDataSetChanged()
|
||||
}
|
||||
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
|
||||
val view =
|
||||
LayoutInflater.from(parent.context).inflate(R.layout.home_right_item, parent, false)
|
||||
val viewHolder = ViewHolder(view)
|
||||
|
||||
viewHolder.itemView.setOnClickListener {
|
||||
|
||||
val position = viewHolder.adapterPosition
|
||||
var rightMenu = rightMenuList[position]
|
||||
when (rightMenu.id) {
|
||||
//// 国内出港
|
||||
Constant.AuthName.AppDomExpCheckin -> {
|
||||
GncShouYunUnListActivity.start(requireContext())
|
||||
}
|
||||
|
||||
Constant.AuthName.AppDomExpWeighting -> {
|
||||
GncFuBangListActivity.start(requireContext())
|
||||
}
|
||||
|
||||
Constant.AuthName.AppDomExpTransport -> {
|
||||
ARouter.getInstance()
|
||||
.build(ARouterConstants.ACTIVITY_URL_GOUT_TRANSFER_ACTIVITY)
|
||||
.navigation()
|
||||
}
|
||||
|
||||
Constant.AuthName.AppDomExpWareHouse -> {
|
||||
ARouter.getInstance().build(ARouterConstants.ACTIVITY_URL_GNC_WAREHOUSE)
|
||||
.navigation()
|
||||
}
|
||||
|
||||
Constant.AuthName.AppDomExpSearch -> {
|
||||
ARouter.getInstance().build(ARouterConstants.ACTIVITY_URL_GNC_QUERY_LIST)
|
||||
.navigation()
|
||||
}
|
||||
|
||||
Constant.AuthName.AppTest -> {
|
||||
PrintActivity.start(requireContext())
|
||||
}
|
||||
|
||||
Constant.AuthName.AppDomExpAssemble -> {
|
||||
ARouter.getInstance().build(ARouterConstants.ACTIVITY_URL_GNC_ASSEMBLE_LIST)
|
||||
.navigation()
|
||||
}
|
||||
|
||||
Constant.AuthName.AppDomExpDistribution -> {
|
||||
GncDistributionHomeActivity.start(requireContext())
|
||||
}
|
||||
|
||||
Constant.AuthName.AppDomExpDeposit -> {
|
||||
GncDepositListActivity.start(requireContext())
|
||||
}
|
||||
/**
|
||||
* 国内进港
|
||||
*/
|
||||
//舱单
|
||||
Constant.AuthName.GnjAppDomExpCheckin -> {
|
||||
GnjManifestListActivity.start(requireContext())
|
||||
}
|
||||
//出库
|
||||
Constant.AuthName.GnjChuKuList -> {
|
||||
GnjOutStashListActivity.start(requireContext())
|
||||
}
|
||||
//仓库管理
|
||||
Constant.AuthName.GnjWareHouse -> {
|
||||
GnjStashListActivity.start(requireContext())
|
||||
}
|
||||
//查询 列表
|
||||
Constant.AuthName.GnjQueryList -> {
|
||||
GnjQueryListActivity.start(requireContext())
|
||||
}
|
||||
//入库
|
||||
Constant.AuthName.GnjRuKu -> {
|
||||
ARouter.getInstance().build(ARouterConstants.ACTIVITY_URL_GNJ_RU_KU)
|
||||
.navigation()
|
||||
}
|
||||
//移库
|
||||
Constant.AuthName.GnjYiKu -> {
|
||||
GnjMoveStashListActivity.start(requireContext())
|
||||
}
|
||||
|
||||
Constant.AuthName.GnjHandover -> {
|
||||
GnjHandoverListActivity.start(requireContext())
|
||||
}
|
||||
/**
|
||||
* 国际出港
|
||||
*/
|
||||
//收运
|
||||
Constant.AuthName.GjcAppDomExpCheckin -> {
|
||||
ARouter.getInstance().build(ARouterConstants.ACTIVITY_URL_GJC_RECEIVE_LIST)
|
||||
.navigation()
|
||||
}
|
||||
//复磅
|
||||
Constant.AuthName.GjcFuBangActivity -> {
|
||||
ARouter.getInstance().build(ARouterConstants.ACTIVITY_URL_GJC_FU_BANG)
|
||||
.navigation()
|
||||
}
|
||||
//仓库
|
||||
Constant.AuthName.GjcWareHouseActivity -> {
|
||||
ARouter.getInstance().build(ARouterConstants.ACTIVITY_URL_GJC_WARE_HOUSE)
|
||||
.navigation()
|
||||
}
|
||||
//查询
|
||||
Constant.AuthName.GjcQueryListActivity -> {
|
||||
ARouter.getInstance().build(ARouterConstants.ACTIVITY_URL_GJC_QUERY_LIST)
|
||||
.navigation()
|
||||
}
|
||||
//移库
|
||||
Constant.AuthName.GjcYiKuListActivity -> {
|
||||
ARouter.getInstance().build(ARouterConstants.ACTIVITY_URL_GJC_YI_KU)
|
||||
.navigation()
|
||||
}
|
||||
// 板箱
|
||||
Constant.AuthName.GjcBanXListActivity -> {
|
||||
ARouter.getInstance().build(ARouterConstants.ACTIVITY_URL_GJC_BOX_ASSEMBLE)
|
||||
.navigation()
|
||||
}
|
||||
// 货物交接
|
||||
Constant.AuthName.GjcGoodsListActivity -> {
|
||||
ARouter.getInstance().build(ARouterConstants.ACTIVITY_URL_GJC_GOODS_LIST)
|
||||
.navigation()
|
||||
}
|
||||
/**
|
||||
* 国际进港
|
||||
*/
|
||||
//舱单
|
||||
Constant.AuthName.GjjCangDanListActivity -> {
|
||||
ARouter.getInstance().build(ARouterConstants.ACTIVITY_URL_GJJ_CANG_DAN_LIST)
|
||||
.navigation()
|
||||
}
|
||||
//仓库
|
||||
Constant.AuthName.GjjWareHouseActivity -> {
|
||||
ARouter.getInstance().build(ARouterConstants.ACTIVITY_URL_GJJ_WARE_HOUSE)
|
||||
.navigation()
|
||||
}
|
||||
//出库
|
||||
Constant.AuthName.GjjChuKuListActivity -> {
|
||||
ARouter.getInstance().build(ARouterConstants.ACTIVITY_URL_GJJ_CHU_KU_LIST)
|
||||
.navigation()
|
||||
}
|
||||
//查询
|
||||
Constant.AuthName.GjjQueryListActivity -> {
|
||||
ARouter.getInstance().build(ARouterConstants.ACTIVITY_URL_GJJ_QUERY_LIST)
|
||||
.navigation()
|
||||
}
|
||||
// 报文解析
|
||||
Constant.AuthName.GjjPacketParseActivity -> {
|
||||
ARouter.getInstance().build(ARouterConstants.ACTIVITY_URL_GJJ_PACKET_PARSE)
|
||||
.navigation()
|
||||
}
|
||||
// 舱单
|
||||
Constant.AuthName.GjjManifestListActivity -> {
|
||||
ARouter.getInstance().build(ARouterConstants.ACTIVITY_URL_GJJ_MANIFEST)
|
||||
.navigation()
|
||||
}
|
||||
// 理货
|
||||
Constant.AuthName.GjjTallyListActivity -> {
|
||||
ARouter.getInstance().build(ARouterConstants.ACTIVITY_URL_GJJ_Tally)
|
||||
.navigation()
|
||||
}
|
||||
// 货物交接
|
||||
Constant.AuthName.GjjGoodsListActivity -> {
|
||||
ARouter.getInstance().build(ARouterConstants.ACTIVITY_URL_GJJ_GOODS)
|
||||
.navigation()
|
||||
}
|
||||
/**
|
||||
* 航班查询
|
||||
*/
|
||||
//航班查询
|
||||
Constant.AuthName.HangBanQuery -> {
|
||||
ARouter.getInstance().build(ARouterConstants.ACTIVITY_URL_HANG_BAN_QUERY)
|
||||
.navigation()
|
||||
}
|
||||
/**
|
||||
* 货物追踪
|
||||
*/
|
||||
//货物追踪
|
||||
Constant.AuthName.CargoTracking -> {
|
||||
ARouter.getInstance().build(ARouterConstants.ACTIVITY_URL_CARGO_TRACKING)
|
||||
.navigation()
|
||||
}
|
||||
/**
|
||||
* 监装监卸
|
||||
*/
|
||||
//进港卸机
|
||||
Constant.AuthName.MonitorInPack -> {
|
||||
// ARouter.getInstance().build(ARouterConstants.ACTIVITY_URL_MONITOR_IN_PACK)
|
||||
// .navigation()
|
||||
GnjUnloadListActivity.start(requireContext())
|
||||
}
|
||||
//事故签证
|
||||
Constant.AuthName.AccidentVisa -> {
|
||||
ARouter.getInstance()
|
||||
.build(ARouterConstants.ACTIVITY_URL_MONITOR_ACCIDENT_VISA).navigation()
|
||||
}
|
||||
//出港装板
|
||||
Constant.AuthName.OutLoadingActivity -> {
|
||||
ARouter.getInstance()
|
||||
.build(ARouterConstants.ACTIVITY_URL_MONITOR_OUT_LOADING).navigation()
|
||||
}
|
||||
/**
|
||||
* 综合管理
|
||||
*/
|
||||
// 消息管理
|
||||
Constant.AuthName.ComprehensiveMessage -> {
|
||||
MessageListActivity.start(requireContext())
|
||||
}
|
||||
// 电报管理
|
||||
Constant.AuthName.ComprehensiveTelegram -> {
|
||||
TelegramListActivity.start(requireContext())
|
||||
}
|
||||
// 货物转运
|
||||
Constant.AuthName.ComprehensiveTransfer -> {
|
||||
GoodsTransportActivity.start(requireContext())
|
||||
}
|
||||
// 事故签证
|
||||
Constant.AuthName.ComprehensiveAccidentVisa -> {
|
||||
AccidentVisaListActivity.start(requireContext())
|
||||
}
|
||||
// 平板车管理
|
||||
Constant.AuthName.ComprehensiveCar -> {
|
||||
CarListActivity.start(requireContext())
|
||||
}
|
||||
// 转运记录
|
||||
Constant.AuthName.TransportLog -> {
|
||||
TransportLogActivity.start(requireContext())
|
||||
}
|
||||
// 日志查询
|
||||
Constant.AuthName.ComprehensiveLog -> {
|
||||
LogListActivity.start(requireContext())
|
||||
}
|
||||
|
||||
else -> {
|
||||
Toast.makeText(
|
||||
parent.context,
|
||||
"暂无入口,等待后期开放...",
|
||||
Toast.LENGTH_SHORT
|
||||
).show()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
return viewHolder
|
||||
}
|
||||
|
||||
override fun onBindViewHolder(holder: ViewHolder, position: Int) {
|
||||
var item = rightMenuList[position]
|
||||
holder.itemText.text = item.text
|
||||
// holder.itemImg.setImageResource(item.img)
|
||||
loadPreviewImage(holder.itemView.context, item.img, holder.itemImg)
|
||||
}
|
||||
|
||||
private fun loadPreviewImage(context: Context, url: Any, target: ImageView) {
|
||||
val requestOptions = RequestOptions()
|
||||
.diskCacheStrategy(DiskCacheStrategy.ALL)
|
||||
.override(
|
||||
com.bumptech.glide.request.target.Target.SIZE_ORIGINAL,
|
||||
com.bumptech.glide.request.target.Target.SIZE_ORIGINAL
|
||||
)
|
||||
Glide.with(context)
|
||||
.setDefaultRequestOptions(requestOptions)
|
||||
.load(url)
|
||||
.into(target)
|
||||
}
|
||||
|
||||
override fun getItemCount() = rightMenuList.size
|
||||
}
|
||||
|
||||
inner class RightMenu(val id: String, val img: Int, val text: String)
|
||||
|
||||
private fun getRightMenu4Id(id: String): List<RightMenu> {
|
||||
var list = arrayListOf<RightMenu>()
|
||||
when (id) {
|
||||
Constant.AuthName.DomExp -> {
|
||||
list.add(
|
||||
RightMenu(
|
||||
Constant.AuthName.AppDomExpCheckin,
|
||||
com.lukouguoji.module_base.R.drawable.img_gnc_shouyun,
|
||||
"出港收运"
|
||||
)
|
||||
)
|
||||
list.add(
|
||||
RightMenu(
|
||||
Constant.AuthName.AppDomExpWeighting,
|
||||
R.mipmap.gnc_fubang,
|
||||
"出港复磅"
|
||||
)
|
||||
)
|
||||
// list.add(RightMenu(Constant.AuthName.AppDomExpTransport, R.mipmap.gnc_zhuanyun, "转运确认"))
|
||||
list.add(
|
||||
RightMenu(
|
||||
Constant.AuthName.AppDomExpAssemble,
|
||||
com.lukouguoji.module_base.R.drawable.img_gnc_zuzhuang,
|
||||
"出港组装"
|
||||
)
|
||||
)
|
||||
list.add(
|
||||
RightMenu(
|
||||
Constant.AuthName.AppDomExpDistribution,
|
||||
com.lukouguoji.module_base.R.drawable.img_gnc_fenpei,
|
||||
"出港分配"
|
||||
)
|
||||
)
|
||||
list.add(
|
||||
RightMenu(
|
||||
Constant.AuthName.AppDomExpDeposit,
|
||||
com.lukouguoji.module_base.R.drawable.img_gnc_cunfang,
|
||||
"出港存放"
|
||||
)
|
||||
)
|
||||
list.add(
|
||||
RightMenu(
|
||||
Constant.AuthName.AppDomExpWareHouse,
|
||||
R.mipmap.gnc_cangku,
|
||||
"仓库管理"
|
||||
)
|
||||
)
|
||||
list.add(RightMenu(Constant.AuthName.AppDomExpSearch, R.mipmap.gnc_cha, "出港查询"))
|
||||
list.add(RightMenu(Constant.AuthName.AppTest, R.mipmap.gnc_cha, "测试页"))
|
||||
}
|
||||
|
||||
Constant.AuthName.DomImp -> {
|
||||
list.add(
|
||||
RightMenu(
|
||||
Constant.AuthName.GnjAppDomExpCheckin,
|
||||
R.mipmap.gnj_cang_dan_icon,
|
||||
"进港舱单"
|
||||
)
|
||||
)
|
||||
list.add(
|
||||
RightMenu(
|
||||
Constant.AuthName.GnjChuKuList,
|
||||
R.mipmap.gnj_chu_ku_icon,
|
||||
"进港出库"
|
||||
)
|
||||
)
|
||||
list.add(RightMenu(Constant.AuthName.GnjYiKu, R.mipmap.gnj_yi_ku_icon, "进港移库"))
|
||||
list.add(
|
||||
RightMenu(
|
||||
Constant.AuthName.GnjWareHouse,
|
||||
R.mipmap.gnj_cang_ku_icon,
|
||||
"仓库管理"
|
||||
)
|
||||
)
|
||||
// list.add(RightMenu(Constant.AuthName.GnjRuKu, R.mipmap.gnc_zhuanyun, "转运确认"))
|
||||
list.add(
|
||||
RightMenu(
|
||||
Constant.AuthName.GnjQueryList,
|
||||
R.mipmap.gnj_query_icon,
|
||||
"进港查询"
|
||||
)
|
||||
)
|
||||
list.add(
|
||||
RightMenu(
|
||||
Constant.AuthName.GnjHandover,
|
||||
R.mipmap.gnj_handover,
|
||||
"进港交接"
|
||||
)
|
||||
)
|
||||
|
||||
}
|
||||
|
||||
Constant.AuthName.IntExp -> {
|
||||
list.add(
|
||||
RightMenu(
|
||||
Constant.AuthName.GjcAppDomExpCheckin,
|
||||
R.mipmap.gjc_shou_yun_icon,
|
||||
"出港收运"
|
||||
)
|
||||
)
|
||||
list.add(
|
||||
RightMenu(
|
||||
Constant.AuthName.GjcFuBangActivity,
|
||||
R.mipmap.gjc_fu_bang_icon,
|
||||
"板箱过磅"
|
||||
)
|
||||
)
|
||||
list.add(
|
||||
RightMenu(
|
||||
Constant.AuthName.GjcWareHouseActivity,
|
||||
R.mipmap.gjc_cang_ku_icon,
|
||||
"仓库管理"
|
||||
)
|
||||
)
|
||||
list.add(
|
||||
RightMenu(
|
||||
Constant.AuthName.GjcYiKuListActivity,
|
||||
R.mipmap.gjc_yi_ku_icon,
|
||||
"出港移库"
|
||||
)
|
||||
)
|
||||
list.add(
|
||||
RightMenu(
|
||||
Constant.AuthName.GjcQueryListActivity,
|
||||
R.mipmap.gjc_query_icon,
|
||||
"出港查询"
|
||||
)
|
||||
)
|
||||
|
||||
list.add(
|
||||
RightMenu(
|
||||
Constant.AuthName.GjcBanXListActivity,
|
||||
com.lukouguoji.module_base.R.drawable.img_gjc_banxiangzuzhuang,
|
||||
"板箱组装"
|
||||
)
|
||||
)
|
||||
list.add(
|
||||
RightMenu(
|
||||
Constant.AuthName.GjcGoodsListActivity,
|
||||
R.mipmap.img_hwjj,
|
||||
"货物交接"
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
Constant.AuthName.IntImp -> {
|
||||
list.add(
|
||||
RightMenu(
|
||||
Constant.AuthName.GjjChuKuListActivity,
|
||||
R.mipmap.gjj_chu_ku_icon,
|
||||
"提取出库"
|
||||
)
|
||||
)
|
||||
list.add(
|
||||
RightMenu(
|
||||
Constant.AuthName.GjjWareHouseActivity,
|
||||
R.mipmap.gjj_cang_ku_icon,
|
||||
"仓库管理"
|
||||
)
|
||||
)
|
||||
list.add(
|
||||
RightMenu(
|
||||
Constant.AuthName.GjjQueryListActivity,
|
||||
R.mipmap.gjj_query_icon,
|
||||
"进港查询"
|
||||
)
|
||||
)
|
||||
list.add(
|
||||
RightMenu(
|
||||
Constant.AuthName.GjjPacketParseActivity,
|
||||
R.mipmap.img_bwjx,
|
||||
"报文解析"
|
||||
)
|
||||
)
|
||||
list.add(
|
||||
RightMenu(
|
||||
Constant.AuthName.GjjManifestListActivity,
|
||||
R.mipmap.gjc_query_icon,
|
||||
"进港舱单"
|
||||
)
|
||||
)
|
||||
list.add(
|
||||
RightMenu(
|
||||
Constant.AuthName.GjjTallyListActivity,
|
||||
R.mipmap.img_jglh,
|
||||
"进港理货"
|
||||
)
|
||||
)
|
||||
list.add(
|
||||
RightMenu(
|
||||
Constant.AuthName.GjjGoodsListActivity,
|
||||
R.mipmap.img_hwjj,
|
||||
"货物交接"
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
Constant.AuthName.Flight -> {
|
||||
// list.add(RightMenu(Constant.AuthName.HangBanQuery, R.mipmap.guoji_in, "航班查询"))
|
||||
}
|
||||
|
||||
Constant.AuthName.CargoStatus -> {
|
||||
// list.add(RightMenu(Constant.AuthName.CargoTracking, R.mipmap.guoji_in, "货物状态查询"))
|
||||
}
|
||||
|
||||
Constant.AuthName.Supervision -> {
|
||||
list.add(
|
||||
RightMenu(
|
||||
Constant.AuthName.MonitorInPack,
|
||||
R.mipmap.mit_in_pack,
|
||||
"进港卸机"
|
||||
)
|
||||
)
|
||||
list.add(
|
||||
RightMenu(
|
||||
Constant.AuthName.AccidentVisa,
|
||||
R.drawable.img_gj_shiguqianzheng,
|
||||
"事故签证"
|
||||
)
|
||||
)
|
||||
list.add(
|
||||
RightMenu(
|
||||
Constant.AuthName.ComprehensiveAccidentVisa,
|
||||
R.mipmap.mit_accident_visa,
|
||||
"事故签证"
|
||||
)
|
||||
)
|
||||
list.add(
|
||||
RightMenu(
|
||||
Constant.AuthName.OutLoadingActivity,
|
||||
R.mipmap.mit_out_pack,
|
||||
"出港装板"
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
Constant.AuthName.Comprehensive -> {
|
||||
list.add(
|
||||
RightMenu(
|
||||
Constant.AuthName.ComprehensiveMessage,
|
||||
com.lukouguoji.module_base.R.drawable.img_xiaoxiguanli,
|
||||
"消息管理"
|
||||
)
|
||||
)
|
||||
list.add(
|
||||
RightMenu(
|
||||
Constant.AuthName.ComprehensiveTelegram,
|
||||
com.lukouguoji.module_base.R.drawable.img_gnc_dianbaoguanli,
|
||||
"电报管理"
|
||||
)
|
||||
)
|
||||
list.add(
|
||||
RightMenu(
|
||||
Constant.AuthName.ComprehensiveTransfer,
|
||||
com.lukouguoji.module_base.R.drawable.img_gnc_huowuzhuanyun,
|
||||
"货物转运"
|
||||
)
|
||||
)
|
||||
list.add(
|
||||
RightMenu(
|
||||
Constant.AuthName.ComprehensiveCar,
|
||||
com.lukouguoji.module_base.R.drawable.img_pingbancheguanli,
|
||||
"平板车管理"
|
||||
)
|
||||
)
|
||||
list.add(
|
||||
RightMenu(
|
||||
Constant.AuthName.ComprehensiveLog,
|
||||
R.mipmap.gnc_shou,
|
||||
"日志查询"
|
||||
)
|
||||
)
|
||||
list.add(
|
||||
RightMenu(
|
||||
Constant.AuthName.TransportLog,
|
||||
R.mipmap.transport_log,
|
||||
"转运记录"
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
else -> {
|
||||
Log.e(TAG, "没有找到对应 $id 的右侧功能列表 ")
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 右侧菜单 权限过滤
|
||||
*/
|
||||
val authsFilter = list.filter { m ->
|
||||
SharedPreferenceUtil.getString(Constant.Share.authList).contains(m.id)
|
||||
}
|
||||
// TODO: 暂时关闭权限筛选
|
||||
list = authsFilter as ArrayList<RightMenu>
|
||||
return list
|
||||
}
|
||||
|
||||
private fun refreshRight(id: String) {
|
||||
(rvRight.adapter as? HomeRightAdapt)?.refresh(getRightMenu4Id(id))
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,129 @@
|
||||
package com.lukouguoji.aerologic.ui.fragment
|
||||
|
||||
import android.os.Bundle
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.EditText
|
||||
import android.widget.LinearLayout
|
||||
import android.widget.TextView
|
||||
import android.widget.Toast
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.lifecycle.ViewModelProvider
|
||||
import com.alibaba.android.arouter.launcher.ARouter
|
||||
import com.lukouguoji.aerologic.MineActivity
|
||||
import com.lukouguoji.aerologic.R
|
||||
import com.lukouguoji.aerologic.ui.viewModel.MineViewModel
|
||||
import com.lukouguoji.module_base.common.Constant
|
||||
import com.lukouguoji.module_base.common.ConstantEvent
|
||||
import com.lukouguoji.module_base.impl.FlowBus
|
||||
import com.lukouguoji.module_base.router.ARouterConstants
|
||||
import com.lukouguoji.module_base.service.repository.LoginRepository
|
||||
import com.lukouguoji.module_base.util.Common
|
||||
|
||||
class MineFragment : Fragment(), View.OnClickListener {
|
||||
private lateinit var mineActivity: MineActivity
|
||||
private lateinit var viewModel: MineViewModel
|
||||
|
||||
private lateinit var toolBack: LinearLayout
|
||||
|
||||
private lateinit var oldPwd: EditText
|
||||
private lateinit var newPwd: EditText
|
||||
private lateinit var confirmPwd: EditText
|
||||
private lateinit var updatePwd: TextView
|
||||
|
||||
|
||||
private fun initView() {
|
||||
mineActivity = requireActivity() as MineActivity
|
||||
viewModel = ViewModelProvider(this).get(MineViewModel::class.java)
|
||||
|
||||
toolBack = mineActivity.findViewById(R.id.tool_back)
|
||||
oldPwd = mineActivity.findViewById(R.id.oldPwd)
|
||||
newPwd = mineActivity.findViewById(R.id.newPwd)
|
||||
confirmPwd = mineActivity.findViewById(R.id.confirmPwd)
|
||||
updatePwd = mineActivity.findViewById(R.id.updatePwd)
|
||||
|
||||
toolBack.setOnClickListener(this)
|
||||
updatePwd.setOnClickListener(this)
|
||||
|
||||
confirmPwd.setOnFocusChangeListener { v, hasFocus ->
|
||||
if (hasFocus) {
|
||||
// 此处为得到焦点时的处理内容
|
||||
} else {
|
||||
if (confirmPwd.text.toString() != newPwd.text.toString()) {
|
||||
Common.showToast(mineActivity, "两次输入的新密码不一致,请重新输入!")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
override fun onCreateView(
|
||||
inflater: LayoutInflater, container: ViewGroup?,
|
||||
savedInstanceState: Bundle?
|
||||
): View? {
|
||||
// Inflate the layout for this fragment
|
||||
return inflater.inflate(R.layout.fragment_mine, container, false)
|
||||
}
|
||||
|
||||
override fun onActivityCreated(savedInstanceState: Bundle?) {
|
||||
super.onActivityCreated(savedInstanceState)
|
||||
initView()
|
||||
|
||||
//确认移库 返回结果
|
||||
viewModel.updatePwdLive.observe(mineActivity) {
|
||||
mineActivity.loadingCancel()
|
||||
val status = it.getString("status")
|
||||
var dataStatus = it.getString("data")
|
||||
val msg = it.getString("msg")
|
||||
if (Constant.Result.succ == status && Constant.Result.succ == dataStatus) {
|
||||
Common.showToast(mineActivity, "密码修改成功!")
|
||||
LoginRepository.logout()
|
||||
ARouter.getInstance().build(ARouterConstants.ACTIVITY_URL_LOGIN).navigation()
|
||||
FlowBus.with<Any>(ConstantEvent.LOGOUT)
|
||||
.tryEmit(true)
|
||||
} else {
|
||||
if (msg != null && msg != "") {
|
||||
Common.showToast(mineActivity, msg)
|
||||
} else {
|
||||
Common.showToast(mineActivity, "密码修改失败!")
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
override fun onClick(v: View?) {
|
||||
v?.let {
|
||||
when (it.id) {
|
||||
R.id.tool_back -> {
|
||||
mineActivity.finish()
|
||||
}
|
||||
R.id.updatePwd -> {
|
||||
if (oldPwd.text.toString() == "") {
|
||||
Common.showToast(mineActivity, "请输入旧密码!")
|
||||
return
|
||||
}
|
||||
if (newPwd.text.toString() == "") {
|
||||
Common.showToast(mineActivity, "请输入新密码!")
|
||||
return
|
||||
}
|
||||
if (confirmPwd.text.toString() == "") {
|
||||
Common.showToast(mineActivity, "请再次输入新密码!")
|
||||
return
|
||||
}
|
||||
if (confirmPwd.text.toString() != newPwd.text.toString()) {
|
||||
Common.showToast(mineActivity, "两次输入的新密码不一致,请重新输入!")
|
||||
return
|
||||
}
|
||||
//修改密码接口
|
||||
viewModel.updatePwd(oldPwd.text.toString(), newPwd.text.toString())
|
||||
}
|
||||
else -> {
|
||||
Toast.makeText(mineActivity, "未找到对应操作", Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.lukouguoji.aerologic.ui.viewModel
|
||||
|
||||
import android.util.Log
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import androidx.lifecycle.Transformations
|
||||
import androidx.lifecycle.ViewModel
|
||||
import androidx.lifecycle.liveData
|
||||
import com.alibaba.fastjson.JSONObject
|
||||
import com.lukouguoji.module_base.http.user.UserNetwork
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
|
||||
class MineViewModel : ViewModel() {
|
||||
|
||||
private val updatePwdParam = MutableLiveData<JSONObject>()
|
||||
|
||||
val updatePwdLive = Transformations.switchMap(updatePwdParam) { param ->
|
||||
liveData(Dispatchers.IO) {
|
||||
try {
|
||||
val response = UserNetwork.updatePwd(param)
|
||||
emit(response)
|
||||
} catch (e: Exception) {
|
||||
Log.e("GoutCollectionViewModel", e.stackTraceToString())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun updatePwd(
|
||||
oldPwd: String,
|
||||
newPwd: String
|
||||
) {
|
||||
val param = JSONObject()
|
||||
param["oldPwd"] = oldPwd
|
||||
param["newPwd"] = newPwd
|
||||
updatePwdParam.value = param
|
||||
}
|
||||
|
||||
}
|
||||
BIN
app/src/main/logot-playstore.png
Normal file
BIN
app/src/main/logot-playstore.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 94 KiB |
30
app/src/main/res/drawable-v24/ic_launcher_foreground.xml
Normal file
30
app/src/main/res/drawable-v24/ic_launcher_foreground.xml
Normal file
@@ -0,0 +1,30 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:aapt="http://schemas.android.com/aapt"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
android:viewportWidth="108"
|
||||
android:viewportHeight="108">
|
||||
<path android:pathData="M31,63.928c0,0 6.4,-11 12.1,-13.1c7.2,-2.6 26,-1.4 26,-1.4l38.1,38.1L107,108.928l-32,-1L31,63.928z">
|
||||
<aapt:attr name="android:fillColor">
|
||||
<gradient
|
||||
android:endX="85.84757"
|
||||
android:endY="92.4963"
|
||||
android:startX="42.9492"
|
||||
android:startY="49.59793"
|
||||
android:type="linear">
|
||||
<item
|
||||
android:color="#44000000"
|
||||
android:offset="0.0" />
|
||||
<item
|
||||
android:color="#00000000"
|
||||
android:offset="1.0" />
|
||||
</gradient>
|
||||
</aapt:attr>
|
||||
</path>
|
||||
<path
|
||||
android:fillColor="#FFFFFF"
|
||||
android:fillType="nonZero"
|
||||
android:pathData="M65.3,45.828l3.8,-6.6c0.2,-0.4 0.1,-0.9 -0.3,-1.1c-0.4,-0.2 -0.9,-0.1 -1.1,0.3l-3.9,6.7c-6.3,-2.8 -13.4,-2.8 -19.7,0l-3.9,-6.7c-0.2,-0.4 -0.7,-0.5 -1.1,-0.3C38.8,38.328 38.7,38.828 38.9,39.228l3.8,6.6C36.2,49.428 31.7,56.028 31,63.928h46C76.3,56.028 71.8,49.428 65.3,45.828zM43.4,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2c-0.3,-0.7 -0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C45.3,56.528 44.5,57.328 43.4,57.328L43.4,57.328zM64.6,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2s-0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C66.5,56.528 65.6,57.328 64.6,57.328L64.6,57.328z"
|
||||
android:strokeWidth="1"
|
||||
android:strokeColor="#00000000" />
|
||||
</vector>
|
||||
9
app/src/main/res/drawable-v24/text_view_border.xml
Normal file
9
app/src/main/res/drawable-v24/text_view_border.xml
Normal file
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<solid android:color="#d9001b" />
|
||||
<stroke android:width="1dip" android:color="#d9001b" />
|
||||
<corners android:topLeftRadius="500dp"
|
||||
android:topRightRadius="500dp"
|
||||
android:bottomRightRadius="500dp"
|
||||
android:bottomLeftRadius="500dp"/>
|
||||
</shape>
|
||||
356
app/src/main/res/layout/activity_accident_visa_details.xml
Normal file
356
app/src/main/res/layout/activity_accident_visa_details.xml
Normal file
@@ -0,0 +1,356 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<data>
|
||||
|
||||
<import type="com.lukouguoji.module_base.ui.weight.data.layout.DataLayoutType" />
|
||||
|
||||
<import type="com.lukouguoji.module_base.common.DetailsPageType" />
|
||||
|
||||
<variable
|
||||
name="viewModel"
|
||||
type="com.lukouguoji.aerologic.page.accident.visa.details.AccidentVisaDetailsViewModel" />
|
||||
|
||||
</data>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/backgroud_gray"
|
||||
android:orientation="vertical">
|
||||
|
||||
<include layout="@layout/title_tool_bar" />
|
||||
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="10dp">
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
|
||||
enable="@{viewModel.pageType != DetailsPageType.Details}"
|
||||
title='@{"起始站:"}'
|
||||
setTextAllCaps="@{true}"
|
||||
titleLength="@{13}"
|
||||
type="@{DataLayoutType.INPUT}"
|
||||
value="@={viewModel.dataBean.dep}"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
|
||||
enable="@{viewModel.pageType == DetailsPageType.Add}"
|
||||
required="@{viewModel.pageType == DetailsPageType.Add}"
|
||||
title='@{"航班号:"}'
|
||||
setTextAllCaps="@{true}"
|
||||
titleLength="@{7}"
|
||||
type="@{DataLayoutType.INPUT}"
|
||||
value="@={viewModel.dataBean.fno}"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="10dp">
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
|
||||
enable="@{viewModel.pageType != DetailsPageType.Details}"
|
||||
title='@{"飞机号:"}'
|
||||
titleLength="@{13}"
|
||||
type="@{DataLayoutType.INPUT}"
|
||||
value="@={viewModel.dataBean.registeration}"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
|
||||
enable="@{viewModel.pageType != DetailsPageType.Details}"
|
||||
title='@{"声明价值:"}'
|
||||
titleLength="@{7}"
|
||||
type="@{DataLayoutType.INPUT}"
|
||||
value="@={viewModel.dataBean.declareamount}"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="10dp">
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
|
||||
enable="@{viewModel.pageType != DetailsPageType.Details}"
|
||||
title='@{"负责商务载重的飞行组组员:"}'
|
||||
titleLength="@{13}"
|
||||
type="@{DataLayoutType.INPUT}"
|
||||
value="@={viewModel.dataBean.fltcrew}"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="10dp">
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
|
||||
enable="@{viewModel.pageType != DetailsPageType.Details}"
|
||||
title='@{"货运单或邮件路单号:"}'
|
||||
titleLength="@{13}"
|
||||
type="@{DataLayoutType.INPUT}"
|
||||
value="@={viewModel.dataBean.mawbno}"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="10dp">
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
|
||||
enable="@{viewModel.pageType != DetailsPageType.Details}"
|
||||
title='@{"发运站:"}'
|
||||
titleLength="@{13}"
|
||||
type="@{DataLayoutType.INPUT}"
|
||||
setTextAllCaps="@{true}"
|
||||
value="@={viewModel.dataBean.dep}"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
|
||||
enable="@{viewModel.pageType != DetailsPageType.Details}"
|
||||
title='@{"到达站:"}'
|
||||
titleLength="@{7}"
|
||||
type="@{DataLayoutType.INPUT}"
|
||||
setTextAllCaps="@{true}"
|
||||
value="@={viewModel.dataBean.dest}"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="10dp">
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
|
||||
enable="@{viewModel.pageType != DetailsPageType.Details}"
|
||||
title='@{"托运人名称及住址:"}'
|
||||
titleLength="@{13}"
|
||||
type="@{DataLayoutType.INPUT}"
|
||||
value="@={viewModel.dataBean.shipper}"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="10dp">
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
|
||||
enable="@{viewModel.pageType != DetailsPageType.Details}"
|
||||
title='@{"收货人名称及住址:"}'
|
||||
titleLength="@{13}"
|
||||
type="@{DataLayoutType.INPUT}"
|
||||
value="@={viewModel.dataBean.consignee}"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="10dp">
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
|
||||
enable="@{viewModel.pageType != DetailsPageType.Details}"
|
||||
title='@{"重量:"}'
|
||||
titleLength="@{13}"
|
||||
type="@{DataLayoutType.INPUT}"
|
||||
value="@={viewModel.dataBean.weight}"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
|
||||
enable="@{viewModel.pageType != DetailsPageType.Details}"
|
||||
title='@{"件数:"}'
|
||||
titleLength="@{7}"
|
||||
type="@{DataLayoutType.INPUT}"
|
||||
value="@={viewModel.dataBean.pc}"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="10dp">
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
|
||||
enable="@{viewModel.pageType != DetailsPageType.Details}"
|
||||
title='@{"包装情况:"}'
|
||||
titleLength="@{13}"
|
||||
type="@{DataLayoutType.INPUT}"
|
||||
value="@={viewModel.dataBean.packing}"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="10dp">
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
|
||||
enable="@{viewModel.pageType != DetailsPageType.Details}"
|
||||
title='@{"所附证件:"}'
|
||||
titleLength="@{13}"
|
||||
type="@{DataLayoutType.INPUT}"
|
||||
value="@={viewModel.dataBean.annex}"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="10dp">
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
|
||||
enable="@{viewModel.pageType != DetailsPageType.Details}"
|
||||
inputHeight="@{100}"
|
||||
title='@{"事故发生或发现经过:"}'
|
||||
titleLength="@{13}"
|
||||
type="@{DataLayoutType.INPUT}"
|
||||
value="@={viewModel.dataBean.accidentdes}"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="10dp">
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
|
||||
enable="@{viewModel.pageType != DetailsPageType.Details}"
|
||||
title='@{"结论:"}'
|
||||
titleLength="@{13}"
|
||||
type="@{DataLayoutType.INPUT}"
|
||||
value="@={viewModel.dataBean.conclusion}"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="10dp">
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
|
||||
enable="@{viewModel.pageType != DetailsPageType.Details}"
|
||||
title='@{"收货人姓名:"}'
|
||||
titleLength="@{13}"
|
||||
type="@{DataLayoutType.INPUT}"
|
||||
value="@={viewModel.dataBean.name}"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
|
||||
enable="@{viewModel.pageType != DetailsPageType.Details}"
|
||||
title='@{"职别或通讯处:"}'
|
||||
titleLength="@{7}"
|
||||
type="@{DataLayoutType.INPUT}"
|
||||
value="@={viewModel.dataBean.title}"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rv"
|
||||
itemLayoutId="@{viewModel.itemLayoutId}"
|
||||
viewHolder="@{viewModel.itemViewHolder}"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="10dp"
|
||||
app:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
|
||||
app:spanCount="4"
|
||||
tools:listitem="@layout/item_image_select" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:background="@color/color_bottom_layout"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingHorizontal="15dp">
|
||||
|
||||
<View
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<TextView
|
||||
style="@style/tv_bottom_btn"
|
||||
visible="@{viewModel.pageType != DetailsPageType.Details}"
|
||||
android:onClick="@{()-> viewModel.onCancelClick()}"
|
||||
android:text="取消" />
|
||||
|
||||
<TextView
|
||||
style="@style/tv_bottom_btn"
|
||||
visible="@{viewModel.pageType != DetailsPageType.Details}"
|
||||
android:onClick="@{()-> viewModel.onSaveClick()}"
|
||||
android:text="保存" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</layout>
|
||||
157
app/src/main/res/layout/activity_accident_visa_list.xml
Normal file
157
app/src/main/res/layout/activity_accident_visa_list.xml
Normal file
@@ -0,0 +1,157 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<data>
|
||||
|
||||
<import type="com.lukouguoji.module_base.ui.weight.search.layout.SearchLayoutType" />
|
||||
|
||||
<variable
|
||||
name="viewModel"
|
||||
type="com.lukouguoji.aerologic.page.accident.visa.list.AccidentVisaListViewModel" />
|
||||
</data>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/backgroud_gray"
|
||||
android:orientation="vertical">
|
||||
|
||||
<include layout="@layout/title_tool_bar" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="10dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayout
|
||||
hint='@{"请选择开具日期"}'
|
||||
icon="@{@drawable/img_date}"
|
||||
type="@{SearchLayoutType.DATE}"
|
||||
value="@={viewModel.date}"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayout
|
||||
hint='@{"请输入航班号"}'
|
||||
type="@{SearchLayoutType.INPUT}"
|
||||
value="@={viewModel.flightNo}"
|
||||
setTextAllCaps="@{true}"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayout
|
||||
hint='@{"请输入发运站"}'
|
||||
type="@{SearchLayoutType.INPUT}"
|
||||
value="@={viewModel.dep}"
|
||||
android:layout_width="0dp"
|
||||
setTextAllCaps="@{true}"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayout
|
||||
hint='@{"请输入单号"}'
|
||||
type="@{SearchLayoutType.INPUT}"
|
||||
value="@={viewModel.order}"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayout
|
||||
hint='@{"请输入填表人"}'
|
||||
type="@{SearchLayoutType.INPUT}"
|
||||
value="@={viewModel.name}"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1">
|
||||
|
||||
<ImageView
|
||||
style="@style/iv_search_action"
|
||||
android:onClick="@{()-> viewModel.refresh()}"
|
||||
android:src="@drawable/img_search" />
|
||||
|
||||
<ImageView
|
||||
style="@style/iv_search_action"
|
||||
android:onClick="@{()-> viewModel.onAddClick()}"
|
||||
android:src="@drawable/img_add" />
|
||||
|
||||
<ImageView
|
||||
style="@style/iv_search_action"
|
||||
android:onClick="@{()-> viewModel.onDeleteClick()}"
|
||||
android:src="@drawable/img_delete" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingTop="10dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="15dp"
|
||||
android:onClick="@{()->viewModel.onAllSelectClick()}"
|
||||
android:text="全选" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/checkIcon"
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:onClick="@{()->viewModel.onAllSelectClick()}"
|
||||
android:src="@drawable/img_check_all" />
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
<com.scwang.smart.refresh.layout.SmartRefreshLayout
|
||||
android:id="@+id/srl"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_weight="1">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rv"
|
||||
itemLayoutId="@{viewModel.itemLayoutId}"
|
||||
viewHolder="@{viewModel.itemViewHolder}"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
||||
tools:listitem="@layout/item_accident_visa_list" />
|
||||
|
||||
</com.scwang.smart.refresh.layout.SmartRefreshLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:background="#5c6890"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingHorizontal="15dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text='@{"合计:"+viewModel.count+"条"}'
|
||||
android:textColor="@color/white"
|
||||
android:textSize="18sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
</layout>
|
||||
148
app/src/main/res/layout/activity_car_add.xml
Normal file
148
app/src/main/res/layout/activity_car_add.xml
Normal file
@@ -0,0 +1,148 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<data>
|
||||
|
||||
<import type="com.lukouguoji.module_base.ui.weight.data.layout.DataLayoutType" />
|
||||
|
||||
<import type="com.lukouguoji.module_base.common.DetailsPageType" />
|
||||
|
||||
<variable
|
||||
name="viewModel"
|
||||
type="com.lukouguoji.aerologic.page.car.add.CarDetailsViewModel" />
|
||||
</data>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/backgroud_gray"
|
||||
android:orientation="vertical">
|
||||
|
||||
<include layout="@layout/title_tool_bar" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="10dp">
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
|
||||
enable="@{viewModel.pageType != DetailsPageType.Details}"
|
||||
required="@{viewModel.pageType != DetailsPageType.Details}"
|
||||
title='@{"平板车号:"}'
|
||||
titleLength="@{5}"
|
||||
type="@{DataLayoutType.INPUT}"
|
||||
value='@={viewModel.carBean.carId}'
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
|
||||
enable="@{viewModel.pageType != DetailsPageType.Details}"
|
||||
list="@{viewModel.statusList}"
|
||||
required="@{viewModel.pageType != DetailsPageType.Details}"
|
||||
title='@{"状态:"}'
|
||||
titleLength="@{5}"
|
||||
type="@{DataLayoutType.SPINNER}"
|
||||
value='@={viewModel.carBean.status}'
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
|
||||
enable="@{viewModel.pageType != DetailsPageType.Details}"
|
||||
required="@{viewModel.pageType != DetailsPageType.Details}"
|
||||
title='@{"自重:"}'
|
||||
titleLength="@{3}"
|
||||
type="@{DataLayoutType.INPUT}"
|
||||
value='@={viewModel.carBean.carWeight}'
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="10dp">
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
|
||||
enable="@{viewModel.pageType != DetailsPageType.Details}"
|
||||
required="@{viewModel.pageType != DetailsPageType.Details}"
|
||||
title='@{"标重:"}'
|
||||
titleLength="@{5}"
|
||||
type="@{DataLayoutType.INPUT}"
|
||||
value='@={viewModel.carBean.signWeight}'
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
|
||||
enable="@{viewModel.pageType != DetailsPageType.Details}"
|
||||
title='@{"最大载重:"}'
|
||||
titleLength="@{5}"
|
||||
type="@{DataLayoutType.INPUT}"
|
||||
value='@={viewModel.carBean.maxWeight}'
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
|
||||
enable="@{viewModel.pageType != DetailsPageType.Details}"
|
||||
hint='@{" "}'
|
||||
list="@{viewModel.locationList}"
|
||||
title='@{"位置:"}'
|
||||
titleLength="@{3}"
|
||||
type="@{DataLayoutType.SPINNER}"
|
||||
value='@={viewModel.carBean.position}'
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="10dp">
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
|
||||
enable="@{viewModel.pageType != DetailsPageType.Details}"
|
||||
title='@{"备注:"}'
|
||||
titleLength="@{5}"
|
||||
type="@{DataLayoutType.INPUT}"
|
||||
value='@={viewModel.carBean.remark}'
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:background="@color/color_bottom_layout"
|
||||
android:gravity="end"
|
||||
android:paddingHorizontal="15dp">
|
||||
|
||||
<TextView
|
||||
style="@style/tv_bottom_btn"
|
||||
visible="@{viewModel.pageType != DetailsPageType.Details}"
|
||||
android:onClick="@{()-> viewModel.onCancelClick()}"
|
||||
android:text="取消" />
|
||||
|
||||
<TextView
|
||||
style="@style/tv_bottom_btn"
|
||||
visible="@{viewModel.pageType != DetailsPageType.Details}"
|
||||
android:onClick="@{()-> viewModel.onSaveClick()}"
|
||||
android:text="保存" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
</layout>
|
||||
77
app/src/main/res/layout/activity_car_chart.xml
Normal file
77
app/src/main/res/layout/activity_car_chart.xml
Normal file
@@ -0,0 +1,77 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<data>
|
||||
|
||||
<import type="com.lukouguoji.module_base.ui.weight.search.layout.SearchLayoutType" />
|
||||
|
||||
<variable
|
||||
name="viewModel"
|
||||
type="com.lukouguoji.aerologic.page.car.chart.CarChartViewModel" />
|
||||
</data>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/backgroud_gray"
|
||||
android:orientation="vertical">
|
||||
|
||||
<include layout="@layout/title_tool_bar" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="10dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayout
|
||||
hint='@{"请选择位置"}'
|
||||
list="@{viewModel.locationList}"
|
||||
type="@{SearchLayoutType.SPINNER}"
|
||||
value="@={viewModel.location}"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
setRefreshCallBack="@{viewModel::getData}"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="5">
|
||||
|
||||
<ImageView
|
||||
style="@style/iv_search_action"
|
||||
android:onClick="@{()-> viewModel.getData()}"
|
||||
android:src="@drawable/img_search" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<com.github.mikephil.charting.charts.BarChart
|
||||
android:id="@+id/bar_chart"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_margin="15dp"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:background="@color/color_bottom_layout"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingHorizontal="15dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text='@{"合计:" + viewModel.count +"辆"}'
|
||||
android:textColor="@color/white"
|
||||
android:textSize="18sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</layout>
|
||||
146
app/src/main/res/layout/activity_car_list.xml
Normal file
146
app/src/main/res/layout/activity_car_list.xml
Normal file
@@ -0,0 +1,146 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<data>
|
||||
|
||||
<import type="com.lukouguoji.module_base.ui.weight.search.layout.SearchLayoutType" />
|
||||
<import type="com.lukouguoji.module_base.ui.weight.data.layout.DataLayoutType" />
|
||||
<variable
|
||||
name="viewModel"
|
||||
type="com.lukouguoji.aerologic.page.car.list.CarListViewModel" />
|
||||
</data>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/backgroud_gray"
|
||||
android:orientation="vertical">
|
||||
|
||||
<include layout="@layout/title_tool_bar" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="10dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayout
|
||||
hint='@{"请选择位置"}'
|
||||
list="@{viewModel.locationList}"
|
||||
type="@{SearchLayoutType.SPINNER}"
|
||||
value="@={viewModel.location}"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayout
|
||||
hint='@{"请选择状态"}'
|
||||
list="@{viewModel.statusList}"
|
||||
type="@{SearchLayoutType.SPINNER}"
|
||||
value="@={viewModel.status}"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayout
|
||||
hint='@{"请输入板车号起"}'
|
||||
icon="@{@drawable/img_scan}"
|
||||
setOnIconClickListener="@{()-> viewModel.onCarScanClick()}"
|
||||
type="@{SearchLayoutType.INPUT}"
|
||||
value="@={viewModel.carStart}"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayout
|
||||
hint='@{"请输入板车号至"}'
|
||||
icon="@{@drawable/img_scan}"
|
||||
setOnIconClickListener="@{()-> viewModel.onCarScanClickCarEnd()}"
|
||||
type="@{SearchLayoutType.INPUT}"
|
||||
value="@={viewModel.carEnd}"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayout
|
||||
hint='@{"请输入打印份数"}'
|
||||
type="@{SearchLayoutType.INTEGER}"
|
||||
value="@={viewModel.printNum}"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="3">
|
||||
|
||||
<ImageView
|
||||
style="@style/iv_search_action"
|
||||
android:onClick="@{()-> viewModel.refresh()}"
|
||||
android:src="@drawable/img_search" />
|
||||
|
||||
<ImageView
|
||||
style="@style/iv_search_action"
|
||||
android:onClick="@{()-> viewModel.onAddClick()}"
|
||||
android:src="@drawable/img_add" />
|
||||
|
||||
<ImageView
|
||||
style="@style/iv_search_action"
|
||||
android:onClick="@{()-> viewModel.onPrintClick()}"
|
||||
android:src="@drawable/img_print" />
|
||||
|
||||
<!-- <View
|
||||
android:layout_width="10dp"
|
||||
android:layout_height="1dp"
|
||||
android:background="@color/color_e0" />-->
|
||||
|
||||
|
||||
<ImageView
|
||||
style="@style/iv_search_action"
|
||||
android:onClick="@{()-> viewModel.onChartClick()}"
|
||||
android:src="@drawable/img_chart" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<com.scwang.smart.refresh.layout.SmartRefreshLayout
|
||||
android:id="@+id/srl"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rv"
|
||||
itemLayoutId="@{viewModel.itemLayoutId}"
|
||||
viewHolder="@{viewModel.itemViewHolder}"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
||||
tools:listitem="@layout/item_car_list" />
|
||||
|
||||
</com.scwang.smart.refresh.layout.SmartRefreshLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:background="#5c6890"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingHorizontal="15dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text='@{"合计:" + viewModel.count + "辆"}'
|
||||
android:textColor="@color/white"
|
||||
android:textSize="18sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
</layout>
|
||||
277
app/src/main/res/layout/activity_flight_query_details.xml
Normal file
277
app/src/main/res/layout/activity_flight_query_details.xml
Normal file
@@ -0,0 +1,277 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<data>
|
||||
|
||||
<import type="com.lukouguoji.module_base.ui.weight.data.layout.DataLayoutType" />
|
||||
|
||||
<variable
|
||||
name="viewModel"
|
||||
type="com.lukouguoji.aerologic.page.flight.query.details.FlightQueryDetailsViewModel" />
|
||||
</data>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/backgroud_gray"
|
||||
android:orientation="vertical">
|
||||
|
||||
<include layout="@layout/title_tool_bar" />
|
||||
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="0dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="10dp">
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
|
||||
enable="@{false}"
|
||||
title='@{"航班日期:"}'
|
||||
titleLength="@{5}"
|
||||
type="@{DataLayoutType.INPUT}"
|
||||
value='@{viewModel.dataBean.fdate}'
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
|
||||
enable="@{false}"
|
||||
hint='@{" "}'
|
||||
title='@{"航班号:"}'
|
||||
titleLength="@{5}"
|
||||
type="@{DataLayoutType.INPUT}"
|
||||
value='@{viewModel.dataBean.fno}'
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
|
||||
enable="@{false}"
|
||||
hint='@{" "}'
|
||||
title='@{"航程:"}'
|
||||
titleLength="@{5}"
|
||||
type="@{DataLayoutType.INPUT}"
|
||||
value='@{viewModel.dataBean.range}'
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="10dp">
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
|
||||
enable="@{false}"
|
||||
title='@{"地区类型:"}'
|
||||
titleLength="@{5}"
|
||||
type="@{DataLayoutType.SPINNER}"
|
||||
value='@{viewModel.dataBean.countryType}'
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
|
||||
enable="@{false}"
|
||||
title='@{"服务类型:"}'
|
||||
titleLength="@{5}"
|
||||
type="@{DataLayoutType.SPINNER}"
|
||||
value='@{viewModel.dataBean.serviceType}'
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
|
||||
enable="@{false}"
|
||||
title='@{"经停站:"}'
|
||||
titleLength="@{5}"
|
||||
type="@{DataLayoutType.INPUT}"
|
||||
value='@{viewModel.dataBean.jtz}'
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="10dp">
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
|
||||
enable="@{false}"
|
||||
hint='@{" "}'
|
||||
title='@{"计划起飞:"}'
|
||||
titleLength="@{5}"
|
||||
type="@{DataLayoutType.INPUT}"
|
||||
value='@{viewModel.dataBean.scheduledTackOff}'
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
|
||||
enable="@{false}"
|
||||
hint='@{" "}'
|
||||
title='@{"预计起飞:"}'
|
||||
titleLength="@{5}"
|
||||
type="@{DataLayoutType.INPUT}"
|
||||
value='@{viewModel.dataBean.estimatedTakeOff}'
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
|
||||
enable="@{false}"
|
||||
hint='@{" "}'
|
||||
title='@{"实际起飞:"}'
|
||||
titleLength="@{5}"
|
||||
type="@{DataLayoutType.INPUT}"
|
||||
value='@{viewModel.dataBean.actualTakeOff}'
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="10dp">
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
|
||||
enable="@{false}"
|
||||
title='@{"计划降落:"}'
|
||||
titleLength="@{5}"
|
||||
type="@{DataLayoutType.INPUT}"
|
||||
value='@{viewModel.dataBean.scheduledArrival}'
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
|
||||
enable="@{false}"
|
||||
hint='@{" "}'
|
||||
title='@{"预计降落:"}'
|
||||
titleLength="@{5}"
|
||||
type="@{DataLayoutType.INPUT}"
|
||||
value='@{viewModel.dataBean.estimatedArrival}'
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
|
||||
enable="@{false}"
|
||||
hint='@{" "}'
|
||||
title='@{"实际降落:"}'
|
||||
titleLength="@{5}"
|
||||
type="@{DataLayoutType.INPUT}"
|
||||
value='@{viewModel.dataBean.actualArrival}'
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="10dp">
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
|
||||
enable="@{false}"
|
||||
title='@{"飞行状态:"}'
|
||||
titleLength="@{5}"
|
||||
type="@{DataLayoutType.SPINNER}"
|
||||
value='@{viewModel.dataBean.portCode}'
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
|
||||
enable="@{false}"
|
||||
hint='@{" "}'
|
||||
title='@{"航班状态:"}'
|
||||
titleLength="@{5}"
|
||||
type="@{DataLayoutType.SPINNER}"
|
||||
value='@{viewModel.dataBean.flightStatus}'
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
|
||||
enable="@{false}"
|
||||
hint='@{" "}'
|
||||
title='@{"延误原因:"}'
|
||||
titleLength="@{5}"
|
||||
type="@{DataLayoutType.INPUT}"
|
||||
value='@{viewModel.dataBean.delayFreeText}'
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="10dp">
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
|
||||
enable="@{false}"
|
||||
title='@{"机号:"}'
|
||||
titleLength="@{5}"
|
||||
type="@{DataLayoutType.INPUT}"
|
||||
value='@{viewModel.dataBean.registration}'
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
|
||||
enable="@{false}"
|
||||
hint='@{" "}'
|
||||
title='@{"机型:"}'
|
||||
titleLength="@{5}"
|
||||
type="@{DataLayoutType.INPUT}"
|
||||
value='@{viewModel.dataBean.aircraftCode}'
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
|
||||
enable="@{false}"
|
||||
hint='@{" "}'
|
||||
title='@{"机位:"}'
|
||||
titleLength="@{5}"
|
||||
type="@{DataLayoutType.INPUT}"
|
||||
value='@{viewModel.dataBean.standId}'
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:background="#5c6890"
|
||||
android:gravity="center_vertical|end"
|
||||
android:paddingHorizontal="15dp">
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
</layout>
|
||||
147
app/src/main/res/layout/activity_flight_query_list.xml
Normal file
147
app/src/main/res/layout/activity_flight_query_list.xml
Normal file
@@ -0,0 +1,147 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<data>
|
||||
|
||||
<import type="com.lukouguoji.module_base.ui.weight.search.layout.SearchLayoutType" />
|
||||
|
||||
<variable
|
||||
name="viewModel"
|
||||
type="com.lukouguoji.aerologic.page.flight.query.list.FlightQueryListViewModel" />
|
||||
</data>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/color_f2"
|
||||
android:orientation="vertical">
|
||||
|
||||
<include layout="@layout/title_tool_bar" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="10dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayout
|
||||
hint='@{"请选择航班日期"}'
|
||||
icon='@{@drawable/img_date}'
|
||||
type="@{SearchLayoutType.DATE}"
|
||||
value="@={viewModel.date}"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayout
|
||||
hint='@{"请输入航班号"}'
|
||||
type="@{SearchLayoutType.INPUT}"
|
||||
value="@={viewModel.fNo}"
|
||||
setTextAllCaps="@{true}"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayout
|
||||
type="@{SearchLayoutType.INPUT}"
|
||||
value="@={viewModel.dep}"
|
||||
hint='@{"始发站"}'
|
||||
setTextAllCaps="@{true}"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<View
|
||||
android:layout_width="10dp"
|
||||
android:layout_height="1dp"
|
||||
android:background="@color/color_e0" />
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayout
|
||||
type="@{SearchLayoutType.INPUT}"
|
||||
hint='@{"目的站"}'
|
||||
value="@={viewModel.dest}"
|
||||
setTextAllCaps="@{true}"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
</LinearLayout>
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayout
|
||||
hint='@{"请选择地区类型"}'
|
||||
list="@{viewModel.addressTypeList}"
|
||||
type="@{SearchLayoutType.SPINNER}"
|
||||
value="@={viewModel.addressType}"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayout
|
||||
hint='@{"请选择服务类型"}'
|
||||
list="@{viewModel.serviceTypeList}"
|
||||
type="@{SearchLayoutType.SPINNER}"
|
||||
value="@={viewModel.serviceType}"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1">
|
||||
|
||||
<ImageView
|
||||
style="@style/iv_search_action"
|
||||
android:onClick="@{()-> viewModel.refresh()}"
|
||||
android:src="@drawable/img_search" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<com.scwang.smart.refresh.layout.SmartRefreshLayout
|
||||
android:id="@+id/srl"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rv"
|
||||
itemLayoutId="@{viewModel.itemLayoutId}"
|
||||
viewHolder="@{viewModel.itemViewHolder}"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
||||
tools:listitem="@layout/item_flight_query_list" />
|
||||
|
||||
</com.scwang.smart.refresh.layout.SmartRefreshLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:background="@color/color_bottom_layout"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingHorizontal="15dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text='@{"合计:"+viewModel.count+"条"}'
|
||||
android:textColor="@color/white"
|
||||
android:textSize="18sp"
|
||||
android:textStyle="bold"
|
||||
tools:text="合计:3条" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
</layout>
|
||||
160
app/src/main/res/layout/activity_gnj_handover_list.xml
Normal file
160
app/src/main/res/layout/activity_gnj_handover_list.xml
Normal file
@@ -0,0 +1,160 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<data>
|
||||
|
||||
<import type="com.lukouguoji.module_base.ui.weight.search.layout.SearchLayoutType" />
|
||||
|
||||
<variable
|
||||
name="viewModel"
|
||||
type="com.lukouguoji.aerologic.page.gnj.jiaojie.GnjHandoverListViewModel" />
|
||||
</data>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/color_f2"
|
||||
android:orientation="vertical">
|
||||
|
||||
<include layout="@layout/title_tool_bar" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="10dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayout
|
||||
hint='@{"请选择航班日期"}'
|
||||
icon='@{@drawable/img_date}'
|
||||
type="@{SearchLayoutType.DATE}"
|
||||
value="@={viewModel.date}"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayout
|
||||
hint='@{"请输入航班号"}'
|
||||
type="@{SearchLayoutType.INPUT}"
|
||||
value="@={viewModel.fNo}"
|
||||
android:layout_width="0dp"
|
||||
setTextAllCaps="@{true}"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayout
|
||||
hint='@{"请输入始发站"}'
|
||||
type="@{SearchLayoutType.INPUT}"
|
||||
value="@={viewModel.fdep}"
|
||||
android:layout_width="0dp"
|
||||
setTextAllCaps="@{true}"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayout
|
||||
hint='@{"请输入板车号"}'
|
||||
icon="@{@drawable/img_scan}"
|
||||
setOnIconClickListener="@{()->viewModel.onCarScanClick()}"
|
||||
type="@{SearchLayoutType.INPUT}"
|
||||
value="@={viewModel.car}"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayout
|
||||
hint='@{"请选择交接仓管"}'
|
||||
list="@{viewModel.whsOpNameList}"
|
||||
type="@{SearchLayoutType.SPINNER}"
|
||||
value="@={viewModel.whsOpName}"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1">
|
||||
|
||||
<ImageView
|
||||
style="@style/iv_search_action"
|
||||
android:onClick="@{()-> viewModel.refresh()}"
|
||||
android:src="@drawable/img_search" />
|
||||
|
||||
<ImageView
|
||||
style="@style/iv_search_action"
|
||||
android:onClick="@{()-> viewModel.filterClick()}"
|
||||
android:src="@drawable/img_filter" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingTop="10dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="15dp"
|
||||
android:onClick="@{()->viewModel.onAllSelectClick()}"
|
||||
android:text="全选" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/checkIcon"
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:onClick="@{()->viewModel.onAllSelectClick()}"
|
||||
android:src="@drawable/img_check_all" />
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
<com.scwang.smart.refresh.layout.SmartRefreshLayout
|
||||
android:id="@+id/srl"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rv"
|
||||
itemLayoutId="@{viewModel.itemLayoutId}"
|
||||
viewHolder="@{viewModel.itemViewHolder}"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
||||
tools:listitem="@layout/item_gnj_handover_list" />
|
||||
|
||||
</com.scwang.smart.refresh.layout.SmartRefreshLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:background="@color/color_bottom_layout"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingHorizontal="15dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text='@{"合计:"+viewModel.count+"辆,已交接:"+viewModel.handoverCount+"辆"}'
|
||||
android:textColor="@color/white"
|
||||
android:textSize="18sp"
|
||||
android:textStyle="bold"/>
|
||||
|
||||
<TextView
|
||||
style="@style/tv_bottom_btn"
|
||||
android:onClick="@{()->viewModel.handover()}"
|
||||
android:text="清点交接" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
</layout>
|
||||
279
app/src/main/res/layout/activity_gnj_manifest_add.xml
Normal file
279
app/src/main/res/layout/activity_gnj_manifest_add.xml
Normal file
@@ -0,0 +1,279 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<data>
|
||||
|
||||
<import type="com.lukouguoji.module_base.ui.weight.data.layout.DataLayoutType" />
|
||||
|
||||
<import type="com.lukouguoji.module_base.common.DetailsPageType" />
|
||||
|
||||
<variable
|
||||
name="viewModel"
|
||||
type="com.lukouguoji.aerologic.page.gnj.manifest.add.GnjManifestAddViewModel" />
|
||||
</data>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/backgroud_gray"
|
||||
android:orientation="vertical">
|
||||
|
||||
<include layout="@layout/title_tool_bar" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="10dp">
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
|
||||
android:id="@+id/pdl_waybill"
|
||||
enable="@{viewModel.pageType != DetailsPageType.Details}"
|
||||
required="@{viewModel.pageType != DetailsPageType.Details}"
|
||||
title='@{"运单号:"}'
|
||||
maxLength="@{11}"
|
||||
setRefreshCallBack="@{viewModel::waybillChanged}"
|
||||
titleLength="@{5}"
|
||||
type="@{DataLayoutType.INPUT}"
|
||||
value='@={viewModel.dataBean.wbNo}'
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
|
||||
enable="@{viewModel.pageType != DetailsPageType.Details}"
|
||||
hint='@{" "}'
|
||||
list="@{viewModel.agentList}"
|
||||
required="@{viewModel.pageType != DetailsPageType.Details}"
|
||||
title='@{"代理人:"}'
|
||||
titleLength="@{5}"
|
||||
type="@{DataLayoutType.SPINNER}"
|
||||
value='@={viewModel.dataBean.agentCode}'
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
|
||||
enable="@{viewModel.pageType != DetailsPageType.Details}"
|
||||
hint='@{" "}'
|
||||
list="@{viewModel.spCodeList}"
|
||||
required="@{viewModel.pageType != DetailsPageType.Details}"
|
||||
title='@{"特码:"}'
|
||||
titleLength="@{6}"
|
||||
type="@{DataLayoutType.SPINNER}"
|
||||
value='@={viewModel.dataBean.spCode}'
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="10dp">
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
|
||||
enable="@{viewModel.pageType != DetailsPageType.Details}"
|
||||
required="@{viewModel.pageType != DetailsPageType.Details}"
|
||||
title='@{"运单件数:"}'
|
||||
titleLength="@{5}"
|
||||
type="@{DataLayoutType.INPUT}"
|
||||
value='@={viewModel.dataBean.totalPc}'
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
|
||||
enable="@{viewModel.pageType != DetailsPageType.Details}"
|
||||
required="@{viewModel.pageType != DetailsPageType.Details}"
|
||||
title='@{"实到件数:"}'
|
||||
titleLength="@{5}"
|
||||
type="@{DataLayoutType.INPUT}"
|
||||
value='@={viewModel.dataBean.pc}'
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
|
||||
enable="@{viewModel.pageType != DetailsPageType.Details}"
|
||||
required="@{viewModel.pageType != DetailsPageType.Details}"
|
||||
title='@{"实到重量:"}'
|
||||
titleLength="@{6}"
|
||||
type="@{DataLayoutType.INPUT}"
|
||||
value='@={viewModel.dataBean.weight}'
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="10dp">
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
|
||||
enable="@{viewModel.pageType != DetailsPageType.Details}"
|
||||
required="@{viewModel.pageType != DetailsPageType.Details}"
|
||||
title='@{"计费重量:"}'
|
||||
titleLength="@{5}"
|
||||
type="@{DataLayoutType.INPUT}"
|
||||
value='@={viewModel.dataBean.cashWeight}'
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
|
||||
enable="@{viewModel.pageType != DetailsPageType.Details}"
|
||||
maxLength="@{3}"
|
||||
required="@{viewModel.pageType != DetailsPageType.Details}"
|
||||
title='@{"始发港:"}'
|
||||
titleLength="@{5}"
|
||||
setTextAllCaps="@{true}"
|
||||
type="@{DataLayoutType.INPUT}"
|
||||
value='@={viewModel.dataBean.origin}'
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
|
||||
enable="@{viewModel.pageType != DetailsPageType.Details}"
|
||||
maxLength="@{3}"
|
||||
required="@{viewModel.pageType != DetailsPageType.Details}"
|
||||
title='@{"目的港:"}'
|
||||
setTextAllCaps="@{true}"
|
||||
titleLength="@{6}"
|
||||
type="@{DataLayoutType.INPUT}"
|
||||
value='@={viewModel.dataBean.dest}'
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="10dp">
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
|
||||
enable="@{viewModel.pageType != DetailsPageType.Details}"
|
||||
list="@{viewModel.waybillTypeList}"
|
||||
title='@{"运单类型:"}'
|
||||
titleLength="@{5}"
|
||||
type="@{DataLayoutType.SPINNER}"
|
||||
value='@={viewModel.dataBean.awbType}'
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
|
||||
enable="@{viewModel.pageType != DetailsPageType.Details}"
|
||||
list="@{viewModel.businessTypeList}"
|
||||
title='@{"业务类型:"}'
|
||||
titleLength="@{5}"
|
||||
type="@{DataLayoutType.SPINNER}"
|
||||
value='@={viewModel.dataBean.businessType}'
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
|
||||
enable="@{viewModel.pageType != DetailsPageType.Details}"
|
||||
hint='@{" "}'
|
||||
list="@{viewModel.wxKuList}"
|
||||
title='@{"危险品库位:"}'
|
||||
titleLength="@{6}"
|
||||
type="@{DataLayoutType.SPINNER}"
|
||||
value='@={viewModel.dataBean.dgrLocation}'
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="10dp">
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
|
||||
enable="@{viewModel.pageType != DetailsPageType.Details}"
|
||||
required="@{viewModel.pageType != DetailsPageType.Details}"
|
||||
title='@{"品名:"}'
|
||||
titleLength="@{5}"
|
||||
type="@{DataLayoutType.INPUT}"
|
||||
value='@={viewModel.dataBean.goods}'
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="2" />
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
|
||||
enable="@{viewModel.pageType != DetailsPageType.Details}"
|
||||
hint='@{" "}'
|
||||
list="@{viewModel.wxDescList}"
|
||||
title='@{"危险品描述:"}'
|
||||
titleLength="@{6}"
|
||||
type="@{DataLayoutType.SPINNER}"
|
||||
value='@={viewModel.dataBean.dgrDetail}'
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="10dp">
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
|
||||
enable="@{viewModel.pageType != DetailsPageType.Details}"
|
||||
title='@{"备注:"}'
|
||||
titleLength="@{5}"
|
||||
type="@{DataLayoutType.INPUT}"
|
||||
value='@={viewModel.dataBean.remark}'
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="2" />
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
|
||||
enable="@{viewModel.pageType != DetailsPageType.Details}"
|
||||
title='@{"UN编号:"}'
|
||||
titleLength="@{6}"
|
||||
type="@{DataLayoutType.INPUT}"
|
||||
value='@={viewModel.dataBean.unNumber}'
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:background="#5c6890"
|
||||
android:gravity="center_vertical|end"
|
||||
android:paddingHorizontal="15dp">
|
||||
|
||||
<TextView
|
||||
style="@style/tv_bottom_btn"
|
||||
visible="@{viewModel.pageType != DetailsPageType.Details}"
|
||||
android:onClick="@{()-> viewModel.onCancelClick()}"
|
||||
android:text="取消" />
|
||||
|
||||
<TextView
|
||||
style="@style/tv_bottom_btn"
|
||||
visible="@{viewModel.pageType != DetailsPageType.Details}"
|
||||
android:onClick="@{()-> viewModel.onSaveClick()}"
|
||||
android:text="保存" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
</layout>
|
||||
175
app/src/main/res/layout/activity_gnj_manifest_list.xml
Normal file
175
app/src/main/res/layout/activity_gnj_manifest_list.xml
Normal file
@@ -0,0 +1,175 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<data>
|
||||
|
||||
<import type="com.lukouguoji.module_base.ui.weight.search.layout.SearchLayoutType" />
|
||||
|
||||
<variable
|
||||
name="viewModel"
|
||||
type="com.lukouguoji.aerologic.page.gnj.manifest.list.GnjManifestListViewModel" />
|
||||
</data>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/color_f2"
|
||||
android:orientation="vertical">
|
||||
|
||||
<include layout="@layout/title_tool_bar" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="10dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayout
|
||||
hint='@{"请选择航班日期"}'
|
||||
icon="@{@drawable/img_date}"
|
||||
type="@{SearchLayoutType.DATE}"
|
||||
value="@={viewModel.date}"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayout
|
||||
hint='@{"请输入航班号"}'
|
||||
setTextAllCaps="@{true}"
|
||||
type="@{SearchLayoutType.INPUT}"
|
||||
value="@={viewModel.fNo}"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayout
|
||||
enable="@{false}"
|
||||
type="@{SearchLayoutType.INPUT}"
|
||||
value="@={viewModel.flightBean.fdep}"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<View
|
||||
android:layout_width="10dp"
|
||||
android:layout_height="1dp"
|
||||
android:background="@color/color_e0" />
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayout
|
||||
enable="@{false}"
|
||||
type="@{SearchLayoutType.INPUT}"
|
||||
value="@={viewModel.flightBean.fdest}"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1">
|
||||
|
||||
<ImageView
|
||||
style="@style/iv_search_action"
|
||||
android:onClick="@{()-> viewModel.refresh()}"
|
||||
android:src="@drawable/img_search" />
|
||||
|
||||
<ImageView
|
||||
style="@style/iv_search_action"
|
||||
android:onClick="@{()-> viewModel.addClick()}"
|
||||
android:src="@drawable/img_add" />
|
||||
|
||||
<ImageView
|
||||
style="@style/iv_search_action"
|
||||
android:onClick="@{()-> viewModel.deleteClick()}"
|
||||
android:src="@drawable/img_delete" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<View
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingTop="10dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="15dp"
|
||||
android:onClick="@{()->viewModel.checkAllClick()}"
|
||||
android:text="全选" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/checkIcon"
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:onClick="@{()->viewModel.checkAllClick()}"
|
||||
android:src="@drawable/img_check_all" />
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
<com.scwang.smart.refresh.layout.SmartRefreshLayout
|
||||
android:id="@+id/srl"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_weight="1">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rv"
|
||||
itemLayoutId="@{viewModel.itemLayoutId}"
|
||||
viewHolder="@{viewModel.itemViewHolder}"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
||||
tools:listitem="@layout/item_gnj_manifest_list" />
|
||||
|
||||
</com.scwang.smart.refresh.layout.SmartRefreshLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:background="#5c6890"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingHorizontal="15dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text='@{"合计:"+viewModel.count+"条,总件数:"+viewModel.number+",总重量:"+viewModel.weight+"KG"}'
|
||||
android:textColor="@color/white"
|
||||
android:textSize="18sp"
|
||||
android:textStyle="bold"
|
||||
tools:text="合计:3条,总件数:212,总重量:342KG" />
|
||||
|
||||
<TextView
|
||||
style="@style/tv_bottom_btn"
|
||||
android:onClick="@{()-> viewModel.sendClick()}"
|
||||
android:text="货物发放" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
</layout>
|
||||
148
app/src/main/res/layout/activity_gnj_move_stash_list.xml
Normal file
148
app/src/main/res/layout/activity_gnj_move_stash_list.xml
Normal file
@@ -0,0 +1,148 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<data>
|
||||
|
||||
<import type="com.lukouguoji.module_base.ui.weight.search.layout.SearchLayoutType" />
|
||||
|
||||
<variable
|
||||
name="viewModel"
|
||||
type="com.lukouguoji.aerologic.page.gnj.move.stash.list.GnjMoveStashListViewModel" />
|
||||
</data>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/color_f2"
|
||||
android:orientation="vertical">
|
||||
|
||||
<include layout="@layout/title_tool_bar" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="10dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayout
|
||||
hint='@{"请选择业务类型"}'
|
||||
list="@{viewModel.businessTypeList}"
|
||||
type="@{SearchLayoutType.SPINNER}"
|
||||
value="@={viewModel.businessType}"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayout
|
||||
hint='@{"请输入运单号"}'
|
||||
icon="@{@drawable/img_scan}"
|
||||
setInputWaybill="@{true}"
|
||||
setOnIconClickListener="@{()-> viewModel.waybillScanClick()}"
|
||||
setRefreshCallBack="@{viewModel::refresh}"
|
||||
setSearchListRefresh="@{viewModel::getWayBillList}"
|
||||
type="@{SearchLayoutType.INPUT}"
|
||||
value="@={viewModel.waybill}"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayout
|
||||
hint='@{"请输入承运人"}'
|
||||
type="@{SearchLayoutType.INPUT}"
|
||||
value="@={viewModel.carrier}"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1">
|
||||
|
||||
<ImageView
|
||||
style="@style/iv_search_action"
|
||||
android:onClick="@{()-> viewModel.refresh()}"
|
||||
android:src="@drawable/img_search" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<View
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1" />
|
||||
|
||||
</LinearLayout>
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingTop="10dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="15dp"
|
||||
android:onClick="@{()->viewModel.checkAllClick()}"
|
||||
android:text="全选" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/checkIcon"
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:onClick="@{()->viewModel.checkAllClick()}"
|
||||
android:src="@drawable/img_check_all" />
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
<com.scwang.smart.refresh.layout.SmartRefreshLayout
|
||||
android:id="@+id/srl"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rv"
|
||||
itemLayoutId="@{viewModel.itemLayoutId}"
|
||||
viewHolder="@{viewModel.itemViewHolder}"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
||||
tools:listitem="@layout/item_gnj_move_stash_list" />
|
||||
|
||||
</com.scwang.smart.refresh.layout.SmartRefreshLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:background="@color/color_bottom_layout"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingHorizontal="15dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text='@{"合计:"+viewModel.count+"条,总件数:"+viewModel.number+",总重量:"+viewModel.weight+"KG"}'
|
||||
android:textColor="@color/white"
|
||||
android:textSize="18sp"
|
||||
android:textStyle="bold"
|
||||
tools:text="合计:3条,总件数:212,总重量:342KG" />
|
||||
|
||||
<TextView
|
||||
style="@style/tv_bottom_btn"
|
||||
android:onClick="@{()-> viewModel.moveStashClick()}"
|
||||
android:text="移库" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
</layout>
|
||||
165
app/src/main/res/layout/activity_gnj_out_stash_list.xml
Normal file
165
app/src/main/res/layout/activity_gnj_out_stash_list.xml
Normal file
@@ -0,0 +1,165 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<data>
|
||||
|
||||
<import type="com.lukouguoji.module_base.ui.weight.search.layout.SearchLayoutType" />
|
||||
|
||||
<variable
|
||||
name="viewModel"
|
||||
type="com.lukouguoji.aerologic.page.gnj.out.stash.list.GnjOutStashListViewModel" />
|
||||
</data>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/color_f2"
|
||||
android:orientation="vertical">
|
||||
|
||||
<include layout="@layout/title_tool_bar" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="10dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayout
|
||||
hint='@{"请选择提货日期"}'
|
||||
icon="@{@drawable/img_date}"
|
||||
type="@{SearchLayoutType.DATE}"
|
||||
value="@={viewModel.date}"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<View
|
||||
android:layout_width="10dp"
|
||||
android:layout_height="1dp"
|
||||
android:background="@color/gray" />
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayout
|
||||
hint='@{"请选择提货日期"}'
|
||||
icon="@{@drawable/img_date}"
|
||||
type="@{SearchLayoutType.DATE}"
|
||||
value="@={viewModel.dateEnd}"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayout
|
||||
hint='@{"请选择代理人"}'
|
||||
list="@{viewModel.agentList}"
|
||||
type="@{SearchLayoutType.SPINNER}"
|
||||
value="@={viewModel.agent}"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayout
|
||||
hint='@{"请输入运单号"}'
|
||||
icon="@{@drawable/img_scan}"
|
||||
setInputWaybill="@{true}"
|
||||
setOnIconClickListener="@{()-> viewModel.waybillScanClick()}"
|
||||
setRefreshCallBack="@{viewModel::refresh}"
|
||||
setSearchListRefresh="@{viewModel::getWayBillList}"
|
||||
type="@{SearchLayoutType.INPUT}"
|
||||
value="@={viewModel.waybill}"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayout
|
||||
hint='@{"请输入提货单号"}'
|
||||
icon="@{@drawable/img_scan}"
|
||||
setOnIconClickListener="@{()-> viewModel.orderScanClick()}"
|
||||
type="@{SearchLayoutType.INPUT}"
|
||||
value="@={viewModel.order}"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1">
|
||||
|
||||
<ImageView
|
||||
style="@style/iv_search_action"
|
||||
android:onClick="@{()-> viewModel.refresh()}"
|
||||
android:src="@drawable/img_search" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingTop="10dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="15dp"
|
||||
android:onClick="@{()->viewModel.checkAllClick()}"
|
||||
android:text="全选" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/checkIcon"
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:onClick="@{()->viewModel.checkAllClick()}"
|
||||
android:src="@drawable/img_check_all" />
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
<com.scwang.smart.refresh.layout.SmartRefreshLayout
|
||||
android:id="@+id/srl"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_weight="1">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rv"
|
||||
itemLayoutId="@{viewModel.itemLayoutId}"
|
||||
viewHolder="@{viewModel.itemViewHolder}"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
||||
tools:listitem="@layout/item_gnj_out_stash_list" />
|
||||
|
||||
</com.scwang.smart.refresh.layout.SmartRefreshLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:background="@color/color_bottom_layout"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingHorizontal="15dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text='@{"合计:"+viewModel.count+"条,总件数:"+viewModel.number+",总重量:"+viewModel.weight+"KG"}'
|
||||
android:textColor="@color/white"
|
||||
android:textSize="18sp"
|
||||
android:textStyle="bold"
|
||||
tools:text="合计:3条,总件数:212,总重量:342KG" />
|
||||
|
||||
<TextView
|
||||
style="@style/tv_bottom_btn"
|
||||
android:onClick="@{()-> viewModel.confirmClick()}"
|
||||
android:text="确认出库" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
</layout>
|
||||
232
app/src/main/res/layout/activity_gnj_query_details.xml
Normal file
232
app/src/main/res/layout/activity_gnj_query_details.xml
Normal file
@@ -0,0 +1,232 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<data>
|
||||
|
||||
<import type="com.lukouguoji.module_base.ui.weight.data.layout.DataLayoutType" />
|
||||
|
||||
<variable
|
||||
name="viewModel"
|
||||
type="com.lukouguoji.aerologic.page.gnj.query.details.GnjQueryDetailsViewModel" />
|
||||
</data>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/backgroud_gray"
|
||||
android:orientation="vertical">
|
||||
|
||||
<include layout="@layout/title_tool_bar" />
|
||||
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="0dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="10dp">
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
|
||||
enable="@{false}"
|
||||
title='@{"运单号:"}'
|
||||
titleLength="@{5}"
|
||||
type="@{DataLayoutType.INPUT}"
|
||||
value='@{viewModel.dataBean.wbNo}'
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
|
||||
enable="@{false}"
|
||||
hint='@{" "}'
|
||||
title='@{"代理人:"}'
|
||||
titleLength="@{5}"
|
||||
type="@{DataLayoutType.SPINNER}"
|
||||
value='@{viewModel.dataBean.agentCode}'
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
|
||||
enable="@{false}"
|
||||
hint='@{" "}'
|
||||
title='@{"特码:"}'
|
||||
titleLength="@{5}"
|
||||
type="@{DataLayoutType.SPINNER}"
|
||||
value='@{viewModel.dataBean.spCode}'
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="10dp">
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
|
||||
enable="@{false}"
|
||||
title='@{"总件数:"}'
|
||||
titleLength="@{5}"
|
||||
type="@{DataLayoutType.INPUT}"
|
||||
value='@{viewModel.dataBean.pc}'
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
|
||||
enable="@{false}"
|
||||
title='@{"总重量:"}'
|
||||
titleLength="@{5}"
|
||||
type="@{DataLayoutType.INPUT}"
|
||||
value='@{viewModel.dataBean.weight}'
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
|
||||
enable="@{false}"
|
||||
title='@{"体积:"}'
|
||||
titleLength="@{5}"
|
||||
type="@{DataLayoutType.INPUT}"
|
||||
value='@{viewModel.dataBean.volume}'
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="10dp">
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
|
||||
enable="@{false}"
|
||||
hint='@{" "}'
|
||||
title='@{"运单类型:"}'
|
||||
titleLength="@{5}"
|
||||
type="@{DataLayoutType.SPINNER}"
|
||||
value='@{viewModel.dataBean.awbType}'
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
|
||||
enable="@{false}"
|
||||
hint='@{" "}'
|
||||
title='@{"业务类型:"}'
|
||||
titleLength="@{5}"
|
||||
type="@{DataLayoutType.SPINNER}"
|
||||
value='@{viewModel.dataBean.businessType}'
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
|
||||
enable="@{false}"
|
||||
hint='@{" "}'
|
||||
title='@{"包装类型:"}'
|
||||
titleLength="@{5}"
|
||||
type="@{DataLayoutType.SPINNER}"
|
||||
value='@{viewModel.dataBean.packageType}'
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="10dp">
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
|
||||
enable="@{false}"
|
||||
title='@{"品名:"}'
|
||||
titleLength="@{5}"
|
||||
type="@{DataLayoutType.INPUT}"
|
||||
value='@{viewModel.dataBean.goods}'
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
|
||||
enable="@{false}"
|
||||
hint='@{" "}'
|
||||
title='@{"备注:"}'
|
||||
titleLength="@{5}"
|
||||
type="@{DataLayoutType.INPUT}"
|
||||
value='@{viewModel.dataBean.remark}'
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="2" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<View
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/bg_xuxian" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="关联仓库信息"
|
||||
android:textColor="@color/colorPrimary" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:src="@mipmap/open_show"
|
||||
app:tint="@color/colorPrimary" />
|
||||
|
||||
<View
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/bg_xuxian" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rv"
|
||||
itemLayoutId="@{viewModel.itemLayoutId}"
|
||||
viewHolder="@{viewModel.viewHolder}"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
||||
tools:listitem="@layout/item_gnc_query_details" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
|
||||
|
||||
<TextView
|
||||
style="@style/tv_bottom_btn"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginVertical="15dp"
|
||||
android:onClick="@{()-> viewModel.onFlowChartClick()}"
|
||||
android:text="运单流程图" />
|
||||
|
||||
</LinearLayout>
|
||||
</layout>
|
||||
139
app/src/main/res/layout/activity_gnj_query_list.xml
Normal file
139
app/src/main/res/layout/activity_gnj_query_list.xml
Normal file
@@ -0,0 +1,139 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<data>
|
||||
|
||||
<import type="com.lukouguoji.module_base.ui.weight.search.layout.SearchLayoutType" />
|
||||
|
||||
<variable
|
||||
name="viewModel"
|
||||
type="com.lukouguoji.aerologic.page.gnj.query.list.GnjQueryListViewModel" />
|
||||
</data>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/color_f2"
|
||||
android:orientation="vertical">
|
||||
|
||||
<include layout="@layout/title_tool_bar" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="10dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayout
|
||||
hint='@{"请选择航班日期"}'
|
||||
icon='@{@drawable/img_date}'
|
||||
type="@{SearchLayoutType.DATE}"
|
||||
value="@={viewModel.date}"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
<View
|
||||
android:layout_width="10dp"
|
||||
android:background="@color/gray"
|
||||
android:layout_height="1dp"/>
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayout
|
||||
hint='@{"请选择航班日期"}'
|
||||
icon='@{@drawable/img_date}'
|
||||
type="@{SearchLayoutType.DATE}"
|
||||
value="@={viewModel.dateEnd}"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayout
|
||||
hint='@{"请选择代理人"}'
|
||||
list="@{viewModel.agentList}"
|
||||
type="@{SearchLayoutType.SPINNER}"
|
||||
value="@={viewModel.agent}"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayout
|
||||
hint='@{"请选择特码"}'
|
||||
list="@{viewModel.spCodeList}"
|
||||
type="@{SearchLayoutType.SPINNER}"
|
||||
value="@={viewModel.spCode}"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayout
|
||||
hint='@{"请输入运单号"}'
|
||||
icon="@{@drawable/img_scan}"
|
||||
setOnIconClickListener="@{()-> viewModel.waybillScanClick()}"
|
||||
type="@{SearchLayoutType.INPUT}"
|
||||
setInputWaybill="@{true}"
|
||||
setRefreshCallBack="@{viewModel::refresh}"
|
||||
setSearchListRefresh="@{viewModel::getWayBillList}"
|
||||
value="@={viewModel.waybill}"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1">
|
||||
|
||||
<ImageView
|
||||
style="@style/iv_search_action"
|
||||
android:onClick="@{()-> viewModel.refresh()}"
|
||||
android:src="@drawable/img_search" />
|
||||
|
||||
<ImageView
|
||||
style="@style/iv_search_action"
|
||||
android:onClick="@{()-> viewModel.filterClick()}"
|
||||
android:src="@drawable/img_filter" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<com.scwang.smart.refresh.layout.SmartRefreshLayout
|
||||
android:id="@+id/srl"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rv"
|
||||
itemLayoutId="@{viewModel.itemLayoutId}"
|
||||
viewHolder="@{viewModel.itemViewHolder}"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
||||
tools:listitem="@layout/item_gnj_query_list" />
|
||||
|
||||
</com.scwang.smart.refresh.layout.SmartRefreshLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:background="@color/color_bottom_layout"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingHorizontal="15dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text='@{"合计:"+viewModel.count+"条,总件数:"+viewModel.totalPc+",总重量:"+viewModel.totalWeight+"KG"}'
|
||||
android:textColor="@color/white"
|
||||
android:textSize="18sp"
|
||||
android:textStyle="bold"
|
||||
tools:text="合计:3条,总件数:212,总重量:342KG" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
</layout>
|
||||
222
app/src/main/res/layout/activity_gnj_stash_details.xml
Normal file
222
app/src/main/res/layout/activity_gnj_stash_details.xml
Normal file
@@ -0,0 +1,222 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<data>
|
||||
|
||||
<import type="com.lukouguoji.module_base.ui.weight.data.layout.DataLayoutType" />
|
||||
|
||||
<variable
|
||||
name="viewModel"
|
||||
type="com.lukouguoji.aerologic.page.gnj.stash.details.GnjStashDetailsViewModel" />
|
||||
</data>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/backgroud_gray"
|
||||
android:orientation="vertical">
|
||||
|
||||
<include layout="@layout/title_tool_bar" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="10dp">
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
|
||||
enable="@{false}"
|
||||
title='@{"运单号:"}'
|
||||
titleLength="@{5}"
|
||||
type="@{DataLayoutType.INPUT}"
|
||||
value='@={viewModel.dataBean.wbNo}'
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
|
||||
enable="@{false}"
|
||||
hint='@{" "}'
|
||||
list="@{viewModel.agentList}"
|
||||
title='@{"代理人:"}'
|
||||
titleLength="@{5}"
|
||||
type="@{DataLayoutType.SPINNER}"
|
||||
value='@={viewModel.dataBean.agentCode}'
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
|
||||
enable="@{false}"
|
||||
hint='@{" "}'
|
||||
list="@{viewModel.spCodeList}"
|
||||
title='@{"特码:"}'
|
||||
titleLength="@{5}"
|
||||
type="@{DataLayoutType.SPINNER}"
|
||||
value='@={viewModel.dataBean.spCode}'
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="10dp">
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
|
||||
enable="@{false}"
|
||||
title='@{"件数:"}'
|
||||
titleLength="@{5}"
|
||||
type="@{DataLayoutType.INPUT}"
|
||||
value='@={viewModel.dataBean.pc}'
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
|
||||
enable="@{false}"
|
||||
title='@{"重量:"}'
|
||||
titleLength="@{5}"
|
||||
type="@{DataLayoutType.INPUT}"
|
||||
value='@={viewModel.dataBean.weight}'
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
|
||||
enable="@{false}"
|
||||
title='@{"库位:"}'
|
||||
titleLength="@{5}"
|
||||
type="@{DataLayoutType.INPUT}"
|
||||
value='@={viewModel.dataBean.location}'
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="10dp">
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
|
||||
enable="@{false}"
|
||||
title='@{"航班日期:"}'
|
||||
titleLength="@{5}"
|
||||
type="@{DataLayoutType.INPUT}"
|
||||
value='@={viewModel.dataBean.fdate}'
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
|
||||
enable="@{false}"
|
||||
title='@{"航班号:"}'
|
||||
titleLength="@{5}"
|
||||
type="@{DataLayoutType.INPUT}"
|
||||
value='@={viewModel.dataBean.fno}'
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
|
||||
enable="@{false}"
|
||||
title='@{"始发港:"}'
|
||||
titleLength="@{5}"
|
||||
type="@{DataLayoutType.INPUT}"
|
||||
value='@={viewModel.dataBean.origin}'
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="10dp">
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
|
||||
enable="@{false}"
|
||||
hint='@{" "}'
|
||||
list="@{viewModel.waybillTypeList}"
|
||||
title='@{"运单类型:"}'
|
||||
titleLength="@{5}"
|
||||
type="@{DataLayoutType.SPINNER}"
|
||||
value='@={viewModel.dataBean.awbType}'
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
|
||||
enable="@{false}"
|
||||
hint='@{" "}'
|
||||
list="@{viewModel.businessTypeList}"
|
||||
title='@{"业务类型:"}'
|
||||
titleLength="@{5}"
|
||||
type="@{DataLayoutType.SPINNER}"
|
||||
value='@={viewModel.dataBean.businessType}'
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
|
||||
enable="@{false}"
|
||||
hint='@{" "}'
|
||||
list="@{viewModel.packageTypeList}"
|
||||
title='@{"包装类型:"}'
|
||||
titleLength="@{5}"
|
||||
type="@{DataLayoutType.SPINNER}"
|
||||
value='@={viewModel.dataBean.packageType}'
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="10dp">
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
|
||||
enable="@{false}"
|
||||
title='@{"品名:"}'
|
||||
titleLength="@{5}"
|
||||
type="@{DataLayoutType.INPUT}"
|
||||
value='@={viewModel.dataBean.goods}'
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="2" />
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
|
||||
enable="@{false}"
|
||||
hint='@{" "}'
|
||||
title='@{"入库时间:"}'
|
||||
titleLength="@{5}"
|
||||
type="@{DataLayoutType.INPUT}"
|
||||
value='@={viewModel.dataBean.opDate}'
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:background="#5c6890"
|
||||
android:gravity="center_vertical|end"
|
||||
android:paddingHorizontal="15dp">
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
</layout>
|
||||
134
app/src/main/res/layout/activity_gnj_stash_list.xml
Normal file
134
app/src/main/res/layout/activity_gnj_stash_list.xml
Normal file
@@ -0,0 +1,134 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<data>
|
||||
|
||||
<import type="com.lukouguoji.module_base.ui.weight.search.layout.SearchLayoutType" />
|
||||
|
||||
<variable
|
||||
name="viewModel"
|
||||
type="com.lukouguoji.aerologic.page.gnj.stash.list.GnjStashListViewModel" />
|
||||
</data>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/color_f2"
|
||||
android:orientation="vertical">
|
||||
|
||||
<include layout="@layout/title_tool_bar" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="10dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayout
|
||||
list="@{viewModel.sortList}"
|
||||
type="@{SearchLayoutType.SPINNER}"
|
||||
value="@={viewModel.sort}"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayout
|
||||
hint='@{"请选择代理人"}'
|
||||
list="@{viewModel.agentList}"
|
||||
type="@{SearchLayoutType.SPINNER}"
|
||||
value="@={viewModel.agent}"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayout
|
||||
hint='@{"请输入承运人"}'
|
||||
setTextAllCaps="@{true}"
|
||||
type="@{SearchLayoutType.INPUT}"
|
||||
value="@={viewModel.carrier}"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayout
|
||||
hint='@{"请输入上一航程"}'
|
||||
setTextAllCaps="@{true}"
|
||||
type="@{SearchLayoutType.INPUT}"
|
||||
value="@={viewModel.lastFlight}"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayout
|
||||
hint='@{"请输入运单号"}'
|
||||
icon="@{@drawable/img_scan}"
|
||||
setOnIconClickListener="@{()-> viewModel.waybillScanClick()}"
|
||||
type="@{SearchLayoutType.INPUT}"
|
||||
value="@={viewModel.waybill}"
|
||||
setInputWaybill="@{true}"
|
||||
setRefreshCallBack="@{viewModel::refresh}"
|
||||
setSearchListRefresh="@{viewModel::getWayBillList}"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1">
|
||||
|
||||
<ImageView
|
||||
style="@style/iv_search_action"
|
||||
android:onClick="@{()-> viewModel.refresh()}"
|
||||
android:src="@drawable/img_search" />
|
||||
|
||||
<ImageView
|
||||
style="@style/iv_search_action"
|
||||
android:onClick="@{()-> viewModel.filterClick()}"
|
||||
android:src="@drawable/img_filter" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<com.scwang.smart.refresh.layout.SmartRefreshLayout
|
||||
android:id="@+id/srl"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rv"
|
||||
itemLayoutId="@{viewModel.itemLayoutId}"
|
||||
viewHolder="@{viewModel.itemViewHolder}"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
||||
tools:listitem="@layout/item_gnj_stash_list" />
|
||||
|
||||
</com.scwang.smart.refresh.layout.SmartRefreshLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:background="@color/color_bottom_layout"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingHorizontal="15dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text='@{"合计:"+viewModel.count+"条,总件数:"+viewModel.number+",总重量:"+viewModel.weight+"KG"}'
|
||||
android:textColor="@color/white"
|
||||
android:textSize="18sp"
|
||||
android:textStyle="bold"
|
||||
tools:text="合计:3条,总件数:212,总重量:342KG" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
</layout>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user