Commit 9de56809 authored by 前端-钟卫鹏's avatar 前端-钟卫鹏

fix: 处理新增招标资格预审/在线评标/目标价初始值问题,处理新增采购订单自提物流方式没有显示地址问题

parent 788b8752
......@@ -205,6 +205,12 @@ const AddNewBid:React.FC<AddNewBidProps> = (props) => {
state.props.enum = addressRes.data.map(item => ({ label: item.fullAddress, value: item.id }))
})
if(pageStatus === PageStatus.ADD) {
ctx.setFieldValue('hasAimPrice', true)
ctx.setFieldValue('isQualificationCheck', true)
ctx.setFieldValue('isOnlineEvaluation', true)
}
$('onFieldValueChange', 'inviteTenderType').subscribe(state => {
if(state.value === PUBLIC_BID) {
if(pageStatus === PageStatus.EDIT && !publicFlag.current) {
......
......@@ -292,7 +292,7 @@ const bidRequestInfo: ISchema = {
}
},
hasAimPrice: {
type: 'number',
// type: 'boolean',
"x-component": 'CheckboxSingle',
"x-component-props": {
children: '是否有目标价',
......@@ -301,7 +301,7 @@ const bidRequestInfo: ISchema = {
}
},
title: '{{help("目标价", "招标项目期望成交价格")}}',
default: 0,
default: true,
"x-linkages": [
{
type: 'value:visible',
......@@ -452,7 +452,7 @@ const qualificationNeedInfo: ISchema = {
},
properties: {
isQualificationCheck: {
type: 'boolean',
// type: 'boolean',
"x-component": 'CheckboxSingle',
"x-component-props": {
children: '需要资格预审',
......@@ -586,7 +586,7 @@ const evaluationNeedInfo: ISchema = {
description: '一次上传一个文件,每个附件大小不能超过20M',
},
isOnlineEvaluation: {
type: 'number',
// type: 'boolean',
required: true,
"x-component": 'CheckboxSingle',
"x-component-props": {
......@@ -596,7 +596,7 @@ const evaluationNeedInfo: ISchema = {
}
},
title: '{{help("是否在线评标", "在线进行评标打分")}}',
default: 1,
default: true,
// "x-linkages": [
// {
// type: 'value:visible',
......
......@@ -63,49 +63,54 @@ export const GivenBidItem:React.FC<GivenBidItemProps> = ({
}
return <div className={style.throwBidInfo}>
<div className={style['card-list']}>
<Row>
<Col span={8}><p className={style['card-list_title']}>含税单价:</p></Col>
<Col><p>{currentData[currentColumn.dataIndex]['price']}</p></Col>
</Row>
</div>
<div className={style['card-list']}>
<Row>
<Col span={8}><p className={style['card-list_title']}>含税金额:</p></Col>
<Col><p>{(currentData[currentColumn.dataIndex]['price'] * currentData['count']).toFixed(2)}</p></Col>
</Row>
</div>
<div className={style['card-list']}>
<Row>
<Col span={8}><p className={style['card-list_title']}>是否含税:</p></Col>
<Col><p>{currentData[currentColumn.dataIndex]['isTax'] ? '是' : '否'}</p></Col>
</Row>
</div>
<div className={style['card-list']}>
<Row>
<Col span={8}><p className={style['card-list_title']}>税率:</p></Col>
<Col><p>{currentData[currentColumn.dataIndex]['taxRate']}</p></Col>
</Row>
</div>
<div className={style['card-list']}>
<Row>
<Col span={8}><p className={style['card-list_title']}>授标:</p></Col>
<Col>
<p>
<Checkbox defaultChecked={currentData[currentColumn.dataIndex]['isAward']} style={{marginRight: 16}} onChange={chanegChecked} />
<InputNumber
defaultValue={currentData[currentColumn.dataIndex]['awardRate']}
min={0}
max={100}
formatter={value => `${value}%`}
parser={value => value.replace('%', '')}
onChange={onChangeInput}
style={{display: 'none'}}
/>
</p>
</Col>
</Row>
</div>
{
currentData[currentColumn.dataIndex] ? <>
<div className={style['card-list']}>
<Row>
<Col span={8}><p className={style['card-list_title']}>含税单价:</p></Col>
<Col><p>{currentData[currentColumn.dataIndex]['price']}</p></Col>
</Row>
</div>
<div className={style['card-list']}>
<Row>
<Col span={8}><p className={style['card-list_title']}>含税金额:</p></Col>
<Col><p>{(currentData[currentColumn.dataIndex]['price'] * currentData['count']).toFixed(2)}</p></Col>
</Row>
</div>
<div className={style['card-list']}>
<Row>
<Col span={8}><p className={style['card-list_title']}>是否含税:</p></Col>
<Col><p>{currentData[currentColumn.dataIndex]['isTax'] ? '是' : '否'}</p></Col>
</Row>
</div>
<div className={style['card-list']}>
<Row>
<Col span={8}><p className={style['card-list_title']}>税率:</p></Col>
<Col><p>{currentData[currentColumn.dataIndex]['taxRate']}</p></Col>
</Row>
</div>
<div className={style['card-list']}>
<Row>
<Col span={8}><p className={style['card-list_title']}>授标:</p></Col>
<Col>
<p>
<Checkbox defaultChecked={currentData[currentColumn.dataIndex]['isAward']} style={{marginRight: 16}} onChange={chanegChecked} />
<InputNumber
defaultValue={currentData[currentColumn.dataIndex]['awardRate']}
min={0}
max={100}
formatter={value => `${value}%`}
parser={value => value.replace('%', '')}
onChange={onChangeInput}
style={{display: 'none'}}
/>
</p>
</Col>
</Row>
</div>
</>
: null
}
</div>
}
......
......@@ -138,7 +138,7 @@ const BidConfirm: React.FC<BidConfirmProps> = ({cardTitle}) => {
{
tableColumns.map((_item, _index) => {
const { title, dataIndex } = _item
if(title === '采购物料') {
if(title === '采购物料' && item[dataIndex]) {
return (<Col span={4} style={{paddingTop: 0, marginTop: 0}}>
<div className={style.materialInfo}>
<span className={style.rankNumber}>{index+1}</span>
......
import React, { useState, useRef, useContext, useEffect } from 'react'
import { Form, Input, Select } from 'antd';
import React, { useState, useRef, useContext, useEffect, useCallback } from 'react'
import { Form, Input, Select, Popover, Row } from 'antd';
import { EnvironmentOutlined } from '@ant-design/icons';
import { PublicApi } from '@/services/api';
export interface MaterialTableCellProps {
title: React.ReactNode;
......@@ -46,6 +48,19 @@ export const MaterialTableCell:React.FC<MaterialTableCellProps> = ({
const formItemRef = useRef<any>();
const { form } = useContext(EditableContext);
// 是否显示地址
const [showAddress, setShowAddress] = useState<boolean>(false)
// 地址信息
const [receiveInfo, setReceiveInfo] = useState<any>()
const getReceiveInfo = async () => {
const { data: deliveryAddress} = await PublicApi.getLogisticsSelectListMemberShipperAddress({
memberId: record.memberId,
roleId: record.memberRoleId
})
setReceiveInfo(() => deliveryAddress.filter(item => item.isDefault)[0])
}
const save = async e => {
try {
const values = await form.validateFields();
......@@ -59,6 +74,13 @@ export const MaterialTableCell:React.FC<MaterialTableCellProps> = ({
// select的change
const change = async (va, op, idx) => {
console.log(va, op, idx)
// 自提情况下 显示地址
if(va === 2) {
setShowAddress(true)
getReceiveInfo()
} else {
setShowAddress(false)
}
try {
const values = await form.validateFields();
values[idx] = op['label']
......@@ -113,35 +135,58 @@ export const MaterialTableCell:React.FC<MaterialTableCellProps> = ({
callback(err)
}
}
console.log(record, 'cell rrr')
let childNode = children;
if (editable) {
childNode =
<Form.Item
style={{ margin: 0 }}
name={dataIndex}
initialValue={record[dataIndex] || ''}
rules={dataIndex === 'purchaseCount' ? [
{
required: true,
message: `${title}必须填写`,
},
{
pattern: /^\d+(\.\d{1,3})?$/,
message: '采购数量仅限三位小数',
},
{
validator: validatorNumber
},
] : [
{
required: true,
message: `${title}必须填写`,
}
]}
>
{chooseFormItem(formItem, record[dataIndex] || '')}
</Form.Item>
<>
<Form.Item
style={{ margin: 0 }}
name={dataIndex}
initialValue={record[dataIndex] || ''}
rules={dataIndex === 'purchaseCount' ? [
{
required: true,
message: `${title}必须填写`,
},
{
pattern: /^\d+(\.\d{1,3})?$/,
message: '采购数量仅限三位小数',
},
{
validator: validatorNumber
},
] : [
{
required: true,
message: `${title}必须填写`,
}
]}
>
{chooseFormItem(formItem, record[dataIndex] || '')}
</Form.Item>
{
showAddress
?
<Popover content={
<Row>
<div>
<h3><EnvironmentOutlined/> 自提地址</h3>
{
receiveInfo && <>
<p>{receiveInfo.shipperName} / {receiveInfo.phone}</p>
<p>{receiveInfo.provinceName + receiveInfo.cityName + receiveInfo.districtName + receiveInfo.address || receiveInfo.fullAddress}</p>
</>
}
</div>
</Row>
}>
<span style={{position: 'absolute', right: 0, top: '42%', }}><EnvironmentOutlined/></span>
</Popover>
:
null
}
</>
}
return <td {...restProps}>{childNode}</td>;
......
......@@ -76,7 +76,7 @@ const orderProductShopTypeMaps = {
export const AddressPop = (props) => {
const { pickInfo = null, children } = props
let receiveInfo = pickInfo?.render && JSON.parse(pickInfo.render)
let receiveInfo = pickInfo?.render && typeof pickInfo.render === 'object' ? pickInfo.render : JSON.parse(pickInfo.render)
return pickInfo && pickInfo.deliveryType === 2 ? <Space>
<EnvironmentOutlined style={{marginRight: 8}}/>
<Popover content={
......
......@@ -5,6 +5,7 @@ import { DELIVERY_TYPE, OrderModalType, PurchaseOrderOutWorkStateTexts } from '@
import { EnvironmentOutlined, MediumOutlined } from '@ant-design/icons'
import { PublicApi } from '@/services/api'
import moment from 'moment'
import { AddressPop } from '../components/productModalTable'
// 简单控制价格区间的组件
// @todo 后续需要优化, 样式,目录文件等。
......@@ -462,7 +463,7 @@ export const productInfoColumns: any[] = [
if(r.logistics?.deliveryType === 1)
return "物流(默认)"
else if(r.logistics?.deliveryType === 2)
return "自提"
return <AddressPop pickInfo={t}>{DELIVERY_TYPE[t.deliveryType]}</AddressPop>
else if(r.logistics?.deliveryType === 3)
return "无需配送"
}
......
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 to comment