|
- import{h as j,f as k,c as b,b as q,e as B,g as S}from"./uploadAction.a771741b.js";import{d as U}from"./delayApply.75360411.js";import{d as D,B as N,r as v,J as O,c as r,e as h,G as I,i as t,h as o,j as m,u as s,g as J,t as L,q as P}from"./index.88314652.js";const T={class:"el-upload__tip"},A=D({name:"applyDialog"}),K=Object.assign(A,{props:{visible:{type:Boolean,default:!1,required:!0},data:Object},emits:["close"],setup(y,{emit:M}){const{proxy:w}=P(),V=N.dictStore.uploadUrl,f=y,g=M,p=v(!1),a=v({supportingMaterials:[]}),x={delayedMonth:[{required:!0,message:"\u8BF7\u8F93\u5165\u5EF6\u671F\u65F6\u957F"}],delayedReason:[{required:!0,message:"\u8BF7\u8F93\u5165\u5EF6\u671F\u7406\u7531"}],supportingMaterials:[{required:!0,message:"\u8BF7\u4E0A\u4F20"}]},c=v(),C=async d=>{!d||d.validate(async e=>{var u,i;if(e){p.value=!0;try{const n={...a.value,supportingMaterials:((i=(u=a.value)==null?void 0:u.supportingMaterials)==null?void 0:i.length)&&JSON.stringify(S(a.value.supportingMaterials))||void 0,projectId:f.data.id};await U(n),w.$message.success("\u63D0\u4EA4\u6210\u529F\uFF01"),p.value=!1,g("close",!0)}catch{p.value=!1}}})};return O(()=>f.visible,async d=>{d?console.log("props.data",f.data):a.value={higherLineSuperOrgReviewComments:[]}}),(d,e)=>{const u=r("el-input"),i=r("el-form-item"),n=r("el-button"),F=r("el-upload"),R=r("el-form"),$=r("el-dialog");return h(),I($,{"model-value":y.visible,title:"\u7533\u8BF7\u5EF6\u671F",width:"600px","destroy-on-close":"",onClose:e[6]||(e[6]=l=>g("close"))},{footer:t(()=>[o(n,{type:"primary",loading:p.value,onClick:e[4]||(e[4]=l=>C(c.value))},{default:t(()=>e[9]||(e[9]=[m(" \u63D0\u4EA4 ")])),_:1},8,["loading"]),o(n,{onClick:e[5]||(e[5]=l=>g("close"))},{default:t(()=>e[10]||(e[10]=[m(" \u5173\u95ED ")])),_:1})]),default:t(()=>[o(R,{ref_key:"dialogFormRef",ref:c,model:a.value,rules:x,"label-width":"auto","status-icon":"",class:"mt-16"},{default:t(()=>[o(i,{label:"\u5EF6\u671F\u65F6\u957F",prop:"delayedMonth"},{default:t(()=>[o(u,{modelValue:a.value.delayedMonth,"onUpdate:modelValue":e[0]||(e[0]=l=>a.value.delayedMonth=l),placeholder:"\u8BF7\u586B\u5199\u9700\u8981\u5EF6\u957F\u51E0\u4E2A\u6708",onInput:e[1]||(e[1]=l=>{var _;return a.value.delayedMonth=(_=a.value.delayedMonth)==null?void 0:_.replace(/[^\d]/g,"")})},{suffix:t(()=>e[7]||(e[7]=[m("\u6708")])),_:1},8,["modelValue"])]),_:1}),o(i,{label:"\u5EF6\u671F\u7406\u7531",prop:"delayedReason"},{default:t(()=>[o(u,{modelValue:a.value.delayedReason,"onUpdate:modelValue":e[2]||(e[2]=l=>a.value.delayedReason=l),type:"textarea",maxlength:"1000","show-word-limit":"",placeholder:"\u8BF7\u586B\u5199"},null,8,["modelValue"])]),_:1}),o(i,{label:"\u4F50\u8BC1\u6750\u6599:",prop:"supportingMaterials"},{default:t(()=>[o(F,{"file-list":a.value.supportingMaterials,"onUpdate:fileList":e[3]||(e[3]=l=>a.value.supportingMaterials=l),class:"w-full",action:s(V),limit:1,"on-success":l=>s(j)(l,a.value.supportingMaterials,!0),"before-upload":l=>s(k)(l,{types:s(b)}),accept:s(b).map(l=>`.${l}`).join(","),"on-preview":s(q)},{tip:t(()=>[J("div",T," \u652F\u6301"+L(s(B))+"\u6587\u4EF6 ",1)]),default:t(()=>[o(n,{type:"primary",plain:""},{default:t(()=>e[8]||(e[8]=[m("\u9009\u62E9\u6587\u4EF6")])),_:1})]),_:1},8,["file-list","action","on-success","before-upload","accept","on-preview"])]),_:1})]),_:1},8,["model"])]),_:1},8,["model-value"])}}});export{K as default};
|