diff --git a/build/assets/authCode-D610lJnm.js b/build/assets/authCode-k34-_7Pb.js similarity index 93% rename from build/assets/authCode-D610lJnm.js rename to build/assets/authCode-k34-_7Pb.js index b64b27a..d98f930 100644 --- a/build/assets/authCode-D610lJnm.js +++ b/build/assets/authCode-k34-_7Pb.js @@ -1 +1 @@ -import{r as o,b as c,c as m,d as y,w as p,g as v,t as f,N as x}from"./index-B9unL6O8.js";const g={__name:"authCode",props:{type:{type:String,default:"primary"},start:{type:Boolean,default:!0},time:{type:Number,default:60},text:{type:String,default:"发送验证码"},timeText:{type:String,default:"秒重新获取"},width:{type:String,default:"100px"},disabled:{type:Boolean,default:!1}},emits:["sendCode"],setup(t,{expose:s,emit:r}){const l=t,u=r,i=()=>{u("sendCode"),l.start&&n()},e=o(0),a=o(null),n=()=>{e.value=l.time,a.value=setInterval(()=>{e.value--,e.value<=0&&(clearInterval(a.value),e.value=0)},1e3)};return s({startCountDown:n,resetDown:()=>{clearInterval(a.value),e.value=0}}),(b,C)=>{const d=c("el-button");return m(),y(d,{type:t.type,style:x({width:t.width}),onClick:i,disabled:e.value>0||t.disabled},{default:p(()=>[v(f(e.value>0?`${e.value}${t.timeText}`:t.text),1)]),_:1},8,["type","style","disabled"])}}};export{g as _}; +import{r as o,b as c,c as m,d as y,w as p,g as v,t as f,N as x}from"./index-CEprPOh1.js";const g={__name:"authCode",props:{type:{type:String,default:"primary"},start:{type:Boolean,default:!0},time:{type:Number,default:60},text:{type:String,default:"发送验证码"},timeText:{type:String,default:"秒重新获取"},width:{type:String,default:"100px"},disabled:{type:Boolean,default:!1}},emits:["sendCode"],setup(t,{expose:s,emit:r}){const l=t,u=r,i=()=>{u("sendCode"),l.start&&n()},e=o(0),a=o(null),n=()=>{e.value=l.time,a.value=setInterval(()=>{e.value--,e.value<=0&&(clearInterval(a.value),e.value=0)},1e3)};return s({startCountDown:n,resetDown:()=>{clearInterval(a.value),e.value=0}}),(b,C)=>{const d=c("el-button");return m(),y(d,{type:t.type,style:x({width:t.width}),onClick:i,disabled:e.value>0||t.disabled},{default:p(()=>[v(f(e.value>0?`${e.value}${t.timeText}`:t.text),1)]),_:1},8,["type","style","disabled"])}}};export{g as _}; diff --git a/build/assets/axiosAPI-BnxnV-Ca.js b/build/assets/axiosAPI-JxG9ekqU.js similarity index 93% rename from build/assets/axiosAPI-BnxnV-Ca.js rename to build/assets/axiosAPI-JxG9ekqU.js index 9ad662a..d0e2f75 100644 --- a/build/assets/axiosAPI-BnxnV-Ca.js +++ b/build/assets/axiosAPI-JxG9ekqU.js @@ -1 +1 @@ -import{O as o,P as s,E as r,u as d,Q as g}from"./index-B9unL6O8.js";const m=o.create({baseURL:s.api,timeout:6e4});m.interceptors.request.use(t=>{const a=localStorage.getItem("Token");return a&&(t.headers.token=a),t},t=>(console.error(t),Promise.reject(t)));m.interceptors.response.use(t=>{var a;if(t.data.code===-1&&(t.data.msg=="登录过期"||t.data.msg=="登录超时,请重新登录"))throw r({message:t.data.msg,type:"error"}),setTimeout(()=>{const e=d();e.setUserInfo({}),e.setToken(""),g.push("/login")},500),new Error(t.data.msg);if(t.data.code===400)throw r({message:t.data.msg,type:"error"}),new Error(t.data.msg);if(t.data.show&&r({message:t.data.msg,type:"error"}),t.data.code===500)throw t.data.msg=JSON.parse(t.data.msg),r({message:((a=t.data.msg)==null?void 0:a.msg)||t.data.msg,type:"error"}),new Error(t.data.msg);return t.data.code===0?Promise.reject(t.data):t.data},t=>{var a,e;return console.error(t),r({message:((e=(a=t.response)==null?void 0:a.data)==null?void 0:e.msg)||t,type:"error"}),Promise.reject(t)});export{m as r}; +import{O as o,P as s,E as r,u as d,Q as g}from"./index-CEprPOh1.js";const m=o.create({baseURL:s.api,timeout:6e4});m.interceptors.request.use(t=>{const a=localStorage.getItem("Token");return a&&(t.headers.token=a),t},t=>(console.error(t),Promise.reject(t)));m.interceptors.response.use(t=>{var a;if(t.data.code===-1&&(t.data.msg=="登录过期"||t.data.msg=="登录超时,请重新登录"))throw r({message:t.data.msg,type:"error"}),setTimeout(()=>{const e=d();e.setUserInfo({}),e.setToken(""),g.push("/login")},500),new Error(t.data.msg);if(t.data.code===400)throw r({message:t.data.msg,type:"error"}),new Error(t.data.msg);if(t.data.show&&r({message:t.data.msg,type:"error"}),t.data.code===500)throw t.data.msg=JSON.parse(t.data.msg),r({message:((a=t.data.msg)==null?void 0:a.msg)||t.data.msg,type:"error"}),new Error(t.data.msg);return t.data.code===0?Promise.reject(t.data):t.data},t=>{var a,e;return console.error(t),r({message:((e=(a=t.response)==null?void 0:a.data)==null?void 0:e.msg)||t,type:"error"}),Promise.reject(t)});export{m as r}; diff --git a/build/assets/index-B68HUL05.js b/build/assets/index-BLGV5dWE.js similarity index 94% rename from build/assets/index-B68HUL05.js rename to build/assets/index-BLGV5dWE.js index e4d5621..1f82ea3 100644 --- a/build/assets/index-B68HUL05.js +++ b/build/assets/index-BLGV5dWE.js @@ -1 +1 @@ -import{a as B,b as L}from"./shop-CbMLEgdU.js";import{r as f,b as s,h as v,c as i,k as b,f as e,w as a,j as N,g as r,d,p as y,E as A}from"./index-B9unL6O8.js";import"./axiosAPI-BnxnV-Ca.js";const D={class:"my-card put-storage"},I={class:"order-lists","infinite-scroll-distance":300,"infinite-scroll-delay":500,"infinite-scroll-immediate":!1,style:{overflow:"auto"}},U={__name:"index",setup(S){const u=f([]),t=f({page_no:1,page_size:20,loadend:!1,type:1}),_=f(!1),c=()=>{t.value.loadend||(_.value=!0,B({page_no:t.value.page_no,page_size:t.value.page_size,type:t.value.type}).then(n=>{u.value=[...u.value,...n.data.lists],n.data.lists.length{t.value.page_no=1,t.value.loadend=!1,u.value=[],c()},k=async n=>{L({id:n.id}).then(p=>{n.status=1,A.success("入库成功")})};return(n,p)=>{const g=s("el-radio-button"),x=s("el-radio-group"),o=s("el-table-column"),C=s("el-image"),m=s("el-tag"),V=s("el-button"),E=s("el-table"),w=v("loading"),z=v("infinite-scroll");return i(),b("div",D,[e(x,{style:{"margin-bottom":"20px"},modelValue:t.value.type,"onUpdate:modelValue":p[0]||(p[0]=l=>t.value.type=l),onChange:h},{default:a(()=>[e(g,{label:1,value:1},{default:a(()=>[r("售卖库存")]),_:1}),e(g,{label:2,value:2},{default:a(()=>[r("兑换库存")]),_:1})]),_:1},8,["modelValue"]),N((i(),b("div",I,[e(E,{data:u.value},{default:a(()=>[e(o,{label:"导入人员",prop:"admin_name"}),e(o,{label:"门店确认人员",prop:"staff_name"}),e(o,{label:"商品图",prop:"image"},{default:a(({row:l})=>[e(C,{class:"image",src:l.image},null,8,["src"])]),_:1}),e(o,{label:"商品",prop:"store_name"}),e(o,{label:"数量",prop:"nums"}),e(o,{label:"状态",prop:"status"},{default:a(({row:l})=>[l.status===1?(i(),d(m,{key:0,type:"success"},{default:a(()=>[r("已入库")]),_:1})):l.status===0?(i(),d(m,{key:1,type:"warning"},{default:a(()=>[r("待确认")]),_:1})):l.status===-1?(i(),d(m,{key:2,type:"danger"},{default:a(()=>[r("库存不足")]),_:1})):y("",!0)]),_:1}),e(o,{label:"备注",prop:"mark"}),e(o,{label:"操作",width:"120",fixed:"right"},{default:a(({row:l})=>[l.status==0?(i(),d(V,{key:0,type:"success",onClick:j=>k(l)},{default:a(()=>[r(" 确认入库 ")]),_:2},1032,["onClick"])):y("",!0)]),_:1})]),_:1},8,["data"])])),[[w,_.value],[z,c]])])}}};export{U as default}; +import{a as B,b as L}from"./shop-DX9HGddz.js";import{r as f,b as s,h as v,c as i,k as b,f as e,w as a,j as N,g as r,d,p as y,E as A}from"./index-CEprPOh1.js";import"./axiosAPI-JxG9ekqU.js";const D={class:"my-card put-storage"},I={class:"order-lists","infinite-scroll-distance":300,"infinite-scroll-delay":500,"infinite-scroll-immediate":!1,style:{overflow:"auto"}},U={__name:"index",setup(S){const u=f([]),t=f({page_no:1,page_size:20,loadend:!1,type:1}),_=f(!1),c=()=>{t.value.loadend||(_.value=!0,B({page_no:t.value.page_no,page_size:t.value.page_size,type:t.value.type}).then(n=>{u.value=[...u.value,...n.data.lists],n.data.lists.length{t.value.page_no=1,t.value.loadend=!1,u.value=[],c()},k=async n=>{L({id:n.id}).then(p=>{n.status=1,A.success("入库成功")})};return(n,p)=>{const g=s("el-radio-button"),x=s("el-radio-group"),o=s("el-table-column"),C=s("el-image"),m=s("el-tag"),V=s("el-button"),E=s("el-table"),w=v("loading"),z=v("infinite-scroll");return i(),b("div",D,[e(x,{style:{"margin-bottom":"20px"},modelValue:t.value.type,"onUpdate:modelValue":p[0]||(p[0]=l=>t.value.type=l),onChange:h},{default:a(()=>[e(g,{label:1,value:1},{default:a(()=>[r("售卖库存")]),_:1}),e(g,{label:2,value:2},{default:a(()=>[r("兑换库存")]),_:1})]),_:1},8,["modelValue"]),N((i(),b("div",I,[e(E,{data:u.value},{default:a(()=>[e(o,{label:"导入人员",prop:"admin_name"}),e(o,{label:"门店确认人员",prop:"staff_name"}),e(o,{label:"商品图",prop:"image"},{default:a(({row:l})=>[e(C,{class:"image",src:l.image},null,8,["src"])]),_:1}),e(o,{label:"商品",prop:"store_name"}),e(o,{label:"数量",prop:"nums"}),e(o,{label:"状态",prop:"status"},{default:a(({row:l})=>[l.status===1?(i(),d(m,{key:0,type:"success"},{default:a(()=>[r("已入库")]),_:1})):l.status===0?(i(),d(m,{key:1,type:"warning"},{default:a(()=>[r("待确认")]),_:1})):l.status===-1?(i(),d(m,{key:2,type:"danger"},{default:a(()=>[r("库存不足")]),_:1})):y("",!0)]),_:1}),e(o,{label:"备注",prop:"mark"}),e(o,{label:"操作",width:"120",fixed:"right"},{default:a(({row:l})=>[l.status==0?(i(),d(V,{key:0,type:"success",onClick:j=>k(l)},{default:a(()=>[r(" 确认入库 ")]),_:2},1032,["onClick"])):y("",!0)]),_:1})]),_:1},8,["data"])])),[[w,_.value],[z,c]])])}}};export{U as default}; diff --git a/build/assets/index-D92nQDz0.js b/build/assets/index-Be4iZhHJ.js similarity index 98% rename from build/assets/index-D92nQDz0.js rename to build/assets/index-Be4iZhHJ.js index e04d4a8..43ede9d 100644 --- a/build/assets/index-D92nQDz0.js +++ b/build/assets/index-Be4iZhHJ.js @@ -1 +1 @@ -import{_ as K,u as j,r as n,o as q,m as D,a as G,b as u,h as I,c as s,k as a,e,f as d,w as p,g as k,d as O,p as $,i as ee,j as F,F as te,l as se,z as A,t as l,q as H,s as J,I as oe}from"./index-B9unL6O8.js";import{u as ae,f as ie}from"./store-DNW8I_iw.js";import{h as E}from"./moment-Cl4UOzQZ.js";import{p as le}from"./pay-BFyuVP94.js";import{p as ne}from"./padding-DLHwO6AB.js";import"./authCode-D610lJnm.js";/* empty css */const Q=f=>(H("data-v-44031ac3"),f=f(),J(),f),de={class:"my-order"},_e={class:"header-nav"},ce=Q(()=>e("div",{class:"nav-item"},l("收银订单"),-1)),re={class:"nav-item-btn"},ue={class:"header-input"},ve={class:"order-lists","infinite-scroll-distance":300,"infinite-scroll-delay":500,style:{overflow:"auto"}},pe=["onClick"],fe={class:"top"},me={class:"create-time"},he={class:"shop"},ye={class:"left"},ge={class:"shop-name"},ke=Q(()=>e("br",null,null,-1)),$e={style:{display:"block","font-size":"0.8rem",color:"#777"}},be={class:"right"},we={class:"money"},Ce={class:"count"},De={class:"bottom"},Se={class:"pay"},Ve={key:0},Ye={key:1},xe={key:2},ze={key:3},Pe={key:4},Ie={key:5},Re={key:1,style:{color:"#ff4a00"}},Me={key:0,class:"load-end"},Le={key:1,class:"load-end"},Be={__name:"order",props:{isSystem:{type:Boolean,default:!1},source:{type:Number,default:1}},setup(f,{expose:w}){j(),n([]);const t=n(1),m=r=>{_.value.page_no=1,b.value=!1,y.value=!1,c.value=[],g(!0)};n(null);const h=n(""),R=()=>{_.value.start_time=E(h.value[0]).format("YYYY-MM-DD 00:00:00"),_.value.end_time=E(h.value[1]).format("YYYY-MM-DD 23:59:59"),g(!0)},S=r=>r.getTime()>Date.now(),_=n({page_no:1,page_size:20,order_id:"",start_time:"",end_time:""}),y=n(!1),M=n(0),C=n(0),b=n(!1),c=n([]),g=(r=!1)=>{if(r)_.value.page_no=1;else if(b.value||y.value)return;y.value=!0,t.value==1&&(_.value.paid=null),t.value==2&&(_.value.paid=0),ae(_.value).then(i=>{r?c.value=i.data.lists:c.value=[...c.value,...i.data.lists],_.value.page_no==1&&c.value.length>0&&D.emit("set-sale-order-detail",c.value[0]),i.data.lists.length<_.value.page_size?b.value=!0:_.value.page_no++,C.value=0,console.log(_.value.page_no),M.value=i.data.count,y.value=!1}).catch(i=>{b.value=!0,y.value=!1})},L=(r,i)=>{C.value=i,D.emit("set-sale-order-detail",r)};return w({getOrderList:g}),q(()=>{D.on("update-sale-order-detail",r=>{console.log("==="),c.value[C.value].paid=1})}),G(()=>{D.off("update-sale-order-detail")}),(r,i)=>{const V=u("el-radio-button"),B=u("el-radio-group"),N=u("el-date-picker"),T=u("CircleClose"),Y=u("el-icon"),x=u("el-button"),z=u("el-input"),P=u("el-image"),W=u("spna"),X=I("loading"),Z=I("infinite-scroll");return s(),a("div",de,[e("div",_e,[ce,e("div",re,[d(B,{modelValue:t.value,"onUpdate:modelValue":i[0]||(i[0]=o=>t.value=o),onChange:m,size:"small"},{default:p(()=>[d(V,{value:1},{default:p(()=>[k("全部")]),_:1}),d(V,{value:2},{default:p(()=>[k("未支付")]),_:1})]),_:1},8,["modelValue"]),d(N,{modelValue:h.value,"onUpdate:modelValue":i[1]||(i[1]=o=>h.value=o),type:"daterange","start-placeholder":"开始时间","end-placeholder":"结束时间",size:"small","value-format":"YYYY/MM/DD","disabled-date":S,onChange:R,clearable:!1,style:{width:"14rem","margin-left":"1rem"}},null,8,["modelValue"])])]),e("div",ue,[d(z,{modelValue:_.value.order_id,"onUpdate:modelValue":i[4]||(i[4]=o=>_.value.order_id=o),placeholder:"请输入订单编号",onKeydown:i[5]||(i[5]=ee(o=>g(!0),["enter"])),onClear:i[6]||(i[6]=o=>g(!0))},{suffix:p(()=>[_.value.order_id!=""?(s(),O(Y,{key:0,size:"18",onClick:i[2]||(i[2]=o=>{_.value.order_id="",g(!0)}),style:{cursor:"pointer","margin-right":"0.5rem"}},{default:p(()=>[d(T)]),_:1})):$("",!0)]),append:p(()=>[d(x,{type:"primary",style:{"background-color":"#1890ff",color:"#fff","border-radius":"0 0.315rem 0.315rem 0"},onClick:i[3]||(i[3]=o=>g(!0))},{default:p(()=>[k("搜索")]),_:1})]),_:1},8,["modelValue"])]),F((s(),a("div",ve,[(s(!0),a(te,null,se(c.value,(o,U)=>(s(),a("div",{class:A(["item",{"item-active":C.value==U}]),key:U,onClick:Ft=>L(o,U)},[e("div",fe,[e("div",{class:A(["sn","cahier"])},"单号: "+l(o.order_id),1),e("div",me,l(o.update_time),1)]),e("div",he,[e("div",ye,[d(P,{src:o.store_name_img,class:"shop-img"},null,8,["src"]),e("div",ge,[k(l(o.store_name)+" ",1),ke,e("span",$e,l(o.store_info),1)])]),e("div",be,[e("div",we,"¥"+l(o.price),1),e("div",Ce,"共"+l(o.nums)+"款商品",1)])]),e("div",De,[e("div",Se,[o.paid?(s(),a("div",Ve,[k(l(o.paid_name)+" ",1),o.pay_type_name?(s(),O(W,{key:0},{default:p(()=>[k("("+l(o.pay_type_name)+")",1)]),_:2},1024)):o.pay_type==9?(s(),a("span",Ye,"(微信收款)")):o.pay_type==17?(s(),a("span",xe,"(现金支付)")):o.pay_type==13?(s(),a("span",ze,"(支付宝收款)")):o.pay_type==3?(s(),a("span",Pe,"(余额支付)")):o.pay_type==1?(s(),a("span",Ie,"(微信支付)")):$("",!0)])):(s(),a("div",Re,l(o.paid_name),1))])])],10,pe))),128)),b.value?(s(),a("div",Me,"没有更多了")):$("",!0),y.value?(s(),a("div",Le,"加载中...")):$("",!0)])),[[X,y.value],[Z,g]])])}}},Ne=K(Be,[["__scopeId","data-v-44031ac3"]]),v=f=>(H("data-v-065ffd6b"),f=f(),J(),f),Te={class:"my-order"},Ue={key:0,class:"detail"},Fe={class:"table","infinite-scroll-distance":300,"infinite-scroll-delay":300,style:{overflow:"auto"},"infinite-scroll-immediate":!1},Oe=v(()=>e("div",{class:"table-title"},"订单信息",-1)),Ae={class:"table-info"},Ee={class:"info-item"},Ke=v(()=>e("div",{class:"info-item-title"},"订单编号:",-1)),je={class:"info-item-info"},qe={class:"info-item"},Ge=v(()=>e("div",{class:"info-item-title"},"商品款数:",-1)),He={class:"info-item-info"},Je={class:"info-item"},Qe=v(()=>e("div",{class:"info-item-title"},"商品总价:",-1)),We={class:"info-item-info"},Xe={class:"info-item"},Ze=v(()=>e("div",{class:"info-item-title"},"创建时间:",-1)),et={class:"info-item-info"},tt={class:"info-item"},st=v(()=>e("div",{class:"info-item-title"},"优惠抵扣:",-1)),ot={class:"info-item-info"},at={class:"info-item"},it=v(()=>e("div",{class:"info-item-title"},"实际支付:",-1)),lt={class:"info-item-info"},nt={class:"info-item"},dt=v(()=>e("div",{class:"info-item-title"},"支付时间:",-1)),_t={class:"info-item-info"},ct={class:"info-item"},rt=v(()=>e("div",{class:"info-item-title"},"支付方式:",-1)),ut={class:"info-item-info"},vt={key:0},pt={key:1},ft={key:2},mt={key:3},ht={key:4},yt={key:5},gt={key:0,class:"table-title"},kt={key:1,class:"table-info"},$t={class:"info-item"},bt=v(()=>e("div",{class:"info-item-title"},"用户ID:",-1)),wt={class:"info-item-info"},Ct={class:"info-item"},Dt=v(()=>e("div",{class:"info-item-title"},"用户昵称:",-1)),St={class:"info-item-info"},Vt={class:"info-item"},Yt=v(()=>e("div",{class:"info-item-title"},"用户电话:",-1)),xt={class:"info-item-info"},zt={style:{"font-size":"0.9rem"}},Pt={style:{color:"#ff4a00"}},It={style:{display:"flex","align-items":"center"}},Rt={style:{"margin-left":"0.5rem"}},Mt=v(()=>e("div",{style:{height:"8rem"}},null,-1)),Lt={key:0,class:"footer"},Bt={key:1},Nt={__name:"detail",emits:["rePaySuccess"],setup(f,{emit:w}){j(),oe();const t=n({id:""});n([]);const m=n(null),h=n(!1);n(0),n(0),n(["商品信息","订单详情"]),n(""),n(!1);const R=()=>{m.value.setForm({isRePay:!0,data:t.value}),m.value.drawer=!0},S=n({page_no:1,page_size:15,loadend:!1,loading:!1}),_=n([]),y=()=>console.log("触底"),M=()=>{h.value=!0,ie({id:t.value.oid}).then(c=>{t.value=c.data,setTimeout(()=>{h.value=!1},200)})},C=w,b=(c=null)=>{setTimeout(()=>{C("rePaySuccess")})};return q(()=>{D.on("set-sale-order-detail",c=>{console.log("===",c),t.value=c,S.value.page_no=1,S.value.loadend=!1,S.value.loading=!1,_.value=[],M()})}),G(()=>{D.off("set-sale-order-detail")}),(c,g)=>{var Y;const L=u("el-image"),r=u("el-table-column"),i=u("el-table"),V=u("el-button"),B=u("el-empty"),N=I("infinite-scroll"),T=I("loading");return s(),a("div",Te,[t.value.id?F((s(),a("div",Ue,[F((s(),a("div",Fe,[Oe,e("div",Ae,[e("div",Ee,[Ke,e("div",je,l(t.value.order_id),1)]),e("div",qe,[Ge,e("div",He,l(t.value.total_num||0),1)]),e("div",Je,[Qe,e("div",We,"¥"+l(t.value.pay_price),1)]),e("div",Xe,[Ze,e("div",et,l(t.value.pay_time),1)]),e("div",tt,[st,e("div",ot,"¥"+l(t.value.deduction_price),1)]),e("div",at,[it,e("div",lt,"¥"+l(t.value.pay_price),1)]),e("div",nt,[dt,e("div",_t,l(t.value.pay_time),1)]),e("div",ct,[rt,e("div",ut,[t.value.pay_type_name?(s(),a("span",vt,l(t.value.pay_type_name),1)):t.value.pay_type==9?(s(),a("span",pt,"微信收款")):t.value.pay_type==17?(s(),a("span",ft,"现金支付")):t.value.pay_type==13?(s(),a("span",mt,"支付宝收款")):t.value.pay_type==3?(s(),a("span",ht,"余额支付")):t.value.pay_type==1?(s(),a("span",yt,"微信支付")):$("",!0)])])]),t.value.uid?(s(),a("div",gt,"用户信息")):$("",!0),t.value.uid?(s(),a("div",kt,[e("div",$t,[bt,e("div",wt,l(t.value.uid),1)]),e("div",Ct,[Dt,e("div",St,l(t.value.nickname),1)]),e("div",Vt,[Yt,e("div",xt,l(t.value.mobile),1)])])):$("",!0),e("div",zt,[k(" 共计 "),e("span",Pt,l(((Y=t.value.product)==null?void 0:Y.length)||" "),1),k(" 款商品 ")]),d(i,{data:t.value.product},{default:p(()=>[d(r,{label:"商品信息"},{default:p(({row:x})=>{var z,P;return[e("div",It,[d(L,{style:{height:"3rem",width:"3rem","flex-shrink":"0"},src:(z=x.cart_info)==null?void 0:z.image},null,8,["src"]),e("span",Rt,l((P=x.cart_info)==null?void 0:P.name),1)])]}),_:1}),d(r,{prop:"cart_info.price",label:"单价",width:"150"}),d(r,{prop:"cart_info.cart_num",label:"数量",width:"150"}),d(r,{prop:"cart_info.pay_price",label:"总价",width:"150"})]),_:1},8,["data"]),Mt])),[[N,y]]),t.value.paid?$("",!0):(s(),a("div",Lt,[d(V,{type:"primary",size:"large",onClick:R},{default:p(()=>[k("重新支付")]),_:1})]))])),[[T,h.value]]):(s(),a("div",Bt,[d(B)])),d(le,{ref_key:"payRef",ref:m,onPaySuccess:b},null,512)])}}},Tt=K(Nt,[["__scopeId","data-v-065ffd6b"]]),Ut={class:"my-card"},Ht={__name:"index",setup(f){const w=n(null),t=()=>{var m;(m=w.value)==null||m.getOrderList(!0)};return(m,h)=>(s(),a("div",Ut,[d(Ne,{style:{"flex-shrink":"0"},ref_key:"orderRef",ref:w},null,512),d(ne),d(Tt,{ref:"detailRef",onRePaySuccess:t},null,512)]))}};export{Ht as default}; +import{_ as K,u as j,r as n,o as q,m as D,a as G,b as u,h as I,c as s,k as a,e,f as d,w as p,g as k,d as O,p as $,i as ee,j as F,F as te,l as se,z as A,t as l,q as H,s as J,I as oe}from"./index-CEprPOh1.js";import{u as ae,f as ie}from"./store-BoFe3Agt.js";import{h as E}from"./moment-Cl4UOzQZ.js";import{p as le}from"./pay-C9Lsc2yr.js";import{p as ne}from"./padding-Bq_IbaOz.js";import"./authCode-k34-_7Pb.js";/* empty css */const Q=f=>(H("data-v-44031ac3"),f=f(),J(),f),de={class:"my-order"},_e={class:"header-nav"},ce=Q(()=>e("div",{class:"nav-item"},l("收银订单"),-1)),re={class:"nav-item-btn"},ue={class:"header-input"},ve={class:"order-lists","infinite-scroll-distance":300,"infinite-scroll-delay":500,style:{overflow:"auto"}},pe=["onClick"],fe={class:"top"},me={class:"create-time"},he={class:"shop"},ye={class:"left"},ge={class:"shop-name"},ke=Q(()=>e("br",null,null,-1)),$e={style:{display:"block","font-size":"0.8rem",color:"#777"}},be={class:"right"},we={class:"money"},Ce={class:"count"},De={class:"bottom"},Se={class:"pay"},Ve={key:0},Ye={key:1},xe={key:2},ze={key:3},Pe={key:4},Ie={key:5},Re={key:1,style:{color:"#ff4a00"}},Me={key:0,class:"load-end"},Le={key:1,class:"load-end"},Be={__name:"order",props:{isSystem:{type:Boolean,default:!1},source:{type:Number,default:1}},setup(f,{expose:w}){j(),n([]);const t=n(1),m=r=>{_.value.page_no=1,b.value=!1,y.value=!1,c.value=[],g(!0)};n(null);const h=n(""),R=()=>{_.value.start_time=E(h.value[0]).format("YYYY-MM-DD 00:00:00"),_.value.end_time=E(h.value[1]).format("YYYY-MM-DD 23:59:59"),g(!0)},S=r=>r.getTime()>Date.now(),_=n({page_no:1,page_size:20,order_id:"",start_time:"",end_time:""}),y=n(!1),M=n(0),C=n(0),b=n(!1),c=n([]),g=(r=!1)=>{if(r)_.value.page_no=1;else if(b.value||y.value)return;y.value=!0,t.value==1&&(_.value.paid=null),t.value==2&&(_.value.paid=0),ae(_.value).then(i=>{r?c.value=i.data.lists:c.value=[...c.value,...i.data.lists],_.value.page_no==1&&c.value.length>0&&D.emit("set-sale-order-detail",c.value[0]),i.data.lists.length<_.value.page_size?b.value=!0:_.value.page_no++,C.value=0,console.log(_.value.page_no),M.value=i.data.count,y.value=!1}).catch(i=>{b.value=!0,y.value=!1})},L=(r,i)=>{C.value=i,D.emit("set-sale-order-detail",r)};return w({getOrderList:g}),q(()=>{D.on("update-sale-order-detail",r=>{console.log("==="),c.value[C.value].paid=1})}),G(()=>{D.off("update-sale-order-detail")}),(r,i)=>{const V=u("el-radio-button"),B=u("el-radio-group"),N=u("el-date-picker"),T=u("CircleClose"),Y=u("el-icon"),x=u("el-button"),z=u("el-input"),P=u("el-image"),W=u("spna"),X=I("loading"),Z=I("infinite-scroll");return s(),a("div",de,[e("div",_e,[ce,e("div",re,[d(B,{modelValue:t.value,"onUpdate:modelValue":i[0]||(i[0]=o=>t.value=o),onChange:m,size:"small"},{default:p(()=>[d(V,{value:1},{default:p(()=>[k("全部")]),_:1}),d(V,{value:2},{default:p(()=>[k("未支付")]),_:1})]),_:1},8,["modelValue"]),d(N,{modelValue:h.value,"onUpdate:modelValue":i[1]||(i[1]=o=>h.value=o),type:"daterange","start-placeholder":"开始时间","end-placeholder":"结束时间",size:"small","value-format":"YYYY/MM/DD","disabled-date":S,onChange:R,clearable:!1,style:{width:"14rem","margin-left":"1rem"}},null,8,["modelValue"])])]),e("div",ue,[d(z,{modelValue:_.value.order_id,"onUpdate:modelValue":i[4]||(i[4]=o=>_.value.order_id=o),placeholder:"请输入订单编号",onKeydown:i[5]||(i[5]=ee(o=>g(!0),["enter"])),onClear:i[6]||(i[6]=o=>g(!0))},{suffix:p(()=>[_.value.order_id!=""?(s(),O(Y,{key:0,size:"18",onClick:i[2]||(i[2]=o=>{_.value.order_id="",g(!0)}),style:{cursor:"pointer","margin-right":"0.5rem"}},{default:p(()=>[d(T)]),_:1})):$("",!0)]),append:p(()=>[d(x,{type:"primary",style:{"background-color":"#1890ff",color:"#fff","border-radius":"0 0.315rem 0.315rem 0"},onClick:i[3]||(i[3]=o=>g(!0))},{default:p(()=>[k("搜索")]),_:1})]),_:1},8,["modelValue"])]),F((s(),a("div",ve,[(s(!0),a(te,null,se(c.value,(o,U)=>(s(),a("div",{class:A(["item",{"item-active":C.value==U}]),key:U,onClick:Ft=>L(o,U)},[e("div",fe,[e("div",{class:A(["sn","cahier"])},"单号: "+l(o.order_id),1),e("div",me,l(o.update_time),1)]),e("div",he,[e("div",ye,[d(P,{src:o.store_name_img,class:"shop-img"},null,8,["src"]),e("div",ge,[k(l(o.store_name)+" ",1),ke,e("span",$e,l(o.store_info),1)])]),e("div",be,[e("div",we,"¥"+l(o.price),1),e("div",Ce,"共"+l(o.nums)+"款商品",1)])]),e("div",De,[e("div",Se,[o.paid?(s(),a("div",Ve,[k(l(o.paid_name)+" ",1),o.pay_type_name?(s(),O(W,{key:0},{default:p(()=>[k("("+l(o.pay_type_name)+")",1)]),_:2},1024)):o.pay_type==9?(s(),a("span",Ye,"(微信收款)")):o.pay_type==17?(s(),a("span",xe,"(现金支付)")):o.pay_type==13?(s(),a("span",ze,"(支付宝收款)")):o.pay_type==3?(s(),a("span",Pe,"(余额支付)")):o.pay_type==1?(s(),a("span",Ie,"(微信支付)")):$("",!0)])):(s(),a("div",Re,l(o.paid_name),1))])])],10,pe))),128)),b.value?(s(),a("div",Me,"没有更多了")):$("",!0),y.value?(s(),a("div",Le,"加载中...")):$("",!0)])),[[X,y.value],[Z,g]])])}}},Ne=K(Be,[["__scopeId","data-v-44031ac3"]]),v=f=>(H("data-v-065ffd6b"),f=f(),J(),f),Te={class:"my-order"},Ue={key:0,class:"detail"},Fe={class:"table","infinite-scroll-distance":300,"infinite-scroll-delay":300,style:{overflow:"auto"},"infinite-scroll-immediate":!1},Oe=v(()=>e("div",{class:"table-title"},"订单信息",-1)),Ae={class:"table-info"},Ee={class:"info-item"},Ke=v(()=>e("div",{class:"info-item-title"},"订单编号:",-1)),je={class:"info-item-info"},qe={class:"info-item"},Ge=v(()=>e("div",{class:"info-item-title"},"商品款数:",-1)),He={class:"info-item-info"},Je={class:"info-item"},Qe=v(()=>e("div",{class:"info-item-title"},"商品总价:",-1)),We={class:"info-item-info"},Xe={class:"info-item"},Ze=v(()=>e("div",{class:"info-item-title"},"创建时间:",-1)),et={class:"info-item-info"},tt={class:"info-item"},st=v(()=>e("div",{class:"info-item-title"},"优惠抵扣:",-1)),ot={class:"info-item-info"},at={class:"info-item"},it=v(()=>e("div",{class:"info-item-title"},"实际支付:",-1)),lt={class:"info-item-info"},nt={class:"info-item"},dt=v(()=>e("div",{class:"info-item-title"},"支付时间:",-1)),_t={class:"info-item-info"},ct={class:"info-item"},rt=v(()=>e("div",{class:"info-item-title"},"支付方式:",-1)),ut={class:"info-item-info"},vt={key:0},pt={key:1},ft={key:2},mt={key:3},ht={key:4},yt={key:5},gt={key:0,class:"table-title"},kt={key:1,class:"table-info"},$t={class:"info-item"},bt=v(()=>e("div",{class:"info-item-title"},"用户ID:",-1)),wt={class:"info-item-info"},Ct={class:"info-item"},Dt=v(()=>e("div",{class:"info-item-title"},"用户昵称:",-1)),St={class:"info-item-info"},Vt={class:"info-item"},Yt=v(()=>e("div",{class:"info-item-title"},"用户电话:",-1)),xt={class:"info-item-info"},zt={style:{"font-size":"0.9rem"}},Pt={style:{color:"#ff4a00"}},It={style:{display:"flex","align-items":"center"}},Rt={style:{"margin-left":"0.5rem"}},Mt=v(()=>e("div",{style:{height:"8rem"}},null,-1)),Lt={key:0,class:"footer"},Bt={key:1},Nt={__name:"detail",emits:["rePaySuccess"],setup(f,{emit:w}){j(),oe();const t=n({id:""});n([]);const m=n(null),h=n(!1);n(0),n(0),n(["商品信息","订单详情"]),n(""),n(!1);const R=()=>{m.value.setForm({isRePay:!0,data:t.value}),m.value.drawer=!0},S=n({page_no:1,page_size:15,loadend:!1,loading:!1}),_=n([]),y=()=>console.log("触底"),M=()=>{h.value=!0,ie({id:t.value.oid}).then(c=>{t.value=c.data,setTimeout(()=>{h.value=!1},200)})},C=w,b=(c=null)=>{setTimeout(()=>{C("rePaySuccess")})};return q(()=>{D.on("set-sale-order-detail",c=>{console.log("===",c),t.value=c,S.value.page_no=1,S.value.loadend=!1,S.value.loading=!1,_.value=[],M()})}),G(()=>{D.off("set-sale-order-detail")}),(c,g)=>{var Y;const L=u("el-image"),r=u("el-table-column"),i=u("el-table"),V=u("el-button"),B=u("el-empty"),N=I("infinite-scroll"),T=I("loading");return s(),a("div",Te,[t.value.id?F((s(),a("div",Ue,[F((s(),a("div",Fe,[Oe,e("div",Ae,[e("div",Ee,[Ke,e("div",je,l(t.value.order_id),1)]),e("div",qe,[Ge,e("div",He,l(t.value.total_num||0),1)]),e("div",Je,[Qe,e("div",We,"¥"+l(t.value.pay_price),1)]),e("div",Xe,[Ze,e("div",et,l(t.value.pay_time),1)]),e("div",tt,[st,e("div",ot,"¥"+l(t.value.deduction_price),1)]),e("div",at,[it,e("div",lt,"¥"+l(t.value.pay_price),1)]),e("div",nt,[dt,e("div",_t,l(t.value.pay_time),1)]),e("div",ct,[rt,e("div",ut,[t.value.pay_type_name?(s(),a("span",vt,l(t.value.pay_type_name),1)):t.value.pay_type==9?(s(),a("span",pt,"微信收款")):t.value.pay_type==17?(s(),a("span",ft,"现金支付")):t.value.pay_type==13?(s(),a("span",mt,"支付宝收款")):t.value.pay_type==3?(s(),a("span",ht,"余额支付")):t.value.pay_type==1?(s(),a("span",yt,"微信支付")):$("",!0)])])]),t.value.uid?(s(),a("div",gt,"用户信息")):$("",!0),t.value.uid?(s(),a("div",kt,[e("div",$t,[bt,e("div",wt,l(t.value.uid),1)]),e("div",Ct,[Dt,e("div",St,l(t.value.nickname),1)]),e("div",Vt,[Yt,e("div",xt,l(t.value.mobile),1)])])):$("",!0),e("div",zt,[k(" 共计 "),e("span",Pt,l(((Y=t.value.product)==null?void 0:Y.length)||" "),1),k(" 款商品 ")]),d(i,{data:t.value.product},{default:p(()=>[d(r,{label:"商品信息"},{default:p(({row:x})=>{var z,P;return[e("div",It,[d(L,{style:{height:"3rem",width:"3rem","flex-shrink":"0"},src:(z=x.cart_info)==null?void 0:z.image},null,8,["src"]),e("span",Rt,l((P=x.cart_info)==null?void 0:P.name),1)])]}),_:1}),d(r,{prop:"cart_info.price",label:"单价",width:"150"}),d(r,{prop:"cart_info.cart_num",label:"数量",width:"150"}),d(r,{prop:"cart_info.pay_price",label:"总价",width:"150"})]),_:1},8,["data"]),Mt])),[[N,y]]),t.value.paid?$("",!0):(s(),a("div",Lt,[d(V,{type:"primary",size:"large",onClick:R},{default:p(()=>[k("重新支付")]),_:1})]))])),[[T,h.value]]):(s(),a("div",Bt,[d(B)])),d(le,{ref_key:"payRef",ref:m,onPaySuccess:b},null,512)])}}},Tt=K(Nt,[["__scopeId","data-v-065ffd6b"]]),Ut={class:"my-card"},Ht={__name:"index",setup(f){const w=n(null),t=()=>{var m;(m=w.value)==null||m.getOrderList(!0)};return(m,h)=>(s(),a("div",Ut,[d(Ne,{style:{"flex-shrink":"0"},ref_key:"orderRef",ref:w},null,512),d(ne),d(Tt,{ref:"detailRef",onRePaySuccess:t},null,512)]))}};export{Ht as default}; diff --git a/build/assets/index-B1waLprr.js b/build/assets/index-BjO2fJoc.js similarity index 98% rename from build/assets/index-B1waLprr.js rename to build/assets/index-BjO2fJoc.js index ef5ce50..53b6989 100644 --- a/build/assets/index-B1waLprr.js +++ b/build/assets/index-BjO2fJoc.js @@ -1 +1 @@ -import{K as V,_ as B,u as j,r as y,b as p,c as s,k as f,e as t,t as m,g as d,F as E,l as F,z as q,f as l,w as r,E as $,m as D,q as J,s as K,o as W,a as G,h as N,d as k,p as w,j as U}from"./index-B9unL6O8.js";import{h as T}from"./moment-Cl4UOzQZ.js";import{p as H}from"./padding-DLHwO6AB.js";function P(){return V.get("/merchant/Merchant/amount_account")}function Q(u){return V.get("/merchant/Merchant/taking_lists",{params:u})}function X(){return V.get("/merchant/Merchant/taking_info")}function Z(u){return V.post("/merchant/Merchant/withdraw",u)}function ee(u){return V.get("/financial/FinancialRecord/api_lists",{params:u})}const z=u=>(J("data-v-e01d9d71"),u=u(),K(),u),ae={class:"my-order"},te={class:"header-nav"},le=z(()=>t("div",{class:"nav-item"},m("提现"),-1)),ne={class:"nav-body"},oe={class:"my-money"},se=z(()=>t("div",null,"我的余额:",-1)),ie={style:{"text-align":"center",color:"#2ec479"}},re={class:"my-count"},de={class:"count"},ue={class:"money"},ce={style:{color:"#ff4a00"}},_e={class:"order-lists","infinite-scroll-distance":300,"infinite-scroll-delay":500,style:{overflow:"auto"}},ve=["onClick"],me={style:{color:"#1890ff"}},pe={class:"own"},fe=z(()=>t("div",{style:{height:"8.2rem"}},null,-1)),he={class:"order-footer"},ge={class:"input-btn"},be={class:"order-btn"},ke={__name:"order",setup(u){j();const e=y({balance:0,count:0,total:0}),g=y([]),c=()=>{P().then(o=>{o.data.bank_list.forEach(i=>{i.is_check&&(a.value.merchant_bank_id=i.id)}),a.value.merchant_bank_id||(a.value.merchant_bank_id=o.data.bank_list[0].id),g.value=o.data.bank_list,e.value.balance=o.data.balance}),X().then(o=>{e.value=Object.assign(e.value,o.data)})};c();const a=y({merchant_bank_id:"",amount:""}),h=o=>{a.value.merchant_bank_id=o.id},x=()=>{if(a.value.amount=Math.floor(a.value.amount*100)/100,+a.value.amount<=0)return a.value.amount="",$.error("提现金额必须大于0");if(+a.value.amount>+e.value.balance)return a.value.amount=e.value.balance,$.error("提现金额不能大于余额");Z(a.value).then(o=>{a.value.amount="",$.success("提现成功,等待管理员审核"),D.emit("get-taking-lists"),c()})};return(o,i)=>{const b=p("el-input"),M=p("el-button");return s(),f("div",ae,[t("div",te,[le,t("div",ne,[t("div",oe,[se,t("div",ie,[t("span",null,m(e.value.balance),1),d("元 ")])]),t("div",re,[t("div",de,[d("提现次数: "),t("span",null,m(e.value.count),1),d("次")]),t("div",ue,[d("累计提现到账: "),t("span",ce,m(e.value.total),1),d("元")])])])]),t("div",_e,[(s(!0),f(E,null,F(g.value,(_,C)=>(s(),f("div",{class:q(["item",{"item-active":a.value.merchant_bank_id==_.id}]),key:C,onClick:v=>h(_)},[t("div",null,[d(" 提现至 "),t("span",me,m(_.bank_name)+"("+m(_.bank_code.slice(-4))+")",1),t("span",pe,m(_.is_own==1?"对公":"个人"),1)])],10,ve))),128))]),fe,t("div",he,[t("div",ge,[l(b,{modelValue:a.value.amount,"onUpdate:modelValue":i[0]||(i[0]=_=>a.value.amount=_),placeholder:"请输入提现金额",type:"number"},null,8,["modelValue"]),l(M,{class:"btn",type:"primary",onClick:i[1]||(i[1]=_=>a.value.amount=e.value.balance)},{default:r(()=>[d("全部")]),_:1})]),t("div",be,[l(M,{class:"btn",type:"primary",onClick:x,disabled:e.value.balance<=0||g.value.length==0},{default:r(()=>[d("立即提现")]),_:1},8,["disabled"])])])])}}},ye=B(ke,[["__scopeId","data-v-e01d9d71"]]),we={class:"my-order"},Ve={class:"date"},Me={class:"detail"},Ye={key:0,class:"table",":infinite-scroll-delay":500,"infinite-scroll-distance":300,style:{overflow:"auto"},"infinite-scroll-immediate":!1},$e={key:0},xe={key:1},Ce={key:1,class:"table",":infinite-scroll-delay":500,"infinite-scroll-distance":300,style:{overflow:"auto"},"infinite-scroll-immediate":!1},De={__name:"detail",setup(u){const e=y({page_no:1,page_size:15,loadend:!1,loading:!1,create_time:"",start_time:""}),g=()=>{e.value.page_no=1,e.value.loadend=!1,e.value.loading=!1,a.value=[],h()},c=y(1),a=y([]),h=()=>{if(console.log("触底",!e.value.loadend,!e.value.loading),!e.value.loadend&&!e.value.loading&&(console.log("加载"),e.value.loading=!0,c.value==1&&Q({page_no:e.value.page_no,page_size:e.value.page_size,create_time:e.value.create_time}).then(o=>{a.value=[...a.value,...o.data.lists],o.data.lists.length=e.value.start_time[1])return e.value.loading=!1,$.error("开始时间不能大于等于结束时间");let o=e.value.start_time[0]?T(e.value.start_time[0]).format("YYYY-MM-DD"):"",i=e.value.start_time[1]?T(e.value.start_time[1]).format("YYYY-MM-DD"):"";ee({page_no:e.value.page_no,page_size:e.value.page_size,start_time:o,end_time:i}).then(b=>{a.value=[...a.value,...b.data.lists],b.data.lists.length{e.value.page_no=1,e.value.loadend=!1,e.value.loading=!1,a.value=[],h()};return W(()=>{D.on("get-taking-lists",o=>{e.value.page_no=1,e.value.loadend=!1,e.value.loading=!1,a.value=[],h()})}),G(()=>{D.off("get-taking-lists")}),(o,i)=>{const b=p("el-date-picker"),M=p("el-button"),_=p("el-radio-button"),C=p("el-radio-group"),v=p("el-table-column"),O=p("el-image"),Y=p("el-tag"),I=p("el-table"),S=N("loading"),A=N("infinite-scroll");return s(),f("div",we,[t("div",Ve,[t("div",null,[c.value==1?(s(),k(b,{key:0,modelValue:e.value.create_time,"onUpdate:modelValue":i[0]||(i[0]=n=>e.value.create_time=n),type:"month",placeholder:"请选择月份",onChange:g,clearable:!1},null,8,["modelValue"])):w("",!0),c.value==2?(s(),k(b,{key:1,modelValue:e.value.start_time,"onUpdate:modelValue":i[1]||(i[1]=n=>e.value.start_time=n),type:"daterange",placeholder:"请选择日期",onChange:g,format:"YYYY-MM-DD",clearable:!1},null,8,["modelValue"])):w("",!0),l(M,{type:"primary",style:{"margin-left":"1rem"}},{default:r(()=>[d("重置")]),_:1})]),l(C,{modelValue:c.value,"onUpdate:modelValue":i[2]||(i[2]=n=>c.value=n),onChange:x},{default:r(()=>[l(_,{label:"提现记录",value:1}),l(_,{label:"余额明细",value:2})]),_:1},8,["modelValue"])]),t("div",Me,[c.value==1?U((s(),f("div",Ye,[l(I,{data:a.value},{default:r(()=>[l(v,{prop:"merchant_bank_info.is_own",label:"账户类型",width:"100"},{default:r(({row:n})=>[t("div",null,m(n.merchant_bank_info.is_own?"对公账户":"个人账户"),1)]),_:1}),l(v,{prop:"price",label:"银行卡"},{default:r(({row:n})=>[t("div",null,m(n.merchant_bank_info.bank_info.name)+" ("+m(n.merchant_bank_info.bank_code.slice(-4))+") ",1)]),_:1}),l(v,{prop:"amount",label:"提现金额",width:"150"}),l(v,{label:"备注/凭证",width:"200"},{default:r(({row:n})=>[n.arrival_proof?(s(),f("div",$e,[(s(!0),f(E,null,F(JSON.parse(n.arrival_proof),(R,L)=>(s(),k(O,{style:{width:"3rem",height:"3rem","margin-right":"0.2rem"},key:L,src:R,"preview-src-list":JSON.parse(n.arrival_proof),"initial-index":L},null,8,["src","preview-src-list","initial-index"]))),128))])):(s(),f("div",xe,m(n.fail_msg),1))]),_:1}),l(v,{label:"提现状态",width:"100"},{default:r(({row:n})=>[n.arrival_proof?(s(),k(Y,{key:0,type:"success"},{default:r(()=>[d("已到账")]),_:1})):n.is_check==1?(s(),k(Y,{key:1,type:"primary"},{default:r(()=>[d("待转账")]),_:1})):n.is_check==0?(s(),k(Y,{key:2,type:"info"},{default:r(()=>[d("待审核")]),_:1})):n.is_check==2?(s(),k(Y,{key:3,type:"danger"},{default:r(()=>[d("提现失败")]),_:1})):w("",!0)]),_:1}),l(v,{prop:"create_time",label:"提现时间",width:"200"})]),_:1},8,["data"])])),[[S,e.value.loading],[A,h]]):w("",!0),c.value==2?U((s(),f("div",Ce,[l(I,{data:a.value},{default:r(()=>[l(v,{prop:"number_sn",label:"订单号",width:"250"}),l(v,{prop:"number",label:"变动金额",width:"180"}),l(v,{prop:"financial_type",label:"变动类型",width:"180"}),l(v,{prop:"create_time",label:"时间"})]),_:1},8,["data"])])),[[S,e.value.loading],[A,h]]):w("",!0)])])}}},ze=B(De,[["__scopeId","data-v-b27fe34a"]]),Ie={class:"my-card"},Ne={__name:"index",setup(u){return(e,g)=>(s(),f("div",Ie,[l(ye,{style:{"flex-shrink":"0"},ref:"orderRef"},null,512),l(H),l(ze,{ref:"detailRef"},null,512)]))}};export{Ne as default}; +import{K as V,_ as B,u as j,r as y,b as p,c as s,k as f,e as t,t as m,g as d,F as E,l as F,z as q,f as l,w as r,E as $,m as D,q as J,s as K,o as W,a as G,h as N,d as k,p as w,j as U}from"./index-CEprPOh1.js";import{h as T}from"./moment-Cl4UOzQZ.js";import{p as H}from"./padding-Bq_IbaOz.js";function P(){return V.get("/merchant/Merchant/amount_account")}function Q(u){return V.get("/merchant/Merchant/taking_lists",{params:u})}function X(){return V.get("/merchant/Merchant/taking_info")}function Z(u){return V.post("/merchant/Merchant/withdraw",u)}function ee(u){return V.get("/financial/FinancialRecord/api_lists",{params:u})}const z=u=>(J("data-v-e01d9d71"),u=u(),K(),u),ae={class:"my-order"},te={class:"header-nav"},le=z(()=>t("div",{class:"nav-item"},m("提现"),-1)),ne={class:"nav-body"},oe={class:"my-money"},se=z(()=>t("div",null,"我的余额:",-1)),ie={style:{"text-align":"center",color:"#2ec479"}},re={class:"my-count"},de={class:"count"},ue={class:"money"},ce={style:{color:"#ff4a00"}},_e={class:"order-lists","infinite-scroll-distance":300,"infinite-scroll-delay":500,style:{overflow:"auto"}},ve=["onClick"],me={style:{color:"#1890ff"}},pe={class:"own"},fe=z(()=>t("div",{style:{height:"8.2rem"}},null,-1)),he={class:"order-footer"},ge={class:"input-btn"},be={class:"order-btn"},ke={__name:"order",setup(u){j();const e=y({balance:0,count:0,total:0}),g=y([]),c=()=>{P().then(o=>{o.data.bank_list.forEach(i=>{i.is_check&&(a.value.merchant_bank_id=i.id)}),a.value.merchant_bank_id||(a.value.merchant_bank_id=o.data.bank_list[0].id),g.value=o.data.bank_list,e.value.balance=o.data.balance}),X().then(o=>{e.value=Object.assign(e.value,o.data)})};c();const a=y({merchant_bank_id:"",amount:""}),h=o=>{a.value.merchant_bank_id=o.id},x=()=>{if(a.value.amount=Math.floor(a.value.amount*100)/100,+a.value.amount<=0)return a.value.amount="",$.error("提现金额必须大于0");if(+a.value.amount>+e.value.balance)return a.value.amount=e.value.balance,$.error("提现金额不能大于余额");Z(a.value).then(o=>{a.value.amount="",$.success("提现成功,等待管理员审核"),D.emit("get-taking-lists"),c()})};return(o,i)=>{const b=p("el-input"),M=p("el-button");return s(),f("div",ae,[t("div",te,[le,t("div",ne,[t("div",oe,[se,t("div",ie,[t("span",null,m(e.value.balance),1),d("元 ")])]),t("div",re,[t("div",de,[d("提现次数: "),t("span",null,m(e.value.count),1),d("次")]),t("div",ue,[d("累计提现到账: "),t("span",ce,m(e.value.total),1),d("元")])])])]),t("div",_e,[(s(!0),f(E,null,F(g.value,(_,C)=>(s(),f("div",{class:q(["item",{"item-active":a.value.merchant_bank_id==_.id}]),key:C,onClick:v=>h(_)},[t("div",null,[d(" 提现至 "),t("span",me,m(_.bank_name)+"("+m(_.bank_code.slice(-4))+")",1),t("span",pe,m(_.is_own==1?"对公":"个人"),1)])],10,ve))),128))]),fe,t("div",he,[t("div",ge,[l(b,{modelValue:a.value.amount,"onUpdate:modelValue":i[0]||(i[0]=_=>a.value.amount=_),placeholder:"请输入提现金额",type:"number"},null,8,["modelValue"]),l(M,{class:"btn",type:"primary",onClick:i[1]||(i[1]=_=>a.value.amount=e.value.balance)},{default:r(()=>[d("全部")]),_:1})]),t("div",be,[l(M,{class:"btn",type:"primary",onClick:x,disabled:e.value.balance<=0||g.value.length==0},{default:r(()=>[d("立即提现")]),_:1},8,["disabled"])])])])}}},ye=B(ke,[["__scopeId","data-v-e01d9d71"]]),we={class:"my-order"},Ve={class:"date"},Me={class:"detail"},Ye={key:0,class:"table",":infinite-scroll-delay":500,"infinite-scroll-distance":300,style:{overflow:"auto"},"infinite-scroll-immediate":!1},$e={key:0},xe={key:1},Ce={key:1,class:"table",":infinite-scroll-delay":500,"infinite-scroll-distance":300,style:{overflow:"auto"},"infinite-scroll-immediate":!1},De={__name:"detail",setup(u){const e=y({page_no:1,page_size:15,loadend:!1,loading:!1,create_time:"",start_time:""}),g=()=>{e.value.page_no=1,e.value.loadend=!1,e.value.loading=!1,a.value=[],h()},c=y(1),a=y([]),h=()=>{if(console.log("触底",!e.value.loadend,!e.value.loading),!e.value.loadend&&!e.value.loading&&(console.log("加载"),e.value.loading=!0,c.value==1&&Q({page_no:e.value.page_no,page_size:e.value.page_size,create_time:e.value.create_time}).then(o=>{a.value=[...a.value,...o.data.lists],o.data.lists.length=e.value.start_time[1])return e.value.loading=!1,$.error("开始时间不能大于等于结束时间");let o=e.value.start_time[0]?T(e.value.start_time[0]).format("YYYY-MM-DD"):"",i=e.value.start_time[1]?T(e.value.start_time[1]).format("YYYY-MM-DD"):"";ee({page_no:e.value.page_no,page_size:e.value.page_size,start_time:o,end_time:i}).then(b=>{a.value=[...a.value,...b.data.lists],b.data.lists.length{e.value.page_no=1,e.value.loadend=!1,e.value.loading=!1,a.value=[],h()};return W(()=>{D.on("get-taking-lists",o=>{e.value.page_no=1,e.value.loadend=!1,e.value.loading=!1,a.value=[],h()})}),G(()=>{D.off("get-taking-lists")}),(o,i)=>{const b=p("el-date-picker"),M=p("el-button"),_=p("el-radio-button"),C=p("el-radio-group"),v=p("el-table-column"),O=p("el-image"),Y=p("el-tag"),I=p("el-table"),S=N("loading"),A=N("infinite-scroll");return s(),f("div",we,[t("div",Ve,[t("div",null,[c.value==1?(s(),k(b,{key:0,modelValue:e.value.create_time,"onUpdate:modelValue":i[0]||(i[0]=n=>e.value.create_time=n),type:"month",placeholder:"请选择月份",onChange:g,clearable:!1},null,8,["modelValue"])):w("",!0),c.value==2?(s(),k(b,{key:1,modelValue:e.value.start_time,"onUpdate:modelValue":i[1]||(i[1]=n=>e.value.start_time=n),type:"daterange",placeholder:"请选择日期",onChange:g,format:"YYYY-MM-DD",clearable:!1},null,8,["modelValue"])):w("",!0),l(M,{type:"primary",style:{"margin-left":"1rem"}},{default:r(()=>[d("重置")]),_:1})]),l(C,{modelValue:c.value,"onUpdate:modelValue":i[2]||(i[2]=n=>c.value=n),onChange:x},{default:r(()=>[l(_,{label:"提现记录",value:1}),l(_,{label:"余额明细",value:2})]),_:1},8,["modelValue"])]),t("div",Me,[c.value==1?U((s(),f("div",Ye,[l(I,{data:a.value},{default:r(()=>[l(v,{prop:"merchant_bank_info.is_own",label:"账户类型",width:"100"},{default:r(({row:n})=>[t("div",null,m(n.merchant_bank_info.is_own?"对公账户":"个人账户"),1)]),_:1}),l(v,{prop:"price",label:"银行卡"},{default:r(({row:n})=>[t("div",null,m(n.merchant_bank_info.bank_info.name)+" ("+m(n.merchant_bank_info.bank_code.slice(-4))+") ",1)]),_:1}),l(v,{prop:"amount",label:"提现金额",width:"150"}),l(v,{label:"备注/凭证",width:"200"},{default:r(({row:n})=>[n.arrival_proof?(s(),f("div",$e,[(s(!0),f(E,null,F(JSON.parse(n.arrival_proof),(R,L)=>(s(),k(O,{style:{width:"3rem",height:"3rem","margin-right":"0.2rem"},key:L,src:R,"preview-src-list":JSON.parse(n.arrival_proof),"initial-index":L},null,8,["src","preview-src-list","initial-index"]))),128))])):(s(),f("div",xe,m(n.fail_msg),1))]),_:1}),l(v,{label:"提现状态",width:"100"},{default:r(({row:n})=>[n.arrival_proof?(s(),k(Y,{key:0,type:"success"},{default:r(()=>[d("已到账")]),_:1})):n.is_check==1?(s(),k(Y,{key:1,type:"primary"},{default:r(()=>[d("待转账")]),_:1})):n.is_check==0?(s(),k(Y,{key:2,type:"info"},{default:r(()=>[d("待审核")]),_:1})):n.is_check==2?(s(),k(Y,{key:3,type:"danger"},{default:r(()=>[d("提现失败")]),_:1})):w("",!0)]),_:1}),l(v,{prop:"create_time",label:"提现时间",width:"200"})]),_:1},8,["data"])])),[[S,e.value.loading],[A,h]]):w("",!0),c.value==2?U((s(),f("div",Ce,[l(I,{data:a.value},{default:r(()=>[l(v,{prop:"number_sn",label:"订单号",width:"250"}),l(v,{prop:"number",label:"变动金额",width:"180"}),l(v,{prop:"financial_type",label:"变动类型",width:"180"}),l(v,{prop:"create_time",label:"时间"})]),_:1},8,["data"])])),[[S,e.value.loading],[A,h]]):w("",!0)])])}}},ze=B(De,[["__scopeId","data-v-b27fe34a"]]),Ie={class:"my-card"},Ne={__name:"index",setup(u){return(e,g)=>(s(),f("div",Ie,[l(ye,{style:{"flex-shrink":"0"},ref:"orderRef"},null,512),l(H),l(ze,{ref:"detailRef"},null,512)]))}};export{Ne as default}; diff --git a/build/assets/index-Cjszd1YP.css b/build/assets/index-Bmm-phAE.css similarity index 84% rename from build/assets/index-Cjszd1YP.css rename to build/assets/index-Bmm-phAE.css index 32bbbe5..d2d2cec 100644 --- a/build/assets/index-Cjszd1YP.css +++ b/build/assets/index-Bmm-phAE.css @@ -1 +1 @@ -@charset "UTF-8";.my-order[data-v-bf6504fc]{border-radius:1.2rem;height:100%;background-color:#fff;width:30rem;position:relative;overflow:hidden}.my-order .header-nav[data-v-bf6504fc]{display:flex;flex-direction:column;justify-content:space-between;padding:1rem;height:3.5rem}.my-order .header-nav span[data-v-bf6504fc]{color:#ff4a00}.my-order .header-nav .nav-item[data-v-bf6504fc]{font-weight:700}.my-order .header-nav .nav-item-btn[data-v-bf6504fc]{display:flex;justify-content:space-between;align-items:center}.my-order .header-input[data-v-bf6504fc]{padding:1rem;padding-top:0;height:2.5rem;border-bottom:.0625rem solid #eee}.my-order .order-lists[data-v-bf6504fc]{height:calc(100vh - 16.45rem);overflow-y:auto}.my-order .order-lists .item[data-v-bf6504fc]{padding:1rem;border-bottom:.0625rem solid #eee}.my-order .order-lists .item .top[data-v-bf6504fc]{display:flex;justify-content:space-between;align-items:flex-end}.my-order .order-lists .item .top .sn[data-v-bf6504fc]{font-weight:700;font-size:.9rem}.my-order .order-lists .item .top .cahier[data-v-bf6504fc]:before{content:"收银";font-weight:400;font-size:.7rem;padding:.1rem;margin-right:.2rem;border:.0625rem solid #2ec479;color:#2ec479;border-radius:.187rem}.my-order .order-lists .item .top .cahier2[data-v-bf6504fc]:before{content:"平台";font-weight:400;font-size:.7rem;padding:.1rem;margin-right:.2rem;border:.0625rem solid #ff4a00;color:#ff4a00;border-radius:.187rem}.my-order .order-lists .item .top .create-time[data-v-bf6504fc]{font-size:.8rem}.my-order .order-lists .item .shop[data-v-bf6504fc]{display:flex;justify-content:space-between}.my-order .order-lists .item .shop .right[data-v-bf6504fc]{flex-shrink:0;display:flex;flex-direction:column;justify-content:center}.my-order .order-lists .item .shop .right .money[data-v-bf6504fc]{font-size:1rem;color:#ff4a00;font-weight:700}.my-order .order-lists .item .shop .right .count[data-v-bf6504fc]{font-size:.7rem;color:#999}.my-order .order-lists .item .shop .left[data-v-bf6504fc]{height:4.5rem;display:flex;align-items:center}.my-order .order-lists .item .shop .left .shop-img[data-v-bf6504fc]{width:3.5rem;height:3.5rem;border-radius:.3rem;margin-right:.4rem}.my-order .order-lists .item .shop .left .shop-name[data-v-bf6504fc]{font-size:.9rem;color:#333;display:-webkit-box;-webkit-box-orient:vertical;overflow:hidden;-webkit-line-clamp:3}.my-order .order-lists .item .bottom[data-v-bf6504fc]{display:flex;justify-content:space-between;font-size:.9rem;color:#777}.my-order .order-lists .item .bottom .manage-btn[data-v-bf6504fc]{color:#fff;background-color:#e6a23c;border-radius:.2rem;padding:0 .2rem;margin-left:.5rem}.my-order .order-lists .item-active[data-v-bf6504fc]{background-color:#efefef}.my-order .load-end[data-v-bf6504fc]{text-align:center;padding:1rem;color:#333;font-size:.8rem}.my-order[data-v-f6cf175a]{border-radius:1.2rem;height:100%;flex:1;background-color:#fff;position:relative;overflow:hidden}.my-order .detail[data-v-f6cf175a]{height:100%;box-sizing:border-box;position:relative}.my-order .detail .table[data-v-f6cf175a]{padding:1rem;overflow-y:auto;height:100%}.my-order .detail .table .table-title[data-v-f6cf175a]{font-weight:700}.my-order .detail .table .table-info[data-v-f6cf175a]{display:flex;flex-wrap:wrap;color:#777;font-size:.9rem;padding-bottom:1rem;margin-bottom:1rem;border-bottom:.0625rem solid #eee}.my-order .detail .table .table-info[data-v-f6cf175a]:last-child{border-bottom:none}.my-order .detail .table .table-info .info-item[data-v-f6cf175a]{width:33%;display:flex;padding-top:1rem}.my-order .detail .table .table-info .info-item .info-item-title[data-v-f6cf175a]{flex-shrink:0;padding-right:1rem}.my-order .detail .footer[data-v-f6cf175a]{position:absolute;bottom:0;left:0;z-index:1;width:100%;height:6rem;box-sizing:border-box;background-color:#fff;display:flex;justify-content:flex-end;align-items:center;padding:0 2rem;border-top:.0625rem solid #eee}.my-card{display:flex}::-webkit-scrollbar{width:.315rem}::-webkit-scrollbar-track{background-color:#f1f1f1}::-webkit-scrollbar-thumb{background-color:#ccc;border-radius:.315rem}::-webkit-scrollbar-thumb:hover{background-color:#999} +@charset "UTF-8";.my-order[data-v-bf6504fc]{border-radius:1.2rem;height:100%;background-color:#fff;width:30rem;position:relative;overflow:hidden}.my-order .header-nav[data-v-bf6504fc]{display:flex;flex-direction:column;justify-content:space-between;padding:1rem;height:3.5rem}.my-order .header-nav span[data-v-bf6504fc]{color:#ff4a00}.my-order .header-nav .nav-item[data-v-bf6504fc]{font-weight:700}.my-order .header-nav .nav-item-btn[data-v-bf6504fc]{display:flex;justify-content:space-between;align-items:center}.my-order .header-input[data-v-bf6504fc]{padding:1rem;padding-top:0;height:2.5rem;border-bottom:.0625rem solid #eee}.my-order .order-lists[data-v-bf6504fc]{height:calc(100vh - 16.45rem);overflow-y:auto}.my-order .order-lists .item[data-v-bf6504fc]{padding:1rem;border-bottom:.0625rem solid #eee}.my-order .order-lists .item .top[data-v-bf6504fc]{display:flex;justify-content:space-between;align-items:flex-end}.my-order .order-lists .item .top .sn[data-v-bf6504fc]{font-weight:700;font-size:.9rem}.my-order .order-lists .item .top .cahier[data-v-bf6504fc]:before{content:"收银";font-weight:400;font-size:.7rem;padding:.1rem;margin-right:.2rem;border:.0625rem solid #2ec479;color:#2ec479;border-radius:.187rem}.my-order .order-lists .item .top .cahier2[data-v-bf6504fc]:before{content:"平台";font-weight:400;font-size:.7rem;padding:.1rem;margin-right:.2rem;border:.0625rem solid #ff4a00;color:#ff4a00;border-radius:.187rem}.my-order .order-lists .item .top .create-time[data-v-bf6504fc]{font-size:.8rem}.my-order .order-lists .item .shop[data-v-bf6504fc]{display:flex;justify-content:space-between}.my-order .order-lists .item .shop .right[data-v-bf6504fc]{flex-shrink:0;display:flex;flex-direction:column;justify-content:center}.my-order .order-lists .item .shop .right .money[data-v-bf6504fc]{font-size:1rem;color:#ff4a00;font-weight:700}.my-order .order-lists .item .shop .right .count[data-v-bf6504fc]{font-size:.7rem;color:#999}.my-order .order-lists .item .shop .left[data-v-bf6504fc]{height:4.5rem;display:flex;align-items:center}.my-order .order-lists .item .shop .left .shop-img[data-v-bf6504fc]{width:3.5rem;height:3.5rem;border-radius:.3rem;margin-right:.4rem}.my-order .order-lists .item .shop .left .shop-name[data-v-bf6504fc]{font-size:.9rem;color:#333;display:-webkit-box;-webkit-box-orient:vertical;overflow:hidden;-webkit-line-clamp:3}.my-order .order-lists .item .bottom[data-v-bf6504fc]{display:flex;justify-content:space-between;font-size:.9rem;color:#777}.my-order .order-lists .item .bottom .manage-btn[data-v-bf6504fc]{color:#fff;background-color:#e6a23c;border-radius:.2rem;padding:0 .2rem;margin-left:.5rem}.my-order .order-lists .item-active[data-v-bf6504fc]{background-color:#efefef}.my-order .load-end[data-v-bf6504fc]{text-align:center;padding:1rem;color:#333;font-size:.8rem}.my-order[data-v-8ba192bc]{border-radius:1.2rem;height:100%;flex:1;background-color:#fff;position:relative;overflow:hidden}.my-order .detail[data-v-8ba192bc]{height:100%;box-sizing:border-box;position:relative}.my-order .detail .table[data-v-8ba192bc]{padding:1rem;overflow-y:auto;height:100%}.my-order .detail .table .table-title[data-v-8ba192bc]{font-weight:700}.my-order .detail .table .table-info[data-v-8ba192bc]{display:flex;flex-wrap:wrap;color:#777;font-size:.9rem;padding-bottom:1rem;margin-bottom:1rem;border-bottom:.0625rem solid #eee}.my-order .detail .table .table-info[data-v-8ba192bc]:last-child{border-bottom:none}.my-order .detail .table .table-info .info-item[data-v-8ba192bc]{width:33%;display:flex;padding-top:1rem}.my-order .detail .table .table-info .info-item .info-item-title[data-v-8ba192bc]{flex-shrink:0;padding-right:1rem}.my-order .detail .footer[data-v-8ba192bc]{position:absolute;bottom:0;left:0;z-index:1;width:100%;height:6rem;box-sizing:border-box;background-color:#fff;display:flex;justify-content:flex-end;align-items:center;padding:0 2rem;border-top:.0625rem solid #eee}.my-card{display:flex}::-webkit-scrollbar{width:.315rem}::-webkit-scrollbar-track{background-color:#f1f1f1}::-webkit-scrollbar-thumb{background-color:#ccc;border-radius:.315rem}::-webkit-scrollbar-thumb:hover{background-color:#999} diff --git a/build/assets/index-BxvPYzrA.js b/build/assets/index-CEe2BLLq.js similarity index 98% rename from build/assets/index-BxvPYzrA.js rename to build/assets/index-CEe2BLLq.js index d52aeb3..53ef70f 100644 --- a/build/assets/index-BxvPYzrA.js +++ b/build/assets/index-CEe2BLLq.js @@ -1 +1 @@ -import{_ as E,u as K,r as n,o as P,m as w,a as j,b as r,h as x,c as s,k as i,e,f as d,w as c,g,d as B,p as k,i as ie,j as L,F,l as O,z as R,t as l,q,s as G,I as le}from"./index-B9unL6O8.js";import{d as ne,f as de}from"./store-DNW8I_iw.js";import{h as A}from"./moment-Cl4UOzQZ.js";/* empty css */import{p as _e}from"./padding-DLHwO6AB.js";const H=m=>(q("data-v-d16a314c"),m=m(),G(),m),ce={class:"my-order"},re={class:"header-nav"},ue=H(()=>e("div",{class:"nav-item"},l("线上订单"),-1)),ve={class:"nav-item-btn"},pe={class:"header-input"},fe={class:"order-lists","infinite-scroll-distance":300,"infinite-scroll-delay":500,style:{overflow:"auto"}},me=["onClick"],he={class:"top"},ye={class:"create-time"},ge={class:"shop"},ke={key:0,class:"left"},$e={key:0,class:"shop-name"},be={class:"right"},we={class:"money"},Ce={class:"count"},Ve={class:"bottom"},De={class:"pay"},Ye={key:0},xe={key:1},ze={key:2},Ie={key:3},Se={key:4},Me={key:5},Ue={key:1,style:{color:"#ff4a00"}},Be={key:0,class:"load-end"},Le={key:1,class:"load-end"},Ne=H(()=>e("span",null,"您有新订单了, 是否立即刷新",-1)),Te={class:"dialog-footer"},Fe={__name:"order",props:{isSystem:{type:Boolean,default:!1},source:{type:Number,default:1}},setup(m){K(),n([]);const o=n(1),C=p=>{_.value.page_no=1,f.value=!1,u.value=!1,h.value=[],y(!0)};n(null);const $=n(""),z=()=>{_.value.start_time=A($.value[0]).format("YYYY-MM-DD 00:00:00"),_.value.end_time=A($.value[1]).format("YYYY-MM-DD 23:59:59"),y(!0)},I=p=>p.getTime()>Date.now(),_=n({page_no:1,page_size:20,order_id:"",start_time:"",end_time:"",is_sashier:2}),u=n(!1),N=n(0),V=n(0),f=n(!1),h=n([]),y=(p=!1)=>{if(p)_.value.page_no=1;else if(f.value||u.value)return;u.value=!0,o.value==1&&(_.value.paid=null),o.value==2&&(_.value.paid=0),ne(_.value).then(a=>{p?h.value=a.data.lists:h.value=[...h.value,...a.data.lists],_.value.page_no==1&&h.value.length>0&&w.emit("set-sale-order-detail",h.value[0]),a.data.lists.length<_.value.page_size?f.value=!0:_.value.page_no++,V.value=0,N.value=a.data.count,u.value=!1}).catch(a=>{f.value=!0,u.value=!1})},S=(p,a)=>{V.value=a,w.emit("set-sale-order-detail",p)},b=n(!1);return P(()=>{w.on("update-sale-order-detail",p=>{console.log("==="),h.value[V.value].paid=1}),w.on("new_order",()=>{b.value||(b.value=!0)})}),j(()=>{w.off("update-sale-order-detail"),w.off("new_order")}),(p,a)=>{const D=r("el-radio-button"),Y=r("el-radio-group"),J=r("el-date-picker"),Q=r("CircleClose"),W=r("el-icon"),M=r("el-button"),X=r("el-input"),Z=r("el-image"),ee=r("spna"),te=r("el-dialog"),se=x("loading"),oe=x("infinite-scroll");return s(),i("div",ce,[e("div",re,[ue,e("div",ve,[d(Y,{modelValue:o.value,"onUpdate:modelValue":a[0]||(a[0]=t=>o.value=t),onChange:C,size:"small"},{default:c(()=>[d(D,{value:1},{default:c(()=>[g("全部")]),_:1}),d(D,{value:2},{default:c(()=>[g("未支付")]),_:1})]),_:1},8,["modelValue"]),d(J,{modelValue:$.value,"onUpdate:modelValue":a[1]||(a[1]=t=>$.value=t),type:"daterange","start-placeholder":"开始时间","end-placeholder":"结束时间",size:"small","value-format":"YYYY/MM/DD","disabled-date":I,onChange:z,clearable:!1,style:{width:"10rem",margin:"0 0 0 1rem"}},null,8,["modelValue"])])]),e("div",pe,[d(X,{modelValue:_.value.order_id,"onUpdate:modelValue":a[4]||(a[4]=t=>_.value.order_id=t),placeholder:"请输入订单编号",onKeydown:a[5]||(a[5]=ie(t=>y(!0),["enter"])),onClear:a[6]||(a[6]=t=>y(!0))},{suffix:c(()=>[_.value.order_id!=""?(s(),B(W,{key:0,size:"18",onClick:a[2]||(a[2]=t=>{_.value.order_id="",y(!0)}),style:{cursor:"pointer","margin-right":"0.5rem"}},{default:c(()=>[d(Q)]),_:1})):k("",!0)]),append:c(()=>[d(M,{type:"primary",style:{"background-color":"#1890ff",color:"#fff","border-radius":"0 0.315rem 0.315rem 0"},onClick:a[3]||(a[3]=t=>y(!0))},{default:c(()=>[g("搜索")]),_:1})]),_:1},8,["modelValue"])]),L((s(),i("div",fe,[(s(!0),i(F,null,O(h.value,(t,U)=>(s(),i("div",{class:R(["item",{"item-active":V.value==U}]),key:U,onClick:T=>S(t,U)},[e("div",he,[e("div",{class:R(["sn","cahier"])},"单号: "+l(t.order_id),1),e("div",ye,l(t.pay_time),1)]),e("div",ge,[t.product_info?(s(),i("div",ke,[(s(!0),i(F,null,O(t.product_info.slice(0,5),(T,ae)=>(s(),B(Z,{key:ae,src:T.image,class:"shop-img"},null,8,["src"]))),128)),t.product_info.length==1?(s(),i("div",$e,l(t.product_info[0].store_name),1)):k("",!0)])):k("",!0),e("div",be,[e("div",we,"¥"+l(t.pay_price),1),e("div",Ce,"共"+l(t.total_num)+"款商品",1)])]),e("div",Ve,[e("div",De,[t.paid?(s(),i("div",Ye,[g(l(t.paid_name)+" ",1),t.pay_type_name?(s(),B(ee,{key:0},{default:c(()=>[g("("+l(t.pay_type_name)+")",1)]),_:2},1024)):t.pay_type==9?(s(),i("span",xe,"(微信收款)")):t.pay_type==17?(s(),i("span",ze,"(现金支付)")):t.pay_type==13?(s(),i("span",Ie,"(支付宝收款)")):t.pay_type==3?(s(),i("span",Se,"(余额支付)")):t.pay_type==1?(s(),i("span",Me,"(微信支付)")):k("",!0)])):(s(),i("div",Ue,l(t.paid_name),1))])])],10,me))),128)),f.value?(s(),i("div",Be,"没有更多了")):k("",!0),u.value?(s(),i("div",Le,"加载中...")):k("",!0)])),[[se,u.value],[oe,y]]),d(te,{modelValue:b.value,"onUpdate:modelValue":a[9]||(a[9]=t=>b.value=t),title:"新订单提醒",width:"500"},{footer:c(()=>[e("div",Te,[d(M,{onClick:a[7]||(a[7]=t=>b.value=!1)},{default:c(()=>[g("稍后刷新")]),_:1}),d(M,{type:"primary",onClick:a[8]||(a[8]=t=>{y(!0),b.value=!1})},{default:c(()=>[g(" 立即刷新 ")]),_:1})])]),default:c(()=>[Ne]),_:1},8,["modelValue"])])}}},Oe=E(Fe,[["__scopeId","data-v-d16a314c"]]),v=m=>(q("data-v-b30acb5e"),m=m(),G(),m),Re={class:"my-order"},Ae={key:0,class:"detail"},Ee={class:"table","infinite-scroll-distance":300,"infinite-scroll-delay":300,style:{overflow:"auto"},"infinite-scroll-immediate":!1},Ke=v(()=>e("div",{class:"table-title"},"订单信息",-1)),Pe={class:"table-info"},je={class:"info-item"},qe=v(()=>e("div",{class:"info-item-title"},"订单编号:",-1)),Ge={class:"info-item-info"},He={class:"info-item"},Je=v(()=>e("div",{class:"info-item-title"},"商品款数:",-1)),Qe={class:"info-item-info"},We={class:"info-item"},Xe=v(()=>e("div",{class:"info-item-title"},"商品总价:",-1)),Ze={class:"info-item-info"},et={class:"info-item"},tt=v(()=>e("div",{class:"info-item-title"},"创建时间:",-1)),st={class:"info-item-info"},ot={class:"info-item"},at=v(()=>e("div",{class:"info-item-title"},"优惠抵扣:",-1)),it={class:"info-item-info"},lt={class:"info-item"},nt=v(()=>e("div",{class:"info-item-title"},"实际支付:",-1)),dt={class:"info-item-info"},_t={class:"info-item"},ct=v(()=>e("div",{class:"info-item-title"},"支付时间:",-1)),rt={class:"info-item-info"},ut={class:"info-item"},vt=v(()=>e("div",{class:"info-item-title"},"支付方式:",-1)),pt={class:"info-item-info"},ft={key:0},mt={key:1},ht={key:2},yt={key:3},gt={key:4},kt={key:5},$t={key:0,class:"table-title"},bt={key:1,class:"table-info"},wt={class:"info-item"},Ct=v(()=>e("div",{class:"info-item-title"},"用户ID:",-1)),Vt={class:"info-item-info"},Dt={class:"info-item"},Yt=v(()=>e("div",{class:"info-item-title"},"用户昵称:",-1)),xt={class:"info-item-info"},zt={class:"info-item"},It=v(()=>e("div",{class:"info-item-title"},"用户电话:",-1)),St={class:"info-item-info"},Mt={style:{"font-size":"0.9rem"}},Ut={style:{color:"#ff4a00"}},Bt={style:{display:"flex","align-items":"center"}},Lt={style:{"margin-left":"0.5rem"}},Nt=v(()=>e("div",{style:{height:"8rem"}},null,-1)),Tt={key:1},Ft={__name:"detail",setup(m){K(),le();const o=n({id:""});n([]),n(null);const C=n(!1);n(0),n(0),n(["商品信息","订单详情"]),n(""),n(!1);const $=n({page_no:1,page_size:15,loadend:!1,loading:!1}),z=n([]),I=()=>console.log("触底"),_=()=>{C.value=!0,de({id:o.value.id}).then(u=>{o.value=u.data,setTimeout(()=>{C.value=!1},200)})};return P(()=>{w.on("set-sale-order-detail",u=>{console.log("===",u),o.value=u,$.value.page_no=1,$.value.loadend=!1,$.value.loading=!1,z.value=[],_()})}),j(()=>{w.off("set-sale-order-detail")}),(u,N)=>{var p;const V=r("el-image"),f=r("el-table-column"),h=r("el-table"),y=r("el-empty"),S=x("infinite-scroll"),b=x("loading");return s(),i("div",Re,[o.value.id?L((s(),i("div",Ae,[L((s(),i("div",Ee,[Ke,e("div",Pe,[e("div",je,[qe,e("div",Ge,l(o.value.order_id),1)]),e("div",He,[Je,e("div",Qe,l(o.value.total_num||0),1)]),e("div",We,[Xe,e("div",Ze,"¥"+l(o.value.total_price),1)]),e("div",et,[tt,e("div",st,l(o.value.pay_time),1)]),e("div",ot,[at,e("div",it,"¥"+l(o.value.deduction_price),1)]),e("div",lt,[nt,e("div",dt,"¥"+l(o.value.pay_price),1)]),e("div",_t,[ct,e("div",rt,l(o.value.pay_time),1)]),e("div",ut,[vt,e("div",pt,[o.value.pay_type_name?(s(),i("span",ft,l(o.value.pay_type_name),1)):o.value.pay_type==9?(s(),i("span",mt,"微信收款")):o.value.pay_type==17?(s(),i("span",ht,"现金支付")):o.value.pay_type==13?(s(),i("span",yt,"支付宝收款")):o.value.pay_type==3?(s(),i("span",gt,"余额支付")):o.value.pay_type==1?(s(),i("span",kt,"微信支付")):k("",!0)])])]),o.value.uid?(s(),i("div",$t,"用户信息")):k("",!0),o.value.uid?(s(),i("div",bt,[e("div",wt,[Ct,e("div",Vt,l(o.value.uid),1)]),e("div",Dt,[Yt,e("div",xt,l(o.value.nickname),1)]),e("div",zt,[It,e("div",St,l(o.value.mobile),1)])])):k("",!0),e("div",Mt,[g(" 共计 "),e("span",Ut,l(((p=o.value.product)==null?void 0:p.length)||" "),1),g(" 款商品 ")]),d(h,{data:o.value.product},{default:c(()=>[d(f,{label:"商品信息"},{default:c(({row:a})=>{var D,Y;return[e("div",Bt,[d(V,{style:{height:"3rem",width:"3rem","flex-shrink":"0"},src:(D=a.cart_info)==null?void 0:D.image},null,8,["src"]),e("span",Lt,l((Y=a.cart_info)==null?void 0:Y.name),1)])]}),_:1}),d(f,{prop:"cart_info.store_info",label:"商品规格",width:"150"}),d(f,{prop:"cart_info.price",label:"单价",width:"150"}),d(f,{prop:"cart_info.cart_num",label:"数量",width:"150"}),d(f,{prop:"cart_info.pay_price",label:"总价",width:"150"})]),_:1},8,["data"]),Nt])),[[S,I]])])),[[b,C.value]]):(s(),i("div",Tt,[d(y)]))])}}},Ot=E(Ft,[["__scopeId","data-v-b30acb5e"]]),Rt={class:"my-card"},qt={__name:"index",setup(m){return(o,C)=>(s(),i("div",Rt,[d(Oe,{style:{"flex-shrink":"0"},ref:"orderRef"},null,512),d(_e),d(Ot,{ref:"detailRef"},null,512)]))}};export{qt as default}; +import{_ as E,u as K,r as n,o as P,m as w,a as j,b as r,h as x,c as s,k as i,e,f as d,w as c,g,d as B,p as k,i as ie,j as L,F,l as O,z as R,t as l,q,s as G,I as le}from"./index-CEprPOh1.js";import{d as ne,f as de}from"./store-BoFe3Agt.js";import{h as A}from"./moment-Cl4UOzQZ.js";/* empty css */import{p as _e}from"./padding-Bq_IbaOz.js";const H=m=>(q("data-v-d16a314c"),m=m(),G(),m),ce={class:"my-order"},re={class:"header-nav"},ue=H(()=>e("div",{class:"nav-item"},l("线上订单"),-1)),ve={class:"nav-item-btn"},pe={class:"header-input"},fe={class:"order-lists","infinite-scroll-distance":300,"infinite-scroll-delay":500,style:{overflow:"auto"}},me=["onClick"],he={class:"top"},ye={class:"create-time"},ge={class:"shop"},ke={key:0,class:"left"},$e={key:0,class:"shop-name"},be={class:"right"},we={class:"money"},Ce={class:"count"},Ve={class:"bottom"},De={class:"pay"},Ye={key:0},xe={key:1},ze={key:2},Ie={key:3},Se={key:4},Me={key:5},Ue={key:1,style:{color:"#ff4a00"}},Be={key:0,class:"load-end"},Le={key:1,class:"load-end"},Ne=H(()=>e("span",null,"您有新订单了, 是否立即刷新",-1)),Te={class:"dialog-footer"},Fe={__name:"order",props:{isSystem:{type:Boolean,default:!1},source:{type:Number,default:1}},setup(m){K(),n([]);const o=n(1),C=p=>{_.value.page_no=1,f.value=!1,u.value=!1,h.value=[],y(!0)};n(null);const $=n(""),z=()=>{_.value.start_time=A($.value[0]).format("YYYY-MM-DD 00:00:00"),_.value.end_time=A($.value[1]).format("YYYY-MM-DD 23:59:59"),y(!0)},I=p=>p.getTime()>Date.now(),_=n({page_no:1,page_size:20,order_id:"",start_time:"",end_time:"",is_sashier:2}),u=n(!1),N=n(0),V=n(0),f=n(!1),h=n([]),y=(p=!1)=>{if(p)_.value.page_no=1;else if(f.value||u.value)return;u.value=!0,o.value==1&&(_.value.paid=null),o.value==2&&(_.value.paid=0),ne(_.value).then(a=>{p?h.value=a.data.lists:h.value=[...h.value,...a.data.lists],_.value.page_no==1&&h.value.length>0&&w.emit("set-sale-order-detail",h.value[0]),a.data.lists.length<_.value.page_size?f.value=!0:_.value.page_no++,V.value=0,N.value=a.data.count,u.value=!1}).catch(a=>{f.value=!0,u.value=!1})},S=(p,a)=>{V.value=a,w.emit("set-sale-order-detail",p)},b=n(!1);return P(()=>{w.on("update-sale-order-detail",p=>{console.log("==="),h.value[V.value].paid=1}),w.on("new_order",()=>{b.value||(b.value=!0)})}),j(()=>{w.off("update-sale-order-detail"),w.off("new_order")}),(p,a)=>{const D=r("el-radio-button"),Y=r("el-radio-group"),J=r("el-date-picker"),Q=r("CircleClose"),W=r("el-icon"),M=r("el-button"),X=r("el-input"),Z=r("el-image"),ee=r("spna"),te=r("el-dialog"),se=x("loading"),oe=x("infinite-scroll");return s(),i("div",ce,[e("div",re,[ue,e("div",ve,[d(Y,{modelValue:o.value,"onUpdate:modelValue":a[0]||(a[0]=t=>o.value=t),onChange:C,size:"small"},{default:c(()=>[d(D,{value:1},{default:c(()=>[g("全部")]),_:1}),d(D,{value:2},{default:c(()=>[g("未支付")]),_:1})]),_:1},8,["modelValue"]),d(J,{modelValue:$.value,"onUpdate:modelValue":a[1]||(a[1]=t=>$.value=t),type:"daterange","start-placeholder":"开始时间","end-placeholder":"结束时间",size:"small","value-format":"YYYY/MM/DD","disabled-date":I,onChange:z,clearable:!1,style:{width:"10rem",margin:"0 0 0 1rem"}},null,8,["modelValue"])])]),e("div",pe,[d(X,{modelValue:_.value.order_id,"onUpdate:modelValue":a[4]||(a[4]=t=>_.value.order_id=t),placeholder:"请输入订单编号",onKeydown:a[5]||(a[5]=ie(t=>y(!0),["enter"])),onClear:a[6]||(a[6]=t=>y(!0))},{suffix:c(()=>[_.value.order_id!=""?(s(),B(W,{key:0,size:"18",onClick:a[2]||(a[2]=t=>{_.value.order_id="",y(!0)}),style:{cursor:"pointer","margin-right":"0.5rem"}},{default:c(()=>[d(Q)]),_:1})):k("",!0)]),append:c(()=>[d(M,{type:"primary",style:{"background-color":"#1890ff",color:"#fff","border-radius":"0 0.315rem 0.315rem 0"},onClick:a[3]||(a[3]=t=>y(!0))},{default:c(()=>[g("搜索")]),_:1})]),_:1},8,["modelValue"])]),L((s(),i("div",fe,[(s(!0),i(F,null,O(h.value,(t,U)=>(s(),i("div",{class:R(["item",{"item-active":V.value==U}]),key:U,onClick:T=>S(t,U)},[e("div",he,[e("div",{class:R(["sn","cahier"])},"单号: "+l(t.order_id),1),e("div",ye,l(t.pay_time),1)]),e("div",ge,[t.product_info?(s(),i("div",ke,[(s(!0),i(F,null,O(t.product_info.slice(0,5),(T,ae)=>(s(),B(Z,{key:ae,src:T.image,class:"shop-img"},null,8,["src"]))),128)),t.product_info.length==1?(s(),i("div",$e,l(t.product_info[0].store_name),1)):k("",!0)])):k("",!0),e("div",be,[e("div",we,"¥"+l(t.pay_price),1),e("div",Ce,"共"+l(t.total_num)+"款商品",1)])]),e("div",Ve,[e("div",De,[t.paid?(s(),i("div",Ye,[g(l(t.paid_name)+" ",1),t.pay_type_name?(s(),B(ee,{key:0},{default:c(()=>[g("("+l(t.pay_type_name)+")",1)]),_:2},1024)):t.pay_type==9?(s(),i("span",xe,"(微信收款)")):t.pay_type==17?(s(),i("span",ze,"(现金支付)")):t.pay_type==13?(s(),i("span",Ie,"(支付宝收款)")):t.pay_type==3?(s(),i("span",Se,"(余额支付)")):t.pay_type==1?(s(),i("span",Me,"(微信支付)")):k("",!0)])):(s(),i("div",Ue,l(t.paid_name),1))])])],10,me))),128)),f.value?(s(),i("div",Be,"没有更多了")):k("",!0),u.value?(s(),i("div",Le,"加载中...")):k("",!0)])),[[se,u.value],[oe,y]]),d(te,{modelValue:b.value,"onUpdate:modelValue":a[9]||(a[9]=t=>b.value=t),title:"新订单提醒",width:"500"},{footer:c(()=>[e("div",Te,[d(M,{onClick:a[7]||(a[7]=t=>b.value=!1)},{default:c(()=>[g("稍后刷新")]),_:1}),d(M,{type:"primary",onClick:a[8]||(a[8]=t=>{y(!0),b.value=!1})},{default:c(()=>[g(" 立即刷新 ")]),_:1})])]),default:c(()=>[Ne]),_:1},8,["modelValue"])])}}},Oe=E(Fe,[["__scopeId","data-v-d16a314c"]]),v=m=>(q("data-v-b30acb5e"),m=m(),G(),m),Re={class:"my-order"},Ae={key:0,class:"detail"},Ee={class:"table","infinite-scroll-distance":300,"infinite-scroll-delay":300,style:{overflow:"auto"},"infinite-scroll-immediate":!1},Ke=v(()=>e("div",{class:"table-title"},"订单信息",-1)),Pe={class:"table-info"},je={class:"info-item"},qe=v(()=>e("div",{class:"info-item-title"},"订单编号:",-1)),Ge={class:"info-item-info"},He={class:"info-item"},Je=v(()=>e("div",{class:"info-item-title"},"商品款数:",-1)),Qe={class:"info-item-info"},We={class:"info-item"},Xe=v(()=>e("div",{class:"info-item-title"},"商品总价:",-1)),Ze={class:"info-item-info"},et={class:"info-item"},tt=v(()=>e("div",{class:"info-item-title"},"创建时间:",-1)),st={class:"info-item-info"},ot={class:"info-item"},at=v(()=>e("div",{class:"info-item-title"},"优惠抵扣:",-1)),it={class:"info-item-info"},lt={class:"info-item"},nt=v(()=>e("div",{class:"info-item-title"},"实际支付:",-1)),dt={class:"info-item-info"},_t={class:"info-item"},ct=v(()=>e("div",{class:"info-item-title"},"支付时间:",-1)),rt={class:"info-item-info"},ut={class:"info-item"},vt=v(()=>e("div",{class:"info-item-title"},"支付方式:",-1)),pt={class:"info-item-info"},ft={key:0},mt={key:1},ht={key:2},yt={key:3},gt={key:4},kt={key:5},$t={key:0,class:"table-title"},bt={key:1,class:"table-info"},wt={class:"info-item"},Ct=v(()=>e("div",{class:"info-item-title"},"用户ID:",-1)),Vt={class:"info-item-info"},Dt={class:"info-item"},Yt=v(()=>e("div",{class:"info-item-title"},"用户昵称:",-1)),xt={class:"info-item-info"},zt={class:"info-item"},It=v(()=>e("div",{class:"info-item-title"},"用户电话:",-1)),St={class:"info-item-info"},Mt={style:{"font-size":"0.9rem"}},Ut={style:{color:"#ff4a00"}},Bt={style:{display:"flex","align-items":"center"}},Lt={style:{"margin-left":"0.5rem"}},Nt=v(()=>e("div",{style:{height:"8rem"}},null,-1)),Tt={key:1},Ft={__name:"detail",setup(m){K(),le();const o=n({id:""});n([]),n(null);const C=n(!1);n(0),n(0),n(["商品信息","订单详情"]),n(""),n(!1);const $=n({page_no:1,page_size:15,loadend:!1,loading:!1}),z=n([]),I=()=>console.log("触底"),_=()=>{C.value=!0,de({id:o.value.id}).then(u=>{o.value=u.data,setTimeout(()=>{C.value=!1},200)})};return P(()=>{w.on("set-sale-order-detail",u=>{console.log("===",u),o.value=u,$.value.page_no=1,$.value.loadend=!1,$.value.loading=!1,z.value=[],_()})}),j(()=>{w.off("set-sale-order-detail")}),(u,N)=>{var p;const V=r("el-image"),f=r("el-table-column"),h=r("el-table"),y=r("el-empty"),S=x("infinite-scroll"),b=x("loading");return s(),i("div",Re,[o.value.id?L((s(),i("div",Ae,[L((s(),i("div",Ee,[Ke,e("div",Pe,[e("div",je,[qe,e("div",Ge,l(o.value.order_id),1)]),e("div",He,[Je,e("div",Qe,l(o.value.total_num||0),1)]),e("div",We,[Xe,e("div",Ze,"¥"+l(o.value.total_price),1)]),e("div",et,[tt,e("div",st,l(o.value.pay_time),1)]),e("div",ot,[at,e("div",it,"¥"+l(o.value.deduction_price),1)]),e("div",lt,[nt,e("div",dt,"¥"+l(o.value.pay_price),1)]),e("div",_t,[ct,e("div",rt,l(o.value.pay_time),1)]),e("div",ut,[vt,e("div",pt,[o.value.pay_type_name?(s(),i("span",ft,l(o.value.pay_type_name),1)):o.value.pay_type==9?(s(),i("span",mt,"微信收款")):o.value.pay_type==17?(s(),i("span",ht,"现金支付")):o.value.pay_type==13?(s(),i("span",yt,"支付宝收款")):o.value.pay_type==3?(s(),i("span",gt,"余额支付")):o.value.pay_type==1?(s(),i("span",kt,"微信支付")):k("",!0)])])]),o.value.uid?(s(),i("div",$t,"用户信息")):k("",!0),o.value.uid?(s(),i("div",bt,[e("div",wt,[Ct,e("div",Vt,l(o.value.uid),1)]),e("div",Dt,[Yt,e("div",xt,l(o.value.nickname),1)]),e("div",zt,[It,e("div",St,l(o.value.mobile),1)])])):k("",!0),e("div",Mt,[g(" 共计 "),e("span",Ut,l(((p=o.value.product)==null?void 0:p.length)||" "),1),g(" 款商品 ")]),d(h,{data:o.value.product},{default:c(()=>[d(f,{label:"商品信息"},{default:c(({row:a})=>{var D,Y;return[e("div",Bt,[d(V,{style:{height:"3rem",width:"3rem","flex-shrink":"0"},src:(D=a.cart_info)==null?void 0:D.image},null,8,["src"]),e("span",Lt,l((Y=a.cart_info)==null?void 0:Y.name),1)])]}),_:1}),d(f,{prop:"cart_info.store_info",label:"商品规格",width:"150"}),d(f,{prop:"cart_info.price",label:"单价",width:"150"}),d(f,{prop:"cart_info.cart_num",label:"数量",width:"150"}),d(f,{prop:"cart_info.pay_price",label:"总价",width:"150"})]),_:1},8,["data"]),Nt])),[[S,I]])])),[[b,C.value]]):(s(),i("div",Tt,[d(y)]))])}}},Ot=E(Ft,[["__scopeId","data-v-b30acb5e"]]),Rt={class:"my-card"},qt={__name:"index",setup(m){return(o,C)=>(s(),i("div",Rt,[d(Oe,{style:{"flex-shrink":"0"},ref:"orderRef"},null,512),d(_e),d(Ot,{ref:"detailRef"},null,512)]))}};export{qt as default}; diff --git a/build/assets/index-B9unL6O8.js b/build/assets/index-CEprPOh1.js similarity index 99% rename from build/assets/index-B9unL6O8.js rename to build/assets/index-CEprPOh1.js index 23f5080..84c5ef9 100644 --- a/build/assets/index-B9unL6O8.js +++ b/build/assets/index-CEprPOh1.js @@ -1,6 +1,6 @@ function __vite__mapDeps(indexes) { if (!__vite__mapDeps.viteFileDeps) { - __vite__mapDeps.viteFileDeps = ["./index-BMcBprbe.js","./store-DNW8I_iw.js","./user-DptWFEfy.js","./moment-Cl4UOzQZ.js","./padding-DLHwO6AB.js","./axiosAPI-BnxnV-Ca.js","./shop-CbMLEgdU.js","./pay-BFyuVP94.js","./authCode-D610lJnm.js","./pay-iBTP5sC1.css","./index-DWcwac8l.css","./index-VyUxKQ4b.js","./index-Cjszd1YP.css","./index-BxvPYzrA.js","./index-B26FQ8AP.css","./index-D92nQDz0.js","./index-N9EvKsCT.css","./index-B1waLprr.js","./index-ZYBKJJNc.css","./index-CtJNP07e.js","./index-C_3rt8cw.css","./index-B68HUL05.js","./index-Bfak7bLR.css","./index-BFpyyBC_.js","./index-DjJP7Zaf.css","./index-BoLif8Bm.js","./index-CCSaqPZy.css","./test-BjN8X7hH.js","./test-CmC8-tN2.css","./index-C7smcUTx.js","./index-BA6nwZsc.css"] + __vite__mapDeps.viteFileDeps = ["./index-DdiPW3dN.js","./store-BoFe3Agt.js","./user-DiHB_Leh.js","./moment-Cl4UOzQZ.js","./padding-Bq_IbaOz.js","./axiosAPI-JxG9ekqU.js","./shop-DX9HGddz.js","./pay-C9Lsc2yr.js","./authCode-k34-_7Pb.js","./pay-BedbwRTP.css","./index-DWcwac8l.css","./index-xBkMFEcu.js","./index-Bmm-phAE.css","./index-CEe2BLLq.js","./index-B26FQ8AP.css","./index-Be4iZhHJ.js","./index-N9EvKsCT.css","./index-BjO2fJoc.js","./index-ZYBKJJNc.css","./index-CSvg3wbO.js","./index-C_3rt8cw.css","./index-BLGV5dWE.js","./index-Bfak7bLR.css","./index-U--D72EK.js","./index-DjJP7Zaf.css","./index-DJKQk7Zm.js","./index-CCSaqPZy.css","./test-DygWT1QV.js","./test-CmC8-tN2.css","./index-HN4ryKvA.js","./index-BA6nwZsc.css"] } return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) } @@ -102,4 +102,4 @@ function __vite__mapDeps(indexes) { `,n+=sl(" ")+` `,n+=T4()+`欢迎下次光临! `,n+=Yce(" ")+` -`,n+=Xce(),n},Sv=(e,t)=>{const n=e.__vccOpts||e;for(const[o,r]of t)n[o]=r;return n},Ii=e=>(Vw("data-v-fa9ee521"),e=e(),Bw(),e),Qce={class:"my-card"},ede={class:"card-header"},tde={style:{width:"4.5rem"}},nde=Ii(()=>k("div",{class:"card-title"},"泸优采收银系统",-1)),ode={style:{"margin-left":"1rem",display:"flex","flex-direction":"column","justify-content":"center",cursor:"pointer"}},rde={class:"card-body"},ade={style:{"margin-right":"1rem"}},lde=Ii(()=>k("span",null,"打印自检",-1)),sde={key:0,style:{"margin-right":"1rem"}},ide=Ii(()=>k("span",null,"点击自动连接打印机",-1)),ude=Ii(()=>k("div",null,"已连接打印机T58",-1)),cde={style:{"font-size":"0.7rem",color:"#ccc"}},dde=Ii(()=>k("span",null,"打印机已连接,是否重新连接",-1)),fde={class:"dialog-footer"},pde={class:"el-dropdown-link"},vde={class:"info"},hde={__name:"myHeader",setup(e){const t=bd(),n=qce(),o=L({});o.value=t.userInfo;const r=hb(),a=()=>{t.setUserInfo({}),t.setToken(""),r.push("/login")},l=()=>{window.location.reload()},s=L(!1),u=()=>{console.log("连接打印机"),uni.getEnv(h=>{h.h5?no.error("请使用APP连接打印机"):(n.setConnect(!1),n.setPrintAddress(""),s.value=!1,uni.postMessage({data:{type:"connect"}}))})};let c=!1;const f=(h="")=>{console.log("预打印"),console.log(Ef(h,!0)),!c&&(c=!0,uni.getEnv(m=>{m.h5?(no.error("请使用APP打印小票"),c=!1):(p(h),setTimeout(()=>{c=!1},4e3))}))},d=(h="")=>{console.log("预打印");let m=Ef(h,!0);console.log(m),!c&&(c=!0,uni.getEnv(v=>{v.h5?(no.error("请使用APP打印小票"),c=!1):(p(m),setTimeout(()=>{c=!1},4e3))}))},p=(h="")=>{let m="";h===""?(m=Ef({},!0),console.log(m)):m=h,uni.postMessage({data:{type:"print",content:m}})};return et(()=>{Yt.on("printReceipt",f),Yt.on("letPrintReceipt",d),window.addEventListener("message",function(h){if(h.data.type==="connect"){let m=h.data.data.address;n.setConnect(!0),n.setPrintAddress(m),no.success("已连接打印机T58("+m+")")}},!1)}),xo(()=>{Yt.off("printReceipt",f),Yt.off("letPrintReceipt",d)}),(h,m)=>{const v=Ze("el-image"),_=Ze("Refresh"),g=Ze("el-icon"),w=Ze("el-button"),y=Ze("el-dialog"),C=Ze("el-avatar"),E=Ze("arrow-down"),x=Ze("el-dropdown-item"),A=Ze("el-dropdown-menu"),T=Ze("el-dropdown");return b(),M("div",Qce,[k("div",ede,[k("div",tde,[W(v,{style:{height:"2.5rem",width:"2.5rem",margin:"0 auto"},src:"https://lihai001.oss-cn-chengdu.aliyuncs.com/def/12c93202404101530591311.png"})]),nde,k("div",ode,[W(g,{color:"#fff",size:"25",onClick:l},{default:X(()=>[W(_)]),_:1})])]),k("div",rde,[k("div",ade,[W(w,{onClick:m[0]||(m[0]=R=>i(Yt).emit("letPrintReceipt")),type:"primary"},{default:X(()=>[lde]),_:1})]),!i(n).is_connect||!i(n).printAddress?(b(),M("div",sde,[W(w,{onClick:u,type:"warning"},{default:X(()=>[ide]),_:1})])):(b(),M("div",{key:1,style:{"margin-right":"1rem","font-size":"0.9rem"},onClick:m[1]||(m[1]=R=>s.value=!0)},[ude,k("div",cde,"("+Te(i(n).printAddress)+")",1)])),W(y,{modelValue:s.value,"onUpdate:modelValue":m[3]||(m[3]=R=>s.value=R),title:"提示",width:"500"},{footer:X(()=>[k("div",fde,[W(w,{onClick:m[2]||(m[2]=R=>s.value=!1)},{default:X(()=>[mt("取消")]),_:1}),W(w,{type:"primary",onClick:u},{default:X(()=>[mt(" 重新连接 ")]),_:1})])]),default:X(()=>[dde]),_:1},8,["modelValue"]),W(T,{trigger:"hover"},{dropdown:X(()=>[W(A,null,{default:X(()=>[W(x,{onClick:a},{default:X(()=>[mt("退出登录")]),_:1})]),_:1})]),default:X(()=>[k("div",pde,[W(C,{src:o.value.avatar,icon:"user-filled"},null,8,["src"]),k("div",vde,[k("div",null,Te(o.value.name),1),k("div",null,"("+Te(o.value.role_name)+")",1)]),W(g,{class:"el-icon--right"},{default:X(()=>[W(E)]),_:1})])]),_:1})])])}}},mde=Sv(hde,[["__scopeId","data-v-fa9ee521"]]),gde=mv("order",()=>{const e=L(localStorage.getItem("orderCount")||0);return{orderCount:e,setOrderCount:n=>{e.value=n,localStorage.setItem("orderCount",n)}}}),yde={class:"my-card"},_de=["onClick"],bde={key:0,class:"badge"},wde={__name:"myAside",setup(e){const t=hb(),n=bue(),o=gde(),r=(d=1)=>{o.setOrderCount(d),u.value.forEach(p=>{p.name=="order"&&(p.count=d)})};let a=!1;const l=d=>{try{if(r(0),no.success("您有新的订单"),a)return;var p=new Audio("/public/order.mp3");p.play(),a=!0,console.log("播放中"),p.addEventListener("ended",function(){a=!1})}catch(h){console.error(h),a=!1,no.error("播放失败")}},s=d=>{t.push({name:d})},u=L([{name:"saleHome",title:"收银",ico:"Sell",count:0},{name:"saleOrder",title:"收银订单",ico:"DataLine",count:0},{name:"order",title:"线上订单",ico:"DataAnalysis",count:0},{name:"convert",title:"订单核销",ico:"FullScreen",count:0},{name:"putStorage",title:"入库登记",ico:"Van",count:0},{name:"stock",title:"商品库存",ico:"Box",count:0},{name:"user",title:"用户",ico:"User",count:0}]),c=()=>{let d=u.value.findIndex(p=>p.name==n.name);d==0&&(d=u.value.length),d>0&&s(u.value[d-1].name)},f=()=>{let d=u.value.findIndex(p=>p.name==n.name);d==u.value.length-1&&(d=-1),d{Yt.on("up",c),Yt.on("down",f),Yt.on("new_order",l),Yt.on("set-order-count-zero",()=>{r(0)}),r(0)}),xo(()=>{Yt.off("aup",c),Yt.off("adown",f),Yt.off("new_order",l),Yt.on("set-order-count-zero")}),(d,p)=>{const h=Ze("el-icon");return b(),M("div",yde,[(b(!0),M(Fe,null,ht(u.value,m=>(b(),M("div",{key:m.name,class:$(["list-item",{active:i(n).name==m.name}]),onClick:v=>s(m.name)},[W(h,{size:"2rem"},{default:X(()=>[(b(),le(st(m.ico)))]),_:2},1024),k("div",null,Te(m.title),1),m.count?(b(),M("div",bde,Te(m.count),1)):ne("",!0)],10,_de))),128))])}}},Cde=Sv(wde,[["__scopeId","data-v-24f75199"]]),Oo=function e(t){this.doNotConnect=0,t=t||{},t.heartbeat=t.heartbeat||25e3,t.pingTimeout=t.pingTimeout||1e4,this.config=t,this.uid=0,this.channels={},this.connection=null,this.pingTimeoutTimer=0,e.instances.push(this),this.createConnection()};Oo.prototype.checkoutPing=function(){var e=this;e.checkoutPingTimer&&clearTimeout(e.checkoutPingTimer),e.checkoutPingTimer=setTimeout(function(){e.checkoutPingTimer=0,e.connection.state==="connected"&&(e.connection.send('{"event":"pusher:ping","data":{}}'),e.pingTimeoutTimer&&(clearTimeout(e.pingTimeoutTimer),e.pingTimeoutTimer=0),e.pingTimeoutTimer=setTimeout(function(){e.connection.closeAndClean(),e.connection.doNotConnect||e.connection.waitReconnect()},e.config.pingTimeout))},this.config.heartbeat)};Oo.prototype.channel=function(e){return this.channels.find(e)};Oo.prototype.allChannels=function(){return this.channels.all()};Oo.prototype.createConnection=function(){if(this.connection)throw Error("Connection already exist");var e=this,t=this.config.url;function n(){for(var o in e.channels)e.channels[o].subscribed=!1}this.connection=new Qa({url:t,app_key:this.config.app_key,onOpen:function(){e.connection.state="connecting",e.checkoutPing()},onMessage:function(o){e.pingTimeoutTimer&&(clearTimeout(e.pingTimeoutTimer),e.pingTimeoutTimer=0),o=JSON.parse(o.data);var r=o.event,a=o.channel;if(r==="pusher:pong"){e.checkoutPing();return}if(r==="pusher:error")throw Error(o.data.message);var l=JSON.parse(o.data),s;if(r==="pusher_internal:subscription_succeeded"){s=e.channels[a],s.subscribed=!0,s.processQueue(),s.emit("pusher:subscription_succeeded");return}if(r==="pusher:connection_established"&&(e.connection.socket_id=l.socket_id,e.connection.updateNetworkState("connected"),e.subscribeAll()),r.indexOf("pusher_internal")!==-1){console.log("Event '"+r+"' not implement");return}s=e.channels[a],s&&s.emit(r,l)},onClose:function(){n()},onError:function(){n()}})};Oo.prototype.disconnect=function(){this.connection.doNotConnect=1,this.connection.close()};Oo.prototype.subscribeAll=function(){if(this.connection.state==="connected")for(var e in this.channels)this.channels[e].processSubscribe()};Oo.prototype.unsubscribe=function(e){this.channels[e]&&(delete this.channels[e],this.connection.state==="connected"&&this.connection.send(JSON.stringify({event:"pusher:unsubscribe",data:{channel:e}})))};Oo.prototype.unsubscribeAll=function(){var e=Object.keys(this.channels);if(e.length&&this.connection.state==="connected")for(var t in this.channels)this.unsubscribe(t);this.channels={}};Oo.prototype.subscribe=function(e){return this.channels[e]?this.channels[e]:e.indexOf("private-")===0?Kb(e,this):e.indexOf("presence-")===0?kde(e,this):Sde(e,this)};Oo.instances=[];function Sde(e,t){var n=new Li(t.connection,e);return t.channels[e]=n,n.subscribeCb=function(){t.connection.send(JSON.stringify({event:"pusher:subscribe",data:{channel:e}}))},n.processSubscribe(),n}function Kb(e,t){var n=new Li(t.connection,e);return t.channels[e]=n,n.subscribeCb=function(){xde({url:t.config.auth,type:"POST",data:{channel_name:e,socket_id:t.connection.socket_id},success:function(o){o=JSON.parse(o),o.channel=e,t.connection.send(JSON.stringify({event:"pusher:subscribe",data:o}))},error:function(o){throw Error(o)}})},n.processSubscribe(),n}function kde(e,t){return Kb(e,t)}function Qa(e){this.dispatcher=new jb,Wb(this,this.dispatcher);var t=["on","off","emit"];for(var n in t)this[t[n]]=this.dispatcher[t[n]];this.options=e,this.state="initialized",this.doNotConnect=0,this.reconnectInterval=1,this.connection=null,this.reconnectTimer=0,this.connect()}Qa.prototype.updateNetworkState=function(e){var t=this.state;this.state=e,t!==e&&this.emit("state_change",{previous:t,current:e})};Qa.prototype.connect=function(){if(this.doNotConnect=0,this.state==="connected"){console.log('networkState is "'+this.state+'" and do not need connect');return}this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=0),this.closeAndClean();var e=this.options,t=new WebSocket(e.url+"/app/"+e.app_key);this.updateNetworkState("connecting");var n=this;t.onopen=function(o){if(n.reconnectInterval=1,n.doNotConnect){n.updateNetworkState("disconnected"),t.close();return}e.onOpen&&e.onOpen(o)},e.onMessage&&(t.onmessage=e.onMessage),t.onclose=function(o){t.onmessage=t.onopen=t.onclose=t.onerror=null,n.updateNetworkState("disconnected"),n.doNotConnect||n.waitReconnect(),e.onClose&&e.onClose(o)},t.onerror=function(o){n.close(),n.doNotConnect||n.waitReconnect(),e.onError&&e.onError(o)},this.connection=t};Qa.prototype.closeAndClean=function(){if(this.connection){var e=this.connection;e.onmessage=e.onopen=e.onclose=e.onerror=null;try{e.close()}catch{}this.updateNetworkState("disconnected")}};Qa.prototype.waitReconnect=function(){if(!(this.state==="connected"||this.state==="connecting")&&!this.doNotConnect){this.updateNetworkState("connecting");var e=this;this.reconnectTimer&&clearTimeout(this.reconnectTimer),this.reconnectTimer=setTimeout(function(){e.connect()},this.reconnectInterval),this.reconnectInterval<1e3?this.reconnectInterval=1e3:this.reconnectInterval=this.reconnectInterval*2,this.reconnectInterval>2e3&&navigator.onLine&&(e.reconnectInterval=2e3)}};Qa.prototype.send=function(e){if(this.state!=="connected"){console.trace('networkState is "'+this.state+'", can not send '+e);return}this.connection.send(e)};Qa.prototype.close=function(){this.updateNetworkState("disconnected"),this.connection.close()};var Wb=function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function o(){this.constructor=e}e.prototype=t===null?Object.create(t):(o.prototype=t.prototype,new o)};function Li(e,t){this.subscribed=!1,this.dispatcher=new jb,this.connection=e,this.channelName=t,this.subscribeCb=null,this.queue=[],Wb(this,this.dispatcher);var n=["on","off","emit"];for(var o in n)this[n[o]]=this.dispatcher[n[o]]}Li.prototype.processSubscribe=function(){this.connection.state==="connected"&&this.subscribeCb()};Li.prototype.processQueue=function(){if(!(this.connection.state!=="connected"||!this.subscribed)){for(var e in this.queue)this.queue[e]();this.queue=[]}};Li.prototype.trigger=function(e,t){if(e.indexOf("client-")!==0)throw new Error("Event '"+e+"' should start with 'client-'");var n=this;this.queue.push(function(){n.connection.send(JSON.stringify({event:e,data:t,channel:n.channelName}))}),this.processQueue()};var vu=function(){var e={};function t(y){for(var C=[],E=1;E0)for(o=0;o=200&&n<300?e.success&&e.success(t.responseText,t.responseXML):e.error&&e.error(n)}},e.type==="GET"?(t.open("GET",e.url+"?"+params,!0),t.send(null)):e.type==="POST"&&(t.open("POST",e.url,!0),t.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),t.send(params))}function Mde(e){var t=[];for(var n in e)t.push(encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t.join("&")}const Tde={class:"common-layout"},$de={__name:"index",setup(e){const t=bd(),o=new Oo({url:"wss://multi-store.lihaink.cn/pull",app_key:"2ce3ce22329517213caa7dad261f5695"}).subscribe(`store_merchant_${t.userInfo.store_id}`);o.on("message",function(a){var l,s,u,c,f,d,p,h,m;console.log("收到消息--",a);try{((l=a==null?void 0:a.content)==null?void 0:l.type)=="cash_register"&&((s=a==null?void 0:a.content)==null?void 0:s.msg)=="您有一笔订单已支付"&&Yt.emit("pay_success",(u=a==null?void 0:a.content)==null?void 0:u.data),((c=a==null?void 0:a.content)==null?void 0:c.type)=="store_merchant"&&((f=a==null?void 0:a.content)==null?void 0:f.msg)=="您有一笔新的订单"&&Yt.emit("new_order",a==null?void 0:a.content),((d=a==null?void 0:a.content)==null?void 0:d.type)=="platform_print"&&Yt.emit("letPrintReceipt",(p=a==null?void 0:a.content)==null?void 0:p.data),((h=a==null?void 0:a.content)==null?void 0:h.msg)=="订单支付成功"&&Yt.emit("pay_user_success",(m=a==null?void 0:a.content)==null?void 0:m.data)}catch{}}),o.on("close",function(){});const r=a=>{console.log("按下",a.keyCode),a.keyCode==16&&Yt.emit("shift"),a.keyCode==120&&Yt.emit("F9"),a.keyCode==13&&Yt.emit("enter"),a.keyCode==37&&Yt.emit("left"),a.keyCode==39&&Yt.emit("right"),a.keyCode==38&&Yt.emit("up"),a.keyCode==40&&Yt.emit("down"),a.keyCode==46&&Yt.emit("delete")};return et(()=>{window.addEventListener("keydown",r),console.log("开启键盘监听")}),xo(()=>{window.removeEventListener("keydown",r),console.log("关闭键盘监听")}),(a,l)=>{const s=Ze("el-header"),u=Ze("el-aside"),c=Ze("router-view"),f=Ze("el-main"),d=Ze("el-container");return b(),M("div",Tde,[W(d,null,{default:X(()=>[W(s,null,{default:X(()=>[W(mde)]),_:1}),W(d,null,{default:X(()=>[W(u,{width:"6.25rem"},{default:X(()=>[W(Cde)]),_:1}),W(f,{style:{color:"#333"}},{default:X(()=>[W(c,{class:"my-main"},{default:X(({Component:p})=>[W(nn,{name:"el-zoom-in-top"},{default:X(()=>[(b(),le(st(p)))]),_:2},1024)]),_:1})]),_:1})]),_:1})]),_:1})])}}},Ode=Sv($de,[["__scopeId","data-v-6c618134"]]),Ade=[{path:"/",name:"layout",component:Ode,redirect:"/saleHome",meta:{title:"里海收银系统"},children:[{path:"/saleHome",name:"saleHome",meta:{title:"收银"},component:()=>qn(()=>import("./index-BMcBprbe.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10]),import.meta.url)},{path:"/saleOrder",name:"saleOrder",meta:{title:"收银订单"},component:()=>qn(()=>import("./index-VyUxKQ4b.js"),__vite__mapDeps([11,1,3,7,8,9,4,12]),import.meta.url)},{path:"/order",name:"order",meta:{title:"线上采购"},component:()=>qn(()=>import("./index-BxvPYzrA.js"),__vite__mapDeps([13,1,3,4,14,9]),import.meta.url)},{path:"/subOrder",name:"subOrder",meta:{title:"订单统计"},component:()=>qn(()=>import("./index-D92nQDz0.js"),__vite__mapDeps([15,1,3,7,8,9,4,16]),import.meta.url)},{path:"/order",name:"order",meta:{title:"预约取货"},component:()=>qn(()=>import("./index-BxvPYzrA.js"),__vite__mapDeps([13,1,3,4,14,9]),import.meta.url)},{path:"/wallet",name:"wallet",meta:{title:"提现"},component:()=>qn(()=>import("./index-B1waLprr.js"),__vite__mapDeps([17,3,4,18]),import.meta.url)},{path:"/convert",name:"convert",meta:{title:"订单核销"},component:()=>qn(()=>import("./index-CtJNP07e.js"),__vite__mapDeps([19,1,4,20,9]),import.meta.url)},{path:"/putStorage",name:"putStorage",meta:{title:"入库登记"},component:()=>qn(()=>import("./index-B68HUL05.js"),__vite__mapDeps([21,6,5,22]),import.meta.url)},{path:"/stock",name:"stock",meta:{title:"入库登记"},component:()=>qn(()=>import("./index-BFpyyBC_.js"),__vite__mapDeps([23,6,5,24]),import.meta.url)},{path:"/user",name:"user",meta:{title:"用户"},component:()=>qn(()=>import("./index-BoLif8Bm.js"),__vite__mapDeps([25,2,3,5,8,1,4,26]),import.meta.url)},{path:"/test",name:"test",component:()=>qn(()=>import("./test-BjN8X7hH.js"),__vite__mapDeps([27,28]),import.meta.url)}]},{path:"/login",name:"login",component:()=>qn(()=>import("./index-C7smcUTx.js"),__vite__mapDeps([29,2,30]),import.meta.url)},{path:"/:catchAll(.*)",name:"notFound",component:()=>qn(()=>import("./index-BxzBeeJt.js"),__vite__mapDeps([]),import.meta.url)}],qb=yue({history:Uie(),routes:Ade});qb.beforeEach((e,t,n)=>{const o=bd();e.name!=="login"&&!o.Token?n({name:"login"}):n()});const Ub=qb,Vi=Fg(g9);for(const[e,t]of Object.entries(qL))Vi.component(e,t);const Nde=Cue();Vi.use(Ub);Vi.use(Nde);Vi.use(fie,{locale:pie});Vi.mount("#app");export{cr as A,Jse as B,cie as C,Sse as D,no as E,Fe as F,wt as G,bue as H,hb as I,S as J,Db as K,bt as L,Op as M,De as N,un as O,Wce as P,Ub as Q,Sv as _,xo as a,Ze as b,b as c,le as d,k as e,W as f,mt as g,Pc as h,Mt as i,tt as j,M as k,ht as l,Yt as m,We as n,et as o,ne as p,Vw as q,L as r,Bw as s,Te as t,bd as u,kr as v,X as w,Er as x,i as y,$ as z}; +`,n+=Xce(),n},Sv=(e,t)=>{const n=e.__vccOpts||e;for(const[o,r]of t)n[o]=r;return n},Ii=e=>(Vw("data-v-fa9ee521"),e=e(),Bw(),e),Qce={class:"my-card"},ede={class:"card-header"},tde={style:{width:"4.5rem"}},nde=Ii(()=>k("div",{class:"card-title"},"泸优采收银系统",-1)),ode={style:{"margin-left":"1rem",display:"flex","flex-direction":"column","justify-content":"center",cursor:"pointer"}},rde={class:"card-body"},ade={style:{"margin-right":"1rem"}},lde=Ii(()=>k("span",null,"打印自检",-1)),sde={key:0,style:{"margin-right":"1rem"}},ide=Ii(()=>k("span",null,"点击自动连接打印机",-1)),ude=Ii(()=>k("div",null,"已连接打印机T58",-1)),cde={style:{"font-size":"0.7rem",color:"#ccc"}},dde=Ii(()=>k("span",null,"打印机已连接,是否重新连接",-1)),fde={class:"dialog-footer"},pde={class:"el-dropdown-link"},vde={class:"info"},hde={__name:"myHeader",setup(e){const t=bd(),n=qce(),o=L({});o.value=t.userInfo;const r=hb(),a=()=>{t.setUserInfo({}),t.setToken(""),r.push("/login")},l=()=>{window.location.reload()},s=L(!1),u=()=>{console.log("连接打印机"),uni.getEnv(h=>{h.h5?no.error("请使用APP连接打印机"):(n.setConnect(!1),n.setPrintAddress(""),s.value=!1,uni.postMessage({data:{type:"connect"}}))})};let c=!1;const f=(h="")=>{console.log("预打印"),console.log(Ef(h,!0)),!c&&(c=!0,uni.getEnv(m=>{m.h5?(no.error("请使用APP打印小票"),c=!1):(p(h),setTimeout(()=>{c=!1},4e3))}))},d=(h="")=>{console.log("预打印");let m=Ef(h,!0);console.log(m),!c&&(c=!0,uni.getEnv(v=>{v.h5?(no.error("请使用APP打印小票"),c=!1):(p(m),setTimeout(()=>{c=!1},4e3))}))},p=(h="")=>{let m="";h===""?(m=Ef({},!0),console.log(m)):m=h,uni.postMessage({data:{type:"print",content:m}})};return et(()=>{Yt.on("printReceipt",f),Yt.on("letPrintReceipt",d),window.addEventListener("message",function(h){if(h.data.type==="connect"){let m=h.data.data.address;n.setConnect(!0),n.setPrintAddress(m),no.success("已连接打印机T58("+m+")")}},!1)}),xo(()=>{Yt.off("printReceipt",f),Yt.off("letPrintReceipt",d)}),(h,m)=>{const v=Ze("el-image"),_=Ze("Refresh"),g=Ze("el-icon"),w=Ze("el-button"),y=Ze("el-dialog"),C=Ze("el-avatar"),E=Ze("arrow-down"),x=Ze("el-dropdown-item"),A=Ze("el-dropdown-menu"),T=Ze("el-dropdown");return b(),M("div",Qce,[k("div",ede,[k("div",tde,[W(v,{style:{height:"2.5rem",width:"2.5rem",margin:"0 auto"},src:"https://lihai001.oss-cn-chengdu.aliyuncs.com/def/12c93202404101530591311.png"})]),nde,k("div",ode,[W(g,{color:"#fff",size:"25",onClick:l},{default:X(()=>[W(_)]),_:1})])]),k("div",rde,[k("div",ade,[W(w,{onClick:m[0]||(m[0]=R=>i(Yt).emit("letPrintReceipt")),type:"primary"},{default:X(()=>[lde]),_:1})]),!i(n).is_connect||!i(n).printAddress?(b(),M("div",sde,[W(w,{onClick:u,type:"warning"},{default:X(()=>[ide]),_:1})])):(b(),M("div",{key:1,style:{"margin-right":"1rem","font-size":"0.9rem"},onClick:m[1]||(m[1]=R=>s.value=!0)},[ude,k("div",cde,"("+Te(i(n).printAddress)+")",1)])),W(y,{modelValue:s.value,"onUpdate:modelValue":m[3]||(m[3]=R=>s.value=R),title:"提示",width:"500"},{footer:X(()=>[k("div",fde,[W(w,{onClick:m[2]||(m[2]=R=>s.value=!1)},{default:X(()=>[mt("取消")]),_:1}),W(w,{type:"primary",onClick:u},{default:X(()=>[mt(" 重新连接 ")]),_:1})])]),default:X(()=>[dde]),_:1},8,["modelValue"]),W(T,{trigger:"hover"},{dropdown:X(()=>[W(A,null,{default:X(()=>[W(x,{onClick:a},{default:X(()=>[mt("退出登录")]),_:1})]),_:1})]),default:X(()=>[k("div",pde,[W(C,{src:o.value.avatar,icon:"user-filled"},null,8,["src"]),k("div",vde,[k("div",null,Te(o.value.name),1),k("div",null,"("+Te(o.value.role_name)+")",1)]),W(g,{class:"el-icon--right"},{default:X(()=>[W(E)]),_:1})])]),_:1})])])}}},mde=Sv(hde,[["__scopeId","data-v-fa9ee521"]]),gde=mv("order",()=>{const e=L(localStorage.getItem("orderCount")||0);return{orderCount:e,setOrderCount:n=>{e.value=n,localStorage.setItem("orderCount",n)}}}),yde={class:"my-card"},_de=["onClick"],bde={key:0,class:"badge"},wde={__name:"myAside",setup(e){const t=hb(),n=bue(),o=gde(),r=(d=1)=>{o.setOrderCount(d),u.value.forEach(p=>{p.name=="order"&&(p.count=d)})};let a=!1;const l=d=>{try{if(r(0),no.success("您有新的订单"),a)return;var p=new Audio("/public/order.mp3");p.play(),a=!0,console.log("播放中"),p.addEventListener("ended",function(){a=!1})}catch(h){console.error(h),a=!1,no.error("播放失败")}},s=d=>{t.push({name:d})},u=L([{name:"saleHome",title:"收银",ico:"Sell",count:0},{name:"saleOrder",title:"收银订单",ico:"DataLine",count:0},{name:"order",title:"线上订单",ico:"DataAnalysis",count:0},{name:"convert",title:"订单核销",ico:"FullScreen",count:0},{name:"putStorage",title:"入库登记",ico:"Van",count:0},{name:"stock",title:"商品库存",ico:"Box",count:0},{name:"user",title:"用户",ico:"User",count:0}]),c=()=>{let d=u.value.findIndex(p=>p.name==n.name);d==0&&(d=u.value.length),d>0&&s(u.value[d-1].name)},f=()=>{let d=u.value.findIndex(p=>p.name==n.name);d==u.value.length-1&&(d=-1),d{Yt.on("up",c),Yt.on("down",f),Yt.on("new_order",l),Yt.on("set-order-count-zero",()=>{r(0)}),r(0)}),xo(()=>{Yt.off("aup",c),Yt.off("adown",f),Yt.off("new_order",l),Yt.on("set-order-count-zero")}),(d,p)=>{const h=Ze("el-icon");return b(),M("div",yde,[(b(!0),M(Fe,null,ht(u.value,m=>(b(),M("div",{key:m.name,class:$(["list-item",{active:i(n).name==m.name}]),onClick:v=>s(m.name)},[W(h,{size:"2rem"},{default:X(()=>[(b(),le(st(m.ico)))]),_:2},1024),k("div",null,Te(m.title),1),m.count?(b(),M("div",bde,Te(m.count),1)):ne("",!0)],10,_de))),128))])}}},Cde=Sv(wde,[["__scopeId","data-v-24f75199"]]),Oo=function e(t){this.doNotConnect=0,t=t||{},t.heartbeat=t.heartbeat||25e3,t.pingTimeout=t.pingTimeout||1e4,this.config=t,this.uid=0,this.channels={},this.connection=null,this.pingTimeoutTimer=0,e.instances.push(this),this.createConnection()};Oo.prototype.checkoutPing=function(){var e=this;e.checkoutPingTimer&&clearTimeout(e.checkoutPingTimer),e.checkoutPingTimer=setTimeout(function(){e.checkoutPingTimer=0,e.connection.state==="connected"&&(e.connection.send('{"event":"pusher:ping","data":{}}'),e.pingTimeoutTimer&&(clearTimeout(e.pingTimeoutTimer),e.pingTimeoutTimer=0),e.pingTimeoutTimer=setTimeout(function(){e.connection.closeAndClean(),e.connection.doNotConnect||e.connection.waitReconnect()},e.config.pingTimeout))},this.config.heartbeat)};Oo.prototype.channel=function(e){return this.channels.find(e)};Oo.prototype.allChannels=function(){return this.channels.all()};Oo.prototype.createConnection=function(){if(this.connection)throw Error("Connection already exist");var e=this,t=this.config.url;function n(){for(var o in e.channels)e.channels[o].subscribed=!1}this.connection=new Qa({url:t,app_key:this.config.app_key,onOpen:function(){e.connection.state="connecting",e.checkoutPing()},onMessage:function(o){e.pingTimeoutTimer&&(clearTimeout(e.pingTimeoutTimer),e.pingTimeoutTimer=0),o=JSON.parse(o.data);var r=o.event,a=o.channel;if(r==="pusher:pong"){e.checkoutPing();return}if(r==="pusher:error")throw Error(o.data.message);var l=JSON.parse(o.data),s;if(r==="pusher_internal:subscription_succeeded"){s=e.channels[a],s.subscribed=!0,s.processQueue(),s.emit("pusher:subscription_succeeded");return}if(r==="pusher:connection_established"&&(e.connection.socket_id=l.socket_id,e.connection.updateNetworkState("connected"),e.subscribeAll()),r.indexOf("pusher_internal")!==-1){console.log("Event '"+r+"' not implement");return}s=e.channels[a],s&&s.emit(r,l)},onClose:function(){n()},onError:function(){n()}})};Oo.prototype.disconnect=function(){this.connection.doNotConnect=1,this.connection.close()};Oo.prototype.subscribeAll=function(){if(this.connection.state==="connected")for(var e in this.channels)this.channels[e].processSubscribe()};Oo.prototype.unsubscribe=function(e){this.channels[e]&&(delete this.channels[e],this.connection.state==="connected"&&this.connection.send(JSON.stringify({event:"pusher:unsubscribe",data:{channel:e}})))};Oo.prototype.unsubscribeAll=function(){var e=Object.keys(this.channels);if(e.length&&this.connection.state==="connected")for(var t in this.channels)this.unsubscribe(t);this.channels={}};Oo.prototype.subscribe=function(e){return this.channels[e]?this.channels[e]:e.indexOf("private-")===0?Kb(e,this):e.indexOf("presence-")===0?kde(e,this):Sde(e,this)};Oo.instances=[];function Sde(e,t){var n=new Li(t.connection,e);return t.channels[e]=n,n.subscribeCb=function(){t.connection.send(JSON.stringify({event:"pusher:subscribe",data:{channel:e}}))},n.processSubscribe(),n}function Kb(e,t){var n=new Li(t.connection,e);return t.channels[e]=n,n.subscribeCb=function(){xde({url:t.config.auth,type:"POST",data:{channel_name:e,socket_id:t.connection.socket_id},success:function(o){o=JSON.parse(o),o.channel=e,t.connection.send(JSON.stringify({event:"pusher:subscribe",data:o}))},error:function(o){throw Error(o)}})},n.processSubscribe(),n}function kde(e,t){return Kb(e,t)}function Qa(e){this.dispatcher=new jb,Wb(this,this.dispatcher);var t=["on","off","emit"];for(var n in t)this[t[n]]=this.dispatcher[t[n]];this.options=e,this.state="initialized",this.doNotConnect=0,this.reconnectInterval=1,this.connection=null,this.reconnectTimer=0,this.connect()}Qa.prototype.updateNetworkState=function(e){var t=this.state;this.state=e,t!==e&&this.emit("state_change",{previous:t,current:e})};Qa.prototype.connect=function(){if(this.doNotConnect=0,this.state==="connected"){console.log('networkState is "'+this.state+'" and do not need connect');return}this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=0),this.closeAndClean();var e=this.options,t=new WebSocket(e.url+"/app/"+e.app_key);this.updateNetworkState("connecting");var n=this;t.onopen=function(o){if(n.reconnectInterval=1,n.doNotConnect){n.updateNetworkState("disconnected"),t.close();return}e.onOpen&&e.onOpen(o)},e.onMessage&&(t.onmessage=e.onMessage),t.onclose=function(o){t.onmessage=t.onopen=t.onclose=t.onerror=null,n.updateNetworkState("disconnected"),n.doNotConnect||n.waitReconnect(),e.onClose&&e.onClose(o)},t.onerror=function(o){n.close(),n.doNotConnect||n.waitReconnect(),e.onError&&e.onError(o)},this.connection=t};Qa.prototype.closeAndClean=function(){if(this.connection){var e=this.connection;e.onmessage=e.onopen=e.onclose=e.onerror=null;try{e.close()}catch{}this.updateNetworkState("disconnected")}};Qa.prototype.waitReconnect=function(){if(!(this.state==="connected"||this.state==="connecting")&&!this.doNotConnect){this.updateNetworkState("connecting");var e=this;this.reconnectTimer&&clearTimeout(this.reconnectTimer),this.reconnectTimer=setTimeout(function(){e.connect()},this.reconnectInterval),this.reconnectInterval<1e3?this.reconnectInterval=1e3:this.reconnectInterval=this.reconnectInterval*2,this.reconnectInterval>2e3&&navigator.onLine&&(e.reconnectInterval=2e3)}};Qa.prototype.send=function(e){if(this.state!=="connected"){console.trace('networkState is "'+this.state+'", can not send '+e);return}this.connection.send(e)};Qa.prototype.close=function(){this.updateNetworkState("disconnected"),this.connection.close()};var Wb=function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function o(){this.constructor=e}e.prototype=t===null?Object.create(t):(o.prototype=t.prototype,new o)};function Li(e,t){this.subscribed=!1,this.dispatcher=new jb,this.connection=e,this.channelName=t,this.subscribeCb=null,this.queue=[],Wb(this,this.dispatcher);var n=["on","off","emit"];for(var o in n)this[n[o]]=this.dispatcher[n[o]]}Li.prototype.processSubscribe=function(){this.connection.state==="connected"&&this.subscribeCb()};Li.prototype.processQueue=function(){if(!(this.connection.state!=="connected"||!this.subscribed)){for(var e in this.queue)this.queue[e]();this.queue=[]}};Li.prototype.trigger=function(e,t){if(e.indexOf("client-")!==0)throw new Error("Event '"+e+"' should start with 'client-'");var n=this;this.queue.push(function(){n.connection.send(JSON.stringify({event:e,data:t,channel:n.channelName}))}),this.processQueue()};var vu=function(){var e={};function t(y){for(var C=[],E=1;E0)for(o=0;o=200&&n<300?e.success&&e.success(t.responseText,t.responseXML):e.error&&e.error(n)}},e.type==="GET"?(t.open("GET",e.url+"?"+params,!0),t.send(null)):e.type==="POST"&&(t.open("POST",e.url,!0),t.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),t.send(params))}function Mde(e){var t=[];for(var n in e)t.push(encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t.join("&")}const Tde={class:"common-layout"},$de={__name:"index",setup(e){const t=bd(),o=new Oo({url:"wss://multi-store.lihaink.cn/pull",app_key:"2ce3ce22329517213caa7dad261f5695"}).subscribe(`store_merchant_${t.userInfo.store_id}`);o.on("message",function(a){var l,s,u,c,f,d,p,h,m;console.log("收到消息--",a);try{((l=a==null?void 0:a.content)==null?void 0:l.type)=="cash_register"&&((s=a==null?void 0:a.content)==null?void 0:s.msg)=="您有一笔订单已支付"&&Yt.emit("pay_success",(u=a==null?void 0:a.content)==null?void 0:u.data),((c=a==null?void 0:a.content)==null?void 0:c.type)=="store_merchant"&&((f=a==null?void 0:a.content)==null?void 0:f.msg)=="您有一笔新的订单"&&Yt.emit("new_order",a==null?void 0:a.content),((d=a==null?void 0:a.content)==null?void 0:d.type)=="platform_print"&&Yt.emit("letPrintReceipt",(p=a==null?void 0:a.content)==null?void 0:p.data),((h=a==null?void 0:a.content)==null?void 0:h.msg)=="订单支付成功"&&Yt.emit("pay_user_success",(m=a==null?void 0:a.content)==null?void 0:m.data)}catch{}}),o.on("close",function(){});const r=a=>{console.log("按下",a.keyCode),a.keyCode==16&&Yt.emit("shift"),a.keyCode==120&&Yt.emit("F9"),a.keyCode==13&&Yt.emit("enter"),a.keyCode==37&&Yt.emit("left"),a.keyCode==39&&Yt.emit("right"),a.keyCode==38&&Yt.emit("up"),a.keyCode==40&&Yt.emit("down"),a.keyCode==46&&Yt.emit("delete")};return et(()=>{window.addEventListener("keydown",r),console.log("开启键盘监听")}),xo(()=>{window.removeEventListener("keydown",r),console.log("关闭键盘监听")}),(a,l)=>{const s=Ze("el-header"),u=Ze("el-aside"),c=Ze("router-view"),f=Ze("el-main"),d=Ze("el-container");return b(),M("div",Tde,[W(d,null,{default:X(()=>[W(s,null,{default:X(()=>[W(mde)]),_:1}),W(d,null,{default:X(()=>[W(u,{width:"6.25rem"},{default:X(()=>[W(Cde)]),_:1}),W(f,{style:{color:"#333"}},{default:X(()=>[W(c,{class:"my-main"},{default:X(({Component:p})=>[W(nn,{name:"el-zoom-in-top"},{default:X(()=>[(b(),le(st(p)))]),_:2},1024)]),_:1})]),_:1})]),_:1})]),_:1})])}}},Ode=Sv($de,[["__scopeId","data-v-6c618134"]]),Ade=[{path:"/",name:"layout",component:Ode,redirect:"/saleHome",meta:{title:"里海收银系统"},children:[{path:"/saleHome",name:"saleHome",meta:{title:"收银"},component:()=>qn(()=>import("./index-DdiPW3dN.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10]),import.meta.url)},{path:"/saleOrder",name:"saleOrder",meta:{title:"收银订单"},component:()=>qn(()=>import("./index-xBkMFEcu.js"),__vite__mapDeps([11,1,3,7,8,9,4,12]),import.meta.url)},{path:"/order",name:"order",meta:{title:"线上采购"},component:()=>qn(()=>import("./index-CEe2BLLq.js"),__vite__mapDeps([13,1,3,4,14,9]),import.meta.url)},{path:"/subOrder",name:"subOrder",meta:{title:"订单统计"},component:()=>qn(()=>import("./index-Be4iZhHJ.js"),__vite__mapDeps([15,1,3,7,8,9,4,16]),import.meta.url)},{path:"/order",name:"order",meta:{title:"预约取货"},component:()=>qn(()=>import("./index-CEe2BLLq.js"),__vite__mapDeps([13,1,3,4,14,9]),import.meta.url)},{path:"/wallet",name:"wallet",meta:{title:"提现"},component:()=>qn(()=>import("./index-BjO2fJoc.js"),__vite__mapDeps([17,3,4,18]),import.meta.url)},{path:"/convert",name:"convert",meta:{title:"订单核销"},component:()=>qn(()=>import("./index-CSvg3wbO.js"),__vite__mapDeps([19,1,4,20,9]),import.meta.url)},{path:"/putStorage",name:"putStorage",meta:{title:"入库登记"},component:()=>qn(()=>import("./index-BLGV5dWE.js"),__vite__mapDeps([21,6,5,22]),import.meta.url)},{path:"/stock",name:"stock",meta:{title:"入库登记"},component:()=>qn(()=>import("./index-U--D72EK.js"),__vite__mapDeps([23,6,5,24]),import.meta.url)},{path:"/user",name:"user",meta:{title:"用户"},component:()=>qn(()=>import("./index-DJKQk7Zm.js"),__vite__mapDeps([25,2,3,5,8,1,4,26]),import.meta.url)},{path:"/test",name:"test",component:()=>qn(()=>import("./test-DygWT1QV.js"),__vite__mapDeps([27,28]),import.meta.url)}]},{path:"/login",name:"login",component:()=>qn(()=>import("./index-HN4ryKvA.js"),__vite__mapDeps([29,2,30]),import.meta.url)},{path:"/:catchAll(.*)",name:"notFound",component:()=>qn(()=>import("./index-vhkeCFJv.js"),__vite__mapDeps([]),import.meta.url)}],qb=yue({history:Uie(),routes:Ade});qb.beforeEach((e,t,n)=>{const o=bd();e.name!=="login"&&!o.Token?n({name:"login"}):n()});const Ub=qb,Vi=Fg(g9);for(const[e,t]of Object.entries(qL))Vi.component(e,t);const Nde=Cue();Vi.use(Ub);Vi.use(Nde);Vi.use(fie,{locale:pie});Vi.mount("#app");export{cr as A,Jse as B,cie as C,Sse as D,no as E,Fe as F,wt as G,bue as H,hb as I,S as J,Db as K,bt as L,Op as M,De as N,un as O,Wce as P,Ub as Q,Sv as _,xo as a,Ze as b,b as c,le as d,k as e,W as f,mt as g,Pc as h,Mt as i,tt as j,M as k,ht as l,Yt as m,We as n,et as o,ne as p,Vw as q,L as r,Bw as s,Te as t,bd as u,kr as v,X as w,Er as x,i as y,$ as z}; diff --git a/build/assets/index-CtJNP07e.js b/build/assets/index-CSvg3wbO.js similarity index 98% rename from build/assets/index-CtJNP07e.js rename to build/assets/index-CSvg3wbO.js index 6060567..ecad522 100644 --- a/build/assets/index-CtJNP07e.js +++ b/build/assets/index-CSvg3wbO.js @@ -1 +1 @@ -import{_ as q,u as W,r as l,b as f,h as E,c as s,k as o,e,t as a,f as _,w as m,g as w,i as G,j as $,F as P,l as T,p as u,m as b,E as F,z as j,d as N,I as X,o as H,a as Y,q as Z,s as ee,n as M,L as A,M as te}from"./index-B9unL6O8.js";import{f as se,k as oe,w as ie,j as ae}from"./store-DNW8I_iw.js";/* empty css */import{p as le}from"./padding-DLHwO6AB.js";const ne={class:"my-order"},ce={class:"header-nav"},de={class:"nav-item"},_e={class:"nav-item-clear"},re={class:"header-input"},ve={class:"order-lists","infinite-scroll-distance":300,"infinite-scroll-delay":500,"infinite-scroll-immediate":!1,style:{overflow:"auto"}},ue=["onClick"],fe={class:"top"},pe={class:"create-time"},he={class:"shop"},ye={key:0,class:"left"},me={key:0,class:"shop-name"},ke={class:"right"},ge={class:"money"},$e={class:"count"},be={class:"bottom"},we={class:"pay"},Ce={key:0},xe={key:1},Re={key:2},Ie={key:3},ze={key:4},Oe={key:5},Ve={key:1,style:{color:"#ff4a00"}},Be={key:0,class:"cashier"},De={key:1,class:"cashier",style:{color:"#ff4a00"}},Le={key:0,class:"load-end"},Se={key:1,class:"load-end"},Ae={__name:"order",props:{type:{type:Number,default:2}},emits:["backOne"],setup(C,{expose:t,emit:h}){W(),l([]),l(null);const n=l({verify_code:"",page_no:1,page_size:15}),r=l(!1),k=l(0),g=l(0),I=l(!1),c=l([]),p=(x=!1)=>{r.value||(r.value=!0,n.value.verify_code?(n.value.verify_code=n.value.verify_code.replace("—","-"),n.value.verify_code=n.value.verify_code.replace(/\uFF0D/,"-"),n.value.verify_code=n.value.verify_code.replace(" ",""),se({verify_code:n.value.verify_code}).then(d=>{c.value=[d.data],g.value=0,b.emit("set-sale-order-detail",c.value[0]),k.value=d.data.count,r.value=!1,c.value[0].is_writeoff&&F.warning("订单已核销过")}).catch(d=>{r.value=!1,F.error(d.msg||"没有找到该订单"),c.value=[],b.emit("set-sale-order-detail",{})})):oe(n.value).then(d=>{c.value=[...c.value,...d.data.lists],n.value.page_no==1&&b.emit("set-sale-order-detail",c.value[0]),k.value=d.data.count,n.value.page_no++,r.value=!1}).catch(d=>{r.value=!1}))},z=(x,d)=>{g.value=d,b.emit("set-sale-order-detail",x)},y=x=>{n.value.verify_code=x,g.value=0,n.value.page_no=1,p(!0)},R=h,O=()=>{b.emit("set-sale-order-detail",{}),c.value=[],R("backOne")};return t({setCode:y}),(x,d)=>{const V=f("el-button"),B=f("el-input"),D=f("el-image"),L=f("spna"),S=E("loading"),J=E("infinite-scroll");return s(),o("div",ne,[e("div",ce,[e("div",de,a(C.type==2?"核销订单":"核销记录"),1),e("div",_e,[_(V,{type:"primary",size:"small",onClick:O},{default:m(()=>[w("返回上一页")]),_:1})])]),e("div",re,[_(B,{modelValue:n.value.verify_code,"onUpdate:modelValue":d[1]||(d[1]=i=>n.value.verify_code=i),placeholder:"请输入核销码",onKeydown:d[2]||(d[2]=G(i=>p(!0),["enter"])),clearable:""},{append:m(()=>[_(V,{type:"primary",style:{"background-color":"#1890ff",color:"#fff","border-radius":"0 0.315rem 0.315rem 0"},onClick:d[0]||(d[0]=i=>p(!0))},{default:m(()=>[w("搜索")]),_:1})]),_:1},8,["modelValue"])]),$((s(),o("div",ve,[(s(!0),o(P,null,T(c.value,(i,K)=>(s(),o("div",{class:j(["item",{"item-active":g.value==K}]),key:K,onClick:U=>z(i,K)},[e("div",fe,[e("div",{class:j(["sn","cahier"])},"单号: "+a(i.order_id),1),e("div",pe,a(i.pay_time),1)]),e("div",he,[i.product?(s(),o("div",ye,[(s(!0),o(P,null,T(i.product.slice(0,5),(U,Q)=>(s(),N(D,{key:Q,src:U.cart_info.image,class:"shop-img"},null,8,["src"]))),128)),i.product.length==1?(s(),o("div",me,a(i.product[0].store_name),1)):u("",!0)])):u("",!0),e("div",ke,[e("div",ge,"¥"+a(i.pay_price),1),e("div",$e,"共"+a(i.total_num)+"款商品",1)])]),e("div",be,[e("div",we,[i.paid?(s(),o("div",Ce,[w(a(i.paid_name)+" ",1),i.pay_type_name?(s(),N(L,{key:0},{default:m(()=>[w("("+a(i.pay_type_name)+")",1)]),_:2},1024)):i.pay_type==9?(s(),o("span",xe,"(微信收款)")):i.pay_type==17?(s(),o("span",Re,"(现金支付)")):i.pay_type==13?(s(),o("span",Ie,"(支付宝收款)")):i.pay_type==3?(s(),o("span",ze,"(余额支付)")):i.pay_type==1?(s(),o("span",Oe,"(微信支付)")):u("",!0)])):(s(),o("div",Ve,a(i.paid_name),1))]),i.is_writeoff==0?(s(),o("div",Be,"核销码:"+a(i.verify_code),1)):(s(),o("div",De,"已核销:"+a(i.verify_code),1))])],10,ue))),128)),I.value?(s(),o("div",Le,"没有更多了")):u("",!0),r.value?(s(),o("div",Se,"加载中...")):u("",!0)])),[[S,r.value],[J,p]])])}}},Ee=q(Ae,[["__scopeId","data-v-f1ecc2f9"]]),v=C=>(Z("data-v-8ae10798"),C=C(),ee(),C),Fe={class:"my-order"},Ne={key:0,class:"detail"},Ke={class:"table","infinite-scroll-distance":300,"infinite-scroll-delay":300,style:{overflow:"auto"},"infinite-scroll-immediate":!1},Me=v(()=>e("div",{class:"table-title"},"订单信息",-1)),Ue={class:"table-info"},Pe={class:"info-item"},Te=v(()=>e("div",{class:"info-item-title"},"订单编号:",-1)),je={class:"info-item-info"},qe={class:"info-item"},We=v(()=>e("div",{class:"info-item-title"},"商品款数:",-1)),Ge={class:"info-item-info"},He={class:"info-item"},Je=v(()=>e("div",{class:"info-item-title"},"商品总价:",-1)),Qe={class:"info-item-info"},Xe={class:"info-item"},Ye=v(()=>e("div",{class:"info-item-title"},"创建时间:",-1)),Ze={class:"info-item-info"},et={class:"info-item"},tt=v(()=>e("div",{class:"info-item-title"},"优惠抵扣:",-1)),st={class:"info-item-info"},ot={class:"info-item"},it=v(()=>e("div",{class:"info-item-title"},"实际支付:",-1)),at={class:"info-item-info"},lt={class:"info-item"},nt=v(()=>e("div",{class:"info-item-title"},"支付时间:",-1)),ct={class:"info-item-info"},dt={class:"info-item"},_t=v(()=>e("div",{class:"info-item-title"},"支付方式:",-1)),rt={class:"info-item-info"},vt={key:0},ut={key:1},ft={key:2},pt={key:3},ht={key:4},yt={key:5},mt={key:0,class:"table-title"},kt={key:1,class:"table-info"},gt={class:"info-item"},$t=v(()=>e("div",{class:"info-item-title"},"用户ID:",-1)),bt={class:"info-item-info"},wt={class:"info-item"},Ct=v(()=>e("div",{class:"info-item-title"},"用户昵称:",-1)),xt={class:"info-item-info"},Rt={class:"info-item"},It=v(()=>e("div",{class:"info-item-title"},"用户电话:",-1)),zt={class:"info-item-info"},Ot={style:{"font-size":"0.9rem"}},Vt={style:{color:"#ff4a00"}},Bt={style:{display:"flex","align-items":"center"}},Dt={style:{"margin-left":"0.5rem"}},Lt=v(()=>e("div",{style:{height:"8rem"}},null,-1)),St={class:"footer"},At={key:1},Et={key:1},Ft={__name:"detail",setup(C){W(),X();const t=l({id:""});l([]),l(null);const h=l(!1);l(0),l(0),l(["商品信息","订单详情"]),l(""),l(!1);const n=l({page_no:1,page_size:15,loadend:!1,loading:!1}),r=l([]),k=()=>console.log("触底"),g=()=>{ie({verify_code:t.value.verify_code}).then(c=>{c.show==0&&c.msg=="核销成功"&&F.success(c.msg),t.value.is_writeoff=1})},I=()=>{ae({id:t.value.id}).then(c=>{b.emit("letPrintReceipt",c.data)})};return H(()=>{b.on("set-sale-order-detail",c=>{console.log("===",c),t.value=c,n.value.page_no=1,n.value.loadend=!1,n.value.loading=!1,r.value=[]})}),Y(()=>{b.off("set-sale-order-detail")}),(c,p)=>{var B;const z=f("el-image"),y=f("el-table-column"),R=f("el-table"),O=f("el-button"),x=f("el-empty"),d=E("infinite-scroll"),V=E("loading");return s(),o("div",Fe,[t.value.id?$((s(),o("div",Ne,[$((s(),o("div",Ke,[Me,e("div",Ue,[e("div",Pe,[Te,e("div",je,a(t.value.order_id),1)]),e("div",qe,[We,e("div",Ge,a(t.value.total_num||0),1)]),e("div",He,[Je,e("div",Qe,"¥"+a(t.value.total_price),1)]),e("div",Xe,[Ye,e("div",Ze,a(t.value.pay_time),1)]),e("div",et,[tt,e("div",st,"¥"+a(t.value.deduction_price),1)]),e("div",ot,[it,e("div",at,"¥"+a(t.value.pay_price),1)]),e("div",lt,[nt,e("div",ct,a(t.value.pay_time),1)]),e("div",dt,[_t,e("div",rt,[t.value.pay_type_name?(s(),o("span",vt,a(t.value.pay_type_name),1)):t.value.pay_type==9?(s(),o("span",ut,"微信收款")):t.value.pay_type==17?(s(),o("span",ft,"现金支付")):t.value.pay_type==13?(s(),o("span",pt,"支付宝收款")):t.value.pay_type==3?(s(),o("span",ht,"余额支付")):t.value.pay_type==1?(s(),o("span",yt,"微信支付")):u("",!0)])])]),t.value.uid?(s(),o("div",mt,"用户信息")):u("",!0),t.value.uid?(s(),o("div",kt,[e("div",gt,[$t,e("div",bt,a(t.value.uid),1)]),e("div",wt,[Ct,e("div",xt,a(t.value.nickname),1)]),e("div",Rt,[It,e("div",zt,a(t.value.mobile),1)])])):u("",!0),e("div",Ot,[w(" 共计 "),e("span",Vt,a(((B=t.value.product)==null?void 0:B.length)||" "),1),w(" 款商品 ")]),_(R,{data:t.value.product},{default:m(()=>[_(y,{label:"商品信息"},{default:m(({row:D})=>{var L,S;return[e("div",Bt,[_(z,{style:{height:"3rem",width:"3rem","flex-shrink":"0"},src:(L=D.cart_info)==null?void 0:L.image},null,8,["src"]),e("span",Dt,a((S=D.cart_info)==null?void 0:S.name),1)])]}),_:1}),_(y,{prop:"cart_info.store_info",label:"商品规格",width:"150"}),_(y,{prop:"cart_info.price",label:"单价",width:"150"}),_(y,{prop:"cart_info.cart_num",label:"数量",width:"150"}),_(y,{prop:"cart_info.pay_price",label:"总价",width:"150"})]),_:1},8,["data"]),Lt])),[[d,k]]),e("div",St,[t.value.is_writeoff==0?(s(),N(O,{key:0,type:"primary",size:"large",disabled:t.value.is_writeoff,onClick:g},{default:m(()=>[w("立即核销")]),_:1},8,["disabled"])):u("",!0),t.value.is_writeoff==1?(s(),o("div",At,"该订单已核销")):u("",!0),t.value.is_writeoff==1?(s(),N(O,{key:2,style:{"margin-left":"1rem"},type:"warning",size:"large",onClick:I},{default:m(()=>[w("打印小票")]),_:1})):u("",!0)])])),[[V,h.value]]):(s(),o("div",Et,[_(x,{description:"没找到核销订单信息"})]))])}}},Nt=q(Ft,[["__scopeId","data-v-8ae10798"]]),Kt={class:"my-card"},Mt={class:"my-code"},Ut=e("h2",null,"订单核销",-1),Pt={class:"box"},Tt=e("span",null,"查看核销记录",-1),Ht={__name:"index",setup(C){const t=l(1),h=l(""),n=l(null),r=l(null),k=()=>{if(h.value=="")return F.error("请输入订单编号");t.value=2,M(()=>{r.value.setCode(h.value)})},g=()=>{t.value=3,M(()=>{r.value.setCode("")})},I=()=>{k()};return H(()=>{M(()=>{n.value.focus()})}),(c,p)=>{const z=f("ArrowRightBold"),y=f("el-icon");return s(),o("div",Kt,[$(e("div",Mt,[Ut,e("div",Pt,[$(e("input",{ref_key:"inputRef",ref:n,"onUpdate:modelValue":p[0]||(p[0]=R=>h.value=R),placeholder:"请输入核销码",class:"input",onKeyup:G(k,["enter"])},null,544),[[te,h.value]]),e("div",{class:"btn",onClick:k},"查询")]),e("div",{class:"to-list",onClick:g},[Tt,_(y,null,{default:m(()=>[_(z)]),_:1})])],512),[[A,t.value==1]]),$(_(Ee,{type:t.value,style:{"flex-shrink":"0"},ref_key:"orderRef",ref:r,onBackOne:p[1]||(p[1]=R=>{t.value=1,h.value=""})},null,8,["type"]),[[A,t.value!=1]]),$(_(le,null,null,512),[[A,t.value!=1]]),$(_(Nt,{ref:"detailRef",onReInit:I},null,512),[[A,t.value!=1]])])}}};export{Ht as default}; +import{_ as q,u as W,r as l,b as f,h as E,c as s,k as o,e,t as a,f as _,w as m,g as w,i as G,j as $,F as P,l as T,p as u,m as b,E as F,z as j,d as N,I as X,o as H,a as Y,q as Z,s as ee,n as M,L as A,M as te}from"./index-CEprPOh1.js";import{f as se,l as oe,w as ie,k as ae}from"./store-BoFe3Agt.js";/* empty css */import{p as le}from"./padding-Bq_IbaOz.js";const ne={class:"my-order"},ce={class:"header-nav"},de={class:"nav-item"},_e={class:"nav-item-clear"},re={class:"header-input"},ve={class:"order-lists","infinite-scroll-distance":300,"infinite-scroll-delay":500,"infinite-scroll-immediate":!1,style:{overflow:"auto"}},ue=["onClick"],fe={class:"top"},pe={class:"create-time"},he={class:"shop"},ye={key:0,class:"left"},me={key:0,class:"shop-name"},ke={class:"right"},ge={class:"money"},$e={class:"count"},be={class:"bottom"},we={class:"pay"},Ce={key:0},xe={key:1},Re={key:2},Ie={key:3},ze={key:4},Oe={key:5},Ve={key:1,style:{color:"#ff4a00"}},Be={key:0,class:"cashier"},De={key:1,class:"cashier",style:{color:"#ff4a00"}},Le={key:0,class:"load-end"},Se={key:1,class:"load-end"},Ae={__name:"order",props:{type:{type:Number,default:2}},emits:["backOne"],setup(C,{expose:t,emit:h}){W(),l([]),l(null);const n=l({verify_code:"",page_no:1,page_size:15}),r=l(!1),k=l(0),g=l(0),I=l(!1),c=l([]),p=(x=!1)=>{r.value||(r.value=!0,n.value.verify_code?(n.value.verify_code=n.value.verify_code.replace("—","-"),n.value.verify_code=n.value.verify_code.replace(/\uFF0D/,"-"),n.value.verify_code=n.value.verify_code.replace(" ",""),se({verify_code:n.value.verify_code}).then(d=>{c.value=[d.data],g.value=0,b.emit("set-sale-order-detail",c.value[0]),k.value=d.data.count,r.value=!1,c.value[0].is_writeoff&&F.warning("订单已核销过")}).catch(d=>{r.value=!1,F.error(d.msg||"没有找到该订单"),c.value=[],b.emit("set-sale-order-detail",{})})):oe(n.value).then(d=>{c.value=[...c.value,...d.data.lists],n.value.page_no==1&&b.emit("set-sale-order-detail",c.value[0]),k.value=d.data.count,n.value.page_no++,r.value=!1}).catch(d=>{r.value=!1}))},z=(x,d)=>{g.value=d,b.emit("set-sale-order-detail",x)},y=x=>{n.value.verify_code=x,g.value=0,n.value.page_no=1,p(!0)},R=h,O=()=>{b.emit("set-sale-order-detail",{}),c.value=[],R("backOne")};return t({setCode:y}),(x,d)=>{const V=f("el-button"),B=f("el-input"),D=f("el-image"),L=f("spna"),S=E("loading"),J=E("infinite-scroll");return s(),o("div",ne,[e("div",ce,[e("div",de,a(C.type==2?"核销订单":"核销记录"),1),e("div",_e,[_(V,{type:"primary",size:"small",onClick:O},{default:m(()=>[w("返回上一页")]),_:1})])]),e("div",re,[_(B,{modelValue:n.value.verify_code,"onUpdate:modelValue":d[1]||(d[1]=i=>n.value.verify_code=i),placeholder:"请输入核销码",onKeydown:d[2]||(d[2]=G(i=>p(!0),["enter"])),clearable:""},{append:m(()=>[_(V,{type:"primary",style:{"background-color":"#1890ff",color:"#fff","border-radius":"0 0.315rem 0.315rem 0"},onClick:d[0]||(d[0]=i=>p(!0))},{default:m(()=>[w("搜索")]),_:1})]),_:1},8,["modelValue"])]),$((s(),o("div",ve,[(s(!0),o(P,null,T(c.value,(i,K)=>(s(),o("div",{class:j(["item",{"item-active":g.value==K}]),key:K,onClick:U=>z(i,K)},[e("div",fe,[e("div",{class:j(["sn","cahier"])},"单号: "+a(i.order_id),1),e("div",pe,a(i.pay_time),1)]),e("div",he,[i.product?(s(),o("div",ye,[(s(!0),o(P,null,T(i.product.slice(0,5),(U,Q)=>(s(),N(D,{key:Q,src:U.cart_info.image,class:"shop-img"},null,8,["src"]))),128)),i.product.length==1?(s(),o("div",me,a(i.product[0].store_name),1)):u("",!0)])):u("",!0),e("div",ke,[e("div",ge,"¥"+a(i.pay_price),1),e("div",$e,"共"+a(i.total_num)+"款商品",1)])]),e("div",be,[e("div",we,[i.paid?(s(),o("div",Ce,[w(a(i.paid_name)+" ",1),i.pay_type_name?(s(),N(L,{key:0},{default:m(()=>[w("("+a(i.pay_type_name)+")",1)]),_:2},1024)):i.pay_type==9?(s(),o("span",xe,"(微信收款)")):i.pay_type==17?(s(),o("span",Re,"(现金支付)")):i.pay_type==13?(s(),o("span",Ie,"(支付宝收款)")):i.pay_type==3?(s(),o("span",ze,"(余额支付)")):i.pay_type==1?(s(),o("span",Oe,"(微信支付)")):u("",!0)])):(s(),o("div",Ve,a(i.paid_name),1))]),i.is_writeoff==0?(s(),o("div",Be,"核销码:"+a(i.verify_code),1)):(s(),o("div",De,"已核销:"+a(i.verify_code),1))])],10,ue))),128)),I.value?(s(),o("div",Le,"没有更多了")):u("",!0),r.value?(s(),o("div",Se,"加载中...")):u("",!0)])),[[S,r.value],[J,p]])])}}},Ee=q(Ae,[["__scopeId","data-v-f1ecc2f9"]]),v=C=>(Z("data-v-8ae10798"),C=C(),ee(),C),Fe={class:"my-order"},Ne={key:0,class:"detail"},Ke={class:"table","infinite-scroll-distance":300,"infinite-scroll-delay":300,style:{overflow:"auto"},"infinite-scroll-immediate":!1},Me=v(()=>e("div",{class:"table-title"},"订单信息",-1)),Ue={class:"table-info"},Pe={class:"info-item"},Te=v(()=>e("div",{class:"info-item-title"},"订单编号:",-1)),je={class:"info-item-info"},qe={class:"info-item"},We=v(()=>e("div",{class:"info-item-title"},"商品款数:",-1)),Ge={class:"info-item-info"},He={class:"info-item"},Je=v(()=>e("div",{class:"info-item-title"},"商品总价:",-1)),Qe={class:"info-item-info"},Xe={class:"info-item"},Ye=v(()=>e("div",{class:"info-item-title"},"创建时间:",-1)),Ze={class:"info-item-info"},et={class:"info-item"},tt=v(()=>e("div",{class:"info-item-title"},"优惠抵扣:",-1)),st={class:"info-item-info"},ot={class:"info-item"},it=v(()=>e("div",{class:"info-item-title"},"实际支付:",-1)),at={class:"info-item-info"},lt={class:"info-item"},nt=v(()=>e("div",{class:"info-item-title"},"支付时间:",-1)),ct={class:"info-item-info"},dt={class:"info-item"},_t=v(()=>e("div",{class:"info-item-title"},"支付方式:",-1)),rt={class:"info-item-info"},vt={key:0},ut={key:1},ft={key:2},pt={key:3},ht={key:4},yt={key:5},mt={key:0,class:"table-title"},kt={key:1,class:"table-info"},gt={class:"info-item"},$t=v(()=>e("div",{class:"info-item-title"},"用户ID:",-1)),bt={class:"info-item-info"},wt={class:"info-item"},Ct=v(()=>e("div",{class:"info-item-title"},"用户昵称:",-1)),xt={class:"info-item-info"},Rt={class:"info-item"},It=v(()=>e("div",{class:"info-item-title"},"用户电话:",-1)),zt={class:"info-item-info"},Ot={style:{"font-size":"0.9rem"}},Vt={style:{color:"#ff4a00"}},Bt={style:{display:"flex","align-items":"center"}},Dt={style:{"margin-left":"0.5rem"}},Lt=v(()=>e("div",{style:{height:"8rem"}},null,-1)),St={class:"footer"},At={key:1},Et={key:1},Ft={__name:"detail",setup(C){W(),X();const t=l({id:""});l([]),l(null);const h=l(!1);l(0),l(0),l(["商品信息","订单详情"]),l(""),l(!1);const n=l({page_no:1,page_size:15,loadend:!1,loading:!1}),r=l([]),k=()=>console.log("触底"),g=()=>{ie({verify_code:t.value.verify_code}).then(c=>{c.show==0&&c.msg=="核销成功"&&F.success(c.msg),t.value.is_writeoff=1})},I=()=>{ae({id:t.value.id}).then(c=>{b.emit("letPrintReceipt",c.data)})};return H(()=>{b.on("set-sale-order-detail",c=>{console.log("===",c),t.value=c,n.value.page_no=1,n.value.loadend=!1,n.value.loading=!1,r.value=[]})}),Y(()=>{b.off("set-sale-order-detail")}),(c,p)=>{var B;const z=f("el-image"),y=f("el-table-column"),R=f("el-table"),O=f("el-button"),x=f("el-empty"),d=E("infinite-scroll"),V=E("loading");return s(),o("div",Fe,[t.value.id?$((s(),o("div",Ne,[$((s(),o("div",Ke,[Me,e("div",Ue,[e("div",Pe,[Te,e("div",je,a(t.value.order_id),1)]),e("div",qe,[We,e("div",Ge,a(t.value.total_num||0),1)]),e("div",He,[Je,e("div",Qe,"¥"+a(t.value.total_price),1)]),e("div",Xe,[Ye,e("div",Ze,a(t.value.pay_time),1)]),e("div",et,[tt,e("div",st,"¥"+a(t.value.deduction_price),1)]),e("div",ot,[it,e("div",at,"¥"+a(t.value.pay_price),1)]),e("div",lt,[nt,e("div",ct,a(t.value.pay_time),1)]),e("div",dt,[_t,e("div",rt,[t.value.pay_type_name?(s(),o("span",vt,a(t.value.pay_type_name),1)):t.value.pay_type==9?(s(),o("span",ut,"微信收款")):t.value.pay_type==17?(s(),o("span",ft,"现金支付")):t.value.pay_type==13?(s(),o("span",pt,"支付宝收款")):t.value.pay_type==3?(s(),o("span",ht,"余额支付")):t.value.pay_type==1?(s(),o("span",yt,"微信支付")):u("",!0)])])]),t.value.uid?(s(),o("div",mt,"用户信息")):u("",!0),t.value.uid?(s(),o("div",kt,[e("div",gt,[$t,e("div",bt,a(t.value.uid),1)]),e("div",wt,[Ct,e("div",xt,a(t.value.nickname),1)]),e("div",Rt,[It,e("div",zt,a(t.value.mobile),1)])])):u("",!0),e("div",Ot,[w(" 共计 "),e("span",Vt,a(((B=t.value.product)==null?void 0:B.length)||" "),1),w(" 款商品 ")]),_(R,{data:t.value.product},{default:m(()=>[_(y,{label:"商品信息"},{default:m(({row:D})=>{var L,S;return[e("div",Bt,[_(z,{style:{height:"3rem",width:"3rem","flex-shrink":"0"},src:(L=D.cart_info)==null?void 0:L.image},null,8,["src"]),e("span",Dt,a((S=D.cart_info)==null?void 0:S.name),1)])]}),_:1}),_(y,{prop:"cart_info.store_info",label:"商品规格",width:"150"}),_(y,{prop:"cart_info.price",label:"单价",width:"150"}),_(y,{prop:"cart_info.cart_num",label:"数量",width:"150"}),_(y,{prop:"cart_info.pay_price",label:"总价",width:"150"})]),_:1},8,["data"]),Lt])),[[d,k]]),e("div",St,[t.value.is_writeoff==0?(s(),N(O,{key:0,type:"primary",size:"large",disabled:t.value.is_writeoff,onClick:g},{default:m(()=>[w("立即核销")]),_:1},8,["disabled"])):u("",!0),t.value.is_writeoff==1?(s(),o("div",At,"该订单已核销")):u("",!0),t.value.is_writeoff==1?(s(),N(O,{key:2,style:{"margin-left":"1rem"},type:"warning",size:"large",onClick:I},{default:m(()=>[w("打印小票")]),_:1})):u("",!0)])])),[[V,h.value]]):(s(),o("div",Et,[_(x,{description:"没找到核销订单信息"})]))])}}},Nt=q(Ft,[["__scopeId","data-v-8ae10798"]]),Kt={class:"my-card"},Mt={class:"my-code"},Ut=e("h2",null,"订单核销",-1),Pt={class:"box"},Tt=e("span",null,"查看核销记录",-1),Ht={__name:"index",setup(C){const t=l(1),h=l(""),n=l(null),r=l(null),k=()=>{if(h.value=="")return F.error("请输入订单编号");t.value=2,M(()=>{r.value.setCode(h.value)})},g=()=>{t.value=3,M(()=>{r.value.setCode("")})},I=()=>{k()};return H(()=>{M(()=>{n.value.focus()})}),(c,p)=>{const z=f("ArrowRightBold"),y=f("el-icon");return s(),o("div",Kt,[$(e("div",Mt,[Ut,e("div",Pt,[$(e("input",{ref_key:"inputRef",ref:n,"onUpdate:modelValue":p[0]||(p[0]=R=>h.value=R),placeholder:"请输入核销码",class:"input",onKeyup:G(k,["enter"])},null,544),[[te,h.value]]),e("div",{class:"btn",onClick:k},"查询")]),e("div",{class:"to-list",onClick:g},[Tt,_(y,null,{default:m(()=>[_(z)]),_:1})])],512),[[A,t.value==1]]),$(_(Ee,{type:t.value,style:{"flex-shrink":"0"},ref_key:"orderRef",ref:r,onBackOne:p[1]||(p[1]=R=>{t.value=1,h.value=""})},null,8,["type"]),[[A,t.value!=1]]),$(_(le,null,null,512),[[A,t.value!=1]]),$(_(Nt,{ref:"detailRef",onReInit:I},null,512),[[A,t.value!=1]])])}}};export{Ht as default}; diff --git a/build/assets/index-BoLif8Bm.js b/build/assets/index-DJKQk7Zm.js similarity index 99% rename from build/assets/index-BoLif8Bm.js rename to build/assets/index-DJKQk7Zm.js index a572ce0..9d2506d 100644 --- a/build/assets/index-BoLif8Bm.js +++ b/build/assets/index-DJKQk7Zm.js @@ -1 +1 @@ -import{u as be,r as d,G as De,b as y,c as n,k as g,f as a,w as t,E as D,_ as ke,o as $e,m as K,a as Ve,h as fe,e,g as f,F as ne,l as re,d as O,p as oe,i as Ne,j as ge,z as ce,t as h,q as we,s as Ce,J as He,n as pe,I as Qe}from"./index-B9unL6O8.js";import{a as Xe,b as Ye,u as Ze,c as Ee,d as Ie,e as Pe,f as el,g as ll,h as al,i as tl}from"./user-DptWFEfy.js";import"./moment-Cl4UOzQZ.js";import{r as ye}from"./axiosAPI-BnxnV-Ca.js";import{_ as je}from"./authCode-D610lJnm.js";import{h as sl,l as ol,m as il}from"./store-DNW8I_iw.js";import{p as nl}from"./padding-DLHwO6AB.js";function Se(C){return ye.get("/city",{params:C})}function Ue(C){return ye.get("/area",{params:C})}function xe(C){return ye.get("/street",{params:C})}function ze(C){return ye.get("/village",{params:C})}function Ae(C){return ye.get("/brigade",{params:C})}const ul={class:"add-user"},dl={__name:"add",emits:["close"],setup(C,{expose:r,emit:$}){const R=be(),F=d(null),c=De({mobile:"",code:"",real_name:"",user_ship:0,selectedValues:[]}),j=De({mobile:[{required:!0,message:"请输入手机号",trigger:"blur"},{pattern:/^1[3456789]\d{9}$/,message:"请输入正确的手机号",trigger:"blur"}],code:[{required:!0,message:"请输入验证码",trigger:"blur"}],real_name:[{required:!0,message:"请输入用户姓名",trigger:"blur"}],user_ship:[{required:!0,message:"请选择用户类型",trigger:"change"}],selectedValues:[{required:!0,message:"请选择用户地址",trigger:"change"}]}),Y=d([]),B=async(q,k)=>{const N=q.level;let b;if(N!==0&&!q.data.code)return k([]);N===0?(b=await Se({province_code:51e4}),b=b.data.map(A=>({code:A.city_code,name:A.city_name}))):N===1?(b=await Ue({city_code:q.data.code}),b=b.data.map(A=>({code:A.area_code,name:A.area_name}))):N===2?(b=await xe({area_code:q.data.code}),b=b.data.map(A=>({code:A.street_code,name:A.street_name}))):N===3?(b=await ze({street_code:q.data.code}),b=b.data.map(A=>({code:A.village_code,name:A.village_name}))):N===4&&(b=await Ae({village_code:q.data.code}),b=b.data.map(A=>({code:A.id,name:A.brigade_name,leaf:!0}))),k(b)},H={value:"code",label:"name",children:"children",multiple:!1,lazy:!0,lazyLoad:B};d([]);const V=$,w=()=>{F.value.validate(async q=>{if(q){let k={};k.mobile=c.mobile,k.code=c.code,k.user_ship=c.user_ship,k.real_name=c.real_name,k.province="510000",k.city=c.selectedValues[0],k.area=c.selectedValues[1],k.street=c.selectedValues[2],k.village=c.selectedValues[3],k.brigade=c.selectedValues[4],k.store_id=R.userInfo.store_id,Xe(k).then(N=>{c.mobile="",c.code="",c.user_ship=0,c.real_name="",c.selectedValues=[],F.value.resetFields(),V("close")})}})},z=d(null),P=()=>{F.value.validateField("mobile",q=>{q&&Ye({mobile:c.mobile}).then(k=>{D.success("发送成功"),z.value.startCountDown()}).catch(k=>{D.error("发送失败")})})};return r({addUser:w}),(q,k)=>{const N=y("el-input"),b=y("el-form-item"),A=y("el-cascader"),ae=y("el-form");return n(),g("div",ul,[a(ae,{model:c,rules:j,ref_key:"formDataRef",ref:F,"label-width":"80px"},{default:t(()=>[a(b,{label:"用户电话",prop:"mobile"},{default:t(()=>[a(N,{modelValue:c.mobile,"onUpdate:modelValue":k[0]||(k[0]=E=>c.mobile=E),placeholder:"请输入用户电话"},null,8,["modelValue"])]),_:1}),a(b,{label:"验证码",prop:"code"},{default:t(()=>[a(N,{modelValue:c.code,"onUpdate:modelValue":k[1]||(k[1]=E=>c.code=E),placeholder:"请输入验证码",style:{flex:"1"}},null,8,["modelValue"]),a(je,{ref_key:"authCodeRef",ref:z,style:{"margin-left":"1rem"},onSendCode:P,start:!1},null,512)]),_:1}),a(b,{label:"用户姓名",prop:"real_name"},{default:t(()=>[a(N,{modelValue:c.real_name,"onUpdate:modelValue":k[2]||(k[2]=E=>c.real_name=E),placeholder:"请输入用户姓名"},null,8,["modelValue"])]),_:1}),a(b,{label:"用户地址",prop:"selectedValues"},{default:t(()=>[a(A,{style:{width:"100%"},modelValue:c.selectedValues,"onUpdate:modelValue":k[3]||(k[3]=E=>c.selectedValues=E),options:Y.value,props:H,load:B,class:"w-full"},null,8,["modelValue","options"])]),_:1})]),_:1},8,["model","rules"])])}}},Re=C=>(we("data-v-df06e4b9"),C=C(),Ce(),C),rl={class:"my-order"},cl={class:"header-nav"},vl=Re(()=>e("div",{class:"nav-item"},h("用户列表"),-1)),_l={class:"header-row"},ml=Re(()=>e("div",{class:"label"},"用户类型",-1)),pl={class:"header-row"},fl=Re(()=>e("div",{class:"label"},"用户地区",-1)),yl={class:"header-input"},hl={class:"order-lists","infinite-scroll-distance":300,"infinite-scroll-delay":500,style:{overflow:"auto"}},gl=["onClick"],bl={style:{display:"flex","flex-direction":"column","justify-content":"space-around",flex:"1"}},kl={class:"top flex"},$l={class:"r-1"},Vl={class:"bold"},wl={class:"bottom flex",style:{"justify-content":"space-between"}},Cl={class:"red"},Sl={class:"red"},Ul={class:"red"},xl={class:"red"},zl={key:0,class:"load-end"},Al={key:1,class:"load-end"},Rl={class:"dialog-footer"},Fl={__name:"order",props:{isSystem:{type:Boolean,default:!1},source:{type:Number,default:1}},setup(C){const r=be();d([]);const $=d({page_no:1,page_size:20,mobile:"",user_ship:"",street:null}),R=d(!1),F=d(0),c=d(0),j=d(!1),Y=d([]),B=(U=!1)=>{if(U)$.value.page_no=1;else if(j.value||R.value)return;R.value=!0,$.value.mobile==""&&$.value.user_ship==""?$.value.store_id=r.userInfo.store_id:$.value.store_id=null,Ze($.value).then(u=>{U?Y.value=u.data.lists:Y.value=[...Y.value,...u.data.lists],$.value.page_no==1&&Y.value.length>0&&K.emit("set-user-detail",Y.value[0]),u.data.lists.length<$.value.page_size?j.value=!0:$.value.page_no++,c.value=0,F.value=u.data.count,R.value=!1}).catch(u=>{j.value=!0,R.value=!1})},H=(U,u)=>{c.value=u,K.emit("set-user-detail",U)},V=d(!1),w=d(null),z=()=>{var U;(U=w.value)==null||U.addUser()},P=()=>{V.value=!1,B(!0)},q=d([]);(()=>{Ee({type_id:4}).then(U=>{q.value=U.data.lists})})();const N=()=>{$.value.mobile="",$.value.user_ship="",$.value.street=null,b.value=[],B(!0)},b=d([]),A=d([]),ae=async(U,u)=>{const x=U.level;let _;if(x!==0&&!U.data.code)return u([]);x===0?(_=await Se({province_code:51e4}),_=_.data.map(p=>({code:p.city_code,name:p.city_name}))):x===1?(_=await Ue({city_code:U.data.code}),_=_.data.map(p=>({code:p.area_code,name:p.area_name}))):x===2?(_=await xe({area_code:U.data.code}),_=_.data.map(p=>({code:p.street_code,name:p.street_name,leaf:!0}))):x===3?(_=await ze({street_code:U.data.code}),_=_.data.map(p=>({code:p.village_code,name:p.village_name}))):x===4&&(_=await Ae({village_code:U.data.code}),_=_.data.map(p=>({code:p.id,name:p.brigade_name,leaf:!0}))),u(_)},E={value:"code",label:"name",children:"children",multiple:!1,lazy:!0,lazyLoad:ae},Z=()=>{b.value.length?$.value.street=b.value[b.value.length-1]:$.value.street="",B(!0)};return $e(()=>{K.on("re-load-user-list",U=>{U&&B(!0)})}),Ve(()=>{K.off("re-load-user-list")}),(U,u)=>{const x=y("Plus"),_=y("el-icon"),p=y("el-button"),ee=y("el-option"),W=y("el-select"),le=y("el-cascader"),J=y("CircleClose"),ve=y("el-input"),ue=y("el-avatar"),ie=y("el-tag"),te=y("el-dialog"),o=fe("loading"),m=fe("infinite-scroll");return n(),g("div",rl,[e("div",cl,[vl,a(p,{type:"primary",onClick:u[0]||(u[0]=l=>V.value=!0)},{default:t(()=>[a(_,null,{default:t(()=>[a(x)]),_:1}),f(" 添加用户")]),_:1})]),e("div",_l,[ml,a(W,{modelValue:$.value.user_ship,"onUpdate:modelValue":u[1]||(u[1]=l=>$.value.user_ship=l),onChange:u[2]||(u[2]=l=>B(!0)),placeholder:"请选择用户类型",style:{flex:"1"}},{default:t(()=>[(n(!0),g(ne,null,re(q.value,l=>(n(),O(ee,{key:l.id,label:l.title,value:l.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue"]),a(p,{onClick:N,style:{"margin-left":"1rem"}},{default:t(()=>[f("重置")]),_:1})]),e("div",pl,[fl,a(le,{style:{flex:"1"},options:A.value,modelValue:b.value,"onUpdate:modelValue":u[3]||(u[3]=l=>b.value=l),props:E,load:ae,class:"w-full",onChange:Z},null,8,["options","modelValue"])]),e("div",yl,[a(ve,{modelValue:$.value.mobile,"onUpdate:modelValue":u[6]||(u[6]=l=>$.value.mobile=l),placeholder:"搜索手机号",onKeydown:u[7]||(u[7]=Ne(l=>B(!0),["enter"])),onClear:u[8]||(u[8]=l=>B(!0))},{suffix:t(()=>[$.value.mobile!=""?(n(),O(_,{key:0,size:"18",onClick:u[4]||(u[4]=l=>{$.value.mobile="",B(!0)}),style:{cursor:"pointer","margin-right":"0.5rem"}},{default:t(()=>[a(J)]),_:1})):oe("",!0)]),append:t(()=>[a(p,{type:"primary",style:{"background-color":"#1890ff",color:"#fff","border-radius":"0 0.315rem 0.315rem 0"},onClick:u[5]||(u[5]=l=>B(!0))},{default:t(()=>[f("搜索")]),_:1})]),_:1},8,["modelValue"])]),ge((n(),g("div",hl,[(n(!0),g(ne,null,re(Y.value,(l,S)=>{var Q;return n(),g("div",{class:ce(["item",{"item-active":c.value==S}]),key:S,onClick:v=>H(l,S)},[a(ue,{class:"avatar",src:l.avatar},null,8,["src"]),e("div",bl,[e("div",kl,[e("div",$l,[e("span",Vl,h(l.real_name||l.nickname),1),e("span",null,h(" (ID:"+l.id+")"),1)]),e("div",null,"手机号: "+h(l.mobile),1)]),e("div",wl,[e("div",null,[f("余额: "),e("span",Cl,h(l.now_money),1)]),e("div",null,[f("采购款: "),e("span",Sl,h(l.purchase_funds),1)]),e("div",null,[f("返还金: "),e("span",Ul,h((Q=l.return_money)==null?void 0:Q.toFixed(2)),1)]),e("div",null,[f("礼品券: "),e("span",xl,h(l.integral),1)]),e("div",null,[l.user_ship==0?(n(),O(ie,{key:0,type:"primary"},{default:t(()=>[f(h(l.user_ship_name),1)]),_:2},1024)):(n(),O(ie,{key:1,type:"success"},{default:t(()=>[f(h(l.user_ship_name),1)]),_:2},1024))])])])],10,gl)}),128)),j.value?(n(),g("div",zl,"没有更多了")):oe("",!0),R.value?(n(),g("div",Al,"加载中...")):oe("",!0)])),[[o,R.value],[m,B]]),a(te,{modelValue:V.value,"onUpdate:modelValue":u[10]||(u[10]=l=>V.value=l),title:"添加用户",width:"600"},{footer:t(()=>[e("div",Rl,[a(p,{onClick:u[9]||(u[9]=l=>V.value=!1)},{default:t(()=>[f("取消")]),_:1}),a(p,{type:"primary",onClick:z},{default:t(()=>[f(" 添加 ")]),_:1})])]),default:t(()=>[a(dl,{ref_key:"addRef",ref:w,onClose:P},null,512)]),_:1},8,["modelValue"])])}}},Ll=ke(Fl,[["__scopeId","data-v-df06e4b9"]]),_e=C=>(we("data-v-5ad4b8f5"),C=C(),Ce(),C),Ol=_e(()=>e("h4",null,"选择支付方式",-1)),Dl={class:"dra-body"},Il={class:"header"},Pl={style:{display:"inline-block"}},Nl=_e(()=>e("div",{style:{color:"#999",padding:"2rem 0 0.3rem 0"}},"应收金额(元):",-1)),El={style:{color:"#f5222d","padding-bottom":"2rem"}},jl={style:{"font-size":"1.6rem"}},ql={key:0,"element-loading-text":"支付中",class:"card1"},Bl=_e(()=>e("div",{class:"tips"},null,-1)),Jl={key:1,class:"card2"},Tl={class:"drawer-body"},Kl={class:"counter"},Ml={class:"received"},Wl={key:0},Gl={key:1,style:{"font-size":"1rem",color:"#999"}},Hl={key:0,class:"balance"},Ql={class:"money"},Xl=_e(()=>e("div",{class:"tips"},"按回车(Enter)确认支付",-1)),Yl={key:1,class:"balance"},Zl=_e(()=>e("div",null,"不够找零, 请支付更多金额",-1)),ea=_e(()=>e("div",{class:"tips"},"按下小键盘输入金额",-1)),la=[Zl,ea],aa={class:"keypad"},ta={class:"left"},sa={class:"right"},oa={style:{width:"100%",display:"flex","justify-content":"center"}},ia={__name:"payUser",emits:["paySuccess"],setup(C,{expose:r,emit:$}){const R=d(!1),F=d(1),c=d(""),j=d("");be();const Y=()=>{u()},B=()=>{pe(()=>{setTimeout(()=>{var m;x.value=!1,c.value="",N.value=!0,(m=j.value)==null||m.focus(),H(F.value)},300)})},H=m=>{m!=1&&j.value.blur(),F.value=m,console.log(F.value),F.value==2?window.addEventListener("keydown",ue):(window.removeEventListener("keydown",ue),pe(()=>{var l;c.value="",(l=j.value)==null||l.focus()}))},V=d({price:0,uid:"",user_ship:"",village:null,brigade:null}),w=d([]),z=d(!1),P=m=>{V.value=m.data,V.value.total=m.data.price,w.value=m.cart_id,z.value=m.isRePay||!1},q=m=>{V.value.total=m.price,E.value=m.order_id},k=$,N=d(!1),b=d(["1","2","3","4","5","6","7","8","9","0","00","."]),A=/^(10|11|12|13|14|15)\d{16}$/,ae=/^(25|26|27|28|29|30)\d{14,22}$/,E=d(""),Z=()=>{if(x.value=!0,j.value.blur(),z.value)U();else{let m;if(A.test(c.value))m="9";else if(ae.test(c.value))m="13";else return x.value=!1,c.value="",j.value.focus(),D.error("请输入正确的支付码");Ie({uid:V.value.uid,user_ship:V.value.user_ship,village:V.value.village,brigade:V.value.brigade,price:V.value.price,pay_type:m,auth_code:c.value}).then(l=>{l.data.out_trade_no&&l.msg=="支付成功"?(R.value=!1,D({message:"支付成功",type:"success"}),u(l.data)):l.msg=="用户支付中"&&l.code==1&&(D.warning(l.msg),K.on("pay_user_success",S=>{D({message:"支付成功",type:"success"}),setTimeout(()=>{K.off("pay_user_success")},200),R.value=!1,u(S)}))}).catch(l=>{x.value=!1,pe(()=>{var S;(S=j.value)==null||S.focus()})})}},U=()=>{let m=17;if(F.value==1)if(A.test(c.value))m="9";else if(ae.test(c.value))m="13";else return x.value=!1,c.value="",j.value.focus(),D.error("请输入正确的支付码");sl({order_id:V.value.order_id,pay_type:m,auth_code:c.value}).then(l=>{var S;(S=l.msg)!=null&&S.includes("成功")?(R.value=!1,D({message:"支付成功",type:"success"}),u({msg:"支付成功"})):l.msg=="用户支付中"&&l.code==1&&(D.warning(l.msg),K.on("pay_user_success",Q=>{D({message:"支付成功",type:"success"}),setTimeout(()=>{K.off("pay_user_success")},200),R.value=!1,u(Q)}))}).catch(l=>{c.value="",x.value=!1,pe(()=>{var S;(S=j.value)==null||S.focus()})})};d(0);const u=(m=null)=>{var l;window.removeEventListener("keydown",ue),N.value=!1,x.value=!1,c.value="",p.value="",_.value=[],(l=j.value)==null||l.blur(),typeof m=="function"&&(m=null),k("paySuccess",m),R.value=!1},x=d(!1);r({drawer:R,setForm:P,setRePay:q,beforeClose:u});const _=d([]),p=d(""),ee=He(()=>+p.value>0?(p.value-V.value.total).toFixed(2):-1),W=d(!1),le=m=>{m===-1?_.value=[]:_.value.pop(),p.value=_.value.length?_.value.join(""):0},J=m=>{W.value===!1&&(p.value="",W.value=!0);let l=String(p.value).indexOf(".")+1,S=String(p.value).length-l;console.log(l,S),(l===0||S<2)&&(_.value.join("")<=9999999&&_.value.push(m),p.value=_.value.join("")>99999999?99999999:_.value.join(""))},ve=()=>{if(ee.value===""||ee.value===null||ee.value===void 0||+p.value<+V.value.total)return D.error("收款金额应该大于等于应收金额");z.value?U():Ie({uid:V.value.uid,user_ship:V.value.user_ship,village:V.value.village,brigade:V.value.brigade,price:V.value.price,pay_type:17}).then(m=>{console.log("========"),R.value=!1,D({message:m.msg,type:"success"}),F.value=1,u({msg:"收款成功"})}).catch(m=>{x.value=!1})},ue=m=>{let S=(m||window.event).keyCode;if(S==37)return H(2);if(S==120)return K.emit("F9");if(S==27)return u();switch(m.stopPropagation(),m.preventDefault(),S){case 96:case 48:J(0);break;case 97:case 49:J(1);break;case 98:case 50:J(2);break;case 99:case 51:J(3);break;case 100:case 52:J(4);break;case 101:case 53:J(5);break;case 102:case 54:J(6);break;case 103:case 55:J(7);break;case 104:case 56:J(8);break;case 105:case 57:J(9);break;case 110:J(".");break;case 190:J(".");break;case 8:le();break;case 13:ve();break}},ie=d(!1),te=()=>{if(!(!R.value||ie.value&&c.value.length>0)&&F.value==2)return H(1)},o=()=>{if(!(!R.value||ie.value&&c.value.length>0)&&F.value==1)return H(2)};return $e(()=>{K.on("left",te),K.on("right",o)}),Ve(()=>{K.off("left",te),K.off("right",o)}),(m,l)=>{const S=y("el-input"),Q=y("el-button"),v=y("Delete"),s=y("el-icon"),G=y("el-drawer"),I=fe("loading");return n(),O(G,{size:"60rem",modelValue:R.value,"onUpdate:modelValue":l[6]||(l[6]=L=>R.value=L),direction:"rtl",onOpen:B,"before-close":u},{header:t(()=>[Ol]),default:t(()=>{var L;return[e("div",Dl,[e("div",Il,[e("div",{class:ce(["left",{active:F.value==1}]),onClick:l[0]||(l[0]=X=>H(1))}," 微信/支付宝 ",2),e("div",{class:ce(["right",{active:F.value==2}]),onClick:l[1]||(l[1]=X=>H(2))}," 现金收款 ",2)]),e("div",null,[e("div",Pl,[Nl,e("div",El,[f(" ¥"),e("span",jl,h((L=V.value)==null?void 0:L.price),1)])])]),F.value==1?ge((n(),g("div",ql,[a(S,{ref_key:"codeRef",ref:j,modelValue:c.value,"onUpdate:modelValue":l[2]||(l[2]=X=>c.value=X),autofocus:"",class:"code-input",placeholder:"请点击输入框聚焦扫码或输入编码号",onKeyup:Ne(Z,["enter"]),onFocus:l[3]||(l[3]=X=>ie.value=!0),onBlur:l[4]||(l[4]=X=>ie.value=!1)},null,8,["modelValue"]),Bl])),[[I,x.value]]):(n(),g("div",Jl,[e("div",Tl,[e("div",Kl,[e("div",Ml,[p.value?(n(),g("span",Wl,h(p.value),1)):(n(),g("span",Gl,"按下键盘输入客户支付金额"))]),ee.value>=0?(n(),g("div",Hl,[e("div",null,[f(" 需找零(元):"),e("span",Ql,"¥"+h(ee.value),1)]),Xl])):(n(),g("div",Yl,la)),e("div",aa,[e("div",ta,[(n(!0),g(ne,null,re(b.value,X=>(n(),O(Q,{key:X,onClick:T=>J(X)},{default:t(()=>[f(h(X),1)]),_:2},1032,["onClick"]))),128))]),e("div",sa,[a(Q,{onClick:le},{default:t(()=>[a(s,null,{default:t(()=>[a(v)]),_:1})]),_:1}),a(Q,{onClick:l[5]||(l[5]=X=>le(-1))},{default:t(()=>[f("C")]),_:1}),a(Q,{class:ce(["enter",{"enter-disable":+p.value<+V.value.total}]),disabled:+p.value<+V.value.total,onClick:ve},{default:t(()=>[f(" 确认 ")]),_:1},8,["class","disabled"])])])])])]))])]}),footer:t(()=>[e("div",oa,[a(Q,{class:"cancel-btn",onClick:Y},{default:t(()=>[f("取消收款")]),_:1})])]),_:1},8,["modelValue"])}}},na=ke(ia,[["__scopeId","data-v-5ad4b8f5"]]),M=C=>(we("data-v-d356fe09"),C=C(),Ce(),C),ua={class:"my-order"},da={class:"header-nav"},ra=["onClick"],ca={key:0,class:"detail"},va={class:"table"},_a=M(()=>e("div",{class:"table-title"},"用户信息",-1)),ma={class:"table-info"},pa={class:"info-item"},fa=M(()=>e("div",{class:"info-item-title"},"用户余额:",-1)),ya={class:"info-item-info red"},ha={class:"info-item"},ga=M(()=>e("div",{class:"info-item-title"},"采购款:",-1)),ba={class:"info-item-info red"},ka={class:"info-item"},$a=M(()=>e("div",{class:"info-item-title"},"返还金:",-1)),Va={class:"info-item-info red"},wa={class:"info-item"},Ca=M(()=>e("div",{class:"info-item-title"},"头像:",-1)),Sa={class:"info-item-info"},Ua={class:"info-item"},xa=M(()=>e("div",{class:"info-item-title"},"礼品券:",-1)),za={class:"info-item-info red"},Aa={class:"info-item"},Ra=M(()=>e("div",{class:"info-item-title"},"冻结礼品券:",-1)),Fa={class:"info-item-info red"},La={class:"info-item"},Oa=M(()=>e("div",{class:"info-item-title"},"ID:",-1)),Da={class:"info-item-info"},Ia={class:"info-item"},Pa=M(()=>e("div",{class:"info-item-title"},"用户昵称:",-1)),Na={class:"info-item-info"},Ea={class:"info-item"},ja=M(()=>e("div",{class:"info-item-title"},"用户电话:",-1)),qa={class:"info-item-info"},Ba={class:"info-item"},Ja=M(()=>e("div",{class:"info-item-title"},"用户账号:",-1)),Ta={class:"info-item-info"},Ka={class:"info-item"},Ma=M(()=>e("div",{class:"info-item-title"},"真实姓名:",-1)),Wa={class:"info-item-info"},Ga={class:"info-item"},Ha=M(()=>e("div",{class:"info-item-title"},"创建时间:",-1)),Qa={class:"info-item-info"},Xa={class:"info-item",style:{width:"100%","flex-shrink":"0","align-items":"center"}},Ya=M(()=>e("div",{class:"info-item-title"},"用户类型:",-1)),Za={class:"info-item-info"},et={class:"info-item",style:{width:"100%","flex-shrink":"0","align-items":"center"}},lt=M(()=>e("div",{class:"info-item-title"},"用户地址:",-1)),at={key:1,class:"detail"},tt={class:"table","infinite-scroll-distance":300,"infinite-scroll-delay":300,style:{overflow:"auto"},"infinite-scroll-immediate":!1},st={style:{display:"flex","align-items":"center"}},ot={style:{"margin-left":"0.5rem"}},it={key:0,style:{display:"flex","align-items":"center"}},nt={class:"footer"},ut={key:0},dt={key:1},rt={key:2},ct={class:"dialog-footer"},vt={key:0},_t={class:"ship-money-list"},mt=["onClick"],pt={class:"item1"},ft={class:"item2"},yt={class:"dialog-footer"},ht={__name:"detail",setup(C){be(),Qe();const r=d({id:""});d({price:"",type:1});const $=d(null),R=(v=null)=>{ie()},F=d(!1),c=d([]);(()=>{Ee({type_id:4}).then(v=>{c.value=v.data.lists})})();const Y=()=>{el({id:r.value.id,user_ship:r.value.user_ship}).then(v=>{var s;D.success("修改成功"),r.value.user_ship_name=(s=c.value.find(G=>G.id==r.value.user_ship))==null?void 0:s.title,F.value=!1})},B=()=>{F.value=!1},H=d([]);(()=>{ll().then(v=>{H.value=v.data,console.log(v)})})();const w=d({id:"",province:"",city:"",area:"",street:"",brigade:""}),z=d([]),P=d([]),q=()=>{al({uid:r.value.id}).then(v=>{var s;(s=v.data)!=null&&s.village?(z.value=[v.data.city,v.data.area,v.data.street,v.data.village,+v.data.brigade],P.value=JSON.parse(JSON.stringify(z.value)),w.value=v.data):(z.value=[],P.value=[],w.value={id:"",province:"",city:"",area:"",street:"",brigade:""})}).catch(v=>{z.value=[],P.value=[],w.value={id:"",province:"",city:"",area:"",street:"",brigade:""}})},k=d([]),N=async(v,s)=>{const G=v.level;let I;if(G!==0&&!v.data.code)return s([]);G===0?(I=await Se({province_code:51e4}),I=I.data.map(L=>({code:L.city_code,name:L.city_name}))):G===1?(I=await Ue({city_code:v.data.code}),I=I.data.map(L=>({code:L.area_code,name:L.area_name}))):G===2?(I=await xe({area_code:v.data.code}),I=I.data.map(L=>({code:L.street_code,name:L.street_name}))):G===3?(I=await ze({street_code:v.data.code}),I=I.data.map(L=>({code:L.village_code,name:L.village_name}))):G===4&&(I=await Ae({village_code:v.data.code}),I=I.data.map(L=>({code:L.id,name:L.brigade_name,leaf:!0}))),s(I)},b={value:"code",label:"name",children:"children",multiple:!1,lazy:!0,lazyLoad:N},A=async()=>{w.value.city=z.value[0],w.value.area=z.value[1],w.value.street=z.value[2],w.value.village=z.value[3],w.value.brigade=z.value[4],w.value.phone||(w.value.phone=r.value.account),w.value.real_name||(w.value.real_name=r.value.real_name||r.value.nickname),tl({...w.value,uid:r.value.id}).then(v=>{P.value=JSON.parse(JSON.stringify(z.value)),D.success("编辑成功"),E.value=!0}).catch(v=>{ae()})},ae=()=>{z.value=JSON.parse(JSON.stringify(P.value)),P.value.length>0&&(w.value.city=P.value[0],w.value.area=P.value[1],w.value.street=P.value[2],w.value.village=P.value[3],w.value.brigade=P.value[4]),E.value=!0},E=d(!0),Z=d(0),U=d(["基本信息","用户资产"]),u=d(!1),x=d([]),_=d({page_no:1,page_size:10,loading:!1,loadend:!1});let p=[];const ee=(v=!1)=>{v&&(x.value=[],_.value.page_no=1,_.value.loadend=!1),!(_.value.loadend||_.value.loading)&&(_.value.loading=!0,ol({uid:r.value.id,page_no:_.value.page_no,page_size:_.value.page_size}).then(s=>{x.value=[...x.value,...s.data.lists],_.value.loading=!1,_.value.page_no++,s.data.lists.length<_.value.page_size&&(_.value.loadend=!0)}))},W=d({mobile:"",code:""}),le=d(!1),J=()=>{if(W.value.mobile=r.value.phone,W.value.code="",p=x.value.filter(v=>v.n_num).map(v=>({product_id:v.product_id,nums:v.n_num})),p.length==0)return D.error("请选择商品");le.value=!0},ve=()=>{console.log("发送短信验证码"),D.success("验证码已发送")},ue=()=>{if(W.value.code=="")return D.error("请输入验证码");il({uid:r.value.id,info:p}).then(v=>{u.value=!1,D.success("出库成功"),le.value=!1,ee(!0)})},ie=()=>{Pe({id:r.value.id}).then(({data:v})=>{v.phone=v.mobile+"",delete v.mobile,r.value=Object.assign(r.value,v)})},te=d(!1),o=d({user_ship:"",user_ship_name:"",limit:"",money:"",type:""}),m=()=>{o.value.money=Number(o.value.money).toFixed(2),(+o.value.money<+o.value.limit||+o.value.money>1e4)&&(+o.value.limit>0?o.value.money=o.value.limit:o.value.money="")},l=v=>{if(o.value.type=="add"){let s=c.value.find(G=>G.id==v);s&&(o.value.limit=s.limit,o.value.user_ship_name=s.title,o.value.money=s.limit)}},S=()=>{if(o.value.user_ship===""||o.value.user_ship===null||o.value.user_ship===void 0||o.value.user_ship===0)return D.error("请选择会员类型");if(o.value.money==0||o.value.money=="")return D.error(o.value.type=="add"?"请输入充值金额":"请选择金额");if(o.value.type=="add"&&(+o.value.money<+o.value.limit||+o.value.money>1e4))return+o.value.limit>0?o.value.money=o.value.limit:o.value.money="",D.error(`该类型至少需要充值${o.value.limit}元`);$.value.setForm({data:{uid:r.value.id,price:o.value.money,user_ship:o.value.user_ship,village:w.value.village,brigade:w.value.brigade}}),$.value.drawer=!0,pe(()=>{te.value=!1})},Q=v=>{if(P.value.length==0)return D.error("请先选择用户地址");o.value.type=v,v=="add"&&(o.value.user_ship=r.value.user_ship,o.value.user_ship_name=r.value.user_ship_name,l(o.value.user_ship)),te.value=!0};return $e(()=>{K.on("set-user-detail",v=>{r.value=v,u.value=!1,Pe({id:r.value.id}).then(({data:s})=>{s.phone=s.mobile+"",delete s.mobile,r.value=Object.assign(v,s)}),z.value=[],P.value=[],q(),ee(!0),o.value={user_ship:"",user_ship_name:"",limit:"",money:"",type:""}})}),Ve(()=>{K.off("set-user-detail")}),(v,s)=>{var Oe;const G=y("el-avatar"),I=y("el-tag"),L=y("el-option"),X=y("el-select"),T=y("el-button"),qe=y("el-cascader"),Be=y("el-image"),he=y("el-table-column"),Je=y("el-input-number"),Te=y("el-table"),Ke=y("el-empty"),me=y("el-input"),de=y("el-form-item"),Fe=y("el-form"),Le=y("el-dialog"),Me=fe("infinite-scroll"),We=fe("loading");return n(),g("div",ua,[e("div",da,[(n(!0),g(ne,null,re(U.value,(i,se)=>(n(),g("div",{key:se,class:ce(["nav-item",{"nav-item-active":Z.value==se,"nav-item-radius1":Z.value==se+1,"nav-item-radius2":Z.value==se-1}]),onClick:Ge=>Z.value=se},h(i),11,ra))),128)),e("div",{class:ce(["nav-item",{"nav-item-radius2":Z.value==U.value.length-1}]),style:{flex:"1"}},null,2)]),r.value.id&&Z.value==0?(n(),g("div",ca,[e("div",va,[_a,e("div",ma,[e("div",pa,[fa,e("div",ya,"¥"+h(r.value.now_money),1)]),e("div",ha,[ga,e("div",ba,"¥"+h(r.value.purchase_funds),1)]),e("div",ka,[$a,e("div",Va,"¥"+h((Oe=r.value.return_money)==null?void 0:Oe.toFixed(2)),1)]),e("div",wa,[Ca,e("div",Sa,[a(G,{style:{width:"4rem",height:"4rem"},src:r.value.avatar},null,8,["src"])])]),e("div",Ua,[xa,e("div",za,"¥"+h(r.value.integral),1)]),e("div",Aa,[Ra,e("div",Fa,"¥"+h(r.value.get_frozen),1)]),e("div",La,[Oa,e("div",Da,h(r.value.id),1)]),e("div",Ia,[Pa,e("div",Na,h(r.value.nickname),1)]),e("div",Ea,[ja,e("div",qa,h(r.value.phone),1)]),e("div",Ba,[Ja,e("div",Ta,h(r.value.account),1)]),e("div",Ka,[Ma,e("div",Wa,h(r.value.real_name),1)]),e("div",Ga,[Ha,e("div",Qa,h(r.value.create_time),1)]),e("div",Xa,[Ya,e("div",Za,[F.value==!1?(n(),g(ne,{key:0},[r.value.user_ship==0?(n(),O(I,{key:0,type:"primary",size:"large"},{default:t(()=>[f(h(r.value.user_ship_name),1)]),_:1})):(n(),O(I,{key:1,type:"success",size:"large"},{default:t(()=>[f(h(r.value.user_ship_name),1)]),_:1}))],64)):(n(),g(ne,{key:1},[a(X,{modelValue:r.value.user_ship,"onUpdate:modelValue":s[0]||(s[0]=i=>r.value.user_ship=i),placeholder:"请选择用户类型",style:{width:"10rem"}},{default:t(()=>[(n(!0),g(ne,null,re(c.value,i=>(n(),O(L,{key:i.id,label:i.title,value:i.id,disabled:i.id!=0&&i.id!=4},null,8,["label","value","disabled"]))),128))]),_:1},8,["modelValue"]),a(T,{type:"primary",style:{"margin-left":"1rem"},onClick:Y},{default:t(()=>[f("确认")]),_:1}),a(T,{style:{"margin-left":"1rem"},onClick:B},{default:t(()=>[f("取消")]),_:1})],64))])]),e("div",et,[lt,(n(),O(qe,{key:r.value.id,style:{flex:"1"},modelValue:z.value,"onUpdate:modelValue":s[1]||(s[1]=i=>z.value=i),options:k.value,props:b,load:N,class:"w-full",disabled:E.value},null,8,["modelValue","options","disabled"])),E.value&&!P.value.length?(n(),O(T,{key:0,type:"primary",style:{"margin-left":"1rem"},onClick:s[2]||(s[2]=i=>E.value=!1)},{default:t(()=>[f("修改")]),_:1})):oe("",!0),E.value?oe("",!0):(n(),O(T,{key:1,type:"primary",style:{"margin-left":"1rem"},onClick:A},{default:t(()=>[f("确认")]),_:1})),E.value?oe("",!0):(n(),O(T,{key:2,style:{"margin-left":"1rem"},onClick:ae},{default:t(()=>[f("取消")]),_:1}))]),r.value.user_ship!=0?(n(),O(T,{key:0,type:"success",class:"big-btn",size:"large",onClick:s[3]||(s[3]=i=>Q("add"))},{default:t(()=>[f("增加经营资金")]),_:1})):(n(),O(T,{key:1,type:"primary",class:"big-btn",size:"large",onClick:s[4]||(s[4]=i=>Q("recharge"))},{default:t(()=>[f("成为会员")]),_:1}))])])])):oe("",!0),r.value.id&&Z.value==1?ge((n(),g("div",at,[ge((n(),g("div",tt,[a(Te,{data:x.value},{default:t(()=>[a(he,{label:"商品信息"},{default:t(({row:i})=>[e("div",st,[a(Be,{style:{height:"3rem",width:"3rem","flex-shrink":"0"},src:i.image},null,8,["src"]),e("span",ot,h(i.store_name),1)])]),_:1}),a(he,{prop:"price",label:"单价",width:u.value?130:200},null,8,["width"]),a(he,{prop:"nums",label:"存量",width:u.value?100:200},null,8,["width"]),u.value?(n(),O(he,{key:0,prop:"nums",label:"出库量",width:"250"},{default:t(({row:i})=>[i.nums?(n(),g("div",it,[a(Je,{modelValue:i.n_num,"onUpdate:modelValue":se=>i.n_num=se,"step-strictly":"",min:0,max:i.nums},null,8,["modelValue","onUpdate:modelValue","max"]),a(T,{type:"primary",style:{"margin-left":"1rem"},onClick:se=>i.n_num=i.nums},{default:t(()=>[f("全部")]),_:2},1032,["onClick"])])):oe("",!0)]),_:1})):oe("",!0)]),_:1},8,["data"])])),[[Me,ee]]),e("div",nt,[u.value?(n(),g("div",dt,[a(T,{type:"primary",size:"large",onClick:J},{default:t(()=>[f("确认出库")]),_:1}),a(T,{size:"large",onClick:s[6]||(s[6]=i=>u.value=!1)},{default:t(()=>[f("取消")]),_:1})])):(n(),g("div",ut,[a(T,{type:"warning",size:"large",onClick:s[5]||(s[5]=i=>u.value=!0),disabled:x.value.length==0},{default:t(()=>[f("商品出库")]),_:1},8,["disabled"])]))])])),[[We,_.value.loading]]):(n(),g("div",rt,[a(Ke)])),a(na,{ref_key:"payRef",ref:$,onPaySuccess:R},null,512),a(Le,{modelValue:le.value,"onUpdate:modelValue":s[10]||(s[10]=i=>le.value=i),title:"出库验证",width:"500"},{footer:t(()=>[e("div",ct,[a(T,{onClick:s[9]||(s[9]=i=>le.value=!1)},{default:t(()=>[f("取消")]),_:1}),a(T,{type:"primary",onClick:ue},{default:t(()=>[f(" 确认 ")]),_:1})])]),default:t(()=>[a(Fe,{model:W.value},{default:t(()=>[a(de,{label:"手机号:"},{default:t(()=>[a(me,{modelValue:W.value.mobile,"onUpdate:modelValue":s[7]||(s[7]=i=>W.value.mobile=i),autocomplete:"off",readonly:""},null,8,["modelValue"])]),_:1}),a(de,{label:"验证码:"},{default:t(()=>[a(me,{modelValue:W.value.code,"onUpdate:modelValue":s[8]||(s[8]=i=>W.value.code=i),autocomplete:"off",placeholder:"请输入验证码",style:{flex:"1"}},null,8,["modelValue"]),(n(),O(je,{style:{"margin-left":"1rem"},onSendCode:ve,key:W.value.mobile}))]),_:1})]),_:1},8,["model"])]),_:1},8,["modelValue"]),a(Le,{modelValue:te.value,"onUpdate:modelValue":s[17]||(s[17]=i=>te.value=i),title:o.value.type=="add"?"增加经营资金":"成为会员",width:"500"},{footer:t(()=>[e("div",yt,[a(T,{onClick:s[16]||(s[16]=i=>te.value=!1)},{default:t(()=>[f("取消")]),_:1}),a(T,{type:"primary",onClick:S},{default:t(()=>[f(" 确认 ")]),_:1})])]),default:t(()=>[a(Fe,{model:o.value,"label-width":"100px"},{default:t(()=>[a(de,{label:"手机号:"},{default:t(()=>[a(me,{modelValue:r.value.phone,"onUpdate:modelValue":s[11]||(s[11]=i=>r.value.phone=i),autocomplete:"off",readonly:""},null,8,["modelValue"])]),_:1}),o.value.type=="add"?(n(),O(de,{key:0,label:"会员类型:"},{default:t(()=>[a(me,{modelValue:o.value.user_ship_name,"onUpdate:modelValue":s[12]||(s[12]=i=>o.value.user_ship_name=i),autocomplete:"off",readonly:""},null,8,["modelValue"])]),_:1})):(n(),O(de,{key:1,label:"会员类型:",required:""},{default:t(()=>[a(X,{modelValue:o.value.user_ship,"onUpdate:modelValue":s[13]||(s[13]=i=>o.value.user_ship=i),placeholder:"请选择用户类型",style:{flex:"1"},onChange:l},{default:t(()=>[(n(!0),g(ne,null,re(c.value,i=>(n(),O(L,{key:i.id,label:i.title,value:i.id,disabled:i.id==0},null,8,["label","value","disabled"]))),128))]),_:1},8,["modelValue"])]),_:1})),o.value.type=="add"?(n(),O(de,{key:2,label:"充值金额:",required:""},{default:t(()=>[a(me,{modelValue:o.value.money,"onUpdate:modelValue":s[14]||(s[14]=i=>o.value.money=i),type:"number",onBlur:m,onFocus:s[15]||(s[15]=i=>o.value.money=""),autocomplete:"off"},{prepend:t(()=>[f("¥")]),append:t(()=>[f("元")]),_:1},8,["modelValue"]),o.value.limit?(n(),g("div",vt,h(`${o.value.user_ship_name}角色至少要充值${o.value.limit}元, 最大不超过10000元`),1)):oe("",!0)]),_:1})):(n(),O(de,{key:3,label:"充值金额:",required:""},{default:t(()=>[e("div",_t,[(n(!0),g(ne,null,re(H.value,(i,se)=>(n(),g("div",{class:ce(["ship-money-item",{"ship-money-item-active":i.money==o.value.money}]),onClick:Ge=>o.value.money=i.money,key:se},[e("div",pt,h(i.money)+h(i.money_string),1),e("div",ft,"送"+h(i.send)+h(i.send_string),1)],10,mt))),128))])]),_:1}))]),_:1},8,["model"])]),_:1},8,["modelValue","title"])])}}},gt=ke(ht,[["__scopeId","data-v-d356fe09"]]),bt={class:"my-card"},xt={__name:"index",setup(C){return(r,$)=>(n(),g("div",bt,[a(Ll,{style:{"flex-shrink":"0"},ref:"orderRef"},null,512),a(nl),a(gt,{ref:"detailRef"},null,512)]))}};export{xt as default}; +import{u as be,r as d,G as De,b as y,c as n,k as g,f as a,w as t,E as D,_ as ke,o as $e,m as K,a as Ve,h as fe,e,g as f,F as ne,l as re,d as O,p as oe,i as Ne,j as ge,z as ce,t as h,q as we,s as Ce,J as He,n as pe,I as Qe}from"./index-CEprPOh1.js";import{a as Xe,b as Ye,u as Ze,c as Ee,d as Ie,e as Pe,f as el,g as ll,h as al,i as tl}from"./user-DiHB_Leh.js";import"./moment-Cl4UOzQZ.js";import{r as ye}from"./axiosAPI-JxG9ekqU.js";import{_ as je}from"./authCode-k34-_7Pb.js";import{i as sl,m as ol,n as il}from"./store-BoFe3Agt.js";import{p as nl}from"./padding-Bq_IbaOz.js";function Se(C){return ye.get("/city",{params:C})}function Ue(C){return ye.get("/area",{params:C})}function xe(C){return ye.get("/street",{params:C})}function ze(C){return ye.get("/village",{params:C})}function Ae(C){return ye.get("/brigade",{params:C})}const ul={class:"add-user"},dl={__name:"add",emits:["close"],setup(C,{expose:r,emit:$}){const R=be(),F=d(null),c=De({mobile:"",code:"",real_name:"",user_ship:0,selectedValues:[]}),j=De({mobile:[{required:!0,message:"请输入手机号",trigger:"blur"},{pattern:/^1[3456789]\d{9}$/,message:"请输入正确的手机号",trigger:"blur"}],code:[{required:!0,message:"请输入验证码",trigger:"blur"}],real_name:[{required:!0,message:"请输入用户姓名",trigger:"blur"}],user_ship:[{required:!0,message:"请选择用户类型",trigger:"change"}],selectedValues:[{required:!0,message:"请选择用户地址",trigger:"change"}]}),Y=d([]),B=async(q,k)=>{const N=q.level;let b;if(N!==0&&!q.data.code)return k([]);N===0?(b=await Se({province_code:51e4}),b=b.data.map(A=>({code:A.city_code,name:A.city_name}))):N===1?(b=await Ue({city_code:q.data.code}),b=b.data.map(A=>({code:A.area_code,name:A.area_name}))):N===2?(b=await xe({area_code:q.data.code}),b=b.data.map(A=>({code:A.street_code,name:A.street_name}))):N===3?(b=await ze({street_code:q.data.code}),b=b.data.map(A=>({code:A.village_code,name:A.village_name}))):N===4&&(b=await Ae({village_code:q.data.code}),b=b.data.map(A=>({code:A.id,name:A.brigade_name,leaf:!0}))),k(b)},H={value:"code",label:"name",children:"children",multiple:!1,lazy:!0,lazyLoad:B};d([]);const V=$,w=()=>{F.value.validate(async q=>{if(q){let k={};k.mobile=c.mobile,k.code=c.code,k.user_ship=c.user_ship,k.real_name=c.real_name,k.province="510000",k.city=c.selectedValues[0],k.area=c.selectedValues[1],k.street=c.selectedValues[2],k.village=c.selectedValues[3],k.brigade=c.selectedValues[4],k.store_id=R.userInfo.store_id,Xe(k).then(N=>{c.mobile="",c.code="",c.user_ship=0,c.real_name="",c.selectedValues=[],F.value.resetFields(),V("close")})}})},z=d(null),P=()=>{F.value.validateField("mobile",q=>{q&&Ye({mobile:c.mobile}).then(k=>{D.success("发送成功"),z.value.startCountDown()}).catch(k=>{D.error("发送失败")})})};return r({addUser:w}),(q,k)=>{const N=y("el-input"),b=y("el-form-item"),A=y("el-cascader"),ae=y("el-form");return n(),g("div",ul,[a(ae,{model:c,rules:j,ref_key:"formDataRef",ref:F,"label-width":"80px"},{default:t(()=>[a(b,{label:"用户电话",prop:"mobile"},{default:t(()=>[a(N,{modelValue:c.mobile,"onUpdate:modelValue":k[0]||(k[0]=E=>c.mobile=E),placeholder:"请输入用户电话"},null,8,["modelValue"])]),_:1}),a(b,{label:"验证码",prop:"code"},{default:t(()=>[a(N,{modelValue:c.code,"onUpdate:modelValue":k[1]||(k[1]=E=>c.code=E),placeholder:"请输入验证码",style:{flex:"1"}},null,8,["modelValue"]),a(je,{ref_key:"authCodeRef",ref:z,style:{"margin-left":"1rem"},onSendCode:P,start:!1},null,512)]),_:1}),a(b,{label:"用户姓名",prop:"real_name"},{default:t(()=>[a(N,{modelValue:c.real_name,"onUpdate:modelValue":k[2]||(k[2]=E=>c.real_name=E),placeholder:"请输入用户姓名"},null,8,["modelValue"])]),_:1}),a(b,{label:"用户地址",prop:"selectedValues"},{default:t(()=>[a(A,{style:{width:"100%"},modelValue:c.selectedValues,"onUpdate:modelValue":k[3]||(k[3]=E=>c.selectedValues=E),options:Y.value,props:H,load:B,class:"w-full"},null,8,["modelValue","options"])]),_:1})]),_:1},8,["model","rules"])])}}},Re=C=>(we("data-v-df06e4b9"),C=C(),Ce(),C),rl={class:"my-order"},cl={class:"header-nav"},vl=Re(()=>e("div",{class:"nav-item"},h("用户列表"),-1)),_l={class:"header-row"},ml=Re(()=>e("div",{class:"label"},"用户类型",-1)),pl={class:"header-row"},fl=Re(()=>e("div",{class:"label"},"用户地区",-1)),yl={class:"header-input"},hl={class:"order-lists","infinite-scroll-distance":300,"infinite-scroll-delay":500,style:{overflow:"auto"}},gl=["onClick"],bl={style:{display:"flex","flex-direction":"column","justify-content":"space-around",flex:"1"}},kl={class:"top flex"},$l={class:"r-1"},Vl={class:"bold"},wl={class:"bottom flex",style:{"justify-content":"space-between"}},Cl={class:"red"},Sl={class:"red"},Ul={class:"red"},xl={class:"red"},zl={key:0,class:"load-end"},Al={key:1,class:"load-end"},Rl={class:"dialog-footer"},Fl={__name:"order",props:{isSystem:{type:Boolean,default:!1},source:{type:Number,default:1}},setup(C){const r=be();d([]);const $=d({page_no:1,page_size:20,mobile:"",user_ship:"",street:null}),R=d(!1),F=d(0),c=d(0),j=d(!1),Y=d([]),B=(U=!1)=>{if(U)$.value.page_no=1;else if(j.value||R.value)return;R.value=!0,$.value.mobile==""&&$.value.user_ship==""?$.value.store_id=r.userInfo.store_id:$.value.store_id=null,Ze($.value).then(u=>{U?Y.value=u.data.lists:Y.value=[...Y.value,...u.data.lists],$.value.page_no==1&&Y.value.length>0&&K.emit("set-user-detail",Y.value[0]),u.data.lists.length<$.value.page_size?j.value=!0:$.value.page_no++,c.value=0,F.value=u.data.count,R.value=!1}).catch(u=>{j.value=!0,R.value=!1})},H=(U,u)=>{c.value=u,K.emit("set-user-detail",U)},V=d(!1),w=d(null),z=()=>{var U;(U=w.value)==null||U.addUser()},P=()=>{V.value=!1,B(!0)},q=d([]);(()=>{Ee({type_id:4}).then(U=>{q.value=U.data.lists})})();const N=()=>{$.value.mobile="",$.value.user_ship="",$.value.street=null,b.value=[],B(!0)},b=d([]),A=d([]),ae=async(U,u)=>{const x=U.level;let _;if(x!==0&&!U.data.code)return u([]);x===0?(_=await Se({province_code:51e4}),_=_.data.map(p=>({code:p.city_code,name:p.city_name}))):x===1?(_=await Ue({city_code:U.data.code}),_=_.data.map(p=>({code:p.area_code,name:p.area_name}))):x===2?(_=await xe({area_code:U.data.code}),_=_.data.map(p=>({code:p.street_code,name:p.street_name,leaf:!0}))):x===3?(_=await ze({street_code:U.data.code}),_=_.data.map(p=>({code:p.village_code,name:p.village_name}))):x===4&&(_=await Ae({village_code:U.data.code}),_=_.data.map(p=>({code:p.id,name:p.brigade_name,leaf:!0}))),u(_)},E={value:"code",label:"name",children:"children",multiple:!1,lazy:!0,lazyLoad:ae},Z=()=>{b.value.length?$.value.street=b.value[b.value.length-1]:$.value.street="",B(!0)};return $e(()=>{K.on("re-load-user-list",U=>{U&&B(!0)})}),Ve(()=>{K.off("re-load-user-list")}),(U,u)=>{const x=y("Plus"),_=y("el-icon"),p=y("el-button"),ee=y("el-option"),W=y("el-select"),le=y("el-cascader"),J=y("CircleClose"),ve=y("el-input"),ue=y("el-avatar"),ie=y("el-tag"),te=y("el-dialog"),o=fe("loading"),m=fe("infinite-scroll");return n(),g("div",rl,[e("div",cl,[vl,a(p,{type:"primary",onClick:u[0]||(u[0]=l=>V.value=!0)},{default:t(()=>[a(_,null,{default:t(()=>[a(x)]),_:1}),f(" 添加用户")]),_:1})]),e("div",_l,[ml,a(W,{modelValue:$.value.user_ship,"onUpdate:modelValue":u[1]||(u[1]=l=>$.value.user_ship=l),onChange:u[2]||(u[2]=l=>B(!0)),placeholder:"请选择用户类型",style:{flex:"1"}},{default:t(()=>[(n(!0),g(ne,null,re(q.value,l=>(n(),O(ee,{key:l.id,label:l.title,value:l.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue"]),a(p,{onClick:N,style:{"margin-left":"1rem"}},{default:t(()=>[f("重置")]),_:1})]),e("div",pl,[fl,a(le,{style:{flex:"1"},options:A.value,modelValue:b.value,"onUpdate:modelValue":u[3]||(u[3]=l=>b.value=l),props:E,load:ae,class:"w-full",onChange:Z},null,8,["options","modelValue"])]),e("div",yl,[a(ve,{modelValue:$.value.mobile,"onUpdate:modelValue":u[6]||(u[6]=l=>$.value.mobile=l),placeholder:"搜索手机号",onKeydown:u[7]||(u[7]=Ne(l=>B(!0),["enter"])),onClear:u[8]||(u[8]=l=>B(!0))},{suffix:t(()=>[$.value.mobile!=""?(n(),O(_,{key:0,size:"18",onClick:u[4]||(u[4]=l=>{$.value.mobile="",B(!0)}),style:{cursor:"pointer","margin-right":"0.5rem"}},{default:t(()=>[a(J)]),_:1})):oe("",!0)]),append:t(()=>[a(p,{type:"primary",style:{"background-color":"#1890ff",color:"#fff","border-radius":"0 0.315rem 0.315rem 0"},onClick:u[5]||(u[5]=l=>B(!0))},{default:t(()=>[f("搜索")]),_:1})]),_:1},8,["modelValue"])]),ge((n(),g("div",hl,[(n(!0),g(ne,null,re(Y.value,(l,S)=>{var Q;return n(),g("div",{class:ce(["item",{"item-active":c.value==S}]),key:S,onClick:v=>H(l,S)},[a(ue,{class:"avatar",src:l.avatar},null,8,["src"]),e("div",bl,[e("div",kl,[e("div",$l,[e("span",Vl,h(l.real_name||l.nickname),1),e("span",null,h(" (ID:"+l.id+")"),1)]),e("div",null,"手机号: "+h(l.mobile),1)]),e("div",wl,[e("div",null,[f("余额: "),e("span",Cl,h(l.now_money),1)]),e("div",null,[f("采购款: "),e("span",Sl,h(l.purchase_funds),1)]),e("div",null,[f("返还金: "),e("span",Ul,h((Q=l.return_money)==null?void 0:Q.toFixed(2)),1)]),e("div",null,[f("礼品券: "),e("span",xl,h(l.integral),1)]),e("div",null,[l.user_ship==0?(n(),O(ie,{key:0,type:"primary"},{default:t(()=>[f(h(l.user_ship_name),1)]),_:2},1024)):(n(),O(ie,{key:1,type:"success"},{default:t(()=>[f(h(l.user_ship_name),1)]),_:2},1024))])])])],10,gl)}),128)),j.value?(n(),g("div",zl,"没有更多了")):oe("",!0),R.value?(n(),g("div",Al,"加载中...")):oe("",!0)])),[[o,R.value],[m,B]]),a(te,{modelValue:V.value,"onUpdate:modelValue":u[10]||(u[10]=l=>V.value=l),title:"添加用户",width:"600"},{footer:t(()=>[e("div",Rl,[a(p,{onClick:u[9]||(u[9]=l=>V.value=!1)},{default:t(()=>[f("取消")]),_:1}),a(p,{type:"primary",onClick:z},{default:t(()=>[f(" 添加 ")]),_:1})])]),default:t(()=>[a(dl,{ref_key:"addRef",ref:w,onClose:P},null,512)]),_:1},8,["modelValue"])])}}},Ll=ke(Fl,[["__scopeId","data-v-df06e4b9"]]),_e=C=>(we("data-v-5ad4b8f5"),C=C(),Ce(),C),Ol=_e(()=>e("h4",null,"选择支付方式",-1)),Dl={class:"dra-body"},Il={class:"header"},Pl={style:{display:"inline-block"}},Nl=_e(()=>e("div",{style:{color:"#999",padding:"2rem 0 0.3rem 0"}},"应收金额(元):",-1)),El={style:{color:"#f5222d","padding-bottom":"2rem"}},jl={style:{"font-size":"1.6rem"}},ql={key:0,"element-loading-text":"支付中",class:"card1"},Bl=_e(()=>e("div",{class:"tips"},null,-1)),Jl={key:1,class:"card2"},Tl={class:"drawer-body"},Kl={class:"counter"},Ml={class:"received"},Wl={key:0},Gl={key:1,style:{"font-size":"1rem",color:"#999"}},Hl={key:0,class:"balance"},Ql={class:"money"},Xl=_e(()=>e("div",{class:"tips"},"按回车(Enter)确认支付",-1)),Yl={key:1,class:"balance"},Zl=_e(()=>e("div",null,"不够找零, 请支付更多金额",-1)),ea=_e(()=>e("div",{class:"tips"},"按下小键盘输入金额",-1)),la=[Zl,ea],aa={class:"keypad"},ta={class:"left"},sa={class:"right"},oa={style:{width:"100%",display:"flex","justify-content":"center"}},ia={__name:"payUser",emits:["paySuccess"],setup(C,{expose:r,emit:$}){const R=d(!1),F=d(1),c=d(""),j=d("");be();const Y=()=>{u()},B=()=>{pe(()=>{setTimeout(()=>{var m;x.value=!1,c.value="",N.value=!0,(m=j.value)==null||m.focus(),H(F.value)},300)})},H=m=>{m!=1&&j.value.blur(),F.value=m,console.log(F.value),F.value==2?window.addEventListener("keydown",ue):(window.removeEventListener("keydown",ue),pe(()=>{var l;c.value="",(l=j.value)==null||l.focus()}))},V=d({price:0,uid:"",user_ship:"",village:null,brigade:null}),w=d([]),z=d(!1),P=m=>{V.value=m.data,V.value.total=m.data.price,w.value=m.cart_id,z.value=m.isRePay||!1},q=m=>{V.value.total=m.price,E.value=m.order_id},k=$,N=d(!1),b=d(["1","2","3","4","5","6","7","8","9","0","00","."]),A=/^(10|11|12|13|14|15)\d{16}$/,ae=/^(25|26|27|28|29|30)\d{14,22}$/,E=d(""),Z=()=>{if(x.value=!0,j.value.blur(),z.value)U();else{let m;if(A.test(c.value))m="9";else if(ae.test(c.value))m="13";else return x.value=!1,c.value="",j.value.focus(),D.error("请输入正确的支付码");Ie({uid:V.value.uid,user_ship:V.value.user_ship,village:V.value.village,brigade:V.value.brigade,price:V.value.price,pay_type:m,auth_code:c.value}).then(l=>{l.data.out_trade_no&&l.msg=="支付成功"?(R.value=!1,D({message:"支付成功",type:"success"}),u(l.data)):l.msg=="用户支付中"&&l.code==1&&(D.warning(l.msg),K.on("pay_user_success",S=>{D({message:"支付成功",type:"success"}),setTimeout(()=>{K.off("pay_user_success")},200),R.value=!1,u(S)}))}).catch(l=>{x.value=!1,pe(()=>{var S;(S=j.value)==null||S.focus()})})}},U=()=>{let m=17;if(F.value==1)if(A.test(c.value))m="9";else if(ae.test(c.value))m="13";else return x.value=!1,c.value="",j.value.focus(),D.error("请输入正确的支付码");sl({order_id:V.value.order_id,pay_type:m,auth_code:c.value}).then(l=>{var S;(S=l.msg)!=null&&S.includes("成功")?(R.value=!1,D({message:"支付成功",type:"success"}),u({msg:"支付成功"})):l.msg=="用户支付中"&&l.code==1&&(D.warning(l.msg),K.on("pay_user_success",Q=>{D({message:"支付成功",type:"success"}),setTimeout(()=>{K.off("pay_user_success")},200),R.value=!1,u(Q)}))}).catch(l=>{c.value="",x.value=!1,pe(()=>{var S;(S=j.value)==null||S.focus()})})};d(0);const u=(m=null)=>{var l;window.removeEventListener("keydown",ue),N.value=!1,x.value=!1,c.value="",p.value="",_.value=[],(l=j.value)==null||l.blur(),typeof m=="function"&&(m=null),k("paySuccess",m),R.value=!1},x=d(!1);r({drawer:R,setForm:P,setRePay:q,beforeClose:u});const _=d([]),p=d(""),ee=He(()=>+p.value>0?(p.value-V.value.total).toFixed(2):-1),W=d(!1),le=m=>{m===-1?_.value=[]:_.value.pop(),p.value=_.value.length?_.value.join(""):0},J=m=>{W.value===!1&&(p.value="",W.value=!0);let l=String(p.value).indexOf(".")+1,S=String(p.value).length-l;console.log(l,S),(l===0||S<2)&&(_.value.join("")<=9999999&&_.value.push(m),p.value=_.value.join("")>99999999?99999999:_.value.join(""))},ve=()=>{if(ee.value===""||ee.value===null||ee.value===void 0||+p.value<+V.value.total)return D.error("收款金额应该大于等于应收金额");z.value?U():Ie({uid:V.value.uid,user_ship:V.value.user_ship,village:V.value.village,brigade:V.value.brigade,price:V.value.price,pay_type:17}).then(m=>{console.log("========"),R.value=!1,D({message:m.msg,type:"success"}),F.value=1,u({msg:"收款成功"})}).catch(m=>{x.value=!1})},ue=m=>{let S=(m||window.event).keyCode;if(S==37)return H(2);if(S==120)return K.emit("F9");if(S==27)return u();switch(m.stopPropagation(),m.preventDefault(),S){case 96:case 48:J(0);break;case 97:case 49:J(1);break;case 98:case 50:J(2);break;case 99:case 51:J(3);break;case 100:case 52:J(4);break;case 101:case 53:J(5);break;case 102:case 54:J(6);break;case 103:case 55:J(7);break;case 104:case 56:J(8);break;case 105:case 57:J(9);break;case 110:J(".");break;case 190:J(".");break;case 8:le();break;case 13:ve();break}},ie=d(!1),te=()=>{if(!(!R.value||ie.value&&c.value.length>0)&&F.value==2)return H(1)},o=()=>{if(!(!R.value||ie.value&&c.value.length>0)&&F.value==1)return H(2)};return $e(()=>{K.on("left",te),K.on("right",o)}),Ve(()=>{K.off("left",te),K.off("right",o)}),(m,l)=>{const S=y("el-input"),Q=y("el-button"),v=y("Delete"),s=y("el-icon"),G=y("el-drawer"),I=fe("loading");return n(),O(G,{size:"60rem",modelValue:R.value,"onUpdate:modelValue":l[6]||(l[6]=L=>R.value=L),direction:"rtl",onOpen:B,"before-close":u},{header:t(()=>[Ol]),default:t(()=>{var L;return[e("div",Dl,[e("div",Il,[e("div",{class:ce(["left",{active:F.value==1}]),onClick:l[0]||(l[0]=X=>H(1))}," 微信/支付宝 ",2),e("div",{class:ce(["right",{active:F.value==2}]),onClick:l[1]||(l[1]=X=>H(2))}," 现金收款 ",2)]),e("div",null,[e("div",Pl,[Nl,e("div",El,[f(" ¥"),e("span",jl,h((L=V.value)==null?void 0:L.price),1)])])]),F.value==1?ge((n(),g("div",ql,[a(S,{ref_key:"codeRef",ref:j,modelValue:c.value,"onUpdate:modelValue":l[2]||(l[2]=X=>c.value=X),autofocus:"",class:"code-input",placeholder:"请点击输入框聚焦扫码或输入编码号",onKeyup:Ne(Z,["enter"]),onFocus:l[3]||(l[3]=X=>ie.value=!0),onBlur:l[4]||(l[4]=X=>ie.value=!1)},null,8,["modelValue"]),Bl])),[[I,x.value]]):(n(),g("div",Jl,[e("div",Tl,[e("div",Kl,[e("div",Ml,[p.value?(n(),g("span",Wl,h(p.value),1)):(n(),g("span",Gl,"按下键盘输入客户支付金额"))]),ee.value>=0?(n(),g("div",Hl,[e("div",null,[f(" 需找零(元):"),e("span",Ql,"¥"+h(ee.value),1)]),Xl])):(n(),g("div",Yl,la)),e("div",aa,[e("div",ta,[(n(!0),g(ne,null,re(b.value,X=>(n(),O(Q,{key:X,onClick:T=>J(X)},{default:t(()=>[f(h(X),1)]),_:2},1032,["onClick"]))),128))]),e("div",sa,[a(Q,{onClick:le},{default:t(()=>[a(s,null,{default:t(()=>[a(v)]),_:1})]),_:1}),a(Q,{onClick:l[5]||(l[5]=X=>le(-1))},{default:t(()=>[f("C")]),_:1}),a(Q,{class:ce(["enter",{"enter-disable":+p.value<+V.value.total}]),disabled:+p.value<+V.value.total,onClick:ve},{default:t(()=>[f(" 确认 ")]),_:1},8,["class","disabled"])])])])])]))])]}),footer:t(()=>[e("div",oa,[a(Q,{class:"cancel-btn",onClick:Y},{default:t(()=>[f("取消收款")]),_:1})])]),_:1},8,["modelValue"])}}},na=ke(ia,[["__scopeId","data-v-5ad4b8f5"]]),M=C=>(we("data-v-d356fe09"),C=C(),Ce(),C),ua={class:"my-order"},da={class:"header-nav"},ra=["onClick"],ca={key:0,class:"detail"},va={class:"table"},_a=M(()=>e("div",{class:"table-title"},"用户信息",-1)),ma={class:"table-info"},pa={class:"info-item"},fa=M(()=>e("div",{class:"info-item-title"},"用户余额:",-1)),ya={class:"info-item-info red"},ha={class:"info-item"},ga=M(()=>e("div",{class:"info-item-title"},"采购款:",-1)),ba={class:"info-item-info red"},ka={class:"info-item"},$a=M(()=>e("div",{class:"info-item-title"},"返还金:",-1)),Va={class:"info-item-info red"},wa={class:"info-item"},Ca=M(()=>e("div",{class:"info-item-title"},"头像:",-1)),Sa={class:"info-item-info"},Ua={class:"info-item"},xa=M(()=>e("div",{class:"info-item-title"},"礼品券:",-1)),za={class:"info-item-info red"},Aa={class:"info-item"},Ra=M(()=>e("div",{class:"info-item-title"},"冻结礼品券:",-1)),Fa={class:"info-item-info red"},La={class:"info-item"},Oa=M(()=>e("div",{class:"info-item-title"},"ID:",-1)),Da={class:"info-item-info"},Ia={class:"info-item"},Pa=M(()=>e("div",{class:"info-item-title"},"用户昵称:",-1)),Na={class:"info-item-info"},Ea={class:"info-item"},ja=M(()=>e("div",{class:"info-item-title"},"用户电话:",-1)),qa={class:"info-item-info"},Ba={class:"info-item"},Ja=M(()=>e("div",{class:"info-item-title"},"用户账号:",-1)),Ta={class:"info-item-info"},Ka={class:"info-item"},Ma=M(()=>e("div",{class:"info-item-title"},"真实姓名:",-1)),Wa={class:"info-item-info"},Ga={class:"info-item"},Ha=M(()=>e("div",{class:"info-item-title"},"创建时间:",-1)),Qa={class:"info-item-info"},Xa={class:"info-item",style:{width:"100%","flex-shrink":"0","align-items":"center"}},Ya=M(()=>e("div",{class:"info-item-title"},"用户类型:",-1)),Za={class:"info-item-info"},et={class:"info-item",style:{width:"100%","flex-shrink":"0","align-items":"center"}},lt=M(()=>e("div",{class:"info-item-title"},"用户地址:",-1)),at={key:1,class:"detail"},tt={class:"table","infinite-scroll-distance":300,"infinite-scroll-delay":300,style:{overflow:"auto"},"infinite-scroll-immediate":!1},st={style:{display:"flex","align-items":"center"}},ot={style:{"margin-left":"0.5rem"}},it={key:0,style:{display:"flex","align-items":"center"}},nt={class:"footer"},ut={key:0},dt={key:1},rt={key:2},ct={class:"dialog-footer"},vt={key:0},_t={class:"ship-money-list"},mt=["onClick"],pt={class:"item1"},ft={class:"item2"},yt={class:"dialog-footer"},ht={__name:"detail",setup(C){be(),Qe();const r=d({id:""});d({price:"",type:1});const $=d(null),R=(v=null)=>{ie()},F=d(!1),c=d([]);(()=>{Ee({type_id:4}).then(v=>{c.value=v.data.lists})})();const Y=()=>{el({id:r.value.id,user_ship:r.value.user_ship}).then(v=>{var s;D.success("修改成功"),r.value.user_ship_name=(s=c.value.find(G=>G.id==r.value.user_ship))==null?void 0:s.title,F.value=!1})},B=()=>{F.value=!1},H=d([]);(()=>{ll().then(v=>{H.value=v.data,console.log(v)})})();const w=d({id:"",province:"",city:"",area:"",street:"",brigade:""}),z=d([]),P=d([]),q=()=>{al({uid:r.value.id}).then(v=>{var s;(s=v.data)!=null&&s.village?(z.value=[v.data.city,v.data.area,v.data.street,v.data.village,+v.data.brigade],P.value=JSON.parse(JSON.stringify(z.value)),w.value=v.data):(z.value=[],P.value=[],w.value={id:"",province:"",city:"",area:"",street:"",brigade:""})}).catch(v=>{z.value=[],P.value=[],w.value={id:"",province:"",city:"",area:"",street:"",brigade:""}})},k=d([]),N=async(v,s)=>{const G=v.level;let I;if(G!==0&&!v.data.code)return s([]);G===0?(I=await Se({province_code:51e4}),I=I.data.map(L=>({code:L.city_code,name:L.city_name}))):G===1?(I=await Ue({city_code:v.data.code}),I=I.data.map(L=>({code:L.area_code,name:L.area_name}))):G===2?(I=await xe({area_code:v.data.code}),I=I.data.map(L=>({code:L.street_code,name:L.street_name}))):G===3?(I=await ze({street_code:v.data.code}),I=I.data.map(L=>({code:L.village_code,name:L.village_name}))):G===4&&(I=await Ae({village_code:v.data.code}),I=I.data.map(L=>({code:L.id,name:L.brigade_name,leaf:!0}))),s(I)},b={value:"code",label:"name",children:"children",multiple:!1,lazy:!0,lazyLoad:N},A=async()=>{w.value.city=z.value[0],w.value.area=z.value[1],w.value.street=z.value[2],w.value.village=z.value[3],w.value.brigade=z.value[4],w.value.phone||(w.value.phone=r.value.account),w.value.real_name||(w.value.real_name=r.value.real_name||r.value.nickname),tl({...w.value,uid:r.value.id}).then(v=>{P.value=JSON.parse(JSON.stringify(z.value)),D.success("编辑成功"),E.value=!0}).catch(v=>{ae()})},ae=()=>{z.value=JSON.parse(JSON.stringify(P.value)),P.value.length>0&&(w.value.city=P.value[0],w.value.area=P.value[1],w.value.street=P.value[2],w.value.village=P.value[3],w.value.brigade=P.value[4]),E.value=!0},E=d(!0),Z=d(0),U=d(["基本信息","用户资产"]),u=d(!1),x=d([]),_=d({page_no:1,page_size:10,loading:!1,loadend:!1});let p=[];const ee=(v=!1)=>{v&&(x.value=[],_.value.page_no=1,_.value.loadend=!1),!(_.value.loadend||_.value.loading)&&(_.value.loading=!0,ol({uid:r.value.id,page_no:_.value.page_no,page_size:_.value.page_size}).then(s=>{x.value=[...x.value,...s.data.lists],_.value.loading=!1,_.value.page_no++,s.data.lists.length<_.value.page_size&&(_.value.loadend=!0)}))},W=d({mobile:"",code:""}),le=d(!1),J=()=>{if(W.value.mobile=r.value.phone,W.value.code="",p=x.value.filter(v=>v.n_num).map(v=>({product_id:v.product_id,nums:v.n_num})),p.length==0)return D.error("请选择商品");le.value=!0},ve=()=>{console.log("发送短信验证码"),D.success("验证码已发送")},ue=()=>{if(W.value.code=="")return D.error("请输入验证码");il({uid:r.value.id,info:p}).then(v=>{u.value=!1,D.success("出库成功"),le.value=!1,ee(!0)})},ie=()=>{Pe({id:r.value.id}).then(({data:v})=>{v.phone=v.mobile+"",delete v.mobile,r.value=Object.assign(r.value,v)})},te=d(!1),o=d({user_ship:"",user_ship_name:"",limit:"",money:"",type:""}),m=()=>{o.value.money=Number(o.value.money).toFixed(2),(+o.value.money<+o.value.limit||+o.value.money>1e4)&&(+o.value.limit>0?o.value.money=o.value.limit:o.value.money="")},l=v=>{if(o.value.type=="add"){let s=c.value.find(G=>G.id==v);s&&(o.value.limit=s.limit,o.value.user_ship_name=s.title,o.value.money=s.limit)}},S=()=>{if(o.value.user_ship===""||o.value.user_ship===null||o.value.user_ship===void 0||o.value.user_ship===0)return D.error("请选择会员类型");if(o.value.money==0||o.value.money=="")return D.error(o.value.type=="add"?"请输入充值金额":"请选择金额");if(o.value.type=="add"&&(+o.value.money<+o.value.limit||+o.value.money>1e4))return+o.value.limit>0?o.value.money=o.value.limit:o.value.money="",D.error(`该类型至少需要充值${o.value.limit}元`);$.value.setForm({data:{uid:r.value.id,price:o.value.money,user_ship:o.value.user_ship,village:w.value.village,brigade:w.value.brigade}}),$.value.drawer=!0,pe(()=>{te.value=!1})},Q=v=>{if(P.value.length==0)return D.error("请先选择用户地址");o.value.type=v,v=="add"&&(o.value.user_ship=r.value.user_ship,o.value.user_ship_name=r.value.user_ship_name,l(o.value.user_ship)),te.value=!0};return $e(()=>{K.on("set-user-detail",v=>{r.value=v,u.value=!1,Pe({id:r.value.id}).then(({data:s})=>{s.phone=s.mobile+"",delete s.mobile,r.value=Object.assign(v,s)}),z.value=[],P.value=[],q(),ee(!0),o.value={user_ship:"",user_ship_name:"",limit:"",money:"",type:""}})}),Ve(()=>{K.off("set-user-detail")}),(v,s)=>{var Oe;const G=y("el-avatar"),I=y("el-tag"),L=y("el-option"),X=y("el-select"),T=y("el-button"),qe=y("el-cascader"),Be=y("el-image"),he=y("el-table-column"),Je=y("el-input-number"),Te=y("el-table"),Ke=y("el-empty"),me=y("el-input"),de=y("el-form-item"),Fe=y("el-form"),Le=y("el-dialog"),Me=fe("infinite-scroll"),We=fe("loading");return n(),g("div",ua,[e("div",da,[(n(!0),g(ne,null,re(U.value,(i,se)=>(n(),g("div",{key:se,class:ce(["nav-item",{"nav-item-active":Z.value==se,"nav-item-radius1":Z.value==se+1,"nav-item-radius2":Z.value==se-1}]),onClick:Ge=>Z.value=se},h(i),11,ra))),128)),e("div",{class:ce(["nav-item",{"nav-item-radius2":Z.value==U.value.length-1}]),style:{flex:"1"}},null,2)]),r.value.id&&Z.value==0?(n(),g("div",ca,[e("div",va,[_a,e("div",ma,[e("div",pa,[fa,e("div",ya,"¥"+h(r.value.now_money),1)]),e("div",ha,[ga,e("div",ba,"¥"+h(r.value.purchase_funds),1)]),e("div",ka,[$a,e("div",Va,"¥"+h((Oe=r.value.return_money)==null?void 0:Oe.toFixed(2)),1)]),e("div",wa,[Ca,e("div",Sa,[a(G,{style:{width:"4rem",height:"4rem"},src:r.value.avatar},null,8,["src"])])]),e("div",Ua,[xa,e("div",za,"¥"+h(r.value.integral),1)]),e("div",Aa,[Ra,e("div",Fa,"¥"+h(r.value.get_frozen),1)]),e("div",La,[Oa,e("div",Da,h(r.value.id),1)]),e("div",Ia,[Pa,e("div",Na,h(r.value.nickname),1)]),e("div",Ea,[ja,e("div",qa,h(r.value.phone),1)]),e("div",Ba,[Ja,e("div",Ta,h(r.value.account),1)]),e("div",Ka,[Ma,e("div",Wa,h(r.value.real_name),1)]),e("div",Ga,[Ha,e("div",Qa,h(r.value.create_time),1)]),e("div",Xa,[Ya,e("div",Za,[F.value==!1?(n(),g(ne,{key:0},[r.value.user_ship==0?(n(),O(I,{key:0,type:"primary",size:"large"},{default:t(()=>[f(h(r.value.user_ship_name),1)]),_:1})):(n(),O(I,{key:1,type:"success",size:"large"},{default:t(()=>[f(h(r.value.user_ship_name),1)]),_:1}))],64)):(n(),g(ne,{key:1},[a(X,{modelValue:r.value.user_ship,"onUpdate:modelValue":s[0]||(s[0]=i=>r.value.user_ship=i),placeholder:"请选择用户类型",style:{width:"10rem"}},{default:t(()=>[(n(!0),g(ne,null,re(c.value,i=>(n(),O(L,{key:i.id,label:i.title,value:i.id,disabled:i.id!=0&&i.id!=4},null,8,["label","value","disabled"]))),128))]),_:1},8,["modelValue"]),a(T,{type:"primary",style:{"margin-left":"1rem"},onClick:Y},{default:t(()=>[f("确认")]),_:1}),a(T,{style:{"margin-left":"1rem"},onClick:B},{default:t(()=>[f("取消")]),_:1})],64))])]),e("div",et,[lt,(n(),O(qe,{key:r.value.id,style:{flex:"1"},modelValue:z.value,"onUpdate:modelValue":s[1]||(s[1]=i=>z.value=i),options:k.value,props:b,load:N,class:"w-full",disabled:E.value},null,8,["modelValue","options","disabled"])),E.value&&!P.value.length?(n(),O(T,{key:0,type:"primary",style:{"margin-left":"1rem"},onClick:s[2]||(s[2]=i=>E.value=!1)},{default:t(()=>[f("修改")]),_:1})):oe("",!0),E.value?oe("",!0):(n(),O(T,{key:1,type:"primary",style:{"margin-left":"1rem"},onClick:A},{default:t(()=>[f("确认")]),_:1})),E.value?oe("",!0):(n(),O(T,{key:2,style:{"margin-left":"1rem"},onClick:ae},{default:t(()=>[f("取消")]),_:1}))]),r.value.user_ship!=0?(n(),O(T,{key:0,type:"success",class:"big-btn",size:"large",onClick:s[3]||(s[3]=i=>Q("add"))},{default:t(()=>[f("增加经营资金")]),_:1})):(n(),O(T,{key:1,type:"primary",class:"big-btn",size:"large",onClick:s[4]||(s[4]=i=>Q("recharge"))},{default:t(()=>[f("成为会员")]),_:1}))])])])):oe("",!0),r.value.id&&Z.value==1?ge((n(),g("div",at,[ge((n(),g("div",tt,[a(Te,{data:x.value},{default:t(()=>[a(he,{label:"商品信息"},{default:t(({row:i})=>[e("div",st,[a(Be,{style:{height:"3rem",width:"3rem","flex-shrink":"0"},src:i.image},null,8,["src"]),e("span",ot,h(i.store_name),1)])]),_:1}),a(he,{prop:"price",label:"单价",width:u.value?130:200},null,8,["width"]),a(he,{prop:"nums",label:"存量",width:u.value?100:200},null,8,["width"]),u.value?(n(),O(he,{key:0,prop:"nums",label:"出库量",width:"250"},{default:t(({row:i})=>[i.nums?(n(),g("div",it,[a(Je,{modelValue:i.n_num,"onUpdate:modelValue":se=>i.n_num=se,"step-strictly":"",min:0,max:i.nums},null,8,["modelValue","onUpdate:modelValue","max"]),a(T,{type:"primary",style:{"margin-left":"1rem"},onClick:se=>i.n_num=i.nums},{default:t(()=>[f("全部")]),_:2},1032,["onClick"])])):oe("",!0)]),_:1})):oe("",!0)]),_:1},8,["data"])])),[[Me,ee]]),e("div",nt,[u.value?(n(),g("div",dt,[a(T,{type:"primary",size:"large",onClick:J},{default:t(()=>[f("确认出库")]),_:1}),a(T,{size:"large",onClick:s[6]||(s[6]=i=>u.value=!1)},{default:t(()=>[f("取消")]),_:1})])):(n(),g("div",ut,[a(T,{type:"warning",size:"large",onClick:s[5]||(s[5]=i=>u.value=!0),disabled:x.value.length==0},{default:t(()=>[f("商品出库")]),_:1},8,["disabled"])]))])])),[[We,_.value.loading]]):(n(),g("div",rt,[a(Ke)])),a(na,{ref_key:"payRef",ref:$,onPaySuccess:R},null,512),a(Le,{modelValue:le.value,"onUpdate:modelValue":s[10]||(s[10]=i=>le.value=i),title:"出库验证",width:"500"},{footer:t(()=>[e("div",ct,[a(T,{onClick:s[9]||(s[9]=i=>le.value=!1)},{default:t(()=>[f("取消")]),_:1}),a(T,{type:"primary",onClick:ue},{default:t(()=>[f(" 确认 ")]),_:1})])]),default:t(()=>[a(Fe,{model:W.value},{default:t(()=>[a(de,{label:"手机号:"},{default:t(()=>[a(me,{modelValue:W.value.mobile,"onUpdate:modelValue":s[7]||(s[7]=i=>W.value.mobile=i),autocomplete:"off",readonly:""},null,8,["modelValue"])]),_:1}),a(de,{label:"验证码:"},{default:t(()=>[a(me,{modelValue:W.value.code,"onUpdate:modelValue":s[8]||(s[8]=i=>W.value.code=i),autocomplete:"off",placeholder:"请输入验证码",style:{flex:"1"}},null,8,["modelValue"]),(n(),O(je,{style:{"margin-left":"1rem"},onSendCode:ve,key:W.value.mobile}))]),_:1})]),_:1},8,["model"])]),_:1},8,["modelValue"]),a(Le,{modelValue:te.value,"onUpdate:modelValue":s[17]||(s[17]=i=>te.value=i),title:o.value.type=="add"?"增加经营资金":"成为会员",width:"500"},{footer:t(()=>[e("div",yt,[a(T,{onClick:s[16]||(s[16]=i=>te.value=!1)},{default:t(()=>[f("取消")]),_:1}),a(T,{type:"primary",onClick:S},{default:t(()=>[f(" 确认 ")]),_:1})])]),default:t(()=>[a(Fe,{model:o.value,"label-width":"100px"},{default:t(()=>[a(de,{label:"手机号:"},{default:t(()=>[a(me,{modelValue:r.value.phone,"onUpdate:modelValue":s[11]||(s[11]=i=>r.value.phone=i),autocomplete:"off",readonly:""},null,8,["modelValue"])]),_:1}),o.value.type=="add"?(n(),O(de,{key:0,label:"会员类型:"},{default:t(()=>[a(me,{modelValue:o.value.user_ship_name,"onUpdate:modelValue":s[12]||(s[12]=i=>o.value.user_ship_name=i),autocomplete:"off",readonly:""},null,8,["modelValue"])]),_:1})):(n(),O(de,{key:1,label:"会员类型:",required:""},{default:t(()=>[a(X,{modelValue:o.value.user_ship,"onUpdate:modelValue":s[13]||(s[13]=i=>o.value.user_ship=i),placeholder:"请选择用户类型",style:{flex:"1"},onChange:l},{default:t(()=>[(n(!0),g(ne,null,re(c.value,i=>(n(),O(L,{key:i.id,label:i.title,value:i.id,disabled:i.id==0},null,8,["label","value","disabled"]))),128))]),_:1},8,["modelValue"])]),_:1})),o.value.type=="add"?(n(),O(de,{key:2,label:"充值金额:",required:""},{default:t(()=>[a(me,{modelValue:o.value.money,"onUpdate:modelValue":s[14]||(s[14]=i=>o.value.money=i),type:"number",onBlur:m,onFocus:s[15]||(s[15]=i=>o.value.money=""),autocomplete:"off"},{prepend:t(()=>[f("¥")]),append:t(()=>[f("元")]),_:1},8,["modelValue"]),o.value.limit?(n(),g("div",vt,h(`${o.value.user_ship_name}角色至少要充值${o.value.limit}元, 最大不超过10000元`),1)):oe("",!0)]),_:1})):(n(),O(de,{key:3,label:"充值金额:",required:""},{default:t(()=>[e("div",_t,[(n(!0),g(ne,null,re(H.value,(i,se)=>(n(),g("div",{class:ce(["ship-money-item",{"ship-money-item-active":i.money==o.value.money}]),onClick:Ge=>o.value.money=i.money,key:se},[e("div",pt,h(i.money)+h(i.money_string),1),e("div",ft,"送"+h(i.send)+h(i.send_string),1)],10,mt))),128))])]),_:1}))]),_:1},8,["model"])]),_:1},8,["modelValue","title"])])}}},gt=ke(ht,[["__scopeId","data-v-d356fe09"]]),bt={class:"my-card"},xt={__name:"index",setup(C){return(r,$)=>(n(),g("div",bt,[a(Ll,{style:{"flex-shrink":"0"},ref:"orderRef"},null,512),a(nl),a(gt,{ref:"detailRef"},null,512)]))}};export{xt as default}; diff --git a/build/assets/index-BMcBprbe.js b/build/assets/index-DdiPW3dN.js similarity index 99% rename from build/assets/index-BMcBprbe.js rename to build/assets/index-DdiPW3dN.js index d90f319..bca9f88 100644 --- a/build/assets/index-BMcBprbe.js +++ b/build/assets/index-DdiPW3dN.js @@ -1,4 +1,4 @@ -var Np=Object.defineProperty;var Gp=(W,A,o)=>A in W?Np(W,A,{enumerable:!0,configurable:!0,writable:!0,value:o}):W[A]=o;var au=(W,A,o)=>(Gp(W,typeof A!="symbol"?A+"":A,o),o);import{c as Kp,a as Hp,b as Xo,s as zp,o as kp}from"./store-DNW8I_iw.js";import{_ as ht,r as R,o as Dt,m as re,a as Nt,b as tn,c as B,d as ae,w as _n,e as v,f as N,g as sn,t as G,n as _u,E as qe,u as Dr,h as Ut,i as Jo,j as du,k as Q,F as Ft,l as Mt,p as te,q as pu,s as gu,v as Wt,x as qp,y as Br,z as Ur,A as Vp,B as ct,C as Wr,D as Zp,G as Yp,H as Xp}from"./index-B9unL6O8.js";import{u as Jp}from"./user-DptWFEfy.js";import"./moment-Cl4UOzQZ.js";import{p as Yo}from"./padding-DLHwO6AB.js";import"./axiosAPI-BnxnV-Ca.js";import{m as cu,s as Qp}from"./shop-CbMLEgdU.js";import{p as jp}from"./pay-BFyuVP94.js";import"./authCode-D610lJnm.js";/* empty css */const ng={class:"price"},eg={class:"flex"},tg={style:{margin:"0.625rem","padding-bottom":"40px"}},rg={style:{color:"#f5222d","font-weight":"bold","margin-left":"1rem"}},ig={class:"dialog-footer"},ug={__name:"price",emits:["changeAllPrice"],setup(W,{expose:A,emit:o}){const b=R(!1),V=R(null),j=R(0),x=(H=!0,y=0)=>{X.value.nowPrice="",X.value.percentage="",b.value=H,j.value=y,_u(()=>{setTimeout(()=>{var nn;(nn=V.value)==null||nn.focus()},150)})},X=R({nowPrice:"",percentage:""}),pn=H=>{X.value.percentage=(H/j.value*100).toFixed(2)},fn=H=>{X.value.nowPrice=(j.value*H/100).toFixed(2)},rn=o,U=()=>{if(X.value.percentage>100)return X.value.nowPrice="",X.value.percentage="",qe.error("改价金额不能大于当前订单金额");if(X.value.nowPrice<=0)return X.value.nowPrice="",X.value.percentage="",qe.error("金额不能小于0");rn("changeAllPrice",X.value.nowPrice)};A({show:x,dialogVisible:b});const Cn=()=>{b.value&&U()};return Dt(()=>{re.on("enter",Cn)}),Nt(()=>{re.off("enter",Cn)}),(H,y)=>{const nn=tn("el-input"),F=tn("el-button"),k=tn("el-dialog");return B(),ae(k,{modelValue:b.value,"onUpdate:modelValue":y[2]||(y[2]=an=>b.value=an),title:"订单改价",width:"650"},{footer:_n(()=>[v("div",ig,[N(F,{class:"ok-btn",type:"primary",onClick:U},{default:_n(()=>[sn(" 确定 (Enter) ")]),_:1})])]),default:_n(()=>[v("div",ng,[v("div",eg,[N(nn,{ref_key:"priceRef",ref:V,style:{flex:"3",margin:"0.625rem",height:"2.5rem"},modelValue:X.value.nowPrice,"onUpdate:modelValue":y[0]||(y[0]=an=>X.value.nowPrice=an),type:"number",placeholder:"请输入改价后的价格",onInput:pn},{suffix:_n(()=>[sn("元")]),_:1},8,["modelValue"]),N(nn,{style:{flex:"2",margin:"0.625rem",height:"2.5rem"},modelValue:X.value.percentage,"onUpdate:modelValue":y[1]||(y[1]=an=>X.value.percentage=an),type:"number",placeholder:"请输入比例",onInput:fn},{suffix:_n(()=>[sn("%")]),_:1},8,["modelValue"])]),v("div",tg,[sn(" 改价后金额: "),v("span",rg,"¥"+G(X.value.nowPrice||j.value||" - - "),1)])])]),_:1},8,["modelValue"])}}},sg=ht(ug,[["__scopeId","data-v-924edcc0"]]),og={class:"check-user-list"},lg={class:"header-input"},fg={class:"order-lists","infinite-scroll-distance":300,"infinite-scroll-delay":500,style:{overflow:"auto"}},ag=["onClick"],cg={style:{display:"flex","flex-direction":"column","justify-content":"space-around",flex:"1"}},hg={class:"top"},_g={class:"bold"},dg={class:"flex-between"},pg={class:"mr-2"},gg={class:"bottom flex",style:{"justify-content":"space-between"}},vg={class:"red"},mg={class:"red"},yg={class:"red"},wg={key:0,class:"load-end"},xg={key:1,class:"load-end"},Ag={__name:"userList",emits:["setUser"],setup(W,{expose:A,emit:o}){Dr();const b=R(!1),V=R({page_no:1,page_size:20,mobile:""}),j=o,x=R(!1),X=R(0),pn=R(!1),fn=R([]),rn=(H=!1)=>{if(H)V.value.page_no=1;else if(pn.value||x.value)return;x.value=!0,Jp(V.value).then(y=>{H?fn.value=y.data.lists:fn.value=[...fn.value,...y.data.lists],y.data.lists.length{pn.value=!0,x.value=!1})},U=(H,y)=>{j("setUser",H),b.value=!1};return A({open:(H=null)=>{H||(V.value.mobile=""),b.value=!0,rn(!0)}}),(H,y)=>{const nn=tn("el-button"),F=tn("el-input"),k=tn("el-avatar"),an=tn("el-tag"),cn=tn("el-dialog"),on=Ut("loading"),hn=Ut("infinite-scroll");return B(),ae(cn,{modelValue:b.value,"onUpdate:modelValue":y[4]||(y[4]=Z=>b.value=Z),title:"选择用户",width:"800"},{default:_n(()=>[v("div",og,[v("div",lg,[N(F,{modelValue:V.value.mobile,"onUpdate:modelValue":y[1]||(y[1]=Z=>V.value.mobile=Z),placeholder:"搜索手机号/ID",onKeydown:y[2]||(y[2]=Jo(Z=>rn(!0),["enter"])),onClear:y[3]||(y[3]=Z=>rn(!0)),clearable:""},{append:_n(()=>[N(nn,{type:"primary",style:{"background-color":"#1890ff",color:"#fff","border-radius":"0 0.315rem 0.315rem 0"},onClick:y[0]||(y[0]=Z=>rn(!0))},{default:_n(()=>[sn("搜索")]),_:1})]),_:1},8,["modelValue"])]),du((B(),Q("div",fg,[(B(!0),Q(Ft,null,Mt(fn.value,(Z,O)=>(B(),Q("div",{class:"item",key:O,onClick:vn=>U(Z,O)},[N(k,{class:"avatar",src:Z.avatar},null,8,["src"]),v("div",cg,[v("div",hg,[v("div",null,[v("span",_g,G(Z.nickname),1),v("span",null,G(" (ID:"+Z.id+")"),1)]),v("div",dg,[v("div",pg,"手机号: "+G(Z.mobile||Z.account),1),Z.user_ship==0?(B(),ae(an,{key:0,type:"primary"},{default:_n(()=>[sn(G(Z.user_ship_name),1)]),_:2},1024)):(B(),ae(an,{key:1,type:"success"},{default:_n(()=>[sn(G(Z.user_ship_name),1)]),_:2},1024))])]),v("div",gg,[v("div",null,[sn("采购款: "),v("span",vg,G(Z.purchase_funds),1)]),v("div",null,[sn("礼品券: "),v("span",mg,G(Z.integral),1)]),v("div",null,[sn("余额: "),v("span",yg,G(Z.now_money),1)])])])],8,ag))),128)),pn.value?(B(),Q("div",wg,"没有更多了")):te("",!0),x.value?(B(),Q("div",xg,"加载中...")):te("",!0)])),[[on,x.value],[hn,rn]])])]),_:1},8,["modelValue"])}}},Ig=ht(Ag,[["__scopeId","data-v-7ac34513"]]),Cg=W=>(pu("data-v-e0ef5c53"),W=W(),gu(),W),Lg={class:"my-order"},Sg={class:"user-nav"},Rg={class:"user-info"},bg={key:0,class:"info"},Eg={class:"flex-bewteen"},Tg={class:"flex-bewteen",style:{"align-items":"flex-start"}},Og={class:"user-money"},Pg={style:{"margin-right":"0.5rem"}},$g={style:{color:"#f70"}},Bg={style:{"margin-right":"0.5rem"}},Wg={style:{color:"#f70"}},Ug={style:{color:"#f70"}},Fg={key:1,class:"info",style:{"align-items":"center",display:"flex","justify-content":"space-between"}},Mg={class:"flex-bewteen",style:{width:"100%"}},Dg=Cg(()=>v("div",{style:{"font-size":"1.2rem"}},"游客",-1)),Ng={class:"header-nav"},Gg={class:"nav-item"},Kg={class:"order-list"},Hg={class:"order-item-info"},zg={class:"order-item-title"},kg={class:"title"},qg=["onClick"],Vg={class:"order-item-sku"},Zg={class:"order-item-price"},Yg={class:"order-footer"},Xg={class:"order-total"},Jg={class:"price",style:{"flex-direction":"column","align-items":"flex-start"}},Qg={class:"total-item",style:{"flex-shrink":"0"}},jg={style:{"font-size":"1.4rem"}},nv={key:0,class:"total-item",style:{"padding-right":"0","line-height":"0.8rem"}},ev={style:{"font-size":"0.8rem"}},tv={class:"update-price"},rv={class:"order-btn"},iv={__name:"order",emits:["goPay","editAttr","getStoreList"],setup(W,{expose:A,emit:o}){const b=R([]),V=R(0),j=R(0),x=R(0);Dr();const X=R(null),pn=()=>{let P=[];b.value.map(E=>{P.push(E.id)}),P.length!=0&&rn(P)},fn=P=>{b.value=b.value.filter(E=>E.id!=P),rn([P])},rn=P=>{Kp({id:P}).then(E=>{y()})},U=R({uid:""}),Cn=P=>{U.value=P,U.value.uid=P.id,y(),nn("getStoreList",{uid:P.id},!0)},H=R({}),y=()=>{V.value=0,j.value=0,x.value=0,Hp({uid:U.value.uid}).then(P=>{H.value=P.data.extend,b.value=P.data.lists||[]})};y();const nn=o,F=()=>{nn("goPay")},k=(P,E)=>{Xo({product_id:P.product_id,cart_num:P.cart_num}).then(Tn=>{y()}).catch(Tn=>{var Bn;let On=(Bn=Tn==null?void 0:Tn.msg)==null?void 0:Bn.match(/\b\d+(\.\d+)?\b/);On?P.cart_num=+On[0]:P.cart_num=1})},an=P=>{x.value=j.value-P,V.value=+P,_u(()=>{setTimeout(()=>{on(!1)},150)})};R(0);const cn=R(null),on=(P=!0)=>{cn.value.show(P,j.value)},hn=R(!1);A({getList:y,resetView:()=>{hn.value=!1,y()},list:b,discounts:x,allPrice:V,userInfo:U,is_storage:hn});const O=()=>{cn.value.dialogVisible?cn.value.dialogVisible=!1:on()},vn=()=>{b.value.length>0&&pn()};return Dt(()=>{re.on("insert",O),re.on("delete",vn)}),Nt(()=>{re.off("insert",O),re.off("delete",vn)}),(P,E)=>{const Tn=tn("el-avatar"),On=tn("ArrowRight"),Bn=tn("el-icon"),ce=tn("el-button"),Ve=tn("RefreshLeft"),Gr=tn("Delete"),ge=tn("el-empty"),he=tn("el-image"),Gt=tn("el-input-number"),Ze=tn("el-switch");return B(),Q("div",Lg,[v("div",Sg,[v("div",Rg,[N(Tn,{class:"avatar",src:U.value.avatar},null,8,["src"]),U.value.uid?(B(),Q("div",bg,[v("div",Eg,[v("div",null,"手机号: "+G(U.value.mobile||U.value.account),1),N(ce,{type:"primary",link:"",class:"change-user",onClick:E[0]||(E[0]=J=>X.value.open(U.value.uid))},{default:_n(()=>[sn("切换用户"),N(Bn,null,{default:_n(()=>[N(On)]),_:1})]),_:1})]),v("div",Tg,[v("div",Og,[v("div",Pg,[sn("采购款: "),v("span",$g,G(U.value.purchase_funds),1)]),v("div",Bg,[sn("礼品券: "),v("span",Wg,G(U.value.integral),1)]),v("div",null,[sn("余额: "),v("span",Ug,G(U.value.now_money),1)])]),N(ce,{style:{"margin-top":"0.2rem"},link:"",onClick:E[1]||(E[1]=J=>Cn({id:""}))},{default:_n(()=>[sn(" 重置"),N(Bn,null,{default:_n(()=>[N(Ve)]),_:1})]),_:1})])])):(B(),Q("div",Fg,[v("div",Mg,[Dg,N(ce,{type:"primary",link:"",class:"change-user",onClick:E[2]||(E[2]=J=>X.value.open())},{default:_n(()=>[sn("切换用户"),N(Bn,null,{default:_n(()=>[N(On)]),_:1})]),_:1})])]))]),N(Ig,{ref_key:"userListRef",ref:X,onSetUser:Cn},null,512)]),v("div",Ng,[v("div",Gg,[sn(" 已选购 "),v("span",null,G(b.value.length),1),sn(" 款 ")]),v("div",{class:"nav-item-clear",onClick:pn},[N(Bn,null,{default:_n(()=>[N(Gr)]),_:1}),sn("清空 (Delete) ")])]),v("div",Kg,[b.value.length==0?(B(),ae(ge,{key:0,description:"请点击右侧添加商品"})):(B(!0),Q(Ft,{key:1},Mt(b.value,(J,Kr)=>(B(),Q("div",{class:"order-item",key:Kr},[N(he,{loading:"lazy",class:"order-item-img",src:J.image},null,8,["src"]),v("div",Hg,[v("div",zg,[v("div",kg,G(J.store_name),1),v("div",{class:"delete",onClick:Re=>fn(J.id)},"删除",8,qg)]),v("div",Vg,[v("span",null,G(J.unit_name),1)]),v("div",Zg,[v("div",null,[sn(" ¥"),v("span",null,G(J.price),1)]),v("div",null,[J.is_bulk==0?(B(),ae(Gt,{key:0,modelValue:J.cart_num,"onUpdate:modelValue":Re=>J.cart_num=Re,min:+J.batch>0?+J.batch:1,step:1,"step-strictly":"",onChange:Re=>k(J)},null,8,["modelValue","onUpdate:modelValue","min","onChange"])):(B(),ae(Gt,{key:1,modelValue:J.cart_num,"onUpdate:modelValue":Re=>J.cart_num=Re,min:+J.batch>0?+J.batch:.1,step:.1,precision:2,"step-strictly":"",onChange:Re=>k(J)},null,8,["modelValue","onUpdate:modelValue","min","onChange"]))])])])]))),128))]),v("div",Yg,[v("div",Xg,[v("div",Jg,[v("div",Qg,[sn(" 合计: "),v("span",null,[sn("¥"),v("span",jg,G(H.value.pay_price||"0.00"),1)])]),H.value.msg?(B(),Q("div",nv,[v("span",ev,G(H.value.msg),1)])):te("",!0)]),v("div",tv,[N(Ze,{modelValue:hn.value,"onUpdate:modelValue":E[3]||(E[3]=J=>hn.value=J),size:"large","inline-prompt":"","active-text":"存货","inactive-text":"不存"},null,8,["modelValue"])])]),v("div",rv,[N(ce,{class:"btn",type:"primary",onClick:F,disabled:b.value.length==0},{default:_n(()=>[sn(G("立即结账 (F9)"))]),_:1},8,["disabled"])])]),N(sg,{ref_key:"priceRef",ref:cn,onChangeAllPrice:an},null,512)])}}},uv=ht(iv,[["__scopeId","data-v-e0ef5c53"]]);var Fr={exports:{}};/** +var Np=Object.defineProperty;var Gp=(W,A,o)=>A in W?Np(W,A,{enumerable:!0,configurable:!0,writable:!0,value:o}):W[A]=o;var au=(W,A,o)=>(Gp(W,typeof A!="symbol"?A+"":A,o),o);import{c as Kp,a as Hp,b as Xo,s as zp,o as kp}from"./store-BoFe3Agt.js";import{_ as ht,r as R,o as Dt,m as re,a as Nt,b as tn,c as B,d as ae,w as _n,e as v,f as N,g as sn,t as G,n as _u,E as qe,u as Dr,h as Ut,i as Jo,j as du,k as Q,F as Ft,l as Mt,p as te,q as pu,s as gu,v as Wt,x as qp,y as Br,z as Ur,A as Vp,B as ct,C as Wr,D as Zp,G as Yp,H as Xp}from"./index-CEprPOh1.js";import{u as Jp}from"./user-DiHB_Leh.js";import"./moment-Cl4UOzQZ.js";import{p as Yo}from"./padding-Bq_IbaOz.js";import"./axiosAPI-JxG9ekqU.js";import{m as cu,s as Qp}from"./shop-DX9HGddz.js";import{p as jp}from"./pay-C9Lsc2yr.js";import"./authCode-k34-_7Pb.js";/* empty css */const ng={class:"price"},eg={class:"flex"},tg={style:{margin:"0.625rem","padding-bottom":"40px"}},rg={style:{color:"#f5222d","font-weight":"bold","margin-left":"1rem"}},ig={class:"dialog-footer"},ug={__name:"price",emits:["changeAllPrice"],setup(W,{expose:A,emit:o}){const b=R(!1),V=R(null),j=R(0),x=(H=!0,y=0)=>{X.value.nowPrice="",X.value.percentage="",b.value=H,j.value=y,_u(()=>{setTimeout(()=>{var nn;(nn=V.value)==null||nn.focus()},150)})},X=R({nowPrice:"",percentage:""}),pn=H=>{X.value.percentage=(H/j.value*100).toFixed(2)},fn=H=>{X.value.nowPrice=(j.value*H/100).toFixed(2)},rn=o,U=()=>{if(X.value.percentage>100)return X.value.nowPrice="",X.value.percentage="",qe.error("改价金额不能大于当前订单金额");if(X.value.nowPrice<=0)return X.value.nowPrice="",X.value.percentage="",qe.error("金额不能小于0");rn("changeAllPrice",X.value.nowPrice)};A({show:x,dialogVisible:b});const Cn=()=>{b.value&&U()};return Dt(()=>{re.on("enter",Cn)}),Nt(()=>{re.off("enter",Cn)}),(H,y)=>{const nn=tn("el-input"),F=tn("el-button"),k=tn("el-dialog");return B(),ae(k,{modelValue:b.value,"onUpdate:modelValue":y[2]||(y[2]=an=>b.value=an),title:"订单改价",width:"650"},{footer:_n(()=>[v("div",ig,[N(F,{class:"ok-btn",type:"primary",onClick:U},{default:_n(()=>[sn(" 确定 (Enter) ")]),_:1})])]),default:_n(()=>[v("div",ng,[v("div",eg,[N(nn,{ref_key:"priceRef",ref:V,style:{flex:"3",margin:"0.625rem",height:"2.5rem"},modelValue:X.value.nowPrice,"onUpdate:modelValue":y[0]||(y[0]=an=>X.value.nowPrice=an),type:"number",placeholder:"请输入改价后的价格",onInput:pn},{suffix:_n(()=>[sn("元")]),_:1},8,["modelValue"]),N(nn,{style:{flex:"2",margin:"0.625rem",height:"2.5rem"},modelValue:X.value.percentage,"onUpdate:modelValue":y[1]||(y[1]=an=>X.value.percentage=an),type:"number",placeholder:"请输入比例",onInput:fn},{suffix:_n(()=>[sn("%")]),_:1},8,["modelValue"])]),v("div",tg,[sn(" 改价后金额: "),v("span",rg,"¥"+G(X.value.nowPrice||j.value||" - - "),1)])])]),_:1},8,["modelValue"])}}},sg=ht(ug,[["__scopeId","data-v-924edcc0"]]),og={class:"check-user-list"},lg={class:"header-input"},fg={class:"order-lists","infinite-scroll-distance":300,"infinite-scroll-delay":500,style:{overflow:"auto"}},ag=["onClick"],cg={style:{display:"flex","flex-direction":"column","justify-content":"space-around",flex:"1"}},hg={class:"top"},_g={class:"bold"},dg={class:"flex-between"},pg={class:"mr-2"},gg={class:"bottom flex",style:{"justify-content":"space-between"}},vg={class:"red"},mg={class:"red"},yg={class:"red"},wg={key:0,class:"load-end"},xg={key:1,class:"load-end"},Ag={__name:"userList",emits:["setUser"],setup(W,{expose:A,emit:o}){Dr();const b=R(!1),V=R({page_no:1,page_size:20,mobile:""}),j=o,x=R(!1),X=R(0),pn=R(!1),fn=R([]),rn=(H=!1)=>{if(H)V.value.page_no=1;else if(pn.value||x.value)return;x.value=!0,Jp(V.value).then(y=>{H?fn.value=y.data.lists:fn.value=[...fn.value,...y.data.lists],y.data.lists.length{pn.value=!0,x.value=!1})},U=(H,y)=>{j("setUser",H),b.value=!1};return A({open:(H=null)=>{H||(V.value.mobile=""),b.value=!0,rn(!0)}}),(H,y)=>{const nn=tn("el-button"),F=tn("el-input"),k=tn("el-avatar"),an=tn("el-tag"),cn=tn("el-dialog"),on=Ut("loading"),hn=Ut("infinite-scroll");return B(),ae(cn,{modelValue:b.value,"onUpdate:modelValue":y[4]||(y[4]=Z=>b.value=Z),title:"选择用户",width:"800"},{default:_n(()=>[v("div",og,[v("div",lg,[N(F,{modelValue:V.value.mobile,"onUpdate:modelValue":y[1]||(y[1]=Z=>V.value.mobile=Z),placeholder:"搜索手机号/ID",onKeydown:y[2]||(y[2]=Jo(Z=>rn(!0),["enter"])),onClear:y[3]||(y[3]=Z=>rn(!0)),clearable:""},{append:_n(()=>[N(nn,{type:"primary",style:{"background-color":"#1890ff",color:"#fff","border-radius":"0 0.315rem 0.315rem 0"},onClick:y[0]||(y[0]=Z=>rn(!0))},{default:_n(()=>[sn("搜索")]),_:1})]),_:1},8,["modelValue"])]),du((B(),Q("div",fg,[(B(!0),Q(Ft,null,Mt(fn.value,(Z,O)=>(B(),Q("div",{class:"item",key:O,onClick:vn=>U(Z,O)},[N(k,{class:"avatar",src:Z.avatar},null,8,["src"]),v("div",cg,[v("div",hg,[v("div",null,[v("span",_g,G(Z.nickname),1),v("span",null,G(" (ID:"+Z.id+")"),1)]),v("div",dg,[v("div",pg,"手机号: "+G(Z.mobile||Z.account),1),Z.user_ship==0?(B(),ae(an,{key:0,type:"primary"},{default:_n(()=>[sn(G(Z.user_ship_name),1)]),_:2},1024)):(B(),ae(an,{key:1,type:"success"},{default:_n(()=>[sn(G(Z.user_ship_name),1)]),_:2},1024))])]),v("div",gg,[v("div",null,[sn("采购款: "),v("span",vg,G(Z.purchase_funds),1)]),v("div",null,[sn("礼品券: "),v("span",mg,G(Z.integral),1)]),v("div",null,[sn("余额: "),v("span",yg,G(Z.now_money),1)])])])],8,ag))),128)),pn.value?(B(),Q("div",wg,"没有更多了")):te("",!0),x.value?(B(),Q("div",xg,"加载中...")):te("",!0)])),[[on,x.value],[hn,rn]])])]),_:1},8,["modelValue"])}}},Ig=ht(Ag,[["__scopeId","data-v-7ac34513"]]),Cg=W=>(pu("data-v-e0ef5c53"),W=W(),gu(),W),Lg={class:"my-order"},Sg={class:"user-nav"},Rg={class:"user-info"},bg={key:0,class:"info"},Eg={class:"flex-bewteen"},Tg={class:"flex-bewteen",style:{"align-items":"flex-start"}},Og={class:"user-money"},Pg={style:{"margin-right":"0.5rem"}},$g={style:{color:"#f70"}},Bg={style:{"margin-right":"0.5rem"}},Wg={style:{color:"#f70"}},Ug={style:{color:"#f70"}},Fg={key:1,class:"info",style:{"align-items":"center",display:"flex","justify-content":"space-between"}},Mg={class:"flex-bewteen",style:{width:"100%"}},Dg=Cg(()=>v("div",{style:{"font-size":"1.2rem"}},"游客",-1)),Ng={class:"header-nav"},Gg={class:"nav-item"},Kg={class:"order-list"},Hg={class:"order-item-info"},zg={class:"order-item-title"},kg={class:"title"},qg=["onClick"],Vg={class:"order-item-sku"},Zg={class:"order-item-price"},Yg={class:"order-footer"},Xg={class:"order-total"},Jg={class:"price",style:{"flex-direction":"column","align-items":"flex-start"}},Qg={class:"total-item",style:{"flex-shrink":"0"}},jg={style:{"font-size":"1.4rem"}},nv={key:0,class:"total-item",style:{"padding-right":"0","line-height":"0.8rem"}},ev={style:{"font-size":"0.8rem"}},tv={class:"update-price"},rv={class:"order-btn"},iv={__name:"order",emits:["goPay","editAttr","getStoreList"],setup(W,{expose:A,emit:o}){const b=R([]),V=R(0),j=R(0),x=R(0);Dr();const X=R(null),pn=()=>{let P=[];b.value.map(E=>{P.push(E.id)}),P.length!=0&&rn(P)},fn=P=>{b.value=b.value.filter(E=>E.id!=P),rn([P])},rn=P=>{Kp({id:P}).then(E=>{y()})},U=R({uid:""}),Cn=P=>{U.value=P,U.value.uid=P.id,y(),nn("getStoreList",{uid:P.id},!0)},H=R({}),y=()=>{V.value=0,j.value=0,x.value=0,Hp({uid:U.value.uid}).then(P=>{H.value=P.data.extend,b.value=P.data.lists||[]})};y();const nn=o,F=()=>{nn("goPay")},k=(P,E)=>{Xo({product_id:P.product_id,cart_num:P.cart_num}).then(Tn=>{y()}).catch(Tn=>{var Bn;let On=(Bn=Tn==null?void 0:Tn.msg)==null?void 0:Bn.match(/\b\d+(\.\d+)?\b/);On?P.cart_num=+On[0]:P.cart_num=1})},an=P=>{x.value=j.value-P,V.value=+P,_u(()=>{setTimeout(()=>{on(!1)},150)})};R(0);const cn=R(null),on=(P=!0)=>{cn.value.show(P,j.value)},hn=R(!1);A({getList:y,resetView:()=>{hn.value=!1,y()},list:b,discounts:x,allPrice:V,userInfo:U,is_storage:hn});const O=()=>{cn.value.dialogVisible?cn.value.dialogVisible=!1:on()},vn=()=>{b.value.length>0&&pn()};return Dt(()=>{re.on("insert",O),re.on("delete",vn)}),Nt(()=>{re.off("insert",O),re.off("delete",vn)}),(P,E)=>{const Tn=tn("el-avatar"),On=tn("ArrowRight"),Bn=tn("el-icon"),ce=tn("el-button"),Ve=tn("RefreshLeft"),Gr=tn("Delete"),ge=tn("el-empty"),he=tn("el-image"),Gt=tn("el-input-number"),Ze=tn("el-switch");return B(),Q("div",Lg,[v("div",Sg,[v("div",Rg,[N(Tn,{class:"avatar",src:U.value.avatar},null,8,["src"]),U.value.uid?(B(),Q("div",bg,[v("div",Eg,[v("div",null,"手机号: "+G(U.value.mobile||U.value.account),1),N(ce,{type:"primary",link:"",class:"change-user",onClick:E[0]||(E[0]=J=>X.value.open(U.value.uid))},{default:_n(()=>[sn("切换用户"),N(Bn,null,{default:_n(()=>[N(On)]),_:1})]),_:1})]),v("div",Tg,[v("div",Og,[v("div",Pg,[sn("采购款: "),v("span",$g,G(U.value.purchase_funds),1)]),v("div",Bg,[sn("礼品券: "),v("span",Wg,G(U.value.integral),1)]),v("div",null,[sn("余额: "),v("span",Ug,G(U.value.now_money),1)])]),N(ce,{style:{"margin-top":"0.2rem"},link:"",onClick:E[1]||(E[1]=J=>Cn({id:""}))},{default:_n(()=>[sn(" 重置"),N(Bn,null,{default:_n(()=>[N(Ve)]),_:1})]),_:1})])])):(B(),Q("div",Fg,[v("div",Mg,[Dg,N(ce,{type:"primary",link:"",class:"change-user",onClick:E[2]||(E[2]=J=>X.value.open())},{default:_n(()=>[sn("切换用户"),N(Bn,null,{default:_n(()=>[N(On)]),_:1})]),_:1})])]))]),N(Ig,{ref_key:"userListRef",ref:X,onSetUser:Cn},null,512)]),v("div",Ng,[v("div",Gg,[sn(" 已选购 "),v("span",null,G(b.value.length),1),sn(" 款 ")]),v("div",{class:"nav-item-clear",onClick:pn},[N(Bn,null,{default:_n(()=>[N(Gr)]),_:1}),sn("清空 (Delete) ")])]),v("div",Kg,[b.value.length==0?(B(),ae(ge,{key:0,description:"请点击右侧添加商品"})):(B(!0),Q(Ft,{key:1},Mt(b.value,(J,Kr)=>(B(),Q("div",{class:"order-item",key:Kr},[N(he,{loading:"lazy",class:"order-item-img",src:J.image},null,8,["src"]),v("div",Hg,[v("div",zg,[v("div",kg,G(J.store_name),1),v("div",{class:"delete",onClick:Re=>fn(J.id)},"删除",8,qg)]),v("div",Vg,[v("span",null,G(J.unit_name),1)]),v("div",Zg,[v("div",null,[sn(" ¥"),v("span",null,G(J.price),1)]),v("div",null,[J.is_bulk==0?(B(),ae(Gt,{key:0,modelValue:J.cart_num,"onUpdate:modelValue":Re=>J.cart_num=Re,min:+J.batch>0?+J.batch:1,step:1,"step-strictly":"",onChange:Re=>k(J)},null,8,["modelValue","onUpdate:modelValue","min","onChange"])):(B(),ae(Gt,{key:1,modelValue:J.cart_num,"onUpdate:modelValue":Re=>J.cart_num=Re,min:+J.batch>0?+J.batch:.1,step:.1,precision:2,"step-strictly":"",onChange:Re=>k(J)},null,8,["modelValue","onUpdate:modelValue","min","onChange"]))])])])]))),128))]),v("div",Yg,[v("div",Xg,[v("div",Jg,[v("div",Qg,[sn(" 合计: "),v("span",null,[sn("¥"),v("span",jg,G(H.value.pay_price||"0.00"),1)])]),H.value.msg?(B(),Q("div",nv,[v("span",ev,G(H.value.msg),1)])):te("",!0)]),v("div",tv,[N(Ze,{modelValue:hn.value,"onUpdate:modelValue":E[3]||(E[3]=J=>hn.value=J),size:"large","inline-prompt":"","active-text":"存货","inactive-text":"不存"},null,8,["modelValue"])])]),v("div",rv,[N(ce,{class:"btn",type:"primary",onClick:F,disabled:b.value.length==0},{default:_n(()=>[sn(G("立即结账 (F9)"))]),_:1},8,["disabled"])])]),N(sg,{ref_key:"priceRef",ref:cn,onChangeAllPrice:an},null,512)])}}},uv=ht(iv,[["__scopeId","data-v-e0ef5c53"]]);var Fr={exports:{}};/** * @license * Lodash * Copyright OpenJS Foundation and other contributors diff --git a/build/assets/index-C7smcUTx.js b/build/assets/index-HN4ryKvA.js similarity index 96% rename from build/assets/index-C7smcUTx.js rename to build/assets/index-HN4ryKvA.js index 3bcc432..cd9a6f6 100644 --- a/build/assets/index-C7smcUTx.js +++ b/build/assets/index-HN4ryKvA.js @@ -1 +1 @@ -import{_ as I,u as U,r as u,o as R,b as n,c as S,k as b,e as v,f as e,w as t,i as m,g as L,q as B,s as C,I as E,E as w}from"./index-B9unL6O8.js";import{l as K}from"./user-DptWFEfy.js";const N=l=>(B("data-v-f9ff2ce9"),l=l(),C(),l),M={class:"body"},T={class:"login"},q=N(()=>v("div",{class:"title"},"里海收银系统 - 登录",-1)),$={__name:"index",setup(l){const d=U(),y=E(),k=u(null),p=u(null),s=u({account:"",password:"",terminal:1}),_=()=>{if(!s.value.account)return w({message:"请填写账号",type:"error"});if(!s.value.password)return w({message:"请填写密码",type:"error"});K(s.value).then(a=>{var o;(o=a.data)!=null&&o.token&&(d.setToken(a.data.token),d.setUserInfo(a.data),y.push("/"))}).catch(a=>{})};return R(()=>{}),(a,o)=>{const h=n("User"),f=n("el-icon"),i=n("el-input"),c=n("el-form-item"),x=n("Lock"),V=n("el-button"),g=n("el-form");return S(),b("div",M,[v("div",T,[q,e(g,null,{default:t(()=>[e(c,null,{default:t(()=>[e(i,{ref_key:"accRef",ref:k,modelValue:s.value.account,"onUpdate:modelValue":o[0]||(o[0]=r=>s.value.account=r),placeholder:"请输入账号",onKeydown:o[1]||(o[1]=m(r=>p.value.focus(),["enter"]))},{prefix:t(()=>[e(f,null,{default:t(()=>[e(h)]),_:1})]),_:1},8,["modelValue"])]),_:1}),e(c,null,{default:t(()=>[e(i,{ref_key:"pwdRef",ref:p,modelValue:s.value.password,"onUpdate:modelValue":o[2]||(o[2]=r=>s.value.password=r),type:"password",placeholder:"请输入密码","show-password":"",onKeydown:m(_,["enter"])},{prefix:t(()=>[e(f,null,{default:t(()=>[e(x)]),_:1})]),_:1},8,["modelValue"])]),_:1}),e(c,null,{default:t(()=>[e(V,{style:{width:"100%"},type:"primary",onClick:_},{default:t(()=>[L("登录")]),_:1})]),_:1})]),_:1})])])}}},A=I($,[["__scopeId","data-v-f9ff2ce9"]]);export{A as default}; +import{_ as I,u as U,r as u,o as R,b as n,c as S,k as b,e as v,f as e,w as t,i as m,g as L,q as B,s as C,I as E,E as w}from"./index-CEprPOh1.js";import{l as K}from"./user-DiHB_Leh.js";const N=l=>(B("data-v-f9ff2ce9"),l=l(),C(),l),M={class:"body"},T={class:"login"},q=N(()=>v("div",{class:"title"},"里海收银系统 - 登录",-1)),$={__name:"index",setup(l){const d=U(),y=E(),k=u(null),p=u(null),s=u({account:"",password:"",terminal:1}),_=()=>{if(!s.value.account)return w({message:"请填写账号",type:"error"});if(!s.value.password)return w({message:"请填写密码",type:"error"});K(s.value).then(a=>{var o;(o=a.data)!=null&&o.token&&(d.setToken(a.data.token),d.setUserInfo(a.data),y.push("/"))}).catch(a=>{})};return R(()=>{}),(a,o)=>{const h=n("User"),f=n("el-icon"),i=n("el-input"),c=n("el-form-item"),x=n("Lock"),V=n("el-button"),g=n("el-form");return S(),b("div",M,[v("div",T,[q,e(g,null,{default:t(()=>[e(c,null,{default:t(()=>[e(i,{ref_key:"accRef",ref:k,modelValue:s.value.account,"onUpdate:modelValue":o[0]||(o[0]=r=>s.value.account=r),placeholder:"请输入账号",onKeydown:o[1]||(o[1]=m(r=>p.value.focus(),["enter"]))},{prefix:t(()=>[e(f,null,{default:t(()=>[e(h)]),_:1})]),_:1},8,["modelValue"])]),_:1}),e(c,null,{default:t(()=>[e(i,{ref_key:"pwdRef",ref:p,modelValue:s.value.password,"onUpdate:modelValue":o[2]||(o[2]=r=>s.value.password=r),type:"password",placeholder:"请输入密码","show-password":"",onKeydown:m(_,["enter"])},{prefix:t(()=>[e(f,null,{default:t(()=>[e(x)]),_:1})]),_:1},8,["modelValue"])]),_:1}),e(c,null,{default:t(()=>[e(V,{style:{width:"100%"},type:"primary",onClick:_},{default:t(()=>[L("登录")]),_:1})]),_:1})]),_:1})])])}}},A=I($,[["__scopeId","data-v-f9ff2ce9"]]);export{A as default}; diff --git a/build/assets/index-BFpyyBC_.js b/build/assets/index-U--D72EK.js similarity index 96% rename from build/assets/index-BFpyyBC_.js rename to build/assets/index-U--D72EK.js index fad10ed..e627c73 100644 --- a/build/assets/index-BFpyyBC_.js +++ b/build/assets/index-U--D72EK.js @@ -1 +1 @@ -import{r as m,b as n,h,c as r,k as V,e as w,f as l,i as K,w as t,j as P,g as s,d as v,p as b}from"./index-B9unL6O8.js";import{c as U}from"./shop-CbMLEgdU.js";import"./axiosAPI-BnxnV-Ca.js";const j={class:"my-card put-storage"},A={class:"storage-header"},E={class:"flex"},I={class:"order-lists","infinite-scroll-distance":300,"infinite-scroll-delay":500,"infinite-scroll-immediate":!1,style:{overflow:"auto"}},q={__name:"index",setup(O){const d=m([]),e=m({page_no:1,page_size:20,loadend:!1,store_name:"",status:null,stock:null}),f=m(!1),g=()=>{e.value.loadend||(f.value=!0,U({page_no:e.value.page_no,page_size:e.value.page_size,store_name:e.value.store_name,stock:e.value.stock,status:e.value.status}).then(o=>{d.value=[...d.value,...o.data.lists],o.data.lists.length{e.value.page_no=1,e.value.loadend=!1,d.value=[],g()},k=m(0),x=o=>{o==0?(e.value.status=null,e.value.stock=null):o==1?(e.value.status=1,e.value.stock=null):o==2?(e.value.status=0,e.value.stock=null):o==3?(e.value.status=null,e.value.stock=10):o==4&&(e.value.status=null,e.value.stock=0),_()};return(o,i)=>{const C=n("el-input"),y=n("el-button"),c=n("el-radio-button"),z=n("el-radio-group"),u=n("el-table-column"),B=n("el-image"),p=n("el-tag"),L=n("el-table"),N=h("loading"),D=h("infinite-scroll");return r(),V("div",j,[w("div",A,[w("div",E,[l(C,{placeholder:"请输入商品名称",style:{width:"20rem"},modelValue:e.value.store_name,"onUpdate:modelValue":i[0]||(i[0]=a=>e.value.store_name=a),onKeydown:K(_,["enter"])},null,8,["modelValue"]),l(y,{style:{"margin-left":"1rem"},type:"primary",onClick:_},{default:t(()=>[s("搜索")]),_:1}),l(y,{style:{"margin-left":"1rem"},onClick:i[1]||(i[1]=a=>{e.value.store_name="",_()})},{default:t(()=>[s("重置")]),_:1})]),l(z,{style:{"margin-bottom":"20px"},modelValue:k.value,"onUpdate:modelValue":i[2]||(i[2]=a=>k.value=a),onChange:x},{default:t(()=>[l(c,{label:0,value:0},{default:t(()=>[s("全部")]),_:1}),l(c,{label:1,value:1},{default:t(()=>[s("上架")]),_:1}),l(c,{label:2,value:2},{default:t(()=>[s("下架")]),_:1}),l(c,{label:3,value:3},{default:t(()=>[s("库存预警")]),_:1}),l(c,{label:4,value:4},{default:t(()=>[s("已售罄")]),_:1})]),_:1},8,["modelValue"])]),P((r(),V("div",I,[l(L,{data:d.value},{default:t(()=>[l(u,{label:"ID",prop:"id","min-width":"55"}),l(u,{label:"商品图",prop:"image",width:"100"},{default:t(({row:a})=>[l(B,{class:"image",src:a.image},null,8,["src"])]),_:1}),l(u,{label:"商品名",prop:"store_name","min-width":"200"}),l(u,{label:"分类",prop:"cate_name"}),l(u,{label:"销量",prop:"sales"}),l(u,{label:"库存",prop:"stock"}),l(u,{label:"状态",prop:"status"},{default:t(({row:a})=>[a.status==1?(r(),v(p,{key:0,class:"el-tag",type:"success"},{default:t(()=>[s("上架")]),_:1})):a.status==0?(r(),v(p,{key:1,class:"el-tag",type:"info"},{default:t(()=>[s("下架")]),_:1})):b("",!0),a.stock<=10&&a.stock>0?(r(),v(p,{key:2,class:"el-tag",type:"warning"},{default:t(()=>[s("库存预警")]),_:1})):b("",!0),a.stock==0?(r(),v(p,{key:3,class:"el-tag",type:"danger"},{default:t(()=>[s("已售罄")]),_:1})):b("",!0)]),_:1})]),_:1},8,["data"])])),[[N,f.value],[D,g]])])}}};export{q as default}; +import{r as m,b as n,h,c as r,k as V,e as w,f as l,i as K,w as t,j as P,g as s,d as v,p as b}from"./index-CEprPOh1.js";import{c as U}from"./shop-DX9HGddz.js";import"./axiosAPI-JxG9ekqU.js";const j={class:"my-card put-storage"},A={class:"storage-header"},E={class:"flex"},I={class:"order-lists","infinite-scroll-distance":300,"infinite-scroll-delay":500,"infinite-scroll-immediate":!1,style:{overflow:"auto"}},q={__name:"index",setup(O){const d=m([]),e=m({page_no:1,page_size:20,loadend:!1,store_name:"",status:null,stock:null}),f=m(!1),g=()=>{e.value.loadend||(f.value=!0,U({page_no:e.value.page_no,page_size:e.value.page_size,store_name:e.value.store_name,stock:e.value.stock,status:e.value.status}).then(o=>{d.value=[...d.value,...o.data.lists],o.data.lists.length{e.value.page_no=1,e.value.loadend=!1,d.value=[],g()},k=m(0),x=o=>{o==0?(e.value.status=null,e.value.stock=null):o==1?(e.value.status=1,e.value.stock=null):o==2?(e.value.status=0,e.value.stock=null):o==3?(e.value.status=null,e.value.stock=10):o==4&&(e.value.status=null,e.value.stock=0),_()};return(o,i)=>{const C=n("el-input"),y=n("el-button"),c=n("el-radio-button"),z=n("el-radio-group"),u=n("el-table-column"),B=n("el-image"),p=n("el-tag"),L=n("el-table"),N=h("loading"),D=h("infinite-scroll");return r(),V("div",j,[w("div",A,[w("div",E,[l(C,{placeholder:"请输入商品名称",style:{width:"20rem"},modelValue:e.value.store_name,"onUpdate:modelValue":i[0]||(i[0]=a=>e.value.store_name=a),onKeydown:K(_,["enter"])},null,8,["modelValue"]),l(y,{style:{"margin-left":"1rem"},type:"primary",onClick:_},{default:t(()=>[s("搜索")]),_:1}),l(y,{style:{"margin-left":"1rem"},onClick:i[1]||(i[1]=a=>{e.value.store_name="",_()})},{default:t(()=>[s("重置")]),_:1})]),l(z,{style:{"margin-bottom":"20px"},modelValue:k.value,"onUpdate:modelValue":i[2]||(i[2]=a=>k.value=a),onChange:x},{default:t(()=>[l(c,{label:0,value:0},{default:t(()=>[s("全部")]),_:1}),l(c,{label:1,value:1},{default:t(()=>[s("上架")]),_:1}),l(c,{label:2,value:2},{default:t(()=>[s("下架")]),_:1}),l(c,{label:3,value:3},{default:t(()=>[s("库存预警")]),_:1}),l(c,{label:4,value:4},{default:t(()=>[s("已售罄")]),_:1})]),_:1},8,["modelValue"])]),P((r(),V("div",I,[l(L,{data:d.value},{default:t(()=>[l(u,{label:"ID",prop:"id","min-width":"55"}),l(u,{label:"商品图",prop:"image",width:"100"},{default:t(({row:a})=>[l(B,{class:"image",src:a.image},null,8,["src"])]),_:1}),l(u,{label:"商品名",prop:"store_name","min-width":"200"}),l(u,{label:"分类",prop:"cate_name"}),l(u,{label:"销量",prop:"sales"}),l(u,{label:"库存",prop:"stock"}),l(u,{label:"状态",prop:"status"},{default:t(({row:a})=>[a.status==1?(r(),v(p,{key:0,class:"el-tag",type:"success"},{default:t(()=>[s("上架")]),_:1})):a.status==0?(r(),v(p,{key:1,class:"el-tag",type:"info"},{default:t(()=>[s("下架")]),_:1})):b("",!0),a.stock<=10&&a.stock>0?(r(),v(p,{key:2,class:"el-tag",type:"warning"},{default:t(()=>[s("库存预警")]),_:1})):b("",!0),a.stock==0?(r(),v(p,{key:3,class:"el-tag",type:"danger"},{default:t(()=>[s("已售罄")]),_:1})):b("",!0)]),_:1})]),_:1},8,["data"])])),[[N,f.value],[D,g]])])}}};export{q as default}; diff --git a/build/assets/index-VyUxKQ4b.js b/build/assets/index-VyUxKQ4b.js deleted file mode 100644 index 51756cf..0000000 --- a/build/assets/index-VyUxKQ4b.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as G,u as H,r as n,o as J,m as D,a as W,b as r,h as M,c as s,k as o,e,f as d,w as p,g as $,d as I,p as f,i as oe,j as E,F as q,l as K,z as j,t as l,q as X,s as Z,I as ae,E as ie}from"./index-B9unL6O8.js";import{d as le,e as ne,f as de}from"./store-DNW8I_iw.js";import{h as Q}from"./moment-Cl4UOzQZ.js";import{p as _e}from"./pay-BFyuVP94.js";import{p as ce}from"./padding-DLHwO6AB.js";import"./authCode-D610lJnm.js";/* empty css */const re=m=>(X("data-v-bf6504fc"),m=m(),Z(),m),ue={class:"my-order"},pe={class:"header-nav"},ve=re(()=>e("div",{class:"nav-item"},l("收银订单"),-1)),fe={class:"nav-item-btn"},me={class:"header-input"},he={class:"order-lists","infinite-scroll-distance":300,"infinite-scroll-delay":500,style:{overflow:"auto"}},ye=["onClick"],ge={class:"top"},ke={class:"create-time"},$e={class:"shop"},be={key:0,class:"left"},we={key:0,class:"shop-name"},Ce={class:"right"},De={class:"money"},Se={class:"count"},Ve={class:"bottom"},Ye={class:"pay"},xe={key:0},ze={key:1},Pe={key:2},Ie={key:3},Me={key:4},Re={key:5},Le={key:1,style:{color:"#ff4a00"}},Be={key:0,class:"load-end"},Ne={key:1,class:"load-end"},Oe={__name:"order",props:{isSystem:{type:Boolean,default:!1},source:{type:Number,default:1}},setup(m,{expose:w}){H(),n([]);const t=n(1),y=v=>{_.value.page_no=1,b.value=!1,k.value=!1,h.value=[],c(!0)};n(null);const g=n(""),R=()=>{_.value.start_time=Q(g.value[0]).format("YYYY-MM-DD 00:00:00"),_.value.end_time=Q(g.value[1]).format("YYYY-MM-DD 23:59:59"),c(!0)},L=v=>v.getTime()>Date.now(),_=n({page_no:1,page_size:20,order_id:"",start_time:"",end_time:"",is_sashier:1}),k=n(!1),B=n(0),C=n(0),b=n(!1),h=n([]),c=(v=!1)=>{if(v)_.value.page_no=1;else if(b.value||k.value)return;k.value=!0,t.value==1&&(_.value.paid=null),t.value==2&&(_.value.paid=0),le(_.value).then(i=>{v?h.value=i.data.lists:h.value=[...h.value,...i.data.lists],_.value.page_no==1&&h.value.length>0&&D.emit("set-sale-order-detail",h.value[0]),i.data.lists.length<_.value.page_size?b.value=!0:_.value.page_no++,C.value=0,console.log(_.value.page_no),B.value=i.data.count,k.value=!1}).catch(i=>{b.value=!0,k.value=!1})},F=(v,i)=>{C.value=i,D.emit("set-sale-order-detail",v)};return w({getOrderList:c}),J(()=>{D.on("update-sale-order-detail",v=>{console.log("==="),h.value[C.value].paid=1})}),W(()=>{D.off("update-sale-order-detail")}),(v,i)=>{const S=r("el-radio-button"),V=r("el-radio-group"),N=r("el-date-picker"),O=r("CircleClose"),T=r("el-icon"),Y=r("el-button"),x=r("el-input"),z=r("el-image"),P=r("spna"),ee=M("loading"),te=M("infinite-scroll");return s(),o("div",ue,[e("div",pe,[ve,e("div",fe,[d(V,{modelValue:t.value,"onUpdate:modelValue":i[0]||(i[0]=a=>t.value=a),onChange:y,size:"small"},{default:p(()=>[d(S,{value:1},{default:p(()=>[$("全部")]),_:1}),d(S,{value:2},{default:p(()=>[$("未支付")]),_:1})]),_:1},8,["modelValue"]),d(N,{modelValue:g.value,"onUpdate:modelValue":i[1]||(i[1]=a=>g.value=a),type:"daterange","start-placeholder":"开始时间","end-placeholder":"结束时间",size:"small","value-format":"YYYY/MM/DD","disabled-date":L,onChange:R,clearable:!1,style:{width:"14rem","margin-left":"1rem"}},null,8,["modelValue"])])]),e("div",me,[d(x,{modelValue:_.value.order_id,"onUpdate:modelValue":i[4]||(i[4]=a=>_.value.order_id=a),placeholder:"请输入订单编号",onKeydown:i[5]||(i[5]=oe(a=>c(!0),["enter"])),onClear:i[6]||(i[6]=a=>c(!0))},{suffix:p(()=>[_.value.order_id!=""?(s(),I(T,{key:0,size:"18",onClick:i[2]||(i[2]=a=>{_.value.order_id="",c(!0)}),style:{cursor:"pointer","margin-right":"0.5rem"}},{default:p(()=>[d(O)]),_:1})):f("",!0)]),append:p(()=>[d(Y,{type:"primary",style:{"background-color":"#1890ff",color:"#fff","border-radius":"0 0.315rem 0.315rem 0"},onClick:i[3]||(i[3]=a=>c(!0))},{default:p(()=>[$("搜索")]),_:1})]),_:1},8,["modelValue"])]),E((s(),o("div",he,[(s(!0),o(q,null,K(h.value,(a,U)=>(s(),o("div",{class:j(["item",{"item-active":C.value==U}]),key:U,onClick:A=>F(a,U)},[e("div",ge,[e("div",{class:j(["sn","cahier"])},"单号: "+l(a.order_id),1),e("div",ke,l(a.pay_time),1)]),e("div",$e,[a.product_info?(s(),o("div",be,[(s(!0),o(q,null,K(a.product_info.slice(0,5),(A,se)=>(s(),I(z,{key:se,src:A.image,class:"shop-img"},null,8,["src"]))),128)),a.product_info.length==1?(s(),o("div",we,l(a.product_info[0].store_name),1)):f("",!0)])):f("",!0),e("div",Ce,[e("div",De,"¥"+l(a.pay_price),1),e("div",Se,"共"+l(a.total_num)+"款商品",1)])]),e("div",Ve,[e("div",Ye,[a.paid?(s(),o("div",xe,[$(l(a.paid_name)+" ",1),a.pay_type_name?(s(),I(P,{key:0},{default:p(()=>[$("("+l(a.pay_type_name)+")",1)]),_:2},1024)):a.pay_type==9?(s(),o("span",ze,"(微信收款)")):a.pay_type==17?(s(),o("span",Pe,"(现金支付)")):a.pay_type==13?(s(),o("span",Ie,"(支付宝收款)")):a.pay_type==3?(s(),o("span",Me,"(余额支付)")):a.pay_type==1?(s(),o("span",Re,"(微信支付)")):f("",!0)])):(s(),o("div",Le,l(a.paid_name),1))])])],10,ye))),128)),b.value?(s(),o("div",Be,"没有更多了")):f("",!0),k.value?(s(),o("div",Ne,"加载中...")):f("",!0)])),[[ee,k.value],[te,c]])])}}},Te=G(Oe,[["__scopeId","data-v-bf6504fc"]]),u=m=>(X("data-v-f6cf175a"),m=m(),Z(),m),Ue={class:"my-order"},Ee={key:0,class:"detail"},Fe={class:"table","infinite-scroll-distance":300,"infinite-scroll-delay":300,style:{overflow:"auto"},"infinite-scroll-immediate":!1},Ae=u(()=>e("div",{class:"table-title"},"订单信息",-1)),qe={class:"table-info"},Ke={class:"info-item"},je=u(()=>e("div",{class:"info-item-title"},"订单编号:",-1)),Qe={class:"info-item-info"},Ge={class:"info-item"},He=u(()=>e("div",{class:"info-item-title"},"商品款数:",-1)),Je={class:"info-item-info"},We={class:"info-item"},Xe=u(()=>e("div",{class:"info-item-title"},"商品总价:",-1)),Ze={class:"info-item-info"},et={class:"info-item"},tt=u(()=>e("div",{class:"info-item-title"},"创建时间:",-1)),st={class:"info-item-info"},ot={class:"info-item"},at=u(()=>e("div",{class:"info-item-title"},"优惠抵扣:",-1)),it={class:"info-item-info"},lt={class:"info-item"},nt=u(()=>e("div",{class:"info-item-title"},"实际支付:",-1)),dt={class:"info-item-info"},_t={class:"info-item"},ct=u(()=>e("div",{class:"info-item-title"},"支付时间:",-1)),rt={class:"info-item-info"},ut={class:"info-item"},pt=u(()=>e("div",{class:"info-item-title"},"支付方式:",-1)),vt={class:"info-item-info"},ft={key:0},mt={key:1},ht={key:2},yt={key:3},gt={key:4},kt={key:5},$t={key:0,class:"table-title"},bt={key:1,class:"table-info"},wt={class:"info-item"},Ct=u(()=>e("div",{class:"info-item-title"},"用户ID:",-1)),Dt={class:"info-item-info"},St={class:"info-item"},Vt=u(()=>e("div",{class:"info-item-title"},"用户昵称:",-1)),Yt={class:"info-item-info"},xt={class:"info-item"},zt=u(()=>e("div",{class:"info-item-title"},"用户电话:",-1)),Pt={class:"info-item-info"},It={style:{"font-size":"0.9rem"}},Mt={style:{color:"#ff4a00"}},Rt={style:{display:"flex","align-items":"center"}},Lt={style:{"margin-left":"0.5rem"}},Bt=u(()=>e("div",{style:{height:"8rem"}},null,-1)),Nt={key:0,class:"footer"},Ot={key:1},Tt={__name:"detail",emits:["rePaySuccess"],setup(m,{emit:w}){H(),ae();const t=n({id:""});n([]);const y=n(null),g=n(!1);n(0),n(0),n(["商品信息","订单详情"]),n(""),n(!1);const R=()=>{y.value.setForm({isRePay:!0,data:t.value}),y.value.drawer=!0},L=()=>{t.value.order_id?ne({order_no:t.value.order_id}).then(c=>{console.log(c)}):ie({message:"订单号不能为空",type:"error"})},_=n({page_no:1,page_size:15,loadend:!1,loading:!1}),k=n([]),B=()=>console.log("触底"),C=()=>{g.value=!0,de({id:t.value.id}).then(c=>{t.value=c.data,setTimeout(()=>{g.value=!1},200)})},b=w,h=(c=null)=>{setTimeout(()=>{b("rePaySuccess")})};return J(()=>{D.on("set-sale-order-detail",c=>{console.log("===",c),t.value=c,_.value.page_no=1,_.value.loadend=!1,_.value.loading=!1,k.value=[],C()})}),W(()=>{D.off("set-sale-order-detail")}),(c,F)=>{var Y;const v=r("el-image"),i=r("el-table-column"),S=r("el-table"),V=r("el-button"),N=r("el-empty"),O=M("infinite-scroll"),T=M("loading");return s(),o("div",Ue,[t.value.id?E((s(),o("div",Ee,[E((s(),o("div",Fe,[Ae,e("div",qe,[e("div",Ke,[je,e("div",Qe,l(t.value.order_id),1)]),e("div",Ge,[He,e("div",Je,l(t.value.total_num||0),1)]),e("div",We,[Xe,e("div",Ze,"¥"+l(t.value.total_price),1)]),e("div",et,[tt,e("div",st,l(t.value.pay_time),1)]),e("div",ot,[at,e("div",it,"¥"+l(t.value.deduction_price),1)]),e("div",lt,[nt,e("div",dt,"¥"+l(t.value.pay_price),1)]),e("div",_t,[ct,e("div",rt,l(t.value.pay_time),1)]),e("div",ut,[pt,e("div",vt,[t.value.pay_type_name?(s(),o("span",ft,l(t.value.pay_type_name),1)):t.value.pay_type==9?(s(),o("span",mt,"微信收款")):t.value.pay_type==17?(s(),o("span",ht,"现金支付")):t.value.pay_type==13?(s(),o("span",yt,"支付宝收款")):t.value.pay_type==3?(s(),o("span",gt,"余额支付")):t.value.pay_type==1?(s(),o("span",kt,"微信支付")):f("",!0)])])]),t.value.uid?(s(),o("div",$t,"用户信息")):f("",!0),t.value.uid?(s(),o("div",bt,[e("div",wt,[Ct,e("div",Dt,l(t.value.uid),1)]),e("div",St,[Vt,e("div",Yt,l(t.value.nickname),1)]),e("div",xt,[zt,e("div",Pt,l(t.value.mobile),1)])])):f("",!0),e("div",It,[$(" 共计 "),e("span",Mt,l(((Y=t.value.product)==null?void 0:Y.length)||" "),1),$(" 款商品 ")]),d(S,{data:t.value.product},{default:p(()=>[d(i,{label:"商品信息"},{default:p(({row:x})=>{var z,P;return[e("div",Rt,[d(v,{style:{height:"3rem",width:"3rem","flex-shrink":"0"},src:(z=x.cart_info)==null?void 0:z.image},null,8,["src"]),e("span",Lt,l((P=x.cart_info)==null?void 0:P.name),1)])]}),_:1}),d(i,{prop:"cart_info.store_info",label:"商品规格",width:"150"}),d(i,{prop:"cart_info.price",label:"单价",width:"150"}),d(i,{prop:"cart_info.cart_num",label:"数量",width:"150"}),d(i,{prop:"cart_info.pay_price",label:"总价",width:"150"})]),_:1},8,["data"]),Bt])),[[O,B]]),t.value.paid?f("",!0):(s(),o("div",Nt,[d(V,{type:"primary",size:"large",onClick:R},{default:p(()=>[$("重新支付")]),_:1}),t.value.pay_type==9?(s(),I(V,{key:0,type:"primary",size:"large",onClick:L},{default:p(()=>[$("查询支付")]),_:1})):f("",!0)]))])),[[T,g.value]]):(s(),o("div",Ot,[d(N)])),d(_e,{ref_key:"payRef",ref:y,onPaySuccess:h},null,512)])}}},Ut=G(Tt,[["__scopeId","data-v-f6cf175a"]]),Et={class:"my-card"},Ht={__name:"index",setup(m){const w=n(null),t=()=>{var y;(y=w.value)==null||y.getOrderList(!0)};return(y,g)=>(s(),o("div",Et,[d(Te,{style:{"flex-shrink":"0"},ref_key:"orderRef",ref:w},null,512),d(ce),d(Ut,{ref:"detailRef",onRePaySuccess:t},null,512)]))}};export{Ht as default}; diff --git a/build/assets/index-BxzBeeJt.js b/build/assets/index-vhkeCFJv.js similarity index 84% rename from build/assets/index-BxzBeeJt.js rename to build/assets/index-vhkeCFJv.js index 5238cd2..2fe9be6 100644 --- a/build/assets/index-BxzBeeJt.js +++ b/build/assets/index-vhkeCFJv.js @@ -1 +1 @@ -import{b as t,c,k as a,e,f as o,w as d,g as l}from"./index-B9unL6O8.js";const r={style:{width:"100vw",height:"100vh"}},_={style:{display:"flex","justify-content":"center","padding-top":"20vh"}},m={style:{display:"flex","flex-direction":"column","justify-content":"center","padding-left":"3rem"}},p=e("div",{style:{"font-size":"5rem","font-weight":"bold"}},"404",-1),h=e("div",{style:{"padding-bottom":"1rem"}},"您的页面没有找到",-1),v={__name:"index",setup(f){const s=()=>{window.location="/"};return(y,g)=>{const n=t("el-image"),i=t("el-button");return c(),a("div",r,[e("div",_,[o(n,{loading:"lazy",style:{width:"30rem",height:"20rem"},src:"/src/assets/icon-404-color.svg"}),e("div",m,[p,h,o(i,{type:"primary",onClick:s},{default:d(()=>[l("返回首页")]),_:1})])])])}}};export{v as default}; +import{b as t,c,k as a,e,f as o,w as d,g as l}from"./index-CEprPOh1.js";const r={style:{width:"100vw",height:"100vh"}},_={style:{display:"flex","justify-content":"center","padding-top":"20vh"}},m={style:{display:"flex","flex-direction":"column","justify-content":"center","padding-left":"3rem"}},p=e("div",{style:{"font-size":"5rem","font-weight":"bold"}},"404",-1),h=e("div",{style:{"padding-bottom":"1rem"}},"您的页面没有找到",-1),v={__name:"index",setup(f){const s=()=>{window.location="/"};return(y,g)=>{const n=t("el-image"),i=t("el-button");return c(),a("div",r,[e("div",_,[o(n,{loading:"lazy",style:{width:"30rem",height:"20rem"},src:"/src/assets/icon-404-color.svg"}),e("div",m,[p,h,o(i,{type:"primary",onClick:s},{default:d(()=>[l("返回首页")]),_:1})])])])}}};export{v as default}; diff --git a/build/assets/index-xBkMFEcu.js b/build/assets/index-xBkMFEcu.js new file mode 100644 index 0000000..241d0bf --- /dev/null +++ b/build/assets/index-xBkMFEcu.js @@ -0,0 +1 @@ +import{_ as J,u as W,r as n,o as X,m as V,a as Z,b as r,h as R,c as s,k as o,e,f as d,w as u,g,d as M,p,i as ie,j as F,F as K,l as j,z as Q,t as l,q as ee,s as te,I as ae,E as G}from"./index-CEprPOh1.js";import{d as le,e as ne,f as de,g as _e}from"./store-BoFe3Agt.js";import{h as H}from"./moment-Cl4UOzQZ.js";import{p as ce}from"./pay-C9Lsc2yr.js";import{p as re}from"./padding-Bq_IbaOz.js";import"./authCode-k34-_7Pb.js";/* empty css */const ue=f=>(ee("data-v-bf6504fc"),f=f(),te(),f),ve={class:"my-order"},pe={class:"header-nav"},fe=ue(()=>e("div",{class:"nav-item"},l("收银订单"),-1)),me={class:"nav-item-btn"},he={class:"header-input"},ye={class:"order-lists","infinite-scroll-distance":300,"infinite-scroll-delay":500,style:{overflow:"auto"}},ge=["onClick"],ke={class:"top"},be={class:"create-time"},$e={class:"shop"},we={key:0,class:"left"},Ce={key:0,class:"shop-name"},De={class:"right"},Se={class:"money"},Ve={class:"count"},ze={class:"bottom"},Ye={class:"pay"},xe={key:0},Pe={key:1},Ie={key:2},Me={key:3},Re={key:4},Le={key:5},Ne={key:1,style:{color:"#ff4a00"}},Te={key:0,class:"load-end"},Be={key:1,class:"load-end"},Oe={__name:"order",props:{isSystem:{type:Boolean,default:!1},source:{type:Number,default:1}},setup(f,{expose:D}){W(),n([]);const t=n(1),k=y=>{_.value.page_no=1,w.value=!1,$.value=!1,m.value=[],h(!0)};n(null);const b=n(""),L=()=>{_.value.start_time=H(b.value[0]).format("YYYY-MM-DD 00:00:00"),_.value.end_time=H(b.value[1]).format("YYYY-MM-DD 23:59:59"),h(!0)},N=y=>y.getTime()>Date.now(),_=n({page_no:1,page_size:20,order_id:"",start_time:"",end_time:"",is_sashier:1}),$=n(!1),T=n(0),S=n(0),w=n(!1),m=n([]),h=(y=!1)=>{if(y)_.value.page_no=1;else if(w.value||$.value)return;$.value=!0,t.value==1&&(_.value.paid=null),t.value==2&&(_.value.paid=0),le(_.value).then(a=>{y?m.value=a.data.lists:m.value=[...m.value,...a.data.lists],_.value.page_no==1&&m.value.length>0&&V.emit("set-sale-order-detail",m.value[0]),a.data.lists.length<_.value.page_size?w.value=!0:_.value.page_no++,S.value=0,console.log(_.value.page_no),T.value=a.data.count,$.value=!1}).catch(a=>{w.value=!0,$.value=!1})},v=(y,a)=>{S.value=a,V.emit("set-sale-order-detail",y)};return D({getOrderList:h}),X(()=>{V.on("update-sale-order-detail",y=>{console.log("==="),m.value[S.value].paid=1})}),Z(()=>{V.off("update-sale-order-detail")}),(y,a)=>{const C=r("el-radio-button"),B=r("el-radio-group"),z=r("el-date-picker"),O=r("CircleClose"),U=r("el-icon"),A=r("el-button"),Y=r("el-input"),x=r("el-image"),P=r("spna"),I=R("loading"),se=R("infinite-scroll");return s(),o("div",ve,[e("div",pe,[fe,e("div",me,[d(B,{modelValue:t.value,"onUpdate:modelValue":a[0]||(a[0]=i=>t.value=i),onChange:k,size:"small"},{default:u(()=>[d(C,{value:1},{default:u(()=>[g("全部")]),_:1}),d(C,{value:2},{default:u(()=>[g("未支付")]),_:1})]),_:1},8,["modelValue"]),d(z,{modelValue:b.value,"onUpdate:modelValue":a[1]||(a[1]=i=>b.value=i),type:"daterange","start-placeholder":"开始时间","end-placeholder":"结束时间",size:"small","value-format":"YYYY/MM/DD","disabled-date":N,onChange:L,clearable:!1,style:{width:"14rem","margin-left":"1rem"}},null,8,["modelValue"])])]),e("div",he,[d(Y,{modelValue:_.value.order_id,"onUpdate:modelValue":a[4]||(a[4]=i=>_.value.order_id=i),placeholder:"请输入订单编号",onKeydown:a[5]||(a[5]=ie(i=>h(!0),["enter"])),onClear:a[6]||(a[6]=i=>h(!0))},{suffix:u(()=>[_.value.order_id!=""?(s(),M(U,{key:0,size:"18",onClick:a[2]||(a[2]=i=>{_.value.order_id="",h(!0)}),style:{cursor:"pointer","margin-right":"0.5rem"}},{default:u(()=>[d(O)]),_:1})):p("",!0)]),append:u(()=>[d(A,{type:"primary",style:{"background-color":"#1890ff",color:"#fff","border-radius":"0 0.315rem 0.315rem 0"},onClick:a[3]||(a[3]=i=>h(!0))},{default:u(()=>[g("搜索")]),_:1})]),_:1},8,["modelValue"])]),F((s(),o("div",ye,[(s(!0),o(K,null,j(m.value,(i,E)=>(s(),o("div",{class:Q(["item",{"item-active":S.value==E}]),key:E,onClick:q=>v(i,E)},[e("div",ke,[e("div",{class:Q(["sn","cahier"])},"单号: "+l(i.order_id),1),e("div",be,l(i.pay_time),1)]),e("div",$e,[i.product_info?(s(),o("div",we,[(s(!0),o(K,null,j(i.product_info.slice(0,5),(q,oe)=>(s(),M(x,{key:oe,src:q.image,class:"shop-img"},null,8,["src"]))),128)),i.product_info.length==1?(s(),o("div",Ce,l(i.product_info[0].store_name),1)):p("",!0)])):p("",!0),e("div",De,[e("div",Se,"¥"+l(i.pay_price),1),e("div",Ve,"共"+l(i.total_num)+"款商品",1)])]),e("div",ze,[e("div",Ye,[i.paid?(s(),o("div",xe,[g(l(i.paid_name)+" ",1),i.pay_type_name?(s(),M(P,{key:0},{default:u(()=>[g("("+l(i.pay_type_name)+")",1)]),_:2},1024)):i.pay_type==9?(s(),o("span",Pe,"(微信收款)")):i.pay_type==17?(s(),o("span",Ie,"(现金支付)")):i.pay_type==13?(s(),o("span",Me,"(支付宝收款)")):i.pay_type==3?(s(),o("span",Re,"(余额支付)")):i.pay_type==1?(s(),o("span",Le,"(微信支付)")):p("",!0)])):(s(),o("div",Ne,l(i.paid_name),1))])])],10,ge))),128)),w.value?(s(),o("div",Te,"没有更多了")):p("",!0),$.value?(s(),o("div",Be,"加载中...")):p("",!0)])),[[I,$.value],[se,h]])])}}},Ue=J(Oe,[["__scopeId","data-v-bf6504fc"]]),c=f=>(ee("data-v-8ba192bc"),f=f(),te(),f),Ae={class:"my-order"},Ee={key:0,class:"detail"},Fe={class:"table","infinite-scroll-distance":300,"infinite-scroll-delay":300,style:{overflow:"auto"},"infinite-scroll-immediate":!1},qe=c(()=>e("div",{class:"table-title"},"订单信息",-1)),Ke={class:"table-info"},je={class:"info-item"},Qe=c(()=>e("div",{class:"info-item-title"},"订单编号:",-1)),Ge={class:"info-item-info"},He={class:"info-item"},Je=c(()=>e("div",{class:"info-item-title"},"商品款数:",-1)),We={class:"info-item-info"},Xe={class:"info-item"},Ze=c(()=>e("div",{class:"info-item-title"},"商品总价:",-1)),et={class:"info-item-info"},tt={class:"info-item"},st=c(()=>e("div",{class:"info-item-title"},"创建时间:",-1)),ot={class:"info-item-info"},it={class:"info-item"},at=c(()=>e("div",{class:"info-item-title"},"优惠抵扣:",-1)),lt={class:"info-item-info"},nt={class:"info-item"},dt=c(()=>e("div",{class:"info-item-title"},"实际支付:",-1)),_t={class:"info-item-info"},ct={class:"info-item"},rt=c(()=>e("div",{class:"info-item-title"},"支付时间:",-1)),ut={class:"info-item-info"},vt={class:"info-item"},pt=c(()=>e("div",{class:"info-item-title"},"支付方式:",-1)),ft={class:"info-item-info"},mt={key:0},ht={key:1},yt={key:2},gt={key:3},kt={key:4},bt={key:5},$t=c(()=>e("div",{class:"info-item"},null,-1)),wt={class:"info-item"},Ct=c(()=>e("div",{class:"info-item-title"},"是否退款:",-1)),Dt={class:"info-item-info"},St={class:"info-item"},Vt=c(()=>e("div",{class:"info-item-title"},"退款金额:",-1)),zt={class:"info-item-info"},Yt={key:0,class:"table-title"},xt={key:1,class:"table-info"},Pt={class:"info-item"},It=c(()=>e("div",{class:"info-item-title"},"用户ID:",-1)),Mt={class:"info-item-info"},Rt={class:"info-item"},Lt=c(()=>e("div",{class:"info-item-title"},"用户昵称:",-1)),Nt={class:"info-item-info"},Tt={class:"info-item"},Bt=c(()=>e("div",{class:"info-item-title"},"用户电话:",-1)),Ot={class:"info-item-info"},Ut={style:{"font-size":"0.9rem"}},At={style:{color:"#ff4a00"}},Et={style:{display:"flex","align-items":"center"}},Ft={style:{"margin-left":"0.5rem"}},qt=c(()=>e("div",{style:{height:"8rem"}},null,-1)),Kt={key:0,class:"footer"},jt={key:1,class:"footer"},Qt={key:1},Gt={__name:"detail",emits:["rePaySuccess"],setup(f,{emit:D}){W(),ae();const t=n({id:""});n([]);const k=n(null),b=n(!1);n(0),n(0),n(["商品信息","订单详情"]),n(""),n(!1);const L=()=>{k.value.setForm({isRePay:!0,data:t.value}),k.value.drawer=!0},N=()=>{t.value.order_id?ne({order_no:t.value.order_id}).then(v=>{console.log(v)}):G({message:"订单号不能为空",type:"error"})},_=n({page_no:1,page_size:15,loadend:!1,loading:!1}),$=n([]),T=()=>console.log("触底"),S=()=>{b.value=!0,de({id:t.value.id}).then(v=>{t.value=v.data,setTimeout(()=>{b.value=!1},200)})},w=D,m=(v=null)=>{setTimeout(()=>{w("rePaySuccess")})},h=()=>{_e({id:t.value.id}).then(v=>{G({message:v.msg,type:"success"}),setTimeout(()=>{w("rePaySuccess")})})};return X(()=>{V.on("set-sale-order-detail",v=>{console.log("===",v),t.value=v,_.value.page_no=1,_.value.loadend=!1,_.value.loading=!1,$.value=[],S()})}),Z(()=>{V.off("set-sale-order-detail")}),(v,y)=>{var Y;const a=r("el-image"),C=r("el-table-column"),B=r("el-table"),z=r("el-button"),O=r("el-empty"),U=R("infinite-scroll"),A=R("loading");return s(),o("div",Ae,[t.value.id?F((s(),o("div",Ee,[F((s(),o("div",Fe,[qe,e("div",Ke,[e("div",je,[Qe,e("div",Ge,l(t.value.order_id),1)]),e("div",He,[Je,e("div",We,l(t.value.total_num||0),1)]),e("div",Xe,[Ze,e("div",et,"¥"+l(t.value.total_price),1)]),e("div",tt,[st,e("div",ot,l(t.value.pay_time),1)]),e("div",it,[at,e("div",lt,"¥"+l(t.value.deduction_price),1)]),e("div",nt,[dt,e("div",_t,"¥"+l(t.value.pay_price),1)]),e("div",ct,[rt,e("div",ut,l(t.value.pay_time),1)]),e("div",vt,[pt,e("div",ft,[t.value.pay_type_name?(s(),o("span",mt,l(t.value.pay_type_name),1)):t.value.pay_type==9?(s(),o("span",ht,"微信收款")):t.value.pay_type==17?(s(),o("span",yt,"现金支付")):t.value.pay_type==13?(s(),o("span",gt,"支付宝收款")):t.value.pay_type==3?(s(),o("span",kt,"余额支付")):t.value.pay_type==1?(s(),o("span",bt,"微信支付")):p("",!0)])]),$t,e("div",wt,[Ct,e("div",Dt,[e("span",null,l(t.value.refund_status_name),1)])]),e("div",St,[Vt,e("div",zt,[e("span",null,"¥"+l(t.value.refund_price),1)])])]),t.value.uid?(s(),o("div",Yt,"用户信息")):p("",!0),t.value.uid?(s(),o("div",xt,[e("div",Pt,[It,e("div",Mt,l(t.value.uid),1)]),e("div",Rt,[Lt,e("div",Nt,l(t.value.nickname),1)]),e("div",Tt,[Bt,e("div",Ot,l(t.value.mobile),1)])])):p("",!0),e("div",Ut,[g(" 共计 "),e("span",At,l(((Y=t.value.product)==null?void 0:Y.length)||" "),1),g(" 款商品 ")]),d(B,{data:t.value.product},{default:u(()=>[d(C,{label:"商品信息"},{default:u(({row:x})=>{var P,I;return[e("div",Et,[d(a,{style:{height:"3rem",width:"3rem","flex-shrink":"0"},src:(P=x.cart_info)==null?void 0:P.image},null,8,["src"]),e("span",Ft,l((I=x.cart_info)==null?void 0:I.name),1)])]}),_:1}),d(C,{prop:"cart_info.store_info",label:"商品规格",width:"150"}),d(C,{prop:"cart_info.price",label:"单价",width:"150"}),d(C,{prop:"cart_info.cart_num",label:"数量",width:"150"}),d(C,{prop:"cart_info.pay_price",label:"总价",width:"150"})]),_:1},8,["data"]),qt])),[[U,T]]),t.value.paid?p("",!0):(s(),o("div",Kt,[d(z,{type:"primary",size:"large",onClick:L},{default:u(()=>[g("重新支付")]),_:1}),t.value.pay_type==9?(s(),M(z,{key:0,type:"primary",size:"large",onClick:N},{default:u(()=>[g("查询支付")]),_:1})):p("",!0)])),t.value.paid==1&&t.value.status==1?(s(),o("div",jt,[d(z,{type:"primary",size:"large",onClick:h},{default:u(()=>[g("不配送")]),_:1})])):p("",!0)])),[[A,b.value]]):(s(),o("div",Qt,[d(O)])),d(ce,{ref_key:"payRef",ref:k,onPaySuccess:m},null,512)])}}},Ht=J(Gt,[["__scopeId","data-v-8ba192bc"]]),Jt={class:"my-card"},is={__name:"index",setup(f){const D=n(null),t=()=>{var k;(k=D.value)==null||k.getOrderList(!0)};return(k,b)=>(s(),o("div",Jt,[d(Ue,{style:{"flex-shrink":"0"},ref_key:"orderRef",ref:D},null,512),d(re),d(Ht,{ref:"detailRef",onRePaySuccess:t},null,512)]))}};export{is as default}; diff --git a/build/assets/padding-DLHwO6AB.js b/build/assets/padding-Bq_IbaOz.js similarity index 65% rename from build/assets/padding-DLHwO6AB.js rename to build/assets/padding-Bq_IbaOz.js index c0a222f..b4f48ba 100644 --- a/build/assets/padding-DLHwO6AB.js +++ b/build/assets/padding-Bq_IbaOz.js @@ -1 +1 @@ -import{_ as e,c as t,k as c}from"./index-B9unL6O8.js";const n={},o={style:{width:"1rem",height:"100%"}};function r(s,_){return t(),c("div",o)}const i=e(n,[["render",r]]);export{i as p}; +import{_ as e,c as t,k as c}from"./index-CEprPOh1.js";const n={},o={style:{width:"1rem",height:"100%"}};function r(s,_){return t(),c("div",o)}const i=e(n,[["render",r]]);export{i as p}; diff --git a/build/assets/pay-BFyuVP94.js b/build/assets/pay-BFyuVP94.js deleted file mode 100644 index 27ee75c..0000000 --- a/build/assets/pay-BFyuVP94.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as ye,r as o,u as me,J as ge,o as he,m,a as ke,b as D,h as be,c as _,d as O,w as g,e as s,z,k as w,g as C,t as S,p as Z,j as we,f as x,i as ee,F as Ce,l as xe,n as R,E as c,q as $e,s as Ve}from"./index-B9unL6O8.js";import{g as K,h as Se,i as Pe,j as Ee}from"./store-DNW8I_iw.js";import{_ as Fe}from"./authCode-D610lJnm.js";/* empty css */const V=L=>($e("data-v-09cf2609"),L=L(),Ve(),L),je=V(()=>s("h4",null,"选择支付方式",-1)),ze={class:"dra-body"},Be={class:"header"},Ae={key:0,style:{display:"inline-block","margin-right":"20px"}},De={style:{display:"inline-block","margin-right":"20px"}},Le=V(()=>s("div",{style:{color:"#999",padding:"2rem 0 0.3rem 0"}},"原价:",-1)),Re={style:{color:"#f5222d","padding-bottom":"2rem"}},Te={style:{"font-size":"1.6rem"}},Ne={style:{display:"inline-block"}},Ue=V(()=>s("div",{style:{color:"#999",padding:"2rem 0 0.3rem 0"}},"活动折扣: ",-1)),Ie={style:{color:"#f5222d","padding-bottom":"2rem"}},Oe={style:{"font-size":"1.6rem"}},Ke={style:{display:"inline-block"}},Me=V(()=>s("div",{style:{color:"#999",padding:"2rem 0 0.3rem 0"}},"应收金额(元):",-1)),qe={style:{color:"#f5222d","padding-bottom":"2rem"}},Je={style:{"font-size":"1.6rem"}},We={key:0,"element-loading-text":"支付中",class:"card1"},Ge=V(()=>s("div",{class:"tips"},null,-1)),He={key:1,class:"card2"},Qe={class:"drawer-body"},Xe={class:"counter"},Ye={class:"received"},Ze={key:0},ea={key:1,style:{"font-size":"1rem",color:"#999"}},aa={key:0,class:"balance"},sa={class:"money"},ta=V(()=>s("div",{class:"tips"},"按回车(Enter)确认支付",-1)),la={key:1,class:"balance"},oa=V(()=>s("div",null,"不够找零, 请支付更多金额",-1)),na=V(()=>s("div",{class:"tips"},"按下小键盘输入金额",-1)),ia=[oa,na],ua={class:"keypad"},ca={class:"left"},ra={class:"right"},da={key:2,class:"card3"},va={class:"codes"},_a={style:{width:"100%",display:"flex","justify-content":"center"}},pa={__name:"pay",emits:["paySuccess"],setup(L,{expose:ae,emit:se}){const v=o(!1),t=o(1),i=o(""),h=o("");me(),o(0);const P=a=>{Ee({id:a}).then(e=>{m.emit("letPrintReceipt",e.data)})},te=()=>{y()},le=()=>{R(()=>{setTimeout(()=>{var a;k.value=!1,i.value="",M.value=!0,(a=h.value)==null||a.focus(),p(t.value)},300)})},p=a=>{t.value=a,t.value==2?window.addEventListener("keydown",U):(window.removeEventListener("keydown",U),R(()=>{var e;i.value="",(e=h.value)==null||e.focus()}))},u=o({}),B=o([]),f=o(""),E=o(null),T=o(!1);let F=0;const oe=a=>{u.value=a.data,B.value=a.cart_id,f.value=a.uid,E.value=a.reservation||null,F=a.is_storage||0,console.log("选择了用户==",f.value||"游客"),T.value=a.isRePay||!1},ne=a=>{u.value.pay_price=a.price,ce.value=a.order_id,F=a.is_storage||0},ie=se,M=o(!1),ue=o(["1","2","3","4","5","6","7","8","9","0","00","."]),q=/^(10|11|12|13|14|15)\d{16}$/,J=/^(25|26|27|28|29|30)\d{14,22}$/,ce=o(""),re=()=>{if(k.value=!0,h.value.blur(),T.value)W();else{let a;if(q.test(i.value))a="9";else if(J.test(i.value))a="13";else return k.value=!1,i.value="",h.value.focus(),c.error("请输入正确的支付码");K({key:u.value.key,cart_id:B.value,pay_type:a,is_storage:F,auth_code:i.value,reservation:E.value,uid:f.value}).then(e=>{e.data.out_trade_no&&e.msg=="支付成功"?(v.value=!1,c({message:"支付成功",type:"success"}),y(e.data),P(e.data.id)):e.msg=="用户支付中"&&e.code==1&&(c.warning(e.msg),m.on("pay_success",l=>{c({message:"支付成功",type:"success"}),P(e.data.id),setTimeout(()=>{m.off("pay_success")},200),v.value=!1,y(l)}))}).catch(e=>{k.value=!1,R(()=>{var l;(l=h.value)==null||l.focus()})})}},W=()=>{let a=17;if(t.value==1)if(q.test(i.value))a="9";else if(J.test(i.value))a="13";else return k.value=!1,i.value="",h.value.focus(),c.error("请输入正确的支付码");Se({order_id:u.value.order_id,pay_type:a,is_storage:F,auth_code:i.value,reservation:E.value,uid:f.value}).then(e=>{var l;(l=e.msg)!=null&&l.includes("成功")?(v.value=!1,c({message:"支付成功",type:"success"}),P(e.data.id),y()):e.msg=="用户支付中"&&e.code==1&&(c.warning(e.msg),m.on("pay_success",$=>{c({message:"支付成功",type:"success"}),P(e.data.id),setTimeout(()=>{m.off("pay_success")},200),v.value=!1,y($)}))}).catch(e=>{i.value="",k.value=!1,R(()=>{var l;(l=h.value)==null||l.focus()})})};o(0);const y=a=>{var e;try{window.removeEventListener("keydown",U),M.value=!1,k.value=!1,i.value="",r.value="",b.value=[],(e=h.value)==null||e.blur(),ie("paySuccess",a),v.value=!1}catch{}},k=o(!1);ae({drawer:v,setForm:oe,setRePay:ne,beforeClose:y});const b=o([]),r=o(""),A=ge(()=>+r.value>0?(+r.value-u.value.pay_price).toFixed(2):-1),G=o(!1),N=a=>{a===-1?b.value=[]:b.value.pop(),r.value=b.value.length?b.value.join(""):0},d=a=>{G.value===!1&&(r.value="",G.value=!0);let e=String(r.value).indexOf(".")+1,l=String(r.value).length-e;console.log(e,l),(e===0||l<2)&&(b.value.join("")<=9999999&&b.value.push(a),r.value=b.value.join("")>99999999?99999999:b.value.join(""))},H=()=>{if(A.value===""||A.value===null||A.value===void 0||+r.value<+u.value.pay_price)return c.error("收款金额应该大于等于应收金额");T.value?W():K({cart_id:B.value,pay_type:"17",is_storage:F,reservation:E.value,uid:f.value}).then(a=>{v.value=!1,c({message:a.msg,type:"success"}),P(a.data.id),t.value=1,y()}).catch(a=>{k.value=!1})},U=a=>{let l=(a||window.event).keyCode;if(l==37)return p(2);if(l==120)return m.emit("F9");if(l==27)return y();switch(a.stopPropagation(),a.preventDefault(),l){case 96:case 48:d(0);break;case 97:case 49:d(1);break;case 98:case 50:d(2);break;case 99:case 51:d(3);break;case 100:case 52:d(4);break;case 101:case 53:d(5);break;case 102:case 54:d(6);break;case 103:case 55:d(7);break;case 104:case 56:d(8);break;case 105:case 57:d(9);break;case 110:d(".");break;case 190:d(".");break;case 8:N();break;case 13:H();break}},de=()=>{if(!f.value)return c.error("请先选择用户");let a=1;t.value==4&&(a=2),t.value==5&&(a=3),Pe({cart_id:B.value,reservation:E.value,uid:f.value,type:a}).then(e=>{c({message:"发送成功",type:"success"})})},I=o(""),Q=()=>{if(!f.value)return c.error("请先选择用户");let a=18;t.value==4&&(a=19),t.value==5&&(a=3),K({pay_type:a,is_storage:F,sms_code:I.value,cart_id:B.value,reservation:E.value,uid:f.value}).then(e=>{v.value=!1,c({message:e.msg,type:"success"}),P(e.data.id),p(1),y()})},j=o(!1),X=()=>{if(!(!v.value||j.value&&i.value.length>0)&&t.value!=1)return p(t.value-1)},Y=()=>{if(!(!v.value||j.value&&i.value.length>0)&&t.value!=5)return p(t.value+1)};return he(()=>{m.on("left",X),m.on("right",Y)}),ke(()=>{m.off("left",X),m.off("right",Y)}),(a,e)=>{const l=D("el-input"),$=D("el-button"),ve=D("Delete"),_e=D("el-icon"),pe=D("el-drawer"),fe=be("loading");return _(),O(pe,{size:"60rem",modelValue:v.value,"onUpdate:modelValue":e[12]||(e[12]=n=>v.value=n),direction:"rtl",onOpen:le,"before-close":y},{header:g(()=>[je]),default:g(()=>[s("div",ze,[s("div",Be,[s("div",{class:z(["left",{active:t.value==1}]),onClick:e[0]||(e[0]=n=>p(1))}," 微信/支付宝 ",2),s("div",{class:z(["center",{active:t.value==2}]),onClick:e[1]||(e[1]=n=>p(2))}," 现金收款 ",2),s("div",{class:z(["center",{active:t.value==3}]),style:{"border-left":"none"},onClick:e[2]||(e[2]=n=>p(3))}," 采购款 ",2),s("div",{class:z(["center",{active:t.value==4}]),style:{"border-left":"none"},onClick:e[3]||(e[3]=n=>p(4))}," 礼品券兑换 ",2),s("div",{class:z(["right",{active:t.value==5}]),onClick:e[4]||(e[4]=n=>p(5))}," 余额 ",2)]),s("div",null,[u.value.activities==1&&t.value!=4?(_(),w("div",Ae,[s("div",De,[Le,s("div",Re,[C(" ¥"),s("span",Te,S(u.value.total_price),1)])]),s("div",Ne,[Ue,s("div",Ie,[C(S(u.value.activity)+"¥",1),s("span",Oe,S(u.value.activity_price),1)])])])):Z("",!0),s("div",Ke,[Me,s("div",qe,[C(" ¥"),s("span",Je,S(t.value==4?u.value.total_price:u.value.pay_price),1)])])]),t.value==1?we((_(),w("div",We,[x(l,{ref_key:"codeRef",ref:h,modelValue:i.value,"onUpdate:modelValue":e[5]||(e[5]=n=>i.value=n),autofocus:"",class:"code-input",placeholder:"请点击输入框聚焦扫码或输入编码号",onKeyup:ee(re,["enter"]),onFocus:e[6]||(e[6]=n=>j.value=!0),onBlur:e[7]||(e[7]=n=>j.value=!1)},null,8,["modelValue"]),Ge])),[[fe,k.value]]):t.value==2?(_(),w("div",He,[s("div",Qe,[s("div",Xe,[s("div",Ye,[r.value?(_(),w("span",Ze,S(r.value),1)):(_(),w("span",ea,"按下键盘输入客户支付金额"))]),A.value>=0?(_(),w("div",aa,[s("div",null,[C(" 需找零(元):"),s("span",sa,"¥"+S(A.value),1)]),ta])):(_(),w("div",la,ia)),s("div",ua,[s("div",ca,[(_(!0),w(Ce,null,xe(ue.value,n=>(_(),O($,{key:n,onClick:fa=>d(n)},{default:g(()=>[C(S(n),1)]),_:2},1032,["onClick"]))),128))]),s("div",ra,[x($,{onClick:N},{default:g(()=>[x(_e,null,{default:g(()=>[x(ve)]),_:1})]),_:1}),x($,{onClick:e[8]||(e[8]=n=>N(-1))},{default:g(()=>[C("C")]),_:1}),x($,{class:z(["enter",{"enter-disable":+r.value<+u.value.pay_price}]),disabled:+r.value<+u.value.pay_price,onClick:H},{default:g(()=>[C(" 确认 ")]),_:1},8,["class","disabled"])])])])])])):t.value==3||t.value==4||t.value==5?(_(),w("div",da,[s("div",va,[x(l,{modelValue:I.value,"onUpdate:modelValue":e[9]||(e[9]=n=>I.value=n),autofocus:"",class:"code-input",placeholder:"请输入验证码",onKeyup:ee(Q,["enter"]),onFocus:e[10]||(e[10]=n=>j.value=!0),onBlur:e[11]||(e[11]=n=>j.value=!1)},null,8,["modelValue"]),(_(),O(Fe,{style:{"margin-left":"1rem"},onSendCode:de,start:f.value>0,key:u.value.order_id,class:"get-code-btn"},null,8,["start"]))]),x($,{type:"primary",onClick:Q,class:"code-pay"},{default:g(()=>[C("确认支付")]),_:1})])):Z("",!0)])]),footer:g(()=>[s("div",_a,[x($,{class:"cancel-btn",onClick:te},{default:g(()=>[C("取消收款")]),_:1})])]),_:1},8,["modelValue"])}}},ka=ye(pa,[["__scopeId","data-v-09cf2609"]]);export{ka as p}; diff --git a/build/assets/pay-BedbwRTP.css b/build/assets/pay-BedbwRTP.css new file mode 100644 index 0000000..3f3c019 --- /dev/null +++ b/build/assets/pay-BedbwRTP.css @@ -0,0 +1 @@ +.dra-body[data-v-51aa72fd]{width:100%;display:flex;flex-direction:column;align-items:center;text-align:center}.dra-body .header[data-v-51aa72fd]{width:35rem;display:flex}.dra-body .header>div[data-v-51aa72fd]{flex:1;border:.0625rem solid #ccc;text-align:center;padding:.6rem 0;cursor:pointer}.dra-body .header .left[data-v-51aa72fd]{border-right:none;border-radius:5rem 0 0 5rem}.dra-body .header .right[data-v-51aa72fd]{border-left:none;border-radius:0 5rem 5rem 0}.dra-body .header .active[data-v-51aa72fd]{background-color:#1890ff;color:#fff;transition:.3s;border-color:#1890ff}.dra-body .card1 .code-input[data-v-51aa72fd]{width:100%;height:3rem;font-size:1.2rem}.dra-body .card1 .tips[data-v-51aa72fd]{width:38rem;height:16rem;background:url(./pay-De0xbdxm.png);background-size:100% 100%;background-repeat:no-repeat}.dra-body .card3 .codes[data-v-51aa72fd]{width:38rem;display:flex;align-items:center}.dra-body .card3 .codes .code-input[data-v-51aa72fd]{flex:1;height:3rem;font-size:1.2rem}.dra-body .card3 .codes .get-code-btn[data-v-51aa72fd]{height:3rem;margin-left:1rem}.dra-body .card3 .code-pay[data-v-51aa72fd]{margin-top:4rem;width:100%;height:3rem;border-radius:3rem}.cancel-btn[data-v-51aa72fd]{width:60%;border-color:#1890ff;color:#1890ff;border-radius:5rem;height:3rem;font-size:1.2rem}.drawer-body[data-v-51aa72fd]{width:100%;overflow-x:hidden}.counter[data-v-51aa72fd]{padding:1.25rem;border-radius:1.25rem;background-color:#f3f9ff}.counter .received[data-v-51aa72fd]{height:3rem;padding:0 1.25rem;border:.0625rem solid #1890ff;box-shadow:0 0 .18rem #1890ff;border-radius:.5rem;background-color:#fff;font-size:1.62rem;line-height:3rem;color:#333}.counter .balance[data-v-51aa72fd]{width:100%;box-sizing:border-box;padding:1.12rem 0 1.12rem .625rem;text-align:start;font-size:.95rem;color:#303133;display:flex;justify-content:space-between}.counter .balance .money[data-v-51aa72fd]{color:#ff4a00}.counter .balance .tips[data-v-51aa72fd]{font-size:.8rem;color:#999}.counter .keypad[data-v-51aa72fd]{display:grid;grid-template-columns:auto auto auto auto;grid-gap:.625rem}.counter .keypad .left[data-v-51aa72fd]{grid-column-end:span 3;display:grid;grid-template-columns:auto auto auto;grid-gap:.625rem}.counter .keypad .right[data-v-51aa72fd]{display:grid;grid-template-columns:auto;grid-gap:.625rem}.counter .keypad .el-button[data-v-51aa72fd]{height:3.875rem;width:8.125rem;margin:0!important;border:0;border-radius:.5rem;font-weight:500;font-size:1.75rem!important;line-height:3.87rem;color:#1890ff}.counter .keypad .el-button[data-v-51aa72fd]:focus{box-shadow:none}.counter .keypad .enter[data-v-51aa72fd]{grid-row-end:span 4;height:8.37rem;line-height:8.37rem;background-color:#1890ff;font-weight:500;font-size:1.35rem!important;color:#fff;position:relative}.counter .keypad .enter-disable[data-v-51aa72fd]{background-color:#ccc} diff --git a/build/assets/pay-C9Lsc2yr.js b/build/assets/pay-C9Lsc2yr.js new file mode 100644 index 0000000..26baa68 --- /dev/null +++ b/build/assets/pay-C9Lsc2yr.js @@ -0,0 +1 @@ +import{_ as ye,r as o,u as me,J as ge,o as ke,m,a as he,b as D,h as be,c as _,d as O,w as g,e as s,z,k as w,g as C,t as S,p as Z,j as we,f as x,i as ee,F as Ce,l as xe,n as R,E as r,q as $e,s as Ve}from"./index-CEprPOh1.js";import{h as K,i as Se,j as Pe,k as Ee}from"./store-BoFe3Agt.js";import{_ as Fe}from"./authCode-k34-_7Pb.js";/* empty css */const V=L=>($e("data-v-51aa72fd"),L=L(),Ve(),L),je=V(()=>s("h4",null,"选择支付方式",-1)),ze={class:"dra-body"},Be={class:"header"},Ae={key:0,style:{display:"inline-block","margin-right":"20px"}},De={style:{display:"inline-block","margin-right":"20px"}},Le=V(()=>s("div",{style:{color:"#999",padding:"2rem 0 0.3rem 0"}},"原价:",-1)),Re={style:{color:"#f5222d","padding-bottom":"2rem"}},Te={style:{"font-size":"1.6rem"}},Ne={style:{display:"inline-block"}},Ue=V(()=>s("div",{style:{color:"#999",padding:"2rem 0 0.3rem 0"}},"活动折扣: ",-1)),Ie={style:{color:"#f5222d","padding-bottom":"2rem"}},Oe={style:{"font-size":"1.6rem"}},Ke={style:{display:"inline-block"}},Me=V(()=>s("div",{style:{color:"#999",padding:"2rem 0 0.3rem 0"}},"应收金额(元):",-1)),qe={style:{color:"#f5222d","padding-bottom":"2rem"}},Je={style:{"font-size":"1.6rem"}},We={key:0,"element-loading-text":"支付中",class:"card1"},Ge=V(()=>s("div",{class:"tips"},null,-1)),He={key:1,class:"card2"},Qe={class:"drawer-body"},Xe={class:"counter"},Ye={class:"received"},Ze={key:0},ea={key:1,style:{"font-size":"1rem",color:"#999"}},aa={key:0,class:"balance"},sa={class:"money"},ta=V(()=>s("div",{class:"tips"},"按回车(Enter)确认支付",-1)),la={key:1,class:"balance"},oa=V(()=>s("div",null,"不够找零, 请支付更多金额",-1)),na=V(()=>s("div",{class:"tips"},"按下小键盘输入金额",-1)),ia=[oa,na],ua={class:"keypad"},ca={class:"left"},ra={class:"right"},da={key:2,class:"card3"},va={class:"codes"},_a={style:{width:"100%",display:"flex","justify-content":"center"}},pa={__name:"pay",emits:["paySuccess"],setup(L,{expose:ae,emit:se}){const v=o(!1),t=o(1),i=o(""),k=o("");me(),o(0);const P=a=>{Ee({id:a}).then(e=>{m.emit("letPrintReceipt",e.data)})},te=()=>{y()},le=()=>{R(()=>{setTimeout(()=>{var a;h.value=!1,i.value="",M.value=!0,(a=k.value)==null||a.focus(),p(t.value)},300)})},p=a=>{t.value=a,t.value==2?window.addEventListener("keydown",U):(window.removeEventListener("keydown",U),R(()=>{var e;i.value="",(e=k.value)==null||e.focus()}))},u=o({}),B=o([]),f=o(""),E=o(null),T=o(!1);let F=0;const oe=a=>{u.value=a.data,B.value=a.cart_id,f.value=a.uid,E.value=a.reservation||null,F=a.is_storage||0,console.log("选择了用户==",f.value||"游客"),T.value=a.isRePay||!1},ne=a=>{u.value.pay_price=a.price,ce.value=a.order_id,F=a.is_storage||0},ie=se,M=o(!1),ue=o(["1","2","3","4","5","6","7","8","9","0","00","."]),q=/^(10|11|12|13|14|15)\d{16}$/,J=/^(25|26|27|28|29|30)\d{14,22}$/,ce=o(""),re=()=>{if(h.value=!0,k.value.blur(),T.value)W();else{let a;if(q.test(i.value))a="9";else if(J.test(i.value))a="13";else return h.value=!1,i.value="",k.value.focus(),r.error("请输入正确的支付码");K({key:u.value.key,cart_id:B.value,pay_type:a,is_storage:F,auth_code:i.value,reservation:E.value,uid:f.value}).then(e=>{e.data.out_trade_no&&e.msg=="支付成功"?(v.value=!1,r({message:"支付成功",type:"success"}),y(e.data),P(e.data.id)):e.msg=="用户支付中"&&e.code==1&&(r.warning(e.msg),m.on("pay_success",l=>{r({message:"支付成功",type:"success"}),P(e.data.id),setTimeout(()=>{m.off("pay_success")},200),v.value=!1,y(l)}))}).catch(e=>{h.value=!1,R(()=>{var l;(l=k.value)==null||l.focus()})})}},W=()=>{let a=17;if(t.value==1)if(q.test(i.value))a="9";else if(J.test(i.value))a="13";else return h.value=!1,i.value="",k.value.focus(),r.error("请输入正确的支付码");Se({order_id:u.value.order_id,pay_type:a,is_storage:F,auth_code:i.value,reservation:E.value,uid:f.value}).then(e=>{var l;(l=e.msg)!=null&&l.includes("成功")?(v.value=!1,r({message:"支付成功",type:"success"}),P(e.data.id),y()):e.msg=="用户支付中"&&e.code==1&&(r.warning(e.msg),m.on("pay_success",$=>{r({message:"支付成功",type:"success"}),P(e.data.id),setTimeout(()=>{m.off("pay_success")},200),v.value=!1,y($)}))}).catch(e=>{i.value="",h.value=!1,R(()=>{var l;(l=k.value)==null||l.focus()})})};o(0);const y=a=>{var e;try{window.removeEventListener("keydown",U),M.value=!1,h.value=!1,i.value="",c.value="",b.value=[],(e=k.value)==null||e.blur(),ie("paySuccess",a),v.value=!1}catch{}},h=o(!1);ae({drawer:v,setForm:oe,setRePay:ne,beforeClose:y});const b=o([]),c=o(""),A=ge(()=>+c.value>0?(+c.value-u.value.pay_price).toFixed(2):-1),G=o(!1),N=a=>{a===-1?b.value=[]:b.value.pop(),c.value=b.value.length?b.value.join(""):0},d=a=>{G.value===!1&&(c.value="",G.value=!0);let e=String(c.value).indexOf(".")+1,l=String(c.value).length-e;console.log(e,l),(e===0||l<2)&&(b.value.join("")<=9999999&&b.value.push(a),c.value=b.value.join("")>99999999?99999999:b.value.join(""))},H=()=>{if(A.value===""||A.value===null||A.value===void 0||+c.value<+u.value.pay_price)return r.error("收款金额应该大于等于应收金额");T.value?W():(c.value="",K({cart_id:B.value,pay_type:"17",is_storage:F,reservation:E.value,uid:f.value}).then(a=>{v.value=!1,r({message:a.msg,type:"success"}),P(a.data.id),t.value=1,y()}).catch(a=>{h.value=!1}))},U=a=>{let l=(a||window.event).keyCode;if(l==37)return p(2);if(l==120)return m.emit("F9");if(l==27)return y();switch(a.stopPropagation(),a.preventDefault(),l){case 96:case 48:d(0);break;case 97:case 49:d(1);break;case 98:case 50:d(2);break;case 99:case 51:d(3);break;case 100:case 52:d(4);break;case 101:case 53:d(5);break;case 102:case 54:d(6);break;case 103:case 55:d(7);break;case 104:case 56:d(8);break;case 105:case 57:d(9);break;case 110:d(".");break;case 190:d(".");break;case 8:N();break;case 13:H();break}},de=()=>{if(!f.value)return r.error("请先选择用户");let a=1;t.value==4&&(a=2),t.value==5&&(a=3),Pe({cart_id:B.value,reservation:E.value,uid:f.value,type:a}).then(e=>{r({message:"发送成功",type:"success"})})},I=o(""),Q=()=>{if(!f.value)return r.error("请先选择用户");let a=18;t.value==4&&(a=19),t.value==5&&(a=3),K({pay_type:a,is_storage:F,sms_code:I.value,cart_id:B.value,reservation:E.value,uid:f.value}).then(e=>{v.value=!1,r({message:e.msg,type:"success"}),P(e.data.id),p(1),y()})},j=o(!1),X=()=>{if(!(!v.value||j.value&&i.value.length>0)&&t.value!=1)return p(t.value-1)},Y=()=>{if(!(!v.value||j.value&&i.value.length>0)&&t.value!=5)return p(t.value+1)};return ke(()=>{m.on("left",X),m.on("right",Y)}),he(()=>{m.off("left",X),m.off("right",Y)}),(a,e)=>{const l=D("el-input"),$=D("el-button"),ve=D("Delete"),_e=D("el-icon"),pe=D("el-drawer"),fe=be("loading");return _(),O(pe,{size:"60rem",modelValue:v.value,"onUpdate:modelValue":e[12]||(e[12]=n=>v.value=n),direction:"rtl",onOpen:le,"before-close":y},{header:g(()=>[je]),default:g(()=>[s("div",ze,[s("div",Be,[s("div",{class:z(["left",{active:t.value==1}]),onClick:e[0]||(e[0]=n=>p(1))}," 微信/支付宝 ",2),s("div",{class:z(["center",{active:t.value==2}]),onClick:e[1]||(e[1]=n=>p(2))}," 现金收款 ",2),s("div",{class:z(["center",{active:t.value==3}]),style:{"border-left":"none"},onClick:e[2]||(e[2]=n=>p(3))}," 采购款 ",2),s("div",{class:z(["center",{active:t.value==4}]),style:{"border-left":"none"},onClick:e[3]||(e[3]=n=>p(4))}," 礼品券兑换 ",2),s("div",{class:z(["right",{active:t.value==5}]),onClick:e[4]||(e[4]=n=>p(5))}," 余额 ",2)]),s("div",null,[u.value.activities==1&&t.value!=4?(_(),w("div",Ae,[s("div",De,[Le,s("div",Re,[C(" ¥"),s("span",Te,S(u.value.total_price),1)])]),s("div",Ne,[Ue,s("div",Ie,[C(S(u.value.activity)+"¥",1),s("span",Oe,S(u.value.activity_price),1)])])])):Z("",!0),s("div",Ke,[Me,s("div",qe,[C(" ¥"),s("span",Je,S(t.value==4?u.value.total_price:u.value.pay_price),1)])])]),t.value==1?we((_(),w("div",We,[x(l,{ref_key:"codeRef",ref:k,modelValue:i.value,"onUpdate:modelValue":e[5]||(e[5]=n=>i.value=n),autofocus:"",class:"code-input",placeholder:"请点击输入框聚焦扫码或输入编码号",onKeyup:ee(re,["enter"]),onFocus:e[6]||(e[6]=n=>j.value=!0),onBlur:e[7]||(e[7]=n=>j.value=!1)},null,8,["modelValue"]),Ge])),[[fe,h.value]]):t.value==2?(_(),w("div",He,[s("div",Qe,[s("div",Xe,[s("div",Ye,[c.value?(_(),w("span",Ze,S(c.value),1)):(_(),w("span",ea,"按下键盘输入客户支付金额"))]),A.value>=0?(_(),w("div",aa,[s("div",null,[C(" 需找零(元):"),s("span",sa,"¥"+S(A.value),1)]),ta])):(_(),w("div",la,ia)),s("div",ua,[s("div",ca,[(_(!0),w(Ce,null,xe(ue.value,n=>(_(),O($,{key:n,onClick:fa=>d(n)},{default:g(()=>[C(S(n),1)]),_:2},1032,["onClick"]))),128))]),s("div",ra,[x($,{onClick:N},{default:g(()=>[x(_e,null,{default:g(()=>[x(ve)]),_:1})]),_:1}),x($,{onClick:e[8]||(e[8]=n=>N(-1))},{default:g(()=>[C("C")]),_:1}),x($,{class:z(["enter",{"enter-disable":+c.value<+u.value.pay_price}]),disabled:+c.value<+u.value.pay_price,onClick:H},{default:g(()=>[C(" 确认 ")]),_:1},8,["class","disabled"])])])])])])):t.value==3||t.value==4||t.value==5?(_(),w("div",da,[s("div",va,[x(l,{modelValue:I.value,"onUpdate:modelValue":e[9]||(e[9]=n=>I.value=n),autofocus:"",class:"code-input",placeholder:"请输入验证码",onKeyup:ee(Q,["enter"]),onFocus:e[10]||(e[10]=n=>j.value=!0),onBlur:e[11]||(e[11]=n=>j.value=!1)},null,8,["modelValue"]),(_(),O(Fe,{style:{"margin-left":"1rem"},onSendCode:de,start:f.value>0,key:u.value.order_id,class:"get-code-btn"},null,8,["start"]))]),x($,{type:"primary",onClick:Q,class:"code-pay"},{default:g(()=>[C("确认支付")]),_:1})])):Z("",!0)])]),footer:g(()=>[s("div",_a,[x($,{class:"cancel-btn",onClick:te},{default:g(()=>[C("取消收款")]),_:1})])]),_:1},8,["modelValue"])}}},ha=ye(pa,[["__scopeId","data-v-51aa72fd"]]);export{ha as p}; diff --git a/build/assets/pay-iBTP5sC1.css b/build/assets/pay-iBTP5sC1.css deleted file mode 100644 index 07bc6c0..0000000 --- a/build/assets/pay-iBTP5sC1.css +++ /dev/null @@ -1 +0,0 @@ -.dra-body[data-v-09cf2609]{width:100%;display:flex;flex-direction:column;align-items:center;text-align:center}.dra-body .header[data-v-09cf2609]{width:35rem;display:flex}.dra-body .header>div[data-v-09cf2609]{flex:1;border:.0625rem solid #ccc;text-align:center;padding:.6rem 0;cursor:pointer}.dra-body .header .left[data-v-09cf2609]{border-right:none;border-radius:5rem 0 0 5rem}.dra-body .header .right[data-v-09cf2609]{border-left:none;border-radius:0 5rem 5rem 0}.dra-body .header .active[data-v-09cf2609]{background-color:#1890ff;color:#fff;transition:.3s;border-color:#1890ff}.dra-body .card1 .code-input[data-v-09cf2609]{width:100%;height:3rem;font-size:1.2rem}.dra-body .card1 .tips[data-v-09cf2609]{width:38rem;height:16rem;background:url(./pay-De0xbdxm.png);background-size:100% 100%;background-repeat:no-repeat}.dra-body .card3 .codes[data-v-09cf2609]{width:38rem;display:flex;align-items:center}.dra-body .card3 .codes .code-input[data-v-09cf2609]{flex:1;height:3rem;font-size:1.2rem}.dra-body .card3 .codes .get-code-btn[data-v-09cf2609]{height:3rem;margin-left:1rem}.dra-body .card3 .code-pay[data-v-09cf2609]{margin-top:4rem;width:100%;height:3rem;border-radius:3rem}.cancel-btn[data-v-09cf2609]{width:60%;border-color:#1890ff;color:#1890ff;border-radius:5rem;height:3rem;font-size:1.2rem}.drawer-body[data-v-09cf2609]{width:100%;overflow-x:hidden}.counter[data-v-09cf2609]{padding:1.25rem;border-radius:1.25rem;background-color:#f3f9ff}.counter .received[data-v-09cf2609]{height:3rem;padding:0 1.25rem;border:.0625rem solid #1890ff;box-shadow:0 0 .18rem #1890ff;border-radius:.5rem;background-color:#fff;font-size:1.62rem;line-height:3rem;color:#333}.counter .balance[data-v-09cf2609]{width:100%;box-sizing:border-box;padding:1.12rem 0 1.12rem .625rem;text-align:start;font-size:.95rem;color:#303133;display:flex;justify-content:space-between}.counter .balance .money[data-v-09cf2609]{color:#ff4a00}.counter .balance .tips[data-v-09cf2609]{font-size:.8rem;color:#999}.counter .keypad[data-v-09cf2609]{display:grid;grid-template-columns:auto auto auto auto;grid-gap:.625rem}.counter .keypad .left[data-v-09cf2609]{grid-column-end:span 3;display:grid;grid-template-columns:auto auto auto;grid-gap:.625rem}.counter .keypad .right[data-v-09cf2609]{display:grid;grid-template-columns:auto;grid-gap:.625rem}.counter .keypad .el-button[data-v-09cf2609]{height:3.875rem;width:8.125rem;margin:0!important;border:0;border-radius:.5rem;font-weight:500;font-size:1.75rem!important;line-height:3.87rem;color:#1890ff}.counter .keypad .el-button[data-v-09cf2609]:focus{box-shadow:none}.counter .keypad .enter[data-v-09cf2609]{grid-row-end:span 4;height:8.37rem;line-height:8.37rem;background-color:#1890ff;font-weight:500;font-size:1.35rem!important;color:#fff;position:relative}.counter .keypad .enter-disable[data-v-09cf2609]{background-color:#ccc} diff --git a/build/assets/shop-CbMLEgdU.js b/build/assets/shop-DX9HGddz.js similarity index 73% rename from build/assets/shop-CbMLEgdU.js rename to build/assets/shop-DX9HGddz.js index c236afc..ac7068e 100644 --- a/build/assets/shop-CbMLEgdU.js +++ b/build/assets/shop-DX9HGddz.js @@ -1 +1 @@ -import{K as s}from"./index-B9unL6O8.js";import{r}from"./axiosAPI-BnxnV-Ca.js";function a(t){return r.get("/product/product/lists",{params:t})}function i(t){return s.get("/cate/cate/lists",{params:t})}function n(t){return s.get("/system_store_storage/systemstorestorage/lists",{params:t})}function u(t){return s.post("/system_store_storage/systemstorestorage/edit",t)}function p(t){return s.get("/store_product/storeProduct/lists",{params:t})}export{n as a,u as b,p as c,i as m,a as s}; +import{K as s}from"./index-CEprPOh1.js";import{r}from"./axiosAPI-JxG9ekqU.js";function a(t){return r.get("/product/product/lists",{params:t})}function i(t){return s.get("/cate/cate/lists",{params:t})}function n(t){return s.get("/system_store_storage/systemstorestorage/lists",{params:t})}function u(t){return s.post("/system_store_storage/systemstorestorage/edit",t)}function p(t){return s.get("/store_product/storeProduct/lists",{params:t})}export{n as a,u as b,p as c,i as m,a as s}; diff --git a/build/assets/store-DNW8I_iw.js b/build/assets/store-BoFe3Agt.js similarity index 71% rename from build/assets/store-DNW8I_iw.js rename to build/assets/store-BoFe3Agt.js index df4c8a0..808c484 100644 --- a/build/assets/store-DNW8I_iw.js +++ b/build/assets/store-BoFe3Agt.js @@ -1 +1 @@ -import{K as e}from"./index-B9unL6O8.js";function o(r){return e.post("/cart/cart/create",r)}function s(r){return e.get("/cart/cart/list",{params:r})}function a(r){return e.post("/store_order/storeOrder/checkInventory",r)}function n(r){return e.post("/store_order/StoreOrder/checkOrder",r)}function i(r){return e.post("/cart/cart/delete",r)}function u(r){return e.post("/store_order/StoreOrder/createOrder",r)}function c(r){return e.post("/store_order/StoreOrder/pay",r)}function d(r){return e.get("/store_order/StoreOrder/lists",{params:r})}function p(r){return e.get("/user_product_storage_log/UserProductStorageLog/lists",{params:r})}function f(r){return e.get("/store_order/storeOrder/detail",{params:r})}function g(r){return e.get("/store_order/storeOrder/writeoff_list",{params:r})}function _(r){return e.post("/store_order/StoreOrder/writeoff_order",r)}function O(r){return e.post("/store_order/StoreOrder/checkSms",r)}function A(r){return e.get("/store_order/StoreOrder/print",{params:r})}function S(r){return e.get("/user_product_storage/UserProductStorage/lists",{params:r})}function l(r){return e.post("/user_product_storage/UserProductStorage/supply",r)}function m(r){return e.get("/store_order/StoreOrder/wechatQuery",{params:r})}export{s as a,o as b,i as c,d,m as e,f,u as g,c as h,O as i,A as j,g as k,S as l,l as m,n as o,a as s,p as u,_ as w}; +import{K as e}from"./index-CEprPOh1.js";function o(r){return e.post("/cart/cart/create",r)}function s(r){return e.get("/cart/cart/list",{params:r})}function a(r){return e.post("/store_order/storeOrder/checkInventory",r)}function n(r){return e.post("/store_order/StoreOrder/checkOrder",r)}function i(r){return e.post("/cart/cart/delete",r)}function u(r){return e.post("/store_order/StoreOrder/createOrder",r)}function c(r){return e.post("/store_order/StoreOrder/pay",r)}function d(r){return e.get("/store_order/StoreOrder/lists",{params:r})}function p(r){return e.get("/user_product_storage_log/UserProductStorageLog/lists",{params:r})}function f(r){return e.get("/store_order/storeOrder/detail",{params:r})}function _(r){return e.get("/store_order/storeOrder/writeoff_list",{params:r})}function g(r){return e.post("/store_order/StoreOrder/writeoff_order",r)}function O(r){return e.post("/store_order/StoreOrder/checkSms",r)}function A(r){return e.get("/store_order/StoreOrder/print",{params:r})}function S(r){return e.get("/user_product_storage/UserProductStorage/lists",{params:r})}function l(r){return e.post("/user_product_storage/UserProductStorage/supply",r)}function m(r){return e.get("/store_order/StoreOrder/wechatQuery",{params:r})}function h(r){return e.post("/store_order/StoreOrder/noDelivery",r)}export{s as a,o as b,i as c,d,m as e,f,h as g,u as h,c as i,O as j,A as k,_ as l,S as m,l as n,n as o,a as s,p as u,g as w}; diff --git a/build/assets/test-BjN8X7hH.js b/build/assets/test-DygWT1QV.js similarity index 99% rename from build/assets/test-BjN8X7hH.js rename to build/assets/test-DygWT1QV.js index da87fa3..677cfdd 100644 --- a/build/assets/test-BjN8X7hH.js +++ b/build/assets/test-DygWT1QV.js @@ -1,4 +1,4 @@ -import{r as O,b as S,c as w,k as C,e as g,f as T,w as A,F as x,E as I,g as L}from"./index-B9unL6O8.js";var D={exports:{}};(function(j,M){(function(a,e){j.exports=e()})(window,function(){return function(h){var a={};function e(o){if(a[o])return a[o].exports;var d=a[o]={i:o,l:!1,exports:{}};return h[o].call(d.exports,d,d.exports,e),d.l=!0,d.exports}return e.m=h,e.c=a,e.d=function(o,d,f){e.o(o,d)||Object.defineProperty(o,d,{enumerable:!0,get:f})},e.r=function(o){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(o,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(o,"__esModule",{value:!0})},e.t=function(o,d){if(d&1&&(o=e(o)),d&8||d&4&&typeof o=="object"&&o&&o.__esModule)return o;var f=Object.create(null);if(e.r(f),Object.defineProperty(f,"default",{enumerable:!0,value:o}),d&2&&typeof o!="string")for(var b in o)e.d(f,b,(function(i){return o[i]}).bind(null,b));return f},e.n=function(o){var d=o&&o.__esModule?function(){return o.default}:function(){return o};return e.d(d,"a",d),d},e.o=function(o,d){return Object.prototype.hasOwnProperty.call(o,d)},e.p="",e(e.s=0)}({"./src/index.js":function(h,a,e){e.r(a),e("./src/sass/index.scss");var o=e("./src/js/init.js"),d=o.default.init;typeof window<"u"&&(window.printJS=d),a.default=d},"./src/js/browser.js":function(h,a,e){e.r(a);var o={isFirefox:function(){return typeof InstallTrigger<"u"},isIE:function(){return navigator.userAgent.indexOf("MSIE")!==-1||!!document.documentMode},isEdge:function(){return!o.isIE()&&!!window.StyleMedia},isChrome:function(){var f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window;return!!f.chrome},isSafari:function(){return Object.prototype.toString.call(window.HTMLElement).indexOf("Constructor")>0||navigator.userAgent.toLowerCase().indexOf("safari")!==-1},isIOSChrome:function(){return navigator.userAgent.toLowerCase().indexOf("crios")!==-1}};a.default=o},"./src/js/functions.js":function(h,a,e){e.r(a),e.d(a,"addWrapper",function(){return b}),e.d(a,"capitalizePrint",function(){return i}),e.d(a,"collectStyles",function(){return l}),e.d(a,"addHeader",function(){return n}),e.d(a,"cleanUp",function(){return u}),e.d(a,"isRawHTML",function(){return p});var o=e("./src/js/modal.js"),d=e("./src/js/browser.js");function f(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?f=function(c){return typeof c}:f=function(c){return c&&typeof Symbol=="function"&&c.constructor===Symbol&&c!==Symbol.prototype?"symbol":typeof c},f(t)}function b(t,s){var c="font-family:"+s.font+" !important; font-size: "+s.font_size+" !important; width:100%;";return'
'+t+"
"}function i(t){return t.charAt(0).toUpperCase()+t.slice(1)}function l(t,s){for(var c=document.defaultView||window,E="",y=c.getComputedStyle(t,""),m=0;m]*>(.*?)");return s.test(t)}},"./src/js/html.js":function(h,a,e){e.r(a);var o=e("./src/js/functions.js"),d=e("./src/js/print.js");function f(l){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?f=function(n){return typeof n}:f=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},f(l)}a.default={print:function(r,n){var u=i(r.printable)?r.printable:document.getElementById(r.printable);if(!u){window.console.error("Invalid HTML element id: "+r.printable);return}r.printableElement=b(u,r),r.header&&Object(o.addHeader)(r.printableElement,r),d.default.send(r,n)}};function b(l,r){for(var n=l.cloneNode(),u=Array.prototype.slice.call(l.childNodes),p=0;p"+t.documentTitle+"",t.css&&(Array.isArray(t.css)||(t.css=[t.css]),t.css.forEach(function(v){y.srcdoc+=''})),y.srcdoc+=""),t.type){case"pdf":if(o.default.isIE())try{console.info("Print.js doesn't support PDF printing in Internet Explorer.");var m=window.open(t.fallbackPrintable,"_blank");m.focus(),t.onIncompatibleBrowser()}catch(v){t.onError(v)}finally{t.showModal&&d.default.close(),t.onLoadingEnd&&t.onLoadingEnd()}else f.default.print(t,y);break;case"image":l.default.print(t,y);break;case"html":b.default.print(t,y);break;case"raw-html":i.default.print(t,y);break;case"json":r.default.print(t,y);break}}}},"./src/js/json.js":function(h,a,e){e.r(a);var o=e("./src/js/functions.js"),d=e("./src/js/print.js");function f(i){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?f=function(r){return typeof r}:f=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},f(i)}a.default={print:function(l,r){if(f(l.printable)!=="object")throw new Error("Invalid javascript data object (JSON).");if(typeof l.repeatTableHeader!="boolean")throw new Error("Invalid value for repeatTableHeader attribute (JSON).");if(!l.properties||!Array.isArray(l.properties))throw new Error("Invalid properties array for your JSON data.");l.properties=l.properties.map(function(n){return{field:f(n)==="object"?n.field:n,displayName:f(n)==="object"?n.displayName:n,columnSize:f(n)==="object"&&n.columnSize?n.columnSize+";":100/l.properties.length+"%;"}}),l.printableElement=document.createElement("div"),l.header&&Object(o.addHeader)(l.printableElement,l),l.printableElement.innerHTML+=b(l),d.default.send(l,r)}};function b(i){var l=i.printable,r=i.properties,n='';i.repeatTableHeader&&(n+=""),n+="";for(var u=0;u'+Object(o.capitalizePrint)(r[u].displayName)+"";n+="",i.repeatTableHeader&&(n+=""),n+="";for(var p=0;p";for(var t=0;t1)for(var E=0;E'+s+""}n+=""}return n+="
",n}},"./src/js/modal.js":function(h,a,e){e.r(a);var o={show:function(f){var b="font-family:sans-serif; display:table; text-align:center; font-weight:300; font-size:30px; left:0; top:0;position:fixed; z-index: 9990;color: #0460B5; width: 100%; height: 100%; background-color:rgba(255,255,255,.9);transition: opacity .3s ease;",i=document.createElement("div");i.setAttribute("style",b),i.setAttribute("id","printJS-Modal");var l=document.createElement("div");l.setAttribute("style","display:table-cell; vertical-align:middle; padding-bottom:100px;");var r=document.createElement("div");r.setAttribute("class","printClose"),r.setAttribute("id","printClose"),l.appendChild(r);var n=document.createElement("span");n.setAttribute("class","printSpinner"),l.appendChild(n);var u=document.createTextNode(f.modalMessage);l.appendChild(u),i.appendChild(l),document.getElementsByTagName("body")[0].appendChild(i),document.getElementById("printClose").addEventListener("click",function(){o.close()})},close:function(){var f=document.getElementById("printJS-Modal");f&&f.parentNode.removeChild(f)}};a.default=o},"./src/js/pdf.js":function(h,a,e){e.r(a);var o=e("./src/js/print.js"),d=e("./src/js/functions.js");a.default={print:function(i,l){if(i.base64){var r=Uint8Array.from(atob(i.printable),function(u){return u.charCodeAt(0)});f(i,l,r);return}i.printable=/^(blob|http|\/\/)/i.test(i.printable)?i.printable:window.location.origin+(i.printable.charAt(0)!=="/"?"/"+i.printable:i.printable);var n=new window.XMLHttpRequest;n.responseType="arraybuffer",n.addEventListener("error",function(){Object(d.cleanUp)(i),i.onError(n.statusText,n)}),n.addEventListener("load",function(){if([200,201].indexOf(n.status)===-1){Object(d.cleanUp)(i),i.onError(n.statusText,n);return}f(i,l,n.response)}),n.open("GET",i.printable,!0),n.send()}};function f(b,i,l){var r=new window.Blob([l],{type:"application/pdf"});r=window.URL.createObjectURL(r),i.setAttribute("src",r),o.default.send(b,i)}},"./src/js/print.js":function(h,a,e){e.r(a);var o=e("./src/js/browser.js"),d=e("./src/js/functions.js"),f={send:function(n,u){document.getElementsByTagName("body")[0].appendChild(u);var p=document.getElementById(n.frameId);p.onload=function(){if(n.type==="pdf"){o.default.isFirefox()?setTimeout(function(){return b(p,n)},1e3):b(p,n);return}var t=p.contentWindow||p.contentDocument;if(t.document&&(t=t.document),t.body.appendChild(n.printableElement),n.type!=="pdf"&&n.style){var s=document.createElement("style");s.innerHTML=n.style,t.head.appendChild(s)}var c=t.getElementsByTagName("img");c.length>0?i(Array.from(c)).then(function(){return b(p,n)}):b(p,n)}}};function b(r,n){try{if(r.focus(),o.default.isEdge()||o.default.isIE())try{r.contentWindow.document.execCommand("print",!1,null)}catch{r.contentWindow.print()}else r.contentWindow.print()}catch(u){n.onError(u)}finally{o.default.isFirefox()&&(r.style.visibility="hidden",r.style.left="-1px"),Object(d.cleanUp)(n)}}function i(r){var n=r.map(function(u){if(u.src&&u.src!==window.location.href)return l(u)});return Promise.all(n)}function l(r){return new Promise(function(n){var u=function p(){!r||typeof r.naturalWidth>"u"||r.naturalWidth===0||!r.complete?setTimeout(p,500):n()};u()})}a.default=f},"./src/js/raw-html.js":function(h,a,e){e.r(a);var o=e("./src/js/print.js");a.default={print:function(f,b){f.printableElement=document.createElement("div"),f.printableElement.setAttribute("style","width:100%"),f.printableElement.innerHTML=f.printable,o.default.send(f,b)}}},"./src/sass/index.scss":function(h,a,e){},0:function(h,a,e){h.exports=e("./src/index.js")}}).default})})(D);const B=g("h2",null,"小票标题",-1),U=g("p",null,"商品名称: 商品1",-1),R=g("p",null,"价格: ¥10.00",-1),W=g("p",null,"数量: 1",-1),H=g("p",null,"-------------------",-1),N=g("p",null,"总计: ¥10.00",-1),K=g("p",null,"-------------------",-1),z=[B,U,R,W,H,N,K],F={__name:"test",setup(j){const M=O(null),h=()=>{uni.getEnv(e=>{e.h5?I.error("请使用APP打印小票"):a()})},a=()=>{let e="";e+=`******************************** +import{r as O,b as S,c as w,k as C,e as g,f as T,w as A,F as x,E as I,g as L}from"./index-CEprPOh1.js";var D={exports:{}};(function(j,M){(function(a,e){j.exports=e()})(window,function(){return function(h){var a={};function e(o){if(a[o])return a[o].exports;var d=a[o]={i:o,l:!1,exports:{}};return h[o].call(d.exports,d,d.exports,e),d.l=!0,d.exports}return e.m=h,e.c=a,e.d=function(o,d,f){e.o(o,d)||Object.defineProperty(o,d,{enumerable:!0,get:f})},e.r=function(o){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(o,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(o,"__esModule",{value:!0})},e.t=function(o,d){if(d&1&&(o=e(o)),d&8||d&4&&typeof o=="object"&&o&&o.__esModule)return o;var f=Object.create(null);if(e.r(f),Object.defineProperty(f,"default",{enumerable:!0,value:o}),d&2&&typeof o!="string")for(var b in o)e.d(f,b,(function(i){return o[i]}).bind(null,b));return f},e.n=function(o){var d=o&&o.__esModule?function(){return o.default}:function(){return o};return e.d(d,"a",d),d},e.o=function(o,d){return Object.prototype.hasOwnProperty.call(o,d)},e.p="",e(e.s=0)}({"./src/index.js":function(h,a,e){e.r(a),e("./src/sass/index.scss");var o=e("./src/js/init.js"),d=o.default.init;typeof window<"u"&&(window.printJS=d),a.default=d},"./src/js/browser.js":function(h,a,e){e.r(a);var o={isFirefox:function(){return typeof InstallTrigger<"u"},isIE:function(){return navigator.userAgent.indexOf("MSIE")!==-1||!!document.documentMode},isEdge:function(){return!o.isIE()&&!!window.StyleMedia},isChrome:function(){var f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window;return!!f.chrome},isSafari:function(){return Object.prototype.toString.call(window.HTMLElement).indexOf("Constructor")>0||navigator.userAgent.toLowerCase().indexOf("safari")!==-1},isIOSChrome:function(){return navigator.userAgent.toLowerCase().indexOf("crios")!==-1}};a.default=o},"./src/js/functions.js":function(h,a,e){e.r(a),e.d(a,"addWrapper",function(){return b}),e.d(a,"capitalizePrint",function(){return i}),e.d(a,"collectStyles",function(){return l}),e.d(a,"addHeader",function(){return n}),e.d(a,"cleanUp",function(){return u}),e.d(a,"isRawHTML",function(){return p});var o=e("./src/js/modal.js"),d=e("./src/js/browser.js");function f(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?f=function(c){return typeof c}:f=function(c){return c&&typeof Symbol=="function"&&c.constructor===Symbol&&c!==Symbol.prototype?"symbol":typeof c},f(t)}function b(t,s){var c="font-family:"+s.font+" !important; font-size: "+s.font_size+" !important; width:100%;";return'
'+t+"
"}function i(t){return t.charAt(0).toUpperCase()+t.slice(1)}function l(t,s){for(var c=document.defaultView||window,E="",y=c.getComputedStyle(t,""),m=0;m]*>(.*?)");return s.test(t)}},"./src/js/html.js":function(h,a,e){e.r(a);var o=e("./src/js/functions.js"),d=e("./src/js/print.js");function f(l){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?f=function(n){return typeof n}:f=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},f(l)}a.default={print:function(r,n){var u=i(r.printable)?r.printable:document.getElementById(r.printable);if(!u){window.console.error("Invalid HTML element id: "+r.printable);return}r.printableElement=b(u,r),r.header&&Object(o.addHeader)(r.printableElement,r),d.default.send(r,n)}};function b(l,r){for(var n=l.cloneNode(),u=Array.prototype.slice.call(l.childNodes),p=0;p"+t.documentTitle+"",t.css&&(Array.isArray(t.css)||(t.css=[t.css]),t.css.forEach(function(v){y.srcdoc+=''})),y.srcdoc+=""),t.type){case"pdf":if(o.default.isIE())try{console.info("Print.js doesn't support PDF printing in Internet Explorer.");var m=window.open(t.fallbackPrintable,"_blank");m.focus(),t.onIncompatibleBrowser()}catch(v){t.onError(v)}finally{t.showModal&&d.default.close(),t.onLoadingEnd&&t.onLoadingEnd()}else f.default.print(t,y);break;case"image":l.default.print(t,y);break;case"html":b.default.print(t,y);break;case"raw-html":i.default.print(t,y);break;case"json":r.default.print(t,y);break}}}},"./src/js/json.js":function(h,a,e){e.r(a);var o=e("./src/js/functions.js"),d=e("./src/js/print.js");function f(i){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?f=function(r){return typeof r}:f=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},f(i)}a.default={print:function(l,r){if(f(l.printable)!=="object")throw new Error("Invalid javascript data object (JSON).");if(typeof l.repeatTableHeader!="boolean")throw new Error("Invalid value for repeatTableHeader attribute (JSON).");if(!l.properties||!Array.isArray(l.properties))throw new Error("Invalid properties array for your JSON data.");l.properties=l.properties.map(function(n){return{field:f(n)==="object"?n.field:n,displayName:f(n)==="object"?n.displayName:n,columnSize:f(n)==="object"&&n.columnSize?n.columnSize+";":100/l.properties.length+"%;"}}),l.printableElement=document.createElement("div"),l.header&&Object(o.addHeader)(l.printableElement,l),l.printableElement.innerHTML+=b(l),d.default.send(l,r)}};function b(i){var l=i.printable,r=i.properties,n='';i.repeatTableHeader&&(n+=""),n+="";for(var u=0;u'+Object(o.capitalizePrint)(r[u].displayName)+"";n+="",i.repeatTableHeader&&(n+=""),n+="";for(var p=0;p";for(var t=0;t1)for(var E=0;E'+s+""}n+=""}return n+="
",n}},"./src/js/modal.js":function(h,a,e){e.r(a);var o={show:function(f){var b="font-family:sans-serif; display:table; text-align:center; font-weight:300; font-size:30px; left:0; top:0;position:fixed; z-index: 9990;color: #0460B5; width: 100%; height: 100%; background-color:rgba(255,255,255,.9);transition: opacity .3s ease;",i=document.createElement("div");i.setAttribute("style",b),i.setAttribute("id","printJS-Modal");var l=document.createElement("div");l.setAttribute("style","display:table-cell; vertical-align:middle; padding-bottom:100px;");var r=document.createElement("div");r.setAttribute("class","printClose"),r.setAttribute("id","printClose"),l.appendChild(r);var n=document.createElement("span");n.setAttribute("class","printSpinner"),l.appendChild(n);var u=document.createTextNode(f.modalMessage);l.appendChild(u),i.appendChild(l),document.getElementsByTagName("body")[0].appendChild(i),document.getElementById("printClose").addEventListener("click",function(){o.close()})},close:function(){var f=document.getElementById("printJS-Modal");f&&f.parentNode.removeChild(f)}};a.default=o},"./src/js/pdf.js":function(h,a,e){e.r(a);var o=e("./src/js/print.js"),d=e("./src/js/functions.js");a.default={print:function(i,l){if(i.base64){var r=Uint8Array.from(atob(i.printable),function(u){return u.charCodeAt(0)});f(i,l,r);return}i.printable=/^(blob|http|\/\/)/i.test(i.printable)?i.printable:window.location.origin+(i.printable.charAt(0)!=="/"?"/"+i.printable:i.printable);var n=new window.XMLHttpRequest;n.responseType="arraybuffer",n.addEventListener("error",function(){Object(d.cleanUp)(i),i.onError(n.statusText,n)}),n.addEventListener("load",function(){if([200,201].indexOf(n.status)===-1){Object(d.cleanUp)(i),i.onError(n.statusText,n);return}f(i,l,n.response)}),n.open("GET",i.printable,!0),n.send()}};function f(b,i,l){var r=new window.Blob([l],{type:"application/pdf"});r=window.URL.createObjectURL(r),i.setAttribute("src",r),o.default.send(b,i)}},"./src/js/print.js":function(h,a,e){e.r(a);var o=e("./src/js/browser.js"),d=e("./src/js/functions.js"),f={send:function(n,u){document.getElementsByTagName("body")[0].appendChild(u);var p=document.getElementById(n.frameId);p.onload=function(){if(n.type==="pdf"){o.default.isFirefox()?setTimeout(function(){return b(p,n)},1e3):b(p,n);return}var t=p.contentWindow||p.contentDocument;if(t.document&&(t=t.document),t.body.appendChild(n.printableElement),n.type!=="pdf"&&n.style){var s=document.createElement("style");s.innerHTML=n.style,t.head.appendChild(s)}var c=t.getElementsByTagName("img");c.length>0?i(Array.from(c)).then(function(){return b(p,n)}):b(p,n)}}};function b(r,n){try{if(r.focus(),o.default.isEdge()||o.default.isIE())try{r.contentWindow.document.execCommand("print",!1,null)}catch{r.contentWindow.print()}else r.contentWindow.print()}catch(u){n.onError(u)}finally{o.default.isFirefox()&&(r.style.visibility="hidden",r.style.left="-1px"),Object(d.cleanUp)(n)}}function i(r){var n=r.map(function(u){if(u.src&&u.src!==window.location.href)return l(u)});return Promise.all(n)}function l(r){return new Promise(function(n){var u=function p(){!r||typeof r.naturalWidth>"u"||r.naturalWidth===0||!r.complete?setTimeout(p,500):n()};u()})}a.default=f},"./src/js/raw-html.js":function(h,a,e){e.r(a);var o=e("./src/js/print.js");a.default={print:function(f,b){f.printableElement=document.createElement("div"),f.printableElement.setAttribute("style","width:100%"),f.printableElement.innerHTML=f.printable,o.default.send(f,b)}}},"./src/sass/index.scss":function(h,a,e){},0:function(h,a,e){h.exports=e("./src/index.js")}}).default})})(D);const B=g("h2",null,"小票标题",-1),U=g("p",null,"商品名称: 商品1",-1),R=g("p",null,"价格: ¥10.00",-1),W=g("p",null,"数量: 1",-1),H=g("p",null,"-------------------",-1),N=g("p",null,"总计: ¥10.00",-1),K=g("p",null,"-------------------",-1),z=[B,U,R,W,H,N,K],F={__name:"test",setup(j){const M=O(null),h=()=>{uni.getEnv(e=>{e.h5?I.error("请使用APP打印小票"):a()})},a=()=>{let e="";e+=`******************************** `,e+=`泸优采-小票 `,e+=`单号: CG171565043141139102 `,e+=`测试商品1 * 1 1.00元 diff --git a/build/assets/user-DptWFEfy.js b/build/assets/user-DiHB_Leh.js similarity index 91% rename from build/assets/user-DptWFEfy.js rename to build/assets/user-DiHB_Leh.js index 5ca757a..e17b764 100644 --- a/build/assets/user-DptWFEfy.js +++ b/build/assets/user-DiHB_Leh.js @@ -1 +1 @@ -import{K as r}from"./index-B9unL6O8.js";function t(s){return r.post("/login/account",s)}function u(s){return r.get("/user/UserShip/lists",{params:s})}function i(s){return r.post("/user/user/add",s)}function n(s){return r.post("/user/user/archives_sms",s)}function a(s){return r.get("/user/user/lists",{params:s})}function o(s){return r.get("/user/user/detail",{params:s})}function p(s){return r.get("/user/Address/detail",{params:s})}function c(s){return r.post("/user/Address/edit",s)}function d(s){return r.post("/store_order/StoreOrder/rechange_amount",s)}function A(s){return r.post("/user/user/user_ship",s)}function f(s){return r.post("/user/User/recharge_list",s)}export{i as a,n as b,u as c,d,o as e,A as f,f as g,p as h,c as i,t as l,a as u}; +import{K as r}from"./index-CEprPOh1.js";function t(s){return r.post("/login/account",s)}function u(s){return r.get("/user/UserShip/lists",{params:s})}function i(s){return r.post("/user/user/add",s)}function n(s){return r.post("/user/user/archives_sms",s)}function a(s){return r.get("/user/user/lists",{params:s})}function o(s){return r.get("/user/user/detail",{params:s})}function p(s){return r.get("/user/Address/detail",{params:s})}function c(s){return r.post("/user/Address/edit",s)}function d(s){return r.post("/store_order/StoreOrder/rechange_amount",s)}function A(s){return r.post("/user/user/user_ship",s)}function f(s){return r.post("/user/User/recharge_list",s)}export{i as a,n as b,u as c,d,o as e,A as f,f as g,p as h,c as i,t as l,a as u}; diff --git a/build/index.html b/build/index.html index 8febe68..642fb44 100644 --- a/build/index.html +++ b/build/index.html @@ -56,7 +56,7 @@ } } - + diff --git a/src/api/store.js b/src/api/store.js index 68d4905..f730187 100644 --- a/src/api/store.js +++ b/src/api/store.js @@ -226,3 +226,10 @@ export function userProductStorageSupplyApi(data) { export function storeOrderQueryApi(data) { return request.get(`/store_order/StoreOrder/wechatQuery`, { params: data }) } + +/** + * @description 支付状态查询 + */ +export function storeNoDeliveryApi(data) { + return request.post(`/store_order/StoreOrder/noDelivery`, data) +} diff --git a/src/components/pay.vue b/src/components/pay.vue index d9b5768..e7498c6 100644 --- a/src/components/pay.vue +++ b/src/components/pay.vue @@ -349,8 +349,10 @@ const cashBnt = () => { +collection.value < +form.value.pay_price ) return ElMessage.error("收款金额应该大于等于应收金额"); - if (isRePay.value) orderPay(); - else + if (isRePay.value){ + orderPay(); + } else{ + collection.value='' orderCreateApi({ cart_id: cart_id.value, pay_type: "17", //现金支付 17 @@ -371,6 +373,9 @@ const cashBnt = () => { .catch((err) => { loading.value = false; }); + } + + }; // 监听键盘函数 diff --git a/src/views/saleOrder/component/detail.vue b/src/views/saleOrder/component/detail.vue index a3afee6..f055992 100644 --- a/src/views/saleOrder/component/detail.vue +++ b/src/views/saleOrder/component/detail.vue @@ -7,7 +7,8 @@ import { cartListApi, cashierinfoListApi, cashierinfoDetailsApi, - storeOrderQueryApi + storeOrderQueryApi, + storeNoDeliveryApi } from "@/api/store.js"; import { useUserStore } from "@/store/user.js"; import { ElMessage } from "element-plus"; @@ -65,11 +66,11 @@ const query = () => { storeOrderQueryApi({ 'order_no': formData.value.order_id }).then(res => { console.log(res) }) - }else{ + } else { ElMessage({ - message: '订单号不能为空', - type: "error", - }); + message: '订单号不能为空', + type: "error", + }); } }; @@ -148,7 +149,17 @@ const paySuccess = (data = null) => { }) }; - +const noDelivery = () => { + storeNoDeliveryApi({ id: formData.value.id }).then(res => { + ElMessage({ + message: res.msg, + type: "success", + }) + setTimeout(() => { + emit('rePaySuccess'); + }) + }) +} onMounted(() => { mitt.on("set-sale-order-detail", (res) => { console.log("===", res); @@ -213,6 +224,20 @@ onUnmounted(() => { 微信支付 +
+
+
+
是否退款:
+
+ {{ formData.refund_status_name }} +
+
+
+
退款金额:
+
+ ¥{{ formData.refund_price }} +
+
用户信息
@@ -255,6 +280,9 @@ onUnmounted(() => { 重新支付 查询支付
+