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