Commit 3f7fc261 authored by 前端-钟卫鹏's avatar 前端-钟卫鹏

feat:对接品牌相关功能

parent 88bbcb19
...@@ -12,7 +12,7 @@ const ReutrnEle:React.FC<IProps> = (props) => { ...@@ -12,7 +12,7 @@ const ReutrnEle:React.FC<IProps> = (props) => {
const { description, logoSrc } = props const { description, logoSrc } = props
return <> return <>
<span style={{fontSize:15,color:'#6B778CFF'}}><ArrowLeftOutlined /> {logoSrc?<img src={logoSrc} style={{width:48,height:48,margin:'0 14px'}}/>:description}</span> <span style={{fontSize:15,color:'#6B778CFF'}}><ArrowLeftOutlined /> {logoSrc?<img src={logoSrc} style={{width:48,height:48,margin:'0 0 0 14px'}}/>:description}</span>
</> </>
} }
......
...@@ -375,6 +375,7 @@ const ClassProperty: React.FC<{}> = () => { ...@@ -375,6 +375,7 @@ const ClassProperty: React.FC<{}> = () => {
<Option value={1}>实物商品</Option> <Option value={1}>实物商品</Option>
<Option value={2}>虚拟商品</Option> <Option value={2}>虚拟商品</Option>
<Option value={3}>服务商品</Option> <Option value={3}>服务商品</Option>
<Option value={4}>积分兑换商品</Option>
</Select> </Select>
</Form.Item> </Form.Item>
</Col> </Col>
......
This diff is collapsed.
.proveBox{
width:175px;
height:120px;
border:1px solid rgba(235,236,240,1);
img {
height: 100%;
padding: 18px;
}
}
\ No newline at end of file
import React, { ReactNode, useRef, useEffect } from 'react' import React, { ReactNode, useRef, useEffect } from 'react'
import { history } from 'umi' import { history } from 'umi'
import { Button, Popconfirm, Card, message } from 'antd' import { Button, Popconfirm, Card, message, Dropdown, Menu } from 'antd'
import { PageHeaderWrapper } from '@ant-design/pro-layout' import { PageHeaderWrapper } from '@ant-design/pro-layout'
import { import {
PlusOutlined, PlusOutlined,
PlayCircleOutlined, PlayCircleOutlined,
EyeOutlined, EyeOutlined,
PauseCircleOutlined PauseCircleOutlined,
DownOutlined,
CaretDownOutlined
} from '@ant-design/icons' } from '@ant-design/icons'
import { StandardTable } from 'god' import { StandardTable } from 'god'
import { ColumnType } from 'antd/lib/table/interface' import { ColumnType } from 'antd/lib/table/interface'
import { getTradeMarkLists, updateTradeMarkStatus, deleteTradeMark } from '@/services/trademark' import { getTradeMarkLists, updateTradeMarkStatus, deleteTradeMark, applyCheckTradeMark } from '@/services/trademark'
import moment from 'moment' import moment from 'moment'
const Trademark: React.FC<{}> = () => { const Trademark: React.FC<{}> = () => {
...@@ -42,7 +44,7 @@ const Trademark: React.FC<{}> = () => { ...@@ -42,7 +44,7 @@ const Trademark: React.FC<{}> = () => {
title: '申请时间', title: '申请时间',
dataIndex: 'applyTime', dataIndex: 'applyTime',
key: 'applyTime', key: 'applyTime',
render: (text: any, record: any) => moment(text).format('YYYY-MM-DD HH:mm:ss') render: (text: any, record: any) => text && moment(text).format('YYYY-MM-DD HH:mm:ss')
}, },
{ {
title: '状态', title: '状态',
...@@ -90,17 +92,33 @@ const Trademark: React.FC<{}> = () => { ...@@ -90,17 +92,33 @@ const Trademark: React.FC<{}> = () => {
render: (text: any, record: any) => { render: (text: any, record: any) => {
return ( return (
<> <>
{record.status === 1 ? <Button type='link'>提交审核</Button> : ''} {record.status === 1 ? <Button type='link' onClick={()=>handleApplyCheck(record)}>提交审核</Button> : ''}
{(record.status === 1 || record.status === 3) ? <Button type='link'>修改</Button> : ''} {(record.status === 1 || record.status === 3) ?
<Popconfirm <Dropdown overlay={
title="确定要执行这个操作?" <Menu>
onConfirm={() => handelDelete(record)} <Menu.Item>
onCancel={cancel} <Button type='link' onClick={()=>history.push(`/memberCenter/commodityAbility/trademark/addBrand?id=${record.id}`)}>修改</Button>
okText="是" </Menu.Item>
cancelText="否" <Menu.Item>
> <Button type='link' onClick={() => handelDelete(record)}>删除</Button>
<Button type='link'>删除</Button> </Menu.Item>
</Popconfirm> </Menu>
}>
<a className="ant-dropdown-link" onClick={e => e.preventDefault()}>
更多 <CaretDownOutlined />
</a>
</Dropdown> : <>
<Popconfirm
title="确定要执行这个操作?"
onConfirm={() => handelDelete(record)}
onCancel={cancel}
okText="是"
cancelText="否"
>
<Button type='link'>删除</Button>
</Popconfirm>
</>
}
</> </>
) )
} }
...@@ -135,6 +153,15 @@ const Trademark: React.FC<{}> = () => { ...@@ -135,6 +153,15 @@ const Trademark: React.FC<{}> = () => {
} }
}) })
} }
const handleApplyCheck = (record:any) => {
applyCheckTradeMark({id: record.id}).then(res=>{
if(res.code === 1000){
message.success(res.message)
//@ts-ignore
ref.current.reload()
}
})
}
return ( return (
<PageHeaderWrapper> <PageHeaderWrapper>
......
import React, { useState, useRef, ReactNode } from 'react' import React, { useState, useRef, ReactNode, useEffect } from 'react'
import { history } from 'umi' import { history } from 'umi'
import { Button, Steps, Card, Space, Tooltip, Row, Col, Descriptions, Table } from 'antd' import { Button, Steps, Card, Space, Tooltip, Row, Col, Descriptions, Table } from 'antd'
import { PageHeaderWrapper } from '@ant-design/pro-layout' import { PageHeaderWrapper } from '@ant-design/pro-layout'
...@@ -10,129 +10,165 @@ import { ...@@ -10,129 +10,165 @@ import {
} from '@ant-design/icons' } from '@ant-design/icons'
import { ColumnType } from 'antd/lib/table/interface' import { ColumnType } from 'antd/lib/table/interface'
import ReutrnEle from '@/components/ReturnEle' import ReutrnEle from '@/components/ReturnEle'
import { getTradeMarkDetail, getTradeMarkCheckRecord } from '@/services/trademark'
import moment from 'moment'
import styles from './index.less'
const { Step } = Steps; const { Step } = Steps;
const viewBrand: React.FC<{}> = () => { const viewBrand: React.FC<{}> = () => {
const dataSource = [ const [queryId, setQueryId] = useState<number>(null)
{ const [brandInfo, setBrandInfo] = useState<any>({})
key: '1', const [fixStep, setFixStep] = useState(0)
name: '供应商', const [recordData, setRecordData] = useState<any[]>([])
status: 0,
action: '提交审核', useEffect(() => {
time: '2015-44-15 12:34:32', const { id } = history.location.query
advice: '同意', if(id){
}, setQueryId(id)
{ getTradeMarkDetail({id: id}).then(res => {
key: '2', console.log(res.data, 'data')
name: '平台', if(res.code===1000){
status: 2, setBrandInfo(res.data)
action: '品牌审核', if(res.data.status===1)
time: '2334-23-32 45:23:21', setFixStep(0)
advice: '重新整改', else if(res.data.status===2)
}, setFixStep(1)
]; }
})
getTradeMarkCheckRecord({brandId: id}).then(res=> {
if(res.code===1000)
setRecordData(res.data)
})
}
}, [])
const columns: ColumnType<any>[] = [ const columns: ColumnType<any>[] = [
{ {
title: '序号', title: '序号',
dataIndex: 'key', dataIndex: 'id',
key: 'key', key: 'id',
align: 'center', render: (text, record, index)=> index+1
}, },
{ {
title: '角色', title: '角色',
dataIndex: 'name', dataIndex: 'merchantRoleName',
key: 'name', key: 'merchantRoleName',
align: 'center',
}, },
{ {
title: '状态', title: '状态',
dataIndex: 'status', dataIndex: 'status',
key: 'status', key: 'status',
align: 'center',
render: (text:any, record:any) => { render: (text:any, record:any) => {
let component: ReactNode = null let component: ReactNode = null
if(record.status === 0) if(record.status === 1)
component = (<><span className="commonStatusValid"></span>通过</>) component = (<><span className="commonStatusInvalid"></span>待提交审核</>)
else if(record.status === 1)
component = (<><span className="commonStatusInvalid"></span>待提交</>)
else if(record.status === 2) else if(record.status === 2)
component = (<><span className="commonStatusModify"></span>待审核</>) component = (<><span className="commonStatusModify"></span>待审核</>)
else if(record.status === 3) else if(record.status === 3)
component = (<><span className="commonStatusStop"></span>审核不通过</>) component = (<><span className="commonStatusStop"></span>审核不通过</>)
else if(record.status === 4)
component = (<><span className="commonStatusValid"></span>审核通过</>)
return component return component
} }
}, },
{ {
title: '操作', title: '操作',
dataIndex: 'action', dataIndex: 'operation',
key: 'action', key: 'operation',
align: 'center', render: (text:any, record:any) => {
let component: ReactNode = null
if(record.operation === 1)
component = (<>新增</>)
else if(record.operation === 2)
component = (<>修改</>)
else if(record.operation === 3)
component = (<>审核</>)
return component
}
}, },
{ {
title: '操作时间', title: '操作时间',
dataIndex: 'time', dataIndex: 'createTime',
key: 'time', key: 'createTime',
align: 'center', render: (text:any, record:any) => moment(text).format('YYYY-MM-DD HH:mm:ss')
}, },
{ {
title: '意见', title: '意见',
dataIndex: 'advice', dataIndex: 'checkRemark',
key: 'advice', key: 'checkRemark',
align: 'center',
}, },
]; ];
const tips = <>证明材料<Tooltip title="这是一段描述的文字"><span>&nbsp;<QuestionCircleOutlined /></span></Tooltip></> const fixStatus = (state: number) => {
if(state === 1)
return <><span className="commonStatusInvalid"></span>待提交审核</>
else if(state === 2)
return <><span className="commonStatusModify"></span>待审核</>
else if(state === 3)
return <><span className="commonStatusStop"></span>审核不通过</>
else if(state === 4)
return <><span className="commonStatusValid"></span>审核通过</>
else if(state === 5)
return <><span className="commonStatusValid"></span>已上架</>
else if(state === 6)
return <><span className="commonStatusStop"></span>已下架</>
}
const fixProveUrl = (proveInfo: any) => {
if(proveInfo){
let imgArray = Object.values(proveInfo)
return imgArray.map((item: string, index: number) => <Col key={index} span={3}>
<div className={styles.proveBox}>
<img src={item} alt=""/>
</div>
</Col>
)
}
}
const tips = <>证明材料<Tooltip title="证明材料:如商标注册证书、品牌授权证书等证明材料"><span>&nbsp;<QuestionCircleOutlined /></span></Tooltip></>
const content = <> const content = <>
<Descriptions colon={true} style={{textAlign: 'center'}}> <Descriptions colon={true} style={{textAlign: 'center'}}>
<Descriptions.Item label="申请审核时间">2020-08-25 09:00:32</Descriptions.Item> <Descriptions.Item label="申请审核时间">{brandInfo.applyTime && moment(brandInfo.applyTime).format('YYYY-MM-DD HH:mm:ss')}</Descriptions.Item>
<Descriptions.Item label="审核状态"><span className="commonStatusValid"></span>通过</Descriptions.Item> <Descriptions.Item label="审核状态">
<Descriptions.Item label="品牌状态">有效</Descriptions.Item> {
fixStatus(brandInfo?.status)
}
</Descriptions.Item>
<Descriptions.Item label="品牌状态">{brandInfo.isEnable?'有效':'无效'}</Descriptions.Item>
</Descriptions> </Descriptions>
</> </>
return ( return (
<PageHeaderWrapper <PageHeaderWrapper
title="万宝龙" title={brandInfo?.name}
onBack={() => history.goBack()} onBack={() => history.goBack()}
backIcon={<ReutrnEle logoSrc='https://avatars1.githubusercontent.com/u/8186664?s=460&v=4' />} backIcon={<ReutrnEle logoSrc={brandInfo?.logoUrl} />}
content={content} content={content}
extra={[ extra={[
<Button icon={<FormOutlined />} key="1" type="primary"> <Button
icon={<FormOutlined />}
key="1"
type="primary"
onClick={()=>history.push(`/memberCenter/commodityAbility/trademark/addBrand?id=${brandInfo.id}`)}
disabled={!(brandInfo.status===1||brandInfo.status===3)}
>
修改 修改
</Button>, </Button>,
]} ]}
> >
<Space direction="vertical" style={{width:'100%'}}> <Space direction="vertical" style={{width:'100%'}}>
<Card headStyle={{borderBottom:'none'}} title={tips}> <Card headStyle={{borderBottom:'none'}} title={tips}>
<Row> <Row gutter={24}>
<Col span={4}> {
<div>横版</div> fixProveUrl(brandInfo.proveUrl)
</Col> }
<Col span={4}>
<div>竖版</div>
</Col>
<Col span={4}>
<div>上版</div>
</Col>
<Col span={4}>
<div>下版</div>
</Col>
<Col span={4}>
<div>左版</div>
</Col>
<Col span={4}>
<div>右版</div>
</Col>
</Row> </Row>
</Card> </Card>
</Space> </Space>
<Space direction="vertical" style={{width:'100%'}}> <Space direction="vertical" style={{width:'100%'}}>
<Card headStyle={{borderBottom:'none'}} title="流程进度"> <Card headStyle={{borderBottom:'none'}} title="流程进度">
<Steps progressDot current={2}> <Steps progressDot current={fixStep}>
<Step title="提交审核" description="供应商" /> <Step title="提交审核" description="供应商" />
<Step title="审核品牌" description="平台" /> <Step title="审核品牌" description="平台" />
<Step title="完成" description="" /> <Step title="完成" description="" />
...@@ -141,7 +177,7 @@ const viewBrand: React.FC<{}> = () => { ...@@ -141,7 +177,7 @@ const viewBrand: React.FC<{}> = () => {
</Space> </Space>
<Space direction="vertical" style={{width:'100%'}}> <Space direction="vertical" style={{width:'100%'}}>
<Card headStyle={{borderBottom:'none'}} title="审核历史"> <Card headStyle={{borderBottom:'none'}} title="审核历史">
<Table dataSource={dataSource} columns={columns} pagination={false} /> <Table dataSource={recordData} columns={columns} pagination={false} />
</Card> </Card>
</Space> </Space>
</PageHeaderWrapper> </PageHeaderWrapper>
......
...@@ -14,10 +14,7 @@ declare namespace TradeMarkApi { ...@@ -14,10 +14,7 @@ declare namespace TradeMarkApi {
status: number; status: number;
checkTime: string; checkTime: string;
isEnable: boolean; isEnable: boolean;
proveUrl: { proveUrl: {}
mapkey: {},
mapValue: {}
}
} }
export interface TradeMarkListsModel { export interface TradeMarkListsModel {
...@@ -42,4 +39,19 @@ declare namespace TradeMarkApi { ...@@ -42,4 +39,19 @@ declare namespace TradeMarkApi {
isEnable: boolean; isEnable: boolean;
} }
export interface TradeMarkRecordByQueryDTO {
brandId: number;
}
export interface TradeMarkRecodModel {
id: number;
merchantRoleId: number;
merchantRoleName: string;
status: number;
createTime: number;
operation: number;
checkRemark: string;
brandId: number;
}
} }
\ No newline at end of file
...@@ -73,4 +73,11 @@ export async function applyCheckTradeMark(params: TradeMarkApi.TradeMarkByQueryD ...@@ -73,4 +73,11 @@ export async function applyCheckTradeMark(params: TradeMarkApi.TradeMarkByQueryD
prefix, prefix,
params params
}) })
}
export async function getTradeMarkCheckRecord(params: TradeMarkApi.TradeMarkRecordByQueryDTO) {
return request<TradeMarkApi.TradeMarkRecodModel[]>('/brand/getBrandCheckRecord', {
prefix,
params
})
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment