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
c0ba8930
Commit
c0ba8930
authored
Sep 18, 2020
by
LeeJiancong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
'详情明细'
parent
b8ee832c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
136 additions
and
48 deletions
+136
-48
index.less
src/pages/member/components/index.less
+4
-1
detail.tsx
src/pages/transaction/enquiryOffer/components/detail.tsx
+127
-42
productModal.tsx
...ages/transaction/enquiryOffer/components/productModal.tsx
+5
-5
No files found.
src/pages/member/components/index.less
View file @
c0ba8930
...
...
@@ -176,7 +176,10 @@
color : #6B778C;
padding-right: 20px;
&:nth-of-type(n + 4) {
// &:nth-of-type(n + 4) {
// margin: 0;
// }
&:nth-of-type(3n+1) {
margin: 0;
}
...
...
src/pages/transaction/enquiryOffer/components/detail.tsx
View file @
c0ba8930
...
...
@@ -3,7 +3,7 @@
* @Date: 2020-08-24 11:32:05
* @LastEditors: LeeJiancong
* @Copyright: 1549414730@qq.com
* @LastEditTime: 2020-09-1
7 15:49:30
* @LastEditTime: 2020-09-1
8 11:17:34
*/
import
React
,
{
Component
,
useEffect
,
useState
,
ReactNode
,
useRef
}
from
'react'
;
import
{
Row
,
Col
,
Modal
,
Table
,
Tooltip
,
Input
,
Select
,
Switch
,
Button
,
Popconfirm
,
Card
,
Tag
,
Badge
,
Steps
,
Tabs
,
}
from
'antd'
...
...
@@ -23,7 +23,8 @@ import style from './index.less'
import
{
interiorState
,
interiorStateTwo
,
enquirySearchInteriorState
,
enquirySearchexternalState
}
from
'../../common/tableStatusList'
import
statuStyle
from
'../../common/colorTag'
import
PlatType
from
'../../components/platType'
import
RroductModal
from
'../components/productModal'
const
{
Step
}
=
Steps
const
{
TabPane
}
=
Tabs
const
data
=
[
...
...
@@ -60,6 +61,17 @@ const detailInfo: React.FC<{}> = () => {
const
[
platType
,
setplatType
]
=
useState
(
1
)
//需求对接类型
const
[
otherList
,
setotherList
]
=
useState
([])
//动态tab循环
const
[
productSource
,
setproductSource
]
=
useState
([])
//商品列表 新增
const
[
RroductinitialValues
,
setRroductinitialValues
]
=
useState
({})
const
[
requisitionFormId
,
setrequisitionFormId
]
=
useState
(
null
)
//对应需求单号
const
[
tabData
,
settabData
]
=
useState
<
any
>
({})
const
[
dialogVisible
,
setdialogVisible
]
=
useState
(
false
)
const
proRef
=
useRef
<
any
>
({})
const
[
mode
,
setmode
]
=
useState
(
0
)
const
[
eqInfo
,
seteqInfo
]
=
useState
({
purchaseNuit
:
''
,
purchaseQuantity
:
null
,
modelList
:[]
})
//报价明细里的规格列表
let
[
dataInfo
,
setdataInfo
]
=
useState
<
any
>
({
status
:
''
,
externalState
:
0
,
...
...
@@ -245,22 +257,35 @@ const detailInfo: React.FC<{}> = () => {
const
equiryColumns
:
ColumnType
<
any
>
[]
=
[
{
title
:
'报价商品名称'
,
dataIndex
:
'productName'
,
key
:
'productName'
,
align
:
'left'
,
render
:
(
text
:
any
,
records
:
any
)
=>
<
EyePreview
type=
"button"
handleClick=
{
()
=>
{
setRroductinitialValues
(
records
)
setdialogVisible
(
true
)
setmode
(
2
)
}
}
>
{
text
}
</
EyePreview
>
},
{
title
:
'品类'
,
dataIndex
:
'category'
,
key
:
'category'
,
align
:
'left'
},
{
title
:
'商品规格型号'
,
dataIndex
:
'model'
,
key
:
'model'
,
align
:
'left'
,
render
:
(
text
:
any
,
records
:
any
)
=>
<
EyePreview
type=
"button"
handleClick=
{
()
=>
{
handleOpenModal
(
records
.
id
)
}
}
>
{
text
}
</
EyePreview
>
align
:
'left'
},
{
title
:
'品牌'
,
dataIndex
:
'brand'
,
key
:
'brand'
,
align
:
'center'
},
...
otherList
,
// ...otherList,//不展示
{
title
:
'单位'
,
dataIndex
:
'purchaseNuit'
,
...
...
@@ -272,6 +297,21 @@ const detailInfo: React.FC<{}> = () => {
dataIndex
:
'purchaseQuantity'
,
key
:
'purchaseQuantity'
,
align
:
'center'
},
{
title
:
'报价单价'
,
dataIndex
:
'price'
,
key
:
'price'
,
align
:
'center'
,
render
:(
text
,
record
)
=>
<>
¥
{
text
}
</>
},
{
title
:
'金额'
,
dataIndex
:
'totalPrice'
,
key
:
'totalPrice'
,
align
:
'center'
,
render
:(
text
,
record
)
=>
<>
¥
{
(
record
.
purchaseQuantity
&&
record
.
price
)
?
record
.
purchaseQuantity
*
record
.
price
:
''
}
</>
}
]
...
...
@@ -290,6 +330,7 @@ const detailInfo: React.FC<{}> = () => {
// }
// }
setdataInfo
(
data
)
getOrderProductAll
(
data
.
requisitionFormId
)
// interiorStateList = [...data.interiorRequisitionFormStateResponses]
...
...
@@ -313,43 +354,51 @@ const detailInfo: React.FC<{}> = () => {
})
//商品列表
PublicApi
.
getOrderRequisitionFormProductAll
({
id
:
id
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
let
{
data
}
=
res
//商品
let
source
=
[]
let
otherColumnkey
=
[]
//动态列的展示
data
.
forEach
((
v
)
=>
{
let
obj
:
any
=
{}
obj
.
model
=
v
.
model
obj
.
id
=
v
.
id
obj
.
brand
=
v
.
brand
obj
.
purchaseNuit
=
v
.
purchaseNuit
obj
.
purchaseQuantity
=
v
.
purchaseQuantity
if
(
v
.
productAttributeJson
){
JSON
.
parse
(
v
.
productAttributeJson
).
forEach
(
child
=>
{
Object
.
keys
(
child
).
forEach
(
key
=>
{
//获取列头
otherColumnkey
.
push
({
title
:
key
,
dataIndex
:
key
,
key
:
key
,
align
:
'center'
})
// console.log('key',key,child,child[key])
obj
[
key
]
=
child
[
key
]
})
});
}
source
.
push
(
obj
)
})
setotherList
([...
otherColumnkey
])
//生成列
setproductSource
([...
source
])
PublicApi
.
getOrderQuotationParticulars
({
id
:
id
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
){
let
{
data
}
=
res
.
data
setproductSource
([...
data
])
}
})
// //商品列表
// PublicApi.getOrderRequisitionFormProductAll({ id: id }).then(res => {
// if (res.code === 1000) {
// let { data } = res
// //商品
// let source = []
// let otherColumnkey = []//动态列的展示
// data.forEach((v)=> {
// let obj:any = {}
// obj.model = v.model
// obj.id = v.id
// obj.brand = v.brand
// obj.purchaseNuit = v.purchaseNuit
// obj.purchaseQuantity = v.purchaseQuantity
// if(v.productAttributeJson){
// JSON.parse(v.productAttributeJson).forEach(child => {
// Object.keys(child).forEach(key => {
// //获取列头
// otherColumnkey.push({
// title: key,
// dataIndex: key,
// key: key,
// align:'center'
// })
// // console.log('key',key,child,child[key])
// obj[key] = child[key]
// })
// });
// }
// source.push(obj)
// })
// setotherList([...otherColumnkey])//生成列
// setproductSource([...source])
// }
// })
}
...
...
@@ -445,6 +494,31 @@ const detailInfo: React.FC<{}> = () => {
}
}
/**
* @description: 查询 商品规格 赋值单位和数量
* @param {type}
* @return {type}
*/
const
getOrderProductAll
=
(
id
)
=>
{
setrequisitionFormId
(
id
)
//需求id
PublicApi
.
getOrderRequisitionFormProductAll
({
id
:
id
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
){
let
{
data
}
=
res
||
{}
let
{
purchaseNuit
,
purchaseQuantity
}
=
data
[
0
]
let
list
=
data
.
map
(
v
=>
v
.
model
)
setRroductinitialValues
({
...
RroductinitialValues
,
purchaseNuit
:
purchaseNuit
,
purchaseQuantity
:
purchaseQuantity
})
seteqInfo
({...
eqInfo
,
modelList
:
list
})
}
})
}
return
(
<
PageHeaderWrapper
onBack=
{
()
=>
window
.
history
.
back
()
}
...
...
@@ -676,6 +750,17 @@ const detailInfo: React.FC<{}> = () => {
onCancel=
{
()
=>
setvisible
(
false
)
}
onOK=
{
handleModalOK
}
/>
<
RroductModal
dialogVisible=
{
dialogVisible
}
eqInfo=
{
eqInfo
}
//需求单相关
onRef=
{
proRef
}
// onRef={(refs) => setSetForm(refs)}
mode=
{
mode
}
initialValues=
{
RroductinitialValues
}
onCancel=
{
()
=>
setdialogVisible
(
false
)
}
>
</
RroductModal
>
</
PageHeaderWrapper
>
)
...
...
src/pages/transaction/enquiryOffer/components/productModal.tsx
View file @
c0ba8930
...
...
@@ -3,7 +3,7 @@
* @Date: 2020-08-28 10:07:45
* @LastEditors: LeeJiancong
* @Copyright: 1549414730@qq.com
* @LastEditTime: 2020-09-1
6 16:46:52
* @LastEditTime: 2020-09-1
8 11:18:40
*/
import
React
,
{
Component
,
useState
,
useRef
,
useEffect
,
useImperativeHandle
}
from
'react'
;
import
{
Modal
,
Button
,
Space
,
Form
,
Radio
,
AutoComplete
,
Badge
,
Tabs
,
Input
,
Select
,
Checkbox
}
from
'antd'
...
...
@@ -20,17 +20,17 @@ const { TextArea } = Input
export
interface
Params
{
sourceData
?:
Array
<
any
>
[],
eqInfo
:
any
,
eqInfo
:
any
,
//重置需求单号列表
id
?:
any
,
mode
?:
number
,
mode
?:
number
,
// 0 新增 1编辑 2 查看
type
?:
number
|
string
,
dialogVisible
:
boolean
;
currentRef
?:
any
;
onCancel
:
Function
;
onRef
?:
any
;
onOK
?:
Function
;
initialValues
?:
any
;
productAttributeJson
:
Function
;
//明细中的属性
initialValues
?:
any
;
//初始化
productAttributeJson
?
:
Function
;
//明细中的属性
dontReceive
?:
boolean
;
//默认展示
}
const
layout
=
{
...
...
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