1 |
- import{_ as ae,d as te,w as c,b0 as A,W as oe,ah as re,ag as k,z as L,r as d,o as v,G as V,C as t,j as l,l as n,b1 as ne,c as w,F as q,D as T,M as b,by as de,L as se,h as f}from"./index.js";import{h as ie}from"./index.de2ee1ae.js";import{S as me}from"./super.f53b4198.js";import{a as pe,c as Fe}from"./index.f3438816.js";import{x as ce}from"./status.151ccddb.js";const ve={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"}]},G={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 be=f("h1",{class:"text-xl font-[600] mb-2 text-[#000]"},"\u516C\u53F8\u8D22\u52A1\u8BBE\u7F6E",-1),Be=f("h1",{class:"text-xl font-[600] mb-2 text-[#000]"},"\u8FDB\u9879\u7968\u8BBE\u7F6E",-1),ge=f("h1",{class:"text-xl font-[600] mb-2 text-[#000]"},"\u9500\u9879\u7968\u8BBE\u7F6E",-1),fe=f("br",null,null,-1),Ee={class:"flex w-full justify-end"},_e=te({__name:"finance-modal",emits:["finance-save"],setup(p,{expose:O,emit:x}){const B=c(!1),F=c(m.create),E=c(null),i=c(),z=c(!0),{run:J,data:W}=A({initalData:[],isList:!0,success:()=>{const{address:o,name:e,registercode:C}=W.value[0];F.value===m.create&&(a.value.company_name=e,a.value.company_address=o,a.value.company_license=C)}}),U={company_name:"",invoice_title:"",company_address:"",company_license:"",bank_name:"",bankNo:"",mobile:"",input_ticket:"",out_ticket:"",voider:"",reviewer:"",drawer:"",payee:"",ownerPlace:"",denomination:"",invoiceType:[]},{companyList:y}=oe(),{isSuperUser:N}=re(),a=c({...U}),S=c(G),g=k(()=>F.value===m.update),$=k(()=>{const o=y.value.findIndex(({companyNo:e})=>e==="");return o>=0?y.value.slice(o+1):y.value}),h=k(()=>{const o="\u516C\u53F8\u8D22\u52A1\u8BBE\u7F6E";switch(F.value){case m.create:return"\u521B\u5EFA"+o;case m.preview:return"\u67E5\u770B"+o;default:return"\u4FEE\u6539"+o}}),H=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:K,loading:M}=A({success:()=>{B.value=!1,x("finance-save")}}),{run:Q,loading:X}=A({success:()=>{B.value=!1,x("finance-save")}});function Y(){E.value.validate(o=>{if(!o)return;const e={companyNo:i.value,...N.value?{}:{relaComNo:i.value},...a.value};switch(F.value){case m.create:K(Fe(e));break;case m.update:Q(pe(e));break}})}const R=o=>J(ie({companyNo:o}));return L(()=>a.value,({out_ticket:o})=>{const e=Number(o)===1?G:ve;S.value=e,E.value&&E.value.clearValidate()},{deep:!0,immediate:!0}),L(()=>i.value,o=>{F.value===m.create&&o&&R(o)}),O({onDisplay:(o,e)=>{a.value={...U},B.value=!0,F.value=e,i.value="",o&&(H(o),i.value=o.companyNo,R(o.companyNo))}}),(o,e)=>{const C=d("ElOption"),Z=d("ElSelect"),r=d("ElFormItem"),s=d("ElInput"),_=d("ElCol"),I=d("ElRow"),D=d("ElRadio"),P=d("ElRadioGroup"),ee=d("ElCheckbox"),ue=d("ElCheckboxGroup"),j=d("ElButton"),le=d("ElDialog");return v(),V(le,{center:"",modelValue:B.value,"onUpdate:modelValue":e[20]||(e[20]=u=>B.value=u),title:n(h),"destroy-on-close":"",onClose:e[21]||(e[21]=u=>z.value=!0),width:"1040px","close-on-click-modal":!1},{default:t(()=>[l(n(ne),{ref_key:"formRef",ref:E,labelWidth:"110px",model:a.value,rules:S.value,disabled:F.value===n(m).preview},{default:t(()=>[be,l(I,{gutter:12},{default:t(()=>[l(_,{span:12},{default:t(()=>[l(r,{label:"\u516C\u53F8",prop:"company_name"},{default:t(()=>[n(N)?(v(),V(me,{key:1,code:i.value,"onUpdate:code":e[1]||(e[1]=u=>i.value=u),noAll:"",noSet:"",onChange:e[2]||(e[2]=u=>i.value=u.code),disabled:n(g)},null,8,["code","disabled"])):(v(),V(Z,{key:0,style:{width:"100%"},modelValue:i.value,"onUpdate:modelValue":e[0]||(e[0]=u=>i.value=u),placeholder:"\u8BF7\u9009\u62E9\u516C\u53F8",disabled:n(g)},{default:t(()=>[(v(!0),w(q,null,T(n($),u=>(v(),V(C,{key:u.companyNo,label:u.companyName,value:u.companyNo},null,8,["label","value"]))),128))]),_:1},8,["modelValue","disabled"]))]),_: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:"invoice_title"},{default:t(()=>[l(s,{disabled:"",modelValue:a.value.invoice_title,"onUpdate:modelValue":e[4]||(e[4]=u=>a.value.invoice_title=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",disabled:n(g)},null,8,["modelValue","disabled"])]),_:1})]),_:1}),l(_,{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),disabled:n(g)},null,8,["modelValue","disabled"])]),_: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),disabled:n(g)},null,8,["modelValue","disabled"])]),_: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",disabled:n(g)},null,8,["modelValue","disabled"])]),_:1})]),_:1})]),_:1}),Be,l(r,{label:"\u8FDB\u9879\u7968\u8BBE\u7F6E",prop:"input_ticket"},{default:t(()=>[l(P,{modelValue:a.value.input_ticket,"onUpdate:modelValue":e[9]||(e[9]=u=>a.value.input_ticket=u)},{default:t(()=>[l(D,{label:"1"},{default:t(()=>[b("\u91D1\u7A0E\u9A8C\u7968")]),_:1}),l(D,{label:"2"},{default:t(()=>[b("\u4EBA\u5DE5\u9A8C\u7968")]),_:1})]),_:1},8,["modelValue"])]),_:1}),ge,l(I,{gutter:10},{default:t(()=>[l(_,{span:12},{default:t(()=>[l(r,{label:"\u91D1\u7A0E\u5F00\u7968",prop:"out_ticket"},{default:t(()=>[l(P,{modelValue:a.value.out_ticket,"onUpdate:modelValue":e[10]||(e[10]=u=>a.value.out_ticket=u)},{default:t(()=>[l(D,{label:"1"},{default:t(()=>[b("\u652F\u6301")]),_:1}),l(D,{label:"2"},{default:t(()=>[b("\u4E0D\u652F\u6301")]),_: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(_,{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(n(de),{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(ue,{modelValue:a.value.invoiceType,"onUpdate:modelValue":e[17]||(e[17]=u=>a.value.invoiceType=u)},{default:t(()=>[(v(!0),w(q,null,T(n(ce),u=>(v(),w(q,{key:u.value},[l(ee,{label:u.value},{default:t(()=>[b(se(u.label),1)]),_:2},1032,["label"]),fe],64))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1})]),_:1}),l(r,null,{default:t(()=>[f("div",Ee,[l(j,{type:"\u53D6\u6D88",onClick:e[18]||(e[18]=()=>B.value=!1)},{default:t(()=>[b("\u53D6\u6D88")]),_:1}),l(j,{loading:n(M)||n(X),type:"primary",onClick:e[19]||(e[19]=()=>Y())},{default:t(()=>[b("\u4FDD\u5B58")]),_:1},8,["loading"])])]),_:1})]),_:1},8,["model","rules","disabled"])]),_:1},8,["modelValue","title"])}}});var De=ae(_e,[["__file","C:/Users/Administrator/Desktop/projects/purchase-vue3/src/views/parameter/finance/components/finance-modal.vue"]]),we=Object.freeze(Object.defineProperty({__proto__:null,default:De},Symbol.toStringTag,{value:"Module"}));export{De as F,m as M,we as f};
|