Commit 0bdc6baa by peii

Merge branch 'develop_ts_ref' into develop

parents fa166b87 61eab372
......@@ -24,6 +24,9 @@ import LineOrderPage from './containers/historicalOrder/module/LineOrderPage'
import SubSuccPage from './containers/common/SubSuccPage'
import BarCodePage from './containers/common/BarCodePage'
// 下单
import SelfOrder from '../src/pages/order/self'
// 结算
import Settlement from '../src/pages/settlement/index'
import SettlementCollection from '../src/pages/settlement/collection'
......@@ -54,6 +57,7 @@ const Router = createAppContainer(
LoginPage: { screen: LoginPage },
HomePage: { screen: HomePage },
SelfOrderPage: { screen: SelfOrderPage },
SelfOrder: { screen: SelfOrder },
ChooseProductPage: { screen: ChooseProductPage },
SearchPage: { screen: SearchPage },
EditThirdLevelPage: { screen: EditThirdLevelPage },
......@@ -71,8 +75,11 @@ const Router = createAppContainer(
TransSearchPage: { screen: TransSearchPage },
HistoricalOrderPage: { screen: HistoricalOrderPage },
LineOrderPage: { screen: LineOrderPage },
SubSuccPage: { screen: SubSuccPage },
BarCodePage: { screen: BarCodePage },
// 结算
Settlement: { screen: Settlement },
SettlementCollection: { screen: SettlementCollection },
SettlementReject: { screen: SettlementReject },
......@@ -85,6 +92,7 @@ const Router = createAppContainer(
DirectionInvoice: { screen: DirectionInvoice },
DirectionInvoiceCollections: { screen: DirectionInvoiceCollections },
DirectionInvoiceApplyDetail: { screen: DirectionInvoiceApplyDetail },
ConsumeFee: { screen: ConsumeFee },
MixConsume: { screen: MixConsume },
MixConsumeForm: { screen: MixConsumeForm },
......
......@@ -17,6 +17,7 @@ import {
import { GetRequest, PostRequest } from '../network/RequestUtils';
import { getUrlParams, show, showWarnErrorMessage, showErrorMessage, isNotBlank } from '../utils/Utils';
import { originSysProfiles, originSysValueSets } from '../reducers/module/login';
import { toBinaryNumber } from '../../src/utils/utils';
export function requestLogin(params) {
return (dispatch, getState) => {
......@@ -183,7 +184,7 @@ export function getSysProfiles() {
console.log(profile_code, 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))
})
}
......
......@@ -131,7 +131,7 @@ export const reqSelfSurgeryHospital = async (global_domain_config, params) => {
}
// 获取订单类型 params={access_token:'', value_set_code:'SUR_ORDER_TYPE'}
export function requestSelfOrderType(params, url) {
export function requestSelfOrderType(params, url, cb = () => {}) {
return (dispatch, getState) => {
dispatch(requestListDataing())
let { global_domain_config } = getState().login
......@@ -144,7 +144,7 @@ export function requestSelfOrderType(params, url) {
console.log('获取订单类型 res=====', res)
// 兼容老的接口,有的环境没有实现获取订单类型接口
if (res.status === 404) {
return dispatch(requestSelfOrderType(params, '/system/value_set/search'))
return dispatch(requestSelfOrderType(params, '/system/value_set/search', cb))
}
if (res.error_code == 0) {
let data = []
......@@ -159,13 +159,14 @@ export function requestSelfOrderType(params, url) {
data = res.data.sys_values
}
dispatch(requestListDataSuccess(data))
cb(data)
} else {
showWarnErrorMessage(dispatch, res, exitLoginStatus, requestListDataFail)
}
})
.catch(err => {
if (!url) {
requestSelfOrderType(params, '/system/value_set/search')
requestSelfOrderType(params, '/system/value_set/search', cb)
} else {
showErrorMessage(dispatch, err, requestListDataFail, '获取订单类型')
}
......
......@@ -14,6 +14,7 @@ import {
font_family_regular,
} from '../../base/BaseStyle'
import { exitLoginStatus, requestSysProfile, setNavigation, getOrganizationData } from '../../action/LoginAction'
import { getOrganizations } from '../../../src/actions/userAction'
import { getLendOrderCodeValues } from '../../action/SelfAction'
import { getSettlementStatus, getInvoiceStatus, getArInvoiceStatus } from '../../action/SettlementAction'
import HeadBackItem from '../common/HeadBackItem'
......@@ -230,7 +231,6 @@ class HomePage extends Component {
this.props.getInvoiceStatus()
// 分销开票状态
this.props.getArInvoiceStatus()
}
getLendOrderCodeValues() {
......@@ -396,8 +396,8 @@ const mapDispatchToProps = dispatch => ({
dispatch(getLendOrderCodeValues())
},
getOrganizationData: () => {
dispatch(getOrganizationData())
}
dispatch(getOrganizations(null, { success: () => {} }))
},
})
export default connect(mapStateToProps, mapDispatchToProps)(HomePage)
......@@ -2,7 +2,7 @@
* @FilePath: /BoneHouse_Business_APP/app/reducers/index.js
* @Author: peii
* @Date: 2021-02-03 20:59:10
* @LastEditTime: 2022-08-04 17:36:19
* @LastEditTime: 2022-11-02 16:29:41
* @LastEditors: PEII
* @Vision: 1.0
* @Description:
......@@ -19,6 +19,8 @@ import deviceInfo from './module/deviceInfo';
import settlement from './module/settlement';
import mixConsume from './module/mixConsume';
import { user } from '../../src/reducers/user';
const loginConfig = {
key: 'login',
storage,
......@@ -92,6 +94,7 @@ const rootReducer = {
deviceInfo: persistReducer(deviceConfig, deviceInfo),
settlement: persistReducer(settlementConfig, settlement),
mixConsume: persistReducer(mixConsumeConfig, mixConsume),
user
}
export default rootReducer;
\ No newline at end of file
import {
LOGIN_NO,
LOGIN_DOING,
LOGIN_SUCCESS,
LOGIN_FAILURE,
EXIT_LOGIN,
AUTO_LOGIN_SUCCESS,
AUTO_LOGIN_FAILURE,
SET_DOMAIN_CONFIGURATE,
SET_VERSION_APK,
SET_DOMAIN_FROM_ORIGIN,
SET_SYSPROFILE,
SET_SYSVALUESET,
SET_NAVIGATION,
SET_ORGANIZATION
} from '../../base/ActionTypes';
LOGIN_NO,
LOGIN_DOING,
LOGIN_SUCCESS,
LOGIN_FAILURE,
EXIT_LOGIN,
AUTO_LOGIN_SUCCESS,
AUTO_LOGIN_FAILURE,
SET_DOMAIN_CONFIGURATE,
SET_VERSION_APK,
SET_DOMAIN_FROM_ORIGIN,
SET_SYSPROFILE,
SET_SYSVALUESET,
SET_NAVIGATION,
SET_ORGANIZATION,
} from '../../base/ActionTypes'
// 登录状态
const defaultState = {
loginState:LOGIN_NO, // 登录状态
userInfo:{}, // 保存用户信息
token:null,
username:'',
password:'',
global_domain_config: 'https://obs.uat.guke.tech',
hasSetDomainFromOrigin: false,
local_version_apk: '',
navigation: null,
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 = {
loginState: LOGIN_NO, // 登录状态
userInfo: {}, // 保存用户信息
token: null,
username: '',
password: '',
global_domain_config: 'https://obs.uat.guke.tech',
hasSetDomainFromOrigin: false,
local_version_apk: '',
navigation: null,
sysProfiles: {
OBS_SHOW_ORG_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_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',
OBS_MOBILE_BOR_WARE_REQUIRED: '00'
},
sysValueSets: {
SUR_FEE_TYPE: [],
SUR_ORDER_TYPE: [],
},
organizations: [],
}
export const originSysValueSets = {
SUR_FEE_TYPE: []
// 默认sysProfile,放state里时,会被持久化影响后面更新不了
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',
OBS_MOBILE_BOR_WARE_REQUIRED: '00'
}
export const originSysValueSets = {
SUR_FEE_TYPE: [],
SUR_ORDER_TYPE: [],
}
export default login = (state = defaultState, action) => {
switch (action.type) {
case LOGIN_DOING:
return Object.assign({}, state, {
loginState: LOGIN_DOING
});
case LOGIN_SUCCESS:
return Object.assign({}, state, {
loginState:LOGIN_SUCCESS,
userInfo:action.rawData,
token:action.rawData.access_token,
username:action.username,
password:action.password
});
case LOGIN_FAILURE:
return Object.assign({}, state, {
loginState:LOGIN_FAILURE
});
case EXIT_LOGIN:
return Object.assign({}, state,{
token: null,
loginState:LOGIN_NO,
userInfo:{},
// password: ''
});
case AUTO_LOGIN_SUCCESS:
return Object.assign({}, state, {
loginState: LOGIN_SUCCESS,
userInfo: action.rawData,
token: action.rawData.access_token
});
case AUTO_LOGIN_FAILURE:
return Object.assign({}, state, {
loginState: LOGIN_FAILURE
});
case SET_DOMAIN_CONFIGURATE:
return Object.assign({}, state, {
global_domain_config: action.global_domain_config
})
case SET_DOMAIN_FROM_ORIGIN:
return Object.assign({}, state, {
hasSetDomainFromOrigin: action.data
})
case SET_VERSION_APK:
return Object.assign({}, state, {
local_version_apk: action.local_version_apk
})
case SET_SYSPROFILE:
return Object.assign({}, state, {
sysProfiles: {
...state.sysProfiles,
[action.code]: action.value
}
})
case SET_SYSVALUESET:
return Object.assign({}, state, {
sysValueSets: {
...state.sysValueSets,
[action.code]: action.value
}
})
case SET_NAVIGATION:
return Object.assign({}, state, {
navigation: action.navigation
})
case SET_ORGANIZATION:
return Object.assign({}, state, {
organizations: action.organizations
})
default: // need this for default case
return state
}
switch (action.type) {
case LOGIN_DOING:
return Object.assign({}, state, {
loginState: LOGIN_DOING,
})
case LOGIN_SUCCESS:
return Object.assign({}, state, {
loginState: LOGIN_SUCCESS,
userInfo: action.rawData,
token: action.rawData.access_token,
username: action.username,
password: action.password,
})
case LOGIN_FAILURE:
return Object.assign({}, state, {
loginState: LOGIN_FAILURE,
})
case EXIT_LOGIN:
return Object.assign({}, state, {
token: null,
loginState: LOGIN_NO,
userInfo: {},
// password: ''
})
case AUTO_LOGIN_SUCCESS:
return Object.assign({}, state, {
loginState: LOGIN_SUCCESS,
userInfo: action.rawData,
token: action.rawData.access_token,
})
case AUTO_LOGIN_FAILURE:
return Object.assign({}, state, {
loginState: LOGIN_FAILURE,
})
case SET_DOMAIN_CONFIGURATE:
return Object.assign({}, state, {
global_domain_config: action.global_domain_config,
})
case SET_DOMAIN_FROM_ORIGIN:
return Object.assign({}, state, {
hasSetDomainFromOrigin: action.data,
})
case SET_VERSION_APK:
return Object.assign({}, state, {
local_version_apk: action.local_version_apk,
})
case SET_SYSPROFILE:
return Object.assign({}, state, {
sysProfiles: {
...state.sysProfiles,
[action.code]: action.value,
},
})
case SET_SYSVALUESET:
return Object.assign({}, state, {
sysValueSets: {
...state.sysValueSets,
[action.code]: action.value,
},
})
case SET_NAVIGATION:
return Object.assign({}, state, {
navigation: action.navigation,
})
case SET_ORGANIZATION:
return Object.assign({}, state, {
organizations: action.organizations,
})
default:
// 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-24 16:33:56
* @LastEditors: PEII
* @Vision: 1.0
* @Description:
*/
export const GET_ORGANIZATIONS = 'GET_ORGANIZATIONS'
export const GET_CUSTOMERS = 'GET_CUSTOMERS'
export const GET_COLLECT_SETTING = 'GET_COLLECT_SETTING'
export const GET_DEPARTMENTS = 'GET_DEPARTMENTS'
\ 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-24 16:35:34
* @LastEditors: PEII
* @Vision: 1.0
* @Description:
*/
import { createApiAction } from './utils'
import { GET_ORGANIZATIONS, GET_CUSTOMERS, GET_COLLECT_SETTING, GET_DEPARTMENTS } from './action-types'
import api from '../services/api'
import service from '../services/service'
/**
* @description: 获取组织
* @return {*}
*/
export const getOrganizations = createApiAction(GET_ORGANIZATIONS, api.getOrganizations)
/**
* @description: 获取部门
* @return {*}
*/
export const getDepartments = createApiAction(GET_DEPARTMENTS, service.getDepartmentsBySellerAndOrg)
export const getCustomers = createApiAction(GET_CUSTOMERS, api.getCustomers)
export const getCollectSetting = createApiAction(GET_COLLECT_SETTING, api.getCollectSetting)
import { IApiAction } from 'action'
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: (key: string) => Dictionary<any> = createAction(__, always(null), always(null))
export const createApiAction: IApiAction = (actionType: string, fn: Function) => {
return (params = {}, callback = { success: <U>(p: U) => {}, fail: <R>(p: R) => {} }, customActionType = actionType) =>
async (dispatch: Function) => {
try {
console.log({ type: `${customActionType}_REQUEST`, params })
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)
@import '../../assets/styles/base.styl'
@import '../../assets/styles/variable.styl'
.audio
background-color #fff
padding 18px
margin-bottom 18px
.not-record
&-tip
font-size 18px
padding-bottom 20px
font-family font_family_regular
.record
&-btn
@extend .row
@extend .middle
@extend .center
align-self center
background-color dis_sub_color
width 150px
height 48px
border-radius 24px
margin-top 20px
margin-bottom 20px
&__icon
height 20px
&__text
font-size second_text_size
color #333
.recorded
@extend .row
align-items center
&-item
background-color home_background_color
padding 10px
border-radius 10px
&__text
font-size second_text_size
font-family font_family_regular
&__delete
padding 0 8px
background-color primary_color
height 22px
@extend .middle
border-radius 5px
margin-left 20px
&-text
font-size third_text_size
color #fff
line-height 22px
.unactive
display none
\ No newline at end of file
/*
* @FilePath: /BoneHouse_Business_APP/src/components/form/audio.tsx
* @Author: peii
* @Date: 2021-06-19 22:37:22
* @LastEditTime: 2022-11-21 14:51:12
* @LastEditors: PEII
* @Vision: 1.0
* @Description: 录音组件
*/
// @ts-nocheck
import React, { Component } from 'react'
import { View, Text, Image, TouchableOpacity, Alert, Linking, Platform, NativeModules } from 'react-native'
import Sound from 'react-native-sound'
import { IFormField } from 'bonehouse'
import * as R from 'ramda'
import { AudioRecorder, AudioUtils } from 'react-native-audio'
import { isBlank, show, isNotBlank, g } from '../../utils/utils'
import { MsgType } from '../../enums'
import styles from './audio.styl'
// import Container from '../../inversify'
// import { TYPES } from '../../inversify/types'
// import Service from '../../services/service'
type IProps = {
item: IFormField
value: string
onChange: Function
}
type IState = {
audioPath: string
hasPermission: boolean
currentTime: number
recorded: boolean
}
export default class Audio extends Component<IProps, IState> {
state = {
audioPath: AudioUtils.DocumentDirectoryPath + `/${new Date().getTime()}.aac`, // 文件路径
hasPermission: false,
recorded: false,
currentTime: 0,
}
sound = null
constructor(props: IProps) {
super(props)
this.openAppSetting = this.openAppSetting.bind(this)
this.requestAudioPermission = this.requestAudioPermission.bind(this)
this.prepareRecordingPath = this.prepareRecordingPath.bind(this)
this.recordHandler = this.recordHandler.bind(this)
this.stopRecordingHandler = this.stopRecordingHandler.bind(this)
this.deleteHandler = this.deleteHandler.bind(this)
this.playHandler = this.playHandler.bind(this)
}
componentDidMount() {
this.requestAudioPermission()
}
/**
* @description: 打开设置
* @param {*}
* @return {*}
*/
openAppSetting() {
Alert.alert('提示信息', 'APP需要使用录音,请打开录音权限允许APP使用', [
{
text: '设置',
onPress: () => {
if (Platform.OS == 'ios') {
Linking.openURL('app-settings:').catch(err => console.log('error', err))
} else if (Platform.OS == 'android') {
NativeModules.OpenSettings.openNetworkSettings((data: any) => {
console.log('call back data', data)
}).catch((err: any) => console.log('android', err))
}
},
},
{
text: '取消',
},
])
}
/**
* @description: 请求录音权限
* @param {*}
* @return {*}
*/
requestAudioPermission() {
AudioRecorder.requestAuthorization().then(isAuthor => {
console.log('是否授权: ' + isAuthor)
if (!isAuthor) return this.openAppSetting()
this.setState({ hasPermission: isAuthor })
// this.prepareRecordingPath(this.state.audioPath)
// 录音进展
AudioRecorder.onProgress = data => {
this.setState({
currentTime: Math.ceil(data.currentTime),
})
}
// 完成录音
AudioRecorder.onFinished = data => {
// data 录音数据
console.log(data)
}
})
}
/**
* @description: 设置录音路径
* @param {string} path
* @return {*}
*/
prepareRecordingPath(path: string) {
const option = {
SampleRate: 44100.0, //采样率
Channels: 2, //通道
AudioQuality: 'High', //音质
AudioEncoding: 'aac', //音频编码
OutputFormat: 'mpeg_4', //输出格式
MeteringEnabled: false, //是否计量
MeasurementMode: false, //测量模式
AudioEncodingBitRate: 32000, //音频编码比特率
IncludeBase64: true, //是否是base64格式
AudioSource: 0, //音频源
}
AudioRecorder.prepareRecordingAtPath(path, option as any)
}
/**
* @description: 录音操作
* @param {*}
* @return {*}
*/
async recordHandler() {
try {
if (!this.state.hasPermission) return this.openAppSetting()
await this.prepareRecordingPath(this.state.audioPath)
this.sound = null
AudioRecorder.startRecording()
show('录音开始')
} catch (err) {
console.error(err)
}
}
/**
* @description: 录音完成
* @param {*}
* @return {*}
*/
async stopRecordingHandler() {
if (!this.state.hasPermission) return
try {
await AudioRecorder.stopRecording()
show('录音完成')
this.setState({ recorded: true })
} catch (error) {}
}
/**
* @description: 录音播放
* @param {*}
* @return {*}
*/
playHandler() {
if (this.state.playing) return
if (isBlank(this.sound)) {
this.sound = new Sound(this.state.audioPath, '', err => {
if (err) {
return show('音频加载失败')
}
this.setState({ playing: true })
this.sound.play(success => {
this.setState({ playing: false })
success ? show('播放完毕') : show('播放失败')
})
})
} else {
this.setState({ playing: true })
this.sound.play(success => {
this.setState({ playing: false })
success ? show('播放完毕') : show('播放失败')
})
}
}
/**
* @description: 删除操作
* @param {*}
* @return {*}
*/
deleteHandler() {
this.setState({ recorded: false })
this.sound = null
}
render() {
const { recorded, currentTime } = this.state
return (
<View style={g(styles, 'audio')}>
<View style={g(styles, { 'not-record': true, unactive: recorded })}>
<Text style={g(styles, 'not-record-tip')}>还有什么要安排的,可录音备注哟!</Text>
<TouchableOpacity
style={g(styles, 'record-btn')}
touchableOpacity={0.8}
onLongPress={this.recordHandler.bind(this)}
onPressOut={this.stopRecordingHandler}
ref={ref => (this.recordBtnRef = ref)}
>
<Image
style={g(styles, 'record-btn__icon')}
source={require('../../assets/images/record_icon.png')}
resizeMode="contain"
/>
<Text style={g(styles, 'record-btn__text')}>长按录音</Text>
</TouchableOpacity>
</View>
<View style={g(styles, { recorded: true, unactive: !recorded })}>
<TouchableOpacity style={g(styles, 'recorded-item')} onPress={this.playHandler}>
<Text style={g(styles, 'recorded-item__text')}>点击播放 {currentTime}"</Text>
</TouchableOpacity>
<TouchableOpacity style={g(styles, 'recorded-item__delete')} onPress={this.deleteHandler}>
<Text style={g(styles, 'recorded-item__delete-text')}>删除</Text>
</TouchableOpacity>
</View>
</View>
)
}
}
......@@ -19,6 +19,7 @@ import Radio from './radio'
import Input from './input'
import DatePicker from './date'
import ImageForm from './image'
import Audio from './audio'
import { g, isBlank, show, debounce } from '../../utils/utils'
import styles from './index.styl'
......@@ -33,6 +34,7 @@ const formComponents = {
[FieldType.DATE]: DatePicker,
[FieldType.IMAGE]: ImageForm,
[FieldType.RADIO]: Radio,
[FieldType.VOICE]: Audio,
}
export default class Form extends Component<IProps> {
......@@ -77,7 +79,7 @@ export default class Form extends Component<IProps> {
checkSubmit() {
const { fields, data } = this.props
for (const item of fields) {
if (isBlank(item.rules)) continue
if (item.show === false || isBlank(item.rules)) continue
// 校验是否可以提交
for (const rule of item.rules) {
......@@ -122,6 +124,8 @@ export default class Form extends Component<IProps> {
<ScrollView style={g(styles, 'form')}>
<KeyboardAvoidingView style={g(styles, 'form-inner')} behavior="padding" enabled>
{fields.map(item => {
if (item.show === false) return <></>
let FormComponent = formComponents[item.type] || Select
if (item.type === FieldType.CUSTOM) {
......
......@@ -70,7 +70,11 @@ export default class Select extends Component<IProps> {
}
// 换了options,表示依赖的项没有了,把当前设置为空
const val = getText(item, value)
if (isNotBlank(value) && isBlank(val) && R.complement(R.equals)(this.props.data, nextProps.data)) {
if (
isNotBlank(value) &&
isBlank(val) &&
(R.complement(R.equals)(this.props.data, nextProps.data) || isBlank(item.options))
) {
this.onChange(null)
}
......
......@@ -286,7 +286,7 @@ class Filter extends React.Component<IProps, IState> {
const mapStateToProps = state => ({
userInfo: state.login.userInfo,
sysProfiles: state.login.sysProfiles,
organizations: state.login.organizations,
organizations: state.user.organizations,
})
const mapDispatchToProps = dispatch => ({})
......
......@@ -257,7 +257,7 @@ class Filter extends React.Component<IProps, IState> {
const mapStateToProps = state => ({
userInfo: state.login.userInfo,
sysProfiles: state.login.sysProfiles,
organizations: state.login.organizations,
organizations: state.user.organizations,
})
const mapDispatchToProps = dispatch => ({})
......
......@@ -543,7 +543,7 @@ class ConsumeForm extends Component<IProps, IState> {
const mapStateToProps = state => ({
list: state.mixConsume.orders,
userInfo: state.login.userInfo,
organizations: state.login.organizations,
organizations: state.user.organizations,
sysProfiles: state.login.sysProfiles,
})
......
......@@ -2,7 +2,7 @@
* @FilePath: /BoneHouse_Business_APP/src/pages/mix_consume/index.tsx
* @Author: PEII
* @Date: 2022-08-02 16:40:21
* @LastEditTime: 2022-10-13 17:52:12
* @LastEditTime: 2022-10-28 17:58:04
* @LastEditors: PEII
* @Vision: 1.0
* @Description: 混单报消耗
......@@ -20,7 +20,6 @@ import Header from '../../components/header/header'
import Resolution from '../../components/common/Resolution'
import Search from './components/search'
import { isBlank, g, show } from '../../utils/utils'
import api from '../../services/api'
import { setOrders } from '../../../app/action/MixConsumeAction'
import styles from './index.styl'
......
/*
* @FilePath: /BoneHouse_Business_APP/src/pages/order/hoc/order.tsx
* @Author: PEII
* @Date: 2022-11-22 16:47:26
* @LastEditTime: 2022-11-24 22:36:13
* @LastEditors: PEII
* @Vision: 1.0
* @Description: 订单类型form
*/
// @ts-nocheck
import React, { Component } from 'react'
import * as R from 'ramda'
import { g, getFormItem, isBlank, isNotBlank, show, getOrderSysProfile } from '../../../utils/utils'
import service from '../../../services/service'
import api from '../../../services/api'
type IProps = {
navigation: INavigation
userInfo: any
organizations: IOrganization[]
allCustomers: {}
getCustomers: (sellerCode: string, orgCode: string) => Promise<any>
getCollectSetting: (orgCode, customerCode, billToSiteCode, shipToSiteCode) => Promise<any>
getOrderTypes: (token, orgCode) => Promise<any>
}
type IState = {
data: { [key: string]: any[] }
formItems: IFormField[]
doctorNames: string[]
invs: { string: any[] }
departments: { string: any[] }
}
export default function Order(WrapComponent: Component<IProps, IState>) {
return class Order extends WrapComponent {
constructor(props) {
super(props)
this.setData = this.setData.bind(this)
this.submitHandler = this.submitHandler.bind(this)
}
state = {
data: {
sellerCode: this.props.userInfo.user_name,
replaceItemFlag: 'N',
Caller: 'dingding',
},
invs: {},
orderTypes: {},
departments: {},
}
/**
* @description: 设置修改值
* @param {*} key
* @param {*} vlaue
* @return {*}
*/
setData(key: string, value: any) {
return new Promise<any>((resolve, reject) => {
const { data, formItems } = this.state
data[key] = value
this.setState({ data }, () => {
const item = getFormItem(formItems, key)
item && item.callback && item.callback()
resolve()
})
})
}
/**
* @description: 组织选择完回调
* @param {*}
* @return {*}
*/
async setOrgCallback() {
const { show } = getOrderSysProfile('OBS_MOBILE_DEPARTMENT_DISPLAY')
this.getOrderTypes()
// 设置完组织获取部门和客户
if (show) {
this.getDepartments.call(this)
}
this.getCustomers.call(this)
}
/**
* @description: 获取部门列表
* @param {*}
* @return {*}
*/
async getDepartments() {
let { data, formItems, departments } = this.state
const { orgCode, sellerCode } = data
const key = `${sellerCode}${orgCode}`
const item = getFormItem(formItems, 'departmentCode')
if (isBlank(departments[key])) {
item.loading = true
const res = await service.getDepartmentsBySellerAndOrg({ orgCode, sellerCode, scopeFlag: 'Y' })
item.loading = false
departments[key] = R.pathOr([], ['data', 'relationships'])(res)
}
item.options = R.map(
R.applySpec({
value: R.prop('department_code'),
label: R.prop('department_name'),
}),
)(departments[key] || [])
this.setState({ formItems, departments })
}
/**
* @description: 设置部门后回调
* @param {*}
* @return {*}
*/
async setDepartmentCallback() {
const { data, formItems, departments } = this.state
const { orgCode, sellerCode, departmentCode } = data
const key = `${sellerCode}${orgCode}`
const dep = R.compose(R.find(R.propEq('department_code', departmentCode)), R.propOr([], key))(departments)
console.log(dep)
// 设置业务经理
const bmItem = getFormItem(formItems, 'businessManagerCode')
if (bmItem.show) {
bmItem.options = R.compose(
R.map(
R.applySpec({
value: R.prop('business_manager_code'),
label: R.prop('business_manager_name'),
}),
),
R.propOr([], 'business_manager_list'),
)(dep)
}
// 设置跟台员
const followerItem = getFormItem(formItems, 'surgeryFollowerCode')
if (followerItem.show) {
followerItem.options = R.compose(
R.map(
R.applySpec({
value: R.prop('surgery_follower_code'),
label: R.prop('surgery_follower_name'),
}),
),
R.propOr([], 'surgery_follower_list'),
)(dep)
}
// 设置送货员
const item = getFormItem(formItems, 'deliverymanCode')
if (item.show) {
item.options = R.compose(
R.map(
R.applySpec({
value: R.prop('deliveryman_code'),
label: R.prop('deliveryman_name'),
}),
),
R.propOr([], 'surgery_follower_list'),
)(dep)
}
this.setState({ formItems })
}
/**
* @description: 获取客户列表
* @param {*}
* @return {*}
*/
async getCustomers() {
const { data, formItems, allCustomers } = this.state
const { orgCode, sellerCode } = data
let customers = R.propOr([], orgCode)(allCustomers)
const item = getFormItem(formItems, 'customerCode')
if (isBlank(customers)) {
item.loading = true
await this.props.getCustomers(sellerCode, orgCode)
item.loading = false
customers = R.propOr([], orgCode)(this.props.allCustomers)
}
item.options = R.map(
R.applySpec({
label: R.prop('customer_name'),
value: R.prop('customer_code'),
}),
)(customers)
this.setState({ formItems })
}
/**
* @description: 客户选择完回调
* @param {*}
* @return {*}
*/
setCustomerCallback() {
const { formItems, data, allCustomers } = this.state
const { orgCode, customerCode } = data
const customer = R.find(R.propEq('customer_code', customerCode))(allCustomers[orgCode] || [])
const item = getFormItem(formItems, 'billToSiteCode')
if (isBlank(customer)) {
item.options = []
} else {
item.options = R.map(
R.applySpec({
label: R.prop('bill_to_site_name'),
value: R.prop('bill_to_site_code'),
shipToSites: R.propOr([], 'ship_to_sites'),
}),
)(customer.bill_to_sites)
}
this.setState({ formItems })
}
/**
* @description: 收单地点选择完回调
* @param {*}
* @return {*}
*/
setBillToSitesCallback() {
let { formItems, data, doctorNames } = this.state
const { billToSiteCode } = data
const item = getFormItem(formItems, 'shipToSiteCode')
const billItem = getFormItem(formItems, 'billToSiteCode')
const billToSiteItem = R.find(R.propEq('value', billToSiteCode))(billItem.options || [])
const doctorItem = getFormItem(formItems, 'doctorName')
if (isBlank(billToSiteItem)) {
item.options = []
doctorNames = []
doctorItem.options = []
} else {
doctorNames = R.compose(R.filter(isNotBlank), R.uniq, R.pluck('customer_name'))(billToSiteItem.shipToSites)
doctorItem.options = R.map(R.applySpec({ label: R.identity, value: R.identity }))(doctorNames)
item.options = R.compose(
R.map(
R.applySpec({
label: R.prop('ship_to_site_name'),
value: R.prop('ship_to_site_code'),
doctorName: R.prop('customer_doctor'),
authorization: R.prop('authorization'),
sal_seller_customer_product_authorization: R.prop('sal_seller_customer_product_authorization'),
}),
),
)(billToSiteItem.shipToSites || [])
}
this.setState({ formItems, doctorNames })
}
/**
* @description: 收货地点选择完回调
* @param {*}
* @return {*}
*/
setShipToSiteCallback() {
const { shipToSiteCode } = this.state.data
// 借货仓库依赖收货地址
if (isNotBlank(shipToSiteCode)) {
this.getInventories()
}
}
/**
* @description: 获取借货仓库
* @param {*}
* @return {*}
*/
async getInventories() {
const { formItems, data, invs } = this.state
const { orgCode, customerCode, billToSiteCode, shipToSiteCode } = data
const item = getFormItem(formItems, 'collectSrcInvCode')
let invRes = await api.getCollectSetting({
orgCode,
customerCode,
billToSiteCode,
shipToSiteCode,
processCode: 'COLLECT',
})
item.options = R.compose(
R.uniqBy(R.prop('source_inv_code')),
R.map(
R.applySpec({
label: R.prop('source_inv_name'),
value: R.prop('source_inv_code'),
}),
),
R.propOr([], 'data'),
)(invRes)
this.setState({ formItems })
}
/**
* @description: 订单类型
* @return {*}
*/
async getOrderTypes() {
let { data, orderTypes, formItems } = this.state
const { token } = this.props
if (isBlank(orderTypes[data.orgCode])) {
const res = await this.props.getOrderTypes(token, data.orgCode)
orderTypes[data.orgCode] = res
}
const item = getFormItem(formItems, 'orderTypeCode')
item.options = R.compose(
R.uniqBy(R.prop('value')),
R.map(
R.applySpec({
label: R.prop('value_name'),
value: R.prop('value_code'),
}),
),
)(orderTypes[data.orgCode] || [])
this.setState({ formItems })
}
/**
* @description:
* @param {*}
* @return {*}
*/
submitHandler() {
console.log('submit')
}
render() {
return super.render()
}
}
}
{
"$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-24 21:12:12
* @LastEditors: PEII
* @Vision: 1.0
* @Description: 自助下单formItem数据
*/
// @ts-nocheck
import * as R from 'ramda'
import { IFormField } from 'bonehouse'
import { FieldType, SelectMode } from '../../enums'
import { getOrderSysProfile } from '../../utils/utils'
export function getSelfFormItems(): IFormField[] {
const srcInvProfile = getOrderSysProfile('OBS_MOBILE_BOR_WARE_REQUIRED')
const departmentProfile = getOrderSysProfile('OBS_MOBILE_DEPARTMENT_DISPLAY')
const businessManagerProfile = getOrderSysProfile('OBS_MOBILE_BM_DISPLAY')
const followerProfile = getOrderSysProfile('OBS_MOBILE_SUR_FOLLOWER_DISPLAY')
const deliverymanProfile = getOrderSysProfile('OBS_MOBILE_DELIVERYMAN_DISPLAY')
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: 'departmentCode',
label: '部门',
type: FieldType.SELECT,
placeholder: '请选择',
show: departmentProfile.show,
options: [],
rules: [{ required: departmentProfile.required, message: '请选择客户' }],
refrence: ['orgCode'],
callback: this.setDepartmentCallback.bind(this),
},
{
field: 'businessManagerCode',
label: '业务经理',
type: FieldType.SELECT,
placeholder: '请选择',
show: businessManagerProfile.show,
options: [],
rules: [{ required: businessManagerProfile.required, message: '请选择业务经理' }],
refrence: ['orgCode', 'departmentCode'],
},
{
field: 'surgeryFollowerCode',
label: '跟台员',
type: FieldType.SELECT,
placeholder: '请选择',
show: followerProfile.show,
options: [],
rules: [{ required: followerProfile.required, message: '请选择跟台员' }],
refrence: ['orgCode', 'departmentCode'],
},
{
field: 'deliverymanCode',
label: '送货员',
type: FieldType.SELECT,
placeholder: '请选择',
show: deliverymanProfile.show,
options: [],
rules: [{ required: deliverymanProfile.required, message: '请选择送货员' }],
refrence: ['orgCode', 'departmentCode'],
},
{
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.TEXT,
// 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: [],
},
{
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: '请选择',
show: srcInvProfile.show,
options: [],
rules: [{ required: srcInvProfile.required, message: '请选择借货仓库' }],
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: '还有什么要安排的,可录音备注哟!',
},
{
field: 'imageUrl',
label: '添加图片',
type: FieldType.IMAGE,
},
]
}
@import '../../assets/styles/base.styl'
@import '../../assets/styles/variable.styl'
\ No newline at end of file
/*
* @FilePath: /BoneHouse_Business_APP/src/pages/order/self.tsx
* @Author: peii
* @Date: 2021-07-13 22:40:12
* @LastEditTime: 2022-11-24 21:20:19
* @LastEditors: PEII
* @Vision: 1.0
* @Description: 自助下单
*/
// @ts-nocheck
import React, { Component } from 'react'
import { View, Text, ScrollView } from 'react-native'
import { IOrganization, IFormField } from 'bonehouse'
import { INavigation } from 'navigation'
import * as R from 'ramda'
import { connect } from 'react-redux'
import Resolution from '../../components/common/Resolution'
import Form from '../../components/form'
import Order from './hoc/order'
import { FieldType, SelectMode } from '../../enums'
import Header from '../../components/header/header'
import { g, getFormItem, isBlank, isNotBlank, show, getOrderSysProfile } from '../../utils/utils'
import { getSelfFormItems } from './self.formItem'
import { getCustomers, getCollectSetting } from '../../actions/userAction'
import { requestSelfOrderType } from '../../../app/action/SelfAction'
import styles from './self.styl'
type IProps = {
navigation: INavigation
userInfo: any
organizations: IOrganization[]
allCustomers: {}
getCustomers: (sellerCode: string, orgCode: string) => Promise<any>
getCollectSetting: (orgCode, customerCode, billToSiteCode, shipToSiteCode) => Promise<any>
getOrderTypes: (token, orgCode) => Promise<any>
}
type IState = {
data: { [key: string]: any[] }
formItems: IFormField[]
doctorNames: []
invs: {}
}
class SelfOrder extends Component<IProps, IState> {
componentDidMount() {
const formItems = getSelfFormItems.call(this)
this.setState({ formItems }, () => {
this.setState({ data: this.state.data })
})
}
/**
* @description: 产品选择点击回调
* @param {*}
* @return {*}
*/
selectProductsBeforeHandler() {
const { data, formItems } = this.state
console.log(data)
const item = getFormItem(formItems, 'shipToSiteCode')
console.log(item.options)
const value = R.find(R.propEq('value', data.shipToSiteCode))(item.options)
console.log(value)
this.props.navigation.navigate('ChooseProductPage', {
title: `选择产品`,
selfData: {
org_code: data.orgCode,
},
productCallBack: productions => {
console.log(productions)
},
})
}
render() {
const { formItems, data } = this.state
const { navigation } = this.props
const title = navigation.getParam('title', '骨科智慧仓')
return (
<View style={g(styles, 'container', 'bg-gray')}>
<Resolution.FixWidthView>
<Header
title={title}
backCallback={() => {
navigation.goBack()
}}
/>
{/* form表单 */}
<Form
fields={formItems}
data={data}
onChange={this.setData}
ref={ref => (this.formRef = ref)}
submitHandler={this.submitHandler}
/>
</Resolution.FixWidthView>
</View>
)
}
}
const mapStateToProps = state => ({
token: state.login.token,
userInfo: state.login.userInfo,
organizations: state.user.organizations,
allCustomers: state.user.customers,
srcInvs: state.user.srcInvs,
})
const mapDispatchToProps = dispatch => ({
getCustomers(seller_code, org_code) {
return new Promise(resolve => {
dispatch(getCustomers({ seller_code, org_code }, { success: () => resolve(), fail: () => resolve() }))
})
},
/**
* @description: 借货设置
* @param {*} orgCode
* @param {*} customerCode
* @param {*} billToSiteCode
* @param {*} shipToSiteCode
* @return {*}
*/
getCollectSetting(orgCode, customerCode, billToSiteCode, shipToSiteCode) {
return new Promise(resolve => {
dispatch(
getCollectSetting(
{ orgCode, customerCode, billToSiteCode, shipToSiteCode, processCode: 'COLLECT' },
{
success: res => {
resolve(res)
},
},
),
)
})
},
/**
* @description: 获取订单类型
* @param {*} access_token
* @param {*} org_code
* @return {*}
*/
getOrderTypes(access_token, org_code) {
const params = { access_token, org_code, value_set_code: 'SUR_ORDER_TYPE', order_type: 'SUR_ORDER_TYPE' }
return new Promise(resolve => {
dispatch(
requestSelfOrderType(params, null, res => {
resolve(res)
}),
)
})
},
})
export default connect(mapStateToProps, mapDispatchToProps)(Order(SelfOrder))
......@@ -267,7 +267,7 @@ class Filter extends React.Component<IProps, IState> {
const mapStateToProps = state => ({
userInfo: state.login.userInfo,
sysProfiles: state.login.sysProfiles,
organizations: state.login.organizations,
organizations: state.user.organizations,
})
const mapDispatchToProps = dispatch => ({})
......
File mode changed
/*
* @FilePath: /BoneHouse_Business_APP/src/reducers/user.ts
* @Author: PEII
* @Date: 2022-11-02 16:02:14
* @LastEditTime: 2022-11-24 16:32:06
* @LastEditors: PEII
* @Vision: 1.0
* @Description:
*/
import * as R from 'ramda'
import { createReducer } from './utils'
import { GET_ORGANIZATIONS, GET_CUSTOMERS, GET_COLLECT_SETTING } from '../actions/action-types'
const initState = {
organizations: [],
inventories: [],
customers: {},
srcInvs: [],
}
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 }
},
[GET_COLLECT_SETTING](state: any, action: IAction) {
return {...state, srcInvs: action.payload}
},
})
/*
* @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
......@@ -2,7 +2,7 @@
* @FilePath: /BoneHouse_Business_APP/src/services/api.ts
* @Author: peii
* @Date: 2021-12-19 16:06:26
* @LastEditTime: 2022-10-27 11:20:09
* @LastEditTime: 2022-11-04 18:11:25
* @LastEditors: PEII
* @Vision: 1.0
* @Description: 未重构完全暂用的所有请求
......@@ -189,4 +189,18 @@ export default {
createGroupComsumeOrder(data: any) {
return request({ url: `${v}/surgery/consume_group_order/create`, data, method: 'POST' })
},
/**
* @description: 获取客户对应的出库仓库
* @return {*}
*/
getCollectSetting(data: {
orgCode: string
customerCode: string
billToSiteCode: string
shipToSiteCode: string
processCode: 'COLLECT'
}) {
return request({ url: `${v}/surgery/collect_setting/search`, data })
},
}
......@@ -66,7 +66,6 @@ export const request = (args: Partial<RequestConfig>) => {
}
}
args.data = transformObject(options.data, 'toLine')
args.data = options.data
options = R.cond([
[R.propEq('method', 'get'), () => R.assoc('url', args.url + '?' + stringify(args.data), options)],
......
......@@ -11,12 +11,19 @@
/// <reference types="react" />
/// <reference types="react-native" />
declare module 'action' {
export interface IApiAction {
<T extends (...args: any) => any>(actionType: string, fn: T): (...args: Parameters<T>) => (dispatch: Function) => Promise<any>
}
}
declare module 'bonehouse' {
export type EnumType = { [s: string]: any }
export type IDepartment = {
departmentCode: string
departmentName: string
[key: string]: any
}
export type IFunction = {
......@@ -24,16 +31,19 @@ declare module 'bonehouse' {
functionCode: string
functionName: string
functionOrder: number
[key: string]: any
}
export type IInventory = {
invCode: string
invName: string
[key: string]: any
}
export type IOption = {
label: string
value: string
[key: string]: any
}
export type IRule = {
......@@ -41,6 +51,7 @@ declare module 'bonehouse' {
message?: string
pattern?: RegExp
func?: Function
[key: string]: any
}
export type IFormField = {
......@@ -62,28 +73,34 @@ declare module 'bonehouse' {
order?: number
minuteInterval?: number
symmetric?: string
show?: boolean
[key: string]: any
}
export type IOrganization = {
orgName: string
orgCode: string
[key: string]: string
}
export type IShipToSite = {
shipToSiteCode: string
shipToSiteName: string
[key: string]: any
}
export type IBillToSite = {
billToSiteCode: string
billToSiteName: string
shipToSites: IShipToSite[]
[key: string]: any
}
export type ICustomer = {
customerCode: string
customerName: string
billToSites: IBillToSite[]
[key: string]: any
}
export type ISurgeryCollectHeader = {
......@@ -153,6 +170,7 @@ declare module 'bonehouse' {
surgeryName: string
updateBy: string
updateTime: string
[key: string]: any
}
export type ISurgeryCollectLine = {
......@@ -190,6 +208,7 @@ declare module 'bonehouse' {
feeType: string
feeAmount: number
remark: string
[key: string]: any
}
export type IPlan = {
......@@ -216,6 +235,7 @@ declare module 'bonehouse' {
zysx: string
ssDate: string
ssTime: string
[key: string]: any
}
}
......@@ -226,12 +246,14 @@ declare module 'navigation' {
push: Function
replace: Function
reset: Function
[key: string]: any
}
type IRouteState = {
params: any
routeName: string
key: string
[key: string]: any
}
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