Commit 05b72197 authored by Bill's avatar Bill

Merge branch 'feat-material-authButton' into 'v2-220418'

当品类关联属性为空时隐藏物料属性 See merge request linkseeks-design/pro-platform!293
parents b6396287 f4f6a588
......@@ -80,7 +80,6 @@ const MaterialAdd = (props) => {
if (!formatInitialValue) {
return
}
console.log(formatInitialValue?.interiorState, "formatInitialValue?.interiorState")
if (formatInitialValue?.interiorState === HAS_CONFIRM) {
formActions.setFieldState('changeCard', (state) => {
FormPath.setIn(state, 'visible', true);
......@@ -332,17 +331,20 @@ const MaterialAdd = (props) => {
$('onFieldValueChange', 'category').subscribe((fieldState) => {
if (!fieldState.value || fieldState.value.length === 0) {
setSchema(
getSchema(
propsCardSchema({} as ISchema)
)
getSchema({})
)
return;
}
const categoryId = [...fieldState.value].pop();
getProductCustomerGetCustomerCategoryById({id: categoryId})
.then((data) => {
console.log(data);
const { customerAttributeList } = data.data;
if (customerAttributeList.length === 0) {
setSchema(
getSchema({})
)
return;
}
const result = {};
customerAttributeList.forEach((_item) => {
const { customerAttributeValueList, name, type, isEmpty, id } = _item;
......
......@@ -44,8 +44,11 @@ const MaterialQuery = () => {
}
setDeleteLoading((prev) => prev.concat(_row.id))
try {
const { selectedRowKeys, selectRow } = selectRowFns;
const { data, code } = await postProductGoodsDeleteBatchGoods({ idList: [_row.id] });
if (code === 1000) {
selectRowFns.setSelectedRowKeys(selectedRowKeys.filter((_item) => _item !== _row.id))
selectRowFns.setSelectRow(selectRow.filter((_item) => _item.id !== _row.id))
formActions.submit();
}
} finally {
......@@ -86,8 +89,11 @@ const MaterialQuery = () => {
});
return;
}
const { selectedRowKeys, selectRow } = selectRowFns;
const { data, code } = await postProductGoodsSubmit({ id: _row.id });
if (code === 1000) {
selectRowFns.setSelectedRowKeys(selectedRowKeys.filter((_item) => _item !== _row.id))
selectRowFns.setSelectRow(selectRow.filter((_item) => _item.id !== _row.id))
formActions.submit();
}
} catch(e) {}
......@@ -211,13 +217,14 @@ const MaterialQuery = () => {
try {
const { data, code } = await postProductGoodsDeleteBatchGoods({ idList: selectedRowKeys })
if (code === 1000) {
selectRowFns.setSelectedRowKeys([])
selectRowFns.setSelectRow([])
ref.current.reload()
}
} catch(e) {}
finally {
setLoading(false);
}
}
const handleSearch = (values: SearchParams) => {
......
......@@ -76,6 +76,8 @@ const MaterialQuery = () => {
try {
const { data, code } = await postProductGoodsGoodsExamineChangeBatch1({ idList: selectedRowKeys })
if (code === 1000) {
selectRowFns.setSelectedRowKeys([])
selectRowFns.setSelectRow([])
ref.current.reload()
}
} catch(e) {}
......
......@@ -80,6 +80,8 @@ const MaterialQuery = () => {
try {
const { data, code } = await postProductGoodsGoodsExamineChangeBatch2({ idList: selectedRowKeys })
if (code === 1000) {
selectRowFns.setSelectedRowKeys([])
selectRowFns.setSelectRow([])
ref.current.reload()
}
} catch(e) {}
......
......@@ -77,6 +77,8 @@ const MaterialQuery = () => {
try {
const { data, code } = await postProductGoodsGoodsExamineBatch1({ idList: selectedRowKeys })
if (code === 1000) {
selectRowFns.setSelectedRowKeys([])
selectRowFns.setSelectRow([])
ref.current.reload()
}
} catch(e) {}
......
......@@ -76,6 +76,8 @@ const MaterialQuery = () => {
try {
const { data, code } = await postProductGoodsGoodsExamineBatch2({ idList: selectedRowKeys })
if (code === 1000) {
selectRowFns.setSelectedRowKeys([])
selectRowFns.setSelectRow([])
ref.current.reload()
}
} catch(e) {}
......
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