|
- (self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[1679],{68526:function($e,ne,s){"use strict";s.r(ne),s.d(ne,{default:function(){return ke}});var Be=s(57663),K=s(71577),De=s(43358),re=s(34041),Ne=s(34792),c=s(48086),l=s(39428),h=s(3182),I=s(2824),f=s(67294),Oe=s(30381),ue=s(16894),ce=s(78009),pe=s(85224),Ae=s(71194),se=s(50146),O=s(11849),We=s(77883),le=s(85986),Le=s(49111),fe=s(19650),Ye=s(48736),he=s(27049),Ve=s(47673),A=s(4107),ve=s(86582),ze=s(9715),y=s(55843),me=s(49101),P=s(48971);function ye(d){return H.apply(this,arguments)}function H(){return H=(0,h.Z)((0,l.Z)().mark(function d(o){return(0,l.Z)().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 ge(d){return Q.apply(this,arguments)}function Q(){return Q=(0,h.Z)((0,l.Z)().mark(function d(o){return(0,l.Z)().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)((0,l.Z)().mark(function d(o){return(0,l.Z)().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 Se(d){return q.apply(this,arguments)}function q(){return q=(0,h.Z)((0,l.Z)().mark(function d(o){return(0,l.Z)().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)((0,l.Z)().mark(function d(){return(0,l.Z)().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 Ce(d){return ee.apply(this,arguments)}function ee(){return ee=(0,h.Z)((0,l.Z)().mark(function d(o){return(0,l.Z)().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 Ie(d){return te.apply(this,arguments)}function te(){return te=(0,h.Z)((0,l.Z)().mark(function d(o){return(0,l.Z)().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 Te(d){return ae.apply(this,arguments)}function ae(){return ae=(0,h.Z)((0,l.Z)().mark(function d(o){return(0,l.Z)().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 Me=s(58024),je=s(91894),Je=s(14781),xe=s(36138),Ue=s(18106),ie=s(95562),t=s(85893),we=ie.Z.TabPane,Ke="message",Fe=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],R=G[1],Y=(0,f.useState)(!1),b=(0,I.Z)(Y,2),k=b[0],x=b[1],Z=[{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"}}}],$=function(){var S=(0,h.Z)((0,l.Z)().mark(function g(C){return(0,l.Z)().wrap(function(v){for(;;)switch(v.prev=v.next){case 0:return x(!0),v.prev=1,v.next=4,Te({current:C,pageSize:10}).then(function(w){R(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 S.apply(this,arguments)}}(),B=(0,f.useRef)(),V=(0,f.useRef)();return(0,f.useEffect)(function(){$(1)},[]),(0,t.jsx)(t.Fragment,{children:(0,t.jsxs)(je.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(S){return(0,t.jsx)(we,{tab:S.name,children:(0,t.jsx)(ue.ZP,{actionRef:V,rowKey:"id",search:!1,loading:k,bordered:!0,columns:Z,request:function(){var g=(0,h.Z)((0,l.Z)().mark(function C(j){var v,w;return(0,l.Z)().wrap(function(F){for(;;)switch(F.prev=F.next){case 0:return v=[],w=0,j.StoreId=S.id,F.next=5,Ie(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)}}},S.id)},S.id)})}),(0,t.jsx)(xe.Z,{size:"small",style:{float:"right"},total:L,onChange:function(g,C){$(g)},showTotal:function(g,C){return"\u603B\u5171 ".concat(g," \u6761")},defaultPageSize:10,defaultCurrent:1})]})})},Pe=Fe,Ge=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],R=(0,f.useState)(!1),Y=(0,I.Z)(R,2),b=Y[0],k=Y[1],x=(0,f.useRef)(null),Z=(0,f.useState)(""),$=(0,I.Z)(Z,2),B=$[0],V=$[1],S=(0,f.useState)([]),g=(0,I.Z)(S,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)((0,l.Z)().mark(function u(){var a,p;return(0,l.Z)().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(E){return p.push({label:E.value,value:E.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)((0,l.Z)().mark(function u(a){return(0,l.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return a.preventDefault(),L([].concat((0,ve.Z)(G),[{label:B,value:Ge++}])),V(""),setTimeout(function(){var n;(n=x.current)===null||n===void 0||n.focus()},0),e.next=6,Ce(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(){k(!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)(he.Z,{style:{margin:"8px 0"}}),(0,t.jsxs)(fe.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)(me.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(){k(!1)},onOk:function(){var u="",a="",p=0,e="";C.forEach(function(n,E){u=u+n.goods_Name,a=a+n.goodsId,p=n.price,e=n.storeId,E<C.length-1&&(u=u+",",a=a+",")}),T.setFieldsValue({goodsName:u,goodsId:a,money:p,storeId:e}),k(!1),j([])},children:(0,t.jsx)(Pe,{oncheck:N})})]})},Ee=Re,be=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],R=G[1],Y=(0,f.useState)(),b=(0,I.Z)(Y,2),k=b[0],x=b[1],Z="coupon",$=(0,f.useState)(),B=(0,I.Z)($,2),V=B[0],S=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)((0,l.Z)().mark(function u(){var a,p;return(0,l.Z)().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(E){return p.push({label:E.value,value:E.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)((0,l.Z)().mark(function u(a){return(0,l.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(c.default.loading("\u6B63\u5728\u6DFB\u52A0...",Z),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,ge(JSON.stringify(a)).then(function(n){c.default.destroy(Z),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(Z),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)((0,l.Z)().mark(function u(a){return(0,l.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return c.default.loading("\u6B63\u5728\u66F4\u65B0...",Z),e.prev=1,e.next=4,Ze(a).then(function(n){console.log(n),c.default.destroy(Z),n.data?(c.default.destroy(Z),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(Z),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)((0,l.Z)().mark(function u(a){return(0,l.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(c.default.loading("\u6B63\u5728\u4FEE\u6539...",Z),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(Z),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(Z),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),S(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(){R(!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)(ce.ZP,{children:[(0,t.jsx)(ue.ZP,{headerTitle:"\u4F18\u60E0\u5377",actionRef:o,rowKey:"id",search:{labelWidth:120},pagination:{pageSize:10},onReset:function(){S("")},toolBarRender:function(){return[(0,t.jsx)(K.Z,{type:"primary",onClick:function(){R(!0)},children:"\u65B0\u5EFA"},"primary")]},columns:N,request:function(){var i=(0,h.Z)((0,l.Z)().mark(function u(a,p){var e,n;return(0,l.Z)().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,ye(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)(pe.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)(Ee,{onFinish:function(){var i=(0,h.Z)((0,l.Z)().mark(function u(a){var p;return(0,l.Z)().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&&(R(!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),R(!1)},createModalVisible:L,values:k||{}})]})},ke=be}}]);
|