包含后厨 团餐 门店分支
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

2 lines
16 KiB

  1. (self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[351],{20173:function(Se,ee,a){"use strict";a.d(ee,{lM:function(){return P},IH:function(){return me},mm:function(){return v},eP:function(){return te},FM:function(){return ve}});var A=a(39428),Y=a(11849),r=a(3182),N=a(48971);function P(c,d){return m.apply(this,arguments)}function m(){return m=(0,r.Z)((0,A.Z)().mark(function c(d,$){return(0,A.Z)().wrap(function(q){for(;;)switch(q.prev=q.next){case 0:return q.abrupt("return",(0,N.WY)("/saasbase/api/organize/page",{method:"POST",data:(0,Y.Z)({},d)}));case 1:case"end":return q.stop()}},c)})),m.apply(this,arguments)}function me(c){return J.apply(this,arguments)}function J(){return J=(0,r.Z)((0,A.Z)().mark(function c(d){return(0,A.Z)().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return s.abrupt("return",(0,N.WY)("/saasbase/api/organize/addorg",{method:"POST",data:(0,Y.Z)({},d)}));case 1:case"end":return s.stop()}},c)})),J.apply(this,arguments)}function x(c){return Q.apply(this,arguments)}function Q(){return Q=_asyncToGenerator(_regeneratorRuntime().mark(function c(d){return _regeneratorRuntime().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return s.abrupt("return",request("\u200B/kitchen/api\u200B/organize/getorglist",{method:"POST",data:_objectSpread({},d)}));case 1:case"end":return s.stop()}},c)})),Q.apply(this,arguments)}function v(c){return X.apply(this,arguments)}function X(){return X=(0,r.Z)((0,A.Z)().mark(function c(d){return(0,A.Z)().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return s.abrupt("return",(0,N.WY)("\u200B/kitchen/api\u200B/organize/deleteorg",{method:"POST",data:(0,Y.Z)({},d)}));case 1:case"end":return s.stop()}},c)})),X.apply(this,arguments)}function te(c){return H.apply(this,arguments)}function H(){return H=(0,r.Z)((0,A.Z)().mark(function c(d){return(0,A.Z)().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return s.abrupt("return",(0,N.WY)("\u200B/saasbase/api\u200B/organize/updateorg",{method:"POST",data:(0,Y.Z)({},d)}));case 1:case"end":return s.stop()}},c)})),H.apply(this,arguments)}function Ce(c){return K.apply(this,arguments)}function K(){return K=_asyncToGenerator(_regeneratorRuntime().mark(function c(d){return _regeneratorRuntime().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return s.abrupt("return",request("/saasbase/api\u200B/sysOrg\u200B/detail",{method:"POST",data:_objectSpread({},d)}));case 1:case"end":return s.stop()}},c)})),K.apply(this,arguments)}function ve(c){return z.apply(this,arguments)}function z(){return z=(0,r.Z)((0,A.Z)().mark(function c(d){return(0,A.Z)().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return s.abrupt("return",(0,N.WY)("\u200B/saasbase/api\u200B/organize/tree",{method:"GET",data:(0,Y.Z)({},d)}));case 1:case"end":return s.stop()}},c)})),z.apply(this,arguments)}},46858:function(Se,ee,a){"use strict";a.r(ee),a.d(ee,{default:function(){return Ye}});var A=a(57663),Y=a(71577),r=a(39428),N=a(34792),P=a(48086),m=a(3182),me=a(62350),J=a(24565),x=a(2824),Q=a(49101),v=a(67294),X=a(28790),te=a(85224),H=a(16894),Ce=a(71194),K=a(50146),ve=a(47673),z=a(4107),c=a(9715),d=a(55843),$=function(e){return crypto.getRandomValues(new Uint8Array(e))},s=function(e,i,n){var k=(2<<Math.log(e.length-1)/Math.LN2)-1,I=-~(1.6*k*i/e.length);return function(){for(var T=arguments.length>0&&arguments[0]!==void 0?arguments[0]:i,M="";;)for(var S=n(I),F=I;F--;)if(M+=e[S[F]&k]||"",M.length===T)return M}},q=function(e){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:21;return s(e,i,$)},we=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:21;return crypto.getRandomValues(new Uint8Array(e)).reduce(function(i,n){return n&=63,n<36?i+=n.toString(36):n<62?i+=(n-26).toString(36).toUpperCase():n>62?i+="-":i+="_",i},"")},t=a(85893),xe=function(e){var i=(0,v.useState)(),n=(0,x.Z)(i,2),k=n[0],I=n[1],T=d.Z.useForm(),M=(0,x.Z)(T,1),S=M[0];return(0,v.useEffect)(function(){var F;if(console.log(e.values),e!=null&&(F=e.values)!==null&&F!==void 0&&F.id){var R,V,C,D;S.setFieldsValue({id:e==null||(R=e.values)===null||R===void 0?void 0:R.id,name:e==null||(V=e.values)===null||V===void 0?void 0:V.name,code:e==null||(C=e.values)===null||C===void 0?void 0:C.code}),I(e==null||(D=e.values)===null||D===void 0?void 0:D.orgId)}else S.resetFields()},[e.values]),(0,t.jsx)(K.Z,{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:(0,t.jsxs)(d.Z,{layout:"Horizontal",labelCol:{span:4},preserve:!1,form:S,onFinish:e.onFinish,children:[(0,t.jsx)(d.Z.Item,{name:"id",hidden:!0,children:(0,t.jsx)(z.Z,{})}),(0,t.jsx)(d.Z.Item,{label:"\u83DC\u8C31\u7F16\u7801",name:"code",initialValue:we(20),rules:[{required:!0,max:50}],children:(0,t.jsx)(z.Z,{})}),(0,t.jsx)(d.Z.Item,{label:"\u83DC\u8C31\u540D\u79F0",name:"name",rules:[{required:!0,max:50}],children:(0,t.jsx)(z.Z,{})}),(0,t.jsx)(d.Z.Item,{children:(0,t.jsx)(Y.Z,{type:"primary",htmlType:"submit",children:"\u4FDD\u5B58"})})]})})},Fe=xe,pe=a(86582),je=a(11849),W=a(48971);function be(u){return ae.apply(this,arguments)}function ae(){return ae=(0,m.Z)((0,r.Z)().mark(function u(e){return(0,r.Z)().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",(0,W.WY)("/saasstore/api/foodmenu/page",{method:"POST",data:e}));case 1:case"end":return n.stop()}},u)})),ae.apply(this,arguments)}function Ee(u){return re.apply(this,arguments)}function re(){return re=(0,m.Z)((0,r.Z)().mark(function u(e){return(0,r.Z)().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",(0,W.WY)("/saasstore/api/foodmenu/add",{method:"POST",data:e}));case 1:case"end":return n.stop()}},u)})),re.apply(this,arguments)}function Ae(u){return ue.apply(this,arguments)}function ue(){return ue=(0,m.Z)((0,r.Z)().mark(function u(e){return(0,r.Z)().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",(0,W.WY)("/saasstore/api/foodmenu/update",{method:"POST",data:e}));case 1:case"end":return n.stop()}},u)})),ue.apply(this,arguments)}function Pe(u){return se.apply(this,arguments)}function se(){return se=(0,m.Z)((0,r.Z)().mark(function u(e){return(0,r.Z)().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",(0,W.WY)("/saasstore/api/foodmenu/delete",{method:"POST",data:e}));case 1:case"end":return n.stop()}},u)})),se.apply(this,arguments)}function Te(u){return ie.apply(this,arguments)}function ie(){return ie=(0,m.Z)((0,r.Z)().mark(function u(e){return(0,r.Z)().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",(0,W.WY)("/saasstore/api/foodmenu/editfoodmenugoods",{method:"POST",data:e}));case 1:case"end":return n.stop()}},u)})),ie.apply(this,arguments)}function Me(u){return le.apply(this,arguments)}function le(){return le=(0,m.Z)((0,r.Z)().mark(function u(e){return(0,r.Z)().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",(0,W.WY)("/saasstore/api/foodmenu/getfoodmenugoods?foodMenuId="+e,{method:"GET"}));case 1:case"end":return n.stop()}},u)})),le.apply(this,arguments)}function De(u){return oe.apply(this,arguments)}function oe(){return oe=(0,m.Z)((0,r.Z)().mark(function u(e){return(0,r.Z)().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",(0,W.WY)("/saasbase/api/goods/page",{method:"POST",data:e}));case 1:case"end":return n.stop()}},u)})),oe.apply(this,arguments)}function Oe(u){return de.apply(this,arguments)}function de(){return de=(0,m.Z)((0,r.Z)().mark(function u(e){return(0,r.Z)().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",(0,W.WY)("\u200B/saasbase/api\u200B/goodstype/tree",{method:"GET",data:(0,je.Z)({},e)}));case 1:case"end":return n.stop()}},u)})),de.apply(this,arguments)}function Ie(){return ce.apply(this,arguments)}function ce(){return ce=(0,m.Z)((0,r.Z)().mark(function u(){return(0,r.Z)().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return i.abrupt("return",(0,W.WY)("/saasbase/api/device/list",{method:"GET"}));case 1:case"end":return i.stop()}},u)})),ce.apply(this,arguments)}var Re=function(e){var i=(0,v.useRef)(),n=(0,v.useState)(),k=(0,x.Z)(n,2),I=k[0],T=k[1],M=(0,v.useState)([]),S=(0,x.Z)(M,2),F=S[0],R=S[1],V=(0,v.useState)([]),C=(0,x.Z)(V,2),D=C[0],G=C[1];(0,v.useEffect)(function(){var j;console.log(e.values),Oe().then(function(f){T(f.data)}),Me(e==null||(j=e.values)===null||j===void 0?void 0:j.id).then(function(f){if(f.data.length>0){var b=f.data.map(function(g){return g.goodsId});G(b)}else G([])})},[e.values]);var fe=[{title:"\u4E3B\u952E",dataIndex:"id",hideInSearch:!0,hideInTable:!0,tip:"\u89C4\u5219\u540D\u79F0\u662F\u552F\u4E00\u7684 key"},{title:"\u5546\u54C1\u7C7B\u578B",dataIndex:"goodsTypeName",valueType:"treeSelect",hideInTable:!0,fieldProps:{showSearch:!0,allowClear:!0,options:I}},{title:"\u5546\u54C1\u540D\u79F0",dataIndex:"name",search:!0}];return(0,t.jsx)(K.Z,{title:"\u5173\u8054\u5546\u54C1",width:1040,visible:e.foodMenuGoodsModalVisible,bodyStyle:{padding:"32px 40px 48px"},okText:"\u4FDD\u5B58",cancelText:"\u53D6\u6D88",onOk:function(){if(console.log(F),console.log(e.values),F.length>0){var f=F.map(function(g){return g.id}),b={foodMenuId:e.values.id,GoodsIds:f};e.handleOk(b)}else P.default.error("\u8BF7\u9009\u62E9\u5546\u54C1")},onCancel:function(){e.onCancel()},destroyOnClose:!0,children:(0,t.jsx)(H.ZP,{headerTitle:"\u5546\u54C1\u4FE1\u606F",actionRef:i,rowKey:"id",pagination:{defaultPageSize:10},search:{labelWidth:120},request:function(){var j=(0,m.Z)((0,r.Z)().mark(function f(b){var g,y;return(0,r.Z)().wrap(function(E){for(;;)switch(E.prev=E.next){case 0:return g=[],y=0,E.next=4,De(b).then(function(L){g=L.data.data,y=L.data.total});case 4:return E.abrupt("return",{data:g,success:!0,total:y});case 5:case"end":return E.stop()}},f)}));return function(f){return j.apply(this,arguments)}}(),columns:fe,rowSelection:{type:"checkbox",selectedRowKeys:D,onSelect:function(f,b){var g=(0,pe.Z)(D);console.log(f),console.log(g);var y=g.findIndex(function(Z){return Z===f.id});b?y<0&&g.push(f.id):y>-1&&g.splice(y,1),G(g)},onSelectAll:function(f,b,g){var y=(0,pe.Z)(D);f?b.forEach(function(Z){if(!!Z){var E=y.findIndex(function(L){return L===Z.id});E<0&&y.push(Z.id)}}):g.forEach(function(Z){var E=y.findIndex(function(L){return L===Z.id});E>-1&&y.splice(E,1)}),G(y)},onChange:function(f,b){R(b)}}})})},Ge=Re,Ne=a(63185),_=a(9676),He=a(13062),ge=a(71230),Je=a(89032),Ze=a(15746),Qe=a(43358),Be=a(34041),We=function(e){var i=d.Z.useForm(),n=(0,x.Z)(i,1),k=n[0],I=(0,v.useState)([]),T=(0,x.Z)(I,2),M=T[0],S=T[1],F=[{label:"\u5546\u54C1",value:"1"},{label:"\u7269\u6599",value:"2"},{label:"\u5DE5\u827A",value:"3"},{label:"\u914D\u65B9",value:"4"}];(0,v.useEffect)(function(){console.log(e.values),Ie().then(function(C){var D=C.data.map(function(G){return{value:G.id,label:G.name}});S(D)})},[e.values]);var R=function(){},V=function(){};return(0,t.jsxs)(K.Z,{title:"\u4E0B\u53D1\u6570\u636E",width:840,visible:e.pushdeviceModalVisible,bodyStyle:{padding:"14px 20px 18px"},okText:"\u4FDD\u5B58",cancelText:"\u53D6\u6D88",onOk:function(){},onCancel:function(){e.onCancel()},destroyOnClose:!0,children:[(0,t.jsx)(ge.Z,{gutter:26,children:(0,t.jsxs)(Ze.Z,{lg:24,md:24,sm:24,children:["\u9009\u62E9\u8BBE\u5907\uFF1A",(0,t.jsx)(Be.Z,{mode:"multiple",allowClear:!0,style:{width:"60%"},placeholder:"\u8BF7\u9009\u62E9\u8981\u4E0B\u53D1\u8BBE\u5907",onChange:R,options:M})]})}),(0,t.jsx)(ge.Z,{gutter:26,children:(0,t.jsxs)(Ze.Z,{span:24,children:["\u9009\u62E9\u6570\u636E\uFF1A",(0,t.jsxs)(_.Z.Group,{defaultValue:["1","2"],onChange:V,children:[(0,t.jsx)(_.Z,{value:"1",children:"\u5546\u54C1"}),(0,t.jsx)("a",{style:{marginLeft:2,marginRight:30},children:"\u3010\u9009\u62E9\u5546\u54C1\u3011"}),(0,t.jsx)(_.Z,{value:"2",children:"\u7269\u6599 "}),(0,t.jsx)("a",{style:{marginLeft:2,marginRight:30},children:"\u3010\u9009\u62E9\u7269\u6599\u3011"}),(0,t.jsx)(_.Z,{value:"3",children:"\u5DE5\u827A"}),(0,t.jsx)("a",{style:{marginLeft:2,marginRight:30},children:"\u3010\u9009\u62E9\u5DE5\u827A\u3011"}),(0,t.jsx)(_.Z,{value:"4",children:"\u914D\u65B9"}),(0,t.jsx)("a",{style:{marginLeft:2,marginRight:30},children:"\u3010\u9009\u62E9\u914D\u65B9\u3011"})]})]})})]})},ke=We,Ve=a(20173),Xe="message",Le=function(){var e=(0,v.useState)([]),i=(0,x.Z)(e,2),n=i[0],k=i[1];(0,v.useEffect)(function(){(0,Ve.FM)().then(function(p){k(p.data)})},[]);var I=(0,v.useState)(!1),T=(0,x.Z)(I,2),M=T[0],S=T[1],F=(0,v.useState)(!1),R=(0,x.Z)(F,2),V=R[0],C=R[1],D=(0,v.useState)(!1),G=(0,x.Z)(D,2),fe=G[0],j=G[1],f=(0,v.useRef)(),b=(0,v.useState)(),g=(0,x.Z)(b,2),y=g[0],Z=g[1],E=(0,v.useState)([]),L=(0,x.Z)(E,2),ne=L[0],ye=L[1],$e=[{title:"\u4E3B\u952E",dataIndex:"id",hideInSearch:!0,hideInTable:!0,tip:"\u89C4\u5219\u540D\u79F0\u662F\u552F\u4E00\u7684 key"},{title:"\u83DC\u8C31\u7F16\u7801",dataIndex:"code",search:!0},{title:"\u83DC\u8C31\u540D\u79F0",dataIndex:"name"},{title:"\u64CD\u4F5C",dataIndex:"option",valueType:"option",fixed:"right",width:400,render:function(h,l){return[(0,t.jsx)("a",{onClick:function(){S(!0),Z(l)},children:"\u66F4\u65B0"},"update"),(0,t.jsx)(J.Z,{type:"primary",title:"\u786E\u8BA4\u5220\u9664\u5417\uFF1F",okText:"\u662F",cancelText:"\u5426",onConfirm:function(){var o=[{id:l.id}];Ue(o)},onCancel:function(){},children:(0,t.jsx)("a",{href:"#",children:"\u5220\u9664"})},"primary"),(0,t.jsx)("a",{onClick:function(){C(!0),Z(l)},children:"\u5173\u8054\u5546\u54C1"},"update"),(0,t.jsx)("a",{onClick:function(){j(!0),Z(l)},children:"\u4E0B\u53D1"},"update")]}}],Ke=function(){var p=(0,m.Z)((0,r.Z)().mark(function h(l){return(0,r.Z)().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,Ee(JSON.stringify(l)).then(function(O){O.succeeded?(P.default.success("\u6DFB\u52A0\u6210\u529F"),S(!1),Z(void 0),f.current.reload()):P.default.error(O.errors)});case 2:case"end":return o.stop()}},h)}));return function(l){return p.apply(this,arguments)}}(),ze=function(){var p=(0,m.Z)((0,r.Z)().mark(function h(l){return(0,r.Z)().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,Ae(JSON.stringify(l)).then(function(O){O.succeeded?(P.default.success("\u4FEE\u6539\u6210\u529F"),S(!1),Z(void 0),f.current.reload()):P.default.error(O.errors)});case 2:case"end":return o.stop()}},h)}));return function(l){return p.apply(this,arguments)}}(),Ue=function(){var p=(0,m.Z)((0,r.Z)().mark(function h(l){var w;return(0,r.Z)().wrap(function(O){for(;;)switch(O.prev=O.next){case 0:return w=[],l.forEach(function(B){w.push(B.id)}),O.next=4,Pe(w).then(function(B){if(B.succeeded){var U,he;P.default.success("\u5220\u9664\u6210\u529F"),ye([]),(U=f.current)===null||U===void 0||(he=U.reloadAndRest)===null||he===void 0||he.call(U)}else P.default.error(B.errors)});case 4:case"end":return O.stop()}},h)}));return function(l){return p.apply(this,arguments)}}();return(0,t.jsxs)(X.ZP,{host:!0,header:{title:"",breadcrumb:{}},children:[(0,t.jsx)(H.ZP,{headerTitle:"\u573A\u666F\u4FE1\u606F",actionRef:f,rowKey:"id",pagination:{defaultPageSize:10},search:{labelWidth:120},toolBarRender:function(){return[(0,t.jsxs)(Y.Z,{type:"primary",onClick:function(){S(!0)},children:[(0,t.jsx)(Q.Z,{})," \u65B0\u5EFA"]},"primary")]},request:function(){var p=(0,m.Z)((0,r.Z)().mark(function h(l){var w,o;return(0,r.Z)().wrap(function(B){for(;;)switch(B.prev=B.next){case 0:return w=[],o=0,B.next=4,be(l).then(function(U){w=U.data.data,o=U.data.total});case 4:return B.abrupt("return",{data:w,success:!0,total:o});case 5:case"end":return B.stop()}},h)}));return function(h){return p.apply(this,arguments)}}(),columns:$e,rowSelection:{onChange:function(h,l){ye(l)}}}),(ne==null?void 0:ne.length)>0&&(0,t.jsx)(te.Z,{extra:(0,t.jsxs)("div",{children:["\u5DF2\u9009\u62E9"," ",(0,t.jsx)("a",{style:{fontWeight:600},children:ne.length})," ","\u9879 \xA0\xA0"]})}),(0,t.jsx)(Fe,{OrgList:n,onFinish:function(){var p=(0,m.Z)((0,r.Z)().mark(function h(l){return(0,r.Z)().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:if(!l.id){o.next=5;break}return o.next=3,ze(l);case 3:o.next=7;break;case 5:return o.next=7,Ke(l);case 7:case"end":return o.stop()}},h)}));return function(h){return p.apply(this,arguments)}}(),onCancel:function(){S(!1),Z(void 0)},createModalVisible:M,values:y||{}}),(0,t.jsx)(Ge,{foodMenuGoodsModalVisible:V,values:y||{},onCancel:function(){C(!1),Z(void 0)},handleOk:function(h){console.log(h),Te(h).then(function(l){l.succeeded?(P.default.success("\u4FDD\u5B58\u6210\u529F"),C(!1),Z(void 0)):P.default.error(l.errors)})}}),(0,t.jsx)(ke,{pushdeviceModalVisible:fe,values:y||{},onCancel:function(){j(!1),Z(void 0)},handleOk:function(h){}})]})},Ye=Le}}]);