import{d as e,r as l,s as a,a as r,b as o,h as d,l as s,F as i,i as t,f as u,c as p,w as f,e as n,n as _,g as c,k as m,Q as v,j as g,Z as b,_ as y}from"./index-d052b22f-1780912037814v=1.0.0.js";import k from"./CardContainer-bf0a1588-1780912037814v=1.0.0.js";import V from"./UploadFile-08fc71e4-1780912037814v=1.0.0.js";import{f as x}from"./common-8cccb005-1780912037814v=1.0.0.js";import"./Document-61a10b68-1780912037814v=1.0.0.js";import"./upload-f9f23203-1780912037814v=1.0.0.js";const U={class:"CardContainer"},h={class:"CardContainer"},C={class:"option"},j={class:"line-box pl10 pr10 mb10"},$=y(e({__name:"MoneyUsage",props:{info:{type:Object,default:()=>{}}},emits:["update:info"],setup(e,{emit:y}){l({xs:24,sm:24,md:24,lg:24,xl:12});const $=l({xs:24,sm:12,md:12,lg:12,xl:12}),q=l({xs:24,sm:12,md:12,lg:8,xl:8}),F=l({xs:24,sm:24,md:24,lg:24,xl:20}),w=e,I=y,D=a({get:()=>w.info,set:e=>{I("update:info",e)}}),M={price:[{required:!0,message:"请输入金额",trigger:"blur"},{pattern:/^\d+(\.\d{1,2})?$/,message:"请输入正确的金额",trigger:"blur"}],year:[{required:!0,message:"请选择下达年份",trigger:"change"}],name:[{required:!0,message:"请输入资金支持单位",trigger:"blur"}],des:[{required:!0,message:"请输入资金使用说明",trigger:"blur"}]},B=e=>{let l="";return E.value.forEach((a=>{a.value==e&&(l=a.label)})),l},E=l(x),K=()=>{let e={price:"",year:"",des:"",name:"",file:{file_name:"",file_url:""},type_id:4,key:Date.now()+Math.random().toString(36).slice(3)};D.value.price_use_info.push(e)},O=e=>D.value.price_use_info.findIndex((l=>l.key===e));return(e,l)=>{const a=r("el-input"),y=r("el-form-item"),x=r("FormCol"),w=r("FormRow"),I=r("el-button"),E=r("Plus"),P=r("el-icon");return o(),d("div",null,[s(" {{ form.price_use_info }} "),(o(!0),d(i,null,t(u(D).price_use_info.filter((e=>4!=e.type_id)),((e,r)=>(o(),p(w,{key:r},{default:f((()=>[n(x,v({ref_for:!0},u(F)),{default:f((()=>[m("div",U,[n(k,{title:B(e.type_id),class:"mb20"},{default:f((()=>[n(w,{class:"pl10 pr10"},{default:f((()=>[n(x,v({ref_for:!0},u($)),{default:f((()=>[n(y,{label:"使用额度：",rules:M.price,prop:`price_use_info.${O(e.key)}.price`},{default:f((()=>[n(a,{modelValue:e.price,"onUpdate:modelValue":l=>e.price=l,placeholder:"请输入资金金额"},{append:f((()=>l[0]||(l[0]=[g("元")]))),_:2},1032,["modelValue","onUpdate:modelValue"])])),_:2},1032,["rules","prop"])])),_:2},1040),n(x,v({ref_for:!0},u($)),{default:f((()=>[s(" {{ getTrueIndexByKey(item.key) }} "),n(y,{label:"资金使用说明",rules:M.des,prop:`price_use_info.${O(e.key)}.des`},{default:f((()=>[n(a,{modelValue:e.des,"onUpdate:modelValue":l=>e.des=l,placeholder:"请输入资金使用说明"},null,8,["modelValue","onUpdate:modelValue"])])),_:2},1032,["rules","prop"])])),_:2},1040),n(x,v({ref_for:!0},u(F)),{default:f((()=>[n(y,{label:"资金相关附件："},{default:f((()=>[n(V,{value:e.file,"onUpdate:value":l=>e.file=l},null,8,["value","onUpdate:value"])])),_:2},1024)])),_:2},1040)])),_:2},1024)])),_:2},1032,["title"])])])),_:2},1040)])),_:2},1024)))),128)),s(" 自筹资金特殊处理 "),u(D).price_use_info.filter((e=>4==e.type_id)).length>0?(o(),p(w,{key:0},{default:f((()=>[n(x,_(c(u(F))),{default:f((()=>[m("div",h,[n(k,{title:"自筹资金",class:"mb20"},{default:f((()=>[(o(!0),d(i,null,t(u(D).price_use_info.filter((e=>4==e.type_id)),((e,r)=>(o(),d("div",{class:"line-box",key:r},[n(w,{style:{flex:"1"}},{default:f((()=>[n(x,v({ref_for:!0},u(q)),{default:f((()=>[n(y,{label:"支持额度",rules:M.price,prop:`price_use_info.${O(e.key)}.price`},{default:f((()=>[n(a,{modelValue:e.price,"onUpdate:modelValue":l=>e.price=l,placeholder:"请输入资金金额"},{append:f((()=>l[1]||(l[1]=[g("元")]))),_:2},1032,["modelValue","onUpdate:modelValue"])])),_:2},1032,["rules","prop"])])),_:2},1040),n(x,v({ref_for:!0},u(q)),{default:f((()=>[n(y,{label:"资金使用说明",prop:`price_use_info.${O(e.key)}.des`,rules:M.des},{default:f((()=>[n(a,{modelValue:e.des,"onUpdate:modelValue":l=>e.des=l,placeholder:"请输入资金支持单位"},null,8,["modelValue","onUpdate:modelValue"])])),_:2},1032,["prop","rules"])])),_:2},1040),n(x,v({ref_for:!0},u(F)),{default:f((()=>[n(y,{label:"资金相关附件："},{default:f((()=>[n(V,{value:e.file,"onUpdate:value":l=>e.file=l},null,8,["value","onUpdate:value"])])),_:2},1024)])),_:2},1040)])),_:2},1024),m("div",C,[n(y,{label:" ",class:"vertical"},{default:f((()=>[u(D).price_use_info.filter((e=>4===e.type_id)).length>1?(o(),p(I,{key:0,type:"danger",icon:u(b),onClick:l=>{return a=e.key,void(D.value.price_use_info=D.value.price_use_info.filter((e=>e.key!==a)));var a}},{default:f((()=>l[2]||(l[2]=[g(" 删除 ")]))),_:2},1032,["icon","onClick"])):s("v-if",!0)])),_:2},1024)])])))),128)),m("div",j,[m("div",{class:"add-button",onClick:K},[n(P,null,{default:f((()=>[n(E)])),_:1}),l[3]||(l[3]=g(" 新增 "))]),l[4]||(l[4]=m("div",{class:"option"},null,-1))])])),_:1})])])),_:1},16)])),_:1})):s("v-if",!0)])}}}),[["__scopeId","data-v-5b5b0a64"]]);export{$ as default};
