Commit d53eaa83 authored by 武广's avatar 武广

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

Merge branch 'feature/goods-list' of git.quantgroup.cn:ui/merchant-manage-ui into feature/20230327_public_takeaway
parents 1b8305f1 6734be6f
...@@ -74,20 +74,23 @@ const Takeaway = options => { ...@@ -74,20 +74,23 @@ const Takeaway = options => {
const onSortEnd = async ({ oldIndex, newIndex }) => { const onSortEnd = async ({ oldIndex, newIndex }) => {
if (oldIndex !== newIndex) { if (oldIndex !== newIndex) {
const newData = arrayMoveImmutable(tableData.slice(), oldIndex, newIndex).filter(el => !!el); const sourceGoods = tableData[oldIndex];
const skuSorts = newData.map((item, index) => ({ const targetGoods = tableData[newIndex];
skuId: item.skuId, // const newData = arrayMoveImmutable(tableData.slice(), oldIndex, newIndex).filter(el => !!el);
sort: pageSize * (pageNo - 1) + index + 1, // const skuSorts = newData.map((item, index) => ({
})); // skuId: item.skuId,
// sort: pageSize * (pageNo - 1) + index + 1,
// }));
if (sourceGoods && sourceGoods.skuId && targetGoods && targetGoods.skuId) {
const params = { const params = {
storageRackId: groupId, storageRackId: groupId,
type: 1,
shopId, shopId,
skuSorts, sourceSkuId: sourceGoods.skuId,
targetSkuId: targetGoods.skuId,
}; };
await apiSortTakeawayGoods(params); await apiSortTakeawayGoods(params);
getDataList(pageNo, pageSize); getDataList(pageNo, pageSize);
// setTableData(newData); }
} }
}; };
......
...@@ -306,8 +306,18 @@ export async function apiTakeawayGoods(params) { ...@@ -306,8 +306,18 @@ export async function apiTakeawayGoods(params) {
}); });
} }
// 外卖商品排序 // 外卖商品排序
// export async function apiSortTakeawayGoods(data) {
// return request.post('/api/merchants/products/sku/batchSort', {
// prefix: goodsApi,
// data,
// });
// }
/**
* 外卖商品排序
* yapi: http://yapi.quantgroups.com/project/389/interface/api/58174
*/
export async function apiSortTakeawayGoods(data) { export async function apiSortTakeawayGoods(data) {
return request.post('/api/merchants/products/sku/batchSort', { return request.post('/api/merchants/products/sku/range/sort', {
prefix: goodsApi, prefix: goodsApi,
data, data,
}); });
......
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