Commit 1284ccdf authored by 武广's avatar 武广

Merge branch 'feature/sourcemap' of git.quantgroup.cn:ui/merchant-manage-ui...

Merge branch 'feature/sourcemap' of git.quantgroup.cn:ui/merchant-manage-ui into feature/sourcemap-merchant
parents aa98368c 09d74448
...@@ -23,6 +23,7 @@ const SaleDateModal = props => { ...@@ -23,6 +23,7 @@ const SaleDateModal = props => {
message.error('请选择餐段'); message.error('请选择餐段');
return; return;
} }
const arr = value.sort((x, y) => x - y);
if (props.productType === 4) { if (props.productType === 4) {
const data = []; const data = [];
props.dataSource.forEach(item => { props.dataSource.forEach(item => {
...@@ -31,7 +32,7 @@ const SaleDateModal = props => { ...@@ -31,7 +32,7 @@ const SaleDateModal = props => {
tabCateList: item.tabCate?.map(v => ({ tabId: v })), tabCateList: item.tabCate?.map(v => ({ tabId: v })),
}; };
if (props.item.skuId === item.skuId && item.saleDate) { if (props.item.skuId === item.skuId && item.saleDate) {
obj.tabCateList = value.map(v => ({ tabId: v })); obj.tabCateList = arr.map(v => ({ tabId: v }));
data.push(obj); data.push(obj);
} else if (item.saleDate?.length && item.tabCate?.length) { } else if (item.saleDate?.length && item.tabCate?.length) {
data.push(obj); data.push(obj);
...@@ -45,13 +46,13 @@ const SaleDateModal = props => { ...@@ -45,13 +46,13 @@ const SaleDateModal = props => {
if (props.id) { if (props.id) {
const params = { const params = {
id: props.id, id: props.id,
tabIds: value, tabIds: arr,
}; };
await apiMealInfoUpdate(params); await apiMealInfoUpdate(params);
notification.success({ message: '保存成功' }); notification.success({ message: '保存成功' });
} }
handleCancel(); handleCancel();
props.handleRefresh(value); props.handleRefresh(arr);
}; };
// 获取店铺餐段通过企业ID // 获取店铺餐段通过企业ID
......
...@@ -144,7 +144,15 @@ export const takeawayGoodsColumn = options => { ...@@ -144,7 +144,15 @@ export const takeawayGoodsColumn = options => {
hideInSearch: true, hideInSearch: true,
render: (_, record) => ( render: (_, record) => (
<Space> <Space>
{_ && _.length ? <span>{_.map(item => item.tabName).join('/')}</span> : <span>-</span>} {_ && _.length ? (
<span>
{_.sort((x, y) => x.tabId - y.tabId)
.map(item => item.tabName)
.join('/')}
</span>
) : (
<span>-</span>
)}
<span <span
className={style.columnBtnEdit} className={style.columnBtnEdit}
onClick={() => { onClick={() => {
...@@ -380,7 +388,11 @@ export const GoodsInfoColumn = options => { ...@@ -380,7 +388,11 @@ export const GoodsInfoColumn = options => {
render: (_, record) => ( render: (_, record) => (
<Space> <Space>
{_ && _.length ? ( {_ && _.length ? (
<span key="1">{_.map(item => mealColumn[item]).join('/')}</span> <span key="1">
{_.sort((x, y) => x - y)
.map(item => mealColumn[item])
.join('/')}
</span>
) : ( ) : (
<span key="2" className={style.columnTip}> <span key="2" className={style.columnTip}>
请配置 请配置
...@@ -552,7 +564,15 @@ export const virtualGoodsColumn = options => { ...@@ -552,7 +564,15 @@ export const virtualGoodsColumn = options => {
align: 'center', align: 'center',
hideInSearch: true, hideInSearch: true,
render: (_, record) => ( render: (_, record) => (
<Space>{_ && _.length && <span>{_.map(item => item.tabName).join('/')}</span>}</Space> <Space>
{_ && _.length && (
<span>
{_.sort((x, y) => x.tabId - y.tabId)
.map(item => item.tabName)
.join('/')}
</span>
)}
</Space>
), ),
}, },
{ {
......
...@@ -137,6 +137,7 @@ const VirtualGoodsInfo = props => { ...@@ -137,6 +137,7 @@ const VirtualGoodsInfo = props => {
setSelectedRowKeys(keys); setSelectedRowKeys(keys);
} else { } else {
setDataSource([]); setDataSource([]);
setSelectedRowKeys([]);
} }
}; };
......
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