import{_ as J,d as W,n as f,Q as X,cb as Z,O as $,r as u,aw as ee,o as s,A as v,y as t,h as l,i as y,df as oe,a as le,H as d,B as te,cY as ae,c as h,F as ne,z as ue,d6 as se,G as g,et as pe,eC as ie,fb as re,e as T,cm as me}from"./index.js";import{c as de}from"./_details.7fd25590.js";import{f as ce}from"./index.41007914.js";const fe={key:3},_e={key:4},ve={key:5},ye={flex:""},ge={"w-full":"",flex:"","justify-end":"","mt-2":""},Ne=W({__name:"choose-modal",emits:["choose"],setup(ke,{expose:U,emit:O}){const R=O,V=f(!1),A=f([]),b=f([]),p=X({total:0,size:15,page:1,background:!0}),a=f({invoiceNumber:"",apply_name:"",currentValue:"",supplierNo:"",payNo:"",hpNo:"",checkApi:"",timer:[],openTimer:[]}),x=f(null),L=f("hpNo"),D=f(!1),P=Z(),{currentCompany:H}=$();async function C(){const{size:n,page:e}=p;D.value=!0;const{currentValue:i,timer:c,openTimer:_,...F}=a.value,{code:E,message:z,data:N}=await ce({status:"4",[L.value]:i,supplierNo:H.value.companyNo,open_start:_[0],open_end:_[1],start:c[0],end:c[1],...F,page:e,size:n});P({code:E,message:z,handler:()=>{p.total=N.count,A.value=N.list}}),D.value=!1}function M(){const[n]=b.value;if(!n)return me.warning("\u8BF7\u9009\u62E9\u4E00\u4E2A\u53D1\u7968\u5173\u8054");R("choose",{hpNo:n.hpNo,InvCode:n.payNo}),V.value=!1}function j(n){if(n.length>1){const e=n.pop();x.value.clearSelection(),x.value.toggleRowSelection(e,!0),b.value=[e]}else b.value=[n[0]]}function q(){p.page=1,C()}function S(n){n&&(a.value={is_comon:"0",apply_name:"",currentValue:"",supplierNo:"",payNo:"",hpNo:"",checkApi:"",openTimer:[],timer:[]}),p.page=1,C()}return U({onDisplay:()=>V.value=!0}),(n,e)=>{const i=u("el-col"),c=u("ElInput"),_=u("el-button"),F=u("el-form-item"),E=u("el-row"),z=u("el-form"),N=u("el-table-column"),B=u("el-tag"),w=u("IconifyIconOffline"),I=u("ElTooltip"),G=u("el-pagination"),K=u("el-dialog"),Q=ee("loading");return s(),v(K,{"close-on-click-modal":!1,modelValue:V.value,"onUpdate:modelValue":e[9]||(e[9]=o=>V.value=o),title:"\u4E70\u5165\u53D1\u7968\u5173\u8054\u7BA1\u7406",center:"",width:"1040px",onOpen:e[10]||(e[10]=()=>C())},{default:t(()=>[l(z,{size:"small"},{default:t(()=>[l(E,{gutter:10},{default:t(()=>[l(i,{span:8},{default:t(()=>[l(y(oe),{prefix:"\u65B0\u5EFA",modelValue:a.value.timer,"onUpdate:modelValue":e[0]||(e[0]=o=>a.value.timer=o)},null,8,["modelValue"])]),_:1}),le(` <el-col :span="8">\r
          <supplier-query v-model="formData.supplierNo" placeholder="\u5356\u51FA\u65B9\u516C\u53F8\u540D\u79F0" />\r
        </el-col> `),l(i,{span:8},{default:t(()=>[l(c,{modelValue:a.value.hpNo,"onUpdate:modelValue":e[1]||(e[1]=o=>a.value.hpNo=o),placeholder:"\u5BF9\u8D26\u56DE\u7968\u7F16\u53F7"},null,8,["modelValue"])]),_:1}),l(i,{span:8},{default:t(()=>[l(c,{modelValue:a.value.payNo,"onUpdate:modelValue":e[2]||(e[2]=o=>a.value.payNo=o),placeholder:"\u53D1\u7968\u7F16\u7801"},null,8,["modelValue"])]),_:1}),l(i,{span:8,class:"mt-[10px]"},{default:t(()=>[l(c,{modelValue:a.value.invoiceNumber,"onUpdate:modelValue":e[3]||(e[3]=o=>a.value.invoiceNumber=o),placeholder:"\u53D1\u7968\u53F7\u7801"},null,8,["modelValue"])]),_:1}),l(i,{span:8,class:"mt-[10px]"},{default:t(()=>[l(c,{modelValue:a.value.apply_name,"onUpdate:modelValue":e[4]||(e[4]=o=>a.value.apply_name=o),placeholder:"\u7533\u8BF7\u4EBA"},null,8,["modelValue"])]),_:1}),l(i,{span:4,class:"mt-[10px]"},{default:t(()=>[l(F,null,{default:t(()=>[l(_,{type:"primary",onClick:e[5]||(e[5]=()=>S())},{default:t(()=>e[11]||(e[11]=[d("\u641C\u7D22")])),_:1}),l(_,{onClick:e[6]||(e[6]=()=>S(!0))},{default:t(()=>e[12]||(e[12]=[d("\u91CD\u7F6E")])),_:1})]),_:1})]),_:1})]),_:1})]),_:1}),te((s(),v(y(ae),{border:"",ref_key:"tableRef",ref:x,data:A.value,size:"small","row-key":"id",onSelectionChange:j,"mb-2":"","max-height":"520px"},{default:t(()=>[l(N,{type:"selection",width:"40",align:"center",fixed:"left"}),(s(!0),h(ne,null,ue(y(de),(o,Y)=>(s(),v(N,se({key:Y,ref_for:!0},o,{"show-overflow-tooltip":""}),{default:t(({row:r})=>[o.prop==="pay_status"?(s(),v(B,{key:0,size:"small"},{default:t(()=>{var m;return[d(g((m=y(pe).find(k=>k.value===String(r.pay_status)))==null?void 0:m.label),1)]}),_:2},1024)):o.prop==="checkApi"?(s(),v(B,{key:1,size:"small"},{default:t(()=>{var m;return[d(g((m=y(ie).find(k=>k.value===String(r.checkApi)))==null?void 0:m.label),1)]}),_:2},1024)):o.prop==="is_comon"?(s(),v(B,{key:2},{default:t(()=>{var m;return[d(g((m=y(re).find(k=>k.value===r.is_comon))==null?void 0:m.label),1)]}),_:2},1024)):o.prop==="supplierName"?(s(),h("span",fe,[l(I,{placement:"left",content:"\u4F9B\u5E94\u5546\u7F16\u7801:"+r.supplierNo},{default:t(()=>[l(w,{class:"inline-block mr-[2px] cursor-pointer",icon:"information-line"})]),_:2},1032,["content"]),d(" "+g(r.supplierName),1)])):o.prop==="companyName"?(s(),h("span",_e,[l(I,{placement:"left",content:"\u4E1A\u52A1\u516C\u53F8\u7F16\u7801:"+r.companyNo},{default:t(()=>[l(w,{class:"inline-block mr-[2px] cursor-pointer",icon:"information-line"})]),_:2},1032,["content"]),d(" "+g(r.companyName),1)])):(s(),h("span",ve,g(r[o.prop]),1))]),_:2},1040))),128))]),_:1},8,["data"])),[[Q,D.value]]),T("div",ye,[l(G,{"current-page":p.page,"onUpdate:currentPage":e[7]||(e[7]=o=>p.page=o),"page-size":p.size,"onUpdate:pageSize":e[8]||(e[8]=o=>p.size=o),total:p.total,onCurrentChange:C,"page-sizes":[15,50,100],onSizeChange:q,layout:"sizes, prev, pager, next"},null,8,["current-page","page-size","total"]),T("div",ge,[l(_,{type:"primary",onClick:M},{default:t(()=>e[13]||(e[13]=[d("\u4FDD\u5B58")])),_:1})])])]),_:1},8,["modelValue"])}}});var be=J(Ne,[["__scopeId","data-v-c9b8d1ae"],["__file","D:/work/jiesuan/settle-vue3/src/views/supplyNew/unInvoiceRelation/components/choose-modal.vue"]]);export{be as default};
