Commit c3fe8eab authored by 郭志伟's avatar 郭志伟

Merge branch 'feature/upgrade' into 'master'

Feature/upgrade

See merge request !32
parents 6de8cb65 d7d9b467
...@@ -50,13 +50,15 @@ const plugins = [ ...@@ -50,13 +50,15 @@ const plugins = [
]; ];
export default { export default {
plugins, antd: {},
block: { dva: {
// 国内用户可以使用码云 hmr: true,
// defaultGitUrl: 'https://gitee.com/ant-design/pro-blocks',
defaultGitUrl: 'https://github.com/ant-design/pro-blocks',
}, },
hash: true, hash: true,
locale: {
default: 'zh-CN', //开启国际化配置,就必须要创建locales/zh-CN.ts 文件
baseNavigator: true,
},
targets: { targets: {
ie: 11, ie: 11,
}, },
...@@ -81,7 +83,7 @@ export default { ...@@ -81,7 +83,7 @@ export default {
{ {
path: '/', path: '/',
component: '../layouts/BasicLayout', component: '../layouts/BasicLayout',
authority: ['admin', 'user'], authority: ['Admin', 'user'],
routes: [ routes: [
{ {
path: '/', path: '/',
...@@ -209,33 +211,33 @@ export default { ...@@ -209,33 +211,33 @@ export default {
ANT_DESIGN_PRO_ONLY_DO_NOT_USE_IN_YOUR_PRODUCTION || '', // preview.pro.ant.design only do not use in your production ; preview.pro.ant.design 专用环境变量,请不要在你的项目中使用它。 ANT_DESIGN_PRO_ONLY_DO_NOT_USE_IN_YOUR_PRODUCTION || '', // preview.pro.ant.design only do not use in your production ; preview.pro.ant.design 专用环境变量,请不要在你的项目中使用它。
}, },
ignoreMomentLocale: true, ignoreMomentLocale: true,
lessLoaderOptions: { lessLoader: {
javascriptEnabled: true, javascriptEnabled: true,
}, },
disableRedirectHoist: true, cssLoader: {
cssLoaderOptions: { modules: {
modules: true, getLocalIdent: (context, _, localName) => {
getLocalIdent: (context, _, localName) => { if (
if ( context.resourcePath.includes('node_modules') ||
context.resourcePath.includes('node_modules') || context.resourcePath.includes('ant.design.pro.less') ||
context.resourcePath.includes('ant.design.pro.less') || context.resourcePath.includes('global.less')
context.resourcePath.includes('global.less') ) {
) { return localName;
return localName; }
}
const match = context.resourcePath.match(/src(.*)/); const match = context.resourcePath.match(/src(.*)/);
if (match && match[1]) { if (match && match[1]) {
const antdProPath = match[1].replace('.less', ''); const antdProPath = match[1].replace('.less', '');
const arr = slash(antdProPath) const arr = slash(antdProPath)
.split('/') .split('/')
.map(a => a.replace(/([A-Z])/g, '-$1')) .map(a => a.replace(/([A-Z])/g, '-$1'))
.map(a => a.toLowerCase()); .map(a => a.toLowerCase());
return `antd-pro${arr.join('-')}-${localName}`.replace(/--/g, '-'); return `antd-pro${arr.join('-')}-${localName}`.replace(/--/g, '-');
} }
return localName; return localName;
},
}, },
}, },
chainWebpack: webpackPlugin, chainWebpack: webpackPlugin,
......
...@@ -3,14 +3,14 @@ const isPre = process.env.PRE_ENV === 'pre'; ...@@ -3,14 +3,14 @@ const isPre = process.env.PRE_ENV === 'pre';
const envAPi = { const envAPi = {
api: '//backstms-test9.liangkebang.net', api: '//backstms-test9.liangkebang.net',
kdspOpApi: 'https://kdsp-operation-test2.liangkebang.net', kdspOpApi: 'https://kdsp-operation-test9.liangkebang.net',
kdspApi: 'https://sc-op-api-test2.liangkebang.net', kdspApi: 'https://sc-op-api-test9.liangkebang.net',
goodsApi: 'https://sc-op-api-test2.liangkebang.net', goodsApi: 'https://sc-op-api-test9.liangkebang.net',
querysApi: 'https://sc-settlement-api-test9.liangkebang.net', querysApi: 'https://sc-settlement-api-test9.liangkebang.net',
// goodsApi: '//192.168.188.111:7000', // goodsApi: '//192.168.188.111:7000',
prologueDomain: 'https://mall-test2.liangkebang.net', prologueDomain: 'https://mall-test9.liangkebang.net',
qiniuHost: 'https://appsync.lkbang.net', qiniuHost: 'https://appsync.lkbang.net',
opapiHost: 'https://opapi-gyl2.liangkebang.net', opapiHost: 'https://opapi-test9.liangkebang.net',
}; };
const prodApi = { const prodApi = {
......
...@@ -5,7 +5,8 @@ ...@@ -5,7 +5,8 @@
"experimentalDecorators": true, "experimentalDecorators": true,
"baseUrl": ".", "baseUrl": ".",
"paths": { "paths": {
"@/*": ["./src/*"] "@/*": ["./src/*"],
"@@/*": ["./src/.uim/*"]
} }
} }
} }
This diff is collapsed.
...@@ -49,11 +49,14 @@ ...@@ -49,11 +49,14 @@
], ],
"dependencies": { "dependencies": {
"@ant-design/colors": "^3.1.0", "@ant-design/colors": "^3.1.0",
"@ant-design/pro-layout": "^4.10.0", "@ant-design/compatible": "^1.1.0",
"@ant-design/icons": "^4.7.0",
"@ant-design/pro-layout": "^4.11.4",
"@ant-design/pro-table": "^1.0.31", "@ant-design/pro-table": "^1.0.31",
"@antv/data-set": "^0.10.2", "@antv/data-set": "^0.10.2",
"antd": "^3.26.20", "antd": "^4.19.3",
"antd-virtual-select": "^1.1.2", "antd-virtual-select": "^1.1.2",
"babel-eslint": "^10.1.0",
"classnames": "^2.2.6", "classnames": "^2.2.6",
"date-fns": "^2.16.1", "date-fns": "^2.16.1",
"dva": "^2.4.1", "dva": "^2.4.1",
...@@ -63,18 +66,14 @@ ...@@ -63,18 +66,14 @@
"omit.js": "^1.0.2", "omit.js": "^1.0.2",
"path-to-regexp": "^3.1.0", "path-to-regexp": "^3.1.0",
"qs": "^6.9.0", "qs": "^6.9.0",
"rc-tree-select": "^5.1.4",
"react": "^16.8.6", "react": "^16.8.6",
"react-copy-to-clipboard": "^5.0.1", "react-copy-to-clipboard": "^5.0.1",
"react-dom": "^16.8.6", "react-dom": "^16.8.6",
"react-helmet": "^5.2.1", "react-helmet": "^5.2.1",
"react-sortablejs": "^6.0.0", "react-sortablejs": "^6.0.0",
"redux": "^4.0.1",
"slash2": "^2.0.0", "slash2": "^2.0.0",
"sortablejs": "^1.13.0", "sortablejs": "^1.13.0",
"umi": "^2.13.0", "umi": "^3.0.0",
"umi-plugin-pro-block": "^1.3.4",
"umi-plugin-react": "^1.10.1",
"umi-request": "^1.2.7", "umi-request": "^1.2.7",
"webpack-theme-color-replacer": "^1.2.15" "webpack-theme-color-replacer": "^1.2.15"
}, },
...@@ -90,6 +89,10 @@ ...@@ -90,6 +89,10 @@
"@types/react-dom": "^16.8.4", "@types/react-dom": "^16.8.4",
"@types/react-helmet": "^5.0.13", "@types/react-helmet": "^5.0.13",
"@umijs/fabric": "^1.2.0", "@umijs/fabric": "^1.2.0",
"@umijs/plugin-blocks": "^2.0.5",
"@umijs/preset-ant-design-pro": "^1.0.1",
"@umijs/preset-react": "^1.3.0",
"@umijs/preset-ui": "^2.0.9",
"chalk": "^2.4.2", "chalk": "^2.4.2",
"check-prettier": "^1.0.3", "check-prettier": "^1.0.3",
"cross-env": "^6.0.0", "cross-env": "^6.0.0",
...@@ -109,10 +112,7 @@ ...@@ -109,10 +112,7 @@
"node-fetch": "^2.6.0", "node-fetch": "^2.6.0",
"prettier": "^1.17.1", "prettier": "^1.17.1",
"pro-download": "1.0.1", "pro-download": "1.0.1",
"stylelint": "^10.1.0", "stylelint": "^10.1.0"
"umi-plugin-ga": "^1.1.3",
"umi-plugin-pro": "^1.0.2",
"umi-types": "^0.5.0"
}, },
"engines": { "engines": {
"node": ">=10.0.0" "node": ">=10.0.0"
......
import { Icon, Popover, Typography } from 'antd'; import { DownloadOutlined } from '@ant-design/icons';
import { Popover, Typography } from 'antd';
import React, { useRef } from 'react'; import React, { useRef } from 'react';
import { connect } from 'dva'; import { connect } from 'dva';
import { isAntDesignPro } from '@/utils/utils'; import { isAntDesignPro } from '@/utils/utils';
...@@ -63,7 +64,7 @@ export default connect(({ routing }) => ({ ...@@ -63,7 +64,7 @@ export default connect(({ routing }) => ({
getPopupContainer={dom => (divDom.current ? divDom.current : dom)} getPopupContainer={dom => (divDom.current ? divDom.current : dom)}
> >
<div className={styles['copy-block']} ref={divDom}> <div className={styles['copy-block']} ref={divDom}>
<Icon type="download" /> <DownloadOutlined />
</div> </div>
</Popover> </Popover>
); );
......
import { Avatar, Icon, Menu, Spin } from 'antd'; import { LogoutOutlined, SettingOutlined, UserOutlined } from '@ant-design/icons';
import { Avatar, Menu, Spin } from 'antd';
import React from 'react'; import React from 'react';
import { connect } from 'dva'; import { connect } from 'dva';
import router from 'umi/router'; import { history } from 'umi';
import HeaderDropdown from '../HeaderDropdown'; import HeaderDropdown from '../HeaderDropdown';
import styles from './index.less'; import styles from './index.less';
...@@ -21,7 +22,7 @@ class AvatarDropdown extends React.Component { ...@@ -21,7 +22,7 @@ class AvatarDropdown extends React.Component {
return; return;
} }
router.push(`/account/${key}`); history.push(`/account/${key}`);
}; };
render() { render() {
...@@ -36,20 +37,20 @@ class AvatarDropdown extends React.Component { ...@@ -36,20 +37,20 @@ class AvatarDropdown extends React.Component {
<Menu className={styles.menu} selectedKeys={[]} onClick={this.onMenuClick}> <Menu className={styles.menu} selectedKeys={[]} onClick={this.onMenuClick}>
{menu && ( {menu && (
<Menu.Item key="center"> <Menu.Item key="center">
<Icon type="user" /> <UserOutlined />
个人中心 个人中心
</Menu.Item> </Menu.Item>
)} )}
{menu && ( {menu && (
<Menu.Item key="settings"> <Menu.Item key="settings">
<Icon type="setting" /> <SettingOutlined />
个人设置 个人设置
</Menu.Item> </Menu.Item>
)} )}
{menu && <Menu.Divider />} {menu && <Menu.Divider />}
<Menu.Item key="logout"> <Menu.Item key="logout">
<Icon type="logout" /> <LogoutOutlined />
退出登录 退出登录
</Menu.Item> </Menu.Item>
</Menu> </Menu>
...@@ -57,7 +58,10 @@ class AvatarDropdown extends React.Component { ...@@ -57,7 +58,10 @@ class AvatarDropdown extends React.Component {
return currentUser && currentUser.name ? ( return currentUser && currentUser.name ? (
<HeaderDropdown overlay={menuHeaderDropdown}> <HeaderDropdown overlay={menuHeaderDropdown}>
<span className={`${styles.action} ${styles.account}`}> <span className={`${styles.action} ${styles.account}`}>
<Avatar icon="user" style={{ backgroundColor: '#388bd8', marginRight: '10px' }} /> <Avatar
icon={<UserOutlined />}
style={{ backgroundColor: '#388bd8', marginRight: '10px' }}
/>
<span className={styles.name}>{currentUser.name}</span> <span className={styles.name}>{currentUser.name}</span>
</span> </span>
</HeaderDropdown> </HeaderDropdown>
......
import { Icon, Tooltip } from 'antd'; import { Tooltip } from 'antd';
import React from 'react'; import React from 'react';
import { connect } from 'dva'; import { connect } from 'dva';
import Avatar from './AvatarDropdown'; import Avatar from './AvatarDropdown';
......
import { AutoComplete, Icon, Input } from 'antd'; import { SearchOutlined } from '@ant-design/icons';
import { AutoComplete, Input } from 'antd';
import React, { Component } from 'react'; import React, { Component } from 'react';
import classNames from 'classnames'; import classNames from 'classnames';
import debounce from 'lodash/debounce'; import debounce from 'lodash/debounce';
...@@ -112,7 +113,7 @@ export default class HeaderSearch extends Component { ...@@ -112,7 +113,7 @@ export default class HeaderSearch extends Component {
} }
}} }}
> >
<Icon type="search" key="Icon" /> <SearchOutlined key="Icon" />
<AutoComplete <AutoComplete
key="AutoComplete" key="AutoComplete"
{...restProps} {...restProps}
......
import { Badge, Icon, Spin, Tabs } from 'antd'; import { BellOutlined } from '@ant-design/icons';
import { Badge, Spin, Tabs } from 'antd';
import React, { Component } from 'react'; import React, { Component } from 'react';
import classNames from 'classnames'; import classNames from 'classnames';
import NoticeList from './NoticeList'; import NoticeList from './NoticeList';
...@@ -116,7 +117,7 @@ export default class NoticeIcon extends Component { ...@@ -116,7 +117,7 @@ export default class NoticeIcon extends Component {
const { visible } = this.state; const { visible } = this.state;
const noticeButtonClass = classNames(className, styles.noticeButton); const noticeButtonClass = classNames(className, styles.noticeButton);
const notificationBox = this.getNotificationBox(); const notificationBox = this.getNotificationBox();
const NoticeBellIcon = bell || <Icon type="bell" className={styles.icon} />; const NoticeBellIcon = bell || <BellOutlined className={styles.icon} />;
const trigger = ( const trigger = (
<span <span
className={classNames(noticeButtonClass, { className={classNames(noticeButtonClass, {
......
...@@ -6,9 +6,10 @@ ...@@ -6,9 +6,10 @@
/* eslint-disable no-underscore-dangle, no-confusing-arrow */ /* eslint-disable no-underscore-dangle, no-confusing-arrow */
import ProLayout from '@ant-design/pro-layout'; import ProLayout from '@ant-design/pro-layout';
import React, { useState, useEffect } from 'react'; import React, { useState, useEffect } from 'react';
import Link from 'umi/link'; import { Link } from 'umi';
import { connect } from 'dva'; import { connect } from 'dva';
import { Result, Button, Layout, Menu, Icon } from 'antd'; import { Icon as LegacyIcon } from '@ant-design/compatible';
import { Result, Button, Layout, Menu } from 'antd';
import Authorized from '@/utils/Authorized'; import Authorized from '@/utils/Authorized';
import RightContent from '@/components/GlobalHeader/RightContent'; import RightContent from '@/components/GlobalHeader/RightContent';
import { getAuthorityFromRouter } from '@/utils/utils'; import { getAuthorityFromRouter } from '@/utils/utils';
...@@ -76,7 +77,6 @@ const BasicLayout = props => { ...@@ -76,7 +77,6 @@ const BasicLayout = props => {
}; // get children authority }; // get children authority
const authorized = getAuthorityFromRouter(props.route.routes, location.pathname || '/'); const authorized = getAuthorityFromRouter(props.route.routes, location.pathname || '/');
const _menu = param => const _menu = param =>
param.map(v => param.map(v =>
v.children && v.children.length ? ( v.children && v.children.length ? (
...@@ -84,7 +84,7 @@ const BasicLayout = props => { ...@@ -84,7 +84,7 @@ const BasicLayout = props => {
key={v.path} key={v.path}
title={ title={
<span> <span>
<Icon type={v.icon} /> <LegacyIcon type={v.icon} />
<span>{v.name}</span> <span>{v.name}</span>
</span> </span>
} }
...@@ -94,7 +94,7 @@ const BasicLayout = props => { ...@@ -94,7 +94,7 @@ const BasicLayout = props => {
) : ( ) : (
<Menu.Item key={v.path}> <Menu.Item key={v.path}>
<Link to={v.path}> <Link to={v.path}>
<Icon type={v.icon} /> <LegacyIcon type={v.icon} />
<span className="nav-text">{v.name}</span> <span className="nav-text">{v.name}</span>
</Link> </Link>
</Menu.Item> </Menu.Item>
...@@ -128,13 +128,18 @@ const BasicLayout = props => { ...@@ -128,13 +128,18 @@ const BasicLayout = props => {
} }
return <Link to={menuItemProps.path}>{defaultDom}</Link>; return <Link to={menuItemProps.path}>{defaultDom}</Link>;
}} }}
breadcrumbRender={(routers = []) => [ // eslint-disable-next-line consistent-return
{ breadcrumbRender={(routers = []) => {
path: '/', if (routers.length) {
breadcrumbName: '首页', return [
}, {
...routers, path: '/',
]} breadcrumbName: '首页',
},
...routers,
];
}
}}
itemRender={(route, params, routes, paths) => { itemRender={(route, params, routes, paths) => {
const first = routes.indexOf(route) === 0; const first = routes.indexOf(route) === 0;
return first ? ( return first ? (
......
...@@ -7,23 +7,23 @@ const GlobalModel = { ...@@ -7,23 +7,23 @@ const GlobalModel = {
notices: [], notices: [],
}, },
effects: { effects: {
*fetchNotices(_, { call, put, select }) { // *fetchNotices(_, { call, put, select }) {
const data = yield call(queryNotices); // const data = yield call(queryNotices);
yield put({ // yield put({
type: 'saveNotices', // type: 'saveNotices',
payload: data, // payload: data,
}); // });
const unreadCount = yield select( // const unreadCount = yield select(
state => state.global.notices.filter(item => !item.read).length, // state => state.global.notices.filter(item => !item.read).length,
); // );
yield put({ // yield put({
type: 'user/changeNotifyCount', // type: 'user/changeNotifyCount',
payload: { // payload: {
totalCount: data.length, // totalCount: data.length,
unreadCount, // unreadCount,
}, // },
}); // });
}, // },
*clearNotices({ payload }, { put, select }) { *clearNotices({ payload }, { put, select }) {
yield put({ yield put({
......
import { queryCurrent, query as queryUsers, homeInfo } from '@/services/user'; // queryUsers
import { queryCurrent, homeInfo } from '@/services/user';
import localStorage from '@/utils/localStorage'; import localStorage from '@/utils/localStorage';
const UserModel = { const UserModel = {
...@@ -8,13 +9,13 @@ const UserModel = { ...@@ -8,13 +9,13 @@ const UserModel = {
homeInfo: {}, homeInfo: {},
}, },
effects: { effects: {
*fetch(_, { call, put }) { // *fetch(_, { call, put }) {
const response = yield call(queryUsers); // const response = yield call(queryUsers);
yield put({ // yield put({
type: 'save', // type: 'save',
payload: response, // payload: response,
}); // });
}, // },
*fetchCurrent(_, { call, put }) { *fetchCurrent(_, { call, put }) {
const response = yield call(queryCurrent); const response = yield call(queryCurrent);
......
import { Button, Result } from 'antd'; import { Button, Result } from 'antd';
import React from 'react'; import React from 'react';
import router from 'umi/router'; // 这里应该使用 antd 的 404 result 组件, import { history } from 'umi'; // 这里应该使用 antd 的 404 result 组件,
// 但是还没发布,先来个简单的。 // 但是还没发布,先来个简单的。
const NoFoundPage = () => ( const NoFoundPage = () => (
...@@ -9,7 +9,7 @@ const NoFoundPage = () => ( ...@@ -9,7 +9,7 @@ const NoFoundPage = () => (
title="404" title="404"
subTitle="Sorry, the page you visited does not exist." subTitle="Sorry, the page you visited does not exist."
extra={ extra={
<Button type="primary" onClick={() => router.push('/')}> <Button type="primary" onClick={() => history.push('/')}>
Back Home Back Home
</Button> </Button>
} }
......
import React from 'react';
import { Card, Typography, Alert, Icon } from 'antd';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
export default () => (
<h2>欢迎使用商户管理后台系统</h2>
);
import React, { useState, useEffect } from 'react';
import { Row, Col } from 'antd';
import { Link } from 'umi';
// import { PageHeaderWrapper } from '@ant-design/pro-layout';
// eslint-disable-next-line import/no-extraneous-dependencies
import { FileTextOutlined } from '@ant-design/icons';
import style from './styles.less';
import { getPendingNum } from './service';
const Admin = () => {
const [pendingNum, setpendingNum] = useState({});
useEffect(() => {
const qurey = async () => {
const { data } = await getPendingNum();
setpendingNum(data);
};
qurey();
}, []);
return (
<div>
<h2>欢迎使用商户管理后台系统</h2>
<div>
<div>
<span className={style.orderleft}></span>
<span className={style.orderRight}>待办事项</span>
</div>
<div style={{ marginTop: '20px' }}>
<Row className={style.orderContent}>
<Col span={2} className="titleOne">
<div>
<FileTextOutlined />
<p>订单</p>
</div>
</Col>
<Col span={2}>
<Link
to={{
pathname: '/orderManage/pendingDeliveryOrder',
}}
>
<strong>{pendingNum?.pendingShipNum || 0}</strong>
<p>待发货</p>
</Link>
</Col>
<Col span={3}>
<Link
to={{
pathname: '/orderManage/pendingDeliveryOrder',
state: { status: 1 },
}}
>
<strong>{pendingNum?.timeOutShipNum || 0}</strong>
<p>超时发货{'>'}48小时</p>
</Link>
</Col>
<Col span={4}>
<Link
to={{
pathname: 'cancelBillManage',
}}
>
<strong>{pendingNum?.cancelOrderPendingAuditNum || 0}</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>{pendingNum?.afterOrderPendingAuditNum || 0}</strong>
<p>退款待审核</p>
</Link>
</Col>
</Row>
</div>
</div>
</div>
);
};
export default Admin;
import { stringify } from 'querystring';
import _ from 'lodash';
import request from '@/utils/request';
import { saveAs } from 'file-saver';
import { format } from 'date-fns';
import config from '../../../config/env.config';
// 查询待办页订单数量
export async function getPendingNum() {
const data = await request.get('/api/kdsp/admin/merchants/getPendingNum', {
prefix: config.kdspApi,
});
return data;
}
.orderleft {
display: inline-block;
width: 5px;
height: 30px;
margin: 0 10px;
vertical-align: middle;
background-color: #1890ff;
}
.orderRight {
display: inline-block;
color: #000;
font-weight: bold;
font-size: 18px;
}
.orderContent {
:global {
.ant-col {
text-align: center;
background-color: #fff;
border: 1px solid #cecece;
border-left: none;
a {
display: block;
padding: 19px 0;
strong {
color: red;
}
}
a:hover {
background-color: #e6f7ff;
}
}
.titleOne {
padding: 20px 0;
color: #fff;
text-align: center;
background-color: #1890ff;
border: none;
}
.titleTwo {
padding: 20px 0;
color: #fff;
text-align: center;
background-color: #52c41a;
border: none;
}
}
}
...@@ -155,7 +155,7 @@ export default () => { ...@@ -155,7 +155,7 @@ export default () => {
<ProTable <ProTable
columns={columns} columns={columns}
request={params => searchList(params, 2)} request={params => searchList(params, 2)}
rowKey="serviceNo" rowKey={r => r.serviceNo}
pagination={{ pagination={{
pagesSize: 20, pagesSize: 20,
}} }}
......
...@@ -102,7 +102,7 @@ export default () => { ...@@ -102,7 +102,7 @@ export default () => {
<ProTable <ProTable
columns={columns} columns={columns}
request={params => searchList(params, 1)} request={params => searchList(params, 1)}
rowKey="serviceNo" rowKey={r => r.serviceNo}
pagination={{ pagination={{
pagesSize: 20, pagesSize: 20,
}} }}
......
import React from 'react'; import React from 'react';
import { Modal, Form, Input, Cascader, notification, InputNumber } from 'antd'; import { Form } from '@ant-design/compatible';
import '@ant-design/compatible/assets/index.css';
import { Modal, Input, Cascader, notification, InputNumber } from 'antd';
import { shopAudit } from '../services'; import { shopAudit } from '../services';
const FormItem = Form.Item; const FormItem = Form.Item;
......
import React from 'react'; import React from 'react';
import { Modal, Form, Input, notification } from 'antd'; import { Form } from '@ant-design/compatible';
import '@ant-design/compatible/assets/index.css';
import { Modal, Input, notification } from 'antd';
import { shopCheck } from '../services'; import { shopCheck } from '../services';
const FormItem = Form.Item; const FormItem = Form.Item;
......
import { Button, Form, Input, Select, notification, Upload, Cascader, InputNumber } from 'antd'; import { Form, Button, Input, Select, notification, Upload, Cascader, InputNumber } from 'antd';
import React, { Component } from 'react'; import React, { Component } from 'react';
import { connect } from 'dva'; import { connect } from 'dva';
import styles from '../style.less'; import styles from '../style.less';
...@@ -10,13 +10,15 @@ const { Option } = Select; ...@@ -10,13 +10,15 @@ const { Option } = Select;
goodsManage, goodsManage,
})) }))
class goodsManage extends Component { class goodsManage extends Component {
formRef = React.createRef();
componentDidMount() { componentDidMount() {
this.props.onRef(this); this.props.onRef(this);
this.handleSearch(); this.handleSearch();
} }
getFieldsValue() { getFieldsValue() {
const { form } = this.props; const form = this.formRef.current;
return form.getFieldsValue(); return form.getFieldsValue();
} }
...@@ -24,8 +26,17 @@ class goodsManage extends Component { ...@@ -24,8 +26,17 @@ class goodsManage extends Component {
this.props.handleSearch(1); this.props.handleSearch(1);
}; };
valueMin = value => {
const { getFieldValue, setFieldsValue } = this.formRef.current;
const minVal = getFieldValue('supplyPriceMin');
if (minVal && minVal > value) {
setFieldsValue({ supplyPriceMax: minVal });
}
};
onReset = () => { onReset = () => {
this.props.form.resetFields(); const form = this.formRef.current;
form.resetFields();
this.props.onReset(); this.props.onReset();
}; };
...@@ -38,14 +49,10 @@ class goodsManage extends Component { ...@@ -38,14 +49,10 @@ class goodsManage extends Component {
}; };
render() { render() {
const { const { treeData } = this.props;
form: { getFieldDecorator, getFieldValue },
treeData,
} = this.props;
const selectW = { width: 250 }; const selectW = { width: 250 };
const iptNumWidth = { width: 118 }; const iptNumWidth = { width: 118 };
const that = this; const that = this;
// const uploadProps = { // const uploadProps = {
// name: 'file', // name: 'file',
// async customRequest(info) { // async customRequest(info) {
...@@ -74,66 +81,53 @@ class goodsManage extends Component { ...@@ -74,66 +81,53 @@ class goodsManage extends Component {
const filterOption = (input, op) => op.props.children.includes(input); const filterOption = (input, op) => op.props.children.includes(input);
return ( return (
<Form name="horizontal_login" layout="inline" className={styles.searchForm}> <Form
<FormItem label="SKU编码"> ref={this.formRef}
{getFieldDecorator('skuId', {})( name="horizontal_login"
<Input placeholder="请输入SKU编码" allowClear style={selectW} />, layout="inline"
)} className={styles.searchForm}
>
<FormItem label="SKU编码" name="skuId">
<Input placeholder="请输入SKU编码" allowClear style={selectW} />
</FormItem> </FormItem>
<FormItem label="商品名称"> <FormItem label="商品名称" name="skuName">
{getFieldDecorator('skuName', {})( <Input placeholder="请输入商品名称" allowClear style={selectW} />
<Input placeholder="请输入商品名称" allowClear style={selectW} />,
)}
</FormItem> </FormItem>
<FormItem label="类目"> <FormItem label="类目" name="productCategoryId">
{getFieldDecorator('productCategoryId', {})( <Cascader
<Cascader placeholder="请选择类目"
placeholder="请选择类目" style={selectW}
style={selectW} showSearch
showSearch changeOnSelect
changeOnSelect fieldNames={{ label: 'name', value: 'id', children: 'children' }}
fieldNames={{ label: 'name', value: 'id', children: 'children' }} options={treeData}
options={treeData} />
/>,
)}
</FormItem> </FormItem>
<FormItem label="审核状态"> <FormItem label="审核状态" name="state">
{getFieldDecorator('state', {})( <Select
<Select style={selectW}
style={selectW} placeholder="请选择审核状态"
placeholder="请选择审核状态" allowClear
allowClear filterOption={filterOption}
filterOption={filterOption} >
> {stateList?.map(item => (
{stateList?.map(item => ( <Option key={item.value} value={item.value}>
<Option key={item.value} value={item.value}> {item.label}
{item.label} </Option>
</Option> ))}
))} </Select>
</Select>,
)}
</FormItem> </FormItem>
<FormItem label="供货价区间"> <FormItem label="供货价区间">
<FormItem className={styles.iptNumRight}> <FormItem name="supplyPriceMin" className={styles.iptNumRight} noStyle>
{getFieldDecorator('supplyPriceMin', {})( <InputNumber placeholder="请输入" style={iptNumWidth} />
<InputNumber placeholder="请输入" style={iptNumWidth} />,
)}
</FormItem> </FormItem>
<span>--</span> <span>--</span>
<FormItem className={styles.iptNumRight}> <FormItem name="supplyPriceMax" className={styles.iptNumRight} noStyle>
{getFieldDecorator('supplyPriceMax', {})( <InputNumber style={iptNumWidth} placeholder="请输入" onChange={this.valueMin} />
<InputNumber
style={iptNumWidth}
placeholder="请输入"
min={getFieldValue('supplyPriceMin')}
/>,
)}
</FormItem> </FormItem>
</FormItem> </FormItem>
<FormItem label="第三方SKU编码"> <FormItem name="thirdSkuNo" label="第三方SKU编码">
{getFieldDecorator('thirdSkuNo', {})( <Input placeholder="请输入第三方SKU编码" allowClear style={selectW} />
<Input placeholder="请输入第三方SKU编码" allowClear style={selectW} />,
)}
</FormItem> </FormItem>
<FormItem className={styles.queryBtn}> <FormItem className={styles.queryBtn}>
<Button onClick={() => this.handleSearch()} type="primary" className={styles.button}> <Button onClick={() => this.handleSearch()} type="primary" className={styles.button}>
...@@ -175,4 +169,4 @@ class goodsManage extends Component { ...@@ -175,4 +169,4 @@ class goodsManage extends Component {
} }
} }
export default Form.create()(goodsManage); export default goodsManage;
import { Form, Modal, Input, Select, Cascader, Tag, notification } from 'antd'; import { Form } from '@ant-design/compatible';
import '@ant-design/compatible/assets/index.css';
import { Modal, Input, Select, Cascader, Tag, notification } from 'antd';
import { da } from 'date-fns/locale'; import { da } from 'date-fns/locale';
import React, { useState, useEffect } from 'react'; import React, { useState, useEffect } from 'react';
import { getTemplate } from '../service'; import { getTemplate } from '../service';
......
import { Modal, InputNumber, notification, Form, Input, Radio } from 'antd'; import { Form } from '@ant-design/compatible';
import '@ant-design/compatible/assets/index.css';
import { Modal, InputNumber, notification, Input, Radio } from 'antd';
import React from 'react'; import React from 'react';
import { updateStock } from '../service'; import { updateStock } from '../service';
......
...@@ -8,12 +8,14 @@ const { Option } = Select; ...@@ -8,12 +8,14 @@ const { Option } = Select;
const FormItem = Form.Item; const FormItem = Form.Item;
class goodsManage extends Component { class goodsManage extends Component {
formRef = React.createRef();
componentDidMount() { componentDidMount() {
this.props.onRef(this); this.props.onRef(this);
} }
setFiled = flag => { setFiled = flag => {
const { form } = this.props; const form = this.formRef.current;
if (flag === 'firstKeys') { if (flag === 'firstKeys') {
form.setFieldsValue({ firstSpecValue: '' }); form.setFieldsValue({ firstSpecValue: '' });
return; return;
...@@ -22,7 +24,8 @@ class goodsManage extends Component { ...@@ -22,7 +24,8 @@ class goodsManage extends Component {
}; };
batchSetting = () => { batchSetting = () => {
const { form, editData, isEdit } = this.props; const { editData, isEdit } = this.props;
const form = this.formRef.current;
const data = form.getFieldsValue(); const data = form.getFieldsValue();
if (!data.firstSpecValue && !data.secondSpecValue) { if (!data.firstSpecValue && !data.secondSpecValue) {
editData.forEach(item => { editData.forEach(item => {
...@@ -83,50 +86,41 @@ class goodsManage extends Component { ...@@ -83,50 +86,41 @@ class goodsManage extends Component {
isEdit, isEdit,
isService, isService,
} = this.props; } = this.props;
const { getFieldDecorator } = this.props.form;
return ( return (
<Form layout="inline" onSubmit={this.handleSubmit}> <Form layout="inline" ref={this.formRef}>
<FormItem> <FormItem name="firstSpecValue">
{getFieldDecorator('firstSpecValue', {})( <Select allowClear style={{ width: 120 }} placeholder={firstSpesName}>
<Select allowClear style={{ width: 120 }} placeholder={firstSpesName}> {firstSpes.length > 0 &&
{firstSpes.length > 0 && firstSpes.map(
firstSpes.map( item =>
item => item &&
item && typeof item === 'string' && (
typeof item === 'string' && ( <Option key={item} value={item}>
<Option key={item} value={item}> {item}
{item} </Option>
</Option> ),
), )}
)} </Select>
</Select>,
)}
</FormItem> </FormItem>
<FormItem> <FormItem name="secondSpecValue">
{getFieldDecorator('secondSpecValue', {})( <Select allowClear style={{ width: 120 }} placeholder={secondSpesName}>
<Select allowClear style={{ width: 120 }} placeholder={secondSpesName}> {secondSpecs.length &&
{secondSpecs.length && secondSpecs.map(
secondSpecs.map( item =>
item => item &&
item && typeof item === 'string' && (
typeof item === 'string' && ( <Option key={item} value={item}>
<Option key={item} value={item}> {item}
{item} </Option>
</Option> ),
), )}
)} </Select>
</Select>,
)}
</FormItem> </FormItem>
<FormItem> <FormItem name="supplyPrice">
{getFieldDecorator('supplyPrice', {})( <Input placeholder="供货价" style={{ width: 100 }} />
<Input placeholder="供货价" style={{ width: 100 }} />,
)}
</FormItem> </FormItem>
<FormItem> <FormItem name="marketPrice">
{getFieldDecorator('marketPrice', {})( <Input placeholder="市场价" style={{ width: 100 }} />
<Input placeholder="市场价" style={{ width: 100 }} />,
)}
</FormItem> </FormItem>
{/* <FormItem> {/* <FormItem>
{getFieldDecorator('salePrice', {})( {getFieldDecorator('salePrice', {})(
...@@ -134,41 +128,35 @@ class goodsManage extends Component { ...@@ -134,41 +128,35 @@ class goodsManage extends Component {
)} )}
</FormItem> */} </FormItem> */}
{productType === 1 && ( {productType === 1 && (
<FormItem> <FormItem name="weight">
{getFieldDecorator('weight', {})( <InputNumber
<InputNumber precision={3}
precision={3} max={999999.999}
max={999999.999} // eslint-disable-next-line radix
// eslint-disable-next-line radix placeholder="重量"
placeholder="重量" style={{ width: 130 }}
style={{ width: 130 }} />
/>,
)}
</FormItem> </FormItem>
)} )}
<FormItem> <FormItem name="productStock">
{getFieldDecorator('productStock', {})( <InputNumber
precision={0}
step={1}
// eslint-disable-next-line radix
formatter={val => parseInt(val, '10') || ''}
placeholder="库存"
style={{ width: 100 }}
/>
</FormItem>
{productType === 1 && (
<FormItem name="productStockWarning">
<InputNumber <InputNumber
placeholder="库存预警"
maxLength={5}
min={0}
precision={0} precision={0}
step={1}
// eslint-disable-next-line radix
formatter={val => parseInt(val, '10') || ''}
placeholder="库存"
style={{ width: 100 }} style={{ width: 100 }}
/>, />
)}
</FormItem>
{productType === 1 && (
<FormItem>
{getFieldDecorator('productStockWarning', {})(
<InputNumber
placeholder="库存预警"
maxLength={5}
min={0}
precision={0}
style={{ width: 100 }}
/>,
)}
</FormItem> </FormItem>
)} )}
<FormItem> <FormItem>
...@@ -181,4 +169,4 @@ class goodsManage extends Component { ...@@ -181,4 +169,4 @@ class goodsManage extends Component {
} }
} }
export default Form.create()(goodsManage); export default goodsManage;
This diff is collapsed.
...@@ -162,6 +162,7 @@ export function validateSpuInfo(values, initData, editData, productType) { ...@@ -162,6 +162,7 @@ export function validateSpuInfo(values, initData, editData, productType) {
const checkKey = Object.keys(newCheckObject); const checkKey = Object.keys(newCheckObject);
const checkString = []; const checkString = [];
editData.forEach((item, index) => { editData.forEach((item, index) => {
item.thirdSkuNo = item.third;
const rowCheckString = checkKey.reduce((checkMessage, val, ind) => { const rowCheckString = checkKey.reduce((checkMessage, val, ind) => {
const checkItem = item[val]; const checkItem = item[val];
if (checkItem === null || checkItem === undefined || checkItem === '') { if (checkItem === null || checkItem === undefined || checkItem === '') {
...@@ -279,15 +280,15 @@ export function editColumns( ...@@ -279,15 +280,15 @@ export function editColumns(
{ {
title: '商品自编码', title: '商品自编码',
align: 'center', align: 'center',
key: 'thirdSkuNo', dataIndex: 'third',
dataIndex: 'thirdSkuNo', key: 'third',
width: 100, width: 100,
render: (val, row, index) => ( render: (val, row, index) => (
<Input <Input
value={val} value={val}
className={`thirdSkuNo ${index}`} className={`third ${index}`}
defaultValue={val} defaultValue={val}
onChange={evt => inputChange(evt.target.value, 'thirdSkuNo', index)} onChange={evt => inputChange(evt.target.value, 'third', index)}
disabled={isService} disabled={isService}
/> />
), ),
......
import { Form, Input, Modal } from 'antd'; import { Form } from '@ant-design/compatible';
import '@ant-design/compatible/assets/index.css';
import { Input, Modal } from 'antd';
import React, { Component } from 'react'; import React, { Component } from 'react';
const { TextArea } = Input; const { TextArea } = Input;
......
import { Card, Form, Pagination, Table, notification, Drawer, Spin } from 'antd'; import { Form } from '@ant-design/compatible';
import '@ant-design/compatible/assets/index.css';
import { Card, Pagination, Table, notification, Drawer, Spin } from 'antd';
import React, { Component } from 'react'; import React, { Component } from 'react';
import { PageHeaderWrapper } from '@ant-design/pro-layout'; import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { connect } from 'dva'; import { connect } from 'dva';
......
...@@ -151,7 +151,7 @@ export function column() { ...@@ -151,7 +151,7 @@ export function column() {
align: 'center', align: 'center',
render: (_, row) => ( render: (_, row) => (
<div className={styles.actionBtn}> <div className={styles.actionBtn}>
{(row.state === 4 || (row.state === 5 && row.updateState !== 1)) && ( {(row.state === 4 || (row.state >= 5 && row.updateState !== 1)) && (
<Button <Button
key="edit" key="edit"
type="primary" type="primary"
......
...@@ -19,6 +19,9 @@ ...@@ -19,6 +19,9 @@
bottom: 20px; bottom: 20px;
left: 0; left: 0;
} }
.ptop {
margin-top: 5px;
}
.tabletop { .tabletop {
margin-top: 20px; margin-top: 20px;
...@@ -39,8 +42,8 @@ ...@@ -39,8 +42,8 @@
} }
.pullBtn { .pullBtn {
position: absolute; position: absolute;
top: -30px; top: 30px;
left: 700px; left: 800px;
} }
.price { .price {
...@@ -51,7 +54,7 @@ ...@@ -51,7 +54,7 @@
.searchForm { .searchForm {
:global { :global {
.ant-form-item-label { .ant-form-item-label {
width: 120px; line-height: 40px;
} }
} }
} }
......
import React, { Component } from 'react'; import React, { Component } from 'react';
import { Modal, Input, Button, Icon, notification, Form } from 'antd'; import { Modal, Input, Button, Icon, notification } from 'antd';
import { Form } from '@ant-design/compatible';
import styles from '../style.less'; import styles from '../style.less';
import { renderModal, detailsModal, formItemLayout } from './data'; import { renderModal, detailsModal, formItemLayout } from './data';
import Upload from './upload'; import Upload from './upload';
......
...@@ -59,15 +59,25 @@ const ReconciliationQuery = () => { ...@@ -59,15 +59,25 @@ const ReconciliationQuery = () => {
setselectedRows(selectedRows); setselectedRows(selectedRows);
} }
}; };
const queryData = async params => {
const { current, pageSize } = params;
setpages({ current, pageSize });
setselectedRowKeys([]);
setselectedRows([]);
const data = await query({ ...params });
return data;
};
const confirmAction = async () => { const confirmAction = async () => {
setloading(true); setloading(true);
if (checkedStatus(selectedRows)) { if (checkedStatus(selectedRows)) {
const data = await confirmSelfBill(selectedRowKeys); const data = await confirmSelfBill(selectedRowKeys);
if (data.code === '0000') { if (data.businessCode === '0000') {
setselectedRowKeys([]); setselectedRowKeys([]);
setselectedRows([]); setselectedRows([]);
reload(); actionRef.current.reloadAndRest();
// reload();
// queryData({ current: 1, pageSize: 20 })
notification.success({ message: '确认成功' }); notification.success({ message: '确认成功' });
} }
setloading(false); setloading(false);
...@@ -91,14 +101,6 @@ const ReconciliationQuery = () => { ...@@ -91,14 +101,6 @@ const ReconciliationQuery = () => {
setloading(false); setloading(false);
} }
}; };
const queryData = async params => {
const { current, pageSize } = params;
setpages({ current, pageSize });
setselectedRowKeys([]);
setselectedRows([]);
const data = await query({ ...params });
return data;
};
const gather = { const gather = {
onDownload, onDownload,
......
import React from 'react'; import React from 'react';
import { Modal, Row, Col, Input, Form, Select, notification } from 'antd'; import { Form } from '@ant-design/compatible';
import '@ant-design/compatible/assets/index.css';
import { Modal, Row, Col, Input, Select, notification } from 'antd';
import { audit } from '../appeal/services'; import { audit } from '../appeal/services';
const { TextArea } = Input; const { TextArea } = Input;
......
import React, { useState, useEffect } from 'react'; import React, { useState, useEffect } from 'react';
import { Modal, Form, Select, Input, notification } from 'antd'; import { Form } from '@ant-design/compatible';
import '@ant-design/compatible/assets/index.css';
import { Modal, Select, Input, notification } from 'antd';
import _ from 'lodash'; import _ from 'lodash';
import { addrQuery, update } from './services'; import { addrQuery, update } from './services';
...@@ -56,7 +58,7 @@ const AddressForm = props => { ...@@ -56,7 +58,7 @@ const AddressForm = props => {
resetForm(); resetForm();
}; };
const getAddr = async (val, type, edit) => { const getAddr = async (val, type, edit) => {
const data = await addrQuery({ parentId: val?.key || val }); const data = await addrQuery({ parentId: val?.value || val });
switch (type) { switch (type) {
case 'city': case 'city':
setCityList(data); setCityList(data);
......
...@@ -63,7 +63,9 @@ const TableList = () => { ...@@ -63,7 +63,9 @@ const TableList = () => {
renderFormItem: () => ( renderFormItem: () => (
<Select onChange={changeSupplier} value={shopId} allowClear> <Select onChange={changeSupplier} value={shopId} allowClear>
{supplierList.map(item => ( {supplierList.map(item => (
<Option value={item.id}>{item.name}</Option> <Option value={item.id} key={item.id}>
{item.name}
</Option>
))} ))}
</Select> </Select>
), ),
...@@ -167,7 +169,7 @@ const TableList = () => { ...@@ -167,7 +169,7 @@ const TableList = () => {
columns={columns} columns={columns}
params={{ shopId }} params={{ shopId }}
request={res => query(res)} request={res => query(res)}
rowKey="id" rowKey={r => r.shopId}
bordered bordered
scroll={{ x: 1500 }} scroll={{ x: 1500 }}
toolBarRender={() => [ toolBarRender={() => [
......
...@@ -70,7 +70,6 @@ export default () => { ...@@ -70,7 +70,6 @@ export default () => {
orderTimeEndAt: params.orderTime?.[1], orderTimeEndAt: params.orderTime?.[1],
auditStatus: 2, auditStatus: 2,
}; };
return searchList(tempParams, type); return searchList(tempParams, type);
}; };
const columns = [ const columns = [
...@@ -103,7 +102,7 @@ export default () => { ...@@ -103,7 +102,7 @@ export default () => {
key="passaudit" key="passaudit"
columns={columns} columns={columns}
request={params => query(params, 2)} request={params => query(params, 2)}
rowKey="skuId" rowKey={r => r.orderId + r.serviceNo}
pagination={{ pagination={{
pagesSize: 20, pagesSize: 20,
}} }}
......
import React, { useState, useRef } from 'react'; /* eslint-disable no-mixed-operators */
/* eslint-disable radix */
import React, { useState, useRef, useEffect } 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';
import AuditModal from './components/auditModal'; import AuditModal from './components/auditModal';
import DetailTable from './components/detailTable'; import DetailTable from './components/detailTable';
import { dateDiff } from './common'; import { dateDiff } from './common';
import moment from 'moment';
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 +78,37 @@ export default () => { ...@@ -71,6 +78,37 @@ export default () => {
setDetailInfo(data || []); setDetailInfo(data || []);
setDetailVisible(true); setDetailVisible(true);
}; };
const renderContent = (record, index, action) => {
if (!time[record.orderId]) {
const applyTime = moment(record.applyTime).valueOf() + 24 * 3600 * 1000;
const nowTime = moment(record.nowTime).valueOf();
let timeNumber = (applyTime - nowTime) / 1000;
time[record.orderId] = 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[record.orderId] = str;
const strings = _.cloneDeep(timeString);
setTimeString(strings);
} else {
clearInterval(time[record.orderId]);
timeString[record.orderId] = '0时0分0秒';
const strings = _.cloneDeep(timeString);
setTimeString(strings);
}
}, 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
...@@ -84,7 +122,22 @@ export default () => { ...@@ -84,7 +122,22 @@ export default () => {
setAuditInfo({ serviceNo }); setAuditInfo({ serviceNo });
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[record.orderId]}
</span>,
],
},
...column, ...column,
{ {
title: '操作', title: '操作',
...@@ -92,6 +145,7 @@ export default () => { ...@@ -92,6 +145,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">
审核 审核
...@@ -107,12 +161,13 @@ export default () => { ...@@ -107,12 +161,13 @@ export default () => {
<ProTable <ProTable
columns={columns} columns={columns}
request={params => query(params, 1)} request={params => query(params, 1)}
rowKey="serviceNo" rowKey={r => r.orderId + r.serviceNo}
pagination={{ pagination={{
pagesSize: 20, pagesSize: 20,
}} }}
bordered bordered
actionRef={table} actionRef={table}
formRef={ref}
scroll={{ x: '100%', y: 400 }} scroll={{ x: '100%', y: 400 }}
search={{ search={{
collapsed: false, collapsed: false,
......
import React from 'react'; import React from 'react';
import { Modal, Form, Input, Cascader, notification } from 'antd'; import { Form } from '@ant-design/compatible';
import '@ant-design/compatible/assets/index.css';
import { Modal, Input, Cascader, notification } from 'antd';
import { shopAudit } from '../service'; import { shopAudit } from '../service';
const FormItem = Form.Item; const FormItem = Form.Item;
......
...@@ -23,7 +23,13 @@ export default props => { ...@@ -23,7 +23,13 @@ export default props => {
]; ];
return ( return (
<Modal title="订单详情" visible={visible} onCancel={handleCancel} footer={null} width={800}> <Modal title="订单详情" visible={visible} onCancel={handleCancel} footer={null} width={800}>
<Table dataSource={dataSource} columns={columns} key="skuName" pagination={false} bordered /> <Table
dataSource={dataSource}
columns={columns}
key={r => r.orderId}
pagination={false}
bordered
/>
</Modal> </Modal>
); );
}; };
import React from 'react'; import React from 'react';
import { Modal, Form, Input, notification } from 'antd'; import { Form } from '@ant-design/compatible';
import '@ant-design/compatible/assets/index.css';
import { Modal, Input, notification } from 'antd';
import { shopCheck } from '../service'; import { shopCheck } from '../service';
const FormItem = Form.Item; const FormItem = Form.Item;
......
...@@ -100,6 +100,7 @@ export const column = [ ...@@ -100,6 +100,7 @@ export const column = [
0: '待处理', 0: '待处理',
1: '同意', 1: '同意',
2: '不同意', 2: '不同意',
3: '超时未处理,系统自动审核同意',
}, },
}, },
{ {
......
...@@ -29,7 +29,7 @@ export async function searchList(params, auditStatus) { ...@@ -29,7 +29,7 @@ export async function searchList(params, auditStatus) {
}; };
} }
return { return {
total: 0, total: 10,
data: [], data: [],
}; };
} }
......
import { Upload, Icon, Modal, notification } from 'antd'; import { DeleteOutlined, EyeOutlined, PlusOutlined } from '@ant-design/icons';
import { Upload, Modal, notification } from 'antd';
import React from 'react'; import React from 'react';
import { ReactSortable } from 'react-sortablejs'; import { ReactSortable } from 'react-sortablejs';
import lodash from 'lodash'; import lodash from 'lodash';
...@@ -152,20 +153,20 @@ class PicturesWall extends React.Component { ...@@ -152,20 +153,20 @@ class PicturesWall extends React.Component {
const { previewVisible, previewImage, fileList } = this.state; const { previewVisible, previewImage, fileList } = this.state;
const uploadButton = ( const uploadButton = (
<div> <div>
<Icon type="plus" /> <PlusOutlined />
<div className="ant-upload-text">上传图片</div> <div className="ant-upload-text">上传图片</div>
</div> </div>
); );
const { max, isDisabled } = this.props; const { max, isDisabled } = this.props;
const that = this; const that = this;
const uploadProps = { const uploadProps = {
accept: '.jpg,.png,.jpeg',
beforeUpload: lodash.debounce(async (file, files) => { beforeUpload: lodash.debounce(async (file, files) => {
const optionsArray = await CheckImageInfoList(files); const optionsArray = await CheckImageInfoList(files);
const onRightImgList = await isUploadNext(optionsArray, that.props.id); const onRightImgList = await isUploadNext(optionsArray, that.props.id);
if (!onRightImgList.length) { if (!onRightImgList.length) {
return; return;
} }
console.log('校验通过的队列=======>', onRightImgList);
this.setState( this.setState(
state => ({ state => ({
newFile: [...state.newFile, ...onRightImgList], newFile: [...state.newFile, ...onRightImgList],
...@@ -196,7 +197,7 @@ class PicturesWall extends React.Component { ...@@ -196,7 +197,7 @@ class PicturesWall extends React.Component {
listType: 'picture-card', listType: 'picture-card',
}; };
return ( return (
<div className="clearfix"> <div className={styles.clearfix}>
<div className={styles.imgContent}> <div className={styles.imgContent}>
{fileList.length > 0 && ( {fileList.length > 0 && (
<ReactSortable list={fileList} setList={list => this.sortChange(list)}> <ReactSortable list={fileList} setList={list => this.sortChange(list)}>
...@@ -213,18 +214,14 @@ class PicturesWall extends React.Component { ...@@ -213,18 +214,14 @@ class PicturesWall extends React.Component {
</div> </div>
{this.state.activeImgIndex === index && ( {this.state.activeImgIndex === index && (
<div className={styles.mask}> <div className={styles.mask}>
<Icon <EyeOutlined
type="eye"
className={styles.maskIcon} className={styles.maskIcon}
onClick={() => this.handlePreview(item)} onClick={() => this.handlePreview(item)}
/> />
{!isDisabled && ( <DeleteOutlined
<Icon className={styles.maskIcon}
type="delete" onClick={() => this.onRemoveImg(item)}
className={styles.maskIcon} />
onClick={() => this.onRemoveImg(item)}
/>
)}
</div> </div>
)} )}
</div> </div>
......
...@@ -28,3 +28,7 @@ ...@@ -28,3 +28,7 @@
font-size: 16px; font-size: 16px;
cursor: pointer; cursor: pointer;
} }
.clearfix {
margin-right: 200px;
}
import { Upload, Icon, Modal, message } from 'antd'; import { PlusOutlined } from '@ant-design/icons';
import { Upload, Modal, message } from 'antd';
import React from 'react'; import React from 'react';
import config from '../../../config/env.config'; import config from '../../../config/env.config';
import { qiniuToken } from '@/services/qiniu'; import { qiniuToken } from '@/services/qiniu';
...@@ -88,7 +89,7 @@ class PicturesWall extends React.Component { ...@@ -88,7 +89,7 @@ class PicturesWall extends React.Component {
const { previewVisible, previewImage, fileList } = this.state; const { previewVisible, previewImage, fileList } = this.state;
const uploadButton = ( const uploadButton = (
<div> <div>
<Icon type="plus" /> <PlusOutlined />
<div className="ant-upload-text">上传图片</div> <div className="ant-upload-text">上传图片</div>
</div> </div>
); );
......
import { Form, Modal, Input, Select, Cascader, Tag, notification } from 'antd'; import { Form } from '@ant-design/compatible';
import '@ant-design/compatible/assets/index.css';
import { Modal, Input, Select, Cascader, Tag, notification } from 'antd';
import React, { useState, useEffect } from 'react'; import React, { useState, useEffect } from 'react';
import RcTreeSelect from 'rc-tree-select';
import { el } from 'date-fns/locale'; import { el } from 'date-fns/locale';
import { areaList, getAddTemplate, forbiddenAddress } from '../services'; import { areaList, getAddTemplate, forbiddenAddress } from '../services';
...@@ -9,13 +10,12 @@ const { Option } = Select; ...@@ -9,13 +10,12 @@ const { Option } = Select;
const AddAreaModal = props => { const AddAreaModal = props => {
const { const {
visible, visible,
form: { getFieldDecorator, validateFields, resetFields }, form: { getFieldDecorator, validateFields, resetFields, setFieldsValue },
templateData, templateData,
} = props; } = props;
const [addList, setAddList] = useState([]); const [addList, setAddList] = useState([]);
const [selectedList, setSelectedList] = useState([]); const [selectedList, setSelectedList] = useState([]);
const [selected, setSelect] = useState([]); const [selected, setSelect] = useState([]);
const a = [];
const formItemLayout = { const formItemLayout = {
labelCol: { labelCol: {
span: 6, span: 6,
...@@ -59,14 +59,13 @@ const AddAreaModal = props => { ...@@ -59,14 +59,13 @@ const AddAreaModal = props => {
value: itemData.addrId, value: itemData.addrId,
addressId: itemData.addrId, addressId: itemData.addrId,
addressLevel: itemData.addrLevel, addressLevel: itemData.addrLevel,
// isLeaf: itemData.addrLevel === 4,
isLeaf: false, isLeaf: false,
}), }),
); );
targetOption.children = newData; targetOption.children = newData;
targetOption.loading = false;
setAddList([...addList]);
} }
targetOption.loading = false;
setAddList([...addList]);
}; };
// 限制区域删除 // 限制区域删除
const preventDefault = val => { const preventDefault = val => {
...@@ -119,45 +118,30 @@ const AddAreaModal = props => { ...@@ -119,45 +118,30 @@ const AddAreaModal = props => {
}); });
}; };
// 判断是否重复 // 判断是否重复
const getChilds = (data, { addressId }) => { const getChilds = select => {
let flag = true; const reslutData = selectedList.filter(
const arr = []; item =>
function judgeChildren(dat) { !select.addressName.includes(item.addressName) &&
// eslint-disable-next-line no-plusplus !item.addressName.includes(select.addressName),
for (let i = 0; i < dat.length; i++) { );
const item = dat[i]; reslutData.push(select);
if (!flag) { return reslutData;
return;
}
if (+item.addressId === +addressId) {
flag = false;
}
// if (item.children && item.children.length) {
// judgeChildren(item.children);
// }
}
}
judgeChildren(data);
return flag;
}; };
const onPopupVisibleChange = labels => { const onPopupVisibleChange = labels => {
if (!labels && selected?.length) { if (!labels && selected?.length) {
const select = selected.slice(-1)[0]; const select = selected.slice(-1)[0];
const arr = selected.map(x => x.label); const arr = selected.map(x => x.label);
select.addressName = arr.join('/'); select.addressName = arr.join('/');
const staust = getChilds(selectedList, select); const reslutData = getChilds(select);
if (staust) { // 用中文字符排序
selectedList.push(select); const resultArray = reslutData.sort((param1, param2) =>
// 用中文字符排序 param1.addressName.localeCompare(param2.addressName, 'zh'),
const resultArray = selectedList.sort((param1, param2) => );
param1.addressName.localeCompare(param2.addressName, 'zh'), setSelectedList([...resultArray]);
); setSelect([]);
setSelectedList([...resultArray]);
setSelect([]);
}
} }
}; };
useEffect(() => { useEffect(() => {
getAreaList(); getAreaList();
if (props.templateData) { if (props.templateData) {
...@@ -189,9 +173,8 @@ const AddAreaModal = props => { ...@@ -189,9 +173,8 @@ const AddAreaModal = props => {
loadData={loadData} loadData={loadData}
onChange={(val, label) => onChange(val, label)} onChange={(val, label) => onChange(val, label)}
allowClear={false} allowClear={false}
// expandTrigger="hover"
changeOnSelect changeOnSelect
onPopupVisibleChange={onPopupVisibleChange} onDropdownVisibleChange={onPopupVisibleChange}
/>, />,
)} )}
{selectedList?.map((selItem, selIndex) => ( {selectedList?.map((selItem, selIndex) => (
......
...@@ -9,8 +9,8 @@ import { ...@@ -9,8 +9,8 @@ import {
downUploadeOrder, downUploadeOrder,
} from '../pendingDeliveryOrder/service'; } from '../pendingDeliveryOrder/service';
const TableList = () => { const TableList = ref => {
const actionRef = useRef(); const actionRef = useRef(null);
const columns = [ const columns = [
{ {
title: '批次号', title: '批次号',
...@@ -164,6 +164,8 @@ const TableList = () => { ...@@ -164,6 +164,8 @@ const TableList = () => {
onClick={() => { onClick={() => {
// eslint-disable-next-line no-unused-expressions // eslint-disable-next-line no-unused-expressions
form?.resetFields(); form?.resetFields();
// eslint-disable-next-line no-unused-expressions
form?.submit();
}} }}
> >
{resetText} {resetText}
......
import React, { useState, useEffect } from 'react'; import React, { useState, useEffect } from 'react';
import { Modal, Form, Select, Input, Icon, Card, notification } from 'antd'; import { MinusCircleOutlined, PlusCircleOutlined } from '@ant-design/icons';
import { Form } from '@ant-design/compatible';
import '@ant-design/compatible/assets/index.css';
import { Modal, Select, Input, Card, notification } from 'antd';
import style from '../index.less'; import style from '../index.less';
import { updateExpress } from '../service'; import { updateExpress } from '../service';
...@@ -160,8 +163,8 @@ const LogisticsForm = props => { ...@@ -160,8 +163,8 @@ const LogisticsForm = props => {
</Card> </Card>
))} ))}
<div className={style.logistics}> <div className={style.logistics}>
<Icon className={style.logisticsIcon} onClick={addForm} type="plus-circle" /> <PlusCircleOutlined className={style.logisticsIcon} onClick={addForm} />
<Icon className={style.logisticsIcon} onClick={rmForm} type="minus-circle" /> <MinusCircleOutlined className={style.logisticsIcon} onClick={rmForm} />
</div> </div>
</Form> </Form>
</Modal> </Modal>
......
...@@ -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(Number(status));
},
},
valueEnum: {
1: '',
2: '',
},
},
{ {
title: '交易时间', title: '交易时间',
dataIndex: 'orderTime', dataIndex: 'orderTime',
...@@ -151,7 +169,7 @@ const TableList = props => { ...@@ -151,7 +169,7 @@ const TableList = props => {
title: '商品自编码', title: '商品自编码',
dataIndex: 'thirdSpuNo', dataIndex: 'thirdSpuNo',
key: 'thirdSpuNo', key: 'thirdSpuNo',
width: 120, width: 150,
hideInSearch: true, hideInSearch: true,
className: 'colStyle', className: 'colStyle',
render: (_, record) => renderContent(record, 'thirdSpuNo'), render: (_, record) => renderContent(record, 'thirdSpuNo'),
...@@ -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,
timeOutType: orderStatus || '',
}; };
return queryToSend(transformedParam); return queryToSend(transformedParam);
}; };
...@@ -323,6 +348,9 @@ const TableList = props => { ...@@ -323,6 +348,9 @@ const TableList = props => {
onClick={() => { onClick={() => {
// eslint-disable-next-line no-unused-expressions // eslint-disable-next-line no-unused-expressions
form?.resetFields(); form?.resetFields();
setorderStatus('');
// eslint-disable-next-line no-unused-expressions
form?.submit();
}} }}
> >
{resetText} {resetText}
......
import React from 'react'; import React from 'react';
import { Modal, Form, Select, Input, notification } from 'antd'; import { Form } from '@ant-design/compatible';
import '@ant-design/compatible/assets/index.css';
import { Modal, Select, Input, notification } from 'antd';
import { updateStatus } from '../services'; import { updateStatus } from '../services';
const FormItem = Form.Item; const FormItem = Form.Item;
......
import React, { useState, useEffect } from 'react'; import React, { useState, useEffect } from 'react';
import { Modal, Form, Select, Input, notification } from 'antd'; import { Form } from '@ant-design/compatible';
import '@ant-design/compatible/assets/index.css';
import { Modal, Select, Input, notification } from 'antd';
import _ from 'lodash'; import _ from 'lodash';
import { update } from './services'; import { update } from './services';
import { addrQuery } from '../afterSaleAddress/services'; import { addrQuery } from '../afterSaleAddress/services';
......
...@@ -2,7 +2,7 @@ import { Button, Select } from 'antd'; ...@@ -2,7 +2,7 @@ import { Button, Select } from 'antd';
import React, { useRef, useEffect, useState } from 'react'; import React, { useRef, useEffect, useState } from 'react';
import { PageHeaderWrapper } from '@ant-design/pro-layout'; import { PageHeaderWrapper } from '@ant-design/pro-layout';
import ProTable from '@ant-design/pro-table'; import ProTable from '@ant-design/pro-table';
import Link from 'umi/link'; import { Link } from 'umi';
import styles from './index.less'; import styles from './index.less';
import { query, supplier, downDetail } from './services'; import { query, supplier, downDetail } from './services';
...@@ -63,7 +63,9 @@ const TableList = () => { ...@@ -63,7 +63,9 @@ const TableList = () => {
renderFormItem: () => ( renderFormItem: () => (
<Select onChange={changeSupplier} value={shopId} allowClear> <Select onChange={changeSupplier} value={shopId} allowClear>
{supplierList.map(item => ( {supplierList.map(item => (
<Option value={item.id}>{item.name}</Option> <Option value={item.id} key={item.id}>
{item.name}
</Option>
))} ))}
</Select> </Select>
), ),
...@@ -149,7 +151,7 @@ const TableList = () => { ...@@ -149,7 +151,7 @@ const TableList = () => {
columns={columns} columns={columns}
params={{ shopId }} params={{ shopId }}
request={res => query(res)} request={res => query(res)}
rowKey="id" rowKey={r => r.batchNo}
bordered bordered
scroll={{ x: 1500 }} scroll={{ x: 1500 }}
search={{ search={{
......
...@@ -150,8 +150,9 @@ export default () => { ...@@ -150,8 +150,9 @@ export default () => {
}, },
{ {
title: '操作', title: '操作',
valueType: 'option', dataIndex: 'action',
width: 280, hideInSearch: true,
width: 200,
fixed: 'right', fixed: 'right',
render: (_, r) => tableRenderBtn(r), render: (_, r) => tableRenderBtn(r),
}, },
...@@ -165,7 +166,7 @@ export default () => { ...@@ -165,7 +166,7 @@ export default () => {
className={style.table} className={style.table}
request={query} request={query}
search={{ collapsed: false }} search={{ collapsed: false }}
rowKey="id" rowKey={r => r.settlementNo}
pagination={{ pagination={{
defaultCurrent: 1, defaultCurrent: 1,
}} }}
......
import React, { useRef, useState, useEffect } from 'react'; import React, { useRef, useState, useEffect } from 'react';
import { Modal, Button, Tabs, Upload, notification, Icon } from 'antd'; import { UploadOutlined } from '@ant-design/icons';
import { Modal, Button, Tabs, Upload, notification } from 'antd';
import styles from '../style.less'; import styles from '../style.less';
import { uploadFile, uploadPic } from '../service'; import { uploadFile, uploadPic } from '../service';
import UploadC from '../../components/upload'; import UploadC from '../../components/upload';
...@@ -87,7 +88,7 @@ export default props => { ...@@ -87,7 +88,7 @@ export default props => {
</a> </a>
<Dragger {...uploadProps} className={styles.clearfloat}> <Dragger {...uploadProps} className={styles.clearfloat}>
<p> <p>
<Icon type="upload" /> <UploadOutlined />
</p> </p>
<p>点击上传附件</p> <p>点击上传附件</p>
</Dragger> </Dragger>
......
import { Button, Col, Form, Input, Row } from 'antd'; import { Form } from '@ant-design/compatible';
import '@ant-design/compatible/assets/index.css';
import { Button, Col, Input, Row } from 'antd';
import React, { Component } from 'react'; import React, { Component } from 'react';
import omit from 'omit.js'; import omit from 'omit.js';
import ItemMap from './map'; import ItemMap from './map';
......
import { Button, Form } from 'antd'; import { Form } from '@ant-design/compatible';
import '@ant-design/compatible/assets/index.css';
import { Button } from 'antd';
import React from 'react'; import React from 'react';
import classNames from 'classnames'; import classNames from 'classnames';
import styles from './index.less'; import styles from './index.less';
......
import { Form, Tabs } from 'antd'; import { Form } from '@ant-design/compatible';
import '@ant-design/compatible/assets/index.css';
import { Tabs } from 'antd';
import React, { Component } from 'react'; import React, { Component } from 'react';
import classNames from 'classnames'; import classNames from 'classnames';
import LoginContext from './LoginContext'; import LoginContext from './LoginContext';
......
import { Icon } from 'antd'; import { LockOutlined, MailOutlined, MobileOutlined, UserOutlined } from '@ant-design/icons';
import React from 'react'; import React from 'react';
import styles from './index.less'; import styles from './index.less';
...@@ -7,7 +7,7 @@ export default { ...@@ -7,7 +7,7 @@ export default {
props: { props: {
size: 'large', size: 'large',
id: 'userName', id: 'userName',
prefix: <Icon type="user" className={styles.prefixIcon} />, prefix: <UserOutlined className={styles.prefixIcon} />,
placeholder: 'admin', placeholder: 'admin',
}, },
rules: [ rules: [
...@@ -20,7 +20,7 @@ export default { ...@@ -20,7 +20,7 @@ export default {
Password: { Password: {
props: { props: {
size: 'large', size: 'large',
prefix: <Icon type="lock" className={styles.prefixIcon} />, prefix: <LockOutlined className={styles.prefixIcon} />,
type: 'password', type: 'password',
id: 'password', id: 'password',
placeholder: '888888', placeholder: '888888',
...@@ -35,7 +35,7 @@ export default { ...@@ -35,7 +35,7 @@ export default {
Mobile: { Mobile: {
props: { props: {
size: 'large', size: 'large',
prefix: <Icon type="mobile" className={styles.prefixIcon} />, prefix: <MobileOutlined className={styles.prefixIcon} />,
placeholder: 'mobile number', placeholder: 'mobile number',
}, },
rules: [ rules: [
...@@ -52,7 +52,7 @@ export default { ...@@ -52,7 +52,7 @@ export default {
Captcha: { Captcha: {
props: { props: {
size: 'large', size: 'large',
prefix: <Icon type="mail" className={styles.prefixIcon} />, prefix: <MailOutlined className={styles.prefixIcon} />,
placeholder: 'captcha', placeholder: 'captcha',
}, },
rules: [ rules: [
......
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