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
57cf31c7
Commit
57cf31c7
authored
May 27, 2025
by
武广
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature-0430-gold' into 'master'
Feature 0430 gold See merge request
!121
parents
9b668ec5
1c00ea67
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
53 additions
and
7 deletions
+53
-7
FormPriceOrStock.jsx
src/pages/ServiceGoods/components/FormPriceOrStock.jsx
+46
-1
index.jsx
src/pages/ServiceGoods/index.jsx
+7
-6
No files found.
src/pages/ServiceGoods/components/FormPriceOrStock.jsx
View file @
57cf31c7
...
...
@@ -233,6 +233,7 @@ const FormPriceOrStock = forwardRef((props, ref) => {
const
editRef
=
useRef
(
null
);
const
packageRef
=
useRef
(
null
);
const
customer
=
useContext
(
ServiceContext
);
const
customerRef
=
useRef
(
customer
);
const
[
form
]
=
Form
.
useForm
();
const
[
specInitValue
,
setSpecInitValue
]
=
useState
(
initSpecReced
());
...
...
@@ -321,7 +322,9 @@ const FormPriceOrStock = forwardRef((props, ref) => {
const
isGoodsManage
=
window
.
location
.
pathname
.
indexOf
(
'
popGoodsManage
'
)
<
0
;
const
dynamicColumns
=
[
...
columsData
,
...(
isGoodsManage
?
StaticColumns
(
customer
)
:
StaticColumnsPop
(
customer
)),
...(
isGoodsManage
?
StaticColumns
(
customerRef
.
current
)
:
StaticColumnsPop
(
customerRef
.
current
)),
];
setDefaultColumns
(
dynamicColumns
);
};
...
...
@@ -401,6 +404,38 @@ const FormPriceOrStock = forwardRef((props, ref) => {
const
getFormValues
=
debounce
(
async
()
=>
{
const
cleanValues
=
await
onSpecificationEvent
();
props
.
onValuesChange
({
infoSpecData
:
cleanValues
});
setTimeout
(
async
()
=>
{
const
values
=
await
form
.
validateFields
();
// eslint-disable-next-line no-shadow
const
cleanValues
=
{
firstValues
:
cleanArray
(
values
.
firstSpecValue
||
[]),
secondValues
:
cleanArray
(
values
.
secondSpecValue
||
[]),
firstSpecId
:
values
.
firstSpecValue
&&
values
.
firstSpecValue
.
length
?
values
.
firstSpecId
:
null
,
secondSpecId
:
values
.
secondSpecValue
&&
values
.
secondSpecValue
.
length
?
values
.
secondSpecId
:
null
,
};
const
{
inIdList
:
fisrtInIdList
,
noIdList
:
fisrtNoIdList
}
=
filterSkuNotIdList
(
cleanValues
.
firstValues
,
);
const
{
inIdList
:
secndInIdList
,
noIdList
:
secndNoIdList
}
=
filterSkuNotIdList
(
cleanValues
.
secondValues
,
);
const
createSkuList
=
createProductData
(
{
firstSpecId
:
cleanValues
.
firstSpecId
,
secondSpecId
:
cleanValues
.
secondSpecId
,
fisrtInIdList
,
secndInIdList
,
fisrtNoIdList
,
secndNoIdList
,
},
customer
.
isEdit
,
skuList
,
);
props
.
onValuesChange
({
skuList
:
fliterSkuListSortData
([...
createSkuList
])
});
},
0
);
},
400
);
const
packageValueChange
=
()
=>
{
...
...
@@ -444,6 +479,16 @@ const FormPriceOrStock = forwardRef((props, ref) => {
},
}));
useEffect
(()
=>
{
customerRef
.
current
=
customer
;
},
[
customer
]);
useEffect
(()
=>
{
(
async
()
=>
{
await
onSpecificationEvent
();
})();
},
[
customer
.
isGold
]);
useEffect
(()
=>
{
if
(
customer
.
isEdit
||
customer
.
isUseCache
)
{
if
(
!
editData
)
{
...
...
src/pages/ServiceGoods/index.jsx
View file @
57cf31c7
...
...
@@ -31,6 +31,7 @@ import { ServiceContext } from './context';
import
{
GOOD_MANAGE
}
from
'
@/../config/permission.config
'
;
import
styles
from
'
./common.less
'
;
import
{
GoldCategory
}
from
'
@/config/app.config
'
;
import
{
debounce
}
from
'
@/utils/utils
'
;
/**
* 服务商品改造-商品模块
...
...
@@ -377,7 +378,7 @@ const ServiceGoods = options => {
}
setPageLoading
(
false
);
})();
},
[
SourceData
,
categoryIds
]);
},
[
SourceData
]);
useEffect
(()
=>
{
if
(
options
.
visible
)
{
...
...
@@ -443,10 +444,10 @@ const ServiceGoods = options => {
const
onCategoryChange
=
e
=>
{
setCategoryIds
(
e
);
let
txt
=
''
;
if
(
categoryIds
.
includes
(
GoldCategory
))
{
txt
=
'
千克
'
;
}
else
if
(
e
.
includes
(
GoldCategory
))
{
if
(
e
.
includes
(
GoldCategory
))
{
txt
=
'
克
'
;
}
else
{
txt
=
'
千克
'
;
}
if
(
txt
)
{
message
.
warning
(
`商品品类已切换,规格重量单位已自动切换为
${
txt
}
`
,
6
);
...
...
@@ -454,7 +455,7 @@ const ServiceGoods = options => {
};
// 保存草稿
const
onSaveDraft
=
async
()
=>
{
const
onSaveDraft
=
debounce
(
async
()
=>
{
const
info
=
localStorage
.
get
(
localAutoSaveKey
);
if
(
!
info
||
...
...
@@ -506,7 +507,7 @@ const ServiceGoods = options => {
handleCancel
(
true
);
},
});
};
}
,
400
)
;
const
isPopGoods
=
location
.
pathname
.
indexOf
(
'
popGoodsManage
'
)
>
0
;
// pop商品管理-商品库(应付审计用的, 驳回和修改状态下不能编辑)
const
providerValue
=
{
pageId
,
...
...
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