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
黄庭坚
jinfa-platform
Commits
5f27da24
Commit
5f27da24
authored
Nov 06, 2020
by
XieZhiXiong
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' into test
parents
05e1698f
d6cf1e3d
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
606 additions
and
199 deletions
+606
-199
handlingRoute.ts
config/routes/handlingRoute.ts
+13
-10
index.tsx
src/components/AuditProcess/index.tsx
+15
-3
index.tsx
src/pages/handling/assign/add/index.tsx
+62
-23
index.tsx
src/pages/handling/assign/detail/index.tsx
+29
-13
index.tsx
src/pages/handling/components/Circulation/index.tsx
+54
-12
content.tsx
src/pages/handling/components/ProcessDetail/content.tsx
+32
-9
index.tsx
src/pages/handling/components/ProcessDetail/index.tsx
+36
-12
contants.tsx
src/pages/handling/components/Query/contants.tsx
+66
-9
index.tsx
src/pages/handling/components/Query/index.tsx
+195
-73
schema.tsx
src/pages/handling/components/Query/schema.tsx
+9
-13
index.tsx
src/pages/handling/components/WrapTable/index.tsx
+28
-10
index.tsx
src/pages/lxMall/purchaseOrder/index.tsx
+2
-1
index.tsx
...payandSettle/creditManage/components/DetailInfo/index.tsx
+5
-3
index.tsx
...pages/transaction/components/orderDetailSection/index.tsx
+17
-3
index.ts
...s/transaction/purchaseOrder/orderCollect/effects/index.ts
+2
-1
index.tsx
src/pages/transaction/purchaseOrder/orderCollect/index.tsx
+18
-4
index.tsx
src/utils/index.tsx
+23
-0
No files found.
config/routes/handlingRoute.ts
View file @
5f27da24
...
...
@@ -23,6 +23,14 @@ const HandlingRoute = {
icon
:
'smile'
,
component
:
'@/pages/handling/components/Query'
,
},
// // 指派生产通知单 -> 详情
{
path
:
'/memberCenter/handling/assign/query/detail'
,
name
:
'assignProductionDetail'
,
icon
:
'smile'
,
component
:
'@/pages/handling/assign/detail'
,
hideInMenu
:
true
},
// 指派生产通知单 -> 待新增生产通知单
{
path
:
'/memberCenter/handling/assign/tobeAddQuery'
,
...
...
@@ -38,14 +46,7 @@ const HandlingRoute = {
component
:
'@/pages/handling/assign/add'
,
hideInMenu
:
true
},
// // 指派生产通知单 -> 详情
{
path
:
'/memberCenter/handling/assign/qeury/detail'
,
name
:
'assignProductionDetail'
,
icon
:
'smile'
,
component
:
'@/pages/handling/assign/detail'
,
hideInMenu
:
true
},
// 指派生产通知单 -> 待审核通知单(一级)
{
path
:
'/memberCenter/handling/assign/pendingFirst'
,
...
...
@@ -72,7 +73,8 @@ const HandlingRoute = {
path
:
'/memberCenter/handling/assign/pendingAddProcessing'
,
name
:
'processStock'
,
icon
:
'smile'
,
component
:
'@/pages/handling/components/Query'
component
:
'@/pages/handling/components/Query'
,
hideInMenu
:
true
},
// 指派生产通知单 -> 待收货生产通知单
{
...
...
@@ -86,7 +88,8 @@ const HandlingRoute = {
path
:
'/memberCenter/handling/assign/createProcessStock'
,
name
:
'createProcessStock'
,
icon
:
'smile'
,
component
:
'@/pages/handling/assign/processStock/createProcessStock'
component
:
'@/pages/handling/assign/processStock/createProcessStock'
,
hideInMenu
:
true
,
}
]
},
...
...
src/components/AuditProcess/index.tsx
View file @
5f27da24
...
...
@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2020-09-15 17:48:36
* @LastEditors: XieZhiXiong
* @LastEditTime: 2020-
09-15 17:49:54
* @LastEditTime: 2020-
11-06 18:47:46
* @Description: 内外部流转记录组件
*/
import
React
from
'react'
;
...
...
@@ -16,8 +16,18 @@ import styles from './index.less';
interface
AuditProcessProp
{
outerVerifyCurrent
?:
number
;
innerVerifyCurrent
?:
number
;
outerVerifySteps
?:
{
step
:
number
,
stepName
:
string
,
roleName
:
string
}[];
innerVerifySteps
?:
{
step
:
number
,
stepName
:
string
,
roleName
:
string
}[];
outerVerifySteps
?:
{
step
:
number
,
stepName
:
string
,
roleName
:
string
,
status
:
'wait'
|
'process'
|
'finish'
|
'error'
,
}[];
innerVerifySteps
?:
{
step
:
number
,
stepName
:
string
,
roleName
:
string
,
status
:
'wait'
|
'process'
|
'finish'
|
'error'
,
}[];
customTitleKey
?:
string
customKey
?:
string
};
...
...
@@ -39,6 +49,7 @@ const AuditProcess: React.FC<AuditProcessProp> = ({
key=
{
customKey
?
item
[
customKey
]
:
item
.
step
}
title=
{
customTitleKey
?
item
[
customTitleKey
]
:
item
.
stepName
}
description=
{
item
.
roleName
}
status=
{
item
.
status
}
/>
))
}
</
Steps
>
...
...
@@ -50,6 +61,7 @@ const AuditProcess: React.FC<AuditProcessProp> = ({
key=
{
customKey
?
item
[
customKey
]
:
item
.
step
}
title=
{
customTitleKey
?
item
[
customTitleKey
]
:
item
.
stepName
}
description=
{
item
.
roleName
}
status=
{
item
.
status
}
/>
))
}
</
Steps
>
...
...
src/pages/handling/assign/add/index.tsx
View file @
5f27da24
...
...
@@ -4,11 +4,10 @@ import { SaveOutlined } from '@ant-design/icons';
import
{
Button
,
Card
,
Select
,
DatePicker
,
Radio
,
Table
,
Space
}
from
'antd'
;
import
{
history
}
from
'umi'
;
import
ReutrnEle
from
'@/components/ReturnEle'
;
import
{
createFormActions
,
FormEffectHooks
,
FormPath
}
from
'@formily/antd'
;
import
{
createFormActions
,
FormEffectHooks
}
from
'@formily/antd'
;
import
NiceForm
from
'@/components/NiceForm'
;
import
schema
from
'./schema'
;
import
{
LinkOutlined
,
PlusOutlined
}
from
'@ant-design/icons'
;
import
ModalContainer
from
'../../components/ModalContainer'
;
import
EnterPrise
from
'../../components/EnterPrise'
;
import
ProcessProducts
from
'../../components/ProcessProducts'
;
import
ProcessOrder
from
'../../components/ProcessOrder'
;
...
...
@@ -48,24 +47,39 @@ const Add: React.FC<{}> = () => {
const
noticesDetailColumn
=
()
=>
{
return
[
{
title
:
'订单号'
,
dataIndex
:
'orderId'
},
{
title
:
'商品ID'
,
dataIndex
:
'
commodityI
d'
},
{
title
:
'商品ID'
,
dataIndex
:
'
i
d'
},
{
title
:
'商品名称'
,
dataIndex
:
'name'
},
{
title
:
'品类'
,
dataIndex
:
'customerCategoryName'
},
{
title
:
'品牌'
,
dataIndex
:
'brandName'
},
{
title
:
'单位'
,
dataIndex
:
'unitName'
},
{
title
:
'订单数量'
,
dataIndex
:
'orderTotal'
},
{
title
:
'剩余加工数量'
,
dataIndex
:
'restTotal'
},
{
title
:
'加工数量'
,
dataIndex
:
'
quantity
'
},
{
title
:
'加工数量'
,
dataIndex
:
'
processNum
'
},
{
title
:
'加工单价'
,
dataIndex
:
'processUnitPrice'
},
{
title
:
'加工费'
,
dataIndex
:
'
cost
'
},
{
title
:
'加工费'
,
dataIndex
:
'
processTotalPrice
'
},
{
title
:
'操作'
,
render
:
(
text
,
record
)
=>
{
return
(
<
Space
>
<
ProcessDetail
id=
{
record
.
commodityId
}
submit=
{
handleChangeSomeList
}
/>
<
a
>
编辑
</
a
>
<
a
>
删除
</
a
>
<
ProcessDetail
id=
{
record
.
goodsId
}
type=
{
"view"
}
quantity=
{
record
.
processNum
}
processUnitPrice=
{
record
.
processUnitPrice
}
>
<
a
>
查看
</
a
>
</
ProcessDetail
>
<
ProcessDetail
id=
{
record
.
goodsId
}
type=
{
"edit"
}
submit=
{
handleChangeSomeList
}
quantity=
{
record
.
processNum
}
processUnitPrice=
{
record
.
processUnitPrice
}
>
<
a
>
编辑
</
a
>
</
ProcessDetail
>
<
a
onClick=
{
()
=>
handleRemoveRow
(
record
.
id
)
}
>
删除
</
a
>
</
Space
>
)
}
...
...
@@ -109,7 +123,6 @@ const Add: React.FC<{}> = () => {
/>
)
}
/* -------- element end-------- */
/**
* formEffect, 表单联动操作放这里操作,包括表单的生命周期等操作
...
...
@@ -180,8 +193,25 @@ const Add: React.FC<{}> = () => {
* @param rows
*/
const
processProductSelected
=
(
rows
)
=>
{
console
.
log
(
rows
)
formActions
.
setFieldValue
(
'Tabs.tab-2.layout.someLists'
,
rows
.
selectRow
)
const
{
selectedRowKeys
,
selectRow
}
=
rows
;
const
currentList
=
formActions
.
getFieldValue
(
'Tabs.tab-2.layout.someLists'
);
// 首先去除掉没有在selectedRowkeys 的那些数据
const
inKeys
=
[];
const
hasRemovedList
=
currentList
.
filter
(
(
item
)
=>
{
const
flag
=
selectedRowKeys
.
includes
(
item
.
id
)
if
(
flag
)
{
inKeys
.
push
(
item
.
id
);
}
return
flag
}
);
// 找到没有在数组中的key,即新增加的key
const
newAddKeys
=
selectedRowKeys
.
filter
((
item
)
=>
{
return
!
inKeys
.
includes
(
item
)});
const
appendRow
=
selectRow
.
filter
((
item
)
=>
newAddKeys
.
includes
(
item
.
id
));
const
newRows
=
hasRemovedList
.
concat
(
appendRow
);
formActions
.
setFieldValue
(
'Tabs.tab-2.layout.someLists'
,
newRows
)
}
/**
...
...
@@ -195,8 +225,9 @@ const Add: React.FC<{}> = () => {
/**
* 提交表单
*/
const
handleSubmit
=
(
values
)
=>
{
const
handleSubmit
=
(
values
:
any
)
=>
{
console
.
log
(
values
)
setSubmitLoading
(
true
);
const
SELF_MENTION
=
2
;
// 自提
const
{
deliveryDate
,
...
...
@@ -208,10 +239,11 @@ const Add: React.FC<{}> = () => {
materialDesc
=
''
,
packingDesc
=
''
,
otherDesc
=
''
,
someLists
,
...
rest
}
=
values
;
const
deliveryDateFormat
=
deliveryDate
.
unix
()
*
1000
;
const
detailList
=
values
.
someLists
.
map
((
item
)
=>
{
const
detailList
=
someLists
.
map
((
item
)
=>
{
return
{
orederNo
:
null
,
goodsId
:
item
.
commodityId
,
...
...
@@ -221,16 +253,17 @@ const Add: React.FC<{}> = () => {
unit
:
item
.
unitName
,
purchaseCount
:
null
,
surplusProcessNum
:
null
,
processNum
:
item
.
quantity
||
0
,
processNum
:
item
.
processNum
||
0
,
processPrice
:
item
.
processUnitPrice
||
0
,
processTotalPrice
:
item
.
processTotalPrice
,
deliveryDate
:
deliveryDateFormat
,
property
:{
specs
:
item
.
productProps
.
map
((
item
)
=>
{
specs
:
item
.
productProps
&&
item
.
productProps
.
map
((
item
)
=>
{
return
{
name
:
item
.
customerAttribute
.
name
,
value
:
''
value
:
item
.
customerAttribute
.
name
}
}),
})
||
[]
,
annex
:
item
.
files
.
map
((
item
)
=>
({
name
:
item
.
name
,
value
:
item
.
url
}))
}
}
...
...
@@ -258,25 +291,25 @@ const Add: React.FC<{}> = () => {
delete
postData
.
receiveUserTel
}
console
.
log
(
postData
);
return
;
//
return ;
PublicApi
.
postEnhanceSupplierToBeAddAdd
(
postData
)
.
then
(
data
=>
{
setSubmitLoading
(
false
);
if
(
data
.
code
===
1000
)
{
history
.
push
(
'/memberCenter/handling/assign/tobeAddQuery'
)
}
})
}
const
handleChangeSomeList
=
(
values
)
=>
{
console
.
log
(
"changeSOmeList"
);
const
handleChangeSomeList
=
(
values
:
any
)
=>
{
let
someList
=
formActions
.
getFieldValue
(
'Tabs.tab-2.layout.someLists'
);
const
index
=
someList
.
findIndex
((
item
)
=>
item
.
commodity
Id
==
values
.
id
);
const
index
=
someList
.
findIndex
((
item
)
=>
item
.
goods
Id
==
values
.
id
);
if
(
index
>
-
1
)
{
someList
[
index
]
=
{
...
someList
[
index
],
quantity
:
values
.
process
.
quantity
,
processNum
:
values
.
process
.
quantity
,
processUnitPrice
:
values
.
process
.
processUnitPrice
,
cost
:
values
.
process
.
quantity
*
values
.
process
.
processUnitPrice
,
processTotalPrice
:
values
.
process
.
quantity
*
values
.
process
.
processUnitPrice
,
productProps
:
values
.
productProps
,
files
:
values
.
files
}
...
...
@@ -285,6 +318,12 @@ const Add: React.FC<{}> = () => {
}
}
const
handleRemoveRow
=
(
id
:
number
)
=>
{
const
currentList
=
formActions
.
getFieldValue
(
'Tabs.tab-2.layout.someLists'
);
const
newList
=
currentList
.
filter
((
item
)
=>
item
.
id
!==
id
);
formActions
.
setFieldValue
(
'Tabs.tab-2.layout.someLists'
,
newList
)
}
return
(
<
PageHeaderWrapper
onBack=
{
()
=>
history
.
goBack
()
}
...
...
src/pages/handling/assign/detail/index.tsx
View file @
5f27da24
import
React
from
'react'
;
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
{
PageHeaderWrapper
}
from
'@ant-design/pro-layout'
;
import
{
history
}
from
'umi'
;
import
AvatarWrap
from
'@/components/AvatarWrap'
;
...
...
@@ -8,9 +8,26 @@ import WrapTable from '../../components/WrapTable';
import
OtherRequirement
from
'../../components/OtherRequirement'
;
import
Appendix
from
'../../components/Appendix'
;
import
ProcessDetail
from
'../../components/ProcessDetail'
;
import
{
usePageStatus
}
from
'@/hooks/usePageStatus'
import
{
PublicApi
}
from
'@/services/api'
;
import
moment
from
'moment'
;
const
{
TabPane
}
=
Tabs
;
const
Detail
:
React
.
FC
<
{}
>
=
()
=>
{
const
[
info
,
setInfo
]
=
useState
<
any
>
({})
const
{
id
}
=
usePageStatus
();
useEffect
(()
=>
{
if
(
id
)
{
PublicApi
.
getEnhanceSupplierAllDetails
({
id
:
id
})
.
then
(({
data
,
code
})
=>
{
if
(
code
===
1000
)
{
setInfo
(
data
);
}
})
}
},
[
id
])
return
(
<
PageHeaderWrapper
title=
{
...
...
@@ -24,36 +41,35 @@ const Detail: React.FC<{}> = () => {
name
:
"通知单号:"
}
}
extra=
{
(
<
span
style=
{
{
fontSize
:
12
,
fontWeight
:
'normal'
}
}
>
{
"TPTY12"
}
</
span
>
<
span
style=
{
{
fontSize
:
12
,
fontWeight
:
'normal'
}
}
>
{
info
?.
noticeNo
}
</
span
>
)
}
/>
}
>
<
Descriptions
column=
{
3
}
style=
{
{
padding
:
'0 32px'
,
}
}
style=
{
{
padding
:
'0 32px'
,
fontWeight
:
400
}
}
colon=
{
false
}
>
<
Descriptions
.
Item
label=
"通知单摘要
"
>
{
"进口头层黄牛皮荔枝纹"
}
</
Descriptions
.
Item
>
<
Descriptions
.
Item
label=
"
供应会员:"
>
{
"广州白马皮具交易中心"
}
</
Descriptions
.
Item
>
<
Descriptions
.
Item
label=
"单据时间:"
>
{
"2020-09-09 12:58:25"
}
</
Descriptions
.
Item
>
<
Descriptions
.
Item
label=
"通知单来源:"
>
{
"订单加工"
}
</
Descriptions
.
Item
>
<
Descriptions
.
Item
label=
"外部状态:"
>
{
"以完成通知单"
}
</
Descriptions
.
Item
>
<
Descriptions
.
Item
label=
"内部状态:"
>
{
"审核通过"
}
</
Descriptions
.
Item
>
<
Descriptions
.
Item
label=
"通知单摘要
:"
>
{
info
?.
summary
}
</
Descriptions
.
Item
>
<
Descriptions
.
Item
label=
"
加工企业:"
>
{
info
?.
processName
}
</
Descriptions
.
Item
>
<
Descriptions
.
Item
label=
"单据时间:"
>
{
info
&&
info
.
createTime
&&
moment
(
info
.
createTime
).
format
(
'YYYY-MM-DD'
)
||
null
}
</
Descriptions
.
Item
>
<
Descriptions
.
Item
label=
"通知单来源:"
>
{
info
?.
source
==
'1'
?
'订单加工'
:
'商品加工'
}
</
Descriptions
.
Item
>
<
Descriptions
.
Item
label=
"外部状态:"
>
{
info
.
outerStatusName
}
</
Descriptions
.
Item
>
<
Descriptions
.
Item
label=
"内部状态:"
>
{
info
.
innerStatusName
}
</
Descriptions
.
Item
>
</
Descriptions
>
</
PageHeader
>
</>
}
>
<
Card
bodyStyle=
{
{
padding
:
'5px 24px 15px 24px'
}
}
>
<
Circulation
/>
<
Circulation
innerStatus=
{
info
?.
innerStatus
}
outerStatus=
{
info
?.
outerStatus
}
innerTaskList=
{
info
?.
innerTaskList
}
outerTaskList=
{
info
?.
outerTaskList
}
/>
</
Card
>
<
div
style=
{
{
marginTop
:
'20px'
}
}
>
<
Card
>
<
h1
style=
{
{
fontSize
:
'16px'
,
marginBottom
:
'16px'
}
}
><
strong
>
通知单明细
</
strong
></
h1
>
<
WrapTable
/>
<
WrapTable
dataSource=
{
info
?.
details
}
/>
</
Card
>
</
div
>
...
...
src/pages/handling/components/Circulation/index.tsx
View file @
5f27da24
import
React
from
'react'
;
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
{
Tabs
,
Steps
,
Popover
}
from
'antd'
;
const
TabPane
=
Tabs
.
TabPane
;
...
...
@@ -10,23 +10,65 @@ const customDot = (dot, { status, index }) => (
</
span
>
);
const
Circulation
:
React
.
FC
<
{}
>
=
()
=>
{
interface
Iprops
{
innerTaskList
:
any
[],
outerTaskList
:
any
[],
innerStatus
:
number
,
outerStatus
:
number
}
const
Circulation
:
React
.
FC
<
Iprops
>
=
(
props
)
=>
{
const
{
innerTaskList
=
[],
outerTaskList
=
[]
}
=
props
;
const
[
innerStatus
,
setInnerStatus
]
=
useState
(
0
);
const
[
outerStatus
,
setOuterStatus
]
=
useState
(
0
);
// const innerStatus = innerTaskList.map(())
useEffect
(()
=>
{
const
length
=
innerTaskList
.
length
;
if
(
length
>
0
)
{
for
(
let
i
=
length
-
1
;
i
>=
0
;
i
--
)
{
if
(
innerTaskList
[
i
].
isExecute
==
1
)
{
setInnerStatus
(
i
);
break
;
}
}
}
},
[
innerTaskList
])
useEffect
(()
=>
{
const
length
=
outerTaskList
.
length
;
if
(
length
>
0
)
{
for
(
let
i
=
length
-
1
;
i
>=
0
;
i
--
)
{
if
(
outerTaskList
[
i
].
isExecute
==
1
)
{
setOuterStatus
(
i
);
break
;
}
}
}
},
[
innerTaskList
])
return
(
<
Tabs
defaultActiveKey=
"1"
>
<
TabPane
tab=
"外部流转"
key=
"1"
>
<
Steps
current=
{
1
}
progressDot=
{
customDot
}
style=
{
{
marginTop
:
'20px'
}
}
>
<
Step
title=
"Finished"
description=
"You can hover on the dot."
/>
<
Step
title=
"In Progress"
description=
"You can hover on the dot."
/>
<
Step
title=
"Waiting"
description=
"You can hover on the dot."
/>
<
Step
title=
"Waiting"
description=
"You can hover on the dot."
/>
<
Steps
current=
{
innerStatus
}
progressDot=
{
customDot
}
style=
{
{
marginTop
:
'20px'
}
}
>
{
outerTaskList
.
map
((
item
)
=>
{
return
(
<
Step
title=
{
item
.
taskName
}
description=
{
item
.
roleName
}
key=
{
item
.
step
}
/>
)
})
}
</
Steps
>
</
TabPane
>
<
TabPane
tab=
"内部流转"
key=
"2"
>
<
Steps
current=
{
1
}
progressDot=
{
customDot
}
style=
{
{
marginTop
:
'20px'
}
}
>
<
Step
title=
"Finished"
description=
"You can hover on the dot."
/>
<
Step
title=
"In Progress"
description=
"You can hover on the dot."
/>
<
Step
title=
"Waiting"
description=
"You can hover on the dot."
/>
<
Step
title=
"Waiting"
description=
"You can hover on the dot."
/>
<
Steps
current=
{
outerStatus
}
progressDot=
{
customDot
}
style=
{
{
marginTop
:
'20px'
}
}
>
{
innerTaskList
.
map
((
item
)
=>
{
return
(
<
Step
title=
{
item
.
taskName
}
description=
{
item
.
roleName
}
key=
{
item
.
step
}
/>
)
})
}
</
Steps
>
</
TabPane
>
</
Tabs
>
...
...
src/pages/handling/components/ProcessDetail/content.tsx
View file @
5f27da24
...
...
@@ -5,7 +5,6 @@ import classnames from 'classnames';
import
{
FileList
,
UploadFile
}
from
'../../components/UploadFile'
;
import
NiceForm
from
'@/components/NiceForm'
;
const
menuList
=
[
"基本信息"
,
"产地"
,
"外观尺寸"
,
"工艺"
,
"特殊说明/其他"
,
"附件"
,
"加工要求"
];
const
HEIGHT_MAP
=
{
'基本信息'
:
0
,
...
...
@@ -57,7 +56,7 @@ const schema = {
}
const
Content
=
(
props
)
=>
{
const
{
id
,
name
,
category
,
brand
,
unitName
,
files
,
productProps
=
[]
}
=
props
;
const
{
id
,
name
,
category
,
brand
,
unitName
,
files
,
productProps
=
[]
,
quantity
,
processUnitPrice
}
=
props
;
const
[
active
,
setActive
]
=
useState
<
string
>
(
"基本信息"
);
const
ref
=
useRef
(
null
);
...
...
@@ -143,7 +142,11 @@ const Content = (props) => {
)
})
}
<
UploadFile
onChange=
{
props
.
fileOnChange
}
fileMaxSize=
{
20
*
1024
}
/>
{
props
.
type
==
'edit'
?
<
UploadFile
onChange=
{
props
.
fileOnChange
}
fileMaxSize=
{
20
*
1024
}
/>
:
null
}
</
div
>
</
div
>
<
div
className=
{
styles
.
common
}
>
...
...
@@ -155,12 +158,32 @@ const Content = (props) => {
</
Row
>
</
div
>
<
div
className=
{
styles
.
info
}
>
<
NiceForm
schema=
{
schema
}
actions=
{
props
.
actions
}
onSubmit=
{
props
.
formSubmit
}
// effects={formEffects()}
/>
{
props
.
type
==
'edit'
?
<
NiceForm
schema=
{
schema
}
actions=
{
props
.
actions
}
onSubmit=
{
props
.
formSubmit
}
initialValues=
{
{
quantity
:
quantity
,
processUnitPrice
:
processUnitPrice
}
}
// effects=
{
formEffects
()}
/>
:
(
<>
<
Row
className=
{
styles
.
infoRow
}
>
<
Col
className=
{
styles
.
label
}
span=
{
4
}
>
加工数量
</
Col
>
<
Col
span=
{
12
}
>
{
quantity
}
</
Col
>
</
Row
>
<
Row
className=
{
styles
.
infoRow
}
>
<
Col
className=
{
styles
.
label
}
span=
{
4
}
>
加工单价
</
Col
>
<
Col
span=
{
12
}
>
{
processUnitPrice
}
</
Col
>
</
Row
>
</>
)
}
</
div
>
</
div
>
</
div
>
...
...
src/pages/handling/components/ProcessDetail/index.tsx
View file @
5f27da24
...
...
@@ -6,10 +6,24 @@ import { createFormActions } from '@formily/antd'
const
actions
=
createFormActions
();
const
ProcessDetail
=
(
props
)
=>
{
const
[
visible
,
setVisible
]
=
useState
(
false
);
interface
Iprops
{
type
:
string
,
// veiw | edit,
submit
?:
(
params
:
any
)
=>
void
,
id
:
string
,
quantity
?:
string
,
processUnitPrice
?:
string
}
interface
IfileProps
{
name
:
string
,
url
:
string
}
const
ProcessDetail
:
React
.
FC
<
Iprops
>
=
(
props
)
=>
{
const
{
quantity
,
processUnitPrice
}
=
props
;
const
[
visible
,
setVisible
]
=
useState
<
boolean
>
(
false
);
const
[
info
,
setInfo
]
=
useState
<
any
>
({})
const
[
files
,
setFiles
]
=
useState
([])
const
[
files
,
setFiles
]
=
useState
<
IfileProps
[]
>
([])
const
onClose
=
()
=>
{
setVisible
(
false
)
...
...
@@ -23,17 +37,24 @@ const ProcessDetail = (props) => {
if
(
props
.
id
&&
visible
)
{
PublicApi
.
getProductCommodityGetCommodity
({
id
:
props
.
id
})
.
then
((
data
)
=>
{
setInfo
(
data
.
data
);
if
(
data
.
code
==
1000
)
{
console
.
log
(
quantity
)
setInfo
({...
data
.
data
,
quantity
:
quantity
,
processUnitPrice
:
processUnitPrice
});
}
})
}
},
[
props
.
id
,
visible
])
const
handleSubmit
=
()
=>
{
actions
.
submit
();
if
(
props
.
type
==
'edit'
)
{
actions
.
submit
();
}
else
{
setVisible
(
false
);
}
}
const
formSubmit
=
(
values
)
=>
{
props
.
submit
({
!!
props
.
submit
&&
props
.
submit
({
files
:
files
,
id
:
props
.
id
,
process
:
values
,
...
...
@@ -45,12 +66,12 @@ const ProcessDetail = (props) => {
const
fileOnChange
=
(
values
)
=>
{
setFiles
(
values
)
}
return
(
<>
<
a
onClick=
{
onOpen
}
>
查看加工详情
</
a
>
<
div
onClick=
{
onOpen
}
>
{
props
.
children
}
</
div
>
<
Drawer
title=
"查看加工明细"
width=
{
720
}
...
...
@@ -64,10 +85,10 @@ const ProcessDetail = (props) => {
}
}
>
<
Button
onClick=
{
onClose
}
style=
{
{
marginRight
:
8
}
}
>
Cancel
取消
</
Button
>
<
Button
onClick=
{
handleSubmit
}
type=
"primary"
>
Submit
确认
</
Button
>
</
div
>
}
...
...
@@ -83,6 +104,9 @@ const ProcessDetail = (props) => {
fileOnChange=
{
fileOnChange
}
files=
{
files
}
productProps=
{
info
?.
commodityAttributeList
}
type=
{
props
.
type
}
quantity=
{
info
?.
quantity
}
processUnitPrice=
{
info
?.
processUnitPrice
}
/>
</
Drawer
>
</>
...
...
src/pages/handling/components/Query/contants.tsx
View file @
5f27da24
/**
* 指派生产通知单-生产通知单查询页
*/
...
...
@@ -8,23 +9,19 @@ export const QUERY_SEARCH_NAME = "noticeNo";
* 指派生产通知单-待新增生产通知单列表页
*/
export
const
TO_BE_ADD_QUERY_SEARCH_NAME
=
"
search
"
;
export
const
TO_BE_ADD_QUERY_SEARCH_NAME
=
"
noticeNo
"
;
/**
* 指派生产通知单-待审核生产通知单(一级)
*/
export
const
PENDING_FIRST_NOTICE
=
"search"
;
/**
* 指派生产通知单-待审核生产通知单(二级)
*/
export
const
PENDING_FIRST_AND_SECOND_NOTICE
=
"noticeNo"
;
export
const
PENDING_SECOND_NOTICE
=
"search"
;
/**
* 指派生产通知单-待提交生产通知单
*/
export
const
PENDING_TO_SUBMIT
=
"
search
"
;
export
const
PENDING_TO_SUBMIT
=
"
noticeNo
"
;
/**
* 指派生产通知单-待新增加工入库单
...
...
@@ -36,7 +33,7 @@ export const PENDING_ADD_PROCESS = "desc"
* 指派生产通知单-待收货生产通知单
*/
export
const
PENDING_RECEIVE
=
"desc
"
export
const
PENDING_RECEIVE
_SCHEMA
=
"noticeNo
"
/**
...
...
@@ -52,7 +49,66 @@ const QUERY_TITLE = '生产通知单查询';
export
const
TO_BE_ADD_QUERY_PATH
=
'/tobeAddQuery'
;
const
TO_BE_ADD_QUERY_TITLE
=
'待新增生产通知单'
;
/**
* 带审核生产通知单(一级)
*/
export
const
PENDING_FIRST
=
'/pendingFirst'
;
const
PENDING_FIRST_TITLE
=
'待审核通知单(一级)'
;
/**
* 待审核通知单(二级)
*/
export
const
PENDING_SECOND
=
'/pendingSecond'
;
const
PENDING_SECOND_TITLE
=
'待审核通知单(二级)'
;
/**
* 待审核生产通知单
*/
export
const
PENDING_SUBMIT
=
'/pendingSubmit'
;
const
PENDING_SUBMIT_TITLE
=
'待提交生产通知单'
;
/**
* 待收货生产通知单
*/
export
const
PENDING_RECEIVE
=
'/pendingReceive'
;
const
PENDING_RECEIVE_TITLE
=
'待收货生产通知单'
;
export
const
TITLE_MAPS
=
{
[
QUERY_PATH
]:
QUERY_TITLE
,
[
TO_BE_ADD_QUERY_PATH
]:
TO_BE_ADD_QUERY_TITLE
[
TO_BE_ADD_QUERY_PATH
]:
TO_BE_ADD_QUERY_TITLE
,
[
PENDING_FIRST
]:
PENDING_FIRST_TITLE
,
[
PENDING_SECOND
]:
PENDING_SECOND_TITLE
,
[
PENDING_SUBMIT
]:
PENDING_SUBMIT_TITLE
,
[
PENDING_RECEIVE
]:
PENDING_RECEIVE_TITLE
}
export
const
INNER_STATUS_BADGE_COLOR
=
{
"1"
:
"default"
,
"2"
:
"warning"
,
"3"
:
"processing"
,
"4"
:
"success"
,
"5"
:
"error"
}
// 根据 lastTypeParams, 获取对应的高级筛选 name
export
const
FILTER_NAMES
=
{
[
QUERY_PATH
]:
QUERY_SEARCH_NAME
,
[
TO_BE_ADD_QUERY_PATH
]:
TO_BE_ADD_QUERY_SEARCH_NAME
,
[
PENDING_FIRST
]:
PENDING_FIRST_AND_SECOND_NOTICE
,
[
PENDING_SECOND
]:
PENDING_FIRST_AND_SECOND_NOTICE
,
[
PENDING_SUBMIT
]:
PENDING_TO_SUBMIT
,
[
PENDING_RECEIVE
]:
PENDING_RECEIVE_SCHEMA
,
"/pendingAddProcessing"
:
PENDING_ADD_PROCESS
,
}
export
const
DETAIL_PATH
=
{
[
QUERY_PATH
]:
'/memberCenter/handling/assign/query/detail'
,
[
TO_BE_ADD_QUERY_PATH
]:
'/memberCenter/handling/assign/query/detail'
,
[
PENDING_FIRST
]:
'/memberCenter/handling/assign/query/detail'
,
[
PENDING_SECOND
]:
'/memberCenter/handling/assign/query/detail'
,
[
PENDING_SUBMIT
]:
'/memberCenter/handling/assign/query/detail'
,
[
PENDING_RECEIVE
]:
'/memberCenter/handling/assign/query/detail'
,
}
\ No newline at end of file
src/pages/handling/components/Query/index.tsx
View file @
5f27da24
...
...
@@ -5,7 +5,7 @@
import
React
,
{
useRef
}
from
'react'
;
import
{
PageHeaderWrapper
}
from
'@ant-design/pro-layout'
;
import
{
Card
,
Space
,
Button
,
Menu
,
Dropdown
}
from
'antd'
;
import
{
Card
,
Space
,
Button
,
Menu
,
Dropdown
,
Badge
}
from
'antd'
;
import
NiceForm
from
'@/components/NiceForm'
;
import
{
StandardTable
}
from
'god'
;
import
{
PublicApi
}
from
'@/services/api'
;
...
...
@@ -21,86 +21,55 @@ import { DownOutlined, DeleteOutlined } from '@ant-design/icons';
import
{
history
}
from
'umi'
;
import
{
querySchema
,
tobeAddQuerySchema
,
pendingFirstQuerySchema
}
from
'./schema'
;
import
{
QUERY_SEARCH_NAME
,
TO_BE_ADD_QUERY_SEARCH_NAME
,
PENDING_FIRST_NOTICE
,
PENDING_SECOND_NOTICE
,
PENDING_TO_SUBMIT
,
PENDING_ADD_PROCESS
,
PENDING_RECEIVE
,
TITLE_MAPS
,
QUERY_PATH
,
TO_BE_ADD_QUERY_PATH
,
QUERY_PATH
,
PENDING_FIRST
,
PENDING_SECOND
,
PENDING_SUBMIT
,
PENDING_RECEIVE
,
//以上代表路径
TITLE_MAPS
,
INNER_STATUS_BADGE_COLOR
,
FILTER_NAMES
,
DETAIL_PATH
}
from
'./contants'
;
import
{
timeRange
}
from
'@/utils'
;
import
{
useRowSelectionTable
}
from
'@/hooks/useRowSelectionTable'
;
import
moment
from
'moment'
;
import
{
Link
}
from
'umi'
const
formActions
=
createFormActions
();
const
columns
:
ColumnsType
=
[
{
title
:
'通知单号'
,
dataIndex
:
'noticeNo'
,
},
{
title
:
'通知单摘要'
,
dataIndex
:
'summary'
,
},
{
title
:
'加工企业名称'
,
dataIndex
:
'processName'
},
{
title
:
'单据时间'
,
dataIndex
:
'createTime'
,
},
{
title
:
'外部状态'
,
dataIndex
:
'outerStatusName'
,
},
{
title
:
'内部状态'
,
dataIndex
:
'innerStatusName'
}
]
// 根据 lastTypeParams, 获取相对应的schema
const
SCHEMAS
=
{
export
const
SCHEMAS
=
{
[
QUERY_PATH
]:
querySchema
,
[
TO_BE_ADD_QUERY_PATH
]:
tobeAddQuerySchema
,
"/pendingFirst"
:
pendingFirstQuerySchema
,
"/pendingSecond"
:
pendingFirstQuerySchema
,
"/pendingSubmit"
:
pendingFirstQuerySchema
,
"/pendingAddProcessing"
:
querySchema
,
"/pendingReceive"
:
querySchema
}
// 根据 lastTypeParams, 获取对应的高级筛选 name
const
FILTER_NAMES
=
{
[
QUERY_PATH
]:
QUERY_SEARCH_NAME
,
[
TO_BE_ADD_QUERY_PATH
]:
TO_BE_ADD_QUERY_SEARCH_NAME
,
"/pendingFirst"
:
PENDING_FIRST_NOTICE
,
"/pendingSecond"
:
PENDING_SECOND_NOTICE
,
"/pendingSubmit"
:
PENDING_TO_SUBMIT
,
"/pendingAddProcessing"
:
PENDING_ADD_PROCESS
,
"/pendingReceive"
:
PENDING_RECEIVE
[
TO_BE_ADD_QUERY_PATH
]:
tobeAddQuerySchema
,
// 待新增生产通知到哪
[
PENDING_FIRST
]:
pendingFirstQuerySchema
,
[
PENDING_SECOND
]:
pendingFirstQuerySchema
,
[
PENDING_SUBMIT
]:
pendingFirstQuerySchema
,
// 带审核生产通知单
[
PENDING_RECEIVE
]:
querySchema
}
// 根据 path, 得到对应的列表页 service
const
SERVICES
=
{
"/query"
:
PublicApi
.
getEnhanceSupplierAllList
,
'/tobeAddQuery'
:
PublicApi
.
getEnhanceSupplierToBeAddList
[
QUERY_PATH
]:
PublicApi
.
getEnhanceSupplierAllList
,
[
TO_BE_ADD_QUERY_PATH
]:
PublicApi
.
getEnhanceSupplierToBeAddList
,
[
PENDING_FIRST
]:
PublicApi
.
getEnhanceSupplierToBeFirstExamList
,
[
PENDING_SECOND
]:
PublicApi
.
getEnhanceSupplierToBeSecondExamList
,
[
PENDING_SUBMIT
]:
PublicApi
.
getEnhanceSupplierToBeSubmitList
,
[
PENDING_RECEIVE
]:
PublicApi
.
getEnhanceSupplierToBeReceiveList
}
const
Query
:
React
.
FC
<
{}
>
=
(
props
)
=>
{
const
ref
=
useRef
<
any
>
({});
const
{
lastTypeParams
}
=
usePageStatus
();
const
[
selectRow
,
selectRowFns
]
=
useRowSelectionTable
({
customKey
:
'id'
});
const
fetchData
=
async
(
params
:
any
)
=>
{
console
.
log
(
params
);
const
service
=
SERVICES
[
lastTypeParams
];
const
res
=
await
service
(
params
);
return
res
.
data
if
(
service
)
{
const
res
=
await
service
(
params
);
return
res
.
data
}
return
{}
};
// 初始化高级筛选选项
...
...
@@ -110,13 +79,77 @@ const Query: React.FC<{}> = (props) => {
const
menu
=
(
<
Menu
>
<
Menu
.
Item
key=
"BatchDelete"
icon=
{
<
DeleteOutlined
/>
}
>
<
Menu
.
Item
key=
"BatchDelete"
onClick=
{
()
=>
handleSubmitToReviewOrDelete
({
type
:
'delete'
})
}
icon=
{
<
DeleteOutlined
/>
}
>
批量删除
</
Menu
.
Item
>
</
Menu
>
);
const
controllerBtns
=
(
const
columns
:
ColumnsType
=
[
{
title
:
'通知单号'
,
dataIndex
:
'noticeNo'
,
render
:
(
text
:
string
,
record
:
any
)
=>
{
const
url
=
DETAIL_PATH
[
lastTypeParams
]
return
(
<
EyePreview
url=
{
`${url}?id=${record.id}`
}
>
{
text
}
</
EyePreview
>
)
}
},
{
title
:
'通知单摘要'
,
dataIndex
:
'summary'
},
{
title
:
'加工企业名称'
,
dataIndex
:
'processName'
},
{
title
:
'单据时间'
,
dataIndex
:
'createTime'
,
render
:
(
text
)
=>
{
return
moment
(
text
).
format
(
'YYYY-MM-DD'
);
}
},
{
title
:
'外部状态'
,
dataIndex
:
'outerStatusName'
,},
{
title
:
'内部状态'
,
dataIndex
:
'innerStatusName'
,
render
:
(
text
,
record
:
any
)
=>
{
return
(
<
Badge
status=
{
INNER_STATUS_BADGE_COLOR
[
record
.
supplierInnerStatus
]
}
text=
{
text
}
></
Badge
>
)
}
}
]
const
hasActionColumn
=
columns
.
concat
([
{
title
:
'操作'
,
render
:
(
text
,
record
:
any
)
=>
{
const
url
=
DETAIL_PATH
[
lastTypeParams
]
const
actionMap
=
{
[
TO_BE_ADD_QUERY_PATH
]:
(<
a
onClick=
{
()
=>
handleUpdateOrDelete
(
'review'
,
{
id
:
record
.
id
})
}
>
{
"提交审核"
}
</
a
>),
[
PENDING_FIRST
]:
<
Link
to
=
{
`
${
url
}
?id=
${
record
.
id
}
`
}
>
审核
<
/Link>
,
[
PENDING_SECOND
]:
<
Link
to
=
{
`
${
url
}
?id=
${
record
.
id
}
`
}
>
审核
<
/Link>
,
[
PENDING_SUBMIT
]:
(<
a
onClick=
{
()
=>
handleUpdateOrDelete
(
'review'
,
{
id
:
record
.
id
})
}
>
{
"提交通知单"
}
</
a
>),
[
PENDING_RECEIVE
]:
<
Link
to
=
{
`
${
url
}
?id=
${
record
.
id
}
`
}
>
收货
<
/Link
>
}
return
(
<
Space
>
{
actionMap
[
lastTypeParams
]
}
{
lastTypeParams
===
TO_BE_ADD_QUERY_PATH
?
<
a
onClick=
{
()
=>
handleUpdateOrDelete
(
'delete'
,
{
id
:
record
.
id
})
}
>
删除
</
a
>
:
null
}
</
Space
>
)
}
}
])
const
controllerBtns
=
()
=>
(
<
Space
>
<
Button
type=
"primary"
...
...
@@ -124,7 +157,7 @@ const Query: React.FC<{}> = (props) => {
>
<
PlusOutlined
/>
新建
</
Button
>
<
Button
>
批量提交审核
</
Button
>
<
Button
onClick=
{
()
=>
handleSubmitToReviewOrDelete
({
type
:
'review'
})
}
>
批量提交审核
</
Button
>
<
Dropdown
.
Button
overlay=
{
menu
}
trigger=
{
[
'click'
]
}
...
...
@@ -135,17 +168,105 @@ const Query: React.FC<{}> = (props) => {
</
Space
>
);
const
batchUpdateBtn
=
(
const
batchUpdateBtn
=
(
)
=>
(
<
div
>
{
lastTypeParams
==
'pendingSubmit'
?
<
Button
>
批量提交
</
Button
>
:
<
Button
>
批量提交审核
</
Button
>
}
<
Button
onClick=
{
()
=>
handleSubmitToReviewOrDelete
({
type
:
'review'
})
}
>
{
lastTypeParams
==
'/pendingSubmit'
?
'批量提交'
:
'批量提交审核'
}
</
Button
>
</
div
>
)
/**
* 批量提交审核,
*/
const
handleSubmitToReviewOrDelete
=
({
type
})
=>
{
let
getParamsAndService
=
{
[
TO_BE_ADD_QUERY_PATH
]:
()
=>
{
return
{
service
:
type
==
'review'
?
PublicApi
.
postEnhanceSupplierToBeAddBatchSubmitExam
:
PublicApi
.
postEnhanceSupplierToBeAddBatchDelete
,
params
:
{
idList
:
selectRowFns
.
selectedRowKeys
,
}
}
},
[
PENDING_FIRST
]:
()
=>
{
return
{
service
:
PublicApi
.
postEnhanceSupplierToBeFirstExamBatchExamPass
,
params
:
{
idList
:
selectRowFns
.
selectedRowKeys
,
}
}
},
[
PENDING_SECOND
]:
()
=>
{
return
{
service
:
PublicApi
.
postEnhanceSupplierToBeSecondExamBatchExamPass
,
params
:
{
idList
:
selectRowFns
.
selectedRowKeys
,
}
}
},
[
PENDING_SUBMIT
]:
()
=>
{
return
{
service
:
PublicApi
.
postEnhanceSupplierToBeSubmitBatchSubmit
,
params
:
{
idList
:
selectRowFns
.
selectedRowKeys
,
}
}
}
}
let
{
params
,
service
}
=
getParamsAndService
[
lastTypeParams
]();
if
(
service
)
{
service
(
params
).
then
(({
data
,
code
})
=>
{
if
(
code
===
1000
)
{
formActions
.
submit
();
}
})
}
}
/**
* 提交审核或者是删除, 用type做标识
* @param values
*/
const
handleUpdateOrDelete
=
(
type
:
string
,
{
id
})
=>
{
let
getParamsAndService
=
{
[
TO_BE_ADD_QUERY_PATH
]:
()
=>
{
return
{
///enhance/supplier/toBeAdd/submitExam
service
:
type
==
'review'
?
PublicApi
.
postEnhanceSupplierToBeAddSubmitExam
:
PublicApi
.
postEnhanceSupplierToBeAddDelete
,
params
:
{
id
:
id
,
}
}
},
[
PENDING_SUBMIT
]:
()
=>
{
return
{
service
:
PublicApi
.
postEnhanceSupplierToBeSubmitSubmit
,
params
:
{
id
:
id
}
}
},
}
let
{
params
,
service
}
=
getParamsAndService
[
lastTypeParams
]();
if
(
service
)
{
service
(
params
).
then
(({
data
,
code
})
=>
{
if
(
code
===
1000
)
{
formActions
.
submit
();
}
})
}
}
console
.
log
(
FILTER_NAMES
[
lastTypeParams
],
SCHEMAS
[
lastTypeParams
]);
/**
* 查询
* @params values 表单字段
*/
...
...
@@ -169,14 +290,15 @@ const Query: React.FC<{}> = (props) => {
<
StandardTable
tableProps=
{
{
rowKey
:
'id'
,
rowSelection
:
selectRow
}
}
columns=
{
columns
}
columns=
{
lastTypeParams
!==
QUERY_PATH
?
hasActionColumn
:
columns
}
currentRef=
{
ref
}
fetchTableData=
{
(
params
:
any
)
=>
fetchData
(
params
)
}
controlRender=
{
<
NiceForm
actions=
{
formActions
}
expressionScope=
{
{
controllerBtns
,
batchUpdateBtn
}
}
expressionScope=
{
{
controllerBtns
:
controllerBtns
(),
batchUpdateBtn
:
batchUpdateBtn
()
}
}
onSubmit=
{
handleSearch
}
effects=
{
(
$
,
actions
)
=>
{
useStateFilterSearchLinkageEffect
(
$
,
actions
,
FILTER_NAMES
[
lastTypeParams
],
FORM_FILTER_PATH
);
...
...
src/pages/handling/components/Query/schema.tsx
View file @
5f27da24
import
{
ISchema
}
from
'@formily/antd'
;
import
{
FORM_FILTER_PATH
}
from
'@/formSchema/const'
;
import
{
QUERY_SEARCH_NAME
,
TO_BE_ADD_QUERY_SEARCH_NAME
}
from
'./contants'
;
import
{
QUERY_SEARCH_NAME
,
TO_BE_ADD_QUERY_SEARCH_NAME
,
PENDING_FIRST_AND_SECOND_NOTICE
}
from
'./contants'
;
import
{
docTime
}
from
'../../common'
;
/**
* @author: Bill
* @description: 指派生产通知单查询页 schema - 生产通知单查询
*/
console
.
log
(
QUERY_SEARCH_NAME
);
export
const
querySchema
:
ISchema
=
{
type
:
'object'
,
properties
:
{
...
...
@@ -21,7 +21,7 @@ export const querySchema: ISchema = {
'x-component-props'
:
{
placeholder
:
'搜索'
,
align
:
'flex-left'
,
tip
:
'输入通知单号进行搜索'
,
tip
:
'输入通知单号
1
进行搜索'
,
},
},
[
FORM_FILTER_PATH
]:
{
...
...
@@ -127,19 +127,17 @@ export const tobeAddQuerySchema: ISchema = {
},
},
properties
:
{
n
ame
:
{
memberN
ame
:
{
type
:
'string'
,
default
:
undefined
,
enum
:
[],
'x-component-props'
:
{
placeholder
:
'加工企业名称
(全部)'
,
placeholder
:
'加工企业名称
'
,
allowClear
:
true
,
},
},
time
:
{
type
:
'string'
,
default
:
undefined
,
enum
:
[]
,
default
:
0
,
enum
:
docTime
,
'x-component-props'
:
{
placeholder
:
'单据时间(全部)'
,
allowClear
:
true
,
...
...
@@ -205,7 +203,7 @@ export const pendingFirstQuerySchema: ISchema = {
children
:
'{{batchUpdateBtn}}'
,
},
},
search
:
{
[
PENDING_FIRST_AND_SECOND_NOTICE
]
:
{
type
:
'string'
,
'x-component'
:
'Search'
,
'x-component-props'
:
{
...
...
@@ -225,10 +223,8 @@ export const pendingFirstQuerySchema: ISchema = {
properties
:
{
name
:
{
type
:
'string'
,
default
:
undefined
,
enum
:
[],
'x-component-props'
:
{
placeholder
:
'加工企业名称
(全部)
'
,
placeholder
:
'加工企业名称'
,
allowClear
:
true
,
},
},
...
...
src/pages/handling/components/WrapTable/index.tsx
View file @
5f27da24
import
React
from
'react'
import
{
Table
}
from
'antd'
import
moment
from
'moment'
;
import
ProcessDetail
from
'../ProcessDetail'
;
const
WrapTable
=
()
=>
{
interface
Iprops
{
dataSource
:
any
[]
}
const
WrapTable
:
React
.
FC
<
Iprops
>
=
(
props
)
=>
{
const
dataSource
=
props
.
dataSource
||
[]
const
columns
=
[
{
title
:
'订单号'
,
dataIndex
:
'
n
o'
,
dataIndex
:
'
orderN
o'
,
},
{
title
:
'ID'
,
...
...
@@ -13,7 +20,7 @@ const WrapTable = () => {
},
{
title
:
'商品名称'
,
dataIndex
:
'
n
ame'
,
dataIndex
:
'
goodsN
ame'
,
},
{
title
:
'品类'
,
...
...
@@ -21,7 +28,7 @@ const WrapTable = () => {
},
{
title
:
'品牌'
,
dataIndex
:
'
type
'
,
dataIndex
:
'
brand
'
,
},
{
title
:
'单位'
,
...
...
@@ -29,29 +36,40 @@ const WrapTable = () => {
},
{
title
:
'加工数量'
,
dataIndex
:
'
number
'
,
dataIndex
:
'
processNum
'
,
},
{
title
:
'加工单价'
,
dataIndex
:
'price'
,
dataIndex
:
'pr
ocessPr
ice'
,
},
{
title
:
'加工费'
,
dataIndex
:
'
total
'
,
dataIndex
:
'
processTotalPrice
'
,
},
{
title
:
'交期'
,
dataIndex
:
'time'
,
dataIndex
:
'deliveryDate'
,
render
:
(
text
,
record
)
=>
{
return
moment
(
text
).
format
(
'YYYY-MM-DD'
);
}
},
{
title
:
'操作'
,
dataIndex
:
'action'
,
render
:
(
text
,
record
)
=>
{
return
(
<
ProcessDetail
type=
"view"
id=
{
record
.
goodsId
}
quantity=
{
record
.
processNum
}
processUnitPrice=
{
record
.
processPrice
}
>
<
a
>
查看加工明细
</
a
>
</
ProcessDetail
>
)
}
},
];
return
(
<
Table
columns=
{
columns
}
dataSource=
{
[]
}
columns=
{
columns
}
rowKey=
{
"id"
}
dataSource=
{
dataSource
}
/>
)
...
...
src/pages/lxMall/purchaseOrder/index.tsx
View file @
5f27da24
...
...
@@ -543,7 +543,8 @@ const PurchaseOrder: React.FC<PurchaseOrderPropsType> = (props) => {
buyOrderInfo
.
payWayList
=
await
getPayWayListByMemberId
(
selectItem
.
memberId
)
PublicApi
.
postOrderIsWorkFlow
({
productIds
}).
then
(
res
=>
{
//@ts-ignore
PublicApi
.
postOrderIsWorkFlow
({
productIds
,
memberId
:
selectItem
.
memberId
}).
then
(
res
=>
{
setConfirmLoading
(
false
)
if
(
res
.
code
===
1000
)
{
message
.
destroy
()
...
...
src/pages/payandSettle/creditManage/components/DetailInfo/index.tsx
View file @
5f27da24
...
...
@@ -14,7 +14,7 @@ import {
CREDIT_OUTER_STATUS
,
CREDIT_STATUS
,
CREDIT_INNER_STATUS_UNCOMMITTED
,
}
from
'@/constants'
;
import
{
normalizeFiledata
,
FileData
}
from
'@/utils'
;
import
{
normalizeFiledata
,
FileData
,
findLastIndexFlowState
,
normalizeFlowData
}
from
'@/utils'
;
import
{
PageHeaderWrapper
}
from
'@ant-design/pro-layout'
;
import
AvatarWrap
from
'@/components/AvatarWrap'
;
import
StatusTag
from
'@/components/StatusTag'
;
...
...
@@ -192,20 +192,22 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
step
:
item
.
step
,
stepName
:
item
.
taskName
,
roleName
:
item
.
roleName
,
status
:
item
.
isExecute
?
'finish'
:
'wait'
,
}))
:
[]
}
outerVerifyCurrent=
{
quotaInfo
&&
quotaInfo
.
outerTaskList
?
quotaInfo
.
outerTaskList
.
findIndex
(
item
=>
item
.
isExecute
===
0
)
:
0
}
outerVerifyCurrent=
{
findLastIndexFlowState
(
quotaInfo
?.
outerTaskList
)
}
innerVerifySteps=
{
quotaInfo
&&
quotaInfo
.
innerTaskList
?
quotaInfo
.
innerTaskList
.
map
(
item
=>
({
step
:
item
.
step
,
stepName
:
item
.
taskName
,
roleName
:
item
.
roleName
,
status
:
item
.
isExecute
?
'finish'
:
'wait'
,
}))
:
[]
}
innerVerifyCurrent=
{
quotaInfo
&&
quotaInfo
.
innerTaskList
?
quotaInfo
.
innerTaskList
.
findIndex
(
item
=>
item
.
isExecute
===
0
)
:
0
}
innerVerifyCurrent=
{
findLastIndexFlowState
(
quotaInfo
?.
innerTaskList
)
}
/>
</
div
>
...
...
src/pages/transaction/components/orderDetailSection/index.tsx
View file @
5f27da24
import
React
from
'react'
import
AuditProcess
from
'@/components/AuditProcess'
import
{
findLastIndexFlowState
}
from
'
../../_public/order
/utils'
import
{
findLastIndexFlowState
}
from
'
@
/utils'
import
OrderProductTable
from
'../../components/orderProductTable'
import
SaleOrderProductTable
from
'../../components/saleOrderProductTable'
import
OrderPayTabs
from
'../../components/orderPayTabs'
...
...
@@ -22,8 +22,22 @@ const OrderDetailSection:React.FC<OrderDetailSectionProps> = ({formContext, type
customKey=
'state'
outerVerifyCurrent=
{
findLastIndexFlowState
(
formContext
.
data
.
externalWorkflowFlowRecordLogResponses
)
}
innerVerifyCurrent=
{
findLastIndexFlowState
(
formContext
.
data
.
interiorWorkflowFlowRecordLogResponses
)
}
outerVerifySteps=
{
formContext
.
data
.
externalWorkflowFlowRecordLogResponses
||
[]
}
innerVerifySteps=
{
formContext
.
data
.
interiorWorkflowFlowRecordLogResponses
||
[]
}
outerVerifySteps=
{
formContext
.
data
.
externalWorkflowFlowRecordLogResponses
?
formContext
.
data
.
externalWorkflowFlowRecordLogResponses
.
map
(
item
=>
({
...
item
,
status
:
item
.
isExecute
?
'finish'
:
'wait'
,
}))
:
[]
}
innerVerifySteps=
{
formContext
.
data
.
interiorWorkflowFlowRecordLogResponses
?
formContext
.
data
.
interiorWorkflowFlowRecordLogResponses
.
map
(
item
=>
({
...
item
,
status
:
item
.
isExecute
?
'finish'
:
'wait'
,
}))
:
[]
}
></
AuditProcess
>
{
type
===
'saleOrder'
?
<
SaleOrderProductTable
/>
:
<
OrderProductTable
editable
/>
}
...
...
src/pages/transaction/purchaseOrder/orderCollect/effects/index.ts
View file @
5f27da24
...
...
@@ -98,7 +98,8 @@ export const useProductTableChangeForPay = (ctx: ISchemaFormActions | ISchemaFor
// 请求一次并复制给支付信息
const
productItem
=
value
[
0
]
fetchOrderApi
.
getPayInfoList
({
productId
:
productItem
.
id
productId
:
productItem
.
id
,
memberId
:
productItem
.
memberId
}).
then
(
data
=>
{
ctx
.
setFieldValue
(
'paymentInformationResponses'
,
data
)
}).
catch
(
err
=>
{
...
...
src/pages/transaction/purchaseOrder/orderCollect/index.tsx
View file @
5f27da24
...
...
@@ -24,8 +24,8 @@ import { useProductTable } from './model/useProductTable'
import
styled
from
'styled-components'
import
{
useUpdate
}
from
'@umijs/hooks'
import
{
PublicApi
}
from
'@/services/api'
import
{
formatTimeString
,
omit
}
from
'@/utils'
import
{
changeRouterTitleByStatus
,
findLastIndexFlowState
}
from
'../../_public/order/utils'
import
{
formatTimeString
,
omit
,
findLastIndexFlowState
}
from
'@/utils'
import
{
changeRouterTitleByStatus
}
from
'../../_public/order/utils'
import
{
ReadyAddOrderDetailContext
}
from
'../context'
import
AuditProcess
from
'@/components/AuditProcess'
...
...
@@ -293,8 +293,22 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
customKey=
'state'
outerVerifyCurrent=
{
findLastIndexFlowState
(
initFormValue
.
externalWorkflowFlowRecordLogResponses
)
}
innerVerifyCurrent=
{
findLastIndexFlowState
(
initFormValue
.
interiorWorkflowFlowRecordLogResponses
)
}
outerVerifySteps=
{
initFormValue
.
externalWorkflowFlowRecordLogResponses
}
innerVerifySteps=
{
initFormValue
.
interiorWorkflowFlowRecordLogResponses
}
outerVerifySteps=
{
initFormValue
.
externalWorkflowFlowRecordLogResponses
?
initFormValue
.
externalWorkflowFlowRecordLogResponses
.
map
(
item
=>
({
...
item
,
status
:
item
.
isExecute
?
'finish'
:
'wait'
,
}))
:
[]
}
innerVerifySteps=
{
initFormValue
.
interiorWorkflowFlowRecordLogResponses
?
initFormValue
.
interiorWorkflowFlowRecordLogResponses
.
map
(
item
=>
({
...
item
,
status
:
item
.
isExecute
?
'finish'
:
'wait'
,
}))
:
[]
}
></
AuditProcess
>
}
<
Card
className=
''
style=
{
{
marginTop
:
24
}
}
>
<
NiceForm
...
...
src/utils/index.tsx
View file @
5f27da24
...
...
@@ -513,6 +513,29 @@ export const coverColFiltersItem = (
}
};
/**
* 找到最后一个可用的工作流状态的索引
* @param {array} data 数据
* @param {string} customKey 自定义 key
*/
export
const
findLastIndexFlowState
=
(
data
:
any
[],
customKey
=
'isExecute'
):
number
=>
{
let
index
=
0
;
if
(
!
Array
.
isArray
(
data
))
{
return
index
;
}
// 循环数据,找到状态值,一直覆盖
for
(
let
i
=
0
;
i
<
data
.
length
;
i
++
)
{
if
(
!
Boolean
(
data
[
i
][
customKey
]))
{
index
=
i
-
1
;
}
// 循环到最后如果 index 还是为 0 的话,说明工作流全部跑完了,此时 index 为 data.length - 1
if
(
i
===
data
.
length
-
1
&&
index
===
0
)
{
index
=
data
.
length
-
1
;
}
}
return
index
;
};
export
default
{
isArray
,
isObject
,
...
...
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