import{_ as L,d as O,w as V,x as i,Z as j,bd as H,r as g,aD as M,o as S,c as b,l as p,m as o,bE as U,H as Z,D as v,M as k,L as $,bP as Q,cQ as G,bx as J,aZ as C}from"./index.js";import{a as K}from"./inv-open.90cd9d14.js";import{useColumns as W}from"./columns.17ba95.js";const X={colLayout:{span:8},formItems:[{field:"customer",type:"input",placeholder:"\u5BA2\u6237\u540D\u79F0"},{field:"sequenceNo",type:"input",placeholder:"\u9500\u552E\u8BA2\u5355\u7F16\u7801"},{field:"cxCode",type:"input",placeholder:"\u9500\u552E\u8BA2\u5355\u4E3B\u7F16\u7801"},{field:"status",type:"select",placeholder:"\u72B6\u6001",span:4,options:K}]};const Y={relative:""},ee=O({__name:"search-check",props:{payload:{type:Object,required:!0}},emits:["confirm"],setup(x,{emit:B}){const F=x,{columns:P}=W(),{logout:E}=V(),d=i(!1),y=i([]),r=i([]),A=i(),t=j({total:0,pageSize:15,currentPage:1,background:!0,pageSizes:[15,50,100]});let f={};const D=i({}),{handleSearchClick:z,handleResetClick:w}=H(e=>(f=e,t.currentPage=1,u(),{result:{},deleteProps:[]}),()=>{f={},u()}),N=e=>{t.currentPage=e,u()};function T(){t.currentPage=1,t.pageSize=15,w()}function I(e){r.value=e}async function u(){d.value=!0;const{currentPage:e,pageSize:s}=t,{cxCode:a,..._}=f,{code:h,data:c,message:m}=await G({...F.payload,inv_is:"1",cat_status:"2",inv_status:"0",status:"3",cxCode:a&&[a],..._,page:e,size:s,...D.value});J({code:h,message:m,logout:E,handler:()=>{const{list:n,count:l}=c!=null?c:{};y.value=n!=null?n:[],t.total=l!=null?l:0}}),d.value=!1}function R(e){t.pageSize=e,t.currentPage=1,u()}function q(){if(r.value.length===0)return C.error("\u81F3\u5C11\u6DFB\u52A0\u4E00\u4E2A\u9500\u552E\u8BA2\u5355\uFF01");const e=r.value.filter(a=>a.winv_fee==="0.00"),s=r.value.filter(a=>String(a.winv_num)==="0");if(e.length!==0)return C.error(`\u9500\u552E\u8BA2\u5355 ${e[0].sequenceNo} \u5F00\u7968\u91D1\u989D\u4E3A\u96F6`);if(s.length!==0)return C.error(`\u9500\u552E\u8BA2\u5355 ${s[0].sequenceNo} \u5F00\u7968\u6570\u91CF\u4E3A\u96F6`);B("confirm",o(r))}return u(),(e,s)=>{const a=g("el-tag"),_=g("PureTable"),h=g("el-button"),c=M("loading");return S(),b("div",Y,[p(o(U),{class:"search",onResetBtnClick:T,onSearchBtnClick:o(z),"form-config":o(X)},null,8,["onSearchBtnClick","form-config"]),Z((S(),b("div",null,[p(_,{ref_key:"tableRef",ref:A,border:"",align:"left","row-key":"id","table-layout":"auto",size:"small",data:y.value,columns:o(P),pagination:t,paginationSmall:!0,"max-height":"560px","header-cell-style":{background:"#fafafa",color:"#606266"},onSelectionChange:I,onCurrentChange:N,onSizeChange:R},{platform_type:v(m=>[p(a,null,{default:v(()=>{var n;return[k($(((n=o(Q).find(({value:l})=>l===m.row.platform_type))==null?void 0:n.label)||"--"),1)]}),_:2},1024)]),_:1},8,["data","columns","pagination"])])),[[c,d.value]]),p(h,{absolute:"","bottom-0px":"",right:"20px",type:"primary",onClick:q,size:"small"},{default:v(()=>[k("\u4FDD\u5B58")]),_:1})])}}});var oe=L(ee,[["__scopeId","data-v-2ce636e8"],["__file","C:/Users/89793/Desktop/projects/settle-vue3/src/views/InvoiceSales/invoiceApply/components/add-edit-form/search-check.vue"]]);export{oe as default};
