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.

p__crm__coupon__couponInfo.2fcd52c4.async.js 24 KiB

1 jaar geleden
1
  1. (self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[4733,7975,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<r.validStartTime)){t.next=5;break}return s.default.error("\u5F00\u59CB\u65F6\u95F4\u4E0D\u80FD\u5927\u4E8E\u7ED3\u675F\u65F6\u95F4"),t.abrupt("return",!1);case 5:return t.next=7,xe(JSON.stringify(r)).then(function(u){s.default.destroy(v),u.data?s.default.success("\u6DFB\u52A0\u6210\u529F"):s.default.error("\u6DFB\u52A0\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01")});case 7:return l.current.reload(),t.abrupt("return",!0);case 11:return t.prev=11,t.t0=t.catch(1),s.default.destroy(v),s.default.error("\u6DFB\u52A0\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01"),t.abrupt("return",!1);case 16:case"end":return t.stop()}},o,null,[[1,11]])}));return function(r){return f.apply(this,arguments)}}(),y=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 s.default.loading("\u6B63\u5728\u5220\u9664...",v),u.prev=1,p=[],r.forEach(function(w){p.push(w.id)}),u.next=6,Ce(JSON.stringify(p)).then(function(w){s.default.destroy(v),w.data?(s.default.destroy(v),s.default.success("\u5220\u9664\u6210\u529F")):s.default.error("\u5220\u9664\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01")});case 6:return l.current.reload(),u.abrupt("return",!0);case 10:return u.prev=10,u.t0=u.catch(1),s.default.destroy(v),s.default.error("\u5220\u9664\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01"),u.abrupt("return",!1);case 15:case"end":return u.stop()}},o,null,[[1,10]])}));return function(r){return f.apply(this,arguments)}}(),x=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\u4FEE\u6539...",v),t.prev=1,!(r.validEndTime<r.validStartTime)){t.next=5;break}return s.default.error("\u5F00\u59CB\u65F6\u95F4\u4E0D\u80FD\u5927\u4E8E\u7ED3\u675F\u65F6\u95F4"),t.abrupt("return",!1);case 5:return t.next=7,je(JSON.stringify(r)).then(function(u){s.default.destroy(v),u.data?s.default.success("\u4FEE\u6539\u6210\u529F"):s.default.error(JSON.sstringify(u.errors))});case 7:return l.current.reload(),t.abrupt("return",!0);case 11:return t.prev=11,t.t0=t.catch(1),s.default.destroy(v),s.default.error("\u4FEE\u6539\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01"),t.abrupt("return",!1);case 16:case"end":return t.stop()}},o,null,[[1,11]])}));return function(r){return f.apply(this,arguments)}}(),F=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:return s.default.loading("\u6B63\u5728\u4F5C\u5E9F...",v),t.prev=1,t.next=4,Se(r.id).then(function(u){s.default.destroy(v),u.data?s.default.success("\u4F5C\u5E9F\u6210\u529F"):s.default.error("\u4F5C\u5E9F\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01")});case 4:return l.current.reload(),t.abrupt("return",!0);case 8:return t.prev=8,t.t0=t.catch(1),s.default.destroy(v),s.default.error("\u4F5C\u5E9F\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01"),t.abrupt("return",!1);case 13:case"end":return t.stop()}},o,null,[[1,8]])}));return function(r){return f.apply(this,arguments)}}(),Z=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:return s.default.loading("\u6B63\u5728\u6DFB\u52A0...",v),t.prev=1,r.RangeType=1,t.next=5,Te(JSON.stringify(r)).then(function(u){u.data&&(s.default.destroy(v),s.default.success("\u6DFB\u52A0\u6210\u529F"))});case 5:return t.abrupt("return",!0);case 8:return t.prev=8,t.t0=t.catch(1),s.default.destroy(v),s.default.error("\u6DFB\u52A0\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01"),t.abrupt("return",!1);case 13:case"end":return t.stop()}},o,null,[[1,8]])}));return function(r){return f.apply(this,arguments)}}(),C=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\u4FEE\u6539...",v),t.prev=1,r.validStatus!=1){t.next=6;break}r.validStatus=4,t.next=11;break;case 6:if(r.validStatus!=4){t.next=10;break}r.validStatus=1,t.next=11;break;case 10:return t.abrupt("return",!1);case 11:return t.next=13,we(JSON.stringify(r)).then(function(u){u.data&&(s.default.destroy(v),s.default.success("\u4FEE\u6539\u6210\u529F"))});case 13:return t.abrupt("return",!0);case 16:return t.prev=16,t.t0=t.catch(1),s.default.destroy(v),s.default.error("\u4FEE\u6539\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01"),t.abrupt("return",!1);case 21:case"end":return t.stop()}},o,null,[[1,16]])}));return function(r){return f.apply(this,arguments)}}(),L=[{title:"\u4E3B\u952E",dataIndex:"id",tip:"\u89C4\u5219\u540D\u79F0\u662F\u552F\u4E00\u7684 key",hideInSearch:!0,hideInTable:!0},{title:"\u6807\u9898",dataIndex:"couponTitle",valueType:"textarea"},{title:"\u4F18\u60E0\u5377\u7C7B\u578B",width:90,dataIndex:"couponType",key:"couponType",valueEnum:D},{title:"\u4F18\u60E0\u91D1\u989D",dataIndex:"couponValue",width:80,valueType:"money"},{title:"\u6EE1\u51CF\u91D1\u989D",dataIndex:"condition",width:80,valueType:"money"},{title:"\u6BCF\u4EBA\u53EF\u9886\u6570\u91CF",dataIndex:"getLimit",width:70,render:function(o,r,p){return(0,e.jsx)("span",{children:r.getLimit!=0?r.getLimit:"\u65E0\u9650\u5236"})}},{title:"\u53D1\u9001\u603B\u91CF",width:80,dataIndex:"sendNum",valueType:"textarea",search:!1},{title:"\u9886\u53D6\u6570\u91CF",width:80,dataIndex:"getNum",valueType:"digit",search:!1},{title:"\u5269\u4F59\u6570\u91CF",width:80,dataIndex:"getNum",search:!1,render:function(o,r,p){return(0,e.jsx)("span",{children:(0,e.jsx)("a",{children:r.sendNum-r.getNum})})}},{title:"\u65F6\u95F4\u7C7B\u578B",width:80,dataIndex:"timeType",valueEnum:{1:{text:"\u65F6\u95F4\u6BB5"},2:{text:"\u56FA\u5B9A\u65F6\u95F4"}}},{title:"\u6709\u6548\u65F6\u95F4",key:"dateRange",width:160,valueType:"dateRange",render:function(o,r,p){return r.timeType==1?(0,e.jsxs)("span",{children:[(0,e.jsx)("div",{children:q()(r.validStartTime).format("YYYY-MM-DD")}),(0,e.jsx)("div",{children:q()(r.validEndTime).format("YYYY-MM-DD")})]}):(0,e.jsxs)("span",{children:["\u81EA\u9886\u53D6\u540E ",(0,e.jsxs)("a",{children:[r.validFixedTerm,"\u5929"]})," \u5185\u6709\u6548"]})}},{title:"\u56FA\u5B9A\u65F6\u95F4",width:80,dataIndex:"validFixedTerm",valueType:"digit",hideInTable:!0},{title:"\u72B6\u6001",width:70,key:"validStatus",dataIndex:"validStatus",valueEnum:{1:{text:"\u751F\u6548",status:"Processing"},2:{text:"\u5931\u6548",status:"Success"},3:{text:"\u4F5C\u5E9F",status:"Error"},4:{text:"\u505C\u7528",status:"Error"}}},{title:"\u5907\u6CE8",search:!1,dataIndex:"remarks",render:function(o,r,p){var t;return console.log("\u6211\u662Fremarks",r.remarks),(0,e.jsx)(me.Z,{placement:"top",title:r.remarks,children:(0,e.jsx)("span",{children:(t=r.remarks)===null||t===void 0?void 0:t.substring(0,10)})})}},{title:"\u521B\u5EFA\u65F6\u95F4",width:90,dataIndex:"createAt",valueType:"date",renderFormItem:function(o,r,p){var t=r.defaultRender,u=(0,he.Z)(r,Ve),w=p.getFieldValue("state");return"".concat(w)==="0"?!1:"".concat(w)==="3"?(0,e.jsx)(Input,(0,Y.Z)((0,Y.Z)({},u),{},{placeholder:"\u8BF7\u8F93\u5165\u5F02\u5E38\u539F\u56E0\uFF01"})):t(o)}},{title:"\u64CD\u4F5C",dataIndex:"option",width:250,valueType:"option",render:function(o,r){var p=[(0,e.jsx)("a",{type:"primary",disabled:!r.isAllowUpdate,style:{pointerEvents:r.isAllowUpdate==!1?"none":"auto"},onClick:function(){!r.isAllowUpdate||(W(!0),$(function(){return r.validStartTime=q()(r.validStartTime),r.validEndTime=q()(r.validEndTime),r}))},children:"\u66F4\u65B0"},"primary"),(0,e.jsx)(de.Z,{type:"primary",title:"\u786E\u8BA4\u4F5C\u5E9F\u5417\uFF1F",okText:"\u662F",cancelText:"\u5426",onConfirm:function(){F(r),l.current.reload()},onCancel:function(){},children:(0,e.jsx)("a",{href:"#",disabled:r.validStatus==3,style:{pointerEvents:r.validStatus==3?"none":"auto"},children:"\u4F5C\u5E9F"})},"primary"),(0,e.jsxs)("a",{onClick:function(){var u={title:"\u4E8C\u7EF4\u7801",content:(0,e.jsx)(De(),{id:"qrCode",value:"https://black-pa.com:5443/lead?couponId=".concat(r.id),size:200,fgColor:"#000000",style:{margin:"auto"}})};ee.Z.info(u)},children:[" ","\u4E8C\u7EF4\u7801"]},"primary")];return r.isAllowUpdate==1?p.push((0,e.jsx)(de.Z,{type:"primary",title:"\u786E\u8BA4\u5220\u9664\u5417\uFF1F",okText:"\u662F",cancelText:"\u5426",onConfirm:function(){y([r])},onCancel:function(){},children:(0,e.jsx)("a",{href:"#",children:"\u5220\u9664"})},"primary")):p.push((0,e.jsx)("a",{disabled:r.validStatus==3,style:{pointerEvents:r.validStatus==3?"none":"auto"},type:"primary",onClick:function(){C(r),l.current.reload()},children:r.validStatus==1?"\u505C\u7528":"\u542F\u7528"},"primary")),r.validStatus==1&&p.push((0,e.jsx)("a",{type:"primary",onClick:function(){S(!0),$(r)},children:"\u53D1\u653E"},"primary")),p}}];return(0,e.jsxs)(Ze.ZP,{children:[(0,e.jsx)(ye.ZP,{headerTitle:"\u4F18\u60E0\u5377",actionRef:l,rowKey:"id",search:{labelWidth:120},pagination:{pageSize:10},toolBarRender:function(){return[(0,e.jsx)(_.Z,{type:"primary",onClick:function(){W(!0)},children:"\u65B0\u5EFA"},"primary")]},columns:L,request:function(){var f=(0,h.Z)((0,n.Z)().mark(function o(r){var p,t;return(0,n.Z)().wrap(function(w){for(;;)switch(w.prev=w.next){case 0:return p=[],t=0,r.dateRange!=null&&r.dateRange.length>=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}}]);