Browse Source

333

一拖四味魔方
fyf 10 months ago
parent
commit
c76ef7cefa
3 changed files with 745 additions and 390 deletions
  1. +348
    -141
      app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/GoodInformation.java
  2. +396
    -248
      app/src/main/res/layout/item/layout/dialog_gooddetails.xml
  3. +1
    -1
      app/src/main/res/layout/item/layout/spinner_text_item.xml

+ 348
- 141
app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/GoodInformation.java View File

@@ -16,8 +16,10 @@ import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.Spinner;
import android.widget.TextView;

import androidx.annotation.Nullable;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import com.bonait.bnframework.R;
@@ -25,6 +27,7 @@ import com.bonait.bnframework.common.constant.DataBus;
import com.bonait.bnframework.common.constant.MessageName;
import com.bonait.bnframework.common.db.QueryDB;
import com.bonait.bnframework.common.db.mode.BPA_GOODS;
import com.bonait.bnframework.common.db.mode.BPA_GOODSRECIPE;
import com.bonait.bnframework.common.db.mode.BPA_GOODSRECIPENAME;
import com.bonait.bnframework.common.db.mode.BPA_GOODSTYPE;
import com.bonait.bnframework.common.db.mode.BPA_MATERIAL;
@@ -40,6 +43,7 @@ import com.bonait.bnframework.common.view.MyLayoutManager;
import com.bonait.bnframework.modules.home.adapter.goodpf_apapter;
import com.bonait.bnframework.modules.home.adapter.newmeatrilselect_adapter;
import com.bonait.bnframework.modules.home.adapter.newneatril_adapter;
import com.bonait.bnframework.modules.home.adapter.pfsx_adapter;
import com.bonait.bnframework.modules.home.adapter.xxpf_adapter;
import com.bonait.bnframework.modules.home.fragment.from.ImageChooseActivity;

@@ -53,7 +57,7 @@ import butterknife.ButterKnife;
/**
* 商品信息展示
*/
public class GoodInformation extends LinearLayout implements MyClickListener{
public class GoodInformation extends LinearLayout implements MyClickListener {

//region 界面变量
/**
@@ -69,26 +73,45 @@ public class GoodInformation extends LinearLayout implements MyClickListener{
*/
ArrayList<ResGoodProperty> bpa_goodproperties = new ArrayList<>();
/**
* 确定文本和取消文本的显示内容
* 当前配方表
*/
private String yesStr;
ArrayList<BPA_GOODSRECIPENAME> goodsrecipenames = new ArrayList<>();
/**
* 选中配方名称
*/
public BPA_GOODSRECIPENAME bpaGoodsrecipename = null;

/**
* 取消按钮
*/
public Button close_from, xinjian;
@BindView(R.id.close_from)
public Button close_from;
@BindView(R.id.xinjian)
public Button xinjian;
@BindView(R.id.xinjiannew)
public Button xinjiannew;

/**
* 图片
*/
@BindView(R.id.cpfm)
public ImageView cpfm;
/**
* 文本输入框
*/

public EditText edittext, edittext1,edittext_wl;
@BindView(R.id.edittext)
public EditText edittext;
@BindView(R.id.edittext1)
public EditText edittext1;
@BindView(R.id.edittext_wl)
public EditText edittext_wl;
/**
* 商品分类
*/
@BindView(R.id.editsp_fl)
public Spinner editsp_fl;
@BindView(R.id.datatab_pf)
ListView datatab_pf;

/**
* 点击事件
@@ -96,22 +119,22 @@ public class GoodInformation extends LinearLayout implements MyClickListener{
public MyClickListener mListener = null;
private View root;


@BindView(R.id.datatab_pf)
ListView datatab_pf;


@BindView(R.id.recycler_view_wl_click)
RecyclerView recycler_view_wl_click;

public BPA_GOODSRECIPENAME bpaGoodsrecipename=null;

@BindView(R.id.edittext_pfmingc)
EditText edittext_pfmingc;//配方名称
@BindView(R.id.datatab_sx)
RecyclerView datatab_sx;
@BindView(R.id.datatab_xxpf)
ListView datatab_xxpf;
ListView datatab_xxpf;//详细配方

@BindView(R.id.save_goods)
Button save_goods;

@BindView(R.id.caozuomiaoshu)
TextView caozuomiaoshu;

//endregion

@@ -137,11 +160,9 @@ public class GoodInformation extends LinearLayout implements MyClickListener{
ToastUtils.info("名称不能为空!");
return false;
}
boolean issc = false;
GetWuLiaoSelect(resMaterilas);

//resMaterilas
if (issc == false) {
if (ids.isEmpty()) {
ToastUtils.info("必须选择一个物料!");
return false;
}
@@ -151,6 +172,46 @@ public class GoodInformation extends LinearLayout implements MyClickListener{
return IsSucees;
}
}

String pfname = "";//配方名称集合
String ggids = "";//规格id集合

/**
* 配方数据验证
*
* @return
*/
public boolean DataVerificationPF() {
boolean isSuceess = false;
//1.数据名称不能为空
pfname = edittext_pfmingc.getText().toString();
if (pfname.isEmpty()) {
ToastUtils.warning("配方名称不能为空!");
return isSuceess;
}

ggids = "";
for (ResGoodProperty item : bpa_goodproperties) {
for (ResGoodProperty k : item.child) {
if (k.isSelect) {
ggids += k.id + ",";
}
}
}

if (!ggids.isEmpty()) {
ggids = ggids.substring(0, ggids.length() - 1);
}

//2.必须选择一个规格
if (DataBus.getInstance().Recipe.size() <= 0) {
ToastUtils.warning("配方数据表格不能为空!");
return isSuceess;
}


return true;
}
//endregion

//region 初始化设置数据
@@ -161,7 +222,7 @@ public class GoodInformation extends LinearLayout implements MyClickListener{
/**
* 上一层界面
*/
Activity activity_ma=null;
Activity activity_ma = null;
/**
* 图片URL
*/
@@ -171,58 +232,102 @@ public class GoodInformation extends LinearLayout implements MyClickListener{
*/
Map<String, String> map_fl = new LinkedHashMap<>();

/**
* 当前属性
*/
public ArrayList<ResGoodProperty> properties = new ArrayList<>();

/**
* 从外界Activity为Dialog 设置数据
*
* @param data
*/
public void setData(String str, BPA_GOODS data, ArrayList<BPA_GOODSTYPE> types, Activity activity,ArrayList<ResGoodProperty> properties) {
if (str != null) {
yesStr = str;
}
public void setData(BPA_GOODS data, ArrayList<BPA_GOODSTYPE> types, Activity activity, ArrayList<ResGoodProperty> _properties) {
bpaGoodsrecipename = null;
caozuomiaoshu.setText("");
Data = data;
Types = types;
activity_ma = activity;
properties = _properties;

for (ResGoodProperty pro:properties)
{
if(pro.GoodsTypeId!=null && !pro.GoodsTypeId.isEmpty())
{
if(pro.GoodsTypeId.contains(Data.goodtype))
{
bpa_goodproperties.add(pro);
}
}else
{
bpa_goodproperties.add(pro);
}
}

//初始化界面控件
initView();
//属性数据填充
SxProperty();
//初始化界面数据
initData();
//初始化界面控件的事件
initEvent();
//初始化配方
//初始化配方名称
Initdata_pf();
//初始化配方表格
InitTab();
}
//endregion

//region 初始化函数
//region 属性数据

/**
* 初始化界面控件
* 刷新属性
*
* @param
*/
private void initView() {
close_from = (Button) findViewById(R.id.close_from);
xinjian = (Button) findViewById(R.id.xinjian);
cpfm = findViewById(R.id.cpfm);

edittext = findViewById(R.id.edittext);
edittext1 = findViewById(R.id.edittext1);
editsp_fl = findViewById(R.id.editsp_fl);
edittext_wl = findViewById(R.id.edittext_wl);
public void SxProperty() {
bpa_goodproperties.clear();
for (ResGoodProperty pro : properties) {
if (pro.GoodsTypeId != null && !pro.GoodsTypeId.isEmpty()) {
if (Data != null) {
if (pro.GoodsTypeId.contains(Data.goodtype)) {
bpa_goodproperties.add(pro);
}
} else {
bpa_goodproperties.add(pro);
}
} else {
bpa_goodproperties.add(pro);
}
}

//2.填充规则数据,查询所有属性大类
if (bpaGoodsrecipename == null) {
for (ResGoodProperty item : bpa_goodproperties) {
int i = 0;
for (ResGoodProperty c : item.child) {
if (i == 0) {
c.isSelect = true;
} else {
c.isSelect = false;
}
i++;
}
}
edittext_pfmingc.setText(GetSelectName());
} else {
edittext_pfmingc.setText(bpaGoodsrecipename.name + "");
for (ResGoodProperty item : bpa_goodproperties) {
for (ResGoodProperty c : item.child) {
if (bpaGoodsrecipename != null && bpaGoodsrecipename.design != null && !bpaGoodsrecipename.design.isEmpty() && bpaGoodsrecipename.design.contains(c.id)) {
c.isSelect = true;
} else {
c.isSelect = false;
}
}
}
}

LinearLayoutManager layoutManager = new LinearLayoutManager(getContext());
layoutManager.setOrientation(LinearLayoutManager.VERTICAL);
datatab_sx.setLayoutManager(layoutManager);

pfsx_adapter sxadapter = new pfsx_adapter(getContext(), bpa_goodproperties);
datatab_sx.setAdapter(sxadapter);
}
//endregion

//region 配方选中

//endregion

//region 初始化函数

/**
* 初始化界面控件的显示数据
@@ -234,10 +339,6 @@ public class GoodInformation extends LinearLayout implements MyClickListener{
map_fl.put(item.name, item.id);
}
SetAdapter(editsp_fl, map_fl);
//如果设置按钮的文字
if (yesStr != null) {
xinjian.setText(yesStr);
}

//数据不为空 那么就是修改
if (Data != null) {
@@ -263,8 +364,6 @@ public class GoodInformation extends LinearLayout implements MyClickListener{

//查询物料数据
ArrayList<BPA_MATERIAL> materials = QueryDB.GetMaterialALL();


if (materials != null && materials.size() > 0) {
resMaterilas.clear();
for (BPA_MATERIAL item : materials) {
@@ -282,27 +381,26 @@ public class GoodInformation extends LinearLayout implements MyClickListener{
}
GetWuLiaoSelect(resMaterilas);

//底部物料,
MyLayoutManager layout = new MyLayoutManager();
layout.setAutoMeasureEnabled(true);
recycler_view_wl_click.setLayoutManager(layout);
newneatril_adapter adapter = new newneatril_adapter(getContext(), QueryDB.GetMaterialALL(), new MyClickListener() {
@Override
public void clickListener(View v, Object data) {
BPA_MATERIAL m=(BPA_MATERIAL)data;

ResGoodsRecipe cipe=new ResGoodsRecipe();
cipe.sort=0;
cipe.materialID=m.id;
cipe.materialName=m.name;
cipe.value="0";
if (DataBus.getInstance().Recipe==null)
{
DataBus.getInstance().Recipe=new ArrayList<>();
BPA_MATERIAL m = (BPA_MATERIAL) data;

ResGoodsRecipe cipe = new ResGoodsRecipe();
cipe.sort = 0;
cipe.materialID = m.id;
cipe.materialName = m.name;
cipe.value = "0";
if (DataBus.getInstance().Recipe == null) {
DataBus.getInstance().Recipe = new ArrayList<>();
}
DataBus.getInstance().Recipe.add(cipe);

if(adapter4!=null)
{
if (adapter4 != null) {
adapter4.notifyDataSetChanged();
}
}
@@ -313,49 +411,41 @@ public class GoodInformation extends LinearLayout implements MyClickListener{
}
});
recycler_view_wl_click.setAdapter(adapter);


// MyLayoutManager layout = new MyLayoutManager();
// layout.setAutoMeasureEnabled(true);
// recycler_view_wl.setLayoutManager(layout);
// newmeatrilselect_adapter adapter = new newmeatrilselect_adapter(getContext(), resMaterilas);
// recycler_view_wl.setAdapter(adapter);
}

xxpf_adapter adapter4=null;
public void InitTab()
{
xxpf_adapter adapter4 = null;

/**
* 物料信息类别
*/
public void InitTab() {
DataBus.getInstance().Recipe.clear();
if(bpaGoodsrecipename!=null)
{
if (bpaGoodsrecipename != null) {
DataBus.getInstance().Recipe = QueryDB.GetGoodsSreciperecipeList(bpaGoodsrecipename.id);

}else
{
for(BPA_MATERIAL wl:resMaterilas)
{
if(Data.materialids!=null && !Data.materialids.isEmpty() && Data.materialids.contains(wl.id))
{
ResGoodsRecipe cipe=new ResGoodsRecipe();
cipe.sort=0;
cipe.materialID=wl.id;
cipe.materialName=wl.name;
cipe.value="0";
cipe.goodsID=Data.id;
DataBus.getInstance().Recipe.add(cipe);
} else {
if (Data != null) {
for (BPA_MATERIAL wl : resMaterilas) {
if (Data.materialids != null && !Data.materialids.isEmpty() && Data.materialids.contains(wl.id)) {
ResGoodsRecipe cipe = new ResGoodsRecipe();
cipe.sort = 0;
cipe.materialID = wl.id;
cipe.materialName = wl.name;
cipe.value = "0";
cipe.goodsID = Data.id;
DataBus.getInstance().Recipe.add(cipe);
}
}
}
}

if( DataBus.getInstance().Recipe==null)
{
DataBus.getInstance().Recipe=new ArrayList<>();
if (DataBus.getInstance().Recipe == null) {
DataBus.getInstance().Recipe = new ArrayList<>();
}
adapter4= new xxpf_adapter(getContext(), R.layout.xxpf_item, DataBus.getInstance().Recipe,this);
datatab_pf.setAdapter(adapter4);
adapter4 = new xxpf_adapter(getContext(), R.layout.xxpf_item, DataBus.getInstance().Recipe, this);
datatab_xxpf.setAdapter(adapter4);
}


/**
* 初始化界面的确定和取消监听器
*/
@@ -366,6 +456,131 @@ public class GoodInformation extends LinearLayout implements MyClickListener{
xinjian.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (Data == null) {
ToastUtils.warning("请先新建商品!");
return;
}

if (DataVerificationPF()) {
if (bpaGoodsrecipename == null)//新增
{
//判断配方是否有相同规格的了
if (bpaGoodsrecipename == null)//新增
{
BPA_GOODSRECIPENAME goodsrecipename = QueryDB.GetGoodsRecipeNameDesignId(ggids, Data.id);
if (goodsrecipename != null) {
ToastUtils.warning("已有改做法配方,不能在新增了!");
return;
}
}
//新增配方名称
BPA_GOODSRECIPENAME n = new BPA_GOODSRECIPENAME();
n.name = pfname;
n.design = ggids;
n.goodsID = Data.id;
QueryDB.AddGoodsRecipeName(n);
//新增配方信息
for (ResGoodsRecipe i : DataBus.getInstance().Recipe) {
BPA_GOODSRECIPE good = new BPA_GOODSRECIPE();
good.materialID = i.materialID;
good.recipeID = n.id;
good.goodsID = Data.id;
good.value = i.value;
good.sort = i.sort;


QueryDB.AddGoodsSrecipe(good);
}
Initdata_pf();
ToastUtils.info("新增配方成功!");
} else //修改
{
bpaGoodsrecipename.name = pfname;
bpaGoodsrecipename.design = ggids;
bpaGoodsrecipename.goodsID = Data.id;
QueryDB.UpdateGoodsRecipeName(bpaGoodsrecipename);

ArrayList<ResGoodsRecipe> re = QueryDB.GetGoodsSreciperecipeList(bpaGoodsrecipename.id);
for (ResGoodsRecipe item : re) {
QueryDB.DeleteGoodsSrecipe(item.id);
}

for (ResGoodsRecipe i : DataBus.getInstance().Recipe) {
BPA_GOODSRECIPE good = new BPA_GOODSRECIPE();
good.materialID = i.materialID;
good.recipeID = bpaGoodsrecipename.id;
good.goodsID = Data.id;
good.value = i.value;
good.sort = i.sort;

QueryDB.AddGoodsSrecipe(good);
}
Initdata_pf();
ToastUtils.info("修改配方成功!");
}
}


}
});
/**
* 保存新配方
*/
xinjiannew.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (Data == null) {
ToastUtils.warning("请先新建商品!");
return;
}

if (DataVerificationPF()) {
//判断配方是否有相同规格的了
BPA_GOODSRECIPENAME goodsrecipename = QueryDB.GetGoodsRecipeNameDesignId(ggids, Data.id);
if (goodsrecipename != null) {
ToastUtils.warning("已有改做法配方,不能在新增了!");
return;
}
//新增配方名称
BPA_GOODSRECIPENAME n = new BPA_GOODSRECIPENAME();
n.name = pfname;
n.design = ggids;
n.goodsID = Data.id;
QueryDB.AddGoodsRecipeName(n);
//新增配方信息
for (ResGoodsRecipe i : DataBus.getInstance().Recipe) {
BPA_GOODSRECIPE good = new BPA_GOODSRECIPE();
good.materialID = i.materialID;
good.recipeID = n.id;
good.goodsID = Data.id;
good.value = i.value;
good.sort = i.sort;
QueryDB.AddGoodsSrecipe(good);
}

Initdata_pf();
ToastUtils.info("新增配方成功!");

}
}
});
/**
* 关闭窗体
*/
close_from.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (mListener != null) {
mListener.clickListenerNew(v, 0, null);
}
}
});
/**
* 保存商品
*/
save_goods.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View view) {
if (DataVerification()) {

ArrayList<BPA_GOODS> goods = QueryDB.GetGoodsALL();
@@ -387,9 +602,6 @@ public class GoodInformation extends LinearLayout implements MyClickListener{
Data.goodtype = map_fl.get(editsp_fl.getSelectedItem().toString());
Data.materialids = ids;
QueryDB.AddGoods(Data);
if (mListener != null) {
mListener.clickListenerNew(v, 1, Data);
}
} else //修改
{
Data.name = edittext.getText().toString();
@@ -402,25 +614,17 @@ public class GoodInformation extends LinearLayout implements MyClickListener{
Data.goodtype = map_fl.get(editsp_fl.getSelectedItem().toString());
Data.materialids = ids;
QueryDB.UpdateGoods(Data);
if (mListener != null) {
mListener.clickListenerNew(v, 1, Data);
}
}

}
}
});
/**
* 关闭窗体
*/
close_from.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (mListener != null) {
mListener.clickListenerNew(v, 0, null);
bpaGoodsrecipename = null;
caozuomiaoshu.setText("");
SxProperty();
Initdata_pf();
InitTab();
ToastUtils.info("保存商品成功!");
}
}
});

/**
* 选择图片资源
*/
@@ -477,12 +681,15 @@ public class GoodInformation extends LinearLayout implements MyClickListener{
/**
* 初始化配方
*/
public void Initdata_pf()
{
if(Data!=null)
{
public void Initdata_pf() {
if (Data != null) {
//根据商品查询配方
ArrayList<BPA_GOODSRECIPENAME> goodsrecipenames=QueryDB.GetGoodsRecipeNameGoodId(Data.id);
goodsrecipenames = QueryDB.GetGoodsRecipeNameGoodId(Data.id);
goodpf_apapter adapter = new goodpf_apapter(getContext(), R.layout.wl_item, goodsrecipenames, this);
datatab_pf.setAdapter(adapter);
}else
{
goodsrecipenames.clear();
goodpf_apapter adapter = new goodpf_apapter(getContext(), R.layout.wl_item, goodsrecipenames, this);
datatab_pf.setAdapter(adapter);
}
@@ -490,8 +697,10 @@ public class GoodInformation extends LinearLayout implements MyClickListener{
//endregion

//region 界面事件

/**
* 设置下拉框
*
* @param spinner
* @param map
*/
@@ -510,7 +719,7 @@ public class GoodInformation extends LinearLayout implements MyClickListener{
DialogInterface.OnMultiChoiceClickListener multiChoiceClickListener = new DialogInterface.OnMultiChoiceClickListener() {
@Override
public void onClick(DialogInterface dialog, int i, boolean isChecked) {
resMaterilas.get(i).isSelect= isChecked;
resMaterilas.get(i).isSelect = isChecked;
}
};

@@ -540,16 +749,15 @@ public class GoodInformation extends LinearLayout implements MyClickListener{
}

public String ids = "";
public String names="";
public String names = "";

/**
* 获取物料选择
*/
public void GetWuLiaoSelect(ArrayList<ResMaterilas> materilas)
{
ids = "";names="";
for (ResMaterilas item:materilas)
{
public void GetWuLiaoSelect(ArrayList<ResMaterilas> materilas) {
ids = "";
names = "";
for (ResMaterilas item : materilas) {
if (item.isSelect) {
if (TextUtils.isEmpty(names)) {
names = names + item.name;
@@ -565,18 +773,15 @@ public class GoodInformation extends LinearLayout implements MyClickListener{

/**
* 获取选中名称
*
* @return
*/
public String GetSelectName()
{
String names=Data.name+"_";
for(ResGoodProperty item:bpa_goodproperties)
{
for(ResGoodProperty k:item.child)
{
if(k.isSelect)
{
names+=k.name+"_";
public String GetSelectName() {
String names = (Data != null ? Data.name : "未知") + "_";
for (ResGoodProperty item : bpa_goodproperties) {
for (ResGoodProperty k : item.child) {
if (k.isSelect) {
names += k.name + "_";
}
}
}
@@ -593,12 +798,14 @@ public class GoodInformation extends LinearLayout implements MyClickListener{
public void clickListener(View v, Object data) {
switch (v.getId()) {
case R.id.button_update://点击 修改
bpaGoodsrecipename =(BPA_GOODSRECIPENAME)data;
bpaGoodsrecipename = (BPA_GOODSRECIPENAME) data;
caozuomiaoshu.setText("当前【" + bpaGoodsrecipename.name + "】操作中...");
SxProperty();//刷新属性
InitTab();
break;
case R.id.button_item://删除按钮
ArrayList<ResGoodsRecipe> re= QueryDB.GetGoodsSreciperecipeList(((BPA_GOODSRECIPENAME) data).id);
for(ResGoodsRecipe item:re)
{
ArrayList<ResGoodsRecipe> re = QueryDB.GetGoodsSreciperecipeList(((BPA_GOODSRECIPENAME) data).id);
for (ResGoodsRecipe item : re) {
QueryDB.DeleteGoodsSrecipe(item);
}
QueryDB.DeleteGoodsRecipeName((BPA_GOODSRECIPENAME) data);


+ 396
- 248
app/src/main/res/layout/item/layout/dialog_gooddetails.xml View File

@@ -1,17 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
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="match_parent"
android:background="@color/dialogbj">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="50dp"
android:layout_marginLeft="10dp"
android:layout_marginTop="10dp"
android:layout_marginRight="50dp"
android:layout_marginRight="10dp"
android:layout_marginBottom="10dp"
android:background="@drawable/common_bg_with_radius_and_border">

<Button
android:id="@+id/close_from"
android:layout_width="32dp"
@@ -23,205 +23,133 @@
android:background="@mipmap/close_image"
android:textColor="@color/white"
android:textSize="14dp" />

<TextView
android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="商品信息详情"
android:textSize="20dp"
android:layout_centerHorizontal="true"
android:layout_marginTop="@dimen/dp_10"
android:layout_centerHorizontal="true">
</TextView>
android:text="商品信息详情"
android:textSize="20dp"></TextView>

<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="46dp"
android:layout_marginLeft="30dp"
android:layout_marginRight="30dp"
android:layout_marginBottom="55dp">
<LinearLayout
<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="30dp"
android:layout_marginRight="30dp"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:text="商品信息"
android:textSize="20dp" />
<!--菜谱名称行-->
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_10"
android:layout_marginBottom="@dimen/dp_10">
<LinearLayout
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="match_parent"
android:orientation="vertical">

<RelativeLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:background="@color/color1">
<ImageView
android:id="@+id/cpfm"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginStart="3dp"
android:layout_marginTop="3dp"
android:layout_marginEnd="3dp"
android:layout_marginBottom="3dp"
android:src="@mipmap/loading3" />
</RelativeLayout>
android:orientation="vertical">

<Button
android:layout_marginTop="@dimen/dp_10"
android:id="@+id/control_huishou"
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_centerHorizontal="true"
android:background="@drawable/silosbuttonbj"
android:text="保存"
android:textColor="@color/white"
android:textSize="18sp"/>
</LinearLayout>
<!--边框分割细线-->
<LinearLayout
android:layout_alignParentBottom="true"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginBottom="@dimen/dp_10"
android:background="@color/color3" />

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:text="商品信息"
android:textSize="20dp" />
<!--菜谱名称行-->
<LinearLayout
android:layout_width="0dp"
android:layout_weight="1.8"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="30dp"
android:orientation="vertical">
android:layout_marginTop="@dimen/dp_10"
android:layout_marginBottom="@dimen/dp_10">

<LinearLayout
android:layout_width="300dp"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_10"
android:layout_marginBottom="12dp">

<com.qmuiteam.qmui.widget.textview.QMUILinkTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="商品名称:"
android:textSize="18dp"/>
<!--账号输入框-->
<EditText
android:id="@+id/edittext"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:background="@drawable/input_bj"
android:hint="请输入"
android:inputType="text"
android:maxLines="1"
android:padding="3dp"
android:textSize="18dp" />
</LinearLayout>
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="vertical">

<LinearLayout
android:layout_width="300dp"
android:layout_height="wrap_content"
android:layout_marginBottom="12dp">
<com.qmuiteam.qmui.widget.textview.QMUILinkTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="商品外键:"
android:textSize="18dp" />
<!--账号输入框-->
<EditText
android:id="@+id/edittext1"
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:background="@drawable/input_bj"
android:hint="请输入"
android:inputType="text"
android:maxLines="1"
android:padding="3dp"
android:textSize="18dp" />
</LinearLayout>
android:layout_height="0dp"
android:layout_weight="1"
android:background="@color/color1">

<LinearLayout
android:layout_width="300dp"
android:layout_height="30dp"
android:layout_marginBottom="12dp">
<ImageView
android:id="@+id/cpfm"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginStart="3dp"
android:layout_marginTop="3dp"
android:layout_marginEnd="3dp"
android:layout_marginBottom="3dp"
android:src="@mipmap/loading3" />
</RelativeLayout>

<com.qmuiteam.qmui.widget.textview.QMUILinkTextView
android:layout_width="wrap_content"
android:layout_height="30dp"
android:text="商品分类:"
android:textSize="18dp"/>
<!--账号输入框-->
<Spinner
android:id="@+id/editsp_fl"
style="@style/commonSpinnerStyle"
<Button
android:id="@+id/save_goods"
android:layout_width="match_parent"
android:layout_height="28dp"
android:layout_centerVertical="true"
android:textSize="18dp"/>
android:layout_height="40dp"
android:layout_centerHorizontal="true"
android:layout_marginTop="@dimen/dp_10"
android:background="@drawable/silosbuttonbj"
android:text="保存"
android:textColor="@color/white"
android:textSize="18sp"
/>
</LinearLayout>

<LinearLayout
android:layout_width="300dp"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginBottom="12dp">
<com.qmuiteam.qmui.widget.textview.QMUILinkTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="商品物料:"
android:textSize="18dp" />
<!--账号输入框-->
<EditText
android:id="@+id/edittext_wl"
android:layout_width="match_parent"
android:layout_marginLeft="30dp"
android:layout_weight="1.8"
android:orientation="vertical">

<LinearLayout
android:layout_width="300dp"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:background="@drawable/input_bj"
android:hint="请输入"
android:inputType="text"
android:maxLines="1"
android:padding="3dp"
android:textSize="18dp" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
android:layout_marginTop="@dimen/dp_10"
android:layout_marginBottom="12dp">

<com.qmuiteam.qmui.widget.textview.QMUILinkTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="商品名称:"
android:textSize="18dp" />
<!--账号输入框-->
<EditText
android:id="@+id/edittext"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:background="@drawable/input_bj"
android:hint="请输入"
android:inputType="text"
android:maxLines="1"
android:padding="3dp"
android:textSize="18dp" />
</LinearLayout>

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:text="配方信息"
android:textSize="20dp" />
<!--物料类型-->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="0dp">
<RelativeLayout
android:layout_weight="1.5"
android:layout_width="0dp"
android:layout_height="wrap_content">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<!-- 商品分类 -->
<LinearLayout
android:layout_marginTop="10dp"
android:layout_marginBottom="12dp"
android:layout_marginRight="10dp"
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_width="300dp"
android:layout_height="wrap_content"
android:layout_marginBottom="12dp">

<com.qmuiteam.qmui.widget.textview.QMUILinkTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="配方名称:"
android:textSize="18dp"/>
android:text="商品外键:"
android:textSize="18dp" />
<!--账号输入框-->
<EditText
android:id="@+id/edittext_pfmingc"
android:id="@+id/edittext1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
@@ -231,114 +159,323 @@
android:maxLines="1"
android:padding="3dp"
android:textSize="18dp" />
</LinearLayout>

<LinearLayout
android:layout_width="300dp"
android:layout_height="30dp"
android:layout_marginBottom="12dp">

<com.qmuiteam.qmui.widget.textview.QMUILinkTextView
android:layout_width="wrap_content"
android:layout_height="30dp"
android:text="商品分类:"
android:textSize="18dp" />
<!--账号输入框-->
<Spinner
android:id="@+id/editsp_fl"
style="@style/commonSpinnerStyle"
android:layout_width="match_parent"
android:layout_height="30dp"
android:layout_centerVertical="true"
android:textSize="18dp" />
</LinearLayout>

<LinearLayout
android:layout_marginTop="50dp"
android:layout_width="match_parent"
android:layout_width="300dp"
android:layout_height="wrap_content"
android:orientation="vertical">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/datatab_sx"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<RelativeLayout
android:layout_marginBottom="12dp">

<com.qmuiteam.qmui.widget.textview.QMUILinkTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="商品物料:"
android:textSize="18dp" />
<!--账号输入框-->
<EditText
android:id="@+id/edittext_wl"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ListView
android:id="@+id/datatab_xxpf"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="3dp"
android:divider="#00000000"
android:dividerHeight="3dp" />
</RelativeLayout>
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:background="@drawable/input_bj"
android:hint="请输入"
android:inputType="text"
android:maxLines="1"
android:padding="3dp"
android:textSize="18dp"
android:focusable="false"/>
</LinearLayout>
</LinearLayout>
</LinearLayout>

<LinearLayout
android:layout_alignParentBottom="true"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginBottom="@dimen/dp_10"
android:background="@color/color3" />

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

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="20dp"
android:text="配方信息"
android:textSize="20dp" />

<TextView
android:id="@+id/caozuomiaoshu"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:text="当前【窗玻璃奶茶】操作中..."
android:textColor="@color/app_color_blue"
android:textSize="20dp" />
</LinearLayout>

<!--物料类型-->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="0dp">
<RelativeLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1.5">

</RelativeLayout>
</RelativeLayout>
<RelativeLayout
android:layout_weight="1"
android:layout_width="0dp"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<!-- 表头 -->
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="26dp"
android:background="@color/app_color_blue">

<TableLayout
android:layout_height="wrap_content">
<!-- 商品分类 -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_gravity="center"
android:gravity="center"
android:stretchColumns="0">
android:layout_marginTop="10dp"
android:layout_marginRight="10dp"
android:layout_marginBottom="12dp">

<TableRow
android:layout_width="fill_parent"
<com.qmuiteam.qmui.widget.textview.QMUILinkTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_horizontal">
android:text="配方名称:"
android:textSize="18dp" />
<!--账号输入框-->
<EditText
android:id="@+id/edittext_pfmingc"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:background="@drawable/input_bj"
android:hint="请输入"
android:inputType="text"
android:maxLines="1"
android:padding="3dp"
android:textSize="18dp" />

</LinearLayout>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="50dp"
android:orientation="vertical">

<androidx.recyclerview.widget.RecyclerView
android:id="@+id/datatab_sx"
android:layout_width="match_parent"
android:layout_height="wrap_content" />

<LinearLayout
android:layout_marginTop="@dimen/dp_10"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<!-- 表头 -->
<RelativeLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1">
android:layout_width="match_parent"
android:layout_height="26dp"
android:background="@color/app_color_blue">

<com.qmuiteam.qmui.widget.textview.QMUILinkTextView
<TableLayout
android:layout_width="match_parent"
android:textAlignment="center"

android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_marginLeft="20dp"
android:text="配方名称"
android:textColor="@color/white" />
</RelativeLayout>
android:layout_centerVertical="true"
android:layout_gravity="center"
android:gravity="center"
android:stretchColumns="0">

<TableRow
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal">

<RelativeLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1">
<RelativeLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1">

<com.qmuiteam.qmui.widget.textview.QMUILinkTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_marginLeft="20dp"
android:text="步骤"
android:textColor="@color/white"/>
</RelativeLayout>

<RelativeLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1">

<com.qmuiteam.qmui.widget.textview.QMUILinkTextView
<com.qmuiteam.qmui.widget.textview.QMUILinkTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_marginLeft="20dp"
android:text="名称"
android:textColor="@color/white"/>
</RelativeLayout>

<RelativeLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1">

<com.qmuiteam.qmui.widget.textview.QMUILinkTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_marginLeft="20dp"
android:text="重量(g)"
android:textColor="@color/white"/>
</RelativeLayout>


<RelativeLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1">

<com.qmuiteam.qmui.widget.textview.QMUILinkTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_marginLeft="20dp"
android:text="操作"
android:textColor="@color/white"/>
</RelativeLayout>
</TableRow>
</TableLayout>
</RelativeLayout>
<!-- 数据 -->
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="match_parent">
<ListView
android:id="@+id/datatab_xxpf"
android:layout_width="match_parent"
android:textAlignment="center" android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_marginLeft="20dp"
android:text="用户操作"
android:textColor="@color/white"/>
android:layout_height="130dp"
android:layout_marginTop="3dp"
android:divider="#00000000"
android:dividerHeight="3dp" />
</RelativeLayout>
</TableRow>
</TableLayout>
</LinearLayout>
</LinearLayout>

</RelativeLayout>
<!-- 数据 -->
<RelativeLayout
</RelativeLayout>

<RelativeLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<ListView
android:id="@+id/datatab_pf"
android:layout_height="match_parent"
android:orientation="vertical">
<!-- 表头 -->
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="3dp"
android:divider="#00000000"
android:dividerHeight="3dp" />
</RelativeLayout>
</LinearLayout>
</RelativeLayout>
</LinearLayout>
android:layout_height="26dp"
android:background="@color/app_color_blue">

<androidx.recyclerview.widget.RecyclerView
android:layout_marginTop="@dimen/dp_10"
android:id="@+id/recycler_view_wl_click"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</LinearLayout>
<TableLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_gravity="center"
android:gravity="center"
android:stretchColumns="0">

<TableRow
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal">

<RelativeLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1">

<com.qmuiteam.qmui.widget.textview.QMUILinkTextView
android:layout_width="match_parent"
android:layout_height="wrap_content"

android:layout_alignParentLeft="true"
android:layout_marginLeft="20dp"
android:text="配方名称"
android:textAlignment="center"
android:textColor="@color/white" />
</RelativeLayout>


<RelativeLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1">

<com.qmuiteam.qmui.widget.textview.QMUILinkTextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_marginLeft="20dp"
android:text="用户操作"
android:textAlignment="center"
android:textColor="@color/white" />
</RelativeLayout>
</TableRow>
</TableLayout>
</RelativeLayout>
<!-- 数据 -->
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">

<ListView
android:id="@+id/datatab_pf"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="3dp"
android:divider="#00000000"
android:dividerHeight="3dp" />
</RelativeLayout>
</LinearLayout>
</RelativeLayout>
</LinearLayout>

<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycler_view_wl_click"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_10" />
</LinearLayout>
</ScrollView>
</RelativeLayout>

<LinearLayout
@@ -346,7 +483,8 @@
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="@dimen/dp_10">
android:layout_marginBottom="@dimen/dp_10"
android:orientation="horizontal">
<Button
android:id="@+id/xinjian"
android:layout_width="200dp"
@@ -355,6 +493,16 @@
android:text="保存配方"
android:textColor="@color/white"
android:textSize="18sp" />

<Button
android:layout_marginLeft="@dimen/dp_10"
android:id="@+id/xinjiannew"
android:layout_width="200dp"
android:layout_height="40dp"
android:background="@drawable/button1"
android:text="生成新配方"
android:textColor="@color/white"
android:textSize="18sp" />
</LinearLayout>
</RelativeLayout>
</RelativeLayout>

+ 1
- 1
app/src/main/res/layout/item/layout/spinner_text_item.xml View File

@@ -9,7 +9,7 @@
android:textAlignment="inherit"
android:gravity="center_vertical"
android:text="请选择"
android:textSize="12dp"
android:textSize="16dp"
android:textColor="@color/black">
</TextView>



Loading…
Cancel
Save