konghe 1 год назад
Родитель
Сommit
8fa067b63d
3 измененных файлов с 436 добавлено и 298 удалено
  1. 285 232
      res/layout/activity_send_out_goods.xml
  2. 24 24
      res/layout/send_out_goods.xml
  3. 127 42
      src/com/jiaju/activity/SendOutGoods.java

+ 285 - 232
res/layout/activity_send_out_goods.xml

@@ -1,23 +1,26 @@
+<?xml version="1.0" encoding="utf-8"?>
 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:tools="http://schemas.android.com/tools"
+    android:id="@+id/parentRel"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
-    android:background="@color/background"
-    tools:context="${relativePackage}.${activityClass}" >
+    android:background="@color/background">
 
-   <include
-        android:id="@+id/suspend_title"
+    <include
+        android:id="@+id/check_title"
         layout="@layout/fragment_title" />
-
-   <LinearLayout
-        android:id="@+id/bottom"
-        android:layout_width="fill_parent"
-        android:layout_height="wrap_content"
-        android:layout_alignParentBottom="true"
-        android:gravity="center_horizontal"
-        android:orientation="horizontal" >
-
-        <Button
+    
+     <LinearLayout
+      android:id="@+id/sendLay"
+      android:layout_width="fill_parent"
+      android:layout_height="wrap_content"
+      android:layout_alignParentBottom="true"
+       android:background="@color/qingcolor"
+      android:gravity="center_horizontal"
+      android:orientation="horizontal"
+      >
+
+
+ <Button
             android:id="@+id/btnSave"
             android:layout_width="0dp"
             android:layout_height="50dp"
@@ -27,23 +30,37 @@
             android:text="保存"
             android:textColor="@color/white"
             android:textSize="@dimen/textsize_24" />
-    </LinearLayout>
 
-        <LinearLayout
-            android:layout_width="fill_parent"
+</LinearLayout> 
+       
+
+    <ScrollView
+        android:id="@+id/scrollLay"
+        android:layout_width="match_parent"
+        android:layout_height="300dp"
+        android:layout_above="@id/sendLay"
+        android:layout_marginBottom="3dp"
+        android:scrollbars="vertical"
+        android:layout_below="@id/check_title" >
+
+        <RelativeLayout
+            android:layout_width="match_parent"
             android:layout_height="wrap_content"
-            android:layout_above="@id/bottom"
-            android:layout_below="@id/suspend_title"
-            android:orientation="vertical" >
+            android:focusableInTouchMode="true" >
 
             <LinearLayout
-                android:id="@+id/procedurelay"
+                android:id="@+id/productlinelay"
                 android:layout_width="fill_parent"
                 android:layout_height="wrap_content"
-                android:layout_marginTop="15dp"
-                android:orientation="horizontal" >
+                android:orientation="vertical" >
+
+                <LinearLayout
+                    android:layout_width="fill_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_marginTop="5dp"
+                    android:orientation="horizontal" >
 
-                <com.jiaju.widget.JustifyTextView
+                     <com.jiaju.widget.JustifyTextView
                     android:id="@+id/procedureTitle"
                     android:layout_width="70dp"
                     android:layout_height="wrap_content"
@@ -53,7 +70,7 @@
                     android:textColor="@color/white"
                     android:textSize="@dimen/textsize_16" />
 
-                <TextView
+                    <TextView
                     android:layout_width="wrap_content"
                     android:layout_height="wrap_content"
                     android:layout_gravity="center_vertical"
@@ -61,14 +78,8 @@
                     android:textColor="@color/white"
                     android:textSize="@dimen/textsize_16" />
 
-                <LinearLayout
-                    android:id="@+id/procedureLay"
-                    android:layout_width="fill_parent"
-                    android:layout_height="wrap_content"
-                    android:orientation="horizontal" >
-
                     <LinearLayout
-                        android:layout_width="wrap_content"
+                        android:layout_width="fill_parent"
                         android:layout_height="wrap_content"
                         android:orientation="vertical" >
 
@@ -83,21 +94,22 @@
                             android:textSize="@dimen/textsize_20" />
 
                         <View
-                            android:layout_width="150dp"
+                            android:layout_width="wrap_content"
                             android:layout_height="1dp"
+                            android:layout_marginRight="10dp"
+                            android:layout_marginTop="1dp"
                             android:background="@color/text_gray" />
                     </LinearLayout>
                 </LinearLayout>
-            </LinearLayout>
 
-            <LinearLayout
-                android:id="@+id/LinearLayout06"
-                android:layout_width="fill_parent"
-                android:layout_height="wrap_content"
-                android:layout_marginTop="15dp"
-                android:orientation="horizontal" >
+                <LinearLayout
+                    android:id="@+id/LinearLayout06"
+                    android:layout_width="fill_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_marginTop="3dp"
+                    android:orientation="horizontal" >
 
-                <com.jiaju.widget.JustifyTextView
+                    <com.jiaju.widget.JustifyTextView
                     android:id="@+id/JustifyTextView05"
                     android:layout_width="70dp"
                     android:layout_height="wrap_content"
@@ -107,26 +119,21 @@
                     android:textColor="@color/white"
                     android:textSize="@dimen/textsize_16" />
 
-                <TextView
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:layout_gravity="center_vertical"
-                    android:text=":"
-                    android:textColor="@color/white"
-                    android:textSize="@dimen/textsize_16" />
-
-                <LinearLayout
-                    android:id="@+id/LinearLayout05"
-                    android:layout_width="fill_parent"
-                    android:layout_height="wrap_content"
-                    android:orientation="horizontal" >
+                    <TextView
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:layout_gravity="center_vertical"
+                        android:text=":"
+                        android:textColor="@color/white"
+                        android:textSize="@dimen/textsize_16" />
 
                     <LinearLayout
-                        android:layout_width="wrap_content"
+                        android:id="@+id/codelay"
+                        android:layout_width="fill_parent"
                         android:layout_height="wrap_content"
                         android:orientation="vertical" >
 
-                        <TextView
+                       <TextView
                             android:id="@+id/sendOutGoodsLogidTxt"
                             android:layout_width="150dp"
                             android:layout_height="wrap_content"
@@ -137,21 +144,20 @@
                             android:textSize="@dimen/textsize_20" />
 
                         <View
-                            android:layout_width="150dp"
+                            android:layout_width="wrap_content"
                             android:layout_height="1dp"
+                            android:layout_marginRight="10dp"
+                            android:layout_marginTop="1dp"
                             android:background="@color/text_gray" />
                     </LinearLayout>
                 </LinearLayout>
-            </LinearLayout>
-
-            <LinearLayout
-                android:id="@+id/barcodelay"
-                android:layout_width="fill_parent"
-                android:layout_height="wrap_content"
-                android:layout_marginTop="10dp"
-                android:orientation="horizontal" >
 
-                <com.jiaju.widget.JustifyTextView
+                <LinearLayout
+                    android:layout_width="fill_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_marginTop="3dp"
+                    android:orientation="horizontal" >
+<com.jiaju.widget.JustifyTextView
                     android:id="@+id/barcodeTitle"
                     android:layout_width="70dp"
                     android:layout_height="wrap_content"
@@ -161,21 +167,21 @@
                     android:textColor="@color/white"
                     android:textSize="@dimen/textsize_16" />
 
-                <TextView
-                    android:id="@+id/symbol2"
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:layout_gravity="center_vertical"
-                    android:text=":"
-                    android:textColor="@color/white"
-                    android:textSize="@dimen/textsize_16" />
+                    <TextView
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:layout_gravity="center_vertical"
+                        android:text=":"
+                        android:textColor="@color/white"
+                        android:textSize="@dimen/textsize_16" />
 
-                <LinearLayout
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:orientation="vertical" >
+                    <LinearLayout
+                        android:id="@+id/groutingLineLay"
+                        android:layout_width="fill_parent"
+                        android:layout_height="wrap_content"
+                        android:orientation="vertical" >
 
-                    <EditText
+                        <EditText
                         android:id="@+id/barcodeEdt"
                         android:layout_width="fill_parent"
                         android:layout_height="wrap_content"
@@ -187,22 +193,22 @@
                         android:textColor="@color/white"
                         android:textSize="@dimen/textsize_24" />
 
-                    <View
-                        android:layout_width="fill_parent"
-                        android:layout_height="1dp"
-                        android:layout_marginRight="10dp"
-                        android:background="@color/text_gray" />
+                        <View
+                            android:layout_width="wrap_content"
+                            android:layout_height="1dp"
+                            android:layout_marginRight="10dp"
+                            android:layout_marginTop="1dp"
+                            android:background="@color/text_gray" />
+                    </LinearLayout>
                 </LinearLayout>
-            </LinearLayout>
 
-            <LinearLayout
-                android:id="@+id/desclay"
-                android:layout_width="fill_parent"
-                android:layout_height="wrap_content"
-                android:layout_marginTop="10dp"
-                android:orientation="horizontal" >
+                <LinearLayout
+                    android:layout_width="fill_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_marginTop="3dp"
+                    android:orientation="horizontal" >
 
-                <com.jiaju.widget.JustifyTextView
+                    <com.jiaju.widget.JustifyTextView
                     android:id="@+id/descTitle1"
                     android:layout_width="70dip"
                     android:layout_height="wrap_content"
@@ -212,37 +218,43 @@
                     android:textColor="@color/white"
                     android:textSize="@dimen/textsize_16" />
 
-                <TextView
-                    android:id="@+id/symbol1"
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:layout_gravity="center_vertical"
-                    android:text=":"
-                    android:textColor="@color/white"
-                    android:textSize="@dimen/textsize_16" />
+                    <TextView
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:layout_gravity="center_vertical"
+                        android:text=":"
+                        android:textColor="@color/white"
+                        android:textSize="@dimen/textsize_16" />
 
-                <LinearLayout
-                    android:layout_width="fill_parent"
-                    android:layout_height="wrap_content"
-                    android:orientation="vertical" >
+                    <LinearLayout
+                        android:id="@+id/mouldCodeLay"
+                        android:layout_width="fill_parent"
+                        android:layout_height="wrap_content"
+                        android:orientation="vertical" >
 
-                    <Spinner
+                        <Spinner
                         android:id="@+id/trademarksource"
                         android:layout_width="fill_parent"
                         android:layout_height="40dp"
                         android:layout_marginRight="10dp"
                         android:background="@drawable/spinner_drop_down" />
+
+                        <View
+                            android:layout_width="wrap_content"
+                            android:layout_height="1dp"
+                            android:layout_marginRight="10dp"
+                            android:layout_marginTop="1dp"
+                            android:background="@color/text_gray" />
+                    </LinearLayout>
                 </LinearLayout>
-            </LinearLayout>
 
-            <LinearLayout
-                android:id="@+id/LinearLayout04"
-                android:layout_width="fill_parent"
-                android:layout_height="wrap_content"
-                android:layout_marginTop="10dp"
-                android:orientation="horizontal" >
+                <LinearLayout
+                    android:layout_width="fill_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_marginTop="3dp"
+                    android:orientation="horizontal" >
 
-                <com.jiaju.widget.JustifyTextView
+                     <com.jiaju.widget.JustifyTextView
                     android:id="@+id/JustifyTextView04"
                     android:layout_width="70dip"
                     android:layout_height="wrap_content"
@@ -252,37 +264,44 @@
                     android:textColor="@color/white"
                     android:textSize="@dimen/textsize_16" />
 
-                <TextView
-                    android:id="@+id/TextView06"
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:layout_gravity="center_vertical"
-                    android:text=":"
-                    android:textColor="@color/white"
-                    android:textSize="@dimen/textsize_16" />
+                    <TextView
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:layout_gravity="center_vertical"
+                        android:text=":"
+                        android:textColor="@color/white"
+                        android:textSize="@dimen/textsize_16" />
 
-                <LinearLayout
-                    android:layout_width="fill_parent"
-                    android:layout_height="wrap_content"
-                    android:orientation="vertical" >
+                    <LinearLayout
+                        android:id="@+id/groutingWorkNoLay"
+                        android:layout_width="fill_parent"
+                        android:layout_height="wrap_content"
+                        android:orientation="vertical" >
 
-                    <Spinner
+                         <Spinner
                         android:id="@+id/Spinner02"
                         android:layout_width="fill_parent"
                         android:layout_height="40dp"
                         android:layout_marginRight="10dp"
                         android:background="@drawable/spinner_drop_down" />
+
+                        <View
+                            android:layout_width="wrap_content"
+                            android:layout_height="1dp"
+                            android:layout_marginRight="10dp"
+                            android:layout_marginTop="1dp"
+                            android:background="@color/text_gray" />
+                    </LinearLayout>
                 </LinearLayout>
-            </LinearLayout>
 
-            <LinearLayout
-                android:id="@+id/LinearLayout03"
-                android:layout_width="fill_parent"
-                android:layout_height="wrap_content"
-                android:layout_marginTop="10dp"
-                android:orientation="horizontal" >
+                <LinearLayout
+                    android:id="@+id/auditstatuslay"
+                    android:layout_width="fill_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_marginTop="3dp"
+                    android:orientation="horizontal" >
 
-                <com.jiaju.widget.JustifyTextView
+                    <com.jiaju.widget.JustifyTextView
                     android:id="@+id/JustifyTextView03"
                     android:layout_width="70dip"
                     android:layout_height="wrap_content"
@@ -292,37 +311,43 @@
                     android:textColor="@color/white"
                     android:textSize="@dimen/textsize_16" />
 
-                <TextView
-                    android:id="@+id/TextView05"
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:layout_gravity="center_vertical"
-                    android:text=":"
-                    android:textColor="@color/white"
-                    android:textSize="@dimen/textsize_16" />
+                    <TextView
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:layout_gravity="center_vertical"
+                        android:text=":"
+                        android:textColor="@color/white"
+                        android:textSize="@dimen/textsize_16" />
 
-                <LinearLayout
-                    android:layout_width="fill_parent"
-                    android:layout_height="wrap_content"
-                    android:orientation="vertical" >
+                    <LinearLayout
+                        android:layout_width="fill_parent"
+                        android:layout_height="wrap_content"
+                        android:orientation="vertical" >
 
-                    <Spinner
+                        <Spinner
                         android:id="@+id/Spinner01"
                         android:layout_width="fill_parent"
                         android:layout_height="40dp"
                         android:layout_marginRight="10dp"
                         android:background="@drawable/spinner_drop_down" />
+                        <View
+                            android:layout_width="wrap_content"
+                            android:layout_height="1dp"
+                            android:layout_marginRight="10dp"
+                            android:layout_marginTop="1dp"
+                            android:background="@color/text_gray" />
+                    </LinearLayout>
                 </LinearLayout>
-            </LinearLayout>
 
-            <LinearLayout
-                android:id="@+id/LinearLayout02"
-                android:layout_width="fill_parent"
-                android:layout_height="wrap_content"
-                android:layout_marginTop="10dp"
-                android:orientation="horizontal" >
+                <LinearLayout
+                    android:id="@+id/scrapDatelay"
+                    android:layout_width="fill_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_marginTop="15dp"
+                    android:orientation="horizontal"
+                    android:visibility="visible" >
 
-                <com.jiaju.widget.JustifyTextView
+                    <com.jiaju.widget.JustifyTextView
                     android:id="@+id/JustifyTextView02"
                     android:layout_width="70dip"
                     android:layout_height="wrap_content"
@@ -332,26 +357,25 @@
                     android:textColor="@color/white"
                     android:textSize="@dimen/textsize_16" />
 
-                <TextView
-                    android:id="@+id/TextView03"
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:layout_gravity="center_vertical"
-                    android:text=":"
-                    android:textColor="@color/white"
-                    android:textSize="@dimen/textsize_16" />
-
-                <LinearLayout
-                    android:layout_width="fill_parent"
-                    android:layout_height="wrap_content"
-                    android:orientation="horizontal" >
+                    <TextView
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:layout_gravity="center_vertical"
+                        android:text=":"
+                        android:textColor="@color/white"
+                        android:textSize="@dimen/textsize_16" />
 
                     <LinearLayout
-                        android:layout_width="wrap_content"
+                        android:layout_width="fill_parent"
                         android:layout_height="wrap_content"
-                        android:orientation="vertical" >
+                        android:orientation="horizontal" >
 
-                        <TextView
+                        <LinearLayout
+                            android:layout_width="wrap_content"
+                            android:layout_height="wrap_content"
+                            android:orientation="vertical" >
+
+                            <TextView
                             android:id="@+id/TextView04"
                             android:layout_width="130dp"
                             android:layout_height="wrap_content"
@@ -361,30 +385,31 @@
                             android:textColor="@color/white"
                             android:textSize="@dimen/textsize_20" />
 
-                        <View
-                            android:layout_width="130dp"
-                            android:layout_height="1dp"
-                            android:background="@color/text_gray" />
-                    </LinearLayout>
-
-                    <ImageView
+                            <View
+                                android:layout_width="150dp"
+                                android:layout_height="1dp"
+                                android:background="@color/text_gray" />
+                        </LinearLayout>
+  <ImageView
                         android:id="@+id/ImageView02"
                         android:layout_width="wrap_content"
                         android:layout_height="wrap_content"
                         android:layout_gravity="center_vertical"
                         android:layout_marginLeft="5dp"
                         android:background="@drawable/addzerenren" />
+                      
+                    </LinearLayout>
                 </LinearLayout>
-            </LinearLayout>
 
-            <LinearLayout
-                android:id="@+id/LinearLayout01"
-                android:layout_width="fill_parent"
-                android:layout_height="wrap_content"
-                android:layout_marginTop="10dp"
-                android:orientation="horizontal" >
+                <LinearLayout
+                    android:id="@+id/worknolay"
+                    android:layout_width="fill_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_marginTop="15dp"
+                    android:orientation="horizontal"
+                    android:visibility="visible" >
 
-                <com.jiaju.widget.JustifyTextView
+                    <com.jiaju.widget.JustifyTextView
                     android:id="@+id/JustifyTextView01"
                     android:layout_width="70dip"
                     android:layout_height="wrap_content"
@@ -394,19 +419,13 @@
                     android:textColor="@color/white"
                     android:textSize="@dimen/textsize_16" />
 
-                <TextView
-                    android:id="@+id/TextView02"
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:layout_gravity="center_vertical"
-                    android:text=":"
-                    android:textColor="@color/white"
-                    android:textSize="@dimen/textsize_16" />
-
-                <LinearLayout
-                    android:layout_width="fill_parent"
-                    android:layout_height="wrap_content"
-                    android:orientation="horizontal" >
+                    <TextView
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:layout_gravity="center_vertical"
+                        android:text=":"
+                        android:textColor="@color/white"
+                        android:textSize="@dimen/textsize_16" />
 
                     <LinearLayout
                         android:layout_width="wrap_content"
@@ -424,11 +443,10 @@
                             android:textSize="@dimen/textsize_20" />
 
                         <View
-                            android:layout_width="130dp"
-                            android:layout_height="1dp"
-                            android:background="@color/text_gray" />
+                                android:layout_width="150dp"
+                                android:layout_height="1dp"
+                                android:background="@color/text_gray" />
                     </LinearLayout>
-
                     <ImageView
                         android:id="@+id/ImageView01"
                         android:layout_width="wrap_content"
@@ -437,47 +455,82 @@
                         android:layout_marginLeft="5dp"
                         android:background="@drawable/addzerenren" />
                 </LinearLayout>
-            </LinearLayout>
 
-            <LinearLayout
-                android:id="@+id/lin2"
-                android:layout_width="fill_parent"
-                android:layout_height="wrap_content"
-                android:layout_marginTop="10dp"
-                android:orientation="vertical" >
-
-                <View
+                <LinearLayout
+                    android:id="@+id/workerlay"
                     android:layout_width="fill_parent"
-                    android:layout_height="1dp"
-                    android:background="@color/text_gray" />
+                    android:layout_height="wrap_content"
+                    android:layout_marginTop="15dp"
+                    android:orientation="vertical"
+                    android:visibility="visible" >
 
-                <TextView
+                    <View
+                        android:layout_width="fill_parent"
+                        android:layout_height="1dp"
+                        android:background="@color/text_gray" />
+
+                    <LinearLayout
+                        android:layout_width="fill_parent"
+                        android:layout_height="wrap_content"
+                        android:orientation="horizontal"
+                        android:visibility="visible" >
+
+                         <TextView
                     android:layout_width="wrap_content"
                     android:layout_height="wrap_content"
                     android:layout_gravity="center_vertical"
                     android:layout_marginLeft="10dp"
-                    android:text="发货单信息:"
+                    android:text="发货单信息"
                     android:textColor="@color/white"
                     android:textSize="@dimen/textsize_16" />
 
-                <View
-                    android:layout_width="fill_parent"
-                    android:layout_height="1dp"
-                    android:background="@color/text_gray" />
-            </LinearLayout>
+                        <TextView
+                            android:layout_width="wrap_content"
+                            android:layout_height="wrap_content"
+                            android:layout_gravity="center_vertical"
+                            android:text=":"
+                            android:textColor="@color/white"
+                            android:textSize="@dimen/textsize_16" />
+                    </LinearLayout>
 
-            <LinearLayout
-                android:layout_width="fill_parent"
-                android:layout_height="wrap_content"
-                android:orientation="vertical" >
+                    <View
+                        android:layout_width="fill_parent"
+                        android:layout_height="1dp"
+                        android:background="@color/text_gray" />
 
-                <ListView
+                    <com.jiaju.widget.MyListView
+                        android:id="@+id/lstview"
+                        android:layout_width="fill_parent"
+                        android:layout_height="wrap_content"
+                        android:cacheColorHint="#00000000"
+                        android:divider="@color/white"
+                        android:dividerHeight="1dp" />
+
+                    <View
+                        android:id="@+id/listlin"
+                        android:layout_width="fill_parent"
+                        android:layout_height="1dp"
+                        android:background="@color/white"
+                        android:visibility="gone" />
+                </LinearLayout>
+
+                 <LinearLayout
+                    android:id="@+id/memoLay"
+                    android:layout_width="fill_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_marginTop="5dp"
+                    android:orientation="horizontal"
+                    android:visibility="visible" >
+
+                   <ListView
                     android:id="@+id/message_listview"
                     android:layout_width="fill_parent"
-                    android:layout_height="fill_parent"
-                    android:cacheColorHint="#00000000"
-                    android:divider="@null" />
+                    android:layout_height="wrap_content"
+                    android:scrollbars="none"
+                    android:cacheColorHint="#00000000"/>
+                </LinearLayout>
             </LinearLayout>
-        </LinearLayout>
+        </RelativeLayout>
+    </ScrollView>
 
-</RelativeLayout>
+</RelativeLayout>

+ 24 - 24
res/layout/send_out_goods.xml

@@ -14,30 +14,6 @@
     android:layout_height="wrap_content"
      android:orientation="vertical"
     >
-    
-    
-      <LinearLayout 
-        android:layout_height="18dp"   
-        android:layout_width="fill_parent"
-        android:layout_marginTop="3dp"
-        android:layout_marginLeft="10dp" 
-        android:orientation="horizontal">
-
-        <TextView
-            android:layout_width="wrap_content"
-            android:layout_height="18dp"
-            android:text=" 板  码 :"
-            android:textColor="@color/white"
-            android:textSize="@dimen/textsize_14" />
- 
-       <TextView
-           android:id="@+id/banmaTxt"
-           android:layout_width="wrap_content"
-           android:layout_height="wrap_content"
-           android:textColor="@color/white"
-           android:textSize="@dimen/textsize_14" />
-			
-    </LinearLayout>
         <LinearLayout 
         android:layout_height="18dp"   
         android:layout_width="fill_parent"
@@ -56,6 +32,7 @@
 		    android:textSize="@dimen/textsize_14"
 			android:textColor="@color/white"/>			
     </LinearLayout>
+
         <LinearLayout 
         android:layout_height="18dp"    
         android:layout_width="fill_parent"
@@ -97,6 +74,29 @@
 		    android:textSize="@dimen/textsize_14"
 			android:textColor="@color/white"/>			
     </LinearLayout>
+
+  <LinearLayout
+      android:layout_width="fill_parent"
+      android:layout_height="18dp"
+      android:layout_marginLeft="10dp"
+      android:layout_marginTop="3dp"
+      android:orientation="horizontal" >
+
+      <TextView
+          android:layout_width="wrap_content"
+          android:layout_height="18dp"
+          android:text="板       码:"
+          android:textColor="@color/white"
+          android:textSize="@dimen/textsize_14" />
+
+      <TextView
+          android:id="@+id/banmaTxt"
+          android:layout_width="wrap_content"
+          android:layout_height="wrap_content"
+          android:textColor="@color/white"
+          android:textSize="@dimen/textsize_14" />
+  </LinearLayout>
+
     <LinearLayout 
         android:layout_height="18dp"   
         android:layout_width="fill_parent"

+ 127 - 42
src/com/jiaju/activity/SendOutGoods.java

@@ -13,6 +13,7 @@ import org.json.JSONArray;
 import org.json.JSONException;
 import org.json.JSONObject;
 
+import com.jiaju.activity.ComponentsBreakageQuantityOkActivity.SaveRunnableScanOk;
 import com.jiaju.activity.MakeBilletActivity.BarcodeRunnable;
 import com.jiaju.adapter.CarBrandSpinnerAdapter;
 import com.jiaju.adapter.GlazeSpinnerAdapter;
@@ -44,6 +45,8 @@ import com.jiaju.utils.TimePickerInfo;
 
 import android.annotation.SuppressLint;
 import android.app.Activity;
+import android.app.AlertDialog;
+import android.app.Dialog;
 import android.app.Notification;
 import android.content.Context;
 import android.content.DialogInterface;
@@ -128,13 +131,18 @@ public class SendOutGoods extends Activity {
 	protected String selectedDate1;
 	protected String sendOutGoodLogId;
 	private SendOutModel sendOutModel;
+	private SendOutModel lastSendOutModel;
 	private String desc;
 	private ImageView dateSelector;
+	private ImageView dateSelector1;
 	private SendOutSpinnerAdapter sendOutAdapter;
 	private ReceiveSpinnerAdapter receiveAdapter;
 	private CarBrandSpinnerAdapter carBrandAdapter;
 	private Handler barcodeUpperH = new Handler();
 	private SendOutGoodsListMessageAdapter adapter;
+	private boolean isCancel=false;
+	private boolean isFirst=true;
+	private int Height=188;
 
 	@Override
 	protected void onCreate(Bundle savedInstanceState) {
@@ -151,7 +159,6 @@ public class SendOutGoods extends Activity {
 		loadProcedureDataSource();
 		initView();
 		sendOutGoodLogId="";
-		
 	    sendOutGoodLogId = this.getIntent().getStringExtra("sendOutGoodLog");
 			if(sendOutGoodLogId==null||sendOutGoodLogId=="")
 			{
@@ -202,36 +209,39 @@ public class SendOutGoods extends Activity {
 		});
 		
 		allListeners();
-		thread = new HandlerThread("sendOutThread", 5);
+
+		thread = new HandlerThread("sendOutThread3", 5);
+		thread.start();
+		mHandler = new Handler(thread.getLooper());
+		SendOutRunnable glazeRunnable = new SendOutRunnable(obj);
+		mHandler.post(glazeRunnable);
+		
+		thread = new HandlerThread("sendOutThread1", 5);
 		thread.start();
 		mHandler = new Handler(thread.getLooper());
 		CarBrandRunnable CarBrandRunnable = new CarBrandRunnable(obj);
 		mHandler.post(CarBrandRunnable);
 
-		thread = new HandlerThread("sendOutThread", 5);
+		thread = new HandlerThread("sendOutThread2", 5);
 		thread.start();
 		mHandler = new Handler(thread.getLooper());
 		ReceiveRunnable ReceiveRunnable = new ReceiveRunnable(obj);
 		mHandler.post(ReceiveRunnable);
 
-		thread = new HandlerThread("sendOutThread", 5);
-		thread.start();
-		mHandler = new Handler(thread.getLooper());
-		SendOutRunnable glazeRunnable = new SendOutRunnable(obj);
-		mHandler.post(glazeRunnable);
 		;
 	}
 
-	 protected void onResume() {
-	        super.onResume();
+	 //protected void onResume() {
+	   //     super.onResume();
 	        // 如果值已经在onCreate()中加载完成,可以在这里直接调用方法
 	    
-		HandlerThread thread = new HandlerThread("worThread", 5);
-		thread.start();
-		mHandler = new Handler(thread.getLooper());
-		mHandler.post(responsibilityWorkNoRunnable);
-		
-	    }
+		//HandlerThread thread = new HandlerThread("worThread", 5);
+		//thread.start();
+		//mHandler = new Handler(thread.getLooper());
+	//	mHandler.post(responsibilityWorkNoRunnable);
+
+		//isFirst=false;
+	   // }
 	private class CarBrandRunnable implements Runnable {
 		private Object object;
 
@@ -326,7 +336,9 @@ public class SendOutGoods extends Activity {
 		@Override
 		public void run() {
 			synchronized (object) {
-				try {
+				try { 
+					ProcessDialogUtils
+					.showProcessDialog(SendOutGoods.this);
 					client = null;
 					client = new WebClient();
 					JSONObject js = new JSONObject();
@@ -370,6 +382,17 @@ public class SendOutGoods extends Activity {
 
 			}
 		});
+		dateSelector1.setOnClickListener(new View.OnClickListener() {
+			@Override
+			public void onClick(View v) {
+				if (mSelectedDate1 == null) {
+					mTimePickerInfo1.show(new Date(timeMillis));
+				} else {
+					mTimePickerInfo1.show(mSelectedDate1);
+				}
+
+			}
+		});
 		backbtn.setOnClickListener(new View.OnClickListener() {
 
 			@Override
@@ -391,10 +414,55 @@ public class SendOutGoods extends Activity {
 			@Override
 			public void onItemSelected(AdapterView<?> arg0, View arg1, int arg2, long arg3) {
 				if (arg0 != null) {
-
+					lastSendOutModel=sendOutModel; 				 
 					sendOutModel = (SendOutModel) arg0.getItemAtPosition(arg2);
-					if (!sendOutModel.getSendOutName().equals("请选择发出仓库")) {
-
+					Lgort = sendOutModel.getSendOutId();
+					if(isCancel) {
+						return;
+					}
+					ProcessDialogUtils.showProcessDialog(
+							SendOutGoods.this);
+					if(!isFirst)
+					{
+						
+						Dialog alertDialog = new AlertDialog.Builder(
+								SendOutGoods.this).setMessage("确定是否切换发出仓库,需要重新扫码校验出库数量是否充足")
+										.setPositiveButton("确定", new DialogInterface.OnClickListener() {
+											@Override
+											public void onClick(DialogInterface dialog, int which) {
+												HandlerThread thread = new HandlerThread("worknoThread", 5);
+												thread.start();
+												mHandler = new Handler(thread.getLooper());
+												mHandler.post(responsibilityWorkNoRunnable);
+											}
+										}).setNegativeButton("取消", new DialogInterface.OnClickListener() {
+											@Override
+											public void onClick(DialogInterface dialog, int which) {
+												 isCancel=true;
+												 int index = sendOutList.indexOf(lastSendOutModel);
+											        if (index >= 0) {
+											            sendOutSpinner.setSelection(index); // 这将更新 Spinner 的选中项,但不会触发任何监听器
+											        }
+
+													ProcessDialogUtils.closeProgressDilog();
+												// 添加一秒延时
+												 new Handler().postDelayed(new Runnable() {
+												     @Override
+												     public void run() {
+												    	 isCancel=false;
+												     }
+												 }, 1500); // 1000 毫秒即一秒延时
+												
+											}
+										}).create();
+						alertDialog.setCanceledOnTouchOutside(false);
+						alertDialog.show();
+						return;
+					
+					}
+					else
+					{
+						sendOutModel = (SendOutModel) arg0.getItemAtPosition(arg2);
 						Lgort = sendOutModel.getSendOutId();
 
 						HandlerThread thread = new HandlerThread("worknoThread", 5);
@@ -402,8 +470,13 @@ public class SendOutGoods extends Activity {
 						mHandler = new Handler(thread.getLooper());
 						mHandler.post(responsibilityWorkNoRunnable);
 					}
+					if (!sendOutModel.getSendOutName().equals("请选择发出仓库")) {
+
+						
+					}
 
 				}
+				 
 				// flag = true;
 
 			}
@@ -432,7 +505,7 @@ public class SendOutGoods extends Activity {
 				//	Toast.makeText(getApplicationContext(), "请添加发货单信息", Toast.LENGTH_SHORT).show();
 				//	return;
 				//}
-
+				ProcessDialogUtils.showProcessDialog(SendOutGoods.this);
 				SendOutModel sendOut = (SendOutModel) sendOutSpinner.getSelectedItem();
 				if (sendOut == null) {
 					CustomToast.showToast(getApplicationContext(), "不能为空", 2000);
@@ -687,6 +760,7 @@ public class SendOutGoods extends Activity {
 		TextView04 = (TextView) findViewById(R.id.TextView04);
 		TextView01 = (TextView) findViewById(R.id.TextView01);
 		dateSelector = (ImageView) findViewById(R.id.ImageView02);
+		dateSelector1 = (ImageView) findViewById(R.id.ImageView01);
 		sGoodsLogcode = (TextView) findViewById(R.id.sendOutGoodsLogidTxt);
 		
 
@@ -1021,13 +1095,13 @@ public class SendOutGoods extends Activity {
 
 								JSONObject sobject = (JSONObject) storageJArray.opt(i);
 								String MATERIALCODE = sobject.optString("MATNR");
-								if (MATERIALCODE == mCODE) {
-									storageConout = storageConout + Integer.parseInt(sobject.optString("LABST"));// sap库存
+								if (MATERIALCODE.equals(mCODE)) {
+									storageConout = storageConout + (int)Double.parseDouble(sobject.optString("LABST"));// sap库存
 								}
 
 							}
 						} 
-						if ((Double.parseDouble(Count)) <= storageConout-mcount) {
+						if ((Double.parseDouble(Count)) >(double)(storageConout-mcount)) {
 							//CommonUtil.setDefault(Notification.DEFAULT_VIBRATE, getApplicationContext());
 							CommonUtil.showBarCodeAlertDialog(0, "库存不足", SendOutGoods.this, barcodeEdt, null,
 									null);
@@ -1048,9 +1122,9 @@ public class SendOutGoods extends Activity {
 
 										CommonUtil.setDefault(Notification.DEFAULT_VIBRATE, getApplicationContext());
 
-										CustomToast.showToast(getApplicationContext(), "条码" + barcode + "重复", 2000);
+										CustomToast.showToast(getApplicationContext(), "条码重复", 2000);
 
-										return; 
+										break; 
 									}
 									BarcodeInfo barcodeInfo = new BarcodeInfo();
 									barcodeInfo.setBanMa(barcode=="null"?"":barcode);
@@ -1066,6 +1140,8 @@ public class SendOutGoods extends Activity {
 									messageLst.setAdapter(adapter);
 								} else {
 									adapter.notifyDataSetChanged();
+									//messageLst.getLayoutParams().height=(messageLst.getHeight()+Height);
+									messageLst.getLayoutParams().height=(barcodeList.size()*Height);
 								}
 
 								saveBtn.setText("保存(" + barcodeList.size() + ")");
@@ -1127,11 +1203,11 @@ public class SendOutGoods extends Activity {
 				break;
 
 			case 2:
-				ProcessDialogUtils.closeProgressDilog();
 				if (mHandler != null) {
 					mHandler.removeCallbacksAndMessages(null);
 					mHandler.getLooper().quit();
 				}
+				ProcessDialogUtils.closeProgressDilog();
 				Bundle bundle2 = msg.getData();
 				String json2 = bundle2.getString("result");
 				JSONObject jObject;
@@ -1140,19 +1216,26 @@ public class SendOutGoods extends Activity {
 					JSONObject object = (JSONObject) jObject.opt("d");
 					int status = object.optInt("Status");
 					String message = object.optString("Message");
-					JSONObject result3 =(JSONObject) object.opt("Result");
-					JSONArray resArray = (JSONArray)result3.opt("Result");
+					//JSONObject result3 =(JSONObject) object.opt("Result");
+					//JSONArray resArray = (JSONArray)result3.opt("Result");
 					if (status == 0) {
 						barcodeList.removeAll(barcodeList);
 						adapter.notifyDataSetChanged();
+						messageLst.getLayoutParams().height=(barcodeList.size()*Height);
 						saveBtn.setText("保存(" + barcodeList.size() + ")");
 						CustomToast.showToast(getApplicationContext(), "成功", 2000);
 						CommonUtil.playSound(getApplicationContext());
-						checkedProcedureList.clear();
-						procedureTv.setText("");
-						descEdt.setText("");
-						desc = "";
-						booleans = new boolean[procedureList.size()];
+						//checkedProcedureList.clear();
+						//procedureTv.setText("");
+						//descEdt.setText("");
+						//desc = "";
+						//booleans = new boolean[procedureList.size()];
+						sendOutGoodLogId="";
+						((LinearLayout) findViewById(R.id.LinearLayout06)).setVisibility(View.GONE);
+						HandlerThread thread = new HandlerThread("worknoThreads", 5);
+						thread.start();
+						mHandler = new Handler(thread.getLooper());
+						mHandler.post(responsibilityWorkNoRunnable);
 
 					} else if (status == 1) {	
 						CommonUtil.setDefault(Notification.DEFAULT_VIBRATE, getApplicationContext());
@@ -1172,7 +1255,7 @@ public class SendOutGoods extends Activity {
 				}
 
 				break;
-			case 3:
+			case 3:	
 				Bundle b3 = msg.getData();
 				String json3 = b3.getString("glazeResult");
 				if (mHandler != null) {
@@ -1216,7 +1299,6 @@ public class SendOutGoods extends Activity {
 					mHandler.removeCallbacksAndMessages(null);
 					mHandler.getLooper().quit();
 				}
-				ProcessDialogUtils.closeProgressDilog();
 				JSONObject j2r;
 				try {
 					j2r = new JSONObject(json3r);
@@ -1253,7 +1335,6 @@ public class SendOutGoods extends Activity {
 					mHandler.removeCallbacksAndMessages(null);
 					mHandler.getLooper().quit();
 				}
-				ProcessDialogUtils.closeProgressDilog();
 				JSONObject j2c;
 				try {
 					j2c = new JSONObject(json3c);
@@ -1302,6 +1383,7 @@ public class SendOutGoods extends Activity {
 						JSONArray jArr = new JSONArray(result);
 						storageJArray=(JSONArray)jArr.opt(0);
 						JSONArray jArray = (JSONArray)jArr.opt(1);
+						barcodeList.removeAll(barcodeList);
 						if (jArray != null && jArray.length() > 0) {
 							for (int i = 0; i < jArray.length(); i++) {
 								JSONObject object2 = (JSONObject) jArray.opt(i);
@@ -1322,11 +1404,13 @@ public class SendOutGoods extends Activity {
 								barcodeInfo.setFinishedBarCode(object2.optString("FINISHEDLOADBATCHNO"));
 								barcodeList.add(barcodeInfo);
 							}
+						} 
 							if (adapter == null) {
 								adapter = new SendOutGoodsListMessageAdapter(SendOutGoods.this, barcodeList);
 								messageLst.setAdapter(adapter);
 							} else {
 								adapter.notifyDataSetChanged();
+								messageLst.getLayoutParams().height=(barcodeList.size()*Height);
 							}
 
 							saveBtn.setText("保存(" + barcodeList.size() + ")");
@@ -1336,6 +1420,7 @@ public class SendOutGoods extends Activity {
 							barcodeEdt.setFocusableInTouchMode(true);
 							barcodeEdt.requestFocus();
 							barcodeEdt.findFocus();
+							isFirst=false;
 							barcodeEdt.setFilters(new InputFilter[] { new InputFilter() {
 								@Override
 								public CharSequence filter(CharSequence source, int start, int end, Spanned dest,
@@ -1354,11 +1439,11 @@ public class SendOutGoods extends Activity {
 							ProcessDialogUtils.closeProgressDilog();
 
 						}
-					} else {
-						CommonUtil.setDefault(Notification.DEFAULT_VIBRATE, getApplicationContext());
-						CommonUtil.showBarCodeAlertDialog(status, message, SendOutGoods.this, barcodeEdt, null, null);
-						return;
-					}
+					//else {
+					//	CommonUtil.setDefault(Notification.DEFAULT_VIBRATE, getApplicationContext());
+					//	CommonUtil.showBarCodeAlertDialog(status, message, SendOutGoods.this, barcodeEdt, null, null);
+					//	return;
+					//}
 				} catch (JSONException e) {
 
 					e.printStackTrace();