finance-modal.79d0cd93.js 11 KB

1
  1. import{_ as le,d as ae,E as F,aZ as C,a5 as te,ai as oe,af as P,H as T,x as n,o as c,N as y,K as t,y as l,u as i,c as A,M as L,L as k,bV as re,b,aK as ne,W as v,T as se}from"./index.743f0c80.js";import{h as de}from"./index.e2a9809e.js";import{S as ie}from"./super.fba22ec9.js";import{b as me,a as pe}from"./index.e866db4a.js";import{x as Fe}from"./status.868e86c0.js";const ce={company_name:[{required:!0,trigger:"blur",message:"\u8BF7\u8F93\u5165\u4E1A\u52A1\u4F01\u4E1A\u540D\u79F0"}],company_address:[{required:!0,trigger:"blur",message:"\u8BF7\u8F93\u5165\u4F01\u4E1A\u5730\u5740"}],company_license:[{required:!0,trigger:"blur",message:"\u8BF7\u8F93\u5165\u7EB3\u7A0E\u4EBA\u8BC6\u522B\u53F7"}],mobile:[{required:!0,trigger:"blur",message:"\u8BF7\u8F93\u5165\u7535\u8BDD"}],bank_name:[{required:!0,trigger:"blur",message:"\u8BF7\u8F93\u5165\u5F00\u6237\u884C"}],bankNo:[{required:!0,trigger:"blur",message:"\u8BF7\u8F93\u5165\u5F00\u6237\u884C\u8D26\u6237"}],input_ticket:[{required:!0,trigger:"blur",message:"\u8BF7\u9009\u62E9\u9A8C\u7968\u65B9\u5F0F"}],out_ticket:[{required:!0,trigger:"blur",message:"\u8BF7\u9009\u62E9\u91D1\u7A0E\u5F00\u7968"}],ownerPlace:[{required:!0,trigger:"blur",message:"\u8BF7\u8F93\u5165\u5F52\u5C5E\u5730"}],denomination:[{required:!0,trigger:"blur",message:"\u8BF7\u8F93\u5165\u9762\u989D"}],invoiceType:[{required:!0,trigger:"blur",message:"\u8BF7\u8F93\u5165\u53D1\u7968\u652F\u6301\u7C7B\u578B"}]},O={company_name:[{required:!0,trigger:"blur",message:"\u8BF7\u8F93\u5165\u4E1A\u52A1\u4F01\u4E1A\u540D\u79F0"}],company_address:[{required:!0,trigger:"blur",message:"\u8BF7\u8F93\u5165\u4F01\u4E1A\u5730\u5740"}],company_license:[{required:!0,trigger:"blur",message:"\u8BF7\u8F93\u5165\u7EB3\u7A0E\u4EBA\u8BC6\u522B\u53F7"}],mobile:[{required:!0,trigger:"blur",message:"\u8BF7\u8F93\u5165\u7535\u8BDD"}],bank_name:[{required:!0,trigger:"blur",message:"\u8BF7\u8F93\u5165\u5F00\u6237\u884C"}],bankNo:[{required:!0,trigger:"blur",message:"\u8BF7\u8F93\u5165\u5F00\u6237\u884C\u8D26\u6237"}],input_ticket:[{required:!0,trigger:"blur",message:"\u8BF7\u9009\u62E9\u9A8C\u7968\u65B9\u5F0F"}],out_ticket:[{required:!0,trigger:"blur",message:"\u8BF7\u9009\u62E9\u91D1\u7A0E\u5F00\u7968"}],voider:[{required:!0,trigger:"blur",message:"\u8BF7\u8F93\u5165\u53D1\u7968\u4F5C\u5E9F\u4EBA"}],payee:[{required:!0,trigger:"blur",message:"\u8BF7\u8F93\u5165\u6536\u6B3E\u4EBA"}],reviewer:[{required:!0,trigger:"blur",message:"\u8BF7\u8F93\u5165\u590D\u6838\u4EBA"}],drawer:[{required:!0,trigger:"blur",message:"\u8BF7\u8F93\u5165\u5F00\u7968\u4EBA"}],ownerPlace:[{required:!0,trigger:"blur",message:"\u8BF7\u8F93\u5165\u5F52\u5C5E\u5730"}],denomination:[{required:!0,trigger:"blur",message:"\u8BF7\u8F93\u5165\u9762\u989D"}],invoiceType:[{required:!0,trigger:"blur",message:"\u8BF7\u8F93\u5165\u53D1\u7968\u652F\u6301\u7C7B\u578B"}]};var m=(p=>(p[p.update=0]="update",p[p.preview=1]="preview",p[p.create=2]="create",p))(m||{});const ve=b("h1",{class:"text-xl font-[600] mb-2 text-[#000]"},"\u516C\u53F8\u8D22\u52A1\u8BBE\u7F6E",-1),_e=b("h1",{class:"text-xl font-[600] mb-2 text-[#000]"},"\u8FDB\u9879\u7968\u8BBE\u7F6E",-1),Be=v("\u91D1\u7A0E\u9A8C\u7968"),be=v("\u4EBA\u5DE5\u9A8C\u7968"),Ee=b("h1",{class:"text-xl font-[600] mb-2 text-[#000]"},"\u9500\u9879\u7968\u8BBE\u7F6E",-1),fe=v("\u652F\u6301"),ge=v("\u4E0D\u652F\u6301"),ye=b("br",null,null,-1),Ve={class:"flex w-full justify-end"},De=v("\u53D6\u6D88"),Ce=v("\u4FDD\u5B58"),Ae=ae({__name:"finance-modal",emits:["finance-save"],setup(p,{expose:j,emit:w}){const _=F(!1),B=F(m.create),E=F(null),d=F(),G=F(!0),{run:h,data:J}=C({initalData:[],isList:!0,success:()=>{const{address:o,name:e,registercode:D}=J.value[0];B.value===m.create&&(a.value.company_name=e,a.value.company_address=o,a.value.company_license=D)}}),q={company_name:"",company_address:"",company_license:"",bank_name:"",bankNo:"",mobile:"",input_ticket:"",out_ticket:"",voider:"",reviewer:"",drawer:"",payee:"",ownerPlace:"",denomination:"",invoiceType:[]},{companyList:V}=te(),{isSuperUser:x}=oe(),a=F({...q}),U=F(O),K=P(()=>{const o=V.value.findIndex(({companyNo:e})=>e==="");return o>=0?V.value.slice(o+1):V.value}),W=P(()=>{const o="\u516C\u53F8\u8D22\u52A1\u8BBE\u7F6E";switch(B.value){case m.create:return"\u521B\u5EFA"+o;case m.preview:return"\u67E5\u770B"+o;default:return"\u4FEE\u6539"+o}}),z=o=>{Object.keys(a.value).forEach(e=>{switch(e){case"invoiceType":a.value[e]=o[e].split(",");break;default:a.value[e]=o[e];break}})},{run:H,loading:Z}=C({success:()=>{_.value=!1,w("finance-save")}}),{run:$,loading:M}=C({success:()=>{_.value=!1,w("finance-save")}});function Q(){E.value.validate(o=>{if(!o)return;const e={companyNo:d.value,...x.value?{}:{relaComNo:d.value},...a.value};switch(B.value){case m.create:H(pe(e));break;case m.update:$(me(e));break}})}const N=o=>h(de({companyNo:o}));return T(()=>a.value,({out_ticket:o})=>{const e=Number(o)===1?O:ce;U.value=e,E.value&&E.value.clearValidate()},{deep:!0,immediate:!0}),T(()=>d.value,o=>{B.value===m.create&&o&&N(o)}),j({onDisplay:(o,e)=>{a.value={...q},_.value=!0,B.value=e,d.value="",o&&(z(o),d.value=o.companyNo,N(o.companyNo))}}),(o,e)=>{const D=n("ElOption"),X=n("ElSelect"),r=n("ElFormItem"),s=n("ElInput"),f=n("ElCol"),S=n("ElRow"),g=n("ElRadio"),R=n("ElRadioGroup"),Y=n("ElCheckbox"),ee=n("ElCheckboxGroup"),I=n("ElButton"),ue=n("ElDialog");return c(),y(ue,{center:"",modelValue:_.value,"onUpdate:modelValue":e[20]||(e[20]=u=>_.value=u),title:i(W),"destroy-on-close":"",onClose:e[21]||(e[21]=u=>G.value=!0),width:"1040px"},{default:t(()=>[l(i(ne),{ref_key:"formRef",ref:E,labelWidth:"110px",model:a.value,rules:U.value,disabled:B.value===i(m).preview},{default:t(()=>[ve,l(S,{gutter:12},{default:t(()=>[l(f,{span:12},{default:t(()=>[l(r,{label:"\u516C\u53F8",prop:"company_name"},{default:t(()=>[i(x)?(c(),y(ie,{key:1,code:d.value,"onUpdate:code":e[1]||(e[1]=u=>d.value=u),noAll:"",noSet:"",onChange:e[2]||(e[2]=u=>d.value=u.code)},null,8,["code"])):(c(),y(X,{key:0,style:{width:"100%"},modelValue:d.value,"onUpdate:modelValue":e[0]||(e[0]=u=>d.value=u),placeholder:"\u8BF7\u9009\u62E9\u516C\u53F8"},{default:t(()=>[(c(!0),A(k,null,L(i(K),u=>(c(),y(D,{key:u.companyNo,label:u.companyName,value:u.companyNo},null,8,["label","value"]))),128))]),_:1},8,["modelValue"]))]),_:1}),l(r,{label:"\u7EB3\u7A0E\u53F7",prop:"company_license"},{default:t(()=>[l(s,{modelValue:a.value.company_license,"onUpdate:modelValue":e[3]||(e[3]=u=>a.value.company_license=u),placeholder:"\u7EB3\u7A0E\u53F7",disabled:""},null,8,["modelValue"])]),_:1}),l(r,{label:"\u62AC\u5934",prop:"company_name"},{default:t(()=>[l(s,{modelValue:a.value.company_name,"onUpdate:modelValue":e[4]||(e[4]=u=>a.value.company_name=u),placeholder:"\u8BF7\u8F93\u5165\u62AC\u5934"},null,8,["modelValue"])]),_:1}),l(r,{label:"\u5730\u5740",prop:"company_address"},{default:t(()=>[l(s,{modelValue:a.value.company_address,"onUpdate:modelValue":e[5]||(e[5]=u=>a.value.company_address=u),placeholder:"\u8BF7\u8F93\u5165\u5730\u5740"},null,8,["modelValue"])]),_:1})]),_:1}),l(f,{span:12},{default:t(()=>[l(r,{label:"\u8054\u7CFB\u7535\u8BDD",prop:"mobile"},{default:t(()=>[l(s,{placeholder:"\u8054\u7CFB\u7535\u8BDD",modelValue:a.value.mobile,"onUpdate:modelValue":e[6]||(e[6]=u=>a.value.mobile=u)},null,8,["modelValue"])]),_:1}),l(r,{label:"\u94F6\u884C\u540D\u79F0",prop:"bank_name"},{default:t(()=>[l(s,{placeholder:"\u94F6\u884C\u540D\u79F0",modelValue:a.value.bank_name,"onUpdate:modelValue":e[7]||(e[7]=u=>a.value.bank_name=u)},null,8,["modelValue"])]),_:1}),l(r,{label:"\u94F6\u884C\u5361\u53F7",prop:"bankNo"},{default:t(()=>[l(s,{modelValue:a.value.bankNo,"onUpdate:modelValue":e[8]||(e[8]=u=>a.value.bankNo=u),placeholder:"\u94F6\u884C\u5361\u53F7"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),_e,l(r,{label:"\u8FDB\u9879\u7968\u8BBE\u7F6E",prop:"input_ticket"},{default:t(()=>[l(R,{modelValue:a.value.input_ticket,"onUpdate:modelValue":e[9]||(e[9]=u=>a.value.input_ticket=u)},{default:t(()=>[l(g,{label:"1"},{default:t(()=>[Be]),_:1}),l(g,{label:"2"},{default:t(()=>[be]),_:1})]),_:1},8,["modelValue"])]),_:1}),Ee,l(S,{gutter:10},{default:t(()=>[l(f,{span:12},{default:t(()=>[l(r,{label:"\u91D1\u7A0E\u5F00\u7968",prop:"out_ticket"},{default:t(()=>[l(R,{modelValue:a.value.out_ticket,"onUpdate:modelValue":e[10]||(e[10]=u=>a.value.out_ticket=u)},{default:t(()=>[l(g,{label:"1"},{default:t(()=>[fe]),_:1}),l(g,{label:"2"},{default:t(()=>[ge]),_:1})]),_:1},8,["modelValue"])]),_:1}),l(r,{label:"\u4F5C\u5E9F\u4EBA",prop:"voider"},{default:t(()=>[l(s,{placeholder:"\u8BF7\u8F93\u5165\u4F5C\u5E9F\u4EBA",modelValue:a.value.voider,"onUpdate:modelValue":e[11]||(e[11]=u=>a.value.voider=u)},null,8,["modelValue"])]),_:1}),l(r,{label:"\u5F00\u7968\u4EBA",prop:"drawer"},{default:t(()=>[l(s,{placeholder:"\u8BF7\u8F93\u5165\u5F00\u7968\u4EBA",modelValue:a.value.drawer,"onUpdate:modelValue":e[12]||(e[12]=u=>a.value.drawer=u)},null,8,["modelValue"])]),_:1}),l(r,{label:"\u6536\u6B3E\u4EBA",prop:"payee"},{default:t(()=>[l(s,{placeholder:"\u8BF7\u8F93\u5165\u6536\u6B3E\u4EBA",modelValue:a.value.payee,"onUpdate:modelValue":e[13]||(e[13]=u=>a.value.payee=u)},null,8,["modelValue"])]),_:1}),l(r,{label:"\u590D\u6838\u4EBA",prop:"reviewer"},{default:t(()=>[l(s,{placeholder:"\u8BF7\u8F93\u5165\u590D\u6838\u4EBA",modelValue:a.value.reviewer,"onUpdate:modelValue":e[14]||(e[14]=u=>a.value.reviewer=u)},null,8,["modelValue"])]),_:1})]),_:1}),l(f,{span:12},{default:t(()=>[l(r,{label:"\u53D1\u7968\u5F52\u5C5E\u5730",prop:"ownerPlace"},{default:t(()=>[l(s,{placeholder:"\u8BF7\u9009\u62E9\u53D1\u7968\u5F52\u5C5E\u5730",modelValue:a.value.ownerPlace,"onUpdate:modelValue":e[15]||(e[15]=u=>a.value.ownerPlace=u)},null,8,["modelValue"])]),_:1}),l(r,{label:"\u53D1\u7968\u9762\u989D",prop:"denomination"},{default:t(()=>[l(i(re),{unit:"\u4E07\u5143",placeholder:"\u8BF7\u8F93\u5165\u53D1\u7968\u9762\u989D",modelValue:a.value.denomination,"onUpdate:modelValue":e[16]||(e[16]=u=>a.value.denomination=u)},null,8,["modelValue"])]),_:1}),l(r,{label:"\u652F\u6301\u53D1\u7968\u7C7B\u578B",prop:"invoiceType"},{default:t(()=>[l(ee,{modelValue:a.value.invoiceType,"onUpdate:modelValue":e[17]||(e[17]=u=>a.value.invoiceType=u)},{default:t(()=>[(c(!0),A(k,null,L(i(Fe),u=>(c(),A(k,{key:u.value},[l(Y,{label:u.value},{default:t(()=>[v(se(u.label),1)]),_:2},1032,["label"]),ye],64))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1})]),_:1}),l(r,null,{default:t(()=>[b("div",Ve,[l(I,{type:"\u53D6\u6D88",onClick:e[18]||(e[18]=()=>_.value=!1)},{default:t(()=>[De]),_:1}),l(I,{loading:i(Z)||i(M),type:"primary",onClick:e[19]||(e[19]=()=>Q())},{default:t(()=>[Ce]),_:1},8,["loading"])])]),_:1})]),_:1},8,["model","rules","disabled"])]),_:1},8,["modelValue","title"])}}});var ke=le(Ae,[["__file","D:/work/accout-vue3-ui/src/views/system/finance/components/finance-modal.vue"]]),Se=Object.freeze(Object.defineProperty({__proto__:null,default:ke},Symbol.toStringTag,{value:"Module"}));export{ke as F,m as M,Se as f};