import{ch as B,a5 as N,_ as k,d as A,n as i,aa as I,r as s,o as v,A as F,y as a,h as o,i as R,cd as S,a as T,c as M,F as O,z as U,e as j,H as q,cD as L}from"./index.js";const{VITE_PROXY_DOMAIN_REAL:K,VITE_PROXY_USER_REAL:P}=N(),E=P+"/admin/",G=c=>B.request("post",`${E}invinterfacelist`,{data:c}),z=c=>B.request("post",`${E}invinterfacecheck`,{data:c}),X={class:"w-full flex justify-end"},Y=A({__name:"invoice-modal",emits:["refresh"],setup(c,{expose:b,emit:g}){const y=g,t=i({id:"",invNo:"",status:""}),d=i(!1),m=i(!1),f=i("0"),_=i(null),D=I(()=>[...f.value==="0"?[{value:"0",label:"\u91CD\u65B0\u5F00\u7968"}]:[],{value:"1",label:"\u91CD\u65B0\u83B7\u53D6\u5F00\u7968\u4FE1\u606F"}]),V={status:[{required:!0,message:"\u8BF7\u9009\u62E9\u72B6\u6001",trigger:"change"}],id:[{required:!0,message:"\u8BF7\u9009\u62E9\u4E00\u6761\u5F00\u7968\u7533\u8BF7",trigger:"change"}]};async function w(){var r;m.value=!0;try{await((r=_.value)==null?void 0:r.validate());const{id:e,status:n}=t.value,u=async()=>{const p=await z({id:e,status:n});Number(p.code)===0&&(d.value=!1,y("refresh"))};Number(n)===0?L.confirm("\u6CE8\u610F\u4E0B\u5927\u8C61\u540E\u53F0\u662F\u5426\u5DF2\u7ECF\u5F00\u51FA ",{type:"warning",confirmButtonText:"\u786E\u8BA4",cancelButtonText:"\u53D6\u6D88"}).then(async()=>{await u()}):await u()}catch{}finally{m.value=!1}}return b({onDisplay:r=>{const{id:e,invNo:n,KPFS:u}=r;f.value=String(u),t.value={id:e,status:"",invNo:n},d.value=!0}}),(r,e)=>{const n=s("el-input"),u=s("el-form-item"),p=s("el-option"),h=s("el-select"),x=s("el-button"),C=s("el-dialog");return v(),F(C,{modelValue:d.value,"onUpdate:modelValue":e[2]||(e[2]=l=>d.value=l),"close-on-click-modal":!1,"close-on-press-escape":!1,title:"\u4FEE\u6539\u91D1\u7A0E\u5F00\u7968",center:""},{default:a(()=>[o(R(S),{ref_key:"formRef",ref:_,size:"small","label-width":"120px",rules:V,model:t.value},{default:a(()=>[o(u,{label:"\u5F00\u7968\u7533\u8BF7\u7F16\u53F7",prop:"id"},{default:a(()=>[o(n,{modelValue:t.value.invNo,"onUpdate:modelValue":e[0]||(e[0]=l=>t.value.invNo=l),disabled:""},null,8,["modelValue"])]),_:1}),o(u,{label:"\u72B6\u6001",prop:"status"},{default:a(()=>[o(h,{class:"w-full",modelValue:t.value.status,"onUpdate:modelValue":e[1]||(e[1]=l=>t.value.status=l),placeholder:"\u8BF7\u9009\u62E9\u72B6\u6001"},{default:a(()=>[T(' <el-option label="\u91CD\u65B0\u5F00\u7968" value="0"  /> '),(v(!0),M(O,null,U(D.value,l=>(v(),F(p,{label:l.label,value:l.value},null,8,["label","value"]))),256))]),_:1},8,["modelValue"])]),_:1}),o(u,null,{default:a(()=>[j("div",X,[o(x,{type:"primary",loading:m.value,onClick:w},{default:a(()=>e[3]||(e[3]=[q("\u4FDD\u5B58")])),_:1},8,["loading"])])]),_:1})]),_:1},8,["model"])]),_:1},8,["modelValue"])}}});var $=k(Y,[["__file","D:/work/jiesuan/settle-vue3/src/views/InvoiceSales/updateInvoice/components/invoice-modal.vue"]]),J=Object.freeze(Object.defineProperty({__proto__:null,default:$},Symbol.toStringTag,{value:"Module"}));export{$ as I,G as h,J as i};
