Merge branch '20221011-标书费功能优化,增加免费选项' into 'release_20221028'

10.28 标书费功能优化,增加免费选项

See merge request eshop/fe_service_ebtp_frontend!38
This commit is contained in:
jl-zhoujl2
2022-10-28 06:18:10 +00:00
4 changed files with 43 additions and 25 deletions

View File

@ -1,5 +1,5 @@
import React, { useEffect, useState } from 'react'; import React, { useEffect, useRef, useState } from 'react';
import ProTable, { ProColumns } from '@ant-design/pro-table'; import ProTable, { ActionType, ProColumns } from '@ant-design/pro-table';
import { Button, Descriptions, Form, Input, message, Radio, Spin } from 'antd'; import { Button, Descriptions, Form, Input, message, Radio, Spin } from 'antd';
import styles from './indexStyles.less'; import styles from './indexStyles.less';
import '@/assets/xsy_style.less' import '@/assets/xsy_style.less'
@ -83,25 +83,40 @@ const costConfig: React.FC<{}> = () => {
{ title: '序号', valueType: 'index', width: 50 }, { title: '序号', valueType: 'index', width: 50 },
{ title: showName.sec, dataIndex: 'sectionName', }, { title: showName.sec, dataIndex: 'sectionName', },
{ {
title: showName.bsf + '(元)', dataIndex: 'expenses1Amount', title: showName.bsf + '(元)', dataIndex: 'expenses1Amount', width: '20%',
render: (_, record) => { render: (_, record) => {
return ( return (
<Form form={form}> <Form form={form}>
<FormItem <Radio.Group disabled={returnDisabled(record.sendOut)} onChange={(event) => {
name={`expenses1Amount${record.key}`} const value = event.target.value;
rules={[ if (value != undefined) {
{ pattern: /^[0-9]+(\.[0-9]{1,2})?$/, message: '请输入正确数值(最多2位小数)' }, const data = [...costData];
{ pattern: /^.{0,21}$/, message: '超长' } const now = data[data.findIndex(item => item.sectionId === record.sectionId)];
]} now.expenses1Type = value;
> record.expenses1Amount = 0;
<Input setCostData(data);
readOnly={returnDisabled(record.sendOut)} }
style={{ width: '80%', maxWidth: '300px' }} }} value={parseInt(record.expenses1Type)}>
placeholder={`请输入${showName.bsf}`} <Radio value={0} className={styles.radioStyle}></Radio>
defaultValue={record.expenses1Amount} <Radio value={2} className={styles.radioStyle}>
onBlur={(event) => record.expenses1Amount = event.target.value} {parseInt(record.expenses1Type) == 2 ? <><FormItem
/> name={`expenses1Amount${record.key}`}
</FormItem> style={{ display: 'inline-block', width: '60%', paddingLeft: '6px', position: 'relative', top: '-4px' }}
rules={[
{ pattern: /^[0-9]+(\.[0-9]{1,2})?$/, message: '请输入正确数值(最多2位小数)' },
{ pattern: /^.{0,21}$/, message: '超长' }
]}
>
<Input
readOnly={returnDisabled(record.sendOut)}
size="small"
type="number"
placeholder={`请输入${showName.bsf}`}
defaultValue={record.expenses1Amount}
onBlur={(event) => record.expenses1Amount = event.target.value}
/>
</FormItem> </> : null}</Radio>
</Radio.Group>
</Form> </Form>
) )
} }

View File

@ -43,13 +43,15 @@ const Complete: React.FC<{}> = () => {
{ title: '费用内容描述', dataIndex: 'commodityDescribe', width: '25%' }, { title: '费用内容描述', dataIndex: 'commodityDescribe', width: '25%' },
{ title: '下单时间', dataIndex: 'createDate', width: '10%', valueType: 'dateTime' }, { title: '下单时间', dataIndex: 'createDate', width: '10%', valueType: 'dateTime' },
{ title: '支付时间', dataIndex: 'paymentTime', width: '10%', valueType: 'dateTime' }, { title: '支付时间', dataIndex: 'paymentTime', width: '10%', valueType: 'dateTime' },
{ title: '金额(元)', dataIndex: 'amount', width: '4%' }, { title: '金额(元)', dataIndex: 'amount', width: '6%', render: (_, record) => record.chargeType == "0" ? "免费" : record.amount },
{ {
title: '操作', title: '操作',
dataIndex: 'option', dataIndex: 'option',
width: '3%',
valueType: 'option', valueType: 'option',
render: (_, record) => { render: (_, record) => {
if (record.chargeType == "0") {//免费无需申请发票
return null;
}
if (record.bidInvoice == null) { if (record.bidInvoice == null) {
return <Button return <Button
type="text" type="text"
@ -97,10 +99,11 @@ const Complete: React.FC<{}> = () => {
options={false} options={false}
rowSelection={{ rowSelection={{
getCheckboxProps: (record) => ({ getCheckboxProps: (record) => ({
disabled: record.bidInvoice == null ? false : true disabled: record.bidInvoice == null ? record.chargeType == "0" : true
}), }),
columnWidth: '1px', preserveSelectedRowKeys: true,
fixed: true, // columnWidth: '50px',
// fixed: true,
}} }}
pagination={{ defaultPageSize: 10 }} //默认显示条数 pagination={{ defaultPageSize: 10 }} //默认显示条数
// bordered // bordered

View File

@ -189,7 +189,7 @@ const IParticipate: React.FC = () => {
{ {
title: flowName[moduleName.cost], title: flowName[moduleName.cost],
dataIndex: 'amount', dataIndex: 'amount',
render: (_: any, record: any, index: number) => digitalConversionAmount(record.amount, 2) render: (_: any, record: any, index: number) => record.chargeType == "0" ? "免费" : digitalConversionAmount(record.amount, 2)
}, },
{ {
title: flowName[moduleName.fileName] + '文件获取开始时间', title: flowName[moduleName.fileName] + '文件获取开始时间',

View File

@ -180,7 +180,7 @@ const IParticipate: React.FC = () => {
{ {
title: '招募文件费用(元)', title: '招募文件费用(元)',
dataIndex: 'amount', dataIndex: 'amount',
render: (_: any, record: any, index: number) => digitalConversionAmount(record.amount, 2) render: (_: any, record: any, index: number) => record.chargeType == "0" ? "免费" : digitalConversionAmount(record.amount, 2)
}, },
{ {
title: '招募文件获取开始时间', title: '招募文件获取开始时间',