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
07dd6b03
Commit
07dd6b03
authored
Oct 29, 2021
by
前端-钟卫鹏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:
parent
481720ea
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
152 additions
and
396 deletions
+152
-396
index.less
src/pages/transaction/purchaseOrder/index.less
+8
-8
index.tsx
...ges/transaction/purchaseRequisition/billPreview/index.tsx
+4
-14
index.tsx
...purchaseRequisition/components/billDetailHeader/index.tsx
+3
-3
index.tsx
...urchaseRequisition/components/billDetailSection/index.tsx
+51
-105
index.tsx
...ion/purchaseRequisition/components/billMaterial/index.tsx
+1
-21
index.tsx
...purchaseRequisition/components/descriptionsInfo/index.tsx
+0
-0
index.tsx
...n/purchaseRequisition/components/transferRecord/index.tsx
+1
-5
index.tsx
src/pages/transaction/purchaseRequisition/constant/index.tsx
+6
-35
index.tsx
...creaseRequisition/components/materialModalTable/index.tsx
+3
-3
index.tsx
...increaseRequisition/components/memberModalTable/index.tsx
+0
-7
index.tsx
...urchaseRequisition/increaseRequisition/constant/index.tsx
+9
-29
index.ts
.../purchaseRequisition/increaseRequisition/effects/index.ts
+1
-1
index.tsx
...saction/purchaseRequisition/increaseRequisition/index.tsx
+8
-40
useMaterialTable.tsx
...equisition/increaseRequisition/model/useMaterialTable.tsx
+8
-18
index.ts
...n/purchaseRequisition/increaseRequisition/schema/index.ts
+6
-6
index.less
src/pages/transaction/purchaseRequisition/index.less
+9
-0
index.tsx
...ion/purchaseRequisition/requisitionOrder/detail/index.tsx
+32
-79
index.tsx
...ransaction/purchaseRequisition/requisitionOrder/index.tsx
+2
-22
No files found.
src/pages/transaction/purchaseOrder/index.less
View file @
07dd6b03
// @统一处理 业务表格内不嵌套NiceForm组件的高级筛选 间距异常问题
//
.god-schema-form {
//
& > .ant-form-item {
//
margin-bottom: 0 !important;
//
}
//
& > .ant-row-end {
//
margin-top: 24px !important;
//
}
//
}
.god-schema-form {
& > .ant-form-item {
margin-bottom: 0 !important;
}
& > .ant-row-end {
margin-top: 24px !important;
}
}
.adjustFormItem {
...
...
src/pages/transaction/purchaseRequisition/billPreview/index.tsx
View file @
07dd6b03
...
...
@@ -10,20 +10,10 @@ const OrderPreview: React.FC = () => {
const
{
formContext
,
detailList
}
=
useBillDetail
({
type
:
'requestBill'
})
const
anchorTitleList
=
[
// { title: '流转进度', id: 'transferProcess', componentName: "TransferProcess" },
// { title: '基本信息', id: 'baseicInfo', type: "basicInfo" },
// { title: '招标物料', id: 'bidMaterial', componentName: "BidMaterial" },
// { title: '招标要求', id: 'bidNeed', type: "bidNeed" },
// { title: '报名要求', id: 'registerNeed', type: "registerNeed" },
// { title: '报名信息', id: 'registerInfoList', componentName: "RegisterInfoList", type: "registerList" },
// { title: '资格预审要求', id: 'checkNeed', type: "checkNeed" },
// { title: '资格预审信息', id: 'preCheckInfoList', componentName: "RegisterInfoList", type: "preCheckList" },
// { title: '评标要求', id: 'remarkNeed', type: "remarkNeed" },
// { title: '评标报告', id: 'remarkBidReport', componentName: "RemarkBidReport" },
// { title: '其他要求', id: 'otherNeed', type: "otherNeed" },
// { title: '招标方式', id: 'bidWay', componentName: "BidMethod" },
// { title: '招标结果', id: 'bidConfirm', componentName: "BidConfirm" },
// { title: '流转记录', id: 'transferRecord', componentName: "BidTransformRecord" },
{
title
:
'流转进度'
,
id
:
'transferProcess'
,
componentName
:
"TransferProcess"
},
{
title
:
'基本信息'
,
id
:
'baseicInfo'
,
type
:
"basicInfo"
},
{
title
:
'招标物料'
,
id
:
'billMaterial'
,
componentName
:
"BillMaterial"
},
{
title
:
'流转记录'
,
id
:
'transferRecord'
,
componentName
:
"TransformRecord"
},
]
...
...
src/pages/transaction/purchaseRequisition/components/billDetailHeader/index.tsx
View file @
07dd6b03
import
React
,
{
ReactNode
,
use
Callback
,
use
Effect
,
useRef
,
useState
}
from
'react'
import
React
,
{
ReactNode
,
useEffect
,
useRef
,
useState
}
from
'react'
import
{
Row
,
Col
,
Skeleton
,
Anchor
}
from
'antd'
import
{
history
}
from
'umi'
import
{
ArrowLeftOutlined
,
BugTwoTone
}
from
'@ant-design/icons'
import
{
ArrowLeftOutlined
}
from
'@ant-design/icons'
import
style
from
'./index.less'
const
{
Link
}
=
Anchor
;
...
...
@@ -79,7 +79,7 @@ const BillDetailHeader: React.FC<BillDetailHeaderProps> = ({
<
ArrowLeftOutlined
onClick=
{
()
=>
backLink
?
history
.
push
(
backLink
)
:
history
.
goBack
()
}
/>
</
Col
>
<
Col
>
<
div
className=
{
style
.
titleAvatorText
}
>
{
formContext
.
data
.
projectName
||
formContext
.
data
.
inviteTender
.
projectName
}
|
{
formContext
.
data
.
code
||
formContext
.
data
.
inviteTender
.
code
}
</
div
>
<
div
className=
{
style
.
titleAvatorText
}
>
{
formContext
.
data
.
orderNo
}
</
div
>
</
Col
>
</
Row
>
<
Row
>
...
...
src/pages/transaction/purchaseRequisition/components/billDetailSection/index.tsx
View file @
07dd6b03
import
React
,
{
useEffect
}
from
'react'
import
{
findLastIndexFlowState
}
from
'@/utils'
import
style
from
'./index.less'
// import TransferProcess from '../transferProcess'
// import DescriptionsInfo from '../descriptionsInfo'
// import BidMaterial from '../bidMaterial'
// import BidMethod from '../bidMethod'
// import BidTransformRecord from '../transferRecord'
// import BidParticulars from '../bidParticulars'
// import RemarkBidReport from '../remarkBidReport'
// import ParticipateInfo from '../participateInfo'
// import BidConfirm from '../bidConfirm'
// import MemberWinInfo from '../memberWinInfo'
// import RegisterInfoList from '../registerInfoList'
import
DescriptionsInfo
from
'../descriptionsInfo'
import
BillMaterial
from
'../billMaterial'
import
TransferProcess
from
'../transferProcess'
import
TransformRecord
from
'../transferRecord'
export
interface
BillDetailSectionProps
{
formContext
:
any
,
type
:
'requestBill'
...
...
@@ -24,42 +16,17 @@ const BillDetailSection:React.FC<BillDetailSectionProps> = ({
anchorList
=
[],
})
=>
{
useEffect
(()
=>
{
// 获取各个子div距父级的高度
let
floors
=
document
.
querySelectorAll
(
".anchorContent>div"
)
let
tempArr
=
[]
floors
.
forEach
((
floor
:
any
,
index
:
any
)
=>
{
tempArr
.
push
(
floor
.
offsetTop
)
})
// 各内容div存入context
formContext
.
ctl
.
setOffsetTopList
(
tempArr
)
},
[])
// // 名称与组件映射
// const NameMapComponent = {
// // 流转进度组件
// "TransferProcess": TransferProcess,
// // 信息 基本信息组件
// "DescriptionsInfo": DescriptionsInfo,
// // 物料组件
// "BidMaterial": BidMaterial,
// // 招标方式组件
// "BidMethod": BidMethod,
// // 流转记录组件
// "BidTransformRecord": BidTransformRecord,
// // 中标明细组件
// "BidParticulars": BidParticulars,
// // 评标报告
// "RemarkBidReport": RemarkBidReport,
// // 会员参标信息
// "ParticipateInfo": ParticipateInfo,
// // 招标定标
// "BidConfirm": BidConfirm,
// // 会员中标信息
// "MemberWinInfo": MemberWinInfo,
// // 报名信息列表
// "RegisterInfoList": RegisterInfoList,
// }
// 名称与组件映射
const
NameMapComponent
=
{
// 流转进度组件
"TransferProcess"
:
TransferProcess
,
// 信息 基本信息组件
"DescriptionsInfo"
:
DescriptionsInfo
,
// 请购组件
"BillMaterial"
:
BillMaterial
,
// 流转记录组件
"TransformRecord"
:
TransformRecord
,
}
const
RenderDetailSection
=
({
componentList
})
=>
{
if
(
componentList
&&
componentList
.
length
>
0
)
{
...
...
@@ -73,63 +40,42 @@ const BillDetailSection:React.FC<BillDetailSectionProps> = ({
const
RenderCertainContent
=
({
title
,
type
=
null
,
componentName
=
null
})
=>
{
let
RcDom
:
any
=
null
;
// switch(componentName) {
// //@todo 需另外调用接口获取数据
// case 'TransferProcess':
// RcDom = (<TransferProcess
// cardTitle={title}
// customTitleKey='name'
// customKey='id'
// outerVerifyCurrent={findLastIndexFlowState(formContext.externalWorkflowFlowRecordLogResponses)}
// innerVerifyCurrent={findLastIndexFlowState(formContext.interiorWorkflowFlowRecordLogResponses)}
// outerVerifySteps={
// formContext.externalWorkflowFlowRecordLogResponses ?
// formContext.externalWorkflowFlowRecordLogResponses.map(item => ({
// ...item,
// status: item.isActive ? 'finish' : 'wait',
// })) :
// []
// }
// innerVerifySteps={
// formContext.interiorWorkflowFlowRecordLogResponses ?
// formContext.interiorWorkflowFlowRecordLogResponses.map(item => ({
// ...item,
// status: item.isActive ? 'finish' : 'wait',
// })) :
// []
// }
// ></TransferProcess>)
// break;
// case "BidMaterial":
// RcDom = (<BidMaterial cardTitle={title} />)
// break;
// case "BidMethod":
// RcDom = (<BidMethod cardTitle={title} />)
// break;
// case "BidTransformRecord":
// RcDom = (<BidTransformRecord cardTitle={title} />)
// break;
// case "BidParticulars":
// RcDom = (<BidParticulars cardTitle={title} />)
// break;
// case "RemarkBidReport":
// RcDom = (<RemarkBidReport cardTitle={title} />)
// break;
// case "ParticipateInfo":
// RcDom = (<ParticipateInfo cardTitle={title} />)
// break;
// case "BidConfirm":
// RcDom = (<BidConfirm cardTitle={title} />)
// break;
// case "MemberWinInfo":
// RcDom = (<MemberWinInfo cardTitle={title} />)
// break;
// case "RegisterInfoList":
// RcDom = (<RegisterInfoList cardTitle={title} type={type} />)
// break;
// default:
// RcDom = (<DescriptionsInfo cardTitle={title} type={type} />)
// }
switch
(
componentName
)
{
//@todo 需另外调用接口获取数据
case
'TransferProcess'
:
RcDom
=
(<
TransferProcess
cardTitle=
{
title
}
customTitleKey=
'name'
customKey=
'id'
outerVerifyCurrent=
{
findLastIndexFlowState
(
formContext
.
externalWorkflowFlowRecordLogResponses
)
}
innerVerifyCurrent=
{
findLastIndexFlowState
(
formContext
.
interiorWorkflowFlowRecordLogResponses
)
}
outerVerifySteps=
{
formContext
.
externalWorkflowFlowRecordLogResponses
?
formContext
.
externalWorkflowFlowRecordLogResponses
.
map
(
item
=>
({
...
item
,
status
:
item
.
isActive
?
'finish'
:
'wait'
,
}))
:
[]
}
innerVerifySteps=
{
formContext
.
interiorWorkflowFlowRecordLogResponses
?
formContext
.
interiorWorkflowFlowRecordLogResponses
.
map
(
item
=>
({
...
item
,
status
:
item
.
isActive
?
'finish'
:
'wait'
,
}))
:
[]
}
></
TransferProcess
>)
break
;
case
"BiillMaterial"
:
RcDom
=
(<
BillMaterial
cardTitle=
{
title
}
/>)
break
;
case
"TransformRecord"
:
RcDom
=
(<
TransformRecord
cardTitle=
{
title
}
/>)
break
;
default
:
RcDom
=
(<
DescriptionsInfo
cardTitle=
{
title
}
type=
{
type
}
/>)
}
return
RcDom
;
}
...
...
src/pages/transaction/purchaseRequisition/components/billMaterial/index.tsx
View file @
07dd6b03
...
...
@@ -4,10 +4,8 @@ import MellowCard from '@/components/MellowCard'
import
{
BidDetailContext
}
from
'@/pages/procurement/_public/bid/context'
;
import
{
QuestionCircleOutlined
}
from
'@ant-design/icons'
;
import
style
from
'./index.less'
import
BASE_CONFIG
from
'../../../../../config/base.config.json'
import
{
CALLFORBID_TYPE
,
INVITE_BID
}
from
'@/constants/procurement'
;
import
{
CALLFORBID_TYPE
}
from
'@/constants/procurement'
;
import
{
ENTERPRISE_CENTER_URL
}
from
'@/constants'
const
shopInfo
=
BASE_CONFIG
.
web
.
shopInfo
/**
* 请购单 请购物料
...
...
@@ -83,25 +81,7 @@ const BidMethod: React.FC<BidMethodProps> = ({cardTitle}) => {
<
Col
><
p
>
{
CALLFORBID_TYPE
[
data
.
inviteTenderType
]
}
</
p
></
Col
>
</
Row
>
</
div
>
{
data
.
inviteTenderType
===
INVITE_BID
?
<
Table
dataSource=
{
data
.
memberList
}
columns=
{
columns
}
pagination=
{
{
size
:
"small"
}
}
/>
:
<
div
className=
{
style
[
'card-list'
]
}
>
<
Row
>
<
Col
span=
{
2
}
><
p
className=
{
style
[
'card-list_title'
]
}
>
发布商城
</
p
></
Col
>
<
Col
>
<
p
>
{
data
.
inviteTenderShopList
.
map
(
item
=>
{
return
shopInfo
.
find
(
_item
=>
_item
.
type
===
item
.
type
&&
_item
.
environment
===
item
.
environment
)[
'name'
]
}).
join
(
' / '
)
}
</
p
>
</
Col
>
</
Row
>
</
div
>
}
</
MellowCard
>)
}
...
...
src/pages/transaction/purchaseRequisition/components/descriptionsInfo/index.tsx
View file @
07dd6b03
This diff is collapsed.
Click to expand it.
src/pages/transaction/purchaseRequisition/components/transferRecord/index.tsx
View file @
07dd6b03
...
...
@@ -3,13 +3,11 @@ import { Table, Radio } from 'antd'
import
{
formatTimeString
}
from
'@/utils'
import
{
BidDetailContext
}
from
'@/pages/procurement/_public/bid/context'
;
import
MellowCard
from
'@/components/MellowCard'
import
CustomTag
from
'../customTag'
;
import
{
TransferEnum
}
from
'../transferProcess'
;
import
style
from
'./index.less'
import
{
BidInOpeartTexts
,
BidOutOpeartTexts
}
from
'@/constants/procurement'
;
/**
*
招标
流转记录
*
请购订单
流转记录
*/
export
interface
BidTransformRecordProps
{
...
...
@@ -42,7 +40,6 @@ const BidTransformRecord:React.FC<BidTransformRecordProps> = ({cardTitle}) => {
dataIndex
:
'statusValue'
,
align
:
'center'
,
key
:
'statusValue'
,
render
:
(
text
,
r
)
=>
<
CustomTag
text=
{
text
}
color=
{
r
.
statusColor
}
/>
},
{
title
:
'操作'
,
...
...
@@ -95,7 +92,6 @@ const BidTransformRecord:React.FC<BidTransformRecordProps> = ({cardTitle}) => {
dataIndex
:
'statusValue'
,
align
:
'center'
,
key
:
'statusValue'
,
render
:
(
text
,
r
)
=>
<
CustomTag
text=
{
text
}
color=
{
r
.
statusColor
}
/>
},
{
title
:
'操作'
,
...
...
src/pages/transaction/purchaseRequisition/constant/index.tsx
View file @
07dd6b03
...
...
@@ -110,44 +110,28 @@ export const tableListSchema: any = (align?: String, colStyle?: Object) => {
return
{
type
:
'object'
,
properties
:
{
mageLayout
:
{
type
:
'object'
,
'x-component'
:
'mega-layout'
,
properties
:
{
topLayout
:
{
type
:
'object'
,
'x-component'
:
'mega-layout'
,
'x-component-props'
:
{
grid
:
true
,
},
properties
:
{
orderNo
:
{
type
:
'string'
,
"x-component"
:
'Search
'
,
"x-component"
:
'SearchFilter
'
,
'x-component-props'
:
{
placeholder
:
'请输入请购单
号'
,
placeholder
:
'请输入订单编
号'
,
align
:
'flex-end'
,
},
}
},
},
[
FORM_FILTER_PATH
]:
{
type
:
'object'
,
'x-component'
:
'flex-layout'
,
'x-component-props'
:
{
rowStyle
:
{
flexWrap
:
'nowrap'
,
},
inline
:
true
,
colStyle
:
{
marginLeft
:
20
,
marginLeft
:
20
},
},
properties
:
{
"digest"
:
{
type
:
'string'
,
'x-component-props'
:
{
placeholder
:
'请输入请购
单摘要'
,
placeholder
:
'请输入订
单摘要'
,
}
},
"memberName"
:
{
...
...
@@ -156,21 +140,8 @@ export const tableListSchema: any = (align?: String, colStyle?: Object) => {
placeholder
:
'请输入供应会员名称'
}
},
"department"
:
{
type
:
'string'
,
"x-component-props"
:
{
placeholder
:
'请输入请购部门'
}
},
"purpose"
:
{
type
:
'string'
,
"x-component-props"
:
{
placeholder
:
'请输入请购用途'
}
},
"[startDate,endDate]"
:
{
type
:
'daterange'
,
// "x-component": 'DateRangePickerUnix',
'x-component-props'
:
{
placeholder
:
[
'开始时间'
,
'结束时间'
],
},
...
...
@@ -181,7 +152,7 @@ export const tableListSchema: any = (align?: String, colStyle?: Object) => {
children
:
'查询'
,
},
},
},}}
},
},
}
}
...
...
src/pages/transaction/purchaseRequisition/increaseRequisition/components/materialModalTable/index.tsx
View file @
07dd6b03
...
...
@@ -91,7 +91,7 @@ const MaterialModalTable:React.FC<MaterialModalTableProps> = (props) => {
temp
.
name
=
v
.
name
;
temp
.
type
=
v
.
type
;
temp
.
category
=
v
.
customerCategory
.
name
;
temp
.
brand
=
v
.
brand
.
name
;
temp
.
brand
=
v
?.
brand
?.
name
||
null
;
temp
.
unit
=
v
.
unitName
;
return
temp
})
...
...
@@ -108,8 +108,8 @@ const MaterialModalTable:React.FC<MaterialModalTableProps> = (props) => {
const
handleConfirm
=
async
()
=>
{
console
.
log
(
rowSelectionCtl
,
'rowSelectionCtl'
)
const
materialData
=
schemaAction
.
getFieldValue
(
'
material
s'
)
schemaAction
.
setFieldValue
(
'
material
s'
,
addMaterialProcessField
(
rowSelectionCtl
.
selectRow
,
materialData
))
const
materialData
=
schemaAction
.
getFieldValue
(
'
product
s'
)
schemaAction
.
setFieldValue
(
'
product
s'
,
addMaterialProcessField
(
rowSelectionCtl
.
selectRow
,
materialData
))
confirmModal
&&
confirmModal
()
setVisible
(
false
)
}
...
...
src/pages/transaction/purchaseRequisition/increaseRequisition/components/memberModalTable/index.tsx
View file @
07dd6b03
...
...
@@ -37,13 +37,6 @@ const MemberModalTable:React.FC<MemberModalTableProps> = (props) => {
}
confirmModal
&&
confirmModal
()
setVisible
(
false
)
// 清空之前可能存在的商品支付信息数据
schemaAction
.
setFieldValue
(
'materials'
,
[])
schemaAction
.
setFieldValue
(
'payments'
,
[])
if
(
props
?.
productRef
)
{
props
.
productRef
.
current
.
rowSelectionCtl
.
setSelectRow
([])
props
.
productRef
.
current
.
rowSelectionCtl
.
setSelectedRowKeys
([])
}
}
return
(
<
ModalTable
...
...
src/pages/transaction/purchaseRequisition/increaseRequisition/constant/index.tsx
View file @
07dd6b03
import
{
formatTimeString
}
from
'@/utils'
/** 修改
合同下
单 初始值转换 */
/** 修改
请购
单 初始值转换 */
export
const
procurmentRenderInit
=
(
initValue
:
any
)
=>
{
return
{
...
initValue
.
requirement
.
detail
,
vendorMemberId
:
initValue
.
vendorMemberId
,
vendorMemberName
:
initValue
.
vendorMemberName
,
vendorRoleId
:
initValue
.
vendorRoleId
,
product
:
initValue
.
product
,
deliveryAddresId
:
initValue
.
consignee
.
consigneeId
,
hasInvoice
:
initValue
.
hasInvoice
,
orderId
:
initValue
.
orderId
,
orderKind
:
initValue
.
orderKind
,
orderMode
:
initValue
.
orderMode
,
orderModeName
:
initValue
.
orderModeName
,
type
:
initValue
.
orderTypeName
,
digest
:
initValue
.
digest
,
deliverDate
:
initValue
.
consignee
.
deliverDate
,
theInvoiceId
:
initValue
.
invoice
?.
invoiceId
||
null
,
hasContract
:
initValue
.
hasContract
,
contractNo
:
initValue
.
contract
.
contractNo
,
contract
:
{...
initValue
.
contract
},
requisitionNo
:
initValue
.
requisitionNo
,
innerStatusName
:
initValue
.
innerStatusName
,
createTime
:
initValue
.
createTime
,
// 预留字段
shopId
:
initValue
.
shopId
,
requisitionId
:
initValue
.
requisitionId
,
}
}
/** 修改
采购合同下
单 回显商品字段转换 */
/** 修改
请购
单 回显商品字段转换 */
export
const
procurementRenderField
=
(
data
)
=>
{
const
_orderProductRequests
=
data
.
product
.
products
return
_orderProductRequests
.
map
(
item
=>
{
return
{
...
item
,
relevanceProductId
:
item
.
quotedSkuId
,
relevanceProductName
:
item
.
quotedName
,
relevanceProductBrand
:
item
.
quotedBrand
,
relevanceProductCategory
:
item
.
quotedCategory
,
relevanceProductSpec
:
item
.
quotedSpec
,
logistics
:
item
.
deliverType
,
id
:
item
.
productId
,
code
:
item
.
productNo
,
type
:
item
.
spec
,
...
...
@@ -54,13 +40,7 @@ export const procurementProcessField = (value) => {
...
item
,
productId
:
item
.
id
,
productNo
:
item
.
code
,
// 关联商品信息
// quotedProductId: item.relevanceProductId,
quotedSkuId
:
item
.
relevanceProductId
,
quotedName
:
item
.
relevanceProductName
,
quotedSpec
:
item
.
relevanceProductType
,
quotedCategory
:
item
.
relevanceProductCategory
,
quotedBrand
:
item
.
relevanceProductBrand
,
spec
:
item
.
type
,
}
})
return
value
...
...
src/pages/transaction/purchaseRequisition/increaseRequisition/effects/index.ts
View file @
07dd6b03
...
...
@@ -15,7 +15,7 @@ export const useEditHideField = () => {
}
export
const
useMaterialTableChangeForAmount
=
(
ctx
:
ISchemaFormActions
|
ISchemaFormAsyncActions
,
update
)
=>
{
FormEffectHooks
.
onFieldValueChange$
(
'
material
s'
).
subscribe
(
state
=>
{
FormEffectHooks
.
onFieldValueChange$
(
'
product
s'
).
subscribe
(
state
=>
{
// 强制渲染一次, 用于触发金额总数
update
()
})
...
...
src/pages/transaction/purchaseRequisition/increaseRequisition/index.tsx
View file @
07dd6b03
...
...
@@ -35,18 +35,12 @@ const RowStyle = styled(props => <Row style={{marginTop: 12}} justify='end' {...
`
// 总计金额联动框
export
const
MoneyTotalBox
=
registerVirtualBox
(
'moneyTotalBox'
,
props
=>
{
const
{
form
}
=
useFormSpy
({
selector
:
[[
'onFieldValueChange'
,
'
material
s'
]],
reducer
:
v
=>
v
})
const
data
=
form
.
getFieldValue
(
'
material
s'
)
export
const
MoneyTotalBox
=
registerVirtualBox
(
'moneyTotalBox'
,
()
=>
{
const
{
form
}
=
useFormSpy
({
selector
:
[[
'onFieldValueChange'
,
'
product
s'
]],
reducer
:
v
=>
v
})
const
data
=
form
.
getFieldValue
(
'
product
s'
)
const
sum
=
data
.
reduce
((
prev
,
next
)
=>
(
prev
*
1000
+
(
next
.
amount
||
0
)
*
1000
)
/
1000
,
0
)
const
total
=
data
.
reduce
((
prev
,
next
)
=>
(
prev
*
1000
+
(
next
.
quantity
||
0
)
*
1000
)
/
1000
,
0
)
// useEffect(() => {
// if (sum + freePrice) {
// form.notify('sumPrice', sum + freePrice)
// }
// }, [sum, freePrice])
return
<
RowStyle
>
<
Col
span=
{
2
}
>
<
div
>
数量合计
</
div
>
...
...
@@ -59,7 +53,6 @@ export const MoneyTotalBox = registerVirtualBox('moneyTotalBox', props => {
</
RowStyle
>
})
/** 采购请购单 新增 */
const
IncreaseRequisition
:
React
.
FC
<
{}
>
=
()
=>
{
const
departmentRef
=
useRef
<
any
>
({})
// 选部门
...
...
@@ -76,13 +69,12 @@ const IncreaseRequisition:React.FC<{}> = () => {
useEffect
(()
=>
{
if
(
id
)
{
setFormLoading
(
true
)
PublicApi
.
get
OrderBuyerCreateDetail
({
orderId
:
id
}).
then
(
res
=>
{
PublicApi
.
get
PurchaseRequisitionDetail
({
id
}).
then
(
res
=>
{
const
{
data
}
=
res
const
_orderProductRequests
=
procurementRenderField
(
data
)
setInitFormValue
(()
=>
procurmentRenderInit
(
data
))
setTimeout
(()
=>
{
addSchemaAction
.
setFieldValue
(
'materials'
,
_orderProductRequests
)
addSchemaAction
.
setFieldValue
(
'contract'
,
{...
data
.
contract
})
addSchemaAction
.
setFieldValue
(
'products'
,
_orderProductRequests
)
},
1000
)
setFormLoading
(
false
)
})
...
...
@@ -98,7 +90,7 @@ const IncreaseRequisition:React.FC<{}> = () => {
console
.
log
(
value
)
// 校验采购数量
const
judgementByCount
=
params
.
materials
?.
length
&&
params
.
material
s
.
map
(
item
=>
{
const
judgementByCount
=
params
.
products
?.
length
&&
params
.
product
s
.
map
(
item
=>
{
if
(
item
.
quantity
){
return
true
}
else
{
...
...
@@ -108,42 +100,18 @@ const IncreaseRequisition:React.FC<{}> = () => {
if
(
!
judgementByCount
||
judgementByCount
.
includes
(
false
)){
throw
new
Error
(
'请填写商品采购数量'
)
}
// 使用发票即校验发票id
if
(
params
.
hasInvoice
&&
!
params
.
theInvoiceId
)
{
throw
new
Error
(
'请新增或选择需要使用的发票'
)
}
setBtnLoading
(
true
)
/** 字段转换 */
// 合同下单 取供应商默认的发货地址
const
{
data
:
deliveryAddress
}
=
await
PublicApi
.
getLogisticsSelectListMemberShipperAddress
({
memberId
:
params
.
vendorMemberId
,
roleId
:
params
.
vendorRoleId
})
params
.
materials
=
params
.
materials
.
map
(
item
=>
{
const
address
=
deliveryAddress
[
0
]
return
{
...
item
,
spec
:
item
.
type
,
quotedSpec
:
item
.
relevanceProductType
,
deliveryType
:
item
.
logistics
,
addressId
:
address
?.
id
||
null
,
address
:
address
?.
fullAddress
||
null
,
receiver
:
address
?.
shipperName
||
null
,
phone
:
address
?.
phone
||
null
,
}
})
const
_params
=
procurementProcessField
(
params
)
console
.
log
(
_params
)
if
(
id
)
{
fnResult
=
await
PublicApi
.
postOrderBuyerCreateSrmUpdate
({...
_params
,
orderId
:
id
})
}
else
{
fnResult
=
await
PublicApi
.
post
OrderBuyerCreateSrm
(
_params
)
fnResult
=
await
PublicApi
.
post
PurchaseRequisitionCreate
(
_params
)
}
if
(
fnResult
.
code
===
1000
)
{
setTimeout
(()
=>
{
history
.
push
(
"/memberCenter/
tranactionAbility/purchaseOrder/readyAddSrmOrder
"
)
history
.
push
(
"/memberCenter/
procurementAbility/purchaseRequisition/readyAddBill
"
)
},
1000
)
}
else
{
setBtnLoading
(
false
)
...
...
src/pages/transaction/purchaseRequisition/increaseRequisition/model/useMaterialTable.tsx
View file @
07dd6b03
import
React
,
{
useRef
,
useState
}
from
'react'
import
{
useRef
,
useState
}
from
'react'
import
{
ISchemaFormActions
,
ISchemaFormAsyncActions
}
from
'@formily/antd'
;
import
{
Button
}
from
'antd'
;
import
{
materialInfoColumns
}
from
'../constant'
;
...
...
@@ -7,16 +7,6 @@ import { useModalTable } from './useModalTable';
import
{
usePageStatus
,
PageStatus
}
from
'@/hooks/usePageStatus'
;
// 对象按key排序(运用于商城传过来的阶梯价格排序)
export
const
sortByKey
=
(
params
)
=>
{
let
keys
=
Object
.
keys
(
params
).
sort
((
x
,
y
)
=>
parseInt
(
x
)
-
parseInt
(
y
));
let
newParams
=
{};
keys
.
forEach
((
key
)
=>
{
newParams
[
key
]
=
params
[
key
];
});
return
newParams
;
}
export
const
getUnitPriceTotal
=
(
record
)
=>
{
const
purchaseCount
=
Number
(
record
[
'quantity'
])
||
0
return
Number
(((
record
.
price
||
0
)
*
purchaseCount
).
toFixed
(
2
))
...
...
@@ -30,7 +20,7 @@ export const useMaterialTable = (ctx: ISchemaFormActions | ISchemaFormAsyncActio
const
{
visible
,
setVisible
,
rowSelection
,
rowSelectionCtl
}
=
useModalTable
({
type
:
'checkbox'
})
const
handleDelete
=
(
record
)
=>
{
const
newData
=
[...
ctx
.
getFieldValue
(
'
material
s'
)]
const
newData
=
[...
ctx
.
getFieldValue
(
'
product
s'
)]
// 删除formvalue
const
colIndex
=
newData
.
findIndex
(
v
=>
v
.
id
===
record
.
id
)
newData
.
splice
(
colIndex
,
1
)
...
...
@@ -38,7 +28,7 @@ export const useMaterialTable = (ctx: ISchemaFormActions | ISchemaFormAsyncActio
// 删除选中的项
rowSelectionCtl
.
setSelectRow
(
newData
)
rowSelectionCtl
.
setSelectedRowKeys
(
newData
.
map
(
v
=>
v
.
id
))
ctx
.
setFieldValue
(
'
material
s'
,
newData
)
ctx
.
setFieldValue
(
'
product
s'
,
newData
)
}
...
...
@@ -59,10 +49,10 @@ export const useMaterialTable = (ctx: ISchemaFormActions | ISchemaFormAsyncActio
return
materialInfoColumns
})
const
handleShowMaterial
=
()
=>
{
const
materials
=
ctx
.
getFieldValue
(
'material
s'
)
const
products
=
ctx
.
getFieldValue
(
'product
s'
)
materialRef
.
current
.
setVisible
(
true
)
if
(
materials
&&
material
s
.
length
)
{
materialRef
.
current
.
rowSelectionCtl
.
setSelectedRowKeys
(()
=>
material
s
.
map
(
item
=>
item
.
id
))
if
(
products
&&
product
s
.
length
)
{
materialRef
.
current
.
rowSelectionCtl
.
setSelectedRowKeys
(()
=>
product
s
.
map
(
item
=>
item
.
id
))
}
}
...
...
@@ -76,7 +66,7 @@ export const useMaterialTable = (ctx: ISchemaFormActions | ISchemaFormAsyncActio
const
handleSave
=
row
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
const
newData
=
[...
ctx
.
getFieldValue
(
'
material
s'
)];
const
newData
=
[...
ctx
.
getFieldValue
(
'
product
s'
)];
const
index
=
newData
.
findIndex
(
item
=>
row
.
id
===
item
.
id
);
const
item
=
newData
[
index
];
// 算单行价格
...
...
@@ -85,7 +75,7 @@ export const useMaterialTable = (ctx: ISchemaFormActions | ISchemaFormAsyncActio
...
item
,
...
row
,
});
ctx
.
setFieldValue
(
'
material
s'
,
newData
)
ctx
.
setFieldValue
(
'
product
s'
,
newData
)
resolve
({
item
,
newData
})
})
};
...
...
src/pages/transaction/purchaseRequisition/increaseRequisition/schema/index.ts
View file @
07dd6b03
...
...
@@ -20,7 +20,7 @@ const basicInfo: ISchema = {
wrapperCol
:
10
},
properties
:
{
order
No
:
{
requisition
No
:
{
type
:
'string'
,
title
:
'请购单号'
,
"x-component"
:
'text'
,
...
...
@@ -40,14 +40,14 @@ const basicInfo: ISchema = {
}
]
},
deliver
Dat
e
:
{
deliver
Tim
e
:
{
type
:
'string'
,
"x-component"
:
'date'
,
title
:
'预交日期'
,
required
:
true
,
"x-component-props"
:
{
showTime
:
true
,
format
:
'YYYY-MM-DD
HH:mm
'
,
//
showTime: true,
format
:
'YYYY-MM-DD'
,
disabledDate
:
current
=>
{
return
current
&&
current
<
moment
().
startOf
(
'day'
)
},
...
...
@@ -103,7 +103,7 @@ const basicInfo: ISchema = {
title
:
'单据时间'
,
visible
:
false
},
interiorState
:
{
interiorState
Name
:
{
type
:
'string'
,
title
:
'内部状态'
,
visible
:
false
...
...
@@ -123,7 +123,7 @@ export const material: ISchema = {
tab
:
'订单物料'
},
properties
:
{
material
s
:
{
product
s
:
{
type
:
'array'
,
"x-component"
:
'MultTable'
,
"x-component-props"
:
{
...
...
src/pages/transaction/purchaseRequisition/index.less
View file @
07dd6b03
// @统一处理 业务表格内不嵌套NiceForm组件的高级筛选 间距异常问题
.god-schema-form {
& > .ant-form-item {
margin-bottom: 0 !important;
}
& > .ant-row-end {
margin-top: 24px !important;
}
}
src/pages/transaction/purchaseRequisition/requisitionOrder/detail/index.tsx
View file @
07dd6b03
import
React
from
'react'
import
{
history
}
from
'umi'
import
{
Card
,
Button
,
Space
}
from
'antd'
import
{
StandardTable
}
from
'god'
import
{
PageHeaderWrapper
}
from
'@ant-design/pro-layout'
import
{
PublicApi
}
from
'@/services/api'
import
{
PlusCircleOutlined
}
from
'@ant-design/icons'
import
{
useStateFilterSearchLinkageEffect
}
from
'@/formSchema/effects/useFilterSearch'
import
{
FORM_FILTER_PATH
}
from
'@/formSchema/const'
import
Submit
from
'@/components/NiceForm/components/Submit'
import
'../index.less'
import
{
tableListSchema
}
from
'../../constant'
import
{
useSelfTable
}
from
'../model/useRequisitionOrder'
// 请购单转订单 详情
export
interface
RequesitionOrderDetailProps
{}
const
fetchTableData
=
async
(
params
)
=>
{
const
{
data
}
=
await
PublicApi
.
getOrderBuyerCreatePage
(
params
)
return
data
}
const
RequesitionOrderDetail
:
React
.
FC
<
RequesitionOrderDetailProps
>
=
()
=>
{
const
{
columns
,
ref
}
=
useSelfTable
()
import
React
from
'react'
;
import
PreLoading
from
'@/components/PreLoading'
;
import
{
useBillDetail
}
from
'@/pages/transaction/_public/bill/effects/useBillDetail'
;
import
{
BillDetailContext
}
from
'@/pages/transaction/_public/bill/effects/context'
;
import
BillDetailHeader
from
'../../components/billDetailHeader'
;
import
BillDetailWrapper
from
'../../components/billDetailWrapper'
;
import
BillDetailSection
from
'../../components/billDetailSection'
;
const
RequisitionOrderDetail
:
React
.
FC
=
()
=>
{
const
{
formContext
,
detailList
}
=
useBillDetail
({
type
:
'requestBill'
})
const
anchorTitleList
=
[
{
title
:
'基本信息'
,
id
:
'baseicInfo'
,
type
:
"basicInfo"
},
{
title
:
'请购物料'
,
id
:
'billMaterial'
,
componentName
:
"BillMaterial"
},
]
return
(
<
div
>
<
BillDetailContext
.
Provider
value=
{
formContext
}
>
<
BillDetailHeader
formContext=
{
formContext
}
anchorList=
{
anchorTitleList
}
/>
<
BillDetailWrapper
>
<
PreLoading
loading=
{
!
formContext
.
data
}
active
paragraph=
{
{
rows
:
6
}
}
>
<
BillDetailSection
formContext=
{
formContext
}
anchorList=
{
anchorTitleList
}
type=
"requestBill"
/>
</
PreLoading
>
</
BillDetailWrapper
>
const
clickAdd
=
()
=>
{
history
.
push
(
`/memberCenter/procurementAbility/purchaseRequisition/readyAddBill/add`
)
}
</
BillDetailContext
.
Provider
>
return
<
PageHeaderWrapper
>
<
Card
>
<
StandardTable
fetchTableData=
{
params
=>
fetchTableData
(
params
)
}
columns=
{
columns
}
currentRef=
{
ref
}
rowKey=
"orderId"
formilyLayouts=
{
{
justify
:
'space-between'
}
}
formilyProps=
{
{
ctx
:
{
inline
:
false
,
schema
:
tableListSchema
(),
effects
:
(
$
,
actions
)
=>
{
useStateFilterSearchLinkageEffect
(
$
,
actions
,
'orderNo'
,
FORM_FILTER_PATH
,
);
},
components
:
{
Submit
}
},
layouts
:
{
order
:
2
,
span
:
16
}
}
}
formilyChilds=
{
{
children
:
<
Space
>
<
Button
icon=
{
<
PlusCircleOutlined
/>
}
type=
'primary'
onClick=
{
clickAdd
}
>
新建
</
Button
>
</
Space
>,
layouts
:
{
span
:
8
}
}
}
/>
</
Card
>
</
PageHeaderWrapper
>
</
div
>
)
}
RequesitionOrderDetail
.
defaultProps
=
{}
export
default
RequesitionOrderDetail
export
default
RequisitionOrderDetail
;
src/pages/transaction/purchaseRequisition/requisitionOrder/index.tsx
View file @
07dd6b03
import
React
from
'react'
import
{
history
}
from
'umi'
import
{
Card
,
Button
,
Space
}
from
'antd'
import
{
Card
}
from
'antd'
import
{
StandardTable
}
from
'god'
import
{
PageHeaderWrapper
}
from
'@ant-design/pro-layout'
import
{
PublicApi
}
from
'@/services/api'
import
{
PlusCircleOutlined
}
from
'@ant-design/icons'
import
{
useStateFilterSearchLinkageEffect
}
from
'@/formSchema/effects/useFilterSearch'
import
{
FORM_FILTER_PATH
}
from
'@/formSchema/const'
import
Submit
from
'@/components/NiceForm/components/Submit'
...
...
@@ -25,10 +23,6 @@ const fetchTableData = async (params) => {
const
RequisitionOrder
:
React
.
FC
<
RequisitionOrderProps
>
=
()
=>
{
const
{
columns
,
ref
}
=
useSelfTable
()
const
clickAdd
=
()
=>
{
history
.
push
(
`/memberCenter/procurementAbility/purchaseRequisition/readyAddBill/add`
)
}
return
<
PageHeaderWrapper
>
<
Card
>
<
StandardTable
...
...
@@ -58,21 +52,7 @@ const RequisitionOrder:React.FC<RequisitionOrderProps> = () => {
},
layouts
:
{
order
:
2
,
span
:
16
}
}
}
formilyChilds=
{
{
children
:
<
Space
>
<
Button
icon=
{
<
PlusCircleOutlined
/>
}
type=
'primary'
onClick=
{
clickAdd
}
>
新建
</
Button
>
</
Space
>,
layouts
:
{
span
:
8
span
:
24
}
}
}
/>
...
...
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