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
3.1KB

  1. import{h as $,f as B,b,c as S,e as U,g as j}from"./uploadAction-3962500e.js";import{d as q}from"./delayApply-7439b69f.js";import{E as D,r as g,B as N,b as r,c as O,L as h,h as t,f as o,i as m,u as s,e as I,t as L,k as P,s as T}from"./index-dd5fae99.js";const A={class:"el-upload__tip"},J=P({name:"applyDialog"}),H=Object.assign(J,{props:{visible:{type:Boolean,default:!1,required:!0},data:Object},emits:["close"],setup(y,{emit:M}){const{proxy:w}=T(),V=D.dictStore.uploadUrl,f=y,v=M,p=g(!1),a=g({supportingMaterials:[]}),x={delayedMonth:[{required:!0,message:"请输入延期时长"}],delayedReason:[{required:!0,message:"请输入延期理由"}],supportingMaterials:[{required:!0,message:"请上传"}]},c=g(),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(j(a.value.supportingMaterials))||void 0,projectId:f.data.id};await q(n),w.$message.success("提交成功!"),p.value=!1,v("close",!0)}catch{p.value=!1}}})};return N(()=>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"),k=r("el-dialog");return O(),h(k,{"model-value":y.visible,title:"申请延期",width:"600px","destroy-on-close":"",onClose:e[6]||(e[6]=l=>v("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(" 提交 ")])),_:1},8,["loading"]),o(n,{onClick:e[5]||(e[5]=l=>v("close"))},{default:t(()=>e[10]||(e[10]=[m(" 关闭 ")])),_: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:"延期时长",prop:"delayedMonth"},{default:t(()=>[o(u,{modelValue:a.value.delayedMonth,"onUpdate:modelValue":e[0]||(e[0]=l=>a.value.delayedMonth=l),placeholder:"请填写需要延长几个月",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("月")])),_:1},8,["modelValue"])]),_:1}),o(i,{label:"延期理由",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:"请填写"},null,8,["modelValue"])]),_:1}),o(i,{label:"佐证材料:",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($)(l,a.value.supportingMaterials,!0),"before-upload":l=>s(B)(l,{types:s(b)}),accept:s(b).map(l=>`.${l}`).join(","),"on-preview":s(S)},{tip:t(()=>[I("div",A," 支持"+L(s(U))+"文件 ",1)]),default:t(()=>[o(n,{type:"primary",plain:""},{default:t(()=>e[8]||(e[8]=[m("选择文件")])),_:1})]),_:1},8,["file-list","action","on-success","before-upload","accept","on-preview"])]),_:1})]),_:1},8,["model"])]),_:1},8,["model-value"])}}});export{H as default};