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