You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2 lines
5.0KB

  1. import"./appBasicInfo.f0eb1a97.js";import"./appSafeInfo.2a878e87.js";import"./appResourceInfo.74701f30.js";import{d as H,z as J,r as n,c as i,e as b,f as K,h as t,i as a,j as d,I,g as x,k as C,F as Q,a0 as X,N,a1 as Y,x as Z}from"./index.0b616ce3.js";import ee from"./applicationInfo.3e5b9937.js";import"./uploadAction.0353e8a4.js";import"./index.8c2e9fca.js";const ae=["onClick"],le=["onClick"];const te={class:"applyBottomBtn flexCenter marginTop"},oe=H({name:"applications"}),we=Object.assign(oe,{props:{isInnovateWholeProvinceShare:{type:Boolean,default:!1},isFirst:{type:Number,default:void 0},coreBusiness:{type:Array,default:()=>[]}},setup(w,{expose:R}){const B=J(),{proxy:$}=Z(),o=n({applicationList:[]}),y=n(),D={includeApplication:[{required:!0,message:"\u8BF7\u9009\u62E9\u662F\u5426\u5305\u542B\u5E94\u7528",trigger:"blur"}],applicationList:[{required:!0,message:"\u8BF7\u6DFB\u52A0\u5E94\u7528",trigger:"blur"}],includeCause:[{required:!0,message:"\u8BF7\u586B\u5199\u4E0D\u5305\u62EC\u539F\u56E0",trigger:"blur"}]},L=[{type:"index",label:"\u5E8F\u53F7",width:60},{label:"\u5E94\u7528\u540D\u79F0",key:"applicationName",prop:"applicationName",render:l=>{var e;return X("span",l.applicationName||((e=l.relatedExistsApplication)==null?void 0:e.applicationName)||"")}},{label:"\u64CD\u4F5C",slot:"action"}],E=l=>{$.$messageBox.confirm("\u786E\u5B9A\u8981\u5220\u9664\u8BE5\u9879\u5417?","\u63D0\u793A\uFF01",{type:"warning"}).then(()=>{o.value.applicationList.splice(l,1)})},r=n(!1),ie=n(["1","2","3"]),_=n({}),ne=n(),se=n(),pe=n(),p=n(),m=n(!1),V=n(),F=async(l,e)=>{m.value=!0,V.value=l,_.value=e,r.value=!0,await N(),p.value.clearValidate()},P=async()=>{m.value=!1,_.value={},r.value=!0,await N(),p.value.clearValidate()},g=()=>{Y.confirm("\u786E\u5B9A\u8981\u5173\u95ED\u5E94\u7528\u7F16\u8F91\u9875\u9762\u5417\uFF1F").then(()=>{k()}).catch(()=>{})},k=()=>{p.value.formData={},p.value.clearValidate(),r.value=!1},A=()=>{m.value?o.value.applicationList[V.value]={...p.value.formData}:o.value.applicationList.push({...p.value.formData}),k()},S=()=>{const l=[];l.push(new Promise((e,u)=>{p.value.validForm(c=>{c&&e()})})),Promise.all([...l]).then(()=>{A()})},j=l=>{y.value.validate(e=>{l(e)})},q=l=>{var u;const e=B.query.isDraft?"applicationList":"projectApplications";o.value={includeApplication:l.includeApplication,applicationList:(u=l[e])!=null&&u.length?l[e].map(c=>({...c,relatedExistsApplication:c.relatedExistsApplication?{applicationCode:c.relatedExistsApplicationCode,applicationName:c.relatedExistsApplication}:void 0})):[],includeCause:l.includeCause}},M=()=>{o.value.applicationList=[]};return R({validForm:j,formData:o,applicationData:_,setFormData:q}),(l,e)=>{const u=i("el-radio"),c=i("el-radio-group"),v=i("el-form-item"),h=i("el-col"),f=i("el-button"),U=i("table-list"),T=i("el-input"),z=i("el-row"),W=i("el-form"),ce=i("el-collapse-item"),re=i("el-collapse"),O=i("el-drawer");return b(),K(Q,null,[t(W,{ref_key:"formRef",ref:y,model:o.value,rules:D,"label-position":"right","label-width":"180px","label-suffix":":","scroll-to-error":""},{default:a(()=>[t(z,{gutter:40},{default:a(()=>[t(h,{span:12},{default:a(()=>[t(v,{label:"\u662F\u5426\u5305\u542B\u5E94\u7528","label-width":"atuo",prop:"includeApplication"},{default:a(()=>[t(c,{modelValue:o.value.includeApplication,"onUpdate:modelValue":e[0]||(e[0]=s=>o.value.includeApplication=s),onChange:M},{default:a(()=>[t(u,{label:1},{default:a(()=>[d("\u662F")]),_:1}),t(u,{label:0},{default:a(()=>[d("\u5426")]),_:1})]),_:1},8,["modelValue"])]),_:1})]),_:1}),o.value.includeApplication===1?(b(),I(h,{key:0,span:24},{default:a(()=>[t(v,{label:"\u5305\u542B\u7684\u5E94\u7528",prop:"applicationList"},{default:a(()=>[t(f,{type:"primary",plain:"",class:"w-full mb-10",icon:"Plus",onClick:P},{default:a(()=>[d("\u6DFB\u52A0\u5E94\u7528")]),_:1}),t(U,{class:"w-full",pagination:!1,data:o.value.applicationList,column:L},{action:a(({scope:s})=>[x("a",{onClick:G=>F(s.$index,s.row)},"\u7F16\u8F91",8,ae),x("a",{class:"text-red-400",onClick:G=>E(s.$index)},"\u5220\u9664",8,le)]),_:1},8,["data"])]),_:1})]),_:1})):C("",!0),o.value.includeApplication!==1?(b(),I(h,{key:1,span:24},{default:a(()=>[t(v,{label:"\u4E0D\u5305\u542B\u5E94\u7528\u539F\u56E0",prop:"includeCause"},{default:a(()=>[t(T,{modelValue:o.value.includeCause,"onUpdate:modelValue":e[1]||(e[1]=s=>o.value.includeCause=s),placeholder:"\u8BF7\u8F93\u5165"},null,8,["modelValue"])]),_:1})]),_:1})):C("",!0)]),_:1})]),_:1},8,["model"]),t(O,{modelValue:r.value,"onUpdate:modelValue":e[3]||(e[3]=s=>r.value=s),title:"\u6DFB\u52A0\u5E94\u7528","before-close":g,size:1e3},{footer:a(()=>[x("div",te,[t(f,{onClick:g},{default:a(()=>[d(" \u5173\u95ED ")]),_:1}),t(f,{type:"primary",plain:"",onClick:A},{default:a(()=>[d(" \u6682\u5B58 ")]),_:1}),t(f,{type:"primary",onClick:S},{default:a(()=>[d(" \u786E\u5B9A ")]),_:1})])]),default:a(()=>[C("",!0),t(ee,{ref_key:"applicationInfoRef",ref:p,data:_.value,"is-first":w.isFirst,"core-business":w.coreBusiness,"drawer-visible":r.value},null,8,["data","is-first","core-business","drawer-visible"])]),_:1},8,["modelValue"])],64)}}});export{we as default};