|
|
@@ -21,13 +21,13 @@ const PrinterInfo = () => { |
|
|
|
const [storeFoodMenuAll, setStoreFoodMenuAll] = useState([]); |
|
|
|
const [modalVisit, setModalVisit] = useState(false); |
|
|
|
const [printerTemplaterList, setPrinterTemplaterList] = useState([]); |
|
|
|
|
|
|
|
|
|
|
|
// 打印机店铺商品 |
|
|
|
|
|
|
|
useEffect(async () => { |
|
|
|
GetStoreInfoList(1); |
|
|
|
//获取模板 |
|
|
|
GetPrinterTemplater().then((re) => { |
|
|
|
GetPrinterTemplater().then((re) => { |
|
|
|
setPrinterTemplaterList(re.data); |
|
|
|
}); |
|
|
|
}, []) |
|
|
@@ -125,11 +125,11 @@ const PrinterInfo = () => { |
|
|
|
avatar: 'https://gw.alipayobjects.com/zos/antfincdn/UCSiy1j6jx/xingzhuang.svg', |
|
|
|
info: item, |
|
|
|
content: ( |
|
|
|
<div style={{ flex: 1 ,width:'100%'}} > |
|
|
|
<div style={{ overflow: 'auto', height: '555px',float:'left',width:'100%'}}> |
|
|
|
<div style={{ flex: 1, width: '100%' }} > |
|
|
|
<div style={{ overflow: 'auto', height: '555px', float: 'left', width: '100%' }}> |
|
|
|
<ProForm |
|
|
|
labelCol={{ span: 5 }} |
|
|
|
style={{float:'left',width:'80%',margin:'10px'}} |
|
|
|
style={{ float: 'left', width: '80%', margin: '10px' }} |
|
|
|
onFinish={async (values) => { |
|
|
|
var result = await UpdatePrinter(values); |
|
|
|
if (result.data) { |
|
|
@@ -161,7 +161,7 @@ const PrinterInfo = () => { |
|
|
|
<ProForm.Item name="applicationId" label="应用ID" placeholder="请输入应用ID"> |
|
|
|
<Field mode={item.state} /> |
|
|
|
</ProForm.Item> |
|
|
|
<ProForm.Item style={{ marginTop: '-10px'}} name="applicationkey" label="应用秘钥" placeholder="请输入应用秘钥"> |
|
|
|
<ProForm.Item style={{ marginTop: '-10px' }} name="applicationkey" label="应用秘钥" placeholder="请输入应用秘钥"> |
|
|
|
<Field valueType="password" mode={item.state} /> |
|
|
|
</ProForm.Item> |
|
|
|
<ProForm.Item style={{ marginTop: '-10px' }} name="terminalId" label="终端ID" placeholder="请输入终端ID"> |
|
|
@@ -186,13 +186,13 @@ const PrinterInfo = () => { |
|
|
|
return list; |
|
|
|
}} |
|
|
|
/> |
|
|
|
<div style={{ overflow: 'auto', width: '100%',float:'left',textAlign:'left',margin:'5px',padding:'5px'}}> |
|
|
|
<div style={{ overflow: 'auto', width: '100%', float: 'left', textAlign: 'left', margin: '5px', padding: '5px' }}> |
|
|
|
<ProFormText |
|
|
|
mode={item.state} |
|
|
|
mode={item.state} |
|
|
|
name="goodsIdList" |
|
|
|
valueType="checkbox" |
|
|
|
label="商品" |
|
|
|
request={ () => { |
|
|
|
request={() => { |
|
|
|
let list = []; |
|
|
|
storeFoodMenuList?.data.map((item, index) => { |
|
|
|
list.push({ label: item.foodName, value: item.foodId }); |
|
|
@@ -213,13 +213,14 @@ const PrinterInfo = () => { |
|
|
|
<div style={{ flex: 1, }} > |
|
|
|
<div style={{ height: 195, textAlign: 'center' }} |
|
|
|
onClick={() => { |
|
|
|
setModalVisit(true); |
|
|
|
setModalVisit(true); |
|
|
|
setCurrentStoreid(key); |
|
|
|
}} > |
|
|
|
<PlusOutlined style={{ fontSize: '50px', color: '#08c', marginTop: '60px' }} /> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
)}); |
|
|
|
) |
|
|
|
}); |
|
|
|
return printerListHtml; |
|
|
|
} |
|
|
|
|
|
|
@@ -227,12 +228,12 @@ const PrinterInfo = () => { |
|
|
|
return ( |
|
|
|
<PageContainer> |
|
|
|
<Card ></Card> |
|
|
|
<Card headStyle={{ border: '0px ' }} title="店铺商品" style={{ marginTop: '17px' }}> |
|
|
|
<Tabs defaultActiveKey="1" tabPosition="left" onChange={async (key) => {}}> |
|
|
|
<Card headStyle={{ border: '0px ' }} title="店铺打印机" style={{ marginTop: '17px' }}> |
|
|
|
<Tabs defaultActiveKey="1" tabPosition="left" onChange={async (key) => { }}> |
|
|
|
{storeInfoList?.map((item) => ( |
|
|
|
|
|
|
|
<TabPane tab={item.storeName} key={item.storeId}> |
|
|
|
|
|
|
|
|
|
|
|
<ProList |
|
|
|
params={{ 'storeid': item.storeId }} |
|
|
|
actionRef={actionRef} |
|
|
@@ -266,7 +267,7 @@ const PrinterInfo = () => { |
|
|
|
|
|
|
|
</Tabs> |
|
|
|
</Card> |
|
|
|
{/* 弹框 */} |
|
|
|
{/* 弹框 */} |
|
|
|
<ModalForm |
|
|
|
labelCol={{ span: 4 }} |
|
|
|
visible={modalVisit} |
|
|
@@ -274,7 +275,7 @@ const PrinterInfo = () => { |
|
|
|
onCancel: () => setModalVisit(false), |
|
|
|
}} |
|
|
|
onFinish={async (values) => { |
|
|
|
values.storeId =currentStoreid; |
|
|
|
values.storeId = currentStoreid; |
|
|
|
var result = await AddPrinter(values); |
|
|
|
if (result.data) { |
|
|
|
actionRef.current.reload(); |
|
|
@@ -287,52 +288,54 @@ const PrinterInfo = () => { |
|
|
|
formRef={formRef} |
|
|
|
layout={'horizontal'} |
|
|
|
autoFocusFirstInput> |
|
|
|
<ProFormText style={{ marginTop: '-10px', }} name="applicationId" label="应用ID" placeholder="请输入应用ID"> |
|
|
|
<Field mode={'edit'} /> |
|
|
|
</ProFormText> |
|
|
|
<ProForm.Item style={{ marginTop: '-10px' }} name="applicationkey" label="应用秘钥" placeholder="请输入应用秘钥"> |
|
|
|
<Field valueType="password" mode={'edit'} /> |
|
|
|
</ProForm.Item> |
|
|
|
<ProForm.Item style={{ marginTop: '-10px' }} name="terminalId" label="终端ID" placeholder="终端ID"> |
|
|
|
<Field mode={'edit'} /> |
|
|
|
</ProForm.Item> |
|
|
|
<ProForm.Item style={{ marginTop: '-10px' }} name="terminalKey" label="终端秘钥" placeholder="终端秘钥"> |
|
|
|
<Field valueType="password" mode={'edit'} /> |
|
|
|
</ProForm.Item> |
|
|
|
<ProForm.Item style={{ marginTop: '-10px' }} name="name" label="打印机名称" placeholder="请输入打印机名称" > |
|
|
|
<Field mode={'edit'} /> |
|
|
|
</ProForm.Item> |
|
|
|
<div style={{ width:'98%' }} > |
|
|
|
<ProFormText style={{ marginTop: '-10px', }} name="applicationId" label="应用ID" placeholder="请输入应用ID"> |
|
|
|
<Field mode={'edit'} /> |
|
|
|
</ProFormText> |
|
|
|
<ProForm.Item style={{ marginTop: '-10px' }} name="applicationkey" label="应用秘钥" placeholder="请输入应用秘钥"> |
|
|
|
<Field valueType="password" mode={'edit'} /> |
|
|
|
</ProForm.Item> |
|
|
|
<ProForm.Item style={{ marginTop: '-10px' }} name="terminalId" label="终端ID" placeholder="终端ID"> |
|
|
|
<Field mode={'edit'} /> |
|
|
|
</ProForm.Item> |
|
|
|
<ProForm.Item style={{ marginTop: '-10px' }} name="terminalKey" label="终端秘钥" placeholder="终端秘钥"> |
|
|
|
<Field valueType="password" mode={'edit'} /> |
|
|
|
</ProForm.Item> |
|
|
|
<ProForm.Item style={{ marginTop: '-10px' }} name="name" label="打印机名称" placeholder="请输入打印机名称" > |
|
|
|
<Field mode={'edit'} /> |
|
|
|
</ProForm.Item> |
|
|
|
|
|
|
|
<ProFormText |
|
|
|
mode={'edit'} |
|
|
|
name="templaterId" |
|
|
|
label="模板" |
|
|
|
placeholder="模板" |
|
|
|
style={{ marginTop: '-10px' }} |
|
|
|
request={() => { |
|
|
|
var list = []; |
|
|
|
printerTemplaterList?.map((item, index) => { |
|
|
|
list.push({ label: item.title, value: item.id }); |
|
|
|
}); |
|
|
|
return list; |
|
|
|
}} |
|
|
|
/> |
|
|
|
<ProFormText |
|
|
|
mode={'edit'} |
|
|
|
name="templaterId" |
|
|
|
label="模板" |
|
|
|
placeholder="模板" |
|
|
|
style={{ marginTop: '-10px' }} |
|
|
|
request={() => { |
|
|
|
var list = []; |
|
|
|
printerTemplaterList?.map((item, index) => { |
|
|
|
list.push({ label: item.title, value: item.id }); |
|
|
|
}); |
|
|
|
return list; |
|
|
|
}} |
|
|
|
/> |
|
|
|
|
|
|
|
<ProFormText |
|
|
|
mode={'edit'} |
|
|
|
name="goodsIdList" |
|
|
|
valueType="checkbox" |
|
|
|
label="商品" |
|
|
|
placeholder="商品" |
|
|
|
request={() => { |
|
|
|
var list = []; |
|
|
|
storeFoodMenuAll?.map((item, index) => { |
|
|
|
list.push({ label: item.foodName, value: item.foodId }); |
|
|
|
}); |
|
|
|
return list; |
|
|
|
<ProFormText |
|
|
|
mode={'edit'} |
|
|
|
name="goodsIdList" |
|
|
|
valueType="checkbox" |
|
|
|
label="商品" |
|
|
|
placeholder="商品" |
|
|
|
request={() => { |
|
|
|
var list = []; |
|
|
|
storeFoodMenuAll?.map((item, index) => { |
|
|
|
list.push({ label: item.foodName, value: item.foodId }); |
|
|
|
}); |
|
|
|
return list; |
|
|
|
|
|
|
|
}} |
|
|
|
/> |
|
|
|
}} |
|
|
|
/> |
|
|
|
</div> |
|
|
|
</ModalForm> |
|
|
|
</PageContainer> |
|
|
|
); |
|
|
|