import{_ as R,d as h,n as s,cb as H,O,Q as T,r as d,aw as j,o as v,A as z,y as p,e as f,h as o,H as C,B as I,i as x,cY as M,c as q,F as Q,z as Y,d6 as $,d$ as G}from"./index.js";import{i as J}from"./configs.ae46c65e.js";const K={flex:"","mb-2":""},W={flex:"","flex-1":"",gap:"5",pr:"20px"},X={flex:"",width:"120px"},Z={flex:"","justify-between":"","mt-2":""},ee=h({__name:"capital-modal",emits:["on-add-order"],setup(te,{expose:b,emit:k}){const V=s([]),_=s([]),l=s({invNo:"",inv_out:"",inv_company:""}),g=s(!1),m=s(!1),S=k,y=s(null),D=H(),{currentCompany:F}=O(),a=T({pageSize:10,currentPage:1,total:0});async function c(){const{pageSize:n,currentPage:e}=a;g.value=!0;const{code:u,message:i,data:r}=await G({status:"3",inv_out:F.value.companyNo,size:n,page:e,...l.value});D({code:u,message:i,handler:()=>{a.total=r.count,V.value=r.list}}),g.value=!1}function P(){m.value=!1,S("on-add-order",x(_.value[0]))}function N(n){if(n.length>1){const e=n.pop();y.value.clearSelection(),y.value.toggleRowSelection(e,!0),_.value=[e]}else _.value=[n[0]]}function B(){a.currentPage=1,c()}function w(n=!1){n&&(l.value={invNo:"",inv_out:"",inv_company:""}),a.currentPage=1,c()}return b({onDisplay:()=>m.value=!0}),(n,e)=>{const u=d("el-input"),i=d("el-button"),r=d("el-table-column"),A=d("el-pagination"),E=d("el-dialog"),U=j("loading");return v(),z(E,{"close-on-click-modal":!1,"close-on-press-escape":!1,modelValue:m.value,"onUpdate:modelValue":e[7]||(e[7]=t=>m.value=t),title:"\u53D1\u7968",center:"",width:"1040px",onOpen:e[8]||(e[8]=()=>c())},{default:p(()=>[f("div",K,[f("div",W,[o(u,{placeholder:"\u53D1\u7968\u7533\u8BF7\u7F16\u7801",size:"small",modelValue:l.value.invNo,"onUpdate:modelValue":e[0]||(e[0]=t=>l.value.invNo=t)},null,8,["modelValue"]),o(u,{placeholder:"\u4E1A\u52A1\u516C\u53F8\u7F16\u7801",size:"small",modelValue:l.value.inv_out,"onUpdate:modelValue":e[1]||(e[1]=t=>l.value.inv_out=t)},null,8,["modelValue"]),o(u,{placeholder:"\u4E1A\u52A1\u516C\u53F8\u540D\u79F0",size:"small",modelValue:l.value.inv_company,"onUpdate:modelValue":e[2]||(e[2]=t=>l.value.inv_company=t)},null,8,["modelValue"])]),f("div",X,[o(i,{size:"small",type:"primary",onClick:e[3]||(e[3]=()=>w())},{default:p(()=>e[9]||(e[9]=[C("\u641C\u7D22")])),_:1}),o(i,{size:"small",onClick:e[4]||(e[4]=()=>w(!0))},{default:p(()=>e[10]||(e[10]=[C("\u91CD\u7F6E")])),_:1})])]),I((v(),z(x(M),{border:"",ref_key:"tableRef",ref:y,data:V.value,size:"small","row-key":"id",onSelectionChange:N},{default:p(()=>[o(r,{type:"selection",align:"center",width:"40",fixed:"left"}),(v(!0),q(Q,null,Y(x(J),(t,L)=>(v(),z(r,$({key:L,ref_for:!0},t,{"show-overflow-tooltip":""}),null,16))),128))]),_:1},8,["data"])),[[U,g.value]]),f("div",Z,[o(A,{"current-page":a.currentPage,"onUpdate:currentPage":e[5]||(e[5]=t=>a.currentPage=t),"page-size":a.pageSize,"onUpdate:pageSize":e[6]||(e[6]=t=>a.pageSize=t),total:a.total,onCurrentChange:c,onSizeChange:B,layout:"sizes, prev, pager, next","page-sizes":[15,50,100]},null,8,["current-page","page-size","total"]),o(i,{type:"primary",size:"small",onClick:P},{default:p(()=>e[11]||(e[11]=[C("\u786E\u5B9A")])),_:1})])]),_:1},8,["modelValue"])}}});var ne=R(ee,[["__scopeId","data-v-6b3c49fd"],["__file","D:/work/jiesuan/settle-vue3/src/views/InvoiceSales/returnTicket/components/create-return-ticket/capital-modal.vue"]]);export{ne as default};
