<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools">

    <data>
        <import type="com.lukouguoji.module_base.ui.weight.data.layout.DataLayoutType" />
        <variable
            name="viewModel"
            type="com.lukouguoji.gjc.viewModel.GjcQueryEditViewModel" />
    </data>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@color/color_f2"
        android:orientation="vertical">

        <!-- 标题栏 -->
        <include layout="@layout/title_tool_bar" />

        <ScrollView
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_weight="1"
            android:fillViewport="true">

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="vertical"
                android:padding="15dp">

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:background="@drawable/bg_white_radius_8"
                    android:orientation="vertical"
                    android:padding="15dp">

                    <LinearLayout
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:orientation="horizontal">

                        <com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
                            android:layout_width="0dp"
                            android:layout_height="wrap_content"
                            android:layout_weight="1"
                            enable="@{false}"
                            title='@{"运单号"}'
                            titleLength="@{5}"
                            type="@{DataLayoutType.INPUT}"
                            value='@{viewModel.dataBean.wbNo}' />

                        <com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
                            android:layout_width="0dp"
                            android:layout_height="wrap_content"
                            android:layout_weight="1"
                            enable="@{false}"
                            title='@{"代理人"}'
                            titleLength="@{5}"
                            type="@{DataLayoutType.INPUT}"
                            value='@{viewModel.dataBean.agentName}' />

                        <com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
                            android:layout_width="0dp"
                            android:layout_height="wrap_content"
                            android:layout_weight="1"
                            enable="@{true}"
                            hint='@{"请输入特码"}'
                            title='@{"特码"}'
                            titleLength="@{5}"
                            type="@{DataLayoutType.INPUT}"
                            value='@={viewModel.dataBean.spCode}' />

                    </LinearLayout>

                    <LinearLayout
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_marginTop="8dp"
                        android:orientation="horizontal">

                        <com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
                            android:layout_width="0dp"
                            android:layout_height="wrap_content"
                            android:layout_weight="1"
                            enable="@{false}"
                            title='@{"运单件数"}'
                            titleLength="@{5}"
                            type="@{DataLayoutType.INPUT}"
                            value='@{viewModel.dataBean.pc != null ? String.valueOf(viewModel.dataBean.pc) : ``}' />

                        <com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
                            android:layout_width="0dp"
                            android:layout_height="wrap_content"
                            android:layout_weight="1"
                            enable="@{false}"
                            title='@{"运单重量"}'
                            titleLength="@{5}"
                            type="@{DataLayoutType.INPUT}"
                            value='@{viewModel.dataBean.weight != null ? String.valueOf(viewModel.dataBean.weight) : ``}' />

                        <com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
                            android:layout_width="0dp"
                            android:layout_height="wrap_content"
                            android:layout_weight="1"
                            enable="@{false}"
                            title='@{"业务类型"}'
                            titleLength="@{5}"
                            type="@{DataLayoutType.INPUT}"
                            value='@{viewModel.dataBean.businessName}' />

                    </LinearLayout>

                    <LinearLayout
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_marginTop="8dp"
                        android:orientation="horizontal">

                        <com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
                            android:layout_width="0dp"
                            android:layout_height="wrap_content"
                            android:layout_weight="1"
                            enable="@{false}"
                            title='@{"入库件数"}'
                            titleLength="@{5}"
                            type="@{DataLayoutType.INPUT}"
                            value='@{viewModel.dataBean.arrivePc != null ? String.valueOf(viewModel.dataBean.arrivePc) : ``}' />

                        <com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
                            android:layout_width="0dp"
                            android:layout_height="wrap_content"
                            android:layout_weight="1"
                            enable="@{false}"
                            title='@{"入库重量"}'
                            titleLength="@{5}"
                            type="@{DataLayoutType.INPUT}"
                            value='@{viewModel.dataBean.arriveWeight != null ? String.valueOf(viewModel.dataBean.arriveWeight) : ``}' />

                        <com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
                            android:layout_width="0dp"
                            android:layout_height="wrap_content"
                            android:layout_weight="1"
                            enable="@{false}"
                            title='@{"计费重量"}'
                            titleLength="@{5}"
                            type="@{DataLayoutType.INPUT}"
                            value='@{viewModel.dataBean.weight != null ? String.valueOf(viewModel.dataBean.weight) : ``}' />

                    </LinearLayout>

                    <LinearLayout
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_marginTop="8dp"
                        android:orientation="horizontal">

                        <com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
                            android:layout_width="0dp"
                            android:layout_height="wrap_content"
                            android:layout_weight="1"
                            enable="@{false}"
                            title='@{"承运人"}'
                            titleLength="@{5}"
                            type="@{DataLayoutType.INPUT}"
                            value='@{viewModel.dataBean.by0}' />

                        <com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
                            android:layout_width="0dp"
                            android:layout_height="wrap_content"
                            android:layout_weight="1"
                            enable="@{false}"
                            title='@{"航程"}'
                            titleLength="@{5}"
                            type="@{DataLayoutType.INPUT}"
                            value='@{viewModel.dataBean.range}' />

                        <com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
                            android:layout_width="0dp"
                            android:layout_height="wrap_content"
                            android:layout_weight="1"
                            enable="@{true}"
                            hint='@{"请选择包装类型"}'
                            list="@{viewModel.packageTypeList}"
                            title='@{"包装类型"}'
                            titleLength="@{5}"
                            type="@{DataLayoutType.SPINNER}"
                            value='@={viewModel.dataBean.packageType}' />

                    </LinearLayout>

                    <LinearLayout
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_marginTop="8dp"
                        android:orientation="horizontal">

                        <com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
                            android:layout_width="0dp"
                            android:layout_height="wrap_content"
                            android:layout_weight="1"
                            enable="@{false}"
                            title='@{"品名(中)"}'
                            titleLength="@{5}"
                            type="@{DataLayoutType.INPUT}"
                            value='@{viewModel.dataBean.goodsCn}' />

                        <com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
                            android:layout_width="0dp"
                            android:layout_height="wrap_content"
                            android:layout_weight="1"
                            enable="@{false}"
                            title='@{"品名(英)"}'
                            titleLength="@{5}"
                            type="@{DataLayoutType.INPUT}"
                            value='@{viewModel.dataBean.goods}' />

                        <com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
                            android:layout_width="0dp"
                            android:layout_height="wrap_content"
                            android:layout_weight="1"
                            enable="@{true}"
                            hint='@{"请输入UN编号"}'
                            title='@{"UN编号"}'
                            titleLength="@{5}"
                            type="@{DataLayoutType.INPUT}"
                            value='@={viewModel.dataBean.unNumber}' />

                    </LinearLayout>

                    <LinearLayout
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_marginTop="8dp"
                        android:orientation="horizontal">

                        <com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
                            android:layout_width="0dp"
                            android:layout_height="wrap_content"
                            android:layout_weight="1"
                            enable="@{true}"
                            hint='@{"请选择运单类型"}'
                            list="@{viewModel.waybillTypeList}"
                            title='@{"运单类型"}'
                            titleLength="@{5}"
                            type="@{DataLayoutType.SPINNER}"
                            value='@={viewModel.dataBean.awbType}' />

                        <Space
                            android:layout_width="0dp"
                            android:layout_height="wrap_content"
                            android:layout_weight="2" />

                    </LinearLayout>

                    <com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_marginTop="8dp"
                        enable="@{true}"
                        hint='@{"请输入备注"}'
                        inputHeight="@{80}"
                        title='@{"备注"}'
                        titleLength="@{5}"
                        type="@{DataLayoutType.INPUT}"
                        value='@={viewModel.dataBean.remark}' />

                </LinearLayout>

                <!-- 底部操作按钮 -->
                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="56dp"
                    android:layout_marginTop="24dp"
                    android:gravity="center"
                    android:paddingHorizontal="15dp">

                    <!-- 取消按钮 -->
                    <TextView
                        style="@style/tv_bottom_btn"
                        android:layout_width="120dp"
                        android:layout_marginEnd="20dp"
                        android:onClick="@{()-> viewModel.cancel()}"
                        android:text="取消" />

                    <!-- 保存按钮 -->
                    <TextView
                        style="@style/tv_bottom_btn"
                        android:layout_width="120dp"
                        android:onClick="@{()-> viewModel.submit()}"
                        android:text="保存" />

                </LinearLayout>

            </LinearLayout>

        </ScrollView>

    </LinearLayout>
</layout>
