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 line
2.1KB

  1. var y=(m,u,o)=>new Promise((_,a)=>{var f=t=>{try{r(o.next(t))}catch(l){a(l)}},c=t=>{try{r(o.throw(t))}catch(l){a(l)}},r=t=>t.done?_(t.value):Promise.resolve(t.value).then(f,c);r((o=o.apply(m,u)).next())});import{l as V}from"./driverFile.0e884ef0.js";import{_ as T,d as w,r as g,f as d,g as B,p as L,w as n,e as i,h as k,N as D,i as M}from"./index.551f5afa.js";const h=k(" \u5173\u95ED "),j=k(" \u4FDD\u5B58 "),E=w({name:"askForLeaveDialog"}),F=Object.assign(E,{props:{visible:{type:Boolean,default:!1,required:!0},data:Object},emits:["close"],setup(m,{emit:u}){const o=m,{proxy:_}=M(),a=g({times:[]}),f=g(),c=g({times:[{required:!0,message:"\u8BF7\u9009\u62E9\u8BF7\u5047\u65F6\u95F4",trigger:"blur"}]}),r=s=>s.getTime()<new Date().getTime()-24*60*60*1e3,t=()=>{f.value.validate(s=>y(this,null,function*(){if(s){const{times:e}=a.value,p={id:o.data.userId,leaveState:"LEAVE",leaveStartTime:e.length?D(e[0]).format("YYYY-MM-DD"):void 0,leaveEndTime:e.length?D(e[1]).format("YYYY-MM-DD"):void 0,times:void 0};yield V(p),_.$message.success("\u8BF7\u5047\u6210\u529F\uFF01"),l(!0)}}))},l=s=>{a.value={times:[]},u("close",s)};return(s,e)=>{const p=d("el-date-picker"),x=d("el-form-item"),Y=d("el-form"),b=d("el-button"),C=d("el-dialog");return B(),L(C,{"model-value":m.visible,title:"\u8BF7\u5047","destroy-on-close":"",onClose:e[2]||(e[2]=v=>u("close"))},{footer:n(()=>[i(b,{type:"info",size:"small",onClick:e[1]||(e[1]=v=>l(!1))},{default:n(()=>[h]),_:1}),i(b,{type:"primary",size:"small",onClick:t},{default:n(()=>[j]),_:1})]),default:n(()=>[i(Y,{ref_key:"formRef",ref:f,model:a.value,rules:c.value,"label-suffix":":",class:"formBox"},{default:n(()=>[i(x,{label:"\u8BF7\u5047\u65F6\u95F4",prop:"times"},{default:n(()=>[i(p,{modelValue:a.value.times,"onUpdate:modelValue":e[0]||(e[0]=v=>a.value.times=v),type:"daterange","range-separator":"\u81F3","start-placeholder":"\u5F00\u59CB\u65F6\u95F4","end-placeholder":"\u7ED3\u675F\u65F6\u95F4","disabled-date":r},null,8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])]),_:1},8,["model-value"])}}}),q=T(F,[["__scopeId","data-v-ef7b43cd"]]);export{q as default};