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
78 KiB

  1. (self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[7825,7975,1322,1793,8951,7005,3042,3721,607,8863,1587,4001,7196],{87246:function(He){He.exports={add_row_content:"add_row_content___1MhOu",add_row_btn:"add_row_btn___55ubX"}},54970:function(He){He.exports={steps_btns:"steps_btns___1fzSt"}},88307:function(He){He.exports={store_config_container:"store_config_container___3YQ4e",choose_store_state:"choose_store_state___3iWn1"}},69038:function(He){He.exports={steps_navbar:"steps_navbar___xiemh",steps_navbar_bottom:"steps_navbar_bottom___3LJIq",steps_content:"steps_content___3jwbG",common_row:"common_row___3vO0H",choose_change_state:"choose_change_state___RcNtV",add_row_content:"add_row_content___3lFj7",add_row_btn:"add_row_btn___FtgXy",ant_descriptions_row:"ant_descriptions_row___1O_JD",ant_descriptions_item_title:"ant_descriptions_item_title___2AaU8",ant_descriptions_item_label:"ant_descriptions_item_label___3bihx",ant_descriptions_item_content:"ant_descriptions_item_content___1840s",current_selected_obj:"current_selected_obj___2DxAP",current_selected_cmp:"current_selected_cmp___2T66U",sure_add_btn:"sure_add_btn___c4Fz9",add_to_some_box:"add_to_some_box___1T4b6",wait_add_list:"wait_add_list___2n8fz",success_add_list:"success_add_list___2fDeC"}},60170:function(He,Zt,d){"use strict";d.r(Zt),d.d(Zt,{default:function(){return pn}});var Sn=d(57106),Dt=d(6129),Fn=d(57663),O=d(71577),jn=d(58024),ot=d(91894),Ae=d(11849),u=d(2824),Bn=d(35556),Ct=d(97880),a=d(67294),Et=d(69038),_=d.n(Et),Mt=d(78009),wn=d(71194),Ie=d(50146),In=d(77883),nt=d(85986),Tn=d(62999),yt=d(54680),c=d(39428),bn=d(34792),f=d(48086),K=d(3182),Dn=d(9715),n=d(71257),En=d(43358),h=d(34041),Mn=d(47673),w=d(4107),Ot=d(81710),k=d(48971),j={getOrgTree:function(){return(0,k.WY)("\u200B/kitchen/api\u200B/sysOrg\u200B/tree",{method:"GET"})},AddOrg:function(t){return(0,k.WY)("/kitchen/api/sysOrg/add",{method:"POST",data:(0,Ae.Z)({},t)})},UpdateOrg:function(t){return(0,k.WY)("\u200B/kitchen/api\u200B/sysOrg\u200B/edit",{method:"POST",data:(0,Ae.Z)({},t)})},getPayTemplateList:function(){return(0,k.WY)("/kitchen/api/paytemplate/getPayTemplatePageList",{method:"post",data:{current:1,pageSize:100}})},AddDeviceInfo:function(t){return(0,k.WY)("/kitchen/api/Device/AddDeviceInfo",{method:"POST",data:t})},UpdateDeviceInfo:function(t){return(0,k.WY)("/kitchen/api/Device/UpdateDeviceInfo",{method:"POST",data:t})},GetDicList:function(t){return(0,k.WY)("/kitchen/api/dict-data/dic-list/".concat(t),{method:"Get"})},GetDeviceType:function(){return(0,k.WY)("\u200B/kitchen/api/Device/GetDeviceType",{method:"GET"})},GetDeviceVersions:function(){return(0,k.WY)("\u200B/kitchen/api/Device/GetDeviceVersions",{method:"post"})},AddDeviceType:function(t){return(0,k.WY)("/kitchen/api/Device/AddDeviceType",{method:"POST",data:t})},GetDeviceInfoPage:function(t){return(0,k.WY)("/kitchen/api/Device/GetDeviceInfoPage",{method:"POST",data:t})},getpage:function(t,xe){return(0,k.WY)("/kitchen/api/sysOrg\u200B/page",{method:"GET",params:(0,Ae.Z)({},t)})},GetFoodMenuInfoPage:function(t){return(0,k.WY)("/kitchen/api/FoodMenu/GetFoodMenuInfoPage",{method:"POST",data:t})},AddFoodMenu:function(t){return(0,k.WY)("/kitchen/api/FoodMenu/AddUpdateFoodMenu",{method:"POST",data:t})},UpdateFoodMenu:function(t){return(0,k.WY)("/kitchen/api/FoodMenu/AddUpdateFoodMenu",{method:"POST",data:t})},GetDeviceGoods:function(t){return(0,k.WY)("/kitchen/api/Device/GetDeviceGoods",{method:"POST",data:t})},AddGoods:function(t){return(0,k.WY)("/kitchen/api/goods",{method:"POST",data:t})},UpdateGoods:function(t){return(0,k.WY)("/kitchen/api/goods",{method:"PUT",data:t})},GetUnitList:function(t){return(0,k.WY)("/kitchen/api/goods-unit/type",{method:"Post",data:t})},GetGoodsbigType:function(t){return(0,k.WY)("/kitchen/api/goods-type/big-goods-types",{method:"POST",data:t})},GetGoodsSmallType:function(t){return(0,k.WY)("/kitchen/api/goods-type/goods-types",{method:"POST",data:t})},GetCosRequestURL:function(t){return(0,k.WY)("/kitchen/api/systemconfig/GetCosRequestSignURL",{method:"POST",data:t})},CreateUnit:function(t){return(0,k.WY)("/kitchen/api/goods-unit",{method:"POST",data:t})},AddGoodsTypeListNew:function(t){return(0,k.WY)("/kitchen/api/goods-type/goods-type-new",{method:"post",data:t})},AddGoodsSmallType:function(t){return(0,k.WY)("/kitchen/api/goods-type",{method:"POST",data:t})},GetgoodsList:function(t){return(0,k.WY)("/kitchen/api/goods/goodss",{method:"Post",data:t})},GetBomPage:function(t){return(0,k.WY)("/kitchen/api/bom/getpage",{method:"Post",data:t})},AddBom:function(t){return(0,k.WY)("/kitchen/api/bom/add",{method:"Post",data:t})},UpdateBom:function(t){return(0,k.WY)("/kitchen/api/bom/update",{method:"Post",data:t})},GetBomTypePage:function(t){return(0,k.WY)("/kitchen/api/bom/getbomtypepage",{method:"Post",data:t})},CreateBomType:function(t){return(0,k.WY)("/kitchen/api/bom/addbomtype",{method:"Post",data:t})},AddMaterial:function(t){return(0,k.WY)("/kitchen/api/product/",{method:"POST",data:(0,Ae.Z)({},t)})},UpdateMaterial:function(t){return(0,k.WY)("/kitchen/api/product/",{method:"PUT",data:(0,Ae.Z)({},t)})},GetMaterialPage:function(t){return(0,k.WY)("/kitchen/api/product/product-list",{method:"Post",data:t})},GetMaterialTypeList:function(t){return(0,k.WY)("/kitchen/api/product-type/type-list",{method:"GET",params:(0,Ae.Z)({},t)})},GetMaterialUintList:function(t){return(0,k.WY)("/kitchen/api/unit/uint-list",{method:"GET",params:(0,Ae.Z)({},t)})},AddMaterialUnit:function(t){return(0,k.WY)("/kitchen/api/unit",{method:"POST",data:t})},AddMaterialType:function(t){return(0,k.WY)("/kitchen/api/product-type",{method:"POST",data:t})},QuickStartAdd:function(t){return(0,k.WY)("/kitchen/api/quickstart/add",{method:"POST",data:t})}},On=d(88307),et=d(49101),Xe=d(17244),e=d(85893),kt=h.Z.Option,at,At=function(t){var xe=(0,a.useState)(null),se=(0,u.Z)(xe,2),Y=se[0],me=se[1],V=(0,a.useState)(null),R=(0,u.Z)(V,2),ee=R[0],L=R[1],X=(0,a.useState)([]),Z=(0,u.Z)(X,2),I=Z[0],$=Z[1],te=(0,a.useState)(null),Q=(0,u.Z)(te,2),re=Q[0],ge=Q[1],ce=function(){re?t.handleOk(re):f.default.error("\u8BF7\u9009\u62E9\u5E97\u94FA\u5730\u5740")},le=function(M){if(M&&Y){Y.clearOverlays();var g=I.find(function(ue){return ue.uid===M});if(g){ge(g);var T=new BMapGL.Point(g.point.lng,g.point.lat);Y.centerAndZoom(T,16);var q=new BMapGL.Marker(T);Y.addOverlay(q);var fe=new BMapGL.InfoWindow(g.address,{width:200,height:100,title:g.title,message:g.address});q.addEventListener("click",function(){Y.openInfoWindow(fe,T)})}}},H=function(M){if(at&&(clearTimeout(at),at=null),Y)if(ee===null){var g=new BMapGL.LocalSearch(Y,{onSearchComplete:function(q){q&&$(JSON.parse(JSON.stringify(q._pois)))}});at=setTimeout(function(){g.search(M)},300),L(g)}else at=setTimeout(function(){ee.search(M)},300)},pe=function(){var M=new BMapGL.Map("baidu_map_container");M.enableScrollWheelZoom(!0),M.setHeading(64.5),M.setTilt(73);var g=new BMapGL.LocalCity;g.get(function(T){T&&M.centerAndZoom(new BMapGL.Point(T.center.lng,T.center.lat),12)}),me(M)};return(0,a.useEffect)(function(){pe()},[]),(0,e.jsx)(e.Fragment,{children:(0,e.jsxs)(Ie.Z,{width:800,title:"\u9009\u62E9\u5E97\u94FA\u5750\u6807",visible:t.isShowBaiduMap,onOk:ce,onCancel:t.handleCancel,children:[(0,e.jsx)(h.Z,{showSearch:!0,placeholder:"\u8BF7\u8F93\u5165\u5730\u5740",onChange:le,onSearch:H,defaultActiveFirstOption:!1,showArrow:!1,filterOption:!1,notFoundContent:null,style:{width:"100%",marginBottom:"10px"},size:"large",children:I==null?void 0:I.map(function(B){return(0,e.jsxs)(kt,{value:B.uid,children:[B.title," \u3010",B.address,"\u3011"]},B.uid)})}),(0,e.jsx)("div",{id:"baidu_map_container",style:{width:"750px",height:"700px"}})]})})},Gt=At,St="message",Pt=function(t){var xe=(0,a.useState)(0),se=(0,u.Z)(xe,2),Y=se[0],me=se[1],V=(0,a.useState)(20),R=(0,u.Z)(V,2),ee=R[0],L=R[1],X=w.Z.TextArea,Z=h.Z.Option,I=h.Z.OptGroup,$=n.Z.useForm(),te=(0,u.Z)($,1),Q=te[0],re=(0,a.useState)([]),ge=(0,u.Z)(re,2),ce=ge[0],le=ge[1],H=(0,a.useState)([]),pe=(0,u.Z)(H,2),B=pe[0],M=pe[1],g=function(){var oe=(0,K.Z)((0,c.Z)().mark(function ne(b){var Ze,ae;return(0,c.Z)().wrap(function(Ce){for(;;)switch(Ce.prev=Ce.next){case 0:if(f.default.loading("\u6B63\u5728\u914D\u7F6E",St),!b.id){Ce.next=8;break}return Ce.next=4,j.UpdateOrg(b);case 4:Ze=Ce.sent,Ze.succeeded?(f.default.success("\u4FEE\u6539\u6210\u529F"),ye(!1),U.current.reload()):f.default.error(Ze.errors||"\u4FEE\u6539\u51FA\u9519"),Ce.next=13;break;case 8:return b.code=(0,Xe.x0)(),Ce.next=11,j.AddOrg(b);case 11:ae=Ce.sent,ae.succeeded?(f.default.success("\u6DFB\u52A0\u6210\u529F"),U.current.reload(),ye(!1)):f.default.error(JSON.stringify(ae.errors)||"\u6DFB\u52A0\u51FA\u9519");case 13:f.default.destroy(St);case 14:case"end":return Ce.stop()}},ne)}));return function(b){return oe.apply(this,arguments)}}(),T=(0,a.useState)({id:""}),q=(0,u.Z)(T,2),fe=q[0],ue=q[1],J=(0,a.useState)(!1),A=(0,u.Z)(J,2),z=A[0],ye=A[1],U=(0,a.useRef)(),we=function(){var oe=(0,K.Z)((0,c.Z)().mark(function ne(){var b,Ze;return(0,c.Z)().wrap(function(Se){for(;;)switch(Se.prev=Se.next){case 0:return Se.next=2,j.getOrgTree();case 2:b=Se.sent,b.statusCode===200?(Ze=[{key:"0",parentId:"0",title:"\u9876\u7EA7",value:"0",children:b.data||[]}],le(Ze)):f.default.error(b.errors||"\u83B7\u53D6\u95E8\u5E97\u67B6\u6784\u51FA\u9519");case 4:case"end":return Se.stop()}},ne)}));return function(){return oe.apply(this,arguments)}}(),je=function(){var oe=(0,K.Z)((0,c.Z)().mark(function ne(){var b;return(0,c.Z)().wrap(function(ae){for(;;)switch(ae.prev=ae.next){case 0:return ae.next=2,j.getPayTemplateList();case 2:b=ae.sent,b.statusCode===200?M(b.data.data):f.default.error(b.errors||"\u83B7\u53D6\u83B7\u53D6\u652F\u4ED8\u65B9\u5F0F\u51FA\u9519");case 4:case"end":return ae.stop()}},ne)}));return function(){return oe.apply(this,arguments)}}(),Te=[{title:"\u4E3B\u952E",dataIndex:"id",tip:"key",hideInSearch:!0,hideInTable:!0},{title:"\u95E8\u5E97\u540D\u79F0",dataIndex:"name"},{title:"\u95E8\u5E97\u7F16\u7801",dataIndex:"code"},{title:"\u95E8\u5E97\u7C7B\u578B",dataIndex:"type",valueEnum:{0:{text:"\u673A\u6784"},1:{text:"\u914D\u9001\u4E2D\u5FC3"},2:{text:"\u76F4\u8425\u5E97"},3:{text:"\u52A0\u76DF\u5E97"}}},{title:"\u7535\u8BDD",dataIndex:"tel",hideInSearch:!0},{title:"\u6392\u5E8F",dataIndex:"sort",valueType:"digit",hideInSearch:!0},{title:"\u63CF\u8FF0",dataIndex:"remark",valueType:"textarea",hideInSearch:!0},{title:"\u64CD\u4F5C",dataIndex:"option",valueType:"option",render:function(ne,b){return[(0,e.jsx)("a",{onClick:function(){ue(b),ye(!0),Q.setFieldsValue(b)},children:"\u66F4\u65B0"},"config")]}}],Ue=(0,a.useState)([]),Ge=(0,u.Z)(Ue,2),Ke=Ge[0],Pe=Ge[1],be=(0,a.useState)(!1),Be=(0,u.Z)(be,2),De=Be[0],Ne=Be[1],_e=function(ne){var b=Q.getFieldsValue(!0);b.store_Loc="".concat(ne.point.lng.toFixed(10),",").concat(ne.point.lat.toFixed(10)),b.store_Addr=ne.address,Q.setFieldsValue(b),Ne(!1),f.default.success("\u95E8\u5E97\u5750\u6807\u8BBE\u7F6E\u6210\u529F\uFF01")};return(0,a.useEffect)(function(){t.storeConfig.id&&Pe([t.storeConfig.id]),we(),je()},[]),(0,e.jsxs)(e.Fragment,{children:[De&&(0,e.jsx)(Gt,{isShowBaiduMap:De,handleOk:_e,handleCancel:function(){return Ne(!1)}}),(0,e.jsx)(Ie.Z,{width:600,title:fe.id?"\u7F16\u8F91\u95E8\u5E97\u67B6\u6784":"\u65B0\u589E\u95E8\u5E97\u67B6\u6784",visible:z,footer:!1,onCancel:function(){return ye(!1)},children:(0,e.jsxs)(n.Z,{form:Q,layout:"horizontal",preserve:!1,labelCol:{span:4},onFinish:g,children:[(0,e.jsx)(n.Z.Item,{name:"id",hidden:!0,children:(0,e.jsx)(w.Z,{})}),(0,e.jsx)(n.Z.Item,{name:"code",hidden:!0,label:"\u95E8\u5E97\u7F16\u7801",children:(0,e.jsx)(w.Z,{placeholder:"\u8BF7\u8F93\u5165\u95E8\u5E97\u7F16\u7801"})}),(0,e.jsx)(n.Z.Item,{name:"name",label:"\u95E8\u5E97\u540D\u79F0",rules:[{required:!0,max:64}],children:(0,e.jsx)(w.Z,{placeholder:"\u8BF7\u8F93\u5165\u540D\u79F0"})}),(0,e.jsx)(n.Z.Item,{name:"pid",label:"\u6240\u5C5E\u673A\u6784",rules:[{required:!0}],children:(0,e.jsx)(yt.Z,{style:{width:"100%"},dropdownStyle:{maxHeight:400,overflow:"auto"},treeData:ce,placeholder:"\u8BF7\u9009\u62E9\u6240\u5C5E\u673A\u6784",treeDefaultExpandAll:!0})}),(0,e.jsx)(n.Z.Item,{name:"type",label:"\u95E8\u5E97\u7C7B\u578B",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u95E8\u5E97\u7C7B\u578B"}],children:(0,e.jsx)(h.Z,{placeholder:"\u8BF7\u9009\u62E9\u673A\u6784\u7C7B\u578B",children:(0,e.jsxs)(I,{children:[(0,e.jsx)(h.Z.Option,{value:2,children:"\u76F4\u8425\u5E97"}),(0,e.jsx)(h.Z.Option,{value:3,children:"\u52A0\u76DF\u5E97"})]})})}),(0,e.jsx)(n.Z.Item,{name:"payTemplateId",label:"\u652F\u4ED8\u6A21\u677F",children:(0,e.jsx)(h.Z,{placeholder:"\u8BF7\u9009\u62E9\u652F\u4ED8\u6A21\u677F",children:B==null?void 0:B.map(function(oe){return(0,e.jsx)(Z,{value:oe.id,children:oe.name},oe.id)})})}),(0,e.jsx)("div",{className:_().add_row_content,children:(0,e.jsx)(n.Z.Item,{label:"\u5E97\u94FA\u5750\u6807",name:"store_Loc",rules:[{required:!0,max:100,pattern:/^[-\+]?\d+(\.\d+)\,[-\+]?\d+(\.\d+)$/,message:"\u7ECF\u7EAC\u5EA6\u683C\u5F0F\u4E0D\u5BF9"}],children:(0,e.jsx)(w.Z,{style:{width:"55%"},placeholder:"104.070734,30.575041"})})}),(0,e.jsx)(n.Z.Item,{label:"\u5E97\u94FA\u5730\u5740",name:"store_Addr",rules:[{required:!0,max:100}],children:(0,e.jsx)(w.Z,{placeholder:"\u6210\u90FD\u5E02\u6B66\u4FAF\u533A\u6842\u6EAA\u8857\u9053\u73AF\u7403\u4E2D\u5FC3N5-9111C"})}),(0,e.jsx)(n.Z.Item,{name:"tel",label:"\u7535\u8BDD",rules:[{max:20}],children:(0,e.jsx)(w.Z,{placeholder:"\u8BF7\u8F93\u5165\u8054\u7CFB\u7535\u8BDD"})}),(0,e.jsx)(n.Z.Item,{name:"sort",label:"\u6392\u5E8F",children:(0,e.jsx)(nt.Z,{min:1,step:1,precision:0})}),(0,e.jsx)(n.Z.Item,{name:"remark",label:"\u5907\u6CE8",children:(0,e.jsx)(X,{rows:4,rules:[{max:500}]})}),(0,e.jsx)(n.Z.Item,{children:(0,e.jsx)(O.Z,{type:"primary",htmlType:"submit",children:"\u786E\u5B9A"})})]})}),(0,e.jsx)(Ot.Z,{search:!1,style:{width:"100%"},headerTitle:"\u95E8\u5E97\u5217\u8868",actionRef:U,rowKey:"id",rowSelection:{type:"radio",onChange:function(ne,b){Pe(ne),t.onSelectedChange("storeConfig",b[0])},selectedRowKeys:Ke},request:function(){var oe=(0,K.Z)((0,c.Z)().mark(function ne(b){var Ze,ae,Se;return(0,c.Z)().wrap(function(Ee){for(;;)switch(Ee.prev=Ee.next){case 0:return Ze=[],ae=0,Ee.next=4,j.getpage(b).then(function(Fe){Ze=Fe.data.data,ae=Fe.data.total});case 4:return Se=Ze.filter(function(Fe){return Fe.type===2||Fe.type===3}),Ee.abrupt("return",{data:Se,success:!0,total:ae});case 6:case"end":return Ee.stop()}},ne)}));return function(ne){return oe.apply(this,arguments)}}(),columns:Te,pagination:{current:Y,pageSize:ee,onChange:function(ne,b){me(ne),L(b)}},toolBarRender:function(){return[(0,e.jsx)(O.Z,{icon:(0,e.jsx)(et.Z,{}),type:"primary",onClick:function(){Q.resetFields(),ue({id:""}),ye(!0)},children:"\u65B0\u5EFA"},"button")]}})]})},Rt=Pt,qe=d(16894),Ut=d(87246),Ft=d.n(Ut),jt="message",Nt=function(t){var xe=h.Z.Option,se=h.Z.OptGroup,Y=n.Z.useForm(),me=(0,u.Z)(Y,1),V=me[0],R=n.Z.useForm(),ee=(0,u.Z)(R,1),L=ee[0],X=(0,a.useState)([]),Z=(0,u.Z)(X,2),I=Z[0],$=Z[1],te=(0,a.useState)([]),Q=(0,u.Z)(te,2),re=Q[0],ge=Q[1],ce=(0,a.useState)({}),le=(0,u.Z)(ce,2),H=le[0],pe=le[1],B=(0,a.useState)([]),M=(0,u.Z)(B,2),g=M[0],T=M[1],q=(0,a.useState)([]),fe=(0,u.Z)(q,2),ue=fe[0],J=fe[1],A=(0,a.useState)(!1),z=(0,u.Z)(A,2),ye=z[0],U=z[1],we=(0,a.useState)({id:""}),je=(0,u.Z)(we,2),Te=je[0],Ue=je[1],Ge=(0,a.useState)(!1),Ke=(0,u.Z)(Ge,2),Pe=Ke[0],be=Ke[1],Be=function(){var F=(0,K.Z)((0,c.Z)().mark(function S(r){var i,s;return(0,c.Z)().wrap(function(m){for(;;)switch(m.prev=m.next){case 0:if(f.default.loading("\u6B63\u5728\u914D\u7F6E",jt),!r.id){m.next=8;break}return m.next=4,j.UpdateDeviceInfo(r);case 4:i=m.sent,i.succeeded?(f.default.success("\u4FEE\u6539\u6210\u529F"),be(!1),b.current.reload()):f.default.error(i.errors||"\u4FEE\u6539\u51FA\u9519"),m.next=12;break;case 8:return m.next=10,j.AddDeviceInfo(r);case 10:s=m.sent,s.succeeded?(f.default.success("\u6DFB\u52A0\u6210\u529F"),b.current.reload(),be(!1)):f.default.error(s.errors||"\u6DFB\u52A0\u6210\u51FA\u9519");case 12:f.default.destroy(jt),b.current.reload();case 14:case"end":return m.stop()}},S)}));return function(r){return F.apply(this,arguments)}}(),De=function(){var F=(0,K.Z)((0,c.Z)().mark(function S(){var r;return(0,c.Z)().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return s.next=2,j.GetDicList("DeviceClientType");case 2:r=s.sent,r.statusCode===200?(r.data.forEach(function(x){x.code=x.code,x.value=x.code}),$(r.data)):f.default.error(r.errors||"\u83B7\u53D6\u8BBE\u5907\u7C7B\u578B\u51FA\u9519");case 4:case"end":return s.stop()}},S)}));return function(){return F.apply(this,arguments)}}(),Ne=function(){var F=(0,K.Z)((0,c.Z)().mark(function S(){var r;return(0,c.Z)().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return s.next=2,j.getOrgTree();case 2:r=s.sent,r.statusCode===200?T(r.data):f.default.error(r.errors||"\u83B7\u53D6\u7EC4\u7EC7\u67B6\u6784\u51FA\u9519");case 4:case"end":return s.stop()}},S)}));return function(){return F.apply(this,arguments)}}(),_e=function(){var F=(0,K.Z)((0,c.Z)().mark(function S(){var r,i;return(0,c.Z)().wrap(function(x){for(;;)switch(x.prev=x.next){case 0:return x.next=2,j.GetDeviceType();case 2:r=x.sent,r.statusCode===200?(i={},r.data.forEach(function(m){i[m.id]={text:m.name}}),pe(i),ge(r.data)):f.default.error(r.errors||"\u83B7\u53D6\u8BBE\u5907\u5206\u7C7B\u51FA\u9519");case 4:case"end":return x.stop()}},S)}));return function(){return F.apply(this,arguments)}}(),oe=function(){var F=(0,K.Z)((0,c.Z)().mark(function S(){var r;return(0,c.Z)().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return s.next=2,j.GetDeviceVersions();case 2:r=s.sent,r.statusCode===200?J(r.data):f.default.error(r.errors||"\u83B7\u53D6\u8BBE\u5907\u7248\u672C\u51FA\u9519");case 4:case"end":return s.stop()}},S)}));return function(){return F.apply(this,arguments)}}(),ne=function(){var F=(0,K.Z)((0,c.Z)().mark(function S(r){var i;return(0,c.Z)().wrap(function(x){for(;;)switch(x.prev=x.next){case 0:return x.next=2,j.AddDeviceType(r);case 2:i=x.sent,i.data?(f.default.success("\u8BBE\u5907\u5206\u7C7B\u6DFB\u52A0\u6210\u529F\uFF01"),U(!1),_e()):f.default.error(i.errors||"\u6DFB\u52A0\u8BBE\u5907\u5206\u7C7B\u51FA\u9519");case 4:case"end":return x.stop()}},S)}));return function(r){return F.apply(this,arguments)}}(),b=(0,a.useRef)(),Ze=(0,a.useState)([]),ae=(0,u.Z)(Ze,2),Se=ae[0],Ce=ae[1],Ee=[{title:"\u4E3B\u952E",dataIndex:"id",hideInSearch:!0,hideInTable:!0,tip:"\u89C4\u5219\u540D\u79F0\u662F\u552F\u4E00\u7684 key"},{title:"\u8BBE\u5907\u540D\u79F0",dataIndex:"deviceName",valueType:"textarea"},{title:"\u6240\u5C5E\u95E8\u5E97",dataIndex:"orgId",hideInSearch:!0,render:function(S,r){return(0,e.jsx)("div",{children:t.storeConfig.name})}},{title:"\u8BBE\u5907\u7C7B\u578B",dataIndex:"deviceTypeKey",valueEnum:I,hideInSearch:!0},{title:"\u8BBE\u5907\u5206\u7C7B",dataIndex:"deviceTypeId",valueEnum:H},{title:"\u72B6\u6001",dataIndex:"status",valueEnum:{0:{text:"\u6B63\u5E38",status:"Processing"},1:{text:"\u505C\u7528",status:"Success"}},hideInSearch:!0},{title:"\u8BBE\u5907\u5730\u5740",dataIndex:"deviceAddr",search:!1,valueType:"textarea"},{title:"\u5750\u6807",dataIndex:"deviceLoc",valueType:"textarea",search:!1},{title:"\u8BBE\u5907\u901A\u9053\u6570\u91CF",dataIndex:"materialQuantity",valueType:"textarea",search:!1},{title:"\u8BBE\u5907\u552F\u4E00key",dataIndex:"autoKey",search:!1},{title:"\u5F52\u5C5E\u95E8\u5E97\u552F\u4E00key",dataIndex:"orgKey",search:!1},{title:"\u64CD\u4F5C",dataIndex:"option",valueType:"option",render:function(S,r){return[(0,e.jsx)("a",{onClick:function(){Ue(r),be(!0),L.setFieldsValue(r)},children:"\u66F4\u65B0"},"config")]}}],Fe=(0,a.useState)(0),ze=(0,u.Z)(Fe,2),Ve=ze[0],Me=ze[1],Je=(0,a.useState)(20),Qe=(0,u.Z)(Je,2),Le=Qe[0],Oe=Qe[1];return(0,a.useEffect)(function(){var F;(F=t.deviceConfig)!==null&&F!==void 0&&F.id&&Ce([t.deviceConfig.id]),Ne(),_e(),De(),oe()},[]),(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(qe.ZP,{style:{width:"100%"},headerTitle:"\u8BBE\u5907\u4FE1\u606F",actionRef:b,rowKey:"id",search:!1,pagination:{current:Ve,pageSize:Le,onChange:function(S,r){Me(S),Oe(r)}},request:function(){var F=(0,K.Z)((0,c.Z)().mark(function S(r){var i,s;return(0,c.Z)().wrap(function(m){for(;;)switch(m.prev=m.next){case 0:return i=[],s=0,m.next=4,j.GetDeviceInfoPage(r).then(function(ie){i=ie.data.data,s=ie.data.total});case 4:return i=i.filter(function(ie){return ie.orgId===t.storeConfig.id}),m.abrupt("return",{data:i,success:!0,total:s});case 6:case"end":return m.stop()}},S)}));return function(S){return F.apply(this,arguments)}}(),columns:Ee,rowSelection:{type:"radio",onChange:function(S,r){Ce(S),t.onSelectedChange("deviceConfig",r[0])},selectedRowKeys:Se},toolBarRender:function(){return[(0,e.jsx)(O.Z,{icon:(0,e.jsx)(et.Z,{}),type:"primary",onClick:function(){L.resetFields();var r=L.getFieldsValue();r.orgId=t.storeConfig.id,r.deviceLoc=t.storeConfig.store_Loc,r.deviceAddr=t.storeConfig.store_Addr,L.setFieldsValue(r),Ue({id:""}),be(!0)},children:"\u65B0\u5EFA"},"button")]}}),(0,e.jsx)(Ie.Z,{width:600,title:Te.id?"\u7F16\u8F91\u8BBE\u5907":"\u65B0\u589E\u8BBE\u5907",visible:Pe,footer:!1,onCancel:function(){return be(!1)},children:(0,e.jsxs)(n.Z,{layout:"Horizontal",labelCol:{span:6},preserve:!1,form:L,onFinish:Be,children:[(0,e.jsx)(n.Z.Item,{name:"id",hidden:!0,children:(0,e.jsx)(w.Z,{})}),(0,e.jsx)(n.Z.Item,{label:"\u8BBE\u5907\u540D\u79F0",name:"deviceName",rules:[{required:!0,max:50}],children:(0,e.jsx)(w.Z,{})}),(0,e.jsx)(n.Z.Item,{label:"\u8BBE\u5907\u7C7B\u578B",name:"deviceTypeKey",rules:[{required:!0}],children:(0,e.jsx)(h.Z,{children:I.map(function(F,S){return(0,e.jsx)(h.Z.Option,{index:S,value:F.code,children:F.value},F.code)})})}),(0,e.jsx)(n.Z.Item,{name:"orgId",label:"\u5F52\u5C5E\u95E8\u5E97",rules:[{required:!0}],children:(0,e.jsx)(yt.Z,{disabled:!0,style:{width:"100%"},dropdownStyle:{maxHeight:400,overflow:"auto"},treeData:g,placeholder:"\u5F52\u5C5E\u95E8\u5E97",treeDefaultExpandAll:!0})}),(0,e.jsxs)("div",{className:Ft().add_row_content,children:[(0,e.jsx)(n.Z.Item,{label:"\u8BBE\u5907\u5206\u7C7B",name:"deviceTypeId",rules:[{required:!0}],children:(0,e.jsx)(h.Z,{style:{width:"75%"},children:re.map(function(F,S){return(0,e.jsx)(h.Z.Option,{index:S,value:F.id,children:F.name},F.id)})})}),(0,e.jsx)(O.Z,{type:"primary",className:Ft().add_row_btn,onClick:function(){U(!0),V.resetFields()},children:"\u6DFB\u52A0\u5206\u7C7B"})]}),(0,e.jsx)(n.Z.Item,{noStyle:!0,shouldUpdate:function(S,r){return S.deviceTypeKey!==r.deviceTypeKey},children:function(S){var r=S.getFieldValue;return r("deviceTypeKey")==="TMC"?(0,e.jsx)(n.Z.Item,{name:"deviceVersion",label:"\u8BBE\u5907\u7248\u672C",initialValue:"WorryFreeEdition",children:(0,e.jsx)(h.Z,{children:ue.map(function(i,s){return(0,e.jsx)(h.Z.Option,{index:s,value:i.code,children:i.name},i.code)})})}):null}}),(0,e.jsx)(n.Z.Item,{label:"\u8BBE\u5907\u5750\u6807",name:"deviceLoc",children:(0,e.jsx)(w.Z,{placeholder:"104.070734,30.575041"})}),(0,e.jsx)(n.Z.Item,{label:"\u72B6\u6001",name:"status",children:(0,e.jsx)(h.Z,{placeholder:"\u8BF7\u9009\u62E9\u72B6\u6001",defaultValue:0,children:(0,e.jsxs)(se,{children:[(0,e.jsx)(h.Z.Option,{value:0,children:"\u6B63\u5E38"}),(0,e.jsx)(h.Z.Option,{value:1,children:"\u505C\u7528"})]})})}),(0,e.jsx)(n.Z.Item,{noStyle:!0,shouldUpdate:function(S,r){return S.deviceTypeKey!==r.deviceTypeKey},children:function(S){var r=S.getFieldValue;return r("deviceTypeKey")==="TMC"?(0,e.jsx)(n.Z.Item,{label:"\u8BBE\u5907\u901A\u9053\u6570\u91CF",name:"materialQuantity",children:(0,e.jsx)(nt.Z,{style:{width:"100%"}})}):null}}),(0,e.jsx)(n.Z.Item,{label:"\u8BBE\u5907\u8BE6\u7EC6\u5730\u5740",name:"deviceAddr",children:(0,e.jsx)(w.Z,{placeholder:"\u6210\u90FD\u5E02\u6B66\u4FAF\u533A\u6842\u6EAA\u8857\u9053\u73AF\u7403\u4E2D\u5FC3N5-9111C"})}),(0,e.jsx)(n.Z.Item,{children:(0,e.jsx)(O.Z,{type:"primary",htmlType:"submit",children:"\u786E\u5B9A"})})]})}),(0,e.jsx)(Ie.Z,{title:"\u6DFB\u52A0\u8BBE\u5907\u5206\u7C7B",visible:ye,footer:!1,onCancel:function(){return U(!1)},children:(0,e.jsxs)(n.Z,{layout:"vertical",onFinish:ne,form:V,children:[(0,e.jsx)(n.Z.Item,{name:"id",hidden:!0,children:(0,e.jsx)(w.Z,{})}),(0,e.jsx)(n.Z.Item,{label:"\u7C7B\u578B\u540D\u79F0",name:"name",rules:[{required:!0,max:50}],children:(0,e.jsx)(w.Z,{})}),(0,e.jsx)(n.Z.Item,{children:(0,e.jsx)(O.Z,{type:"primary",htmlType:"submit",children:"\u4FDD\u5B58"})})]})})]})},_t=Nt,tt="message",Lt=function(t){var xe=n.Z.useForm(),se=(0,u.Z)(xe,1),Y=se[0],me=function(){var J=(0,K.Z)((0,c.Z)().mark(function A(z){return(0,c.Z)().wrap(function(U){for(;;)switch(U.prev=U.next){case 0:if(!z.id){U.next=13;break}return U.prev=1,f.default.loading("\u6B63\u5728\u4FEE\u6539",tt),U.next=5,j.UpdateFoodMenu(z).then(function(we){f.default.destroy(tt),we.data?(f.default.success("\u4FEE\u6539\u6210\u529F"),$(!1),te.current.reload()):f.default.error("\u4FEE\u6539\u5931\u8D25")});case 5:U.next=11;break;case 7:U.prev=7,U.t0=U.catch(1),f.default.destroy(tt),f.default.error("\u4FEE\u6539\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01");case 11:U.next=23;break;case 13:return U.prev=13,f.default.loading("\u6B63\u5728\u6DFB\u52A0",tt),U.next=17,j.AddFoodMenu(z).then(function(we){f.default.destroy(tt),we.data?(f.default.success("\u6DFB\u52A0\u6210\u529F"),$(!1),te.current.reload()):f.default.error("\u6DFB\u52A0\u5931\u8D25")});case 17:U.next=23;break;case 19:U.prev=19,U.t1=U.catch(13),f.default.destroy(tt),f.default.error("\u6DFB\u52A0\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01");case 23:case"end":return U.stop()}},A,null,[[1,7],[13,19]])}));return function(z){return J.apply(this,arguments)}}(),V=(0,a.useState)({id:""}),R=(0,u.Z)(V,2),ee=R[0],L=R[1],X=(0,a.useState)(!1),Z=(0,u.Z)(X,2),I=Z[0],$=Z[1],te=(0,a.useRef)(),Q=(0,a.useState)(1),re=(0,u.Z)(Q,2),ge=re[0],ce=re[1],le=(0,a.useState)(10),H=(0,u.Z)(le,2),pe=H[0],B=H[1],M=(0,a.useState)([]),g=(0,u.Z)(M,2),T=g[0],q=g[1],fe=[{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",valueType:"textarea"},{title:"\u83DC\u8C31\u540D\u79F0",dataIndex:"name",valueType:"textarea"},{title:"\u64CD\u4F5C",dataIndex:"option",valueType:"option",render:function(A,z){return[(0,e.jsx)("a",{onClick:function(){L(z),$(!0),Y.setFieldsValue(z)},children:"\u66F4\u65B0"},"config")]}}],ue=function(){if(t.foodMenuConfig.length>0){var A=[];t.foodMenuConfig.forEach(function(z){A.push(z.id)}),q(A)}};return(0,a.useEffect)(function(){ue()},[]),(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(qe.ZP,{style:{width:"100%"},headerTitle:"\u83DC\u8C31\u5217\u8868",actionRef:te,rowKey:"id",search:!1,pagination:{current:ge,pageSize:pe,onChange:function(A,z){ce(A),B(z)}},request:function(){var J=(0,K.Z)((0,c.Z)().mark(function A(z){var ye,U;return(0,c.Z)().wrap(function(je){for(;;)switch(je.prev=je.next){case 0:return ye=[],U=0,je.next=4,j.GetFoodMenuInfoPage(z).then(function(Te){ye=Te.data.data,U=Te.data.total});case 4:return je.abrupt("return",{data:ye,success:!0,total:U});case 5:case"end":return je.stop()}},A)}));return function(A){return J.apply(this,arguments)}}(),columns:fe,rowSelection:{type:"checkbox",onChange:function(A,z){q(A),t.onSelectedChange("foodMenuConfig",z)},selectedRowKeys:T},toolBarRender:function(){return[(0,e.jsx)(O.Z,{icon:(0,e.jsx)(et.Z,{}),type:"primary",onClick:function(){Y.resetFields();var z=Y.getFieldsValue();z.code=(0,Xe.x0)().substring(0,20),Y.setFieldsValue(z),L({id:""}),$(!0)},children:"\u65B0\u5EFA"},"button")]}}),(0,e.jsx)(Ie.Z,{width:600,title:ee.id?"\u7F16\u8F91\u83DC\u8C31":"\u65B0\u589E\u83DC\u8C31",visible:I,footer:!1,onCancel:function(){return $(!1)},children:(0,e.jsxs)(n.Z,{form:Y,layout:"Horizontal",preserve:!1,onFinish:me,style:{width:"100%"},children:[(0,e.jsx)(n.Z.Item,{name:"id",hidden:!0,children:(0,e.jsx)(w.Z,{})}),(0,e.jsx)(n.Z.Item,{label:"\u83DC\u8C31\u7F16\u7801",name:"code",rules:[{required:!0,max:50}],children:(0,e.jsx)(w.Z,{disabled:!0})}),(0,e.jsx)(n.Z.Item,{label:"\u83DC\u8C31\u540D\u79F0",name:"name",rules:[{required:!0,max:20}],children:(0,e.jsx)(w.Z,{})}),(0,e.jsx)(n.Z.Item,{children:(0,e.jsx)(O.Z,{type:"primary",htmlType:"submit",children:"\u786E\u5B9A"})})]})})]})},$t=Lt,kn=d(57338),mt=d(273),An=d(66456),pt=d(15711),Gn=d(77576),Bt=d(12028),Pn=d(43185),Wt=d(93009),Rn=d(74379),Re=d(38648),Kt=d(84391),zt=d(9669),Yt=d.n(zt),wt="message",Vt=function(t){var xe=h.Z.Option,se=h.Z.OptGroup,Y=(0,a.useState)(),me=(0,u.Z)(Y,2),V=me[0],R=me[1],ee=(0,a.useState)([]),L=(0,u.Z)(ee,2),X=L[0],Z=L[1],I=(0,a.useState)([]),$=(0,u.Z)(I,2),te=$[0],Q=$[1],re=(0,a.useState)([]),ge=(0,u.Z)(re,2),ce=ge[0],le=ge[1],H=n.Z.useForm(),pe=(0,u.Z)(H,1),B=pe[0],M=(0,a.useState)(!1),g=(0,u.Z)(M,2),T=g[0],q=g[1],fe=(0,a.useState)(!1),ue=(0,u.Z)(fe,2),J=ue[0],A=ue[1],z=n.Z.useForm(),ye=(0,u.Z)(z,1),U=ye[0],we=(0,a.useState)(!1),je=(0,u.Z)(we,2),Te=je[0],Ue=je[1],Ge=(0,a.useState)(0),Ke=(0,u.Z)(Ge,2),Pe=Ke[0],be=Ke[1],Be=(0,a.useState)(10),De=(0,u.Z)(Be,2),Ne=De[0],_e=De[1],oe=function(){var l=(0,K.Z)((0,c.Z)().mark(function o(){var C;return(0,c.Z)().wrap(function(E){for(;;)switch(E.prev=E.next){case 0:return E.next=2,j.GetUnitList({current:1,pageSize:200});case 2:C=E.sent,C.statusCode===200&&Z(C.data.data);case 4:case"end":return E.stop()}},o)}));return function(){return l.apply(this,arguments)}}(),ne=function(){var l=(0,K.Z)((0,c.Z)().mark(function o(){var C;return(0,c.Z)().wrap(function(E){for(;;)switch(E.prev=E.next){case 0:return E.next=2,j.GetGoodsbigType({current:1,status:0,pageSize:1e3});case 2:C=E.sent,C.statusCode===200&&Q(C.data.data);case 4:case"end":return E.stop()}},o)}));return function(){return l.apply(this,arguments)}}(),b=function(){var l=(0,K.Z)((0,c.Z)().mark(function o(){var C;return(0,c.Z)().wrap(function(E){for(;;)switch(E.prev=E.next){case 0:return E.next=2,j.GetGoodsSmallType({current:1,status:0,pageSize:1e3});case 2:C=E.sent,C.statusCode===200&&le(C.data.data);case 4:case"end":return E.stop()}},o)}));return function(){return l.apply(this,arguments)}}(),Ze={name:"file",showUploadList:!1,multiple:!1,accept:".png, .jpg, .jpeg, .gif",headers:{"Content-Type":"application/octet-stream"},customRequest:function(o){var C=o.action,D=o.file,E=o.headers,he=o.onError,de=o.onProgress,Ye=o.onSuccess,vn=o.withCredentials;console.log("\u4E0A\u4F20\u56FE\u7247",D);var gn=D.name.lastIndexOf("."),xn=D.name.substr(gn+1),Tt=null;return j.GetCosRequestURL({directory:"goods",fileExtension:xn,method:"PUT"}).then(function(ht){C=ht.allUrl;var bt=new FileReader;bt.readAsArrayBuffer(D),bt.onload=function(Zn){Tt=Zn.target.result,Yt().put(C,Tt,{withCredentials:vn,headers:E,onUploadProgress:function(st){var Cn=st.total,yn=st.loaded;de({percent:Math.round(yn/Cn*100).toFixed(2)},D)}}).then(function(xt){if(xt.status==200||xt.statusText=="OK"){R(ht.seeUrl);var st=B.getFieldsValue();st.imgUrl=ht.seeUrl,B.setFieldsValue(st)}}).catch(he)}}),{abort:function(){console.log("upload progress is aborted.")}}}},ae=function(){var l=(0,K.Z)((0,c.Z)().mark(function o(C){var D,E;return(0,c.Z)().wrap(function(de){for(;;)switch(de.prev=de.next){case 0:if(delete C.imgUrl1,f.default.loading("\u6B63\u5728\u914D\u7F6E",wt),!C.id){de.next=9;break}return de.next=5,j.UpdateGoods(C);case 5:D=de.sent,D.succeeded?(f.default.success("\u4FEE\u6539\u6210\u529F"),Le(!1),Oe.current.reload()):f.default.error(D.errors||"\u4FEE\u6539\u51FA\u9519"),de.next=13;break;case 9:return de.next=11,j.AddGoods(C);case 11:E=de.sent,E.data?(f.default.success("\u6DFB\u52A0\u6210\u529F"),Oe.current.reload(),Le(!1)):f.default.error(E.errors||"\u6DFB\u52A0\u6210\u51FA\u9519");case 13:f.default.destroy(wt);case 14:case"end":return de.stop()}},o)}));return function(C){return l.apply(this,arguments)}}(),Se=[{title:"\u4E3B\u952E",dataIndex:"id",hideInTable:!0,hideInSearch:!0},{title:"\u56FE\u7247\u5730\u5740",dataIndex:"imgUrl",hideInTable:!0,hideInSearch:!0},{title:"\u7F16\u7801",dataIndex:"code",valueType:"textarea"},{title:"\u540D\u79F0",dataIndex:"name",valueType:"textarea"},{title:"\u57FA\u7840\u4EF7\u683C",dataIndex:"price",hideInForm:!0,renderText:function(o){return"".concat(o,"\xA5")},hideInSearch:!0},{title:"\u4F1A\u5458\u4EF7",dataIndex:"vipPrice",hideInForm:!0,renderText:function(o){return"".concat(o,"\xA5")},hideInSearch:!0},{title:"\u5546\u54C1\u5C0F\u7C7B",dataIndex:"goodsTypeName",hideInForm:!0,hideInSearch:!0},{title:"\u5546\u54C1\u7C7B\u578B",dataIndex:"goodsTypeId",hideInForm:!0,hideInTable:!0},{title:"\u5546\u54C1\u5C5E\u6027",dataIndex:"goodsAttribute",hideInForm:!0,valueEnum:{0:{text:"\u5355\u54C1"},1:{text:"\u5957\u9910"}}},{title:"\u72B6\u6001",dataIndex:"status",hideInForm:!0,valueEnum:{0:{text:"\u6B63\u5E38",status:"Processing"},1:{text:"\u505C\u7528",status:"Error"},2:{text:"\u5220\u9664",status:"Error"}}},{title:"\u521B\u5EFA\u65F6\u95F4",dataIndex:"createAt",valueType:"date"},{title:"\u64CD\u4F5C",dataIndex:"option",valueType:"option",render:function(o,C){return[(0,e.jsx)("a",{onClick:function(){Ve(C),Le(!0),B.setFieldsValue(C)},children:"\u66F4\u65B0"},"config")]}}],Ce=[{title:"\u540D\u79F0",dataIndex:"name",valueType:"textarea"}],Ee=(0,a.useState)({id:""}),Fe=(0,u.Z)(Ee,2),ze=Fe[0],Ve=Fe[1],Me=(0,a.useState)(!1),Je=(0,u.Z)(Me,2),Qe=Je[0],Le=Je[1],Oe=(0,a.useRef)(),F=(0,a.useState)([]),S=(0,u.Z)(F,2),r=S[0],i=S[1],s=(0,a.useState)([]),x=(0,u.Z)(s,2),m=x[0],ie=x[1],ve=(0,a.useState)(!1),ke=(0,u.Z)(ve,2),dt=ke[0],ct=ke[1],ut=(0,a.useState)([]),ft=(0,u.Z)(ut,2),gt=ft[0],it=ft[1],G=(0,a.useState)(t.foodMenuConfig[0].id),p=(0,u.Z)(G,2),v=p[0],W=p[1],N=[{title:"\u540D\u79F0",dataIndex:"name",valueType:"textarea"},{title:"\u64CD\u4F5C",dataIndex:"option",valueType:"option",render:function(o,C){return[(0,e.jsx)("a",{onClick:function(){t.onAddGoodsToFoodMenu(v,C,!1)},children:"\u79FB\u51FA\u83DC\u8C31"})]}}],P=function(){if(m.length===0){Re.default.error({message:"\u5546\u54C1\u6DFB\u52A0\u5230\u83DC\u8C31\u51FA\u9519",description:"\u8BF7\u9009\u62E9\u5546\u54C1",placement:"topRight"});return}t.onAddGoodsToFoodMenu(v,m),i([]),ie([])};return(0,a.useEffect)(function(){oe(),ne(),b()},[]),(0,a.useEffect)(function(){var l=t.foodMenuConfig.find(function(o){return o.id===v});it(l?l.goodsConfig:[])},[t.foodMenuConfig,v]),(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(Ie.Z,{width:600,title:ze.id?"\u7F16\u8F91\u5546\u54C1":"\u65B0\u589E\u5546\u54C1",visible:Qe,footer:!1,onCancel:function(){return Le(!1)},children:(0,e.jsxs)(n.Z,{labelCol:{span:4},layout:"horizontal",preserve:!1,onFinish:ae,form:B,children:[(0,e.jsx)(n.Z.Item,{name:"id",hidden:!0,children:(0,e.jsx)(w.Z,{})}),(0,e.jsx)(n.Z.Item,{name:"code",label:"\u5546\u54C1\u7F16\u7801",hidden:!0,children:(0,e.jsx)(w.Z,{disabled:!0})}),(0,e.jsx)(n.Z.Item,{name:"name",label:"\u5546\u54C1\u540D\u79F0",rules:[{required:!0}],children:(0,e.jsx)(w.Z,{})}),(0,e.jsxs)("div",{className:_().add_row_content,children:[(0,e.jsx)(n.Z.Item,{name:"goodsUintId",label:"\u5546\u54C1\u5355\u4F4D",rules:[{required:!0}],children:(0,e.jsx)(h.Z,{style:{width:"75%"},children:X.map(function(l,o){return(0,e.jsx)(h.Z.Option,{index:o,value:l.id,children:l.name},l.id)})})}),(0,e.jsx)(O.Z,{type:"primary",className:_().add_row_btn,onClick:function(){return q(!0)},children:"\u6DFB\u52A0\u5355\u4F4D"})]}),(0,e.jsxs)("div",{className:_().add_row_content,children:[(0,e.jsx)(n.Z.Item,{name:"parentTypeID",label:"\u5546\u54C1\u5927\u7C7B",rules:[{required:!0}],children:(0,e.jsx)(h.Z,{style:{width:"75%"},children:te.map(function(l,o){return(0,e.jsx)(h.Z.Option,{index:o,value:l.id,children:l.name},l.id)})})}),(0,e.jsx)(O.Z,{type:"primary",className:_().add_row_btn,onClick:function(){return A(!0)},children:"\u6DFB\u52A0\u5927\u7C7B"})]}),(0,e.jsxs)("div",{className:_().add_row_content,children:[(0,e.jsx)(n.Z.Item,{name:"goodsTypeId",label:"\u5546\u54C1\u5C0F\u7C7B",rules:[{required:!0}],children:(0,e.jsx)(h.Z,{style:{width:"75%"},children:ce.map(function(l,o){return(0,e.jsx)(h.Z.Option,{index:o,value:l.id,children:l.goodsType_Name},l.id)})})}),(0,e.jsx)(O.Z,{type:"primary",className:_().add_row_btn,onClick:function(){return Ue(!0)},children:"\u6DFB\u52A0\u5C0F\u7C7B"})]}),(0,e.jsx)(n.Z.Item,{name:"price",label:"\u5546\u54C1\u4EF7\u683C",rules:[{required:!0}],children:(0,e.jsx)(nt.Z,{placeholder:"\u4EF7\u683C",min:0,style:{width:"100%"}})}),(0,e.jsx)(n.Z.Item,{name:"vipPrice",label:"\u4F1A\u5458\u4EF7\u683C",children:(0,e.jsx)(nt.Z,{placeholder:"\u4F1A\u5458\u4EF7",min:0,style:{width:"100%"}})}),(0,e.jsx)(n.Z.Item,{name:"goodsAttribute",label:"\u5546\u54C1\u5C5E\u6027",defaultValue:0,rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u5546\u54C1\u5C5E\u6027"}],children:(0,e.jsx)(h.Z,{placeholder:"\u8BF7\u9009\u62E9\u5546\u54C1\u5C5E\u6027",children:(0,e.jsxs)(se,{children:[(0,e.jsx)(h.Z.Option,{value:0,children:"\u5355\u54C1"}),(0,e.jsx)(h.Z.Option,{value:1,children:"\u5957\u9910"})]})})}),(0,e.jsx)(n.Z.Item,{name:"status",label:"\u72B6\u6001",defaultValue:0,rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u72B6\u6001"}],children:(0,e.jsx)(h.Z,{placeholder:"\u8BF7\u9009\u62E9\u72B6\u6001",children:(0,e.jsxs)(se,{children:[(0,e.jsx)(h.Z.Option,{value:0,children:"\u6B63\u5E38"}),(0,e.jsx)(h.Z.Option,{value:1,children:"\u505C\u7528"})]})})}),(0,e.jsx)(n.Z.Item,{name:"remark",label:"\u5907\u6CE8",children:(0,e.jsx)(w.Z,{})}),(0,e.jsx)(n.Z.Item,{name:"imgUrl",hidden:!0,children:(0,e.jsx)(w.Z,{})}),(0,e.jsx)(n.Z.Item,{name:"imgUrl1",label:"\u5546\u54C1\u56FE\u7247\u5730\u5740",children:(0,e.jsx)(Wt.Z,(0,Ae.Z)((0,Ae.Z)({},Ze),{},{children:ze.imgUrl?(0,e.jsx)("img",{src:ze.imgUrl,alt:"avatar",style:{width:"100%"}}):(0,e.jsx)(O.Z,{icon:(0,e.jsx)(Kt.Z,{}),children:"\u4E0A\u4F20"})}))}),(0,e.jsx)(n.Z.Item,{label:"\u662F\u5426\u79F0\u91CD",name:"isWeigh",valuePropName:"checked",initialValue:"false",children:(0,e.jsx)(Bt.Z,{checkedChildren:"\u662F",unCheckedChildren:"\u5426",defaultChecked:"false"})}),(0,e.jsx)(n.Z.Item,{children:(0,e.jsx)(O.Z,{type:"primary",htmlType:"submit",children:"\u786E\u5B9A"})})]})}),(0,e.jsx)(qe.ZP,{actionRef:Oe,style:{width:"100%"},headerTitle:"\u5546\u54C1\u5217\u8868",rowKey:"id",search:{labelWidth:120},pagination:{current:Pe,pageSize:Ne,onChange:function(o,C){be(o),_e(C)}},request:function(){var l=(0,K.Z)((0,c.Z)().mark(function o(C){var D,E;return(0,c.Z)().wrap(function(de){for(;;)switch(de.prev=de.next){case 0:return D=[],E=0,de.next=4,j.GetgoodsList(C).then(function(Ye){D=Ye.data.data,E=Ye.data.total});case 4:return de.abrupt("return",{data:D,success:!0,total:E});case 5:case"end":return de.stop()}},o)}));return function(o){return l.apply(this,arguments)}}(),columns:Se,toolBarRender:function(){return[(0,e.jsx)(O.Z,{icon:(0,e.jsx)(et.Z,{}),type:"primary",onClick:function(){B.resetFields(),Ve({id:""}),Le(!0)},children:"\u65B0\u5EFA"},"button"),(0,e.jsx)(O.Z,{type:"primary",onClick:function(){ct(!0)},children:"\u5173\u8054\u83DC\u8C31"},"button")]}}),(0,e.jsx)(Ie.Z,{title:"\u65B0\u5EFA\u5546\u54C1\u5355\u4F4D",width:640,visible:T,bodyStyle:{padding:"32px 40px 48px"},footer:null,onCancel:function(){q(!1)},destroyOnClose:!0,maskClosable:!1,children:(0,e.jsxs)(n.Z,{layout:"vertical",preserve:!1,onFinish:function(){var l=(0,K.Z)((0,c.Z)().mark(function o(C){var D;return(0,c.Z)().wrap(function(he){for(;;)switch(he.prev=he.next){case 0:return he.next=2,j.CreateUnit(C);case 2:D=he.sent,D.data?(f.default.success("\u5546\u54C1\u5355\u4F4D\u6DFB\u52A0\u6210\u529F"),q(!1),oe()):f.default.error(D.errors||"\u5546\u54C1\u5355\u4F4D\u6DFB\u52A0\u5931\u8D25");case 4:case"end":return he.stop()}},o)}));return function(o){return l.apply(this,arguments)}}(),children:[(0,e.jsx)(n.Z.Item,{name:"id",hidden:!0,children:(0,e.jsx)(w.Z,{})}),(0,e.jsx)(n.Z.Item,{name:"name",label:"\u5546\u54C1\u5355\u4F4D\u540D\u79F0",rules:[{required:!0,max:64}],children:(0,e.jsx)(w.Z,{placeholder:"\u5546\u54C1\u5355\u4F4D\u540D\u79F0"})}),(0,e.jsx)(n.Z.Item,{name:"status",label:"\u72B6\u6001",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u72B6\u6001"}],children:(0,e.jsx)(h.Z,{placeholder:"\u8BF7\u9009\u62E9\u72B6\u6001",children:(0,e.jsxs)(se,{children:[(0,e.jsx)(h.Z.Option,{value:"0",children:"\u6B63\u5E38"}),(0,e.jsx)(h.Z.Option,{value:"1",children:"\u505C\u7528"})]})})}),(0,e.jsx)(n.Z.Item,{children:(0,e.jsx)(O.Z,{type:"primary",htmlType:"submit",children:"\u4FDD\u5B58"})})]})}),(0,e.jsx)(Ie.Z,{title:"\u65B0\u5EFA\u5546\u54C1\u5927\u7C7B",width:640,visible:J,bodyStyle:{padding:"32px 40px 48px"},footer:null,onCancel:function(){A(!1)},destroyOnClose:!0,children:(0,e.jsxs)(n.Z,{form:U,labelCol:{span:6},layout:"horizontal",preserve:!1,onFinish:function(){var l=(0,K.Z)((0,c.Z)().mark(function o(C){var D;return(0,c.Z)().wrap(function(he){for(;;)switch(he.prev=he.next){case 0:return he.next=2,j.AddGoodsTypeListNew(C);case 2:D=he.sent,D.data?(f.default.success("\u5546\u54C1\u5927\u7C7B\u6DFB\u52A0\u6210\u529F"),A(!1),ne()):f.default.error(D.errors||"\u5546\u54C1\u5927\u7C7B\u6DFB\u52A0\u5931\u8D25");case 4:case"end":return he.stop()}},o)}));return function(o){return l.apply(this,arguments)}}(),children:[(0,e.jsx)(n.Z.Item,{name:"id",hidden:!0,children:(0,e.jsx)(w.Z,{})}),(0,e.jsx)(n.Z.Item,{name:"name",label:"\u5546\u54C1\u5927\u7C7B\u540D\u79F0",rules:[{required:!0,max:50}],children:(0,e.jsx)(w.Z,{})}),(0,e.jsx)(n.Z.Item,{name:"status",label:"\u72B6\u6001",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u72B6\u6001"}],children:(0,e.jsx)(h.Z,{placeholder:"\u8BF7\u9009\u62E9\u72B6\u6001",children:(0,e.jsxs)(se,{children:[(0,e.jsx)(h.Z.Option,{value:"0",children:"\u6B63\u5E38"}),(0,e.jsx)(h.Z.Option,{value:"1",children:"\u505C\u7528"})]})})}),(0,e.jsx)(n.Z.Item,{name:"remark",label:"\u5907\u6CE8",children:(0,e.jsx)(w.Z,{})}),(0,e.jsx)(n.Z.Item,{children:(0,e.jsx)(O.Z,{type:"primary",htmlType:"submit",children:"\u4FDD\u5B58"})})]})}),(0,e.jsx)(Ie.Z,{title:"\u65B0\u5EFA\u5546\u54C1\u5C0F\u7C7B",width:640,visible:Te,bodyStyle:{padding:"32px 40px 48px"},footer:null,onCancel:function(){Ue(!1)},destroyOnClose:!0,children:(0,e.jsxs)(n.Z,{labelCol:{span:6},layout:"horizontal",preserve:!1,onFinish:function(){var l=(0,K.Z)((0,c.Z)().mark(function o(C){var D;return(0,c.Z)().wrap(function(he){for(;;)switch(he.prev=he.next){case 0:return he.next=2,j.AddGoodsSmallType(C);case 2:D=he.sent,D.data?(f.default.success("\u5546\u54C1\u5C0F\u7C7B\u6DFB\u52A0\u6210\u529F"),Ue(!1),b()):f.default.error(D.errors||"\u5546\u54C1\u5C0F\u7C7B\u6DFB\u52A0\u5931\u8D25");case 4:case"end":return he.stop()}},o)}));return function(o){return l.apply(this,arguments)}}(),children:[(0,e.jsx)(n.Z.Item,{name:"id",hidden:!0,children:(0,e.jsx)(w.Z,{})}),(0,e.jsx)(n.Z.Item,{name:"goodsType_Name",label:"\u5546\u54C1\u5C0F\u7C7B\u540D\u79F0",rules:[{required:!0,max:50}],children:(0,e.jsx)(w.Z,{})}),(0,e.jsx)(n.Z.Item,{name:"status",label:"\u72B6\u6001",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u72B6\u6001"}],children:(0,e.jsx)(h.Z,{placeholder:"\u8BF7\u9009\u62E9\u72B6\u6001",children:(0,e.jsxs)(se,{children:[(0,e.jsx)(h.Z.Option,{value:"0",children:"\u6B63\u5E38"}),(0,e.jsx)(h.Z.Option,{value:"1",children:"\u505C\u7528"})]})})}),(0,e.jsx)(n.Z.Item,{name:"remark",label:"\u5907\u6CE8",children:(0,e.jsx)(w.Z,{})}),(0,e.jsx)(n.Z.Item,{children:(0,e.jsx)(O.Z,{type:"primary",htmlType:"submit",children:"\u4FDD\u5B58"})})]})}),(0,e.jsxs)(mt.Z,{width:800,title:"\u5546\u54C1\u6DFB\u52A0\u5230\u83DC\u8C31",placement:"right",onClose:function(){return ct(!1)},visible:dt,children:[(0,e.jsxs)("div",{style:{display:"flex",alignItems:"center",marginBottom:"10px"},children:[(0,e.jsx)("div",{className:_().current_selected_obj,children:"\u5F53\u524D\u83DC\u8C31\uFF1A"}),(0,e.jsx)(h.Z,{className:_().current_selected_cmp,onChange:function(o){W(o)},placeholder:"\u8BF7\u9009\u62E9\u83DC\u8C31",value:v,size:"large",children:t.foodMenuConfig.map(function(l){return(0,e.jsx)(xe,{value:l.id,children:l.name},l.id)})})]}),(0,e.jsxs)("div",{className:_().add_to_some_box,children:[(0,e.jsx)(qe.ZP,{actionRef:Oe,className:_().wait_add_list,headerTitle:"\u5F85\u6DFB\u52A0\u5546\u54C1\u5217\u8868",rowKey:"id",search:!1,pagination:{current:Pe,pageSize:Ne,onChange:function(o,C){be(o),_e(C)}},request:function(){var l=(0,K.Z)((0,c.Z)().mark(function o(C){var D,E;return(0,c.Z)().wrap(function(de){for(;;)switch(de.prev=de.next){case 0:return D=[],C.goodsTypeId!=null&&(C.goodsTypeId=goodsTypes[C.goodsTypeId].goodsTypeId),E=0,de.next=5,j.GetgoodsList(C).then(function(Ye){D=Ye.data.data,E=Ye.data.total});case 5:return de.abrupt("return",{data:D,success:!0,total:E});case 6:case"end":return de.stop()}},o)}));return function(o){return l.apply(this,arguments)}}(),columns:Ce,rowSelection:{type:"checkbox",onSelect:function(o,C){var D=JSON.parse(JSON.stringify(m)),E=JSON.parse(JSON.stringify(r)),he=D.findIndex(function(Ye){return Ye.id===o.id}),de=E.findIndex(function(Ye){return Ye===o.id});C?(he<0&&D.push(o),de<0&&E.push(o.id)):(he>-1&&D.splice(he,1),de>-1&&E.splice(de,1)),ie(D),i(E)},onChange:function(o,C){o.length===0&&i([]),C.length===0&&ie([])},selectedRowKeys:r}}),(0,e.jsx)(pt.Z,{className:_().success_add_list,rowKey:"id",columns:N,dataSource:gt})]}),(0,e.jsx)(O.Z,{className:_().sure_add_btn,type:"primary",onClick:P,children:"\u786E\u5B9A\u6DFB\u52A0"})]})]})},Jt=Vt,Un=d(49111),Qt=d(19650),Nn=d(71153),Ht=d(60331),qt=function(t){var xe,se,Y=n.Z.useForm(),me=(0,u.Z)(Y,1),V=me[0],R=function(){var r=(0,K.Z)((0,c.Z)().mark(function i(s){return(0,c.Z)().wrap(function(m){for(;;)switch(m.prev=m.next){case 0:s.id?j.UpdateBom(s).then(function(ie){ie.data?f.default.success("\u4FEE\u6539\u6210\u529F"):f.default.error("\u4FEE\u6539\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01"),De.current.reload(),Be(!1)}):j.AddBom(s).then(function(ie){ie.data?(f.default.success("\u6DFB\u52A0\u6210\u529F"),De.current.reload(),Be(!1)):f.default.error("\u6DFB\u52A0\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01")});case 1:case"end":return m.stop()}},i)}));return function(s){return r.apply(this,arguments)}}(),ee=[{title:"\u4E3B\u952E",dataIndex:"id",hideInTable:!0,hideInSearch:!0},{title:"\u914D\u65B9\u7F16\u7801",dataIndex:"code",hideInForm:!0,hideInSearch:!0},{title:"\u914D\u65B9\u540D\u79F0",dataIndex:"name",hideInForm:!0,hideInSearch:!0},{title:"\u6392\u5E8F",dataIndex:"sort",hideInForm:!0,hideInSearch:!0},{title:"\u914D\u65B9\u5206\u7C7B",dataIndex:"bomTypeList",search:!1,width:450,render:function(i,s){return(0,e.jsx)(Qt.Z,{children:ue.filter(function(x){var m=s.bomTypeList.find(function(ve){return ve===x.id}),ie=ue.find(function(ve){return ve.id===m});return ie!=null||void 0}).map(function(x){return(0,e.jsx)(Ht.Z,{color:"#87d068",children:x.name},x.id)})})}},{title:"\u914D\u65B9\u7C7B\u578B",dataIndex:"isMain",hideInForm:!0,valueEnum:{false:{text:"\u8F85\u6599\u914D\u65B9",status:"Processing"},true:{text:"\u4E3B\u6599\u914D\u65B9",status:"Success"}}},{title:"\u64CD\u4F5C",dataIndex:"option",valueType:"option",render:function(i,s){return[(0,e.jsx)("a",{type:"primary",onClick:function(){Be(!0),Ge(s),V.setFieldsValue(s)},children:"\u66F4\u65B0"},"primary3")]}}],L=[{title:"\u914D\u65B9\u540D\u79F0",dataIndex:"name",hideInForm:!0,hideInSearch:!0}],X=(0,a.useState)(0),Z=(0,u.Z)(X,2),I=Z[0],$=Z[1],te=(0,a.useState)(5),Q=(0,u.Z)(te,2),re=Q[0],ge=Q[1],ce=(0,a.useState)([]),le=(0,u.Z)(ce,2),H=le[0],pe=le[1],B=(0,a.useState)([]),M=(0,u.Z)(B,2),g=M[0],T=M[1],q=(0,a.useState)([]),fe=(0,u.Z)(q,2),ue=fe[0],J=fe[1],A=(0,a.useState)(!1),z=(0,u.Z)(A,2),ye=z[0],U=z[1],we=function(){var r=(0,K.Z)((0,c.Z)().mark(function i(){var s;return(0,c.Z)().wrap(function(m){for(;;)switch(m.prev=m.next){case 0:return m.next=2,j.GetBomTypePage({current:1,pagesize:1e3});case 2:s=m.sent,s.statusCode===200&&J(s.data.data);case 4:case"end":return m.stop()}},i)}));return function(){return r.apply(this,arguments)}}(),je=(0,a.useState)({id:""}),Te=(0,u.Z)(je,2),Ue=Te[0],Ge=Te[1],Ke=(0,a.useState)(!1),Pe=(0,u.Z)(Ke,2),be=Pe[0],Be=Pe[1],De=(0,a.useRef)(),Ne=(0,a.useState)(!1),_e=(0,u.Z)(Ne,2),oe=_e[0],ne=_e[1],b=(0,a.useState)(""),Ze=(0,u.Z)(b,2),ae=Ze[0],Se=Ze[1],Ce=(0,a.useState)([]),Ee=(0,u.Z)(Ce,2),Fe=Ee[0],ze=Ee[1],Ve=(0,a.useState)([]),Me=(0,u.Z)(Ve,2),Je=Me[0],Qe=Me[1],Le=[{title:"\u914D\u65B9\u540D\u79F0",dataIndex:"name",hideInForm:!0,hideInSearch:!0},{title:"\u64CD\u4F5C",dataIndex:"option",valueType:"option",render:function(i,s){return[(0,e.jsx)("a",{type:"primary",onClick:function(){t.onBomRelationGoods(s.goodsId,s,!1)},children:"\u79FB\u9664\u914D\u65B9"},"primary3")]}}],Oe=function(){var i=[];t.foodMenuConfig.forEach(function(s){var x=s.id;s.goodsConfig&&s.goodsConfig.forEach(function(m){m.foodMenuId=x;var ie=i.find(function(ve){return ve.id===m.id});ie||i.push(m)})}),ae||Se(i[0].id),ze(i)},F=function(){var i=Fe.find(function(s){return s.id===ae});i&&i.bomConfig?Qe(i.bomConfig):Qe([])},S=function(){if(H.length===0){Re.default.error({message:"\u914D\u65B9\u5173\u8054\u5546\u54C1\u51FA\u9519",description:"\u8BF7\u9009\u62E9\u914D\u65B9",placement:"topRight"});return}var i=Fe.find(function(s){return s.id===ae});i&&(H.forEach(function(s){s.foodMenuId=i.foodMenuId,s.goodsId=i.id}),t.onBomRelationGoods(i.id,H),T([]),pe([]))};return(0,a.useEffect)(function(){we()},[]),(0,a.useEffect)(function(){Oe()},[t.foodMenuConfig]),(0,a.useEffect)(function(){F()},[Fe,ae]),(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(Ie.Z,{width:600,title:Ue.id?"\u7F16\u8F91\u914D\u65B9":"\u65B0\u589E\u914D\u65B9",visible:be,footer:!1,onCancel:function(){return Be(!1)},children:(0,e.jsxs)(n.Z,{labelCol:{span:4},layout:"horizontal",preserve:!1,onFinish:R,form:V,children:[(0,e.jsx)(n.Z.Item,{name:"id",hidden:!0,children:(0,e.jsx)(w.Z,{})}),(0,e.jsx)(n.Z.Item,{name:"code",label:"\u914D\u65B9\u7F16\u7801",rules:[{required:!0}],children:(0,e.jsx)(w.Z,{disabled:!0,placeholder:"\u914D\u65B9\u7F16\u7801"})}),(0,e.jsx)(n.Z.Item,{name:"name",label:"\u914D\u65B9\u540D\u79F0",rules:[{required:!0}],children:(0,e.jsx)(w.Z,{placeholder:"\u914D\u65B9\u540D\u79F0"})}),(0,e.jsxs)("div",{className:_().add_row_content,children:[(0,e.jsx)(n.Z.Item,{name:"bomTypeList",label:"\u914D\u65B9\u7C7B\u578B",rules:[{required:!0}],children:(0,e.jsx)(h.Z,{style:{width:"70%"},mode:"multiple",allowClear:!0,children:ue.map(function(r,i){return(0,e.jsx)(h.Z.Option,{index:r.id,value:r.id,children:r.name},r.id)})})}),(0,e.jsx)(O.Z,{type:"primary",className:_().add_row_btn,onClick:function(){return U(!0)},children:"\u6DFB\u52A0\u914D\u65B9\u7C7B\u578B"})]}),(0,e.jsx)(n.Z.Item,{name:"isMain",label:"\u914D\u65B9\u7C7B\u578B",children:(0,e.jsx)(Bt.Z,{checkedChildren:"\u4E3B\u6599",unCheckedChildren:"\u8F85\u6599"})}),(0,e.jsx)(n.Z.Item,{name:"sort",label:"\u6392\u5E8F",rules:[{required:!0}],children:(0,e.jsx)(nt.Z,{placeholder:"\u6392\u5E8F",min:1})}),(0,e.jsx)(n.Z.Item,{children:(0,e.jsx)(O.Z,{type:"primary",htmlType:"submit",children:"\u786E\u5B9A"})})]})}),(0,e.jsx)(Ie.Z,{title:"\u65B0\u5EFA\u914D\u65B9\u7C7B\u578B",width:640,bodyStyle:{padding:"32px 40px 48px"},visible:ye,footer:null,onCancel:function(){U(!1)},destroyOnClose:!0,maskClosable:!1,children:(0,e.jsxs)(n.Z,{layout:"vertical",preserve:!1,initialValues:t==null?void 0:t.values,onFinish:function(){var r=(0,K.Z)((0,c.Z)().mark(function i(s){var x;return(0,c.Z)().wrap(function(ie){for(;;)switch(ie.prev=ie.next){case 0:return ie.next=2,j.CreateBomType(s);case 2:x=ie.sent,x.data?(f.default.success("\u914D\u65B9\u7C7B\u522B\u6DFB\u52A0\u6210\u529F"),U(!1),we()):f.default.error(x.errors||"\u914D\u65B9\u7C7B\u522B\u6DFB\u52A0\u5931\u8D25");case 4:case"end":return ie.stop()}},i)}));return function(i){return r.apply(this,arguments)}}(),children:[(0,e.jsx)(n.Z.Item,{name:"id",hidden:!0,children:(0,e.jsx)(w.Z,{})}),(0,e.jsx)(n.Z.Item,{name:"name",label:"\u914D\u65B9\u7C7B\u578B\u540D\u79F0",rules:[{required:!0,max:64,whitespace:!0}],children:(0,e.jsx)(w.Z,{placeholder:"\u8BF7\u8F93\u5165\u914D\u65B9\u7C7B\u578B\u540D\u79F0"})}),(0,e.jsx)(n.Z.Item,{name:"pertain",label:"\u5F52\u5C5E",defaultValue:t==null||(xe=t.values)===null||xe===void 0?void 0:xe.pertain,rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u7C7B\u578B\u5F52\u5C5E"}],children:(0,e.jsxs)(h.Z,{placeholder:"\u8BF7\u9009\u62E9\u7C7B\u578B\u5F52\u5C5E",children:[(0,e.jsx)(Option,{value:"1",children:"\u65E0"}),(0,e.jsx)(Option,{value:"2",children:"TMC "})]})}),(0,e.jsx)(n.Z.Item,{name:"status",label:"\u72B6\u6001",defaultValue:t==null||(se=t.values)===null||se===void 0?void 0:se.status,rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u72B6\u6001"}],children:(0,e.jsxs)(h.Z,{placeholder:"\u8BF7\u9009\u62E9\u72B6\u6001",children:[(0,e.jsx)(Option,{value:"0",children:"\u6B63\u5E38"}),(0,e.jsx)(Option,{value:"1",children:"\u505C\u7528"})]})}),(0,e.jsx)(n.Z.Item,{children:(0,e.jsx)(O.Z,{type:"primary",htmlType:"submit",children:"\u4FDD\u5B58"})})]})}),(0,e.jsx)(qe.ZP,{actionRef:De,style:{width:"100%"},headerTitle:"\u914D\u65B9\u5217\u8868",rowKey:"id",pagination:{current:I,pageSize:re,onChange:function(i,s){$(i),ge(s)}},search:!1,request:function(){var r=(0,K.Z)((0,c.Z)().mark(function i(s){var x,m;return(0,c.Z)().wrap(function(ve){for(;;)switch(ve.prev=ve.next){case 0:return x=[],m=0,ve.next=4,j.GetBomPage(s).then(function(ke){x=ke.data.data,m=ke.data.total});case 4:return ve.abrupt("return",{data:x,success:!0,total:m});case 5:case"end":return ve.stop()}},i)}));return function(i){return r.apply(this,arguments)}}(),columns:ee,toolBarRender:function(){return[(0,e.jsx)(O.Z,{icon:(0,e.jsx)(et.Z,{}),type:"primary",onClick:function(){V.resetFields();var s=V.getFieldsValue();s.code=(0,Xe.x0)().substring(0,20),V.setFieldsValue(s),Ge({id:""}),Be(!0)},children:"\u65B0\u5EFA"},"button"),(0,e.jsx)(O.Z,{type:"primary",onClick:function(){ne(!0)},children:"\u5173\u8054\u5546\u54C1"},"button")]}}),(0,e.jsxs)(mt.Z,{width:800,title:"\u914D\u65B9\u5173\u8054\u5546\u54C1",placement:"right",onClose:function(){return ne(!1)},visible:oe,children:[(0,e.jsxs)("div",{style:{display:"flex",alignItems:"center",marginBottom:"10px"},children:[(0,e.jsx)("div",{className:_().current_selected_obj,children:"\u5F53\u524D\u5546\u54C1\uFF1A"}),(0,e.jsx)(h.Z,{className:_().current_selected_cmp,onChange:function(i){Se(i)},placeholder:"\u8BF7\u9009\u62E9\u5546\u54C1",value:ae,size:"large",children:Fe.map(function(r){return(0,e.jsx)(Option,{value:r.id,children:r.name},r.id)})})]}),(0,e.jsxs)("div",{className:_().add_to_some_box,children:[(0,e.jsx)(qe.ZP,{actionRef:De,className:_().wait_add_list,headerTitle:"\u914D\u65B9\u5217\u8868",rowKey:"id",pagination:{current:I,pageSize:re,onChange:function(i,s){$(i),ge(s)}},search:!1,request:function(){var r=(0,K.Z)((0,c.Z)().mark(function i(s){var x,m;return(0,c.Z)().wrap(function(ve){for(;;)switch(ve.prev=ve.next){case 0:return x=[],m=0,ve.next=4,j.GetBomPage(s).then(function(ke){x=ke.data.data,m=ke.data.total});case 4:return ve.abrupt("return",{data:x,success:!0,total:m});case 5:case"end":return ve.stop()}},i)}));return function(i){return r.apply(this,arguments)}}(),columns:L,rowSelection:{type:"checkbox",onSelect:function(i,s){var x=JSON.parse(JSON.stringify(H)),m=JSON.parse(JSON.stringify(g)),ie=x.findIndex(function(ke){return ke.id===i.id}),ve=m.findIndex(function(ke){return ke===i.id});s?(ie<0&&x.push(i),ve<0&&m.push(i.id)):(ie>-1&&x.splice(ie,1),ve>-1&&m.splice(ve,1)),pe(x),T(m)},onChange:function(i,s){i.length===0&&T([]),s.length===0&&pe([])},selectedRowKeys:g}}),(0,e.jsx)(pt.Z,{className:_().success_add_list,rowKey:"id",columns:Le,dataSource:Je})]}),(0,e.jsx)(O.Z,{className:_().sure_add_btn,type:"primary",onClick:S,children:"\u786E\u5B9A\u5173\u8054"})]})]})},Xt=qt,_n=d(13062),en=d(71230),Ln=d(89032),$e=d(15746),tn=d(952),lt=d(5966),rt=d(64317),vt=d(31199),nn=h.Z.Option,It=h.Z.OptGroup,We={name:"\u7269\u6599\u540D\u79F0",stockUint:"\u5E93\u5B58\u5355\u4F4D",specs:"\u7269\u6599\u89C4\u683C",code:"\u7269\u6599\u7F16\u7801",aittribute:"\u7269\u6599\u5C5E\u6027",typeID:"\u7269\u6599\u7C7B\u522B",status:"\u7269\u6599\u72B6\u6001",price:"\u6210\u672C\u4EF7",netrecovery:"\u51C0\u6599\u7387(%)",OutstockUint:"\u51FA\u5E93\u5355\u4F4D",proportion:"\u6362\u7B97\u6BD4\u4F8B(%)"},an=function(t){var xe=n.Z.useForm(),se=(0,u.Z)(xe,1),Y=se[0],me=(0,a.useState)(1),V=(0,u.Z)(me,2),R=V[0],ee=V[1],L=(0,a.useState)(10),X=(0,u.Z)(L,2),Z=X[0],I=X[1],$=(0,a.useState)([]),te=(0,u.Z)($,2),Q=te[0],re=te[1],ge=(0,a.useState)([]),ce=(0,u.Z)(ge,2),le=ce[0],H=ce[1],pe=(0,a.useRef)(),B=function(){var G=(0,K.Z)((0,c.Z)().mark(function p(v){return(0,c.Z)().wrap(function(N){for(;;)switch(N.prev=N.next){case 0:v.id?j.UpdateMaterial(v).then(function(P){P.data?(f.default.success("\u4FEE\u6539\u6210\u529F"),ae(!1),pe.current.reload()):f.default.error("\u4FEE\u6539\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01")}):j.AddMaterial(v).then(function(P){P.data?(f.default.success("\u6DFB\u52A0\u6210\u529F"),ae(!1),pe.current.reload()):f.default.error("\u6DFB\u52A0\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01")});case 1:case"end":return N.stop()}},p)}));return function(v){return G.apply(this,arguments)}}(),M=[{title:"\u7269\u6599\u540D\u79F0",dataIndex:"name",ellipsis:!0,formItemProps:{rules:[{required:!0,message:"\u540D\u79F0\u4E3A\u5FC5\u586B\u9879"}]}},{title:"\u7269\u6599\u5C5E\u6027",dataIndex:"aittribute",valueEnum:{0:{text:"\u6210\u54C1"},1:{text:"\u534A\u6210\u54C1"},2:{text:"\u6613\u8017\u54C1"}}},{title:"\u72B6\u6001",dataIndex:"status",hideInForm:!0,valueEnum:{0:{text:"\u6B63\u5E38",status:"Processing"},1:{text:"\u505C\u7528",status:"Success"}}},{title:"\u64CD\u4F5C",dataIndex:"option",valueType:"option",render:function(p,v){return[(0,e.jsx)("a",{type:"primary",onClick:function(){ae(!0),oe(v),Y.setFieldsValue(v)},children:"\u66F4\u65B0"},"primary3")]}}],g=[{title:"\u7269\u6599\u540D\u79F0",dataIndex:"name",ellipsis:!0,formItemProps:{rules:[{required:!0,message:"\u540D\u79F0\u4E3A\u5FC5\u586B\u9879"}]}}],T=(0,a.useState)([]),q=(0,u.Z)(T,2),fe=q[0],ue=q[1],J=(0,a.useState)([]),A=(0,u.Z)(J,2),z=A[0],ye=A[1],U=function(){var G=(0,K.Z)((0,c.Z)().mark(function p(){var v;return(0,c.Z)().wrap(function(N){for(;;)switch(N.prev=N.next){case 0:return N.next=2,j.GetMaterialTypeList();case 2:v=N.sent,v.statusCode===200?(v.data.forEach(function(P){P.value=P.id,P.label=P.name}),ue(v.data)):f.default.error(v.errors||"\u83B7\u53D6\u7269\u6599\u7C7B\u522B\u51FA\u9519");case 4:case"end":return N.stop()}},p)}));return function(){return G.apply(this,arguments)}}(),we=function(){var G=(0,K.Z)((0,c.Z)().mark(function p(){var v;return(0,c.Z)().wrap(function(N){for(;;)switch(N.prev=N.next){case 0:return N.next=2,j.GetMaterialUintList();case 2:v=N.sent,v.statusCode===200?(v.data.forEach(function(P){P.value=P.id,P.label=P.name}),ye(v.data)):f.default.error(v.errors||"\u83B7\u53D6\u7269\u6599\u7C7B\u522B\u51FA\u9519");case 4:case"end":return N.stop()}},p)}));return function(){return G.apply(this,arguments)}}(),je=(0,a.useState)(!1),Te=(0,u.Z)(je,2),Ue=Te[0],Ge=Te[1],Ke=(0,a.useState)(!1),Pe=(0,u.Z)(Ke,2),be=Pe[0],Be=Pe[1],De=(0,a.useState)({id:""}),Ne=(0,u.Z)(De,2),_e=Ne[0],oe=Ne[1],ne=(0,a.useState)(!1),b=(0,u.Z)(ne,2),Ze=b[0],ae=b[1],Se=(0,a.useState)(!1),Ce=(0,u.Z)(Se,2),Ee=Ce[0],Fe=Ce[1],ze=(0,a.useState)(""),Ve=(0,u.Z)(ze,2),Me=Ve[0],Je=Ve[1],Qe=(0,a.useState)([]),Le=(0,u.Z)(Qe,2),Oe=Le[0],F=Le[1],S=(0,a.useState)([]),r=(0,u.Z)(S,2),i=r[0],s=r[1],x=[{title:"\u7269\u6599\u540D\u79F0",dataIndex:"name",ellipsis:!0,formItemProps:{rules:[{required:!0,message:"\u540D\u79F0\u4E3A\u5FC5\u586B\u9879"}]}},{title:"\u7269\u6599\u6570\u91CF",dataIndex:"BomQty",width:50},{title:"\u64CD\u4F5C",dataIndex:"option",valueType:"option",render:function(p,v){return[(0,e.jsx)("a",{type:"primary",onClick:function(){var N=Oe.find(function(P){return P.id===Me});N&&t.onMaterialRelationBom(N.id,v,!1)},children:"\u79FB\u9664\u7269\u6599"},"primary3"),(0,e.jsx)("a",{type:"primary",style:{marginLeft:"10px"},onClick:function(){it.setFieldsValue(v),ut(!0)},children:"\u8BBE\u7F6E\u6570\u91CF"},"primary3")]}}],m=function(){var p,v=[];if((p=t.foodMenuConfig)===null||p===void 0||p.forEach(function(N){var P;(P=N.goodsConfig)===null||P===void 0||P.forEach(function(l){var o;(o=l.bomConfig)===null||o===void 0||o.forEach(function(C){var D=v.find(function(E){return E.id===C.id});D||(C.goodsId=l.id,v.push(C))})})}),!Me){var W;Je((W=v[0])===null||W===void 0?void 0:W.id)}F(v)},ie=function(){if(Q.length===0){Re.default.error({message:"\u914D\u65B9\u5173\u8054\u5546\u54C1\u51FA\u9519",description:"\u8BF7\u9009\u62E9\u914D\u65B9",placement:"topRight"});return}var p=Oe.find(function(W){return W.id===Me});if(p){var v=JSON.parse(JSON.stringify(Q));v.forEach(function(W){W.BomQty=0}),t.onMaterialRelationBom(p.id,v),H([]),re([])}},ve=function(){var p=Oe.find(function(v){return v.id===Me});p&&p.materialConfig?s(p.materialConfig):s([])},ke=(0,a.useState)(!1),dt=(0,u.Z)(ke,2),ct=dt[0],ut=dt[1],ft=n.Z.useForm(),gt=(0,u.Z)(ft,1),it=gt[0];return(0,a.useEffect)(function(){U(),we()},[]),(0,a.useEffect)(function(){m()},[t.foodMenuConfig]),(0,a.useEffect)(function(){ve()},[Oe,Me]),(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(Ie.Z,{width:800,title:_e.id?"\u7F16\u8F91\u7269\u6599":"\u65B0\u589E\u7269\u6599",visible:Ze,footer:!1,onCancel:function(){return ae(!1)},children:(0,e.jsxs)(tn.ZP,{form:Y,labelCol:{span:6},layout:"horizontal",hideRequiredMark:!0,initialValues:t.materialConfig,onFinish:B,submitter:!1,children:[(0,e.jsxs)(en.Z,{gutter:16,children:[(0,e.jsx)($e.Z,{lg:12,md:12,sm:24,children:(0,e.jsx)(lt.Z,{label:We.code,name:"code",rules:[{required:!0,max:50}],placeholder:"\u8BF7\u8F93\u5165\u539F\u6599\u7F16\u7801"})}),(0,e.jsxs)($e.Z,{lg:12,md:12,sm:24,children:[(0,e.jsx)(lt.Z,{name:"id",hidden:!0}),(0,e.jsx)(lt.Z,{label:We.name,name:"name",rules:[{required:!0,max:50}],placeholder:"\u8BF7\u8F93\u5165\u539F\u6599\u540D\u79F0"})]}),(0,e.jsx)($e.Z,{lg:12,md:12,sm:24,children:(0,e.jsx)(lt.Z,{label:We.specs,name:"specs",rules:[{required:!0,max:500}],placeholder:"\u8BF7\u8F93\u5165\u89C4\u683C\u578B\u53F7"})}),(0,e.jsx)($e.Z,{lg:12,md:12,sm:24,children:(0,e.jsx)(rt.Z,{label:We.aittribute,name:"aittribute",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u7269\u6599\u5C5E\u6027"}],options:[{value:"0",label:"\u6210\u54C1"},{value:"1",label:"\u534A\u6210\u54C1"},{value:"2",label:"\u6613\u8017\u54C1"}],placeholder:"\u8BF7\u9009\u62E9\u7269\u6599\u5C5E\u6027"})}),(0,e.jsx)($e.Z,{lg:12,md:12,sm:24,children:(0,e.jsx)(vt.Z,{label:We.price,name:"price",placeholder:"\u8BF7\u8F93\u5165\u6210\u672C\u4EF7",min:1})}),(0,e.jsx)($e.Z,{lg:12,md:12,sm:24,children:(0,e.jsx)(vt.Z,{label:We.netrecovery,name:"netrecovery",min:1,max:100,placeholder:"\u8BF7\u8F93\u5165\u51C0\u6599\u7387"})}),(0,e.jsx)($e.Z,{lg:12,md:12,sm:24,children:(0,e.jsxs)("div",{className:_().add_row_content,children:[(0,e.jsx)(rt.Z,{style:{width:"65%"},label:We.typeID,name:"typeID",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u7269\u6599\u7C7B\u522B"}],options:fe,placeholder:"\u8BF7\u9009\u62E9\u7269\u6599\u7C7B\u522B"}),(0,e.jsx)(O.Z,{onClick:function(){return Ge(!0)},type:"primary",className:_().add_row_btn,children:"\u6DFB\u52A0\u7C7B\u522B"})]})}),(0,e.jsx)($e.Z,{lg:12,md:12,sm:24,children:(0,e.jsxs)("div",{className:_().add_row_content,children:[(0,e.jsx)(rt.Z,{style:{width:"65%"},label:We.stockUint,name:"stockUint",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u5355\u4F4D"}],options:z,placeholder:"\u8BF7\u9009\u62E9\u5355\u4F4D"}),(0,e.jsx)(O.Z,{onClick:function(){return Be(!0)},type:"primary",className:_().add_row_btn,children:"\u6DFB\u52A0\u5355\u4F4D"})]})}),(0,e.jsx)($e.Z,{lg:12,md:12,sm:24,children:(0,e.jsxs)("div",{className:_().add_row_content,children:[(0,e.jsx)(rt.Z,{style:{width:"65%"},label:We.OutstockUint,name:"outstockUint",options:z,rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u51FA\u5E93\u5355\u4F4D"}],placeholder:"\u8BF7\u9009\u62E9\u51FA\u5E93\u5355\u4F4D"}),(0,e.jsx)(O.Z,{onClick:function(){return Be(!0)},type:"primary",className:_().add_row_btn,children:"\u6DFB\u52A0\u5355\u4F4D"})]})}),(0,e.jsx)($e.Z,{lg:12,md:12,sm:24,children:(0,e.jsx)(vt.Z,{label:We.proportion,name:"proportion",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u51FA\u5165\u5E93\u6362\u7B97\u6BD4\u4F8B"}],placeholder:"\u8BF7\u8F93\u5165\u6362\u7B97\u6BD4\u4F8B"})}),(0,e.jsx)($e.Z,{lg:12,md:12,sm:24,children:(0,e.jsx)(rt.Z,{label:We.status,name:"status",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u72B6\u6001"}],options:[{value:"0",label:"\u6B63\u5E38"},{value:"1",label:"\u505C\u7528"}],placeholder:"\u8BF7\u9009\u62E9\u72B6\u6001"})})]}),(0,e.jsx)(n.Z.Item,{children:(0,e.jsx)(O.Z,{type:"primary",htmlType:"submit",children:"\u786E\u5B9A"})})]})}),(0,e.jsx)(qe.ZP,{actionRef:pe,headerTitle:"\u7269\u6599\u5217\u8868",rowKey:"id",search:{labelWidth:120},pagination:{current:R,pageSize:Z,onChange:function(p,v){ee(p),I(v)}},request:function(){var G=(0,K.Z)((0,c.Z)().mark(function p(v){var W,N;return(0,c.Z)().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return W=[],N=0,l.next=4,j.GetMaterialPage(v).then(function(o){W=o.data.data,N=o.data.total});case 4:return l.abrupt("return",{data:W,success:!0,total:N});case 5:case"end":return l.stop()}},p)}));return function(p){return G.apply(this,arguments)}}(),columns:M,toolBarRender:function(){return[(0,e.jsx)(O.Z,{icon:(0,e.jsx)(et.Z,{}),type:"primary",onClick:function(){Y.resetFields(),oe({id:""}),ae(!0)},children:"\u65B0\u5EFA"},"button"),(0,e.jsx)(O.Z,{type:"primary",onClick:function(){Fe(!0)},children:"\u5173\u8054\u914D\u65B9"},"button")]}}),(0,e.jsx)(Ie.Z,{title:"\u6DFB\u52A0\u7269\u6599\u5355\u4F4D",width:640,visible:be,bodyStyle:{padding:"32px 40px 48px"},footer:null,onCancel:function(){Be(!1)},destroyOnClose:!0,maskClosable:!1,children:(0,e.jsxs)(n.Z,{layout:"vertical",preserve:!1,onFinish:function(){var G=(0,K.Z)((0,c.Z)().mark(function p(v){var W;return(0,c.Z)().wrap(function(P){for(;;)switch(P.prev=P.next){case 0:return P.next=2,j.AddMaterialUnit(v);case 2:W=P.sent,W.data?(f.default.success("\u6DFB\u52A0\u6210\u529F"),Be(!1),we()):f.default.error(W.errors||"\u7269\u6599\u5355\u4F4D\u6DFB\u52A0\u5931\u8D25");case 4:case"end":return P.stop()}},p)}));return function(p){return G.apply(this,arguments)}}(),children:[(0,e.jsx)(n.Z.Item,{name:"id",hidden:!0,children:(0,e.jsx)(w.Z,{})}),(0,e.jsx)(n.Z.Item,{name:"name",label:"\u7269\u6599\u5355\u4F4D\u540D\u79F0",rules:[{required:!0,max:64}],children:(0,e.jsx)(w.Z,{placeholder:"\u7269\u6599\u5355\u4F4D\u540D\u79F0"})}),(0,e.jsx)(n.Z.Item,{name:"status",label:"\u72B6\u6001",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u72B6\u6001"}],children:(0,e.jsx)(h.Z,{placeholder:"\u8BF7\u9009\u62E9\u72B6\u6001",children:(0,e.jsxs)(It,{children:[(0,e.jsx)(h.Z.Option,{value:"0",children:"\u6B63\u5E38"}),(0,e.jsx)(h.Z.Option,{value:"1",children:"\u505C\u7528"})]})})}),(0,e.jsx)(n.Z.Item,{children:(0,e.jsx)(O.Z,{type:"primary",htmlType:"submit",children:"\u4FDD\u5B58"})})]})}),(0,e.jsx)(Ie.Z,{title:"\u6DFB\u52A0\u7269\u6599\u5206\u7C7B",width:640,visible:Ue,bodyStyle:{padding:"32px 40px 48px"},footer:null,onCancel:function(){Ge(!1)},destroyOnClose:!0,maskClosable:!1,children:(0,e.jsxs)(n.Z,{layout:"vertical",preserve:!1,onFinish:function(){var G=(0,K.Z)((0,c.Z)().mark(function p(v){var W;return(0,c.Z)().wrap(function(P){for(;;)switch(P.prev=P.next){case 0:return P.next=2,j.AddMaterialType(v);case 2:W=P.sent,W.data?(f.default.success("\u6DFB\u52A0\u6210\u529F"),Ge(!1),U()):f.default.error(W.errors||"\u7269\u6599\u5206\u7C7B\u6DFB\u52A0\u5931\u8D25");case 4:case"end":return P.stop()}},p)}));return function(p){return G.apply(this,arguments)}}(),children:[(0,e.jsx)(n.Z.Item,{name:"id",hidden:!0,children:(0,e.jsx)(w.Z,{})}),(0,e.jsx)(n.Z.Item,{name:"name",label:"\u7269\u6599\u5206\u7C7B\u540D\u79F0",rules:[{required:!0,max:64,whitespace:!0}],children:(0,e.jsx)(w.Z,{placeholder:"\u8BF7\u8F93\u5165\u7269\u7269\u6599\u5206\u7C7B\u79F0"})}),(0,e.jsx)(n.Z.Item,{name:"status",label:"\u72B6\u6001",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u7269\u6599\u5206\u7C7B\u72B6\u6001"}],children:(0,e.jsx)(h.Z,{placeholder:"\u8BF7\u9009\u62E9\u7269\u6599\u5206\u7C7B\u72B6\u6001",children:(0,e.jsxs)(It,{children:[(0,e.jsx)(h.Z.Option,{value:"0",children:"\u6B63\u5E38"}),(0,e.jsx)(h.Z.Option,{value:"1",children:"\u505C\u7528"})]})})}),(0,e.jsx)(n.Z.Item,{children:(0,e.jsx)(O.Z,{type:"primary",htmlType:"submit",children:"\u4FDD\u5B58"})})]})}),(0,e.jsxs)(mt.Z,{width:900,title:"\u7269\u6599\u5173\u8054\u914D\u65B9",placement:"right",onClose:function(){return Fe(!1)},visible:Ee,children:[(0,e.jsxs)("div",{style:{display:"flex",alignItems:"center",marginBottom:"10px"},children:[(0,e.jsx)("div",{className:_().current_selected_obj,children:"\u5F53\u524D\u914D\u65B9\uFF1A"}),(0,e.jsx)(h.Z,{className:_().current_selected_cmp,onChange:function(p){console.log("setCurrentSelectedBom",p),Je(p)},placeholder:"\u8BF7\u9009\u62E9\u914D\u65B9",value:Me,size:"large",children:Oe.map(function(G){return(0,e.jsx)(nn,{value:G.id,children:G.name},G.id)})})]}),(0,e.jsxs)("div",{className:_().add_to_some_box,children:[(0,e.jsx)(qe.ZP,{className:_().wait_add_list,actionRef:pe,headerTitle:"\u7269\u6599\u5217\u8868",rowKey:"id",search:!1,pagination:{current:R,pageSize:Z,onChange:function(p,v){ee(p),I(v)}},request:function(){var G=(0,K.Z)((0,c.Z)().mark(function p(v){var W,N;return(0,c.Z)().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return W=[],N=0,l.next=4,j.GetMaterialPage(v).then(function(o){W=o.data.data,N=o.data.total});case 4:return l.abrupt("return",{data:W,success:!0,total:N});case 5:case"end":return l.stop()}},p)}));return function(p){return G.apply(this,arguments)}}(),columns:g,rowSelection:{type:"checkbox",onSelect:function(p,v){var W=JSON.parse(JSON.stringify(Q)),N=JSON.parse(JSON.stringify(le)),P=W.findIndex(function(o){return o.id===p.id}),l=N.findIndex(function(o){return o===p.id});v?(P<0&&W.push(p),l<0&&N.push(p.id)):(P>-1&&W.splice(P,1),l>-1&&N.splice(l,1)),re(W),H(N)},onChange:function(p,v){p.length===0&&H([]),v.length===0&&re([])},selectedRowKeys:le}}),(0,e.jsx)(pt.Z,{className:_().success_add_list,rowKey:"id",columns:x,dataSource:i})]}),(0,e.jsx)(O.Z,{className:_().sure_add_btn,type:"primary",onClick:ie,children:"\u786E\u5B9A\u5173\u8054"})]}),(0,e.jsx)(Ie.Z,{title:"\u8BBE\u7F6E\u7269\u6599\u6570\u91CF",visible:ct,footer:null,onCancel:function(){return ut(!1)},children:(0,e.jsxs)(n.Z,{form:it,name:"basic",labelCol:{span:8},wrapperCol:{span:16},initialValues:{remember:!0},onFinish:function(p){t.onUpdateMaterial(Me,p),ut(!1)},autoComplete:"off",children:[(0,e.jsx)(n.Z.Item,{name:"id",hidden:!0,children:(0,e.jsx)(w.Z,{})}),(0,e.jsx)(n.Z.Item,{label:"\u7269\u6599\u540D\u79F0",name:"name",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u7269\u6599\u540D\u79F0"}],children:(0,e.jsx)(w.Z,{disabled:!0})}),(0,e.jsx)(n.Z.Item,{label:"\u7269\u6599\u6570\u91CF",name:"BomQty",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u7269\u6599\u6570\u91CF"}],children:(0,e.jsx)(w.Z,{})}),(0,e.jsx)(n.Z.Item,{wrapperCol:{offset:8,span:16},children:(0,e.jsx)(O.Z,{type:"primary",htmlType:"submit",children:"\u786E\u5B9A"})})]})})]})},rn=an,$n=d(73935),un=d(20474),sn=function(t){var xe=(0,a.useState)({id:t.storeConfig.id,value:{name:t.storeConfig.name},children:[{id:t.deviceConfig.id,value:{name:t.deviceConfig.deviceName},children:[]}]}),se=(0,u.Z)(xe,2),Y=se[0],me=se[1],V=function(){var ee=JSON.parse(JSON.stringify(Y));t.foodMenuConfig.forEach(function(L,X){ee.children[0].children[X]={id:(0,Xe.x0)(),value:{name:L.name},children:[]},L==null||L.goodsConfig.forEach(function(Z,I){ee.children[0].children[X].children[I]={id:(0,Xe.x0)(),value:{name:Z.name},children:[]},Z==null||Z.bomConfig.forEach(function($,te){ee.children[0].children[X].children[I].children[te]={id:(0,Xe.x0)(),value:{name:$.name},children:[]},$==null||$.materialConfig.forEach(function(Q,re){ee.children[0].children[X].children[I].children[te].children[re]={id:(0,Xe.x0)(),value:{name:Q.name}}})})})}),me(ee)};return(0,a.useEffect)(function(){V()},[]),(0,e.jsx)(e.Fragment,{children:(0,e.jsx)(un.Z,{style:{width:"100%",height:"auto"},data:Y,behaviors:["drag-canvas","zoom-canvas"],nodeCfg:{autoWidth:!0}})})},on=sn,ln=d(54970),dn=d.n(ln),cn=function(t){var xe=function(){var me,V,R;switch(t.current){case 0:(me=t.storeConfig)!==null&&me!==void 0&&me.id?t.next():Re.default.error({message:"\u95E8\u5E97\u914D\u7F6E\u51FA\u9519",description:"\u8BF7\u9009\u62E9\u95E8\u5E97\uFF01",placement:"topRight"});break;case 1:(V=t.deviceConfig)!==null&&V!==void 0&&V.id?t.next():Re.default.error({message:"\u8BBE\u5907\u914D\u7F6E\u51FA\u9519",description:"\u8BF7\u9009\u62E9\u8BBE\u5907\uFF01",placement:"topRight"});break;case 2:((R=t.foodMenuConfig)===null||R===void 0?void 0:R.length)>0?t.next():Re.default.error({message:"\u83DC\u8C31\u914D\u7F6E\u51FA\u9519",description:"\u8BF7\u81F3\u5C11\u9009\u62E9\u4E00\u4E2A\u83DC\u8C31\uFF01",placement:"topRight"});break;case 3:for(var ee=0;ee<t.foodMenuConfig.length;ee++){var L,X=(L=t.foodMenuConfig[ee])===null||L===void 0?void 0:L.goodsConfig;if(!X||(X==null?void 0:X.length)===0){Re.default.error({message:"\u5546\u54C1\u914D\u7F6E\u51FA\u9519",description:"\u8BF7\u4E3A\u83DC\u8C31\u3010".concat(t.foodMenuConfig[ee].name,"\u3011\u6DFB\u52A0\u5546\u54C1\uFF01"),placement:"topRight"});return}}t.next();break;case 4:for(var Z=0;Z<t.foodMenuConfig.length;Z++)for(var I,$=(I=t.foodMenuConfig[Z])===null||I===void 0?void 0:I.goodsConfig,te=0;te<$.length;te++){var Q,re=(Q=$[te])===null||Q===void 0?void 0:Q.bomConfig;if(!re||(re==null?void 0:re.length)===0){Re.default.error({message:"\u914D\u65B9\u914D\u7F6E\u51FA\u9519",description:"\u8BF7\u4E3A\u5546\u54C1\u3010".concat($[te].name,"\u3011\u6DFB\u52A0\u914D\u65B9\uFF01"),placement:"topRight"});return}}t.next();break;case 5:for(var ge=0;ge<t.foodMenuConfig.length;ge++)for(var ce,le=(ce=t.foodMenuConfig[ge])===null||ce===void 0?void 0:ce.goodsConfig,H=0;H<le.length;H++)for(var pe,B=(pe=le[H])===null||pe===void 0?void 0:pe.bomConfig,M=0;M<B.length;M++){var g=B[M].materialConfig;if(!g||(g==null?void 0:g.length)===0){Re.default.error({message:"\u7269\u6599\u914D\u7F6E\u51FA\u9519",description:"\u8BF7\u4E3A\u914D\u65B9\u3010".concat(B[M].name,"\u3011\u6DFB\u52A0\u7269\u6599\uFF01"),placement:"topRight"});return}for(var T=0;T<g.length;T++)if(!g[T].BomQty){Re.default.error({message:"\u7269\u6599\u914D\u7F6E\u51FA\u9519",description:"\u8BF7\u4E3A\u7269\u6599\u3010".concat(g[T].name,"\u3011\u8BBE\u7F6E\u6570\u91CF\uFF01"),placement:"topRight"});return}}t.next();break}},se=function(){var Y=(0,K.Z)((0,c.Z)().mark(function me(){var V,R;return(0,c.Z)().wrap(function(L){for(;;)switch(L.prev=L.next){case 0:return V={storeId:t.storeConfig.id,deviceId:t.deviceConfig.id,foodMenuList:[]},t.foodMenuConfig.forEach(function(X,Z){V.foodMenuList[Z]={id:X.id,goodsList:[]},X==null||X.goodsConfig.forEach(function(I,$){V.foodMenuList[Z].goodsList[$]={id:I.id,price:I.price,vipPrice:I.vipPrice,isdevice:!0,BOMList:[]},I==null||I.bomConfig.forEach(function(te,Q){V.foodMenuList[Z].goodsList[$].BOMList[Q]={id:te.id,BatchingList:[]},te==null||te.materialConfig.forEach(function(re,ge){V.foodMenuList[Z].goodsList[$].BOMList[Q].BatchingList[ge]={id:re.id,BomQty:re.BomQty}})})})}),L.next=4,j.QuickStartAdd(V);case 4:R=L.sent,R.data.isSuccess?(Re.default.success({message:"\u5FEB\u901F\u5F00\u59CB",description:"\u914D\u7F6E\u6210\u529F\uFF01",placement:"topRight"}),t.success()):Re.default.error({message:"\u5FEB\u901F\u5F00\u59CB",description:"\u914D\u7F6E\u5931\u8D25\uFF01\u8BF7\u91CD\u8BD5\uFF01",placement:"topRight"});case 6:case"end":return L.stop()}},me)}));return function(){return Y.apply(this,arguments)}}();return(0,e.jsxs)("div",{className:dn().steps_btns,children:[t.current>0&&(0,e.jsxs)(O.Z,{style:{margin:"0 8px"},onClick:t.prev,children:["\u4E0A\u4E00\u6B65\uFF1A",t.steps[t.current-1]]}),t.current<t.steps.length-1&&(0,e.jsxs)(O.Z,{type:"primary",htmlType:"submit",onClick:xe,children:["\u4E0B\u4E00\u6B65\uFF1A",t.steps[t.current+1]]}),t.current===t.steps.length-1&&(0,e.jsx)(O.Z,{type:"primary",onClick:se,children:"\u521B\u5EFA\u914D\u7F6E"})]})},fn=cn,hn=Ct.Z.Step,mn=function(){var t=(0,a.useState)(!1),xe=(0,u.Z)(t,2),se=xe[0],Y=xe[1],me=(0,a.useState)(0),V=(0,u.Z)(me,2),R=V[0],ee=V[1],L=(0,a.useState)({storeConfig:{},deviceConfig:{},foodMenuConfig:[]}),X=(0,u.Z)(L,2),Z=X[0],I=X[1],$=function(M,g){var T=JSON.parse(JSON.stringify(Z));switch(M){case"storeConfig":T.storeConfig=g;break;case"deviceConfig":T.deviceConfig=g;break;case"foodMenuConfig":T.foodMenuConfig=g;break}I(T)},te=function(M,g){var T=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,q=JSON.parse(JSON.stringify(Z)),fe=q.foodMenuConfig.find(function(J){return J.id===M});if(T&&fe)fe.goodsConfig=g;else{var ue=fe.goodsConfig.findIndex(function(J){return J.id===g.id});ue>-1&&fe.goodsConfig.splice(ue,1)}I(q)},Q=function(M,g){var T=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,q=JSON.parse(JSON.stringify(Z));q.foodMenuConfig.forEach(function(fe){var ue=fe.goodsConfig.find(function(A){return A.id===M});if(ue){if(T)ue.bomConfig=g;else{var J=ue.bomConfig.findIndex(function(A){return A.id===g.id});J>-1&&ue.bomConfig.splice(J,1)}I(q)}})},re=function(M,g){var T=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,q=JSON.parse(JSON.stringify(Z));q.foodMenuConfig.forEach(function(fe){fe.goodsConfig.forEach(function(ue){var J=ue.bomConfig.find(function(z){return z.id===M});if(J){if(T)J.materialConfig=g;else{var A=J.materialConfig.findIndex(function(z){return z.id===g.id});A>-1&&J.materialConfig.splice(A,1)}I(q)}})})},ge=function(M,g){var T=JSON.parse(JSON.stringify(Z));T.foodMenuConfig.forEach(function(q){q.goodsConfig.forEach(function(fe){var ue=fe.bomConfig.find(function(A){return A.id===M});if(ue){var J=ue.materialConfig.find(function(A){return A.id===g.id});J&&(J.BomQty=Number.parseFloat(g.BomQty)||0,I(T))}})})},ce=function(){ee(R+1)},le=function(){ee(R-1)},H=["\u95E8\u5E97\u914D\u7F6E","\u8BBE\u5907\u914D\u7F6E","\u83DC\u8C31\u914D\u7F6E","\u5546\u54C1\u914D\u7F6E","\u914D\u65B9\u914D\u7F6E","\u7269\u6599\u914D\u7F6E","\u786E\u8BA4\u914D\u7F6E"],pe=[(0,e.jsx)(Rt,{storeConfig:Z.storeConfig,current:R,steps:H,next:ce,onSelectedChange:$}),(0,e.jsx)(_t,{storeConfig:Z.storeConfig,deviceConfig:Z.deviceConfig,current:R,steps:H,prev:le,next:ce,onSelectedChange:$}),(0,e.jsx)($t,{foodMenuConfig:Z.foodMenuConfig,current:R,steps:H,prev:le,next:ce,onSelectedChange:$}),(0,e.jsx)(Jt,{deviceConfig:Z.deviceConfig,foodMenuConfig:Z.foodMenuConfig,current:R,steps:H,onAddGoodsToFoodMenu:te,prev:le,next:ce}),(0,e.jsx)(Xt,{foodMenuConfig:Z.foodMenuConfig,current:R,steps:H,prev:le,next:ce,onBomRelationGoods:Q}),(0,e.jsx)(rn,{foodMenuConfig:Z.foodMenuConfig,current:R,steps:H,onMaterialRelationBom:re,onUpdateMaterial:ge,prev:le,next:ce}),(0,e.jsx)(on,(0,Ae.Z)((0,Ae.Z)({},Z),{},{current:R,steps:H,prev:le}))];return(0,a.useEffect)(function(){console.log("\u5BF9\u8C61\u66F4\u65B0",Z)},[Z]),(0,e.jsxs)(Mt.ZP,{children:[(0,e.jsx)("div",{className:_().steps_navbar,children:(0,e.jsx)(ot.Z,{children:(0,e.jsx)(Ct.Z,{current:R,children:H.map(function(B){return(0,e.jsx)(hn,{title:B},B)})})})}),se?(0,e.jsx)(ot.Z,{children:(0,e.jsx)(Dt.ZP,{status:"success",title:"\u6210\u529F\u914D\u7F6E\u6240\u6709\u4FE1\u606F\uFF01",subTitle:"\u6B22\u8FCE\u518D\u6B21\u4F7F\u7528\uFF01",extra:[(0,e.jsx)(O.Z,{type:"primary",onClick:function(){I({storeConfig:{},deviceConfig:{},foodMenuConfig:[]}),ee(0),Y(!1)},children:"\u5FEB\u901F\u5F00\u59CB"},"console")]})}):(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(ot.Z,{children:(0,e.jsx)("div",{className:_().steps_content,children:pe[R]})}),(0,e.jsx)("div",{className:_().steps_navbar_bottom,children:(0,e.jsx)(ot.Z,{children:(0,e.jsx)(fn,(0,Ae.Z)((0,Ae.Z)({},Z),{},{current:R,steps:H,prev:le,next:ce,success:function(){return Y(!0)}}))})})]})]})},pn=mn}}]);