|
|
@@ -1,21 +1,206 @@ |
|
|
|
import React, { useState, useEffect, useRef } from 'react'; |
|
|
|
import ProTable from '@ant-design/pro-table'; |
|
|
|
import { Form, Input, Select, InputNumber, TreeSelect, message, Button, Modal, Radio, Upload, Switch, Card } from 'antd'; |
|
|
|
import quickAPI from "../../service"; |
|
|
|
import indexStyles from "../../index.less"; |
|
|
|
import StepsButton from "../StepsButton"; |
|
|
|
import { message } from 'antd'; |
|
|
|
|
|
|
|
/** |
|
|
|
* 确认配置 |
|
|
|
* @returns |
|
|
|
*/ |
|
|
|
const ConfirmConfig = (props) => { |
|
|
|
/** |
|
|
|
* 1.组织配置 |
|
|
|
*/ |
|
|
|
//组织树 |
|
|
|
const [orgTree, setOrgTree] = useState([]); |
|
|
|
//支付方式列表 |
|
|
|
const [payTypeList, setPayTypeList] = useState([]); |
|
|
|
//获取组织树 |
|
|
|
const onFetchOrgTree = async () => { |
|
|
|
const response = await await quickAPI.getpage({ |
|
|
|
current: 1, |
|
|
|
pageSize: 1000 |
|
|
|
}); |
|
|
|
if (response.data.success) { |
|
|
|
setOrgTree(response.data.data); |
|
|
|
} else { |
|
|
|
message.error(response.errors || '获取组织架构出错'); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
//获取支付配置 |
|
|
|
const getPayTemplateList = async () => { |
|
|
|
const response = await quickAPI.getPayTemplateList(); |
|
|
|
if (response.statusCode === 200) { |
|
|
|
setPayTypeList(response.data.data); |
|
|
|
} else { |
|
|
|
message.error(response.errors || '获取获取支付方式出错'); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
onFetchOrgTree(); |
|
|
|
getPayTemplateList(); |
|
|
|
}, []); |
|
|
|
|
|
|
|
return <> |
|
|
|
<Card |
|
|
|
title="门店信息" |
|
|
|
> |
|
|
|
<Card.Grid>组织名称:{quickStartObj.storeConfig.name}</Card.Grid> |
|
|
|
</Card> |
|
|
|
{/* 1.组织配置 */} |
|
|
|
<table style={{ width: '50%', marginBottom: '10px' }}> |
|
|
|
<tbody> |
|
|
|
<tr className={indexStyles.ant_descriptions_row}> |
|
|
|
<th className={indexStyles.ant_descriptions_item_title}> |
|
|
|
组织配置 |
|
|
|
</th> |
|
|
|
</tr> |
|
|
|
<tr className={indexStyles.ant_descriptions_row}> |
|
|
|
<th className={indexStyles.ant_descriptions_item_label}> |
|
|
|
ID |
|
|
|
</th> |
|
|
|
<td className={indexStyles.ant_descriptions_item_content}> |
|
|
|
{props.quickStartObj.storeConfig.id} |
|
|
|
</td> |
|
|
|
</tr> |
|
|
|
<tr className={indexStyles.ant_descriptions_row}> |
|
|
|
<th className={indexStyles.ant_descriptions_item_label}> |
|
|
|
编码 |
|
|
|
</th> |
|
|
|
<td className={indexStyles.ant_descriptions_item_content}> |
|
|
|
{props.quickStartObj.storeConfig.code} |
|
|
|
</td> |
|
|
|
</tr> |
|
|
|
<tr className={indexStyles.ant_descriptions_row}> |
|
|
|
<th className={indexStyles.ant_descriptions_item_label}> |
|
|
|
名称 |
|
|
|
</th> |
|
|
|
<td className={indexStyles.ant_descriptions_item_content}> |
|
|
|
{props.quickStartObj.storeConfig.name} |
|
|
|
</td> |
|
|
|
</tr> |
|
|
|
<tr className={indexStyles.ant_descriptions_row}> |
|
|
|
<th className={indexStyles.ant_descriptions_item_label}> |
|
|
|
上级组织 |
|
|
|
</th> |
|
|
|
<td className={indexStyles.ant_descriptions_item_content}> |
|
|
|
{(() => { |
|
|
|
const pid = props.quickStartObj.storeConfig.pid; |
|
|
|
const find = orgTree.find(item => item.id === pid); |
|
|
|
if (find) { |
|
|
|
return find.name; |
|
|
|
} else { |
|
|
|
return "无上级组织" |
|
|
|
} |
|
|
|
})()} |
|
|
|
</td> |
|
|
|
</tr> |
|
|
|
<tr className={indexStyles.ant_descriptions_row}> |
|
|
|
<th className={indexStyles.ant_descriptions_item_label}> |
|
|
|
组织类型 |
|
|
|
</th> |
|
|
|
<td className={indexStyles.ant_descriptions_item_content}> |
|
|
|
{props.quickStartObj.storeConfig.type} |
|
|
|
</td> |
|
|
|
</tr> |
|
|
|
<tr className={indexStyles.ant_descriptions_row}> |
|
|
|
<th className={indexStyles.ant_descriptions_item_label}> |
|
|
|
支付方式 |
|
|
|
</th> |
|
|
|
<td className={indexStyles.ant_descriptions_item_content}> |
|
|
|
{(() => { |
|
|
|
const payTemplateId = props.quickStartObj.storeConfig.payTemplateId; |
|
|
|
const find = payTypeList.find(item => item.id === payTemplateId); |
|
|
|
if (find) { |
|
|
|
return find.name; |
|
|
|
} else { |
|
|
|
return "无支付方式" |
|
|
|
} |
|
|
|
})()} |
|
|
|
</td> |
|
|
|
</tr> |
|
|
|
<tr className={indexStyles.ant_descriptions_row}> |
|
|
|
<th className={indexStyles.ant_descriptions_item_label}> |
|
|
|
店铺地址 |
|
|
|
</th> |
|
|
|
<td className={indexStyles.ant_descriptions_item_content}> |
|
|
|
{props.quickStartObj.storeConfig.store_Addr} |
|
|
|
</td> |
|
|
|
</tr> |
|
|
|
<tr className={indexStyles.ant_descriptions_row}> |
|
|
|
<th className={indexStyles.ant_descriptions_item_label}> |
|
|
|
店铺坐标 |
|
|
|
</th> |
|
|
|
<td className={indexStyles.ant_descriptions_item_content}> |
|
|
|
{props.quickStartObj.storeConfig.store_Loc} |
|
|
|
</td> |
|
|
|
</tr> |
|
|
|
<tr className={indexStyles.ant_descriptions_row}> |
|
|
|
<th className={indexStyles.ant_descriptions_item_label}> |
|
|
|
联系电话 |
|
|
|
</th> |
|
|
|
<td className={indexStyles.ant_descriptions_item_content}> |
|
|
|
{props.quickStartObj.storeConfig.tel} |
|
|
|
</td> |
|
|
|
</tr> |
|
|
|
<tr className={indexStyles.ant_descriptions_row}> |
|
|
|
<th className={indexStyles.ant_descriptions_item_label}> |
|
|
|
门店排序 |
|
|
|
</th> |
|
|
|
<td className={indexStyles.ant_descriptions_item_content}> |
|
|
|
{props.quickStartObj.storeConfig.sort} |
|
|
|
</td> |
|
|
|
</tr> |
|
|
|
<tr className={indexStyles.ant_descriptions_row}> |
|
|
|
<th className={indexStyles.ant_descriptions_item_label}> |
|
|
|
备注 |
|
|
|
</th> |
|
|
|
<td className={indexStyles.ant_descriptions_item_content}> |
|
|
|
{props.quickStartObj.storeConfig.remark} |
|
|
|
</td> |
|
|
|
</tr> |
|
|
|
</tbody> |
|
|
|
</table> |
|
|
|
{/* 2.设备配置 */} |
|
|
|
<table style={{ width: '50%', marginBottom: '10px' }}> |
|
|
|
<tbody> |
|
|
|
<tr className={indexStyles.ant_descriptions_row}> |
|
|
|
<th className={indexStyles.ant_descriptions_item_title}> |
|
|
|
设备配置 |
|
|
|
</th> |
|
|
|
</tr> |
|
|
|
<tr className={indexStyles.ant_descriptions_row}> |
|
|
|
<th className={indexStyles.ant_descriptions_item_label}> |
|
|
|
ID |
|
|
|
</th> |
|
|
|
<td className={indexStyles.ant_descriptions_item_content}> |
|
|
|
{props.quickStartObj.deviceConfig.id} |
|
|
|
</td> |
|
|
|
</tr> |
|
|
|
<tr className={indexStyles.ant_descriptions_row}> |
|
|
|
<th className={indexStyles.ant_descriptions_item_label}> |
|
|
|
设备名称 |
|
|
|
</th> |
|
|
|
<td className={indexStyles.ant_descriptions_item_content}> |
|
|
|
{props.quickStartObj.deviceConfig.deviceName} |
|
|
|
</td> |
|
|
|
</tr> |
|
|
|
<tr className={indexStyles.ant_descriptions_row}> |
|
|
|
<th className={indexStyles.ant_descriptions_item_label}> |
|
|
|
设备类型 |
|
|
|
</th> |
|
|
|
<td className={indexStyles.ant_descriptions_item_content}> |
|
|
|
{props.quickStartObj.deviceConfig.deviceTypeKey} |
|
|
|
</td> |
|
|
|
</tr> |
|
|
|
<tr className={indexStyles.ant_descriptions_row}> |
|
|
|
<th className={indexStyles.ant_descriptions_item_label}> |
|
|
|
设备类型 |
|
|
|
</th> |
|
|
|
<td className={indexStyles.ant_descriptions_item_content}> |
|
|
|
{props.quickStartObj.deviceConfig.deviceTypeKey} |
|
|
|
</td> |
|
|
|
</tr> |
|
|
|
</tbody> |
|
|
|
</table> |
|
|
|
<StepsButton current={props.current} steps={props.steps} prev={props.prev}></StepsButton> |
|
|
|
</> |
|
|
|
} |
|
|
|