Commit 8ee8d55e by wong.peiyi

Merge branch 'develop' into product

parents 7c031b4e 89116767
......@@ -29,8 +29,6 @@ const codepushOptions = {
// ON_APP_START 开机时检测
// MANUAL 手动
checkFrequency: CodePush.CheckFrequency.ON_APP_RESUME,
installMode: CodePush.InstallMode.ON_NEXT_RESTART,
updateDialog: false,
}
class App extends Component {
......@@ -45,7 +43,32 @@ class App extends Component {
}
syncImmediate() {
CodePush.sync({})
CodePush.sync({
//安装模式
//ON_NEXT_RESUME 下次恢复到前台时
//ON_NEXT_RESTART 下一次重启时
//IMMEDIATE 马上更新
installMode : CodePush.InstallMode.IMMEDIATE ,
//对话框
updateDialog : {
//是否显示更新描述
appendReleaseDescription : false ,
//更新描述的前缀。 默认为"Description"
descriptionPrefix : "更新内容:" ,
//强制更新按钮文字,默认为continue
mandatoryContinueButtonLabel : "立即更新" ,
//强制更新时的信息. 默认为"An update is available that must be installed."
mandatoryUpdateMessage : "必须更新后才能使用" ,
//非强制更新时,按钮文字,默认为"ignore"
optionalIgnoreButtonLabel : '稍后' ,
//非强制更新时,确认按钮文字. 默认为"Install"
optionalInstallButtonLabel : '后台更新' ,
//非强制更新时,检查到更新的消息文本
optionalUpdateMessage : '有新版本了,是否更新?',
//Alert窗口的标题
title : '更新提示'
}
})
}
render() {
......
This diff could not be displayed because it is too large.
......@@ -152,7 +152,7 @@ export function setSubdetailOption(data) {
}
}
// 设置当前费用明细
// 设置当前费用明细
export function setCharDetailsOption(data) {
return {
type: SET_CHARGE_DETAILS_OPTION,
......@@ -171,6 +171,10 @@ export const uploadEquipImg = async (global_domain_config, params) => {
return await UploadRequest(global_domain_config, getUrlParams('/dingding/upload_media', { access_token }), formData)
}
export const reqOrgDepartments = async (global_domain_config, params) => {
return await GetRequest(global_domain_config, getUrlParams('/sale/sale_relationship/search', params))
}
// 提交数据
export function requestEquipSumbit({access_token, ...params}) {
return (dispatch, getState) => {
......@@ -226,4 +230,4 @@ export function setEquipInitData() {
return {
type: EQUIP_INIT_DATA
}
}
\ No newline at end of file
}
......@@ -37,6 +37,10 @@ export const requestHistorSurgeryType = async (global_domain_config, params) =>
return await GetRequest(global_domain_config, getUrlParams('/system/value_set/search', params))
}
export const reqOrgDepartments = async (global_domain_config, params) => {
return await GetRequest(global_domain_config, getUrlParams('/sale/sale_relationship/search', params))
}
// 借货订单查询 params: {access_token: '', ...}
export function requestGetAllBorrow(params) {
return (dispatch, getState) => {
......@@ -202,4 +206,4 @@ function getDuplicateIncreCount(data, typeName) {
}
})
return dupData
}
\ No newline at end of file
}
import {
import {
LOGIN_DOING,
LOGIN_SUCCESS,
LOGIN_FAILURE,
......@@ -6,7 +6,8 @@ import {
AUTO_LOGIN_SUCCESS,
AUTO_LOGIN_FAILURE,
SET_DOMAIN_CONFIGURATE,
SET_VERSION_APK
SET_VERSION_APK,
SET_DOMAIN_FROM_ORIGIN
} from '../base/ActionTypes';
import { GetRequest, PostRequest } from '../network/RequestUtils';
import { getUrlParams, show, showWarnErrorMessage, showErrorMessage } from '../utils/Utils';
......@@ -116,6 +117,13 @@ export function setDomainConfigurate(domainVal) {
}
}
export function setDomainFromOrigin(hasSet) {
return {
type: SET_DOMAIN_FROM_ORIGIN,
data: hasSet
}
}
//系统配置文件查询接口 access_token profile_code
export const requestSysProfile = async (global_domain_config, params) => {
return await GetRequest(global_domain_config, getUrlParams('/system/sys_profile/search', params))
......
......@@ -155,6 +155,10 @@ export const reqQuickTemplateCollect = async (global_domain_config, params) => {
return await GetRequest(global_domain_config, getUrlParams('/surgery/template_header/search', params))
}
export const reqOrgDepartments = async (global_domain_config, params) => {
return await GetRequest(global_domain_config, getUrlParams('/sale/sale_relationship/search', params))
}
// 获取手术类型 params={access_token:'', value_set_code:'ORTHOPEDICS_PRODUCT_CLASS'}
export function requestQuickSurgeryType(params) {
return (dispatch, getState) => {
......@@ -211,7 +215,7 @@ function requestListDataFail() {
}
}
// 上传语音
// 上传语音
export const requestQuickAudio = async (global_domain_config, params) => {
let { access_token, path } = params
let formData = new FormData()
......@@ -363,4 +367,4 @@ export const reqQuickSurColSetting = async (global_domain_config, params) => {
// }else {
// dispatch(requestListDataFail());
// }
// }
\ No newline at end of file
// }
import { PostRequest, GetRequest, UploadRequest } from '../network/RequestUtils';
import { show, getUrlParams, showWarnErrorMessage, showErrorMessage } from '../utils/Utils';
import { show, getUrlParams, showWarnErrorMessage, showErrorMessage, dedupQuoteArray } from '../utils/Utils';
import { exitLoginStatus } from './LoginAction';
import {
SELF_ORDER_LIST_DOING,
......@@ -44,10 +44,50 @@ export function requestSelfOrganizations(params) {
}
}
// 获取未定单据借货设置 params={access_token:'', org_code:'', customer_code: '', bill_to_site_code: '', ship_to_site_code: '', process_code: ''}
export function requestQuickSurColSetting(params) {
return (dispatch, getState) => {
dispatch(requestListDataing());
let {global_domain_config} = getState().login
GetRequest(global_domain_config, getUrlParams('/surgery/collect_setting/search', params))
.then(res => {
console.log('获取未定单据借货设置 res=====', res);
if(res.error_code == 0) {
let { data } = res
let filterOpt = dedupQuoteArray(data, 'source_inv_code')
dispatch(requestListDataSuccess(filterOpt));
}else {
showWarnErrorMessage(dispatch, res, exitLoginStatus, requestListDataFail);
}
// else if(res.error_code === 41006) {
// show('登录过期,请重新登录');
// dispatch(exitLoginStatus());
// }else if(res.status === 404){
// show('请求接口不存在,请联系管理员!')
// dispatch(requestListDataFail());
// } else {
// let error_msg = res.error_msg || res.message
// show(error_msg);
// dispatch(requestListDataFail());
// }
})
.catch(err => {
// console.log('------err-====获取未定单据借货设置----', Object.keys(err), err)
// show(err.error);
// dispatch(requestListDataFail());
showErrorMessage(dispatch, err, requestListDataFail, '获取未定单据借货设置');
})
}
}
export const reqSelfOrganizations = async (global_domain_config, params) => {
return await GetRequest(global_domain_config, getUrlParams('/authorized_inventory/search', params))
}
export const reqOrgDepartments = async (global_domain_config, params) => {
return await GetRequest(global_domain_config, getUrlParams('/sale/sale_relationship/search', params))
}
// 获取客户名称 params={access_token:'', org_code:'', seller_code:''}
export function requestSelfSurgeryHospital(params) {
......@@ -205,7 +245,7 @@ function requestListDataFail() {
}
// 上传语音
// 上传语音
export const requestSelfAudio = async (global_domain_config, params) => {
let { access_token, path } = params
let formData = new FormData()
......@@ -356,4 +396,4 @@ export function setSelectProductOpts(data) {
type: SET_SELECT_PRODUCT_OPTS,
rawData: data
}
}
\ No newline at end of file
}
......@@ -48,6 +48,10 @@ export const reqTransOrganizations = async (global_domain_config, params) => {
return await GetRequest(global_domain_config, getUrlParams('/authorized_inventory/search', params))
}
export const reqOrgDepartments = async (global_domain_config, params) => {
return await GetRequest(global_domain_config, getUrlParams('/sale/sale_relationship/search', params))
}
// 获取客户名称 params={access_token:'', org_code:'', seller_code:''}
export function requestTransSurgeryHospital(params) {
return (dispatch, getState) => {
......@@ -147,7 +151,7 @@ export function setTransDetailOption(data, searchData) {
}
}
// 上传语音
// 上传语音
export const requestTransAudio = async (global_domain_config, params) => {
let { access_token, path } = params
let formData = new FormData()
......
......@@ -7,6 +7,7 @@ export const EXIT_LOGIN = "EXIT_LOGIN"
export const AUTO_LOGIN_SUCCESS = "AUTO_LOGIN_SUCCESS"
export const AUTO_LOGIN_FAILURE = "AUTO_LOGIN_FAILURE"
export const SET_DOMAIN_CONFIGURATE="SET_DOMAIN_CONFIGURATE"
export const SET_DOMAIN_FROM_ORIGIN = 'SET_DOMAIN_FROM_ORIGIN'
export const SET_VERSION_APK="SET_VERSION_APK"
//-----------self order---------------------
export const SELF_ORDER_LIST_NO = "SELF_ORDER_LIST_NO"
......@@ -62,4 +63,4 @@ export const SET_TRANS_SEARCH_FORM = "SET_TRANS_SEARCH_FORM"
export const DEVICE_INFORMATION_UPDATE_NO = "DEVICE_INFORMATION_UPDATE_NO"
export const DEVICE_INFORMATION_UPDATE_DOING = "DEVICE_INFORMATION_UPDATE_DOING"
export const DEVICE_INFORMATION_UPDATE_SUCCESS = "DEVICE_INFORMATION_UPDATE_SUCCESS"
export const DEVICE_INFORMATION_UPDATE_FAILURE = "DEVICE_INFORMATION_UPDATE_FAILURE"
\ No newline at end of file
export const DEVICE_INFORMATION_UPDATE_FAILURE = "DEVICE_INFORMATION_UPDATE_FAILURE"
......@@ -25,14 +25,14 @@ import { connect } from 'react-redux';
class DialogModel extends Component {
constructor(props) {
super(props);
this.state = {
this.state = {
isVisible: false,
entityList: this.props.entityList,
isShowImage: false,
zoomImages: []
}
}
componentWillReceiveProps(nextProps) {
if (this.state.isVisible != nextProps.show) {
this.setState({
......@@ -43,7 +43,7 @@ class DialogModel extends Component {
this.setState({
entityList: nextProps.entityList
})
}
}
}
closeModal() {
......@@ -52,7 +52,7 @@ class DialogModel extends Component {
});
this.props.closeModal(false);
}
handleChooseItem(item) {
let { itemTitle } = this.props
if (this.state.isVisible) {
......@@ -113,7 +113,7 @@ class DialogModel extends Component {
<View style={styles.opt_area}>
<View style={styles.modal_style}>
<View style={styles.scro_box}>
<ScrollView
<ScrollView
style={styles.item_scroll}
// showsVerticalScrollIndicator={false}
>
......@@ -151,7 +151,7 @@ class DialogModel extends Component {
)
}
render() {
render() {
return (
<View style={styles.dia_container}>
<Modal
......@@ -165,7 +165,7 @@ class DialogModel extends Component {
style={styles.container} activeOpacity={1}
onPress={() => this.closeModal()}
>
{this.renderZoomPicture()}
{this.renderZoomPicture()}
{this.renderDialog()}
</TouchableOpacity>
</SafeAreaView>
......@@ -218,7 +218,9 @@ const styles = StyleSheet.create({
},
list_item_text: {
fontSize: 16,
color: third_text_color
color: third_text_color,
width: '100%',
textAlign: 'center',
},
curr_item: {
color: first_text_color,
......@@ -244,7 +246,10 @@ const styles = StyleSheet.create({
height: 'auto'
},
list_txt_box: {
flex: 1
flex: 1,
width: '100%',
alignItems: 'center',
justifyContent: 'center',
},
list_img_box: {
width: pxSize(60),
......@@ -266,5 +271,5 @@ const mapStateToProps = (state) => {
global_domain_config: state.login.global_domain_config
}
}
export default connect(mapStateToProps, null)(DialogModel);
\ No newline at end of file
export default connect(mapStateToProps, null)(DialogModel);
......@@ -359,4 +359,4 @@ const mapDispatchToProps = (dispatch) => {
}
}
export default connect(mapStateToProps, mapDispatchToProps)(PicTitDetaiCalcu);
\ No newline at end of file
export default connect(mapStateToProps, mapDispatchToProps)(PicTitDetaiCalcu);
......@@ -9,14 +9,16 @@ import { dedupQuoteArray, show, formatStrForDate, cloneObject } from '../../util
import DateModel from '../common/DateModel';
import DialogModel from '../common/DialogModel';
import ZoomPictureModel from '../common/ZoomPictureModel';
import { requestEquipOrganizations, requestEquipSurgeryHospital, requestEquipOrderInfo, uploadEquipImg, setSubdetailOption, setCharDetailsOption, requestEquipSumbit, setEquipInitData, reqEquipSurgeryHospital, reqEquipOrderInfo, requestListDataSuccess, reqEquipOrganizations, requestEquipDetails } from '../../action/EquipAction';
import { requestEquipOrganizations, requestEquipSurgeryHospital, requestEquipOrderInfo, uploadEquipImg, setSubdetailOption, setCharDetailsOption, requestEquipSumbit, setEquipInitData, reqEquipSurgeryHospital, reqEquipOrderInfo, requestListDataSuccess, reqEquipOrganizations, requestEquipDetails, reqOrgDepartments } from '../../action/EquipAction';
import { EQUIP_CONSU_LIST_DOING, EQUIP_CONSU_LIST_SUCCESS, EQUIP_CONSU_LIST_FAILURE, LOGIN_NO, EQUIP_SUBMIT_DOING, EQUIP_SUBMIT_SUCCESS, EQUIP_SUBMIT_FAILURE } from '../../base/ActionTypes';
import moment from 'moment';
import { isNotBlank } from "../../utils/Utils";
import ImagePicker from 'react-native-image-picker';
import { exitLoginStatus } from '../../action/LoginAction';
import { exitLoginStatus, requestSysProfile } from '../../action/LoginAction';
import LodingModel from '../common/LodingModel';
import { OBS_MOBILE_EQU_CON_DISPLAY_PRICE } from '../../base/BaseConstants';
import PageListArrow from '../common/listDataComponent/PageListArrow';
import * as R from 'ramda';
class EquipConsuPage extends Component {
constructor(props) {
......@@ -114,7 +116,25 @@ class EquipConsuPage extends Component {
value: '',
isAddImage: true, // 添加图片
uploadImgArr: [] // 上传后的路径
}
},
{
"id": "15",
title: '部门',
name: '请选择',
value: ''
},
{
"id": "16",
title: '医生',
value: ''
},
{
"id": "17",
title: '跟台员',
name: '请选择',
value: ''
},
],
subInitListOption: [], // 提交成功后,初始化当前数据
submitOption: { // 提交的信息
......@@ -159,11 +179,21 @@ class EquipConsuPage extends Component {
localPhoOption: [ // 添加的图片
],
isShowImage: false,
currShowImgIndex: 0
currShowImgIndex: 0,
sysValues: {
OBS_MOBILE_CONSU_DEPARTMENT_DISPLAY: 0,
OBS_MOBILE_CONSU_DOCTOR_DISPLAY: 0,
OBS_MOBILE_CONSU_FOLLOW_DISPLAY: 0
},
departments: [],
localDoctors: [],
localFollowers: [],
orderInfos: {}
}
}
componentDidMount() {
this.getSysProfileValue()
this.getSellerName()
this.initSetOptsValue()
this.getOrganizationData()
......@@ -275,6 +305,33 @@ class EquipConsuPage extends Component {
}
}
/**
* 获取系统配置
*/
getSysProfileValue() {
let { global_domain_config, token} = this.props
const {sysValues} = this.state
const getSysProfile = async (code) => {
const params = {
access_token: token,
profile_code: code
}
let res = await requestSysProfile(global_domain_config, params)
console.log('sysRes:==', res)
if(res && res.error_code === 0){
const value = res.data.profile_value
sysValues[code] = isNaN(value) ? value : Number(value)
this.setState({ sysValues }, () => {
console.log(sysValues)
})
}
}
R.compose(R.map(getSysProfile), R.keys)(sysValues)
}
// 修改正在加载
changeSubLoding(loading, loadTit) {
this.setState({
......@@ -284,13 +341,13 @@ class EquipConsuPage extends Component {
}
// 清空当前项以下的选择器值,以及耗材明细
clearInitNameAndValue(curIndex) {
clearInitNameAndValue(curIndex, endIndex = 4) {
let { listOptionData, localOtherObj } = this.state
let { props } = this
let that = this
this.setState({
listOptionData: listOptionData.map((item, index) => {
if(index > curIndex && index < 4 ) {
if(index > curIndex && index < endIndex ) {
item.name = localOtherObj.name
item.value = localOtherObj.value
if(listOptionData[1].value && item.title == '客户名称') {
......@@ -315,7 +372,7 @@ class EquipConsuPage extends Component {
// 判断是否都有值,修改提交按钮的颜色
changeCanSub(isSubCheck) {
let { listOptionData } = this.state
let { listOptionData, sysValues } = this.state
let tempStatus = false
let tempTit = ''
for(let chIndex in listOptionData) {
......@@ -339,6 +396,18 @@ class EquipConsuPage extends Component {
tempTit = `“${listOptionData[chIndex].title}”未添加`
tempStatus = true
break
} else if ( sysValues.OBS_MOBILE_CONSU_DEPARTMENT_DISPLAY == 3 && chIndex == 15 && !listOptionData[15].value) {
tempTit = `“${listOptionData[chIndex].title}”未选择`
tempStatus = true
break
} else if (sysValues.OBS_MOBILE_CONSU_FOLLOW_DISPLAY == 3 && chIndex == 17 && !listOptionData[17].value) {
tempTit = `“${listOptionData[chIndex].title}”未选择`
tempStatus = true
break
} else if (sysValues.OBS_MOBILE_CONSU_DOCTOR_DISPLAY == 3 && chIndex == 16 && !listOptionData[16].value) {
tempTit = `“${listOptionData[chIndex].title}”未输入`
tempStatus = true
break
}
}
this.setState({
......@@ -351,7 +420,7 @@ class EquipConsuPage extends Component {
// 选择器弹窗回调函数
handleCallBack(item, itemTitle) {
let { listOptionData} = this.state
let { listOptionData, sysValues} = this.state
let that = this
this.setState({
currentItem: item,
......@@ -363,13 +432,20 @@ class EquipConsuPage extends Component {
chItem.value = item.value
if(itemTitle === '组织') {
that.clearInitNameAndValue(1)
that.clearInitNameAndValue(14, 18)
that.getDepartmentsByOrg(item.value)
}
if (itemTitle === '部门') {
that.clearInitNameAndValue(16, 18)
}
if(itemTitle === '客户名称') {
that.clearInitNameAndValue(2)
that.clearInitNameAndValue(15, 18)
}
if(itemTitle === '订单信息') {
that.clearInitNameAndValue(3)
that.getCurOrderDetail()
that.autoSetDoctorAndFollower()
}
}
return chItem
......@@ -388,7 +464,7 @@ class EquipConsuPage extends Component {
// 修改当前选择器数据
changeCurrentOption() {
let { currentTitle } = this.state
let { currentTitle, orderInfos, listOptionData } = this.state
let { equipOrderOption } = this.props
let tempOption = []
let that = this
......@@ -416,15 +492,30 @@ class EquipConsuPage extends Component {
equipOrderOption.forEach(item => {
let obj = {}
let collect_number = item.collect_number ? item.collect_number : '空'
let surgery_name = item.surgery_name ? item.surgery_name : ''
let surgery_name = item.surgery_name ? item.surgery_name : ''
let create_time = item.create_time ? moment(item.create_time).format("YYYY-MM-DD") : '空'
let tempName = `${collect_number}-${surgery_name}-${create_time}`
let tempName = `${collect_number}-${surgery_name}-${item.doctor_name ? (item.doctor_name + '-') : ''}${create_time}`
obj.name = tempName,
obj.value = item.collect_number
resultArr.push(obj)
})
tempOption = [...resultArr]
orderInfos[`${listOptionData[1].value}_${listOptionData[2].value}`] = tempOption
const doctors = R.map(R.applySpec({
collect_number: R.prop('collect_number'),
doctor_name: R.prop('doctor_name'),
}))(equipOrderOption)
const followers = R.map(R.applySpec({
collect_number: R.prop('collect_number'),
surgery_follower_code: R.prop('surgery_follower_code'),
surgery_follower_name: R.prop('surgery_follower_name'),
}))(equipOrderOption)
this.setState({
localDoctors: doctors,
localFollowers: followers
})
}
this.setState({
listCurrentOption: [...tempOption]
......@@ -466,6 +557,53 @@ class EquipConsuPage extends Component {
props.requestEquipOrganizations(params)
})
}
/**
* 部门和跟台员点击
* @param {*} curData
* @param {*} objName
* @param {*} itemName
* @param {*} itemVal
* @returns
*/
handItemClickCheck(curData, objName, itemName, itemVal) {
if (!this.judgeOrgIsNull()) return
const {listOptionData, departments} = this.state
let options = this.state[objName] || []
if (objName === 'localFollowers' && !this.judgeCustomerIsNull() && !this.judgeOrderInfoIsNull()) return
if (objName === 'localFollowers') {
const code = listOptionData[15].value
const dep = R.find(R.propEq('department_code', code))(departments)
const followers = R.propOr([], 'surgery_follower_list')(dep)
options = R.compose(
R.map(R.head),
R.values,
R.groupBy(R.prop('surgery_follower_code')),
R.concat(followers)
)(options)
}
const listOptions = R.map(R.applySpec({
name: R.prop(itemName),
value: R.prop(itemVal)
}))(options)
this.setState({
currentTitle: curData.title,
currentItem: {
name: curData.name,
value: curData.value
},
showTypePop: true,
listCurrentOption: listOptions
}, () => {
this.changeCanSub()
})
}
async getOrganizationData() {
let { state, props } = this
let params = {
......@@ -490,6 +628,7 @@ class EquipConsuPage extends Component {
listOptionData
}, () => {
that.organizationGetCustomerData()
that.getDepartmentsByOrg(listOptionData[1].value)
})
}
} else if (orgResult.error_code == 41006) {
......@@ -501,6 +640,44 @@ class EquipConsuPage extends Component {
}
}
/**
* 根据组织获取部门等信息, 其他信息在部门下面
* @param {*} org_code
*/
async getDepartmentsByOrg(org_code) {
const {token, global_domain_config, userInfo} = this.props
const params = {
access_token: token,
org_code,
seller_code: userInfo.user_name,
scope_flag: 'Y'
}
try {
const res = await reqOrgDepartments(global_domain_config, params)
console.log('deparments: ', res)
let departments = res.data.relationships
this.setState({ departments })
const {listOptionData, sysValues} = this.state
const noop = () => {}
// 部门只有一个时直接设置
R.cond([
[R.equals(0), () => setTimeout(() => show('当前组织没有部门信息'), 4000)],
[R.equals(1), () => {
const dep = R.head(departments)
listOptionData[15].name = dep.department_name
listOptionData[15].value = dep.department_code
this.setState({ listOptionData })
}],
[R.T, noop]
])(R.length(departments))
} catch (error) {
console.log(error)
}
}
// 客户名称 点击
handleCustomerCheck(curData) {
let that = this
......@@ -578,6 +755,12 @@ class EquipConsuPage extends Component {
value: curData.value
}
}, () => {
const { orderInfos, listOptionData } = state
const options = orderInfos[`${listOptionData[1].value}_${listOptionData[2].value}`]
if (isNotBlank(options)) {
this.setState({ listCurrentOption: options, showTypePop: true })
return
}
let params = {
access_token: props.token,
org_code: state.listOptionData[1].value,
......@@ -610,17 +793,36 @@ class EquipConsuPage extends Component {
show(`当前${listOptionData[3].title}为空`)
return
}
// 保存医生和跟台员信息
const doctors = R.map(R.applySpec({
collect_number: R.prop('collect_number'),
doctor_name: R.prop('doctor_name'),
}))(surgery_collect_headers)
const followers = R.map(R.applySpec({
collect_number: R.prop('collect_number'),
surgery_follower_code: R.prop('surgery_follower_code'),
surgery_follower_name: R.prop('surgery_follower_name'),
}))(surgery_collect_headers)
this.setState({
localDoctors: doctors,
localFollowers: followers
})
if(surgery_collect_headers.length === 1) {
let doctor_name = surgery_collect_headers[0].doctor_name ? surgery_collect_headers[0].doctor_name + '-' : ''
let collect_number = surgery_collect_headers[0].collect_number ? surgery_collect_headers[0].collect_number : '空'
let surgery_name = surgery_collect_headers[0].surgery_name ? surgery_collect_headers[0].surgery_name : '空'
let create_time = surgery_collect_headers[0].create_time ? moment(surgery_collect_headers[0].create_time).format("YYYY-MM-DD") : '空'
let tempName = `${collect_number}-${surgery_name}-${create_time}`
let tempName = `${collect_number}-${surgery_name}-${doctor_name}${create_time}`
listOptionData[3].name = tempName
listOptionData[3].value = surgery_collect_headers[0].collect_number
that.setState({
listOptionData
}, () => {
that.getCurOrderDetail()
this.autoSetDoctorAndFollower()
})
}
} else if(cusResult.error_code == 41006) {
......@@ -632,6 +834,23 @@ class EquipConsuPage extends Component {
}
}
/**
* 自动填充医生和跟台员
*/
autoSetDoctorAndFollower() {
const {listOptionData, localDoctors, localFollowers} = this.state
let collect_number = listOptionData[3].value
const doctor = R.find(R.propEq('collect_number', collect_number))(localDoctors)
listOptionData[16].value = doctor && doctor.doctor_name
const follower = R.find(R.propEq('collect_number', collect_number))(localFollowers)
if (follower) {
listOptionData[17].value = follower.surgery_follower_code
listOptionData[17].name = follower.surgery_follower_name
}
this.setState({listOptionData})
}
// 获取当前订单的消耗明细
async getCurOrderDetail() {
let {listOptionData} = this.state
......@@ -705,6 +924,20 @@ class EquipConsuPage extends Component {
})
}
/**
* 医生输入
* @param {*} text
* @param {*} curData
*/
handleDoctorInput(text, curData) {
let {listOptionData} = this.state
listOptionData[16] = R.compose(
R.assoc('value', text),
R.find(R.propEq('title', curData.title))
)(listOptionData)
this.setState({ listOptionData }, () => this.changeCanSub())
}
// 患者姓名 输入
handlePatNameInput(text, curData) {
let { listOptionData } = this.state
......@@ -815,7 +1048,7 @@ class EquipConsuPage extends Component {
item.value = text
}
})
that.setState({
this.setState({
listOptionData: listOptionData
})
}
......@@ -984,6 +1217,8 @@ class EquipConsuPage extends Component {
this.changeCanSub(true)
let { state, props } = this
const { sysValues } = state
// 可提交 并且 不处于正在提交中
if(state.canSubFlag && !state.isSubLoding) {
let tempSubOption = state.submitOption
......@@ -998,6 +1233,12 @@ class EquipConsuPage extends Component {
// tempSubOption.settled_flag = state.listOptionData[10].isRedio
tempSubOption.remark = state.listOptionData[11].value
tempSubOption.lines = state.listOptionData[12].subOption
// 部门等信息
sysValues.OBS_MOBILE_CONSU_DEPARTMENT_DISPLAY > 0 && (tempSubOption.department_code = state.listOptionData[15].value)
sysValues.OBS_MOBILE_CONSU_DOCTOR_DISPLAY > 0 && (tempSubOption.doctor_name = state.listOptionData[16].value)
sysValues.OBS_MOBILE_CONSU_FOLLOW_DISPLAY > 0 && (tempSubOption.surgery_follower_code = state.listOptionData[17].value)
if(state.listOptionData[13].subOption && state.listOptionData[13].subOption.length > 0){
tempSubOption.fee_lines = []
state.listOptionData[13].subOption.forEach(item => {
......@@ -1042,6 +1283,11 @@ class EquipConsuPage extends Component {
return this.showTipFirstSelect(3)
}
// 判断订单信息是否为空
judgeDepartmentIsNull() {
return this.showTipFirstSelect(15)
}
// 提示请先选择
showTipFirstSelect(ind) {
let { listOptionData } = this.state
......@@ -1095,7 +1341,7 @@ class EquipConsuPage extends Component {
// 返回备注以上的元素
renderListItem() {
let { listOptionData, dateModelPop } = this.state
let { listOptionData, dateModelPop, sysValues } = this.state
return(
<View style={styles.list_cont}>
<PageListArrow
......@@ -1115,6 +1361,19 @@ class EquipConsuPage extends Component {
listCallBack={() => this.handleOrganizationCheck(listOptionData[1])}
listHasArrow={true}
/>
{
sysValues.OBS_MOBILE_CONSU_DEPARTMENT_DISPLAY > 0 && (
<PageListArrow
listActOpa={.8}
listHasAster={true}
listItem={listOptionData[15]}
listName={'name'}
listTitle={'title'}
listCallBack={() => this.handItemClickCheck(listOptionData[15], 'departments', 'department_name', 'department_code')}
listHasArrow={true}
/>
)
}
<PageListArrow
listActOpa={.8}
listHasAster={true}
......@@ -1133,6 +1392,19 @@ class EquipConsuPage extends Component {
listCallBack={() => this.handleOrderInfoCheck(listOptionData[3])}
listHasArrow={true}
/>
{
sysValues.OBS_MOBILE_CONSU_FOLLOW_DISPLAY > 0 && (
<PageListArrow
listActOpa={.8}
listHasAster={true}
listItem={listOptionData[17]}
listName={'name'}
listTitle={'title'}
listCallBack={() => this.handItemClickCheck(listOptionData[17], 'localFollowers', 'surgery_follower_name', 'surgery_follower_code')}
listHasArrow={true}
/>
)
}
<PageListArrow
listActOpa={.8}
listHasAster={true}
......@@ -1142,6 +1414,21 @@ class EquipConsuPage extends Component {
listCallBack={() => this.handleEquipDateCheck(listOptionData[4])}
listHasArrow={true}
/>
{
sysValues.OBS_MOBILE_CONSU_DOCTOR_DISPLAY > 0 && (
<PageListArrow
listActOpa={.8}
listHasAster={true}
listItem={listOptionData[16]}
listDefaValue={'value'}
listTitle={'title'}
listInputPlace={`请输入${listOptionData[16].title}`}
inputCallBack={(text) => this.handleDoctorInput(text, listOptionData[16])}
isTitInputStyle={true}
listCellStyle={styles.list_cell_box}
/>
)
}
<PageListArrow
listActOpa={.8}
listHasAster={true}
......
......@@ -11,6 +11,7 @@ import LodingModel from '../../common/LodingModel';
import { exitLoginStatus } from '../../../action/LoginAction';
import { OBS_MOBILE_EQU_CON_DISPLAY_PRICE } from '../../../base/BaseConstants';
import { LOGIN_NO } from '../../../base/ActionTypes';
import moment from 'moment';
const CONSUM_SEARCH_VALUE_BAR_CODE = 'CONSUM_SEARCH_VALUE_BAR_CODE';
......@@ -18,7 +19,7 @@ const CONSUM_SEARCH_VALUE_BAR_CODE = 'CONSUM_SEARCH_VALUE_BAR_CODE';
class ConsumDetailsPage extends Component {
constructor(props) {
super(props);
this.state = {
this.state = {
searchValue: '',
conDetaOption: [],
allConOption: [], // 所有数据(未筛选过的)
......@@ -48,7 +49,7 @@ class ConsumDetailsPage extends Component {
case LOGIN_NO:
navigation.navigate('LoginPage')
break;
default:
default:
break;
}
}
......@@ -113,7 +114,7 @@ class ConsumDetailsPage extends Component {
// 满足搜索条件
tempArr.push(item)
}
})
})
} else {
tempArr = [...allConOption]
}
......@@ -212,7 +213,7 @@ class ConsumDetailsPage extends Component {
handleSubSelected(show) {
this.handleCloseSelectModal(true)
}
// 点击 确定耗材
handleSubmit() {
this.handleCloseSelectModal(false)
......@@ -270,7 +271,7 @@ class ConsumDetailsPage extends Component {
keyExtractor={item => item.id}
data={this.state.conDetaOption}
extraData={this.state}
renderItem={ ({item, index}) => this.renderSubListItem(item, index) }
renderItem={ ({item, index}) => this.renderSubListItem(item, index) }
/>
</ScrollView>
)
......@@ -284,7 +285,7 @@ class ConsumDetailsPage extends Component {
style={styles.cons_sub_list}
onPress={() => this.handleSubSelectCheck(index, !item.select)}>
<View style={styles.sub_list_lef}>
{ item.select ?
{ item.select ?
<View
style={styles.sub_icon_box}
// onPress={() => this.handleCelSelCheck(item, index)}
......@@ -300,19 +301,31 @@ class ConsumDetailsPage extends Component {
</View>
<View style={styles.sub_list_rig}>
<Text style={styles.rig_tit}>
{index+1}. {item.manufacturer_product_code ? item.manufacturer_product_code : '厂家产品代码无'}
{index+1}. {item.manufacturer_product_code || '无厂家产品代码'}
</Text>
<Text style={[styles.rig_ser, styles.te_ot_str]} numberOfLines={1}>
物料名称 {item.item_name || '无'}
</Text>
<Text style={[styles.rig_ser, styles.te_ot_one]} numberOfLines={1}>
通用名称 {item.general_name || '无'}
</Text>
<Text style={[styles.rig_ser, styles.te_ot_one]} numberOfLines={1}>
规格型号:{item.specification || '无'}
</Text>
<Text style={[styles.rig_ser, styles.te_ot_thr]} numberOfLines={1}>
序列号:{item.serial_number_v || item.serial_number || '无'}
</Text>
<Text style={[styles.rig_ser, styles.te_ot_str]}>
物料名称 {item.item_name ? item.item_name : '无'}
<Text style={[styles.rig_ser, styles.te_ot_thr]} numberOfLines={1}>
生产批号:{item.production_batch_number || '无'}
</Text>
<Text style={[styles.rig_ser, styles.te_ot_one]}>
通用名称 {item.general_name ? item.general_name : '无'}
<Text style={[styles.rig_ser, styles.te_ot_thr]} numberOfLines={1}>
生产序号:{item.production_serial_number || '无'}
</Text>
<Text style={[styles.rig_ser, styles.te_ot_one]}>
规格型号:{item.specification ? item.specification : '无'}
<Text style={[styles.rig_ser, styles.te_ot_thr]} numberOfLines={1}>
生产日期:{item.production_date && moment(item.production_date).format('YYYY-MM-DD') || '无'}
</Text>
<Text style={[styles.rig_ser, styles.te_ot_thr]}>
序列号:{item.serial_number ? item.serial_number : '无'}
<Text style={[styles.rig_ser, styles.te_ot_thr]} numberOfLines={1}>
过期日期:{item.expiration_date && moment(item.expiration_date).format('YYYY-MM-DD') || '无'}
</Text>
</View>
</TouchableOpacity>
......@@ -363,7 +376,7 @@ class ConsumDetailsPage extends Component {
render() {
let {navigation} = this.props
let {title} = navigation.state.params
return (
return (
<View style={styles.cu_dl_container}>
<StatusBarView
isReactStackNavigator={true}
......@@ -396,9 +409,9 @@ const styles = StyleSheet.create({
},
list_cont: {
flex: 1
},
},
item_container: {
flex: 1
flex: 1
},
cons_cont_scroll: {},
cons_cont: {
......@@ -430,7 +443,7 @@ const styles = StyleSheet.create({
},
rig_ser: {
fontSize: third_text_size,
fontFamily: font_family_regular
fontFamily: font_family_regular,
},
te_ot_str: {
fontFamily: font_family_semibold,
......@@ -476,5 +489,5 @@ const mapDispatchToProps = (dispatch) => {
}
}
}
export default connect(mapStateToProps, mapDispatchToProps)(ConsumDetailsPage);
......@@ -26,14 +26,15 @@ import {
pxSize,
third_text_color,
Height,
font_family_medium
font_family_medium,
btn_sub_color
} from '../../../base/BaseStyle';
import DateModel from '../../common/DateModel';
import DialogModel from '../../common/DialogModel';
import StatusBarView from '../../common/StatusBarView';
import HeadBackItem from '../../common/HeadBackItem';
import { connect } from 'react-redux';
import { exitLoginStatus } from '../../../action/LoginAction';
import { exitLoginStatus, requestSysProfile} from '../../../action/LoginAction';
import {
LOGIN_NO
} from '../../../base/ActionTypes';
......@@ -42,18 +43,20 @@ import {
requestHistorSurgeryHospital,
requestHistorOrderType,
requestHistorTarOrSourOrd,
requestHistorSurgeryType
requestHistorSurgeryType,
reqOrgDepartments
} from '../../../action/HistorAction';
import { show, dedupQuoteArray, cloneObject } from '../../../utils/Utils';
import { show, dedupQuoteArray, cloneObject, isBlank, isNotBlank } from '../../../utils/Utils';
import moment from 'moment';
import ErrorTipModel from '../../common/ErrorTipModel';
import * as R from 'ramda';
const REQUEST_NUMBER_BAR_CODE = 'REQUEST_NUMBER_BAR_CODE'
class FilterModel extends Component {
constructor(props) {
super(props);
this.state = {
this.state = {
isVisible: false,
topProcOptionList: [],
topActiveIndex: 0,
......@@ -86,7 +89,8 @@ class FilterModel extends Component {
// surgery_type_code: '', // 手术类型 -- 不用此参数
surgery_date_from: '', // 手术时间开始
surgery_date_to: '', // 手术时间结束
order_type_code: '' // 订单类型
order_type_code: '', // 订单类型
department_code: '' // 部门
},
consumeSearchOption: { // [消耗]筛选条件
consumed_flag: '', // 状态筛选 'Y'/'N'
......@@ -175,6 +179,11 @@ class FilterModel extends Component {
title: '订单类型',
name: '请选择',
value: ''
}, {
"id": "11",
title: '部门',
name: '请选择',
value: ''
}],
consumeListOptionData: [{ // [消耗]筛选-对应字段
"id": "0",
......@@ -299,7 +308,7 @@ class FilterModel extends Component {
"APPROVED,COLLECTING_WAITING_CONFIRM",
"COLLECTED,RETURNING_WAITING_CONFIRM",
"RETURNED,CLOSED,REJECTED,CANCELED,CONSUMED"
],
],
searchComsumeStatus: [ // 【消耗】对应的状态值
"N",
"Y"
......@@ -311,13 +320,19 @@ class FilterModel extends Component {
],
errorPopType: false, // 错误提示弹窗
errorTit: '', // 错误提示文字
isRightExit: true
isRightExit: true,
sysValues: {
OBS_MOBILE_COLL_DEPARTMENT: 'N'
},
departments: {},
sellers: []
}
}
componentDidMount() {
this.getSellerName()
this.initSelectPickerData()
this.getSysConfigValue()
}
// 赋值销售员 初始化数据
......@@ -377,7 +392,7 @@ class FilterModel extends Component {
case LOGIN_NO:
navigation.navigate('LoginPage')
break;
default:
default:
break;
}
}
......@@ -402,6 +417,31 @@ class FilterModel extends Component {
}
}
/**
* 获取系统配置
*/
getSysConfigValue() {
const { global_domain_config, token} = this.props
const {sysValues} = this.state
const getSysProfile = async code => {
const params = {
access_token: token,
profile_code: code
}
let res = await requestSysProfile(global_domain_config, params)
console.log('sysRes:==', res)
if(res && res.error_code === 0) {
const value = res.data.profile_value
sysValues[code] = isNaN(value) ? value : Number(value)
this.setState({ sysValues })
}
}
R.compose(R.map(getSysProfile), R.keys)(sysValues)
}
// 修改选择器为属性 name 和 value
changeNameAndValue(data, nameType, valueType) {
let result = []
......@@ -415,13 +455,14 @@ class FilterModel extends Component {
}
// 清空当前项以下的值
clearInitNameAndValue(curIndex) {
clearInitNameAndValue(curIndex, endIndex) {
let { topActiveIndex, borrowListOptionData, consumeListOptionData, localOtherObj} = this.state
switch(topActiveIndex) {
case 0:
borrowListOptionData = borrowListOptionData.map((item, index) => {
if(index > curIndex && index < 7 ) {
!endIndex && (endIndex = 7)
if(index > curIndex && index < endIndex ) {
item.name = localOtherObj.name
item.value = localOtherObj.value
if(item.title == '主治医生') {
......@@ -434,7 +475,8 @@ class FilterModel extends Component {
break;
case 1:
consumeListOptionData = consumeListOptionData.map((item, index) => {
if(index > curIndex && index < 4 ) {
!endIndex && (endIndex = 4)
if(index > curIndex && index < endIndex ) {
item.name = localOtherObj.name
item.value = localOtherObj.value
}
......@@ -456,6 +498,7 @@ class FilterModel extends Component {
// 选择器弹窗回调函数
handleCallBack(item, itemTitle) {
let { topActiveIndex, borrowListOptionData, consumeListOptionData, transferListOptionData} = this.state
const {userInfo} = this.props
let self = this
this.setState({
currentItem: item
......@@ -468,6 +511,16 @@ class FilterModel extends Component {
chItem.value = item.value
if(itemTitle === '组织') {
self.clearInitNameAndValue(2)
self.clearInitNameAndValue(10, 12)
self.getDepartmentsByOrg(item.value)
self.setSellerList()
}
if (itemTitle === '部门') {
borrowListOptionData[1].value = userInfo.user_name
borrowListOptionData[1].name = userInfo.person_name
this.setState({ borrowListOptionData, sellers: [] }, () => {
this.setSellerList()
})
}
if(itemTitle === '客户名称') {
self.clearInitNameAndValue(3)
......@@ -522,7 +575,9 @@ class FilterModel extends Component {
transferListOptionData
})
}
// 修改当前选择器值 -- 可隐藏
changeCurrentObj(item, itemTitle, optArray) {
let result = []
......@@ -667,6 +722,73 @@ class FilterModel extends Component {
return [obj, org_code];
}
/**
* 获取部门信息
* @param {*} org_code
*/
async getDepartmentsByOrg(org_code) {
const {token, global_domain_config, userInfo} = this.props
const params = {
access_token: token,
org_code,
seller_code: userInfo.user_name,
scope_flag: 'Y'
}
try {
const res = await reqOrgDepartments(global_domain_config, params)
console.log('depRes', res)
let departments = res.data.relationships
this.setState({ departments })
const {borrowListOptionData} = this.state
const noop = () => {}
// 部门只有一个时直接设置
R.cond([
[R.equals(0), () => show('当前组织没有部门信息')],
[R.equals(1), () => {
const dep = R.head(departments)
borrowListOptionData[11].name = dep.department_name
borrowListOptionData[11].value = dep.department_code
this.setState({ borrowListOptionData }, () => {
this.setSellerList()
})
}],
[R.T, noop]
])(R.length(departments))
} catch (error) {
console.log(error)
}
}
/**
* 根据部门信息设置销售员
*/
setSellerList() {
const {userInfo} = this.props
const {departments, borrowListOptionData} = this.state
let sellers = []
const department = R.find(R.propEq('department_code', borrowListOptionData[11].value))(departments)
if (isNotBlank(department)) {
sellers = R.compose(
R.map(R.applySpec({
name: R.prop('seller_name'),
value: R.prop('seller_code'),
})),
R.propOr([], 'seller_list')
)(department)
R.ifElse(R.compose(R.includes(userInfo.user_name), R.pluck('value')), () => { }, () => {
sellers = R.concat([{
name: userInfo.person_name,
value: userInfo.user_name
}], sellers)
})(sellers)
}
this.setState({ sellers })
}
// 组织 - 筛选
handleOrganizationCheck() {
let {props} = this
......@@ -710,6 +832,57 @@ class FilterModel extends Component {
})
}
/**
* 部门
*/
handleDepartmentCheck() {
if(!this.judgeOrgIsNull()) return
const curItem = this.getCurrentOption(11)
const {departments} = this.state
const options = R.compose(
R.map(
R.applySpec({
name: R.prop('department_name'),
value: R.prop('department_code'),
})
)
)(departments)
this.setState({
currentTitle: '部门',
currentItem: curItem[0],
showTypePop: true,
listCurrentOption: options
})
}
/**
* 设置销售员
*/
setCollectSeller(seller) {
const {sellers, borrowListOptionData} = this.state
let sellerCodes = R.compose(R.split(','), R.pathOr('', [1, 'value']))(borrowListOptionData)
R.ifElse(R.contains(R.__, sellerCodes), () => {
// 已在其中,减掉
if (R.length(sellerCodes) === 1) {
return show('最少要有一个销售员')
}
const idx = R.findIndex(R.equals(seller.value))(sellerCodes)
borrowListOptionData[1].value = R.compose(R.join(','), R.remove(idx, 1))(sellerCodes)
let sellerNames = R.compose(R.split(','), R.pathOr('', [1, 'name']))(borrowListOptionData)
borrowListOptionData[1].name = R.compose(R.join(','), R.remove(idx, 1))(sellerNames)
}, () => {
borrowListOptionData[1].value += `,${seller.value}`
borrowListOptionData[1].name += `,${seller.name}`
})(seller.value)
this.setState({ borrowListOptionData })
}
// 客户名称 - 筛选
handleCustomerCheck() {
if(!this.judgeOrgIsNull()) {
......@@ -1267,11 +1440,11 @@ class FilterModel extends Component {
// 重置 - 筛选
handleSubResetCheck() {
let {
topActiveIndex,
topActiveIndex,
borrowListOptionData,
consumeListOptionData,
transferListOptionData,
subBorrowInitListOption,
subBorrowInitListOption,
subConsumeInitListOption,
subTransferInitListOption
} = this.state
......@@ -1279,7 +1452,8 @@ class FilterModel extends Component {
case 0:
borrowListOptionData = cloneObject(subBorrowInitListOption)
this.setState({
borrowListOptionData
borrowListOptionData,
sellers: []
})
break;
case 1:
......@@ -1302,8 +1476,8 @@ class FilterModel extends Component {
// 确定 - 筛选 传递参数给父组件
handleFilterSubmitCheck() {
let {
topActiveIndex,
borrowListOptionData,
topActiveIndex,
borrowListOptionData,
consumeListOptionData,
transferListOptionData,
searchBorrowStatus,
......@@ -1315,7 +1489,7 @@ class FilterModel extends Component {
} = this.state
let {props} = this
let that = this
let tempSubOption = {}
let params = {
access_token: props.token
......@@ -1350,10 +1524,11 @@ class FilterModel extends Component {
tempSubOption.surgery_date_from = borrowListOptionData[8].value
tempSubOption.surgery_date_to = borrowListOptionData[9].value
tempSubOption.order_type_code = borrowListOptionData[10].value
tempSubOption.department_code = borrowListOptionData[11].value
params = Object.assign({}, params, tempSubOption)
props.callSupSubmit(params)
that.changeSeaColorAct() // 改变筛选颜色
that.closeModal() // 关闭弹窗
that.closeModal() // 关闭弹窗
break;
case 1:
tempSubOption = {...consumeSearchOption}
......@@ -1459,7 +1634,7 @@ class FilterModel extends Component {
bothArrayIsCom(arr, newArr) {
let comFlag = false
let that = this
otherFor:
otherFor:
for(let i in arr) {
if(arr[i] instanceof Object && newArr[i] instanceof Object) {
for(let key of Object.keys(arr[i])) {
......@@ -1539,7 +1714,7 @@ class FilterModel extends Component {
showsHorizontalScrollIndicator={false}
> */}
{
topProcOptionList.map((item, index) =>
topProcOptionList.map((item, index) =>
<TouchableOpacity
activeOpacity={1}
style={styles.top_touch_cont}
......@@ -1573,22 +1748,22 @@ class FilterModel extends Component {
</Text>
<View style={styles.sea_icon}>
{
isVisible ?
isVisible ?
<Image source={require('../../../images/arr_top.png')} style={icon_style} />
: <Image source={require('../../../images/arr_bom.png')} style={icon_style} />
}
</View>
</TouchableOpacity>
{
isVisible ?
isVisible ?
<View style={styles.sea_main}>
{
this.renderTopSelectItem()
}
this.renderTopSelectItem()
}
</View>
: null
}
</View>
</View>
</View>
</View>
......@@ -1600,21 +1775,21 @@ class FilterModel extends Component {
// 返回筛选
renderTopSelectItem() {
let {topActiveIndex, borrowListOptionData, consumeListOptionData, transferListOptionData} = this.state
let {topActiveIndex, borrowListOptionData, consumeListOptionData, transferListOptionData, sysValues, sellers} = this.state
return (
<View style={styles.sea_container}>
<View style={styles.sea_scr_box}>
<ScrollView style={styles.sea_scroll}>
{
topActiveIndex == 0 ?
topActiveIndex == 0 ?
<View style={styles.sea_sel_opt}>
<View style={styles.sea_stu_select}>
<Text style={styles.sea_stu_tit}>状态筛选</Text>
<View style={styles.sea_stu_box}>
{
borrowListOptionData[0].status.map((item, index) =>
<TouchableOpacity
activeOpacity={.8}
borrowListOptionData[0].status.map((item, index) =>
<TouchableOpacity
activeOpacity={.8}
style={[
styles.sta_btn,
borrowListOptionData[0].curStatus.includes(index) ? styles.sta_btn_act : '',
......@@ -1625,10 +1800,10 @@ class FilterModel extends Component {
>
<Text style={[styles.btn_txt, borrowListOptionData[0].curStatus.includes(index) ? styles.btn_txt_act: '']}>{item}</Text>
{
borrowListOptionData[0].curStatus.includes(index) ?
borrowListOptionData[0].curStatus.includes(index) ?
<View style={styles.btn_act_icon}>
<Image source={require('../../../images/his_ord_sel.png')} style={icon_style} />
</View>
</View>
: null
}
</TouchableOpacity>
......@@ -1639,33 +1814,118 @@ class FilterModel extends Component {
<View style={styles.sea_qui_select}>
<Text style={styles.sea_qui_tit}>快捷筛选</Text>
<View style={styles.sea_qui_box}>
<View style={styles.qui_cell}>
<Text style={styles.qui_cell_tit}>销售员</Text>
<TouchableOpacity
activeOpacity={1}
style={styles.qui_cell_rig}
>
<Text style={styles.cell_rig_sel}>{borrowListOptionData[1].name}</Text>
<View style={styles.arr_icon_box}>
</View>
</TouchableOpacity>
</View>
<View style={styles.qui_cell}>
<Text style={styles.qui_cell_tit}>组织</Text>
<TouchableOpacity
activeOpacity={.8}
style={styles.qui_cell_rig}
onPress={() => this.handleOrganizationCheck() }
>
<Text style={styles.cell_rig_sel}>{borrowListOptionData[2].name}</Text>
<View style={styles.arr_icon_box}>
<Image source={require('../../../images/arr_rig.png')} style={icon_style} />
</View>
</TouchableOpacity>
</View>
{
// 兼容旧版本的
sysValues.OBS_MOBILE_COLL_DEPARTMENT === 'Y' && (
<>
<View style={styles.qui_cell}>
<Text style={styles.qui_cell_tit}>组织</Text>
<TouchableOpacity
activeOpacity={.8}
style={styles.qui_cell_rig}
onPress={() => this.handleOrganizationCheck() }
>
<Text style={styles.cell_rig_sel}>{borrowListOptionData[2].name}</Text>
<View style={styles.arr_icon_box}>
<Image source={require('../../../images/arr_rig.png')} style={icon_style} />
</View>
</TouchableOpacity>
</View>
<View style={styles.qui_cell}>
<Text style={styles.qui_cell_tit}>部门</Text>
<TouchableOpacity
activeOpacity={.8}
style={styles.qui_cell_rig}
onPress={() => this.handleDepartmentCheck() }
>
<Text style={styles.cell_rig_sel}>{borrowListOptionData[11].name}</Text>
<View style={styles.arr_icon_box}>
<Image source={require('../../../images/arr_rig.png')} style={icon_style} />
</View>
</TouchableOpacity>
</View>
<View style={styles.qui_cell}>
<Text style={styles.qui_cell_tit}>销售员</Text>
<TouchableOpacity
activeOpacity={1}
style={styles.qui_cell_rig}
>
<Text style={styles.cell_rig_sel}>{borrowListOptionData[1].name}</Text>
<View style={styles.arr_icon_box}>
</View>
</TouchableOpacity>
</View>
{
sellers && sellers.length > 0 &&
<View style={[styles.qui_cell, styles.qui_cell_select]}>
{
sellers.map(seller => {
const isSelected = R.compose(R.includes(seller.value), R.pathOr('', [1, 'value']))(borrowListOptionData)
return (
<TouchableOpacity style={isSelected
? [styles.qui_cell_select_box, styles.qui_cell_select_box_selected]
: styles.qui_cell_select_box}
key={seller.value}
activeOpacity={0.5}
onPress={() => this.setCollectSeller(seller)}
>
<Text style={
borrowListOptionData[1].value === seller.value
? styles.qui_cell_select_text_selected
: styles.qui_cell_select_text
}
>
{seller.name}
</Text>
{
isSelected &&
<View style={styles.btn_act_icon}>
<Image source={require('../../../images/his_ord_sel.png')} style={icon_style} />
</View>
}
</TouchableOpacity>
)
})
}
</View>
}
</>
)
}
{
// 兼容旧版本的
sysValues.OBS_MOBILE_COLL_DEPARTMENT === 'N' && (
<>
<View style={styles.qui_cell}>
<Text style={styles.qui_cell_tit}>销售员</Text>
<TouchableOpacity
activeOpacity={1}
style={styles.qui_cell_rig}
>
<Text style={styles.cell_rig_sel}>{borrowListOptionData[1].name}</Text>
<View style={styles.arr_icon_box}>
</View>
</TouchableOpacity>
</View>
<View style={styles.qui_cell}>
<Text style={styles.qui_cell_tit}>组织</Text>
<TouchableOpacity
activeOpacity={.8}
style={styles.qui_cell_rig}
onPress={() => this.handleOrganizationCheck() }
>
<Text style={styles.cell_rig_sel}>{borrowListOptionData[2].name}</Text>
<View style={styles.arr_icon_box}>
<Image source={require('../../../images/arr_rig.png')} style={icon_style} />
</View>
</TouchableOpacity>
</View>
</>
)
}
<View style={styles.qui_cell}>
<Text style={styles.qui_cell_tit}>客户名称</Text>
<TouchableOpacity
<TouchableOpacity
activeOpacity={.8}
style={styles.qui_cell_rig}
onPress={() => this.handleCustomerCheck() }
......@@ -1678,7 +1938,7 @@ class FilterModel extends Component {
</View>
<View style={styles.qui_cell}>
<Text style={styles.qui_cell_tit}>收单地点</Text>
<TouchableOpacity
<TouchableOpacity
activeOpacity={.8}
style={styles.qui_cell_rig}
onPress={() => this.handleBillCheck() }
......@@ -1691,7 +1951,7 @@ class FilterModel extends Component {
</View>
<View style={styles.qui_cell}>
<Text style={styles.qui_cell_tit}>收货地点</Text>
<TouchableOpacity
<TouchableOpacity
activeOpacity={.8}
style={styles.qui_cell_rig}
onPress={() => this.handleShipCheck() }
......@@ -1704,8 +1964,8 @@ class FilterModel extends Component {
</View>
<View style={styles.qui_cell}>
<Text style={styles.qui_cell_tit}>主治医生</Text>
<TouchableOpacity
<TouchableOpacity
activeOpacity={.8}
style={styles.qui_cell_rig}
onPress={() => this.handleDoctorCheck() }
......@@ -1718,13 +1978,13 @@ class FilterModel extends Component {
</View>
{
borrowListOptionData[6].showInput ?
borrowListOptionData[6].showInput ?
<View style={styles.qui_cell}>
<Text style={styles.qui_cell_tit}></Text>
<TouchableOpacity
<TouchableOpacity
activeOpacity={.8}
style={styles.qui_cell_inp}>
<TextInput
<TextInput
placeholder={'请输入主治医生'}
style={[styles.cell_rig_sel, styles.cell_rig_input]}
placeholderTextColor = {placehold_text_color}
......@@ -1733,13 +1993,13 @@ class FilterModel extends Component {
defaultValue={borrowListOptionData[6].inputValue}
/>
</TouchableOpacity>
</View>
: null
</View>
: null
}
{/* <View style={styles.qui_cell}>
<Text style={styles.qui_cell_tit}>手术类型</Text>
<TouchableOpacity
<TouchableOpacity
activeOpacity={.8}
style={styles.qui_cell_rig}
onPress={() => this.handleSurTypeCheck() }
......@@ -1753,7 +2013,7 @@ class FilterModel extends Component {
<View style={styles.qui_cell}>
<Text style={styles.qui_cell_tit}>手术时间</Text>
<View style={styles.qui_cell_rig_date}>
<TouchableOpacity
<TouchableOpacity
activeOpacity={.8}
style={styles.qui_date_box}
onPress={() => this.handleSurDateCheck('start') }
......@@ -1764,7 +2024,7 @@ class FilterModel extends Component {
</View>
</TouchableOpacity>
<Text style={styles.qui_date_line}></Text>
<TouchableOpacity
<TouchableOpacity
activeOpacity={.8}
style={styles.qui_date_box}
onPress={() => this.handleSurDateCheck('end') }
......@@ -1778,7 +2038,7 @@ class FilterModel extends Component {
</View>
<View style={styles.qui_cell}>
<Text style={styles.qui_cell_tit}>订单类型</Text>
<TouchableOpacity
<TouchableOpacity
activeOpacity={.8}
style={styles.qui_cell_rig}
onPress={() => this.handleOrderCheck() }
......@@ -1795,15 +2055,15 @@ class FilterModel extends Component {
</View> : null
}
{
topActiveIndex == 1 ?
topActiveIndex == 1 ?
<View style={styles.sea_sel_opt}>
<View style={styles.sea_stu_select}>
<Text style={styles.sea_stu_tit}>状态筛选</Text>
<View style={styles.sea_stu_box}>
{
consumeListOptionData[0].status.map((item, index) =>
<TouchableOpacity
activeOpacity={.8}
consumeListOptionData[0].status.map((item, index) =>
<TouchableOpacity
activeOpacity={.8}
style={[
styles.sta_btn,
consumeListOptionData[0].curStatus.includes(index) ? styles.sta_btn_act : '',
......@@ -1814,10 +2074,10 @@ class FilterModel extends Component {
>
<Text style={[styles.btn_txt, consumeListOptionData[0].curStatus.includes(index) ? styles.btn_txt_act: '']}>{item}</Text>
{
consumeListOptionData[0].curStatus.includes(index) ?
consumeListOptionData[0].curStatus.includes(index) ?
<View style={styles.btn_act_icon}>
<Image source={require('../../../images/his_ord_sel.png')} style={icon_style} />
</View>
</View>
: null
}
</TouchableOpacity>
......@@ -1831,7 +2091,7 @@ class FilterModel extends Component {
<View style={styles.sea_qui_box}>
<View style={styles.qui_cell}>
<Text style={styles.qui_cell_tit}>销售员</Text>
<TouchableOpacity
<TouchableOpacity
activeOpacity={1}
style={styles.qui_cell_rig}
>
......@@ -1842,7 +2102,7 @@ class FilterModel extends Component {
</View>
<View style={styles.qui_cell}>
<Text style={styles.qui_cell_tit}>组织</Text>
<TouchableOpacity
<TouchableOpacity
activeOpacity={.8}
style={styles.qui_cell_rig}
onPress={() => this.handleOrganizationCheck() }
......@@ -1855,7 +2115,7 @@ class FilterModel extends Component {
</View>
<View style={styles.qui_cell}>
<Text style={styles.qui_cell_tit}>客户名称</Text>
<TouchableOpacity
<TouchableOpacity
activeOpacity={.8}
style={styles.qui_cell_rig}
onPress={() => this.handleCustomerCheck() }
......@@ -1868,10 +2128,10 @@ class FilterModel extends Component {
</View>
<View style={styles.qui_cell}>
<Text style={styles.qui_cell_tit}>患者姓名</Text>
<TouchableOpacity
<TouchableOpacity
activeOpacity={.8}
style={styles.qui_cell_inp}>
<TextInput
<TextInput
placeholder={'请输入'}
style={[styles.cell_rig_sel, styles.cell_rig_input]}
placeholderTextColor = {placehold_text_color}
......@@ -1883,10 +2143,10 @@ class FilterModel extends Component {
</View>
<View style={styles.qui_cell}>
<Text style={styles.qui_cell_tit}>病历号</Text>
<TouchableOpacity
<TouchableOpacity
activeOpacity={.8}
style={styles.qui_cell_inp}>
<TextInput
<TextInput
placeholder={'请输入'}
style={[styles.cell_rig_sel, styles.cell_rig_input]}
placeholderTextColor = {placehold_text_color}
......@@ -1900,7 +2160,7 @@ class FilterModel extends Component {
<View style={styles.qui_cell}>
<Text style={styles.qui_cell_tit}>消耗时间</Text>
<View style={styles.qui_cell_rig_date}>
<TouchableOpacity
<TouchableOpacity
activeOpacity={.8}
style={styles.qui_date_box}
onPress={() => this.handleSurDateCheck('start') }
......@@ -1911,7 +2171,7 @@ class FilterModel extends Component {
</View>
</TouchableOpacity>
<Text style={styles.qui_date_line}></Text>
<TouchableOpacity
<TouchableOpacity
activeOpacity={.8}
style={styles.qui_date_box}
onPress={() => this.handleSurDateCheck('end') }
......@@ -1926,10 +2186,10 @@ class FilterModel extends Component {
<View style={styles.qui_cell}>
<Text style={styles.qui_cell_tit}>床位</Text>
<TouchableOpacity
<TouchableOpacity
activeOpacity={.8}
style={styles.qui_cell_inp}>
<TextInput
<TextInput
placeholder={'请输入'}
style={[styles.cell_rig_sel, styles.cell_rig_input]}
placeholderTextColor = {placehold_text_color}
......@@ -1943,10 +2203,10 @@ class FilterModel extends Component {
<View style={styles.qui_cell}>
<Text style={styles.qui_cell_tit}>住院号</Text>
<TouchableOpacity
<TouchableOpacity
activeOpacity={.8}
style={styles.qui_cell_inp}>
<TextInput
<TextInput
placeholder={'请输入'}
style={[styles.cell_rig_sel, styles.cell_rig_input]}
placeholderTextColor = {placehold_text_color}
......@@ -1960,7 +2220,7 @@ class FilterModel extends Component {
{/* <View style={styles.qui_cell}>
<Text style={styles.qui_cell_tit}>是否结单</Text>
<TouchableOpacity
<TouchableOpacity
activeOpacity={1}
style={styles.qui_cell_inp}>
<View style={styles.btn_radio_box}>
......@@ -1971,7 +2231,7 @@ class FilterModel extends Component {
>
<View style={styles.radio_icon}>
{
consumeListOptionData[10].isRedio == 'Y' ?
consumeListOptionData[10].isRedio == 'Y' ?
<Image style={icon_style} source={require('../../../images/radio_yes.png')} />
: <Image style={icon_style} source={require('../../../images/radio_no.png')} />
}
......@@ -1985,9 +2245,9 @@ class FilterModel extends Component {
>
<View style={styles.radio_icon}>
{
!consumeListOptionData[10].isRedio ?
!consumeListOptionData[10].isRedio ?
<Image style={icon_style} source={require('../../../images/radio_no.png')} />
: ( consumeListOptionData[10].isRedio == 'Y' ?
: ( consumeListOptionData[10].isRedio == 'Y' ?
<Image style={icon_style} source={require('../../../images/radio_no.png')} />
: <Image style={icon_style} source={require('../../../images/radio_yes.png')} /> )
}
......@@ -1999,18 +2259,18 @@ class FilterModel extends Component {
</View> */}
</View>
</View>
</View> : null
</View> : null
}
{
topActiveIndex == 2 ?
topActiveIndex == 2 ?
<View style={styles.sea_sel_opt}>
<View style={styles.sea_stu_select}>
<Text style={styles.sea_stu_tit}>状态筛选</Text>
<View style={styles.sea_stu_box}>
{
transferListOptionData[0].status.map((item, index) =>
<TouchableOpacity
activeOpacity={.8}
transferListOptionData[0].status.map((item, index) =>
<TouchableOpacity
activeOpacity={.8}
style={[
styles.sta_btn,
transferListOptionData[0].curStatus.includes(index) ? styles.sta_btn_act : '',
......@@ -2021,10 +2281,10 @@ class FilterModel extends Component {
>
<Text style={[styles.btn_txt, transferListOptionData[0].curStatus.includes(index) ? styles.btn_txt_act: '']}>{item}</Text>
{
transferListOptionData[0].curStatus.includes(index) ?
transferListOptionData[0].curStatus.includes(index) ?
<View style={styles.btn_act_icon}>
<Image source={require('../../../images/his_ord_sel.png')} style={icon_style} />
</View>
</View>
: null
}
</TouchableOpacity>
......@@ -2037,7 +2297,7 @@ class FilterModel extends Component {
<View style={styles.sea_qui_box}>
<View style={styles.qui_cell}>
<Text style={styles.qui_cell_tit}>销售员</Text>
<TouchableOpacity
<TouchableOpacity
activeOpacity={1}
style={styles.qui_cell_rig}
>
......@@ -2048,7 +2308,7 @@ class FilterModel extends Component {
</View>
<View style={styles.qui_cell}>
<Text style={styles.qui_cell_tit}>组织</Text>
<TouchableOpacity
<TouchableOpacity
activeOpacity={.8}
style={styles.qui_cell_rig}
onPress={() => this.handleOrganizationCheck() }
......@@ -2061,7 +2321,7 @@ class FilterModel extends Component {
</View>
<View style={styles.qui_cell}>
<Text style={styles.qui_cell_tit}>客户名称</Text>
<TouchableOpacity
<TouchableOpacity
activeOpacity={.8}
style={styles.qui_cell_rig}
onPress={() => this.handleCustomerCheck() }
......@@ -2074,7 +2334,7 @@ class FilterModel extends Component {
</View>
<View style={styles.qui_cell}>
<Text style={styles.qui_cell_tit}>目标借货订单</Text>
<TouchableOpacity
<TouchableOpacity
activeOpacity={.8}
style={styles.qui_cell_rig}
onPress={() => this.handleTargetBorCheck() }
......@@ -2087,7 +2347,7 @@ class FilterModel extends Component {
</View>
<View style={styles.qui_cell}>
<Text style={styles.qui_cell_tit}>来源借货订单号</Text>
<TouchableOpacity
<TouchableOpacity
activeOpacity={.8}
style={styles.qui_cell_rig}
onPress={() => this.handleSourOrdCheck() }
......@@ -2100,10 +2360,10 @@ class FilterModel extends Component {
</View>
<View style={styles.qui_cell}>
<Text style={styles.qui_cell_tit}>申请单号</Text>
<TouchableOpacity
<TouchableOpacity
activeOpacity={.8}
style={[styles.qui_cell_inp, styles.qui_cell_tran]}>
<TextInput
<TextInput
placeholder={'请输入'}
style={[styles.cell_rig_sel, styles.cell_rig_input]}
placeholderTextColor = {placehold_text_color}
......@@ -2124,7 +2384,7 @@ class FilterModel extends Component {
<View style={styles.qui_cell}>
<Text style={styles.qui_cell_tit}>手术时间</Text>
<View style={styles.qui_cell_rig_date}>
<TouchableOpacity
<TouchableOpacity
activeOpacity={.8}
style={styles.qui_date_box}
onPress={() => this.handleSurDateCheck('start') }
......@@ -2135,7 +2395,7 @@ class FilterModel extends Component {
</View>
</TouchableOpacity>
<Text style={styles.qui_date_line}></Text>
<TouchableOpacity
<TouchableOpacity
activeOpacity={.8}
style={styles.qui_date_box}
onPress={() => this.handleSurDateCheck('end') }
......@@ -2149,7 +2409,7 @@ class FilterModel extends Component {
</View>
</View>
</View>
</View> : null
</View> : null
}
</ScrollView>
</View>
......@@ -2171,7 +2431,7 @@ class FilterModel extends Component {
{ this.renderErrorModel() }
</View>
{ this.renderDateModel() }
......@@ -2197,7 +2457,7 @@ class FilterModel extends Component {
// 返回选择器
renderPickerModel() {
let {
let {
listCurrentOption,
currentItem,
currentTitle,
......@@ -2222,7 +2482,7 @@ class FilterModel extends Component {
renderErrorModel() {
let {errorPopType, errorTit} = this.state
return(
<ErrorTipModel
<ErrorTipModel
title={errorTit}
show={errorPopType}
closeModal={(show) => this.handelCloseErrorModel(show)}
......@@ -2350,7 +2610,7 @@ const styles = StyleSheet.create({
sea_main: {},
sea_container: {
// flex: 1
height: Height()
height: Height()
},
sea_scr_box: {
// height: Height() - 360,
......@@ -2419,13 +2679,38 @@ const styles = StyleSheet.create({
qui_cell: {
flexDirection: 'row',
alignItems: 'center',
marginTop: 12
marginTop: pxSize(12)
},
qui_cell_tit: {
color: first_text_color,
fontSize: 14,
fontFamily: font_family_regular,
width: 80
width: pxSize(80)
},
qui_cell_select: {
paddingLeft: pxSize(80),
justifyContent: 'space-between',
flexWrap: 'wrap',
},
qui_cell_select_box: {
width: "30%",
padding: pxSize(5),
borderWidth: pxSize(1),
borderColor: "#eee",
backgroundColor: "#FFF",
marginBottom: pxSize(5)
},
qui_cell_select_box_selected: {
backgroundColor: "#E7F1FD",
},
qui_cell_select_text: {
width: "100%",
textAlign: 'center'
},
qui_cell_select_text_selected: {
width: "100%",
textAlign: 'center',
color: '#007EFF'
},
qui_cell_rig: {
height: 40,
......@@ -2569,5 +2854,5 @@ const mapDispatchToProps = (dispatch) => {
}
}
}
export default connect(mapStateToProps, mapDispatchToProps)(FilterModel);
\ No newline at end of file
export default connect(mapStateToProps, mapDispatchToProps)(FilterModel);
......@@ -487,7 +487,7 @@ class LineOrderPage extends Component {
subColumns.map(col => {
const obj = this.state[col.obj] || orderSupOptions
if(!!col.ifShow && !col.ifShow()) return null
console.log(Object.prototype.toString.call(col.prop))
return (
<View key={col.name} style={styles.fo_cell_box}>
<View style={{minWidth: pxSize(70), }}>
......
......@@ -28,7 +28,7 @@ import {
safe_view,
font_family_medium
} from '../../base/BaseStyle';
import { requestLogin, autoLogin, setDomainConfigurate, setVersionApk } from '../../action/LoginAction';
import { requestLogin, autoLogin, setDomainConfigurate, setVersionApk, setDomainFromOrigin } from '../../action/LoginAction';
import { show, isEmpty } from '../../utils/Utils';
import { LOGIN_DOING, LOGIN_SUCCESS, LOGIN_FAILURE, LOGIN_NO } from '../../base/ActionTypes';
import StatusBarView from '../common/StatusBarView';
......@@ -67,7 +67,10 @@ class LoginPage extends Component{
async setDefaultDomain() {
try {
const baseUrl = await NativeModules.RNToolsManager.getBaseUrl()
this.props.setDomainConfigurate(baseUrl)
if (baseUrl && !this.props.hasSet) {
this.props.setDomainConfigurate(baseUrl)
this.props.setDomainFromOrigin(true)
}
} catch (error) {
console.log('do not suppor getBaseUrl')
}
......@@ -507,7 +510,8 @@ const mapStateToProps = (state) => ({
loginState:state.login.loginState,
username:state.login.username,
password:state.login.password,
global_domain_config:state.login.global_domain_config
global_domain_config:state.login.global_domain_config,
hasSet:state.login.hasSetDomainFromOrigin
})
const mapDispatchToProps = (dispatch) => ({
......@@ -523,6 +527,9 @@ const mapDispatchToProps = (dispatch) => ({
setVersionApk: (versionApk) => {
dispatch(setVersionApk(versionApk))
},
setDomainFromOrigin: (hasSet) => {
dispatch(setDomainFromOrigin(hasSet))
}
})
export default connect(mapStateToProps, mapDispatchToProps)(LoginPage)
/**
* 快速下单
*/
import React, { Component } from 'react';
import {
View,
......@@ -33,7 +36,7 @@ import {
FooterBtnStyle
} from '../common/CellTextStyle';
import { connect } from 'react-redux';
import { show, dedupQuoteArray, formatStrForDate, cloneObject } from '../../utils/Utils';
import { show, dedupQuoteArray, formatStrForDate, cloneObject, isBlank, isNotBlank } from '../../utils/Utils';
import { AudioRecorder, AudioUtils } from 'react-native-audio';
import Sound from 'react-native-sound';
import DateModel from '../common/DateModel';
......@@ -53,7 +56,8 @@ import {
requestQuickSurgeryType,
reqQuickOrganizations,
requestQuickSurColSetting,
reqQuickTemplateCollect
reqQuickTemplateCollect,
reqOrgDepartments
} from '../../action/QuickAction';
import { exitLoginStatus, requestSysProfile } from '../../action/LoginAction';
import {
......@@ -67,6 +71,7 @@ import {
} from '../../base/ActionTypes';
import moment from 'moment';
import PageListArrow from '../common/listDataComponent/PageListArrow';
import * as R from 'ramda';
class EquipConsuPage extends Component {
constructor(props) {
......@@ -155,6 +160,35 @@ class EquipConsuPage extends Component {
title: '还有什么要安排的,可录音备注哟!',
value: '',
isRecode: true // 录音
},
{
"id": '13', // 以后如果有需要添加字段可以在这里加,下面的部门4个序号与自助下单一样
title: '占位',
name: '占位'
},
{
"id": "14",
title: '部门',
name: '请选择',
value: '',
},
{
"id": "15",
title: '业务经理',
name: '请选择',
value: '',
},
{
"id": "16",
title: '跟台员',
name: '请选择',
value: '',
},
{
"id": "17",
title: '送货员',
name: '请选择',
value: '',
}
],
subInitListOption: [], // 提交成功后,初始化当前数据
......@@ -215,7 +249,14 @@ class EquipConsuPage extends Component {
// ],
showNotEnogPop: false, // 库存不足弹窗
not_enough_items_list:[], // 库存不足数据
bor_ware_required: 0, // APP借货仓库必填权限
sysValues: {
OBS_MOBILE_BOR_WARE_REQUIRED: 0, // 多仓借还,借货仓库必填 [0, 1, 2, 3]
OBS_MOBILE_DEPARTMENT_DISPLAY: 0,
OBS_MOBILE_BM_DISPLAY: 0,
OBS_MOBILE_SUR_FOLLOWER_DISPLAY: 0,
OBS_MOBILE_DELIVERYMAN_DISPLAY: 0,
},
departments: []
}
}
......@@ -223,7 +264,7 @@ class EquipConsuPage extends Component {
this.getSellerName()
this.getAudioAuthorize()
this.getOrganizationData()
this.getSysConfigValue()
this.getSysProfileValue()
}
// 赋值销售员 初始化数据
......@@ -523,12 +564,12 @@ class EquipConsuPage extends Component {
}
// 清空当前项以下的值
clearInitNameAndValue(curIndex) {
clearInitNameAndValue(startIndex, endIndex = 12) {
let { listOptionData, localOtherObj } = this.state
let that = this
this.setState({
listOptionData: listOptionData.map((item, index) => {
if(index > curIndex && index < 12 ) {
if(index > startIndex && index < endIndex ) {
item.name = localOtherObj.name
item.value = localOtherObj.value
if(listOptionData[1].value && item.title == '客户名称') {
......@@ -555,11 +596,11 @@ class EquipConsuPage extends Component {
// 判断是否都有值,修改提交按钮的颜色
changeCanSub(isSubCheck) {
let { listOptionData, bor_ware_required } = this.state
let { listOptionData, sysValues } = this.state
let tempStatus = false
let tempTit = ''
let maxIndex = 10
if(bor_ware_required === 3){
if(sysValues.OBS_MOBILE_BOR_WARE_REQUIRED === 3){
maxIndex = 11
}
for(let chIndex in listOptionData) {
......@@ -572,6 +613,15 @@ class EquipConsuPage extends Component {
tempStatus = true
break
}
if (((chIndex == 14 && sysValues.OBS_MOBILE_DEPARTMENT_DISPLAY > 2)
|| (chIndex == 15 && sysValues.OBS_MOBILE_BM_DISPLAY > 2)
|| (chIndex == 16 && sysValues.OBS_MOBILE_SUR_FOLLOWER_DISPLAY > 2)
|| (chIndex == 17 && sysValues.OBS_MOBILE_DELIVERYMAN_DISPLAY > 2))
&& !listOptionData[chIndex].value) {
tempTit = listOptionData[chIndex].title
tempStatus = true
break
}
}
this.setState({
canSubFlag: !tempStatus
......@@ -583,7 +633,7 @@ class EquipConsuPage extends Component {
// 选择器弹窗回调函数
handleCallBack(item, itemTitle) {
let { listOptionData} = this.state
let { listOptionData, sysValues, departments } = this.state
let that = this
listOptionData.map(function(chItem, index){
if(chItem.title === itemTitle) {
......@@ -591,6 +641,16 @@ class EquipConsuPage extends Component {
chItem.value = item.value
if(itemTitle === '组织') {
that.clearInitNameAndValue(1)
// 选择完组织后获取部门
if (sysValues.OBS_MOBILE_DEPARTMENT_DISPLAY > 0) {
that.clearInitNameAndValue(13, 18)
that.getDepartmentsByOrg(item.value)
}
}
if (itemTitle === '部门') {
that.clearInitNameAndValue(14, 18)
const dep = R.find(R.propEq('department_code', item.value))(departments)
that.autoSetBMAndSFAndDMWhildSelectDepartment(dep)
}
if(itemTitle === '客户名称') {
that.clearInitNameAndValue(2)
......@@ -641,9 +701,29 @@ class EquipConsuPage extends Component {
if (currentTitle === '组织') {
tempOption = this.changeNameAndValue(quickOrderOption, 'org_name', 'org_code')
} else if (currentTitle === '客户名称') {
this.setState({
localCustomersOption: quickOrderOption
let customers = quickOrderOption
// 兼容旧接口 customers结构有可能是扁平的, 要改成层级的
if (customers.length && !!R.path([0, 'ship_to_site_code'], customers)) {
customers = R.map(cus => ({
bill_to_sites: [{
bill_to_site_code: cus.bill_to_site_code,
bill_to_site_name: cus.bill_to_site_name,
ship_to_sites: [{
ship_to_site_code: cus.ship_to_site_code,
ship_to_site_name: cus.ship_to_site_name,
customer_doctor: cus.customer_doctor
}]
}],
customer_code: cus.customer_code,
customer_name: cus.customer_name,
}))(customers)
}
that.setState({
localCustomersOption: customers
})
// 去重医院数据
let filterOpt = dedupQuoteArray(quickOrderOption, 'customer_code')
let currentArr = []
......@@ -725,6 +805,88 @@ class EquipConsuPage extends Component {
props.requestQuickOrganizations(params)
})
}
/**
* 根据组织获取部门等信息, 其他信息在部门下面
* @param {*} org_code
*/
async getDepartmentsByOrg(org_code) {
const {token, global_domain_config, userInfo} = this.props
const params = {
access_token: token,
org_code,
seller_code: userInfo.user_name,
scope_flag: 'Y'
}
try {
const res = await reqOrgDepartments(global_domain_config, params)
console.log('departments: ', res)
let departments = res.data.relationships
this.setState({ departments })
const {listOptionData, sysValues} = this.state
const noop = () => {}
// 部门只有一个时直接设置
R.cond([
[R.equals(0), () => setTimeout(() => show('当前组织没有部门信息'), 4000)],
[R.equals(1), () => {
const dep = R.head(departments)
listOptionData[14].name = dep.department_name
listOptionData[14].value = dep.department_code
this.setState({ listOptionData })
// 只有一个部门时可以自动设置
this.autoSetBMAndSFAndDMWhildSelectDepartment(dep)
}],
[R.T, noop]
])(R.length(departments))
} catch (error) {
console.log(error)
}
}
/**
* 当选择部门后,判断业务经理、跟台员、送货员是否只有一个,如果只有一个自动填上
*/
autoSetBMAndSFAndDMWhildSelectDepartment(department) {
const { listOptionData } = this.state
const noop = () => {}
// 业务经理只有一个时,直接设置业务经理
R.cond([
[R.equals(0), () => show('当前部门没有业务经理')],
[R.equals(1), () => {
const bm = R.pathOr([], ['business_manager_list', 0])(department)
listOptionData[15].name = bm.business_manager_name
listOptionData[15].value = bm.business_manager_code
this.setState({ listOptionData })
}],
[R.T, noop]
])(R.length(department.business_manager_list))
// 跟台员只有一个
R.ifElse(R.equals(1), () => {
const sf = R.pathOr([], ['surgery_follower_list', 0])(department)
listOptionData[16].name = sf.surgery_follower_name
listOptionData[16].value = sf.surgery_follower_code
this.setState({ listOptionData })
}, noop)(R.length(department.surgery_follower_list))
// 送货员只有一个
R.ifElse(R.equals(1), () => {
const dm = R.pathOr([], ['deliveryman_list', 0])(department)
listOptionData[17].name = dm.deliveryman_name
listOptionData[17].value = dm.deliveryman_code
this.setState({ listOptionData })
}, noop)(R.length(department.deliveryman_list))
}
/**
* 获取组织
*/
async getOrganizationData() {
let { state, props } = this
let params = {
......@@ -749,19 +911,49 @@ class EquipConsuPage extends Component {
listOptionData
}, () => {
that.organizationGetCustomerData()
that.getDepartmentsByOrg(listOptionData[1].value)
})
}
}else {
this.showWarnError(orgResult)
}
// else if (orgResult.error_code == 41006) {
// show('登录过期,请重新登录');
// props.exitLoginStatus();
// } else {
// let error_msg = orgResult.error_msg || orgResult.message
// show(error_msg);
// }
}
/**
* 点击部门,业务经理,跟台员,送货员等
*/
handleDepartmentCheck(curData, objName, itemName, itemVal) {
if (!this.judgeOrgIsNull()) return
// objName有值直接是部门
if (!!objName && !this.judgeDepartmentIsNull()) return
const {departments, listOptionData} = this.state
let options = departments
// 非部门
if (!!objName) {
const code = listOptionData[14].value
const dep = R.find(R.propEq('department_code', code))(departments)
options = R.propOr([], objName, dep)
}
const listOptions = R.map(R.applySpec({
name: R.prop(itemName),
value: R.prop(itemVal)
}))(options)
this.setState({
currentTitle: curData.title,
currentItem: {
name: curData.name,
value: curData.value
},
showTypePop: true,
listCurrentOption: listOptions
})
}
// 客户名称 点击
handleCustomerCheck(curData) {
let that = this
......@@ -801,6 +993,24 @@ class EquipConsuPage extends Component {
let cusResult = await reqQuickSurgeryHospital(global_domain_config, params);
if(cusResult.error_code == 0) {
let { data: { customers } } = cusResult
// customers结构有可能是扁平的, 要改成层级的,新版的
if (customers.length && !!R.path([0, 'ship_to_site_code'], customers)) {
customers = R.map(cus => ({
bill_to_sites: [{
bill_to_site_code: cus.bill_to_site_code,
bill_to_site_name: cus.bill_to_site_name,
ship_to_sites: [{
ship_to_site_code: cus.ship_to_site_code,
ship_to_site_name: cus.ship_to_site_name,
customer_doctor: cus.customer_doctor
}]
}],
customer_code: cus.customer_code,
customer_name: cus.customer_name,
}))(customers)
}
let { listOptionData } = state
// props.requestListDataSuccess(customers)
let filterOpt = dedupQuoteArray(customers, 'customer_code')
......@@ -830,7 +1040,10 @@ class EquipConsuPage extends Component {
// show(error_msg);
// }
}
// 收单地点 点击
/**
* 收单地点 点击
*/
handleBillCheck(curData) {
let { localCustomersOption, listOptionData } = this.state
let that = this
......@@ -842,38 +1055,45 @@ class EquipConsuPage extends Component {
value: curData.value
}
}, () => {
let tempOption = []
if( localCustomersOption.length ) {
localCustomersOption.forEach((item) => {
if(item.customer_code === listOptionData[2].value) {
// 保证是当前客户名称下的地点
let obj = {}
obj.value = item.bill_to_site_code
obj.name = item.bill_to_site_name
tempOption.push(obj)
}
})
const customer = R.find(R.propEq('customer_code', listOptionData[2].value), localCustomersOption)
let options = []
if (isNotBlank(customer.bill_to_sites)) {
options = R.compose(
R.curry(dedupQuoteArray)(R.__, 'name'),
R.map(R.applySpec({
value: R.prop('bill_to_site_code'),
name: R.prop('bill_to_site_name'),
})),
R.prop('bill_to_sites')
)(customer)
}
tempOption = dedupQuoteArray(tempOption, 'name')
that.setState({
showTypePop: true,
listCurrentOption: [...tempOption]
listCurrentOption: options
})
})
}
}
/**
* 自动填充收单地点
* @returns
*/
customerGetBill() {
let { localCustomersOption, listOptionData } = this.state
let that = this
let tempLocalOption = localCustomersOption.filter(item => item.customer_code === listOptionData[2].value)
tempLocalOption = dedupQuoteArray(tempLocalOption, 'bill_to_site_code')
if(tempLocalOption.length === 0) {
const customer = R.find(R.propEq('customer_code', listOptionData[2].value), localCustomersOption)
if (!customer || isBlank(customer.bill_to_sites)) {
show(`当前${listOptionData[3].title}为空`)
return
}
if(tempLocalOption.length === 1) {
listOptionData[3].name = tempLocalOption[0].bill_to_site_name
listOptionData[3].value = tempLocalOption[0].bill_to_site_code
const sites = customer.bill_to_sites
if(sites.length === 1) {
listOptionData[3].name = R.pathOr('', [0, 'bill_to_site_name'], sites)
listOptionData[3].value = R.pathOr('', [0, 'bill_to_site_code'], sites)
that.setState({
listOptionData
})
......@@ -891,41 +1111,66 @@ class EquipConsuPage extends Component {
value: curData.value
}
}, () => {
let tempOption = []
if( localCustomersOption.length ) {
localCustomersOption.forEach((item, index) => {
if(item.customer_code === listOptionData[2].value) {
// 保证是当前客户名称下的地点
let obj = {}
obj.value = item.ship_to_site_code
obj.name = item.ship_to_site_name
tempOption.push(obj)
}
})
const customer = R.find(R.propEq('customer_code', listOptionData[2].value), localCustomersOption)
let options = []
if (isNotBlank(customer)) {
const billSite = R.find(R.propEq('bill_to_site_code', listOptionData[3].value), customer.bill_to_sites)
if (isNotBlank(billSite) && isNotBlank(billSite.ship_to_sites)) {
options = R.compose(
R.curry(dedupQuoteArray)(R.__, 'name'),
R.map(R.applySpec({
value: R.prop('ship_to_site_code'),
name: R.prop('ship_to_site_name'),
})),
R.prop('ship_to_sites')
)(billSite)
}
}
tempOption = dedupQuoteArray(tempOption, 'name')
that.setState({
showTypePop: true,
listCurrentOption: [...tempOption]
listCurrentOption: options
})
})
}
}
/**
* 收货地点自动填充
* @returns
*/
customerGetShip() {
let { localCustomersOption, listOptionData } = this.state
let that = this
let tempLocalOption = localCustomersOption.filter(item => item.customer_code === listOptionData[2].value)
tempLocalOption = dedupQuoteArray(tempLocalOption, 'ship_to_site_code')
if(tempLocalOption.length === 0) {
show(`当前${listOptionData[4].title}为空`)
return
const customer = R.find(R.propEq('customer_code', listOptionData[2].value), localCustomersOption)
if (R.any(isBlank, [customer, customer.bill_to_sites]) ) {
return show(`当前${listOptionData[4].title}为空`)
}
if(tempLocalOption.length === 1) {
listOptionData[4].name = tempLocalOption[0].ship_to_site_name
listOptionData[4].value = tempLocalOption[0].ship_to_site_code
that.setState({
listOptionData
})
// 收单地点为单或已选
if (customer.bill_to_sites.length === 1 || listOptionData[3].value) {
let billSite = R.find(R.propEq('bill_to_site_code', listOptionData[3].value), customer.bill_to_sites)
if (isBlank(billSite) && customer.bill_to_sites.length === 1) {
billSite = R.head(customer.bill_to_sites)
}
if (isBlank(billSite)) return
// 收货地点
let shipSites = billSite.ship_to_sites
shipSites = dedupQuoteArray(shipSites, 'ship_to_site_code')
if (shipSites.length === 0) {
show(`当前${listOptionData[4].title}为空`)
return
}
if (shipSites.length === 1) {
listOptionData[4].name = shipSites[0].ship_to_site_name
listOptionData[4].value = shipSites[0].ship_to_site_code
that.setState({
listOptionData
})
}
}
}
// 主治医生 点击
......@@ -941,23 +1186,26 @@ class EquipConsuPage extends Component {
value: curData.value
}
}, () => {
let tempOption = []
if( localCustomersOption.length ) {
localCustomersOption.forEach((item) => {
if(item.customer_code === listOptionData[2].value) {
// 保证是当前客户名称下的医生
let obj = {}
obj.value = item.customer_doctor
obj.name = item.customer_doctor
tempOption.push(obj)
let tempOption = [{name: '其他', value: '-1'}]
if (isNotBlank(localCustomersOption) && listOptionData[2].value) {
const customer = R.find(R.propEq('customer_code', listOptionData[2].value))(localCustomersOption)
if (isNotBlank(customer) && isNotBlank(customer.bill_to_sites) && listOptionData[3].value) {
const billSite = R.find(R.propEq('bill_to_site_code', listOptionData[3].value))(customer.bill_to_sites)
if (isNotBlank(billSite) && isNotBlank(billSite.ship_to_sites) && listOptionData[4].value) {
const ship = R.find(R.propEq('ship_to_site_code', listOptionData[4].value))(billSite.ship_to_sites)
if (isNotBlank(ship)) {
tempOption = R.prepend({
value: ship.customer_doctor,
name: ship.customer_doctor
}, tempOption)
}
}
})
}
let othObj = {
name: '其他',
value: '-1'
}
}
tempOption.push(othObj)
tempOption = dedupQuoteArray(tempOption, 'name')
that.setState({
showTypePop: true,
......@@ -1226,6 +1474,13 @@ class EquipConsuPage extends Component {
tempSubOption.collect_src_inv_code = state.listOptionData[10].value
tempSubOption.surgery_desc = state.listOptionData[11].value
tempSubOption.voice_url = state.listOptionData[12].value
// 有部门显示的提交
const {sysValues} = state
sysValues.OBS_MOBILE_DEPARTMENT_DISPLAY > 0 && (tempSubOption.department_code = state.listOptionData[14].value)
sysValues.OBS_MOBILE_BM_DISPLAY > 0 && (tempSubOption.business_manager_code = state.listOptionData[15].value)
sysValues.OBS_MOBILE_SUR_FOLLOWER_DISPLAY > 0 && (tempSubOption.surgery_follower_code = state.listOptionData[16].value)
sysValues.OBS_MOBILE_DELIVERYMAN_DISPLAY > 0 && (tempSubOption.deliveryman_code = state.listOptionData[17].value)
let params = {
access_token: props.token,
data: { ...tempSubOption }
......@@ -1244,6 +1499,18 @@ class EquipConsuPage extends Component {
return true
}
}
/**
* 部门是否为空
* @returns
*/
judgeDepartmentIsNull() {
let {listOptionData } = this.state
return R.ifElse(R.isEmpty, () => {show('请先选择部门'); return R.F()}, R.T)(
R.path(['listOptionData', 14, 'value'], this.state)
)
}
// 判断客户名称是否为空
judgeCustomerIsNull() {
let { listOptionData } = this.state
......@@ -1255,6 +1522,17 @@ class EquipConsuPage extends Component {
return true
}
}
/**
* 收单地点为空
* @returns
*/
judgeBillIsNull() {
let {listOptionData } = this.state
return R.ifElse(R.isEmpty, () => {show('请先选择收单地点'); return R.F()}, R.T)(
R.path(['listOptionData', 3, 'value'], this.state)
)
}
// 处理提交后返回的数据
processReturnData() {
let { quickOrderOption } = this.props
......@@ -1314,23 +1592,32 @@ class EquipConsuPage extends Component {
showNotEnogPop: show
})
}
// 获取配置值
async getSysConfigValue() {
let { global_domain_config, token } = this.props
const params = {
access_token: token,
profile_code: 'OBS_MOBILE_BOR_WARE_REQUIRED'
}
let sysRes = await requestSysProfile(global_domain_config, params)
console.log('sysRes:==', sysRes)
if(sysRes.error_code === 0){
this.setState({
bor_ware_required: Number(sysRes.data.profile_value) || 0
})
// }else {
// this.showWarnError(sysRes)
/**
* 获取配置
*/
getSysProfileValue() {
let { global_domain_config, token} = this.props
const {sysValues} = this.state
const getSysProfile = async (code) => {
const params = {
access_token: token,
profile_code: code
}
let res = await requestSysProfile(global_domain_config, params)
console.log('sysRes:==', res)
if(res && res.error_code === 0){
const value = res.data.profile_value
sysValues[code] = isNaN(value) ? value : Number(value)
this.setState({ sysValues })
}
}
R.compose(R.map(getSysProfile), R.keys)(sysValues)
}
showWarnError(res){
if(res.error_code == 41006) {
show('登录过期,请重新登录');
......@@ -1343,7 +1630,7 @@ class EquipConsuPage extends Component {
// 返回备注以上的元素
renderListItem() {
let { listOptionData, dateModelPop, bor_ware_required } = this.state
let { listOptionData, dateModelPop, sysValues } = this.state
return(
<View style={styles.list_cont}>
<PageListArrow
......@@ -1363,6 +1650,60 @@ class EquipConsuPage extends Component {
listCallBack={() => this.handleOrganizationCheck(listOptionData[1])}
listHasArrow={true}
/>
{
sysValues.OBS_MOBILE_DEPARTMENT_DISPLAY > 1 && (
<PageListArrow
listActOpa={.8}
listHasAster={sysValues.OBS_MOBILE_DEPARTMENT_DISPLAY > 2}
listItem={listOptionData[14]}
listName={'name'}
listTitle={'title'}
listCallBack={() => this.handleDepartmentCheck(listOptionData[14], null, 'department_name', 'department_code')}
listHasArrow={true}
/>
)
}
{
sysValues.OBS_MOBILE_BM_DISPLAY > 1 && (
<PageListArrow
listActOpa={.8}
listHasAster={sysValues.OBS_MOBILE_BM_DISPLAY > 2}
listItem={listOptionData[15]}
listName={'name'}
listTitle={'title'}
listCallBack={this.handleDepartmentCheck.bind(this, listOptionData[15], 'business_manager_list', 'business_manager_name', 'business_manager_code')}
listHasArrow={true}
/>
)
}
{
sysValues.OBS_MOBILE_SUR_FOLLOWER_DISPLAY > 1 && (
<PageListArrow
listActOpa={.8}
listHasAster={sysValues.OBS_MOBILE_SUR_FOLLOWER_DISPLAY > 2}
listItem={listOptionData[16]}
listName={'name'}
listTitle={'title'}
listCallBack={this.handleDepartmentCheck.bind(this, listOptionData[16], 'surgery_follower_list', 'surgery_follower_name', 'surgery_follower_code')}
listHasArrow={true}
/>
)
}
{
sysValues.OBS_MOBILE_DELIVERYMAN_DISPLAY > 1 && (
<PageListArrow
listActOpa={.8}
listHasAster={ sysValues.OBS_MOBILE_DELIVERYMAN_DISPLAY > 2}
listItem={listOptionData[17]}
listName={'name'}
listTitle={'title'}
listCallBack={this.handleDepartmentCheck.bind(this, listOptionData[17], 'deliveryman_list', 'deliveryman_name', 'deliveryman_code')}
listHasArrow={true}
/>
)
}
<PageListArrow
listActOpa={.8}
listHasAster={true}
......@@ -1438,10 +1779,10 @@ class EquipConsuPage extends Component {
listHasArrow={true}
/>
{
bor_ware_required > 1 ?
sysValues.OBS_MOBILE_BOR_WARE_REQUIRED > 1 ?
<PageListArrow
listActOpa={.8}
listHasAster={bor_ware_required === 3}
listHasAster={sysValues.OBS_MOBILE_BOR_WARE_REQUIRED === 3}
listItem={listOptionData[10]}
listName={'name'}
listTitle={'title'}
......
......@@ -3,7 +3,7 @@ import { View, Text, SafeAreaView, StyleSheet, TouchableOpacity, Image, ScrollVi
import { connect } from 'react-redux';
import { home_background_color, placehold_text_color, promary_color, safe_view, icon_style, list_common_item } from '../../base/BaseStyle';
import { ImageTextStyle, CellTextStyle, FooterBtnStyle } from '../common/CellTextStyle';
import { show, formatStrForDate, cloneObject, dedupQuoteArray } from '../../utils/Utils';
import { show, formatStrForDate, cloneObject, dedupQuoteArray, isBlank, isNotBlank } from '../../utils/Utils';
import HeadBackItem from '../common/HeadBackItem';
import StatusBarView from '../common/StatusBarView';
import DialogModel from '../common/DialogModel';
......@@ -11,8 +11,8 @@ import LodingModel from '../common/LodingModel';
import DateModel from '../common/DateModel';
import { AudioRecorder, AudioUtils } from 'react-native-audio';
import Sound from 'react-native-sound';
import { requestSelfOrganizations, requestSelfSurgeryHospital, requestSelfOrderType, requestSelfTemplateCollect, requestSelfAudio, requestSelfSumbit, setSelfInitData, reqSelfSurgeryHospital, requestListDataSuccess, requestSelfSurgeryType, setSelectProductOpts, reqSelfOrganizations } from '../../action/SelfAction';
import { exitLoginStatus } from '../../action/LoginAction';
import { requestSelfOrganizations, requestSelfSurgeryHospital, requestSelfOrderType, requestSelfTemplateCollect, requestSelfAudio, requestSelfSumbit, setSelfInitData, reqSelfSurgeryHospital, requestListDataSuccess, requestSelfSurgeryType, setSelectProductOpts, reqSelfOrganizations, reqOrgDepartments, requestQuickSurColSetting} from '../../action/SelfAction';
import { exitLoginStatus, requestSysProfile } from '../../action/LoginAction';
import { SELF_ORDER_LIST_DOING, SELF_ORDER_LIST_SUCCESS, SELF_ORDER_LIST_FAILURE, LOGIN_NO, SELF_SUBMIT_DOING, SELF_SUBMIT_SUCCESS, SELF_SUBMIT_FAILURE } from '../../base/ActionTypes';
import PageListArrow from '../common/listDataComponent/PageListArrow';
import TipInfoNeedSelect from '../common/listDataComponent/TipInfoNeedSelect';
......@@ -23,6 +23,7 @@ import ImagePicker from 'react-native-image-picker';
import ZoomPictureModel from '../common/ZoomPictureModel';
import { uploadTransImg } from '../../action/TransAction';
import moment from 'moment';
import * as R from "ramda";
class SelfOrderPage extends Component {
constructor(props) {
......@@ -68,11 +69,6 @@ class SelfOrderPage extends Component {
showInput: false,
inputValue: ''
},
// {
// "id": "6",
// title: '手术名称',
// value: ''
// },
{
"id": "6",
title: '需求时间',
......@@ -81,12 +77,6 @@ class SelfOrderPage extends Component {
dateValue: new Date(),
showDatePicker: true
},
// {
// "id": "8",
// title: '手术类型',
// name: '请选择',
// value: '',
// },
{
"id": "7",
title: '订单类型',
......@@ -106,14 +96,12 @@ class SelfOrderPage extends Component {
{
"id": "9",
title: '需要携带合格证',
// name: '',
value: '',
isRedio: '' // 单选
},
{
"id": "10",
title: '同意替换器械包', // 同意替换同品不同器械包
// name: '',
value: 'N',
isRedio: 'N' // 单选
},
......@@ -135,6 +123,36 @@ class SelfOrderPage extends Component {
value: '',
isAddImage: true, // 添加图片
uploadImgArr: [] // 上传后的路径
},
{
"id": "14",
title: '部门',
name: '请选择',
value: '',
},
{
"id": "15",
title: '业务经理',
name: '请选择',
value: '',
},
{
"id": "16",
title: '跟台员',
name: '请选择',
value: '',
},
{
"id": "17",
title: '送货员',
name: '请选择',
value: '',
},
{
"id": "18",
title: '借货仓库',
name: '请选择',
value: '',
}
],
subInitListOption: [], // 存储最初数据
......@@ -181,11 +199,20 @@ class SelfOrderPage extends Component {
not_enough_items_list: [], // 库存不足数据
localPhoOption: [], // 本地图片
isShowImage: false,
currShowImgIndex: 0
currShowImgIndex: 0,
sysValues: {
OBS_MOBILE_DEPARTMENT_DISPLAY: 0,
OBS_MOBILE_BM_DISPLAY: 0,
OBS_MOBILE_SUR_FOLLOWER_DISPLAY: 0,
OBS_MOBILE_DELIVERYMAN_DISPLAY: 0,
OBS_MOBILE_BOR_WARE_REQUIRED: 0
},
departments: []
}
}
componentDidMount() {
this.getSysProfileValue()
this.props.setSelectProductOpts([])
this.getSellerName()
this.getAudioAuthorize()
......@@ -209,6 +236,29 @@ class SelfOrderPage extends Component {
}
}
/**
* 从系统值集中获取是否显示部门、业务经理、跟台员、送货员等信息
*/
async getSysProfileValue() {
let { global_domain_config, token } = this.props
const {sysValues} = this.state
const getSysValue = async (key) => {
const params = {
access_token: token,
profile_code: key
}
const res = await requestSysProfile(global_domain_config, params)
if (res.error_code || res.status) return
sysValues[key] = isNaN(res.data.profile_value) ? res.data.profile_value : parseInt(res.data.profile_value)
this.setState({
sysValues
})
}
R.compose(R.map(getSysValue), R.keys)(sysValues)
}
// 请求授权
getAudioAuthorize() {
AudioRecorder.requestAuthorization()
......@@ -424,12 +474,12 @@ class SelfOrderPage extends Component {
}
// 清空当前项以下的值
clearInitNameAndValue(curIndex) {
clearInitNameAndValue(startIndex, endIndex = 6) {
let { listOptionData, localOtherObj } = this.state
let that = this
this.setState({
listOptionData: listOptionData.map((item, index) => {
if (index > curIndex && index < 6) {
if (index > startIndex && index < endIndex) {
item.name = localOtherObj.name
item.value = localOtherObj.value
if (listOptionData[1].value && item.title == '客户名称') {
......@@ -453,7 +503,7 @@ class SelfOrderPage extends Component {
// 判断是否都有值,修改提交按钮的颜色
changeCanSub(isSubCheck) {
let { listOptionData } = this.state
let { listOptionData, sysValues} = this.state
let tempStatus = false
let tempTit = ''
let curTip = '未选择'
......@@ -469,6 +519,16 @@ class SelfOrderPage extends Component {
}
break
}
if (((chIndex == 14 && sysValues.OBS_MOBILE_DEPARTMENT_DISPLAY > 2)
|| (chIndex == 15 && sysValues.OBS_MOBILE_BM_DISPLAY > 2)
|| (chIndex == 16 && sysValues.OBS_MOBILE_SUR_FOLLOWER_DISPLAY > 2)
|| (chIndex == 17 && sysValues.OBS_MOBILE_DELIVERYMAN_DISPLAY > 2)
|| (chIndex == 18 && sysValues.OBS_MOBILE_BOR_WARE_REQUIRED > 2))
&& !listOptionData[chIndex].value) {
tempTit = listOptionData[chIndex].title
tempStatus = true
break
}
}
this.setState({
canSubFlag: !tempStatus
......@@ -480,7 +540,7 @@ class SelfOrderPage extends Component {
// 选择器弹窗回调函数
handleCallBack(item, itemTitle) {
let { listOptionData } = this.state
let { listOptionData, sysValues, departments } = this.state
let that = this
listOptionData.map(function (chItem, index) {
if (chItem.title === itemTitle) {
......@@ -488,6 +548,16 @@ class SelfOrderPage extends Component {
chItem.value = item.value
if (itemTitle === '组织') {
that.clearInitNameAndValue(1)
// 选择完组织后获取部门
if (sysValues.OBS_MOBILE_DEPARTMENT_DISPLAY > 0) {
that.clearInitNameAndValue(13, 18)
that.getDepartmentsByOrg(item.value)
}
}
if (itemTitle === '部门') {
that.clearInitNameAndValue(14, 18)
const dep = R.find(R.propEq('department_code', item.value))(departments)
that.autoSetBMAndSFAndDMWhildSelectDepartment(dep)
}
if (itemTitle === '客户名称') {
that.clearInitNameAndValue(2)
......@@ -533,9 +603,28 @@ class SelfOrderPage extends Component {
if (currentTitle === '组织') {
tempOption = that.changeNameAndValue(selfOrderOption, 'org_name', 'org_code')
} else if (currentTitle === '客户名称') {
let customers = selfOrderOption
// 兼容旧接口 customers结构有可能是扁平的, 要改成层级的
if (customers.length && !!R.path([0, 'ship_to_site_code'], customers)) {
customers = R.map(cus => ({
bill_to_sites: [{
bill_to_site_code: cus.bill_to_site_code,
bill_to_site_name: cus.bill_to_site_name,
ship_to_sites: [{
ship_to_site_code: cus.ship_to_site_code,
ship_to_site_name: cus.ship_to_site_name,
customer_doctor: cus.customer_doctor
}]
}],
customer_code: cus.customer_code,
customer_name: cus.customer_name,
}))(customers)
}
that.setState({
localCustomersOption: selfOrderOption
localCustomersOption: customers
})
// 去重医院数据
let filterOpt = dedupQuoteArray(selfOrderOption, 'customer_code')
let currentArr = []
......@@ -561,6 +650,9 @@ class SelfOrderPage extends Component {
// }
else if (currentTitle === '订单类型') {
tempOption = that.changeNameAndValue(selfOrderOption, 'value_name', 'value_code')
} else if (currentTitle === '借货仓库') {
let filterOpt = dedupQuoteArray(selfOrderOption, 'source_inv_code')
tempOption = this.changeNameAndValue(filterOpt, 'source_inv_name', 'source_inv_code')
}
that.setState({
listCurrentOption: [...tempOption]
......@@ -606,6 +698,88 @@ class SelfOrderPage extends Component {
props.requestSelfOrganizations(params)
})
}
/**
* 根据组织获取部门等信息, 其他信息在部门下面
* @param {*} org_code
*/
async getDepartmentsByOrg(org_code) {
const {token, global_domain_config, userInfo} = this.props
const params = {
access_token: token,
org_code,
seller_code: userInfo.user_name,
scope_flag: 'Y'
}
try {
const res = await reqOrgDepartments(global_domain_config, params)
console.log('deparments: ', res)
let departments = res.data.relationships
this.setState({ departments })
const {listOptionData, sysValues} = this.state
const noop = () => {}
// 部门只有一个时直接设置
R.cond([
[R.equals(0), () => setTimeout(() =>show('当前组织没有部门信息'), 4000)],
[R.equals(1), () => {
const dep = R.head(departments)
listOptionData[14].name = dep.department_name
listOptionData[14].value = dep.department_code
this.setState({ listOptionData })
// 只有一个部门时可以自动设置
this.autoSetBMAndSFAndDMWhildSelectDepartment(dep)
}],
[R.T, noop]
])(R.length(departments))
} catch (error) {
console.log(error)
}
}
/**
* 当选择部门后,判断业务经理、跟台员、送货员是否只有一个,如果只有一个自动填上
*/
autoSetBMAndSFAndDMWhildSelectDepartment(department) {
const { listOptionData } = this.state
const noop = () => {}
// 业务经理只有一个时,直接设置业务经理
R.cond([
[R.equals(0), () => show('当前部门没有业务经理')],
[R.equals(1), () => {
const bm = R.pathOr([], ['business_manager_list', 0])(department)
listOptionData[15].name = bm.business_manager_name
listOptionData[15].value = bm.business_manager_code
this.setState({ listOptionData })
}],
[R.T, noop]
])(R.length(department.business_manager_list))
// 跟台员只有一个
R.ifElse(R.equals(1), () => {
const sf = R.pathOr([], ['surgery_follower_list', 0])(department)
listOptionData[16].name = sf.surgery_follower_name
listOptionData[16].value = sf.surgery_follower_code
this.setState({ listOptionData })
}, noop)(R.length(department.surgery_follower_list))
// 送货员只有一个
R.ifElse(R.equals(1), () => {
const dm = R.pathOr([], ['deliveryman_list', 0])(department)
listOptionData[17].name = dm.deliveryman_name
listOptionData[17].value = dm.deliveryman_code
this.setState({ listOptionData })
}, noop)(R.length(department.deliveryman_list))
}
/**
* 获取组织
*/
async getOrganizationData() {
let { state, props } = this
let params = {
......@@ -630,6 +804,7 @@ class SelfOrderPage extends Component {
listOptionData
}, () => {
that.organizationGetCustomerData()
that.getDepartmentsByOrg(listOptionData[1].value)
})
}
} else if (orgResult.error_code == 41006) {
......@@ -641,6 +816,41 @@ class SelfOrderPage extends Component {
}
}
/**
* 点击部门,业务经理,跟台员,送货员等
*/
handleDepartmentCheck(curData, objName, itemName, itemVal) {
if (!this.judgeOrgIsNull()) return
// objName有值直接是部门
if (!!objName && !this.judgeDepartmentIsNull()) return
const {departments, listOptionData} = this.state
let options = departments
// 非部门
if (!!objName) {
const code = listOptionData[14].value
const dep = R.find(R.propEq('department_code', code))(departments)
options = R.propOr([], objName, dep)
}
const listOptions = R.map(R.applySpec({
name: R.prop(itemName),
value: R.prop(itemVal)
}))(options)
this.setState({
currentTitle: curData.title,
currentItem: {
name: curData.name,
value: curData.value
},
showTypePop: true,
listCurrentOption: listOptions
})
}
// 客户名称 点击
handleCustomerCheck(curData) {
let that = this
......@@ -662,7 +872,7 @@ class SelfOrderPage extends Component {
let params = {
access_token: props.token,
org_code: state.listOptionData[1].value,
seller_code: props.userInfo.user_name
seller_code: props.userInfo.user_name,
}
props.requestSelfSurgeryHospital(params)
}
......@@ -672,13 +882,32 @@ class SelfOrderPage extends Component {
let params = {
access_token: props.token,
org_code: state.listOptionData[1].value,
seller_code: props.userInfo.user_name
seller_code: props.userInfo.user_name,
}
let that = this
let { global_domain_config } = props
let cusResult = await reqSelfSurgeryHospital(global_domain_config, params);
console.log(cusResult)
if (cusResult.error_code == 0) {
let { data: { customers } } = cusResult
// customers结构有可能是扁平的, 要改成层级的,新版的
if (customers.length && !!R.path([0, 'ship_to_site_code'], customers)) {
customers = R.map(cus => ({
bill_to_sites: [{
bill_to_site_code: cus.bill_to_site_code,
bill_to_site_name: cus.bill_to_site_name,
ship_to_sites: [{
ship_to_site_code: cus.ship_to_site_code,
ship_to_site_name: cus.ship_to_site_name,
customer_doctor: cus.customer_doctor
}]
}],
customer_code: cus.customer_code,
customer_name: cus.customer_name,
}))(customers)
}
let { listOptionData } = state
// props.requestListDataSuccess(customers)
let filterOpt = dedupQuoteArray(customers, 'customer_code')
......@@ -706,7 +935,9 @@ class SelfOrderPage extends Component {
}
}
// 收单地点 点击
/**
* 收单地点 点击
* */
handleBillCheck(curData) {
let { localCustomersOption, listOptionData } = this.state
let that = this
......@@ -718,38 +949,42 @@ class SelfOrderPage extends Component {
value: curData.value
}
}, () => {
let tempOption = []
if (localCustomersOption.length) {
localCustomersOption.forEach((item) => {
if (item.customer_code === listOptionData[2].value) {
// 保证是当前客户名称下的地点
let obj = {}
obj.value = item.bill_to_site_code
obj.name = item.bill_to_site_name
tempOption.push(obj)
}
})
const customer = R.find(R.propEq('customer_code', listOptionData[2].value), localCustomersOption)
let options = []
if (isNotBlank(customer.bill_to_sites)) {
options = R.compose(
R.curry(dedupQuoteArray)(R.__, 'name'),
R.map(R.applySpec({
value: R.prop('bill_to_site_code'),
name: R.prop('bill_to_site_name'),
})),
R.prop('bill_to_sites')
)(customer)
}
tempOption = dedupQuoteArray(tempOption, 'name')
that.setState({
showTypePop: true,
listCurrentOption: [...tempOption]
listCurrentOption: options
})
})
}
}
/**
* 自动填充收单地点
*/
customerGetBill() {
let { localCustomersOption, listOptionData } = this.state
let that = this
let tempLocalOption = localCustomersOption.filter(item => item.customer_code === listOptionData[2].value)
tempLocalOption = dedupQuoteArray(tempLocalOption, 'bill_to_site_code')
if (tempLocalOption.length === 0) {
const customer = R.find(R.propEq('customer_code', listOptionData[2].value), localCustomersOption)
if (!customer || isBlank(customer.bill_to_sites)) {
show(`当前${listOptionData[3].title}为空`)
return
}
if (tempLocalOption.length === 1) {
listOptionData[3].name = tempLocalOption[0].bill_to_site_name
listOptionData[3].value = tempLocalOption[0].bill_to_site_code
const sites = customer.bill_to_sites
if (sites.length === 1) {
listOptionData[3].name = R.pathOr('', [0, 'bill_to_site_name'], sites)
listOptionData[3].value = R.pathOr('', [0, 'bill_to_site_code'], sites)
that.setState({
listOptionData
})
......@@ -760,7 +995,7 @@ class SelfOrderPage extends Component {
handleShipCheck(curData) {
let { localCustomersOption, listOptionData } = this.state
let that = this
if (this.judgeOrgIsNull() && this.judgeCustomerIsNull()) {
if (this.judgeOrgIsNull() && this.judgeCustomerIsNull() && this.judgeBillIsNull()) {
that.setState({
currentTitle: curData.title,
currentItem: {
......@@ -768,41 +1003,66 @@ class SelfOrderPage extends Component {
value: curData.value
}
}, () => {
let tempOption = []
if (localCustomersOption.length) {
localCustomersOption.forEach((item, index) => {
if (item.customer_code === listOptionData[2].value) {
// 保证是当前客户名称下的地点
let obj = {}
obj.value = item.ship_to_site_code
obj.name = item.ship_to_site_name
tempOption.push(obj)
}
})
const customer = R.find(R.propEq('customer_code', listOptionData[2].value), localCustomersOption)
let options = []
if (isNotBlank(customer)) {
const billSite = R.find(R.propEq('bill_to_site_code', listOptionData[3].value), customer.bill_to_sites)
if (isNotBlank(billSite) && isNotBlank(billSite.ship_to_sites)) {
options = R.compose(
R.curry(dedupQuoteArray)(R.__, 'name'),
R.map(R.applySpec({
value: R.prop('ship_to_site_code'),
name: R.prop('ship_to_site_name'),
})),
R.prop('ship_to_sites')
)(billSite)
}
}
tempOption = dedupQuoteArray(tempOption, 'name')
that.setState({
showTypePop: true,
listCurrentOption: [...tempOption]
listCurrentOption: options
})
})
}
}
/**
* 自动填充收货地点
* @returns
*/
customerGetShip() {
let { localCustomersOption, listOptionData } = this.state
let that = this
let tempLocalOption = localCustomersOption.filter(item => item.customer_code === listOptionData[2].value)
tempLocalOption = dedupQuoteArray(tempLocalOption, 'ship_to_site_code')
if (tempLocalOption.length === 0) {
show(`当前${listOptionData[4].title}为空`)
return
const customer = R.find(R.propEq('customer_code', listOptionData[2].value), localCustomersOption)
if (R.any(isBlank, [customer, customer.bill_to_sites]) ) {
return show(`当前${listOptionData[4].title}为空`)
}
if (tempLocalOption.length === 1) {
listOptionData[4].name = tempLocalOption[0].ship_to_site_name
listOptionData[4].value = tempLocalOption[0].ship_to_site_code
that.setState({
listOptionData
})
// 收单地点为单或已选
if (customer.bill_to_sites.length === 1 || listOptionData[3].value) {
let billSite = R.find(R.propEq('bill_to_site_code', listOptionData[3].value), customer.bill_to_sites)
if (isBlank(billSite) && customer.bill_to_sites.length === 1) {
billSite = R.head(customer.bill_to_sites)
}
if (isBlank(billSite)) return
// 收货地点
let shipSites = billSite.ship_to_sites
shipSites = dedupQuoteArray(shipSites, 'ship_to_site_code')
if (shipSites.length === 0) {
show(`当前${listOptionData[4].title}为空`)
return
}
if (shipSites.length === 1) {
listOptionData[4].name = shipSites[0].ship_to_site_name
listOptionData[4].value = shipSites[0].ship_to_site_code
that.setState({
listOptionData
})
}
}
}
......@@ -819,23 +1079,27 @@ class SelfOrderPage extends Component {
value: curData.value
}
}, () => {
let tempOption = []
if (localCustomersOption.length) {
localCustomersOption.forEach((item) => {
if (item.customer_code === listOptionData[2].value) {
// 保证是当前客户名称下的医生
let obj = {}
obj.value = item.customer_doctor
obj.name = item.customer_doctor
tempOption.push(obj)
let tempOption = [{name: '其他', value: '-1'}]
if (isNotBlank(localCustomersOption) && listOptionData[2].value) {
const customer = R.find(R.propEq('customer_code', listOptionData[2].value))(localCustomersOption)
if (isNotBlank(customer) && isNotBlank(customer.bill_to_sites) && listOptionData[3].value) {
const billSite = R.find(R.propEq('bill_to_site_code', listOptionData[3].value))(customer.bill_to_sites)
if (isNotBlank(billSite) && isNotBlank(billSite.ship_to_sites) && listOptionData[4].value) {
const ship = R.find(R.propEq('ship_to_site_code', listOptionData[4].value))(billSite.ship_to_sites)
if (isNotBlank(ship)) {
tempOption = R.prepend({
value: ship.customer_doctor,
name: ship.customer_doctor
}, tempOption)
}
}
})
}
let othObj = {
name: '其他',
value: '-1'
}
}
tempOption.push(othObj)
tempOption = dedupQuoteArray(tempOption, 'name')
that.setState({
showTypePop: true,
......@@ -1034,6 +1298,31 @@ class SelfOrderPage extends Component {
})
}
// 借货仓库 点击
handleWareCheck(curData){
let { state, props } = this
if(this.judgeOrgIsNull() && this.judgeCustomerIsNull()) {
this.setState({
currentTitle: curData.title,
currentItem: {
name: curData.name,
value: curData.value
}
}, () => {
// 在此修改接口
let params = {
access_token: props.token,
org_code: state.listOptionData[1].value,
customer_code: state.listOptionData[2].value,
bill_to_site_code: state.listOptionData[3].value,
ship_to_site_code: state.listOptionData[4].value,
process_code: 'COLLECT'
}
props.requestQuickSurColSetting(params)
})
}
}
// 添加图片 点击
handleAddPicCheck() {
let { localPhoOption, listOptionData } = this.state
......@@ -1227,6 +1516,15 @@ class SelfOrderPage extends Component {
tempSubOption.voice_url = state.listOptionData[12].value
tempSubOption.image_url = state.listOptionData[13].uploadImgArr.join(',')
tempSubOption.collect_src_inv_code = state.listOptionData[18].value
// 有部门显示的提交
const {sysValues} = state
sysValues.OBS_MOBILE_DEPARTMENT_DISPLAY > 0 && (tempSubOption.department_code = state.listOptionData[14].value)
sysValues.OBS_MOBILE_BM_DISPLAY > 0 && (tempSubOption.business_manager_code = state.listOptionData[15].value)
sysValues.OBS_MOBILE_SUR_FOLLOWER_DISPLAY > 0 && (tempSubOption.surgery_follower_code = state.listOptionData[16].value)
sysValues.OBS_MOBILE_DELIVERYMAN_DISPLAY > 0 && (tempSubOption.deliveryman_code = state.listOptionData[17].value)
// tempSubOption.replace_item_flag = state.listOptionData[10].replace_item_flag
// tempSubOption.take_cert_flag = state.listOptionData[10].take_cert_flag
......@@ -1250,7 +1548,8 @@ class SelfOrderPage extends Component {
local_lines.forEach(sup_item => {
if (sup_item[LocalVariable.SELECTED_QUQNTITY] > 0 && sup_item.leftOptionList && sup_item.leftOptionList.length > 0) {
sup_item.leftOptionList.map(lef_item => {
let select_arr = lef_item[LocalVariable.SELECTED_DATA_ARR]
// let select_arr = lef_item[LocalVariable.SELECTED_DATA_ARR]
let select_arr = lef_item.selectedArr || []
if (lef_item[LocalVariable.SELECTED_QUQNTITY] > 0 && select_arr && select_arr.length > 0) {
if (lef_item.category_code === LocalVariable.SURGICAL_TEMPLATE) {
// 手术套包
......@@ -1376,6 +1675,18 @@ class SelfOrderPage extends Component {
return true
}
}
/**
* 部门是否为空
* @returns
*/
judgeDepartmentIsNull() {
let {listOptionData } = this.state
return R.ifElse(R.isEmpty, () => {show('请先选择部门'); return R.F()}, R.T)(
R.path(['listOptionData', 14, 'value'], this.state)
)
}
// 判断客户名称是否为空
judgeCustomerIsNull() {
let { listOptionData } = this.state
......@@ -1387,6 +1698,18 @@ class SelfOrderPage extends Component {
return true
}
}
/**
* 收单地点为空
* @returns
*/
judgeBillIsNull() {
let {listOptionData } = this.state
return R.ifElse(R.isEmpty, () => {show('请先选择收单地点'); return R.F()}, R.T)(
R.path(['listOptionData', 3, 'value'], this.state)
)
}
// 处理提交后返回的数据
processReturnData() {
let { selfOrderOption } = this.props
......@@ -1475,7 +1798,7 @@ class SelfOrderPage extends Component {
// 返回备注以上的元素
renderListItem() {
let { listOptionData, dateModelPop } = this.state
let { listOptionData, dateModelPop, sysValues } = this.state
return (
<View style={styles.list_cont}>
<PageListArrow
......@@ -1495,6 +1818,58 @@ class SelfOrderPage extends Component {
listCallBack={() => this.handleOrganizationCheck(listOptionData[1])}
listHasArrow={true}
/>
{
sysValues.OBS_MOBILE_DEPARTMENT_DISPLAY > 1 && (
<PageListArrow
listActOpa={.8}
listHasAster={sysValues.OBS_MOBILE_DEPARTMENT_DISPLAY > 2}
listItem={listOptionData[14]}
listName={'name'}
listTitle={'title'}
listCallBack={() => this.handleDepartmentCheck(listOptionData[14], null, 'department_name', 'department_code')}
listHasArrow={true}
/>
)
}
{
sysValues.OBS_MOBILE_BM_DISPLAY > 1 && (
<PageListArrow
listActOpa={.8}
listHasAster={sysValues.OBS_MOBILE_BM_DISPLAY > 2}
listItem={listOptionData[15]}
listName={'name'}
listTitle={'title'}
listCallBack={this.handleDepartmentCheck.bind(this, listOptionData[15], 'business_manager_list', 'business_manager_name', 'business_manager_code')}
listHasArrow={true}
/>
)
}
{
sysValues.OBS_MOBILE_SUR_FOLLOWER_DISPLAY > 1 && (
<PageListArrow
listActOpa={.8}
listHasAster={sysValues.OBS_MOBILE_SUR_FOLLOWER_DISPLAY > 2}
listItem={listOptionData[16]}
listName={'name'}
listTitle={'title'}
listCallBack={this.handleDepartmentCheck.bind(this, listOptionData[16], 'surgery_follower_list', 'surgery_follower_name', 'surgery_follower_code')}
listHasArrow={true}
/>
)
}
{
sysValues.OBS_MOBILE_DELIVERYMAN_DISPLAY > 1 && (
<PageListArrow
listActOpa={.8}
listHasAster={sysValues.OBS_MOBILE_DELIVERYMAN_DISPLAY > 2}
listItem={listOptionData[17]}
listName={'name'}
listTitle={'title'}
listCallBack={this.handleDepartmentCheck.bind(this, listOptionData[17], 'deliveryman_list', 'deliveryman_name', 'deliveryman_code')}
listHasArrow={true}
/>
)
}
<PageListArrow
listActOpa={.8}
listHasAster={true}
......@@ -1601,6 +1976,20 @@ class SelfOrderPage extends Component {
listIsAudio={true}
/>
{
sysValues.OBS_MOBILE_BOR_WARE_REQUIRED > 1 ?
<PageListArrow
listActOpa={.8}
listHasAster={sysValues.OBS_MOBILE_BOR_WARE_REQUIRED > 2}
listItem={listOptionData[18]}
listName={'name'}
listTitle={'title'}
listCallBack={() => this.handleWareCheck(listOptionData[18])}
listHasArrow={true}
/>
: <Text></Text>
}
<DateModel
date={listOptionData[6].dateValue}
closeModal={(show) => this.closeDateModal(show)}
......@@ -1778,7 +2167,7 @@ class SelfOrderPage extends Component {
// url: 'https://obs.uat.sfrx.guke.tech/upload/dingding/image/QDw05sTo.jpg',
// },{
// url: 'https://obs.uat.sfrx.guke.tech/jeecg-boot/sys/common/view/upload/dingding/image/8V4599aH.jpg'
// }]
// }]
// 正式
let zoomImages = []
listOptionData[13].uploadImgArr.forEach(item => {
......@@ -1956,8 +2345,11 @@ const mapDispatchToProps = (dispatch) => {
},
setSelectProductOpts: (data) => {
dispatch(setSelectProductOpts(data))
},
requestQuickSurColSetting: (params) => {
dispatch(requestQuickSurColSetting(params))
}
}
}
export default connect(mapStateToProps, mapDispatchToProps)(SelfOrderPage);
\ No newline at end of file
export default connect(mapStateToProps, mapDispatchToProps)(SelfOrderPage);
......@@ -12,6 +12,7 @@ import { reqPurSupplierSearch, reqProCategorySearch, reqSurTempHeadSearch, reqNa
import LoadingModel from '../../common/listDataComponent/LoadingModel';
import LocalVariable from '../../common/LocalVariable';
import { exitLoginStatus } from '../../../action/LoginAction';
import * as R from 'ramda';
class ChooseProductPage extends Component {
constructor(props) {
......@@ -363,21 +364,16 @@ class ChooseProductPage extends Component {
if (leIndex === leftActiveIndex) {
// 当前选择项
leItem[LocalVariable.SELECTED_QUQNTITY] = count
if (leItem[LocalVariable.LOCAL_SECOND_DATA].length > 0) {
leItem[LocalVariable.SELECTED_DATA_ARR] = []
leItem[LocalVariable.LOCAL_SECOND_DATA].forEach(function (chItem) {
if (chItem[coutFieName]) {
leItem[LocalVariable.SELECTED_DATA_ARR].push(chItem)
}
})
}
const selectData = R.filter(R.compose(R.lt(0), R.prop(coutFieName)))(leItem[LocalVariable.LOCAL_SECOND_DATA])
leItem.selectedArr = selectData
// 原本是赋值给这个对象属性的,但不知道哪里这个对象属性会把第四个以后的所选耗材放到第四个上,
// 所以最后计算的时候使用属性 selectedArr
leItem[LocalVariable.SELECTED_DATA_ARR] = R.clone(selectData)
}
top_sel_sum += leItem[LocalVariable.SELECTED_QUQNTITY]
})
topProcOptionList[topActiveIndex][LocalVariable.SELECTED_QUQNTITY] = top_sel_sum
this.setState({
topProcOptionList
})
this.setState({ topProcOptionList })
}
// 关闭已选弹窗
......@@ -543,7 +539,6 @@ class ChooseProductPage extends Component {
})
}
})
this.setState({
topProcOptionList: topProcOptionList
})
......@@ -798,7 +793,7 @@ class ChooseProductPage extends Component {
})
cur_sel_options[cur_sel_options.length - 1][LocalVariable.SELECTED_DATA_ARR] = cur_hc_arr
}
}
}
return (
<View style={list_common_item.sub_box}>
......@@ -1032,4 +1027,4 @@ const mapDispatchToProps = (dispatch) => {
}
}
export default connect(mapStateToProps, mapDispatchToProps)(ChooseProductPage);
\ No newline at end of file
export default connect(mapStateToProps, mapDispatchToProps)(ChooseProductPage);
......@@ -581,4 +581,4 @@ const mapDispatchToProps = (dispatch) => {
}
}
export default connect(mapStateToProps, mapDispatchToProps)(EditThirdLevelPage);
\ No newline at end of file
export default connect(mapStateToProps, mapDispatchToProps)(EditThirdLevelPage);
......@@ -50,7 +50,8 @@ import {
reqTransSurgeryHospital,
requestSubSourBorOrdNum,
requestListDataSuccess,
reqTransOrganizations
reqTransOrganizations,
reqOrgDepartments
} from '../../action/TransAction';
import { show, dedupQuoteArray, cloneObject } from '../../utils/Utils';
import {
......@@ -66,6 +67,7 @@ import ImagePicker from 'react-native-image-picker';
import { exitLoginStatus, requestSysProfile } from '../../action/LoginAction';
import moment from 'moment';
import PageListArrow from '../common/listDataComponent/PageListArrow';
import * as R from 'ramda';
class TransOrderPage extends Component {
constructor(props) {
......@@ -131,6 +133,12 @@ class TransOrderPage extends Component {
value: '',
isAddImage: true, // 添加图片
uploadImgArr: [] // 上传后的路径
},
{
"id": "9",
title: '部门',
name: '请选择',
value: ''
}
],
subInitListOption: [], // 提交成功后,初始化当前数据
......@@ -140,7 +148,8 @@ class TransOrderPage extends Component {
remark: '', // 备注信息
voice_url: '', // 录音地址
sur_order_transfer_line: '',
img_url: '' // 图片地址
img_url: '', // 图片地址
department_code: '',
// seller_code: '', // 用户名username
// org_code: '', // 组织
......@@ -172,8 +181,11 @@ class TransOrderPage extends Component {
],
isShowImage: false,
currShowImgIndex: 0,
bor_ware_required: 0, // APP目标仓库显示及必填权限
sysValues: {
OBS_MOBILE_BOR_WARE_REQUIRED: 0, // APP目标仓库显示及必填权限
OBS_MOBILE_TRANS_DEPARTMENT_DISPLAY: 0
},
departments: []
}
}
......@@ -489,12 +501,12 @@ class TransOrderPage extends Component {
}
// 清空当前项以下的值
clearInitNameAndValue(curIndex) {
clearInitNameAndValue(startIndex, endIndex = 5) {
let { listOptionData, localOtherObj } = this.state
let that = this
this.setState({
listOptionData: listOptionData.map((item, index) => {
if(index > curIndex && index < 5 ) {
if(index > startIndex && index < endIndex) {
item.name = localOtherObj.name
item.value = localOtherObj.value
if(listOptionData[1].value && item.title == '客户名称') {
......@@ -511,11 +523,11 @@ class TransOrderPage extends Component {
// 判断是否都有值,修改提交按钮的颜色
changeCanSub(isSubCheck) {
let { listOptionData, bor_ware_required } = this.state
let { listOptionData, sysValues } = this.state
let tempStatus = false
let tempTit = ''
let maxIndex = 4
if(bor_ware_required === 3){
if(sysValues.OBS_MOBILE_BOR_WARE_REQUIRED === 3){
maxIndex = 5
}
for(let chIndex in listOptionData) {
......@@ -529,6 +541,10 @@ class TransOrderPage extends Component {
tempTit = `“${listOptionData[chIndex].title}”未添加`
tempStatus = true
break
} else if (chIndex == 9 && sysValues.OBS_MOBILE_TRANS_DEPARTMENT_DISPLAY > 2 && !listOptionData[chIndex].value) {
tempTit = `“${listOptionData[chIndex].title}”未选择`
tempStatus = true
break
}
}
this.setState({
......@@ -553,6 +569,8 @@ class TransOrderPage extends Component {
chItem.value = item.value
if(itemTitle === '组织') {
that.clearInitNameAndValue(1)
that.clearInitNameAndValue(8, 10)
that.getDepartmentsByOrg(item.value)
}
if(itemTitle === '客户名称') {
that.clearInitNameAndValue(2)
......@@ -681,6 +699,7 @@ class TransOrderPage extends Component {
listOptionData
}, () => {
that.organizationGetCustomerData()
that.getDepartmentsByOrg(listOptionData[1].value)
})
}
}else {
......@@ -695,6 +714,70 @@ class TransOrderPage extends Component {
// }
}
/**
* 根据组织获取部门等信息, 其他信息在部门下面
* @param {*} org_code
*/
async getDepartmentsByOrg(org_code) {
const {token, global_domain_config, userInfo} = this.props
const params = {
access_token: token,
org_code,
seller_code: userInfo.user_name,
scope_flag: 'Y'
}
try {
const res = await reqOrgDepartments(global_domain_config, params)
console.log('departments: ', res)
let departments = res.data.relationships
this.setState({ departments })
const {listOptionData, sysValues} = this.state
const noop = () => {}
// 部门只有一个时直接设置
R.cond([
[R.equals(0), () => setTimeout(() => show('当前组织没有部门信息'), 4000)],
[R.equals(1), () => {
const dep = R.head(departments)
listOptionData[9].name = dep.department_name
listOptionData[9].value = dep.department_code
this.setState({ listOptionData })
}],
[R.T, noop]
])(R.length(departments))
} catch (error) {
console.log(error)
}
}
/**
* 部门点击
*/
handleDepCheck(curData) {
if (!this.judgeOrgIsNull()) return
const {departments} = this.state
const listOptions = R.map(
R.applySpec({
name: R.prop('department_name'),
value: R.prop('department_code')
})
)(departments)
this.setState({
currentTitle: curData.title,
currentItem: {
name: curData.name,
value: curData.value
},
showTypePop: true,
listCurrentOption: listOptions
})
}
// 客户名称 点击
handleCustomerCheck(curData) {
let { state, props } = this
......@@ -1098,6 +1181,8 @@ class TransOrderPage extends Component {
tempSubOption.voice_url = state.listOptionData[6].value
tempSubOption.sur_order_transfer_line = state.listOptionData[7].subOption
tempSubOption.img_url = state.listOptionData[8].uploadImgArr.join(',')
tempSubOption.department_code = state.listOptionData[9].value
let params = {
access_token: props.token,
data: { ...tempSubOption }
......@@ -1174,20 +1259,25 @@ class TransOrderPage extends Component {
}
// 获取配置值
async getSysConfigValue() {
let { global_domain_config, token } = this.props
const params = {
access_token: token,
profile_code: 'OBS_MOBILE_BOR_WARE_REQUIRED'
}
let sysRes = await requestSysProfile(global_domain_config, params)
console.log('sysRes:==', sysRes)
if(sysRes.error_code === 0){
this.setState({
bor_ware_required: Number(sysRes.data.profile_value) || 0
})
// }else {
// this.showWarnError(sysRes)
let { global_domain_config, token} = this.props
const {sysValues} = this.state
const log = R.bind(console.log, console)
const getSysProfile = async code => {
const params = {
access_token: token,
profile_code: code,
}
let res = await requestSysProfile(global_domain_config, params)
console.log('sysRes:==', res)
if(res.error_code === 0){
const value = res.data.profile_value
sysValues[code] = isNaN(value) ? value : Number(value)
this.setState({ sysValues })
}
}
R.compose(R.map(getSysProfile), R.keys)(sysValues)
}
showWarnError(res){
if(res.error_code == 41006) {
......@@ -1201,7 +1291,7 @@ class TransOrderPage extends Component {
// 返回备注以上的元素
renderListItem() {
let { listOptionData, bor_ware_required } = this.state
let { listOptionData, sysValues } = this.state
return(
<View style={styles.list_cont}>
<PageListArrow
......@@ -1221,6 +1311,19 @@ class TransOrderPage extends Component {
listCallBack={() => this.handleOrganizationCheck(listOptionData[1])}
listHasArrow={true}
/>
{
sysValues.OBS_MOBILE_TRANS_DEPARTMENT_DISPLAY > 1 && (
<PageListArrow
listActOpa={.8}
listHasAster={sysValues.OBS_MOBILE_TRANS_DEPARTMENT_DISPLAY === 3}
listItem={listOptionData[9]}
listName={'name'}
listTitle={'title'}
listCallBack={() => this.handleDepCheck(listOptionData[9])}
listHasArrow={true}
/>
)
}
<PageListArrow
listActOpa={.8}
listHasAster={true}
......@@ -1241,10 +1344,10 @@ class TransOrderPage extends Component {
listMaxLines={3}
/>
{
bor_ware_required > 1 &&
sysValues.OBS_MOBILE_BOR_WARE_REQUIRED > 1 &&
<PageListArrow
listActOpa={.8}
listHasAster={bor_ware_required === 3}
listHasAster={sysValues.OBS_MOBILE_BOR_WARE_REQUIRED === 3}
listItem={listOptionData[4]}
listName={'name'}
listTitle={'title'}
......
......@@ -59,4 +59,4 @@ export const UploadRequest = (BaseUrl, url,datas) => {
console.error(error)
return {error_code: -3, error_msg:'请求异常,请重试'}
})
};
\ No newline at end of file
};
......@@ -7,7 +7,8 @@ import {
AUTO_LOGIN_SUCCESS,
AUTO_LOGIN_FAILURE,
SET_DOMAIN_CONFIGURATE,
SET_VERSION_APK
SET_VERSION_APK,
SET_DOMAIN_FROM_ORIGIN
} from '../../base/ActionTypes';
// 登录状态
......@@ -18,6 +19,7 @@ const defaultState = {
username:'',
password:'',
global_domain_config: 'https://obs.uat.guke.tech',
hasSetDomainFromOrigin: false,
local_version_apk: '',
// 默认【深圳仓】https://obs.uat.guke.tech;【十方uat】https://obs.uat.sfrx.guke.tech;【十方pro】https://obs.sfrx.orth.tech
// 【国药dev】https://obs.dev.guke.tech;【国药pro】https://obs-pro.gyjtsx.com
......@@ -26,7 +28,7 @@ const defaultState = {
export default login = (state = defaultState, action) => {
switch (action.type) {
case LOGIN_DOING:
case LOGIN_DOING:
return Object.assign({}, state, {
loginState: LOGIN_DOING
});
......@@ -59,15 +61,19 @@ export default login = (state = defaultState, action) => {
return Object.assign({}, state, {
loginState: LOGIN_FAILURE
});
case SET_DOMAIN_CONFIGURATE:
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
})
default: // need this for default case
return state
return state
}
}
\ No newline at end of file
}
import Toast from 'react-native-root-toast';
import { Dimensions, Platform, NativeModules, PixelRatio, Text } from "react-native";
import * as R from 'ramda';
/**
* 提示框
......@@ -319,3 +320,10 @@ export const showErrorMessage = (dispatch, err, errorCallback, logTit) => {
show(error_msg);
dispatch(errorCallback());
}
/**
* 空值或空判断
*/
export const isBlank = R.anyPass([R.isNil, R.isEmpty])
export const isNotBlank = R.complement(isBlank)
......@@ -22,7 +22,6 @@
13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; };
13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; };
140ED2AC1D01E1AD002B40FF /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 146834041AC3E56700842450 /* libReact.a */; };
146834051AC3E58100842450 /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 146834041AC3E56700842450 /* libReact.a */; };
2D02E4BC1E0B4A80006451C7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.m */; };
2D02E4BD1E0B4A84006451C7 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; };
2D02E4BF1E0B4AB3006451C7 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; };
......@@ -42,6 +41,7 @@
A32499D5AE884F6F872774E4 /* libRNGestureHandler-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A3D4AB90D45046B6BFE7C6D9 /* libRNGestureHandler-tvOS.a */; };
AB5CF7B125F35664008DF3C6 /* libSplashScreen.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 98464320248115E6000A6140 /* libSplashScreen.a */; };
AB5CF7B225F3568D008DF3C6 /* libRNAudio.a in Frameworks */ = {isa = PBXBuildFile; fileRef = ECD74ED82474DDFC005B4208 /* libRNAudio.a */; };
ABDDF166261577F5009E84C3 /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 146834041AC3E56700842450 /* libReact.a */; };
ABFEE38D25F36AC400727C35 /* libCodePush.a in Frameworks */ = {isa = PBXBuildFile; fileRef = ABB463F125F0C45400F9E705 /* libCodePush.a */; };
ABFEE38E25F36AE800727C35 /* libRNFetchBlob.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 9867E22025BED25B00C29E9D /* libRNFetchBlob.a */; };
ABFEE44225F37BE200727C35 /* libRNGestureHandler.a in Frameworks */ = {isa = PBXBuildFile; fileRef = ECD74ECB2474DDFC005B4208 /* libRNGestureHandler.a */; };
......@@ -493,9 +493,9 @@
buildActionMask = 2147483647;
files = (
ED297163215061F000B7C4FE /* JavaScriptCore.framework in Frameworks */,
ABDDF166261577F5009E84C3 /* libReact.a in Frameworks */,
ADBDB9381DFEBF1600ED6528 /* libRCTBlob.a in Frameworks */,
11D1A2F320CAFA9E000508D9 /* libRCTAnimation.a in Frameworks */,
146834051AC3E58100842450 /* libReact.a in Frameworks */,
00C302E51ABCBA2D00DB3ED1 /* libRCTActionSheet.a in Frameworks */,
00C302E71ABCBA2D00DB3ED1 /* libRCTGeolocation.a in Frameworks */,
00C302E81ABCBA2D00DB3ED1 /* libRCTImage.a in Frameworks */,
......@@ -1676,12 +1676,12 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = "";
CODEPUSH_KEY = "";
CURRENT_PROJECT_VERSION = 1.2.11;
CURRENT_PROJECT_VERSION = 1.2.13;
DEAD_CODE_STRIPPING = NO;
DEVELOPMENT_TEAM = 2BWXWUS2NV;
FRAMEWORK_SEARCH_PATHS = "";
HEADER_SEARCH_PATHS = (
"$(inherited)",
"$(inherited)/**",
"$(SRCROOT)/../node_modules/react-native/React/**",
"$(SRCROOT)/../node_modules/react-native-audio/ios",
"$(SRCROOT)/../node_modules/react-native-gesture-handler/ios/**",
......@@ -1707,8 +1707,9 @@
"$(SRCROOT)/../node_modules/react-native-fs/**",
"$(SRCROOT)/../node_modules/rn-fetch-blob/**",
"$(SRCROOT)/../node_modules/react-native-splash-screen/ios/build/**",
"$(SRCROOT)/../node_modules/react-native/**",
);
MARKETING_VERSION = 1.2.10;
MARKETING_VERSION = 1.2.11;
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
......@@ -1728,11 +1729,11 @@
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = "";
CODEPUSH_KEY = "PanMvkUOw_lNr2S5F-LG0nzMjj0Mo49v-wxeWm";
CODE_SIGN_IDENTITY = "Apple Development";
CURRENT_PROJECT_VERSION = 1.2.11;
CURRENT_PROJECT_VERSION = 1.2.13;
DEVELOPMENT_TEAM = 2BWXWUS2NV;
FRAMEWORK_SEARCH_PATHS = "";
HEADER_SEARCH_PATHS = (
"$(inherited)",
"$(inherited)/**",
"$(SRCROOT)/../node_modules/react-native/React/**",
"$(SRCROOT)/../node_modules/react-native-audio/ios",
"$(SRCROOT)/../node_modules/react-native-gesture-handler/ios/**",
......@@ -1742,7 +1743,7 @@
"$(SRCROOT)/../node_modules/react-native-image-picker/ios",
"$(SRCROOT)/../node_modules/react-native-date-picker/ios/RNDatePicker",
"$(SRCROOT)/../node_modules/react-native-fs/**",
"$(SRCROOT)/../node_modules/rn-fetch-blob/ios/**",
"$(SRCROOT)/../node_modules/rn-fetch-blob/**",
"$(SRCROOT)/../node_modules/react-native-code-push/ios/CodePush/**",
);
INFOPLIST_FILE = BoneHouse_Business_APP/Info.plist;
......@@ -1758,8 +1759,9 @@
"$(SRCROOT)/../node_modules/react-native-fs/**",
"$(SRCROOT)/../node_modules/rn-fetch-blob/**",
"$(SRCROOT)/../node_modules/react-native-splash-screen/ios/build/**",
"$(SRCROOT)/../node_modules/react-native/**",
);
MARKETING_VERSION = 1.2.10;
MARKETING_VERSION = 1.2.11;
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
......@@ -2007,6 +2009,8 @@
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
SYSTEM_HEADER_SEARCH_PATHS = "$(SRCROOT)/../node_modules/react-native/React/**";
USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/../node_modules/react-native/React/**";
};
name = Debug;
};
......@@ -2053,6 +2057,8 @@
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SYSTEM_HEADER_SEARCH_PATHS = "$(SRCROOT)/../node_modules/react-native/React/**";
USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/../node_modules/react-native/React/**";
VALIDATE_PRODUCT = YES;
};
name = Release;
......@@ -2100,6 +2106,8 @@
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SYSTEM_HEADER_SEARCH_PATHS = "$(SRCROOT)/../node_modules/react-native/React/**";
USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/../node_modules/react-native/React/**";
VALIDATE_PRODUCT = YES;
};
name = Staging;
......@@ -2111,7 +2119,7 @@
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = "";
CODEPUSH_KEY = "0Jf6O1u52LayZPBbWMss7v-AZStc-LBdjjw9j";
CODE_SIGN_IDENTITY = "Apple Development";
CURRENT_PROJECT_VERSION = 1.2.11;
CURRENT_PROJECT_VERSION = 1.2.13;
DEVELOPMENT_TEAM = 2BWXWUS2NV;
HEADER_SEARCH_PATHS = (
"$(inherited)/**",
......@@ -2130,7 +2138,19 @@
INFOPLIST_FILE = BoneHouse_Business_APP/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 1.2.10;
LIBRARY_SEARCH_PATHS = (
"$(SRCROOT)/../node_modules/react-native-audio/**",
"$(SRCROOT)/../node_modules/react-native-gesture-handler/**",
"$(SRCROOT)/../node_modules/react-native-sound/**",
"$(SRCROOT)/../node_modules/react-native-camera/**",
"$(SRCROOT)/../node_modules/react-native-image-picker/**",
"$(SRCROOT)/../node_modules/react-native-date-picker/**",
"$(SRCROOT)/../node_modules/react-native-fs/**",
"$(SRCROOT)/../node_modules/rn-fetch-blob/**",
"$(SRCROOT)/../node_modules/react-native-splash-screen/ios/build/**",
"$(SRCROOT)/../node_modules/react-native/**",
);
MARKETING_VERSION = 1.2.11;
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
......
......@@ -119,7 +119,7 @@
buildConfiguration = "Release">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Staging"
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
......@@ -4,8 +4,11 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#if __has_include(<React/RCTBridgeDelegate.h>)
#import <React/RCTBridgeDelegate.h>
#else
#import "RCTBridgeDelegate.h"
#endif
#import <UIKit/UIKit.h>
@interface AppDelegate : UIResponder <UIApplicationDelegate, RCTBridgeDelegate>
......
......@@ -6,10 +6,15 @@
*/
#import "AppDelegate.h"
#if __has_include(<React/RCTBridge.h>)
#import <React/RCTBridge.h>
#import <React/RCTBundleURLProvider.h>
#import <React/RCTRootView.h>
#else
#import "RCTBridge.h"
#import "RCTBundleURLProvider.h"
#import "RCTRootView.h"
#endif
#import "CodePush.h"
#import "RNSplashScreen.h" // 导入启动页组件库
......
......@@ -17,7 +17,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.2.5</string>
<string>1.2.6</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
......
......@@ -7,9 +7,14 @@
#import <UIKit/UIKit.h>
#import <XCTest/XCTest.h>
#if __has_include(<React/RCTLog.h>)
#import <React/RCTLog.h>
#import <React/RCTRootView.h>
#else
#import "RCTLog.h"
#import "RCTRootView.h"
#endif
#define TIMEOUT_SECONDS 600
#define TEXT_TO_LOOK_FOR @"Welcome to React Native!"
......
......@@ -13,8 +13,11 @@
#endif /* RNToolsManager_h */
#import <Foundation/Foundation.h>
//#import <React/RCTBridgeModule.h>
#if __has_include(<React/RCTBridgeModule.h>)
#import <React/RCTBridgeModule.h>
#else
#import "RCTBridgeModule.h"
#endif
@interface RNToolsManager : NSObject <RCTBridgeModule>
......
......@@ -7,8 +7,8 @@
//
#import <Foundation/Foundation.h>
#import "RNToolsManager.h"
@implementation RNToolsManager
@synthesize bridge = _bridge;
......
{
"name": "BoneHouse_Business_APP",
"version": "1.2.5",
"version": "1.2.6",
"private": true,
"scripts": {
"postinstall": "npx jetify",
......@@ -8,7 +8,9 @@
"test": "jest"
},
"dependencies": {
"@types/ramda": "^0.27.39",
"moment": "2.29.1",
"ramda": "^0.27.1",
"react": "16.8.3",
"react-native": "0.59.9",
"react-native-audio": "4.3.0",
......
......@@ -937,6 +937,13 @@
"@types/istanbul-lib-coverage" "*"
"@types/istanbul-lib-report" "*"
"@types/ramda@^0.27.39":
version "0.27.39"
resolved "https://registry.npm.taobao.org/@types/ramda/download/@types/ramda-0.27.39.tgz?cache=0&sync_timestamp=1615893039310&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40types%2Framda%2Fdownload%2F%40types%2Framda-0.27.39.tgz#7541d9d745a2003c8f635897dff8c65c12be9327"
integrity sha1-dUHZ10WiADyPY1iX3/jGXBK+kyc=
dependencies:
ts-toolbelt "^6.15.1"
"@types/stack-utils@^1.0.1":
version "1.0.1"
resolved "https://registry.npm.taobao.org/@types/stack-utils/download/@types/stack-utils-1.0.1.tgz?cache=0&sync_timestamp=1605057309059&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40types%2Fstack-utils%2Fdownload%2F%40types%2Fstack-utils-1.0.1.tgz#0a851d3bd96498fa25c33ab7278ed3bd65f06c3e"
......@@ -5155,6 +5162,11 @@ querystringify@^2.1.1:
resolved "https://registry.npm.taobao.org/querystringify/download/querystringify-2.2.0.tgz#3345941b4153cb9d082d8eee4cda2016a9aef7f6"
integrity sha1-M0WUG0FTy50ILY7uTNogFqmu9/Y=
ramda@^0.27.1:
version "0.27.1"
resolved "https://registry.npm.taobao.org/ramda/download/ramda-0.27.1.tgz#66fc2df3ef873874ffc2da6aa8984658abacf5c9"
integrity sha1-Zvwt8++HOHT/wtpqqJhGWKus9ck=
randomatic@^3.0.0:
version "3.1.1"
resolved "https://registry.npm.taobao.org/randomatic/download/randomatic-3.1.1.tgz#b776efc59375984e36c537b2f51a1f0aff0da1ed"
......@@ -6519,6 +6531,11 @@ tr46@^1.0.1:
dependencies:
punycode "^2.1.0"
ts-toolbelt@^6.15.1:
version "6.15.5"
resolved "https://registry.npm.taobao.org/ts-toolbelt/download/ts-toolbelt-6.15.5.tgz#cb3b43ed725cb63644782c64fbcad7d8f28c0a83"
integrity sha1-yztD7XJctjZEeCxk+8rX2PKMCoM=
tslib@^1.9.0:
version "1.14.1"
resolved "https://registry.npm.taobao.org/tslib/download/tslib-1.14.1.tgz?cache=0&sync_timestamp=1609887539329&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Ftslib%2Fdownload%2Ftslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00"
......
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