1 |
- import{aT as m,ac as M,_ as O,d as j,ag as F,bs as b,w as g,r as l,o as x,G as N,C as o,j as t,l as s,h as U,M as $,aq as T,aN as h}from"./index.js";const{VITE_PROXY_DOMAIN_REAL:J,VITE_PROXY_USER_REAL:P}=M(),_=P+"/admin/",K=(a={})=>m.request("post",`${_}customerlist`,{data:a}),L=(a={})=>m.request("post",`${_}customercreate`,{data:a}),z=(a={})=>m.request("post",`${_}customerupdate`,{data:a}),Q=(a={})=>m.request("post",`${_}customerstatus`,{data:a}),X={class:"w-full flex justify-end"},Y=j({__name:"modal",props:{data:{type:null,required:!0,default:{companyNo:"",name:"",pid:"",id:""}},pid:{type:String,required:!0},visible:{type:Boolean,required:!0},breadcrumb:{type:Array,required:!0}},emits:["refresh"],setup(a,{emit:y}){const d=a,V={name:"",pid:"",id:"",kh:""};F(()=>{const{breadcrumb:n=[]}=d;return n.slice(0).map(({name:e})=>e).join("/")});const B=F(()=>u.value.id?"\u7F16\u8F91\u4F01\u4E1A/\u7EC4\u7EC7":"\u6DFB\u52A0\u4F01\u4E1A/\u7EC4\u7EC7"),i=b(d,"visible"),u=b(d,"data"),E=g(!1),v=g(null),D={name:[{required:!0,message:"\u8BF7\u8F93\u5165\u7EC4\u7EC7\u540D\u79F0",trigger:"blur"}],kh:[{required:!0,message:"\u8BF7\u9009\u62E9\u7EC4\u5408/\u4F01\u4E1A",trigger:"blur"}]};function A(){u.value={...V},i.value=!1}async function w(){try{await v.value.validate();const{id:n}=d.data,e={pid:d.pid||"0",name:u.value.name,id:u.value.id},r=n===void 0||!n;r||(e.id=n);const f=r?L:z;E.value=!0;const p=await f(e);E.value=!1,p.code===0?(i.value=!1,h.success(`${r?"\u6DFB\u52A0":"\u66F4\u65B0"}\u6210\u529F`),y("refresh")):h.warning(`${r?"\u6DFB\u52A0":"\u66F4\u65B0"}\u5931\u8D25`)}catch{}}return(n,e)=>{const r=l("ElOption"),f=l("ElSelect"),p=l("ElFormItem"),C=l("ElCol"),q=l("ElInput"),k=l("ElRow"),R=l("ElButton"),S=l("ElForm"),I=l("ElDialog");return x(),N(I,{modelValue:s(i),"onUpdate:modelValue":e[2]||(e[2]=c=>T(i)?i.value=c:null),title:s(B),center:"",onClose:A},{default:o(()=>[t(S,{model:s(u),rules:D,size:"small",ref_key:"formRef",ref:v},{default:o(()=>[t(k,null,{default:o(()=>[t(C,{span:6},{default:o(()=>[t(p,{prop:"kh",label:"\u7EC4\u7EC7/\u4F01\u4E1A"},{default:o(()=>[t(f,{modelValue:s(u).kh,"onUpdate:modelValue":e[0]||(e[0]=c=>s(u).kh=c),disabled:!!s(u).id,style:{width:"100%"}},{default:o(()=>[t(r,{value:"0",label:"\u7EC4\u7EC7"}),t(r,{value:"1",label:"\u4F01\u4E1A"})]),_:1},8,["modelValue","disabled"])]),_:1})]),_:1}),t(C,{span:18},{default:o(()=>[t(p,{label:"\u7EC4\u7EC7\u540D\u79F0",prop:"name"},{default:o(()=>[t(q,{modelValue:s(u).name,"onUpdate:modelValue":e[1]||(e[1]=c=>s(u).name=c),style:{width:"100%"},placeholder:"\u540D\u79F0"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),U("div",X,[t(R,{type:"primary",loading:E.value,onClick:w},{default:o(()=>[$("\u4FDD\u5B58")]),_:1},8,["loading"])])]),_:1},8,["model"])]),_:1},8,["modelValue","title"])}}});var G=O(Y,[["__file","C:/Users/63107/Desktop/projects/purchase-vue3/src/views/serviceParam/business/cpns/modal.vue"]]),W=Object.freeze(Object.defineProperty({__proto__:null,default:G},Symbol.toStringTag,{value:"Module"}));export{G as M,Q as a,K as h,W as m};
|