Não pode escolher mais do que 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
 

2 linhas
6.9 KiB

  1. (self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[8362,1322],{75725:function(se,W,n){"use strict";n.r(W),n.d(W,{default:function(){return ae}});var ue=n(57663),T=n(71577),C=n(2824),le=n(34792),f=n(48086),h=n(3182),Y=n(94043),u=n.n(Y),b=n(49101),S=n(67294),N=n(78009),k=n(85224),x=n(48971);function U(r){return F.apply(this,arguments)}function F(){return F=(0,h.Z)(u().mark(function r(t){return u().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,x.WY)("/kitchen/api/goodes/GetAddGoodsPage",{method:"POST",data:t}));case 1:case"end":return e.stop()}},r)})),F.apply(this,arguments)}function z(r){return O.apply(this,arguments)}function O(){return O=(0,h.Z)(u().mark(function r(t){return u().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,x.WY)("/kitchen/api/goodes/PlusAddGoods",{method:"POST",data:t}));case 1:case"end":return e.stop()}},r)})),O.apply(this,arguments)}function ie(r){return D.apply(this,arguments)}function D(){return D=_asyncToGenerator(_regeneratorRuntime.mark(function r(t){return _regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",request("\u200B/kitchen/api\u200B/store\u200B/store-type",{method:"put",data:t}));case 1:case"end":return e.stop()}},r)})),D.apply(this,arguments)}function J(r){return B.apply(this,arguments)}function B(){return B=(0,h.Z)(u().mark(function r(t){return u().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,x.WY)("\u200B/kitchen/api/goodes/DelPlusAddGoods",{method:"POST",data:t}));case 1:case"end":return e.stop()}},r)})),B.apply(this,arguments)}function K(){return E.apply(this,arguments)}function E(){return E=(0,h.Z)(u().mark(function r(){var t;return u().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t={current:1,pageSize:1e3,goods_Enable:0},e.abrupt("return",(0,x.WY)("/kitchen/api/goods/goodss",{method:"Post",data:t}));case 2:case"end":return e.stop()}},r)})),E.apply(this,arguments)}var H=n(16894),de=n(71194),L=n(50146),oe=n(77883),Q=n(85482),ce=n(9715),I=n(86835),fe=n(47673),X=n(4107),he=n(43358),R=n(34041),a=n(85893),q=function(t){var i=R.Z.Option,e=R.Z.OptGroup,l=(0,S.useState)([]),s=(0,C.Z)(l,2),c=s[0],V=s[1];return(0,S.useEffect)(function(){var v=function(){K().then(function(P){var j,A,m=[];(j=P.data)===null||j===void 0||(A=j.data)===null||A===void 0||A.forEach(function(G){m.push({text:G.name,id:G.id})}),V(m)})};v()},[]),(0,a.jsx)(L.Z,{title:t.values.id?"\u7F16\u8F91":"\u65B0\u5EFA",width:640,visible:t.createModalVisible,bodyStyle:{padding:"32px 40px 48px"},footer:null,onCancel:function(){t.onCancel()},destroyOnClose:!0,children:(0,a.jsxs)(I.Z,{layout:"vertical",preserve:!1,initialValues:t.values,onFinish:t.onFinish,children:[(0,a.jsx)(I.Z.Item,{name:"id",hidden:!0,children:(0,a.jsx)(X.Z,{})}),(0,a.jsx)(I.Z.Item,{label:"\u5546\u54C1",name:"addGoodsId",rules:[{required:!0}],children:(0,a.jsx)(R.Z,{children:c.map(function(v,$){return(0,a.jsx)(R.Z.Option,{index:$,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)(Q.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,M="message",ee=function(){var r=(0,h.Z)(u().mark(function t(i){return u().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.prev=0,f.default.loading("\u6B63\u5728\u6DFB\u52A0",M),l.next=4,z(JSON.stringify(i)).then(function(s){return f.default.destroy(M),s.data?(f.default.success("\u6DFB\u52A0\u6210\u529F"),!0):(f.default.error("\u6DFB\u52A0\u5931\u8D25"),!1)});case 4:l.next=10;break;case 6:return l.prev=6,l.t0=l.catch(0),f.default.error("\u6DFB\u52A0\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01"),l.abrupt("return",!1);case 10:case"end":return l.stop()}},t,null,[[0,6]])}));return function(i){return r.apply(this,arguments)}}(),te=function(){var r=(0,h.Z)(u().mark(function t(i){var e;return u().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return s.prev=0,f.default.loading("\u6B63\u5728\u5220\u9664"),e=[],i.forEach(function(c){e.push(c.id)}),s.next=6,J(e).then(function(c){return c.data?(f.default.success("\u5220\u9664\u6210\u529F"),!0):(f.default.success("\u5220\u9664\u5931\u8D25"),!1)});case 6:s.next=12;break;case 8:return s.prev=8,s.t0=s.catch(0),f.default.error("\u5220\u9664\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01"),s.abrupt("return",!1);case 12:case"end":return s.stop()}},t,null,[[0,8]])}));return function(i){return r.apply(this,arguments)}}(),ne=function(t){var i=(0,S.useState)(!1),e=(0,C.Z)(i,2),l=e[0],s=e[1],c=(0,S.useRef)(),V=(0,S.useState)(),v=(0,C.Z)(V,2),$=v[0],P=v[1],j=(0,S.useState)([]),A=(0,C.Z)(j,2),m=A[0],G=A[1],re=[{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"}}}];return(0,a.jsxs)(N.ZP,{children:[(0,a.jsx)(H.ZP,{search:!1,headerTitle:(t.location.query.values.goods_Name?t.location.query.values.goods_Name:"")+"\u52A0\u8D2D\u5546\u54C1",actionRef:c,rowKey:"id",toolBarRender:function(){return[(0,a.jsxs)(T.Z,{type:"primary",onClick:function(){s(!0)},children:[(0,a.jsx)(b.Z,{})," \u6DFB\u52A0\u52A0\u8D2D\u5546\u54C1"]},"primary")]},request:function(){var p=(0,h.Z)(u().mark(function o(d){var Z,y;return u().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:if(!(t.location.query.values.goodsId==null||t.location.query.values.goodsId==null)){g.next=3;break}g.next=10;break;case 3:return d.GoodsId=t.location.query.values.goodsId,d.StoreId=t.location.query.storeId,Z=0,g.next=8,U(d);case 8:return y=g.sent,g.abrupt("return",{data:y.data.data,success:!0,total:Z});case 10:case"end":return g.stop()}},o)}));return function(o){return p.apply(this,arguments)}}(),columns:re,rowSelection:{onChange:function(o,d){G(d)}}}),(m==null?void 0:m.length)>0&&(0,a.jsx)(k.Z,{extra:(0,a.jsxs)("div",{children:["\u5DF2\u9009\u62E9"," ",(0,a.jsx)("a",{style:{fontWeight:600},children:m.length})," ","\u9879 \xA0\xA0"]}),children:(0,a.jsx)(T.Z,{onClick:(0,h.Z)(u().mark(function p(){var o,d;return u().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return y.next=2,te(m);case 2:G([]),(o=c.current)===null||o===void 0||(d=o.reloadAndRest)===null||d===void 0||d.call(o);case 4:case"end":return y.stop()}},p)})),children:"\u5220\u9664"})}),(0,a.jsx)(_,{onFinish:function(){var p=(0,h.Z)(u().mark(function o(d){var Z;return u().wrap(function(w){for(;;)switch(w.prev=w.next){case 0:Z=!1,d.GoodsId=t.location.query.values.goodsId,d.StoreId=t.location.query.storeId,Z=ee(d),Z&&(s(!1),P(void 0),c.current.reload()),c.current.reload();case 6:case"end":return w.stop()}},o)}));return function(o){return p.apply(this,arguments)}}(),onCancel:function(){s(!1),P(void 0)},createModalVisible:l,values:$||{}})]})},ae=ne}}]);