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
e76ef1eb
Commit
e76ef1eb
authored
Jul 30, 2021
by
前端-黄佳鑫
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
🐞
fix(采购询价): 添加采购物料加上不可重复选择物货号
parent
c0ccd3b5
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
11 deletions
+26
-11
index.tsx
src/pages/transaction/components/TableLayout/index.tsx
+8
-1
basic.tsx
...seAbility/purchaseInquiry/addInquiry/components/basic.tsx
+1
-7
material.tsx
...bility/purchaseInquiry/addInquiry/components/material.tsx
+2
-0
index.tsx
...urchaseAbility/purchaseInquiry/addInquiry/modal/index.tsx
+15
-3
No files found.
src/pages/transaction/components/TableLayout/index.tsx
View file @
e76ef1eb
...
...
@@ -56,11 +56,18 @@ const Table: React.FC<Iprops> = (props: any) => {
/** 列表数据 */
const
fetchData
=
(
params
?:
any
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
if
(
!
Array
.
isArray
(
fetch
))
{
fetch
({
...
params
}).
then
(
res
=>
{
resolve
(
res
.
data
)
}).
catch
(
error
=>
{
console
.
warn
(
error
)
})
return
}
resolve
({
code
:
1000
,
data
:
fetch
})
})
}
...
...
@@ -119,7 +126,7 @@ const Table: React.FC<Iprops> = (props: any) => {
<
StandardTable
currentRef=
{
tableRef
}
columns=
{
columns
}
tableProps=
{
{
rowKe
w
:
'id'
}
}
tableProps=
{
{
rowKe
y
:
'id'
}
}
rowSelection=
{
selectedRow
&&
rowSelection
}
fetchTableData=
{
(
params
:
any
)
=>
fetchData
(
params
)
}
controlRender=
{
...
...
src/pages/transaction/purchaseAbility/purchaseInquiry/addInquiry/components/basic.tsx
View file @
e76ef1eb
...
...
@@ -109,10 +109,8 @@ const BasicInfo: React.FC<Iprops> = (props: any) => {
city
[
idx
]
=
{
citydata
:
res
.
data
}
setcity
([...
city
])
}
})
})
.
catch
(()
=>
{})
}
}).
catch
(
error
=>
{
console
.
warn
(
error
)
})
}
else
{
...
...
@@ -130,13 +128,11 @@ const BasicInfo: React.FC<Iprops> = (props: any) => {
})
setcity
([...
city
])
}
console
.
log
(
2
)
setrequisitionFormAddress
(
result
);
}
/** 选择城市的时候下拉就调用方 */
const
onDropdownVisibleChange
=
()
=>
{
console
.
log
(
1
)
return
new
Promise
(
reslove
=>
reslove
(
code
)).
then
((
res
:
any
)
=>
{
city
.
forEach
((
item
:
any
)
=>
{
item
.
citydata
.
filter
(
it
=>
{
...
...
@@ -148,8 +144,6 @@ const BasicInfo: React.FC<Iprops> = (props: any) => {
})
})
setcity
([...
city
])
}).
catch
(
error
=>
{
console
.
warn
(
error
)
})
}
...
...
src/pages/transaction/purchaseAbility/purchaseInquiry/addInquiry/components/material.tsx
View file @
e76ef1eb
...
...
@@ -182,6 +182,7 @@ const Material: React.FC<Iprops> = (props: any) => {
}
},
[
fetchdata
])
return
(
<>
<
Form
...
...
@@ -222,6 +223,7 @@ const Material: React.FC<Iprops> = (props: any) => {
{
materielMode
===
1
&&
(
<
AnchorModal
dataSource=
{
dataSource
}
preview=
{
isPreview
}
edit=
{
edit
}
visible=
{
flag
}
...
...
src/pages/transaction/purchaseAbility/purchaseInquiry/addInquiry/modal/index.tsx
View file @
e76ef1eb
...
...
@@ -18,6 +18,8 @@ const layout: any = {
};
interface
AnchorModalProps
{
/** 列表数据 */
dataSource
?:
any
[],
/** 显示隐藏 */
visible
?:
boolean
,
/** 是否查看数据 */
...
...
@@ -32,13 +34,14 @@ interface AnchorModalProps {
const
AnchorModal
:
React
.
FC
<
AnchorModalProps
>
=
(
props
:
any
)
=>
{
const
[
form
]
=
Form
.
useForm
();
const
{
visible
,
preview
,
edit
,
onClose
,
onConfirm
}
=
props
;
const
{
dataSource
,
visible
,
preview
,
edit
,
onClose
,
onConfirm
}
=
props
;
const
[
loading
,
setloading
]
=
useState
<
boolean
>
(
false
);
const
[
searchVisible
,
setSearchVisible
]
=
useState
<
boolean
>
(
false
)
const
[
isSeleted
,
setIsSeleted
]
=
useState
<
number
>
(
1
);
const
[
category
,
setcategory
]
=
useState
([]);
const
[
files
,
setFiles
]
=
useState
([]);
const
[
product
,
setProduct
]
=
useState
<
any
>
({});
const
[
ids
,
setIds
]
=
useState
<
Array
<
number
>
[]
>
([])
const
[
menu
]
=
useState
([
{
id
:
1
,
label
:
'基本信息'
},
...
...
@@ -99,7 +102,6 @@ const AnchorModal: React.FC<AnchorModalProps> = (props: any) => {
console
.
warn
(
error
)
})
}).
then
((
data
:
any
)
=>
{
console
.
log
(
data
)
setcategory
(
data
)
})
}
...
...
@@ -110,7 +112,6 @@ const AnchorModal: React.FC<AnchorModalProps> = (props: any) => {
setIsSeleted
(
1
)
searchCategoryTree
(
null
);
if
(
!
isEmpty
(
edit
))
{
console
.
log
(
edit
)
form
.
setFieldsValue
({
number
:
edit
.
number
,
name
:
edit
.
name
,
...
...
@@ -122,11 +123,22 @@ const AnchorModal: React.FC<AnchorModalProps> = (props: any) => {
})
setFiles
(
edit
.
urls
)
}
if
(
!
isEmpty
(
dataSource
))
{
const
arr
:
Array
<
number
>
[]
=
[]
dataSource
.
forEach
(
item
=>
{
arr
.
push
(
item
.
goodsId
)
});
setIds
(
arr
)
}
},
[
visible
]);
/** 选择货品点击 */
const
confirm
=
(
selectRowKeys
:
string
[]
|
number
[],
selectRowRecord
:
any
)
=>
{
const
selectRow
=
selectRowRecord
;
if
(
ids
.
includes
(
selectRow
[
0
].
id
))
{
message
.
error
(
'货品已存在,请勿重复选择!'
)
return
}
if
(
selectRow
.
length
>
0
)
{
const
data
:
any
=
selectRow
[
0
]
if
(
data
.
customerCategory
.
category
)
{
...
...
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