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

feat: 更新重复约字段

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