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
6664d28c
提交
6664d28c
authored
4月 14, 2020
作者:
lgd
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
1.外采购订单详情
2.//TODO erp用户激活测试,忘记/重置密码测试,审核规则,领用申请列表/退件列表/参数,坩埚下单页面,组装下单,产品下单还差附件测试,mes,刷新token
上级
b00dfb4c
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
454 行增加
和
0 行删除
+454
-0
OutOrderDetailActivity.java
...koffice/ui/activity/bat/order/OutOrderDetailActivity.java
+454
-0
没有找到文件。
app/src/main/java/com/wd/workoffice/ui/activity/bat/order/OutOrderDetailActivity.java
0 → 100644
浏览文件 @
6664d28c
package
com
.
wd
.
workoffice
.
ui
.
activity
.
bat
.
order
;
import
android.content.DialogInterface
;
import
android.os.Bundle
;
import
android.text.Editable
;
import
android.text.TextUtils
;
import
android.text.TextWatcher
;
import
android.view.LayoutInflater
;
import
android.view.View
;
import
android.widget.EditText
;
import
android.widget.ImageView
;
import
android.widget.LinearLayout
;
import
android.widget.RelativeLayout
;
import
android.widget.TextView
;
import
com.alibaba.fastjson.JSON
;
import
com.chad.library.adapter.base.BaseQuickAdapter
;
import
com.qmuiteam.qmui.widget.dialog.QMUIDialog
;
import
com.wd.workoffice.R
;
import
com.wd.workoffice.app.BaseBean
;
import
com.wd.workoffice.app.WorkToolBarActivity
;
import
com.wd.workoffice.bean.OrderDetail
;
import
com.wd.workoffice.bean.event.CheckOrderEvent
;
import
com.wd.workoffice.retrofit.RtfUtils
;
import
com.wd.workoffice.retrofit.WorkObserver
;
import
com.wd.workoffice.ui.adapter.OrderDetailProductAdapter
;
import
com.wd.workoffice.ui.adapter.OrderProcessAdapter
;
import
com.wd.workoffice.ui.adapter.OutOrderDetailProductAdapter
;
import
com.wd.workoffice.util.DialogUtils
;
import
com.wd.workoffice.util.WorkUtils
;
import
org.greenrobot.eventbus.EventBus
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Map
;
import
androidx.appcompat.app.AlertDialog
;
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
OutOrderDetailActivity
extends
WorkToolBarActivity
{
@BindView
(
R
.
id
.
tv_status
)
TextView
tvStatus
;
@BindView
(
R
.
id
.
tv_desc
)
TextView
tvDesc
;
@BindView
(
R
.
id
.
ll_top
)
RelativeLayout
llTop
;
@BindView
(
R
.
id
.
tv_refuse
)
TextView
tvRefuse
;
@BindView
(
R
.
id
.
tv_agree
)
TextView
tvAgree
;
@BindView
(
R
.
id
.
ll_check
)
LinearLayout
llCheck
;
@BindView
(
R
.
id
.
tv_finish_apply
)
TextView
tvFinishApply
;
@BindView
(
R
.
id
.
tv_send_apply
)
TextView
tvSendApply
;
@BindView
(
R
.
id
.
ll_apply
)
LinearLayout
llApply
;
@BindView
(
R
.
id
.
ll_bottom
)
LinearLayout
llBottom
;
@BindView
(
R
.
id
.
rv_process
)
RecyclerView
rvProcess
;
@BindView
(
R
.
id
.
tv_name
)
TextView
tvName
;
@BindView
(
R
.
id
.
tv_dep
)
TextView
tvDep
;
@BindView
(
R
.
id
.
rl_dep
)
RelativeLayout
rlDep
;
@BindView
(
R
.
id
.
tv_place_name
)
TextView
tvPlaceName
;
@BindView
(
R
.
id
.
tv_company
)
TextView
tvCompany
;
@BindView
(
R
.
id
.
tv_supplier
)
TextView
tvSupplier
;
@BindView
(
R
.
id
.
rv_supplier
)
RelativeLayout
rvSupplier
;
@BindView
(
R
.
id
.
tv_order_no
)
TextView
tvOrderNo
;
@BindView
(
R
.
id
.
tv_time
)
TextView
tvTime
;
@BindView
(
R
.
id
.
tv_send_time
)
TextView
tvSendTime
;
@BindView
(
R
.
id
.
tv_price
)
TextView
tvPrice
;
@BindView
(
R
.
id
.
rv_pro
)
RecyclerView
rvPro
;
@BindView
(
R
.
id
.
tv_claim1
)
TextView
tvClaim1
;
@BindView
(
R
.
id
.
tv_claim2
)
TextView
tvClaim2
;
@BindView
(
R
.
id
.
tv_claim3
)
TextView
tvClaim3
;
@BindView
(
R
.
id
.
tv_claim4
)
TextView
tvClaim4
;
@BindView
(
R
.
id
.
tv_claim5
)
TextView
tvClaim5
;
@BindView
(
R
.
id
.
tv_claim6
)
TextView
tvClaim6
;
@BindView
(
R
.
id
.
tv_order_desc
)
TextView
tvOrderDesc
;
@BindView
(
R
.
id
.
tv_set
)
TextView
tvSet
;
@BindView
(
R
.
id
.
iv_setting
)
ImageView
ivSetting
;
@BindView
(
R
.
id
.
rl_set
)
RelativeLayout
rlSet
;
private
OrderDetail
dataBean
;
private
List
<
OrderDetail
.
OrderFlowsBean
>
flowList
;
private
OrderProcessAdapter
flowAdapter
;
private
OutOrderDetailProductAdapter
proAdapter
;
private
List
<
OrderDetail
.
OrderItemsBean
>
proList
;
private
Integer
status
;
private
String
identity
;
private
QMUIDialog
.
MenuDialogBuilder
settingDialog
;
String
[]
settingList
=
new
String
[]{
"中转入库"
,
"直接入库"
};
@Override
protected
void
initView
()
{
ButterKnife
.
bind
(
this
);
rvPro
.
setLayoutManager
(
new
LinearLayoutManager
(
this
,
RecyclerView
.
VERTICAL
,
false
));
rvProcess
.
setLayoutManager
(
new
LinearLayoutManager
(
this
,
RecyclerView
.
VERTICAL
,
false
));
status
=
Integer
.
valueOf
(
getIntent
().
getStringExtra
(
"status"
));
identity
=
getIntent
().
getStringExtra
(
"identity"
);
if
(
TextUtils
.
equals
(
identity
,
"1"
))
{
//1销售 2生产
}
else
{
rlDep
.
setVisibility
(
View
.
GONE
);
}
switch
(
status
)
{
// {"待审核", "待接单", "待生产", "已入库","已交付"};
// { "100", "200", "710", "500","600"};
case
100
:
llBottom
.
setVisibility
(
View
.
VISIBLE
);
llCheck
.
setVisibility
(
View
.
VISIBLE
);
break
;
case
200
:
break
;
case
300
:
llBottom
.
setVisibility
(
View
.
VISIBLE
);
llApply
.
setVisibility
(
View
.
VISIBLE
);
tvSendApply
.
setVisibility
(
View
.
GONE
);
rlSet
.
setVisibility
(
View
.
VISIBLE
);
break
;
case
410
:
llBottom
.
setVisibility
(
View
.
VISIBLE
);
llApply
.
setVisibility
(
View
.
VISIBLE
);
rlSet
.
setVisibility
(
View
.
VISIBLE
);
break
;
case
500
:
llBottom
.
setVisibility
(
View
.
VISIBLE
);
llApply
.
setVisibility
(
View
.
VISIBLE
);
rlSet
.
setVisibility
(
View
.
VISIBLE
);
break
;
case
600
:
llBottom
.
setVisibility
(
View
.
VISIBLE
);
llApply
.
setVisibility
(
View
.
VISIBLE
);
rlSet
.
setVisibility
(
View
.
VISIBLE
);
break
;
default
:
llBottom
.
setVisibility
(
View
.
VISIBLE
);
llApply
.
setVisibility
(
View
.
VISIBLE
);
tvSendApply
.
setVisibility
(
View
.
GONE
);
rlSet
.
setVisibility
(
View
.
VISIBLE
);
break
;
}
settingDialog
=
DialogUtils
.
listDialog
(
this
);
settingDialog
.
addItems
(
settingList
,
(
dialog
,
which
)
->
{
tvSet
.
setText
(
settingList
[
which
]);
setting
(++
which
);
dialog
.
dismiss
();
});
}
@Override
protected
void
initData
()
{
getData
();
flowList
=
new
ArrayList
<>();
flowAdapter
=
new
OrderProcessAdapter
(
R
.
layout
.
item_order_process
,
flowList
);
flowAdapter
.
bindToRecyclerView
(
rvProcess
);
flowAdapter
.
setEmptyView
(
R
.
layout
.
view_empty_order
,
rvProcess
);
proList
=
new
ArrayList
<>();
proAdapter
=
new
OutOrderDetailProductAdapter
(
R
.
layout
.
item_order_product
,
proList
,
status
);
proAdapter
.
bindToRecyclerView
(
rvPro
);
proAdapter
.
setEmptyView
(
R
.
layout
.
view_empty_order
,
rvProcess
);
}
private
void
getData
()
{
RtfUtils
.
getRtf
().
purchaseOrderDetail
(
getIntent
().
getStringExtra
(
"id"
),
"3"
).
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
;
}
dataBean
=
JSON
.
parseObject
(
data
.
getData
().
toString
(),
OrderDetail
.
class
);
flowList
.
addAll
(
dataBean
.
getOrderFlows
());
flowAdapter
.
notifyDataSetChanged
();
proList
.
addAll
(
dataBean
.
getOrderItems
());
proAdapter
.
notifyDataSetChanged
();
tvName
.
setText
(
dataBean
.
getCustomerName
());
tvDep
.
setText
(
dataBean
.
getReceiveDeptName
());
tvStatus
.
setText
(
dataBean
.
getStatusName
());
tvPlaceName
.
setText
(
dataBean
.
getLaunchUserName
());
tvCompany
.
setText
(
dataBean
.
getLaunchDeptName
());
tvOrderNo
.
setText
(
dataBean
.
getId
());
tvTime
.
setText
(
dataBean
.
getCreatedTime
());
tvSendTime
.
setText
(
dataBean
.
getRequireTime
());
tvDesc
.
setText
(
dataBean
.
getAttrName
());
tvPrice
.
setText
(
String
.
valueOf
(
dataBean
.
getLaunchOrderAmount
()));
tvSupplier
.
setText
(
dataBean
.
getSupplierName
());
OrderDetail
.
ExpandInfoBean
expandInfo
=
dataBean
.
getExpandInfo
();
tvClaim1
.
setText
(
expandInfo
.
getDemond4
());
tvClaim2
.
setText
(
expandInfo
.
getDemond5
());
tvClaim3
.
setText
(
expandInfo
.
getDemond1
());
tvClaim4
.
setText
(
expandInfo
.
getDemond2
());
tvClaim5
.
setText
(
expandInfo
.
getDemond3
());
tvClaim6
.
setText
(
expandInfo
.
getComments
());
tvDesc
.
setText
(
dataBean
.
getAttrName
());
tvStatus
.
setText
(
dataBean
.
getStatusName
());
changEnterStockType
(
dataBean
.
getEnterStockType
());
}
});
}
@Override
protected
void
initEvent
()
{
proAdapter
.
setOnItemChildClickListener
(
new
BaseQuickAdapter
.
OnItemChildClickListener
()
{
@Override
public
void
onItemChildClick
(
BaseQuickAdapter
adapter
,
View
view
,
int
position
)
{
switch
(
view
.
getId
())
{
case
R
.
id
.
tv_get
:
startActivity
(
UseApplyActivity
.
class
,
"status"
,
dataBean
.
getStatus
()
+
""
,
"num"
,
proList
.
get
(
position
).
getCanOutStoreProductSum
()
+
""
,
"product"
,
proList
.
get
(
position
).
getProductName
(),
"simpleCode"
,
proList
.
get
(
position
).
getProductSimpleCode
(),
"orderId"
,
getIntent
().
getStringExtra
(
"id"
),
"productId"
,
proList
.
get
(
position
).
getProductId
()
+
""
);
break
;
case
R
.
id
.
tv_add
:
startActivity
(
AddStockApplyActivity
.
class
,
"status"
,
dataBean
.
getStatus
()
+
""
,
"orderType"
,
dataBean
.
getOrderType
()
+
""
,
"num"
,
proList
.
get
(
position
).
getCanInStoreProductSum
()
+
""
,
"product"
,
proList
.
get
(
position
).
getProductName
(),
"simpleCode"
,
proList
.
get
(
position
).
getProductSimpleCode
(),
"orderId"
,
getIntent
().
getStringExtra
(
"id"
),
"orderItemId"
,
proList
.
get
(
position
).
getId
(),
"productId"
,
proList
.
get
(
position
).
getProductId
()
+
""
);
break
;
case
R
.
id
.
tv_return
:
startActivity
(
ReturnApplyActivity
.
class
,
"status"
,
dataBean
.
getStatus
()
+
""
,
"orderType"
,
dataBean
.
getOrderType
()
+
""
,
"num"
,
proList
.
get
(
position
).
getStoreSum
()
+
""
,
"product"
,
proList
.
get
(
position
).
getProductName
(),
"simpleCode"
,
proList
.
get
(
position
).
getProductSimpleCode
(),
"orderId"
,
getIntent
().
getStringExtra
(
"id"
),
"productId"
,
proList
.
get
(
position
).
getProductId
()
+
""
);
break
;
case
R
.
id
.
tv_flow
:
startActivity
(
ProFlowActivity
.
class
,
"status"
,
dataBean
.
getStatus
()
+
""
,
"num"
,
proList
.
get
(
position
).
getStoreSum
()
+
""
,
"product"
,
proList
.
get
(
position
).
getProductName
(),
"simpleCode"
,
proList
.
get
(
position
).
getProductSimpleCode
(),
"orderId"
,
getIntent
().
getStringExtra
(
"id"
),
"productId"
,
proList
.
get
(
position
).
getProductId
()
+
""
,
"orderItemId"
,
proList
.
get
(
position
).
getId
(),
"info"
,
JSON
.
toJSONString
(
proList
.
get
(
position
)));
break
;
}
}
});
}
@Override
protected
int
layoutId
()
{
return
R
.
layout
.
activity_out_order
;
}
@OnClick
({
R
.
id
.
rl_set
,
R
.
id
.
tv_finish_apply
,
R
.
id
.
tv_send_apply
,
R
.
id
.
tv_refuse
,
R
.
id
.
tv_agree
})
public
void
onViewClicked
(
View
view
)
{
switch
(
view
.
getId
())
{
case
R
.
id
.
rl_set
:
settingDialog
.
show
();
break
;
case
R
.
id
.
tv_refuse
:
checkDialog
(
2
);
break
;
case
R
.
id
.
tv_agree
:
checkDialog
(
1
);
break
;
case
R
.
id
.
tv_finish_apply
:
if
(
dataBean
==
null
)
{
toast
(
"正在加载中,请稍后"
);
return
;
}
startActivity
(
EndApplyActivity
.
class
,
"status"
,
getIntent
().
getStringExtra
(
"status"
),
"orderType"
,
dataBean
.
getOrderType
(),
"orderId"
,
getIntent
().
getStringExtra
(
"id"
));
break
;
case
R
.
id
.
tv_send_apply
:
startActivity
(
SendApplyActivity
.
class
,
"orderId"
,
getIntent
().
getStringExtra
(
"id"
));
break
;
}
}
private
void
checkDialog
(
int
status
)
{
AlertDialog
.
Builder
builder
=
new
AlertDialog
.
Builder
(
this
);
View
view
=
LayoutInflater
.
from
(
this
).
inflate
(
R
.
layout
.
view_check_order
,
null
);
TextView
tvOk
=
view
.
findViewById
(
R
.
id
.
tv_ok
);
TextView
tvPrice
=
view
.
findViewById
(
R
.
id
.
tv_price
);
tvPrice
.
setText
(
String
.
valueOf
(
dataBean
.
getLaunchOrderAmount
()));
TextView
tvNum
=
view
.
findViewById
(
R
.
id
.
tv_num
);
TextView
tvCancel
=
view
.
findViewById
(
R
.
id
.
tv_cancel
);
EditText
etRemark
=
view
.
findViewById
(
R
.
id
.
et_content
);
etRemark
.
addTextChangedListener
(
new
TextWatcher
()
{
@Override
public
void
beforeTextChanged
(
CharSequence
s
,
int
start
,
int
count
,
int
after
)
{
}
@Override
public
void
onTextChanged
(
CharSequence
s
,
int
start
,
int
before
,
int
count
)
{
}
@Override
public
void
afterTextChanged
(
Editable
s
)
{
tvNum
.
setText
(
s
.
length
()
+
"/140"
);
}
});
builder
.
setView
(
view
);
AlertDialog
addCartDialog
=
builder
.
create
();
tvOk
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
public
void
onClick
(
View
v
)
{
if
(
TextUtils
.
isEmpty
(
etRemark
.
getText
().
toString
()))
{
toast
(
"请填写备注"
);
return
;
}
check
(
status
,
etRemark
.
getText
().
toString
());
addCartDialog
.
dismiss
();
}
});
tvCancel
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
public
void
onClick
(
View
v
)
{
addCartDialog
.
dismiss
();
}
});
addCartDialog
.
show
();
}
private
void
check
(
int
status
,
String
remark
)
{
Map
<
String
,
Object
>
dataParam
=
WorkUtils
.
simpleParam
();
dataParam
.
put
(
"result"
,
status
);
dataParam
.
put
(
"comment"
,
remark
);
RtfUtils
.
getRtf
().
saleOrderCheck
(
dataBean
.
getId
(),
WorkUtils
.
convertMapToBody
(
dataParam
)).
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
;
}
toast
(
"操作成功"
);
llBottom
.
setVisibility
(
View
.
GONE
);
EventBus
.
getDefault
().
post
(
new
CheckOrderEvent
());
}
});
}
private
void
changEnterStockType
(
String
enterStockType
)
{
if
(!
TextUtils
.
isEmpty
(
enterStockType
))
{
ivSetting
.
setVisibility
(
View
.
GONE
);
rlSet
.
setClickable
(
false
);
tvSet
.
setText
(
WorkUtils
.
getEnterStockType
(
enterStockType
));
}
}
private
void
setting
(
int
i
)
{
showLoading
();
Map
<
String
,
Object
>
dataParam
=
WorkUtils
.
simpleParam
();
dataParam
.
put
(
"orderId"
,
getIntent
().
getStringExtra
(
"id"
));
dataParam
.
put
(
"enterStockType"
,
i
);
RtfUtils
.
getRtf
().
purchaseOrderStockType
(
dataParam
).
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
;
}
toast
(
"操作成功"
);
changEnterStockType
(
i
+
""
);
}
});
}
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论