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
44fe2d02
Commit
44fe2d02
authored
Oct 20, 2020
by
前端-黄佳鑫
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' into test
parents
65615cbf
6a55e1cb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
32 deletions
+43
-32
productModal.tsx
...ges/transaction/enquirySubmit/components/productModal.tsx
+24
-11
detail.tsx
src/pages/transaction/enquirySubmit/toAddSubmit/detail.tsx
+19
-21
No files found.
src/pages/transaction/enquirySubmit/components/productModal.tsx
View file @
44fe2d02
...
...
@@ -6,7 +6,7 @@
* @LastEditTime: 2020-09-11 16:51:28
*/
import
React
,
{
Component
,
useState
,
useEffect
,
Fragment
}
from
'react'
;
import
{
Modal
,
Button
,
Form
,
Radio
,
AutoComplete
,
Tabs
,
Input
,
Select
,
Checkbox
}
from
'antd'
import
{
Modal
,
Button
,
Form
,
Radio
,
AutoComplete
,
Tabs
,
Input
,
Select
,
Checkbox
,
message
}
from
'antd'
import
{
PublicApi
}
from
'@/services/api'
const
{
TabPane
}
=
Tabs
const
{
Option
}
=
Select
...
...
@@ -43,11 +43,13 @@ const comfirmDialog: React.FC<Params> = (props) => {
const
[
placeOfOriginList
,
setplaceOfOriginList
]
=
useState
([])
//产地
const
handleCancel
=
()
=>
{
}
const
handletOk
=
()
=>
{
form
.
validateFields
().
then
(
v
=>
{
cons
ole
.
log
(
v
)
const
handletOk
=
async
()
=>
{
try
{
cons
t
v
=
await
form
.
validateFields
();
props
.
onOK
(
v
)
})
}
catch
(
err
)
{
message
.
error
(
'有必填项没填写请检查!'
)
}
// if(props.type){
// value.type = props.type
// }
...
...
@@ -176,14 +178,20 @@ const comfirmDialog: React.FC<Params> = (props) => {
<
Form
.
Item
label=
'规格型号'
name=
'model'
required
rules=
{
[{
required
:
true
,
message
:
'此项为必填项'
}]
}
>
<
Input
placeholder=
''
/>
</
Form
.
Item
>
<
Form
.
Item
label=
'商品品牌'
name=
'brand'
required
rules=
{
[{
required
:
true
,
message
:
'此项为必填项'
}]
}
>
<
Input
placeholder=
''
/>
</
Form
.
Item
>
...
...
@@ -198,8 +206,7 @@ const comfirmDialog: React.FC<Params> = (props) => {
}
{
props
.
sourceData
.
length
>
0
&&
props
.
sourceData
.
map
((
attributeItem
:
any
)
=>
{
console
.
log
(
attributeItem
,
10086
)
return
(
return
(
<
TabPane
tab=
{
attributeItem
.
name
}
key=
{
attributeItem
.
id
}
>
{
renderTabPanchildren
(
attributeItem
)
...
...
@@ -212,7 +219,10 @@ const comfirmDialog: React.FC<Params> = (props) => {
<
Form
.
Item
label=
'单位'
name=
'purchaseNuit'
required
rules=
{
[{
required
:
true
,
message
:
'此项为必填项'
}]
}
>
<
Input
placeholder=
''
/>
</
Form
.
Item
>
...
...
@@ -220,7 +230,10 @@ const comfirmDialog: React.FC<Params> = (props) => {
<
Form
.
Item
label=
'采购数量'
name=
'purchaseQuantity'
required
rules=
{
[{
required
:
true
,
message
:
'此项为必填项'
}]
}
>
<
Input
placeholder=
''
/>
</
Form
.
Item
>
...
...
src/pages/transaction/enquirySubmit/toAddSubmit/detail.tsx
View file @
44fe2d02
...
...
@@ -351,7 +351,7 @@ const Detail: React.FC<{}> = () => {
PublicApi
.
getProductPlatformGetCategoryById
({
id
:
seletCategoryId
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
let
data
=
res
.
data
console
.
log
(
data
,
10086
)
console
.
log
(
data
,
10086
)
settabData
([
data
])
//转成数组
let
da
=
[]
// data.forEach((item: any) => {
...
...
@@ -531,12 +531,7 @@ const Detail: React.FC<{}> = () => {
const
handleOptionBtn
=
(
type
:
any
)
=>
{
switch
(
type
)
{
case
1
:
if
(
Object
.
keys
(
tabData
).
length
>
0
)
{
setdialogVisible
(
true
)
}
else
{
message
.
error
(
'请选择商品品类!'
)
}
setdialogVisible
(
true
)
break
;
case
2
:
setVisibleChannelMember
(
true
)
...
...
@@ -609,7 +604,7 @@ const Detail: React.FC<{}> = () => {
*/
if
(
id
)
{
PublicApi
.
getOrderRequisitionFormDetails
({
id
}).
then
(
res
=>
{
PublicApi
.
getOrderRequisitionFormDetails
({
id
:
id
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
let
data
=
res
.
data
let
areaCodeList
=
[]
...
...
@@ -639,7 +634,7 @@ const Detail: React.FC<{}> = () => {
tabForm
.
resetFields
()
//需求单对接列表
PublicApi
.
getOrderRequisitionFormDemandDockingList
({
id
}).
then
(
res
=>
{
PublicApi
.
getOrderRequisitionFormDemandDockingList
({
id
:
id
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
let
{
data
}
=
res
.
data
if
(
_plattype
==
2
)
{
//系统匹配
...
...
@@ -929,23 +924,26 @@ const Detail: React.FC<{}> = () => {
*/
const
handleSubmit
=
(
values
:
any
)
=>
{
let
item
=
{}
// Object.keys(values).forEach((key) => {
// item[key] = values[key]
// })
let
list
=
[]
//先循环所有 再循环有值的
otherList
.
forEach
((
vitem
:
any
)
=>
{
if
(
otherList
.
length
>
0
)
{
otherList
.
forEach
((
vitem
:
any
)
=>
{
Object
.
keys
(
values
).
forEach
((
key
)
=>
{
if
(
vitem
.
title
==
key
)
{
item
[
key
]
=
values
[
vitem
.
title
]
}
else
{
item
[
key
]
=
values
[
key
]
}
})
})
}
else
{
Object
.
keys
(
values
).
forEach
((
key
)
=>
{
if
(
vitem
.
title
==
key
)
{
item
[
key
]
=
values
[
vitem
.
title
]
console
.
log
(
values
,
'详情页面1'
)
}
else
{
item
[
key
]
=
values
[
key
]
console
.
log
(
values
,
'详情页面2'
)
}
item
[
key
]
=
values
[
key
]
})
})
}
list
.
push
(
item
)
setproductSource
([...
productSource
,
...
list
])
//新增就要合并
...
...
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