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
b747ee46
Commit
b747ee46
authored
Apr 04, 2023
by
陈万宝
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:更新修改库存
parent
06d4d844
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
30 additions
and
10 deletions
+30
-10
index.jsx
src/pages/GoodsManage/index.jsx
+1
-1
common.less
src/pages/ServiceGoods/common.less
+14
-0
AddRepertoryModal.jsx
src/pages/ServiceGoods/components/AddRepertoryModal.jsx
+5
-1
FormTakeaway.jsx
src/pages/ServiceGoods/components/FormTakeaway.jsx
+10
-7
index.jsx
src/pages/ServiceGoods/index.jsx
+0
-1
No files found.
src/pages/GoodsManage/index.jsx
View file @
b747ee46
...
...
@@ -62,7 +62,7 @@ class goodsManage extends Component {
auditRow
:
{},
// 查看审核信息使用
isVisibleDraft
:
false
,
// 显示隐藏草稿箱
isEditDraft
:
false
,
// 是否编辑草稿
productType
:
5
,
// 商品类型
productType
:
1
,
// 商品类型
takeAway
:
{},
// 弹窗外卖商品参数
searchValue
:
{},
// 搜索条件
refresh
:
''
,
// 外卖刷新
...
...
src/pages/ServiceGoods/common.less
View file @
b747ee46
...
...
@@ -254,6 +254,20 @@
}
}
}
.specsSingularBetween {
display: flex;
justify-content: flex-start;
width: max-content;
align-items:center;
:global {
.ant-form-item-label {
overflow: inherit;
}
.ant-col-sm-3 {
max-width: fit-content;
}
}
}
.specsBetween {
display: flex;
justify-content: flex-end;
...
...
src/pages/ServiceGoods/components/AddRepertoryModal.jsx
View file @
b747ee46
import
React
,
{
useState
,
useEffect
,
forwardRef
,
useRef
,
useImperativeHandle
}
from
'
react
'
;
import
{
Button
,
Modal
,
Radio
,
Form
,
InputNumber
,
Switch
,
Space
}
from
'
antd
'
;
import
{
Button
,
Modal
,
Radio
,
Form
,
InputNumber
,
Switch
,
Space
,
message
}
from
'
antd
'
;
import
styles
from
'
../common.less
'
;
import
{
ENUM_SET_REPERTORY
}
from
'
../config
'
;
import
{
debounce
}
from
'
@/utils/utils
'
;
...
...
@@ -59,6 +59,10 @@ const AddRepertoryModal = (props, ref) => {
const
handleOk
=
async
()
=>
{
const
values
=
await
form
.
validateFields
();
values
.
autoStock
=
values
.
autoStock
?
1
:
0
;
if
(
+
values
.
autoStock
===
1
&&
+
values
.
maxStock
===
0
)
{
message
.
error
(
'
最大库存不能为0
'
)
return
}
// 回调库存
modifiedInventory
(
type
,
idx
,
values
);
setConfirmLoading
(
true
);
...
...
src/pages/ServiceGoods/components/FormTakeaway.jsx
View file @
b747ee46
...
...
@@ -244,9 +244,9 @@ const TakeawayGoodsInfo = forwardRef((props, ref) => {
itm
.
unit
=
itm
?.
unit
&&
(
Array
.
isArray
(
itm
?.
unit
)
?
itm
?.
unit
.
slice
(
itm
?.
unit
.
length
-
1
)[
0
]
:
itm
?.
unit
);
if
(
itm
?.
unit
&&
peopleUnits
.
includes
(
itm
.
unit
))
{
delete
itm
.
quantity
;
}
}
if
(
itm
?.
unit
&&
peopleUnits
.
includes
(
itm
.
unit
))
{
delete
itm
.
quantity
;
}
if
(
itm
?.
specName
)
{
return
itm
.
specName
;
...
...
@@ -890,11 +890,11 @@ const TakeawayGoodsInfo = forwardRef((props, ref) => {
</Form.Item>
<div className={styles.rowWarp}>
{singularSpu.length > 0 &&
(takeawayData?.infoMation?.name || takeawayData.takeawayItem.name)
&&
singularSpu[0]?.specs[0]?.unit
&&
singularSpu.map((item, index) => (
<div className={styles.specsBetween}>
<div className={styles.specs
Singular
Between}>
<Form.Item label={calcLabelName(intactData, item, 'singular')}>
<div className={styles.specsBetween}>
<div className={styles.specs
Singular
Between}>
<span className={styles.repertoryLimit}>
{item?.specs[0]?.productStock}/{item?.specs[0]?.maxStock}
</span>
...
...
@@ -943,7 +943,10 @@ const TakeawayGoodsInfo = forwardRef((props, ref) => {
shouldUpdate={(prevValues, curValues) => false}
>
{form => {
let unit = form.getFieldValue(['weight'])?.[index]?.unit;
let unit = form.getFieldValue(['weight'])?.[index]?.unit || '';
unit =
(unit && (Array.isArray(unit) && unit?.length && unit?.slice(1).toString())) ||
unit;
if (!peopleUnits.includes(unit)) {
return (
<Form.Item
...
...
src/pages/ServiceGoods/index.jsx
View file @
b747ee46
...
...
@@ -87,7 +87,6 @@ const ServiceGoods = options => {
const
resetForm
=
()
=>
clearCurrent
(
checkFormList
).
forEach
(({
current
})
=>
current
.
reset
());
const
onValuesChange
=
e
=>
{
// console.log('e======', e, !isEdit, visibleCacheEdit);
if
(
!
isEdit
)
{
if
(
visibleCacheEdit
)
{
setVisibleCacheEdit
(
false
);
...
...
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