Commit 250c34de authored by 王苓芝's avatar 王苓芝

接口联调

parent c6d90926
...@@ -6,7 +6,7 @@ import Detail from '../components/detail'; ...@@ -6,7 +6,7 @@ import Detail from '../components/detail';
import ImgModal from '../components/imgModal'; import ImgModal from '../components/imgModal';
import styles from './styles.less'; import styles from './styles.less';
import { columns } from './staticdata'; import { columns } from './staticdata';
import { query, getDetail } from './services'; import { query, getDetail, audit } from './services';
const Appeal = () => { const Appeal = () => {
// const protable = useRef(); // const protable = useRef();
...@@ -17,8 +17,17 @@ const Appeal = () => { ...@@ -17,8 +17,17 @@ const Appeal = () => {
const [imgData, getImgData] = useState([]); const [imgData, getImgData] = useState([]);
const [imgTitle, changeImgTitle] = useState(''); const [imgTitle, changeImgTitle] = useState('');
const audit = async row => { const handleAudit = async row => {
console.log('selected-row', row); console.log('selected-row', row);
const data = await audit({
appealNo: row.appealNo,
appealResult: row.appealResult,
refuseReason: row.refuseReason,
receiverName: row.merchantName,
receiverPhone: row.merchantPhone,
receiveAddress: row.merchantAddress,
});
console.log('data-audiit', data);
}; };
const openDetail = async row => { const openDetail = async row => {
const detailData = await getDetail({ appealNo: row.appealNo }); const detailData = await getDetail({ appealNo: row.appealNo });
...@@ -40,7 +49,7 @@ const Appeal = () => { ...@@ -40,7 +49,7 @@ const Appeal = () => {
changeImgModal(false); changeImgModal(false);
}; };
const res = { const res = {
audit, handleAudit,
openDetail, openDetail,
openImgModal, openImgModal,
}; };
...@@ -54,9 +63,8 @@ const Appeal = () => { ...@@ -54,9 +63,8 @@ const Appeal = () => {
}} }}
columns={columns(res)} columns={columns(res)}
request={params => query({ ...params })} request={params => query({ ...params })}
rowKey="appealNo" rowKey={r => r.orderNo}
expandIconColumnIndex={10} expandIconColumnIndex={10}
key="appealNo"
bordered bordered
className={styles.table} className={styles.table}
toolBarRender={false} toolBarRender={false}
......
import { stringify } from 'querystring'; import { stringify } from 'querystring';
import _ from 'lodash'; import _ from 'lodash';
import request from '@/utils/request'; import request from '@/utils/request';
// import config from '../../../../config/env.config'; import config from '../../../../config/env.config';
export async function query(params) { export async function query(param) {
const params = {
...param,
pageNo: param.current,
};
const data = await request.post('/api/kdsp/op/appeal/list', { const data = await request.post('/api/kdsp/op/appeal/list', {
prefix: 'http://yapi.quantgroups.com/mock/351', // prefix: 'http://yapi.quantgroups.com/mock/351',
prefix: config.kdspApi,
data: stringify(_.omitBy(params, v => !v)), data: stringify(_.omitBy(params, v => !v)),
headers: { headers: {
'Content-Type': 'application/x-www-form-urlencoded', 'Content-Type': 'application/x-www-form-urlencoded',
...@@ -19,8 +24,20 @@ export async function query(params) { ...@@ -19,8 +24,20 @@ export async function query(params) {
export async function getDetail(params) { export async function getDetail(params) {
const { data } = await request.post('/api/kdsp/op/appeal/info', { const { data } = await request.post('/api/kdsp/op/appeal/info', {
data: stringify(_.omitBy(params, v => !v)), data: stringify(_.omitBy(params, v => !v)),
// prefix: config.kdspApi, prefix: config.kdspApi,
prefix: 'http://yapi.quantgroups.com/mock/351', // prefix: 'http://yapi.quantgroups.com/mock/351',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
},
});
return data;
}
export async function audit(params) {
const { data } = await request.post('/api/kdsp/op/appeal/audit', {
data: stringify(params),
prefix: config.kdspApi,
// prefix: 'http://yapi.quantgroups.com/mock/351',
headers: { headers: {
'Content-Type': 'application/x-www-form-urlencoded', 'Content-Type': 'application/x-www-form-urlencoded',
}, },
......
import { Button } from 'antd'; import { Button, Tag } from 'antd';
import React from 'react'; import React from 'react';
export const refuseReasonEnum = {
0: { text: '待操作' },
1: { text: '已确认' },
2: { text: '已拒绝' },
};
export function columns(res) { export function columns(res) {
console.log('res', res); const { handleAudit, openDetail, openImgModal } = res;
const { audit, openDetail, openImgModal } = res;
return [ return [
{ {
title: '售后申诉单ID', title: '售后申诉单ID',
...@@ -19,15 +24,21 @@ export function columns(res) { ...@@ -19,15 +24,21 @@ export function columns(res) {
}, },
{ {
title: '订单ID', title: '订单ID',
width: 120, width: 200,
dataIndex: 'orderNo', dataIndex: 'orderNo',
key: 'orderNo', key: 'orderNo',
render: (orderNo, row) => (
<Tag color={row.timeout ? 'red' : 'green'} key={orderNo}>
{orderNo}
</Tag>
),
}, },
{ {
title: '介入单开始时间', title: '介入单开始时间',
width: 120, width: 120,
dataIndex: 'startDate', dataIndex: 'startDate',
key: 'startDate', key: 'startDate',
valueType: 'date',
hideInTable: true, hideInTable: true,
}, },
{ {
...@@ -35,6 +46,7 @@ export function columns(res) { ...@@ -35,6 +46,7 @@ export function columns(res) {
width: 120, width: 120,
dataIndex: 'endDate', dataIndex: 'endDate',
key: 'endDate', key: 'endDate',
valueType: 'date',
hideInTable: true, hideInTable: true,
}, },
{ {
...@@ -121,6 +133,7 @@ export function columns(res) { ...@@ -121,6 +133,7 @@ export function columns(res) {
dataIndex: 'appealResult', dataIndex: 'appealResult',
key: 'appealResult', key: 'appealResult',
hideInSearch: true, hideInSearch: true,
valueEnum: refuseReasonEnum,
}, },
{ {
title: '售后申诉拒绝原因', title: '售后申诉拒绝原因',
...@@ -136,10 +149,10 @@ export function columns(res) { ...@@ -136,10 +149,10 @@ export function columns(res) {
valueType: 'option', valueType: 'option',
key: 'option', key: 'option',
render: (_, row) => [ render: (_, row) => [
<Button type="primary" key="1" onClick={() => audit(row)}> <Button disabled={!row.showAudit} type="primary" onClick={() => handleAudit(row)}>
审核 审核
</Button>, </Button>,
<Button type="primary" key="2" onClick={() => openDetail(row)}> <Button disabled={!row.showDetail} type="primary" onClick={() => openDetail(row)}>
查看详情 查看详情
</Button>, </Button>,
], ],
......
...@@ -53,7 +53,7 @@ const AppealDetail = props => { ...@@ -53,7 +53,7 @@ const AppealDetail = props => {
<Col span={3}>售后凭证:</Col> <Col span={3}>售后凭证:</Col>
{data.proofs && {data.proofs &&
data.proofs.split(',').map(item => ( data.proofs.split(',').map(item => (
<Col key={item}> <Col key={item} span={8}>
<img key={item} width="100%" src={item} alt="" /> <img key={item} width="100%" src={item} alt="" />
</Col> </Col>
))} ))}
...@@ -65,11 +65,11 @@ const AppealDetail = props => { ...@@ -65,11 +65,11 @@ const AppealDetail = props => {
</Col> </Col>
</Row> </Row>
<Row type="flex" justify="start" align="middle" gutter={[10, 20]}> <Row type="flex" justify="start" align="middle" gutter={[10, 20]}>
<Col span={5}>补充资料:</Col> <Col span={3}>补充资料:</Col>
{data.supplement && {data.supplement &&
data.supplement.split(',').map(item => ( data.supplement.split(',').map(item => (
<Col key={item}> <Col key={item} span={8}>
<img src={item} key={item} alt="" /> <img width="100%" src={item} key={item} alt="" />
</Col> </Col>
))} ))}
</Row> </Row>
...@@ -91,7 +91,7 @@ const AppealDetail = props => { ...@@ -91,7 +91,7 @@ const AppealDetail = props => {
</Row> </Row>
</div> </div>
) : ( ) : (
'暂无物流信息' '暂无详情信息'
)} )}
</Modal> </Modal>
); );
......
...@@ -43,6 +43,7 @@ class imgModal extends Component { ...@@ -43,6 +43,7 @@ class imgModal extends Component {
footer={null} footer={null}
onCancel={() => this.setState({ imgModal: false })} onCancel={() => this.setState({ imgModal: false })}
width="800px" width="800px"
style={{ textAlign: 'center' }}
> >
<img width="700px" src={this.state.selectImg} alt=""></img> <img width="700px" src={this.state.selectImg} alt=""></img>
</Modal> </Modal>
......
...@@ -86,7 +86,6 @@ class PicturesWall extends React.Component { ...@@ -86,7 +86,6 @@ class PicturesWall extends React.Component {
render() { render() {
const { previewVisible, previewImage, fileList } = this.state; const { previewVisible, previewImage, fileList } = this.state;
console.log('fileList---render', fileList);
const uploadButton = ( const uploadButton = (
<div> <div>
<Icon type="plus" /> <Icon type="plus" />
......
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