Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jinfa-platform
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
linweijiong
jinfa-platform
Commits
10c554d3
Commit
10c554d3
authored
May 31, 2021
by
卢均锐
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev-srm' of
http://10.0.0.22:3000/lingxi/lingxi-business-paltform
into dev-srm
* 'dev-srm' of
http://10.0.0.22:3000/lingxi/lingxi-business-paltform
:
🐞
fix: 修改采购计划BUG
parents
82e3c418
43698fa9
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
201 additions
and
3 deletions
+201
-3
index.tsx
...saction/purchaseAbility/components/modalOperate/index.tsx
+5
-0
index.tsx
...ction/purchaseAbility/confirmOffer/offerInquire/index.tsx
+3
-0
index.tsx
...transaction/purchaseAbility/purchasePlan/detail/index.tsx
+45
-3
modal.tsx
...transaction/purchaseAbility/purchasePlan/detail/modal.tsx
+148
-0
No files found.
src/pages/transaction/purchaseAbility/components/modalOperate/index.tsx
View file @
10c554d3
...
...
@@ -13,6 +13,7 @@ const { onFieldChange$ } = FormEffectHooks;
export
interface
IProps
{
title
:
string
,
visible
:
boolean
,
data
?:
any
,
id
:
number
,
modalType
:
'audit'
|
'abandon'
|
'date'
|
'next'
|
'key'
|
'discard'
|
'planAudit'
|
'billBack'
,
onCancel
?:
()
=>
void
,
...
...
@@ -24,6 +25,7 @@ export interface IProps {
const
ModalOperate
:
React
.
FC
<
IProps
>
=
(
props
:
any
)
=>
{
const
{
title
,
data
,
visible
,
id
,
onCancel
,
...
...
@@ -193,6 +195,9 @@ const ModalOperate: React.FC<IProps> = (props: any) => {
if
(
modalType
===
'abandon'
)
{
actions
.
setFieldValue
(
'reasonTime'
,
moment
().
format
())
}
if
(
modalType
===
'date'
)
{
actions
.
setFieldValue
(
'quotedPriceTime'
,
moment
(
data
).
format
())
}
actions
.
clearErrors
();
},
[
visible
])
...
...
src/pages/transaction/purchaseAbility/confirmOffer/offerInquire/index.tsx
View file @
10c554d3
...
...
@@ -22,6 +22,7 @@ const OfferInquire = () => {
const
ref
=
useRef
<
any
>
({});
const
[
id
,
setId
]
=
useState
<
number
>
();
const
[
visible
,
setVisible
]
=
useState
<
boolean
>
(
false
);
const
[
dataSoucre
,
setDataSoucre
]
=
useState
<
number
>
()
const
format
=
(
text
)
=>
{
return
<>
{
moment
(
text
).
format
(
"YYYY-MM-DD HH:mm:ss"
)
}
</>
}
...
...
@@ -104,6 +105,7 @@ const OfferInquire = () => {
<
Button
type=
'link'
onClick=
{
()
=>
{
setDataSoucre
(
record
.
offerEndTime
)
setId
(
record
.
id
);
setVisible
(
true
);
}
}
...
...
@@ -135,6 +137,7 @@ const OfferInquire = () => {
title=
"调整截止时间"
visible=
{
visible
}
modalType=
'date'
data=
{
dataSoucre
}
onOk=
{
()
=>
handleSubmit
()
}
onCancel=
{
()
=>
setVisible
(
false
)
}
fetch=
{
PublicApi
.
postPurchaseConfirmQuotedPriceAdjustTime
}
...
...
src/pages/transaction/purchaseAbility/purchasePlan/detail/index.tsx
View file @
10c554d3
...
...
@@ -15,6 +15,7 @@ import {
import
{
CheckCircleOutlined
}
from
'@ant-design/icons'
;
import
ModalOperate
from
'../../components/modalOperate'
;
import
PurchasePlanMaterialLayout
from
'../../components/detail/components/purchasePlanMaterialLayout'
;
import
ModalLayout
from
'./modal'
;
const
TABLINK
=
[
{
id
:
'progressLayout'
,
title
:
'流转进度'
},
...
...
@@ -23,6 +24,17 @@ const TABLINK = [
{
id
:
'recordLyout'
,
title
:
'流转记录'
},
]
interface
PropsType
{
/** 类型 */
type
?:
string
,
/** 显示隐藏 */
visible
?:
boolean
,
/** 标题 */
title
?:
string
,
/** 传进来的数据 */
dataScoure
:
string
|
number
,
}
const
PurchasePlanDetailed
=
()
=>
{
const
format
=
(
text
)
=>
{
return
<>
{
moment
(
text
).
format
(
"YYYY-MM-DD HH:mm:ss"
)
}
</>
...
...
@@ -38,6 +50,17 @@ const PurchasePlanDetailed = () => {
const
[
visible
,
setVisible
]
=
useState
<
boolean
>
(
false
);
const
[
dataSource
,
setDataSource
]
=
useState
<
any
>
({});
const
[
basicEffect
,
setBasicEffect
]
=
useState
<
any
>
([]);
const
[
props
,
setProps
]
=
useState
<
PropsType
>
()
const
handleEidt
=
(
value
:
string
|
number
,
title
:
string
,
type
:
string
)
=>
{
setProps
({
title
,
visible
:
true
,
dataScoure
:
value
,
type
})
}
const
handleBasicEffect
=
(
data
:
any
)
=>
{
setBasicEffect
([
{
...
...
@@ -47,7 +70,7 @@ const PurchasePlanDetailed = () => {
label
:
'采购计划摘要'
,
extra
:
(
<
div
style=
{
{
display
:
'flex'
,
justifyContent
:
'space-between'
,
width
:
'100%'
}
}
>
<
span
>
{
data
.
summary
}
</
span
>
{
(
pathPci
===
'purchasePlanSubmit'
&&
path
===
'detail'
)
&&
(<
span
style=
{
{
padding
:
0
,
color
:
'#00B37A'
,
cursor
:
'pointer'
}
}
>
修改摘要
</
span
>)
}
{
(
pathPci
===
'purchasePlanSubmit'
&&
path
===
'detail'
)
&&
(<
span
onClick=
{
()
=>
handleEidt
(
data
.
summary
,
'采购计划摘要'
,
'summary'
)
}
style=
{
{
padding
:
0
,
color
:
'#00B37A'
,
cursor
:
'pointer'
}
}
>
修改摘要
</
span
>)
}
</
div
>
)
...
...
@@ -61,7 +84,7 @@ const PurchasePlanDetailed = () => {
label
:
'采购计划开始'
,
extra
:
(
<
div
style=
{
{
display
:
'flex'
,
justifyContent
:
'space-between'
,
width
:
'100%'
}
}
>
<
span
>
{
format
(
data
.
startTime
)
}
</
span
>
{
(
pathPci
===
'purchasePlanSubmit'
&&
path
===
'detail'
)
&&
(<
span
style=
{
{
padding
:
0
,
color
:
'#00B37A'
,
cursor
:
'pointer'
}
}
>
修改时间
</
span
>)
}
{
(
pathPci
===
'purchasePlanSubmit'
&&
path
===
'detail'
)
&&
(<
span
onClick=
{
()
=>
handleEidt
(
data
.
startTime
,
'计划开始时间'
,
'startTime'
)
}
style=
{
{
padding
:
0
,
color
:
'#00B37A'
,
cursor
:
'pointer'
}
}
>
修改时间
</
span
>)
}
</
div
>
)
},
...
...
@@ -69,7 +92,7 @@ const PurchasePlanDetailed = () => {
label
:
'采购计划截止'
,
extra
:
(
<
div
style=
{
{
display
:
'flex'
,
justifyContent
:
'space-between'
,
width
:
'100%'
}
}
>
<
span
>
{
format
(
data
.
endTime
)
}
</
span
>
{
(
pathPci
===
'purchasePlanSubmit'
&&
path
===
'detail'
)
&&
(<
span
style=
{
{
padding
:
0
,
color
:
'#00B37A'
,
cursor
:
'pointer'
}
}
>
修改时间
</
span
>)
}
{
(
pathPci
===
'purchasePlanSubmit'
&&
path
===
'detail'
)
&&
(<
span
onClick=
{
()
=>
handleEidt
(
data
.
endTime
,
'计划结束时间'
,
'endTime'
)
}
style=
{
{
padding
:
0
,
color
:
'#00B37A'
,
cursor
:
'pointer'
}
}
>
修改时间
</
span
>)
}
</
div
>
)
},
...
...
@@ -161,6 +184,19 @@ const PurchasePlanDetailed = () => {
return
fetchSoure
}
const
reload
=
()
=>
{
fetchDataSource
()
}
const
handleClose
=
()
=>
{
setProps
({
title
:
''
,
visible
:
false
,
dataScoure
:
null
,
type
:
''
})
}
return
(
<
Context
.
Provider
value=
{
dataSource
}
>
<
PeripheralLayout
...
...
@@ -202,6 +238,12 @@ const PurchasePlanDetailed = () => {
onCancel=
{
()
=>
setVisible
(
false
)
}
onOk=
{
()
=>
history
.
goBack
()
}
/>
<
ModalLayout
{
...
props
}
id=
{
id
}
reload=
{
reload
}
onClose=
{
handleClose
}
/>
</
Context
.
Provider
>
)
}
...
...
src/pages/transaction/purchaseAbility/purchasePlan/detail/modal.tsx
0 → 100644
View file @
10c554d3
import
React
,
{
useEffect
}
from
'react'
;
import
{
Modal
}
from
'antd'
;
import
{
SchemaForm
,
SchemaMarkupField
as
Field
,
createFormActions
,
FormEffectHooks
,
}
from
'@formily/antd'
import
{
Input
,
DatePicker
}
from
'@formily/antd-components'
import
moment
from
'moment'
;
import
{
PublicApi
}
from
'@/services/api'
;
const
actions
=
createFormActions
()
const
{
onFieldChange$
}
=
FormEffectHooks
;
interface
ModalLayoutProps
{
/** 单据id */
id
:
number
,
/** 类型 */
type
?:
string
,
/** 显示隐藏 */
visible
?:
boolean
,
/** 标题 */
title
?:
string
,
/** 传进来的数据 */
dataScoure
:
string
|
number
,
/** onClose */
onClose
?:
()
=>
void
,
/** 刷新 */
reload
:
()
=>
void
,
}
const
ModalLayout
:
React
.
FC
<
ModalLayoutProps
>
=
(
props
:
any
)
=>
{
const
{
id
,
type
,
visible
,
title
,
dataScoure
,
onClose
,
reload
}
=
props
;
const
disabledDate
=
(
current
)
=>
{
return
current
&&
current
<=
moment
().
startOf
(
'day'
);
}
const
useFormEffects
=
()
=>
{
const
{
setFieldState
}
=
createFormActions
()
}
const
handleSubmit
=
(
value
:
any
)
=>
{
const
params
:
any
=
{
id
,
}
if
(
type
===
'summary'
)
{
params
.
summary
=
value
.
summary
}
if
(
type
===
'startTime'
)
{
params
.
startTime
=
new
Date
(
value
.
startTime
).
getTime
();
}
if
(
type
===
'endTime'
)
{
params
.
endTime
=
new
Date
(
value
.
endTime
).
getTime
();
}
PublicApi
.
postPurchasePurchasePlanUpdate
({
...
params
}).
then
(
res
=>
{
if
(
res
.
code
!==
1000
)
{
return
}
onClose
();
reload
();
})
}
useEffect
(()
=>
{
if
(
type
===
'summary'
)
{
actions
.
setFieldValue
(
'summary'
,
dataScoure
)
}
if
(
type
===
'startTime'
)
{
actions
.
setFieldValue
(
'startTime'
,
moment
(
dataScoure
).
format
())
}
if
(
type
===
'endTime'
)
{
actions
.
setFieldValue
(
'endTime'
,
moment
(
dataScoure
).
format
())
}
actions
.
clearErrors
();
},
[
visible
])
const
handleClose
=
()
=>
{
onClose
();
actions
.
reset
();
}
return
(
<
Modal
width=
{
600
}
title=
{
title
}
visible=
{
visible
}
onCancel=
{
handleClose
}
onOk=
{
()
=>
actions
.
submit
()
}
afterClose=
{
()
=>
actions
.
reset
()
}
>
<
SchemaForm
layout=
"vertical"
components=
{
{
Input
,
DatePicker
}
}
actions=
{
actions
}
effects=
{
()
=>
useFormEffects
()
}
onSubmit=
{
(
values
)
=>
handleSubmit
(
values
)
}
>
{
type
===
'summary'
&&
(
<
Field
title=
"采购计划摘要"
name=
"summary"
required
x
-
component=
"Input"
x
-
component
-
props=
{
{
style
:
{
width
:
'100%'
},
}
}
/>
)
}
{
type
===
'startTime'
&&
(
<
Field
title=
"计划开始时间"
name=
"startTime"
required
x
-
component=
"DatePicker"
x
-
component
-
props=
{
{
style
:
{
width
:
'100%'
},
format
:
'YYYY-MM-DD HH:mm:ss'
,
disabledDate
,
}
}
/>
)
}
{
type
===
'endTime'
&&
(
<
Field
title=
"计划结束时间"
name=
"endTime"
required
x
-
component=
"DatePicker"
x
-
component
-
props=
{
{
style
:
{
width
:
'100%'
},
format
:
'YYYY-MM-DD HH:mm:ss'
,
disabledDate
,
}
}
/>
)
}
</
SchemaForm
>
</
Modal
>
)
}
export
default
ModalLayout
;
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment