init: init proj

This commit is contained in:
2025-11-10 18:21:19 +08:00
commit b65b28ec9e
1796 changed files with 187617 additions and 0 deletions

1
module_gjj/.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
/build

76
module_gjj/build.gradle Normal file
View File

@@ -0,0 +1,76 @@
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 {
compileSdk 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.gjj"
}
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 "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'androidx.core:core-ktx:1.2.0'
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'com.google.android.material:material:1.2.1'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
kapt 'com.alibaba:arouter-compiler:1.5.2'
}

21
module_gjj/proguard-rules.pro vendored Normal file
View 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

View File

@@ -0,0 +1,24 @@
package com.lukouguoji.gjj
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.gjj", appContext.packageName)
}
}

View 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.gjj">
<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>

View File

@@ -0,0 +1,11 @@
package com.lukouguoji.gjj
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)
}
}

View File

@@ -0,0 +1,529 @@
package com.lukouguoji.gjj.activity
import android.os.Bundle
import android.view.View
import android.widget.EditText
import android.widget.TextView
import android.widget.Toast
import androidx.lifecycle.ViewModelProvider
import androidx.recyclerview.widget.GridLayoutManager
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.JSONObject
import com.lukouguoji.gjj.R
import com.lukouguoji.gjj.adapt.GjjCangDanInfoAdapter
import com.lukouguoji.gjj.common.GjjCommon
import com.lukouguoji.gjj.model.GjjCangDanInfoItemModel
import com.lukouguoji.gjj.viewModel.GjjCangDanInfoViewModel
import com.lukouguoji.module_base.BaseActivity
import com.lukouguoji.module_base.common.Constant
import com.lukouguoji.module_base.common.String.isValidInt
import com.lukouguoji.module_base.router.ARouterConstants
import com.lukouguoji.module_base.util.Common
@Route(path = ARouterConstants.ACTIVITY_URL_GJJ_CANG_DAN_INFO)
class GjjCangDanInfoActivity : BaseActivity(), View.OnClickListener {
private lateinit var viewModel: GjjCangDanInfoViewModel
private lateinit var adapter: GjjCangDanInfoAdapter
private val collectList = ArrayList<GjjCangDanInfoItemModel>()
private lateinit var receive: EditText
private lateinit var cardNo: EditText
private lateinit var telPhone: EditText
private lateinit var cancel: TextView
private lateinit var submit: TextView
@JvmField
@Autowired
var id: String? = null
@JvmField
@Autowired
var ref: String? = null
@JvmField
@Autowired
var fid: Int = -9999
@JvmField
@Autowired
var prefix: String? = null
private fun initView() {
viewModel = ViewModelProvider(this).get(GjjCangDanInfoViewModel::class.java)
viewModel.waybillFormNetWork["prefix"] = prefix
val layoutManager = GridLayoutManager(this, 2)
adapter = GjjCangDanInfoAdapter(this, collectList)
var recyclerView: RecyclerView = findViewById(R.id.collectList)
recyclerView.layoutManager = layoutManager
recyclerView.adapter = adapter
receive = findViewById(R.id.receive)
cardNo = findViewById(R.id.cardNo)
telPhone = findViewById(R.id.telPhone)
cancel = findViewById(R.id.cancel)
submit = findViewById(R.id.submit)
cancel.setOnClickListener(this)
submit.setOnClickListener(this)
cardNo.onFocusChangeListener = View.OnFocusChangeListener { v, hasFocus ->
if (!hasFocus) {
//失去焦点
var cardNoStr = cardNo.text.toString()
if (cardNoStr != "" && !Common.isIDNumber(cardNoStr)) {
Common.showToast(this, "请输入正确的身份证号!")
}
}
}
telPhone.onFocusChangeListener = View.OnFocusChangeListener { v, hasFocus ->
if (!hasFocus) {
//失去焦点
var telPhoneStr = telPhone.text.toString()
if (telPhoneStr != "" && !Common.isPhoneNum(telPhoneStr)) {
Common.showToast(this, "请输入正确的电话号码!")
}
}
}
}
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_gjj_cang_dan_info)
initView()
//1.新增
if (id == null) {
// if (true) {
setBackArrow("新增国际进港舱单")
selObserve()
initData(GjjCommon.CangDan.Info.add)
viewModel.saveFestGjjCangDanObserver.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 != null && id != "" && ref != null && ref == GjjCommon.CangDan.Ref.read) {
// if (true) {
setBackArrow("国际进港舱单详情")
initNetWork(id, null, GjjCommon.CangDan.Info.read)
receive.isEnabled = false
receive.setBackgroundResource(R.drawable.gjj_cang_dan_info_edit_disable_shape)
cardNo.isEnabled = false
cardNo.setBackgroundResource(R.drawable.gjj_cang_dan_info_edit_disable_shape)
telPhone.isEnabled = false
telPhone.setBackgroundResource(R.drawable.gjj_cang_dan_info_edit_disable_shape)
cancel.visibility = View.GONE
submit.visibility = View.GONE
return
}
//3.编辑
if (id != null && id != "" && ref != null && ref != GjjCommon.CangDan.Ref.read) {
setBackArrow("国际进港舱单详情")
initNetWork(id, null, GjjCommon.CangDan.Info.update)
viewModel.updateFestGjjCangDanObserver.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.cancel -> {
finish()
}
R.id.submit -> {
submit()
}
else -> {
Toast.makeText(this, "未找到对应操作", Toast.LENGTH_SHORT).show()
}
}
}
}
/**
* 监听运单详情返回数据
*
* 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")
val consignee = viewModel.waybillFormNetWork.getString("consignee") ?: ""//收货人
val cneeId = viewModel.waybillFormNetWork.getString("cneeId") ?: ""//收货人身份证号
val cneeTel = viewModel.waybillFormNetWork.getString("cneeTel") ?: ""//收货人电话
initData(status)
////收获 信息
receive.setText(consignee)
cardNo.setText(cneeId)
telPhone.setText(cneeTel)
} else {
//无数据
}
}
}
/**
* 下拉框赋值
*/
private fun selObserve() {
/////////////// 下拉框 start
viewModel.agentCode(System.currentTimeMillis().toString())
viewModel.agentCodeObserver.observe(this) { vd ->
val noneObj = JSONObject()
noneObj["name"] = "请选择代理人"
noneObj["code"] = ""
viewModel.agentCodeList.add(noneObj)
viewModel.agentCodeList.addAll(vd.getJSONArray("data"))
totalRequestNotifyAdapter()
}
viewModel.business(Constant.businessType.II)
viewModel.businessObserver.observe(this) { vd ->
val noneObj = JSONObject()
noneObj["name"] = "请选择业务类型"
noneObj["code"] = ""
viewModel.businessList.add(noneObj)
viewModel.businessList.addAll(vd.getJSONArray("data"))
totalRequestNotifyAdapter()
}
viewModel.specialCode(System.currentTimeMillis().toString())
viewModel.specialCodeObserver.observe(this) { vd ->
val noneObj = JSONObject()
noneObj["name"] = "请选择特码"
noneObj["code"] = ""
viewModel.specialCodeList.add(noneObj)
viewModel.specialCodeList.addAll(vd.getJSONArray("data"))
totalRequestNotifyAdapter()
}
val noneObj = JSONObject()
noneObj["name"] = "请选择运单类型"
noneObj["code"] = ""
val noneObj2 = JSONObject()
noneObj2["name"] = "国际进港(国内中转)"
noneObj2["code"] = "CIII1"
val noneObj3 = JSONObject()
noneObj3["name"] = "国际进港(国际直航)"
noneObj3["code"] = "IIII1"
val noneObj4 = JSONObject()
noneObj4["name"] = "国际进港(直航中转)"
noneObj4["code"] = "IIIO1"
viewModel.awbList.add(noneObj)
viewModel.awbList.add(noneObj2)
viewModel.awbList.add(noneObj3)
viewModel.awbList.add(noneObj4)
/* viewModel.awb(System.currentTimeMillis().toString())
viewModel.awbObserver.observe(this) { vd ->
val noneObj = JSONObject()
noneObj["name"] = "请选择运单类型"
noneObj["code"] = ""
viewModel.awbList.add(noneObj)
viewModel.awbList.addAll(vd.getJSONArray("data"))
totalRequestNotifyAdapter()
}*/
/////////////// 下拉框 end
}
/**
* 所有请求结束更细adpter 只适用于刚开始加载
*/
private fun totalRequestNotifyAdapter() {
adapter.notifyDataSetChanged()
}
/**
* 初始化网络请求
*/
private fun initNetWork(id: String?, wbNo: String?, status: String) {
selObserve()
viewModel.queryWaybillById(id!!.toInt(), 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
}
//输入框
else {
if (must && inputContent == "") {
Common.showToast(this, "请输入$titleName")
return
}
viewModel.waybillFormNetWork[c.titleCode] = inputContent
//前缀不为空时,赋值
if (titleCodePre != null && titleCodePre != "" && inputContentPre != null && inputContentPre != "") {
viewModel.waybillFormNetWork[titleCodePre] = inputContentPre
}
}
}
//1.新增
if (id == null) {
//身份证、电话号码校验
val cardNoStr = cardNo.text.toString()
val telPhoneStr = telPhone.text.toString()
if (cardNoStr != "" && !Common.isIDNumber(cardNoStr)) {
Common.showToast(this, "请输入正确的身份证号!")
return
}
if (telPhoneStr != "" && !Common.isPhoneNum(telPhoneStr)) {
Common.showToast(this, "请输入正确的电话号码!")
return
}
//输入运单号需要校验规则判断前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.saveFestGjjCangDan(
fid, viewModel.waybillFormNetWork.getString("prefix"), viewModel.waybillFormNetWork.getString("no"),
viewModel.waybillFormNetWork.getString("agentCode"), viewModel.waybillFormNetWork.getString("spCode"),
viewModel.waybillFormNetWork.getString("location"), viewModel.waybillFormNetWork.getIntValue("totalPc"),
viewModel.waybillFormNetWork.getIntValue("pc"), viewModel.waybillFormNetWork.getDoubleValue("weight"),
viewModel.waybillFormNetWork.getString("goods"), viewModel.waybillFormNetWork.getString("origin"),
viewModel.waybillFormNetWork.getString("dest"), viewModel.waybillFormNetWork.getString("businessType"),
viewModel.waybillFormNetWork.getString("remark"), viewModel.waybillFormNetWork.getString("awbType"),
viewModel.waybillFormNetWork.getDoubleValue("cashWeight"), receive.text.toString(), cardNoStr, telPhoneStr
)
return
}
//2.查看
if (id != null && id != "" && ref != null && ref == GjjCommon.CangDan.Ref.read) {
finish()
return
}
//3.编辑
if (id != null && id != "" && ref != null && ref != GjjCommon.CangDan.Ref.read) {
//身份证、电话号码校验
val cardNoStr = cardNo.text.toString()
val telPhoneStr = telPhone.text.toString()
if (cardNoStr != "" && !Common.isIDNumber(cardNoStr)) {
Common.showToast(this, "请输入正确的身份证号!")
return
}
if (telPhoneStr != "" && !Common.isPhoneNum(telPhoneStr)) {
Common.showToast(this, "请输入正确的电话号码!")
return
}
loading()
viewModel.updateFestGjjCangDan(
id!!.toInt(),
fid, viewModel.waybillFormNetWork.getString("prefix"), viewModel.waybillFormNetWork.getString("no"),
viewModel.waybillFormNetWork.getString("agentCode"), viewModel.waybillFormNetWork.getString("spCode"),
viewModel.waybillFormNetWork.getString("location"), viewModel.waybillFormNetWork.getIntValue("totalPc"),
viewModel.waybillFormNetWork.getIntValue("pc"), viewModel.waybillFormNetWork.getDoubleValue("weight"),
viewModel.waybillFormNetWork.getString("goods"), viewModel.waybillFormNetWork.getString("origin"),
viewModel.waybillFormNetWork.getString("dest"), viewModel.waybillFormNetWork.getString("businessType"),
viewModel.waybillFormNetWork.getString("remark"), viewModel.waybillFormNetWork.getString("awbType"),
viewModel.waybillFormNetWork.getDoubleValue("cashWeight"), receive.text.toString(), cardNoStr, telPhoneStr
)
return
}
}
/**
* 初始化列表数据
*/
private fun initData(status: String) {
var write = false
var waybillOperator = false
when (status) {
GjjCommon.CangDan.Info.read -> {
write = false
waybillOperator = false
}
GjjCommon.CangDan.Info.add -> {
write = true
waybillOperator = true
}
GjjCommon.CangDan.Info.update -> {
write = true
waybillOperator = false
}
}
collectList.clear()
collectList.add(
GjjCangDanInfoItemModel(
true, waybillOperator, "运单号", "no", viewModel.waybillFormNetWork.getString("no") ?: "",
"prefix", viewModel.waybillFormNetWork.getString("prefix") ?: ""
)
)
collectList.add(
GjjCangDanInfoItemModel(
true,
write,
"代理",
"agentCode",
viewModel.agentCodeList,
viewModel.waybillFormNetWork.getString("agentCode") ?: "", viewModel.waybillFormNetWork.getString("agentName") ?: ""
)
)
collectList.add(
GjjCangDanInfoItemModel(
true,
write,
"业务类型",
"businessType",
viewModel.businessList,
viewModel.waybillFormNetWork.getString("businessType") ?: "", ""
)
)
collectList.add(
GjjCangDanInfoItemModel(
true,
write,
"总件数",
"totalPc",
viewModel.waybillFormNetWork.getString("totalPc") ?: ""
)
)
collectList.add(GjjCangDanInfoItemModel(true, write, "实到件数", "pc", viewModel.waybillFormNetWork.getString("pc") ?: ""))
collectList.add(
GjjCangDanInfoItemModel(
true,
write,
"实到重量",
"weight",
viewModel.waybillFormNetWork.getString("weight") ?: ""
)
)
collectList.add(GjjCangDanInfoItemModel(true, write, "品名", "goods", viewModel.waybillFormNetWork.getString("goods") ?: ""))
collectList.add(
GjjCangDanInfoItemModel(
false,
write,
"计费重量",
"cashWeight",
viewModel.waybillFormNetWork.getString("cashWeight") ?: ""
)
)
collectList.add(
GjjCangDanInfoItemModel(
false,
write,
"特码",
"spCode",
viewModel.specialCodeList,
viewModel.waybillFormNetWork.getString("spCode") ?: "", ""
)
)
collectList.add(GjjCangDanInfoItemModel(true, write, "始发港", "origin", viewModel.waybillFormNetWork.getString("origin") ?: ""))
collectList.add(GjjCangDanInfoItemModel(true, write, "目的港", "dest", viewModel.waybillFormNetWork.getString("dest") ?: ""))
collectList.add(
GjjCangDanInfoItemModel(
true,
write,
"运单类型",
"awbType",
viewModel.awbList,
viewModel.waybillFormNetWork.getString("awbType") ?: "", ""
)
)
collectList.add(GjjCangDanInfoItemModel(false, write, "库位", "location", viewModel.waybillFormNetWork.getString("location") ?: ""))
collectList.add(GjjCangDanInfoItemModel(false, write, "备注", "remark", viewModel.waybillFormNetWork.getString("remark") ?: ""))
totalRequestNotifyAdapter()
}
/**
* 清空数据
*/
private fun reset() {
//1.清空数据
viewModel.waybillFormNetWork.clear()
receive.setText("")
cardNo.setText("")
telPhone.setText("")
initData(GjjCommon.CangDan.Info.add)
}
}

View File

@@ -0,0 +1,477 @@
package com.lukouguoji.gjj.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.gjj.R
import com.lukouguoji.gjj.adapt.GjjCangDanListAdapter
import com.lukouguoji.gjj.model.GjjCangDanListModel
import com.lukouguoji.gjj.viewModel.GjjCangDanListViewModel
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_GJJ_CANG_DAN_LIST)
class GjjCangDanListActivity : BaseActivity(), View.OnClickListener {
private lateinit var viewModel: GjjCangDanListViewModel
private lateinit var adapter: GjjCangDanListAdapter
private val collectList = ArrayList<GjjCangDanListModel>()
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 fdep: EditText
private lateinit var dest: EditText
private lateinit var endDate: TextView
private lateinit var searchLayout: LinearLayout
private lateinit var addIcon: ImageView
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
private fun initView() {
viewModel = ViewModelProvider(this).get(GjjCangDanListViewModel::class.java)
val layoutManager = LinearLayoutManager(this)
adapter = GjjCangDanListAdapter(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)
fdep = findViewById(R.id.fdep)
dest = findViewById(R.id.dest)
endDate = findViewById(R.id.endDate)
searchLayout = findViewById(R.id.searchLayout)
addIcon = findViewById(R.id.addIcon)
checkIcon = findViewById(R.id.checkIcon)
quickSearch = findViewById(R.id.quickSearch)
//列表
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)
fdate.setOnClickListener(this)
startDateIcon.setOnClickListener(this)
endDate.setOnClickListener(this)
searchLayout.setOnClickListener(this)
addIcon.setOnClickListener(this)
checkIcon.setOnClickListener(this)
send.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 = GjjCangDanListAdapter(
ActivityCollector.getLastActivity()!!,
viewModel,
filterCollectionList as MutableList<GjjCangDanListModel>
)
} else {
recyclerView.adapter = GjjCangDanListAdapter(
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_gjj_cang_dan_list)
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 no = itemObj.getString("wbNo") ?: ""
val goods = itemObj.getString("goods") ?: ""
val awbType = itemObj.getString("awbType") ?: ""
val startPort = itemObj.getString("origin") ?: ""
val destPort = itemObj.getString("dest") ?: ""
val agentCode = itemObj.getString("agentCode") ?: ""
val spCode = itemObj.getString("spCode") ?: ""
val totalPc = itemObj.getIntValue("totalPc")
val pc = itemObj.getIntValue("pc")
val acWeight = itemObj.getDoubleValue("weight")//实到重量
val chWight = itemObj.getDoubleValue("cashWeight")//计费重量
val ref = itemObj.getString("ref") ?: ""// 1查看
//列表赋值
collectList.add(
GjjCangDanListModel(
mfId.toString(),
no,
goods,
awbType,
startPort,
destPort,
agentCode,
spCode,
totalPc,
pc,
acWeight,
chWight,
false,
ref
)
)
}
//3.调adpter展示
if (currentPage == 1) {
val layoutManager = LinearLayoutManager(this)
adapter = GjjCangDanListAdapter(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()
}
totalPc.text = totalCount.toString()
resetSelCount(false)
}
//航班返回结果
viewModel.intFlightGjjCangDanObserver.observe(this) {
loadingCancel()
val status = it.getString("status")
if (Constant.Result.succ == status) {
var jsonObject = it.getJSONObject("data")
viewModel.fid = jsonObject.getInteger("fid")
viewModel.prefix = jsonObject.getString("prefix")
val actualArrival = jsonObject.getString("actualArrival")
val fdepParam = jsonObject.getString("fdep")//始发港
val fdest = jsonObject.getString("fdest")//目的港
fdep.setText(fdepParam)
dest.setText(fdest)
endDate.text = actualArrival
if (viewModel.fid != null) {
listLayout.visibility = View.VISIBLE
totalLayout.visibility = View.VISIBLE
resetSearch()
}
} else {
//无数据
}
}
//删除行 返回结果
viewModel.deleteFestGjjCangDanObserver.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)
resetSelCount(false)
val 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, "删除失败!")
}
}
//货物发放 返回结果
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()
}
//监听 复选框选中
viewModel.checkCount.observe(this) {
selPc.text = it.toString()
}
/////////////////////////////// 加载刷新的布局
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.endDate -> {
Common.onYearMonthDay(this, endDate.text.toString()) { year, month, day ->
calendar.set(year, month - 1, day)
endDate.text = ymdSdf.format(calendar.time)
}
}
R.id.searchLayout -> {
endDate.text = ""
dest.setText("")
doFlight()
}
R.id.addIcon -> {
ARouter.getInstance().build(ARouterConstants.ACTIVITY_URL_GJJ_CANG_DAN_INFO).withString("id", null).withString("ref", null)
.withInt("fid", viewModel.fid ?: -9999).withString("prefix", viewModel.prefix)
.navigation(this, Constant.RequestCode.gjj_cang_dan_list)
}
R.id.checkIcon -> {
//重置 isAllCheck
isAllCheck = !isAllCheck
resetSelCount(isAllCheck)
}
R.id.send -> {
val ids = collectList.filter { c -> c.isCheck }.map { c -> c.id.toInt() }
viewModel.provideGjjCangDan(viewModel.fid!!, ids)
}
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() {
/*if (fdate.text.toString() == "" || fno.text.toString() == "") {
Common.showToast(this, "航班日期和航班号不可为空!")
return
}*/
loading()
viewModel.search(
pageSize,
currentPage,
"",
"",
"",
fdate.text.toString(),
fno.text.toString(),
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
""
)
}
/**
* 重置数据,搜索
*/
private fun resetSearch() {
//recyclerView 清除所有数据数据
viewModel.setCheckCount(0)
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
totalLayout.visibility = View.GONE
viewModel.intFlightGjjCangDan(fdate.text.toString(), fno.text.toString())
}
/**
* 重新计算选中数量
* isAllCheckParam true全选 false:全部全效选择
*/
private fun resetSelCount(isAllCheckParam: Boolean) {
var selCount = 0
collectList.forEach { c ->
//不是出库 并且 选中,可以选
if (c.ref != "1" && isAllCheckParam) {
c.isCheck = isAllCheckParam
++selCount
} else {
c.isCheck = false
}
}
if (isAllCheckParam) {
viewModel.setCheckCount(selCount)
} else {
viewModel.setCheckCount(0)
}
adapter.notifyDataSetChanged()
}
}

View File

@@ -0,0 +1,544 @@
package com.lukouguoji.gjj.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.lifecycle.viewModelScope
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.alibaba.android.arouter.facade.annotation.Route
import com.alibaba.fastjson.JSONArray
import com.alibaba.fastjson.JSONObject
import com.lukouguoji.gjj.R
import com.lukouguoji.gjj.adapt.GjjChuKuListAdapter
import com.lukouguoji.gjj.model.GjjChuKuListModel
import com.lukouguoji.gjj.viewModel.GjjChuKuListViewModel
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 kotlinx.coroutines.launch
import java.text.SimpleDateFormat
import java.util.*
@Route(path = ARouterConstants.ACTIVITY_URL_GJJ_CHU_KU_LIST)
class GjjChuKuListActivity : BaseActivity(), View.OnClickListener {
private val currentTitleName = "国际进港出库"
private lateinit var viewModel: GjjChuKuListViewModel
private lateinit var adapter: GjjChuKuListAdapter
private val collectList = ArrayList<GjjChuKuListModel>()
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 startDate: TextView
private lateinit var endDate: TextView
private lateinit var wbNo: EditText
private lateinit var pickNo: EditText
private lateinit var scanIcon: ImageView
private lateinit var searchLayout: LinearLayout
private lateinit var checkIcon: ImageView
private lateinit var quickSearch: EditText
private var isAllCheck = true
//筛选页
private lateinit var searchListFragment: LinearLayout
private lateinit var filtrateLayout: LinearLayout
private lateinit var filtrateFragment: LinearLayout
private lateinit var agentCode: TextView
private var agentCodeValue = ""
private lateinit var submit: TextView
private lateinit var reset: TextView
//列表
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
private fun initView() {
viewModel = ViewModelProvider(this).get(GjjChuKuListViewModel::class.java)
val layoutManager = LinearLayoutManager(this)
adapter = GjjChuKuListAdapter(this, viewModel, collectList)
var recyclerView: RecyclerView = 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)
startDate = findViewById(R.id.startDate)
endDate = findViewById(R.id.endDate)
wbNo = findViewById(R.id.wbNo)
pickNo = findViewById(R.id.pickNo)
scanIcon = findViewById(R.id.scanIcon)
searchLayout = findViewById(R.id.searchLayout)
filtrateLayout = findViewById(R.id.filtrateLayout)
checkIcon = findViewById(R.id.checkIcon)
quickSearch = findViewById(R.id.quickSearch)
//筛选页
searchListFragment = findViewById(R.id.searchListFragment)
filtrateFragment = findViewById(R.id.filtrateFragment)
agentCode = findViewById(R.id.agentCode)
submit = findViewById(R.id.submit)
reset = findViewById(R.id.reset)
//列表
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)
toolBack.setOnClickListener(this)
startDate.setOnClickListener(this)
endDate.setOnClickListener(this)
scanIcon.setOnClickListener(this)
searchLayout.setOnClickListener(this)
checkIcon.setOnClickListener(this)
send.setOnClickListener(this)
filtrateLayout.setOnClickListener(this)
agentCode.setOnClickListener(this)
submit.setOnClickListener(this)
reset.setOnClickListener(this)
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() != "" && s.length == 4) {
viewModel.queryWbNoGjjChuKu(s.toString())
}
}
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()) }
recyclerView.adapter = GjjChuKuListAdapter(
ActivityCollector.getLastActivity()!!,
viewModel,
filterCollectionList as MutableList<GjjChuKuListModel>
)
} else {
recyclerView.adapter = GjjChuKuListAdapter(
ActivityCollector.getLastActivity()!!,
viewModel,
collectList
)
}
adapter.notifyDataSetChanged()
}
override fun afterTextChanged(s: Editable?) {
}
})
startDate.text = "${ymdSdf.format(Date())} 00:00:00"
endDate.text ="${ymdSdf.format(Date())} 23:59:59"
}
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_gjj_chu_ku_list)
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 id = itemObj.getIntValue("id")
val pkId = itemObj.getString("pkId") ?: ""
val no = itemObj.getString("wbNo") ?: ""
val fno = itemObj.getString("fno") ?: ""
val pc = itemObj.getIntValue("pc")
val weight = itemObj.getDoubleValue("weight")//实到重量
val goods = itemObj.getString("goods") ?: ""
val agentCode = itemObj.getString("agentCode") ?: ""
val spCode = itemObj.getString("spCode") ?: ""
val pickDate = itemObj.getString("chargeTime") ?: ""
//列表赋值
collectList.add(
GjjChuKuListModel(
id,
no,
pkId,
fno,
pc,
weight,
goods,
agentCode,
spCode,
pickDate, false
)
)
}
//3.调adpter展示
if (currentPage == 1) {
adapter.notifyDataSetChanged()
} else {
adapter.notifyItemRangeInserted((currentPage - 1) * 10, collectList.size)
}
refreshLayout.finishRefresh()
refreshLayout.finishLoadMore()
}
totalPc.text = totalCount.toString()
selPc.text = viewModel.checkCount.value.toString()
}
//查询运单号四位返回结果
viewModel.viewModelScope.launch {
viewModel.queryWbNoGjjChuKuParamLive.collect {
//1.获取数据
if (it["status"] == Constant.Result.succ && it.getJSONArray("data").size > 0) {
val tempArr = JSONArray()
it.getJSONArray("data").forEach { wayNo ->
val tempObj = JSONObject()
tempObj["name"] = wayNo.toString()
tempObj["code"] = wayNo.toString()
tempArr.add(tempObj)
}
Common.singleSelect(ActivityCollector.getLastActivity()!!, "请选择运单号", tempArr, "") { _, item ->
val jsonObject = item as JSONObject
val name = jsonObject.getString("name")
val code = jsonObject.getString("code")
wbNo.setText(code)
resetSearch()
}
}
}
}
//根据id返回结果
viewModel.queryPickByIdGjjChuKuObserver.observe(this) {
loadingCancel()
//1.获取数据
var status = it.getString("status")
if (status == Constant.Result.succ) {
var itemObj = it.getJSONObject("data")
val id = itemObj.getIntValue("id")
val pkId = itemObj.getString("pkId") ?: ""
val no = itemObj.getString("wbNo") ?: ""
val fno = itemObj.getString("fno") ?: ""
val pc = itemObj.getIntValue("pc")
val weight = itemObj.getDoubleValue("weight")//实到重量
val goods = itemObj.getString("goods") ?: ""
val agentCode = itemObj.getString("agentCode") ?: ""
val spCode = itemObj.getString("spCode") ?: ""
val pickDate = itemObj.getString("chargeTime") ?: ""
//列表赋值
collectList.add(
GjjChuKuListModel(
id,
no,
pkId,
fno,
pc,
weight,
goods,
agentCode,
spCode,
pickDate, false
)
)
//3.调adpter展示
adapter.notifyDataSetChanged()
refreshLayout.finishRefresh()
refreshLayout.finishLoadMore()
totalCount = 1
viewModel.setCheckCount(0)
totalPc.text = totalCount.toString()
selPc.text = viewModel.checkCount.value.toString()
}
}
//货物发放 返回结果
viewModel.completedGjjChuKuObserver.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, "出库成功!")
}
} 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()
}
//监听 复选框选中
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
viewModel.agentCode(System.currentTimeMillis().toString())
viewModel.agentCodeObserver.observe(this) { vd ->
val noneObj = JSONObject()
noneObj["name"] = "请选择代理人"
noneObj["code"] = ""
viewModel.agentCodeList.add(noneObj)
viewModel.agentCodeList.addAll(vd.getJSONArray("data"))
}
/////////////// 下拉框 end
}
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.startDate -> {
Common.onYearMonthDayTime(this, startDate.text.toString()) { year, month, day, hour, minute, second ->
calendar.set(year, month - 1, day, hour, minute, second)
startDate.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.scanIcon -> {
scanCode(Constant.RequestCode.gnj_chu_ku_list)
}
R.id.searchLayout -> {
// viewModel.queryPickByIdGnjChuKu("M000995643")
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
}
}
R.id.checkIcon -> {
collectList.forEach { c ->
c.isCheck = isAllCheck
}
if (isAllCheck) {
viewModel.setCheckCount(totalCount)
} else {
viewModel.setCheckCount(0)
}
//重置 isAllCheck
isAllCheck = !isAllCheck
adapter.notifyDataSetChanged()
}
R.id.send -> {
val ids = collectList.filter { c -> c.isCheck }.map { c -> c.id }
viewModel.completedGjjChuKu(ids)
}
R.id.agentCode -> {
Common.singleSelect(this, "代理", viewModel.agentCodeList, agentCodeValue) { _, item ->
val jsonObject = item as JSONObject
val name = jsonObject.getString("name")
val code = jsonObject.getString("code")
agentCode.text = name
agentCodeValue = code
}
}
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()
}
}
}
}
/**
* 扫码返回的结果
*/
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.gnj_chu_ku_list -> {
collectList.clear()
currentPage = 1
refreshLayout.setNoMoreData(false)
pickNo.setText("$content")
viewModel.queryPickByIdGjjChuKu(content)
}
}
}
}
/**
* 搜索
*/
private fun searchFun() {
loading()
listLayout.visibility = View.GONE
totalLayout.visibility = View.GONE
viewModel.search(
pageSize,
currentPage,
wbNo.text.toString(),
agentCode.text.toString(),
pickNo.text.toString(),
startDate.text.toString(),
endDate.text.toString()
)
}
/**
* 重置数据,搜索
*/
private fun resetSearch() {
//recyclerView 清除所有数据数据
viewModel.setCheckCount(0)
refreshLayout.setNoMoreData(false)
adapter.notifyItemRangeRemoved(0, collectList.size)
collectList.clear()
currentPage = 1
searchFun()
}
/**
* 重置筛选条件
*/
private fun resetFun() {
currentPage = 1
startDate.text = "${ymdSdf.format(Date())} 00:00:00"
endDate.text ="${ymdSdf.format(Date())} 23:59:59"
wbNo.setText("")
pickNo.setText("")
agentCode.text = ""
agentCodeValue = ""
}
}

View File

@@ -0,0 +1,37 @@
package com.lukouguoji.gjj.activity
import android.content.Context
import android.content.Intent
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import com.lukouguoji.gjj.R
import com.lukouguoji.gjj.databinding.ActivityGjjGoodsAddBinding
import com.lukouguoji.gjj.viewModel.GjjGoodsAddViewModel
import com.lukouguoji.module_base.base.BaseBindingActivity
import com.lukouguoji.module_base.ktx.addOnItemClickListener
class GjjGoodsAddActivity :
BaseBindingActivity<ActivityGjjGoodsAddBinding, GjjGoodsAddViewModel>() {
override fun layoutId() = R.layout.activity_gjj_goods_add
override fun viewModelClass() = GjjGoodsAddViewModel::class.java
override fun initOnCreate(savedInstanceState: Bundle?) {
setBackArrow("国际进港货物开始交接")
binding.viewModel = viewModel
viewModel.pageModel.bindSmartRefreshLayout(binding.srl, binding.rv, viewModel, this)
binding.rv.addOnItemClickListener(viewModel)
viewModel.getData()
}
companion object {
@JvmStatic
fun start(context: Context) {
val starter = Intent(context, GjjGoodsAddActivity::class.java)
context.startActivity(starter)
}
}
}

View File

@@ -0,0 +1,35 @@
package com.lukouguoji.gjj.activity
import android.os.Bundle
import com.alibaba.android.arouter.facade.annotation.Route
import com.lukouguoji.gjj.R
import com.lukouguoji.gjj.databinding.ActivityGjjGoodsListBinding
import com.lukouguoji.gjj.holder.GjjGoodsListViewHolder
import com.lukouguoji.gjj.viewModel.GjjGoodsListViewModel
import com.lukouguoji.module_base.base.BaseBindingActivity
import com.lukouguoji.module_base.base.CommonAdapter
import com.lukouguoji.module_base.ktx.addOnItemClickListener
import com.lukouguoji.module_base.router.ARouterConstants
@Route(path = ARouterConstants.ACTIVITY_URL_GJJ_GOODS)
class GjjGoodsListActivity :
BaseBindingActivity<ActivityGjjGoodsListBinding, GjjGoodsListViewModel>() {
override fun layoutId() = R.layout.activity_gjj_goods_list
override fun viewModelClass() = GjjGoodsListViewModel::class.java
override fun initOnCreate(savedInstanceState: Bundle?) {
setBackArrow("国际进港货物交接")
binding.viewModel = viewModel
binding.rv.addOnItemClickListener(viewModel)
viewModel.pageModel.bindSmartRefreshLayout(binding.srl, binding.rv, viewModel, this)
}
override fun onResume() {
super.onResume()
viewModel.refresh()
}
}

View File

@@ -0,0 +1,55 @@
package com.lukouguoji.gjj.activity
import android.content.Context
import android.content.Intent
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import com.lukouguoji.gjj.R
import com.lukouguoji.gjj.databinding.ActivityGjjGoodsManifestBinding
import com.lukouguoji.gjj.viewModel.GjjGoodsManifestViewModel
import com.lukouguoji.module_base.adapter.loadImage
import com.lukouguoji.module_base.base.BaseBindingActivity
import com.lukouguoji.module_base.common.Constant
import com.lukouguoji.module_base.common.ConstantEvent
import com.lukouguoji.module_base.impl.FlowBus
import com.lukouguoji.module_base.impl.observe
import com.lukouguoji.module_base.ktx.noNull
import com.yzq.zxinglibrary.encode.CodeCreator
class GjjGoodsManifestActivity :
BaseBindingActivity<ActivityGjjGoodsManifestBinding, GjjGoodsManifestViewModel>() {
override fun layoutId() = R.layout.activity_gjj_goods_manifest
override fun viewModelClass() = GjjGoodsManifestViewModel::class.java
override fun initOnCreate(savedInstanceState: Bundle?) {
viewModel.id = intent.getStringExtra(Constant.Key.ID).noNull()
binding.viewModel = viewModel
viewModel.pageModel.rv = binding.rv
viewModel.getData()
CodeCreator.createQRCode("123456", 400, 400, null)?.let {
loadImage(binding.iv, it)
}
FlowBus.with<String>(ConstantEvent.SIGNATURE_SUCCESS)
.observe(this) {
viewModel.signature.postValue(it)
viewModel.submitSignature(requireContext(), it)
}
viewModel.resultSign.observe(this) {
loadImage(binding.ivSign, it)
}
}
companion object {
@JvmStatic
fun start(context: Context, id: String) {
val starter = Intent(context, GjjGoodsManifestActivity::class.java)
.putExtra(Constant.Key.ID, id)
context.startActivity(starter)
}
}
}

View File

@@ -0,0 +1,39 @@
package com.lukouguoji.gjj.activity
import android.content.Context
import android.content.Intent
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import com.lukouguoji.gjj.R
import com.lukouguoji.gjj.databinding.ActivityGjjManifestAddBinding
import com.lukouguoji.gjj.viewModel.GjjManifestAddViewModel
import com.lukouguoji.module_base.base.BaseBindingActivity
import com.lukouguoji.module_base.common.Constant
import com.lukouguoji.module_base.ktx.noNull
class GjjManifestAddActivity :
BaseBindingActivity<ActivityGjjManifestAddBinding, GjjManifestAddViewModel>() {
override fun layoutId() = R.layout.activity_gjj_manifest_add
override fun viewModelClass() = GjjManifestAddViewModel::class.java
override fun initOnCreate(savedInstanceState: Bundle?) {
setBackArrow("国际进港舱单新增")
viewModel.fid = intent.getStringExtra(Constant.Key.ID).noNull()
viewModel.departure.value = intent.getStringExtra(Constant.Key.DEPARTURE).noNull()
viewModel.destination.value = intent.getStringExtra(Constant.Key.DESTINATION).noNull()
binding.viewModel = viewModel
}
companion object {
@JvmStatic
fun start(context: Context, fid: String = "", dep: String, dest: String) {
val starter = Intent(context, GjjManifestAddActivity::class.java)
.putExtra(Constant.Key.ID, fid)
.putExtra(Constant.Key.DEPARTURE, dep)
.putExtra(Constant.Key.DESTINATION, dest)
context.startActivity(starter)
}
}
}

View File

@@ -0,0 +1,38 @@
package com.lukouguoji.gjj.activity
import android.content.Context
import android.content.Intent
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import com.lukouguoji.gjj.R
import com.lukouguoji.gjj.databinding.ActivityGjjManifestDetailsBinding
import com.lukouguoji.gjj.viewModel.GjjManifestDetailsViewModel
import com.lukouguoji.module_base.base.BaseBindingActivity
import com.lukouguoji.module_base.common.Constant
import com.lukouguoji.module_base.ktx.noNull
class GjjManifestDetailsActivity :
BaseBindingActivity<ActivityGjjManifestDetailsBinding, GjjManifestDetailsViewModel>() {
override fun layoutId() = R.layout.activity_gjj_manifest_details
override fun viewModelClass() = GjjManifestDetailsViewModel::class.java
override fun initOnCreate(savedInstanceState: Bundle?) {
setBackArrow("国际进港舱单详情")
viewModel.id = intent.getStringExtra(Constant.Key.ID).noNull()
binding.viewModel = viewModel
viewModel.getData()
}
companion object {
@JvmStatic
fun start(context: Context, id: String) {
val starter = Intent(context, GjjManifestDetailsActivity::class.java)
.putExtra(Constant.Key.ID, id)
context.startActivity(starter)
}
}
}

View File

@@ -0,0 +1,47 @@
package com.lukouguoji.gjj.activity
import android.content.Context
import android.content.Intent
import android.os.Bundle
import com.alibaba.android.arouter.facade.annotation.Route
import com.lukouguoji.gjj.R
import com.lukouguoji.gjj.databinding.ActivityGjjManifestBinding
import com.lukouguoji.gjj.holder.GjjManifestListViewHolder
import com.lukouguoji.gjj.viewModel.GjjManifestListViewModel
import com.lukouguoji.module_base.base.BaseBindingActivity
import com.lukouguoji.module_base.base.CommonAdapter
import com.lukouguoji.module_base.ktx.addOnItemClickListener
import com.lukouguoji.module_base.router.ARouterConstants
@Route(path = ARouterConstants.ACTIVITY_URL_GJJ_MANIFEST)
class GjjManifestListActivity :
BaseBindingActivity<ActivityGjjManifestBinding, GjjManifestListViewModel>() {
override fun layoutId() = R.layout.activity_gjj_manifest
override fun initOnCreate(savedInstanceState: Bundle?) {
setBackArrow("国际进港舱单")
binding.viewModel = viewModel
binding.rv.addOnItemClickListener(viewModel)
viewModel.pageModel.bindSmartRefreshLayout(binding.srl, binding.rv, viewModel, this)
viewModel.init(requireContext())
}
override fun onResume() {
super.onResume()
viewModel.refresh()
}
override fun viewModelClass() = GjjManifestListViewModel::class.java
companion object {
@JvmStatic
fun start(context: Context) {
val starter = Intent(context, GjjManifestListActivity::class.java)
context.startActivity(starter)
}
}
}

View File

@@ -0,0 +1,36 @@
package com.lukouguoji.gjj.activity
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import com.alibaba.android.arouter.facade.annotation.Route
import com.lukouguoji.gjj.R
import com.lukouguoji.gjj.databinding.ActivityGjjPacketParseBinding
import com.lukouguoji.gjj.viewModel.GjjPacketParseViewModel
import com.lukouguoji.module_base.BaseActivity
import com.lukouguoji.module_base.base.BaseBindingActivity
import com.lukouguoji.module_base.ktx.addOnItemClickListener
import com.lukouguoji.module_base.router.ARouterConstants
@Route(path = ARouterConstants.ACTIVITY_URL_GJJ_PACKET_PARSE)
class GjjPacketParseActivity :
BaseBindingActivity<ActivityGjjPacketParseBinding, GjjPacketParseViewModel>() {
override fun layoutId() = R.layout.activity_gjj_packet_parse
override fun viewModelClass() = GjjPacketParseViewModel::class.java
override fun initOnCreate(savedInstanceState: Bundle?) {
setBackArrow("国际进港电报解析")
binding.viewModel = viewModel
viewModel.pageModel.bindSmartRefreshLayout(binding.srl, binding.rv, viewModel, this)
binding.rv.addOnItemClickListener(viewModel)
viewModel.flightNo.observe(this) {
viewModel.getDepartureDictList()
}
viewModel.init(requireContext())
}
}

View File

@@ -0,0 +1,188 @@
package com.lukouguoji.gjj.activity
import android.os.Bundle
import android.view.View
import android.widget.LinearLayout
import android.widget.TextView
import android.widget.Toast
import androidx.core.widget.NestedScrollView
import androidx.lifecycle.ViewModelProvider
import androidx.recyclerview.widget.GridLayoutManager
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.android.arouter.launcher.ARouter
import com.alibaba.fastjson.JSONObject
import com.lukouguoji.gjj.R
import com.lukouguoji.gjj.adapt.GjjQueryInfoListAdapter
import com.lukouguoji.gjj.adapt.GjjQueryInfoWhListAdapter
import com.lukouguoji.gjj.model.GjjQueryInfo
import com.lukouguoji.gjj.model.GjjQueryInfoWh
import com.lukouguoji.gjj.viewModel.GjjQueryInfoViewModel
import com.lukouguoji.module_base.BaseActivity
import com.lukouguoji.module_base.common.Constant
import com.lukouguoji.module_base.router.ARouterConstants
@Route(path = ARouterConstants.ACTIVITY_URL_GJJ_QUERY_INFO)
class GjjQueryInfoActivity : BaseActivity(), View.OnClickListener {
private lateinit var viewModel: GjjQueryInfoViewModel
private lateinit var scrollView: NestedScrollView
private lateinit var queryInfoList: RecyclerView
private lateinit var adapter: GjjQueryInfoListAdapter
private val queryInfoAdapterList = arrayListOf<GjjQueryInfo>()
private lateinit var submit: TextView
private lateinit var refWareHouseInfo: LinearLayout
private lateinit var wareHouseInfoLayout: LinearLayout
private lateinit var queryWareHouseInfoList: RecyclerView
private lateinit var wareHouseInfoAdapter: GjjQueryInfoWhListAdapter
private val queryWareHouseInfoAdapterList = arrayListOf<GjjQueryInfoWh>()
@JvmField
@Autowired
var id: Int = -9999
@JvmField
@Autowired
var wbNoParam: String? = null
private fun initView() {
viewModel = ViewModelProvider(this).get(GjjQueryInfoViewModel::class.java)
scrollView = findViewById(R.id.scrollView)
refWareHouseInfo = findViewById(R.id.refWareHouseInfo)
wareHouseInfoLayout = findViewById(R.id.wareHouseInfoLayout)
submit = findViewById(R.id.submit)
val layoutManager = GridLayoutManager(this, 2)
adapter = GjjQueryInfoListAdapter(this, queryInfoAdapterList)
queryInfoList = findViewById(R.id.gncQueryInfoList)
queryInfoList.adapter = adapter
queryInfoList.layoutManager = layoutManager
val wareHouseLayoutManager = LinearLayoutManager(this)
wareHouseInfoAdapter = GjjQueryInfoWhListAdapter(this, queryWareHouseInfoAdapterList)
queryWareHouseInfoList = findViewById(R.id.gncQueryWareHouseInfoList)
queryWareHouseInfoList.adapter = wareHouseInfoAdapter
queryWareHouseInfoList.layoutManager = wareHouseLayoutManager
refWareHouseInfo.setOnClickListener(this)
submit.setOnClickListener(this)
}
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_gjj_query_info)
setBackArrow("国际进港查询详情")
initView()
// initData()
viewModel.queryWaybillById(id, wbNoParam)
viewModel.waybillLiveData.observe(this) {
val status = it.getString("status")
if (Constant.Result.succ == status) {
viewModel.wayBillInfo = it.getJSONObject("data")
//主运单详情
val maWbObj = viewModel.wayBillInfo.getJSONObject("maWb")
val wbNo =
(maWbObj.getString("prefix") ?: "") + (maWbObj.getString("no") ?: "")
adapter.append(GjjQueryInfo(1, "运单号", wbNo))
viewModel.wbNo = wbNo
adapter.append(GjjQueryInfo(1, "总件数", maWbObj.getIntValue("pc").toString()))
adapter.append(
GjjQueryInfo(
1,
"总重量",
"${maWbObj.getDoubleValue("grossweight")} KG"
)
)
adapter.append(GjjQueryInfo(1, "承运人", maWbObj.getString("carrier") ?: ""))
adapter.append(GjjQueryInfo(1, "目的港", maWbObj.getString("dest") ?: ""))
adapter.append(GjjQueryInfo(1, "品名(英)", maWbObj.getString("goods") ?: ""))
adapter.append(GjjQueryInfo(1, "特码", maWbObj.getString("spcode") ?: ""))
adapter.append(GjjQueryInfo(1, "代理", maWbObj.getString("agent") ?: ""))
adapter.append(GjjQueryInfo(1, "运单类型", maWbObj.getString("awbtype") ?: ""))
adapter.append(GjjQueryInfo(1, "业务类型", maWbObj.getString("businesstype") ?: ""))
adapter.append(GjjQueryInfo(1, "包装类型", maWbObj.getString("packagecode") ?: ""))
/*adapter.append(GjjQueryInfo(1, "卸货港", maWbObj.getString("dest1") ?: ""))
adapter.append(GjjQueryInfo(1, "危险品描述", maWbObj.getString("dgrDetail") ?: ""))
adapter.append(GjjQueryInfo(1, "危险品库位", maWbObj.getString("dgrLocation") ?: ""))
adapter.append(GjjQueryInfo(1, "航班", maWbObj.getString("flight") ?: ""))
adapter.append(GjjQueryInfo(1, "入库时间", maWbObj.getString("opDate") ?: ""))
adapter.append(GjjQueryInfo(1, "出库时间", maWbObj.getString("mclose") ?: ""))
adapter.append(GjjQueryInfo(1, "收运人", maWbObj.getString("opId") ?: ""))*/
//关联仓库详情
val whListArr = viewModel.wayBillInfo.getJSONArray("whList")
whListArr.forEach { waybill ->
val waybillObj = waybill as JSONObject
wareHouseInfoAdapter.append(
GjjQueryInfoWh(
1,
waybillObj.getString("wbNo") ?: "",
waybillObj.getString("location") ?: "",
waybillObj.getIntValue("pc"),
waybillObj.getDoubleValue("weight"),
waybillObj.getString("flight") ?: "",
waybillObj.getString("opDate") ?: "",
waybillObj.getString("handtime") ?: "",
waybillObj.getString("opId") ?: ""
)
)
}
} else {
//无数据
}
}
}
private fun initData() {
queryInfoAdapterList.add(GjjQueryInfo(1, "入库时间", "2021-04-05 15:22:33"))
queryInfoAdapterList.add(GjjQueryInfo(1, "运单号", "A014d384"))
queryInfoAdapterList.add(GjjQueryInfo(1, "代理人", "张三"))
queryInfoAdapterList.add(GjjQueryInfo(1, "特码", "A06"))
queryInfoAdapterList.add(GjjQueryInfo(1, "件数", "39件"))
queryInfoAdapterList.add(GjjQueryInfo(1, "重量", "30kg"))
queryInfoAdapterList.add(GjjQueryInfo(1, "品名", "TF"))
queryInfoAdapterList.add(GjjQueryInfo(1, "目的港", "白云国际机场"))
queryInfoAdapterList.add(GjjQueryInfo(1, "航班号", "U23"))
queryInfoAdapterList.add(GjjQueryInfo(1, "运单类型", "配载单"))
queryInfoAdapterList.add(GjjQueryInfo(1, "承运人", "SF"))
queryInfoAdapterList.add(GjjQueryInfo(1, "包装", "木箱"))
adapter.notifyDataSetChanged()
}
override fun onClick(v: View?) {
v?.let {
when (it.id) {
R.id.refWareHouseInfo -> {
//开关关联列表
if (wareHouseInfoLayout.visibility == View.GONE) {
wareHouseInfoLayout.visibility = View.VISIBLE
} else {
wareHouseInfoLayout.visibility = View.GONE
}
scrollView.post { scrollView.scrollTo(0, scrollView.bottom) }
}
R.id.submit -> {
ARouter.getInstance().build(ARouterConstants.ACTIVITY_URL_CARGO_TRACKING)
.withString("countryTypeParam", Constant.CargoTracking.gjStatus)
.withString("ieFlagParam", Constant.CargoTracking.importStatus)
.withString("wbNoParam", viewModel.wbNo)
.navigation()
}
else -> {
Toast.makeText(this, "未找到对应操作", Toast.LENGTH_SHORT).show()
}
}
}
}
}

View File

@@ -0,0 +1,502 @@
package com.lukouguoji.gjj.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.Route
import com.alibaba.fastjson.JSONArray
import com.alibaba.fastjson.JSONObject
import com.lukouguoji.gjj.R
import com.lukouguoji.gjj.adapt.GjjQueryListAdapter
import com.lukouguoji.gjj.model.GjjQueryList
import com.lukouguoji.gjj.viewModel.GjjQueryListViewModel
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_GJJ_QUERY_LIST)
class GjjQueryListActivity : BaseActivity(), View.OnClickListener {
private val currentTitleName = "国际进港查询"
private lateinit var viewModel: GjjQueryListViewModel
private lateinit var adapter: GjjQueryListAdapter
private val collectList = ArrayList<GjjQueryList>()
private var currentPage = 1
private var pageSize = 10
private var totalPage = 0
private lateinit var refreshLayout: RefreshLayout
//标题
private lateinit var toolBack: LinearLayout
private lateinit var titleName: TextView
//搜索条件
private lateinit var beginDate: TextView
private lateinit var beginDateIcon: ImageView
private lateinit var endDate: TextView
private lateinit var endDateIcon: ImageView
private lateinit var searchListFragment: LinearLayout
private lateinit var filtrateLayout: LinearLayout
private lateinit var wbNo: EditText
private lateinit var fno: EditText
private lateinit var mudiGang: EditText
private lateinit var searchLayout: LinearLayout
//筛选页
private lateinit var filtrateFragment: LinearLayout
private lateinit var spCode: TextView
private var spCodeValue = ""
private lateinit var agentCode: TextView
private var agentCodeValue = ""
private lateinit var goods: EditText
private lateinit var awbType: TextView
private var awbTypeValue = ""
private lateinit var businessType: TextView
private var businessTypeValue = ""
private lateinit var submit: TextView
private lateinit var reset: TextView
private val ymdSdf = SimpleDateFormat("yyyy-MM-dd")//年月日
private val ymdHmsSdf = SimpleDateFormat("yyyy-MM-dd HH:mm:ss")//年月日 时分秒
private val calendar = Calendar.getInstance()
private fun initView() {
viewModel = ViewModelProvider(this).get(GjjQueryListViewModel::class.java)
val layoutManager = LinearLayoutManager(this)
adapter = GjjQueryListAdapter(this, collectList)
var recyclerView: RecyclerView = findViewById(R.id.recyclerList)
recyclerView.layoutManager = layoutManager
recyclerView.adapter = adapter
//标题
toolBack = findViewById(R.id.tool_back)
titleName = findViewById(R.id.title_name)
//搜索列表页
searchListFragment = findViewById(R.id.searchListFragment)
wbNo = findViewById(R.id.wbNo)
fno = findViewById(R.id.fno)
beginDate = findViewById(R.id.beginDate)
beginDateIcon = findViewById(R.id.beginDateIcon)
endDate = findViewById(R.id.endDate)
endDateIcon = findViewById(R.id.endDateIcon)
mudiGang = findViewById(R.id.mudiGang)
searchLayout = findViewById(R.id.searchLayout)
filtrateLayout = findViewById(R.id.filtrateLayout)
//筛选页
filtrateFragment = findViewById(R.id.filtrateFragment)
goods = findViewById(R.id.goods)
spCode = findViewById(R.id.spCode)
agentCode = findViewById(R.id.agentCode)
businessType = findViewById(R.id.businessType)
awbType = findViewById(R.id.awbType)
submit = findViewById(R.id.submit)
reset = findViewById(R.id.reset)
toolBack.setOnClickListener(this)
searchLayout.setOnClickListener(this)
beginDate.setOnClickListener(this)
beginDateIcon.setOnClickListener(this)
endDate.setOnClickListener(this)
endDateIcon.setOnClickListener(this)
spCode.setOnClickListener(this)
agentCode.setOnClickListener(this)
businessType.setOnClickListener(this)
awbType.setOnClickListener(this)
// isCangDan.setOnClickListener(this)
filtrateLayout.setOnClickListener(this)
submit.setOnClickListener(this)
reset.setOnClickListener(this)
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) {
Common.alertDialog(ActivityCollector.getLastActivity()!!, "运单号不能超过11位") { dialog ->
wbNo.setText(s.toString().substring(0, 11))
dialog.dismiss()
}
}
}
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)
}
}
}
})
mudiGang.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-Z]+)$)"
val matches = originText.matches(regularExpression.toRegex())
if(!matches){
val regularExpression2 = "([^A-Za-z]+)"
val replaceStr = originText.replace(regularExpression2.toRegex(),"")
val replaceStrToUpper = replaceStr.uppercase(Locale.ROOT)//小写转大写
mudiGang.setText(replaceStrToUpper)
mudiGang.setSelection(replaceStrToUpper.length)
}
}
}
})
beginDate.text = ymdSdf.format(Date())//tw2022年6月13日15:57:10 要求航班日期默认当天
endDate.text = ymdSdf.format(Date())//tw2022年6月13日15:57:10 要求航班日期默认当天
}
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_gjj_query_list)
initView()
//初始化查询
searchFun()
loading()
viewModel.searchParamLive.observe(this) {
loadingCancel()
//1.获取数据
var listArr: JSONArray = it["list"] as JSONArray
totalPage = it["pages"] as Int
// var listArr :JSONArray =it["list"] as JSONArray
if (listArr.size > 0) {
//2.循环遍历塞入collectList
listArr.forEach {
val itemObj = it as JSONObject
val id = itemObj.getIntValue("mawbid")
val wbNo = (itemObj.getString("prefix") ?: "") + (itemObj.getString("no") ?: "")
val agentCode = itemObj.getString("agent") ?: ""
val spCode = itemObj.getString("spCode") ?: ""
val goods = itemObj.getString("goods") ?: ""
val flight = itemObj.getString("flight") ?: ""
val range = itemObj.getString("range") ?: ""
val pc = itemObj.getString("pc") ?: ""
val weight = itemObj.getString("weight") ?: ""
collectList.add(GjjQueryList(id, wbNo, agentCode, spCode, goods, flight, range,pc,weight))
}
//3.调adpter展示
if (currentPage == 1) {
adapter.notifyDataSetChanged()
} else {
adapter.notifyItemRangeInserted((currentPage - 1) * 10, collectList.size)
}
refreshLayout.finishRefresh()
refreshLayout.finishLoadMore()
}
}
/////////////// 下拉框 start
viewModel.agentCode(System.currentTimeMillis().toString())
viewModel.agentCodeObserver.observe(this) { vd ->
val noneObj = JSONObject()
noneObj["name"] = "请选择代理人"
noneObj["code"] = ""
viewModel.agentCodeList.add(noneObj)
viewModel.agentCodeList.addAll(vd.getJSONArray("data"))
}
viewModel.business(Constant.businessType.II)
viewModel.businessObserver.observe(this) { vd ->
val noneObj = JSONObject()
noneObj["name"] = "请选择业务类型"
noneObj["code"] = ""
viewModel.businessList.add(noneObj)
viewModel.businessList.addAll(vd.getJSONArray("data"))
}
viewModel.specialCode(System.currentTimeMillis().toString())
viewModel.specialCodeObserver.observe(this) { vd ->
val noneObj = JSONObject()
noneObj["name"] = "请选择特码"
noneObj["code"] = ""
viewModel.specialCodeList.add(noneObj)
viewModel.specialCodeList.addAll(vd.getJSONArray("data"))
}
viewModel.awb(Constant.businessType.II)
viewModel.awbObserver.observe(this) { vd ->
val noneObj = JSONObject()
noneObj["name"] = "请选择运单类型"
noneObj["code"] = ""
viewModel.awbList.add(noneObj)
viewModel.awbList.addAll(vd.getJSONArray("data"))
}
/////////////// 下拉框 end
/////////////////////////////// 加载刷新的布局
refreshLayout = findViewById<View>(R.id.refreshLayout) as RefreshLayout
refreshLayout.setRefreshHeader(ClassicsHeader(this))
refreshLayout.setRefreshFooter(ClassicsFooter(this))
/////////////////////////////// 下拉刷新
refreshLayout.setOnRefreshListener {
resetSearch()
}
/////////////////////////////// 上拉加载
refreshLayout.setOnLoadMoreListener {
if (currentPage < totalPage) {
currentPage++
//初始化查询
searchFun()
} else {
refreshLayout.finishLoadMoreWithNoMoreData()
}
}
//点击扫码
/*scanCodeImg.setOnClickListener {
scanCode(Constant.RequestCode.gnc_query_list)
}*/
}
/**
* onActivityResult 回调
*/
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
super.onActivityResult(requestCode, resultCode, data)
// 扫描二维码/条码回传
/*if (requestCode == Constant.RequestCode.gnc_query_list && resultCode == RESULT_OK) {
if (data != null) {
val content = data.getStringExtra(com.yzq.zxinglibrary.common.Constant.CODED_CONTENT)
searchContent.setText("$content")
//调用接口查询进入详情页
if (content != null && content != "") {
ARouter.getInstance().build(ARouterConstants.ACTIVITY_URL_GNC_QUERY_INFO).withString("wbNoParam", content)
.navigation(this)
}
}
}*/
}
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.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.beginDate -> {
Common.onYearMonthDay(this, beginDate.text.toString()) { year, month, day ->
calendar.set(year, month - 1, day)
beginDate.text = ymdSdf.format(calendar.time)
}
}
R.id.beginDateIcon -> {
beginDate.text = ""
}
R.id.endDate -> {
Common.onYearMonthDay(this, endDate.text.toString()) { year, month, day ->
calendar.set(year, month - 1, day)
endDate.text = ymdSdf.format(calendar.time)
}
}
R.id.endDateIcon -> {
endDate.text = ""
}
/* R.id.startDateParam -> {
Common.onYearMonthDayTime(this, startDateParam.text.toString()) { year, month, day, hour, minute, second ->
calendar.set(year, month - 1, day, hour, minute, second)
startDateParam.text = ymdHmsSdf.format(calendar.time)
}
}
R.id.endDateParam -> {
Common.onYearMonthDayTime(this, endDateParam.text.toString()) { year, month, day, hour, minute, second ->
calendar.set(year, month - 1, day, hour, minute, second)
endDateParam.text = ymdHmsSdf.format(calendar.time)
}
}*/
R.id.agentCode -> {
Common.singleSelect(this, "代理", viewModel.agentCodeList, agentCodeValue) { _, item ->
val jsonObject = item as JSONObject
val name = jsonObject.getString("name")
val code = jsonObject.getString("code")
agentCode.text = name
agentCodeValue = code
}
}
R.id.businessType -> {
Common.singleSelect(this, "业务类型", viewModel.businessList, businessTypeValue) { _, item ->
val jsonObject = item as JSONObject
val name = jsonObject.getString("name")
val code = jsonObject.getString("code")
businessType.text = name
businessTypeValue = code
}
}
R.id.spCode -> {
Common.singleSelect(this, "特码", viewModel.specialCodeList, spCodeValue) { _, item ->
val jsonObject = item as JSONObject
val name = jsonObject.getString("name")
val code = jsonObject.getString("code")
spCode.text = name
spCodeValue = code
}
}
R.id.awbType -> {
Common.singleSelect(this, "运单类型", viewModel.awbList, awbTypeValue) { _, item ->
val jsonObject = item as JSONObject
val name = jsonObject.getString("name")
val code = jsonObject.getString("code")
awbType.text = name
awbTypeValue = code
}
}
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()
}
}
}
}
/**
* 搜索
*/
private fun searchFun() {
viewModel.search(
pageSize,
currentPage,
"", // carrier.text.toString(),
agentCodeValue,
awbTypeValue,
beginDate.text.toString(),// startDateParam.text.toString(),
endDate.text.toString(),// endDateParam.text.toString(),
"",
fno.text.toString(),
mudiGang.text.toString(),
"",// kuWei.text.toString(),
"",// hangCheng.text.toString(),
businessTypeValue,
"",// isCangDanStatus,
wbNo.text.toString(),
spCodeValue,
goods.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("")
mudiGang.setText("")
beginDate.text = ""
endDate.text = ""
fno.setText("")
spCode.text = ""
spCodeValue = ""
agentCode.text = ""
agentCodeValue = ""
goods.setText("")
businessType.text = ""
businessTypeValue = ""
awbType.text = ""
awbTypeValue = ""
}
}

View File

@@ -0,0 +1,46 @@
package com.lukouguoji.gjj.activity
import android.content.Context
import android.content.Intent
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import com.lukouguoji.gjj.R
import com.lukouguoji.gjj.databinding.ActivityGjjTallyAddBinding
import com.lukouguoji.gjj.viewModel.GjjTallyAddViewModel
import com.lukouguoji.module_base.base.BaseBindingActivity
import com.lukouguoji.module_base.bean.GjjTallyBean
import com.lukouguoji.module_base.common.Constant
import com.lukouguoji.module_base.http.net.NetApply
import com.lukouguoji.module_base.ktx.addOnItemClickListener
import com.lukouguoji.module_base.ktx.toJson
class GjjTallyAddActivity :
BaseBindingActivity<ActivityGjjTallyAddBinding, GjjTallyAddViewModel>() {
override fun layoutId() = R.layout.activity_gjj_tally_add
override fun viewModelClass() = GjjTallyAddViewModel::class.java
override fun initOnCreate(savedInstanceState: Bundle?) {
setBackArrow("国际进港开始理货")
intent.getStringExtra(Constant.Key.DATA)?.let {
viewModel.tallyBean = NetApply.gson.fromJson(it, GjjTallyBean::class.java)
viewModel.getData()
}
binding.viewModel = viewModel
viewModel.pageModel.bindSmartRefreshLayout(binding.srl, binding.rv, viewModel, this)
binding.rv.addOnItemClickListener(viewModel)
}
companion object {
@JvmStatic
fun start(context: Context, bean: GjjTallyBean? = null) {
val starter = Intent(context, GjjTallyAddActivity::class.java)
bean?.let {
starter.putExtra(Constant.Key.DATA, it.toJson(false))
}
context.startActivity(starter)
}
}
}

View File

@@ -0,0 +1,40 @@
package com.lukouguoji.gjj.activity
import android.content.Context
import android.content.Intent
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import com.lukouguoji.gjj.R
import com.lukouguoji.gjj.databinding.ActivityGjjTallyDetailsBinding
import com.lukouguoji.gjj.viewModel.GjjTallyDetailsViewModel
import com.lukouguoji.module_base.base.BaseBindingActivity
import com.lukouguoji.module_base.common.Constant
import com.lukouguoji.module_base.ktx.noNull
class GjjTallyDetailsActivity :
BaseBindingActivity<ActivityGjjTallyDetailsBinding, GjjTallyDetailsViewModel>() {
override fun layoutId() = R.layout.activity_gjj_tally_details
override fun viewModelClass() = GjjTallyDetailsViewModel::class.java
override fun initOnCreate(savedInstanceState: Bundle?) {
setBackArrow("国际进港理货详情")
viewModel.mfId = intent.getStringExtra(Constant.Key.ID).noNull()
viewModel.waybillNo = intent.getStringExtra(Constant.Key.WAYBILL).noNull()
binding.viewModel = viewModel
viewModel.pageModel.bindSmartRefreshLayout(binding.srl, binding.rv, viewModel, this)
viewModel.refresh()
}
companion object {
@JvmStatic
fun start(context: Context, mfId: String, waybillNo: String) {
val starter = Intent(context, GjjTallyDetailsActivity::class.java)
.putExtra(Constant.Key.ID, mfId)
.putExtra(Constant.Key.WAYBILL, waybillNo)
context.startActivity(starter)
}
}
}

View File

@@ -0,0 +1,49 @@
package com.lukouguoji.gjj.activity
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import androidx.databinding.DataBindingUtil
import androidx.lifecycle.ViewModelProvider
import com.alibaba.android.arouter.facade.annotation.Route
import com.lukouguoji.gjj.R
import com.lukouguoji.gjj.databinding.ActivityGjjManifestBinding
import com.lukouguoji.gjj.databinding.ActivityGjjTallyListBinding
import com.lukouguoji.gjj.holder.GjjManifestListViewHolder
import com.lukouguoji.gjj.holder.GjjTallyListViewHolder
import com.lukouguoji.gjj.viewModel.GjjManifestListViewModel
import com.lukouguoji.gjj.viewModel.GjjTallyViewModel
import com.lukouguoji.module_base.BaseActivity
import com.lukouguoji.module_base.base.BaseBindingActivity
import com.lukouguoji.module_base.base.CommonAdapter
import com.lukouguoji.module_base.interfaces.IOnItemClickListener
import com.lukouguoji.module_base.ktx.addOnItemClickListener
import com.lukouguoji.module_base.router.ARouterConstants
import kotlin.properties.Delegates
@Route(path = ARouterConstants.ACTIVITY_URL_GJJ_Tally)
class GjjTallyListActivity : BaseBindingActivity<ActivityGjjTallyListBinding, GjjTallyViewModel>() {
override fun layoutId() = R.layout.activity_gjj_tally_list
override fun viewModelClass() = GjjTallyViewModel::class.java
override fun initOnCreate(savedInstanceState: Bundle?) {
setBackArrow("国际进港理货")
binding.viewModel = viewModel
viewModel.pageModel.bindSmartRefreshLayout(binding.srl, binding.rv, viewModel, this)
// 条目点击事件
binding.rv.addOnItemClickListener(object : IOnItemClickListener {
override fun onItemClick(position: Int, type: Int) {
viewModel.onItemClick(position, type)
}
})
}
override fun onResume() {
super.onResume()
viewModel.refresh()
}
}

View File

@@ -0,0 +1,462 @@
package com.lukouguoji.gjj.activity
import android.os.Bundle
import android.text.Editable
import android.text.TextWatcher
import android.view.View
import android.widget.EditText
import android.widget.LinearLayout
import android.widget.TextView
import android.widget.Toast
import androidx.lifecycle.ViewModelProvider
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.alibaba.android.arouter.facade.annotation.Route
import com.alibaba.fastjson.JSONArray
import com.alibaba.fastjson.JSONObject
import com.lukouguoji.gjj.R
import com.lukouguoji.gjj.adapt.GjjWareHouseListAdapter
import com.lukouguoji.gjj.model.GjjWareHouseList
import com.lukouguoji.gjj.viewModel.GjjWareHouseListViewModel
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_GJJ_WARE_HOUSE)
class GjjWareHouseActivity : BaseActivity(), View.OnClickListener {
private lateinit var viewModel: GjjWareHouseListViewModel
private val currentTitleName = "国际进港仓库管理"
private lateinit var adapter: GjjWareHouseListAdapter
private val collectList = ArrayList<GjjWareHouseList>()
private lateinit var refreshLayout: RefreshLayout
private var currentPage = 1
private var pageSize = 10
private var totalPage = 0
//是否刷新
private var refresh = false
//标题
private lateinit var toolBack: LinearLayout
private lateinit var titleName: TextView
//搜索条件
private lateinit var searchListFragment: LinearLayout
private lateinit var wayNo: EditText
private lateinit var agentCode: TextView
private var agentCodeValue = ""
private lateinit var carrier: EditText
private lateinit var location: EditText
private lateinit var searchLayout: LinearLayout
private lateinit var summaryText: TextView
//筛选页
private lateinit var filtrateLayout: LinearLayout
private lateinit var filtrateFragment: LinearLayout
private lateinit var fdep: EditText
private lateinit var isGroup: TextView
private var isGroupStatus = ""
private val isGroupArr = JSONArray()
private lateinit var submit: TextView
private lateinit var reset: TextView
private val ymdSdf = SimpleDateFormat("yyyy-MM-dd")//年月日
private val ymdHmsSdf = SimpleDateFormat("yyyy-MM-dd HH:mm:ss")//年月日 时分秒
private val calendar = Calendar.getInstance()
private fun initView() {
viewModel = ViewModelProvider(this).get(GjjWareHouseListViewModel::class.java)
val layoutManager = LinearLayoutManager(this)
adapter = GjjWareHouseListAdapter(this, collectList)
var recyclerView: RecyclerView = findViewById(R.id.guo_nei_collect_list)
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)
wayNo = findViewById(R.id.waybillNo)
agentCode = findViewById(R.id.agentCode)
carrier = findViewById(R.id.carrier)
location = findViewById(R.id.location)
searchLayout = findViewById(R.id.searchLayout)
filtrateLayout = findViewById(R.id.filtrateLayout)
summaryText = findViewById(R.id.summaryText)
//筛选页
filtrateFragment = findViewById(R.id.filtrateFragment)
fdep = findViewById(R.id.fdep)
isGroup = findViewById(R.id.isGroup)
submit = findViewById(R.id.submit)
reset = findViewById(R.id.reset)
toolBack.setOnClickListener(this)
searchLayout.setOnClickListener(this)
filtrateLayout.setOnClickListener(this)
submit.setOnClickListener(this)
reset.setOnClickListener(this)
isGroup.setOnClickListener(this)
agentCode.setOnClickListener(this)
wayNo.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) {
Common.alertDialog(ActivityCollector.getLastActivity()!!, "运单号不能超过11位") { dialog ->
wayNo.setText(s.toString().substring(0, 11))
dialog.dismiss()
}
}
}
override fun afterTextChanged(s: Editable?) {
}
})
carrier.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-Z]+)$)"
val matches = originText.matches(regularExpression.toRegex())
if(!matches){
val regularExpression2 = "([^A-Za-z]+)"
val replaceStr = originText.replace(regularExpression2.toRegex(),"")
val replaceStrToUpper = replaceStr.uppercase(Locale.ROOT)//小写转大写
carrier.setText(replaceStrToUpper)
carrier.setSelection(replaceStrToUpper.length)
}
}
}
})
//赋值
//是否上舱单
val noneGroup = JSONObject()
noneGroup["name"] = "请选择分组类型"
noneGroup["code"] = ""
val yesGroup = JSONObject()
yesGroup["name"] = "航程"
yesGroup["code"] = "dest"
val noGroup = JSONObject()
noGroup["name"] = "库位"
noGroup["code"] = "location"
val dateGroup = JSONObject()
dateGroup["name"] = "入库时间"
dateGroup["code"] = "date"
isGroupArr.add(noneGroup)
isGroupArr.add(yesGroup)
isGroupArr.add(noGroup)
isGroupArr.add(dateGroup)
}
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_gjj_ware_house)
initView()
//查询返回结果
viewModel.searchParamLive.observe(this) {
loadingCancel()
//1.获取数据
var listArr = JSONArray()
try {
listArr = it["list"] as JSONArray
} catch (e: Exception) {
return@observe
}
totalPage = it["pages"] as Int
// var listArr :JSONArray =it["list"] as JSONArray
if (listArr.size > 0) {
//2.循环遍历塞入collectList
listArr.forEach {
val itemObj = it as JSONObject
val whId = itemObj.getIntValue("whid")
val no = itemObj.getString("wbNo") ?: ""
val weight = itemObj.getDouble("weight")
val pc = itemObj.getIntValue("pc")
val fno = itemObj.getString("fno") ?: ""
val flight = itemObj.getString("flight") ?: ""
val opDate = itemObj.getString("opDate") ?: ""
val gdate = itemObj.getString("gdate") ?: ""
val locStatus = itemObj.getString("locStatus") ?: ""
val dest = itemObj.getString("dest") ?: ""
val location = itemObj.getString("location") ?: ""
val goods = itemObj.getString("goods") ?: ""
val spCode = itemObj.getString("spCode") ?: ""
val agentCode = itemObj.getString("agentCode") ?: ""
val by1 = itemObj.getString("by1") ?: ""
val origin = itemObj.getString("origin") ?: ""
val awbType = itemObj.getString("awbType") ?: ""
val businessType = itemObj.getString("businessType") ?: ""
val status = itemObj.getString("status") ?: ""
val days = itemObj.getIntValue("days")
var groupTitle = ""
var groupName = ""
var daysString: String? = null
when (isGroupStatus) {
"dest" -> {
groupTitle = "目的港:"
groupName = dest
}
"location" -> {
groupTitle = "库位:"
groupName = location
}
"date" -> {
groupTitle = "入库时间:"
groupName = "$gdate,入库天数:"
daysString = days.toString()
}
else -> {
}
}
collectList.add(
GjjWareHouseList(
whId,
no,
pc,
weight,
fno,
flight,
opDate,
locStatus,
groupTitle,
groupName,
daysString,
goods,
spCode,
agentCode,
by1,
origin,
location,
awbType,
businessType,
status,
)
)
}
//3.调adpter展示
if (currentPage == 1) {
adapter.notifyDataSetChanged()
} else {
adapter.notifyItemRangeInserted((currentPage - 1) * 10, collectList.size)
}
refreshLayout.finishRefresh()
refreshLayout.finishLoadMore()
}
}
//汇总返回结果
viewModel.summaryObserver.observe(this) {
loadingCancel()
val status = it.getString("status")
if (Constant.Result.succ == status) {
var jsonObject = it.getJSONObject("data")
val totalTemp = jsonObject.getIntValue("total")
val totalPcTemp = jsonObject.getIntValue("pc")
val totalWeightTemp = jsonObject.getDoubleValue("weight")
summaryText.text = "总票数:$totalTemp,总件数:$totalPcTemp,总重量:$totalWeightTemp"
} else {
//无数据
}
}
//初始化查询
searchFun()
loading()
/////////////// 下拉框 start
viewModel.agentCode(System.currentTimeMillis().toString())
viewModel.agentCodeObserver.observe(this) { vd ->
val noneObj = JSONObject()
noneObj["name"] = "请选择代理人"
noneObj["code"] = ""
viewModel.agentCodeList.add(noneObj)
viewModel.agentCodeList.addAll(vd.getJSONArray("data"))
}
viewModel.business(Constant.businessType.II)
viewModel.businessObserver.observe(this) { vd ->
val noneObj = JSONObject()
noneObj["name"] = "请选择业务类型"
noneObj["code"] = ""
viewModel.businessList.add(noneObj)
viewModel.businessList.addAll(vd.getJSONArray("data"))
}
/////////////// 下拉框 end
/////////////////////////////// 加载刷新的布局
refreshLayout.setRefreshHeader(ClassicsHeader(this))
refreshLayout.setRefreshFooter(ClassicsFooter(this))
/////////////////////////////// 下拉刷新
refreshLayout.setOnRefreshListener {
refresh = true
resetSearch()
}
/////////////////////////////// 上拉加载
refreshLayout.setOnLoadMoreListener {
refresh = false
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.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
}
}
R.id.isGroup -> {
Common.singleSelect(this, "分组类型", isGroupArr, isGroupStatus) { position, item ->
val jsonObject = item as JSONObject
val name = jsonObject.getString("name")
val code = jsonObject.getString("code")
isGroup.text = name
isGroupStatus = code
}
}
R.id.agentCode -> {
Common.singleSelect(this, "代理", viewModel.agentCodeList, agentCodeValue) { _, item ->
val jsonObject = item as JSONObject
val name = jsonObject.getString("name")
val code = jsonObject.getString("code")
agentCode.text = name
agentCodeValue = code
}
}
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()
}
}
}
}
/**
* 搜索
*/
private fun searchFun() {
viewModel.search(
pageSize,
currentPage,
carrier.text.toString(),
"",
"",
"",
"",
fdep.text.toString(),
"",
"",
"",
"",//isCangDanStatus
wayNo.text.toString(),
isGroupStatus,
agentCodeValue,
location.text.toString()
)
}
/**
* 重置数据,搜索
*/
private fun resetSearch() {
//recyclerView 清除所有数据数据
refreshLayout.setNoMoreData(false)
adapter.notifyItemRangeRemoved(0, collectList.size)
collectList.clear()
currentPage = 1
searchFun()
}
/**
* 重置筛选条件
*/
private fun resetFun() {
currentPage = 1
wayNo.setText("")
agentCode.text = ""
agentCodeValue = ""
carrier.setText("")
location.setText("")
fdep.setText("")
isGroup.text = ""
isGroupStatus = ""
}
}

View File

@@ -0,0 +1,104 @@
package com.lukouguoji.gjj.activity
import android.os.Bundle
import android.view.View
import android.widget.Toast
import androidx.core.widget.NestedScrollView
import androidx.lifecycle.ViewModelProvider
import androidx.recyclerview.widget.GridLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.alibaba.android.arouter.facade.annotation.Autowired
import com.alibaba.android.arouter.facade.annotation.Route
import com.lukouguoji.gjj.R
import com.lukouguoji.gjj.adapt.GjjWareHouseInfoListAdapter
import com.lukouguoji.gjj.model.GjjWareHouseInfo
import com.lukouguoji.gjj.viewModel.GjjWareHouseInfoViewModel
import com.lukouguoji.module_base.BaseActivity
import com.lukouguoji.module_base.common.Constant
import com.lukouguoji.module_base.router.ARouterConstants
@Route(path = ARouterConstants.ACTIVITY_URL_GJJ_WARE_HOUSE_INFO)
class GjjWareHouseInfoActivity : BaseActivity(), View.OnClickListener {
private lateinit var viewModel: GjjWareHouseInfoViewModel
private lateinit var scrollView: NestedScrollView
private lateinit var gncQueryInfoList: RecyclerView
private lateinit var adapter: GjjWareHouseInfoListAdapter
private val queryInfoAdapterList = arrayListOf<GjjWareHouseInfo>()
@JvmField
@Autowired
var id: Int = -9999
private fun initView() {
viewModel = ViewModelProvider(this).get(GjjWareHouseInfoViewModel::class.java)
scrollView = findViewById(R.id.scrollView)
val layoutManager = GridLayoutManager(this, 2)
adapter = GjjWareHouseInfoListAdapter(this, queryInfoAdapterList)
gncQueryInfoList = findViewById(R.id.gncQueryInfoList)
gncQueryInfoList.adapter = adapter
gncQueryInfoList.layoutManager = layoutManager
}
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_gjj_ware_house_info)
setBackArrow("仓库管理详情")
initView()
viewModel.queryInfoByIdWareHouse(id)
viewModel.queryInfoByIdWareHouseObserver.observe(this) {
val status = it.getString("status")
if (Constant.Result.succ == status) {
viewModel.wayBillInfo = it.getJSONObject("data")
//运单号、
adapter.append(GjjWareHouseInfo(1, "运单号", viewModel.wayBillInfo.getString("wbNo") ?: ""))
// 件数、
adapter.append(GjjWareHouseInfo(1, "件数", viewModel.wayBillInfo.getString("pc") ?: ""))
// 重量、
adapter.append(GjjWareHouseInfo(1, "重量", "${viewModel.wayBillInfo.getDoubleValue("weight")} KG"))
// 品名、
adapter.append(GjjWareHouseInfo(1, "品名(英)", viewModel.wayBillInfo.getString("goods") ?: ""))
// 特码、
adapter.append(GjjWareHouseInfo(1, "特码", viewModel.wayBillInfo.getString("spCode") ?: ""))
// 代理人、
adapter.append(GjjWareHouseInfo(1, "代理人", viewModel.wayBillInfo.getString("agentName") ?: ""))
// 承运人、
adapter.append(GjjWareHouseInfo(1, "承运人", viewModel.wayBillInfo.getString("carrier") ?: ""))
//始发港、
adapter.append(GjjWareHouseInfo(1, "目的港", viewModel.wayBillInfo.getString("dest") ?: ""))
// 航班、
adapter.append(GjjWareHouseInfo(1, "航班", viewModel.wayBillInfo.getString("flight") ?: ""))
// 库位
// adapter.append(GjjWareHouseInfo(1, "库位", viewModel.wayBillInfo.getString("location") ?: ""))
// 运单类型、
adapter.append(GjjWareHouseInfo(1, "运单类型", viewModel.wayBillInfo.getString("awbType") ?: ""))
// 业务类型、
adapter.append(GjjWareHouseInfo(1, "业务类型", viewModel.wayBillInfo.getString("businessType") ?: ""))
// 包装类型
adapter.append(GjjWareHouseInfo(1, "包装类型", viewModel.wayBillInfo.getString("packageName") ?: ""))
// 状态、
// adapter.append(GjjWareHouseInfo(1, "状态", viewModel.wayBillInfo.getString("ref") ?: ""))
// 入库时间
adapter.append(GjjWareHouseInfo(1, "入库时间", viewModel.wayBillInfo.getString("opDate") ?: ""))
} else {
//无数据
}
}
}
override fun onClick(v: View?) {
v?.let {
when (it.id) {
else -> {
Toast.makeText(this, "未找到对应操作", Toast.LENGTH_SHORT).show()
}
}
}
}
}

View File

@@ -0,0 +1,230 @@
package com.lukouguoji.gjj.adapt
import android.app.Activity
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.LinearLayout
import android.widget.TextView
import androidx.recyclerview.widget.RecyclerView
import com.alibaba.fastjson.JSONObject
import com.lukouguoji.gjj.R
import com.lukouguoji.gjj.model.GjjCangDanInfoItemModel
import com.lukouguoji.module_base.common.String.isValidInt
import com.lukouguoji.module_base.util.Common
import java.util.*
class GjjCangDanInfoAdapter(val activity: Activity, private val collectList: MutableList<GjjCangDanInfoItemModel>) :
RecyclerView.Adapter<GjjCangDanInfoAdapter.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)
}
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
val view = LayoutInflater.from(parent.context).inflate(R.layout.gjj_cang_dan_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 selContentCode = collect.selContentCode
val selContentName = collect.selContentName
//是否必填
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
var anyMatchCode = false
selList?.forEach { sel ->
var selObj = sel as JSONObject
var name = selObj.getString("name")
var code = selObj.getString("code")
if (selContentCode == code) {
anyMatchCode = true
holder.selContent.text = name
}
}
//没匹配到渲染成selContentName
if (!anyMatchCode) {
holder.selContent.text = selContentName
}
//是否允许
holder.selContent.isEnabled = enable
if (enable) {
holder.selContent.setBackgroundResource(R.drawable.gjj_cang_dan_info_edit_shape)
} else {
holder.selContent.setBackgroundResource(R.drawable.gjj_cang_dan_info_edit_disable_shape)
}
//下拉框监听
holder.selContent.setOnClickListener {
Common.singleSelect(activity, titleName, selList!!, selContentCode) { _, item ->
val jsonObject = item as JSONObject
val code = jsonObject.getString("code")
collect.selContentCode = code
notifyDataSetChanged()
}
}
}
//输入框
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.gjj_cang_dan_info_edit_shape)
} else {
holder.inputContent.setBackgroundResource(R.drawable.gjj_cang_dan_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 (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
}
}
}
}
//如果是始发港或者目的港,监听输入事件 只能输入大写字母
if (collect.titleCode == "origin" || collect.titleCode == "dest") {
//失去焦点
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(editable: Editable?) {
val originText = editable.toString()
if (originText != null && originText != "") {
val regularExpression = "(^([A-Z]+)$)"
val matches = originText.matches(regularExpression.toRegex())
if(!matches){
val regularExpression2 = "([^A-Za-z]+)"
val replaceStr = originText.replace(regularExpression2.toRegex(),"")
val replaceStrToUpper = replaceStr.uppercase(Locale.ROOT)//小写转大写
holder.inputContent.setText(replaceStrToUpper)
holder.inputContent.setSelection(replaceStrToUpper.length)
}
}
}
})
}
//输入框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.gjj_cang_dan_info_edit_shape)
} else {
holder.inputContentPre.setBackgroundResource(R.drawable.gjj_cang_dan_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(gjjCangDanInfoItemModel: GjjCangDanInfoItemModel) {
collectList.add(gjjCangDanInfoItemModel)
notifyDataSetChanged()
}
}

View File

@@ -0,0 +1,125 @@
package com.lukouguoji.gjj.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.alibaba.android.arouter.launcher.ARouter
import com.lukouguoji.gjj.R
import com.lukouguoji.gjj.model.GjjCangDanListModel
import com.lukouguoji.gjj.viewModel.GjjCangDanListViewModel
import com.lukouguoji.module_base.common.Constant
import com.lukouguoji.module_base.router.ARouterConstants
import com.lukouguoji.module_base.util.Common
class GjjCangDanListAdapter(
val activity: Activity,
private val viewModel: GjjCangDanListViewModel,
private val collectList: MutableList<GjjCangDanListModel>
) :
RecyclerView.Adapter<GjjCangDanListAdapter.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 goods: TextView = view.findViewById(R.id.goods)
val awbType: TextView = view.findViewById(R.id.awbType)
val startPort: TextView = view.findViewById(R.id.startPort)
val destPort: TextView = view.findViewById(R.id.destPort)
val agentCode: TextView = view.findViewById(R.id.agentCode)
val spCode: TextView = view.findViewById(R.id.spCode)
val totalPc: TextView = view.findViewById(R.id.totalPc)
val pc: TextView = view.findViewById(R.id.pc)
val acWeight: TextView = view.findViewById(R.id.acWeight)
val chWight: TextView = view.findViewById(R.id.chWight)
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.gjj_cang_dan_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_GJJ_CANG_DAN_INFO).withString("id", item.id).withString("ref", item.ref)
.withInt("fid", viewModel.fid ?: -9999).withString("prefix", viewModel.prefix)
.navigation(activity, Constant.RequestCode.gnj_cang_dan_list)
}
return viewHolder
}
override fun onBindViewHolder(holder: ViewHolder, position: Int) {
val collect = collectList[position]
val ref = collect.ref
if (ref == "1") {
collect.isCheck = false
}
val leftIcon = holder.leftIcon
//选中
if (collect.isCheck) {
leftIcon.setImageResource(R.mipmap.img_plane_s)
} else {
leftIcon.setImageResource(R.mipmap.gnc_ware_house_left_icon)
}
holder.wbNo.text = collect.wbNo
holder.goods.text = collect.goods
holder.awbType.text = collect.awbType
holder.startPort.text = collect.startPort
holder.destPort.text = collect.destPort
holder.agentCode.text = collect.agentCode
holder.spCode.text = collect.spCode
holder.totalPc.text = "${collect.totalPc}"
holder.pc.text = "${collect.pc}"
holder.acWeight.text = "${collect.acWeight} KG"
holder.chWight.text = "${collect.chWight} KG"
//红色图标 不允许操作
if (ref == "1") {
leftIcon.setImageResource(R.mipmap.img_plane_disable)
} else {
leftIcon.setOnClickListener {
collect.isCheck = !collect.isCheck
if (collect.isCheck) {
viewModel.plusOne()
} else {
viewModel.subOne()
}
notifyDataSetChanged() // 更新数据
}
}
holder.delete.setOnClickListener {
if (ref == "1") {
Common.showToast(activity, "货物已发放,无法删除!")
} else {
Common.secondConfirmDialog(activity, "确认删除?") { dialog ->
dialog.dismiss()
val position = holder.adapterPosition
viewModel.deleteFestGjjCangDan(collect.id.toInt(), position)
}
}
}
}
override fun getItemCount() = collectList.size
fun append(gjjCangDanListModel: GjjCangDanListModel) {
collectList.add(gjjCangDanListModel)
notifyDataSetChanged()
}
}

View File

@@ -0,0 +1,84 @@
package com.lukouguoji.gjj.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.gjj.R
import com.lukouguoji.gjj.model.GjjChuKuListModel
import com.lukouguoji.gjj.viewModel.GjjChuKuListViewModel
class GjjChuKuListAdapter(
val activity: Activity,
private val viewModel: GjjChuKuListViewModel,
private val collectList: MutableList<GjjChuKuListModel>
) :
RecyclerView.Adapter<GjjChuKuListAdapter.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 pickNo: TextView = view.findViewById(R.id.pickNo)
val fno: TextView = view.findViewById(R.id.fno)
val pc: TextView = view.findViewById(R.id.pc)
val weight: TextView = view.findViewById(R.id.weight)
val goods: TextView = view.findViewById(R.id.goods)
val agentCode: TextView = view.findViewById(R.id.agentCode)
val spCode: TextView = view.findViewById(R.id.spCode)
val pickDate: TextView = view.findViewById(R.id.pickDate)
}
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
val view = LayoutInflater.from(parent.context).inflate(R.layout.gjj_chu_ku_list_item, parent, false)
val viewHolder = ViewHolder(view)
return viewHolder
}
override fun onBindViewHolder(holder: ViewHolder, position: Int) {
val collect = collectList[position]
val leftIcon = holder.leftIcon
//选中
if (collect.isCheck) {
leftIcon.setImageResource(R.mipmap.gjj_chu_ku_left_icon_check)
} else {
leftIcon.setImageResource(R.mipmap.gnc_ware_house_left_icon)
}
holder.wbNo.text = collect.wbNo
holder.pickNo.text = collect.pickNo.toString()
holder.fno.text = collect.fno
holder.pc.text = "${collect.pc}"
holder.weight.text = "${collect.weight} KG"
holder.goods.text = collect.goods
holder.agentCode.text = collect.agentCode
holder.spCode.text = collect.spCode
holder.pickDate.text = collect.pickDate
leftIcon.setOnClickListener {
collect.isCheck = !collect.isCheck
if (collect.isCheck) {
viewModel.plusOne()
} else {
viewModel.subOne()
}
notifyDataSetChanged() // 更新数据
}
}
override fun getItemCount() = collectList.size
fun append(gjjChuKuListModel: GjjChuKuListModel) {
collectList.add(gjjChuKuListModel)
notifyDataSetChanged()
}
}

View File

@@ -0,0 +1,56 @@
package com.lukouguoji.gjj.adapt
import android.app.Activity
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.EditText
import android.widget.TextView
import androidx.recyclerview.widget.RecyclerView
import com.lukouguoji.gjj.R
import com.lukouguoji.gjj.model.GjjQueryInfo
/**
* 出港查询详情
*/
class GjjQueryInfoListAdapter(val activity: Activity, val collectList: MutableList<GjjQueryInfo>) :
RecyclerView.Adapter<GjjQueryInfoListAdapter.ViewHolder>() {
inner class ViewHolder(view: View) : RecyclerView.ViewHolder(view) {
val title: TextView = view.findViewById(R.id.title)
val content: EditText = view.findViewById(R.id.content)
}
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
val view = LayoutInflater.from(parent.context).inflate(R.layout.gjj_query_info_item, parent, false)
val viewHolder = ViewHolder(view)
/* 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]
holder.title.text = collect.title
holder.content.setText(collect.content)
}
override fun getItemCount() = collectList.size
fun append(gjjQueryInfo: GjjQueryInfo) {
collectList.add(gjjQueryInfo)
notifyDataSetChanged()
}
}

View File

@@ -0,0 +1,49 @@
package com.lukouguoji.gjj.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.lukouguoji.gjj.R
import com.lukouguoji.gjj.model.GjjQueryInfoWh
class GjjQueryInfoWhListAdapter(val activity: Activity, val collectList: MutableList<GjjQueryInfoWh>) :
RecyclerView.Adapter<GjjQueryInfoWhListAdapter.ViewHolder>() {
inner class ViewHolder(view: View) : RecyclerView.ViewHolder(view) {
val location: TextView = view.findViewById(R.id.location)
val pc: TextView = view.findViewById(R.id.pc)
val weight: TextView = view.findViewById(R.id.weight)
val flight: TextView = view.findViewById(R.id.flight)
val opDate: TextView = view.findViewById(R.id.opDate)
val mclose: TextView = view.findViewById(R.id.mclose)
val opId: TextView = view.findViewById(R.id.opId)
}
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
val view = LayoutInflater.from(parent.context).inflate(R.layout.gjj_query_info_wh_list_item, parent, false)
val viewHolder = ViewHolder(view)
return viewHolder
}
override fun onBindViewHolder(holder: ViewHolder, position: Int) {
val collect = collectList[position]
holder.location.text = collect.location
holder.pc.text = collect.pc.toString()
holder.weight.text = "${collect.weight} KG"
holder.flight.text = collect.flight
holder.opDate.text = collect.opDate
holder.mclose.text = collect.mclose
holder.opId.text = collect.opId
}
override fun getItemCount() = collectList.size
fun append(gjjQueryInfoWh: GjjQueryInfoWh) {
collectList.add(gjjQueryInfoWh)
notifyDataSetChanged()
}
}

View File

@@ -0,0 +1,66 @@
package com.lukouguoji.gjj.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.gjj.R
import com.lukouguoji.gjj.model.GjjQueryList
import com.lukouguoji.module_base.router.ARouterConstants
/**
* 国内出港查询列表
*/
class GjjQueryListAdapter(val activity: Activity, private val collectList: List<GjjQueryList>) :
RecyclerView.Adapter<GjjQueryListAdapter.ViewHolder>() {
inner class ViewHolder(view: View) : RecyclerView.ViewHolder(view) {
val no: TextView = view.findViewById(R.id.no)
val agentCode: TextView = view.findViewById(R.id.agentCode)
val goods: TextView = view.findViewById(R.id.goods)
val flight: TextView = view.findViewById(R.id.flight)
val range: TextView = view.findViewById(R.id.range)
val pc: TextView = view.findViewById(R.id.pc)
val weight: TextView = view.findViewById(R.id.weight)
}
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
val view =
LayoutInflater.from(parent.context).inflate(R.layout.gjj_query_list_item, parent, false)
val viewHolder = ViewHolder(view)
viewHolder.itemView.setOnClickListener {
var adapterPosition = viewHolder.adapterPosition
if (adapterPosition < 0 || collectList.isEmpty()) {
return@setOnClickListener
}
var gncQueryList = collectList[adapterPosition]
ARouter.getInstance().build(ARouterConstants.ACTIVITY_URL_GJJ_QUERY_INFO)
.withInt("id", gncQueryList.mawbId)
.navigation()
}
return viewHolder
}
override fun onBindViewHolder(holder: ViewHolder, position: Int) {
val collect = collectList[position]
holder.no.text = collect.wbNo
holder.agentCode.text = collect.agentCode
holder.goods.text = collect.goods
holder.flight.text = collect.flight
holder.range.text = collect.range
holder.pc.text = collect.pc
holder.weight.text = collect.weight
}
override fun getItemCount() = collectList.size
}

View File

@@ -0,0 +1,56 @@
package com.lukouguoji.gjj.adapt
import android.app.Activity
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.EditText
import android.widget.TextView
import androidx.recyclerview.widget.RecyclerView
import com.lukouguoji.gjj.R
import com.lukouguoji.gjj.model.GjjWareHouseInfo
/**
* 查询详情
*/
class GjjWareHouseInfoListAdapter(val activity: Activity, val collectList: MutableList<GjjWareHouseInfo>) :
RecyclerView.Adapter<GjjWareHouseInfoListAdapter.ViewHolder>() {
inner class ViewHolder(view: View) : RecyclerView.ViewHolder(view) {
val title: TextView = view.findViewById(R.id.title)
val content: EditText = view.findViewById(R.id.content)
}
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
val view = LayoutInflater.from(parent.context).inflate(R.layout.gjj_ware_house_info_item, parent, false)
val viewHolder = ViewHolder(view)
/* 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]
holder.title.text = collect.title
holder.content.setText(collect.content)
}
override fun getItemCount() = collectList.size
fun append(gjjWareHouseInfo: GjjWareHouseInfo) {
collectList.add(gjjWareHouseInfo)
notifyDataSetChanged()
}
}

View File

@@ -0,0 +1,128 @@
package com.lukouguoji.gjj.adapt
import android.app.Activity
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.LinearLayout
import android.widget.TextView
import androidx.recyclerview.widget.RecyclerView
import com.alibaba.android.arouter.launcher.ARouter
import com.lukouguoji.gjj.R
import com.lukouguoji.gjj.model.GjjWareHouseList
import com.lukouguoji.module_base.router.ARouterConstants
import kotlin.time.Duration.Companion.days
/**
* 仓库管理列表
*/
class GjjWareHouseListAdapter(val activity: Activity, private val collectList: List<GjjWareHouseList>) :
RecyclerView.Adapter<GjjWareHouseListAdapter.ViewHolder>() {
inner class ViewHolder(view: View) : RecyclerView.ViewHolder(view) {
val groupNameLayout: LinearLayout = view.findViewById(R.id.groupNameLayout)
val groupTitle: TextView = view.findViewById(R.id.groupTitle)
val groupContent: TextView = view.findViewById(R.id.groupContent)
val days: TextView = view.findViewById(R.id.days)
val no: TextView = view.findViewById(R.id.no)
val pc: TextView = view.findViewById(R.id.pc)
val weight: TextView = view.findViewById(R.id.weight)
/*val goods: TextView = view.findViewById(R.id.goods)
val spCode: TextView = view.findViewById(R.id.spCode)
val agentCode: TextView = view.findViewById(R.id.agentCode)
val by1: TextView = view.findViewById(R.id.by1)
val origin: TextView = view.findViewById(R.id.origin)*/
val flight: TextView = view.findViewById(R.id.flight)
/* val location: TextView = view.findViewById(R.id.location)
val awbType: TextView = view.findViewById(R.id.awbType)
val businessType: TextView = view.findViewById(R.id.businessType)
val status: TextView = view.findViewById(R.id.status)*/
val date: TextView = view.findViewById(R.id.date)
}
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
val view = LayoutInflater.from(parent.context).inflate(R.layout.gjj_ware_house_list_item, parent, false)
val viewHolder = ViewHolder(view)
viewHolder.itemView.setOnClickListener {
var adapterPosition = viewHolder.adapterPosition
if (adapterPosition < 0 || collectList.isEmpty()) {
return@setOnClickListener
}
var gncFuBang = collectList[adapterPosition]
ARouter.getInstance().build(ARouterConstants.ACTIVITY_URL_GJJ_WARE_HOUSE_INFO).withInt("id", gncFuBang.id)
.navigation()
}
return viewHolder
}
override fun onBindViewHolder(holder: ViewHolder, position: Int) {
val collect = collectList[position]
val groupTitle = collect.groupTitle
val groupName = collect.groupName
val days = collect.days
//第一条
if (position == 0 && groupName != "") {
holder.groupNameLayout.visibility = View.VISIBLE
holder.groupTitle.text = groupTitle
holder.groupContent.text = groupName
//出库时间分组时days数据不为null展示
if (days != null) {
holder.days.text = days
holder.days.visibility = View.VISIBLE
} else {
holder.days.visibility = View.GONE
}
}
//不是第一条
else if (groupName != "") {
//当前分组名和上一次分组名不一样,展示新的分组
val preCollect = collectList[position - 1]
val preGroupName = preCollect.groupName
if (groupName != preGroupName) {
holder.groupNameLayout.visibility = View.VISIBLE
holder.groupTitle.text = groupTitle
holder.groupContent.text = groupName
//出库时间分组时days数据不为null展示
if (days != null) {
holder.days.text = days
holder.days.visibility = View.VISIBLE
} else {
holder.days.visibility = View.GONE
}
} else {
holder.groupNameLayout.visibility = View.GONE
}
} else {
holder.groupNameLayout.visibility = View.GONE
}
holder.no.text = collect.waybillNo
holder.pc.text = collect.pc.toString()
holder.weight.text = "${collect.weight} KG"
/*holder.goods.text = collect.goods
holder.spCode.text = collect.spCode
holder.agentCode.text = collect.agentCode
holder.by1.text = collect.by1
holder.origin.text = collect.origin*/
holder.flight.text = collect.flight
/*holder.location.text = collect.location
holder.awbType.text = collect.awbType
holder.businessType.text = collect.businessType
holder.status.text = collect.status*/
holder.date.text = collect.date
}
override fun getItemCount() = collectList.size
}

View File

@@ -0,0 +1,21 @@
package com.lukouguoji.gjj.common
interface GjjCommon {
/**
* 舱单
*/
interface CangDan {
interface Ref {
companion object {
const val read = "1"//查看
}
}
interface Info {
companion object {
const val read = "1"//查看
const val add = "2"//新增
const val update = "3"//修改
}
}
}
}

View File

@@ -0,0 +1,19 @@
package com.lukouguoji.gjj.holder
import android.view.View
import com.lukouguoji.gjj.databinding.ItemGjjTallyDialogBinding
import com.lukouguoji.module_base.base.BaseViewHolder
import com.lukouguoji.module_base.bean.GjcUnLoadListBean
import com.lukouguoji.module_base.bean.GjcWaybillBean
import com.lukouguoji.module_base.bean.GjjHandoverRecordBean
class GjcTallyDialogViewHolder(view: View) :
BaseViewHolder<GjjHandoverRecordBean, ItemGjjTallyDialogBinding>(view) {
override fun onBind(item: Any?, position: Int) {
val bean = getItemBean(item) ?: return
binding.bean = bean
notifyItemClick(position, binding.ivIcon)
}
}

View File

@@ -0,0 +1,19 @@
package com.lukouguoji.gjj.holder
import android.view.View
import com.lukouguoji.gjj.databinding.ItemGjjGoodsAddBinding
import com.lukouguoji.module_base.base.BaseViewHolder
import com.lukouguoji.module_base.bean.GjjTallyRecordBean
class GjjGoodsAddViewHolder(view: View) :
BaseViewHolder<GjjTallyRecordBean, ItemGjjGoodsAddBinding>(view) {
override fun onBind(item: Any?, position: Int) {
val bean = getItemBean(item) ?: return
binding.bean = bean
notifyItemClick(position, binding.ivIcon)
}
}

View File

@@ -0,0 +1,20 @@
package com.lukouguoji.gjj.holder
import android.view.View
import com.lukouguoji.gjj.databinding.ItemGjjGoodsBinding
import com.lukouguoji.gjj.databinding.ItemGjjManifestBinding
import com.lukouguoji.module_base.base.BaseViewHolder
import com.lukouguoji.module_base.bean.GjjGoodsBean
import com.lukouguoji.module_base.bean.GjjManifestBean
class GjjGoodsListViewHolder(view: View) :
BaseViewHolder<GjjGoodsBean, ItemGjjGoodsBinding>(view) {
override fun onBind(item: Any?, position: Int) {
getItemBean(item)?.let {
binding.bean = it
}
notifyItemClick(position, binding.tvDetails)
}
}

View File

@@ -0,0 +1,17 @@
package com.lukouguoji.gjj.holder
import android.view.View
import com.lukouguoji.gjj.databinding.ItemGjjGoodsManifestBinding
import com.lukouguoji.module_base.base.BaseViewHolder
import com.lukouguoji.module_base.bean.GjcGoodsManifestBean
import com.lukouguoji.module_base.bean.GjjWarehouse
class GjjGoodsManifestViewHolder(view: View) :
BaseViewHolder<GjjWarehouse, ItemGjjGoodsManifestBinding>(view) {
override fun onBind(item: Any?, position: Int) {
val bean = getItemBean(item) ?: return
binding.position = position + 1
binding.bean = bean
}
}

View File

@@ -0,0 +1,22 @@
package com.lukouguoji.gjj.holder
import android.view.View
import com.lukouguoji.gjj.databinding.ItemGjjManifestBinding
import com.lukouguoji.module_base.base.BaseViewHolder
import com.lukouguoji.module_base.bean.GjjManifestBean
class GjjManifestListViewHolder(view: View) :
BaseViewHolder<GjjManifestBean, ItemGjjManifestBinding>(view) {
override fun onBind(item: Any?, position: Int) {
getItemBean(item)?.let {
binding.bean = it
}
notifyItemClick(position, binding.ivIcon)
notifyItemClick(position, binding.ivShow)
notifyItemClick(position, binding.tvDetails)
notifyItemClick(position, binding.tvDelete)
}
}

View File

@@ -0,0 +1,19 @@
package com.lukouguoji.gjj.holder
import android.view.View
import com.lukouguoji.gjj.databinding.ItemPacketParseBinding
import com.lukouguoji.module_base.base.BaseViewHolder
import com.lukouguoji.module_base.bean.PacketParseBean
import com.lukouguoji.module_base.ktx.loge
class GjjPacketParseViewHolder(view: View) :
BaseViewHolder<PacketParseBean, ItemPacketParseBinding>(view) {
override fun onBind(item: Any?, position: Int) {
val bean = getItemBean(item) ?: return
binding.bean = bean
notifyItemClick(position, binding.ll)
notifyItemClick(position, binding.ivIcon)
}
}

View File

@@ -0,0 +1,36 @@
package com.lukouguoji.gjj.holder
import android.view.View
import com.lukouguoji.gjj.R
import com.lukouguoji.gjj.databinding.ItemGjjTallyBinding
import com.lukouguoji.gjj.databinding.ItemTallyDetailsBinding
import com.lukouguoji.module_base.base.BaseViewHolder
import com.lukouguoji.module_base.base.CommonAdapter
import com.lukouguoji.module_base.bean.GjjTallyDetailsBean
import com.lukouguoji.module_base.impl.ListChangedCallBackImpl
import com.lukouguoji.module_base.interfaces.IOnItemClickListener
import com.lukouguoji.module_base.ktx.addOnItemClickListener
import com.lukouguoji.module_base.ktx.refresh
class GjjTallyDetailsViewHolder(view: View) :
BaseViewHolder<GjjTallyDetailsBean, ItemTallyDetailsBinding>(view) {
override fun onBind(item: Any?, position: Int) {
val bean = getItemBean(item) ?: return
binding.bean = bean
binding.rv.adapter = CommonAdapter(
itemView.context,
R.layout.item_jian,
JianViewHolder::class.java
)
binding.rv.refresh(bean.jianList)
bean.jianList.addOnListChangedCallback(ListChangedCallBackImpl() {
binding.rv.refresh(bean.jianList)
})
}
}

View File

@@ -0,0 +1,23 @@
package com.lukouguoji.gjj.holder
import android.view.View
import com.lukouguoji.gjj.databinding.ItemGjjManifestBinding
import com.lukouguoji.gjj.databinding.ItemGjjTallyBinding
import com.lukouguoji.module_base.base.BaseViewHolder
import com.lukouguoji.module_base.bean.GjjManifestBean
import com.lukouguoji.module_base.bean.GjjTallyBean
class GjjTallyListViewHolder(view: View) :
BaseViewHolder<GjjTallyBean, ItemGjjTallyBinding>(view) {
override fun onBind(item: Any?, position: Int) {
getItemBean(item)?.let {
binding.bean = it
}
notifyItemClick(position, binding.ivIcon)
notifyItemClick(position, binding.tvDetails)
notifyItemClick(position, binding.tvModify)
notifyItemClick(position, binding.tvDelete)
}
}

View File

@@ -0,0 +1,30 @@
package com.lukouguoji.gjj.holder
import android.view.View
import com.lukouguoji.gjj.databinding.ItemJianBinding
import com.lukouguoji.module_base.base.BaseViewHolder
import com.lukouguoji.module_base.bean.JianBean
import com.lukouguoji.module_base.ktx.loge
class JianViewHolder(view: View) : BaseViewHolder<JianBean, ItemJianBinding>(view) {
override fun onBind(item: Any?, position: Int) {
val bean = getItemBean(item) ?: return
binding.tv.text = bean.code
binding.iv.visibility = if (bean.checked.get()) View.VISIBLE else View.GONE
bean.checked.addOnPropertyChangedCallback(object :
androidx.databinding.Observable.OnPropertyChangedCallback() {
override fun onPropertyChanged(
sender: androidx.databinding.Observable?,
propertyId: Int
) {
binding.iv.visibility = if (bean.checked.get()) View.VISIBLE else View.GONE
}
})
notifyItemClick(position, binding.rl)
}
}

View File

@@ -0,0 +1,15 @@
package com.lukouguoji.gjj.holder
import android.view.View
import com.lukouguoji.gjj.databinding.ItemTallyAddJBinding
import com.lukouguoji.module_base.base.BaseViewHolder
class TallyAddListJViewHolder(view: View) : BaseViewHolder<Any, ItemTallyAddJBinding>(view) {
override fun onBind(item: Any?, position: Int) {
val bean = getItemBean(item) ?: return
binding.tv.text = "${position + 1}"
}
}

View File

@@ -0,0 +1,46 @@
package com.lukouguoji.gjj.holder
import android.view.View
import com.lukouguoji.gjj.R
import com.lukouguoji.gjj.databinding.ItemTallyAddBinding
import com.lukouguoji.module_base.base.BaseViewHolder
import com.lukouguoji.module_base.base.CommonAdapter
import com.lukouguoji.module_base.bean.GjcBoxAddListBean
import com.lukouguoji.module_base.bean.GjjTallyAddBean
import com.lukouguoji.module_base.impl.ListChangedCallBackImpl
import com.lukouguoji.module_base.interfaces.IOnItemClickListener
import com.lukouguoji.module_base.ktx.addOnItemClickListener
import com.lukouguoji.module_base.ktx.refresh
class TallyAddListViewHolder(view: View) :
BaseViewHolder<GjjTallyAddBean, ItemTallyAddBinding>(view) {
override fun onBind(item: Any?, position: Int) {
val bean = getItemBean(item) ?: return
binding.bean = bean
binding.rv.adapter = CommonAdapter(
itemView.context,
R.layout.item_jian,
JianViewHolder::class.java
)
binding.rv.addOnItemClickListener(object : IOnItemClickListener {
override fun onItemClick(position: Int, type: Int) {
val jianBean = bean.jianList[position]
jianBean.checked.set(!jianBean.checked.get())
}
})
binding.rv.refresh(bean.jianList)
bean.jianList.addOnListChangedCallback(ListChangedCallBackImpl() {
binding.rv.refresh(bean.jianList)
})
notifyItemClick(position, binding.tvBatch)
notifyItemClick(position, binding.tvDeleteOrder)
notifyItemClick(position, binding.tvDeleteMatter)
notifyItemClick(position, binding.ivShow)
}
}

View File

@@ -0,0 +1,86 @@
package com.lukouguoji.gjj.model
import com.alibaba.fastjson.JSONArray
class GjjCangDanInfoItemModel(
val isMust: Boolean,//是否必选
val isEnable: Boolean,//是否允许操作
val titleName: String,//输入框名字
val titleCode: String,
val isSel: Boolean,//是否下拉框
var inputContent: String,//输入框内容
val selList: JSONArray?,//下拉框数据集合
var selContentCode: String,//下拉框code
var selContentName: String,//下拉框code
val titleCodePre: String?,
var inputContentPre: String?,//输入框内容前缀
) {
/**
* 输入框构造
*/
constructor(isMust: Boolean, isEnable: Boolean, titleName: String, titleCode: String, inputContent: String) : this(
isMust,
isEnable,
titleName,
titleCode,
false,
inputContent,
null,
"",
"",
null,
null
)
/**
* 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
)
/**
* 下拉框构造
*/
constructor(
isMust: Boolean, isEnable: Boolean, titleName: String, titleCode: String,
selList: JSONArray,
selContentCode: String,
selContentName: String
) : this(
isMust,
isEnable,
titleName,
titleCode,
true,
"",
selList,
selContentCode,
selContentName,
null,
null
)
}

View File

@@ -0,0 +1,19 @@
package com.lukouguoji.gjj.model
class GjjCangDanListModel(
val id: String,
val wbNo: String,
val goods: String, //品名
val awbType: String, //运单类型
val startPort: String, //始发港
val destPort: String, //目的港
val agentCode: String, //代理
val spCode: String, //特码
val totalPc: Int, //总件数
val pc: Int, //件数
val acWeight: Double, //实到重量
val chWight: Double, //计费重量
var isCheck: Boolean, //复选框 选中
var ref: String //== '1' 只能查看 不能修改
)

View File

@@ -0,0 +1,17 @@
package com.lukouguoji.gjj.model
class GjjChuKuListModel(
val id: Int,
val wbNo: String,
val pickNo: String,
val fno: String,
val pc: Int, //件数
val weight: Double, //重量
val goods: String, //品名
val agentCode: String, //代理
val spCode: String, //特码
val pickDate: String, //提取日期
var isCheck: Boolean, //复选框 选中
)

View File

@@ -0,0 +1,22 @@
package com.lukouguoji.gjj.model
class GjjQueryInfo(
val id: Int,
val title: String,
val content: String
)
/**
* 关联运单
*/
class GjjQueryInfoWh(
val id: Int,
val wbNo: String,
val location: String,//库位
val pc: Int,//件数
val weight: Double,//重量
val flight: String,//航班
val opDate: String,//入库时间
val mclose: String,//出库时间
val opId: String //收运人
)

View File

@@ -0,0 +1,13 @@
package com.lukouguoji.gjj.model
class GjjQueryList(
val mawbId: Int,
val wbNo: String,
val agentCode: String,
val spCode: String,
val goods: String,
val flight: String,
val range: String,
val pc: String,
val weight: String,
)

View File

@@ -0,0 +1,56 @@
package com.lukouguoji.gjj.model
import android.content.Context
import android.view.View
import com.lukouguoji.gjj.R
import com.lukouguoji.gjj.databinding.DialogTallyAddSelectBinding
import com.lukouguoji.gjj.holder.GjcTallyDialogViewHolder
import com.lukouguoji.module_base.base.BaseDialogModel
import com.lukouguoji.module_base.bean.GjcWaybillBean
import com.lukouguoji.module_base.bean.GjjHandoverRecordBean
import com.lukouguoji.module_base.interfaces.IOnItemClickListener
import com.lukouguoji.module_base.ktx.addOnItemClickListener
import com.lukouguoji.module_base.ktx.refresh
import com.lukouguoji.module_base.ktx.showToast
import com.lukouguoji.module_base.util.CheckUtil
import com.lxj.xpopup.XPopup
class GjjTallyAddSelectDialogModel(
val list: List<GjjHandoverRecordBean>,
private val callBack: (GjjHandoverRecordBean) -> Unit
) : BaseDialogModel<DialogTallyAddSelectBinding>(DIALOG_TYPE_CENTER) {
val itemId = R.layout.item_gjj_tally_dialog
val itemHolder = GjcTallyDialogViewHolder::class.java
override fun onBuild(builder: XPopup.Builder) {
builder.dismissOnBackPressed(false)
builder.dismissOnTouchOutside(false)
}
override fun layoutId(): Int {
return R.layout.dialog_tally_add_select
}
override fun onDialogCreated(context: Context) {
binding.model = this
binding.rv.refresh(list)
binding.rv.addOnItemClickListener(object : IOnItemClickListener {
override fun onItemClick(position: Int, type: Int) {
CheckUtil.handleSingleCheck(list, "checked", position, cancelAble = false)
}
})
}
fun onConfirmClick(view: View) {
val find = list.find { it.checked.get() }
if (find == null) {
showToast("请选择一个运单")
return
}
callBack.invoke(find)
dismiss()
}
}

View File

@@ -0,0 +1,7 @@
package com.lukouguoji.gjj.model
class GjjWareHouseInfo(
val id: Int,
val title: String,
val content: String
)

View File

@@ -0,0 +1,25 @@
package com.lukouguoji.gjj.model
class GjjWareHouseList(
val id: Int,
val waybillNo: String,
val pc: Int,
val weight: Double,
val fno: String,//航班号
val flight: String,//航班
val date: String,//入库时间
val isCangDan: String,
val groupTitle: String,
val groupName: String,
val days: String?,//入库天数
val goods: String,//品名
val spCode: String,//特码
val agentCode: String,//代理人
val by1: String,//承运人
val origin: String,//始发港
val location: String,//库位
val awbType: String,//运单类型
val businessType: String,//业务类型
val status: String,//状态
)

View File

@@ -0,0 +1,95 @@
package com.lukouguoji.gjj.model
import android.content.Context
import android.view.View
import androidx.lifecycle.MutableLiveData
import com.lukouguoji.gjj.R
import com.lukouguoji.gjj.databinding.DialogGjjTallyBatchBinding
import com.lukouguoji.module_base.base.BaseDialogModel
import com.lukouguoji.module_base.bean.GjcWaybillBean
import com.lukouguoji.module_base.bean.GjjHandoverRecordBean
import com.lukouguoji.module_base.http.net.NetApply
import com.lukouguoji.module_base.ktx.getLifecycleOwner
import com.lukouguoji.module_base.ktx.launchCollect
import com.lukouguoji.module_base.ktx.noNull
import com.lukouguoji.module_base.ktx.showToast
import com.lukouguoji.module_base.ktx.toRequestBody
import com.lukouguoji.module_base.ktx.tryCatch
import com.lukouguoji.module_base.util.Arith
import com.lxj.xpopup.XPopup
import dev.utils.app.ScreenUtils
import kotlin.math.roundToInt
class TallyBatchDialogModel(
val bean: GjjHandoverRecordBean,
val callBack: () -> Unit
) : BaseDialogModel<DialogGjjTallyBatchBinding>(DIALOG_TYPE_CENTER) {
// 剩余件数
val remainingCount = MutableLiveData(bean.pc.noNull())
// 剩余重量
val remainingWeight = MutableLiveData(bean.weight.noNull())
// 件数
val count = MutableLiveData("")
// 重量
val weight = MutableLiveData("")
override fun onBuild(builder: XPopup.Builder) {
builder.maxWidth((ScreenUtils.getScreenWidth() * 0.5).roundToInt())
}
override fun layoutId() = R.layout.dialog_gjj_tally_batch
override fun onDialogCreated(context: Context) {
binding.model = this
// 件数改变监听
count.observe(context.getLifecycleOwner()) {
tryCatch({ _ ->
val old = bean.pc.noNull().toInt()
val new = it.toInt()
if (old < new) {
count.value = bean.pc.noNull()
remainingCount.postValue("0")
} else {
val c = (old - new).toString()
remainingCount.postValue(c)
}
}) {
remainingCount.postValue(bean.pc.noNull())
}
}
// 重量改变监听
weight.observe(context.getLifecycleOwner()) {
tryCatch({ _ ->
val old = bean.weight.noNull().toDouble()
val new = it.toDouble()
if (old < new) {
weight.value = bean.weight.noNull()
remainingWeight.postValue("0")
} else {
val w =
Arith.round((old - new), 2).toString()
remainingWeight.postValue(w)
}
}) {
remainingWeight.postValue(bean.weight.noNull())
}
}
}
/**
* 保存
*/
fun save(view: View) {
bean.pc = remainingCount.value!!
bean.weight = remainingWeight.value!!
callBack()
dismiss()
}
}

View File

@@ -0,0 +1,261 @@
package com.lukouguoji.gjj.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.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
class GjjCangDanInfoViewModel : ViewModel() {
private val logName = "GjjCangDanInfoViewModel"
var waybillFormNetWork = JSONObject()
/**
* 进港 舱单详情
*/
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.queryFestByIdGjjCangDan(param.wbId)
} else if (param.wbNo != null) {
// response = UserNetwork.queryFestByWbNoGjjCangDan(param.wbNo)//tw2022年7月9日19:18:22 这个接口已经从后台删除了
} else {
}
emit(response)
} catch (e: Exception) {
Log.e(logName, e.stackTraceToString())
}
}
}
fun queryWaybillById(wbId: Int, wbNo: String?) {
wbIdData.value = WaybillParam(wbId, wbNo)
}
/**
* 代理人
*/
var agentCodeList = JSONArray()
private val agentCodeLiveData = MutableLiveData<String>()
fun agentCode(time: String) {
agentCodeLiveData.value = time
}
val agentCodeObserver = Transformations.switchMap(agentCodeLiveData) { _ ->
liveData(Dispatchers.IO) {
try {
var response = UserNetwork.agentCodeGjj()
emit(response)
} catch (e: Exception) {
Log.e("GoutStartViewModel", e.stackTraceToString())
}
}
}
/**
* 业务类型
*/
var businessList = JSONArray()
private val businessLiveData = MutableLiveData<String>()
fun business(type: String) {
businessLiveData.value = type
}
val businessObserver = Transformations.switchMap(businessLiveData) { type ->
liveData(Dispatchers.IO) {
try {
var response = UserNetwork.business(type)
emit(response)
} catch (e: Exception) {
Log.e("GoutStartViewModel", e.stackTraceToString())
}
}
}
/**
* 特码
*/
var specialCodeList = JSONArray()
private val specialCodeLiveData = MutableLiveData<String>()
fun specialCode(time: String) {
specialCodeLiveData.value = time
}
val specialCodeObserver = Transformations.switchMap(specialCodeLiveData) { _ ->
liveData(Dispatchers.IO) {
try {
var response = UserNetwork.specialCode()
emit(response)
} catch (e: Exception) {
Log.e("GoutStartViewModel", e.stackTraceToString())
}
}
}
/**
* 运单类型
*/
var awbList = JSONArray()
private val awbLiveData = MutableLiveData<String>()
fun awb(type: String) {
awbLiveData.value = type
}
val awbObserver = Transformations.switchMap(awbLiveData) { type ->
liveData(Dispatchers.IO) {
try {
var response = UserNetwork.awb(type)
emit(response)
} catch (e: Exception) {
Log.e("GoutStartViewModel", e.stackTraceToString())
}
}
}
/**
* 进港 新增舱单
*/
private val saveFestGjjCangDanLiveData = MutableLiveData<JSONObject>()
val saveFestGjjCangDanObserver = Transformations.switchMap(saveFestGjjCangDanLiveData) { param ->
liveData(Dispatchers.IO) {
try {
var response = UserNetwork.saveFestGjjCangDan(param)
emit(response)
} catch (e: Exception) {
Log.e(logName, e.stackTraceToString())
}
}
}
fun saveFestGjjCangDan(
fid: Int,
prefix: String?,
no: String?,
agentCode: String?,
spCode: String,
location: String,
totalPc: Int,
pc: Int,
weight: Double,
goods: String?,
origin: String?,
dest: String?,
businessType: String?,
remark: String?,
awbType: String?,
cashWeight: Double,
consignee: String?,
cneeId: String?,
cneeTel: String?
) {
val temObj = JSONObject()
temObj["fid"] = fid
temObj["prefix"] = prefix.emptyToNull()
temObj["no"] = no.emptyToNull()
temObj["agentCode"] = agentCode.emptyToNull()
temObj["spCode"] = spCode.emptyToNull()
temObj["location"] = location.emptyToNull()
temObj["totalPc"] = totalPc
temObj["pc"] = pc
temObj["weight"] = weight
temObj["goods"] = goods.emptyToNull()
temObj["origin"] = origin.emptyToNull()
temObj["dest"] = dest.emptyToNull()
temObj["businessType"] = businessType.emptyToNull()
temObj["remark"] = remark.emptyToNull()
temObj["awbType"] = awbType.emptyToNull()
temObj["cashWeight"] = cashWeight
temObj["consignee"] = consignee.emptyToNull()
temObj["cneeId"] = cneeId.emptyToNull()
temObj["cneeTel"] = cneeTel.emptyToNull()
saveFestGjjCangDanLiveData.value = temObj
}
/**
* 进港 修改舱单
*/
private val updateFestGjjCangDanLiveData = MutableLiveData<JSONObject>()
val updateFestGjjCangDanObserver = Transformations.switchMap(updateFestGjjCangDanLiveData) { param ->
liveData(Dispatchers.IO) {
try {
var response = UserNetwork.updateFestGjjCangDan(param)
emit(response)
} catch (e: Exception) {
Log.e(logName, e.stackTraceToString())
}
}
}
fun updateFestGjjCangDan(
mfId: Int,
fid: Int,
prefix: String,
no: String,
agentCode: String,
spCode: String,
location: String,
totalPc: Int,
pc: Int,
weight: Double,
goods: String,
origin: String,
dest: String,
businessType: String,
remark: String,
awbType: String,
cashWeight: Double,
consignee: String,
cneeId: String,
cneeTel: String
) {
val temObj = JSONObject()
temObj["mfId"] = mfId
temObj["fid"] = fid
temObj["prefix"] = prefix.emptyToNull()
temObj["no"] = no.emptyToNull()
temObj["agentCode"] = agentCode.emptyToNull()
temObj["spCode"] = spCode.emptyToNull()
temObj["location"] = location.emptyToNull()
temObj["totalPc"] = totalPc
temObj["pc"] = pc
temObj["weight"] = weight
temObj["goods"] = goods.emptyToNull()
temObj["origin"] = origin.emptyToNull()
temObj["dest"] = dest.emptyToNull()
temObj["businessType"] = businessType.emptyToNull()
temObj["remark"] = remark.emptyToNull()
temObj["awbType"] = awbType.emptyToNull()
temObj["cashWeight"] = cashWeight
temObj["consignee"] = consignee.emptyToNull()
temObj["cneeId"] = cneeId.emptyToNull()
temObj["cneeTel"] = cneeTel.emptyToNull()
updateFestGjjCangDanLiveData.value = temObj
}
}

View File

@@ -0,0 +1,184 @@
package com.lukouguoji.gjj.viewModel
import android.util.Log
import androidx.lifecycle.*
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
class GjjCangDanListViewModel : ViewModel() {
private val logName = "GjjCangDanListViewModel"
/**
* 航班号
*/
var fid: Int? = null
var prefix: String? = null
/**
* 选中
*/
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.searchGjjCangDan(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 intFlightGjjCangDanLiveData = MutableLiveData<JSONObject>()
val intFlightGjjCangDanObserver = Transformations.switchMap(intFlightGjjCangDanLiveData) { param ->
liveData(Dispatchers.IO) {
try {
val response = UserNetwork.queryFlightMitInPack(param)
emit(response)
} catch (e: Exception) {
Log.e(logName, e.stackTraceToString())
}
}
}
fun intFlightGjjCangDan(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
intFlightGjjCangDanLiveData.value = temObj
}
/**
* 删除行
*/
inner class CangDanDel(val id: Int, val position: Int)
private val deleteFestGjjCangDanLiveData = MutableLiveData<CangDanDel>()
val deleteFestGjjCangDanObserver = Transformations.switchMap(deleteFestGjjCangDanLiveData) { param ->
liveData(Dispatchers.IO) {
try {
val response = UserNetwork.deleteFestGjjCangDan(param.id)
response["positionDel"] = param.position
emit(response)
} catch (e: Exception) {
Log.e(logName, e.stackTraceToString())
}
}
}
fun deleteFestGjjCangDan(id: Int, position: Int) {
deleteFestGjjCangDanLiveData.value = CangDanDel(id, position)
}
/**
* 货物发放
*/
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
}
}

View File

@@ -0,0 +1,171 @@
package com.lukouguoji.gjj.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
class GjjChuKuListViewModel : ViewModel() {
/**
* 航班号
*/
var fid: Int? = null
/**
* 选中
*/
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.searchGjjChuKu(param)
emit(response)
} catch (e: Exception) {
Log.e("GoutCollectionViewModel", e.stackTraceToString())
}
}
}
fun search(
limit: Int,
page: Int,
wbNo: String,
agentCode: String,
id: String,
beginDate: String,
endDate: String
) {
val param = JSONObject()
param["limit"] = limit
param["page"] = page
param["wbNo"] = wbNo.emptyToNull()
param["agentCode"] = agentCode.emptyToNull()
param["id"] = id.emptyToNull()
param["beginDate"] = beginDate.emptyToNull()
param["endDate"] = endDate.emptyToNull()
searchParam.value = param
}
/**
* 根据运单号后4位查询运单号
*/
val queryWbNoGjjChuKuParamLive = MutableSharedFlow<JSONObject>(replay = 1)
fun queryWbNoGjjChuKu(wbNo: String) {
viewModelScope.launch {
flow {
val response = UserNetwork.queryWbNoGjjChuKu(wbNo)
//返回结果
emit(response)
}.flowOn(Dispatchers.Default)
.catch { e ->
Log.e("GnjChuKuListViewModel", e.stackTraceToString())
}
.collect { response ->
queryWbNoGjjChuKuParamLive.emit(response)
}
}
}
/**
* 确认出库
*/
private val completedGjjChuKuLiveData = MutableLiveData<JSONObject>()
val completedGjjChuKuObserver = Transformations.switchMap(completedGjjChuKuLiveData) { param ->
liveData(Dispatchers.IO) {
try {
val response = UserNetwork.completedGjjChuKu(param)
emit(response)
} catch (e: Exception) {
Log.e("GoutCollectionViewModel", e.stackTraceToString())
}
}
}
fun completedGjjChuKu(ids: List<Int>) {
val temObj = JSONObject()
temObj["ids"] = ids
completedGjjChuKuLiveData.value = temObj
}
/**
* 根据提货单号查询
*/
private val queryPickByIdGjjChuKuLiveData = MutableLiveData<String>()
val queryPickByIdGjjChuKuObserver = Transformations.switchMap(queryPickByIdGjjChuKuLiveData) { param ->
liveData(Dispatchers.IO) {
try {
val response = UserNetwork.queryPickByIdGjjChuKu(param)
emit(response)
} catch (e: Exception) {
Log.e("GoutCollectionViewModel", e.stackTraceToString())
}
}
}
fun queryPickByIdGjjChuKu(pkId: String) {
queryPickByIdGjjChuKuLiveData.value = pkId
}
/**
* 代理人
*/
var agentCodeList = JSONArray()
private val agentCodeLiveData = MutableLiveData<String>()
fun agentCode(time: String) {
agentCodeLiveData.value = time
}
val agentCodeObserver = Transformations.switchMap(agentCodeLiveData) { _ ->
liveData(Dispatchers.IO) {
try {
var response = UserNetwork.agentCodeGjc()
emit(response)
} catch (e: Exception) {
Log.e("GoutStartViewModel", e.stackTraceToString())
}
}
}
}

View File

@@ -0,0 +1,223 @@
package com.lukouguoji.gjj.viewModel
import android.app.Activity
import android.content.Intent
import android.view.View
import androidx.lifecycle.MutableLiveData
import com.lukouguoji.gjj.R
import com.lukouguoji.gjj.holder.GjjGoodsAddViewHolder
import com.lukouguoji.module_base.base.BasePageViewModel
import com.lukouguoji.module_base.bean.GjjTallyRecordBean
import com.lukouguoji.module_base.common.Constant
import com.lukouguoji.module_base.http.net.NetApply
import com.lukouguoji.module_base.interfaces.ICheck
import com.lukouguoji.module_base.ktx.commonAdapter
import com.lukouguoji.module_base.ktx.finish
import com.lukouguoji.module_base.ktx.formatDate
import com.lukouguoji.module_base.ktx.getActivity
import com.lukouguoji.module_base.ktx.launchCollect
import com.lukouguoji.module_base.ktx.limit
import com.lukouguoji.module_base.ktx.noNull
import com.lukouguoji.module_base.ktx.showToast
import com.lukouguoji.module_base.ktx.toRequestBody
import com.lukouguoji.module_base.model.ScanModel
import com.lukouguoji.module_base.util.CheckUtil
import com.lukouguoji.module_base.util.Common
import com.lukouguoji.module_base.util.DictUtils
import dev.utils.app.info.KeyValue
import java.util.Calendar
import java.util.Date
class GjjGoodsAddViewModel : BasePageViewModel() {
// 航班日期
val flightDate = MutableLiveData(Date().formatDate())
// 航班号
val flightNo = MutableLiveData<String>()
// 代理
val agent = MutableLiveData<String>()
// 运单号
val waybillNo = MutableLiveData<String>()
// 代理列表
val agentList = MutableLiveData(emptyList<KeyValue>())
val itemLayoutId = R.layout.item_gjj_goods_add
val itemViewHolder = GjjGoodsAddViewHolder::class.java
// 描述
val desc = MutableLiveData("")
init {
DictUtils.getAgentList {
agentList.postValue(it)
}
}
override fun getData() {
launchCollect({
NetApply.api
.getGjjGoodsTallyRecordList(
mapOf(
"fdate" to flightDate.value,
"fno" to flightNo.value,
"agent" to agent.value,
"wbNo" to waybillNo.value,
).toRequestBody()
)
}) {
onSuccess = {
if (it.verifySuccess()) {
pageModel.handleDataList(it.data)
generateDesc()
} else {
showToast(it.msg.noNull("获取数据失败"))
}
}
}
}
/**
* 条目点击事件
*/
override fun onItemClick(position: Int, type: Int) {
val adapter = pageModel.rv!!.commonAdapter()!!
val bean = adapter.getItem(position) as GjjTallyRecordBean
when (type) {
// 图标选中状态
R.id.iv_icon -> {
bean.checked.set(!bean.checked.get())
generateDesc()
}
else -> {
showToast("未知点击类型")
}
}
}
/**
* 航班日期点击
*/
fun onFlightDateClick(view: View) {
Common.onYearMonthDay(
view.context.getActivity(),
flightDate.value!!
) { year, month, day ->
val calendar = Calendar.getInstance()
calendar.set(year, month - 1, day)
flightDate.value = calendar.time.formatDate()
}
}
/**
* 代理点击
*/
fun onAgentSelected(position: Int) {
agent.value = agentList.value!![position].value
}
/**
* 运单号扫描点击
*/
fun onWaybillNoScanClick(view: View) {
ScanModel.startScan(view.context.getActivity(), Constant.RequestCode.WAYBILL)
}
/**
* 全选点击
*/
fun onAllClick(view: View) {
pageModel.rv?.commonAdapter()?.items?.let {
CheckUtil.handleAllCheck(it as List<ICheck>)
generateDesc()
}
}
/**
* 搜索点击
*/
fun onSearchClick(view: View) {
refresh()
}
/**
* 确认点击
*/
fun onConfirmClick(view: View) {
val checkedList = getCheckedList()
if (checkedList.isEmpty()) {
showToast("请选择需要交接的数据")
return
}
checkedList.count { it.agent == checkedList.first().agent }.let {
if (it != checkedList.size) {
showToast("请选择同一代理的数据")
return
}
}
showLoading()
launchCollect({
NetApply.api.gjjGoodsInsert(
mapOf(
"agent" to checkedList.first().agent,
"pc" to checkedList.sumOf { it.pc ?: 0 },
"weight" to checkedList.sumOf { it.weight.noNull("0.0").toDouble() }.limit(),
"whidList" to checkedList.map { it.whid }
).toRequestBody()
)
}) {
onSuccess = {
if (it.verifySuccess()) {
showToast(it.msg.noNull("交接成功"))
view.context.finish()
} else {
showToast(it.msg.noNull("交接失败"))
}
}
onComplete = {
dismissLoading()
}
}
}
/**
* 生成描述
*/
fun generateDesc() {
val checkedList = getCheckedList()
if (checkedList.isEmpty()) {
desc.value = "合计0票件数0重量0KG"
}
val count = checkedList.size
val weight = checkedList.sumOf { it.weight?.toDouble() ?: 0.0 }
val pc = checkedList.sumOf { it.pc ?: 0 }
desc.value = "合计:${count}票,件数:${pc},重量:${weight.limit(2)}KG"
}
/**
* 获取选中的列表
*/
private fun getCheckedList(): List<GjjTallyRecordBean> {
return (pageModel.rv?.commonAdapter()?.items?.filter {
it is GjjTallyRecordBean && it.checked.get()
} ?: emptyList()) as List<GjjTallyRecordBean>
}
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
if (resultCode == Activity.RESULT_OK && data != null) {
when (requestCode) {
Constant.RequestCode.WAYBILL -> {
val id = data.getStringExtra(Constant.Result.CODED_CONTENT).noNull()
waybillNo.value = id
}
else -> {}
}
}
}
}

View File

@@ -0,0 +1,147 @@
package com.lukouguoji.gjj.viewModel
import android.view.View
import androidx.lifecycle.MutableLiveData
import com.lukouguoji.gjj.R
import com.lukouguoji.gjj.activity.GjjGoodsAddActivity
import com.lukouguoji.gjj.activity.GjjGoodsManifestActivity
import com.lukouguoji.gjj.holder.GjjGoodsListViewHolder
import com.lukouguoji.module_base.base.BasePageViewModel
import com.lukouguoji.module_base.bean.GjjGoodsBean
import com.lukouguoji.module_base.common.Constant
import com.lukouguoji.module_base.http.net.NetApply
import com.lukouguoji.module_base.interfaces.IOnItemClickListener
import com.lukouguoji.module_base.ktx.commonAdapter
import com.lukouguoji.module_base.ktx.formatDate
import com.lukouguoji.module_base.ktx.getActivity
import com.lukouguoji.module_base.ktx.launchCollect
import com.lukouguoji.module_base.ktx.noNull
import com.lukouguoji.module_base.ktx.showToast
import com.lukouguoji.module_base.ktx.toRequestBody
import com.lukouguoji.module_base.model.ScanModel
import com.lukouguoji.module_base.util.Common
import com.lukouguoji.module_base.util.DictUtils
import dev.DevUtils
import dev.utils.app.info.KeyValue
import java.util.Calendar
import java.util.Date
class GjjGoodsListViewModel : BasePageViewModel(), IOnItemClickListener {
// 交接开始日期
val startDate = MutableLiveData(Date().formatDate())
// 交接结束日期
val endDate = MutableLiveData(Date().formatDate())
// 交接单号
val handoverNo = MutableLiveData<String>()
// 代理
val agent = MutableLiveData<String>("")
// 代理列表
val agentList = MutableLiveData<List<KeyValue>>(emptyList())
val itemId = R.layout.item_gjj_goods
val itemHolder = GjjGoodsListViewHolder::class.java
// 数量
val count = MutableLiveData(0)
init {
DictUtils.getAgentList {
agentList.postValue(it)
}
}
override fun getData() {
launchCollect({
NetApply.api
.getGjjGoodsList(
mapOf(
"handtimeStart" to startDate.value,
"handtimeEnd" to endDate.value,
"movID" to handoverNo.value,
"agent" to agent.value,
).toRequestBody()
)
}) {
onSuccess = {
if (it.verifySuccess()) {
pageModel.handleDataList(it.data)
count.value = it.data?.size ?: 0
} else {
showToast(it.msg.noNull("获取数据失败"))
}
}
}
}
/**
* 交接开始日期选择
*/
fun startDateSelect(view: View) {
Common.onYearMonthDay(view.context.getActivity(), startDate.value!!) { y, m, d ->
val calendar = Calendar.getInstance()
calendar.set(y, m - 1, d)
startDate.value = calendar.time.formatDate()
}
}
/**
* 交接结束日期选择
*/
fun endDateSelect(view: View) {
Common.onYearMonthDay(view.context.getActivity(), endDate.value!!) { y, m, d ->
val calendar = Calendar.getInstance()
calendar.set(y, m - 1, d)
endDate.value = calendar.time.formatDate()
}
}
/**
* 交接单号扫描
*/
fun handoverNoScan(view: View) {
ScanModel.startScan(view.context.getActivity(), Constant.RequestCode.CODE)
}
/**
* 代理点击
*/
fun agentSelected(position: Int) {
agent.value = agentList.value!![position].value
}
/**
* 查询
*/
fun searchClick(view: View) {
refresh()
}
/**
* 添加 点击
*/
fun addClick(view: View) {
GjjGoodsAddActivity.start(view.context)
}
/**
* 条目点击事件
*/
override fun onItemClick(position: Int, type: Int) {
val bean = pageModel.rv!!.commonAdapter()!!.getItem(position) as GjjGoodsBean
when (type) {
// 详情
R.id.tv_details -> {
GjjGoodsManifestActivity.start(DevUtils.getTopActivity(), bean.movID.noNull())
}
else -> {
showToast("未知点击类型")
}
}
}
}

View File

@@ -0,0 +1,111 @@
package com.lukouguoji.gjj.viewModel
import android.content.Context
import android.graphics.Bitmap
import android.graphics.BitmapFactory
import android.view.View
import androidx.lifecycle.MutableLiveData
import com.lukouguoji.gjj.R
import com.lukouguoji.gjj.holder.GjjGoodsManifestViewHolder
import com.lukouguoji.module_base.base.BasePageViewModel
import com.lukouguoji.module_base.bean.GjjGoodsDetailsBean
import com.lukouguoji.module_base.http.net.NetApply
import com.lukouguoji.module_base.ktx.finish
import com.lukouguoji.module_base.ktx.launchCollect
import com.lukouguoji.module_base.ktx.noNull
import com.lukouguoji.module_base.ktx.showToast
import com.lukouguoji.module_base.ktx.toBoolean
import com.lukouguoji.module_base.ui.signature.SignatureActivity
import dev.utils.common.cipher.Base64
import okhttp3.MediaType.Companion.toMediaTypeOrNull
import okhttp3.MultipartBody
import okhttp3.RequestBody.Companion.asRequestBody
import okhttp3.RequestBody.Companion.toRequestBody
import java.io.File
class GjjGoodsManifestViewModel : BasePageViewModel() {
var id: String = ""
val itemLayoutId = R.layout.item_gjj_goods_manifest
val itemViewHolder = GjjGoodsManifestViewHolder::class.java
// 签名
val signature = MutableLiveData("")
val dataBean = MutableLiveData<GjjGoodsDetailsBean>()
// 返回签名
val resultSign = MutableLiveData<Bitmap>()
///////////////////////////////////////////////////////////////////////////
// 方法区
///////////////////////////////////////////////////////////////////////////
override fun getData() {
launchCollect({
NetApply.api.getGjjGoodsDetail(id)
}) {
onSuccess = {
if (it.verifySuccess() && it.data != null) {
dataBean.value = it.data!!
pageModel.handleDataList(it.data!!.gjjWarehouseList)
val data = it.data!!
// 已交接 & 有签名
if (data.isCheck.toBoolean() && !data.sign.isNullOrEmpty()) {
val bytes = Base64.decode(
data.sign!!,
Base64.DEFAULT
)
val bitmap = BitmapFactory.decodeByteArray(bytes, 0, bytes.size)
resultSign.postValue(bitmap)
}
} else {
showToast(it.msg.noNull("获取数据失败"))
}
}
}
}
/**
* 打印点击
*/
fun printClick(view: View) {
view.context.finish()
}
/**
* 签字点击
*/
fun signClick(view: View) {
if (dataBean.value?.isCheck?.toBoolean() == false) {
SignatureActivity.start(view.context)
}
}
/**
* 提交签名
*/
fun submitSignature(context: Context, signature: String) {
launchCollect({
val file = File(signature)
val body = file.asRequestBody("multipart/form-data".toMediaTypeOrNull())
val part = MultipartBody.Part.createFormData("file", file.name, body)
NetApply.api
.gjjGoodsSubmitSignature(
part, mutableMapOf(
"movID " to id.toRequestBody("multipart/form-data".toMediaTypeOrNull()),
)
)
}) {
onSuccess = {
if (it.verifySuccess()) {
showToast(it.msg.noNull("提交成功"))
context.finish()
} else {
showToast(it.msg.noNull("提交失败"))
}
}
}
}
}

View File

@@ -0,0 +1,211 @@
package com.lukouguoji.gjj.viewModel
import android.view.View
import androidx.lifecycle.MutableLiveData
import com.lukouguoji.module_base.base.BaseViewModel
import com.lukouguoji.module_base.http.net.NetApply
import com.lukouguoji.module_base.ktx.finish
import com.lukouguoji.module_base.ktx.launchCollect
import com.lukouguoji.module_base.ktx.noNull
import com.lukouguoji.module_base.ktx.showToast
import com.lukouguoji.module_base.ktx.toRequestBody
import com.lukouguoji.module_base.ktx.verifyNullOrEmpty
import com.lukouguoji.module_base.util.DictUtils
import dev.utils.app.info.KeyValue
class GjjManifestAddViewModel : BaseViewModel() {
// 航班ID
var fid: String = ""
// 运单号
val waybillNo = MutableLiveData("")
// 运单件数
val waybillNum = MutableLiveData("")
// 实到数量
val actualNum = MutableLiveData("")
// 实到重量
val actualWeight = MutableLiveData("")
// 计费重量
val billingWeight = MutableLiveData("")
// 始发港
val departure = MutableLiveData("")
// 目的港
val destination = MutableLiveData("")
// 品名(中)
val goodsNameCn = MutableLiveData("")
// 品名(英)
val goodsNameEn = MutableLiveData("")
// 备注
val remark = MutableLiveData("")
// 业务类型 列表
val businessTypeList = MutableLiveData<List<KeyValue>>()
private var businessType = ""
// 包装类型 列表
val packageTypeList = MutableLiveData<List<KeyValue>>()
private var packageType = ""
// 代理列表
val agentList = MutableLiveData<List<KeyValue>>()
private var agent = ""
// 特码列表
val specialCodeList = MutableLiveData<List<KeyValue>>()
private var specialCode = ""
// 货物类型
val goodsTypeList = MutableLiveData<List<KeyValue>>()
private var goodsType = ""
// 运单类型
val waybillTypeList = MutableLiveData<List<KeyValue>>()
private var waybillType = ""
init {
DictUtils.getAgentList(addAll = false) {
agentList.postValue(listOf(KeyValue("", "")) + it)
}
DictUtils.getSpecialCodeList(addAll = false, flag = 1, ieFlag = "I") {
val list = arrayListOf<KeyValue>()
it.find { b -> b.key.contains("普通货物") }?.let { b ->
list.add(b)
}
list.addAll(it.filter { b -> !b.key.contains("普通货物") })
specialCodeList.postValue(list)
}
DictUtils.getBusinessTypeList(addAll = false) {
businessTypeList.postValue(it)
}
DictUtils.getGjjPackageTypeList(addAll = false) {
packageTypeList.postValue(listOf(KeyValue("", "")) + it)
}
DictUtils.getGjjGoodsTypeList(addAll = false) {
goodsTypeList.postValue(it)
}
DictUtils.getWaybillTypeList(type = "II", addAll = false) {
val list = arrayListOf<KeyValue>()
it.find { b -> b.key.contains("干线") }?.let { b ->
list.add(b)
}
list.addAll(it.filter { b -> !b.key.contains("干线") })
waybillTypeList.postValue(list)
}
}
/**
* 代理点击
*/
fun onAgentSelected(position: Int) {
agent = agentList.value?.get(position)?.value.noNull()
}
/**
* 特码点击
*/
fun onSpecialCodeSelected(position: Int) {
specialCode = specialCodeList.value?.get(position)?.value.noNull()
}
/**
* 包装类型点击
*/
fun onPackageTypeSelected(position: Int) {
packageType = packageTypeList.value?.get(position)?.value.noNull()
}
/**
* 业务类型点击
*/
fun onBusinessTypeSelected(position: Int) {
businessType = businessTypeList.value?.get(position)?.value.noNull()
}
/**
* 货物类型点击
*/
fun onGoodsTypeSelected(position: Int) {
goodsType = goodsTypeList.value?.get(position)?.value.noNull()
}
/**
* 运单类型点击
*/
fun onWaybillTypeSelected(position: Int) {
waybillType = waybillTypeList.value?.get(position)?.value.noNull()
}
/**
* 保存点击
*/
fun onSaveClick(view: View) {
if ((waybillNo.value.verifyNullOrEmpty("请输入运单号")
|| agent.verifyNullOrEmpty("请选择代理")
|| waybillNum.value.verifyNullOrEmpty("请输入运单件数")
|| actualNum.value.verifyNullOrEmpty("请输入实到数量")
|| goodsNameEn.value.verifyNullOrEmpty("请输入品名(英)")
|| actualWeight.value.verifyNullOrEmpty("请输入实到重量")
|| packageType.verifyNullOrEmpty("请选择包装类型")
)
) {
return
}
showLoading()
launchCollect({
NetApply.api.gjjManifestInsert(
mapOf(
"fid" to fid,
"wbNo" to waybillNo.value,
"agent" to agent,
"spCode" to specialCode,
"businessType" to businessType,
"awbpc" to waybillNum.value,
"pc" to actualNum.value,
"weight" to actualWeight.value,
"planweight" to billingWeight.value,
"packagecode" to packageType,
"dep" to departure.value,
"origin" to departure.value,
"dest" to destination.value,
"goods" to goodsNameEn.value,
"goodsCn" to goodsNameCn.value,
"awbType" to waybillType,
"cargoType" to goodsType,
"remark" to remark.value,
).toRequestBody()
)
}) {
onSuccess = {
if (it.verifySuccess()) {
showToast("保存成功")
view.context.finish()
} else {
showToast(it.msg.noNull("保存失败"))
}
}
onComplete = {
dismissLoading()
}
}
}
/**
* 取消点击
*/
fun onCancelClick(view: View) {
view.context.finish()
}
}

View File

@@ -0,0 +1,251 @@
package com.lukouguoji.gjj.viewModel
import android.view.View
import androidx.lifecycle.MutableLiveData
import com.lukouguoji.module_base.base.BaseViewModel
import com.lukouguoji.module_base.http.net.NetApply
import com.lukouguoji.module_base.interfaces.IGetData
import com.lukouguoji.module_base.ktx.finish
import com.lukouguoji.module_base.ktx.formatDate
import com.lukouguoji.module_base.ktx.launchCollect
import com.lukouguoji.module_base.ktx.noNull
import com.lukouguoji.module_base.ktx.showToast
import com.lukouguoji.module_base.ktx.toRequestBody
import com.lukouguoji.module_base.ktx.verifyNullOrEmpty
import com.lukouguoji.module_base.util.DictUtils
import dev.utils.app.info.KeyValue
import dev.utils.common.DateUtils
class GjjManifestDetailsViewModel : BaseViewModel(), IGetData {
var id = ""
var fid = ""
// 是否修改状态
var modifyAble = MutableLiveData(false)
// 运单号
val waybillNo = MutableLiveData("")
// 运单件数
val waybillNum = MutableLiveData("")
// 实到数量
val actualNum = MutableLiveData("")
// 实到重量
val actualWeight = MutableLiveData("")
// 计费重量
val billingWeight = MutableLiveData("")
// 始发港
val departure = MutableLiveData("")
// 目的港
val destination = MutableLiveData("")
// 品名(中)
val goodsNameCn = MutableLiveData("")
// 品名(英)
val goodsNameEn = MutableLiveData("")
// 备注
val remark = MutableLiveData("")
// 时间
val date = MutableLiveData(DateUtils.getCurrentTime().formatDate())
// 业务类型 列表
val businessTypeList = MutableLiveData<List<KeyValue>>()
private var businessType = ""
// 包装类型 列表
val packageTypeList = MutableLiveData<List<KeyValue>>()
private var packageType = ""
// 代理列表
val agentList = MutableLiveData<List<KeyValue>>()
private var agent = ""
// 特码列表
val specialCodeList = MutableLiveData<List<KeyValue>>()
private var specialCode = ""
// 货物类型
val goodsTypeList = MutableLiveData<List<KeyValue>>()
private var goodsType = ""
// 运单类型
val waybillTypeList = MutableLiveData<List<KeyValue>>()
private var waybillType = ""
///////////////////////////////////////////////////////////////////////////
// 方法区
///////////////////////////////////////////////////////////////////////////
override fun getData() {
showLoading()
launchCollect({
NetApply.api.getGjjManifestDetail(id)
}) {
onSuccess = { result ->
result.data?.let { data ->
fid = data.fid.toString()
waybillNo.value = data.getWaybillCode().noNull()
waybillNum.value = data.awbpc.toString()
actualNum.value = data.pc.toString()
actualWeight.value = data.weight.noNull()
billingWeight.value = data.planweight.noNull()
departure.value = data.origin.noNull(data.dep.noNull())
destination.value = data.dest.noNull()
goodsNameCn.value = data.goodsCn.noNull()
goodsNameEn.value = data.goods.noNull()
remark.value = data.remark.noNull()
date.value = data.storageTime.noNull()
DictUtils.getAgentList(addAll = false, checkedValue = data.agent) {
agentList.postValue(it)
}
DictUtils.getSpecialCodeList(addAll = false, flag = 1, ieFlag = "I", checkedValue = data.spCode) {
specialCodeList.postValue(it)
}
DictUtils.getBusinessTypeList(
addAll = false,
checkedValue = data.businessType
) {
businessTypeList.postValue(it)
}
DictUtils.getGjjPackageTypeList(addAll = false, checkedValue = data.packagecode) {
packageTypeList.postValue(it)
}
DictUtils.getGjjGoodsTypeList(addAll = false, checkedValue = data.cargoType) {
goodsTypeList.postValue(it)
}
DictUtils.getWaybillTypeList(
type = "II",
addAll = false,
checkedValue = data.awbType
) {
waybillTypeList.postValue(it)
}
}
}
onComplete = {
dismissLoading()
}
}
}
/**
* 修改状态点击
*/
fun onModifyClick(view: View) {
modifyAble.value = !modifyAble.value!!
}
/**
* 代理点击
*/
fun onAgentSelected(position: Int) {
agent = agentList.value?.get(position)?.value.noNull()
}
/**
* 特码点击
*/
fun onSpecialCodeSelected(position: Int) {
specialCode = specialCodeList.value?.get(position)?.value.noNull()
}
/**
* 包装类型点击
*/
fun onPackageTypeSelected(position: Int) {
packageType = packageTypeList.value?.get(position)?.value.noNull()
}
/**
* 业务类型点击
*/
fun onBusinessTypeSelected(position: Int) {
businessType = businessTypeList.value?.get(position)?.value.noNull()
}
/**
* 货物类型点击
*/
fun onGoodsTypeSelected(position: Int) {
goodsType = goodsTypeList.value?.get(position)?.value.noNull()
}
/**
* 运单类型点击
*/
fun onWaybillTypeSelected(position: Int) {
waybillType = waybillTypeList.value?.get(position)?.value.noNull()
}
/**
* 保存点击
*/
fun onSaveClick(view: View) {
if ((waybillNo.value.verifyNullOrEmpty("请输入运单号")
|| waybillNum.value.verifyNullOrEmpty("请输入运单件数")
|| actualNum.value.verifyNullOrEmpty("请输入实到数量")
|| actualWeight.value.verifyNullOrEmpty("请输入实到重量"))
) {
return
}
showLoading()
launchCollect({
NetApply.api.gjjManifestUpdate(
mapOf(
"mfId" to id,
"fid" to fid,
"wbNo" to waybillNo.value,
"agent" to agent,
"spCode" to specialCode,
"businessType" to businessType,
"awbpc" to waybillNum.value,
"pc" to actualNum.value,
"weight" to actualWeight.value,
"planweight" to billingWeight.value,
"packagecode" to packageType,
"dep" to departure.value,
"origin" to departure.value,
"dest" to destination.value,
"goods" to goodsNameEn.value,
"goodsCn" to goodsNameCn.value,
"awbType" to waybillType,
"cargoType" to goodsType,
"remark" to remark.value,
).toRequestBody()
)
}) {
onSuccess = {
if (it.verifySuccess()) {
showToast("保存成功")
view.context.finish()
} else {
showToast(it.msg.noNull("保存失败"))
}
}
onComplete = {
dismissLoading()
}
}
}
/**
* 取消点击
*/
fun onCancelClick(view: View) {
modifyAble.value = false
}
}

View File

@@ -0,0 +1,305 @@
package com.lukouguoji.gjj.viewModel
import android.app.Activity
import android.content.Context
import android.content.Intent
import android.view.View
import androidx.lifecycle.MutableLiveData
import com.lukouguoji.gjj.R
import com.lukouguoji.gjj.activity.GjjManifestAddActivity
import com.lukouguoji.gjj.activity.GjjManifestDetailsActivity
import com.lukouguoji.gjj.holder.GjjManifestListViewHolder
import com.lukouguoji.module_base.base.BasePageViewModel
import com.lukouguoji.module_base.bean.FlightBean
import com.lukouguoji.module_base.bean.GjjManifestBean
import com.lukouguoji.module_base.common.Constant
import com.lukouguoji.module_base.http.net.NetApply
import com.lukouguoji.module_base.interfaces.ICheck
import com.lukouguoji.module_base.interfaces.IOnItemClickListener
import com.lukouguoji.module_base.ktx.commonAdapter
import com.lukouguoji.module_base.ktx.formatDate
import com.lukouguoji.module_base.ktx.getActivity
import com.lukouguoji.module_base.ktx.getLifecycleOwner
import com.lukouguoji.module_base.ktx.launchCollect
import com.lukouguoji.module_base.ktx.limit
import com.lukouguoji.module_base.ktx.noNull
import com.lukouguoji.module_base.ktx.showToast
import com.lukouguoji.module_base.ktx.toRequestBody
import com.lukouguoji.module_base.ktx.verifyNullOrEmpty
import com.lukouguoji.module_base.model.ScanModel
import com.lukouguoji.module_base.util.CheckUtil
import com.lukouguoji.module_base.util.Common
import dev.DevUtils
import dev.utils.app.info.KeyValue
import java.util.Calendar
import java.util.Date
class GjjManifestListViewModel : BasePageViewModel(), IOnItemClickListener {
// 航班日期
var flightDate = MutableLiveData(Date().formatDate())
// 航班号
var flightNo = MutableLiveData<String>()
// 始发站
var departure = MutableLiveData<String>()
// 运单号
var waybillNo = MutableLiveData<String>()
// 始发站
val departureList = MutableLiveData<List<KeyValue>>(emptyList())
// 航班信息
val flightBean = MutableLiveData<FlightBean>()
val itemId = R.layout.item_gjj_manifest
val viewHolder = GjjManifestListViewHolder::class.java
// 描述
val desc = MutableLiveData("合计0票件数0重量0KG")
private var firstIn = true
///////////////////////////////////////////////////////////////////////////
// 方法区
///////////////////////////////////////////////////////////////////////////
/**
* 初始化
*/
fun init(context: Context) {
flightNo.observe(context.getLifecycleOwner()) {
getDepartureDictList()
}
}
override fun getData() {
if (!verifyHaveFlight()) {
if (!firstIn)
showToast("请输入正确航班信息")
pageModel.finishLoading()
firstIn = false
return
}
launchCollect({
NetApply.api
.getGjjManifestList(
mapOf(
"fdate" to flightDate.value,
"fno" to flightNo.value,
"wbNo" to waybillNo.value,
"page" to pageModel.page,
).toRequestBody()
)
}) {
onSuccess = {
pageModel.handleListBean(it)
val count = it.list?.size ?: 0
val weight =
(it.list?.sumOf { b -> b.weight.noNull("0.0").toDouble() } ?: 0.0).limit()
val pieces = it.list?.sumOf { b -> b.pc } ?: 0
desc.value = "合计:${count}票,件数:${pieces},重量:${weight}KG"
}
onComplete = {
pageModel.finishLoading()
}
}
}
/**
* 获取航班信息
*/
private fun getDepartureDictList() {
if (flightNo.value.isNullOrEmpty()) {
return
}
launchCollect({
NetApply.api
.getGjFlightBean(
mapOf(
"fdate" to flightDate.value,
"fno" to flightNo.value,
"ieFlag" to "I",
).toRequestBody()
)
}) {
onSuccess = {
if (it.verifySuccess() && it.data != null) {
flightBean.value = it.data
val list = mutableListOf(
KeyValue(it.data!!.fdep.noNull(), it.data!!.fdep.noNull()),
)
if (!it.data!!.jtz.isNullOrEmpty()) {
list.add(KeyValue(it.data!!.jtz.noNull(), it.data!!.jtz.noNull()))
}
departureList.value = list
refresh()
} else {
flightBean.value = FlightBean()
departureList.value = emptyList()
}
}
onFailed = { _, _ ->
flightBean.value = FlightBean()
departureList.value = emptyList()
}
}
}
/**
* 航班日期 点击
*/
fun flightDateClick(view: View) {
Common.onYearMonthDay(view.context.getActivity(), flightDate.value) { year, month, day ->
val calendar = Calendar.getInstance()
calendar.set(year, month - 1, day)
flightDate.value = calendar.time.formatDate()
getDepartureDictList()
}
}
/**
* 始发站 点击
*/
fun departureSelected(position: Int) {
departure.value = departureList.value?.get(position)?.value
}
/**
* 运单号 点击
*/
fun waybillNoClick(view: View) {
ScanModel.startScan(view.context.getActivity(), Constant.RequestCode.WAYBILL)
}
/**
* 搜索点击
*/
fun searchClick(view: View) {
refresh()
}
/**
* 添加 点击
*/
fun addClick(view: View) {
if (flightBean.value?.fid.verifyNullOrEmpty("请先输入正确航班信息")) {
return
}
GjjManifestAddActivity.start(
view.context,
flightBean.value?.fid?.toString() ?: "",
flightBean.value?.fdep?.toString() ?: "",
flightBean.value?.fdest?.toString() ?: "",
)
}
/**
* 删除 点击
*/
fun deleteClick(view: View) {
val list =
pageModel.rv?.commonAdapter()?.items?.filter { (it as GjjManifestBean).checked.get() }
if (list.isNullOrEmpty()) {
showToast("请选择需要删除的数据")
return
}
Common.secondConfirmDialog(
view.context.getActivity(),
"是否确认删除选中的${list.size}条数据?"
) { dialog ->
dialog.dismiss()
onDelete(list as List<GjjManifestBean>)
}
}
/**
* 全选点击
*/
fun selectAllClick(view: View) {
pageModel.rv?.commonAdapter()?.items?.let {
CheckUtil.handleAllCheck((it as List<ICheck>))
}
}
/**
* item 点击
*/
override fun onItemClick(position: Int, type: Int) {
val adapter = pageModel.rv!!.commonAdapter()!!
val bean = adapter.getItem(position) as GjjManifestBean
when (type) {
R.id.iv_icon -> {
bean.checked.set(!bean.checked.get())
}
R.id.iv_show -> {
CheckUtil.handleSingleCheck(adapter.items, "show", position)
}
R.id.tv_details -> {
GjjManifestDetailsActivity.start(DevUtils.getTopActivity(), bean.mfId)
}
R.id.tv_delete -> {
Common.secondConfirmDialog(
DevUtils.getTopActivity(),
"是否确认删除该条信息?"
) { dialog ->
dialog.dismiss()
onDelete(listOf(bean))
}
}
else -> {}
}
}
/**
* 删除单条数据
*/
private fun onDelete(list: List<GjjManifestBean>) {
showLoading()
launchCollect({
NetApply.api.gjjManifestDelete(
list.map { it.mfId }.toRequestBody()
)
}) {
onSuccess = {
if (it.verifySuccess()) {
showToast(it.msg.noNull("删除成功"))
refresh()
} else {
showToast(it.msg.noNull("删除失败"))
}
}
onComplete = {
dismissLoading()
}
}
}
/**
* 校验是否有航班信息
*/
private fun verifyHaveFlight() = !flightBean.value?.fid.isNullOrEmpty()
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
if (resultCode == Activity.RESULT_OK && data != null) {
when (requestCode) {
Constant.RequestCode.WAYBILL -> {
val id = data.getStringExtra(Constant.Result.CODED_CONTENT).noNull()
waybillNo.value = id
}
else -> {}
}
}
}
}

View File

@@ -0,0 +1,304 @@
package com.lukouguoji.gjj.viewModel
import android.content.Context
import android.view.View
import androidx.lifecycle.MutableLiveData
import com.lukouguoji.gjj.R
import com.lukouguoji.gjj.activity.GjjManifestListActivity
import com.lukouguoji.gjj.holder.GjjPacketParseViewHolder
import com.lukouguoji.module_base.base.BasePageViewModel
import com.lukouguoji.module_base.bean.FlightBean
import com.lukouguoji.module_base.bean.PacketParseBean
import com.lukouguoji.module_base.http.net.NetApply
import com.lukouguoji.module_base.ktx.commonAdapter
import com.lukouguoji.module_base.ktx.formatDate
import com.lukouguoji.module_base.ktx.getActivity
import com.lukouguoji.module_base.ktx.getLifecycleOwner
import com.lukouguoji.module_base.ktx.launchCollect
import com.lukouguoji.module_base.ktx.noNull
import com.lukouguoji.module_base.ktx.showToast
import com.lukouguoji.module_base.ktx.toJson
import com.lukouguoji.module_base.ktx.toRequestBody
import com.lukouguoji.module_base.util.Common
import com.lukouguoji.module_base.util.DictUtils
import dev.utils.app.info.KeyValue
import okhttp3.MediaType.Companion.toMediaTypeOrNull
import okhttp3.RequestBody.Companion.toRequestBody
import java.util.Calendar
import java.util.Date
class GjjPacketParseViewModel : BasePageViewModel() {
// 航班日期
var flightDate = MutableLiveData(Date().formatDate())
// 航班号
var flightNo = MutableLiveData("")
// 报文类型
var packetType = MutableLiveData("")
// 始发站
var departure = MutableLiveData<String>()
// 报文内容
var packetContent = MutableLiveData<String>()
// 是否可修改
var modifyAble = MutableLiveData(false)
// 修改对应的position
var position = -1
val itemId = R.layout.item_packet_parse
val itemHolder = GjjPacketParseViewHolder::class.java
// 报文类型
val packetTypeList = MutableLiveData<List<KeyValue>>(emptyList())
// 始发站
val departureList = MutableLiveData<List<KeyValue>>(emptyList())
// 航班信息
val flightBean = MutableLiveData<FlightBean>()
// 数量
val count = MutableLiveData(0)
/**
* 初始化
*/
fun init(context: Context) {
DictUtils.getPacketTypeList {
packetTypeList.value = it
}
// 监听修改的内容,并设置到对应的数据中
packetContent.observe(context.getLifecycleOwner()) {
if (!modifyAble.value!!) {
return@observe
}
val adapter = pageModel.rv?.commonAdapter()
if ((adapter?.items?.size ?: 0) <= position) {
return@observe
}
val item = adapter?.getItem(position)
if (position >= 0 && item != null) {
(item as PacketParseBean).text = it
}
}
}
/**
* 获取航班信息
*/
fun getDepartureDictList() {
if (flightNo.value.isNullOrEmpty()) {
return
}
launchCollect({
NetApply.api
.getGjFlightBean(
mapOf(
"fdate" to flightDate.value,
"fno" to flightNo.value,
"ieFlag" to "I",
).toRequestBody()
)
}) {
onSuccess = {
if (it.verifySuccess() && it.data != null) {
flightBean.value = it.data
val list = mutableListOf(
KeyValue(it.data!!.fdep.noNull(), it.data!!.fdep.noNull()),
)
if (!it.data!!.jtz.isNullOrEmpty()) {
list.add(KeyValue(it.data!!.jtz.noNull(), it.data!!.jtz.noNull()))
}
departureList.value = list
} else {
flightBean.value = FlightBean()
departureList.value = emptyList()
showToast(it.msg.noNull("获取航班信息失败"))
}
}
onFailed = { _, _ ->
flightBean.value = FlightBean()
departureList.value = emptyList()
}
}
}
override fun getData() {
if (!verifyHaveFlight()) {
showToast("请输入航班号")
pageModel.finishLoading()
return
}
launchCollect({
NetApply.api
.getGjcPacketParseList(
mapOf(
"fdate" to flightDate.value,
"fno" to flightNo.value,
"msgType" to packetType.value.noNull("ALL"),
).toRequestBody()
)
}) {
onSuccess = {
pageModel.handleDataList(it.data)
count.value = it.data?.size ?: 0
resetContent()
}
}
}
override fun onItemClick(position: Int, type: Int) {
val adapter = pageModel.rv!!.commonAdapter()!!
val bean = adapter.getItem(position) as PacketParseBean
when (type) {
R.id.ll -> {
this.position = position
packetContent.postValue(bean.text.noNull())
modifyAble.postValue(false)
}
R.id.iv_icon -> {
bean.checked.set(!bean.checked.get())
}
else -> {}
}
}
/**
* 航班日期点击
*/
fun onFlightDateClick(view: View) {
Common.onYearMonthDay(
view.context.getActivity(),
flightDate.value!!
) { year, month, day ->
val calendar = Calendar.getInstance()
calendar.set(year, month - 1, day)
flightDate.value = calendar.time.formatDate()
getDepartureDictList()
}
}
/**
* 报文类型点击
*/
fun onPacketTypeSelected(position: Int) {
packetType.value = packetTypeList.value?.get(position)?.value
}
/**
* 始发站点击
*/
fun onDepartureSelected(position: Int) {
departure.value = departureList.value?.get(position)?.value
}
/**
* 搜索点击
*/
fun onSearchClick(view: View) {
refresh()
}
/**
* 列表点击
*/
fun onListClick(view: View) {
GjjManifestListActivity.start(view.context)
}
/**
* 修改点击
*/
fun onModifyClick(view: View) {
modifyAble.value = !modifyAble.value!!
}
/**
* 确认点击
*/
fun onConfirmClick(view: View) {
if (!verifyHaveFlight()) {
showToast("请输入正确航班信息")
return
}
val filter =
pageModel.rv!!.commonAdapter()!!.items.filter { (it as PacketParseBean).checked.get() } as List<PacketParseBean>
if (filter.isEmpty()) {
showToast("请选择需要生成的报文")
return
}
val ffmList = filter.filter { it.msgType == "FFM" }
if (ffmList.isNotEmpty()) {
submitFFM(ffmList)
}
val fwbList = filter.filter { it.msgType == "FWB" || it.msgType == "FHL" }
if (fwbList.isNotEmpty()) {
submitFWB(fwbList)
}
}
/**
* 校验是否有航班信息
*/
private fun verifyHaveFlight() = flightBean.value?.fid?.isEmpty() == false
/**
* 提交FWB报文
*/
private fun submitFWB(fwbList: List<PacketParseBean>) {
val body = fwbList.toJson(false)
.toRequestBody("application/json; charset=utf-8".toMediaTypeOrNull())
launchCollect({
NetApply.api
.gjjPacketParseFWBSubmit(body)
}) {
onSuccess = {
if (it.verifySuccess()) {
showToast(it.msg.noNull("提交成功"))
refresh()
} else {
showToast(it.msg.noNull("提交失败"))
}
}
}
}
/**
* 提交FFM报文
*/
private fun submitFFM(ffmList: List<PacketParseBean>) {
val body = mapOf(
"ffmstrL" to ffmList.map { it.text }.toList(),
"poolIdList" to ffmList.map { it.id }.toList(),
"fid" to flightBean.value?.fid
).toRequestBody()
launchCollect({
NetApply.api
.gjjPacketParseFFMSubmit(body)
}) {
onSuccess = {
if (it.verifySuccess()) {
showToast(it.msg.noNull("提交成功"))
refresh()
} else {
showToast(it.msg.noNull("提交失败"))
}
}
}
}
private fun resetContent() {
modifyAble.postValue(false)
packetContent.postValue("")
position = -1
}
}

View File

@@ -0,0 +1,48 @@
package com.lukouguoji.gjj.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 GjjQueryInfoViewModel : ViewModel() {
private val logName = "GjjQueryInfoViewModel"
var wayBillInfo = JSONObject()
var wbNo: String? = null
/**
* 查询详情
*/
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.searchByIdGjjQuery(param.wbId)
} else if (param.wbNo != null) {
response = UserNetwork.searchByWbNoGjjQuery(param.wbNo)
} else {
}
emit(response)
} catch (e: Exception) {
Log.e(logName, e.stackTraceToString())
}
}
}
fun queryWaybillById(wbId: Int, wbNo: String?) {
wbIdData.value = WaybillParam(wbId, wbNo)
}
}

View File

@@ -0,0 +1,154 @@
package com.lukouguoji.gjj.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.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
class GjjQueryListViewModel : ViewModel() {
private val searchParam = MutableLiveData<JSONObject>()
val searchParamLive = Transformations.switchMap(searchParam) { param ->
liveData(Dispatchers.IO) {
try {
val response = UserNetwork.searchGjjQuery(param)
emit(response)
} catch (e: Exception) {
Log.e("GoutCollectionViewModel", e.stackTraceToString())
}
}
}
fun search(
limit: Int,
page: Int,
carrier: String,//承运人
agentCode: String,//代理人
awbType: String,//运单类型
beginDate: String,
endDate: String,
fdate: String,//航班日期
fno: String,//航班编码
dest: String,//目的港
location: String,//舱位
range: String,
businessType: String,//业务类型
locStatus: String,//是否仓舱单
wbNo: String,
spCode: String, //特码
goods: String //商品名
) {
val param = JSONObject()
param["limit"] = limit
param["page"] = page
param["carrier"] = carrier.emptyToNull()
param["agentCode"] = agentCode.emptyToNull()
param["awbType"] = awbType.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["businessType"] = businessType.emptyToNull()
param["locStatus"] = locStatus.emptyToNull()
param["wbNo"] = wbNo.emptyToNull()
param["spCode"] = spCode.emptyToNull()
param["goods"] = goods.emptyToNull()
searchParam.value = param
}
/**
* 代理人
*/
var agentCodeList = JSONArray()
private val agentCodeLiveData = MutableLiveData<String>()
fun agentCode(time: String) {
agentCodeLiveData.value = time
}
val agentCodeObserver = Transformations.switchMap(agentCodeLiveData) { _ ->
liveData(Dispatchers.IO) {
try {
var response = UserNetwork.agentCodeGjc()
emit(response)
} catch (e: Exception) {
Log.e("GoutStartViewModel", e.stackTraceToString())
}
}
}
/**
* 业务类型
*/
var businessList = JSONArray()
private val businessLiveData = MutableLiveData<String>()
fun business(type: String) {
businessLiveData.value = type
}
val businessObserver = Transformations.switchMap(businessLiveData) { type ->
liveData(Dispatchers.IO) {
try {
var response = UserNetwork.business(type)
emit(response)
} catch (e: Exception) {
Log.e("GoutStartViewModel", e.stackTraceToString())
}
}
}
/**
* 特码
*/
var specialCodeList = JSONArray()
private val specialCodeLiveData = MutableLiveData<String>()
fun specialCode(time: String) {
specialCodeLiveData.value = time
}
val specialCodeObserver = Transformations.switchMap(specialCodeLiveData) { _ ->
liveData(Dispatchers.IO) {
try {
var response = UserNetwork.specialCode()
emit(response)
} catch (e: Exception) {
Log.e("GoutStartViewModel", e.stackTraceToString())
}
}
}
/**
* 运单类型
*/
var awbList = JSONArray()
private val awbLiveData = MutableLiveData<String>()
fun awb(param: String) {
awbLiveData.value = param
}
val awbObserver = Transformations.switchMap(awbLiveData) { param ->
liveData(Dispatchers.IO) {
try {
var response = UserNetwork.awb(param)
emit(response)
} catch (e: Exception) {
Log.e("GoutStartViewModel", e.stackTraceToString())
}
}
}
}

View File

@@ -0,0 +1,345 @@
package com.lukouguoji.gjj.viewModel
import android.app.Activity
import android.content.Context
import android.content.Intent
import android.view.View
import androidx.lifecycle.MutableLiveData
import com.lukouguoji.gjj.R
import com.lukouguoji.gjj.holder.TallyAddListViewHolder
import com.lukouguoji.gjj.model.GjjTallyAddSelectDialogModel
import com.lukouguoji.gjj.model.TallyBatchDialogModel
import com.lukouguoji.module_base.base.BasePageViewModel
import com.lukouguoji.module_base.bean.FlatcarBean
import com.lukouguoji.module_base.bean.GjjHandoverRecordBean
import com.lukouguoji.module_base.bean.GjjTallyAddBean
import com.lukouguoji.module_base.bean.GjjTallyBean
import com.lukouguoji.module_base.common.Constant
import com.lukouguoji.module_base.http.net.NetApply
import com.lukouguoji.module_base.ktx.commonAdapter
import com.lukouguoji.module_base.ktx.finish
import com.lukouguoji.module_base.ktx.getActivity
import com.lukouguoji.module_base.ktx.launchCollect
import com.lukouguoji.module_base.ktx.loge
import com.lukouguoji.module_base.ktx.noNull
import com.lukouguoji.module_base.ktx.showToast
import com.lukouguoji.module_base.ktx.toJson
import com.lukouguoji.module_base.ktx.toMap
import com.lukouguoji.module_base.ktx.toRequestBody
import com.lukouguoji.module_base.model.ScanModel
import com.lukouguoji.module_base.util.CheckUtil
import com.lukouguoji.module_base.util.Common
import dev.DevUtils
import dev.utils.common.NumberUtils
class GjjTallyAddViewModel : BasePageViewModel() {
var tallyBean: GjjTallyBean? = null
// 平板车或ULD
val plateOrUld = MutableLiveData<String>()
// 平板车信息
val flatcarBean = MutableLiveData<FlatcarBean>()
// 运单号或件号
val waybillOrPiece = MutableLiveData<String>()
val itemId = R.layout.item_tally_add
val itemHolder = TallyAddListViewHolder::class.java
private var isBatch = "1"
override fun getData() {
// 记录数据存在,则获取详情
tallyBean?.let {
showLoading()
launchCollect({
NetApply.api
.getGjjTallyDetail(it.mfId.noNull())
}) {
onSuccess = { result ->
if (result.verifySuccess() && !result.data.isNullOrEmpty()) {
val first = result.data!!.first()
val hashMapOf = hashMapOf<String, Any?>()
isBatch = first.isBatch.noNull("1")
first.initJianList()
hashMapOf.putAll(it.toMap())
hashMapOf.putAll(first.toMap())
val recordBean = NetApply.gson.fromJson(
hashMapOf.toJson(false),
GjjHandoverRecordBean::class.java
)
val addBean = GjjTallyAddBean(recordBean)
addBean.jianList.addAll(first.jianList)
pageModel.rv!!.commonAdapter()!!
.refresh(listOf(addBean))
plateOrUld.value = first.carID
flatcarBean.value = FlatcarBean().apply {
carId = first.carID.noNull()
}
} else {
showToast(result.msg.noNull("获取理货信息失败"))
}
}
onComplete = {
dismissLoading()
}
}
}
}
override fun onItemClick(position: Int, type: Int) {
val adapter = pageModel.rv!!.commonAdapter()!!
val list = adapter.items as List<GjjTallyAddBean>
val bean = list[position]
when (type) {
R.id.iv_show -> {
CheckUtil.handleSingleCheck(list, "show", position, true)
}
// 分批
R.id.tv_batch -> {
TallyBatchDialogModel(bean.handoverRecordBean) {
isBatch = "0"
adapter.notifyItemChanged(position)
}.show()
}
// 删除
R.id.tv_delete_order -> {
Common.secondConfirmDialog(
DevUtils.getTopActivity(),
"是否确认删除该条信息?"
) { dialog ->
adapter.removeItem(position)
dialog.dismiss()
}
}
// 删件
R.id.tv_delete_matter -> {
if (bean.jianList.none { it.checked.get() }) {
showToast("请先选择要删除的件号")
return
}
Common.secondConfirmDialog(
DevUtils.getTopActivity(),
"是否确认删除选中件号?"
) { dialog ->
bean.jianList.removeIf { it.checked.get() }
adapter.notifyItemChanged(position)
dialog.dismiss()
}
}
else -> {}
}
}
/**
* 平板 扫描 点击
*/
fun onPlateClick(view: View) {
ScanModel.startScan(view.context.getActivity(), Constant.RequestCode.CAR)
}
/**
* 运单或件号 扫描 点击
*/
fun onWaybillOrPieceClick(view: View) {
ScanModel.startScan(view.context.getActivity(), Constant.RequestCode.WAYBILL)
}
/**
* 确认点击
*/
fun confirmClick(view: View) {
val adapter = pageModel.rv!!.commonAdapter()!!
val count = adapter.itemCount
if (flatcarBean.value == null) {
showToast("请先扫描平板车")
return
}
if (count <= 0) {
showToast("请先添加运单信息")
return
}
val bean = adapter.items.first() as GjjTallyAddBean
val jianListStr = bean.jianList.joinToString(",") { it.value }
showLoading()
launchCollect({
val requestBody = mapOf(
"carID" to flatcarBean.value!!.carId,
"isBatch" to isBatch,
"list" to jianListStr,
"mfId" to bean.handoverRecordBean.mfId,
"no" to bean.handoverRecordBean.no,
"organizationcode" to bean.handoverRecordBean.organizationCode,
"pc" to bean.handoverRecordBean.pc,
"prefix" to bean.handoverRecordBean.prefix,
"weight" to bean.handoverRecordBean.weight,
"pcID" to bean.handoverRecordBean.pcID,
).toRequestBody()
if (tallyBean == null) {
NetApply.api.gjjTallyConfirm(requestBody)
} else {
NetApply.api.gjjTallyUpdate(requestBody)
}
}) {
onSuccess = {
dismissLoading()
if (it.verifySuccess()) {
showToast("确认成功")
view.context.finish()
} else {
showToast(it.msg.noNull("确认失败"))
}
}
onComplete = {
dismissLoading()
}
}
}
/**
* 取消点击
*/
fun cancelClick(view: View) {
view.context.finish()
}
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
if (resultCode == Activity.RESULT_OK && data != null) {
when (requestCode) {
Constant.RequestCode.CAR -> {
val id = data.getStringExtra(Constant.Result.CODED_CONTENT).noNull()
plateOrUld.value = id
onPbcOrUldChange(false)
}
Constant.RequestCode.WAYBILL -> {
val id = data.getStringExtra(Constant.Result.CODED_CONTENT).noNull()
waybillOrPiece.value = id
onWaybillOrPieceChange(false)
}
else -> {}
}
}
}
/**
* 获取运单信息
* @param waybillCode 运单号
* @param jianCode 件号
*/
private fun addWaybillInfo(waybillCode: String, jianCode: String = "") {
val adapter = pageModel.rv!!.commonAdapter()!!
if (adapter.itemCount > 0) {
val bean = adapter.items.first() as GjjTallyAddBean
if (bean.handoverRecordBean.getWaybillCode() == waybillCode) {
bean.addJian(jianCode)
} else {
showToast("请先完成当前运单信息")
}
return
}
launchCollect({
NetApply.api.getGjjTallyHandoverList(
mapOf(
"prefix" to waybillCode.substring(0, 3),
"no" to waybillCode.substring(3),
).toRequestBody()
)
}) {
onSuccess = {
if (it.verifySuccess() && !it.data.isNullOrEmpty()) {
if (it.data!!.size == 1) {
val bean = it.data!!.first()
val addBean = GjjTallyAddBean(bean)
if (jianCode.isNotEmpty()) {
addBean.addJian(jianCode)
}
adapter.addItem(addBean)
} else {
showSelectDialog(DevUtils.getTopActivity(), it.data!!, jianCode)
}
} else {
showToast(it.msg.noNull("获取运单信息失败"))
}
}
}
}
/**
* 展示选择弹窗
* 仅用于选择返回
*/
private fun showSelectDialog(
context: Context,
list: List<GjjHandoverRecordBean>,
jianCode: String = ""
) {
val adapter = pageModel.rv!!.commonAdapter()!!
loge("展示选择弹窗 : ${list.size}")
GjjTallyAddSelectDialogModel(list) { bean ->
val addBean = GjjTallyAddBean(bean)
if (jianCode.isNotEmpty()) {
addBean.addJian(jianCode)
}
adapter.addItem(addBean)
}.show(context)
}
/**
* 获取平板车数据
*/
private fun getFlatcarInfo(id: String) {
if (id.isEmpty()) {
return
}
launchCollect({
NetApply.api
.getFlatcarInfo(id)
}) {
onSuccess = {
if (it.verifySuccess() && it.data != null) {
flatcarBean.value = it.data
} else {
showToast(it.msg.noNull("获取平板车信息失败"))
}
}
}
}
fun onPbcOrUldChange(focused: Boolean = false) {
if (focused) {
return
}
getFlatcarInfo(plateOrUld.value.noNull())
}
fun onWaybillOrPieceChange(focused: Boolean = false) {
if (focused) {
return
}
val code = waybillOrPiece.value.noNull()
if (NumberUtils.isNumber(code)) {
// 运单号
if (code.length == 11) {
addWaybillInfo(code)
}
// 运单号 + 件号
else if (code.length == 16) {
addWaybillInfo(code.substring(0, 11), code.substring(11))
}
}
}
}

View File

@@ -0,0 +1,59 @@
package com.lukouguoji.gjj.viewModel
import androidx.lifecycle.MutableLiveData
import com.lukouguoji.gjj.R
import com.lukouguoji.gjj.holder.GjjTallyDetailsViewHolder
import com.lukouguoji.module_base.base.BasePageViewModel
import com.lukouguoji.module_base.bean.GjjTallyDetailsBean
import com.lukouguoji.module_base.http.net.NetApply
import com.lukouguoji.module_base.ktx.launchCollect
import com.lukouguoji.module_base.ktx.limit
class GjjTallyDetailsViewModel : BasePageViewModel() {
// 主单id
var mfId: String = ""
// 运单号
var waybillNo: String = ""
val itemId = R.layout.item_tally_details
val itemHolder = GjjTallyDetailsViewHolder::class.java
// 描述
val desc = MutableLiveData("")
override fun getData() {
showLoading()
launchCollect({
NetApply.api
.getGjjTallyDetail(mfId)
}) {
onSuccess = {
it.data?.forEach { b -> b.initJianList() }
pageModel.handleDataList(it.data)
generateDesc(it.data)
}
onComplete = {
dismissLoading()
}
}
}
private fun generateDesc(list: List<GjjTallyDetailsBean>?) {
if (list.isNullOrEmpty()) {
desc.value = "合计0票件数0重量0KG"
return
}
val total = list.size
var totalJ = 0
var totalW = 0.0
list.forEach {
totalJ += it.jianList.size
totalW += it.weight?.toDouble() ?: 0.0
}
desc.value = "合计:${total}票,件数:${totalJ},重量:${totalW.limit()}KG"
}
}

View File

@@ -0,0 +1,318 @@
package com.lukouguoji.gjj.viewModel
import android.app.Activity
import android.content.Intent
import android.view.View
import androidx.lifecycle.MutableLiveData
import com.lukouguoji.gjj.R
import com.lukouguoji.gjj.activity.GjjTallyDetailsActivity
import com.lukouguoji.gjj.activity.GjjTallyAddActivity
import com.lukouguoji.gjj.holder.GjjTallyListViewHolder
import com.lukouguoji.module_base.base.BasePageViewModel
import com.lukouguoji.module_base.bean.GjjTallyBean
import com.lukouguoji.module_base.common.Constant
import com.lukouguoji.module_base.http.net.NetApply
import com.lukouguoji.module_base.interfaces.ICheck
import com.lukouguoji.module_base.ktx.commonAdapter
import com.lukouguoji.module_base.ktx.formatDate
import com.lukouguoji.module_base.ktx.getActivity
import com.lukouguoji.module_base.ktx.launchCollect
import com.lukouguoji.module_base.ktx.limit
import com.lukouguoji.module_base.ktx.noNull
import com.lukouguoji.module_base.ktx.showToast
import com.lukouguoji.module_base.ktx.toRequestBody
import com.lukouguoji.module_base.model.ScanModel
import com.lukouguoji.module_base.util.CheckUtil
import com.lukouguoji.module_base.util.Common
import com.lukouguoji.module_base.util.DictUtils
import dev.DevUtils
import dev.utils.app.info.KeyValue
import java.util.Calendar
import java.util.Date
class GjjTallyViewModel : BasePageViewModel() {
// 航班日期
val flightDate = MutableLiveData(Date().formatDate())
// 航班号
val flightNo = MutableLiveData<String>()
// 代理
private val agent = MutableLiveData("")
// 运单号
val waybillNo = MutableLiveData<String>()
// 理货状态
private val tallyStatus = MutableLiveData("0")
// 代理列表
val agentList = MutableLiveData(emptyList<KeyValue>())
// 理货状态
val tallyStatusList = DictUtils.tallyStatusList
val itemId = R.layout.item_gjj_tally
val itemHolder = GjjTallyListViewHolder::class.java
val desc = MutableLiveData("合计0票件数0重量0KG")
init {
// 获取代理列表
DictUtils.getAgentList {
agentList.postValue(it)
}
}
override fun getData() {
launchCollect({
NetApply.api.getGjjTallyList(
mapOf(
"fdate" to flightDate.value,
"fno" to flightNo.value,
"agent" to agent.value,
"wbNo" to waybillNo.value,
"ref" to tallyStatus.value,
).toRequestBody()
)
}) {
onSuccess = {
if (it.verifySuccess()) {
pageModel.handleDataList(it.data)
generateDesc(it.data)
} else {
showToast(it.msg.noNull("获取数据失败"))
}
}
onComplete = {
pageModel.finishLoading()
}
}
}
/**
* 条目点击事件
*/
override fun onItemClick(position: Int, type: Int) {
val bean = (pageModel.rv!!.commonAdapter()!!.getItem(position) ?: return) as GjjTallyBean
when (type) {
// 图标选中状态
R.id.iv_icon -> {
if (bean.canTally()) {
bean.checked.set(!bean.checked.get())
}
}
// 详情
R.id.tv_details -> {
GjjTallyDetailsActivity.start(
DevUtils.getTopActivity(),
bean.mfId.noNull(),
bean.getWaybillNo()
)
}
// 修改
R.id.tv_modify -> {
GjjTallyAddActivity.start(DevUtils.getTopActivity(), bean)
}
// 删除
R.id.tv_delete -> {
Common.secondConfirmDialog(
DevUtils.getTopActivity(),
"是否确认删除该条信息?"
) { dialog ->
dialog.dismiss()
onDeleteItem(bean)
}
}
else -> {
showToast("未知点击类型")
}
}
}
/**
* 航班日期点击
*/
fun onFlightDateClick(view: View) {
Common.onYearMonthDay(
view.context.getActivity(),
flightDate.value!!
) { year, month, day ->
val calendar = Calendar.getInstance()
calendar.set(year, month - 1, day)
flightDate.value = calendar.time.formatDate()
}
}
/**
* 代理点击
*/
fun onAgentSelected(position: Int) {
agent.value = agentList.value?.get(position)?.value
}
/**
* 理货状态 选中
*/
fun onTallyStatusSelected(position: Int) {
tallyStatus.value = tallyStatusList[position].value
}
/**
* 运单号扫描点击
*/
fun onWaybillNoScanClick(view: View) {
ScanModel.startScan(view.context.getActivity(), Constant.RequestCode.WAYBILL)
}
/**
* 全选点击
*/
fun onAllClick(view: View) {
pageModel.rv?.commonAdapter()?.items?.let {
CheckUtil.handleAllCheck(it as List<ICheck>)
}
}
/**
* 删除点击
*/
fun onDeleteClick(view: View) {
pageModel.rv?.commonAdapter()?.items?.let {
val checkedList = (it as List<GjjTallyBean>)
.filter { b -> b.checked.get() }
.toList()
if (checkedList.isEmpty()) {
showToast("请选择要删除的条目")
} else {
showLoading()
launchCollect({
NetApply.api.gjjTallyDeleteList(checkedList.map { it.mfId.noNull() }
.toRequestBody())
}) {
onSuccess = {
if (it.verifySuccess()) {
showToast(it.msg.noNull("删除成功"))
refresh()
} else {
showToast(it.msg.noNull("删除失败"))
}
}
onComplete = {
dismissLoading()
}
}
}
}
}
/**
* 搜索点击
*/
fun onSearchClick(view: View) {
refresh()
}
/**
* 添加点击
*/
fun onAddClick(view: View) {
GjjTallyAddActivity.start(view.context)
}
/**
* 货物发放点击
*/
fun onGoodsSendClick(view: View) {
pageModel.rv?.commonAdapter()?.items?.let {
val checkedList = (it as List<GjjTallyBean>)
.filter { b -> b.checked.get() }
.toList()
if (checkedList.isEmpty()) {
showToast("请选择要发放的数据")
} else if ((checkedList.filter { b -> b.fid == checkedList.first().fid }).size != checkedList.size) {
showToast("请选择同一航班的数据")
} else {
showLoading()
launchCollect({
NetApply.api.gjjTallyHandover(
mapOf(
"fid" to checkedList.first().fid,
"ids" to checkedList.map { b -> b.mfId },
).toRequestBody()
)
}) {
onSuccess = {
if (it.verifySuccess()) {
showToast(it.msg.noNull("发放成功"))
refresh()
} else {
showToast(it.msg.noNull("发放失败"))
}
}
onComplete = {
dismissLoading()
}
}
}
}
}
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
if (resultCode == Activity.RESULT_OK && data != null) {
when (requestCode) {
Constant.RequestCode.WAYBILL -> {
waybillNo.value =
data.getStringExtra(Constant.Result.CODED_CONTENT).noNull()
}
else -> {}
}
}
}
/**
* 删除条目
*/
private fun onDeleteItem(bean: GjjTallyBean) {
showLoading()
launchCollect({
NetApply.api.gjjTallyDelete(bean.mfId.noNull())
}) {
onSuccess = {
if (it.verifySuccess()) {
showToast(it.msg.noNull("删除成功"))
refresh()
} else {
showToast(it.msg.noNull("删除失败"))
}
}
onComplete = {
dismissLoading()
}
}
}
private fun generateDesc(list: List<GjjTallyBean>?) {
if (list.isNullOrEmpty()) {
desc.value = "合计0票件数0重量0KG"
return
}
val total = list.size
var totalJ = 0
var totalW = 0.0
list.forEach {
totalJ += it.pc.noNull("0").toInt()
totalW += it.weight?.toDouble() ?: 0.0
}
desc.value = "合计:${total}票,件数:${totalJ},重量:${totalW.limit()}KG"
}
}

View File

@@ -0,0 +1,42 @@
package com.lukouguoji.gjj.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 GjjWareHouseInfoViewModel : ViewModel() {
private val logName = "GjjWareHouseInfoViewModel"
var wayBillInfo = JSONObject()
/**
* 查询详情
*/
private val queryInfoByIdWareHouseLiveData = MutableLiveData<Int>()
val queryInfoByIdWareHouseObserver = Transformations.switchMap(queryInfoByIdWareHouseLiveData) { param ->
liveData(Dispatchers.IO) {
try {
var response = JSONObject()
if (param != -9999) {
response = UserNetwork.queryInfoByIdGjjCangKu(param)
}
emit(response)
} catch (e: Exception) {
Log.e(logName, e.stackTraceToString())
}
}
}
fun queryInfoByIdWareHouse(wbId: Int) {
queryInfoByIdWareHouseLiveData.value = wbId
}
}

View File

@@ -0,0 +1,130 @@
package com.lukouguoji.gjj.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.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
class GjjWareHouseListViewModel : ViewModel() {
private val logName = "GjjWareHouseListViewModel"
/**
* 分页搜索
*/
private val searchParam = MutableLiveData<JSONObject>()
val searchParamLive = Transformations.switchMap(searchParam) { param ->
liveData(Dispatchers.IO) {
try {
val response = UserNetwork.searchGjjCangKu(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,//航班编码
fdep: String,//上一个港
dest: String,//目的港
businessType: String,//业务类型
range: String,
status: String,
wbNo: String,
groupName: String,
agentCode: String,
location: 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["fdep"] = fdep.emptyToNull()
param["dest"] = dest.emptyToNull()
param["fno"] = fno.emptyToNull()
param["businessType"] = businessType.emptyToNull()
param["range"] = range.emptyToNull()
param["locStatus"] = status.emptyToNull()
param["wbNo"] = wbNo.emptyToNull()
param["groupName"] = groupName.emptyToNull()
param["agentCode"] = agentCode.emptyToNull()
param["agentCode"] = agentCode.emptyToNull()
param["location"] = location.emptyToNull()
searchParam.value = param
}
/**
* 数据汇总
*/
val summaryObserver = Transformations.switchMap(searchParam) { param ->
liveData(Dispatchers.IO) {
try {
val response = UserNetwork.totalGjjCangKu(param)
emit(response)
} catch (e: Exception) {
Log.e(logName, e.stackTraceToString())
}
}
}
/**
* 代理人
*/
var agentCodeList = JSONArray()
private val agentCodeLiveData = MutableLiveData<String>()
fun agentCode(time: String) {
agentCodeLiveData.value = time
}
val agentCodeObserver = Transformations.switchMap(agentCodeLiveData) { _ ->
liveData(Dispatchers.IO) {
try {
var response = UserNetwork.agentCodeGjj()
emit(response)
} catch (e: Exception) {
Log.e(logName, e.stackTraceToString())
}
}
}
/**
* 业务类型
*/
var businessList = JSONArray()
private val businessLiveData = MutableLiveData<String>()
fun business(type: String) {
businessLiveData.value = type
}
val businessObserver = Transformations.switchMap(businessLiveData) { type ->
liveData(Dispatchers.IO) {
try {
var response = UserNetwork.business(type)
emit(response)
} catch (e: Exception) {
Log.e(logName, e.stackTraceToString())
}
}
}
}

View File

@@ -0,0 +1,99 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.lukouguoji.gjj">
<application>
<activity
android:name=".activity.GjjGoodsAddActivity"
android:configChanges="orientation|keyboardHidden"
android:exported="false"
android:screenOrientation="userLandscape" />
<activity
android:name=".activity.GjjGoodsManifestActivity"
android:configChanges="orientation|keyboardHidden"
android:exported="false"
android:screenOrientation="userLandscape" />
<activity
android:name=".activity.GjjTallyDetailsActivity"
android:configChanges="orientation|keyboardHidden"
android:exported="false"
android:screenOrientation="userLandscape" />
<activity
android:name=".activity.GjjTallyAddActivity"
android:configChanges="orientation|keyboardHidden"
android:exported="false"
android:screenOrientation="userLandscape" />
<activity
android:name=".activity.GjjManifestAddActivity"
android:configChanges="orientation|keyboardHidden"
android:exported="false"
android:screenOrientation="userLandscape" />
<activity
android:name=".activity.GjjManifestDetailsActivity"
android:configChanges="orientation|keyboardHidden"
android:exported="false"
android:screenOrientation="userLandscape" />
<activity
android:name=".activity.GjjPacketParseActivity"
android:configChanges="orientation|keyboardHidden"
android:exported="false"
android:screenOrientation="userLandscape"
android:windowSoftInputMode="adjustPan" />
<activity
android:name=".activity.GjjGoodsListActivity"
android:configChanges="orientation|keyboardHidden"
android:exported="false"
android:screenOrientation="userLandscape" />
<activity
android:name=".activity.GjjTallyListActivity"
android:configChanges="orientation|keyboardHidden"
android:exported="false"
android:screenOrientation="userLandscape" />
<activity
android:name=".activity.GjjManifestListActivity"
android:configChanges="orientation|keyboardHidden"
android:exported="false"
android:screenOrientation="userLandscape" />
<activity
android:name=".activity.GjjQueryInfoActivity"
android:configChanges="orientation|keyboardHidden"
android:exported="false"
android:screenOrientation="userLandscape" />
<activity
android:name=".activity.GjjQueryListActivity"
android:configChanges="orientation|keyboardHidden"
android:exported="false"
android:screenOrientation="userLandscape" />
<activity
android:name=".activity.GjjChuKuListActivity"
android:configChanges="orientation|keyboardHidden"
android:exported="false"
android:screenOrientation="userLandscape" />
<activity
android:name=".activity.GjjWareHouseInfoActivity"
android:configChanges="orientation|keyboardHidden"
android:exported="false"
android:screenOrientation="userLandscape" />
<activity
android:name=".activity.GjjWareHouseActivity"
android:configChanges="orientation|keyboardHidden"
android:exported="false"
android:screenOrientation="userLandscape" />
<activity
android:name=".activity.GjjCangDanInfoActivity"
android:configChanges="orientation|keyboardHidden"
android:exported="false"
android:screenOrientation="userLandscape" />
<activity
android:name=".activity.GjjCangDanListActivity"
android:configChanges="orientation|keyboardHidden"
android:exported="false"
android:screenOrientation="userLandscape" />
<activity
android:name=".MainActivity"
android:configChanges="orientation|keyboardHidden"
android:exported="true"
android:screenOrientation="userLandscape" />
</application>
</manifest>

View File

@@ -0,0 +1,30 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:aapt="http://schemas.android.com/aapt"
android:width="108dp"
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108">
<path android:pathData="M31,63.928c0,0 6.4,-11 12.1,-13.1c7.2,-2.6 26,-1.4 26,-1.4l38.1,38.1L107,108.928l-32,-1L31,63.928z">
<aapt:attr name="android:fillColor">
<gradient
android:endX="85.84757"
android:endY="92.4963"
android:startX="42.9492"
android:startY="49.59793"
android:type="linear">
<item
android:color="#44000000"
android:offset="0.0" />
<item
android:color="#00000000"
android:offset="1.0" />
</gradient>
</aapt:attr>
</path>
<path
android:fillColor="#FFFFFF"
android:fillType="nonZero"
android:pathData="M65.3,45.828l3.8,-6.6c0.2,-0.4 0.1,-0.9 -0.3,-1.1c-0.4,-0.2 -0.9,-0.1 -1.1,0.3l-3.9,6.7c-6.3,-2.8 -13.4,-2.8 -19.7,0l-3.9,-6.7c-0.2,-0.4 -0.7,-0.5 -1.1,-0.3C38.8,38.328 38.7,38.828 38.9,39.228l3.8,6.6C36.2,49.428 31.7,56.028 31,63.928h46C76.3,56.028 71.8,49.428 65.3,45.828zM43.4,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2c-0.3,-0.7 -0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C45.3,56.528 44.5,57.328 43.4,57.328L43.4,57.328zM64.6,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2s-0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C66.5,56.528 65.6,57.328 64.6,57.328L64.6,57.328z"
android:strokeWidth="1"
android:strokeColor="#00000000" />
</vector>

View File

@@ -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="@color/list_bg" />
<corners android:radius="7dp" />
</shape>

View File

@@ -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>

View File

@@ -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>

View File

@@ -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>

View 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>

View 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>

View File

@@ -0,0 +1,262 @@
<?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.GjjCangDanInfoActivity">
<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_margin="5dp"
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:background="@drawable/gjj_cang_dan_info_content_shape"
android:orientation="vertical"
android:padding="10dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="收货人信息(个人短信必须填此信息)"
android:textColor="@color/gjj_cang_dan_green" />
<!-- 收货人填写区-->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="30dp"
android:layout_gravity="center_vertical"
android:layout_marginTop="10dp"
android:gravity="center_vertical">
<!-- 收货人-->
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:layout_width="50dp"
android:layout_height="match_parent"
android:gravity="center_vertical"
android:text="收货人" />
<EditText
android:id="@+id/receive"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginLeft="2dp"
android:layout_weight="1"
android:background="@drawable/gjj_cang_dan_info_edit_shape"
android:imeOptions="actionDone"
android:inputType="text"
android:maxLines="1"
android:paddingLeft="5dp"
android:singleLine="true"
android:text=""
/>
</LinearLayout>
<!-- 空格-->
<LinearLayout
android:layout_width="20dp"
android:layout_height="match_parent" />
<!-- 身份证-->
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="2"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:layout_width="50dp"
android:layout_height="match_parent"
android:gravity="center_vertical"
android:text="身份证" />
<EditText
android:id="@+id/cardNo"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginLeft="2dp"
android:layout_weight="1"
android:background="@drawable/gjj_cang_dan_info_edit_shape"
android:imeOptions="actionDone"
android:inputType="text"
android:maxLines="1"
android:paddingLeft="5dp"
android:singleLine="true"
android:text=""
/>
</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.5"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:layout_width="50dp"
android:layout_height="match_parent"
android:gravity="center_vertical"
android:text="电话" />
<EditText
android:id="@+id/telPhone"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginLeft="2dp"
android:layout_weight="1"
android:background="@drawable/gjj_cang_dan_info_edit_shape"
android:imeOptions="actionDone"
android:inputType="number"
android:maxLines="1"
android:paddingLeft="5dp"
android:singleLine="true"
android:text=""
/>
</LinearLayout>
</LinearLayout>
</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>

View File

@@ -0,0 +1,390 @@
<?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"
tools:context=".activity.GjjCangDanListActivity"
android:orientation="vertical"
tools:ignore="ResourceName">
<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: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_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="20dp"
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="20dp"
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/fdep"
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>
<!-- 横线-->
<View
android:layout_width="10dp"
android:layout_height="1px"
android:layout_gravity="center"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:background="@color/black" />
<!-- 目的港-->
<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="20dp"
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"
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"
android:enabled="false"/>
<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"
android:enabled="false"/>
</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: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="10dp"
android:layout_height="match_parent" />
</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">
<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/gjj_add" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:gravity="center|start"
android:text="全选"/>
<ImageView
android:id="@+id/checkIcon"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_marginLeft="2dp"
android:src="@mipmap/img_all_check" />
<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/gjj_cang_dan_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
android:id="@+id/totalLayout"
android:layout_width="match_parent"
android:layout_height="50dp"
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="20dp"
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="20dp"
android:background="@drawable/gjj_cang_dan_list_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>

View File

@@ -0,0 +1,552 @@
<?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.GjjChuKuListActivity">
<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/startDate"
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>
<!-- 横线-->
<View
android:layout_width="10dp"
android:layout_height="1px"
android:layout_gravity="center"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:background="@color/black" />
<!--提取结束时间-->
<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">
<EditText
android:id="@+id/wbNo"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/input_edit_text"
android:gravity="center"
android:hint="请输入运单后4位"
android:imeOptions="actionDone"
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"
android:orientation="horizontal">
<EditText
android:id="@+id/pickNo"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@drawable/input_edit_text"
android:gravity="center"
android:hint="请输入提货单号"
android:imeOptions="actionDone"
android:inputType="text"
android:singleLine="true"
android:textSize="15dp" />
<ImageView
android:id="@+id/scanIcon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:src="@mipmap/scan_code"
app:tint="@color/weak_grey" />
</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: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: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="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:src="@mipmap/img_all_check" />
<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/gjj_cang_dan_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="50dp"
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="20dp"
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="20dp"
android:background="@drawable/gjj_cang_dan_list_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>
<!-- 筛选 页-->
<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">
<TextView
android:id="@+id/agentCode"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginLeft="2dp"
android:layout_weight="1"
android:gravity="center|start"
android:hint="请选择代理人"
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>

View File

@@ -0,0 +1,214 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">
<data>
<variable
name="viewModel"
type="com.lukouguoji.gjj.viewModel.GjjGoodsAddViewModel" />
</data>
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/color_f2"
android:orientation="vertical"
tools:context=".activity.GjjGoodsAddActivity">
<include layout="@layout/title_tool_bar" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_marginHorizontal="15dp"
android:layout_marginTop="10dp"
android:gravity="center"
android:orientation="horizontal">
<LinearLayout
style="@style/ll_search"
android:onClick="@{viewModel::onFlightDateClick}">
<TextView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@drawable/input_edit_text"
android:gravity="center"
android:hint="请选择航班日期"
android:imeOptions="actionDone"
android:inputType="text"
android:singleLine="true"
android:text="@{viewModel.flightDate}"
android:textSize="15dp" />
<ImageView
android:id="@+id/wbNoScanIcon"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_gravity="center"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:src="@mipmap/img_date" />
</LinearLayout>
<LinearLayout
style="@style/ll_search"
android:layout_marginLeft="20dp">
<EditText
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@drawable/input_edit_text"
android:gravity="center"
android:hint="请输入航班号"
android:imeOptions="actionDone"
android:inputType="text"
android:singleLine="true"
android:text="@={viewModel.flightNo}"
android:textSize="15dp" />
</LinearLayout>
<LinearLayout
style="@style/ll_search"
android:layout_marginLeft="20dp">
<androidx.appcompat.widget.AppCompatSpinner
items="@{viewModel.agentList}"
onSelected="@{viewModel::onAgentSelected}"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
<LinearLayout
style="@style/ll_search"
android:layout_marginLeft="20dp">
<EditText
android:id="@+id/et_car"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@drawable/input_edit_text"
android:gravity="center"
android:hint="请输入运单号"
android:imeOptions="actionDone"
android:inputType="text"
android:singleLine="true"
android:text="@={viewModel.waybillNo}"
android:textSize="15dp" />
<ImageView
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_gravity="center"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:onClick="@{viewModel::onWaybillNoScanClick}"
android:src="@mipmap/scan_code" />
</LinearLayout>
<!-- 搜索图标-->
<LinearLayout
android:id="@+id/ll_search"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_marginLeft="20dp"
android:background="@drawable/search_shape_gnc_ware_house2"
android:onClick="@{viewModel::onSearchClick}"
android:padding="10dp">
<ImageView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:src="@drawable/search"
app:tint="@color/colorPrimary" />
</LinearLayout>
<View
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_weight="1" />
</LinearLayout>
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:paddingTop="10dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="15dp"
android:onClick="@{viewModel::onAllClick}"
android:text="全选" />
<ImageView
android:id="@+id/checkIcon"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_marginLeft="5dp"
android:onClick="@{viewModel::onAllClick}"
android:src="@drawable/img_check_all" />
</androidx.appcompat.widget.LinearLayoutCompat>
<com.scwang.smart.refresh.layout.SmartRefreshLayout
android:id="@+id/srl"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginTop="10dp"
android:layout_weight="1">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv"
itemLayoutId="@{viewModel.itemLayoutId}"
viewHolder="@{viewModel.itemViewHolder}"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
tools:listitem="@layout/item_gjj_goods_add" />
</com.scwang.smart.refresh.layout.SmartRefreshLayout>
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="50dp"
android:background="#5c6890"
android:gravity="center_vertical"
android:paddingHorizontal="15dp">
<TextView
android:id="@+id/tv_total"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@{viewModel.desc}"
android:textColor="@color/white"
android:textSize="16sp"
android:textStyle="bold" />
<View
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_weight="1" />
<TextView
style="@style/tv_bottom_btn"
android:onClick="@{viewModel::onConfirmClick}"
android:text="确认交接" />
</androidx.appcompat.widget.LinearLayoutCompat>
</androidx.appcompat.widget.LinearLayoutCompat>
</layout>

View File

@@ -0,0 +1,209 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">
<data>
<variable
name="viewModel"
type="com.lukouguoji.gjj.viewModel.GjjGoodsListViewModel" />
</data>
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/color_f2"
android:orientation="vertical"
tools:context=".activity.GjjGoodsListActivity">
<include layout="@layout/title_tool_bar" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_marginHorizontal="15dp"
android:layout_marginTop="10dp"
android:gravity="center"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="交接时间:"
android:textColor="#333"
android:textSize="16sp" />
<LinearLayout
style="@style/ll_search"
android:onClick="@{viewModel::startDateSelect}">
<TextView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@drawable/input_edit_text"
android:gravity="center"
android:hint="请选择交接日期"
android:imeOptions="actionDone"
android:singleLine="true"
android:text="@{viewModel.startDate}"
android:textSize="15dp" />
<ImageView
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_gravity="center"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:src="@mipmap/img_date" />
</LinearLayout>
<View
android:layout_width="20dp"
android:layout_height="1dp"
android:layout_marginHorizontal="8dp"
android:background="#999" />
<LinearLayout
style="@style/ll_search"
android:layout_marginLeft="20dp"
android:onClick="@{viewModel::endDateSelect}">
<TextView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@drawable/input_edit_text"
android:gravity="center"
android:hint="请选择交接日期"
android:imeOptions="actionDone"
android:singleLine="true"
android:text="@{viewModel.endDate}"
android:textSize="15dp" />
<ImageView
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_gravity="center"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:src="@mipmap/img_date" />
</LinearLayout>
<LinearLayout
style="@style/ll_search"
android:layout_marginLeft="20dp">
<EditText
android:id="@+id/et_car"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@drawable/input_edit_text"
android:gravity="center"
android:hint="请输入交接单号"
android:imeOptions="actionDone"
android:inputType="text"
android:singleLine="true"
android:text="@={viewModel.handoverNo}"
android:textSize="15dp" />
<ImageView
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_gravity="center"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:onClick="@{viewModel::handoverNoScan}"
android:src="@mipmap/scan_code" />
</LinearLayout>
<LinearLayout
style="@style/ll_search"
android:layout_marginLeft="20dp">
<androidx.appcompat.widget.AppCompatSpinner
items="@{viewModel.agentList}"
onSelected="@{viewModel::agentSelected}"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
<!-- 搜索图标-->
<LinearLayout
android:id="@+id/ll_search"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_marginLeft="20dp"
android:background="@drawable/search_shape_gnc_ware_house2"
android:onClick="@{viewModel::searchClick}"
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:id="@+id/ll_add"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_marginLeft="20dp"
android:background="@drawable/search_shape_gnc_ware_house2"
android:onClick="@{viewModel::addClick}"
android:padding="10dp">
<ImageView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:src="@mipmap/add"
app:tint="@color/colorPrimary" />
</LinearLayout>
<View
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_weight="1" />
</LinearLayout>
<com.scwang.smart.refresh.layout.SmartRefreshLayout
android:id="@+id/srl"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginTop="10dp"
android:layout_weight="1">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv"
itemLayoutId="@{viewModel.itemId}"
viewHolder="@{viewModel.itemHolder}"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
tools:listitem="@layout/item_gjj_goods" />
</com.scwang.smart.refresh.layout.SmartRefreshLayout>
<TextView
android:id="@+id/tv_total"
android:layout_width="match_parent"
android:layout_height="50dp"
android:background="#5c6890"
android:gravity="center_vertical"
android:paddingLeft="15dp"
android:text='@{"合计:" + viewModel.count + "票"}'
android:textColor="@color/white"
android:textSize="16sp"
android:textStyle="bold" />
</androidx.appcompat.widget.LinearLayoutCompat>
</layout>

View File

@@ -0,0 +1,252 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">
<data>
<import type="android.text.TextUtils" />
<variable
name="viewModel"
type="com.lukouguoji.gjj.viewModel.GjjGoodsManifestViewModel" />
</data>
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/color_f2"
android:orientation="vertical"
tools:context=".activity.GjcGoodsManifestActivity">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_marginLeft="30dp"
android:layout_marginTop="20dp"
android:onClick="@{viewModel::printClick}"
android:src="@drawable/img_print" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:text="国际进港货物交接清单"
android:textColor="#333"
android:textSize="35sp"
android:textStyle="bold" />
<ImageView
android:id="@+id/iv"
android:layout_width="150dp"
android:layout_height="150dp"
android:layout_alignParentEnd="true"
android:layout_marginRight="30dp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/iv"
android:layout_marginLeft="30dp"
android:text='@{"交接单号:" + (viewModel.dataBean.movID ?? "")}'
android:textColor="#333"
android:textSize="25sp"
android:textStyle="bold" />
</RelativeLayout>
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginHorizontal="30dp"
android:layout_marginTop="10dp"
android:layout_weight="1"
android:background="@drawable/bg_border_excel"
android:orientation="vertical">
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="55dp"
android:background="#aaaaaa">
<TextView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@drawable/bg_border_excel"
android:gravity="center"
android:text="序号"
android:textColor="#333"
android:textSize="20dp"
android:textStyle="bold" />
<TextView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1.5"
android:background="@drawable/bg_border_excel"
android:gravity="center"
android:text="运单号"
android:textColor="#333"
android:textSize="20dp"
android:textStyle="bold" />
<TextView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="2"
android:background="@drawable/bg_border_excel"
android:gravity="center"
android:text="航班"
android:textColor="#333"
android:textSize="20dp"
android:textStyle="bold" />
<TextView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@drawable/bg_border_excel"
android:gravity="center"
android:text="始发站"
android:textColor="#333"
android:textSize="20dp"
android:textStyle="bold" />
<TextView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@drawable/bg_border_excel"
android:gravity="center"
android:text="件数"
android:textColor="#333"
android:textSize="20dp"
android:textStyle="bold" />
<TextView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@drawable/bg_border_excel"
android:gravity="center"
android:text="重量"
android:textColor="#333"
android:textSize="20dp"
android:textStyle="bold" />
<TextView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1.2"
android:background="@drawable/bg_border_excel"
android:gravity="center"
android:text="特码"
android:textColor="#333"
android:textSize="20dp"
android:textStyle="bold" />
<TextView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1.2"
android:background="@drawable/bg_border_excel"
android:gravity="center"
android:text="业务类型"
android:textColor="#333"
android:textSize="20dp"
android:textStyle="bold" />
<TextView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1.2"
android:background="@drawable/bg_border_excel"
android:gravity="center"
android:text="品名"
android:textColor="#333"
android:textSize="20dp"
android:textStyle="bold" />
</androidx.appcompat.widget.LinearLayoutCompat>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv"
itemLayoutId="@{viewModel.itemLayoutId}"
viewHolder="@{viewModel.itemViewHolder}"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
tools:listitem="@layout/item_gjj_goods_manifest" />
</androidx.appcompat.widget.LinearLayoutCompat>
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="30dp"
android:layout_marginVertical="20dp"
android:gravity="center_vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text='@{"交接时间:" + (viewModel.dataBean.handtime ?? "")}'
android:textColor="#333"
android:textSize="25sp"
android:textStyle="bold" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="50dp"
android:text='@{"出库人:" + (viewModel.dataBean.checkout ?? "")}'
android:textColor="#333"
android:textSize="25sp"
android:textStyle="bold" />
<View
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_weight="1" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="接收人:"
android:textColor="#333"
android:textSize="25sp"
android:textStyle="bold" />
<RelativeLayout
android:layout_width="200dp"
android:layout_height="60dp"
android:background="@color/white"
android:onClick="@{viewModel::signClick}">
<TextView
visible="@{TextUtils.isEmpty(viewModel.signature)}"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:text="请签字"
android:textColor="#2323ff"
android:textSize="25sp" />
<ImageView
android:id="@+id/iv_sign"
loadImage="@{viewModel.signature}"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</RelativeLayout>
</androidx.appcompat.widget.LinearLayoutCompat>
</androidx.appcompat.widget.LinearLayoutCompat>
</layout>

View File

@@ -0,0 +1,242 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">
<data>
<variable
name="viewModel"
type="com.lukouguoji.gjj.viewModel.GjjManifestListViewModel" />
</data>
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/color_f2"
android:orientation="vertical"
tools:context=".activity.GjjManifestListActivity">
<include layout="@layout/title_tool_bar" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_marginHorizontal="15dp"
android:layout_marginTop="10dp"
android:gravity="center"
android:orientation="horizontal">
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@drawable/bg_search_row"
android:onClick="@{viewModel::flightDateClick}"
android:orientation="horizontal">
<TextView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:hint="请选择航班日期"
android:text="@{viewModel.flightDate}"
android:textSize="15dp" />
<ImageView
android:id="@+id/wbNoScanIcon"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_gravity="center"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:src="@mipmap/img_date" />
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginLeft="20dp"
android:layout_weight="1"
android:background="@drawable/bg_search_row"
android:orientation="horizontal">
<EditText
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@drawable/input_edit_text"
android:gravity="center"
android:hint="请输入航班号"
android:imeOptions="actionDone"
android:inputType="text"
android:singleLine="true"
android:text="@={viewModel.flightNo}"
android:textSize="15dp" />
</LinearLayout>
<LinearLayout
style="@style/ll_search"
android:layout_marginLeft="20dp">
<androidx.appcompat.widget.AppCompatSpinner
items="@{viewModel.departureList}"
onSelected="@{viewModel::departureSelected}"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
<View
android:layout_width="20dp"
android:layout_height="1dp"
android:layout_marginHorizontal="8dp"
android:background="#999" />
<LinearLayout style="@style/ll_search">
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:enabled="false"
android:gravity="center"
android:hint="目的港"
android:text="@{viewModel.flightBean.fdest}"
android:textSize="15dp" />
</LinearLayout>
<LinearLayout
style="@style/ll_search"
android:layout_marginLeft="20dp">
<EditText
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@drawable/input_edit_text"
android:gravity="center"
android:hint="请输入运单号"
android:imeOptions="actionDone"
android:inputType="text"
android:singleLine="true"
android:text="@={viewModel.waybillNo}"
android:textSize="15dp" />
<ImageView
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_gravity="center"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:onClick="@{viewModel::waybillNoClick}"
android:src="@mipmap/scan_code" />
</LinearLayout>
<LinearLayout
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_marginLeft="20dp"
android:background="@drawable/search_shape_gnc_ware_house2"
android:onClick="@{viewModel::searchClick}"
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="40dp"
android:layout_height="40dp"
android:layout_marginLeft="20dp"
android:background="@drawable/search_shape_gnc_ware_house2"
android:onClick="@{viewModel::addClick}"
android:padding="10dp">
<ImageView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:src="@mipmap/add"
app:tint="@color/colorPrimary" />
</LinearLayout>
<LinearLayout
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_marginLeft="20dp"
android:background="@drawable/search_shape_gnc_ware_house2"
android:onClick="@{viewModel::deleteClick}"
android:padding="10dp">
<ImageView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:src="@drawable/delete"
app:tint="@color/colorPrimary" />
</LinearLayout>
</LinearLayout>
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:paddingTop="10dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="15dp"
android:onClick="@{viewModel::selectAllClick}"
android:text="全选" />
<ImageView
android:id="@+id/checkIcon"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_marginLeft="5dp"
android:onClick="@{viewModel::selectAllClick}"
android:src="@drawable/img_check_all" />
</androidx.appcompat.widget.LinearLayoutCompat>
<com.scwang.smart.refresh.layout.SmartRefreshLayout
android:id="@+id/srl"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginTop="10dp"
android:layout_weight="1">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv"
itemLayoutId="@{viewModel.itemId}"
viewHolder="@{viewModel.viewHolder}"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
tools:listitem="@layout/item_gjj_manifest" />
</com.scwang.smart.refresh.layout.SmartRefreshLayout>
<TextView
android:id="@+id/tv_total"
android:layout_width="match_parent"
android:layout_height="50dp"
android:background="#5c6890"
android:gravity="center_vertical"
android:paddingLeft="15dp"
android:text="@{viewModel.desc}"
android:textColor="@color/white"
android:textSize="16sp"
android:textStyle="bold" />
</androidx.appcompat.widget.LinearLayoutCompat>
</layout>

View File

@@ -0,0 +1,532 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">
<data>
<variable
name="viewModel"
type="com.lukouguoji.gjj.viewModel.GjjManifestAddViewModel" />
</data>
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/color_f2"
android:orientation="vertical"
tools:context=".activity.GjjManifestDetailsActivity">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="50dp">
<include layout="@layout/title_tool_bar" />
</RelativeLayout>
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="30dp"
android:layout_marginRight="15dp">
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center_vertical">
<TextView
android:layout_width="15dp"
android:layout_height="wrap_content"
android:gravity="center"
android:text="*"
android:textColor="@color/red" />
<TextView
style="@style/tv_manifest_details_label"
android:text="运单号:" />
<EditText
style="@style/tv_manifest_details_value"
android:inputType="number"
android:maxLength="11"
android:text="@={viewModel.waybillNo}" />
</androidx.appcompat.widget.LinearLayoutCompat>
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center_vertical">
<TextView
android:layout_width="15dp"
android:layout_height="wrap_content"
android:gravity="center"
android:text="*"
android:textColor="@color/red" />
<TextView
style="@style/tv_manifest_details_label"
android:text="代理:" />
<LinearLayout style="@style/tv_manifest_details_value">
<androidx.appcompat.widget.AppCompatSpinner
items="@{viewModel.agentList}"
onSelected="@{viewModel::onAgentSelected}"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
</androidx.appcompat.widget.LinearLayoutCompat>
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center_vertical">
<TextView
android:layout_width="15dp"
android:layout_height="wrap_content"
android:gravity="center"
android:text="*"
android:textColor="@color/red" />
<TextView
style="@style/tv_manifest_details_label"
android:text="特码:" />
<LinearLayout style="@style/tv_manifest_details_value">
<androidx.appcompat.widget.AppCompatSpinner
items="@{viewModel.specialCodeList}"
onSelected="@{viewModel::onSpecialCodeSelected}"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
</androidx.appcompat.widget.LinearLayoutCompat>
</androidx.appcompat.widget.LinearLayoutCompat>
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="30dp"
android:layout_marginRight="15dp">
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center_vertical">
<TextView
android:layout_width="15dp"
android:layout_height="wrap_content"
android:gravity="center"
android:text="*"
android:textColor="@color/red" />
<TextView
style="@style/tv_manifest_details_label"
android:text="业务类型:" />
<LinearLayout style="@style/tv_manifest_details_value">
<androidx.appcompat.widget.AppCompatSpinner
items="@{viewModel.businessTypeList}"
onSelected="@{viewModel::onBusinessTypeSelected}"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
</androidx.appcompat.widget.LinearLayoutCompat>
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center_vertical">
<TextView
android:layout_width="15dp"
android:layout_height="wrap_content"
android:gravity="center"
android:text="*"
android:textColor="@color/red" />
<TextView
style="@style/tv_manifest_details_label"
android:text="货物类型:" />
<LinearLayout style="@style/tv_manifest_details_value">
<androidx.appcompat.widget.AppCompatSpinner
items="@{viewModel.goodsTypeList}"
onSelected="@{viewModel::onGoodsTypeSelected}"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
</androidx.appcompat.widget.LinearLayoutCompat>
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center_vertical">
<TextView
android:layout_width="15dp"
android:layout_height="wrap_content"
android:gravity="center"
android:text="*"
android:textColor="@color/red" />
<TextView
style="@style/tv_manifest_details_label"
android:text="运单类型:" />
<LinearLayout style="@style/tv_manifest_details_value">
<androidx.appcompat.widget.AppCompatSpinner
items="@{viewModel.waybillTypeList}"
onSelected="@{viewModel::onWaybillTypeSelected}"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
</androidx.appcompat.widget.LinearLayoutCompat>
</androidx.appcompat.widget.LinearLayoutCompat>
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="30dp"
android:layout_marginRight="15dp">
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center_vertical">
<TextView
android:layout_width="15dp"
android:layout_height="wrap_content"
android:gravity="center"
android:text="*"
android:textColor="@color/red" />
<TextView
style="@style/tv_manifest_details_label"
android:text="运单件数:" />
<EditText
style="@style/tv_manifest_details_value"
android:inputType="number"
android:text="@={viewModel.waybillNum}" />
</androidx.appcompat.widget.LinearLayoutCompat>
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center_vertical">
<TextView
android:layout_width="15dp"
android:layout_height="wrap_content"
android:gravity="center"
android:text="*"
android:textColor="@color/red" />
<TextView
style="@style/tv_manifest_details_label"
android:text="实到件数:" />
<EditText
style="@style/tv_manifest_details_value"
android:inputType="number"
android:text="@={viewModel.actualNum}" />
</androidx.appcompat.widget.LinearLayoutCompat>
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center_vertical">
<TextView
android:layout_width="15dp"
android:layout_height="wrap_content"
android:gravity="center"
android:text="*"
android:textColor="@color/red" />
<TextView
style="@style/tv_manifest_details_label"
android:text="实到重量:" />
<EditText
style="@style/tv_manifest_details_value"
android:inputType="numberDecimal"
android:text="@={viewModel.actualWeight}" />
</androidx.appcompat.widget.LinearLayoutCompat>
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center_vertical"
android:visibility="gone">
<TextView
android:layout_width="15dp"
android:layout_height="wrap_content"
android:gravity="center"
android:text="*"
android:textColor="@color/red" />
<TextView
style="@style/tv_manifest_details_label"
android:text="计费重量:" />
<EditText
style="@style/tv_manifest_details_value"
android:inputType="numberDecimal"
android:text="@{viewModel.billingWeight}" />
</androidx.appcompat.widget.LinearLayoutCompat>
</androidx.appcompat.widget.LinearLayoutCompat>
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="30dp"
android:layout_marginRight="15dp">
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center_vertical">
<TextView
android:layout_width="15dp"
android:layout_height="wrap_content"
android:gravity="center"
android:text="*"
android:textColor="@color/red" />
<TextView
style="@style/tv_manifest_details_label"
android:text="包装类型:" />
<LinearLayout style="@style/tv_manifest_details_value">
<androidx.appcompat.widget.AppCompatSpinner
items="@{viewModel.packageTypeList}"
onSelected="@{viewModel::onPackageTypeSelected}"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
</androidx.appcompat.widget.LinearLayoutCompat>
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center_vertical">
<TextView
android:layout_width="15dp"
android:layout_height="wrap_content"
android:gravity="center"
android:text="*"
android:textColor="@color/red"
android:visibility="invisible" />
<TextView
style="@style/tv_manifest_details_label"
android:text="始发港:" />
<EditText
style="@style/tv_manifest_details_value"
android:enabled="false"
android:text="@={viewModel.departure}" />
</androidx.appcompat.widget.LinearLayoutCompat>
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center_vertical">
<TextView
android:layout_width="15dp"
android:layout_height="wrap_content"
android:gravity="center"
android:text="*"
android:textColor="@color/red"
android:visibility="invisible" />
<TextView
style="@style/tv_manifest_details_label"
android:text="目的港:" />
<EditText
style="@style/tv_manifest_details_value"
android:enabled="false"
android:text="@={viewModel.destination}" />
</androidx.appcompat.widget.LinearLayoutCompat>
</androidx.appcompat.widget.LinearLayoutCompat>
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="30dp"
android:layout_marginRight="15dp">
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center_vertical">
<TextView
android:layout_width="15dp"
android:layout_height="wrap_content"
android:gravity="center"
android:text="*"
android:textColor="@color/red" />
<TextView
style="@style/tv_manifest_details_label"
android:text="品名(英)" />
<EditText
style="@style/tv_manifest_details_value"
android:text="@={viewModel.goodsNameEn}" />
</androidx.appcompat.widget.LinearLayoutCompat>
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center_vertical"
android:visibility="invisible">
<TextView
android:layout_width="15dp"
android:layout_height="wrap_content"
android:gravity="center"
android:text="*"
android:textColor="@color/red" />
<TextView
style="@style/tv_manifest_details_label"
android:text="品名(中)" />
<EditText
style="@style/tv_manifest_details_value"
android:text="@={viewModel.goodsNameCn}" />
</androidx.appcompat.widget.LinearLayoutCompat>
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center_vertical">
</androidx.appcompat.widget.LinearLayoutCompat>
</androidx.appcompat.widget.LinearLayoutCompat>
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="30dp"
android:layout_marginRight="15dp">
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="2"
android:gravity="center_vertical">
<TextView
android:layout_width="15dp"
android:layout_height="wrap_content"
android:gravity="center"
android:text="*"
android:textColor="@color/red"
android:visibility="invisible" />
<TextView
style="@style/tv_manifest_details_label"
android:text="备注:" />
<EditText
style="@style/tv_manifest_details_value"
android:text="@={viewModel.remark}" />
</androidx.appcompat.widget.LinearLayoutCompat>
<View
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_weight="1" />
</androidx.appcompat.widget.LinearLayoutCompat>
<View
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_weight="1" />
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="50dp"
android:background="#5c6890"
android:gravity="end"
android:paddingHorizontal="15dp">
<TextView
style="@style/tv_bottom_btn"
android:onClick="@{viewModel::onCancelClick}"
android:text="取消" />
<TextView
style="@style/tv_bottom_btn"
android:onClick="@{viewModel::onSaveClick}"
android:text="保存" />
</androidx.appcompat.widget.LinearLayoutCompat>
</androidx.appcompat.widget.LinearLayoutCompat>
</layout>

View File

@@ -0,0 +1,461 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">
<data>
<variable
name="viewModel"
type="com.lukouguoji.gjj.viewModel.GjjManifestDetailsViewModel" />
</data>
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/color_f2"
android:orientation="vertical"
tools:context=".activity.GjjManifestDetailsActivity">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="50dp">
<include layout="@layout/title_tool_bar" />
<ImageView
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginRight="15dp"
android:onClick="@{viewModel::onModifyClick}"
android:src="@drawable/img_edit" />
</RelativeLayout>
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="30dp"
android:layout_marginRight="15dp">
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center_vertical">
<TextView
style="@style/tv_manifest_details_label_no_mi"
android:text="运单号:" />
<TextView
style="@style/tv_manifest_details_value"
shape_bg_color='@{"#f0f0f0"}'
android:text="@{viewModel.waybillNo}" />
</androidx.appcompat.widget.LinearLayoutCompat>
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center_vertical">
<TextView
style="@style/tv_manifest_details_label_no_mi"
android:text="代理:" />
<LinearLayout
style="@style/tv_manifest_details_value"
shape_bg_color='@{viewModel.modifyAble ? "#ffffff" :"#f0f0f0"}'>
<androidx.appcompat.widget.AppCompatSpinner
items="@{viewModel.agentList}"
onSelected="@{viewModel::onAgentSelected}"
setEnable="@{viewModel.modifyAble}"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
</androidx.appcompat.widget.LinearLayoutCompat>
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center_vertical">
<TextView
style="@style/tv_manifest_details_label_no_mi"
android:text="特码:" />
<LinearLayout
style="@style/tv_manifest_details_value"
shape_bg_color='@{viewModel.modifyAble ? "#ffffff" :"#f0f0f0"}'>
<androidx.appcompat.widget.AppCompatSpinner
items="@{viewModel.specialCodeList}"
onSelected="@{viewModel::onSpecialCodeSelected}"
setEnable="@{viewModel.modifyAble}"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
</androidx.appcompat.widget.LinearLayoutCompat>
</androidx.appcompat.widget.LinearLayoutCompat>
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="30dp"
android:layout_marginRight="15dp">
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center_vertical">
<TextView
style="@style/tv_manifest_details_label_no_mi"
android:text="业务类型:" />
<LinearLayout
style="@style/tv_manifest_details_value"
shape_bg_color='@{viewModel.modifyAble ? "#ffffff" :"#f0f0f0"}'>
<androidx.appcompat.widget.AppCompatSpinner
items="@{viewModel.businessTypeList}"
onSelected="@{viewModel::onBusinessTypeSelected}"
setEnable="@{viewModel.modifyAble}"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
</androidx.appcompat.widget.LinearLayoutCompat>
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center_vertical">
<TextView
style="@style/tv_manifest_details_label_no_mi"
android:text="货物类型:" />
<LinearLayout
style="@style/tv_manifest_details_value"
shape_bg_color='@{viewModel.modifyAble ? "#ffffff" :"#f0f0f0"}'>
<androidx.appcompat.widget.AppCompatSpinner
items="@{viewModel.goodsTypeList}"
onSelected="@{viewModel::onGoodsTypeSelected}"
setEnable="@{viewModel.modifyAble}"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
</androidx.appcompat.widget.LinearLayoutCompat>
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center_vertical">
<TextView
style="@style/tv_manifest_details_label_no_mi"
android:text="运单类型:" />
<LinearLayout
style="@style/tv_manifest_details_value"
shape_bg_color='@{viewModel.modifyAble ? "#ffffff" :"#f0f0f0"}'>
<androidx.appcompat.widget.AppCompatSpinner
items="@{viewModel.waybillTypeList}"
onSelected="@{viewModel::onWaybillTypeSelected}"
setEnable="@{viewModel.modifyAble}"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
</androidx.appcompat.widget.LinearLayoutCompat>
</androidx.appcompat.widget.LinearLayoutCompat>
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="30dp"
android:layout_marginRight="15dp">
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center_vertical">
<TextView
style="@style/tv_manifest_details_label_no_mi"
android:text="始发港:" />
<EditText
style="@style/tv_manifest_details_value"
shape_bg_color='@{viewModel.modifyAble ? "#ffffff" :"#f0f0f0"}'
android:enabled="false"
android:text="@={viewModel.departure}" />
</androidx.appcompat.widget.LinearLayoutCompat>
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center_vertical">
<TextView
style="@style/tv_manifest_details_label_no_mi"
android:text="目的港:" />
<EditText
style="@style/tv_manifest_details_value"
shape_bg_color='@{viewModel.modifyAble ? "#ffffff" :"#f0f0f0"}'
android:enabled="false"
android:text="@={viewModel.destination}" />
</androidx.appcompat.widget.LinearLayoutCompat>
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center_vertical">
<TextView
style="@style/tv_manifest_details_label_no_mi"
android:text="运单件数:" />
<EditText
style="@style/tv_manifest_details_value"
shape_bg_color='@{viewModel.modifyAble ? "#ffffff" :"#f0f0f0"}'
android:enabled="@{viewModel.modifyAble}"
android:text="@={viewModel.waybillNum}" />
</androidx.appcompat.widget.LinearLayoutCompat>
</androidx.appcompat.widget.LinearLayoutCompat>
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="30dp"
android:layout_marginRight="15dp">
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center_vertical">
<TextView
style="@style/tv_manifest_details_label_no_mi"
android:text="实到件数:" />
<EditText
style="@style/tv_manifest_details_value"
shape_bg_color='@{viewModel.modifyAble ? "#ffffff" :"#f0f0f0"}'
android:enabled="@{viewModel.modifyAble}"
android:text="@={viewModel.actualNum}" />
</androidx.appcompat.widget.LinearLayoutCompat>
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center_vertical">
<TextView
style="@style/tv_manifest_details_label_no_mi"
android:text="实到重量:" />
<EditText
style="@style/tv_manifest_details_value"
shape_bg_color='@{viewModel.modifyAble ? "#ffffff" :"#f0f0f0"}'
android:enabled="@{viewModel.modifyAble}"
android:text="@={viewModel.actualWeight}" />
</androidx.appcompat.widget.LinearLayoutCompat>
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center_vertical"
android:visibility="gone">
<TextView
style="@style/tv_manifest_details_label_no_mi"
android:text="计费重量:" />
<EditText
style="@style/tv_manifest_details_value"
shape_bg_color='@{viewModel.modifyAble ? "#ffffff" :"#f0f0f0"}'
android:enabled="@{viewModel.modifyAble}"
android:text="465456165" />
</androidx.appcompat.widget.LinearLayoutCompat>
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center_vertical">
<TextView
style="@style/tv_manifest_details_label_no_mi"
android:text="包装类型:" />
<LinearLayout
style="@style/tv_manifest_details_value"
shape_bg_color='@{viewModel.modifyAble ? "#ffffff" :"#f0f0f0"}'>
<androidx.appcompat.widget.AppCompatSpinner
items="@{viewModel.packageTypeList}"
onSelected="@{viewModel::onPackageTypeSelected}"
setEnable="@{viewModel.modifyAble}"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
</androidx.appcompat.widget.LinearLayoutCompat>
</androidx.appcompat.widget.LinearLayoutCompat>
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="30dp"
android:layout_marginRight="15dp">
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center_vertical">
<TextView
style="@style/tv_manifest_details_label_no_mi"
android:text="品名(英)" />
<EditText
style="@style/tv_manifest_details_value"
shape_bg_color='@{viewModel.modifyAble ? "#ffffff" :"#f0f0f0"}'
android:enabled="@{viewModel.modifyAble}"
android:text="@={viewModel.goodsNameEn}" />
</androidx.appcompat.widget.LinearLayoutCompat>
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center_vertical">
<TextView
style="@style/tv_manifest_details_label_no_mi"
android:text="入库时间:" />
<TextView
style="@style/tv_manifest_details_value"
shape_bg_color='@{"#f0f0f0"}'
android:text="@{viewModel.date}" />
</androidx.appcompat.widget.LinearLayoutCompat>
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center_vertical"
android:visibility="invisible">
<TextView
style="@style/tv_manifest_details_label_no_mi"
android:text="品名(中)" />
<EditText
style="@style/tv_manifest_details_value"
shape_bg_color='@{viewModel.modifyAble ? "#ffffff" :"#f0f0f0"}'
android:enabled="@{viewModel.modifyAble}"
android:text="@={viewModel.goodsNameCn}" />
</androidx.appcompat.widget.LinearLayoutCompat>
</androidx.appcompat.widget.LinearLayoutCompat>
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="30dp"
android:layout_marginRight="15dp">
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="2"
android:gravity="center_vertical">
<TextView
style="@style/tv_manifest_details_label_no_mi"
android:text="备注:" />
<EditText
style="@style/tv_manifest_details_value"
shape_bg_color='@{viewModel.modifyAble ? "#ffffff" :"#f0f0f0"}'
android:enabled="@{viewModel.modifyAble}"
android:text="@={viewModel.remark}" />
</androidx.appcompat.widget.LinearLayoutCompat>
<View
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_weight="1" />
</androidx.appcompat.widget.LinearLayoutCompat>
<View
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_weight="1" />
<androidx.appcompat.widget.LinearLayoutCompat
visible="@{viewModel.modifyAble}"
android:layout_width="match_parent"
android:layout_height="50dp"
android:background="#5c6890"
android:gravity="end"
android:paddingHorizontal="15dp">
<TextView
style="@style/tv_bottom_btn"
android:onClick="@{viewModel::onSaveClick}"
android:text="保存" />
<TextView
style="@style/tv_bottom_btn"
android:onClick="@{viewModel::onCancelClick}"
android:text="取消" />
</androidx.appcompat.widget.LinearLayoutCompat>
</androidx.appcompat.widget.LinearLayoutCompat>
</layout>

View File

@@ -0,0 +1,256 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">
<data>
<variable
name="viewModel"
type="com.lukouguoji.gjj.viewModel.GjjPacketParseViewModel" />
</data>
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/color_f2"
android:orientation="vertical"
tools:context=".activity.GjjPacketParseActivity">
<include layout="@layout/title_tool_bar" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_marginHorizontal="15dp"
android:layout_marginTop="10dp"
android:gravity="center"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="*"
android:textColor="@color/red" />
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginLeft="5dp"
android:layout_weight="1"
android:background="@drawable/bg_search_row"
android:onClick="@{viewModel::onFlightDateClick}"
android:orientation="horizontal">
<TextView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:hint="请选择航班日期"
android:text="@{viewModel.flightDate}"
android:textSize="15dp" />
<ImageView
android:id="@+id/wbNoScanIcon"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_gravity="center"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:src="@mipmap/img_date" />
</LinearLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:text="*"
android:textColor="@color/red" />
<LinearLayout
style="@style/ll_search"
android:layout_marginLeft="5dp">
<EditText
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@drawable/input_edit_text"
android:gravity="center"
android:hint="请输入航班号"
android:imeOptions="actionDone"
android:inputType="text"
android:singleLine="true"
android:text="@={viewModel.flightNo}"
android:textSize="15dp" />
</LinearLayout>
<LinearLayout
style="@style/ll_search"
android:layout_marginLeft="20dp">
<androidx.appcompat.widget.AppCompatSpinner
items="@{viewModel.packetTypeList}"
onSelected="@{viewModel::onPacketTypeSelected}"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
<LinearLayout
style="@style/ll_search"
android:layout_marginLeft="20dp">
<androidx.appcompat.widget.AppCompatSpinner
android:id="@+id/spinner"
items="@{viewModel.departureList}"
onSelected="@{viewModel::onDepartureSelected}"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
<View
android:layout_width="20dp"
android:layout_height="1dp"
android:layout_marginHorizontal="10dp"
android:background="#555" />
<LinearLayout style="@style/ll_search">
<TextView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:enabled="false"
android:gravity="center"
android:hint="目的港"
android:text="@{viewModel.flightBean.fdest}"
android:imeOptions="actionDone"
android:inputType="text"
android:singleLine="true"
android:textSize="15dp" />
</LinearLayout>
<LinearLayout
android:id="@+id/ll_search"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_marginLeft="20dp"
android:background="@drawable/search_shape_gnc_ware_house2"
android:onClick="@{viewModel::onSearchClick}"
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:id="@+id/ll_add"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_marginLeft="20dp"
android:background="@drawable/search_shape_gnc_ware_house2"
android:onClick="@{viewModel::onListClick}"
android:padding="10dp">
<ImageView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:src="@drawable/img_list"
app:tint="@color/colorPrimary" />
</LinearLayout>
</LinearLayout>
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_margin="15dp"
android:layout_weight="1">
<com.scwang.smart.refresh.layout.SmartRefreshLayout
android:id="@+id/srl"
android:layout_width="400dp"
android:layout_height="match_parent">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv"
itemLayoutId="@{viewModel.itemId}"
viewHolder="@{viewModel.itemHolder}"
android:layout_width="400dp"
android:layout_height="match_parent"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
tools:listitem="@layout/item_packet_parse" />
</com.scwang.smart.refresh.layout.SmartRefreshLayout>
<com.mcxtzhang.swipemenulib.SwipeMenuLayout
android:id="@+id/sml"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="15dp">
<EditText
shape_bg_color="@{@color/white}"
shape_border_color='@{"#666666"}'
shape_border_width="@{1}"
shape_radius="@{8}"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@null"
android:enabled="@{viewModel.modifyAble}"
android:gravity="start"
android:padding="10dp"
android:text="@={viewModel.packetContent}"
tools:text="123" />
<TextView
style="@style/tv_item_action"
android:background="#f6a943"
android:onClick="@{viewModel::onModifyClick}"
android:text="修改" />
</com.mcxtzhang.swipemenulib.SwipeMenuLayout>
</androidx.appcompat.widget.LinearLayoutCompat>
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="50dp"
android:background="#5c6890"
android:gravity="center_vertical"
android:paddingHorizontal="15dp">
<TextView
android:id="@+id/tv_total"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text='@{"合计:" + viewModel.count + "条"}'
android:textColor="@color/white"
android:textSize="16sp"
android:textStyle="bold" />
<View
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_weight="1" />
<TextView
style="@style/tv_bottom_btn"
android:onClick="@{viewModel::onConfirmClick}"
android:text="电报生成" />
</androidx.appcompat.widget.LinearLayoutCompat>
</androidx.appcompat.widget.LinearLayoutCompat>
</layout>

View File

@@ -0,0 +1,157 @@
<?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:background="@color/list_bg"
android:orientation="vertical"
tools:context=".activity.GjjQueryInfoActivity">
<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_margin="5dp"
android:layout_weight="5"
android:background="@drawable/collect_item_shape"
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="wrap_content"
android:orientation="horizontal">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/gncQueryInfoList"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
<!-- 关联仓库信息 分割线-->
<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="horizontal">
<View
android:layout_width="0dp"
android:layout_height="2dp"
android:layout_weight="2"
android:background="@drawable/dash_line"
android:layerType="software" />
<LinearLayout
android:id="@+id/refWareHouseInfo"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_gravity="center_vertical"
android:layout_weight="1"
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/colorPrimary"
/>
<ImageView
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_marginLeft="5dp"
android:src="@mipmap/open_show"
app:tint="@color/colorPrimary" />
</LinearLayout>
<View
android:layout_width="0dp"
android:layout_height="2dp"
android:layout_weight="2"
android:background="@drawable/dash_line"
android:layerType="software" />
</LinearLayout>
<!--关联仓库信息 内容区-->
<LinearLayout
android:id="@+id/wareHouseInfoLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginTop="20dp"
android:background="@color/list_bg"
android:gravity="center_vertical"
android:orientation="vertical"
android:visibility="gone">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/gncQueryWareHouseInfoList"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginBottom="5dp"
android:overScrollMode="never" />
</LinearLayout>
</LinearLayout>
</androidx.core.widget.NestedScrollView>
<!-- 底部-->
<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>

View File

@@ -0,0 +1,861 @@
<?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.GjjQueryListActivity">
<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="match_parent"
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">
<!-- 航班日期开始-->
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="4"
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:singleLine="true"
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="4"
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:singleLine="true"
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="4"
android:background="@drawable/bg_search_row">
<EditText
android:id="@+id/wbNo"
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="number"
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="4"
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="20dp"
android:layout_height="match_parent" />
<!-- 搜索图标-->
<LinearLayout
android:id="@+id/searchLayout"
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="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:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:layout_weight="1">
<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/recyclerList"
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="入库时间" />
&lt;!&ndash;内容&ndash;&gt;
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginTop="5dp"
android:layout_weight="3"
android:gravity="center"
android:orientation="horizontal">
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@drawable/input_shape">
<TextView
android:id="@+id/startDateParam"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="2dp"
android:gravity="start|center"
android:hint="开始时间"
android:inputType="text"
android:maxLines="1"
android:singleLine="true"
android:text=""
/>
</LinearLayout>
<TextView
android:layout_width="20dp"
android:layout_height="match_parent"
android:gravity="center"
android:text="-"
/>
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@drawable/input_shape">
<TextView
android:id="@+id/endDateParam"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="2dp"
android:gravity="start|center"
android:hint="结束时间"
android:inputType="text"
android:maxLines="1"
android:singleLine="true"
android:text=""
/>
</LinearLayout>
</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="航程" />
&lt;!&ndash;内容&ndash;&gt;
<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/hangCheng"
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="承运人" />
&lt;!&ndash;内容&ndash;&gt;
<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/carrier"
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="库位" />
&lt;!&ndash;内容&ndash;&gt;
<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/kuWei"
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/mudiGang"
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">
<TextView
android:id="@+id/spCode"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginLeft="2dp"
android:layout_weight="1"
android:gravity="center|start"
android:hint="请选择特码"
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">
<TextView
android:id="@+id/agentCode"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginLeft="2dp"
android:layout_weight="1"
android:gravity="center|start"
android:hint="请选择代理人"
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/goods"
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">
<TextView
android:id="@+id/awbType"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginLeft="2dp"
android:layout_weight="1"
android:gravity="center|start"
android:hint="请选择运单类型"
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">
<TextView
android:id="@+id/businessType"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginLeft="2dp"
android:layout_weight="1"
android:gravity="center|start"
android:hint="请选择业务类型"
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="是否上舱单" />
&lt;!&ndash;内容&ndash;&gt;
<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">
<TextView
android:id="@+id/isCangDan"
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|start"
android:hint="请选择"
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>

View File

@@ -0,0 +1,136 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">
<data>
<variable
name="viewModel"
type="com.lukouguoji.gjj.viewModel.GjjTallyAddViewModel" />
</data>
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/color_f2"
android:orientation="vertical"
tools:context=".activity.GjcBoxAssembleAddActivity">
<include layout="@layout/title_tool_bar" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="25dp"
android:text='@{"平板车:" + (viewModel.flatcarBean.carId ?? "")}'
android:textColor="#333333"
android:textSize="30dp"
android:textStyle="bold" />
<com.scwang.smart.refresh.layout.SmartRefreshLayout
android:id="@+id/srl"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginTop="25dp"
android:layout_weight="1"
app:srlEnableLoadMore="false"
app:srlEnableRefresh="false">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv"
itemLayoutId="@{viewModel.itemId}"
viewHolder="@{viewModel.itemHolder}"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
tools:listitem="@layout/item_tally_add" />
</com.scwang.smart.refresh.layout.SmartRefreshLayout>
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="50dp"
android:background="#5c6890"
android:gravity="center_vertical"
android:paddingHorizontal="15dp">
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="0dp"
android:layout_height="40dp"
android:layout_marginLeft="20dp"
android:layout_weight="1"
android:background="@drawable/bg_search_row"
android:gravity="center_vertical">
<EditText
setFocusChangedListener="@{viewModel::onPbcOrUldChange}"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@null"
android:hint="请输入平板车"
android:paddingLeft="8dp"
android:text="@={viewModel.plateOrUld}" />
<ImageView
android:layout_width="40dp"
android:layout_height="match_parent"
android:layout_gravity="center"
android:onClick="@{viewModel::onPlateClick}"
android:padding="10dp"
android:src="@mipmap/scan_code" />
</androidx.appcompat.widget.LinearLayoutCompat>
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="0dp"
android:layout_height="40dp"
android:layout_marginLeft="20dp"
android:layout_weight="1.3"
android:background="@drawable/bg_search_row"
android:gravity="center_vertical">
<EditText
setFocusChangedListener="@{viewModel::onWaybillOrPieceChange}"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@null"
android:hint="请输入运单号或分单号或件号"
android:paddingLeft="8dp"
android:text="@={viewModel.waybillOrPiece}" />
<ImageView
android:layout_width="40dp"
android:layout_height="match_parent"
android:layout_gravity="center"
android:onClick="@{viewModel::onWaybillOrPieceClick}"
android:padding="10dp"
android:src="@mipmap/scan_code" />
</androidx.appcompat.widget.LinearLayoutCompat>
<View
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_weight="1" />
<TextView
style="@style/tv_bottom_btn"
android:onClick="@{viewModel::confirmClick}"
android:text="确认" />
<TextView
style="@style/tv_bottom_btn"
android:onClick="@{viewModel::cancelClick}"
android:text="取消" />
</androidx.appcompat.widget.LinearLayoutCompat>
</androidx.appcompat.widget.LinearLayoutCompat>
</layout>

View File

@@ -0,0 +1,71 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">
<data>
<variable
name="viewModel"
type="com.lukouguoji.gjj.viewModel.GjjTallyDetailsViewModel" />
</data>
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/color_f2"
android:orientation="vertical"
tools:context=".activity.GjjTallyDetailsActivity">
<include layout="@layout/title_tool_bar" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="40dp"
android:text='@{"运单号:" + viewModel.waybillNo}'
android:textColor="#333333"
android:textSize="30dp"
android:textStyle="bold" />
<com.scwang.smart.refresh.layout.SmartRefreshLayout
android:id="@+id/srl"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginTop="30dp"
android:layout_weight="1">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv"
itemLayoutId="@{viewModel.itemId}"
viewHolder="@{viewModel.itemHolder}"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
tools:listitem="@layout/item_tally_add" />
</com.scwang.smart.refresh.layout.SmartRefreshLayout>
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="50dp"
android:background="#5c6890"
android:gravity="center_vertical"
android:paddingHorizontal="15dp">
<TextView
android:id="@+id/tv_total"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@{viewModel.desc}"
android:textColor="@color/white"
android:textSize="16sp"
android:textStyle="bold" />
</androidx.appcompat.widget.LinearLayoutCompat>
</androidx.appcompat.widget.LinearLayoutCompat>
</layout>

View File

@@ -0,0 +1,249 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">
<data>
<variable
name="viewModel"
type="com.lukouguoji.gjj.viewModel.GjjTallyViewModel" />
</data>
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/color_f2"
android:orientation="vertical"
tools:context=".activity.GjjManifestListActivity">
<include layout="@layout/title_tool_bar" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_marginHorizontal="15dp"
android:layout_marginTop="10dp"
android:gravity="center"
android:orientation="horizontal">
<LinearLayout
style="@style/ll_search"
android:layout_marginLeft="20dp"
android:onClick="@{viewModel::onFlightDateClick}">
<TextView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:hint="请选择航班日期"
android:text="@{viewModel.flightDate}"
android:textSize="15dp" />
<ImageView
android:id="@+id/wbNoScanIcon"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_gravity="center"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:src="@mipmap/img_date" />
</LinearLayout>
<LinearLayout
style="@style/ll_search"
android:layout_marginLeft="20dp">
<EditText
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@drawable/input_edit_text"
android:gravity="center"
android:hint="请输入航班号"
android:imeOptions="actionDone"
android:inputType="text"
android:singleLine="true"
android:text="@={viewModel.flightNo}"
android:textSize="15dp" />
</LinearLayout>
<LinearLayout
style="@style/ll_search"
android:layout_marginLeft="20dp">
<androidx.appcompat.widget.AppCompatSpinner
items="@{viewModel.agentList}"
onSelected="@{viewModel::onAgentSelected}"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
<LinearLayout
style="@style/ll_search"
android:layout_marginLeft="20dp">
<EditText
android:id="@+id/et_car"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@drawable/input_edit_text"
android:gravity="center"
android:hint="请输入运单号"
android:imeOptions="actionDone"
android:inputType="text"
android:singleLine="true"
android:text="@={viewModel.waybillNo}"
android:textSize="15dp" />
<ImageView
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_gravity="center"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:onClick="@{viewModel::onWaybillNoScanClick}"
android:src="@mipmap/scan_code" />
</LinearLayout>
<LinearLayout
style="@style/ll_search"
android:layout_marginLeft="20dp">
<androidx.appcompat.widget.AppCompatSpinner
items="@{viewModel.tallyStatusList}"
onSelected="@{viewModel::onTallyStatusSelected}"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
<!-- 搜索图标-->
<LinearLayout
android:id="@+id/ll_search"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_marginLeft="20dp"
android:background="@drawable/search_shape_gnc_ware_house2"
android:onClick="@{viewModel::onSearchClick}"
android:padding="10dp">
<ImageView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:src="@drawable/search"
app:tint="@color/colorPrimary" />
</LinearLayout>
<LinearLayout
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_marginLeft="20dp"
android:background="@drawable/search_shape_gnc_ware_house2"
android:onClick="@{viewModel::onAddClick}"
android:padding="10dp">
<ImageView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:src="@drawable/add"
app:tint="@color/colorPrimary" />
</LinearLayout>
<LinearLayout
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_marginLeft="20dp"
android:background="@drawable/search_shape_gnc_ware_house2"
android:onClick="@{viewModel::onDeleteClick}"
android:padding="10dp">
<ImageView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:src="@drawable/delete"
app:tint="@color/colorPrimary" />
</LinearLayout>
</LinearLayout>
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:paddingTop="10dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="15dp"
android:onClick="@{viewModel::onAllClick}"
android:text="全选" />
<ImageView
android:id="@+id/checkIcon"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_marginLeft="5dp"
android:onClick="@{viewModel::onAllClick}"
android:src="@drawable/img_check_all" />
</androidx.appcompat.widget.LinearLayoutCompat>
<com.scwang.smart.refresh.layout.SmartRefreshLayout
android:id="@+id/srl"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginTop="10dp"
android:layout_weight="1">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv"
itemLayoutId="@{viewModel.itemId}"
viewHolder="@{viewModel.itemHolder}"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
tools:listitem="@layout/item_gjj_tally" />
</com.scwang.smart.refresh.layout.SmartRefreshLayout>
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="50dp"
android:background="#5c6890"
android:gravity="center_vertical"
android:paddingHorizontal="15dp">
<TextView
android:id="@+id/tv_total"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@{viewModel.desc}"
android:textColor="@color/white"
android:textSize="16sp"
android:textStyle="bold" />
<View
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_weight="1" />
<TextView
style="@style/tv_bottom_btn"
android:onClick="@{viewModel::onGoodsSendClick}"
android:text="货物发放" />
</androidx.appcompat.widget.LinearLayoutCompat>
</androidx.appcompat.widget.LinearLayoutCompat>
</layout>

View File

@@ -0,0 +1,461 @@
<?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.GjjWareHouseActivity">
<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="5"
android:background="@drawable/bg_search_row"
android:orientation="horizontal">
<EditText
android:id="@+id/waybillNo"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@drawable/input_edit_text"
android:gravity="center"
android:hint="请输入运单号"
android:imeOptions="actionDone"
android:inputType="number"
android:maxLines="1"
android:singleLine="true"
android:text=""
android:textSize="15sp" />
</LinearLayout>
<!-- 空格-->
<LinearLayout
android:layout_width="20dp"
android:layout_height="match_parent" />
<!-- 代理人 -->
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="5"
android:background="@drawable/bg_search_row"
android:orientation="horizontal">
<TextView
android:id="@+id/agentCode"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:hint="请选择代理人"
android:inputType="text"
android:maxLines="1"
android:singleLine="true"
android:text=""
android:textSize="15sp" />
</LinearLayout>
<LinearLayout
android:layout_width="20dp"
android:layout_height="match_parent" />
<!-- 承运人-->
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="5"
android:background="@drawable/bg_search_row"
android:orientation="horizontal">
<EditText
android:id="@+id/carrier"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@drawable/input_edit_text"
android:hint="请输入承运人"
android:gravity="center"
android:imeOptions="actionDone"
android:inputType="text"
android:maxLines="1"
android:singleLine="true"
android:text=""
android:textSize="15sp" />
</LinearLayout>
<LinearLayout
android:layout_width="20dp"
android:layout_height="match_parent" />
<!-- 库位-->
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="5"
android:background="@drawable/bg_search_row"
android:orientation="horizontal">
<EditText
android:id="@+id/location"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@drawable/input_edit_text"
android:hint="请输入库位"
android:gravity="center"
android:imeOptions="actionDone"
android:inputType="text"
android:maxLines="1"
android:singleLine="true"
android:text=""
android:textSize="15sp" />
</LinearLayout>
<LinearLayout
android:layout_width="10dp"
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:padding="10dp">
<ImageView
android:layout_width="match_parent"
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: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:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:layout_weight="1">
<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/guo_nei_collect_list"
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:layout_width="match_parent"
android:layout_height="30dp"
android:background="@color/dark_grey"
android:orientation="horizontal">
<TextView
android:id="@+id/summaryText"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:ellipsize="end"
android:gravity="center"
android:maxLines="1"
android:singleLine="true"
android:text="总票数0总件数0总重量0"
android:textColor="@color/white"
android:textSize="20sp" />
</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/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: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">
<TextView
android:id="@+id/isGroup"
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|start"
android:hint="请选择分组类型"
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>

View File

@@ -0,0 +1,44 @@
<?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.GjjWareHouseInfoActivity">
<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_margin="5dp"
android:layout_weight="5"
android:background="@drawable/collect_item_shape"
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="match_parent"
android:orientation="horizontal">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/gncQueryInfoList"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
</LinearLayout>
</androidx.core.widget.NestedScrollView>
</LinearLayout>

View 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_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -0,0 +1,202 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android">
<data>
<variable
name="model"
type="com.lukouguoji.gjj.model.TallyBatchDialogModel" />
</data>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/bg_dialog_radius_10"
android:gravity="center_horizontal"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="50dp"
android:background="@drawable/bg_primary_radius_top_10"
android:gravity="center"
android:text="分批操作"
android:textColor="@color/white"
android:textSize="16sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:text="运单号: 7812344652"
android:textColor="#333333"
android:textSize="16sp"
android:textStyle="bold" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_marginHorizontal="10dp"
android:layout_marginTop="10dp"
android:gravity="center_vertical">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1">
<TextView
android:layout_width="80dp"
android:layout_height="wrap_content"
android:text="总件数:"
android:textColor="#333333" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@{model.bean.pc}"
android:textColor="#333333" />
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1">
<TextView
android:layout_width="80dp"
android:layout_height="wrap_content"
android:text="总重量:"
android:textColor="#333333" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@{model.bean.weight}"
android:textColor="#333333" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_marginHorizontal="10dp"
android:gravity="center_vertical">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1">
<TextView
android:layout_width="80dp"
android:layout_height="wrap_content"
android:text="剩余件数:"
android:textColor="#333333" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text='@{"" + model.remainingCount}'
android:textColor="#333333" />
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1">
<TextView
android:layout_width="80dp"
android:layout_height="wrap_content"
android:text="剩余重量:"
android:textColor="#333333" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text='@{"" + model.remainingWeight}'
android:textColor="#333333" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_marginHorizontal="10dp"
android:gravity="center_vertical">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1">
<TextView
android:layout_width="80dp"
android:layout_height="wrap_content"
android:text="分批件数:"
android:textColor="#333333" />
<EditText
android:layout_width="match_parent"
android:layout_height="35dp"
android:layout_marginRight="10dp"
android:background="@color/white"
android:inputType="number"
android:text="@={model.count}"
android:textColor="#333333"
android:textSize="14sp" />
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1">
<TextView
android:layout_width="80dp"
android:layout_height="wrap_content"
android:text="分批重量:"
android:textColor="#333333" />
<EditText
android:layout_width="match_parent"
android:layout_height="35dp"
android:background="@color/white"
android:inputType="numberDecimal"
android:text="@={model.weight}"
android:textColor="#333333"
android:textSize="14sp" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginVertical="20dp">
<TextView
android:id="@+id/tv_cancel"
style="@style/tv_bottom_btn"
android:onClick="@{()->model.dismiss()}"
android:text="取消" />
<TextView
android:id="@+id/tv_save"
style="@style/tv_bottom_btn"
android:onClick="@{model::save}"
android:text="保存" />
</LinearLayout>
</LinearLayout>
</layout>

View File

@@ -0,0 +1,50 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">
<data>
<variable
name="model"
type="com.lukouguoji.gjj.model.GjjTallyAddSelectDialogModel" />
</data>
<LinearLayout
shape_bg_color="@{@color/color_f2}"
shape_radius="@{8}"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/color_f2"
android:maxHeight="300dp"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="15dp"
android:text="以下运单数据有重复,请选择一条"
android:textSize="16sp"
android:textStyle="bold" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv"
itemLayoutId="@{model.itemId}"
viewHolder="@{model.itemHolder}"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginTop="15dp"
android:layout_weight="1"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
tools:listitem="@layout/item_gjc_un_load" />
<TextView
style="@style/tv_bottom_btn"
android:layout_gravity="end"
android:layout_marginVertical="10dp"
android:layout_marginRight="15dp"
android:onClick="@{model::onConfirmClick}"
android:text="确定" />
</LinearLayout>
</layout>

View File

@@ -0,0 +1,119 @@
<?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:paddingLeft="20dp"
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"
android:gravity="start|center"
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/gjj_cang_dan_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:textSize="20sp"
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"/>
<!-- 输入框-->
<EditText
android:id="@+id/inputContent"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="3"
android:background="@drawable/gjj_cang_dan_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:textSize="20sp"
android:visibility="visible" />
</LinearLayout>
<!-- 下拉框-->
<TextView
android:id="@+id/selContent"
android:layout_width="0dp"
android:layout_weight="3"
android:layout_height="match_parent"
android:background="@drawable/gjj_cang_dan_info_edit_shape"
android:gravity="center|start"
android:maxLines="1"
android:paddingLeft="5dp"
android:layout_marginLeft="2dp"
android:singleLine="true"
android:textColor="@color/black"
android:text="请选择"
android:textSize="20sp"
android:visibility="gone" />
</LinearLayout>
</LinearLayout>

View File

@@ -0,0 +1,404 @@
<?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/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: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
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/goods"
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/startPort"
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/destPort"
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>
<!-- 分割线-->
<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/spCode"
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/totalPc"
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/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/acWeight"
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/chWight"
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>
<!-- 分割线-->
<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/agentCode"
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="4"
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/awbType"
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>
<!-- &lt;!&ndash; 占位&ndash;&gt;
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center_vertical">
</LinearLayout>
&lt;!&ndash; 占位&ndash;&gt;
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center_vertical">
</LinearLayout>
&lt;!&ndash; 占位&ndash;&gt;
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center_vertical">
</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/bg_red_radius_5"
android:text="删除"
android:textSize="18sp"
android:textColor="@color/white"/>
</LinearLayout>
</LinearLayout>

View File

@@ -0,0 +1,290 @@
<?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="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/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:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:textColor="@color/weak_grey"
android:text="运单号"/>
<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>
<!-- 提货单号行-->
<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="match_parent"
android:gravity="center"
android:text="提货单号"
android:textColor="@color/weak_grey" />
<TextView
android:id="@+id/pickNo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="2dp"
android:ellipsize="end"
android:maxLines="2"
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/fno"
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/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>
<!-- 分割线-->
<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/goods"
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/agentCode"
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/spCode"
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="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/pickDate"
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>

Some files were not shown because too many files have changed in this diff Show More