|
- (self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[6059],{96798:function(se,M,n){"use strict";n.r(M),n.d(M,{default:function(){return ne}});var ue=n(57663),T=n(71577),le=n(62350),b=n(24565),s=n(39428),ie=n(34792),m=n(48086),f=n(3182),x=n(2824),Y=n(49101),g=n(67294),N=n(28790),U=n(85224),G=n(48971);function z(){return $.apply(this,arguments)}function $(){return $=(0,f.Z)((0,s.Z)().mark(function i(){return(0,s.Z)().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return c.abrupt("return",(0,G.WY)("/saasbase/api/goods/getgoodslist",{method:"get"}));case 1:case"end":return c.stop()}},i)})),$.apply(this,arguments)}function J(i){return w.apply(this,arguments)}function w(){return w=(0,f.Z)((0,s.Z)().mark(function i(r){return(0,s.Z)().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(0,G.WY)("/storemanagement/api/FoodMenu/PlusAddGoods",{method:"POST",data:r}));case 1:case"end":return t.stop()}},i)})),w.apply(this,arguments)}function K(i){return P.apply(this,arguments)}function P(){return P=(0,f.Z)((0,s.Z)().mark(function i(r){return(0,s.Z)().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(0,G.WY)("/storemanagement/api/FoodMenu/GetAddGoodsPageAsync",{method:"POST",data:r}));case 1:case"end":return t.stop()}},i)})),P.apply(this,arguments)}function H(i){return B.apply(this,arguments)}function B(){return B=(0,f.Z)((0,s.Z)().mark(function i(r){return(0,s.Z)().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(0,G.WY)("\u200B/storemanagement/api/FoodMenu/BatchDelPlusAddGoodsAsync?Ids="+r,{method:"POST",data:r}));case 1:case"end":return t.stop()}},i)})),B.apply(this,arguments)}function oe(i){return D.apply(this,arguments)}function D(){return D=_asyncToGenerator(_regeneratorRuntime().mark(function i(r){return _regeneratorRuntime().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",request("\u200B/kitchen/api\u200B/store\u200B/store-type",{method:"put",data:r}));case 1:case"end":return t.stop()}},i)})),D.apply(this,arguments)}var L=n(16894),de=n(71194),Q=n(50146),ce=n(77883),X=n(21888),fe=n(9715),I=n(55843),he=n(47673),k=n(4107),ve=n(43358),C=n(34041),a=n(85893),q=function(r){var c=C.Z.Option,t=C.Z.OptGroup,O=(0,g.useState)([]),A=(0,x.Z)(O,2),Z=A[0],E=A[1];return(0,g.useEffect)(function(){var v=function(){z().then(function(R){var S,j=[];(S=R.data)===null||S===void 0||S.forEach(function(p){j.push({text:p.name,id:p.id})}),E(j)})};v()},[]),(0,a.jsx)(Q.Z,{title:r.values.id?"\u7F16\u8F91":"\u65B0\u5EFA",width:640,visible:r.createModalVisible,bodyStyle:{padding:"32px 40px 48px"},footer:null,onCancel:function(){r.onCancel()},destroyOnClose:!0,children:(0,a.jsxs)(I.Z,{layout:"vertical",preserve:!1,initialValues:r.values,onFinish:r.onFinish,children:[(0,a.jsx)(I.Z.Item,{name:"id",hidden:!0,children:(0,a.jsx)(k.Z,{})}),(0,a.jsx)(I.Z.Item,{label:"\u5546\u54C1",name:"addGoodsId",rules:[{required:!0}],children:(0,a.jsx)(C.Z,{children:Z.map(function(v,F){return(0,a.jsx)(C.Z.Option,{index:F,value:v.id,children:v.text},v.id)})})}),(0,a.jsx)(I.Z.Item,{label:"\u4EF7\u683C",name:"price",rules:[{required:!0}],children:(0,a.jsx)(X.Z,{placeholder:"\u4EF7\u683C",min:0})}),(0,a.jsx)(I.Z.Item,{children:(0,a.jsx)(T.Z,{type:"primary",htmlType:"submit",children:"\u4FDD\u5B58"})})]})})},_=q,V="message",ee=function(r){var c=(0,g.useState)(!1),t=(0,x.Z)(c,2),O=t[0],A=t[1],Z=(0,g.useRef)(),E=(0,g.useState)(),v=(0,x.Z)(E,2),F=v[0],R=v[1],S=(0,g.useState)([]),j=(0,x.Z)(S,2),p=j[0],re=j[1],te=function(){var d=(0,f.Z)((0,s.Z)().mark(function l(u){return(0,s.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:e.prev=0,m.default.loading("\u6B63\u5728\u6DFB\u52A0",V),J(JSON.stringify(u)).then(function(o){return m.default.destroy(V),o.data?(m.default.success("\u6DFB\u52A0\u6210\u529F"),A(!1),R(void 0),Z.current.reload(),!0):(m.default.error("\u6DFB\u52A0\u5931\u8D25"),!1)}),e.next=9;break;case 5:return e.prev=5,e.t0=e.catch(0),m.default.error("\u6DFB\u52A0\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01"),e.abrupt("return",!1);case 9:case"end":return e.stop()}},l,null,[[0,5]])}));return function(u){return d.apply(this,arguments)}}(),W=function(){var d=(0,f.Z)((0,s.Z)().mark(function l(u){return(0,s.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,H(u).then(function(o){return o.data?(m.default.success("\u5220\u9664\u6210\u529F"),Z.current.reload(),!0):(m.default.error("\u5220\u9664\u5931\u8D25"),!1)});case 3:e.next=9;break;case 5:return e.prev=5,e.t0=e.catch(0),m.default.error("\u5220\u9664\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01"),e.abrupt("return",!1);case 9:case"end":return e.stop()}},l,null,[[0,5]])}));return function(u){return d.apply(this,arguments)}}(),ae=[{title:"\u4E3B\u952E",dataIndex:"id",hideInSearch:!0,hideInTable:!0,tip:"\u89C4\u5219\u540D\u79F0\u662F\u552F\u4E00\u7684 key"},{title:"\u5546\u54C1",dataIndex:"name",valueType:"textarea"},{title:"\u5546\u54C1\u4EF7\u683C",dataIndex:"price",valueType:"money"},{title:"\u72B6\u6001",dataIndex:"status",valueEnum:{0:{text:"\u542F\u7528",status:"Processing"},1:{text:"\u505C\u7528",status:"Success"}}},{title:"\u64CD\u4F5C",dataIndex:"option",valueType:"option",render:function(l,u){return[(0,a.jsx)(b.Z,{title:"\u786E\u5B9A\u8981\u5220\u9664\u5417\uFF1F",onConfirm:(0,f.Z)((0,s.Z)().mark(function h(){return(0,s.Z)().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,W([u.id]);case 2:case"end":return o.stop()}},h)})),okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",children:(0,a.jsx)("a",{href:"#",children:"\u5220\u9664"})},"delete")]}}];return(0,a.jsxs)(N.ZP,{header:{title:"",breadcrumb:{}},children:[(0,a.jsx)(L.ZP,{search:!1,pagination:{pageSize:10},scroll:{x:1300},headerTitle:(r.location.query.values.goods_Name?r.location.query.values.goods_Name:"")+"\u52A0\u8D2D\u5546\u54C1",actionRef:Z,rowKey:"id",toolBarRender:function(){return[(0,a.jsxs)(T.Z,{type:"primary",onClick:function(){A(!0)},children:[(0,a.jsx)(Y.Z,{})," \u6DFB\u52A0\u52A0\u8D2D\u5546\u54C1"]},"primary")]},request:function(){var d=(0,f.Z)((0,s.Z)().mark(function l(u){var h,e;return(0,s.Z)().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:if(!(r.location.query.values.goodsId==null||r.location.query.values.goodsId==null)){y.next=3;break}y.next=10;break;case 3:return u.GoodsId=r.location.query.values.goodsId,u.StoreId=r.location.query.storeId,h=0,y.next=8,K(u);case 8:return e=y.sent,y.abrupt("return",{data:e.data.data,success:!0,total:h});case 10:case"end":return y.stop()}},l)}));return function(l){return d.apply(this,arguments)}}(),columns:ae}),(p==null?void 0:p.length)>0&&(0,a.jsx)(U.Z,{extra:(0,a.jsxs)("div",{children:["\u5DF2\u9009\u62E9"," ",(0,a.jsx)("a",{style:{fontWeight:600},children:p.length})," ","\u9879 \xA0\xA0"]}),children:(0,a.jsx)(T.Z,{onClick:(0,f.Z)((0,s.Z)().mark(function d(){var l,u;return(0,s.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,W(p);case 2:re([]),(l=Z.current)===null||l===void 0||(u=l.reloadAndRest)===null||u===void 0||u.call(l);case 4:case"end":return e.stop()}},d)})),children:"\u5220\u9664"})}),(0,a.jsx)(_,{onFinish:function(){var d=(0,f.Z)((0,s.Z)().mark(function l(u){var h;return(0,s.Z)().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:h=!1,u.GoodsId=r.location.query.values.goodsId,u.StoreId=r.location.query.storeId,h=te(u),Z.current.reload();case 5:case"end":return o.stop()}},l)}));return function(l){return d.apply(this,arguments)}}(),onCancel:function(){A(!1),R(void 0)},createModalVisible:O,values:F||{}})]})},ne=ee}}]);
|