Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
merchant-manage-ui
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ui
merchant-manage-ui
Commits
0aa6a9e0
Commit
0aa6a9e0
authored
Mar 31, 2023
by
陈万宝
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 修改商品名称
parent
4714428f
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
12 deletions
+25
-12
FormInformationBasic.jsx
src/pages/ServiceGoods/components/FormInformationBasic.jsx
+3
-2
FormTakeaway.jsx
src/pages/ServiceGoods/components/FormTakeaway.jsx
+19
-8
UploadCropImage.jsx
src/pages/ServiceGoods/components/UploadCropImage.jsx
+1
-1
utils.js
src/pages/ServiceGoods/utils.js
+2
-1
No files found.
src/pages/ServiceGoods/components/FormInformationBasic.jsx
View file @
0aa6a9e0
...
...
@@ -12,6 +12,7 @@ import { ServiceContext } from '../context';
import
{
debounce
}
from
'
@/utils/utils
'
;
import
AddMenusModal
from
'
./AddMenusModal
'
;
import
UploadImage
from
'
./UploadImage
'
;
import
UploadCropImage
from
'
./UploadCropImage
'
import
{
apiShopIds
,
apiQueryShopList
,
getByProductType
}
from
'
../service
'
;
import
GroupInfo
from
'
../../GoodsManage/Takeaway/components/GroupInfo
'
;
...
...
@@ -202,7 +203,7 @@ const FormInformationBasic = forwardRef((props, ref) => {
name=
"name"
label=
"商品名称"
rules=
{
[
{
required
:
true
,
min
:
2
,
m
essage
:
'
请输入最少两个
字符的商品名称
'
,
whitespace
:
true
},
{
required
:
true
,
min
:
2
,
m
ax
:
30
,
message
:
'
请输入大于2个且小于30
字符的商品名称
'
,
whitespace
:
true
},
]
}
>
<
Input
placeholder=
"请输入商品名称"
disabled=
{
customer
.
isDisabled
}
/>
...
...
@@ -270,7 +271,7 @@ const FormInformationBasic = forwardRef((props, ref) => {
},
]
}
>
<
UploadImage
<
Upload
Crop
Image
name=
"takeawayImageList"
limit=
{
5
}
disabled=
{
customer
.
isDisabled
}
...
...
src/pages/ServiceGoods/components/FormTakeaway.jsx
View file @
0aa6a9e0
...
...
@@ -31,7 +31,7 @@ import { Title } from './CommonTemplate';
import
{
formItemLayout
,
ENUM_REPERTORY
,
ENUM_SET_REPERTORY
,
ENUM_WEEK
}
from
'
../config
'
;
import
{
ServiceContext
}
from
'
../context
'
;
import
{
debounce
}
from
'
@/utils/utils
'
;
import
Upload
Image
from
'
./Upload
Image
'
;
import
Upload
CropImage
from
'
./UploadCrop
Image
'
;
// import AddSellTimeModal from './AddSellTimeModal';
import
styles
from
'
../common.less
'
;
import
AddRepertoryModal
from
'
./AddRepertoryModal
'
;
...
...
@@ -163,7 +163,8 @@ const TakeawayGoodsInfo = forwardRef((props, ref) => {
salePrice
,
maxStock
,
quantity
,
unit
:
(
Array
.
isArray
(
unit
)
&&
unit
?.
length
&&
unit
?.
splice
(
unit
?.
length
-
1
)[
0
])
||
unit
,
// unit: (Array.isArray(unit) && unit?.length && unit?.splice(unit?.length - 1)[0]) || unit,
unit
,
productStock
,
specGroupName
:
'
份量
'
,
};
...
...
@@ -471,6 +472,19 @@ const TakeawayGoodsInfo = forwardRef((props, ref) => {
if (!editData) return;
let { label, firstCategoryId, secondCategoryId, thirdCategoryId, id } = editData;
editData.label = label.split(',').map(item => +item);
let specList = editData?.specList;
let weight = specList.filter(item => item.specGroupName === '份量');
const tempWeightName = JSON.parse(sessionStorage.getItem('weightUnits'));
weight.forEach(item => {
if (item?.specs?.length) {
item.specs.forEach(itm => {
if (tempWeightName.includes(itm.unit)) {
itm.quantity =
itm?.quantity.indexOf('约') > -1 ? itm?.quantity.slice(1) : itm?.quantity || '';
}
});
}
});
if (editData?.skuList.length) {
editData.minPurchaseNum = editData?.skuList[0]?.serviceItem.minPurchaseNum;
// 单规格
...
...
@@ -483,7 +497,7 @@ const TakeawayGoodsInfo = forwardRef((props, ref) => {
} = editData?.skuList[0];
let { quantity, unit, salePrice } = specs[0];
editData.productStock = productStock;
editData.quantity =
quantity
;
editData.quantity =
`
$
{
quantity
}
`.indexOf('约') > -1 ? quantity.slice(1) :quantity || '';
;
editData.unit = unit;
editData.salePrice = salePrice;
editData.maxStock = maxStock;
...
...
@@ -583,7 +597,7 @@ const TakeawayGoodsInfo = forwardRef((props, ref) => {
label="商品图片"
extra="支持.jpg/png格式图片,建议单张切片宽750像素,大小200kb左右,您可以拖拽图片调整顺序,最多上传5张。"
>
<UploadImage
<Upload
Crop
Image
name="detailImageList"
limit={5}
disabled={customer.isDisabled}
...
...
@@ -601,7 +615,6 @@ const TakeawayGoodsInfo = forwardRef((props, ref) => {
<InputNumber
min={1}
max={999999999}
precision={2}
style={{ width: 200 }}
placeholder="请输入购买量"
/>
...
...
@@ -695,7 +708,7 @@ const TakeawayGoodsInfo = forwardRef((props, ref) => {
)}
<Form.Item name="label" label="商品标签">
<Select
mode="multiple"
//
mode="multiple"
allowClear
placeholder="请选择商品标签"
style={{ width: 400 }}
...
...
@@ -793,7 +806,6 @@ const TakeawayGoodsInfo = forwardRef((props, ref) => {
<InputNumber
min={0}
max={999999999}
precision={2}
style={{ width: 200, display: 'inline-block' }}
placeholder="请输入"
/>
...
...
@@ -813,7 +825,6 @@ const TakeawayGoodsInfo = forwardRef((props, ref) => {
<InputNumber
max={999999999}
min={0}
precision={2}
style={{ width: 200 }}
placeholder="请输入"
onChange={onChangeMaxStock}
...
...
src/pages/ServiceGoods/components/UploadCropImage.jsx
View file @
0aa6a9e0
...
...
@@ -238,7 +238,7 @@ const UploadCropImage = forwardRef((props, ref) => {
{
limit
!==
null
&&
fileList
.
length
>=
limit
?
(
''
)
:
(
<
ImgCrop
rotationSlider
modalWidth=
{
12
00
}
quality=
{
0.5
}
showReset
>
<
ImgCrop
rotationSlider
modalWidth=
{
900
}
modalHeight=
{
9
00
}
quality=
{
0.5
}
showReset
>
<
Upload
{
...
uploadParams
}
disabled=
{
Boolean
(
disabled
)
}
...
...
src/pages/ServiceGoods/utils.js
View file @
0aa6a9e0
...
...
@@ -117,10 +117,10 @@ export const filterSendData = (type, params) => {
temp
.
categoryId
=
(
Array
.
isArray
(
temp
.
categoryId
)
&&
temp
.
categoryId
?.
slice
(
temp
.
categoryId
?.
length
-
1
)?.
toString
())
temp
.
productRefShopId
=
temp
.
productRefShopId
.
toString
()
const
tempWeightName
=
JSON
.
parse
(
sessionStorage
.
getItem
(
'
weightUnits
'
))
// console.log(tempWeightName, 'tempWeightName');
temp
.
items
.
forEach
(
item
=>
{
item
.
autoStock
=
item
.
autoStock
?
1
:
0
item
.
serviceItem
.
autoStock
=
item
?.
serviceItem
?.
autoStock
?
1
:
0
item
.
productStock
=
item
?.
serviceItem
?.
productStock
if
(
item
?.
specs
?.
length
)
{
item
?.
specs
.
forEach
(
itm
=>
{
if
(
tempWeightName
.
includes
(
itm
.
unit
))
{
...
...
@@ -132,6 +132,7 @@ export const filterSendData = (type, params) => {
temp.specList && temp.specList.forEach(item => {
if (item?.specs?.length) {
item?.specs.forEach(itm => {
itm.unit = (Array.isArray(itm.unit) && itm.unit?.length>=2 && itm.unit?.splice(itm.unit?.length - 1)[0]) || itm.unit
if (tempWeightName.includes(itm.unit)) {
itm.quantity = `
$
{
itm
?.
quantity
}
`.indexOf('约') > -1 ? itm?.quantity : `
约
$
{
itm
?.
quantity
}
`
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment