Commit 08408684 authored by 陈万宝's avatar 陈万宝

feat: 更新重复约字段

parent db4ed06f
......@@ -20971,7 +20971,7 @@
},
"pubsub-js": {
"version": "1.9.4",
"resolved": "http://npmprivate.quantgroups.com/pubsub-js/-/pubsub-js-1.9.4.tgz",
"resolved": "https://registry.npmjs.org/pubsub-js/-/pubsub-js-1.9.4.tgz",
"integrity": "sha512-hJYpaDvPH4w8ZX/0Fdf9ma1AwRgU353GfbaVfPjfJQf1KxZ2iHaHl3fAUw1qlJIR5dr4F3RzjGaWohYUEyoh7A=="
},
"pump": {
......@@ -114,16 +114,18 @@ export const filterSendData = (type, params) => {
// 外卖商品
if (type === 5) {
const temp = Object.assign({}, takeawayItem?.intactData, infoMation);
temp.categoryId =
Array.isArray(temp.categoryId) &&
temp.categoryId?.slice(temp.categoryId?.length - 1)?.toString();
temp.productRefShopId = temp.productRefShopId.toString();
const deepTemp = JSON.parse(JSON.stringify(temp))
deepTemp.categoryId =
Array.isArray(deepTemp.categoryId) &&
deepTemp.categoryId?.slice(deepTemp.categoryId?.length - 1)?.toString();
deepTemp.productRefShopId = deepTemp.productRefShopId.toString();
const tempWeightName = JSON.parse(sessionStorage.getItem('weightUnits'));
temp.items.forEach(item => {
deepTemp.items.forEach(item => {
item.autoStock = item.autoStock ? 1 : 0;
item.serviceItem.autoStock = item?.serviceItem?.autoStock ? 1 : 0;
item.productStock = item?.serviceItem?.productStock;
item.list = temp.list;
item.list = deepTemp.list;
if (item?.specs?.length) {
item?.specs.forEach(itm => {
if (tempWeightName.includes(itm.unit)) {
......@@ -133,8 +135,8 @@ export const filterSendData = (type, params) => {
});
}
});
temp.specList &&
temp.specList.forEach(item => {
deepTemp.specList &&
deepTemp.specList.forEach(item => {
if (item?.specs?.length) {
item?.specs.forEach(itm => {
itm.unit =
......@@ -149,7 +151,7 @@ export const filterSendData = (type, params) => {
});
}
});
return temp;
return deepTemp;
}
const items = filterItems(type, params);
const commonImageList = type === 4 ? [] : infoImageData.commonImageList;
......@@ -327,12 +329,12 @@ export const calcDescartes = array => {
console.log(array, 'array');
if (array.length < 2) return array[0] || [];
return [].reduce.call(array, function(col, set) {
var res = [];
return [].reduce.call(array, (col, set) => {
const res = [];
col.forEach(function(c) {
set.forEach(function(s) {
var t = [].concat(Array.isArray(c) ? c : [c]);
col.forEach(c => {
set.forEach(s => {
const t = [].concat(Array.isArray(c) ? c : [c]);
t.push(s);
res.push(t);
});
......
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