Commit 0f7c1776 authored by 张子雨's avatar 张子雨

feat: 接口联调

parent a07ded6e
...@@ -39,6 +39,10 @@ export const businessModel = [ ...@@ -39,6 +39,10 @@ export const businessModel = [
{ label: '到店业务(服务类业务)', value: 3 }, { label: '到店业务(服务类业务)', value: 3 },
]; ];
export const signDateTypeList = [{ label: '自商品售卖起默认一年', value: 1 }];
export const legalPersonList = [{ label: '长期', value: '长期' }];
// 获取申请信息 // 获取申请信息
export async function getInfo() { export async function getInfo() {
const data = await apiBusinessDetail(); const data = await apiBusinessDetail();
...@@ -49,6 +53,7 @@ export async function getInfo() { ...@@ -49,6 +53,7 @@ export async function getInfo() {
res.customList = res.facilities.customList || []; res.customList = res.facilities.customList || [];
res.selfList = res.facilities.selfList || []; res.selfList = res.facilities.selfList || [];
} }
res.signDateType = [res.signDateType] || [];
res.accountOpenPermitImage = res.accountOpenPermitImage res.accountOpenPermitImage = res.accountOpenPermitImage
? [{ uid: 0, url: res.accountOpenPermitImage }] ? [{ uid: 0, url: res.accountOpenPermitImage }]
: []; : [];
...@@ -87,18 +92,28 @@ export async function getInfo() { ...@@ -87,18 +92,28 @@ export async function getInfo() {
} }
settlementType = +res.settlementType; settlementType = +res.settlementType;
} }
res.checked = res.legalPersonPeriod === '长期'; // 身份证有效期处理
res.legalPerson = const date = res.legalPersonPeriod.split('-') || [];
res.legalPersonPeriod && res.legalPersonStart = date[0] && moment(date[0]);
res.legalPersonPeriod !== '长期' && res.legalPersonEnd = date[1] && date[1] !== '长期' ? moment(date[1]) : '';
res.legalPersonPeriod.split('-').map(item => moment(item)); res.checked = date[1] && date[1] === '长期' ? ['长期'] : [];
const checkboxDisabled = date[1] && date[1] === '长期';
res.businessLicensePeriod = res.businessLicensePeriod && moment(res.businessLicensePeriod); res.businessLicensePeriod = res.businessLicensePeriod && moment(res.businessLicensePeriod);
const companyNamedis = !!res.companyName; const companyNamedis = !!res.companyName;
// 获取主营类目
let categoryList = [];
if (res.productBusiness.length) {
const dataList = await apiCategoryList(res.productBusiness);
categoryList = dataList.data;
}
this.setState({ this.setState({
settlementType, settlementType,
businessInfo: res, businessInfo: res,
checkboxDisabled: res.checked, checkboxDisabled,
companyNamedis, companyNamedis,
categoryList,
mainCategoryId: res.mainCategoryId,
}); });
} }
......
This diff is collapsed.
...@@ -55,6 +55,10 @@ ...@@ -55,6 +55,10 @@
} }
.formBtns { .formBtns {
display: flex;
align-items: center;
justify-content: space-evenly;
width: 100%;
padding: 20px 0; padding: 20px 0;
background-color: #fff; background-color: #fff;
} }
...@@ -24,3 +24,6 @@ export const businessModel = [ ...@@ -24,3 +24,6 @@ export const businessModel = [
{ label: '实物商品业务员', value: 2 }, { label: '实物商品业务员', value: 2 },
{ label: '到店业务(服务类业务)', value: 3 }, { label: '到店业务(服务类业务)', value: 3 },
]; ];
// 营业日
export const businessStatus = [{ label: '停业', value: 2 }, { label: '营业中', value: 1 }];
...@@ -10,14 +10,16 @@ import { ...@@ -10,14 +10,16 @@ import {
Table, Table,
Pagination, Pagination,
Modal, Modal,
Select,
} from 'antd'; } from 'antd';
import _ from 'lodash'; import _ from 'lodash';
import { el } from 'date-fns/locale'; import { el } from 'date-fns/locale';
import { searchList, apiEnableStore, apiAddrArea, apiproductBusiness } from './services'; import { searchList, apiEnableStore, apiAddrArea, apiproductBusiness } from './services';
import { stateDesc, weeks, layout } from './data'; import { stateDesc, weeks, layout, businessStatus, businessModel } from './data';
import StoreModal from './components/storeModal'; import StoreModal from './components/storeModal';
import style from './style.less'; import style from './style.less';
const { Option } = Select;
const { confirm } = Modal; const { confirm } = Modal;
export default () => { export default () => {
const [visible, setVisible] = useState(false); const [visible, setVisible] = useState(false);
...@@ -117,6 +119,10 @@ export default () => { ...@@ -117,6 +119,10 @@ export default () => {
params[ids[i]] = item; params[ids[i]] = item;
}); });
} }
if (val.businessStatus) {
params.businessStatus = val.businessStatus;
}
getList(params); getList(params);
}; };
const closeModal = isReload => { const closeModal = isReload => {
...@@ -205,74 +211,60 @@ export default () => { ...@@ -205,74 +211,60 @@ export default () => {
const columns = [ const columns = [
{ {
title: '门店名称', title: '业务模式',
dataIndex: 'name', dataIndex: 'productBusiness',
width: 120, width: 120,
align: 'center',
render: v => {
let str = '';
v.forEach(it => {
businessModel.forEach(item => {
if (+it === +item.value) {
str += `${item.label}`;
}
});
});
return str;
},
}, },
{ {
title: '门店电话', title: '门店名称',
dataIndex: 'phone', dataIndex: 'name',
hideInSearch: true,
width: 120, width: 120,
align: 'center',
}, },
{ {
title: '营业时间', title: '营业状态',
dataIndex: 'businessHours', dataIndex: 'businessStatus',
hideInSearch: true, width: 80,
width: 150, align: 'center',
render: businessHours => ( render: val => businessStatus.find(item => item.value === val)?.label || '-',
<div>
<div>{getWeekSlots(businessHours.weeks)}</div>
<div>
{businessHours.hoursItems.map(item => (
<div key={item.begin}>
<span>{item.begin}</span>-<span>{item.end}</span>
</div>
))}
</div>
</div>
),
}, },
{ {
title: '地区', title: '创建时间',
dataIndex: 'addr', dataIndex: 'createdAt',
width: 200, width: 120,
hideInSearch: true, align: 'center',
render: (addr, r) => (
<span>{`${r.provinceName}${r.cityName}${r.countyName}${r.townName || ''}`}</span>
),
},
{
title: '详细地址',
dataIndex: 'address',
hideInSearch: true,
width: 150,
}, },
{ {
title: '经纬度', title: '门店电话',
dataIndex: 'latlng', dataIndex: 'phone',
hideInSearch: true, align: 'center',
width: 120, width: 100,
render: (latlng, r) => <span>{`${r.longitude},${r.latitude}`}</span>,
}, },
{ {
title: '状态', title: '门店状态',
dataIndex: 'state', dataIndex: 'state',
hideInSearch: true, hideInSearch: true,
width: 120, align: 'center',
width: 80,
render: v => <span>{`${stateDesc[v]}`}</span>, render: v => <span>{`${stateDesc[v]}`}</span>,
}, },
{
title: '创建时间',
dataIndex: 'createdAt',
hideInSearch: true,
width: 120,
},
{ {
title: '操作', title: '操作',
hideInSearch: true, hideInSearch: true,
dataIndex: 'action', dataIndex: 'action',
width: 170, width: 200,
fixed: 'right', fixed: 'right',
render: (val, r) => ( render: (val, r) => (
<div className={style.actionBtn}> <div className={style.actionBtn}>
...@@ -310,6 +302,18 @@ export default () => { ...@@ -310,6 +302,18 @@ export default () => {
</Form.Item> </Form.Item>
</Col> </Col>
<Col span={8}> <Col span={8}>
<Form.Item label="营业状态" name="businessStatus">
<Select>
{businessStatus.map(item => (
<Option label={item.label} value={item.value} key={item.value}>
{item.label}
</Option>
))}
</Select>
</Form.Item>
</Col>
</Row>
<div className={style.search}>
<Button type="primary" htmlType="submit" size="middle"> <Button type="primary" htmlType="submit" size="middle">
搜索 搜索
</Button> </Button>
...@@ -319,8 +323,7 @@ export default () => { ...@@ -319,8 +323,7 @@ export default () => {
<Button type="primary" size="middle" onClick={() => onCreate()}> <Button type="primary" size="middle" onClick={() => onCreate()}>
新建 新建
</Button> </Button>
</Col> </div>
</Row>
</Form> </Form>
</div> </div>
<Table <Table
......
.serachForm { .serachForm {
margin-bottom: 20px; margin-bottom: 20px;
padding: 20px 50px 0 10px; padding: 20px 50px 10px 10px;
background-color: #fff; background-color: #fff;
} }
.search {
display: flex;
justify-content: end;
}
.searchBtn { .searchBtn {
margin: 0 10px; margin: 0 10px;
} }
...@@ -16,8 +20,9 @@ ...@@ -16,8 +20,9 @@
.actionBtn { .actionBtn {
display: flex; display: flex;
flex-direction: column;
align-items: center; align-items: center;
// flex-direction: column;
justify-content: space-around;
button { button {
width: 75px; width: 75px;
margin-bottom: 5px; margin-bottom: 5px;
......
import React, { useState, useRef } from 'react'; import React, { useState, useRef } from 'react';
import ProTable from '@ant-design/pro-table'; import ProTable from '@ant-design/pro-table';
import { PageHeaderWrapper } from '@ant-design/pro-layout'; import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { notification, Button, Modal, Image } from 'antd'; import { notification, Button, Modal, Image, message } from 'antd';
import { query } from './services'; import { query } from './services';
const ContractView = () => { const ContractView = () => {
const [visible, setVisible] = useState(false); const [visible, setVisible] = useState(false);
const url = const [url, setUrl] = useState();
'https://contract-test.q-gp.com/621-621T18364B279E2null.pdf?Expires=1679994655&OSSAccessKeyId=LTAI5tGV1jdSEBjuKDUYZVHY&Signature=nVC2YgG8t5DWZl6sMyRmCzeRYLw%3D';
// 查看 // 查看
const onLook = ({ contractPdfUrl }) => { const onLook = ({ contractPdfUrl }) => {
if (contractPdfUrl) {
setUrl(contractPdfUrl);
setVisible(true); setVisible(true);
// window.open(url) } else {
message.error('暂无合同');
}
}; };
// 下载 // 下载
const ondown = ({ contractPdfUrl }) => { const ondown = ({ contractPdfUrl }) => {
window.open(url); if (contractPdfUrl) {
window.open(contractPdfUrl);
} else {
message.error('暂无合同');
}
}; };
const columns = [ const columns = [
{ {
......
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