Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
zhangzhonghua
/
BoneHouse_Business_APP
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
ae5d0722
authored
May 20, 2020
by
Denglingling
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
完善【器械消耗】需要存储的store 数据,以及对接接口函数的封装
parent
3f74230a
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
275 additions
and
29 deletions
app/action/EquipAction.js
app/action/QuickAction.js
app/base/ActionTypes.js
app/containers/equipConsu/EquipConsuPage.js
app/reducers/index.js
app/reducers/module/equip.js
app/action/EquipAction.js
View file @
ae5d0722
import
{
PostRequest
,
GetRequest
}
from
'../network/RequestUtils'
;
import
{
PostRequest
,
GetRequest
}
from
'../network/RequestUtils'
;
import
{
show
}
from
'../utils/Utils'
;
import
{
show
,
getUrlParams
}
from
'../utils/Utils'
;
import
{
exitLoginStatus
}
from
'./LoginAction'
;
import
{
exitLoginStatus
}
from
'./LoginAction'
;
// import { SELF_ORDER_LIST_DOING, SELF_ORDER_LIST_SUCCESS, SELF_ORDER_LIST_FAILURE } from '../base/ActionTypes';
import
{
EQUIP_CONSU_LIST_DOING
,
EQUIP_CONSU_LIST_SUCCESS
,
EQUIP_CONSU_LIST_FAILURE
,
EQUIP_SUBMIT_DOING
,
EQUIP_SUBMIT_SUCCESS
,
EQUIP_SUBMIT_FAILURE
}
from
'../base/ActionTypes'
;
// 获取组织 params={access_token:''}
export
function
requestEquipOrganizations
(
params
)
{
return
dispatch
=>
{
console
.
log
(
'----requestEquipOrganizations===================='
)
dispatch
(
requestListDataing
());
GetRequest
(
getUrlParams
(
'/authorized_inventory/search'
,
params
))
.
then
(
res
=>
{
console
.
log
(
'res====='
,
Object
.
keys
(
res
),
res
);
if
(
res
.
error_code
==
0
)
{
let
{
data
:
{
organizations
}
}
=
res
dispatch
(
requestListDataSuccess
(
organizations
));
}
else
if
(
res
.
error_code
===
41006
)
{
show
(
'登录过期,请重新登录'
);
dispatch
(
exitLoginStatus
());
}
else
{
let
error_msg
=
res
.
error_msg
||
res
.
message
show
(
error_msg
);
dispatch
(
requestListDataFail
());
}
})
.
catch
(
err
=>
{
console
.
log
(
'------err--====requestEquipOrganizations----'
,
Object
.
keys
(
err
),
err
)
show
(
err
.
error
);
})
}
}
// 获取手术医院 params={access_token:'', org_code:'', seller_code:''}
export
function
requestEquipSurgeryHospital
(
params
)
{
return
dispatch
=>
{
console
.
log
(
'----requestEquipSurgeryHospital===================='
,
params
)
dispatch
(
requestListDataing
());
GetRequest
(
getUrlParams
(
'/sale/seller_customer/search'
,
params
))
.
then
(
res
=>
{
console
.
log
(
'res===!!=='
,
Object
.
keys
(
res
));
if
(
res
.
error_code
==
0
)
{
let
{
data
:
{
customers
}
}
=
res
dispatch
(
requestListDataSuccess
(
customers
));
}
else
if
(
res
.
error_code
===
41006
)
{
show
(
'登录过期,请重新登录'
);
dispatch
(
exitLoginStatus
());
}
else
{
let
error_msg
=
res
.
error_msg
||
res
.
message
show
(
error_msg
);
dispatch
(
requestListDataFail
());
}
})
.
catch
(
err
=>
{
console
.
log
(
'------err--====requestEquipSurgeryHospital----'
,
Object
.
keys
(
err
),
err
)
show
(
err
.
error
);
})
}
}
// api/latest/surgery/collect_order/search?access_token=${access_token}&org_code=A02&seller_code=shi.ming&customer_code=CU00000017&collect_header_status=RETURNED,COLLECTED
// 获取手术医院 params={access_token:'', org_code:'', seller_code:'', customer_code:'', collect_header_status: ''}
export
function
requestEquipOrderInfo
(
params
)
{
return
dispatch
=>
{
console
.
log
(
'----requestEquipOrderInfo===================='
,
params
)
dispatch
(
requestListDataing
());
GetRequest
(
getUrlParams
(
'/surgery/collect_order/search'
,
params
))
.
then
(
res
=>
{
console
.
log
(
'res===!!=='
,
Object
.
keys
(
res
));
if
(
res
.
error_code
==
0
)
{
let
{
data
:
{
surgery_collect_headers
}
}
=
res
dispatch
(
requestListDataSuccess
(
surgery_collect_headers
));
}
else
if
(
res
.
error_code
===
41006
)
{
show
(
'登录过期,请重新登录'
);
dispatch
(
exitLoginStatus
());
}
else
{
let
error_msg
=
res
.
error_msg
||
res
.
message
show
(
error_msg
);
dispatch
(
requestListDataFail
());
}
})
.
catch
(
err
=>
{
console
.
log
(
'------err--====requestEquipOrderInfo----'
,
Object
.
keys
(
err
),
err
)
show
(
err
.
error
);
})
}
}
function
requestListDataing
()
{
return
{
type
:
EQUIP_CONSU_LIST_DOING
}
}
function
requestListDataSuccess
(
data
)
{
return
{
type
:
EQUIP_CONSU_LIST_SUCCESS
,
rawData
:
data
}
}
function
requestListDataFail
()
{
return
{
type
:
EQUIP_CONSU_LIST_FAILURE
}
}
// 获取消耗明细 params={access_token:'', surgery_collect_number:''}
export
const
requestEquipDetails
=
async
(
params
)
=>
{
console
.
log
(
'----requestEquipDetails----'
,
params
)
return
await
GetRequest
(
getUrlParams
(
'/surgery/collected_order_line/search'
,
params
))
}
// 图片上传 -- 具体需要修改!!!!!
export
const
requestQuickAudio
=
async
(
params
)
=>
{
let
{
access_token
,
path
}
=
params
let
formData
=
new
FormData
()
let
soundPath
=
`file://
${
path
}
`
let
fileName
=
path
.
substring
(
path
.
lastIndexOf
(
'/'
)
+
1
,
path
.
length
)
let
file
=
{
uri
:
soundPath
,
type
:
"multipart/form-data"
,
name
:
fileName
}
formData
.
append
(
'file'
,
file
)
console
.
log
(
'--------'
,
file
,
formData
)
return
await
UploadRequest
(
getUrlParams
(
'/dingding/upload_media'
,
{
access_token
}),
formData
)
}
// 提交数据
export
function
requestEquipSumbit
({
access_token
,
...
params
})
{
return
dispatch
=>
{
console
.
warn
(
'----requestEquipSumbit===================='
,
access_token
,
params
)
dispatch
(
requestSubmiting
());
PostRequest
(
getUrlParams
(
'/surgery/consume_order/create'
,
{
access_token
:
access_token
}),
params
)
.
then
(
res
=>
{
console
.
warn
(
'res====='
,
Object
.
keys
(
res
));
if
(
res
.
error_code
==
0
)
{
console
.
warn
(
'res====requestEquipSumbit=========='
,
res
.
data
);
let
{
data
}
=
res
dispatch
(
requestSubmitSuccess
(
data
));
}
else
if
(
res
.
error_code
===
41006
)
{
show
(
'登录过期,请重新登录'
);
dispatch
(
exitLoginStatus
());
}
else
{
let
error_msg
=
res
.
error_msg
||
res
.
message
show
(
error_msg
);
dispatch
(
requestSubmitFail
());
}
})
.
catch
(
err
=>
{
console
.
log
(
'------err--====requestEquipSumbit----'
,
Object
.
keys
(
err
),
err
)
show
(
err
.
error
);
})
}
}
function
requestSubmiting
()
{
return
{
type
:
EQUIP_SUBMIT_DOING
}
}
function
requestSubmitSuccess
(
data
)
{
return
{
type
:
EQUIP_SUBMIT_SUCCESS
,
rawData
:
data
}
}
function
requestSubmitFail
()
{
return
{
type
:
EQUIP_SUBMIT_FAILURE
}
}
\ No newline at end of file
app/action/QuickAction.js
View file @
ae5d0722
...
@@ -14,21 +14,21 @@ import {
...
@@ -14,21 +14,21 @@ import {
export
function
requestQuickOrganizations
(
params
)
{
export
function
requestQuickOrganizations
(
params
)
{
return
dispatch
=>
{
return
dispatch
=>
{
console
.
log
(
'----requestQuickOrganizations===================='
)
console
.
log
(
'----requestQuickOrganizations===================='
)
dispatch
(
request
Organizations
ing
());
dispatch
(
request
ListData
ing
());
// GetRequest(`/authorized_inventory/search?access_token=${access_token}`)
// GetRequest(`/authorized_inventory/search?access_token=${access_token}`)
GetRequest
(
getUrlParams
(
'/authorized_inventory/search'
,
params
))
GetRequest
(
getUrlParams
(
'/authorized_inventory/search'
,
params
))
.
then
(
res
=>
{
.
then
(
res
=>
{
console
.
log
(
'res====='
,
Object
.
keys
(
res
),
res
);
console
.
log
(
'res====='
,
Object
.
keys
(
res
),
res
);
if
(
res
.
error_code
==
0
)
{
if
(
res
.
error_code
==
0
)
{
let
{
data
:
{
organizations
}
}
=
res
let
{
data
:
{
organizations
}
}
=
res
dispatch
(
request
Organizations
Success
(
organizations
));
dispatch
(
request
ListData
Success
(
organizations
));
}
else
if
(
res
.
error_code
===
41006
)
{
}
else
if
(
res
.
error_code
===
41006
)
{
show
(
'登录过期,请重新登录'
);
show
(
'登录过期,请重新登录'
);
dispatch
(
exitLoginStatus
());
dispatch
(
exitLoginStatus
());
}
else
{
}
else
{
let
error_msg
=
res
.
error_msg
||
res
.
message
let
error_msg
=
res
.
error_msg
||
res
.
message
show
(
error_msg
);
show
(
error_msg
);
dispatch
(
request
Organizations
Fail
());
dispatch
(
request
ListData
Fail
());
}
}
})
})
.
catch
(
err
=>
{
.
catch
(
err
=>
{
...
@@ -42,20 +42,20 @@ export function requestQuickOrganizations(params) {
...
@@ -42,20 +42,20 @@ export function requestQuickOrganizations(params) {
export
function
requestQuickSurgeryHospital
(
params
)
{
export
function
requestQuickSurgeryHospital
(
params
)
{
return
dispatch
=>
{
return
dispatch
=>
{
console
.
log
(
'----requestQuickSurgeryHospital===================='
,
params
)
console
.
log
(
'----requestQuickSurgeryHospital===================='
,
params
)
dispatch
(
request
Organizations
ing
());
dispatch
(
request
ListData
ing
());
GetRequest
(
getUrlParams
(
'/sale/seller_customer/search'
,
params
))
GetRequest
(
getUrlParams
(
'/sale/seller_customer/search'
,
params
))
.
then
(
res
=>
{
.
then
(
res
=>
{
console
.
log
(
'res===!!=='
,
Object
.
keys
(
res
));
console
.
log
(
'res===!!=='
,
Object
.
keys
(
res
));
if
(
res
.
error_code
==
0
)
{
if
(
res
.
error_code
==
0
)
{
let
{
data
:
{
customers
}
}
=
res
let
{
data
:
{
customers
}
}
=
res
dispatch
(
request
Organizations
Success
(
customers
));
dispatch
(
request
ListData
Success
(
customers
));
}
else
if
(
res
.
error_code
===
41006
)
{
}
else
if
(
res
.
error_code
===
41006
)
{
show
(
'登录过期,请重新登录'
);
show
(
'登录过期,请重新登录'
);
dispatch
(
exitLoginStatus
());
dispatch
(
exitLoginStatus
());
}
else
{
}
else
{
let
error_msg
=
res
.
error_msg
||
res
.
message
let
error_msg
=
res
.
error_msg
||
res
.
message
show
(
error_msg
);
show
(
error_msg
);
dispatch
(
request
Organizations
Fail
());
dispatch
(
request
ListData
Fail
());
}
}
})
})
.
catch
(
err
=>
{
.
catch
(
err
=>
{
...
@@ -69,20 +69,20 @@ export function requestQuickSurgeryHospital(params) {
...
@@ -69,20 +69,20 @@ export function requestQuickSurgeryHospital(params) {
export
function
requestQuickOrderType
(
params
)
{
export
function
requestQuickOrderType
(
params
)
{
return
dispatch
=>
{
return
dispatch
=>
{
console
.
log
(
'----requestQuickOrderType===================='
,
params
)
console
.
log
(
'----requestQuickOrderType===================='
,
params
)
dispatch
(
request
Organizations
ing
());
dispatch
(
request
ListData
ing
());
GetRequest
(
getUrlParams
(
'/system/value_set/search'
,
params
))
GetRequest
(
getUrlParams
(
'/system/value_set/search'
,
params
))
.
then
(
res
=>
{
.
then
(
res
=>
{
console
.
log
(
'res===!!=='
,
Object
.
keys
(
res
));
console
.
log
(
'res===!!=='
,
Object
.
keys
(
res
));
if
(
res
.
error_code
==
0
)
{
if
(
res
.
error_code
==
0
)
{
let
{
data
:
{
sys_values
}
}
=
res
let
{
data
:
{
sys_values
}
}
=
res
dispatch
(
request
Organizations
Success
(
sys_values
));
dispatch
(
request
ListData
Success
(
sys_values
));
}
else
if
(
res
.
error_code
===
41006
)
{
}
else
if
(
res
.
error_code
===
41006
)
{
show
(
'登录过期,请重新登录'
);
show
(
'登录过期,请重新登录'
);
dispatch
(
exitLoginStatus
());
dispatch
(
exitLoginStatus
());
}
else
{
}
else
{
let
error_msg
=
res
.
error_msg
||
res
.
message
let
error_msg
=
res
.
error_msg
||
res
.
message
show
(
error_msg
);
show
(
error_msg
);
dispatch
(
request
Organizations
Fail
());
dispatch
(
request
ListData
Fail
());
}
}
})
})
.
catch
(
err
=>
{
.
catch
(
err
=>
{
...
@@ -96,20 +96,20 @@ export function requestQuickOrderType(params) {
...
@@ -96,20 +96,20 @@ export function requestQuickOrderType(params) {
export
function
requestQuickTemplateCollect
(
params
)
{
export
function
requestQuickTemplateCollect
(
params
)
{
return
dispatch
=>
{
return
dispatch
=>
{
console
.
log
(
'----requestQuickTemplateCollect===================='
,
params
)
console
.
log
(
'----requestQuickTemplateCollect===================='
,
params
)
dispatch
(
request
Organizations
ing
());
dispatch
(
request
ListData
ing
());
GetRequest
(
getUrlParams
(
'/surgery/template_header/search'
,
params
))
GetRequest
(
getUrlParams
(
'/surgery/template_header/search'
,
params
))
.
then
(
res
=>
{
.
then
(
res
=>
{
console
.
log
(
'res===!!=='
,
Object
.
keys
(
res
));
console
.
log
(
'res===!!=='
,
Object
.
keys
(
res
));
if
(
res
.
error_code
==
0
)
{
if
(
res
.
error_code
==
0
)
{
let
{
data
:
{
surgery_template_headers
}
}
=
res
let
{
data
:
{
surgery_template_headers
}
}
=
res
dispatch
(
request
Organizations
Success
(
surgery_template_headers
));
dispatch
(
request
ListData
Success
(
surgery_template_headers
));
}
else
if
(
res
.
error_code
===
41006
)
{
}
else
if
(
res
.
error_code
===
41006
)
{
show
(
'登录过期,请重新登录'
);
show
(
'登录过期,请重新登录'
);
dispatch
(
exitLoginStatus
());
dispatch
(
exitLoginStatus
());
}
else
{
}
else
{
let
error_msg
=
res
.
error_msg
||
res
.
message
let
error_msg
=
res
.
error_msg
||
res
.
message
show
(
error_msg
);
show
(
error_msg
);
dispatch
(
request
Organizations
Fail
());
dispatch
(
request
ListData
Fail
());
}
}
})
})
.
catch
(
err
=>
{
.
catch
(
err
=>
{
...
@@ -119,20 +119,20 @@ export function requestQuickTemplateCollect(params) {
...
@@ -119,20 +119,20 @@ export function requestQuickTemplateCollect(params) {
}
}
}
}
function
request
Organizations
ing
()
{
function
request
ListData
ing
()
{
return
{
return
{
type
:
QUICK_ORDER_LIST_DOING
type
:
QUICK_ORDER_LIST_DOING
}
}
}
}
function
request
Organizations
Success
(
data
)
{
function
request
ListData
Success
(
data
)
{
return
{
return
{
type
:
QUICK_ORDER_LIST_SUCCESS
,
type
:
QUICK_ORDER_LIST_SUCCESS
,
rawData
:
data
rawData
:
data
}
}
}
}
function
request
Organizations
Fail
()
{
function
request
ListData
Fail
()
{
return
{
return
{
type
:
QUICK_ORDER_LIST_FAILURE
type
:
QUICK_ORDER_LIST_FAILURE
}
}
...
@@ -162,7 +162,7 @@ export function requestQuickAudio_222(params) {
...
@@ -162,7 +162,7 @@ export function requestQuickAudio_222(params) {
console
.
log
(
'----file===================='
,
file
,
soundPath
,
formData
)
console
.
log
(
'----file===================='
,
file
,
soundPath
,
formData
)
dispatch
(
requestSubmit
Organizations
ing
());
dispatch
(
requestSubmiting
());
// /system/attachment/create
// /system/attachment/create
// /dingding/upload_media
// /dingding/upload_media
UploadRequest
(
getUrlParams
(
'/dingding/upload_media'
,
{
access_token
}),
formData
)
UploadRequest
(
getUrlParams
(
'/dingding/upload_media'
,
{
access_token
}),
formData
)
...
@@ -170,14 +170,14 @@ export function requestQuickAudio_222(params) {
...
@@ -170,14 +170,14 @@ export function requestQuickAudio_222(params) {
console
.
log
(
'res===!!=='
,
Object
.
keys
(
res
),
res
);
console
.
log
(
'res===!!=='
,
Object
.
keys
(
res
),
res
);
if
(
res
.
error_code
==
0
)
{
if
(
res
.
error_code
==
0
)
{
let
{
data
:
{
url
}
}
=
res
let
{
data
:
{
url
}
}
=
res
dispatch
(
requestSubmit
Organizations
Success
(
url
));
dispatch
(
requestSubmitSuccess
(
url
));
}
else
if
(
res
.
error_code
===
41006
)
{
}
else
if
(
res
.
error_code
===
41006
)
{
show
(
'登录过期,请重新登录'
);
show
(
'登录过期,请重新登录'
);
dispatch
(
exitLoginStatus
());
dispatch
(
exitLoginStatus
());
}
else
{
}
else
{
let
error_msg
=
res
.
error_msg
||
res
.
message
let
error_msg
=
res
.
error_msg
||
res
.
message
show
(
error_msg
);
show
(
error_msg
);
dispatch
(
requestSubmit
Organizations
Fail
());
dispatch
(
requestSubmitFail
());
}
}
})
})
.
catch
(
err
=>
{
.
catch
(
err
=>
{
...
@@ -208,21 +208,21 @@ export const requestQuickAudio = async (params) => {
...
@@ -208,21 +208,21 @@ export const requestQuickAudio = async (params) => {
export
function
requestQuickSumbit
({
access_token
,
...
params
})
{
export
function
requestQuickSumbit
({
access_token
,
...
params
})
{
return
dispatch
=>
{
return
dispatch
=>
{
console
.
warn
(
'----requestQuickSumbit===================='
,
access_token
,
params
)
console
.
warn
(
'----requestQuickSumbit===================='
,
access_token
,
params
)
dispatch
(
requestSubmit
Organizations
ing
());
dispatch
(
requestSubmiting
());
PostRequest
(
getUrlParams
(
'/surgery/collect_order/via_data/create'
,
{
access_token
:
access_token
}),
params
)
PostRequest
(
getUrlParams
(
'/surgery/collect_order/via_data/create'
,
{
access_token
:
access_token
}),
params
)
.
then
(
res
=>
{
.
then
(
res
=>
{
console
.
warn
(
'res====='
,
Object
.
keys
(
res
));
console
.
warn
(
'res====='
,
Object
.
keys
(
res
));
if
(
res
.
error_code
==
0
)
{
if
(
res
.
error_code
==
0
)
{
console
.
warn
(
'res====requestQuickSumbit=========='
,
res
.
data
);
console
.
warn
(
'res====requestQuickSumbit=========='
,
res
.
data
);
let
{
data
}
=
res
let
{
data
}
=
res
dispatch
(
requestSubmit
Organizations
Success
(
data
));
dispatch
(
requestSubmitSuccess
(
data
));
}
else
if
(
res
.
error_code
===
41006
)
{
}
else
if
(
res
.
error_code
===
41006
)
{
show
(
'登录过期,请重新登录'
);
show
(
'登录过期,请重新登录'
);
dispatch
(
exitLoginStatus
());
dispatch
(
exitLoginStatus
());
}
else
{
}
else
{
let
error_msg
=
res
.
error_msg
||
res
.
message
let
error_msg
=
res
.
error_msg
||
res
.
message
show
(
error_msg
);
show
(
error_msg
);
dispatch
(
requestSubmit
Organizations
Fail
());
dispatch
(
requestSubmitFail
());
}
}
})
})
.
catch
(
err
=>
{
.
catch
(
err
=>
{
...
@@ -232,20 +232,20 @@ export function requestQuickSumbit({access_token, ...params}) {
...
@@ -232,20 +232,20 @@ export function requestQuickSumbit({access_token, ...params}) {
}
}
}
}
function
requestSubmit
Organizations
ing
()
{
function
requestSubmiting
()
{
return
{
return
{
type
:
QUICK_SUBMIT_DOING
type
:
QUICK_SUBMIT_DOING
}
}
}
}
function
requestSubmit
Organizations
Success
(
data
)
{
function
requestSubmitSuccess
(
data
)
{
return
{
return
{
type
:
QUICK_SUBMIT_SUCCESS
,
type
:
QUICK_SUBMIT_SUCCESS
,
rawData
:
data
rawData
:
data
}
}
}
}
function
requestSubmit
Organizations
Fail
()
{
function
requestSubmitFail
()
{
return
{
return
{
type
:
QUICK_SUBMIT_FAILURE
type
:
QUICK_SUBMIT_FAILURE
}
}
...
...
app/base/ActionTypes.js
View file @
ae5d0722
...
@@ -23,4 +23,13 @@ export const QUICK_ORDER_LIST_FAILURE = "QUICK_ORDER_LIST_FAILURE"
...
@@ -23,4 +23,13 @@ export const QUICK_ORDER_LIST_FAILURE = "QUICK_ORDER_LIST_FAILURE"
export
const
QUICK_SUBMIT_NO
=
"QUICK_SUBMIT_NO"
export
const
QUICK_SUBMIT_NO
=
"QUICK_SUBMIT_NO"
export
const
QUICK_SUBMIT_DOING
=
"QUICK_SUBMIT_DOING"
export
const
QUICK_SUBMIT_DOING
=
"QUICK_SUBMIT_DOING"
export
const
QUICK_SUBMIT_SUCCESS
=
"QUICK_SUBMIT_SUCCESS"
export
const
QUICK_SUBMIT_SUCCESS
=
"QUICK_SUBMIT_SUCCESS"
export
const
QUICK_SUBMIT_FAILURE
=
"QUICK_SUBMIT_FAILURE"
export
const
QUICK_SUBMIT_FAILURE
=
"QUICK_SUBMIT_FAILURE"
\ No newline at end of file
//-----------equipment consumption---------------------
export
const
EQUIP_CONSU_LIST_NO
=
"EQUIP_CONSU_LIST_NO"
export
const
EQUIP_CONSU_LIST_DOING
=
"EQUIP_CONSU_LIST_DOING"
export
const
EQUIP_CONSU_LIST_SUCCESS
=
"EQUIP_CONSU_LIST_SUCCESS"
export
const
EQUIP_CONSU_LIST_FAILURE
=
"EQUIP_CONSU_LIST_FAILURE"
export
const
EQUIP_SUBMIT_NO
=
"EQUIP_SUBMIT_NO"
export
const
EQUIP_SUBMIT_DOING
=
"EQUIP_SUBMIT_DOING"
export
const
EQUIP_SUBMIT_SUCCESS
=
"EQUIP_SUBMIT_SUCCESS"
export
const
EQUIP_SUBMIT_FAILURE
=
"EQUIP_SUBMIT_FAILURE"
\ No newline at end of file
app/containers/equipConsu/EquipConsuPage.js
View file @
ae5d0722
...
@@ -675,7 +675,7 @@ class EquipConsuPage extends Component {
...
@@ -675,7 +675,7 @@ class EquipConsuPage extends Component {
// 返回耗材明细子项
// 返回耗材明细子项
renderConDeSubItem
(
item
,
index
)
{
renderConDeSubItem
(
item
,
index
)
{
return
(
return
(
<
View
style
=
{
list_common_item
.
con_de_sub
}
>
<
View
style
=
{
list_common_item
.
con_de_sub
}
key
=
{
index
}
>
<
Text
style
=
{
list_common_item
.
de_sub_tit
}
>
<
Text
style
=
{
list_common_item
.
de_sub_tit
}
>
{
index
+
1
}
:
{
item
.
title
}
{
index
+
1
}
:
{
item
.
title
}
<
/Text
>
<
/Text
>
...
...
app/reducers/index.js
View file @
ae5d0722
...
@@ -3,6 +3,7 @@ import {persistReducer} from 'redux-persist';
...
@@ -3,6 +3,7 @@ import {persistReducer} from 'redux-persist';
import
login
from
'./module/login'
;
import
login
from
'./module/login'
;
import
quick
from
'./module/quick'
;
import
quick
from
'./module/quick'
;
import
selfOrder
from
'./module/selfOrder'
;
import
selfOrder
from
'./module/selfOrder'
;
import
equip
from
'./module/equip'
;
const
loginConfig
=
{
const
loginConfig
=
{
key
:
'login'
,
key
:
'login'
,
...
@@ -25,10 +26,18 @@ const quickConfig = {
...
@@ -25,10 +26,18 @@ const quickConfig = {
blackList
:
[]
blackList
:
[]
}
}
const
equipConfig
=
{
key
:
'equip'
,
storage
,
debug
:
false
,
blackList
:
[]
}
const
rootReducer
=
{
const
rootReducer
=
{
login
:
persistReducer
(
loginConfig
,
login
),
login
:
persistReducer
(
loginConfig
,
login
),
selfOrder
:
persistReducer
(
selfConfig
,
selfOrder
),
selfOrder
:
persistReducer
(
selfConfig
,
selfOrder
),
quick
:
persistReducer
(
quickConfig
,
quick
),
quick
:
persistReducer
(
quickConfig
,
quick
),
equip
:
persistReducer
(
equipConfig
,
equip
),
}
}
export
default
rootReducer
;
export
default
rootReducer
;
\ No newline at end of file
app/reducers/module/equip.js
View file @
ae5d0722
import
{
EQUIP_CONSU_LIST_NO
,
EQUIP_CONSU_LIST_DOING
,
EQUIP_CONSU_LIST_SUCCESS
,
EQUIP_CONSU_LIST_FAILURE
,
EQUIP_SUBMIT_NO
,
EQUIP_SUBMIT_DOING
,
EQUIP_SUBMIT_SUCCESS
,
EQUIP_SUBMIT_FAILURE
}
from
'../../base/ActionTypes'
;
// 器械消耗状态
const
defaultState
=
{
equip_list_status
:
EQUIP_CONSU_LIST_NO
,
// 获取数据状态
submit_equip_order_status
:
EQUIP_SUBMIT_NO
,
// 提交订单状态
equipOrderOption
:
{}
// 当前临时存储数据
}
export
default
equip
=
(
state
=
defaultState
,
action
)
=>
{
switch
(
action
.
type
)
{
case
EQUIP_CONSU_LIST_DOING
:
return
Object
.
assign
({},
state
,
{
equip_list_status
:
EQUIP_CONSU_LIST_DOING
});
case
EQUIP_CONSU_LIST_SUCCESS
:
return
Object
.
assign
({},
state
,
{
equip_list_status
:
EQUIP_CONSU_LIST_SUCCESS
,
equipOrderOption
:
action
.
rawData
})
case
EQUIP_CONSU_LIST_FAILURE
:
return
Object
.
assign
({},
state
,
{
equip_list_status
:
EQUIP_CONSU_LIST_FAILURE
})
case
EQUIP_SUBMIT_DOING
:
return
Object
.
assign
({},
state
,
{
submit_equip_order_status
:
EQUIP_SUBMIT_DOING
});
case
EQUIP_SUBMIT_SUCCESS
:
return
Object
.
assign
({},
state
,
{
submit_equip_order_status
:
EQUIP_SUBMIT_SUCCESS
,
equipOrderOption
:
action
.
rawData
// equipOrderOption: {} // 清空当前临时数据
})
case
EQUIP_SUBMIT_FAILURE
:
return
Object
.
assign
({},
state
,
{
submit_equip_order_status
:
EQUIP_SUBMIT_FAILURE
})
default
:
return
state
;
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment