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__coupon-Batch.78a920db.async.js 15 KiB

1 year ago
1
  1. (self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[6053],{64760:function(pe,$,e){"use strict";var l=e(71194),x=e(50146),i=e(62350),d=e(24565),Z=e(39428),D=e(3182),w=e(2824),te=e(47673),k=e(4107),N=e(67294),G=e(16894),O=e(78009),t=e(79146),_=e(85893),L=function(y){var b=(0,N.useRef)(),n=k.Z.TextArea,ae=(0,N.useState)(!1),z=(0,w.Z)(ae,2),me=z[0],U=z[1],X="",E=(0,N.useState)(),ne=(0,w.Z)(E,2),V=ne[0],re=ne[1],ue=function(){var T=(0,D.Z)((0,Z.Z)().mark(function r(f){return(0,Z.Z)().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:if(y.couponRecord.showType!=1){u.next=5;break}return u.next=3,(0,t.m$)(JSON.stringify({Id:V.id,Status:V.status==1?0:1,Remark:X})).then(function(g){U(!1),b.current.reload()});case 3:u.next=7;break;case 5:return u.next=7,(0,t.A8)(JSON.stringify({Id:V.id,Status:V.status==1?0:1,Remark:X})).then(function(g){U(!1),b.current.reload()});case 7:case"end":return u.stop()}},r)}));return function(f){return T.apply(this,arguments)}}(),se=function(){U(!1)},oe=function(r){X=r.target.value},le=[{title:"\u4E3B\u952E",dataIndex:"id",tip:"\u89C4\u5219\u540D\u79F0\u662F\u552F\u4E00\u7684 key",hideInSearch:!0,hideInTable:!0},{title:"\u9002\u7528\u8303\u56F4",dataIndex:"supplier",hideInSearch:!0,valueType:"textarea"},{title:"\u72B6\u6001",key:"status",dataIndex:"status",valueEnum:{1:{text:"\u7981\u7528",status:"Warning"},0:{text:"\u542F\u7528",status:"Success"}}},{title:"\u5907\u6CE8",dataIndex:"remark",hideInSearch:!0,valueType:"textarea"},{title:"\u53D1\u653E\u65F6\u95F4",key:"sendTime",hideInSearch:!0,dataIndex:"sendTime"},{title:"\u64CD\u4F5C",dateIndex:"option",valueType:"option",render:function(r,f){return(0,_.jsx)(d.Z,{type:"primary",title:"\u786E\u8BA4\u542F\u7528\u5417\uFF1F",okText:"\u662F",cancelText:"\u5426",onConfirm:(0,D.Z)((0,Z.Z)().mark(function S(){return(0,Z.Z)().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:n.value=f.remark,re(f),U(!0);case 3:case"end":return g.stop()}},S)})),onCancel:function(){},children:(0,_.jsx)("a",{href:"#",children:f.status==0?"\u7981\u7528":"\u542F\u7528"})},"primary")}}];return(0,_.jsxs)(x.Z,{footer:null,destroyOnClose:!0,visible:y.shows,width:1100,onCancel:function(){y.onCancel()},children:[(0,_.jsx)(O.ZP,{headerTitle:"",header:{title:"\u53D1\u653E\u8BB0\u5F55",breadcrumb:{}},children:(0,_.jsx)(G.ZP,{actionRef:b,rowKey:"id",options:!1,search:{labelWidth:120},pagination:{pageSize:5},columns:le,request:function(){var T=(0,D.Z)((0,Z.Z)().mark(function r(f){var S,u;return(0,Z.Z)().wrap(function(p){for(;;)switch(p.prev=p.next){case 0:if(S=[],u=0,f.couponId=y.couponRecord.couponId,f.batchNo=y.couponRecord.batchNo,y.couponRecord.showType!=1){p.next=9;break}return p.next=7,(0,t.m2)(f).then(function(C){S=C.data.data,u=C.data.total});case 7:p.next=11;break;case 9:return p.next=11,(0,t.tP)(f).then(function(C){S=C.data.data,u=C.data.total});case 11:return p.abrupt("return",{data:S,success:!0,total:u});case 12:case"end":return p.stop()}},r)}));return function(r){return T.apply(this,arguments)}}()})}),(0,_.jsx)(x.Z,{title:"\u5907\u6CE8",visible:me,onOk:ue,onCancel:se,children:(0,_.jsx)(n,{onChange:function(r){return oe(r)},rows:4})})]})};$.Z=L},55099:function(pe,$,e){"use strict";e.r($),e.d($,{default:function(){return le}});var l=e(39428),x=e(3182),i=e(2824),d=e(67294),Z=e(78009),D=e(16894),w=e(64760),te=e(71194),k=e(50146),N=e(30381),G=e.n(N),O=e(79146),t=e(85893),_=function(r){var f=(0,d.useRef)(),S=[{title:"\u4E3B\u952E",dataIndex:"id",tip:"\u89C4\u5219\u540D\u79F0\u662F\u552F\u4E00\u7684 key",hideInSearch:!0,hideInTable:!0},{title:"\u5BA2\u6237\u7535\u8BDD",dataIndex:"phone",valueType:"textarea"},{title:"\u5BA2\u6237Id",dataIndex:"customerId",valueType:"textarea",search:!1},{title:"\u8BA2\u5355\u53F7",dataIndex:"orderId",valueType:"textarea"},{title:"\u4F7F\u7528\u5E97\u94FA",dataIndex:"storeName",valueType:"textarea",search:!1},{title:"\u9886\u53D6\u65B9\u5F0F",key:"receiveType",dataIndex:"receiveType",valueEnum:{1:{text:"\u5C0F\u7A0B\u5E8F\u9886\u53D6"},2:{text:"\u7EBF\u4E0B\u95E8\u5E97\u626B\u7801"},3:{text:"\u81EA\u52A8\u4E0B\u53D1"},4:{text:"\u597D\u53CB\u5206\u4EAB\u9886\u53D6"},5:{text:"\u6307\u5B9A\u53D1\u653E"},6:{text:"\u53C2\u52A0\u6D3B\u52A8"}}},{title:"\u72B6\u6001",key:"state",dataIndex:"state",valueEnum:{1:{text:"\u672A\u4F7F\u7528",status:"Warning"},2:{text:"\u5DF2\u4F7F\u7528",status:"Success"},3:{text:"\u5360\u7528\u4E2D",status:"Processing"},4:{text:"\u5931\u6548",status:"Default"}}},{title:"\u9886\u53D6\u65F6\u95F4",dataIndex:"createAt",valueType:"date"},{title:"\u6709\u6548\u65F6\u95F4",hideInSearch:!0,width:200,render:function(g,p,C){return(0,t.jsxs)("span",{children:[(0,t.jsx)("div",{children:G()(p.validStartTime).format("YYYY-MM-DD")}),(0,t.jsx)("div",{children:G()(p.validEndTime).format("YYYY-MM-DD")})]})}},{title:"\u6838\u9500\u65F6\u95F4",dataIndex:"writeOffTime",valueType:"date"}];return(0,t.jsx)(k.Z,{footer:null,destroyOnClose:!0,visible:r.shows,width:1300,onCancel:function(){r.onCancel()},children:(0,t.jsx)(Z.ZP,{header:{title:"\u9886\u53D6\u8BE6\u60C5",breadcrumb:{}},children:(0,t.jsx)(D.ZP,{actionRef:f,rowKey:"id",options:!1,search:{labelWidth:120},pagination:{pageSize:5},columns:S,request:function(){var u=(0,x.Z)((0,l.Z)().mark(function g(p){var C,j;return(0,l.Z)().wrap(function(A){for(;;)switch(A.prev=A.next){case 0:return C=[],j=0,p.batchNo=r.couponRecord.batchNo,A.next=5,(0,O.GA)(p).then(function(B){C=B.data.data,j=B.data.total});case 5:return A.abrupt("return",{data:C,success:!0,total:j});case 6:case"end":return A.stop()}},g)}));return function(g){return u.apply(this,arguments)}}()})})})},L=_,c=e(58996),y=e(77933),b=e(11849),n=e(57663),ae=e(71577),z=e(86582),me=e(43185),U=e(93009),X=e(34792),E=e(48086),ne=e(47673),V=e(4107),re=e(84391),ue=function(r){var f,S=(0,d.useRef)(),u="sendCoupon",g=V.Z.Search,p=(0,d.useState)([]),C=(0,i.Z)(p,2),j=C[0],P=C[1],A=(0,d.useState)([]),B=(0,i.Z)(A,2),q=B[0],H=B[1],ie=(0,d.useState)(!0),Q=(0,i.Z)(ie,2),ce=Q[0],de=Q[1],he=(0,d.useState)(),W=(0,i.Z)(he,2),M=W[0],m=W[1],F=(0,d.useState)([]),R=(0,i.Z)(F,2),ve=R[0],K=R[1],ee=(0,d.useState)([]),ye=(0,i.Z)(ee,2),Ae=ye[0],Me=ye[1],xe=(0,d.useState)([]),Ce=(0,i.Z)(xe,2),Ie=Ce[0],Ze=Ce[1],Ee=(0,d.useState)(!1),Se=(0,i.Z)(Ee,2),_e=Se[0],ge=Se[1];(0,d.useEffect)(function(){var v=function(){var a=(0,x.Z)((0,l.Z)().mark(function s(h){return(0,l.Z)().wrap(function(I){for(;;)switch(I.prev=I.next){case 0:return I.next=2,(0,O.fC)({CurrentPage:1,PageSize:7}).then(function(fe){var J=[];fe.data.forEach(function(Y){J.push({key:Y.memberId,title:Y.phone,description:h,disabled:!1,tag:Y.memberId})}),H(J),P(J)});case 2:case"end":return I.stop()}},s)}));return function(h){return a.apply(this,arguments)}}();v()},[]);var Te=[{title:"\u4E3B\u952E",dataIndex:"phone",tip:"\u89C4\u5219\u540D\u79F0\u662F\u552F\u4E00\u7684 key",hideInSearch:!0,hideInTable:!0},{title:"\u624B\u673A\u53F7",dataIndex:"phone",search:!1,valueType:"textarea",width:110},{title:"\u5BA2\u6237ID",dataIndex:"memberId",search:!1,valueType:"textarea",width:250},{title:"\u539F\u56E0",dataIndex:"msg",search:!1,valueType:"textarea",width:250}],be={beforeUpload:function(a){return a.type!=="application/vnd.ms-excel"&&a.type!=="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"&&E.default.error("".concat(a.name," \u4E0D\u662F exelce \u6587\u4EF6")),a.type=="application/vnd.ms-excel"||a.type=="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"?!0:U.Z.LIST_IGNORE},name:"file",maxCount:1,multiple:!1,action:"/kitchen/api/member/uploadcustomer/".concat((f=r.values)===null||f===void 0?void 0:f.couponId),headers:{authorization:"authorization-text"},onChange:function(a){if(a.file.status==="done"){E.default.success("".concat(a.file.name," \u4E0A\u4F20\u6210\u529F")),a.file.response.available,Ze(a.file.response.notAvailable);var s=q.filter(function(h){var o=a.file.response.available.filter(function(I){if(I.memberId==h.key)return I});if(o.length>0)return h}).map(function(h){return h.key});m(s),ge(!0)}else a.file.status==="error"&&E.default.error("".concat(a.file.name," \u4E0A\u4F20\u5931\u8D25."))}},we=function(a){var s=(0,z.Z)(a.fileList);s=s.slice(-2),s=s.map(function(h){return h.response&&(h.url=h.response.url),h}),fileListDataState({fileList:s})},Pe=function(a,s,h){m(a)},Re=function(a,s){K([].concat((0,z.Z)(a),(0,z.Z)(s)))},De=function(a,s){},Oe=function(){var v=(0,x.Z)((0,l.Z)().mark(function a(s,h){return(0,l.Z)().wrap(function(I){for(;;)switch(I.prev=I.next){case 0:if(s!="right"){I.next=2;break}return I.abrupt("return");case 2:return I.next=4,(0,O.fC)({CurrentPage:1,PageSize:7,phone:h}).then(function(fe){var J=[];fe.data.forEach(function(Y){J.push({key:Y.memberId,title:Y.phone,description:h,disabled:!1,tag:Y.memberId})}),H(J)});case 4:case"end":return I.stop()}},a)}));return function(s,h){return v.apply(this,arguments)}}(),je=function(){var v=(0,x.Z)((0,l.Z)().mark(function a(s){return(0,l.Z)().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:if(!(M==null||M.length<=0)){o.next=3;break}return E.default.error("\u8BF7\u9009\u62E9\u4F1A\u5458"),o.abrupt("return");case 3:if(!(M.length>s.lastNum)){o.next=6;break}return E.default.error("\u4F18\u60E0\u5238\u6570\u91CF\u4E0D\u591F"),o.abrupt("return");case 6:return E.default.loading("\u6B63\u5728\u53D1\u9001...",u),o.prev=7,o.next=10,(0,O.aO)({memberId:M,couponId:s.couponId,couponRangeId:s.couponRangeId}).then(function(I){E.default.destroy(u),I.data?(E.default.success("\u53D1\u9001\u6210\u529F"),m([]),K([])):E.default.error("\u53D1\u9001\u5931\u8D25")});case 10:return o.abrupt("return",!0);case 13:return o.prev=13,o.t0=o.catch(7),E.default.destroy(u),E.default.error("\u53D1\u9001\u8BF7\u91CD\u8BD5\uFF01"),o.abrupt("return",!1);case 18:case"end":return o.stop()}},a,null,[[7,13]])}));return function(s){return v.apply(this,arguments)}}();return(0,t.jsxs)(k.Z,{destroyOnClose:!0,visible:r.shows,width:700,onCancel:function(){H(j),r.onCancel()},onOk:function(){je(r.values),r.actionRef.current.reload()},children:[(0,t.jsxs)(Z.ZP,{header:{title:"\u6307\u5B9A\u53D1\u653E",breadcrumb:{}},children:[(0,t.jsx)("div",{style:{height:"68px"},children:(0,t.jsx)("span",{children:(0,t.jsx)(U.Z,(0,b.Z)((0,b.Z)({},be),{},{nostyle:!0,children:(0,t.jsx)(ae.Z,{icon:(0,t.jsx)(re.Z,{}),children:"\u4E0A\u4F20\u6587\u4EF6"})}))})}),(0,t.jsx)(y.Z,{oneWay:ce,showSearch:!0,showSelectAll:!0,onSearch:Oe,dataSource:q,titles:["\u672A\u9009\u62E9","\u5DF2\u9009\u4E2D"],targetKeys:M,selectedKeys:ve,onChange:Pe,onSelectChange:Re,onScroll:De,render:function(a){return a.title},pagination:{pageSize:8},listStyle:{width:500,height:400}})]}),(0,t.jsx)(k.Z,{footer:null,title:"\u65E0\u6548\u4F1A\u5458",visible:_e,width:600,onCancel:function(){ge(!1)},children:(0,t.jsx)(D.ZP,{headerTitle:"\u65E0\u6548\u4F1A\u5458",actionRef:S,rowKey:"phone",columns:Te,toolBarRender:!1,search:!1,scroll:{y:450},pagination:!1,request:function(){var v=(0,x.Z)((0,l.Z)().mark(function a(s){return(0,l.Z)().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.abrupt("return",{data:Ie,success:!0,total:Ie.length});case 1:case"end":return o.stop()}},a)}));return function(a){return v.apply(this,arguments)}}()})})]})},se=ue,oe=function(){var r=(0,d.useRef)(),f=(0,d.useState)(!1),S=(0,i.Z)(f,2),u=S[0],g=S[1],p=(0,d.useState)(),C=(0,i.Z)(p,2),j=C[0],P=C[1],A=(0,d.useState)(!1),B=(0,i.Z)(A,2),q=B[0],H=B[1],ie=(0,d.useState)(!1),Q=(0,i.Z)(ie,2),ce=Q[0],de=Q[1],he=[{title:"\u4E3B\u952E",dataIndex:"id",tip:"\u89C4\u5219\u540D\u79F0\u662F\u552F\u4E00\u7684 key",hideInSearch:!0,hideInTable:!0},{title:"\u6279\u6B21\u53F7",dataIndex:"batchNo",valueType:"textarea"},{title:"\u4F18\u60E0\u5377",dataIndex:"couponTitle",valueType:"textarea"},{title:"\u53D1\u653E\u6570\u91CF",dataIndex:"sendNum",search:!1,valueType:"textarea"},{title:"\u9886\u53D6\u6570\u91CF",dataIndex:"totalNum",search:!1,valueType:"digit"},{title:"\u5269\u4F59\u6570\u91CF",dataIndex:"lastNum",search:!1,valueType:"digit"},{title:"\u53D1\u653E\u65F6\u95F4",dataIndex:"createAt",valueType:"date"},{title:"\u64CD\u4F5C",dataIndex:"option",valueType:"option",render:function(M,m){var F=[(0,t.jsx)("a",{type:"primary",onClick:function(){g(!0),P({batchNo:m.batchNo,couponId:m.couponId,showType:1})},children:"\u9002\u7528\u8303\u56F4"},"primary1"),(0,t.jsx)("a",{type:"primary",onClick:function(){g(!0),P({batchNo:m.batchNo,couponId:m.couponId,showType:2})},children:"\u9002\u7528\u5546\u54C1"},"primary2"),(0,t.jsx)("a",{type:"primary",onClick:function(){de(!0),P({batchNo:m.batchNo})},children:"\u9886\u53D6\u8BE6\u60C5"},"primary3"),(0,t.jsx)("a",{type:"primary",disabled:m.validStatus!=1||m.lastNum==0,style:{pointerEvents:m.validStatus!=1||m.lastNum==0?"none":"auto"},onClick:function(){H(!0),P({couponRangeId:m.id,couponId:m.couponId,lastNum:m.lastNum})},children:"\u53D1\u653E"},"primary")];return F}}];return(0,t.jsxs)(Z.ZP,{children:[(0,t.jsx)(D.ZP,{headerTitle:"\u4F18\u60E0\u5377",actionRef:r,rowKey:"id",search:{labelWidth:120},columns:he,request:function(){var W=(0,x.Z)((0,l.Z)().mark(function M(m){var F,R;return(0,l.Z)().wrap(function(K){for(;;)switch(K.prev=K.next){case 0:return F=[],R=0,K.next=4,(0,O.hz)(m).then(function(ee){F=ee.data.data,R=ee.data.total});case 4:return K.abrupt("return",{data:F,success:!0,total:R});case 5:case"end":return K.stop()}},M)}));return function(M){return W.apply(this,arguments)}}()}),(0,t.jsx)(w.Z,{shows:u,onCancel:function(){g(!1),P(void 0)},couponRecord:j}),(0,t.jsx)(L,{shows:ce,onCancel:function(){de(!1),P(void 0)},couponRecord:j}),(0,t.jsx)(se,{shows:q,values:j,actionRef:r,onCancel:function(){H(!1),P(void 0)}})]})},le=oe},79146:function(pe,$,e){"use strict";e.d($,{hz:function(){return d},GA:function(){return D},m$:function(){return te},m2:function(){return k},tP:function(){return N},A8:function(){return G},aO:function(){return O},fC:function(){return _}});var l=e(39428),x=e(3182),i=e(48971);function d(c){return Z.apply(this,arguments)}function Z(){return Z=(0,x.Z)((0,l.Z)().mark(function c(y){return(0,l.Z)().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",(0,i.WY)("/kitchen/api/coupon/couponrecordpage",{method:"POST",data:y}));case 1:case"end":return n.stop()}},c)})),Z.apply(this,arguments)}function D(c){return w.apply(this,arguments)}function w(){return w=(0,x.Z)((0,l.Z)().mark(function c(y){return(0,l.Z)().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",(0,i.WY)("/kitchen/api/coupon/customerpage",{method:"POST",data:y}));case 1:case"end":return n.stop()}},c)})),w.apply(this,arguments)}function te(c){return(0,i.WY)("/kitchen/api/coupon/recallcoupon",{method:"post",data:c})}function k(c){return(0,i.WY)("/kitchen/api/coupon/couponrecordbyid",{method:"post",data:c})}function N(c){return(0,i.WY)("/kitchen/api/coupon/couponrecordgoods",{method:"post",data:c})}function G(c){return(0,i.WY)("/kitchen/api/coupon/recallcoupongoods",{method:"post",data:c})}function O(c){return t.apply(this,arguments)}function t(){return t=(0,x.Z)((0,l.Z)().mark(function c(y){return(0,l.Z)().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",(0,i.WY)("/kitchen/api/coupon/receivecouponbyinput",{method:"PUT",data:y}));case 1:case"end":return n.stop()}},c)})),t.apply(this,arguments)}function _(c){return L.apply(this,arguments)}function L(){return L=(0,x.Z)((0,l.Z)().mark(function c(y){return(0,l.Z)().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",(0,i.WY)("/kitchen\u200B/api\u200B/select\u200B/customerinfo\u200B",{method:"Post",data:y}));case 1:case"end":return n.stop()}},c)})),L.apply(this,arguments)}}}]);