Commit 31bbc3be authored by 张子雨's avatar 张子雨

Merge branch 'feature/meal-3.0' of...

Merge branch 'feature/meal-3.0' of http://git.quantgroup.cn/ui/merchant-manage-ui into feature/meal-3.0

* 'feature/meal-3.0' of http://git.quantgroup.cn/ui/merchant-manage-ui:
  fix: 修改review问题
  fix: 修改review代码
parents 84aa90da 82de3154
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
*/ */
// 从tob进入的判断接口前缀 // 从tob进入的判断接口前缀
const getUrlParams = name => { const getUrlParams = name => {
const regArg = new RegExp(`(^|&)${name}=([^&]*)(&|$)`); const regArg = RegExp(`(^|&)${name}=([^&]*)(&|$)`);
const r = window.location.search.substring(1).match(regArg); const r = regArg.exec(window.location.search.substring(1));
if (r != null) return decodeURIComponent(r[2]); if (r != null) return decodeURIComponent(r[2]);
return null; return null;
}; };
......
...@@ -11,7 +11,6 @@ import { connect } from 'dva'; ...@@ -11,7 +11,6 @@ import { connect } from 'dva';
import { Icon as LegacyIcon } from '@ant-design/compatible'; import { Icon as LegacyIcon } from '@ant-design/compatible';
import { Result, Button, Layout, Menu } from 'antd'; import { Result, Button, Layout, Menu } from 'antd';
import Authorized from '@/utils/Authorized'; import Authorized from '@/utils/Authorized';
import localStorage from '@/utils/localStorage';
import RightContent from '@/components/GlobalHeader/RightContent'; import RightContent from '@/components/GlobalHeader/RightContent';
import MessageReminder from '@/components/MessageReminder'; import MessageReminder from '@/components/MessageReminder';
import { getAuthorityFromRouter, getUrlSearchParams, getToken } from '@/utils/utils'; import { getAuthorityFromRouter, getUrlSearchParams, getToken } from '@/utils/utils';
......
import React, { useState, useEffect } from 'react'; import React, { useState, useEffect } from 'react';
import { Row, Col } from 'antd'; import { Row, Col } from 'antd';
import { Link } from 'umi'; 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 { FileTextOutlined } from '@ant-design/icons';
import style from './styles.less'; import style from './styles.less';
import { getPendingNum } from './service'; import { getPendingNum } from './service';
import { connect } from 'dva'; import { connect } from 'dva';
import { import { AFTER_SALE_ORDER, PENDING_DELIVERY_ORDER } from '@/../config/permission.config';
AFTER_SALE_ORDER,
CANCEL_BILL_MANAGE,
PENDING_DELIVERY_ORDER,
} from '@/../config/permission.config';
const Admin = props => { const Admin = props => {
const [pendingNum, setPendingNum] = useState({}); const [pendingNum, setPendingNum] = useState({});
const showAfterSaleList = props.permissions[AFTER_SALE_ORDER.LIST]; const showAfterSaleList = props.permissions[AFTER_SALE_ORDER.LIST];
const showCancelBillList = props.permissions[CANCEL_BILL_MANAGE.LIST];
const showPendingDeliveryOrderList = props.permissions[PENDING_DELIVERY_ORDER.LIST]; const showPendingDeliveryOrderList = props.permissions[PENDING_DELIVERY_ORDER.LIST];
const qurey = async () => { const query = async () => {
const res = await getPendingNum(); const res = await getPendingNum();
if (res && res.data) { setPendingNum(res?.data || {});
setPendingNum(res.data);
}
}; };
useEffect(() => { useEffect(() => {
qurey(); query();
}, []); }, []);
return ( return (
......
...@@ -4,7 +4,6 @@ import { Card, Pagination, Table, notification, Drawer, Spin, Button, Modal } fr ...@@ -4,7 +4,6 @@ import { Card, Pagination, Table, notification, Drawer, Spin, Button, Modal } fr
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';
import { getToken } from '@/utils/utils';
import styles from './style.less'; import styles from './style.less';
import UpdateStock from './UpdateStock'; import UpdateStock from './UpdateStock';
......
...@@ -162,18 +162,14 @@ const CustomerInfo = props => { ...@@ -162,18 +162,14 @@ const CustomerInfo = props => {
if (props.id && ms.length < mealTypes.length) { if (props.id && ms.length < mealTypes.length) {
await checkConfirm(); await checkConfirm();
} }
// 添加餐段 // 取消外卖,必须取消自助餐
if (mealTypes.length < ms.length) { if (mealTypes.includes('1') && !ms.includes('1')) {
if (!ms.includes('1') && ms.includes('2')) { ms = ms.filter(item => item !== '2');
ms.push('1');
}
} else if (!ms.includes('1') && ms.includes('2')) {
// 去除餐段
if (ms.includes('4')) {
ms = ['4'];
} else {
ms = [];
} }
// 选择自助餐,必须选择外卖
if (!mealTypes.includes('1') && ms.includes('2')) {
ms.push('1');
} }
form.setFieldsValue({ form.setFieldsValue({
mealType: ms, mealType: ms,
......
...@@ -51,14 +51,13 @@ const SaleDateModal = props => { ...@@ -51,14 +51,13 @@ const SaleDateModal = props => {
api = apiSelVirtualGoodsList; api = apiSelVirtualGoodsList;
} }
const res = await api(data); const res = await api(data);
console.log('res :>> ', res); const arr =
if (res && res.data && res.data.records) { res?.data?.records?.map(item => {
res.data.records.forEach(item => {
item.enterprisePrice = item.salePrice; item.enterprisePrice = item.salePrice;
}); return item;
setDataSource(res.data.records); }) || [];
setTotal(res.data.total); setDataSource(arr);
} setTotal(res?.data?.total || 0);
setLoading(false); setLoading(false);
}; };
......
...@@ -108,25 +108,18 @@ const TakeawayGoods = () => { ...@@ -108,25 +108,18 @@ const TakeawayGoods = () => {
// 根据企业ID获取取餐点 // 根据企业ID获取取餐点
const getPickSelf = async id => { const getPickSelf = async id => {
const res = await apiSelPickSelfList({ enterpriseId: id }); const res = await apiSelPickSelfList({ enterpriseId: id });
if (res && res.data && res.data.length) { const arr =
setPickSelfList( res?.data?.map(item => ({
res.data.map(item => ({
key: `${item.pickSelfId}`, key: `${item.pickSelfId}`,
label: <span>{item.pickSelfName}</span>, label: <span>{item.pickSelfName}</span>,
})), })) || [];
); setPickSelfList(arr);
const pid = res.data[0].pickSelfId; const [obj] = res?.data || [];
const pid = `${obj?.pickSelfId || ''}`;
setActiveKey(`${pid}`); setActiveKey(`${pid}`);
if (pageLoaded) { if (pageLoaded) {
onRefresh(); onRefresh();
} }
} else {
setPickSelfList([]);
setActiveKey('');
if (pageLoaded) {
onRefresh();
}
}
}; };
// 改变企业 // 改变企业
......
...@@ -3,7 +3,6 @@ import { parse } from 'querystring'; ...@@ -3,7 +3,6 @@ import { parse } from 'querystring';
import pathRegexp from 'path-to-regexp'; import pathRegexp from 'path-to-regexp';
import moment from 'moment'; import moment from 'moment';
import localStorage from './localStorage'; import localStorage from './localStorage';
import config from '@/../config/env.config';
/* eslint no-useless-escape:0 import/prefer-default-export:0 */ /* eslint no-useless-escape:0 import/prefer-default-export:0 */
const reg = /(((^https?:(?:\/\/)?)(?:[-;:&=\+\$,\w]+@)?[A-Za-z0-9.-]+(?::\d+)?|(?:www.|[-;:&=\+\$,\w]+@)[A-Za-z0-9.-]+)((?:\/[\+~%\/.\w-_]*)?\??(?:[-\+=&;%@.\w_]*)#?(?:[\w]*))?)$/; const reg = /(((^https?:(?:\/\/)?)(?:[-;:&=\+\$,\w]+@)?[A-Za-z0-9.-]+(?::\d+)?|(?:www.|[-;:&=\+\$,\w]+@)[A-Za-z0-9.-]+)((?:\/[\+~%\/.\w-_]*)?\??(?:[-\+=&;%@.\w_]*)#?(?:[\w]*))?)$/;
...@@ -183,8 +182,8 @@ export const getErrorMessage = err => { ...@@ -183,8 +182,8 @@ export const getErrorMessage = err => {
// 获取地址栏参数,name:参数名称 // 获取地址栏参数,name:参数名称
export const getUrlParams = name => { export const getUrlParams = name => {
const regArg = new RegExp(`(^|&)${name}=([^&]*)(&|$)`); const regArg = RegExp(`(^|&)${name}=([^&]*)(&|$)`);
const r = window.location.search.substring(1).match(regArg); const r = regArg.exec(window.location.search.substring(1));
if (r != null) return decodeURIComponent(r[2]); if (r != null) return decodeURIComponent(r[2]);
return null; return null;
}; };
......
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