import{_ as b,d as C,Z as v,w as h,z as x,r as n,o as i,G as p,C as r,l as t,a as d,u as c,b as q,M as A,aR as R}from"./index.1d1a5ecb.js";import{I as w}from"./index.c87609a1.js";/* empty css                                                */const P={class:"w-full flex justify-end"},N=C({__name:"receipt",props:{approveValue:{type:String,required:!0},rejectValue:{type:String,required:!1},imgProp:{type:String,required:!1,default:"return_image"},noTime:{type:Boolean,required:!1,default:!1},hasRemark:{type:Boolean,required:!1,default:!1}},emits:["approval"],setup(a,{emit:F}){const l=a,e=v({[l.imgProp]:"",return_time:"",status:l.approveValue}),f=v({status:[{required:!0,trigger:"change",message:"\u8BF7\u9009\u62E9\u5BA1\u6838\u72B6\u6001"}],remark:[{required:l.hasRemark,trigger:"change",message:"\u8BF7\u9009\u62E9\u5BA1\u6838\u72B6\u6001"}],return_time:[{required:!l.noTime,trigger:"change",message:"\u8BF7\u9009\u62E9\u4E0A\u4F20\u56DE\u6267\u65F6\u95F4"}],[l.imgProp]:[{required:!l.noTime,trigger:"change",message:"\u8BF7\u9009\u62E9\u4E0A\u4F20\u56DE\u6267\u56FE\u7247"}]}),g=h(null),B=()=>{g.value.validate(s=>s&&F("approval",c(e)))},V=s=>s.getTime()>Date.now();return x(()=>e.status,s=>{const u=s===l.approveValue;f.remark[0].required=!u},{immediate:!0}),(s,u)=>{const _=n("el-option"),k=n("el-select"),m=n("el-form-item"),y=n("el-input"),E=n("el-date-picker"),D=n("el-button");return i(),p(c(R),{ref_key:"formRef",ref:g,model:e,rules:f,"label-width":"80px"},{default:r(()=>[a.rejectValue?(i(),p(m,{key:0,label:"\u5BA1\u6838\u72B6\u6001",prop:"status",style:{"margin-bottom":"10px"}},{default:r(()=>[t(k,{placeholder:"\u5BA1\u6838\u72B6\u6001",modelValue:e.status,"onUpdate:modelValue":u[0]||(u[0]=o=>e.status=o),style:{width:"300px"}},{default:r(()=>[t(_,{label:"\u901A\u8FC7",value:a.approveValue},null,8,["value"]),t(_,{label:"\u4E0D\u901A\u8FC7",value:a.rejectValue},null,8,["value"])]),_:1},8,["modelValue"])]),_:1})):d("v-if",!0),a.hasRemark?(i(),p(m,{key:1,label:"\u5907\u6CE8",prop:"remark"},{default:r(()=>[t(y,{style:{width:"300px"},type:"textarea",modelValue:e.remark,"onUpdate:modelValue":u[1]||(u[1]=o=>e.remark=o),placeholder:"\u8BF7\u8F93\u5165\u5907\u6CE8"},null,8,["modelValue"])]),_:1})):d("v-if",!0),t(m,{label:"\u56DE\u6267\u56FE\u7247",prop:a.imgProp},{default:r(()=>[t(c(w),{multiple:"",onChange:u[2]||(u[2]=o=>e[a.imgProp]=o)})]),_:1},8,["prop"]),a.noTime?d("v-if",!0):(i(),p(m,{key:2,label:"\u56DE\u6267\u65F6\u95F4",prop:"return_time"},{default:r(()=>[t(E,{type:"datetime","disabled-date":V,"value-format":"YYYY-MM-DD HH:mm:ss",modelValue:e.return_time,"onUpdate:modelValue":u[3]||(u[3]=o=>e.return_time=o),placeholder:"\u8BF7\u8F93\u5165\u56DE\u6267\u65F6\u95F4"},null,8,["modelValue"])]),_:1})),t(m,null,{default:r(()=>[q("div",P,[t(D,{type:"primary",onClick:B},{default:r(()=>[A("\u4FDD\u5B58")]),_:1})])]),_:1})]),_:1},8,["model","rules"])}}});var Y=b(N,[["__file","C:/Users/63107/Desktop/projects/accout-vue3-ui/src/components/ApprovalNode/src/receipt.vue"]]);export{Y as R};
