@@ -9,7 +9,7 @@ | |||
export default { | |||
dev: { | |||
'/saasbase/': { | |||
target: 'http://localhost:5006/', | |||
target: 'http://localhost:5001/', | |||
changeOrigin: true, | |||
secure: false, //关闭证书验证 | |||
pathRewrite: { | |||
@@ -18,7 +18,7 @@ | |||
}, | |||
'/groupmeal/': { | |||
//target: 'http://10.2.1.26:21995/groupmeal/', | |||
target:'http://localhost:5298/', | |||
target:'http://localhost:5002/', | |||
changeOrigin: true, | |||
secure: false, //关闭证书验证 | |||
pathRewrite: { | |||
@@ -26,7 +26,7 @@ | |||
}, | |||
}, | |||
'/groupmealorder/': { | |||
target: 'http://localhost:5248/', | |||
target: 'http://localhost:5003/', | |||
changeOrigin: true, | |||
secure: false, //关闭证书验证 | |||
pathRewrite: { | |||
@@ -381,12 +381,6 @@ export default [ | |||
path: '/order/thirdOrder', | |||
component: './order/thirdOrder', | |||
}, | |||
{ | |||
name: '店铺授权', | |||
icon: 'smile', | |||
path: '/order/thirdOrder', | |||
component: './order/thirdOrder', | |||
}, | |||
{ | |||
name: '授权管理', | |||
icon: 'smile', | |||
@@ -8,3 +8,13 @@ export function getApiUrl() { | |||
export function getDataBaseUrl() { | |||
return '/saasbase'; | |||
} | |||
export function getgroupmealUrl() { | |||
return '/groupmeal'; | |||
} | |||
export function getgroupmealorderUrl() { | |||
return '/groupmealorder'; | |||
} | |||
@@ -75,7 +75,10 @@ const PayTemplate = () => { | |||
return <Button | |||
type="primary" | |||
key="primary" | |||
onClick={() => {setDrawerVisible(true) }} > | |||
onClick={() => { | |||
form.resetFields(); | |||
setDrawerVisible(true) | |||
}} > | |||
<PlusOutlined /> 新建 | |||
</Button> | |||
}} | |||
@@ -115,7 +118,7 @@ const PayTemplate = () => { | |||
setDrawerVisible(false); | |||
actionRef.current.reload(); | |||
} else { | |||
message.error('修改失败'); | |||
message.error(re.errors||'修改失败'); | |||
} | |||
}); | |||
} else { | |||
@@ -125,7 +128,7 @@ const PayTemplate = () => { | |||
setDrawerVisible(false); | |||
actionRef.current.reload(); | |||
} else { | |||
message.error('添加失败'); | |||
message.error(re.errors||'添加失败'); | |||
} | |||
}); | |||
@@ -1,28 +1,29 @@ | |||
import { request } from 'umi'; | |||
import { getDataBaseUrl,getgroupmealUrl } from '@/global_data'; | |||
export function page(data) { | |||
return request(`/groupmeal/api/appid/getappidpage`, { | |||
return request(getgroupmealUrl()+`/api/appid/getappidpage`, { | |||
method: 'post', | |||
data: data, | |||
}); | |||
} | |||
export function add(data) { | |||
return request(`/groupmeal/api/appid/add`, { | |||
return request(getgroupmealUrl()+`/api/appid/add`, { | |||
method: 'post', | |||
data: data, | |||
}); | |||
} | |||
export function del(data) { | |||
return request(`/groupmeal/api/appid/delete`, { | |||
return request(getgroupmealUrl()+`/api/appid/delete`, { | |||
method: 'post', | |||
data: data, | |||
}); | |||
} | |||
export function update(data) { | |||
return request(`/groupmeal/api/appid/update`, { | |||
return request(getgroupmealUrl()+`/api/appid/update`, { | |||
method: 'post', | |||
data: data, | |||
}); |
@@ -84,7 +84,7 @@ const PayTemplate = () => { | |||
message.success('删除成功'); | |||
actionRef.current.reload(); | |||
} else { | |||
message.error('删除失败'); | |||
message.error(re.errors||'删除失败'); | |||
} | |||
}); | |||
}} | |||
@@ -169,7 +169,7 @@ const PayTemplate = () => { | |||
setDrawerVisible(false); | |||
actionRef.current.reload(); | |||
} else { | |||
message.error('修改失败'); | |||
message.error(re.errors||'修改失败'); | |||
} | |||
}); | |||
} else { | |||
@@ -179,7 +179,7 @@ const PayTemplate = () => { | |||
setDrawerVisible(false); | |||
actionRef.current.reload(); | |||
} else { | |||
message.error('添加失败'); | |||
message.error(re.errors||'添加失败'); | |||
} | |||
}); | |||
@@ -1,28 +1,29 @@ | |||
import { request } from 'umi'; | |||
import { getDataBaseUrl,getgroupmealUrl } from '@/global_data'; | |||
export function getPayTemplatePageList(data) { | |||
return request(`/groupmeal/api/paytemplate/getPayTemplatePageList`, { | |||
return request(getgroupmealUrl()+`/api/paytemplate/getPayTemplatePageList`, { | |||
method: 'post', | |||
data: data, | |||
}); | |||
} | |||
export function add(data) { | |||
return request(`/groupmeal/api/paytemplate/add`, { | |||
return request(getgroupmealUrl()+`/api/paytemplate/add`, { | |||
method: 'post', | |||
data: data, | |||
}); | |||
} | |||
export function deletepaytemplate(data) { | |||
return request(`/groupmeal/api/paytemplate/delete`, { | |||
return request(getgroupmealUrl()+`/api/paytemplate/delete`, { | |||
method: 'post', | |||
data: data, | |||
}); | |||
} | |||
export function update(data) { | |||
return request(`/groupmeal/api/paytemplate/update`, { | |||
return request(getgroupmealUrl()+`/api/paytemplate/update`, { | |||
method: 'post', | |||
data: data, | |||
}); |
@@ -20,6 +20,7 @@ const getBase64 = (file) => | |||
const Material = () => { | |||
const actionRef = useRef(); | |||
const [selectedStore, setSelectedStore] = useState(''); | |||
const [selectedPage, setSelectedPage] = useState(''); | |||
const [storeList, setStoreList] = useState([]); | |||
const [isModalVisible, setIsModalVisible] = useState(false); | |||
const [currentImage, setCurrentImage] = useState({ | |||
@@ -75,8 +76,8 @@ const Material = () => { | |||
dataIndex: 'materialPath', | |||
render: (_, record) => ( | |||
<Image | |||
style={{width: '50%', height: '50%'}} | |||
src={ JSON.parse(record.materialPath)[0]} | |||
style={{ width: '50%', height: '50%' }} | |||
src={JSON.parse(record.materialPath)[0]} | |||
fallback="data:image/png;base64,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"> | |||
</Image> | |||
) | |||
@@ -161,7 +162,7 @@ const Material = () => { | |||
onProgress({ percent: Math.round(loaded / total * 100).toFixed(2) }, file); | |||
}, | |||
}).then(response => { | |||
if (response.status == 200 || response.statusText == 'OK') { | |||
const tempUploadImage = JSON.parse(JSON.stringify(currentImage)); | |||
tempUploadImage.materialPath.push(r.data.seeUrl); | |||
@@ -211,7 +212,7 @@ const Material = () => { | |||
setIsModalVisible(false); | |||
actionRef.current.reload(); | |||
} else { | |||
message.error('更新失败') | |||
message.error(response.errors||'更新失败') | |||
} | |||
} else { | |||
const response = await appletAPI.AddMinimaterial(jsonData); | |||
@@ -220,7 +221,7 @@ const Material = () => { | |||
setIsModalVisible(false); | |||
actionRef.current.reload(); | |||
} else { | |||
message.error('添加失败') | |||
message.error(response.errors||'添加失败') | |||
} | |||
} | |||
} | |||
@@ -282,6 +283,7 @@ const Material = () => { | |||
}); | |||
if (response.statusCode === 200) { | |||
setMiniPageList(response.data.items); | |||
setSelectedPage(response?.data?.items[0]?.id); | |||
} else { | |||
message.error(response.errors || '获取页面列表失败') | |||
} | |||
@@ -305,20 +307,26 @@ const Material = () => { | |||
useEffect(() => { | |||
if (!selectedStore) return; | |||
onFetchMiniPageList(); | |||
if(!selectedPage) return; | |||
actionRef.current.reload(); | |||
}, [selectedStore]); | |||
useEffect(() => { | |||
actionRef.current.reload(); | |||
}, [selectedPage]); | |||
return <PageContainer header={{ | |||
title: '', | |||
breadcrumb: {}, | |||
}}> | |||
}}> | |||
<Card style={{ marginBottom: '10px' }}> | |||
<div className={styles.table_search_item}> | |||
<div className={styles.table_search_item} style={{float:"left"}}> | |||
<div> | |||
当前门店: | |||
</div> | |||
<Select style={{ width: 300 }} value={selectedStore} onChange={(value) => { | |||
setSelectedStore(value); | |||
setSelectedPage(miniPageList[0]?.id); | |||
}}> | |||
{ | |||
storeList.map(item => { | |||
@@ -327,6 +335,22 @@ const Material = () => { | |||
} | |||
</Select> | |||
</div> | |||
<div style={{float:"left"}}> </div> | |||
<div className={styles.table_search_item} style={{float:"left"}}> | |||
<div> | |||
所属页面: | |||
</div> | |||
<Select style={{ width: 300 }} value={selectedPage} onChange={(value) => { | |||
setSelectedPage(value); | |||
actionRef.current.reload(); | |||
}}> | |||
{ | |||
miniPageList.map(item => { | |||
return <Option value={item.id} key={item.id}>{item.pageName}</Option> | |||
}) | |||
} | |||
</Select> | |||
</div> | |||
</Card> | |||
<ProTable | |||
search={false} | |||
@@ -336,22 +360,26 @@ const Material = () => { | |||
editable={{ | |||
type: 'multiple', | |||
}} | |||
request={async () => { | |||
pagination={{ | |||
pageSize: 10, | |||
}} | |||
request={async (params) => { | |||
if (!selectedStore) return; | |||
const jsonData = { | |||
"current": currentPage, | |||
"pageSize": pageSize, | |||
"storeId": selectedStore | |||
"current": params.current, | |||
"pageSize": params.pageSize, | |||
"storeId": selectedStore, | |||
"pageId":selectedPage | |||
} | |||
const response = await appletAPI.MinimaterialListByStore(jsonData); | |||
const pageList = []; | |||
response.data.forEach(item => { | |||
response.data.items.forEach(item => { | |||
pageList.push(...item.list); | |||
}); | |||
return { | |||
data: pageList, | |||
success: true, | |||
total: 10, | |||
total: response.data.totalCount, | |||
} | |||
}} | |||
columnsState={{ | |||
@@ -374,48 +402,51 @@ const Material = () => { | |||
</Button> | |||
]} | |||
/> | |||
<Modal title="编辑素材" visible={isModalVisible} footer={null} onOk={onAddPageMaterial} onCancel={() => setIsModalVisible(false)} bodyStyle={{ padding: '32px 40px 1px 48px',height: '465px'}}> | |||
<Modal | |||
title="编辑素材" | |||
maskClosable={false} | |||
visible={isModalVisible} footer={null} onOk={onAddPageMaterial} onCancel={() => setIsModalVisible(false)} bodyStyle={{ padding: '32px 40px 1px 48px', height: '465px' }}> | |||
<div className={styles.edit_image_card}> | |||
<div className={styles.edit_image_item}> | |||
<div className={styles.edit_image_prev}> | |||
素材名称: | |||
所属页面: | |||
</div> | |||
<div className={styles.edit_image_suffix}> | |||
<Input placeholder='请输入素材名称' value={currentImage.materialName} onChange={value => { | |||
<Select placeholder="请选择所在页面" style={{ width: '100%' }} value={currentImage.pageId} onChange={(value) => { | |||
const tempImg = JSON.parse(JSON.stringify(currentImage)); | |||
tempImg.materialName = value.target.value; | |||
tempImg.pageId = value; | |||
setCurrentImage(tempImg); | |||
}}></Input> | |||
}}> | |||
{ | |||
miniPageList.map(item => { | |||
return <Option value={item.id} key={item.id}>{item.pageName}</Option> | |||
}) | |||
} | |||
</Select> | |||
</div> | |||
</div> | |||
<div className={styles.edit_image_item}> | |||
<div className={styles.edit_image_prev}> | |||
素材编码: | |||
素材名称: | |||
</div> | |||
<div className={styles.edit_image_suffix}> | |||
<Input placeholder='请输入素材编码' value={currentImage.materialCode} onChange={value => { | |||
<Input placeholder='请输入素材名称' value={currentImage.materialName} onChange={value => { | |||
const tempImg = JSON.parse(JSON.stringify(currentImage)); | |||
tempImg.materialCode = value.target.value; | |||
tempImg.materialName = value.target.value; | |||
setCurrentImage(tempImg); | |||
}}></Input> | |||
</div> | |||
</div> | |||
<div className={styles.edit_image_item}> | |||
<div className={styles.edit_image_prev}> | |||
所属页面: | |||
素材编码: | |||
</div> | |||
<div className={styles.edit_image_suffix}> | |||
<Select placeholder="请选择所在页面" style={{ width: '100%' }} value={currentImage.pageId} onChange={(value) => { | |||
<Input placeholder='请输入素材编码' value={currentImage.materialCode} onChange={value => { | |||
const tempImg = JSON.parse(JSON.stringify(currentImage)); | |||
tempImg.pageId = value; | |||
tempImg.materialCode = value.target.value; | |||
setCurrentImage(tempImg); | |||
}}> | |||
{ | |||
miniPageList.map(item => { | |||
return <Option value={item.id} key={item.id}>{item.pageName}</Option> | |||
}) | |||
} | |||
</Select> | |||
}}></Input> | |||
</div> | |||
</div> | |||
<div className={styles.edit_image_item}> | |||
@@ -433,7 +464,7 @@ const Material = () => { | |||
</Select> | |||
</div> | |||
</div> | |||
<Upload | |||
listType="picture-card" | |||
fileList={fileList} | |||
@@ -463,13 +494,13 @@ const Material = () => { | |||
})() | |||
} | |||
</Upload> | |||
<Button htmlType="button" style={{float:'right',left:10}} onClick={() => setIsModalVisible(false)}> | |||
取消 | |||
</Button> | |||
<Button type="primary" htmlType="submit" style={{float:'right'}} onClick={()=> onAddPageMaterial()}>保存</Button> | |||
<Button htmlType="button" style={{ float: 'right', left: 10 }} onClick={() => setIsModalVisible(false)}> | |||
取消 | |||
</Button> | |||
<Button type="primary" htmlType="submit" style={{ float: 'right' }} onClick={() => onAddPageMaterial()}>保存</Button> | |||
</div> | |||
</Modal> | |||
<Modal visible={previewVisible} title={previewTitle} footer={null} onCancel={handleCancel}> | |||
<img | |||
@@ -481,6 +512,6 @@ const Material = () => { | |||
/> | |||
</Modal> | |||
</PageContainer > | |||
} | |||
export default Material; |
@@ -186,7 +186,10 @@ const pageManage = () => { | |||
</Button> | |||
]} | |||
/> | |||
<Modal title="编辑页面" footer={false} visible={isModalVisible} onOk={() => setIsModalVisible(false)} onCancel={() => setIsModalVisible(false)} bodyStyle={{ padding: '32px 40px 1px 48px' }}> | |||
<Modal | |||
title="编辑页面" | |||
maskClosable={false} | |||
footer={false} visible={isModalVisible} onOk={() => setIsModalVisible(false)} onCancel={() => setIsModalVisible(false)} bodyStyle={{ padding: '32px 40px 1px 48px' }}> | |||
<Form | |||
name="basic" | |||
form={pageForm} | |||
@@ -199,25 +202,30 @@ const pageManage = () => { | |||
<Input /> | |||
</Form.Item> | |||
<Form.Item | |||
label="页面名称" | |||
name="pageName" | |||
label="归属场景" | |||
name="storeId" | |||
rules={[ | |||
{ | |||
required: true, | |||
message: '请输入页面名称!', | |||
message: '请选择门店!', | |||
}, | |||
]} | |||
> | |||
<Input /> | |||
<Select allowClear placeholder="请选择门店" style={{ width: '100%' }}> | |||
{ | |||
storeList.map(item => { | |||
return <Option value={item.id} key={item.id}>{item.name}</Option> | |||
}) | |||
} | |||
</Select> | |||
</Form.Item> | |||
<Form.Item | |||
label="页面路径" | |||
name="pageRoute" | |||
label="页面名称" | |||
name="pageName" | |||
rules={[ | |||
{ | |||
required: true, | |||
message: '请输入页面路径!', | |||
message: '请输入页面名称!', | |||
}, | |||
]} | |||
> | |||
@@ -225,22 +233,16 @@ const pageManage = () => { | |||
</Form.Item> | |||
<Form.Item | |||
label="归属场景" | |||
name="storeId" | |||
label="页面路径" | |||
name="pageRoute" | |||
rules={[ | |||
{ | |||
required: true, | |||
message: '请选择门店!', | |||
message: '请输入页面路径!', | |||
}, | |||
]} | |||
> | |||
<Select allowClear placeholder="请选择门店" style={{ width: '100%' }}> | |||
{ | |||
storeList.map(item => { | |||
return <Option value={item.id} key={item.id}>{item.name}</Option> | |||
}) | |||
} | |||
</Select> | |||
<Input /> | |||
</Form.Item> | |||
<Form.Item> | |||
@@ -1,13 +1,14 @@ | |||
import { request } from 'umi'; | |||
import { getDataBaseUrl,getgroupmealUrl } from '@/global_data'; | |||
export default { | |||
GetAllStore() { | |||
return request('/groupmeal/api/shop/alllist', { | |||
return request(getgroupmealUrl()+'/api/shop/alllist', { | |||
method: 'GET' | |||
}); | |||
}, | |||
GetCosRequestURL(data) { | |||
return request(`/groupmeal/api/SysService/GetPresignUploadUrl`, { | |||
return request(getgroupmealUrl()+`/api/SysService/GetPresignUploadUrl`, { | |||
method: 'POST', | |||
data: data, | |||
}); | |||
@@ -16,7 +17,7 @@ export default { | |||
//-----------------------页面管理 start--------------------- | |||
//分页查询 | |||
MiniPageList(params) { | |||
return request('/groupmeal/api/AppletService/page', { | |||
return request(getgroupmealUrl()+'/api/AppletService/page', { | |||
method: 'POST', | |||
data: { | |||
...params | |||
@@ -30,7 +31,7 @@ export default { | |||
* @returns | |||
*/ | |||
MiniPageAdd(params) { | |||
return request('/groupmeal/api/AppletService/add', { | |||
return request(getgroupmealUrl()+'/api/AppletService/add', { | |||
method: 'POST', | |||
data: { | |||
...params | |||
@@ -43,7 +44,7 @@ export default { | |||
* @param {*} params | |||
*/ | |||
MiniPageUpdate(params) { | |||
return request('/groupmeal/api/AppletService/update', { | |||
return request(getgroupmealUrl()+'/api/AppletService/update', { | |||
method: 'POST', | |||
data: { | |||
...params | |||
@@ -57,7 +58,7 @@ export default { | |||
* @returns | |||
*/ | |||
MiniPageDelete(id) { | |||
return request('/groupmeal/api/AppletService/del', { | |||
return request(getgroupmealUrl()+'/api/AppletService/del', { | |||
method: 'POST', | |||
data: { | |||
id | |||
@@ -76,7 +77,7 @@ export default { | |||
* 根据店铺id查询素材 | |||
*/ | |||
MinimaterialListByStore(params) { | |||
return request(`/groupmeal/api/AppletService/MiniStoreMaterial`, { | |||
return request(getgroupmealUrl()+`/api/AppletService/MiniStoreMaterial`, { | |||
method: 'POST', | |||
data: params, | |||
}); | |||
@@ -88,7 +89,7 @@ export default { | |||
* @returns | |||
*/ | |||
AddMinimaterial(params) { | |||
return request(`/groupmeal/api/AppletService/MaterialAdd`, { | |||
return request(getgroupmealUrl()+`/api/AppletService/MaterialAdd`, { | |||
method: 'POST', | |||
data: params, | |||
}); | |||
@@ -99,7 +100,7 @@ export default { | |||
* @param {*} params | |||
*/ | |||
UpdateMiniMaterial(params) { | |||
return request(`/groupmeal/api/AppletService/MaterialUpdate`, { | |||
return request(getgroupmealUrl()+`/api/AppletService/MaterialUpdate`, { | |||
method: 'POST', | |||
data: params, | |||
}); | |||
@@ -109,7 +110,7 @@ export default { | |||
* 删除素材 | |||
*/ | |||
DeleteMiniMaterial(id) { | |||
return request(`/groupmeal/api/AppletService/MaterialDel`, { | |||
return request(getgroupmealUrl()+`/api/AppletService/MaterialDel`, { | |||
method: 'POST', | |||
data: { | |||
id | |||
@@ -127,7 +127,9 @@ const CreateForm = (props) => { | |||
<Form.Item name="realName" style={{ float: 'left', width: '145px' }}> | |||
<Input placeholder="请输入真实姓名" /> | |||
</Form.Item> | |||
<Form.Item name="cardNum" style={{ float: 'left', marginLeft: 10, width: '300px' }}> | |||
<Form.Item name="cardNum" | |||
rules={[{ pattern: '^(\\d{15}$|^\\d{18}$|^\\d{17}(\\d|X|x))$', message: '请请输入正确的身份证号码' }]} | |||
style={{ float: 'left', marginLeft: 10, width: '300px' }}> | |||
<Input placeholder="请输入身份证号码" /> | |||
</Form.Item> | |||
</Form.Item> | |||
@@ -304,23 +304,23 @@ const MemberManage = () => { | |||
> | |||
更新 | |||
</a>, | |||
<Popconfirm | |||
key="delete" | |||
title={`确定要${record.status == 0 ? '禁用' : '启用'}吗?`} | |||
onConfirm={async () => { | |||
var data = { Id: record.id, platformType: 0, status: record.status == 0 ? 1 : 0 }; | |||
updateMemberStatus(data); | |||
}} | |||
okText="确定" | |||
cancelText="取消" | |||
> | |||
<a | |||
key="primary" | |||
type="primary" | |||
> | |||
{record.status == 0 ? '禁用 ' : '启用'} | |||
</a> | |||
</Popconfirm>, | |||
// <Popconfirm | |||
// key="delete" | |||
// title={`确定要${record.status == 0 ? '禁用' : '启用'}吗?`} | |||
// onConfirm={async () => { | |||
// var data = { Id: record.id, platformType: 0, status: record.status == 0 ? 1 : 0 }; | |||
// updateMemberStatus(data); | |||
// }} | |||
// okText="确定" | |||
// cancelText="取消" | |||
// > | |||
// <a | |||
// key="primary" | |||
// type="primary" | |||
// > | |||
// {record.status == 0 ? '禁用 ' : '启用'} | |||
// </a> | |||
// </Popconfirm>, | |||
<a | |||
@@ -458,20 +458,20 @@ const MemberManage = () => { | |||
// > | |||
// 更新 | |||
// </a>, | |||
<a | |||
key="primary" | |||
type="primary" | |||
onClick={() => { | |||
var data = { | |||
Id: record.memberInfo_Id, | |||
platformType: record.platformType, | |||
status: record.status == 0 ? 1 : 0, | |||
}; | |||
updateMemberStatus(data); | |||
}} | |||
> | |||
{record.status == 0 ? '禁用 ' : '启用'} | |||
</a>, | |||
// <a | |||
// key="primary" | |||
// type="primary" | |||
// onClick={() => { | |||
// var data = { | |||
// Id: record.memberInfo_Id, | |||
// platformType: record.platformType, | |||
// status: record.status == 0 ? 1 : 0, | |||
// }; | |||
// updateMemberStatus(data); | |||
// }} | |||
// > | |||
// {record.status == 0 ? '禁用 ' : '启用'} | |||
// </a>, | |||
<a | |||
key="primary" | |||
type="primary" | |||
@@ -589,6 +589,7 @@ const MemberManage = () => { | |||
) | |||
) { | |||
setIsTagModalVisible(false); | |||
setDataRowKey([]); | |||
} | |||
}} | |||
onCancel={() => { | |||
@@ -607,13 +608,13 @@ const MemberManage = () => { | |||
</> | |||
</Modal> | |||
{/* 积分记录 */} | |||
<IntegralRecord | |||
{/* <IntegralRecord | |||
onClose={() => { | |||
SetIntegralRecordVisible(false); | |||
}} | |||
memberId={currentRow?.id} | |||
integralRecordVisible={integralRecordVisible} | |||
/> | |||
/> */} | |||
</PageContainer> | |||
); | |||
}; | |||
@@ -1,14 +1,11 @@ | |||
import { request } from 'umi'; | |||
export function GetCustomerPageQuery(data) { | |||
return request(`/saasbase/api/member/customer-page-query`, { | |||
method: 'post', | |||
data: data, | |||
}); | |||
} | |||
import { getDataBaseUrl,getgroupmealUrl } from '@/global_data'; | |||
//获取会员信息 | |||
export function GetMemberPageQuery(data) { | |||
return request(`/groupmeal/api/MemberInfoService/GetMemberPageQuery`, { | |||
return request(getgroupmealUrl()+`/api/MemberInfoService/GetMemberPageQuery`, { | |||
method: 'post', | |||
data: data, | |||
}); | |||
@@ -16,7 +13,7 @@ export function GetMemberPageQuery(data) { | |||
//添加会员 | |||
export function CreateMemberInfo(data) { | |||
return request(`/groupmeal/api/MemberInfoService/AddMember`, { | |||
return request(getgroupmealUrl()+`/api/MemberInfoService/AddMember`, { | |||
method: 'post', | |||
data: data, | |||
}); | |||
@@ -24,7 +21,7 @@ export function CreateMemberInfo(data) { | |||
//修改会员信息 | |||
export function UpdateMemberInfo(data) { | |||
return request(`/groupmeal/api/MemberInfoService/UpdateMemberInfo`, { | |||
return request(getgroupmealUrl()+`/api/MemberInfoService/UpdateMemberInfo`, { | |||
method: 'post', | |||
data: data, | |||
}); | |||
@@ -32,7 +29,7 @@ export function UpdateMemberInfo(data) { | |||
//修改会员状态 | |||
export function UpdateMemberStatus(data) { | |||
return request(`/groupmeal/api/MemberInfoService/UpdateMemberStatus`, { | |||
return request(getgroupmealUrl()+`/api/MemberInfoService/UpdateMemberStatus`, { | |||
method: 'post', | |||
data: data, | |||
}); | |||
@@ -40,7 +37,7 @@ export function UpdateMemberStatus(data) { | |||
//获取会员 | |||
export function GetPlatformMemberList(data) { | |||
return request(`/groupmeal/api/MemberInfoService/GetPlatformMemberList?memberId=${data}`, { | |||
return request(getgroupmealUrl()+`/api/MemberInfoService/GetPlatformMemberList?memberId=${data}`, { | |||
method: 'get', | |||
}); | |||
} | |||
@@ -48,7 +45,7 @@ export function GetPlatformMemberList(data) { | |||
//获取会员标签 和绑定详情 | |||
export function GetMemberTagAndInfo(memberinfoid, platformtype) { | |||
return request( | |||
`/groupmeal/api/MemberInfoService/GetMemberTagAndInfo?memberInfoId=${memberinfoid}&PlatformType=${platformtype}`, | |||
getgroupmealUrl()+`/api/MemberInfoService/GetMemberTagAndInfo?memberInfoId=${memberinfoid}&PlatformType=${platformtype}`, | |||
{ | |||
method: 'get', | |||
}, | |||
@@ -57,28 +54,9 @@ export function GetMemberTagAndInfo(memberinfoid, platformtype) { | |||
//修改会员标签 | |||
export function UpdateMemberTag(data) { | |||
return request(`/groupmeal/api/MemberInfoService/UpdateMemberTag`, { | |||
return request(getgroupmealUrl()+`/api/MemberInfoService/UpdateMemberTag`, { | |||
method: 'post', | |||
data: data, | |||
}); | |||
} | |||
//同步会员 | |||
export function SyncMember(data) { | |||
return request(`/saasbase/api/member/syncmember/${data}`, { | |||
method: 'post', | |||
}); | |||
} | |||
//获取会员积分记录 | |||
export function GetIntegralRecord(data) { | |||
return request(`/saasbase/api/member/member-integral-record-page`, { | |||
method: 'post', | |||
data: data, | |||
}); | |||
} |
@@ -43,12 +43,12 @@ const CreateForm = (props) => { | |||
</OptGroup> | |||
</Select> | |||
</Form.Item> | |||
<Form.Item name="sort" label="排序"> | |||
{/* <Form.Item name="sort" label="排序"> | |||
<InputNumber min={1} placeholder="请选择排序" /> | |||
</Form.Item> | |||
</Form.Item> */} | |||
<Form.Item | |||
{/* <Form.Item | |||
noStyle | |||
shouldUpdate={(prevValues, currentValues) => | |||
prevValues.mode !== currentValues.mode | |||
@@ -70,7 +70,7 @@ const CreateForm = (props) => { | |||
</Form.Item> | |||
) : null | |||
} | |||
</Form.Item> | |||
</Form.Item> */} | |||
<Form.Item> | |||
@@ -3,11 +3,12 @@ | |||
/* eslint-disable */ | |||
import { defaultActionRender } from '@ant-design/pro-utils/lib/useEditableArray'; | |||
import { request } from 'umi'; | |||
import { getDataBaseUrl,getgroupmealUrl } from '@/global_data'; | |||
export default { | |||
/** 获取会员标签信息 sdsa GET /kitchen/api/rule */ | |||
memberTagList(data) { | |||
return request(`/groupmeal/api/MemberTagService/MemberTagQueryDto`, { | |||
return request(getgroupmealUrl()+`/api/MemberTagService/MemberTagQueryDto`, { | |||
method: 'POST', | |||
data: data, | |||
// params: { ...params }, | |||
@@ -17,7 +18,7 @@ export default { | |||
/** 新建会员标签信息 POST /kitchen/api/rule */ | |||
addMemberTag(data) { | |||
// http://localhost:7002 | |||
return request(`/groupmeal/api/MemberTagService/AddMemberTag`, { | |||
return request(getgroupmealUrl()+`/api/MemberTagService/AddMemberTag`, { | |||
method: 'POST', | |||
// type:'json', | |||
data: data, | |||
@@ -28,7 +29,7 @@ export default { | |||
/** 修改会员标签信息 POST /kitchen/api/rule */ | |||
updateMemberTag(data) { | |||
// http://localhost:7002 | |||
return request(`/groupmeal/api/MemberTagService/UpdateMemberTag`, { | |||
return request(getgroupmealUrl()+`/api/MemberTagService/UpdateMemberTag`, { | |||
method: 'post', | |||
// type:'json', | |||
data: data, | |||
@@ -38,26 +39,10 @@ export default { | |||
/** 删除会员标签信息 POST /kitchen/api/rule */ | |||
removeMemberTag(data) { | |||
return request(`/groupmeal/api/MemberTagService/DelMemberTag?Id=` + data, { | |||
return request(getgroupmealUrl()+`/api/MemberTagService/DelMemberTag?Id=` + data, { | |||
method: 'DELETE', | |||
// ...(options || {}), | |||
}); | |||
}, | |||
/** 获取所有基础会员信息*/ | |||
GetMemberInfoPageAsync(data) { | |||
return request(`/groupmeal/api/member/member-page-query`, { | |||
method: 'POST', | |||
data: data, | |||
// params: { ...params }, | |||
// ...(options || {}), | |||
}); | |||
}, | |||
AddOrUpdateMemberTagInfo(data) { | |||
return request(`/saasbase/api/member-tag/batch-member-info`, { | |||
method: 'post', | |||
data: data, | |||
}); | |||
}, | |||
}; |
@@ -18,7 +18,7 @@ export default () => { | |||
"startTime": dataTime[0], | |||
"endTime": dataTime[1] | |||
}); | |||
setData(res.data.data); | |||
setData(res.data?.data); | |||
} | |||
const dateFormat = 'YYYY/MM/DD'; | |||
@@ -1,9 +1,10 @@ | |||
import { request } from 'umi'; | |||
import { getDataBaseUrl,getgroupmealUrl } from '@/global_data'; | |||
export default { | |||
//获取部门分页 | |||
GetData(data) { | |||
return request('/groupmeal/api/Reservation/GetDayConsumeInfo', { | |||
return request(getgroupmealUrl()+'/api/Reservation/GetDayConsumeInfo', { | |||
method: 'POST', | |||
data | |||
}); | |||
@@ -19,7 +19,7 @@ export default () => { | |||
"startTime": dataTime[0], | |||
"endTime": dataTime[1] | |||
}); | |||
setData(res.data.data); | |||
setData(res.data?.data); | |||
} | |||
const onChange = (value, dateString) => { | |||
setDataTime(dateString); | |||
@@ -1,9 +1,10 @@ | |||
import { request } from 'umi'; | |||
import { getDataBaseUrl,getgroupmealUrl } from '@/global_data'; | |||
export default { | |||
//获取部门分页 | |||
GetData(data) { | |||
return request('/groupmeal/api/Reservation/GetTimeIntervalConsumeInfo', { | |||
return request(getgroupmealUrl()+'/api/Reservation/GetTimeIntervalConsumeInfo', { | |||
method: 'POST', | |||
data | |||
}); | |||
@@ -1,9 +1,11 @@ | |||
import { request } from 'umi'; | |||
import { getDataBaseUrl,getgroupmealUrl } from '@/global_data'; | |||
export default { | |||
//获取部门分页 | |||
GetData(data) { | |||
return request('/groupmeal/api/Reservation/GetConsumeInfo', { | |||
return request(getgroupmealUrl()+'/api/Reservation/GetConsumeInfo', { | |||
method: 'POST', | |||
data | |||
}); | |||
@@ -1,11 +1,12 @@ | |||
import { request } from 'umi'; | |||
import { getgroupmealUrl } from '@/global_data'; | |||
export default { | |||
/** | |||
* 获取部门分页 | |||
*/ | |||
GetDeparent(data) { | |||
return request('/groupmeal/api/MemberInfoService/GetMemberTag', { | |||
return request(getgroupmealUrl()+'/api/MemberInfoService/GetMemberTag', { | |||
method: 'POST', | |||
data | |||
}); | |||
@@ -13,7 +14,7 @@ export default { | |||
//获取预定商品 | |||
GetReservationGoods(data) { | |||
return request('/groupmeal/api/Reservation/GetReservationGoods', { | |||
return request(getgroupmealUrl()+'/api/Reservation/GetReservationGoods', { | |||
method: 'POST', | |||
data | |||
}); | |||
@@ -21,7 +22,7 @@ export default { | |||
//预定部门汇总 | |||
GetReservationOrg(data) { | |||
return request('/groupmeal/api/Reservation/GetReservationOrg', { | |||
return request(getgroupmealUrl()+'/api/Reservation/GetReservationOrg', { | |||
method: 'POST', | |||
data | |||
}); | |||
@@ -29,7 +30,7 @@ GetReservationOrg(data) { | |||
//获取预定人员 | |||
GetReservationUser(data) { | |||
return request('/groupmeal/api/Reservation/GetReservationUser', { | |||
return request(getgroupmealUrl()+'/api/Reservation/GetReservationUser', { | |||
method: 'POST', | |||
data | |||
}); | |||
@@ -37,7 +38,7 @@ GetReservationUser(data) { | |||
//获取预定商品 | |||
GetReservationGoodsDetailed(data) { | |||
return request('/groupmeal/api/Reservation/GetReservationGoodsDetailed', { | |||
return request(getgroupmealUrl()+'/api/Reservation/GetReservationGoodsDetailed', { | |||
method: 'POST', | |||
data | |||
}); | |||
@@ -45,7 +46,7 @@ GetReservationUser(data) { | |||
//获取预定商品Excel | |||
GetReservationGoodsExcel(data) { | |||
return request('/groupmeal/api/Reservation/GetReservationGoodsExcel', { | |||
return request(getgroupmealUrl()+'/api/Reservation/GetReservationGoodsExcel', { | |||
method: 'POST', | |||
responseType: 'blob', | |||
data | |||
@@ -264,7 +264,7 @@ const GetGateFoodList =async (gateId) => { | |||
const response = await cardAPI.GetAllStore(); | |||
if (response.statusCode == "200") { | |||
setStoreList(response.data); | |||
setSelectedStore(response.data[0].id); | |||
setSelectedStore(response.data[0]?.id); | |||
actionRef.current.reload(); | |||
} else { | |||
message.error(response.msg || '获取场景列表失败'); | |||
@@ -1,10 +1,11 @@ | |||
import { request } from 'umi'; | |||
import { getDataBaseUrl,getgroupmealUrl } from '@/global_data'; | |||
export default { | |||
//获取所有门店 | |||
GetAllStore() { | |||
return request('/groupmeal/api/shop/alllist', { | |||
return request(getgroupmealUrl()+'/api/shop/alllist', { | |||
method: 'GET', | |||
}); | |||
}, | |||
@@ -12,7 +13,7 @@ export default { | |||
//根据门店ID查询 档口分页列表 | |||
GetGateListByStorePage(StoreId, Current, PageSize, TenantId = '') { | |||
return request(`/groupmeal/api/GateInfo/gatelist?StoreId=${StoreId}&Current=${Current}&PageSize=${PageSize}`, { | |||
return request(getgroupmealUrl()+`/api/GateInfo/gatelist?StoreId=${StoreId}&Current=${Current}&PageSize=${PageSize}`, { | |||
method: 'GET', | |||
headers: { | |||
TenantId: TenantId | |||
@@ -23,7 +24,7 @@ export default { | |||
/** 档口管理:Start */ | |||
// 新增档口 | |||
AddGate(data) { | |||
return request(`/groupmeal/api/GateInfo/add`, { | |||
return request(getgroupmealUrl()+`/api/GateInfo/add`, { | |||
method: 'POST', | |||
data | |||
}); | |||
@@ -31,7 +32,7 @@ export default { | |||
//更新档口信息 | |||
UpdateGateInfo(data, TenantId = '') { | |||
return request(`/groupmeal/api/GateInfo/Update`, { | |||
return request(getgroupmealUrl()+`/api/GateInfo/Update`, { | |||
method: 'POST', | |||
data, | |||
headers: { | |||
@@ -42,14 +43,14 @@ export default { | |||
//获取字典数据数据(设备屏幕显示) | |||
GetDicList(TypeCode) { | |||
return request(`/saasbase/api/dictdata/getdiclist?typeCode=`+TypeCode, { | |||
return request(getDataBaseUrl()+`/api/dictdata/getdiclist?typeCode=`+TypeCode, { | |||
method: 'Get', | |||
}); | |||
}, | |||
//添加屏幕显示 | |||
AddGateSetUp(data) { | |||
return request(`/groupmeal/api/GateInfo/AddGateSetUp`, { | |||
return request(getgroupmealUrl()+`/api/GateInfo/AddGateSetUp`, { | |||
method: 'POST', | |||
data | |||
}); | |||
@@ -57,7 +58,7 @@ export default { | |||
//添加屏幕显示 | |||
GetGateSetUp(data) { | |||
return request(`/groupmeal/api/GateInfo/GetGateSetUp`, { | |||
return request(getgroupmealUrl()+`/api/GateInfo/GetGateSetUp`, { | |||
method: 'POST', | |||
data | |||
}); | |||
@@ -65,13 +66,13 @@ export default { | |||
//删除档口 | |||
Del(data) { | |||
return request(`/groupmeal/api/GateInfo/del?id=` + data, { | |||
return request(getgroupmealUrl()+`/api/GateInfo/del?id=` + data, { | |||
method: 'POST', | |||
}); | |||
}, | |||
GetGoodsByMenuIdPage(params) { | |||
return request('/saasbase/api/FoodMenu/GetGoodsByMenuIdPage', { | |||
return request(getDataBaseUrl()+'/api/FoodMenu/GetGoodsByMenuIdPage', { | |||
method: 'get', | |||
data: { | |||
...params, | |||
@@ -80,14 +81,14 @@ export default { | |||
}, | |||
GetGoodsList() { | |||
return request('/saasbase/api/goods/getgoodslist', { | |||
return request(getDataBaseUrl()+'/api/goods/getgoodslist', { | |||
method: 'get', | |||
}); | |||
}, | |||
//设置屏幕显示菜品 | |||
AddGateFood(data) { | |||
return request(`/groupmeal/api/GateInfo/AddGateFood`, { | |||
return request(getgroupmealUrl()+`/api/GateInfo/AddGateFood`, { | |||
method: 'POST', | |||
data | |||
}); | |||
@@ -95,7 +96,7 @@ export default { | |||
//获取设置屏幕显示菜品 | |||
GetGateFoodList(data) { | |||
return request(`/groupmeal/api/GateInfo/GetGateFoodList?gateId=`+data, { | |||
return request(getgroupmealUrl()+`/api/GateInfo/GetGateFoodList?gateId=`+data, { | |||
method: 'get', | |||
data | |||
}); | |||
@@ -158,8 +158,8 @@ const Machine = () => { | |||
const response = await cardAPI.GetAllStore(); | |||
if (response.statusCode == "200") { | |||
setStoreList(response.data); | |||
setSelectedStore(response.data[0].id); | |||
onFetchGateList(response.data[0].id); | |||
setSelectedStore(response.data[0]?.id); | |||
onFetchGateList(response.data[0]?.id); | |||
} else { | |||
message.error(response.msg || '获取店铺列表失败'); | |||
} | |||
@@ -270,7 +270,10 @@ const Machine = () => { | |||
</Button> | |||
]} | |||
/> | |||
<Modal width={600} title={currentOption.id ? '更新' : '新增'} visible={isModalOpen} footer={false} onCancel={() => { setCurrentOption({}); setIsModalOpen(false) }}> | |||
<Modal | |||
width={600} | |||
maskClosable={false} | |||
title={currentOption.id ? '更新' : '新增'} visible={isModalOpen} footer={false} onCancel={() => { setCurrentOption({}); setIsModalOpen(false) }}> | |||
<Form | |||
name="basic" | |||
onFinish={onFinish} | |||
@@ -1,16 +1,17 @@ | |||
import { request } from 'umi'; | |||
import { getDataBaseUrl,getgroupmealUrl } from '@/global_data'; | |||
export default { | |||
//获取所有门店 | |||
GetAllStore() { | |||
return request('/groupmeal/api/shop/alllist', { | |||
return request(getgroupmealUrl()+'/api/shop/alllist', { | |||
method: 'GET', | |||
}); | |||
}, | |||
//根据门店ID查询 档口列表 | |||
GetGateListByStoreList(StoreId) { | |||
return request(`/groupmeal/api/GateInfo/gatealllist?StoreId=${StoreId}`, { | |||
return request(getgroupmealUrl()+`/api/GateInfo/gatealllist?StoreId=${StoreId}`, { | |||
method: 'GET' | |||
}); | |||
}, | |||
@@ -18,7 +19,7 @@ export default { | |||
/** 刷卡机管理:Start */ | |||
// 新增刷卡机 | |||
PayCardAdd(data) { | |||
return request(`/groupmeal/api/PayCard/add`, { | |||
return request(getgroupmealUrl()+`/api/PayCard/add`, { | |||
method: 'POST', | |||
data | |||
}); | |||
@@ -26,7 +27,7 @@ export default { | |||
//刷卡机状态更改 | |||
PayCardEnable(data) { | |||
return request(`/groupmeal/PayCard/enable`, { | |||
return request(getgroupmealUrl()+`/PayCard/enable`, { | |||
method: 'POST', | |||
data | |||
}); | |||
@@ -34,14 +35,14 @@ export default { | |||
//根据档口信息查询刷卡机列表 | |||
PayCardByGateId(GateId, Current, PageSize) { | |||
return request(`/groupmeal/api/PayCard/gateList?GateId=${GateId}&Current=${Current}&PageSize=${PageSize}`, { | |||
return request(getgroupmealUrl()+`/api/PayCard/gateList?GateId=${GateId}&Current=${Current}&PageSize=${PageSize}`, { | |||
method: 'GET' | |||
}); | |||
}, | |||
//更新刷卡机信息 | |||
UpdatePayCardInfo(data) { | |||
return request(`/groupmeal/api/PayCard/update`, { | |||
return request(getgroupmealUrl()+`/api/PayCard/update`, { | |||
method: 'POST', | |||
data | |||
}); | |||
@@ -49,7 +50,7 @@ export default { | |||
//删除刷卡机 | |||
DelPayCard(data) { | |||
return request(`/groupmeal/api/PayCard/del?id=`+data, { | |||
return request(getgroupmealUrl()+`/api/PayCard/del?id=`+data, { | |||
method: 'POST', | |||
}); | |||
}, | |||
@@ -1,9 +1,10 @@ | |||
import { request } from 'umi'; | |||
import { getDataBaseUrl,getgroupmealUrl } from '@/global_data'; | |||
export default { | |||
//获取会员账户列表 | |||
GetMemberAccountPageList(data) { | |||
return request(`/groupmeal/api/MemberInfoService/GetMemberAccountPageList`, { | |||
return request(getgroupmealUrl()+`/api/MemberInfoService/GetMemberAccountPageList`, { | |||
method: 'POST', | |||
data: data, | |||
}); | |||
@@ -11,7 +12,7 @@ export default { | |||
//查询会员账户/卡号消费记录 | |||
GetMemberAccountCardConsRecord(data) { | |||
return request('/groupmeal/api/StoredValueCard/GetMemberAccountAmountPage', { | |||
return request(getgroupmealUrl()+'/api/StoredValueCard/GetMemberAccountAmountPage', { | |||
method: 'POST', | |||
data, | |||
}); | |||
@@ -19,7 +20,7 @@ export default { | |||
//获取会员信息 | |||
GetMemberPageQuery(data) { | |||
return request(`/groupmeal/api/StoredValueCard/GetMemberPageQuery`, { | |||
return request(getgroupmealUrl()+`/api/StoredValueCard/GetMemberPageQuery`, { | |||
method: 'post', | |||
data: data, | |||
}); | |||
@@ -27,7 +28,7 @@ export default { | |||
//添加会员 | |||
CreateMemberInfo(data) { | |||
return request(`/groupmeal/api/StoredValueCard/AddMember`, { | |||
return request(getgroupmealUrl()+`/api/StoredValueCard/AddMember`, { | |||
method: 'post', | |||
data: data, | |||
}); | |||
@@ -35,8 +36,7 @@ export default { | |||
//获取会员标签 和绑定详情 | |||
GetMemberTagAndInfo(memberinfoid, platformtype) { | |||
return request( | |||
`/groupmeal/api/StoredValueCard/GetMemberTagAndInfo?memberInfoId=${memberinfoid}&PlatformType=${platformtype}`, | |||
return request(getgroupmealUrl()+`/api/StoredValueCard/GetMemberTagAndInfo?memberInfoId=${memberinfoid}&PlatformType=${platformtype}`, | |||
{ | |||
method: 'get', | |||
}, | |||
@@ -45,7 +45,7 @@ export default { | |||
//获取会员 | |||
GetPlatformMemberList(data) { | |||
return request(`/groupmeal/api/StoredValueCard/GetPlatformMemberList?memberId=${data}`, { | |||
return request(getgroupmealUrl()+`/api/StoredValueCard/GetPlatformMemberList?memberId=${data}`, { | |||
method: 'get', | |||
}); | |||
}, | |||
@@ -282,6 +282,7 @@ const storedValueCard = () => { | |||
/> | |||
<Modal | |||
width={600} | |||
maskClosable={false} | |||
title={currentOption.id ? '编辑储值卡' : '添加储值卡'} | |||
visible={isModalOpen} | |||
footer={false} | |||
@@ -1,9 +1,10 @@ | |||
import { request } from 'umi'; | |||
import { getDataBaseUrl,getgroupmealUrl } from '@/global_data'; | |||
export default { | |||
//获取会员储值卡列表 | |||
GetMemberCardPageList(data) { | |||
return request(`/groupmeal/api/StoredValueCard/GetMmenberCardPage`, { | |||
return request(getgroupmealUrl()+`/api/StoredValueCard/GetMmenberCardPage`, { | |||
method: 'POST', | |||
data: data, | |||
}); | |||
@@ -11,7 +12,7 @@ export default { | |||
//添加会员储值卡 | |||
AddMemberCard(data) { | |||
return request(`/groupmeal/api/StoredValueCard/AddMmenberCard`, { | |||
return request(getgroupmealUrl()+`/api/StoredValueCard/AddMmenberCard`, { | |||
method: 'POST', | |||
data: data, | |||
}); | |||
@@ -19,7 +20,7 @@ export default { | |||
//修改会员卡状态 | |||
UpdateMemberCardState(data) { | |||
return request(`/groupmeal/api/StoredValueCard/UpdateMmenberCardState`, { | |||
return request(getgroupmealUrl()+`/api/StoredValueCard/UpdateMmenberCardState`, { | |||
method: 'PUT', | |||
data: data, | |||
}); | |||
@@ -27,7 +28,7 @@ export default { | |||
//获取会员分页 | |||
GetMemberListByPage(data) { | |||
return request('/groupmeal/api/MemberInfoService/GetMemberPageQuery', { | |||
return request(getgroupmealUrl()+'/api/MemberInfoService/GetMemberPageQuery', { | |||
method: 'POST', | |||
data, | |||
}); | |||
@@ -35,7 +36,7 @@ export default { | |||
//绑定会员 | |||
OnBindMember(data) { | |||
return request('/groupmeal/api/StoredValueCard/MemberBindingCards', { | |||
return request(getgroupmealUrl()+'/api/StoredValueCard/MemberBindingCards', { | |||
method: 'POST', | |||
data, | |||
}); | |||
@@ -216,7 +216,9 @@ const app = () => { | |||
<Modal width={600} title={current.id ? "更新" : "新增"} open={isModalOpen} onOk={form.submit} onCancel={() => { form.resetFields(); setIsModalOpen(false); }}> | |||
<Modal width={600} | |||
maskClosable={false} | |||
title={current.id ? "更新" : "新增"} open={isModalOpen} onOk={form.submit} onCancel={() => { form.resetFields(); setIsModalOpen(false); }}> | |||
<Form | |||
@@ -1,37 +1,38 @@ | |||
import { request } from 'umi'; | |||
import { getDataBaseUrl,getgroupmealUrl } from '@/global_data'; | |||
export default { | |||
Page(data) { | |||
return request(`/groupmeal/api/shop/page`, { | |||
return request(getgroupmealUrl()+`/api/shop/page`, { | |||
method: 'Post', | |||
data: data, | |||
}); | |||
}, | |||
Add(data) { | |||
return request(`/groupmeal/api/shop`, { | |||
return request(getgroupmealUrl()+`/api/shop`, { | |||
method: 'Post', | |||
data: data, | |||
}); | |||
}, | |||
Update(data) { | |||
return request(`/groupmeal/api/shop`, { | |||
return request(getgroupmealUrl()+`/api/shop`, { | |||
method: 'PUT', | |||
data: data, | |||
}); | |||
}, | |||
Del(data) { | |||
return request(`/groupmeal//api/shop/del/`+data, { | |||
return request(getgroupmealUrl()+`//api/shop/del/`+data, { | |||
method: 'Post', | |||
}); | |||
}, | |||
//获取组织列表 | |||
GetOrgList(data) { | |||
return request(`/saasbase/api/organize/getorglist`, { | |||
return request(getDataBaseUrl()+`/api/organize/getorglist`, { | |||
method: 'Post', | |||
data: data, | |||
}); | |||
@@ -39,7 +40,7 @@ export default { | |||
//获取组织树 | |||
GetOrgtree() { | |||
return request(`/saasbase/api/organize/tree`, { | |||
return request(getDataBaseUrl()+`/api/organize/tree`, { | |||
method: 'get', | |||
}); | |||
}, | |||
@@ -2,12 +2,13 @@ | |||
/* eslint-disable */ | |||
import { request } from 'umi'; | |||
import { getgroupmealorderUrl,getgroupmealUrl } from '@/global_data'; | |||
export default { | |||
/** 获取订单流水信息*/ | |||
orderList(data) { | |||
data.isreport = true; | |||
return request(`/groupmealorder/api/Order/PostDetail`, { | |||
return request(getgroupmealorderUrl()+`/api/Order/PostDetail`, { | |||
method: 'Post', | |||
data: data, | |||
// params: { ...params }, | |||
@@ -19,13 +20,13 @@ export default { | |||
* 查询店铺信息(设备信息) | |||
*/ | |||
srdList(data) { | |||
return request('/groupmeal/api/shop/alllist', { | |||
return request(getgroupmealUrl()+'/api/shop/alllist', { | |||
method: 'GET' | |||
}); | |||
}, | |||
GetOrderDetails(data) { | |||
return request(`/groupmealorder/api/Order/GetFlowExport`, { | |||
return request(getgroupmealorderUrl()+`/api/Order/GetFlowExport`, { | |||
method: 'Post', | |||
data: data | |||
@@ -2,35 +2,36 @@ | |||
/* eslint-disable */ | |||
import { request } from 'umi'; | |||
import { getgroupmealorderUrl,getgroupmealUrl } from '@/global_data'; | |||
export default { | |||
page(data) { | |||
data.isreport = true; | |||
return request(`/groupmealorder/api/ThirdAuthorize/Page`, { | |||
return request(getgroupmealorderUrl()+`/api/ThirdAuthorize/Page`, { | |||
method: 'Post', | |||
data: data, | |||
}); | |||
}, | |||
GetAllStore() { | |||
return request('/groupmeal/api/shop/alllist', { | |||
return request(getgroupmealUrl()+'/api/shop/alllist', { | |||
method: 'GET' | |||
}); | |||
}, | |||
Create(data) { | |||
return request('/groupmealorder/api/ThirdAuthorize/Create', { | |||
return request(getgroupmealorderUrl()+'/api/ThirdAuthorize/Create', { | |||
method: 'Post', | |||
data: data, | |||
}); | |||
}, | |||
Update(data) { | |||
return request('/groupmealorder/api/ThirdAuthorize/Update', { | |||
return request(getgroupmealorderUrl()+'/api/ThirdAuthorize/Update', { | |||
method: 'Post', | |||
data: data, | |||
}); | |||
}, | |||
Del(data) { | |||
return request('/groupmealorder/api/ThirdAuthorize/Del?id='+data, { | |||
return request(getgroupmealorderUrl()+'/api/ThirdAuthorize/Del?id='+data, { | |||
method: 'Post', | |||
}); | |||
}, | |||
@@ -2,19 +2,20 @@ | |||
/* eslint-disable */ | |||
import { request } from 'umi'; | |||
import { getgroupmealorderUrl,getgroupmealUrl } from '@/global_data'; | |||
export default { | |||
page(data) { | |||
data.isreport = true; | |||
return request(`/groupmealorder/api/Order/ThirdOrderPage`, { | |||
return request(getgroupmealorderUrl()+`/api/Order/ThirdOrderPage`, { | |||
method: 'Post', | |||
data: data, | |||
}); | |||
}, | |||
getThirdOrderInfo(data) { | |||
return request(`/groupmealorder/api/Order/GetThirdOrderInfo?thirdOrderId=`+data, { | |||
return request(getgroupmealorderUrl()+`/api/Order/GetThirdOrderInfo?thirdOrderId=`+data, { | |||
method: 'get', | |||
}); | |||
}, | |||
@@ -26,7 +27,7 @@ export default { | |||
/** 获取订单流水信息*/ | |||
orderList(data) { | |||
data.isreport = true; | |||
return request(`/groupmealorder/api/Order/PostDetail`, { | |||
return request(getgroupmealorderUrl()+`/api/Order/PostDetail`, { | |||
method: 'Post', | |||
data: data, | |||
// params: { ...params }, | |||
@@ -38,13 +39,13 @@ export default { | |||
* 查询店铺信息(设备信息) | |||
*/ | |||
srdList(data) { | |||
return request('/groupmealorder/api/shop/alllist', { | |||
return request(getgroupmealorderUrl()+'/api/shop/alllist', { | |||
method: 'GET' | |||
}); | |||
}, | |||
GetFlowExport(data) { | |||
return request(`/groupmealorder/api/Order/GetFlowExport`, { | |||
return request(getgroupmealorderUrl()+`/api/Order/GetFlowExport`, { | |||
method: 'Post', | |||
data: data | |||
@@ -53,6 +53,7 @@ const PushFrom = (props) => { | |||
] | |||
return ( | |||
<Modal | |||
maskClosable={false} | |||
title={'下发数据'} | |||
width={1040} | |||
visible={props.createModalVisible} | |||
@@ -1,5 +1,5 @@ | |||
import { PlusOutlined } from '@ant-design/icons'; | |||
import { Button, message, Input, Drawer, Popconfirm,Typography} from 'antd'; | |||
import { Button, message, Input, Drawer, Popconfirm, Typography } from 'antd'; | |||
import React, { useState, useRef, useEffect } from 'react'; | |||
import { PageContainer, FooterToolbar } from '@ant-design/pro-layout'; | |||
import ProTable from '@ant-design/pro-table'; | |||
@@ -7,9 +7,9 @@ import ProDescriptions from '@ant-design/pro-descriptions'; | |||
import PushFrom from './components/PushFrom'; | |||
import { | |||
GetDevicePushRecodePage, | |||
DevicePushRecodeAdd, | |||
DevicePushRecodeDelete | |||
GetDevicePushRecodePage, | |||
DevicePushRecodeAdd, | |||
DevicePushRecodeDelete | |||
} from './services'; | |||
@@ -22,12 +22,12 @@ const goodspush = () => { | |||
const actionRef = useRef(); | |||
const [currentRow, setCurrentRow] = useState(); | |||
const [selectedRowsState, setSelectedRows] = useState([]); | |||
const { Paragraph } = Typography; | |||
const { Paragraph } = Typography; | |||
/** 国际化修改 */ | |||
useEffect(() => { | |||
}, []); | |||
/** | |||
@@ -35,7 +35,7 @@ const { Paragraph } = Typography; | |||
* | |||
* @param selectedRows | |||
*/ | |||
const handleRemove = async (selectedRows) => { | |||
const hide = message.loading('正在删除'); | |||
if (!selectedRows) return true; | |||
@@ -77,17 +77,17 @@ const { Paragraph } = Typography; | |||
ellipsis: true, | |||
}, | |||
{ | |||
title: '下发数据', | |||
dataIndex: 'type', | |||
ellipsis: true, | |||
valueEnum: { | |||
2: { | |||
text: '物料', | |||
}, | |||
}, | |||
}, | |||
// { | |||
// title: '下发数据', | |||
// dataIndex: 'type', | |||
// ellipsis: true, | |||
// valueEnum: { | |||
// 2: { | |||
// text: '物料', | |||
// }, | |||
// }, | |||
// }, | |||
{ | |||
title: '下发时间', | |||
dataIndex: 'createAt', | |||
@@ -107,40 +107,40 @@ const { Paragraph } = Typography; | |||
> | |||
下发详情 | |||
</a>, | |||
<Popconfirm | |||
type="primary" | |||
key="primary" | |||
title="确认删除吗?" | |||
okText="是" | |||
cancelText="否" | |||
onConfirm={async () => { | |||
await DeleteGoodsType(record.id).then((r) => { | |||
if (r.succeeded) { | |||
message.success('删除成功'); | |||
actionRef.current.reload(); | |||
} else { | |||
message.error(r.errors); | |||
} | |||
}); | |||
}} | |||
onCancel={() => {}} | |||
> | |||
<a href="#">删除</a> | |||
</Popconfirm>, | |||
// <Popconfirm | |||
// type="primary" | |||
// key="primary" | |||
// title="确认删除吗?" | |||
// okText="是" | |||
// cancelText="否" | |||
// onConfirm={async () => { | |||
// await DeleteGoodsType(record.id).then((r) => { | |||
// if (r.succeeded) { | |||
// message.success('删除成功'); | |||
// actionRef.current.reload(); | |||
// } else { | |||
// message.error(r.errors); | |||
// } | |||
// }); | |||
// }} | |||
// onCancel={() => { }} | |||
// > | |||
// <a href="#">删除</a> | |||
// </Popconfirm>, | |||
], | |||
}, | |||
]; | |||
const HandleOk= async(values)=>{ | |||
await DevicePushRecodeAdd(values).then((res)=>{ | |||
if(res.data){ | |||
message.success('操作成功'); | |||
handleModalVisible(false); | |||
actionRef.current.reload(); | |||
}else{ | |||
message.error(res.errors); | |||
} | |||
}) | |||
} | |||
const HandleOk = async (values) => { | |||
await DevicePushRecodeAdd(values).then((res) => { | |||
if (res.data) { | |||
message.success('操作成功'); | |||
handleModalVisible(false); | |||
actionRef.current.reload(); | |||
} else { | |||
message.error(res.errors); | |||
} | |||
}) | |||
} | |||
return ( | |||
<PageContainer host header={{ | |||
title: '', | |||
@@ -168,7 +168,7 @@ const HandleOk= async(values)=>{ | |||
request={async (params) => { | |||
var goodsData = []; | |||
var total = 0; | |||
params.type=2 | |||
params.type = 2 | |||
await GetDevicePushRecodePage(params).then((r) => { | |||
goodsData = r.data.data; | |||
total = r.data.total; | |||
@@ -220,7 +220,7 @@ const HandleOk= async(values)=>{ | |||
<PushFrom | |||
onFinish={async (value) => { | |||
}} | |||
onCancel={() => { | |||
handleModalVisible(false); | |||
@@ -244,18 +244,18 @@ const HandleOk= async(values)=>{ | |||
<ProDescriptions | |||
column={1} | |||
title="下发详情" | |||
> | |||
<ProDescriptions.Item label="下发设备" valueType="text"> | |||
<ProDescriptions.Item label="下发设备" valueType="text"> | |||
{currentRow?.deviceName} | |||
</ProDescriptions.Item> | |||
<ProDescriptions.Item label="topic" valueType="text" copyable={true}> | |||
<Paragraph copyable>{currentRow?.topic}</Paragraph> | |||
</ProDescriptions.Item> | |||
<ProDescriptions.Item contentStyle={{ maxWidth: '85%'}} label="下发数据" valueType="jsonCode" > | |||
</ProDescriptions.Item> | |||
<ProDescriptions.Item label="topic" valueType="text" > | |||
<Paragraph copyable>{currentRow?.topic}</Paragraph> | |||
</ProDescriptions.Item> | |||
<ProDescriptions.Item contentStyle={{ maxWidth: '85%' }} label="下发数据" valueType="jsonCode" > | |||
{currentRow?.dataResore} | |||
</ProDescriptions.Item> | |||
</ProDescriptions> | |||
</ProDescriptions.Item> | |||
</ProDescriptions> | |||
)} | |||
</Drawer> | |||
</PageContainer> | |||
@@ -1,39 +1,39 @@ | |||
import { request } from 'umi'; | |||
import { getDataBaseUrl,getgroupmealUrl } from '@/global_data'; | |||
export async function GetDevicePushRecodePage(data) { | |||
return request(`/groupmeal/api/devicepushrecode/page`, { | |||
return request(getgroupmealUrl()+`/api/devicepushrecode/page`, { | |||
method: 'POST', | |||
data: data, | |||
}); | |||
} | |||
export async function DevicePushRecodeAdd(data) { | |||
return request(`/groupmeal/api/devicepushrecode/add`, { | |||
return request(getgroupmealUrl()+`/api/devicepushrecode/add`, { | |||
method: 'POST', | |||
data: data, | |||
}); | |||
} | |||
export async function DevicePushRecodeUpdate(data) { | |||
return request(`/groupmeal/api/devicepushrecode/update`, { | |||
return request(getgroupmealUrl()+`/api/devicepushrecode/update`, { | |||
method: 'POST', | |||
data: data, | |||
}); | |||
} | |||
export async function DevicePushRecodeDelete(data) { | |||
return request(`/groupmeal/api/devicepushrecode/delete`, { | |||
return request(getgroupmealUrl()+`/api/devicepushrecode/delete`, { | |||
method: 'POST', | |||
data: data, | |||
}); | |||
} | |||
export async function GetDeviceList() { | |||
return request(`/saasbase/api/device/list`, { | |||
return request(getDataBaseUrl()+`/api/device/list`, { | |||
method: 'GET', | |||
}); | |||
} | |||
export async function GetBatchingPage(data) { | |||
return request(`/saasbase/api/batching/getpage`, { | |||
return request(getDataBaseUrl()+`/api/batching/getpage`, { | |||
method: 'Post', | |||
data: data, | |||
// params: { ...params }, | |||
// ...(options || {}), | |||
}); | |||
} |
@@ -1,5 +1,5 @@ | |||
import React, { useState, useEffect,useRef } from 'react'; | |||
import { Modal, Row, Col, Checkbox, Select,message,Switch} from 'antd'; | |||
import React, { useState, useEffect, useRef } from 'react'; | |||
import { Modal, Row, Col, Checkbox, Select, message, Switch } from 'antd'; | |||
import ProTable from '@ant-design/pro-table'; | |||
import { | |||
GetDeviceList, | |||
@@ -9,7 +9,7 @@ import { | |||
const PushFrom = (props) => { | |||
const [deviceData, setdeviceData] = useState([]); | |||
const [selectedRowsState, setSelectedRows] = useState([]); | |||
const [dataSource,setdataSource]= useState([]); | |||
const [dataSource, setdataSource] = useState([]); | |||
const [treeData, setTreeData] = useState(); | |||
const [DeviceIds, setDeviceIds] = useState(); | |||
const [DeviceInfo, setDeviceInfo] = useState([]); | |||
@@ -17,66 +17,67 @@ const PushFrom = (props) => { | |||
const actionRef = useRef(); | |||
useEffect(() => { | |||
console.log(props.values) | |||
GetDeviceList().then((r)=>{ | |||
GetDeviceList().then((r) => { | |||
setDeviceInfo(r.data) | |||
var data=r.data.map(x=>{ | |||
return {value:x.id,label:x.name} | |||
}) | |||
setdeviceData(data) | |||
var data = r.data.map(x => { | |||
return { value: x.id, label: x.name } | |||
}) | |||
setdeviceData(data) | |||
}) | |||
GetGoodsTypeTree().then((r) => { | |||
setTreeData(r.data); | |||
}); | |||
var params={current:1,pageSize:10} | |||
GetGoodsData(params) | |||
},[props.values]) | |||
const GetGoodsData=(params)=>{ | |||
setTreeData(r.data); | |||
}); | |||
var params = { current: 1, pageSize: 10 } | |||
GetGoodsData(params) | |||
}, [props.values]) | |||
const GetGoodsData = (params) => { | |||
GetGoodsPage(params).then((r) => { | |||
setdataSource(r.data.data); | |||
//console.log(goodsData) | |||
//total = r.data.total; | |||
}); | |||
setdataSource(r.data.data); | |||
//console.log(goodsData) | |||
//total = r.data.total; | |||
}); | |||
} | |||
const handleChange=(value)=>{ | |||
const handleChange = (value) => { | |||
setDeviceIds(value) | |||
var params={current:1,pageSize:10,deviceId:value} | |||
var params = { current: 1, pageSize: 10, deviceId: value } | |||
GetGoodsData(params) | |||
} | |||
const onChange=(checked)=>{ | |||
if(!DeviceIds){ | |||
message.error('请先选择设备'); | |||
}else{ | |||
setisGlogy(checked) | |||
} | |||
} | |||
const columns=[ | |||
const onChange = (checked) => { | |||
if (!DeviceIds) { | |||
message.error('请先选择设备'); | |||
} else { | |||
setisGlogy(checked) | |||
} | |||
} | |||
const columns = [ | |||
{ | |||
title: '编码', | |||
dataIndex: 'code', | |||
valueType: 'textarea', | |||
hideInTable: true, | |||
hideInSearch: true, | |||
}, | |||
{ | |||
title: '名称', | |||
dataIndex: 'name', | |||
valueType: 'textarea', | |||
}, | |||
{ | |||
title: '商品类型', | |||
dataIndex: 'goodsTypeName', | |||
valueType: 'treeSelect', | |||
fieldProps: { | |||
showSearch:true, | |||
allowClear:true, | |||
options: treeData | |||
}, | |||
title: '编码', | |||
dataIndex: 'code', | |||
valueType: 'textarea', | |||
hideInTable: true, | |||
hideInSearch: true, | |||
}, | |||
{ | |||
title: '名称', | |||
dataIndex: 'name', | |||
valueType: 'textarea', | |||
}, | |||
{ | |||
title: '商品类型', | |||
dataIndex: 'goodsTypeName', | |||
valueType: 'treeSelect', | |||
fieldProps: { | |||
showSearch: true, | |||
allowClear: true, | |||
options: treeData | |||
}, | |||
] | |||
}, | |||
] | |||
return ( | |||
<Modal | |||
maskClosable={false} | |||
title={'下发数据'} | |||
width={1040} | |||
visible={props.createModalVisible} | |||
@@ -84,16 +85,16 @@ const PushFrom = (props) => { | |||
okText="确定" | |||
cancelText="取消" | |||
onOk={() => { | |||
if(!DeviceIds){ | |||
if (!DeviceIds) { | |||
message.error('请选择设备'); | |||
}else{ | |||
var de=DeviceInfo.find(x=>x.id==DeviceIds); | |||
var data={goodsinfo:[]}; | |||
} else { | |||
var de = DeviceInfo.find(x => x.id == DeviceIds); | |||
var data = { goodsinfo: [] }; | |||
// if(isGlogy){ | |||
// data.goodstechnology=[] | |||
// } | |||
selectedRowsState.map(x=>{ | |||
var pa={id:x.id,code:x.code,goodsTypeId:x.goodsTypeId,goodsTypeName:x.goodsTypeName,goodsUintId:x.goodsUintId,imgUrl:x.imgUrl,isAttrubute:x.isAttrubute,name:x.name,price:x.price,design:x.design,remark:x.remark} | |||
selectedRowsState.map(x => { | |||
var pa = { id: x.id, code: x.code, goodsTypeId: x.goodsTypeId, goodsTypeName: x.goodsTypeName, goodsUintId: x.goodsUintId, imgUrl: x.imgUrl, isAttrubute: x.isAttrubute, name: x.name, price: x.price, design: x.design, remark: x.remark } | |||
data.goodsinfo.push(pa); | |||
// if(isGlogy){ | |||
// //data.goodstechnology=[] | |||
@@ -102,7 +103,7 @@ const PushFrom = (props) => { | |||
// } | |||
// } | |||
}) | |||
var parm={deviceId:de.id,deviceName:de.name,deviceAutoKey:de.autoKey,type:1,data:data} | |||
var parm = { deviceId: de.id, deviceName: de.name, deviceAutoKey: de.autoKey, type: 1, data: data } | |||
props.HandleOk(parm) | |||
console.log(de) | |||
} | |||
@@ -112,48 +113,48 @@ const PushFrom = (props) => { | |||
}} | |||
destroyOnClose | |||
> | |||
<Row gutter={26} style={{marginBottom:20}}> | |||
<Col lg={24} md={24} sm={24}> | |||
选择设备: | |||
<Select | |||
allowClear | |||
style={{width: '60%'}} | |||
placeholder="请选择要下发设备" | |||
onChange={handleChange} | |||
options={deviceData} | |||
/> | |||
</Col> | |||
</Row> | |||
{/* <Row style={{marginBottom:20}}> | |||
<Row gutter={26} style={{ marginBottom: 20 }}> | |||
<Col lg={24} md={24} sm={24}> | |||
选择设备: | |||
<Select | |||
allowClear | |||
style={{ width: '60%' }} | |||
placeholder="请选择要下发设备" | |||
onChange={handleChange} | |||
options={deviceData} | |||
/> | |||
</Col> | |||
</Row> | |||
{/* <Row style={{marginBottom:20}}> | |||
<Col lg={24} md={24} sm={24}> | |||
是否包含工艺: | |||
<Switch checkedChildren="是" unCheckedChildren="否" checked={isGlogy} value={isGlogy} onChange={onChange} /> | |||
</Col> | |||
</Row> */} | |||
<Row gutter={26}> | |||
<Col span={24}> | |||
选择数据: | |||
<ProTable | |||
headerTitle="" | |||
actionRef={actionRef} | |||
rowKey="id" | |||
pagination={{ defaultPageSize: 10 }} | |||
search={{ | |||
labelWidth: 120, | |||
}} | |||
dataSource={dataSource} | |||
columns={columns} | |||
rowSelection={{ | |||
onChange: (_, selectedRows) => { | |||
setSelectedRows(selectedRows); | |||
}, | |||
}} | |||
> | |||
<Row gutter={26}> | |||
<Col span={24}> | |||
选择数据: | |||
<ProTable | |||
headerTitle="" | |||
actionRef={actionRef} | |||
rowKey="id" | |||
pagination={{ defaultPageSize: 10 }} | |||
search={{ | |||
labelWidth: 120, | |||
}} | |||
dataSource={dataSource} | |||
columns={columns} | |||
rowSelection={{ | |||
onChange: (_, selectedRows) => { | |||
setSelectedRows(selectedRows); | |||
}, | |||
}} | |||
> | |||
</ProTable> | |||
</Col> | |||
</Row> | |||
</Col> | |||
</Row> | |||
</Modal> | |||
); | |||
}; | |||
@@ -76,17 +76,17 @@ const goodspush = () => { | |||
ellipsis: true, | |||
}, | |||
{ | |||
title: '下发数据', | |||
dataIndex: 'type', | |||
ellipsis: true, | |||
valueEnum: { | |||
1: { | |||
text: '商品', | |||
}, | |||
// { | |||
// title: '下发数据', | |||
// dataIndex: 'type', | |||
// ellipsis: true, | |||
// valueEnum: { | |||
// 1: { | |||
// text: '商品', | |||
// }, | |||
}, | |||
}, | |||
// }, | |||
// }, | |||
{ | |||
title: '下发时间', | |||
dataIndex: 'createAt', | |||
@@ -106,26 +106,26 @@ const goodspush = () => { | |||
> | |||
下发详情 | |||
</a>, | |||
<Popconfirm | |||
type="primary" | |||
key="primary" | |||
title="确认删除吗?" | |||
okText="是" | |||
cancelText="否" | |||
onConfirm={async () => { | |||
await DeleteGoodsType(record.id).then((r) => { | |||
if (r.succeeded) { | |||
message.success('删除成功'); | |||
actionRef.current.reload(); | |||
} else { | |||
message.error(r.errors); | |||
} | |||
}); | |||
}} | |||
onCancel={() => {}} | |||
> | |||
<a href="#">删除</a> | |||
</Popconfirm>, | |||
// <Popconfirm | |||
// type="primary" | |||
// key="primary" | |||
// title="确认删除吗?" | |||
// okText="是" | |||
// cancelText="否" | |||
// onConfirm={async () => { | |||
// await DeleteGoodsType(record.id).then((r) => { | |||
// if (r.succeeded) { | |||
// message.success('删除成功'); | |||
// actionRef.current.reload(); | |||
// } else { | |||
// message.error(r.errors); | |||
// } | |||
// }); | |||
// }} | |||
// onCancel={() => {}} | |||
// > | |||
// <a href="#">删除</a> | |||
// </Popconfirm>, | |||
], | |||
}, | |||
]; | |||
@@ -248,7 +248,7 @@ const HandleOk= async(values)=>{ | |||
<ProDescriptions.Item label="下发设备" valueType="text"> | |||
{currentRow?.deviceName} | |||
</ProDescriptions.Item> | |||
<ProDescriptions.Item label="topic" valueType="text" copyable={true}> | |||
<ProDescriptions.Item label="topic" valueType="text"> | |||
<Paragraph copyable>{currentRow?.topic}</Paragraph> | |||
</ProDescriptions.Item> | |||
<ProDescriptions.Item contentStyle={{ maxWidth: '85%'}} label="下发数据" valueType="jsonCode" > | |||
@@ -1,24 +1,26 @@ | |||
import { request } from 'umi'; | |||
import { getDataBaseUrl,getgroupmealUrl } from '@/global_data'; | |||
export async function GetDevicePushRecodePage(data) { | |||
return request(`/groupmeal/api/devicepushrecode/page`, { | |||
return request(getgroupmealUrl()+`/api/devicepushrecode/page`, { | |||
method: 'POST', | |||
data: data, | |||
}); | |||
} | |||
export async function DevicePushRecodeAdd(data) { | |||
return request(`/groupmeal/api/devicepushrecode/add`, { | |||
return request(getgroupmealUrl()+`/api/devicepushrecode/add`, { | |||
method: 'POST', | |||
data: data, | |||
}); | |||
} | |||
export async function DevicePushRecodeUpdate(data) { | |||
return request(`/groupmeal/api/devicepushrecode/update`, { | |||
return request(getgroupmealUrl()+`/api/devicepushrecode/update`, { | |||
method: 'POST', | |||
data: data, | |||
}); | |||
} | |||
export async function DevicePushRecodeDelete(data) { | |||
return request(`/groupmeal/api/devicepushrecode/delete`, { | |||
return request(getgroupmealUrl()+`/api/devicepushrecode/delete`, { | |||
method: 'POST', | |||
data: data, | |||
}); | |||
@@ -29,7 +31,7 @@ export async function GetDevicePushRecodePage(data) { | |||
}); | |||
} | |||
export async function GetGoodsTypeTree(params) { | |||
return request('/saasbase/api/goodstype/tree', { | |||
return request(getDataBaseUrl()+'/api/goodstype/tree', { | |||
method: 'GET', | |||
data: { | |||
...params, | |||
@@ -37,7 +39,7 @@ export async function GetDevicePushRecodePage(data) { | |||
}); | |||
} | |||
export async function GetGoodsPage(data) { | |||
return request(`/saasbase/api/goods/page`, { | |||
return request(getDataBaseUrl()+`/api/goods/page`, { | |||
method: 'Post', | |||
data: data, | |||
// params: { ...params }, | |||
@@ -1,5 +1,5 @@ | |||
import React, { useState, useEffect,useRef } from 'react'; | |||
import { Modal, Row, Col, Checkbox, Select,message,Switch} from 'antd'; | |||
import React, { useState, useEffect, useRef } from 'react'; | |||
import { Modal, Row, Col, Checkbox, Select, message, Switch } from 'antd'; | |||
import ProTable from '@ant-design/pro-table'; | |||
import { | |||
GetDeviceList, | |||
@@ -9,7 +9,7 @@ import { | |||
const PushFrom = (props) => { | |||
const [deviceData, setdeviceData] = useState([]); | |||
const [selectedRowsState, setSelectedRows] = useState([]); | |||
const [dataSource,setdataSource]= useState([]); | |||
const [dataSource, setdataSource] = useState([]); | |||
const [treeData, setTreeData] = useState(); | |||
const [DeviceIds, setDeviceIds] = useState(); | |||
const [DeviceInfo, setDeviceInfo] = useState([]); | |||
@@ -17,66 +17,67 @@ const PushFrom = (props) => { | |||
const actionRef = useRef(); | |||
useEffect(() => { | |||
console.log(props.values) | |||
GetDeviceList().then((r)=>{ | |||
GetDeviceList().then((r) => { | |||
setDeviceInfo(r.data) | |||
var data=r.data.map(x=>{ | |||
return {value:x.id,label:x.name} | |||
}) | |||
setdeviceData(data) | |||
var data = r.data.map(x => { | |||
return { value: x.id, label: x.name } | |||
}) | |||
setdeviceData(data) | |||
}) | |||
GetGoodsTypeTree().then((r) => { | |||
setTreeData(r.data); | |||
}); | |||
var params={current:1,pageSize:10} | |||
GetGoodsData(params) | |||
},[props.values]) | |||
const GetGoodsData=(params)=>{ | |||
setTreeData(r.data); | |||
}); | |||
var params = { current: 1, pageSize: 10 } | |||
GetGoodsData(params) | |||
}, [props.values]) | |||
const GetGoodsData = (params) => { | |||
GetGoodsPage(params).then((r) => { | |||
setdataSource(r.data.data); | |||
//console.log(goodsData) | |||
//total = r.data.total; | |||
}); | |||
setdataSource(r.data.data); | |||
//console.log(goodsData) | |||
//total = r.data.total; | |||
}); | |||
} | |||
const handleChange=(value)=>{ | |||
const handleChange = (value) => { | |||
setDeviceIds(value) | |||
var params={current:1,pageSize:10,deviceId:value} | |||
var params = { current: 1, pageSize: 10, deviceId: value } | |||
GetGoodsData(params) | |||
} | |||
const onChange=(checked)=>{ | |||
if(!DeviceIds){ | |||
message.error('请先选择设备'); | |||
}else{ | |||
setisGlogy(checked) | |||
} | |||
} | |||
const columns=[ | |||
const onChange = (checked) => { | |||
if (!DeviceIds) { | |||
message.error('请先选择设备'); | |||
} else { | |||
setisGlogy(checked) | |||
} | |||
} | |||
const columns = [ | |||
{ | |||
title: '编码', | |||
dataIndex: 'code', | |||
valueType: 'textarea', | |||
hideInTable: true, | |||
hideInSearch: true, | |||
}, | |||
{ | |||
title: '名称', | |||
dataIndex: 'name', | |||
valueType: 'textarea', | |||
}, | |||
{ | |||
title: '商品类型', | |||
dataIndex: 'goodsTypeName', | |||
valueType: 'treeSelect', | |||
fieldProps: { | |||
showSearch:true, | |||
allowClear:true, | |||
options: treeData | |||
}, | |||
title: '编码', | |||
dataIndex: 'code', | |||
valueType: 'textarea', | |||
hideInTable: true, | |||
hideInSearch: true, | |||
}, | |||
{ | |||
title: '名称', | |||
dataIndex: 'name', | |||
valueType: 'textarea', | |||
}, | |||
{ | |||
title: '商品类型', | |||
dataIndex: 'goodsTypeName', | |||
valueType: 'treeSelect', | |||
fieldProps: { | |||
showSearch: true, | |||
allowClear: true, | |||
options: treeData | |||
}, | |||
] | |||
}, | |||
] | |||
return ( | |||
<Modal | |||
maskClosable={false} | |||
title={'下发数据'} | |||
width={1040} | |||
visible={props.createModalVisible} | |||
@@ -84,32 +85,32 @@ const PushFrom = (props) => { | |||
okText="确定" | |||
cancelText="取消" | |||
onOk={() => { | |||
if(!DeviceIds){ | |||
if (!DeviceIds) { | |||
message.error('请选择设备'); | |||
}else{ | |||
var de=DeviceInfo.find(x=>x.id==DeviceIds); | |||
var data={goodstechnology:[]}; | |||
} else { | |||
var de = DeviceInfo.find(x => x.id == DeviceIds); | |||
var data = { goodstechnology: [] }; | |||
// if(isGlogy){ | |||
// data.goodstechnology=[] | |||
// } | |||
selectedRowsState.map(x=>{ | |||
selectedRowsState.map(x => { | |||
// var pa={id:x.id,code:x.code,goodsTypeId:x.goodsTypeId,goodsTypeName:x.goodsTypeName,goodsUintId:x.goodsUintId,imgUrl:x.imgUrl,isAttrubute:x.isAttrubute,name:x.name,price:x.price,design:x.design,remark:x.remark} | |||
// data.goodsinfo.push(pa); | |||
// if(isGlogy){ | |||
// //data.goodstechnology=[] | |||
if(x.goodstechnology.length>0){ | |||
data.goodstechnology.push(x.goodstechnology) | |||
} | |||
if (x.goodstechnology.length > 0) { | |||
data.goodstechnology.push(x.goodstechnology) | |||
} | |||
// } | |||
}) | |||
if(data.goodstechnology.length==0){ | |||
if (data.goodstechnology.length == 0) { | |||
message.error('选择的商品还没有工艺'); | |||
}else{ | |||
var parm={deviceId:de.id,deviceName:de.name,deviceAutoKey:de.autoKey,type:4,data:data} | |||
} else { | |||
var parm = { deviceId: de.id, deviceName: de.name, deviceAutoKey: de.autoKey, type: 4, data: data } | |||
props.HandleOk(parm) | |||
console.log(de) | |||
} | |||
} | |||
}} | |||
onCancel={() => { | |||
@@ -117,48 +118,48 @@ const PushFrom = (props) => { | |||
}} | |||
destroyOnClose | |||
> | |||
<Row gutter={26} style={{marginBottom:20}}> | |||
<Col lg={24} md={24} sm={24}> | |||
选择设备: | |||
<Select | |||
allowClear | |||
style={{width: '60%'}} | |||
placeholder="请选择要下发设备" | |||
onChange={handleChange} | |||
options={deviceData} | |||
/> | |||
</Col> | |||
</Row> | |||
{/* <Row style={{marginBottom:20}}> | |||
<Row gutter={26} style={{ marginBottom: 20 }}> | |||
<Col lg={24} md={24} sm={24}> | |||
选择设备: | |||
<Select | |||
allowClear | |||
style={{ width: '60%' }} | |||
placeholder="请选择要下发设备" | |||
onChange={handleChange} | |||
options={deviceData} | |||
/> | |||
</Col> | |||
</Row> | |||
{/* <Row style={{marginBottom:20}}> | |||
<Col lg={24} md={24} sm={24}> | |||
是否包含工艺: | |||
<Switch checkedChildren="是" unCheckedChildren="否" checked={isGlogy} value={isGlogy} onChange={onChange} /> | |||
</Col> | |||
</Row> */} | |||
<Row gutter={26}> | |||
<Col span={24}> | |||
选择数据: | |||
<ProTable | |||
headerTitle="" | |||
actionRef={actionRef} | |||
rowKey="id" | |||
pagination={{ defaultPageSize: 10 }} | |||
search={{ | |||
labelWidth: 120, | |||
}} | |||
dataSource={dataSource} | |||
columns={columns} | |||
rowSelection={{ | |||
onChange: (_, selectedRows) => { | |||
setSelectedRows(selectedRows); | |||
}, | |||
}} | |||
> | |||
<Row gutter={26}> | |||
<Col span={24}> | |||
选择数据: | |||
<ProTable | |||
headerTitle="" | |||
actionRef={actionRef} | |||
rowKey="id" | |||
pagination={{ defaultPageSize: 10 }} | |||
search={{ | |||
labelWidth: 120, | |||
}} | |||
dataSource={dataSource} | |||
columns={columns} | |||
rowSelection={{ | |||
onChange: (_, selectedRows) => { | |||
setSelectedRows(selectedRows); | |||
}, | |||
}} | |||
> | |||
</ProTable> | |||
</Col> | |||
</Row> | |||
</Col> | |||
</Row> | |||
</Modal> | |||
); | |||
}; | |||
@@ -76,16 +76,16 @@ const goodspush = () => { | |||
ellipsis: true, | |||
}, | |||
{ | |||
title: '下发数据', | |||
dataIndex: 'type', | |||
ellipsis: true, | |||
valueEnum: { | |||
4: { | |||
text: '工艺', | |||
}, | |||
}, | |||
}, | |||
// { | |||
// title: '下发数据', | |||
// dataIndex: 'type', | |||
// ellipsis: true, | |||
// valueEnum: { | |||
// 4: { | |||
// text: '工艺', | |||
// }, | |||
// }, | |||
// }, | |||
{ | |||
title: '下发时间', | |||
dataIndex: 'createAt', | |||
@@ -105,26 +105,26 @@ const goodspush = () => { | |||
> | |||
下发详情 | |||
</a>, | |||
<Popconfirm | |||
type="primary" | |||
key="primary" | |||
title="确认删除吗?" | |||
okText="是" | |||
cancelText="否" | |||
onConfirm={async () => { | |||
await DeleteGoodsType(record.id).then((r) => { | |||
if (r.succeeded) { | |||
message.success('删除成功'); | |||
actionRef.current.reload(); | |||
} else { | |||
message.error(r.errors); | |||
} | |||
}); | |||
}} | |||
onCancel={() => {}} | |||
> | |||
<a href="#">删除</a> | |||
</Popconfirm>, | |||
// <Popconfirm | |||
// type="primary" | |||
// key="primary" | |||
// title="确认删除吗?" | |||
// okText="是" | |||
// cancelText="否" | |||
// onConfirm={async () => { | |||
// await DeleteGoodsType(record.id).then((r) => { | |||
// if (r.succeeded) { | |||
// message.success('删除成功'); | |||
// actionRef.current.reload(); | |||
// } else { | |||
// message.error(r.errors); | |||
// } | |||
// }); | |||
// }} | |||
// onCancel={() => {}} | |||
// > | |||
// <a href="#">删除</a> | |||
// </Popconfirm>, | |||
], | |||
}, | |||
]; | |||
@@ -247,7 +247,7 @@ const HandleOk= async(values)=>{ | |||
<ProDescriptions.Item label="下发设备" valueType="text"> | |||
{currentRow?.deviceName} | |||
</ProDescriptions.Item> | |||
<ProDescriptions.Item label="topic" valueType="text" copyable={true}> | |||
<ProDescriptions.Item label="topic" valueType="text"> | |||
<Paragraph copyable>{currentRow?.topic}</Paragraph> | |||
</ProDescriptions.Item> | |||
<ProDescriptions.Item contentStyle={{ maxWidth: '85%'}} label="下发数据" valueType="jsonCode" > | |||
@@ -1,35 +1,37 @@ | |||
import { request } from 'umi'; | |||
import { getDataBaseUrl,getgroupmealUrl } from '@/global_data'; | |||
export async function GetDevicePushRecodePage(data) { | |||
return request(`/groupmeal/api/devicepushrecode/page`, { | |||
return request(getgroupmealUrl()+`/api/devicepushrecode/page`, { | |||
method: 'POST', | |||
data: data, | |||
}); | |||
} | |||
export async function DevicePushRecodeAdd(data) { | |||
return request(`/groupmeal/api/devicepushrecode/add`, { | |||
return request(getgroupmealUrl()+`/api/devicepushrecode/add`, { | |||
method: 'POST', | |||
data: data, | |||
}); | |||
} | |||
export async function DevicePushRecodeUpdate(data) { | |||
return request(`/groupmeal/api/devicepushrecode/update`, { | |||
return request(getgroupmealUrl()+`/api/devicepushrecode/update`, { | |||
method: 'POST', | |||
data: data, | |||
}); | |||
} | |||
export async function DevicePushRecodeDelete(data) { | |||
return request(`/groupmeal/api/devicepushrecode/delete`, { | |||
return request(getgroupmealUrl()+`/api/devicepushrecode/delete`, { | |||
method: 'POST', | |||
data: data, | |||
}); | |||
} | |||
export async function GetDeviceList() { | |||
return request(`/saasbase/api/device/list`, { | |||
return request(getDataBaseUrl()+`/api/device/list`, { | |||
method: 'GET', | |||
}); | |||
} | |||
export async function GetGoodsTypeTree(params) { | |||
return request('/saasbase/api/goodstype/tree', { | |||
return request(getDataBaseUrl()+'/api/goodstype/tree', { | |||
method: 'GET', | |||
data: { | |||
...params, | |||
@@ -37,7 +39,7 @@ export async function GetDevicePushRecodePage(data) { | |||
}); | |||
} | |||
export async function GetGoodsPage(data) { | |||
return request(`/saasbase/api/goods/page`, { | |||
return request(getDataBaseUrl()+`/api/goods/page`, { | |||
method: 'Post', | |||
data: data, | |||
// params: { ...params }, | |||