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

feat: 更新数据问题

parent bf91c52a
...@@ -249,12 +249,12 @@ ...@@ -249,12 +249,12 @@
.multiSpecification { .multiSpecification {
display: flex; display: flex;
flex-flow: row wrap; flex-flow: row wrap;
:global{ :global {
.ant-form-item-control { .ant-form-item-control {
flex-direction:none; flex-direction: none;
} }
.ant-form-item-control-input-content{ .ant-form-item-control-input-content {
flex:none flex: none;
} }
} }
} }
...@@ -262,7 +262,7 @@ ...@@ -262,7 +262,7 @@
display: flex; display: flex;
justify-content: flex-start; justify-content: flex-start;
width: max-content; width: max-content;
align-items:center; align-items: center;
:global { :global {
.ant-form-item-label { .ant-form-item-label {
overflow: inherit; overflow: inherit;
...@@ -342,6 +342,6 @@ ...@@ -342,6 +342,6 @@
:global { :global {
.reactEasyCrop_Container { .reactEasyCrop_Container {
height: 750px !important; height: 550px !important;
} }
} }
...@@ -267,7 +267,7 @@ const TakeawayGoodsInfo = forwardRef((props, ref) => { ...@@ -267,7 +267,7 @@ const TakeawayGoodsInfo = forwardRef((props, ref) => {
if (itm?.specName) { if (itm?.specName) {
return itm.specName; return itm.specName;
} }
return itm return itm;
}) })
.toString(); .toString();
}); });
...@@ -303,7 +303,14 @@ const TakeawayGoodsInfo = forwardRef((props, ref) => { ...@@ -303,7 +303,14 @@ const TakeawayGoodsInfo = forwardRef((props, ref) => {
multiSpu.map(item => { multiSpu.map(item => {
tempMultiSpu.forEach(itm => { tempMultiSpu.forEach(itm => {
if (item.unique === itm.unique) { if (item.unique === itm.unique) {
item.serviceItem = { ...item.serviceItem, ...itm.serviceItem }; // 修改商品售卖信息参数
const params = {
saleDates: temp.serviceItem.saleDates,
saleTimes: temp.serviceItem.saleTimes,
saleTimeType: temp.serviceItem.saleTimeType,
minPurchaseNum: temp.serviceItem.minPurchaseNum,
};
item.serviceItem = { ...item.serviceItem, ...itm.serviceItem, ...params };
itm.specs = [...item.specs]; itm.specs = [...item.specs];
} }
}); });
...@@ -349,7 +356,6 @@ const TakeawayGoodsInfo = forwardRef((props, ref) => { ...@@ -349,7 +356,6 @@ const TakeawayGoodsInfo = forwardRef((props, ref) => {
const getFormValues = debounce(() => { const getFormValues = debounce(() => {
const values = form.getFieldsValue(); const values = form.getFieldsValue();
console.log(values, 'values==='); console.log(values, 'values===');
// debugger
props.onValuesChange({ takeawayItem: JSON.parse(JSON.stringify(values)) }); props.onValuesChange({ takeawayItem: JSON.parse(JSON.stringify(values)) });
const takeawayData = customer.isEdit const takeawayData = customer.isEdit
? { takeawayItem: Object.assign({}, editData, values) } ? { takeawayItem: Object.assign({}, editData, values) }
...@@ -548,7 +554,6 @@ const TakeawayGoodsInfo = forwardRef((props, ref) => { ...@@ -548,7 +554,6 @@ const TakeawayGoodsInfo = forwardRef((props, ref) => {
weight.forEach(item => { weight.forEach(item => {
if (item?.specs?.length) { if (item?.specs?.length) {
item.specs.forEach(itm => { item.specs.forEach(itm => {
console.log('itm?.unit11111', itm?.unit);
if (itm?.unit && tempWeightName.includes(itm?.unit)) { if (itm?.unit && tempWeightName.includes(itm?.unit)) {
itm.quantity = itm.quantity =
itm?.quantity.indexOf('约') > -1 ? itm?.quantity.slice(1) : itm?.quantity || ''; itm?.quantity.indexOf('约') > -1 ? itm?.quantity.slice(1) : itm?.quantity || '';
...@@ -590,8 +595,6 @@ const TakeawayGoodsInfo = forwardRef((props, ref) => { ...@@ -590,8 +595,6 @@ const TakeawayGoodsInfo = forwardRef((props, ref) => {
weight.forEach(item => { weight.forEach(item => {
if (item?.specs?.length) { if (item?.specs?.length) {
item.specs.forEach(itm => { item.specs.forEach(itm => {
console.log('itm?.unit112222', itm?.unit);
if (itm?.unit && tempWeightName.includes(itm?.unit)) { if (itm?.unit && tempWeightName.includes(itm?.unit)) {
itm.quantity = itm.quantity =
itm?.quantity?.indexOf('约') > -1 itm?.quantity?.indexOf('约') > -1
...@@ -611,7 +614,6 @@ const TakeawayGoodsInfo = forwardRef((props, ref) => { ...@@ -611,7 +614,6 @@ const TakeawayGoodsInfo = forwardRef((props, ref) => {
form.setFieldsValue({ specs }); form.setFieldsValue({ specs });
const tempMultiSpu = editData?.skuList.map(item => { const tempMultiSpu = editData?.skuList.map(item => {
if (item) { if (item) {
console.log('item===', item);
item.serviceItem.productStock = item.productStock; item.serviceItem.productStock = item.productStock;
const weightIndex = item.specs.findIndex(itm => itm.specGroupName === '份量'); const weightIndex = item.specs.findIndex(itm => itm.specGroupName === '份量');
const tempQuantity = item.specs[weightIndex].quantity; const tempQuantity = item.specs[weightIndex].quantity;
...@@ -837,7 +839,6 @@ const TakeawayGoodsInfo = forwardRef((props, ref) => { ...@@ -837,7 +839,6 @@ const TakeawayGoodsInfo = forwardRef((props, ref) => {
> >
{form => { {form => {
let unit = form.getFieldValue('unit') || ''; let unit = form.getFieldValue('unit') || '';
console.log('unit', unit);
unit = unit =
(unit && (Array.isArray(unit) && unit?.length && unit?.slice(1).toString())) || (unit && (Array.isArray(unit) && unit?.length && unit?.slice(1).toString())) ||
unit; unit;
......
...@@ -216,7 +216,7 @@ const UploadCropImage = forwardRef((props, ref) => { ...@@ -216,7 +216,7 @@ const UploadCropImage = forwardRef((props, ref) => {
onMouseEnter={() => setActiveImgIndex(index)} onMouseEnter={() => setActiveImgIndex(index)}
onMouseLeave={() => setActiveImgIndex(null)} onMouseLeave={() => setActiveImgIndex(null)}
> >
<div style={{ width: '100%', height: '100%', overflow: 'hidden' }}> <div style={{ width: '90%', height: '90%', overflow: 'hidden' }}>
<img width="100%" key={item.uid} src={item.url} alt="" /> <img width="100%" key={item.uid} src={item.url} alt="" />
</div> </div>
{activeImgIndex === index && ( {activeImgIndex === index && (
...@@ -238,7 +238,7 @@ const UploadCropImage = forwardRef((props, ref) => { ...@@ -238,7 +238,7 @@ const UploadCropImage = forwardRef((props, ref) => {
{limit !== null && fileList.length >= limit ? ( {limit !== null && fileList.length >= limit ? (
'' ''
) : ( ) : (
<ImgCrop rotationSlider modalWidth={900} modalHeight={900} quality={0.5} showReset> <ImgCrop rotationSlider modalWidth={500} modalHeight={500} quality={0.5} showReset>
<Upload <Upload
{...uploadParams} {...uploadParams}
disabled={Boolean(disabled)} disabled={Boolean(disabled)}
......
...@@ -153,7 +153,7 @@ export const apiUnits = data => ...@@ -153,7 +153,7 @@ export const apiUnits = data =>
}); });
// 获取shopids http://yapi.quantgroups.com/project/389/interface/api/38056 // 获取shopids http://yapi.quantgroups.com/project/389/interface/api/38056
export const apiShopIds = data => export const apiShopIds = data =>
request.get('/api/merchants/shops/getBySupplierId?state=1', { request.get('/api/merchants/shops/getBySupplierId?state=1&productBusiness=1', {
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