10.11 标书费功能优化,增加免费选项
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import ProTable, { ProColumns } from '@ant-design/pro-table';
|
||||
import React, { useEffect, useRef, useState } from 'react';
|
||||
import ProTable, { ActionType, ProColumns } from '@ant-design/pro-table';
|
||||
import { Button, Descriptions, Form, Input, message, Radio, Spin } from 'antd';
|
||||
import styles from './indexStyles.less';
|
||||
import '@/assets/xsy_style.less'
|
||||
@ -83,25 +83,40 @@ const costConfig: React.FC<{}> = () => {
|
||||
{ title: '序号', valueType: 'index', width: 50 },
|
||||
{ title: showName.sec, dataIndex: 'sectionName', },
|
||||
{
|
||||
title: showName.bsf + '(元)', dataIndex: 'expenses1Amount',
|
||||
title: showName.bsf + '(元)', dataIndex: 'expenses1Amount', width: '20%',
|
||||
render: (_, record) => {
|
||||
return (
|
||||
<Form form={form}>
|
||||
<FormItem
|
||||
name={`expenses1Amount${record.key}`}
|
||||
rules={[
|
||||
{ pattern: /^[0-9]+(\.[0-9]{1,2})?$/, message: '请输入正确数值(最多2位小数)' },
|
||||
{ pattern: /^.{0,21}$/, message: '超长' }
|
||||
]}
|
||||
>
|
||||
<Input
|
||||
readOnly={returnDisabled(record.sendOut)}
|
||||
style={{ width: '80%', maxWidth: '300px' }}
|
||||
placeholder={`请输入${showName.bsf}`}
|
||||
defaultValue={record.expenses1Amount}
|
||||
onBlur={(event) => record.expenses1Amount = event.target.value}
|
||||
/>
|
||||
</FormItem>
|
||||
<Radio.Group disabled={returnDisabled(record.sendOut)} onChange={(event) => {
|
||||
const value = event.target.value;
|
||||
if (value != undefined) {
|
||||
const data = [...costData];
|
||||
const now = data[data.findIndex(item => item.sectionId === record.sectionId)];
|
||||
now.expenses1Type = value;
|
||||
record.expenses1Amount = 0;
|
||||
setCostData(data);
|
||||
}
|
||||
}} value={parseInt(record.expenses1Type)}>
|
||||
<Radio value={0} className={styles.radioStyle}>免费</Radio>
|
||||
<Radio value={2} className={styles.radioStyle}>收费
|
||||
{parseInt(record.expenses1Type) == 2 ? <><FormItem
|
||||
name={`expenses1Amount${record.key}`}
|
||||
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>
|
||||
)
|
||||
}
|
||||
|
@ -43,13 +43,15 @@ const Complete: React.FC<{}> = () => {
|
||||
{ title: '费用内容描述', dataIndex: 'commodityDescribe', width: '25%' },
|
||||
{ title: '下单时间', dataIndex: 'createDate', 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: '操作',
|
||||
dataIndex: 'option',
|
||||
width: '3%',
|
||||
valueType: 'option',
|
||||
render: (_, record) => {
|
||||
if (record.chargeType == "0") {//免费无需申请发票
|
||||
return null;
|
||||
}
|
||||
if (record.bidInvoice == null) {
|
||||
return <Button
|
||||
type="text"
|
||||
@ -97,10 +99,11 @@ const Complete: React.FC<{}> = () => {
|
||||
options={false}
|
||||
rowSelection={{
|
||||
getCheckboxProps: (record) => ({
|
||||
disabled: record.bidInvoice == null ? false : true
|
||||
disabled: record.bidInvoice == null ? record.chargeType == "0" : true
|
||||
}),
|
||||
columnWidth: '1px',
|
||||
fixed: true,
|
||||
preserveSelectedRowKeys: true,
|
||||
// columnWidth: '50px',
|
||||
// fixed: true,
|
||||
}}
|
||||
pagination={{ defaultPageSize: 10 }} //默认显示条数
|
||||
// bordered
|
||||
|
@ -189,7 +189,7 @@ const IParticipate: React.FC = () => {
|
||||
{
|
||||
title: flowName[moduleName.cost],
|
||||
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] + '文件获取开始时间',
|
||||
|
@ -180,7 +180,7 @@ const IParticipate: React.FC = () => {
|
||||
{
|
||||
title: '招募文件费用(元)',
|
||||
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: '招募文件获取开始时间',
|
||||
|
Reference in New Issue
Block a user