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
34d37bb5
Commit
34d37bb5
authored
Nov 07, 2022
by
李腾
Browse files
Options
Browse Files
Download
Plain Diff
feat: 解决冲突
parents
29330223
aeac15f4
Changes
16
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
476 additions
and
54 deletions
+476
-54
.eslintrc.js
.eslintrc.js
+1
-0
env.config.js
config/env.config.js
+1
-1
index.jsx
src/pages/GoodsManage/createModal/index.jsx
+264
-12
infoAudit.jsx
src/pages/GoodsManage/createModal/infoAudit.jsx
+60
-0
index.jsx
src/pages/GoodsManage/index.jsx
+34
-14
service.js
src/pages/GoodsManage/service.js
+29
-0
staticdata.js
src/pages/GoodsManage/staticdata.js
+16
-2
style.less
src/pages/GoodsManage/style.less
+16
-0
upload.jsx
src/pages/PaymentMange/ToExamine/upload.jsx
+7
-5
EditFormTable.jsx
src/pages/ServiceGoods/components/EditFormTable.jsx
+0
-1
FormRuleSetting.jsx
src/pages/ServiceGoods/components/FormRuleSetting.jsx
+23
-2
FormRuleVPictures.jsx
src/pages/ServiceGoods/components/FormRuleVPictures.jsx
+1
-0
UploadImage.jsx
src/pages/ServiceGoods/components/UploadImage.jsx
+19
-15
config.js
src/pages/ServiceGoods/config.js
+1
-1
index.jsx
src/pages/orderManage/queryOrder/index.jsx
+1
-1
qiniu.js
src/services/qiniu.js
+3
-0
No files found.
.eslintrc.js
View file @
34d37bb5
...
...
@@ -14,5 +14,6 @@ module.exports = {
'
@typescript-eslint/no-unused-vars
'
:
[
'
off
'
],
'
import/no-unresolved
'
:
0
,
'
import/extensions
'
:
0
,
'
no-unused-expressions
'
:
[
'
error
'
,
{
allowShortCircuit
:
true
}],
},
};
config/env.config.js
View file @
34d37bb5
...
...
@@ -23,7 +23,7 @@ const prodApi = {
goodsApi
:
'
https://sc-merchant-api.q-gp.com
'
,
// 线上环境打包域名
qiniuHost
:
'
https://kdspstatic.q-gp.com/
'
,
// talos 后面要下线
opapiHost
:
'
//
talos.xyqb
.com
'
,
opapiHost
:
'
//
gw.yxmie
.com
'
,
// opapiHost: 'https://opapi.q-gp.com',
// querysApi: 'https://sc-settlement-api.q-gp.com',
querysApi
:
'
https://sc-merchant-api.q-gp.com/admin/merchant/sc-settlement
'
,
...
...
src/pages/GoodsManage/createModal/index.jsx
View file @
34d37bb5
This diff is collapsed.
Click to expand it.
src/pages/GoodsManage/createModal/infoAudit.jsx
0 → 100644
View file @
34d37bb5
import
React
,
{
useState
,
useEffect
}
from
'
react
'
;
import
{
Modal
,
Button
}
from
'
antd
'
;
import
{
apiQueryLastAuditRecord
}
from
'
../service
'
;
const
InfoAudit
=
props
=>
{
const
[
audit
,
setAudit
]
=
useState
({});
const
getRecord
=
async
()
=>
{
const
res
=
await
apiQueryLastAuditRecord
(
props
.
skuInfo
.
skuId
);
if
(
res
&&
res
.
data
)
{
console
.
log
(
'
res :>>
'
,
res
);
setAudit
(
res
.
data
);
}
};
const
getContent
=
()
=>
{
const
obj
=
{
1
:
'
-
'
,
2
:
'
审核通过
'
,
3
:
`审核拒绝,
${
audit
.
rejectReason
}
`
,
};
if
(
audit
)
{
return
obj
[
audit
.
status
]
||
''
;
}
return
''
;
};
useEffect
(()
=>
{
if
(
props
.
visible
)
{
getRecord
();
}
},
[
props
.
visible
]);
return
(
<
Modal
title=
"商品信息变更审核"
visible=
{
props
.
visible
}
closable=
{
false
}
footer=
{
[
audit
.
status
===
3
&&
props
.
canEditable
&&
(
props
.
skuInfo
.
state
===
4
||
(
props
.
skuInfo
.
state
>=
5
&&
props
.
skuInfo
.
updateState
!==
1
))
&&
(
<
Button
key=
"back"
type=
"primary"
onClick=
{
()
=>
props
.
onEdit
()
}
>
再次编辑
</
Button
>
),
<
Button
key=
"close"
onClick=
{
()
=>
props
.
onCancel
()
}
>
关闭
</
Button
>,
]
}
>
<
p
>
审核状态:
{
audit
.
statusDesc
}
</
p
>
<
p
>
申请时间:
{
audit
.
createdAt
}
</
p
>
<
p
>
审核结果:
{
getContent
()
}
</
p
>
</
Modal
>
);
};
export
default
InfoAudit
;
src/pages/GoodsManage/index.jsx
View file @
34d37bb5
import
{
Form
}
from
'
@ant-design/compatible
'
;
import
'
@ant-design/compatible/assets/index.css
'
;
import
{
Card
,
Pagination
,
Table
,
notification
,
Drawer
,
Spin
,
Button
}
from
'
antd
'
;
import
{
Card
,
Pagination
,
Table
,
notification
,
Drawer
,
Spin
,
Button
,
Modal
}
from
'
antd
'
;
import
React
,
{
Component
}
from
'
react
'
;
import
{
PageHeaderWrapper
}
from
'
@ant-design/pro-layout
'
;
import
{
connect
}
from
'
dva
'
;
import
{
sortBy
}
from
'
lodash
'
;
import
{
da
}
from
'
date-fns/locale
'
;
import
styles
from
'
./style.less
'
;
import
LocalStroage
from
'
@/utils/localStorage
'
;
import
configApi
from
'
../../../config/env.config
'
;
...
...
@@ -27,6 +26,7 @@ import { column, JDSHOPID, ProcessEditData } from './staticdata';
import
SearchForm
from
'
./SearchForm
'
;
import
TempleatModal
from
'
./TempleatModal
'
;
import
ServiceGoods
from
'
../ServiceGoods
'
;
import
InfoAudit
from
'
./createModal/infoAudit
'
;
import
{
GOOD_MANAGE
}
from
'
@/../config/permission.config
'
;
...
...
@@ -58,6 +58,8 @@ class goodsManage extends Component {
serviceVisble
:
false
,
serviceData
:
{},
visibleAuditModal
:
false
,
auditRow
:
{},
// 查看审核信息使用
};
currentLog
=
null
;
...
...
@@ -495,18 +497,20 @@ class goodsManage extends Component {
title=
"商品预览"
></
iframe
>
</
Drawer
>
<
CreateModal
initData=
{
this
.
state
.
initData
}
visible=
{
this
.
state
.
createVisible
}
onCancel=
{
()
=>
{
this
.
setState
({
createVisible
:
false
,
initData
:
{}
});
}
}
query=
{
()
=>
this
.
handleSearch
()
}
shopList=
{
this
.
filterShopList
(
this
.
shopList
,
Object
.
keys
(
this
.
state
.
initData
).
length
)
}
treeData=
{
this
.
state
.
treeData
}
virtualTreeData=
{
this
.
state
.
virtualTreeData
}
specListData=
{
this
.
state
.
specListData
}
></
CreateModal
>
{
this
.
state
.
createVisible
&&
(
<
CreateModal
initData=
{
this
.
state
.
initData
}
visible=
{
this
.
state
.
createVisible
}
onCancel=
{
()
=>
{
this
.
setState
({
createVisible
:
false
,
initData
:
{}
});
}
}
query=
{
()
=>
this
.
handleSearch
()
}
shopList=
{
this
.
filterShopList
(
this
.
shopList
,
Object
.
keys
(
this
.
state
.
initData
).
length
)
}
treeData=
{
this
.
state
.
treeData
}
virtualTreeData=
{
this
.
state
.
virtualTreeData
}
specListData=
{
this
.
state
.
specListData
}
></
CreateModal
>
)
}
<
UpdateStock
visible=
{
this
.
state
.
updateStockVisible
}
...
...
@@ -537,6 +541,22 @@ class goodsManage extends Component {
specListData=
{
this
.
state
.
specListData
}
/>
</
Spin
>
<
InfoAudit
visible=
{
this
.
state
.
visibleAuditModal
}
skuInfo=
{
this
.
state
.
auditRow
}
canEditable=
{
this
.
canEditable
}
onCancel=
{
()
=>
{
this
.
setState
({
visibleAuditModal
:
false
,
auditRow
:
{}
});
}
}
onEdit=
{
()
=>
{
this
.
setState
({
visibleAuditModal
:
false
,
auditRow
:
{}
});
if
(
this
.
state
.
auditRow
.
type
===
4
)
{
this
.
serviceVisbleChange
(
this
.
state
.
auditRow
);
}
else
{
this
.
onUpdateInfo
(
this
.
state
.
auditRow
);
}
}
}
/>
</
PageHeaderWrapper
>
);
}
...
...
src/pages/GoodsManage/service.js
View file @
34d37bb5
...
...
@@ -9,6 +9,10 @@ const headers = {
'
Content-Type
'
:
'
application/x-www-form-urlencoded
'
,
};
/**
* 商品列表
* yapi: http://yapi.quantgroups.com/project/389/interface/api/23814
*/
export
async
function
searchList
(
params
)
{
return
request
.
post
(
'
/product/api/merchant/page
'
,
{
prefix
:
goodsApi
,
...
...
@@ -42,6 +46,16 @@ export async function getBrandList() {
});
}
// 获取类目关联属性
export
async
function
apiGetAttribute
(
categoryId
)
{
const
data
=
await
request
.
get
(
`/api/kdsp/category/template/ref/attribute/detail?categoryId=
${
categoryId
}
`
,
{
prefix
:
goodsApi
,
},
);
return
data
;
}
// 编辑--获取详情
export
async
function
spuDetail
(
params
)
{
return
request
.
post
(
'
/product/api/merchant/detail
'
,
{
...
...
@@ -73,6 +87,15 @@ export async function categoryList() {
prefix
:
goodsApi
,
});
}
/**
* 商品分类
* type 商品类型:1-实物类,2-虚拟类,4-服务类
* */
export
async
function
apiCategoryListType
(
type
)
{
return
request
.
get
(
`/product/category/getByProductType/
${
type
}
`
,
{
prefix
:
goodsApi
,
});
}
// 批量修改
export
async
function
uploadFile
(
file
)
{
...
...
@@ -240,3 +263,9 @@ export const apiChangeStateGoods = async params => {
});
return
data
;
};
// 查询sku最后一条审核记录
export
const
apiQueryLastAuditRecord
=
skuId
=>
request
.
get
(
`/api/kdsp/sku/last/audit/record?skuId=
${
skuId
}
`
,
{
prefix
:
goodsApi
,
});
src/pages/GoodsManage/staticdata.js
View file @
34d37bb5
...
...
@@ -3,7 +3,7 @@ import { Button, Badge, Switch, Modal } from 'antd';
import
{
ExclamationCircleOutlined
}
from
'
@ant-design/icons
'
;
import
styles
from
'
./style.less
'
;
import
{
resetTime
}
from
'
../../utils/utils
'
;
import
{
apiChangeStateGoods
}
from
'
./service
'
;
import
{
apiChangeStateGoods
,
apiQueryLastAuditRecord
}
from
'
./service
'
;
const
{
confirm
}
=
Modal
;
...
...
@@ -50,6 +50,12 @@ export function column() {
},
});
};
const
onShowAudit
=
row
=>
{
this
.
setState
({
auditRow
:
row
,
visibleAuditModal
:
true
,
});
};
return
[
{
...
...
@@ -183,7 +189,15 @@ export function column() {
render
:
(
_
,
row
)
=>
(
<
div
>
<
p
>
{
row
.
state
>=
5
?
'
审核通过
'
:
_
}
<
/p
>
<
p
>
{
row
.
updateStateDesc
||
'
_ _
'
}
<
/p
>
<
div
>
{
row
.
updateState
?
(
<
Button
onClick
=
{()
=>
onShowAudit
(
row
)}
type
=
"
link
"
>
{
row
.
updateStateDesc
}
<
/Button
>
)
:
(
'
--
'
)}
<
/div
>
<
/div
>
),
},
...
...
src/pages/GoodsManage/style.less
View file @
34d37bb5
...
...
@@ -110,3 +110,19 @@
color: #d9363e;
line-height: 1;
}
.cardTitle {
padding: 15px;
font-weight: bold;
font-size: 18px;
}
.stateAuditTxt {
color: #1890ff;
cursor: pointer;
}
.attrbox {
max-height: 384px;
overflow: hidden;
}
.attrboxMore {
max-height: max-content;
}
src/pages/PaymentMange/ToExamine/upload.jsx
View file @
34d37bb5
...
...
@@ -46,19 +46,21 @@ class PicturesWall extends React.Component {
};
customRequest
=
({
file
,
onError
,
onSuccess
})
=>
{
let
filename
=
''
;
let
suffix
=
''
;
if
(
file
.
name
)
{
const
lastFile
=
file
.
name
.
split
(
'
.
'
);
const
index
=
lastFile
.
length
-
1
;
const
index
=
file
.
name
.
lastIndexOf
(
'
.
'
);
filename
=
file
.
name
.
substr
(
0
,
index
);
suffix
=
file
.
name
.
substr
(
index
+
1
,
file
.
name
.
length
-
1
);
const
types
=
[
'
pdf
'
,
'
doc
'
,
'
docx
'
,
'
zip
'
,
'
rar
'
,
'
png
'
,
'
jpeg
'
];
if
(
!
types
.
includes
(
lastFile
[
index
]
))
{
if
(
!
types
.
includes
(
suffix
))
{
message
.
error
(
'
文件格式错误!
'
);
return
;
}
}
const
vm
=
this
;
const
name
=
file
.
name
+
file
.
uid
;
// eslint-disable-next-line new-cap
const
data
=
file
.
name
+
new
Date
().
getTime
()
;
const
data
=
`
${
filename
}
-
${
new
Date
().
getTime
()}
.
${
suffix
}
`
;
const
observable
=
qiniu
.
upload
(
file
,
data
,
token
);
const
observer
=
{
next
()
{
...
...
src/pages/ServiceGoods/components/EditFormTable.jsx
View file @
34d37bb5
...
...
@@ -172,7 +172,6 @@ const EditFormTable = forwardRef((props, ref) => {
return
(
<>
<
Form
form=
{
form
}
scrollToFirstError
component=
{
false
}
>
{
/* <Button onClick={onCheck}>测试</Button> */
}
<
EditableContext
.
Provider
value=
{
form
}
>
<
Table
scroll=
{
{
y
:
300
,
x
:
1000
}
}
...
...
src/pages/ServiceGoods/components/FormRuleSetting.jsx
View file @
34d37bb5
...
...
@@ -24,10 +24,24 @@ const FormRuleSetting = forwardRef((props, ref) => {
const
[
form
]
=
Form
.
useForm
();
const
customer
=
useContext
(
ServiceContext
);
// 判断是否有禁用的店铺 禁用店铺不显示
const
getIsInShops
=
arr
=>
{
const
list
=
[];
arr
.
forEach
(
item
=>
{
supplierIdList
.
some
(
s
=>
+
s
.
id
===
+
item
)
&&
list
.
push
(
item
);
});
return
list
;
};
useEffect
(()
=>
{
if
(
customer
.
isEdit
)
{
if
(
!
editData
)
return
;
form
.
setFieldsValue
(
editData
);
const
goodInfo
=
Object
.
assign
({},
editData
);
if
(
goodInfo
.
shopIds
)
{
const
shopIds
=
getIsInShops
(
editData
.
shopIds
);
goodInfo
.
shopIds
=
shopIds
;
}
form
.
setFieldsValue
(
goodInfo
);
}
},
[
customer
.
isEdit
,
editData
]);
...
...
@@ -98,7 +112,14 @@ const FormRuleSetting = forwardRef((props, ref) => {
label=
"适用门店"
rules=
{
[{
required
:
true
,
message
:
'
请选择适用门店!
'
,
type
:
'
array
'
}]
}
>
<
Select
mode=
"multiple"
placeholder=
"请选择适用门店"
>
<
Select
mode=
"multiple"
placeholder=
"请选择适用门店"
showSearch
filterOption=
{
(
input
,
option
)
=>
option
.
props
.
children
.
toLowerCase
().
indexOf
(
input
.
toLowerCase
())
>=
0
}
>
{
(
supplierIdList
||
[]).
map
(
item
=>
(
<
Option
value=
{
+
item
.
id
}
key=
{
item
.
id
}
>
{
item
.
name
}
...
...
src/pages/ServiceGoods/components/FormRuleVPictures.jsx
View file @
34d37bb5
...
...
@@ -142,6 +142,7 @@ const FormRuleVPictures = forwardRef((props, ref) => {
>
<
UploadImage
disabled=
{
customer
.
isService
}
multiple=
{
false
}
name=
"commonImageList"
limit=
{
imgConfig
.
commonImageList
.
limit
}
pictures=
{
commonImageList
}
...
...
src/pages/ServiceGoods/components/UploadImage.jsx
View file @
34d37bb5
...
...
@@ -192,21 +192,25 @@ const UploadImage = forwardRef((props, ref) => {
</
ReactSortable
>
)
}
</
div
>
<
Upload
{
...
uploadParams
}
disabled=
{
Boolean
(
disabled
)
}
multiple=
{
multiple
}
name=
{
name
}
customRequest=
{
()
=>
{}
}
listType=
"picture-card"
beforeUpload=
{
defaultBeforeUpload
}
fileList=
{
fileList
}
onPreview=
{
handlePreview
}
onRemove=
{
handleRemove
}
showUploadList=
{
false
}
>
{
limit
!==
null
&&
fileList
.
length
>=
limit
?
null
:
UploadButton
}
</
Upload
>
{
limit
!==
null
&&
fileList
.
length
>=
limit
?
(
''
)
:
(
<
Upload
{
...
uploadParams
}
disabled=
{
Boolean
(
disabled
)
}
multiple=
{
multiple
}
name=
{
name
}
customRequest=
{
()
=>
{}
}
listType=
"picture-card"
beforeUpload=
{
defaultBeforeUpload
}
fileList=
{
fileList
}
onPreview=
{
handlePreview
}
onRemove=
{
handleRemove
}
showUploadList=
{
false
}
>
{
UploadButton
}
</
Upload
>
)
}
<
Modal
visible=
{
previewVisible
}
title=
{
previewTitle
}
footer=
{
null
}
onCancel=
{
handleCancel
}
>
<
img
alt=
"example"
style=
{
{
width
:
'
100%
'
}
}
src=
{
previewImage
}
/>
</
Modal
>
...
...
src/pages/ServiceGoods/config.js
View file @
34d37bb5
...
...
@@ -236,7 +236,7 @@ export const StaticColumns = customer => [
min
:
0
,
},
roleRules
:
{
required
:
true
},
disabeldRender
:
()
=>
customer
.
isService
,
disabeldRender
:
v
=>
v
.
id
&&
customer
.
isService
,
},
{
title
:
'
库存预警
'
,
...
...
src/pages/orderManage/queryOrder/index.jsx
View file @
34d37bb5
...
...
@@ -252,7 +252,7 @@ const OrderList = props => {
dataIndex
:
'
receiverName
'
,
rowSpanMode
:
'
auto
'
,
width
:
150
,
render
:
({
value
,
record
})
=>
`
${
value
}
/
${
record
.
receiverMobile
}
`
,
render
:
({
value
,
record
})
=>
`
${
value
||
'
-
'
}
/
${
record
.
receiverMobile
||
'
-
'
}
`
,
},
{
title
:
'
付款金额(元)
'
,
...
...
src/services/qiniu.js
View file @
34d37bb5
...
...
@@ -4,6 +4,9 @@ import config from '../../config/env.config';
export
async
function
qiniuToken
()
{
const
data
=
await
request
.
get
(
'
/api/kdsp/common/upload/token
'
,
{
prefix
:
config
.
opapiHost
,
headers
:
{
'
qg-tenant-id
'
:
560761
,
},
});
return
data
?.
data
?.
token
;
}
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