import{_ as b,d as h,Z as v,x,A,r as n,o as i,G as p,D as r,l as u,a as d,m as c,h as C,M as q,aQ as R}from"./index.js";import{I as w}from"./index.63cd11b6.js";/* empty css                                                */const P={class:"w-full flex justify-end"},N=h({__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=x(null),B=()=>{g.value.validate(s=>s&&F("approval",c(e)))},V=s=>s.getTime()>Date.now();return A(()=>e.status,s=>{const t=s===l.approveValue;f.remark[0].required=!t},{immediate:!0}),(s,t)=>{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(()=>[u(k,{placeholder:"\u5BA1\u6838\u72B6\u6001",modelValue:e.status,"onUpdate:modelValue":t[0]||(t[0]=o=>e.status=o),style:{width:"300px"}},{default:r(()=>[u(_,{label:"\u901A\u8FC7",value:a.approveValue},null,8,["value"]),u(_,{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(()=>[u(y,{style:{width:"300px"},type:"textarea",modelValue:e.remark,"onUpdate:modelValue":t[1]||(t[1]=o=>e.remark=o),placeholder:"\u8BF7\u8F93\u5165\u5907\u6CE8"},null,8,["modelValue"])]),_:1})):d("v-if",!0),u(m,{label:"\u56DE\u6267\u56FE\u7247",prop:a.imgProp},{default:r(()=>[u(c(w),{multiple:"",onChange:t[2]||(t[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(()=>[u(E,{type:"datetime","disabled-date":V,"value-format":"YYYY-MM-DD HH:mm:ss",modelValue:e.return_time,"onUpdate:modelValue":t[3]||(t[3]=o=>e.return_time=o),placeholder:"\u8BF7\u8F93\u5165\u56DE\u6267\u65F6\u95F4"},null,8,["modelValue"])]),_:1})),u(m,null,{default:r(()=>[C("div",P,[u(D,{type:"primary",onClick:B},{default:r(()=>[q("\u4FDD\u5B58")]),_:1})])]),_:1})]),_:1},8,["model","rules"])}}});var Y=b(N,[["__file","C:/Users/89793/Desktop/projects/settle-vue3/src/components/ApprovalNode/src/receipt.vue"]]);export{Y as R};
