Commit 50df9447 by peii

结算及临高下单调整

parent 6473ab48
...@@ -3,7 +3,7 @@ import { View, Text, SafeAreaView, StyleSheet, TouchableOpacity, Image, ScrollVi ...@@ -3,7 +3,7 @@ import { View, Text, SafeAreaView, StyleSheet, TouchableOpacity, Image, ScrollVi
import { connect } from 'react-redux'; 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 { 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 { ImageTextStyle, CellTextStyle, FooterBtnStyle } from '../common/CellTextStyle';
import { show, formatStrForDate, cloneObject, dedupQuoteArray, isBlank, isNotBlank, decodeDisplayProfiles } from '../../utils/Utils'; import { show, formatStrForDate, cloneObject, dedupQuoteArray, isBlank, isNotBlank, decodeDisplayProfiles, getCodeValue } from '../../utils/Utils';
import HeadBackItem from '../common/HeadBackItem'; import HeadBackItem from '../common/HeadBackItem';
import StatusBarView from '../common/StatusBarView'; import StatusBarView from '../common/StatusBarView';
import DialogModel from '../common/DialogModel'; import DialogModel from '../common/DialogModel';
...@@ -289,6 +289,13 @@ class SelfOrderPage extends Component { ...@@ -289,6 +289,13 @@ class SelfOrderPage extends Component {
*/ */
decodeDisplayLendProfile = decodeDisplayProfiles(this.props.lend_order_value_profiles) decodeDisplayLendProfile = decodeDisplayProfiles(this.props.lend_order_value_profiles)
/**
* @description: 获取值集配置里的值
* @param {*}
* @return {*}
*/
getCodeSetValue = getCodeValue(this.props.lend_order_value_profiles)
// 赋值销售员 初始化数据 // 赋值销售员 初始化数据
getSellerName() { getSellerName() {
let { state, props } = this let { state, props } = this
...@@ -579,7 +586,7 @@ class SelfOrderPage extends Component { ...@@ -579,7 +586,7 @@ class SelfOrderPage extends Component {
let tempTit = '' let tempTit = ''
let curTip = '未选择' let curTip = '未选择'
const {isLendOrder} = navigation.getParam('params') const {isLendOrder} = navigation.getParam('params')
const doctorNameProfile = this.decodeDisplayLendProfile('PATIENT_NAME_DISPLAY') const doctorNameProfile = this.decodeDisplayLendProfile('DOCTOR_DISPLAY')
const patientNameProfile = this.decodeDisplayLendProfile('PATIENT_NAME_DISPLAY') const patientNameProfile = this.decodeDisplayLendProfile('PATIENT_NAME_DISPLAY')
const patientGenderProfile = this.decodeDisplayLendProfile('PATIENT_GENDER_DISPLAY') const patientGenderProfile = this.decodeDisplayLendProfile('PATIENT_GENDER_DISPLAY')
const patientAgeProfile = this.decodeDisplayLendProfile('PATIENT_AGE_DISPLAY') const patientAgeProfile = this.decodeDisplayLendProfile('PATIENT_AGE_DISPLAY')
...@@ -609,16 +616,22 @@ class SelfOrderPage extends Component { ...@@ -609,16 +616,22 @@ class SelfOrderPage extends Component {
tempStatus = true tempStatus = true
break break
} }
if (isLendOrder && if (isLendOrder &&
(chIndex == 20 && patientNameProfile.required || (chIndex == 20 && patientNameProfile.required ||
chIndex == 5 && doctorNameProfile.required ||
chIndex == 21 && patientGenderProfile.required || chIndex == 21 && patientGenderProfile.required ||
chIndex == 22 && patientAgeProfile.required || chIndex == 22 && patientAgeProfile.required ||
chIndex == 23 && hospitalizationNumberProfile.required || chIndex == 23 && hospitalizationNumberProfile.required ||
chIndex == 24 && patientIdProfile.required chIndex == 24 && patientIdProfile.required
) ) &&
&& !listOptionData[chIndex].value !listOptionData[chIndex].value
) {
tempTit = listOptionData[chIndex].title
tempStatus = true
break
}
if (isLendOrder && chIndex == 5 && doctorNameProfile.required && (
listOptionData[chIndex].value != '-1' ||
!listOptionData[chIndex].inputValue)
) { ) {
tempTit = listOptionData[chIndex].title tempTit = listOptionData[chIndex].title
tempStatus = true tempStatus = true
...@@ -691,6 +704,7 @@ class SelfOrderPage extends Component { ...@@ -691,6 +704,7 @@ class SelfOrderPage extends Component {
let { selfOrderOption } = this.props let { selfOrderOption } = this.props
let tempOption = [] let tempOption = []
let that = this let that = this
const {isLendOrder} = this.props.navigation.getParam('params')
if (selfOrderOption.length === 0) { if (selfOrderOption.length === 0) {
show(`当前${currentTitle}为空`) show(`当前${currentTitle}为空`)
return return
...@@ -744,9 +758,27 @@ class SelfOrderPage extends Component { ...@@ -744,9 +758,27 @@ class SelfOrderPage extends Component {
// tempOption = [...resultArr] // tempOption = [...resultArr]
// } // }
else if (currentTitle === '订单类型') { else if (currentTitle === '订单类型') {
if (isLendOrder) {
const order_type = this.getCodeSetValue('order_type')
if (isNotBlank(order_type)) {
const option = R.find(R.propEq('value_code', order_type.value))(selfOrderOption)
if (isNotBlank(option)) {
selfOrderOption = [option]
}
}
}
tempOption = that.changeNameAndValue(selfOrderOption, 'value_name', 'value_code') tempOption = that.changeNameAndValue(selfOrderOption, 'value_name', 'value_code')
} else if (currentTitle === '借货仓库') { } else if (currentTitle === '借货仓库') {
let filterOpt = dedupQuoteArray(selfOrderOption, 'source_inv_code') let filterOpt = dedupQuoteArray(selfOrderOption, 'source_inv_code')
if (isLendOrder) {
const inv = this.getCodeSetValue('collect_src_inv_code')
if (isNotBlank(inv)) {
const option = R.find(R.propEq('source_inv_code', inv.value))(filterOpt)
if (isNotBlank(option)) {
filterOpt = [option]
}
}
}
tempOption = this.changeNameAndValue(filterOpt, 'source_inv_name', 'source_inv_code') tempOption = this.changeNameAndValue(filterOpt, 'source_inv_name', 'source_inv_code')
} }
that.setState({ that.setState({
...@@ -1227,6 +1259,8 @@ class SelfOrderPage extends Component { ...@@ -1227,6 +1259,8 @@ class SelfOrderPage extends Component {
}) })
this.setState({ this.setState({
listOptionData: listOptionData listOptionData: listOptionData
}, () => {
this.changeCanSub()
}) })
} }
...@@ -1669,6 +1703,8 @@ class SelfOrderPage extends Component { ...@@ -1669,6 +1703,8 @@ class SelfOrderPage extends Component {
// 提交订单 // 提交订单
submitSelfOrder() { submitSelfOrder() {
let { state, props } = this let { state, props } = this
const {isLendOrder} = this.props.navigation.getParam('params')
let tempSubOption = state.submitOption let tempSubOption = state.submitOption
tempSubOption.seller_code = state.listOptionData[0].value tempSubOption.seller_code = state.listOptionData[0].value
tempSubOption.org_code = state.listOptionData[1].value tempSubOption.org_code = state.listOptionData[1].value
...@@ -1704,7 +1740,6 @@ class SelfOrderPage extends Component { ...@@ -1704,7 +1740,6 @@ class SelfOrderPage extends Component {
sysValues.OBS_MOBILE_DELIVERYMAN_DISPLAY > 0 && (tempSubOption.deliveryman_code = state.listOptionData[17].value) sysValues.OBS_MOBILE_DELIVERYMAN_DISPLAY > 0 && (tempSubOption.deliveryman_code = state.listOptionData[17].value)
const {isLendOrder} = this.props.navigation.getParam('params')
const patientNameProfile = this.decodeDisplayLendProfile('PATIENT_NAME_DISPLAY') const patientNameProfile = this.decodeDisplayLendProfile('PATIENT_NAME_DISPLAY')
const patientGenderProfile = this.decodeDisplayLendProfile('PATIENT_GENDER_DISPLAY') const patientGenderProfile = this.decodeDisplayLendProfile('PATIENT_GENDER_DISPLAY')
const patientAgeProfile = this.decodeDisplayLendProfile('PATIENT_AGE_DISPLAY') const patientAgeProfile = this.decodeDisplayLendProfile('PATIENT_AGE_DISPLAY')
......
...@@ -341,3 +341,11 @@ export const decodeDisplayProfiles = R.curry((codeValues, code) => { ...@@ -341,3 +341,11 @@ export const decodeDisplayProfiles = R.curry((codeValues, code) => {
required: R.includes(R.prop('value_tag')(values), ['3']), required: R.includes(R.prop('value_tag')(values), ['3']),
} }
}) })
export const getCodeValue = R.curry((codeValues, code) => {
if (isBlank(codeValues)) return
const values = R.find(R.propEq('value_code', code))(codeValues);
if (isBlank(values)) return
return {value: values.value_tag, label: values.value_desc}
})
\ No newline at end of file
...@@ -28,7 +28,7 @@ type IProps = { ...@@ -28,7 +28,7 @@ type IProps = {
export default class Input extends Component<IProps> { export default class Input extends Component<IProps> {
constructor(props) { constructor(props) {
super(props) super(props)
this.onChangeText = debounce(this.onChangeText.bind(this), 500) this.onChangeText = debounce(this.onChangeText.bind(this), 200)
} }
onChangeText(text: string) { onChangeText(text: string) {
......
...@@ -85,12 +85,12 @@ export default class Select extends Component<IProps> { ...@@ -85,12 +85,12 @@ export default class Select extends Component<IProps> {
loading={item.loading} loading={item.loading}
value={value} value={value}
visible={true} visible={true}
mask={true} mask={false}
onChange={this.onChange} onChange={this.onChange}
onClose={() => { onClose={() => {
this.setState({ visible: false }, () => { // this.setState({ visible: false }, () => {
this.props.modalCallback() this.props.modalCallback(null)
}) // })
}} }}
/> />
) )
...@@ -131,12 +131,12 @@ export default class Select extends Component<IProps> { ...@@ -131,12 +131,12 @@ export default class Select extends Component<IProps> {
loading={item.loading} loading={item.loading}
value={value} value={value}
visible={true} visible={true}
mask={true} mask={false}
onChange={this.onChange} onChange={this.onChange}
onClose={() => { onClose={() => {
this.setState({ visible: false }, () => { // this.setState({ visible: false }, () => {
this.props.modalCallback() this.props.modalCallback(null)
}) // })
}} }}
/> />
) )
......
/* /*
* @FilePath: /BoneHouse_Hospital_APP/src/components/modals/base/bottom.tsx * @FilePath: /BoneHouse_Business_APP/src/components/modals/base/bottom.tsx
* @Author: peii * @Author: peii
* @Date: 2021-04-27 21:53:02 * @Date: 2021-04-27 21:53:02
* @Vision: 1.0 * @Vision: 1.0
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
* @Revision: * @Revision:
* *
*/ */
// @ts-nocheck
import React, { useEffect, useRef, useState, createRef } from 'react' import React, { useEffect, useRef, useState, createRef } from 'react'
import { View, Text, TouchableOpacity, ScrollView, Animated, Platform } from 'react-native' import { View, Text, TouchableOpacity, ScrollView, Animated, Platform } from 'react-native'
import { Provider, Modal } from '@ant-design/react-native' import { Provider, Modal } from '@ant-design/react-native'
...@@ -64,16 +65,7 @@ let scrollRef = null ...@@ -64,16 +65,7 @@ let scrollRef = null
* @return {*} * @return {*}
*/ */
export function BottomModal(props: IModalProps) { export function BottomModal(props: IModalProps) {
const { const { onChange, visible, title, onClose, action, headerHeight, mask = true, contentHeight = 300 } = props
onChange,
visible,
title,
onClose,
action,
headerHeight,
mask = true,
contentHeight = 300,
} = props
const { width, height } = Resolution.get() const { width, height } = Resolution.get()
const statusHeight = Platform.OS === 'android' ? 0 : isIphoneX() ? 44 : 20 const statusHeight = Platform.OS === 'android' ? 0 : isIphoneX() ? 44 : 20
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
* @FilePath: /BoneHouse_Business_APP/src/components/modals/filter/filter.tsx * @FilePath: /BoneHouse_Business_APP/src/components/modals/filter/filter.tsx
* @Author: peii * @Author: peii
* @Date: 2021-12-19 10:49:42 * @Date: 2021-12-19 10:49:42
* @LastEditTime: 2021-12-23 16:04:12 * @LastEditTime: 2022-01-11 09:03:17
* @LastEditors: peii * @LastEditors: PEII
* @Vision: 1.0 * @Vision: 1.0
* @Description: 过滤弹窗 * @Description: 过滤弹窗
*/ */
...@@ -69,6 +69,7 @@ export default class FilterModal extends React.Component<IProps, IState> { ...@@ -69,6 +69,7 @@ export default class FilterModal extends React.Component<IProps, IState> {
<View style={g(styles, 'filter-item')} key={item.field}> <View style={g(styles, 'filter-item')} key={item.field}>
<FormComponent <FormComponent
item={item} item={item}
data={data}
value={data[item.field]} value={data[item.field]}
onChange={this.props.setData} onChange={this.props.setData}
itemStyle={g(styles, 'filter-item__bd')} itemStyle={g(styles, 'filter-item__bd')}
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
* @FilePath: /BoneHouse_Business_APP/src/pages/invoice/direct/collections.tsx * @FilePath: /BoneHouse_Business_APP/src/pages/invoice/direct/collections.tsx
* @Author: peii * @Author: peii
* @Date: 2021-12-27 09:59:21 * @Date: 2021-12-27 09:59:21
* @LastEditTime: 2022-01-05 15:25:16 * @LastEditTime: 2022-01-10 19:03:39
* @LastEditors: peii * @LastEditors: PEII
* @Vision: 1.0 * @Vision: 1.0
* @Description: 基于消耗单的直销开票查询汇总 * @Description: 基于消耗单的直销开票查询汇总
*/ */
...@@ -40,7 +40,7 @@ class Direction extends Component<IProps, IState> { ...@@ -40,7 +40,7 @@ class Direction extends Component<IProps, IState> {
constructor(props) { constructor(props) {
super(props) super(props)
this.toggleModalVisible = this.toggleModalVisible.bind(this) this.toggleModalVisible = this.toggleModalVisible.bind(this)
this.getData = this.getData.bind(this) this.getData = debounce(this.getData.bind(this), 200)
this.getLineData = this.getLineData.bind(this) this.getLineData = this.getLineData.bind(this)
this.selectAllHandler = this.selectAllHandler.bind(this) this.selectAllHandler = this.selectAllHandler.bind(this)
this.submitHandler = debounce(this.submitHandler.bind(this), 200) this.submitHandler = debounce(this.submitHandler.bind(this), 200)
...@@ -121,10 +121,10 @@ class Direction extends Component<IProps, IState> { ...@@ -121,10 +121,10 @@ class Direction extends Component<IProps, IState> {
args.header_status = 'APPROVED' args.header_status = 'APPROVED'
// args.invoice_header_status = 'ENTERED' // args.invoice_header_status = 'ENTERED'
const params = { const params = R.filter(isNotBlank)({
...args, ...args,
...pagination, ...pagination,
} })
if (!isRefresh && !isNext) { if (!isRefresh && !isNext) {
this.setState({ loading: true }) this.setState({ loading: true })
} }
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
* @FilePath: /BoneHouse_Business_APP/src/pages/invoice/direct/components/filter.tsx * @FilePath: /BoneHouse_Business_APP/src/pages/invoice/direct/components/filter.tsx
* @Author: peii * @Author: peii
* @Date: 2021-12-19 10:49:42 * @Date: 2021-12-19 10:49:42
* @LastEditTime: 2022-01-04 17:39:29 * @LastEditTime: 2022-01-11 09:30:03
* @LastEditors: peii * @LastEditors: PEII
* @Vision: 1.0 * @Vision: 1.0
* @Description: 过滤弹窗 * @Description: 过滤弹窗
*/ */
...@@ -68,6 +68,7 @@ class Filter extends React.Component<IProps, IState> { ...@@ -68,6 +68,7 @@ class Filter extends React.Component<IProps, IState> {
label: '客户', label: '客户',
type: FieldType.SELECT, type: FieldType.SELECT,
rules: [{ required: true, message: '请选择客户' }], rules: [{ required: true, message: '请选择客户' }],
refrence: ['org_code'],
}, },
{ {
field: 'consume_order_number', field: 'consume_order_number',
...@@ -104,10 +105,11 @@ class Filter extends React.Component<IProps, IState> { ...@@ -104,10 +105,11 @@ class Filter extends React.Component<IProps, IState> {
* @param {*} value 输入值 * @param {*} value 输入值
* @return {*} * @return {*}
*/ */
setData(key: string, value: any) { setData(key: string, value: any, callback = () => {}) {
const { data, isAutoOpen } = this.state const { data, isAutoOpen } = this.state
data[key] = value data[key] = value
this.setState({ data }, () => { this.setState({ data }, () => {
callback()
if (!isAutoOpen) return if (!isAutoOpen) return
const isAllParamSet = R.compose( const isAllParamSet = R.compose(
R.all(isNotBlank), R.all(isNotBlank),
...@@ -133,17 +135,22 @@ class Filter extends React.Component<IProps, IState> { ...@@ -133,17 +135,22 @@ class Filter extends React.Component<IProps, IState> {
filterItems = R.concat(filterItems)(otherFilterItems) filterItems = R.concat(filterItems)(otherFilterItems)
this.setState({ filterItems, data }) this.setState({ filterItems, data })
if (!showOrg) return // if (!showOrg) return
const item = { const item = {
field: 'org_code', field: 'org_code',
label: '组织', label: '组织',
type: FieldType.SELECT, type: FieldType.SELECT,
options: [], options: [],
display: showOrg,
rules: [{ required: true, message: '请选择组织' }], rules: [{ required: true, message: '请选择组织' }],
callback: () => {
data.customer_code = ''
this.getCustomers()
}
} }
filterItems = R.prepend(item, filterItems) filterItems = R.prepend(item, filterItems)
this.getOrganizations() this.getOrganizations(showOrg)
this.setState({ filterItems, data }) this.setState({ filterItems, data })
} }
...@@ -152,7 +159,7 @@ class Filter extends React.Component<IProps, IState> { ...@@ -152,7 +159,7 @@ class Filter extends React.Component<IProps, IState> {
* @param {*} * @param {*}
* @return {*} * @return {*}
*/ */
async getOrganizations() { async getOrganizations(showOrg) {
const res = await api.getOrganizations() const res = await api.getOrganizations()
if (res.error_code) return if (res.error_code) return
...@@ -167,6 +174,9 @@ class Filter extends React.Component<IProps, IState> { ...@@ -167,6 +174,9 @@ class Filter extends React.Component<IProps, IState> {
), ),
R.pathOr([], ['data', 'organizations']), R.pathOr([], ['data', 'organizations']),
)(res) )(res)
if (!showOrg && R.length(item.options) !== 1) {
show('请先选组织')
}
this.setState({ filterItems }) this.setState({ filterItems })
} }
...@@ -246,7 +256,7 @@ class Filter extends React.Component<IProps, IState> { ...@@ -246,7 +256,7 @@ class Filter extends React.Component<IProps, IState> {
style={g(styles, 'filter-modal')} style={g(styles, 'filter-modal')}
visible={visible} visible={visible}
data={data} data={data}
filterItems={filterItems} filterItems={R.reject(R.propEq('display', false), filterItems)}
onClose={this.onClose} onClose={this.onClose}
setData={this.setData} setData={this.setData}
resetHandler={this.resetHandler} resetHandler={this.resetHandler}
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
* @FilePath: /BoneHouse_Business_APP/src/pages/invoice/direct/components/list.tsx * @FilePath: /BoneHouse_Business_APP/src/pages/invoice/direct/components/list.tsx
* @Author: peii * @Author: peii
* @Date: 2021-12-19 10:44:15 * @Date: 2021-12-19 10:44:15
* @LastEditTime: 2022-01-05 11:34:50 * @LastEditTime: 2022-01-11 02:07:31
* @LastEditors: peii * @LastEditors: PEII
* @Vision: 1.0 * @Vision: 1.0
* @Description: 汇总列表 * @Description: 汇总列表
*/ */
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @FilePath: /BoneHouse_Business_APP/src/pages/invoice/direct/detail.tsx * @FilePath: /BoneHouse_Business_APP/src/pages/invoice/direct/detail.tsx
* @Author: peii * @Author: peii
* @Date: 2021-12-29 11:26:53 * @Date: 2021-12-29 11:26:53
* @LastEditTime: 2022-01-05 11:45:19 * @LastEditTime: 2022-01-10 10:06:03
* @LastEditors: peii * @LastEditors: peii
* @Vision: 1.0 * @Vision: 1.0
* @Description: 开票申请详情 * @Description: 开票申请详情
...@@ -166,7 +166,7 @@ class InvoiceApplyDetail extends Component<IProps> { ...@@ -166,7 +166,7 @@ class InvoiceApplyDetail extends Component<IProps> {
<View style={g(styles, 'item-info-line')}> <View style={g(styles, 'item-info-line')}>
<Text style={g(styles, 'item-info__text', 'item-info-line__text')}>数量: {item.consumed_quantity}</Text> <Text style={g(styles, 'item-info__text', 'item-info-line__text')}>数量: {item.consumed_quantity}</Text>
<Text style={g(styles, 'item-info__text', 'item-info-line__text')}> <Text style={g(styles, 'item-info__text', 'item-info-line__text')}>
金额: {item.consumed_quantity * item.consumed_price} 金额: {item.sale_amount}
</Text> </Text>
</View> </View>
{isCollection && ( {isCollection && (
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
* @FilePath: /BoneHouse_Business_APP/src/pages/invoice/direct/index.tsx * @FilePath: /BoneHouse_Business_APP/src/pages/invoice/direct/index.tsx
* @Author: peii * @Author: peii
* @Date: 2021-12-27 09:59:21 * @Date: 2021-12-27 09:59:21
* @LastEditTime: 2022-01-06 11:45:09 * @LastEditTime: 2022-01-11 02:18:03
* @LastEditors: peii * @LastEditors: PEII
* @Vision: 1.0 * @Vision: 1.0
* @Description: 基于消耗单的直销开票申请 * @Description: 基于消耗单的直销开票申请
*/ */
...@@ -39,7 +39,7 @@ class Direction extends Component<IProps, IState> { ...@@ -39,7 +39,7 @@ class Direction extends Component<IProps, IState> {
constructor(props) { constructor(props) {
super(props) super(props)
this.toggleModalVisible = this.toggleModalVisible.bind(this) this.toggleModalVisible = this.toggleModalVisible.bind(this)
this.getData = this.getData.bind(this) this.getData = debounce(this.getData.bind(this), 200)
this.getLineData = this.getLineData.bind(this) this.getLineData = this.getLineData.bind(this)
this.selectAllHandler = this.selectAllHandler.bind(this) this.selectAllHandler = this.selectAllHandler.bind(this)
this.submitHandler = debounce(this.submitHandler.bind(this), 200) this.submitHandler = debounce(this.submitHandler.bind(this), 200)
...@@ -105,10 +105,10 @@ class Direction extends Component<IProps, IState> { ...@@ -105,10 +105,10 @@ class Direction extends Component<IProps, IState> {
args.header_status = 'APPROVED' args.header_status = 'APPROVED'
args.invoice_header_status = 'ENTERED' args.invoice_header_status = 'ENTERED'
const params = { const params = R.filter(isNotBlank)({
...args, ...args,
...pagination, ...pagination,
} })
if (!isRefresh && !isNext) { if (!isRefresh && !isNext) {
this.setState({ loading: true }) this.setState({ loading: true })
} }
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
* @FilePath: /BoneHouse_Business_APP/src/pages/invoice/distribution/collection.tsx * @FilePath: /BoneHouse_Business_APP/src/pages/invoice/distribution/collection.tsx
* @Author: peii * @Author: peii
* @Date: 2021-12-27 09:59:21 * @Date: 2021-12-27 09:59:21
* @LastEditTime: 2022-01-07 16:53:05 * @LastEditTime: 2022-01-11 08:29:14
* @LastEditors: peii * @LastEditors: PEII
* @Vision: 1.0 * @Vision: 1.0
* @Description: 分销开票申请汇总 * @Description: 分销开票申请汇总
*/ */
...@@ -15,6 +15,7 @@ import { View, Text, TouchableOpacity, Image, ActivityIndicator } from 'react-na ...@@ -15,6 +15,7 @@ import { View, Text, TouchableOpacity, Image, ActivityIndicator } from 'react-na
import { connect } from 'react-redux' import { connect } from 'react-redux'
import * as R from 'ramda' import * as R from 'ramda'
import { INavigation } from 'navigation' import { INavigation } from 'navigation'
import debounce from 'debounce'
import Loading from '../../../../app/containers/common/LodingModel' import Loading from '../../../../app/containers/common/LodingModel'
import Header from '../../../components/header/header' import Header from '../../../components/header/header'
import Resolution from '../../../components/common/Resolution' import Resolution from '../../../components/common/Resolution'
...@@ -38,7 +39,7 @@ class Distribution extends Component<IProps, IState> { ...@@ -38,7 +39,7 @@ class Distribution extends Component<IProps, IState> {
constructor(props) { constructor(props) {
super(props) super(props)
this.toggleModalVisible = this.toggleModalVisible.bind(this) this.toggleModalVisible = this.toggleModalVisible.bind(this)
this.getData = this.getData.bind(this) this.getData = debounce(this.getData.bind(this), 200)
this.getLineData = this.getLineData.bind(this) this.getLineData = this.getLineData.bind(this)
this.itemClickHandler = this.itemClickHandler.bind(this) this.itemClickHandler = this.itemClickHandler.bind(this)
} }
...@@ -117,10 +118,12 @@ class Distribution extends Component<IProps, IState> { ...@@ -117,10 +118,12 @@ class Distribution extends Component<IProps, IState> {
this.setState({ filterData: args }) this.setState({ filterData: args })
} }
const params = { const params = R.filter(isNotBlank)({
...args, ...args,
...pagination, ...pagination,
} })
console.log(params)
if (!isRefresh && !isNext) { if (!isRefresh && !isNext) {
this.setState({ loading: true }) this.setState({ loading: true })
} }
...@@ -169,9 +172,7 @@ class Distribution extends Component<IProps, IState> { ...@@ -169,9 +172,7 @@ class Distribution extends Component<IProps, IState> {
await this.getLineData(order, true) await this.getLineData(order, true)
} }
const title = this.props.navigation.getParam('title')
this.props.navigation.navigate('DistributeInvoiceCollectionDetail', { this.props.navigation.navigate('DistributeInvoiceCollectionDetail', {
title,
order, order,
isCollection: true, isCollection: true,
}) })
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
* @FilePath: /BoneHouse_Business_APP/src/pages/invoice/distribution/collection_detail.tsx * @FilePath: /BoneHouse_Business_APP/src/pages/invoice/distribution/collection_detail.tsx
* @Author: peii * @Author: peii
* @Date: 2021-12-29 11:26:53 * @Date: 2021-12-29 11:26:53
* @LastEditTime: 2022-01-07 12:00:23 * @LastEditTime: 2022-01-11 08:38:02
* @LastEditors: peii * @LastEditors: PEII
* @Vision: 1.0 * @Vision: 1.0
* @Description: 开票申请详情 * @Description: 开票申请详情
*/ */
...@@ -125,7 +125,7 @@ class InvoiceApplyDetail extends Component<IProps> { ...@@ -125,7 +125,7 @@ class InvoiceApplyDetail extends Component<IProps> {
<Text style={g(styles, 'item-info__text')}>规格型号: {item.customer_specification}</Text> <Text style={g(styles, 'item-info__text')}>规格型号: {item.customer_specification}</Text>
<Text style={g(styles, 'item-info__text')}>存储条件: {item.storage_condition_name}</Text> <Text style={g(styles, 'item-info__text')}>存储条件: {item.storage_condition_name}</Text>
<Text style={g(styles, 'item-info__text')}>注册证号: {item.reg_number}</Text> <Text style={g(styles, 'item-info__text')}>注册证号: {item.reg_number}</Text>
<Text style={g(styles, 'item-info__text', 'item-info-line__text')}>数量: {item.invoice_quantity}</Text> <Text style={g(styles, 'item-info__text', 'item-info-line__text')}>数量: {item.quantity}</Text>
<Text style={g(styles, 'item-info__text', 'item-info-line__text')}>金额: {item.invoice_amount}</Text> <Text style={g(styles, 'item-info__text', 'item-info-line__text')}>金额: {item.invoice_amount}</Text>
</View> </View>
</View> </View>
...@@ -133,14 +133,13 @@ class InvoiceApplyDetail extends Component<IProps> { ...@@ -133,14 +133,13 @@ class InvoiceApplyDetail extends Component<IProps> {
} }
render() { render() {
const title = this.props.navigation.getParam('title')
const { order } = this.state const { order } = this.state
return ( return (
<View style={g(styles, 'container')}> <View style={g(styles, 'container')}>
<Resolution.FixWidthView> <Resolution.FixWidthView>
<Header <Header
title={title} title="开票详情"
backCallback={() => { backCallback={() => {
this.props.navigation.goBack() this.props.navigation.goBack()
}} }}
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
* @FilePath: /BoneHouse_Business_APP/src/pages/invoice/distribution/components/filter.tsx * @FilePath: /BoneHouse_Business_APP/src/pages/invoice/distribution/components/filter.tsx
* @Author: peii * @Author: peii
* @Date: 2021-12-19 10:49:42 * @Date: 2021-12-19 10:49:42
* @LastEditTime: 2022-01-07 11:11:06 * @LastEditTime: 2022-01-11 09:22:40
* @LastEditors: peii * @LastEditors: PEII
* @Vision: 1.0 * @Vision: 1.0
* @Description: 过滤弹窗 * @Description: 过滤弹窗
*/ */
...@@ -15,7 +15,7 @@ import { connect } from 'react-redux' ...@@ -15,7 +15,7 @@ import { connect } from 'react-redux'
import * as R from 'ramda' import * as R from 'ramda'
import { IFormField } from 'bonehouse' import { IFormField } from 'bonehouse'
import api from '../../../../services/api' import api from '../../../../services/api'
import { isNotBlank, g, getFormItem } from '../../../../utils/utils' import { isNotBlank, g, getFormItem, show, isBlank } from '../../../../utils/utils'
import { FieldType } from '../../../../enums' import { FieldType } from '../../../../enums'
import FilterModal from '../../../../components/modals/filter/filter' import FilterModal from '../../../../components/modals/filter/filter'
import styles from './filter.styl' import styles from './filter.styl'
...@@ -50,12 +50,12 @@ class Filter extends React.Component<IProps, IState> { ...@@ -50,12 +50,12 @@ class Filter extends React.Component<IProps, IState> {
seller_code: this.props.userInfo.user_name, seller_code: this.props.userInfo.user_name,
}, },
filterItems: [ filterItems: [
{ {
field: 'customer_code', field: 'customer_code',
label: '客户', label: '客户',
type: FieldType.SELECT, type: FieldType.SELECT,
rules: [{ required: true, message: '请选择客户' }], rules: [{ required: true, message: '请选择客户' }],
refrence: ['org_code'],
}, },
], ],
} }
...@@ -77,10 +77,11 @@ class Filter extends React.Component<IProps, IState> { ...@@ -77,10 +77,11 @@ class Filter extends React.Component<IProps, IState> {
* @param {*} value 输入值 * @param {*} value 输入值
* @return {*} * @return {*}
*/ */
setData(key: string, value: any) { setData(key: string, value: any, callback = () => {}) {
const { data, isAutoOpen } = this.state const { data, isAutoOpen, formItems } = this.state
data[key] = value data[key] = value
this.setState({ data }, () => { this.setState({ data }, () => {
callback && callback()
if (!isAutoOpen) return if (!isAutoOpen) return
const isAllParamSet = R.compose( const isAllParamSet = R.compose(
R.all(isNotBlank), R.all(isNotBlank),
...@@ -107,17 +108,22 @@ class Filter extends React.Component<IProps, IState> { ...@@ -107,17 +108,22 @@ class Filter extends React.Component<IProps, IState> {
filterItems = [...prefixFilterItems, ...filterItems, ...otherFilterItems] filterItems = [...prefixFilterItems, ...filterItems, ...otherFilterItems]
this.setState({ filterItems, data }) this.setState({ filterItems, data })
if (!showOrg) return // if (!showOrg) return
const item = { const item = {
field: 'org_code', field: 'org_code',
label: '组织', label: '组织',
type: FieldType.SELECT, type: FieldType.SELECT,
options: [], options: [],
display: showOrg,
rules: [{ required: true, message: '请选择组织' }], rules: [{ required: true, message: '请选择组织' }],
callback: () => {
data.customer_code = ''
this.getCustomers()
},
} }
filterItems = R.insert(1, item, filterItems) filterItems = R.insert(0, item, filterItems)
this.getOrganizations() this.getOrganizations(showOrg)
this.setState({ filterItems, data }) this.setState({ filterItems, data })
} }
...@@ -126,7 +132,7 @@ class Filter extends React.Component<IProps, IState> { ...@@ -126,7 +132,7 @@ class Filter extends React.Component<IProps, IState> {
* @param {*} * @param {*}
* @return {*} * @return {*}
*/ */
async getOrganizations() { async getOrganizations(showOrg) {
const res = await api.getOrganizations() const res = await api.getOrganizations()
if (res.error_code) return if (res.error_code) return
...@@ -141,6 +147,9 @@ class Filter extends React.Component<IProps, IState> { ...@@ -141,6 +147,9 @@ class Filter extends React.Component<IProps, IState> {
), ),
R.pathOr([], ['data', 'organizations']), R.pathOr([], ['data', 'organizations']),
)(res) )(res)
if (!showOrg && R.length(item.options) !== 1) {
show('请先选组织')
}
this.setState({ filterItems }) this.setState({ filterItems })
} }
...@@ -197,7 +206,15 @@ class Filter extends React.Component<IProps, IState> { ...@@ -197,7 +206,15 @@ class Filter extends React.Component<IProps, IState> {
* @return {*} * @return {*}
*/ */
filterHandler() { filterHandler() {
const { data, customers } = this.state const { data, customers, filterItems } = this.state
const items = R.filter(R.pathEq(['rules', 0, 'required'], true))(filterItems)
for (const item of items) {
if (isBlank(data[item.field])) {
return show(`请选择${item.label}`)
}
}
this.props.searchHandler && this.props.searchHandler(data, customers) this.props.searchHandler && this.props.searchHandler(data, customers)
this.onClose() this.onClose()
} }
...@@ -211,7 +228,7 @@ class Filter extends React.Component<IProps, IState> { ...@@ -211,7 +228,7 @@ class Filter extends React.Component<IProps, IState> {
style={g(styles, 'filter-modal')} style={g(styles, 'filter-modal')}
visible={visible} visible={visible}
data={data} data={data}
filterItems={filterItems} filterItems={R.reject(R.propEq('display', false), filterItems)}
onClose={this.onClose} onClose={this.onClose}
setData={this.setData} setData={this.setData}
resetHandler={this.resetHandler} resetHandler={this.resetHandler}
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
* @FilePath: /BoneHouse_Business_APP/src/pages/invoice/distribution/index.tsx * @FilePath: /BoneHouse_Business_APP/src/pages/invoice/distribution/index.tsx
* @Author: peii * @Author: peii
* @Date: 2021-12-27 09:59:21 * @Date: 2021-12-27 09:59:21
* @LastEditTime: 2022-01-07 11:13:22 * @LastEditTime: 2022-01-11 09:20:24
* @LastEditors: peii * @LastEditors: PEII
* @Vision: 1.0 * @Vision: 1.0
* @Description: 分销开票申请 * @Description: 分销开票申请
*/ */
...@@ -39,7 +39,7 @@ class Distribution extends Component<IProps, IState> { ...@@ -39,7 +39,7 @@ class Distribution extends Component<IProps, IState> {
constructor(props) { constructor(props) {
super(props) super(props)
this.toggleModalVisible = this.toggleModalVisible.bind(this) this.toggleModalVisible = this.toggleModalVisible.bind(this)
this.getData = this.getData.bind(this) this.getData = debounce(this.getData.bind(this), 200)
this.getLineData = this.getLineData.bind(this) this.getLineData = this.getLineData.bind(this)
this.selectAllHandler = this.selectAllHandler.bind(this) this.selectAllHandler = this.selectAllHandler.bind(this)
this.submitHandler = debounce(this.submitHandler.bind(this), 200) this.submitHandler = debounce(this.submitHandler.bind(this), 200)
...@@ -66,19 +66,19 @@ class Distribution extends Component<IProps, IState> { ...@@ -66,19 +66,19 @@ class Distribution extends Component<IProps, IState> {
customers: [], customers: [],
submitting: false, submitting: false,
prefixFilterItems: [ prefixFilterItems: [
{ // {
field: 'seller_code', // field: 'seller_code',
label: '销售员', // label: '销售员',
disabled: true, // disabled: true,
type: FieldType.SELECT, // type: FieldType.SELECT,
options: [ // options: [
{ // {
value: this.props.userInfo.user_name, // value: this.props.userInfo.user_name,
label: this.props.userInfo.person_name, // label: this.props.userInfo.person_name,
}, // },
], // ],
rules: [{ required: true, message: '请选择客户' }], // rules: [{ required: true, message: '请选择客户' }],
}, // },
], ],
} }
...@@ -120,16 +120,17 @@ class Distribution extends Component<IProps, IState> { ...@@ -120,16 +120,17 @@ class Distribution extends Component<IProps, IState> {
const status = R.compose( const status = R.compose(
R.join(','), R.join(','),
R.reject(R.includes(R.__, ['ENTERED', 'REJECTED', 'CANCELED'])), R.filter(R.includes(R.__, ['APPROVED'])),
R.pluck('value_code'), R.pluck('value_code'),
R.propOr([], 'status'), R.propOr([], 'status'),
)(this.props) )(this.props)
args.invoice_flag = 'Y'
args.header_status = status args.header_status = status
const params = { const params = R.filter(isNotBlank)({
...args, ...args,
...pagination, ...pagination,
} })
if (!isRefresh && !isNext) { if (!isRefresh && !isNext) {
this.setState({ loading: true }) this.setState({ loading: true })
} }
...@@ -159,6 +160,7 @@ class Distribution extends Component<IProps, IState> { ...@@ -159,6 +160,7 @@ class Distribution extends Component<IProps, IState> {
async getLineData(order, loading = false) { async getLineData(order, loading = false) {
const params = { const params = {
settlement_number: order.settlement_number, settlement_number: order.settlement_number,
invoice_flag: 'Y',
} }
this.setState({ loading }) this.setState({ loading })
const res = await api.getSettlementLines(params) const res = await api.getSettlementLines(params)
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
* @FilePath: /BoneHouse_Business_APP/src/pages/settlement/collection.tsx * @FilePath: /BoneHouse_Business_APP/src/pages/settlement/collection.tsx
* @Author: peii * @Author: peii
* @Date: 2021-12-18 16:33:37 * @Date: 2021-12-18 16:33:37
* @LastEditTime: 2021-12-23 19:07:42 * @LastEditTime: 2022-01-10 18:52:47
* @LastEditors: peii * @LastEditors: PEII
* @Vision: 1.0 * @Vision: 1.0
* @Description: 结算汇总 * @Description: 结算汇总
*/ */
...@@ -104,10 +104,11 @@ class SettlementCollection extends React.Component<IProps, IState> { ...@@ -104,10 +104,11 @@ class SettlementCollection extends React.Component<IProps, IState> {
args = filterData args = filterData
} }
const params = { const params = R.filter(isNotBlank)({
...args, ...args,
...pagination, ...pagination,
} })
if (!isRefresh && !isNext) { if (!isRefresh && !isNext) {
this.setState({ loading: true }) this.setState({ loading: true })
} }
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
* @FilePath: /BoneHouse_Business_APP/src/pages/settlement/components/filter.tsx * @FilePath: /BoneHouse_Business_APP/src/pages/settlement/components/filter.tsx
* @Author: peii * @Author: peii
* @Date: 2021-12-19 10:49:42 * @Date: 2021-12-19 10:49:42
* @LastEditTime: 2021-12-23 16:04:58 * @LastEditTime: 2022-01-11 09:29:12
* @LastEditors: peii * @LastEditors: PEII
* @Vision: 1.0 * @Vision: 1.0
* @Description: 过滤弹窗 * @Description: 过滤弹窗
*/ */
...@@ -15,7 +15,7 @@ import { connect } from 'react-redux' ...@@ -15,7 +15,7 @@ import { connect } from 'react-redux'
import * as R from 'ramda' import * as R from 'ramda'
import { IFormField } from 'bonehouse' import { IFormField } from 'bonehouse'
import api from '../../../services/api' import api from '../../../services/api'
import { isNotBlank, g, getFormItem } from '../../../utils/utils' import { isNotBlank, g, getFormItem, show, isBlank } from '../../../utils/utils'
import { FieldType } from '../../../enums' import { FieldType } from '../../../enums'
import FilterModal from '../../../components/modals/filter/filter' import FilterModal from '../../../components/modals/filter/filter'
import styles from './filter.styl' import styles from './filter.styl'
...@@ -89,10 +89,11 @@ class Filter extends React.Component<IProps, IState> { ...@@ -89,10 +89,11 @@ class Filter extends React.Component<IProps, IState> {
* @param {*} value 输入值 * @param {*} value 输入值
* @return {*} * @return {*}
*/ */
setData(key: string, value: any) { setData(key: string, value: any, callback = () => {}) {
const { data, isAutoOpen } = this.state const { data, isAutoOpen } = this.state
data[key] = value data[key] = value
this.setState({ data }, () => { this.setState({ data }, () => {
callback()
if (!isAutoOpen) return if (!isAutoOpen) return
const isAllParamSet = R.compose( const isAllParamSet = R.compose(
R.all(isNotBlank), R.all(isNotBlank),
...@@ -118,17 +119,22 @@ class Filter extends React.Component<IProps, IState> { ...@@ -118,17 +119,22 @@ class Filter extends React.Component<IProps, IState> {
filterItems = R.concat(filterItems)(otherFilterItems) filterItems = R.concat(filterItems)(otherFilterItems)
this.setState({ filterItems, data }) this.setState({ filterItems, data })
if (!showOrg) return // if (!showOrg) return
const item = { const item = {
field: 'org_code', field: 'org_code',
label: '组织', label: '组织',
type: FieldType.SELECT, type: FieldType.SELECT,
options: [], options: [],
display: showOrg,
rules: [{ required: true, message: '请选择组织' }], rules: [{ required: true, message: '请选择组织' }],
callback: () => {
data.customer_code = ''
this.getCustomers()
}
} }
filterItems = R.insert(1, item, filterItems) filterItems = R.insert(1, item, filterItems)
this.getOrganizations() this.getOrganizations(showOrg)
this.setState({ filterItems, data }) this.setState({ filterItems, data })
} }
...@@ -137,7 +143,7 @@ class Filter extends React.Component<IProps, IState> { ...@@ -137,7 +143,7 @@ class Filter extends React.Component<IProps, IState> {
* @param {*} * @param {*}
* @return {*} * @return {*}
*/ */
async getOrganizations() { async getOrganizations(showOrg) {
const res = await api.getOrganizations() const res = await api.getOrganizations()
if (res.error_code) return if (res.error_code) return
...@@ -152,6 +158,9 @@ class Filter extends React.Component<IProps, IState> { ...@@ -152,6 +158,9 @@ class Filter extends React.Component<IProps, IState> {
), ),
R.pathOr([], ['data', 'organizations']), R.pathOr([], ['data', 'organizations']),
)(res) )(res)
if (!showOrg && R.length(item.options) !== 1) {
show('请先选组织')
}
this.setState({ filterItems }) this.setState({ filterItems })
} }
...@@ -207,7 +216,14 @@ class Filter extends React.Component<IProps, IState> { ...@@ -207,7 +216,14 @@ class Filter extends React.Component<IProps, IState> {
* @return {*} * @return {*}
*/ */
filterHandler() { filterHandler() {
const { data } = this.state const { data, filterItems } = this.state
const items = R.filter(R.pathEq(['rules', 0, 'required'], true))(filterItems)
for (const item of items) {
if (isBlank(data[item.field])) {
return show(`请选择${item.label}`)
}
}
this.props.searchHandler && this.props.searchHandler(data) this.props.searchHandler && this.props.searchHandler(data)
this.onClose() this.onClose()
} }
...@@ -221,7 +237,7 @@ class Filter extends React.Component<IProps, IState> { ...@@ -221,7 +237,7 @@ class Filter extends React.Component<IProps, IState> {
style={g(styles, 'filter-modal')} style={g(styles, 'filter-modal')}
visible={visible} visible={visible}
data={data} data={data}
filterItems={filterItems} filterItems={R.reject(R.propEq('display', false))(filterItems)}
onClose={this.onClose} onClose={this.onClose}
setData={this.setData} setData={this.setData}
resetHandler={this.resetHandler} resetHandler={this.resetHandler}
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
* @FilePath: /BoneHouse_Business_APP/src/pages/settlement/index.tsx * @FilePath: /BoneHouse_Business_APP/src/pages/settlement/index.tsx
* @Author: peii * @Author: peii
* @Date: 2021-12-18 16:33:37 * @Date: 2021-12-18 16:33:37
* @LastEditTime: 2021-12-24 10:08:29 * @LastEditTime: 2022-01-10 17:55:54
* @LastEditors: peii * @LastEditors: PEII
* @Vision: 1.0 * @Vision: 1.0
* @Description: 结算确认首页 * @Description: 结算确认首页
*/ */
...@@ -84,10 +84,10 @@ class Settlement extends React.Component<IProps, IState> { ...@@ -84,10 +84,10 @@ class Settlement extends React.Component<IProps, IState> {
} }
args.header_status = 'ENTERED' args.header_status = 'ENTERED'
const params = { const params = R.filter(isNotBlank)({
...args, ...args,
...pagination, ...pagination,
} })
if (!isRefresh && !isNext) { if (!isRefresh && !isNext) {
this.setState({ loading: true }) this.setState({ loading: true })
} }
......
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