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
shenshaokai
jinfa-platform
Commits
51ea4387
Commit
51ea4387
authored
Aug 11, 2021
by
前端-许佳敏
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'v2' of
http://10.0.0.22:3000/lingxi/lingxi-business-paltform
into v2
parents
a061f0c4
d946d57e
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
711 additions
and
254 deletions
+711
-254
index.tsx
src/pages/contract/components/examine/index.tsx
+55
-2
FormList.tsx
src/pages/contract/manage/add/components/FormList.tsx
+1
-1
TableList.tsx
src/pages/contract/manage/details/components/TableList.tsx
+147
-0
index.tsx
src/pages/contract/manage/details/index.tsx
+7
-51
context.ts
...transaction/components/detailLayout/components/context.ts
+3
-0
addForm.tsx
...ion/dealAbility/productInquiry/waitAddInquiry/addForm.tsx
+15
-3
basicInfo.tsx
...ty/productInquiry/waitAddInquiry/components/basicInfo.tsx
+18
-1
inquiryProduct.tsx
...oductInquiry/waitAddInquiry/components/inquiryProduct.tsx
+2
-1
tradeTerms.tsx
...y/productInquiry/waitAddInquiry/components/tradeTerms.tsx
+137
-3
index.tsx
.../marketingAbility/components/activityUserLayout/index.tsx
+4
-3
columns.tsx
...nsaction/marketingAbility/paltformSign/detail/columns.tsx
+25
-36
index.tsx
...ction/marketingAbility/paltformSign/readySubmit/index.tsx
+92
-58
columns.tsx
...ty/paltformSign/readySubmitExamine/components/columns.tsx
+41
-22
EditableCell.tsx
...bmitExamine/components/productListLayout/EditableCell.tsx
+149
-0
index.tsx
...readySubmitExamine/components/productListLayout/index.tsx
+13
-71
index.tsx
...urchaseAbility/purchaseInquiry/addInquiry/modal/index.tsx
+2
-2
No files found.
src/pages/contract/components/examine/index.tsx
View file @
51ea4387
import
React
,
{
useState
}
from
'react'
;
import
{
Button
,
Input
,
Form
,
Radio
,
message
,
Modal
}
from
'antd'
import
React
,
{
ReactNode
,
useState
}
from
'react'
;
import
{
Button
,
Input
,
Form
,
Radio
,
message
,
Modal
,
Upload
,
Row
,
Col
,
}
from
'antd'
const
{
TextArea
}
=
Input
import
{
PublicApi
}
from
'@/services/api'
;
import
{
IAntdSchemaFormProps
}
from
'@formily/antd'
import
{
UploadOutlined
}
from
'@ant-design/icons'
;
export
interface
Iprops
extends
IAntdSchemaFormProps
{
/* 显示隐藏 */
...
...
@@ -17,6 +18,7 @@ export interface Iprops extends IAntdSchemaFormProps {
agreeText
?:
string
,
/* 不同意 */
disagree
?:
string
,
}
/* 合同审核组建 */
const
Examine
:
React
.
FC
<
Iprops
>
=
({
...
...
@@ -26,8 +28,10 @@ const Examine: React.FC<Iprops> = ({
type
,
agreeText
,
disagree
,
})
=>
{
const
[
isPass
,
setIsAllMember
]
=
useState
(
1
)
const
[
state
,
setstate
]
=
useState
<
any
>
(
false
);
/* 设置选中值 */
const
handleIsAllMemberChange
=
(
v
:
any
)
=>
{
setIsAllMember
(
v
.
target
.
value
)
...
...
@@ -121,6 +125,53 @@ const Examine: React.FC<Iprops> = ({
console
.
log
(
'确认'
)
}
}
const
uploadProps
=
{
name
:
'file'
,
action
:
'/api/file/file/upload/prefix'
,
data
:
{
fileType
:
1
,
prefix
:
''
,
},
onChange
(
info
)
{
if
(
info
.
file
.
response
)
{
const
{
code
}
=
info
.
file
.
response
;
console
.
log
(
code
);
message
.
info
(
'上传成功'
);
console
.
log
(
info
.
file
)
setstate
(
true
);
}
;
if
(
info
.
file
.
status
!==
'uploading'
)
{
}
if
(
info
.
file
.
status
===
'done'
)
{
}
else
if
(
info
.
file
.
status
===
'error'
)
{
message
.
error
(
`
${
info
.
file
.
name
}
上传失败`
);
}
},
beforeUpload
(
file
)
{
if
(
file
.
size
/
1024
/
1024
>
20
)
{
message
.
warning
(
'附件大小超过20M'
);
return
Promise
.
reject
();
}
},
}
const
uploadNode
=
()
=>
{
return
(
<
div
>
<
p
style=
{
{
paddingTop
:
10
,
paddingBottom
:
10
,
}
}
>
纸质合同(乙方已盖章签字)
</
p
>
<
Row
style=
{
{
marginBottom
:
30
,
}
}
>
<
Col
>
<
Upload
{
...
uploadProps
}
>
<
Button
icon=
{
<
UploadOutlined
/>
}
>
上传附件
</
Button
>
</
Upload
>
</
Col
>
</
Row
>
</
div
>
)
}
return
(
<
div
>
<
Modal
footer=
{
null
}
title=
"提交审核"
visible=
{
ExamineFlag
}
onCancel=
{
()
=>
fetchData
(
'onCancel'
)
}
>
...
...
@@ -131,6 +182,7 @@ const Examine: React.FC<Iprops> = ({
onFinish=
{
onFinish
}
onFinishFailed=
{
onFinishFailed
}
>
{
type
===
'Signacontract'
?
uploadNode
()
:
null
}
<
Form
.
Item
name=
"isPass"
label=
""
rules=
{
[{
required
:
true
,
message
:
'请选择通过方式'
}]
}
initialValue=
{
isPass
}
>
<
Radio
.
Group
onChange=
{
handleIsAllMemberChange
}
>
<
Radio
value=
{
1
}
>
{
agreeText
}
</
Radio
>
...
...
@@ -154,5 +206,6 @@ const Examine: React.FC<Iprops> = ({
Examine
.
defaultProps
=
{
agreeText
:
"通过"
,
disagree
:
"不通过"
,
uploadNode
:
null
}
export
default
Examine
;
src/pages/contract/manage/add/components/FormList.tsx
View file @
51ea4387
...
...
@@ -126,7 +126,7 @@ const FormList = (props: any) => {
id
:
_filterArr
(
sourceType
,
item
,
[
''
,
'goodsId'
,
'categoryId'
,
'ids'
]),
},
brand
:
{
name
:
_filter
(
sourceType
,
item
,
[
''
,
'brand'
,
'
category
Name'
,
'brand'
])
name
:
_filter
(
sourceType
,
item
,
[
''
,
'brand'
,
'
brand
Name'
,
'brand'
])
},
// 品牌
unitName
:
_filter
(
sourceType
,
item
,
[
''
,
'unit'
,
'unitName'
,
'unitPrice'
]),
//单位
purchaseCount
:
_filter
(
sourceType
,
item
,
[
''
,
'purchaseCount'
,
'count'
,
'purchaseCount'
]),
// 数量
...
...
src/pages/contract/manage/details/components/TableList.tsx
0 → 100644
View file @
51ea4387
import
{
Table
,
}
from
'antd'
;
import
React
,
{
useEffect
,
useState
,
useRef
}
from
'react'
;
import
{
PublicApi
}
from
'@/services/api'
;
export
interface
Iprops
extends
IAntdSchemaFormProps
{
contractId
:
any
,
listIndex
:
any
}
const
TableList
:
React
.
FC
<
Iprops
>
=
({
contractId
,
listIndex
})
=>
{
const
[
index
,
setIndex
]
=
useState
(
1
)
/* 外部 */
const
[
ListData
,
setListData
]
=
useState
<
any
>
([])
// 外部数据
const
[
page
,
setPage
]
=
useState
(
1
);
// 当前页
const
[
size
,
setSize
]
=
useState
(
10
);
// 页大小
const
[
total
,
setTotal
]
=
useState
(
0
);
// 外部总条数
/* 内部 */
const
[
List
,
setList
]
=
useState
<
any
>
([]);
// 内部数据
const
[
innerpage
,
setinnerPage
]
=
useState
(
1
);
// 当前页
const
[
innersize
,
setinnerSize
]
=
useState
(
10
);
// 页大小
const
[
innertotal
,
setinnerTotal
]
=
useState
(
0
);
// 内部总条数
const
[
listLoading
,
setListLoading
]
=
useState
(
false
);
/* 流转列表 */
const
CirculationList
:
any
=
[
{
title
:
'序号'
,
dataIndex
:
'name'
,
align
:
'center'
,
render
:
(
_
,
record
,
index
)
=>
index
+
1
,
},
{
title
:
'操作角色'
,
dataIndex
:
'roleName'
,
align
:
'center'
,
},
{
title
:
'状态'
,
dataIndex
:
'statusName'
,
align
:
'center'
,
},
{
title
:
'操作'
,
dataIndex
:
'operate'
,
align
:
'center'
,
},
{
title
:
'操作时间'
,
dataIndex
:
'operateTime'
,
align
:
'center'
,
},
{
title
:
'审核意见'
,
dataIndex
:
'opinion'
,
align
:
'center'
,
},
]
/* 内部 */
const
fetchDataListcolumns
:
any
=
[
{
title
:
'操作人'
,
dataIndex
:
'name'
,
align
:
'center'
,
render
:
(
_
,
record
,
index
)
=>
index
+
1
,
},
{
title
:
'部门'
,
dataIndex
:
'department'
,
align
:
'center'
,
},
{
title
:
'职位'
,
dataIndex
:
'jobTitle'
,
align
:
'center'
,
},
{
title
:
'状态'
,
dataIndex
:
'statusName'
,
align
:
'center'
,
},
{
title
:
'操作'
,
dataIndex
:
'operate'
,
align
:
'center'
,
},
{
title
:
'操作时间'
,
dataIndex
:
'operateTime'
,
align
:
'center'
,
},
{
title
:
'审核意见'
,
dataIndex
:
'opinion'
,
align
:
'center'
,
},
]
/*分页 */
const
handlePaginationChange
=
(
current
:
number
,
pageSize
:
number
)
=>
{
let
data
=
{
current
,
pageSize
}
if
(
index
===
1
)
{
PageOuterRecordList
(
data
)
}
else
{
InnerRecordList
(
data
);
}
};
/* 外部 */
const
PageOuterRecordList
=
(
data
)
=>
{
PublicApi
.
getContractManagePageOuterRecordList
({
contractId
,
...
data
}).
then
(
res
=>
{
console
.
log
(
res
);
if
(
res
.
code
===
1000
)
{
setListData
(
res
.
data
.
data
)
setTotal
(
res
.
data
.
totalCount
)
}
}).
catch
(
err
=>
{
console
.
log
(
err
)
})
}
/* 内部 */
const
InnerRecordList
=
(
innerData
)
=>
{
PublicApi
.
getContractManagePageInnerRecordList
({
contractId
,
...
innerData
}).
then
(
res
=>
{
console
.
log
(
res
);
if
(
res
.
code
===
1000
)
{
setList
(
res
.
data
.
data
)
setTotal
(
res
.
data
.
totalCount
)
}
}).
catch
(
err
=>
{
console
.
log
(
err
)
})
}
useEffect
(()
=>
{
setIndex
(
listIndex
)
},
[
listIndex
])
useEffect
(()
=>
{
if
(
contractId
)
{
const
data
=
{
pageSize
:
size
,
current
:
page
,
}
PageOuterRecordList
(
data
)
const
innerData
=
{
pageSize
:
innersize
,
current
:
innerpage
,
}
InnerRecordList
(
innerData
);
}
},
[
contractId
])
return
(
<>
{
index
==
1
?
<
Table
columns=
{
CirculationList
}
rowKey=
'id'
loading=
{
listLoading
}
dataSource=
{
ListData
}
pagination=
{
{
pageSize
:
size
,
total
,
onChange
:
handlePaginationChange
}
}
style=
{
{
width
:
"100%"
}
}
/>
:
<
Table
columns=
{
fetchDataListcolumns
}
rowKey=
'id'
loading=
{
listLoading
}
dataSource=
{
List
}
pagination=
{
{
pageSize
:
size
,
total
:
innertotal
,
onChange
:
handlePaginationChange
}
}
style=
{
{
width
:
"100%"
}
}
/>
}
</>
)
}
export
default
TableList
src/pages/contract/manage/details/index.tsx
View file @
51ea4387
import
React
,
{
useEffect
,
useState
,
useRef
}
from
'react'
;
import
{
StandardTable
}
from
'god'
;
import
{
Anchor
,
Radio
,
Steps
,
Table
,
Space
,
Typography
,
Button
}
from
'antd'
;
import
{
Anchor
,
Radio
,
Steps
,
Table
,
Space
,
Typography
,
Button
,
message
}
from
'antd'
;
import
style
from
'./index.less'
;
import
{
ArrowLeftOutlined
}
from
'@ant-design/icons'
;
import
{
history
}
from
'umi'
;
...
...
@@ -8,6 +8,7 @@ import { PublicApi } from '@/services/api';
import
ExamineFrom
from
'../../components/examine'
import
Basic
from
'../../components/detailCard/basic'
import
PaymentCard
from
'../../components/detailCard/PaymentCard'
import
TableList
from
'./components/TableList'
import
{
FileWordFilled
}
from
'@ant-design/icons'
...
...
@@ -43,6 +44,7 @@ const Details = (props: any) => {
* @param contractText 合同文档
*/
const
[
StepList
,
setStepList
]
=
useState
<
any
>
([]);
const
[
outerTaskStepList
,
setouterTaskStepList
]
=
useState
<
any
>
([])
const
[
innerTaskStepList
,
setinnerTaskStepList
]
=
useState
<
any
>
([]);
const
[
currentBatch
,
setCurrentBatch
]
=
useState
(
'1'
);
...
...
@@ -139,31 +141,10 @@ const Details = (props: any) => {
setStepList
(
StepList
)
return
;
}
else
{
setTimeout
(()
=>
{
setlistIndex
(
e
.
target
.
value
)
},
100
);
setTimeout
(()
=>
{
ref
.
current
.
reload
();
},
300
);
setlistIndex
(
e
.
target
.
value
)
}
};
/* 流转记录内部 */
const
fetchData
=
(
params
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
let
fn
;
fn
=
listIndex
==
'1'
?
PublicApi
.
getContractManagePageOuterRecordList
:
PublicApi
.
getContractManagePageInnerRecordList
;
fn
({
...
params
,
contractId
:
contractId
}).
then
(
res
=>
{
console
.
log
(
res
.
data
,
listIndex
)
resolve
(
res
.
data
)
}).
catch
(
err
=>
{
console
.
log
(
err
)
})
})
}
/*查询合同详情-分页查询合同采购物料*/
const
columns
:
any
=
[
{
...
...
@@ -304,25 +285,7 @@ const Details = (props: any) => {
</
div
>
)
/* 流转列表 */
const
CirculationList
:
any
=
[
{
title
:
'序号'
,
dataIndex
:
'name'
,
align
:
'center'
,
render
:
(
_
,
record
,
index
)
=>
index
+
1
,
},
{
title
:
'操作角色'
,
dataIndex
:
'roleName'
,
align
:
'center'
,
},
{
title
:
'状态'
,
dataIndex
:
'statusName'
,
align
:
'center'
,
},
{
title
:
'操作'
,
dataIndex
:
'operate'
,
align
:
'center'
,
},
{
title
:
'操作时间'
,
dataIndex
:
'operateTime'
,
align
:
'center'
,
},
{
title
:
'审核意见'
,
dataIndex
:
'opinion'
,
align
:
'center'
,
},
]
/* 内部 */
const
fetchDataListcolumns
:
any
=
[
{
title
:
'操作人'
,
dataIndex
:
'name'
,
align
:
'center'
,
render
:
(
_
,
record
,
index
)
=>
index
+
1
,
},
{
title
:
'部门'
,
dataIndex
:
'department'
,
align
:
'center'
,
},
{
title
:
'职位'
,
dataIndex
:
'jobTitle'
,
align
:
'center'
,
},
{
title
:
'状态'
,
dataIndex
:
'statusName'
,
align
:
'center'
,
},
{
title
:
'操作'
,
dataIndex
:
'operate'
,
align
:
'center'
,
},
{
title
:
'操作时间'
,
dataIndex
:
'operateTime'
,
align
:
'center'
,
},
{
title
:
'审核意见'
,
dataIndex
:
'opinion'
,
align
:
'center'
,
},
]
/* 提交审核的回调 */
const
getfetchData
=
(
data
)
=>
{
console
.
log
(
data
)
...
...
@@ -345,8 +308,8 @@ const Details = (props: any) => {
}
else
{
setIsModalVisible
(
!
Visible
)
}
}
return
(
<
div
className=
{
style
.
anchorWrap
}
>
<
Anchor
...
...
@@ -497,14 +460,7 @@ const Details = (props: any) => {
</
div
>
</
div
>
<
div
className=
'ant-card-body'
>
<
StandardTable
tableProps=
{
{
rowKey
:
'id'
,
}
}
currentRef=
{
ref
}
columns=
{
listIndex
===
'1'
?
CirculationList
:
fetchDataListcolumns
}
fetchTableData=
{
(
params
:
any
)
=>
fetchData
(
params
)
}
/>
<
TableList
contractId=
{
contractId
}
listIndex=
{
listIndex
}
/>
</
div
>
</
div
>
</
div
>
...
...
src/pages/transaction/components/detailLayout/components/context.ts
View file @
51ea4387
...
...
@@ -8,3 +8,6 @@ export const BidDetailContext = createContext<any>({})
/**采购竞价单详情 Context */
export
const
PurchaseBidContext
=
createContext
<
any
>
({})
/** 营销活动 */
export
const
EditableContext
=
createContext
(
null
);
src/pages/transaction/dealAbility/productInquiry/waitAddInquiry/addForm.tsx
View file @
51ea4387
...
...
@@ -61,7 +61,10 @@ const AddedFormLayout: React.FC<AddedFormLayoutProps> = (props: any) => {
otherRequire
:
res
.
otherRequire
,
enclosureUrls
:
res
.
enclosureUrls
,
inquiryListProductRequests
:
res
.
inquiryListProductRequests
,
contacts
:
res
.
contacts
,
contactsPhone
:
res
.
contactsPhone
,
phoneCode
:
res
.
phoneCode
,
shopId
:
res
.
shopId
,
}
id
&&
(
params
.
id
=
id
);
fetchRequest
({
...
params
}).
then
(
res
=>
{
...
...
@@ -131,6 +134,14 @@ const AddedFormLayout: React.FC<AddedFormLayoutProps> = (props: any) => {
})
}
const
getContacts
=
(
value
)
=>
{
form
.
setFieldsValue
({
"contacts"
:
value
.
name
,
'contactsPhone'
:
value
.
phone
,
'phoneCode'
:
86
,
});
}
const
init
=
async
()
=>
{
if
(
isEdit
&&
spam
)
{
// const data: any = JSON.parse(sessionStorage.getItem(spam));
...
...
@@ -148,7 +159,8 @@ const AddedFormLayout: React.FC<AddedFormLayoutProps> = (props: any) => {
purchaseCount
:
1
,
logistics
:
data
.
logistics
,
memberId
:
data
.
memberId
,
memberRoleId
:
data
.
memberRoleId
memberRoleId
:
data
.
memberRoleId
,
taxRate
:
data
.
taxRate
,
})
setMenberInfo
({
memberId
:
data
.
memberId
,
...
...
@@ -228,7 +240,7 @@ const AddedFormLayout: React.FC<AddedFormLayoutProps> = (props: any) => {
>
<
BasicInfoLatyout
getMemberInfo=
{
getMemberInfo
}
memb=
{
memberInfo
}
isEdit=
{
spam
}
/>
<
InquiryProductLayout
getInquiryProduct=
{
getInquiryProduct
}
member=
{
memberInfo
}
setInquiryProduct=
{
inquiryProduct
}
/>
<
TradeTermsLayout
getFullAddress=
{
getFullAddress
}
/>
<
TradeTermsLayout
getFullAddress=
{
getFullAddress
}
getContacts=
{
getContacts
}
/>
<
AttachLayout
enclosureUrls=
{
enclosureUrls
}
getEnclosureUrls=
{
getEnclosureUrls
}
removeEnclosureUrls=
{
removeEnclosureUrls
}
/>
</
Form
>
}
...
...
src/pages/transaction/dealAbility/productInquiry/waitAddInquiry/components/basicInfo.tsx
View file @
51ea4387
import
React
,
{
useCallback
,
useEffect
,
useState
}
from
'react'
;
import
{
Row
,
Col
,
Form
,
Input
,
Button
}
from
'antd'
;
import
{
Row
,
Col
,
Form
,
Input
,
Button
,
Select
}
from
'antd'
;
import
{
GlobalConfig
}
from
'@/global/config'
import
{
LinkOutlined
}
from
'@ant-design/icons'
;
import
Card
from
'@/pages/transaction/components/card'
;
import
TableModal
from
'@/pages/transaction/components/TableModal'
;
...
...
@@ -23,6 +24,7 @@ const BasicInfoLayout: React.FC<BasicInfoLayoutProps> = (props: any) => {
const
{
getMemberInfo
,
memb
,
isEdit
}
=
props
;
const
[
visible
,
setVisible
]
=
useState
<
boolean
>
(
false
);
const
[
member
,
setMember
]
=
useState
<
any
>
({})
const
[
storeList
,
setStoreList
]
=
useState
<
Array
<
any
>>
([]);
const
columns
:
any
=
[
{
...
...
@@ -52,6 +54,14 @@ const BasicInfoLayout: React.FC<BasicInfoLayoutProps> = (props: any) => {
}
]
useEffect
(()
=>
{
let
shopList
=
GlobalConfig
.
web
.
shopInfo
.
filter
(
v
=>
(
v
.
type
==
1
&&
v
.
environment
==
1
)).
map
(
v
=>
v
)
console
.
log
(
shopList
,
962039
)
setStoreList
(
shopList
)
},
[])
const
handleFetchData
=
useCallback
((
params
:
any
)
=>
{
return
new
Promise
(
resolve
=>
{
PublicApi
.
getMemberManagePlatformProviderPage
({
...
params
}).
then
(
res
=>
{
...
...
@@ -99,6 +109,13 @@ const BasicInfoLayout: React.FC<BasicInfoLayoutProps> = (props: any) => {
<
Form
.
Item
label=
"询价单摘要"
name=
"details"
rules=
{
[{
required
:
true
,
message
:
'请输入询价单摘要'
}]
}
>
<
Input
maxLength=
{
30
}
placeholder=
"最长60字符,30个汉字"
/>
</
Form
.
Item
>
<
Form
.
Item
label=
"询价商城"
name=
"shopId"
rules=
{
[{
required
:
true
,
message
:
'请选择询价商城'
}]
}
>
<
Select
>
{
storeList
.
map
(
item
=>
(
<
Select
.
Option
key=
{
item
.
id
}
value=
{
item
.
id
}
>
{
item
.
name
}
</
Select
.
Option
>
))
}
</
Select
>
</
Form
.
Item
>
</
Col
>
<
Col
span=
{
12
}
className=
{
style
.
searchColor
}
>
<
Form
.
Item
label=
"被询价会员"
name=
'memberName'
rules=
{
[{
required
:
true
,
message
:
'请选择被询价会员'
}]
}
>
...
...
src/pages/transaction/dealAbility/productInquiry/waitAddInquiry/components/inquiryProduct.tsx
View file @
51ea4387
...
...
@@ -141,7 +141,8 @@ const InquiryProductLayout: React.FC<InquiryProductLayoutProps> = (props: any) =
logistics
:
v
.
logistics
,
memberId
:
v
.
memberId
,
memberRoleId
:
v
.
memberRoleId
,
imgUrl
:
v
.
mainPic
imgUrl
:
v
.
mainPic
,
taxRate
:
v
.
taxRate
,
})
})
resolve
({
...
...
src/pages/transaction/dealAbility/productInquiry/waitAddInquiry/components/tradeTerms.tsx
View file @
51ea4387
import
React
,
{
useEffect
,
useState
}
from
'react'
;
import
React
,
{
use
Callback
,
use
Effect
,
useState
}
from
'react'
;
import
{
Row
,
Col
,
Form
,
Input
,
DatePicker
,
Select
,
Button
,
Space
}
from
'antd'
;
import
Card
from
'@/pages/transaction/components/card'
;
import
moment
from
'moment'
;
import
{
PublicApi
}
from
'@/services/api'
;
import
{
isEmpty
}
from
'lodash'
;
import
{
LinkOutlined
}
from
'@ant-design/icons'
;
import
TableModal
from
'@/pages/transaction/components/TableModal'
;
import
{
FORM_FILTER_PATH
}
from
'@/formSchema/const'
;
import
{
useStateFilterSearchLinkageEffect
}
from
'@/formSchema/effects/useFilterSearch'
;
const
disabledDate
=
(
current
)
=>
{
return
current
&&
current
<
moment
().
startOf
(
'day'
);
...
...
@@ -13,11 +16,14 @@ const disabledDate = (current) => {
interface
TradeTermsLayoutProps
{
/** 获取地址详情 */
getFullAddress
?:
(
e
)
=>
void
,
/** 获取联系人 */
getContacts
?:
(
e
)
=>
void
,
}
const
TradeTermsLayout
:
React
.
FC
<
TradeTermsLayoutProps
>
=
(
props
:
any
)
=>
{
const
{
getFullAddress
}
=
props
;
const
{
getFullAddress
,
getContacts
}
=
props
;
const
[
fullAddress
,
setFullAddress
]
=
useState
<
any
[]
>
([]);
const
[
visible
,
setVisible
]
=
useState
<
boolean
>
(
false
)
useEffect
(()
=>
{
PublicApi
.
getLogisticsSelectListReceiverAddress
().
then
(
res
=>
{
...
...
@@ -34,6 +40,52 @@ const TradeTermsLayout: React.FC<TradeTermsLayoutProps> = (props: any) => {
getFullAddress
(
option
)
}
const
handleFetchData
=
useCallback
((
params
:
any
)
=>
{
return
new
Promise
(
resolve
=>
{
PublicApi
.
getMemberManageUsersPage
({
...
params
}).
then
(
res
=>
{
if
(
res
.
code
!==
1000
)
{
return
}
resolve
(
res
.
data
)
}).
catch
(
error
=>
{
console
.
warn
(
error
)
})
})
},
[])
const
toggle
=
(
flag
:
boolean
)
=>
{
setVisible
(
flag
)
}
const
columns
:
any
=
[
{
title
:
'序号'
,
dataIndex
:
'userId'
,
key
:
'userId'
,
},
{
title
:
'用户姓名'
,
dataIndex
:
'name'
,
key
:
'name'
,
},
{
title
:
'手机号'
,
dataIndex
:
'phone'
,
key
:
'phone'
,
},
{
title
:
'所属机构'
,
dataIndex
:
'orgName'
,
key
:
'orgName'
,
},
]
const
handleConfirm
=
(
selectRowKeys
:
string
[]
|
number
[],
selectRowRecord
:
any
)
=>
{
const
target
=
selectRowRecord
[
0
];
getContacts
(
target
)
toggle
(
false
)
}
return
(
<
Card
id=
"tradeTermsLayout"
...
...
@@ -76,7 +128,7 @@ const TradeTermsLayout: React.FC<TradeTermsLayoutProps> = (props: any) => {
name=
'contacts'
rules=
{
[{
required
:
true
,
message
:
'请选择询价联系人'
}]
}
>
<
Input
.
Search
readOnly
enterButton=
{
<
Button
style=
{
{
height
:
'31.19px'
}
}
icon=
{
<
LinkOutlined
/>
}
>
选择
</
Button
>
}
/>
<
Input
.
Search
onSearch=
{
()
=>
toggle
(
true
)
}
readOnly
enterButton=
{
<
Button
style=
{
{
height
:
'31.19px'
}
}
icon=
{
<
LinkOutlined
/>
}
>
选择
</
Button
>
}
/>
</
Form
.
Item
>
<
Form
.
Item
label=
'联系人电话'
...
...
@@ -126,6 +178,88 @@ const TradeTermsLayout: React.FC<TradeTermsLayoutProps> = (props: any) => {
</
Form
.
Item
>
</
Col
>
</
Row
>
<
TableModal
modalType=
"Drawer"
visible=
{
visible
}
title=
"选择用户"
mode=
"radio"
tableProps=
{
{
rowKey
:
'userId'
,
}
}
customKey=
"userId"
fetchData=
{
handleFetchData
}
onClose=
{
()
=>
toggle
(
false
)
}
onOk=
{
handleConfirm
}
columns=
{
columns
}
effects=
{
(
$
,
actions
)
=>
{
actions
.
reset
()
useStateFilterSearchLinkageEffect
(
$
,
actions
,
"name"
,
FORM_FILTER_PATH
)
}
}
schema=
{
{
type
:
'object'
,
properties
:
{
megalayout
:
{
type
:
'object'
,
"x-component"
:
'mega-layout'
,
properties
:
{
name
:
{
type
:
'string'
,
"x-component"
:
"Search"
,
"x-mega-props"
:
{
},
"x-component-props"
:
{
placeholder
:
'用户姓名'
,
align
:
'flex-left'
,
}
}
}
},
[
FORM_FILTER_PATH
]:
{
type
:
'object'
,
"x-component"
:
"flex-layout"
,
"x-component-props"
:
{
rowStyle
:
{
justifyContent
:
'flex-start'
,
flexWrap
:
'nowrap'
},
colStyle
:
{
//改变间隔
marginRight
:
20
}
},
properties
:
{
PRO_LAYOUT
:
{
type
:
'object'
,
"x-component"
:
'mega-layout'
,
"x-mega-props"
:
{
span
:
5
},
"x-component-props"
:
{
inline
:
true
},
properties
:
{
orgName
:
{
type
:
'string'
,
"x-component-props"
:
{
placeholder
:
'所属机构'
}
},
}
},
sumbit
:
{
"x-component"
:
'Submit'
,
"x-mega-props"
:
{
span
:
1
},
"x-component-props"
:
{
children
:
'查询'
}
}
}
}
}
}
}
/>
</
Card
>
)
}
...
...
src/pages/transaction/marketingAbility/components/activityUserLayout/index.tsx
View file @
51ea4387
...
...
@@ -46,7 +46,8 @@ const ActivityUserLayout: React.FC<ActivityUserLayoutProps> = (props: any) => {
<
h5
className=
{
style
.
label
}
>
适用用户:
</
h5
>
<
h5
className=
{
style
.
content
}
>
<
Space
>
<
div
className=
{
style
.
selector
}
>
新用户
</
div
>
{
data
.
newMember
&&
<
div
className=
{
style
.
selector
}
>
新会员(平台会员)
</
div
>
}
{
data
.
oldMember
&&
<
div
className=
{
style
.
selector
}
>
老会员(平台会员)
</
div
>
}
</
Space
>
</
h5
>
</
div
>
...
...
@@ -54,8 +55,8 @@ const ActivityUserLayout: React.FC<ActivityUserLayoutProps> = (props: any) => {
<
h5
className=
{
style
.
label
}
>
适用用户角色:
</
h5
>
<
h5
className=
{
style
.
content
}
>
<
Space
>
<
div
className=
{
style
.
selector
}
>
会员用户
</
div
>
<
div
className=
{
style
.
selector
}
>
普通用户
</
div
>
{
data
.
enterpriseMember
&&
<
div
className=
{
style
.
selector
}
>
企业会员
</
div
>
}
{
data
.
personalMember
&&
<
div
className=
{
style
.
selector
}
>
个人会员
</
div
>
}
</
Space
>
</
h5
>
</
div
>
...
...
src/pages/transaction/marketingAbility/paltformSign/detail/columns.tsx
View file @
51ea4387
...
...
@@ -107,6 +107,7 @@ export const Columns = (int) => {
</
Tooltip
>,
key
:
'plummetPrice'
,
dataIndex
:
'plummetPrice'
,
render
:
(
text
)
=>
`¥
${
Number
(
text
).
toFixed
(
2
)}
`
},
{
title
:
'活动价格'
,
...
...
@@ -173,7 +174,8 @@ export const Columns = (int) => {
{
title
:
'活动价格'
,
key
:
'activityPrice'
,
dataIndex
:
'activityPrice'
dataIndex
:
'activityPrice'
,
render
:
(
text
)
=>
`¥
${
Number
(
text
).
toFixed
(
2
)}
`
},
{
title
:
'个人限购数量'
,
...
...
@@ -185,11 +187,6 @@ export const Columns = (int) => {
key
:
'restrictTotalNum'
,
dataIndex
:
'restrictTotalNum'
},
{
title
:
'操作'
,
key
:
''
,
dataIndex
:
''
},
]
case
4
:
case
5
:
...
...
@@ -234,7 +231,8 @@ export const Columns = (int) => {
{
title
:
'商品价格'
,
key
:
'price'
,
dataIndex
:
'price'
dataIndex
:
'price'
,
render
:
(
text
)
=>
`¥
${
Number
(
text
).
toFixed
(
2
)}
`
},
{
title
:
'个人限购数量'
,
...
...
@@ -246,11 +244,6 @@ export const Columns = (int) => {
key
:
'restrictTotalNum'
,
dataIndex
:
'restrictTotalNum'
},
{
title
:
'操作'
,
key
:
''
,
dataIndex
:
''
},
]
case
9
:
return
[
...
...
@@ -288,12 +281,14 @@ export const Columns = (int) => {
{
title
:
'商品价格'
,
key
:
'price'
,
dataIndex
:
'price'
dataIndex
:
'price'
,
render
:
(
text
)
=>
`¥
${
Number
(
text
).
toFixed
(
2
)}
`
},
{
title
:
'团购价格'
,
key
:
'activityPrice'
,
dataIndex
:
'activityPrice'
dataIndex
:
'activityPrice'
,
render
:
(
text
)
=>
`¥
${
Number
(
text
).
toFixed
(
2
)}
`
},
{
title
:
'个人限购数量'
,
...
...
@@ -305,11 +300,6 @@ export const Columns = (int) => {
key
:
'restrictTotalNum'
,
dataIndex
:
'restrictTotalNum'
},
{
title
:
'操作'
,
key
:
''
,
dataIndex
:
''
},
]
case
11
:
return
[
...
...
@@ -347,7 +337,8 @@ export const Columns = (int) => {
{
title
:
'商品价格'
,
key
:
'price'
,
dataIndex
:
'price'
dataIndex
:
'price'
,
render
:
(
text
)
=>
`¥
${
Number
(
text
).
toFixed
(
2
)}
`
},
{
title
:
<
Tooltip
placement=
"top"
title=
"第一个用户帮砍价时的起始价格"
>
...
...
@@ -355,6 +346,7 @@ export const Columns = (int) => {
</
Tooltip
>,
key
:
'plummetPrice'
,
dataIndex
:
'plummetPrice'
,
render
:
(
text
)
=>
`¥
${
Number
(
text
).
toFixed
(
2
)}
`
},
{
title
:
<
Tooltip
placement=
"top"
title=
"砍价过程中最后一次砍价不能超过砍价底价"
>
...
...
@@ -362,6 +354,7 @@ export const Columns = (int) => {
</
Tooltip
>,
key
:
'activityPrice'
,
dataIndex
:
'activityPrice'
,
render
:
(
text
)
=>
`¥
${
Number
(
text
).
toFixed
(
2
)}
`
},
{
title
:
'个人限购数量'
,
...
...
@@ -410,14 +403,16 @@ export const Columns = (int) => {
{
title
:
'商品价格'
,
key
:
'price'
,
dataIndex
:
'price'
dataIndex
:
'price'
,
render
:
(
text
)
=>
`¥
${
Number
(
text
).
toFixed
(
2
)}
`
},
{
title
:
<
Tooltip
placement=
"top"
title=
"秒杀价格表示在秒杀时间段内商城直接以该商品的秒杀价格进行销售"
>
秒杀价格
<
QuestionCircleOutlined
/>
</
Tooltip
>,
key
:
'activityPrice'
,
dataIndex
:
'activityPrice'
dataIndex
:
'activityPrice'
,
render
:
(
text
)
=>
`¥
${
Number
(
text
).
toFixed
(
2
)}
`
},
{
title
:
'个人限购数量'
,
...
...
@@ -429,11 +424,6 @@ export const Columns = (int) => {
key
:
'restrictTotalNum'
,
dataIndex
:
'restrictTotalNum'
},
{
title
:
'操作'
,
key
:
''
,
dataIndex
:
''
},
]
case
14
:
return
[
...
...
@@ -471,22 +461,26 @@ export const Columns = (int) => {
{
title
:
'商品价格'
,
key
:
'price'
,
dataIndex
:
'price'
dataIndex
:
'price'
,
render
:
(
text
)
=>
`¥
${
Number
(
text
).
toFixed
(
2
)}
`
},
{
title
:
'预售价格'
,
key
:
'activityPrice'
,
dataIndex
:
'activityPrice'
dataIndex
:
'activityPrice'
,
render
:
(
text
)
=>
`¥
${
Number
(
text
).
toFixed
(
2
)}
`
},
{
title
:
'单位定金'
,
key
:
'activityPrice'
,
dataIndex
:
'activityPrice'
dataIndex
:
'activityPrice'
,
render
:
(
text
)
=>
`¥
${
Number
(
text
).
toFixed
(
2
)}
`
},
{
title
:
'定金抵扣单价'
,
key
:
'activityPrice'
,
dataIndex
:
'activityPrice'
dataIndex
:
'activityPrice'
,
render
:
(
text
)
=>
`¥
${
Number
(
text
).
toFixed
(
2
)}
`
},
{
title
:
'个人限购数量'
,
...
...
@@ -498,11 +492,6 @@ export const Columns = (int) => {
key
:
'restrictTotalNum'
,
dataIndex
:
'restrictTotalNum'
},
{
title
:
'操作'
,
key
:
''
,
dataIndex
:
''
},
]
}
}
...
...
src/pages/transaction/marketingAbility/paltformSign/readySubmit/index.tsx
View file @
51ea4387
import
React
from
'react'
;
import
React
,
{
useState
,
useRef
}
from
'react'
;
import
TableLayout
from
'../../../components/TableLayout'
;
import
{
FORM_FILTER_PATH
}
from
'@/formSchema/const'
;
import
{
ColumnType
}
from
'antd/lib/table/interface'
;
import
StatusTag
from
'@/components/StatusTag'
;
import
{
Button
,
Space
}
from
'antd'
;
import
{
Button
,
Space
,
Popconfirm
}
from
'antd'
;
import
{
format
}
from
'@/pages/transaction/common/dateFormat'
;
import
{
useLinkageUtils
}
from
'@/utils/formEffectUtils'
;
import
{
FormEffectHooks
}
from
'@formily/antd'
;
...
...
@@ -13,6 +13,27 @@ import EyePreview from '@/components/EyePreview';
const
{
onFormMount$
}
=
FormEffectHooks
;
const
ReadySubmit
=
()
=>
{
const
ref
=
useRef
<
any
>
({});
const
[
rowkeys
,
setRowKeys
]
=
useState
<
Array
<
number
>>
([]);
const
[
confirmLoading
,
setConfirmLoading
]
=
useState
<
boolean
>
(
false
)
/** 批量审核 */
const
fetchSubmitBatch
=
async
(
id
?:
number
)
=>
{
let
res
=
null
;
if
(
id
)
{
res
=
await
PublicApi
.
postMarketingPlatformActivitySignupSubmitSignUp
({
id
});
}
else
{
res
=
await
PublicApi
.
postPurchaseQuotedPriceSubmitBatch
({
ids
:
rowkeys
});
}
setConfirmLoading
(
true
)
if
(
res
.
code
!==
1000
)
{
setConfirmLoading
(
false
)
return
}
setConfirmLoading
(
false
)
ref
.
current
.
reload
();
setRowKeys
([])
}
const
columns
:
ColumnType
<
any
>
[]
=
[
{
title
:
'活动ID'
,
...
...
@@ -23,7 +44,7 @@ const ReadySubmit = () => {
title
:
'活动名称'
,
key
:
'activityName'
,
dataIndex
:
'activityName'
,
render
:
(
text
)
=>
<
EyePreview
>
{
text
}
</
EyePreview
>
render
:
(
text
,
record
)
=>
<
EyePreview
url=
{
`/memberCenter/marketingAbility/paltformSign/readySubmit/preview?activityId=${record.activityId}&signUpId=${record.id}`
}
>
{
text
}
</
EyePreview
>
},
{
title
:
'活动类型'
,
...
...
@@ -75,24 +96,13 @@ const ReadySubmit = () => {
title
:
'操作'
,
key
:
'state'
,
dataIndex
:
'state'
,
render
:
(
text
,
record
)
=>
(
<>
<
Button
type=
'link'
>
提交审核
</
Button
>
<
Button
type=
'link'
>
填写报名资料
</
Button
>
</>
)
render
:
(
text
,
record
)
=>
<
Popconfirm
title=
"确定要提交吗?"
okButtonProps=
{
{
loading
:
confirmLoading
}
}
disabled=
{
!
record
.
id
}
okText=
"是"
cancelText=
"否"
onConfirm=
{
()
=>
fetchSubmitBatch
(
record
.
id
)
}
>
<
Button
type=
'link'
disabled=
{
!
record
.
id
}
>
提交
</
Button
>
</
Popconfirm
>
},
]
/* 多选返回的 */
const
fetchRowkeys
=
(
row
)
=>
{
console
.
log
(
row
);
}
/* 操作按钮 */
const
controllerBtns
=
(
<
Space
>
<
Button
type=
"ghost"
>
批量提交审核
</
Button
>
</
Space
>
)
const
useStateEffects
=
()
=>
{
const
linkage
=
useLinkageUtils
();
...
...
@@ -109,42 +119,66 @@ const ReadySubmit = () => {
return
(
<
TableLayout
reload=
{
ref
}
columns=
{
columns
}
effects=
"id"
fetch=
{
PublicApi
.
getMarketingPlatformActivitySignupPageTobeSubmitSignUp
}
selectedRow=
{
true
}
fetchRowkeys=
{
fetchRowkeys
}
controllerBtns=
{
controllerBtns
}
fetchRowkeys=
{
(
e
)
=>
setRowKeys
(
e
)
}
controllerBtns=
{
<
Space
>
<
Button
loading=
{
confirmLoading
}
disabled=
{
rowkeys
.
length
===
0
}
onClick=
{
()
=>
fetchSubmitBatch
()
}
>
批量提交
</
Button
>
</
Space
>
}
schema=
{
{
type
:
'object'
,
type
:
"object"
,
properties
:
{
mageLayout
:
{
type
:
'object'
,
'x-component'
:
'Mega-Layout'
,
megalayout
:
{
type
:
"object"
,
"x-component"
:
"mega-layout"
,
"x-component-props"
:
{
grid
:
true
},
properties
:
{
topLayout
:
{
type
:
'object'
,
'x-component'
:
'Mega-Layout'
,
ctl
:
{
type
:
"object"
,
"x-component"
:
"controllerBtns"
,
},
id
:
{
type
:
'string'
,
'x-component'
:
'Search'
,
'x-component-props'
:
{
grid
:
true
,
},
properties
:
{
id
:
{
type
:
'string'
,
'x-component'
:
'Search'
,
'x-component-props'
:
{
placeholder
:
'活动ID'
,
},
},
placeholder
:
'活动ID'
,
},
},
[
FORM_FILTER_PATH
]:
{
type
:
'object'
,
'x-component'
:
'Flex-Layout'
,
'x-component-props'
:
{
colStyle
:
{
marginLeft
:
20
,
},
}
},
[
FORM_FILTER_PATH
]:
{
type
:
"object"
,
"x-component"
:
"flex-layout"
,
"x-component-props"
:
{
rowStyle
:
{
flexWrap
:
"nowrap"
},
colStyle
:
{
marginLeft
:
20
}
},
properties
:
{
PRO_LAYOUT
:
{
type
:
"object"
,
"x-component"
:
"mega-layout"
,
"x-mega-props"
:
{
span
:
5
},
"x-component-props"
:
{
inline
:
true
},
properties
:
{
activityName
:
{
...
...
@@ -176,20 +210,20 @@ const ReadySubmit = () => {
},
enum
:
[],
},
submit
:
{
'x-component'
:
'Submit'
,
'x-mega-props'
:
{
span
:
1
,
},
'x-component-props'
:
{
children
:
'查询'
,
},
},
},
}
},
},
},
},
sumbit
:
{
"x-component"
:
"Submit"
,
"x-mega-props"
:
{
span
:
1
},
"x-component-props"
:
{
children
:
"查询"
}
}
}
}
}
}
}
useStateEffects=
{
useStateEffects
}
/>
...
...
src/pages/transaction/marketingAbility/paltformSign/readySubmitExamine/components/columns.tsx
View file @
51ea4387
...
...
@@ -121,7 +121,7 @@ export const Columns = (int) => {
title
:
'活动价格'
,
key
:
'activityPrice'
,
dataIndex
:
'activityPrice'
,
render
:
(
text
)
=>
`¥
${
Number
(
text
).
toFixed
(
2
)}
`
render
:
(
text
)
=>
text
?
`¥
${
Number
(
text
).
toFixed
(
2
)}
`
:
`¥0
`
},
{
title
:
'个人限购数量'
,
...
...
@@ -178,7 +178,8 @@ export const Columns = (int) => {
{
title
:
'商品价格'
,
key
:
'price'
,
dataIndex
:
'price'
dataIndex
:
'price'
,
render
:
(
text
)
=>
`¥
${
Number
(
text
).
toFixed
(
2
)}
`
},
{
title
:
<
Tooltip
placement=
"top"
title=
"折扣为商品价格的折扣,输入数字,如85折,输入85,9折输入90"
>
...
...
@@ -190,22 +191,26 @@ export const Columns = (int) => {
{
title
:
'活动价格'
,
key
:
'activityPrice'
,
dataIndex
:
'activityPrice'
dataIndex
:
'activityPrice'
,
render
:
(
text
)
=>
text
?
`¥
${
Number
(
text
).
toFixed
(
2
)}
`
:
`¥0`
},
{
title
:
'个人限购数量'
,
key
:
'restrictNum'
,
dataIndex
:
'restrictNum'
dataIndex
:
'restrictNum'
,
editable
:
true
,
},
{
title
:
'活动限购总数量'
,
key
:
'restrictTotalNum'
,
dataIndex
:
'restrictTotalNum'
dataIndex
:
'restrictTotalNum'
,
editable
:
true
,
},
{
title
:
'操作'
,
key
:
''
,
dataIndex
:
''
key
:
'operation'
,
dataIndex
:
'operation'
,
operation
:
true
,
},
]
case
4
:
...
...
@@ -251,22 +256,26 @@ export const Columns = (int) => {
{
title
:
'商品价格'
,
key
:
'price'
,
dataIndex
:
'price'
dataIndex
:
'price'
,
render
:
(
text
)
=>
`¥
${
Number
(
text
).
toFixed
(
2
)}
`
},
{
title
:
'个人限购数量'
,
key
:
'restrictNum'
,
dataIndex
:
'restrictNum'
dataIndex
:
'restrictNum'
,
editable
:
true
,
},
{
title
:
'活动限购总数量'
,
key
:
'restrictTotalNum'
,
dataIndex
:
'restrictTotalNum'
dataIndex
:
'restrictTotalNum'
,
editable
:
true
,
},
{
title
:
'操作'
,
key
:
''
,
dataIndex
:
''
key
:
'operation'
,
dataIndex
:
'operation'
,
operation
:
true
,
},
]
case
9
:
...
...
@@ -305,7 +314,8 @@ export const Columns = (int) => {
{
title
:
'商品价格'
,
key
:
'price'
,
dataIndex
:
'price'
dataIndex
:
'price'
,
render
:
(
text
)
=>
`¥
${
Number
(
text
).
toFixed
(
2
)}
`
},
{
title
:
'团购价格'
,
...
...
@@ -315,12 +325,14 @@ export const Columns = (int) => {
{
title
:
'个人限购数量'
,
key
:
'restrictNum'
,
dataIndex
:
'restrictNum'
dataIndex
:
'restrictNum'
,
editable
:
true
,
},
{
title
:
'活动限购总数量'
,
key
:
'restrictTotalNum'
,
dataIndex
:
'restrictTotalNum'
dataIndex
:
'restrictTotalNum'
,
editable
:
true
,
},
{
title
:
'操作'
,
...
...
@@ -364,7 +376,8 @@ export const Columns = (int) => {
{
title
:
'商品价格'
,
key
:
'price'
,
dataIndex
:
'price'
dataIndex
:
'price'
,
render
:
(
text
)
=>
`¥
${
Number
(
text
).
toFixed
(
2
)}
`
},
{
title
:
<
Tooltip
placement=
"top"
title=
"第一个用户帮砍价时的起始价格"
>
...
...
@@ -437,7 +450,8 @@ export const Columns = (int) => {
{
title
:
'商品价格'
,
key
:
'price'
,
dataIndex
:
'price'
dataIndex
:
'price'
,
render
:
(
text
)
=>
`¥
${
Number
(
text
).
toFixed
(
2
)}
`
},
{
title
:
<
Tooltip
placement=
"top"
title=
"秒杀价格表示在秒杀时间段内商城直接以该商品的秒杀价格进行销售"
>
...
...
@@ -449,12 +463,14 @@ export const Columns = (int) => {
{
title
:
'个人限购数量'
,
key
:
'restrictNum'
,
dataIndex
:
'restrictNum'
dataIndex
:
'restrictNum'
,
editable
:
true
,
},
{
title
:
'活动限购总数量'
,
key
:
'restrictTotalNum'
,
dataIndex
:
'restrictTotalNum'
dataIndex
:
'restrictTotalNum'
,
editable
:
true
,
},
{
title
:
'操作'
,
...
...
@@ -498,7 +514,8 @@ export const Columns = (int) => {
{
title
:
'商品价格'
,
key
:
'price'
,
dataIndex
:
'price'
dataIndex
:
'price'
,
render
:
(
text
)
=>
`¥
${
Number
(
text
).
toFixed
(
2
)}
`
},
{
title
:
'预售价格'
,
...
...
@@ -518,12 +535,14 @@ export const Columns = (int) => {
{
title
:
'个人限购数量'
,
key
:
'restrictNum'
,
dataIndex
:
'restrictNum'
dataIndex
:
'restrictNum'
,
editable
:
true
,
},
{
title
:
'活动限购总数量'
,
key
:
'restrictTotalNum'
,
dataIndex
:
'restrictTotalNum'
dataIndex
:
'restrictTotalNum'
,
editable
:
true
,
},
{
title
:
'操作'
,
...
...
src/pages/transaction/marketingAbility/paltformSign/readySubmitExamine/components/productListLayout/EditableCell.tsx
0 → 100644
View file @
51ea4387
import
React
,
{
useContext
}
from
'react'
;
import
{
Input
,
Form
,
Popconfirm
}
from
'antd'
;
import
{
EditableContext
}
from
'@/pages/transaction/components/detailLayout/components/context'
;
const
EditableCell
=
({
title
,
operation
,
editable
,
children
,
dataIndex
,
record
,
activities
,
handleSave
,
handleDelete
,
sumTotal
,
...
restProps
})
=>
{
const
form
=
useContext
(
EditableContext
);
let
childNode
=
children
;
const
save
=
async
()
=>
{
try
{
const
values
=
await
form
.
validateFields
();
handleSave
({
...
record
,
...
values
});
}
catch
(
errInfo
)
{
}
}
const
rate
=
async
()
=>
{
try
{
const
values
=
await
form
.
getFieldValue
(
dataIndex
);
if
(
activities
&&
Number
(
activities
)
!==
11
)
{
record
.
activityPrice
=
sumTotal
(
record
.
price
,
values
)
}
handleSave
({
...
record
,
...
values
});
}
catch
(
errInfo
)
{
}
}
/** 编辑按钮 */
if
(
editable
)
{
switch
(
dataIndex
)
{
case
'activityPrice'
:
case
'plummetPrice'
:
childNode
=
(
<
Form
.
Item
style=
{
{
margin
:
0
,
}
}
name=
{
dataIndex
}
initialValue=
{
record
[
dataIndex
]
}
rules=
{
[
{
required
:
true
,
validator
:
async
(
_rule
,
value
)
=>
{
const
pattern
=
/^
(\-)?\d
+
(\.\d
{1,4}
)?
$/
;
const
plummetPrice
=
await
form
.
getFieldValue
(
'plummetPrice'
);
if
(
!
value
)
{
return
Promise
.
reject
(
new
Error
(
'必填项'
));
}
if
((
Number
(
activities
)
===
11
&&
dataIndex
===
'activityPrice'
)
&&
(
!
pattern
.
test
(
value
)
||
(
Number
(
value
)
>=
Number
(
plummetPrice
))))
{
console
.
log
((
Number
(
activities
)
===
11
&&
dataIndex
===
'activityPrice'
),
!
pattern
.
test
(
value
)
||
(
Number
(
value
)
>=
Number
(
plummetPrice
)),
10086
)
return
Promise
.
reject
(
new
Error
(
'必须大于0且小于起始价格'
));
}
if
(
!
pattern
.
test
(
value
)
||
(
Number
(
value
)
>=
Number
(
record
.
price
)))
{
return
Promise
.
reject
(
new
Error
(
'必须大于0且小于商品价格'
));
}
return
Promise
.
resolve
();
},
},
]
}
>
<
Input
style=
{
{
width
:
'112px'
}
}
addonBefore=
"¥"
onPressEnter=
{
rate
}
onBlur=
{
rate
}
/>
</
Form
.
Item
>
)
break
;
case
'restrictNum'
:
childNode
=
(
<
Form
.
Item
style=
{
{
margin
:
0
,
}
}
name=
{
dataIndex
}
initialValue=
{
record
[
dataIndex
]
}
rules=
{
[
{
required
:
true
,
validator
:
async
(
_rule
,
value
)
=>
{
const
pattern
=
/^
(\-)?\d
+
(\.\d
{1,3}
)?
$/
;
const
restrictTotalNum
=
await
form
.
getFieldValue
(
'restrictTotalNum'
);
if
(
!
value
)
{
return
Promise
.
reject
(
new
Error
(
'必填项'
));
}
if
(
!
pattern
.
test
(
value
)
||
!
(
Number
(
value
)
<=
Number
(
restrictTotalNum
)))
{
return
Promise
.
reject
(
new
Error
(
'个人限购数量必须大于0且小于活动限购总数量'
));
}
return
Promise
.
resolve
();
},
},
]
}
>
<
Input
style=
{
{
width
:
'112px'
}
}
onPressEnter=
{
save
}
onBlur=
{
save
}
/>
</
Form
.
Item
>
)
break
;
case
'restrictTotalNum'
:
childNode
=
(
<
Form
.
Item
style=
{
{
margin
:
0
,
}
}
name=
{
dataIndex
}
initialValue=
{
record
[
dataIndex
]
}
rules=
{
[
{
required
:
true
,
validator
:
(
_rule
,
value
)
=>
{
const
pattern
=
/^
(\-)?\d
+
(\.\d
{1,3}
)?
$/
;
if
(
!
value
)
{
return
Promise
.
reject
(
new
Error
(
'必填项'
));
}
if
(
!
pattern
.
test
(
value
))
{
return
Promise
.
reject
(
new
Error
(
'活动限购总数量必须大于0'
));
}
return
Promise
.
resolve
();
},
},
]
}
>
<
Input
style=
{
{
width
:
'112px'
}
}
onPressEnter=
{
save
}
onBlur=
{
save
}
/>
</
Form
.
Item
>
)
break
;
}
}
/** 操作按钮 */
if
(
operation
)
{
childNode
=
(
<
Popconfirm
title=
"是否删除?"
onConfirm=
{
()
=>
handleDelete
(
record
.
productId
)
}
>
<
a
>
删除
</
a
>
</
Popconfirm
>
)
}
return
<
td
{
...
restProps
}
>
{
childNode
}
</
td
>;
}
export
default
EditableCell
src/pages/transaction/marketingAbility/paltformSign/readySubmitExamine/components/productListLayout/index.tsx
View file @
51ea4387
import
React
,
{
useState
,
useMemo
,
useEffect
,
useC
ontext
,
useC
allback
}
from
'react'
;
import
{
Table
,
Form
,
Input
,
Popconfirm
,
Button
}
from
'antd'
;
import
React
,
{
useState
,
useMemo
,
useEffect
,
useCallback
}
from
'react'
;
import
{
Table
,
Form
,
Button
}
from
'antd'
;
import
Card
from
'@/pages/transaction/components/card'
;
import
{
Columns
}
from
'../columns'
;
import
EditableCell
from
'./EditableCell'
;
import
{
isEmpty
}
from
'lodash'
;
import
{
ColumnType
}
from
'antd/lib/table'
;
import
TableModal
from
'@/pages/transaction/components/TableModal'
;
...
...
@@ -9,7 +10,7 @@ import { PublicApi } from '@/services/api';
import
{
useStateFilterSearchLinkageEffect
}
from
'@/formSchema/effects/useFilterSearch'
;
import
{
FORM_FILTER_PATH
}
from
'@/formSchema/const'
;
import
{
PlusOutlined
}
from
'@ant-design/icons'
;
const
EditableContext
=
React
.
createContext
(
null
)
;
import
{
EditableContext
}
from
'@/pages/transaction/components/detailLayout/components/context'
;
/** 表格头 */
const
EditableRow
=
({
index
,
...
props
})
=>
{
...
...
@@ -22,65 +23,6 @@ const EditableRow = ({ index, ...props }) => {
</
Form
>
);
};
/** 表格内容 */
const
EditableCell
=
({
title
,
operation
,
editable
,
children
,
dataIndex
,
record
,
handleSave
,
handleDelete
,
sumTotal
,
...
restProps
})
=>
{
const
form
=
useContext
(
EditableContext
);
const
save
=
async
()
=>
{
try
{
const
values
=
await
form
.
validateFields
();
record
.
activityPrice
=
sumTotal
(
record
.
price
,
values
.
plummetPrice
)
handleSave
({
...
record
,
...
values
});
}
catch
(
errInfo
)
{}
};
let
childNode
=
children
;
if
(
editable
)
{
childNode
=
(
<
Form
.
Item
style=
{
{
margin
:
0
,
}
}
name=
{
dataIndex
}
initialValue=
{
record
[
dataIndex
]
}
rules=
{
[
{
required
:
true
,
message
:
`${title}是必填项`
,
},
]
}
>
<
Input
style=
{
{
width
:
'112px'
}
}
onPressEnter=
{
save
}
onBlur=
{
save
}
/>
</
Form
.
Item
>
)
}
if
(
operation
)
{
childNode
=
(
<
Popconfirm
title=
"是否删除?"
onConfirm=
{
()
=>
handleDelete
(
record
.
productId
)
}
>
<
a
>
删除
</
a
>
</
Popconfirm
>
)
}
return
<
td
{
...
restProps
}
>
{
childNode
}
</
td
>;
};
interface
ProductListLayoutProps
{
/** 详情数据 */
data
?:
any
,
...
...
@@ -151,12 +93,12 @@ const ProductListLayout: React.FC<ProductListLayoutProps> = (props: any) => {
key
:
'status'
,
dataIndex
:
'status'
,
render
:
(
text
)
=>
<>
{
Number
(
text
)
===
1
&&
'待提交审核'
}
{
Number
(
text
)
===
2
&&
'待审核'
}
{
Number
(
text
)
===
3
&&
'审核不通过'
}
{
Number
(
text
)
===
4
&&
'审核通过'
}
{
Number
(
text
)
===
5
&&
'上架'
}
{
Number
(
text
)
===
6
&&
'下架'
}
{
Number
(
text
)
===
1
&&
'待提交审核'
}
{
Number
(
text
)
===
2
&&
'待审核'
}
{
Number
(
text
)
===
3
&&
'审核不通过'
}
{
Number
(
text
)
===
4
&&
'审核通过'
}
{
Number
(
text
)
===
5
&&
'上架'
}
{
Number
(
text
)
===
6
&&
'下架'
}
</>
},
]
...
...
@@ -196,7 +138,6 @@ const ProductListLayout: React.FC<ProductListLayoutProps> = (props: any) => {
const
handleOk
=
(
selectRowKeys
:
string
[]
|
number
[],
selectRowRecord
:
any
)
=>
{
const
rowRecord
:
any
[]
=
[...
selectRowRecord
]
console
.
log
(
rowRecord
,
10086
)
const
productList
=
rowRecord
.
map
(
item
=>
{
return
{
id
:
item
.
id
,
...
...
@@ -207,7 +148,7 @@ const ProductListLayout: React.FC<ProductListLayoutProps> = (props: any) => {
brand
:
item
.
brand
,
unit
:
item
.
unit
,
price
:
item
.
price
,
plummetPrice
:
item
.
price
,
plummetPrice
:
item
.
p
lummetP
rice
,
activityPrice
:
item
.
activityPrice
,
deductionPrice
:
item
.
deductionPrice
,
discount
:
item
.
discount
,
...
...
@@ -222,7 +163,7 @@ const ProductListLayout: React.FC<ProductListLayoutProps> = (props: any) => {
/** 活动加个计算 */
const
sumTotal
=
(
price
,
num
)
=>
{
switch
(
Number
(
type
))
{
switch
(
Number
(
type
))
{
case
2
:
return
(
Number
(
price
)
-
Number
(
num
))
}
...
...
@@ -261,6 +202,7 @@ const ProductListLayout: React.FC<ProductListLayoutProps> = (props: any) => {
editable
:
col
.
editable
,
dataIndex
:
col
.
dataIndex
,
title
:
col
.
title
,
activities
:
type
,
handleSave
:
handleSave
,
handleDelete
:
handleDelete
,
sumTotal
:
sumTotal
,
...
...
src/pages/transaction/purchaseAbility/purchaseInquiry/addInquiry/modal/index.tsx
View file @
51ea4387
...
...
@@ -177,8 +177,8 @@ const AnchorModal: React.FC<AnchorModalProps> = (props: any) => {
name
:
Object
.
keys
(
product
).
length
>
0
?
product
.
name
:
res
.
name
,
category
:
Object
.
keys
(
product
).
length
>
0
?
product
.
customerCategory
.
name
:
edit
.
category
,
ids
:
res
.
ids
,
categoryId
:
Object
.
keys
(
product
).
length
>
0
?
product
.
customerCategory
.
id
:
edit
.
catcategoryIdegory
,
memberCategoryId
:
(
Object
.
keys
(
product
).
length
>
0
&&
!
isEmpty
(
product
.
customerCategory
.
category
))
?
product
.
customerCategory
.
c
ategory
.
id
:
edit
.
memberCategoryId
,
categoryId
:
(
Object
.
keys
(
product
).
length
>
0
&&
!
isEmpty
(
product
.
customerCategory
.
category
))
?
product
.
customerCategory
.
category
.
id
:
edit
.
categoryId
,
memberCategoryId
:
Object
.
keys
(
product
).
length
>
0
?
product
.
customerC
ategory
.
id
:
edit
.
memberCategoryId
,
brand
:
res
.
brand
,
model
:
res
.
model
,
purchaseCount
:
res
.
purchaseCount
,
...
...
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