Commit 52dcff53 by peii

Merge branch 'develop' into product

parents b6332fa9 22bcd25a
......@@ -140,7 +140,7 @@ android {
}
buildTypes {
debug {
resValue "string", "CodePushDeploymentKey", '"OQxOHKC_pU5KPExPvQLLfeOdhO4_zss5pKduM"'
resValue "string", "CodePushDeploymentKey", '""'
resValue 'string', "CODE_PUSH_APK_BUILD_TIME", String.format("\"%d\"", System.currentTimeMillis())
}
release {
......@@ -162,7 +162,7 @@ android {
resValue "string", "baseUrl", '"https://obs.uat.guke.tech"'
}
xhk {
resValue "string", "baseUrl", '"https://obs.xhk.orth.tech"'
resValue "string", "baseUrl", '"https://obs.dev.xhk.guke.tech"'
}
bjzr {
resValue "string", "baseUrl", '"https://hos.dev.bjhh.guke.tech"'
......@@ -170,6 +170,9 @@ android {
gyxj {
resValue "string", "baseUrl", '"http://190.3.1.42"'
}
hzngz {
resValue "string", "baseUrl", '"https://obs.hzn.orth.tech"'
}
}
// applicationVariants are e.g. debug, release
......
......@@ -1266,6 +1266,40 @@ class SelfOrderPage extends Component {
// 选择产品 点击跳转
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()) {
let { listOptionData } = this.state
let that = this
......@@ -1273,7 +1307,9 @@ class SelfOrderPage extends Component {
title: `选择产品`,
selfData: {
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)
})
......
......@@ -9,7 +9,7 @@ import ProductRightStyle from './ProductRightStyle';
import ProductModel from '../../common/ProductModel';
import StatusBarView from '../../common/StatusBarView';
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 LoadingModel from '../../common/listDataComponent/LoadingModel';
import LocalVariable from '../../common/LocalVariable';
......@@ -77,22 +77,27 @@ class ChooseProductPage extends Component {
options: [],
value: '',
type: 'select'
}]
}],
productAuthorization: 'N',
authorizations: []
}
this.inputSearchValue = debounce(this.inputSearchValue.bind(this), 500)
}
componentDidMount() {
this.initGetData()
const {authorizations = [], productAuthorization = 'N'} = R.pathOr({}, ['state', 'params', 'selfData'])(this.props.navigation)
this.setState({authorizations, productAuthorization}, () => {
this.initGetData()
})
}
// 返回
handleGoBack() {
let { topProcOptionList } = this.state
let { topProcOptionList, originManufacterList } = this.state
let { setSelectProductOpts } = this.props
setSelectProductOpts(topProcOptionList)
this.props.navigation.state.params.productCallBack(topProcOptionList)
setSelectProductOpts(originManufacterList)
this.props.navigation.state.params.productCallBack(originManufacterList)
this.props.navigation.goBack()
}
......@@ -100,12 +105,28 @@ class ChooseProductPage extends Component {
async initGetData() {
let that = this
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) {
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({
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
}
......@@ -135,11 +156,25 @@ class ChooseProductPage extends Component {
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({
topProcOptionList
topProcOptionList: list,
originManufacterList: topProcOptionList,
}, () => {
that.refs.LoadingModel.hide()
that.handleTopNav(topProcOptionList[0], 0)
if (isNotBlank(list)) {
that.handleTopNav(list[0], 0)
}
})
} else {
this.refs.LoadingModel.hide()
......@@ -653,7 +688,19 @@ class ChooseProductPage extends Component {
* @return {*}
*/
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 => {
const value = filter.value
if (isNotBlank(value)) {
......@@ -668,15 +715,40 @@ class ChooseProductPage extends Component {
/**
* @description: 搜索过滤
* @param {*}
* @param {array} list 要过滤的数组
* @param {boolean} isChildFilter 子组件调用(三级调用)
* @return {*}
*/
rightNameFilter(list = []) {
const {searchValue} = this.state
rightNameFilter(list = [], isChildFilter = false) {
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 reg = new RegExp(searchValue, 'g')
return R.test(reg, item.general_name) || R.test(reg, item.item_name)
const preds = R.compose(
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)
}
......@@ -769,7 +841,7 @@ class ChooseProductPage extends Component {
// 返回右侧二级数据
renderContItem() {
let { leftActiveIndex, defaultThridShow, topProcOptionList, topActiveIndex} = this.state
let { leftActiveIndex, defaultThridShow, topProcOptionList, topActiveIndex, searchValue } = this.state
let curRigSecoOption = []
let curSuperLeftOption = []
let topItem = topProcOptionList[topActiveIndex]
......@@ -799,6 +871,7 @@ class ChooseProductPage extends Component {
superCallBack={(count, coutFieName) => this.handleChangeCount(count, coutFieName)}
superReduceBack={() => this.handleSubSelected()}
superLeftData={curSuperLeftOption}
rightNameFilter={this.rightNameFilter.bind(this)}
/>
</View>
)
......
import React, { Component } from 'react';
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 PicTitDetaiCalcu from '../../common/listDataComponent/PicTitDetaiCalcu';
import { cloneObject } from '../../../utils/Utils';
import { cloneObject, isBlank, isNotBlank} from '../../../utils/Utils';
import { PicListNoData } from '../../common/CellTextStyle';
import _ from "lodash";
import { connect } from 'react-redux';
......@@ -156,11 +157,10 @@ class ProductRightStyle extends Component {
// 修改当前小类是否展示
changeThrShow(show, superItem, superIndex) {
let { curThridObj, rowSingleData } = this.state
let { curThridObj, rowSingleData, lastInputText } = this.state
let that = this
if (show && superItem) {
// 大类点击标题
let curRowData = cloneObject(superItem['details'])
curThridObj = {
superItem: superItem,
superIndex: superIndex,
......@@ -169,7 +169,7 @@ class ProductRightStyle extends Component {
that.setState({
thridIsVisible: show,
curThridObj: curThridObj,
rowSingleData: curRowData
rowSingleData: R.clone(superItem['details'])
})
this.props.changeThrShow(show)
} else {
......@@ -177,7 +177,7 @@ class ProductRightStyle extends Component {
if (curThridObj.superItem) {
let curDa = curThridObj.superItem
let curInd = curThridObj.superIndex
curDa.details = cloneObject(rowSingleData)
curDa.details = R.clone(rowSingleData)
curDa[LocalVariable.QUANTITY_FIELD] = 0
curDa.details.forEach(itVal => {
if (itVal[LocalVariable.QUANTITY_FIELD] > 0) {
......@@ -186,7 +186,8 @@ class ProductRightStyle extends Component {
})
that.handleCalCallBack(curDa, curInd, 'rightSecondData', LocalVariable.QUANTITY_FIELD)
that.setState({
thridIsVisible: show
thridIsVisible: show,
lastInputText: ''
})
this.props.changeThrShow(show)
}
......@@ -334,13 +335,16 @@ class ProductRightStyle extends Component {
// 耗材 -- 小类每一列
renderThridItem(item, index) {
let { rowSingleData } = this.state
const idx = R.findIndex(R.propEq('item_code', item.item_code))(rowSingleData)
return (
<SafeAreaView style={styles.thr_container} key={'item_code' + index}>
<PicTitDetaiCalcu
listItem={item}
listIndex={index}
listIndex={idx}
calField={LocalVariable.QUANTITY_FIELD}
subCalCallBack={(item, index) => this.handleCalCallBack(item, index, 'rowSingleData')}
subCalCallBack={(item, idx) => this.handleCalCallBack(item, idx, 'rowSingleData')}
titText={'manufacturer_product_code'}
tipTextStr={'item_name'}
tipTextOne={'general_name'}
......@@ -358,12 +362,14 @@ class ProductRightStyle extends Component {
// 耗材 -- 小类
renderThridStyle() {
let { rowSingleData } = this.state
let data = this.props.rightNameFilter(rowSingleData, true)
return (
<View style={styles.stencil_cont}>
<FlatList
style={styles.cont_thr_list}
keyExtractor={item => item.id}
data={rowSingleData}
data={data}
extraData={this.state}
renderItem={({ item, index }) => this.renderThridItem(item, index)}
/>
......
......@@ -903,6 +903,11 @@
resolved "https://registry.yarnpkg.com/@react-native-community/slider/-/slider-3.0.3.tgz#830167fd757ba70ac638747ba3169b2dbae60330"
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":
version "3.4.2"
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:
dependencies:
debounce "^1.2.0"
react-native-scrollable-tab-view@0.9.0:
version "0.9.0"
resolved "https://registry.npm.taobao.org/react-native-scrollable-tab-view/download/react-native-scrollable-tab-view-0.9.0.tgz#cf8c09018f1e1c88bb26db6a003c90de275a1c6f"
integrity sha1-z4wJAY8eHIi7JttqADyQ3idaHG8=
react-native-scrollable-tab-view@^1.0.0:
version "1.0.0"
resolved "https://r.cnpmjs.org/react-native-scrollable-tab-view/download/react-native-scrollable-tab-view-1.0.0.tgz#87319896067f7bb643ecd7fba2cba4d6d8f9e18b"
integrity sha1-hzGYlgZ/e7ZD7Nf7osuk1tj54Ys=
dependencies:
"@react-native-community/viewpager" "^2.0.1"
create-react-class "^15.6.2"
prop-types "^15.6.0"
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