FANGLH 8 years ago
parent
commit
e4f1f0ebbf

+ 27 - 0
app_core/common/src/main/res/layout/bsetting_activity.xml

@@ -287,6 +287,33 @@
             android:background="@drawable/oa_next"
             android:contentDescription="@string/app_name" />
     </RelativeLayout>
+    <RelativeLayout
+        android:id="@+id/table_setting_rl"
+        style="@style/IMTbleLine"
+        android:background="@drawable/selector_me_menu_item_bg"
+        android:layout_alignParentTop="true"
+        android:layout_centerHorizontal="true">
+        <View
+            android:layout_alignParentBottom="true"
+            android:layout_width="match_parent"
+            android:layout_height="@dimen/line"
+            android:background="@color/item_line" />
+        <TextView
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_centerVertical="true"
+            android:gravity="center"
+            android:text="桌位设置"
+            android:textColor="@color/black"
+            android:textSize="14sp" />
+        <ImageView
+            android:layout_width="@dimen/next_width"
+            android:layout_height="@dimen/next_height"
+            android:layout_alignParentRight="true"
+            android:layout_centerVertical="true"
+            android:background="@drawable/oa_next"
+            android:contentDescription="@string/app_name" />
+    </RelativeLayout>
     <RelativeLayout
         android:id="@+id/business_introduction_rl"
         style="@style/IMTbleLine"

+ 1 - 0
app_modular/appme/src/main/AndroidManifest.xml

@@ -75,5 +75,6 @@
             />
         <activity android:name=".settings.activity.WagesDetailsActivity"
             />
+        <activity android:name=".settings.activity.TableSetActivity"/>
     </application>
 </manifest>

+ 13 - 2
app_modular/appme/src/main/java/com/uas/appme/settings/activity/BSettingActivity.java

@@ -31,6 +31,7 @@ public class BSettingActivity extends BaseActivity implements View.OnClickListen
     private String sc_industry = null;
     private String sc_industrycode = null;
     private RelativeLayout rTyperl;
+    private RelativeLayout tableSetRl;
 
     @Override
     protected void onCreate(Bundle savedInstanceState) {
@@ -99,6 +100,10 @@ public class BSettingActivity extends BaseActivity implements View.OnClickListen
         }else if (v.getId() == R.id.room_type_rl){
             startActivity(new Intent(ct,BusinessHoursSetting.class)
                     .putExtra("setType",4));
+        }else if (v.getId() == R.id.table_setting_rl){
+            startActivity(new Intent(ct,TableSetActivity.class)
+                    .putExtra("sc_industry",sc_industry)
+                    .putExtra("sc_industrycode",sc_industrycode));
         }
     }
 
@@ -115,9 +120,15 @@ public class BSettingActivity extends BaseActivity implements View.OnClickListen
         rTyperl = (RelativeLayout) findViewById(R.id.room_type_rl);
         rTyperl.setOnClickListener(this);
 
-        if ("餐饮".equals(sc_industry))
+        tableSetRl = (RelativeLayout) findViewById(R.id.table_setting_rl);
+        tableSetRl.setOnClickListener(this);
+
+        if ("餐饮".equals(sc_industry)) {
             rTyperl.setVisibility(View.GONE);
-        else
+            tableSetRl.setVisibility(View.VISIBLE);
+        }else {
             rTyperl.setVisibility(View.GONE);
+            tableSetRl.setVisibility(View.VISIBLE);
+        }
     }
 }

+ 124 - 0
app_modular/appme/src/main/java/com/uas/appme/settings/activity/TableSetActivity.java

@@ -0,0 +1,124 @@
+package com.uas.appme.settings.activity;
+
+import android.content.Context;
+import android.os.Bundle;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.BaseAdapter;
+import android.widget.Button;
+import android.widget.RelativeLayout;
+
+import com.common.data.ListUtils;
+import com.common.data.StringUtil;
+import com.core.app.MyApplication;
+import com.core.base.BaseActivity;
+import com.core.utils.CommonUtil;
+import com.core.widget.MyListView;
+import com.uas.appme.R;
+import com.uas.appme.settings.model.TableMode;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Created by FANGlh on 2017/11/22.
+ * function:
+ */
+
+public class TableSetActivity extends BaseActivity {
+    private MyListView mComList;
+    private RelativeLayout mAddNewRl;
+    private Button mSaveBt;
+    private Button mDeleteBtn;
+    private String updateData;
+    private List<TableMode> tableList;
+    private String as_companyid;
+    private TableAdapter myAdapter;
+
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        setContentView(R.layout.table_set_activity);
+        initView();
+        initData();
+    }
+
+    private void initData() {
+        updateData = getIntent().getStringExtra("updateData");
+        if(StringUtil.isEmpty(updateData)){
+            TableMode model = new TableMode();
+            model.setAs_deskcode("");
+            model.setAs_number("");
+            model.setAs_type("");
+            model.setAs_remark("");
+            model.setAs_id("0");
+            model.setAs_companyid(as_companyid);
+            tableList.add(model);
+            myAdapter.notifyDataSetChanged();
+        }else{
+
+        }
+    }
+
+    private void initView() {
+        getSupportActionBar().setTitle("桌位设置");
+
+        mComList = (MyListView) findViewById(R.id.com_list);
+        mAddNewRl = (RelativeLayout) findViewById(R.id.add_new_rl);
+        mSaveBt = (Button) findViewById(R.id.save_bt);
+        mDeleteBtn = (Button) findViewById(R.id.delete_btn);
+
+        myAdapter = new TableAdapter(this);
+        tableList = new ArrayList<>();
+        myAdapter.setModeList(tableList);
+        mComList.setAdapter(myAdapter);
+        as_companyid =  CommonUtil.getSharedPreferences(MyApplication.getInstance(),"erp_uu");
+    }
+
+
+    private class TableAdapter extends BaseAdapter{
+       private List<TableMode> modeList;
+       private Context mContext;
+
+        public List<TableMode> getModeList() {return modeList;}
+        public void setModeList(List<TableMode> modeList) {this.modeList = modeList;}
+
+        public TableAdapter(Context mContext){
+            this.mContext = mContext;
+        }
+        @Override
+        public int getCount() {
+            return ListUtils.isEmpty(modeList) ? 0 : modeList.size();
+        }
+        @Override
+        public Object getItem(int position) {
+            return modeList.get(position);
+        }
+
+        @Override
+        public long getItemId(int position) {
+            return position;
+        }
+        @Override
+        public View getView(int position, View convertView, ViewGroup parent) {
+            TableView tableView = null;
+            if (convertView == null){
+                tableView = new TableView();
+                convertView =  View.inflate(mContext, R.layout.com_location_input_item,null);
+                convertView.setTag(tableView);
+
+            }else {
+                tableView = (TableView) convertView.getTag();
+            }
+
+
+
+
+            return convertView;
+        }
+        class TableView{
+
+        }
+    }
+}

+ 63 - 0
app_modular/appme/src/main/java/com/uas/appme/settings/model/TableMode.java

@@ -0,0 +1,63 @@
+package com.uas.appme.settings.model;
+
+/**
+ * Created by FANGlh on 2017/11/22.
+ * function:
+ */
+
+public class TableMode {
+    private String as_id;
+    private String as_type;
+    private String as_deskcode;
+    private String as_number;
+    private String as_remark;
+    private String as_companyid;
+
+    public String getAs_id() {
+        return as_id;
+    }
+
+    public void setAs_id(String as_id) {
+        this.as_id = as_id;
+    }
+
+    public String getAs_companyid() {
+        return as_companyid;
+    }
+
+    public void setAs_companyid(String as_companyid) {
+        this.as_companyid = as_companyid;
+    }
+
+    public String getAs_type() {
+        return as_type;
+    }
+
+    public void setAs_type(String as_type) {
+        this.as_type = as_type;
+    }
+
+    public String getAs_deskcode() {
+        return as_deskcode;
+    }
+
+    public void setAs_deskcode(String as_deskcode) {
+        this.as_deskcode = as_deskcode;
+    }
+
+    public String getAs_number() {
+        return as_number;
+    }
+
+    public void setAs_number(String as_number) {
+        this.as_number = as_number;
+    }
+
+    public String getAs_remark() {
+        return as_remark;
+    }
+
+    public void setAs_remark(String as_remark) {
+        this.as_remark = as_remark;
+    }
+}

+ 131 - 0
app_modular/appme/src/main/res/layout/table_item.xml

@@ -0,0 +1,131 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    xmlns:whatever="http://schemas.android.com/tools"
+    android:orientation="vertical">
+
+    <RelativeLayout
+        style="@style/IMTbleLine2"
+        android:layout_height="50dp"
+        android:background="@color/white"
+        >
+        <TextView
+            style="@style/form_relative_left_text"
+            android:text="桌位类型"
+            android:layout_marginLeft="0dp"
+            android:textColor="@color/text_main"
+            android:textSize="15sp" />
+
+        <com.andreabaccega.widget.FormEditText xmlns:editTextFormExample="http://schemas.android.com/apk/res-auto"
+            android:id="@+id/type_et"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:textColor="@color/dark_dark_grey"
+            android:padding="10dp"
+            android:hint="请选择(必选)"
+            android:layout_alignParentRight="true"
+            android:gravity="center_vertical|right"
+            android:background="@null"
+            android:textSize="15sp"
+            />
+    </RelativeLayout>
+    <View
+        android:layout_width="match_parent"
+        android:layout_height="2px"
+        android:background="@color/item_line" />
+    <RelativeLayout
+        style="@style/IMTbleLine2"
+        android:layout_height="50dp"
+        android:background="@color/white">
+
+        <TextView
+            style="@style/form_relative_left_text"
+            android:text="桌位代码"
+            android:layout_marginLeft="0dp"
+            android:textColor="@color/text_main"
+            android:textSize="15sp" />
+
+        <com.andreabaccega.widget.FormEditText
+            android:id="@+id/deskcode_et"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:textColor="@color/dark_dark_grey"
+            android:padding="10dp"
+            android:layout_alignParentRight="true"
+            android:layout_centerVertical="true"
+            android:background="@null"
+            android:hint="@string/common_input"
+            android:textSize="15sp"
+            android:gravity="center_vertical|right"
+            whatever:testType="regexp"
+            whatever:customRegexp="^[A-Za-z\u4e00-\u9fa5]{0,8}+$"
+            whatever:testErrorString="姓名只能为8个字符之内的中、英文"
+            />
+    </RelativeLayout>
+    <View
+        android:layout_width="match_parent"
+        android:layout_height="2px"
+        android:background="@color/item_line" />
+    <RelativeLayout
+        style="@style/IMTbleLine2"
+        android:layout_height="50dp"
+        android:background="@color/white">
+        <TextView
+            android:id="@+id/tel_tv"
+            style="@style/form_relative_left_text"
+            android:text="数量"
+            android:layout_marginLeft="0dp"
+            android:textColor="@color/text_main"
+            android:textSize="15sp"/>
+
+        <com.andreabaccega.widget.FormEditText
+            android:id="@+id/number_et"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:textColor="@color/dark_dark_grey"
+            android:padding="10dp"
+            android:background="@null"
+            android:hint="@string/common_input"
+            android:textSize="15sp"
+            android:inputType="number"
+            android:gravity="center_vertical|right"
+            android:maxLength="4"
+            android:layout_alignParentTop="true"
+            android:layout_alignParentRight="true"
+            android:layout_alignParentEnd="true" />
+    </RelativeLayout>
+    <View
+        android:layout_width="match_parent"
+        android:layout_height="2px"
+        android:background="@color/item_line" />
+    <RelativeLayout
+        style="@style/IMTbleLine2"
+        android:minHeight="50dp"
+        android:background="@color/white">
+
+        <TextView
+            style="@style/form_relative_left_text"
+            android:text="备注"
+            android:layout_marginLeft="0dp"
+            android:textColor="@color/text_main"
+            android:textSize="15sp" />
+
+        <com.andreabaccega.widget.FormEditText
+            android:id="@+id/remark_et"
+            android:layout_width="200dp"
+            android:layout_height="wrap_content"
+            android:textColor="@color/dark_dark_grey"
+            android:padding="10dp"
+            android:layout_alignParentRight="true"
+            android:layout_centerVertical="true"
+            android:background="@null"
+            android:hint="@string/common_input2"
+            android:textSize="15sp"
+            android:gravity="center_vertical|right"
+            whatever:testType="regexp"
+            whatever:customRegexp="^[A-Za-z\u4e00-\u9fa5]{0,8}+$"
+            whatever:testErrorString="姓名只能为8个字符之内的中、英文"
+            />
+    </RelativeLayout>
+</LinearLayout>

+ 83 - 0
app_modular/appme/src/main/res/layout/table_set_activity.xml

@@ -0,0 +1,83 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:orientation="vertical"
+    android:background="@color/base_bg">
+    <ScrollView
+        android:layout_width="match_parent"
+        android:layout_height="match_parent">
+
+        <LinearLayout
+            android:layout_width="match_parent"
+            android:layout_height="match_parent"
+            android:orientation="vertical">
+            <com.core.widget.MyListView
+                android:id="@+id/com_list"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:scrollbars="none"
+                android:paddingBottom="20dp">
+            </com.core.widget.MyListView>
+
+
+            <RelativeLayout
+                android:id="@+id/add_new_rl"
+                android:layout_width="match_parent"
+                style="@style/IMTbleLine2"
+                android:layout_height="40dp"
+                android:layout_marginLeft="25dp"
+                android:layout_marginRight="25dp"
+                >
+                <TextView
+                    android:layout_width="wrap_content"
+                    android:text="+新增"
+                    android:textColor="#2F95DD"
+                    android:layout_height="wrap_content"
+                    android:layout_centerInParent="true"
+                    />
+
+            </RelativeLayout>
+            <LinearLayout
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:orientation="horizontal">
+
+                <Button
+                    android:id="@+id/save_bt"
+                    android:layout_width="0dp"
+                    android:layout_weight="1"
+                    android:layout_height="wrap_content"
+                    android:layout_alignParentBottom="true"
+                    android:layout_marginBottom="30dp"
+                    android:layout_marginLeft="20dp"
+                    android:layout_marginRight="20dp"
+                    android:layout_marginTop="50dp"
+                    android:background="@drawable/bg_bule_btn"
+                    android:padding="10dp"
+                    android:text="@string/save"
+                    android:textColor="@color/white"
+                    android:textSize="@dimen/text_main"
+                    />
+                <Button
+                    android:id="@+id/delete_btn"
+                    android:layout_width="0dp"
+                    android:layout_weight="1"
+                    android:layout_height="wrap_content"
+                    android:layout_alignParentBottom="true"
+                    android:layout_marginBottom="30dp"
+                    android:layout_marginLeft="20dp"
+                    android:layout_marginRight="20dp"
+                    android:layout_marginTop="50dp"
+                    android:background="@drawable/bg_bule_btn"
+                    android:padding="10dp"
+                    android:text="@string/delete"
+                    android:textColor="@color/white"
+                    android:textSize="@dimen/text_main"
+                    android:visibility="gone"/>
+
+            </LinearLayout>
+        </LinearLayout>
+        </ScrollView>
+
+</LinearLayout>