Commit 1f504a1e authored by 武广's avatar 武广

fix: 修改获取企业列表接口

parent 27a6d72c
import RoleType, { isPlatForm } from './role.config'; import RoleType, { isPlatForm } from './role.config';
const isProduction = process.env.NODE_ENV === 'production'; const isProduction = process.env.NODE_ENV === 'production';
const isPre = process.env.PRE_ENV === 'pre'; const isPre = process.env.PRE_ENV === 'pre';
const environment = 'sc'; const environment = 'yxm2';
const envAPi = { const envAPi = {
api: `https://security-${environment}.liangkebang.net`, //'https://security-xyqb.liangkebang.net', api: `https://security-${environment}.liangkebang.net`, //'https://security-xyqb.liangkebang.net',
......
...@@ -230,7 +230,7 @@ const CustomerInfo = props => { ...@@ -230,7 +230,7 @@ const CustomerInfo = props => {
obj.mealTimePeriod = []; obj.mealTimePeriod = [];
} }
obj.mealLimit = {}; obj.mealLimit = {};
if (res.data.mealLimit) { if (res.data.mealLimit && res.data.mealLimit.length) {
res.data.mealLimit.forEach(item => { res.data.mealLimit.forEach(item => {
obj.mealLimit[`limit${item.mealPeriodType}`] = {}; obj.mealLimit[`limit${item.mealPeriodType}`] = {};
item.limit.forEach(limit => { item.limit.forEach(limit => {
...@@ -245,12 +245,16 @@ const CustomerInfo = props => { ...@@ -245,12 +245,16 @@ const CustomerInfo = props => {
if (+res.data.hideImage) { if (+res.data.hideImage) {
obj.hideInfo.push('hideImage'); obj.hideInfo.push('hideImage');
} }
obj.mealType = res.data.mealType.map(item => `${item}`); if (res.data.mealType) {
obj.mealType = res.data.mealType.map(item => `${item}`);
}
setMealTypes(obj.mealType); setMealTypes(obj.mealType);
const json = {}; const json = {};
res.data.mealTimePeriod.forEach(item => { if (res.data.mealTimePeriod) {
json[item.mealPeriodType] = mealSections[item.mealPeriodType]; res.data.mealTimePeriod.forEach(item => {
}); json[item.mealPeriodType] = mealSections[item.mealPeriodType];
});
}
setMeals(json); setMeals(json);
form.setFieldsValue(obj); form.setFieldsValue(obj);
} }
......
...@@ -2,10 +2,11 @@ import debounce from 'lodash/debounce'; ...@@ -2,10 +2,11 @@ import debounce from 'lodash/debounce';
import { apiEnterpriseList, apiShopList, apiShopListByPickSelfID } from './index'; import { apiEnterpriseList, apiShopList, apiShopListByPickSelfID } from './index';
// 获取企业列表 // 获取企业列表
export const getEnterpriseList = async () => { export const getEnterpriseList = async (param = {}) => {
const res = await apiEnterpriseList({ const res = await apiEnterpriseList({
page: 1, page: 1,
size: 10000, size: 10000,
data: param,
}); });
if (res && res.data && res.data.records) { if (res && res.data && res.data.records) {
const data = res.data.records; const data = res.data.records;
......
...@@ -136,7 +136,9 @@ const TakeawayGoods = () => { ...@@ -136,7 +136,9 @@ const TakeawayGoods = () => {
// 获取企业列表 // 获取企业列表
const getList = async () => { const getList = async () => {
const obj = await getEnterpriseList(); const obj = await getEnterpriseList({
type: 1,
});
if (obj.list && Object.keys(obj.list).length) { if (obj.list && Object.keys(obj.list).length) {
setEnterprises(obj.list); setEnterprises(obj.list);
setEnterpriseId(`${obj.id}`); setEnterpriseId(`${obj.id}`);
......
...@@ -84,7 +84,9 @@ const VirtualGoods = () => { ...@@ -84,7 +84,9 @@ const VirtualGoods = () => {
// 获取企业列表 // 获取企业列表
const getList = async () => { const getList = async () => {
const obj = await getEnterpriseList(); const obj = await getEnterpriseList({
type: 2,
});
if (obj.list && Object.keys(obj.list).length) { if (obj.list && Object.keys(obj.list).length) {
setEnterprises(obj.list); setEnterprises(obj.list);
setEnterpriseId(`${obj.id}`); setEnterpriseId(`${obj.id}`);
......
...@@ -90,8 +90,11 @@ const VirtualGoodsInfo = props => { ...@@ -90,8 +90,11 @@ const VirtualGoodsInfo = props => {
// 删除 // 删除
const onDel = i => { const onDel = i => {
const arr = [...dataSource]; const arr = [...dataSource];
const keys = [...selectedRowKeys];
arr.splice(i, 1); arr.splice(i, 1);
keys.splice(i, 1);
setDataSource(arr); setDataSource(arr);
setSelectedRowKeys(keys);
}; };
// 根据企业ID获取店铺列表 // 根据企业ID获取店铺列表
......
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