Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

p__crm__coupon__goodsCoupon.eeacef12.async.js 15 KiB

1
  1. (self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[1679],{68526:function(Be,ne,s){"use strict";s.r(ne),s.d(ne,{default:function(){return ke}});var De=s(57663),K=s(71577),Ne=s(43358),re=s(34041),Oe=s(34792),c=s(48086),h=s(3182),I=s(2824),ce=s(94043),l=s.n(ce),f=s(67294),Ae=s(30381),ue=s(16894),pe=s(78009),fe=s(85224),We=s(71194),se=s(50146),O=s(11849),Le=s(77883),le=s(85482),Ye=s(49111),he=s(19650),Ve=s(48736),ve=s(27049),ze=s(47673),A=s(4107),me=s(86582),Me=s(9715),y=s(86835),ye=s(49101),P=s(48971);function ge(d){return H.apply(this,arguments)}function H(){return H=(0,h.Z)(l().mark(function d(o){return l().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",(0,P.WY)("/kitchen/api/goodscoupon/getGoodsCouponPgage",{method:"POST",data:o}));case 1:case"end":return r.stop()}},d)})),H.apply(this,arguments)}function Se(d){return Q.apply(this,arguments)}function Q(){return Q=(0,h.Z)(l().mark(function d(o){return l().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",(0,P.WY)("/kitchen/api/goodscoupon/addGoodsCoupon",{method:"POST",data:o}));case 1:case"end":return r.stop()}},d)})),Q.apply(this,arguments)}function Ze(d){return X.apply(this,arguments)}function X(){return X=(0,h.Z)(l().mark(function d(o){return l().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",(0,P.WY)("/kitchen/api/goodscoupon/updateGoodsCouponEnable?Ids="+o,{method:"GET"}));case 1:case"end":return r.stop()}},d)})),X.apply(this,arguments)}function Ce(d){return q.apply(this,arguments)}function q(){return q=(0,h.Z)(l().mark(function d(o){return l().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",(0,P.WY)("/kitchen/api/goodscoupon/updateGoodsCoupon",{method:"POST",data:o}));case 1:case"end":return r.stop()}},d)})),q.apply(this,arguments)}function oe(){return _.apply(this,arguments)}function _(){return _=(0,h.Z)(l().mark(function d(){return l().wrap(function(m){for(;;)switch(m.prev=m.next){case 0:return m.abrupt("return",(0,P.WY)("/kitchen/api/papercoupon/getPaperCouponType",{method:"GET"}));case 1:case"end":return m.stop()}},d)})),_.apply(this,arguments)}function Ie(d){return ee.apply(this,arguments)}function ee(){return ee=(0,h.Z)(l().mark(function d(o){return l().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",(0,P.WY)("/kitchen/api/papercoupon/addPaperCouponType",{method:"POST",data:o}));case 1:case"end":return r.stop()}},d)})),ee.apply(this,arguments)}function Te(d){return te.apply(this,arguments)}function te(){return te=(0,h.Z)(l().mark(function d(o){return l().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",(0,P.WY)("\u200B\u200B/kitchen/api/Store/GetStoreGoods",{method:"POST",data:o}));case 1:case"end":return r.stop()}},d)})),te.apply(this,arguments)}function je(d){return ae.apply(this,arguments)}function ae(){return ae=(0,h.Z)(l().mark(function d(o){return l().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",(0,P.WY)("/kitchen/api/Store/GetStoreList",{method:"POST",data:o}));case 1:case"end":return r.stop()}},d)})),ae.apply(this,arguments)}var Je=s(58024),xe=s(91894),Ue=s(14781),we=s(36138),Ke=s(18106),ie=s(51752),t=s(85893),Fe=ie.Z.TabPane,He="message",Pe=function(o){var m=(0,f.useState)([]),r=(0,I.Z)(m,2),T=r[0],U=r[1],W=(0,f.useState)(0),G=(0,I.Z)(W,2),L=G[0],E=G[1],Y=(0,f.useState)(!1),b=(0,I.Z)(Y,2),$=b[0],x=b[1],S=[{title:"\u4E3B\u952E",dataIndex:"id",hideInSearch:!0,hideInTable:!0,tip:"\u89C4\u5219\u540D\u79F0\u662F\u552F\u4E00\u7684 key"},{title:"\u5546\u54C1",dataIndex:"goods_Name",valueType:"textarea"},{title:"\u5546\u54C1\u4EF7\u683C",dataIndex:"price",valueType:"money"},{title:"\u5546\u54C1\u4F1A\u5458\u4EF7\u683C",dataIndex:"vipPrice",valueType:"money"},{title:"\u662F\u5426\u8BBE\u5907\u5236\u4F5C",dataIndex:"isDevice",valueEnum:{0:{text:"\u5E97\u94FA",status:"Processing"},1:{text:"\u8BBE\u5907",status:"Success"}}},{title:"\u72B6\u6001",dataIndex:"status",valueEnum:{0:{text:"\u4E0A\u67B6",status:"Processing"},1:{text:"\u4E0B\u67B6",status:"Success"}}},{title:"\u4F30\u6E05",dataIndex:"stopSales",valueEnum:{0:{text:"\u9500\u552E",status:"Processing"},1:{text:"\u4F30\u6E05",status:"Success"}}}],k=function(){var Z=(0,h.Z)(l().mark(function g(C){return l().wrap(function(v){for(;;)switch(v.prev=v.next){case 0:return x(!0),v.prev=1,v.next=4,je({current:C,pageSize:10}).then(function(w){E(1),U(w.data),x(!1)});case 4:v.next=9;break;case 6:v.prev=6,v.t0=v.catch(1),x(!1);case 9:case"end":return v.stop()}},g,null,[[1,6]])}));return function(C){return Z.apply(this,arguments)}}(),B=(0,f.useRef)(),V=(0,f.useRef)();return(0,f.useEffect)(function(){k(1)},[]),(0,t.jsx)(t.Fragment,{children:(0,t.jsxs)(xe.Z,{headStyle:{border:"0px "},title:"\u5E97\u94FA\u5546\u54C1",style:{marginTop:"17px"},children:[(0,t.jsx)(ie.Z,{defaultActiveKey:"1",tabPosition:"left",onChange:function(g){},children:T==null?void 0:T.map(function(Z){return(0,t.jsx)(Fe,{tab:Z.name,children:(0,t.jsx)(ue.ZP,{actionRef:V,rowKey:"id",search:!1,loading:$,bordered:!0,columns:S,request:function(){var g=(0,h.Z)(l().mark(function C(j){var v,w;return l().wrap(function(F){for(;;)switch(F.prev=F.next){case 0:return v=[],w=0,j.StoreId=Z.id,F.next=5,Te(j).then(function(z){var D,N;v=(D=z.data)===null||D===void 0?void 0:D.data,w=(N=z.data)===null||N===void 0?void 0:N.total});case 5:return F.abrupt("return",{data:v,success:!0,total:w});case 6:case"end":return F.stop()}},C)}));return function(C){return g.apply(this,arguments)}}(),rowSelection:{type:"radio",onChange:function(C,j){o.oncheck(j)}}},Z.id)},Z.id)})}),(0,t.jsx)(we.Z,{size:"small",style:{float:"right"},total:L,onChange:function(g,C){k(g)},showTotal:function(g,C){return"\u603B\u5171 ".concat(g," \u6761")},defaultPageSize:10,defaultCurrent:1})]})})},Ge=Pe,Ee=0,Re=function(o){var m=y.Z.useForm(),r=(0,I.Z)(m,1),T=r[0],U=(0,f.useState)(),W=(0,I.Z)(U,2),G=W[0],L=W[1],E=(0,f.useState)(!1),Y=(0,I.Z)(E,2),b=Y[0],$=Y[1],x=(0,f.useRef)(null),S=(0,f.useState)(""),k=(0,I.Z)(S,2),B=k[0],V=k[1],Z=(0,f.useState)([]),g=(0,I.Z)(Z,2),C=g[0],j=g[1];(0,f.useEffect)(function(){v()},[]),(0,f.useEffect)(function(){T.setFieldsValue(o.values)},[o.values]);var v=function(){var i=(0,h.Z)(l().mark(function u(){var a,p;return l().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,oe();case 2:a=n.sent,p=[],a.data.map(function(R){return p.push({label:R.value,value:R.key})}),L(p);case 6:case"end":return n.stop()}},u)}));return function(){return i.apply(this,arguments)}}(),w={labelCol:{sm:{span:4}},wrapperCol:{}},M={wrapperCol:{sm:{span:500,offset:1}}},F=function(u){V(u.target.value)},z=function(){var i=(0,h.Z)(l().mark(function u(a){return l().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return a.preventDefault(),L([].concat((0,me.Z)(G),[{label:B,value:Ee++}])),V(""),setTimeout(function(){var n;(n=x.current)===null||n===void 0||n.focus()},0),e.next=6,Ie(JSON.stringify({Name:B})).then(function(n){n.data?(c.default.success("\u6DFB\u52A0\u6210\u529F"),v()):c.default.error("\u6DFB\u52A0\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01")});case 6:case"end":return e.stop()}},u)}));return function(a){return i.apply(this,arguments)}}(),D=function(){$(!0)},N=function(u){console.log(u),j(u)};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(se.Z,{maskClosable:!1,title:o.values.id?"\u7F16\u8F91\u4F18\u60E0\u5377":"\u65B0\u5EFA\u4F18\u60E0\u5377",width:700,visible:o.createModalVisible,footer:null,onCancel:function(){o.onCancel()},destroyOnClose:!0,children:(0,t.jsxs)(y.Z,(0,O.Z)((0,O.Z)({},w),{},{layout:"Horizontal",preserve:!1,form:T,onFinish:o.onFinish,children:[(0,t.jsx)(y.Z.Item,{name:"id",hidden:!0,children:(0,t.jsx)(A.Z,{})}),(0,t.jsx)(y.Z.Item,{name:"storeId",hidden:!0,children:(0,t.jsx)(A.Z,{})}),(0,t.jsx)(y.Z.Item,{name:"goodsId",hidden:!0,children:(0,t.jsx)(A.Z,{})}),(0,t.jsx)(y.Z.Item,{name:"goodsName",label:"\u5546\u54C1",rules:[{required:!0,max:200}],children:(0,t.jsx)(A.Z,{placeholder:"\u8BF7\u9009\u62E9\u5546\u54C1\u540D\u79F0",onClick:D})}),(0,t.jsx)(y.Z.Item,{name:"title",label:"\u4F18\u60E0\u5377\u6807\u9898",rules:[{required:!0,max:200}],children:(0,t.jsx)(A.Z,{placeholder:"\u8BF7\u8F93\u5165\u4F18\u60E0\u5377\u6807\u9898"})}),(0,t.jsx)(y.Z.Item,{name:"cTypeId",label:"\u4F18\u60E0\u5377\u7C7B\u578B",defaultValue:o.values.cTypeId,rules:[{required:!0}],children:(0,t.jsx)(re.Z,{placeholder:"\u8BF7\u9009\u62E9\u4F18\u60E0\u5377\u7C7B\u578B",dropdownRender:function(u){return(0,t.jsxs)(t.Fragment,{children:[u,(0,t.jsx)(ve.Z,{style:{margin:"8px 0"}}),(0,t.jsxs)(he.Z,{style:{padding:"0 8px 4px"},children:[(0,t.jsx)(A.Z,{placeholder:"\u8BF7\u8F93\u5165\u9009\u9879",ref:x,value:B,onChange:F}),(0,t.jsx)(K.Z,{type:"text",icon:(0,t.jsx)(ye.Z,{}),onClick:z,children:"\u65B0\u589E"})]})]})},options:G})}),(0,t.jsx)(y.Z.Item,(0,O.Z)((0,O.Z)({},M),{},{style:{height:32},children:(0,t.jsx)(y.Z.Item,{label:"\u539F\u59CB\u91D1\u989D",style:{float:"left"},rules:[{required:!0}],children:(0,t.jsx)(y.Z.Item,{name:"money",noStyle:!0,children:(0,t.jsx)(le.Z,{placeholder:"\u91D1\u989D",min:0,precision:2})})})})),(0,t.jsx)(y.Z.Item,(0,O.Z)((0,O.Z)({},M),{},{style:{height:32},children:(0,t.jsx)(y.Z.Item,{label:"\u5E73\u53F0\u91D1\u989D",style:{float:"left"},rules:[{required:!0}],children:(0,t.jsx)(y.Z.Item,{name:"soureMoney",noStyle:!0,children:(0,t.jsx)(le.Z,{placeholder:"\u91D1\u989D",min:0,precision:2})})})})),(0,t.jsx)(y.Z.Item,{children:(0,t.jsx)(K.Z,{type:"primary",htmlType:"submit",style:{float:"right"},children:"\u4FDD\u5B58"})})]}))}),(0,t.jsx)(se.Z,{title:"\u5546\u54C1\u5217\u8868",destroyOnClose:!0,maskClosable:!1,visible:b,width:900,onCancel:function(){$(!1)},onOk:function(){var u="",a="",p=0,e="";C.forEach(function(n,R){u=u+n.goods_Name,a=a+n.goodsId,p=n.price,e=n.storeId,R<C.length-1&&(u=u+",",a=a+",")}),T.setFieldsValue({goodsName:u,goodsId:a,money:p,storeId:e}),$(!1),j([])},children:(0,t.jsx)(Ge,{oncheck:N})})]})},be=Re,$e=function(){var o=(0,f.useRef)(),m=(0,f.useState)([]),r=(0,I.Z)(m,2),T=r[0],U=r[1],W=(0,f.useState)(!1),G=(0,I.Z)(W,2),L=G[0],E=G[1],Y=(0,f.useState)(),b=(0,I.Z)(Y,2),$=b[0],x=b[1],S="coupon",k=(0,f.useState)(),B=(0,I.Z)(k,2),V=B[0],Z=B[1],g=(0,f.useState)(),C=(0,I.Z)(g,2),j=C[0],v=C[1];(0,f.useEffect)(function(){w()},[]);var w=function(){var i=(0,h.Z)(l().mark(function u(){var a,p;return l().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,oe();case 2:a=n.sent,p=[],a.data.map(function(R){return p.push({label:R.value,value:R.key})}),v(p);case 6:case"end":return n.stop()}},u)}));return function(){return i.apply(this,arguments)}}(),M=function(){var i=(0,h.Z)(l().mark(function u(a){return l().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(c.default.loading("\u6B63\u5728\u6DFB\u52A0...",S),e.prev=1,!(a.validEndTime<a.validStartTime)){e.next=5;break}return c.default.error("\u5F00\u59CB\u65F6\u95F4\u4E0D\u80FD\u5927\u4E8E\u7ED3\u675F\u65F6\u95F4"),e.abrupt("return",!1);case 5:return e.next=7,Se(JSON.stringify(a)).then(function(n){c.default.destroy(S),n.data?c.default.success("\u6DFB\u52A0\u6210\u529F"):c.default.error("\u6DFB\u52A0\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01")});case 7:return o.current.reload(),e.abrupt("return",!0);case 11:return e.prev=11,e.t0=e.catch(1),c.default.destroy(S),c.default.error("\u6DFB\u52A0\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01"),e.abrupt("return",!1);case 16:case"end":return e.stop()}},u,null,[[1,11]])}));return function(a){return i.apply(this,arguments)}}(),F=function(){var i=(0,h.Z)(l().mark(function u(a){return l().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return c.default.loading("\u6B63\u5728\u66F4\u65B0...",S),e.prev=1,e.next=4,Ze(a).then(function(n){console.log(n),c.default.destroy(S),n.data?(c.default.destroy(S),c.default.success("\u66F4\u65B0\u6210\u529F")):c.default.error(n.errors)});case 4:return o.current.reload(),e.abrupt("return",!0);case 8:return e.prev=8,e.t0=e.catch(1),c.default.destroy(S),c.default.error("\u66F4\u65B0\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01"),e.abrupt("return",!1);case 13:case"end":return e.stop()}},u,null,[[1,8]])}));return function(a){return i.apply(this,arguments)}}(),z=function(){var i=(0,h.Z)(l().mark(function u(a){return l().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(c.default.loading("\u6B63\u5728\u4FEE\u6539...",S),e.prev=1,!(a.validEndTime<a.validStartTime)){e.next=5;break}return c.default.error("\u5F00\u59CB\u65F6\u95F4\u4E0D\u80FD\u5927\u4E8E\u7ED3\u675F\u65F6\u95F4"),e.abrupt("return",!1);case 5:return e.next=7,Ce(JSON.stringify(a)).then(function(n){c.default.destroy(S),n.data?c.default.success("\u4FEE\u6539\u6210\u529F"):c.default.error(JSON.sstringify(n.errors))});case 7:return o.current.reload(),e.abrupt("return",!0);case 11:return e.prev=11,e.t0=e.catch(1),c.default.destroy(S),c.default.error("\u4FEE\u6539\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01"),e.abrupt("return",!1);case 16:case"end":return e.stop()}},u,null,[[1,11]])}));return function(a){return i.apply(this,arguments)}}(),D=function(u){console.log(u),Z(u)},N=[{title:"\u4E3B\u952E",dataIndex:"id",tip:"\u89C4\u5219\u540D\u79F0\u662F\u552F\u4E00\u7684 key",hideInSearch:!0,hideInTable:!0},{title:"\u6807\u9898",dataIndex:"title",valueType:"textarea"},{title:"\u5E97\u94FA\u540D\u79F0",dataIndex:"storeName",valueType:"textarea",width:120},{title:"\u5546\u54C1\u540D\u79F0",dataIndex:"goodsName",valueType:"textarea",width:120},{title:"\u4F18\u60E0\u5E73\u53F0",width:90,dataIndex:"cTypeName",key:"cTypeName",renderFormItem:function(){return(0,t.jsx)(re.Z,{options:j,onChange:D,allowClear:!0})}},{title:"\u539F\u59CB\u91D1\u989D",dataIndex:"money",width:90,valueType:"money"},{title:"\u5E73\u53F0\u91D1\u989D",dataIndex:"soureMoney",width:90,valueType:"money"},{title:"\u521B\u5EFA\u65F6\u95F4",width:90,dataIndex:"crateTimeAt",valueType:"date",hideInSearch:!1},{title:"\u64CD\u4F5C",dataIndex:"option",width:250,valueType:"option",render:function(u,a){var p=[(0,t.jsx)("a",{type:"primary",onClick:function(){E(!0),x(function(){return a})},children:"\u66F4\u65B0"},"primary")];return p.push((0,t.jsx)("a",{type:"primary",onClick:function(){F(a.id)},children:a.enable?"\u7981\u7528":"\u542F\u7528"},"primary")),p}}];return(0,t.jsxs)(pe.ZP,{children:[(0,t.jsx)(ue.ZP,{headerTitle:"\u4F18\u60E0\u5377",actionRef:o,rowKey:"id",search:{labelWidth:120},pagination:{pageSize:10},onReset:function(){Z("")},toolBarRender:function(){return[(0,t.jsx)(K.Z,{type:"primary",onClick:function(){E(!0)},children:"\u65B0\u5EFA"},"primary")]},columns:N,request:function(){var i=(0,h.Z)(l().mark(function u(a,p){var e,n;return l().wrap(function(J){for(;;)switch(J.prev=J.next){case 0:return e=[],n=0,a.dateRange!=null&&a.dateRange.length>=2&&(a.validStartTime=a.dateRange[0],a.validEndTime=a.dateRange[1]),a.CTypeId=V,J.next=6,ge(a).then(function(de){e=de.data.data,n=de.data.total});case 6:return J.abrupt("return",{data:e,success:!0,total:n});case 7:case"end":return J.stop()}},u)}));return function(u,a){return i.apply(this,arguments)}}()}),(T==null?void 0:T.length)>0&&(0,t.jsx)(fe.Z,{extra:(0,t.jsxs)("div",{children:[" ","\u5DF2\u9009\u62E9 ",(0,t.jsxs)("a",{style:{fontWeight:600},children:[T.length," "]})," \u9879 \xA0\xA0"," "]})}),(0,t.jsx)(be,{onFinish:function(){var i=(0,h.Z)(l().mark(function u(a){var p;return l().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(p=!1,!a.id){n.next=7;break}return n.next=4,z(a);case 4:p=n.sent,n.next=10;break;case 7:return n.next=9,M(a);case 9:p=n.sent;case 10:p&&(E(!1),o.current&&o.current.reload());case 11:case"end":return n.stop()}},u)}));return function(u){return i.apply(this,arguments)}}(),onCancel:function(){x(void 0),E(!1)},createModalVisible:L,values:$||{}})]})},ke=$e}}]);