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