cashier-mer/build/assets/index-iWHpo5iP.js

2 lines
12 KiB
JavaScript

import{_ as O,u as W,r as t,o as Y,m as D,a as q,b as g,s as L,c as u,h as m,e,f as o,w as f,g as C,v as T,z as I,F as Q,i as j,y as G,t as d,A as S,V as H,B as R,C as N,d as J,Q as X,P as Z,W as ee,U as te}from"./index-BhwfcSvx.js";import"./moment-Cl4UOzQZ.js";import{p as oe}from"./padding-dm0HkGpn.js";const M=p=>(R("data-v-fa3e0699"),p=p(),N(),p),se={class:"my-order"},le={class:"header-nav"},ae=M(()=>e("div",{class:"nav-item"},d("采购订单"),-1)),ie={class:"nav-item-btn"},ne={class:"header-input"},de={class:"order-lists","infinite-scroll-distance":300,"infinite-scroll-delay":500,style:{overflow:"auto"}},_e=["onClick"],ce={class:"top"},re={class:"sn"},ue={class:"create-time"},ve={class:"shop"},me={class:"left"},fe={class:"right"},pe={class:"money"},he=M(()=>e("div",{class:"bottom"},null,-1)),ge={key:0,class:"load-end"},be={key:1,class:"load-end"},ye={__name:"order",props:{isSystem:{type:Boolean,default:!1},source:{type:Number,default:0}},emits:["addAddress"],setup(p,{expose:A,emit:r}){W(),t([]);const l=t(1);t(null);const s=t(""),c=()=>{i.value.start_time=s.value[0]+" 00:00:00",i.value.end_time=s.value[1]+" 23:59:59",$(!0)},k=z=>z.getTime()>Date.now(),i=t({page_no:1,page_size:20,number:"",start_time:"",end_time:""}),a=t(!1),n=t(0),b=t(0),h=t(!1),v=t([]),$=(z=!1)=>{if(z)i.value.page_no=1;else if(h.value||a.value)return;a.value=!0,l.value==1&&(i.value.paid=null),l.value==2&&(i.value.paid=0),H(i.value).then(_=>{z?v.value=_.data.lists:v.value=[...v.value,..._.data.lists],_.data.lists.length<i.value.page_size?h.value=!0:i.value.page_no++,b.value=0,D.emit("set-c-order-detail",v.value[0]),n.value=_.data.count,a.value=!1}).catch(_=>{h.value=!0,a.value=!1})},y=(z,_)=>{b.value=_,D.emit("set-c-order-detail",z)};return A({getOrderList:$}),Y(()=>{D.on("update-c-order-detail",z=>{v.value[b.value].paid=1})}),q(()=>{D.off("update-c-order-detail")}),(z,_)=>{const F=g("el-date-picker"),x=g("el-button"),E=g("el-input"),K=L("loading"),P=L("infinite-scroll");return u(),m("div",se,[e("div",le,[ae,e("div",ie,[o(F,{modelValue:s.value,"onUpdate:modelValue":_[0]||(_[0]=V=>s.value=V),type:"daterange","start-placeholder":"开始时间","end-placeholder":"结束时间",size:"small","value-format":"YYYY-MM-DD","disabled-date":k,onChange:c},null,8,["modelValue"])])]),e("div",ne,[o(E,{modelValue:i.value.number,"onUpdate:modelValue":_[2]||(_[2]=V=>i.value.number=V),placeholder:"请输入订单编号",onKeydown:_[3]||(_[3]=T(V=>$(!0),["enter"])),onClear:_[4]||(_[4]=V=>$(!0)),clearable:""},{append:f(()=>[o(x,{type:"primary",style:{"background-color":"#1890ff",color:"#fff","border-radius":"0 0.315rem 0.315rem 0"},onClick:_[1]||(_[1]=V=>$(!0))},{default:f(()=>[C("搜索")]),_:1})]),_:1},8,["modelValue"])]),I((u(),m("div",de,[(u(!0),m(Q,null,j(v.value,(V,B)=>(u(),m("div",{class:G(["item",{"item-active":b.value==B}]),key:B,onClick:Mt=>y(V,B)},[e("div",ce,[e("div",re,"单号: "+d(V.number),1),e("div",ue,d(V.create_time),1)]),e("div",ve,[e("div",me,[e("div",null,"订单数量 x "+d(V.order_count),1)]),e("div",fe,[e("div",pe,"¥"+d(V.total),1)])]),he],10,_e))),128)),h.value?(u(),m("div",ge,"没有更多了")):S("",!0),a.value?(u(),m("div",be,"加载中...")):S("",!0)])),[[K,a.value],[P,$]])])}}},$e=O(ye,[["__scopeId","data-v-fa3e0699"]]),w=p=>(R("data-v-928e3cd0"),p=p(),N(),p),we=w(()=>e("h4",{style:{padding:"0",margin:"0",color:"#000"}},"订单详情",-1)),Ve={class:"dra-body"},ke={class:"detail"},ze={class:"table","infinite-scroll-distance":300,"infinite-scroll-delay":300,style:{overflow:"auto"},"infinite-scroll-immediate":!1},Ce={class:"table-info"},Ae={class:"info-item"},xe=w(()=>e("div",{class:"info-item-title"},"订单编号:",-1)),De={class:"info-item-info"},Le={class:"info-item"},Ue=w(()=>e("div",{class:"info-item-title"},"商品款数:",-1)),Se={class:"info-item-info"},Ie={class:"info-item"},Fe=w(()=>e("div",{class:"info-item-title"},"商品总价:",-1)),Be={class:"info-item-info"},Oe={class:"info-item"},Re=w(()=>e("div",{class:"info-item-title"},"创建时间:",-1)),Ne={class:"info-item-info"},We={class:"info-item"},Ye=w(()=>e("div",{class:"info-item-title"},"优惠抵扣:",-1)),qe={class:"info-item-info"},Me={class:"info-item"},Ee=w(()=>e("div",{class:"info-item-title"},"实际支付:",-1)),Ke={class:"info-item-info"},Pe={class:"info-item"},Te=w(()=>e("div",{class:"info-item-title"},"支付时间:",-1)),Qe={class:"info-item-info"},je={class:"info-item"},Ge=w(()=>e("div",{class:"info-item-title"},"支付方式:",-1)),He={class:"info-item-info"},Je={key:0},Xe={key:1},Ze={key:2},et=w(()=>e("div",{class:"table-title"},"收货人信息",-1)),tt={key:0,class:"table-info",style:{"flex-direction":"column"}},ot={class:"info-item"},st=w(()=>e("div",{class:"info-item-title"},"收货人:",-1)),lt={class:"info-item-info"},at={class:"info-item"},it=w(()=>e("div",{class:"info-item-title"},"联系方式:",-1)),nt={class:"info-item-info"},dt={class:"info-item"},_t=w(()=>e("div",{class:"info-item-title"},"收货地址:",-1)),ct={class:"info-item-info"},rt={key:1,class:"addAddress"},ut={style:{"font-size":"0.9rem"}},vt={style:{color:"#ff4a00"}},mt={style:{display:"flex","align-items":"center"}},ft={style:{"margin-left":"0.5rem"}},pt={__name:"sub",setup(p,{expose:A}){const r=t(!1),l=t({id:""});t([]),t(null);const s=t(!1),c=t({page_no:1,page_size:15,loadend:!1,loading:!1}),k=t([]),i=()=>{console.log("触底"),l.value.id&&!c.value.loadend&&(console.log("加载"),c.value.loading=!0,X({pid:l.value.id,page_no:c.value.page_no,page_size:c.value.page_size}).then(n=>{l.value.goods_count=n.data.count,k.value=[...k.value,...n.data.lists],n.data.lists.length<c.value.page_size&&(c.value.loadend=!0),c.value.loading=!1,c.value.page_no++}))};return A({drawer:r,setForm:n=>{l.value=n,c.value.page_no=1,c.value.loadend=!1,c.value.loading=!1,k.value=[],i()}}),(n,b)=>{const h=g("el-button"),v=g("el-table-column"),$=g("el-image"),y=g("el-table"),z=g("el-drawer"),_=L("loading"),F=L("infinite-scroll");return u(),J(z,{size:"64rem",modelValue:r.value,"onUpdate:modelValue":b[1]||(b[1]=x=>r.value=x),direction:"rtl"},{header:f(()=>[we]),default:f(()=>[e("div",Ve,[I((u(),m("div",ke,[I((u(),m("div",ze,[e("div",Ce,[e("div",Ae,[xe,e("div",De,d(l.value.number),1)]),e("div",Le,[Ue,e("div",Se,d(l.value.goods_count),1)]),e("div",Ie,[Fe,e("div",Be,"¥"+d(l.value.total),1)]),e("div",Oe,[Re,e("div",Ne,d(l.value.create_time),1)]),e("div",We,[Ye,e("div",qe," ¥"+d(l.value.deduction_price),1)]),e("div",Me,[Ee,e("div",Ke,"¥"+d(l.value.actual),1)]),e("div",Pe,[Te,e("div",Qe,d(l.value.update_time),1)]),e("div",je,[Ge,e("div",He,[l.value.pay_type==9?(u(),m("span",Je,"微信收款")):S("",!0),l.value.pay_type==3?(u(),m("span",Xe,"余额支付")):S("",!0),l.value.pay_type==1?(u(),m("span",Ze,"微信支付")):S("",!0)])])]),et,l.value.user_phone?(u(),m("div",tt,[e("div",ot,[st,e("div",lt,d(l.value.real_name),1)]),e("div",at,[it,e("div",nt,d(l.value.user_phone),1)]),e("div",dt,[_t,e("div",ct,d(l.value.user_address),1)])])):(u(),m("div",rt,[o(h,{type:"primary",onClick:b[0]||(b[0]=x=>n.addAddress(l.value)),size:"large"},{default:f(()=>[C("点击添加收货地址")]),_:1})])),e("div",ut,[C(" 共计 "),e("span",vt,d(l.value.goods_count),1),C(" 款商品 ")]),o(y,{data:k.value},{default:f(()=>[o(v,{type:"index",width:"60",label:"序号"}),o(v,{label:"商品信息"},{default:f(({row:x})=>[e("div",mt,[o($,{style:{height:"3rem",width:"3rem"},src:x.imgs},null,8,["src"]),e("span",ft,d(x.goods_name),1)])]),_:1}),o(v,{prop:"price",label:"单价",width:"150"}),o(v,{prop:"nums",label:"数量",width:"150"}),o(v,{prop:"total",label:"总价",width:"150"})]),_:1},8,["data"])])),[[_,s.value],[F,i]])])),[[_,s.value]])])]),_:1},8,["modelValue"])}}},ht=O(pt,[["__scopeId","data-v-928e3cd0"]]),U=p=>(R("data-v-7bc9887f"),p=p(),N(),p),gt={class:"my-order"},bt={class:"detail"},yt={class:"table","infinite-scroll-distance":300,"infinite-scroll-delay":300,style:{overflow:"auto"},"infinite-scroll-immediate":!1},$t=U(()=>e("div",{class:"table-title"},"订单信息",-1)),wt={class:"table-info"},Vt={class:"info-item"},kt=U(()=>e("div",{class:"info-item-title"},"订单编号:",-1)),zt={class:"info-item-info"},Ct={class:"info-item"},At=U(()=>e("div",{class:"info-item-title"},"订单数量:",-1)),xt={class:"info-item-info"},Dt={class:"info-item"},Lt=U(()=>e("div",{class:"info-item-title"},"商品总价:",-1)),Ut={class:"info-item-info"},St={class:"info-item"},It=U(()=>e("div",{class:"info-item-title"},"创建时间:",-1)),Ft={class:"info-item-info"},Bt={style:{"font-size":"0.9rem"}},Ot={style:{color:"#ff4a00"}},Rt=U(()=>e("span",{style:{color:"#777"}}," ( 点击订单查看订单详情 )",-1)),Nt={__name:"detail",emits:["addAddress"],setup(p,{emit:A}){W(),Z();const r=t({id:""});t([]),t(null);const l=t(!1);t(0),t(0),t(["商品信息","订单详情"]),t(""),t(!1);const s=t({page_no:1,page_size:15,loadend:!1,loading:!1}),c=t([]),k=()=>{console.log("触底"),r.value.id&&!s.value.loadend&&(console.log("加载"),s.value.loading=!0,ee({id:r.value.id,page_no:s.value.page_no,page_size:s.value.page_size}).then(n=>{c.value=[...c.value,...n.data.lists],n.data.lists.length<s.value.page_size&&(s.value.loadend=!0),s.value.loading=!1,s.value.page_no++}))},i=n=>{console.log(n),a.value.drawer=!0,a.value.setForm(n)},a=t(null);return Y(()=>{D.on("set-c-order-detail",n=>{r.value=n,s.value.page_no=1,s.value.loadend=!1,s.value.loading=!1,c.value=[],k()})}),q(()=>{D.off("set-c-order-detail")}),(n,b)=>{const h=g("el-table-column"),v=g("el-table"),$=L("loading"),y=L("infinite-scroll");return u(),m("div",gt,[I((u(),m("div",bt,[I((u(),m("div",yt,[$t,e("div",wt,[e("div",Vt,[kt,e("div",zt,d(r.value.number),1)]),e("div",Ct,[At,e("div",xt,d(r.value.order_count),1)]),e("div",Dt,[Lt,e("div",Ut,"¥"+d(r.value.total),1)]),e("div",St,[It,e("div",Ft,d(r.value.create_time),1)])]),e("div",Bt,[C(" 共计 "),e("span",Ot,d(r.value.order_count),1),C("个订单 "),Rt]),o(v,{data:c.value,style:{cursor:"pointer"},onCellClick:i},{default:f(()=>[o(h,{type:"index",width:"60",label:"序号"}),o(h,{prop:"number",label:"订单号",width:"200"}),o(h,{prop:"real_name",label:"收货人",width:"150"}),o(h,{prop:"user_phone",label:"联系方式",width:"150"}),o(h,{prop:"user_address",label:"收货地址"}),o(h,{prop:"update_time",label:"下单时间",width:"200"})]),_:1},8,["data"])])),[[$,l.value],[y,k]])])),[[$,l.value]]),o(ht,{ref_key:"subRef",ref:a},null,512)])}}},Wt=O(Nt,[["__scopeId","data-v-7bc9887f"]]),Yt={class:"my-card"},qt={class:"dialog-footer"},Tt={__name:"index",setup(p){const A=t(null),r=t(!1),l=i=>{i.id!=s.value.order_id?s.value={real_name:"",phone:"",detail:"",order_id:i.id}:s.value.order_id=i.id,r.value=!0},s=t({real_name:"",phone:"",detail:"",order_id:""}),c=t({real_name:[{required:!0,message:"请输入姓名",trigger:"blur"}],phone:[{required:!0,message:"请输入手机号",trigger:"blur"}],detail:[{required:!0,message:"请输入地址",trigger:"blur"}]}),k=()=>{te(s.value).then(i=>{var a;r.value=!1,(a=A.value)==null||a.getOrderList(!0)})};return(i,a)=>{const n=g("el-input"),b=g("el-form-item"),h=g("el-form"),v=g("el-button"),$=g("el-dialog");return u(),m("div",Yt,[o($e,{style:{"flex-shrink":"0"},ref_key:"orderRef",ref:A,onAddAddress:l},null,512),o(oe),o(Wt,{ref:"detailRef",onAddAddress:l},null,512),o($,{modelValue:r.value,"onUpdate:modelValue":a[4]||(a[4]=y=>r.value=y),title:"添加地址",width:"500"},{footer:f(()=>[e("div",qt,[o(v,{onClick:a[3]||(a[3]=y=>r.value=!1)},{default:f(()=>[C("取消")]),_:1}),o(v,{type:"primary",onClick:k},{default:f(()=>[C(" 确认 ")]),_:1})])]),default:f(()=>[o(h,{model:s.value,"label-width":"100",rules:c.value},{default:f(()=>[o(b,{label:"收货人","label-width":i.formLabelWidth,prop:"real_name"},{default:f(()=>[o(n,{modelValue:s.value.real_name,"onUpdate:modelValue":a[0]||(a[0]=y=>s.value.real_name=y),autocomplete:"off",placeholder:"请输入收货人"},null,8,["modelValue"])]),_:1},8,["label-width"]),o(b,{label:"电话","label-width":i.formLabelWidth,prop:"phone"},{default:f(()=>[o(n,{modelValue:s.value.phone,"onUpdate:modelValue":a[1]||(a[1]=y=>s.value.phone=y),type:"number",placeholder:"请输入电话"},null,8,["modelValue"])]),_:1},8,["label-width"]),o(b,{label:"地址","label-width":i.formLabelWidth,prop:"detail"},{default:f(()=>[o(n,{modelValue:s.value.detail,"onUpdate:modelValue":a[2]||(a[2]=y=>s.value.detail=y),placeholder:"请输入地址"},null,8,["modelValue"])]),_:1},8,["label-width"])]),_:1},8,["model","rules"])]),_:1},8,["modelValue"])])}}};export{Tt as default};