import{_ as L,d as O,v as V,w as i,Z as j,r as _,aC as H,o as y,c as S,l as p,u as o,bt as M,H as U,C as g,M as k,L as $,bn as Y,aY as h}from"./index.1d1a5ecb.js";import{g as Z}from"./index.5fa131c7.js";import{u as G}from"./use-page-search.f4c305e2.js";import{a as J}from"./inv-open.21fa1eb1.js";import{useColumns as K}from"./columns.05c114a8.js";import{u as Q}from"./status.d6b2a53d.js";import"./tootip.76f6bcc3.js";const W={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:J}]};const X={relative:""},ee=O({__name:"search-check",props:{payload:{type:Object,required:!0}},emits:["confirm"],setup(b,{emit:B}){const F=b,{columns:E}=K(),{logout:P}=V(),d=i(!1),v=i([]),n=i([]),A=i(),t=j({total:0,pageSize:15,currentPage:1,background:!0,pageSizes:[15,50,100]});let f={};const x=i({}),{handleSearchClick:z,handleResetClick:D}=G(e=>(f=e,t.currentPage=1,r(),{result:{},deleteProps:[]}),()=>{f={},r()}),w=e=>{t.currentPage=e,r()};function N(){t.currentPage=1,t.pageSize=15,D()}function T(e){n.value=e}async function r(){d.value=!0;const{currentPage:e,pageSize:u}=t,{code:a,data:s,message:m}=await Z({...F.payload,inv_is:"1",cat_status:"2",inv_status:"0",...f,page:e,size:u,...x.value});Y({code:a,message:m,logout:P,handler:()=>{const{list:c,count:l}=s!=null?s:{};v.value=c!=null?c:[],t.total=l!=null?l:0}}),d.value=!1}function I(e){t.pageSize=e,t.currentPage=1,r()}function R(){if(n.value.length===0)return h.error("\u81F3\u5C11\u6DFB\u52A0\u4E00\u4E2A\u9500\u552E\u8BA2\u5355\uFF01");const e=n.value.filter(a=>a.winv_fee==="0.00"),u=n.value.filter(a=>String(a.winv_num)==="0");if(e.length!==0)return h.error(`\u9500\u552E\u8BA2\u5355 ${e[0].sequenceNo} \u5F00\u7968\u91D1\u989D\u4E3A\u96F6`);if(u.length!==0)return h.error(`\u9500\u552E\u8BA2\u5355 ${u[0].sequenceNo} \u5F00\u7968\u6570\u91CF\u4E3A\u96F6`);B("confirm",o(n))}return r(),(e,u)=>{const a=_("el-tag"),s=_("PureTable"),m=_("el-button"),c=H("loading");return y(),S("div",X,[p(o(M),{class:"search",onResetBtnClick:N,onSearchBtnClick:o(z),"form-config":o(W)},null,8,["onSearchBtnClick","form-config"]),U((y(),S("div",null,[p(s,{ref_key:"tableRef",ref:A,border:"",align:"left","row-key":"id","table-layout":"auto",size:"small",data:v.value,columns:o(E),pagination:t,paginationSmall:!0,"max-height":"560px","header-cell-style":{background:"#fafafa",color:"#606266"},onSelectionChange:T,onCurrentChange:w,onSizeChange:I},{platform_type:g(l=>[p(a,null,{default:g(()=>{var C;return[k($(((C=o(Q).find(({value:q})=>q===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:R,size:"small"},{default:g(()=>[k("\u4FDD\u5B58")]),_:1})])}}});var ce=L(ee,[["__scopeId","data-v-2ce636e8"],["__file","C:/Users/63107/Desktop/projects/accout-vue3-ui/src/views/InvoiceSales/invoiceApply/components/add-edit-form/search-check.vue"]]);export{ce as default};
