init: init proj
1
module_mit/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
/build
|
||||
73
module_mit/build.gradle
Normal file
@@ -0,0 +1,73 @@
|
||||
if (isBuildModule.toBoolean()) {
|
||||
apply plugin: 'com.android.application'
|
||||
} else {
|
||||
apply plugin: 'com.android.library'
|
||||
}
|
||||
apply plugin: 'kotlin-android'
|
||||
apply plugin: 'kotlin-kapt'
|
||||
|
||||
kapt {
|
||||
arguments {
|
||||
arg("AROUTER_MODULE_NAME", project.getName())
|
||||
}
|
||||
}
|
||||
|
||||
android {
|
||||
compileSdkVersion 31
|
||||
|
||||
sourceSets {
|
||||
main{
|
||||
// 应用
|
||||
if(isBuildModule.toBoolean()){
|
||||
manifest.srcFile 'src/main/debug/AndroidManifest.xml'
|
||||
}else{// 插件
|
||||
manifest.srcFile 'src/main/release/AndroidManifest.xml'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
defaultConfig {
|
||||
if (isBuildModule.toBoolean()) {
|
||||
applicationId "com.lukouguoji.mit"
|
||||
}
|
||||
minSdkVersion 24
|
||||
targetSdkVersion 30
|
||||
versionCode 1
|
||||
versionName "1.0"
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_1_8
|
||||
targetCompatibility JavaVersion.VERSION_1_8
|
||||
}
|
||||
kotlinOptions {
|
||||
jvmTarget = '1.8'
|
||||
}
|
||||
buildToolsVersion '30.0.3'
|
||||
|
||||
buildFeatures {
|
||||
dataBinding = true
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
api project(':module_base')
|
||||
|
||||
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'
|
||||
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'
|
||||
}
|
||||
21
module_mit/proguard-rules.pro
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
# 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
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.lukouguoji.mit
|
||||
|
||||
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.mit", appContext.packageName)
|
||||
}
|
||||
}
|
||||
25
module_mit/src/main/debug/AndroidManifest.xml
Normal file
@@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.lukouguoji.mit">
|
||||
|
||||
<application
|
||||
android:allowBackup="true"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:label="@string/app_name"
|
||||
android:roundIcon="@mipmap/ic_launcher_round"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/Theme.Aerologic">
|
||||
<activity
|
||||
android:name=".MainActivity"
|
||||
android:configChanges="orientation|keyboardHidden"
|
||||
android:screenOrientation="userLandscape"
|
||||
android:exported="true">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
11
module_mit/src/main/java/com/lukouguoji/mit/MainActivity.kt
Normal file
@@ -0,0 +1,11 @@
|
||||
package com.lukouguoji.mit
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import android.os.Bundle
|
||||
|
||||
class MainActivity : AppCompatActivity() {
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
setContentView(R.layout.activity_main)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,441 @@
|
||||
package com.lukouguoji.mit.activity
|
||||
|
||||
import android.app.Activity
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import android.text.Editable
|
||||
import android.text.TextWatcher
|
||||
import android.view.View
|
||||
import android.widget.*
|
||||
import androidx.lifecycle.ViewModelProvider
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.alibaba.android.arouter.launcher.ARouter
|
||||
import com.alibaba.fastjson.JSONArray
|
||||
import com.alibaba.fastjson.JSONObject
|
||||
import com.lukouguoji.mit.R
|
||||
import com.lukouguoji.mit.adapt.AccidentVisaAdapter
|
||||
import com.lukouguoji.mit.model.AccidentVisaModel
|
||||
import com.lukouguoji.mit.viewModel.AccidentVisaViewModel
|
||||
import com.lukouguoji.module_base.ActivityCollector
|
||||
import com.lukouguoji.module_base.BaseActivity
|
||||
import com.lukouguoji.module_base.common.Constant
|
||||
import com.lukouguoji.module_base.router.ARouterConstants
|
||||
import com.lukouguoji.module_base.util.Common
|
||||
import com.lukouguoji.module_base.util.SwipeDeleteRecyclerView
|
||||
import com.scwang.smart.refresh.footer.ClassicsFooter
|
||||
import com.scwang.smart.refresh.header.ClassicsHeader
|
||||
import com.scwang.smart.refresh.layout.api.RefreshLayout
|
||||
import java.text.SimpleDateFormat
|
||||
import java.util.*
|
||||
|
||||
@Route(path = ARouterConstants.ACTIVITY_URL_MONITOR_ACCIDENT_VISA)
|
||||
class AccidentVisaActivity : BaseActivity(), View.OnClickListener {
|
||||
private val currentTitleName = "事故签证"
|
||||
|
||||
private lateinit var viewModel: AccidentVisaViewModel
|
||||
private lateinit var adapter: AccidentVisaAdapter
|
||||
private val collectList = ArrayList<AccidentVisaModel>()
|
||||
private lateinit var refreshLayout: RefreshLayout
|
||||
private var currentPage = 1
|
||||
private var pageSize = 10
|
||||
private var totalPage = 0
|
||||
private var totalCount = 0 //总条数
|
||||
private val calendar = Calendar.getInstance()
|
||||
private val ymdSdf = SimpleDateFormat("yyyy-MM-dd")//年月日
|
||||
private val ymdHmsSdf = SimpleDateFormat("yyyy-MM-dd HH:mm:ss")//年月日 时分秒
|
||||
|
||||
//标题
|
||||
private lateinit var toolBack: LinearLayout
|
||||
private lateinit var titleName: TextView
|
||||
|
||||
//筛选页
|
||||
private lateinit var searchListFragment: LinearLayout
|
||||
private lateinit var filtrateFragment: LinearLayout
|
||||
private lateinit var filtrateLayout: LinearLayout
|
||||
private lateinit var submit: TextView
|
||||
private lateinit var reset: TextView
|
||||
|
||||
|
||||
//搜索
|
||||
private lateinit var beginDate: TextView
|
||||
private lateinit var endDate: TextView
|
||||
private lateinit var areaType: TextView
|
||||
private var areaTypeStatus = ""
|
||||
private val areaTypeArr = JSONArray()
|
||||
private lateinit var ieFlag: TextView
|
||||
private var ieFlagStatus = ""
|
||||
private val ieFlagArr = JSONArray()
|
||||
private lateinit var wbNo: EditText
|
||||
private lateinit var opId: EditText
|
||||
private lateinit var searchLayout: LinearLayout
|
||||
private lateinit var addIcon: ImageView
|
||||
private lateinit var quickSearch: EditText
|
||||
|
||||
//列表
|
||||
private lateinit var listLayout: LinearLayout
|
||||
|
||||
|
||||
private fun initView() {
|
||||
viewModel = ViewModelProvider(this).get(AccidentVisaViewModel::class.java)
|
||||
|
||||
val layoutManager = LinearLayoutManager(this)
|
||||
adapter = AccidentVisaAdapter(this, viewModel, collectList)
|
||||
var recyclerView: SwipeDeleteRecyclerView = findViewById(R.id.collectList)
|
||||
recyclerView.layoutManager = layoutManager
|
||||
recyclerView.adapter = adapter
|
||||
|
||||
refreshLayout = findViewById(R.id.refreshLayout)
|
||||
|
||||
//标题
|
||||
toolBack = findViewById(R.id.tool_back)
|
||||
titleName = findViewById(R.id.title_name)
|
||||
//筛选页
|
||||
searchListFragment = findViewById(R.id.searchListFragment)
|
||||
filtrateFragment = findViewById(R.id.filtrateFragment)
|
||||
filtrateLayout = findViewById(R.id.filtrateLayout)
|
||||
submit = findViewById(R.id.submit)
|
||||
reset = findViewById(R.id.reset)
|
||||
|
||||
beginDate = findViewById(R.id.beginDate)
|
||||
endDate = findViewById(R.id.endDate)
|
||||
areaType = findViewById(R.id.areaType)
|
||||
ieFlag = findViewById(R.id.ieFlag)
|
||||
wbNo = findViewById(R.id.wbNo)
|
||||
opId = findViewById(R.id.opId)
|
||||
searchLayout = findViewById(R.id.searchLayout)
|
||||
addIcon = findViewById(R.id.addIcon)
|
||||
quickSearch = findViewById(R.id.quickSearch)
|
||||
//列表
|
||||
listLayout = findViewById(R.id.listLayout)
|
||||
|
||||
|
||||
toolBack.setOnClickListener(this)
|
||||
beginDate.setOnClickListener(this)
|
||||
endDate.setOnClickListener(this)
|
||||
areaType.setOnClickListener(this)
|
||||
ieFlag.setOnClickListener(this)
|
||||
searchLayout.setOnClickListener(this)
|
||||
filtrateLayout.setOnClickListener(this)
|
||||
addIcon.setOnClickListener(this)
|
||||
submit.setOnClickListener(this)
|
||||
reset.setOnClickListener(this)
|
||||
|
||||
quickSearch.addTextChangedListener(object : TextWatcher {
|
||||
override fun beforeTextChanged(s: CharSequence?, start: Int, count: Int, after: Int) {
|
||||
|
||||
}
|
||||
|
||||
override fun onTextChanged(s: CharSequence?, start: Int, before: Int, count: Int) {
|
||||
if (s != null && s.toString() != "") {
|
||||
val filterCollectionList = collectList.filter { c -> c.wbNo.contains(s.toString()) }
|
||||
recyclerView.adapter = AccidentVisaAdapter(
|
||||
ActivityCollector.getLastActivity()!!,
|
||||
viewModel,
|
||||
filterCollectionList as MutableList<AccidentVisaModel>
|
||||
)
|
||||
} else {
|
||||
recyclerView.adapter = AccidentVisaAdapter(
|
||||
ActivityCollector.getLastActivity()!!,
|
||||
viewModel,
|
||||
collectList
|
||||
)
|
||||
}
|
||||
adapter.notifyDataSetChanged()
|
||||
}
|
||||
|
||||
override fun afterTextChanged(s: Editable?) {
|
||||
|
||||
}
|
||||
})
|
||||
|
||||
wbNo.addTextChangedListener(object : TextWatcher {
|
||||
override fun beforeTextChanged(s: CharSequence?, start: Int, count: Int, after: Int) {
|
||||
|
||||
}
|
||||
|
||||
override fun onTextChanged(s: CharSequence?, start: Int, before: Int, count: Int) {
|
||||
if (s != null && s.toString().length > 11) {
|
||||
var wbNoStr = s.toString()
|
||||
Common.showToast(ActivityCollector.getLastActivity() as Activity, "请输入正确的运单号格式!")
|
||||
wbNoStr = wbNoStr.substring(0, 11)
|
||||
wbNo.setText(wbNoStr)
|
||||
}
|
||||
}
|
||||
|
||||
override fun afterTextChanged(s: Editable?) {
|
||||
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
var format = ymdSdf.format(Date())
|
||||
beginDate.text = "$format 00:00:00"
|
||||
endDate.text = "$format 23:59:59"
|
||||
|
||||
val noneArea = JSONObject()
|
||||
noneArea["name"] = "请选择"
|
||||
noneArea["code"] = ""
|
||||
val guonei = JSONObject()
|
||||
guonei["name"] = "国内"
|
||||
guonei["code"] = "0"
|
||||
val guoji = JSONObject()
|
||||
guoji["name"] = "国际"
|
||||
guoji["code"] = "1"
|
||||
areaTypeArr.add(noneArea)
|
||||
areaTypeArr.add(guonei)
|
||||
areaTypeArr.add(guoji)
|
||||
|
||||
val noneIeFlag = JSONObject()
|
||||
noneIeFlag["name"] = "请选择"
|
||||
noneIeFlag["code"] = ""
|
||||
val chu = JSONObject()
|
||||
chu["name"] = "出港"
|
||||
chu["code"] = "E"
|
||||
val jin = JSONObject()
|
||||
jin["name"] = "进港"
|
||||
jin["code"] = "I"
|
||||
ieFlagArr.add(noneIeFlag)
|
||||
ieFlagArr.add(chu)
|
||||
ieFlagArr.add(jin)
|
||||
}
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
setContentView(R.layout.activity_accident_visa)
|
||||
initView()
|
||||
|
||||
//查询返回结果
|
||||
viewModel.searchParamLive.observe(this) {
|
||||
loadingCancel()
|
||||
//1.获取数据
|
||||
var listArr: JSONArray = it["list"] as JSONArray
|
||||
totalCount = it.getIntValue("total")
|
||||
totalPage = it["pages"] as Int
|
||||
// var listArr :JSONArray =it["list"] as JSONArray
|
||||
if (listArr.size > 0) {
|
||||
listLayout.visibility = View.VISIBLE
|
||||
|
||||
//2.循环遍历塞入collectList
|
||||
listArr.forEach {
|
||||
val itemObj = it as JSONObject
|
||||
|
||||
val id = itemObj.getIntValue("id")
|
||||
val wbNo = itemObj.getString("wbNo") ?: ""
|
||||
val areaFlag = itemObj.getString("areaFlag") ?: ""
|
||||
val ieFlag = itemObj.getString("ieFlag") ?: ""
|
||||
val dpc = itemObj.getString("dpc") ?: ""//不正常件数
|
||||
val opId = itemObj.getString("opId") ?: ""//操作人
|
||||
val opDate = itemObj.getString("opDate") ?: ""//操作时间
|
||||
|
||||
//列表赋值
|
||||
collectList.add(
|
||||
AccidentVisaModel(
|
||||
id,
|
||||
wbNo,
|
||||
areaFlag,
|
||||
ieFlag,
|
||||
dpc,
|
||||
opId,
|
||||
opDate
|
||||
)
|
||||
)
|
||||
}
|
||||
//3.调adpter展示
|
||||
if (currentPage == 1) {
|
||||
val layoutManager = LinearLayoutManager(this)
|
||||
adapter = AccidentVisaAdapter(this, viewModel, collectList)
|
||||
var recyclerView: SwipeDeleteRecyclerView = findViewById(R.id.collectList)
|
||||
recyclerView.layoutManager = layoutManager
|
||||
recyclerView.adapter = adapter
|
||||
} else {
|
||||
adapter.notifyItemRangeInserted((currentPage - 1) * 10, collectList.size)
|
||||
}
|
||||
refreshLayout.finishRefresh()
|
||||
refreshLayout.finishLoadMore()
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
resetSearch()
|
||||
|
||||
//删除行 返回结果
|
||||
viewModel.deleteLineObserver.observe(this) {
|
||||
loadingCancel()
|
||||
val positionDel = it.getInteger("positionDel")
|
||||
val status = it.getString("status")
|
||||
val msg = it.getString("msg")
|
||||
if (Constant.Result.succ == status) {
|
||||
collectList.removeAt(positionDel)
|
||||
adapter.notifyItemRemoved(positionDel)
|
||||
val dataStatus = it.getString("data")
|
||||
if (Constant.Result.succ == dataStatus) {
|
||||
Common.showToast(this, "删除成功!")
|
||||
|
||||
} else {
|
||||
Common.showToast(this, "删除失败!")
|
||||
}
|
||||
} else {
|
||||
Common.showToast(this, "删除失败!")
|
||||
}
|
||||
}
|
||||
|
||||
/////////////////////////////// 加载刷新的布局
|
||||
refreshLayout.setRefreshHeader(ClassicsHeader(this))
|
||||
refreshLayout.setRefreshFooter(ClassicsFooter(this))
|
||||
/////////////////////////////// 下拉刷新
|
||||
refreshLayout.setOnRefreshListener {
|
||||
resetSearch()
|
||||
}
|
||||
/////////////////////////////// 上拉加载
|
||||
refreshLayout.setOnLoadMoreListener {
|
||||
if (currentPage < totalPage) {
|
||||
currentPage++
|
||||
//初始化查询
|
||||
searchFun()
|
||||
} else {
|
||||
refreshLayout.finishLoadMoreWithNoMoreData()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onClick(v: View?) {
|
||||
v?.let {
|
||||
when (it.id) {
|
||||
R.id.tool_back -> {
|
||||
if (searchListFragment.visibility == View.GONE && filtrateFragment.visibility == View.VISIBLE) {
|
||||
searchListFragment.visibility = View.VISIBLE
|
||||
filtrateFragment.visibility = View.GONE
|
||||
titleName.text = currentTitleName
|
||||
} else {
|
||||
finish()
|
||||
}
|
||||
}
|
||||
R.id.beginDate -> {
|
||||
Common.onYearMonthDayTime(this, beginDate.text.toString()) { year, month, day, hour, minute, second ->
|
||||
calendar.set(year, month - 1, day, hour, minute, second)
|
||||
beginDate.text = ymdHmsSdf.format(calendar.time)
|
||||
}
|
||||
}
|
||||
R.id.endDate -> {
|
||||
Common.onYearMonthDayTime(this, endDate.text.toString()) { year, month, day, hour, minute, second ->
|
||||
calendar.set(year, month - 1, day, hour, minute, second)
|
||||
endDate.text = ymdHmsSdf.format(calendar.time)
|
||||
}
|
||||
}
|
||||
R.id.areaType -> {
|
||||
Common.singleSelect(this, "地区类型", areaTypeArr, areaTypeStatus) { _, item ->
|
||||
val jsonObject = item as JSONObject
|
||||
val name = jsonObject.getString("name")
|
||||
val code = jsonObject.getString("code")
|
||||
areaType.text = name
|
||||
areaTypeStatus = code
|
||||
}
|
||||
}
|
||||
R.id.ieFlag -> {
|
||||
Common.singleSelect(this, "进出港", ieFlagArr, ieFlagStatus) { _, item ->
|
||||
val jsonObject = item as JSONObject
|
||||
val name = jsonObject.getString("name")
|
||||
val code = jsonObject.getString("code")
|
||||
ieFlag.text = name
|
||||
ieFlagStatus = code
|
||||
}
|
||||
}
|
||||
R.id.searchLayout -> {
|
||||
resetSearch()
|
||||
}
|
||||
R.id.filtrateLayout -> {
|
||||
if (searchListFragment.visibility == View.VISIBLE && filtrateFragment.visibility == View.GONE) {
|
||||
searchListFragment.visibility = View.GONE
|
||||
filtrateFragment.visibility = View.VISIBLE
|
||||
titleName.text = "搜索"
|
||||
} else {
|
||||
searchListFragment.visibility = View.VISIBLE
|
||||
filtrateFragment.visibility = View.GONE
|
||||
titleName.text = currentTitleName
|
||||
}
|
||||
// Common.showToast(this,"筛选")
|
||||
}
|
||||
R.id.addIcon -> {
|
||||
ARouter.getInstance().build(ARouterConstants.ACTIVITY_URL_MONITOR_ACCIDENT_VISA_INFO)
|
||||
.navigation(this, Constant.RequestCode.accident_visa_list_query_result)
|
||||
}
|
||||
R.id.submit -> {
|
||||
//筛选页隐藏
|
||||
searchListFragment.visibility = View.VISIBLE
|
||||
filtrateFragment.visibility = View.GONE
|
||||
titleName.text = currentTitleName
|
||||
//搜索
|
||||
resetSearch()
|
||||
}
|
||||
R.id.reset -> {
|
||||
resetFun()
|
||||
}
|
||||
else -> {
|
||||
Toast.makeText(this, "未找到对应操作", Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* onActivityResult 回调
|
||||
*/
|
||||
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
|
||||
super.onActivityResult(requestCode, resultCode, data)
|
||||
if (requestCode == Constant.RequestCode.accident_visa_list_query_result && resultCode == RESULT_OK) {
|
||||
resetSearch()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 搜索
|
||||
*/
|
||||
private fun searchFun() {
|
||||
|
||||
loading()
|
||||
viewModel.search(
|
||||
pageSize,
|
||||
currentPage,
|
||||
beginDate.text.toString(),
|
||||
endDate.text.toString(),
|
||||
areaTypeStatus,
|
||||
ieFlagStatus,
|
||||
wbNo.text.toString(),
|
||||
opId.text.toString()
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* 重置数据,搜索
|
||||
*/
|
||||
private fun resetSearch() {
|
||||
//recyclerView 清除所有数据数据
|
||||
refreshLayout.setNoMoreData(false)
|
||||
adapter.notifyItemRangeRemoved(0, collectList.size)
|
||||
collectList.clear()
|
||||
currentPage = 1
|
||||
searchFun()
|
||||
}
|
||||
|
||||
/**
|
||||
* 重置筛选条件
|
||||
*/
|
||||
private fun resetFun() {
|
||||
currentPage = 1
|
||||
|
||||
wbNo.setText("")
|
||||
|
||||
beginDate.text = ""
|
||||
endDate.text = ""
|
||||
areaType.text = ""
|
||||
areaTypeStatus = ""
|
||||
ieFlag.text = ""
|
||||
ieFlagStatus = ""
|
||||
|
||||
wbNo.setText("")
|
||||
opId.setText("")
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,802 @@
|
||||
package com.lukouguoji.mit.activity
|
||||
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
import android.widget.TextView
|
||||
import android.widget.Toast
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.lifecycle.ViewModelProvider
|
||||
import androidx.lifecycle.viewModelScope
|
||||
import androidx.recyclerview.widget.GridLayoutManager
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import androidx.recyclerview.widget.SimpleItemAnimator
|
||||
import com.alibaba.android.arouter.facade.annotation.Autowired
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.alibaba.fastjson.JSONObject
|
||||
import com.luck.picture.lib.basic.IBridgeViewLifecycle
|
||||
import com.luck.picture.lib.basic.PictureSelector
|
||||
//import com.luck.picture.lib.config.PictureSelectionConfig.selectorStyle
|
||||
import com.luck.picture.lib.config.SelectMimeType.ofImage
|
||||
import com.luck.picture.lib.decoration.GridSpacingItemDecoration
|
||||
import com.luck.picture.lib.entity.LocalMedia
|
||||
import com.luck.picture.lib.interfaces.OnResultCallbackListener
|
||||
import com.luck.picture.lib.style.PictureSelectorStyle
|
||||
import com.luck.picture.lib.utils.DensityUtil
|
||||
import com.lukouguoji.gnj.common.MitCommon
|
||||
import com.lukouguoji.mit.R
|
||||
import com.lukouguoji.mit.adapt.AccidentVisaInfoAdapter
|
||||
import com.lukouguoji.mit.adapt.PictureAdapter
|
||||
import com.lukouguoji.mit.model.AccidentVisaInfoItemModel
|
||||
import com.lukouguoji.mit.uitl.FullyGridLayoutManager
|
||||
import com.lukouguoji.mit.uitl.GlideEngine
|
||||
import com.lukouguoji.mit.viewModel.AccidentVisaInfoViewModel
|
||||
import com.lukouguoji.module_base.ActivityCollector
|
||||
import com.lukouguoji.module_base.BaseActivity
|
||||
import com.lukouguoji.module_base.MyApplication
|
||||
import com.lukouguoji.module_base.common.Constant
|
||||
import com.lukouguoji.module_base.common.String.emptyToNull
|
||||
import com.lukouguoji.module_base.ktx.getActivity
|
||||
import com.lukouguoji.module_base.router.ARouterConstants
|
||||
import com.lukouguoji.module_base.util.Common
|
||||
import kotlinx.coroutines.launch
|
||||
import okhttp3.MediaType
|
||||
import okhttp3.MediaType.Companion.toMediaTypeOrNull
|
||||
import okhttp3.MultipartBody
|
||||
import okhttp3.RequestBody
|
||||
import java.io.File
|
||||
|
||||
|
||||
@Route(path = ARouterConstants.ACTIVITY_URL_MONITOR_ACCIDENT_VISA_INFO)
|
||||
class AccidentVisaInfoActivity : BaseActivity(), View.OnClickListener {
|
||||
private lateinit var viewModel: AccidentVisaInfoViewModel
|
||||
private lateinit var adapter: AccidentVisaInfoAdapter
|
||||
|
||||
private val collectList = ArrayList<AccidentVisaInfoItemModel>()
|
||||
|
||||
private lateinit var pictureAdapter: PictureAdapter
|
||||
private lateinit var mRecyclerView: RecyclerView
|
||||
private val mData = ArrayList<LocalMedia>()
|
||||
|
||||
// private lateinit var uploadImg: ImageView
|
||||
private lateinit var cancel: TextView
|
||||
private lateinit var submit: TextView
|
||||
|
||||
|
||||
@JvmField
|
||||
@Autowired
|
||||
var id: Int = -9999
|
||||
|
||||
private fun initView() {
|
||||
viewModel = ViewModelProvider(this).get(AccidentVisaInfoViewModel::class.java)
|
||||
|
||||
val layoutManager = GridLayoutManager(this, 2)
|
||||
adapter = AccidentVisaInfoAdapter(this, viewModel, collectList)
|
||||
var recyclerView: RecyclerView = findViewById(R.id.collectList)
|
||||
recyclerView.layoutManager = layoutManager
|
||||
recyclerView.adapter = adapter
|
||||
|
||||
//初始化 加载的资源
|
||||
/*val list = ArrayList<LocalMedia>()
|
||||
list.add(LocalMedia.generateHttpAsLocalMedia("https://fdfs.test-kepu.weiyilewen.com/group1/M00/00/01/wKhkY2Iv936EMKWzAAAAAHuLNY8762.mp4"));
|
||||
list.add(LocalMedia.generateHttpAsLocalMedia("https://wx1.sinaimg.cn/mw2000/0073ozWdly1h0afogn4vij30u05keb29.jpg"));
|
||||
list.add(LocalMedia.generateHttpAsLocalMedia("https://wx3.sinaimg.cn/mw2000/0073ozWdly1h0afohdkygj30u05791kx.jpg"));
|
||||
list.add(LocalMedia.generateHttpAsLocalMedia("https://wx2.sinaimg.cn/mw2000/0073ozWdly1h0afoi70m2j30u05fq1kx.jpg"));
|
||||
list.add(LocalMedia.generateHttpAsLocalMedia("https://wx2.sinaimg.cn/mw2000/0073ozWdly1h0afoipj8xj30kw3kmwru.jpg"));
|
||||
list.add(LocalMedia.generateHttpAsLocalMedia("https://wx4.sinaimg.cn/mw2000/0073ozWdly1h0afoj5q8ij30u04gqkb1.jpg"));
|
||||
list.add(LocalMedia.generateHttpAsLocalMedia("https://ww1.sinaimg.cn/bmiddle/bcd10523ly1g96mg4sfhag20c806wu0x.gif"));
|
||||
mData.addAll(list);*/
|
||||
mRecyclerView = findViewById(R.id.recycler)
|
||||
val manager = FullyGridLayoutManager(
|
||||
this,
|
||||
6, GridLayoutManager.VERTICAL, false
|
||||
)
|
||||
mRecyclerView.layoutManager = manager
|
||||
val itemAnimator: RecyclerView.ItemAnimator? = mRecyclerView.itemAnimator
|
||||
if (itemAnimator != null) {
|
||||
(itemAnimator as SimpleItemAnimator).supportsChangeAnimations = false
|
||||
}
|
||||
mRecyclerView.addItemDecoration(
|
||||
GridSpacingItemDecoration(
|
||||
6,
|
||||
DensityUtil.dip2px(this, 4f), false
|
||||
)
|
||||
)
|
||||
pictureAdapter = PictureAdapter(this, viewModel, mData)
|
||||
pictureAdapter.setSelectMax(9)
|
||||
mRecyclerView.adapter = pictureAdapter
|
||||
|
||||
|
||||
// uploadImg = findViewById(R.id.uploadImg)
|
||||
cancel = findViewById(R.id.cancel)
|
||||
submit = findViewById(R.id.submit)
|
||||
|
||||
// uploadImg.setOnClickListener(this)
|
||||
cancel.setOnClickListener(this)
|
||||
submit.setOnClickListener(this)
|
||||
|
||||
}
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
setContentView(R.layout.activity_accident_visa_info)
|
||||
initView()
|
||||
|
||||
/**
|
||||
* 上传图片返回结果
|
||||
*/
|
||||
/*viewModel.uploadImgObserver.observe(this) {
|
||||
loadingCancel()
|
||||
val status = it.getString("status")
|
||||
val msg = it.getString("msg")
|
||||
if (Constant.Result.succ == status) {
|
||||
val data = it.getJSONObject("data")
|
||||
var oldName = data.getString("oldName")
|
||||
var newName = data.getString("newName")
|
||||
|
||||
viewModel.imageKeyValue[oldName] = newName
|
||||
|
||||
} else {
|
||||
Common.showToast(this, "上传失败!")
|
||||
}
|
||||
}*/
|
||||
|
||||
viewModel.viewModelScope.launch {
|
||||
viewModel.uploadImgObserver.collect {
|
||||
loadingCancel()
|
||||
val status = it.getString("status")
|
||||
val msg = it.getString("msg")
|
||||
if (Constant.Result.succ == status) {
|
||||
val data = it.getJSONObject("data")
|
||||
var oldName = data.getString("oldName")
|
||||
var newName = data.getString("newName")
|
||||
|
||||
viewModel.imageKeyValue[oldName] = newName
|
||||
|
||||
} else {
|
||||
Common.showToast(MyApplication.context, "上传失败!")
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//航班返回结果
|
||||
viewModel.queryFlightObserver.observe(this) {
|
||||
loadingCancel()
|
||||
val status = it.getString("status")
|
||||
if (Constant.Result.succ == status) {
|
||||
var jsonObject = it.getJSONObject("data")
|
||||
val countryName = jsonObject.getString("countryName")
|
||||
val countryType = jsonObject.getString("countryType")
|
||||
val dep = jsonObject.getString("fdep")
|
||||
val dest = jsonObject.getString("fdest")
|
||||
|
||||
viewModel.waybillFormNetWork["countryName"] = countryName
|
||||
viewModel.waybillFormNetWork["areaFlag"] = countryName
|
||||
viewModel.waybillFormNetWork["countryType"] = countryType
|
||||
viewModel.waybillFormNetWork["dep"] = dep
|
||||
viewModel.waybillFormNetWork["dest"] = dest
|
||||
|
||||
//运单号
|
||||
collectList.forEach { c ->
|
||||
when (c.titleCode) {
|
||||
"areaFlag" -> {
|
||||
c.inputContent = countryName
|
||||
}
|
||||
"dep" -> {
|
||||
c.inputContent = dep
|
||||
}
|
||||
"dest" -> {
|
||||
c.inputContent = dest
|
||||
}
|
||||
}
|
||||
}
|
||||
adapter.notifyDataSetChanged()
|
||||
|
||||
} else {
|
||||
val countryName = ""
|
||||
val countryType = ""
|
||||
val dep = ""
|
||||
val dest = ""
|
||||
|
||||
viewModel.waybillFormNetWork["areaFlag"] = countryName
|
||||
viewModel.waybillFormNetWork["countryName"] = countryName
|
||||
viewModel.waybillFormNetWork["countryType"] = countryType
|
||||
viewModel.waybillFormNetWork["dep"] = dep
|
||||
viewModel.waybillFormNetWork["dest"] = dest
|
||||
|
||||
//运单号
|
||||
collectList.forEach { c ->
|
||||
when (c.titleCode) {
|
||||
"areaFlag" -> {
|
||||
c.inputContent = countryName
|
||||
}
|
||||
"dep" -> {
|
||||
c.inputContent = dep
|
||||
}
|
||||
"dest" -> {
|
||||
c.inputContent = dest
|
||||
}
|
||||
}
|
||||
}
|
||||
adapter.notifyDataSetChanged()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 删除图片返回结果
|
||||
*/
|
||||
viewModel.deleteImgObserver.observe(this) {
|
||||
loadingCancel()
|
||||
val status = it.getString("status")
|
||||
val msg = it.getString("msg")
|
||||
}
|
||||
//监听照片事件
|
||||
pictureAdapter.setOnItemClickListener(object : PictureAdapter.OnItemClickListener {
|
||||
override fun onItemClick(v: View?, position: Int) {
|
||||
// 预览图片、视频、音频
|
||||
PictureSelector.create(ActivityCollector.getLastActivity())
|
||||
.openPreview()
|
||||
.setImageEngine(GlideEngine.createGlideEngine())
|
||||
.setAttachViewLifecycle(object : IBridgeViewLifecycle {
|
||||
override fun onViewCreated(fragment: Fragment, view: View, savedInstanceState: Bundle?) {
|
||||
|
||||
}
|
||||
|
||||
override fun onDestroy(fragment: Fragment) {
|
||||
}
|
||||
})
|
||||
.startActivityPreview(position, false, pictureAdapter.getData())
|
||||
}
|
||||
|
||||
override fun openPicture() {
|
||||
// 进入相册
|
||||
PictureSelector.create(ActivityCollector.getLastActivity())
|
||||
.openGallery(ofImage())
|
||||
.setImageEngine(GlideEngine.createGlideEngine())
|
||||
.isPageSyncAlbumCount(true)
|
||||
.forResult(object : OnResultCallbackListener<LocalMedia?> {
|
||||
override fun onCancel() {
|
||||
// 取消
|
||||
}
|
||||
|
||||
override fun onResult(result: java.util.ArrayList<LocalMedia?>?) {
|
||||
if (result != null) {
|
||||
val resultList = arrayListOf<LocalMedia>()
|
||||
result.forEach {
|
||||
//上传图片至服务器
|
||||
val filePath = File(it!!.realPath)
|
||||
var fileName = it.fileName
|
||||
val imgBody = RequestBody.create("multipart/form-data".toMediaTypeOrNull(), filePath)
|
||||
val filePart = MultipartBody.Part.createFormData("file", filePath.name, imgBody)
|
||||
viewModel.imageKeyValue[fileName] = ""
|
||||
loading()
|
||||
viewModel.uploadImg(filePart)
|
||||
|
||||
resultList.add(it)
|
||||
}
|
||||
mData.addAll(resultList)
|
||||
pictureAdapter.notifyDataSetChanged()
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
//1.新增
|
||||
if (id == -9999) {
|
||||
// if (true) {
|
||||
setBackArrow("新增事故签证")
|
||||
|
||||
selObserve()
|
||||
initData(MitCommon.AccidentVisa.Info.add)
|
||||
|
||||
viewModel.saveFestGnjCangDanObserver.observe(this) {
|
||||
loadingCancel()
|
||||
val status = it.getString("status")
|
||||
val msg = it.getString("msg")
|
||||
if (Constant.Result.succ == status) {
|
||||
val dataStatus = it.getString("data")
|
||||
if (Constant.Result.succ == dataStatus) {
|
||||
Common.showToast(this, "新增成功!")
|
||||
reset()
|
||||
} else if (Constant.Result.code2 == dataStatus) {
|
||||
Common.showToast(this, "没有选择航班,请选择航班!")
|
||||
} else {
|
||||
Common.showToast(this, "新增失败!")
|
||||
}
|
||||
} else {
|
||||
Common.showToast(this, "新增失败!")
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
//2.编辑
|
||||
if (id != -9999) {
|
||||
setBackArrow("事故签证详情")
|
||||
|
||||
initNetWork(id, null, MitCommon.AccidentVisa.Info.update)
|
||||
|
||||
viewModel.updateFestGnjCangDanObserver.observe(this) {
|
||||
loadingCancel()
|
||||
val status = it.getString("status")
|
||||
val msg = it.getString("msg")
|
||||
if (Constant.Result.succ == status) {
|
||||
var dataStatus = it.getString("data")
|
||||
if (Constant.Result.succ == dataStatus) {
|
||||
Common.showToast(this, "修改成功!")
|
||||
} else if (Constant.Result.code2 == dataStatus) {
|
||||
Common.showToast(this, "没有选择航班,请选择航班!")
|
||||
} else {
|
||||
Common.showToast(this, "修改失败!")
|
||||
}
|
||||
} else {
|
||||
Common.showToast(this, "修改失败!")
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
override fun onClick(v: View?) {
|
||||
v?.let {
|
||||
when (it.id) {
|
||||
/*R.id.uploadImg -> {
|
||||
|
||||
PictureSelector.create(this)
|
||||
.openGallery(ofImage())
|
||||
.setImageEngine(GlideEngine.createGlideEngine()) // 请参考Demo GlideEngine.java
|
||||
.forResult(object : OnResultCallbackListener<LocalMedia?> {
|
||||
override fun onCancel() {
|
||||
// 取消
|
||||
}
|
||||
|
||||
override fun onResult(result: java.util.ArrayList<LocalMedia?>?) {
|
||||
if(result != null){
|
||||
val files = arrayListOf<MultipartBody.Part>()
|
||||
result.forEach {
|
||||
var file = File(it?.realPath)
|
||||
var imgBody = RequestBody.create(MediaType.parse("multipart/form-data"), file)
|
||||
var filePart = MultipartBody.Part.createFormData("file", file.name, imgBody)
|
||||
|
||||
// viewModel.uploadImg(filePart)
|
||||
|
||||
files.add(filePart)
|
||||
|
||||
}
|
||||
|
||||
// viewModel.uploadImgList(files)
|
||||
}
|
||||
|
||||
}
|
||||
})
|
||||
}*/
|
||||
R.id.cancel -> {
|
||||
finish()
|
||||
}
|
||||
R.id.submit -> {
|
||||
submit()
|
||||
}
|
||||
else -> {
|
||||
Toast.makeText(this, "未找到对应操作", Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 扫码返回的结果
|
||||
*/
|
||||
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
|
||||
super.onActivityResult(requestCode, resultCode, data)
|
||||
// 扫描二维码/条码回传
|
||||
if (resultCode == RESULT_OK && data != null) {
|
||||
val content = data.getStringExtra(com.yzq.zxinglibrary.common.Constant.CODED_CONTENT)
|
||||
if (content == null) {
|
||||
Common.showToast(this, "条码错误!")
|
||||
return
|
||||
}
|
||||
when (requestCode) {
|
||||
Constant.RequestCode.accident_visa_info_wbno_scan -> {
|
||||
//运单号
|
||||
viewModel.waybillFormNetWork["wbNo"] = content
|
||||
collectList.forEach { c ->
|
||||
if (c.titleCode == "wbNo") {
|
||||
c.inputContent = content
|
||||
}
|
||||
}
|
||||
adapter.notifyDataSetChanged()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 监听运单详情返回数据
|
||||
*
|
||||
* write = false 只读 true 可写
|
||||
*/
|
||||
private fun waybillObserve(status: String) {
|
||||
viewModel.waybillLiveData.observe(this) {
|
||||
val resStatus = it.getString("status")
|
||||
if (Constant.Result.succ == resStatus) {
|
||||
viewModel.waybillFormNetWork = it.getJSONObject("data")
|
||||
|
||||
initData(status)
|
||||
|
||||
} else {
|
||||
//无数据
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 下拉框赋值
|
||||
*/
|
||||
private fun selObserve() {
|
||||
/////////////// 下拉框 start
|
||||
viewModel.outerPackageType(System.currentTimeMillis().toString())
|
||||
viewModel.outerPackageTypeObserver.observe(this) { vd ->
|
||||
val noneObj = JSONObject()
|
||||
noneObj["name"] = "请选择外包装"
|
||||
noneObj["code"] = ""
|
||||
viewModel.outerPackageTypeList.add(noneObj)
|
||||
viewModel.outerPackageTypeList.addAll(vd.getJSONArray("data"))
|
||||
|
||||
totalRequestNotifyAdapter()
|
||||
}
|
||||
|
||||
viewModel.damageType(Constant.businessType.CO)
|
||||
viewModel.damageTypeObserver.observe(this) { vd ->
|
||||
val noneObj = JSONObject()
|
||||
noneObj["name"] = "请选择包装破损情况"
|
||||
noneObj["code"] = ""
|
||||
viewModel.damageTypeList.add(noneObj)
|
||||
viewModel.damageTypeList.addAll(vd.getJSONArray("data"))
|
||||
|
||||
totalRequestNotifyAdapter()
|
||||
}
|
||||
|
||||
viewModel.contentType(System.currentTimeMillis().toString())
|
||||
viewModel.contentTypeObserver.observe(this) { vd ->
|
||||
val noneObj = JSONObject()
|
||||
noneObj["name"] = "请选择内容物情况"
|
||||
noneObj["code"] = ""
|
||||
viewModel.contentTypeList.add(noneObj)
|
||||
viewModel.contentTypeList.addAll(vd.getJSONArray("data"))
|
||||
|
||||
totalRequestNotifyAdapter()
|
||||
}
|
||||
|
||||
viewModel.unusualType(System.currentTimeMillis().toString())
|
||||
viewModel.unusualTypeObserver.observe(this) { vd ->
|
||||
val noneObj = JSONObject()
|
||||
noneObj["name"] = "请选择不正常类型"
|
||||
noneObj["code"] = ""
|
||||
viewModel.unusualTypeList.add(noneObj)
|
||||
viewModel.unusualTypeList.addAll(vd.getJSONArray("data"))
|
||||
|
||||
totalRequestNotifyAdapter()
|
||||
}
|
||||
|
||||
viewModel.searchDateType(System.currentTimeMillis().toString())
|
||||
viewModel.searchDateTypeObserver.observe(this) { vd ->
|
||||
val noneObj = JSONObject()
|
||||
noneObj["name"] = "请选择发现时间类型"
|
||||
noneObj["code"] = ""
|
||||
viewModel.searchDateTypeList.add(noneObj)
|
||||
viewModel.searchDateTypeList.addAll(vd.getJSONArray("data"))
|
||||
|
||||
totalRequestNotifyAdapter()
|
||||
}
|
||||
|
||||
/////////////// 下拉框 end
|
||||
}
|
||||
|
||||
/**
|
||||
* 所有请求结束,更细adpter 只适用于刚开始加载
|
||||
*/
|
||||
private fun totalRequestNotifyAdapter() {
|
||||
adapter.notifyDataSetChanged()
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化网络请求
|
||||
*/
|
||||
private fun initNetWork(id: Int, wbNo: String?, status: String) {
|
||||
selObserve()
|
||||
viewModel.queryWaybillById(id, wbNo)
|
||||
waybillObserve(status)
|
||||
}
|
||||
|
||||
/**
|
||||
* 提交
|
||||
*/
|
||||
private fun submit() {
|
||||
for ((index, c) in collectList.withIndex()) {
|
||||
val titleName = c.titleName//标题
|
||||
val inputContent = c.inputContent//输入内容
|
||||
val selContentCode = c.selContentCode//选择内容
|
||||
val must = c.isMust//是否必填
|
||||
val sel = c.isSel//是否下拉框
|
||||
val titleCodePre = c.titleCodePre//前缀
|
||||
val inputContentPre = c.inputContentPre//前缀
|
||||
//下拉框
|
||||
if (sel) {
|
||||
if (must && selContentCode == "") {
|
||||
Common.showToast(this, "请选择$titleName")
|
||||
return
|
||||
}
|
||||
viewModel.waybillFormNetWork[c.titleCode] = selContentCode.emptyToNull()
|
||||
}
|
||||
//输入框
|
||||
else {
|
||||
if (must && inputContent == "") {
|
||||
Common.showToast(this, "请输入$titleName")
|
||||
return
|
||||
}
|
||||
viewModel.waybillFormNetWork[c.titleCode] = inputContent.emptyToNull()
|
||||
//前缀不为空时,赋值
|
||||
if (titleCodePre != null && titleCodePre != "" && inputContentPre != null && inputContentPre != "") {
|
||||
viewModel.waybillFormNetWork[titleCodePre] = inputContentPre.emptyToNull()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//图片循环获取名称。映射表里存在,说明是新上传的,取映射的字段。否则直接去名字
|
||||
val imageUrls = mData.map { m ->
|
||||
val fileName = viewModel.imageKeyValue[m.fileName]
|
||||
if (fileName != null && fileName != "") {
|
||||
fileName
|
||||
} else {
|
||||
m.fileName
|
||||
}
|
||||
}.joinToString { i -> i }
|
||||
|
||||
viewModel.waybillFormNetWork["imageUrl"] = imageUrls.emptyToNull()
|
||||
|
||||
//1.新增
|
||||
if (id == -9999) {
|
||||
//输入运单号,需要校验规则,判断前7位除以7得到的余数是否等于第8位,是即符合规则,否则提示
|
||||
/*val prefixStr = viewModel.waybillFormNetWork.getString("prefix")
|
||||
if (prefixStr.length != 3 || !prefixStr.isValidInt()) {
|
||||
Common.showToast(this, "请输入正确的运单号前缀格式!")
|
||||
return
|
||||
}
|
||||
val checkWaybill = viewModel.waybillFormNetWork.getString("no")
|
||||
if (checkWaybill.length != 8 || !checkWaybill.isValidInt()) {
|
||||
Common.showToast(this, "请输入正确的运单号格式!")
|
||||
return
|
||||
}
|
||||
var subSequence = checkWaybill.subSequence(0, 7).toString().toInt()
|
||||
var subSequence2 = checkWaybill[7].toString().toInt()
|
||||
if (subSequence % 7 != subSequence2) {
|
||||
Common.showToast(this, "请输入正确的运单号格式!")
|
||||
return
|
||||
}*/
|
||||
|
||||
loading()
|
||||
viewModel.saveFestGnjCangDan(viewModel.waybillFormNetWork)
|
||||
return
|
||||
}
|
||||
//2.编辑
|
||||
if (id != -9999) {
|
||||
loading()
|
||||
viewModel.updateFestGnjCangDan(viewModel.waybillFormNetWork)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化列表数据
|
||||
*/
|
||||
private fun initData(status: String) {
|
||||
var write = false
|
||||
var waybillOperator = false
|
||||
when (status) {
|
||||
MitCommon.AccidentVisa.Info.read -> {
|
||||
write = false
|
||||
waybillOperator = false
|
||||
}
|
||||
MitCommon.AccidentVisa.Info.add -> {
|
||||
write = true
|
||||
waybillOperator = true
|
||||
}
|
||||
MitCommon.AccidentVisa.Info.update -> {
|
||||
write = true
|
||||
waybillOperator = false
|
||||
}
|
||||
}
|
||||
|
||||
collectList.clear()
|
||||
collectList.add(
|
||||
AccidentVisaInfoItemModel(
|
||||
true,
|
||||
waybillOperator,
|
||||
"运单号",
|
||||
"wbNo",
|
||||
viewModel.waybillFormNetWork.getString("wbNo") ?: "", id == -9999, Constant.RequestCode.accident_visa_info_wbno_scan
|
||||
)
|
||||
)// id == -9999 是新增,显示扫描
|
||||
collectList.add(
|
||||
AccidentVisaInfoItemModel(
|
||||
true,
|
||||
write,
|
||||
"不正常件数",
|
||||
"dpc",
|
||||
viewModel.waybillFormNetWork.getString("dpc") ?: ""
|
||||
)
|
||||
)
|
||||
collectList.add(
|
||||
AccidentVisaInfoItemModel(
|
||||
true,
|
||||
write,
|
||||
"外包装",
|
||||
"opacking",
|
||||
viewModel.outerPackageTypeList,
|
||||
viewModel.waybillFormNetWork.getString("opacking") ?: ""
|
||||
)
|
||||
)
|
||||
collectList.add(
|
||||
AccidentVisaInfoItemModel(
|
||||
true,
|
||||
write,
|
||||
"包装破损情况",
|
||||
"damage",
|
||||
viewModel.damageTypeList,
|
||||
viewModel.waybillFormNetWork.getString("damage") ?: ""
|
||||
)
|
||||
)
|
||||
collectList.add(
|
||||
AccidentVisaInfoItemModel(
|
||||
true,
|
||||
write,
|
||||
"内容物情况",
|
||||
"condition",
|
||||
viewModel.contentTypeList,
|
||||
viewModel.waybillFormNetWork.getString("condition") ?: ""
|
||||
)
|
||||
)
|
||||
collectList.add(
|
||||
AccidentVisaInfoItemModel(
|
||||
true,
|
||||
write,
|
||||
"发现时间类型",
|
||||
"searchDate",
|
||||
viewModel.searchDateTypeList,
|
||||
viewModel.waybillFormNetWork.getString("searchDate") ?: ""
|
||||
)
|
||||
)
|
||||
collectList.add(
|
||||
AccidentVisaInfoItemModel(
|
||||
true,
|
||||
write,
|
||||
"不正常类型",
|
||||
"kdamage",
|
||||
viewModel.unusualTypeList,
|
||||
viewModel.waybillFormNetWork.getString("kdamage") ?: ""
|
||||
)
|
||||
)
|
||||
collectList.add(
|
||||
AccidentVisaInfoItemModel(
|
||||
true,
|
||||
write,
|
||||
"航班日期",
|
||||
"fdate",
|
||||
false,
|
||||
viewModel.waybillFormNetWork.getString("fdate") ?: ""
|
||||
)
|
||||
)
|
||||
collectList.add(
|
||||
AccidentVisaInfoItemModel(
|
||||
true,
|
||||
write,
|
||||
"航班号",
|
||||
"fno",
|
||||
viewModel.waybillFormNetWork.getString("fno") ?: ""
|
||||
)
|
||||
)
|
||||
collectList.add(
|
||||
AccidentVisaInfoItemModel(
|
||||
false,
|
||||
false,
|
||||
"地区类型",
|
||||
"areaFlag",
|
||||
viewModel.waybillFormNetWork.getString("areaFlag") ?: ""
|
||||
)
|
||||
)
|
||||
collectList.add(
|
||||
AccidentVisaInfoItemModel(
|
||||
false,
|
||||
false,
|
||||
"始发港",
|
||||
"dep",
|
||||
viewModel.waybillFormNetWork.getString("dep") ?: ""
|
||||
)
|
||||
)
|
||||
collectList.add(
|
||||
AccidentVisaInfoItemModel(
|
||||
false,
|
||||
false,
|
||||
"目的港",
|
||||
"dest",
|
||||
viewModel.waybillFormNetWork.getString("dest") ?: ""
|
||||
)
|
||||
)
|
||||
collectList.add(
|
||||
AccidentVisaInfoItemModel(
|
||||
false,
|
||||
write,
|
||||
"运单总件数",
|
||||
"pc",
|
||||
viewModel.waybillFormNetWork.getString("pc") ?: ""
|
||||
)
|
||||
)
|
||||
collectList.add(
|
||||
AccidentVisaInfoItemModel(
|
||||
false,
|
||||
write,
|
||||
"运单总重量",
|
||||
"weight",
|
||||
viewModel.waybillFormNetWork.getString("weight") ?: ""
|
||||
)
|
||||
)
|
||||
collectList.add(
|
||||
AccidentVisaInfoItemModel(
|
||||
false,
|
||||
write,
|
||||
"复称重量",
|
||||
"checkWeight",
|
||||
viewModel.waybillFormNetWork.getString("checkWeight") ?: ""
|
||||
)
|
||||
)
|
||||
collectList.add(
|
||||
AccidentVisaInfoItemModel(
|
||||
false,
|
||||
write,
|
||||
"品名",
|
||||
"goods",
|
||||
viewModel.waybillFormNetWork.getString("goods") ?: ""
|
||||
)
|
||||
)
|
||||
|
||||
collectList.add(AccidentVisaInfoItemModel(false, write, "备注", "remarks", viewModel.waybillFormNetWork.getString("remarks") ?: ""))
|
||||
|
||||
//加载图片
|
||||
var imageUrl = viewModel.waybillFormNetWork.getString("imageUrl") ?: ""
|
||||
if (imageUrl != "") {
|
||||
val list = ArrayList<LocalMedia>()
|
||||
imageUrl.split(",").forEach { i ->
|
||||
val tempUrl = i.trim()
|
||||
var generateHttpAsLocalMedia = LocalMedia.generateHttpAsLocalMedia(loadImgUrl(tempUrl))
|
||||
generateHttpAsLocalMedia.fileName = tempUrl
|
||||
list.add(generateHttpAsLocalMedia)
|
||||
}
|
||||
mData.addAll(list)
|
||||
}
|
||||
|
||||
totalRequestNotifyAdapter()
|
||||
}
|
||||
|
||||
/**
|
||||
* 封装图片路径
|
||||
*/
|
||||
private fun loadImgUrl(suffixUrl: String) =
|
||||
"${MyApplication.context.getString(com.lukouguoji.module_base.R.string.system_url)}/file/getImg/${suffixUrl.trim()}"
|
||||
|
||||
/**
|
||||
* 清空数据
|
||||
*/
|
||||
private fun reset() {
|
||||
//1.清空数据
|
||||
viewModel.waybillFormNetWork.clear()
|
||||
mData.clear()
|
||||
pictureAdapter.notifyDataSetChanged()
|
||||
initData(MitCommon.AccidentVisa.Info.add)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,370 @@
|
||||
package com.lukouguoji.mit.activity
|
||||
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import android.text.Editable
|
||||
import android.text.TextWatcher
|
||||
import android.view.View
|
||||
import android.widget.*
|
||||
import androidx.lifecycle.ViewModelProvider
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.alibaba.android.arouter.launcher.ARouter
|
||||
import com.alibaba.fastjson.JSONArray
|
||||
import com.alibaba.fastjson.JSONObject
|
||||
import com.lukouguoji.mit.R
|
||||
import com.lukouguoji.mit.adapt.MitInPackListAdapter
|
||||
import com.lukouguoji.mit.model.MitInPackListModel
|
||||
import com.lukouguoji.mit.viewModel.MitInPackListViewModel
|
||||
import com.lukouguoji.module_base.ActivityCollector
|
||||
import com.lukouguoji.module_base.BaseActivity
|
||||
import com.lukouguoji.module_base.common.Constant
|
||||
import com.lukouguoji.module_base.router.ARouterConstants
|
||||
import com.lukouguoji.module_base.util.Common
|
||||
import com.lukouguoji.module_base.util.SwipeDeleteRecyclerView
|
||||
import com.scwang.smart.refresh.footer.ClassicsFooter
|
||||
import com.scwang.smart.refresh.header.ClassicsHeader
|
||||
import com.scwang.smart.refresh.layout.api.RefreshLayout
|
||||
import java.text.SimpleDateFormat
|
||||
import java.util.*
|
||||
|
||||
@Route(path = ARouterConstants.ACTIVITY_URL_MONITOR_IN_PACK)
|
||||
class MitInPackActivity : BaseActivity(), View.OnClickListener {
|
||||
private lateinit var viewModel: MitInPackListViewModel
|
||||
private lateinit var adapter: MitInPackListAdapter
|
||||
private val collectList = ArrayList<MitInPackListModel>()
|
||||
private lateinit var refreshLayout: RefreshLayout
|
||||
private var currentPage = 1
|
||||
private var pageSize = 10
|
||||
private var totalPage = 0
|
||||
private var totalCount = 0 //总条数
|
||||
private val calendar = Calendar.getInstance()
|
||||
private val ymdSdf = SimpleDateFormat("yyyy-MM-dd")//年月日
|
||||
private val ymdHmsSdf = SimpleDateFormat("yyyy-MM-dd HH:mm:ss")//年月日 时分秒
|
||||
|
||||
|
||||
//搜索
|
||||
private lateinit var fdate: TextView
|
||||
private lateinit var startDateIcon: ImageView
|
||||
private lateinit var fno: EditText
|
||||
private lateinit var origin: EditText
|
||||
private lateinit var dest: EditText
|
||||
private lateinit var searchLayout: LinearLayout
|
||||
private lateinit var addIcon: ImageView
|
||||
private lateinit var quickSearch: EditText
|
||||
|
||||
//列表
|
||||
private lateinit var listLayout: LinearLayout
|
||||
|
||||
|
||||
private fun initView() {
|
||||
viewModel = ViewModelProvider(this).get(MitInPackListViewModel::class.java)
|
||||
|
||||
val layoutManager = LinearLayoutManager(this)
|
||||
adapter = MitInPackListAdapter(this, viewModel, collectList)
|
||||
var recyclerView: SwipeDeleteRecyclerView = findViewById(R.id.collectList)
|
||||
recyclerView.layoutManager = layoutManager
|
||||
recyclerView.adapter = adapter
|
||||
|
||||
refreshLayout = findViewById(R.id.refreshLayout)
|
||||
|
||||
fdate = findViewById(R.id.fdate)
|
||||
startDateIcon = findViewById(R.id.startDateIcon)
|
||||
fno = findViewById(R.id.fno)
|
||||
origin = findViewById(R.id.origin)
|
||||
dest = findViewById(R.id.dest)
|
||||
searchLayout = findViewById(R.id.searchLayout)
|
||||
addIcon = findViewById(R.id.addIcon)
|
||||
quickSearch = findViewById(R.id.quickSearch)
|
||||
//列表
|
||||
listLayout = findViewById(R.id.listLayout)
|
||||
|
||||
|
||||
fdate.setOnClickListener(this)
|
||||
startDateIcon.setOnClickListener(this)
|
||||
searchLayout.setOnClickListener(this)
|
||||
addIcon.setOnClickListener(this)
|
||||
|
||||
quickSearch.addTextChangedListener(object : TextWatcher {
|
||||
override fun beforeTextChanged(s: CharSequence?, start: Int, count: Int, after: Int) {
|
||||
|
||||
}
|
||||
|
||||
override fun onTextChanged(s: CharSequence?, start: Int, before: Int, count: Int) {
|
||||
if (s != null && s.toString() != "") {
|
||||
val filterCollectionList = collectList.filter { c -> c.carId.contains(s.toString()) }
|
||||
recyclerView.adapter = MitInPackListAdapter(
|
||||
ActivityCollector.getLastActivity()!!,
|
||||
viewModel,
|
||||
filterCollectionList as MutableList<MitInPackListModel>
|
||||
)
|
||||
} else {
|
||||
recyclerView.adapter = MitInPackListAdapter(
|
||||
ActivityCollector.getLastActivity()!!,
|
||||
viewModel,
|
||||
collectList
|
||||
)
|
||||
}
|
||||
adapter.notifyDataSetChanged()
|
||||
}
|
||||
|
||||
override fun afterTextChanged(s: Editable?) {
|
||||
|
||||
}
|
||||
})
|
||||
|
||||
fno.addTextChangedListener(object : TextWatcher {
|
||||
override fun beforeTextChanged(s: CharSequence?, start: Int, count: Int, after: Int) {
|
||||
|
||||
}
|
||||
|
||||
override fun onTextChanged(s: CharSequence?, start: Int, before: Int, count: Int) {
|
||||
|
||||
}
|
||||
|
||||
override fun afterTextChanged(editable: Editable?) {
|
||||
val originText = editable.toString()
|
||||
if (originText != null && originText != "") {
|
||||
val regularExpression = "(^([A-Z0-9]+)$)"
|
||||
val matches = originText.matches(regularExpression.toRegex())
|
||||
if(!matches){
|
||||
val regularExpression2 = "([^A-Za-z0-9]+)"
|
||||
val replaceStr = originText.replace(regularExpression2.toRegex(),"")
|
||||
val replaceStrToUpper = replaceStr.uppercase(Locale.ROOT)//小写转大写
|
||||
fno.setText(replaceStrToUpper)
|
||||
fno.setSelection(replaceStrToUpper.length)
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
fdate.text = ymdSdf.format(Date())//tw2022年6月13日15:57:10 要求航班日期默认当天
|
||||
}
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
setContentView(R.layout.activity_mit_in_pack)
|
||||
setBackArrow("进港卸机")
|
||||
initView()
|
||||
|
||||
//查询返回结果
|
||||
viewModel.searchParamLive.observe(this) {
|
||||
loadingCancel()
|
||||
//1.获取数据
|
||||
var listArr: JSONArray = it["list"] as JSONArray
|
||||
totalCount = it.getIntValue("total")
|
||||
totalPage = it["pages"] as Int
|
||||
// var listArr :JSONArray =it["list"] as JSONArray
|
||||
if (listArr.size > 0) {
|
||||
listLayout.visibility = View.VISIBLE
|
||||
|
||||
//2.循环遍历塞入collectList
|
||||
listArr.forEach {
|
||||
val itemObj = it as JSONObject
|
||||
|
||||
val fId = itemObj.getIntValue("fid")
|
||||
val carId = itemObj.getString("carId") ?: ""//板车号
|
||||
val flight = itemObj.getString("flight") ?: ""//航班
|
||||
val countryType = itemObj.getString("countryType") ?: ""//地区类型
|
||||
val opDate = itemObj.getString("opDate") ?: ""//装板时间
|
||||
val opId = itemObj.getString("opId") ?: ""//确认人
|
||||
|
||||
//列表赋值
|
||||
collectList.add(
|
||||
MitInPackListModel(
|
||||
fId,
|
||||
carId,
|
||||
flight,
|
||||
countryType,
|
||||
opDate,
|
||||
opId
|
||||
)
|
||||
)
|
||||
}
|
||||
//3.调adpter展示
|
||||
if (currentPage == 1) {
|
||||
val layoutManager = LinearLayoutManager(this)
|
||||
adapter = MitInPackListAdapter(this, viewModel, collectList)
|
||||
var recyclerView: SwipeDeleteRecyclerView = findViewById(R.id.collectList)
|
||||
recyclerView.layoutManager = layoutManager
|
||||
recyclerView.adapter = adapter
|
||||
} else {
|
||||
adapter.notifyItemRangeInserted((currentPage - 1) * 10, collectList.size)
|
||||
}
|
||||
refreshLayout.finishRefresh()
|
||||
refreshLayout.finishLoadMore()
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//航班返回结果
|
||||
viewModel.queryFlightObserver.observe(this) {
|
||||
loadingCancel()
|
||||
val status = it.getString("status")
|
||||
if (Constant.Result.succ == status) {
|
||||
var jsonObject = it.getJSONObject("data")
|
||||
viewModel.fid = jsonObject.getInteger("fid")
|
||||
viewModel.fdate = jsonObject.getString("fdate")
|
||||
viewModel.fno = jsonObject.getString("fno")
|
||||
viewModel.countryName = jsonObject.getString("countryName")
|
||||
viewModel.fdep = jsonObject.getString("fdep")
|
||||
viewModel.fdest = jsonObject.getString("fdest")
|
||||
|
||||
origin.setText(viewModel.fdep)
|
||||
dest.setText(viewModel.fdest)
|
||||
|
||||
if (viewModel.fid != null) {
|
||||
listLayout.visibility = View.VISIBLE
|
||||
loading()
|
||||
resetSearch()
|
||||
}
|
||||
|
||||
} else {
|
||||
//无数据
|
||||
}
|
||||
}
|
||||
|
||||
//删除行 返回结果
|
||||
viewModel.deleteObserver.observe(this) {
|
||||
loadingCancel()
|
||||
val status = it.getString("status")
|
||||
val msg = it.getString("msg")
|
||||
if (Constant.Result.succ == status) {
|
||||
val dataStatus = it.getString("data")
|
||||
if (Constant.Result.succ == dataStatus) {
|
||||
Common.showToast(this, "删除成功!")
|
||||
resetSearch()
|
||||
} else {
|
||||
Common.showToast(this, "删除失败!")
|
||||
}
|
||||
} else {
|
||||
Common.showToast(this, "删除失败!")
|
||||
}
|
||||
}
|
||||
|
||||
/////////////////////////////// 加载刷新的布局
|
||||
refreshLayout.setRefreshHeader(ClassicsHeader(this))
|
||||
refreshLayout.setRefreshFooter(ClassicsFooter(this))
|
||||
/////////////////////////////// 下拉刷新
|
||||
refreshLayout.setOnRefreshListener {
|
||||
resetSearch()
|
||||
}
|
||||
/////////////////////////////// 上拉加载
|
||||
refreshLayout.setOnLoadMoreListener {
|
||||
if (currentPage < totalPage) {
|
||||
currentPage++
|
||||
//初始化查询
|
||||
searchFun()
|
||||
} else {
|
||||
refreshLayout.finishLoadMoreWithNoMoreData()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onClick(v: View?) {
|
||||
v?.let {
|
||||
when (it.id) {
|
||||
R.id.fdate -> {
|
||||
Common.onYearMonthDay(this, fdate.text.toString()) { year, month, day ->
|
||||
calendar.set(year, month - 1, day)
|
||||
fdate.text = ymdSdf.format(calendar.time)
|
||||
}
|
||||
}
|
||||
R.id.startDateIcon -> {
|
||||
fdate.text = ""
|
||||
}
|
||||
R.id.searchLayout -> {
|
||||
origin.setText("")
|
||||
dest.setText("")
|
||||
|
||||
viewModel.fid = null
|
||||
viewModel.fdate = ""
|
||||
viewModel.fno = ""
|
||||
viewModel.countryName = ""
|
||||
viewModel.fdep = ""
|
||||
viewModel.fdest = ""
|
||||
|
||||
doFlight()
|
||||
}
|
||||
R.id.addIcon -> {
|
||||
ARouter.getInstance().build(ARouterConstants.ACTIVITY_URL_MONITOR_IN_PACK_INFO).withInt("fid", viewModel.fid ?: -9999)
|
||||
.withString("fdate", viewModel.fdate)
|
||||
.withString("fno", viewModel.fno)
|
||||
.withString("countryName", viewModel.countryName)
|
||||
.withString("fdep", viewModel.fdep)
|
||||
.withString("fdest", viewModel.fdest)
|
||||
.navigation(this, Constant.RequestCode.gjj_cang_dan_list)
|
||||
}
|
||||
else -> {
|
||||
Toast.makeText(this, "未找到对应操作", Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* onActivityResult 回调
|
||||
*/
|
||||
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
|
||||
super.onActivityResult(requestCode, resultCode, data)
|
||||
if (requestCode == Constant.RequestCode.gjj_cang_dan_list && resultCode == RESULT_OK) {
|
||||
resetSearch()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 搜索
|
||||
*/
|
||||
private fun searchFun() {
|
||||
|
||||
loading()
|
||||
viewModel.search(
|
||||
pageSize,
|
||||
currentPage,
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
fdate.text.toString(),
|
||||
fno.text.toString(),
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
""
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* 重置数据,搜索
|
||||
*/
|
||||
private fun resetSearch() {
|
||||
//recyclerView 清除所有数据数据
|
||||
refreshLayout.setNoMoreData(false)
|
||||
adapter.notifyItemRangeRemoved(0, collectList.size)
|
||||
collectList.clear()
|
||||
currentPage = 1
|
||||
searchFun()
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询航班是否存在
|
||||
*/
|
||||
private fun doFlight() {
|
||||
if (fdate.text.toString() == "" || fno.text.toString() == "") {
|
||||
Common.showToast(this, "航班日期和航班号不可为空!")
|
||||
return
|
||||
}
|
||||
loading()
|
||||
listLayout.visibility = View.GONE
|
||||
viewModel.queryFlight(fdate.text.toString(), fno.text.toString())
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,189 @@
|
||||
package com.lukouguoji.mit.activity
|
||||
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
import android.widget.EditText
|
||||
import android.widget.ImageView
|
||||
import android.widget.TextView
|
||||
import android.widget.Toast
|
||||
import androidx.lifecycle.ViewModelProvider
|
||||
import com.alibaba.android.arouter.facade.annotation.Autowired
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.lukouguoji.mit.R
|
||||
import com.lukouguoji.mit.viewModel.MitInPackInfoViewModel
|
||||
import com.lukouguoji.module_base.BaseActivity
|
||||
import com.lukouguoji.module_base.common.Constant
|
||||
import com.lukouguoji.module_base.router.ARouterConstants
|
||||
import com.lukouguoji.module_base.util.Common
|
||||
|
||||
|
||||
@Route(path = ARouterConstants.ACTIVITY_URL_MONITOR_IN_PACK_INFO)
|
||||
class MitInPackInfoActivity : BaseActivity(), View.OnClickListener {
|
||||
private lateinit var viewModel: MitInPackInfoViewModel
|
||||
|
||||
private lateinit var carNo: EditText
|
||||
private lateinit var carNoScan: ImageView
|
||||
|
||||
//第一列
|
||||
private lateinit var fdateEdit: EditText
|
||||
private lateinit var fdepEdit: EditText
|
||||
|
||||
|
||||
//第二列
|
||||
private lateinit var fnoEdit: EditText
|
||||
private lateinit var fdestEdit: EditText
|
||||
|
||||
|
||||
//第三列
|
||||
private lateinit var countryTypeEdit: EditText
|
||||
|
||||
private lateinit var submit: TextView
|
||||
|
||||
@JvmField
|
||||
@Autowired
|
||||
var fid: Int = -9999
|
||||
|
||||
@JvmField
|
||||
@Autowired
|
||||
var fdate: String? = null
|
||||
|
||||
@JvmField
|
||||
@Autowired
|
||||
var fno: String? = null
|
||||
|
||||
@JvmField
|
||||
@Autowired
|
||||
var countryName: String? = null
|
||||
|
||||
@JvmField
|
||||
@Autowired
|
||||
var fdep: String? = null
|
||||
|
||||
@JvmField
|
||||
@Autowired
|
||||
var fdest: String? = null
|
||||
|
||||
private fun initView() {
|
||||
carNo = findViewById(R.id.carNo)
|
||||
carNoScan = findViewById(R.id.carNoScan)
|
||||
|
||||
fdateEdit = findViewById(R.id.fdate)
|
||||
fdepEdit = findViewById(R.id.fdep)
|
||||
|
||||
fnoEdit = findViewById(R.id.fno)
|
||||
fdestEdit = findViewById(R.id.fdest)
|
||||
|
||||
countryTypeEdit = findViewById(R.id.countryType)
|
||||
|
||||
submit = findViewById(R.id.submit)
|
||||
|
||||
carNoScan.setOnClickListener(this)
|
||||
submit.setOnClickListener(this)
|
||||
|
||||
|
||||
//渲染数据
|
||||
fdateEdit.setText(fdate)
|
||||
fdepEdit.setText(fdep)
|
||||
fnoEdit.setText(fno)
|
||||
fdestEdit.setText(fdest)
|
||||
countryTypeEdit.setText(countryName)
|
||||
|
||||
}
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
setContentView(R.layout.activity_mit_in_pack_info)
|
||||
setBackArrow("进港卸机确认")
|
||||
initView()
|
||||
viewModel = ViewModelProvider(this).get(MitInPackInfoViewModel::class.java)
|
||||
|
||||
//监听完成装板
|
||||
viewModel.completedObserver.observe(this) {
|
||||
loadingCancel()
|
||||
val status = it.getString("status")
|
||||
val data = it.getString("data")
|
||||
if (Constant.Result.succ == status) {
|
||||
if (data == "1") {
|
||||
carNo.setText("")
|
||||
Common.alertDialog(this, "完成装板!") { dialog ->
|
||||
dialog.dismiss()
|
||||
}
|
||||
} else if (data == "2") {
|
||||
Common.alertDialog(this, "板车不存在!") { dialog ->
|
||||
dialog.dismiss()
|
||||
}
|
||||
|
||||
} else if (data == "3") {
|
||||
Common.alertDialog(this, "此板车已装板!") { dialog ->
|
||||
dialog.dismiss()
|
||||
}
|
||||
|
||||
} else {
|
||||
Common.alertDialog(this, "装板失败!") { dialog ->
|
||||
dialog.dismiss()
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// Common.showToastLong(this, "收运失败! ")
|
||||
Common.alertDialog(this, "装板失败!") { dialog ->
|
||||
dialog.dismiss()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
override fun onClick(v: View?) {
|
||||
v?.let {
|
||||
when (it.id) {
|
||||
R.id.carNoScan -> {
|
||||
scanCode(Constant.RequestCode.mit_in_pack_info_car_scan)
|
||||
}
|
||||
R.id.submit -> {
|
||||
if (getAllEditData()) {
|
||||
Common.secondConfirmDialog(this, "是否确认?") { dialog ->
|
||||
viewModel.completed(fid, carNo.text.toString())
|
||||
dialog.dismiss()
|
||||
loading()
|
||||
}
|
||||
}
|
||||
}
|
||||
else -> {
|
||||
Toast.makeText(this, "未找到对应操作", Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 扫码返回的结果
|
||||
*/
|
||||
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
|
||||
super.onActivityResult(requestCode, resultCode, data)
|
||||
// 扫描二维码/条码回传
|
||||
if (resultCode == RESULT_OK && data != null) {
|
||||
val content = data.getStringExtra(com.yzq.zxinglibrary.common.Constant.CODED_CONTENT)
|
||||
if (content == null) {
|
||||
Common.showToast(this, "条码错误!")
|
||||
return
|
||||
}
|
||||
when (requestCode) {
|
||||
Constant.RequestCode.mit_in_pack_info_car_scan -> {
|
||||
carNo.setText("$content")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 同步viewModel的实体类数据
|
||||
*/
|
||||
private fun getAllEditData(): Boolean {
|
||||
if (carNo.text.toString() == "") {
|
||||
Common.showToast(this, "请填写平板车编号!")
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,398 @@
|
||||
package com.lukouguoji.mit.activity
|
||||
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import android.text.Editable
|
||||
import android.text.TextWatcher
|
||||
import android.view.View
|
||||
import android.widget.*
|
||||
import androidx.lifecycle.ViewModelProvider
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.alibaba.android.arouter.launcher.ARouter
|
||||
import com.bumptech.glide.load.engine.Resource
|
||||
import com.lukouguoji.mit.R
|
||||
import com.lukouguoji.mit.viewModel.OutLoadingViewModel
|
||||
import com.lukouguoji.module_base.BaseActivity
|
||||
import com.lukouguoji.module_base.common.Constant
|
||||
import com.lukouguoji.module_base.router.ARouterConstants
|
||||
import com.lukouguoji.module_base.util.CPResourceUtil
|
||||
import com.lukouguoji.module_base.util.Common
|
||||
import org.json.JSONObject
|
||||
import java.text.SimpleDateFormat
|
||||
import java.util.*
|
||||
|
||||
|
||||
@Route(path = ARouterConstants.ACTIVITY_URL_MONITOR_OUT_LOADING)
|
||||
class OutLoadingActivity : BaseActivity(), View.OnClickListener {
|
||||
private lateinit var viewModel: OutLoadingViewModel
|
||||
|
||||
private val calendar = Calendar.getInstance()
|
||||
private val ymdSdf = SimpleDateFormat("yyyy-MM-dd")//年月日
|
||||
private val ymdHmsSdf = SimpleDateFormat("yyyy-MM-dd HH:mm:ss")//年月日 时分秒
|
||||
|
||||
|
||||
//搜索
|
||||
private lateinit var fdate: TextView
|
||||
private lateinit var startDateIcon: ImageView
|
||||
private lateinit var fno: EditText
|
||||
private lateinit var dest: EditText
|
||||
private lateinit var countryName: EditText
|
||||
private lateinit var searchLayout: LinearLayout
|
||||
|
||||
private lateinit var formTitle: TextView
|
||||
private lateinit var submit: TextView
|
||||
private lateinit var operatorLayout: LinearLayout
|
||||
|
||||
//表单
|
||||
private lateinit var fnoValue: TextView
|
||||
private lateinit var jiXingValue: TextView
|
||||
private lateinit var jiHaoValue: TextView
|
||||
private lateinit var jiWeiValue: TextView
|
||||
private lateinit var zhiDanDateValue: TextView
|
||||
|
||||
private lateinit var h1Dest: TextView
|
||||
private lateinit var h1C: TextView
|
||||
private lateinit var h1M: TextView
|
||||
private lateinit var h1B: TextView
|
||||
private lateinit var h1Content: TextView
|
||||
|
||||
private lateinit var h2Dest: TextView
|
||||
private lateinit var h2C: TextView
|
||||
private lateinit var h2M: TextView
|
||||
private lateinit var h2B: TextView
|
||||
private lateinit var h2Content: TextView
|
||||
|
||||
private lateinit var h3Dest: TextView
|
||||
private lateinit var h3C: TextView
|
||||
private lateinit var h3M: TextView
|
||||
private lateinit var h3B: TextView
|
||||
private lateinit var h3Content: TextView
|
||||
|
||||
private lateinit var h4Dest: TextView
|
||||
private lateinit var h4C: TextView
|
||||
private lateinit var h4M: TextView
|
||||
private lateinit var h4B: TextView
|
||||
private lateinit var h4Content: TextView
|
||||
|
||||
private lateinit var h5Dest: TextView
|
||||
private lateinit var h5C: TextView
|
||||
private lateinit var h5M: TextView
|
||||
private lateinit var h5B: TextView
|
||||
private lateinit var h5Content: TextView
|
||||
|
||||
private lateinit var totalNum: TextView
|
||||
private lateinit var pekNum: TextView
|
||||
private lateinit var totalPc: TextView
|
||||
private lateinit var totalWeight: TextView
|
||||
|
||||
private lateinit var matchPerson: TextView
|
||||
private lateinit var balancePerson: TextView
|
||||
private lateinit var fuBangPerson: TextView
|
||||
private lateinit var driver: TextView
|
||||
private lateinit var monitorLoadUnload: TextView
|
||||
|
||||
|
||||
private fun initView() {
|
||||
viewModel = ViewModelProvider(this).get(OutLoadingViewModel::class.java)
|
||||
|
||||
fdate = findViewById(R.id.fdate)
|
||||
startDateIcon = findViewById(R.id.startDateIcon)
|
||||
fno = findViewById(R.id.fno)
|
||||
dest = findViewById(R.id.dest)
|
||||
countryName = findViewById(R.id.countryName)
|
||||
searchLayout = findViewById(R.id.searchLayout)
|
||||
formTitle = findViewById(R.id.formTitle)
|
||||
submit = findViewById(R.id.submit)
|
||||
operatorLayout = findViewById(R.id.operatorLayout)
|
||||
|
||||
//表单
|
||||
fnoValue = findViewById(R.id.fnoValue)
|
||||
jiXingValue = findViewById(R.id.jiXingValue)
|
||||
jiHaoValue = findViewById(R.id.jiHaoValue)
|
||||
jiWeiValue = findViewById(R.id.jiWeiValue)
|
||||
zhiDanDateValue = findViewById(R.id.zhiDanDateValue)
|
||||
h1Dest = findViewById(R.id.h1Dest)
|
||||
h1C = findViewById(R.id.h1C)
|
||||
h1M = findViewById(R.id.h1M)
|
||||
h1B = findViewById(R.id.h1B)
|
||||
h1Content = findViewById(R.id.h1Content)
|
||||
h2Dest = findViewById(R.id.h2Dest)
|
||||
h2C = findViewById(R.id.h2C)
|
||||
h2M = findViewById(R.id.h2M)
|
||||
h2B = findViewById(R.id.h2B)
|
||||
h2Content = findViewById(R.id.h2Content)
|
||||
h3Dest = findViewById(R.id.h3Dest)
|
||||
h3C = findViewById(R.id.h3C)
|
||||
h3M = findViewById(R.id.h3M)
|
||||
h3B = findViewById(R.id.h3B)
|
||||
h3Content = findViewById(R.id.h3Content)
|
||||
h4Dest = findViewById(R.id.h4Dest)
|
||||
h4C = findViewById(R.id.h4C)
|
||||
h4M = findViewById(R.id.h4M)
|
||||
h4B = findViewById(R.id.h4B)
|
||||
h4Content = findViewById(R.id.h4Content)
|
||||
h5Dest = findViewById(R.id.h5Dest)
|
||||
h5C = findViewById(R.id.h5C)
|
||||
h5M = findViewById(R.id.h5M)
|
||||
h5B = findViewById(R.id.h5B)
|
||||
h5Content = findViewById(R.id.h5Content)
|
||||
totalNum = findViewById(R.id.totalNum)
|
||||
pekNum = findViewById(R.id.pekNum)
|
||||
totalPc = findViewById(R.id.totalPc)
|
||||
totalWeight = findViewById(R.id.totalWeight)
|
||||
matchPerson = findViewById(R.id.matchPerson)
|
||||
balancePerson = findViewById(R.id.balancePerson)
|
||||
fuBangPerson = findViewById(R.id.fuBangPerson)
|
||||
driver = findViewById(R.id.driver)
|
||||
monitorLoadUnload = findViewById(R.id.monitorLoadUnload)
|
||||
|
||||
fdate.setOnClickListener(this)
|
||||
startDateIcon.setOnClickListener(this)
|
||||
searchLayout.setOnClickListener(this)
|
||||
submit.setOnClickListener(this)
|
||||
|
||||
fno.addTextChangedListener(object : TextWatcher {
|
||||
override fun beforeTextChanged(s: CharSequence?, start: Int, count: Int, after: Int) {
|
||||
|
||||
}
|
||||
|
||||
override fun onTextChanged(s: CharSequence?, start: Int, before: Int, count: Int) {
|
||||
|
||||
}
|
||||
|
||||
override fun afterTextChanged(editable: Editable?) {
|
||||
val originText = editable.toString()
|
||||
if (originText != null && originText != "") {
|
||||
val regularExpression = "(^([A-Z0-9]+)$)"
|
||||
val matches = originText.matches(regularExpression.toRegex())
|
||||
if(!matches){
|
||||
val regularExpression2 = "([^A-Za-z0-9]+)"
|
||||
val replaceStr = originText.replace(regularExpression2.toRegex(),"")
|
||||
val replaceStrToUpper = replaceStr.uppercase(Locale.ROOT)//小写转大写
|
||||
fno.setText(replaceStrToUpper)
|
||||
fno.setSelection(replaceStrToUpper.length)
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
fdate.text = ymdSdf.format(Date())//tw2022年6月13日15:57:10 要求航班日期默认当天
|
||||
}
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
setContentView(R.layout.activity_out_loading)
|
||||
setBackArrow("出港装机")
|
||||
initView()
|
||||
|
||||
//查询返回结果
|
||||
viewModel.searchParamLive.observe(this) {
|
||||
loadingCancel()
|
||||
//todo 1.获取数据
|
||||
val status = it.getString("status")
|
||||
if (Constant.Result.succ == status) {
|
||||
val dataObj = it.getJSONObject("data")
|
||||
val headObj = dataObj.getJSONObject("head")
|
||||
val bodyObj = dataObj.getJSONObject("body")
|
||||
val totalObj = dataObj.getJSONObject("total")
|
||||
viewModel.cars = ""
|
||||
dataObj.getJSONArray("cars").forEach { c ->
|
||||
viewModel.cars += "$c,"
|
||||
}
|
||||
if (viewModel.cars.isNotEmpty()) {
|
||||
viewModel.cars = viewModel.cars.substring(0, viewModel.cars.length - 1)
|
||||
}
|
||||
|
||||
//1.head
|
||||
fnoValue.text = headObj.getString("fno") ?: ""
|
||||
jiXingValue.text = headObj.getString("aircraftCode") ?: ""
|
||||
jiWeiValue.text = headObj.getString("standId") ?: ""
|
||||
jiHaoValue.text = headObj.getString("airNum") ?: ""
|
||||
zhiDanDateValue.text = headObj.getString("opDate") ?: ""
|
||||
|
||||
//2.body
|
||||
for (index in 1..5) {
|
||||
val tempObj = bodyObj.getJSONObject("${index}HD")
|
||||
|
||||
val destRid = CPResourceUtil.getId(this, "h${index}Dest")
|
||||
val tempDest = findViewById<TextView>(destRid)
|
||||
val cRid = CPResourceUtil.getId(this, "h${index}C")
|
||||
val tempC = findViewById<TextView>(cRid)
|
||||
val mRid = CPResourceUtil.getId(this, "h${index}M")
|
||||
val tempM = findViewById<TextView>(mRid)
|
||||
val bRid = CPResourceUtil.getId(this, "h${index}B")
|
||||
val tempB = findViewById<TextView>(bRid)
|
||||
val contentRid = CPResourceUtil.getId(this, "h${index}Content")
|
||||
val tempContent = findViewById<TextView>(contentRid)
|
||||
|
||||
tempDest.text = tempObj.getString("dest") ?: ""
|
||||
tempC.text = tempObj.getString("c") ?: ""
|
||||
tempM.text = tempObj.getString("m") ?: ""
|
||||
tempB.text = tempObj.getString("b") ?: ""
|
||||
var tempContentValue = ""
|
||||
tempObj.getJSONArray("remark").forEach { r ->
|
||||
tempContentValue = tempContentValue + r + "\n"
|
||||
}
|
||||
tempContent.text = tempContentValue
|
||||
}
|
||||
|
||||
//3.totalObj
|
||||
totalPc.text = totalObj.getIntValue("pc").toString()
|
||||
totalNum.text = totalObj.getIntValue("count").toString()
|
||||
totalWeight.text = totalObj.getIntValue("weight").toString()
|
||||
var pekNumvlue = ""
|
||||
totalObj.getJSONObject("group").keys .forEach { r->
|
||||
pekNumvlue = pekNumvlue + r+":"+totalObj.getJSONObject("group").getIntValue(r).toString()+ "车,"
|
||||
}
|
||||
pekNum.text = pekNumvlue //totalObj.getJSONObject("group").getIntValue("PEK").toString()
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
//航班返回结果
|
||||
viewModel.queryFlightObserver.observe(this) {
|
||||
loadingCancel()
|
||||
val status = it.getString("status")
|
||||
if (Constant.Result.succ == status) {
|
||||
var jsonObject = it.getJSONObject("data")
|
||||
viewModel.fdest = jsonObject.getString("fdest")
|
||||
viewModel.countryType = jsonObject.getString("countryType")
|
||||
viewModel.countryName = jsonObject.getString("countryName")
|
||||
viewModel.fid = jsonObject.getIntValue("fid")
|
||||
viewModel.fno = jsonObject.getString("fno")
|
||||
viewModel.fdate = jsonObject.getString("fdate")
|
||||
|
||||
when (viewModel.countryType) {
|
||||
"0" -> {
|
||||
formTitle.text = "国内出港货邮预装单"
|
||||
operatorLayout.visibility = View.VISIBLE
|
||||
}
|
||||
"1" -> {
|
||||
formTitle.text = "国际出港货邮预装单"
|
||||
operatorLayout.visibility = View.GONE
|
||||
}
|
||||
}
|
||||
|
||||
countryName.setText(viewModel.countryName)
|
||||
dest.setText(viewModel.fdest)
|
||||
|
||||
resetSearch()
|
||||
} else {
|
||||
//无数据
|
||||
}
|
||||
}
|
||||
|
||||
//收获 返回结果
|
||||
viewModel.provideGjjCangDanObserver.observe(this) {
|
||||
loadingCancel()
|
||||
val status = it.getString("status")
|
||||
val msg = it.getString("msg")
|
||||
if (Constant.Result.succ == status) {
|
||||
val data = it.getString("data")
|
||||
if (Constant.Result.succ == data) {
|
||||
if (msg != null && msg != "") {
|
||||
Common.showToast(this, msg)
|
||||
} else {
|
||||
Common.showToast(this, "货物发放成功!")
|
||||
}
|
||||
resetSearch()
|
||||
} else {
|
||||
if (msg != null && msg != "") {
|
||||
Common.showToast(this, msg)
|
||||
} else {
|
||||
Common.showToast(this, "货物发放失败!")
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (msg != null && msg != "") {
|
||||
Common.showToast(this, msg)
|
||||
} else {
|
||||
Common.showToast(this, "货物发放失败!")
|
||||
}
|
||||
}
|
||||
//重新搜索
|
||||
resetSearch()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
override fun onClick(v: View?) {
|
||||
v?.let {
|
||||
when (it.id) {
|
||||
R.id.fdate -> {
|
||||
Common.onYearMonthDay(this, fdate.text.toString()) { year, month, day ->
|
||||
calendar.set(year, month - 1, day)
|
||||
fdate.text = ymdSdf.format(calendar.time)
|
||||
}
|
||||
}
|
||||
R.id.startDateIcon -> {
|
||||
fdate.text = ""
|
||||
}
|
||||
R.id.searchLayout -> {
|
||||
countryName.setText("")
|
||||
dest.setText("")
|
||||
|
||||
viewModel.countryType = ""
|
||||
viewModel.countryName = ""
|
||||
viewModel.fdest = ""
|
||||
|
||||
doFlight()
|
||||
}
|
||||
R.id.submit -> {
|
||||
ARouter.getInstance().build(ARouterConstants.ACTIVITY_URL_MONITOR_OUT_LOADING_PULL).withInt("fidParam", viewModel.fid ?: -9999)
|
||||
.withString("fnoParam", viewModel.fno ?: "").withString("fdateParam", viewModel.fdate ?: "")
|
||||
.withString("carsParam", viewModel.cars)
|
||||
.navigation()
|
||||
}
|
||||
else -> {
|
||||
Toast.makeText(this, "未找到对应操作", Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* onActivityResult 回调
|
||||
*/
|
||||
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
|
||||
super.onActivityResult(requestCode, resultCode, data)
|
||||
if (resultCode == RESULT_OK) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 搜索
|
||||
*/
|
||||
private fun searchFun() {
|
||||
/*if (fdate.text.toString() == "" || fno.text.toString() == "") {
|
||||
Common.showToast(this, "航班日期和航班号不可为空!")
|
||||
return
|
||||
}*/
|
||||
loading()
|
||||
viewModel.search(
|
||||
fdate.text.toString(),
|
||||
fno.text.toString()
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* 重置数据,搜索
|
||||
*/
|
||||
private fun resetSearch() {
|
||||
searchFun()
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询航班是否存在
|
||||
*/
|
||||
private fun doFlight() {
|
||||
if (fdate.text.toString() == "" || fno.text.toString() == "") {
|
||||
Common.showToast(this, "航班日期和航班号不可为空!")
|
||||
return
|
||||
}
|
||||
loading()
|
||||
viewModel.queryFlight(fdate.text.toString(), fno.text.toString(),getString(R.string.airport))
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,436 @@
|
||||
package com.lukouguoji.mit.activity
|
||||
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import android.text.Editable
|
||||
import android.text.TextWatcher
|
||||
import android.view.View
|
||||
import android.widget.*
|
||||
import androidx.lifecycle.ViewModelProvider
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.alibaba.android.arouter.facade.annotation.Autowired
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.alibaba.fastjson.JSONArray
|
||||
import com.alibaba.fastjson.JSONObject
|
||||
import com.lukouguoji.mit.R
|
||||
import com.lukouguoji.mit.adapt.OutLoadingPullAdapter
|
||||
import com.lukouguoji.mit.model.OutLoadingPullModel
|
||||
import com.lukouguoji.mit.viewModel.OutLoadingPullViewModel
|
||||
import com.lukouguoji.module_base.ActivityCollector
|
||||
import com.lukouguoji.module_base.BaseActivity
|
||||
import com.lukouguoji.module_base.common.Constant
|
||||
import com.lukouguoji.module_base.router.ARouterConstants
|
||||
import com.lukouguoji.module_base.util.Common
|
||||
import com.scwang.smart.refresh.footer.ClassicsFooter
|
||||
import com.scwang.smart.refresh.header.ClassicsHeader
|
||||
import com.scwang.smart.refresh.layout.api.RefreshLayout
|
||||
import java.text.SimpleDateFormat
|
||||
import java.util.*
|
||||
|
||||
@Route(path = ARouterConstants.ACTIVITY_URL_MONITOR_OUT_LOADING_PULL)
|
||||
class OutLoadingPullActivity : BaseActivity(), View.OnClickListener {
|
||||
private lateinit var viewModel: OutLoadingPullViewModel
|
||||
private lateinit var adapter: OutLoadingPullAdapter
|
||||
private val collectList = ArrayList<OutLoadingPullModel>()
|
||||
private var collectListFromNet = ArrayList<OutLoadingPullModel>()
|
||||
private lateinit var refreshLayout: RefreshLayout
|
||||
private var currentPage = 1
|
||||
private var pageSize = 10
|
||||
private var totalPage = 0
|
||||
private var totalCount = 0 //总条数
|
||||
private val calendar = Calendar.getInstance()
|
||||
private val ymdSdf = SimpleDateFormat("yyyy-MM-dd")//年月日
|
||||
private val ymdHmsSdf = SimpleDateFormat("yyyy-MM-dd HH:mm:ss")//年月日 时分秒
|
||||
|
||||
//搜索
|
||||
private lateinit var fdate: TextView
|
||||
private lateinit var fno: EditText
|
||||
private lateinit var carNo: AutoCompleteTextView
|
||||
private lateinit var carListPop: ListPopupWindow
|
||||
|
||||
private lateinit var searchLayout: LinearLayout
|
||||
private lateinit var checkIcon: ImageView
|
||||
private lateinit var quickSearch: EditText
|
||||
private var isAllCheck = false
|
||||
|
||||
//列表
|
||||
private lateinit var listLayout: LinearLayout
|
||||
private lateinit var totalLayout: LinearLayout
|
||||
|
||||
//底部
|
||||
private lateinit var totalPc: TextView
|
||||
private lateinit var selPc: TextView
|
||||
private lateinit var send: TextView
|
||||
|
||||
@JvmField
|
||||
@Autowired
|
||||
var fidParam: Int = -9999
|
||||
|
||||
@JvmField
|
||||
@Autowired
|
||||
var fnoParam: String = ""
|
||||
|
||||
@JvmField
|
||||
@Autowired
|
||||
var fdateParam: String = ""
|
||||
|
||||
@JvmField
|
||||
@Autowired
|
||||
var carsParam: String = ""
|
||||
|
||||
private fun initView() {
|
||||
viewModel = ViewModelProvider(this).get(OutLoadingPullViewModel::class.java)
|
||||
val layoutManager = LinearLayoutManager(this)
|
||||
adapter = OutLoadingPullAdapter(this, viewModel, collectList)
|
||||
var recyclerView: RecyclerView = findViewById(R.id.collectList)
|
||||
recyclerView.layoutManager = layoutManager
|
||||
recyclerView.adapter = adapter
|
||||
refreshLayout = findViewById(R.id.refreshLayout)
|
||||
//搜索框
|
||||
fdate = findViewById(R.id.fdate)
|
||||
fno = findViewById(R.id.fno)
|
||||
carNo = findViewById(R.id.carNo)
|
||||
val split = carsParam.split(",")
|
||||
|
||||
carNo.setAdapter(ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, split))
|
||||
|
||||
//快捷搜索
|
||||
searchLayout = findViewById(R.id.searchLayout)
|
||||
checkIcon = findViewById(R.id.checkIcon)
|
||||
quickSearch = findViewById(R.id.quickSearch)
|
||||
|
||||
//cars的下拉框初始化
|
||||
/*carListPop = ListPopupWindow(this)
|
||||
carListPop.setAdapter(ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, split))
|
||||
carListPop.setWidth(ActionBar.LayoutParams.WRAP_CONTENT)
|
||||
carListPop.setHeight(ActionBar.LayoutParams.WRAP_CONTENT)
|
||||
carListPop.setAnchorView(carNo) //设置ListPopupWindow的锚点,即关联PopupWindow的显示位置和这个锚点
|
||||
carListPop.setModal(true) //设置是否是模式
|
||||
carListPop.setOnItemClickListener { _, _, position, _ ->
|
||||
carNo.setText(split[position])
|
||||
carListPop.dismiss()
|
||||
}*/
|
||||
|
||||
//列表
|
||||
listLayout = findViewById(R.id.listLayout)
|
||||
totalLayout = findViewById(R.id.totalLayout)
|
||||
//底部
|
||||
totalPc = findViewById(R.id.totalPc)
|
||||
selPc = findViewById(R.id.selPc)
|
||||
send = findViewById(R.id.send)
|
||||
|
||||
searchLayout.setOnClickListener(this)
|
||||
checkIcon.setOnClickListener(this)
|
||||
send.setOnClickListener(this)
|
||||
|
||||
/*carNo.addTextChangedListener(object : TextWatcher {
|
||||
override fun beforeTextChanged(s: CharSequence?, start: Int, count: Int, after: Int) {
|
||||
|
||||
}
|
||||
|
||||
override fun onTextChanged(s: CharSequence?, start: Int, before: Int, count: Int) {
|
||||
if (s != null && s.toString() != "") {
|
||||
val filterCollectionList = split.filter { c -> c.contains(s.toString()) }
|
||||
if (filterCollectionList.isNotEmpty()) {
|
||||
carListPop.setAdapter(
|
||||
ArrayAdapter<String>(
|
||||
ActivityCollector.getLastActivity()!!,
|
||||
android.R.layout.simple_list_item_1,
|
||||
filterCollectionList
|
||||
)
|
||||
)
|
||||
carListPop.setOnItemClickListener { _, _, position, _ ->
|
||||
carNo.setText(filterCollectionList[position])
|
||||
carListPop.dismiss()
|
||||
}
|
||||
carListPop.show()
|
||||
}
|
||||
} else {
|
||||
if (split.isNotEmpty()) {
|
||||
carListPop.setAdapter(
|
||||
ArrayAdapter<String>(
|
||||
ActivityCollector.getLastActivity()!!,
|
||||
android.R.layout.simple_list_item_1,
|
||||
split
|
||||
)
|
||||
)
|
||||
carListPop.setOnItemClickListener { _, _, position, _ ->
|
||||
carNo.setText(split[position])
|
||||
carListPop.dismiss()
|
||||
}
|
||||
carListPop.show()
|
||||
}
|
||||
}
|
||||
carNo.isFocusable = true
|
||||
carNo.requestFocus()
|
||||
carNo.setSelection(carNo.getText().length);
|
||||
}
|
||||
|
||||
override fun afterTextChanged(s: Editable?) {
|
||||
|
||||
}
|
||||
})*/
|
||||
|
||||
quickSearch.addTextChangedListener(object : TextWatcher {
|
||||
override fun beforeTextChanged(s: CharSequence?, start: Int, count: Int, after: Int) {
|
||||
|
||||
}
|
||||
|
||||
override fun onTextChanged(s: CharSequence?, start: Int, before: Int, count: Int) {
|
||||
if (s != null && s.toString() != "") {
|
||||
val filterCollectionList = collectList.filter { c -> c.wbNo.contains(s.toString()) }
|
||||
collectList.clear()
|
||||
collectList.addAll(filterCollectionList)
|
||||
recyclerView.adapter = OutLoadingPullAdapter(
|
||||
ActivityCollector.getLastActivity()!!,
|
||||
viewModel,
|
||||
collectList
|
||||
)
|
||||
} else {
|
||||
collectList.clear()
|
||||
collectList.addAll(collectListFromNet)
|
||||
recyclerView.adapter = OutLoadingPullAdapter(
|
||||
ActivityCollector.getLastActivity()!!,
|
||||
viewModel,
|
||||
collectList
|
||||
)
|
||||
}
|
||||
val checkList = collectList.filter { c -> c.isCheck }
|
||||
viewModel.setCheckCount(checkList.size)
|
||||
adapter.notifyDataSetChanged()
|
||||
}
|
||||
|
||||
override fun afterTextChanged(s: Editable?) {
|
||||
|
||||
}
|
||||
})
|
||||
|
||||
fdate.text = fdateParam
|
||||
fno.setText(fnoParam)
|
||||
}
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
setContentView(R.layout.activity_out_loading_pull)
|
||||
setBackArrow("出港装机拉货")
|
||||
initView()
|
||||
|
||||
//查询返回结果
|
||||
viewModel.searchParamLive.observe(this) {
|
||||
loadingCancel()
|
||||
//1.获取数据
|
||||
var listArr: JSONArray = it["list"] as JSONArray
|
||||
totalCount = it.getIntValue("total")
|
||||
totalPage = it["pages"] as Int
|
||||
// var listArr :JSONArray =it["list"] as JSONArray
|
||||
if (listArr.size > 0) {
|
||||
listLayout.visibility = View.VISIBLE
|
||||
totalLayout.visibility = View.VISIBLE
|
||||
//2.循环遍历塞入collectList
|
||||
listArr.forEach {
|
||||
val itemObj = it as JSONObject
|
||||
|
||||
val mfId = itemObj.getIntValue("mfId")
|
||||
val whId = itemObj.getIntValue("whId")
|
||||
val no = itemObj.getString("wbNo") ?: ""
|
||||
val pc = itemObj.getIntValue("pc")
|
||||
val weight = itemObj.getDoubleValue("weight")//实到重量
|
||||
val volume = itemObj.getDoubleValue("volume")
|
||||
val location = itemObj.getString("location") ?: ""
|
||||
|
||||
//列表赋值
|
||||
collectList.add(
|
||||
OutLoadingPullModel(
|
||||
no,
|
||||
mfId,
|
||||
whId,
|
||||
pc,
|
||||
weight,
|
||||
volume,
|
||||
location,
|
||||
false
|
||||
)
|
||||
)
|
||||
}
|
||||
collectListFromNet.clear()
|
||||
collectListFromNet = collectList.clone() as ArrayList<OutLoadingPullModel>
|
||||
|
||||
//3.调adpter展示
|
||||
if (currentPage == 1) {
|
||||
adapter.notifyDataSetChanged()
|
||||
} else {
|
||||
adapter.notifyItemRangeInserted((currentPage - 1) * 10, collectList.size)
|
||||
}
|
||||
refreshLayout.finishRefresh()
|
||||
refreshLayout.finishLoadMore()
|
||||
|
||||
}
|
||||
|
||||
totalPc.text = totalCount.toString()
|
||||
resetSelCount(false, totalCount)
|
||||
}
|
||||
|
||||
//货物发放 返回结果
|
||||
viewModel.completedObserver.observe(this) {
|
||||
loadingCancel()
|
||||
val status = it.getString("status")
|
||||
val msg = it.getString("msg")
|
||||
if (Constant.Result.succ == status) {
|
||||
var dataStatus = it.getString("data")
|
||||
if (Constant.Result.succ == dataStatus) {
|
||||
if (msg != null && msg != "") {
|
||||
Common.showToast(this, msg)
|
||||
} else {
|
||||
Common.showToast(this, "拉货成功!")
|
||||
}
|
||||
//重新刷新列表
|
||||
resetSearch()
|
||||
} else {
|
||||
if (msg != null && msg != "") {
|
||||
Common.showToast(this, msg)
|
||||
} else {
|
||||
Common.showToast(this, "拉货失败!")
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (msg != null && msg != "") {
|
||||
Common.showToast(this, msg)
|
||||
} else {
|
||||
Common.showToast(this, "拉货失败!")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//监听 复选框选中
|
||||
viewModel.checkCount.observe(this) {
|
||||
selPc.text = it.toString()
|
||||
}
|
||||
|
||||
//搜索
|
||||
resetSearch()
|
||||
|
||||
/////////////////////////////// 加载刷新的布局
|
||||
refreshLayout.setRefreshHeader(ClassicsHeader(this))
|
||||
refreshLayout.setRefreshFooter(ClassicsFooter(this))
|
||||
/////////////////////////////// 下拉刷新
|
||||
refreshLayout.setOnRefreshListener {
|
||||
resetSearch()
|
||||
}
|
||||
/////////////////////////////// 上拉加载
|
||||
refreshLayout.setOnLoadMoreListener {
|
||||
if (currentPage < totalPage) {
|
||||
currentPage++
|
||||
//初始化查询
|
||||
searchFun()
|
||||
} else {
|
||||
refreshLayout.finishLoadMoreWithNoMoreData()
|
||||
}
|
||||
}
|
||||
|
||||
/////////////// 下拉框 start
|
||||
|
||||
/////////////// 下拉框 end
|
||||
}
|
||||
|
||||
override fun onClick(v: View?) {
|
||||
v?.let {
|
||||
when (it.id) {
|
||||
R.id.searchLayout -> {
|
||||
// viewModel.queryPickByIdGnjChuKu("M000995643")
|
||||
resetSearch()
|
||||
}
|
||||
R.id.checkIcon -> {
|
||||
//重置 isAllCheck
|
||||
isAllCheck = !isAllCheck
|
||||
resetSelCount(isAllCheck, totalCount)
|
||||
}
|
||||
R.id.send -> {
|
||||
val paramArr = JSONArray()
|
||||
collectList.forEach { c ->
|
||||
if (c.isCheck) {
|
||||
val paramObj = JSONObject()
|
||||
paramObj["fid"] = fidParam
|
||||
paramObj["mfId"] = c.mfId
|
||||
paramObj["weight"] = c.weight
|
||||
paramObj["pc"] = c.pc
|
||||
paramObj["whId"] = c.whId
|
||||
paramArr.add(paramObj)
|
||||
}
|
||||
}
|
||||
if (paramArr.size > 0) {
|
||||
viewModel.completed(paramArr)
|
||||
} else {
|
||||
Common.alertDialog(this, "请至少选择一票货物!") { dialog ->
|
||||
dialog.dismiss()
|
||||
}
|
||||
}
|
||||
}
|
||||
else -> {
|
||||
Toast.makeText(this, "未找到对应操作", Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 扫码返回的结果
|
||||
*/
|
||||
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
|
||||
super.onActivityResult(requestCode, resultCode, data)
|
||||
// 扫描二维码/条码回传
|
||||
if (resultCode == RESULT_OK && data != null) {
|
||||
val content = data.getStringExtra(com.yzq.zxinglibrary.common.Constant.CODED_CONTENT)
|
||||
if (content == null) {
|
||||
Common.showToast(this, "条码错误!")
|
||||
return
|
||||
}
|
||||
when (requestCode) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 搜索
|
||||
*/
|
||||
private fun searchFun() {
|
||||
loading()
|
||||
listLayout.visibility = View.GONE
|
||||
totalLayout.visibility = View.GONE
|
||||
viewModel.search(
|
||||
pageSize,
|
||||
currentPage,
|
||||
fidParam,
|
||||
carNo.text.toString()
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* 重置数据,搜索
|
||||
*/
|
||||
private fun resetSearch() {
|
||||
//recyclerView 清除所有数据数据
|
||||
viewModel.setCheckCount(0)
|
||||
refreshLayout.setNoMoreData(false)
|
||||
adapter.notifyItemRangeRemoved(0, collectList.size)
|
||||
collectList.clear()
|
||||
currentPage = 1
|
||||
searchFun()
|
||||
}
|
||||
|
||||
/**
|
||||
* 重新计算选中数量
|
||||
* isAllCheckParam true:全选 false:全部全效选择
|
||||
*/
|
||||
private fun resetSelCount(isAllCheckParam: Boolean, totalCount: Int) {
|
||||
collectList.forEach { c ->
|
||||
c.isCheck = isAllCheckParam
|
||||
}
|
||||
if (isAllCheckParam) {
|
||||
viewModel.setCheckCount(totalCount)
|
||||
} else {
|
||||
viewModel.setCheckCount(0)
|
||||
}
|
||||
adapter.notifyDataSetChanged()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
package com.lukouguoji.mit.adapt
|
||||
|
||||
import android.app.Activity
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.TextView
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.alibaba.android.arouter.launcher.ARouter
|
||||
import com.lukouguoji.mit.R
|
||||
import com.lukouguoji.mit.model.AccidentVisaModel
|
||||
import com.lukouguoji.mit.viewModel.AccidentVisaViewModel
|
||||
import com.lukouguoji.module_base.common.Constant
|
||||
import com.lukouguoji.module_base.router.ARouterConstants
|
||||
import com.lukouguoji.module_base.util.Common
|
||||
|
||||
class AccidentVisaAdapter(
|
||||
val activity: Activity,
|
||||
private val viewModel: AccidentVisaViewModel,
|
||||
private val collectList: MutableList<AccidentVisaModel>
|
||||
) :
|
||||
RecyclerView.Adapter<AccidentVisaAdapter.ViewHolder>() {
|
||||
|
||||
inner class ViewHolder(view: View) : RecyclerView.ViewHolder(view) {
|
||||
val wbNo: TextView = view.findViewById(R.id.wbNo)
|
||||
val areaFlag: TextView = view.findViewById(R.id.areaFlag)
|
||||
val ieFlag: TextView = view.findViewById(R.id.ieFlag)
|
||||
val dpc: TextView = view.findViewById(R.id.dpc)
|
||||
val opId: TextView = view.findViewById(R.id.opId)
|
||||
val opDate: TextView = view.findViewById(R.id.opDate)
|
||||
|
||||
val delete: TextView = view.findViewById(R.id.delete)
|
||||
}
|
||||
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
|
||||
val view = LayoutInflater.from(parent.context).inflate(R.layout.accident_visa_list_item, parent, false)
|
||||
val viewHolder = ViewHolder(view)
|
||||
|
||||
viewHolder.itemView.setOnClickListener {
|
||||
|
||||
var adapterPosition = viewHolder.adapterPosition
|
||||
if (adapterPosition < 0 || collectList.isEmpty()) {
|
||||
return@setOnClickListener
|
||||
}
|
||||
var item = collectList[adapterPosition]
|
||||
|
||||
ARouter.getInstance().build(ARouterConstants.ACTIVITY_URL_MONITOR_ACCIDENT_VISA_INFO)
|
||||
.withInt("id", item.id)
|
||||
.navigation(activity,Constant.RequestCode.accident_visa_list_query_result)
|
||||
|
||||
}
|
||||
return viewHolder
|
||||
}
|
||||
|
||||
override fun onBindViewHolder(holder: ViewHolder, position: Int) {
|
||||
val collect = collectList[position]
|
||||
|
||||
holder.wbNo.text = collect.wbNo
|
||||
holder.areaFlag.text = collect.areaFlag
|
||||
holder.ieFlag.text = collect.ieFlag
|
||||
holder.dpc.text = collect.dpc
|
||||
holder.opId.text = collect.opId
|
||||
holder.opDate.text = collect.opDate
|
||||
|
||||
holder.delete.setOnClickListener {
|
||||
Common.secondConfirmDialog(activity, "确认删除?") { dialog ->
|
||||
dialog.dismiss()
|
||||
val position = holder.absoluteAdapterPosition
|
||||
viewModel.deleteLine(collect.id, position)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun getItemCount() = collectList.size
|
||||
|
||||
fun append(accidentVisaModel: AccidentVisaModel) {
|
||||
collectList.add(accidentVisaModel)
|
||||
notifyDataSetChanged()
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,321 @@
|
||||
package com.lukouguoji.mit.adapt
|
||||
|
||||
import android.text.Editable
|
||||
import android.text.TextWatcher
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.EditText
|
||||
import android.widget.ImageView
|
||||
import android.widget.LinearLayout
|
||||
import android.widget.TextView
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.alibaba.fastjson.JSONObject
|
||||
import com.lukouguoji.mit.R
|
||||
import com.lukouguoji.mit.activity.AccidentVisaInfoActivity
|
||||
import com.lukouguoji.mit.model.AccidentVisaInfoItemModel
|
||||
import com.lukouguoji.mit.viewModel.AccidentVisaInfoViewModel
|
||||
import com.lukouguoji.module_base.common.String.isValidInt
|
||||
import com.lukouguoji.module_base.util.Common
|
||||
import java.text.SimpleDateFormat
|
||||
import java.util.*
|
||||
|
||||
class AccidentVisaInfoAdapter(
|
||||
val activity: AccidentVisaInfoActivity,
|
||||
val viewModel: AccidentVisaInfoViewModel,
|
||||
private val collectList: MutableList<AccidentVisaInfoItemModel>
|
||||
) :
|
||||
RecyclerView.Adapter<AccidentVisaInfoAdapter.ViewHolder>() {
|
||||
|
||||
inner class ViewHolder(view: View) : RecyclerView.ViewHolder(view) {
|
||||
val titleName: TextView = view.findViewById(R.id.titleName)
|
||||
val isMust: TextView = view.findViewById(R.id.isMust)
|
||||
val inputLayout: LinearLayout = view.findViewById(R.id.inputLayout)
|
||||
val inputContent: EditText = view.findViewById(R.id.inputContent)
|
||||
val inputContentPreView: View = view.findViewById(R.id.inputContentPreView)
|
||||
val inputContentPre: EditText = view.findViewById(R.id.inputContentPre)
|
||||
val selContent: TextView = view.findViewById(R.id.selContent)
|
||||
val scanIcon: ImageView = view.findViewById(R.id.scanIcon)
|
||||
}
|
||||
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
|
||||
val view = LayoutInflater.from(parent.context).inflate(R.layout.accident_visa_info_item, parent, false)
|
||||
val viewHolder = ViewHolder(view)
|
||||
viewHolder.setIsRecyclable(false)
|
||||
|
||||
/* viewHolder.itemView.setOnClickListener {
|
||||
|
||||
var adapterPosition = viewHolder.adapterPosition
|
||||
if (adapterPosition < 0 || collectList.isEmpty()) {
|
||||
return@setOnClickListener
|
||||
}
|
||||
var gncFuBang = collectList[adapterPosition]
|
||||
|
||||
ARouter.getInstance().build(ARouterConstants.ACTIVITY_URL_GOUT_FU_BANG_ACTIVITY).withString("userIdParam", gncFuBang.useId.toString())
|
||||
.navigation(activity, Constant.RequestCode.gnc_shouyun_list_refresh)
|
||||
|
||||
}
|
||||
*/
|
||||
return viewHolder
|
||||
}
|
||||
|
||||
override fun onBindViewHolder(holder: ViewHolder, position: Int) {
|
||||
val collect = collectList[position]
|
||||
val must = collect.isMust
|
||||
val enable = collect.isEnable
|
||||
val titleName = collect.titleName
|
||||
val isSel = collect.isSel
|
||||
val inputContent = collect.inputContent
|
||||
val inputContentPre = collect.inputContentPre
|
||||
val selList = collect.selList
|
||||
val ymdhms = collect.ymdhms
|
||||
val selContentCode = collect.selContentCode
|
||||
val scan = collect.scan
|
||||
val scanResultCode = collect.scanResultCode
|
||||
|
||||
//是否必填
|
||||
if (must) {
|
||||
holder.isMust.visibility = View.VISIBLE
|
||||
} else {
|
||||
holder.isMust.visibility = View.GONE
|
||||
}
|
||||
holder.titleName.text = titleName
|
||||
//下拉框
|
||||
if (isSel) {
|
||||
holder.selContent.visibility = View.VISIBLE
|
||||
holder.inputLayout.visibility = View.GONE
|
||||
|
||||
//1.单选下拉框
|
||||
selList?.forEach { sel ->
|
||||
var selObj = sel as JSONObject
|
||||
var name = selObj.getString("name")
|
||||
var code = selObj.getString("code")
|
||||
if (selContentCode == code) {
|
||||
holder.selContent.text = name
|
||||
}
|
||||
}
|
||||
//2.时间下拉框
|
||||
ymdhms?.let {
|
||||
holder.selContent.text = selContentCode
|
||||
}
|
||||
|
||||
//是否允许
|
||||
holder.selContent.isEnabled = enable
|
||||
if (enable) {
|
||||
holder.selContent.setBackgroundResource(R.drawable.mit_in_pack_list_input_edit_text)
|
||||
} else {
|
||||
holder.selContent.setBackgroundResource(R.drawable.accident_visa_info_edit_disable_shape)
|
||||
}
|
||||
//下拉框监听
|
||||
holder.selContent.setOnClickListener {
|
||||
if (selList != null) {
|
||||
Common.singleSelect(activity, titleName, selList!!, selContentCode) { _, item ->
|
||||
val jsonObject = item as JSONObject
|
||||
val code = jsonObject.getString("code")
|
||||
collect.selContentCode = code
|
||||
notifyDataSetChanged()
|
||||
}
|
||||
} else if (ymdhms != null) {
|
||||
if (ymdhms) {
|
||||
Common.onYearMonthDayTime(activity, collect.selContentCode) { year, month, day, hour, minute, second ->
|
||||
val calendar = Calendar.getInstance()
|
||||
val ymdHmsSdf = SimpleDateFormat("yyyy-MM-dd HH:mm:ss")//年月日 时分秒
|
||||
calendar.set(year, month - 1, day, hour, minute, second)
|
||||
val dateRes = ymdHmsSdf.format(calendar.time)
|
||||
collect.selContentCode = dateRes
|
||||
notifyDataSetChanged()
|
||||
}
|
||||
} else {
|
||||
Common.onYearMonthDay(activity, collect.selContentCode) { year, month, day ->
|
||||
val calendar = Calendar.getInstance()
|
||||
val ymdSdf = SimpleDateFormat("yyyy-MM-dd")//年月日
|
||||
calendar.set(year, month - 1, day)
|
||||
collect.selContentCode = ymdSdf.format(calendar.time)
|
||||
//如果是fdate另算
|
||||
if (collect.titleCode == "fdate") {
|
||||
var fno = ""
|
||||
collectList.forEach { c ->
|
||||
if (c.titleCode == "fno") {
|
||||
fno = c.inputContent
|
||||
return@forEach
|
||||
}
|
||||
}
|
||||
if (collect.selContentCode != "" && fno != "") {
|
||||
viewModel.queryFlight(collect.selContentCode, fno)
|
||||
}
|
||||
}
|
||||
notifyDataSetChanged()
|
||||
}
|
||||
}
|
||||
} else {
|
||||
Common.showToast(activity, "暂无选项!")
|
||||
}
|
||||
}
|
||||
}
|
||||
//输入框
|
||||
else {
|
||||
//输入框1
|
||||
holder.selContent.visibility = View.GONE
|
||||
holder.inputContentPreView.visibility = View.GONE
|
||||
holder.inputContentPre.visibility = View.GONE
|
||||
holder.inputLayout.visibility = View.VISIBLE
|
||||
holder.inputContent.visibility = View.VISIBLE
|
||||
|
||||
//是否允许
|
||||
holder.inputContent.isEnabled = enable
|
||||
if (enable) {
|
||||
holder.inputContent.setBackgroundResource(R.drawable.mit_in_pack_list_input_edit_text)
|
||||
} else {
|
||||
holder.inputContent.setBackgroundResource(R.drawable.accident_visa_info_edit_disable_shape)
|
||||
}
|
||||
holder.inputContent.setText(inputContent)
|
||||
holder.inputContent.addTextChangedListener(object : TextWatcher {
|
||||
override fun beforeTextChanged(s: CharSequence?, start: Int, count: Int, after: Int) {
|
||||
|
||||
}
|
||||
|
||||
override fun onTextChanged(s: CharSequence?, start: Int, before: Int, count: Int) {
|
||||
|
||||
}
|
||||
|
||||
override fun afterTextChanged(s: Editable?) {
|
||||
collect.inputContent = s.toString()
|
||||
}
|
||||
})
|
||||
//支持扫描
|
||||
if (scan != null && scan) {
|
||||
holder.scanIcon.visibility = View.VISIBLE
|
||||
holder.scanIcon.setOnClickListener {
|
||||
activity.scanCode(scanResultCode ?: -9999)
|
||||
}
|
||||
} else {
|
||||
holder.scanIcon.visibility = View.GONE
|
||||
}
|
||||
// 1.如果是订单no,监听输入事件
|
||||
if (collect.titleCode == "no") {
|
||||
//失去焦点
|
||||
holder.inputContent.onFocusChangeListener = View.OnFocusChangeListener { v, hasFocus ->
|
||||
if (hasFocus) {
|
||||
|
||||
} else {
|
||||
val editText = v as EditText
|
||||
//失去焦点
|
||||
if (editText.text.toString().length != 8 || !editText.text.toString().isValidInt()) {
|
||||
Common.showToast(activity, "请输入正确的运单号格式!")
|
||||
return@OnFocusChangeListener
|
||||
}
|
||||
val subSequence = editText.text.toString().subSequence(0, 7).toString().toInt()
|
||||
val subSequence2 = editText.text.toString()[7].toString().toInt()
|
||||
if (subSequence % 7 != subSequence2) {
|
||||
Common.showToast(activity, "请输入正确的运单号格式!")
|
||||
return@OnFocusChangeListener
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// 2.如果是订单 wbNo ,监听输入事件
|
||||
if (collect.titleCode == "wbNo") {
|
||||
//输入监听
|
||||
holder.inputContent.addTextChangedListener(object : TextWatcher {
|
||||
override fun beforeTextChanged(s: CharSequence?, start: Int, count: Int, after: Int) {
|
||||
|
||||
}
|
||||
|
||||
override fun onTextChanged(s: CharSequence?, start: Int, before: Int, count: Int) {
|
||||
if (s != null && s.toString().length > 11) {
|
||||
var wbNoStr = s.toString()
|
||||
Common.alertDialog(activity, "请输入正确的运单号格式!") { dialog ->
|
||||
dialog.dismiss()
|
||||
wbNoStr = wbNoStr.substring(0, 11)
|
||||
collectList.forEach { c ->
|
||||
if (c.titleCode == "wbNo") {
|
||||
c.inputContent = wbNoStr.substring(0, 11)
|
||||
return@forEach
|
||||
}
|
||||
}
|
||||
notifyDataSetChanged()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun afterTextChanged(s: Editable?) {
|
||||
|
||||
}
|
||||
})
|
||||
//失去焦点
|
||||
holder.inputContent.onFocusChangeListener = View.OnFocusChangeListener { v, hasFocus ->
|
||||
if (hasFocus) {
|
||||
|
||||
} else {
|
||||
val editText = v as EditText
|
||||
//失去焦点
|
||||
val editTextStr = editText.text.toString()
|
||||
if (editTextStr.length < 11) {
|
||||
Common.showToast(activity, "请输入正确的运单号格式!")
|
||||
return@OnFocusChangeListener
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// 3.如果是订单 fno ,监听输入事件
|
||||
if (collect.titleCode == "fno") {
|
||||
//失去焦点
|
||||
holder.inputContent.onFocusChangeListener = View.OnFocusChangeListener { v, hasFocus ->
|
||||
if (hasFocus) {
|
||||
|
||||
} else {
|
||||
val editText = v as EditText
|
||||
var fdate = ""
|
||||
collectList.forEach { c ->
|
||||
if (c.titleCode == "fdate") {
|
||||
fdate = c.selContentCode
|
||||
return@forEach
|
||||
}
|
||||
}
|
||||
if (fdate != "" && editText.text.toString() != "") {
|
||||
viewModel.queryFlight(fdate, editText.text.toString())
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//输入框2
|
||||
if (collect.titleCodePre != null && collect.inputContentPre != null) {
|
||||
holder.inputContentPreView.visibility = View.VISIBLE
|
||||
holder.inputContentPre.visibility = View.VISIBLE
|
||||
|
||||
//是否允许
|
||||
holder.inputContentPre.isEnabled = enable
|
||||
if (enable) {
|
||||
holder.inputContentPre.setBackgroundResource(R.drawable.mit_in_pack_list_input_edit_text)
|
||||
} else {
|
||||
holder.inputContentPre.setBackgroundResource(R.drawable.accident_visa_info_edit_disable_shape)
|
||||
}
|
||||
holder.inputContentPre.setText(inputContentPre)
|
||||
holder.inputContentPre.addTextChangedListener(object : TextWatcher {
|
||||
override fun beforeTextChanged(s: CharSequence?, start: Int, count: Int, after: Int) {
|
||||
|
||||
}
|
||||
|
||||
override fun onTextChanged(s: CharSequence?, start: Int, before: Int, count: Int) {
|
||||
|
||||
}
|
||||
|
||||
override fun afterTextChanged(s: Editable?) {
|
||||
collect.inputContentPre = s.toString()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
override fun getItemCount() = collectList.size
|
||||
|
||||
fun append(accidentVisaInfoItemModel: AccidentVisaInfoItemModel) {
|
||||
collectList.add(accidentVisaInfoItemModel)
|
||||
notifyDataSetChanged()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
package com.lukouguoji.mit.adapt
|
||||
|
||||
import android.app.Activity
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.ImageView
|
||||
import android.widget.TextView
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.lukouguoji.mit.R
|
||||
import com.lukouguoji.mit.model.MitInPackListModel
|
||||
import com.lukouguoji.mit.viewModel.MitInPackListViewModel
|
||||
import com.lukouguoji.module_base.util.Common
|
||||
|
||||
class MitInPackListAdapter(
|
||||
val activity: Activity,
|
||||
private val viewModel: MitInPackListViewModel,
|
||||
private val collectList: MutableList<MitInPackListModel>
|
||||
) :
|
||||
RecyclerView.Adapter<MitInPackListAdapter.ViewHolder>() {
|
||||
|
||||
inner class ViewHolder(view: View) : RecyclerView.ViewHolder(view) {
|
||||
val leftIcon: ImageView = view.findViewById(R.id.leftIcon)
|
||||
val carId: TextView = view.findViewById(R.id.carId)
|
||||
val flight: TextView = view.findViewById(R.id.flight)
|
||||
val countryType: TextView = view.findViewById(R.id.countryType)
|
||||
val opDate: TextView = view.findViewById(R.id.opDate)
|
||||
val opId: TextView = view.findViewById(R.id.opId)
|
||||
|
||||
val delete: TextView = view.findViewById(R.id.delete)
|
||||
}
|
||||
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
|
||||
val view = LayoutInflater.from(parent.context).inflate(R.layout.mit_in_pack_list_item, parent, false)
|
||||
val viewHolder = ViewHolder(view)
|
||||
|
||||
viewHolder.itemView.isClickable = true
|
||||
|
||||
return ViewHolder(view)
|
||||
}
|
||||
|
||||
override fun onBindViewHolder(holder: ViewHolder, position: Int) {
|
||||
val collect = collectList[position]
|
||||
|
||||
holder.carId.text = collect.carId
|
||||
holder.flight.text = collect.flight
|
||||
holder.countryType.text = collect.countryType
|
||||
holder.opDate.text = collect.opDate
|
||||
holder.opId.text = collect.opId
|
||||
|
||||
holder.delete.setOnClickListener {
|
||||
Common.secondConfirmDialog(activity, "确认删除?") { dialog ->
|
||||
dialog.dismiss()
|
||||
viewModel.delete(collect.id, collect.carId)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun getItemCount() = collectList.size
|
||||
|
||||
fun append(mitInPackListModel: MitInPackListModel) {
|
||||
collectList.add(mitInPackListModel)
|
||||
notifyDataSetChanged()
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,120 @@
|
||||
package com.lukouguoji.mit.adapt
|
||||
|
||||
import android.app.Activity
|
||||
import android.app.AlertDialog
|
||||
import android.content.DialogInterface
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.EditText
|
||||
import android.widget.ImageView
|
||||
import android.widget.TextView
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.lukouguoji.mit.R
|
||||
import com.lukouguoji.mit.model.OutLoadingPullModel
|
||||
import com.lukouguoji.mit.viewModel.OutLoadingPullViewModel
|
||||
import com.lukouguoji.module_base.util.Arith
|
||||
|
||||
class OutLoadingPullAdapter(
|
||||
val activity: Activity,
|
||||
private val viewModel: OutLoadingPullViewModel,
|
||||
private val collectList: MutableList<OutLoadingPullModel>
|
||||
) :
|
||||
RecyclerView.Adapter<OutLoadingPullAdapter.ViewHolder>() {
|
||||
|
||||
inner class ViewHolder(view: View) : RecyclerView.ViewHolder(view) {
|
||||
val leftIcon: ImageView = view.findViewById(R.id.leftIcon)
|
||||
val wbNo: TextView = view.findViewById(R.id.wbNo)
|
||||
val pc: TextView = view.findViewById(R.id.pc)
|
||||
val weight: TextView = view.findViewById(R.id.weight)
|
||||
val volume: TextView = view.findViewById(R.id.volume)
|
||||
val location: TextView = view.findViewById(R.id.location)
|
||||
}
|
||||
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
|
||||
val view = LayoutInflater.from(parent.context).inflate(R.layout.out_loading_pull_list_item, parent, false)
|
||||
val viewHolder = ViewHolder(view)
|
||||
|
||||
viewHolder.itemView.setOnClickListener {
|
||||
|
||||
var adapterPosition = viewHolder.absoluteAdapterPosition
|
||||
if (adapterPosition < 0 || collectList.isEmpty()) {
|
||||
return@setOnClickListener
|
||||
}
|
||||
val builder: AlertDialog.Builder = AlertDialog.Builder(activity)
|
||||
builder.setTitle("请填写拉货件数、重量")
|
||||
// 通过LayoutInflater来加载一个xml的布局文件作为一个View对象
|
||||
val viewDialog: View = LayoutInflater.from(activity).inflate(
|
||||
R.layout.out_loading_pull_sub_dialog, null
|
||||
)
|
||||
// 设置我们自己定义的布局文件作为弹出框的Content
|
||||
builder.setView(viewDialog)
|
||||
|
||||
val wbNo = viewDialog.findViewById<TextView>(R.id.wbNo)
|
||||
val pc = viewDialog.findViewById<EditText>(R.id.pc)
|
||||
val weight = viewDialog.findViewById<EditText>(R.id.weight)
|
||||
|
||||
wbNo.text = collectList[adapterPosition].wbNo
|
||||
/*pc.setText(collectList[adapterPosition].pc.toString())
|
||||
weight.setText(collectList[adapterPosition].weight.toString())*/
|
||||
|
||||
pc?.requestFocus()
|
||||
|
||||
builder.setPositiveButton("确定",
|
||||
DialogInterface.OnClickListener { dialog, which ->
|
||||
//确定操作的内容
|
||||
collectList[adapterPosition].pc = pc.text.toString().toInt()
|
||||
collectList[adapterPosition].weight = weight.text.toString().toDouble()
|
||||
collectList[adapterPosition].volume = Arith.div(weight.text.toString().toDouble(), 220.0, 2)
|
||||
notifyDataSetChanged()
|
||||
dialog.dismiss()
|
||||
})
|
||||
|
||||
builder.setNegativeButton("取消",
|
||||
DialogInterface.OnClickListener { dialog, which ->
|
||||
dialog.dismiss()
|
||||
})
|
||||
builder.show()
|
||||
|
||||
}
|
||||
|
||||
return viewHolder
|
||||
}
|
||||
|
||||
override fun onBindViewHolder(holder: ViewHolder, position: Int) {
|
||||
val collect = collectList[position]
|
||||
|
||||
val leftIcon = holder.leftIcon
|
||||
//选中
|
||||
if (collect.isCheck) {
|
||||
leftIcon.setImageResource(R.mipmap.left_icon_check)
|
||||
} else {
|
||||
leftIcon.setImageResource(R.mipmap.gnc_ware_house_left_icon)
|
||||
}
|
||||
|
||||
holder.wbNo.text = collect.wbNo
|
||||
holder.pc.text = "${collect.pc}"
|
||||
holder.weight.text = "${collect.weight} KG"
|
||||
holder.volume.text = "${collect.volume}"
|
||||
holder.location.text = "${collect.location}"
|
||||
|
||||
leftIcon.setOnClickListener {
|
||||
collect.isCheck = !collect.isCheck
|
||||
if (collect.isCheck) {
|
||||
viewModel.plusOne()
|
||||
} else {
|
||||
viewModel.subOne()
|
||||
}
|
||||
notifyDataSetChanged() // 更新数据
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
override fun getItemCount() = collectList.size
|
||||
|
||||
fun append(outLoadingPullModel: OutLoadingPullModel) {
|
||||
collectList.add(outLoadingPullModel)
|
||||
notifyDataSetChanged()
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,172 @@
|
||||
package com.lukouguoji.mit.adapt
|
||||
|
||||
import android.app.Activity
|
||||
import android.net.Uri
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.ImageView
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.bumptech.glide.Glide
|
||||
import com.bumptech.glide.load.engine.DiskCacheStrategy
|
||||
import com.bumptech.glide.load.model.GlideUrl
|
||||
import com.bumptech.glide.load.model.LazyHeaders
|
||||
import com.luck.picture.lib.entity.LocalMedia
|
||||
import com.lukouguoji.mit.R
|
||||
import com.lukouguoji.mit.viewModel.AccidentVisaInfoViewModel
|
||||
import com.lukouguoji.module_base.common.Constant
|
||||
import com.lukouguoji.module_base.db.perference.SharedPreferenceUtil
|
||||
import com.lukouguoji.module_base.util.Common
|
||||
|
||||
|
||||
class PictureAdapter(
|
||||
val activity: Activity,
|
||||
private val viewModel: AccidentVisaInfoViewModel,
|
||||
private val list: ArrayList<LocalMedia>
|
||||
) :
|
||||
RecyclerView.Adapter<PictureAdapter.ViewHolder>() {
|
||||
|
||||
private var selectMax = 9
|
||||
val TYPE_CAMERA = 1
|
||||
val TYPE_PICTURE = 2
|
||||
|
||||
fun setSelectMax(selectMax: Int) {
|
||||
this.selectMax = selectMax
|
||||
}
|
||||
|
||||
fun getSelectMax(): Int {
|
||||
return selectMax
|
||||
}
|
||||
|
||||
fun getData(): ArrayList<LocalMedia>? {
|
||||
return list
|
||||
}
|
||||
|
||||
fun remove(position: Int) {
|
||||
if (position < list.size) {
|
||||
list.removeAt(position)
|
||||
}
|
||||
}
|
||||
|
||||
inner class ViewHolder(view: View) : RecyclerView.ViewHolder(view) {
|
||||
val mImg: ImageView = view.findViewById(R.id.fiv)
|
||||
val mIvDel: ImageView = view.findViewById(R.id.iv_del)
|
||||
|
||||
}
|
||||
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
|
||||
val view = LayoutInflater.from(parent.context).inflate(R.layout.accident_visa_image_item, parent, false)
|
||||
return ViewHolder(view)
|
||||
}
|
||||
|
||||
override fun onBindViewHolder(viewHolder: ViewHolder, position: Int) {
|
||||
|
||||
//少于MaxSize张,显示继续添加的图标
|
||||
if (getItemViewType(position) == TYPE_CAMERA) {
|
||||
viewHolder.mImg.setImageResource(R.mipmap.ic_add_image)
|
||||
viewHolder.mImg.setOnClickListener(View.OnClickListener {
|
||||
mItemClickListener?.openPicture()
|
||||
})
|
||||
viewHolder.mIvDel.setVisibility(View.INVISIBLE)
|
||||
} else {
|
||||
viewHolder.mIvDel.setVisibility(View.VISIBLE)
|
||||
//删除图片
|
||||
viewHolder.mIvDel.setOnClickListener(View.OnClickListener { view: View? ->
|
||||
Common.secondConfirmDialog(activity, "确认删除?") { dialog ->
|
||||
dialog.dismiss()
|
||||
val index: Int = viewHolder.absoluteAdapterPosition
|
||||
if (index != RecyclerView.NO_POSITION && list.size > index) {
|
||||
//删除服务器图片
|
||||
var delModel = list[index]
|
||||
var fileName = delModel.fileName
|
||||
var realName = viewModel.imageKeyValue[fileName]
|
||||
if (realName != null && realName != "") {
|
||||
viewModel.deleteImg(realName)
|
||||
} else {
|
||||
viewModel.deleteImg(fileName)
|
||||
}
|
||||
//删除本地图片
|
||||
list.removeAt(index)
|
||||
notifyItemRemoved(index)
|
||||
notifyItemRangeChanged(index, list.size)
|
||||
}
|
||||
}
|
||||
})
|
||||
val media: LocalMedia = list[position]
|
||||
val path = media.availablePath
|
||||
|
||||
val tokenGlide = GlideUrl(
|
||||
path,
|
||||
LazyHeaders.Builder().addHeader("Authorization", SharedPreferenceUtil.getString(Constant.Share.token)).build()
|
||||
)
|
||||
//网络图片地址渲染
|
||||
if(media.realPath == null){
|
||||
Glide.with(viewHolder.itemView.getContext())
|
||||
.load(tokenGlide)
|
||||
.centerCrop()
|
||||
.placeholder(R.color.white)
|
||||
.diskCacheStrategy(DiskCacheStrategy.ALL)
|
||||
.into(viewHolder.mImg)
|
||||
}
|
||||
//本地渲染
|
||||
else{
|
||||
Glide.with(viewHolder.itemView.getContext())
|
||||
.load(path)
|
||||
.centerCrop()
|
||||
.placeholder(R.color.white)
|
||||
.diskCacheStrategy(DiskCacheStrategy.ALL)
|
||||
.into(viewHolder.mImg)
|
||||
}
|
||||
|
||||
|
||||
//itemView 的点击事件
|
||||
if (mItemClickListener != null) {
|
||||
viewHolder.itemView.setOnClickListener(View.OnClickListener { v: View? ->
|
||||
val adapterPosition: Int = viewHolder.getAbsoluteAdapterPosition()
|
||||
mItemClickListener!!.onItemClick(v, adapterPosition)
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun getItemCount() = if (list.size < getSelectMax()) {
|
||||
list.size + 1
|
||||
} else {
|
||||
list.size
|
||||
}
|
||||
|
||||
override fun getItemViewType(position: Int): Int {
|
||||
return if (isShowAddItem(position)) {
|
||||
TYPE_CAMERA
|
||||
} else {
|
||||
TYPE_PICTURE
|
||||
}
|
||||
}
|
||||
|
||||
private fun isShowAddItem(position: Int): Boolean {
|
||||
val size: Int = list.size
|
||||
return position == size
|
||||
}
|
||||
|
||||
private var mItemClickListener: OnItemClickListener? = null
|
||||
|
||||
fun setOnItemClickListener(l: OnItemClickListener?) {
|
||||
mItemClickListener = l
|
||||
}
|
||||
|
||||
|
||||
interface OnItemClickListener {
|
||||
/**
|
||||
* Item click event
|
||||
*
|
||||
* @param v
|
||||
* @param position
|
||||
*/
|
||||
fun onItemClick(v: View?, position: Int)
|
||||
|
||||
/**
|
||||
* Open PictureSelector
|
||||
*/
|
||||
fun openPicture()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.lukouguoji.gnj.common
|
||||
|
||||
interface MitCommon {
|
||||
/**
|
||||
* 舱单
|
||||
*/
|
||||
interface AccidentVisa {
|
||||
interface Ref {
|
||||
companion object {
|
||||
const val read = "1"//查看
|
||||
}
|
||||
}
|
||||
interface Info {
|
||||
companion object {
|
||||
const val read = "1"//查看
|
||||
const val add = "2"//新增
|
||||
const val update = "3"//修改
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,178 @@
|
||||
package com.lukouguoji.mit.model
|
||||
|
||||
import com.alibaba.fastjson.JSONArray
|
||||
|
||||
class AccidentVisaInfoItemModel(
|
||||
val isMust: Boolean,//是否必选
|
||||
val isEnable: Boolean,//是否允许操作
|
||||
val titleName: String,//字段名
|
||||
val titleCode: String,//字段code名
|
||||
val isSel: Boolean,//是否下拉框
|
||||
|
||||
var inputContent: String,//输入框内容
|
||||
|
||||
val selList: JSONArray?,//下拉框数据集合
|
||||
var selContentCode: String,//下拉框code
|
||||
|
||||
val titleCodePre: String?,
|
||||
var inputContentPre: String?,//输入框内容前缀
|
||||
val ymdhms: Boolean?, //日期格式 true: 日期格式 yyyy-MM-dd HH:mm:ss false: yyyy-MM-dd
|
||||
val scan: Boolean?, //是否支持扫描
|
||||
val scanResultCode: Int? //扫描回调的code值 scan=false 不需要填
|
||||
) {
|
||||
|
||||
/**
|
||||
* 1.输入框构造
|
||||
*/
|
||||
constructor(
|
||||
isMust: Boolean,
|
||||
isEnable: Boolean,
|
||||
titleName: String,
|
||||
titleCode: String,
|
||||
inputContent: String
|
||||
) : this(
|
||||
isMust,
|
||||
isEnable,
|
||||
titleName,
|
||||
titleCode,
|
||||
false,
|
||||
inputContent,
|
||||
null,
|
||||
"",
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null
|
||||
)
|
||||
|
||||
/**
|
||||
* 2.输入框构造 带扫描功能
|
||||
*/
|
||||
constructor(
|
||||
isMust: Boolean,
|
||||
isEnable: Boolean,
|
||||
titleName: String,
|
||||
titleCode: String,
|
||||
inputContent: String,
|
||||
scan: Boolean,
|
||||
scanResultCode: Int
|
||||
) : this(
|
||||
isMust,
|
||||
isEnable,
|
||||
titleName,
|
||||
titleCode,
|
||||
false,
|
||||
inputContent,
|
||||
null,
|
||||
"",
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
scan,
|
||||
scanResultCode
|
||||
)
|
||||
|
||||
/**
|
||||
* 3. 2个输入框构造 运单
|
||||
*/
|
||||
constructor(
|
||||
isMust: Boolean,
|
||||
isEnable: Boolean,
|
||||
titleName: String,
|
||||
titleCode: String,
|
||||
inputContent: String,
|
||||
titleCodePre: String,
|
||||
inputContentPre: String
|
||||
) : this(
|
||||
isMust,
|
||||
isEnable,
|
||||
titleName,
|
||||
titleCode,
|
||||
false,
|
||||
inputContent,
|
||||
null,
|
||||
"",
|
||||
titleCodePre,
|
||||
inputContentPre,
|
||||
null,
|
||||
null,
|
||||
null
|
||||
)
|
||||
|
||||
/**
|
||||
* 4. 2个输入框构造 运单 带扫描
|
||||
*/
|
||||
constructor(
|
||||
isMust: Boolean,
|
||||
isEnable: Boolean,
|
||||
titleName: String,
|
||||
titleCode: String,
|
||||
inputContent: String,
|
||||
titleCodePre: String,
|
||||
inputContentPre: String,
|
||||
scan: Boolean,
|
||||
scanResultCode: Int
|
||||
) : this(
|
||||
isMust,
|
||||
isEnable,
|
||||
titleName,
|
||||
titleCode,
|
||||
false,
|
||||
inputContent,
|
||||
null,
|
||||
"",
|
||||
titleCodePre,
|
||||
inputContentPre,
|
||||
null,
|
||||
scan,
|
||||
scanResultCode
|
||||
)
|
||||
|
||||
|
||||
/**
|
||||
* 下拉框构造
|
||||
*/
|
||||
constructor(
|
||||
isMust: Boolean, isEnable: Boolean, titleName: String, titleCode: String,
|
||||
selList: JSONArray,
|
||||
selContentCode: String
|
||||
) : this(
|
||||
isMust,
|
||||
isEnable,
|
||||
titleName,
|
||||
titleCode,
|
||||
true,
|
||||
"",
|
||||
selList,
|
||||
selContentCode,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null
|
||||
)
|
||||
|
||||
/**
|
||||
* 日期下拉框构造
|
||||
* ymdhms true 日期格式 yyyy-MM-dd HH:mm:ss false: yyyy-MM-dd
|
||||
*/
|
||||
constructor(
|
||||
isMust: Boolean, isEnable: Boolean, titleName: String, titleCode: String, ymdhms: Boolean, selContentCode: String
|
||||
) : this(
|
||||
isMust,
|
||||
isEnable,
|
||||
titleName,
|
||||
titleCode,
|
||||
true,
|
||||
"",
|
||||
null,
|
||||
selContentCode,
|
||||
null,
|
||||
null,
|
||||
ymdhms,
|
||||
null,
|
||||
null
|
||||
)
|
||||
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package com.lukouguoji.mit.model
|
||||
|
||||
class AccidentVisaModel(
|
||||
val id: Int,
|
||||
val wbNo: String,//)运单号 -wbNo
|
||||
val areaFlag: String,//地区类型
|
||||
val ieFlag: String,//进出港
|
||||
val dpc: String,//不正常件数
|
||||
val opId: String,//操作人
|
||||
val opDate: String//操作时间
|
||||
)
|
||||
@@ -0,0 +1,10 @@
|
||||
package com.lukouguoji.mit.model
|
||||
|
||||
class MitInPackListModel(
|
||||
val id: Int,
|
||||
val carId: String,//板车号
|
||||
val flight: String,//航班
|
||||
val countryType: String,//地区类型
|
||||
val opDate: String,//装板时间
|
||||
val opId: String//确认人
|
||||
)
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.lukouguoji.mit.model
|
||||
|
||||
class OutLoadingPullModel(
|
||||
val wbNo: String,
|
||||
val mfId: Int,
|
||||
val whId: Int,
|
||||
var pc: Int, //件数
|
||||
var weight: Double, //重量
|
||||
var volume: Double, //重量
|
||||
var location: String, //板车号
|
||||
|
||||
var isCheck: Boolean, //复选框 选中
|
||||
)
|
||||
@@ -0,0 +1,103 @@
|
||||
package com.lukouguoji.mit.uitl;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
/**
|
||||
* @author:luck
|
||||
* @date:2016/12/31 2:26 下午
|
||||
* @describe:PictureOnlyCameraFragment
|
||||
*/
|
||||
|
||||
public class FullyGridLayoutManager extends GridLayoutManager {
|
||||
private final int[] mMeasuredDimension = new int[2];
|
||||
|
||||
public FullyGridLayoutManager(Context context, int spanCount) {
|
||||
super(context, spanCount);
|
||||
}
|
||||
|
||||
public FullyGridLayoutManager(Context context, int spanCount, int orientation, boolean reverseLayout) {
|
||||
super(context, spanCount, orientation, reverseLayout);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMeasure(@NonNull RecyclerView.Recycler recycler, @NonNull RecyclerView.State state, int widthSpec, int heightSpec) {
|
||||
final int widthMode = View.MeasureSpec.getMode(widthSpec);
|
||||
final int heightMode = View.MeasureSpec.getMode(heightSpec);
|
||||
final int widthSize = View.MeasureSpec.getSize(widthSpec);
|
||||
final int heightSize = View.MeasureSpec.getSize(heightSpec);
|
||||
|
||||
int width = 0;
|
||||
int height = 0;
|
||||
int count = getItemCount();
|
||||
int span = getSpanCount();
|
||||
for (int i = 0; i < count; i++) {
|
||||
measureScrapChild(recycler, i,
|
||||
View.MeasureSpec.makeMeasureSpec(i, View.MeasureSpec.UNSPECIFIED),
|
||||
View.MeasureSpec.makeMeasureSpec(i, View.MeasureSpec.UNSPECIFIED),
|
||||
mMeasuredDimension);
|
||||
|
||||
if (getOrientation() == HORIZONTAL) {
|
||||
if (i % span == 0) {
|
||||
width = width + mMeasuredDimension[0];
|
||||
}
|
||||
if (i == 0) {
|
||||
height = mMeasuredDimension[1];
|
||||
}
|
||||
} else {
|
||||
if (i % span == 0) {
|
||||
height = height + mMeasuredDimension[1];
|
||||
}
|
||||
if (i == 0) {
|
||||
width = mMeasuredDimension[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
switch (widthMode) {
|
||||
case View.MeasureSpec.EXACTLY:
|
||||
width = widthSize;
|
||||
case View.MeasureSpec.AT_MOST:
|
||||
case View.MeasureSpec.UNSPECIFIED:
|
||||
}
|
||||
|
||||
switch (heightMode) {
|
||||
case View.MeasureSpec.EXACTLY:
|
||||
height = heightSize;
|
||||
case View.MeasureSpec.AT_MOST:
|
||||
case View.MeasureSpec.UNSPECIFIED:
|
||||
}
|
||||
|
||||
setMeasuredDimension(width, height);
|
||||
}
|
||||
|
||||
final RecyclerView.State mState = new RecyclerView.State();
|
||||
|
||||
private void measureScrapChild(RecyclerView.Recycler recycler, int position, int widthSpec,
|
||||
int heightSpec, int[] measuredDimension) {
|
||||
int itemCount = mState.getItemCount();
|
||||
if (position < itemCount) {
|
||||
try {
|
||||
View view = recycler.getViewForPosition(0);
|
||||
if (view != null) {
|
||||
RecyclerView.LayoutParams p = (RecyclerView.LayoutParams) view.getLayoutParams();
|
||||
int childWidthSpec = ViewGroup.getChildMeasureSpec(widthSpec,
|
||||
getPaddingLeft() + getPaddingRight(), p.width);
|
||||
int childHeightSpec = ViewGroup.getChildMeasureSpec(heightSpec,
|
||||
getPaddingTop() + getPaddingBottom(), p.height);
|
||||
view.measure(childWidthSpec, childHeightSpec);
|
||||
measuredDimension[0] = view.getMeasuredWidth() + p.leftMargin + p.rightMargin;
|
||||
measuredDimension[1] = view.getMeasuredHeight() + p.bottomMargin + p.topMargin;
|
||||
recycler.recycleView(view);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,111 @@
|
||||
package com.lukouguoji.mit.uitl;
|
||||
|
||||
import android.content.Context;
|
||||
import android.widget.ImageView;
|
||||
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.bumptech.glide.load.resource.bitmap.CenterCrop;
|
||||
import com.bumptech.glide.load.resource.bitmap.RoundedCorners;
|
||||
import com.luck.picture.lib.engine.ImageEngine;
|
||||
import com.luck.picture.lib.utils.ActivityCompatHelper;
|
||||
import com.lukouguoji.mit.R;
|
||||
|
||||
/**
|
||||
* @author:luck
|
||||
* @date:2019-11-13 17:02
|
||||
* @describe:Glide加载引擎
|
||||
*/
|
||||
public class GlideEngine implements ImageEngine {
|
||||
|
||||
/**
|
||||
* 加载图片
|
||||
*
|
||||
* @param context 上下文
|
||||
* @param url 资源url
|
||||
* @param imageView 图片承载控件
|
||||
*/
|
||||
@Override
|
||||
public void loadImage(Context context, String url, ImageView imageView) {
|
||||
if (!ActivityCompatHelper.assertValidRequest(context)) {
|
||||
return;
|
||||
}
|
||||
Glide.with(context)
|
||||
.load(url)
|
||||
.into(imageView);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadImage(Context context, ImageView imageView, String url, int maxWidth, int maxHeight) {
|
||||
if (!ActivityCompatHelper.assertValidRequest(context)) {
|
||||
return;
|
||||
}
|
||||
Glide.with(context)
|
||||
.load(url)
|
||||
.override(maxWidth, maxHeight)
|
||||
.into(imageView);
|
||||
}
|
||||
|
||||
/**
|
||||
* 加载相册目录封面
|
||||
*
|
||||
* @param context 上下文
|
||||
* @param url 图片路径
|
||||
* @param imageView 承载图片ImageView
|
||||
*/
|
||||
@Override
|
||||
public void loadAlbumCover(Context context, String url, ImageView imageView) {
|
||||
if (!ActivityCompatHelper.assertValidRequest(context)) {
|
||||
return;
|
||||
}
|
||||
Glide.with(context)
|
||||
.asBitmap()
|
||||
.load(url)
|
||||
.override(180, 180)
|
||||
.sizeMultiplier(0.5f)
|
||||
.transform(new CenterCrop(), new RoundedCorners(8))
|
||||
.placeholder(R.drawable.ps_image_placeholder)
|
||||
.into(imageView);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 加载图片列表图片
|
||||
*
|
||||
* @param context 上下文
|
||||
* @param url 图片路径
|
||||
* @param imageView 承载图片ImageView
|
||||
*/
|
||||
@Override
|
||||
public void loadGridImage(Context context, String url, ImageView imageView) {
|
||||
if (!ActivityCompatHelper.assertValidRequest(context)) {
|
||||
return;
|
||||
}
|
||||
Glide.with(context)
|
||||
.load(url)
|
||||
.override(200, 200)
|
||||
.centerCrop()
|
||||
.placeholder(R.drawable.ps_image_placeholder)
|
||||
.into(imageView);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void pauseRequests(Context context) {
|
||||
Glide.with(context).pauseRequests();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void resumeRequests(Context context) {
|
||||
Glide.with(context).resumeRequests();
|
||||
}
|
||||
|
||||
private GlideEngine() {
|
||||
}
|
||||
|
||||
private static final class InstanceHolder {
|
||||
static final GlideEngine instance = new GlideEngine();
|
||||
}
|
||||
|
||||
public static GlideEngine createGlideEngine() {
|
||||
return InstanceHolder.instance;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,322 @@
|
||||
package com.lukouguoji.mit.viewModel
|
||||
|
||||
import android.util.Log
|
||||
import androidx.lifecycle.*
|
||||
import com.alibaba.fastjson.JSONArray
|
||||
import com.alibaba.fastjson.JSONObject
|
||||
import com.lukouguoji.module_base.common.String.emptyToNull
|
||||
import com.lukouguoji.module_base.http.user.UserNetwork
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.flow.MutableSharedFlow
|
||||
import kotlinx.coroutines.flow.catch
|
||||
import kotlinx.coroutines.flow.flow
|
||||
import kotlinx.coroutines.flow.flowOn
|
||||
import kotlinx.coroutines.launch
|
||||
import okhttp3.MultipartBody
|
||||
|
||||
|
||||
class AccidentVisaInfoViewModel : ViewModel() {
|
||||
private val logName = "AccidentVisaInfoViewModel"
|
||||
|
||||
var waybillFormNetWork = JSONObject()
|
||||
|
||||
//本地图片名称和服务器名称映射
|
||||
val imageKeyValue = hashMapOf<String, String>()
|
||||
|
||||
//服务器返回所有的图片名称
|
||||
val imageNamesFromNetWork = arrayListOf<String>()
|
||||
|
||||
/**
|
||||
* 进港 舱单详情
|
||||
*/
|
||||
inner class WaybillParam(val wbId: Int, val wbNo: String?)
|
||||
|
||||
private val wbIdData = MutableLiveData<WaybillParam>()
|
||||
val waybillLiveData = Transformations.switchMap(wbIdData) { param ->
|
||||
liveData(Dispatchers.IO) {
|
||||
try {
|
||||
var response = JSONObject()
|
||||
if (param.wbId != -9999) {
|
||||
response = UserNetwork.queryVisaById(param.wbId)
|
||||
} else if (param.wbNo != null) {
|
||||
// response = UserNetwork.queryFestByWbNoGnjCangDan(param.wbNo)
|
||||
} else {
|
||||
}
|
||||
emit(response)
|
||||
} catch (e: Exception) {
|
||||
Log.e(logName, e.stackTraceToString())
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
fun queryWaybillById(wbId: Int, wbNo: String?) {
|
||||
wbIdData.value = WaybillParam(wbId, wbNo)
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 外包装
|
||||
*/
|
||||
var outerPackageTypeList = JSONArray()
|
||||
private val outerPackageTypeLiveData = MutableLiveData<String>()
|
||||
fun outerPackageType(time: String) {
|
||||
outerPackageTypeLiveData.value = time
|
||||
}
|
||||
|
||||
val outerPackageTypeObserver = Transformations.switchMap(outerPackageTypeLiveData) { _ ->
|
||||
liveData(Dispatchers.IO) {
|
||||
try {
|
||||
var response = UserNetwork.outerPackageType()
|
||||
emit(response)
|
||||
} catch (e: Exception) {
|
||||
Log.e(logName, e.stackTraceToString())
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 包装破损情况
|
||||
*/
|
||||
var damageTypeList = JSONArray()
|
||||
private val damageTypeLiveData = MutableLiveData<String>()
|
||||
fun damageType(type: String) {
|
||||
damageTypeLiveData.value = type
|
||||
}
|
||||
|
||||
val damageTypeObserver = Transformations.switchMap(damageTypeLiveData) { type ->
|
||||
liveData(Dispatchers.IO) {
|
||||
try {
|
||||
var response = UserNetwork.damageType()
|
||||
emit(response)
|
||||
} catch (e: Exception) {
|
||||
Log.e(logName, e.stackTraceToString())
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 内容物情况
|
||||
*/
|
||||
var contentTypeList = JSONArray()
|
||||
private val contentTypeLiveData = MutableLiveData<String>()
|
||||
fun contentType(time: String) {
|
||||
contentTypeLiveData.value = time
|
||||
}
|
||||
|
||||
val contentTypeObserver = Transformations.switchMap(contentTypeLiveData) { _ ->
|
||||
liveData(Dispatchers.IO) {
|
||||
try {
|
||||
var response = UserNetwork.contentType()
|
||||
emit(response)
|
||||
} catch (e: Exception) {
|
||||
Log.e(logName, e.stackTraceToString())
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 不正常类型
|
||||
*/
|
||||
var unusualTypeList = JSONArray()
|
||||
private val unusualTypeLiveData = MutableLiveData<String>()
|
||||
fun unusualType(time: String) {
|
||||
unusualTypeLiveData.value = time
|
||||
}
|
||||
|
||||
val unusualTypeObserver = Transformations.switchMap(unusualTypeLiveData) { _ ->
|
||||
liveData(Dispatchers.IO) {
|
||||
try {
|
||||
var response = UserNetwork.unusualType()
|
||||
emit(response)
|
||||
} catch (e: Exception) {
|
||||
Log.e(logName, e.stackTraceToString())
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取发现时间类型
|
||||
*/
|
||||
var searchDateTypeList = JSONArray()
|
||||
private val searchDateTypeLiveData = MutableLiveData<String>()
|
||||
fun searchDateType(time: String) {
|
||||
searchDateTypeLiveData.value = time
|
||||
}
|
||||
|
||||
val searchDateTypeObserver = Transformations.switchMap(searchDateTypeLiveData) { _ ->
|
||||
liveData(Dispatchers.IO) {
|
||||
try {
|
||||
var response = UserNetwork.searchDateType()
|
||||
emit(response)
|
||||
} catch (e: Exception) {
|
||||
Log.e(logName, e.stackTraceToString())
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 进港 新增舱单
|
||||
*/
|
||||
private val saveFestGnjCangDanLiveData = MutableLiveData<JSONObject>()
|
||||
val saveFestGnjCangDanObserver = Transformations.switchMap(saveFestGnjCangDanLiveData) { param ->
|
||||
liveData(Dispatchers.IO) {
|
||||
try {
|
||||
var response = UserNetwork.saveVisa(param)
|
||||
emit(response)
|
||||
|
||||
} catch (e: Exception) {
|
||||
Log.e(logName, e.stackTraceToString())
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
fun saveFestGnjCangDan(
|
||||
paramObj: JSONObject
|
||||
) {
|
||||
saveFestGnjCangDanLiveData.value = paramObj
|
||||
}
|
||||
|
||||
/**
|
||||
* 进港 修改舱单
|
||||
*/
|
||||
private val updateFestGnjCangDanLiveData = MutableLiveData<JSONObject>()
|
||||
val updateFestGnjCangDanObserver = Transformations.switchMap(updateFestGnjCangDanLiveData) { param ->
|
||||
liveData(Dispatchers.IO) {
|
||||
try {
|
||||
var response = UserNetwork.updateVisa(param)
|
||||
emit(response)
|
||||
|
||||
} catch (e: Exception) {
|
||||
Log.e(logName, e.stackTraceToString())
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
fun updateFestGnjCangDan(paramObj: JSONObject) {
|
||||
updateFestGnjCangDanLiveData.value = paramObj
|
||||
}
|
||||
|
||||
/**
|
||||
* 上传图片
|
||||
*/
|
||||
/*private val uploadImgLiveData = MutableLiveData<MultipartBody.Part>()
|
||||
val uploadImgObserver = Transformations.switchMap(uploadImgLiveData) { param ->
|
||||
liveData(Dispatchers.IO) {
|
||||
try {
|
||||
var response = UserNetwork.uploadImg(param)
|
||||
emit(response)
|
||||
|
||||
} catch (e: Exception) {
|
||||
Log.e(logName, e.stackTraceToString())
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
fun uploadImg(
|
||||
file: MultipartBody.Part
|
||||
) {
|
||||
uploadImgLiveData.value = file
|
||||
}*/
|
||||
|
||||
val uploadImgObserver = MutableSharedFlow<JSONObject>(replay = 1)
|
||||
fun uploadImg(file: MultipartBody.Part) {
|
||||
viewModelScope.launch {
|
||||
flow {
|
||||
val response = UserNetwork.uploadImg(file)
|
||||
//返回结果
|
||||
emit(response)
|
||||
}.flowOn(Dispatchers.Default)
|
||||
.catch { e ->
|
||||
Log.e("GnjChuKuListViewModel", e.stackTraceToString())
|
||||
}
|
||||
.collect { response ->
|
||||
uploadImgObserver.emit(response)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 删除图片
|
||||
*/
|
||||
private val deleteImgLiveData = MutableLiveData<String>()
|
||||
val deleteImgObserver = Transformations.switchMap(deleteImgLiveData) { param ->
|
||||
liveData(Dispatchers.IO) {
|
||||
try {
|
||||
var response = UserNetwork.deleteImg(param)
|
||||
emit(response)
|
||||
} catch (e: Exception) {
|
||||
Log.e(logName, e.stackTraceToString())
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
fun deleteImg(name: String) {
|
||||
deleteImgLiveData.value = name
|
||||
}
|
||||
|
||||
/**
|
||||
* 上传图片数组
|
||||
*/
|
||||
private val uploadImgListLiveData = MutableLiveData<List<MultipartBody.Part>>()
|
||||
val uploadImgListObserver = Transformations.switchMap(uploadImgListLiveData) { param ->
|
||||
liveData(Dispatchers.IO) {
|
||||
try {
|
||||
var response = UserNetwork.uploadImgList(param)
|
||||
emit(response)
|
||||
|
||||
} catch (e: Exception) {
|
||||
Log.e(logName, e.stackTraceToString())
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
fun uploadImgList(
|
||||
files: List<MultipartBody.Part>
|
||||
) {
|
||||
uploadImgListLiveData.value = files
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询航班
|
||||
*/
|
||||
private val queryFlightLiveData = MutableLiveData<JSONObject>()
|
||||
val queryFlightObserver = Transformations.switchMap(queryFlightLiveData) { param ->
|
||||
liveData(Dispatchers.IO) {
|
||||
try {
|
||||
val response = UserNetwork.queryFlightMitInPack(param)
|
||||
emit(response)
|
||||
} catch (e: Exception) {
|
||||
Log.e(logName, e.stackTraceToString())
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
fun queryFlight(fdate: String, fno: String) {
|
||||
val temObj = JSONObject()
|
||||
temObj["countryType"] = null
|
||||
temObj["fclose"] = null
|
||||
temObj["fdate"] = fdate.emptyToNull()
|
||||
temObj["fdep"] = null
|
||||
temObj["fdest"] = null
|
||||
temObj["fid"] = null
|
||||
temObj["fno"] = fno.emptyToNull()
|
||||
temObj["mclose"] = null
|
||||
|
||||
|
||||
queryFlightLiveData.value = temObj
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,82 @@
|
||||
package com.lukouguoji.mit.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.common.String.emptyToNull
|
||||
import com.lukouguoji.module_base.http.user.UserNetwork
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlin.collections.set
|
||||
|
||||
class AccidentVisaViewModel : ViewModel() {
|
||||
|
||||
private val logName = "AccidentVisaViewModel"
|
||||
|
||||
/**
|
||||
* 分页搜索
|
||||
*/
|
||||
private val searchParam = MutableLiveData<JSONObject>()
|
||||
val searchParamLive = Transformations.switchMap(searchParam) { param ->
|
||||
liveData(Dispatchers.IO) {
|
||||
try {
|
||||
val response = UserNetwork.searchVisa(param)
|
||||
emit(response)
|
||||
} catch (e: Exception) {
|
||||
Log.e(logName, e.stackTraceToString())
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
fun search(
|
||||
limit: Int,
|
||||
page: Int,
|
||||
beginDate: String,
|
||||
endDate: String,
|
||||
areaType: String,
|
||||
ieFlag: String,
|
||||
wbNo: String,
|
||||
opId: String
|
||||
) {
|
||||
|
||||
val param = JSONObject()
|
||||
param["limit"] = limit
|
||||
param["page"] = page
|
||||
param["beginDate"] = beginDate.emptyToNull()
|
||||
param["endDate"] = endDate.emptyToNull()
|
||||
param["areaType"] = areaType.emptyToNull()
|
||||
param["ieFlag"] = ieFlag.emptyToNull()
|
||||
param["wbNo"] = wbNo.emptyToNull()
|
||||
param["opId"] = opId.emptyToNull()
|
||||
|
||||
|
||||
searchParam.value = param
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除行
|
||||
*/
|
||||
inner class AccidentVisaDel(val id: Int, val position: Int)
|
||||
|
||||
private val deleteLineLiveData = MutableLiveData<AccidentVisaDel>()
|
||||
val deleteLineObserver = Transformations.switchMap(deleteLineLiveData) { param ->
|
||||
liveData(Dispatchers.IO) {
|
||||
try {
|
||||
val response = UserNetwork.deleteVisa(param.id)
|
||||
response["positionDel"] = param.position
|
||||
emit(response)
|
||||
} catch (e: Exception) {
|
||||
Log.e("GoutCollectionViewModel", e.stackTraceToString())
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
fun deleteLine(id: Int, position: Int) {
|
||||
deleteLineLiveData.value = AccidentVisaDel(id, position)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.lukouguoji.mit.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 MitInPackInfoViewModel : ViewModel() {
|
||||
|
||||
/**
|
||||
* 完成复磅
|
||||
*/
|
||||
private val completedLiveData = MutableLiveData<JSONObject>()
|
||||
val completedObserver = Transformations.switchMap(completedLiveData) { param ->
|
||||
liveData(Dispatchers.IO) {
|
||||
try {
|
||||
val response = UserNetwork.completedMitInPack(param!!)
|
||||
emit(response)
|
||||
} catch (e: Exception) {
|
||||
Log.e("GoutStartViewModel", e.stackTraceToString())
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
fun completed(fid: Int, carId: String) {
|
||||
val jsonObject = JSONObject()
|
||||
jsonObject["fid"] = fid
|
||||
jsonObject["carId"] = carId
|
||||
completedLiveData.value = jsonObject
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,143 @@
|
||||
package com.lukouguoji.mit.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.common.String.emptyToNull
|
||||
import com.lukouguoji.module_base.http.user.UserNetwork
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlin.collections.set
|
||||
|
||||
class MitInPackListViewModel : ViewModel() {
|
||||
|
||||
private val logName = "MitInPackListViewModel"
|
||||
|
||||
/**
|
||||
* 航班号
|
||||
*/
|
||||
var fid: Int? = null
|
||||
var fdate: String? = null
|
||||
var fno: String? = null
|
||||
var countryName: String? = null
|
||||
var fdep: String? = null
|
||||
var fdest: String? = null
|
||||
|
||||
|
||||
/**
|
||||
* 分页搜索
|
||||
*/
|
||||
private val searchParam = MutableLiveData<JSONObject>()
|
||||
val searchParamLive = Transformations.switchMap(searchParam) { param ->
|
||||
liveData(Dispatchers.IO) {
|
||||
try {
|
||||
val response = UserNetwork.searchMitInPack(param)
|
||||
emit(response)
|
||||
} catch (e: Exception) {
|
||||
Log.e(logName, e.stackTraceToString())
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
fun search(
|
||||
limit: Int,
|
||||
page: Int,
|
||||
carrier: String,
|
||||
beginDate: String,
|
||||
endDate: String,
|
||||
fdate: String,//航班日期
|
||||
fno: String,//航班编码
|
||||
dest: String,//目的港
|
||||
location: String,//舱位
|
||||
range: String,
|
||||
status: String,
|
||||
wbNo: String,
|
||||
groupName: String,
|
||||
agentCode: String,
|
||||
awbType: String,
|
||||
businessType: String,
|
||||
goods: String,
|
||||
spCode: String
|
||||
) {
|
||||
|
||||
val param = JSONObject()
|
||||
param["limit"] = limit
|
||||
param["page"] = page
|
||||
param["carrier"] = carrier.emptyToNull()
|
||||
param["beginDate"] = beginDate.emptyToNull()
|
||||
param["endDate"] = endDate.emptyToNull()
|
||||
param["fdate"] = fdate.emptyToNull()
|
||||
param["dest"] = dest.emptyToNull()
|
||||
param["fno"] = fno.emptyToNull()
|
||||
param["location"] = location.emptyToNull()
|
||||
param["range"] = range.emptyToNull()
|
||||
param["locStatus"] = status.emptyToNull()
|
||||
param["wbNo"] = wbNo.emptyToNull()
|
||||
param["groupName"] = groupName.emptyToNull()
|
||||
param["agentCode"] = agentCode.emptyToNull()
|
||||
param["awbType"] = awbType.emptyToNull()
|
||||
param["businessType"] = businessType.emptyToNull()
|
||||
param["goods"] = goods.emptyToNull()
|
||||
param["spCode"] = spCode.emptyToNull()
|
||||
|
||||
searchParam.value = param
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询航班
|
||||
*/
|
||||
private val queryFlightLiveData = MutableLiveData<JSONObject>()
|
||||
val queryFlightObserver = Transformations.switchMap(queryFlightLiveData) { param ->
|
||||
liveData(Dispatchers.IO) {
|
||||
try {
|
||||
val response = UserNetwork.queryFlightMitInPack(param)
|
||||
emit(response)
|
||||
} catch (e: Exception) {
|
||||
Log.e(logName, e.stackTraceToString())
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
fun queryFlight(fdate: String, fno: String) {
|
||||
val temObj = JSONObject()
|
||||
temObj["countryType"] = null
|
||||
temObj["fclose"] = null
|
||||
temObj["fdate"] = fdate.emptyToNull()
|
||||
temObj["fdep"] = null
|
||||
temObj["fdest"] = null
|
||||
temObj["fid"] = null
|
||||
temObj["fno"] = fno.emptyToNull()
|
||||
temObj["mclose"] = null
|
||||
|
||||
|
||||
queryFlightLiveData.value = temObj
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除行
|
||||
*/
|
||||
private val deleteLiveData = MutableLiveData<JSONObject>()
|
||||
val deleteObserver = Transformations.switchMap(deleteLiveData) { param ->
|
||||
liveData(Dispatchers.IO) {
|
||||
try {
|
||||
val response = UserNetwork.deleteMitInPack(param)
|
||||
emit(response)
|
||||
} catch (e: Exception) {
|
||||
Log.e(logName, e.stackTraceToString())
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
fun delete(fid: Int, carId: String) {
|
||||
val tempObj = JSONObject()
|
||||
tempObj["id"] = fid
|
||||
tempObj["location"] = carId.emptyToNull()
|
||||
deleteLiveData.value = tempObj
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,96 @@
|
||||
package com.lukouguoji.mit.viewModel
|
||||
|
||||
import android.util.Log
|
||||
import androidx.lifecycle.*
|
||||
import com.alibaba.fastjson.JSONArray
|
||||
import com.alibaba.fastjson.JSONObject
|
||||
import com.lukouguoji.module_base.common.String.emptyToNull
|
||||
import com.lukouguoji.module_base.http.user.UserNetwork
|
||||
import com.wega.library.loadingDialog.LoadingDialog
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlin.collections.set
|
||||
|
||||
class OutLoadingPullViewModel : ViewModel() {
|
||||
|
||||
/**
|
||||
* 选中
|
||||
*/
|
||||
val checkCount: LiveData<Int>
|
||||
get() = _checkCount
|
||||
|
||||
private val _checkCount = MutableLiveData<Int>()
|
||||
|
||||
init {
|
||||
_checkCount.value = 0
|
||||
}
|
||||
|
||||
fun plusOne() {
|
||||
val count = _checkCount.value ?: 0
|
||||
_checkCount.value = count + 1
|
||||
}
|
||||
|
||||
fun subOne() {
|
||||
val count = _checkCount.value ?: 0
|
||||
_checkCount.value = count - 1
|
||||
}
|
||||
|
||||
fun setCheckCount(count: Int) {
|
||||
_checkCount.value = count
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 分页搜索
|
||||
*/
|
||||
private val searchParam = MutableLiveData<JSONObject>()
|
||||
val searchParamLive = Transformations.switchMap(searchParam) { param ->
|
||||
liveData(Dispatchers.IO) {
|
||||
try {
|
||||
val response = UserNetwork.queryWbOutLoading(param)
|
||||
emit(response)
|
||||
} catch (e: Exception) {
|
||||
Log.e("GoutCollectionViewModel", e.stackTraceToString())
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
fun search(
|
||||
limit: Int,
|
||||
page: Int,
|
||||
fid: Int,
|
||||
location: String,
|
||||
) {
|
||||
|
||||
val param = JSONObject()
|
||||
param["limit"] = limit
|
||||
param["page"] = page
|
||||
param["id"] = fid
|
||||
param["location"] = location.emptyToNull()
|
||||
|
||||
searchParam.value = param
|
||||
}
|
||||
|
||||
/**
|
||||
* 拉货完结
|
||||
*/
|
||||
private val completedLiveData = MutableLiveData<JSONObject>()
|
||||
val completedObserver = Transformations.switchMap(completedLiveData) { param ->
|
||||
liveData(Dispatchers.IO) {
|
||||
try {
|
||||
val response = UserNetwork.pullOutLoading(param)
|
||||
emit(response)
|
||||
} catch (e: Exception) {
|
||||
Log.e("GoutCollectionViewModel", e.stackTraceToString())
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
fun completed(param: JSONArray) {
|
||||
val paramObj = JSONObject()
|
||||
paramObj["list"] = param
|
||||
completedLiveData.value = paramObj
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,105 @@
|
||||
package com.lukouguoji.mit.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.common.String.emptyToNull
|
||||
import com.lukouguoji.module_base.http.user.UserNetwork
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlin.collections.set
|
||||
|
||||
class OutLoadingViewModel : ViewModel() {
|
||||
|
||||
private val logName = "OutLoadingViewModel"
|
||||
|
||||
/**
|
||||
* 航班号
|
||||
*/
|
||||
var fid: Int? = null
|
||||
var fno: String? = null
|
||||
var fdate: String? = null
|
||||
var cars: String = ""
|
||||
var fdest: String? = null
|
||||
var countryType: String? = null
|
||||
var countryName: String? = null
|
||||
var fdep:String?=null
|
||||
|
||||
|
||||
/**
|
||||
* 分页搜索
|
||||
*/
|
||||
private val searchParam = MutableLiveData<JSONObject>()
|
||||
val searchParamLive = Transformations.switchMap(searchParam) { param ->
|
||||
liveData(Dispatchers.IO) {
|
||||
try {
|
||||
val response = UserNetwork.searchOutLoading(param)
|
||||
emit(response)
|
||||
} catch (e: Exception) {
|
||||
Log.e(logName, e.stackTraceToString())
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
fun search(
|
||||
fdate: String,//航班日期
|
||||
fno: String//航班号
|
||||
) {
|
||||
val param = JSONObject()
|
||||
param["fdate"] = fdate.emptyToNull()
|
||||
param["fno"] = fno.emptyToNull()
|
||||
|
||||
searchParam.value = param
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询航班
|
||||
*/
|
||||
private val queryFlightLiveData = MutableLiveData<JSONObject>()
|
||||
val queryFlightObserver = Transformations.switchMap(queryFlightLiveData) { param ->
|
||||
liveData(Dispatchers.IO) {
|
||||
try {
|
||||
val response = UserNetwork.queryFlightMitInPack(param)
|
||||
emit(response)
|
||||
} catch (e: Exception) {
|
||||
Log.e(logName, e.stackTraceToString())
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
fun queryFlight(fdate: String, fno: String,fdep:String) {
|
||||
val temObj = JSONObject()
|
||||
temObj["fdate"] = fdate.emptyToNull()
|
||||
temObj["fno"] = fno.emptyToNull()
|
||||
temObj["fdep"] = fdep.emptyToNull()
|
||||
queryFlightLiveData.value = temObj
|
||||
}
|
||||
|
||||
/**
|
||||
* 货物发放
|
||||
*/
|
||||
private val provideGjjCangDanLiveData = MutableLiveData<JSONObject>()
|
||||
val provideGjjCangDanObserver = Transformations.switchMap(provideGjjCangDanLiveData) { param ->
|
||||
liveData(Dispatchers.IO) {
|
||||
try {
|
||||
val response = UserNetwork.provideGjjCangDan(param)
|
||||
emit(response)
|
||||
} catch (e: Exception) {
|
||||
Log.e(logName, e.stackTraceToString())
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
fun provideGjjCangDan(fid: Int, ids: List<Int>) {
|
||||
val temObj = JSONObject()
|
||||
temObj["fid"] = fid
|
||||
temObj["ids"] = ids
|
||||
|
||||
provideGjjCangDanLiveData.value = temObj
|
||||
}
|
||||
}
|
||||
43
module_mit/src/main/release/AndroidManifest.xml
Normal file
@@ -0,0 +1,43 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.lukouguoji.mit">
|
||||
|
||||
<application>
|
||||
<activity
|
||||
android:name=".activity.OutLoadingPullActivity"
|
||||
android:configChanges="orientation|keyboardHidden"
|
||||
android:screenOrientation="userLandscape"
|
||||
android:exported="false" />
|
||||
<activity
|
||||
android:name=".activity.OutLoadingActivity"
|
||||
android:configChanges="orientation|keyboardHidden"
|
||||
android:screenOrientation="userLandscape"
|
||||
android:exported="false" />
|
||||
<activity
|
||||
android:name=".activity.AccidentVisaInfoActivity"
|
||||
android:configChanges="orientation|keyboardHidden"
|
||||
android:screenOrientation="userLandscape"
|
||||
android:exported="false" />
|
||||
<activity
|
||||
android:name=".activity.AccidentVisaActivity"
|
||||
android:configChanges="orientation|keyboardHidden"
|
||||
android:screenOrientation="userLandscape"
|
||||
android:exported="false" />
|
||||
<activity
|
||||
android:name=".activity.MitInPackInfoActivity"
|
||||
android:configChanges="orientation|keyboardHidden"
|
||||
android:screenOrientation="userLandscape"
|
||||
android:exported="false" />
|
||||
<activity
|
||||
android:name=".activity.MitInPackActivity"
|
||||
android:configChanges="orientation|keyboardHidden"
|
||||
android:screenOrientation="userLandscape"
|
||||
android:exported="false" />
|
||||
<activity
|
||||
android:name=".MainActivity"
|
||||
android:configChanges="orientation|keyboardHidden"
|
||||
android:screenOrientation="userLandscape"
|
||||
android:exported="true" />
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
@@ -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>
|
||||
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
|
||||
<!-- 圆角-->
|
||||
<corners android:radius="5dp" />
|
||||
<solid android:color="@color/disable_grey" />
|
||||
<!--描边-->
|
||||
<stroke
|
||||
android:width="1dp"
|
||||
android:color="@android:color/darker_gray" />
|
||||
</shape>
|
||||
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
|
||||
<!-- 圆角-->
|
||||
<corners android:radius="5dp" />
|
||||
<solid android:color="@color/white" />
|
||||
<!--描边-->
|
||||
<stroke
|
||||
android:width="1dp"
|
||||
android:color="@android:color/darker_gray" />
|
||||
</shape>
|
||||
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<solid android:color="#EA0553" />
|
||||
<corners android:radius="5dp"/>
|
||||
</shape>
|
||||
170
module_mit/src/main/res/drawable/ic_launcher_background.xml
Normal file
@@ -0,0 +1,170 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
android:viewportWidth="108"
|
||||
android:viewportHeight="108">
|
||||
<path
|
||||
android:fillColor="#3DDC84"
|
||||
android:pathData="M0,0h108v108h-108z" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M9,0L9,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,0L19,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M29,0L29,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M39,0L39,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M49,0L49,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M59,0L59,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M69,0L69,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M79,0L79,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M89,0L89,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M99,0L99,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,9L108,9"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,19L108,19"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,29L108,29"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,39L108,39"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,49L108,49"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,59L108,59"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,69L108,69"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,79L108,79"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,89L108,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,99L108,99"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,29L89,29"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,39L89,39"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,49L89,49"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,59L89,59"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,69L89,69"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,79L89,79"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M29,19L29,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M39,19L39,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M49,19L49,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M59,19L59,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M69,19L69,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M79,19L79,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
</vector>
|
||||
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
|
||||
<!-- 圆角-->
|
||||
<corners android:radius="1dp" />
|
||||
<!--描边-->
|
||||
<stroke
|
||||
android:width="1dp"
|
||||
android:color="@android:color/darker_gray" />
|
||||
</shape>
|
||||
5
module_mit/src/main/res/drawable/send_shape.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<solid android:color="@color/two_grey" />
|
||||
<corners android:radius="5dp"/>
|
||||
</shape>
|
||||
26
module_mit/src/main/res/layout/accident_visa_image_item.xml
Normal file
@@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<com.luck.picture.lib.widget.SquareRelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="90dp"
|
||||
android:layout_height="90dp"
|
||||
tools:ignore="MissingClass">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/fiv"
|
||||
android:layout_width="match_parent" android:layout_height="match_parent"
|
||||
tools:src="@color/white" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_del"
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_alignTop="@id/fiv"
|
||||
android:layout_alignRight="@id/fiv"
|
||||
android:paddingLeft="10dp"
|
||||
android:paddingBottom="10dp"
|
||||
android:scaleType="centerInside"
|
||||
android:src="@mipmap/ic_item_delete"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible" />
|
||||
|
||||
</com.luck.picture.lib.widget.SquareRelativeLayout>
|
||||
137
module_mit/src/main/res/layout/accident_visa_info_item.xml
Normal file
@@ -0,0 +1,137 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="start|center_vertical"
|
||||
android:orientation="vertical"
|
||||
android:paddingTop="5dp"
|
||||
android:paddingRight="20dp">
|
||||
|
||||
<!--内容-->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="30dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal"
|
||||
android:paddingLeft="10dp">
|
||||
|
||||
<!-- 文字-->
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1.4"
|
||||
android:gravity="start|center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/titleName"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="运单号" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/isMust"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="2dp"
|
||||
android:text="*"
|
||||
android:textColor="@color/red" />
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 输入框-->
|
||||
<LinearLayout
|
||||
android:id="@+id/inputLayout"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="3"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginLeft="2dp"
|
||||
android:visibility="visible">
|
||||
<!-- 前缀-->
|
||||
<EditText
|
||||
android:id="@+id/inputContentPre"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/accident_visa_info_edit_shape"
|
||||
android:gravity="center|start"
|
||||
android:imeOptions="actionDone"
|
||||
android:inputType="text"
|
||||
android:maxLines="1"
|
||||
android:paddingLeft="5dp"
|
||||
android:singleLine="true"
|
||||
android:text=""
|
||||
android:textColor="@color/black"
|
||||
|
||||
android:visibility="gone" />
|
||||
|
||||
<!-- 横线-->
|
||||
<View
|
||||
android:id="@+id/inputContentPreView"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="0.3"
|
||||
android:layout_height="1dp"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:layout_marginRight="5dp"
|
||||
android:layout_gravity="center"
|
||||
android:background="@color/black"
|
||||
android:visibility="gone"/>
|
||||
|
||||
<!-- 输入框-->
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="3"
|
||||
android:background="@drawable/accident_visa_info_edit_shape"
|
||||
android:orientation="horizontal">
|
||||
<EditText
|
||||
android:id="@+id/inputContent"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center|start"
|
||||
android:imeOptions="actionDone"
|
||||
android:inputType="text"
|
||||
android:background="@drawable/input_edit_text"
|
||||
android:maxLines="1"
|
||||
android:paddingLeft="5dp"
|
||||
android:singleLine="true"
|
||||
android:text=""
|
||||
android:textColor="@color/black"
|
||||
|
||||
android:visibility="visible" />
|
||||
<!-- 扫描-->
|
||||
<ImageView
|
||||
android:id="@+id/scanIcon"
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginLeft="2dp"
|
||||
android:layout_marginRight="10dp"
|
||||
android:src="@mipmap/scan_code"
|
||||
android:visibility="gone"/>
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 下拉框-->
|
||||
<TextView
|
||||
android:id="@+id/selContent"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="3"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/accident_visa_info_edit_shape"
|
||||
android:gravity="center|start"
|
||||
android:maxLines="1"
|
||||
android:paddingLeft="5dp"
|
||||
android:layout_marginLeft="2dp"
|
||||
android:singleLine="true"
|
||||
android:text="请选择"
|
||||
android:textColor="@color/black"
|
||||
|
||||
android:visibility="gone" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
233
module_mit/src/main/res/layout/accident_visa_list_item.xml
Normal file
@@ -0,0 +1,233 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:orientation="horizontal"
|
||||
tools:ignore="MissingDefaultResource">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="105dp"
|
||||
android:background="@drawable/collect_item_shape"
|
||||
android:orientation="horizontal"
|
||||
android:padding="10dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/leftIcon"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_gravity="center"
|
||||
android:src="@mipmap/fubang_list_left_icon" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginLeft="20dp"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="vertical">
|
||||
<!-- 运单号行-->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<!-- 运单号-->
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="2"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:text="运单号"
|
||||
android:textColor="@color/weak_grey" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/wbNo"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="2dp"
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
android:ellipsize="end"
|
||||
android:text="A123456789"
|
||||
android:textColor="@color/colorPrimary"
|
||||
/>
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
<!-- 分割线-->
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="2dp"
|
||||
android:background="@drawable/dash_line"
|
||||
android:layerType="software" />
|
||||
<!-- 第二行-->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
|
||||
<!-- 地区类型-->
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:text="地区类型"
|
||||
android:textColor="@color/weak_grey" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/areaFlag"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="2dp"
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
android:ellipsize="end"
|
||||
android:textColor="@color/weak_grey2"
|
||||
android:text="" />
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 进出港-->
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:text="进出港"
|
||||
android:textColor="@color/weak_grey" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/ieFlag"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="2dp"
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
android:ellipsize="end"
|
||||
android:textColor="@color/weak_grey2"
|
||||
android:text="" />
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 不正常件数-->
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:text="不正常件数"
|
||||
android:textColor="@color/weak_grey" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/dpc"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="2dp"
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
android:ellipsize="end"
|
||||
android:textColor="@color/weak_grey2"
|
||||
android:text="" />
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 操作人-->
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:text="操作人"
|
||||
android:textColor="@color/weak_grey" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/opId"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="2dp"
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
android:ellipsize="end"
|
||||
android:textColor="@color/weak_grey2"
|
||||
android:text="" />
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 操作时间-->
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="2"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:text="操作时间"
|
||||
android:textColor="@color/weak_grey" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/opDate"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="2dp"
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
android:ellipsize="end"
|
||||
android:textColor="@color/weak_grey2"
|
||||
android:text="" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="105dp">
|
||||
<TextView
|
||||
android:id="@+id/delete"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:background="@drawable/accident_visa_list_item_del_shape"
|
||||
android:text="删除"
|
||||
android:textSize="18sp"
|
||||
android:textColor="@color/white"/>
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
495
module_mit/src/main/res/layout/activity_accident_visa.xml
Normal file
@@ -0,0 +1,495 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout 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"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
tools:context=".activity.AccidentVisaActivity">
|
||||
|
||||
<androidx.appcompat.widget.Toolbar
|
||||
android:id="@+id/main_toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
android:background="@color/colorPrimary"
|
||||
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/tool_back"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="15dp"
|
||||
android:layout_height="15dp"
|
||||
android:src="@mipmap/left_icon"
|
||||
app:tint="@color/white" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical|left"
|
||||
android:text="返回"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="18sp" />
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/title_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:text="事故签证"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="18sp" />
|
||||
|
||||
|
||||
</androidx.appcompat.widget.Toolbar>
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
<!-- 搜索、列表页-->
|
||||
<LinearLayout
|
||||
android:id="@+id/searchListFragment"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:visibility="visible">
|
||||
|
||||
<!-- 搜索 框 列表区域-->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:background="@color/list_bg"
|
||||
android:orientation="vertical"
|
||||
android:paddingLeft="20dp"
|
||||
android:paddingTop="10dp"
|
||||
android:paddingRight="20dp"
|
||||
android:paddingBottom="10dp">
|
||||
<!-- 搜索框 区域-->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:orientation="horizontal"
|
||||
android:paddingTop="5dp"
|
||||
android:paddingBottom="5dp">
|
||||
<!-- 操作起始时间-->
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/bg_search_row"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/beginDate"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:hint="请输入起始时间"
|
||||
android:textSize="15dp" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/beginDateIcon"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:src="@mipmap/calendar_icon"
|
||||
app:tint="@color/weak_grey" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
<!-- 结束时间-->
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/bg_search_row"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/endDate"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:hint="请输入结束时间"
|
||||
android:textSize="15dp" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/endDateIcon"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:src="@mipmap/calendar_icon"
|
||||
app:tint="@color/weak_grey" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
<!-- 地区类型-->
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/bg_search_row">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/areaType"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/input_edit_text"
|
||||
android:gravity="center"
|
||||
android:hint="请选择地区类型"
|
||||
android:inputType="text"
|
||||
android:singleLine="true"
|
||||
android:textSize="15dp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
<!-- 进出港-->
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/bg_search_row">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/ieFlag"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/input_edit_text"
|
||||
android:gravity="center"
|
||||
android:hint="请选择进出港"
|
||||
android:inputType="text"
|
||||
android:singleLine="true"
|
||||
android:textSize="15dp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="match_parent" />
|
||||
<!-- 搜索图标-->
|
||||
<LinearLayout
|
||||
android:id="@+id/searchLayout"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_gravity="center_vertical|end"
|
||||
android:background="@drawable/search_shape_gnc_ware_house2"
|
||||
android:padding="10dp">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:src="@mipmap/search"
|
||||
app:tint="@color/colorPrimary" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="10dp"
|
||||
android:layout_height="match_parent" />
|
||||
<!-- 筛选图标-->
|
||||
<LinearLayout
|
||||
android:id="@+id/filtrateLayout"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_gravity="center"
|
||||
android:background="@drawable/search_shape_gnc_ware_house2"
|
||||
android:padding="10dp">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:src="@mipmap/filtrate"
|
||||
app:tint="@color/colorPrimary" />
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<!--列表-->
|
||||
<LinearLayout
|
||||
android:id="@+id/listLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical"
|
||||
android:visibility="visible">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="40dp"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center|start"
|
||||
android:text="新增" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/addIcon"
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_marginLeft="2dp"
|
||||
android:src="@mipmap/mit_add" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginRight="5dp"
|
||||
android:gravity="center|right"
|
||||
android:text="快速检索" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/quickSearch"
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_gravity="center"
|
||||
android:background="@drawable/mit_in_pack_list_input_edit_text"
|
||||
android:gravity="start"
|
||||
android:hint=""
|
||||
android:imeOptions="actionDone"
|
||||
android:inputType="text"
|
||||
android:maxLines="1"
|
||||
android:paddingLeft="5dp"
|
||||
android:singleLine="true"
|
||||
android:textSize="15dp" />
|
||||
</LinearLayout>
|
||||
|
||||
<com.scwang.smart.refresh.layout.SmartRefreshLayout
|
||||
android:id="@+id/refreshLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<com.scwang.smart.refresh.header.ClassicsHeader
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<com.lukouguoji.module_base.util.SwipeDeleteRecyclerView
|
||||
android:id="@+id/collectList"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:overScrollMode="never" />
|
||||
|
||||
<com.scwang.smart.refresh.footer.ClassicsFooter
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
</com.scwang.smart.refresh.layout.SmartRefreshLayout>
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 筛选 页-->
|
||||
<LinearLayout
|
||||
android:id="@+id/filtrateFragment"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/list_bg"
|
||||
android:orientation="vertical"
|
||||
android:paddingLeft="20dp"
|
||||
android:paddingTop="10dp"
|
||||
android:paddingRight="20dp"
|
||||
android:paddingBottom="10dp"
|
||||
android:visibility="gone">
|
||||
|
||||
<!-- 筛选内容-->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginLeft="40dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginRight="40dp"
|
||||
android:layout_weight="5"
|
||||
android:background="@drawable/home_shape"
|
||||
android:orientation="vertical"
|
||||
android:paddingLeft="50dp"
|
||||
android:paddingTop="10dp"
|
||||
android:paddingRight="50dp"
|
||||
android:paddingBottom="10dp">
|
||||
|
||||
<ScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<!-- 运单号-->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:layout_marginTop="10dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginRight="5dp"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_vertical|right"
|
||||
android:text="运单号" />
|
||||
|
||||
<!--内容-->
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_weight="3"
|
||||
android:background="@drawable/input_shape"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/wbNo"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginLeft="2dp"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/input_edit_text"
|
||||
android:hint="请输入运单号"
|
||||
android:imeOptions="actionDone"
|
||||
android:inputType="text"
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
android:text=""
|
||||
/>
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 操作人-->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:layout_marginTop="10dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginRight="5dp"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_vertical|right"
|
||||
android:text="操作人" />
|
||||
|
||||
<!--内容-->
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_weight="3"
|
||||
android:background="@drawable/input_shape"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/opId"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginLeft="2dp"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/input_edit_text"
|
||||
android:hint="请输入操作人"
|
||||
android:imeOptions="actionDone"
|
||||
android:inputType="text"
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
android:text=""
|
||||
/>
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 底部-->
|
||||
<LinearLayout
|
||||
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:orientation="horizontal"
|
||||
android:padding="5dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginBottom="10dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/reset"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/submit_shape"
|
||||
android:gravity="center"
|
||||
android:text="重置"
|
||||
android:textColor="@color/white"
|
||||
/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/submit"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/submit_shape"
|
||||
android:gravity="center"
|
||||
android:text="搜索"
|
||||
android:textColor="@color/white"
|
||||
/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
</FrameLayout>
|
||||
</LinearLayout>
|
||||
170
module_mit/src/main/res/layout/activity_accident_visa_info.xml
Normal file
@@ -0,0 +1,170 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
tools:context=".activity.AccidentVisaInfoActivity">
|
||||
|
||||
<include layout="@layout/title_tool_bar" />
|
||||
|
||||
<!--运单信息 中间-->
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:id="@+id/scrollView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginLeft="20dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginRight="20dp"
|
||||
android:layout_weight="5"
|
||||
android:fillViewport="true"
|
||||
android:overScrollMode="never">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<!-- 详细信息 分割线-->
|
||||
<!--<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="40dp"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginBottom="20dp"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/waybillInfo"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:text="详细信息"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="18sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="2dp"
|
||||
android:background="@drawable/dash_line"
|
||||
android:layerType="software" />
|
||||
|
||||
</LinearLayout>-->
|
||||
|
||||
<!--详细信息 内容区-->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/collectList"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<!--收货人 内容区-->
|
||||
<!--<LinearLayout
|
||||
android:id="@+id/wareHouseInfoLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="80dp"
|
||||
android:layout_marginLeft="20dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginRight="20dp"
|
||||
android:orientation="vertical"
|
||||
android:padding="10dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/uploadImg"
|
||||
android:src="@mipmap/ic_add_image"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
</LinearLayout>-->
|
||||
<LinearLayout
|
||||
android:id="@+id/wareHouseInfoLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="20dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recycler"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="2dp"
|
||||
android:overScrollMode="never" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
|
||||
|
||||
<!-- 底部-->
|
||||
<LinearLayout
|
||||
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:padding="5dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginBottom="10dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/cancel"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/submit_shape"
|
||||
android:gravity="center"
|
||||
android:text="取消"
|
||||
android:textColor="@color/white"
|
||||
/>
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/submit"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/submit_shape"
|
||||
android:gravity="center"
|
||||
android:text="确定"
|
||||
android:textColor="@color/white"
|
||||
/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1" />
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
18
module_mit/src/main/res/layout/activity_main.xml
Normal file
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout 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"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".MainActivity">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Hello World!"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
249
module_mit/src/main/res/layout/activity_mit_in_pack.xml
Normal file
@@ -0,0 +1,249 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout 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"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
tools:context=".activity.MitInPackActivity">
|
||||
|
||||
<include layout="@layout/title_tool_bar" />
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
<!-- 搜索、列表页-->
|
||||
<LinearLayout
|
||||
android:id="@+id/searchListFragment"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:visibility="visible">
|
||||
|
||||
<!-- 搜索 框 列表区域-->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:background="@color/list_bg"
|
||||
android:orientation="vertical"
|
||||
android:padding="5dp">
|
||||
<!-- 搜索框 区域-->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:orientation="horizontal"
|
||||
android:paddingTop="5dp"
|
||||
android:paddingBottom="5dp">
|
||||
<!--日期-->
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/bg_search_row"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/fdate"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:hint="请输入航班日期"
|
||||
android:textSize="15dp" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/startDateIcon"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:src="@mipmap/calendar_icon"
|
||||
app:tint="@color/weak_grey" />
|
||||
|
||||
</LinearLayout>
|
||||
<!-- 空格-->
|
||||
<LinearLayout
|
||||
android:layout_width="5dp"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
<!-- 航班号-->
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/bg_search_row">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/fno"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/input_edit_text"
|
||||
android:gravity="center"
|
||||
android:hint="请输入航班号"
|
||||
android:imeOptions="actionDone"
|
||||
android:inputType="text"
|
||||
android:singleLine="true"
|
||||
android:textSize="15dp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="5dp"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
<!-- 出发港-->
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/bg_search_row">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/origin"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/input_edit_text"
|
||||
android:gravity="center"
|
||||
android:hint="出发港"
|
||||
android:imeOptions="actionDone"
|
||||
android:inputType="text"
|
||||
android:singleLine="true"
|
||||
android:textSize="15dp"
|
||||
android:enabled="false"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="5dp"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
<!-- 目的港-->
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/bg_search_row">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/dest"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/input_edit_text"
|
||||
android:gravity="center"
|
||||
android:hint="目的港"
|
||||
android:imeOptions="actionDone"
|
||||
android:inputType="text"
|
||||
android:singleLine="true"
|
||||
android:textSize="15dp"
|
||||
android:enabled="false"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="5dp"
|
||||
android:layout_height="match_parent" />
|
||||
<!-- 搜索图标-->
|
||||
<LinearLayout
|
||||
android:id="@+id/searchLayout"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:background="@drawable/search_shape_gnc_ware_house2"
|
||||
android:layout_gravity="center_vertical|end"
|
||||
android:padding="10dp">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:src="@mipmap/search"
|
||||
app:tint="@color/colorPrimary" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="5dp"
|
||||
android:layout_height="match_parent" />
|
||||
</LinearLayout>
|
||||
|
||||
<!--列表-->
|
||||
<LinearLayout
|
||||
android:id="@+id/listLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical"
|
||||
android:visibility="gone">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="40dp"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center|start"
|
||||
android:text="新增"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/addIcon"
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_marginLeft="2dp"
|
||||
android:src="@mipmap/mit_add" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginRight="5dp"
|
||||
android:gravity="center|right"
|
||||
android:text="快速检索"/>
|
||||
|
||||
<EditText
|
||||
android:id="@+id/quickSearch"
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="20dp"
|
||||
android:paddingLeft="5dp"
|
||||
android:background="@drawable/mit_in_pack_list_input_edit_text"
|
||||
android:gravity="start"
|
||||
android:layout_gravity="center"
|
||||
android:hint=""
|
||||
android:imeOptions="actionDone"
|
||||
android:inputType="text"
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
android:textSize="15dp" />
|
||||
</LinearLayout>
|
||||
|
||||
<com.scwang.smart.refresh.layout.SmartRefreshLayout
|
||||
android:id="@+id/refreshLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<com.scwang.smart.refresh.header.ClassicsHeader
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<com.lukouguoji.module_base.util.SwipeDeleteRecyclerView
|
||||
android:id="@+id/collectList"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:overScrollMode="never" />
|
||||
|
||||
<com.scwang.smart.refresh.footer.ClassicsFooter
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
</com.scwang.smart.refresh.layout.SmartRefreshLayout>
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
</FrameLayout>
|
||||
</LinearLayout>
|
||||
466
module_mit/src/main/res/layout/activity_mit_in_pack_info.xml
Normal file
@@ -0,0 +1,466 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/list_bg"
|
||||
android:orientation="vertical"
|
||||
tools:context=".activity.MitInPackInfoActivity">
|
||||
|
||||
<include layout="@layout/title_tool_bar" />
|
||||
<!--上部-->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginLeft="20dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginRight="20dp"
|
||||
android:layout_weight="5"
|
||||
android:background="@drawable/collect_item_shape"
|
||||
android:orientation="vertical">
|
||||
|
||||
<!--运单区-->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="100dp"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<!-- 第一行中第一列-->
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="start"
|
||||
android:orientation="vertical"
|
||||
android:paddingLeft="20dp"
|
||||
android:paddingTop="10dp"
|
||||
android:paddingRight="20dp"
|
||||
android:paddingBottom="10dp">
|
||||
<!-- 文字-->
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="平板车编号" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="2dp"
|
||||
android:text="*"
|
||||
android:textColor="@color/red" />
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 运单号-->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="35dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:background="@drawable/input_shape"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/carNo"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginLeft="2dp"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/input_edit_text"
|
||||
android:imeOptions="actionDone"
|
||||
android:inputType="text"
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
android:text=""
|
||||
android:textColor="@color/colorPrimary"
|
||||
android:textSize="25dp" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/carNoScan"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="32dp"
|
||||
android:src="@mipmap/scan_code" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="2dp"
|
||||
android:background="@drawable/dash_line"
|
||||
android:layerType="software" />
|
||||
<!--主内容区-->
|
||||
<ScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:overScrollMode="never">
|
||||
|
||||
<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:orientation="horizontal">
|
||||
<!--第一列-->
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_horizontal"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="80dp"
|
||||
android:gravity="start"
|
||||
android:orientation="vertical"
|
||||
android:paddingLeft="20dp"
|
||||
android:paddingTop="10dp"
|
||||
android:paddingRight="20dp"
|
||||
android:paddingBottom="10dp">
|
||||
<!-- 文字-->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="航班日期" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="2dp"
|
||||
android:text="*"
|
||||
android:textColor="@color/red" />
|
||||
</LinearLayout>
|
||||
<!--内容-->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="30dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:background="@drawable/input_shape"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/fdate"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginLeft="2dp"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/input_edit_text"
|
||||
android:enabled="false"
|
||||
android:imeOptions="actionDone"
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
android:text=""
|
||||
/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="80dp"
|
||||
android:gravity="start"
|
||||
android:orientation="vertical"
|
||||
android:paddingLeft="20dp"
|
||||
android:paddingTop="10dp"
|
||||
android:paddingRight="20dp"
|
||||
android:paddingBottom="10dp">
|
||||
<!-- 文字-->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="出发港" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="2dp"
|
||||
android:text="*"
|
||||
android:textColor="@color/red" />
|
||||
</LinearLayout>
|
||||
<!--内容-->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="30dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:background="@drawable/input_shape"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/fdep"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginLeft="2dp"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/input_edit_text"
|
||||
android:enabled="false"
|
||||
android:imeOptions="actionDone"
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<!--第二列-->
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_horizontal"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="80dp"
|
||||
android:gravity="start"
|
||||
android:orientation="vertical"
|
||||
android:paddingLeft="20dp"
|
||||
android:paddingTop="10dp"
|
||||
android:paddingRight="20dp"
|
||||
android:paddingBottom="10dp">
|
||||
<!-- 文字-->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="航班号" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="2dp"
|
||||
android:text="*"
|
||||
android:textColor="@color/red" />
|
||||
</LinearLayout>
|
||||
<!--内容-->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="30dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:background="@drawable/input_shape"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/fno"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginLeft="2dp"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/input_edit_text"
|
||||
android:enabled="false"
|
||||
android:imeOptions="actionDone"
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="80dp"
|
||||
android:gravity="start"
|
||||
android:orientation="vertical"
|
||||
android:paddingLeft="20dp"
|
||||
android:paddingTop="10dp"
|
||||
android:paddingRight="20dp"
|
||||
android:paddingBottom="10dp">
|
||||
<!-- 文字-->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="目的港" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="2dp"
|
||||
android:text="*"
|
||||
android:textColor="@color/red" />
|
||||
</LinearLayout>
|
||||
<!--内容-->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="30dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:background="@drawable/input_shape"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/fdest"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginLeft="2dp"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/input_edit_text"
|
||||
android:enabled="false"
|
||||
android:imeOptions="actionDone"
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<!--第三列-->
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_horizontal"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="80dp"
|
||||
android:gravity="start"
|
||||
android:orientation="vertical"
|
||||
android:paddingLeft="20dp"
|
||||
android:paddingTop="10dp"
|
||||
android:paddingRight="20dp"
|
||||
android:paddingBottom="10dp">
|
||||
<!-- 文字-->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="地区类型" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="2dp"
|
||||
android:text="*"
|
||||
android:textColor="@color/red" />
|
||||
</LinearLayout>
|
||||
<!--内容-->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="30dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:background="@drawable/input_shape"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/countryType"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginLeft="2dp"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/input_edit_text"
|
||||
android:enabled="false"
|
||||
android:imeOptions="actionDone"
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 底部-->
|
||||
<LinearLayout
|
||||
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:orientation="horizontal"
|
||||
android:padding="5dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginBottom="10dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/submit"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/submit_shape"
|
||||
android:gravity="center"
|
||||
android:text="确认"
|
||||
android:textColor="@color/white"
|
||||
/>
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1" />
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
1393
module_mit/src/main/res/layout/activity_out_loading.xml
Normal file
303
module_mit/src/main/res/layout/activity_out_loading_pull.xml
Normal file
@@ -0,0 +1,303 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout 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"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
tools:context=".activity.OutLoadingPullActivity">
|
||||
|
||||
<include layout="@layout/title_tool_bar" />
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
<!-- 搜索、列表页-->
|
||||
<LinearLayout
|
||||
android:id="@+id/searchListFragment"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:visibility="visible">
|
||||
|
||||
<!-- 搜索 框 列表区域-->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:background="@color/list_bg"
|
||||
android:orientation="vertical"
|
||||
android:padding="5dp">
|
||||
<!-- 搜索框 区域-->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center_vertical"
|
||||
android:layout_marginHorizontal="10dp"
|
||||
android:layout_marginTop="10dp">
|
||||
<!--fdate-->
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_margin="5dp"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/bg_search_layout"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/fdate"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_vertical"
|
||||
android:hint="请选择航班日期"
|
||||
android:paddingStart="10dp"
|
||||
android:textColor="@color/text_normal"
|
||||
android:textColorHint="@color/text_gray_l"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/startDateIcon"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:padding="10dp"
|
||||
android:src="@drawable/img_date" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_margin="5dp"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/bg_search_layout"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/fno"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:background="@null"
|
||||
android:hint="请输入航班号"
|
||||
android:paddingStart="10dp"
|
||||
android:textColor="@color/text_normal"
|
||||
android:textColorHint="@color/text_gray_l"
|
||||
android:textSize="14sp"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_margin="5dp"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/bg_search_layout"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/carNo"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:background="@null"
|
||||
android:hint="请输入板车号"
|
||||
android:paddingStart="10dp"
|
||||
android:textColor="@color/text_normal"
|
||||
android:textColorHint="@color/text_gray_l"
|
||||
android:textSize="14sp"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="3">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/searchLayout"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<ImageView
|
||||
style="@style/iv_search_action"
|
||||
android:src="@drawable/img_search" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<!--列表-->
|
||||
<LinearLayout
|
||||
android:id="@+id/listLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical"
|
||||
android:visibility="gone">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="30dp"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center|start"
|
||||
android:text="全选" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/checkIcon"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="2dp"
|
||||
android:src="@mipmap/all_check_icon" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginRight="5dp"
|
||||
android:gravity="center|right"
|
||||
android:text="快速检索" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/quickSearch"
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_gravity="center"
|
||||
android:background="@drawable/mit_in_pack_list_input_edit_text"
|
||||
android:gravity="start"
|
||||
android:hint=""
|
||||
android:imeOptions="actionDone"
|
||||
android:inputType="text"
|
||||
android:maxLines="1"
|
||||
android:paddingLeft="5dp"
|
||||
android:singleLine="true"
|
||||
android:textSize="15dp" />
|
||||
</LinearLayout>
|
||||
|
||||
<com.scwang.smart.refresh.layout.SmartRefreshLayout
|
||||
android:id="@+id/refreshLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<com.scwang.smart.refresh.header.ClassicsHeader
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/collectList"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:overScrollMode="never" />
|
||||
|
||||
<com.scwang.smart.refresh.footer.ClassicsFooter
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
</com.scwang.smart.refresh.layout.SmartRefreshLayout>
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<!-- 汇总数据 区域-->
|
||||
<LinearLayout
|
||||
android:id="@+id/totalLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="40dp"
|
||||
android:background="@color/dark_grey"
|
||||
android:orientation="horizontal"
|
||||
android:visibility="gone">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center"
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
android:text="总票数:"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="20sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/totalPc"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center"
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
android:text="0"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="20sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center"
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
android:text="票,已选中:"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="20sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/selPc"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center"
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
android:text="0"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="20sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center"
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
android:text="票"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="20sp" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/send"
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginRight="5dp"
|
||||
android:background="@drawable/send_shape"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center"
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
android:text="确认拉货"
|
||||
android:textColor="@color/dark_grey"
|
||||
android:textSize="20sp" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
</FrameLayout>
|
||||
</LinearLayout>
|
||||
206
module_mit/src/main/res/layout/mit_in_pack_list_item.xml
Normal file
@@ -0,0 +1,206 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:orientation="horizontal"
|
||||
tools:ignore="MissingDefaultResource">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="105dp"
|
||||
android:background="@drawable/collect_item_shape"
|
||||
android:orientation="horizontal"
|
||||
android:padding="10dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/leftIcon"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_gravity="center"
|
||||
android:src="@mipmap/fubang_list_left_icon" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginLeft="20dp"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="vertical">
|
||||
<!-- 运单号行-->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<!-- 板车号-->
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="2"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:text="板车号"
|
||||
android:textColor="@color/weak_grey" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/carId"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="2dp"
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
android:ellipsize="end"
|
||||
android:text="A123456789"
|
||||
android:textColor="@color/colorPrimary"
|
||||
/>
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
<!-- 分割线-->
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="2dp"
|
||||
android:background="@drawable/dash_line"
|
||||
android:layerType="software" />
|
||||
<!-- 第二行-->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<!-- 航班-->
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="2"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:text="航班"
|
||||
android:textColor="@color/weak_grey" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/flight"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="2dp"
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
android:ellipsize="end"
|
||||
android:textColor="@color/weak_grey2"
|
||||
android:text="" />
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 地区类型-->
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:text="地区类型"
|
||||
android:textColor="@color/weak_grey" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/countryType"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="2dp"
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
android:ellipsize="end"
|
||||
android:textColor="@color/weak_grey2"
|
||||
android:text="" />
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 装板时间-->
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="2"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:text="装板时间"
|
||||
android:textColor="@color/weak_grey" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/opDate"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="2dp"
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
android:ellipsize="end"
|
||||
android:textColor="@color/weak_grey2"
|
||||
android:text="" />
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 确认人-->
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:text="确认人"
|
||||
android:textColor="@color/weak_grey" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/opId"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="2dp"
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
android:ellipsize="end"
|
||||
android:textColor="@color/weak_grey2"
|
||||
android:text="" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="105dp">
|
||||
<TextView
|
||||
android:id="@+id/delete"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:background="@drawable/accident_visa_list_item_del_shape"
|
||||
android:text="删除"
|
||||
android:textSize="18sp"
|
||||
android:textColor="@color/white"/>
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
175
module_mit/src/main/res/layout/out_loading_pull_list_item.xml
Normal file
@@ -0,0 +1,175 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="70dp"
|
||||
android:background="@drawable/collect_item_shape"
|
||||
android:orientation="horizontal"
|
||||
android:padding="10dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/leftIcon"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_gravity="center"
|
||||
android:src="@mipmap/gnc_ware_house_left_icon" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginLeft="20dp"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="vertical">
|
||||
<!-- 运单号行-->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:layout_weight="1"
|
||||
android:orientation="horizontal">
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/wbNo"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/colorPrimary"
|
||||
android:layout_marginLeft="2dp"
|
||||
android:text="A123456789"
|
||||
/>
|
||||
<!-- 板车号-->
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:text="板车号"
|
||||
android:textColor="@color/weak_grey" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/location"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="2dp"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
android:textColor="@color/weak_grey2"
|
||||
android:text="" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 分割线-->
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="2dp"
|
||||
android:background="@drawable/dash_line"
|
||||
android:layerType="software" />
|
||||
|
||||
|
||||
<!-- 第二行-->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:layout_marginTop="5dp"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<!-- 件数-->
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:text="件数"
|
||||
android:textColor="@color/weak_grey" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/pc"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="2dp"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
android:textColor="@color/weak_grey2"
|
||||
android:text="" />
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 重量-->
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:text="重量"
|
||||
android:textColor="@color/weak_grey" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/weight"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="2dp"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
android:textColor="@color/weak_grey2"
|
||||
android:text="" />
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 体积-->
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:text="体积"
|
||||
android:textColor="@color/weak_grey" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/volume"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="2dp"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
android:textColor="@color/weak_grey2"
|
||||
android:text="" />
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
176
module_mit/src/main/res/layout/out_loading_pull_sub_dialog.xml
Normal file
@@ -0,0 +1,176 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/white"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:layout_marginLeft="20dp"
|
||||
android:layout_marginRight="20dp"
|
||||
android:background="@drawable/search_shape"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginLeft="2dp"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/input_edit_text"
|
||||
android:gravity="center|end"
|
||||
android:maxLines="1"
|
||||
android:paddingRight="15dp"
|
||||
android:singleLine="true"
|
||||
android:text="运单号"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="15sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/wbNo"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="2"
|
||||
android:background="@drawable/input_edit_text"
|
||||
android:gravity="center|start"
|
||||
android:maxLines="1"
|
||||
android:paddingRight="5dp"
|
||||
android:singleLine="true"
|
||||
android:text=""
|
||||
android:textColor="@color/colorPrimary"
|
||||
android:textSize="15sp" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="match_parent"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:layout_marginLeft="20dp"
|
||||
android:layout_marginRight="20dp"
|
||||
android:layout_marginTop="5dp"
|
||||
|
||||
android:background="@drawable/search_shape"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginLeft="2dp"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/input_edit_text"
|
||||
android:gravity="center|end"
|
||||
android:maxLines="1"
|
||||
android:paddingRight="15dp"
|
||||
android:singleLine="true"
|
||||
android:text="件数"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="15sp" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="2"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginBottom="5dp"
|
||||
android:background="@drawable/input_shape"
|
||||
android:gravity="center"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/pc"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginLeft="2dp"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/input_edit_text"
|
||||
android:imeOptions="actionDone"
|
||||
android:inputType="number"
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
android:textColor="@color/black"
|
||||
android:text=""
|
||||
android:textSize="15sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="match_parent"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:layout_marginLeft="20dp"
|
||||
android:layout_marginRight="20dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:background="@drawable/search_shape"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginLeft="2dp"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/input_edit_text"
|
||||
android:gravity="center|end"
|
||||
android:maxLines="1"
|
||||
android:paddingRight="15dp"
|
||||
android:singleLine="true"
|
||||
android:text="重量"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="15sp" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="2"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginBottom="5dp"
|
||||
android:background="@drawable/input_shape"
|
||||
android:gravity="center"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/weight"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginLeft="2dp"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/input_edit_text"
|
||||
android:imeOptions="actionDone"
|
||||
android:inputType="numberDecimal"
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
android:textColor="@color/black"
|
||||
android:text=""
|
||||
android:textSize="15sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="match_parent"/>
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@drawable/ic_launcher_background" />
|
||||
<foreground android:drawable="@drawable/ic_launcher_foreground" />
|
||||
</adaptive-icon>
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@drawable/ic_launcher_background" />
|
||||
<foreground android:drawable="@drawable/ic_launcher_foreground" />
|
||||
</adaptive-icon>
|
||||
BIN
module_mit/src/main/res/mipmap-hdpi/ic_launcher.webp
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
module_mit/src/main/res/mipmap-hdpi/ic_launcher_round.webp
Normal file
|
After Width: | Height: | Size: 2.8 KiB |
BIN
module_mit/src/main/res/mipmap-mdpi/ic_add_image.png
Normal file
|
After Width: | Height: | Size: 897 B |
BIN
module_mit/src/main/res/mipmap-mdpi/ic_item_delete.png
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
module_mit/src/main/res/mipmap-mdpi/ic_launcher.webp
Normal file
|
After Width: | Height: | Size: 982 B |
BIN
module_mit/src/main/res/mipmap-mdpi/ic_launcher_round.webp
Normal file
|
After Width: | Height: | Size: 1.7 KiB |
BIN
module_mit/src/main/res/mipmap-mdpi/left_icon_check.png
Normal file
|
After Width: | Height: | Size: 3.5 KiB |
BIN
module_mit/src/main/res/mipmap-mdpi/mit_add.png
Normal file
|
After Width: | Height: | Size: 1.8 KiB |
|
After Width: | Height: | Size: 3.3 KiB |
BIN
module_mit/src/main/res/mipmap-xhdpi/ic_launcher.webp
Normal file
|
After Width: | Height: | Size: 1.9 KiB |
BIN
module_mit/src/main/res/mipmap-xhdpi/ic_launcher_round.webp
Normal file
|
After Width: | Height: | Size: 3.8 KiB |
BIN
module_mit/src/main/res/mipmap-xxhdpi/ic_launcher.webp
Normal file
|
After Width: | Height: | Size: 2.8 KiB |
BIN
module_mit/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp
Normal file
|
After Width: | Height: | Size: 5.8 KiB |
BIN
module_mit/src/main/res/mipmap-xxxhdpi/ic_launcher.webp
Normal file
|
After Width: | Height: | Size: 3.8 KiB |
BIN
module_mit/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp
Normal file
|
After Width: | Height: | Size: 7.6 KiB |
16
module_mit/src/main/res/values-night/themes.xml
Normal file
@@ -0,0 +1,16 @@
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<!-- Base application theme. -->
|
||||
<style name="Theme.Aerologic" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
|
||||
<!-- Primary brand color. -->
|
||||
<item name="colorPrimary">@color/purple_200</item>
|
||||
<item name="colorPrimaryVariant">@color/purple_700</item>
|
||||
<item name="colorOnPrimary">@color/black</item>
|
||||
<!-- Secondary brand color. -->
|
||||
<item name="colorSecondary">@color/teal_200</item>
|
||||
<item name="colorSecondaryVariant">@color/teal_200</item>
|
||||
<item name="colorOnSecondary">@color/black</item>
|
||||
<!-- Status bar color. -->
|
||||
<item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item>
|
||||
<!-- Customize your theme here. -->
|
||||
</style>
|
||||
</resources>
|
||||
14
module_mit/src/main/res/values/colors.xml
Normal file
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="purple_200">#FFBB86FC</color>
|
||||
<color name="purple_500">#FF6200EE</color>
|
||||
<color name="purple_700">#FF3700B3</color>
|
||||
<color name="teal_200">#FF03DAC5</color>
|
||||
<color name="teal_700">#FF018786</color>
|
||||
<color name="black">#FF000000</color>
|
||||
<color name="white">#FFFFFFFF</color>
|
||||
|
||||
<color name="mit_in_pack_grey">#FF798A92</color>
|
||||
<color name="table_cell_color">#FFFFFFFF</color>
|
||||
|
||||
</resources>
|
||||
4
module_mit/src/main/res/values/strings.xml
Normal file
@@ -0,0 +1,4 @@
|
||||
<resources>
|
||||
<string name="app_name">MyApplication</string>
|
||||
<dimen name="table_cell_margin">0.5dp</dimen>
|
||||
</resources>
|
||||
16
module_mit/src/main/res/values/themes.xml
Normal file
@@ -0,0 +1,16 @@
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<!-- Base application theme. -->
|
||||
<style name="Theme.Aerologic" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
|
||||
<!-- Primary brand color. -->
|
||||
<item name="colorPrimary">@color/purple_500</item>
|
||||
<item name="colorPrimaryVariant">@color/purple_700</item>
|
||||
<item name="colorOnPrimary">@color/white</item>
|
||||
<!-- Secondary brand color. -->
|
||||
<item name="colorSecondary">@color/teal_200</item>
|
||||
<item name="colorSecondaryVariant">@color/teal_700</item>
|
||||
<item name="colorOnSecondary">@color/black</item>
|
||||
<!-- Status bar color. -->
|
||||
<item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item>
|
||||
<!-- Customize your theme here. -->
|
||||
</style>
|
||||
</resources>
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.lukouguoji.mit
|
||||
|
||||
import org.junit.Test
|
||||
|
||||
import org.junit.Assert.*
|
||||
|
||||
/**
|
||||
* Example local unit test, which will execute on the development machine (host).
|
||||
*
|
||||
* See [testing documentation](http://d.android.com/tools/testing).
|
||||
*/
|
||||
class ExampleUnitTest {
|
||||
@Test
|
||||
fun addition_isCorrect() {
|
||||
assertEquals(4, 2 + 2)
|
||||
}
|
||||
}
|
||||