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

fix:处理新增采购订单采购数量变动清空原有支付信息

parent 93d8fd62
......@@ -77,8 +77,8 @@ const AddBrand: React.FC<{}> = () => {
setFormValues(data)
form.setFieldsValue(data)
setlogoUrl(data.logoUrl)
if(data.status === 4)
setBanSomeField(true)
// if(data.status === 4)
// setBanSomeField(true)
// 多图回显
let proveImgs = Object.values(data.proveUrl)
let files = [];
......
......@@ -8,7 +8,6 @@ import { useUpdate } from '@umijs/hooks';
import { PublicApi } from '@/services/api';
import { filterProductDataById } from '../components/productModalTable'
import { getUnitPriceTotal } from '../model/useProductTable';
import { toPercent } from '@/utils/type';
// 异步填充表格字段
const asyncPadDataForProduct = async (ctx: ISchemaFormActions | ISchemaFormAsyncActions, productValue: any) => {
......@@ -86,7 +85,7 @@ export const useEditHideField = () => {
})
}
export const useProductTableChangeForPay = (ctx: ISchemaFormActions | ISchemaFormAsyncActions, update, editData) => {
export const useProductTableChangeForPay = (ctx: ISchemaFormActions | ISchemaFormAsyncActions, update) => {
const { pageStatus } = usePageStatus()
FormEffectHooks.onFieldValueChange$('orderProductRequests').subscribe(state => {
......@@ -157,7 +156,6 @@ export const useOrderFormInitEffect = (ctx: ISchemaFormActions | ISchemaFormAsyn
// }
return assign
}).sort((prev, next) => prev.disabled ? prev.value : next.value - prev.value)
console.log(state.props.enum)
})
......
......@@ -5,7 +5,7 @@ import ReutrnEle from '@/components/ReturnEle'
import { usePageStatus, PageStatus } from '@/hooks/usePageStatus'
import { Button, Card, Row, Col, Drawer, message } from 'antd'
import { createFormActions, registerVirtualBox, useFormSpy, createAsyncFormActions } from '@formily/antd'
import { SaveOutlined, LinkOutlined, PlusOutlined } from '@ant-design/icons'
import { SaveOutlined, LinkOutlined, PlusOutlined, CodeSandboxCircleFilled } from '@ant-design/icons'
import NiceForm from '@/components/NiceForm'
import { orderDetailSchema, orderAddSchema, mergeAllSchemas } from './schema'
import { useModelTypeChange, useEditHideField, useOrderFormInitEffect, useProductTableChangeForPay } from './effects'
......@@ -30,7 +30,6 @@ import { changeRouterTitleByStatus } from '../../_public/order/utils'
import { ReadyAddOrderDetailContext } from '../context'
import AuditProcess from '@/components/AuditProcess'
import styles from './index.less'
import { toPoint } from '@/utils/type'
export interface PurchaseOrderDetailProps {}
......@@ -208,7 +207,6 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
// theInvoiceInfo: (value.typeof value.theInvoiceId === 'object' ? value.theInvoiceId : null
// theInvoiceInfo: value.theInvoiceInfo
}
console.log(params, 'params')
// 校验是否选择支付渠道
let judgementByPay = params.paymentInformationResponses.map(item => {
if(item.channel && item.payWay){
......@@ -244,7 +242,6 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
break;
}
}
console.log(fnResult, 'fnResult')
if (fnResult.code === 1000) {
// 跳转至待新增列表
window.sessionStorage.removeItem(spam_id)
......@@ -379,7 +376,6 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
// }
})
}
console.log(initFormValue, 'init')
})
// 监听商品总价的变更, 此处逻辑需优化
$('sumPrice').subscribe(payload => {
......@@ -452,7 +448,7 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
})
useEditHideField()
// 商品信息的改动 驱动支付信息变化
useProductTableChangeForPay(ctx, update, initFormValue)
useProductTableChangeForPay(ctx, update)
}}
expressionScope={{
orderNoPrice,
......
......@@ -5,7 +5,6 @@ import { productInfoColumns } from '../constant';
import ProductTableCell, { ProductEditableRow } from '../components/productTableCell';
import { useModalTable } from './useModalTable';
import { usePageStatus, PageStatus } from '@/hooks/usePageStatus';
import { toPoint } from '@/utils/type';
// 对象按key排序(运用于商城传过来的阶梯价格排序)
export const sortByKey = (params) => {
......@@ -100,6 +99,9 @@ export const useProductTable = (ctx: ISchemaFormActions | ISchemaFormAsyncAction
}
const handleSave = row => {
// 商品采购数量变动 清空之前的支付信息
ctx.setFieldValue('paymentInformationResponses', [])
return new Promise((resolve, reject) => {
const newData = [...ctx.getFieldValue('orderProductRequests')];
const index = newData.findIndex(item => row.id === item.id);
......
......@@ -321,6 +321,9 @@ const RuleSetting:React.FC<RuleSettingProps> = (props) => {
visible={visibleChannelRroduct}
columns={columnsSetProduct}
rowSelection={productRowSelection}
resetModal={{
destroyOnClose: true
}}
fetchTableData={params => fetchProductList(params)}
formilyProps={
{
......
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