cashier-mer/build/assets/index-D-yXaBrM.js

2 lines
32 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import{u as ge,r as c,G as Ie,b as g,c as n,k as $,f as a,w as t,F as te,l as ie,d as R,E as D,_ as ke,o as $e,m as J,a as Ve,h as me,e,g as h,p as ee,i as Ee,j as he,z as de,t as k,q as we,s as Ce,J as He,n as pe,I as Qe}from"./index-BlCcmI7_.js";import{a as Se,b as Xe,c as Ye,u as Ze,d as Pe,e as Ne,f as el,g as ll,h as al,i as tl}from"./user-DIpwgLs2.js";import"./moment-Cl4UOzQZ.js";import{r as fe}from"./axiosAPI-DIkvDLxY.js";import{_ as je}from"./authCode-NUTHtb8P.js";import{g as sl,u as ol,k as il}from"./store-DWIWoU4r.js";import{p as nl}from"./padding-BSItkK4N.js";function Ue(x){return fe.get("/city",{params:x})}function xe(x){return fe.get("/area",{params:x})}function ze(x){return fe.get("/street",{params:x})}function Ae(x){return fe.get("/village",{params:x})}function Re(x){return fe.get("/brigade",{params:x})}const ul={class:"add-user"},dl={__name:"add",emits:["close"],setup(x,{expose:u,emit:w}){const L=ge(),F=c(null),r=Ie({mobile:"",code:"",real_name:"",user_ship:"",selectedValues:[]}),j=Ie({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"}]}),X=c([]),q=async(I,_)=>{const P=I.level;let V;if(P!==0&&!I.data.code)return _([]);P===0?(V=await Ue({province_code:51e4}),V=V.data.map(S=>({code:S.city_code,name:S.city_name}))):P===1?(V=await xe({city_code:I.data.code}),V=V.data.map(S=>({code:S.area_code,name:S.area_name}))):P===2?(V=await ze({area_code:I.data.code}),V=V.data.map(S=>({code:S.street_code,name:S.street_name}))):P===3?(V=await Ae({street_code:I.data.code}),V=V.data.map(S=>({code:S.village_code,name:S.village_name}))):P===4&&(V=await Re({village_code:I.data.code}),V=V.data.map(S=>({code:S.id,name:S.brigade_name,leaf:!0}))),_(V)},W={value:"code",label:"name",children:"children",multiple:!1,lazy:!0,lazyLoad:q},C=c([]);(()=>{Se({type_id:4}).then(I=>{var _;C.value=(_=I.data.lists)==null?void 0:_.filter(P=>P.id==0||P.id==4)})})();const O=w,E=()=>{F.value.validate(async I=>{if(I){let _={};_.mobile=r.mobile,_.code=r.code,_.user_ship=r.user_ship,_.real_name=r.real_name,_.province="510000",_.city=r.selectedValues[0],_.area=r.selectedValues[1],_.street=r.selectedValues[2],_.village=r.selectedValues[3],_.brigade=r.selectedValues[4],_.store_id=L.userInfo.store_id,Xe(_).then(P=>{r.mobile="",r.code="",r.user_ship="",r.real_name="",r.selectedValues=[],F.value.resetFields(),O("close")})}})},se=c(null),re=()=>{F.value.validateField("mobile",I=>{I&&Ye({mobile:r.mobile}).then(_=>{D.success("发送成功"),se.value.startCountDown()}).catch(_=>{D.error("发送失败")})})};return u({addUser:E}),(I,_)=>{const P=g("el-input"),V=g("el-form-item"),S=g("el-option"),G=g("el-select"),U=g("el-cascader"),d=g("el-form");return n(),$("div",ul,[a(d,{model:r,rules:j,ref_key:"formDataRef",ref:F,"label-width":"80px"},{default:t(()=>[a(V,{label:"用户电话",prop:"mobile"},{default:t(()=>[a(P,{modelValue:r.mobile,"onUpdate:modelValue":_[0]||(_[0]=f=>r.mobile=f),placeholder:"请输入用户电话"},null,8,["modelValue"])]),_:1}),a(V,{label:"验证码",prop:"code"},{default:t(()=>[a(P,{modelValue:r.code,"onUpdate:modelValue":_[1]||(_[1]=f=>r.code=f),placeholder:"请输入验证码",style:{flex:"1"}},null,8,["modelValue"]),a(je,{ref_key:"authCodeRef",ref:se,style:{"margin-left":"1rem"},onSendCode:re,start:!1},null,512)]),_:1}),a(V,{label:"用户姓名",prop:"real_name"},{default:t(()=>[a(P,{modelValue:r.real_name,"onUpdate:modelValue":_[2]||(_[2]=f=>r.real_name=f),placeholder:"请输入用户姓名"},null,8,["modelValue"])]),_:1}),a(V,{label:"用户类型",prop:"user_ship"},{default:t(()=>[a(G,{modelValue:r.user_ship,"onUpdate:modelValue":_[3]||(_[3]=f=>r.user_ship=f),placeholder:"请选择用户类型",style:{width:"100%"}},{default:t(()=>[(n(!0),$(te,null,ie(C.value,f=>(n(),R(S,{key:f.id,label:f.title,value:f.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),a(V,{label:"用户地址",prop:"selectedValues"},{default:t(()=>[a(U,{style:{width:"100%"},modelValue:r.selectedValues,"onUpdate:modelValue":_[4]||(_[4]=f=>r.selectedValues=f),options:X.value,props:W,load:q,class:"w-full"},null,8,["modelValue","options"])]),_:1})]),_:1},8,["model","rules"])])}}},Fe=x=>(we("data-v-a0be2eef"),x=x(),Ce(),x),rl={class:"my-order"},cl={class:"header-nav"},vl=Fe(()=>e("div",{class:"nav-item"},k("用户列表"),-1)),_l={class:"header-row"},pl=Fe(()=>e("div",{class:"label"},"用户类型",-1)),ml={class:"header-row"},fl=Fe(()=>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(x){const u=ge();c([]);const w=c({page_no:1,page_size:20,mobile:"",user_ship:"",street:null}),L=c(!1),F=c(0),r=c(0),j=c(!1),X=c([]),q=(U=!1)=>{if(U)w.value.page_no=1;else if(j.value||L.value)return;L.value=!0,w.value.mobile==""&&w.value.user_ship==""?w.value.store_id=u.userInfo.store_id:w.value.store_id=null,Ze(w.value).then(d=>{U?X.value=d.data.lists:X.value=[...X.value,...d.data.lists],w.value.page_no==1&&X.value.length>0&&J.emit("set-user-detail",X.value[0]),d.data.lists.length<w.value.page_size?j.value=!0:w.value.page_no++,r.value=0,F.value=d.data.count,L.value=!1}).catch(d=>{j.value=!0,L.value=!1})},W=(U,d)=>{r.value=d,J.emit("set-user-detail",U)},C=c(!1),z=c(null),O=()=>{var U;(U=z.value)==null||U.addUser()},E=()=>{C.value=!1,q(!0)},se=c([]);(()=>{Se({type_id:4}).then(U=>{se.value=U.data.lists})})();const I=()=>{w.value.mobile="",w.value.user_ship="",w.value.street=null,_.value=[],q(!0)},_=c([]),P=c([]),V=async(U,d)=>{const f=U.level;let p;if(f!==0&&!U.data.code)return d([]);f===0?(p=await Ue({province_code:51e4}),p=p.data.map(y=>({code:y.city_code,name:y.city_name}))):f===1?(p=await xe({city_code:U.data.code}),p=p.data.map(y=>({code:y.area_code,name:y.area_name}))):f===2?(p=await ze({area_code:U.data.code}),p=p.data.map(y=>({code:y.street_code,name:y.street_name,leaf:!0}))):f===3?(p=await Ae({street_code:U.data.code}),p=p.data.map(y=>({code:y.village_code,name:y.village_name}))):f===4&&(p=await Re({village_code:U.data.code}),p=p.data.map(y=>({code:y.id,name:y.brigade_name,leaf:!0}))),d(p)},S={value:"code",label:"name",children:"children",multiple:!1,lazy:!0,lazyLoad:V},G=()=>{_.value.length?w.value.street=_.value[_.value.length-1]:w.value.street="",q(!0)};return $e(()=>{J.on("re-load-user-list",U=>{U&&q(!0)})}),Ve(()=>{J.off("re-load-user-list")}),(U,d)=>{const f=g("Plus"),p=g("el-icon"),y=g("el-button"),Y=g("el-option"),K=g("el-select"),Z=g("el-cascader"),B=g("CircleClose"),ce=g("el-input"),ne=g("el-avatar"),oe=g("el-tag"),le=g("el-dialog"),i=me("loading"),m=me("infinite-scroll");return n(),$("div",rl,[e("div",cl,[vl,a(y,{type:"primary",onClick:d[0]||(d[0]=l=>C.value=!0)},{default:t(()=>[a(p,null,{default:t(()=>[a(f)]),_:1}),h(" 添加用户")]),_:1})]),e("div",_l,[pl,a(K,{modelValue:w.value.user_ship,"onUpdate:modelValue":d[1]||(d[1]=l=>w.value.user_ship=l),onChange:d[2]||(d[2]=l=>q(!0)),placeholder:"请选择用户类型",style:{flex:"1"}},{default:t(()=>[(n(!0),$(te,null,ie(se.value,l=>(n(),R(Y,{key:l.id,label:l.title,value:l.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue"]),a(y,{onClick:I,style:{"margin-left":"1rem"}},{default:t(()=>[h("重置")]),_:1})]),e("div",ml,[fl,a(Z,{style:{flex:"1"},options:P.value,modelValue:_.value,"onUpdate:modelValue":d[3]||(d[3]=l=>_.value=l),props:S,load:V,class:"w-full",onChange:G},null,8,["options","modelValue"])]),e("div",yl,[a(ce,{modelValue:w.value.mobile,"onUpdate:modelValue":d[6]||(d[6]=l=>w.value.mobile=l),placeholder:"搜索手机号",onKeydown:d[7]||(d[7]=Ee(l=>q(!0),["enter"])),onClear:d[8]||(d[8]=l=>q(!0))},{suffix:t(()=>[w.value.mobile!=""?(n(),R(p,{key:0,size:"18",onClick:d[4]||(d[4]=l=>{w.value.mobile="",q(!0)}),style:{cursor:"pointer","margin-right":"0.5rem"}},{default:t(()=>[a(B)]),_:1})):ee("",!0)]),append:t(()=>[a(y,{type:"primary",style:{"background-color":"#1890ff",color:"#fff","border-radius":"0 0.315rem 0.315rem 0"},onClick:d[5]||(d[5]=l=>q(!0))},{default:t(()=>[h("搜索")]),_:1})]),_:1},8,["modelValue"])]),he((n(),$("div",hl,[(n(!0),$(te,null,ie(X.value,(l,A)=>{var H;return n(),$("div",{class:de(["item",{"item-active":r.value==A}]),key:A,onClick:v=>W(l,A)},[a(ne,{class:"avatar",src:l.avatar},null,8,["src"]),e("div",bl,[e("div",kl,[e("div",$l,[e("span",Vl,k(l.real_name||l.nickname),1),e("span",null,k(" (ID:"+l.id+")"),1)]),e("div",null,"手机号: "+k(l.mobile),1)]),e("div",wl,[e("div",null,[h("余额: "),e("span",Cl,k(l.now_money),1)]),e("div",null,[h("采购款: "),e("span",Sl,k(l.purchase_funds),1)]),e("div",null,[h("返还金: "),e("span",Ul,k((H=l.return_money)==null?void 0:H.toFixed(2)),1)]),e("div",null,[h("礼品券: "),e("span",xl,k(l.integral),1)]),e("div",null,[l.user_ship==0||l.user_ship==4?(n(),R(oe,{key:0,type:"primary"},{default:t(()=>[h(k(l.user_ship_name),1)]),_:2},1024)):(n(),R(oe,{key:1,type:"success"},{default:t(()=>[h(k(l.user_ship_name),1)]),_:2},1024))])])])],10,gl)}),128)),j.value?(n(),$("div",zl,"没有更多了")):ee("",!0),L.value?(n(),$("div",Al,"加载中...")):ee("",!0)])),[[i,L.value],[m,q]]),a(le,{modelValue:C.value,"onUpdate:modelValue":d[10]||(d[10]=l=>C.value=l),title:"添加用户",width:"600"},{footer:t(()=>[e("div",Rl,[a(y,{onClick:d[9]||(d[9]=l=>C.value=!1)},{default:t(()=>[h("取消")]),_:1}),a(y,{type:"primary",onClick:O},{default:t(()=>[h(" 添加 ")]),_:1})])]),default:t(()=>[a(dl,{ref_key:"addRef",ref:z,onClose:E},null,512)]),_:1},8,["modelValue"])])}}},Ll=ke(Fl,[["__scopeId","data-v-a0be2eef"]]),ve=x=>(we("data-v-5ad4b8f5"),x=x(),Ce(),x),Ol=ve(()=>e("h4",null,"选择支付方式",-1)),Dl={class:"dra-body"},Il={class:"header"},Pl={style:{display:"inline-block"}},Nl=ve(()=>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=ve(()=>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=ve(()=>e("div",{class:"tips"},"按回车(Enter)确认支付",-1)),Yl={key:1,class:"balance"},Zl=ve(()=>e("div",null,"不够找零, 请支付更多金额",-1)),ea=ve(()=>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(x,{expose:u,emit:w}){const L=c(!1),F=c(1),r=c(""),j=c("");ge();const X=()=>{d()},q=()=>{pe(()=>{setTimeout(()=>{var m;f.value=!1,r.value="",I.value=!0,(m=j.value)==null||m.focus(),W(F.value)},300)})},W=m=>{m!=1&&j.value.blur(),F.value=m,console.log(F.value),F.value==2?window.addEventListener("keydown",ne):(window.removeEventListener("keydown",ne),pe(()=>{var l;r.value="",(l=j.value)==null||l.focus()}))},C=c({price:0,uid:"",user_ship:"",village:null,brigade:null}),z=c([]),O=c(!1),E=m=>{C.value=m.data,C.value.total=m.data.price,z.value=m.cart_id,O.value=m.isRePay||!1},se=m=>{C.value.total=m.price,S.value=m.order_id},re=w,I=c(!1),_=c(["1","2","3","4","5","6","7","8","9","0","00","."]),P=/^(10|11|12|13|14|15)\d{16}$/,V=/^(25|26|27|28|29|30)\d{14,22}$/,S=c(""),G=()=>{if(f.value=!0,j.value.blur(),O.value)U();else{let m;if(P.test(r.value))m="9";else if(V.test(r.value))m="13";else return f.value=!1,r.value="",j.value.focus(),D.error("请输入正确的支付码");Pe({uid:C.value.uid,user_ship:C.value.user_ship,village:C.value.village,brigade:C.value.brigade,price:C.value.price,pay_type:m,auth_code:r.value}).then(l=>{l.data.out_trade_no&&l.msg=="支付成功"?(L.value=!1,D({message:"支付成功",type:"success"}),d(l.data)):l.msg=="用户支付中"&&l.code==1&&(D.warning(l.msg),J.on("pay_user_success",A=>{D({message:"支付成功",type:"success"}),setTimeout(()=>{J.off("pay_user_success")},200),L.value=!1,d(A)}))}).catch(l=>{f.value=!1,pe(()=>{var A;(A=j.value)==null||A.focus()})})}},U=()=>{let m=17;if(F.value==1)if(P.test(r.value))m="9";else if(V.test(r.value))m="13";else return f.value=!1,r.value="",j.value.focus(),D.error("请输入正确的支付码");sl({order_id:C.value.order_id,pay_type:m,auth_code:r.value}).then(l=>{var A;(A=l.msg)!=null&&A.includes("成功")?(L.value=!1,D({message:"支付成功",type:"success"}),d({msg:"支付成功"})):l.msg=="用户支付中"&&l.code==1&&(D.warning(l.msg),J.on("pay_user_success",H=>{D({message:"支付成功",type:"success"}),setTimeout(()=>{J.off("pay_user_success")},200),L.value=!1,d(H)}))}).catch(l=>{r.value="",f.value=!1,pe(()=>{var A;(A=j.value)==null||A.focus()})})};c(0);const d=(m=null)=>{var l;window.removeEventListener("keydown",ne),I.value=!1,f.value=!1,r.value="",y.value="",p.value=[],(l=j.value)==null||l.blur(),typeof m=="function"&&(m=null),re("paySuccess",m),L.value=!1},f=c(!1);u({drawer:L,setForm:E,setRePay:se,beforeClose:d});const p=c([]),y=c(""),Y=He(()=>+y.value>0?(y.value-C.value.total).toFixed(2):-1),K=c(!1),Z=m=>{m===-1?p.value=[]:p.value.pop(),y.value=p.value.length?p.value.join(""):0},B=m=>{K.value===!1&&(y.value="",K.value=!0);let l=String(y.value).indexOf(".")+1,A=String(y.value).length-l;console.log(l,A),(l===0||A<2)&&(p.value.join("")<=9999999&&p.value.push(m),y.value=p.value.join("")>99999999?99999999:p.value.join(""))},ce=()=>{if(Y.value===""||Y.value===null||Y.value===void 0||+y.value<+C.value.total)return D.error("收款金额应该大于等于应收金额");O.value?U():Pe({uid:C.value.uid,user_ship:C.value.user_ship,village:C.value.village,brigade:C.value.brigade,price:C.value.price,pay_type:17}).then(m=>{console.log("========"),L.value=!1,D({message:m.msg,type:"success"}),F.value=1,d({msg:"收款成功"})}).catch(m=>{f.value=!1})},ne=m=>{let A=(m||window.event).keyCode;if(A==37)return W(2);if(A==120)return J.emit("F9");if(A==27)return d();switch(m.stopPropagation(),m.preventDefault(),A){case 96:case 48:B(0);break;case 97:case 49:B(1);break;case 98:case 50:B(2);break;case 99:case 51:B(3);break;case 100:case 52:B(4);break;case 101:case 53:B(5);break;case 102:case 54:B(6);break;case 103:case 55:B(7);break;case 104:case 56:B(8);break;case 105:case 57:B(9);break;case 110:B(".");break;case 190:B(".");break;case 8:Z();break;case 13:ce();break}},oe=c(!1),le=()=>{if(!(!L.value||oe.value&&r.value.length>0)&&F.value==2)return W(1)},i=()=>{if(!(!L.value||oe.value&&r.value.length>0)&&F.value==1)return W(2)};return $e(()=>{J.on("left",le),J.on("right",i)}),Ve(()=>{J.off("left",le),J.off("right",i)}),(m,l)=>{const A=g("el-input"),H=g("el-button"),v=g("Delete"),s=g("el-icon"),M=g("el-drawer"),N=me("loading");return n(),R(M,{size:"60rem",modelValue:L.value,"onUpdate:modelValue":l[6]||(l[6]=b=>L.value=b),direction:"rtl",onOpen:q,"before-close":d},{header:t(()=>[Ol]),default:t(()=>{var b;return[e("div",Dl,[e("div",Il,[e("div",{class:de(["left",{active:F.value==1}]),onClick:l[0]||(l[0]=Q=>W(1))}," 微信/支付宝 ",2),e("div",{class:de(["right",{active:F.value==2}]),onClick:l[1]||(l[1]=Q=>W(2))}," 现金收款 ",2)]),e("div",null,[e("div",Pl,[Nl,e("div",El,[h(" ¥"),e("span",jl,k((b=C.value)==null?void 0:b.price),1)])])]),F.value==1?he((n(),$("div",ql,[a(A,{ref_key:"codeRef",ref:j,modelValue:r.value,"onUpdate:modelValue":l[2]||(l[2]=Q=>r.value=Q),autofocus:"",class:"code-input",placeholder:"请点击输入框聚焦扫码或输入编码号",onKeyup:Ee(G,["enter"]),onFocus:l[3]||(l[3]=Q=>oe.value=!0),onBlur:l[4]||(l[4]=Q=>oe.value=!1)},null,8,["modelValue"]),Bl])),[[N,f.value]]):(n(),$("div",Jl,[e("div",Tl,[e("div",Kl,[e("div",Ml,[y.value?(n(),$("span",Wl,k(y.value),1)):(n(),$("span",Gl,"按下键盘输入客户支付金额"))]),Y.value>=0?(n(),$("div",Hl,[e("div",null,[h(" 需找零(元)"),e("span",Ql,"¥"+k(Y.value),1)]),Xl])):(n(),$("div",Yl,la)),e("div",aa,[e("div",ta,[(n(!0),$(te,null,ie(_.value,Q=>(n(),R(H,{key:Q,onClick:be=>B(Q)},{default:t(()=>[h(k(Q),1)]),_:2},1032,["onClick"]))),128))]),e("div",sa,[a(H,{onClick:Z},{default:t(()=>[a(s,null,{default:t(()=>[a(v)]),_:1})]),_:1}),a(H,{onClick:l[5]||(l[5]=Q=>Z(-1))},{default:t(()=>[h("C")]),_:1}),a(H,{class:de(["enter",{"enter-disable":+y.value<+C.value.total}]),disabled:+y.value<+C.value.total,onClick:ce},{default:t(()=>[h(" 确认 ")]),_:1},8,["class","disabled"])])])])])]))])]}),footer:t(()=>[e("div",oa,[a(H,{class:"cancel-btn",onClick:X},{default:t(()=>[h("取消收款")]),_:1})])]),_:1},8,["modelValue"])}}},na=ke(ia,[["__scopeId","data-v-5ad4b8f5"]]),T=x=>(we("data-v-80ac9503"),x=x(),Ce(),x),ua={class:"my-order"},da={class:"header-nav"},ra=["onClick"],ca={key:0,class:"detail"},va={class:"table"},_a=T(()=>e("div",{class:"table-title"},"用户信息",-1)),pa={class:"table-info"},ma={class:"info-item"},fa=T(()=>e("div",{class:"info-item-title"},"用户余额:",-1)),ya={class:"info-item-info red"},ha={class:"info-item"},ga=T(()=>e("div",{class:"info-item-title"},"采购款:",-1)),ba={class:"info-item-info red"},ka={class:"info-item"},$a=T(()=>e("div",{class:"info-item-title"},"返还金:",-1)),Va={class:"info-item-info red"},wa={class:"info-item"},Ca=T(()=>e("div",{class:"info-item-title"},"头像:",-1)),Sa={class:"info-item-info"},Ua={class:"info-item"},xa=T(()=>e("div",{class:"info-item-title"},"礼品券:",-1)),za={class:"info-item-info red"},Aa={class:"info-item"},Ra=T(()=>e("div",{class:"info-item-title"},"冻结礼品券:",-1)),Fa={class:"info-item-info red"},La={class:"info-item"},Oa=T(()=>e("div",{class:"info-item-title"},"ID:",-1)),Da={class:"info-item-info"},Ia={class:"info-item"},Pa=T(()=>e("div",{class:"info-item-title"},"用户昵称:",-1)),Na={class:"info-item-info"},Ea={class:"info-item"},ja=T(()=>e("div",{class:"info-item-title"},"用户电话:",-1)),qa={class:"info-item-info"},Ba={class:"info-item"},Ja=T(()=>e("div",{class:"info-item-title"},"用户账号:",-1)),Ta={class:"info-item-info"},Ka={class:"info-item"},Ma=T(()=>e("div",{class:"info-item-title"},"真实姓名:",-1)),Wa={class:"info-item-info"},Ga={class:"info-item"},Ha=T(()=>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=T(()=>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=T(()=>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"},pt=["onClick"],mt={class:"item1"},ft={class:"item2"},yt={class:"dialog-footer"},ht={__name:"detail",setup(x){ge(),Qe();const u=c({id:""});c({price:"",type:1});const w=c(null),L=(v=null)=>{oe()},F=c(!1),r=c([]);(()=>{Se({type_id:4}).then(v=>{r.value=v.data.lists})})();const X=()=>{el({id:u.value.id,user_ship:u.value.user_ship}).then(v=>{var s;D.success("修改成功"),u.value.user_ship_name=(s=r.value.find(M=>M.id==u.value.user_ship))==null?void 0:s.title,F.value=!1})},q=()=>{F.value=!1},W=c([]);(()=>{ll().then(v=>{W.value=v.data,console.log(v)})})();const z=c({id:"",province:"",city:"",area:"",street:"",brigade:""}),O=c([]),E=c([]),se=()=>{al({uid:u.value.id}).then(v=>{var s;(s=v.data)!=null&&s.village?(O.value=[v.data.city,v.data.area,v.data.street,v.data.village,+v.data.brigade],E.value=JSON.parse(JSON.stringify(O.value)),z.value=v.data):(O.value=[],E.value=[],z.value={id:"",province:"",city:"",area:"",street:"",brigade:""})}).catch(v=>{O.value=[],E.value=[],z.value={id:"",province:"",city:"",area:"",street:"",brigade:""}})},re=c([]),I=async(v,s)=>{const M=v.level;let N;if(M!==0&&!v.data.code)return s([]);M===0?(N=await Ue({province_code:51e4}),N=N.data.map(b=>({code:b.city_code,name:b.city_name}))):M===1?(N=await xe({city_code:v.data.code}),N=N.data.map(b=>({code:b.area_code,name:b.area_name}))):M===2?(N=await ze({area_code:v.data.code}),N=N.data.map(b=>({code:b.street_code,name:b.street_name}))):M===3?(N=await Ae({street_code:v.data.code}),N=N.data.map(b=>({code:b.village_code,name:b.village_name}))):M===4&&(N=await Re({village_code:v.data.code}),N=N.data.map(b=>({code:b.id,name:b.brigade_name,leaf:!0}))),s(N)},_={value:"code",label:"name",children:"children",multiple:!1,lazy:!0,lazyLoad:I},P=async()=>{z.value.city=O.value[0],z.value.area=O.value[1],z.value.street=O.value[2],z.value.village=O.value[3],z.value.brigade=O.value[4],z.value.phone||(z.value.phone=u.value.account),z.value.real_name||(z.value.real_name=u.value.real_name||u.value.nickname),tl({...z.value,uid:u.value.id}).then(v=>{E.value=JSON.parse(JSON.stringify(O.value)),D.success("编辑成功"),S.value=!0}).catch(v=>{V()})},V=()=>{O.value=JSON.parse(JSON.stringify(E.value)),E.value.length>0&&(z.value.city=E.value[0],z.value.area=E.value[1],z.value.street=E.value[2],z.value.village=E.value[3],z.value.brigade=E.value[4]),S.value=!0},S=c(!0),G=c(0),U=c(["基本信息","用户资产"]),d=c(!1),f=c([]),p=c({page_no:1,page_size:10,loading:!1,loadend:!1});let y=[];const Y=(v=!1)=>{v&&(f.value=[],p.value.page_no=1,p.value.loadend=!1),!(p.value.loadend||p.value.loading)&&(p.value.loading=!0,ol({uid:u.value.id,page_no:p.value.page_no,page_size:p.value.page_size}).then(s=>{f.value=[...f.value,...s.data.lists],p.value.loading=!1,p.value.page_no++,s.data.lists.length<p.value.page_size&&(p.value.loadend=!0)}))},K=c({mobile:"",code:""}),Z=c(!1),B=()=>{if(K.value.mobile=u.value.phone,K.value.code="",y=f.value.filter(v=>v.n_num).map(v=>({product_id:v.product_id,nums:v.n_num})),y.length==0)return D.error("请选择商品");Z.value=!0},ce=()=>{console.log("发送短信验证码"),D.success("验证码已发送")},ne=()=>{if(K.value.code=="")return D.error("请输入验证码");il({uid:u.value.id,info:y}).then(v=>{d.value=!1,D.success("出库成功"),Z.value=!1,Y(!0)})},oe=()=>{Ne({id:u.value.id}).then(({data:v})=>{v.phone=v.mobile+"",delete v.mobile,u.value=Object.assign(u.value,v)})},le=c(!1),i=c({user_ship:"",user_ship_name:"",limit:"",money:"",type:""}),m=()=>{i.value.money=Number(i.value.money).toFixed(2),(+i.value.money<+i.value.limit||+i.value.money>1e4)&&(+i.value.limit>0?i.value.money=i.value.limit:i.value.money="")},l=v=>{if(i.value.type=="add"){let s=r.value.find(M=>M.id==v);s&&(i.value.limit=s.limit,i.value.user_ship_name=s.title,i.value.money=s.limit)}},A=()=>{if(i.value.user_ship===""||i.value.user_ship===null||i.value.user_ship===void 0||i.value.user_ship===0||i.value.user_ship===4)return D.error("请选择会员类型");if(i.value.money==0||i.value.money=="")return D.error(i.value.type=="add"?"请输入充值金额":"请选择金额");if(i.value.type=="add"&&(+i.value.money<+i.value.limit||+i.value.money>1e4))return+i.value.limit>0?i.value.money=i.value.limit:i.value.money="",D.error(`该类型至少需要充值${i.value.limit}`);w.value.setForm({data:{uid:u.value.id,price:i.value.money,user_ship:i.value.user_ship,village:z.value.village,brigade:z.value.brigade}}),w.value.drawer=!0,pe(()=>{le.value=!1})},H=v=>{if(E.value.length==0)return D.error("请先选择用户地址");i.value.type=v,v=="add"&&(i.value.user_ship=u.value.user_ship,i.value.user_ship_name=u.value.user_ship_name,l(i.value.user_ship)),le.value=!0};return $e(()=>{J.on("set-user-detail",v=>{u.value=v,d.value=!1,Ne({id:u.value.id}).then(({data:s})=>{s.phone=s.mobile+"",delete s.mobile,u.value=Object.assign(v,s)}),O.value=[],E.value=[],se(),Y(!0),i.value={user_ship:"",user_ship_name:"",limit:"",money:"",type:""}})}),Ve(()=>{J.off("set-user-detail")}),(v,s)=>{var De;const M=g("el-avatar"),N=g("el-tag"),b=g("el-button"),Q=g("el-option"),be=g("el-select"),qe=g("el-cascader"),Be=g("el-image"),ye=g("el-table-column"),Je=g("el-input-number"),Te=g("el-table"),Ke=g("el-empty"),_e=g("el-input"),ue=g("el-form-item"),Le=g("el-form"),Oe=g("el-dialog"),Me=me("infinite-scroll"),We=me("loading");return n(),$("div",ua,[e("div",da,[(n(!0),$(te,null,ie(U.value,(o,ae)=>(n(),$("div",{key:ae,class:de(["nav-item",{"nav-item-active":G.value==ae,"nav-item-radius1":G.value==ae+1,"nav-item-radius2":G.value==ae-1}]),onClick:Ge=>G.value=ae},k(o),11,ra))),128)),e("div",{class:de(["nav-item",{"nav-item-radius2":G.value==U.value.length-1}]),style:{flex:"1"}},null,2)]),u.value.id&&G.value==0?(n(),$("div",ca,[e("div",va,[_a,e("div",pa,[e("div",ma,[fa,e("div",ya,"¥"+k(u.value.now_money),1)]),e("div",ha,[ga,e("div",ba,"¥"+k(u.value.purchase_funds),1)]),e("div",ka,[$a,e("div",Va,"¥"+k((De=u.value.return_money)==null?void 0:De.toFixed(2)),1)]),e("div",wa,[Ca,e("div",Sa,[a(M,{style:{width:"4rem",height:"4rem"},src:u.value.avatar},null,8,["src"])])]),e("div",Ua,[xa,e("div",za,"¥"+k(u.value.integral),1)]),e("div",Aa,[Ra,e("div",Fa,"¥"+k(u.value.get_frozen),1)]),e("div",La,[Oa,e("div",Da,k(u.value.id),1)]),e("div",Ia,[Pa,e("div",Na,k(u.value.nickname),1)]),e("div",Ea,[ja,e("div",qa,k(u.value.phone),1)]),e("div",Ba,[Ja,e("div",Ta,k(u.value.account),1)]),e("div",Ka,[Ma,e("div",Wa,k(u.value.real_name),1)]),e("div",Ga,[Ha,e("div",Qa,k(u.value.create_time),1)]),e("div",Xa,[Ya,e("div",Za,[F.value==!1?(n(),$(te,{key:0},[u.value.user_ship==0||u.value.user_ship==4?(n(),R(N,{key:0,type:"primary",size:"large"},{default:t(()=>[h(k(u.value.user_ship_name),1)]),_:1})):(n(),R(N,{key:1,type:"success",size:"large"},{default:t(()=>[h(k(u.value.user_ship_name),1)]),_:1})),u.value.user_ship==0||u.value.user_ship==4?(n(),R(b,{key:2,type:"primary",style:{"margin-left":"1rem"},onClick:s[0]||(s[0]=o=>F.value=!0)},{default:t(()=>[h("修改")]),_:1})):ee("",!0)],64)):(n(),$(te,{key:1},[a(be,{modelValue:u.value.user_ship,"onUpdate:modelValue":s[1]||(s[1]=o=>u.value.user_ship=o),placeholder:"请选择用户类型",style:{width:"10rem"}},{default:t(()=>[(n(!0),$(te,null,ie(r.value,o=>(n(),R(Q,{key:o.id,label:o.title,value:o.id,disabled:o.id!=0&&o.id!=4},null,8,["label","value","disabled"]))),128))]),_:1},8,["modelValue"]),a(b,{type:"primary",style:{"margin-left":"1rem"},onClick:X},{default:t(()=>[h("确认")]),_:1}),a(b,{style:{"margin-left":"1rem"},onClick:q},{default:t(()=>[h("取消")]),_:1})],64))])]),e("div",et,[lt,(n(),R(qe,{key:u.value.id,style:{flex:"1"},modelValue:O.value,"onUpdate:modelValue":s[2]||(s[2]=o=>O.value=o),options:re.value,props:_,load:I,class:"w-full",disabled:S.value},null,8,["modelValue","options","disabled"])),S.value&&!E.value.length?(n(),R(b,{key:0,type:"primary",style:{"margin-left":"1rem"},onClick:s[3]||(s[3]=o=>S.value=!1)},{default:t(()=>[h("修改")]),_:1})):ee("",!0),S.value?ee("",!0):(n(),R(b,{key:1,type:"primary",style:{"margin-left":"1rem"},onClick:P},{default:t(()=>[h("确认")]),_:1})),S.value?ee("",!0):(n(),R(b,{key:2,style:{"margin-left":"1rem"},onClick:V},{default:t(()=>[h("取消")]),_:1}))]),u.value.user_ship!=0&&u.value.user_ship!=4?(n(),R(b,{key:0,type:"success",class:"big-btn",size:"large",onClick:s[4]||(s[4]=o=>H("add"))},{default:t(()=>[h("增加经营资金")]),_:1})):(n(),R(b,{key:1,type:"primary",class:"big-btn",size:"large",onClick:s[5]||(s[5]=o=>H("recharge"))},{default:t(()=>[h("成为会员")]),_:1}))])])])):ee("",!0),u.value.id&&G.value==1?he((n(),$("div",at,[he((n(),$("div",tt,[a(Te,{data:f.value},{default:t(()=>[a(ye,{label:"商品信息"},{default:t(({row:o})=>[e("div",st,[a(Be,{style:{height:"3rem",width:"3rem","flex-shrink":"0"},src:o.image},null,8,["src"]),e("span",ot,k(o.store_name),1)])]),_:1}),a(ye,{prop:"price",label:"单价",width:d.value?130:200},null,8,["width"]),a(ye,{prop:"nums",label:"存量",width:d.value?100:200},null,8,["width"]),d.value?(n(),R(ye,{key:0,prop:"nums",label:"出库量",width:"250"},{default:t(({row:o})=>[o.nums?(n(),$("div",it,[a(Je,{modelValue:o.n_num,"onUpdate:modelValue":ae=>o.n_num=ae,"step-strictly":"",min:0,max:o.nums},null,8,["modelValue","onUpdate:modelValue","max"]),a(b,{type:"primary",style:{"margin-left":"1rem"},onClick:ae=>o.n_num=o.nums},{default:t(()=>[h("全部")]),_:2},1032,["onClick"])])):ee("",!0)]),_:1})):ee("",!0)]),_:1},8,["data"])])),[[Me,Y]]),e("div",nt,[d.value?(n(),$("div",dt,[a(b,{type:"primary",size:"large",onClick:B},{default:t(()=>[h("确认出库")]),_:1}),a(b,{size:"large",onClick:s[7]||(s[7]=o=>d.value=!1)},{default:t(()=>[h("取消")]),_:1})])):(n(),$("div",ut,[a(b,{type:"warning",size:"large",onClick:s[6]||(s[6]=o=>d.value=!0),disabled:f.value.length==0},{default:t(()=>[h("商品出库")]),_:1},8,["disabled"])]))])])),[[We,p.value.loading]]):(n(),$("div",rt,[a(Ke)])),a(na,{ref_key:"payRef",ref:w,onPaySuccess:L},null,512),a(Oe,{modelValue:Z.value,"onUpdate:modelValue":s[11]||(s[11]=o=>Z.value=o),title:"出库验证",width:"500"},{footer:t(()=>[e("div",ct,[a(b,{onClick:s[10]||(s[10]=o=>Z.value=!1)},{default:t(()=>[h("取消")]),_:1}),a(b,{type:"primary",onClick:ne},{default:t(()=>[h(" 确认 ")]),_:1})])]),default:t(()=>[a(Le,{model:K.value},{default:t(()=>[a(ue,{label:"手机号:"},{default:t(()=>[a(_e,{modelValue:K.value.mobile,"onUpdate:modelValue":s[8]||(s[8]=o=>K.value.mobile=o),autocomplete:"off",readonly:""},null,8,["modelValue"])]),_:1}),a(ue,{label:"验证码:"},{default:t(()=>[a(_e,{modelValue:K.value.code,"onUpdate:modelValue":s[9]||(s[9]=o=>K.value.code=o),autocomplete:"off",placeholder:"请输入验证码",style:{flex:"1"}},null,8,["modelValue"]),(n(),R(je,{style:{"margin-left":"1rem"},onSendCode:ce,key:K.value.mobile}))]),_:1})]),_:1},8,["model"])]),_:1},8,["modelValue"]),a(Oe,{modelValue:le.value,"onUpdate:modelValue":s[18]||(s[18]=o=>le.value=o),title:i.value.type=="add"?"增加经营资金":"成为会员",width:"500"},{footer:t(()=>[e("div",yt,[a(b,{onClick:s[17]||(s[17]=o=>le.value=!1)},{default:t(()=>[h("取消")]),_:1}),a(b,{type:"primary",onClick:A},{default:t(()=>[h(" 确认 ")]),_:1})])]),default:t(()=>[a(Le,{model:i.value,"label-width":"100px"},{default:t(()=>[a(ue,{label:"手机号:"},{default:t(()=>[a(_e,{modelValue:u.value.phone,"onUpdate:modelValue":s[12]||(s[12]=o=>u.value.phone=o),autocomplete:"off",readonly:""},null,8,["modelValue"])]),_:1}),i.value.type=="add"?(n(),R(ue,{key:0,label:"会员类型:"},{default:t(()=>[a(_e,{modelValue:i.value.user_ship_name,"onUpdate:modelValue":s[13]||(s[13]=o=>i.value.user_ship_name=o),autocomplete:"off",readonly:""},null,8,["modelValue"])]),_:1})):(n(),R(ue,{key:1,label:"会员类型:",required:""},{default:t(()=>[a(be,{modelValue:i.value.user_ship,"onUpdate:modelValue":s[14]||(s[14]=o=>i.value.user_ship=o),placeholder:"请选择用户类型",style:{flex:"1"},onChange:l},{default:t(()=>[(n(!0),$(te,null,ie(r.value,o=>(n(),R(Q,{key:o.id,label:o.title,value:o.id,disabled:o.id==0||o.id==4},null,8,["label","value","disabled"]))),128))]),_:1},8,["modelValue"])]),_:1})),i.value.type=="add"?(n(),R(ue,{key:2,label:"充值金额:",required:""},{default:t(()=>[a(_e,{modelValue:i.value.money,"onUpdate:modelValue":s[15]||(s[15]=o=>i.value.money=o),type:"number",onBlur:m,onFocus:s[16]||(s[16]=o=>i.value.money=""),autocomplete:"off"},{prepend:t(()=>[h("¥")]),append:t(()=>[h("元")]),_:1},8,["modelValue"]),i.value.limit?(n(),$("div",vt,k(`${i.value.user_ship_name}角色至少要充值${i.value.limit}元, 最大不超过10000元`),1)):ee("",!0)]),_:1})):(n(),R(ue,{key:3,label:"充值金额:",required:""},{default:t(()=>[e("div",_t,[(n(!0),$(te,null,ie(W.value,(o,ae)=>(n(),$("div",{class:de(["ship-money-item",{"ship-money-item-active":o.money==i.value.money}]),onClick:Ge=>i.value.money=o.money,key:ae},[e("div",mt,k(o.money)+k(o.money_string),1),e("div",ft,"送"+k(o.send)+k(o.send_string),1)],10,pt))),128))])]),_:1}))]),_:1},8,["model"])]),_:1},8,["modelValue","title"])])}}},gt=ke(ht,[["__scopeId","data-v-80ac9503"]]),bt={class:"my-card"},xt={__name:"index",setup(x){return(u,w)=>(n(),$("div",bt,[a(Ll,{style:{"flex-shrink":"0"},ref:"orderRef"},null,512),a(nl),a(gt,{ref:"detailRef"},null,512)]))}};export{xt as default};