import{_ as z,d as V,v as I,w as m,Z as P,aP as R,r,aC as $,o as y,c as E,l,u as c,aq as K,aX as O,H,C as v,M as C,L,b as M,aY as i,bn as U}from"./index.1d1a5ecb.js";import{i as W}from"./index.5fa131c7.js";import{useColumns as X}from"./columns.05c114a8.js";import{u as Y}from"./status.d6b2a53d.js";const Z={relative:""},G={class:"flex justify-end mt-10px"},J=V({__name:"search-batch",props:{payload:{type:Object,required:!0}},emits:["reload","confirm"],setup(b,{emit:x}){const w=b,{columns:p}=X();p.value=p.value.slice(1);const{logout:B}=I(),d=m(!1),a=m([]),D=m(),A=P({total:0,pageSize:15,currentPage:1,background:!0,pageSizes:[15,50,100]}),n=R("");async function S(u=[]){d.value=!0;const{currentPage:e,pageSize:t}=A,{code:o,data:s,message:f}=await W({...w.payload,sequenceNo:u.join(","),inv_is:"1",cat_status:"2",inv_status:"0",page:e,size:t});U({code:o,message:f,logout:B,handler:()=>{a.value=s!=null?s:[],n.value=""}}),d.value=!1}const g=" ",h=`
`,N=function(u=""){if(!u)return"";let e=u;const t=e.includes(g),o=e.includes(h);return t&&(e=e.split(g).join("")),o&&(e=e.split(h).join("")),e};function k(){const u=N(n.value);if(u.length===0){i.warning("\u4E0D\u80FD\u89E3\u6790\u7A7A\u6587\u672C"),n.value=u;return}const t=u.replace(/[，。；、; .]/g,",").split(",");S(t)}function T(){if(a.value.length===0)return i.error("\u81F3\u5C11\u6DFB\u52A0\u4E00\u4E2A\u9500\u552E\u8BA2\u5355\uFF01");const u=a.value.filter(t=>t.winv_fee==="0.00"),e=a.value.filter(t=>String(t.winv_num)==="0");if(u.length!==0)return i.error(`\u9500\u552E\u8BA2\u5355 ${u[0].sequenceNo} \u5F00\u7968\u91D1\u989D\u4E3A\u96F6`);if(e.length!==0)return i.error(`\u9500\u552E\u8BA2\u5355 ${e[0].sequenceNo} \u5F00\u7968\u6570\u91CF\u4E3A\u96F6`);x("confirm",c(a))}return(u,e)=>{const t=r("ElInput"),o=r("el-tag"),s=r("PureTable"),f=r("el-button"),j=$("loading");return y(),E("div",Z,[l(t,{rows:4,modelValue:c(n),"onUpdate:modelValue":e[0]||(e[0]=_=>K(n)?n.value=_:null),style:{"margin-bottom":"10px"},placeholder:"\u8F93\u5165\u9500\u552E\u5355\u7F16\u7801(\u5C0F\u4E8E100\u6761)\uFF0C\u7CFB\u7EDF\u652F\u6301\u7684\u5206\u5272\u7B26\u4E3A\u9017\u53F7(,)\u3001\u53E5\u53F7(.)\u3001\u5206\u53F7(;)\u3001\u987F\u53F7(\u3001)\uFF0C\u56DE\u8F66\u540E\u5F00\u59CB\u89E3\u6790\u3002",type:"textarea",onKeydown:O(k,["enter"])},null,8,["modelValue","onKeydown"]),H((y(),E("div",null,[l(s,{ref_key:"tableRef",ref:D,border:"",align:"left","row-key":"id","table-layout":"auto",size:"small",data:a.value,columns:c(p),"max-height":"560px","header-cell-style":{background:"#fafafa",color:"#606266"}},{platform_type:v(_=>[l(o,null,{default:v(()=>{var F;return[C(L(((F=c(Y).find(({value:q})=>q===_.row.platform_type))==null?void 0:F.label)||"--"),1)]}),_:2},1024)]),_:1},8,["data","columns"])])),[[j,d.value]]),M("div",G,[l(f,{type:"primary",onClick:T,size:"small"},{default:v(()=>[C("\u4FDD\u5B58")]),_:1})])])}}});var ae=z(J,[["__scopeId","data-v-4a667fcc"],["__file","C:/Users/63107/Desktop/projects/accout-vue3-ui/src/views/InvoiceSales/invoiceApply/components/add-edit-form/search-batch.vue"]]);export{ae as default};
