Commit d8ecef5c authored by rainbowmorel@163.com's avatar rainbowmorel@163.com

Merge branch 'v2-220418' into 20418order

parents 48f95e60 0a9abfb2
...@@ -11,13 +11,19 @@ import './index.less'; ...@@ -11,13 +11,19 @@ import './index.less';
interface DraggableHeaderCellProps { interface DraggableHeaderCellProps {
columnIndex: number, columnIndex: number,
className: string, className: string,
/**
* 是否可拖拽
*/
draggable: boolean,
/**
* 是否可改变大小
*/
resizable: boolean,
children?: React.ReactNode, children?: React.ReactNode,
} }
const DraggableHeaderCell: React.FC<DraggableHeaderCellProps> = (props) => { const DraggableHeaderCell: React.FC<DraggableHeaderCellProps> = (props) => {
const { className, children, columnIndex, ...restProps } = props; const { className, children, columnIndex, draggable, resizable, ...restProps } = props;
// console.log('propsprops', props)
const context = React.useContext(SortableContext); const context = React.useContext(SortableContext);
...@@ -26,14 +32,30 @@ const DraggableHeaderCell: React.FC<DraggableHeaderCellProps> = (props) => { ...@@ -26,14 +32,30 @@ const DraggableHeaderCell: React.FC<DraggableHeaderCellProps> = (props) => {
}; };
return ( return (
<th className={classNames(className, 'sortable-header-cell')} {...restProps}> <th
{columnIndex !== undefined ? ( className={classNames(
className,
'sortable-header-cell',
{
'sortable-header-cell__active': draggable,
},
)}
{...restProps}
>
{draggable ? (
<span className={classNames('draggable-header-handle', 'columns-draggable-handle')}> <span className={classNames('draggable-header-handle', 'columns-draggable-handle')}>
<HolderOutlined style={{ color: 'rgba(0, 0, 0, 0.45)' }} /> <HolderOutlined
style={{
color: 'rgba(0, 0, 0, 0.45)',
fontSize: 16,
position: 'relative',
top: -2,
}}
/>
</span> </span>
) : null} ) : null}
{children} {children}
{columnIndex !== undefined ? ( {resizable ? (
<ResizableHandleBar onSlide={handleCellWidthChange} /> <ResizableHandleBar onSlide={handleCellWidthChange} />
) : null} ) : null}
</th> </th>
......
...@@ -4,32 +4,43 @@ ...@@ -4,32 +4,43 @@
.sortable-header-cell { .sortable-header-cell {
cursor: pointer; cursor: pointer;
transition: all .3s; transition: all .3s !important;
position: relative; position: relative;
user-select: none; user-select: none;
overflow: visible; overflow: visible;
&:hover { &__active {
background-color: #EBF9F6; &:hover {
padding-left: @padding-md * 2;
.@{draggable-header-prefix}-handle { background-color: #EBF9F6;
opacity: 1;
} .@{draggable-header-prefix}-handle {
opacity: 1;
.resizable-handle { }
opacity: 1 !important;
.resizable-handle {
opacity: 1 !important;
}
} }
} }
.@{draggable-header-prefix} { .@{draggable-header-prefix} {
&-handle { &-handle {
position: absolute; position: absolute;
top: 50%; top: 0;
left: @margin-xss / 2; left: 0;
bottom: 0;
z-index: 1; z-index: 1;
transform: translateY(-50%); padding: @padding-xs;
display: flex;
align-items: center;
justify-content: center;
opacity: 0; opacity: 0;
cursor: grabbing; cursor: grabbing;
&:hover {
background-color: rgba(255, 0, 0, 0.1);
}
} }
} }
} }
...@@ -19,7 +19,9 @@ const normailizeAdditionalHeaderCell = (dataSource: ColumnType<any>[]) => { ...@@ -19,7 +19,9 @@ const normailizeAdditionalHeaderCell = (dataSource: ColumnType<any>[]) => {
onHeaderCell: () => { onHeaderCell: () => {
return { return {
...(item.onHeaderCell?.(item) || {}), ...(item.onHeaderCell?.(item) || {}),
columnIndex: index !== dataSource.length - 1 ? index : undefined, columnIndex: index,
draggable: !item.fixed,
resizable: index !== dataSource.length - 1,
}; };
}, },
}; };
......
...@@ -73,7 +73,7 @@ export const getSchema = (options: Options) => { ...@@ -73,7 +73,7 @@ export const getSchema = (options: Options) => {
style: { width: '150px' }, style: { width: '150px' },
}, },
}, },
categoryId: { customerCategoryId: {
type: 'string', type: 'string',
'x-component': 'Cascader', 'x-component': 'Cascader',
'x-component-props': { 'x-component-props': {
......
...@@ -62,7 +62,7 @@ function useGetDetailCommon<T extends GetProductGoodsGetGoodsProcessDetailRespon ...@@ -62,7 +62,7 @@ function useGetDetailCommon<T extends GetProductGoodsGetGoodsProcessDetailRespon
}, },
{ {
title: '规格型号', title: '规格型号',
value: 'M20型号' value: initialValue?.type
}, },
{ {
title: '品牌', title: '品牌',
...@@ -74,7 +74,7 @@ function useGetDetailCommon<T extends GetProductGoodsGetGoodsProcessDetailRespon ...@@ -74,7 +74,7 @@ function useGetDetailCommon<T extends GetProductGoodsGetGoodsProcessDetailRespon
}, },
{ {
title: '备注', title: '备注',
value: initialValue?.remark || '' value: initialValue?.remake || ''
}, },
{ {
title: '品类', title: '品类',
...@@ -150,7 +150,7 @@ function useGetDetailCommon<T extends GetProductGoodsGetGoodsProcessDetailRespon ...@@ -150,7 +150,7 @@ function useGetDetailCommon<T extends GetProductGoodsGetGoodsProcessDetailRespon
{ {
title: '附件', title: '附件',
render: (text, record) => { render: (text, record) => {
const value = { name: '设计图纸pdf', url: '' }; const value = { name: record.name, url: record.url };
return ( return (
<FileItem value={value} /> <FileItem value={value} />
) )
...@@ -158,10 +158,10 @@ function useGetDetailCommon<T extends GetProductGoodsGetGoodsProcessDetailRespon ...@@ -158,10 +158,10 @@ function useGetDetailCommon<T extends GetProductGoodsGetGoodsProcessDetailRespon
}, },
{ {
title: '备注', title: '备注',
dataIndex: 'desc' dataIndex: 'description'
} }
] ]
}, [initialValue]) }, [])
/** /**
* 内部单据流转记录 * 内部单据流转记录
......
...@@ -92,7 +92,18 @@ const Add = () => { ...@@ -92,7 +92,18 @@ const Add = () => {
let materialGroups = [] let materialGroups = []
if (data.suitableMaterialType === MATERIAL_ITEM) { if (data.suitableMaterialType === MATERIAL_ITEM) {
const listData = await getProductMaterialProcessPageRelMaterial({ processId: id }) const listData = await getProductMaterialProcessPageRelMaterial({ processId: id })
materials = [...listData.data]; materials = [...listData.data].map((_item) => {
return {
name: _item.materialName,
code: _item?.materialCode || '',
materialGroup: {
name: _item.materialGroupName,
},
id: _item.materialId,
..._item,
}
});
} }
if (data.suitableMaterialType === GROUP) { if (data.suitableMaterialType === GROUP) {
...@@ -129,11 +140,11 @@ const Add = () => { ...@@ -129,11 +140,11 @@ const Add = () => {
} }
}), }),
} }
} else if (values.suitableMaterialType === 2) { } else if (values.suitableMaterialType === 3) {
tempData = { tempData = {
materials: values.materials?.map((_item) => { materials: values.materials?.map((_item) => {
return { return {
materialId: _item, materialId: _item.id,
} }
}) })
} }
......
...@@ -58,19 +58,19 @@ const SelectMaterial: React.FC<Iprops> & { isFieldComponent: boolean} = (props: ...@@ -58,19 +58,19 @@ const SelectMaterial: React.FC<Iprops> & { isFieldComponent: boolean} = (props:
{ {
title: '规格型号', title: '规格型号',
dataIndex: 'type', dataIndex: 'type',
render: (text, record) => { // render: (text, record) => {
const { materialAttributeList } = record; // const { materialAttributeList } = record;
const string = materialAttributeList?.reduce((prev, current) => { // const string = materialAttributeList?.reduce((prev, current) => {
const { customerAttributeValueList } = current; // const { customerAttributeValueList } = current;
const temp = customerAttributeValueList?.map((_item) => { // const temp = customerAttributeValueList?.map((_item) => {
return _item.value // return _item.value
}).join('/'); // }).join('/');
return prev + "/" + temp // return prev + "/" + temp
}, "").slice(1); // }, "").slice(1);
return ( // return (
<div>{string}</div> // <div>{string}</div>
) // )
} // }
}, },
{ {
title: '品类', title: '品类',
......
...@@ -24,6 +24,7 @@ export const schema: ISchema = { ...@@ -24,6 +24,7 @@ export const schema: ISchema = {
{ {
limitByte: true, limitByte: true,
maxByte: 12, maxByte: 12,
allowChineseTransform: false,
} }
] ]
}, },
......
...@@ -210,9 +210,10 @@ const MaterialAdd = (props) => { ...@@ -210,9 +210,10 @@ const MaterialAdd = (props) => {
const toArrayData = Array.isArray(rest[_item]) ? rest[_item] : [rest[_item]] const toArrayData = Array.isArray(rest[_item]) ? rest[_item] : [rest[_item]]
const customerAttributeValueList = toArrayData.map((_row) => { const customerAttributeValueList = toArrayData.map((_row) => {
const splitData = _row?.split("-"); const splitData = _row?.split("-");
const isInput = splitData.length === 1
return { return {
id: splitData[0], id: isInput ? null : splitData[0],
value: splitData[1] value: isInput ? splitData[0] : splitData[1]
} }
}) })
return { return {
...@@ -238,8 +239,7 @@ const MaterialAdd = (props) => { ...@@ -238,8 +239,7 @@ const MaterialAdd = (props) => {
...withMaterialGroup, ...withMaterialGroup,
...withChangeData, ...withChangeData,
} }
console.log(postData) console.log("postData", postData)
// return;
setSubmitLoading(true); setSubmitLoading(true);
const { code, data } = await postProductGoodsSaveOrUpdateGoods(postData); const { code, data } = await postProductGoodsSaveOrUpdateGoods(postData);
setSubmitLoading(false); setSubmitLoading(false);
...@@ -249,12 +249,21 @@ const MaterialAdd = (props) => { ...@@ -249,12 +249,21 @@ const MaterialAdd = (props) => {
history.back(); history.back();
}, 100) }, 100)
} }
console.log("postData", postData) }
const renderTitle = () => {
if (isEdit) {
return '编辑物料'
}
if (isAdd) {
return '新增物料'
}
return '查看物料详情'
} }
return ( return (
<AnchorPage <AnchorPage
title={"新增物料"} title={renderTitle()}
anchors={anchorHeader} anchors={anchorHeader}
extra={ extra={
(isAdd || isEdit) && ( (isAdd || isEdit) && (
...@@ -289,10 +298,17 @@ const MaterialAdd = (props) => { ...@@ -289,10 +298,17 @@ const MaterialAdd = (props) => {
}} }}
effects={($, actions) => { effects={($, actions) => {
useAsyncCascader('category', fetchCategoryData) useAsyncCascader('category', fetchCategoryData)
useAsyncSelect('brandId', fetchBrand, ["name", "id"]) useAsyncSelect('brand', fetchBrand, ["name", "id"])
useAsyncCascader('materialGroup', fetchTreeData); useAsyncCascader('materialGroup', fetchTreeData);
useAsyncSelect('unitId', fetchUnit, ["name", "id"]) useAsyncSelect('unitId', fetchUnit, ["name", "id"])
$('onFieldInputChange', 'category').subscribe((fieldState) => { $('onFormMount').subscribe(() => {
if (isEdit) {
formActions.setFieldState('code', (state) => {
FormPath.setIn(state, 'editable', false);
})
}
})
$('onFieldValueChange', 'category').subscribe((fieldState) => {
if (!fieldState.value || fieldState.value.length === 0) { if (!fieldState.value || fieldState.value.length === 0) {
setSchema( setSchema(
getSchema( getSchema(
...@@ -302,8 +318,6 @@ const MaterialAdd = (props) => { ...@@ -302,8 +318,6 @@ const MaterialAdd = (props) => {
return; return;
} }
const categoryId = [...fieldState.value].pop(); const categoryId = [...fieldState.value].pop();
console.log(categoryId);
getProductCustomerGetCustomerCategoryById({id: categoryId}) getProductCustomerGetCustomerCategoryById({id: categoryId})
.then((data) => { .then((data) => {
console.log(data); console.log(data);
......
...@@ -9,7 +9,7 @@ import { Button, Card, Cascader, message, Modal, Popconfirm, Space, Spin } from ...@@ -9,7 +9,7 @@ import { Button, Card, Cascader, message, Modal, Popconfirm, Space, Spin } from
import { getColumn } from '../common/columns'; import { getColumn } from '../common/columns';
import { createFormActions, Schema } from '@formily/antd'; import { createFormActions, Schema } from '@formily/antd';
import { useRowSelectionTable } from '@/hooks/useRowSelectionTable'; import { useRowSelectionTable } from '@/hooks/useRowSelectionTable';
import { GetProductGoodsGetMaterialListRequest, getProductGoodsGetSubGoodsList, getProductGoodsGetToBeAddGoodsList, postProductGoodsDeleteBatchGoods, postProductGoodsSubmit } from '@/services/ProductV2Api'; import { GetProductGoodsGetMaterialListRequest, getProductGoodsGetSubGoodsList, getProductGoodsGetToBeAddGoodsList, getProductMaterialProcessIsExistMaterialProcess, postProductGoodsDeleteBatchGoods, postProductGoodsSubmit } from '@/services/ProductV2Api';
import { SearchParams } from '../materialQuery'; import { SearchParams } from '../materialQuery';
import { EMPTY, fetchBrand, fetchCategoryData, fetchTreeData, useAsyncCascader } from '../common/useGetTableSearchData'; import { EMPTY, fetchBrand, fetchCategoryData, fetchTreeData, useAsyncCascader } from '../common/useGetTableSearchData';
import { useAsyncSelect } from '@/formSchema/effects/useAsyncSelect'; import { useAsyncSelect } from '@/formSchema/effects/useAsyncSelect';
...@@ -43,19 +43,37 @@ const MaterialQuery = () => { ...@@ -43,19 +43,37 @@ const MaterialQuery = () => {
const handleSubmit = async (_row) => { const handleSubmit = async (_row) => {
setIsLoading((prev) => prev.concat(_row.id)) setIsLoading((prev) => prev.concat(_row.id))
const { data, code } = await postProductGoodsSubmit({ id: _row.id }); try {
setIsLoading((prev) => prev.filter((_item) => _item !== _row.id)) const materialGroupId = _row.materialGroup?.id
if (code === 1000) { ? { materialGroupId: _row.materialGroup?.id }
formActions.submit(); : {}
} else if (code === 43149) { const processRes = await getProductMaterialProcessIsExistMaterialProcess({
Modal.warning({ materialId: _row.id,
title: '提交提醒', processType: _row.interiorState === 1 ? `1` : `2`,
content: `当前还未创建审核工作流, 请在物料审核流程规则配置设置`, ...materialGroupId,
onOk() { } as any)
console.log('OK');
}, if (processRes.code !== 1000 || !processRes.data) {
}); Modal.warning({
title: '提交提醒',
content: (
<div>当前还未创建审核工作流, 请在<a target={"_blank"} href={`/memberCenter/commodityAbility/material/materialAuditProcessConfig`}>物料审核流程规则配置</a>设置</div>
),
onOk() {
console.log('OK');
},
});
return;
}
const { data, code } = await postProductGoodsSubmit({ id: _row.id });
if (code === 1000) {
formActions.submit();
}
} catch(e) {}
finally {
setIsLoading((prev) => prev.filter((_item) => _item !== _row.id))
} }
} }
const columns = getColumn({ const columns = getColumn({
...@@ -161,11 +179,17 @@ const MaterialQuery = () => { ...@@ -161,11 +179,17 @@ const MaterialQuery = () => {
} }
const handleSearch = (values: SearchParams) => { const handleSearch = (values: SearchParams) => {
const formatMaterialGroupId = values.materialGroupId && values.materialGroupId.length > 0 const { materialGroupId, customerCategoryId, ...rest } = values;
? { materialGroupId: values.materialGroupId?.pop() }
const formatMaterialGroupId = materialGroupId && materialGroupId.length > 0
? { materialGroupId: materialGroupId?.pop() }
: { }
const formatCategoryId = customerCategoryId && customerCategoryId.length > 0
? { customerCategoryId: customerCategoryId?.pop() }
: { } : { }
const result = { ...values, ...formatMaterialGroupId } const result = { ...rest, ...formatMaterialGroupId, ...formatCategoryId }
ref.current.reload(result) ref.current.reload(result)
}; };
...@@ -210,6 +234,7 @@ const MaterialQuery = () => { ...@@ -210,6 +234,7 @@ const MaterialQuery = () => {
unitId: target.unitId, unitId: target.unitId,
name: target.name, name: target.name,
goodsId: target.id, goodsId: target.id,
type: target.type,
} }
} }
}) })
......
...@@ -44,11 +44,26 @@ export const getSchema = (schema: ISchema): ISchema => { ...@@ -44,11 +44,26 @@ export const getSchema = (schema: ISchema): ISchema => {
{ {
limitByte: true, limitByte: true,
maxByte: 20, maxByte: 20,
allowChineseTransform: false
}, },
{ {
pattern: /(?=.*[0-9])(?=.*[~!@#$%^&*()_+`\-={}:";'<>?,.\/])(?=.*[a-zA-Z])/, pattern: /(?=.*[0-9])(?=.*[~!@#$%^&*()_+`\-={}:";'<>?,.\/])(?=.*[a-zA-Z])/,
message: '编号由英文(不分大小写)、数字、特殊字符组成' message: '编号由英文(不分大小写)、数字、特殊字符组成'
} },
]
},
type: {
title: '规格型号',
type: 'string',
'x-rules': [
{
required: true,
message: '请填写规格型号'
},
{
limitByte: true,
maxByte: 24,
},
] ]
}, },
unitId: { unitId: {
...@@ -217,6 +232,10 @@ export const getSchema = (schema: ISchema): ISchema => { ...@@ -217,6 +232,10 @@ export const getSchema = (schema: ISchema): ISchema => {
{ {
required: true, required: true,
message: '请填写备注', message: '请填写备注',
},
{
limitByte: true,
maxByte: 200,
} }
] ]
} }
...@@ -253,7 +272,13 @@ export const getSchema = (schema: ISchema): ISchema => { ...@@ -253,7 +272,13 @@ export const getSchema = (schema: ISchema): ISchema => {
properties: { properties: {
changeRemark: { changeRemark: {
title: '变更内容', title: '变更内容',
type: 'textarea' type: 'textarea',
'x-rules': [
{
limitByte: true,
maxByte: 200,
}
]
} }
} }
}, },
...@@ -351,7 +376,7 @@ export const propsCardSchema = (schema: ISchema): ISchema => { ...@@ -351,7 +376,7 @@ export const propsCardSchema = (schema: ISchema): ISchema => {
"x-component": 'MellowCard', "x-component": 'MellowCard',
"x-component-props": { "x-component-props": {
id: 'type', id: 'type',
title: '规格型号' title: '属性'
}, },
properties: { properties: {
layout: { layout: {
......
...@@ -12,6 +12,8 @@ type Options = { ...@@ -12,6 +12,8 @@ type Options = {
memberRoleId: number, memberRoleId: number,
unitId: string, unitId: string,
name: string name: string
/** 规格 */
type: string
} }
}, },
query?: { query?: {
...@@ -49,6 +51,14 @@ function useInitialValue(options: Options) { ...@@ -49,6 +51,14 @@ function useInitialValue(options: Options) {
return null return null
} }
const category = initialValue.customerCategory?.fullId?.split('.').map((_item) => _item.replace(/0+/, "")); const category = initialValue.customerCategory?.fullId?.split('.').map((_item) => _item.replace(/0+/, ""));
const customerAttribute = {};
initialValue?.materialAttributeList.forEach((_item) => {
/** 1-单选、2-多选、3-输入 */
const isInput = _item.customerAttributeValueList?.[0]?.type === 3;
const res = isInput ? `${ _item.customerAttributeValueList?.[0]?.value}` : `${_item.customerAttributeValueList?.[0]?.id}-${ _item.customerAttributeValueList?.[0]?.value}`
customerAttribute[`customerAttribute-${_item.customerAttribute.id}`] = res;
})
return { return {
...initialValue, ...initialValue,
brand: initialValue?.brand?.id, brand: initialValue?.brand?.id,
...@@ -63,7 +73,9 @@ function useInitialValue(options: Options) { ...@@ -63,7 +73,9 @@ function useInitialValue(options: Options) {
goodsPic: initialValue.goodsPic?.map((_item) => ({ goodsPic: initialValue.goodsPic?.map((_item) => ({
name: _item, name: _item,
url: _item, url: _item,
})) })),
remark: initialValue?.remake,
...customerAttribute,
} }
}, [initialValue]) }, [initialValue])
......
...@@ -77,11 +77,16 @@ const MaterialQuery = () => { ...@@ -77,11 +77,16 @@ const MaterialQuery = () => {
} }
const handleSearch = (values: any) => { const handleSearch = (values: any) => {
const formatMaterialGroupId = values.materialGroupId && values.materialGroupId.length > 0 const { materialGroupId, customerCategoryId, ...rest } = values;
? { materialGroupId: values.materialGroupId?.pop() } const formatMaterialGroupId = materialGroupId && materialGroupId.length > 0
? { materialGroupId: materialGroupId?.pop() }
: { }
const formatCategoryId = customerCategoryId && customerCategoryId.length > 0
? { customerCategoryId: customerCategoryId?.pop() }
: { } : { }
const result = { ...values, ...formatMaterialGroupId } const result = { ...rest, ...formatMaterialGroupId, ...formatCategoryId }
ref.current.reload(result) ref.current.reload(result)
}; };
...@@ -99,7 +104,7 @@ const MaterialQuery = () => { ...@@ -99,7 +104,7 @@ const MaterialQuery = () => {
return ( return (
<PageHeaderWrapper <PageHeaderWrapper
title={"物料"} title={"待审核变更一级"}
> >
<Card> <Card>
<StandardTable <StandardTable
...@@ -120,7 +125,7 @@ const MaterialQuery = () => { ...@@ -120,7 +125,7 @@ const MaterialQuery = () => {
effects={($, actions) => { effects={($, actions) => {
useStateFilterSearchLinkageEffect($, actions, 'code', FORM_FILTER_PATH); useStateFilterSearchLinkageEffect($, actions, 'code', FORM_FILTER_PATH);
useAsyncCascader('materialGroupId', fetchTreeData) useAsyncCascader('materialGroupId', fetchTreeData)
useAsyncCascader('categoryId', fetchCategoryData) useAsyncCascader('customerCategoryId', fetchCategoryData)
useAsyncSelect('brandId', fetchBrand, ["name", "id"]) useAsyncSelect('brandId', fetchBrand, ["name", "id"])
}} }}
/> />
......
...@@ -79,11 +79,16 @@ const MaterialQuery = () => { ...@@ -79,11 +79,16 @@ const MaterialQuery = () => {
} }
const handleSearch = (values: any) => { const handleSearch = (values: any) => {
const formatMaterialGroupId = values.materialGroupId && values.materialGroupId.length > 0 const { materialGroupId, customerCategoryId, ...rest } = values;
? { materialGroupId: values.materialGroupId?.pop() } const formatMaterialGroupId = materialGroupId && materialGroupId.length > 0
? { materialGroupId: materialGroupId?.pop() }
: { } : { }
const result = { ...values, ...formatMaterialGroupId } const formatCategoryId = customerCategoryId && customerCategoryId.length > 0
? { customerCategoryId: customerCategoryId?.pop() }
: { }
const result = { ...rest, ...formatMaterialGroupId, ...formatCategoryId }
ref.current.reload(result) ref.current.reload(result)
}; };
...@@ -101,7 +106,7 @@ const MaterialQuery = () => { ...@@ -101,7 +106,7 @@ const MaterialQuery = () => {
return ( return (
<PageHeaderWrapper <PageHeaderWrapper
title={"物料"} title={"待审核变更二级"}
> >
<Card> <Card>
<StandardTable <StandardTable
...@@ -122,7 +127,7 @@ const MaterialQuery = () => { ...@@ -122,7 +127,7 @@ const MaterialQuery = () => {
effects={($, actions) => { effects={($, actions) => {
useStateFilterSearchLinkageEffect($, actions, 'code', FORM_FILTER_PATH); useStateFilterSearchLinkageEffect($, actions, 'code', FORM_FILTER_PATH);
useAsyncCascader('materialGroupId', fetchTreeData) useAsyncCascader('materialGroupId', fetchTreeData)
useAsyncCascader('categoryId', fetchCategoryData) useAsyncCascader('customerCategoryId', fetchCategoryData)
useAsyncSelect('brandId', fetchBrand, ["name", "id"]) useAsyncSelect('brandId', fetchBrand, ["name", "id"])
}} }}
/> />
......
...@@ -77,11 +77,17 @@ const MaterialQuery = () => { ...@@ -77,11 +77,17 @@ const MaterialQuery = () => {
} }
const handleSearch = (values: any) => { const handleSearch = (values: any) => {
const formatMaterialGroupId = values.materialGroupId && values.materialGroupId.length > 0 const { materialGroupId, customerCategoryId, ...rest } = values;
? { materialGroupId: values.materialGroupId?.pop() }
const formatMaterialGroupId = materialGroupId && materialGroupId.length > 0
? { materialGroupId: materialGroupId?.pop() }
: { }
const formatCategoryId = customerCategoryId && customerCategoryId.length > 0
? { customerCategoryId: customerCategoryId?.pop() }
: { } : { }
const result = { ...values, ...formatMaterialGroupId } const result = { ...rest, ...formatMaterialGroupId, ...formatCategoryId }
ref.current.reload(result) ref.current.reload(result)
}; };
...@@ -99,7 +105,7 @@ const MaterialQuery = () => { ...@@ -99,7 +105,7 @@ const MaterialQuery = () => {
return ( return (
<PageHeaderWrapper <PageHeaderWrapper
title={"物料"} title={"待审核一级"}
> >
<Card> <Card>
<StandardTable <StandardTable
...@@ -120,7 +126,7 @@ const MaterialQuery = () => { ...@@ -120,7 +126,7 @@ const MaterialQuery = () => {
effects={($, actions) => { effects={($, actions) => {
useStateFilterSearchLinkageEffect($, actions, 'code', FORM_FILTER_PATH); useStateFilterSearchLinkageEffect($, actions, 'code', FORM_FILTER_PATH);
useAsyncCascader('materialGroupId', fetchTreeData) useAsyncCascader('materialGroupId', fetchTreeData)
useAsyncCascader('categoryId', fetchCategoryData) useAsyncCascader('customerCategoryId', fetchCategoryData)
useAsyncSelect('brandId', fetchBrand, ["name", "id"]) useAsyncSelect('brandId', fetchBrand, ["name", "id"])
}} }}
/> />
......
...@@ -77,11 +77,17 @@ const MaterialQuery = () => { ...@@ -77,11 +77,17 @@ const MaterialQuery = () => {
} }
const handleSearch = (values: any) => { const handleSearch = (values: any) => {
const formatMaterialGroupId = values.materialGroupId && values.materialGroupId.length > 0 const { materialGroupId, customerCategoryId, ...rest } = values;
? { materialGroupId: values.materialGroupId?.pop() }
const formatMaterialGroupId = materialGroupId && materialGroupId.length > 0
? { materialGroupId: materialGroupId?.pop() }
: { }
const formatCategoryId = customerCategoryId && customerCategoryId.length > 0
? { customerCategoryId: customerCategoryId?.pop() }
: { } : { }
const result = { ...values, ...formatMaterialGroupId } const result = { ...rest, ...formatMaterialGroupId, ...formatCategoryId }
ref.current.reload(result) ref.current.reload(result)
}; };
...@@ -99,7 +105,7 @@ const MaterialQuery = () => { ...@@ -99,7 +105,7 @@ const MaterialQuery = () => {
return ( return (
<PageHeaderWrapper <PageHeaderWrapper
title={"物料"} title={"待审核二级"}
> >
<Card> <Card>
<StandardTable <StandardTable
...@@ -120,7 +126,7 @@ const MaterialQuery = () => { ...@@ -120,7 +126,7 @@ const MaterialQuery = () => {
effects={($, actions) => { effects={($, actions) => {
useStateFilterSearchLinkageEffect($, actions, 'code', FORM_FILTER_PATH); useStateFilterSearchLinkageEffect($, actions, 'code', FORM_FILTER_PATH);
useAsyncCascader('materialGroupId', fetchTreeData) useAsyncCascader('materialGroupId', fetchTreeData)
useAsyncCascader('categoryId', fetchCategoryData) useAsyncCascader('customerCategoryId', fetchCategoryData)
useAsyncSelect('brandId', fetchBrand, ["name", "id"]) useAsyncSelect('brandId', fetchBrand, ["name", "id"])
}} }}
/> />
......
...@@ -25,7 +25,8 @@ const querySchema = getSchema({ showStatus: true }); ...@@ -25,7 +25,8 @@ const querySchema = getSchema({ showStatus: true });
export type SearchParams = Omit<GetProductGoodsGetMaterialListRequest, 'materialGroupId'> & { export type SearchParams = Omit<GetProductGoodsGetMaterialListRequest, 'materialGroupId'> & {
materialGroupId: string[], materialGroupId: string[],
status: string | number status: string | number,
customerCategoryId: string[],
} }
const URL_PREFIX = '/memberCenter/commodityAbility/material' const URL_PREFIX = '/memberCenter/commodityAbility/material'
...@@ -195,12 +196,17 @@ const MaterialQuery = () => { ...@@ -195,12 +196,17 @@ const MaterialQuery = () => {
} }
const handleSearch = (values: SearchParams) => { const handleSearch = (values: SearchParams) => {
const formatMaterialGroupId = values.materialGroupId && values.materialGroupId.length > 0 const { materialGroupId, customerCategoryId, status, ...rest } = values;
? { materialGroupId: values.materialGroupId?.pop() } const formatMaterialGroupId = materialGroupId && materialGroupId.length > 0
? { materialGroupId: materialGroupId?.pop() }
: { }
const formatCategoryId = customerCategoryId && customerCategoryId.length > 0
? { customerCategoryId: customerCategoryId?.pop() }
: { } : { }
const formatStatus = values.status ? { ids:[values.status] } : {} const formatStatus = values.status ? { ids:[values.status] } : {}
const result = { ...values, ...formatMaterialGroupId, ...formatStatus } const result = { ...rest, ...formatMaterialGroupId, ...formatStatus, ...formatCategoryId }
ref.current.reload(result) ref.current.reload(result)
}; };
...@@ -247,7 +253,7 @@ const MaterialQuery = () => { ...@@ -247,7 +253,7 @@ const MaterialQuery = () => {
effects={($, actions) => { effects={($, actions) => {
useStateFilterSearchLinkageEffect($, actions, 'code', FORM_FILTER_PATH); useStateFilterSearchLinkageEffect($, actions, 'code', FORM_FILTER_PATH);
useAsyncCascader('materialGroupId', fetchTreeData) useAsyncCascader('materialGroupId', fetchTreeData)
useAsyncCascader('categoryId', fetchCategoryData) useAsyncCascader('customerCategoryId', fetchCategoryData)
useAsyncSelect('brandId', fetchBrand, ["name", "id"]) useAsyncSelect('brandId', fetchBrand, ["name", "id"])
useAsyncSelect('status', fetchStatus, ["name", "status"]) useAsyncSelect('status', fetchStatus, ["name", "status"])
}} }}
......
...@@ -74,7 +74,7 @@ const SourceList = () => { ...@@ -74,7 +74,7 @@ const SourceList = () => {
const renderAddition = () => ( const renderAddition = () => (
<div className={styles.addition} onClick={handleOpenModal}> <div className={styles.addition} onClick={handleOpenModal}>
<PlusOutlined /> <PlusOutlined />
<span className={styles.text}>新增附件信息</span> <span className={styles.text}>编辑供应商</span>
</div> </div>
) )
......
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