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

fix:商品渠道商品字段变更

parent cdc196fd
...@@ -229,12 +229,12 @@ const BasicInfoForm: React.FC<Iprops> = (props) => { ...@@ -229,12 +229,12 @@ const BasicInfoForm: React.FC<Iprops> = (props) => {
<Form.Item <Form.Item
name="brandId" name="brandId"
label="商品品牌" label="商品品牌"
rules={[ // rules={[
{ // {
required: true, // required: true,
message: '请选择商品品牌' // message: '请选择商品品牌'
} // }
]} // ]}
> >
<Select <Select
disabled={!isUpdateAttribute} disabled={!isUpdateAttribute}
......
...@@ -38,12 +38,14 @@ interface Item { ...@@ -38,12 +38,14 @@ interface Item {
interface paramItem { interface paramItem {
name: string; name: string;
code: string; code: string;
priceType: number; priceType?: number;
priceTypeList: number[];
min: number; min: number;
max: number; max: number;
brandId: number; brandId: number;
customerCategoryId: number; customerCategoryId: number;
status: number; status?: number;
statusList: number[];
} }
let timeChange: any; let timeChange: any;
...@@ -69,11 +71,13 @@ const Products: React.FC<{}> = () => { ...@@ -69,11 +71,13 @@ const Products: React.FC<{}> = () => {
name: '', name: '',
code: '', code: '',
priceType: null, priceType: null,
priceTypeList: null,
min: null, min: null,
max: null, max: null,
brandId: 0, brandId: 0,
customerCategoryId: 0, customerCategoryId: 0,
status: null, status: null,
statusList: null,
}) })
const [brandData, setBrandData] = useState<any>([]) const [brandData, setBrandData] = useState<any>([])
const [brandValue, setBrandValue] = useState(undefined) const [brandValue, setBrandValue] = useState(undefined)
...@@ -245,7 +249,6 @@ const Products: React.FC<{}> = () => { ...@@ -245,7 +249,6 @@ const Products: React.FC<{}> = () => {
} }
const fetchData = (params: any) => { const fetchData = (params: any) => {
console.log(params, filterParams)
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
PublicApi.getProductCommodityGetCommodityList({ ...filterParams, ...params}).then(res => { PublicApi.getProductCommodityGetCommodityList({ ...filterParams, ...params}).then(res => {
console.log(res, 'res') console.log(res, 'res')
...@@ -256,7 +259,6 @@ const Products: React.FC<{}> = () => { ...@@ -256,7 +259,6 @@ const Products: React.FC<{}> = () => {
} }
const handleSee = (record: any) => { const handleSee = (record: any) => {
console.log('see')
history.push(`/memberCenter/commodityAbility/commodity/products/viewProducts?id=${record.id}`) history.push(`/memberCenter/commodityAbility/commodity/products/viewProducts?id=${record.id}`)
} }
...@@ -562,7 +564,7 @@ const Products: React.FC<{}> = () => { ...@@ -562,7 +564,7 @@ const Products: React.FC<{}> = () => {
} }
const handleReset = () => { const handleReset = () => {
let restObj = { name: '', code: '', max: null, min: null, priceType: null, brandId: 0, customerCategoryId: 0, status: null } let restObj = { name: '', code: '', max: null, min: null, priceType: null, priceTypeList: null, brandId: 0, customerCategoryId: 0, status: null, statusList: null }
setFilterParams(restObj) setFilterParams(restObj)
setBrandValue(undefined) setBrandValue(undefined)
setClassValue(undefined) setClassValue(undefined)
...@@ -596,8 +598,12 @@ const Products: React.FC<{}> = () => { ...@@ -596,8 +598,12 @@ const Products: React.FC<{}> = () => {
} }
const handleSearch = (val?: string) => { const handleSearch = (val?: string) => {
console.log(val) let _params: any = { ...filterParams }
let obj = val ? {...filterParams, name: val} : { ...filterParams } if(_params.priceType)
_params.priceTypeList = [_params.priceType]
if(_params.status)
_params.statusList = [_params.status]
let obj = val ? {..._params, name: val} : { ..._params }
setFilterParams(obj) setFilterParams(obj)
ref.current.reload(obj) ref.current.reload(obj)
} }
......
...@@ -232,21 +232,21 @@ export const addChannelSchema: ISchema = { ...@@ -232,21 +232,21 @@ export const addChannelSchema: ISchema = {
}, },
}, },
properties: { properties: {
categoryId: { customerCategoryName: {
type: 'string', type: 'string',
"x-component": 'SearchSelect', // "x-component": 'SearchSelect',
"x-component-props": { "x-component-props": {
placeholder: '请选择品类', placeholder: '请输入品类',
className: 'fixed-ant-selected-down', // className: 'fixed-ant-selected-down',
fetchSearch: PublicApi.getProductSelectGetSelectCategory, // fetchSearch: PublicApi.getProductSelectGetSelectCategory,
} }
}, },
brandId: { brandName: {
type: 'string', type: 'string',
"x-component": 'SearchSelect', // "x-component": 'SearchSelect',
"x-component-props": { "x-component-props": {
placeholder: '请选择品牌', placeholder: '请输入品牌',
fetchSearch: PublicApi.getProductSelectGetSelectBrand, // fetchSearch: PublicApi.getProductSelectGetSelectBrand,
} }
}, },
parentMemberId: { parentMemberId: {
......
...@@ -83,7 +83,7 @@ baseRequest.interceptors.request.use((url: string, options: RequestOptionsInit): ...@@ -83,7 +83,7 @@ baseRequest.interceptors.request.use((url: string, options: RequestOptionsInit):
} }
options.paramsSerializer = params => { options.paramsSerializer = params => {
return qs.stringify(params, { arrayFormat: 'brackets' }) return qs.stringify(params, { arrayFormat: 'indices' })
} }
return { return {
// 前缀如果已经带上api, 跳过自动补前缀 // 前缀如果已经带上api, 跳过自动补前缀
......
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