Commit fa0269a0 authored by 前端-黄佳鑫's avatar 前端-黄佳鑫

🐞fix: 修复确认报价bug

parent 2e4cdf89
......@@ -12,6 +12,7 @@ import BidTable from '../bidTable';
import { Context, BidDetailContext } from '../context';
import { useBidTable } from '../../../effects/useBidTable';
import { FilePdfOutlined } from '@ant-design/icons';
import ModalOperate from '../../../modalOperate';
export interface ContrastProps {
effect?: any,
......@@ -34,6 +35,11 @@ const ContrastLyout: React.FC<ContrastProps> = (props: any) => {
ctl: { setDataSource }
}
} = useBidTable();
const context = useContext(Context);
const [loading, setLoading] = useState<boolean>(false);
const [disabled, setDisabled] = useState<boolean>(false);
const [type, setType] = useState<string>('');
const [visible, setVisible] = useState<boolean>(false);
const format = (text) => {
return <>{moment(text).format("YYYY-MM-DD HH:mm:ss")}</>
}
......@@ -44,7 +50,8 @@ const ContrastLyout: React.FC<ContrastProps> = (props: any) => {
dataIndex: 'quotedPriceNo',
render: (text: any, record: any) => (
<Space direction='vertical'>
<EyePreview url={`/memberCenter/procurementAbility/confirmOffer/quote/detail?id=${record.id}&number=${record.quotedPriceNo}`}>{text}</EyePreview>
{ context.priceContrast === PRICECONTRAST_TYPE.UNENCRYPTED && <EyePreview url={`/memberCenter/procurementAbility/confirmOffer/quote/detail?id=${record.id}&number=${record.quotedPriceNo}`}>{text}</EyePreview> }
{ context.priceContrast === PRICECONTRAST_TYPE.UNDECRYPTED && <Typography.Text type='success'>{text}</Typography.Text> }
<Typography.Text>{record.details}</Typography.Text>
</Space>
)
......@@ -87,9 +94,6 @@ const ContrastLyout: React.FC<ContrastProps> = (props: any) => {
)
},
]
const context = useContext(Context);
const [loading, setLoading] = useState<boolean>(false);
const [disabled, setDisabled] = useState<boolean>(false);
const fetchTableData = (params: any) => {
return new Promise(resolve => {
......@@ -164,7 +168,7 @@ const ContrastLyout: React.FC<ContrastProps> = (props: any) => {
id,
turn
}
PublicApi.getPurchaseConfirmQuotedPriceRightOffContrastPrice(params).then((res: any) => {
PublicApi.getPurchaseConfirmQuotedPriceRightOffContrastPrice({...params}, { ctrlType: 'none' }).then((res: any) => {
if (res.code === 1000) {
const { data } = res;
if (data.length > 0) {
......@@ -192,10 +196,17 @@ const ContrastLyout: React.FC<ContrastProps> = (props: any) => {
useEffect(() => {
if (preview && Object.keys(context).length > 0) {
atonceContrast()
if (context.priceContrast === PRICECONTRAST_TYPE.UNENCRYPTED) {
atonceContrast()
}
}
}, [context])
const handleSubmit = (type: string) => {
setVisible(true)
setType(type)
}
return (
<BidDetailContext.Provider value={dataSource}>
<Card
......@@ -204,11 +215,11 @@ const ContrastLyout: React.FC<ContrastProps> = (props: any) => {
extra={
preview ? null :
<Space>
<Button onClick={() => history.goBack()}>发起下轮报价</Button>
<Button onClick={() => handleSubmit('next')}>发起下轮报价</Button>
{context.priceContrast === PRICECONTRAST_TYPE.UNDECRYPTED &&
<Button>
<Button onClick={() => handleSubmit('key')}>
解密报价单
</Button>}
</Button>}
<Button
type='primary'
disabled={disabled}
......@@ -276,7 +287,18 @@ const ContrastLyout: React.FC<ContrastProps> = (props: any) => {
</Col>
</Row>
}
<ModalOperate
id={id}
title={type === 'next' ? '调整下轮报价时间' : '输入密匙'}
modalType={type === 'next' ? 'next' : 'key'}
visible={visible}
fetch={
type === 'next' ? PublicApi.postPurchaseConfirmQuotedPriceLaunchTurnQuotedPrice :
PublicApi.postPurchaseConfirmQuotedPriceDecryptQuotedPrice
}
onCancel={() => setVisible(false)}
onOk={() => history.goBack()}
/>
</Card>
</BidDetailContext.Provider>
)
......
......@@ -139,7 +139,7 @@ const ModalOperate: React.FC<IProps> = (props: any) => {
if (modalType === 'next') {
actions.setFieldValue('quotedPriceTime', moment().format())
}
}, [])
}, [visible])
const handleSubmit = (val: any) => {
let value = { ...val }
......
......@@ -202,7 +202,7 @@ export const FILTEREXTERNALSTATE = [
},
]
/** 筛选外部状态 */
/** 筛选确认报价内部状态 */
export const FILTERINTERNALSTATE = [
{
label: '待提交审核', value: 1
......@@ -236,6 +236,37 @@ export const FILTERINTERNALSTATE = [
},
]
/** 筛选内部状态 */
export const FILTERCONFIRMINTERNALSTATE = [
{
label: '待比价', value: 1
},
{
label: '待审核授标结果(一级)', value: 2
},
{
label: '待审核授标结果(二级)', value: 3
},
{
label: '待确认授标结果', value: 4
},
{
label: '审核授标结果通过(一级)', value: 5
},
{
label: '审核授标结果通过(二级)', value: 6
},
{
label: '审核授标结果不通过(一级)', value: 7
},
{
label: '审核授标结果不通过(二级)', value: 8
},
{
label: '已完成', value: 99
},
]
/** 确认报价内部状态 */
export const OFFTER_CONFIRMINTERIORSTATE = {
99: '已完成',
......
......@@ -73,11 +73,11 @@ const AddForm = () => {
} else {
res = await PublicApi.postPurchasePurchaseInquiryAdd({ ...params });
}
if (res.code === 1000) {
history.goBack()
} else {
if (res.code !== 1000) {
setLoading(false);
return
}
history.goBack()
} else {
setLoading(false);
}
......@@ -139,6 +139,7 @@ const AddForm = () => {
setCondition(conditionInfo);
demandInfo.type = params.type;
demandInfo.shopIds = params.shopIds;
demandInfo.demandMembers = params.demandMembers;
setDemand(demandInfo);
}
})
......
......@@ -51,6 +51,14 @@ const Demand: React.FC<Iprops> = (props: any) => {
const [visible, setVisible] = useState<boolean>(false);
const [menberVisible, setMenberVidible] = useState<boolean>(false);
const [rowCtl, setRowCtl] = useState<any>([])
const handleGetSwitch = (e: any, index: number) => {
const state = e ? 1 : 0;
const params = [...rowCtl];
params[index].state = state;
setRowCtl([...params]);
}
/** 表头 */
const columns: ColumnType<any>[] = [
{
......@@ -82,18 +90,19 @@ const Demand: React.FC<Iprops> = (props: any) => {
title: '是否归属会员',
key: 'membershipOrNot',
dataIndex: 'membershipOrNot',
render: (_text: any, _record: any) => <span></span>
render: (_text: any, _record: any) => <>
{ value === 3 && <Typography.Text type='success'></Typography.Text> }
</>
},
{
title: '状态',
key: 'state',
dataIndex: 'state',
render: (_text: any, _record: any) => (
render: (_text: any, _record: any, index:number) => (
<Form.Item
style={{ marginBottom: 0 }}
initialValue={_text}
>
<Switch />
<Switch checked={_text} onChange={(e: any) => handleGetSwitch(e, index)} />
</Form.Item>
)
},
......@@ -102,7 +111,7 @@ const Demand: React.FC<Iprops> = (props: any) => {
key: 'operate',
dataIndex: 'operate',
render: (_text: any, _record: any) => (
<Link href={`/shop?shopId=${btoa(JSON.stringify({ shopId: _record.id, memberId: _record.memberId }))}`} target="_blank">
<Link href={`/shop?shopId=${btoa(JSON.stringify({ roleId: _record.roleId, memberId: _record.memberId }))}`} target="_blank">
进入店铺
</Link>
)
......@@ -115,6 +124,7 @@ const Demand: React.FC<Iprops> = (props: any) => {
setVisible(true)
}
setStore([]);
setRowCtl([]);
setValue(value)
}
/** 确认选择商城 */
......@@ -143,13 +153,16 @@ const Demand: React.FC<Iprops> = (props: any) => {
const data: any = []
RowCtl.forEach(item => {
data.push({
id: item.id,
isSubMember: 1,
memberId: item.memberId,
memberName: item.name,
memberTypeName: item.memberTypeName,
roleId: item.roleId,
roleName: item.roleName,
levelTag: item.levelTag,
state: false,
membershipOrNot: 1,
state: 0,
type: 2,
})
})
......@@ -209,7 +222,8 @@ const Demand: React.FC<Iprops> = (props: any) => {
setStoreList(shopList)
}
setValue(fetchdata.type);
handleStoreIds(fetchdata.shopIds);
fetchdata.shopIds && handleStoreIds(fetchdata.shopIds);
fetchdata.demandMembers && setRowCtl([...fetchdata.demandMembers]);
}
}, [fetchdata])
......@@ -291,6 +305,7 @@ const Demand: React.FC<Iprops> = (props: any) => {
/>
<SelectMenber
visible={menberVisible}
rowCtl={rowCtl}
onclose={() => setMenberVidible(false)}
confirm={(e) => handleMenberList(e)}
/>
......
import React, { useRef } from 'react';
import React, { useEffect, useRef } from 'react';
import {
Drawer,
Button
......@@ -15,6 +15,7 @@ import {
const formActions = createFormActions();
interface Iprops {
rowCtl?: any,
visible: boolean,
onclose?(),
confirm?(e: any),
......@@ -22,7 +23,7 @@ interface Iprops {
const SelectMenber: React.FC<Iprops> = (props: any) => {
const ref = useRef({});
const { visible, onclose, confirm } = props;
const { visible, onclose, confirm, rowCtl } = props;
const [rowSelection, RowCtl] = useRowSelectionTable({ customKey: 'id' });
const columns: ColumnType<any>[] = [
{
......@@ -60,6 +61,13 @@ const SelectMenber: React.FC<Iprops> = (props: any) => {
})
}
useEffect(() => {
if (rowCtl) {
RowCtl.setSelectRow(rowCtl)
RowCtl.setSelectedRowKeys(rowCtl.map(v => v.id))
}
}, [visible])
return (
<Drawer
visible={visible}
......
import { ISchema} from '@formily/antd'
import { FORM_FILTER_PATH } from '@/formSchema/const'
import { PublicApi } from '@/services/api'
import { FILTEREXTERNALSTATE, FILTERINTERNALSTATE } from '../constants'
import { FILTEREXTERNALSTATE, FILTERINTERNALSTATE, FILTERCONFIRMINTERNALSTATE } from '../constants'
/** 采购询价 - 需求单查询 */
......@@ -609,7 +609,7 @@ export const CONFIRMOFFERSERAH_SCHEMA: ISchema = {
},
enum: FILTEREXTERNALSTATE
},
interiorState: {
confirmInteriorState: {
type: 'string',
"x-component-props": {
placeholder: '内部状态',
......@@ -617,7 +617,7 @@ export const CONFIRMOFFERSERAH_SCHEMA: ISchema = {
width: 160
}
},
enum: FILTERINTERNALSTATE
enum: FILTERCONFIRMINTERNALSTATE
},
}
},
......
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