Jelajahi Sumber

提交类型 修改bug、提交备份
提交内容 出差单修改部分敏感操作,明细表写死的日期选择字段修改,可通过SwtchUtil来控制

冲突文件 版本文件、ViewUtil 取网络

Bitliker 8 tahun lalu
induk
melakukan
6ab267e82d
18 mengubah file dengan 779 tambahan dan 403 penghapusan
  1. 2 1
      WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/circle/BusinessCircleActivity.java
  2. 3 3
      WeiChat/version.properties
  3. 5 5
      app_core/common/src/main/java/com/core/utils/OpenFilesUtils.java
  4. 211 160
      app_modular/appmessages/src/main/java/com/modular/appmessages/activity/MessageWebActivity.java
  5. 29 0
      app_modular/appmessages/src/main/java/com/modular/appmessages/activity/MsgThirdWebActivity.java
  6. 3 0
      app_modular/appmessages/src/main/java/com/modular/appmessages/activity/MsgsSecondCommonActivity.java
  7. 2 2
      app_modular/appmessages/src/main/java/com/modular/appmessages/adapter/ApprovalAdapter.java
  8. 2 1
      app_modular/apputils/src/main/java/com/modular/apputils/utils/SwitchUtil.java
  9. 0 0
      app_modular/apputils/src/main/res/drawable/edit_hint_right_angle.xml
  10. 10 0
      app_modular/apputils/src/main/res/drawable/edit_white_right_angle.xml
  11. 18 29
      app_modular/appworks/src/main/java/com/uas/appworks/OA/platform/activity/BusinessTravelActivity.java
  12. 39 42
      app_modular/appworks/src/main/java/com/uas/appworks/OA/platform/activity/PurchaseDetailsActivity.java
  13. 57 15
      app_modular/appworks/src/main/java/com/uas/appworks/OA/platform/adapter/BusinessTravelAdapter.java
  14. 68 46
      app_modular/appworks/src/main/java/com/uas/appworks/OA/platform/adapter/PurchaseDetailsAdapter.java
  15. 16 0
      app_modular/appworks/src/main/java/com/uas/appworks/OA/platform/model/BusinessTravel.java
  16. 57 44
      app_modular/appworks/src/main/java/com/uas/appworks/OA/platform/model/Purchase.java
  17. 117 8
      app_modular/appworks/src/main/res/layout/item_ls_purchase.xml
  18. 140 47
      app_modular/appworks/src/main/res/layout/item_purchase.xml

+ 2 - 1
WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/circle/BusinessCircleActivity.java

@@ -31,6 +31,7 @@ import com.alibaba.fastjson.JSON;
 import com.android.volley.Response;
 import com.android.volley.Response.ErrorListener;
 import com.android.volley.VolleyError;
+import com.common.LogUtil;
 import com.common.preferences.PreferenceUtils;
 import com.common.system.DisplayUtil;
 import com.common.ui.CameraUtil;
@@ -695,7 +696,7 @@ public class BusinessCircleActivity extends BaseActivity implements showCEView {
         }, new StringJsonArrayRequest.Listener<PublicMessage>() {
             @Override
             public void onResponse(ArrayResult<PublicMessage> result) {
-                Log.i("Arison", "商务信息:" + JSON.toJSONString(result));
+                LogUtil.prinlnLongMsg("Arison", "商务信息:" + JSON.toJSONString(result));
                 boolean success = Result.defaultParser(mContext, result, true);
                 if (success) {
                     List<PublicMessage> datas = result.getData();

+ 3 - 3
WeiChat/version.properties

@@ -1,5 +1,5 @@
-#Tue Jan 16 11:12:55 CST 2018
-debugName=435
+#Wed Jan 17 09:43:32 CST 2018
+debugName=452
 versionName=624
-debugCode=435
+debugCode=452
 versionCode=163

+ 5 - 5
app_core/common/src/main/java/com/core/utils/OpenFilesUtils.java

@@ -286,18 +286,18 @@ public class OpenFilesUtils {
             int status = c.getInt(c.getColumnIndex(DownloadManager.COLUMN_STATUS));
             switch (status) {
                 case DownloadManager.STATUS_PAUSED:
-                    showFileToast(">>>下载暂停");
+                    showFileToast(">>>浏览暂停");
                 case DownloadManager.STATUS_PENDING:
-                    showFileToast(">>>下载延迟");
+                    showFileToast(">>>浏览出现延迟");
                 case DownloadManager.STATUS_RUNNING:
-                    showFileToast(">>>正在下载");
+                    showFileToast(">>>正在生成附件浏览");
                     break;
                 case DownloadManager.STATUS_SUCCESSFUL:
-                    showFileToast(">>>下载完成");
+                    showFileToast(">>>正在打开文件");
                     //下载完成安装克定义自动执行打开文件操作
                     break;
                 case DownloadManager.STATUS_FAILED:
-                    showFileToast(">>>下载失败");
+                    showFileToast(">>>浏览失败");
                     break;
             }
         }

+ 211 - 160
app_modular/appmessages/src/main/java/com/modular/appmessages/activity/MessageWebActivity.java

@@ -1,5 +1,6 @@
 package com.modular.appmessages.activity;
 
+import android.content.Context;
 import android.content.Intent;
 import android.graphics.Bitmap;
 import android.net.http.SslError;
@@ -8,8 +9,12 @@ import android.os.Bundle;
 import android.view.Menu;
 import android.view.MenuItem;
 import android.view.View;
+import android.webkit.CookieManager;
+import android.webkit.CookieSyncManager;
 import android.webkit.SslErrorHandler;
 import android.webkit.WebChromeClient;
+import android.webkit.WebResourceRequest;
+import android.webkit.WebResourceResponse;
 import android.webkit.WebSettings;
 import android.webkit.WebView;
 import android.webkit.WebViewClient;
@@ -18,177 +23,223 @@ import android.widget.ZoomButtonsController;
 
 import com.common.LogUtil;
 import com.common.system.SystemUtil;
+import com.core.app.MyApplication;
 import com.core.base.BaseActivity;
 import com.core.utils.CommonUtil;
 import com.core.utils.IntentUtils;
+import com.core.utils.ToastUtil;
 import com.modular.appmessages.R;
 import com.umeng.socialize.ShareAction;
 import com.umeng.socialize.bean.SHARE_MEDIA;
 import com.umeng.socialize.media.UMImage;
 
+import org.apache.http.cookie.Cookie;
+
 import java.lang.reflect.Field;
 
 public class MessageWebActivity extends BaseActivity {
 
 
-	private WebView webViewRefresh;
-	private ProgressBar progressBar;
-	private String url;
-
-	@Override
-	protected void onCreate(Bundle savedInstanceState) {
-		super.onCreate(savedInstanceState);
-		setContentView(R.layout.activity_message_web);
-		webViewRefresh = (WebView) findViewById(R.id.webView);
-		progressBar = (ProgressBar) findViewById(R.id.progressBar);
-		initView();
-		initData();
-	}
-
-
-	@Override
-	public boolean onCreateOptionsMenu(Menu menu) {
-		if (getIntent() != null && getIntent().getBooleanExtra(IntentUtils.KEY_NEER_SHARE, false)) {
-			getMenuInflater().inflate(R.menu.menu_about, menu);
-		}
-		return true;
-	}
-
-	@Override
-	public boolean onOptionsItemSelected(MenuItem item) {
-		if (R.id.app_about == item.getItemId()) {
-			String title = getSupportActionBar().getTitle().toString();
-			String content = null;
-			String imageUrl = null;
-			Intent intent = getIntent();
-			if (intent != null) {
-				content = intent.getStringExtra(IntentUtils.KEY_SHARE_CONTENT);
-				imageUrl = intent.getStringExtra(IntentUtils.KEY_SHARE_IMAGE);
-			}
-			if (content == null) {
-				content = "UU互联 Android客户端" + SystemUtil.getVersionName(mContext);
-				imageUrl = "http://img.my.csdn.net/uploads/201609/30/1475204542_1365.png";
-			}
-			LogUtil.i("url="+url);
-			LogUtil.i("content="+content);
-			LogUtil.i("imageUrl="+imageUrl);
-			new ShareAction(activity).setDisplayList(
-					SHARE_MEDIA.SINA,
-					SHARE_MEDIA.QQ,
-					SHARE_MEDIA.QZONE,
-					SHARE_MEDIA.WEIXIN,
-					SHARE_MEDIA.WEIXIN_CIRCLE,
-					SHARE_MEDIA.WEIXIN_FAVORITE,
-					SHARE_MEDIA.MORE)
-					.withTitle(title)
-					.withText(content)
-					.withMedia(new UMImage(activity, imageUrl))
-					.withTargetUrl(url)
-					.setCallback(CommonUtil.umShareListener)
-					.open();
-		}
-		return super.onOptionsItemSelected(item);
-	}
-
-	private void initView() {
-		webViewRefresh.getSettings().setJavaScriptEnabled(true);
-		webViewRefresh.getSettings().setSupportZoom(true);
-		webViewRefresh.getSettings().setBuiltInZoomControls(true);
-		webViewRefresh.getSettings().setUseWideViewPort(true);
-		webViewRefresh.getSettings().setDomStorageEnabled(true);
-		webViewRefresh.getSettings().setLoadWithOverviewMode(true);
-		webViewRefresh.getSettings().setDefaultTextEncodingName("utf-8");
-		webViewRefresh.getSettings().setCacheMode(WebSettings.LOAD_NO_CACHE);
-		if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
-			webViewRefresh.getSettings().setDisplayZoomControls(false);
-		} else {
-			setZoomControlGone();
-		}
-		webViewRefresh.clearCache(true);
-		webViewRefresh.clearHistory();
-		webViewRefresh.setWebViewClient(new WebViewClient() {
-			public boolean shouldOverrideUrlLoading(WebView view, String url) {
-				view.loadUrl(url);
-				return true;
-			}
-
-			@Override
-			public void onPageStarted(WebView view, String url, Bitmap favicon) {
-				if (progressBar.getVisibility() == View.GONE) {
-					progressBar.setVisibility(View.VISIBLE);
-				}
-			}
-
-			@Override
-			public void onPageFinished(WebView view, String url) {
-				if (progressBar.getVisibility() == View.VISIBLE) {
-					progressBar.setVisibility(View.GONE);
-				}
-			}
-
-			@Override
-			public void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error) {
-				handler.proceed();
-			}
-		});
-		webViewRefresh.setWebChromeClient(new WebChromeClient() {
-			@Override
-			public void onProgressChanged(WebView view, int newProgress) {
-				progressBar.setProgress(newProgress);
-				if (newProgress == 100) {
-					progressBar.setProgress(newProgress);
-					progressBar.setVisibility(View.GONE);
-				}
-				super.onProgressChanged(view, newProgress);
-			}
-		});
-//        webViewRefresh.setOnRefreshListener(new PullToRefreshBase.OnRefreshListener<WebView>() {
-//            @Override
-//            public void onRefresh(PullToRefreshBase<WebView> refreshView) {
-//                loadData();
-//            }
-//        });
-	}
-
-	public void setZoomControlGone() {
-		Class classType;
-		Field field;
-		try {
-			classType = WebView.class;
-			field = classType.getDeclaredField("mZoomButtonsController");
-			field.setAccessible(true);
-			ZoomButtonsController mZoomButtonsController = new ZoomButtonsController(webViewRefresh);
-			mZoomButtonsController.getZoomControls().setVisibility(View.GONE);
-			try {
-				field.set(webViewRefresh, mZoomButtonsController);
-			} catch (IllegalArgumentException e) {
-				e.printStackTrace();
-			} catch (IllegalAccessException e) {
-				e.printStackTrace();
-			}
-		} catch (SecurityException e) {
-			e.printStackTrace();
-		} catch (NoSuchFieldException e) {
-			e.printStackTrace();
-		}
-	}
-
-	private void initData() {
-		Intent intent = getIntent();
-		if (intent != null) {
-			url = intent.getStringExtra(IntentUtils.KEY_URL);
-			String title = intent.getStringExtra(IntentUtils.KEY_TITLE);
-			if (title != null) {
-				getSupportActionBar().setTitle(title);
-			}
-		}
-		loadData();
-	}
-
-	private void loadData() {
-		if (url != null) {
-			webViewRefresh.loadUrl(url);
-		}
-
-	}
+    protected WebView webViewRefresh;
+    protected ProgressBar progressBar;
+    protected String url;
+    private boolean needCookie;
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        setContentView(R.layout.activity_message_web);
+        webViewRefresh = (WebView) findViewById(R.id.webView);
+        progressBar = (ProgressBar) findViewById(R.id.progressBar);
+        initView();
+        initData();
+    }
+
+
+    @Override
+    public boolean onCreateOptionsMenu(Menu menu) {
+        if (getIntent() != null && getIntent().getBooleanExtra(IntentUtils.KEY_NEER_SHARE, false)) {
+            getMenuInflater().inflate(R.menu.menu_about, menu);
+        }
+        return true;
+    }
+
+    @Override
+    public boolean onOptionsItemSelected(MenuItem item) {
+        if (R.id.app_about == item.getItemId()) {
+            String title = getSupportActionBar().getTitle().toString();
+            String content = null;
+            String imageUrl = null;
+            Intent intent = getIntent();
+            if (intent != null) {
+                content = intent.getStringExtra(IntentUtils.KEY_SHARE_CONTENT);
+                imageUrl = intent.getStringExtra(IntentUtils.KEY_SHARE_IMAGE);
+            }
+            if (content == null) {
+                content = "UU互联 Android客户端" + SystemUtil.getVersionName(mContext);
+                imageUrl = "http://img.my.csdn.net/uploads/201609/30/1475204542_1365.png";
+            }
+            LogUtil.i("url=" + url);
+            LogUtil.i("content=" + content);
+            LogUtil.i("imageUrl=" + imageUrl);
+            new ShareAction(activity).setDisplayList(
+                    SHARE_MEDIA.SINA,
+                    SHARE_MEDIA.QQ,
+                    SHARE_MEDIA.QZONE,
+                    SHARE_MEDIA.WEIXIN,
+                    SHARE_MEDIA.WEIXIN_CIRCLE,
+                    SHARE_MEDIA.WEIXIN_FAVORITE,
+                    SHARE_MEDIA.MORE)
+                    .withTitle(title)
+                    .withText(content)
+                    .withMedia(new UMImage(activity, imageUrl))
+                    .withTargetUrl(url)
+                    .setCallback(CommonUtil.umShareListener)
+                    .open();
+        }
+        return super.onOptionsItemSelected(item);
+    }
+
+    protected void initView() {
+        webViewRefresh.getSettings().setJavaScriptEnabled(true);
+        webViewRefresh.getSettings().setSupportZoom(true);
+        webViewRefresh.getSettings().setBuiltInZoomControls(true);
+        webViewRefresh.getSettings().setUseWideViewPort(true);
+        webViewRefresh.getSettings().setDomStorageEnabled(true);
+        webViewRefresh.getSettings().setLoadWithOverviewMode(true);
+        webViewRefresh.getSettings().setDefaultTextEncodingName("utf-8");
+        webViewRefresh.getSettings().setCacheMode(WebSettings.LOAD_NO_CACHE);
+        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
+            webViewRefresh.getSettings().setDisplayZoomControls(false);
+        } else {
+            setZoomControlGone();
+        }
+        webViewRefresh.clearCache(true);
+        webViewRefresh.clearHistory();
+        webViewRefresh.setWebViewClient(getWebViewClient());
+        webViewRefresh.setWebChromeClient(getWebChromeClient());
+    }
+
+
+    protected WebChromeClient getWebChromeClient() {
+        return new WebChromeClient() {
+            @Override
+            public void onProgressChanged(WebView view, int newProgress) {
+                progressBar.setProgress(newProgress);
+                if (newProgress == 100) {
+                    progressBar.setProgress(newProgress);
+                    progressBar.setVisibility(View.GONE);
+                }
+                super.onProgressChanged(view, newProgress);
+            }
+
+        };
+    }
+    protected WebViewClient getWebViewClient() {
+        return new WebViewClient() {
+            public boolean shouldOverrideUrlLoading(WebView view, String url) {
+                LogUtil.i("shouldOverrideUrlLoading url=" + url);
+                if (needCookie) {
+                    synCookies(ct, url);
+                }
+                view.loadUrl(url);
+                return true;
+            }
+
+            @Override
+            public void onPageStarted(WebView view, String url, Bitmap favicon) {
+                LogUtil.i("onPageStarted url=" + url);
+                if (progressBar.getVisibility() == View.GONE) {
+                    progressBar.setVisibility(View.VISIBLE);
+                }
+            }
+
+
+            @Override
+            public void onReceivedHttpError(WebView view, WebResourceRequest request, WebResourceResponse errorResponse) {
+                ToastUtil.showToast(ct,"Cookie已经过期,请重新登陆");
+                super.onReceivedHttpError(view, request, errorResponse);
+            }
+
+            @Override
+            public void onPageFinished(WebView view, String url) {
+                if (progressBar.getVisibility() == View.VISIBLE) {
+                    progressBar.setVisibility(View.GONE);
+                }
+            }
+
+            @Override
+            public void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error) {
+                handler.proceed();
+            }
+        };
+    }
+
+    public void setZoomControlGone() {
+        Class classType;
+        Field field;
+        try {
+            classType = WebView.class;
+            field = classType.getDeclaredField("mZoomButtonsController");
+            field.setAccessible(true);
+            ZoomButtonsController mZoomButtonsController = new ZoomButtonsController(webViewRefresh);
+            mZoomButtonsController.getZoomControls().setVisibility(View.GONE);
+            try {
+                field.set(webViewRefresh, mZoomButtonsController);
+            } catch (IllegalArgumentException e) {
+                e.printStackTrace();
+            } catch (IllegalAccessException e) {
+                e.printStackTrace();
+            }
+        } catch (SecurityException e) {
+            e.printStackTrace();
+        } catch (NoSuchFieldException e) {
+            e.printStackTrace();
+        }
+    }
+
+
+    private void initData() {
+        Intent intent = getIntent();
+        if (intent != null) {
+            url = intent.getStringExtra(IntentUtils.KEY_URL);
+            String title = intent.getStringExtra(IntentUtils.KEY_TITLE);
+            needCookie = intent.getBooleanExtra(IntentUtils.KEY_NEER_COOKIE, false);
+            if (title != null) {
+                getSupportActionBar().setTitle(title);
+            }
+            if (needCookie) {
+                synCookies(ct, url);
+            }
+        }
+        loadData();
+    }
+
+    private void loadData() {
+        if (url != null) {
+            webViewRefresh.loadUrl(url);
+        }
+
+    }
+
+
+    /**
+     * 同步一下cookie
+     */
+    public void synCookies(Context context, String url) {
+        CookieSyncManager.createInstance(context);
+        CookieManager cookieManager = CookieManager.getInstance();
+        cookieManager.setAcceptCookie(true);
+        cookieManager.removeSessionCookie();//移除
+        Cookie sessionCookie = MyApplication.cookieERP;
+        if (sessionCookie!=null){
+            String cookieStr = sessionCookie.getName() + "="
+                    + sessionCookie.getValue() + "; domain="
+                    + sessionCookie.getDomain() + "; path="
+                    + sessionCookie.getPath();
+            cookieManager.setCookie(url, cookieStr);//cookies是在HttpClient中获得的cookie
+            CookieSyncManager.getInstance().sync();
+        }
+
+    }
 }

+ 29 - 0
app_modular/appmessages/src/main/java/com/modular/appmessages/activity/MsgThirdWebActivity.java

@@ -0,0 +1,29 @@
+package com.modular.appmessages.activity;
+
+import android.os.Build;
+import android.webkit.ValueCallback;
+
+import com.common.LogUtil;
+
+/**
+ * Created by Bitlike on 2018/1/16.
+ */
+
+public class MsgThirdWebActivity extends MessageWebActivity {
+
+
+    @Override
+    protected void initView() {
+        super.initView();
+        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
+            webViewRefresh.evaluateJavascript("javascript:openUrl()", new ValueCallback<String>() {
+                @Override
+                public void onReceiveValue(String value) {
+                    LogUtil.i("onReceiveValue   value="+value);
+                }
+            });
+        }else{
+
+        }
+    }
+}

+ 3 - 0
app_modular/appmessages/src/main/java/com/modular/appmessages/activity/MsgsSecondCommonActivity.java

@@ -39,6 +39,7 @@ import com.core.dao.MessageDao;
 import com.core.model.MessageModel;
 import com.core.net.http.ViewUtil;
 import com.core.utils.CommonUtil;
+import com.core.utils.IntentUtils;
 import com.core.utils.TimeUtils;
 import com.core.widget.EmptyLayout;
 import com.handmark.pulltorefresh.library.PullToRefreshBase;
@@ -440,6 +441,8 @@ public class MsgsSecondCommonActivity extends BaseActivity implements View.OnCli
     private void doClickEvent(int mPosition, int msg_id) {
         baseUrl = CommonUtil.getSharedPreferences(mContext, "erp_baseurl");
         String url = baseUrl + "mobile/message/getDetail.action";
+//        IntentUtils.linkCommonWeb(ct,url + "?id=" + msg_id,msg_title,"","",false,true);
+
         Intent intent_web = new Intent("com.modular.main.WebViewCommActivity");
         intent_web.putExtra("url", url + "?id=" + msg_id);
         intent_web.putExtra("title", msg_title);

+ 2 - 2
app_modular/appmessages/src/main/java/com/modular/appmessages/adapter/ApprovalAdapter.java

@@ -320,8 +320,8 @@ public class ApprovalAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolde
     private void gotoReadEnclosure(Approval approval) {
         String url = approval.getIdKey();
         final CustomProgressDialog progressDialog = CustomProgressDialog.createDialog(ct);
-        progressDialog.setTitile("正在下载");
-        progressDialog.setMessage("正在下载,请勿关闭程序");
+        progressDialog.setTitile("正在预览");
+        progressDialog.setMessage("正在生成附件预览,请勿关闭程序");
         LogUtil.i("gotoReadEnclosure");
         if (!StringUtil.isEmpty(approval.getCaption())) {
             if (isImage(approval.getCaption())) {

+ 2 - 1
app_modular/apputils/src/main/java/com/modular/apputils/utils/SwitchUtil.java

@@ -15,8 +15,9 @@ public class SwitchUtil {
     public static boolean showShebeiguanli() {
         return  true;
     }
+
     public static boolean newFeePlease() {
-        return  false;
+        return  true;
     }
 
 

+ 0 - 0
app_core/common/src/main/res/drawable-xxhdpi/edit_hint_right_angle.xml → app_modular/apputils/src/main/res/drawable/edit_hint_right_angle.xml


+ 10 - 0
app_modular/apputils/src/main/res/drawable/edit_white_right_angle.xml

@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+    <item>
+        <shape>
+            <solid android:color="@color/white"/>
+            <stroke android:width="0.6dp" android:color="@color/item_line"/>
+            <padding android:bottom="0.5dp" android:left="0.5dp" android:right="0.5dp" android:top="0.5dp"/>
+        </shape>
+    </item>
+</selector>

+ 18 - 29
app_modular/appworks/src/main/java/com/uas/appworks/OA/platform/activity/BusinessTravelActivity.java

@@ -51,6 +51,7 @@ public class BusinessTravelActivity extends BaseNetActivity implements OnSmartHt
     private void initView() {
         mRefreshLayout = findViewById(R.id.mRefreshLayout);
         mRecyclerView = findViewById(R.id.mRecyclerView);
+        mRefreshLayout.setEnabledPullUp(false);
         mRefreshLayout.setOnRefreshListener(new BaseRefreshLayout.onRefreshListener() {
             @Override
             public void onRefresh() {
@@ -59,7 +60,7 @@ public class BusinessTravelActivity extends BaseNetActivity implements OnSmartHt
 
             @Override
             public void onLoadMore() {
-                loadData(++page);
+//                loadData(++page);
             }
         });
     }
@@ -78,7 +79,6 @@ public class BusinessTravelActivity extends BaseNetActivity implements OnSmartHt
     }
 
 
-
     @Override
     public void onSuccess(int what, String message, Tags tags) throws Exception {
         handlerData(message);
@@ -96,39 +96,28 @@ public class BusinessTravelActivity extends BaseNetActivity implements OnSmartHt
 
     private void handlerData(String message) throws Exception {
         LogUtil.i("handlerData");
-        try{
-            JSONObject object= JSON.parseObject(message);
-            JSONArray listdata = JSONUtil.getJSONArray(object, "listdata");
-            List<BusinessTravel> models = new ArrayList<>();
-            BusinessTravel model = null;
-            String cttpid=JSONUtil.getText(object, "em_cttpid");
-            for (int i = 0; i < listdata.size(); i++) {
-                JSONObject data = listdata.getJSONObject(i);
-                model = new BusinessTravel();
-                model.setType(BusinessTravel.TITLE);
-                model.setCode(JSONUtil.getText(data, "FP_ID"));
-                models.add(model);
-                JSONArray reimbursements = JSONUtil.getJSONArray(data, "reimbursement");
-                for (int j = 0; j < reimbursements.size(); j++) {
-                    models.add(new BusinessTravel(cttpid,reimbursements.getJSONObject(i)));
-                }
+        JSONObject object = JSON.parseObject(message);
+        JSONArray listdata = JSONUtil.getJSONArray(object, "listdata");
+        List<BusinessTravel> models = new ArrayList<>();
+        BusinessTravel model = null;
+        String cttpid = JSONUtil.getText(object, "em_cttpid");
+        for (int i = 0; i < listdata.size(); i++) {
+            JSONObject data = listdata.getJSONObject(i);
+            model = new BusinessTravel();
+            model.setType(BusinessTravel.TITLE);
+            model.setCode(JSONUtil.getText(data, "FP_ID"));
+            models.add(model);
+            JSONArray reimbursements = JSONUtil.getJSONArray(data, "reimbursement");
+            for (int j = 0; j < reimbursements.size(); j++) {
+                models.add(new BusinessTravel(cttpid, reimbursements.getJSONObject(j)));
             }
-            setAdapter(models);
-        }catch (Exception e){
-            LogUtil.i("Exception="+e.getMessage());
         }
-
+        setAdapter(models);
     }
 
     private void setAdapter(List<BusinessTravel> models) {
-        LogUtil.i("models="+models.size());
         if (mAdapter == null) {
-            mAdapter = new BusinessTravelAdapter(ct, models, new BusinessTravelAdapter.OnItemClickListener() {
-                @Override
-                public void click(int position, BusinessTravel model) {
-
-                }
-            });
+            mAdapter = new BusinessTravelAdapter(ct, models);
             mRecyclerView.addItemDecoration(new SpaceItemDecoration(30));
             mRecyclerView.setLayoutManager(new LinearLayoutManager(ct));
             mRecyclerView.setAdapter(mAdapter);

+ 39 - 42
app_modular/appworks/src/main/java/com/uas/appworks/OA/platform/activity/PurchaseDetailsActivity.java

@@ -3,6 +3,7 @@ package com.uas.appworks.OA.platform.activity;
 import android.app.Activity;
 import android.content.Intent;
 import android.support.v7.widget.AppCompatButton;
+import android.support.v7.widget.DividerItemDecoration;
 import android.support.v7.widget.LinearLayoutManager;
 import android.support.v7.widget.RecyclerView;
 import android.text.Editable;
@@ -11,6 +12,7 @@ import android.view.View;
 import android.view.ViewGroup;
 import android.widget.BaseAdapter;
 import android.widget.EditText;
+import android.widget.LinearLayout;
 import android.widget.ListView;
 import android.widget.TextView;
 
@@ -43,8 +45,6 @@ import com.uas.appworks.R;
 
 
 import java.util.ArrayList;
-import java.util.Calendar;
-import java.util.Date;
 import java.util.List;
 
 
@@ -67,7 +67,7 @@ public class PurchaseDetailsActivity extends BaseNetActivity implements OnSmartH
 
     @Override
     protected String getBaseUrl() {
-        return CommonUtil.getAppBaseUrl(ct);
+        return "http://uas.ubtob.com/";
     }
 
     @Override
@@ -87,6 +87,7 @@ public class PurchaseDetailsActivity extends BaseNetActivity implements OnSmartH
     private void initView() {
         mRecyclerView = findViewById(R.id.mRecyclerView);
         mRecyclerView.setLayoutManager(new LinearLayoutManager(ct));
+        mRecyclerView.addItemDecoration(new DividerItemDecoration(ct, LinearLayout.VERTICAL));
 
     }
 
@@ -95,7 +96,16 @@ public class PurchaseDetailsActivity extends BaseNetActivity implements OnSmartH
     }
 
 
-    private void verifiReply() {
+    private void loadData() {
+        Parameter.Builder builder = new Parameter.Builder();
+        builder.mode(Method.GET)
+                .url("sale/orders/" + varId + "/info");
+        requestHttp(builder, this);
+    }
+
+
+    private void verifiReply(List<Purchase> purchases) {
+        LogUtil.prinlnLongMsg("gongpengming", "json=" + JSON.toJSONString(purchases));
         reply();
     }
 
@@ -108,13 +118,6 @@ public class PurchaseDetailsActivity extends BaseNetActivity implements OnSmartH
         requestHttp(builder, this);
     }
 
-    private Purchase getPurchase(int id, JSONObject object, String caption, String field) {
-        Purchase purchase = new Purchase(id);
-        purchase.setCaption(caption);
-        purchase.setField(field);
-        purchase.setValues(JSONUtil.getText(object, purchase.getField()));
-        return purchase;
-    }
 
     private void handleMessage(final String message) {
         ThreadPool.getThreadPool().addTask(new Runnable() {
@@ -122,38 +125,11 @@ public class PurchaseDetailsActivity extends BaseNetActivity implements OnSmartH
             public void run() {
                 JSONObject object = JSON.parseObject(message);
                 final List<Purchase> dataList = new ArrayList<>();
-                //添加头部固定功能
-                dataList.add(getPurchase(0, object, "客户", "CLIENT"));
-                dataList.add(getPurchase(0, object, "收货地址", "ADDRESS"));
-                dataList.add(getPurchase(0, object, "订单号", "CODE"));
-                dataList.add(getPurchase(0, object, "单据时间", "TIME"));
-                dataList.add(getPurchase(0, object, "备注", "REMARKS"));
-                dataList.add(getPurchase(0, object, "总额", "ALLS"));
-
+                dataList.add(getPurchase(object));
                 JSONArray dataJSONs = JSONUtil.getJSONArray(object, "DATA");
-                JSONArray fields = JSONUtil.getJSONArray(object, "fields");
-
-                String idField = null;
-                for (int j = 0; j < fields.size(); j++) {
-                    if ("ID".equals(JSONUtil.getText(fields.getJSONObject(j), "caption"))) {
-                        idField = JSONUtil.getText(fields.getJSONObject(j), "field");
-                        break;
-                    }
-                }
-                if (!ListUtils.isEmpty(dataJSONs) && !ListUtils.isEmpty(fields)) {
+                if (!ListUtils.isEmpty(dataJSONs)) {
                     for (int i = 0; i < dataJSONs.size(); i++) {
-                        JSONObject dataJSON = dataJSONs.getJSONObject(i);
-                        for (int j = 0; j < fields.size(); j++) {
-                            JSONObject fieldJSON = fields.getJSONObject(j);
-                            Purchase purchaseItem = new Purchase();
-                            purchaseItem.setField(JSONUtil.getText(fieldJSON, "field"));
-                            purchaseItem.setCaption(JSONUtil.getText(fieldJSON, "caption"));
-                            purchaseItem.setType(JSONUtil.getText(fieldJSON, "type"));
-                            purchaseItem.setNeedInput(JSONUtil.getBoolean(fieldJSON, "needInput"));
-                            purchaseItem.setValues(JSONUtil.getText(dataJSON, purchaseItem.getField()));
-                            purchaseItem.setId(JSONUtil.getInt(dataJSON, idField));
-                            dataList.add(purchaseItem);
-                        }
+                        dataList.add(getPurchase(dataJSONs.getJSONObject(i)));
                     }
                 }
                 OAHttpHelper.getInstance().post(new Runnable() {
@@ -166,12 +142,33 @@ public class PurchaseDetailsActivity extends BaseNetActivity implements OnSmartH
         });
     }
 
+    private Purchase getPurchase(JSONObject object) {
+        Purchase purchase = new Purchase();
+        int id = JSONUtil.getInt(object, "ID");
+        String client = JSONUtil.getText(object, "CLIENT");
+        String address = JSONUtil.getText(object, "ADDRESS");
+        String time = JSONUtil.getText(object, "TIME");
+        String remarks = JSONUtil.getText(object, "REMARKS");
+        String alls = JSONUtil.getText(object, "ALLS");
+        String number = JSONUtil.getText(object, "NUMBER");
+        String date = JSONUtil.getText(object, "DELIVERYDATE");
+        purchase.setNumber(number);
+        purchase.setDate(date);
+        purchase.setId(id);
+        purchase.setCustomer(client);
+        purchase.setAddress(address);
+        purchase.setTime(time);
+        purchase.setRemarks(remarks);
+        purchase.setTotal(alls);
+        return purchase;
+    }
+
     private void setData2Adapter(List<Purchase> dataList) {
         mAdapter = new PurchaseDetailsAdapter(ct, varStatus, dataList);
         mAdapter.setOnReplyLisenter(new PurchaseDetailsAdapter.OnReplyLisenter() {
             @Override
             public void reply(List<Purchase> purchases) {
-                LogUtil.prinlnLongMsg("gongpengming","json="+JSON.toJSONString(purchases));
+                PurchaseDetailsActivity.this.verifiReply(purchases);
             }
         });
         mRecyclerView.setAdapter(mAdapter);

+ 57 - 15
app_modular/appworks/src/main/java/com/uas/appworks/OA/platform/adapter/BusinessTravelAdapter.java

@@ -12,14 +12,21 @@ import android.widget.TextView;
 import com.alibaba.fastjson.JSON;
 import com.common.LogUtil;
 import com.common.data.DateFormatUtil;
+import com.common.data.JSONUtil;
 import com.common.data.ListUtils;
 import com.common.data.StringUtil;
+import com.common.hmac.Md5Util;
 import com.core.utils.CommonUtil;
+import com.core.utils.IntentUtils;
 import com.modular.apputils.widget.TravelDirectionView;
 import com.uas.appworks.OA.platform.model.BusinessTravel;
 import com.uas.appworks.R;
 
+import java.io.UnsupportedEncodingException;
+import java.net.URLEncoder;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 
 /**
  * Created by Bitlike on 2017/12/12.
@@ -28,13 +35,11 @@ import java.util.List;
 public class BusinessTravelAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> implements View.OnClickListener {
     private Context ct;
     private List<BusinessTravel> models;
-    private OnItemClickListener listener;
     private String currentName;
 
-    public BusinessTravelAdapter(Context ct, List<BusinessTravel> models, OnItemClickListener listener) {
+    public BusinessTravelAdapter(Context ct, List<BusinessTravel> models) {
         this.ct = ct;
         this.models = models;
-        this.listener = listener;
         this.currentName = CommonUtil.getName();
     }
 
@@ -99,7 +104,7 @@ public class BusinessTravelAdapter extends RecyclerView.Adapter<RecyclerView.Vie
     private final String DONE_CANCEL = "取消预约";
 
     private void bindBaseView(BaseViewHlder holder, BusinessTravel model, int position) {
-        holder.codeTv.setText(model.getTitle());
+        holder.codeTv.setText(model.getTitleAndCode() );
         holder.statusTv.setText(model.getStatus());
         holder.nameTv.setText(currentName == null ? "**" : currentName);
         holder.idCardTv.setText(model.getCttpid());
@@ -144,7 +149,7 @@ public class BusinessTravelAdapter extends RecyclerView.Adapter<RecyclerView.Vie
         holder.tripTv.setText(fromCity + "-" + toCity);
         holder.mTravelDirectionView.setData(model.getSeat(), longTime2Time(model.getAllTime()));
         //改签
-        if (model.canChange()) {
+        if (StringUtil.getText(holder.dateTv).equals(DONE_CANCEL)) {
             holder.changeTv.setVisibility(View.VISIBLE);
             holder.changeTv.setBackgroundResource(R.drawable.text_frame_radian_hint_bg);
             holder.changeTv.setTextColor(ct.getResources().getColor(R.color.text_hine));
@@ -285,8 +290,6 @@ public class BusinessTravelAdapter extends RecyclerView.Adapter<RecyclerView.Vie
     public void onClick(View v) {
         BusinessTravel model = (BusinessTravel) v.getTag(R.id.tag_key);
         int position = (int) v.getTag(R.id.tag_key2);
-        LogUtil.i("model=" + JSON.toJSONString(model));
-        LogUtil.i("position=" + position);
         int id = v.getId();
         if (id == R.id.expandTv) {
             model.setExpand(!model.isExpand());
@@ -295,21 +298,16 @@ public class BusinessTravelAdapter extends RecyclerView.Adapter<RecyclerView.Vie
             TextView doneTv = (TextView) v;
             String doneMessage = StringUtil.getText(doneTv);
             if (doneMessage.equals(DONE_CANCEL)) {
-                LogUtil.i("点击了取消预约");
+                cancel(model);
             } else {
-                LogUtil.i("点击了预约/订票");
+                reserve(model);
             }
         } else if (R.id.changeTv == id) {
-            LogUtil.i("点击了改签");
+            change(model);
         }
     }
 
 
-    public interface OnItemClickListener {
-        void click(int position, BusinessTravel model);
-    }
-
-
     private String longTime2Time(long time) {
         long second = time / 1000;
         long hh = second / 3600;
@@ -317,4 +315,48 @@ public class BusinessTravelAdapter extends RecyclerView.Adapter<RecyclerView.Vie
         return hh + "小时" + mm + "分钟";
     }
 
+
+    private void cancel(BusinessTravel model) {
+        LogUtil.i("点击了取消预约");
+
+    }
+
+    private void reserve(BusinessTravel model) {
+        LogUtil.i("点击了预约/订票");
+        Map<String, Object> map = new HashMap<>();
+        map.put("traverorderno",model.getCode());
+        map.put("product",model.getTitleCode());
+        map.put("costname","成本中心");
+        map.put("proname","UU互联出差单申报");
+        String p = JSONUtil.map2JSON(map);
+        turn2Web(p);
+    }
+
+    private void change(BusinessTravel model) {
+        LogUtil.i("点击了改签");
+
+    }
+
+    private void turn2Web(String p) {
+        //TODO 测试数据
+        String appkey = "y8gd87dsdkencgzk394k7s5c78io35c";
+        String username = "huangx";
+        String appSceret = "e212e142a5c9e0590eefb7d9f1bc91d7";
+        String data = appkey + username.toUpperCase() + appSceret;
+        String key = Md5Util.toMD5(appSceret).toUpperCase();
+        String sign = Md5Util.toMD5(key + data);
+        StringBuilder urlBuilder = new StringBuilder("http://124.254.45.234:8082/oa/caslogin/");
+        urlBuilder.append(appkey + "/");
+        urlBuilder.append(username + "/");
+        urlBuilder.append(sign);
+        try {
+            urlBuilder.append("?p=" + URLEncoder.encode(p, "UTF-8"));
+        } catch (UnsupportedEncodingException e) {
+            e.printStackTrace();
+        }
+        LogUtil.i(urlBuilder.toString());
+        IntentUtils.linkCommonWeb(ct, urlBuilder.toString());
+    }
+
+
 }

+ 68 - 46
app_modular/appworks/src/main/java/com/uas/appworks/OA/platform/adapter/PurchaseDetailsAdapter.java

@@ -2,6 +2,7 @@ package com.uas.appworks.OA.platform.adapter;
 
 import android.app.Activity;
 import android.content.Context;
+import android.support.v7.widget.AppCompatTextView;
 import android.support.v7.widget.RecyclerView;
 import android.text.Editable;
 import android.view.LayoutInflater;
@@ -50,7 +51,12 @@ public class PurchaseDetailsAdapter extends RecyclerView.Adapter<RecyclerView.Vi
 
     @Override
     public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
-        return viewType == (getItemCount() - 1) ? new BtnViewHolder(parent) : new ViewHolder(parent);
+        if (viewType == 0) {
+            return new TotalViewHolder(parent);
+        } else if (viewType == (getItemCount() - 1)) {
+            return new BtnViewHolder(parent);
+        }
+        return new ViewHolder(parent);
     }
 
     @Override
@@ -73,9 +79,8 @@ public class PurchaseDetailsAdapter extends RecyclerView.Adapter<RecyclerView.Vi
     }
 
     class ViewHolder extends RecyclerView.ViewHolder {
-        TextView captionTV, valueTv;
-        EditText valueEt;
-        View line;
+        TextView timeTv, remarksTv, totalTv,dateEd;
+        EditText  numberEd, remarksInputEd;
 
         public ViewHolder(ViewGroup viewGroup) {
             this(mInflater.inflate(R.layout.item_purchase, viewGroup, false));
@@ -83,10 +88,31 @@ public class PurchaseDetailsAdapter extends RecyclerView.Adapter<RecyclerView.Vi
 
         public ViewHolder(View itemView) {
             super(itemView);
-            captionTV = itemView.findViewById(R.id.captionTV);
-            valueTv = itemView.findViewById(R.id.valueTv);
-            valueEt = itemView.findViewById(R.id.valueEt);
-            line = itemView.findViewById(R.id.line);
+            timeTv = itemView.findViewById(R.id.timeTv);
+            remarksTv = itemView.findViewById(R.id.remarksTv);
+            totalTv = itemView.findViewById(R.id.totalTv);
+            dateEd = itemView.findViewById(R.id.dateEd);
+            numberEd = itemView.findViewById(R.id.numberEd);
+            remarksInputEd = itemView.findViewById(R.id.remarksInputEd);
+        }
+    }
+
+    class TotalViewHolder extends RecyclerView.ViewHolder {
+        TextView customerTv, addressTv, codeTv, timeTv, remarksTv, totalTv;
+
+        public TotalViewHolder(ViewGroup viewGroup) {
+            this(mInflater.inflate(R.layout.item_ls_purchase, viewGroup, false));
+        }
+
+        public TotalViewHolder(View itemView) {
+            super(itemView);
+            addressTv = itemView.findViewById(R.id.addressTv);
+            codeTv = itemView.findViewById(R.id.codeTv);
+            timeTv = itemView.findViewById(R.id.timeTv);
+            customerTv = itemView.findViewById(R.id.customerTv);
+            remarksTv = itemView.findViewById(R.id.remarksTv);
+            totalTv = itemView.findViewById(R.id.totalTv);
+
         }
     }
 
@@ -95,11 +121,23 @@ public class PurchaseDetailsAdapter extends RecyclerView.Adapter<RecyclerView.Vi
     public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {
         if (holder instanceof ViewHolder && position < ListUtils.getSize(purchases)) {
             onBindViewHolder((ViewHolder) holder, position);
+        } else if (holder instanceof TotalViewHolder) {
+            onBindViewHolder((TotalViewHolder) holder, position);
         } else if (holder instanceof BtnViewHolder) {
             onBindViewHolder((BtnViewHolder) holder);
         }
     }
 
+    private void onBindViewHolder(TotalViewHolder holder, int position) {
+        Purchase purchase = purchases.get(position);
+        holder.totalTv.setText(purchase.getTotal());
+        holder.addressTv.setText(purchase.getAddress());
+        holder.customerTv.setText(purchase.getNumber());
+        holder.codeTv.setText(purchase.getRemarksInput());
+        holder.remarksTv.setText(purchase.getRemarks());
+        holder.timeTv.setText(purchase.getTime());
+    }
+
     private void onBindViewHolder(BtnViewHolder holder) {
         boolean canReply = (status != null && !status.equals("已结案"));
         holder.replyBtn.setFocusable(canReply);
@@ -118,39 +156,22 @@ public class PurchaseDetailsAdapter extends RecyclerView.Adapter<RecyclerView.Vi
 
     private void onBindViewHolder(ViewHolder holder, int position) {
         Purchase purchase = purchases.get(position);
-        holder.captionTV.setText(purchase.getCaption());
-
-        if (purchase.isNeedInput()) {
-            holder.valueEt.setBackgroundResource(R.drawable.edit_hint_right_angle);
-            holder.valueEt.setClickable(true);
-            if (purchase.getType().equals("date")) {
-                holder.valueTv.setText(purchase.getValues());
-                holder.valueTv.setBackgroundResource(R.drawable.edit_hint_right_angle);
-                holder.valueEt.setVisibility(View.GONE);
-                holder.valueTv.setVisibility(View.VISIBLE);
-                holder.valueTv.setTag(position);
-                holder.valueTv.setOnClickListener(onClickListener);
-            } else {
-                holder.valueEt.setText(purchase.getValues());
-                holder.valueTv.setVisibility(View.GONE);
-                holder.valueEt.setVisibility(View.VISIBLE);
-                holder.valueEt.setFocusable(true);
-                holder.valueEt.addTextChangedListener(new TextChangListener(holder, position));
-            }
-        } else {
-            holder.valueTv.setText(StringUtil.isEmpty(purchase.getValues()) ? "无" : purchase.getValues());
-            holder.valueTv.setBackgroundDrawable(null);
-            holder.valueEt.setVisibility(View.GONE);
-            holder.valueTv.setVisibility(View.VISIBLE);
-        }
-        holder.line.setVisibility((position > 0 && purchases.get(position - 1).getId() != purchase.getId()) ? View.VISIBLE : View.GONE);
-//        holder.line.setVisibility(View.VISIBLE);
+        holder.totalTv.setText(purchase.getTotal());
+        holder.remarksTv.setText(purchase.getRemarks());
+        holder.timeTv.setText(purchase.getTime());
+        holder.dateEd.setText(purchase.getDate());
+        holder.numberEd.setText(purchase.getNumber());
+        holder.remarksInputEd.setText(purchase.getRemarksInput());
+        holder.dateEd.setTag(position);
+        holder.dateEd.setOnClickListener(onClickListener);
+        holder.numberEd.addTextChangedListener(new TextChangListener(position, 1));
+        holder.remarksInputEd.addTextChangedListener(new TextChangListener(position, 2));
     }
 
     private View.OnClickListener onClickListener = new View.OnClickListener() {
         @Override
         public void onClick(View v) {
-            if (v.getId() == R.id.valueTv && v.getTag() != null && v.getTag() instanceof Integer) {
+            if (v.getId() == R.id.dateEd && v.getTag() != null && v.getTag() instanceof Integer) {
                 int position = (int) v.getTag();
                 showDateSelect(position);
             } else if (v.getId() == R.id.replyBtn) {
@@ -166,8 +187,8 @@ public class PurchaseDetailsAdapter extends RecyclerView.Adapter<RecyclerView.Vi
         picker.setRange(2000, 2030);
         int year, month, day;
         Date time = null;
-        if (ListUtils.getSize(purchases) > position && !StringUtil.isEmpty(purchases.get(position).getValues())) {
-            time = DateFormatUtil.str2date(purchases.get(position).getValues(), DateFormatUtil.YMD);
+        if (ListUtils.getSize(purchases) > position && !StringUtil.isEmpty(purchases.get(position).getDate())) {
+            time = DateFormatUtil.str2date(purchases.get(position).getDate(), DateFormatUtil.YMD);
         }
         year = CalendarUtil.getYear(time);
         month = CalendarUtil.getMonth(time);
@@ -177,7 +198,7 @@ public class PurchaseDetailsAdapter extends RecyclerView.Adapter<RecyclerView.Vi
             @Override
             public void onDateTimePicked(String year, String month, String day, String hour, String minute) {
                 if (ListUtils.getSize(purchases) > position) {
-                    purchases.get(position).setValues(year + "-" + month + "-" + day);
+                    purchases.get(position).setDate(year + "-" + month + "-" + day);
                     notifyItemChanged(position);
                 }
             }
@@ -186,21 +207,22 @@ public class PurchaseDetailsAdapter extends RecyclerView.Adapter<RecyclerView.Vi
     }
 
     private class TextChangListener extends EditChangeListener {
-        ViewHolder hodler;
         private int position;
+        private int type;
 
-        public TextChangListener(ViewHolder hodler, int position) {
-            this.hodler = hodler;
+        public TextChangListener(int position, int type) {
             this.position = position;
+            this.type = type;
         }
 
         @Override
         public void afterTextChanged(Editable s) {
             if (this.position >= 0 && ListUtils.getSize(purchases) > this.position) {
-                if (this.hodler.valueEt != null && this.hodler.valueEt.getVisibility() == View.VISIBLE) {
-                    LogUtil.i("s=" + s.toString());
-                    LogUtil.i("position=" + this.position);
-                    purchases.get(this.position).setValues(s == null ? "" : s.toString());
+                String message = s == null ? "" : s.toString();
+                if (type == 1) {
+                    purchases.get(this.position).setNumber(message);
+                } else if (type == 2) {
+                    purchases.get(this.position).setRemarksInput(message);
                 }
             }
         }

+ 16 - 0
app_modular/appworks/src/main/java/com/uas/appworks/OA/platform/model/BusinessTravel.java

@@ -265,6 +265,22 @@ public class BusinessTravel {
     }
 
     public String getTitle() {
+        return title;
+    }
+
+    public String getTitleCode() {
+        switch (title) {
+            case "火车票":
+                return "train";
+            case "住宿":
+                return "hotel";
+            case "飞机票":
+                return "air";
+        }
+        return title;
+    }
+
+    public String getTitleAndCode() {
         return title + "   " + (StringUtil.isEmpty(code) ? "未订票" : code);
     }
 

+ 57 - 44
app_modular/appworks/src/main/java/com/uas/appworks/OA/platform/model/Purchase.java

@@ -5,81 +5,94 @@ package com.uas.appworks.OA.platform.model;
  */
 
 public class Purchase {
-    private int position;
     private int id;
-    private String field;
-    private String caption;
-    private String values;
-    private String type;
-    private boolean needInput;
+    private String customer;
+    private String address;
+    private  String code;
+    private  String time;
+    private  String remarks;
+    private  String total;
+    private  String date;
+    private  String number;
+    private  String remarksInput;
 
-    public Purchase(int position) {
-        this.position = position;
-        this.id = 0;
-        this.field = "";
-        this.values = "无";
-        this.caption = "";
-        this.type = "";
-        this.needInput = false;
+    public int getId() {
+        return id;
     }
 
-    public Purchase() {
-        this(0);
+    public void setId(int id) {
+        this.id = id;
     }
 
-    public String getCaption() {
-        return caption;
+    public String getCustomer() {
+        return customer;
     }
 
-    public void setCaption(String caption) {
-        this.caption = caption;
+    public void setCustomer(String customer) {
+        this.customer = customer;
     }
 
-    public int getPosition() {
-        return position;
+    public String getAddress() {
+        return address;
     }
 
-    public void setPosition(int position) {
-        this.position = position;
+    public void setAddress(String address) {
+        this.address = address;
     }
 
-    public int getId() {
-        return id;
+    public String getCode() {
+        return code;
     }
 
-    public void setId(int id) {
-        this.id = id;
+    public void setCode(String code) {
+        this.code = code;
+    }
+
+    public String getTime() {
+        return time;
+    }
+
+    public void setTime(String time) {
+        this.time = time;
+    }
+
+    public String getRemarks() {
+        return remarks;
+    }
+
+    public void setRemarks(String remarks) {
+        this.remarks = remarks;
     }
 
-    public String getField() {
-        return field;
+    public String getTotal() {
+        return total;
     }
 
-    public void setField(String field) {
-        this.field = field;
+    public void setTotal(String total) {
+        this.total = total;
     }
 
-    public String getValues() {
-        return values;
+    public String getDate() {
+        return date;
     }
 
-    public void setValues(String values) {
-        this.values = values;
+    public void setDate(String date) {
+        this.date = date;
     }
 
-    public String getType() {
-        return type;
+    public String getNumber() {
+        return number;
     }
 
-    public void setType(String type) {
-        this.type = type;
+    public void setNumber(String number) {
+        this.number = number;
     }
 
-    public boolean isNeedInput() {
-        return needInput;
+    public String getRemarksInput() {
+        return remarksInput;
     }
 
-    public void setNeedInput(boolean needInput) {
-        this.needInput = needInput;
+    public void setRemarksInput(String remarksInput) {
+        this.remarksInput = remarksInput;
     }
 }

+ 117 - 8
app_modular/appworks/src/main/res/layout/item_ls_purchase.xml

@@ -2,15 +2,124 @@
 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="match_parent"
     android:layout_height="wrap_content"
-    android:focusableInTouchMode="true"
-    android:paddingBottom="@dimen/padding"
-    android:paddingLeft="@dimen/paddingApp">
+    android:background="#f2f8fc"
+    android:padding="@dimen/padding">
 
-    <com.core.widget.MyListView
-        android:id="@+id/dataListView"
+    <android.support.v7.widget.AppCompatTextView
+        android:id="@+id/customerTag"
+        android:layout_width="80dp"
+        android:layout_height="wrap_content"
+        android:text="客户:"
+        android:textColor="@color/hintColor"
+        android:textSize="@dimen/text_main" />
+
+    <android.support.v7.widget.AppCompatTextView
+        android:id="@+id/customerTv"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_alignTop="@id/customerTag"
+        android:layout_toRightOf="@id/customerTag"
+        android:text="客户:"
+        android:textColor="@color/text_main"
+        android:textSize="@dimen/text_main" />
+
+    <android.support.v7.widget.AppCompatTextView
+        android:id="@+id/addressTag"
+        android:layout_width="80dp"
+        android:layout_marginTop="@dimen/padding"
+        android:layout_height="wrap_content"
+        android:layout_below="@id/customerTag"
+        android:text="收货地址:"
+        android:textColor="@color/hintColor"
+        android:textSize="@dimen/text_main" />
+
+    <android.support.v7.widget.AppCompatTextView
+        android:id="@+id/addressTv"
         android:layout_width="match_parent"
-        android:layout_height="match_parent"
-        android:dividerHeight="0dp"
-        android:focusableInTouchMode="false" />
+        android:layout_height="wrap_content"
+        android:layout_alignTop="@id/addressTag"
+        android:layout_toRightOf="@id/customerTag"
+        android:text="客户:"
+        android:textColor="@color/text_main"
+        android:textSize="@dimen/text_main" />
+
+    <android.support.v7.widget.AppCompatTextView
+        android:id="@+id/codeTag"
+        android:layout_width="80dp"
+        android:layout_marginTop="@dimen/padding"
+        android:layout_height="wrap_content"
+        android:layout_below="@id/addressTag"
+        android:text="订单号:"
+        android:textColor="@color/hintColor"
+        android:textSize="@dimen/text_main" />
+
+    <android.support.v7.widget.AppCompatTextView
+        android:id="@+id/codeTv"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_alignTop="@id/codeTag"
+        android:layout_toRightOf="@id/customerTag"
+        android:text="客户:"
+        android:textColor="@color/text_main"
+        android:textSize="@dimen/text_main" />
+
+    <android.support.v7.widget.AppCompatTextView
+        android:id="@+id/timeTag"
+        android:layout_width="80dp"
+        android:layout_marginTop="@dimen/padding"
+        android:layout_height="wrap_content"
+        android:layout_below="@id/codeTag"
+        android:text="单据时间:"
+        android:textColor="@color/hintColor"
+        android:textSize="@dimen/text_main" />
 
+    <android.support.v7.widget.AppCompatTextView
+        android:id="@+id/timeTv"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_alignTop="@id/timeTag"
+        android:layout_toRightOf="@id/customerTag"
+        android:text="客户:"
+        android:textColor="@color/text_main"
+        android:textSize="@dimen/text_main" />
+
+    <android.support.v7.widget.AppCompatTextView
+        android:id="@+id/remarksTag"
+        android:layout_width="80dp"
+        android:layout_marginTop="@dimen/padding"
+        android:layout_height="wrap_content"
+        android:layout_below="@id/timeTag"
+        android:text="备注:"
+        android:textColor="@color/hintColor"
+        android:textSize="@dimen/text_main" />
+
+    <android.support.v7.widget.AppCompatTextView
+        android:id="@+id/remarksTv"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_alignTop="@id/remarksTag"
+        android:layout_toRightOf="@id/customerTag"
+        android:text="客户:"
+        android:textColor="@color/text_main"
+        android:textSize="@dimen/text_main" />
+
+    <android.support.v7.widget.AppCompatTextView
+        android:id="@+id/totalTag"
+        android:layout_marginTop="@dimen/padding"
+        android:layout_width="80dp"
+        android:layout_height="wrap_content"
+        android:layout_below="@id/remarksTag"
+        android:text="总额:"
+        android:textColor="@color/hintColor"
+        android:textSize="@dimen/text_main" />
+
+    <android.support.v7.widget.AppCompatTextView
+        android:id="@+id/totalTv"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_alignTop="@id/totalTag"
+        android:layout_toRightOf="@id/customerTag"
+        android:text="客户:"
+        android:textColor="@color/text_main"
+        android:textSize="@dimen/text_main" />
 </RelativeLayout>

+ 140 - 47
app_modular/appworks/src/main/res/layout/item_purchase.xml

@@ -1,55 +1,148 @@
 <?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="match_parent"
     android:layout_height="wrap_content"
-    android:orientation="vertical">
-    <View
-        android:id="@+id/line"
+    android:background="@color/white"
+    android:padding="@dimen/padding">
+
+    <android.support.v7.widget.AppCompatTextView
+        android:id="@+id/timeTag"
+        android:layout_width="80dp"
+        android:layout_height="wrap_content"
+        android:text="单据时间:"
+        android:textColor="@color/hintColor"
+        android:textSize="@dimen/text_main" />
+
+    <android.support.v7.widget.AppCompatTextView
+        android:id="@+id/timeTv"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_alignTop="@id/timeTag"
+        android:layout_toRightOf="@id/timeTag"
+        android:textColor="@color/text_main"
+        android:textSize="@dimen/text_main" />
+
+
+    <android.support.v7.widget.AppCompatTextView
+        android:id="@+id/remarksTag"
+        android:layout_width="80dp"
+        android:layout_height="wrap_content"
+        android:layout_below="@id/timeTag"
         android:layout_marginTop="@dimen/padding"
-        android:layout_marginBottom="@dimen/padding"
+        android:text="备注:"
+        android:textColor="@color/hintColor"
+        android:textSize="@dimen/text_main" />
+
+    <android.support.v7.widget.AppCompatTextView
+        android:id="@+id/remarksTv"
         android:layout_width="match_parent"
-        android:background="@color/item_line"
-        android:layout_height="@dimen/line"/>
+        android:layout_height="wrap_content"
+        android:layout_alignTop="@id/remarksTag"
+        android:layout_toRightOf="@id/timeTag"
+        android:text="客户:"
+        android:textColor="@color/text_main"
+        android:textSize="@dimen/text_main" />
 
-    <LinearLayout
-        style="@style/approvalStyle"
+    <android.support.v7.widget.AppCompatTextView
+        android:id="@+id/totalTag"
+        android:layout_width="80dp"
+        android:layout_height="wrap_content"
+        android:layout_below="@id/remarksTag"
+        android:layout_marginTop="@dimen/padding"
+        android:text="总额:"
+        android:textColor="@color/hintColor"
+        android:textSize="@dimen/text_main" />
+
+    <android.support.v7.widget.AppCompatTextView
+        android:id="@+id/totalTv"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
-        android:paddingLeft="@dimen/paddingApp">
-
-        <TextView
-            android:id="@+id/captionTV"
-            style="@style/approvalItemStyle"
-            android:layout_width="0dp"
-            android:layout_height="wrap_content"
-            android:layout_marginRight="10dp"
-            android:layout_weight="1" />
-
-        <FrameLayout
-            android:id="@+id/valuesFl"
-            android:layout_width="0dp"
-            android:layout_height="wrap_content"
-            android:layout_weight="3">
-
-            <EditText
-                android:id="@+id/valueEt"
-                style="@style/approvalItemStyle"
-                android:layout_width="match_parent"
-                android:layout_height="match_parent"
-                android:background="@drawable/edit_hint_right_angle"
-                android:hint="@string/common_input2"
-                android:textColor="@color/text_main" />
-
-            <TextView
-                android:id="@+id/valueTv"
-                style="@style/approvalItemStyle"
-                android:layout_width="match_parent"
-                android:background="@drawable/edit_hint_right_angle"
-                android:gravity="center|left"
-                android:hint="@string/common_select1"
-                android:textColor="@color/text_main"
-                android:visibility="gone" />
-        </FrameLayout>
-    </LinearLayout>
-
-</LinearLayout>
+        android:layout_alignTop="@id/totalTag"
+        android:layout_toRightOf="@id/timeTag"
+        android:text="客户:"
+        android:textColor="@color/text_main"
+        android:textSize="@dimen/text_main" />
+
+    <android.support.v7.widget.AppCompatTextView
+        android:id="@+id/dateTag"
+        android:layout_width="80dp"
+        android:layout_height="wrap_content"
+        android:layout_below="@id/totalTag"
+        android:layout_marginTop="@dimen/padding"
+        android:text="交货日期:"
+        android:textColor="@color/hintColor"
+        android:textSize="@dimen/text_main" />
+
+    <android.support.v7.widget.AppCompatTextView
+        android:id="@+id/dateEd"
+        android:layout_width="100dp"
+        android:layout_height="25dp"
+        android:layout_alignTop="@id/dateTag"
+        android:layout_toRightOf="@id/timeTag"
+        android:background="@drawable/edit_white_right_angle"
+        android:gravity="center_vertical"
+        android:text="客户:"
+        android:textColor="@color/text_main"
+        android:textSize="@dimen/text_main" />
+
+    <android.support.v7.widget.AppCompatTextView
+        android:id="@+id/numberTag"
+        android:layout_width="80dp"
+        android:layout_height="wrap_content"
+        android:layout_below="@id/dateTag"
+        android:layout_marginTop="@dimen/padding"
+        android:text="数量:"
+        android:textColor="@color/hintColor"
+        android:textSize="@dimen/text_main" />
+
+    <android.support.v7.widget.AppCompatEditText
+        android:id="@+id/numberEd"
+        android:layout_width="100dp"
+        android:layout_height="25dp"
+        android:layout_alignTop="@id/numberTag"
+        android:layout_toRightOf="@id/timeTag"
+        android:background="@drawable/edit_white_right_angle"
+        android:gravity="center_vertical"
+        android:inputType="number"
+        android:text="客户:"
+        android:textColor="@color/text_main"
+        android:textSize="@dimen/text_main" />
+
+    <android.support.v7.widget.AppCompatEditText
+        android:id="@+id/numberUnit"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_alignTop="@id/numberTag"
+        android:layout_toRightOf="@id/numberEd"
+        android:background="@drawable/edit_white_right_angle"
+        android:gravity="center_vertical"
+        android:inputType="number"
+        android:text="PCS"
+        android:textColor="@color/text_main"
+        android:textSize="@dimen/text_main" />
+
+    <android.support.v7.widget.AppCompatTextView
+        android:id="@+id/remarksInputTag"
+        android:layout_width="80dp"
+        android:layout_height="wrap_content"
+        android:layout_below="@id/numberTag"
+        android:layout_marginTop="@dimen/padding"
+        android:text="备注:"
+        android:textColor="@color/hintColor"
+        android:textSize="@dimen/text_main" />
+
+    <android.support.v7.widget.AppCompatEditText
+        android:id="@+id/remarksInputEd"
+        android:layout_width="100dp"
+        android:layout_height="25dp"
+        android:layout_alignTop="@id/remarksInputTag"
+        android:layout_toRightOf="@id/timeTag"
+        android:background="@drawable/edit_white_right_angle"
+        android:gravity="center_vertical"
+        android:inputType="number"
+        android:text="客户:"
+        android:textColor="@color/text_main"
+        android:textSize="@dimen/text_main" />
+
+
+</RelativeLayout>