modal.18e072.js 7.0 KB

1
  1. import{aT as D,ac as z,c6 as L,c7 as j,c8 as $,c9 as P,aL as X,_ as Y,d as G,bs as H,w as x,z as J,r as _,aC as K,o as C,G as y,C as u,H as Q,l as f,b1 as W,h as c,j as e,M as s,L as v,c as Z,F as ee,D as ue,aq as le}from"./index.js";import{u as T}from"./useTask.8a645393.js";import{c as ae}from"./validator.92b8f4b2.js";const{VITE_PROXY_DOMAIN_REAL:Ce,VITE_PROXY_USER_REAL:te}=z(),B=te+"/admin/",De=i=>D.request("post",`${B}businesslist`,{data:i}),oe=i=>D.request("post",`${B}businesssinfo`,{data:i}),ne=i=>D.request("post",`${B}businessedit`,{data:i}),Be=i=>D.request("post",`${B}businessstatus`,{data:i}),A={required:!0,message:"\u8054\u7CFB\u7535\u8BDD\u683C\u5F0F\u4E0D\u6B63\u786E"},ie=[{value:"0",label:"\u533A-\u56FA-\u5206",rule:{...A,validator(i,r){return L(r)}}},{value:"1",label:"\u533A-\u56FA",rule:{...A,validator(i,r){return j(r)}}},{value:"2",label:"\u56FA-\u5206",rule:{...A,validator(i,r){return $(r||"")}}},{value:"3",label:"\u56FA",rule:{...A,validator(i,r){return P(r||"")}}},{value:"4",label:"\u624B\u673A\u53F7",rule:{...A,validator(i,r){return X(r||"")}}}],re={inv_bank:[{required:!0,message:"\u94F6\u884C\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A\uFF01",trigger:"blur"}],inv_bankNo:[{required:!0,message:"\u94F6\u884C\u5361\u53F7\u4E0D\u80FD\u4E3A\u7A7A\uFF01",trigger:"blur"}],inv_addr:[{required:!0,message:"\u8054\u7CFB\u5730\u5740\u4E0D\u80FD\u4E3A\u7A7A\uFF01",trigger:"blur"}],invoice_title:[{required:!0,message:"\u516C\u53F8\u62AC\u5934\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],invoice_mobile:[{required:!0,message:"\u8054\u7CFB\u7535\u8BDD\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}]},se={class:"flex flex-col"},de={class:"flex"},_e=c("div",{class:"w-[30px] p-[5px] border-r-1 border-b-1 border-[#ccc]"},"\u4F01\u4E1A\u4FE1\u606F",-1),ve={class:"flex-1 border-b-1 border-[#ccc]"},ce={class:"flex"},pe=c("div",{class:"w-[30px] p-[5px] border-r-1 border-[#ccc]"},"\u5F00\u7968\u4FE1\u606F",-1),me={class:"flex-1"},be={class:"flex w-full justify-end"},fe=G({__name:"modal",props:{visible:{type:Boolean,required:!0},data:{type:String,required:!0}},emits:["refresh"],setup(i,{emit:r}){const k=i,m=H(k,"visible"),l=x({}),h=x("0"),w=x(null),N=T({success(){m.value=!1,r("refresh")}}),R=T({initialData:{},success(p){const{id:a,company:n,nature:o,inv_code:b,inv_legaler:d,inv_time:F,contactor:E,inv_scope:g,license_img:V,invoice_title:q,invoice_mobile:t,inv_bank:I,inv_bankNo:S,inv_addr:O,addr:M}=p;l.value={id:a||"",code:k.data,company:n||"",type:o||"",inv_code:b||"",inv_legaler:d||"",inv_time:ae(F)||"",inv_addr:"",inv_bank:"",inv_bankNo:"",contactor:E||"",invoice_mobile:"",addr:M||"",inv_scope:g||"",license_img:V||"",invoice_title:q||"",invoice_mobile:t||"",inv_bank:I||"",inv_bankNo:S||"",inv_addr:O||""}}});async function U(){try{await w.value.validate();const{inv_bank:p,inv_bankNo:a,inv_addr:n,invoice_mobile:o,id:b,invoice_title:d,inv_code:F}=l.value,E={id:b,inv_bank:p,inv_bankNo:a,inv_addr:n,invoice_mobile:o,invoice_title:d,inv_code:F};N.run(ne(E))}catch{}}return J(()=>m.value,p=>{!p||R.run(oe({companyNo:k.data}))},{immediate:!0}),(p,a)=>{const n=_("ElFormItem"),o=_("ElCol"),b=_("ElRow"),d=_("ElInput"),F=_("ElOption"),E=_("ElSelect"),g=_("ElButton"),V=_("ElDialog"),q=K("loading");return C(),y(V,{title:"\u4F9B\u5E94\u5546\u5347\u7EA7\u4E1A\u52A1\u516C\u53F8",center:"",modelValue:f(m),"onUpdate:modelValue":a[7]||(a[7]=t=>le(m)?m.value=t:null),top:"10px"},{default:u(()=>[Q((C(),y(f(W),{"label-width":"100px",rules:f(re),model:l.value,ref_key:"formRef",ref:w},{default:u(()=>[c("div",se,[c("div",de,[_e,c("div",ve,[e(b,null,{default:u(()=>[e(o,{span:6},{default:u(()=>[e(n,{label:"\u6CD5\u4EBA",required:""},{default:u(()=>[s(v(l.value.inv_legaler),1)]),_:1})]),_:1}),e(o,{span:6},{default:u(()=>[e(n,{label:"\u8425\u4E1A\u6267\u7167",required:""})]),_:1}),e(o,{span:12},{default:u(()=>[e(n,{label:"\u4F01\u4E1A\u540D\u79F0",required:""},{default:u(()=>[s(v(l.value.company),1)]),_:1})]),_:1}),e(o,{span:8},{default:u(()=>[e(n,{label:"\u7EB3\u7A0E\u8BC6\u522B\u53F7",required:""},{default:u(()=>[s(v(l.value.inv_code),1)]),_:1})]),_:1}),e(o,{span:8},{default:u(()=>[e(n,{label:"\u6210\u7ACB\u65E5\u671F",required:""},{default:u(()=>[s(v(l.value.inv_time),1)]),_:1})]),_:1}),e(o,{span:8},{default:u(()=>[e(n,{label:"\u516C\u53F8\u7C7B\u578B",required:""},{default:u(()=>[s(v(l.value.type),1)]),_:1})]),_:1}),e(o,{span:18},{default:u(()=>[e(n,{label:"\u8BE6\u7EC6\u5730\u5740",required:""},{default:u(()=>[s(v(l.value.addr),1)]),_:1})]),_:1}),e(o,{span:6},{default:u(()=>[e(n,{label:"\u8054\u7CFB\u4EBA",required:""},{default:u(()=>[s(v(l.value.contactor),1)]),_:1})]),_:1}),e(o,{span:24},{default:u(()=>[e(n,{label:"\u8425\u4E1A\u8303\u56F4",required:""},{default:u(()=>[s(v(l.value.inv_scope),1)]),_:1})]),_:1})]),_:1})])]),c("div",ce,[pe,c("div",me,[e(b,{class:"p-[10px]"},{default:u(()=>[e(o,{span:12},{default:u(()=>[e(n,{label:"\u516C\u53F8\u62AC\u5934",prop:"invoice_title"},{default:u(()=>[e(d,{placeholder:"\u516C\u53F8\u62AC\u5934",modelValue:l.value.invoice_title,"onUpdate:modelValue":a[0]||(a[0]=t=>l.value.invoice_title=t),maxlength:"100"},null,8,["modelValue"])]),_:1})]),_:1}),e(o,{span:12},{default:u(()=>[e(n,{label:"\u8054\u7CFB\u7535\u8BDD",prop:"invoice_mobile"},{default:u(()=>[e(d,{modelValue:l.value.invoice_mobile,"onUpdate:modelValue":a[2]||(a[2]=t=>l.value.invoice_mobile=t)},{prepend:u(()=>[e(E,{style:{width:"115px"},modelValue:h.value,"onUpdate:modelValue":a[1]||(a[1]=t=>h.value=t)},{default:u(()=>[(C(!0),Z(ee,null,ue(f(ie),t=>(C(),y(F,{key:t.value,label:t.label,value:t.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1},8,["modelValue"])]),_:1})]),_:1}),e(o,{span:12},{default:u(()=>[e(n,{label:"\u94F6\u884C\u540D\u79F0",prop:"inv_bank"},{default:u(()=>[e(d,{placeholder:"\u94F6\u884C\u540D\u79F0",modelValue:l.value.inv_bank,"onUpdate:modelValue":a[3]||(a[3]=t=>l.value.inv_bank=t),maxlength:"100"},null,8,["modelValue"])]),_:1})]),_:1}),e(o,{span:12},{default:u(()=>[e(n,{label:"\u94F6\u884C\u5361\u53F7",prop:"inv_bankNo"},{default:u(()=>[e(d,{placeholder:"\u94F6\u884C\u5361\u53F7",modelValue:l.value.inv_bankNo,"onUpdate:modelValue":a[4]||(a[4]=t=>l.value.inv_bankNo=t),maxlength:"100"},null,8,["modelValue"])]),_:1})]),_:1}),e(o,{span:24},{default:u(()=>[e(n,{label:"\u8054\u7CFB\u5730\u5740",prop:"inv_addr"},{default:u(()=>[e(d,{placeholder:"\u8054\u7CFB\u5730\u5740",modelValue:l.value.inv_addr,"onUpdate:modelValue":a[5]||(a[5]=t=>l.value.inv_addr=t),maxlength:"100"},null,8,["modelValue"])]),_:1})]),_:1}),e(o,{span:24},{default:u(()=>[c("div",be,[e(g,{onClick:a[6]||(a[6]=t=>m.value=!1)},{default:u(()=>[s("\u53D6\u6D88")]),_:1}),e(g,{type:"primary",onClick:U,loading:f(N).loading},{default:u(()=>[s("\u4FDD\u5B58")]),_:1},8,["loading"])])]),_:1})]),_:1})])])])]),_:1},8,["rules","model"])),[[q,f(R).loading]])]),_:1},8,["modelValue"])}}});var Fe=Y(fe,[["__file","C:/Users/Administrator/Desktop/projects/purchase-vue3/src/views/serviceParam/workCompany/components/modal.vue"]]),ke=Object.freeze(Object.defineProperty({__proto__:null,default:Fe},Symbol.toStringTag,{value:"Module"}));export{Fe as M,Be as a,De as h,ke as m};