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
4865061c
Commit
4865061c
authored
Aug 16, 2024
by
guang.wu
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of git.quantgroup.cn:ui/merchant-manage-ui into feature-20240715-bank-company
parents
e18414c8
1b2dc0b5
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
38 additions
and
7 deletions
+38
-7
app.config.js
src/config/app.config.js
+5
-0
index.jsx
src/pages/GoodsManage/index.jsx
+9
-0
config.js
src/pages/ServiceGoods/config.js
+5
-5
index.jsx
src/pages/ServiceGoods/index.jsx
+13
-2
utils.js
src/pages/ServiceGoods/utils.js
+6
-0
No files found.
src/config/app.config.js
0 → 100644
View file @
4865061c
/**
* 投资类黄金(商品类目)
* 商品新增编辑页,重量显示为克并且回显的时候把重量*1000 提交的时候重量再除以1000(接口只接受kg,但是产品希望看到g)
* * */
export
const
GoldCategory
=
6151
;
src/pages/GoodsManage/index.jsx
View file @
4865061c
...
@@ -30,6 +30,7 @@ import Takeaway from './Takeaway';
...
@@ -30,6 +30,7 @@ import Takeaway from './Takeaway';
import
{
GOOD_MANAGE
}
from
'
@/../config/permission.config
'
;
import
{
GOOD_MANAGE
}
from
'
@/../config/permission.config
'
;
import
LocalStroage
from
'
@/utils/localStorage
'
;
import
LocalStroage
from
'
@/utils/localStorage
'
;
import
configApi
from
'
@/../config/env.config
'
;
import
configApi
from
'
@/../config/env.config
'
;
import
{
GoldCategory
}
from
'
@/config/app.config
'
;
@
connect
(({
goodsManage
,
menu
})
=>
({
@
connect
(({
goodsManage
,
menu
})
=>
({
goodsManage
,
goodsManage
,
...
@@ -343,6 +344,14 @@ class goodsManage extends Component {
...
@@ -343,6 +344,14 @@ class goodsManage extends Component {
if
(
data
)
{
if
(
data
)
{
const
SourceData
=
ProcessEditData
(
data
,
row
);
const
SourceData
=
ProcessEditData
(
data
,
row
);
console
.
log
(
'
index.js=============>
'
,
SourceData
);
console
.
log
(
'
index.js=============>
'
,
SourceData
);
// 投资金商品重量单位转换 从g转换为kg
if
(
SourceData
?.
infoMation
?.
categoryId
.
includes
(
GoldCategory
))
{
SourceData
.
skuList
?.
forEach
(
item
=>
{
if
(
item
.
weight
)
{
item
.
weight
=
+
(
item
.
weight
*
1000
).
toFixed
(
2
);
}
});
}
this
.
setState
({
this
.
setState
({
serviceData
:
SourceData
,
serviceData
:
SourceData
,
serviceVisble
:
true
,
serviceVisble
:
true
,
...
...
src/pages/ServiceGoods/config.js
View file @
4865061c
...
@@ -223,21 +223,21 @@ export const StaticColumns = customer => [
...
@@ -223,21 +223,21 @@ export const StaticColumns = customer => [
disabeldRender
:
()
=>
customer
.
isDisabled
,
disabeldRender
:
()
=>
customer
.
isDisabled
,
},
},
{
{
title
:
'
重量(kg)
'
,
title
:
`重量(
${
customer
.
isGold
?
'
g
'
:
'
kg
'
}
)`
,
dataIndex
:
'
weight
'
,
dataIndex
:
'
weight
'
,
editable
:
true
,
editable
:
true
,
batchRole
:
[
1
],
batchRole
:
[
1
],
batchProps
:
{
batchProps
:
{
min
:
0
,
min
:
0
,
precision
:
3
,
precision
:
customer
.
isGold
?
2
:
3
,
max
:
999999.999
,
max
:
customer
.
isGold
?
100
:
999999.999
,
},
},
role
:
[
1
],
role
:
[
1
],
roleRules
:
{
required
:
true
},
roleRules
:
{
required
:
true
},
roleProps
:
{
roleProps
:
{
min
:
0
,
min
:
0
,
precision
:
3
,
precision
:
customer
.
isGold
?
2
:
3
,
max
:
999999.999
,
max
:
customer
.
isGold
?
100
:
999999.999
,
},
},
disabeldRender
:
()
=>
customer
.
isDisabled
,
disabeldRender
:
()
=>
customer
.
isDisabled
,
},
},
...
...
src/pages/ServiceGoods/index.jsx
View file @
4865061c
...
@@ -29,6 +29,7 @@ import { isUrl, filterSendData, clearCurrent, onAutoSaveValue, localAutoSaveKey
...
@@ -29,6 +29,7 @@ import { isUrl, filterSendData, clearCurrent, onAutoSaveValue, localAutoSaveKey
import
{
ServiceContext
}
from
'
./context
'
;
import
{
ServiceContext
}
from
'
./context
'
;
import
{
GOOD_MANAGE
}
from
'
@/../config/permission.config
'
;
import
{
GOOD_MANAGE
}
from
'
@/../config/permission.config
'
;
import
styles
from
'
./common.less
'
;
import
styles
from
'
./common.less
'
;
import
{
GoldCategory
}
from
'
@/config/app.config
'
;
/**
/**
* 服务商品改造-商品模块
* 服务商品改造-商品模块
...
@@ -374,7 +375,7 @@ const ServiceGoods = options => {
...
@@ -374,7 +375,7 @@ const ServiceGoods = options => {
}
}
setPageLoading
(
false
);
setPageLoading
(
false
);
})();
})();
},
[
SourceData
]);
},
[
SourceData
,
categoryIds
]);
useEffect
(()
=>
{
useEffect
(()
=>
{
if
(
options
.
visible
)
{
if
(
options
.
visible
)
{
...
@@ -439,6 +440,15 @@ const ServiceGoods = options => {
...
@@ -439,6 +440,15 @@ const ServiceGoods = options => {
// 切换类目
// 切换类目
const
onCategoryChange
=
e
=>
{
const
onCategoryChange
=
e
=>
{
setCategoryIds
(
e
);
setCategoryIds
(
e
);
let
txt
=
''
;
if
(
categoryIds
.
includes
(
GoldCategory
))
{
txt
=
'
千克
'
;
}
else
if
(
e
.
includes
(
GoldCategory
))
{
txt
=
'
克
'
;
}
if
(
txt
)
{
message
.
warning
(
`商品品类已切换,规格重量单位已自动切换为
${
txt
}
`
,
6
);
}
};
};
// 保存草稿
// 保存草稿
...
@@ -504,6 +514,7 @@ const ServiceGoods = options => {
...
@@ -504,6 +514,7 @@ const ServiceGoods = options => {
canTakeawayService
,
// 是否可以添加外卖商品
canTakeawayService
,
// 是否可以添加外卖商品
isCard
:
productType
===
4
,
isCard
:
productType
===
4
,
isTakeawayService
:
productType
===
5
,
isTakeawayService
:
productType
===
5
,
isGold
:
categoryIds
.
includes
(
GoldCategory
),
// 投资金 重量显示克
// 0, "商品删除" 1, "新建" 2, "提交审核" 3, "待审核" 4, "驳回" 5, "未上架" 6, "已上架" 7, "已下架"
// 0, "商品删除" 1, "新建" 2, "提交审核" 3, "待审核" 4, "驳回" 5, "未上架" 6, "已上架" 7, "已下架"
isNormal
:
SourceData
.
state
&&
SourceData
.
state
!==
4
,
// 商品不是驳回状态
isNormal
:
SourceData
.
state
&&
SourceData
.
state
!==
4
,
// 商品不是驳回状态
// 当商品进行编辑 & 类型不为电子卡券 & 商品状态不为驳回 禁用当前功能
// 当商品进行编辑 & 类型不为电子卡券 & 商品状态不为驳回 禁用当前功能
...
@@ -516,7 +527,7 @@ const ServiceGoods = options => {
...
@@ -516,7 +527,7 @@ const ServiceGoods = options => {
return
(
return
(
<
Modal
<
Modal
title=
{
isEdit
?
'
修改商品
'
:
'
新增商品
'
}
title=
{
isEdit
?
'
修改商品
'
:
'
新增商品
'
}
visible
=
{
options
.
visible
}
open
=
{
options
.
visible
}
onCancel=
{
()
=>
handleCancel
()
}
onCancel=
{
()
=>
handleCancel
()
}
destroyOnClose
destroyOnClose
width=
{
1050
}
width=
{
1050
}
...
...
src/pages/ServiceGoods/utils.js
View file @
4865061c
...
@@ -3,6 +3,7 @@ import { sortBy } from 'lodash';
...
@@ -3,6 +3,7 @@ import { sortBy } from 'lodash';
import
UUID
from
'
../../utils/uuid
'
;
import
UUID
from
'
../../utils/uuid
'
;
import
localStorage
from
'
@/utils/localStorage
'
;
import
localStorage
from
'
@/utils/localStorage
'
;
import
{
debounce
,
getObjectType
,
isClass
}
from
'
@/utils/utils
'
;
import
{
debounce
,
getObjectType
,
isClass
}
from
'
@/utils/utils
'
;
import
{
GoldCategory
}
from
'
@/config/app.config
'
;
export
const
clearCurrent
=
currentList
=>
currentList
.
filter
(
item
=>
item
.
current
);
export
const
clearCurrent
=
currentList
=>
currentList
.
filter
(
item
=>
item
.
current
);
...
@@ -94,6 +95,11 @@ const filterItems = (type, props) => {
...
@@ -94,6 +95,11 @@ const filterItems = (type, props) => {
item
.
firstSpecId
=
infoSpecData
.
firstSpecId
;
item
.
firstSpecId
=
infoSpecData
.
firstSpecId
;
item
.
secondSpecId
=
infoSpecData
.
secondSpecId
||
null
;
item
.
secondSpecId
=
infoSpecData
.
secondSpecId
||
null
;
console
.
log
(
'
setMealContent :>>
'
,
setMealContent
);
console
.
log
(
'
setMealContent :>>
'
,
setMealContent
);
// 投资金 提交的时候 重量要从克转换成千克
if
(
infoMation
.
categoryId
.
includes
(
GoldCategory
)
&&
+
item
.
weight
)
{
const
w
=
+
item
.
weight
/
1000
;
item
.
weight
=
w
.
toFixed
(
5
);
}
if
(
type
===
4
)
{
if
(
type
===
4
)
{
item
.
serviceItem
=
{
item
.
serviceItem
=
{
...
serviceItem
,
...
serviceItem
,
...
...
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