import{_ as x,d as k,ab as G,O as B,Q as I,ci as U,n as f,w as C,r as i,aw as M,o as d,A as v,y as u,B as q,i as l,cd as R,h as n,dN as F,c as Y,F as j,z as O,e as P,dm as Q,H as T,ak as z,a7 as H}from"./index.js";import{h as L}from"./export.97c4d705.js";import"./xlsx.ed122d16.js";const J={style:{width:"100%",display:"flex","justify-content":"flex-end"}},K=k({__name:"company-modal",props:{visible:{type:Boolean,required:!0}},setup(h){const _=h,{isSuperUser:D,userInfo:A}=G(),{currentCompany:s}=B(),o=I({month:"",companyNo:""});B();const g={month:[{required:!0,trigger:"change",message:"\u8BF7\u9009\u62E9\u6708\u4EFD"}],companyNo:[{required:!0,trigger:"change",message:"\u60F3\u9009\u62E9\u4E1A\u52A1\u516C\u53F8"}]},t=U(_,"visible"),w=f(null),r=f(!1);async function b(){const{month:m,companyNo:a}=o,p=H(m).daysInMonth(),y=m+"-01",E=m+"-"+p,c={companyNo:a,start:y,end:E,is_show_cgd:"1"};A.value.itemid=="52"&&s.value.companyNo==="GS2302231125079621"&&(c.is_show_cgd="0"),await L({url:"http://rep.report.caixiao365.com/admin/Everyday/EveryInvByQrd",name:"\u53D1\u7968\u7533\u8BF7\u8BA2\u5355\u660E\u7EC6\u5BFC\u51FA(\u4E1A\u52A1\u516C\u53F8)",noBaseUrl:!0,onStart:()=>r.value=!0,onSuccess:()=>{r.value=!1,t.value=!1},onFail:()=>r.value=!1,params:c})}function S(){o.companyNo="",o.month=""}const N=f([]);return C(()=>_.visible,()=>{N.value=[{companyNo:"GS2402020907088731",companyName:"\u5317\u4EAC\u6CF0\u6587\u521B\u4F9B\u5E94\u94FE\u7BA1\u7406\u6709\u9650\u516C\u53F8"},{companyNo:"GS2302231125079621",companyName:"\u5317\u4EAC\u767E\u8FB0\u8363\u8FBE\u56FD\u9645\u79D1\u8D38\u6709\u9650\u516C\u53F8"},{companyNo:"GS2302231124114965",companyName:"\u666E\u6DA6&\u9526\u5174&\u77E5\u4E8B"}]}),C(()=>t.value,()=>{!t.value||(s.value.companyNo==="GS2304031312553746"||s.value.companyNo==="GS2401181650538135"?o.companyNo="GS2302231124114965":o.companyNo=s.value.companyNo)}),(m,a)=>{const p=i("ElDatePicker"),y=i("ElOption"),E=i("ElSelect"),c=i("ElDialog"),V=M("loading");return d(),v(c,{title:"\u53D1\u7968\u7533\u8BF7\u8BA2\u5355\u660E\u7EC6\u5BFC\u51FA(\u4E1A\u52A1\u516C\u53F8)",modelValue:l(t),"onUpdate:modelValue":a[2]||(a[2]=e=>z(t)?t.value=e:null),center:"",onClose:S,class:"custom-dialog"},{default:u(()=>[q((d(),v(l(R),{"label-width":"100px",model:o,rules:g,ref_key:"formRef",ref:w},{default:u(()=>[n(l(F),{label:"\u6708\u4EFD",prop:"month"},{default:u(()=>[n(p,{modelValue:o.month,"onUpdate:modelValue":a[0]||(a[0]=e=>o.month=e),style:{width:"100%"},placeholder:"\u6708\u4EFD","value-format":"YYYY-MM",type:"month",disabledDate:e=>e.getTime()>Date.now()},null,8,["modelValue","disabledDate"])]),_:1}),n(l(F),{label:"\u4E1A\u52A1\u516C\u53F8",prop:"companyNo"},{default:u(()=>[n(E,{modelValue:o.companyNo,"onUpdate:modelValue":a[1]||(a[1]=e=>o.companyNo=e),placeholder:"\u8BF7\u9009\u62E9\u516C\u53F8",style:{width:"100%"},disabled:!l(D)},{default:u(()=>[(d(!0),Y(j,null,O(N.value,e=>(d(),v(y,{key:e.companyNo,label:e.companyName,value:e.companyNo},null,8,["label","value"]))),128))]),_:1},8,["modelValue","disabled"])]),_:1}),n(l(F),null,{default:u(()=>[P("div",J,[n(l(Q),{type:"primary",onClick:b},{default:u(()=>a[3]||(a[3]=[T("\u63D0\u4EA4")])),_:1})])]),_:1})]),_:1},8,["model"])),[[V,r.value]])]),_:1},8,["modelValue"])}}});var $=x(K,[["__file","D:/work/jiesuan/settle-vue3/src/views/InvoiceSales/invoiceApply/components/company-modal.vue"]]);export{$ as default};
