Commit 55ab9255 by peii

user reducers

parent 7848348c
...@@ -3,7 +3,7 @@ import { Easing, Animated } from 'react-native' ...@@ -3,7 +3,7 @@ import { Easing, Animated } from 'react-native'
import { createStackNavigator, createAppContainer } from 'react-navigation' import { createStackNavigator, createAppContainer } from 'react-navigation'
import LoginPage from './containers/login/LoginPage' import LoginPage from './containers/login/LoginPage'
import HomePage from './containers/home/HomePage' import HomePage from './containers/home/HomePage'
import SelfOrderPage from './containers/selfOrder/SelfOrderPage' // import SelfOrderPage from './containers/selfOrder/SelfOrderPage'
import ChooseProductPage from './containers/selfOrder/module/ChooseProductPage' import ChooseProductPage from './containers/selfOrder/module/ChooseProductPage'
import SearchPage from './containers/selfOrder/module/SearchPage' import SearchPage from './containers/selfOrder/module/SearchPage'
import EditThirdLevelPage from './containers/selfOrder/module/EditThirdLevelPage' import EditThirdLevelPage from './containers/selfOrder/module/EditThirdLevelPage'
...@@ -24,6 +24,9 @@ import LineOrderPage from './containers/historicalOrder/module/LineOrderPage' ...@@ -24,6 +24,9 @@ import LineOrderPage from './containers/historicalOrder/module/LineOrderPage'
import SubSuccPage from './containers/common/SubSuccPage' import SubSuccPage from './containers/common/SubSuccPage'
import BarCodePage from './containers/common/BarCodePage' import BarCodePage from './containers/common/BarCodePage'
// 下单
import SelfOrder from '../src/pages/order/self'
// 结算 // 结算
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'
...@@ -53,7 +56,7 @@ const Router = createAppContainer( ...@@ -53,7 +56,7 @@ const Router = createAppContainer(
{ {
LoginPage: { screen: LoginPage }, LoginPage: { screen: LoginPage },
HomePage: { screen: HomePage }, HomePage: { screen: HomePage },
SelfOrderPage: { screen: SelfOrderPage }, SelfOrder: { screen: SelfOrder },
ChooseProductPage: { screen: ChooseProductPage }, ChooseProductPage: { screen: ChooseProductPage },
SearchPage: { screen: SearchPage }, SearchPage: { screen: SearchPage },
EditThirdLevelPage: { screen: EditThirdLevelPage }, EditThirdLevelPage: { screen: EditThirdLevelPage },
...@@ -93,7 +96,6 @@ const Router = createAppContainer( ...@@ -93,7 +96,6 @@ const Router = createAppContainer(
MixConsume: { screen: MixConsume }, MixConsume: { screen: MixConsume },
MixConsumeForm: { screen: MixConsumeForm }, MixConsumeForm: { screen: MixConsumeForm },
MixConsumeItems: { screen: MixConsumeItems }, MixConsumeItems: { screen: MixConsumeItems },
}, },
{ {
navigationOptions: { navigationOptions: {
......
...@@ -17,6 +17,7 @@ import { ...@@ -17,6 +17,7 @@ import {
import { GetRequest, PostRequest } from '../network/RequestUtils'; import { GetRequest, PostRequest } from '../network/RequestUtils';
import { getUrlParams, show, showWarnErrorMessage, showErrorMessage, isNotBlank } from '../utils/Utils'; import { getUrlParams, show, showWarnErrorMessage, showErrorMessage, isNotBlank } from '../utils/Utils';
import { originSysProfiles, originSysValueSets } from '../reducers/module/login'; import { originSysProfiles, originSysValueSets } from '../reducers/module/login';
import { toBinaryNumber } from '../../src/utils/utils';
export function requestLogin(params) { export function requestLogin(params) {
return (dispatch, getState) => { return (dispatch, getState) => {
...@@ -183,7 +184,7 @@ export function getSysProfiles() { ...@@ -183,7 +184,7 @@ export function getSysProfiles() {
console.log(profile_code, res) console.log(profile_code, res)
let value = R.pathOr(originSysProfiles[profile_code], ['data', 'profile_value'])(res) let value = R.pathOr(originSysProfiles[profile_code], ['data', 'profile_value'])(res)
if (isNotBlank(value) && !isNaN(value)) value = parseInt(value) if (isNotBlank(value) && !isNaN(value)) value = toBinaryNumber(value)
dispatch(setSysProfiles(profile_code, value)) dispatch(setSysProfiles(profile_code, value))
}) })
} }
......
...@@ -14,6 +14,7 @@ import { ...@@ -14,6 +14,7 @@ import {
font_family_regular, font_family_regular,
} from '../../base/BaseStyle' } from '../../base/BaseStyle'
import { exitLoginStatus, requestSysProfile, setNavigation, getOrganizationData } from '../../action/LoginAction' import { exitLoginStatus, requestSysProfile, setNavigation, getOrganizationData } from '../../action/LoginAction'
import { getOrganizations } from '../../../src/actions/userAction'
import { getLendOrderCodeValues } from '../../action/SelfAction' import { getLendOrderCodeValues } from '../../action/SelfAction'
import { getSettlementStatus, getInvoiceStatus, getArInvoiceStatus } from '../../action/SettlementAction' import { getSettlementStatus, getInvoiceStatus, getArInvoiceStatus } from '../../action/SettlementAction'
import HeadBackItem from '../common/HeadBackItem' import HeadBackItem from '../common/HeadBackItem'
...@@ -49,7 +50,7 @@ class HomePage extends Component { ...@@ -49,7 +50,7 @@ class HomePage extends Component {
MOBILE_SELF_HELP_ORDER: { MOBILE_SELF_HELP_ORDER: {
icon: require('../../images/self_order.png'), icon: require('../../images/self_order.png'),
title: '自助下单', title: '自助下单',
page: 'SelfOrderPage', page: 'SelfOrder',
params: { params: {
isLendOrder: false, isLendOrder: false,
}, },
...@@ -230,7 +231,6 @@ class HomePage extends Component { ...@@ -230,7 +231,6 @@ class HomePage extends Component {
this.props.getInvoiceStatus() this.props.getInvoiceStatus()
// 分销开票状态 // 分销开票状态
this.props.getArInvoiceStatus() this.props.getArInvoiceStatus()
} }
getLendOrderCodeValues() { getLendOrderCodeValues() {
...@@ -396,8 +396,8 @@ const mapDispatchToProps = dispatch => ({ ...@@ -396,8 +396,8 @@ const mapDispatchToProps = dispatch => ({
dispatch(getLendOrderCodeValues()) dispatch(getLendOrderCodeValues())
}, },
getOrganizationData: () => { getOrganizationData: () => {
dispatch(getOrganizationData()) dispatch(getOrganizations())
} },
}) })
export default connect(mapStateToProps, mapDispatchToProps)(HomePage) export default connect(mapStateToProps, mapDispatchToProps)(HomePage)
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @FilePath: /BoneHouse_Business_APP/app/reducers/index.js * @FilePath: /BoneHouse_Business_APP/app/reducers/index.js
* @Author: peii * @Author: peii
* @Date: 2021-02-03 20:59:10 * @Date: 2021-02-03 20:59:10
* @LastEditTime: 2022-08-04 17:36:19 * @LastEditTime: 2022-11-02 16:29:41
* @LastEditors: PEII * @LastEditors: PEII
* @Vision: 1.0 * @Vision: 1.0
* @Description: * @Description:
...@@ -19,6 +19,8 @@ import deviceInfo from './module/deviceInfo'; ...@@ -19,6 +19,8 @@ import deviceInfo from './module/deviceInfo';
import settlement from './module/settlement'; import settlement from './module/settlement';
import mixConsume from './module/mixConsume'; import mixConsume from './module/mixConsume';
import { user } from '../../src/reducers/user';
const loginConfig = { const loginConfig = {
key: 'login', key: 'login',
storage, storage,
...@@ -92,6 +94,7 @@ const rootReducer = { ...@@ -92,6 +94,7 @@ const rootReducer = {
deviceInfo: persistReducer(deviceConfig, deviceInfo), deviceInfo: persistReducer(deviceConfig, deviceInfo),
settlement: persistReducer(settlementConfig, settlement), settlement: persistReducer(settlementConfig, settlement),
mixConsume: persistReducer(mixConsumeConfig, mixConsume), mixConsume: persistReducer(mixConsumeConfig, mixConsume),
user
} }
export default rootReducer; export default rootReducer;
\ No newline at end of file
import { import {
LOGIN_NO, LOGIN_NO,
LOGIN_DOING, LOGIN_DOING,
LOGIN_SUCCESS, LOGIN_SUCCESS,
LOGIN_FAILURE, LOGIN_FAILURE,
EXIT_LOGIN, EXIT_LOGIN,
AUTO_LOGIN_SUCCESS, AUTO_LOGIN_SUCCESS,
AUTO_LOGIN_FAILURE, AUTO_LOGIN_FAILURE,
SET_DOMAIN_CONFIGURATE, SET_DOMAIN_CONFIGURATE,
SET_VERSION_APK, SET_VERSION_APK,
SET_DOMAIN_FROM_ORIGIN, SET_DOMAIN_FROM_ORIGIN,
SET_SYSPROFILE, SET_SYSPROFILE,
SET_SYSVALUESET, SET_SYSVALUESET,
SET_NAVIGATION, SET_NAVIGATION,
SET_ORGANIZATION SET_ORGANIZATION,
} from '../../base/ActionTypes'; } from '../../base/ActionTypes'
// 登录状态 // 登录状态
const defaultState = { const defaultState = {
loginState:LOGIN_NO, // 登录状态 loginState: LOGIN_NO, // 登录状态
userInfo:{}, // 保存用户信息 userInfo: {}, // 保存用户信息
token:null, token: null,
username:'', username: '',
password:'', password: '',
global_domain_config: 'https://obs.uat.guke.tech', global_domain_config: 'https://obs.uat.guke.tech',
hasSetDomainFromOrigin: false, hasSetDomainFromOrigin: false,
local_version_apk: '', local_version_apk: '',
navigation: null, navigation: null,
sysProfiles: { sysProfiles: {
OBS_SHOW_ORG_FLAG: 'Y',
SUR_MOBILE_HISTORY_SALE_PRICE_SHOW_FLAG: 'Y',
SUR_MOBILE_INV_PRODUCT_LINE_CATEGORY_FLAG: 0,
OBS_MOBILE_APP_TITLE: '骨科智慧仓',
OBS_MOBILE_CONSU_DEPARTMENT_DISPLAY: 'N',
},
sysValueSets: {
SUR_FEE_TYPE: []
},
organizations: []
}
// 默认sysProfile,放state里时,会被持久化影响后面更新不了
export const originSysProfiles = {
OBS_SHOW_ORG_FLAG: 'Y', OBS_SHOW_ORG_FLAG: 'Y',
SUR_MOBILE_HISTORY_SALE_PRICE_SHOW_FLAG: 'Y', SUR_MOBILE_HISTORY_SALE_PRICE_SHOW_FLAG: 'Y',
SUR_MOBILE_INV_PRODUCT_LINE_CATEGORY_FLAG: 0, SUR_MOBILE_INV_PRODUCT_LINE_CATEGORY_FLAG: '00',
OBS_MOBILE_APP_TITLE: '骨科智慧仓', OBS_MOBILE_APP_TITLE: '骨科智慧仓',
OBS_MOBILE_CONSU_DEPARTMENT_DISPLAY: 'N', OBS_MOBILE_CONSU_DEPARTMENT_DISPLAY: 'N',
OBS_MOBILE_DEPARTMENT_DISPLAY: '00',
OBS_MOBILE_BM_DISPLAY: '00',
OBS_MOBILE_SUR_FOLLOWER_DISPLAY: '00',
OBS_MOBILE_DELIVERYMAN_DISPLAY: '00',
},
sysValueSets: {
SUR_FEE_TYPE: [],
SUR_ORDER_TYPE: [],
},
organizations: [],
} }
export const originSysValueSets = { // 默认sysProfile,放state里时,会被持久化影响后面更新不了
SUR_FEE_TYPE: [] export const originSysProfiles = {
OBS_SHOW_ORG_FLAG: 'Y',
SUR_MOBILE_HISTORY_SALE_PRICE_SHOW_FLAG: 'Y',
SUR_MOBILE_INV_PRODUCT_LINE_CATEGORY_FLAG: '00',
OBS_MOBILE_APP_TITLE: '骨科智慧仓',
OBS_MOBILE_CONSU_DEPARTMENT_DISPLAY: 'N',
// APP下单是否显示部门权限
OBS_MOBILE_DEPARTMENT_DISPLAY: '00',
// APP下单是否显示业务经理权限
OBS_MOBILE_BM_DISPLAY: '00',
// APP下单是否显示跟台员权限
OBS_MOBILE_SUR_FOLLOWER_DISPLAY: '00',
// APP下单是否显示送货员权限
OBS_MOBILE_DELIVERYMAN_DISPLAY: '00',
} }
export const originSysValueSets = {
SUR_FEE_TYPE: [],
SUR_ORDER_TYPE: [],
}
export default login = (state = defaultState, action) => { export default login = (state = defaultState, action) => {
switch (action.type) { switch (action.type) {
case LOGIN_DOING: case LOGIN_DOING:
return Object.assign({}, state, { return Object.assign({}, state, {
loginState: LOGIN_DOING loginState: LOGIN_DOING,
}); })
case LOGIN_SUCCESS: case LOGIN_SUCCESS:
return Object.assign({}, state, { return Object.assign({}, state, {
loginState:LOGIN_SUCCESS, loginState: LOGIN_SUCCESS,
userInfo:action.rawData, userInfo: action.rawData,
token:action.rawData.access_token, token: action.rawData.access_token,
username:action.username, username: action.username,
password:action.password password: action.password,
}); })
case LOGIN_FAILURE: case LOGIN_FAILURE:
return Object.assign({}, state, { return Object.assign({}, state, {
loginState:LOGIN_FAILURE loginState: LOGIN_FAILURE,
}); })
case EXIT_LOGIN: case EXIT_LOGIN:
return Object.assign({}, state,{ return Object.assign({}, state, {
token: null, token: null,
loginState:LOGIN_NO, loginState: LOGIN_NO,
userInfo:{}, userInfo: {},
// password: '' // password: ''
}); })
case AUTO_LOGIN_SUCCESS: case AUTO_LOGIN_SUCCESS:
return Object.assign({}, state, { return Object.assign({}, state, {
loginState: LOGIN_SUCCESS, loginState: LOGIN_SUCCESS,
userInfo: action.rawData, userInfo: action.rawData,
token: action.rawData.access_token token: action.rawData.access_token,
}); })
case AUTO_LOGIN_FAILURE: case AUTO_LOGIN_FAILURE:
return Object.assign({}, state, { return Object.assign({}, state, {
loginState: LOGIN_FAILURE loginState: LOGIN_FAILURE,
}); })
case SET_DOMAIN_CONFIGURATE: case SET_DOMAIN_CONFIGURATE:
return Object.assign({}, state, { return Object.assign({}, state, {
global_domain_config: action.global_domain_config global_domain_config: action.global_domain_config,
}) })
case SET_DOMAIN_FROM_ORIGIN: case SET_DOMAIN_FROM_ORIGIN:
return Object.assign({}, state, { return Object.assign({}, state, {
hasSetDomainFromOrigin: action.data hasSetDomainFromOrigin: action.data,
}) })
case SET_VERSION_APK: case SET_VERSION_APK:
return Object.assign({}, state, { return Object.assign({}, state, {
local_version_apk: action.local_version_apk local_version_apk: action.local_version_apk,
}) })
case SET_SYSPROFILE: case SET_SYSPROFILE:
return Object.assign({}, state, { return Object.assign({}, state, {
sysProfiles: { sysProfiles: {
...state.sysProfiles, ...state.sysProfiles,
[action.code]: action.value [action.code]: action.value,
} },
}) })
case SET_SYSVALUESET: case SET_SYSVALUESET:
return Object.assign({}, state, { return Object.assign({}, state, {
sysValueSets: { sysValueSets: {
...state.sysValueSets, ...state.sysValueSets,
[action.code]: action.value [action.code]: action.value,
} },
}) })
case SET_NAVIGATION: case SET_NAVIGATION:
return Object.assign({}, state, { return Object.assign({}, state, {
navigation: action.navigation navigation: action.navigation,
}) })
case SET_ORGANIZATION: case SET_ORGANIZATION:
return Object.assign({}, state, { return Object.assign({}, state, {
organizations: action.organizations organizations: action.organizations,
}) })
default: // need this for default case default:
return state // need this for default case
} return state
}
} }
/*
* @FilePath: /BoneHouse_Business_APP/src/actions/action-types.ts
* @Author: PEII
* @Date: 2022-11-02 16:41:21
* @LastEditTime: 2022-11-02 16:52:16
* @LastEditors: PEII
* @Vision: 1.0
* @Description:
*/
export const GET_ORGANIZATIONS = 'GET_ORGANIZATIONS'
export const GET_CUSTOMERS = 'GET_CUSTOMERS'
\ No newline at end of file
/*
* @FilePath: /BoneHouse_Business_APP/src/actions/userAction.ts
* @Author: PEII
* @Date: 2022-11-02 16:09:29
* @LastEditTime: 2022-11-02 16:56:49
* @LastEditors: PEII
* @Vision: 1.0
* @Description:
*/
import { createApiAction } from './utils'
import { GET_ORGANIZATIONS, GET_CUSTOMERS } from './action-types'
import api from '../services/api'
export const getOrganizations = createApiAction(GET_ORGANIZATIONS, api.getOrganizations)
export const getCustomers = createApiAction(GET_CUSTOMERS, (params: any) => api.getCustomers(params))
import { curry, compose, reject, isNil, applySpec, always, __, Dictionary, identity, type } from 'ramda'
import { request } from '../services/baseApi'
/**
* 创建action
* @param type {string}
* @param getPayload {Func}
* @param getMeta {Func}
*/
export const createAction = curry((type: string, getPayload: Function, getMeta: Function) =>
compose(
reject(isNil),
applySpec({
type: always(type),
payload: getPayload,
meta: getMeta,
}),
),
)
/**
* 创建简单action
* @param type {string} 类型
* @param payload {any}
* @return
*/
export const createSimpleAction: (string, any?) => Dictionary<any> = createAction(__, identity, always(null))
/**
* 创建常量action
* @param type {string} 类型
* @return
*/
export const createConstantAction: (string) => Dictionary<any> = createAction(__, always(null), always(null))
export const createApiAction = curry((actionType: string, fn: Function) => {
return (params = {}, callback = { success: <U>(p: U) => {}, fail: <R>(p: R) => {} }, customActionType = actionType) =>
async (dispatch: Function) => {
try {
dispatch({ type: `${customActionType}_REQUEST`, params })
if (type(fn) !== 'Function') {
throw new Error(`参数【${fn.toString()}】不是可调用函数`)
}
let data = await fn(params)
if (data && data.error_code === 0) {
dispatch({ type: `${customActionType}`, payload: data.data })
callback.success && callback.success({ payload: data.data })
return data.data
} else {
throw new Error('请求数据失败')
}
} catch (error) {
console.log({ type: `${customActionType}_FAILURE`, payload: error })
dispatch({ type: `${customActionType}_FAILURE`, payload: error })
callback.fail && callback.fail(error)
}
}
})
export const createSimpleApiAction = createApiAction(__, request)
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @FilePath: /BoneHouse_Business_APP/src/pages/mix_consume/index.tsx * @FilePath: /BoneHouse_Business_APP/src/pages/mix_consume/index.tsx
* @Author: PEII * @Author: PEII
* @Date: 2022-08-02 16:40:21 * @Date: 2022-08-02 16:40:21
* @LastEditTime: 2022-10-13 17:52:12 * @LastEditTime: 2022-10-28 17:58:04
* @LastEditors: PEII * @LastEditors: PEII
* @Vision: 1.0 * @Vision: 1.0
* @Description: 混单报消耗 * @Description: 混单报消耗
...@@ -20,7 +20,6 @@ import Header from '../../components/header/header' ...@@ -20,7 +20,6 @@ import Header from '../../components/header/header'
import Resolution from '../../components/common/Resolution' import Resolution from '../../components/common/Resolution'
import Search from './components/search' import Search from './components/search'
import { isBlank, g, show } from '../../utils/utils' import { isBlank, g, show } from '../../utils/utils'
import api from '../../services/api'
import { setOrders } from '../../../app/action/MixConsumeAction' import { setOrders } from '../../../app/action/MixConsumeAction'
import styles from './index.styl' import styles from './index.styl'
......
{
"$schema": "../../../types/formitem.schema.json",
"formItems": [
{
"label": "临床科室",
"type": "SELECT",
"disabled": true,
"rules": [{ "required": true }],
"options": [
{
"value": "-1",
"label": "骨科关节"
}
]
},
{
"field": ""
}
]
}
/*
* @FilePath: /BoneHouse_Business_APP/src/pages/order/self.formItem.ts
* @Author: PEII
* @Date: 2022-10-27 15:10:32
* @LastEditTime: 2022-11-02 12:16:05
* @LastEditors: PEII
* @Vision: 1.0
* @Description: 自助下单formItem数据
*/
// @ts-nocheck
import * as R from 'ramda'
import { FieldType, SelectMode } from '../../enums'
import { IFormField } from 'bonehouse'
export function getSelfFormItems(): IFormField[] {
return [
{
field: 'sellerCode',
label: '销售员',
type: FieldType.SELECT,
options: [
{
label: this.props.userInfo.person_name,
value: this.props.userInfo.user_name,
},
],
placeholder: '请选择',
rules: [{ required: true, message: '请选择销售员' }],
disabled: true,
},
{
field: 'orgCode',
label: '组织',
type: FieldType.SELECT,
options: (() => {
return R.compose(
R.map(
R.applySpec({
label: R.prop('org_name'),
value: R.prop('org_code'),
}),
),
R.uniqBy(R.prop('org_code'))
)(this.props.organizations || [])
})(),
placeholder: '请选择',
rules: [{ required: true, message: '请选择组织' }],
callback: this.setOrgCallback.bind(this),
},
{
field: 'customerCode',
label: '客户',
type: FieldType.SELECT,
options: [],
placeholder: '请选择',
rules: [{ required: true, message: '请选择客户' }],
refrence: ['orgCode'],
callback: this.setCustomerCallback.bind(this),
},
{
field: 'billToSiteCode',
label: '收单地点',
type: FieldType.SELECT,
options: [],
placeholder: '请选择',
rules: [{ required: true, message: '请选择收单地点' }],
refrence: ['orgCode', 'customerCode'],
callback: this.setBillToSitesCallback.bind(this),
},
{
field: 'shipToSiteCode',
label: '收货地点',
type: FieldType.SELECT,
options: [],
placeholder: '请选择',
rules: [{ required: true, message: '请选择收货地点' }],
refrence: ['orgCode', 'customerCode', 'billToSiteCode'],
callback: this.setShipToSiteCallback.bind(this),
},
{
field: 'doctorName',
label: '主治医生',
type: FieldType.SELECT,
options: [],
placeholder: '请选择',
refrence: ['orgCode', 'customerCode', 'billToSiteCode', 'shipToSiteCode'],
},
{
field: 'surgeryDate',
label: '手术时间',
type: FieldType.DATE,
dateMode: 'datetime',
placeholder: '请选择',
rules: [{ required: true, message: '请选择手术时间' }],
},
{
field: 'orderTypeCode',
label: '订单类型',
type: FieldType.SELECT,
placeholder: '请选择',
rules: [{ required: true, message: '请选择订单类型' }],
options: R.compose(
R.map(
R.applySpec({
label: R.prop('valueName'),
value: R.prop('valueCode'),
}),
),
R.pathOr([], ['sysStore', 'sysValueSets', 'SUR_ORDER_TYPE']),
)(this.props),
},
{
field: 'products',
label: '选择产品',
type: FieldType.SELECT,
selectMode: SelectMode.PAGE,
placeholder: '请选择',
rules: [{ required: true, message: '请选择产品' }],
refrence: ['orgCode'],
customHandler: this.selectProductsBeforeHandler.bind(this),
},
{
field: 'collectSrcInvCode',
label: '借货仓库',
type: FieldType.SELECT,
placeholder: '请选择',
options: [],
refrence: ['orgCode', 'sellerCode', 'customerCode', 'billToSiteCode', 'shipToSiteCode'],
},
{
field: 'takeCertFlag',
label: '需要携带合格证',
type: FieldType.RADIO,
rules: [{ required: true, message: '请选择是否需要携带合格证' }],
options: [
{
label: '是',
value: 'Y',
},
{
label: '否',
value: 'N',
},
],
},
{
field: 'replaceItemFlag',
label: '同意替换器械包',
type: FieldType.RADIO,
options: [
{
label: '是',
value: 'Y',
},
{
label: '否',
value: 'N',
},
],
},
{
field: 'surgeryDesc',
label: '备注',
type: FieldType.TEXT,
placeholder: '请输入备注',
multiline: true,
},
{
field: 'voiceUrl',
label: '录音',
type: FieldType.VOICE,
placeholder: '还有什么要安排的,可录音备注哟!',
},
]
}
File mode changed
/*
* @FilePath: /BoneHouse_Business_APP/src/reducers/user.ts
* @Author: PEII
* @Date: 2022-11-02 16:02:14
* @LastEditTime: 2022-11-02 17:19:01
* @LastEditors: PEII
* @Vision: 1.0
* @Description:
*/
import * as R from 'ramda'
import { createReducer } from './utils'
import { GET_ORGANIZATIONS, GET_CUSTOMERS } from '../actions/action-types'
const initState = {
organizations: [],
inventories: [],
customers: {},
}
type IAction = {
type: string
payload: any
}
export const user = createReducer(initState, {
[GET_ORGANIZATIONS]: (state: any, action: IAction) => {
const organizations = R.compose(R.uniqBy(R.prop('org_code')), R.propOr([], 'organizations'))(action.payload)
const inventories = R.compose(R.uniqBy(R.prop('inv_code')), R.propOr([], 'inventories'))(action.payload)
return { ...state, organizations, inventories }
},
[GET_CUSTOMERS]: (state: any, action: IAction) => {
const data = action.payload
let customers = {...state.customers }
customers[data.org_code] = data.customers
return { ...state, customers }
},
})
/*
* @FilePath: /BoneHouse_Business_APP/src/reducers/utils.ts
* @Author: PEII
* @Date: 2022-10-28 19:49:08
* @LastEditTime: 2022-10-28 19:49:21
* @LastEditors: PEII
* @Vision: 1.0
* @Description: reducers
*/
// @ts-nocheck
import { identity, propOr } from 'ramda'
export interface IAction {
type: string
}
export function createReducer<U, T extends Object>(initialState: U, handlers: T) {
return <R extends IAction>(state = initialState, action: R) => propOr(identity, action.type, handlers)(state, action)
}
export default createReducer
...@@ -17,6 +17,7 @@ declare module 'bonehouse' { ...@@ -17,6 +17,7 @@ declare module 'bonehouse' {
export type IDepartment = { export type IDepartment = {
departmentCode: string departmentCode: string
departmentName: string departmentName: string
[key: string]: any
} }
export type IFunction = { export type IFunction = {
...@@ -24,16 +25,19 @@ declare module 'bonehouse' { ...@@ -24,16 +25,19 @@ declare module 'bonehouse' {
functionCode: string functionCode: string
functionName: string functionName: string
functionOrder: number functionOrder: number
[key: string]: any
} }
export type IInventory = { export type IInventory = {
invCode: string invCode: string
invName: string invName: string
[key: string]: any
} }
export type IOption = { export type IOption = {
label: string label: string
value: string value: string
[key: string]: any
} }
export type IRule = { export type IRule = {
...@@ -41,6 +45,7 @@ declare module 'bonehouse' { ...@@ -41,6 +45,7 @@ declare module 'bonehouse' {
message?: string message?: string
pattern?: RegExp pattern?: RegExp
func?: Function func?: Function
[key: string]: any
} }
export type IFormField = { export type IFormField = {
...@@ -62,28 +67,33 @@ declare module 'bonehouse' { ...@@ -62,28 +67,33 @@ declare module 'bonehouse' {
order?: number order?: number
minuteInterval?: number minuteInterval?: number
symmetric?: string symmetric?: string
[key: string]: any
} }
export type IOrganization = { export type IOrganization = {
orgName: string orgName: string
orgCode: string orgCode: string
[key: string]: string
} }
export type IShipToSite = { export type IShipToSite = {
shipToSiteCode: string shipToSiteCode: string
shipToSiteName: string shipToSiteName: string
[key: string]: any
} }
export type IBillToSite = { export type IBillToSite = {
billToSiteCode: string billToSiteCode: string
billToSiteName: string billToSiteName: string
shipToSites: IShipToSite[] shipToSites: IShipToSite[]
[key: string]: any
} }
export type ICustomer = { export type ICustomer = {
customerCode: string customerCode: string
customerName: string customerName: string
billToSites: IBillToSite[] billToSites: IBillToSite[]
[key: string]: any
} }
export type ISurgeryCollectHeader = { export type ISurgeryCollectHeader = {
...@@ -153,6 +163,7 @@ declare module 'bonehouse' { ...@@ -153,6 +163,7 @@ declare module 'bonehouse' {
surgeryName: string surgeryName: string
updateBy: string updateBy: string
updateTime: string updateTime: string
[key: string]: any
} }
export type ISurgeryCollectLine = { export type ISurgeryCollectLine = {
...@@ -190,6 +201,7 @@ declare module 'bonehouse' { ...@@ -190,6 +201,7 @@ declare module 'bonehouse' {
feeType: string feeType: string
feeAmount: number feeAmount: number
remark: string remark: string
[key: string]: any
} }
export type IPlan = { export type IPlan = {
...@@ -216,6 +228,7 @@ declare module 'bonehouse' { ...@@ -216,6 +228,7 @@ declare module 'bonehouse' {
zysx: string zysx: string
ssDate: string ssDate: string
ssTime: string ssTime: string
[key: string]: any
} }
} }
...@@ -226,12 +239,14 @@ declare module 'navigation' { ...@@ -226,12 +239,14 @@ declare module 'navigation' {
push: Function push: Function
replace: Function replace: Function
reset: Function reset: Function
[key: string]: any
} }
type IRouteState = { type IRouteState = {
params: any params: any
routeName: string routeName: string
key: string key: string
[key: string]: any
} }
export type INavigation = { export type INavigation = {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment