|
- (self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[1160],{52953:function(){},57894:function(Ee,ue,f){"use strict";f.r(ue),f.d(ue,{default:function(){return mt}});var Ge=f(57663),X=f(71577),z=f(11849),a=f(39428),yt=f(34792),F=f(48086),p=f(3182),D=f(2824),Zt=f(18106),Ae=f(25499),Te=f(49101),y=f(67294),Re=f(28790),A=f(48971);function Pe(){return se.apply(this,arguments)}function se(){return se=(0,p.Z)((0,a.Z)().mark(function n(){return(0,a.Z)().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.abrupt("return",(0,A.WY)("/storemanagement/api/shop/alllist",{method:"GET"}));case 1:case"end":return o.stop()}},n)})),se.apply(this,arguments)}function De(n){return oe.apply(this,arguments)}function oe(){return oe=(0,p.Z)((0,a.Z)().mark(function n(e){return(0,a.Z)().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(0,A.WY)("/storemanagement/api/FoodMenu/GetShopFoodMenuPage",{method:"POST",data:e}));case 1:case"end":return t.stop()}},n)})),oe.apply(this,arguments)}function $e(n){return ie.apply(this,arguments)}function ie(){return ie=(0,p.Z)((0,a.Z)().mark(function n(e){return(0,a.Z)().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(0,A.WY)("/storemanagement/api/FoodMenu/AddUpdateFoodMenu",{method:"POST",data:e}));case 1:case"end":return t.stop()}},n)})),ie.apply(this,arguments)}function Be(n){return le.apply(this,arguments)}function le(){return le=(0,p.Z)((0,a.Z)().mark(function n(e){return(0,a.Z)().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(0,A.WY)("/storemanagement/api/FoodMenu/AddUpdateFoodMenu",{method:"POST",data:e}));case 1:case"end":return t.stop()}},n)})),le.apply(this,arguments)}function Ue(n){return de.apply(this,arguments)}function de(){return de=(0,p.Z)((0,a.Z)().mark(function n(e){return(0,a.Z)().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(0,A.WY)("/storemanagement/api/FoodMenu/GetGoodsByMenuIdPage",{method:"POST",data:(0,z.Z)({},e)}));case 1:case"end":return t.stop()}},n)})),de.apply(this,arguments)}function We(n){return ce.apply(this,arguments)}function ce(){return ce=(0,p.Z)((0,a.Z)().mark(function n(e){return(0,a.Z)().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(0,A.WY)("/storemanagement/api/FoodMenu/GetFoodMenuGoodsPage_V2",{method:"POST",data:(0,z.Z)({},e)}));case 1:case"end":return t.stop()}},n)})),ce.apply(this,arguments)}function Ne(n){return fe.apply(this,arguments)}function fe(){return fe=(0,p.Z)((0,a.Z)().mark(function n(e){return(0,a.Z)().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(0,A.WY)("/storemanagement/api/FoodMenu/EditFoodMenuGoods",{method:"POST",data:e}));case 1:case"end":return t.stop()}},n)})),fe.apply(this,arguments)}function Le(n){return pe.apply(this,arguments)}function pe(){return pe=(0,p.Z)((0,a.Z)().mark(function n(e){return(0,a.Z)().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(0,A.WY)("\u200B\u200B/storemanagement/api/FoodMenu/GetStoreGoods",{method:"POST",data:e}));case 1:case"end":return t.stop()}},n)})),pe.apply(this,arguments)}function Ke(n){return he.apply(this,arguments)}function he(){return he=(0,p.Z)((0,a.Z)().mark(function n(e){return(0,a.Z)().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(0,A.WY)("/storemanagement/api/FoodMenu/UpdateStoreGood",{method:"put",data:e}));case 1:case"end":return t.stop()}},n)})),he.apply(this,arguments)}function Ye(n){return me.apply(this,arguments)}function me(){return me=(0,p.Z)((0,a.Z)().mark(function n(e){return(0,a.Z)().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(0,A.WY)("/storemanagement/api/FoodMenu/SetStopGoods",{method:"POST",data:e}));case 1:case"end":return t.stop()}},n)})),me.apply(this,arguments)}function Ve(n){return ve.apply(this,arguments)}function ve(){return ve=(0,p.Z)((0,a.Z)().mark(function n(e){return(0,a.Z)().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(0,A.WY)("/storemanagement/api/FoodMenu/UpdateStoreGood",{method:"put",data:e}));case 1:case"end":return t.stop()}},n)})),ve.apply(this,arguments)}function be(n){return ge.apply(this,arguments)}function ge(){return ge=(0,p.Z)((0,a.Z)().mark(function n(e){return(0,a.Z)().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(0,A.WY)("/storemanagement/api/FoodMenu/AddGoodDeviceAsync",{method:"POST",data:e}));case 1:case"end":return t.stop()}},n)})),ge.apply(this,arguments)}function ze(n){return ye.apply(this,arguments)}function ye(){return ye=(0,p.Z)((0,a.Z)().mark(function n(e){return(0,a.Z)().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(0,A.WY)("/saasbase/api/device/list",{method:"get",data:e}));case 1:case"end":return t.stop()}},n)})),ye.apply(this,arguments)}function Je(n,e){return Ze.apply(this,arguments)}function Ze(){return Ze=(0,p.Z)((0,a.Z)().mark(function n(e,o){return(0,a.Z)().wrap(function(Z){for(;;)switch(Z.prev=Z.next){case 0:return Z.abrupt("return",(0,A.WY)("/storemanagement/api/FoodMenu/GetGoodDeviceAsync?foodId=".concat(e,"&storeId=").concat(o),{method:"GET"}));case 1:case"end":return Z.stop()}},n)})),Ze.apply(this,arguments)}function St(n){return Se.apply(this,arguments)}function Se(){return Se=_asyncToGenerator(_regeneratorRuntime().mark(function n(e){return _regeneratorRuntime().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",request("/kitchen/api/select/GetCokingWorkList"));case 1:case"end":return t.stop()}},n)})),Se.apply(this,arguments)}function Ct(n){return Ce.apply(this,arguments)}function Ce(){return Ce=_asyncToGenerator(_regeneratorRuntime().mark(function n(e){return _regeneratorRuntime().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",request("/kitchen/api/store-info/store-good",{method:"POST",data:e}));case 1:case"end":return t.stop()}},n)})),Ce.apply(this,arguments)}function It(n){return Ie.apply(this,arguments)}function Ie(){return Ie=_asyncToGenerator(_regeneratorRuntime().mark(function n(e){return _regeneratorRuntime().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",request("/kitchen/api/store-info/del-store-good",{method:"POST",data:e}));case 1:case"end":return t.stop()}},n)})),Ie.apply(this,arguments)}function wt(){return we.apply(this,arguments)}function we(){return we=_asyncToGenerator(_regeneratorRuntime().mark(function n(){var e;return _regeneratorRuntime().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e={current:1,pageSize:1e3,goods_Enable:0},t.abrupt("return",request("/kitchen/api/goods/goodss",{method:"Post",data:e}));case 2:case"end":return t.stop()}},n)})),we.apply(this,arguments)}function Ft(n){return request("/kitchen//api/Store/StoreGoodsAllUpdate",{method:"post",data:n})}function kt(n){return request("/kitchen/api/log/request-log-page",{method:"post",data:n})}function Xe(n){return Fe.apply(this,arguments)}function Fe(){return Fe=(0,p.Z)((0,a.Z)().mark(function n(e){return(0,a.Z)().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(0,A.WY)("/kitchen/api/FoodMenu/GetFoodMenuInfoPage",{method:"POST",data:e}));case 1:case"end":return t.stop()}},n)})),Fe.apply(this,arguments)}function _e(n){return ke.apply(this,arguments)}function ke(){return ke=(0,p.Z)((0,a.Z)().mark(function n(e){return(0,a.Z)().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(0,A.WY)("/kitchen/api/FoodMenu/StoreAddFoodMenuNew",{method:"POST",data:e}));case 1:case"end":return t.stop()}},n)})),ke.apply(this,arguments)}var q=f(16894),Mt=f(71194),jt=f(77883),xt=f(9715),Gt=f(47673),Dt=f(43358),u=f(85893),bt=function(e){var o=_Select.Option,t=_Select.OptGroup,Z=useState([]),m=_slicedToArray(Z,2),k=m[0],T=m[1],M=useState([]),v=_slicedToArray(M,2),j=v[0],S=v[1];return _jsx(_Modal,{title:e.values.id?"\u7F16\u8F91":"\u65B0\u5EFA",width:640,visible:e.createModalVisible,bodyStyle:{padding:"32px 40px 48px"},footer:null,onCancel:function(){e.onCancel()},destroyOnClose:!0,children:_jsxs(_Form,{layout:"vertical",preserve:!1,initialValues:e.values,onFinish:e.onFinish,children:[_jsx(_Form.Item,{name:"id",hidden:!0,children:_jsx(_Input,{})}),_jsx(_Form.Item,{label:"\u4EF7\u683C",name:"price",rules:[{required:!0}],children:_jsx(_InputNumber,{placeholder:"\u4EF7\u683C",min:0})}),_jsx(_Form.Item,{label:"\u4F1A\u5458\u4EF7\u683C",name:"vipPrice",rules:[{required:!0}],children:_jsx(_InputNumber,{placeholder:"\u4EF7\u683C",min:0})}),_jsx(_Form.Item,{label:"\u72B6\u6001",name:"status",rules:[{required:!0}],children:_jsxs(_Select,{placeholder:"\u72B6\u6001",children:[_jsx(o,{value:1,children:"\u4E0B\u67B6"}),_jsx(o,{value:0,children:"\u4E0A\u67B6"})]})}),_jsx(_Form.Item,{children:_jsx(_Button,{type:"primary",htmlType:"submit",children:"\u4FDD\u5B58"})})]})})},Ot=null,Et=f(57338),At=f(98858),Tt=function(e){var o=useRef(),t=useState({}),Z=_slicedToArray(t,2),m=Z[0],k=Z[1],T=useState(!1),M=_slicedToArray(T,2),v=M[0],j=M[1],S=function(){var s=_asyncToGenerator(_regeneratorRuntime().mark(function l(r){return _regeneratorRuntime().wrap(function(h){for(;;)switch(h.prev=h.next){case 0:k({ip:r.ip,refererUrl:r.refererUrl,requestUrl:r.requestURL,parameters:r.requestData,returnResult:r.resultData});case 1:case"end":return h.stop()}},l)}));return function(r){return s.apply(this,arguments)}}(),w=new Map;w.set(!0,{text:"\u5F02\u5E38",status:"Error"}),w.set(!1,{text:"\u6B63\u5E38",status:"Success"});var d=[{title:"\u4E3B\u952E",dataIndex:"id",tip:"\u89C4\u5219\u540D\u79F0\u662F\u552F\u4E00\u7684key",hideInSearch:!0,hideInTable:!0},{title:"\u64CD\u4F5C\u4EBA",dataIndex:"name",valueType:"textarea"},{title:"\u64CD\u4F5C\u8BF4\u660E",dataIndex:"methodName",valueType:"textarea",hideInSearch:!0},{title:"\u521B\u5EFA\u65F6\u95F4",dataIndex:"createAt",valueType:"date",hideInForm:!0},{title:"\u64CD\u4F5C",dataIndex:"option",valueType:"option",render:function(l,r){return[_jsx("a",{onClick:_asyncToGenerator(_regeneratorRuntime().mark(function c(){return _regeneratorRuntime().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return g.next=2,S(r);case 2:j(!0);case 3:case"end":return g.stop()}},c)})),children:"\u8BE6\u60C5"},r.id)]}}],i=useIntl();return _jsxs(PageContainer,{children:[_jsx(ProTable,{search:!1,headerTitle:"\u64CD\u4F5C\u65E5\u5FD7",actionRef:o,rowKey:"id",request:function(){var s=_asyncToGenerator(_regeneratorRuntime().mark(function l(r){var c,h;return _regeneratorRuntime().wrap(function(L){for(;;)switch(L.prev=L.next){case 0:return c=[],h=0,r.value=e.storeId,r.method=["AddStoreGoodAsync","DelStoreGoodAsync","UpdateStoreGoodsAsync"],L.next=6,GetRequestLogPageAsync(JSON.stringify(r)).then(function(J){c=J.data.data,h=J.data.total});case 6:return L.abrupt("return",{data:c,success:!0,total:h});case 7:case"end":return L.stop()}},l)}));return function(l){return s.apply(this,arguments)}}(),columns:d,pagination:{defaultPageSize:10}}),_jsxs(_Drawer,{title:"\u8BE6\u60C5",placement:"right",size:"large",onClose:function(){j(!1)},visible:v,children:[_jsxs(_Descriptions,{column:1,children:[_jsx(_Descriptions.Item,{label:"\u64CD\u4F5CIP",children:_jsx(Field,{text:m.ip})}),_jsx(_Descriptions.Item,{label:"\u53C2\u8003\u5730\u5740",children:_jsx(Field,{text:m.refererUrl})}),_jsx(_Descriptions.Item,{label:"\u8BF7\u6C42\u5730\u5740",children:_jsx(Field,{text:m.requestUrl})})]}),_jsxs(_Descriptions,{children:[_jsxs(_Descriptions.Item,{label:"\u8BF7\u6C42\u6570\u636E",children:[_jsx("a",{onClick:function(){var l=document.createElement("input");l.value=m.parameters,document.body.appendChild(l),l.select(),document.execCommand("Copy"),_message.success("\u590D\u5236\u6210\u529F"),l.remove()},children:_jsx(CopyOutlined,{})}),_jsx("div",{style:{width:"220px",overflow:"scroll",overflowX:"auto"},children:_jsx(Field,{text:m.parameters,valueType:"jsonCode"})})]}),_jsxs(_Descriptions.Item,{label:"\u8FD4\u56DE\u6570\u636E",children:[_jsx("a",{onClick:function(){var l=document.createElement("input");l.value=m.returnResult,document.body.appendChild(l),l.select(),document.execCommand("Copy"),_message.success("\u590D\u5236\u6210\u529F"),l.remove()},children:_jsx(CopyOutlined,{})}),_jsx("div",{style:{width:"400px",overflow:"scroll",overflowX:"auto"},children:_jsx(Field,{text:m.returnResult,valueType:"jsonCode"})})]})]})]},"1")]})},Rt=null,_=f(50146),Pt=f(59250),He=f(13013),$t=f(49111),Me=f(19650),Bt=f(62350),ee=f(24565),Oe=f(21888),H=f(4107),N=f(55843),Q=f(34041),je="message",Qe=function(e){var o=Q.Z.Option,t=N.Z.useForm(),Z=(0,D.Z)(t,1),m=Z[0],k=function(){e.goods&&m.setFieldsValue(e.goods)},T=function(){var M=(0,p.Z)((0,a.Z)().mark(function v(){var j,S;return(0,a.Z)().wrap(function(d){for(;;)switch(d.prev=d.next){case 0:return d.next=2,m.validateFields();case 2:return j=d.sent,d.prev=3,F.default.loading("\u6B63\u5728\u4FEE\u6539",je),F.default.destroy(je),d.next=8,Ke((0,z.Z)((0,z.Z)({},e.goods),j));case 8:S=d.sent,F.default.destroy(je),S.statusCode===200?(F.default.success("\u4FEE\u6539\u6210\u529F"),e.onOk()):F.default.success("\u4FEE\u6539\u5931\u8D25"),d.next=16;break;case 13:d.prev=13,d.t0=d.catch(3),F.default.error("\u4FEE\u6539\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01");case 16:case"end":return d.stop()}},v,null,[[3,13]])}));return function(){return M.apply(this,arguments)}}();return(0,y.useEffect)(function(){k()},[]),(0,u.jsx)(_.Z,{title:"\u7F16\u8F91\u3010".concat(e.goods.goods_Name,"\u3011"),width:640,visible:e.open,onOk:T,onCancel:e.onCancel,destroyOnClose:!0,children:(0,u.jsxs)(N.Z,{layout:"vertical",form:m,children:[(0,u.jsx)(N.Z.Item,{name:"id",hidden:!0,children:(0,u.jsx)(H.Z,{})}),(0,u.jsx)(N.Z.Item,{label:"\u4EF7\u683C",name:"price",rules:[{required:!0}],children:(0,u.jsx)(Oe.Z,{placeholder:"\u4EF7\u683C",min:0})}),(0,u.jsx)(N.Z.Item,{label:"\u4F1A\u5458\u4EF7\u683C",name:"vipPrice",rules:[{required:!0}],children:(0,u.jsx)(Oe.Z,{placeholder:"\u4EF7\u683C",min:0})}),(0,u.jsx)(N.Z.Item,{label:"\u72B6\u6001",name:"status",rules:[{required:!0}],children:(0,u.jsxs)(Q.Z,{placeholder:"\u72B6\u6001",children:[(0,u.jsx)(o,{value:1,children:"\u4E0B\u67B6"}),(0,u.jsx)(o,{value:0,children:"\u4E0A\u67B6"})]})})]})})},qe=Qe,Ut="message",et=function(e){var o=(0,y.useState)([]),t=(0,D.Z)(o,2),Z=t[0],m=t[1],k=(0,y.useState)([]),T=(0,D.Z)(k,2),M=T[0],v=T[1],j=function(){var d=(0,p.Z)((0,a.Z)().mark(function i(){var s,l;return(0,a.Z)().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return s=[],M.forEach(function(h){s.push({deviceId:h})}),c.next=4,be({foodMenuId:e.foodMenu.id,foods:e.goods.goodsId,isDevice:e.isDevice,deviceIds:s});case 4:l=c.sent,l.statusCode===200?(F.default.success("\u7ED1\u5B9A\u6210\u529F\uFF01"),e.onOk()):F.default.error(JSON.stringify(l.errors)||"\u5546\u54C1\u7ED1\u5B9A\u8BBE\u5907\u5931\u8D25");case 6:case"end":return c.stop()}},i)}));return function(){return d.apply(this,arguments)}}(),S=function(){var d=(0,p.Z)((0,a.Z)().mark(function i(){var s,l;return(0,a.Z)().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return c.next=2,ze();case 2:s=c.sent,s.statusCode===200&&s.data?(s==null||(l=s.data)===null||l===void 0||l.forEach(function(h){h.label=h.name,h.value=h.id}),m(s.data)):F.default.error(JSON.stringify(s.errors)||"\u83B7\u53D6\u8BBE\u5907\u5217\u8868\u5931\u8D25");case 4:case"end":return c.stop()}},i)}));return function(){return d.apply(this,arguments)}}(),w=function(){var d=(0,p.Z)((0,a.Z)().mark(function i(){var s;return(0,a.Z)().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(!(e.goods&&e.storeId)){r.next=5;break}return r.next=3,Je(e.goods.goodsId,e.storeId);case 3:s=r.sent,s.statusCode===200&&v(s.data);case 5:case"end":return r.stop()}},i)}));return function(){return d.apply(this,arguments)}}();return(0,y.useEffect)(function(){S(),w()},[]),(0,u.jsx)(_.Z,{title:"\u3010".concat(e.goods.goods_Name,"\u3011\u7ED1\u5B9A\u8BBE\u5907"),width:640,bodyStyle:{height:"300px"},visible:e.open,onOk:j,onCancel:e.onCancel,destroyOnClose:!0,children:(0,u.jsx)(Q.Z,{mode:"multiple",allowClear:!0,style:{width:"100%"},placeholder:"\u8BF7\u9009\u62E9\u8BBE\u5907\uFF01",onChange:v,options:Z,value:M})})},tt=et,nt=function(e){var o=(0,y.useRef)(),t=(0,y.useState)(!1),Z=(0,D.Z)(t,2),m=Z[0],k=Z[1],T=(0,y.useState)(),M=(0,D.Z)(T,2),v=M[0],j=M[1],S=(0,y.useState)(!1),w=(0,D.Z)(S,2),d=w[0],i=w[1],s=(0,y.useState)([]),l=(0,D.Z)(s,2),r=l[0],c=l[1],h=(0,y.useState)(0),g=(0,D.Z)(h,2),L=g[0],J=g[1],ne=function(){var K=(0,p.Z)((0,a.Z)().mark(function Y(C,R){var G;return(0,a.Z)().wrap(function(I){for(;;)switch(I.prev=I.next){case 0:if(!(C.key=="1"||C.key=="2")){I.next=5;break}J(C.key),i(!0),I.next=13;break;case 5:if(j(R),C.key!="0"){I.next=13;break}return console.log(v),I.next=10,be({foodMenuId:v.foodMenuId,foods:v.goodsId,deviceIds:[],isDevice:C.key});case 10:G=I.sent,console.log(G),G.statusCode===200?(F.default.success("\u4FEE\u6539\u6210\u529F\uFF01"),o.current.reload()):F.default.error(JSON.stringify(G.errors)||"\u4FEE\u6539\u5931\u8D25");case 13:case"end":return I.stop()}},Y)}));return function(C,R){return K.apply(this,arguments)}}(),re=[{title:"\u4E3B\u952E",dataIndex:"id",hideInSearch:!0,hideInTable:!0,tip:"\u89C4\u5219\u540D\u79F0\u662F\u552F\u4E00\u7684 key"},{title:"\u5546\u54C1",dataIndex:"goods_Name",valueType:"textarea"},{title:"\u5546\u54C1\u4EF7\u683C",dataIndex:"price",valueType:"money",hideInSearch:!0},{title:"\u5546\u54C1\u4F1A\u5458\u4EF7\u683C",dataIndex:"vipPrice",valueType:"money",hideInSearch:!0},{title:"\u5236\u4F5C\u65B9\u5F0F",dataIndex:"isDevice",valueEnum:{0:{text:"\u5E97\u94FA",status:"Processing"},1:{text:"\u8BBE\u5907",status:"Success"},2:{text:"\u8BBE\u5907\u626B\u7801",status:"Warning"}}},{title:"\u72B6\u6001",dataIndex:"status",valueEnum:{0:{text:"\u4E0A\u67B6",status:"Processing"},1:{text:"\u4E0B\u67B6",status:"Success"}}},{title:"\u4F30\u6E05",dataIndex:"stopSales",valueEnum:{0:{text:"\u9500\u552E",status:"Processing"},1:{text:"\u4F30\u6E05",status:"Success"}}},{title:"\u64CD\u4F5C",dataIndex:"option",valueType:"option",render:function(Y,C){return[(0,u.jsx)("a",{onClick:function(){j(C),k(!0)},children:"\u7F16\u8F91"},"update"),(0,u.jsx)(ee.Z,{title:"\u786E\u5B9A\u8981".concat(C.stopSales==0?"\u4F30\u6E05":"\u9500\u552E","\u5417\uFF1F"),onConfirm:(0,p.Z)((0,a.Z)().mark(function R(){var G,O,I;return(0,a.Z)().wrap(function(b){for(;;)switch(b.prev=b.next){case 0:return G=0,C.stopSales==0?G=1:G=0,O=[{goodsId:C.foodId,storeId:C.storeId,StopSales:G}],b.next=5,Ye(O);case 5:I=b.sent,I.statusCode===200&&I.data?(F.default.success("\u64CD\u4F5C\u6210\u529F\uFF01"),o.current.reload()):F.default.error(JSON.stringify(I.errors)||"\u64CD\u4F5C\u5931\u8D25");case 7:case"end":return b.stop()}},R)})),okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",children:(0,u.jsx)("a",{onClick:(0,p.Z)((0,a.Z)().mark(function R(){return(0,a.Z)().wrap(function(O){for(;;)switch(O.prev=O.next){case 0:case"end":return O.stop()}},R)})),children:C.stopSales==0?"\u4F30\u6E05":"\u9500\u552E"})},"stopSales"),(0,u.jsx)(ee.Z,{title:"\u786E\u5B9A\u8981".concat(C.status==0?"\u4E0B\u67B6":"\u4E0A\u67B6","\u5417\uFF1F"),onConfirm:(0,p.Z)((0,a.Z)().mark(function R(){var G;return(0,a.Z)().wrap(function(I){for(;;)switch(I.prev=I.next){case 0:return C.status=C.status==0?1:0,I.next=3,Ve(C);case 3:G=I.sent,G.data?(o.current.reload(),F.default.success("\u64CD\u4F5C\u6210\u529F\uFF01")):F.default.error(JSON.stringify(G.errors)||"\u64CD\u4F5C\u5931\u8D25");case 5:case"end":return I.stop()}},R)})),okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",children:(0,u.jsx)("a",{children:C.status==0?"\u4E0B\u67B6":"\u4E0A\u67B6"})},"status"),(0,u.jsx)(He.Z,{menu:{items:r,selectable:!0,onClick:ne,defaultSelectedKeys:[]},trigger:["click"],children:(0,u.jsx)("a",{onClick:function(G){ne(G,C)},children:(0,u.jsx)(Me.Z,{children:"\u5236\u4F5C\u65B9\u5F0F"})})}),(0,u.jsx)("a",{onClick:function(){A.m8.push({pathname:"/shopmanage/storeAddGoodsInfo",query:{isAdd:!1,values:C,storeId:e.storeId}})},children:"\u52A0\u8D2D\u5546\u54C1"},"config")]}}];return(0,y.useEffect)(function(){c([{key:"1",label:"\u8BBE\u5907\u5236\u4F5C"},{key:"0",label:"\u5E97\u94FA\u5236\u4F5C"},{key:"2",label:"\u8BBE\u5907\u626B\u7801\u5236\u4F5C"}])},[]),(0,u.jsxs)(_.Z,{destroyOnClose:!0,footer:null,width:1200,title:e.foodMenu.name,visible:e.open,onCancel:e.onCancel,children:[(0,u.jsx)(q.ZP,{columns:re,actionRef:o,pagination:{pageSize:10},request:(0,p.Z)((0,a.Z)().mark(function K(){var Y,C,R,G,O,I=arguments;return(0,a.Z)().wrap(function(b){for(;;)switch(b.prev=b.next){case 0:if(C=I.length>0&&I[0]!==void 0?I[0]:{},R=I.length>1?I[1]:void 0,G=I.length>2?I[2]:void 0,!(e.storeId&&(Y=e.foodMenu)!==null&&Y!==void 0&&Y.id)){b.next=13;break}return C.status&&(C.status=parseInt(C.status)),b.next=7,Le((0,z.Z)((0,z.Z)({},C),{},{goodsName:C.goods_Name,storeId:e.storeId,foodMenuId:e.foodMenu.id}));case 7:if(O=b.sent,O.statusCode!==200){b.next=12;break}return b.abrupt("return",{data:O.data.data,success:!0,total:O.data.total});case 12:return b.abrupt("return",[]);case 13:return b.abrupt("return",[]);case 14:case"end":return b.stop()}},K)})),rowKey:"id",headerTitle:"\u5546\u54C1\u5217\u8868"}),m&&v&&(0,u.jsx)(qe,{open:m,goods:v,onCancel:function(){return k(!1)},onOk:function(){o.current.reload(),k(!1)}}),d&&(0,u.jsx)(tt,{open:d,goods:v,foodMenu:e.foodMenu,storeId:e.storeId,isDevice:L,onCancel:function(){return i(!1)},onOk:function(){o.current.reload(),i(!1)}})]})},rt=nt,te=f(86582),at=function(e){var o=(0,y.useRef)(),t=(0,y.useState)([]),Z=(0,D.Z)(t,2),m=Z[0],k=Z[1],T=[{title:"\u83DC\u8C31\u540D\u79F0",dataIndex:"name"},{title:"\u83DC\u8C31\u7F16\u7801",dataIndex:"code",hideInSearch:!0},{title:"\u83DC\u8C31\u6392\u5E8F",dataIndex:"sort",hideInSearch:!0}],M=function(){var j=(0,p.Z)((0,a.Z)().mark(function S(){var w;return(0,a.Z)().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,_e({foodMenuIds:m,storeId:e.storeId});case 2:w=i.sent,w.statusCode===200?(F.default.success("\u7ED1\u5B9A\u6210\u529F\uFF01"),e.onOk()):F.default.error(w.errors||"\u7ED1\u5B9A\u83DC\u8C31\u5931\u8D25");case 4:case"end":return i.stop()}},S)}));return function(){return j.apply(this,arguments)}}(),v=function(){var j=(0,p.Z)((0,a.Z)().mark(function S(){var w,d,i,s;return(0,a.Z)().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(e.storeId){r.next=2;break}return r.abrupt("return",[]);case 2:return r.next=4,De({current:1,pageSize:999,storeId:e.storeId});case 4:w=r.sent,w.statusCode===200&&(s=[],(d=w.data)===null||d===void 0||(i=d.data)===null||i===void 0||i.forEach(function(c){s.push(c.id)}),k(s));case 6:case"end":return r.stop()}},S)}));return function(){return j.apply(this,arguments)}}();return(0,y.useEffect)(function(){v()},[]),(0,u.jsx)(_.Z,{destroyOnClose:!0,width:1200,title:"\u7ED1\u5B9A\u83DC\u8C31",visible:e.open,onOk:M,onCancel:e.onCancel,children:(0,u.jsx)(q.ZP,{columns:T,actionRef:o,pagination:{pageSize:10},request:(0,p.Z)((0,a.Z)().mark(function j(){var S,w,d,i,s=arguments;return(0,a.Z)().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(S=s.length>0&&s[0]!==void 0?s[0]:{},w=s.length>1?s[1]:void 0,d=s.length>2?s[2]:void 0,!e.storeId){r.next=12;break}return r.next=6,Xe((0,z.Z)({},S));case 6:if(i=r.sent,i.statusCode!==200){r.next=11;break}return r.abrupt("return",{data:i.data.data,success:!0,total:i.data.total});case 11:return r.abrupt("return",[]);case 12:return r.abrupt("return",[]);case 13:case"end":return r.stop()}},j)})),rowSelection:{type:"checkbox",selectedRowKeys:m,onSelect:function(S,w){var d=(0,te.Z)(m),i=d.findIndex(function(s){return s===S.id});w?i<0&&d.push(S.id):i>-1&&d.splice(i,1),k(d)},onSelectAll:function(S,w,d){var i=(0,te.Z)(m);S?w.forEach(function(s){if(!!s){var l=i.findIndex(function(r){return r===s.id});l<0&&i.push(s.id)}}):d.forEach(function(s){var l=i.findIndex(function(r){return r===s.id});l>-1&&i.splice(l,1)}),k(i)}},tableAlertOptionRender:function(){return(0,u.jsx)(Me.Z,{size:16,children:(0,u.jsx)(ee.Z,{title:"\u6B64\u64CD\u4F5C\u4F1A\u53D6\u6D88\u6240\u6709\u9009\u4E2D\u9879\uFF0C\u786E\u5B9A\u8981\u53D6\u6D88\u5417\uFF1F",onConfirm:function(){return k([])},okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",children:(0,u.jsx)("a",{children:"\u53D6\u6D88\u9009\u62E9"})})})},rowKey:"id",headerTitle:"\u83DC\u8C31\u5217\u8868"})})},ut=at;let st=n=>crypto.getRandomValues(new Uint8Array(n)),ot=(n,e,o)=>{let t=(2<<Math.log(n.length-1)/Math.LN2)-1,Z=-~(1.6*t*e/n.length);return(m=e)=>{let k="";for(;;){let T=o(Z),M=Z;for(;M--;)if(k+=n[T[M]&t]||"",k.length===m)return k}}},Wt=(n,e=21)=>ot(n,e,st),it=(n=21)=>crypto.getRandomValues(new Uint8Array(n)).reduce((e,o)=>(o&=63,o<36?e+=o.toString(36):o<62?e+=(o-26).toString(36).toUpperCase():o>62?e+="-":e+="_",e),"");var lt=function(e){var o=Q.Z.Option,t=Q.Z.OptGroup;return(0,u.jsx)(_.Z,{title:e.values.id?"\u7F16\u8F91":"\u65B0\u5EFA",width:640,visible:e.createModalVisible,bodyStyle:{padding:"32px 40px 1px 48px"},footer:null,onCancel:function(){e.onCancel()},destroyOnClose:!0,children:(0,u.jsxs)(N.Z,{layout:"vertical",preserve:!1,initialValues:e.values,onFinish:e.onFinish,children:[(0,u.jsx)(N.Z.Item,{name:"id",hidden:!0,children:(0,u.jsx)(H.Z,{})}),(0,u.jsx)(N.Z.Item,{label:"\u83DC\u8C31\u7F16\u7801",hidden:!0,name:"code",initialValue:it(20),rules:[{required:!0,max:20}],children:(0,u.jsx)(H.Z,{})}),(0,u.jsx)(N.Z.Item,{label:"\u83DC\u8C31\u540D\u79F0",name:"name",rules:[{required:!0,max:20}],children:(0,u.jsx)(H.Z,{})}),(0,u.jsx)(N.Z.Item,{label:"\u6392\u5E8F",name:"sort",rules:[{required:!0}],children:(0,u.jsx)(H.Z,{type:"number"})}),(0,u.jsxs)(N.Z.Item,{children:[(0,u.jsx)(X.Z,{htmlType:"button",style:{float:"right",left:10},onClick:e.onCancel,children:"\u53D6\u6D88"}),(0,u.jsx)(X.Z,{type:"primary",htmlType:"submit",style:{float:"right"},children:"\u4FDD\u5B58"})]})]})})},dt=lt,ct=[{title:"\u5546\u54C1id",dataIndex:"id",tip:"\u89C4\u5219\u540D\u79F0\u662F\u552F\u4E00\u7684 key",hideInSearch:!0,hideInTable:!0},{title:"\u5546\u54C1\u540D\u79F0",dataIndex:"name"}],ft=function(e){var o=(0,y.useRef)(),t=(0,y.useState)([]),Z=(0,D.Z)(t,2),m=Z[0],k=Z[1],T=(0,y.useState)([]),M=(0,D.Z)(T,2),v=M[0],j=M[1],S=function(){var d=(0,p.Z)((0,a.Z)().mark(function i(){var s,l,r;return(0,a.Z)().wrap(function(h){for(;;)switch(h.prev=h.next){case 0:if((s=e.foodMenu)!==null&&s!==void 0&&s.id){h.next=2;break}return h.abrupt("return");case 2:return l={goodsIds:[],foodMenuId:e.foodMenu.id},m.forEach(function(g){l.goodsIds.push({goodsId:g})}),l.storeId=e.storeId,h.next=7,Ne(l);case 7:r=h.sent,r.statusCode===200?(F.default.success("\u66F4\u65B0\u83DC\u8C31\u5546\u54C1\u6210\u529F\uFF01"),e.onOk()):F.default.error(JSON.stringify(r.errors)||"\u66F4\u65B0\u83DC\u8C31\u5546\u54C1\u51FA\u9519");case 9:case"end":return h.stop()}},i)}));return function(){return d.apply(this,arguments)}}(),w=function(){var d=(0,p.Z)((0,a.Z)().mark(function i(){var s,l,r,c;return(0,a.Z)().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:if(!e.foodMenu.id){g.next=5;break}return g.next=3,We({current:1,pageSize:999,FoodMenuId:e.foodMenu.id});case 3:s=g.sent,s.statusCode===200&&(c=[],(l=s.data)===null||l===void 0||(r=l.data)===null||r===void 0||r.forEach(function(L){c.push(L.goodid)}),k(c));case 5:case"end":return g.stop()}},i)}));return function(){return d.apply(this,arguments)}}();return(0,y.useEffect)(function(){w()},[]),(0,u.jsxs)(_.Z,{width:800,footer:null,bodyStyle:{padding:"32px 40px 1px 48px",height:"912px"},title:e.foodMenu.name,visible:e.open,onOk:S,onCancel:e.onCancel,children:[(0,u.jsx)(q.ZP,{columns:ct,actionRef:o,pagination:{pageSize:10},rowSelection:{type:"checkbox",selectedRowKeys:m,onSelect:function(i,s){var l=(0,te.Z)(m),r=l.findIndex(function(c){return c===i.id});s?r<0&&l.push(i.id):r>-1&&l.splice(r,1),k(l)},onSelectAll:function(i,s,l){var r=(0,te.Z)(m);i?(console.log("11111111"),console.log(r),s.forEach(function(c){if(!!c){var h=r.findIndex(function(g){return g===c.id});h<0&&r.push(c.id)}})):l.forEach(function(c){var h=r.findIndex(function(g){return g===c.id});h>-1&&r.splice(h,1)}),k(r)}},tableAlertOptionRender:function(){return(0,u.jsx)(Me.Z,{size:16,children:(0,u.jsx)(ee.Z,{title:"\u6B64\u64CD\u4F5C\u4F1A\u53D6\u6D88\u6240\u6709\u9009\u4E2D\u9879\uFF0C\u786E\u5B9A\u8981\u53D6\u6D88\u5417\uFF1F",onConfirm:function(){return k([])},okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",children:(0,u.jsx)("a",{children:"\u53D6\u6D88\u9009\u62E9"})})})},request:(0,p.Z)((0,a.Z)().mark(function d(){var i,s,l,r,c=arguments;return(0,a.Z)().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return i=c.length>0&&c[0]!==void 0?c[0]:{},s=c.length>1?c[1]:void 0,l=c.length>2?c[2]:void 0,i.FoodMenuId=e.foodMenu.id,g.next=6,Ue(i);case 6:if(r=g.sent,r.statusCode!==200){g.next=11;break}return g.abrupt("return",{data:r.data.data,success:!0,total:r.data.total});case 11:return g.abrupt("return",[]);case 12:case"end":return g.stop()}},d)})),rowKey:"id",headerTitle:"\u5546\u54C1\u5217\u8868"}),(0,u.jsx)(X.Z,{htmlType:"button",style:{float:"right",left:10},onClick:e.onCancel,children:"\u53D6\u6D88"}),(0,u.jsx)(X.Z,{type:"primary",htmlType:"submit",style:{float:"right"},onClick:function(){return S()},children:"\u4FDD\u5B58"})]})},pt=ft,Nt=Ae.Z.TabPane,Lt="message",ht=function(e){var o=(0,y.useRef)(),t=(0,y.useState)([]),Z=(0,D.Z)(t,2),m=Z[0],k=Z[1],T=(0,y.useState)(),M=(0,D.Z)(T,2),v=M[0],j=M[1],S=(0,y.useState)(!1),w=(0,D.Z)(S,2),d=w[0],i=w[1],s=(0,y.useState)(),l=(0,D.Z)(s,2),r=l[0],c=l[1],h=(0,y.useState)(!1),g=(0,D.Z)(h,2),L=g[0],J=g[1],ne=(0,y.useState)(),re=(0,D.Z)(ne,2),K=re[0],Y=re[1],C=(0,y.useState)(!1),R=(0,D.Z)(C,2),G=R[0],O=R[1],I=(0,y.useState)(!1),ae=(0,D.Z)(I,2),b=ae[0],xe=ae[1],vt=function(){var B=(0,p.Z)((0,a.Z)().mark(function P(){var E,V;return(0,a.Z)().wrap(function(W){for(;;)switch(W.prev=W.next){case 0:return W.next=2,Pe({current:1,pageSize:999});case 2:E=W.sent,E.statusCode===200?((V=E.data)===null||V===void 0||V.forEach(function(x){x.value=x.id,x.label=x.name}),E.data.length>0&&j(E.data[0].id),k(E.data)):F.default.error(JSON.stringify(E.errors)||"\u83B7\u53D6\u95E8\u5E97\u5217\u8868\u5931\u8D25\uFF01");case 4:case"end":return W.stop()}},P)}));return function(){return B.apply(this,arguments)}}(),gt=[{title:"\u5E97\u94FA",dataIndex:"storeId",valueType:"select",hideInTable:!0,fieldProps:{options:m,value:v,onChange:function(P){j(P)}}},{title:"\u83DC\u8C31\u540D\u79F0",dataIndex:"name",hideInSearch:!0},{title:"\u64CD\u4F5C",dataIndex:"option",valueType:"option",fixed:"right",width:300,render:function(P,E){return[(0,u.jsx)("a",{onClick:function(){O(!0),Y(E)},children:"\u66F4\u65B0"},"food-menu-list"),(0,u.jsx)("a",{onClick:function(){Y(E),xe(!0)},children:"\u83DC\u8C31\u5173\u8054\u5546\u54C1"},"food-menu-list"),(0,u.jsx)("a",{onClick:function(){c(E),i(!0)},children:"\u83DC\u8C31\u5546\u54C1"},"food-menu-list")]}}];return(0,y.useEffect)(function(){vt()},[]),(0,y.useEffect)(function(){v&&o.current&&o.current.reload()},[v]),(0,u.jsxs)(Re.ZP,{header:{title:"",breadcrumb:{}},children:[(0,u.jsx)(q.ZP,{columns:gt,actionRef:o,scroll:{x:1300},pagination:{pageSize:10},request:(0,p.Z)((0,a.Z)().mark(function B(){var P,E,V,U,W=arguments;return(0,a.Z)().wrap(function($){for(;;)switch($.prev=$.next){case 0:if(P=W.length>0&&W[0]!==void 0?W[0]:{},E=W.length>1?W[1]:void 0,V=W.length>2?W[2]:void 0,v){$.next=5;break}return $.abrupt("return",[]);case 5:return $.next=7,De((0,z.Z)((0,z.Z)({},P),{},{storeId:v}));case 7:if(U=$.sent,U.statusCode!==200){$.next=10;break}return $.abrupt("return",{data:U.data.data,success:!0,total:U.data.total});case 10:return $.abrupt("return",[]);case 11:case"end":return $.stop()}},B)})),rowKey:"id",headerTitle:"\u83DC\u8C31\u5217\u8868",toolBarRender:function(){return[(0,u.jsx)(X.Z,{icon:(0,u.jsx)(Te.Z,{}),onClick:function(){O(!0)},type:"primary",children:"\u6DFB\u52A0\u83DC\u8C31"},"button")]}}),d&&v&&r&&(0,u.jsx)(rt,{foodMenu:r,open:d,storeId:v,onCancel:function(){return i(!1)},onOk:function(){return i(!1)}}),L&&v&&(0,u.jsx)(ut,{open:L,storeId:v,onCancel:function(){return J(!1)},onOk:function(){var P;J(!1),(P=o.current)===null||P===void 0||P.reload()}}),(0,u.jsx)(dt,{onFinish:function(){var B=(0,p.Z)((0,a.Z)().mark(function P(E){var V,U;return(0,a.Z)().wrap(function(x){for(;;)switch(x.prev=x.next){case 0:if(U=!1,!E.id){x.next=13;break}return x.prev=2,x.next=5,Be(JSON.stringify(E)).then(function($){$.data?(F.default.success("\u4FEE\u6539\u6210\u529F"),U=!0):(F.default.error($.errors||"\u4FEE\u6539\u5931\u8D25"),U=!1)});case 5:x.next=11;break;case 7:x.prev=7,x.t0=x.catch(2),F.default.error("\u4FEE\u6539\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01"),U=!1;case 11:x.next=23;break;case 13:return x.prev=13,E.storeId=v,x.next=17,$e(JSON.stringify(E)).then(function($){$.data?(F.default.success("\u6DFB\u52A0\u6210\u529F"),U=!0):(F.default.error($.errors||"\u6DFB\u52A0\u5931\u8D25"),U=!1)});case 17:x.next=23;break;case 19:x.prev=19,x.t1=x.catch(13),F.default.error("\u6DFB\u52A0\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01",x.t1),U=!1;case 23:console.log("success",U),U&&(O(!1),Y(void 0)),(V=o.current)===null||V===void 0||V.reload();case 26:case"end":return x.stop()}},P,null,[[2,7],[13,19]])}));return function(P){return B.apply(this,arguments)}}(),onCancel:function(){O(!1),Y(void 0)},createModalVisible:G,values:K||{}}),v&&K&&b&&(0,u.jsx)(pt,{foodMenu:K,open:b,storeId:v,onOk:function(){xe(!1)},onCancel:function(){return xe(!1)}})]})},mt=ht},98858:function(Ee,ue,f){"use strict";var Ge=f(38663),X=f.n(Ge),z=f(52953),a=f.n(z)}}]);
|