Skip to content
项目
Groups
代码片段
帮助
正在加载...
Sign in / Register
Toggle navigation
W
workoffice
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图表
统计图
Create a new issue
作业
提交
议题看板
Open sidebar
冷广德
workoffice
Commits
dd77865f
提交
dd77865f
authored
8月 06, 2020
作者:
lgd
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
1.坩埚销售发货,页面
2.TODO 供应订单三个功能测试,坩埚销售页面查接口/数量对应字段
上级
db27760e
显示空白字符变更
内嵌
并排
正在显示
12 个修改的文件
包含
851 行增加
和
7 行删除
+851
-7
AndroidManifest.xml
app/src/main/AndroidManifest.xml
+11
-1
OrderDetail.java
app/src/main/java/com/wd/workoffice/bean/OrderDetail.java
+19
-0
OrderMarkActivity.java
...d/workoffice/ui/activity/bat/order/OrderMarkActivity.java
+2
-0
SaleOrderDetailActivity.java
...office/ui/activity/bat/order/SaleOrderDetailActivity.java
+1
-0
SendApplyActivity.java
...d/workoffice/ui/activity/bat/order/SendApplyActivity.java
+2
-1
SendApplyAddCrucibleActivity.java
...e/ui/activity/bat/order/SendApplyAddCrucibleActivity.java
+23
-5
SendApplyCrucibleChooseActivity.java
...i/activity/bat/order/SendApplyCrucibleChooseActivity.java
+234
-0
SendApplyAddCrucibleAdapter.java
...wd/workoffice/ui/adapter/SendApplyAddCrucibleAdapter.java
+75
-0
SendApplyCrucibleChooseAdapter.java
...workoffice/ui/adapter/SendApplyCrucibleChooseAdapter.java
+100
-0
activity_send_apply_choose.xml
app/src/main/res/layout/activity_send_apply_choose.xml
+124
-0
item_add_stock_choose.xml
app/src/main/res/layout/item_add_stock_choose.xml
+1
-0
item_send_apply_add_crucible.xml
app/src/main/res/layout/item_send_apply_add_crucible.xml
+259
-0
没有找到文件。
app/src/main/AndroidManifest.xml
浏览文件 @
dd77865f
...
...
@@ -2384,7 +2384,7 @@
android:theme=
"@style/Work.Base"
android:windowSoftInputMode=
"adjustPan"
/>
<activity
android:name=
".ui.activity.bat.order.SendApplyAddCruibleActivity"
android:name=
".ui.activity.bat.order.SendApplyAddCru
c
ibleActivity"
android:configChanges=
"orientation|screenSize|keyboardHidden"
android:label=
"申请发货"
android:launchMode=
"singleTop"
...
...
@@ -2399,6 +2399,16 @@
android:screenOrientation=
"portrait"
android:theme=
"@style/Work.Base"
android:windowSoftInputMode=
"adjustPan"
/>
<activity
android:name=
".ui.activity.bat.order.SendApplyCrucibleChooseActivity"
android:configChanges=
"orientation|screenSize|keyboardHidden"
android:label=
"发货来源"
android:launchMode=
"singleTop"
android:screenOrientation=
"portrait"
android:theme=
"@style/Work.Base"
android:windowSoftInputMode=
"adjustPan"
/>
<provider
android:name=
"androidx.core.content.FileProvider"
android:authorities=
"com.wd.workoffice.fileprovider"
...
...
app/src/main/java/com/wd/workoffice/bean/OrderDetail.java
浏览文件 @
dd77865f
package
com
.
wd
.
workoffice
.
bean
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
...
...
@@ -951,6 +952,24 @@ public class OrderDetail {
private
String
chooseNum
;
private
double
productBeyondCount
;
private
String
canPickReturnProductSum
;
List
<
AddStockChooseBean
.
RecordsBean
>
backList
;
String
count
;
// backList的数量
public
String
getCount
()
{
return
count
;
}
public
void
setCount
(
String
count
)
{
this
.
count
=
count
;
}
public
List
<
AddStockChooseBean
.
RecordsBean
>
getBackList
()
{
return
backList
;
}
public
void
setBackList
(
List
<
AddStockChooseBean
.
RecordsBean
>
backList
)
{
this
.
backList
=
backList
;
}
public
String
getCanPickReturnProductSum
()
{
return
canPickReturnProductSum
;
...
...
app/src/main/java/com/wd/workoffice/ui/activity/bat/order/OrderMarkActivity.java
浏览文件 @
dd77865f
...
...
@@ -115,9 +115,11 @@ public class OrderMarkActivity extends WorkToolBarActivity {
toast
(
data
.
getMessage
());
return
;
}
if
(
null
!=
data
.
getData
()){
markBean
=
JSON
.
parseObject
(
data
.
getData
().
toString
(),
MarkBean
.
class
);
changeView
();
}
}
});
}
...
...
app/src/main/java/com/wd/workoffice/ui/activity/bat/order/SaleOrderDetailActivity.java
浏览文件 @
dd77865f
...
...
@@ -442,6 +442,7 @@ public class SaleOrderDetailActivity extends WorkToolBarActivity {
"status"
,
dataBean
.
getStatus
()
+
""
,
"isCrucible"
,
dataBean
.
getIsCrucible
(),
"orderType"
,
dataBean
.
getExpandInfo
().
getOrderType
(),
"deptId"
,
dataBean
.
getLaunchDeptId
()
+
""
,
"orderId"
,
getIntent
().
getStringExtra
(
"id"
));
break
;
}
...
...
app/src/main/java/com/wd/workoffice/ui/activity/bat/order/SendApplyActivity.java
浏览文件 @
dd77865f
...
...
@@ -103,8 +103,9 @@ public class SendApplyActivity extends WorkToolBarActivity {
switch
(
item
.
getItemId
())
{
case
R
.
id
.
add
:
if
(
TextUtils
.
equals
(
"1"
,
getIntent
().
getStringExtra
(
"isCrucible"
)))
{
startActivity
(
SendApplyAddCruibleActivity
.
class
,
startActivity
(
SendApplyAddCru
c
ibleActivity
.
class
,
"orderType"
,
getIntent
().
getStringExtra
(
"orderType"
),
"deptId"
,
getIntent
().
getStringExtra
(
"deptId"
),
"id"
,
getIntent
().
getStringExtra
(
"orderId"
));
return
super
.
onOptionsItemSelected
(
item
);
}
...
...
app/src/main/java/com/wd/workoffice/ui/activity/bat/order/SendApplyAddCruibleActivity.java
→
app/src/main/java/com/wd/workoffice/ui/activity/bat/order/SendApplyAddCru
c
ibleActivity.java
浏览文件 @
dd77865f
...
...
@@ -10,9 +10,11 @@ import android.widget.TextView;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.bigkoo.pickerview.listener.OnTimeSelectListener
;
import
com.chad.library.adapter.base.BaseQuickAdapter
;
import
com.wd.workoffice.R
;
import
com.wd.workoffice.app.BaseBean
;
import
com.wd.workoffice.app.WorkToolBarActivity
;
import
com.wd.workoffice.bean.AddStockChooseBean
;
import
com.wd.workoffice.bean.OrderDetail
;
import
com.wd.workoffice.bean.event.CheckSendEvent
;
import
com.wd.workoffice.bean.event.SendWeightEvent
;
...
...
@@ -20,7 +22,7 @@ import com.wd.workoffice.bean.workEnum.OrderType;
import
com.wd.workoffice.retrofit.RtfUtils
;
import
com.wd.workoffice.retrofit.WorkObserver
;
import
com.wd.workoffice.ui.activity.bat.store.StoreSaleClientActivity
;
import
com.wd.workoffice.ui.adapter.
WorkSendApplyAdd
Adapter
;
import
com.wd.workoffice.ui.adapter.
SendApplyAddCrucible
Adapter
;
import
com.wd.workoffice.util.MathUtils
;
import
com.wd.workoffice.util.PickTimeUtils
;
import
com.wd.workoffice.util.WorkUtils
;
...
...
@@ -52,7 +54,7 @@ import io.reactivex.disposables.Disposable;
* email : lgd19940421@163.com
* github: https://github.com/FlexibleXd
**/
public
class
SendApplyAddCruibleActivity
extends
WorkToolBarActivity
{
public
class
SendApplyAddCru
c
ibleActivity
extends
WorkToolBarActivity
{
@BindView
(
R
.
id
.
tv_bottom
)
TextView
tvBottom
;
@BindView
(
R
.
id
.
rv_data
)
...
...
@@ -76,7 +78,7 @@ public class SendApplyAddCruibleActivity extends WorkToolBarActivity {
@BindView
(
R
.
id
.
tv_input1
)
TextView
tvInput1
;
private
List
<
OrderDetail
.
OrderItemsBean
>
dataList
;
private
WorkSendApplyAdd
Adapter
dataAdapter
;
private
SendApplyAddCrucible
Adapter
dataAdapter
;
private
Map
<
String
,
Object
>
param
;
private
OrderDetail
dataBean
;
private
int
clientId
;
...
...
@@ -93,7 +95,7 @@ public class SendApplyAddCruibleActivity extends WorkToolBarActivity {
protected
void
initData
()
{
orderType
=
getIntent
().
getStringExtra
(
"orderType"
);
dataList
=
new
ArrayList
<>();
dataAdapter
=
new
WorkSendApplyAddAdapter
(
R
.
layout
.
item_send_apply_add
,
dataList
);
dataAdapter
=
new
SendApplyAddCrucibleAdapter
(
R
.
layout
.
item_send_apply_add_crucible
,
dataList
);
dataAdapter
.
bindToRecyclerView
(
rvData
);
param
=
new
HashMap
<>();
param
.
put
(
"orderId"
,
getIntent
().
getStringExtra
(
"id"
));
...
...
@@ -103,6 +105,15 @@ public class SendApplyAddCruibleActivity extends WorkToolBarActivity {
@Override
protected
void
initEvent
()
{
dataAdapter
.
setOnItemChildClickListener
(
new
BaseQuickAdapter
.
OnItemChildClickListener
()
{
@Override
public
void
onItemChildClick
(
BaseQuickAdapter
baseQuickAdapter
,
View
view
,
int
i
)
{
startActivityForResult
(
SendApplyCrucibleChooseActivity
.
class
,
10002
,
"position"
,
i
+
""
,
"deptId"
,
getIntent
().
getStringExtra
(
"deptId"
),
"productId"
,
dataList
.
get
(
i
).
getProductId
()+
""
);
}
});
}
private
void
getData
()
{
...
...
@@ -260,7 +271,7 @@ public class SendApplyAddCruibleActivity extends WorkToolBarActivity {
case
R
.
id
.
tv_bottom
:
break
;
case
R
.
id
.
rl_time
:
PickTimeUtils
.
showPickThree
(
SendApplyAddCruibleActivity
.
this
,
new
OnTimeSelectListener
()
{
PickTimeUtils
.
showPickThree
(
SendApplyAddCru
c
ibleActivity
.
this
,
new
OnTimeSelectListener
()
{
@Override
public
void
onTimeSelect
(
Date
date
,
View
v
)
{
String
time
=
TimeUtils
.
date2String
(
date
,
new
SimpleDateFormat
(
"yyyy-MM-dd"
));
...
...
@@ -283,6 +294,13 @@ public class SendApplyAddCruibleActivity extends WorkToolBarActivity {
String
clientName
=
data
.
getStringExtra
(
"clientName"
);
clientId
=
data
.
getIntExtra
(
"id"
,
0
);
tvLogisticsCompany
.
setText
(
clientName
);
}
else
if
(
requestCode
==
10002
&&
resultCode
==
10002
){
List
<
AddStockChooseBean
.
RecordsBean
>
backList
=
JSON
.
parseArray
(
getIntent
().
getStringExtra
(
"stock"
),
AddStockChooseBean
.
RecordsBean
.
class
);
Integer
position
=
Integer
.
valueOf
(
data
.
getStringExtra
(
"position"
));
String
count
=
data
.
getStringExtra
(
"count"
);
dataList
.
get
(
position
).
setBackList
(
backList
);
dataList
.
get
(
position
).
setCount
(
count
);
dataAdapter
.
notifyItemChanged
(
position
);
}
}
...
...
app/src/main/java/com/wd/workoffice/ui/activity/bat/order/SendApplyCrucibleChooseActivity.java
0 → 100644
浏览文件 @
dd77865f
package
com
.
wd
.
workoffice
.
ui
.
activity
.
bat
.
order
;
import
android.content.Intent
;
import
android.text.TextUtils
;
import
android.view.Menu
;
import
android.view.MenuItem
;
import
android.widget.RelativeLayout
;
import
android.widget.TextView
;
import
com.alibaba.fastjson.JSON
;
import
com.wd.workoffice.R
;
import
com.wd.workoffice.app.BaseBean
;
import
com.wd.workoffice.app.WorkToolBarActivity
;
import
com.wd.workoffice.bean.AddStockChooseBean
;
import
com.wd.workoffice.bean.event.ModifyCarEvent
;
import
com.wd.workoffice.retrofit.RtfUtils
;
import
com.wd.workoffice.retrofit.WorkObserver
;
import
com.wd.workoffice.ui.adapter.AddStockCrucibleChooseAdapter
;
import
com.wd.workoffice.ui.adapter.SendApplyCrucibleChooseAdapter
;
import
com.wd.workoffice.util.MathUtils
;
import
com.wd.workoffice.util.WorkUtils
;
import
org.greenrobot.eventbus.EventBus
;
import
org.greenrobot.eventbus.Subscribe
;
import
org.greenrobot.eventbus.ThreadMode
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Map
;
import
androidx.recyclerview.widget.LinearLayoutManager
;
import
androidx.recyclerview.widget.RecyclerView
;
import
butterknife.BindView
;
import
butterknife.ButterKnife
;
import
butterknife.OnClick
;
import
flexible.xd.android_base.network.rtfhttp.Transformer
;
import
io.reactivex.disposables.Disposable
;
/**
* 选择来源仓库
* author : flexible
* email : lgd19940421@163.com
* github: https://github.com/FlexibleXd
**/
public
class
SendApplyCrucibleChooseActivity
extends
WorkToolBarActivity
{
@BindView
(
R
.
id
.
tv_price
)
TextView
tvPrice
;
@BindView
(
R
.
id
.
tv_ok
)
TextView
tvOk
;
@BindView
(
R
.
id
.
ll_bottom
)
RelativeLayout
llBottom
;
@BindView
(
R
.
id
.
rv_product
)
RecyclerView
rvProduct
;
private
List
<
AddStockChooseBean
.
RecordsBean
>
productList
;
private
SendApplyCrucibleChooseAdapter
productAdapter
;
private
int
page
=
1
;
private
Map
<
String
,
Object
>
param
;
@Override
protected
void
initView
()
{
ButterKnife
.
bind
(
this
);
rvProduct
.
setLayoutManager
(
new
LinearLayoutManager
(
this
,
RecyclerView
.
VERTICAL
,
false
));
}
@Override
protected
void
initData
()
{
productList
=
new
ArrayList
<>();
productAdapter
=
new
SendApplyCrucibleChooseAdapter
(
R
.
layout
.
item_add_stock_choose
,
productList
);
productAdapter
.
bindToRecyclerView
(
rvProduct
);
productAdapter
.
notifyDataSetChanged
();
param
=
WorkUtils
.
pageKey
();
param
.
put
(
"current"
,
page
);
param
.
put
(
"deptId"
,
getIntent
().
getStringExtra
(
"deptId"
));
param
.
put
(
"productId"
,
getIntent
().
getStringExtra
(
"productId"
));
getData
();
changeNumAndPrice
();
}
private
void
changeChooseStatue
()
{
String
pro
=
getIntent
().
getStringExtra
(
"pro"
);
if
(!
TextUtils
.
isEmpty
(
pro
))
{
Map
<
Integer
,
Boolean
>
isChoose
=
productAdapter
.
getIsChoose
();
List
<
AddStockChooseBean
.
RecordsBean
>
chooseList
=
JSON
.
parseArray
(
pro
,
AddStockChooseBean
.
RecordsBean
.
class
);
for
(
AddStockChooseBean
.
RecordsBean
chooseStock
:
chooseList
)
{
for
(
int
i
=
0
;
i
<
productList
.
size
();
i
++)
{
if
(
productList
.
get
(
i
).
getId
()
==
chooseStock
.
getId
())
{
isChoose
.
put
(
i
,
true
);
productList
.
get
(
i
).
setChooseNum
(
chooseStock
.
getChooseNum
());
}
}
}
productAdapter
.
notifyDataSetChanged
();
}
}
@Override
protected
void
initEvent
()
{
// productAdapter.setOnLoadMoreListener(new BaseQuickAdapter.RequestLoadMoreListener() {
// @Override
// public void onLoadMoreRequested() {
// param.put("current", page);
// getData();
// }
// }, rvProduct);
}
@Override
protected
int
layoutId
()
{
return
R
.
layout
.
activity_send_apply_choose
;
}
@OnClick
(
R
.
id
.
tv_ok
)
public
void
onViewClicked
()
{
submit
();
}
private
void
submit
()
{
Map
<
Integer
,
Boolean
>
isChoose
=
productAdapter
.
getIsChoose
();
boolean
isHas
=
false
;
List
<
AddStockChooseBean
.
RecordsBean
>
backList
=
new
ArrayList
<>();
for
(
Map
.
Entry
<
Integer
,
Boolean
>
entry
:
isChoose
.
entrySet
())
{
if
(
entry
.
getValue
())
{
isHas
=
true
;
backList
.
add
(
productList
.
get
(
entry
.
getKey
()));
if
(
TextUtils
.
isEmpty
(
productList
.
get
(
entry
.
getKey
()).
getChooseNum
())||
TextUtils
.
equals
(
productList
.
get
(
entry
.
getKey
()).
getChooseNum
(),
"0"
))
{
toast
(
"请输入数量"
);
return
;
}
}
}
if
(
isHas
)
{
Intent
intent
=
new
Intent
();
intent
.
putExtra
(
"stock"
,
JSON
.
toJSONString
(
backList
));
intent
.
putExtra
(
"position"
,
getIntent
().
getStringExtra
(
"position"
));
intent
.
putExtra
(
"count"
,
tvPrice
.
getText
().
toString
().
split
(
": "
)[
1
]);
setResult
(
10002
,
intent
);
finish
();
}
else
{
toast
(
"请选择来源仓库"
);
}
}
@Override
public
void
onStart
()
{
super
.
onStart
();
EventBus
.
getDefault
().
register
(
this
);
}
@Override
public
void
onStop
()
{
super
.
onStop
();
EventBus
.
getDefault
().
unregister
(
this
);
}
@Subscribe
(
threadMode
=
ThreadMode
.
MAIN
)
public
void
onMessageEvent
(
ModifyCarEvent
event
)
{
changeNumAndPrice
();
}
private
void
changeNumAndPrice
()
{
String
allPrice
=
""
;
Map
<
Integer
,
Boolean
>
isChoose
=
productAdapter
.
getIsChoose
();
for
(
Map
.
Entry
<
Integer
,
Boolean
>
entry
:
isChoose
.
entrySet
())
{
if
(
entry
.
getValue
())
{
allPrice
=
MathUtils
.
add
(
allPrice
,
productList
.
get
(
entry
.
getKey
()).
getChooseNum
(),
3
);
}
}
tvPrice
.
setText
(
"小计: "
.
concat
(
allPrice
));
}
private
void
getData
()
{
RtfUtils
.
getRtf
().
productionPlan
(
param
).
compose
(
Transformer
.
schedule
()).
subscribe
(
new
WorkObserver
<
BaseBean
>()
{
@Override
public
void
doOnSubscribe
(
Disposable
d
)
{
}
@Override
public
void
onFail
(
String
errorMsg
)
{
hideLoading
();
toast
(
errorMsg
);
}
@Override
public
void
onSuccess
(
BaseBean
data
)
{
hideLoading
();
if
(
data
.
getCode
()
!=
0
)
{
toast
(
data
.
getMessage
());
return
;
}
List
<
AddStockChooseBean
.
RecordsBean
>
getList
=
JSON
.
parseObject
(
data
.
getData
().
toString
(),
AddStockChooseBean
.
class
).
getRecords
();
productList
.
clear
();
productList
.
addAll
(
getList
);
productAdapter
.
notifyDataSetChanged
();
changeChooseStatue
();
// if (page == 1) {
// productList.clear();
// productList.addAll(getList);
// productAdapter.notifyDataSetChanged();
// productAdapter.loadMoreComplete();
// } else {
// productAdapter.loadMoreComplete();
// productList.addAll(getList);
// productAdapter.notifyDataSetChanged();
// }
// if (getList.size() == 0) {
// productAdapter.loadMoreEnd();
// } else {
// page++;
// }
}
});
}
@Override
public
boolean
onCreateOptionsMenu
(
Menu
menu
)
{
getMenuInflater
().
inflate
(
R
.
menu
.
menu_finish
,
menu
);
return
super
.
onCreateOptionsMenu
(
menu
);
}
@Override
public
boolean
onOptionsItemSelected
(
MenuItem
item
)
{
switch
(
item
.
getItemId
())
{
case
R
.
id
.
finish
:
submit
();
break
;
}
return
super
.
onOptionsItemSelected
(
item
);
}
}
app/src/main/java/com/wd/workoffice/ui/adapter/SendApplyAddCrucibleAdapter.java
0 → 100644
浏览文件 @
dd77865f
package
com
.
wd
.
workoffice
.
ui
.
adapter
;
import
android.text.TextUtils
;
import
android.widget.CheckBox
;
import
android.widget.CompoundButton
;
import
com.chad.library.adapter.base.BaseQuickAdapter
;
import
com.chad.library.adapter.base.BaseViewHolder
;
import
com.wd.workoffice.R
;
import
com.wd.workoffice.bean.OrderDetail
;
import
com.wd.workoffice.bean.event.SendWeightEvent
;
import
com.wd.workoffice.util.MathUtils
;
import
com.wd.workoffice.widget.AddAndReduceView
;
import
org.greenrobot.eventbus.EventBus
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
/**
* Created by flexible on 2018/8/13.
*/
public
class
SendApplyAddCrucibleAdapter
extends
BaseQuickAdapter
<
OrderDetail
.
OrderItemsBean
,
BaseViewHolder
>
{
Map
<
Integer
,
Boolean
>
isChoose
=
new
HashMap
<>();
public
SendApplyAddCrucibleAdapter
(
int
layoutResId
,
List
data
)
{
super
(
layoutResId
,
data
);
for
(
int
i
=
0
;
i
<
isChoose
.
entrySet
().
size
();
i
++)
{
isChoose
.
put
(
i
,
false
);
}
}
@Override
protected
void
convert
(
BaseViewHolder
helper
,
OrderDetail
.
OrderItemsBean
item
)
{
if
(!
TextUtils
.
isEmpty
(
item
.
getCount
())){
helper
.
setText
(
R
.
id
.
tv_from
,
item
.
getCount
());
}
helper
.
setText
(
R
.
id
.
tv_name
,
item
.
getProductSimpleCode
());
helper
.
setText
(
R
.
id
.
tv_card
,
item
.
getProductSoleCode
());
helper
.
setText
(
R
.
id
.
tv_card_name
,
item
.
getProductName
());
helper
.
setText
(
R
.
id
.
tv_spec
,
item
.
getProductSpec
());
helper
.
setText
(
R
.
id
.
tv_price
,
"¥"
.
concat
(
MathUtils
.
converData
(
item
.
getInnerPrice
(),
3
)));
// helper.setText(R.id.tv_all_price, "¥".concat(String.valueOf(item.getInnerPrice())));
helper
.
setText
(
R
.
id
.
tv_unit
,
item
.
getProductUnit
());
// helper.setText(R.id.tv_from, WorkUtils.getOrderFrom(item.getType()));
helper
.
setText
(
R
.
id
.
tv_num
,
MathUtils
.
converData
(
item
.
getProductCount
(),
3
));
helper
.
setText
(
R
.
id
.
tv_apply_send_num
,
MathUtils
.
converData
(
item
.
getCanOutStoreProductSum
(),
3
));
helper
.
setText
(
R
.
id
.
tv_send_num
,
MathUtils
.
converData
(
item
.
getShipSum
(),
3
));
CheckBox
cbChoose
=
helper
.
getView
(
R
.
id
.
cb_check
);
cbChoose
.
setOnCheckedChangeListener
(
new
CompoundButton
.
OnCheckedChangeListener
()
{
@Override
public
void
onCheckedChanged
(
CompoundButton
buttonView
,
boolean
isChecked
)
{
isChoose
.
put
(
helper
.
getAdapterPosition
(),
cbChoose
.
isChecked
());
EventBus
.
getDefault
().
post
(
new
SendWeightEvent
());
}
});
helper
.
addOnClickListener
(
R
.
id
.
rl_from
);
}
public
Map
<
Integer
,
Boolean
>
getIsChoose
()
{
return
isChoose
;
}
public
void
setIsChoose
(
Map
<
Integer
,
Boolean
>
isChoose
)
{
this
.
isChoose
=
isChoose
;
}
}
app/src/main/java/com/wd/workoffice/ui/adapter/SendApplyCrucibleChooseAdapter.java
0 → 100644
浏览文件 @
dd77865f
package
com
.
wd
.
workoffice
.
ui
.
adapter
;
import
android.text.TextUtils
;
import
android.widget.CheckBox
;
import
android.widget.CompoundButton
;
import
com.alibaba.fastjson.JSON
;
import
com.chad.library.adapter.base.BaseQuickAdapter
;
import
com.chad.library.adapter.base.BaseViewHolder
;
import
com.wd.workoffice.R
;
import
com.wd.workoffice.bean.AddStockChooseBean
;
import
com.wd.workoffice.bean.event.ModifyCarEvent
;
import
com.wd.workoffice.util.MathUtils
;
import
com.wd.workoffice.widget.AddAndReduceView
;
import
org.greenrobot.eventbus.EventBus
;
import
java.util.LinkedHashMap
;
import
java.util.List
;
import
java.util.Map
;
/**
* Created by flexible on 2018/8/13.
*/
public
class
SendApplyCrucibleChooseAdapter
extends
BaseQuickAdapter
<
AddStockChooseBean
.
RecordsBean
,
BaseViewHolder
>
{
int
type
;
// 0 新增选择 1 新增展示 2 详情
Map
<
Integer
,
Boolean
>
isChoose
=
new
LinkedHashMap
<>();
public
SendApplyCrucibleChooseAdapter
(
int
layoutResId
,
List
data
)
{
super
(
layoutResId
,
data
);
for
(
int
i
=
0
;
i
<
getData
().
size
();
i
++)
{
isChoose
.
put
(
i
,
false
);
}
}
public
SendApplyCrucibleChooseAdapter
(
int
layoutResId
,
List
data
,
int
type
)
{
super
(
layoutResId
,
data
);
this
.
type
=
type
;
for
(
int
i
=
0
;
i
<
getData
().
size
();
i
++)
{
isChoose
.
put
(
i
,
false
);
}
}
@Override
protected
void
convert
(
BaseViewHolder
helper
,
AddStockChooseBean
.
RecordsBean
item
)
{
if
(
type
==
1
)
{
helper
.
setGone
(
R
.
id
.
ll_bottom
,
false
);
helper
.
setGone
(
R
.
id
.
cb_check
,
false
);
helper
.
setText
(
R
.
id
.
tv_stock_num_desc
,
"可发货数量"
);
helper
.
setText
(
R
.
id
.
tv_stock_num
,
MathUtils
.
converData
(
item
.
getChooseNum
(),
3
));
}
else
if
(
type
==
2
)
{
helper
.
setGone
(
R
.
id
.
ll_bottom
,
false
);
helper
.
setGone
(
R
.
id
.
cb_check
,
false
);
helper
.
setText
(
R
.
id
.
tv_stock_num_desc
,
"可发货数量"
);
helper
.
setText
(
R
.
id
.
tv_stock_num
,
MathUtils
.
converData
(
item
.
getQuantity
(),
3
));
}
else
{
helper
.
setText
(
R
.
id
.
tv_stock_num_desc
,
"可发货数量"
);
helper
.
setText
(
R
.
id
.
tv_add_desc
,
"申请发货数量"
);
helper
.
setText
(
R
.
id
.
tv_stock_num
,
MathUtils
.
converData
(
item
.
getActionQuantity
(),
3
));
}
helper
.
setText
(
R
.
id
.
tv_name
,
item
.
getCrucibleId
());
helper
.
setText
(
R
.
id
.
tv_stock
,
item
.
getStockName
());
CheckBox
cbChoose
=
helper
.
getView
(
R
.
id
.
cb_check
);
cbChoose
.
setOnCheckedChangeListener
(
new
CompoundButton
.
OnCheckedChangeListener
()
{
@Override
public
void
onCheckedChanged
(
CompoundButton
buttonView
,
boolean
isChecked
)
{
isChoose
.
put
(
helper
.
getAdapterPosition
(),
cbChoose
.
isChecked
());
EventBus
.
getDefault
().
post
(
new
ModifyCarEvent
(
JSON
.
toJSONString
(
getData
())));
}
});
cbChoose
.
setChecked
(
isChoose
.
get
(
helper
.
getAdapterPosition
())
==
null
?
false
:
isChoose
.
get
(
helper
.
getAdapterPosition
()));
AddAndReduceView
num
=
helper
.
getView
(
R
.
id
.
ar_num
);
num
.
setMaxNum
(
item
.
getQuantity
());
if
(!
TextUtils
.
isEmpty
(
item
.
getChooseNum
()))
num
.
setNumber
(
item
.
getChooseNum
());
num
.
setOnNumberChangedListener
(
new
AddAndReduceView
.
OnNumberChangedListener
()
{
@Override
public
void
OnNumberChanged
(
String
vs
)
{
item
.
setChooseNum
(
vs
);
EventBus
.
getDefault
().
post
(
new
ModifyCarEvent
(
JSON
.
toJSONString
(
getData
())));
}
});
}
public
Map
<
Integer
,
Boolean
>
getIsChoose
()
{
return
isChoose
;
}
public
void
setIsChoose
(
Map
<
Integer
,
Boolean
>
isChoose
)
{
this
.
isChoose
=
isChoose
;
}
}
app/src/main/res/layout/activity_send_apply_choose.xml
0 → 100644
浏览文件 @
dd77865f
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
<RelativeLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
<RelativeLayout
android:id=
"@+id/ll_bottom"
android:layout_width=
"match_parent"
android:layout_height=
"60mm"
android:layout_alignParentBottom=
"true"
android:orientation=
"horizontal"
android:visibility=
"gone"
>
<TextView
android:id=
"@+id/tv_price"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_alignParentLeft=
"true"
android:layout_centerVertical=
"true"
android:layout_marginLeft=
"15mm"
android:text=
"总计: ¥ "
android:textSize=
"16sp"
/>
<TextView
android:id=
"@+id/tv_ok"
android:layout_width=
"80mm"
android:layout_height=
"match_parent"
android:layout_alignParentRight=
"true"
android:background=
"@color/red_btn_bg"
android:gravity=
"center"
android:text=
"确定"
android:textColor=
"@color/white"
/>
</RelativeLayout>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_above=
"@id/ll_bottom"
android:orientation=
"vertical"
>
<LinearLayout
android:id=
"@+id/ll_search"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:background=
"@color/white"
android:orientation=
"horizontal"
android:paddingHorizontal=
"20mm"
android:paddingVertical=
"10mm"
>
<LinearLayout
android:layout_width=
"0dp"
android:layout_height=
"match_parent"
android:layout_weight=
"1"
android:background=
"@drawable/shape_client_search"
android:gravity=
"center_vertical"
android:paddingHorizontal=
"10mm"
>
<ImageView
android:layout_width=
"15mm"
android:layout_height=
"15mm"
android:src=
"@mipmap/client_search"
/>
<EditText
android:id=
"@+id/et_key"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_marginLeft=
"2mm"
android:background=
"@null"
android:hint=
"输入订单号"
android:textColor=
"#91ABBA"
android:textColorHint=
"#91ABBA"
android:textSize=
"14sp"
/>
</LinearLayout>
<Button
android:id=
"@+id/btn_search"
android:layout_width=
"60mm"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"10mm"
android:background=
"@color/mainTextColor"
android:text=
"搜索"
android:textColor=
"@color/white"
android:textSize=
"16sp"
/>
</LinearLayout>
<LinearLayout
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:paddingVertical=
"10mm"
>
<View
android:layout_width=
"8mm"
android:layout_height=
"18mm"
android:background=
"@color/red_btn_bg"
/>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"10mm"
android:text=
"货品信息"
android:textSize=
"16sp"
/>
<TextView
android:id=
"@+id/tv_count_desc"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:textSize=
"16sp"
/>
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView
android:id=
"@+id/rv_product"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
/>
</LinearLayout>
</RelativeLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
app/src/main/res/layout/item_add_stock_choose.xml
浏览文件 @
dd77865f
...
...
@@ -98,6 +98,7 @@
android:layout_marginTop=
"5mm"
>
<TextView
android:id=
"@+id/tv_add_desc"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_alignParentLeft=
"true"
...
...
app/src/main/res/layout/item_send_apply_add_crucible.xml
0 → 100644
浏览文件 @
dd77865f
<?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=
"wrap_content"
android:layout_centerHorizontal=
"true"
android:layout_marginTop=
"10mm"
android:background=
"@color/white"
android:orientation=
"vertical"
android:paddingHorizontal=
"20mm"
android:paddingTop=
"10mm"
android:paddingBottom=
"20mm"
>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"5mm"
android:gravity=
"center_vertical"
>
<CheckBox
android:id=
"@+id/cb_check"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
/>
<TextView
android:id=
"@+id/tv_name"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:textSize=
"16sp"
android:textStyle=
"bold"
/>
</LinearLayout>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"14mm"
android:background=
"#FCFCFD"
android:orientation=
"vertical"
android:padding=
"10mm"
>
<RelativeLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_alignParentLeft=
"true"
android:text=
"品号"
android:textColor=
"@color/flexible_text_gray"
android:textSize=
"12sp"
/>
<TextView
android:id=
"@+id/tv_card"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_alignParentRight=
"true"
android:text=
"品号"
android:textColor=
"@color/flexible_text_gray"
android:textSize=
"12sp"
/>
</RelativeLayout>
<RelativeLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"10mm"
>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_alignParentLeft=
"true"
android:text=
"品名"
android:textColor=
"@color/flexible_text_gray"
android:textSize=
"12sp"
/>
<TextView
android:id=
"@+id/tv_card_name"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_alignParentRight=
"true"
android:text=
"品号"
android:textColor=
"@color/flexible_text_gray"
android:textSize=
"12sp"
/>
</RelativeLayout>
<RelativeLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"10mm"
>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_alignParentLeft=
"true"
android:text=
"规格"
android:textColor=
"@color/flexible_text_gray"
android:textSize=
"12sp"
/>
<TextView
android:id=
"@+id/tv_spec"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_alignParentRight=
"true"
android:text=
"品号"
android:textColor=
"@color/flexible_text_gray"
android:textSize=
"12sp"
/>
</RelativeLayout>
<RelativeLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"10mm"
>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_alignParentLeft=
"true"
android:text=
"内部单价"
android:textColor=
"@color/flexible_text_gray"
android:textSize=
"12sp"
/>
<TextView
android:id=
"@+id/tv_price"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_alignParentRight=
"true"
android:text=
"品号"
android:textColor=
"@color/flexible_text_gray"
android:textSize=
"12sp"
/>
</RelativeLayout>
<RelativeLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"10mm"
>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_alignParentLeft=
"true"
android:text=
"单位"
android:textColor=
"@color/flexible_text_gray"
android:textSize=
"12sp"
/>
<TextView
android:id=
"@+id/tv_unit"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_alignParentRight=
"true"
android:textColor=
"@color/flexible_text_gray"
android:textSize=
"12sp"
/>
</RelativeLayout>
<RelativeLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"10mm"
>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_alignParentLeft=
"true"
android:text=
"数量"
android:textColor=
"@color/flexible_text_gray"
android:textSize=
"12sp"
/>
<TextView
android:id=
"@+id/tv_num"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_alignParentRight=
"true"
android:textColor=
"@color/flexible_text_gray"
android:textSize=
"12sp"
/>
</RelativeLayout>
<RelativeLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"10mm"
>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_alignParentLeft=
"true"
android:text=
"可使用数量"
android:textColor=
"@color/flexible_text_gray"
android:textSize=
"12sp"
/>
<TextView
android:id=
"@+id/tv_apply_send_num"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_alignParentRight=
"true"
android:textColor=
"@color/flexible_text_gray"
android:textSize=
"12sp"
/>
</RelativeLayout>
<RelativeLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"10mm"
>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_alignParentLeft=
"true"
android:text=
"已使用"
android:textColor=
"@color/flexible_text_gray"
android:textSize=
"12sp"
/>
<TextView
android:id=
"@+id/tv_send_num"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_alignParentRight=
"true"
android:textColor=
"@color/flexible_text_gray"
android:textSize=
"12sp"
/>
</RelativeLayout>
</LinearLayout>
<RelativeLayout
android:id=
"@+id/rl_from"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:paddingVertical=
"9mm"
>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_alignParentLeft=
"true"
android:layout_centerVertical=
"true"
android:text=
"发货来源"
android:textSize=
"14sp"
/>
<LinearLayout
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_alignParentRight=
"true"
android:gravity=
"center_vertical"
>
<TextView
android:id=
"@+id/tv_from"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_alignParentLeft=
"true"
android:layout_marginRight=
"3mm"
android:hint=
"请选择"
android:textSize=
"14sp"
/>
<ImageView
android:id=
"@+id/iv_from"
android:layout_width=
"15mm"
android:layout_height=
"20mm"
android:src=
"@mipmap/arrow_right_gray"
/>
</LinearLayout>
</RelativeLayout>
</LinearLayout>
\ No newline at end of file
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论