import{d as E,aA as B,t as w,r as p,ac as O,y as S,aC as A,o as D,b as I,e as o,f as n,g as C,i as f,u as t,R as V,X as L,k as M,l as F,m as T,p as J,E as $,_ as j}from"./index-BeAZaivf.js";const q={class:"dialog-footer"},z=E({__name:"DialogCustomer",props:B({data:{}},{modelValue:{type:Boolean},modelModifiers:{}}),emits:["update:modelValue"],setup(b){const x=w(),m=p(!1),i=p(""),s=O(b,"modelValue"),v=b,a=p({id:"",name:"",adress:"",taxpayerNumber:"",bankAccount:"",bankOfCreate:"",phone:"",remark:""});S(()=>{y()});const y=()=>{if(v.data){let r=JSON.parse(JSON.stringify(v.data));Number(r.id)>0&&(i.value="修改客户单位",a.value=r)}else i.value="新增客户单位"},_=A("selectTableList",Function,!0),c=async()=>{if(a.value.name.length===0){V.error("请输入客户单位名称");return}m.value=!0;try{await L.UpdateCustomer(a.value),V.success("操作成功"),_(),x.UpdateShowCount(),s.value=!1}catch(r){V.error(r.msg||"操作失败")}finally{m.value=!1}};return(r,e)=>{const u=M,d=F,U=T,g=J,N=$;return D(),I("div",null,[o(N,{title:t(i),width:"500px",modelValue:s.value,"onUpdate:modelValue":e[9]||(e[9]=l=>s.value=l),onClose:e[10]||(e[10]=l=>s.value=!1)},{footer:n(()=>[C("div",q,[o(g,{onClick:e[8]||(e[8]=l=>s.value=!1)},{default:n(()=>e[12]||(e[12]=[f("取 消")])),_:1}),o(g,{type:"primary",onClick:c,loading:t(m)},{default:n(()=>e[13]||(e[13]=[f("确 定")])),_:1},8,["loading"])])]),default:n(()=>[C("div",null,[o(U,{"label-width":"auto"},{default:n(()=>[o(d,{required:"",label:"客户单位名称"},{default:n(()=>[o(u,{placeholder:"请输入客户单位名称",maxLength:100,modelValue:t(a).name,"onUpdate:modelValue":e[0]||(e[0]=l=>t(a).name=l)},null,8,["modelValue"])]),_:1}),o(d,{label:"客户单位地址"},{default:n(()=>[o(u,{placeholder:"请输入客户单位地址",maxLength:100,modelValue:t(a).adress,"onUpdate:modelValue":e[1]||(e[1]=l=>t(a).adress=l)},null,8,["modelValue"])]),_:1}),o(d,{label:"纳税人识别号"},{default:n(()=>[o(u,{placeholder:"请输入纳税人识别号",modelValue:t(a).taxpayerNumber,"onUpdate:modelValue":e[2]||(e[2]=l=>t(a).taxpayerNumber=l)},null,8,["modelValue"])]),_:1}),o(d,{label:"银行账号"},{default:n(()=>[o(u,{placeholder:"请输入银行账号",modelValue:t(a).bankAccount,"onUpdate:modelValue":e[3]||(e[3]=l=>t(a).bankAccount=l),onBlur:e[4]||(e[4]=l=>{var k;return t(a).bankAccount=parseInt((k=l.target)==null?void 0:k.value).toString()}),oninput:"value=value.replace(/[^\\d]/g,'')"},{default:n(()=>e[11]||(e[11]=[f(" >")])),_:1},8,["modelValue"])]),_:1}),o(d,{label:"开户行"},{default:n(()=>[o(u,{placeholder:"请输入开户行",modelValue:t(a).bankOfCreate,"onUpdate:modelValue":e[5]||(e[5]=l=>t(a).bankOfCreate=l)},null,8,["modelValue"])]),_:1}),o(d,{label:"电话"},{default:n(()=>[o(u,{placeholder:"请输入电话",modelValue:t(a).phone,"onUpdate:modelValue":e[6]||(e[6]=l=>t(a).phone=l)},null,8,["modelValue"])]),_:1}),o(d,{label:"备注"},{default:n(()=>[o(u,{placeholder:"请输入备注",modelValue:t(a).remark,"onUpdate:modelValue":e[7]||(e[7]=l=>t(a).remark=l)},null,8,["modelValue"])]),_:1})]),_:1})])]),_:1},8,["title","modelValue"])])}}}),R=j(z,[["__scopeId","data-v-4876d8ba"]]);export{R as D};
//# sourceMappingURL=DialogCustomer-BvWASY4Y.js.map
