This commit is contained in:
weipengfei 2024-04-11 15:32:40 +08:00
parent 59efc8d420
commit c0f55c1efd
28 changed files with 424 additions and 41 deletions

File diff suppressed because one or more lines are too long

1
dist/assets/index-4etrSz2S.js vendored Normal file

File diff suppressed because one or more lines are too long

1
dist/assets/index-B8nV3YhQ.css vendored Normal file
View File

@ -0,0 +1 @@
@charset "UTF-8";.dra-body[data-v-b7248a11]{width:100%;display:flex;flex-direction:column;text-align:center}[data-v-b7248a11] .el-upload--picture-card{--el-upload-picture-card-size: 60px !important}[data-v-b7248a11] .el-upload-list--picture-card .el-upload-list__item{height:60px!important;width:60px!important}.my-shop[data-v-497050df]{background-color:#fff;border-radius:1.2rem;box-sizing:border-box;padding:1rem;overflow-y:scroll}[data-v-497050df]::-webkit-scrollbar{width:5px}[data-v-497050df]::-webkit-scrollbar-track{background-color:#f1f1f1;margin:20px 0}[data-v-497050df]::-webkit-scrollbar-thumb{background-color:#ccc;border-radius:5px}[data-v-497050df]::-webkit-scrollbar-thumb:hover{background-color:#999}.el-menu--horizontal[data-v-497050df]{height:2.5rem}.el-form--inline .el-form-item[data-v-497050df]{margin-right:1rem}

1
dist/assets/index-CHQ1r-Oq.js vendored Normal file

File diff suppressed because one or more lines are too long

1
dist/assets/index-CzH39hkF.js vendored Normal file
View File

@ -0,0 +1 @@
import{o as r,d as o}from"./detail-BB6Kd3Ns.js";import{p as t}from"./padding-DgRc53vd.js";import{c as a,h as s,f as e}from"./index-DG0Cmpzz.js";import"./pay-hmX8FyfK.js";const c={class:"my-card"},_={__name:"index",setup(d){return(l,n)=>(a(),s("div",c,[e(r,{style:{"flex-shrink":"0"},ref:"orderRef"},null,512),e(t),e(o,{ref:"detailRef"},null,512)]))}};export{_ as default};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1 +0,0 @@
import{o as r,d as o}from"./detail-B1GiYJo4.js";import{p as t}from"./padding-CHwe9gtr.js";import{c as a,h as s,f as e}from"./index-ewPIg6Mj.js";import"./pay-BdASyvsQ.js";const c={class:"my-card"},_={__name:"index",setup(d){return(l,n)=>(a(),s("div",c,[e(r,{style:{"flex-shrink":"0"},ref:"orderRef"},null,512),e(t),e(o,{ref:"detailRef"},null,512)]))}};export{_ as default};

View File

@ -1 +1 @@
import{b as t,c,h as a,e,f as o,w as d,g as l}from"./index-ewPIg6Mj.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"}},h=e("div",{style:{"font-size":"5rem","font-weight":"bold"}},"404",-1),p=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,[h,p,o(i,{type:"primary",onClick:s},{default:d(()=>[l("返回首页")]),_:1})])])])}}};export{v as default};
import{b as t,c,h as a,e,f as o,w as d,g as l}from"./index-DG0Cmpzz.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"}},h=e("div",{style:{"font-size":"5rem","font-weight":"bold"}},"404",-1),p=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,[h,p,o(i,{type:"primary",onClick:s},{default:d(()=>[l("返回首页")]),_:1})])])])}}};export{v as default};

View File

@ -1 +1 @@
import{_ as U,u as I,r as u,o as R,b as n,c as S,h as b,e as w,f as e,w as t,p as v,g as C,y as K,z as L,C as B,E as d,J as E,K as N}from"./index-ewPIg6Mj.js";const M=l=>(K("data-v-59a7e82c"),l=l(),L(),l),T={class:"body"},z={class:"login"},J=M(()=>w("div",{class:"title"},"里海收银系统 - 登录",-1)),$={__name:"index",setup(l){const p=I(),y=B(),h=u(null),_=u(null),s=u({account:"",password:"",key:"",captchaVerification:"",code:""}),i=()=>{if(!s.value.account)return d({message:"请填写账号",type:"error"});if(!s.value.password)return d({message:"请填写密码",type:"error"});E(s.value).then(a=>{console.log(a),a.data&&(p.setToken(a.data.token),N().then(({data:o})=>{if(!o.service)return d({message:"请联系管理员开通服务",type:"error"});p.setUserInfo(o),y.push("/")}))}).catch(a=>{})};return R(()=>{}),(a,o)=>{const g=n("User"),f=n("el-icon"),m=n("el-input"),c=n("el-form-item"),k=n("Lock"),V=n("el-button"),x=n("el-form");return S(),b("div",T,[w("div",z,[J,e(x,null,{default:t(()=>[e(c,null,{default:t(()=>[e(m,{ref_key:"accRef",ref:h,modelValue:s.value.account,"onUpdate:modelValue":o[0]||(o[0]=r=>s.value.account=r),placeholder:"请输入账号",autofocus:!0,onKeydown:o[1]||(o[1]=v(r=>_.value.focus(),["enter"]))},{prefix:t(()=>[e(f,null,{default:t(()=>[e(g)]),_:1})]),_:1},8,["modelValue"])]),_:1}),e(c,null,{default:t(()=>[e(m,{ref_key:"pwdRef",ref:_,modelValue:s.value.password,"onUpdate:modelValue":o[2]||(o[2]=r=>s.value.password=r),type:"password",placeholder:"请输入密码","show-password":"",onKeydown:v(i,["enter"])},{prefix:t(()=>[e(f,null,{default:t(()=>[e(k)]),_:1})]),_:1},8,["modelValue"])]),_:1}),e(c,null,{default:t(()=>[e(V,{style:{width:"100%"},type:"primary",onClick:i},{default:t(()=>[C("登录")]),_:1})]),_:1})]),_:1})])])}}},q=U($,[["__scopeId","data-v-59a7e82c"]]);export{q as default};
import{_ as U,u as I,r as u,o as L,b as n,c as R,h as S,e as w,f as e,w as t,p as v,g as b,y as C,z as K,C as B,E as d,K as E,L as N}from"./index-DG0Cmpzz.js";const M=l=>(C("data-v-59a7e82c"),l=l(),K(),l),T={class:"body"},z={class:"login"},$=M(()=>w("div",{class:"title"},"里海收银系统 - 登录",-1)),j={__name:"index",setup(l){const p=I(),y=B(),h=u(null),_=u(null),s=u({account:"",password:"",key:"",captchaVerification:"",code:""}),i=()=>{if(!s.value.account)return d({message:"请填写账号",type:"error"});if(!s.value.password)return d({message:"请填写密码",type:"error"});E(s.value).then(a=>{console.log(a),a.data&&(p.setToken(a.data.token),N().then(({data:o})=>{if(!o.service)return d({message:"请联系管理员开通服务",type:"error"});p.setUserInfo(o),y.push("/")}))}).catch(a=>{})};return L(()=>{}),(a,o)=>{const g=n("User"),f=n("el-icon"),m=n("el-input"),c=n("el-form-item"),k=n("Lock"),V=n("el-button"),x=n("el-form");return R(),S("div",T,[w("div",z,[$,e(x,null,{default:t(()=>[e(c,null,{default:t(()=>[e(m,{ref_key:"accRef",ref:h,modelValue:s.value.account,"onUpdate:modelValue":o[0]||(o[0]=r=>s.value.account=r),placeholder:"请输入账号",autofocus:!0,onKeydown:o[1]||(o[1]=v(r=>_.value.focus(),["enter"]))},{prefix:t(()=>[e(f,null,{default:t(()=>[e(g)]),_:1})]),_:1},8,["modelValue"])]),_:1}),e(c,null,{default:t(()=>[e(m,{ref_key:"pwdRef",ref:_,modelValue:s.value.password,"onUpdate:modelValue":o[2]||(o[2]=r=>s.value.password=r),type:"password",placeholder:"请输入密码","show-password":"",onKeydown:v(i,["enter"])},{prefix:t(()=>[e(f,null,{default:t(()=>[e(k)]),_:1})]),_:1},8,["modelValue"])]),_:1}),e(c,null,{default:t(()=>[e(V,{style:{width:"100%"},type:"primary",onClick:i},{default:t(()=>[b("登录")]),_:1})]),_:1})]),_:1})])])}}},A=U(j,[["__scopeId","data-v-59a7e82c"]]);export{A as default};

View File

@ -1 +0,0 @@
import{s as q,p as G,u as H}from"./shop-BHLflC8g.js";import{_ as J,r as u,u as K,b as n,l as Q,v as R,c,h as m,f as t,w as l,F as W,i as X,d as v,x as y,g,e as I,t as U,E as T}from"./index-ewPIg6Mj.js";const Y={"element-loading-text":"加载中",class:"my-shop"},Z={key:0},ee={key:1,style:{color:"#ff4a00"}},te={class:"dialog-footer"},ae={__name:"index",setup(le){const k=u([]),f=K(),i=u({page:1,limit:15,type:1,staff_id:f.userInfo.service.service_id}),h=u(!1),b=u(0),d=()=>{h.value=!0,q(f.userInfo.service.mer_id,i.value).then(a=>{k.value=a.data.list,b.value=a.data.count,h.value=!1})};d();const z=a=>{i.value.page=a,d()},A=a=>{i.value.page=a,d()},N=a=>{i.value.page=a,d()},_=u(!1),s=u({}),S=a=>{s.value=a,_.value=!0},B=()=>{let a={attr:s.value.attr||[],attrValue:s.value.attrValue,mer_cate_id:s.value.merCateId||[],spec_type:s.value.spec_type,is_stock:1};H(s.value.product_id,a).then(r=>{T({message:r.message,type:"success"}),_.value=!1,d()}).catch(r=>{T({message:r,type:"error"})})},D=u(1),F=a=>{i.value.type=a,i.value.page=1,d()},V=u([]);return(()=>{G(f.userInfo.service.mer_id).then(a=>{V.value=a.data})})(),(a,r)=>{const L=n("el-menu-item"),$=n("el-menu"),o=n("el-table-column"),x=n("el-image"),E=n("el-switch"),w=n("el-button"),C=n("el-table"),P=n("el-pagination"),j=n("el-input-number"),M=n("el-dialog"),O=Q("loading");return R((c(),m("div",Y,[t($,{"default-active":D.value,class:"el-menu-top",mode:"horizontal",onSelect:F},{default:l(()=>[(c(!0),m(W,null,X(V.value,(e,p)=>(c(),v(L,{index:e.type,key:p},{default:l(()=>[g(U(`${e.name}(${e.count})`),1)]),_:2},1032,["index"]))),128))]),_:1},8,["default-active"]),t(C,{data:k.value,style:{width:"100%"}},{default:l(()=>[t(o,{prop:"product_id",label:"ID",width:"100"}),t(o,{prop:"image",label:"图片",width:"120"},{default:l(e=>[t(x,{loading:"lazy",style:{width:"60px",height:"60px"},src:e.row.image},null,8,["src"])]),_:1}),t(o,{prop:"store_name",label:"商品名称",width:"500"}),t(o,{prop:"price",label:"售价"}),t(o,{prop:"stock",label:"库存"}),i.value.type<=2?(c(),v(o,{key:0,label:"上/下架",width:"100"},{default:l(e=>[t(E,{modelValue:e.row.is_show,"onUpdate:modelValue":p=>e.row.is_show=p,"active-value":1,"inline-prompt":"","active-text":"上架","inactive-text":"下架"},null,8,["modelValue","onUpdate:modelValue"])]),_:1})):y("",!0),t(o,{label:"商品状态",width:"100"},{default:l(e=>[e.row.is_used?(c(),m("span",Z,"上架显示")):(c(),m("span",ee,"平台关闭"))]),_:1}),t(o,{label:"操作",width:"120"},{default:l(e=>[i.value.type<=4?(c(),v(w,{key:0,type:"primary",link:"",onClick:p=>S(e.row)},{default:l(()=>[g("修改库存")]),_:2},1032,["onClick"])):y("",!0)]),_:1})]),_:1},8,["data"]),t(P,{"page-size":i.value.limit,layout:"prev, pager, next",total:b.value,onPrevClick:z,onNextClick:A,onCurrentChange:N},null,8,["page-size","total"]),t(M,{modelValue:_.value,"onUpdate:modelValue":r[1]||(r[1]=e=>_.value=e),title:"编辑商品库存",width:"800"},{footer:l(()=>[I("div",te,[t(w,{onClick:r[0]||(r[0]=e=>_.value=!1)},{default:l(()=>[g("取消")]),_:1}),t(w,{type:"primary",onClick:B},{default:l(()=>[g(" 确定 ")]),_:1})])]),default:l(()=>[s.value.attrValue?(c(),v(C,{key:0,data:s.value.attrValue,stripe:"",style:{width:"100%"}},{default:l(()=>[t(o,{prop:"image",label:"图片",width:"180"},{default:l(e=>[t(x,{loading:"lazy",style:{width:"5rem",height:"5rem"},src:e.row.image||s.value.image},null,8,["src"])]),_:1}),t(o,{prop:"sku",label:"名称",width:"180"},{default:l(e=>[I("span",null,U(e.row.sku||s.value.store_name),1)]),_:1}),t(o,{prop:"price",label:"价格"}),t(o,{prop:"stock",label:"库存"},{default:l(e=>[t(j,{modelValue:e.row.stock,"onUpdate:modelValue":p=>e.row.stock=p,"step-strictly":"",min:0,step:1},null,8,["modelValue","onUpdate:modelValue"])]),_:1})]),_:1},8,["data"])):y("",!0)]),_:1},8,["modelValue"])])),[[O,h.value]])}}},ie=J(ae,[["__scopeId","data-v-16fa6099"]]);export{ie as default};

View File

@ -1 +0,0 @@
@charset "UTF-8";.my-shop[data-v-16fa6099]{background-color:#fff;border-radius:1.2rem;box-sizing:border-box;padding:1rem;overflow-y:scroll}[data-v-16fa6099]::-webkit-scrollbar{width:5px}[data-v-16fa6099]::-webkit-scrollbar-track{background-color:#f1f1f1;margin:20px 0}[data-v-16fa6099]::-webkit-scrollbar-thumb{background-color:#ccc;border-radius:5px}[data-v-16fa6099]::-webkit-scrollbar-thumb:hover{background-color:#999}.el-menu--horizontal[data-v-16fa6099]{height:2.5rem}

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
import{e as F,a as G,p as J,g as K,f as Q}from"./pay-BdASyvsQ.js";import{_ as W,u as X,r as s,b as d,l as Y,v as Z,c as u,h as v,f as t,w as o,g as r,t as ee,e as P,d as I,C as te,E as h,y as ae,z as oe}from"./index-ewPIg6Mj.js";const le=m=>(ae("data-v-80048b20"),m=m(),oe(),m),se={"element-loading-text":"加载中",class:"my-order"},ne={key:0},re={key:1,style:{color:"#ff4a00"}},ie={key:0},de={key:1,class:"flex"},ue=le(()=>P("span",null,"提单前请清空购物车, 避免提单的商品与购物车商品混合, 请确保购物车内无数据后再进行提单",-1)),ce={class:"dialog-footer"},pe={__name:"indexList",setup(m){const k=X(),C=s([]),b=te(),g=s(1),f=s(null),n=s({page:1,limit:20}),y=s(!1),w=s(0),i=()=>{y.value=!0,g.value==1&&(n.value.paid=null),g.value==2&&(n.value.paid=0),F(k.userInfo.service.mer_id,n.value).then(e=>{C.value=e.data.list,w.value=e.data.count,y.value=!1})};i();const x=s(0);(()=>{G({staff_id:k.userInfo.service.service_id}).then(e=>{var a;x.value=(a=e.data.list)==null?void 0:a.length})})();const A=e=>{n.value.page=1,i()},B=e=>{n.value.page=e,i()},D=e=>{n.value.page=e,i()},N=e=>{n.value.page=e,i()},R=()=>{i()},$=e=>{f.value.setRePay({price:e.pay_price,order_id:e.group_order_id}),f.value.drawer=!0},z=e=>{K({order_sn:e}).then(a=>{a.data.paid==1||a.message=="支付成功"?(h({message:a.message,type:"success"}),i()):h({message:a.message,type:"error"})}).catch(a=>{})},L=s(""),E=()=>{_.value=!1,Q({order_sn:L.value}).then(e=>{h({message:e.message,type:"success"}),b.push({name:"home"})})},_=s(!1),U=e=>{L.value=e,_.value=!0},O=()=>{b.push({name:"home"})};return(e,a)=>{const S=d("el-radio-button"),T=d("el-radio-group"),c=d("el-table-column"),p=d("el-button"),H=d("el-table"),M=d("el-pagination"),j=d("el-dialog"),q=Y("loading");return Z((u(),v("div",se,[t(T,{modelValue:g.value,"onUpdate:modelValue":a[0]||(a[0]=l=>g.value=l),style:{"margin-bottom":"30px"},onChange:A},{default:o(()=>[t(S,{value:1},{default:o(()=>[r("全部")]),_:1}),t(S,{value:2},{default:o(()=>[r("未支付")]),_:1})]),_:1},8,["modelValue"]),t(H,{data:C.value,style:{width:"100%"}},{default:o(()=>[t(c,{prop:"group_order_id",label:"ID",width:"100"}),t(c,{prop:"order_sn",label:"订单号",width:"260"}),t(c,{prop:"total_price",label:"订单金额"}),t(c,{prop:"paid",label:"支付状态"},{default:o(l=>[l.row.paid==1?(u(),v("span",ne,"已支付")):(u(),v("span",re,"未支付"))]),_:1}),t(c,{prop:"create_time",label:"订单创建时间"}),t(c,{prop:"pay_time",label:"订单支付时间"},{default:o(l=>[l.row.pay_time?(u(),v("span",ie,ee(l.row.pay_time),1)):(u(),v("div",de,[t(p,{type:"primary",link:"",onClick:V=>$(l.row)},{default:o(()=>[r("重新支付")]),_:2},1032,["onClick"]),t(p,{type:"primary",link:"",onClick:V=>z(l.row.order_sn)},{default:o(()=>[r("检测状态")]),_:2},1032,["onClick"]),t(p,{type:"primary",link:"",onClick:V=>U(l.row.order_sn)},{default:o(()=>[r("提单")]),_:2},1032,["onClick"])]))]),_:1})]),_:1},8,["data"]),t(M,{"page-size":n.value.limit,layout:"prev, pager, next",total:w.value,onPrevClick:B,onNextClick:D,onCurrentChange:N},null,8,["page-size","total"]),t(J,{ref_key:"payRef",ref:f,onPaySuccess:R},null,512),t(j,{modelValue:_.value,"onUpdate:modelValue":a[2]||(a[2]=l=>_.value=l),title:"提示",width:"500"},{footer:o(()=>[P("div",ce,[t(p,{onClick:a[1]||(a[1]=l=>_.value=!1)},{default:o(()=>[r("取消")]),_:1}),x.value>0?(u(),I(p,{key:0,onClick:O},{default:o(()=>[r(" 前去清空购物车 ")]),_:1})):(u(),I(p,{key:1,type:"primary",onClick:E},{default:o(()=>[r(" 确认提单 ")]),_:1}))])]),default:o(()=>[ue]),_:1},8,["modelValue"])])),[[q,y.value]])}}},ge=W(pe,[["__scopeId","data-v-80048b20"]]);export{ge as default};
import{e as F,a as G,p as J,g as K,f as Q}from"./pay-hmX8FyfK.js";import{_ as W,u as X,r as s,b as d,l as Y,v as Z,c as u,h as v,f as t,w as o,g as r,t as ee,e as P,d as I,C as te,E as h,y as ae,z as oe}from"./index-DG0Cmpzz.js";const le=m=>(ae("data-v-80048b20"),m=m(),oe(),m),se={"element-loading-text":"加载中",class:"my-order"},ne={key:0},re={key:1,style:{color:"#ff4a00"}},ie={key:0},de={key:1,class:"flex"},ue=le(()=>P("span",null,"提单前请清空购物车, 避免提单的商品与购物车商品混合, 请确保购物车内无数据后再进行提单",-1)),ce={class:"dialog-footer"},pe={__name:"indexList",setup(m){const k=X(),C=s([]),b=te(),g=s(1),f=s(null),n=s({page:1,limit:20}),y=s(!1),w=s(0),i=()=>{y.value=!0,g.value==1&&(n.value.paid=null),g.value==2&&(n.value.paid=0),F(k.userInfo.service.mer_id,n.value).then(e=>{C.value=e.data.list,w.value=e.data.count,y.value=!1})};i();const x=s(0);(()=>{G({staff_id:k.userInfo.service.service_id}).then(e=>{var a;x.value=(a=e.data.list)==null?void 0:a.length})})();const A=e=>{n.value.page=1,i()},B=e=>{n.value.page=e,i()},D=e=>{n.value.page=e,i()},N=e=>{n.value.page=e,i()},R=()=>{i()},$=e=>{f.value.setRePay({price:e.pay_price,order_id:e.group_order_id}),f.value.drawer=!0},z=e=>{K({order_sn:e}).then(a=>{a.data.paid==1||a.message=="支付成功"?(h({message:a.message,type:"success"}),i()):h({message:a.message,type:"error"})}).catch(a=>{})},L=s(""),E=()=>{_.value=!1,Q({order_sn:L.value}).then(e=>{h({message:e.message,type:"success"}),b.push({name:"home"})})},_=s(!1),U=e=>{L.value=e,_.value=!0},O=()=>{b.push({name:"home"})};return(e,a)=>{const S=d("el-radio-button"),T=d("el-radio-group"),c=d("el-table-column"),p=d("el-button"),H=d("el-table"),M=d("el-pagination"),j=d("el-dialog"),q=Y("loading");return Z((u(),v("div",se,[t(T,{modelValue:g.value,"onUpdate:modelValue":a[0]||(a[0]=l=>g.value=l),style:{"margin-bottom":"30px"},onChange:A},{default:o(()=>[t(S,{value:1},{default:o(()=>[r("全部")]),_:1}),t(S,{value:2},{default:o(()=>[r("未支付")]),_:1})]),_:1},8,["modelValue"]),t(H,{data:C.value,style:{width:"100%"}},{default:o(()=>[t(c,{prop:"group_order_id",label:"ID",width:"100"}),t(c,{prop:"order_sn",label:"订单号",width:"260"}),t(c,{prop:"total_price",label:"订单金额"}),t(c,{prop:"paid",label:"支付状态"},{default:o(l=>[l.row.paid==1?(u(),v("span",ne,"已支付")):(u(),v("span",re,"未支付"))]),_:1}),t(c,{prop:"create_time",label:"订单创建时间"}),t(c,{prop:"pay_time",label:"订单支付时间"},{default:o(l=>[l.row.pay_time?(u(),v("span",ie,ee(l.row.pay_time),1)):(u(),v("div",de,[t(p,{type:"primary",link:"",onClick:V=>$(l.row)},{default:o(()=>[r("重新支付")]),_:2},1032,["onClick"]),t(p,{type:"primary",link:"",onClick:V=>z(l.row.order_sn)},{default:o(()=>[r("检测状态")]),_:2},1032,["onClick"]),t(p,{type:"primary",link:"",onClick:V=>U(l.row.order_sn)},{default:o(()=>[r("提单")]),_:2},1032,["onClick"])]))]),_:1})]),_:1},8,["data"]),t(M,{"page-size":n.value.limit,layout:"prev, pager, next",total:w.value,onPrevClick:B,onNextClick:D,onCurrentChange:N},null,8,["page-size","total"]),t(J,{ref_key:"payRef",ref:f,onPaySuccess:R},null,512),t(j,{modelValue:_.value,"onUpdate:modelValue":a[2]||(a[2]=l=>_.value=l),title:"提示",width:"500"},{footer:o(()=>[P("div",ce,[t(p,{onClick:a[1]||(a[1]=l=>_.value=!1)},{default:o(()=>[r("取消")]),_:1}),x.value>0?(u(),I(p,{key:0,onClick:O},{default:o(()=>[r(" 前去清空购物车 ")]),_:1})):(u(),I(p,{key:1,type:"primary",onClick:E},{default:o(()=>[r(" 确认提单 ")]),_:1}))])]),default:o(()=>[ue]),_:1},8,["modelValue"])])),[[q,y.value]])}}},ge=W(pe,[["__scopeId","data-v-80048b20"]]);export{ge as default};

View File

@ -1 +1 @@
import{o as r,d as t}from"./detail-B1GiYJo4.js";import{p as s}from"./padding-CHwe9gtr.js";import{c as o,h as a,f as e}from"./index-ewPIg6Mj.js";import"./pay-BdASyvsQ.js";const c={class:"my-card"},_={__name:"indexSystem",setup(d){return(i,l)=>(o(),a("div",c,[e(r,{style:{"flex-shrink":"0"},ref:"orderRef",isSystem:""},null,512),e(s),e(t,{ref:"detailRef"},null,512)]))}};export{_ as default};
import{o as r,d as t}from"./detail-BB6Kd3Ns.js";import{p as s}from"./padding-DgRc53vd.js";import{c as o,h as a,f as e}from"./index-DG0Cmpzz.js";import"./pay-hmX8FyfK.js";const c={class:"my-card"},_={__name:"indexSystem",setup(d){return(i,l)=>(o(),a("div",c,[e(r,{style:{"flex-shrink":"0"},ref:"orderRef",isSystem:""},null,512),e(s),e(t,{ref:"detailRef"},null,512)]))}};export{_ as default};

View File

@ -1 +1 @@
import{_ as e,c as t,h as c}from"./index-ewPIg6Mj.js";const n={},o={style:{width:"20px",height:"100%"}};function s(r,_){return t(),c("div",o)}const i=e(n,[["render",s]]);export{i as p};
import{_ as e,c as t,h as c}from"./index-DG0Cmpzz.js";const n={},o={style:{width:"20px",height:"100%"}};function s(r,_){return t(),c("div",o)}const i=e(n,[["render",s]]);export{i as p};

File diff suppressed because one or more lines are too long

View File

@ -1 +0,0 @@
import{D as e}from"./index-ewPIg6Mj.js";function u(r,t){return e.get(`server/${r}/product/lst`,{params:t})}function a(r,t){return e.get(`store/product/detail/${r}`,{params:t})}function i(r,t){return e.post(`user_free_trial/${r}`,t)}function o(r,t){return e.get(`server/${r}/product/title`,{params:t})}export{a as g,o as p,u as s,i as u};

1
dist/assets/shop-Y1sgv1U3.js vendored Normal file
View File

@ -0,0 +1 @@
import{G as e}from"./index-DG0Cmpzz.js";function a(t,r){return e.get(`server/${t}/product/lst`,{params:r})}function p(t,r){return e.get(`store/product/detail/${t}`,{params:r})}function o(t,r){return e.post(`user_free_trial/${t}`,r)}function i(t,r){return e.get(`server/${t}/product/title`,{params:r})}function n(t,r,s){return e.post(`server/${t}/product/status/${r}`,s)}function c(t,r){return e.get(`server/${t}/category/list`,{params:r})}function d(t,r){return e.post(`server/${t}/product/create`,r)}function $(t,r,s){return e.post(`server/${t}/product/update/${r}`,s)}function f(t,r,s){return e.get(`server/${t}/product/detail/${r}`,{params:s})}export{d as a,$ as b,c,i as d,n as e,p as g,f as p,a as s,o as u};

2
dist/index.html vendored
View File

@ -5,7 +5,7 @@
<link rel="icon" type="image/svg+xml" href="./cashier.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>里海收银系统</title>
<script type="module" crossorigin src="./assets/index-ewPIg6Mj.js"></script>
<script type="module" crossorigin src="./assets/index-DG0Cmpzz.js"></script>
<link rel="stylesheet" crossorigin href="./assets/index-BVX4hike.css">
</head>
<body>

View File

@ -3,6 +3,8 @@ import { onMounted } from 'vue'
onMounted(() => {
document.body.style.setProperty('--el-color-primary', '#1890ff');
document.body.style.setProperty('--el-upload-picture-card-size', '60px');
document.body.style.setProperty('--el-upload-list-picture-card-size', '60px');
})
</script>
@ -14,6 +16,7 @@ onMounted(() => {
.el-button:focus{
outline: none;
}
// input
input::-webkit-outer-spin-button, input::-webkit-inner-spin-button {

View File

@ -27,3 +27,38 @@ export function userFreeTrialApi(id, data) {
export function productTitleApi(id, data) {
return request.get(`server/${id}/product/title`, { params: data })
}
/**
* @description 上下架
*/
export function productStatusApi(mer_id, id, data) {
return request.post(`server/${mer_id}/product/status/${id}`, data)
}
/**
* @description 平台分类
*/
export function categoryListApi(mer_id, data) {
return request.get(`server/${mer_id}/category/list`, { params: data })
}
/**
* @description 添加商品
*/
export function productCreateApi(mer_id, data) {
return request.post(`server/${mer_id}/product/create`, data)
}
/**
* @description 编辑商品
*/
export function productUpdateApi(mer_id, id, data) {
return request.post(`server/${mer_id}/product/update/${id}`, data)
}
/**
* @description 商品详情
*/
export function productDetailApi(mer_id, id, data) {
return request.get(`server/${mer_id}/product/detail/${id}`, { params: data })
}

6
src/config/index.js Normal file
View File

@ -0,0 +1,6 @@
const config = {
url: import.meta.env.VITE_BASE_URL + '/api',
upload: import.meta.env.VITE_BASE_URL + '/api/upload/image/field',
}
export default config;

View File

@ -2,9 +2,10 @@ import axios from "axios";
import { ElMessage } from "element-plus";
import router from "@/router/index.js";
import { useUserStore } from "../store/user";
import config from "@/config";
const request = axios.create({
baseURL: import.meta.env.VITE_BASE_URL + '/api',
baseURL: config.url,
timeout: 10000
})

View File

@ -1,5 +1,5 @@
<script setup>
import { ref } from "vue";
import { nextTick, ref } from "vue";
import {
orderListApi,
orderStatusApi,
@ -19,6 +19,9 @@ const router = useRouter();
const formData = ref({});
mitt.on("set-order-detail", (res) => {
formData.value = res;
nextTick(()=>{
tableRef.value?.toggleAllSelection();
})
});
const list = ref([]);
@ -83,11 +86,14 @@ const emit = defineEmits(['reInit'])
const tableRef = ref(null);
//
const convert = ()=>{
let tableList = tableRef.value.getSelectionRows();
if(tableList.length == 0){
return ElMessage.error('请选择核销商品');
}
let query = {
data: [],
verify_code: formData.value.verify_code
}
let tableList = tableRef.value.getSelectionRows();
tableList.forEach(item => {
query.data.push({
id: item.order_product_id,

View File

@ -0,0 +1,289 @@
<script setup>
import { ref, watch, nextTick, computed, onMounted, onUnmounted } from "vue";
import { ElMessage } from "element-plus";
import mitt from "@/utils/mitt.js";
import { useUserStore } from "@/store/user.js";
import config from "@/config";
import {
categoryListApi,
productCreateApi,
productDetailApi,
productUpdateApi,
} from "@/api/shop.js";
const drawer = ref(false);
const table = {
store_name: "",
image: [],
slider_image: [],
attrValue: [
{
bar_code: "",
price: "",
stock: "",
cost: "",
ot_price: "",
wholesale_price: "0",
extension_one: "",
extension_two: "",
},
],
content: {
image: [],
},
unit_name: "",
delivery_way: ["1"],
};
const formData = ref(table);
const userStore = useUserStore();
const emit = defineEmits(["reload"]);
const dialogImgVisible = ref(false);
const dialogImageUrl = ref("");
const handlePictureCardPreview = (uploadFile) => {
dialogImageUrl.value = uploadFile.url;
dialogImgVisible.value = true;
};
const showType = ref("add");
const show = (type, data) => {
formData.value = table;
showType.value = type;
if (type == "add") {
drawer.value = true;
} else if (type == "edit") {
drawer.value = true;
getProductDetail(data.product_id);
}
};
const getProductDetail = (id) => {
productDetailApi(userStore.userInfo.service.mer_id, id).then((res) => {
res.data.image = [
{
url: res.data.image,
uid: res.data.image,
},
];
res.data.content.image = res.data.content.image.map((item) => {
return {
url: item,
uid: res.data.image,
};
});
res.data.slider_image = res.data.slider_image.map((item) => {
return {
url: item,
uid: res.data.image,
};
});
formData.value = res.data;
console.log(formData.value);
});
};
const categoryList = ref([]);
const getCategoryList = () => {
categoryListApi(userStore.userInfo.service.mer_id).then((res) => {
categoryList.value = res.data;
});
};
getCategoryList();
const uploadImage = (res) => {
formData.value.image = res.data.path;
};
const uploadSliderImage = (res) => {
console.log(formData.value.slider_image);
};
const handleRemove = (file) => {
console.log(file);
};
const formRef = ref(null);
const submit = () => {
let data = JSON.parse(JSON.stringify(formData.value));
console.log(data.cate_id);
if (data.cate_id && typeof data.cate_id == "object" && data.cate_id.length > 0)
data.cate_id = data.cate_id[data.cate_id.length - 1] || '';
else data.cate_id = data.cate_id || '';
if (data.image == "") return ElMessage.error("请上传商品封面图");
// if (data.content.image.length == 0)
// return ElMessage.error("");
if (data.slider_image.length == 0) return ElMessage.error("请上传商品轮播图");
data.content.image = data.content.image.map((item) => {
return item?.response?.data?.path ? item?.response?.data?.path : item.url;
});
data.image = data.image[0]?.response?.data?.path
? data.image[0]?.response?.data?.path
: data.image[0].url;
data.slider_image = data.slider_image.map((item) => {
return item?.response?.data?.path ? item?.response?.data?.path : item.url;
});
if (data.store_name == "") return ElMessage.error("请输入商品名称");
if (data.cate_id == "") return ElMessage.error("请选择平台分类");
if (data.attrValue[0].bar_code == "")
return ElMessage.error("请输入商品条码");
if (data.attrValue[0].stock<=0) return ElMessage.error("请输入商品库存");
if (data.attrValue[0].price<=0) return ElMessage.error("请输入商品价格");
if (showType.value == "add")
productCreateApi(userStore.userInfo.service.mer_id, data).then((res) => {
ElMessage.success(res.message);
emit("reload");
beforeClose();
});
else
productUpdateApi(
userStore.userInfo.service.mer_id,
data.product_id,
data
).then((res) => {
ElMessage.success(res.message);
emit("reload");
beforeClose();
});
};
const cancelClick = () => {
beforeClose();
};
const beforeClose = () => {
drawer.value = false;
};
const open = () => {};
defineExpose({
drawer,
show,
});
</script>
<template>
<el-drawer
:size="800"
v-model="drawer"
direction="rtl"
@open="open"
:before-close="beforeClose"
>
<template #header>
<h4>添加商品</h4>
</template>
<template #default>
<div class="dra-body">
<el-form ref="formRef" :model="formData" label-width="150px">
<el-form-item label="商品条码" required>
<el-input
v-model="formData.attrValue[0].bar_code"
type="number"
placeholder="请输入商品条码"
></el-input>
</el-form-item>
<el-form-item label="商品名称" required>
<el-input
v-model="formData.store_name"
placeholder="请输入商品名称"
></el-input>
</el-form-item>
<el-form-item label="平台分类" required>
<el-cascader
v-model="formData.cate_id"
class="pageWidth"
:options="categoryList"
filterable
clearable
/>
</el-form-item>
<el-form-item label="商品封面图" required>
<el-upload
v-model:file-list="formData.image"
:action="config.upload"
name="field"
list-type="picture-card"
:on-preview="handlePictureCardPreview"
:limit="1"
>
<el-icon><Plus /></el-icon>
</el-upload>
</el-form-item>
<el-form-item label="商品轮播图" required>
<el-upload
v-model:file-list="formData.slider_image"
:action="config.upload"
name="field"
list-type="picture-card"
:on-preview="handlePictureCardPreview"
:limit="9"
>
<el-icon><Plus /></el-icon>
</el-upload>
</el-form-item>
<el-form-item label="商品详情">
<el-upload
v-model:file-list="formData.content.image"
:action="config.upload"
name="field"
list-type="picture-card"
:on-preview="handlePictureCardPreview"
:limit="9"
>
<el-icon><Plus /></el-icon>
</el-upload>
</el-form-item>
<el-form-item label="商品单位" required>
<el-input
v-model="formData.unit_name"
placeholder="请输入商品单位"
></el-input>
</el-form-item>
<el-form-item label="零售价" required>
<el-input
v-model="formData.attrValue[0].price"
type="number"
placeholder="请输入零售价"
></el-input>
</el-form-item>
<el-form-item label="库存" required>
<el-input
v-model="formData.attrValue[0].stock"
type="number"
placeholder="请输入库存"
></el-input>
</el-form-item>
</el-form>
</div>
<el-dialog v-model="dialogImgVisible">
<img
style="width: 100%; height: 100%"
w-full
:src="dialogImageUrl"
alt="Preview Image"
/>
</el-dialog>
</template>
<template #footer>
<el-button @click="cancelClick">取消</el-button>
<el-button type="primary" @click="submit">确认</el-button>
</template>
</el-drawer>
</template>
<style lang="scss" scoped>
.dra-body {
width: 100%;
display: flex;
flex-direction: column;
/* align-items: center; */
text-align: center;
}
::v-deep .el-upload--picture-card {
--el-upload-picture-card-size: 60px !important;
}
::v-deep .el-upload-list--picture-card .el-upload-list__item {
height: 60px !important;
width: 60px !important;
}
</style>

View File

@ -1,8 +1,9 @@
<script setup>
import { ref } from "vue";
import { storeListApi, userFreeTrialApi, productTitleApi } from "@/api/shop.js";
import { onMounted, ref } from "vue";
import { storeListApi, userFreeTrialApi, productTitleApi, productStatusApi } from "@/api/shop.js";
import { useUserStore } from "@/store/user.js";
import { ElMessage } from "element-plus";
import add from "./component/add.vue";
const orderList = ref([]);
const userStore = useUserStore();
@ -11,13 +12,24 @@ const where = ref({
page: 1,
limit: 15,
type: 1,
keyword: "",
staff_id: userStore.userInfo.service.service_id,
});
const loading = ref(false);
const total = ref(0);
const getOrderList = () => {
const productTitle = ref([]);
const getProductTitleApi = () => {
productTitleApi(userStore.userInfo.service.mer_id).then((res) => {
productTitle.value = res.data;
});
};
getProductTitleApi()
const getShopList = () => {
loading.value = true;
storeListApi(userStore.userInfo.service.mer_id, where.value).then((res) => {
orderList.value = res.data.list;
@ -26,21 +38,21 @@ const getOrderList = () => {
});
};
getOrderList();
getShopList();
const prevClick = (e) => {
where.value.page = e;
getOrderList();
getShopList();
};
const nextClick = (e) => {
where.value.page = e;
getOrderList();
getShopList();
};
const currentChange = (e) => {
where.value.page = e;
getOrderList();
getShopList();
};
const dialogFormVisible = ref(false);
@ -65,7 +77,7 @@ const submitUpdate = () => {
type: "success",
});
dialogFormVisible.value = false;
getOrderList();
getShopList();
})
.catch((err) => {
ElMessage({
@ -75,25 +87,44 @@ const submitUpdate = () => {
});
};
const activeIndex = ref(1);
const activeIndex = ref('1');
const handleSelect = (key) => {
where.value.type = key;
where.value.page = 1;
getOrderList();
getShopList();
};
const productTitle = ref([]);
const getProductTitleApi = () => {
productTitleApi(userStore.userInfo.service.mer_id).then((res) => {
productTitle.value = res.data;
});
};
getProductTitleApi();
const updateShow = (row) => {
productStatusApi(userStore.userInfo.service.mer_id, row.product_id, {
status: row.is_show ? 1 : 0
}).then(res=>{
ElMessage.success(res.message);
getShopList();
})
}
const addRef = ref(null);
const showAdd = (type='add', data)=>{
addRef.value.show(type, data);
}
</script>
<template>
<div v-loading="loading" element-loading-text="加载中" class="my-shop">
<el-form :inline="true">
<el-form-item label="关键字:">
<el-input v-model="where.keyword" placeholder="请输入关键字搜索" style="width: 20rem;" clearable @clear="getShopList(true)" @keydown.enter="getShopList(true)"/>
</el-form-item>
<el-form-item >
<el-button type="primary" @click="getShopList(true)">搜索</el-button>
</el-form-item>
<el-form-item >
<el-button type="primary" @click="showAdd('add')">新增</el-button>
</el-form-item>
</el-form>
<el-menu
:default-active="activeIndex"
class="el-menu-top"
@ -101,7 +132,7 @@ getProductTitleApi();
@select="handleSelect"
>
<el-menu-item
:index="item.type"
:index="item.type+''"
v-for="(item, index) in productTitle"
:key="index"
>{{ `${item.name}(${item.count})` }}</el-menu-item
@ -130,10 +161,11 @@ getProductTitleApi();
inline-prompt
active-text="上架"
inactive-text="下架"
@click="updateShow(scope.row)"
/>
</template>
</el-table-column>
<el-table-column label="商品状态" width="100">
<el-table-column label="商品状态" v-if="where.type<=4" width="100">
<template #default="scope">
<span v-if="scope.row.is_used">上架显示</span>
<span v-else style="color: #ff4a00">平台关闭</span>
@ -143,11 +175,18 @@ getProductTitleApi();
<template #default="scope">
<el-button
type="primary"
v-if="where.type <= 4"
v-if="where.type != 5"
link
@click="edit(scope.row)"
>修改库存</el-button
>
<el-button
type="primary"
v-if="where.type != 1 && where.type != 5"
link
@click="showAdd('edit', scope.row)"
>编辑</el-button
>
</template>
</el-table-column>
</el-table>
@ -201,6 +240,7 @@ getProductTitleApi();
</div>
</template>
</el-dialog>
<add ref="addRef" @reload="getShopList"></add>
</div>
</template>
@ -236,4 +276,7 @@ getProductTitleApi();
.el-menu--horizontal {
height: 2.5rem;
}
.el-form--inline .el-form-item{
margin-right: 1rem;
}
</style>