company-modal.8174b6.js 2.6 KB

1
  1. import{_ as U,d as E,w as s,X as j,Z as A,r,aC as H,o as w,G as x,C as p,h as c,j as t,M as v,H as L,l as b,aV as M,ce as N}from"./index.js";const R={flex:"","mb-2":""},I={flex:"","flex-1":"",gap:"5",pr:"20px"},O={flex:"",width:"120px"},T={flex:"","justify-between":"","mt-2":""},q=E({__name:"company-modal",emits:["choose"],setup(G,{expose:z,emit:h}){const g=s([]),C=s([]),u=s({name:""}),m=s(!1),d=s(!1),V=s(null),k=j(),a=A({currentPage:1,pageSize:10,total:0});async function _(){const{pageSize:n,currentPage:e}=a;m.value=!0;const{code:f,message:i,data:o}=await N({...u.value,size:n,page:e});k({code:f,message:i,handler:()=>{a.total=o.count,g.value=o.list}}),m.value=!1}function F(){d.value=!1,h("choose",b(C))}function S(n){C.value=n}function y(n=!1){n&&(u.value={name:""}),a.currentPage=1,_()}return z({onDisplay:()=>{d.value=!0}}),(n,e)=>{const f=r("el-input"),i=r("el-button"),o=r("el-table-column"),D=r("el-pagination"),B=r("el-dialog"),P=H("loading");return w(),x(B,{"close-on-click-modal":!1,modelValue:d.value,"onUpdate:modelValue":e[5]||(e[5]=l=>d.value=l),title:"\u4F9B\u5E94\u5546",center:"",width:"1040px",onOpen:e[6]||(e[6]=()=>_()),onClose:e[7]||(e[7]=()=>u.value.name="")},{default:p(()=>[c("div",R,[c("div",I,[t(f,{placeholder:"\u516C\u53F8\u540D\u79F0",size:"small",modelValue:u.value.name,"onUpdate:modelValue":e[0]||(e[0]=l=>u.value.name=l)},null,8,["modelValue"])]),c("div",O,[t(i,{size:"small",type:"primary",onClick:e[1]||(e[1]=()=>y())},{default:p(()=>[v("\u641C\u7D22")]),_:1}),t(i,{size:"small",onClick:e[2]||(e[2]=()=>y(!0))},{default:p(()=>[v("\u91CD\u7F6E")]),_:1})])]),L((w(),x(b(M),{border:"",ref_key:"tableRef",ref:V,data:g.value,size:"small","row-key":"id",onSelectionChange:S},{default:p(()=>[t(o,{type:"selection",align:"center",width:"40"}),t(o,{label:"\u516C\u53F8\u7F16\u7801",prop:"code","show-overflow-tooltip":"",width:"150px"}),t(o,{label:"\u516C\u53F8\u540D\u79F0",prop:"name","show-overflow-tooltip":""}),t(o,{label:"\u516C\u53F8\u7C7B\u578B",prop:"nature","show-overflow-tooltip":""})]),_:1},8,["data"])),[[P,m.value]]),c("div",T,[t(D,{"current-page":a.currentPage,"onUpdate:currentPage":e[3]||(e[3]=l=>a.currentPage=l),"page-size":a.pageSize,"onUpdate:pageSize":e[4]||(e[4]=l=>a.pageSize=l),total:a.total,onCurrentChange:_},null,8,["current-page","page-size","total"]),t(i,{type:"primary",size:"small",onClick:F},{default:p(()=>[v("\u786E\u5B9A")]),_:1})])]),_:1},8,["modelValue"])}}});var Z=U(q,[["__scopeId","data-v-08afa861"],["__file","C:/Users/Administrator/Desktop/projects/purchase-vue3/src/views/supplierInterest/supplierAccount/components/company-modal.vue"]]);export{Z as default};