| 1 |
- import{d as V,u as $,b as E,e as r,p as H,R,A as F,B as y,c as p,a as t,f as u,w as n,j as b,m as U,v as O,y as q,r as C,o as h,F as G,i as J,t as g,I as K,g as _,k as Q}from"./index-B9UwUtN4.js";import{x as W}from"./vue3-datatable-33agO3sn.js";const X=t("li",{class:"before:content-['/'] ltr:before:mr-2 rtl:before:ml-2"},[t("span",null,"订单列表")],-1),Y={class:"panel pb-0 mt-6"},Z={class:"flex md:items-center md:flex-row flex-col mb-5 gap-5"},ee={class:"flex items-center gap-5 ltr:ml-auto rtl:mr-auto"},te={class:"dropdown"},se={type:"button",class:"whitespace-nowrap flex items-center border font-semibold border-[#e0e6ed] dark:border-[#253b5c] rounded-md px-4 py-2 text-sm dark:bg-[#1b2e4b] dark:text-white-dark"},ae=t("span",{class:"ltr:mr-1 rtl:ml-1"},"选择",-1),oe={class:"whitespace-nowrap"},re={class:"flex items-center px-4 py-1"},ne={class:"cursor-pointer mb-0"},le=["id","value","onChange","checked"],ie=["for"],de={class:"datatable"},ce=["onClick"],ge=V({__name:"orderList",setup(pe){$({title:"Column Chooser Table"});const w=q(),L=E(),m=r(""),v=r([]);r([]);const d=r([]);r([]);const l=r([]),A=r([]),f=r([{field:"sn",title:"订单编号",hide:!1},{field:"member_id",title:"客户",hide:!0},{field:"order_time",title:"下单时间",hide:!1},{field:"warehouse_id",title:"仓库名称",hide:!0},{field:"send_type",title:"配送方式",hide:!0},{field:"pay_type",title:"付款方式",hide:!1},{field:"pay_price",title:"实付金额",hide:!0},{field:"status",title:"订单状态",hide:!0},{field:"extension",title:"延期次数",hide:!0},{field:"type",title:"订单类型",hide:!0}]),a=r([{page_no:1,page_size:10}]),k=r(0),z=()=>{w.replace({name:"home"})},j=e=>{console.log(`${e} items per page`)},M=e=>{a.page_no=e,x(),console.log(`current page: ${e}`)},N=e=>{if(e&&d.value&&d.value.data){const o=d.value.data.find(i=>i.id===e);return o?o.name:""}},B=e=>{if(e&&l.value&&l.value.data&&l.value.data.data){const o=l.value.data.data.find(i=>i.id===e);return o?o.name:""}},I=e=>{if(e)return e=="HAS_HANDLE"?"已处理":"未处理"};H(()=>{x(),S()});const x=async()=>{console.log(a),R.orderList({page_no:a.page_no,page_size:a.page_size}).then(e=>{a.page_no=e.data.page_no,a.page_size=e.data.page_size,k.value=e.data.data_total,v.value=e.data.data})},S=async()=>{d.value=await F.warehouseList({}),l.value=await y.getExpressList(a),A.value=await y.getPage({dictType:"transfer_status"})},D=async e=>{w.replace({name:"addInventory",params:{id:e.value.id}})};return(e,o)=>{const i=C("Popper"),P=C("el-pagination");return h(),p("div",null,[t("ul",{class:"flex space-x-2 rtl:space-x-reverse"},[t("li",null,[t("a",{href:"javascript:;",class:"text-primary hover:underline",onClick:z},"首页")]),X]),t("div",Y,[t("div",Z,[t("div",ee,[t("div",te,[u(i,{placement:b(L).rtlClass==="rtl"?"bottom-end":"bottom-start",offsetDistance:"0",class:"align-middle"},{content:n(()=>[t("ul",oe,[(h(!0),p(G,null,J(f.value,(s,c)=>(h(),p("li",{key:c},[t("div",re,[t("label",ne,[t("input",{type:"checkbox",class:"form-checkbox",id:`chk-${c}`,value:s.field,onChange:T=>s.hide=!T.target.checked,checked:!s.hide},null,40,le),t("span",{for:`chk-${c}`,class:"ltr:ml-2 rtl:mr-2"},g(s.title),9,ie)])])]))),128))])]),default:n(()=>[t("button",se,[ae,u(K,{class:"w-5 h-5"})])]),_:1},8,["placement"])]),t("div",null,[U(t("input",{"onUpdate:modelValue":o[0]||(o[0]=s=>m.value=s),type:"text",class:"form-input",placeholder:"Search..."},null,512),[[O,m.value]])])])]),t("div",de,[u(b(W),{rows:v.value,columns:f.value,sortable:!0,search:m.value,style:{"min-height":"500px"},"show-pagination":!1,skin:"whitespace-nowrap bh-table-hover",firstArrow:'<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" class="w-4.5 h-4.5 rtl:rotate-180"> <path d="M13 19L7 12L13 5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/> <path opacity="0.5" d="M16.9998 19L10.9998 12L16.9998 5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/> </svg>',lastArrow:'<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" class="w-4.5 h-4.5 rtl:rotate-180"> <path d="M11 19L17 12L11 5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/> <path opacity="0.5" d="M6.99976 19L12.9998 12L6.99976 5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/> </svg> ',previousArrow:'<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" class="w-4.5 h-4.5 rtl:rotate-180"> <path d="M15 5L9 12L15 19" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/> </svg>',nextArrow:'<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" class="w-4.5 h-4.5 rtl:rotate-180"> <path d="M9 5L15 12L9 19" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/> </svg>'},{warehouse_id:n(s=>[_(g(N(s.value.warehouse_id)),1)]),send_type:n(s=>[_(g(B(s.value.send_type)),1)]),status:n(s=>[_(g(I(s.value.status)),1)]),actions:n(s=>[s.value.status!=="HAS_HANDLE"?(h(),p("button",{key:0,onClick:c=>D(s),class:"btn btn-primary m-0"},"编辑",8,ce)):Q("",!0)]),isActive:n(()=>[]),pagination:n(()=>[]),_:1},8,["rows","columns","search"]),u(P,{class:"p-2 flex justify-end dark:bg-[#0e1726]","current-page":a.value.page_no,"onUpdate:currentPage":o[1]||(o[1]=s=>a.value.page_no=s),"page-size":a.value.page_size,small:!0,layout:"total, prev, pager, next",total:k.value,onSizeChange:j,onCurrentChange:M},null,8,["current-page","page-size","total"])])])])}}});export{ge as default};
|