Commit 6734be6f authored by 武广's avatar 武广

fix: 修改拍戏问题

parent 0ff0fd32
......@@ -74,20 +74,23 @@ const Takeaway = options => {
const onSortEnd = async ({ oldIndex, newIndex }) => {
if (oldIndex !== newIndex) {
const newData = arrayMoveImmutable(tableData.slice(), oldIndex, newIndex).filter(el => !!el);
const skuSorts = newData.map((item, index) => ({
skuId: item.skuId,
sort: pageSize * (pageNo - 1) + index + 1,
}));
const sourceGoods = tableData[oldIndex];
const targetGoods = tableData[newIndex];
// const newData = arrayMoveImmutable(tableData.slice(), oldIndex, newIndex).filter(el => !!el);
// const skuSorts = newData.map((item, index) => ({
// skuId: item.skuId,
// sort: pageSize * (pageNo - 1) + index + 1,
// }));
if (sourceGoods && sourceGoods.skuId && targetGoods && targetGoods.skuId) {
const params = {
storageRackId: groupId,
type: 1,
shopId,
skuSorts,
sourceSkuId: sourceGoods.skuId,
targetSkuId: targetGoods.skuId,
};
await apiSortTakeawayGoods(params);
getDataList(pageNo, pageSize);
// setTableData(newData);
}
}
};
......
......@@ -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) {
return request.post('/api/merchants/products/sku/batchSort', {
return request.post('/api/merchants/products/sku/range/sort', {
prefix: goodsApi,
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