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

🐞 fix: 修改采购需求计划BUG

parent 8cfdcfa2
......@@ -18,7 +18,9 @@ const getPrevTime = (num, flag) => {
const DateSelect = (props) => {
const { value, mutators } = props
const todayStartTime = moment().startOf('day').format('x')
const nowTime = moment().format('x').valueOf()
// const nowTime = moment().format('x').valueOf()
/** 当天的23:59:59 */
const nowTime = moment().endOf('day').valueOf()
const dateMemo = useMemo(() => [
{ label: '今天', value: `${todayStartTime},${nowTime}`},
{ label: '一周内', value: `${getPrevTime(1, 'week')},${nowTime}`},
......@@ -28,8 +30,8 @@ const DateSelect = (props) => {
{ label: '一年内', value: `${getPrevTime(1, 'year')},${nowTime}`},
{ label: '一年前', value: `0,${getPrevTime(1, 'year')}`},
], [])
const handleChange = (e) => {
mutators.change(e ? e.split(',') : '');
}
......@@ -37,7 +39,7 @@ const DateSelect = (props) => {
const val = !value || !value.length ? undefined : value.join();
return (
<Select
<Select
style={{minWidth: 160}}
placeholder={placeholder}
onChange={handleChange}
......@@ -52,4 +54,4 @@ DateSelect.defaultProps = {}
DateSelect.isFieldComponent = true;
export default DateSelect
\ No newline at end of file
export default DateSelect
......@@ -293,4 +293,4 @@
> label.ant-form-item-required::before {
order: 10;
margin-left: -6px;
}
\ No newline at end of file
}
......@@ -33,8 +33,8 @@ const DrawerLayout: React.FC<DrawerLayoutProps> = (props: any) => {
dataIndex: 'startTime',
render: (text: any, record: any) => (
<Space direction='vertical' size={0}>
<Typography.Text>{format(text)}</Typography.Text>
<Typography.Text>{format(record.endTime)}</Typography.Text>
<Typography.Text>{format(text, "YYYY-MM-DD")}</Typography.Text>
<Typography.Text>{format(record.endTime, "YYYY-MM-DD")}</Typography.Text>
</Space>
)
},
......@@ -57,17 +57,19 @@ const DrawerLayout: React.FC<DrawerLayoutProps> = (props: any) => {
title: '成本价',
key: 'costPrice',
dataIndex: 'costPrice',
render: (text: any) => (<>{ text ? `¥${text.toFixed(2)}` : `¥0` }</>)
},
{
title: '需求金额',
key: 'needPrice',
dataIndex: 'needPrice',
render: (text: any) => (<>{ text ? `¥${text.toFixed(2)}` : `¥0` }</>)
},
{
title: '到货日期',
key: 'arriveTime',
dataIndex: 'arriveTime',
render: (text: any) => format(text)
render: (text: any) => format(text, "YYYY-MM-DD")
},
]
......
......@@ -48,8 +48,8 @@ const DemandDetailed = () => {
},
{
col: [
{ label: '需求计划开始', extra: format(data.startTime) },
{ label: '需求计划截止', extra: format(data.endTime) },
{ label: '需求计划开始', extra: format(data.startTime, "YYYY-MM-DD") },
{ label: '需求计划截止', extra: format(data.endTime, "YYYY-MM-DD") },
]
},
{
......
......@@ -83,7 +83,7 @@ const PurchasePlanDetailed = () => {
{
label: '采购计划开始', extra: (
<div style={{ display: 'flex', justifyContent: 'space-between', width: '100%' }}>
<span>{format(data.startTime)}</span>
<span>{format(data.startTime, "YYYY-MM-DD")}</span>
{(pathPci === 'purchasePlanSubmit' && path === 'detail') && (<span onClick={() => handleEidt(data.startTime, '计划开始时间', 'startTime')} style={{ padding: 0, color: '#00B37A', cursor: 'pointer' }}>修改时间</span>)}
</div>
)
......@@ -91,7 +91,7 @@ const PurchasePlanDetailed = () => {
{
label: '采购计划截止', extra: (
<div style={{ display: 'flex', justifyContent: 'space-between', width: '100%' }}>
<span>{format(data.endTime)}</span>
<span>{format(data.endTime, "YYYY-MM-DD")}</span>
{(pathPci === 'purchasePlanSubmit' && path === 'detail') && (<span onClick={() => handleEidt(data.endTime, '计划结束时间', 'endTime')} style={{ padding: 0, color: '#00B37A', cursor: 'pointer' }}>修改时间</span>)}
</div>
)
......
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