import{af as y,ez as x,ce as C,cA as B,db as O,a7 as Y,_ as $,d as j,n as i,ab as V,c9 as W,k as q,O as G,cB as J,cm as K,r as d,aw as Q,B as X,i as n,o as w,A as _,y as r,h as l,D,H as g,a as b,cC as Z}from"./index.js";import{d as ee,e as oe}from"./index.5741d39c.js";import ue from"./invoice-modal.563a08.js";import{u as h,w as te}from"./xlsx.ed122d16.js";import ne from"./index.4cdcc9.js";import le from"./choose-modal.ce3345.js";import"./index.c443965f.js";import"./execl-upload.d28cb458.js";const ae=[{type:"selection",width:40,align:"center",fixed:"left"},{label:"\u53D1\u7968\u7F16\u7801",prop:"InvCode",width:140},{label:"\u7A0E\u524D\u91D1\u989D",prop:"invoice_subtotal",width:100},{label:"\u7A0E\u540E\u91D1\u989D",prop:"invoice_total",width:100},{label:"\u72B6\u6001",prop:"status",width:120,cellRenderer:({row:u,props:a})=>y(C,{size:a.size},{default:()=>{var s;return((s=x.find(m=>String(u.status)===String(m.value)))==null?void 0:s.label)||"--"}})},{label:"\u5356\u51FA\u65B9\u516C\u53F8",prop:"supplierName",width:145,...B("supplierNo","supplierName","\u5356\u51FA\u65B9\u516C\u53F8\u7F16\u7801:")},{label:"\u4E70\u5165\u65B9\u516C\u53F8",prop:"companyName",width:145,...B("companyNo","companyName","\u4E70\u5165\u65B9\u516C\u53F8\u7F16\u7801:")},{label:"\u53D1\u7968\u7C7B\u578B",width:185,cellRenderer({row:u}){return y(C,null,{default:()=>{var a;return((a=O.find(({value:s})=>s===u.invoice_type))==null?void 0:a.label)||"--"}})}},{label:"\u53D1\u7968\u53F7\u7801",width:110,prop:"invoice_number"},{label:"\u7533\u8BF7\u4EBA",prop:"apply_name"},{label:"\u521B\u5EFA\u65F6\u95F4",prop:"addtime",width:150,formatter:({addtime:u})=>Y(u).format("YYYY-MM-DD HH:mm:ss")},{label:"\u64CD\u4F5C",fixed:"right",slot:"operation",width:140}],se={title:"\u91C7\u8D2D\u56DE\u7968",statusProp:"companyNo",columns:ae,apis:{httpDelete:ee,httpList:oe,httpAdd:!0},deleteProp:"hpNo",delTooltip:"\u662F\u5426\u64A4\u56DE\u91C7\u8D2D\u56DE\u7968\u7533\u8BF7",superUserNoAction:!0,showDelete:({status:u})=>Number(u)<=3},A={formItems:[{field:"create_timer",type:"date_picker",otherOptions:{type:"daterange",startProp:"start",endProp:"end",startPlaceholder:"\u65B0\u5EFA\u8D77\u59CB\u65F6\u95F4",endPlaceholder:"\u65B0\u5EFA\u7ED3\u675F\u65F6\u95F4"}},{field:"status",type:"select",placeholder:"\u5BA1\u6838\u72B6\u6001",options:x},{field:"supplierNo",type:"supplier-query"},{field:"apply_name",type:"input",placeholder:"\u7533\u8BF7\u4EBA"}]},ie={\u53D1\u7968\u7C7B\u578B:"",\u5F00\u7968\u65E5\u671F:"",\u53D1\u7968\u53F7\u7801:"",\u53D1\u7968\u7A0E\u540E\u91D1\u989D:"",\u53D1\u7968\u4EE3\u7801:"",\u53D1\u7968\u7A0E\u524D\u91D1\u989D:"",\u6821\u9A8C\u7801:""},k="outputInvoicePool",P="/supply/outputInvoicePoolDetail",re=j({__name:"index",setup(u){const a=i([]),{isSuperUser:s}=V(),{hasPermissionWithCode:m}=W(k),c=i(null);i(!1);const{push:F}=q();G();const N=i(null),E=i(null),p=i({visible:!1,current:{}}),{run:pe,loading:S}=J({success:()=>{var o;K.success("\u64A4\u9500\u6210\u529F"),(o=c.value)==null||o.onSearch()}}),I={pageSearchHook:()=>Z(void 0,void 0,A)},R={content:{preview:({InvCode:o})=>F(`${P}?id=${o}`),create:()=>F(P)}};function T(){const o=h.book_new(),e=h.json_to_sheet([ie]);h.book_append_sheet(o,e,"sheet"),te(o,"\u53D1\u7968\u4FE1\u606F\u6A21\u677F.xlsx",{bookType:"xlsx"})}function M(o){p.value.current={...o},p.value.visible=!0}return(o,e)=>{const f=d("ElButton"),U=d("ElTooltip"),z=d("PageContainer"),L=d("PageAuth"),H=Q("loading");return X((w(),_(L,{pageName:k},{default:r(()=>[l(z,{hooks:I,events:R,contentConfig:n(se),"search-config":n(A),"get-content-ref":t=>c.value=t,onContentSelectChange:e[1]||(e[1]=t=>a.value=t)},{content_header:r(()=>[l(f,{size:"small",icon:n(D)("arrow-down-line"),onClick:T},{default:r(()=>e[5]||(e[5]=[g("\u4E0B\u8F7D\u53D1\u7968\u4FE1\u606F\u6A21\u677F")])),_:1},8,["icon"]),l(f,{size:"small",type:"primary",icon:n(D)("arrow-up-line"),onClick:e[0]||(e[0]=()=>E.value.onDisplay())},{default:r(()=>e[6]||(e[6]=[g("\u4E0A\u4F20\u53D1\u7968\u4FE1\u606F ")])),_:1},8,["icon"])]),content_action:r(t=>[b(` <ElButton\r
          v-if="invStatus.includes(String(row.status))"\r
          link\r
          type="primary"\r
          :icon="useRenderIcon('scaletooriginal')"\r
          @click="() => invoiceModalRef.onDisplay(row)"\r
        />\r
        <ElTooltip \r
          v-if="row.status == '11' && hasPermissionWithCode('010') && row.has_account != 1" \r
          content="\u64A4\u9500\u56DE\u7968\u7533\u8BF7" \r
          placement="top"\r
        >\r
          <ElButton \r
            link \r
            type="primary" \r
            :icon="useRenderIcon('refresh')" \r
            @click="handleRefresh(row)" \r
          />\r
        </ElTooltip> `),l(U,{content:"\u7ED1\u5B9A\u516C\u53F8"},{default:r(()=>[n(m)("066")&&!n(s)?(w(),_(f,{key:0,link:"",type:"primary",icon:n(D)("home-filled"),onClick:v=>M(t)},null,8,["icon","onClick"])):b("v-if",!0)]),_:2},1024)]),_:1},8,["contentConfig","search-config","get-content-ref"]),l(ue,{ref_key:"invoiceModalRef",ref:N},null,512),l(le,{visible:p.value.visible,"onUpdate:visible":e[2]||(e[2]=t=>p.value.visible=t),data:p.value.current,onRefresh:e[3]||(e[3]=t=>{var v;return(v=c.value)==null?void 0:v.onSearch()})},null,8,["visible","data"]),l(ne,{ref_key:"excelUploadInvRef",ref:E,onOnSuccess:e[4]||(e[4]=()=>c.value.onSearch())},null,512)]),_:1})),[[H,n(S)]])}}});var Ee=$(re,[["__file","D:/work/jiesuan/settle-vue3/src/views/supply/outputInvoicePool/index.vue"]]);export{Ee as default};
