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
5d22fd3b
提交
5d22fd3b
authored
6月 01, 2020
作者:
lgd
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
1.状态显示
2.//TODO (设备采购,维修列表接口,新增维修的部门接口),坩埚下单,下单时间选择器当前时间验证,mes其他页面,mes用户反馈空也展示,编辑任务担当无法修改
上级
73f823c1
隐藏空白字符变更
内嵌
并排
正在显示
18 个修改的文件
包含
1682 行增加
和
4 行删除
+1682
-4
AndroidManifest.xml
app/src/main/AndroidManifest.xml
+33
-0
DeviceBean.java
app/src/main/java/com/wd/workoffice/bean/DeviceBean.java
+0
-0
ApiService.java
app/src/main/java/com/wd/workoffice/retrofit/ApiService.java
+8
-0
WorkDeviceBuyActivity.java
...orkoffice/ui/activity/bat/work/WorkDeviceBuyActivity.java
+3
-3
WorkDeviceBuyAddActivity.java
...office/ui/activity/bat/work/WorkDeviceBuyAddActivity.java
+134
-0
WorkDeviceBuyCarActivity.java
...office/ui/activity/bat/work/WorkDeviceBuyCarActivity.java
+139
-0
WorkDeviceBuyConfirmActivity.java
...ce/ui/activity/bat/work/WorkDeviceBuyConfirmActivity.java
+230
-0
WorkDeviceBuyProductActivity.java
...ce/ui/activity/bat/work/WorkDeviceBuyProductActivity.java
+251
-0
DeviceCarAdapter.java
...n/java/com/wd/workoffice/ui/adapter/DeviceCarAdapter.java
+77
-0
DeviceConfirmAdapter.java
...va/com/wd/workoffice/ui/adapter/DeviceConfirmAdapter.java
+44
-0
DeviceProductAdapter.java
...va/com/wd/workoffice/ui/adapter/DeviceProductAdapter.java
+32
-0
activity_device_buy.xml
app/src/main/res/layout/activity_device_buy.xml
+148
-0
activity_device_buy_confirm.xml
app/src/main/res/layout/activity_device_buy_confirm.xml
+178
-0
activity_device_buy_pro.xml
app/src/main/res/layout/activity_device_buy_pro.xml
+15
-0
item_device_car.xml
app/src/main/res/layout/item_device_car.xml
+164
-0
item_device_confirm.xml
app/src/main/res/layout/item_device_confirm.xml
+129
-0
item_device_product.xml
app/src/main/res/layout/item_device_product.xml
+97
-0
item_device_repair.xml
app/src/main/res/layout/item_device_repair.xml
+0
-1
没有找到文件。
app/src/main/AndroidManifest.xml
浏览文件 @
5d22fd3b
...
@@ -2010,6 +2010,39 @@
...
@@ -2010,6 +2010,39 @@
android:theme=
"@style/Work.Base"
android:theme=
"@style/Work.Base"
android:windowSoftInputMode=
"adjustPan"
/>
android:windowSoftInputMode=
"adjustPan"
/>
<activity
android:name=
".ui.activity.bat.work.WorkDeviceBuyAddActivity"
android:configChanges=
"keyboardHidden|orientation"
android:label=
"添加设备采购"
android:launchMode=
"singleTop"
android:screenOrientation=
"portrait"
android:theme=
"@style/Work.Base"
android:windowSoftInputMode=
"adjustPan"
/>
<activity
android:name=
".ui.activity.bat.work.WorkDeviceBuyProductActivity"
android:configChanges=
"keyboardHidden|orientation"
android:label=
"选择产品"
android:launchMode=
"singleTop"
android:screenOrientation=
"portrait"
android:theme=
"@style/Work.Base"
android:windowSoftInputMode=
"adjustPan"
/>
<activity
android:name=
".ui.activity.bat.work.WorkDeviceBuyCarActivity"
android:configChanges=
"keyboardHidden|orientation"
android:label=
"购物车"
android:launchMode=
"singleTop"
android:screenOrientation=
"portrait"
android:theme=
"@style/Work.Base"
android:windowSoftInputMode=
"adjustPan"
/>
<activity
android:name=
".ui.activity.bat.work.WorkDeviceBuyConfirmActivity"
android:configChanges=
"keyboardHidden|orientation"
android:label=
"确认"
android:launchMode=
"singleTop"
android:screenOrientation=
"portrait"
android:theme=
"@style/Work.Base"
android:windowSoftInputMode=
"adjustPan"
/>
<provider
<provider
android:name=
"androidx.core.content.FileProvider"
android:name=
"androidx.core.content.FileProvider"
android:authorities=
"com.wd.workoffice.fileprovider"
android:authorities=
"com.wd.workoffice.fileprovider"
...
...
app/src/main/java/com/wd/workoffice/bean/DeviceBean.java
浏览文件 @
5d22fd3b
No preview for this file type
app/src/main/java/com/wd/workoffice/retrofit/ApiService.java
浏览文件 @
5d22fd3b
...
@@ -1783,4 +1783,12 @@ public interface ApiService {
...
@@ -1783,4 +1783,12 @@ public interface ApiService {
*/
*/
@GET
(
"/equipmentPurchase/page/list"
)
@GET
(
"/equipmentPurchase/page/list"
)
Observable
<
BaseBean
>
equipmentPurchaseList
(
@QueryMap
Map
<
String
,
Object
>
param
);
Observable
<
BaseBean
>
equipmentPurchaseList
(
@QueryMap
Map
<
String
,
Object
>
param
);
/**
* 获取设备采购
*
* @return
*/
@POST
(
"/equipmentPurchase"
)
Observable
<
BaseBean
>
addEquipmentPurchase
(
@Body
RequestBody
requestBody
);
}
}
app/src/main/java/com/wd/workoffice/ui/activity/bat/work/WorkDeviceBuyActivity.java
浏览文件 @
5d22fd3b
...
@@ -82,15 +82,15 @@ public class WorkDeviceBuyActivity extends WorkToolBarActivity {
...
@@ -82,15 +82,15 @@ public class WorkDeviceBuyActivity extends WorkToolBarActivity {
@Override
@Override
public
boolean
onCreateOptionsMenu
(
Menu
menu
)
{
public
boolean
onCreateOptionsMenu
(
Menu
menu
)
{
getMenuInflater
().
inflate
(
R
.
menu
.
menu_
search
,
menu
);
getMenuInflater
().
inflate
(
R
.
menu
.
menu_
add
,
menu
);
return
super
.
onCreateOptionsMenu
(
menu
);
return
super
.
onCreateOptionsMenu
(
menu
);
}
}
@Override
@Override
public
boolean
onOptionsItemSelected
(
MenuItem
item
)
{
public
boolean
onOptionsItemSelected
(
MenuItem
item
)
{
switch
(
item
.
getItemId
())
{
switch
(
item
.
getItemId
())
{
case
R
.
id
.
search
:
case
R
.
id
.
add
:
startActivity
(
CrucibleOrderSearchActivity
.
class
,
"identity"
,
getIntent
().
getStringExtra
(
"identity"
)
);
startActivity
(
WorkDeviceBuyAddActivity
.
class
);
break
;
break
;
}
}
return
super
.
onOptionsItemSelected
(
item
);
return
super
.
onOptionsItemSelected
(
item
);
...
...
app/src/main/java/com/wd/workoffice/ui/activity/bat/work/WorkDeviceBuyAddActivity.java
0 → 100644
浏览文件 @
5d22fd3b
package
com
.
wd
.
workoffice
.
ui
.
activity
.
bat
.
work
;
import
android.content.DialogInterface
;
import
android.content.Intent
;
import
android.os.Bundle
;
import
android.view.View
;
import
android.widget.RelativeLayout
;
import
android.widget.TextView
;
import
com.alibaba.fastjson.JSON
;
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.DepBean
;
import
com.wd.workoffice.bean.ProcessBean
;
import
com.wd.workoffice.bean.StockBean
;
import
com.wd.workoffice.bean.workEnum.PagePermissionType
;
import
com.wd.workoffice.bean.workEnum.PermissionType
;
import
com.wd.workoffice.contract.BatSaleContract
;
import
com.wd.workoffice.presenter.BatSalePresenter
;
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.activity.bat.store.StoreSaleProductActivity
;
import
com.wd.workoffice.util.DialogUtils
;
import
com.wd.workoffice.util.WorkUtils
;
import
java.util.ArrayList
;
import
java.util.List
;
import
androidx.annotation.Nullable
;
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
WorkDeviceBuyAddActivity
extends
WorkToolBarActivity
{
@BindView
(
R
.
id
.
tv_dep
)
TextView
tvDep
;
@BindView
(
R
.
id
.
rl_dep
)
RelativeLayout
rlDep
;
@BindView
(
R
.
id
.
tv_product
)
TextView
tvProduct
;
@BindView
(
R
.
id
.
rl_product
)
RelativeLayout
rlProduct
;
private
QMUIDialog
.
MenuDialogBuilder
depDialog
;
private
List
<
DepBean
>
depList
;
List
<
String
>
depNameList
=
new
ArrayList
<>();
private
DepBean
chooseDep
;
@Override
protected
void
initView
()
{
ButterKnife
.
bind
(
this
);
depDialog
=
DialogUtils
.
listDialog
(
this
);
}
@Override
protected
void
initData
()
{
// batSalePresenter.getDep(PermissionType.REPAIR_BUY.getCode());
RtfUtils
.
getRtf
().
depList
().
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
<
DepBean
>
getList
=
JSON
.
parseArray
(
data
.
getData
().
toString
(),
DepBean
.
class
);
depList
=
getList
;
depNameList
.
clear
();
for
(
DepBean
dep
:
getList
)
{
depNameList
.
add
(
dep
.
getName
());
}
depDialog
.
addItems
(
depNameList
.
toArray
(
new
String
[
depNameList
.
size
()]),
new
DialogInterface
.
OnClickListener
()
{
@Override
public
void
onClick
(
DialogInterface
dialog
,
int
which
)
{
chooseDep
=
depList
.
get
(
which
);
tvDep
.
setText
(
depNameList
.
get
(
which
));
dialog
.
dismiss
();
}
});
}
});
}
@Override
protected
void
initEvent
()
{
}
@Override
protected
int
layoutId
()
{
return
R
.
layout
.
activity_device_buy
;
}
@OnClick
({
R
.
id
.
rl_dep
,
R
.
id
.
rl_product
})
public
void
onViewClicked
(
View
view
)
{
switch
(
view
.
getId
())
{
case
R
.
id
.
rl_dep
:
depDialog
.
show
();
break
;
case
R
.
id
.
rl_product
:
if
(
chooseDep
==
null
)
{
toast
(
"请选择接单部门"
);
return
;
}
startActivity
(
WorkDeviceBuyProductActivity
.
class
,
"depId"
,
chooseDep
.
getId
()
+
""
,
"depName"
,
chooseDep
.
getName
()
+
""
);
break
;
}
}
}
app/src/main/java/com/wd/workoffice/ui/activity/bat/work/WorkDeviceBuyCarActivity.java
0 → 100644
浏览文件 @
5d22fd3b
package
com
.
wd
.
workoffice
.
ui
.
activity
.
bat
.
work
;
import
android.view.View
;
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.qmuiteam.qmui.widget.dialog.QMUIDialogAction
;
import
com.wd.workoffice.R
;
import
com.wd.workoffice.app.WorkToolBarActivity
;
import
com.wd.workoffice.bean.DeviceBean
;
import
com.wd.workoffice.bean.ProductBean
;
import
com.wd.workoffice.bean.event.ModifyCarEvent
;
import
com.wd.workoffice.ui.activity.bat.store.StoreSaleConfirmActivity
;
import
com.wd.workoffice.ui.adapter.DeviceCarAdapter
;
import
com.wd.workoffice.ui.adapter.StoreCarAdapter
;
import
com.wd.workoffice.util.DialogUtils
;
import
com.wd.workoffice.util.MathUtils
;
import
org.greenrobot.eventbus.EventBus
;
import
org.greenrobot.eventbus.Subscribe
;
import
org.greenrobot.eventbus.ThreadMode
;
import
java.util.ArrayList
;
import
java.util.List
;
import
androidx.recyclerview.widget.LinearLayoutManager
;
import
androidx.recyclerview.widget.RecyclerView
;
import
butterknife.BindView
;
import
butterknife.ButterKnife
;
import
butterknife.OnClick
;
/**
* 设备采购-购物车
* author : flexible
* email : lgd19940421@163.com
* github: https://github.com/FlexibleXd
**/
public
class
WorkDeviceBuyCarActivity
extends
WorkToolBarActivity
{
@BindView
(
R
.
id
.
tv_num
)
TextView
tvNum
;
@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
<
DeviceBean
.
RecordsBean
>
productList
;
private
DeviceCarAdapter
productAdapter
;
@Override
protected
void
initView
()
{
ButterKnife
.
bind
(
this
);
rvProduct
.
setLayoutManager
(
new
LinearLayoutManager
(
this
,
RecyclerView
.
VERTICAL
,
false
));
}
@Override
protected
void
initData
()
{
productList
=
new
ArrayList
<>();
productAdapter
=
new
DeviceCarAdapter
(
R
.
layout
.
item_device_car
,
productList
);
productAdapter
.
bindToRecyclerView
(
rvProduct
);
String
pro
=
getIntent
().
getStringExtra
(
"pro"
);
productList
.
addAll
(
JSON
.
parseArray
(
pro
,
DeviceBean
.
RecordsBean
.
class
));
productAdapter
.
notifyDataSetChanged
();
changeNumAndPrice
();
}
@Override
protected
void
initEvent
()
{
productAdapter
.
setOnItemChildClickListener
(
new
BaseQuickAdapter
.
OnItemChildClickListener
()
{
@Override
public
void
onItemChildClick
(
BaseQuickAdapter
adapter
,
View
view
,
int
position
)
{
QMUIDialog
.
MessageDialogBuilder
dialog
=
DialogUtils
.
okAndCancelDialog
(
WorkDeviceBuyCarActivity
.
this
);
dialog
.
setMessage
(
"是否删除"
).
addAction
(
"取消"
,
new
QMUIDialogAction
.
ActionListener
()
{
@Override
public
void
onClick
(
QMUIDialog
dialog
,
int
index
)
{
dialog
.
dismiss
();
}
}).
addAction
(
"确定"
,
new
QMUIDialogAction
.
ActionListener
()
{
@Override
public
void
onClick
(
QMUIDialog
dialog
,
int
index
)
{
dialog
.
dismiss
();
productList
.
remove
(
position
);
productAdapter
.
notifyDataSetChanged
();
EventBus
.
getDefault
().
post
(
new
ModifyCarEvent
(
JSON
.
toJSONString
(
productList
)));
}
}).
show
();
}
});
}
@Override
protected
int
layoutId
()
{
return
R
.
layout
.
activity_bat_shopcar
;
}
@OnClick
(
R
.
id
.
tv_ok
)
public
void
onViewClicked
()
{
String
allPrice
=
""
;
for
(
DeviceBean
.
RecordsBean
recordsBean
:
productList
)
{
allPrice
=
MathUtils
.
add
(
allPrice
,
MathUtils
.
multiply
(
recordsBean
.
getCarNum
()
+
""
,
recordsBean
.
getCarPrice
()+
""
,
2
),
2
);
}
startActivity
(
WorkDeviceBuyConfirmActivity
.
class
,
"pro"
,
JSON
.
toJSONString
(
productList
),
"depId"
,
getIntent
().
getStringExtra
(
"depId"
),
"depName"
,
getIntent
().
getStringExtra
(
"depName"
),
"launchOrderAmount"
,
allPrice
);
}
@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
()
{
tvNum
.
setText
(
"共 "
.
concat
(
productList
.
size
()
+
""
).
concat
(
" 件"
));
String
allPrice
=
""
;
for
(
DeviceBean
.
RecordsBean
recordsBean
:
productList
)
{
allPrice
=
MathUtils
.
add
(
allPrice
,
MathUtils
.
multiply
(
recordsBean
.
getCarNum
()
+
""
,
recordsBean
.
getCarPrice
()+
""
,
2
),
2
);
}
tvPrice
.
setText
(
"总计: ¥ "
.
concat
(
allPrice
));
}
}
app/src/main/java/com/wd/workoffice/ui/activity/bat/work/WorkDeviceBuyConfirmActivity.java
0 → 100644
浏览文件 @
5d22fd3b
package
com
.
wd
.
workoffice
.
ui
.
activity
.
bat
.
work
;
import
android.Manifest
;
import
android.content.DialogInterface
;
import
android.content.Intent
;
import
android.content.pm.ActivityInfo
;
import
android.os.Bundle
;
import
android.text.Editable
;
import
android.text.TextUtils
;
import
android.text.TextWatcher
;
import
android.view.View
;
import
android.widget.EditText
;
import
android.widget.RelativeLayout
;
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.qmuiteam.qmui.widget.dialog.QMUIDialog
;
import
com.qmuiteam.qmui.widget.dialog.QMUIDialogAction
;
import
com.tbruyelle.rxpermissions2.RxPermissions
;
import
com.wd.workoffice.R
;
import
com.wd.workoffice.app.BaseBean
;
import
com.wd.workoffice.app.WorkToolBarActivity
;
import
com.wd.workoffice.bean.DeviceBean
;
import
com.wd.workoffice.bean.ProductBean
;
import
com.wd.workoffice.bean.workEnum.PermissionType
;
import
com.wd.workoffice.retrofit.ApiService
;
import
com.wd.workoffice.retrofit.RtfUtils
;
import
com.wd.workoffice.retrofit.WorkObserver
;
import
com.wd.workoffice.ui.activity.bat.store.StoreClientFactoryActivity
;
import
com.wd.workoffice.ui.activity.bat.store.StoreOrderSuccessActivity
;
import
com.wd.workoffice.ui.adapter.DeviceConfirmAdapter
;
import
com.wd.workoffice.ui.adapter.StoreCarAdapter
;
import
com.wd.workoffice.util.DialogUtils
;
import
com.wd.workoffice.util.Glide4Engine
;
import
com.wd.workoffice.util.MathUtils
;
import
com.wd.workoffice.util.PickTimeUtils
;
import
com.wd.workoffice.util.UserKeeper
;
import
com.wd.workoffice.util.WorkUtils
;
import
com.zhihu.matisse.Matisse
;
import
com.zhihu.matisse.MimeType
;
import
com.zhihu.matisse.internal.entity.CaptureStrategy
;
import
java.io.File
;
import
java.text.SimpleDateFormat
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
androidx.annotation.Nullable
;
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.RtfHelper
;
import
flexible.xd.android_base.network.rtfhttp.Transformer
;
import
flexible.xd.android_base.utils.TimeUtils
;
import
io.reactivex.Observable
;
import
io.reactivex.disposables.Disposable
;
import
okhttp3.MediaType
;
import
okhttp3.MultipartBody
;
import
okhttp3.RequestBody
;
/**
* 采购-确认订单
* author : flexible
* email : lgd19940421@163.com
* github: https://github.com/FlexibleXd
**/
public
class
WorkDeviceBuyConfirmActivity
extends
WorkToolBarActivity
{
@BindView
(
R
.
id
.
tv_num
)
TextView
tvNum
;
@BindView
(
R
.
id
.
tv_price
)
TextView
tvPrice
;
@BindView
(
R
.
id
.
tv_ok
)
TextView
tvOk
;
@BindView
(
R
.
id
.
ll_bottom
)
RelativeLayout
llBottom
;
@BindView
(
R
.
id
.
tv_dep
)
TextView
tvDep
;
@BindView
(
R
.
id
.
rl_set
)
RelativeLayout
rlSet
;
@BindView
(
R
.
id
.
rv_pro
)
RecyclerView
rvPro
;
@BindView
(
R
.
id
.
et_input5
)
EditText
etInput5
;
@BindView
(
R
.
id
.
tv_input5
)
TextView
tvInput5
;
private
List
<
DeviceBean
.
RecordsBean
>
proList
;
private
DeviceConfirmAdapter
proAdapter
;
private
Map
<
String
,
Object
>
param
;
private
Map
<
String
,
Object
>
expandInfo
;
private
List
<
JSONObject
>
orderItems
;
private
Integer
choosePosition
;
@Override
protected
void
initView
()
{
ButterKnife
.
bind
(
this
);
rvPro
.
setLayoutManager
(
new
LinearLayoutManager
(
this
,
RecyclerView
.
VERTICAL
,
false
));
}
@Override
protected
void
initData
()
{
tvDep
.
setText
(
getIntent
().
getStringExtra
(
"depName"
));
proList
=
new
ArrayList
<>();
proAdapter
=
new
DeviceConfirmAdapter
(
R
.
layout
.
item_device_confirm
,
proList
);
proAdapter
.
bindToRecyclerView
(
rvPro
);
proList
.
addAll
(
JSON
.
parseArray
(
getIntent
().
getStringExtra
(
"pro"
),
DeviceBean
.
RecordsBean
.
class
));
proAdapter
.
notifyDataSetChanged
();
changeNumAndPrice
();
param
=
new
HashMap
<>();
param
.
put
(
"receiveDeptId"
,
getIntent
().
getStringExtra
(
"depId"
));
expandInfo
=
new
HashMap
<>();
}
/**
* 转换pro,生成上传参数
*
* @param proList
* @return
*/
private
List
<
JSONObject
>
coverProInfo
(
List
<
DeviceBean
.
RecordsBean
>
proList
)
{
List
<
JSONObject
>
orderItems
=
new
ArrayList
<>();
for
(
DeviceBean
.
RecordsBean
recordsBean
:
proList
)
{
JSONObject
data
=
new
JSONObject
();
data
.
put
(
"equipmentId"
,
recordsBean
.
getId
());
data
.
put
(
"quantity"
,
recordsBean
.
getCarNum
());
data
.
put
(
"unitPrice"
,
recordsBean
.
getCarPrice
());
orderItems
.
add
(
data
);
}
return
orderItems
;
}
@Override
protected
void
initEvent
()
{
addNumListener
(
etInput5
,
tvInput5
);
}
/**
* 添加字数监听器
*
* @param et
* @param tv
*/
private
void
addNumListener
(
EditText
et
,
TextView
tv
)
{
et
.
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
)
{
tv
.
setText
(
s
.
length
()
+
"/140"
);
}
});
}
@Override
protected
int
layoutId
()
{
return
R
.
layout
.
activity_device_buy_confirm
;
}
@OnClick
({
R
.
id
.
tv_ok
})
public
void
onViewClicked
(
View
view
)
{
switch
(
view
.
getId
())
{
case
R
.
id
.
tv_ok
:
expandInfo
.
put
(
"remark"
,
etInput5
.
getText
().
toString
());
orderItems
=
coverProInfo
(
proList
);
submitOrder
();
break
;
}
}
/**
* 下单
*/
private
void
submitOrder
()
{
param
.
put
(
"equipmentPurchaseItem"
,
orderItems
);
showLoading
();
RtfUtils
.
getRtf
().
addEquipmentPurchase
(
WorkUtils
.
convertMapToBody
(
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
;
}
toast
(
"下单成功"
);
startActivity
(
StoreOrderSuccessActivity
.
class
);
}
});
}
private
void
changeNumAndPrice
()
{
tvNum
.
setText
(
"共 "
.
concat
(
proList
.
size
()
+
""
).
concat
(
" 件"
));
String
allPrice
=
""
;
for
(
DeviceBean
.
RecordsBean
recordsBean
:
proList
)
{
allPrice
=
MathUtils
.
add
(
allPrice
,
MathUtils
.
multiply
(
recordsBean
.
getCarNum
()
+
""
,
recordsBean
.
getCarPrice
()
+
""
,
2
),
2
);
}
tvPrice
.
setText
(
"总计: ¥ "
.
concat
(
allPrice
));
}
}
app/src/main/java/com/wd/workoffice/ui/activity/bat/work/WorkDeviceBuyProductActivity.java
0 → 100644
浏览文件 @
5d22fd3b
package
com
.
wd
.
workoffice
.
ui
.
activity
.
bat
.
work
;
import
android.os.Bundle
;
import
android.text.TextUtils
;
import
android.view.LayoutInflater
;
import
android.view.Menu
;
import
android.view.MenuItem
;
import
android.view.View
;
import
android.widget.EditText
;
import
android.widget.LinearLayout
;
import
android.widget.TextView
;
import
com.alibaba.fastjson.JSON
;
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.DeviceBean
;
import
com.wd.workoffice.bean.ProductBean
;
import
com.wd.workoffice.bean.event.ModifyCarEvent
;
import
com.wd.workoffice.bean.workEnum.PermissionType
;
import
com.wd.workoffice.retrofit.RtfUtils
;
import
com.wd.workoffice.retrofit.WorkObserver
;
import
com.wd.workoffice.ui.activity.bat.store.StoreSaleCarActivity
;
import
com.wd.workoffice.ui.adapter.DeviceProductAdapter
;
import
com.wd.workoffice.ui.adapter.StoreProductAdapter
;
import
com.wd.workoffice.util.WorkUtils
;
import
com.wd.workoffice.widget.AddAndReduceView
;
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.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
WorkDeviceBuyProductActivity
extends
WorkToolBarActivity
{
@BindView
(
R
.
id
.
rv_product
)
RecyclerView
rvProduct
;
private
Map
<
String
,
Object
>
param
;
private
List
<
DeviceBean
.
RecordsBean
>
clientList
;
private
DeviceProductAdapter
clientAdapter
;
private
int
page
=
1
;
private
List
<
DeviceBean
.
RecordsBean
>
carList
=
new
ArrayList
<>();
@Override
protected
void
initView
()
{
ButterKnife
.
bind
(
this
);
rvProduct
.
setLayoutManager
(
new
LinearLayoutManager
(
this
,
RecyclerView
.
VERTICAL
,
false
));
}
@Override
protected
void
onResume
()
{
super
.
onResume
();
}
private
void
openDialog
(
DeviceBean
.
RecordsBean
data
)
{
AlertDialog
.
Builder
builder
=
new
AlertDialog
.
Builder
(
this
);
View
view
=
LayoutInflater
.
from
(
this
).
inflate
(
R
.
layout
.
view_add_cart
,
null
);
LinearLayout
llPrice
=
view
.
findViewById
(
R
.
id
.
ll_price
);
TextView
tvOk
=
view
.
findViewById
(
R
.
id
.
tv_ok
);
TextView
tvCancel
=
view
.
findViewById
(
R
.
id
.
tv_cancel
);
AddAndReduceView
num
=
view
.
findViewById
(
R
.
id
.
ar_num
);
EditText
etPrice
=
view
.
findViewById
(
R
.
id
.
et_price
);
for
(
DeviceBean
.
RecordsBean
recordsBean
:
carList
)
{
if
(
data
.
getId
()
==
recordsBean
.
getId
())
{
etPrice
.
setText
(
recordsBean
.
getCarPrice
());
num
.
setNumber
(
recordsBean
.
getCarNum
());
}
}
etPrice
.
setHint
(
"请输入价格"
);
builder
.
setView
(
view
);
AlertDialog
addCartDialog
=
builder
.
create
();
tvOk
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
public
void
onClick
(
View
v
)
{
if
(
TextUtils
.
isEmpty
(
etPrice
.
getText
().
toString
()))
{
toast
(
"请填写外部价格"
);
return
;
}
addCart
(
data
,
num
.
getNumber
(),
etPrice
.
getText
().
toString
());
addCartDialog
.
dismiss
();
}
});
tvCancel
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
public
void
onClick
(
View
v
)
{
addCartDialog
.
dismiss
();
}
});
addCartDialog
.
show
();
}
/**
* 添加购物车
*
* @param chooseProduct 产品
* @param number 数量
* @param price 单价
*/
private
void
addCart
(
DeviceBean
.
RecordsBean
chooseProduct
,
int
number
,
String
price
)
{
boolean
isHas
=
false
;
for
(
DeviceBean
.
RecordsBean
recordsBean
:
carList
)
{
if
(
chooseProduct
.
getId
()
==
recordsBean
.
getId
())
{
isHas
=
true
;
recordsBean
.
setCarNum
(
number
);
recordsBean
.
setCarPrice
(
price
);
}
}
if
(!
isHas
)
{
chooseProduct
.
setCarNum
(
number
);
chooseProduct
.
setCarPrice
(
price
);
carList
.
add
(
chooseProduct
);
}
toast
(
"加入购物车成功"
);
}
@Override
protected
void
initData
()
{
clientList
=
new
ArrayList
<>();
clientAdapter
=
new
DeviceProductAdapter
(
R
.
layout
.
item_device_product
,
clientList
);
clientAdapter
.
bindToRecyclerView
(
rvProduct
);
param
=
WorkUtils
.
pageKey
();
param
.
put
(
"current"
,
1
);
param
.
put
(
"parentId"
,
0
);
getData
();
}
private
void
getData
()
{
RtfUtils
.
getRtf
().
equipmentList
(
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
<
DeviceBean
.
RecordsBean
>
getList
=
JSON
.
parseObject
(
data
.
getData
().
toString
(),
DeviceBean
.
class
).
getRecords
();
if
(
page
==
1
)
{
clientList
.
clear
();
clientList
.
addAll
(
getList
);
clientAdapter
.
notifyDataSetChanged
();
clientAdapter
.
loadMoreComplete
();
}
else
{
clientAdapter
.
loadMoreComplete
();
clientList
.
addAll
(
getList
);
clientAdapter
.
notifyDataSetChanged
();
}
if
(
getList
.
size
()
==
0
)
{
clientAdapter
.
loadMoreEnd
();
}
else
{
page
++;
}
}
});
}
@Override
protected
void
initEvent
()
{
clientAdapter
.
setOnLoadMoreListener
(
new
BaseQuickAdapter
.
RequestLoadMoreListener
()
{
@Override
public
void
onLoadMoreRequested
()
{
param
.
put
(
"current"
,
page
);
getData
();
}
},
rvProduct
);
clientAdapter
.
setOnItemChildClickListener
(
new
BaseQuickAdapter
.
OnItemChildClickListener
()
{
@Override
public
void
onItemChildClick
(
BaseQuickAdapter
adapter
,
View
view
,
int
position
)
{
openDialog
(
clientList
.
get
(
position
));
}
});
}
@Override
protected
int
layoutId
()
{
return
R
.
layout
.
activity_device_buy_pro
;
}
@Override
public
boolean
onCreateOptionsMenu
(
Menu
menu
)
{
getMenuInflater
().
inflate
(
R
.
menu
.
menu_store_cart
,
menu
);
return
super
.
onCreateOptionsMenu
(
menu
);
}
@Override
public
boolean
onOptionsItemSelected
(
MenuItem
item
)
{
switch
(
item
.
getItemId
())
{
case
R
.
id
.
cart
:
if
(
carList
.
size
()
==
0
)
{
toast
(
"购物车没有产品"
);
return
super
.
onOptionsItemSelected
(
item
);
}
startActivity
(
WorkDeviceBuyCarActivity
.
class
,
"pro"
,
JSON
.
toJSONString
(
carList
),
"depId"
,
getIntent
().
getStringExtra
(
"depId"
),
"depName"
,
getIntent
().
getStringExtra
(
"depName"
));
break
;
}
return
super
.
onOptionsItemSelected
(
item
);
}
@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
)
{
String
pro
=
event
.
getPro
();
carList
.
clear
();
carList
.
addAll
(
JSON
.
parseArray
(
pro
,
DeviceBean
.
RecordsBean
.
class
));
}
}
app/src/main/java/com/wd/workoffice/ui/adapter/DeviceCarAdapter.java
0 → 100644
浏览文件 @
5d22fd3b
package
com
.
wd
.
workoffice
.
ui
.
adapter
;
import
android.text.Editable
;
import
android.text.TextUtils
;
import
android.text.TextWatcher
;
import
android.widget.EditText
;
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.DeviceBean
;
import
com.wd.workoffice.bean.ProductBean
;
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.List
;
import
flexible.xd.android_base.utils.ToastUtil
;
/**
* Created by flexible on 2018/8/13.
*/
public
class
DeviceCarAdapter
extends
BaseQuickAdapter
<
DeviceBean
.
RecordsBean
,
BaseViewHolder
>
{
public
DeviceCarAdapter
(
int
layoutResId
,
List
data
)
{
super
(
layoutResId
,
data
);
}
@Override
protected
void
convert
(
BaseViewHolder
helper
,
DeviceBean
.
RecordsBean
item
)
{
helper
.
setText
(
R
.
id
.
tv_name
,
item
.
getTitle
());
helper
.
setText
(
R
.
id
.
tv_spec
,
item
.
getSpecification
());
helper
.
setText
(
R
.
id
.
tv_all_price
,
MathUtils
.
multiply
(
item
.
getCarNum
()
+
""
,
item
.
getCarPrice
()+
""
,
2
));
AddAndReduceView
num
=
helper
.
getView
(
R
.
id
.
ar_num
);
num
.
setOnNumberChangedListener
(
new
AddAndReduceView
.
OnNumberChangedListener
()
{
@Override
public
void
OnNumberChanged
(
int
vs
)
{
item
.
setCarNum
(
vs
);
helper
.
setText
(
R
.
id
.
tv_all_price
,
MathUtils
.
multiply
(
vs
+
""
,
item
.
getCarPrice
(),
2
));
EventBus
.
getDefault
().
post
(
new
ModifyCarEvent
(
JSON
.
toJSONString
(
getData
())));
}
});
EditText
etPrice
=
helper
.
getView
(
R
.
id
.
et_price
);
etPrice
.
setText
(
item
.
getCarPrice
());
etPrice
.
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
)
{
if
(
TextUtils
.
isEmpty
(
s
))
{
ToastUtil
.
showShort
(
"请输入外部单价"
);
return
;
}
item
.
setCarPrice
(
s
.
toString
());
helper
.
setText
(
R
.
id
.
tv_all_price
,
MathUtils
.
multiply
(
item
.
getCarNum
()
+
""
,
item
.
getCarPrice
(),
2
));
EventBus
.
getDefault
().
post
(
new
ModifyCarEvent
(
JSON
.
toJSONString
(
getData
())));
}
});
num
.
setNumber
(
item
.
getCarNum
());
}
}
app/src/main/java/com/wd/workoffice/ui/adapter/DeviceConfirmAdapter.java
0 → 100644
浏览文件 @
5d22fd3b
package
com
.
wd
.
workoffice
.
ui
.
adapter
;
import
android.text.Editable
;
import
android.text.TextUtils
;
import
android.text.TextWatcher
;
import
android.widget.EditText
;
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.DeviceBean
;
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.List
;
import
flexible.xd.android_base.utils.ToastUtil
;
/**
* Created by flexible on 2018/8/13.
*/
public
class
DeviceConfirmAdapter
extends
BaseQuickAdapter
<
DeviceBean
.
RecordsBean
,
BaseViewHolder
>
{
public
DeviceConfirmAdapter
(
int
layoutResId
,
List
data
)
{
super
(
layoutResId
,
data
);
}
@Override
protected
void
convert
(
BaseViewHolder
helper
,
DeviceBean
.
RecordsBean
item
)
{
helper
.
setText
(
R
.
id
.
tv_name
,
item
.
getTitle
());
helper
.
setText
(
R
.
id
.
tv_spec
,
item
.
getSpecification
());
helper
.
setText
(
R
.
id
.
tv_price
,
item
.
getCarPrice
());
helper
.
setText
(
R
.
id
.
tv_num
,
item
.
getCarNum
()
+
""
);
helper
.
setText
(
R
.
id
.
tv_all_price
,
MathUtils
.
multiply
(
item
.
getCarNum
()
+
""
,
item
.
getCarPrice
()
+
""
,
2
));
}
}
app/src/main/java/com/wd/workoffice/ui/adapter/DeviceProductAdapter.java
0 → 100644
浏览文件 @
5d22fd3b
package
com
.
wd
.
workoffice
.
ui
.
adapter
;
import
com.chad.library.adapter.base.BaseQuickAdapter
;
import
com.chad.library.adapter.base.BaseViewHolder
;
import
com.wd.workoffice.R
;
import
com.wd.workoffice.bean.DeviceBean
;
import
com.wd.workoffice.bean.ProductBean
;
import
java.util.List
;
import
androidx.annotation.Nullable
;
/**
* Created by flexible on 2018/8/13.
*/
public
class
DeviceProductAdapter
extends
BaseQuickAdapter
<
DeviceBean
.
RecordsBean
,
BaseViewHolder
>
{
public
DeviceProductAdapter
(
int
layoutResId
,
List
data
)
{
super
(
layoutResId
,
data
);
}
@Override
protected
void
convert
(
BaseViewHolder
helper
,
DeviceBean
.
RecordsBean
item
)
{
helper
.
setText
(
R
.
id
.
tv_name
,
item
.
getTitle
());
helper
.
setText
(
R
.
id
.
tv_spec
,
item
.
getSpecification
());
helper
.
addOnClickListener
(
R
.
id
.
tv_cart
);
}
}
app/src/main/res/layout/activity_device_buy.xml
0 → 100644
浏览文件 @
5d22fd3b
<?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"
>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:orientation=
"vertical"
>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:orientation=
"vertical"
>
<TextView
android:layout_width=
"match_parent"
android:layout_height=
"60mm"
android:layout_centerInParent=
"true"
android:gravity=
"center"
android:text=
"第一步"
android:textColor=
"#ff9eaab1"
android:textSize=
"16sp"
/>
<RelativeLayout
android:id=
"@+id/rl_dep"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
android:background=
"@color/white"
android:gravity=
"center"
android:paddingHorizontal=
"20mm"
android:paddingVertical=
"22mm"
>
<LinearLayout
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_alignParentLeft=
"true"
android:gravity=
"center_vertical"
>
<View
android:layout_width=
"12mm"
android:layout_height=
"12mm"
android:background=
"#C45D5D"
/>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_centerVertical=
"true"
android:layout_marginLeft=
"10mm"
android:text=
"选择接单部门"
android:textSize=
"16sp"
/>
</LinearLayout>
<LinearLayout
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_alignParentRight=
"true"
android:gravity=
"center_vertical"
>
<TextView
android:id=
"@+id/tv_dep"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginRight=
"10mm"
android:text=
"请选择接单部门"
android:textSize=
"16sp"
android:textStyle=
"bold"
/>
<ImageView
android:layout_width=
"6mm"
android:layout_height=
"10mm"
android:background=
"@mipmap/arrow_right_blue"
/>
</LinearLayout>
</RelativeLayout>
<TextView
android:layout_width=
"match_parent"
android:layout_height=
"60mm"
android:layout_centerInParent=
"true"
android:gravity=
"center"
android:text=
"第二步"
android:textColor=
"#ff9eaab1"
android:textSize=
"16sp"
/>
<!--Product selection-->
<RelativeLayout
android:id=
"@+id/rl_product"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
android:background=
"@color/white"
android:gravity=
"center"
android:paddingHorizontal=
"20mm"
android:paddingVertical=
"22mm"
>
<LinearLayout
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_alignParentLeft=
"true"
android:gravity=
"center_vertical"
>
<View
android:layout_width=
"12mm"
android:layout_height=
"12mm"
android:background=
"#359486"
/>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_centerVertical=
"true"
android:layout_marginLeft=
"10mm"
android:text=
"选择产品"
android:textSize=
"16sp"
/>
</LinearLayout>
<LinearLayout
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_alignParentRight=
"true"
android:gravity=
"center_vertical"
>
<TextView
android:id=
"@+id/tv_product"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginRight=
"10mm"
android:textSize=
"16sp"
android:textStyle=
"bold"
/>
<ImageView
android:layout_width=
"6mm"
android:layout_height=
"10mm"
android:layout_alignParentRight=
"true"
android:layout_centerVertical=
"true"
android:background=
"@mipmap/arrow_right_blue"
/>
</LinearLayout>
</RelativeLayout>
</LinearLayout>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
app/src/main/res/layout/activity_device_buy_confirm.xml
0 → 100644
浏览文件 @
5d22fd3b
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
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"
>
<LinearLayout
android:layout_width=
"wrap_content"
android:layout_height=
"match_parent"
android:layout_alignParentLeft=
"true"
android:layout_marginLeft=
"15mm"
android:gravity=
"center_vertical"
android:orientation=
"vertical"
>
<TextView
android:id=
"@+id/tv_num"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"共 0 件"
android:textSize=
"13sp"
/>
<TextView
android:id=
"@+id/tv_price"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"10mm"
android:text=
"总计: ¥ "
android:textSize=
"16sp"
/>
</LinearLayout>
<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>
<androidx.core.widget.NestedScrollView
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_above=
"@id/ll_bottom"
android:background=
"@color/white"
>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_above=
"@id/ll_bottom"
android:orientation=
"vertical"
android:paddingBottom=
"20mm"
>
<View
style=
"@style/ViewX"
/>
<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"
/>
</LinearLayout>
<RelativeLayout
android:id=
"@+id/rl_set"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:paddingHorizontal=
"20mm"
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:textColor=
"@color/flexible_text_gray"
android:textSize=
"14sp"
/>
<TextView
android:id=
"@+id/tv_dep"
android:layout_alignParentRight=
"true"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginRight=
"3mm"
android:textColor=
"@color/flexible_text_gray"
android:textSize=
"14sp"
/>
</RelativeLayout>
<View
style=
"@style/ViewX"
/>
<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"
/>
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView
android:id=
"@+id/rv_pro"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
/>
<View
style=
"@style/ViewX"
/>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_alignParentLeft=
"true"
android:layout_centerVertical=
"true"
android:layout_marginLeft=
"18mm"
android:paddingVertical=
"15mm"
android:text=
"备注"
android:textSize=
"16sp"
/>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginHorizontal=
"20mm"
android:background=
"@drawable/shape_confirm_order"
android:orientation=
"vertical"
>
<EditText
android:id=
"@+id/et_input5"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"3mm"
android:background=
"@null"
android:gravity=
"top"
android:hint=
"请输入"
android:minLines=
"4"
android:padding=
"5mm"
android:textSize=
"16sp"
/>
<TextView
android:id=
"@+id/tv_input5"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"right"
android:layout_margin=
"4mm"
android:text=
"0/140"
android:textColor=
"@color/flexible_text_gray"
/>
</LinearLayout>
</LinearLayout>
</androidx.core.widget.NestedScrollView>
</RelativeLayout>
\ No newline at end of file
app/src/main/res/layout/activity_device_buy_pro.xml
0 → 100644
浏览文件 @
5d22fd3b
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:orientation=
"vertical"
>
<androidx.recyclerview.widget.RecyclerView
android:id=
"@+id/rv_product"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
/>
</LinearLayout>
\ No newline at end of file
app/src/main/res/layout/item_device_car.xml
0 → 100644
浏览文件 @
5d22fd3b
<?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:background=
"@color/white"
android:orientation=
"vertical"
android:paddingHorizontal=
"20mm"
android:paddingVertical=
"10mm"
>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:background=
"#FCFCFD"
android:orientation=
"vertical"
android:padding=
"10mm"
>
<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_name"
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_spec"
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:id=
"@+id/rl_num"
android:visibility=
"gone"
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:text=
"品号"
android:textColor=
"@color/flexible_text_gray"
android:textSize=
"12sp"
/>
</RelativeLayout>
</LinearLayout>
<LinearLayout
android:id=
"@+id/ll_price"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"right"
android:layout_marginTop=
"30mm"
android:orientation=
"horizontal"
>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:gravity=
"center"
android:text=
"外部单价"
android:textColor=
"@color/flexible_text_sup"
android:textSize=
"17sp"
/>
<EditText
android:id=
"@+id/et_price"
android:layout_width=
"150mm"
android:layout_height=
"30mm"
android:layout_marginLeft=
"10mm"
android:background=
"@drawable/shape_add_cart"
android:gravity=
"right|center_vertical"
android:hint=
"¥0.00"
android:inputType=
"numberDecimal"
android:paddingHorizontal=
"10mm"
android:paddingVertical=
"4mm"
android:textColor=
"@color/flexible_text_sup"
android:textColorHint=
"#91ABBA"
android:textSize=
"16sp"
/>
</LinearLayout>
<LinearLayout
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"right|center_vertical"
android:layout_marginTop=
"25mm"
android:gravity=
"center_vertical"
android:orientation=
"horizontal"
>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:gravity=
"center"
android:text=
"购买数量"
android:textColor=
"@color/flexible_text_sup"
android:textSize=
"17sp"
/>
<com.wd.workoffice.widget.AddAndReduceView
android:id=
"@+id/ar_num"
android:layout_width=
"150mm"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"10mm"
/>
</LinearLayout>
<LinearLayout
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"right"
android:layout_marginTop=
"30mm"
>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"小计: ¥ "
android:textSize=
"12sp"
/>
<TextView
android:id=
"@+id/tv_all_price"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"00"
android:textSize=
"14sp"
android:textStyle=
"bold"
/>
</LinearLayout>
</LinearLayout>
\ No newline at end of file
app/src/main/res/layout/item_device_confirm.xml
0 → 100644
浏览文件 @
5d22fd3b
<?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:background=
"@color/white"
android:orientation=
"vertical"
android:paddingHorizontal=
"20mm"
android:paddingVertical=
"10mm"
>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:background=
"#FCFCFD"
android:orientation=
"vertical"
android:padding=
"10mm"
>
<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_name"
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_spec"
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_price"
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>
</LinearLayout>
<LinearLayout
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"right"
android:layout_marginTop=
"10mm"
>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"小计: ¥ "
android:textSize=
"12sp"
/>
<TextView
android:id=
"@+id/tv_all_price"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"00"
android:textSize=
"14sp"
android:textStyle=
"bold"
/>
</LinearLayout>
</LinearLayout>
\ No newline at end of file
app/src/main/res/layout/item_device_product.xml
0 → 100644
浏览文件 @
5d22fd3b
<?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:background=
"@color/white"
android:layout_marginTop=
"10mm"
android:orientation=
"vertical"
android:paddingHorizontal=
"20mm"
android:paddingVertical=
"10mm"
>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:background=
"#FCFCFD"
android:orientation=
"vertical"
android:padding=
"10mm"
>
<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_name"
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_spec"
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:id=
"@+id/rl_num"
android:visibility=
"gone"
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:text=
"品号"
android:textColor=
"@color/flexible_text_gray"
android:textSize=
"12sp"
/>
</RelativeLayout>
</LinearLayout>
<TextView
android:id=
"@+id/tv_cart"
android:layout_width=
"90mm"
android:layout_height=
"26mm"
android:layout_gravity=
"right"
android:layout_marginTop=
"10mm"
android:background=
"@mipmap/product_add_cart"
/>
</LinearLayout>
\ No newline at end of file
app/src/main/res/layout/item_device_repair.xml
浏览文件 @
5d22fd3b
...
@@ -29,7 +29,6 @@
...
@@ -29,7 +29,6 @@
android:textSize=
"14sp"
/>
android:textSize=
"14sp"
/>
</LinearLayout>
</LinearLayout>
<LinearLayout
<LinearLayout
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论