import{_ as A,d as q,Z as g,w as x,aP as h,ag as w,a0 as f,r as i,o as b,G as N,C as t,l as e,u as d,c as U,F as O,aq as R,b as M,a as P,M as T,aR as I}from"./index.42bf163d.js";const Y={"w-400px":""},j=q({__name:"approval-pending",props:{isNormal:{type:Boolean,required:!1},isJs:{type:Boolean,required:!1},isOutMonth:{type:String,required:!1},invType:{type:String,required:!1},isNormalOpen:{type:Boolean,required:!1},getOriginInvoice:{type:Function,required:!0}},emits:["approval"],setup(F,{emit:E}){const p=F,u=g({return_type:"2",return_reason:"",remark:"",status:"1",invCode:"",invNum:"",open_date:"",checkCode:"",subtotal_fee:""}),c=g({return_type:[{required:!0,trigger:"change",message:"\u8BF7\u9009\u62E9\u9000\u7968\u65B9\u5F0F"}],return_reason:[{required:!0,trigger:"change",message:"\u8BF7\u9009\u62E9\u7EA2\u51B2\u539F\u56E0"}],status:[{required:!0,trigger:"change",message:"\u8BF7\u9009\u62E9\u5BA1\u6838\u72B6\u6001"}],remark:[{required:!0,trigger:"change",message:"\u8BF7\u8F93\u5165\u5907\u6CE8"}],invCode:[{required:!0,trigger:"change",message:"\u8BF7\u8F93\u5165\u53D1\u7968\u7F16\u7801"}],invNum:[{required:!0,trigger:"change",message:"\u8BF7\u8F93\u5165\u53D1\u7968\u53F7\u7801"}],open_date:[{required:!0,trigger:"change",message:"\u8BF7\u9009\u62E9\u5F00\u7968\u65E5\u671F"}],subtotal_fee:[{required:!0,trigger:"change",message:"\u8BF7\u8F93\u5165\u7A0E\u524D\u91D1\u989D"}],checkCode:[{required:p.isNormal,trigger:"change",message:"\u8BF7\u8F93\u5165\u6821\u9A8C\u7801"}]}),V=g({status:[{required:!0,trigger:"change",message:"\u8BF7\u9009\u62E9\u5BA1\u6838\u72B6\u6001"}],remark:[{required:!0,trigger:"change",message:"\u8BF7\u8F93\u5165\u5907\u6CE8"}]}),v=x(null),s=h("0"),C=()=>{v.value.validate(o=>o&&E("approval",u,B.value))},B=w(()=>{const{invType:o,isOutMonth:l,isNormalOpen:r}=p;return l&&(o==="normal"||o==="special")&&!r});return f(()=>{const o=p.getOriginInvoice();Object.keys(o).forEach(l=>{u[l]=s.value==="0"?o[l]:""})}),f(()=>u.return_type=p.isJs?"1":"2"),f(()=>{const{invType:o}=p;c.remark[0].required=u.status==="3",c.checkCode[0].required=o==="special_electronic"||o==="electronic"}),(o,l)=>{const r=i("el-option"),m=i("el-select"),n=i("el-form-item"),_=i("el-input"),D=i("el-date-picker"),y=i("el-input-number"),k=i("el-button");return b(),N(d(I),{ref_key:"formRef",ref:v,"label-width":"100px",size:"small",model:u,rules:u.status==="1"?c:V},{default:t(()=>[e(n,{label:"\u5BA1\u6279\u72B6\u6001",prop:"status","w-400px":""},{default:t(()=>[e(m,{"w-400px":"",modelValue:u.status,"onUpdate:modelValue":l[0]||(l[0]=a=>u.status=a),placeholder:"\u8BF7\u9009\u62E9\u5BA1\u6279\u72B6\u6001"},{default:t(()=>[e(r,{label:"\u901A\u8FC7",value:"1"}),e(r,{label:"\u4E0D\u901A\u8FC7",value:"3"})]),_:1},8,["modelValue"])]),_:1}),u.status!=="3"&&!d(B)?(b(),U(O,{key:0},[e(n,{label:"\u9000\u7968\u65B9\u5F0F",prop:"return_type"},{default:t(()=>[e(m,{"w-300px":"",modelValue:u.return_type,"onUpdate:modelValue":l[1]||(l[1]=a=>u.return_type=a),placeholder:"\u8BF7\u9009\u62E9\u9000\u7968\u65B9\u5F0F"},{default:t(()=>[e(r,{disabled:!F.isJs,value:"1",label:"\u91D1\u7A0E"},null,8,["disabled"]),e(r,{value:"2",label:"\u7EBF\u4E0B"})]),_:1},8,["modelValue"])]),_:1}),e(n,{label:"\u7EA2\u51B2\u539F\u56E0",prop:"return_reason",placeholder:"\u8BF7\u9009\u62E9\u7EA2\u51B2\u539F\u56E0"},{default:t(()=>[e(m,{"w-300px":"",modelValue:u.return_reason,"onUpdate:modelValue":l[2]||(l[2]=a=>u.return_reason=a)},{default:t(()=>[e(r,{label:"\u9500\u8D27\u9000\u56DE",value:"1"}),e(r,{label:"\u5F00\u7968\u6709\u8BEF",value:"2"}),e(r,{label:"\u670D\u52A1\u7EC8\u6B62",value:"3"}),e(r,{label:"\u9500\u552E\u6298\u8BA9",value:"4"})]),_:1},8,["modelValue"])]),_:1}),e(n,{label:"\u7EA2\u51B2/\u539F\u7968"},{default:t(()=>[e(m,{style:{width:"300px"},modelValue:d(s),"onUpdate:modelValue":l[3]||(l[3]=a=>R(s)?s.value=a:null)},{default:t(()=>[e(r,{label:"\u539F\u7968",value:"0"}),e(r,{label:"\u7EA2\u51B2",value:"1"})]),_:1},8,["modelValue"])]),_:1}),M("div",Y,[e(n,{label:"\u53D1\u7968\u7F16\u7801",prop:"invCode"},{default:t(()=>[e(_,{modelValue:u.invCode,"onUpdate:modelValue":l[4]||(l[4]=a=>u.invCode=a),placeholder:"\u53D1\u7968\u7F16\u7801",disabled:d(s)==="0"},null,8,["modelValue","disabled"])]),_:1}),e(n,{label:"\u53D1\u7968\u53F7\u7801",prop:"invNum"},{default:t(()=>[e(_,{modelValue:u.invNum,"onUpdate:modelValue":l[5]||(l[5]=a=>u.invNum=a),placeholder:"\u53D1\u7968\u53F7\u7801"},null,8,["modelValue"])]),_:1}),e(n,{label:"\u6821\u9A8C\u7801",prop:"checkCode"},{default:t(()=>[e(_,{modelValue:u.checkCode,"onUpdate:modelValue":l[6]||(l[6]=a=>u.checkCode=a),placeholder:"\u6821\u9A8C\u7801",disabled:d(s)==="0"},null,8,["modelValue","disabled"])]),_:1}),e(n,{label:"\u5F00\u7968\u65E5\u671F",prop:"open_date"},{default:t(()=>[e(D,{"w-300px":"",modelValue:u.open_date,"onUpdate:modelValue":l[7]||(l[7]=a=>u.open_date=a),placeholder:"\u5F00\u7968\u65E5\u671F","value-format":"YYYY-MM-DD HH:mm:ss",disabled:d(s)==="0"},null,8,["modelValue","disabled"])]),_:1}),e(n,{label:"\u7A0E\u524D\u91D1\u989D",prop:"subtotal_fee"},{default:t(()=>[e(y,{modelValue:u.subtotal_fee,"onUpdate:modelValue":l[8]||(l[8]=a=>u.subtotal_fee=a),max:d(s)==="0"?void 0:"0",placeholder:"\u7A0E\u524D\u91D1\u989D",disabled:d(s)==="0"},null,8,["modelValue","max","disabled"])]),_:1})])],64)):P("v-if",!0),e(n,{label:"\u5907\u6CE8",prop:"remark","w-400px":""},{default:t(()=>[e(_,{type:"textarea",modelValue:u.remark,"onUpdate:modelValue":l[9]||(l[9]=a=>u.remark=a)},null,8,["modelValue"])]),_:1}),e(n,{"w-full":"",flex:"","justify-end":""},{default:t(()=>[e(k,{type:"primary",onClick:C},{default:t(()=>[T("\u4FDD\u5B58")]),_:1})]),_:1})]),_:1},8,["model","rules"])}}});var S=A(j,[["__file","C:/Users/63107/Desktop/projects/accout-vue3-ui/src/views/InvoiceSales/returnTicket/components/approval-pending.vue"]]);export{S as default};