(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[4733,1322],{22719:function(Ue,oe,i){"use strict";i.r(oe),i.d(oe,{default:function(){return We}});var Le=i(57663),_=i(71577),Me=i(71194),ee=i(50146),Ne=i(62350),de=i(24565),Y=i(11849),he=i(93224),Pe=i(22385),me=i(45777),Je=i(34792),s=i(48086),n=i(39428),h=i(3182),G=i(2824),b=i(67294),ve=i(30381),q=i.n(ve),ye=i(16894),Ze=i(78009),ge=i(85224),ze=i(14965),ce=i(91774),He=i(77883),J=i(85986),Ke=i(9715),c=i(55843),Qe=i(47673),z=i(4107),Xe=i(43358),m=i(34041),k=i(48971);function Fe(d){return te.apply(this,arguments)}function te(){return te=(0,h.Z)((0,n.Z)().mark(function d(l){return(0,n.Z)().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.abrupt("return",(0,k.WY)("/kitchen/api/coupon/couponpgage",{method:"POST",data:l}));case 1:case"end":return a.stop()}},d)})),te.apply(this,arguments)}function xe(d){return re.apply(this,arguments)}function re(){return re=(0,h.Z)((0,n.Z)().mark(function d(l){return(0,n.Z)().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.abrupt("return",(0,k.WY)("/kitchen/api/coupon/addCoupon",{method:"POST",data:l}));case 1:case"end":return a.stop()}},d)})),re.apply(this,arguments)}function Ce(d){return ne.apply(this,arguments)}function ne(){return ne=(0,h.Z)((0,n.Z)().mark(function d(l){return(0,n.Z)().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.abrupt("return",(0,k.WY)("/kitchen/api/coupon/deleteCoupon",{method:"POST",data:l}));case 1:case"end":return a.stop()}},d)})),ne.apply(this,arguments)}function je(d){return ae.apply(this,arguments)}function ae(){return ae=(0,h.Z)((0,n.Z)().mark(function d(l){return(0,n.Z)().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.abrupt("return",(0,k.WY)("/kitchen/api/coupon/updateCoupon",{method:"POST",data:l}));case 1:case"end":return a.stop()}},d)})),ae.apply(this,arguments)}function Se(d){return ue.apply(this,arguments)}function ue(){return ue=(0,h.Z)((0,n.Z)().mark(function d(l){return(0,n.Z)().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.abrupt("return",(0,k.WY)("/kitchen/api/coupon/abolish-coupon/".concat(l),{method:"POST"}));case 1:case"end":return a.stop()}},d)})),ue.apply(this,arguments)}function pe(d){return le.apply(this,arguments)}function le(){return le=(0,h.Z)((0,n.Z)().mark(function d(l){return(0,n.Z)().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.abrupt("return",(0,k.WY)("/kitchen/api/coupon/getCouponStatusOrType",{method:"POST",data:l}));case 1:case"end":return a.stop()}},d)})),le.apply(this,arguments)}function Te(d){return ie.apply(this,arguments)}function ie(){return ie=(0,h.Z)((0,n.Z)().mark(function d(l){return(0,n.Z)().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.abrupt("return",(0,k.WY)("/kitchen/api/coupon/couponsendrecord",{method:"put",data:l}));case 1:case"end":return a.stop()}},d)})),ie.apply(this,arguments)}function we(d){return se.apply(this,arguments)}function se(){return se=(0,h.Z)((0,n.Z)().mark(function d(l){return(0,n.Z)().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.abrupt("return",(0,k.WY)("/kitchen/api/coupon/coupon-status",{method:"put",data:l}));case 1:case"end":return a.stop()}},d)})),se.apply(this,arguments)}var e=i(85893),Ee=function(l){var j=m.Z.Option,a=m.Z.OptGroup,O=(0,b.useState)(),K=(0,G.Z)(O,2),M=K[0],N=K[1],Q=function(){var A=(0,h.Z)((0,n.Z)().mark(function S(){return(0,n.Z)().wrap(function(R){for(;;)switch(R.prev=R.next){case 0:case"end":return R.stop()}},S)}));return function(){return A.apply(this,arguments)}}();(0,b.useEffect)(function(){var A=function(){var S=(0,h.Z)((0,n.Z)().mark(function B(R){var V,$;return(0,n.Z)().wrap(function(E){for(;;)switch(E.prev=E.next){case 0:return E.next=2,pe(2);case 2:V=E.sent,$=V.data.map(function(I){return(0,e.jsx)(m.Z.Option,{value:I.key,children:I.value},I.key)}),N($);case 5:case"end":return E.stop()}},B)}));return function(R){return S.apply(this,arguments)}}();A()},[]);var W={labelCol:{sm:{span:4}},wrapperCol:{}},U={wrapperCol:{sm:{span:500,offset:1}}},P=function(S){};return(0,e.jsx)(ee.Z,{maskClosable:!1,title:l.values.id?"\u7F16\u8F91\u4F18\u60E0\u5377":"\u65B0\u5EFA\u4F18\u60E0\u5377",width:700,visible:l.createModalVisible,footer:null,onCancel:function(){l.onCancel()},destroyOnClose:!0,children:(0,e.jsxs)(c.Z,(0,Y.Z)((0,Y.Z)({},W),{},{layout:"Horizontal",preserve:!1,initialValues:l.values,onFinish:l.onFinish,children:[(0,e.jsx)(c.Z.Item,{name:"id",hidden:!0,children:(0,e.jsx)(z.Z,{})}),(0,e.jsx)(c.Z.Item,{name:"couponTitle",label:"\u4F18\u60E0\u5377\u6807\u9898",rules:[{required:!0,max:200}],children:(0,e.jsx)(z.Z,{placeholder:"\u8BF7\u8F93\u5165\u4F18\u60E0\u5377\u6807\u9898"})}),(0,e.jsx)(c.Z.Item,{name:"couponType",label:"\u4F18\u60E0\u5377\u7C7B\u578B",defaultValue:l.values.couponType,rules:[{required:!0}],children:(0,e.jsx)(m.Z,{placeholder:"\u8BF7\u9009\u62E9\u4F18\u60E0\u5377\u7C7B\u578B",children:(0,e.jsx)(a,{children:M})})}),(0,e.jsxs)(c.Z.Item,(0,Y.Z)((0,Y.Z)({},U),{},{style:{height:32},children:[(0,e.jsx)(c.Z.Item,{label:"\u4F18\u60E0\u91D1\u989D",style:{float:"left"},rules:[{required:!0}],children:(0,e.jsx)(c.Z.Item,{name:"couponValue",noStyle:!0,children:(0,e.jsx)(J.Z,{placeholder:"\u91D1\u989D",min:0,precision:2})})}),(0,e.jsx)(c.Z.Item,{label:"\u4F7F\u7528\u6761\u4EF6",style:{float:"left",marginLeft:10},rules:[{required:!0}],children:(0,e.jsx)(c.Z.Item,{name:"condition",noStyle:!0,children:(0,e.jsx)(J.Z,{placeholder:"\u4F7F\u7528\u6761\u4EF6",min:0,precision:2})})}),(0,e.jsxs)(c.Z.Item,{label:"\u6BCF\u4EBA\u53EF\u9886\u6570\u91CF",style:{float:"left",marginLeft:10},rules:[{required:!0}],children:[(0,e.jsx)(c.Z.Item,{name:"getLimit",noStyle:!0,children:(0,e.jsx)(J.Z,{placeholder:"\u53EF\u9886\u6570\u91CF",min:0,precision:0})}),(0,e.jsx)("span",{style:{color:"#FFCC52"},children:" 0 \u4E3A\u4E0D\u9650\u5236"})]})]})),(0,e.jsx)(c.Z.Item,{name:"timeType",label:"\u65F6\u95F4\u7C7B\u578B",rules:[{required:!0}],children:(0,e.jsx)(m.Z,{onChange:P,children:(0,e.jsxs)(a,{children:[(0,e.jsx)(m.Z.Option,{value:1,children:"\u65F6\u95F4\u6BB5"}),(0,e.jsx)(m.Z.Option,{value:2,children:"\u56FA\u5B9A\u671F\u9650"})]})})}),(0,e.jsx)(c.Z.Item,{noStyle:!0,shouldUpdate:function(S,B){return S.timeType!==B.timeType},children:function(S){var B=S.getFieldValue;return B("timeType")=="2"?(0,e.jsx)(c.Z.Item,{label:"\u56FA\u5B9A\u65F6\u95F4",rules:[{required:!0}],children:(0,e.jsx)(c.Z.Item,{name:"validFixedTerm",noStyle:!0,children:(0,e.jsx)(J.Z,{placeholder:"",precision:0,min:0})})}):(0,e.jsxs)(c.Z.Item,(0,Y.Z)((0,Y.Z)({},U),{},{style:{height:32},children:[(0,e.jsx)(c.Z.Item,{name:"validStartTime",label:"\u5F00\u59CB\u65F6\u95F4",style:{float:"left"},rules:[{required:!0}],children:(0,e.jsx)(ce.Z,{placeholder:"\u5F00\u59CB\u65F6\u95F4"})}),(0,e.jsx)(c.Z.Item,{name:"validEndTime",label:"\u7ED3\u675F\u65F6\u95F4",style:{float:"left",marginLeft:20},rules:[{required:!0}],children:(0,e.jsx)(ce.Z,{placeholder:"\u7ED3\u675F\u65F6\u95F4"})})]}))}}),(0,e.jsx)(c.Z.Item,{name:"validStatus",label:"\u72B6\u6001",rules:[{required:!0}],children:(0,e.jsxs)(m.Z,{placeholder:"\u72B6\u6001",children:[(0,e.jsx)(j,{value:1,children:"\u751F\u6548"}),(0,e.jsx)(j,{value:2,children:"\u5931\u6548"}),(0,e.jsx)(j,{value:3,children:"\u4F5C\u5E9F"})]})}),(0,e.jsxs)(c.Z.Item,{noStyle:!0,children:[(0,e.jsx)(c.Z.Item,{name:"remarks",label:"\u5907\u6CE8",rules:[{max:500}],children:(0,e.jsx)(z.Z,{placeholder:"\u5907\u6CE8"})}),(0,e.jsx)("span",{style:{color:"#FFCC52",marginLeft:70},children:"\u6CE8: \u591A\u6761\u89C4\u5219\u8BF7\u7528 \xA0;\xA0 \u9694\u5F00\u3002 \xA0\xA0 \u5982\uFF1A1.xxxxxx\uFF1B 2.xxxxxx"})]}),(0,e.jsx)(c.Z.Item,{children:(0,e.jsx)(_.Z,{type:"primary",htmlType:"submit",style:{float:"right"},children:"\u4FDD\u5B58"})})]}))})},Ie=Ee;function be(d){return(0,k.WY)("/kitchen/api/select/selectedconfig/".concat(d),{method:"get"})}function ke(d){return(0,k.WY)("/kitchen/api/coupon/couponrecordbyid",{method:"post",data:d})}function Be(d){return(0,k.WY)("/kitchen/api/select/goodstype",{method:"get"})}function Ae(d){return(0,k.WY)("/kitchen/api/select/goods/".concat(d),{method:"get"})}function Ge(d){return(0,k.WY)("/kitchen/api/sysOrg/listbytype",{method:"get",data:d})}var H={GetSelectedConfig:be,GetCouponRecordById:ke,GetGoodsType:Be,GetGoodsById:Ae,GetStores:Ge},Oe=function(l){var j=c.Z.useForm(),a=(0,G.Z)(j,1),O=a[0],K=(0,b.useState)(),M=(0,G.Z)(K,2),N=M[0],Q=M[1],W=(0,b.useState)(),U=(0,G.Z)(W,2),P=U[0],A=U[1],S=(0,b.useState)(),B=(0,G.Z)(S,2),R=B[0],V=B[1];(0,b.useEffect)(function(){var E=function(){var T=(0,h.Z)((0,n.Z)().mark(function g(){var y,x;return(0,n.Z)().wrap(function(Z){for(;;)switch(Z.prev=Z.next){case 0:return Z.next=2,H.GetStores();case 2:y=Z.sent,x=[],y.data.forEach(function(C){x.push((0,e.jsx)(m.Z.Option,{value:C.id,children:C.name},C.id))}),Q(x);case 6:case"end":return Z.stop()}},g)}));return function(){return T.apply(this,arguments)}}(),I=function(){var T=(0,h.Z)((0,n.Z)().mark(function g(){var y,x,F;return(0,n.Z)().wrap(function(C){for(;;)switch(C.prev=C.next){case 0:return C.next=2,H.GetGoodsType();case 2:y=C.sent,x=[];for(F in y.data)x.push((0,e.jsx)(m.Z.Option,{value:F.toString(),children:y.data[F.toString()]},F.toString()));A(x);case 6:case"end":return C.stop()}},g)}));return function(){return T.apply(this,arguments)}}(),D=function(){var T=(0,h.Z)((0,n.Z)().mark(function g(y){var x,F,Z;return(0,n.Z)().wrap(function(L){for(;;)switch(L.prev=L.next){case 0:return L.next=2,H.GetGoodsById(-1);case 2:x=L.sent,F=[];for(Z in x.data)F.push((0,e.jsx)(m.Z.Option,{value:Z.toString(),children:x.data[Z.toString()]},Z.toString()));V(F);case 6:case"end":return L.stop()}},g)}));return function(y){return T.apply(this,arguments)}}();I(),D(),E()},[]);var $=function(){var E=(0,h.Z)((0,n.Z)().mark(function I(D){var T,g,y;return(0,n.Z)().wrap(function(F){for(;;)switch(F.prev=F.next){case 0:return F.next=2,H.GetGoodsById(D==null?-1:D);case 2:T=F.sent,g=[];for(y in T.data)g.push((0,e.jsx)(m.Z.Option,{value:y.toString(),children:T.data[y.toString()]},y.toString()));V(g),O.setFieldsValue({goodsRelation:[]});case 7:case"end":return F.stop()}},I)}));return function(D){return E.apply(this,arguments)}}(),v=function(){var E=(0,h.Z)((0,n.Z)().mark(function I(D){var T,g,y,x;return(0,n.Z)().wrap(function(Z){for(;;)switch(Z.prev=Z.next){case 0:return Z.next=2,H.GetSelectedConfig(D);case 2:T=Z.sent.data,g=[];for(y in T)g.push({k:y.toString(),v:T[y.toString()]});x=g.map(function(C){return(0,e.jsx)(m.Z.Option,{value:C.k,children:C.v},C.k)}),Q(x),O.setFieldsValue({Relation:[]});case 8:case"end":return Z.stop()}},I)}));return function(D){return E.apply(this,arguments)}}();return(0,e.jsx)(ee.Z,{footer:null,title:"\u65B0\u589E\u8BB0\u5F55",width:660,visible:l.createModalVisible,onCancel:function(){l.onCancel()},destroyOnClose:!0,children:(0,e.jsxs)(c.Z,{labelCol:{sm:{span:4}},form:O,layout:"Horizontal",preserve:!1,initialValues:l.values,onFinish:l.onFinish,children:[(0,e.jsx)(c.Z.Item,{name:"Coupon_Id",hidden:!0,children:(0,e.jsx)(z.Z,{})}),(0,e.jsx)(c.Z.Item,{name:"SendNum",label:"\u53D1\u653E\u6570\u91CF",rules:[{required:!0}],children:(0,e.jsx)(J.Z,{placeholder:"\u53D1\u653E\u6570\u91CF",min:0,style:{width:"510px"}})}),(0,e.jsx)(c.Z.Item,{name:"RangeType",label:"\u9002\u7528\u8303\u56F4\u7C7B\u578B",hidden:!0,defaultValue:1,children:(0,e.jsxs)(m.Z,{placeholder:"\u53D1\u653E\u8303\u56F4",onSelect:v,defaultValue:1,children:[(0,e.jsx)(m.Z.Option,{value:"1",children:"\u5E97\u94FA"}),(0,e.jsx)(m.Z.Option,{value:"3",children:"\u533A\u57DF"})]})}),(0,e.jsx)(c.Z.Item,{name:"Relation",label:"\u9002\u7528\u8303\u56F4",rules:[{required:!0}],defaultValue:"1",children:(0,e.jsx)(m.Z,{placeholder:"\u9002\u7528\u8303\u56F4",filterOption:!1,mode:"multiple",children:N})}),(0,e.jsx)(c.Z.Item,{name:"applyGoodType",label:"\u9002\u7528\u5546\u54C1\u7C7B\u578B",children:(0,e.jsx)(m.Z,{placeholder:"\u9002\u7528\u5546\u54C1\u7C7B\u578B",onClear:$,allowClear:!0,onSelect:$,children:P})}),(0,e.jsx)(c.Z.Item,{name:"goodsRelation",label:"\u9002\u7528\u5546\u54C1\u8303\u56F4",children:(0,e.jsx)(m.Z,{placeholder:"\u9002\u7528\u5546\u54C1\u8303\u56F4",filterOption:!1,mode:"multiple",children:R})}),(0,e.jsx)(c.Z.Item,{name:"Status",label:"\u72B6\u6001",rules:[{required:!0}],defaultValue:"1",children:(0,e.jsxs)(m.Z,{placeholder:"\u8BF7\u9009\u62E9\u72B6\u6001",children:[(0,e.jsx)(m.Z.Option,{value:"1",children:"\u542F\u7528"}),(0,e.jsx)(m.Z.Option,{value:"0",children:"\u7981\u7528"})]})}),(0,e.jsx)(c.Z.Item,{name:"Remark",label:"\u5907\u6CE8",children:(0,e.jsx)(z.Z,{placeholder:"\u5907\u6CE8"})}),(0,e.jsx)(c.Z.Item,{children:(0,e.jsx)(_.Z,{type:"primary",htmlType:"submit",style:{marginLeft:"520px"},children:"\u4FDD\u5B58"})})]})})},Re=Oe,$e=i(79361),De=i.n($e),Ve=["defaultRender"],Ye=function(){var l=(0,b.useRef)(),j=(0,b.useState)([]),a=(0,G.Z)(j,2),O=a[0],K=a[1],M=(0,b.useState)(!1),N=(0,G.Z)(M,2),Q=N[0],W=N[1],U=(0,b.useState)(!1),P=(0,G.Z)(U,2),A=P[0],S=P[1],B=(0,b.useState)(),R=(0,G.Z)(B,2),V=R[0],$=R[1],v="coupon",E=(0,b.useState)({}),I=(0,G.Z)(E,2),D=I[0],T=I[1];(0,b.useEffect)(function(){var f=function(){var o=(0,h.Z)((0,n.Z)().mark(function r(p){return(0,n.Z)().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return u.next=2,pe(2).then(function(w){var X={};w.succeeded&&w.data.forEach(function(fe){X[fe.key]={text:fe.value}}),T(X)});case 2:case"end":return u.stop()}},r)}));return function(p){return o.apply(this,arguments)}}();f()},[]);var g=function(){var f=(0,h.Z)((0,n.Z)().mark(function o(r){return(0,n.Z)().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(s.default.loading("\u6B63\u5728\u6DFB\u52A0...",v),t.prev=1,!(r.validEndTime=2&&(r.validStartTime=r.dateRange[0],r.validEndTime=r.dateRange[1]),w.next=5,Fe(r).then(function(X){p=X.data.data,t=X.data.total});case 5:return w.abrupt("return",{data:p,success:!0,total:t});case 6:case"end":return w.stop()}},o)}));return function(o){return f.apply(this,arguments)}}()}),(O==null?void 0:O.length)>0&&(0,e.jsx)(ge.Z,{extra:(0,e.jsxs)("div",{children:[" ","\u5DF2\u9009\u62E9 ",(0,e.jsxs)("a",{style:{fontWeight:600},children:[O.length," "]})," \u9879 \xA0\xA0"," "]})}),(0,e.jsx)(Ie,{onFinish:function(){var f=(0,h.Z)((0,n.Z)().mark(function o(r){var p;return(0,n.Z)().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:if(p=!1,!r.id){u.next=7;break}return u.next=4,x(r);case 4:p=u.sent,u.next=10;break;case 7:return u.next=9,g(r);case 9:p=u.sent;case 10:p&&(W(!1),l.current&&l.current.reload());case 11:case"end":return u.stop()}},o)}));return function(o){return f.apply(this,arguments)}}(),onCancel:function(){$(void 0),W(!1)},createModalVisible:Q,values:V||{}}),(0,e.jsx)(Re,{onFinish:function(){var f=(0,h.Z)((0,n.Z)().mark(function o(r){var p;return(0,n.Z)().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return r.Coupon_Id=V.id,u.next=3,Z(r);case 3:p=u.sent,p&&(S(!1),l.current&&l.current.reload());case 5:case"end":return u.stop()}},o)}));return function(o){return f.apply(this,arguments)}}(),onCancel:function(){$(void 0),S(!1)},createModalVisible:A,values:V||{}})]})},We=Ye}}]);