import{aU as B,ac as N,_ as k,d as A,x as i,ah as I,r as n,o as v,G as F,D as t,l as o,m as E,aQ as R,a as S,c as T,F as U,E as M,h as O,M as j,be as q}from"./index.js";const{VITE_PROXY_DOMAIN_REAL:G,VITE_PROXY_USER_REAL:L}=N(),b=L+"/admin/",K=c=>B.request("post",`${b}invinterfacelist`,{data:c}),P=c=>B.request("post",`${b}invinterfacecheck`,{data:c}),z={class:"w-full flex justify-end"},X=A({__name:"invoice-modal",emits:["refresh"],setup(c,{expose:g,emit:y}){const a=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 h(){var r;m.value=!0;try{await((r=_.value)==null?void 0:r.validate());const{id:e,status:s}=a.value,u=async()=>{const p=await P({id:e,status:s});Number(p.code)===0&&(d.value=!1,y("refresh"))};Number(s)===0?q.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 g({onDisplay:r=>{const{id:e,invNo:s,KPFS:u}=r;f.value=String(u),a.value={id:e,status:"",invNo:s},d.value=!0}}),(r,e)=>{const s=n("el-input"),u=n("el-form-item"),p=n("el-option"),C=n("el-select"),w=n("el-button"),x=n("el-dialog");return v(),F(x,{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:t(()=>[o(E(R),{ref_key:"formRef",ref:_,size:"small","label-width":"120px",rules:V,model:a.value},{default:t(()=>[o(u,{label:"\u5F00\u7968\u7533\u8BF7\u7F16\u53F7",prop:"id"},{default:t(()=>[o(s,{modelValue:a.value.invNo,"onUpdate:modelValue":e[0]||(e[0]=l=>a.value.invNo=l),disabled:""},null,8,["modelValue"])]),_:1}),o(u,{label:"\u72B6\u6001",prop:"status"},{default:t(()=>[o(C,{class:"w-full",modelValue:a.value.status,"onUpdate:modelValue":e[1]||(e[1]=l=>a.value.status=l),placeholder:"\u8BF7\u9009\u62E9\u72B6\u6001"},{default:t(()=>[S(' <el-option label="\u91CD\u65B0\u5F00\u7968" value="0"  /> '),(v(!0),T(U,null,M(E(D),l=>(v(),F(p,{label:l.label,value:l.value},null,8,["label","value"]))),256))]),_:1},8,["modelValue"])]),_:1}),o(u,null,{default:t(()=>[O("div",z,[o(w,{type:"primary",loading:m.value,onClick:h},{default:t(()=>[j("\u4FDD\u5B58")]),_:1},8,["loading"])])]),_:1})]),_:1},8,["model"])]),_:1},8,["modelValue"])}}});var Y=k(X,[["__file","C:/Users/89793/Desktop/projects/settle-vue3/src/views/InvoiceSales/updateInvoice/components/invoice-modal.vue"]]),Q=Object.freeze(Object.defineProperty({__proto__:null,default:Y},Symbol.toStringTag,{value:"Module"}));export{Y as I,K as h,Q as i};
