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

fix: 修改拍戏问题

parent 0ff0fd32
...@@ -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,
const params = { // sort: pageSize * (pageNo - 1) + index + 1,
storageRackId: groupId, // }));
type: 1, if (sourceGoods && sourceGoods.skuId && targetGoods && targetGoods.skuId) {
shopId, const params = {
skuSorts, storageRackId: groupId,
}; shopId,
await apiSortTakeawayGoods(params); sourceSkuId: sourceGoods.skuId,
getDataList(pageNo, pageSize); targetSkuId: targetGoods.skuId,
// setTableData(newData); };
await apiSortTakeawayGoods(params);
getDataList(pageNo, pageSize);
}
} }
}; };
......
...@@ -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