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
f562200b
Commit
f562200b
authored
May 13, 2021
by
前端-钟卫鹏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 处理采购合同下单修改异常
parent
f4bba90e
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
69 additions
and
29 deletions
+69
-29
index.tsx
...pages/procurement/callForBids/callForBidsSearch/index.tsx
+1
-1
index.tsx
...Order/orderCollect/components/materialTableCell/index.tsx
+8
-8
index.tsx
...transaction/purchaseOrder/orderCollect/constant/index.tsx
+20
-0
index.ts
...s/transaction/purchaseOrder/orderCollect/effects/index.ts
+0
-1
index.tsx
src/pages/transaction/purchaseOrder/orderCollect/index.tsx
+38
-18
addRule.tsx
src/pages/transaction/purchaseRules/addRule.tsx
+2
-1
No files found.
src/pages/procurement/callForBids/callForBidsSearch/index.tsx
View file @
f562200b
...
...
@@ -68,7 +68,7 @@ const callForBidsSearch: React.FC<{}> = () => {
}
const
handleWithdraw
=
()
=>
{
history
.
push
(
'memberCenter/procurementAbility/callForBids/remarkBidCommittee/add'
)
history
.
push
(
'
/
memberCenter/procurementAbility/callForBids/remarkBidCommittee/add'
)
}
// 复制 id存入本地存储跳转至新增页
...
...
src/pages/transaction/purchaseOrder/orderCollect/components/materialTableCell/index.tsx
View file @
f562200b
...
...
@@ -59,14 +59,14 @@ export const MaterialTableCell:React.FC<MaterialTableCellProps> = ({
// select的change
const
change
=
async
(
va
,
op
,
idx
)
=>
{
console
.
log
(
va
,
op
,
idx
)
//
try {
//
const values = await form.validateFields();
//
values[idx] = op['label']
// values['unitId
'] = op['value']
//
handleSave({ ...record, ...values });
//
} catch (errInfo) {
//
console.log('Save failed:', errInfo);
//
}
try
{
const
values
=
await
form
.
validateFields
();
values
[
idx
]
=
op
[
'label'
]
values
[
'logistics
'
]
=
op
[
'value'
]
handleSave
({
...
record
,
...
values
});
}
catch
(
errInfo
)
{
console
.
log
(
'Save failed:'
,
errInfo
);
}
}
const
chooseFormItem
=
(
type
,
v
)
=>
{
...
...
src/pages/transaction/purchaseOrder/orderCollect/constant/index.tsx
View file @
f562200b
...
...
@@ -25,6 +25,26 @@ export const PriceComp = (props) => {
</
div
>
}
/** 修改采购合同下单 回显字段转换 */
export
const
procurementRenderField
=
(
_orderProductRequests
)
=>
{
return
_orderProductRequests
.
map
(
item
=>
{
return
{
...
item
,
relevanceProductId
:
item
.
productId
,
relevanceProductName
:
item
.
productName
,
relevanceProductBrand
:
item
.
brand
,
relevanceProductCategory
:
item
.
category
,
logistics
:
item
.
logistics
.
deliveryType
,
id
:
item
.
materialId
,
code
:
item
.
materialCode
,
name
:
item
.
materialName
,
type
:
item
.
materialType
,
category
:
item
.
materialCategory
,
brand
:
item
.
materialBrand
,
}
})
}
/** 采购合同下单 字段转换 */
export
const
procurementProcessField
=
(
value
)
=>
{
value
.
orderProductRequests
=
value
.
orderProductRequests
.
map
(
item
=>
{
...
...
src/pages/transaction/purchaseOrder/orderCollect/effects/index.ts
View file @
f562200b
...
...
@@ -74,7 +74,6 @@ export const useModelTypeChange = (callback) => {
const
utils
=
useLinkageUtils
()
// 下单模式发生改变时
FormEffectHooks
.
onFieldValueChange$
(
'orderModel'
).
subscribe
(
state
=>
{
console
.
log
(
state
.
value
,
'efffect'
)
callback
(
state
)
})
}
...
...
src/pages/transaction/purchaseOrder/orderCollect/index.tsx
View file @
f562200b
...
...
@@ -9,7 +9,7 @@ import { SaveOutlined, LinkOutlined, PlusOutlined, CodeSandboxCircleFilled, Ques
import
NiceForm
from
'@/components/NiceForm'
import
{
orderDetailSchema
,
orderAddSchema
,
mergeAllSchemas
,
payInfo
,
orderMaterial
,
orderProduct
}
from
'./schema'
import
{
useModelTypeChange
,
useEditHideField
,
useOrderFormInitEffect
,
useProductTableChangeForPay
,
useOrderUpdateChangeOther
}
from
'./effects'
import
{
orderTypeLabel
,
orderCombination
,
orderTypeLabelMap
,
procurementProcessField
}
from
'./constant'
import
{
orderTypeLabel
,
orderCombination
,
orderTypeLabelMap
,
procurementProcessField
,
procurementRenderField
}
from
'./constant'
import
{
OrderModalType
}
from
'@/constants'
import
ProductModalTable
from
'./components/productModalTable'
import
MemberModalTable
from
'./components/memberModalTable'
...
...
@@ -179,6 +179,8 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
const
{
data
}
=
res
setInitFormValue
({
...
data
,
// 判断是否合同下单
orderProductRequests
:
data
.
orderModel
>
30
?
procurementRenderField
(
data
.
orderProductRequests
)
:
data
.
orderProductRequests
,
deliveryTime
:
formatTimeString
(
data
.
deliveryTime
)
})
setFormLoading
(
false
)
...
...
@@ -203,6 +205,10 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
},
[])
useEffect
(()
=>
{
console
.
log
(
initFormValue
,
'init'
)
},
[
initFormValue
])
const
handleSubmit
=
async
(
value
)
=>
{
let
_orderProductRequests
=
JSON
.
parse
(
JSON
.
stringify
(
value
.
orderProductRequests
))
let
processEnum
=
value
[
'processEnum'
]
...
...
@@ -361,7 +367,7 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
...
params
,
ordeProducts
:
addSchemaAction
.
getFieldValue
(
"ordeProducts"
)
})
}
else
if
(
params
.
orderModel
>
30
)
{
}
else
if
(
params
.
orderModel
>
30
)
{
// 判断是否合同下单
let
_params
=
procurementProcessField
(
params
)
let
_
=
_params
.
quotationNo
_params
.
quotationNo
=
_params
.
contractNo
...
...
@@ -456,6 +462,31 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
productSumPrice
,
setProductSumPrice
}
// 显示采购下单合同栏目
const
showContractColumn
=
()
=>
{
// 移除支付信息栏 订单商品栏 添加订单物料
setInitFormSchema
(()
=>
{
let
origin
=
{...
initFormSchema
}
delete
origin
.
properties
.
NO_SUBMIT_TABS
.
properties
.
payInfo
delete
origin
.
properties
.
NO_SUBMIT_TABS
.
properties
.
orderProduct
origin
.
properties
.
NO_SUBMIT_TABS
.
properties
.
orderMaterial
=
orderMaterial
return
origin
})
}
// 移除采购合同下单栏目 恢复原有
const
removeContractColumn
=
()
=>
{
// 移除订单物料 添加支付信息栏 订单商品栏
setInitFormSchema
(()
=>
{
let
origin
=
{...
initFormSchema
}
origin
.
properties
.
NO_SUBMIT_TABS
.
properties
.
payInfo
=
payInfo
origin
.
properties
.
NO_SUBMIT_TABS
.
properties
.
orderProduct
=
orderProduct
delete
origin
.
properties
.
NO_SUBMIT_TABS
.
properties
.
orderMaterial
return
origin
})
}
return
(
<
PageHeaderWrapper
onBack=
{
()
=>
history
.
goBack
()
}
...
...
@@ -552,19 +583,13 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
state
.
props
.
enum
=
enumList
.
filter
(
item
=>
item
.
type
===
4
&&
item
.
environment
===
1
)
})
}
// 判断合同下单
if
(
value
>
30
)
{
ctx
.
setFieldState
(
'quotationNo'
,
state
=>
{
state
.
props
.
title
=
orderTypeLabelMap
[
value
]
state
.
visible
=
true
})
// 移除支付信息栏 订单商品栏 添加订单物料
setInitFormSchema
(()
=>
{
let
origin
=
{...
initFormSchema
}
delete
origin
.
properties
.
NO_SUBMIT_TABS
.
properties
.
payInfo
delete
origin
.
properties
.
NO_SUBMIT_TABS
.
properties
.
orderProduct
origin
.
properties
.
NO_SUBMIT_TABS
.
properties
.
orderMaterial
=
orderMaterial
return
origin
})
showContractColumn
()
}
else
{
ctx
.
setFieldState
(
'quotationNo'
,
state
=>
{
state
.
props
.
title
=
'对应报价单号'
...
...
@@ -572,14 +597,7 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
ctx
.
setFieldState
(
'payInfo'
,
state
=>
{
state
.
visible
=
true
})
// 移除订单物料 添加支付信息栏 订单商品栏
setInitFormSchema
(()
=>
{
let
origin
=
{...
initFormSchema
}
origin
.
properties
.
NO_SUBMIT_TABS
.
properties
.
payInfo
=
payInfo
origin
.
properties
.
NO_SUBMIT_TABS
.
properties
.
orderProduct
=
orderProduct
delete
origin
.
properties
.
NO_SUBMIT_TABS
.
properties
.
orderMaterial
return
origin
})
removeContractColumn
()
}
}
...
...
@@ -634,6 +652,7 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
value
===
OrderModalType
.
PURCHASE_BIDDING_CONTRACT_ORDER
||
value
===
OrderModalType
.
PURCHASE_TENDER_CONTRACT_ORDER
)
{
// 判断合同下单
setTimeout
(()
=>
{
addSchemaAction
.
setFieldState
(
'orderProductRequests'
,
productState
=>
{
productState
.
props
[
"x-component-props"
]
=
{
...
...
@@ -642,6 +661,7 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
}
})
},
300
)
showContractColumn
()
}
else
{
setTimeout
(()
=>
{
addSchemaAction
.
setFieldState
(
'orderProductRequests'
,
productState
=>
{
...
...
src/pages/transaction/purchaseRules/addRule.tsx
View file @
f562200b
...
...
@@ -29,10 +29,11 @@ const AddRule:React.FC<{}> = (props) => {
const
formSubmit
=
async
(
values
)
=>
{
setIsDisabled
(
true
)
const
params
=
omit
(
values
,
[
'state'
])
// 移除不需要的字段
params
.
processEnum
=
params
.
processEnumId
addSchemaAction
.
getFieldState
(
'processEnumId'
,
state
=>
{
const
process
=
state
.
dataSource
.
filter
(
item
=>
item
.
id
===
params
.
processEnumId
)[
0
]
params
.
type
=
process
.
type
params
.
processEnum
=
process
.
processEnum
params
.
processEnumId
=
process
.
id
})
let
res
:
any
=
{}
...
...
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