index.c262eb.js 5.9 KB

1
  1. import{am as B,db as I,aR as A,bb as w,bO as Z,_ as K,d as Q,x as l,ai as X,aM as Y,p as ee,W as ue,bc as S,aZ as N,r as c,aD as oe,H as te,m as t,o as D,G as C,D as a,l as i,J as v,M as P,a as F,bd as ne,dP as ie}from"./index.js";import{e as se}from"./index.2fb9f37c.js";import le from"./invoice-modal.bd7cf9.js";import{u as _,w as ae}from"./xlsx.ed122d16.js";import re from"./index.217fef.js";import pe from"./create-modal.cd8660.js";import ce from"./choose-modal.eafc69.js";import"./index.bf16817a.js";import"./ticketReturn.6df30604.js";import"./porder.9a85976d.js";import"./execl-upload.7c83427b.js";import"./_rules.731b2b7a.js";import"./global.9ad647c8.js";import"./index.1e471a82.js";const de=[{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:d,props:n})=>B(A,{size:n.size},{default:()=>{var r;return((r=I.find(b=>String(d.status)===String(b.value)))==null?void 0:r.label)||"--"}})},{label:"\u5356\u51FA\u65B9\u516C\u53F8",prop:"supplierName",width:145,...w("supplierNo","supplierName","\u5356\u51FA\u65B9\u516C\u53F8\u7F16\u7801:")},{label:"\u4E70\u5165\u65B9\u516C\u53F8",prop:"companyName",width:145,...w("companyNo","companyName","\u4E70\u5165\u65B9\u516C\u53F8\u7F16\u7801:")},{label:"\u53D1\u7968\u7C7B\u578B",width:185,cellRenderer({row:d}){return B(A,null,{default:()=>{var n;return((n=Z.find(({value:r})=>r===d.invoice_type))==null?void 0:n.label)||"--"}})}},{label:"\u53D1\u7968\u53F7\u7801",width:110,prop:"invoice_number"},{label:"\u5907\u6CE8",width:150,prop:"remark"},{label:"\u7533\u8BF7\u4EBA",prop:"apply_name"},{label:"\u521B\u5EFA\u65F6\u95F4",prop:"createTime",width:150},{label:"\u64CD\u4F5C",fixed:"right",slot:"operation",width:140}],me={title:"\u91C7\u8D2D\u56DE\u7968",statusProp:"companyNo",columns:de,notPreview:!0,delTooltip:"\u662F\u5426\u64A4\u56DE\u91C7\u8D2D\u56DE\u7968\u7533\u8BF7",superUserNoAction:!0,apis:{httpAdd:!0,httpList:({companyNo:d,...n})=>se({...n})}},x={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:I},{field:"invoice_number",placeholder:"\u53D1\u7968\u53F7\u7801",type:"input"},{field:"supplierNo",type:"supplier-query"}]},ve={\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:""},fe=Q({__name:"index",setup(d){const n="inputInvoicePool",r="/purchase/inputInvoicePoolDetail",b=l([]),{isSuperUser:y}=X(),{hasPermissionWithCode:h,permissions:De}=Y(n),p=l(null);l(!1);const{push:R}=ee();ue();const E=l(null),k=l(null),g=l(!1),m=l({visible:!1,current:{companyNo:"",supplierNo:"",companyName:"",supplierName:""}}),{run:Ce,loading:U}=S({success:()=>{var o;N.success("\u64A4\u9500\u6210\u529F"),(o=p.value)==null||o.onSearch()}}),{run:T,loading:M}=S({success(){var o;N.success("\u5220\u9664\u6210\u529F!"),(o=p.value)==null||o.onSearch()}}),L={pageSearchHook:()=>ne(void 0,void 0,x)},$={content:{preview:({InvCode:o})=>R(`${r}?id=${o}`),create:()=>g.value=!0}};function z(){const o=_.book_new(),u=_.json_to_sheet([ve]);_.book_append_sheet(o,u,"sheet"),ae(o,"\u53D1\u7968\u4FE1\u606F\u6A21\u677F.xlsx",{bookType:"xlsx"})}function O(o){m.value.current={...o},m.value.visible=!0}function V(o){T(ie({InvCode:o.InvCode}))}return(o,u)=>{const f=c("ElButton"),j=c("ElTooltip"),H=c("el-button"),W=c("ElPopconfirm"),q=c("PageContainer"),G=c("PageAuth"),J=oe("loading");return te((D(),C(G,{pageName:n},{default:a(()=>[i(q,{hooks:L,events:$,contentConfig:t(me),"search-config":t(x),"get-content-ref":e=>p.value=e,onContentSelectChange:u[1]||(u[1]=e=>b.value=e)},{content_header:a(()=>[i(f,{size:"small",icon:t(v)("arrow-down-line"),onClick:z},{default:a(()=>[P("\u4E0B\u8F7D\u53D1\u7968\u4FE1\u606F\u6A21\u677F")]),_:1},8,["icon"]),t(h)("033")?(D(),C(f,{key:0,size:"small",type:"primary",icon:t(v)("arrow-up-line"),onClick:u[0]||(u[0]=()=>k.value.onDisplay())},{default:a(()=>[P("\u4E0A\u4F20\u53D1\u7968\u4FE1\u606F ")]),_:1},8,["icon"])):F("v-if",!0)]),content_action:a(e=>[F(` v-if="String(row.status) === '1' || String(row.status) === '2' || String(row.status) === '5'" `),i(f,{link:"",type:"primary",icon:t(v)("scaletooriginal"),onClick:()=>E.value.onDisplay({...e,invoiceNumber:e.invoice_number})},null,8,["icon","onClick"]),i(j,{content:"\u7ED1\u5B9A\u516C\u53F8"},{default:a(()=>[t(h)("066")&&!t(y)&&String(e.status)==="1"?(D(),C(f,{key:0,link:"",type:"primary",icon:t(v)("home-filled"),onClick:s=>O(e)},null,8,["icon","onClick"])):F("v-if",!0)]),_:2},1024),(String(e.status)==="1"||String(e.status)==="2"||String(e.status)==="5")&&t(h)("006")&&!t(y)?(D(),C(W,{key:0,title:"\u662F\u5426\u786E\u8BA4\u5220\u9664?",onConfirm:s=>V(e)},{reference:a(()=>[i(H,{class:"reset-margin",link:"",type:"primary",size:"mini",icon:t(v)("delete")},null,8,["icon"])]),_:2},1032,["onConfirm"])):F("v-if",!0)]),_:1},8,["contentConfig","search-config","get-content-ref"]),i(le,{ref_key:"invoiceModalRef",ref:E},null,512),i(ce,{data:m.value.current,visible:m.value.visible,"onUpdate:visible":u[2]||(u[2]=e=>m.value.visible=e),onRefresh:u[3]||(u[3]=e=>{var s;return(s=p.value)==null?void 0:s.onSearch()})},null,8,["data","visible"]),i(pe,{visible:g.value,"onUpdate:visible":u[4]||(u[4]=e=>g.value=e),onRefresh:u[5]||(u[5]=e=>{var s;return(s=p.value)==null?void 0:s.onSearch()})},null,8,["visible"]),i(re,{ref_key:"excelUploadInvRef",ref:k,onOnSuccess:u[6]||(u[6]=()=>p.value.onSearch())},null,512)]),_:1})),[[J,t(U)||t(M)]])}}});var xe=K(fe,[["__file","C:/Users/89793/Desktop/projects/settle-vue3/src/views/purchaseNew/inputInvoicePool/index.vue"]]);export{xe as default};