Commit 52dcff53 by peii

Merge branch 'develop' into product

parents b6332fa9 22bcd25a
...@@ -140,7 +140,7 @@ android { ...@@ -140,7 +140,7 @@ android {
} }
buildTypes { buildTypes {
debug { debug {
resValue "string", "CodePushDeploymentKey", '"OQxOHKC_pU5KPExPvQLLfeOdhO4_zss5pKduM"' resValue "string", "CodePushDeploymentKey", '""'
resValue 'string', "CODE_PUSH_APK_BUILD_TIME", String.format("\"%d\"", System.currentTimeMillis()) resValue 'string', "CODE_PUSH_APK_BUILD_TIME", String.format("\"%d\"", System.currentTimeMillis())
} }
release { release {
...@@ -162,7 +162,7 @@ android { ...@@ -162,7 +162,7 @@ android {
resValue "string", "baseUrl", '"https://obs.uat.guke.tech"' resValue "string", "baseUrl", '"https://obs.uat.guke.tech"'
} }
xhk { xhk {
resValue "string", "baseUrl", '"https://obs.xhk.orth.tech"' resValue "string", "baseUrl", '"https://obs.dev.xhk.guke.tech"'
} }
bjzr { bjzr {
resValue "string", "baseUrl", '"https://hos.dev.bjhh.guke.tech"' resValue "string", "baseUrl", '"https://hos.dev.bjhh.guke.tech"'
...@@ -170,6 +170,9 @@ android { ...@@ -170,6 +170,9 @@ android {
gyxj { gyxj {
resValue "string", "baseUrl", '"http://190.3.1.42"' resValue "string", "baseUrl", '"http://190.3.1.42"'
} }
hzngz {
resValue "string", "baseUrl", '"https://obs.hzn.orth.tech"'
}
} }
// applicationVariants are e.g. debug, release // applicationVariants are e.g. debug, release
......
...@@ -1266,6 +1266,40 @@ class SelfOrderPage extends Component { ...@@ -1266,6 +1266,40 @@ class SelfOrderPage extends Component {
// 选择产品 点击跳转 // 选择产品 点击跳转
handleProductCheck() { handleProductCheck() {
const { localCustomersOption, listOptionData } = this.state
console.log(localCustomersOption);
if (isBlank(listOptionData[2].value) || isBlank(listOptionData[3].value) || isBlank(listOptionData[4].value)) {
return show('请先选择客户相关信息')
}
const customer = R.find(R.propEq('customer_code', listOptionData[2].value))(localCustomersOption)
const billToSite = R.find(R.propEq('bill_to_site_code', listOptionData[3].value))(customer.bill_to_sites)
const shipToSites = R.filter(R.propEq('ship_to_site_code', listOptionData[4].value))(billToSite.ship_to_sites)
const productAuthorization = R.pathOr('N', [0, 'sal_seller_customer_product_authorization'])(shipToSites)
let authorizations = []
if (productAuthorization === 'Y') {
const auths = R.compose(R.unnest, R.pluck('authorization'))(shipToSites)
const suppliers = R.groupBy(R.prop('supplier_code'))(auths)
authorizations = R.compose(
R.map(key => {
const values = suppliers[key]
return {
product_line_category_list: R.compose(
R.uniqBy(R.prop('product_line_category_code')),
R.unnest,
R.pluck('product_line_category_list')
)(values),
supplier_code: R.pathOr('', [0, 'supplier_code'])(values),
supplier_name: R.pathOr('', [0, 'supplier_name'])(values),
}
}),
R.keys,
R.clone
)(suppliers)
}
if (this.judgeOrgIsNull()) { if (this.judgeOrgIsNull()) {
let { listOptionData } = this.state let { listOptionData } = this.state
let that = this let that = this
...@@ -1273,7 +1307,9 @@ class SelfOrderPage extends Component { ...@@ -1273,7 +1307,9 @@ class SelfOrderPage extends Component {
title: `选择产品`, title: `选择产品`,
selfData: { selfData: {
org_code: listOptionData[1].value, org_code: listOptionData[1].value,
doctor_name: (listOptionData[5].name == '其他' || listOptionData[5].name == '请选择') ? listOptionData[5].inputValue : listOptionData[5].name doctor_name: (listOptionData[5].name == '其他' || listOptionData[5].name == '请选择') ? listOptionData[5].inputValue : listOptionData[5].name,
authorizations,
productAuthorization
}, },
productCallBack: that.productCallBack.bind(that) productCallBack: that.productCallBack.bind(that)
}) })
......
...@@ -9,7 +9,7 @@ import ProductRightStyle from './ProductRightStyle'; ...@@ -9,7 +9,7 @@ import ProductRightStyle from './ProductRightStyle';
import ProductModel from '../../common/ProductModel'; import ProductModel from '../../common/ProductModel';
import StatusBarView from '../../common/StatusBarView'; import StatusBarView from '../../common/StatusBarView';
import ChooseCardList from '../../common/listDataComponent/ChooseCardList'; import ChooseCardList from '../../common/listDataComponent/ChooseCardList';
import { cloneObject, show, isNotBlank } from '../../../utils/Utils'; import { cloneObject, show, isNotBlank, isBlank } from '../../../utils/Utils';
import { reqPurSupplierSearch, reqProCategorySearch, reqSurTempHeadSearch, reqNailEquipHeadSearch, reqScatEquipmentSearch, reqSingleConsumSearch, setSelectProductOpts } from '../../../action/SelfAction'; import { reqPurSupplierSearch, reqProCategorySearch, reqSurTempHeadSearch, reqNailEquipHeadSearch, reqScatEquipmentSearch, reqSingleConsumSearch, setSelectProductOpts } from '../../../action/SelfAction';
import LoadingModel from '../../common/listDataComponent/LoadingModel'; import LoadingModel from '../../common/listDataComponent/LoadingModel';
import LocalVariable from '../../common/LocalVariable'; import LocalVariable from '../../common/LocalVariable';
...@@ -77,22 +77,27 @@ class ChooseProductPage extends Component { ...@@ -77,22 +77,27 @@ class ChooseProductPage extends Component {
options: [], options: [],
value: '', value: '',
type: 'select' type: 'select'
}] }],
productAuthorization: 'N',
authorizations: []
} }
this.inputSearchValue = debounce(this.inputSearchValue.bind(this), 500) this.inputSearchValue = debounce(this.inputSearchValue.bind(this), 500)
} }
componentDidMount() { componentDidMount() {
this.initGetData() const {authorizations = [], productAuthorization = 'N'} = R.pathOr({}, ['state', 'params', 'selfData'])(this.props.navigation)
this.setState({authorizations, productAuthorization}, () => {
this.initGetData()
})
} }
// 返回 // 返回
handleGoBack() { handleGoBack() {
let { topProcOptionList } = this.state let { topProcOptionList, originManufacterList } = this.state
let { setSelectProductOpts } = this.props let { setSelectProductOpts } = this.props
setSelectProductOpts(topProcOptionList) setSelectProductOpts(originManufacterList)
this.props.navigation.state.params.productCallBack(topProcOptionList) this.props.navigation.state.params.productCallBack(originManufacterList)
this.props.navigation.goBack() this.props.navigation.goBack()
} }
...@@ -100,12 +105,28 @@ class ChooseProductPage extends Component { ...@@ -100,12 +105,28 @@ class ChooseProductPage extends Component {
async initGetData() { async initGetData() {
let that = this let that = this
let { token, global_domain_config, navigation, local_sele_pro_options } = that.props let { token, global_domain_config, navigation, local_sele_pro_options } = that.props
let { productAuthorization, authorizations } = this.state
if (local_sele_pro_options && local_sele_pro_options.length > 0) { if (local_sele_pro_options && local_sele_pro_options.length > 0) {
let list = local_sele_pro_options
if (productAuthorization === 'Y') {
const filterSuppliers = R.pluck('supplier_code', authorizations)
if (isNotBlank(filterSuppliers)) {
list = R.filter(R.propSatisfies(R.includes(R.__, filterSuppliers), 'supplier_code'))(local_sele_pro_options)
} else {
list = []
}
}
// 之前选择过值 // 之前选择过值
that.setState({ that.setState({
topProcOptionList: local_sele_pro_options topProcOptionList: list,
originManufacterList: local_sele_pro_options
}, () => { }, () => {
that.handleTopNav(local_sele_pro_options[0], 0) if (isNotBlank(list)) {
that.handleTopNav(list[0], 0)
}
}) })
return return
} }
...@@ -135,11 +156,25 @@ class ChooseProductPage extends Component { ...@@ -135,11 +156,25 @@ class ChooseProductPage extends Component {
topObj.supplier_short_name = topObj.supplier_name.substring(0, 3) topObj.supplier_short_name = topObj.supplier_name.substring(0, 3)
} }
}) })
let list = topProcOptionList
if (productAuthorization === 'Y') {
const filterSuppliers = R.pluck('supplier_code', authorizations)
if (isNotBlank(filterSuppliers)) {
list = R.filter(R.propSatisfies(R.includes(R.__, filterSuppliers), 'supplier_code'))(topProcOptionList)
} else {
list = []
}
}
that.setState({ that.setState({
topProcOptionList topProcOptionList: list,
originManufacterList: topProcOptionList,
}, () => { }, () => {
that.refs.LoadingModel.hide() that.refs.LoadingModel.hide()
that.handleTopNav(topProcOptionList[0], 0) if (isNotBlank(list)) {
that.handleTopNav(list[0], 0)
}
}) })
} else { } else {
this.refs.LoadingModel.hide() this.refs.LoadingModel.hide()
...@@ -653,7 +688,19 @@ class ChooseProductPage extends Component { ...@@ -653,7 +688,19 @@ class ChooseProductPage extends Component {
* @return {*} * @return {*}
*/ */
rightFilter(list = []) { rightFilter(list = []) {
const {filterData} = this.state const {filterData, authorizations, productAuthorization, topActiveIndex, topProcOptionList} = this.state
if (productAuthorization === 'Y') {
const curSupplier = topProcOptionList[topActiveIndex]
const auth = R.find(R.propEq('supplier_code', curSupplier.supplier_code))(authorizations)
if (isNotBlank(auth) && isNotBlank(auth.product_line_category_list)) {
const typeCodes = R.pluck('product_line_category_name', auth.product_line_category_list)
list = R.filter(R.propSatisfies(R.includes(R.__, typeCodes), 'surgery_type'))(list)
} else {
list = []
}
}
R.compose(R.map(filter => { R.compose(R.map(filter => {
const value = filter.value const value = filter.value
if (isNotBlank(value)) { if (isNotBlank(value)) {
...@@ -668,15 +715,40 @@ class ChooseProductPage extends Component { ...@@ -668,15 +715,40 @@ class ChooseProductPage extends Component {
/** /**
* @description: 搜索过滤 * @description: 搜索过滤
* @param {*} * @param {array} list 要过滤的数组
* @param {boolean} isChildFilter 子组件调用(三级调用)
* @return {*} * @return {*}
*/ */
rightNameFilter(list = []) { rightNameFilter(list = [], isChildFilter = false) {
const {searchValue} = this.state if(isBlank(list)) return []
const {searchValue, authorizations, productAuthorization, topActiveIndex, topProcOptionList } = this.state
if (productAuthorization === 'Y') {
const curSupplier = topProcOptionList[topActiveIndex]
const auth = R.find(R.propEq('supplier_code', curSupplier.supplier_code))(authorizations)
if (isNotBlank(auth) && isNotBlank(auth.product_line_category_list)) {
const typeCodes = R.pluck('product_line_category_code', auth.product_line_category_list)
if (R.compose(R.isNil, R.path([0, 'details']) || isChildFilter)(list)) {
list = R.filter(R.propSatisfies(R.includes(R.__, typeCodes), 'product_line_category_code'))(list)
}
} else {
list = []
}
}
if (isBlank(searchValue)) return list
const keys = ['general_name', 'item_name', 'specification', 'manufacturer_product_code', 'initials_pinyin', 'serial_number', 'category_name']
const includes = item => { const includes = item => {
const reg = new RegExp(searchValue, 'g') const preds = R.compose(
return R.test(reg, item.general_name) || R.test(reg, item.item_name) R.map(val => R.includes(R.__, val)),
R.filter(isNotBlank),
R.map(key => item[key])
)(keys)
return R.anyPass(preds)(searchValue)
} }
return R.filter(includes, list) return R.filter(includes, list)
} }
...@@ -769,7 +841,7 @@ class ChooseProductPage extends Component { ...@@ -769,7 +841,7 @@ class ChooseProductPage extends Component {
// 返回右侧二级数据 // 返回右侧二级数据
renderContItem() { renderContItem() {
let { leftActiveIndex, defaultThridShow, topProcOptionList, topActiveIndex} = this.state let { leftActiveIndex, defaultThridShow, topProcOptionList, topActiveIndex, searchValue } = this.state
let curRigSecoOption = [] let curRigSecoOption = []
let curSuperLeftOption = [] let curSuperLeftOption = []
let topItem = topProcOptionList[topActiveIndex] let topItem = topProcOptionList[topActiveIndex]
...@@ -799,6 +871,7 @@ class ChooseProductPage extends Component { ...@@ -799,6 +871,7 @@ class ChooseProductPage extends Component {
superCallBack={(count, coutFieName) => this.handleChangeCount(count, coutFieName)} superCallBack={(count, coutFieName) => this.handleChangeCount(count, coutFieName)}
superReduceBack={() => this.handleSubSelected()} superReduceBack={() => this.handleSubSelected()}
superLeftData={curSuperLeftOption} superLeftData={curSuperLeftOption}
rightNameFilter={this.rightNameFilter.bind(this)}
/> />
</View> </View>
) )
......
import React, { Component } from 'react'; import React, { Component } from 'react';
import { View, Text, StyleSheet, TouchableOpacity, Image, ScrollView, FlatList, SafeAreaView } from 'react-native'; import { View, Text, StyleSheet, TouchableOpacity, Image, ScrollView, FlatList, SafeAreaView } from 'react-native';
import * as R from "ramda";
import { third_text_color, foundation_color, second_text_size, Width, pxSize, font_family_regular, icon_style } from '../../../base/BaseStyle'; import { third_text_color, foundation_color, second_text_size, Width, pxSize, font_family_regular, icon_style } from '../../../base/BaseStyle';
import PicTitDetaiCalcu from '../../common/listDataComponent/PicTitDetaiCalcu'; import PicTitDetaiCalcu from '../../common/listDataComponent/PicTitDetaiCalcu';
import { cloneObject } from '../../../utils/Utils'; import { cloneObject, isBlank, isNotBlank} from '../../../utils/Utils';
import { PicListNoData } from '../../common/CellTextStyle'; import { PicListNoData } from '../../common/CellTextStyle';
import _ from "lodash"; import _ from "lodash";
import { connect } from 'react-redux'; import { connect } from 'react-redux';
...@@ -156,11 +157,10 @@ class ProductRightStyle extends Component { ...@@ -156,11 +157,10 @@ class ProductRightStyle extends Component {
// 修改当前小类是否展示 // 修改当前小类是否展示
changeThrShow(show, superItem, superIndex) { changeThrShow(show, superItem, superIndex) {
let { curThridObj, rowSingleData } = this.state let { curThridObj, rowSingleData, lastInputText } = this.state
let that = this let that = this
if (show && superItem) { if (show && superItem) {
// 大类点击标题 // 大类点击标题
let curRowData = cloneObject(superItem['details'])
curThridObj = { curThridObj = {
superItem: superItem, superItem: superItem,
superIndex: superIndex, superIndex: superIndex,
...@@ -169,7 +169,7 @@ class ProductRightStyle extends Component { ...@@ -169,7 +169,7 @@ class ProductRightStyle extends Component {
that.setState({ that.setState({
thridIsVisible: show, thridIsVisible: show,
curThridObj: curThridObj, curThridObj: curThridObj,
rowSingleData: curRowData rowSingleData: R.clone(superItem['details'])
}) })
this.props.changeThrShow(show) this.props.changeThrShow(show)
} else { } else {
...@@ -177,7 +177,7 @@ class ProductRightStyle extends Component { ...@@ -177,7 +177,7 @@ class ProductRightStyle extends Component {
if (curThridObj.superItem) { if (curThridObj.superItem) {
let curDa = curThridObj.superItem let curDa = curThridObj.superItem
let curInd = curThridObj.superIndex let curInd = curThridObj.superIndex
curDa.details = cloneObject(rowSingleData) curDa.details = R.clone(rowSingleData)
curDa[LocalVariable.QUANTITY_FIELD] = 0 curDa[LocalVariable.QUANTITY_FIELD] = 0
curDa.details.forEach(itVal => { curDa.details.forEach(itVal => {
if (itVal[LocalVariable.QUANTITY_FIELD] > 0) { if (itVal[LocalVariable.QUANTITY_FIELD] > 0) {
...@@ -186,7 +186,8 @@ class ProductRightStyle extends Component { ...@@ -186,7 +186,8 @@ class ProductRightStyle extends Component {
}) })
that.handleCalCallBack(curDa, curInd, 'rightSecondData', LocalVariable.QUANTITY_FIELD) that.handleCalCallBack(curDa, curInd, 'rightSecondData', LocalVariable.QUANTITY_FIELD)
that.setState({ that.setState({
thridIsVisible: show thridIsVisible: show,
lastInputText: ''
}) })
this.props.changeThrShow(show) this.props.changeThrShow(show)
} }
...@@ -334,13 +335,16 @@ class ProductRightStyle extends Component { ...@@ -334,13 +335,16 @@ class ProductRightStyle extends Component {
// 耗材 -- 小类每一列 // 耗材 -- 小类每一列
renderThridItem(item, index) { renderThridItem(item, index) {
let { rowSingleData } = this.state
const idx = R.findIndex(R.propEq('item_code', item.item_code))(rowSingleData)
return ( return (
<SafeAreaView style={styles.thr_container} key={'item_code' + index}> <SafeAreaView style={styles.thr_container} key={'item_code' + index}>
<PicTitDetaiCalcu <PicTitDetaiCalcu
listItem={item} listItem={item}
listIndex={index} listIndex={idx}
calField={LocalVariable.QUANTITY_FIELD} calField={LocalVariable.QUANTITY_FIELD}
subCalCallBack={(item, index) => this.handleCalCallBack(item, index, 'rowSingleData')} subCalCallBack={(item, idx) => this.handleCalCallBack(item, idx, 'rowSingleData')}
titText={'manufacturer_product_code'} titText={'manufacturer_product_code'}
tipTextStr={'item_name'} tipTextStr={'item_name'}
tipTextOne={'general_name'} tipTextOne={'general_name'}
...@@ -358,12 +362,14 @@ class ProductRightStyle extends Component { ...@@ -358,12 +362,14 @@ class ProductRightStyle extends Component {
// 耗材 -- 小类 // 耗材 -- 小类
renderThridStyle() { renderThridStyle() {
let { rowSingleData } = this.state let { rowSingleData } = this.state
let data = this.props.rightNameFilter(rowSingleData, true)
return ( return (
<View style={styles.stencil_cont}> <View style={styles.stencil_cont}>
<FlatList <FlatList
style={styles.cont_thr_list} style={styles.cont_thr_list}
keyExtractor={item => item.id} keyExtractor={item => item.id}
data={rowSingleData} data={data}
extraData={this.state} extraData={this.state}
renderItem={({ item, index }) => this.renderThridItem(item, index)} renderItem={({ item, index }) => this.renderThridItem(item, index)}
/> />
......
...@@ -903,6 +903,11 @@ ...@@ -903,6 +903,11 @@
resolved "https://registry.yarnpkg.com/@react-native-community/slider/-/slider-3.0.3.tgz#830167fd757ba70ac638747ba3169b2dbae60330" resolved "https://registry.yarnpkg.com/@react-native-community/slider/-/slider-3.0.3.tgz#830167fd757ba70ac638747ba3169b2dbae60330"
integrity sha512-8IeHfDwJ9/CTUwFs6x90VlobV3BfuPgNLjTgC6dRZovfCWigaZwVNIFFJnHBakK3pW2xErAPwhdvNR4JeNoYbw== integrity sha512-8IeHfDwJ9/CTUwFs6x90VlobV3BfuPgNLjTgC6dRZovfCWigaZwVNIFFJnHBakK3pW2xErAPwhdvNR4JeNoYbw==
"@react-native-community/viewpager@^2.0.1":
version "2.0.2"
resolved "https://r.cnpmjs.org/@react-native-community/viewpager/download/@react-native-community/viewpager-2.0.2.tgz#622b190294b1310c4825c98daeaee1c8443f7124"
integrity sha1-YisZApSxMQxIJcmNrq7hyEQ/cSQ=
"@react-navigation/core@~3.4.1": "@react-navigation/core@~3.4.1":
version "3.4.2" version "3.4.2"
resolved "https://registry.npm.taobao.org/@react-navigation/core/download/@react-navigation/core-3.4.2.tgz#bec563e94fde40fbab3730cdc97f22afbb2a1498" resolved "https://registry.npm.taobao.org/@react-navigation/core/download/@react-navigation/core-3.4.2.tgz#bec563e94fde40fbab3730cdc97f22afbb2a1498"
...@@ -5426,11 +5431,12 @@ react-native-safe-area-view@^0.14.1: ...@@ -5426,11 +5431,12 @@ react-native-safe-area-view@^0.14.1:
dependencies: dependencies:
debounce "^1.2.0" debounce "^1.2.0"
react-native-scrollable-tab-view@0.9.0: react-native-scrollable-tab-view@^1.0.0:
version "0.9.0" version "1.0.0"
resolved "https://registry.npm.taobao.org/react-native-scrollable-tab-view/download/react-native-scrollable-tab-view-0.9.0.tgz#cf8c09018f1e1c88bb26db6a003c90de275a1c6f" resolved "https://r.cnpmjs.org/react-native-scrollable-tab-view/download/react-native-scrollable-tab-view-1.0.0.tgz#87319896067f7bb643ecd7fba2cba4d6d8f9e18b"
integrity sha1-z4wJAY8eHIi7JttqADyQ3idaHG8= integrity sha1-hzGYlgZ/e7ZD7Nf7osuk1tj54Ys=
dependencies: dependencies:
"@react-native-community/viewpager" "^2.0.1"
create-react-class "^15.6.2" create-react-class "^15.6.2"
prop-types "^15.6.0" prop-types "^15.6.0"
react-timer-mixin "^0.13.3" react-timer-mixin "^0.13.3"
......
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