Commit 97be610e authored by 张子雨's avatar 张子雨

feat: 接口联调

parent f6093a53
...@@ -34,6 +34,7 @@ const prodApi = { ...@@ -34,6 +34,7 @@ const prodApi = {
querysApi: 'https://sc-merchant-api.q-gp.com/admin/merchant/sc-settlement', querysApi: 'https://sc-merchant-api.q-gp.com/admin/merchant/sc-settlement',
wsApi: 'wss://push.q-gp.com', wsApi: 'wss://push.q-gp.com',
msgApi: 'https://msgapi.q-gp.com', msgApi: 'https://msgapi.q-gp.com',
keystoneApi: '//sc-op-api.q-gp.com',
apiPrefix, apiPrefix,
}; };
...@@ -48,6 +49,7 @@ const preProdApi = { ...@@ -48,6 +49,7 @@ const preProdApi = {
querysApi: 'https://sc-settlement-api.q-gp.com', querysApi: 'https://sc-settlement-api.q-gp.com',
wsApi: 'wss://push.q-gp.com', wsApi: 'wss://push.q-gp.com',
msgApi: 'https://msgapi.q-gp.com', msgApi: 'https://msgapi.q-gp.com',
keystoneApi: '//sc-op-api-pre.q-gp.com',
apiPrefix, apiPrefix,
}; };
......
...@@ -5,13 +5,13 @@ import { apiStaffBlack } from '../service'; ...@@ -5,13 +5,13 @@ import { apiStaffBlack } from '../service';
const { Item } = Form; const { Item } = Form;
const BlacklistModal = ({ visible, onClose, list, employeeId }) => { const BlacklistModal = ({ visible, onClose, list, enterpriseId }) => {
const [form] = Form.useForm(); const [form] = Form.useForm();
const handleSave = () => { const handleSave = () => {
form.validateFields().then(values => { form.validateFields().then(values => {
const params = { const params = {
employeeId, enterpriseId,
ids: list, ids: list,
isBlack: 1, isBlack: 1,
balanceBackFlag: 1, balanceBackFlag: 1,
...@@ -33,7 +33,7 @@ const BlacklistModal = ({ visible, onClose, list, employeeId }) => { ...@@ -33,7 +33,7 @@ const BlacklistModal = ({ visible, onClose, list, employeeId }) => {
</Item> </Item>
<Item name="reason" label="加入黑名单吗?"> <Item name="reason" label="加入黑名单吗?">
<div className={styles.blackList}> <div className={styles.blackList}>
<Checkbox disabled></Checkbox> <Checkbox defaultChecked disabled></Checkbox>
<div className={styles.left}> <div className={styles.left}>
<span>请确定要回收员工账户内的剩余余额&餐券吗? </span> <span>请确定要回收员工账户内的剩余余额&餐券吗? </span>
<br /> <br />
......
import React, { useState } from 'react'; import React, { useState } from 'react';
import { Modal, Form, Input, Button, Select, message, Upload, Radio } from 'antd'; import { Modal, Form, Input, Button, Select, message, Upload, Radio } from 'antd';
import { UploadOutlined } from '@ant-design/icons'; import { UploadOutlined } from '@ant-design/icons';
import { apiStaffSave, apiStaffExcel } from '../service'; import { apiStaffSave, apiStaffExcel, apiDepartmentList } from '../service';
import styles from '../index.less'; import styles from '../index.less';
const { Dragger } = Upload; const { Dragger } = Upload;
...@@ -12,10 +12,10 @@ const layout = { ...@@ -12,10 +12,10 @@ const layout = {
wrapperCol: { span: 16 }, wrapperCol: { span: 16 },
}; };
const NewEmployeeModal = props => { const NewEmployeeModal = props => {
const { departmentList, visible, onClose, enterpriseList, getDepartmentList } = props; const { visible, onClose, enterpriseList } = props;
const [form] = Form.useForm(); const [form] = Form.useForm();
const [loading, setLoading] = useState(false);
const [importMode, setImportMode] = useState(false); const [importMode, setImportMode] = useState(false);
const [departmentList, setDepartmentList] = useState([]);
const handleCancel = val => { const handleCancel = val => {
form.resetFields(); form.resetFields();
setImportMode(false); setImportMode(false);
...@@ -23,7 +23,6 @@ const NewEmployeeModal = props => { ...@@ -23,7 +23,6 @@ const NewEmployeeModal = props => {
}; };
const handleSave = () => { const handleSave = () => {
form.validateFields().then(async values => { form.validateFields().then(async values => {
setLoading(true);
if (importMode) { if (importMode) {
const res = await apiStaffExcel(values); const res = await apiStaffExcel(values);
if (res.businessCode === '0000') { if (res.businessCode === '0000') {
...@@ -34,7 +33,6 @@ const NewEmployeeModal = props => { ...@@ -34,7 +33,6 @@ const NewEmployeeModal = props => {
} }
const res = await apiStaffSave(values); const res = await apiStaffSave(values);
if (res.businessCode === '0000') { if (res.businessCode === '0000') {
setLoading(false);
message.success('保存成功'); message.success('保存成功');
handleCancel(true); handleCancel(true);
} }
...@@ -51,6 +49,20 @@ const NewEmployeeModal = props => { ...@@ -51,6 +49,20 @@ const NewEmployeeModal = props => {
return Promise.reject('请输入有效的手机号码'); return Promise.reject('请输入有效的手机号码');
}; };
// 部门查询
const getDepartmentList = async id => {
const res = await apiDepartmentList({ data: { enterpriseId: id }, page: 1, size: 10000 });
if (res.businessCode === '0000' && res.data?.records?.length) {
const list = res.data.records;
const optionData = list.map(item => ({
value: item.id,
label: item.name,
}));
setDepartmentList(optionData);
return;
}
setDepartmentList([]);
};
const onChange = value => { const onChange = value => {
getDepartmentList(value); getDepartmentList(value);
}; };
...@@ -63,7 +75,7 @@ const NewEmployeeModal = props => { ...@@ -63,7 +75,7 @@ const NewEmployeeModal = props => {
<Button key="cancel" onClick={onClose}> <Button key="cancel" onClick={onClose}>
取消 取消
</Button>, </Button>,
<Button key="save" type="primary" loading={loading} onClick={handleSave}> <Button key="save" type="primary" onClick={handleSave}>
保存 保存
</Button>, </Button>,
]} ]}
...@@ -141,7 +153,6 @@ const NewEmployeeModal = props => { ...@@ -141,7 +153,6 @@ const NewEmployeeModal = props => {
</> </>
) : ( ) : (
<> <>
{' '}
<Form.Item <Form.Item
name="departmentId" name="departmentId"
label="部门" label="部门"
......
import React, { useState } from 'react'; import React, { useEffect, useState } from 'react';
import { Modal, Form, Input, Button, Table, Space, Row, Col, Select, message } from 'antd'; import { Modal, Form, Input, Button, Table, Space, Row, Col, Select, message } from 'antd';
import { apiDepartmentList, apiDepartmentUpdate } from '../service'; import { apiDepartmentList, apiDepartmentUpdate } from '../service';
...@@ -9,47 +9,45 @@ const ViewDepartmentModal = ({ visible, onClose, enterpriseList }) => { ...@@ -9,47 +9,45 @@ const ViewDepartmentModal = ({ visible, onClose, enterpriseList }) => {
const [refForm] = Form.useForm(); const [refForm] = Form.useForm();
const [dataSource, setDataSource] = useState([]); const [dataSource, setDataSource] = useState([]);
const [nameVisible, setNameVisible] = useState(false); const [nameVisible, setNameVisible] = useState(false);
const [value, setValue] = useState(''); const [enterpriseId, setEnterpriseId] = useState('');
const [name, setName] = useState(''); const [name, setName] = useState('');
const [id, setId] = useState(''); const [id, setId] = useState('');
const [pagination, setPagination] = useState({ const [total, setTotal] = useState(0);
const [pageInfo, setPageInfo] = useState({
page: 1, page: 1,
size: 10, size: 10,
}); });
const handleCancel = () => { const handleCancel = () => {
form.resetFields(); form.resetFields();
setDataSource([]);
setPageInfo({ page: 1, size: 10 });
setTotal(0);
onClose(); onClose();
}; };
const editName = row => { const editName = row => {
setName(row.department); setName(row.name);
setId(row.id); setId(row.id);
setNameVisible(true); setNameVisible(true);
}; };
const getDepartmentList = async params => {
const handleSearch = async values => { const res = await apiDepartmentList(params);
setPagination({ ...pagination, page: 1 }); if (res.businessCode === '0000') {
setValue(value);
const res = await apiDepartmentList({ value, ...pagination });
if (res.businessCode === '0000' && res.data?.records?.length) {
const list = res.data.records; const list = res.data.records;
const optionData = list.map(item => ({ setTotal(res.data.total);
value: item.id, setDataSource(list);
label: item.name,
}));
setDataSource(optionData);
} }
}; };
const handleTableChange = (pag, filters, sorter) => { const handleSearch = async values => {
setPagination(pag); setEnterpriseId(values.enterpriseId);
handleSearch(); getDepartmentList({ data: { enterpriseId: values.enterpriseId }, ...pageInfo });
}; };
const handleSave = () => { const handleSave = () => {
form.validateFields().then(async values => { refForm.validateFields().then(async values => {
const params = { const params = {
enterpriseId: form.id, enterpriseId,
id, id,
name: values.name, name: values.name,
}; };
...@@ -57,7 +55,7 @@ const ViewDepartmentModal = ({ visible, onClose, enterpriseList }) => { ...@@ -57,7 +55,7 @@ const ViewDepartmentModal = ({ visible, onClose, enterpriseList }) => {
if (res.businessCode === '0000') { if (res.businessCode === '0000') {
message.success('修改成功'); message.success('修改成功');
setNameVisible(false); setNameVisible(false);
handleSearch(); getDepartmentList({ data: { enterpriseId: values.enterpriseId }, ...pageInfo });
} }
}); });
}; };
...@@ -69,18 +67,18 @@ const ViewDepartmentModal = ({ visible, onClose, enterpriseList }) => { ...@@ -69,18 +67,18 @@ const ViewDepartmentModal = ({ visible, onClose, enterpriseList }) => {
}, },
{ {
title: '部门', title: '部门',
dataIndex: 'department', dataIndex: 'name',
key: 'department', key: 'name',
}, },
{ {
title: '创建时间', title: '创建时间',
dataIndex: 'createTime', dataIndex: 'createdAt',
key: 'createTime', key: 'createdAt',
}, },
{ {
title: '创建人', title: '创建人',
dataIndex: 'creator', dataIndex: 'createdBy',
key: 'creator', key: 'createdBy',
}, },
{ {
title: '操作', title: '操作',
...@@ -88,20 +86,39 @@ const ViewDepartmentModal = ({ visible, onClose, enterpriseList }) => { ...@@ -88,20 +86,39 @@ const ViewDepartmentModal = ({ visible, onClose, enterpriseList }) => {
key: 'operation', key: 'operation',
render: (_, record) => ( render: (_, record) => (
<Space> <Space>
<Button type="link" onClick={editName(record)}> <Button type="link" onClick={() => editName(record)}>
修改部门名称 修改部门名称
</Button> </Button>
</Space> </Space>
), ),
}, },
]; ];
const onCancel = () => {
setNameVisible(false);
setName('');
};
const onChange = (page, size) => {
const json = {
page,
size,
};
setPageInfo(json);
getDepartmentList({ data: { enterpriseId }, ...json });
};
const pagination = {
...pageInfo,
total,
showTotal: t => `共 ${t} 项数据`,
onChange,
onShowSizeChange: onChange,
};
return ( return (
<Modal visible={visible} onCancel={handleCancel} width={800} footer={null} title="查看部门"> <Modal visible={visible} onCancel={handleCancel} width={800} footer={null} title="查看部门">
<Form form={form} onFinish={handleSearch}> <Form form={form} onFinish={handleSearch}>
<Row gutter={16}> <Row gutter={16}>
<Col span={10}> <Col span={10}>
<Item name="id" style={{ width: '300px' }}> <Item name="enterpriseId" style={{ width: '300px' }}>
<Select <Select
placeholder="请选择企业" placeholder="请选择企业"
allowClear allowClear
...@@ -125,25 +142,28 @@ const ViewDepartmentModal = ({ visible, onClose, enterpriseList }) => { ...@@ -125,25 +142,28 @@ const ViewDepartmentModal = ({ visible, onClose, enterpriseList }) => {
<Table <Table
dataSource={dataSource} dataSource={dataSource}
columns={columns} columns={columns}
pagination={pagination}
onChange={handleTableChange}
bordered bordered
rowKey={r => r.id}
pagination={pagination}
/> />
<Modal <Modal
title="修改部门名称" title="修改部门名称"
visible={nameVisible} visible={nameVisible}
footer={[ footer={[
<Button key="cancel">取消</Button>, <Button key="cancel" onClick={onCancel}>
取消
</Button>,
<Button key="save" type="primary" onClick={() => handleSave()}> <Button key="save" type="primary" onClick={() => handleSave()}>
保存 保存
</Button>, </Button>,
]} ]}
onCancel={onCancel}
> >
<Form form={refForm}> <Form form={refForm}>
<Form.Item <Form.Item
label="部门名称" label="部门名称"
name="name" name="name"
initialValues={name} initialValue={name}
rules={[{ required: true, message: '请填写部门名称' }]} rules={[{ required: true, message: '请填写部门名称' }]}
> >
<Input /> <Input />
......
...@@ -51,14 +51,11 @@ export const columns = props => [ ...@@ -51,14 +51,11 @@ export const columns = props => [
key: 'isLimit', key: 'isLimit',
dataIndex: 'isLimit', dataIndex: 'isLimit',
align: 'center', align: 'center',
width: '150px',
render: (_, row) => ( render: (_, row) => (
<> <>
<Switch <Switch defaultChecked={row?.isLimit} onChange={val => props.handleLimitChange(val, row)} />
checkedChildren="限额" &nbsp;<span>{row?.isLimit ? '已开启' : '已关闭'}</span>
unCheckedChildren="不限额"
defaultChecked={row?.isLimit}
onChange={val => props.handleLimitChange(val, row)}
/>
</> </>
), ),
}, },
......
...@@ -54,33 +54,10 @@ const StoreManagement = () => { ...@@ -54,33 +54,10 @@ const StoreManagement = () => {
const [addVisible, setAddVisible] = useState(false); const [addVisible, setAddVisible] = useState(false);
const [repastType, setRepastType] = useState([]); const [repastType, setRepastType] = useState([]);
const [repastId, setRepastId] = useState(null); const [repastId, setRepastId] = useState(null);
const data = [
{
enterpriseId: '企业id',
id: '1',
shopId: 'shopId',
shopName: '店铺名称',
mealType: '到店',
pickselfName: '',
updatedBy: '修改人名称',
amount: '2023/03/21 14:06:11',
isBlack: 0,
},
{
enterpriseId: '企业id',
id: '2',
shopId: 'shopId',
shopName: '店铺名称',
mealType: '到店',
pickselfName: '取餐点',
updatedBy: '修改人名称',
isBlack: 1,
},
];
const shopList = async () => { const shopList = async () => {
const res = await apiStaffList({ ...page, data: searchForm }); const res = await apiStaffList({ ...page, data: searchForm });
if (res.businessCode === '0000' && res.data?.records?.length) { if (res.businessCode === '0000' && res.data?.records) {
const list = res.data.records; const list = res.data.records;
setStaffList(list); setStaffList(list);
} }
...@@ -92,21 +69,9 @@ const StoreManagement = () => { ...@@ -92,21 +69,9 @@ const StoreManagement = () => {
disabled: record.isBlack === 1, disabled: record.isBlack === 1,
}), }),
}; };
// 关闭弹框
const handleCloseModal = val => {
setModalVisible(false);
setDepartmentVisible(false);
setViewDepartmentVisible(false);
setBlacklistVisible(false);
setRechargeDetailsVisible(false);
if (val) {
shopList();
}
};
// 部门查询 // 部门查询
const getDepartmentList = async id => { const getDepartmentList = async id => {
const res = await apiDepartmentList({ id, page: 1, size: 10000 }); const res = await apiDepartmentList({ data: { enterpriseId: id }, page: 1, size: 10000 });
if (res.businessCode === '0000' && res.data?.records?.length) { if (res.businessCode === '0000' && res.data?.records?.length) {
const list = res.data.records; const list = res.data.records;
const optionData = list.map(item => ({ const optionData = list.map(item => ({
...@@ -118,6 +83,20 @@ const StoreManagement = () => { ...@@ -118,6 +83,20 @@ const StoreManagement = () => {
} }
setDepartmentList([]); setDepartmentList([]);
}; };
// 关闭弹框
const handleCloseModal = val => {
setModalVisible(false);
setDepartmentVisible(false);
setViewDepartmentVisible(false);
setBlacklistVisible(false);
setRechargeDetailsVisible(false);
if (val) {
getDepartmentList(searchForm.enterpriseId);
shopList();
setSelectedRowKeys([]);
}
};
// 企业查询 // 企业查询
const getEnterpriseList = async () => { const getEnterpriseList = async () => {
const res = await apiEnterpriseList(); const res = await apiEnterpriseList();
...@@ -128,10 +107,10 @@ const StoreManagement = () => { ...@@ -128,10 +107,10 @@ const StoreManagement = () => {
value: item.id, value: item.id,
label: item.name, label: item.name,
})); }));
setFirstEnterprise(firstOption);
setEnterpriseList(optionData); setEnterpriseList(optionData);
setFirstEnterprise(firstOption);
getDepartmentList(firstOption); getDepartmentList(firstOption);
shopList(); setSearchForm({ enterpriseId: firstOption });
} }
}; };
// 设置黑名单 // 设置黑名单
...@@ -145,10 +124,14 @@ const StoreManagement = () => { ...@@ -145,10 +124,14 @@ const StoreManagement = () => {
useEffect(() => { useEffect(() => {
getEnterpriseList(); getEnterpriseList();
}, []); }, []);
useEffect(() => {
if (searchForm.enterpriseId) {
shopList();
}
}, [searchForm, page]);
// 删除 // 删除
const deleteEmployee = async id => { const deleteEmployee = async id => {
const res = await apiStaffDelete({ id }); const res = await apiStaffDelete({ id, enterpriseId: searchForm.enterpriseId, state: 0 });
if (res.businessCode === '0000') { if (res.businessCode === '0000') {
message.success('删除成功!'); message.success('删除成功!');
shopList(); shopList();
...@@ -175,12 +158,11 @@ const StoreManagement = () => { ...@@ -175,12 +158,11 @@ const StoreManagement = () => {
const onFinish = values => { const onFinish = values => {
setSearchForm(values); setSearchForm(values);
setPage({ current: 1, pageSize: 10 }); setPage({ current: 1, pageSize: 10 });
shopList();
}; };
// 重置 // 重置
const onReset = () => { const onReset = () => {
formRef.current.resetFields(); formRef.current.resetFields();
shopList(); setSearchForm({ enterpriseId: firstEnterprise });
}; };
// 分页 // 分页
const handleTableChange = val => { const handleTableChange = val => {
...@@ -196,14 +178,18 @@ const StoreManagement = () => { ...@@ -196,14 +178,18 @@ const StoreManagement = () => {
}; };
const handleLimitChange = async (checked, row) => { const handleLimitChange = async (checked, row) => {
const res = await apiStaffLimit({ const res = await apiStaffLimit({
id: row, id: row.id,
isLimit: checked ? 1 : 0, isLimit: checked ? 1 : 0,
enterpriseId: searchForm.enterpriseId, enterpriseId: searchForm.enterpriseId,
}); });
if (res.businessCode === '0000') { if (res.businessCode === '0000') {
message.success('设置成功'); message.success('设置成功');
shopList();
} }
}; };
const enterpriseOnChange = val => {
getDepartmentList(val);
};
const res = { const res = {
delEmployee, delEmployee,
goDetails, goDetails,
...@@ -212,7 +198,8 @@ const StoreManagement = () => { ...@@ -212,7 +198,8 @@ const StoreManagement = () => {
return ( return (
<PageHeaderWrapper> <PageHeaderWrapper>
<Card className={styles.card}> <Card className={styles.card}>
<Form ref={formRef} onFinish={onFinish} initialValue={{ enterpriseId: firstEnterprise }}> {firstEnterprise && (
<Form ref={formRef} onFinish={onFinish}>
<Row gutter={24}> <Row gutter={24}>
<Col span={8}> <Col span={8}>
<Form.Item <Form.Item
...@@ -220,6 +207,7 @@ const StoreManagement = () => { ...@@ -220,6 +207,7 @@ const StoreManagement = () => {
name="enterpriseId" name="enterpriseId"
wrapperCol={{ span: 16 }} wrapperCol={{ span: 16 }}
rules={[{ required: true }]} rules={[{ required: true }]}
initialValue={firstEnterprise}
> >
<Select <Select
allowClear allowClear
...@@ -228,6 +216,7 @@ const StoreManagement = () => { ...@@ -228,6 +216,7 @@ const StoreManagement = () => {
(option?.label ?? '').toLowerCase().includes(input.toLowerCase()) (option?.label ?? '').toLowerCase().includes(input.toLowerCase())
} }
options={enterpriseList} options={enterpriseList}
onChange={enterpriseOnChange}
/> />
</Form.Item> </Form.Item>
</Col> </Col>
...@@ -255,7 +244,7 @@ const StoreManagement = () => { ...@@ -255,7 +244,7 @@ const StoreManagement = () => {
</Form.Item> </Form.Item>
</Col> </Col>
<Col span={8}> <Col span={8}>
<Form.Item label="员工状态" name="mealType" wrapperCol={{ span: 16 }}> <Form.Item label="员工状态" name="isBlack" wrapperCol={{ span: 16 }}>
<Select <Select
allowClear allowClear
showSearch showSearch
...@@ -293,6 +282,8 @@ const StoreManagement = () => { ...@@ -293,6 +282,8 @@ const StoreManagement = () => {
</Col> </Col>
</Row> </Row>
</Form> </Form>
)}
<div className={styles.addBtn}> <div className={styles.addBtn}>
<Button type="primary" className={styles.left} onClick={getBlacklist}> <Button type="primary" className={styles.left} onClick={getBlacklist}>
设置员工黑名单 设置员工黑名单
...@@ -337,7 +328,6 @@ const StoreManagement = () => { ...@@ -337,7 +328,6 @@ const StoreManagement = () => {
<NewEmployeeModal <NewEmployeeModal
visible={modalVisible} visible={modalVisible}
enterpriseList={enterpriseList} enterpriseList={enterpriseList}
departmentList={departmentList}
onClose={handleCloseModal} onClose={handleCloseModal}
getDepartmentList={getDepartmentList} getDepartmentList={getDepartmentList}
/> />
...@@ -355,7 +345,7 @@ const StoreManagement = () => { ...@@ -355,7 +345,7 @@ const StoreManagement = () => {
list={selectedRowKeys} list={selectedRowKeys}
visible={blacklistVisible} visible={blacklistVisible}
onClose={handleCloseModal} onClose={handleCloseModal}
employeeId={searchForm.enterpriseId} enterpriseId={searchForm.enterpriseId}
/> />
<RechargeDetailsModal <RechargeDetailsModal
visible={rechargeDetailsVisible} visible={rechargeDetailsVisible}
......
...@@ -9,7 +9,7 @@ const { goodsApi, apiPrefix, keystoneApi } = config; ...@@ -9,7 +9,7 @@ const { goodsApi, apiPrefix, keystoneApi } = config;
// http://yapi.quantgroups.com/project/389/interface/api/65359 // http://yapi.quantgroups.com/project/389/interface/api/65359
export const apiStaffList = async params => { export const apiStaffList = async params => {
const data = await request.post(`${apiPrefix}/enterprise/staff/pageList`, { const data = await request.post(`${apiPrefix}/enterprise/staff/pageList`, {
prefix: goodsApi, prefix: keystoneApi,
data: params, data: params,
}); });
return data; return data;
...@@ -32,7 +32,7 @@ export const apiEnterpriseList = async () => { ...@@ -32,7 +32,7 @@ export const apiEnterpriseList = async () => {
// http://yapi.quantgroups.com/project/389/interface/api/65344 // http://yapi.quantgroups.com/project/389/interface/api/65344
export const apiDepartmentList = async params => { export const apiDepartmentList = async params => {
const data = await request.post(`${apiPrefix}/enterprise/department/pageList`, { const data = await request.post(`${apiPrefix}/enterprise/department/pageList`, {
prefix: goodsApi, prefix: keystoneApi,
data: params, data: params,
}); });
return data; return data;
...@@ -42,7 +42,7 @@ export const apiDepartmentList = async params => { ...@@ -42,7 +42,7 @@ export const apiDepartmentList = async params => {
// http://yapi.quantgroups.com/project/389/interface/api/65364 // http://yapi.quantgroups.com/project/389/interface/api/65364
export const apiStaffSave = async params => { export const apiStaffSave = async params => {
const data = await request.post(`${apiPrefix}/enterprise/staff/save`, { const data = await request.post(`${apiPrefix}/enterprise/staff/save`, {
prefix: goodsApi, prefix: keystoneApi,
data: params, data: params,
}); });
return data; return data;
...@@ -51,11 +51,12 @@ export const apiStaffSave = async params => { ...@@ -51,11 +51,12 @@ export const apiStaffSave = async params => {
// [企业员工]-导入员工 // [企业员工]-导入员工
// http://yapi.quantgroups.com/project/389/interface/api/65384 // http://yapi.quantgroups.com/project/389/interface/api/65384
export const apiStaffExcel = async file => { export const apiStaffExcel = async file => {
console.log(file);
const params = new FormData(); const params = new FormData();
params.append('file', file.file); params.append('file', file.file.file);
params.append('enterpriseId', file.enterpriseId); params.append('enterpriseId', file.enterpriseId);
const data = await request.post(`${apiPrefix}/enterprise/staff/excel`, { const data = await request.post(`${apiPrefix}/enterprise/staff/excel`, {
prefix: goodsApi, prefix: keystoneApi,
data: params, data: params,
}); });
return data; return data;
...@@ -65,7 +66,7 @@ export const apiStaffExcel = async file => { ...@@ -65,7 +66,7 @@ export const apiStaffExcel = async file => {
// http://yapi.quantgroups.com/project/389/interface/api/65349 // http://yapi.quantgroups.com/project/389/interface/api/65349
export const apiDepartmentSave = async params => { export const apiDepartmentSave = async params => {
const data = await request.post(`${apiPrefix}/enterprise/department/save`, { const data = await request.post(`${apiPrefix}/enterprise/department/save`, {
prefix: goodsApi, prefix: keystoneApi,
data: params, data: params,
}); });
return data; return data;
...@@ -75,10 +76,10 @@ export const apiDepartmentSave = async params => { ...@@ -75,10 +76,10 @@ export const apiDepartmentSave = async params => {
// http://yapi.quantgroups.com/project/389/interface/api/65354 // http://yapi.quantgroups.com/project/389/interface/api/65354
export const apiDepartmentExcel = async file => { export const apiDepartmentExcel = async file => {
const params = new FormData(); const params = new FormData();
params.append('file', file.file); params.append('file', file.file.file);
params.append('enterpriseId', file.enterpriseId); params.append('enterpriseId', file.enterpriseId);
const data = await request.post(`${apiPrefix}/enterprise/department/excel`, { const data = await request.post(`${apiPrefix}/enterprise/department/excel`, {
prefix: goodsApi, prefix: keystoneApi,
data: params, data: params,
}); });
return data; return data;
...@@ -88,7 +89,7 @@ export const apiDepartmentExcel = async file => { ...@@ -88,7 +89,7 @@ export const apiDepartmentExcel = async file => {
// http://yapi.quantgroups.com/project/389/interface/api/65374 // http://yapi.quantgroups.com/project/389/interface/api/65374
export const apiStaffDelete = async params => { export const apiStaffDelete = async params => {
const data = await request.post(`${apiPrefix}/enterprise/staff/delete`, { const data = await request.post(`${apiPrefix}/enterprise/staff/delete`, {
prefix: goodsApi, prefix: keystoneApi,
data: params, data: params,
}); });
return data; return data;
...@@ -98,7 +99,7 @@ export const apiStaffDelete = async params => { ...@@ -98,7 +99,7 @@ export const apiStaffDelete = async params => {
// http://yapi.quantgroups.com/project/389/interface/api/65474 // http://yapi.quantgroups.com/project/389/interface/api/65474
export const apiDepartmentUpdate = async params => { export const apiDepartmentUpdate = async params => {
const data = await request.post(`${apiPrefix}/enterprise/department/update`, { const data = await request.post(`${apiPrefix}/enterprise/department/update`, {
prefix: goodsApi, prefix: keystoneApi,
data: params, data: params,
}); });
return data; return data;
...@@ -108,7 +109,7 @@ export const apiDepartmentUpdate = async params => { ...@@ -108,7 +109,7 @@ export const apiDepartmentUpdate = async params => {
// http://yapi.quantgroups.com/project/389/interface/api/65489 // http://yapi.quantgroups.com/project/389/interface/api/65489
export const apiGenerateLogList = async params => { export const apiGenerateLogList = async params => {
const data = await request.get(`${apiPrefix}/enterprise/staff/generateLog/list`, { const data = await request.get(`${apiPrefix}/enterprise/staff/generateLog/list`, {
prefix: goodsApi, prefix: keystoneApi,
params, params,
}); });
return data; return data;
...@@ -118,7 +119,7 @@ export const apiGenerateLogList = async params => { ...@@ -118,7 +119,7 @@ export const apiGenerateLogList = async params => {
// http://yapi.quantgroups.com/project/389/interface/api/65379 // http://yapi.quantgroups.com/project/389/interface/api/65379
export const apiStaffLimit = async params => { export const apiStaffLimit = async params => {
const data = await request.post(`${apiPrefix}/enterprise/staff/limit`, { const data = await request.post(`${apiPrefix}/enterprise/staff/limit`, {
prefix: goodsApi, prefix: keystoneApi,
data: params, data: params,
}); });
return data; return data;
...@@ -128,7 +129,7 @@ export const apiStaffLimit = async params => { ...@@ -128,7 +129,7 @@ export const apiStaffLimit = async params => {
// http://yapi.quantgroups.com/project/389/interface/api/65369 // http://yapi.quantgroups.com/project/389/interface/api/65369
export const apiStaffBlack = async params => { export const apiStaffBlack = async params => {
const data = await request.post(`${apiPrefix}/enterprise/staff/black`, { const data = await request.post(`${apiPrefix}/enterprise/staff/black`, {
prefix: goodsApi, prefix: keystoneApi,
data: params, data: params,
}); });
return data; return data;
......
...@@ -4,11 +4,12 @@ import { stringify } from 'qs'; ...@@ -4,11 +4,12 @@ import { stringify } from 'qs';
import _ from 'lodash'; import _ from 'lodash';
const { goodsApi, apiPrefix, keystoneApi } = config; const { goodsApi, apiPrefix, keystoneApi } = config;
console.log(apiPrefix, 'apiPrefix');
// [企业店铺]-列表查询 // [企业店铺]-列表查询
// http://yapi.quantgroups.com/project/389/interface/api/65284 // http://yapi.quantgroups.com/project/389/interface/api/65284
export const setShopList = async params => { export const setShopList = async params => {
const data = await request.post(`${apiPrefix}/enterprise/shop/list`, { const data = await request.post(`${apiPrefix}/enterprise/shop/list`, {
prefix: goodsApi, prefix: keystoneApi,
data: params, data: params,
}); });
return data; return data;
...@@ -18,7 +19,7 @@ export const setShopList = async params => { ...@@ -18,7 +19,7 @@ export const setShopList = async params => {
// http://yapi.quantgroups.com/project/389/interface/api/65319 // http://yapi.quantgroups.com/project/389/interface/api/65319
export const setShopDelete = async params => { export const setShopDelete = async params => {
const data = await request.post(`${apiPrefix}/enterprise/shop/delete`, { const data = await request.post(`${apiPrefix}/enterprise/shop/delete`, {
prefix: goodsApi, prefix: keystoneApi,
data: params, data: params,
}); });
return data; return data;
...@@ -28,7 +29,7 @@ export const setShopDelete = async params => { ...@@ -28,7 +29,7 @@ export const setShopDelete = async params => {
// http://yapi.quantgroups.com/project/389/interface/api/65314 // http://yapi.quantgroups.com/project/389/interface/api/65314
export const mealTypeList = async params => { export const mealTypeList = async params => {
const data = await request.post(`${apiPrefix}/enterprise/shop/mealType/list`, { const data = await request.post(`${apiPrefix}/enterprise/shop/mealType/list`, {
prefix: goodsApi, prefix: keystoneApi,
data: params, data: params,
}); });
return data; return data;
...@@ -38,7 +39,7 @@ export const mealTypeList = async params => { ...@@ -38,7 +39,7 @@ export const mealTypeList = async params => {
// http://yapi.quantgroups.com/project/389/interface/api/65304 // http://yapi.quantgroups.com/project/389/interface/api/65304
export const shopAdd = async params => { export const shopAdd = async params => {
const data = await request.post(`${apiPrefix}/enterprise/shop/add`, { const data = await request.post(`${apiPrefix}/enterprise/shop/add`, {
prefix: goodsApi, prefix: keystoneApi,
data: params, data: params,
}); });
return data; return data;
...@@ -48,7 +49,7 @@ export const shopAdd = async params => { ...@@ -48,7 +49,7 @@ export const shopAdd = async params => {
// http://yapi.quantgroups.com/project/389/interface/api/65309 // http://yapi.quantgroups.com/project/389/interface/api/65309
export const apiShopUpdate = async params => { export const apiShopUpdate = async params => {
const data = await request.post(`${apiPrefix}/enterprise/shop/update`, { const data = await request.post(`${apiPrefix}/enterprise/shop/update`, {
prefix: goodsApi, prefix: keystoneApi,
data: params, data: params,
}); });
return data; return data;
...@@ -70,7 +71,7 @@ export const apiEnterpriseList = async () => { ...@@ -70,7 +71,7 @@ export const apiEnterpriseList = async () => {
// http://yapi.quantgroups.com/project/389/interface/api/65524 // http://yapi.quantgroups.com/project/389/interface/api/65524
export const apiSelectList = async params => { export const apiSelectList = async params => {
const data = await request.post(`${apiPrefix}/enterprise/shop/select/list`, { const data = await request.post(`${apiPrefix}/enterprise/shop/select/list`, {
prefix: goodsApi, prefix: keystoneApi,
data: params, data: params,
}); });
return data; return data;
...@@ -80,7 +81,7 @@ export const apiSelectList = async params => { ...@@ -80,7 +81,7 @@ export const apiSelectList = async params => {
// http://yapi.quantgroups.com/project/389/interface/api/65304 // http://yapi.quantgroups.com/project/389/interface/api/65304
export const busineesTypeCheck = async params => { export const busineesTypeCheck = async params => {
const data = await request.post(`${apiPrefix}/enterprise/shop/busineesType/check`, { const data = await request.post(`${apiPrefix}/enterprise/shop/busineesType/check`, {
prefix: goodsApi, prefix: keystoneApi,
data: params, data: params,
}); });
return data; return data;
...@@ -90,7 +91,7 @@ export const busineesTypeCheck = async params => { ...@@ -90,7 +91,7 @@ export const busineesTypeCheck = async params => {
// http://yapi.quantgroups.com/project/389/interface/api/65304 // http://yapi.quantgroups.com/project/389/interface/api/65304
export const apiShopAdd = async params => { export const apiShopAdd = async params => {
const data = await request.post(`${apiPrefix}/enterprise/shop/add`, { const data = await request.post(`${apiPrefix}/enterprise/shop/add`, {
prefix: goodsApi, prefix: keystoneApi,
data: params, data: params,
}); });
return data; return data;
...@@ -100,7 +101,7 @@ export const apiShopAdd = async params => { ...@@ -100,7 +101,7 @@ export const apiShopAdd = async params => {
// http://yapi.quantgroups.com/project/389/interface/api/65534 // http://yapi.quantgroups.com/project/389/interface/api/65534
export const apiSelectedList = async params => { export const apiSelectedList = async params => {
const data = await request.post(`${apiPrefix}/enterprise/shop/selected/list`, { const data = await request.post(`${apiPrefix}/enterprise/shop/selected/list`, {
prefix: goodsApi, prefix: keystoneApi,
data: params, data: params,
}); });
return data; return data;
......
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