import{_ as L,d as V,m as j,n as i,Q as H,cC as $,r as _,aw as G,o as S,c as k,h as p,i as u,d1 as M,B as Q,y as v,H as B,G as U,dc as W,ee as J,cW as K,cm as C}from"./index.js";import{a as X}from"./inv-open.b2ee78c0.js";import{useColumns as Y}from"./columns.17ba95.js";const Z={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:X}]};const ee={relative:""},te=V({__name:"search-check",props:{payload:{type:Object,required:!0}},emits:["confirm"],setup(F,{emit:b}){const{columns:P}=Y(),{logout:x}=j(),d=i(!1),y=i([]),r=i([]),E=i(),t=H({total:0,pageSize:15,currentPage:1,background:!0,pageSizes:[15,50,100]}),A=F,w=b;let f={};const z=i({}),{handleSearchClick:D,handleResetClick:N}=$(e=>(f=e,t.currentPage=1,s(),{result:{},deleteProps:[]}),()=>{f={},s()}),T=e=>{t.currentPage=e,s()};function I(){t.currentPage=1,t.pageSize=15,N()}function R(e){r.value=e}async function s(){d.value=!0;const{currentPage:e,pageSize:n}=t,{cxCode:a,...m}=f,{code:g,data:c,message:h}=await J({...A.payload,inv_is:"1",cat_status:"2",inv_status:"0",status:"3",cxCode:a&&[a],...m,page:e,size:n,...z.value});K({code:g,message:h,logout:x,handler:()=>{const{list:o,count:l}=c!=null?c:{};y.value=o!=null?o:[],t.total=l!=null?l:0}}),d.value=!1}function q(e){t.pageSize=e,t.currentPage=1,s()}function O(){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"),n=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(n.length!==0)return C.error(`\u9500\u552E\u8BA2\u5355 ${n[0].sequenceNo} \u5F00\u7968\u6570\u91CF\u4E3A\u96F6`);w("confirm",u(r))}return s(),(e,n)=>{const a=_("el-tag"),m=_("PureTable"),g=_("el-button"),c=G("loading");return S(),k("div",ee,[p(u(M),{class:"search",onResetBtnClick:I,onSearchBtnClick:u(D),"form-config":u(Z)},null,8,["onSearchBtnClick","form-config"]),Q((S(),k("div",null,[p(m,{ref_key:"tableRef",ref:E,border:"",align:"left","row-key":"id","table-layout":"auto",size:"small",data:y.value,columns:u(P),pagination:t,paginationSmall:!0,"max-height":"560px","header-cell-style":{background:"#fafafa",color:"#606266"},onSelectionChange:R,onCurrentChange:T,onSizeChange:q},{platform_type:v(h=>[p(a,null,{default:v(()=>{var o;return[B(U(((o=u(W).find(({value:l})=>l===h.row.platform_type))==null?void 0:o.label)||"--"),1)]}),_:2},1024)]),_:1},8,["data","columns","pagination"])])),[[c,d.value]]),p(g,{absolute:"","bottom-0px":"",right:"20px",type:"primary",onClick:O,size:"small"},{default:v(()=>n[0]||(n[0]=[B("\u4FDD\u5B58")])),_:1})])}}});var ue=L(te,[["__scopeId","data-v-2ce636e8"],["__file","D:/work/jiesuan/settle-vue3/src/views/InvoiceSales/invoiceApply/components/add-edit-form/search-check.vue"]]);export{ue as default};
