|
- (self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[5750,1322],{32084:function(ge,K,r){"use strict";r.r(K),r.d(K,{default:function(){return ve}});var xe=r(57663),G=r(71577),Ze=r(62350),ne=r(24565),Z=r(2824),s=r(39428),Fe=r(34792),v=r(48086),B=r(3182),H=r(49101),h=r(67294),re=r(78009),ae=r(85224),Q=r(16894),Se=r(71194),L=r(50146),Ce=r(77883),X=r(85986),Ie=r(9715),F=r(55843),je=r(47673),z=r(4107),Ee=r(43358),M=r(34041),w=r(48971),T={getpage:function(e){return(0,w.WY)("/kitchen/api/stirFryTime/getpage",{method:"Post",data:e})},getStirFryArray:function(e){return(0,w.WY)("/kitchen/api/stirFryTime/getStirFryArray?type="+e,{method:"GET"})},getbygoods:function(e){return(0,w.WY)("/kitchen/api/goodsproduct/getbygoods",{method:"POST",data:e})},addupdate:function(e){return(0,w.WY)("/kitchen/api/stirFryTime/AddUpdate",{method:"POST",data:e})},delete:function(e){return(0,w.WY)("/kitchen/api/stirFryTime/delete?id="+e,{method:"GET"})},GetEntryPage:function(e){return(0,w.WY)("/kitchen/api/stirFryTime/GetEntryPage",{method:"Post",data:e})},AddUpdateEntry:function(e){return(0,w.WY)("/kitchen/api/stirFryTime/AddUpdateEntry",{method:"POST",data:e})},DeleteEntry:function(e){return(0,w.WY)("/kitchen/api/stirFryTime/DeleteEntry?id="+e,{method:"POST",data:e})}},t=r(85893),ue=function(e){var a=M.Z.Option,S=M.Z.OptGroup,n=(0,h.useState)(),d=(0,Z.Z)(n,2),C=d[0],P=d[1];return(0,h.useEffect)(function(){var g=function(){var I=(0,B.Z)((0,s.Z)().mark(function x(U){var R;return(0,s.Z)().wrap(function(j){for(;;)switch(j.prev=j.next){case 0:return j.next=2,T.getStirFryArray("stirfrypotaction");case 2:R=j.sent,R!=null&&P(R.data);case 4:case"end":return j.stop()}},x)}));return function(U){return I.apply(this,arguments)}}();g()},[]),(0,t.jsx)(L.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)(F.Z,{layout:"horizontal",preserve:!1,initialValues:e.values,onFinish:e.onFinish,children:[(0,t.jsx)(F.Z.Item,{name:"id",hidden:!0,children:(0,t.jsx)(z.Z,{})}),(0,t.jsx)(F.Z.Item,{name:"status",hidden:!0,children:(0,t.jsx)(z.Z,{})}),(0,t.jsx)(F.Z.Item,{name:"fryTime",label:"\u6B65\u9AA4\u540D\u79F0",rules:[{required:!0,max:64}],children:(0,t.jsx)(z.Z,{})}),(0,t.jsx)(F.Z.Item,{name:"actions",label:"\u7092\u9505\u52A8\u4F5C",rules:[{required:!0,max:64}],children:(0,t.jsx)(M.Z,{style:{width:200},showSearch:!0,optionFilterProp:"children",filterOption:function(I,x){return x.children.toLowerCase().indexOf(I.toLowerCase())>=0},children:C==null?void 0:C.map(function(g,I){return(0,t.jsx)(a,{index:g,value:g,children:g},I)})})}),(0,t.jsx)(F.Z.Item,{name:"during",label:"\u6301\u7EED\u65F6\u95F4",rules:[{required:!0}],children:(0,t.jsx)(X.Z,{min:0})}),(0,t.jsx)("span",{style:{color:"#FFCC52"},children:"\u6CE8: \u6301\u7EED\u65F6\u95F4(s),\u82E5\u4E3A0,\u5219\u7B49\u5F85\u8BE5\u6D41\u7A0B\u8D70\u5B8C\u7ED3\u675F"}),(0,t.jsx)(F.Z.Item,{name:"sort",label:"\u6B65\u9AA4\u6392\u5E8F",rules:[{required:!0}],children:(0,t.jsx)(X.Z,{min:0})}),(0,t.jsx)("span",{style:{color:"#FFCC52"},children:"\u6CE8: \u6B65\u9AA4\u6392\u5E8F\u4E0D\u80FD\u91CD\u590D"}),(0,t.jsx)(F.Z.Item,{children:(0,t.jsx)(G.Z,{type:"primary",htmlType:"submit",children:"\u4FDD\u5B58"})})]})})},ie=ue,se=function(e){var a=M.Z.Option,S=M.Z.OptGroup;return(0,t.jsx)(L.Z,{title:"\u6DFB\u52A0\u914D\u65B9\u539F\u6599",width:640,visible:e.createModalVisible,bodyStyle:{padding:"32px 40px 48px"},footer:null,onCancel:function(){e.onCancel()},destroyOnClose:!0,children:(0,t.jsxs)(F.Z,{layout:"vertical",preserve:!1,initialValues:e.values,onFinish:e.onFinish,children:[(0,t.jsx)(F.Z.Item,{name:"BatchingId",label:"\u539F\u6599\u540D\u79F0",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u539F\u6599\u540D\u79F0"}],children:(0,t.jsx)(M.Z,{placeholder:"\u8BF7\u9009\u62E9\u539F\u6599\u540D\u79F0",showSearch:!0,optionFilterProp:"children",filterOption:function(d,C){return C.children.toLowerCase().indexOf(d.toLowerCase())>=0},children:e.stockGoodsData.map(function(n,d){return(0,t.jsx)(a,{index:d,value:n.id,children:n.name},n.id)})})}),(0,t.jsx)(F.Z.Item,{children:(0,t.jsx)(G.Z,{type:"primary",htmlType:"submit",children:"\u4FDD\u5B58"})})]})})},le=se,oe=function(e){var a=(0,h.useRef)(),S=(0,h.useState)(!1),n=(0,Z.Z)(S,2),d=n[0],C=n[1],P=(0,h.useState)(),g=(0,Z.Z)(P,2),I=g[0],x=g[1],U=(0,h.useState)([]),R=(0,Z.Z)(U,2),V=R[0],j=R[1];(0,h.useEffect)(function(){function c(){T.getbygoods({IsMain:e.IsMain,goodsId:e.values.goodsId}).then(function(i){var f=i.data;f.forEach(function(l){l.text=l.name,l.stockGoodsId=l.value}),j(f)})}c()},[]);function N(c){try{return T.DeleteEntry(c.id).then(function(i){i.data?v.default.success("\u914D\u7F6E\u6210\u529F"):v.default.error("\u914D\u7F6E\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01"),a.current.reload()}),!0}catch(i){return v.default.error("\u914D\u7F6E\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01"),!1}}function W(c){try{return T.AddUpdateEntry(JSON.stringify(c)).then(function(i){i.data?(v.default.success("\u6DFB\u52A0\u6210\u529F"),a.current.reload()):v.default.error("\u6DFB\u52A0\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01")}),!0}catch(i){return v.default.error("\u6DFB\u52A0\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01"),!1}}var O=[{title:"\u4E3B\u952E",dataIndex:"id",hideInTable:!0,hideInSearch:!0,tip:"\u89C4\u5219\u540D\u79F0\u662F\u552F\u4E00\u7684 key",render:function(i,f){return(0,t.jsx)("a",{onClick:function(){x(f),setShowDetail(!0)},children:i})}},{title:"\u539F\u6599\u540D\u79F0",dataIndex:"batchingName",hideInForm:!0,hideInSearch:!0},{title:"\u64CD\u4F5C",dataIndex:"option",valueType:"option",render:function(i,f){return[(0,t.jsx)("a",{onClick:function(){N(f)},children:"\u5220\u9664"},"link4")]}}];return(0,t.jsxs)(L.Z,{title:e.IsMain?"\u4E3B\u6599\u914D\u7F6E":"\u8F85\u6599\u914D\u7F6E",width:640,visible:e.createModalVisible,bodyStyle:{padding:"32px 40px 48px"},footer:null,onCancel:function(){e.onCancel()},destroyOnClose:!0,children:[(0,t.jsx)(Q.ZP,{headerTitle:"",actionRef:a,rowKey:"id",pagination:{defaultPageSize:20},search:!1,toolBarRender:function(){return[(0,t.jsxs)(G.Z,{type:"primary",onClick:function(){return C(!0)},children:[(0,t.jsx)(H.Z,{})," \u6DFB\u52A0\u539F\u6599"]},"create")]},request:function(){var c=(0,B.Z)((0,s.Z)().mark(function i(f){var l,b;return(0,s.Z)().wrap(function(D){for(;;)switch(D.prev=D.next){case 0:return l=[],b=0,e.values.id!=null&&(f.IsMain=e.IsMain,f.StirFryTimeId=e.values.id),D.next=5,T.GetEntryPage(f).then(function(Y){l=Y.data.data,b=Y.data.total});case 5:return D.abrupt("return",{data:l,success:!0,total:b});case 6:case"end":return D.stop()}},i)}));return function(i){return c.apply(this,arguments)}}(),columns:O}),(0,t.jsx)(le,{onFinish:function(){var c=(0,B.Z)((0,s.Z)().mark(function i(f){var l;return(0,s.Z)().wrap(function(k){for(;;)switch(k.prev=k.next){case 0:return f.StirFryTimeId=e.values.id,f.IsMain=e.IsMain,l=!1,k.next=5,W(f);case 5:l=k.sent,l&&C(!1),a.current.reload();case 8:case"end":return k.stop()}},i)}));return function(i){return c.apply(this,arguments)}}(),onCancel:function(){C(!1)},createModalVisible:d,stockGoodsData:V})]})},de=oe,ce=function(){var u=(0,B.Z)((0,s.Z)().mark(function e(a){return(0,s.Z)().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,T.addupdate(JSON.stringify(a)).then(function(d){d.data?v.default.success("\u6DFB\u52A0\u6210\u529F"):v.default.error("\u6DFB\u52A0\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01")}),n.abrupt("return",!0);case 5:return n.prev=5,n.t0=n.catch(0),v.default.error("\u6DFB\u52A0\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01"),n.abrupt("return",!1);case 9:case"end":return n.stop()}},e,null,[[0,5]])}));return function(a){return u.apply(this,arguments)}}(),q=function(){var u=(0,B.Z)((0,s.Z)().mark(function e(a){return(0,s.Z)().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,T.delete(a.id).then(function(d){d.data?v.default.success("\u5220\u9664\u6210\u529F\uFF0C\u5373\u5C06\u5237\u65B0"):v.default.error("\u5220\u9664\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5")}),n.abrupt("return",!0);case 5:n.prev=5,n.t0=n.catch(0),v.default.error("\u5220\u9664\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5");case 8:case"end":return n.stop()}},e,null,[[0,5]])}));return function(a){return u.apply(this,arguments)}}(),Ae=null,Be=null,fe=function(){var u=(0,B.Z)((0,s.Z)().mark(function e(a){return(0,s.Z)().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,T.addupdate(a).then(function(d){d.data?v.default.success("\u4FEE\u6539\u6210\u529F"):v.default.error("\u4FEE\u6539\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01")}),n.abrupt("return",!0);case 5:return n.prev=5,n.t0=n.catch(0),v.default.error("\u4FEE\u6539\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01"),n.abrupt("return",!1);case 9:case"end":return n.stop()}},e,null,[[0,5]])}));return function(a){return u.apply(this,arguments)}}(),he=function(e){var a=(0,h.useState)(e.location.query.values?e.location.query.values:null),S=(0,Z.Z)(a,2),n=S[0],d=S[1],C=(0,h.useState)(!1),P=(0,Z.Z)(C,2),g=P[0],I=P[1],x=(0,h.useRef)(),U=(0,h.useState)(),R=(0,Z.Z)(U,2),V=R[0],j=R[1],N=(0,h.useState)([]),W=(0,Z.Z)(N,2),O=W[0],c=W[1],i=(0,h.useState)(),f=(0,Z.Z)(i,2),l=f[0],b=f[1],k=(0,h.useState)(),D=(0,Z.Z)(k,2),Y=D[0],_=D[1],me=(0,h.useState)(),ee=(0,Z.Z)(me,2),pe=ee[0],J=ee[1];(0,h.useEffect)(function(){},[]);var ye=[{title:"\u4E3B\u952E",dataIndex:"id",hideInTable:!0,hideInSearch:!0},{title:"\u6B65\u9AA4\u540D\u79F0",dataIndex:"fryTime",hideInForm:!0,hideInSearch:!0},{title:"\u7092\u9505\u52A8\u4F5C",dataIndex:"actions",hideInForm:!0,hideInSearch:!0},{title:"\u6301\u7EED\u65F6\u95F4(\u79D2)",dataIndex:"during",hideInForm:!0,hideInSearch:!0},{title:"\u6B65\u9AA4\u6392\u5E8F",dataIndex:"sort",hideInForm:!0,hideInSearch:!0},{title:"\u64CD\u4F5C",dataIndex:"option",valueType:"option",render:function(p,o){return[(0,t.jsx)("a",{onClick:function(){I(!0),j(o)},children:"\u4FEE\u6539"},"config"),(0,t.jsx)(ne.Z,{type:"primary",title:"\u786E\u8BA4\u5220\u9664\u5417\uFF1F",okText:"\u662F",cancelText:"\u5426",onConfirm:function(){var y;q(o),(y=x.current)===null||y===void 0||y.reloadAndRest()},onCancel:function(){},children:(0,t.jsx)("a",{href:"#",children:"\u5220\u9664"})},"primary"),(0,t.jsx)("a",{onClick:function(){b(o),_(!1),J(!0)},children:"\u8F85\u6599\u8BBE\u7F6E"},"config"),(0,t.jsx)("a",{onClick:function(){b(o),_(!0),J(!0)},children:"\u4E3B\u6599\u8BBE\u7F6E"},"config")]}}];return(0,t.jsxs)(re.ZP,{children:[(0,t.jsx)(Q.ZP,{pagination:{defaultPageSize:50},headerTitle:e.location.query.values.name+"\u5C0F\u7092\u6B65\u9AA4\u8BBE\u7F6E",actionRef:x,rowKey:"id",search:!1,columns:ye,toolBarRender:function(){return[(0,t.jsxs)(G.Z,{type:"primary",onClick:function(){I(!0),j({})},children:[(0,t.jsx)(H.Z,{})," \u65B0\u5EFA"]},"primary")]},request:function(){var E=(0,B.Z)((0,s.Z)().mark(function p(o){var m,y;return(0,s.Z)().wrap(function($){for(;;)switch($.prev=$.next){case 0:return o.GoodsId=e.location.query.values.id,m=[],y=0,$.next=5,T.getpage(o).then(function(te){m=te.data.data,y=te.data.total});case 5:return $.abrupt("return",{data:m,success:!0,total:y});case 6:case"end":return $.stop()}},p)}));return function(p){return E.apply(this,arguments)}}(),rowSelection:{onChange:function(p,o){c(o)}}}),(O==null?void 0:O.length)>0&&(0,t.jsx)(ae.Z,{extra:(0,t.jsxs)("div",{children:["\u5DF2\u9009\u62E9"," ",(0,t.jsx)("a",{style:{fontWeight:600},children:O.length})," ","\u9879 \xA0\xA0"]}),children:(0,t.jsx)(G.Z,{onClick:(0,B.Z)((0,s.Z)().mark(function E(){var p,o;return(0,s.Z)().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return y.next=2,q(O);case 2:c([]),(p=x.current)===null||p===void 0||(o=p.reloadAndRest)===null||o===void 0||o.call(p);case 4:case"end":return y.stop()}},E)})),children:"\u6279\u91CF\u5220\u9664"})}),l&&Object.keys(l).length?(0,t.jsx)(de,{onCancel:function(){J(!1),b({})},IsMain:Y,createModalVisible:pe,values:l}):null,(0,t.jsx)(ie,{onFinish:function(){var E=(0,B.Z)((0,s.Z)().mark(function p(o){var m;return(0,s.Z)().wrap(function(A){for(;;)switch(A.prev=A.next){case 0:if(m=!1,!o.id){A.next=7;break}return A.next=4,fe(o);case 4:m=A.sent,A.next=11;break;case 7:return o.goodsId=e.location.query.values.id,A.next=10,ce(o);case 10:m=A.sent;case 11:m&&(I(!1),x.current&&x.current.reload());case 12:case"end":return A.stop()}},p)}));return function(p){return E.apply(this,arguments)}}(),onCancel:function(){j(void 0),I(!1)},createModalVisible:g,values:V||{}})]})},ve=he}}]);
|