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
4b2389b1
authored
Apr 17, 2022
by
lhc
Committed by
peii
Apr 18, 2022
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
feat: 增加全局搜索
(cherry picked from commit
e09dbcef
)
parent
ae71f4e4
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
2578 additions
and
1893 deletions
app/Router.js
app/action/SelfAction.js
app/containers/common/listDataComponent/PicTitDetaiCalcu.js
app/containers/selfOrder/module/ChooseProductPage.js
app/containers/selfOrder/module/SearchPage.js
app/Router.js
View file @
4b2389b1
import
React
,
{
Component
}
from
'react'
;
import
React
,
{
Component
}
from
'react'
import
{
import
{
Easing
,
Animated
}
from
'react-native'
Easing
,
import
{
createStackNavigator
,
createAppContainer
}
from
'react-navigation'
Animated
import
LoginPage
from
'./containers/login/LoginPage'
}
from
'react-native'
;
import
HomePage
from
'./containers/home/HomePage'
import
{
createStackNavigator
,
createAppContainer
}
from
'react-navigation'
;
import
SelfOrderPage
from
'./containers/selfOrder/SelfOrderPage'
import
LoginPage
from
'./containers/login/LoginPage'
;
import
ChooseProductPage
from
'./containers/selfOrder/module/ChooseProductPage'
import
HomePage
from
'./containers/home/HomePage'
;
import
SearchPage
from
'./containers/selfOrder/module/SearchPage'
import
SelfOrderPage
from
'./containers/selfOrder/SelfOrderPage'
;
import
EditThirdLevelPage
from
'./containers/selfOrder/module/EditThirdLevelPage'
import
ChooseProductPage
from
'./containers/selfOrder/module/ChooseProductPage'
;
import
EquipConsuPage
from
'./containers/equipConsu/EquipConsuPage'
import
EditThirdLevelPage
from
'./containers/selfOrder/module/EditThirdLevelPage'
;
import
ConsumDetailsPage
from
'./containers/equipConsu/module/ConsumDetailsPage'
import
EquipConsuPage
from
'./containers/equipConsu/EquipConsuPage'
;
import
ChargeDetailsPage
from
'./containers/equipConsu/module/ChargeDetailsPageRef'
import
ConsumDetailsPage
from
'./containers/equipConsu/module/ConsumDetailsPage'
;
import
FillUnitPricePage
from
'./containers/equipConsu/module/FillUnitPricePage'
import
ChargeDetailsPage
from
'./containers/equipConsu/module/ChargeDetailsPageRef'
;
import
OrdersPage
from
'./containers/equipConsu/module/OrdersPage'
import
FillUnitPricePage
from
'./containers/equipConsu/module/FillUnitPricePage'
;
import
ShowDetailPage
from
'./containers/equipConsu/module/ShowDetailPage'
import
OrdersPage
from
'./containers/equipConsu/module/OrdersPage'
;
import
QuickOrderPage
from
'./containers/quickOrder/QuickOrderPage'
import
ShowDetailPage
from
'./containers/equipConsu/module/ShowDetailPage'
;
import
surgeryTemplatePage
from
'./containers/quickOrder/module/surgeryTemplatePage'
import
QuickOrderPage
from
'./containers/quickOrder/QuickOrderPage'
;
import
surgeryDetailsPage
from
'./containers/quickOrder/module/surgeryDetailsPage'
import
surgeryTemplatePage
from
'./containers/quickOrder/module/surgeryTemplatePage'
;
import
TransOrderPage
from
'./containers/transOrder/TransOrderPage'
import
surgeryDetailsPage
from
'./containers/quickOrder/module/surgeryDetailsPage'
;
import
DeviceInfoPage
from
'./containers/deviceInfo/DeviceInfoPage'
import
TransOrderPage
from
'./containers/transOrder/TransOrderPage'
;
import
TransSearchPage
from
'./containers/transOrder/module/TransSearchPage'
import
DeviceInfoPage
from
'./containers/deviceInfo/DeviceInfoPage'
;
import
HistoricalOrderPage
from
'./containers/historicalOrder/HistoricalOrderPage'
import
TransSearchPage
from
'./containers/transOrder/module/TransSearchPage'
;
import
LineOrderPage
from
'./containers/historicalOrder/module/LineOrderPage'
import
HistoricalOrderPage
from
'./containers/historicalOrder/HistoricalOrderPage'
;
import
SubSuccPage
from
'./containers/common/SubSuccPage'
import
LineOrderPage
from
'./containers/historicalOrder/module/LineOrderPage'
;
import
BarCodePage
from
'./containers/common/BarCodePage'
import
SubSuccPage
from
'./containers/common/SubSuccPage'
;
import
BarCodePage
from
'./containers/common/BarCodePage'
;
// 结算
// 结算
import
Settlement
from
'../src/pages/settlement/index'
;
import
Settlement
from
'../src/pages/settlement/index'
import
SettlementCollection
from
'../src/pages/settlement/collection'
;
import
SettlementCollection
from
'../src/pages/settlement/collection'
import
SettlementDetail
from
'../src/pages/settlement/detail'
;
import
SettlementDetail
from
'../src/pages/settlement/detail'
import
SettlementSaleDetail
from
'../src/pages/settlement/saleDetail'
;
import
SettlementSaleDetail
from
'../src/pages/settlement/saleDetail'
import
SettlementReject
from
'../src/pages/settlement/reject'
;
import
SettlementReject
from
'../src/pages/settlement/reject'
// 分销开票
// 分销开票
import
DistributeInvoice
from
'../src/pages/invoice/distribution'
;
import
DistributeInvoice
from
'../src/pages/invoice/distribution'
import
DistributeInvoiceApplyDetail
from
'../src/pages/invoice/distribution/detail'
;
import
DistributeInvoiceApplyDetail
from
'../src/pages/invoice/distribution/detail'
import
DistributeInvoiceCollections
from
'../src/pages/invoice/distribution/collection'
;
import
DistributeInvoiceCollections
from
'../src/pages/invoice/distribution/collection'
import
DistributeInvoiceCollectionDetail
from
'../src/pages/invoice/distribution/collection_detail'
;
import
DistributeInvoiceCollectionDetail
from
'../src/pages/invoice/distribution/collection_detail'
// 直销开票
// 直销开票
import
DirectionInvoice
from
'../src/pages/invoice/direct'
;
import
DirectionInvoice
from
'../src/pages/invoice/direct'
import
DirectionInvoiceCollections
from
'../src/pages/invoice/direct/collections'
;
import
DirectionInvoiceCollections
from
'../src/pages/invoice/direct/collections'
import
DirectionInvoiceApplyDetail
from
'../src/pages/invoice/direct/detail'
;
import
DirectionInvoiceApplyDetail
from
'../src/pages/invoice/direct/detail'
const
Router
=
createAppContainer
(
const
Router
=
createAppContainer
(
createStackNavigator
({
createStackNavigator
(
LoginPage
:
{
screen
:
LoginPage
},
{
HomePage
:
{
screen
:
HomePage
},
LoginPage
:
{
screen
:
LoginPage
},
SelfOrderPage
:
{
screen
:
SelfOrderPage
},
HomePage
:
{
screen
:
HomePage
},
ChooseProductPage
:
{
screen
:
ChooseProductPage
},
SelfOrderPage
:
{
screen
:
SelfOrderPage
},
EditThirdLevelPage
:
{
screen
:
EditThirdLevelPage
},
ChooseProductPage
:
{
screen
:
ChooseProductPage
},
EquipConsuPage
:
{
screen
:
EquipConsuPage
},
SearchPage
:
{
screen
:
SearchPage
},
ConsumDetailsPage
:
{
screen
:
ConsumDetailsPage
},
EditThirdLevelPage
:
{
screen
:
EditThirdLevelPage
},
ChargeDetailsPage
:
{
screen
:
ChargeDetailsPage
},
EquipConsuPage
:
{
screen
:
EquipConsuPage
},
FillUnitPricePage
:
{
screen
:
FillUnitPricePage
},
ConsumDetailsPage
:
{
screen
:
ConsumDetailsPage
},
OrdersPage
:
{
screen
:
OrdersPage
},
ChargeDetailsPage
:
{
screen
:
ChargeDetailsPage
},
ShowDetailPage
:
{
screen
:
ShowDetailPage
},
FillUnitPricePage
:
{
screen
:
FillUnitPricePage
},
QuickOrderPage
:
{
screen
:
QuickOrderPage
},
OrdersPage
:
{
screen
:
OrdersPage
},
surgeryTemplatePage
:
{
screen
:
surgeryTemplatePage
},
ShowDetailPage
:
{
screen
:
ShowDetailPage
},
surgeryDetailsPage
:
{
screen
:
surgeryDetailsPage
},
QuickOrderPage
:
{
screen
:
QuickOrderPage
},
TransOrderPage
:
{
screen
:
TransOrderPage
},
surgeryTemplatePage
:
{
screen
:
surgeryTemplatePage
},
DeviceInfoPage
:
{
screen
:
DeviceInfoPage
},
surgeryDetailsPage
:
{
screen
:
surgeryDetailsPage
},
TransSearchPage
:
{
screen
:
TransSearchPage
},
TransOrderPage
:
{
screen
:
TransOrderPage
},
HistoricalOrderPage
:
{
screen
:
HistoricalOrderPage
},
DeviceInfoPage
:
{
screen
:
DeviceInfoPage
},
LineOrderPage
:
{
screen
:
LineOrderPage
},
TransSearchPage
:
{
screen
:
TransSearchPage
},
SubSuccPage
:
{
screen
:
SubSuccPage
},
HistoricalOrderPage
:
{
screen
:
HistoricalOrderPage
},
BarCodePage
:
{
screen
:
BarCodePage
},
LineOrderPage
:
{
screen
:
LineOrderPage
},
Settlement
:
{
screen
:
Settlement
},
SubSuccPage
:
{
screen
:
SubSuccPage
},
SettlementCollection
:
{
screen
:
SettlementCollection
},
BarCodePage
:
{
screen
:
BarCodePage
},
SettlementReject
:
{
screen
:
SettlementReject
},
Settlement
:
{
screen
:
Settlement
},
SettlementDetail
:
{
screen
:
SettlementDetail
},
SettlementCollection
:
{
screen
:
SettlementCollection
},
SettlementSaleDetail
:
{
screen
:
SettlementSaleDetail
},
SettlementReject
:
{
screen
:
SettlementReject
},
DistributeInvoice
:
{
screen
:
DistributeInvoice
},
SettlementDetail
:
{
screen
:
SettlementDetail
},
DistributeInvoiceApplyDetail
:
{
screen
:
DistributeInvoiceApplyDetail
},
SettlementSaleDetail
:
{
screen
:
SettlementSaleDetail
},
DistributeInvoiceCollections
:
{
screen
:
DistributeInvoiceCollections
},
DistributeInvoice
:
{
screen
:
DistributeInvoice
},
DistributeInvoiceCollectionDetail
:
{
screen
:
DistributeInvoiceCollectionDetail
},
DistributeInvoiceApplyDetail
:
{
screen
:
DistributeInvoiceApplyDetail
},
DirectionInvoice
:
{
screen
:
DirectionInvoice
},
DistributeInvoiceCollections
:
{
screen
:
DistributeInvoiceCollections
},
DirectionInvoiceCollections
:
{
screen
:
DirectionInvoiceCollections
},
DistributeInvoiceCollectionDetail
:
{
screen
:
DistributeInvoiceCollectionDetail
},
DirectionInvoiceApplyDetail
:
{
screen
:
DirectionInvoiceApplyDetail
},
DirectionInvoice
:
{
screen
:
DirectionInvoice
},
},
{
DirectionInvoiceCollections
:
{
screen
:
DirectionInvoiceCollections
},
navigationOptions
:
{
DirectionInvoiceApplyDetail
:
{
screen
:
DirectionInvoiceApplyDetail
},
gesturesEnabled
:
true
},
},
headerMode
:
'none'
,
{
transitionConfig
:
()
=>
({
navigationOptions
:
{
gesturesEnabled
:
true
,
},
headerMode
:
'none'
,
transitionConfig
:
()
=>
({
transitionSpec
:
{
transitionSpec
:
{
duration
:
300
,
duration
:
300
,
easing
:
Easing
.
out
(
Easing
.
poly
(
4
)),
easing
:
Easing
.
out
(
Easing
.
poly
(
4
)),
timing
:
Animated
.
timing
timing
:
Animated
.
timing
,
},
},
screenInterpolator
:
sceneProps
=>
{
screenInterpolator
:
sceneProps
=>
{
const
{
layout
,
position
,
scene
}
=
sceneProps
;
const
{
layout
,
position
,
scene
}
=
sceneProps
const
{
index
}
=
scene
;
const
{
index
}
=
scene
const
Width
=
layout
.
initWidth
;
const
Width
=
layout
.
initWidth
//沿X轴平移
//沿X轴平移
const
translateX
=
position
.
interpolate
({
const
translateX
=
position
.
interpolate
({
inputRange
:
[
index
-
1
,
index
,
index
+
1
],
inputRange
:
[
index
-
1
,
index
,
index
+
1
],
outputRange
:
[
Width
,
0
,
-
(
Width
-
10
)],
outputRange
:
[
Width
,
0
,
-
(
Width
-
10
)],
});
})
//透明度
//透明度
const
opacity
=
position
.
interpolate
({
const
opacity
=
position
.
interpolate
({
inputRange
:
[
index
-
1
,
index
-
0.99
,
index
],
inputRange
:
[
index
-
1
,
index
-
0.99
,
index
],
outputRange
:
[
0
,
1
,
1
]
outputRange
:
[
0
,
1
,
1
],
});
})
return
{
opacity
,
transform
:
[{
translateX
}]};
return
{
opacity
,
transform
:
[{
translateX
}]
}
}
},
})
}),
}))
},
),
)
// const defaultGetStateForAction = Router.router.getStateForAction;
// const defaultGetStateForAction = Router.router.getStateForAction;
// Router.router.getStateForAction = ((action, state) => {
// Router.router.getStateForAction = ((action, state) => {
...
@@ -127,4 +130,4 @@ const Router = createAppContainer(createStackNavigator({
...
@@ -127,4 +130,4 @@ const Router = createAppContainer(createStackNavigator({
// return defaultGetStateForAction(action, state)
// return defaultGetStateForAction(action, state)
// })
// })
export
default
Router
export
default
Router
\ No newline at end of file
app/action/SelfAction.js
View file @
4b2389b1
import
{
PostRequest
,
GetRequest
,
UploadRequest
}
from
'../network/RequestUtils'
;
import
{
PostRequest
,
GetRequest
,
UploadRequest
}
from
'../network/RequestUtils'
import
{
show
,
getUrlParams
,
showWarnErrorMessage
,
showErrorMessage
,
dedupQuoteArray
}
from
'../utils/Utils'
;
import
{
show
,
getUrlParams
,
showWarnErrorMessage
,
showErrorMessage
,
dedupQuoteArray
}
from
'../utils/Utils'
import
{
exitLoginStatus
}
from
'./LoginAction'
;
import
{
exitLoginStatus
}
from
'./LoginAction'
import
{
import
{
SELF_ORDER_LIST_DOING
,
SELF_ORDER_LIST_DOING
,
SELF_ORDER_LIST_SUCCESS
,
SELF_ORDER_LIST_SUCCESS
,
SELF_ORDER_LIST_FAILURE
,
SELF_ORDER_LIST_FAILURE
,
SELF_SUBMIT_DOING
,
SELF_SUBMIT_DOING
,
SELF_SUBMIT_SUCCESS
,
SELF_SUBMIT_SUCCESS
,
SELF_SUBMIT_FAILURE
,
SELF_SUBMIT_FAILURE
,
SELF_INIT_DATA
,
SELF_INIT_DATA
,
SET_SELECT_PRODUCT_OPTS
,
SET_SELECT_PRODUCT_OPTS
,
SET_LEND_ORDER_VALUES
SET_LEND_ORDER_VALUES
,
}
from
'../base/ActionTypes'
;
}
from
'../base/ActionTypes'
import
local_inter_mock
from
'../containers/selfOrder/module/mock/inter_mock'
import
local_inter_mock
from
'../containers/selfOrder/module/mock/inter_mock'
import
*
as
R
from
'ramda'
import
*
as
R
from
'ramda'
// 获取组织 params={access_token:''}
// 获取组织 params={access_token:''}
export
function
requestSelfOrganizations
(
params
)
{
export
function
requestSelfOrganizations
(
params
)
{
return
(
dispatch
,
getState
)
=>
{
return
(
dispatch
,
getState
)
=>
{
dispatch
(
requestListDataing
());
dispatch
(
requestListDataing
())
let
{
global_domain_config
}
=
getState
().
login
let
{
global_domain_config
}
=
getState
().
login
GetRequest
(
global_domain_config
,
getUrlParams
(
'/authorized_inventory/search'
,
params
))
GetRequest
(
global_domain_config
,
getUrlParams
(
'/authorized_inventory/search'
,
params
))
.
then
(
res
=>
{
.
then
(
res
=>
{
console
.
log
(
'获取组织 res====='
,
res
);
console
.
log
(
'获取组织 res====='
,
res
)
if
(
res
.
error_code
==
0
)
{
if
(
res
.
error_code
==
0
)
{
let
{
data
:
{
organizations
}
}
=
res
let
{
dispatch
(
requestListDataSuccess
(
organizations
));
data
:
{
organizations
},
}
else
{
}
=
res
showWarnErrorMessage
(
dispatch
,
res
,
exitLoginStatus
,
requestListDataFail
)
dispatch
(
requestListDataSuccess
(
organizations
))
}
}
else
{
// else if(res.error_code === 41006) {
showWarnErrorMessage
(
dispatch
,
res
,
exitLoginStatus
,
requestListDataFail
)
// show('登录过期,请重新登录');
}
// dispatch(exitLoginStatus());
// else if(res.error_code === 41006) {
// } else {
// show('登录过期,请重新登录');
// show(res.error_msg);
// dispatch(exitLoginStatus());
// dispatch(requestListDataFail());
// } else {
// }
// show(res.error_msg);
})
// dispatch(requestListDataFail());
.
catch
(
err
=>
{
// }
showErrorMessage
(
dispatch
,
err
,
requestListDataFail
,
'获取组织'
)
})
// console.log('------err--获取组织----', Object.keys(err), err)
.
catch
(
err
=>
{
// show(err.error);
showErrorMessage
(
dispatch
,
err
,
requestListDataFail
,
'获取组织'
)
// dispatch(requestListDataFail());
// console.log('------err--获取组织----', Object.keys(err), err)
})
// show(err.error);
}
// dispatch(requestListDataFail());
})
}
}
}
// 获取未定单据借货设置 params={access_token:'', org_code:'', customer_code: '', bill_to_site_code: '', ship_to_site_code: '', process_code: ''}
// 获取未定单据借货设置 params={access_token:'', org_code:'', customer_code: '', bill_to_site_code: '', ship_to_site_code: '', process_code: ''}
export
function
requestQuickSurColSetting
(
params
)
{
export
function
requestQuickSurColSetting
(
params
)
{
return
(
dispatch
,
getState
)
=>
{
return
(
dispatch
,
getState
)
=>
{
dispatch
(
requestListDataing
());
dispatch
(
requestListDataing
())
let
{
global_domain_config
}
=
getState
().
login
let
{
global_domain_config
}
=
getState
().
login
GetRequest
(
global_domain_config
,
getUrlParams
(
'/surgery/collect_setting/search'
,
params
))
GetRequest
(
global_domain_config
,
getUrlParams
(
'/surgery/collect_setting/search'
,
params
))
.
then
(
res
=>
{
.
then
(
res
=>
{
console
.
log
(
'获取未定单据借货设置 res====='
,
res
);
console
.
log
(
'获取未定单据借货设置 res====='
,
res
)
if
(
res
.
error_code
==
0
)
{
if
(
res
.
error_code
==
0
)
{
let
{
data
}
=
res
let
{
data
}
=
res
let
filterOpt
=
dedupQuoteArray
(
data
,
'source_inv_code'
)
let
filterOpt
=
dedupQuoteArray
(
data
,
'source_inv_code'
)
dispatch
(
requestListDataSuccess
(
filterOpt
));
dispatch
(
requestListDataSuccess
(
filterOpt
))
}
else
{
}
else
{
showWarnErrorMessage
(
dispatch
,
res
,
exitLoginStatus
,
requestListDataFail
);
showWarnErrorMessage
(
dispatch
,
res
,
exitLoginStatus
,
requestListDataFail
)
}
}
// else if(res.error_code === 41006) {
// else if(res.error_code === 41006) {
// show('登录过期,请重新登录');
// show('登录过期,请重新登录');
// dispatch(exitLoginStatus());
// dispatch(exitLoginStatus());
// }else if(res.status === 404){
// }else if(res.status === 404){
// show('请求接口不存在,请联系管理员!')
// show('请求接口不存在,请联系管理员!')
// dispatch(requestListDataFail());
// dispatch(requestListDataFail());
// } 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(requestListDataFail());
// dispatch(requestListDataFail());
// }
// }
})
})
.
catch
(
err
=>
{
.
catch
(
err
=>
{
// console.log('------err-====获取未定单据借货设置----', Object.keys(err), err)
// console.log('------err-====获取未定单据借货设置----', Object.keys(err), err)
// show(err.error);
// show(err.error);
// dispatch(requestListDataFail());
// dispatch(requestListDataFail());
showErrorMessage
(
dispatch
,
err
,
requestListDataFail
,
'获取未定单据借货设置'
);
showErrorMessage
(
dispatch
,
err
,
requestListDataFail
,
'获取未定单据借货设置'
)
})
})
}
}
}
}
export
const
reqSelfOrganizations
=
async
(
global_domain_config
,
params
)
=>
{
export
const
reqSelfOrganizations
=
async
(
global_domain_config
,
params
)
=>
{
return
await
GetRequest
(
global_domain_config
,
getUrlParams
(
'/authorized_inventory/search'
,
params
))
return
await
GetRequest
(
global_domain_config
,
getUrlParams
(
'/authorized_inventory/search'
,
params
))
}
}
export
const
reqOrgDepartments
=
async
(
global_domain_config
,
params
)
=>
{
export
const
reqOrgDepartments
=
async
(
global_domain_config
,
params
)
=>
{
return
await
GetRequest
(
global_domain_config
,
getUrlParams
(
'/sale/sale_relationship/search'
,
params
))
return
await
GetRequest
(
global_domain_config
,
getUrlParams
(
'/sale/sale_relationship/search'
,
params
))
}
}
// 获取客户名称 params={access_token:'', org_code:'', seller_code:''}
// 获取客户名称 params={access_token:'', org_code:'', seller_code:''}
export
function
requestSelfSurgeryHospital
(
params
)
{
export
function
requestSelfSurgeryHospital
(
params
)
{
return
(
dispatch
,
getState
)
=>
{
return
(
dispatch
,
getState
)
=>
{
dispatch
(
requestListDataing
());
dispatch
(
requestListDataing
())
let
{
global_domain_config
}
=
getState
().
login
let
{
global_domain_config
}
=
getState
().
login
GetRequest
(
global_domain_config
,
getUrlParams
(
'/sale/seller_customer/search'
,
params
))
GetRequest
(
global_domain_config
,
getUrlParams
(
'/sale/seller_customer/search'
,
params
))
.
then
(
res
=>
{
.
then
(
res
=>
{
console
.
log
(
'获取客户名称 res====='
,
res
);
console
.
log
(
'获取客户名称 res====='
,
res
)
if
(
res
.
error_code
==
0
)
{
if
(
res
.
error_code
==
0
)
{
let
{
data
:
{
customers
}
}
=
res
let
{
dispatch
(
requestListDataSuccess
(
customers
));
data
:
{
customers
},
}
else
{
}
=
res
showWarnErrorMessage
(
dispatch
,
res
,
exitLoginStatus
,
requestListDataFail
)
dispatch
(
requestListDataSuccess
(
customers
))
}
}
else
{
// else if(res.error_code === 41006) {
showWarnErrorMessage
(
dispatch
,
res
,
exitLoginStatus
,
requestListDataFail
)
// show('登录过期,请重新登录');
}
// dispatch(exitLoginStatus());
// else if(res.error_code === 41006) {
// } else {
// show('登录过期,请重新登录');
// let error_msg = res.error_msg || res.message
// dispatch(exitLoginStatus());
// show(error_msg);
// } else {
// dispatch(requestListDataFail());
// let error_msg = res.error_msg || res.message
// }
// show(error_msg);
})
// dispatch(requestListDataFail());
.
catch
(
err
=>
{
// }
showErrorMessage
(
dispatch
,
err
,
requestListDataFail
,
'获取客户名称'
)
})
// console.log('------err--====获取客户名称----', Object.keys(err), err)
.
catch
(
err
=>
{
// show(err.error);
showErrorMessage
(
dispatch
,
err
,
requestListDataFail
,
'获取客户名称'
)
// dispatch(requestListDataFail());
// console.log('------err--====获取客户名称----', Object.keys(err), err)
})
// show(err.error);
}
// dispatch(requestListDataFail());
})
}
}
}
export
const
reqSelfSurgeryHospital
=
async
(
global_domain_config
,
params
)
=>
{
export
const
reqSelfSurgeryHospital
=
async
(
global_domain_config
,
params
)
=>
{
return
await
GetRequest
(
global_domain_config
,
getUrlParams
(
'/sale/seller_customer/search'
,
params
))
return
await
GetRequest
(
global_domain_config
,
getUrlParams
(
'/sale/seller_customer/search'
,
params
))
}
}
// 获取订单类型 params={access_token:'', value_set_code:'SUR_ORDER_TYPE'}
// 获取订单类型 params={access_token:'', value_set_code:'SUR_ORDER_TYPE'}
export
function
requestSelfOrderType
(
params
,
url
)
{
export
function
requestSelfOrderType
(
params
,
url
)
{
return
(
dispatch
,
getState
)
=>
{
return
(
dispatch
,
getState
)
=>
{
dispatch
(
requestListDataing
());
dispatch
(
requestListDataing
())
let
{
global_domain_config
}
=
getState
().
login
let
{
global_domain_config
}
=
getState
().
login
// GetRequest(global_domain_config, getUrlParams('/system/value_set/search', params))
// GetRequest(global_domain_config, getUrlParams('/system/value_set/search', params))
if
(
!
url
)
{
url
=
'/system/order_type/search'
}
GetRequest
(
global_domain_config
,
getUrlParams
(
url
,
params
))
.
then
(
res
=>
{
console
.
log
(
'获取订单类型 res====='
,
res
)
// 兼容老的接口,有的环境没有实现获取订单类型接口
if
(
res
.
status
===
404
)
{
return
dispatch
(
requestSelfOrderType
(
params
,
'/system/value_set/search'
))
}
if
(
res
.
error_code
==
0
)
{
let
data
=
[]
if
(
R
.
includes
(
'order_type'
,
url
))
{
data
=
R
.
map
(
R
.
applySpec
({
value_name
:
R
.
prop
(
'order_type_name'
),
value_code
:
R
.
prop
(
'order_type_code'
),
}),
)(
res
.
data
)
}
else
{
data
=
res
.
data
.
sys_values
}
dispatch
(
requestListDataSuccess
(
data
))
}
else
{
showWarnErrorMessage
(
dispatch
,
res
,
exitLoginStatus
,
requestListDataFail
)
}
})
.
catch
(
err
=>
{
if
(
!
url
)
{
if
(
!
url
)
{
url
=
'/system/order_type/search'
requestSelfOrderType
(
params
,
'/system/value_set/search'
)
}
else
{
showErrorMessage
(
dispatch
,
err
,
requestListDataFail
,
'获取订单类型'
)
}
}
GetRequest
(
global_domain_config
,
getUrlParams
(
url
,
params
))
})
.
then
(
res
=>
{
}
console
.
log
(
'获取订单类型 res====='
,
res
);
// 兼容老的接口,有的环境没有实现获取订单类型接口
if
(
res
.
status
===
404
)
{
return
dispatch
(
requestSelfOrderType
(
params
,
'/system/value_set/search'
))
}
if
(
res
.
error_code
==
0
)
{
let
data
=
[]
if
(
R
.
includes
(
'order_type'
,
url
))
{
data
=
R
.
map
(
R
.
applySpec
({
value_name
:
R
.
prop
(
'order_type_name'
),
value_code
:
R
.
prop
(
'order_type_code'
),
}))(
res
.
data
)
}
else
{
data
=
res
.
data
.
sys_values
}
dispatch
(
requestListDataSuccess
(
data
));
}
else
{
showWarnErrorMessage
(
dispatch
,
res
,
exitLoginStatus
,
requestListDataFail
)
}
})
.
catch
(
err
=>
{
if
(
!
url
)
{
requestSelfOrderType
(
params
,
'/system/value_set/search'
)
}
else
{
showErrorMessage
(
dispatch
,
err
,
requestListDataFail
,
'获取订单类型'
)
}
})
}
}
}
// 获取配台模板 params={access_token:'', org_code:'', seller_code: 'shi.ming', customer_code: '', surgery_type: '', doctor_name: ''}
// 获取配台模板 params={access_token:'', org_code:'', seller_code: 'shi.ming', customer_code: '', surgery_type: '', doctor_name: ''}
export
function
requestSelfTemplateCollect
(
params
)
{
export
function
requestSelfTemplateCollect
(
params
)
{
return
(
dispatch
,
getState
)
=>
{
return
(
dispatch
,
getState
)
=>
{
dispatch
(
requestListDataing
());
dispatch
(
requestListDataing
())
let
{
global_domain_config
}
=
getState
().
login
let
{
global_domain_config
}
=
getState
().
login
GetRequest
(
global_domain_config
,
getUrlParams
(
'/surgery/template_header/search'
,
params
))
GetRequest
(
global_domain_config
,
getUrlParams
(
'/surgery/template_header/search'
,
params
))
.
then
(
res
=>
{
.
then
(
res
=>
{
console
.
log
(
'获取配台模板 res====='
,
res
);
console
.
log
(
'获取配台模板 res====='
,
res
)
if
(
res
.
error_code
==
0
)
{
if
(
res
.
error_code
==
0
)
{
let
{
data
:
{
surgery_template_headers
}
}
=
res
let
{
dispatch
(
requestListDataSuccess
(
surgery_template_headers
));
data
:
{
surgery_template_headers
},
}
else
{
}
=
res
showWarnErrorMessage
(
dispatch
,
res
,
exitLoginStatus
,
requestListDataFail
)
dispatch
(
requestListDataSuccess
(
surgery_template_headers
))
}
}
else
{
// else if(res.error_code === 41006) {
showWarnErrorMessage
(
dispatch
,
res
,
exitLoginStatus
,
requestListDataFail
)
// show('登录过期,请重新登录');
}
// dispatch(exitLoginStatus());
// else if(res.error_code === 41006) {
// } else {
// show('登录过期,请重新登录');
// let error_msg = res.error_msg || res.message
// dispatch(exitLoginStatus());
// show(error_msg);
// } else {
// dispatch(requestListDataFail());
// let error_msg = res.error_msg || res.message
// }
// show(error_msg);
})
// dispatch(requestListDataFail());
.
catch
(
err
=>
{
// }
showErrorMessage
(
dispatch
,
err
,
requestListDataFail
,
'获取配台模板'
)
})
// console.log('------err--====获取配台模板----', Object.keys(err), err)
.
catch
(
err
=>
{
// show(err.error);
showErrorMessage
(
dispatch
,
err
,
requestListDataFail
,
'获取配台模板'
)
// dispatch(requestListDataFail());
// console.log('------err--====获取配台模板----', Object.keys(err), err)
})
// show(err.error);
}
// dispatch(requestListDataFail());
})
}
}
}
// 获取手术类型 params={access_token:'', value_set_code:'ORTHOPEDICS_PRODUCT_CLASS'}
// 获取手术类型 params={access_token:'', value_set_code:'ORTHOPEDICS_PRODUCT_CLASS'}
export
function
requestSelfSurgeryType
(
params
)
{
export
function
requestSelfSurgeryType
(
params
)
{
return
(
dispatch
,
getState
)
=>
{
return
(
dispatch
,
getState
)
=>
{
dispatch
(
requestListDataing
());
dispatch
(
requestListDataing
())
let
{
global_domain_config
}
=
getState
().
login
let
{
global_domain_config
}
=
getState
().
login
GetRequest
(
global_domain_config
,
getUrlParams
(
'/system/value_set/search'
,
params
))
GetRequest
(
global_domain_config
,
getUrlParams
(
'/system/value_set/search'
,
params
))
.
then
(
res
=>
{
.
then
(
res
=>
{
console
.
log
(
'获取手术类型 res====='
,
res
);
console
.
log
(
'获取手术类型 res====='
,
res
)
if
(
res
.
error_code
==
0
)
{
if
(
res
.
error_code
==
0
)
{
let
typeOption
=
[]
let
typeOption
=
[]
let
{
data
:
{
value_set_code
,
sys_values
}
}
=
res
let
{
if
(
value_set_code
===
'ORTHOPEDICS_PRODUCT_CLASS'
&&
sys_values
&&
sys_values
.
length
)
{
data
:
{
value_set_code
,
sys_values
},
typeOption
=
sys_values
}
=
res
}
if
(
value_set_code
===
'ORTHOPEDICS_PRODUCT_CLASS'
&&
sys_values
&&
sys_values
.
length
)
{
dispatch
(
requestListDataSuccess
(
typeOption
));
typeOption
=
sys_values
}
else
{
}
showWarnErrorMessage
(
dispatch
,
res
,
exitLoginStatus
,
requestListDataFail
)
dispatch
(
requestListDataSuccess
(
typeOption
))
}
}
else
{
// else if(res.error_code === 41006) {
showWarnErrorMessage
(
dispatch
,
res
,
exitLoginStatus
,
requestListDataFail
)
// show('登录过期,请重新登录');
}
// dispatch(exitLoginStatus());
// else if(res.error_code === 41006) {
// } else {
// show('登录过期,请重新登录');
// let error_msg = res.error_msg || res.message
// dispatch(exitLoginStatus());
// show(error_msg);
// } else {
// dispatch(requestListDataFail());
// let error_msg = res.error_msg || res.message
// }
// show(error_msg);
})
// dispatch(requestListDataFail());
.
catch
(
err
=>
{
// }
showErrorMessage
(
dispatch
,
err
,
requestListDataFail
,
'获取手术类型'
)
})
// console.log('------err--====获取手术类型----', Object.keys(err), err)
.
catch
(
err
=>
{
// show(err.error);
showErrorMessage
(
dispatch
,
err
,
requestListDataFail
,
'获取手术类型'
)
// dispatch(requestListDataFail());
// console.log('------err--====获取手术类型----', Object.keys(err), err)
})
// show(err.error);
}
// dispatch(requestListDataFail());
})
}
}
}
function
requestListDataing
()
{
function
requestListDataing
()
{
return
{
return
{
type
:
SELF_ORDER_LIST_DOING
type
:
SELF_ORDER_LIST_DOING
,
}
}
}
}
export
function
requestListDataSuccess
(
data
)
{
export
function
requestListDataSuccess
(
data
)
{
return
{
return
{
type
:
SELF_ORDER_LIST_SUCCESS
,
type
:
SELF_ORDER_LIST_SUCCESS
,
rawData
:
data
rawData
:
data
,
}
}
}
}
function
requestListDataFail
()
{
function
requestListDataFail
()
{
return
{
return
{
type
:
SELF_ORDER_LIST_FAILURE
type
:
SELF_ORDER_LIST_FAILURE
,
}
}
}
}
// 上传语音
// 上传语音
export
const
requestSelfAudio
=
async
(
global_domain_config
,
params
)
=>
{
export
const
requestSelfAudio
=
async
(
global_domain_config
,
params
)
=>
{
let
{
access_token
,
path
}
=
params
let
{
access_token
,
path
}
=
params
let
formData
=
new
FormData
()
let
formData
=
new
FormData
()
let
soundPath
=
`file://
${
path
}
`
let
soundPath
=
`file://
${
path
}
`
let
fileName
=
path
.
substring
(
path
.
lastIndexOf
(
'/'
)
+
1
,
path
.
length
)
let
fileName
=
path
.
substring
(
path
.
lastIndexOf
(
'/'
)
+
1
,
path
.
length
)
let
file
=
{
uri
:
soundPath
,
type
:
"multipart/form-data"
,
name
:
fileName
}
let
file
=
{
uri
:
soundPath
,
type
:
'multipart/form-data'
,
name
:
fileName
}
formData
.
append
(
'file'
,
file
)
formData
.
append
(
'file'
,
file
)
return
await
UploadRequest
(
global_domain_config
,
getUrlParams
(
'/dingding/upload_media'
,
{
access_token
}),
formData
)
return
await
UploadRequest
(
global_domain_config
,
getUrlParams
(
'/dingding/upload_media'
,
{
access_token
}),
formData
)
}
}
// 提交数据
// 提交数据
export
function
requestSelfSumbit
({
access_token
,
...
params
})
{
export
function
requestSelfSumbit
({
access_token
,
...
params
})
{
return
(
dispatch
,
getState
)
=>
{
return
(
dispatch
,
getState
)
=>
{
dispatch
(
requestSubmiting
());
dispatch
(
requestSubmiting
())
let
{
global_domain_config
}
=
getState
().
login
let
{
global_domain_config
}
=
getState
().
login
PostRequest
(
global_domain_config
,
getUrlParams
(
'/surgery/collect_order/via_data/create'
,
{
access_token
:
access_token
}),
params
)
PostRequest
(
// PostRequest(global_domain_config, getUrlParams('/order/sur_requirement/create', {access_token: access_token}), params)
global_domain_config
,
.
then
(
res
=>
{
getUrlParams
(
'/surgery/collect_order/via_data/create'
,
{
access_token
:
access_token
}),
console
.
log
(
'提交数据 res====='
,
res
);
params
,
if
(
res
.
error_code
==
0
)
{
)
let
{
data
}
=
res
// PostRequest(global_domain_config, getUrlParams('/order/sur_requirement/create', {access_token: access_token}), params)
dispatch
(
requestSubmitSuccess
(
data
));
.
then
(
res
=>
{
}
else
{
console
.
log
(
'提交数据 res====='
,
res
)
showWarnErrorMessage
(
dispatch
,
res
,
exitLoginStatus
,
requestSubmitFail
)
if
(
res
.
error_code
==
0
)
{
}
let
{
data
}
=
res
// else if(res.error_code === 41006) {
dispatch
(
requestSubmitSuccess
(
data
))
// show('登录过期,请重新登录');
}
else
{
// dispatch(exitLoginStatus());
showWarnErrorMessage
(
dispatch
,
res
,
exitLoginStatus
,
requestSubmitFail
)
// } else {
}
// let error_msg = res.error_msg || res.message
// else if(res.error_code === 41006) {
// show(error_msg);
// show('登录过期,请重新登录');
// dispatch(requestSubmitFail());
// dispatch(exitLoginStatus());
// }
// } else {
})
// let error_msg = res.error_msg || res.message
.
catch
(
err
=>
{
// show(error_msg);
showErrorMessage
(
dispatch
,
err
,
requestSubmitFail
,
'提交数据'
)
// dispatch(requestSubmitFail());
// console.log('------err--====提交数据----', Object.keys(err), err)
// }
// show(err.error);
})
// dispatch(requestSubmitFail());
.
catch
(
err
=>
{
})
showErrorMessage
(
dispatch
,
err
,
requestSubmitFail
,
'提交数据'
)
}
// console.log('------err--====提交数据----', Object.keys(err), err)
// show(err.error);
// dispatch(requestSubmitFail());
})
}
}
}
// 选择产品-供应商信息查询接口
// 选择产品-供应商信息查询接口
export
const
reqPurSupplierSearch
=
async
(
global_domain_config
,
params
)
=>
{
export
const
reqPurSupplierSearch
=
async
(
global_domain_config
,
params
)
=>
{
// return local_inter_mock.inter_1
// return local_inter_mock.inter_1
return
await
GetRequest
(
global_domain_config
,
getUrlParams
(
'/order/pur_supplier/search'
,
params
))
return
await
GetRequest
(
global_domain_config
,
getUrlParams
(
'/order/pur_supplier/search'
,
params
))
}
}
// 选择产品-产品信息分类查询接口
// 选择产品-产品信息分类查询接口
export
const
reqProCategorySearch
=
async
(
global_domain_config
,
params
)
=>
{
export
const
reqProCategorySearch
=
async
(
global_domain_config
,
params
)
=>
{
// return local_inter_mock.inter_2
// return local_inter_mock.inter_2
return
await
GetRequest
(
global_domain_config
,
getUrlParams
(
'/order/item/search'
,
params
))
return
await
GetRequest
(
global_domain_config
,
getUrlParams
(
'/order/item/search'
,
params
))
}
}
// 选择产品-手术套包头查询接口
// 选择产品-手术套包头查询接口
export
const
reqSurTempHeadSearch
=
async
(
global_domain_config
,
params
)
=>
{
export
const
reqSurTempHeadSearch
=
async
(
global_domain_config
,
params
)
=>
{
// return local_inter_mock.inter_3
// return local_inter_mock.inter_3
return
await
GetRequest
(
global_domain_config
,
getUrlParams
(
'/surgery/template_header/search'
,
params
))
return
await
GetRequest
(
global_domain_config
,
getUrlParams
(
'/surgery/template_header/search'
,
params
))
}
}
// 选择产品-手术套包行查询接口
// 选择产品-手术套包行查询接口
export
const
reqSurTempLineSearch
=
async
(
global_domain_config
,
params
)
=>
{
export
const
reqSurTempLineSearch
=
async
(
global_domain_config
,
params
)
=>
{
// return local_inter_mock.inter_4
// return local_inter_mock.inter_4
return
await
GetRequest
(
global_domain_config
,
getUrlParams
(
'/surgery/template_line/search'
,
params
))
return
await
GetRequest
(
global_domain_config
,
getUrlParams
(
'/surgery/template_line/search'
,
params
))
}
}
// 选择产品-螺钉盒(器械包)头查询接口
// 选择产品-螺钉盒(器械包)头查询接口
export
const
reqNailEquipHeadSearch
=
async
(
global_domain_config
,
params
)
=>
{
export
const
reqNailEquipHeadSearch
=
async
(
global_domain_config
,
params
)
=>
{
// if(params.category_code === '1301'){
// if(params.category_code === '1301'){
// return local_inter_mock.inter_5
// return local_inter_mock.inter_5
// }else {
// }else {
// return local_inter_mock.inter_55
// return local_inter_mock.inter_55
// }
// }
return
await
GetRequest
(
global_domain_config
,
getUrlParams
(
'/inventory/item_package_header/search'
,
params
))
return
await
GetRequest
(
global_domain_config
,
getUrlParams
(
'/inventory/item_package_header/search'
,
params
))
}
}
// 选择产品-螺钉盒明细查询接口
// 选择产品-螺钉盒明细查询接口
export
const
reqNailBoxLineSearch
=
async
(
global_domain_config
,
params
)
=>
{
export
const
reqNailBoxLineSearch
=
async
(
global_domain_config
,
params
)
=>
{
// return local_inter_mock.inter_6
// return local_inter_mock.inter_6
return
await
GetRequest
(
global_domain_config
,
getUrlParams
(
'/inventory/nail_box_template_detail/search'
,
params
))
return
await
GetRequest
(
global_domain_config
,
getUrlParams
(
'/inventory/nail_box_template_detail/search'
,
params
))
}
}
// 选择产品-器械包明细查询接口
// 选择产品-器械包明细查询接口
export
const
reqEquipPackageLineSearch
=
async
(
global_domain_config
,
params
)
=>
{
export
const
reqEquipPackageLineSearch
=
async
(
global_domain_config
,
params
)
=>
{
// return local_inter_mock.inter_7
// return local_inter_mock.inter_7
return
await
GetRequest
(
global_domain_config
,
getUrlParams
(
'/inventory/item_package/search'
,
params
))
return
await
GetRequest
(
global_domain_config
,
getUrlParams
(
'/inventory/item_package/search'
,
params
))
}
}
// 选择产品-螺钉盒明细/器械包明细查询接口
// 选择产品-螺钉盒明细/器械包明细查询接口
export
const
reqNailAndEquipSearch
=
async
(
global_domain_config
,
params
)
=>
{
export
const
reqNailAndEquipSearch
=
async
(
global_domain_config
,
params
)
=>
{
// if(params.nail_box_flag == 'Y'){
// if(params.nail_box_flag == 'Y'){
// return local_inter_mock.inter_6
// return local_inter_mock.inter_6
// }else {
// }else {
// return local_inter_mock.inter_77
// return local_inter_mock.inter_77
// }
// }
return
await
GetRequest
(
global_domain_config
,
getUrlParams
(
'/inventory/item_package_detail/search'
,
params
))
return
await
GetRequest
(
global_domain_config
,
getUrlParams
(
'/inventory/item_package_detail/search'
,
params
))
}
}
// 选择产品-零散器械查询接口
// 选择产品-零散器械查询接口
export
const
reqScatEquipmentSearch
=
async
(
global_domain_config
,
params
)
=>
{
export
const
reqScatEquipmentSearch
=
async
(
global_domain_config
,
params
)
=>
{
// return local_inter_mock.inter_8
// return local_inter_mock.inter_8
return
await
GetRequest
(
global_domain_config
,
getUrlParams
(
'/order/tool/search'
,
params
))
return
await
GetRequest
(
global_domain_config
,
getUrlParams
(
'/order/tool/search'
,
params
))
}
}
// 选择产品-单点耗材查询接口
// 选择产品-单点耗材查询接口
export
const
reqSingleConsumSearch
=
async
(
global_domain_config
,
params
)
=>
{
export
const
reqSingleConsumSearch
=
async
(
global_domain_config
,
params
)
=>
{
// if(params.leftIndex && params.leftIndex%2 === 0){
// if(params.leftIndex && params.leftIndex%2 === 0){
// return local_inter_mock.inter_9
// return local_inter_mock.inter_9
// }else {
// }else {
// return local_inter_mock.inter_99
// return local_inter_mock.inter_99
// }
// }
return
await
GetRequest
(
global_domain_config
,
getUrlParams
(
'/order/item_detail/search'
,
params
))
return
await
GetRequest
(
global_domain_config
,
getUrlParams
(
'/order/item_detail/search'
,
params
))
}
export
const
reqGlobalSearch
=
async
(
global_domain_config
,
params
)
=>
{
return
await
GetRequest
(
global_domain_config
,
getUrlParams
(
'/order/item/global_search'
,
params
))
}
}
function
requestSubmiting
()
{
function
requestSubmiting
()
{
return
{
return
{
type
:
SELF_SUBMIT_DOING
type
:
SELF_SUBMIT_DOING
,
}
}
}
}
function
requestSubmitSuccess
(
data
)
{
function
requestSubmitSuccess
(
data
)
{
return
{
return
{
type
:
SELF_SUBMIT_SUCCESS
,
type
:
SELF_SUBMIT_SUCCESS
,
rawData
:
data
rawData
:
data
,
}
}
}
}
function
requestSubmitFail
()
{
function
requestSubmitFail
()
{
return
{
return
{
type
:
SELF_SUBMIT_FAILURE
type
:
SELF_SUBMIT_FAILURE
,
}
}
}
}
// 初始化数据
// 初始化数据
export
function
setSelfInitData
()
{
export
function
setSelfInitData
()
{
return
{
return
{
type
:
SELF_INIT_DATA
type
:
SELF_INIT_DATA
,
}
}
}
}
// 存储选择产品数据
// 存储选择产品数据
export
function
setSelectProductOpts
(
data
)
{
export
function
setSelectProductOpts
(
data
)
{
return
{
return
{
type
:
SET_SELECT_PRODUCT_OPTS
,
type
:
SET_SELECT_PRODUCT_OPTS
,
rawData
:
data
rawData
:
data
,
}
}
}
}
/**
/**
...
@@ -415,7 +428,7 @@ export function setSelectProductOpts(data) {
...
@@ -415,7 +428,7 @@ export function setSelectProductOpts(data) {
* @return {*}
* @return {*}
*/
*/
export
async
function
requestSurgeryType
(
global_domain_config
,
params
)
{
export
async
function
requestSurgeryType
(
global_domain_config
,
params
)
{
return
await
GetRequest
(
global_domain_config
,
getUrlParams
(
`/inventory/category/search`
,
params
))
return
await
GetRequest
(
global_domain_config
,
getUrlParams
(
`/inventory/category/search`
,
params
))
}
}
/**
/**
...
@@ -424,22 +437,22 @@ export async function requestSurgeryType(global_domain_config, params) {
...
@@ -424,22 +437,22 @@ export async function requestSurgeryType(global_domain_config, params) {
* @return {*}
* @return {*}
*/
*/
export
function
getLendOrderCodeValues
()
{
export
function
getLendOrderCodeValues
()
{
return
(
dispatch
,
getState
)
=>
{
return
(
dispatch
,
getState
)
=>
{
let
{
global_domain_config
,
token
}
=
getState
().
login
let
{
global_domain_config
,
token
}
=
getState
().
login
const
params
=
{
const
params
=
{
access_token
:
token
,
access_token
:
token
,
value_set_code
:
'OBS_MOBILE_LEND_ORDER'
value_set_code
:
'OBS_MOBILE_LEND_ORDER'
,
}
GetRequest
(
global_domain_config
,
getUrlParams
(
'/system/value_set/search'
,
params
)).
then
(
res
=>
{
const
values
=
R
.
pathOr
([],
[
'data'
,
'sys_values'
])(
res
)
dispatch
(
setLendOrderCodeValues
(
values
))
})
}
}
GetRequest
(
global_domain_config
,
getUrlParams
(
'/system/value_set/search'
,
params
)).
then
(
res
=>
{
const
values
=
R
.
pathOr
([],
[
'data'
,
'sys_values'
])(
res
)
dispatch
(
setLendOrderCodeValues
(
values
))
})
}
}
}
export
function
setLendOrderCodeValues
(
values
)
{
export
function
setLendOrderCodeValues
(
values
)
{
return
{
return
{
type
:
SET_LEND_ORDER_VALUES
,
type
:
SET_LEND_ORDER_VALUES
,
values
values
,
}
}
}
}
app/containers/common/listDataComponent/PicTitDetaiCalcu.js
View file @
4b2389b1
import
React
,
{
Component
}
from
'react'
;
import
React
,
{
Component
}
from
'react'
import
{
StyleSheet
,
Image
,
Text
,
TouchableOpacity
,
View
}
from
'react-native'
;
import
{
StyleSheet
,
Image
,
Text
,
TouchableOpacity
,
View
}
from
'react-native'
import
{
connect
}
from
'react-redux'
;
import
{
connect
}
from
'react-redux'
import
{
first_text_color
,
font_family_medium
,
font_family_regular
,
font_family_semibold
,
home_background_color
,
icon_style
,
pxSize
,
second_text_size
,
third_text_color
,
third_text_size
,
list_tit_color
,
list_str_color
,
list_one_color
,
list_thr_color
,
list_one_light_color
}
from
'../../../base/BaseStyle'
;
import
{
import
PictureZoom
from
'../../common/listDataComponent/PictureZoom'
;
first_text_color
,
import
LocalVariable
from
'../LocalVariable'
;
font_family_medium
,
const
PropTypes
=
require
(
'prop-types'
);
font_family_regular
,
font_family_semibold
,
home_background_color
,
icon_style
,
pxSize
,
second_text_size
,
third_text_color
,
third_text_size
,
list_tit_color
,
list_str_color
,
list_one_color
,
list_thr_color
,
list_one_light_color
,
}
from
'../../../base/BaseStyle'
import
PictureZoom
from
'../../common/listDataComponent/PictureZoom'
import
LocalVariable
from
'../LocalVariable'
const
PropTypes
=
require
(
'prop-types'
)
/**
/**
* 列表组件,图片-标题(提示)-计算/关闭
* 列表组件,图片-标题(提示)-计算/关闭
*/
*/
class
PicTitDetaiCalcu
extends
Component
{
class
PicTitDetaiCalcu
extends
Component
{
static
propTypres
=
{
listItem
:
PropTypes
.
object
,
listIndex
:
PropTypes
.
number
,
listStyleBox
:
PropTypes
.
object
,
listStyleTit
:
PropTypes
.
object
,
listStyleTip
:
PropTypes
.
object
,
listStyleCalBtn
:
PropTypes
.
object
,
listPicType
:
PropTypes
.
string
,
// 每一列图片类型
subCalCallBack
:
PropTypes
.
func
,
// 计算后回调给父组件
calField
:
PropTypes
.
string
,
// 计算的字段名
titCallBack
:
PropTypes
.
func
,
// 标题回调函数
titText
:
PropTypes
.
string
,
// 标题
titTextTit
:
PropTypes
.
string
,
tipTextStr
:
PropTypes
.
string
,
tipTextStrTit
:
PropTypes
.
string
,
tipTextOne
:
PropTypes
.
string
,
tipTextOneTit
:
PropTypes
.
string
,
tipTextTwo
:
PropTypes
.
string
,
tipTextTwoTit
:
PropTypes
.
string
,
tipTextThr
:
PropTypes
.
string
,
tipTextThrTit
:
PropTypes
.
string
,
listImgIcon
:
PropTypes
.
string
,
listStyleImg
:
PropTypes
.
objec
,
plusCallBack
:
PropTypes
.
func
,
// 加法的回调函数
reduceCallBack
:
PropTypes
.
func
,
// 减法的回调函数
showClearIcon
:
PropTypes
.
bool
,
// 展示减少x图标,不展示加减
showClearIndex
:
PropTypes
.
number
,
// 展示index
listCardActIndex
:
PropTypes
.
number
,
// 父级index = 展示index
listStyleClearBtn
:
PropTypes
.
object
,
clearCallBack
:
PropTypes
.
func
,
// 清空图标回调函数
onlyShowNum
:
PropTypes
.
bool
,
// 只展示数字
onlyShowSelect
:
PropTypes
.
bool
,
// 只能单选
listMaxNum
:
PropTypes
.
number
,
// 数量限制最大值
listShowOthOptFlag
:
PropTypes
.
bool
,
// 展示耗材详情
}
static
propTypres
=
{
constructor
(
props
)
{
listItem
:
PropTypes
.
object
,
super
(
props
)
listIndex
:
PropTypes
.
number
,
this
.
state
=
{
listStyleBox
:
PropTypes
.
object
,
listPicTypeArr
:
[
'ROUND'
,
'SQUARE'
,
'RECTANGLE'
],
listStyleTit
:
PropTypes
.
object
,
picStyleArr
:
[
'round_pic'
,
'square_pic'
,
'rectan_pic'
],
listStyleTip
:
PropTypes
.
object
,
showOtherFlag
:
true
,
listStyleCalBtn
:
PropTypes
.
object
,
showOtherTitle
:
'点击隐藏具体详情'
,
listPicType
:
PropTypes
.
string
,
// 每一列图片类型
subCalCallBack
:
PropTypes
.
func
,
// 计算后回调给父组件
calField
:
PropTypes
.
string
,
// 计算的字段名
titCallBack
:
PropTypes
.
func
,
// 标题回调函数
titText
:
PropTypes
.
string
,
// 标题
titTextTit
:
PropTypes
.
string
,
tipTextStr
:
PropTypes
.
string
,
tipTextStrTit
:
PropTypes
.
string
,
tipTextOne
:
PropTypes
.
string
,
tipTextOneTit
:
PropTypes
.
string
,
tipTextTwo
:
PropTypes
.
string
,
tipTextTwoTit
:
PropTypes
.
string
,
tipTextThr
:
PropTypes
.
string
,
tipTextThrTit
:
PropTypes
.
string
,
listImgIcon
:
PropTypes
.
string
,
listStyleImg
:
PropTypes
.
objec
,
plusCallBack
:
PropTypes
.
func
,
// 加法的回调函数
reduceCallBack
:
PropTypes
.
func
,
// 减法的回调函数
showClearIcon
:
PropTypes
.
bool
,
// 展示减少x图标,不展示加减
showClearIndex
:
PropTypes
.
number
,
// 展示index
listCardActIndex
:
PropTypes
.
number
,
// 父级index = 展示index
listStyleClearBtn
:
PropTypes
.
object
,
clearCallBack
:
PropTypes
.
func
,
// 清空图标回调函数
onlyShowNum
:
PropTypes
.
bool
,
// 只展示数字
onlyShowSelect
:
PropTypes
.
bool
,
// 只能单选
listMaxNum
:
PropTypes
.
number
,
// 数量限制最大值
listShowOthOptFlag
:
PropTypes
.
bool
,
// 展示耗材详情
}
}
}
constructor
(
props
)
{
// 单选点击
super
(
props
);
handelSelectCheck
(
item
,
index
)
{
this
.
state
=
{
item
.
select
=
!!!
item
.
select
listPicTypeArr
:
[
'ROUND'
,
'SQUARE'
,
'RECTANGLE'
],
this
.
props
.
subCalCallBack
(
item
,
index
)
picStyleArr
:
[
'round_pic'
,
'square_pic'
,
'rectan_pic'
],
}
showOtherFlag
:
true
,
showOtherTitle
:
'点击隐藏具体详情'
}
}
// 单选点击
/**
handelSelectCheck
(
item
,
index
)
{
* 点击加减
item
.
select
=
!!!
item
.
select
* @param {object} item 当前小类数据
this
.
props
.
subCalCallBack
(
item
,
index
)
* @param {number} index 当前角标
* @param {boolean} isPlus 默认减法 false,加法 true,
*/
handelCalculation
(
item
,
index
,
isPlus
)
{
let
{
calField
,
plusCallBack
,
reduceCallBack
}
=
this
.
props
if
(
!
isPlus
&&
reduceCallBack
)
{
reduceCallBack
(
item
,
index
)
return
}
}
if
(
isPlus
&&
plusCallBack
)
{
/**
plusCallBack
(
item
,
index
)
* 点击加减
return
* @param {object} item 当前小类数据
* @param {number} index 当前角标
* @param {boolean} isPlus 默认减法 false,加法 true,
*/
handelCalculation
(
item
,
index
,
isPlus
)
{
let
{
calField
,
plusCallBack
,
reduceCallBack
}
=
this
.
props
if
(
!
isPlus
&&
reduceCallBack
)
{
reduceCallBack
(
item
,
index
)
return
}
if
(
isPlus
&&
plusCallBack
)
{
plusCallBack
(
item
,
index
)
return
}
item
[
calField
]
=
Number
(
item
[
calField
])
if
(
Number
.
isNaN
(
item
[
calField
]))
{
item
[
calField
]
=
0
}
if
(
isPlus
)
{
item
[
calField
]
+=
1
}
else
if
(
!
isPlus
&&
item
[
calField
]
>
0
)
{
item
[
calField
]
-=
1
}
this
.
props
.
subCalCallBack
(
item
,
index
)
}
}
item
[
calField
]
=
Number
(
item
[
calField
])
// 具体详情
if
(
Number
.
isNaN
(
item
[
calField
]))
{
showAllTip
(){
item
[
calField
]
=
0
let
{
showOtherFlag
}
=
this
.
state
let
curShowOtherTitle
=
showOtherFlag
?
'点击查看具体详情'
:
'点击隐藏具体详情'
this
.
setState
({
showOtherFlag
:
!
showOtherFlag
,
showOtherTitle
:
curShowOtherTitle
})
}
}
if
(
isPlus
)
{
item
[
calField
]
+=
1
}
else
if
(
!
isPlus
&&
item
[
calField
]
>
0
)
{
item
[
calField
]
-=
1
}
this
.
props
.
subCalCallBack
(
item
,
index
)
}
render
()
{
// 具体详情
let
{
listItem
,
listIndex
,
calField
,
listStyleBox
,
listStyleTit
,
listStyleTip
,
listStyleCalBtn
,
listPicType
,
titCallBack
,
showAllTip
()
{
titText
,
tipTextStr
,
tipTextOne
,
tipTextTwo
,
tipTextThr
,
listImgIcon
,
listStyleImg
,
showClearIcon
,
showClearIndex
,
listCardActIndex
,
let
{
showOtherFlag
}
=
this
.
state
listStyleClearBtn
,
clearCallBack
,
onlyShowNum
,
onlyShowSelect
,
titTextTit
,
tipTextStrTit
,
tipTextOneTit
,
tipTextTwoTit
,
tipTextThrTit
,
let
curShowOtherTitle
=
showOtherFlag
?
'点击查看具体详情'
:
'点击隐藏具体详情'
global_domain_config
,
listMaxNum
,
listShowOthOptFlag
}
=
this
.
props
this
.
setState
({
let
{
listPicTypeArr
,
picStyleArr
,
showOtherFlag
,
showOtherTitle
}
=
this
.
state
showOtherFlag
:
!
showOtherFlag
,
showOtherTitle
:
curShowOtherTitle
,
})
}
let
picOthStyle
=
''
render
()
{
if
(
listPicTypeArr
.
indexOf
(
listPicType
)
>
-
1
)
{
let
{
picOthStyle
=
picStyleArr
[
listPicTypeArr
.
indexOf
(
listPicType
)]
listItem
,
}
listIndex
,
let
valIsZero
=
Boolean
(
listItem
[
calField
]
===
0
)
calField
,
let
calIcon
=
require
(
'../../../images/plur_icon_big.png'
)
listStyleBox
,
if
(
!
valIsZero
)
{
listStyleTit
,
calIcon
=
require
(
'../../../images/plur_big_act.png'
)
listStyleTip
,
}
listStyleCalBtn
,
let
defSelIcon
=
require
(
'../../../images/radio_no.png'
)
listPicType
,
if
(
onlyShowSelect
&&
listItem
.
select
)
{
titCallBack
,
defSelIcon
=
require
(
'../../../images/radio_yes.png'
)
titText
,
}
tipTextStr
,
let
showPlusIcon
=
true
tipTextOne
,
if
(
listMaxNum
&&
listItem
[
calField
]
===
listMaxNum
)
{
tipTextTwo
,
showPlusIcon
=
false
tipTextThr
,
}
listImgIcon
,
let
cur_photos
=
[]
listStyleImg
,
if
(
listItem
[
listImgIcon
]
instanceof
Array
)
{
showClearIcon
,
listItem
[
listImgIcon
].
map
((
iconIt
)
=>
{
showClearIndex
,
cur_photos
.
push
({
url
:
global_domain_config
+
'/jeecg-boot/sys/common/view/'
+
iconIt
})
listCardActIndex
,
})
listStyleClearBtn
,
if
(
listItem
[
listImgIcon
].
length
===
0
){
clearCallBack
,
cur_photos
[
0
]
=
(
require
(
'../../../images/not_img.png'
))
onlyShowNum
,
}
onlyShowSelect
,
}
else
if
(
typeof
listItem
[
listImgIcon
]
===
'string'
){
titTextTit
,
cur_photos
[
0
]
=
{
url
:
global_domain_config
+
'/jeecg-boot/sys/common/view/'
+
listItem
[
listImgIcon
]
}
tipTextStrTit
,
}
tipTextOneTit
,
return
(
tipTextTwoTit
,
<
View
style
=
{[
styles
.
ri_inner
,
listStyleBox
]}
>
tipTextThrTit
,
{(
listImgIcon
&&
cur_photos
.
length
>
0
)
?
global_domain_config
,
<
PictureZoom
listMaxNum
,
listImageIndex
=
{
0
}
listShowOthOptFlag
,
listImageUrls
=
{
cur_photos
}
}
=
this
.
props
listStyleImage
=
{[
styles
.
oth_img_box
,
styles
[
picOthStyle
],
listStyleImg
]}
let
{
listPicTypeArr
,
picStyleArr
,
showOtherFlag
,
showOtherTitle
}
=
this
.
state
listPicType
=
{
listPicType
}
/
>
:
null
}
<
View
style
=
{
styles
.
ri_text_box
}
>
<
TouchableOpacity
activeOpacity
=
{
titCallBack
?
.
8
:
1
}
onPress
=
{()
=>
{
titCallBack
?
titCallBack
(
listItem
,
listIndex
)
:
{}
}}
style
=
{
styles
.
oth_box
}
>
<
Text
numberOfLines
=
{
3
}
style
=
{[
styles
.
thr_ot
,
listStyleTit
]}
>
{
listItem
[
titText
]
?
`
${
listIndex
+
1
}
.
${
listItem
[
titText
]}
`
:
''
}
{
!
listItem
[
titText
]
&&
titTextTit
?
`
${
listIndex
+
1
}
.
${
titTextTit
}
: 无`
:
''
}
<
/Text
>
{
tipTextStrTit
?
<
Text
numberOfLines
=
{
3
}
style
=
{[
styles
.
ri_te_ot
,
styles
.
te_ot_str
,
listStyleTip
]}
>
{
`
${
tipTextStrTit
}
:`
}
{
listItem
[
tipTextStr
]
?
listItem
[
tipTextStr
]
:
'无'
}
<
/Text> : null
}
{
tipTextOneTit
?
<
Text
numberOfLines
=
{
3
}
style
=
{[
styles
.
ri_te_ot
,
styles
.
te_ot_one
,
listStyleTip
]}
>
{
`
${
tipTextOneTit
}
:`
}
{
listItem
[
tipTextOne
]
?
listItem
[
tipTextOne
]
:
'无'
}
<
/Text> : null
}
{
tipTextTwoTit
?
<
Text
numberOfLines
=
{
3
}
style
=
{[
styles
.
ri_te_ot
,
styles
.
te_ot_two
,
listStyleTip
]}
>
{
`
${
tipTextTwoTit
}
:`
}
{
listItem
[
tipTextTwo
]
?
listItem
[
tipTextTwo
]
:
'无'
}
<
/Text> : null
}
{
tipTextThrTit
?
<
Text
numberOfLines
=
{
3
}
style
=
{[
styles
.
ri_te_ot
,
styles
.
te_ot_thr
,
listStyleTip
]}
>
{
`
${
tipTextThrTit
}
:`
}
{
listItem
[
tipTextThr
]
?
listItem
[
tipTextThr
]
:
'无'
}
<
/Text> : null
}
{
listShowOthOptFlag
&&
listItem
[
LocalVariable
.
SUPER_SEL_ALL_ARR
]
?
<
View
>
<
TouchableOpacity
activeOpacity
=
{.
8
}
onPress
=
{()
=>
this
.
showAllTip
()}
>
<
Text
numberOfLines
=
{
3
}
style
=
{[
styles
.
ri_te_ot
,
styles
.
te_ot_thr
,
listStyleTip
]}
>
{
showOtherTitle
}
<
/Text
>
<
/TouchableOpacity
>
{
showOtherFlag
?
listItem
[
LocalVariable
.
SUPER_SEL_ALL_ARR
].
map
((
item
,
item_index
)
=>
{
return
<
View
>
<
Text
numberOfLines
=
{
3
}
style
=
{[
styles
.
ri_te_ot
,
styles
.
te_ot_one
,
listStyleTip
]}
>
{
item_index
+
1
}.
{
item
.
item_name
}
-
<
Text
style
=
{[
styles
.
ri_te_ot
,
styles
.
te_ot_main
,
listStyleTip
]}
>
{
item
.
manufacturer_product_code
}
-
{
item
.
specification
}
<
/Text> - {item.general_name} x {item
[
LocalVariable.QUANTITY_FIELD
]
}
<
/Text
>
<
/View
>
})
:
null
}
<
/View> : null
}
<
/TouchableOpacity
>
<
/View
>
{
(
showClearIcon
&&
listCardActIndex
===
showClearIndex
)
?
<
View
style
=
{
styles
.
btn_cle_box
}
>
<
TouchableOpacity
activeOpacity
=
{.
9
}
style
=
{[
styles
.
btn_clear_inner
,
listStyleClearBtn
]}
onPress
=
{()
=>
clearCallBack
(
listItem
,
listIndex
)}
>
<
View
style
=
{[
styles
.
icon_cle_btn
]}
>
<
Image
source
=
{
require
(
'../../../images/close_icon.png'
)}
style
=
{
icon_style
}
><
/Image
>
<
/View
>
<
/TouchableOpacity
>
<
/View>
:
<
View
style
=
{[
styles
.
ri_num_box
,
onlyShowNum
?
styles
.
show_num_box
:
null
]}
>
{(
listItem
[
calField
]
!==
0
&&
!
onlyShowNum
&&
!
onlyShowSelect
)
?
<
TouchableOpacity
activeOpacity
=
{.
9
}
style
=
{[
styles
.
btn_inner
,
listStyleCalBtn
]}
onPress
=
{()
=>
this
.
handelCalculation
(
listItem
,
listIndex
)}
>
<
View
style
=
{[
styles
.
thr_num_btn
,
styles
.
thr_btn_left
]}
>
<
Image
source
=
{
require
(
'../../../images/less_icon_big.png'
)}
style
=
{
icon_style
}
><
/Image
>
<
/View
>
<
/TouchableOpacity> : null
}
{(
listItem
[
calField
]
!==
0
&&
!
onlyShowSelect
)
?
<
Text
style
=
{[
styles
.
thr_num
,
onlyShowNum
?
styles
.
show_num
:
null
]}
>
{
listItem
[
calField
]}
<
/Text> : null
}
{(
!
onlyShowNum
&&
!
onlyShowSelect
&&
showPlusIcon
)
?
<
TouchableOpacity
activeOpacity
=
{.
9
}
style
=
{[
styles
.
btn_inner
,
listStyleCalBtn
]}
onPress
=
{()
=>
this
.
handelCalculation
(
listItem
,
listIndex
,
true
)}
>
<
View
style
=
{[
styles
.
thr_num_btn
,
styles
.
thr_btn_right
]}
>
<
Image
source
=
{
calIcon
}
style
=
{
icon_style
}
><
/Image
>
<
/View
>
<
/TouchableOpacity> : null
}
{
onlyShowSelect
?
<
TouchableOpacity
let
picOthStyle
=
''
activeOpacity
=
{.
9
}
if
(
listPicTypeArr
.
indexOf
(
listPicType
)
>
-
1
)
{
style
=
{[
styles
.
btn_sel_inner
]}
picOthStyle
=
picStyleArr
[
listPicTypeArr
.
indexOf
(
listPicType
)]
onPress
=
{()
=>
this
.
handelSelectCheck
(
listItem
,
listIndex
)}
>
<
View
style
=
{[
styles
.
thr_sel_btn
]}
>
<
Image
source
=
{
defSelIcon
}
style
=
{
icon_style
}
><
/Image
>
<
/View
>
<
/TouchableOpacity> : nul
l
}
<
/View
>
}
<
/View
>
);
}
}
}
let
valIsZero
=
Boolean
(
listItem
[
calField
]
===
0
)
let
calIcon
=
require
(
'../../../images/plur_icon_big.png'
)
if
(
!
valIsZero
)
{
calIcon
=
require
(
'../../../images/plur_big_act.png'
)
}
let
defSelIcon
=
require
(
'../../../images/radio_no.png'
)
if
(
onlyShowSelect
&&
listItem
.
select
)
{
defSelIcon
=
require
(
'../../../images/radio_yes.png'
)
}
let
showPlusIcon
=
true
if
(
listMaxNum
&&
listItem
[
calField
]
===
listMaxNum
)
{
showPlusIcon
=
false
}
let
cur_photos
=
[]
if
(
listItem
[
listImgIcon
]
instanceof
Array
)
{
listItem
[
listImgIcon
].
map
(
iconIt
=>
{
cur_photos
.
push
({
url
:
global_domain_config
+
'/jeecg-boot/sys/common/view/'
+
iconIt
})
})
if
(
listItem
[
listImgIcon
].
length
===
0
)
{
cur_photos
[
0
]
=
require
(
'../../../images/not_img.png'
)
}
}
else
if
(
typeof
listItem
[
listImgIcon
]
===
'string'
)
{
cur_photos
[
0
]
=
{
url
:
global_domain_config
+
'/jeecg-boot/sys/common/view/'
+
listItem
[
listImgIcon
]
}
}
return
(
<
View
style
=
{[
styles
.
ri_inner
,
listStyleBox
]}
>
{
listImgIcon
&&
cur_photos
.
length
>
0
?
(
<
PictureZoom
listImageIndex
=
{
0
}
listImageUrls
=
{
cur_photos
}
listStyleImage
=
{[
styles
.
oth_img_box
,
styles
[
picOthStyle
],
listStyleImg
]}
listPicType
=
{
listPicType
}
/
>
)
:
null
}
<
View
style
=
{
styles
.
ri_text_box
}
>
<
TouchableOpacity
activeOpacity
=
{
titCallBack
?
0.8
:
1
}
onPress
=
{()
=>
{
titCallBack
?
titCallBack
(
listItem
,
listIndex
)
:
{}
}}
style
=
{
styles
.
oth_box
}
>
<
Text
numberOfLines
=
{
3
}
style
=
{[
styles
.
thr_ot
,
listStyleTit
]}
>
{
listItem
[
titText
]
?
`
${
listIndex
+
1
}
.
${
listItem
[
titText
]}
`
:
''
}
{
!
listItem
[
titText
]
&&
titTextTit
?
`
${
listIndex
+
1
}
.
${
titTextTit
}
: 无`
:
''
}
<
/Text
>
{
tipTextStrTit
?
(
<
Text
numberOfLines
=
{
3
}
style
=
{[
styles
.
ri_te_ot
,
styles
.
te_ot_str
,
listStyleTip
]}
>
{
`
${
tipTextStrTit
}
:`
}
{
listItem
[
tipTextStr
]
?
listItem
[
tipTextStr
]
:
'无'
}
<
/Text
>
)
:
null
}
{
tipTextOneTit
?
(
<
Text
numberOfLines
=
{
3
}
style
=
{[
styles
.
ri_te_ot
,
styles
.
te_ot_one
,
listStyleTip
]}
>
{
`
${
tipTextOneTit
}
:`
}
{
listItem
[
tipTextOne
]
?
listItem
[
tipTextOne
]
:
'无'
}
<
/Text
>
)
:
null
}
{
tipTextTwoTit
?
(
<
Text
numberOfLines
=
{
3
}
style
=
{[
styles
.
ri_te_ot
,
styles
.
te_ot_two
,
listStyleTip
]}
>
{
`
${
tipTextTwoTit
}
:`
}
{
listItem
[
tipTextTwo
]
?
listItem
[
tipTextTwo
]
:
'无'
}
<
/Text
>
)
:
null
}
{
tipTextThrTit
?
(
<
Text
numberOfLines
=
{
3
}
style
=
{[
styles
.
ri_te_ot
,
styles
.
te_ot_thr
,
listStyleTip
]}
>
{
`
${
tipTextThrTit
}
:`
}
{
listItem
[
tipTextThr
]
?
listItem
[
tipTextThr
]
:
'无'
}
<
/Text
>
)
:
null
}
{
listShowOthOptFlag
&&
listItem
[
LocalVariable
.
SUPER_SEL_ALL_ARR
]
?
(
<
View
>
<
TouchableOpacity
activeOpacity
=
{
0.8
}
onPress
=
{()
=>
this
.
showAllTip
()}
>
<
Text
numberOfLines
=
{
3
}
style
=
{[
styles
.
ri_te_ot
,
styles
.
te_ot_thr
,
listStyleTip
]}
>
{
showOtherTitle
}
<
/Text
>
<
/TouchableOpacity
>
{
showOtherFlag
?
listItem
[
LocalVariable
.
SUPER_SEL_ALL_ARR
].
map
((
item
,
item_index
)
=>
{
return
(
<
View
>
<
Text
numberOfLines
=
{
3
}
style
=
{[
styles
.
ri_te_ot
,
styles
.
te_ot_one
,
listStyleTip
]}
>
{
item_index
+
1
}.
{
item
.
item_name
}
-
{
' '
}
<
Text
style
=
{[
styles
.
ri_te_ot
,
styles
.
te_ot_main
,
listStyleTip
]}
>
{
item
.
manufacturer_product_code
}
-
{
item
.
specification
}
<
/Text>{' '
}
-
{
item
.
general_name
}
x
{
item
[
LocalVariable
.
QUANTITY_FIELD
]}
<
/Text
>
<
/View
>
)
})
:
null
}
<
/View
>
)
:
null
}
<
/TouchableOpacity
>
<
/View
>
{
showClearIcon
&&
listCardActIndex
===
showClearIndex
?
(
<
View
style
=
{
styles
.
btn_cle_box
}
>
<
TouchableOpacity
activeOpacity
=
{
0.9
}
style
=
{[
styles
.
btn_clear_inner
,
listStyleClearBtn
]}
onPress
=
{()
=>
clearCallBack
(
listItem
,
listIndex
)}
>
<
View
style
=
{[
styles
.
icon_cle_btn
]}
>
<
Image
source
=
{
require
(
'../../../images/close_icon.png'
)}
style
=
{
icon_style
}
><
/Image
>
<
/View
>
<
/TouchableOpacity
>
<
/View
>
)
:
(
<
View
style
=
{[
styles
.
ri_num_box
,
onlyShowNum
?
styles
.
show_num_box
:
null
]}
>
{
listItem
[
calField
]
&&
!
onlyShowNum
&&
!
onlyShowSelect
?
(
<
TouchableOpacity
activeOpacity
=
{
0.9
}
style
=
{[
styles
.
btn_inner
,
listStyleCalBtn
]}
onPress
=
{()
=>
this
.
handelCalculation
(
listItem
,
listIndex
)}
>
<
View
style
=
{[
styles
.
thr_num_btn
,
styles
.
thr_btn_left
]}
>
<
Image
source
=
{
require
(
'../../../images/less_icon_big.png'
)}
style
=
{
icon_style
}
><
/Image
>
<
/View
>
<
/TouchableOpacity
>
)
:
null
}
{
listItem
[
calField
]
&&
!
onlyShowSelect
?
(
<
Text
style
=
{[
styles
.
thr_num
,
onlyShowNum
?
styles
.
show_num
:
null
]}
>
{
listItem
[
calField
]}
<
/Text
>
)
:
null
}
{
!
onlyShowNum
&&
!
onlyShowSelect
&&
showPlusIcon
?
(
<
TouchableOpacity
activeOpacity
=
{
0.9
}
style
=
{[
styles
.
btn_inner
,
listStyleCalBtn
]}
onPress
=
{()
=>
this
.
handelCalculation
(
listItem
,
listIndex
,
true
)}
>
<
View
style
=
{[
styles
.
thr_num_btn
,
styles
.
thr_btn_right
]}
>
<
Image
source
=
{
calIcon
}
style
=
{
icon_style
}
><
/Image
>
<
/View
>
<
/TouchableOpacity
>
)
:
null
}
{
onlyShowSelect
?
(
<
TouchableOpacity
activeOpacity
=
{
0.9
}
style
=
{[
styles
.
btn_sel_inner
]}
onPress
=
{()
=>
this
.
handelSelectCheck
(
listItem
,
listIndex
)}
>
<
View
style
=
{[
styles
.
thr_sel_btn
]}
>
<
Image
source
=
{
defSelIcon
}
style
=
{
icon_style
}
><
/Image
>
<
/View
>
<
/TouchableOpacity
>
)
:
null
}
<
/View
>
)}
<
/View
>
)
}
}
const
styles
=
StyleSheet
.
create
({
const
styles
=
StyleSheet
.
create
({
ri_inner
:
{
ri_inner
:
{
flexDirection
:
'row'
,
flexDirection
:
'row'
,
justifyContent
:
'space-between'
,
justifyContent
:
'space-between'
,
alignItems
:
'center'
,
alignItems
:
'center'
,
paddingTop
:
16
,
paddingTop
:
16
,
paddingBottom
:
12
,
paddingBottom
:
12
,
borderBottomWidth
:
1
,
borderBottomWidth
:
1
,
borderColor
:
'rgba(241, 241, 241, 0.87)'
borderColor
:
'rgba(241, 241, 241, 0.87)'
,
},
},
ri_text_box
:
{
ri_text_box
:
{
flex
:
1
flex
:
1
,
},
},
ri_te_ot
:
{
ri_te_ot
:
{
fontSize
:
third_text_size
,
fontSize
:
third_text_size
,
color
:
third_text_color
,
color
:
third_text_color
,
fontFamily
:
font_family_regular
,
fontFamily
:
font_family_regular
,
paddingBottom
:
2
paddingBottom
:
2
,
},
},
oth_box
:
{
oth_box
:
{
paddingBottom
:
2
paddingBottom
:
2
,
},
},
thr_ot
:
{
thr_ot
:
{
fontFamily
:
font_family_medium
,
fontFamily
:
font_family_medium
,
fontSize
:
second_text_size
,
fontSize
:
second_text_size
,
color
:
list_tit_color
,
color
:
list_tit_color
,
paddingBottom
:
4
paddingBottom
:
4
,
},
},
te_ot_str
:
{
te_ot_str
:
{
fontFamily
:
font_family_semibold
,
fontFamily
:
font_family_semibold
,
color
:
list_str_color
color
:
list_str_color
,
},
},
te_ot_one
:
{
te_ot_one
:
{
color
:
list_one_color
color
:
list_one_color
,
},
},
te_ot_two
:
{
te_ot_two
:
{
color
:
list_one_color
color
:
list_one_color
,
},
},
te_ot_thr
:
{
te_ot_thr
:
{
color
:
list_thr_color
color
:
list_thr_color
,
},
},
te_ot_main
:
{
te_ot_main
:
{
color
:
list_one_light_color
color
:
list_one_light_color
,
},
},
oth_img_box
:
{
oth_img_box
:
{
width
:
pxSize
(
58
),
width
:
pxSize
(
58
),
height
:
pxSize
(
58
),
height
:
pxSize
(
58
),
justifyContent
:
'center'
,
justifyContent
:
'center'
,
alignItems
:
'center'
,
alignItems
:
'center'
,
marginRight
:
3
,
marginRight
:
3
,
padding
:
3
padding
:
3
,
},
},
round_pic
:
{
round_pic
:
{
borderColor
:
'rgba(0, 0, 0, 0.12)'
,
borderColor
:
'rgba(0, 0, 0, 0.12)'
,
borderWidth
:
.
5
,
borderWidth
:
0
.5
,
borderRadius
:
50
,
borderRadius
:
50
,
},
},
square_pic
:
{},
square_pic
:
{},
rectan_pic
:
{
rectan_pic
:
{
width
:
pxSize
(
60
),
width
:
pxSize
(
60
),
height
:
pxSize
(
40
),
height
:
pxSize
(
40
),
},
},
thr_num_btn
:
{
thr_num_btn
:
{
width
:
pxSize
(
24
),
width
:
pxSize
(
24
),
height
:
pxSize
(
30
)
height
:
pxSize
(
30
),
},
},
thr_sel_btn
:
{
thr_sel_btn
:
{
width
:
pxSize
(
22
),
width
:
pxSize
(
22
),
height
:
pxSize
(
22
)
height
:
pxSize
(
22
),
},
},
btn_inner
:
{},
btn_inner
:
{},
btn_sel_inner
:
{},
btn_sel_inner
:
{},
btn_cle_box
:
{
btn_cle_box
:
{
marginRight
:
3
,
marginRight
:
3
,
paddingHorizontal
:
4
,
paddingHorizontal
:
4
,
paddingVertical
:
4
paddingVertical
:
4
,
},
},
btn_clear_inner
:
{},
btn_clear_inner
:
{},
icon_cle_btn
:
{
icon_cle_btn
:
{
width
:
pxSize
(
22
),
width
:
pxSize
(
22
),
height
:
pxSize
(
22
)
height
:
pxSize
(
22
),
},
},
ri_num_box
:
{
ri_num_box
:
{
flexDirection
:
'row'
,
flexDirection
:
'row'
,
alignItems
:
'center'
,
alignItems
:
'center'
,
marginLeft
:
3
,
marginLeft
:
3
,
backgroundColor
:
home_background_color
backgroundColor
:
home_background_color
,
},
},
show_num_box
:
{
show_num_box
:
{
backgroundColor
:
null
backgroundColor
:
null
,
},
},
thr_btn_left
:
{},
thr_btn_left
:
{},
thr_btn_right
:
{},
thr_btn_right
:
{},
thr_num
:
{
thr_num
:
{
minWidth
:
pxSize
(
28
),
minWidth
:
pxSize
(
28
),
textAlign
:
'center'
,
textAlign
:
'center'
,
fontFamily
:
font_family_regular
,
fontFamily
:
font_family_regular
,
fontSize
:
14
,
fontSize
:
14
,
color
:
first_text_color
color
:
first_text_color
,
},
},
show_num
:
{
show_num
:
{
fontSize
:
18
fontSize
:
18
,
}
},
})
})
const
mapStateToProps
=
(
state
)
=>
{
const
mapStateToProps
=
state
=>
{
return
{
return
{
global_domain_config
:
state
.
login
.
global_domain_config
global_domain_config
:
state
.
login
.
global_domain_config
,
}
}
}
}
const
mapDispatchToProps
=
(
dispatch
)
=>
{
const
mapDispatchToProps
=
dispatch
=>
{
return
{
return
{
// exitLoginStatus: () => {
// exitLoginStatus: () => {
// dispatch(exitLoginStatus())
// dispatch(exitLoginStatus())
// },
// },
}
}
}
}
export
default
connect
(
mapStateToProps
,
mapDispatchToProps
)(
PicTitDetaiCalcu
)
;
export
default
connect
(
mapStateToProps
,
mapDispatchToProps
)(
PicTitDetaiCalcu
)
app/containers/selfOrder/module/ChooseProductPage.js
View file @
4b2389b1
This diff could not be displayed because it is too large.
app/containers/selfOrder/module/SearchPage.js
0 → 100644
View file @
4b2389b1
import
React
,
{
Component
}
from
'react'
import
{
icon_style
,
list_common_item
,
safe_view
,
foundation_color
}
from
'../../../base/BaseStyle'
import
{
View
,
StyleSheet
,
Image
,
TextInput
,
SafeAreaView
,
ScrollView
,
FlatList
}
from
'react-native'
import
HeadBackItem
from
'../../common/HeadBackItem'
import
{
PicListNoData
}
from
'../../common/CellTextStyle'
import
PicTitDetaiCalcu
from
'../../common/listDataComponent/PicTitDetaiCalcu'
import
LocalVariable
from
'../../common/LocalVariable'
import
{
reqGlobalSearch
,
reqSingleConsumSearch
,
reqProCategorySearch
}
from
'../../../action/SelfAction'
import
ChooseCardList
from
'../../common/listDataComponent/ChooseCardList'
import
{
connect
}
from
'react-redux'
import
{
cloneObject
}
from
'../../../utils/Utils'
// import ChooseCardList from '../../common/listDataComponent/ChooseCardList';
import
LoadingModel
from
'../../common/listDataComponent/LoadingModel'
import
{
Width
}
from
'../../../base/BaseStyle'
class
SearchPage
extends
Component
{
constructor
(
props
)
{
super
(
props
)
this
.
state
=
{
defalutLeftItem
:
[
{
category_code
:
LocalVariable
.
SURGICAL_TEMPLATE
,
category_name
:
'手术套包'
,
cate_local_icon
:
require
(
'../../../images/surg_temp.png'
),
},
{
category_code
:
LocalVariable
.
NAIL_BOX
,
category_name
:
'钉盒'
,
cate_local_icon
:
require
(
'../../../images/screw_box.png'
),
},
{
category_code
:
LocalVariable
.
EQUIPMENT_BAG
,
category_name
:
'器械包'
,
cate_local_icon
:
require
(
'../../../images/equip_bag.png'
),
},
{
category_code
:
LocalVariable
.
SCATTERED_EQUIPMENT
,
category_name
:
'零散器械'
,
cate_local_icon
:
require
(
'../../../images/auxili_tool.png'
),
},
],
searchValue
:
'金属脊柱'
,
dataList
:
[],
topActiveIndex
:
0
,
}
}
componentDidMount
()
{
this
.
getSearchData
()
}
// 获取搜索数据
async
getSearchData
()
{
const
{
navigation
,
global_domain_config
,
token
}
=
this
.
props
const
{
topActiveIndex
,
searchValue
}
=
this
.
state
const
{
selfData
,
topProcOptionList
}
=
navigation
.
state
.
params
const
{
authorizations
}
=
selfData
const
productLineCategory
=
authorizations
?.
product_line_category_list
?.
map
(
item
=>
item
.
product_line_category_code
)
?.
join
(
','
)
console
.
log
(
'topProcOptionList'
,
topProcOptionList
[
topActiveIndex
])
const
params
=
{
accessToken
:
token
,
orgCode
:
selfData
.
org_code
,
manufacturerCode
:
topProcOptionList
[
topActiveIndex
].
supplier_code
,
productLineCategory
,
keyword
:
encodeURIComponent
(
searchValue
),
// pageSize: 9999,
}
this
.
refs
.
LoadingModel
.
show
()
const
single_all_search
=
await
reqGlobalSearch
(
global_domain_config
,
JSON
.
parse
(
JSON
.
stringify
(
params
)))
this
.
refs
.
LoadingModel
.
hide
()
console
.
log
(
'single_all_search'
,
single_all_search
)
this
.
setState
({
dataList
:
single_all_search
?.
data
?.
item
?
single_all_search
?.
data
?.
item
:
[],
})
}
// 获取搜索到的类目
async
getLeftOptionList
(
item
)
{
const
{
navigation
,
global_domain_config
,
token
}
=
this
.
props
const
{
topProcOptionList
}
=
navigation
.
state
.
params
const
{
defalutLeftItem
,
topActiveIndex
}
=
this
.
state
const
params
=
{
access_token
:
token
,
manufacturer_code
:
topProcOptionList
[
topActiveIndex
].
supplier_code
,
}
console
.
log
(
'params='
,
params
)
this
.
refs
.
LoadingModel
.
show
()
const
pro_scate_search
=
await
reqProCategorySearch
(
global_domain_config
,
params
)
this
.
refs
.
LoadingModel
.
hide
()
console
.
log
(
'res_2 : '
,
pro_scate_search
)
if
(
pro_scate_search
.
error_code
===
0
)
{
const
{
data
}
=
pro_scate_search
let
newData
=
defalutLeftItem
.
concat
(
data
.
item
)
// 记录找到的菜单的index
let
index
=
-
1
newData
=
newData
.
map
((
ele
,
i
)
=>
{
let
selectedQuantity
=
ele
[
LocalVariable
.
SELECTED_QUQNTITY
]
||
0
if
(
ele
.
category_code
===
item
.
big_category
.
category_code
)
{
index
=
i
selectedQuantity
+=
1
}
return
{
...
ele
,
[
LocalVariable
.
SELECTED_QUQNTITY
]:
selectedQuantity
,
[
LocalVariable
.
LOCAL_SECOND_DATA
]:
[],
}
})
return
Promise
.
resolve
({
newData
,
index
})
}
return
Promise
.
resolve
([])
}
// 获取搜索到的类目商品数据
async
getLocalSecondData
(
item
)
{
const
that
=
this
const
{
navigation
,
global_domain_config
,
token
}
=
this
.
props
const
{
topActiveIndex
}
=
this
.
state
const
{
topProcOptionList
,
selfData
}
=
navigation
.
state
.
params
let
params
=
{
access_token
:
token
,
category_code
:
item
.
big_category
.
category_code
,
manufacturer_code
:
topProcOptionList
[
topActiveIndex
].
supplier_code
,
org_code
:
selfData
.
org_code
,
// leftIndex: leftIndex, // 测试
}
console
.
log
(
'params='
,
params
)
this
.
refs
.
LoadingModel
.
show
()
const
single_all_search
=
await
reqSingleConsumSearch
(
global_domain_config
,
params
)
this
.
refs
.
LoadingModel
.
hide
()
console
.
log
(
'res_3 : '
,
single_all_search
)
if
(
single_all_search
.
error_code
===
0
)
{
const
{
data
}
=
single_all_search
const
{
details
,
items
}
=
data
if
(
details
)
{
const
newData
=
details
.
map
(
ele
=>
{
let
quantity
=
ele
[
LocalVariable
.
QUANTITY_FIELD
]
||
0
if
(
ele
.
item_code
===
item
.
item_code
)
{
quantity
+=
1
}
return
{
...
ele
,
[
LocalVariable
.
ONLY_TWO_LEVELS
]:
true
,
[
LocalVariable
.
QUANTITY_FIELD
]:
quantity
,
}
})
console
.
log
(
'res_3:newData'
,
newData
)
return
Promise
.
resolve
(
newData
)
}
else
if
(
items
)
{
// 如果是四层结构
const
newData
=
items
.
map
(
ele
=>
{
let
quantity
=
ele
[
LocalVariable
.
QUANTITY_FIELD
]
||
0
if
(
ele
.
category_code
===
item
.
middle_category
.
category_code
)
{
quantity
+=
1
console
.
log
(
'ele.length'
,
ele
.
details
.
length
)
}
return
{
...
ele
,
[
LocalVariable
.
QUANTITY_FIELD
]:
quantity
,
details
:
ele
.
details
.
map
(
ele1
=>
{
let
quantity1
=
ele1
[
LocalVariable
.
QUANTITY_FIELD
]
||
0
if
(
ele1
.
item_code
===
item
.
item_code
)
{
quantity1
+=
1
console
.
log
(
'item.item_code'
,
item
.
item_code
)
console
.
log
(
'ele1'
,
ele1
)
}
return
{
...
ele1
,
[
LocalVariable
.
ONLY_TWO_LEVELS
]:
true
,
[
LocalVariable
.
QUANTITY_FIELD
]:
quantity1
,
}
}),
}
})
return
Promise
.
resolve
(
newData
)
}
}
return
Promise
.
resolve
([])
}
// 把后台给的数据转成商品列表的格式,并添加数量
async
formatToTopProcOptionList
(
item
)
{
const
{
navigation
}
=
this
.
props
let
{
topProcOptionList
}
=
navigation
.
state
.
params
const
{
topActiveIndex
}
=
this
.
state
// 大类列表
let
{
leftOptionList
}
=
topProcOptionList
[
topActiveIndex
]
// 找搜索出来商品对应的大类
let
leftOptionListItem
=
leftOptionList
.
find
(
ele
=>
ele
.
category_code
===
item
.
big_category
?.
category_code
)
console
.
log
(
'leftOptionListItem'
,
leftOptionListItem
)
if
(
leftOptionListItem
)
{
console
.
log
(
'已存在'
)
// 如果大类已存在
leftOptionListItem
[
'selectedQuantity'
]
+=
1
// 找耗材
let
localSecondDataItem
=
leftOptionListItem
.
localSecondData
?.
find
(
ele
=>
{
if
(
ele
.
item_code
===
item
.
item_code
)
{
return
true
}
// 找中类
if
(
ele
.
details
&&
item
.
middle_category
)
{
if
(
ele
.
category_code
===
item
.
middle_category
.
category_code
)
{
console
.
log
(
'ele.category_code'
,
ele
.
category_code
)
return
true
}
return
false
}
return
false
})
// 如果找到
if
(
localSecondDataItem
)
{
// 查找对应的产品 并添加数量、
const
{
details
}
=
localSecondDataItem
if
(
details
)
{
// 如果是4层
const
detail
=
details
.
find
(
ele
=>
ele
.
item_code
===
item
.
item_code
)
detail
[
LocalVariable
.
QUANTITY_FIELD
]
+=
1
}
// 一般情况
localSecondDataItem
[
LocalVariable
.
QUANTITY_FIELD
]
+=
1
}
else
{
// 如果找不到对应的产品
const
localSecondData
=
await
this
.
createLocalSecondData
(
item
)
leftOptionListItem
.
localSecondData
=
localSecondData
console
.
log
(
'localSecondDataItem'
,
localSecondDataItem
)
}
}
else
{
// 如果找不到当前商品大类,代表大类列表未加载
// 搜索出所有大类,并加入
leftOptionList
=
await
this
.
createLeftOptionList
(
item
)
console
.
log
(
'leftOptionList'
,
leftOptionList
)
}
topProcOptionList
[
topActiveIndex
]
=
{
...
topProcOptionList
[
topActiveIndex
],
[
LocalVariable
.
SELECTED_QUQNTITY
]:
topProcOptionList
[
topActiveIndex
][
LocalVariable
.
SELECTED_QUQNTITY
]
+
1
,
leftOptionList
:
leftOptionList
.
map
(
ele
=>
{
const
childrenLineData
=
this
.
getChildrenLineData
(
ele
.
localSecondData
)
console
.
log
(
'selectedDataArr'
,
childrenLineData
)
return
{
...
ele
,
[
LocalVariable
.
SELECTED_DATA_ARR
]:
childrenLineData
,
}
}),
}
return
Promise
.
resolve
(
topProcOptionList
)
}
// 创建大类
async
createLeftOptionList
(
item
)
{
// 获取该厂家下所有大类
let
{
newData
:
newLeftOptionList
,
index
}
=
await
this
.
getLeftOptionList
(
item
)
console
.
log
(
'newLeftOptionList'
,
newLeftOptionList
)
const
localSecondData
=
await
this
.
getLocalSecondData
(
item
)
newLeftOptionList
[
index
]
=
{
...
newLeftOptionList
[
index
],
localSecondData
,
}
console
.
log
(
'newLeftOptionList_index'
,
newLeftOptionList
[
index
])
return
Promise
.
resolve
(
newLeftOptionList
)
}
// 统计后塞入购物车
getChildrenLineData
=
data
=>
{
console
.
log
(
'getChildrenLineData'
,
data
)
return
data
.
filter
(
item
=>
item
.
quantity
>
0
)
}
// 返回每一列元素
renderContColumnItem
(
item
,
index
)
{
const
{
navigation
}
=
this
.
props
const
{
setTopProcOptionListCallBack
}
=
navigation
.
state
.
params
return
(
<
SafeAreaView
style
=
{
styles
.
column_container
}
key
=
{
'item_code'
+
index
}
>
<
PicTitDetaiCalcu
listItem
=
{
item
}
listIndex
=
{
index
}
calField
=
{
LocalVariable
.
QUANTITY_FIELD
}
subCalCallBack
=
{(
item
,
idx
)
=>
{}}
titText
=
{
'manufacturer_product_code'
}
tipTextStr
=
{
'item_name'
}
tipTextOne
=
{
'general_name'
}
tipTextTwo
=
{
'specification'
}
titTextTit
=
{
'厂家产品代码'
}
tipTextStrTit
=
{
'物料名称'
}
tipTextOneTit
=
{
'通用名称'
}
tipTextTwoTit
=
{
'规格型号'
}
listImgIcon
=
{
'photos'
}
plusCallBack
=
{(
item
,
index
)
=>
{
setTopProcOptionListCallBack
(
this
.
formatToTopProcOptionList
(
item
).
then
(
data
=>
{
this
.
props
.
navigation
.
goBack
()
return
Promise
.
resolve
(
data
)
}),
)
}}
// reduceCallBack={() => this.props.handleAllPlusReduce(item, index)}
/
>
<
/SafeAreaView
>
)
}
handleTopNav
(
topItem
,
topActiveIndex
)
{
this
.
setState
(
{
topActiveIndex
,
},
()
=>
{
this
.
getSearchData
()
},
)
}
inputSearchValue
(
text
)
{
this
.
setState
({
searchValue
:
text
},
()
=>
{
this
.
getSearchData
()
})
}
render
()
{
const
{
navigation
}
=
this
.
props
const
{
title
,
topProcOptionList
}
=
navigation
.
state
.
params
const
{
dataList
,
topActiveIndex
}
=
this
.
state
const
cur_icon
=
'supplier_icon'
console
.
log
(
'dataList'
,
dataList
)
return
(
<
SafeAreaView
style
=
{
safe_view
}
>
<
HeadBackItem
title
=
{
title
}
navigation
=
{
navigation
}
/
>
<
View
style
=
{
list_common_item
.
ser_cont
}
>
<
TextInput
placeholder
=
{
'请输入搜索关键词'
}
style
=
{
list_common_item
.
ser_text_input
}
// defaultValue={this.state.searchValue}
onChangeText
=
{
text
=>
this
.
inputSearchValue
(
text
)}
/
>
<
View
style
=
{
list_common_item
.
ser_img_box
}
>
<
Image
source
=
{
require
(
'../../../images/search_icon.png'
)}
style
=
{
icon_style
}
/
>
<
/View
>
<
/View
>
<
ChooseCardList
cardStyleBox
=
{
styles
.
chooseCardList_box
}
cardScrollEnabled
=
{
true
}
cardHorizontal
=
{
true
}
cardShowsHorizontalScrollIndicator
=
{
false
}
cardStyleListItem
=
{
styles
.
top_inner
}
cardListOptions
=
{
topProcOptionList
}
// cardItemTitle={cur_title}
cardItemIcon
=
{
cur_icon
}
curActIndex
=
{
topActiveIndex
}
cardCallBack
=
{(
item
,
index
)
=>
this
.
handleTopNav
(
item
,
index
)}
cardCountName
=
{
LocalVariable
.
SELECTED_QUQNTITY
}
cardStyleType
=
{
'GRAPHICS'
}
cardCouStyle
=
{
styles
.
top_cot_num
}
cardShowDefIcon
=
{
true
}
/
>
<
ScrollView
showsVerticalScrollIndicator
=
{
false
}
>
{
dataList
.
length
>
0
?
(
<
FlatList
keyExtractor
=
{
item
=>
item
.
id
}
data
=
{
dataList
}
extraData
=
{
this
.
state
}
renderItem
=
{({
item
,
index
})
=>
this
.
renderContColumnItem
(
item
,
index
)}
/
>
)
:
(
<
PicListNoData
/>
)}
<
/ScrollView
>
<
LoadingModel
ref
=
"LoadingModel"
/>
<
/SafeAreaView
>
)
}
}
const
styles
=
StyleSheet
.
create
({
top_box
:
{
width
:
Width
(),
paddingHorizontal
:
20
,
paddingTop
:
12
,
},
chooseCardList_box
:
{
width
:
Width
(),
height
:
58
,
backgroundColor
:
foundation_color
,
paddingHorizontal
:
20
,
paddingTop
:
12
,
borderBottomColor
:
'#F4F4F4'
,
borderBottomWidth
:
1
,
},
top_inner
:
{
borderBottomColor
:
foundation_color
,
minWidth
:
60
,
paddingBottom
:
10
,
},
top_cot_num
:
{
right
:
8
,
},
column_container
:
{
marginBottom
:
10
,
paddingHorizontal
:
10
,
paddingVertical
:
6
,
backgroundColor
:
foundation_color
,
},
})
// export default SearchPage
const
mapStateToProps
=
state
=>
{
return
{
userInfo
:
state
.
login
.
userInfo
,
token
:
state
.
login
.
token
,
loginState
:
state
.
login
.
loginState
,
global_domain_config
:
state
.
login
.
global_domain_config
,
local_sele_pro_options
:
state
.
selfOrder
.
local_sele_pro_options
,
}
}
export
default
connect
(
mapStateToProps
)(
SearchPage
)
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