25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

2 lines
11 KiB

  1. (self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[3580,1322],{91208:function(de,Y,a){"use strict";a.r(Y),a.d(Y,{default:function(){return oe}});var fe=a(57663),O=a(71577),he=a(62350),G=a(24565),ve=a(77576),V=a(12028),c=a(39428),me=a(34792),l=a(48086),g=a(3182),pe=a(9715),f=a(55843),j=a(2824),I=a(67294),k=a(78009),z=a(16894),ye=a(30381),ge=a(71194),H=a(50146),Ze=a(49111),K=a(19650),Ce=a(77883),b=a(85986),Fe=a(62999),Q=a(54680),je=a(47673),J=a(4107),Z=a(11849),Ie=a(43358),N=a(34041),C=a(48971);function X(o){return(0,C.WY)("/kitchen/api/rechargeactivity/getRechargeActivityPgage",{method:"post",data:o})}function q(o){return(0,C.WY)("/kitchen/api/rechargeactivity/addRechargeActivity",{method:"post",data:o})}function _(o){return(0,C.WY)("/kitchen/api/rechargeactivity/updateRechargeActivity",{method:"post",data:o})}function ee(o){return(0,C.WY)("/kitchen/api/rechargeactivity/updateRechargeactivityrecommend",{method:"post",data:o})}function re(o){return(0,C.WY)("/kitchen/api/rechargeactivity/deleteRechargeActivity",{method:"post",data:o})}function te(o){return D.apply(this,arguments)}function D(){return D=(0,g.Z)((0,c.Z)().mark(function o(d){return(0,c.Z)().wrap(function(h){for(;;)switch(h.prev=h.next){case 0:return h.abrupt("return",(0,C.WY)("\u200B/kitchen/api\u200B/sysOrg\u200B/tree",{data:(0,Z.Z)({},d)}));case 1:case"end":return h.stop()}},o)})),D.apply(this,arguments)}function ne(o){return M.apply(this,arguments)}function M(){return M=(0,g.Z)((0,c.Z)().mark(function o(d){return(0,c.Z)().wrap(function(h){for(;;)switch(h.prev=h.next){case 0:return h.abrupt("return",(0,C.WY)("/kitchen/api/coupon/couponpgage",{method:"POST",data:d}));case 1:case"end":return h.stop()}},o)})),M.apply(this,arguments)}var ae=a(59465),ue=a(49101),t=a(85893),ie=N.Z.Option,se=function(d){var R=(0,I.useState)([]),h=(0,j.Z)(R,2),y=h[0],T=h[1],A=(0,I.useState)([]),x=(0,j.Z)(A,2),S=x[0],L=x[1],E=f.Z.useForm(),$=(0,j.Z)(E,1),F=$[0],B=function(){var v=(0,g.Z)((0,c.Z)().mark(function u(){var n;return(0,c.Z)().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return s.next=2,ne({current:1,pageSize:999});case 2:n=s.sent,n.statusCode===200&&n.data&&L(n.data.data);case 4:case"end":return s.stop()}},u)}));return function(){return v.apply(this,arguments)}}(),W=function(u){d.onFinish(u)},w=function(){var u;if((u=d.values)!==null&&u!==void 0&&u.couponInfo){var n=JSON.parse(d.values.couponInfo);n.forEach(function(r){r.couponId=r.CouponId,r.quantity=r.Quantity}),F.setFieldsValue((0,Z.Z)((0,Z.Z)({},d.values),{},{couponInfos:n}))}};function P(){te().then(function(v){u(v.data);function u(n){for(var r in n)n[r].type==2||n[r].type==3?n[r].disabled=!1:n[r].disabled=!0,n[r].children&&u(n[r].children)}T(v.data)})}return(0,I.useEffect)(function(){P(),B(),w()},[]),(0,t.jsx)(t.Fragment,{children:(0,t.jsx)(H.Z,{title:d.values.id?"\u7F16\u8F91\u5145\u503C\u6D3B\u52A8":"\u65B0\u5EFA\u5145\u503C\u6D3B\u52A8",width:500,visible:d.createModalVisible,footer:null,onCancel:function(){d.onCancel()},destroyOnClose:!0,children:(0,t.jsxs)(f.Z,{preserve:!1,initialValues:d.values,labelCol:{span:4},layout:"Horizontal",onFinish:W,form:F,children:[(0,t.jsx)(f.Z.Item,{name:"id",hidden:!0,children:(0,t.jsx)(J.Z,{})}),(0,t.jsx)(f.Z.Item,{name:"storeId",label:"\u9009\u62E9\u5E97\u94FA",rules:[{required:!0,max:64}],children:(0,t.jsx)(Q.Z,{style:{width:"100%"},dropdownStyle:{maxHeight:400,overflow:"auto"},treeData:y,placeholder:"\u5F52\u5C5E\u95E8\u5E97",treeDefaultExpandAll:!0})}),(0,t.jsx)(f.Z.Item,{name:"rechargeMoney",label:"\u5145\u503C\u91D1\u989D",rules:[{required:!0,max:64,type:"money"}],children:(0,t.jsx)(b.Z,{formatter:function(u){return"$ ".concat(u).replace(/\B(?=(\d{3})+(?!\d))/g,",")},parser:function(u){return u.replace(/\$\s?|(,*)/g,"")},value:d.values.rechargeMoney,stringMode:!0,style:{width:"100%"}})}),(0,t.jsx)(f.Z.Item,{name:"giveMoney",label:"\u8D60\u9001\u91D1\u989D",rules:[{required:!0,max:64,type:"money"}],children:(0,t.jsx)(b.Z,{formatter:function(u){return"$ ".concat(u).replace(/\B(?=(\d{3})+(?!\d))/g,",")},parser:function(u){return u.replace(/\$\s?|(,*)/g,"")},style:{width:"100%"},value:d.values.giveMoney,stringMode:!0})}),(0,t.jsx)(f.Z.Item,{name:"recommend",label:"\u662F\u5426\u63A8\u8350",children:(0,t.jsx)(V.Z,{checked:d.values.recommend})}),(0,t.jsx)(f.Z.List,{name:"couponInfos",children:function(u,n){var r=n.add,s=n.remove;return(0,t.jsxs)(t.Fragment,{children:[u.map(function(e){return(0,t.jsxs)(K.Z,{align:"baseline",children:[(0,t.jsx)(f.Z.Item,{shouldUpdate:!0,children:function(){return(0,t.jsx)(f.Z.Item,(0,Z.Z)((0,Z.Z)({},e),{},{label:"\u4F18\u60E0\u5238",name:[e.name,"couponId"],rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u4F18\u60E0\u5238"}],children:(0,t.jsx)(N.Z,{style:{width:200},children:S.map(function(p){return(0,t.jsx)(ie,{value:p.id,children:p.couponTitle},p.id)})})}))}}),(0,t.jsx)(f.Z.Item,(0,Z.Z)((0,Z.Z)({},e),{},{label:"\u6570\u91CF",name:[e.name,"quantity"],labelCol:{span:8},rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4F18\u60E0\u5238\u6570\u91CF\uFF01"}],children:(0,t.jsx)(J.Z,{type:"number",style:{width:"100px"}})})),(0,t.jsx)(ae.Z,{onClick:function(){return s(e.name)}})]},e.key)}),(0,t.jsx)(f.Z.Item,{children:(0,t.jsx)(O.Z,{type:"dashed",onClick:function(){return r()},block:!0,icon:(0,t.jsx)(ue.Z,{}),children:"\u9009\u62E9\u4F18\u60E0\u5238"})})]})}}),(0,t.jsx)(f.Z.Item,{children:(0,t.jsx)(O.Z,{type:"primary",htmlType:"submit",style:{float:"right"},children:"\u4FDD\u5B58"})})]})})})},le=se,Re=a(79361),m="message",ce=function(){var d=f.Z.useForm(),R=(0,j.Z)(d,1),h=R[0],y=(0,I.useRef)(),T=(0,I.useState)(),A=(0,j.Z)(T,2),x=A[0],S=A[1],L=(0,I.useState)(!1),E=(0,j.Z)(L,2),$=E[0],F=E[1],B=function(){var u=(0,g.Z)((0,c.Z)().mark(function n(r){return(0,c.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return l.default.loading("\u6B63\u5728\u6DFB\u52A0...",m),e.prev=1,e.next=4,q(JSON.stringify(r)).then(function(i){l.default.destroy(m),i.data?l.default.success("\u6DFB\u52A0\u6210\u529F"):l.default.error("\u6DFB\u52A0\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01")});case 4:return y.current.reload(),e.abrupt("return",!0);case 8:return e.prev=8,e.t0=e.catch(1),l.default.destroy(m),l.default.error("\u6DFB\u52A0\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01"),e.abrupt("return",!1);case 13:case"end":return e.stop()}},n,null,[[1,8]])}));return function(r){return u.apply(this,arguments)}}(),W=function(){var u=(0,g.Z)((0,c.Z)().mark(function n(r){var s;return(0,c.Z)().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return l.default.loading("\u6B63\u5728\u5220\u9664...",m),i.prev=1,s=[],r.forEach(function(p){s.push(p.id)}),i.next=6,re(JSON.stringify(s)).then(function(p){l.default.destroy(m),p.data?(l.default.destroy(m),l.default.success("\u5220\u9664\u6210\u529F")):l.default.error("\u5220\u9664\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01")});case 6:return y.current.reload(),i.abrupt("return",!0);case 10:return i.prev=10,i.t0=i.catch(1),l.default.destroy(m),l.default.error("\u5220\u9664\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01"),i.abrupt("return",!1);case 15:case"end":return i.stop()}},n,null,[[1,10]])}));return function(r){return u.apply(this,arguments)}}(),w=function(){var u=(0,g.Z)((0,c.Z)().mark(function n(r){return(0,c.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return l.default.loading("\u6B63\u5728\u4FEE\u6539...",m),e.prev=1,r.activityType==3&&r.activityRewards.forEach(function(i){i.value="[".concat(i.value.join(),"]")}),e.next=5,_(JSON.stringify(r)).then(function(i){l.default.destroy(m),i.data?l.default.success("\u4FEE\u6539\u6210\u529F"):l.default.error(i.errors)});case 5:return y.current.reload(),e.abrupt("return",!0);case 9:return e.prev=9,e.t0=e.catch(1),l.default.destroy(m),l.default.error("\u4FEE\u6539\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01"),e.abrupt("return",!1);case 14:case"end":return e.stop()}},n,null,[[1,9]])}));return function(r){return u.apply(this,arguments)}}(),P=function(){var u=(0,g.Z)((0,c.Z)().mark(function n(r){return(0,c.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return l.default.loading("\u6B63\u5728\u4FEE\u6539...",m),e.prev=1,e.next=4,ee(JSON.stringify(r)).then(function(i){l.default.destroy(m),console.log(i),i.succeeded?l.default.success("\u4FEE\u6539\u6210\u529F"):l.default.error("\u66F4\u65B0\u5931\u8D25")});case 4:return y.current.reload(),e.abrupt("return",!0);case 8:return e.prev=8,e.t0=e.catch(1),l.default.destroy(m),l.default.error("\u4FEE\u6539\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01"),e.abrupt("return",!1);case 13:case"end":return e.stop()}},n,null,[[1,8]])}));return function(r){return u.apply(this,arguments)}}(),v=[{title:"\u4E3B\u952E",dataIndex:"id",hideInSearch:!0,hideInTable:!0,tip:"\u89C4\u5219\u540D\u79F0\u662F\u552F\u4E00\u7684 key"},{title:"\u5145\u503C\u91D1\u989D",dataIndex:"rechargeMoney",valueType:"money"},{title:"\u8D60\u9001\u91D1\u989D",dataIndex:"giveMoney",valueType:"money"},{title:"\u662F\u5426\u63A8\u8350",dataIndex:"recommend",hideInSearch:!0,render:function(n,r){return(0,t.jsx)(t.Fragment,{children:(0,t.jsx)(V.Z,{checkedChildren:"\u63A8\u8350",unCheckedChildren:"\u4E0D\u63A8\u8350",checked:r.recommend,onChange:function(e){var i={Id:r.id,Recommend:e};P(i)}})})}},{title:"\u64CD\u4F5C",dataIndex:"option",valueType:"option",render:function(n,r){var s=[(0,t.jsx)("a",{type:"primary",onClick:function(){F(!0),S(function(){return r})},children:"\u66F4\u65B0"},"update")];return s.push((0,t.jsx)(G.Z,{type:"primary",title:"\u786E\u8BA4\u5220\u9664\u5417\uFF1F",okText:"\u662F",cancelText:"\u5426",onConfirm:function(){W([r])},onCancel:function(){},children:(0,t.jsx)("a",{href:"#",children:"\u5220\u9664"})},"primary")),s}}];return(0,t.jsxs)(k.ZP,{children:[(0,t.jsx)(z.ZP,{headerTitle:"\u6D3B\u52A8\u4FE1\u606F",actionRef:y,rowKey:"id",search:{labelWidth:120},request:function(){var u=(0,g.Z)((0,c.Z)().mark(function n(r){var s,e;return(0,c.Z)().wrap(function(p){for(;;)switch(p.prev=p.next){case 0:return s=[],e=0,p.next=4,X(r).then(function(U){s=U.data.data,e=U.data.total});case 4:return p.abrupt("return",{data:s,success:!0,total:e});case 5:case"end":return p.stop()}},n)}));return function(n){return u.apply(this,arguments)}}(),toolBarRender:function(){return[(0,t.jsx)(O.Z,{type:"primary",onClick:function(){F(!0)},children:"\u65B0\u5EFA"},"primary")]},columns:v}),$&&(0,t.jsx)(le,{onFinish:function(){var u=(0,g.Z)((0,c.Z)().mark(function n(r){var s;return(0,c.Z)().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:if(s=!1,!r.id){i.next=7;break}return i.next=4,w(r);case 4:s=i.sent,i.next=11;break;case 7:return console.log(r),i.next=10,B(r);case 10:s=i.sent;case 11:s&&(F(!1),S(void 0),y.current&&y.current.reload()),y.current.reload();case 13:case"end":return i.stop()}},n)}));return function(n){return u.apply(this,arguments)}}(),onCancel:function(){S(void 0),F(!1)},createModalVisible:$,values:x||{},form:h})]})},oe=ce}}]);