index.ace80d96.js 6.8 KB

1
  1. import{aj as v,aF as B,_ as Q,d as X,aZ as ee,E as i,ai as ue,a5 as te,b8 as R,A as oe,x as h,o as p,N as c,K as l,y as d,u as t,R as _,a as F,W as E,aS as N,ah as M}from"./index.1417328f.js";import{c as ne,b as ae,a as le}from"./index.cc00443d.js";import{a as U}from"./inv-open.516190c3.js";import{i as re,e as se,f as ie}from"./status.727086c1.js";import{u as pe}from"./use-page-search.7e7b4728.js";import ce from"./post-modal.8569f292.js";import de from"./index.c79ed301.js";import{h as fe}from"./export.0c2421ad.js";import{u as C,w as Fe}from"./xlsx.ed122d16.js";import me from"./back-modal.67b75574.js";import"./tootip.8c37fa8a.js";import"./execl-upload.2ed330c3.js";import"./status.4c13d767.js";const he=[{label:"\u53D1\u7968\u7533\u8BF7\u7F16\u53F7",prop:"invNo",width:155},{label:"\u4E1A\u52A1\u4F01\u4E1A\u7F16\u53F7",prop:"inv_out",width:155},{label:"\u5BA2\u6237\u516C\u53F8\u540D\u79F0",prop:"buyer_title",width:175},{label:"\u7533\u8BF7\u989D\u5EA6",prop:"inv_value",width:110},{label:"\u72B6\u6001",prop:"status",width:125,cellRenderer:({row:r})=>v(B,null,{default:()=>{var o;return((o=U.find(n=>n.value==r.status+""))==null?void 0:o.label)||"--"}})},{label:"\u53D1\u7968\u7C7B\u578B",prop:"status",minWidth:160,cellRenderer:({row:r})=>v(B,null,{default:()=>{var o;return((o=re.find(n=>n.value==r.inv_type+""))==null?void 0:o.label)||"--"}})},{label:"\u53D1\u7968\u53F7\u7801",prop:"inv_number",width:130},{label:"\u53D1\u7968\u4EE3\u7801",prop:"inv_code",width:100},{label:"\u8D2D\u4E70\u65B9\u62AC\u5934\u72B6\u6001",prop:"seller_check",width:130,cellRenderer:({row:r})=>v(B,null,{default:()=>{var o;return((o=se.find(n=>n.value==r.seller_check+""))==null?void 0:o.label)||"--"}})},{label:"\u9500\u552E\u65B9\u62AC\u5934\u72B6\u6001",prop:"buyer_check",width:130,cellRenderer:({row:r})=>v(B,null,{default:()=>{var o;return((o=ie.find(n=>n.value==r.buyer_check+""))==null?void 0:o.label)||"--"}})},{label:"\u7533\u8BF7\u4EBA",prop:"apply_name",width:80},{label:"\u521B\u5EFA\u65F6\u95F4",width:140,prop:"addtime"},{label:"\u64CD\u4F5C",fixed:"right",width:140,slot:"operation"}],_e={title:"\u53D1\u7968\u7533\u8BF7\u7BA1\u7406",columns:he,superUserNoAction:!0,companyProp:"inv_out",apis:{httpList:ne,httpAdd:!0}},T={colLayout:{span:8},formItems:[{field:"invNo",type:"input",placeholder:"\u53D1\u7968\u7533\u8BF7\u7F16\u53F7"},{field:"buyer_name",type:"input",placeholder:"\u5BA2\u6237\u540D\u79F0"},{field:"apply_name",type:"input",placeholder:"\u7533\u8BF7\u4EBA"},{field:"status",type:"select",placeholder:"\u72B6\u6001",span:4,options:U},{field:"timer",type:"date_picker",otherOptions:{type:"daterange",startProp:"start",endProp:"end",startPlaceholder:"\u7533\u8BF7\u5F00\u59CB\u65F6\u95F4",endPlaceholder:"\u7533\u8BF7\u7ED3\u675F\u65F6\u95F4"}}]},ye={\u53D1\u7968\u7533\u8BF7\u7F16\u53F7:"INV20210712w0vHkk",\u53D1\u7968\u7C7B\u578B:"\u589E\u503C\u7A0E\u7535\u5B50\u666E\u901A\u53D1\u7968",\u53D1\u7968\u4EE3\u7801:"011002000711",\u53D1\u7968\u53F7\u7801:"51678540",\u4EF7\u7A0E\u5408\u8BA1:"4900",\u53D1\u7968\u91D1\u989D:"",\u6821\u9A8C\u7801:"",\u5F00\u7968\u65E5\u671F:"2020/12/17 0:00:00"},ve=E("\u5F00\u7968\u4FE1\u606F\u5BFC\u51FA"),Be=E("\u4E0B\u8F7D\u53D1\u7968\u4FE1\u606F\u5BFC\u5165\u6A21\u677F"),De=E("\u6279\u91CF\u5BFC\u5165\u8D22\u52A1\u5F00\u7968\u7ED3\u679C\uFF08\u53D1\u7968\u7533\u8BF7\uFF09"),ge=X({__name:"index",setup(r){const o="invoiceApply",{hasPermissionWithCode:n}=ee(o),y=i(!1),k="/InvoiceSales/invoiceApplyDetail",A=i(null),b=i(null),{isSuperUser:D}=ue(),m=i(null),w=i(null),{currentCompany:I}=te(),{run:V}=R({success:()=>m.value.onSearch()}),{run:j}=R({success:()=>m.value.onSearch()}),O=({invNo:e})=>j(ae({invNo:e,status:"7"})),{push:S}=oe(),Y=i([]),x=i(null),$={pageSearchHook:()=>pe(void 0,void 0,T)};function z(e){V(le(e))}const L={content:{preview:({invNo:e})=>S(`${k}?id=${e}`),create:()=>S(k)}},P=e=>e?M(e).format("YYYY-MM-DD"):"";async function W(){const{timer:e,...u}=w.value.getData();if(!e||e.length===0){N.warning("\u8BF7\u9009\u62E9\u5BFC\u51FA\u5F00\u7968\u7533\u8BF7\u7684\u65F6\u95F4\u533A\u95F4");return}if(Math.abs(M(e[0]).diff(e[1],"day"))>12){N.warning("\u5BFC\u51FA\u5F00\u7968\u7533\u8BF7\u7684\u65F6\u95F4\u533A\u95F4\u4E0D\u80FD\u8D85\u8FC712\u5929");return}const f={start:P(e[0]),end:P(e[1])};await fe({url:"/ipe",name:`${f.start}\u81F3${f.end}\u5F00\u7968\u4FE1\u606F`,onStart:()=>y.value=!0,onSuccess:()=>y.value=!1,onFail:()=>y.value=!1,params:{...u,...f,inv_out:I.value.companyNo}})}function H(){const e=C.book_new(),u=C.json_to_sheet([ye]);C.book_append_sheet(e,u,"sheet"),Fe(e,"\u5F00\u7968\u6A21\u677F.xlsx",{bookType:"xlsx"})}return(e,u)=>{const s=h("ElButton"),f=h("ElTooltip"),q=h("ElPopconfirm"),K=h("PageContainer"),Z=h("PageAuth");return p(),c(Z,{pageName:o},{default:l(()=>[d(K,{hooks:$,events:L,contentConfig:t(_e),"search-config":t(T),"get-content-ref":a=>m.value=a,"get-search-ref":a=>w.value=a,onContentSelectChange:u[3]||(u[3]=a=>Y.value=a)},{content_header:l(()=>[t(n)("026")?(p(),c(s,{key:0,icon:t(_)("arrow-up-line"),size:"small",loading:y.value,onClick:u[0]||(u[0]=()=>W())},{default:l(()=>[ve]),_:1},8,["icon","loading"])):F("v-if",!0),t(n)("027")?(p(),c(s,{key:1,icon:t(_)("arrow-down-line"),size:"small",onClick:u[1]||(u[1]=()=>H())},{default:l(()=>[Be]),_:1},8,["icon"])):F("v-if",!0),!t(D)&&t(n)("028")?(p(),c(s,{key:2,onClick:u[2]||(u[2]=()=>b.value.onDisplay()),size:"small"},{default:l(()=>[De]),_:1})):F("v-if",!0)]),content_action:l(({status:a,post_code:G,invNo:g,inv_type:J})=>[!t(D)&&String(a)==="3"&&!G?(p(),c(f,{key:0,content:"\u586B\u5199\u7269\u6D41",placement:"top"},{default:l(()=>[d(s,{text:"",type:"primary",style:{"margin-left":"0px"},icon:t(_)("promotion"),onClick:()=>A.value.onDisplay(g)},null,8,["icon","onClick"])]),_:2},1024)):F("v-if",!0),(String(a)==="1"||String(a)==="5")&&t(n)("010")&&!t(D)?(p(),c(q,{key:1,placement:"top",title:"\u662F\u5426\u786E\u8BA4\u64A4\u9500\u5F00\u7968\u7533\u8BF7?","on-confirm":()=>O({invNo:g})},{reference:l(()=>[d(s,{text:"",type:"primary",style:{"margin-left":"0px","padding-right":"0px"},icon:t(_)("refresh-right")},null,8,["icon"])]),_:2},1032,["on-confirm"])):F("v-if",!0),String(a)==="5"&&t(n)("005")?(p(),c(f,{key:2,content:"\u4FEE\u6539\u53D1\u7968\u4FE1\u606F",placement:"top"},{default:l(()=>[d(s,{text:"",icon:t(_)("edit"),style:{"margin-left":"0px"},type:"primary",onClick:()=>x.value.onDisplay(J,g)},null,8,["icon","onClick"])]),_:2},1024)):F("v-if",!0)]),_:1},8,["contentConfig","search-config","get-content-ref","get-search-ref"]),d(ce,{ref_key:"postModalRef",ref:A,onPostSave:z},null,512),d(de,{ref_key:"execlUploadRef",ref:b,onOnSuccess:u[4]||(u[4]=()=>m.value.onSearch())},null,512),d(me,{ref_key:"backModalRef",ref:x,onRefresh:u[5]||(u[5]=()=>m.value.onSearch())},null,512)]),_:1})}}});var Ue=Q(ge,[["__file","/Users/apple/Desktop/Company Projects/accout-vue3-ui/src/views/InvoiceSales/invoiceApply/index.vue"]]);export{Ue as default};