"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[909],{7539:function(Ot,X,t){t.d(X,{Ku:function(){return U},n3:function(){return O},Nm:function(){return _},gp:function(){return tt},nB:function(){return at},Jz:function(){return B},DM:function(){return et},kJ:function(){return V},$P:function(){return nt}});var U={};t.r(U),t.d(U,{Params:function(){return st},request:function(){return ut}});var O={};t.r(O),t.d(O,{Params:function(){return ht},request:function(){return mt}});var V={};t.r(V),t.d(V,{Params:function(){return ft},request:function(){return gt}});var B={};t.r(B),t.d(B,{Params:function(){return rt},request:function(){return St}});var _={};t.r(_),t.d(_,{Params:function(){return I},request:function(){return pt}});var tt={};t.r(tt),t.d(tt,{Params:function(){return xt},request:function(){return vt}});var et={};t.r(et),t.d(et,{Params:function(){return Pt},request:function(){return Ct}});var at={};t.r(at),t.d(at,{Params:function(){return Ht},request:function(){return Tt}});var nt={};t.r(nt),t.d(nt,{Params:function(){return Ft},request:function(){return it}});var C=t(97857),s=t.n(C),T=t(72004),v=t.n(T),H=t(12444),y=t.n(H),D=t(9783),i=t.n(D),A=t(88593),st=v()(function n(){y()(this,n),i()(this,"page",void 0),i()(this,"page_size",void 0),i()(this,"status",void 0)});function ut(n,c){return(0,A.request)("/order/batchList",s()({method:"GET",params:s()({},n),data:{}},c||{}))}var ht=v()(function n(){y()(this,n),i()(this,"status1",void 0),i()(this,"status2",void 0),i()(this,"total",void 0)});function mt(n,c){return(0,A.request)("/order/batchListTotal",s()({method:"GET",params:s()({},n),data:{}},c||{}))}var ft=v()(function n(){y()(this,n)});function gt(n,c,L){return(0,A.request)("/order/batchSend",s()({method:"PUT",params:s()({},n),data:s()({},c)},L||{}))}var rt=v()(function n(){y()(this,n)});function St(n,c,L){return(0,A.request)("/order/batchSend",s()({method:"POST",params:s()({},n),data:s()({},c)},L||{}))}var I=v()(function n(){y()(this,n),i()(this,"orderID",void 0)});function pt(n,c){return(0,A.request)("/order/detail",s()({method:"GET",params:s()({},n),data:{}},c||{}))}var xt=v()(function n(){y()(this,n),i()(this,"code",void 0),i()(this,"createdAt",void 0),i()(this,"createdAtEnd",void 0),i()(this,"createdAtStart",void 0),i()(this,"goodsID",void 0),i()(this,"influenceId",void 0),i()(this,"name",void 0),i()(this,"orderID",void 0),i()(this,"page",void 0),i()(this,"page_size",void 0),i()(this,"phone",void 0),i()(this,"spu_no",void 0),i()(this,"status",void 0),i()(this,"userId",void 0)});function vt(n,c){return(0,A.request)("/order/list",s()({method:"GET",params:s()({},n),data:{}},c||{}))}var e=null;function jt(n,c){return Request("/order/postSale",_objectSpread({method:"GET",params:_objectSpread({},n),data:{}},c||{}))}var Pt=v()(function n(){y()(this,n)});function Ct(n,c,L){return(0,A.request)("/order/postSale",s()({method:"POST",params:s()({},n),data:s()({},c)},L||{}))}var Ht=v()(function n(){y()(this,n),i()(this,"confirmTimeEnd",void 0),i()(this,"confirmTimeStart",void 0),i()(this,"orderId",void 0),i()(this,"page",void 0),i()(this,"page_size",void 0),i()(this,"status",void 0)});function Tt(n,c){return(0,A.request)("/order/postSale/list",s()({method:"GET",params:s()({},n),data:{}},c||{}))}var Rt=null;function It(n,c){return Request("/order/postSale/refund",_objectSpread({method:"POST",params:_objectSpread({},n),data:{}},c||{}))}var Ft=v()(function n(){y()(this,n)});function it(n,c,L){return(0,A.request)("/order/send",s()({method:"PUT",params:s()({},n),data:s()({},c)},L||{}))}},95749:function(Ot,X,t){t.d(X,{Z:function(){return V}});var U=t(84908),O=t(85893);function V(B){return(0,O.jsx)(U.Z,{title:(B==null?void 0:B.title)||B.children,placement:"topLeft",children:(0,O.jsx)("div",{className:"fm-ellipsis-2",children:B.children})})}},50432:function(Ot,X,t){t.r(X),t.d(X,{default:function(){return bt}});var U=t(15009),O=t.n(U),V=t(99289),B=t.n(V),_=t(13769),tt=t.n(_),et=t(19632),at=t.n(et),nt=t(5574),C=t.n(nt),s=t(97857),T=t.n(s),v=t(67294),H=t(84485),y=t(84739),D=t(26713),i=t(79216),A=t(12461),st=t(8702),ut=t(7539),ht={},mt=t(95749),ft=t(73935),gt=t(85402),rt=t(71577),St=t(59652),I=t(2587),pt=t(69677),xt=t(30381),vt=t.n(xt),e=t(85893);function jt(l){var m=l.datetime,u=l.type,r=u===void 0?"date":u;function f(){switch(r){case"date":return vt()(m).format("YYYY-MM-DD");case"dateTime":return vt()(m).format("YYYY-MM-DD HH:mm:ss");default:return""}}return(0,e.jsx)("span",{children:f()})}var Pt=H.Z.Title,Ct=H.Z.Text,Ht=function(m){var u,r=m.record;return _jsxs(Space,{style:{width:250,overflowX:"hidden"},align:"start",children:[_jsx(Image,{style:{width:120,height:120,objectFit:"cover"},src:r==null||(u=r.image)===null||u===void 0?void 0:u.split(",")[0]}),_jsxs("div",{children:[_jsxs(Ct,{children:["ID:",r==null?void 0:r.spu_no]}),_jsx(Ellipsis,{title:r==null?void 0:r.title,children:_jsx(Pt,{level:5,children:r==null?void 0:r.title})})]})]})};function Tt(l){var m,u,r,f,x,K,N,$,J,z,E,b=l.visible,ot=l.onOk,R=l.onCancel,a=l.data,Q=l.handleAudit,dt=l.action,k=(0,v.useState)(""),q=C()(k,2),G=q[0],M=q[1];return console.log(a),(0,e.jsxs)(gt.Z,{title:"\u9000\u6B3E\u5BA1\u6838",destroyOnClose:!0,width:document.body.clientWidth>1e3?document.body.clientWidth-200:800,open:b,onOk:ot,onCancel:R,footer:(0,e.jsxs)(D.Z,{children:[(0,e.jsx)(rt.Z,{onClick:R,children:"\u53D6\u6D88"}),dt==="audit"?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(rt.Z,{onClick:function(){return Q(2,G)},children:"\u5BA1\u6838\u4E0D\u901A\u8FC7"}),(0,e.jsx)(rt.Z,{onClick:function(){return Q(1,G)},type:"primary",children:"\u5BA1\u6838\u901A\u8FC7"})]}):null]}),children:[(0,e.jsx)(st.QVr,{scroll:{x:"max-content"},options:!1,columns:[{title:"\u5546\u54C1\u4FE1\u606F",dataIndex:"goods_id",render:function(Z,j){var Y;return(0,e.jsx)(e.Fragment,{children:(0,e.jsxs)(D.Z,{direction:"horizontal",children:[(0,e.jsx)(i.Z,{style:{width:80,height:80,objectFit:"contain"},src:j==null||(Y=j.images)===null||Y===void 0?void 0:Y.split(",")[0]}),(0,e.jsxs)(D.Z,{direction:"vertical",children:[(0,e.jsxs)(H.Z.Text,{children:["ID:",(j==null?void 0:j.goods_id)||"-"]}),(0,e.jsx)(H.Z.Text,{children:(j==null?void 0:j.title)||"-"})]})]})})}},{title:"\u9500\u552E\u4EF7",dataIndex:"price"},{title:"\u5E93\u5B58",dataIndex:"stock"},{title:"\u7D2F\u79EF\u9500\u91CF",dataIndex:"sales"},{title:"30\u65E5\u9500\u91CF",dataIndex:"sales_30"},{title:"\u521B\u5EFA\u65F6\u95F4",valueType:"dateTime",dataIndex:"createdAt"},{title:"\u6807\u7B7E",dataIndex:"tags"}],style:{marginTop:20},bordered:!0,toolBarRender:!1,tooltip:null,search:!1,dataSource:[T()(T()({},a==null||(m=a.order)===null||m===void 0?void 0:m.goods),{},{price:a==null||(u=a.order)===null||u===void 0?void 0:u.price,createdAt:a==null||(r=a.order)===null||r===void 0?void 0:r.createdAt})||{}]}),(0,e.jsx)(St.Z,{title:"\u8BA2\u5355\u4FE1\u606F",style:{marginBottom:20},children:(0,e.jsxs)(I.Z,{layout:"horizontal",column:3,children:[(0,e.jsx)(I.Z.Item,{label:"\u5B9E\u4ED8\u91D1\u989D",children:(a==null||(f=a.order)===null||f===void 0?void 0:f.paidPrice)||"-"}),(0,e.jsx)(I.Z.Item,{label:"\u9000\u6B3E\u91D1\u989D",children:(a==null?void 0:a.amount)||"-"}),(0,e.jsx)(I.Z.Item,{label:"\u552E\u540E\u539F\u56E0",children:a==null?void 0:a.reason}),(0,e.jsx)(I.Z.Item,{label:"\u6210\u4EA4\u65F6\u95F4",children:(0,e.jsx)(jt,{datetime:a==null||(x=a.order)===null||x===void 0?void 0:x.createdAt,type:"dateTime"})}),(0,e.jsx)(I.Z.Item,{label:"\u552E\u540E\u65F6\u95F4",children:(0,e.jsx)(jt,{datetime:a==null?void 0:a.createdAt,type:"dateTime"})}),(0,e.jsx)(I.Z.Item,{label:"\u4E70\u5BB6",children:(a==null||(K=a.order)===null||K===void 0||(N=K.address)===null||N===void 0?void 0:N.phone)||"-"}),(0,e.jsx)(I.Z.Item,{label:"\u552E\u540E\u56FE\u7247",span:3,children:(0,e.jsx)(D.Z,{wrap:!0,children:a!=null&&a.images?a==null||($=a.images)===null||$===void 0||(J=$.spilt(","))===null||J===void 0?void 0:J.map(function(g,Z){return(0,e.jsx)(i.Z,{src:g},g+Z)}):"\u65E0"})}),(0,e.jsx)(I.Z.Item,{label:"\u552E\u540E\u89C6\u9891",span:3,children:(0,e.jsx)(D.Z,{wrap:!0,children:a!=null&&a.videos?a==null||(z=a.videos)===null||z===void 0||(E=z.spilt(","))===null||E===void 0?void 0:E.map(function(g,Z){return(0,e.jsxs)("video",{controls:!0,width:"300",height:"200",children:[(0,e.jsx)("source",{src:g,type:"video/mp4"}),"Your browser does not support the video tag."]},g+Z)}):"\u65E0"})}),dt==="audit"?(0,e.jsx)(I.Z.Item,{label:"\u5BA1\u6838\u610F\u89C1",span:3,children:(0,e.jsx)(pt.Z.TextArea,{value:G,onChange:function(Z){M(Z.target.value)}})}):null]})})]})}var Rt=["page","page_size"],It=H.Z.Title,Ft=H.Z.Link,it=H.Z.Text,n=function(m){var u=document.querySelector("#table .ant-spin-container");return u?ft.createPortal((0,e.jsx)(y.Z,T()(T()({style:{textAlign:"right",mariginTop:20},size:"small",pageSize:m.pageSize,showTotal:function(f,x){return console.log({total:f,range:x}),"\u7B2C ".concat(x[0],"-").concat(x[1]," \u6761/\u603B\u5171 ").concat(f," \u6761")}},m),{},{current:m.current,onChange:function(f,x){m.onChange(f,x)}})),u):null},c=function(m){var u,r=m.record;return(0,e.jsxs)(D.Z,{style:{width:250,overflowX:"hidden"},align:"start",children:[(0,e.jsx)(i.Z,{style:{width:120,height:120,objectFit:"cover"},src:r==null||(u=r.images)===null||u===void 0?void 0:u.split(",")[0]}),(0,e.jsxs)("div",{children:[(0,e.jsxs)(it,{children:["ID:",(r==null?void 0:r.spu_no)||"-"]}),(0,e.jsx)(mt.Z,{title:(r==null?void 0:r.title)||"-",children:(0,e.jsx)(It,{level:5,children:(r==null?void 0:r.title)||"-"})})]})]})},L=function(m){var u=m.onChange,r=m.value;return _jsxs(Space,{align:"center",children:[_jsx(It,{level:5,style:{marginBottom:0,fontWeight:900},children:"\u5FEB\u901F\u7B5B\u9009\u8BA2\u5355"}),_jsx(Radio.Group,{value:(r==null?void 0:r.status)||"",onChange:function(x){u(x.target.value)},children:_jsxs(Space,{wrap:!0,children:[_jsx(Radio.Button,{value:"",children:"\u5168\u90E8"}),_jsx(Radio.Button,{value:2,children:"\u5F85\u5BA1\u6838"}),_jsx(Radio.Button,{value:3,children:"\u5DF2\u5BA1\u6838"})]})})]})},zt=function(){var m=(0,v.useState)([]),u=C()(m,2),r=u[0],f=u[1],x=(0,v.useState)(0),K=C()(x,2),N=K[0],$=K[1],J=(0,v.useState)(1),z=C()(J,2),E=z[0],b=z[1],ot=(0,v.useState)(20),R=C()(ot,2),a=R[0],Q=R[1],dt=(0,v.useState)({}),k=C()(dt,2),q=k[0],G=k[1],M=(0,v.useRef)(),g=(0,v.useState)({}),Z=C()(g,2),j=Z[0],Y=Z[1];return{list:r,listHandler:f,total:N,totalHandler:$,page:E,pageHandler:b,pageSize:a,pageSizeHandler:Q,actionRef:M,record:q,recordHandler:G,params:j,paramsHandler:Y}};function bt(){var l=zt(),m=l.list,u=l.listHandler,r=l.totalHandler,f=l.actionRef,x=l.record,K=l.recordHandler,N=l.params,$=l.paramsHandler,J=l.page,z=l.pageSize,E=l.pageHandler,b=l.pageSizeHandler,ot=l.total,R=(0,v.useRef)(1),a=(0,v.useState)({}),Q=C()(a,2),dt=Q[0],k=Q[1],q=(0,v.useState)({}),G=C()(q,2),M=G[0],g=G[1],Z=(0,v.useState)(!1),j=C()(Z,2),Y=j[0],lt=j[1],Gt=(0,v.useState)(""),Lt=C()(Gt,2),Mt=Lt[0],$t=Lt[1],Bt=function(d){if(!(d!=null&&d.length))return[];var o=at()(d),S=[];return o.forEach(function(p){S.push(p),S.push(p)}),S},w=function(d,o){return o%2===0?{colSpan:0}:{}},Yt=[{title:"\u8BA2\u5355\u7F16\u53F7",dataIndex:"orderId",hideInTable:!0},{title:"\u552E\u540E\u72B6\u6001",dataIndex:"status",valueType:"select",fieldProps:{options:[{label:"\u5F85\u5BA1\u6838",value:1},{label:"\u9000\u6B3E\u4E2D",value:2},{label:"\u9000\u6B3E\u6210\u529F",value:3},{label:"\u9000\u6B3E\u5931\u8D25",value:4}]},hideInTable:!0},{title:"\u6210\u4EA4\u65F6\u95F4",dataIndex:"createdAt",hideInTable:!0,valueType:"dateRange",search:{transform:function(d){return{confirmTimeStart:d[0],confirmTimeEnd:d[1]}}}},{title:"\u5546\u54C1\u4FE1\u606F",dataIndex:"name",hideInSearch:!0,width:350,onCell:function(d,o){return{colSpan:o%2!==0?1:9}},render:function(d,o,S){if(S%2===0){var p,h;return(0,e.jsxs)(D.Z,{children:[(0,e.jsxs)(it,{children:["\u8BA2\u5355\u7F16\u53F7:",(o==null||(p=o.order)===null||p===void 0?void 0:p.orderID)||"-"]}),(0,e.jsxs)(it,{children:["\u7F51\u7EA2\u8D26\u53F7:",(o==null||(h=o.order)===null||h===void 0?void 0:h.code)||"-"]})]})}else{var W;return(0,e.jsx)(c,{record:o==null||(W=o.order)===null||W===void 0?void 0:W.goods})}}},{title:"\u8BA2\u5355\u72B6\u6001",width:160,dataIndex:"status",hideInSearch:!0,valueType:"select",fieldProps:{options:[{label:"\u5DF2\u63D0\u4EA4",value:1},{label:"\u5DF2\u5904\u7406",value:2},{label:"\u5DF2\u62D2\u7EDD",value:3},{label:"\u5DF2\u64A4\u56DE",value:4}]},onCell:w},{title:"\u91D1\u989D",width:120,dataIndex:"amount",hideInSearch:!0,onCell:w},{title:"\u552E\u540E\u72B6\u6001",width:160,dataIndex:"refundStatus",hideInSearch:!0,valueType:"select",fieldProps:{options:[{label:"\u5F85\u5BA1\u6838",value:1},{label:"\u9000\u6B3E\u4E2D",value:2},{label:"\u9000\u6B3E\u6210\u529F",value:3},{label:"\u9000\u6B3E\u5931\u8D25",value:4}]},onCell:w},{title:"\u552E\u540E\u539F\u56E0",width:120,dataIndex:"reason_desc",hideInSearch:!0,onCell:w},{title:"\u4E70\u5BB6",width:120,dataIndex:"customerPhone",hideInSearch:!0,onCell:w,render:function(d,o){var S,p;return(0,e.jsx)(e.Fragment,{children:o==null||(S=o.order)===null||S===void 0||(p=S.address)===null||p===void 0?void 0:p.phone})}},{title:"\u64CD\u4F5C",width:180,hideInSearch:!0,fixed:"right",onCell:w,render:function(d,o){return(0,e.jsxs)(D.Z,{direction:"vertical",children:[(o==null?void 0:o.status)===1?(0,e.jsx)("a",{onClick:function(){$t("audit"),g(o),lt(!0)},children:"\u9000\u6B3E\u5BA1\u6838"}):null,(0,e.jsx)("a",{onClick:function(){$t("detail"),g(o),lt(!0)},children:"\u67E5\u770B"})]})}}],Wt=function(d){E(d.current),b(d.pageSize),console.log(d);var o=d.page,S=d.page_size,p=tt()(d,Rt);return k(p),ut.nB.request(T()({},d)).then(function(h){var W,F,yt,At,Et,Zt;return u((h==null||(W=h.data)===null||W===void 0?void 0:W.list)||[]),r(h==null||(F=h.data)===null||F===void 0?void 0:F.total),console.log(Bt(h==null||(yt=h.data)===null||yt===void 0?void 0:yt.list)),{success:!0,data:Bt(h==null||(At=h.data)===null||At===void 0||(Et=At.list)===null||Et===void 0?void 0:Et.map(function(ct){var Dt;return T()(T()({},ct),{},{orderStatus:ct==null||(Dt=ct.order)===null||Dt===void 0?void 0:Dt.status})})),total:(h==null||(Zt=h.data)===null||Zt===void 0?void 0:Zt.total)*2}})},Ut=function(){var P=B()(O()().mark(function d(o,S){var p,h;return O()().wrap(function(F){for(;;)switch(F.prev=F.next){case 0:return F.next=2,ut.DM.request({},{id:M==null?void 0:M.id,status:o,remark:S});case 2:p=F.sent,p.code===0&&(A.ZP.success("\u64CD\u4F5C\u6210\u529F"),lt(!1),g({}),f==null||(h=f.current)===null||h===void 0||h.reload());case 4:case"end":return F.stop()}},d)}));return function(o,S){return P.apply(this,arguments)}}();return(0,e.jsxs)("div",{className:ht.orderList,id:"table",children:[(0,e.jsx)(st.QVr,{scroll:{x:"max-content"},beforeSearchSubmit:function(d){return R.current=1,$({status:d.status}),E(1),b(20),console.log(d),T()({},d)},defaultSize:"small",onReset:function(){$({status:""}),E(1),b(20)},pagination:!1,options:{reload:!1},params:T()(T()({},N),{},{page:J,page_size:z}),actionRef:f,request:Wt,dataSource:Bt(m),columns:Yt}),(0,e.jsx)(n,{current:R.current,pageSize:20,total:ot,onChange:function(d,o){E(d),R.current=d,b(o)},pageHandler:E}),Y?(0,e.jsx)(Tt,{action:Mt,visible:Y,handleAudit:Ut,data:M,onOk:function(){g({}),lt(!1)},onCancel:function(){g({}),lt(!1)}}):null]})}}}]);