Commit 163cd886 by peii

添加支持客户销售员可自助下单

parent 3a87b630
......@@ -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';
......@@ -114,6 +114,8 @@ class ChooseProductPage extends Component {
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 = []
}
}
......@@ -122,7 +124,9 @@ class ChooseProductPage extends Component {
topProcOptionList: list,
originManufacterList: local_sele_pro_options
}, () => {
that.handleTopNav(list[0], 0)
if (isNotBlank(list)) {
that.handleTopNav(list[0], 0)
}
})
return
}
......@@ -158,6 +162,8 @@ class ChooseProductPage extends Component {
const filterSuppliers = R.pluck('supplier_code', authorizations)
if (isNotBlank(filterSuppliers)) {
list = R.filter(R.propSatisfies(R.includes(R.__, filterSuppliers), 'supplier_code'))(topProcOptionList)
} else {
list = []
}
}
......@@ -166,7 +172,9 @@ class ChooseProductPage extends Component {
originManufacterList: topProcOptionList,
}, () => {
that.refs.LoadingModel.hide()
that.handleTopNav(topProcOptionList[0], 0)
if (isNotBlank(list)) {
that.handleTopNav(list[0], 0)
}
})
} else {
this.refs.LoadingModel.hide()
......@@ -688,6 +696,8 @@ class ChooseProductPage extends Component {
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 = []
}
}
......@@ -709,22 +719,42 @@ class ChooseProductPage extends Component {
* @return {*}
*/
rightNameFilter(list = []) {
const {searchValue, authorizations, productAuthorization, topActiveIndex, topProcOptionList, leftActiveIndex} = this.state
if(isBlank(list)) return []
if (productAuthorization === 'Y' && R.includes(leftActiveIndex, [1, 2, 3])) {
const {searchValue, authorizations, productAuthorization, topActiveIndex, topProcOptionList, leftActiveIndex} = 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)
list = R.filter(R.propSatisfies(R.includes(R.__, typeCodes), 'product_line_category_code'))(list)
if (R.compose(R.isNil, R.path([0, 'details']))(list)) {
list = R.filter(R.propSatisfies(R.includes(R.__, typeCodes), 'product_line_category_code'))(list)
} else {
R.map(item => {
if (isBlank(item.details)) return
item.details = R.filter(R.propSatisfies(R.includes(R.__, typeCodes), 'product_line_category_code'))(item.details)
})(list)
}
} else {
list = []
}
}
const includes = item => {
const reg = new RegExp(searchValue, 'g')
return R.test(reg, item.general_name) || R.test(reg, item.item_name)
}
return R.filter(includes, list)
// if (R.compose(R.isNil, R.path([0, 'details']))(list)) {
// return R.filter(includes, list)
// } else {
// R.map(item => {
// if (isBlank(item.details)) return
// item.display_details = R.filter(includes, item.details)
// })(list)
// return list
// }
}
// 返回搜索元素
......
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';
......@@ -160,7 +161,7 @@ class ProductRightStyle extends Component {
let that = this
if (show && superItem) {
// 大类点击标题
let curRowData = cloneObject(superItem['details'])
let curRowData = R.clone(superItem['details'])
curThridObj = {
superItem: superItem,
superIndex: superIndex,
......
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