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
d4f7dbd0
Commit
d4f7dbd0
authored
Jul 06, 2021
by
前端-黄佳鑫
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
🐞
fix: 修复采购询价bug
parent
c49d7c42
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
133 additions
and
187 deletions
+133
-187
index.tsx
src/components/ModalTable/index.tsx
+2
-2
index.tsx
src/pages/transaction/components/TableModal/index.tsx
+3
-2
addForm.tsx
...saction/dealAbility/inquiryOffer/waitAddOffer/addForm.tsx
+4
-2
basicInfo.tsx
...bility/inquiryOffer/waitAddOffer/components/basicInfo.tsx
+6
-4
productQuote.tsx
...ity/inquiryOffer/waitAddOffer/components/productQuote.tsx
+47
-22
tradingConditions.tsx
...nquiryOffer/waitAddOffer/components/tradingConditions.tsx
+1
-1
index.tsx
...ity/components/detail/components/contrastLyout1/index.tsx
+2
-5
index.tsx
...ents/detail/components/contrastLyout1/rowLayout/index.tsx
+7
-2
index.tsx
...saction/purchaseAbility/components/modalOperate/index.tsx
+3
-3
index.tsx
...transaction/purchaseAbility/confirmOffer/demand/index.tsx
+1
-1
add.tsx
...ages/transaction/purchaseAbility/offter/addOffter/add.tsx
+2
-1
offer.tsx
...ion/purchaseAbility/offter/addOffter/components/offer.tsx
+2
-4
crossSellProducts.tsx
...chaseAbility/offter/addOffter/modal/crossSellProducts.tsx
+1
-1
selectProduct.tsx
.../purchaseAbility/offter/addOffter/modal/selectProduct.tsx
+6
-5
index.tsx
.../transaction/purchaseAbility/purchaseBid/detail/index.tsx
+2
-2
demand.tsx
...eAbility/purchaseInquiry/addInquiry/components/demand.tsx
+2
-2
material.tsx
...bility/purchaseInquiry/addInquiry/components/material.tsx
+18
-122
drawerWrite.tsx
...eAbility/purchaseInquiry/addInquiry/modal/drawerWrite.tsx
+23
-5
index.tsx
...nsaction/purchaseAbility/purchaseInquiry/detail/index.tsx
+1
-1
No files found.
src/components/ModalTable/index.tsx
View file @
d4f7dbd0
...
...
@@ -121,8 +121,8 @@ const ModalTable:React.FC<ModalTableProps> = (props) => {
tableType=
'small'
currentRef=
{
selfRef
}
formRender=
{
(
child
,
ps
)
=>
<
Row
justify=
'space-between'
style=
{
{
marginBottom
:
16
}
}
>
<
Col
span=
{
18
}
style=
{
{
zIndex
:
99
}
}
>
{
child
}
</
Col
>
<
Col
style=
{
{
marginTop
:
4
}
}
>
{
ps
}
</
Col
>
<
Col
span=
{
22
}
style=
{
{
zIndex
:
99
}
}
>
{
child
}
</
Col
>
<
Col
s
pan=
{
2
}
s
tyle=
{
{
marginTop
:
4
}
}
>
{
ps
}
</
Col
>
</
Row
>
}
formilyProps=
{
modalType
===
'none'
?
null
:
{
...
...
src/pages/transaction/components/TableModal/index.tsx
View file @
d4f7dbd0
...
...
@@ -133,7 +133,7 @@ const TableModal: React.FC<Iprops> = (props: Iprops) => {
onClose=
{
handleOnClose
}
onCancel=
{
handleOnClose
}
// onOk={handleOk}
width=
{
84
0
}
width=
{
90
0
}
{
...
otherProps
}
>
<
StandardTable
...
...
@@ -142,6 +142,7 @@ const TableModal: React.FC<Iprops> = (props: Iprops) => {
...
tableProps
,
pagination
:
false
}
}
tableType=
"small"
fetchTableData=
{
fetchData
}
currentRef=
{
ref
}
rowSelection=
{
{
...
...
@@ -151,7 +152,7 @@ const TableModal: React.FC<Iprops> = (props: Iprops) => {
hideSelectAll
:
customizeRadio
,
}
}
formRender=
{
(
child
,
ps
)
=>
<
Row
justify=
'space-between'
style=
{
{
marginBottom
:
16
}
}
>
<
Col
style=
{
{
zIndex
:
99
}
}
>
{
child
}
</
Col
>
<
Col
s
pan=
{
18
}
s
tyle=
{
{
zIndex
:
99
}
}
>
{
child
}
</
Col
>
<
Col
style=
{
{
marginTop
:
4
}
}
>
{
ps
}
</
Col
>
</
Row
>
}
controlRender=
{
...
...
src/pages/transaction/dealAbility/inquiryOffer/waitAddOffer/addForm.tsx
View file @
d4f7dbd0
...
...
@@ -203,6 +203,7 @@ export default AddQuotes
// const [form] = Form.useForm();
// const [unsaved, setUnsaved] = useState<boolean>(false);
// const [dataSource, setDataSource] = useState({});
// const [productQuote, setProductQuote] = useState([])
// useEffect(() => {
// if (id && !spam) {
...
...
@@ -213,6 +214,7 @@ export default AddQuotes
// return
// }
// setDataSource(res.data);
// setProductQuote(res.data.inquiryListProductRequests)
// form.setFieldsValue({
// ...res.data,
// })
...
...
@@ -242,8 +244,8 @@ export default AddQuotes
// }
// }}
// >
// <BasicInfoLayout />
// <ProductQuoteLayout />
// <BasicInfoLayout
isEdit={spam}
/>
// <ProductQuoteLayout
setProductQuote={productQuote}
/>
// <OtherExplainLayout />
// <AttachLayout />
// </Form>
...
...
src/pages/transaction/dealAbility/inquiryOffer/waitAddOffer/components/basicInfo.tsx
View file @
d4f7dbd0
...
...
@@ -194,10 +194,12 @@ export default BasicInfo
// import { FORM_FILTER_PATH } from '@/formSchema/const';
// import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch';
// interface BasicInfoLayoutProps {
// /** 是否可修改 */
// isEdit?: boolean,
// }
// const BasicInfoLayout: React.FC<BasicInfoLayoutProps> = () => {
// const BasicInfoLayout: React.FC<BasicInfoLayoutProps> = (props: any) => {
// const { isEdit } = props;
// const context = useContext(Context);
// const format = (text, fmt?: string) => {
// return <>{moment(text).format(fmt || "YYYY-MM-DD HH:mm:ss")}</>
...
...
@@ -260,7 +262,7 @@ export default BasicInfo
// <Input />
// </Form.Item>
// <Form.Item label="对应询价单号" name='inquiryListNo' rules={[{ required: true, message: '请选择对应询价单号' }]}>
// <Input.Search readOnly onSearch={() => toggle(true)} enterButton={<Button style={{ height: '31.19px' }} icon={<LinkOutlined />}>选择</Button>} />
// <Input.Search readOnly onSearch={() => toggle(true)} enterButton={<Button
disabled={isEdit}
style={{ height: '31.19px' }} icon={<LinkOutlined />}>选择</Button>} />
// </Form.Item>
// </Col>
// <Col span={12} className={style.searchColor}>
...
...
@@ -330,7 +332,7 @@ export default BasicInfo
// span: 5
// },
// "x-component-props": {
// inline: true
// inline: true
,
// },
// properties: {
// memberName: {
...
...
src/pages/transaction/dealAbility/inquiryOffer/waitAddOffer/components/productQuote.tsx
View file @
d4f7dbd0
import
React
,
{
useState
}
from
'react'
;
import
{
Form
,
Button
,
Table
,
InputNumber
,
Image
}
from
'antd'
;
import
{
LinkOutlined
}
from
'@ant-design/icons'
;
import
React
,
{
useEffect
,
useState
}
from
'react'
;
import
{
Form
,
Button
,
Table
,
Input
,
Image
}
from
'antd'
;
import
{
ColumnType
}
from
'antd/lib/table/interface'
;
import
Card
from
'@/pages/transaction/components/card'
;
import
{
isEmpty
}
from
'@/components/NiceForm/components/AntUpload/shared'
;
interface
ProductQuoteLayoutProps
{
/** 回显 */
setProductQuote
?:
any
[],
}
const
ProductQuoteLayout
:
React
.
FC
<
ProductQuoteLayoutProps
>
=
()
=>
{
const
[
dataSource
,
setDataSource
]
=
useState
<
any
[]
>
([])
const
ProductQuoteLayout
:
React
.
FC
<
ProductQuoteLayoutProps
>
=
(
props
:
any
)
=>
{
const
{
setProductQuote
}
=
props
;
const
[
dataSource
,
setDataSource
]
=
useState
<
any
[]
>
([]);
const
count
=
(
num
:
any
,
price
:
any
)
=>
{
let
money
:
any
=
null
;
money
=
(
Number
(
price
)
*
1
)
/
Number
(
num
);
return
Number
(
money
).
toFixed
(
2
);
}
const
handleChange
=
(
id
,
e
)
=>
{
const
{
value
}
=
e
.
target
dataSource
.
forEach
(
v
=>
{
if
(
v
.
productId
===
id
)
{
v
.
price
=
value
v
.
money
=
count
(
v
.
purchaseCount
,
value
);
}
})
setDataSource
([...
dataSource
]);
}
const
columns
:
ColumnType
<
any
>
[]
=
[
{
title
:
"商品ID"
,
...
...
@@ -41,20 +58,21 @@ const ProductQuoteLayout: React.FC<ProductQuoteLayoutProps> = () => {
title
:
"采购数量/单位"
,
key
:
"purchaseCount"
,
dataIndex
:
"purchaseCount"
,
render
:
(
text
:
any
,
record
:
any
)
=>
<>
{
`${text}/${record.unit}`
}
</>
},
{
title
:
"含税/税率"
,
key
:
""
,
dataIndex
:
""
},
{
title
:
"报价单价"
,
key
:
"price"
,
dataIndex
:
"price"
,
render
:
(
text
,
_data
,
index
)
=>
(
<
Form
.
Item
initialValue=
{
text
}
name=
{
`purchaseCount${index}`
}
rules=
{
[{
required
:
true
,
message
:
'请输入采购数量'
}]
}
style=
{
{
marginBottom
:
'0px'
}
}
>
<
InputNumber
min=
{
1
}
/>
width
:
150
,
render
:
(
text
,
record
,
index
)
=>
(
<
Form
.
Item
initialValue=
{
record
.
price
}
name=
{
`purchaseCount${index}`
}
rules=
{
[{
required
:
true
,
message
:
'请输入采购数量'
}]
}
style=
{
{
marginBottom
:
'0px'
}
}
>
<
Input
onBlur=
{
(
e
)
=>
handleChange
(
record
.
productId
,
e
)
}
addonBefore=
"¥"
min=
{
1
}
type=
"number"
/>
</
Form
.
Item
>
)
...
...
@@ -64,16 +82,23 @@ const ProductQuoteLayout: React.FC<ProductQuoteLayoutProps> = () => {
key
:
"money"
,
dataIndex
:
"money"
},
{
title
:
"操作"
,
key
:
"operate"
,
dataIndex
:
"operate"
,
render
:
(
_text
,
_data
,
index
)
=>
(
<
Button
type=
"link"
>
历史报价
</
Button
>
)
},
//
{
//
title: "操作",
//
key: "operate",
//
dataIndex: "operate",
//
render: (_text, _data, index) => (
//
<Button type="link">历史报价</Button>
//
)
//
},
]
useEffect
(()
=>
{
if
(
!
isEmpty
(
setProductQuote
))
{
console
.
log
(
setProductQuote
)
setDataSource
([...
setProductQuote
])
}
},
[
setProductQuote
])
return
(
<
Card
id=
"productQuoteLayout"
...
...
src/pages/transaction/dealAbility/inquiryOffer/waitAddOffer/components/tradingConditions.tsx
View file @
d4f7dbd0
...
...
@@ -75,7 +75,7 @@ const TradingConditions: React.FC<queryProps> = (props) => {
<
Row
gutter=
{
70
}
>
<
Col
span=
{
12
}
>
<
Form
.
Item
label=
'最小起订'
name=
'minimumOrder'
rules=
{
[{
required
:
true
,
message
:
'请输入最小起订'
}]
}
>
<
InputNumber
min=
{
1
}
placeholder=
'请输入数量'
/>
<
InputNumber
style=
{
{
width
:
'100%'
}
}
min=
{
1
}
placeholder=
'请输入数量'
/>
</
Form
.
Item
>
<
Form
.
Item
label=
'交付说明'
name=
'deliveryInstructions'
>
<
Input
.
TextArea
placeholder=
'最长100个字符,50个汉字'
/>
...
...
src/pages/transaction/purchaseAbility/components/detail/components/contrastLyout1/index.tsx
View file @
d4f7dbd0
...
...
@@ -67,7 +67,6 @@ const ContrastLyout1: React.FC<IProps> = (props: any) => {
const
[
encrypt
,
setEncrypt
]
=
useState
<
number
>
(
0
);
/** 当前数据的第0条 */
const
[
idx
,
setIdx
]
=
useState
<
number
>
(
0
);
/** 报价轮次 */
const
handleTurn
=
(
num
:
number
)
=>
{
let
isTurn
:
Array
<
number
>
=
[];
...
...
@@ -84,7 +83,6 @@ const ContrastLyout1: React.FC<IProps> = (props: any) => {
/** 格式化数据 */
const
formatting
=
(
data
:
any
,
index
:
number
)
=>
{
console
.
log
(
index
,
10086
)
const
arr
:
any
=
data
[
0
].
awardInfoResponses
.
sort
((
a
,
b
)
=>
{
return
a
.
goodsId
-
b
.
goodsId
})
||
[]
const
params
:
any
=
[];
arr
.
forEach
((
i
:
any
,
index
:
number
)
=>
{
...
...
@@ -131,7 +129,7 @@ const ContrastLyout1: React.FC<IProps> = (props: any) => {
const
dataSoure
=
{
...
soure
}
dataSoure
[
index
]
=
[...
params
]
setSoure
(
dataSoure
);
if
(
preview
)
{
if
(
preview
||
isEdit
)
{
redux
(
params
)
}
}
...
...
@@ -173,7 +171,6 @@ const ContrastLyout1: React.FC<IProps> = (props: any) => {
* i: 当前tab 下标
*/
const
fetchTableData
=
async
(
t
:
string
,
i
?:
number
)
=>
{
console
.
log
(
i
)
const
params
=
{
id
,
turn
:
t
,
...
...
@@ -284,7 +281,7 @@ const ContrastLyout1: React.FC<IProps> = (props: any) => {
data
-
index=
{
index
}
tab=
{
`第${chNum[item]}轮`
}
>
{
(
rowSource
[
idx
]
&&
rowSource
[
idx
].
length
>
0
)
?
<
RowLayout
encrypt=
{
encrypt
}
rowSource=
{
rowSource
[
idx
]
}
/>
:
{
(
rowSource
[
idx
]
&&
rowSource
[
idx
].
length
>
0
)
?
<
RowLayout
priceContrast=
{
context
.
priceContrast
}
encrypt=
{
encrypt
}
rowSource=
{
rowSource
[
idx
]
}
/>
:
<
Empty
image=
{
Empty
.
PRESENTED_IMAGE_SIMPLE
}
/>
}
<
Skeleton
...
...
src/pages/transaction/purchaseAbility/components/detail/components/contrastLyout1/rowLayout/index.tsx
View file @
d4f7dbd0
...
...
@@ -9,13 +9,18 @@ export interface IProps {
rowSource
?:
any
,
/** 是否加密 */
encrypt
?:
number
,
/** 比价方式 */
priceContrast
?:
number
,
}
const
RowLayout
:
React
.
FC
<
IProps
>
=
(
props
:
any
)
=>
{
const
{
rowSource
,
encrypt
}
=
props
;
const
{
rowSource
,
encrypt
,
priceContrast
}
=
props
;
const
format
=
(
text
,
fmt
?:
string
)
=>
{
return
<>
{
moment
(
text
).
format
(
fmt
||
"YYYY-MM-DD HH:mm:ss"
)
}
</>
}
console
.
log
(
priceContrast
,
123
)
return
(
<
Fragment
>
<
div
className=
{
style
.
divider
}
><
Divider
type=
'vertical'
className=
{
style
.
vertical
}
/>
供应商信息
</
div
>
...
...
@@ -64,7 +69,7 @@ const RowLayout: React.FC<IProps> = (props: any) => {
</
Row
>
</
div
>
<
div
className=
{
style
[
'card-badge'
]
}
>
{
item
.
isDecrypt
===
PRICECONTRAST_TYPE
.
UNENCRYPTED
?
(
encrypt
===
1
?
'未加密'
:
'已解
密'
)
:
'未解密'
}
{
item
.
isDecrypt
===
PRICECONTRAST_TYPE
.
UNENCRYPTED
?
(
priceContrast
===
1
?
'已解密'
:
'未加
密'
)
:
'未解密'
}
</
div
>
{
item
.
isDecrypt
===
PRICECONTRAST_TYPE
.
UNENCRYPTED
&&
<
Typography
.
Link
href=
{
`/memberCenter/procurementAbility/confirmOffer/quote/detail?id=${item.id}&number=${item.quotedPriceNo}&turn=${item.turn}`
}
className=
{
style
[
'card-link'
]
}
>
查看报价详情
</
Typography
.
Link
>
}
{
item
.
isDecrypt
===
PRICECONTRAST_TYPE
.
UNDECRYPTED
&&
<
Tooltip
placement=
"topLeft"
title=
'当前报价为密封报价,请先解密报价单'
><
Typography
.
Text
className=
{
style
[
'card-link'
]
}
type=
'success'
>
查看报价详情
</
Typography
.
Text
></
Tooltip
>
}
...
...
src/pages/transaction/purchaseAbility/components/modalOperate/index.tsx
View file @
d4f7dbd0
...
...
@@ -2,7 +2,7 @@ import React, { useEffect } from 'react';
import
{
Modal
}
from
'antd'
;
import
{
SchemaForm
,
SchemaMarkupField
as
Field
,
create
FormActions
,
create
AsyncFormActions
,
FormEffectHooks
,
}
from
'@formily/antd'
import
{
Input
,
Radio
,
DatePicker
,
Checkbox
}
from
'@formily/antd-components'
...
...
@@ -11,7 +11,7 @@ import moment from 'moment';
import
styles
from
'./index.less'
;
import
{
isEmpty
}
from
'lodash'
;
const
actions
=
create
FormActions
()
const
actions
=
create
AsyncFormActions
()
const
{
onFieldChange$
}
=
FormEffectHooks
;
export
interface
IProps
{
...
...
@@ -40,7 +40,7 @@ const ModalOperate: React.FC<IProps> = (props: any) => {
}
=
props
;
const
useFormEffects
=
()
=>
{
const
{
setFieldState
}
=
create
FormActions
()
const
{
setFieldState
}
=
create
AsyncFormActions
()
if
(
modalType
===
'audit'
)
{
onFieldChange$
(
'state'
).
subscribe
(({
value
})
=>
{
setFieldState
(
'auditOpinion'
,
state
=>
{
...
...
src/pages/transaction/purchaseAbility/confirmOffer/demand/index.tsx
View file @
d4f7dbd0
...
...
@@ -140,7 +140,7 @@ const DemandDetailed = () => {
}
const
fetchDataSource
=
async
()
=>
{
let
shopList
=
GlobalConfig
.
web
.
shopInfo
.
filter
(
v
=>
v
.
type
==
1
).
map
(
let
shopList
=
GlobalConfig
.
web
.
shopInfo
.
filter
(
v
=>
v
.
type
==
6
).
map
(
v
=>
v
)
const
params
=
{
...
...
src/pages/transaction/purchaseAbility/offter/addOffter/add.tsx
View file @
d4f7dbd0
...
...
@@ -130,7 +130,8 @@ const AddForm = () => {
params
.
memberRoleId
=
memberRoleId
;
await
PublicApi
.
postPurchaseQuotedPriceAdd
({...
params
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
history
.
goBack
()
// history.goBack()
history
.
push
(
`/memberCenter/procurementAbility/offter/addOffter`
)
}
else
{
setLoading
(
false
);
}
...
...
src/pages/transaction/purchaseAbility/offter/addOffter/components/offer.tsx
View file @
d4f7dbd0
...
...
@@ -130,7 +130,6 @@ const OfferInfo: React.FC<IProps> = (props: any) => {
rules=
{
[{
required
:
true
,
message
:
'请选择'
}]
}
>
<
Select
defaultValue=
{
1
}
style=
{
{
width
:
100
}
}
onChange=
{
(
e
)
=>
handleEdit
(
e
,
'isTax'
,
index
)
}
disabled=
{
fetchdata
&&
(
count
!==
tabs
[
0
])
}
...
...
@@ -222,7 +221,7 @@ const OfferInfo: React.FC<IProps> = (props: any) => {
const
setFieldsValueFn
=
(
params
:
any
)
=>
{
params
.
forEach
((
it
:
any
,
i
:
number
)
=>
{
form
.
setFieldsValue
({
[
'isTax'
+
i
]:
it
.
isTax
,
[
'isTax'
+
i
]:
it
.
isTax
?
it
.
isTax
:
1
,
[
'taxProbability'
+
i
]:
it
.
taxProbability
,
[
'taxUnitPrice'
+
i
]:
it
.
taxUnitPrice
})
...
...
@@ -243,14 +242,13 @@ const OfferInfo: React.FC<IProps> = (props: any) => {
return
}
if
(
res
.
data
.
data
.
length
>
0
)
{
console
.
log
(
1
)
param
[
index
]
=
[...
res
.
data
.
data
];
if
(
param
[
index
])
{
setFieldsValueFn
(
param
[
index
])
}
}
else
{
console
.
log
(
2
)
param
[
index
]
=
fetchdata
.
materiels
;
setFieldsValueFn
(
param
[
index
])
}
setData
({
...
param
});
})
...
...
src/pages/transaction/purchaseAbility/offter/addOffter/modal/crossSellProducts.tsx
View file @
d4f7dbd0
...
...
@@ -282,7 +282,7 @@ const CrossSellProducts: React.FC<IProps> = (props: any) => {
</>
)
}
{
!
preview
&&
(
<
Button
onClick=
{
()
=>
{
setFlag
(
true
);
setProductId
(
product
.
productI
d
);
console
.
log
(
product
)
}
}
block
type=
"dashed"
style=
{
{
margin
:
'16px 0px'
}
}
>
<
Button
onClick=
{
()
=>
{
setFlag
(
true
);
setProductId
(
product
.
i
d
);
console
.
log
(
product
)
}
}
block
type=
"dashed"
style=
{
{
margin
:
'16px 0px'
}
}
>
<
PlusSquareOutlined
/>
选择商品
</
Button
>
...
...
src/pages/transaction/purchaseAbility/offter/addOffter/modal/selectProduct.tsx
View file @
d4f7dbd0
...
...
@@ -15,7 +15,7 @@ import { searchSelectGetSelectCategoryOptionEffect } from '@/pages/transaction/e
import
{
OfferProductSchema
,
}
from
'../../../schema'
;
import
{
ISchema
}
from
'@formily/antd'
;
import
{
ISchema
}
from
'@formily/antd'
;
const
formActions
=
createFormActions
();
...
...
@@ -57,7 +57,7 @@ const SelectProduct: React.FC<Iprops> = (props: any) => {
const
data
=
{
environment
:
1
,
shopType
:
1
,
// priceTypeList: [
2]
priceTypeList
:
[
1
,
2
]
}
PublicApi
.
getProductCommodityCommonGetCommodityListBySeller
({
...
params
,
...
data
}).
then
(
res
=>
{
resolve
(
res
.
data
)
...
...
@@ -159,11 +159,12 @@ const SelectProduct: React.FC<Iprops> = (props: any) => {
}
useEffect
(()
=>
{
console
.
log
(
id
)
if
(
!!
id
)
{
if
(
id
)
{
RowCtl
.
setSelectedRowKeys
([
id
]);
}
else
{
RowCtl
.
setSelectedRowKeys
([]);
}
},
[
id
])
},
[
visible
])
return
(
<
Drawer
...
...
src/pages/transaction/purchaseAbility/purchaseBid/detail/index.tsx
View file @
d4f7dbd0
...
...
@@ -230,7 +230,7 @@ const SearchDetail = () => {
}
const
fetchDataSource
=
async
()
=>
{
let
shopList
=
GlobalConfig
.
web
.
shopInfo
.
filter
(
v
=>
v
.
type
==
1
).
map
(
let
shopList
=
GlobalConfig
.
web
.
shopInfo
.
filter
(
v
=>
v
.
type
==
6
).
map
(
v
=>
v
)
const
params
=
{
...
...
@@ -291,7 +291,7 @@ const SearchDetail = () => {
}
else
{
return
null
}
case
'readyExamineOne'
:
case
'readyExamineTwo'
:
case
'readyExamineSignUp'
:
...
...
src/pages/transaction/purchaseAbility/purchaseInquiry/addInquiry/components/demand.tsx
View file @
d4f7dbd0
...
...
@@ -186,7 +186,7 @@ const Demand: React.FC<Iprops> = (props: any) => {
}
useEffect
(()
=>
{
let
shopList
=
GlobalConfig
.
web
.
shopInfo
.
filter
(
v
=>
v
.
type
==
1
).
map
(
let
shopList
=
GlobalConfig
.
web
.
shopInfo
.
filter
(
v
=>
v
.
type
==
6
).
map
(
v
=>
v
)
setStoreList
(
shopList
)
...
...
@@ -231,7 +231,7 @@ const Demand: React.FC<Iprops> = (props: any) => {
type
:
fetchdata
.
type
})
if
(
fetchdata
.
type
===
1
)
{
let
shopList
=
GlobalConfig
.
web
.
shopInfo
.
filter
(
v
=>
v
.
type
==
1
).
map
(
let
shopList
=
GlobalConfig
.
web
.
shopInfo
.
filter
(
v
=>
v
.
type
==
6
).
map
(
v
=>
v
)
setStoreList
(
shopList
)
...
...
src/pages/transaction/purchaseAbility/purchaseInquiry/addInquiry/components/material.tsx
View file @
d4f7dbd0
...
...
@@ -38,49 +38,23 @@ const Material: React.FC<Iprops> = (props: any) => {
const
[
form
]
=
Form
.
useForm
();
const
{
currentRef
,
fetchdata
,
onBadge
}
=
props
;
/** 表单表头 */
const
[
flag
,
setFlag
]
=
useState
<
boolean
>
(
false
)
const
[
flag
,
setFlag
]
=
useState
<
boolean
>
(
false
);
const
[
edit
,
setEdit
]
=
useState
<
any
>
({});
const
[
dataSource
,
setDataSource
]
=
useState
<
any
>
([])
const
[
category
,
setcategory
]
=
useState
([]);
/**查询品类树 */
const
searchCategoryTree
=
(
id
:
any
)
=>
{
return
new
Promise
(
resolve
=>
{
PublicApi
.
getProductPlatformGetCategoryTree
({
rootNodeId
:
id
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
resolve
(
res
.
data
)
}
})
}).
then
((
data
:
any
)
=>
{
console
.
log
(
data
)
setcategory
(
data
)
})
}
/** 修改列表表单 */
const
handleEdit
=
(
e
:
any
,
name
:
string
,
index
:
number
,
flag
?:
boolean
)
=>
{
const
params
=
[...
dataSource
];
Object
.
keys
(
params
[
index
]).
map
(
key
=>
{
if
(
key
===
name
)
{
if
(
flag
)
{
params
[
index
][
key
]
=
e
}
else
{
params
[
index
][
key
]
=
e
.
target
.
value
}
}
})
setDataSource
(
params
)
}
/** 修改品类 */
const
handleEditCategory
=
(
e
:
any
,
value
:
any
,
index
:
number
)
=>
{
const
params
=
[...
dataSource
];
params
[
index
].
ids
=
e
;
params
[
index
].
category
=
value
[
value
.
length
-
1
].
title
;
setDataSource
(
params
);
}
/** 删除列表 */
const
handleRemove
=
(
index
:
number
)
=>
{
const
data
=
[...
dataSource
];
data
.
splice
(
index
,
1
);
setDataSource
(
data
)
}
/** 编辑列表 */
const
handleEdit
=
(
data
)
=>
{
setEdit
(
data
);
setFlag
(
true
)
}
const
columns
:
ColumnType
<
Object
>
[]
=
[
{
title
:
'物料编号'
,
...
...
@@ -91,118 +65,41 @@ const Material: React.FC<Iprops> = (props: any) => {
title
:
'物料名称'
,
key
:
'name'
,
dataIndex
:
'name'
,
render
:
(
text
:
any
,
record
:
any
,
index
:
number
)
=>
(
<
Form
.
Item
style=
{
{
margin
:
0
}
}
name=
{
`name_${index + 1}`
}
initialValue=
{
text
}
rules=
{
[{
required
:
true
,
message
:
'请输入'
}]
}
>
<
Input
onChange=
{
(
e
)
=>
handleEdit
(
e
,
'name'
,
index
)
}
/>
</
Form
.
Item
>
)
},
{
title
:
'规格型号'
,
key
:
'model'
,
dataIndex
:
'model'
,
render
:
(
text
:
any
,
record
:
any
,
index
:
number
)
=>
(
<
Form
.
Item
style=
{
{
margin
:
0
}
}
name=
{
`model_${index + 1}`
}
initialValue=
{
text
}
rules=
{
[{
required
:
true
,
message
:
'请输入'
}]
}
>
<
Input
onChange=
{
(
e
)
=>
handleEdit
(
e
,
'model'
,
index
)
}
/>
</
Form
.
Item
>
)
},
{
title
:
'品类'
,
key
:
'category'
,
dataIndex
:
'category'
,
render
:
(
text
:
any
,
record
:
any
,
index
:
number
)
=>
(
<>
{
Array
.
isArray
(
record
.
ids
)
?
(
<
Form
.
Item
style=
{
{
margin
:
0
}
}
name=
{
`category_${index + 1}`
}
initialValue=
{
record
.
ids
}
rules=
{
[{
required
:
true
,
message
:
'请输入'
}]
}
>
<
Cascader
options=
{
category
}
onChange=
{
(
e
,
value
)
=>
handleEditCategory
(
e
,
value
,
index
)
}
fieldNames=
{
{
label
:
'title'
,
value
:
'id'
,
children
:
'children'
}
}
placeholder=
"请选择品类"
allowClear=
{
false
}
notFoundContent=
{
<
Spin
size=
"small"
/>
}
/>
</
Form
.
Item
>
)
:
(
<
Form
.
Item
style=
{
{
margin
:
0
}
}
name=
{
`category_${index + 1}`
}
initialValue=
{
text
}
rules=
{
[{
required
:
true
,
message
:
'请输入'
}]
}
>
<
Input
onChange=
{
(
e
)
=>
handleEdit
(
e
,
'category'
,
index
)
}
/>
</
Form
.
Item
>
)
}
</>
),
},
{
title
:
'品牌'
,
key
:
'brand'
,
dataIndex
:
'brand'
,
render
:
(
text
:
any
,
record
:
any
,
index
:
number
)
=>
(
<
Form
.
Item
style=
{
{
margin
:
0
}
}
name=
{
`brand_${index + 1}`
}
initialValue=
{
text
}
>
<
Input
onChange=
{
(
e
)
=>
handleEdit
(
e
,
'brand'
,
index
)
}
/>
</
Form
.
Item
>
)
},
{
title
:
'单位'
,
key
:
'unit'
,
dataIndex
:
'unit'
,
render
:
(
text
:
any
,
record
:
any
,
index
:
number
)
=>
(
<
Form
.
Item
style=
{
{
margin
:
0
}
}
name=
{
`unit_${index + 1}`
}
initialValue=
{
text
}
rules=
{
[{
required
:
true
,
message
:
'请输入'
}]
}
>
<
Input
onChange=
{
(
e
)
=>
handleEdit
(
e
,
'unit'
,
index
)
}
/>
</
Form
.
Item
>
)
},
{
title
:
'采购数量'
,
key
:
'purchaseCount'
,
dataIndex
:
'purchaseCount'
,
render
:
(
text
:
any
,
record
:
any
,
index
:
number
)
=>
(
<
Form
.
Item
style=
{
{
margin
:
0
}
}
name=
{
`purchaseCount_${index + 1}`
}
initialValue=
{
text
}
rules=
{
[{
required
:
true
,
message
:
'请输入'
}]
}
>
<
InputNumber
onChange=
{
(
e
)
=>
handleEdit
(
e
,
'purchaseCount'
,
index
,
true
)
}
/>
</
Form
.
Item
>
)
},
{
title
:
'操作'
,
key
:
'operate'
,
dataIndex
:
'operate'
,
render
:
(
text
:
any
,
record
:
any
,
index
:
number
)
=>
(
<
Button
onClick=
{
()
=>
handleRemove
(
index
)
}
type=
'link'
>
删除
</
Button
>
render
:
(
_text
:
any
,
record
:
any
,
index
:
number
)
=>
(
<>
<
Button
type=
'link'
onClick=
{
()
=>
handleEdit
(
record
)
}
>
编辑
</
Button
>
<
Button
onClick=
{
()
=>
handleRemove
(
index
)
}
type=
'link'
>
删除
</
Button
>
</>
)
}
]
...
...
@@ -231,9 +128,7 @@ const Material: React.FC<Iprops> = (props: any) => {
setDataSource
([...
dataSource
,
...
data
]);
}
}
useEffect
(()
=>
{
searchCategoryTree
(
'0'
);
},
[])
useEffect
(()
=>
{
currentRef
.
current
=
{
get
:
()
=>
new
Promise
((
resolve
:
any
)
=>
{
...
...
@@ -280,7 +175,7 @@ const Material: React.FC<Iprops> = (props: any) => {
>
<
Radio
.
Group
onChange=
{
checkRadio
}
>
<
Radio
value=
{
1
}
>
选择货品添加
</
Radio
>
<
Radio
value=
{
2
}
>
导入货品生成
</
Radio
>
{
/* <Radio value={2}>导入货品生成</Radio> */
}
</
Radio
.
Group
>
</
Form
.
Item
>
{
materielMode
>=
1
...
...
@@ -307,6 +202,7 @@ const Material: React.FC<Iprops> = (props: any) => {
{
materielMode
===
1
&&
(
<
DrawerWrite
edit=
{
edit
}
flag=
{
flag
}
onClose=
{
()
=>
setFlag
(
false
)
}
onConfirm=
{
fetchTableList
}
...
...
src/pages/transaction/purchaseAbility/purchaseInquiry/addInquiry/modal/drawerWrite.tsx
View file @
d4f7dbd0
...
...
@@ -19,6 +19,7 @@ import { UPLOAD_TYPE } from '@/constants'
import
{
DeleteOutlined
,
LinkOutlined
,
UploadOutlined
}
from
'@ant-design/icons'
;
import
SelectProduct
from
'./selectProduct'
;
import
{
PublicApi
}
from
'@/services/api'
;
import
{
isEmpty
}
from
'lodash'
;
const
layout
:
any
=
{
colon
:
false
,
...
...
@@ -31,6 +32,8 @@ interface Iprops {
flag
:
boolean
,
onClose
:
()
=>
void
,
onConfirm
?(
e
:
any
),
/** 编辑的数据 */
edit
?:
any
,
}
const
DrawerWrite
:
React
.
FC
<
Iprops
>
=
(
props
:
any
)
=>
{
...
...
@@ -38,6 +41,7 @@ const DrawerWrite: React.FC<Iprops> = (props: any) => {
flag
,
onClose
,
onConfirm
,
edit
}
=
props
;
const
[
form
]
=
Form
.
useForm
();
const
[
visible
,
setVisile
]
=
useState
<
boolean
>
(
false
)
...
...
@@ -153,11 +157,23 @@ const DrawerWrite: React.FC<Iprops> = (props: any) => {
setFiles
(
arr
);
}
useEffect
(()
=>
{
form
.
resetFields
();
searchCategoryTree
(
'0'
);
},
[
flag
])
if
(
!
isEmpty
(
edit
))
{
form
.
setFieldsValue
({
number
:
edit
.
number
,
name
:
edit
.
name
,
model
:
edit
.
model
,
brand
:
edit
.
brand
,
unit
:
edit
.
unit
,
ids
:
edit
.
ids
,
purchaseCount
:
edit
.
purchaseCount
,
})
setFiles
(
edit
.
urls
)
}
},
[
flag
]);
return
(
<>
<
Drawer
...
...
@@ -238,6 +254,7 @@ const DrawerWrite: React.FC<Iprops> = (props: any) => {
rules=
{
[{
required
:
true
,
message
:
'请输入货号'
}]
}
>
<
Input
.
Search
readOnly
enterButton=
{
<><
LinkOutlined
/>
选择
</>
}
onSearch=
{
()
=>
setVisile
(
true
)
}
/>
...
...
@@ -247,14 +264,14 @@ const DrawerWrite: React.FC<Iprops> = (props: any) => {
name=
'name'
rules=
{
[{
required
:
true
,
message
:
'请输入货品名称'
}]
}
>
<
Input
/>
<
Input
disabled
/>
</
Form
.
Item
>
<
Form
.
Item
label=
'规格型号'
name=
'model'
rules=
{
[{
required
:
true
,
message
:
'请输入规格型号'
}]
}
>
<
Input
/>
<
Input
disabled
/>
</
Form
.
Item
>
<
Form
.
Item
label=
'品类'
...
...
@@ -262,6 +279,7 @@ const DrawerWrite: React.FC<Iprops> = (props: any) => {
rules=
{
[{
required
:
true
,
message
:
'请选择品类'
}]
}
>
<
Cascader
disabled
options=
{
category
}
fieldNames=
{
{
label
:
'title'
,
value
:
'id'
,
children
:
'children'
}
}
placeholder=
"请选择品类"
...
...
@@ -305,7 +323,7 @@ const DrawerWrite: React.FC<Iprops> = (props: any) => {
name=
'unit'
rules=
{
[{
required
:
true
,
message
:
'请选择单位'
}]
}
>
<
Input
/>
<
Input
disabled
/>
</
Form
.
Item
>
<
Form
.
Item
label=
'采购数量'
...
...
src/pages/transaction/purchaseAbility/purchaseInquiry/detail/index.tsx
View file @
d4f7dbd0
...
...
@@ -143,7 +143,7 @@ const DemandDetailed = () => {
}
const
fetchDataSource
=
async
()
=>
{
let
shopList
=
GlobalConfig
.
web
.
shopInfo
.
filter
(
v
=>
v
.
type
==
1
).
map
(
let
shopList
=
GlobalConfig
.
web
.
shopInfo
.
filter
(
v
=>
v
.
type
==
6
).
map
(
v
=>
v
)
const
params
=
{
...
...
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