Commit e828e210 authored by lxd's avatar lxd

feat:订单审核提升

parent 4b5a4a3f
...@@ -2,12 +2,12 @@ const isProduction = process.env.NODE_ENV === 'production'; ...@@ -2,12 +2,12 @@ const isProduction = process.env.NODE_ENV === 'production';
const isPre = process.env.PRE_ENV === 'pre'; const isPre = process.env.PRE_ENV === 'pre';
const envAPi = { const envAPi = {
api: '//backstms-gyl2.liangkebang.net', api: '//backstms-test2.liangkebang.net',
kdspOpApi: 'https://kdsp-operation-gyl2.liangkebang.net', kdspOpApi: 'https://kdsp-operation-test2.liangkebang.net',
kdspApi: 'https://sc-op-api-gyl2.liangkebang.net', kdspApi: 'https://sc-op-api-test2.liangkebang.net',
goodsApi: 'https://sc-op-api-gyl2.liangkebang.net', goodsApi: 'https://sc-op-api-test2.liangkebang.net',
// goodsApi: '//192.168.28.107:7000', // goodsApi: '//192.168.28.107:7000',
prologueDomain: 'https://mall-gyl2.liangkebang.net', prologueDomain: 'https://mall-test2.liangkebang.net',
qiniuHost: 'https://appsync.lkbang.net', qiniuHost: 'https://appsync.lkbang.net',
opapiHost: 'https://opapi-gyl2.liangkebang.net', opapiHost: 'https://opapi-gyl2.liangkebang.net',
}; };
...@@ -17,8 +17,8 @@ const prodApi = { ...@@ -17,8 +17,8 @@ const prodApi = {
kdspOpApi: '//kdsp-operation.q-gp.com', kdspOpApi: '//kdsp-operation.q-gp.com',
prologueDomain: '//mall.q-gp.com', prologueDomain: '//mall.q-gp.com',
kdspApi: '//sc-op-api.q-gp.com', kdspApi: '//sc-op-api.q-gp.com',
// goodsApi: 'https://sc-op-api.q-gp.com', // 测试环境打包域名, goodsApi: 'https://sc-op-api.q-gp.com', // 测试环境打包域名,
goodsApi: 'https://sc-merchant-api.q-gp.com', // 线上环境打包域名 // goodsApi: 'https://sc-merchant-api.q-gp.com', // 线上环境打包域名
qiniuHost: 'https://appsync.lkbang.net', qiniuHost: 'https://appsync.lkbang.net',
opapiHost: 'https://opapi.xyqb.com', opapiHost: 'https://opapi.xyqb.com',
}; };
......
This source diff could not be displayed because it is too large. You can view the blob instead.
import React from 'react'; import React from 'react';
import { Row, Col } from 'antd'; import { Row, Col } from 'antd';
import Link from 'umi/link';
// import { PageHeaderWrapper } from '@ant-design/pro-layout'; // import { PageHeaderWrapper } from '@ant-design/pro-layout';
// eslint-disable-next-line import/no-extraneous-dependencies // eslint-disable-next-line import/no-extraneous-dependencies
import { FileTextOutlined } from '@ant-design/icons'; import { FileTextOutlined } from '@ant-design/icons';
...@@ -22,16 +23,52 @@ const Admin = () => ( ...@@ -22,16 +23,52 @@ const Admin = () => (
</div> </div>
</Col> </Col>
<Col span={2}> <Col span={2}>
<strong>9</strong> <Link
<p>待发货</p> to={{
pathname: '/orderManage/pendingDeliveryOrder',
state: { status: 2 },
}}
>
<strong>9</strong>
<p>待发货</p>
</Link>
</Col> </Col>
<Col span={3}> <Col span={3}>
<strong>9</strong> <Link
<p>待发货{'>'}48小时</p> to={{
pathname: '/orderManage/pendingDeliveryOrder',
state: { status: 1 },
}}
>
<strong>9</strong>
<p>待发货{'>'}48小时</p>
</Link>
</Col> </Col>
<Col span={4}> <Col span={4}>
<strong>9</strong> <Link
<p>取消订单审核{'<'}24小时</p> to={{
pathname: 'cancelBillManage',
}}
>
<strong>9</strong>
<p>取消订单审核{'<'}24小时</p>
</Link>
</Col>
<Col span={2} className="titleTwo" offset={4}>
<div>
<FileTextOutlined />
<p> 售后</p>
</div>
</Col>
<Col span={3}>
<Link
to={{
pathname: 'afterSaleManage',
}}
>
<strong>9</strong>
<p>退款待审核</p>
</Link>
</Col> </Col>
</Row> </Row>
</div> </div>
......
...@@ -15,13 +15,20 @@ ...@@ -15,13 +15,20 @@
.orderContent { .orderContent {
:global { :global {
.ant-col { .ant-col {
padding: 19px 0;
text-align: center; text-align: center;
background-color: #fff; background-color: #fff;
border: 1px solid #cecece; border: 1px solid #cecece;
border-left: none; border-left: none;
strong { a {
color: red; display: block;
padding: 19px 0;
strong {
color: red;
}
}
a:hover {
color: #fff;
background-color: #5468ff;
} }
} }
.titleOne { .titleOne {
...@@ -31,5 +38,12 @@ ...@@ -31,5 +38,12 @@
background-color: #1890ff; background-color: #1890ff;
border: none; border: none;
} }
.titleTwo {
padding: 20px 0;
color: #fff;
text-align: center;
background-color: #52c41a;
border: none;
}
} }
} }
/* eslint-disable no-mixed-operators */
/* eslint-disable radix */
import React, { useState, useRef } from 'react'; import React, { useState, useRef } from 'react';
import { Button, notification } from 'antd'; import { Button, notification } from 'antd';
import ProTable from '@ant-design/pro-table'; import ProTable from '@ant-design/pro-table';
import _ from 'lodash';
// import { searchList, auditInfoApi, orderDetail } from './service'; // import { searchList, auditInfoApi, orderDetail } from './service';
import { searchList, orderDetail } from './service'; import { searchList, orderDetail } from './service';
import { column } from './data'; import { column } from './data';
...@@ -10,10 +13,13 @@ import { dateDiff } from './common'; ...@@ -10,10 +13,13 @@ import { dateDiff } from './common';
export default () => { export default () => {
const table = useRef(); const table = useRef();
const ref = useRef();
const [visible, setVisible] = useState(false); const [visible, setVisible] = useState(false);
const [detailVisible, setDetailVisible] = useState(false); const [detailVisible, setDetailVisible] = useState(false);
const [detailInfo, setDetailInfo] = useState([]); const [detailInfo, setDetailInfo] = useState([]);
const [auditInfo, setAuditInfo] = useState({}); const [auditInfo, setAuditInfo] = useState({});
const [timeString, settimeString] = useState({});
const [time, settime] = useState({});
const query = async (params, type) => { const query = async (params, type) => {
if (params.orderId) { if (params.orderId) {
...@@ -71,6 +77,33 @@ export default () => { ...@@ -71,6 +77,33 @@ export default () => {
setDetailInfo(data || []); setDetailInfo(data || []);
setDetailVisible(true); setDetailVisible(true);
}; };
const renderContent = (record, index, action) => {
if (!time[index]) {
const timestart = new Date().getTime();
let timeNumber = (record.startTime - timestart) / 1000;
time[index] = setInterval(() => {
if (timeNumber > 0) {
timeNumber -= 1;
const hours = parseInt((timeNumber / 3600) % 24)
.toString()
.padStart(2, '0');
const minutes = parseInt((timeNumber / 60) % 60)
.toString()
.padStart(2, '0');
const seconds = parseInt(timeNumber % 60)
.toString()
.padStart(2, '0');
const str = `${hours}${minutes}${seconds}秒`;
timeString[index] = str;
const strings = _.cloneDeep(timeString);
settimeString(strings);
} else {
clearInterval(time[index]);
action.reload();
}
}, 1000);
}
};
const closeModal = isReload => { const closeModal = isReload => {
if (isReload === true) { if (isReload === true) {
// eslint-disable-next-line no-unused-expressions // eslint-disable-next-line no-unused-expressions
...@@ -85,6 +118,20 @@ export default () => { ...@@ -85,6 +118,20 @@ export default () => {
setVisible(true); setVisible(true);
}; };
const columns = [ const columns = [
{
title: '审核倒计时',
dataIndex: 'examine',
key: 'examine',
hideInSearch: true,
width: 200,
// eslint-disable-next-line no-shadow
render: (_, record, index, action) => [
<span style={{ color: 'red' }}>
{renderContent(record, index, action)}
{timeString[index]}
</span>,
],
},
...column, ...column,
{ {
title: '操作', title: '操作',
...@@ -92,6 +139,7 @@ export default () => { ...@@ -92,6 +139,7 @@ export default () => {
dataIndex: 'action', dataIndex: 'action',
width: 250, width: 250,
fixed: 'right', fixed: 'right',
// eslint-disable-next-line no-shadow
render: (_, r) => [ render: (_, r) => [
<Button key="link1" onClick={() => openAudit(r)} className="mr10" type="primary"> <Button key="link1" onClick={() => openAudit(r)} className="mr10" type="primary">
审核 审核
...@@ -113,6 +161,7 @@ export default () => { ...@@ -113,6 +161,7 @@ export default () => {
}} }}
bordered bordered
actionRef={table} actionRef={table}
formRef={ref}
scroll={{ x: '100%', y: 400 }} scroll={{ x: '100%', y: 400 }}
search={{ search={{
collapsed: false, collapsed: false,
......
...@@ -22,15 +22,18 @@ export async function searchList(params, auditStatus) { ...@@ -22,15 +22,18 @@ export async function searchList(params, auditStatus) {
// 'Content-Type': 'application/x-www-form-urlencoded', // 'Content-Type': 'application/x-www-form-urlencoded',
// }, // },
}); });
if (data && data.data) { // if (data && data.data) {
return { // return {
total: data.data.total, // total: data.data.total,
data: data.data.records, // data: data.data.records,
}; // };
} // }
return { return {
total: 0, total: 10,
data: [], data: [
{ serviceNo: 1, receiverName: 1, startTime: 1649924464730 },
{ serviceNo: 2, receiverName: 2, startTime: 1649920460730 },
],
}; };
} }
......
...@@ -34,6 +34,7 @@ const TableList = props => { ...@@ -34,6 +34,7 @@ const TableList = props => {
); );
const [endTime, setEndTime] = useState(moment()); const [endTime, setEndTime] = useState(moment());
const [orderStatus, setorderStatus] = useState(1);
const [endTimeStr, setEndTimeStr] = useState(moment().format(dateFormat)); const [endTimeStr, setEndTimeStr] = useState(moment().format(dateFormat));
// const startDisabledDate = current => // const startDisabledDate = current =>
...@@ -113,6 +114,23 @@ const TableList = props => { ...@@ -113,6 +114,23 @@ const TableList = props => {
order: 6, order: 6,
hideInTable: true, hideInTable: true,
}, },
{
title: '超时发货',
dataIndex: 'orderStatus',
key: 'orderStatus',
hideInTable: true,
formItemProps: {
// eslint-disable-next-line no-nested-ternary
value: orderStatus ? (orderStatus === '1' ? '' : '') : '',
onChange(status) {
setorderStatus(status);
},
},
valueEnum: {
1: '',
2: '',
},
},
{ {
title: '交易时间', title: '交易时间',
dataIndex: 'orderTime', dataIndex: 'orderTime',
...@@ -294,6 +312,12 @@ const TableList = props => { ...@@ -294,6 +312,12 @@ const TableList = props => {
setCompanys(data); setCompanys(data);
}; };
getCompanys(); getCompanys();
if (props.location?.state) {
const { status } = props.location?.state;
setorderStatus(status);
} else {
setorderStatus('');
}
}, []); }, []);
const queryToSendFn = params => { const queryToSendFn = params => {
...@@ -302,6 +326,7 @@ const TableList = props => { ...@@ -302,6 +326,7 @@ const TableList = props => {
logisticsStatus: props.type || 1, logisticsStatus: props.type || 1,
pageNo: params.current, pageNo: params.current,
pageSize: params.pageSize || 20, pageSize: params.pageSize || 20,
status: orderStatus || '',
}; };
return queryToSend(transformedParam); return queryToSend(transformedParam);
}; };
...@@ -323,6 +348,7 @@ const TableList = props => { ...@@ -323,6 +348,7 @@ const TableList = props => {
onClick={() => { onClick={() => {
// eslint-disable-next-line no-unused-expressions // eslint-disable-next-line no-unused-expressions
form?.resetFields(); form?.resetFields();
setorderStatus('');
}} }}
> >
{resetText} {resetText}
......
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