Commit 2dd8df23 authored by 前端-钟卫鹏's avatar 前端-钟卫鹏

fix: 处理采购合同下单编辑异常问题

parent 14ffb8b6
......@@ -8,7 +8,7 @@ export const tableListSchema: ISchema = {
type: 'string',
"x-component": 'SearchFilter',
'x-component-props': {
placeholder: '请输入标编号',
placeholder: '请输入标编号',
align: 'flex-end',
},
},
......
......@@ -90,7 +90,7 @@ const OrderMergeInfo: React.FC<OrderMergeInfoProps> = (props) => {
<Col span={6}>
<MellowCard title='电子合同' fullHeight>
{
data.externalStateName !== '不接受订单' ?
(data.externalStateName !== '不接受订单') || (data.orderModel > 30) ?
<ContractList
dataSource={
data.electronicContractUrl ?
......
......@@ -335,7 +335,7 @@ const OrderProductTable:React.FC<OrderProductTableProps> = ({editable}) => {
dataIndex: 'taxRate',
align: 'center',
key: 'taxRate',
render: (t, r) => `${t}%`
render: (t, r) => t ? `${t}%` : null
},
{
title: creditsCommodity ? '所需积分小计' : '金额',
......@@ -431,7 +431,7 @@ const OrderProductTable:React.FC<OrderProductTableProps> = ({editable}) => {
dataIndex: 'taxRate',
align: 'center',
key: 'taxRate',
render: (t, r) => `${t}%`
render: (t, r) => t ? `${t}%` : null
},
{
title: '金额',
......
......@@ -537,7 +537,7 @@ const SaleOrderProductTable:React.FC<OrderProductTableProps> = (props) => {
dataIndex: 'taxRate',
align: 'center',
key: 'taxRate',
render: (t, r) => `${t}%`
render: (t, r) => t ? `${t}%` : null
},
{
title: '金额',
......
......@@ -34,7 +34,7 @@ export const procurementRenderField = (_orderProductRequests) => {
relevanceProductBrand: item.brand,
relevanceProductCategory: item.category,
logistics: item.logistics.deliveryType,
id: item.materialId,
// id: item.materialId,
code: item.materialCode,
name: item.materialName,
type: item.materialType,
......@@ -62,7 +62,7 @@ export const procurementProcessField = (value) => {
// @todo 后端暂无返回 写死1
minOrder: 1,
// 物料信息
materialId: item.id,
// materialId: item.id,
materialCode: item.code,
materialName: item.name,
materialType: item.type,
......@@ -450,7 +450,7 @@ export const productInfoColumns: any[] = [
dataIndex: 'taxRate',
align: 'center',
key: 'taxRate',
render: (t, r) => `${t}%`
render: (t, r) => t ? `${t}%` : null
},
{
title: '金额',
......@@ -491,6 +491,13 @@ export const materialInfoColumns: any[] = [
className: 'commonHide'
},
{
title: '物料ID',
dataIndex: 'materialId',
align: 'center',
key: 'materialId',
className: 'commonHide'
},
{
title: '物料编号',
dataIndex: 'code',
align: 'center',
......@@ -561,7 +568,7 @@ export const materialInfoColumns: any[] = [
dataIndex: 'taxRate',
align: 'center',
key: 'taxRate',
render: (t, r) => `${t}%`
render: (t, r) => t ? `${t}%` : null
},
{
title: '金额',
......
......@@ -109,6 +109,8 @@ export const useMaterialTable = (ctx: ISchemaFormActions | ISchemaFormAsyncActio
}
const handleSave = row => {
const { pageStatus } = usePageStatus()
return new Promise((resolve, reject) => {
const newData = [...ctx.getFieldValue('orderProductRequests')];
const index = newData.findIndex(item => row.id === item.id);
......@@ -120,7 +122,7 @@ export const useMaterialTable = (ctx: ISchemaFormActions | ISchemaFormAsyncActio
addModel === OrderModalType["HAND_ORDER"] ||
addModel === OrderModalType["CHANNEL_DIRECT_MINING_ORDER"] ||
addModel === OrderModalType["CHANNEL_SPOT_MANUAL_ORDER"]
) ? row.id : row.productId
) && (pageStatus === PageStatus.ADD) ? row.id : row.productId
newData.splice(index, 1, {
...item,
...row,
......
......@@ -169,6 +169,7 @@ export const useProductTable = (ctx: ISchemaFormActions | ISchemaFormAsyncAction
}
const handleSave = row => {
const { pageStatus } = usePageStatus()
// 商品采购数量变动 清空之前的支付信息
if (pageStatus === PageStatus.ADD) {
ctx.setFieldValue('paymentInformationResponses', [])
......@@ -184,7 +185,7 @@ export const useProductTable = (ctx: ISchemaFormActions | ISchemaFormAsyncAction
addModel === OrderModalType["HAND_ORDER"] ||
addModel === OrderModalType["CHANNEL_DIRECT_MINING_ORDER"] ||
addModel === OrderModalType["CHANNEL_SPOT_MANUAL_ORDER"]
) ? row.id : row.productId
) && (pageStatus === PageStatus.ADD) ? row.id : row.productId
newData.splice(index, 1, {
...item,
...row,
......
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