From b7afb6cc0f6df279d1c040e6f88e85624037d4cc Mon Sep 17 00:00:00 2001 From: gwbvipvip Date: Wed, 31 Jan 2024 19:52:47 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/proxy.js | 6 +- config/routes.js | 6 - src/global_data.js | 10 + src/pages/applet/appidmanager/appid/index.jsx | 9 +- .../applet/appidmanager/appid/service.js | 9 +- .../applet/appidmanager/payment/index.jsx | 6 +- .../applet/appidmanager/payment/service.js | 9 +- src/pages/applet/basicconfiguration/index.jsx | 109 ++++++---- src/pages/applet/paytemplate/index.jsx | 40 ++-- src/pages/applet/service.js | 21 +- .../memberInfo/components/CreateForm.jsx | 4 +- .../groupMeal/member/memberInfo/index.jsx | 67 +++--- .../groupMeal/member/memberInfo/service.js | 42 +--- .../membertag/components/CreateForm.jsx | 8 +- .../groupMeal/member/membertag/services.js | 25 +-- .../ReportStatistics/dayConsumption/index.jsx | 2 +- .../dayConsumption/service.js | 3 +- .../ReportStatistics/monthSummary/index.jsx | 2 +- .../ReportStatistics/monthSummary/service.js | 3 +- .../ReportStatistics/monthTimeSlot/service.js | 4 +- .../ReportStatistics/reservation/service.js | 13 +- src/pages/groupMeal/oneCard/gate/index.jsx | 2 +- src/pages/groupMeal/oneCard/gate/service.js | 25 +-- src/pages/groupMeal/oneCard/machine/index.jsx | 9 +- .../groupMeal/oneCard/machine/service.js | 15 +- .../oneCard/memberAccount/service.js | 14 +- .../oneCard/storedValueCard/index.jsx | 1 + .../oneCard/storedValueCard/service.js | 11 +- src/pages/groupMeal/shop/index.jsx | 4 +- src/pages/groupMeal/shop/service.js | 13 +- src/pages/order/orderflow/service.js | 7 +- src/pages/order/thirdAuthorize/service.js | 11 +- src/pages/order/thirdOrder/service.js | 11 +- .../push/batchingpush/components/PushFrom.jsx | 1 + src/pages/push/batchingpush/index.jsx | 122 +++++------ src/pages/push/batchingpush/services.js | 16 +- .../push/goodspush/components/PushFrom.jsx | 189 ++++++++--------- src/pages/push/goodspush/index.jsx | 62 +++--- src/pages/push/goodspush/services.js | 14 +- .../technologypush/components/PushFrom.jsx | 199 +++++++++--------- src/pages/push/technologypush/index.jsx | 62 +++--- src/pages/push/technologypush/services.js | 16 +- 42 files changed, 618 insertions(+), 584 deletions(-) diff --git a/config/proxy.js b/config/proxy.js index 8fc035e..f192bb9 100644 --- a/config/proxy.js +++ b/config/proxy.js @@ -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: { diff --git a/config/routes.js b/config/routes.js index e606a74..d8812fc 100644 --- a/config/routes.js +++ b/config/routes.js @@ -381,12 +381,6 @@ export default [ path: '/order/thirdOrder', component: './order/thirdOrder', }, - { - name: '店铺授权', - icon: 'smile', - path: '/order/thirdOrder', - component: './order/thirdOrder', - }, { name: '授权管理', icon: 'smile', diff --git a/src/global_data.js b/src/global_data.js index b5b7104..05fd24f 100644 --- a/src/global_data.js +++ b/src/global_data.js @@ -8,3 +8,13 @@ export function getApiUrl() { export function getDataBaseUrl() { return '/saasbase'; } + +export function getgroupmealUrl() { + return '/groupmeal'; +} + +export function getgroupmealorderUrl() { + return '/groupmealorder'; +} + + diff --git a/src/pages/applet/appidmanager/appid/index.jsx b/src/pages/applet/appidmanager/appid/index.jsx index ed79c01..7bf1e52 100644 --- a/src/pages/applet/appidmanager/appid/index.jsx +++ b/src/pages/applet/appidmanager/appid/index.jsx @@ -75,7 +75,10 @@ const PayTemplate = () => { return }} @@ -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||'添加失败'); } }); diff --git a/src/pages/applet/appidmanager/appid/service.js b/src/pages/applet/appidmanager/appid/service.js index 3fb24d0..4fa6ae9 100644 --- a/src/pages/applet/appidmanager/appid/service.js +++ b/src/pages/applet/appidmanager/appid/service.js @@ -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, }); diff --git a/src/pages/applet/appidmanager/payment/index.jsx b/src/pages/applet/appidmanager/payment/index.jsx index 0370fdb..88c7bfe 100644 --- a/src/pages/applet/appidmanager/payment/index.jsx +++ b/src/pages/applet/appidmanager/payment/index.jsx @@ -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||'添加失败'); } }); diff --git a/src/pages/applet/appidmanager/payment/service.js b/src/pages/applet/appidmanager/payment/service.js index 125e83c..a229cf5 100644 --- a/src/pages/applet/appidmanager/payment/service.js +++ b/src/pages/applet/appidmanager/payment/service.js @@ -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, }); diff --git a/src/pages/applet/basicconfiguration/index.jsx b/src/pages/applet/basicconfiguration/index.jsx index 52de71b..2a75413 100644 --- a/src/pages/applet/basicconfiguration/index.jsx +++ b/src/pages/applet/basicconfiguration/index.jsx @@ -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) => ( ) @@ -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 + }}> -
+
当前门店:
+
    
+
+
+ 所属页面: +
+ +
{ 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 = () => { ]} /> - setIsModalVisible(false)} bodyStyle={{ padding: '32px 40px 1px 48px',height: '465px'}}> + setIsModalVisible(false)} bodyStyle={{ padding: '32px 40px 1px 48px', height: '465px' }}>
- 素材名称: + 所属页面:
- { +
- 素材编码: + 素材名称:
- { + { const tempImg = JSON.parse(JSON.stringify(currentImage)); - tempImg.materialCode = value.target.value; + tempImg.materialName = value.target.value; setCurrentImage(tempImg); }}>
- 所属页面: + 素材编码:
- { const tempImg = JSON.parse(JSON.stringify(currentImage)); - tempImg.pageId = value; + tempImg.materialCode = value.target.value; setCurrentImage(tempImg); - }}> - { - miniPageList.map(item => { - return - }) - } - + }}>
@@ -433,7 +464,7 @@ const Material = () => {
- + { })() } - - - + + +
- + { />
- + } export default Material; diff --git a/src/pages/applet/paytemplate/index.jsx b/src/pages/applet/paytemplate/index.jsx index f6a0801..befda33 100644 --- a/src/pages/applet/paytemplate/index.jsx +++ b/src/pages/applet/paytemplate/index.jsx @@ -186,7 +186,10 @@ const pageManage = () => { ]} /> - setIsModalVisible(false)} onCancel={() => setIsModalVisible(false)} bodyStyle={{ padding: '32px 40px 1px 48px' }}> + setIsModalVisible(false)} onCancel={() => setIsModalVisible(false)} bodyStyle={{ padding: '32px 40px 1px 48px' }}>
{ - + - @@ -225,22 +233,16 @@ const pageManage = () => { - + diff --git a/src/pages/applet/service.js b/src/pages/applet/service.js index 904560a..792b7ee 100644 --- a/src/pages/applet/service.js +++ b/src/pages/applet/service.js @@ -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 diff --git a/src/pages/groupMeal/member/memberInfo/components/CreateForm.jsx b/src/pages/groupMeal/member/memberInfo/components/CreateForm.jsx index 98cfe37..78235fe 100644 --- a/src/pages/groupMeal/member/memberInfo/components/CreateForm.jsx +++ b/src/pages/groupMeal/member/memberInfo/components/CreateForm.jsx @@ -127,7 +127,9 @@ const CreateForm = (props) => { - + diff --git a/src/pages/groupMeal/member/memberInfo/index.jsx b/src/pages/groupMeal/member/memberInfo/index.jsx index cb556ae..4f2ae14 100644 --- a/src/pages/groupMeal/member/memberInfo/index.jsx +++ b/src/pages/groupMeal/member/memberInfo/index.jsx @@ -304,23 +304,23 @@ const MemberManage = () => { > 更新 , - { - var data = { Id: record.id, platformType: 0, status: record.status == 0 ? 1 : 0 }; - updateMemberStatus(data); - }} - okText="确定" - cancelText="取消" - > - - {record.status == 0 ? '禁用 ' : '启用'} - - , + // { + // var data = { Id: record.id, platformType: 0, status: record.status == 0 ? 1 : 0 }; + // updateMemberStatus(data); + // }} + // okText="确定" + // cancelText="取消" + // > + // + // {record.status == 0 ? '禁用 ' : '启用'} + // + // , { // > // 更新 // , - { - var data = { - Id: record.memberInfo_Id, - platformType: record.platformType, - status: record.status == 0 ? 1 : 0, - }; - updateMemberStatus(data); - }} - > - {record.status == 0 ? '禁用 ' : '启用'} - , + // { + // var data = { + // Id: record.memberInfo_Id, + // platformType: record.platformType, + // status: record.status == 0 ? 1 : 0, + // }; + // updateMemberStatus(data); + // }} + // > + // {record.status == 0 ? '禁用 ' : '启用'} + // , { ) ) { setIsTagModalVisible(false); + setDataRowKey([]); } }} onCancel={() => { @@ -607,13 +608,13 @@ const MemberManage = () => { {/* 积分记录 */} - { SetIntegralRecordVisible(false); }} memberId={currentRow?.id} integralRecordVisible={integralRecordVisible} - /> + /> */} ); }; diff --git a/src/pages/groupMeal/member/memberInfo/service.js b/src/pages/groupMeal/member/memberInfo/service.js index c593923..12bbd1e 100644 --- a/src/pages/groupMeal/member/memberInfo/service.js +++ b/src/pages/groupMeal/member/memberInfo/service.js @@ -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, - }); -} diff --git a/src/pages/groupMeal/member/membertag/components/CreateForm.jsx b/src/pages/groupMeal/member/membertag/components/CreateForm.jsx index 3c19ab7..e063cb1 100644 --- a/src/pages/groupMeal/member/membertag/components/CreateForm.jsx +++ b/src/pages/groupMeal/member/membertag/components/CreateForm.jsx @@ -43,12 +43,12 @@ const CreateForm = (props) => { - + {/* - + */} - prevValues.mode !== currentValues.mode @@ -70,7 +70,7 @@ const CreateForm = (props) => { ) : null } - + */} diff --git a/src/pages/groupMeal/member/membertag/services.js b/src/pages/groupMeal/member/membertag/services.js index 1d2a046..a5059f5 100644 --- a/src/pages/groupMeal/member/membertag/services.js +++ b/src/pages/groupMeal/member/membertag/services.js @@ -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, - }); - }, }; diff --git a/src/pages/groupMeal/oneCard/ReportStatistics/dayConsumption/index.jsx b/src/pages/groupMeal/oneCard/ReportStatistics/dayConsumption/index.jsx index 89739b9..94f87f0 100644 --- a/src/pages/groupMeal/oneCard/ReportStatistics/dayConsumption/index.jsx +++ b/src/pages/groupMeal/oneCard/ReportStatistics/dayConsumption/index.jsx @@ -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'; diff --git a/src/pages/groupMeal/oneCard/ReportStatistics/dayConsumption/service.js b/src/pages/groupMeal/oneCard/ReportStatistics/dayConsumption/service.js index b5cc818..aa2fcb7 100644 --- a/src/pages/groupMeal/oneCard/ReportStatistics/dayConsumption/service.js +++ b/src/pages/groupMeal/oneCard/ReportStatistics/dayConsumption/service.js @@ -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 }); diff --git a/src/pages/groupMeal/oneCard/ReportStatistics/monthSummary/index.jsx b/src/pages/groupMeal/oneCard/ReportStatistics/monthSummary/index.jsx index e61a7a1..3e4ff6f 100644 --- a/src/pages/groupMeal/oneCard/ReportStatistics/monthSummary/index.jsx +++ b/src/pages/groupMeal/oneCard/ReportStatistics/monthSummary/index.jsx @@ -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); diff --git a/src/pages/groupMeal/oneCard/ReportStatistics/monthSummary/service.js b/src/pages/groupMeal/oneCard/ReportStatistics/monthSummary/service.js index fcf0b9c..16cb78b 100644 --- a/src/pages/groupMeal/oneCard/ReportStatistics/monthSummary/service.js +++ b/src/pages/groupMeal/oneCard/ReportStatistics/monthSummary/service.js @@ -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 }); diff --git a/src/pages/groupMeal/oneCard/ReportStatistics/monthTimeSlot/service.js b/src/pages/groupMeal/oneCard/ReportStatistics/monthTimeSlot/service.js index bcd70db..cd7bb0b 100644 --- a/src/pages/groupMeal/oneCard/ReportStatistics/monthTimeSlot/service.js +++ b/src/pages/groupMeal/oneCard/ReportStatistics/monthTimeSlot/service.js @@ -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 }); diff --git a/src/pages/groupMeal/oneCard/ReportStatistics/reservation/service.js b/src/pages/groupMeal/oneCard/ReportStatistics/reservation/service.js index c9c29f0..dff213a 100644 --- a/src/pages/groupMeal/oneCard/ReportStatistics/reservation/service.js +++ b/src/pages/groupMeal/oneCard/ReportStatistics/reservation/service.js @@ -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 diff --git a/src/pages/groupMeal/oneCard/gate/index.jsx b/src/pages/groupMeal/oneCard/gate/index.jsx index c676748..4be0010 100644 --- a/src/pages/groupMeal/oneCard/gate/index.jsx +++ b/src/pages/groupMeal/oneCard/gate/index.jsx @@ -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 || '获取场景列表失败'); diff --git a/src/pages/groupMeal/oneCard/gate/service.js b/src/pages/groupMeal/oneCard/gate/service.js index bbb9633..6096eb2 100644 --- a/src/pages/groupMeal/oneCard/gate/service.js +++ b/src/pages/groupMeal/oneCard/gate/service.js @@ -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 }); diff --git a/src/pages/groupMeal/oneCard/machine/index.jsx b/src/pages/groupMeal/oneCard/machine/index.jsx index 99353ff..def2ee3 100644 --- a/src/pages/groupMeal/oneCard/machine/index.jsx +++ b/src/pages/groupMeal/oneCard/machine/index.jsx @@ -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 = () => { ]} /> - { setCurrentOption({}); setIsModalOpen(false) }}> + { setCurrentOption({}); setIsModalOpen(false) }}> { /> { - { form.resetFields(); setIsModalOpen(false); }}> + { form.resetFields(); setIsModalOpen(false); }}> { ] return ( { 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; > 下发详情 , - { - await DeleteGoodsType(record.id).then((r) => { - if (r.succeeded) { - message.success('删除成功'); - actionRef.current.reload(); - } else { - message.error(r.errors); - } - }); - }} - onCancel={() => {}} - > - 删除 - , + // { + // await DeleteGoodsType(record.id).then((r) => { + // if (r.succeeded) { + // message.success('删除成功'); + // actionRef.current.reload(); + // } else { + // message.error(r.errors); + // } + // }); + // }} + // onCancel={() => { }} + // > + // 删除 + // , ], }, ]; -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 ( { 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)=>{ { - + }} onCancel={() => { handleModalVisible(false); @@ -244,18 +244,18 @@ const HandleOk= async(values)=>{ - + {currentRow?.deviceName} - - - {currentRow?.topic} - - + + + {currentRow?.topic} + + {currentRow?.dataResore} - - + + )} diff --git a/src/pages/push/batchingpush/services.js b/src/pages/push/batchingpush/services.js index c556802..848ea3b 100644 --- a/src/pages/push/batchingpush/services.js +++ b/src/pages/push/batchingpush/services.js @@ -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 || {}), }); } diff --git a/src/pages/push/goodspush/components/PushFrom.jsx b/src/pages/push/goodspush/components/PushFrom.jsx index b1b0eb6..e5f8496 100644 --- a/src/pages/push/goodspush/components/PushFrom.jsx +++ b/src/pages/push/goodspush/components/PushFrom.jsx @@ -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 ( { 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 > - - - 选择设备: - + + + + {/* 是否包含工艺: */} - - - 选择数据: - { - setSelectedRows(selectedRows); - }, - }} - > + + + 选择数据: + { + setSelectedRows(selectedRows); + }, + }} + > - - + + ); }; diff --git a/src/pages/push/goodspush/index.jsx b/src/pages/push/goodspush/index.jsx index 96302d6..0140b0c 100644 --- a/src/pages/push/goodspush/index.jsx +++ b/src/pages/push/goodspush/index.jsx @@ -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 = () => { > 下发详情 , - { - await DeleteGoodsType(record.id).then((r) => { - if (r.succeeded) { - message.success('删除成功'); - actionRef.current.reload(); - } else { - message.error(r.errors); - } - }); - }} - onCancel={() => {}} - > - 删除 - , + // { + // await DeleteGoodsType(record.id).then((r) => { + // if (r.succeeded) { + // message.success('删除成功'); + // actionRef.current.reload(); + // } else { + // message.error(r.errors); + // } + // }); + // }} + // onCancel={() => {}} + // > + // 删除 + // , ], }, ]; @@ -248,7 +248,7 @@ const HandleOk= async(values)=>{ {currentRow?.deviceName} - + {currentRow?.topic} diff --git a/src/pages/push/goodspush/services.js b/src/pages/push/goodspush/services.js index 2bd56ed..684ac76 100644 --- a/src/pages/push/goodspush/services.js +++ b/src/pages/push/goodspush/services.js @@ -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 }, diff --git a/src/pages/push/technologypush/components/PushFrom.jsx b/src/pages/push/technologypush/components/PushFrom.jsx index e4f8369..bce44ac 100644 --- a/src/pages/push/technologypush/components/PushFrom.jsx +++ b/src/pages/push/technologypush/components/PushFrom.jsx @@ -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 ( { 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 > - - - 选择设备: - + + + + {/* 是否包含工艺: */} - - - 选择数据: - { - setSelectedRows(selectedRows); - }, - }} - > + + + 选择数据: + { + setSelectedRows(selectedRows); + }, + }} + > - - + + ); }; diff --git a/src/pages/push/technologypush/index.jsx b/src/pages/push/technologypush/index.jsx index 2b89689..fe90bd9 100644 --- a/src/pages/push/technologypush/index.jsx +++ b/src/pages/push/technologypush/index.jsx @@ -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 = () => { > 下发详情 , - { - await DeleteGoodsType(record.id).then((r) => { - if (r.succeeded) { - message.success('删除成功'); - actionRef.current.reload(); - } else { - message.error(r.errors); - } - }); - }} - onCancel={() => {}} - > - 删除 - , + // { + // await DeleteGoodsType(record.id).then((r) => { + // if (r.succeeded) { + // message.success('删除成功'); + // actionRef.current.reload(); + // } else { + // message.error(r.errors); + // } + // }); + // }} + // onCancel={() => {}} + // > + // 删除 + // , ], }, ]; @@ -247,7 +247,7 @@ const HandleOk= async(values)=>{ {currentRow?.deviceName} - + {currentRow?.topic} diff --git a/src/pages/push/technologypush/services.js b/src/pages/push/technologypush/services.js index 2bd56ed..4529873 100644 --- a/src/pages/push/technologypush/services.js +++ b/src/pages/push/technologypush/services.js @@ -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 },