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_gjc/.gitignore vendored Normal file
View File

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

76
module_gjc/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.gjc"
}
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_gjc/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.gjc
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.gjc", 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.gjc">
<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.gjc
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,47 @@
package com.lukouguoji.gjc.activity
import android.os.Bundle
import com.alibaba.android.arouter.facade.annotation.Route
import com.lukouguoji.gjc.R
import com.lukouguoji.gjc.databinding.ActivityBoxAssembleBinding
import com.lukouguoji.gjc.holder.BoxAssembleViewHolder
import com.lukouguoji.gjc.viewModel.BoxAssembleViewModel
import com.lukouguoji.module_base.base.BaseBindingActivity
import com.lukouguoji.module_base.base.CommonAdapter
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.addOnItemClickListener
import com.lukouguoji.module_base.router.ARouterConstants
/**
* 板箱组装
*/
@Route(path = ARouterConstants.ACTIVITY_URL_GJC_BOX_ASSEMBLE)
class BoxAssembleActivity :
BaseBindingActivity<ActivityBoxAssembleBinding, BoxAssembleViewModel>() {
override fun layoutId() = R.layout.activity_box_assemble
override fun viewModelClass() = BoxAssembleViewModel::class.java
override fun initOnCreate(savedInstanceState: Bundle?) {
setBackArrow("国际出港板箱组装")
binding.viewModel = viewModel
binding.rv.adapter =
CommonAdapter(this, R.layout.item_box_assemble, BoxAssembleViewHolder::class.java)
binding.rv.addOnItemClickListener(viewModel)
// 绑定刷新事件
viewModel.pageModel.bindSmartRefreshLayout(binding.srl, binding.rv, viewModel, this)
// 刷新数据
viewModel.getData()
FlowBus.with<Any>(ConstantEvent.GJC_BOX_ADD_SUCCESS)
.observe(this) {
viewModel.getData()
}
}
}

View File

@@ -0,0 +1,64 @@
package com.lukouguoji.gjc.activity
import android.content.Context
import android.content.Intent
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import com.lukouguoji.gjc.R
import com.lukouguoji.gjc.databinding.ActivityGjcBoxAssembleAddBinding
import com.lukouguoji.gjc.holder.BoxAddListViewHolder
import com.lukouguoji.gjc.viewModel.GjcBoxAssembleAddViewModel
import com.lukouguoji.module_base.base.BaseBindingActivity
import com.lukouguoji.module_base.base.CommonAdapter
import com.lukouguoji.module_base.bean.GjcWaybillBean
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.addOnItemClickListener
import com.lukouguoji.module_base.ktx.loge
import com.lukouguoji.module_base.ktx.noNull
class GjcBoxAssembleAddActivity :
BaseBindingActivity<ActivityGjcBoxAssembleAddBinding, GjcBoxAssembleAddViewModel>() {
override fun layoutId() = R.layout.activity_gjc_box_assemble_add
override fun viewModelClass() = GjcBoxAssembleAddViewModel::class.java
override fun initOnCreate(savedInstanceState: Bundle?) {
setBackArrow("国际出港开始组装")
val locId = intent.getStringExtra(Constant.Key.DATA)
// 获取传入的数据
viewModel.insertId = locId.noNull()
viewModel.isAdd.value = locId.isNullOrEmpty()
binding.viewModel = viewModel
binding.rv.adapter = CommonAdapter(
requireContext(),
R.layout.item_box_add,
BoxAddListViewHolder::class.java
)
binding.rv.addOnItemClickListener(viewModel)
viewModel.pageModel.bindSmartRefreshLayout(binding.srl, binding.rv, viewModel, this)
viewModel.getData()
// 监听待装运单选中事件
FlowBus.with<List<GjcWaybillBean>>(ConstantEvent.GJC_UNLOAD_LIST_CHECKED)
.observe(this) {
viewModel.onWaybillListSelected(requireContext(), it)
}
}
companion object {
@JvmStatic
fun start(context: Context, locId: String = "") {
val starter = Intent(context, GjcBoxAssembleAddActivity::class.java)
.putExtra(Constant.Key.DATA, locId)
context.startActivity(starter)
}
}
}

View File

@@ -0,0 +1,638 @@
package com.lukouguoji.gjc.activity
import android.content.Intent
import android.os.Bundle
import android.text.Editable
import android.text.TextWatcher
import android.view.View
import android.widget.*
import androidx.lifecycle.ViewModelProvider
import com.alibaba.android.arouter.facade.annotation.Autowired
import com.alibaba.android.arouter.facade.annotation.Route
import com.alibaba.fastjson.JSONObject
import com.lukouguoji.gjc.R
import com.lukouguoji.gjc.model.GjcFuBang
import com.lukouguoji.gjc.viewModel.GjcFuBangViewModel
import com.lukouguoji.module_base.BaseActivity
import com.lukouguoji.module_base.common.Constant
import com.lukouguoji.module_base.ktx.noNull
import com.lukouguoji.module_base.router.ARouterConstants
import com.lukouguoji.module_base.util.Common
import java.text.SimpleDateFormat
import java.util.*
@Route(path = ARouterConstants.ACTIVITY_URL_GJC_FU_BANG)
class GjcFuBangActivity : BaseActivity(), View.OnClickListener {
private lateinit var viewModel: GjcFuBangViewModel
private lateinit var carId: EditText
private lateinit var carIdScan: ImageView
private lateinit var uld: EditText
private lateinit var uldScan: ImageView
private lateinit var dibangWeight: EditText
private lateinit var dibangWeightScan: ImageView
//第一行
private lateinit var carWeight: EditText
private lateinit var uldWeight: EditText
private lateinit var netWeight: EditText
//第二行
private lateinit var dgrCode: EditText
private lateinit var boardType: EditText
private lateinit var cargoWeight: EditText
//第三行
private lateinit var plClose: Button
private lateinit var plCloseSize: EditText
private lateinit var plCloseSizeMust: TextView
private lateinit var totalWeight: EditText
//第四行
private lateinit var height: EditText
private lateinit var fdate: Button
private lateinit var fno: EditText
//第5行
private lateinit var fdest: EditText
private lateinit var cargoType: Button
private lateinit var remark: EditText
private lateinit var submit: TextView
private val ymdSdf = SimpleDateFormat("yyyy-MM-dd")//年月日
private val calendar = Calendar.getInstance()
@JvmField
@Autowired
var carNoParam: String? = null
@JvmField
@Autowired
var userIdParam: String? = null
private fun initView() {
carId = findViewById(R.id.carId)
carIdScan = findViewById(R.id.carIdScan)
uld = findViewById(R.id.uld)
uldScan = findViewById(R.id.uldScan)
dibangWeight = findViewById(R.id.dibangWeight)
dibangWeightScan = findViewById(R.id.dibangWeightScan)
//第一行
carWeight = findViewById(R.id.carWeight)
uldWeight = findViewById(R.id.uldWeight)
netWeight = findViewById(R.id.netWeight)
//第二行
dgrCode = findViewById(R.id.dgrCode)
boardType = findViewById(R.id.boardType)
cargoWeight = findViewById(R.id.cargoWeight)
//第三行
plClose = findViewById(R.id.plClose)
plCloseSizeMust = findViewById(R.id.plCloseSizeMust)
plCloseSize = findViewById(R.id.plCloseSize)
totalWeight = findViewById(R.id.totalWeight)
//第四行
height = findViewById(R.id.height)
fdate = findViewById(R.id.fdate)
fno = findViewById(R.id.fno)
//第五行
fdest = findViewById(R.id.fdest)
cargoType = findViewById(R.id.cargoType)
remark = findViewById(R.id.remark)
submit = findViewById(R.id.submit)
carIdScan.setOnClickListener(this)
uldScan.setOnClickListener(this)
dibangWeightScan.setOnClickListener(this)
plClose.setOnClickListener(this)
fdate.setOnClickListener(this)
cargoType.setOnClickListener(this)
submit.setOnClickListener(this)
fdate.text = ymdSdf.format(calendar.time)
///////////// 监听edittext变化
dibangWeight.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().trim() != "") {
val tempWeight = s.toString().toDouble()
//架子车自重
var carWeightDouble = 0.0
if (carWeight.text.toString().trim() != "") {
carWeightDouble = carWeight.text.toString().trim().toDouble()
}
//集装器自重
var uldWeightDouble = 0.0
if (uldWeight.text.toString().trim() != "") {
uldWeightDouble = uldWeight.text.toString().trim().toDouble()
}
//赋值
//装机重
netWeight.setText("${tempWeight - carWeightDouble}")
//货重
cargoWeight.setText("${tempWeight - carWeightDouble - uldWeightDouble}")
//总重
totalWeight.setText("$tempWeight")
}
}
override fun afterTextChanged(s: Editable?) {
}
})
carWeight.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().trim() != "") {
val tempWeight = s.toString().toDouble()
//地磅
var dibangWeightDouble = 0.0
if (dibangWeight.text.toString().trim() != "") {
dibangWeightDouble = dibangWeight.text.toString().trim().toDouble()
}
//集装器自重
var uldWeightDouble = 0.0
if (uldWeight.text.toString().trim() != "") {
uldWeightDouble = uldWeight.text.toString().trim().toDouble()
}
//赋值
//装机重
netWeight.setText("${dibangWeightDouble - tempWeight}")
//货重
cargoWeight.setText("${dibangWeightDouble - tempWeight - uldWeightDouble}")
}
}
override fun afterTextChanged(s: Editable?) {
}
})
uldWeight.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().trim() != "") {
val tempWeight = s.toString().toDouble()
//地磅
var dibangWeightDouble = 0.0
if (dibangWeight.text.toString().trim() != "") {
dibangWeightDouble = dibangWeight.text.toString().trim().toDouble()
}
//架子车自重
var carWeightDouble = 0.0
if (carWeight.text.toString().trim() != "") {
carWeightDouble = carWeight.text.toString().trim().toDouble()
}
//赋值
//货重
cargoWeight.setText("${dibangWeightDouble - carWeightDouble - tempWeight}")
}
}
override fun afterTextChanged(s: Editable?) {
}
})
//失去焦点
carId.onFocusChangeListener = View.OnFocusChangeListener { v, hasFocus ->
if (hasFocus) {
} else {
//失去焦点
// viewModel.queryFlatcarGjcReceive(carId.text.toString())
viewModel.getBoxDetailsByCarId(carId.text.toString())
}
}
uld.onFocusChangeListener = View.OnFocusChangeListener { v, hasFocus ->
if (hasFocus) {
} else {
//失去焦点
viewModel.queryUldGjcReceive(uld.text.toString())
}
}
fno.onFocusChangeListener = View.OnFocusChangeListener { v, hasFocus ->
if (hasFocus) {
} else {
if (fdate.text.toString() != "" && fno.text.toString() != "") {
viewModel.queryFlight(fdate.text.toString(), fno.text.toString())
}
}
}
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)
}
}
}
})
//赋值
viewModel.fuBangInfo.cargoType = "0"//货物类型初始化 默认 0-> 计重货
}
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_gjc_fu_bang)
setBackArrow("板箱过磅")
viewModel = ViewModelProvider(this).get(GjcFuBangViewModel::class.java)
initView()
//监听完成过磅
viewModel.completedObserver.observe(this) {
loadingCancel()
val status = it.getString("status")
val data = it.getString("data")
if (Constant.Result.succ == status) {
if (data == "1") {
carId.setText("")
Common.alertDialog(this, "完成过磅!") { dialog ->
resetData()
dialog.dismiss()
}
} else if (data == "3") {
Common.alertDialog(this, "航班不存在!") { dialog ->
dialog.dismiss()
}
} else if (data == "4") {
Common.alertDialog(this, "航班已关闭!") { dialog ->
dialog.dismiss()
}
} else if (data == "5") {
Common.alertDialog(this, "航班已截载!") { dialog ->
dialog.dismiss()
}
} else {
Common.alertDialog(this, "过磅失败!") { dialog ->
dialog.dismiss()
}
}
} else {
// Common.showToastLong(this, "收运失败! ")
Common.alertDialog(this, "过磅失败!") { dialog ->
dialog.dismiss()
}
}
}
//集装器编号,查询集装器自重
viewModel.queryUldGjcReceiveObserver.observe(this) {
loadingCancel()
val status = it.getString("status")
val data = it.getJSONObject("data")
if (Constant.Result.succ == status && data != null) {
val uldWeightTemp = data.getIntValue("uldWeight")
uldWeight.setText("$uldWeightTemp")
}
}
//托盘编号,查询集装器自重
viewModel.queryFlatcarGjcReceiveObserver.observe(this) {
loadingCancel()
val status = it.getString("status")
val data = it.getJSONObject("data")
if (Constant.Result.succ == status && data != null) {
val carWeightTemp = data.getIntValue("carWeight")
carWeight.setText("$carWeightTemp")
}
}
//航班返回结果
viewModel.queryFlightObserver.observe(this) {
loadingCancel()
val status = it.getString("status")
if (Constant.Result.succ == status) {
var jsonObject = it.getJSONObject("data")
val countryName = jsonObject.getString("countryName")
val countryType = jsonObject.getString("countryType")
val dep = jsonObject.getString("fdep")
val dest = jsonObject.getString("fdest")
fdest.setText(dest)
} else {
fdest.setText("")
}
}
//下拉框赋值
val plClose = JSONObject()
plClose["code"] = ""
plClose["name"] = "请选择"
val plClose1 = JSONObject()
plClose1["code"] = "探板"
plClose1["name"] = "探板"
val plClose2 = JSONObject()
plClose2["code"] = "收口"
plClose2["name"] = "收口"
viewModel.plCloseList.add(plClose)
viewModel.plCloseList.add(plClose1)
viewModel.plCloseList.add(plClose2)
viewModel.cargoSelect(System.currentTimeMillis().toString())
viewModel.cargoObserver.observe(this) { vd ->
viewModel.cargoList = vd.getJSONArray("data")
for ((index, obj) in viewModel.cargoList.withIndex()) {
val tempObj = obj as JSONObject
val name = tempObj.getString("name")
val code = tempObj.getString("code")
if (viewModel.fuBangInfo.cargoType == code) {
cargoType.text = name
}
}
}
viewModel.boxDetails.observe(this) {
it.gjcLoading?.firstOrNull()?.let { bean ->
uld.setText(bean.uld.noNull())
carWeight.setText(it.carweight.noNull())
uldWeight.setText(bean.uldweight.noNull())
fdate.text = bean.fdate.noNull()
fno.setText(bean.fno.noNull())
fdest.setText(bean.dest.noNull())
bean.cargotype?.let { cargoType ->
viewModel.cargoList.forEach { cargo ->
val cargoObj = cargo as JSONObject
if (cargoObj.getString("code") == cargoType) {
this.cargoType.text = cargoObj.getString("name")
viewModel.fuBangInfo.cargoType = cargoObj.getString("code")
}
}
}
}
}
}
override fun onClick(v: View?) {
v?.let {
when (it.id) {
R.id.carIdScan -> {
scanCode(Constant.RequestCode.gjc_fubang_car_id)
}
R.id.uldScan -> {
scanCode(Constant.RequestCode.gjc_fubang_uld_id)
}
R.id.dibangWeightScan -> {
dibangWeight.setText("")
}
R.id.plClose -> {
Common.singleSelect(
this,
"探板收口",
viewModel.plCloseList,
viewModel.fuBangInfo.plClose
) { position, item ->
val jsonObject = item as JSONObject
val name = jsonObject.getString("name")
val code = jsonObject.getString("code")
plClose.text = name
viewModel.fuBangInfo.plClose = code
if (code != "") {
plCloseSizeMust.visibility = View.VISIBLE
plCloseSize.isEnabled = true
} else {
plCloseSizeMust.visibility = View.GONE
plCloseSize.isEnabled = false
}
}
}
R.id.cargoType -> {
Common.singleSelect(
this,
"货物类型",
viewModel.cargoList,
viewModel.fuBangInfo.cargoType
) { position, item ->
val jsonObject = item as JSONObject
val name = jsonObject.getString("name")
val code = jsonObject.getString("code")
cargoType.text = name
viewModel.fuBangInfo.cargoType = code
}
}
R.id.fdate -> {
Common.onYearMonthDay(this, fdate.text.toString()) { year, month, day ->
calendar.set(year, month - 1, day)
val selDate = ymdSdf.format(calendar.time)
fdate.text = selDate
if (selDate != "" && fno.text.toString() != "") {
viewModel.queryFlight(selDate, fno.text.toString())
}
}
}
R.id.submit -> {
if (getAllEditData()) {
Common.secondConfirmDialog(this, "确认过磅") { dialog ->
// viewModel.completed(viewModel.fuBangInfo)
viewModel.onConfirmClick(this, viewModel.fuBangInfo) {
resetData()
}
dialog.dismiss()
}
}
}
else -> {
Toast.makeText(this, "未找到对应操作", Toast.LENGTH_SHORT).show()
}
}
}
}
/**
* 扫码返回的结果
*/
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
super.onActivityResult(requestCode, resultCode, data)
// 扫描二维码/条码回传
if (resultCode == RESULT_OK && data != null) {
val content = data.getStringExtra(com.yzq.zxinglibrary.common.Constant.CODED_CONTENT)
if (content == null) {
Common.showToast(this, "条码错误!")
return
}
when (requestCode) {
Constant.RequestCode.gjc_fubang_car_id -> {
carId.setText(content)
// viewModel.queryFlatcarGjcReceive(content)
viewModel.getBoxDetailsByCarId(content)
}
Constant.RequestCode.gjc_fubang_uld_id -> {
uld.setText(content)
viewModel.queryUldGjcReceive(content)
}
}
}
}
/**
* 同步viewModel的实体类数据
*/
private fun getAllEditData(): Boolean {
if (carId.text.toString() == "") {
Common.showToast(this, "请填写平板车号!")
return false
}
if (uld.text.toString() == "") {
//默认值 BULK
Common.secondConfirmDialog(this, "集装器编号未填写,是否填入默认值!") { dialog ->
uld.setText("BULK")
dialog.dismiss()
}
return false
}
if (netWeight.text.toString() == "" || netWeight.text.toString().toDouble() == 0.0) {
Common.showToast(this, "请填写装机重!")
return false
}
if (cargoWeight.text.toString() == "" || cargoWeight.text.toString().toDouble() == 0.0) {
Common.showToast(this, "请填写货物重量!")
return false
}
if (totalWeight.text.toString() == "" || totalWeight.text.toString().toDouble() == 0.0) {
Common.showToast(this, "请填写总重量!")
return false
}
if (plClose.text.toString() != "") {
if (plCloseSize.text.toString() == null || plCloseSize.text.toString() == "") {
Common.showToast(this, "探板收口大小不能为空!")
return false
}
}
// if (fdate.text.toString() == "") {
// Common.showToast(this, "航班日期不能为空!")
// return false
// }
// if (fno.text.toString() == "") {
// Common.showToast(this, "航班号不能为空!")
// return false
// }
if (fdest.text.toString() == "") {
Common.showToast(this, "请填写目的港!")
return false
}
if (cargoType.text.toString() == "") {
Common.showToast(this, "请填写货物类型!")
return false
}
if (height.text.toString() == "") {
height.setText("0.0")
}
viewModel.fuBangInfo.carId = carId.text.toString()
viewModel.fuBangInfo.uld = uld.text.toString()
viewModel.fuBangInfo.carWeight = carWeight.text.toString().toDouble()
viewModel.fuBangInfo.uldWeight = uldWeight.text.toString().toDouble()
viewModel.fuBangInfo.netWeight = netWeight.text.toString().toDouble()
viewModel.fuBangInfo.dgrCode = dgrCode.text.toString()
viewModel.fuBangInfo.boardType = boardType.text.toString()
viewModel.fuBangInfo.cargoWeight = cargoWeight.text.toString().toDouble()
viewModel.fuBangInfo.plClose = plClose.text.toString()
viewModel.fuBangInfo.plCloseSize = plCloseSize.text.toString()
viewModel.fuBangInfo.totalWeight = totalWeight.text.toString().toDouble()
viewModel.fuBangInfo.height = height.text.toString().toDouble()
viewModel.fuBangInfo.fdate = fdate.text.toString()
viewModel.fuBangInfo.fno = fno.text.toString()
viewModel.fuBangInfo.fdest = fdest.text.toString()
viewModel.fuBangInfo.remark = remark.text.toString()
return true
}
/**
* 清空数据
*/
private fun resetData() {
carId.setText("")
uld.setText("")
dibangWeight.setText("")
carWeight.setText("")
uldWeight.setText("")
netWeight.setText("")
dgrCode.setText("")
boardType.setText("")
cargoWeight.setText("")
plClose.text = ""
plCloseSize.setText("")
totalWeight.setText("")
height.setText("")
calendar.time = Date()
fdate.text = ymdSdf.format(calendar.time)
fno.setText("")
fdest.setText("")
cargoType.text = ""
remark.setText("")
viewModel.fuBangInfo = GjcFuBang()
}
}

View File

@@ -0,0 +1,37 @@
package com.lukouguoji.gjc.activity
import android.content.Context
import android.content.Intent
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import com.lukouguoji.gjc.R
import com.lukouguoji.gjc.databinding.ActivityGjcGoodsAddBinding
import com.lukouguoji.gjc.viewModel.GjcGoodsAddViewModel
import com.lukouguoji.module_base.base.BaseBindingActivity
import com.lukouguoji.module_base.ktx.addOnItemClickListener
class GjcGoodsAddActivity :
BaseBindingActivity<ActivityGjcGoodsAddBinding, GjcGoodsAddViewModel>() {
override fun layoutId() = R.layout.activity_gjc_goods_add
override fun viewModelClass() = GjcGoodsAddViewModel::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, GjcGoodsAddActivity::class.java)
context.startActivity(starter)
}
}
}

View File

@@ -0,0 +1,54 @@
package com.lukouguoji.gjc.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.gjc.R
import com.lukouguoji.gjc.databinding.ActivityGjcGoodsListBinding
import com.lukouguoji.gjc.holder.GjcGoodsViewHolder
import com.lukouguoji.gjc.viewModel.GjcGoodsListViewModel
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.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.addOnItemClickListener
import com.lukouguoji.module_base.router.ARouterConstants
import kotlin.properties.Delegates
@Route(path = ARouterConstants.ACTIVITY_URL_GJC_GOODS_LIST)
class GjcGoodsListActivity :
BaseBindingActivity<ActivityGjcGoodsListBinding, GjcGoodsListViewModel>() {
override fun layoutId() = R.layout.activity_gjc_goods_list
override fun viewModelClass() = GjcGoodsListViewModel::class.java
override fun initOnCreate(savedInstanceState: Bundle?) {
setBackArrow("国际出港货物交接")
binding.viewModel = viewModel
binding.rv.adapter =
CommonAdapter(this, R.layout.item_gjc_goods, GjcGoodsViewHolder::class.java)
viewModel.pageModel.bindSmartRefreshLayout(binding.srl, binding.rv, viewModel, this)
binding.rv.addOnItemClickListener(viewModel)
viewModel.getData()
// 新增成功
FlowBus.with<Any>(ConstantEvent.GJC_HANDOVER_ADD_SUCCESS)
.observe(this) {
viewModel.refresh()
}
// 签名成功
FlowBus.with<Any>(ConstantEvent.GJC_HANDOVER_SIGNATURE_SUCCESS)
.observe(this) {
viewModel.refresh()
}
}
}

View File

@@ -0,0 +1,56 @@
package com.lukouguoji.gjc.activity
import android.content.Context
import android.content.Intent
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import com.lukouguoji.gjc.R
import com.lukouguoji.gjc.databinding.ActivityGjcGoodsManifestBinding
import com.lukouguoji.gjc.viewModel.GjcGoodsManifestViewModel
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 GjcGoodsManifestActivity :
BaseBindingActivity<ActivityGjcGoodsManifestBinding, GjcGoodsManifestViewModel>() {
override fun layoutId() = R.layout.activity_gjc_goods_manifest
override fun viewModelClass() = GjcGoodsManifestViewModel::class.java
override fun initOnCreate(savedInstanceState: Bundle?) {
viewModel.movID = 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, movID: String) {
val starter = Intent(context, GjcGoodsManifestActivity::class.java)
.putExtra(Constant.Key.ID, movID)
context.startActivity(starter)
}
}
}

View File

@@ -0,0 +1,186 @@
package com.lukouguoji.gjc.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.gjc.R
import com.lukouguoji.gjc.adapt.GjcQueryInfoListAdapter
import com.lukouguoji.gjc.adapt.GjcQueryInfoWhListAdapter
import com.lukouguoji.gjc.model.GjcQueryInfo
import com.lukouguoji.gjc.model.GjcQueryInfoWh
import com.lukouguoji.gjc.viewModel.GjcQueryInfoViewModel
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_GJC_QUERY_INFO)
class GjcQueryInfoActivity : BaseActivity(), View.OnClickListener {
private lateinit var viewModel: GjcQueryInfoViewModel
private lateinit var scrollView: NestedScrollView
private lateinit var queryInfoList: RecyclerView
private lateinit var adapter: GjcQueryInfoListAdapter
private val queryInfoAdapterList = arrayListOf<GjcQueryInfo>()
private lateinit var submit: TextView
private lateinit var refWareHouseInfo: LinearLayout
private lateinit var wareHouseInfoLayout: LinearLayout
private lateinit var queryWareHouseInfoList: RecyclerView
private lateinit var wareHouseInfoAdapter: GjcQueryInfoWhListAdapter
private val queryWareHouseInfoAdapterList = arrayListOf<GjcQueryInfoWh>()
@JvmField
@Autowired
var id: Int = -9999
@JvmField
@Autowired
var wbNoParam: String? = null
private fun initView() {
viewModel = ViewModelProvider(this).get(GjcQueryInfoViewModel::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 = GjcQueryInfoListAdapter(this, queryInfoAdapterList)
queryInfoList = findViewById(R.id.gncQueryInfoList)
queryInfoList.adapter = adapter
queryInfoList.layoutManager = layoutManager
val wareHouseLayoutManager = LinearLayoutManager(this)
wareHouseInfoAdapter = GjcQueryInfoWhListAdapter(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_gjc_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")
adapter.append(GjcQueryInfo(1, "运单号", maWbObj.getString("wbNo") ?: ""))
viewModel.wbNo = maWbObj.getString("wbNo")
adapter.append(GjcQueryInfo(1, "件数", maWbObj.getIntValue("pc").toString()))
adapter.append(
GjcQueryInfo(
1,
"重量",
"${maWbObj.getDoubleValue("grossWeight")} KG"
)
)
adapter.append(GjcQueryInfo(1, "承运人", maWbObj.getString("by1") ?: ""))
adapter.append(GjcQueryInfo(1, "目的港", maWbObj.getString("dest") ?: ""))
adapter.append(GjcQueryInfo(1, "品名(英)", maWbObj.getString("goods") ?: ""))
adapter.append(GjcQueryInfo(1, "特码", maWbObj.getString("spCode") ?: ""))
adapter.append(GjcQueryInfo(1, "代理", maWbObj.getString("agent") ?: ""))
adapter.append(GjcQueryInfo(1, "运单类型", maWbObj.getString("awbType") ?: ""))
adapter.append(GjcQueryInfo(1, "业务类型", maWbObj.getString("businessType") ?: ""))
adapter.append(GjcQueryInfo(1, "包装类型", maWbObj.getString("packageType") ?: ""))
/*adapter.append(GjcQueryInfo(1, "卸货港", maWbObj.getString("dest1") ?: ""))
adapter.append(GjcQueryInfo(1, "危险品描述", maWbObj.getString("dgrDetail") ?: ""))
adapter.append(GjcQueryInfo(1, "危险品库位", maWbObj.getString("dgrLocation") ?: ""))
adapter.append(GjcQueryInfo(1, "航班", maWbObj.getString("flight") ?: ""))
adapter.append(GjcQueryInfo(1, "入库时间", maWbObj.getString("opDate") ?: ""))
adapter.append(GjcQueryInfo(1, "出库时间", maWbObj.getString("mclose") ?: ""))
adapter.append(GjcQueryInfo(1, "收运人", maWbObj.getString("opId") ?: ""))*/
//关联仓库详情
val whListArr = viewModel.wayBillInfo.getJSONArray("whList")
whListArr.forEach { waybill ->
val waybillObj = waybill as JSONObject
wareHouseInfoAdapter.append(
GjcQueryInfoWh(
1,
waybillObj.getString("wbNo") ?: "",
waybillObj.getString("location") ?: "",
waybillObj.getIntValue("pc"),
waybillObj.getDoubleValue("weight"),
waybillObj.getString("flight") ?: "",
waybillObj.getString("opDate") ?: "",
waybillObj.getString("mclose") ?: "",
waybillObj.getString("opId") ?: ""
)
)
}
} else {
//无数据
}
}
}
private fun initData() {
queryInfoAdapterList.add(GjcQueryInfo(1, "入库时间", "2021-04-05 15:22:33"))
queryInfoAdapterList.add(GjcQueryInfo(1, "运单号", "A014d384"))
queryInfoAdapterList.add(GjcQueryInfo(1, "代理人", "张三"))
queryInfoAdapterList.add(GjcQueryInfo(1, "特码", "A06"))
queryInfoAdapterList.add(GjcQueryInfo(1, "件数", "39件"))
queryInfoAdapterList.add(GjcQueryInfo(1, "重量", "30kg"))
queryInfoAdapterList.add(GjcQueryInfo(1, "品名(英)", "TF"))
queryInfoAdapterList.add(GjcQueryInfo(1, "目的港", "白云国际机场"))
queryInfoAdapterList.add(GjcQueryInfo(1, "航班号", "U23"))
queryInfoAdapterList.add(GjcQueryInfo(1, "运单类型", "配载单"))
queryInfoAdapterList.add(GjcQueryInfo(1, "承运人", "SF"))
queryInfoAdapterList.add(GjcQueryInfo(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.exportStatus)
.withString("wbNoParam", viewModel.wbNo)
.navigation()
}
else -> {
Toast.makeText(this, "未找到对应操作", Toast.LENGTH_SHORT).show()
}
}
}
}
}

View File

@@ -0,0 +1,503 @@
package com.lukouguoji.gjc.activity
import android.content.Intent
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.gjc.R
import com.lukouguoji.gjc.adapt.GjcQueryListAdapter
import com.lukouguoji.gjc.model.GjcQueryList
import com.lukouguoji.gjc.viewModel.GjcQueryListViewModel
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_GJC_QUERY_LIST)
class GjcQueryListActivity : BaseActivity(), View.OnClickListener {
private val currentTitleName = "国际出港查询"
private lateinit var viewModel: GjcQueryListViewModel
private lateinit var adapter: GjcQueryListAdapter
private val collectList = ArrayList<GjcQueryList>()
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 searchListFragment: LinearLayout
private lateinit var filtrateLayout: LinearLayout
private lateinit var wbNo: EditText
private lateinit var fno: EditText
private lateinit var startDate: TextView
private lateinit var endDate: TextView
private lateinit var mudiGang: EditText
private lateinit var searchLayout: LinearLayout
private lateinit var summaryText: TextView
//筛选页
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(GjcQueryListViewModel::class.java)
val layoutManager = LinearLayoutManager(this)
adapter = GjcQueryListAdapter(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)
startDate = findViewById(R.id.startDate)
endDate = findViewById(R.id.endDate)
mudiGang = findViewById(R.id.mudiGang)
searchLayout = findViewById(R.id.searchLayout)
summaryText = findViewById(R.id.summaryText)
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)
startDate.setOnClickListener(this)
endDate.setOnClickListener(this)
spCode.setOnClickListener(this)
agentCode.setOnClickListener(this)
businessType.setOnClickListener(this)
awbType.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)
}
}
}
})
val format = ymdSdf.format(Date())
startDate.text = format
endDate.text = format
}
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_gjc_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("wbNo") ?: ""
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 fclose = itemObj.getString("actualTakeOff") ?: ""
val awbType = itemObj.getString("awbType") ?: ""
val pc = itemObj.getString("pc") ?: ""
val weight = itemObj.getString("grossWeight") ?: ""
collectList.add(GjcQueryList(id, wbNo, agentCode, spCode, goods, flight, range, fclose, awbType, pc, weight))
}
//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("GROSSWEIGHT")
summaryText.text = "总票数:$totalTemp,总件数:$totalPcTemp,总重量:$totalWeightTemp"
} else {
//无数据
}
}
/////////////// 下拉框 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.IO)
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.IO)
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.startDate -> {
Common.onYearMonthDay(this, startDate.text.toString()) { year, month, day ->
calendar.set(year, month - 1, day)
startDate.text = ymdSdf.format(calendar.time)
}
}
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.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,
startDate.text.toString(),
endDate.text.toString(),
"",// fdate.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("")
val format = ymdSdf.format(Date())
startDate.text = format
calendar.time = Date()
endDate.text = format
fno.setText("")
spCode.text = ""
spCodeValue = ""
agentCode.text = ""
agentCodeValue = ""
goods.setText("")
businessType.text = ""
businessTypeValue = ""
awbType.text = ""
awbTypeValue = ""
}
}

View File

@@ -0,0 +1,176 @@
package com.lukouguoji.gjc.activity
import android.content.Intent
import android.os.Bundle
import android.view.View
import android.widget.EditText
import android.widget.ImageView
import android.widget.TextView
import androidx.lifecycle.ViewModelProvider
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.alibaba.android.arouter.facade.annotation.Route
import com.alibaba.android.arouter.launcher.ARouter
import com.alibaba.fastjson.JSONArray
import com.alibaba.fastjson.JSONObject
import com.lukouguoji.gjc.R
import com.lukouguoji.gjc.adapt.GjcReceiveListAdapter
import com.lukouguoji.gjc.model.GjcReceive
import com.lukouguoji.gjc.viewModel.GjcReceiveListViewModel
import com.lukouguoji.module_base.BaseActivity
import com.lukouguoji.module_base.router.ARouterConstants
import com.scwang.smart.refresh.footer.ClassicsFooter
import com.scwang.smart.refresh.header.ClassicsHeader
import com.scwang.smart.refresh.layout.api.RefreshLayout
import com.yzq.zxinglibrary.common.Constant
import java.util.*
@Route(path = ARouterConstants.ACTIVITY_URL_GJC_RECEIVE_LIST)
class GjcReceiveListActivity : BaseActivity() {
private lateinit var adapter: GjcReceiveListAdapter
private val collectList = ArrayList<GjcReceive>()
private var currentPage = 1
private var pageSize = 10
private var totalPage = 0
private var text = ""
private lateinit var refreshLayout: RefreshLayout
private lateinit var search: TextView
private lateinit var wbNo: EditText
private lateinit var wbNoScanIcon: ImageView
//是否刷新
private var refresh = false
private lateinit var viewModel: GjcReceiveListViewModel
private fun initView() {
search = findViewById(R.id.search)
wbNo = findViewById(R.id.wbNo)
wbNoScanIcon = findViewById(R.id.wbNoScanIcon)
}
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_gjc_receive_list)
setBackArrow("国际出港待收运")
initView()
viewModel = ViewModelProvider(this).get(GjcReceiveListViewModel::class.java)
val layoutManager = LinearLayoutManager(this)
adapter = GjcReceiveListAdapter(this, collectList)
var recyclerView: RecyclerView = findViewById(R.id.guo_nei_collect_list)
recyclerView.layoutManager = layoutManager
recyclerView.adapter = adapter
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 mawbId = itemObj.getIntValue("maWbId")
val wbNo = itemObj.getString("wbNo") ?: ""
val pc = itemObj.getIntValue("pc")
val weight = itemObj.getDoubleValue("grossWeight")
val agentCode = itemObj.getString("agent") ?: ""
val spCode = itemObj.getString("spCode") ?: ""
val goods = itemObj.getString("goodsCn") ?: ""
val flight = itemObj.getString("flight") ?: ""
val businessType = itemObj.getString("businessType") ?: ""
collectList.add(GjcReceive(mawbId, wbNo, pc, weight, agentCode, spCode, goods, flight, businessType))
}
//3.调adpter展示
if (currentPage == 1) {
adapter.notifyDataSetChanged()
} else {
adapter.notifyItemRangeInserted((currentPage - 1) * 10, collectList.size)
}
refreshLayout.finishRefresh()
refreshLayout.finishLoadMore()
}
}
//初始化查询
viewModel.search(pageSize, currentPage, text)
loading()
/////////////////////////////// 加载刷新的布局
refreshLayout = findViewById<View>(R.id.refreshLayout) as RefreshLayout
refreshLayout.setRefreshHeader(ClassicsHeader(this))
refreshLayout.setRefreshFooter(ClassicsFooter(this))
/////////////////////////////// 下拉刷新
refreshLayout.setOnRefreshListener {
refresh = true
currentPage = 1
//recyclerView 清除所有数据数据
adapter.notifyItemRangeRemoved(0, collectList.size)
collectList.clear()
//初始化查询
viewModel.search(pageSize, currentPage, text)
adapter.notifyItemRangeInserted(0, collectList.size)
}
/////////////////////////////// 上拉加载
refreshLayout.setOnLoadMoreListener {
refresh = false
if (currentPage < totalPage) {
currentPage++
//初始化查询
viewModel.search(pageSize, currentPage, text)
} else {
refreshLayout.finishLoadMoreWithNoMoreData()
}
}
search.setOnClickListener {
currentPage = 1
//recyclerView 清除所有数据数据
adapter.notifyItemRangeRemoved(0, collectList.size)
collectList.clear()
//初始化查询
viewModel.search(pageSize, currentPage, wbNo.text.toString())
}
//点击扫码
wbNoScanIcon.setOnClickListener {
scanCode(com.lukouguoji.module_base.common.Constant.RequestCode.gjc_shouyun_search)
}
}
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
super.onActivityResult(requestCode, resultCode, data)
// 扫描二维码/条码回传
if (requestCode == com.lukouguoji.module_base.common.Constant.RequestCode.gjc_shouyun_search) {
if (data != null) {
val content = data.getStringExtra(Constant.CODED_CONTENT)
wbNo.setText("$content")
//调用接口查询进入详情页
if (content != null && content != "") {
ARouter.getInstance().build(ARouterConstants.ACTIVITY_URL_GJC_START_RECEIVE).withString("wbNoParam", content)
.navigation(this)
}
}
}
if (requestCode == com.lukouguoji.module_base.common.Constant.RequestCode.gjc_shouyun_refresh && resultCode == RESULT_OK) {
collectList.clear()
currentPage = 1
refreshLayout.setNoMoreData(false)
viewModel.search(10, currentPage, "")
loading()
}
}
}

View File

@@ -0,0 +1,615 @@
package com.lukouguoji.gjc.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.core.content.ContextCompat
import androidx.lifecycle.ViewModelProvider
import com.alibaba.android.arouter.facade.annotation.Autowired
import com.alibaba.android.arouter.facade.annotation.Route
import com.alibaba.fastjson.JSONObject
import com.lukouguoji.gjc.R
import com.lukouguoji.gjc.model.GjcStartReceiveWaybill
import com.lukouguoji.gjc.viewModel.GjcStartReceiveViewModel
import com.lukouguoji.module_base.BaseActivity
import com.lukouguoji.module_base.MyApplication
import com.lukouguoji.module_base.common.Constant
import com.lukouguoji.module_base.router.ARouterConstants
import com.lukouguoji.module_base.util.Arith
import com.lukouguoji.module_base.util.Common
import java.text.SimpleDateFormat
import kotlin.math.abs
@Route(path = ARouterConstants.ACTIVITY_URL_GJC_START_RECEIVE)
class GjcStartReceiveActivity : BaseActivity(), View.OnClickListener {
private lateinit var finishCollect: TextView
private lateinit var viewModel: GjcStartReceiveViewModel
private lateinit var wbNo: EditText
private lateinit var wbNoScan: ImageView
private lateinit var diBangWeight: EditText
private lateinit var tuoPanCode: EditText
private lateinit var tuoPanScan: ImageView
private lateinit var tuoPanWeight: EditText
private lateinit var spCode: Button
private lateinit var jiZhuangCode: EditText
private lateinit var jiZhuangScan: ImageView
private lateinit var jiZhuangWeight: EditText
private lateinit var pc: EditText
private lateinit var weight: EditText
private lateinit var volume: EditText
private lateinit var arrivePc: EditText
private lateinit var arriveWeight: EditText
private lateinit var arriveVolume: EditText
private lateinit var tuoPanWeightCheck: TextView
private lateinit var jiZhuangCheck: TextView
private lateinit var businessType: Button
private lateinit var remark: EditText
var simpleDateFormat = SimpleDateFormat("yyyy-MM-dd")
@JvmField
@Autowired
var wbId: Int = -9999
@JvmField
@Autowired
var wbNoParam: String? = null
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_gjc_start_receive)
setBackArrow("开始收运")
initView()
viewModel = ViewModelProvider(this).get(GjcStartReceiveViewModel::class.java)
val dgrObj = JSONObject()
dgrObj["name"] = "请选择"
dgrObj["code"] = ""
viewModel.dgrDetailList.add(dgrObj)
viewModel.queryWaybillById(wbId, wbNoParam)
viewModel.waybillLiveData.observe(this) {
val status = it.getString("status")
if (Constant.Result.succ == status) {
var jsonObject = it.getJSONObject("data")
viewModel.waybillFormNetWork = jsonObject
val checkIn = jsonObject.getString("checkIn")
if (checkIn == "1") {
Common.showToast(this, "该订单收运已完成,不可再收运!")
return@observe
}
viewModel.receiveWaybill.maWbId = jsonObject.getIntValue("maWbId")
viewModel.receiveWaybill.prefix = jsonObject.getString("prefix") ?: ""
viewModel.receiveWaybill.no = jsonObject.getString("no") ?: ""
viewModel.receiveWaybill.wbNo = jsonObject.getString("wbNo") ?: ""
viewModel.receiveWaybill.agentCode = jsonObject.getString("agentCode") ?: ""
viewModel.receiveWaybill.goods = jsonObject.getString("goods") ?: ""
viewModel.receiveWaybill.spCode = jsonObject.getString("spCode") ?: ""
viewModel.receiveWaybill.businessType = jsonObject.getString("businessType") ?: ""
viewModel.receiveWaybill.pc = jsonObject.getIntValue("pc")
viewModel.receiveWaybill.weight = jsonObject.getDoubleValue("grossWeight")
viewModel.receiveWaybill.volume = jsonObject.getDoubleValue("volume")
viewModel.receiveWaybill.arrivePc = jsonObject.getIntValue("arrivePc")
viewModel.receiveWaybill.arriveWeight = jsonObject.getDoubleValue("arriveWeight")
viewModel.receiveWaybill.arriveVolume = jsonObject.getDoubleValue("arriveVolume")
viewModel.receiveWaybill.remark = jsonObject.getString("remark") ?: ""
viewModel.receiveWaybill.activeId = jsonObject.getIntValue("activeId")
viewModel.receiveWaybill.awbType = jsonObject.getString("awbType")
viewModel.receiveWaybill.dep = jsonObject.getString("dep") ?: ""
viewModel.receiveWaybill.dest = jsonObject.getString("dest") ?: ""
viewModel.receiveWaybill.dest1 = jsonObject.getString("dest1") ?: ""
viewModel.receiveWaybill.by1 = jsonObject.getString("by1") ?: ""
viewModel.receiveWaybill.checkIn = jsonObject.getString("checkIn") ?: ""
wbNo.setText(viewModel.receiveWaybill.wbNo)
pc.setText(viewModel.receiveWaybill.pc.toString())
weight.setText(viewModel.receiveWaybill.weight.toString())
volume.setText(viewModel.receiveWaybill.volume.toString())
remark.setText(viewModel.receiveWaybill.remark)
//下拉框赋值
viewModel.business(Constant.businessType.IO)
viewModel.businessObserver.observe(this) { vd ->
viewModel.businessList = vd.getJSONArray("data")
for ((index, obj) in viewModel.businessList.withIndex()) {
val tempObj = obj as JSONObject
val name = tempObj.getString("name")
val code = tempObj.getString("code")
if (viewModel.receiveWaybill.businessType == code) {
businessType.text = name
}
}
}
viewModel.specialCode(System.currentTimeMillis().toString())
viewModel.specialCodeObserver.observe(this) { vd ->
viewModel.specialCodeList = vd.getJSONArray("data")
for ((index, obj) in viewModel.specialCodeList.withIndex()) {
val tempObj = obj as JSONObject
var code = tempObj.getString("code")
var name = tempObj.getString("name")
if (viewModel.receiveWaybill.spCode == code) {
spCode.text = name
}
}
}
} else {
//无数据
}
}
//监听完成收运
viewModel.completedObserver.observe(this) {
loadingCancel()
val status = it.getString("status")
val data = it.getString("data")
val msg = it.getString("msg")
if (Constant.Result.succ == status) {
if (data == Constant.Result.succ) {
reset()
}
Common.alertDialog(this, msg) { dialog ->
dialog.dismiss()
}
} else {
Common.alertDialog(this, "收运失败!") { dialog ->
dialog.dismiss()
}
}
}
//集装器编号,查询集装器自重
viewModel.queryUldGjcReceiveObserver.observe(this) {
loadingCancel()
val status = it.getString("status")
val data = it.getJSONObject("data")
if (Constant.Result.succ == status && data != null) {
var uldWeight = data.getIntValue("uldWeight")
jiZhuangWeight.setText("$uldWeight")
val uldWeightDb = uldWeight.toDouble()
val diBangWeightDb = diBangWeight.text.toString().toDouble()
if (mt3percent(uldWeightDb - diBangWeightDb, uldWeightDb)) {
jiZhuangCheck.isEnabled = true
jiZhuangCheck.background = ContextCompat.getDrawable(this, R.drawable.submit_shape)
} else {
jiZhuangCheck.isEnabled = false
jiZhuangCheck.background = ContextCompat.getDrawable(this, R.drawable.input_shape)
}
}
}
//集装器编号,校验集装器重量
viewModel.updateUldGjcReceiveObserver.observe(this) {
loadingCancel()
val status = it.getString("status")
val data = it.getString("data")
if (Constant.Result.succ == status && Constant.Result.succ == data) {
jiZhuangWeight.setText(diBangWeight.text.toString())
} else {
Common.alertDialog(this, "校验失败!") { dialog ->
dialog.dismiss()
}
}
}
//托盘编号,查询集装器自重
viewModel.queryFlatcarGjcReceiveObserver.observe(this) {
loadingCancel()
val status = it.getString("status")
val data = it.getJSONObject("data")
if (Constant.Result.succ == status && data != null) {
var carWeight = data.getIntValue("carWeight")
tuoPanWeight.setText("$carWeight")
val carWeightDb = carWeight.toDouble()
val diBangWeightDb = diBangWeight.text.toString().toDouble()
if (mt3percent(carWeightDb - diBangWeightDb, carWeightDb)) {
tuoPanWeightCheck.isEnabled = true
tuoPanWeightCheck.background = ContextCompat.getDrawable(this, R.drawable.submit_shape)
} else {
tuoPanWeightCheck.isEnabled = false
tuoPanWeightCheck.background = ContextCompat.getDrawable(this, R.drawable.input_shape)
}
}
}
//托盘编号,校验平板车重量
viewModel.updateFlatcarGjcReceiveObserver.observe(this) {
loadingCancel()
val status = it.getString("status")
val data = it.getString("data")
if (Constant.Result.succ == status && Constant.Result.succ == data) {
tuoPanWeight.setText(diBangWeight.text.toString())
} else {
Common.alertDialog(this, "校验失败!") { dialog ->
dialog.dismiss()
}
}
}
}
/////////onCreate 结束
private fun initView() {
finishCollect = findViewById(R.id.finish_collect)
wbNo = findViewById(R.id.wbNo)
wbNoScan = findViewById(R.id.wbNo_scan)
diBangWeight = findViewById(R.id.diBangWeight)
tuoPanCode = findViewById(R.id.tuoPanCode)
tuoPanScan = findViewById(R.id.tuoPanScan)
tuoPanWeight = findViewById(R.id.tuoPanWeight)
spCode = findViewById(R.id.spCode)
jiZhuangCode = findViewById(R.id.jiZhuangCode)
jiZhuangScan = findViewById(R.id.jiZhuangScan)
jiZhuangWeight = findViewById(R.id.jiZhuangWeight)
pc = findViewById(R.id.pc)
weight = findViewById(R.id.weight)
volume = findViewById(R.id.volume)
arrivePc = findViewById(R.id.arrivePc)
arriveWeight = findViewById(R.id.arriveWeight)
arriveVolume = findViewById(R.id.arriveVolume)
businessType = findViewById(R.id.businessType)
remark = findViewById(R.id.remark)
tuoPanWeightCheck = findViewById(R.id.tuoPanWeightCheck)
jiZhuangCheck = findViewById(R.id.jiZhuangCheck)
//////////////// 绑定点击事件
// fenDou.setOnClickListener(this)
finishCollect.setOnClickListener(this)
wbNoScan.setOnClickListener(this)
tuoPanScan.setOnClickListener(this)
jiZhuangScan.setOnClickListener(this)
businessType.setOnClickListener(this)
spCode.setOnClickListener(this)
tuoPanWeightCheck.setOnClickListener(this)
jiZhuangCheck.setOnClickListener(this)
///////////// 监听edittext变化
diBangWeight.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) {
var tempWeight = "0.0"
if (s != null && s.toString().trim() != "") {
tempWeight = s.toString()
}
var tuoPanWeightDouble = 0.0
if (tuoPanWeight.text.toString() != "") {
tuoPanWeightDouble = tuoPanWeight.text.toString().toDouble()
} else {
tuoPanWeightDouble = 0.0
}
var jiZhuangWeightDouble = 0.0
if (jiZhuangWeight.text.toString() != "") {
jiZhuangWeightDouble = jiZhuangWeight.text.toString().toDouble()
} else {
jiZhuangWeightDouble = 0.0
}
val arriveWeightTemp = tempWeight.toDouble() - tuoPanWeightDouble - jiZhuangWeightDouble
arriveWeight.setText(arriveWeightTemp.toString())
arriveVolume.setText(Arith.div(arriveWeightTemp, 220.0, 2).toString())
//校验集装器差值
if (mt3percent(jiZhuangWeightDouble - tempWeight.toDouble(), jiZhuangWeightDouble)) {
jiZhuangCheck.isEnabled = true
jiZhuangCheck.background = ContextCompat.getDrawable(MyApplication.context, R.drawable.submit_shape)
} else {
jiZhuangCheck.isEnabled = false
jiZhuangCheck.background = ContextCompat.getDrawable(MyApplication.context, R.drawable.input_shape)
}
//校验托盘差值
if (mt3percent(tuoPanWeightDouble - tempWeight.toDouble(), tuoPanWeightDouble)) {
tuoPanWeightCheck.isEnabled = true
tuoPanWeightCheck.background = ContextCompat.getDrawable(MyApplication.context, R.drawable.submit_shape)
} else {
tuoPanWeightCheck.isEnabled = false
tuoPanWeightCheck.background = ContextCompat.getDrawable(MyApplication.context, R.drawable.input_shape)
}
}
override fun afterTextChanged(s: Editable?) {
}
})
jiZhuangWeight.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().trim() != "") {
val tempWeight = s.toString()
var diBangWeightDouble = 0.0
if (diBangWeight.text.toString() != "") {
diBangWeightDouble = diBangWeight.text.toString().toDouble()
} else {
diBangWeightDouble = 0.0
}
var tuoPanWeightDouble = 0.0
if (tuoPanWeight.text.toString() != "") {
tuoPanWeightDouble = tuoPanWeight.text.toString().toDouble()
} else {
tuoPanWeightDouble = 0.0
}
val arriveWeightTemp = diBangWeightDouble - tempWeight.toDouble() - tuoPanWeightDouble
arriveWeight.setText(arriveWeightTemp.toString())
arriveVolume.setText(Arith.div(arriveWeightTemp, 220.0, 2).toString())
}
}
override fun afterTextChanged(s: Editable?) {
}
})
tuoPanWeight.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().trim() != "") {
val tempWeight = s.toString()
var diBangWeightDouble = 0.0
if (diBangWeight.text.toString() != "") {
diBangWeightDouble = diBangWeight.text.toString().toDouble()
} else {
diBangWeightDouble = 0.0
}
var jiZhuangWeightDouble = 0.0
if (jiZhuangWeight.text.toString() != "") {
jiZhuangWeightDouble = jiZhuangWeight.text.toString().toDouble()
} else {
jiZhuangWeightDouble = 0.0
}
val arriveWeightTemp = diBangWeightDouble - tempWeight.toDouble() - jiZhuangWeightDouble
arriveWeight.setText(arriveWeightTemp.toString())
arriveVolume.setText(Arith.div(arriveWeightTemp, 220.0, 2).toString())
}
}
override fun afterTextChanged(s: Editable?) {
}
})
//点击确认
/* uld.setOnEditorActionListener { v, actionId, event ->
if (actionId == EditorInfo.IME_ACTION_DONE) {
// uld.setText(fill0AndQueryActiveCar(uld.text.toString()))
}
false
}*/
//失去焦点
tuoPanCode.onFocusChangeListener = View.OnFocusChangeListener { v, hasFocus ->
if (hasFocus) {
} else {
//失去焦点
viewModel.queryFlatcarGjcReceive(tuoPanCode.text.toString())
}
}
jiZhuangCode.onFocusChangeListener = View.OnFocusChangeListener { v, hasFocus ->
if (hasFocus) {
} else {
//失去焦点
viewModel.queryUldGjcReceive(jiZhuangCode.text.toString())
}
}
}
override fun onClick(v: View?) {
v?.let {
when (it.id) {
R.id.finish_collect -> {
if (getAllEditData()) {
Common.secondConfirmDialog(this, "是否确认收运") { dialog ->
viewModel.completed(viewModel.receiveWaybill)
dialog.dismiss()
loading()
}
}
}
R.id.wbNo_scan -> {
scanCode(Constant.RequestCode.gjc_shouyun_waybill)
}
R.id.tuoPanScan -> {
scanCode(Constant.RequestCode.gjc_shouyun_tuopan)
}
R.id.jiZhuangScan -> {
scanCode(Constant.RequestCode.gjc_shouyun_jizhuang)
}
R.id.tuoPanWeightCheck -> {
Common.secondConfirmDialog(this, "是否校验此托盘重量?") { dialog ->
viewModel.updateFlatcarGjcReceive(tuoPanCode.text.toString(), diBangWeight.text.toString().toDouble())
dialog.dismiss()
loading()
}
}
R.id.jiZhuangCheck -> {
Common.secondConfirmDialog(this, "是否校验此集装器重量?") { dialog ->
viewModel.updateUldGjcReceive(jiZhuangCode.text.toString(), diBangWeight.text.toString().toDouble())
dialog.dismiss()
loading()
}
}
R.id.businessType -> {
Common.singleSelect(this, "业务类型", viewModel.businessList, viewModel.receiveWaybill.businessType) { position, item ->
val jsonObject = item as JSONObject
val name = jsonObject.getString("name")
val code = jsonObject.getString("code")
businessType.text = name
viewModel.receiveWaybill.businessType = code
}
}
R.id.spCode -> {
Common.singleSelect(this, "特码", viewModel.specialCodeList, viewModel.receiveWaybill.spCode) { position, item ->
val jsonObject = item as JSONObject
val name = jsonObject.getString("name")
val code = jsonObject.getString("code")
spCode.text = name
viewModel.receiveWaybill.spCode = code
}
}
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.gjc_shouyun_waybill -> {
wbNo.setText("$content")
viewModel.queryWaybillById(-9999, content)
}
Constant.RequestCode.gjc_shouyun_tuopan -> {
tuoPanCode.setText("$content")
viewModel.queryFlatcarGjcReceive(content)
}
Constant.RequestCode.gjc_shouyun_jizhuang -> {
jiZhuangCode.setText("$content")
viewModel.queryUldGjcReceive(content)
}
}
}
}
/**
* 同步viewModel的实体类数据
*/
private fun getAllEditData(): Boolean {
viewModel.receiveWaybill.wbNo = wbNo.text.toString()
viewModel.receiveWaybill.arrivePc = arrivePc.text.toString().toIntOrNull() ?: 0
viewModel.receiveWaybill.arriveWeight = arriveWeight.text.toString().toDoubleOrNull() ?: 0.0
viewModel.receiveWaybill.arriveVolume = arriveVolume.text.toString().toDoubleOrNull() ?: 0.0
viewModel.receiveWaybill.remark = remark.text.toString()
if (viewModel.receiveWaybill.wbNo == "") {
Common.showToast(this, "请填写运单号!")
return false
}
if (viewModel.receiveWaybill.arrivePc < 1) {
Common.showToast(this, "请填写件数!")
return false
}
if (viewModel.receiveWaybill.spCode == "") {
Common.showToast(this, "特码不能为空!")
return false
}
if (viewModel.receiveWaybill.arriveWeight == 0.0) {
Common.showToast(this, "请填写重量!")
return false
}
if (viewModel.receiveWaybill.arriveVolume == 0.0) {
Common.showToast(this, "请填写体积!")
return false
}
if (viewModel.receiveWaybill.businessType == "") {
Common.showToast(this, "业务类型不能为空!")
return false
}
return true
}
override fun setBackArrow(title: String) {
setResult(RESULT_OK)
super.setBackArrow(title)
}
/**
* 重置数据
*/
private fun reset() {
wbNo.setText("")
diBangWeight.setText("")
pc.setText("")
weight.setText("")
volume.setText("")
arrivePc.setText("")
arriveWeight.setText("")
arriveVolume.setText("")
jiZhuangCode.setText("")
jiZhuangWeight.setText("")
spCode.text = ""
businessType.text = ""
tuoPanCode.setText("")
tuoPanWeight.setText("")
remark.setText("")
//清空
viewModel.receiveWaybill = GjcStartReceiveWaybill()
}
/**
* 是否超过百分之三
*/
private fun mt3percent(num1: Double, num2: Double): Boolean {
if (num2 == 0.0) {
return false
}
val tempNum = abs(num1)
val div = Arith.div(tempNum, num2, 3) * 100
return div > 3
}
}

View File

@@ -0,0 +1,39 @@
package com.lukouguoji.gjc.activity
import android.content.Context
import android.content.Intent
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import com.lukouguoji.gjc.R
import com.lukouguoji.gjc.databinding.ActivityGjcUnLoadListBinding
import com.lukouguoji.gjc.viewModel.GjcUnLoadListViewModel
import com.lukouguoji.module_base.base.BaseBindingActivity
import com.lukouguoji.module_base.common.Constant
import com.lukouguoji.module_base.ktx.addOnItemClickListener
import com.lukouguoji.module_base.ktx.noNull
class GjcUnLoadListActivity :
BaseBindingActivity<ActivityGjcUnLoadListBinding, GjcUnLoadListViewModel>() {
override fun layoutId() = R.layout.activity_gjc_un_load_list
override fun viewModelClass() = GjcUnLoadListViewModel::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.refresh()
}
companion object {
@JvmStatic
fun start(context: Context) {
val starter = Intent(context, GjcUnLoadListActivity::class.java)
context.startActivity(starter)
}
}
}

View File

@@ -0,0 +1,532 @@
package com.lukouguoji.gjc.activity
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.gjc.R
import com.lukouguoji.gjc.adapt.GjcWareHouseListAdapter
import com.lukouguoji.gjc.model.GjcWareHouseList
import com.lukouguoji.gjc.viewModel.GjcWareHouseListViewModel
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_GJC_WARE_HOUSE)
class GjcWareHouseActivity : BaseActivity(), View.OnClickListener {
private lateinit var viewModel: GjcWareHouseListViewModel
private val currentTitleName = "国际出港仓库管理"
private lateinit var adapter: GjcWareHouseListAdapter
private val collectList = ArrayList<GjcWareHouseList>()
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 startDate: TextView
// private lateinit var endDate: TextView
// private lateinit var flightDate: TextView
// private lateinit var flightDateIcon: ImageView
// private lateinit var flightNo: EditText
private lateinit var mudiGang: EditText
private lateinit var searchLayout: LinearLayout
private lateinit var summaryText: TextView
//筛选页
private lateinit var filtrateLayout: LinearLayout
private lateinit var filtrateFragment: LinearLayout
private lateinit var isGroup: TextView
private var isGroupStatus = ""
private val isGroupArr = JSONArray()
private lateinit var agentCode: TextView
private var agentCodeValue = ""
private lateinit var carrier: EditText
private lateinit var businessType: TextView
private var businessTypeValue = ""
private lateinit var wayNo: EditText
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(GjcWareHouseListViewModel::class.java)
val layoutManager = LinearLayoutManager(this)
adapter = GjcWareHouseListAdapter(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)
// startDate = findViewById(R.id.startDate)
// endDate = findViewById(R.id.endDate)
// flightDate = findViewById(R.id.flightDate)
// flightDateIcon = findViewById(R.id.flightDateIcon)
// flightNo = findViewById(R.id.fno)
mudiGang = findViewById(R.id.mudiGang)
searchLayout = findViewById(R.id.searchLayout)
filtrateLayout = findViewById(R.id.filtrateLayout)
summaryText = findViewById(R.id.summaryText)
//筛选页
filtrateFragment = findViewById(R.id.filtrateFragment)
isGroup = findViewById(R.id.isGroup)
agentCode = findViewById(R.id.agentCode)
carrier = findViewById(R.id.carrier)
businessType = findViewById(R.id.businessType)
wayNo = findViewById(R.id.waybillNo)
submit = findViewById(R.id.submit)
reset = findViewById(R.id.reset)
toolBack.setOnClickListener(this)
// startDate.setOnClickListener(this)
// endDate.setOnClickListener(this)
// flightDate.setOnClickListener(this)
// flightDateIcon.setOnClickListener(this)
searchLayout.setOnClickListener(this)
filtrateLayout.setOnClickListener(this)
submit.setOnClickListener(this)
reset.setOnClickListener(this)
isGroup.setOnClickListener(this)
businessType.setOnClickListener(this)
agentCode.setOnClickListener(this)
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)
}
}
}
})
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)
}
}
}
})
//赋值
// val format = ymdSdf.format(Date())
// startDate.text = "$format 00:00:00"
// endDate.text = ymdHmsSdf.format(Date())
// calendar.time = Date()
// calendar.add(Calendar.MINUTE, 30)
// endDate.text = ymdHmsSdf.format(calendar.time)
//是否上舱单
val noneGroup = JSONObject()
noneGroup["name"] = "请选择分组类型"
noneGroup["code"] = ""
val yesGroup = JSONObject()
yesGroup["name"] = "航程"
yesGroup["code"] = "dest"
val noGroup = JSONObject()
noGroup["name"] = "入库时间"
noGroup["code"] = "date"
isGroupArr.add(noneGroup)
isGroupArr.add(yesGroup)
isGroupArr.add(noGroup)
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?) {
}
})
}
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_gjc_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
}
"date" -> {
groupTitle = "入库时间:"
groupName = "$gdate,入库天数:"
daysString = days.toString()
}
else -> {
}
}
val element = GjcWareHouseList(
whId,
no,
pc,
weight,
fno,
flight,
opDate,
locStatus,
groupTitle,
groupName,
daysString,
goods,
spCode,
agentCode,
by1,
origin,
location,
awbType,
businessType,
status,
)
collectList.add(
element
)
}
//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.IO)
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.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.flightDate -> {
Common.onYearMonthDay(this, endDate.text.toString()) { year, month, day ->
calendar.set(year, month - 1, day)
flightDate.text = ymdSdf.format(calendar.time)
}
// Common.showToast(this, "航班日期")
}
R.id.flightDateIcon -> {
flightDate.text = ""
}*/
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.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.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(),
"",//startDate.text.toString(),
"",//endDate.text.toString(),
"",//flightDate.text.toString(),
"",//flightNo.text.toString(),
mudiGang.text.toString(),
businessTypeValue,
"",
"",//isCangDanStatus
wayNo.text.toString(),
isGroupStatus,
agentCodeValue
)
}
/**
* 重置数据,搜索
*/
private fun resetSearch() {
//recyclerView 清除所有数据数据
refreshLayout.setNoMoreData(false)
adapter.notifyItemRangeRemoved(0, collectList.size)
collectList.clear()
currentPage = 1
searchFun()
}
/**
* 重置筛选条件
*/
private fun resetFun() {
currentPage = 1
carrier.setText("")
/* var format = ymdSdf.format(Date())
startDate.text = "$format 00:00:00"
calendar.time = Date()
calendar.add(Calendar.MINUTE, 30)
endDate.text = ymdHmsSdf.format(calendar.time)
flightDate.text = ""
flightNo.setText("")*/
mudiGang.setText("")
businessType.text = ""
businessTypeValue = ""
isGroup.text = ""
isGroupStatus = ""
agentCode.text = ""
agentCodeValue = ""
wayNo.setText("")
}
}

View File

@@ -0,0 +1,104 @@
package com.lukouguoji.gjc.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.gjc.R
import com.lukouguoji.gjc.adapt.GjcWareHouseInfoListAdapter
import com.lukouguoji.gjc.model.GjcWareHouseInfo
import com.lukouguoji.gjc.viewModel.GjcWareHouseInfoViewModel
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_GJC_WARE_HOUSE_INFO)
class GjcWareHouseInfoActivity : BaseActivity(), View.OnClickListener {
private lateinit var viewModel: GjcWareHouseInfoViewModel
private lateinit var scrollView: NestedScrollView
private lateinit var gncQueryInfoList: RecyclerView
private lateinit var adapter: GjcWareHouseInfoListAdapter
private val queryInfoAdapterList = arrayListOf<GjcWareHouseInfo>()
@JvmField
@Autowired
var id: Int = -9999
private fun initView() {
viewModel = ViewModelProvider(this).get(GjcWareHouseInfoViewModel::class.java)
scrollView = findViewById(R.id.scrollView)
val layoutManager = GridLayoutManager(this, 2)
adapter = GjcWareHouseInfoListAdapter(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_gjc_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(GjcWareHouseInfo(1, "运单号", viewModel.wayBillInfo.getString("wbNo") ?: ""))
// 件数、
adapter.append(GjcWareHouseInfo(1, "件数", viewModel.wayBillInfo.getString("pc") ?: ""))
// 重量、
adapter.append(GjcWareHouseInfo(1, "重量", "${viewModel.wayBillInfo.getDoubleValue("weight")} KG"))
// 品名、
adapter.append(GjcWareHouseInfo(1, "品名(英)", viewModel.wayBillInfo.getString("goods") ?: ""))
// 特码、
adapter.append(GjcWareHouseInfo(1, "特码", viewModel.wayBillInfo.getString("spcode") ?: ""))
// 代理人、
adapter.append(GjcWareHouseInfo(1, "代理人", viewModel.wayBillInfo.getString("agent") ?: ""))
// 承运人、
adapter.append(GjcWareHouseInfo(1, "承运人", viewModel.wayBillInfo.getString("by1") ?: ""))
//始发港、
adapter.append(GjcWareHouseInfo(1, "目的港", viewModel.wayBillInfo.getString("dest") ?: ""))
// 航班、
adapter.append(GjcWareHouseInfo(1, "航班", viewModel.wayBillInfo.getString("flight") ?: ""))
// 库位
// adapter.append(GjcWareHouseInfo(1, "库位", viewModel.wayBillInfo.getString("location") ?: ""))
// 运单类型、
adapter.append(GjcWareHouseInfo(1, "运单类型", viewModel.wayBillInfo.getString("awbType") ?: ""))
// 业务类型、
adapter.append(GjcWareHouseInfo(1, "业务类型", viewModel.wayBillInfo.getString("businesstype") ?: ""))
// 包装类型
adapter.append(GjcWareHouseInfo(1, "包装类型", viewModel.wayBillInfo.getString("packageCode") ?: ""))
// 状态、
// adapter.append(GjcWareHouseInfo(1, "状态", viewModel.wayBillInfo.getString("ref") ?: ""))
// 入库时间
adapter.append(GjcWareHouseInfo(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,51 @@
package com.lukouguoji.gjc.activity
import android.os.Bundle
import android.view.View
import android.widget.Toast
import androidx.fragment.app.Fragment
import androidx.viewpager.widget.ViewPager
import androidx.viewpager2.widget.ViewPager2
import com.alibaba.android.arouter.facade.annotation.Route
import com.lukouguoji.gjc.R
import com.lukouguoji.gjc.adapt.GjcYiKuListSwitchAdapter
import com.lukouguoji.gjc.fragment.GjcYiKu2Fragment
import com.lukouguoji.gjc.fragment.GjcYiKuFragment
import com.lukouguoji.module_base.BaseActivity
import com.lukouguoji.module_base.router.ARouterConstants
@Route(path = ARouterConstants.ACTIVITY_URL_GJC_YI_KU)
class GjcYiKuListActivity : BaseActivity(), View.OnClickListener {
val viewContainter = ArrayList<View>()
var pager: ViewPager? = null
private fun initView() {
val listFragment = arrayListOf<Fragment>()
listFragment.add(GjcYiKu2Fragment())
listFragment.add(GjcYiKuFragment())
val viewPager2 = findViewById<ViewPager2>(R.id.viewpager2)
val viewPagerAdapter = GjcYiKuListSwitchAdapter(listFragment, supportFragmentManager, lifecycle)
viewPager2.adapter = viewPagerAdapter
viewPager2.setCurrentItem(1, false)
}
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_gjc_yi_ku_list)
initView()
}
override fun onClick(v: View?) {
v?.let {
when (it.id) {
else -> {
Toast.makeText(this, "未找到对应操作", Toast.LENGTH_SHORT).show()
}
}
}
}
}

View File

@@ -0,0 +1,56 @@
package com.lukouguoji.gjc.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.gjc.R
import com.lukouguoji.gjc.model.GjcQueryInfo
/**
* 出港查询详情
*/
class GjcQueryInfoListAdapter(val activity: Activity, val collectList: MutableList<GjcQueryInfo>) :
RecyclerView.Adapter<GjcQueryInfoListAdapter.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.gjc_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(gjcQueryInfo: GjcQueryInfo) {
collectList.add(gjcQueryInfo)
notifyDataSetChanged()
}
}

View File

@@ -0,0 +1,47 @@
package com.lukouguoji.gjc.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.gjc.R
import com.lukouguoji.gjc.model.GjcQueryInfoWh
class GjcQueryInfoWhListAdapter(val activity: Activity, val collectList: MutableList<GjcQueryInfoWh>) :
RecyclerView.Adapter<GjcQueryInfoWhListAdapter.ViewHolder>() {
inner class ViewHolder(view: View) : RecyclerView.ViewHolder(view) {
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 location: TextView = view.findViewById(R.id.location)
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.gjc_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.pc.text = collect.pc.toString()
holder.weight.text = "${collect.weight} KG"
holder.flight.text = collect.flight
holder.opDate.text = collect.opDate
holder.location.text = collect.location
holder.opId.text = collect.opId
}
override fun getItemCount() = collectList.size
fun append(gjcQueryInfoWh: GjcQueryInfoWh) {
collectList.add(gjcQueryInfoWh)
notifyDataSetChanged()
}
}

View File

@@ -0,0 +1,69 @@
package com.lukouguoji.gjc.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.gjc.R
import com.lukouguoji.gjc.model.GjcQueryList
import com.lukouguoji.module_base.router.ARouterConstants
/**
* 国际出港查询列表
*/
class GjcQueryListAdapter(val activity: Activity, private val collectList: List<GjcQueryList>) :
RecyclerView.Adapter<GjcQueryListAdapter.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 fclose: TextView = view.findViewById(R.id.fclose)
val businessType: TextView = view.findViewById(R.id.businessType)
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.gjc_query_list_item, parent, false)
val viewHolder = ViewHolder(view)
viewHolder.itemView.setOnClickListener {
var adapterPosition = viewHolder.adapterPosition
if (adapterPosition < 0 || collectList.isEmpty()) {
return@setOnClickListener
}
var GjcQueryList = collectList[adapterPosition]
ARouter.getInstance().build(ARouterConstants.ACTIVITY_URL_GJC_QUERY_INFO).withInt("id", GjcQueryList.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.fclose.text = collect.fclose
holder.businessType.text = collect.businessType
holder.pc.text = collect.pc
holder.weight.text = collect.weight
}
override fun getItemCount() = collectList.size
}

View File

@@ -0,0 +1,63 @@
package com.lukouguoji.gjc.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.gjc.R
import com.lukouguoji.gjc.model.GjcReceive
import com.lukouguoji.module_base.common.Constant
import com.lukouguoji.module_base.router.ARouterConstants
class GjcReceiveListAdapter(val activity: Activity, private val collectList: List<GjcReceive>) :
RecyclerView.Adapter<GjcReceiveListAdapter.ViewHolder>() {
inner class ViewHolder(view: View) : RecyclerView.ViewHolder(view) {
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 agentCode: TextView = view.findViewById(R.id.agentCode)
val spCode: TextView = view.findViewById(R.id.spCode)
val goods: TextView = view.findViewById(R.id.goods)
val flight: TextView = view.findViewById(R.id.flight)
val businessType: TextView = view.findViewById(R.id.businessType)
}
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
val view = LayoutInflater.from(parent.context).inflate(R.layout.gjc_receive_list_item, parent, false)
val viewHolder = ViewHolder(view)
viewHolder.itemView.setOnClickListener {
var adapterPosition = viewHolder.adapterPosition
if (adapterPosition < 0 || collectList.isEmpty()) {
return@setOnClickListener
}
var collect = collectList[adapterPosition]
ARouter.getInstance().build(ARouterConstants.ACTIVITY_URL_GJC_START_RECEIVE).withInt("wbId", collect.mawbId)
.navigation(activity, Constant.RequestCode.gjc_shouyun_refresh)
}
return viewHolder
}
override fun onBindViewHolder(holder: ViewHolder, position: Int) {
val collect = collectList[position]
holder.no.text = collect.wbNo
holder.pc.text = collect.pc.toString()
holder.weight.text = "${collect.weight} KG"
holder.agentCode.text = collect.agentCode
holder.spCode.text = collect.spCode
holder.goods.text = collect.goods
holder.flight.text = collect.flight
holder.businessType.text = collect.businessType
}
override fun getItemCount() = collectList.size
}

View File

@@ -0,0 +1,56 @@
package com.lukouguoji.gjc.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.gjc.R
import com.lukouguoji.gjc.model.GjcWareHouseInfo
/**
* 查询详情
*/
class GjcWareHouseInfoListAdapter(val activity: Activity, val collectList: MutableList<GjcWareHouseInfo>) :
RecyclerView.Adapter<GjcWareHouseInfoListAdapter.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.gjc_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(gjcWareHouseInfo: GjcWareHouseInfo) {
collectList.add(gjcWareHouseInfo)
notifyDataSetChanged()
}
}

View File

@@ -0,0 +1,125 @@
package com.lukouguoji.gjc.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.gjc.R
import com.lukouguoji.gjc.model.GjcWareHouseList
import com.lukouguoji.module_base.router.ARouterConstants
/**
* 仓库管理列表
*/
class GjcWareHouseListAdapter(val activity: Activity, private val collectList: List<GjcWareHouseList>) :
RecyclerView.Adapter<GjcWareHouseListAdapter.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.gjc_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_GJC_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,77 @@
package com.lukouguoji.gjc.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.gjc.R
import com.lukouguoji.gjc.model.GjcYiKu2ListModel
class GjcYiKu2ListAdapter(
val activity: Activity,
private val collectList: MutableList<GjcYiKu2ListModel>
) :
RecyclerView.Adapter<GjcYiKu2ListAdapter.ViewHolder>() {
inner class ViewHolder(view: View) : RecyclerView.ViewHolder(view) {
val leftIcon: ImageView = view.findViewById(R.id.leftIcon)
val id: TextView = view.findViewById(R.id.id)
val wbNo: TextView = view.findViewById(R.id.wbNo)
val pc: TextView = view.findViewById(R.id.pc)
val weight: TextView = view.findViewById(R.id.weight)
val goods: TextView = view.findViewById(R.id.goods)
val agentCode: TextView = view.findViewById(R.id.agentCode)
val spCode: TextView = view.findViewById(R.id.spCode)
val origin: TextView = view.findViewById(R.id.origin)//始发港
val dest: TextView = view.findViewById(R.id.dest)//目的港
val by1: TextView = view.findViewById(R.id.by1)//承运人
val awbType: TextView = view.findViewById(R.id.awbType)//运单类型
}
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
val view = LayoutInflater.from(parent.context).inflate(R.layout.gjc_yi_ku2_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.gjc_yi_ku_left_icon_check)
} else {
leftIcon.setImageResource(R.mipmap.gnc_ware_house_left_icon)
}
holder.wbNo.text = collect.wbNo
holder.id.text = collect.id
holder.pc.text = "${collect.pc}"
holder.weight.text = "${collect.weight} KG"
holder.goods.text = collect.goods
holder.spCode.text = collect.spCode
holder.agentCode.text = collect.agentCode
holder.origin.text = collect.origin
holder.dest.text = collect.dest
holder.by1.text = collect.by1
holder.awbType.text = collect.awbType
}
override fun getItemCount() = collectList.size
fun append(gjcYiKu2ListModel: GjcYiKu2ListModel) {
collectList.add(gjcYiKu2ListModel)
notifyDataSetChanged()
}
}

View File

@@ -0,0 +1,88 @@
package com.lukouguoji.gjc.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.gjc.R
import com.lukouguoji.gjc.model.GjcYiKuListModel
import com.lukouguoji.gjc.viewModel.GjcYiKuListViewModel
class GjcYiKuListAdapter(
val activity: Activity,
private val viewModel: GjcYiKuListViewModel,
private val collectList: MutableList<GjcYiKuListModel>
) :
RecyclerView.Adapter<GjcYiKuListAdapter.ViewHolder>() {
inner class ViewHolder(view: View) : RecyclerView.ViewHolder(view) {
val leftIcon: ImageView = view.findViewById(R.id.leftIcon)
val wbNo: TextView = view.findViewById(R.id.wbNo)
val pc: TextView = view.findViewById(R.id.pc)
val weight: TextView = view.findViewById(R.id.weight)
val goods: TextView = view.findViewById(R.id.goods)
val agentCode: TextView = view.findViewById(R.id.agentCode)
val spCode: TextView = view.findViewById(R.id.spCode)
val origin: TextView = view.findViewById(R.id.origin)//始发港
val dest: TextView = view.findViewById(R.id.dest)//目的港
val by1: TextView = view.findViewById(R.id.by1)//承运人
val awbType: TextView = view.findViewById(R.id.awbType)//运单类型
}
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
val view = LayoutInflater.from(parent.context).inflate(R.layout.gjc_yi_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.gjc_yi_ku_left_icon_check)
} else {
leftIcon.setImageResource(R.mipmap.gnc_ware_house_left_icon)
}
holder.wbNo.text = collect.wbNo
holder.pc.text = "${collect.pc}"
holder.weight.text = "${collect.weight} KG"
holder.goods.text = collect.goods
holder.spCode.text = collect.spCode
holder.agentCode.text = collect.agentCode
holder.origin.text = collect.origin
holder.dest.text = collect.dest
holder.by1.text = collect.by1
holder.awbType.text = collect.awbType
leftIcon.setOnClickListener {
collect.isCheck = !collect.isCheck
if (collect.isCheck) {
viewModel.plusOne()
} else {
viewModel.subOne()
}
notifyDataSetChanged() // 更新数据
}
}
override fun getItemCount() = collectList.size
fun append(gjcYiKuListModel: GjcYiKuListModel) {
collectList.add(gjcYiKuListModel)
notifyDataSetChanged()
}
}

View File

@@ -0,0 +1,18 @@
package com.lukouguoji.gjc.adapt
import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentManager
import androidx.lifecycle.Lifecycle
import androidx.viewpager2.adapter.FragmentStateAdapter
class GjcYiKuListSwitchAdapter(
private val fragments: List<Fragment>, fragmentManager: FragmentManager, lifecycle: Lifecycle
) :
FragmentStateAdapter(fragmentManager, lifecycle) {
override fun getItemCount() = 2
override fun createFragment(position: Int) = fragments[position];
}

View File

@@ -0,0 +1,110 @@
package com.lukouguoji.gjc.dialog
import android.content.Context
import android.view.View
import androidx.lifecycle.MutableLiveData
import com.lukouguoji.gjc.R
import com.lukouguoji.gjc.databinding.DialogGjcBoxBatchBinding
import com.lukouguoji.module_base.base.BaseDialogModel
import com.lukouguoji.module_base.bean.GjcWaybillBean
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 BoxBatchDialogModel(
val bean: GjcWaybillBean,
val callBack: () -> Unit
) : BaseDialogModel<DialogGjcBoxBatchBinding>(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_gjc_box_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) {
launchCollect({
NetApply.api.gjcBoxAssembleBatch(
mapOf(
"code" to bean.getWaybillCode(),
"whid" to bean.whid,
"pc" to count.value,
"weight" to weight.value,
).toRequestBody()
)
}) {
onSuccess = {
if (it.verifySuccess()) {
callBack()
} else {
showToast(it.msg.noNull("分批保存失败"))
}
}
}
dismiss()
}
}

View File

@@ -0,0 +1,55 @@
package com.lukouguoji.gjc.dialog
import android.content.Context
import android.view.View
import com.lukouguoji.gjc.R
import com.lukouguoji.gjc.databinding.DialogBoxAddSelectBinding
import com.lukouguoji.gjc.holder.GjcUnLoadDialogViewHolder
import com.lukouguoji.module_base.base.BaseDialogModel
import com.lukouguoji.module_base.bean.GjcWaybillBean
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 GjcBoxAddSelectDialogModel(
val list: List<GjcWaybillBean>,
private val callBack: (GjcWaybillBean) -> Unit
) : BaseDialogModel<DialogBoxAddSelectBinding>(DIALOG_TYPE_CENTER) {
val itemId = R.layout.item_gjc_un_load_dialog
val itemHolder = GjcUnLoadDialogViewHolder::class.java
override fun onBuild(builder: XPopup.Builder) {
builder.dismissOnBackPressed(false)
builder.dismissOnTouchOutside(false)
}
override fun layoutId(): Int {
return R.layout.dialog_box_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,60 @@
package com.lukouguoji.gjc.dialog
import android.content.Context
import android.view.View
import com.lukouguoji.gjc.R
import com.lukouguoji.gjc.databinding.DialogBoxAddSelectBinding
import com.lukouguoji.gjc.databinding.DialogGjcUldSelectBinding
import com.lukouguoji.gjc.holder.GjcUnLoadDialogViewHolder
import com.lukouguoji.gjc.holder.UldViewHolder
import com.lukouguoji.module_base.base.BaseDialogModel
import com.lukouguoji.module_base.bean.GjcWaybillBean
import com.lukouguoji.module_base.bean.ULDBean
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
import dev.utils.app.ScreenUtils
class GjcUldSelectDialogModel(
val list: List<ULDBean>,
private val callBack: (ULDBean) -> Unit
) : BaseDialogModel<DialogGjcUldSelectBinding>(DIALOG_TYPE_CENTER) {
val itemId = R.layout.item_uld
val itemHolder = UldViewHolder::class.java
override fun onBuild(builder: XPopup.Builder) {
builder.dismissOnBackPressed(false)
.dismissOnTouchOutside(false)
.maxHeight((ScreenUtils.getScreenHeight() * 0.7f).toInt())
}
override fun layoutId(): Int {
return R.layout.dialog_gjc_uld_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("请选择一个ULD")
return
}
callBack.invoke(find)
dismiss()
}
}

View File

@@ -0,0 +1,408 @@
package com.lukouguoji.gjc.fragment
import android.content.Intent
import android.net.Uri
import android.os.Bundle
import android.provider.Settings
import android.text.Editable
import android.text.TextWatcher
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.*
import androidx.fragment.app.Fragment
import androidx.lifecycle.ViewModelProvider
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.alibaba.fastjson.JSONArray
import com.alibaba.fastjson.JSONObject
import com.lukouguoji.gjc.R
import com.lukouguoji.gjc.activity.GjcYiKuListActivity
import com.lukouguoji.gjc.adapt.GjcYiKu2ListAdapter
import com.lukouguoji.gjc.model.GjcYiKu2ListModel
import com.lukouguoji.gjc.viewModel.GjcYiKu2ListViewModel
import com.lukouguoji.module_base.ActivityCollector
import com.lukouguoji.module_base.common.Constant
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 com.yanzhenjie.permission.AndPermission
import com.yanzhenjie.permission.runtime.Permission
import com.yzq.zxinglibrary.android.CaptureActivity
import com.yzq.zxinglibrary.bean.ZxingConfig
import java.text.SimpleDateFormat
import java.util.*
class GjcYiKu2Fragment : Fragment(), View.OnClickListener {
private lateinit var yiKuActivity: GjcYiKuListActivity
private val currentTitleName = "国际出港查询完成移库"
private lateinit var viewModel: GjcYiKu2ListViewModel
private lateinit var adapter: GjcYiKu2ListAdapter
private val collectList = ArrayList<GjcYiKu2ListModel>()
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 searchListFragment: LinearLayout
private lateinit var filtrateLayout: LinearLayout
private lateinit var startDate: TextView
private lateinit var endDate: TextView
private lateinit var awbType: TextView
private var awbTypeValue = ""
private lateinit var id: EditText
private lateinit var idScanIcon: ImageView
private lateinit var searchLayout: LinearLayout
//筛选页
private lateinit var filtrateFragment: LinearLayout
private lateinit var wbNo: EditText
private lateinit var wbNoScanIcon: ImageView
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() {
yiKuActivity = activity!! as GjcYiKuListActivity
viewModel = ViewModelProvider(this).get(GjcYiKu2ListViewModel::class.java)
val layoutManager = LinearLayoutManager(yiKuActivity)
adapter = GjcYiKu2ListAdapter(yiKuActivity, collectList)
var recyclerView: RecyclerView = yiKuActivity.findViewById(R.id.recyclerList)
recyclerView.layoutManager = layoutManager
recyclerView.adapter = adapter
//标题
toolBack = yiKuActivity.findViewById(R.id.tool_back)
titleName = yiKuActivity.findViewById(R.id.title_name)
//搜索列表页
searchListFragment = yiKuActivity.findViewById(R.id.searchListFragment)
startDate = yiKuActivity.findViewById(R.id.startDate)
endDate = yiKuActivity.findViewById(R.id.endDate)
awbType = yiKuActivity.findViewById(R.id.awbType)
id = yiKuActivity.findViewById(R.id.id)
idScanIcon = yiKuActivity.findViewById(R.id.idScanIcon)
searchLayout = yiKuActivity.findViewById(R.id.searchLayout)
filtrateLayout = yiKuActivity.findViewById(R.id.filtrateLayout)
//筛选页
filtrateFragment = yiKuActivity.findViewById(R.id.filtrateFragment)
wbNo = yiKuActivity.findViewById(R.id.wbNo)
wbNoScanIcon = yiKuActivity.findViewById(R.id.wbNoScanIcon)
submit = yiKuActivity.findViewById(R.id.submit)
reset = yiKuActivity.findViewById(R.id.reset)
toolBack.setOnClickListener(this)
searchLayout.setOnClickListener(this)
startDate.setOnClickListener(this)
endDate.setOnClickListener(this)
awbType.setOnClickListener(this)
idScanIcon.setOnClickListener(this)
wbNoScanIcon.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?) {
}
})
val format = ymdSdf.format(Date())
startDate.text = "$format 00:00:00"
endDate.text = "$format 23:59:59"
}
override fun onCreateView(
inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?
): View? {
return inflater.inflate(R.layout.fragment_gjc_yi_ku2, container, false)
}
override fun onActivityCreated(savedInstanceState: Bundle?) {
super.onActivityCreated(savedInstanceState)
initView()
//初始化查询
searchFun()
yiKuActivity.loading()
//查询返回结果
viewModel.searchParamLive.observe(yiKuActivity) {
yiKuActivity.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) {
collectList.clear()
//2.循环遍历塞入collectList
listArr.forEach {
val itemObj = it as JSONObject
val id = itemObj.getString("moveId")
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") ?: ""
val origin = itemObj.getString("origin") ?: ""
val dest = itemObj.getString("dest") ?: ""
val by1 = itemObj.getString("by1") ?: ""
val awbType = itemObj.getString("awbType") ?: ""
//列表赋值
collectList.add(
GjcYiKu2ListModel(
id,
no,
fno,
pc,
weight,
goods,
agentCode,
spCode,
pickDate, origin, dest, by1, awbType, false
)
)
}
//3.调adpter展示
if (currentPage == 1) {
adapter.notifyDataSetChanged()
} else {
adapter.notifyItemRangeInserted((currentPage - 1) * 10, collectList.size)
}
refreshLayout.finishRefresh()
refreshLayout.finishLoadMore()
}
}
/////////////// 下拉框 start
viewModel.awb(Constant.businessType.IO)
viewModel.awbObserver.observe(yiKuActivity) { vd ->
val noneObj = JSONObject()
noneObj["name"] = "请选择运单类型"
noneObj["code"] = ""
viewModel.awbList.add(noneObj)
viewModel.awbList.addAll(vd.getJSONArray("data"))
}
/////////////// 下拉框 end
/////////////////////////////// 加载刷新的布局
refreshLayout = yiKuActivity.findViewById<View>(R.id.refreshLayout) as RefreshLayout
refreshLayout.setRefreshHeader(ClassicsHeader(yiKuActivity))
refreshLayout.setRefreshFooter(ClassicsFooter(yiKuActivity))
/////////////////////////////// 下拉刷新
refreshLayout.setOnRefreshListener {
resetSearch()
}
/////////////////////////////// 上拉加载
refreshLayout.setOnLoadMoreListener {
if (currentPage < totalPage) {
currentPage++
//初始化查询
searchFun()
} else {
refreshLayout.finishLoadMoreWithNoMoreData()
}
}
}
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
super.onActivityResult(requestCode, resultCode, data)
if (data != null) {
val content = data.getStringExtra(com.yzq.zxinglibrary.common.Constant.CODED_CONTENT)
// 扫描二维码/条码回传
when (requestCode) {
Constant.RequestCode.gjc_yiku2_id_scan -> {
id.setText(content)
resetSearch()
}
Constant.RequestCode.gjc_yiku2_wb_no_scan -> {
wbNo.setText(content)
resetSearch()
}
}
}
}
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 {
yiKuActivity.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.startDate -> {
Common.onYearMonthDayTime(yiKuActivity, startDate.text.toString()) { year, month, day, hour, min, second ->
calendar.set(year, month - 1, day, hour, min, second)
startDate.text = ymdHmsSdf.format(calendar.time)
}
}
R.id.endDate -> {
Common.onYearMonthDayTime(yiKuActivity, endDate.text.toString()) { year, month, day, hour, min, second ->
calendar.set(year, month - 1, day, hour, min, second)
endDate.text = ymdHmsSdf.format(calendar.time)
}
}
R.id.awbType -> {
Common.singleSelect(yiKuActivity, "运单类型", 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.idScanIcon -> {
scanCode(Constant.RequestCode.gjc_yiku2_id_scan)
}
R.id.wbNoScanIcon -> {
scanCode(Constant.RequestCode.gjc_yiku2_wb_no_scan)
}
R.id.submit -> {
titleName.text = currentTitleName
//搜索
resetSearch()
}
R.id.reset -> {
resetFun()
}
else -> {
Toast.makeText(yiKuActivity, "未找到对应操作", Toast.LENGTH_SHORT).show()
}
}
}
}
/**
* 搜索
*/
private fun searchFun() {
//筛选页隐藏
searchListFragment.visibility = View.VISIBLE
filtrateFragment.visibility = View.GONE
yiKuActivity.loading()
viewModel.search(
pageSize,
currentPage,
startDate.text.toString(),
endDate.text.toString(),
awbTypeValue,
id.text.toString(),
wbNo.text.toString()
)
}
/**
* 重置数据,搜索
*/
private fun resetSearch() {
//recyclerView 清除所有数据数据
refreshLayout.setNoMoreData(false)
adapter.notifyItemRangeRemoved(0, collectList.size)
collectList.clear()
currentPage = 1
searchFun()
}
/**
* 重置筛选条件
*/
private fun resetFun() {
currentPage = 1
val format = ymdSdf.format(Date())
startDate.text = "$format 00:00:00"
endDate.text = "$format 23:59:59"
wbNo.setText("")
id.setText("")
awbType.text = ""
awbTypeValue = ""
}
/**
* 扫码功能
*/
fun scanCode(requestCode: Int) {
AndPermission.with(this)
.runtime()
.permission(Permission.CAMERA, Permission.READ_EXTERNAL_STORAGE)
.onGranted { data: List<String?>? ->
val intent = Intent(yiKuActivity, CaptureActivity::class.java)
val config = ZxingConfig()
config.isFullScreenScan = false //是否全屏扫描 默认为true 设为false则只会在扫描框中扫描
intent.putExtra(com.yzq.zxinglibrary.common.Constant.INTENT_ZXING_CONFIG, config)
startActivityForResult(intent, requestCode)
}
.onDenied { data: List<String?>? ->
val packageURI = Uri.parse("package:${yiKuActivity.packageName}")
val intent = Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS, packageURI)
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
startActivity(intent)
Toast.makeText(yiKuActivity, "没有权限无法扫描呦", Toast.LENGTH_LONG).show()
}
.start()
}
}

View File

@@ -0,0 +1,460 @@
package com.lukouguoji.gjc.fragment
import android.content.Intent
import android.net.Uri
import android.os.Bundle
import android.provider.Settings
import android.text.Editable
import android.text.TextWatcher
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.*
import androidx.fragment.app.Fragment
import androidx.lifecycle.ViewModelProvider
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.alibaba.fastjson.JSONArray
import com.alibaba.fastjson.JSONObject
import com.lukouguoji.gjc.R
import com.lukouguoji.gjc.activity.GjcYiKuListActivity
import com.lukouguoji.gjc.adapt.GjcYiKuListAdapter
import com.lukouguoji.gjc.model.GjcYiKuListModel
import com.lukouguoji.gjc.viewModel.GjcYiKuListViewModel
import com.lukouguoji.module_base.ActivityCollector
import com.lukouguoji.module_base.MyApplication
import com.lukouguoji.module_base.common.Constant
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 com.yanzhenjie.permission.AndPermission
import com.yanzhenjie.permission.runtime.Permission
import com.yzq.zxinglibrary.android.CaptureActivity
import com.yzq.zxinglibrary.bean.ZxingConfig
import java.util.*
import kotlin.collections.ArrayList
class GjcYiKuFragment : Fragment(), View.OnClickListener {
private lateinit var viewModel: GjcYiKuListViewModel
private lateinit var yiKuActivity: GjcYiKuListActivity
private lateinit var adapter: GjcYiKuListAdapter
private val collectList = ArrayList<GjcYiKuListModel>()
private var collectListFromNet = ArrayList<GjcYiKuListModel>()
private lateinit var refreshLayout: RefreshLayout
private var currentPage = 1
private var pageSize = 10
private var totalPage = 0
private var totalCount = 0 //总条数
//搜索
private lateinit var wbNo: EditText
private lateinit var wbNoScanIcon: ImageView
private lateinit var carrier: EditText
private lateinit var dest: EditText
private lateinit var searchLayout: LinearLayout
private lateinit var checkIcon: ImageView
private lateinit var quickSearch: EditText
private var isAllCheck = false
//列表
private lateinit var listLayout: LinearLayout
private lateinit var totalLayout: LinearLayout
//底部
private lateinit var totalPc: TextView
private lateinit var selPc: TextView
private lateinit var send: TextView
private fun initView() {
yiKuActivity = activity!! as GjcYiKuListActivity
viewModel = ViewModelProvider(this).get(GjcYiKuListViewModel::class.java)
val layoutManager = LinearLayoutManager(activity)
adapter = GjcYiKuListAdapter(yiKuActivity, viewModel, collectList)
var recyclerView: RecyclerView = yiKuActivity.findViewById(R.id.collectList)
recyclerView.layoutManager = layoutManager
recyclerView.adapter = adapter
refreshLayout = yiKuActivity.findViewById(R.id.refreshLayout)
wbNo = yiKuActivity.findViewById(R.id.wbNo)
wbNoScanIcon = yiKuActivity.findViewById(R.id.wbNoScanIcon)
carrier = yiKuActivity.findViewById(R.id.carrier)
dest = yiKuActivity.findViewById(R.id.dest)
searchLayout = yiKuActivity.findViewById(R.id.searchLayout)
checkIcon = yiKuActivity.findViewById(R.id.checkIcon)
quickSearch = yiKuActivity.findViewById(R.id.quickSearch)
//列表
listLayout = yiKuActivity.findViewById(R.id.listLayout)
totalLayout = yiKuActivity.findViewById(R.id.totalLayout)
//底部
totalPc = yiKuActivity.findViewById(R.id.totalPc)
selPc = yiKuActivity.findViewById(R.id.selPc)
send = yiKuActivity.findViewById(R.id.send)
searchLayout.setOnClickListener(this)
wbNoScanIcon.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()) }
collectList.clear()
collectList.addAll(filterCollectionList)
recyclerView.adapter = GjcYiKuListAdapter(
ActivityCollector.getLastActivity()!!,
viewModel,
collectList
)
} else {
collectList.clear()
collectList.addAll(collectListFromNet)
recyclerView.adapter = GjcYiKuListAdapter(
ActivityCollector.getLastActivity()!!,
viewModel,
collectList
)
}
val checkList = collectList.filter { c -> c.isCheck }
viewModel.setCheckCount(checkList.size)
adapter.notifyDataSetChanged()
}
override fun afterTextChanged(s: Editable?) {
}
})
wbNo.addTextChangedListener(object : TextWatcher {
override fun beforeTextChanged(s: CharSequence?, start: Int, count: Int, after: Int) {
}
override fun onTextChanged(s: CharSequence?, start: Int, before: Int, count: Int) {
if (s != null && s.toString().length > 11) {
Common.alertDialog(ActivityCollector.getLastActivity()!!, "运单号不能超过11位") { dialog ->
wbNo.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)
}
}
}
})
dest.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)//小写转大写
dest.setText(replaceStrToUpper)
dest.setSelection(replaceStrToUpper.length)
}
}
}
})
}
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
}
override fun onCreateView(
inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?
): View? {
return inflater.inflate(R.layout.fragment_gjc_yi_ku, container, false)
}
override fun onActivityCreated(savedInstanceState: Bundle?) {
super.onActivityCreated(savedInstanceState)
initView()
yiKuActivity.setBackArrow("国际出港移库")
//查询返回结果
viewModel.searchParamLive.observe(yiKuActivity) {
yiKuActivity.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) {
collectList.clear()
listLayout.visibility = View.VISIBLE
totalLayout.visibility = View.VISIBLE
//2.循环遍历塞入collectList
listArr.forEach {
val itemObj = it as JSONObject
val id = itemObj.getIntValue("maWbId")
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") ?: ""
val origin = itemObj.getString("origin") ?: ""
val dest = itemObj.getString("dest") ?: ""
val by1 = itemObj.getString("by1") ?: ""
val awbType = itemObj.getString("awbType") ?: ""
//列表赋值
collectList.add(
GjcYiKuListModel(
id,
no,
pkId,
fno,
pc,
weight,
goods,
agentCode,
spCode,
pickDate, origin, dest, by1, awbType, false
)
)
}
collectListFromNet.clear()
collectListFromNet = collectList.clone() as ArrayList<GjcYiKuListModel>
//3.调adpter展示
if (currentPage == 1) {
adapter.notifyDataSetChanged()
} else {
adapter.notifyItemRangeInserted((currentPage - 1) * 10, collectList.size)
}
refreshLayout.finishRefresh()
refreshLayout.finishLoadMore()
}
totalPc.text = totalCount.toString()
resetSelCount(false, totalCount)
}
//确认移库 返回结果
viewModel.moveGnjYiKuObserver.observe(yiKuActivity) {
yiKuActivity.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(yiKuActivity, msg)
} else {
Common.showToast(yiKuActivity, "移库成功!")
}
//重新搜索
resetSearch()
} else {
if (msg != null && msg != "") {
Common.showToast(yiKuActivity, msg)
} else {
Common.showToast(yiKuActivity, "移库失败!")
}
}
} else {
if (msg != null && msg != "") {
Common.showToast(yiKuActivity, msg)
} else {
Common.showToast(yiKuActivity, "移库失败!")
}
}
}
//监听 复选框选中
viewModel.checkCount.observe(yiKuActivity) {
selPc.text = it.toString()
}
//搜索
resetSearch()
/////////////////////////////// 加载刷新的布局
refreshLayout.setRefreshHeader(ClassicsHeader(yiKuActivity))
refreshLayout.setRefreshFooter(ClassicsFooter(yiKuActivity))
/////////////////////////////// 下拉刷新
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.searchLayout -> {
// viewModel.queryPickByIdGnjChuKu("M000995643")
resetSearch()
}
R.id.wbNoScanIcon -> {
scanCode(Constant.RequestCode.gjc_yiku_wb_no_scan)
}
R.id.checkIcon -> {
//重置 isAllCheck
isAllCheck = !isAllCheck
resetSelCount(isAllCheck, totalCount)
}
R.id.send -> {
val ids = collectList.filter { c -> c.isCheck }.map { c -> c.id }
viewModel.moveGnjYiKu(ids)
}
else -> {
Toast.makeText(yiKuActivity, "未找到对应操作", Toast.LENGTH_SHORT).show()
}
}
}
}
/**
* 扫码返回的结果
*/
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
super.onActivityResult(requestCode, resultCode, data)
// 扫描二维码/条码回传
if (requestCode == Constant.RequestCode.gjc_yiku_wb_no_scan) {
if (data != null) {
val content = data.getStringExtra(com.yzq.zxinglibrary.common.Constant.CODED_CONTENT)
wbNo.setText("$content")
resetSearch()
}
}
}
/**
* 搜索
*/
private fun searchFun() {
yiKuActivity.loading()
listLayout.visibility = View.GONE
totalLayout.visibility = View.GONE
viewModel.search(
pageSize,
currentPage,
wbNo.text.toString(),
dest.text.toString(),
carrier.text.toString()
)
}
/**
* 重置数据,搜索
*/
private fun resetSearch() {
//recyclerView 清除所有数据数据
viewModel.setCheckCount(0)
refreshLayout.setNoMoreData(false)
adapter.notifyItemRangeRemoved(0, collectList.size)
collectList.clear()
currentPage = 1
searchFun()
}
/**
* 重新计算选中数量
* isAllCheckParam true全选 false:全部全效选择
*/
private fun resetSelCount(isAllCheckParam: Boolean, totalCount: Int) {
collectList.forEach { c ->
c.isCheck = isAllCheckParam
}
if (isAllCheckParam) {
viewModel.setCheckCount(totalCount)
} else {
viewModel.setCheckCount(0)
}
adapter.notifyDataSetChanged()
}
/**
* 扫码功能
*/
fun scanCode(requestCode: Int) {
AndPermission.with(this)
.runtime()
.permission(Permission.CAMERA, Permission.READ_EXTERNAL_STORAGE)
.onGranted { data: List<String?>? ->
val intent = Intent(yiKuActivity, CaptureActivity::class.java)
val config = ZxingConfig()
config.isFullScreenScan = false //是否全屏扫描 默认为true 设为false则只会在扫描框中扫描
intent.putExtra(com.yzq.zxinglibrary.common.Constant.INTENT_ZXING_CONFIG, config)
startActivityForResult(intent, requestCode)
}
.onDenied { data: List<String?>? ->
val packageURI = Uri.parse("package:${yiKuActivity.packageName}")
val intent = Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS, packageURI)
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
startActivity(intent)
Toast.makeText(yiKuActivity, "没有权限无法扫描呦", Toast.LENGTH_LONG).show()
}
.start()
}
}

View File

@@ -0,0 +1,23 @@
package com.lukouguoji.gjc.holder
import android.view.View
import com.lukouguoji.gjc.databinding.ItemBoxAddJBinding
import com.lukouguoji.module_base.base.BaseViewHolder
import com.lukouguoji.module_base.bean.JianBean
import com.lukouguoji.module_base.ktx.loge
class BoxAddListJViewHolder(view: View) : BaseViewHolder<JianBean, ItemBoxAddJBinding>(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
binding.rl.setOnClickListener {
bean.checked.set(!bean.checked.get())
binding.iv.visibility = if (bean.checked.get()) View.VISIBLE else View.GONE
}
}
}

View File

@@ -0,0 +1,74 @@
package com.lukouguoji.gjc.holder
import android.view.View
import androidx.databinding.ObservableArrayList
import androidx.databinding.ObservableList.OnListChangedCallback
import com.lukouguoji.gjc.R
import com.lukouguoji.gjc.databinding.ItemBoxAddBinding
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.JianBean
import com.lukouguoji.module_base.ktx.refresh
class BoxAddListViewHolder(view: View) :
BaseViewHolder<GjcBoxAddListBean, ItemBoxAddBinding>(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_box_add_j,
BoxAddListJViewHolder::class.java
)
binding.rv.refresh(bean.jianList)
bean.jianList.addOnListChangedCallback(object :OnListChangedCallback<ObservableArrayList<JianBean>>(){
override fun onChanged(sender: ObservableArrayList<JianBean>?) {
binding.rv.refresh(bean.jianList)
}
override fun onItemRangeChanged(
sender: ObservableArrayList<JianBean>?,
positionStart: Int,
itemCount: Int
) {
binding.rv.refresh(bean.jianList)
}
override fun onItemRangeInserted(
sender: ObservableArrayList<JianBean>?,
positionStart: Int,
itemCount: Int
) {
binding.rv.refresh(bean.jianList)
}
override fun onItemRangeMoved(
sender: ObservableArrayList<JianBean>?,
fromPosition: Int,
toPosition: Int,
itemCount: Int
) {
binding.rv.refresh(bean.jianList)
}
override fun onItemRangeRemoved(
sender: ObservableArrayList<JianBean>?,
positionStart: Int,
itemCount: Int
) {
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,18 @@
package com.lukouguoji.gjc.holder
import android.view.View
import com.lukouguoji.gjc.databinding.ItemBoxAssembleBinding
import com.lukouguoji.module_base.bean.GjcBoxAssembleBean
import com.lukouguoji.module_base.base.BaseViewHolder
class BoxAssembleViewHolder(view: View) :
BaseViewHolder<GjcBoxAssembleBean, ItemBoxAssembleBinding>(view) {
override fun onBind(item: Any?, position: Int) {
val bean = getItemBean(item) ?: return
binding.bean = bean
notifyItemClick(position, binding.tvDetails)
notifyItemClick(position, binding.tvDelete)
}
}

View File

@@ -0,0 +1,24 @@
package com.lukouguoji.gjc.holder
import android.view.View
import com.lukouguoji.gjc.databinding.ItemGoodsAddShowBinding
import com.lukouguoji.module_base.base.BaseViewHolder
import com.lukouguoji.module_base.bean.Warehouse
class GjcGoodsAddShowViewHolder(view: View) :
BaseViewHolder<List<Warehouse>, ItemGoodsAddShowBinding>(view) {
override fun onBind(item: Any?, position: Int) {
val list = getItemBean(item) ?: return
list.forEachIndexed { index, warehouse ->
when (index) {
0 -> binding.bean1 = warehouse
1 -> binding.bean2 = warehouse
2 -> binding.bean3 = warehouse
3 -> binding.bean4 = warehouse
4 -> binding.bean5 = warehouse
else -> {}
}
}
}
}

View File

@@ -0,0 +1,37 @@
package com.lukouguoji.gjc.holder
import android.view.View
import androidx.viewpager2.widget.ViewPager2.OnPageChangeCallback
import com.lukouguoji.gjc.R
import com.lukouguoji.gjc.databinding.ItemGoodsAddBinding
import com.lukouguoji.module_base.base.BaseViewHolder
import com.lukouguoji.module_base.base.CommonAdapter
import com.lukouguoji.module_base.bean.GjcGoodsAddBean
import com.lukouguoji.module_base.ktx.slipList
class GjcGoodsAddViewHolder(view: View) :
BaseViewHolder<GjcGoodsAddBean, ItemGoodsAddBinding>(view) {
override fun onBind(item: Any?, position: Int) {
val bean = getItemBean(item) ?: return
binding.bean = bean
val adapter = CommonAdapter(
requireContext(),
R.layout.item_goods_add_show,
GjcGoodsAddShowViewHolder::class.java
)
binding.vp.adapter = adapter
adapter.refresh(bean.warehouseList?.slipList(5))
binding.vp.registerOnPageChangeCallback(object : OnPageChangeCallback() {
override fun onPageSelected(position: Int) {
binding.tvIndex.text = "${position + 1}/${adapter.itemCount}"
}
})
notifyItemClick(position, binding.ivShow)
notifyItemClick(position, binding.tvDelete)
}
}

View File

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

View File

@@ -0,0 +1,16 @@
package com.lukouguoji.gjc.holder
import android.view.View
import com.lukouguoji.gjc.databinding.ItemGjcGoodsBinding
import com.lukouguoji.module_base.base.BaseViewHolder
import com.lukouguoji.module_base.bean.GjcGoodsBean
class GjcGoodsViewHolder(view: View) : BaseViewHolder<GjcGoodsBean, ItemGjcGoodsBinding>(view) {
override fun onBind(item: Any?, position: Int) {
val bean = getItemBean(item) ?: return
binding.bean = bean
notifyItemClick(position, binding.tvDetails)
}
}

View File

@@ -0,0 +1,19 @@
package com.lukouguoji.gjc.holder
import android.view.View
import com.lukouguoji.gjc.databinding.ItemGjcUnLoadBinding
import com.lukouguoji.gjc.databinding.ItemGjcUnLoadDialogBinding
import com.lukouguoji.module_base.base.BaseViewHolder
import com.lukouguoji.module_base.bean.GjcUnLoadListBean
import com.lukouguoji.module_base.bean.GjcWaybillBean
class GjcUnLoadDialogViewHolder(view: View) :
BaseViewHolder<GjcWaybillBean, ItemGjcUnLoadDialogBinding>(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,18 @@
package com.lukouguoji.gjc.holder
import android.view.View
import com.lukouguoji.gjc.databinding.ItemGjcUnLoadBinding
import com.lukouguoji.module_base.base.BaseViewHolder
import com.lukouguoji.module_base.bean.GjcUnLoadListBean
import com.lukouguoji.module_base.bean.GjcWaybillBean
class GjcUnLoadViewHolder(view: View) :
BaseViewHolder<GjcWaybillBean, ItemGjcUnLoadBinding>(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,14 @@
package com.lukouguoji.gjc.holder
import android.view.View
import com.lukouguoji.gjc.databinding.ItemUldBinding
import com.lukouguoji.module_base.base.BaseViewHolder
import com.lukouguoji.module_base.bean.ULDBean
class UldViewHolder(view: View) : BaseViewHolder<ULDBean, ItemUldBinding>(view) {
override fun onBind(item: Any?, position: Int) {
binding.bean = getItemBean(item) ?: return
notifyItemClick(position, binding.ivIcon)
}
}

View File

@@ -0,0 +1,5 @@
package com.lukouguoji.gjc.model
class BoxAssembleModel {
}

View File

@@ -0,0 +1,28 @@
package com.lukouguoji.gjc.model
class GjcFuBang {
var carId: String = ""
var uld: String? = "" //uld
var carWeight: Double? = 0.0 //平板车自重量
var uldWeight: Double? = 0.0 //uldWeightd
var netWeight: Double? = 0.0 //净重(装机重量)
var dgrCode: String? = "" //IMP代码
var boardType: String? = "" //板型
var cargoWeight: Double? = 0.0 //货重
var plClose: String? = "" //探板收口
var plCloseSize: String? = "" //探板收口大小
var totalWeight: Double? = 0.0 //总重
var height: Double? = 0.0 //高度
var fdate: String? = "" //航班日期
var fno: String? = "" //航班号
var fdest: String = "" //航班目的港
var cargoType: String? = "" //货物类型
var remark: String? = "" //备注
}

View File

@@ -0,0 +1,22 @@
package com.lukouguoji.gjc.model
class GjcQueryInfo(
val id: Int,
val title: String,
val content: String
)
/**
* 关联运单
*/
class GjcQueryInfoWh(
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,15 @@
package com.lukouguoji.gjc.model
class GjcQueryList(
val maWbId: Int,
val wbNo: String,
val agentCode: String,
val spCode: String,
val goods: String,
val flight: String,
val range: String,
val fclose: String,//离港时间
val businessType: String,//运单类型
val pc: String,//件数
val weight: String//重量
)

View File

@@ -0,0 +1,15 @@
package com.lukouguoji.gjc.model
class GjcReceive(
val mawbId: Int,
val wbNo: String,
val pc: Int,
val weight: Double,
val agentCode: String,
val spCode: String,
val goods: String,
val flight: String,
val businessType: String
)

View File

@@ -0,0 +1,30 @@
package com.lukouguoji.gjc.model
class GjcStartReceiveWaybill {
var maWbId: Int = 0
var prefix: String = ""
var no: String = ""
var wbNo: String = ""
var agentCode: String = ""//代理
var goods: String = "" //品名
var spCode: String? = "" //特码
var businessType: String = "" //业务类型
var pc: Int = 0 //件数
var weight: Double = 0.0 //重量
var volume: Double = 0.0 //体积
var arrivePc: Int = 0 //抵达件数
var arriveWeight: Double = 0.0 //抵达重量
var arriveVolume: Double = 0.0 //抵达体积
var remark: String? = "" //备注
var activeId: Int = -9999 //运单活跃状态0:当前有效运单;>0:运单复用次数;
var awbType: String? = "" //运单类型
var dep: String? = "" //
var dest: String? = "" //
var dest1: String? = "" //
var by1: String? = "" //
var checkIn: String? = "" //
}

View File

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

View File

@@ -0,0 +1,25 @@
package com.lukouguoji.gjc.model
class GjcWareHouseList(
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,21 @@
package com.lukouguoji.gjc.model
class GjcYiKu2ListModel(
val id: String,
val wbNo: String,
val fno: String,
val pc: Int, //件数
val weight: Double, //重量
val goods: String, //品名
val agentCode: String, //代理
val spCode: String, //特码
val pickDate: String, //提取日期
val origin: String, //始发港
val dest: String, //目的港
val by1: String, //承运人
val awbType: String, //运单类型
var isCheck: Boolean, //复选框 选中
)

View File

@@ -0,0 +1,22 @@
package com.lukouguoji.gjc.model
class GjcYiKuListModel(
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, //提取日期
val origin: String, //始发港
val dest: String, //目的港
val by1: String, //承运人
val awbType: String, //运单类型
var isCheck: Boolean, //复选框 选中
)

View File

@@ -0,0 +1,196 @@
package com.lukouguoji.gjc.viewModel
import android.app.Activity.RESULT_OK
import android.content.Intent
import android.view.View
import androidx.lifecycle.MutableLiveData
import com.lukouguoji.gjc.R
import com.lukouguoji.gjc.activity.GjcBoxAssembleAddActivity
import com.lukouguoji.module_base.base.BasePageViewModel
import com.lukouguoji.module_base.bean.GjcBoxAssembleBean
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.ktx.trim
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.*
class BoxAssembleViewModel : BasePageViewModel(), IOnItemClickListener {
// 组装日期
val date = MutableLiveData(Date().formatDate())
// 平板车号
val car = MutableLiveData("")
// ULD编号
val uld = MutableLiveData("")
// 复磅状态
val status = MutableLiveData("")
// 截载状态
val cutStatus = MutableLiveData("0")
// 复磅状态列表
val statusList = DictUtils.reWeightStatusList
// 截载状态列表
val cutStatusList = DictUtils.cutStatusList
val count = MutableLiveData(0)
/**
* 获取数据
*/
override fun getData() {
launchCollect({
NetApply.api.getBoxList(
mapOf(
"carid" to car.value,
"uld" to uld.value,
"opdate" to date.value + " 00:00:00",
"cflag" to status.value,
"mcloseStatus" to cutStatus.value,
).trim().toRequestBody()
)
}) {
onSuccess = {
pageModel.handleDataList(it.data)
count.postValue(it.data?.size)
}
onComplete = {
pageModel.finishLoading()
}
}
}
/**
* 组装日期点击
*/
fun dateClick(view: View) {
Common.onYearMonthDay(view.context.getActivity(), date.value) { year, month, day ->
val calendar = Calendar.getInstance()
calendar.set(year, month - 1, day)
date.value = calendar.time.formatDate()
}
}
/**
* 平板车 扫描
*/
fun carScan(view: View) {
ScanModel.startScan(view.context.getActivity(), Constant.RequestCode.gjc_fubang_car_id)
}
/**
* ULD编号 扫描
*/
fun uldScan(view: View) {
ScanModel.startScan(view.context.getActivity(), Constant.RequestCode.gjc_fubang_uld_id)
}
/**
* 复磅状态 选中
*/
fun statusSelected(position: Int) {
status.value = statusList[position].value
}
/**
* 截载状态 点击
*/
fun cutStatusSelected(position: Int) {
cutStatus.value = cutStatusList[position].value
}
/**
* 搜索 点击
*/
fun searchClick(view: View) {
refresh()
}
/**
* 添加 点击
*/
fun addClick(view: View) {
GjcBoxAssembleAddActivity.start(view.context, "")
}
/**
* item 点击
*/
override fun onItemClick(position: Int, type: Int) {
val bean =
pageModel.rv!!.commonAdapter()!!.getItem(position) as GjcBoxAssembleBean
when (type) {
R.id.tv_details -> {
GjcBoxAssembleAddActivity.start(DevUtils.getTopActivity(), bean.locId.noNull())
}
R.id.tv_delete -> {
Common.secondConfirmDialog(
DevUtils.getTopActivity().getActivity(),
"确认删除?"
) { dialog ->
dialog.dismiss()
deleteItem(bean.locId.noNull())
}
}
else -> {}
}
}
private fun deleteItem(id: String) {
showLoading()
launchCollect({
NetApply.api.gjcBoxAssembleDelete(id)
}) {
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 == RESULT_OK && data != null) {
when (requestCode) {
Constant.RequestCode.gjc_fubang_car_id -> {
car.value =
data.getStringExtra(Constant.Result.CODED_CONTENT).noNull()
}
Constant.RequestCode.gjc_fubang_uld_id -> {
uld.value =
data.getStringExtra(Constant.Result.CODED_CONTENT).noNull()
}
else -> {}
}
}
}
}

View File

@@ -0,0 +1,588 @@
package com.lukouguoji.gjc.viewModel
import android.app.Activity.RESULT_OK
import android.content.Context
import android.content.Intent
import android.view.View
import androidx.lifecycle.MutableLiveData
import com.lukouguoji.gjc.R
import com.lukouguoji.gjc.activity.GjcUnLoadListActivity
import com.lukouguoji.gjc.dialog.BoxBatchDialogModel
import com.lukouguoji.module_base.bean.GcjBoxAddReqBean
import com.lukouguoji.gjc.dialog.GjcBoxAddSelectDialogModel
import com.lukouguoji.gjc.dialog.GjcUldSelectDialogModel
import com.lukouguoji.module_base.base.BasePageViewModel
import com.lukouguoji.module_base.bean.FlatcarBean
import com.lukouguoji.module_base.bean.GjcBoxAddListBean
import com.lukouguoji.module_base.bean.GjcWaybillBean
import com.lukouguoji.module_base.bean.JianBean
import com.lukouguoji.module_base.bean.ULDBean
import com.lukouguoji.module_base.common.Constant
import com.lukouguoji.module_base.common.ConstantEvent
import com.lukouguoji.module_base.http.net.NetApply
import com.lukouguoji.module_base.impl.FlowBus
import com.lukouguoji.module_base.interfaces.IOnItemClickListener
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.handle
import com.lukouguoji.module_base.ktx.launchCollect
import com.lukouguoji.module_base.ktx.limit
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.Common
import dev.DevUtils
import dev.utils.common.NumberUtils
import java.util.LinkedList
import java.util.Queue
class GjcBoxAssembleAddViewModel : BasePageViewModel(), IOnItemClickListener {
val isAdd = MutableLiveData(true)
// 平板车或ULD
val plateOrUld = MutableLiveData<String>()
// 运单号或件号
val waybillOrPiece = MutableLiveData<String>()
val checkPBC = MutableLiveData(true)
val checkULD = MutableLiveData(false)
// 平板车信息
val flatcarBean = MutableLiveData<FlatcarBean>()
// ULD信息
val uldBean = MutableLiveData<ULDBean>()
// 插入数据ID
var insertId = ""
// 总件数
val totalCount = MutableLiveData(0)
// 总重量
val totalWeight = MutableLiveData(0.0)
///////////////////////////////////////////////////////////////////////////
// 方法区
///////////////////////////////////////////////////////////////////////////
/**
* 获取详细信息
*/
override fun getData() {
if (isAdd.value != true && insertId.isNotEmpty()) {
showLoading()
launchCollect({
NetApply.api
.getGjcBoxAssembleDetail(insertId)
}) {
onSuccess = {
if (it.verifySuccess()) {
val details = it.data!!
// 设置ULD和平板车信息
flatcarBean.value = details.flatCar
uldBean.value = details.eqmUld
// 刷新选中列表
val list = details.warehousePclistDTOList?.map { it.toGjcBoxAddListBean() }
?: emptyList()
pageModel.handleDataList(list)
computeTotal(list)
} else {
showToast(it.msg.noNull("获取数据失败"))
}
}
onComplete = {
dismissLoading()
}
}
}
}
/**
* 筛选点击
*/
fun onFilterClick(view: View) {
if (verifyCarULD()) {
GjcUnLoadListActivity.start(view.context)
}
}
/**
* 校验当前平板车和ULD是否都扫描成功
*/
private fun verifyCarULD(): Boolean {
if ((flatcarBean.value == null || flatcarBean.value?.carId.isNullOrEmpty()) && uldBean.value == null) {
showToast("请扫描平板车或ULD信息")
return false
}
return true
}
/**
* 校验当前是否已经空数据
*/
private fun verifyIsEmpty(): Boolean {
return (pageModel.rv?.commonAdapter()?.itemCount ?: 0) <= 0
}
/**
* 运单选中返回
*/
fun onWaybillListSelected(context: Context, list: List<GjcWaybillBean>) {
val adapter = pageModel.rv!!.commonAdapter()!!
val items = (adapter.items as List<GjcBoxAddListBean>).map { it.waybillBean }
// 筛选出来已有的运单信息,并弹窗做选择
val map = linkedMapOf<String, ArrayList<GjcWaybillBean>>()
// 添加选中的运单
list.forEach {
it.checked.set(false)
val waybillBeans = map[it.getWaybillCode()] ?: arrayListOf()
if (waybillBeans.find { b -> b.whid == it.whid } == null) {
waybillBeans.add(it)
}
map[it.getWaybillCode()] = waybillBeans
}
// 添加列表中已有的运单
items.forEach {
it.checked.set(false)
val waybillBeans = map[it.getWaybillCode()] ?: arrayListOf()
if (waybillBeans.find { b -> b.whid == it.whid } == null) {
waybillBeans.add(it)
}
map[it.getWaybillCode()] = waybillBeans
}
// 单条数据加入到列表
map.values.filter { it.size == 1 }
.forEach { l ->
val bean = l.first()
if (items.find { b -> b.getWaybillCode() == bean.getWaybillCode() } == null) {
loge("添加到列表 ${bean.getWaybillCode()}")
adapter.addItem(GjcBoxAddListBean(bean))
} else {
loge("列表中已经有了 ${bean.getWaybillCode()}")
}
}
// 多条数据转换为队列
val queue = LinkedList<List<GjcWaybillBean>>()
loge("数量列表 : ${map.values.map { it.size }.toJson()}")
map.values.filter { it.size > 1 }
.forEach { l ->
queue.offer(l)
}
loge("队列数量 : ${queue.size}")
showSelectDialog(context, queue)
computeTotal()
}
/**
* 展示选择弹窗
* 仅用于选择返回
*/
private fun showSelectDialog(context: Context, queue: Queue<List<GjcWaybillBean>>) {
val adapter = pageModel.rv!!.commonAdapter()!!
val list = queue.poll() ?: return
loge("展示选择弹窗 : ${list.size}")
GjcBoxAddSelectDialogModel(list) { bean ->
val items = adapter.items as List<GjcBoxAddListBean>
items.find { it.waybillBean.getWaybillCode() == bean.getWaybillCode() }
.handle({
// 如果查询到运单号一致的数据,则更新数据
if (it.waybillBean.whid != bean.whid) {
it.waybillBean = bean
adapter.notifyItemChanged(items.indexOf(it))
}
}) {
val listBean = GjcBoxAddListBean(bean)
adapter.addItem(listBean)
}
computeTotal()
showSelectDialog(context, queue)
}.show(context)
}
/**
* 确认 点击
*/
fun onConfirmClick(view: View) {
val adapter = pageModel.rv!!.commonAdapter()!!
val items = adapter.items as List<GjcBoxAddListBean>
if (items.isEmpty()) {
showToast("请扫描或选择运单")
return
}
if (!verifyCarULD()) {
return
}
Common.secondConfirmDialog(
DevUtils.getTopActivity(),
"是否确认组装?"
) { dialog ->
dialog.dismiss()
doConfirm(view, items)
}
}
private fun doConfirm(view: View, items: List<GjcBoxAddListBean>) {
val bean = GcjBoxAddReqBean(locId = insertId)
bean.setGjcBoxAddList(items, uldBean.value?.uldWeight.noNull("0.0"))
showLoading()
launchCollect({
val map = bean.toMap()
map["isAdd"] = isAdd.value!!
NetApply.api
.gjcBoxAddConfirm(map.toRequestBody())
}) {
onSuccess = {
if (it.verifySuccess()) {
showToast("操作成功")
FlowBus.with<Any>(ConstantEvent.GJC_BOX_ADD_SUCCESS)
.tryEmit(true)
view.context.finish()
} else {
showToast(it.msg.noNull("操作失败"))
}
}
onComplete = {
dismissLoading()
}
}
}
/**
* 平板或Uld 扫描 点击
*/
fun onPlateOrUldClick(view: View) {
if (!verifyIsEmpty()) {
showToast("请清理所有运单后再进行扫描")
return
}
ScanModel.startScan(
view.context.getActivity(),
Constant.RequestCode.gjc_fubang_car_id
)
}
/**
* 运单或件号 扫描 点击
*/
fun onWaybillOrPieceClick(view: View) {
if (!verifyCarULD()) {
return
}
ScanModel.startScan(
view.context.getActivity(),
Constant.RequestCode.WAYBILL
)
}
/**
* 条目点击事件
*/
override fun onItemClick(position: Int, type: Int) {
val adapter = pageModel.rv!!.commonAdapter()!!
val items = adapter.items as List<GjcBoxAddListBean>
when (type) {
R.id.tv_batch -> {
val bean = items[position].waybillBean
BoxBatchDialogModel(bean) {
addWaybillInfo(bean.getWaybillCode(), whid = bean.whid.noNull())
}.show(DevUtils.getTopActivity())
}
R.id.tv_delete_order -> {
Common.secondConfirmDialog(
DevUtils.getTopActivity(),
"是否确认删除该运单信息?"
) { dialog ->
adapter.removeItem(position)
computeTotal()
dialog.dismiss()
}
}
// 删件
R.id.tv_delete_matter -> {
val bean = items[position]
if (bean.jianList.filter { it.checked.get() }.isEmpty()) {
showToast("请先选择要删除的件号")
return
}
Common.secondConfirmDialog(
DevUtils.getTopActivity(),
"是否确认删除选中件号?"
) { dialog ->
bean.jianList.removeIf { it.checked.get() }
adapter.notifyItemChanged(position)
computeTotal()
dialog.dismiss()
}
}
R.id.iv_show -> {
if (items[position].show.get()) {
items[position].show.set(false)
} else {
items.forEachIndexed { index, bean ->
if (bean.show.get() != (index == position)) {
bean.show.set(index == position)
}
}
}
}
else -> {}
}
}
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
if (resultCode == RESULT_OK && data != null) {
when (requestCode) {
Constant.RequestCode.gjc_fubang_car_id -> {
val id = data.getStringExtra(Constant.Result.CODED_CONTENT).noNull()
plateOrUld.value = id
onPbcOrUldChange()
}
Constant.RequestCode.WAYBILL -> {
val id = data.getStringExtra(Constant.Result.CODED_CONTENT).noNull()
waybillOrPiece.value = id
onWaybillOrPieceChange()
}
else -> {}
}
}
}
/**
* 平板车或ULD 改变
*/
fun onPbcOrUldChange(focused: Boolean = false) {
if (focused) {
return
}
val id = plateOrUld.value ?: return
if (!verifyIsEmpty()) {
return
}
if (checkPBC.value!!) {
getFlatcarInfo(id)
} else {
getUldInfo(id)
}
}
/**
* 运单号或件号 改变
*/
fun onWaybillOrPieceChange(focused: Boolean = false) {
if (focused) {
return
}
val code = waybillOrPiece.value ?: return
if (NumberUtils.isNumber(code)) {
// 运单号
if (code.length == 11) {
addWaybillInfo(code)
}
// 运单号 + 件号
else if (code.length == 16) {
addWaybillInfo(code.substring(0, 11), code.substring(11))
}
}
if (code.length > 16) {
loge("件号 : $code")
addWaybillInfo(code, code)
}
}
/**
* 获取运单信息
* @param waybillCode 运单号
* @param jianCode 件号
* @param whid 仓库ID, 不为空,则视为更新
*/
private fun addWaybillInfo(waybillCode: String, jianCode: String = "", whid: String = "") {
// 非更新
if (whid.isEmpty()) {
val find =
(pageModel.rv!!.commonAdapter()!!.items as List<GjcBoxAddListBean>).find { it.waybillBean.getWaybillCode() == waybillCode }
if (find != null) {
if (jianCode.isEmpty()) {
showToast("该运单已在列表中")
} else {
addJian(jianCode, find)
}
return
}
}
launchCollect({
NetApply.api.getGjcWaybillInfo(waybillCode)
}) {
onSuccess = {
if (it.verifySuccess() && it.data != null && !it.data!!.whList.isNullOrEmpty()) {
val filter = it.data!!.whList!!.filter { bean -> bean.location.isNullOrEmpty() }
if (filter.isEmpty()) {
showToast("该运单已装配到设备上")
} else {
// 重新获取列表
val adapter = pageModel.rv!!.commonAdapter()!!
val list = adapter.items as List<GjcBoxAddListBean>
if (whid.isNotEmpty()) {
// 更新数据
filter.find { b -> b.whid == whid }?.let { b ->
list.find { l -> l.waybillBean.whid == whid }?.let { f ->
f.waybillBean = b
adapter.notifyItemChanged(list.indexOf(f))
addJian(jianCode, f)
}
}
} else if (filter.size > 1) {
GjcBoxAddSelectDialogModel(filter) {
val listBean = GjcBoxAddListBean(it)
adapter.addItem(listBean)
loge("新增数据 ${it.whid} , 添加件 : $jianCode")
addJian(jianCode, listBean)
}.show(DevUtils.getTopActivity())
} else {
val first = filter.first()
val listBean = GjcBoxAddListBean(first)
adapter.addItem(listBean)
loge("新增数据 ${first.whid} , 添加件 : $jianCode")
addJian(jianCode, listBean)
}
}
computeTotal()
} else {
showToast(it.msg.noNull("获取运单信息失败"))
}
}
}
}
/**
* 添加件号
*/
private fun addJian(code: String, bean: GjcBoxAddListBean) {
if (code.isEmpty()) {
computeTotal()
return
}
if (bean.jianList.find { b -> b.code == JianBean.getCode(code) } == null) {
bean.jianList.add(JianBean.create(code))
}
computeTotal()
}
/**
* 获取平板车数据
*/
private fun getFlatcarInfo(id: String) {
launchCollect({
NetApply.api
.getFlatcarInfo(id)
}) {
onSuccess = {
if (it.verifySuccess() && it.data != null) {
flatcarBean.value = it.data
insertCarOrULD()
} else {
showToast(it.msg.noNull("该平板车不存在"))
}
}
}
}
/**
* 获取ULD数据
*/
private fun getUldInfo(id: String) {
launchCollect({
NetApply.api
.getUldInfo(id)
}) {
onSuccess = {
if (it.verifySuccess() && it.data != null && it.data!!.isNotEmpty()) {
val data = it.data!!
if (data.size == 1) {
uldBean.value = data.first()
insertCarOrULD()
} else {
GjcUldSelectDialogModel(data) { b ->
uldBean.value = b
insertCarOrULD()
}.show()
}
} else {
showToast(it.msg.noNull("获取ULD信息失败"))
}
}
}
}
/**
* 插入数据
*/
private fun insertCarOrULD() {
val map = hashMapOf(
"carid" to flatcarBean.value?.carId,
"carweight" to flatcarBean.value?.carWeight,
"locId" to insertId,
"gjcLoading" to listOf(
mapOf(
"carid" to flatcarBean.value?.carId,
"locId" to insertId,
"maxweight" to flatcarBean.value?.maxWeight,
"maxvolume" to uldBean.value?.maxVolume,
"uld" to uldBean.value?.uld,
"uldflag" to uldBean.value?.uldFlag,
"uldweight" to uldBean.value?.uldWeight,
)
)
)
launchCollect({
NetApply.api
.gjcBoxInsert(map.toRequestBody())
}) {
onSuccess = {
if (!it.verifySuccess()) {
showToast(it.msg.noNull("插入数据失败"))
if (checkPBC.value!!) {
flatcarBean.value = FlatcarBean()
} else {
uldBean.value = ULDBean()
}
} else {
it.data?.locId?.let { id -> insertId = id }
}
}
}
}
/**
* 计算总数
*/
private fun computeTotal(list: List<GjcBoxAddListBean>? = null) {
val adapter = pageModel.rv!!.commonAdapter()!!
val items = list ?: adapter.items as List<GjcBoxAddListBean>
var count = 0
var weight = 0.0
items.forEach { bean ->
count += if (bean.jianList.isEmpty()) bean.waybillBean.pc.noNull("0")
.toInt() else bean.jianList.size
weight += (bean.waybillBean.weight.noNull().toDouble())
}
totalCount.value = count
totalWeight.value = weight.limit(2).toDouble()
}
}

View File

@@ -0,0 +1,219 @@
package com.lukouguoji.gjc.viewModel
import android.content.Context
import android.util.Log
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.Transformations
import androidx.lifecycle.liveData
import com.alibaba.fastjson.JSONArray
import com.alibaba.fastjson.JSONObject
import com.lukouguoji.gjc.model.GjcFuBang
import com.lukouguoji.module_base.base.BaseViewModel
import com.lukouguoji.module_base.bean.BoxDetailsForCarIdBean
import com.lukouguoji.module_base.common.String.emptyToNull
import com.lukouguoji.module_base.http.net.NetApply
import com.lukouguoji.module_base.http.user.UserNetwork
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 kotlinx.coroutines.Dispatchers
class GjcFuBangViewModel : BaseViewModel() {
var plCloseList = JSONArray()
/**
* 接口返回复磅信息
*/
var fuBangInfoFormNetWork = JSONObject()
var fuBangInfo = GjcFuBang()
/**
* 集装器编号,查询集装器自重
*/
private val queryUldGjcReceiveLiveData = MutableLiveData<String>()
val queryUldGjcReceiveObserver =
Transformations.switchMap(queryUldGjcReceiveLiveData) { param ->
liveData(Dispatchers.IO) {
try {
var response = UserNetwork.queryUldGjcReceive(param)
emit(response)
} catch (e: Exception) {
Log.e("GoutStartViewModel", e.stackTraceToString())
}
}
}
fun queryUldGjcReceive(id: String) {
queryUldGjcReceiveLiveData.value = id
}
/**
* 托盘编号,查询托盘自重
*/
private val queryFlatcarGjcReceiveLiveData = MutableLiveData<String>()
val queryFlatcarGjcReceiveObserver =
Transformations.switchMap(queryFlatcarGjcReceiveLiveData) { param ->
liveData(Dispatchers.IO) {
try {
var response = UserNetwork.queryFlatcarGjcReceive(param)
emit(response)
} catch (e: Exception) {
Log.e("GoutStartViewModel", e.stackTraceToString())
}
}
}
// 板箱详情
val boxDetails = MutableLiveData<BoxDetailsForCarIdBean>()
fun queryFlatcarGjcReceive(id: String) {
queryFlatcarGjcReceiveLiveData.value = id
}
fun getBoxDetailsByCarId(carId: String) {
launchCollect({
NetApply.api.getGjcBoxAssembleByCarIdList(
mapOf(
"carid" to carId
).toRequestBody()
)
}) {
onSuccess = {
if (it.data != null) {
boxDetails.value = it.data
}
}
}
}
/**
* 完成复磅
*/
private val completedLiveData = MutableLiveData<JSONObject>()
val completedObserver = Transformations.switchMap(completedLiveData) { param ->
liveData(Dispatchers.IO) {
try {
val response = UserNetwork.completedGjcFuBang(param!!)
emit(response)
} catch (e: Exception) {
Log.e("GoutStartViewModel", e.stackTraceToString())
}
}
}
fun completed(gjcFuBang: GjcFuBang) {
val jsonObject = fuBangInfoFormNetWork
jsonObject["carId"] = gjcFuBang.carId
jsonObject["uld"] = gjcFuBang.uld
jsonObject["carWeight"] = gjcFuBang.carWeight
jsonObject["uldWeight"] = gjcFuBang.uldWeight
jsonObject["netWeight"] = gjcFuBang.netWeight
jsonObject["dgrCode"] = gjcFuBang.dgrCode
jsonObject["boardType"] = gjcFuBang.boardType
jsonObject["cargoWeight"] = gjcFuBang.cargoWeight
jsonObject["plClose"] = gjcFuBang.plClose
jsonObject["plCloseSize"] = gjcFuBang.plCloseSize
jsonObject["totalWeight"] = gjcFuBang.totalWeight
jsonObject["height"] = gjcFuBang.height
jsonObject["fdate"] = gjcFuBang.fdate
jsonObject["fno"] = gjcFuBang.fno
jsonObject["fdest"] = gjcFuBang.fdest
jsonObject["cargoType"] = gjcFuBang.cargoType
jsonObject["remark"] = gjcFuBang.remark
completedLiveData.value = jsonObject
}
fun onConfirmClick(context: Context, gjcFuBang: GjcFuBang, callBack: () -> Unit) {
showLoading()
launchCollect({
NetApply.api.gjcBoxWeighingSubmit(
mapOf(
"carid" to gjcFuBang.carId,
"carweight" to gjcFuBang.carWeight,
"locId" to boxDetails.value?.locId,
"totalWeight" to gjcFuBang.totalWeight,
"gjcLoading" to listOf(
mapOf(
"cargoweight" to gjcFuBang.cargoWeight,
"locId" to boxDetails.value?.locId,
"netweight" to gjcFuBang.netWeight,
"remark" to gjcFuBang.remark,
"uldweight" to gjcFuBang.uldWeight,
)
),
).toRequestBody()
)
}) {
onSuccess = {
if (it.verifySuccess()) {
showToast("提交成功")
callBack()
} else {
showToast(it.msg.noNull("提交失败"))
}
}
onComplete = {
dismissLoading()
}
}
}
/**
* 货物类型 下拉框
*/
var cargoList = JSONArray()
private val cargoLiveData = MutableLiveData<String>()
val cargoObserver = Transformations.switchMap(cargoLiveData) { _ ->
liveData(Dispatchers.IO) {
try {
var response = UserNetwork.cargoSelectGjc()
emit(response)
} catch (e: Exception) {
Log.e("GoutFuBangViewModel", e.stackTraceToString())
}
}
}
fun cargoSelect(type: String) {
cargoLiveData.value = type
}
/**
* 查询航班
*/
private val queryFlightLiveData = MutableLiveData<JSONObject>()
val queryFlightObserver = Transformations.switchMap(queryFlightLiveData) { param ->
liveData(Dispatchers.IO) {
try {
val response = UserNetwork.queryFlightMitInPack(param)
emit(response)
} catch (e: Exception) {
Log.e("GjcFuBangViewModel", e.stackTraceToString())
}
}
}
fun queryFlight(fdate: String, fno: String) {
val temObj = JSONObject()
temObj["countryType"] = null
temObj["fclose"] = null
temObj["fdate"] = fdate.emptyToNull()
temObj["fdep"] = null
temObj["fdest"] = null
temObj["fid"] = null
temObj["fno"] = fno.emptyToNull()
temObj["mclose"] = null
queryFlightLiveData.value = temObj
}
}
class CarParam(val carNo: String?, val userId: String?)

View File

@@ -0,0 +1,170 @@
package com.lukouguoji.gjc.viewModel
import android.app.Activity
import android.content.Intent
import android.view.View
import androidx.lifecycle.MutableLiveData
import com.lukouguoji.gjc.R
import com.lukouguoji.gjc.holder.GjcGoodsAddViewHolder
import com.lukouguoji.module_base.base.BasePageViewModel
import com.lukouguoji.module_base.bean.GjcGoodsAddBean
import com.lukouguoji.module_base.common.Constant
import com.lukouguoji.module_base.common.ConstantEvent
import com.lukouguoji.module_base.http.net.NetApply
import com.lukouguoji.module_base.impl.FlowBus
import com.lukouguoji.module_base.ktx.commonAdapter
import com.lukouguoji.module_base.ktx.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.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 java.util.Calendar
import java.util.Date
class GjcGoodsAddViewModel : BasePageViewModel() {
// 航班日期
var flightDate = MutableLiveData(Date().formatDate())
// 航班号
var flightNo = MutableLiveData<String>()
// 板车号
var truckNo = MutableLiveData<String>()
// ULD编号
var uldNo = MutableLiveData<String>()
val itemId = R.layout.item_goods_add
val itemHolder = GjcGoodsAddViewHolder::class.java
// 列表数量
val size = MutableLiveData(0)
override fun getData() {
launchCollect({
NetApply.api
.getGjcGoodsAddList(
mapOf(
"fdate" to flightDate.value,
"fno" to flightNo.value,
"carid" to truckNo.value,
"uld" to uldNo.value,
).toRequestBody()
)
}) {
onSuccess = {
pageModel.handleDataList(it.data)
size.value = it.data?.size ?: 0
}
}
}
override fun onItemClick(position: Int, type: Int) {
val adapter = pageModel.rv!!.commonAdapter()!!
val items = adapter.items
when (type) {
R.id.iv_show -> {
CheckUtil.handleSingleCheck(items as List<GjcGoodsAddBean>, "show", position, true)
adapter.notifyDataSetChanged()
}
R.id.tv_delete -> {
adapter.removeItem(position)
size.value = adapter.itemCount
}
else -> {}
}
}
/**
* 航班日期点击
*/
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()
}
}
/**
* 板车号 扫描
*/
fun truckNoScan(view: View) {
ScanModel.startScan(view.context.getActivity(), Constant.RequestCode.CAR)
}
/**
* ULD编号 扫描
*/
fun uldNoScan(view: View) {
ScanModel.startScan(view.context.getActivity(), Constant.RequestCode.ULD)
}
/**
* 搜索点击
*/
fun searchClick(view: View) {
refresh()
}
/**
* 确认点击
*/
fun confirmClick(view: View) {
val list = pageModel.rv?.commonAdapter()?.items?.map { (it as GjcGoodsAddBean).locId }
?: emptyList()
if (list.isEmpty()) {
showToast("请先添加货物")
return
}
showLoading()
launchCollect({
NetApply.api
.gjcGoodsAdd(
mapOf(
"locIdList" to list
).toRequestBody()
)
}) {
onSuccess = {
if (it.verifySuccess()) {
FlowBus.with<Any>(ConstantEvent.GJC_HANDOVER_ADD_SUCCESS)
.tryEmit(true)
view.context.finish()
} 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.CAR -> {
val id = data.getStringExtra(Constant.Result.CODED_CONTENT).noNull()
truckNo.value = id
}
Constant.RequestCode.ULD -> {
val id = data.getStringExtra(Constant.Result.CODED_CONTENT).noNull()
uldNo.value = id
}
else -> {}
}
}
}
}

View File

@@ -0,0 +1,140 @@
package com.lukouguoji.gjc.viewModel
import android.app.Activity
import android.content.Intent
import android.view.View
import androidx.lifecycle.MutableLiveData
import com.lukouguoji.gjc.R
import com.lukouguoji.gjc.activity.GjcGoodsAddActivity
import com.lukouguoji.gjc.activity.GjcGoodsManifestActivity
import com.lukouguoji.module_base.base.BasePageViewModel
import com.lukouguoji.module_base.bean.GjcGoodsBean
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 dev.DevUtils
import java.util.Calendar
import java.util.Date
class GjcGoodsListViewModel : BasePageViewModel(), IOnItemClickListener {
// 航班日期
var flightDate = MutableLiveData(Date().formatDate())
// 航班号
var flightNo = MutableLiveData<String>()
// 板车号
var truckNo = MutableLiveData<String>()
// ULD编号
var uldNo = MutableLiveData<String>()
var count = MutableLiveData(0)
override fun getData() {
launchCollect({
NetApply.api
.gjcHandoverList(
mapOf(
"carid" to truckNo.value,
"fdate" to flightDate.value,
"fno" to flightNo.value,
"uld" to uldNo.value,
).toRequestBody()
)
}) {
onSuccess = {
if (it.verifySuccess()) {
pageModel.handleDataList(it.data ?: emptyList())
count.postValue(it.data?.size)
} else {
showToast(it.msg.noNull("获取数据失败"))
count.postValue(0)
}
}
}
}
/**
* 航班日期点击
*/
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()
}
}
/**
* 板车号 扫描
*/
fun truckNoScan(view: View) {
ScanModel.startScan(view.context.getActivity(), Constant.RequestCode.CAR)
}
/**
* ULD编号 扫描
*/
fun uldNoScan(view: View) {
ScanModel.startScan(view.context.getActivity(), Constant.RequestCode.ULD)
}
/**
* 搜索点击
*/
fun searchClick(view: View) {
refresh()
}
/**
* 添加点击
*/
fun addClick(view: View) {
GjcGoodsAddActivity.start(view.context)
}
/**
* item点击
*/
override fun onItemClick(position: Int, type: Int) {
val bean = pageModel.rv!!.commonAdapter()!!.getItem(position) as GjcGoodsBean
when (type) {
R.id.tv_details -> {
GjcGoodsManifestActivity.start(DevUtils.getTopActivity(), bean.movID.noNull())
}
else -> {}
}
}
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()
truckNo.value = id
}
Constant.RequestCode.ULD -> {
val id = data.getStringExtra(Constant.Result.CODED_CONTENT).noNull()
uldNo.value = id
}
else -> {}
}
}
}
}

View File

@@ -0,0 +1,122 @@
package com.lukouguoji.gjc.viewModel
import android.content.Context
import android.graphics.Bitmap
import android.graphics.BitmapFactory
import android.view.View
import androidx.lifecycle.MutableLiveData
import com.lukouguoji.gjc.R
import com.lukouguoji.gjc.holder.GjcGoodsManifestViewHolder
import com.lukouguoji.module_base.base.BasePageViewModel
import com.lukouguoji.module_base.bean.GjcGoodsDetailsBean
import com.lukouguoji.module_base.common.ConstantEvent
import com.lukouguoji.module_base.http.net.NetApply
import com.lukouguoji.module_base.impl.FlowBus
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 GjcGoodsManifestViewModel : BasePageViewModel() {
var movID = ""
val itemLayoutId = R.layout.item_goods_manifest
val itemViewHolder = GjcGoodsManifestViewHolder::class.java
// 签名
val signature = MutableLiveData<String>()
// 返回签名
val resultSign = MutableLiveData<Bitmap>()
// 详情
val dataBean = MutableLiveData<GjcGoodsDetailsBean>()
///////////////////////////////////////////////////////////////////////////
// 方法区
///////////////////////////////////////////////////////////////////////////
override fun getData() {
showLoading()
launchCollect({
NetApply.api
.getGjcGoodsDetail(movID)
}) {
onSuccess = {
if (it.verifySuccess() && it.data != null) {
val data = it.data!!
pageModel.handleDataList(data.loadingHandoverList)
dataBean.postValue(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("获取数据失败"))
}
}
onComplete = {
dismissLoading()
}
}
}
/**
* 打印点击
*/
fun printClick(view: View) {
view.context.finish()
}
/**
* 提交签名
*/
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
.gjcGoodsSubmitSignature(
part, mutableMapOf(
"movID " to movID.toRequestBody("multipart/form-data".toMediaTypeOrNull()),
)
)
}) {
onSuccess = {
if (it.verifySuccess()) {
showToast(it.msg.noNull("提交成功"))
FlowBus.with<Any>(ConstantEvent.GJC_HANDOVER_SIGNATURE_SUCCESS)
.tryEmit(true)
context.finish()
} else {
showToast(it.msg.noNull("提交失败"))
}
}
}
}
/**
* 签字点击
*/
fun signClick(view: View) {
if (dataBean.value?.isCheck?.toBoolean() == false) {
SignatureActivity.start(view.context)
}
}
}

View File

@@ -0,0 +1,48 @@
package com.lukouguoji.gjc.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 GjcQueryInfoViewModel : ViewModel() {
private val logName = "GncQueryInfoViewModel"
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.searchByIdGjcQuery(param.wbId)
} else if (param.wbNo != null) {
response = UserNetwork.searchByWbNoGncQuery(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,168 @@
package com.lukouguoji.gjc.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 GjcQueryListViewModel : ViewModel() {
private val searchParam = MutableLiveData<JSONObject>()
val searchParamLive = Transformations.switchMap(searchParam) { param ->
liveData(Dispatchers.IO) { try {
val response = UserNetwork.searchGjcQuery(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
}
/**
* 数据汇总
*/
val summaryObserver = Transformations.switchMap(searchParam) { param ->
liveData(Dispatchers.IO) {
try {
val response = UserNetwork.totalGjcQuery(param)
emit(response)
} catch (e: Exception) {
Log.e("GoutCollectionViewModel", 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.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(type: String) {
awbLiveData.value = type
}
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,38 @@
package com.lukouguoji.gjc.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 GjcReceiveListViewModel : ViewModel() {
private val searchParam = MutableLiveData<JSONObject>()
val searchParamLive = Transformations.switchMap(searchParam) { param ->
liveData(Dispatchers.IO) {
try {
val response = UserNetwork.searchGjcReceive(param)
emit(response)
} catch (e: Exception) {
Log.e("GoutCollectionViewModel", e.stackTraceToString())
}
}
}
fun search(limit: Int, page: Int, text: String) {
val param = JSONObject()
param["limit"] = limit
param["page"] = page
param["text"] = text
searchParam.value = param
}
}

View File

@@ -0,0 +1,219 @@
package com.lukouguoji.gjc.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.gjc.model.GjcStartReceiveWaybill
import com.lukouguoji.module_base.http.user.UserNetwork
import kotlinx.coroutines.Dispatchers
class GjcStartReceiveViewModel : ViewModel() {
var receiveWaybill = GjcStartReceiveWaybill()
var waybillFormNetWork = JSONObject()
var agentCodeList = JSONArray()
var businessList = JSONArray()
var specialCodeList = JSONArray()
var dgrDetailList = JSONArray()
private val wbIdData = MutableLiveData<WaybillParam>()
private val businessLiveData = MutableLiveData<String>()
private val specialCodeLiveData = MutableLiveData<String>()
inner class WaybillParam(val wbId: Int, val wbNo: String?)
val waybillLiveData = Transformations.switchMap(wbIdData) { param ->
liveData(Dispatchers.IO) {
try {
var response = JSONObject()
if (param.wbId != -9999) {
response = UserNetwork.queryWbByIdGjcReceive(param.wbId)
} else if (param.wbNo != null) {
response = UserNetwork.queryWbByNoGjcReceive(param.wbNo)
} else {
}
emit(response)
} catch (e: Exception) {
Log.e("GoutStartViewModel", e.stackTraceToString())
}
}
}
fun queryWaybillById(wbId: Int, wbNo: String?) {
wbIdData.value = WaybillParam(wbId, wbNo)
}
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())
}
}
}
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())
}
}
}
private val completedLiveData = MutableLiveData<JSONObject>()
val completedObserver = Transformations.switchMap(completedLiveData) { param ->
liveData(Dispatchers.IO) {
try {
val response = UserNetwork.completedGjcReceive(param!!)
emit(response)
} catch (e: Exception) {
Log.e("GoutStartViewModel", e.stackTraceToString())
}
}
}
fun completed(waybill: GjcStartReceiveWaybill) {
var prefix: String = ""
var no: String = ""
val jsonObject = waybillFormNetWork
jsonObject["maWbId"] = waybill.maWbId
jsonObject["wbNo"] = waybill.wbNo
jsonObject["agentCode"] = waybill.agentCode
jsonObject["goods"] = waybill.goods
jsonObject["spCode"] = waybill.spCode
jsonObject["businessType"] = waybill.businessType
jsonObject["awbType"] = waybill.awbType
jsonObject["pc"] = waybill.pc
jsonObject["weight"] = waybill.weight
jsonObject["volume"] = waybill.volume
jsonObject["arrivePc"] = waybill.arrivePc
jsonObject["arriveWeight"] = waybill.arriveWeight
jsonObject["arriveVolume"] = waybill.arriveVolume
jsonObject["activeId"] = waybill.activeId
jsonObject["remark"] = waybill.remark
jsonObject["dep"] = waybill.dep
jsonObject["dest"] = waybill.dest
jsonObject["dest1"] = waybill.dest1
jsonObject["by1"] = waybill.by1
jsonObject["checkIn"] = waybill.checkIn
completedLiveData.value = jsonObject
}
/**
* 集装器编号,查询集装器自重
*/
private val queryUldGjcReceiveLiveData = MutableLiveData<String>()
val queryUldGjcReceiveObserver = Transformations.switchMap(queryUldGjcReceiveLiveData) { param ->
liveData(Dispatchers.IO) {
try {
var response = UserNetwork.queryUldGjcReceive(param)
emit(response)
} catch (e: Exception) {
Log.e("GoutStartViewModel", e.stackTraceToString())
}
}
}
fun queryUldGjcReceive(id: String) {
queryUldGjcReceiveLiveData.value = id
}
/**
* 集装器编号校验ULD重量
*/
private val updateUldGjcReceiveLiveData = MutableLiveData<JSONObject>()
val updateUldGjcReceiveObserver = Transformations.switchMap(updateUldGjcReceiveLiveData) { param ->
liveData(Dispatchers.IO) {
try {
var response = UserNetwork.updateUldGjcReceive(param)
emit(response)
} catch (e: Exception) {
Log.e("GoutStartViewModel", e.stackTraceToString())
}
}
}
fun updateUldGjcReceive(uld: String, uldWeight: Double) {
val param = JSONObject()
param["uld"] = uld
param["uldWeight"] = uldWeight
updateUldGjcReceiveLiveData.value = param
}
/**
* 托盘编号,查询托盘自重
*/
private val queryFlatcarGjcReceiveLiveData = MutableLiveData<String>()
val queryFlatcarGjcReceiveObserver = Transformations.switchMap(queryFlatcarGjcReceiveLiveData) { param ->
liveData(Dispatchers.IO) {
try {
var response = UserNetwork.queryFlatcarGjcReceive(param)
emit(response)
} catch (e: Exception) {
Log.e("GoutStartViewModel", e.stackTraceToString())
}
}
}
fun queryFlatcarGjcReceive(id: String) {
queryFlatcarGjcReceiveLiveData.value = id
}
/**
* 托盘编号,校验平板车重量
*/
private val updateFlatcarGjcReceiveLiveData = MutableLiveData<JSONObject>()
val updateFlatcarGjcReceiveObserver = Transformations.switchMap(updateFlatcarGjcReceiveLiveData) { param ->
liveData(Dispatchers.IO) {
try {
var response = UserNetwork.updateFlatcarGjcReceive(param)
emit(response)
} catch (e: Exception) {
Log.e("GoutStartViewModel", e.stackTraceToString())
}
}
}
fun updateFlatcarGjcReceive(carId: String, carWeight: Double) {
val param = JSONObject()
param["carId"] = carId
param["carWeight"] = carWeight
updateFlatcarGjcReceiveLiveData.value = param
}
}

View File

@@ -0,0 +1,160 @@
package com.lukouguoji.gjc.viewModel
import android.view.View
import androidx.lifecycle.MutableLiveData
import com.lukouguoji.gjc.R
import com.lukouguoji.gjc.holder.GjcUnLoadViewHolder
import com.lukouguoji.module_base.base.BasePageViewModel
import com.lukouguoji.module_base.bean.GjcUnLoadListBean
import com.lukouguoji.module_base.bean.GjcWaybillBean
import com.lukouguoji.module_base.common.Constant
import com.lukouguoji.module_base.common.ConstantEvent
import com.lukouguoji.module_base.http.net.NetApply
import com.lukouguoji.module_base.impl.FlowBus
import com.lukouguoji.module_base.ktx.commonAdapter
import com.lukouguoji.module_base.ktx.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.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.DictUtils
import dev.utils.app.info.KeyValue
class GjcUnLoadListViewModel : BasePageViewModel() {
// 目的港
val destPort = MutableLiveData("")
// 代理
val agent = MutableLiveData("")
// 特码
val specialCode = MutableLiveData("")
// 运单号
val waybillNo = MutableLiveData("")
val itemLayoutId = R.layout.item_gjc_un_load
val itemViewHolder = GjcUnLoadViewHolder::class.java
val agentList = MutableLiveData<List<KeyValue>>(emptyList())
val specialCodeList = MutableLiveData<List<KeyValue>>(emptyList())
// 选中条数
val count = MutableLiveData(0)
init {
DictUtils.getAgentList {
agentList.postValue(it)
}
DictUtils.getSpecialCodeList(flag = 1) {
specialCodeList.postValue(it)
}
}
/**
* 获取列表数据
*/
override fun getData() {
launchCollect({
NetApply.api
.getGjcUnloadWaybillList(
mapOf(
"dest" to destPort.value,
"agent" to agent.value,
"spCode" to specialCode.value,
"wbNo" to waybillNo.value,
).toRequestBody()
)
}) {
onSuccess = {
loge("获取列表数据成功 ${it.data?.size}")
pageModel.handleDataList(it.data)
}
onComplete = {
pageModel.finishLoading()
}
}
}
/**
* 搜索点击
*/
fun searchClick(view: View) {
refresh()
}
/**
* 运单号 扫描
*/
fun waybillNoScanClick(view: View) {
ScanModel.startScan(view.context.getActivity(), Constant.RequestCode.WAYBILL)
}
/**
* 按钮 点击
*/
fun btnClick(view: View) {
val list =
(pageModel.rv?.commonAdapter()?.items ?: emptyList()) as List<GjcWaybillBean>
val checkedList = list.filter { it.checked.get() }
if (checkedList.isEmpty()) {
showToast("请先选择运单")
return
}
FlowBus.with<List<GjcWaybillBean>>(ConstantEvent.GJC_UNLOAD_LIST_CHECKED)
.tryEmit(checkedList)
view.context.finish()
}
/**
* 代理 选中
*/
fun agentSelected(position: Int) {
agent.value = agentList.value?.get(position)?.value
}
/**
* 特码 选中
*/
fun specialCodeSelected(position: Int) {
specialCode.value = specialCodeList.value?.get(position)?.value
}
/**
* 全选 点击
*/
fun checkAllClick(view: View) {
CheckUtil.handleAllCheck(
pageModel.rv?.commonAdapter()?.items as? List<GjcWaybillBean> ?: emptyList()
)
computeSelectCount()
}
/**
* item 点击
*/
override fun onItemClick(position: Int, type: Int) {
when (type) {
R.id.iv_icon -> {
pageModel.rv?.commonAdapter()?.getItem(position)?.let { bean ->
(bean as GjcWaybillBean).checked.set(!bean.checked.get())
}
computeSelectCount()
}
else -> {}
}
}
private fun computeSelectCount() {
val list =
(pageModel.rv?.commonAdapter()?.items ?: emptyList()) as List<GjcWaybillBean>
count.postValue(list.filter { it.checked.get() }.size)
}
}

View File

@@ -0,0 +1,42 @@
package com.lukouguoji.gjc.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 GjcWareHouseInfoViewModel : ViewModel() {
private val logName = "GjcWareHouseInfoViewModel"
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.queryInfoByIdGjcWareHouse(param)
}
emit(response)
} catch (e: Exception) {
Log.e(logName, e.stackTraceToString())
}
}
}
fun queryInfoByIdWareHouse(wbId: Int) {
queryInfoByIdWareHouseLiveData.value = wbId
}
}

View File

@@ -0,0 +1,124 @@
package com.lukouguoji.gjc.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 GjcWareHouseListViewModel : ViewModel() {
/**
* 分页搜索
*/
private val searchParam = MutableLiveData<JSONObject>()
val searchParamLive = Transformations.switchMap(searchParam) { param ->
liveData(Dispatchers.IO) {
try {
val response = UserNetwork.searchGjcWareHouse(param)
emit(response)
} catch (e: Exception) {
Log.e("GoutCollectionViewModel", e.stackTraceToString())
}
}
}
fun search(
limit: Int,
page: Int,
carrier: String,
beginDate: String,
endDate: String,
fdate: String,//航班日期
fno: String,//航班编码
dest: String,//目的港
businessType: String,//业务类型
range: String,
status: String,
wbNo: String,
groupName: String,
agentCode: 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["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()
searchParam.value = param
}
/**
* 数据汇总
*/
val summaryObserver = Transformations.switchMap(searchParam) { param ->
liveData(Dispatchers.IO) {
try {
val response = UserNetwork.totalGjcWareHouse(param)
emit(response)
} catch (e: Exception) {
Log.e("GoutCollectionViewModel", 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.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())
}
}
}
}

View File

@@ -0,0 +1,77 @@
package com.lukouguoji.gjc.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
import kotlin.collections.set
class GjcYiKu2ListViewModel : ViewModel() {
/**
* 分页搜索
*/
private val searchParam = MutableLiveData<JSONObject>()
val searchParamLive = Transformations.switchMap(searchParam) { param ->
liveData(Dispatchers.IO) {
try {
val response = UserNetwork.searchMovedGjcYiKu(param)
emit(response)
} catch (e: Exception) {
Log.e("GoutCollectionViewModel", e.stackTraceToString())
}
}
}
fun search(
limit: Int,
page: Int,
beginDate: String,
endDate: String,
awbType: String,
id: String,
wbNo: String
) {
val param = JSONObject()
param["limit"] = limit
param["page"] = page
param["beginDate"] = beginDate.emptyToNull()
param["endDate"] = endDate.emptyToNull()
param["awbType"] = awbType.emptyToNull()
param["id"] = id.emptyToNull()
param["wbNo"] = wbNo.emptyToNull()
searchParam.value = param
}
/**
* 运单类型
*/
var awbList = JSONArray()
private val awbLiveData = MutableLiveData<String>()
fun awb(type: String) {
awbLiveData.value = type
}
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,102 @@
package com.lukouguoji.gjc.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 GjcYiKuListViewModel : 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.searchGjcYiKu(param)
emit(response)
} catch (e: Exception) {
Log.e("GoutCollectionViewModel", e.stackTraceToString())
}
}
}
fun search(
limit: Int,
page: Int,
wbNo: String,
dest: String,
carrier: String
) {
val param = JSONObject()
param["limit"] = limit
param["page"] = page
param["wbNo"] = wbNo.emptyToNull()
param["dest"] = dest.emptyToNull()
param["carrier"] = carrier.emptyToNull()
searchParam.value = param
}
/**
* 确认移库
*/
private val moveGnjYiKuLiveData = MutableLiveData<JSONObject>()
val moveGnjYiKuObserver = Transformations.switchMap(moveGnjYiKuLiveData) { param ->
liveData(Dispatchers.IO) {
try {
val response = UserNetwork.moveGjcYiKu(param)
emit(response)
} catch (e: Exception) {
Log.e("GoutCollectionViewModel", e.stackTraceToString())
}
}
}
fun moveGnjYiKu(ids: List<Int>) {
val temObj = JSONObject()
temObj["fid"] = 0 //随意填,不起作用
temObj["ids"] = ids
moveGnjYiKuLiveData.value = temObj
}
}

View File

@@ -0,0 +1,82 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.lukouguoji.gjc">
<application>
<activity
android:name=".activity.GjcGoodsAddActivity"
android:configChanges="orientation|keyboardHidden"
android:exported="false"
android:screenOrientation="userLandscape" />
<activity
android:name=".activity.GjcGoodsManifestActivity"
android:configChanges="orientation|keyboardHidden"
android:exported="false"
android:screenOrientation="userLandscape" />
<activity
android:name=".activity.GjcUnLoadListActivity"
android:configChanges="orientation|keyboardHidden"
android:exported="false"
android:screenOrientation="userLandscape" />
<activity
android:name=".activity.GjcBoxAssembleAddActivity"
android:configChanges="orientation|keyboardHidden"
android:exported="false"
android:screenOrientation="userLandscape" />
<activity
android:name=".activity.GjcGoodsListActivity"
android:configChanges="orientation|keyboardHidden"
android:exported="false"
android:screenOrientation="userLandscape" />
<activity
android:name=".activity.GjcYiKuListActivity"
android:configChanges="orientation|keyboardHidden"
android:exported="false"
android:screenOrientation="userLandscape" />
<activity
android:name=".activity.GjcQueryInfoActivity"
android:configChanges="orientation|keyboardHidden"
android:exported="false"
android:screenOrientation="userLandscape" />
<activity
android:name=".activity.GjcQueryListActivity"
android:configChanges="orientation|keyboardHidden"
android:exported="false"
android:screenOrientation="userLandscape" />
<activity
android:name=".activity.GjcWareHouseInfoActivity"
android:configChanges="orientation|keyboardHidden"
android:exported="false"
android:screenOrientation="userLandscape" />
<activity
android:name=".activity.GjcWareHouseActivity"
android:configChanges="orientation|keyboardHidden"
android:exported="false"
android:screenOrientation="userLandscape" />
<activity
android:name=".activity.GjcFuBangActivity"
android:configChanges="orientation|keyboardHidden"
android:exported="false"
android:screenOrientation="userLandscape" />
<activity
android:name=".activity.GjcStartReceiveActivity"
android:configChanges="orientation|keyboardHidden"
android:exported="false"
android:screenOrientation="userLandscape" />
<activity
android:name=".activity.GjcReceiveListActivity"
android:configChanges="orientation|keyboardHidden"
android:exported="false"
android:screenOrientation="userLandscape" />
<activity
android:name=".MainActivity"
android:configChanges="orientation|keyboardHidden"
android:exported="true"
android:screenOrientation="userLandscape" />
<activity
android:name=".activity.BoxAssembleActivity"
android:configChanges="orientation|keyboardHidden"
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,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,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,204 @@
<?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.gjc.viewModel.BoxAssembleViewModel" />
</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.BoxAssembleActivity">
<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::dateClick}">
<TextView
android:id="@+id/tv_date"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:hint="请选择组装日期"
android:text="@{viewModel.date}"
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: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.car}"
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::carScan}"
android:src="@mipmap/scan_code" />
</LinearLayout>
<!-- 目的港查询 -->
<LinearLayout
style="@style/ll_search"
android:layout_marginLeft="20dp">
<EditText
android:id="@+id/et_uld"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@drawable/input_edit_text"
android:gravity="center"
android:hint="请输入ULD编号"
android:imeOptions="actionDone"
android:inputType="text"
android:singleLine="true"
android:text="@={viewModel.uld}"
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::uldScan}"
android:src="@mipmap/scan_code" />
</LinearLayout>
<LinearLayout
style="@style/ll_search"
android:layout_marginLeft="20dp">
<androidx.appcompat.widget.AppCompatSpinner
android:id="@+id/spinner_status"
items="@{viewModel.statusList}"
onSelected="@{viewModel::statusSelected}"
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_cut"
items="@{viewModel.cutStatusList}"
onSelected="@{viewModel::cutStatusSelected}"
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>
</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"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
tools:listitem="@layout/item_box_assemble" />
</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,289 @@
<?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.gjc.viewModel.GjcBoxAssembleAddViewModel" />
</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">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<include layout="@layout/title_tool_bar" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:layout_marginRight="15dp"
android:gravity="center"
android:onClick="@{viewModel::onFilterClick}">
<ImageView
android:layout_width="30dp"
android:layout_height="30dp"
android:src="@mipmap/filtrate"
app:tint="@color/white" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:text="筛选"
android:textColor="@color/white"
android:textSize="20sp"
android:textStyle="bold" />
</LinearLayout>
</RelativeLayout>
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical">
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center_vertical"
android:orientation="horizontal"
android:padding="10dp">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text='@{"平板车:" + (viewModel.flatcarBean.carId ?? "")}'
android:textColor="#333"
android:textSize="25dp"
android:textStyle="bold" />
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text='@{"自\u3000\u3000重" + (viewModel.flatcarBean.carWeight ?? "")}' />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:text='@{"标\u3000\u3000重" + (viewModel.flatcarBean.signWeight ?? "")}' />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:text='@{"最大载重:" + (viewModel.flatcarBean.maxWeight ?? "")}' />
</androidx.appcompat.widget.LinearLayoutCompat>
</androidx.appcompat.widget.LinearLayoutCompat>
<View
android:layout_width="1dp"
android:layout_height="match_parent"
android:background="#666" />
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center_vertical"
android:orientation="horizontal"
android:padding="10dp">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text='@{"ULD" + (viewModel.uldBean.uld ?? "")}'
android:textColor="#333"
android:textSize="25dp"
android:textStyle="bold" />
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text='@{"自\u3000\u3000重" + (viewModel.uldBean.uldWeight ?? "")}' />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:text='@{"最大载重:" + (viewModel.uldBean.maxWeight ?? "")}' />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:text='@{"最大体积:" + (viewModel.uldBean.maxVolume ?? "")}' />
</androidx.appcompat.widget.LinearLayoutCompat>
</androidx.appcompat.widget.LinearLayoutCompat>
</androidx.appcompat.widget.LinearLayoutCompat>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#666" />
<com.scwang.smart.refresh.layout.SmartRefreshLayout
android:id="@+id/srl"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
app:srlEnableRefresh="false">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
tools:listitem="@layout/item_box_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:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text='@{"总件数:" + viewModel.totalCount + ",总重量" + viewModel.totalWeight + "KG"}'
android:textColor="@color/white"
android:textSize="16sp"
android:textStyle="bold" />
<RadioGroup
android:id="@+id/rg"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<RadioButton
android:id="@+id/tb_pbc"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="15dp"
android:background="#5c6890"
android:checked="@={viewModel.checkPBC}"
android:text="平板车"
android:textColor="#ecc490"
android:textSize="18sp"
android:textStyle="bold"
tools:checked="true" />
<RadioButton
android:id="@+id/tb_uld"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:background="#5c6890"
android:checked="@={viewModel.checkULD}"
android:text="ULD"
android:textColor="#ecc490"
android:textSize="18sp"
android:textStyle="bold" />
</RadioGroup>
<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="请输入平板车或ULD"
android:paddingLeft="8dp"
android:text="@={viewModel.plateOrUld}" />
<ImageView
android:layout_width="40dp"
android:layout_height="match_parent"
android:layout_gravity="center"
android:onClick="@{viewModel::onPlateOrUldClick}"
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"
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>
<TextView
style="@style/tv_bottom_btn"
android:onClick="@{viewModel::onConfirmClick}"
android:text="确认组装" />
</androidx.appcompat.widget.LinearLayoutCompat>
</androidx.appcompat.widget.LinearLayoutCompat>
</layout>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,217 @@
<?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.gjc.viewModel.GjcGoodsAddViewModel" />
</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.GjcGoodsAddActivity">
<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
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.truckNo}"
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::truckNoScan}"
android:src="@mipmap/scan_code" />
</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:id="@+id/et_uld"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@drawable/input_edit_text"
android:gravity="center"
android:hint="请输入ULD编号"
android:imeOptions="actionDone"
android:inputType="text"
android:singleLine="true"
android:text="@={viewModel.uldNo}"
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::uldNoScan}"
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::searchClick}"
android:padding="10dp">
<ImageView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:src="@mipmap/search"
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_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_margin="5dp"
app:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
app:spanCount="3"
tools:listitem="@layout/item_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:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text='@{"合计:" +viewModel.size+ "辆平板车," +viewModel.size+ "台ULD"}'
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::confirmClick}"
android:text="确认交接" />
</androidx.appcompat.widget.LinearLayoutCompat>
</androidx.appcompat.widget.LinearLayoutCompat>
</layout>

View File

@@ -0,0 +1,217 @@
<?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.gjc.viewModel.GjcGoodsListViewModel" />
</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.GjcGoodsListActivity">
<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
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.truckNo}"
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::truckNoScan}"
android:src="@mipmap/scan_code" />
</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:id="@+id/et_uld"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@drawable/input_edit_text"
android:gravity="center"
android:hint="请输入ULD编号"
android:imeOptions="actionDone"
android:inputType="text"
android:singleLine="true"
android:text="@={viewModel.uldNo}"
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::uldNoScan}"
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::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="0.8" />
</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"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
tools:listitem="@layout/item_gjc_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,253 @@
<?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.gjc.viewModel.GjcGoodsManifestViewModel" />
</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="2"
android:background="@drawable/bg_border_excel"
android:gravity="center"
android:text="ULD编号"
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"
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.5"
android:background="@drawable/bg_border_excel"
android:gravity="center"
android:text="重量(KG)"
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_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"
tools:text="交接时间2023-11-11 11:11:11" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="30dp"
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,159 @@
<?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.GjcQueryInfoActivity">
<include layout="@layout/title_tool_bar" />
<!--运单信息 中间-->
<androidx.core.widget.NestedScrollView
android:id="@+id/scrollView"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginLeft="20dp"
android:layout_marginTop="20dp"
android:layout_marginRight="20dp"
android:layout_weight="5"
android: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,891 @@
<?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.GjcQueryListActivity">
<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">
<!-- 开始日期-->
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="3"
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>
<!-- 空格-->
<LinearLayout
android:layout_width="20dp"
android:layout_height="match_parent">
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:text="-"
android:textColor="@color/weak_grey"
android:textSize="25dp" />
</LinearLayout>
<!-- 结束日期-->
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="3"
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="3"
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_height="match_parent"
android:layout_weight="3"
android:background="@drawable/bg_search_row">
<EditText
android:id="@+id/mudiGang"
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:maxLines="1"
android:singleLine="true"
android:textSize="15dp" />
</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: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/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
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="入库时间" />
&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">
<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">
<EditText
android:id="@+id/wbNo"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginLeft="2dp"
android:layout_weight="1"
android:background="@drawable/input_edit_text"
android:hint="请输入运单号"
android:imeOptions="actionDone"
android:inputType="number"
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,224 @@
<?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.GjcReceiveListActivity"
tools:ignore="ResourceName">
<include layout="@layout/title_tool_bar" />
<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"
android:paddingTop="5dp"
android:paddingBottom="5dp">
&lt;!&ndash; 主运单&ndash;&gt;
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="4"
android:background="@drawable/search_shape_gnc_ware_house">
<EditText
android:id="@+id/wbNo"
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="10dp" />
<ImageView
android:id="@+id/wbNoScanIcon"
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" />
&lt;!&ndash;分运单 &ndash;&gt;
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="4"
android:background="@drawable/search_shape_gnc_ware_house"
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="10dp" />
<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" />
&lt;!&ndash; 代理人&ndash;&gt;
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="3"
android:background="@drawable/search_shape_gnc_ware_house">
<EditText
android:id="@+id/agentCode"
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="10dp" />
</LinearLayout>
<LinearLayout
android:layout_width="20dp"
android:layout_height="match_parent" />
&lt;!&ndash; 搜索图标&ndash;&gt;
<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>-->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_marginTop="10dp"
android:background="@drawable/search_shape"
android:orientation="horizontal">
<ImageView
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_gravity="center"
android:layout_marginLeft="30dp"
android:hint="@color/white"
android:src="@mipmap/search" />
<EditText
android:id="@+id/wbNo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="2dp"
android:layout_weight="1"
android:background="@android:color/transparent"
android:hint="请输入运单号、运单后4位或代理"
android:imeOptions="actionDone"
android:inputType="text"
android:maxLines="1"
android:singleLine="true"
android:textSize="16dp" />
<ImageView
android:id="@+id/wbNoScanIcon"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_gravity="center"
android:layout_marginLeft="30dp"
android:src="@mipmap/scan_code" />
<TextView
android:id="@+id/search"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:gravity="center_vertical"
android:text="搜索"
android:textColor="@color/colorPrimary"
/>
</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>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,203 @@
<?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.gjc.viewModel.GjcUnLoadListViewModel" />
</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.GjcUnLoadListActivity">
<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">
<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.destPort}"
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.agent}"
android:textSize="15dp" />
<androidx.appcompat.widget.AppCompatSpinner
items="@{viewModel.agentList}"
onSelected="@{viewModel::agentSelected}"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
<LinearLayout
style="@style/ll_search"
android:layout_marginLeft="20dp">
<androidx.appcompat.widget.AppCompatSpinner
items="@{viewModel.specialCodeList}"
onSelected="@{viewModel::specialCodeSelected}"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</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.specialCode}"
android:textSize="15dp" />
<ImageView
android:layout_width="40dp"
android:layout_height="match_parent"
android:onClick="@{viewModel::waybillNoScanClick}"
android:padding="10dp"
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::searchClick}"
android:padding="10dp">
<ImageView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:src="@mipmap/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::checkAllClick}"
android:text="全选" />
<ImageView
android:id="@+id/checkIcon"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_marginLeft="5dp"
android:onClick="@{viewModel::checkAllClick}"
android:src="@drawable/img_check_all" />
</androidx.appcompat.widget.LinearLayoutCompat>
<com.scwang.smart.refresh.layout.SmartRefreshLayout
android:id="@+id/srl"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv"
itemLayoutId="@{viewModel.itemLayoutId}"
viewHolder="@{viewModel.itemViewHolder}"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
tools:listitem="@layout/item_gjc_un_load" />
</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.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::btnClick}"
android:text="装\u3000货" />
</androidx.appcompat.widget.LinearLayoutCompat>
</androidx.appcompat.widget.LinearLayoutCompat>
</layout>

View File

@@ -0,0 +1,584 @@
<?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.GjcWareHouseActivity">
<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">
<!-- &lt;!&ndash;开始日期&ndash;&gt;
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="5"
android:background="@drawable/search_shape_gnc_ware_house"
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>
&lt;!&ndash; 空格&ndash;&gt;
<LinearLayout
android:layout_width="20dp"
android:layout_height="match_parent">
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:text="-"
android:textColor="@color/weak_grey"
android:textSize="25dp" />
</LinearLayout>
&lt;!&ndash; 结束日期 &ndash;&gt;
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="5"
android:background="@drawable/search_shape_gnc_ware_house"
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" />
&lt;!&ndash; 航班日期&ndash;&gt;
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="5"
android:background="@drawable/search_shape_gnc_ware_house"
android:orientation="horizontal">
<TextView
android:id="@+id/flightDate"
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/flightDateIcon"
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" />
&lt;!&ndash; 航班号&ndash;&gt;
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="5"
android:background="@drawable/search_shape_gnc_ware_house">
<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="10dp"
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:gravity="center"
android:orientation="horizontal">
<EditText
android:id="@+id/waybillNo"
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: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:gravity="center"
android:orientation="horizontal">
<EditText
android:id="@+id/carrier"
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: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:gravity="center"
android:orientation="horizontal">
<EditText
android:id="@+id/mudiGang"
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: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:gravity="center"
android:orientation="horizontal">
<TextView
android:id="@+id/businessType"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/input_edit_text"
android:gravity="center"
android:hint="请输入业务类型"
android:inputType="text"
android: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">
<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
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,47 @@
<?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.GjcWareHouseInfoActivity">
<include layout="@layout/title_tool_bar" />
<!--运单信息 中间-->
<androidx.core.widget.NestedScrollView
android:id="@+id/scrollView"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginLeft="20dp"
android:layout_marginTop="20dp"
android:layout_marginRight="20dp"
android:layout_marginBottom="20dp"
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,17 @@
<?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.GjcYiKuListActivity">
<androidx.viewpager2.widget.ViewPager2
android:id="@+id/viewpager2"
android:layout_width="match_parent"
android:layout_height="match_parent">
</androidx.viewpager2.widget.ViewPager2>
</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,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.gjc.dialog.GjcBoxAddSelectDialogModel" />
</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,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.gjc.dialog.BoxBatchDialogModel" />
</data>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/color_f2"
android:gravity="center_horizontal"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="40dp"
android:background="@color/colorPrimary"
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='@{"运单号: " + model.bean.waybillCode}'
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.gjc.dialog.GjcUldSelectDialogModel" />
</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="以下ULD数据有重复请选择一条"
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_uld" />
<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,320 @@
<?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"
xmlns:app="http://schemas.android.com/apk/res-auto"
tools:context=".fragment.GjcYiKuFragment"
android:orientation="vertical">
<include layout="@layout/title_tool_bar" />
<!-- 搜索、列表页-->
<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:gravity="center"
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">
<EditText
android:id="@+id/wbNo"
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/wbNoScanIcon"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_gravity="center"
android:layout_marginLeft="2dp"
android:layout_marginRight="10dp"
android:src="@mipmap/scan_code" />
</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">
<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: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"
android:orientation="horizontal">
<EditText
android:id="@+id/dest"
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" />
</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>
<!--列表-->
<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="30dp"
android:layout_height="30dp"
android:layout_marginLeft="2dp"
android:src="@mipmap/gjc_check_icon" />
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="5dp"
android:gravity="center|right"
android:text="快速检索" />
<EditText
android:id="@+id/quickSearch"
android:layout_width="100dp"
android:layout_height="20dp"
android:layout_gravity="center"
android:background="@drawable/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/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>

View File

@@ -0,0 +1,441 @@
<?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=".fragment.GjcYiKu2Fragment"
android:orientation="vertical">
<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">
<!-- 开始日期-->
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="3"
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>
<!-- 空格-->
<LinearLayout
android:layout_width="20dp"
android:layout_height="match_parent">
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:text="-"
android:textColor="@color/weak_grey"
android:textSize="25dp" />
</LinearLayout>
<!-- 结束日期-->
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="3"
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="3"
android:background="@drawable/bg_search_row">
<TextView
android:id="@+id/awbType"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/input_edit_text"
android:gravity="center"
android:hint="运单类型"
android:inputType="text"
android:maxLines="1"
android:singleLine="true"
android:text=""
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="3"
android:orientation="horizontal"
android:background="@drawable/bg_search_row">
<EditText
android:id="@+id/id"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="match_parent"
android:background="@drawable/input_edit_text"
android:gravity="center"
android:hint="移库单编号"
android:imeOptions="actionDone"
android:inputType="text"
android:maxLines="1"
android:singleLine="true"
android:textSize="15dp" />
<ImageView
android:id="@+id/idScanIcon"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_gravity="center"
android:layout_marginLeft="2dp"
android:layout_marginRight="10dp"
android:src="@mipmap/scan_code" />
</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: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/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="visible">
<!-- 筛选内容-->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginLeft="40dp"
android:layout_marginTop="20dp"
android:layout_marginRight="40dp"
android:layout_weight="5"
android:background="@drawable/home_shape"
android:orientation="vertical"
android:paddingLeft="50dp"
android:paddingTop="10dp"
android:paddingRight="50dp"
android:paddingBottom="10dp">
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<!-- 运单号-->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_marginTop="10dp">
<TextView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginRight="5dp"
android:layout_weight="1"
android:gravity="center_vertical|right"
android:text="运单号" />
<!--内容-->
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginTop="5dp"
android:layout_weight="3"
android:background="@drawable/input_shape"
android:gravity="center"
android:orientation="horizontal">
<EditText
android:id="@+id/wbNo"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginLeft="2dp"
android:layout_weight="1"
android:background="@drawable/input_edit_text"
android:hint="请输入运单号"
android:imeOptions="actionDone"
android:inputType="number"
android:maxLines="1"
android:singleLine="true"
android:text=""
/>
<ImageView
android:id="@+id/wbNoScanIcon"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_gravity="center"
android:layout_marginLeft="2dp"
android:layout_marginRight="10dp"
android:src="@mipmap/scan_code" />
</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,50 @@
<?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:background="@drawable/input_shape"
android:gravity="center"
android:orientation="horizontal"
android:paddingLeft="10dp">
<TextView
android:id="@+id/title"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="start|center"
android:text="过磅重量" />
<EditText
android:id="@+id/content"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginLeft="2dp"
android:paddingRight="5dp"
android:layout_weight="3"
android:gravity="center|start"
android:maxLines="1"
android:singleLine="true"
android:cursorVisible="false"
android:focusable="false"
android:focusableInTouchMode="false"
android:background="@drawable/input_edit_text"
android:text="0.0"
android:textColor="@color/black"/>
</LinearLayout>
</LinearLayout>

View File

@@ -0,0 +1,211 @@
<?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="105dp"
android:layout_marginTop="5dp"
android:background="@drawable/collect_item_shape"
android:orientation="horizontal"
android:padding="10dp">
<ImageView
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_gravity="center"
android:src="@mipmap/fubang_list_left_icon" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginLeft="20dp"
android:layout_weight="1"
android:orientation="vertical">
<!-- 库位 行-->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:gravity="center_vertical"
android:orientation="horizontal">
<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/location"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="2dp"
android:text=""
android:textColor="@color/colorPrimary"
/>
</LinearLayout>
<!-- 第二行-->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
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">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="1"
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/pc"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="2dp"
android:text="" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="1"
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/weight"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="2dp"
android:text="" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="1"
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/flight"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="2dp"
android:text="" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
<!-- 第三行-->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
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">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="1"
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/opDate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="2dp"
android:text="" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="1"
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/opId"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="2dp"
android:text="" />
</LinearLayout>
</LinearLayout>
<!-- 占位-->
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1">
</LinearLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>

View File

@@ -0,0 +1,275 @@
<?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="105dp"
android:layout_marginTop="5dp"
android:background="@drawable/collect_item_shape"
android:orientation="horizontal"
android:padding="10dp">
<ImageView
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:orientation="vertical">
<!-- 运单号行-->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center_vertical"
android:orientation="horizontal">
<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/no"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="2dp"
android:gravity="center"
android:text=""
android:textColor="@color/colorPrimary"
/>
</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">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="1"
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/flight"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="2dp"
android:text="" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="2">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="1"
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/range"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="2dp"
android:text="" />
</LinearLayout>
</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="wrap_content"
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:text="" />
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="1"
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/goods"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="2dp"
android:maxLines="1"
android:singleLine="true"
android:text="" />
</LinearLayout>
</LinearLayout>
</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">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="1"
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/fclose"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="2dp"
android:text="" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="2">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="1"
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/businessType"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="2dp"
android:text="" />
</LinearLayout>
</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="wrap_content"
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:text="" />
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="1"
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/weight"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="2dp"
android:text="" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>

View File

@@ -0,0 +1,244 @@
<?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="70dp"
android:layout_marginTop="5dp"
android:background="@drawable/collect_item_shape"
android:orientation="horizontal"
android:padding="10dp">
<ImageView
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_gravity="center"
android:src="@mipmap/list_item_left_icon" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginLeft="20dp"
android:layout_weight="1"
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="1.5"
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/no"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="2dp"
android:singleLine="true"
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="wrap_content"
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:text="0"
android:textColor="@color/textValue" />
</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="wrap_content"
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:text="0"
android:textColor="@color/textValue" />
</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="wrap_content"
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:text=""
android:textColor="@color/textValue" />
</LinearLayout>
</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="1.5">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="1"
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/flight"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="2dp"
android:text=""
android:textColor="@color/textValue" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="1"
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/spCode"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="2dp"
android:text=""
android:textColor="@color/textValue" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="1"
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/goods"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="2dp"
android:text=""
android:textColor="@color/textValue" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="1"
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/businessType"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="2dp"
android:text=""
android:textColor="@color/textValue" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>

View File

@@ -0,0 +1,50 @@
<?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:background="@drawable/input_shape"
android:gravity="center"
android:orientation="horizontal"
android:paddingLeft="10dp">
<TextView
android:id="@+id/title"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="start|center"
android:text="过磅重量" />
<EditText
android:id="@+id/content"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginLeft="2dp"
android:paddingRight="5dp"
android:layout_weight="3"
android:gravity="center|start"
android:maxLines="1"
android:singleLine="true"
android:cursorVisible="false"
android:focusable="false"
android:focusableInTouchMode="false"
android:background="@drawable/input_edit_text"
android:text="0.0"
android:textColor="@color/black"/>
</LinearLayout>
</LinearLayout>

View File

@@ -0,0 +1,529 @@
<?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="vertical"
tools:ignore="MissingDefaultResource">
<LinearLayout
android:id="@+id/groupNameLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:orientation="horizontal"
android:visibility="gone">
<TextView
android:id="@+id/groupTitle"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="目的港:" />
<TextView
android:id="@+id/groupContent"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="北京,入库天数:" />
<TextView
android:id="@+id/days"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="32"
android:textColor="@color/red"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="70dp"
android:background="@drawable/collect_item_shape"
android:orientation="horizontal"
android:paddingLeft="10dp"
android:paddingRight="10dp">
<ImageView
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="0dp"
android:layout_weight="1"
android:gravity="center_vertical"
android:orientation="horizontal">
<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/no"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginLeft="2dp"
android:gravity="center_vertical"
android:text="A123456789"
android:textColor="@color/colorPrimary"
android:textSize="18sp" />
</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="0dp"
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/pc"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="2dp"
android:textColor="@color/weak_grey2"
android:text="" />
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="1"
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/weight"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="2dp"
android:textColor="@color/weak_grey2"
android:text="" />
</LinearLayout>
</LinearLayout>
<!-- 航班号-->
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="2">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="1"
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/flight"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="2dp"
android:textColor="@color/weak_grey2"
android:text="" />
</LinearLayout>
</LinearLayout>
<!-- 入库时间-->
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="2">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="1"
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/date"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="2dp"
android:textColor="@color/weak_grey2"
android:text="" />
</LinearLayout>
</LinearLayout>
<!--&lt;!&ndash; 品名&ndash;&gt;
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="1"
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/goods"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="2dp"
android:text="" />
</LinearLayout>
</LinearLayout>
&lt;!&ndash; 特码&ndash;&gt;
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="1"
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/spCode"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="2dp"
android:text="" />
</LinearLayout>
</LinearLayout>
&lt;!&ndash; 代理人&ndash;&gt;
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="1"
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/agentCode"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="2dp"
android:text="" />
</LinearLayout>
</LinearLayout>
&lt;!&ndash; 承运人&ndash;&gt;
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="1"
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/by1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="2dp"
android:text="" />
</LinearLayout>
</LinearLayout>
&lt;!&ndash; 始发港&ndash;&gt;
<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/origin"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="2dp"
android:text="" />
</LinearLayout>-->
</LinearLayout>
<!--&lt;!&ndash; 分割线&ndash;&gt;
<View
android:layout_width="match_parent"
android:layout_height="2dp"
android:background="@drawable/dash_line"
android:layerType="software" />
&lt;!&ndash; 第三行&ndash;&gt;
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginTop="5dp"
android:layout_weight="1"
android:gravity="center_vertical"
android:orientation="horizontal">
&lt;!&ndash; 航班号&ndash;&gt;
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="1"
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/fno"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="2dp"
android:text="" />
</LinearLayout>
</LinearLayout>
&lt;!&ndash; 库位&ndash;&gt;
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="1"
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/location"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="2dp"
android:text="" />
</LinearLayout>
</LinearLayout>
&lt;!&ndash; 运单类型&ndash;&gt;
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="1"
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/awbType"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="2dp"
android:text="" />
</LinearLayout>
</LinearLayout>
&lt;!&ndash; 业务类型&ndash;&gt;
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="1"
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/businessType"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="2dp"
android:text="" />
</LinearLayout>
</LinearLayout>
&lt;!&ndash; 状态&ndash;&gt;
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="1"
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/status"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="2dp"
android:text="" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="2">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="1"
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/date"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="2dp"
android:text="" />
</LinearLayout>
</LinearLayout>
</LinearLayout>-->
</LinearLayout>
</LinearLayout>
</LinearLayout>

View File

@@ -0,0 +1,345 @@
<?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: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="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:text=""
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="wrap_content"
android:gravity="center"
android:text="移库单编号"
android:textColor="@color/weak_grey" />
<TextView
android:id="@+id/id"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="2dp"
android:text=""
android:textColor="@color/colorPrimary"
/>
</LinearLayout>
</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="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:text=""
android:textColor="@color/weak_grey2" />
</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:text=""
android:textColor="@color/weak_grey2" />
</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:ellipsize="end"
android:maxLines="1"
android:singleLine="true"
android:text=""
android:textColor="@color/weak_grey2" />
</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:text=""
android:textColor="@color/weak_grey2" />
</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:text=""
android:textColor="@color/weak_grey2" />
</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/origin"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="2dp"
android:ellipsize="end"
android:maxLines="1"
android:singleLine="true"
android:text=""
android:textColor="@color/weak_grey2" />
</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/dest"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="2dp"
android:ellipsize="end"
android:maxLines="1"
android:singleLine="true"
android:text=""
android:textColor="@color/weak_grey2" />
</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/by1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="2dp"
android:ellipsize="end"
android:maxLines="1"
android:singleLine="true"
android:text=""
android:textColor="@color/weak_grey2" />
</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/awbType"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="2dp"
android:ellipsize="end"
android:maxLines="1"
android:singleLine="true"
android:text=""
android:textColor="@color/weak_grey2" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>

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