Commit 3d7ebf5e authored by shenshaokai's avatar shenshaokai

Merge branch 'jinfa-20221102' into 'jinfa-20221102'

fix: bugID=35688 框架合同支持修改采购数量 See merge request project/jinfa-platform!475
parents 7fe013a8 f13e9931
......@@ -245,7 +245,7 @@ const PurchaseOrderDetail: React.FC<PurchaseOrderDetailProps> = (props) => {
: materialColumns
productState.props["x-component-props"] = {
...productState.props["x-component-props"],
columns,
// columns,
scroll: { x: columns.reduce((total, current) => total += current.width, 0) },
// prefix: productState.editable && pageStatus === PageStatus.ADD ? materialAddButton : '',
prefix: materialAddButton,
......
......@@ -25,7 +25,7 @@ export const sortByKey = (params) => {
export const getUnitPriceTotal = (record) => {
const purchaseCount = Number(record['quantity']) || 0
return math('round', Number((record.price * purchaseCount)),2)
return math('round', Number((record.price * purchaseCount)), 2)
}
/**
......@@ -57,24 +57,12 @@ export const useMaterialTable = (
onDeleteRecord?.(record)
}
const materialColumns = useMemo(() => {
const { pageStatus } = usePageStatus()
// const { pageStatus } = usePageStatus()
const tempColumn = [...(
orderMode === OrderModalType.PURCHASE_REQUISITION_CONTRACT_ORDER
? materialInfoColumnsByRequisition
: materialInfoColumns.map(val => {
if (val.key === 'quantity') {
// //采购询价合同、框架都能改 其他不能都不能改(这个在弹窗里面输入数量了)
return {
...val,
editable: orderMode === OrderModalType.PURCHASE_ENQUIRY_CONTRACT_ORDER || orderMode === OrderModalType.FRAME_CONTRACT_ORDER ,
}
}
return val
})
: materialInfoColumns
)]
// if (pageStatus === PageStatus.ADD) {
// 渲染操作
......@@ -96,7 +84,7 @@ export const useMaterialTable = (
)
}
return tempColumn
},[orderMode])
}, [orderMode])
const handleShowMaterial = () => {
const supplyMembersId = ctx.getFieldValue('vendorMemberId')
const products = ctx.getFieldValue('products')
......@@ -192,7 +180,7 @@ export const useMaterialTable = (
if (!col.editable) {
return col;
}
if(orderMode === OrderModalType.PURCHASE_REQUISITION_CONTRACT_ORDER && col?.dataIndex === 'quantity') {
if (![OrderModalType.FRAME_CONTRACT_ORDER, OrderModalType.PURCHASE_ENQUIRY_CONTRACT_ORDER].includes(Number(orderMode)) && col?.dataIndex === 'quantity') {
return col
}
return {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment