Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 
 

2 lignes
7.0 KiB

  1. (self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[8362,7975,1322],{75725:function(re,W,n){"use strict";n.r(W),n.d(W,{default:function(){return ne}});var se=n(57663),T=n(71577),C=n(2824),u=n(39428),ue=n(34792),f=n(48086),h=n(3182),M=n(49101),S=n(67294),Y=n(78009),k=n(85224),x=n(48971);function N(r){return F.apply(this,arguments)}function F(){return F=(0,h.Z)((0,u.Z)().mark(function r(t){return(0,u.Z)().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 U(r){return O.apply(this,arguments)}function O(){return O=(0,h.Z)((0,u.Z)().mark(function r(t){return(0,u.Z)().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 le(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 z(r){return B.apply(this,arguments)}function B(){return B=(0,h.Z)((0,u.Z)().mark(function r(t){return(0,u.Z)().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 J(){return E.apply(this,arguments)}function E(){return E=(0,h.Z)((0,u.Z)().mark(function r(){var t;return(0,u.Z)().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 K=n(53779),ie=n(71194),H=n(50146),de=n(77883),L=n(85986),oe=n(9715),I=n(55843),ce=n(47673),Q=n(4107),fe=n(43358),R=n(34041),a=n(85893),X=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(){J().then(function(w){var j,A,m=[];(j=w.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)(H.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)(Q.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)(L.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=X,b="message",_=function(){var r=(0,h.Z)((0,u.Z)().mark(function t(i){return(0,u.Z)().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.prev=0,f.default.loading("\u6B63\u5728\u6DFB\u52A0",b),l.next=4,U(JSON.stringify(i)).then(function(s){return f.default.destroy(b),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)}}(),ee=function(){var r=(0,h.Z)((0,u.Z)().mark(function t(i){var e;return(0,u.Z)().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,z(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)}}(),te=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],w=v[1],j=(0,S.useState)([]),A=(0,C.Z)(j,2),m=A[0],G=A[1],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"}}}];return(0,a.jsxs)(Y.ZP,{children:[(0,a.jsx)(K.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)(M.Z,{})," \u6DFB\u52A0\u52A0\u8D2D\u5546\u54C1"]},"primary")]},request:function(){var p=(0,h.Z)((0,u.Z)().mark(function o(d){var Z,y;return(0,u.Z)().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,N(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:ae,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)((0,u.Z)().mark(function p(){var o,d;return(0,u.Z)().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return y.next=2,ee(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)(q,{onFinish:function(){var p=(0,h.Z)((0,u.Z)().mark(function o(d){var Z;return(0,u.Z)().wrap(function(P){for(;;)switch(P.prev=P.next){case 0:Z=!1,d.GoodsId=t.location.query.values.goodsId,d.StoreId=t.location.query.storeId,Z=_(d),Z&&(s(!1),w(void 0),c.current.reload()),c.current.reload();case 6:case"end":return P.stop()}},o)}));return function(o){return p.apply(this,arguments)}}(),onCancel:function(){s(!1),w(void 0)},createModalVisible:l,values:$||{}})]})},ne=te}}]);