Commit 50df9447 by peii

结算及临高下单调整

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