Commit da376f14 authored by Bill's avatar Bill

Merge branch 'fix-home-auth' into 'v2-220418'

fix: 采购选品修改参考品牌 See merge request linkseeks-design/pro-platform!253
parents b88802ea c7aaf418
...@@ -68,6 +68,8 @@ const MaterialAdd = (props) => { ...@@ -68,6 +68,8 @@ const MaterialAdd = (props) => {
formActions.setFieldState('sourceListCard', (state) => { formActions.setFieldState('sourceListCard', (state) => {
FormPath.setIn(state, 'visible', true); FormPath.setIn(state, 'visible', true);
}) })
console.log(state.dataSource)
if (!state.dataSource) { if (!state.dataSource) {
message.error(intl.formatMessage({ id: 'material.should.select.purchaseSelection', defaultMessage: '请选择采购选品'})); message.error(intl.formatMessage({ id: 'material.should.select.purchaseSelection', defaultMessage: '请选择采购选品'}));
} }
...@@ -135,6 +137,17 @@ const MaterialAdd = (props) => { ...@@ -135,6 +137,17 @@ const MaterialAdd = (props) => {
</UploadFiles> </UploadFiles>
) )
const createDescriptionElement = () => {
return {
desc() {
if (query?.type !== 'sourceData' ) {
return null;
}
return React.createElement('div', { className: styles['label-required'] }, `参考品牌: ${state.dataSource?.referenceBrand}`);
}
}
};
const handleSubmit = async (value) => { const handleSubmit = async (value) => {
console.log("values", value); console.log("values", value);
const { const {
...@@ -299,7 +312,8 @@ const MaterialAdd = (props) => { ...@@ -299,7 +312,8 @@ const MaterialAdd = (props) => {
// renderListTableRemove: renderListTableRemove, // renderListTableRemove: renderListTableRemove,
renderAddition: renderAddition(), renderAddition: renderAddition(),
uploadContainer: uploadContainer, uploadContainer: uploadContainer,
customizeFileItemRender: customizeFileItemRender customizeFileItemRender: customizeFileItemRender,
...createDescriptionElement(),
}} }}
effects={($, actions) => { effects={($, actions) => {
useAsyncCascader('category', fetchCategoryData) useAsyncCascader('category', fetchCategoryData)
......
...@@ -264,7 +264,7 @@ const MaterialQuery = () => { ...@@ -264,7 +264,7 @@ const MaterialQuery = () => {
name: target.name, name: target.name,
goodsId: target.id, goodsId: target.id,
type: target.type, type: target.type,
brand: target.brand?.name, referenceBrand: target.brand?.name,
goodsPic: target.goodsPic?.map((_item) => { goodsPic: target.goodsPic?.map((_item) => {
return { return {
name: _item, name: _item,
...@@ -288,6 +288,7 @@ const MaterialQuery = () => { ...@@ -288,6 +288,7 @@ const MaterialQuery = () => {
// rowSelection: selectRow // rowSelection: selectRow
rowSelection: selectRow rowSelection: selectRow
}} }}
keepAlive={false}
columns={columns} columns={columns}
currentRef={ref} currentRef={ref}
fetchTableData={fetchListData} fetchTableData={fetchListData}
...@@ -300,7 +301,7 @@ const MaterialQuery = () => { ...@@ -300,7 +301,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"])
}} }}
/> />
......
...@@ -128,6 +128,7 @@ export const getSchema = (schema: ISchema): ISchema => { ...@@ -128,6 +128,7 @@ export const getSchema = (schema: ISchema): ISchema => {
'x-component-props': { 'x-component-props': {
showSearch: true, showSearch: true,
}, },
description: `{{desc()}}`
}, },
category: { category: {
title: intl.formatMessage({ id: 'material.category', defaultMessage: '品类' }), title: intl.formatMessage({ id: 'material.category', defaultMessage: '品类' }),
......
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