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

fix: 处理品类属性价格管理代码合并异常

parent 19f0c420
......@@ -11,7 +11,7 @@ import { FORM_FILTER_PATH } from '@/formSchema/const';
import Search from '@/components/NiceForm/components/Search'
import Submit from '@/components/NiceForm/components/Submit'
import ModalTable from '@/components/ModalTable';
import { getProductCustomerGetCustomerAttribute, postProductCustomerSaveOrUpdateCustomerAttribute } from '@/services/ProductV2Api';
import { getProductCustomerGetCustomerAttribute, getProductPlatformGetAttributeList, postProductCustomerSaveOrUpdateCustomerAttribute } from '@/services/ProductV2Api';
const { Option } = Select;
......@@ -90,7 +90,6 @@ const AddAtttribute: React.FC<{}> = () => {
const fetchData = (params: any) => {
return new Promise((resolve, reject) => {
//@ts-ignore
getProductPlatformGetAttributeList({ ...params, name: params.name || '', groupName: params.groupName || '', isEnable: true }).then(res => {
resolve(res.data)
})
......
......@@ -23,7 +23,7 @@ import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilte
import ModalTable from '@/components/ModalTable'
import { clearModalParams } from '@/utils'
import { useRowSelectionTable } from '@/hooks/useRowSelectionTable'
import { getProductCustomerGetCustomerAttributeList, getProductPlatformGetAttributeList, postProductCustomerDeleteCustomerAttribute, postProductCustomerUpdateCustomerAttributeStatus } from '@/services/ProductV2Api'
import { getProductCustomerGetCustomerAttributeList, getProductPlatformGetAttributeList, postProductCustomerDeleteCustomerAttribute, postProductCustomerSyncAttribute, postProductCustomerUpdateCustomerAttributeStatus } from '@/services/ProductV2Api'
// import styles from './index.less'
const formActions = createFormActions();
......@@ -214,7 +214,6 @@ const Attribute: React.FC<{}> = () => {
const handleAsyncOk = () => {
setSyncLoading(true)
if (rowSelectionCtl.selectedRowKeys.length) {
// @ts-ignore
postProductCustomerSyncAttribute({ idList: rowSelectionCtl.selectedRowKeys }).then(res => {
if (res.code === 1000) {
ref.current.reload()
......
......@@ -21,12 +21,11 @@ import Submit from '@/components/NiceForm/components/Submit'
import { ISchema } from '@formily/antd';
import { clearModalParams } from '@/utils';
import { useRowSelectionTable } from '@/hooks/useRowSelectionTable';
import { getProductCustomerGetCustomerAttributeValueList, getProductPlatformGetSyncAttributeValueList, postProductCustomerDeleteCustomerAttributeValue, postProductCustomerUpdateCustomerAttributeValueStatus } from '@/services/ProductV2Api';
import { getProductCustomerGetCustomerAttributeTree, getProductCustomerGetCustomerAttributeValueList, getProductPlatformGetSyncAttributeValueList, postProductCustomerDeleteCustomerAttributeValue, postProductCustomerUpdateCustomerAttributeValueStatus } from '@/services/ProductV2Api';
const treeActions = createTreeActions()
const fetchAttributeTreeData = async (params?) => {
// @ts-ignore
const res = await getProductCustomerGetCustomerAttributeTree({ filterInput: true })
return res
}
......
......@@ -98,7 +98,7 @@ export const transformParamsForApi = (data: any, ctx: ISchemaFormActions | ISche
let _params: any = {}
_params["name"] = data.name
_params["priceType"] = data.priceType
let shopInfo = ctx.getFieldState("shopId")['values'][1]
let shopInfo = data?.shopId ? { id: data.shopId } : ctx.getFieldState("shopId")['values'][1]
_params["shopId"] = shopInfo["id"]
_params["type"] = shopInfo["type"]
......@@ -131,6 +131,7 @@ export const transformDataForNiceForm = (value: any, ctx: ISchemaFormActions | I
initValue["priceType"] = value.priceType
initValue["productId"] = value.commodity.id
initValue["productName"] = value.commodity.name
initValue["minOrder"] = value.commodity.minOrder
initValue["commodityMemberList"] = value.commodityMemberList.map(item => ({
memberId: item.memberId,
name: item.memberName,
......
......@@ -63,6 +63,7 @@ const PriceSetting: React.FC<PriceSettingProps> = (props) => {
addSchemaAction.setFieldState('commodityMemberList', state => {
state.dataSource = initValue.commodityMemberList
})
addSchemaAction.setFieldValue('minOrder', initValue.minOrder)
})
}
}, [])
......
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