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
29f50b81
Commit
29f50b81
authored
Aug 07, 2021
by
前端-钟卫鹏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:
parent
1ff03345
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
39 additions
and
35 deletions
+39
-35
index.tsx
src/pages/classAndProperty/attribute/index.tsx
+15
-13
index.tsx
src/pages/classAndProperty/propertyValue/index.tsx
+16
-14
index.tsx
...nsaction/purchaseOrder/orderCollectSrm/constant/index.tsx
+0
-1
index.tsx
...pages/transaction/purchaseOrder/orderCollectSrm/index.tsx
+2
-0
index.tsx
src/pages/transaction/purchaseOrder/readyAddOrder/index.tsx
+6
-7
No files found.
src/pages/classAndProperty/attribute/index.tsx
View file @
29f50b81
...
...
@@ -24,6 +24,7 @@ import Submit from '@/components/NiceForm/components/Submit'
import
{
useStateFilterSearchLinkageEffect
}
from
'@/formSchema/effects/useFilterSearch'
import
ModalTable
from
'@/components/ModalTable'
import
{
clearModalParams
}
from
'@/utils'
import
{
useRowSelectionTable
}
from
'@/hooks/useRowSelectionTable'
// import styles from './index.less'
const
formActions
=
createFormActions
();
...
...
@@ -82,10 +83,11 @@ const Attribute: React.FC<{}> = () => {
const
ref
=
useRef
<
any
>
({})
const
syncRef
=
useRef
<
any
>
({})
const
[
syncVisible
,
setSyncVisible
]
=
useState
<
boolean
>
(
false
)
const
[
selectRow
,
setSelectRow
]
=
useState
<
any
[]
>
([])
// 模态框选择的行数据
const
[
selectedRowKeys
,
setSelectedRowKeys
]
=
useState
<
Array
<
string
>>
([])
//
const [selectRow, setSelectRow] = useState<any[]>([]) // 模态框选择的行数据
//
const [selectedRowKeys, setSelectedRowKeys] = useState<Array<string>>([])
const
[
syncLoading
,
setSyncLoading
]
=
useState
<
boolean
>
(
false
)
const
[
rowSelection
,
rowSelectionCtl
]
=
useRowSelectionTable
({
customKey
:
'id'
})
const
fetchData
=
(
params
?:
any
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
...
...
@@ -201,23 +203,23 @@ const Attribute: React.FC<{}> = () => {
setSyncVisible
(
true
)
}
const
rowSelection
:
any
=
{
type
:
'checkbox'
,
selectedRowKeys
:
selectedRowKeys
,
onChange
:
(
selectedRowKeys
:
any
,
selectedRows
:
any
)
=>
{
setSelectRow
(
selectedRows
)
setSelectedRowKeys
(
selectedRowKeys
)
}
};
//
const rowSelection: any = {
//
type: 'checkbox',
//
selectedRowKeys: selectedRowKeys,
//
onChange: (selectedRowKeys: any, selectedRows: any) => {
//
setSelectRow(selectedRows)
//
setSelectedRowKeys(selectedRowKeys)
//
}
//
};
const
handleAsyncOk
=
()
=>
{
setSyncLoading
(
true
)
if
(
selectedRowKeys
.
length
)
{
if
(
rowSelectionCtl
.
selectedRowKeys
.
length
)
{
// @ts-ignore
PublicApi
.
postProductCustomerSyncAttribute
({
idList
:
selectedRowKeys
}).
then
(
res
=>
{
PublicApi
.
postProductCustomerSyncAttribute
({
idList
:
rowSelectionCtl
.
selectedRowKeys
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
ref
.
current
.
reload
()
setSelectedRowKeys
([])
rowSelectionCtl
.
setSelectedRowKeys
([])
}
setSyncVisible
(
false
)
setSyncLoading
(
false
)
...
...
src/pages/classAndProperty/propertyValue/index.tsx
View file @
29f50b81
...
...
@@ -9,7 +9,7 @@ import {
}
from
'@ant-design/icons'
;
import
{
PageHeaderWrapper
}
from
'@ant-design/pro-layout'
;
import
{
history
}
from
'umi'
;
import
{
MenuTree
,
StandardTable
}
from
'god'
;
import
{
StandardTable
}
from
'god'
;
import
{
ColumnType
}
from
'antd/lib/table/interface'
;
import
{
PublicApi
}
from
'@/services/api'
;
import
{
useTreeTabs
}
from
'@/hooks/useTreeTabs'
;
...
...
@@ -21,6 +21,7 @@ import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilte
import
Submit
from
'@/components/NiceForm/components/Submit'
import
{
ISchema
}
from
'@formily/antd'
;
import
{
clearModalParams
}
from
'@/utils'
;
import
{
useRowSelectionTable
}
from
'@/hooks/useRowSelectionTable'
;
const
treeActions
=
createTreeActions
()
...
...
@@ -91,8 +92,9 @@ const PropertyValue: React.FC<{}> = () => {
const
[
syncVisible
,
setSyncVisible
]
=
useState
(
false
)
const
[
syncLoading
,
setSyncLoading
]
=
useState
<
boolean
>
(
false
)
const
[
selectRow
,
setSelectRow
]
=
useState
<
any
[]
>
([])
// 模态框选择的行数据
const
[
selectedRowKeys
,
setSelectedRowKeys
]
=
useState
<
Array
<
string
>>
([])
// const [selectRow, setSelectRow] = useState<any[]>([]) // 模态框选择的行数据
// const [selectedRowKeys, setSelectedRowKeys] = useState<Array<string>>([])
const
[
rowSelection
,
rowSelectionCtl
]
=
useRowSelectionTable
({
customKey
:
'id'
})
const
{
treeData
,
...
...
@@ -282,26 +284,26 @@ const PropertyValue: React.FC<{}> = () => {
setSyncVisible
(
true
)
}
const
rowSelection
:
any
=
{
type
:
'checkbox'
,
selectedRowKeys
:
selectedRowKeys
,
onChange
:
(
selectedRowKeys
:
any
,
selectedRows
:
any
)
=>
{
setSelectRow
(
selectedRows
)
setSelectedRowKeys
(
selectedRowKeys
)
}
};
//
const rowSelection: any = {
//
type: 'checkbox',
//
selectedRowKeys: selectedRowKeys,
//
onChange: (selectedRowKeys: any, selectedRows: any) => {
//
setSelectRow(selectedRows)
//
setSelectedRowKeys(selectedRowKeys)
//
}
//
};
const
handleAsyncOk
=
()
=>
{
setSyncLoading
(
true
)
if
(
selectedRowKeys
.
length
)
{
if
(
rowSelectionCtl
.
selectedRowKeys
.
length
)
{
// @ts-ignore
PublicApi
.
postProductCustomerSyncAttributeValue
({
idList
:
selectedRowKeys
}).
then
(
res
=>
{
PublicApi
.
postProductCustomerSyncAttributeValue
({
idList
:
rowSelectionCtl
.
selectedRowKeys
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
if
(
ref
?.
current
?.
reload
)
{
ref
.
current
.
reload
()
}
resetMenu
()
setSelectedRowKeys
([])
rowSelectionCtl
.
setSelectedRowKeys
([])
}
setSyncVisible
(
false
)
setSyncLoading
(
false
)
...
...
src/pages/transaction/purchaseOrder/orderCollectSrm/constant/index.tsx
View file @
29f50b81
...
...
@@ -379,7 +379,6 @@ export const materialInfoColumns: any[] = [
dataIndex
:
'amount'
,
align
:
'center'
,
key
:
'amount'
,
render
:
(
t
)
=>
`¥
${
t
}
`
},
// 接口调用
{
...
...
src/pages/transaction/purchaseOrder/orderCollectSrm/index.tsx
View file @
29f50b81
...
...
@@ -155,6 +155,8 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
const
address
=
deliveryAddress
[
0
]
return
{
...
item
,
spec
:
item
.
type
,
quotedSpec
:
item
.
relevanceProductType
,
deliveryType
:
item
.
logistics
,
addressId
:
address
.
id
,
address
:
address
.
fullAddress
,
...
...
src/pages/transaction/purchaseOrder/readyAddOrder/index.tsx
View file @
29f50b81
...
...
@@ -37,24 +37,23 @@ const fetchOrderMode = async () => {
}
const
ReadyAddOrder
:
React
.
FC
<
ReadyAddOrderProps
>
=
(
props
)
=>
{
const
{
run
:
deleteRun
}
=
useHttpRequest
(
PublicApi
.
postOrder
ProcurementOrderDeleteAll
)
const
{
loading
:
submitLoading
,
run
:
submitRun
}
=
useHttpRequest
(
PublicApi
.
postOrder
ProcurementOrderSubmitExamineAll
)
const
{
run
:
deleteRun
}
=
useHttpRequest
(
PublicApi
.
postOrder
BuyerCreateDeleteBatch
)
const
{
loading
:
submitLoading
,
run
:
submitRun
}
=
useHttpRequest
(
PublicApi
.
postOrder
BuyerCreateSubmitBatch
)
const
currentRef
=
useRef
<
any
>
({})
const
{
columns
,
ref
,
rowSelection
,
rowSelectionCtl
}
=
useSelfTable
()
const
handleMenuClick
=
async
(
e
)
=>
{
switch
(
e
.
key
)
{
case
'1'
:
{
// 批量删除
const
canDelete
=
!
rowSelectionCtl
.
selectRow
.
some
(
v
=>
v
.
interiorState
!==
PurchaseOrderInsideWorkState
.
ADD_PURCHASE_ORDER
)
if
(
canDelete
)
{
const
{
code
}
=
await
deleteRun
({
ids
:
rowSelectionCtl
.
selectedRowKeys
})
if
(
rowSelectionCtl
.
selectRow
.
length
)
{
const
{
code
}
=
await
deleteRun
(
rowSelectionCtl
.
selectedRowKeys
.
map
(
item
=>
({
orderId
:
item
})))
if
(
code
===
1000
)
{
ref
.
current
.
reload
()
rowSelectionCtl
.
setSelectRow
([])
rowSelectionCtl
.
setSelectedRowKeys
([])
}
}
else
{
message
.
error
(
'
只能删除内部状态为未审核过
的订单'
)
message
.
error
(
'
请先选择待新增
的订单'
)
}
break
;
}
...
...
@@ -63,7 +62,7 @@ const ReadyAddOrder:React.FC<ReadyAddOrderProps> = (props) => {
const
handleBitchPush
=
async
()
=>
{
if
(
rowSelectionCtl
.
selectRow
.
length
)
{
const
{
code
}
=
await
submitRun
(
{
ids
:
rowSelectionCtl
.
selectedRowKeys
}
)
const
{
code
}
=
await
submitRun
(
rowSelectionCtl
.
selectedRowKeys
.
map
(
item
=>
({
orderId
:
item
}))
)
if
(
code
===
1000
)
{
ref
.
current
.
reload
()
rowSelectionCtl
.
setSelectRow
([])
...
...
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