import{_ as R,d as k,x as l,ah as I,r as m,o as D,c as P,l as u,D as n,m as c,G as x,a as A,h as V,M as O,aQ as w,aZ as M,dI as b}from"./index.js";import{R as T}from"./index.79a52a46.js";import U from"./choose-modal.5ef1e3.js";import"./orderRecord.bd0f73d4.js";import"./porder.cb2a60e8.js";import"./date-range.019e953f.js";const j={pay_fee:[{required:!0,trigger:"change",message:"\u8BF7\u8F93\u5165\u4ED8\u6B3E\u91D1\u989D"}],payNo:[{required:!0,trigger:"change",message:"\u8BF7\u9009\u62E9\u4ED8\u6B3E\u8BA2\u5355"}]},q={"w-full":""},L={class:"flex w-full justify-end"},G=k({__name:"choose-form",emits:["create"],setup(H,{emit:C}){const d=l(null),_=l(null),v=l(null),e=l({payNo:"",pay_fee:""}),y=l(!1),h=l(!1),t=I(()=>y.value||h.value),B=()=>_.value.onDisplay();function N(){var E;const p=(E=v.value)==null?void 0:E.getOpenInvInfo(),{data:o={},orderArr:a=[]}=p,{payNo:r}=o,f=a.map(({currentTotal:i,sequenceNo:F})=>({rela_fee:i,sequenceNo:F}));if(f.length===0&&!t.value){M.warning("\u81F3\u5C11\u9009\u62E9\u4E00\u6761\u91C7\u8D2D\u5355");return}let s={};t.value?s={payNo:e.value.payNo,pay_fee:e.value.pay_fee}:s={cgdNos:f,payNo:r},d.value.validate(i=>i&&C("create",s,t.value))}function g(p={}){const{payNo:o,is_comon:a}=p,r=o.slice(3,9);y.value=Number(r)<Number(b),h.value=a=="1",e.value.payNo=o}return(p,o)=>{const a=m("ElFormItem"),r=m("ElInput"),f=m("ElButton");return D(),P("div",q,[u(c(w),{ref_key:"formRef",ref:d,model:e.value,rules:c(j)},{default:n(()=>[u(a,{label:"\u8BA2\u5355\u5BF9\u8D26",prop:"payNo"},{default:n(()=>[u(c(T),{ref_key:"reconciliationRef",ref:v,isPurchPay:"",id:e.value.payNo,readonly:!!e.value.payNo,cover:!0,onChoose:B,isChoosePurchaseOrder:!c(t)},null,8,["id","readonly","isChoosePurchaseOrder"])]),_:1}),c(t)?(D(),x(a,{key:0,label:"\u4ED8\u6B3E\u91D1\u989D",prop:"pay_fee"},{default:n(()=>[u(r,{modelValue:e.value.pay_fee,"onUpdate:modelValue":o[0]||(o[0]=s=>e.value.pay_fee=s),placeholder:"\u8BF7\u8F93\u5165\u4ED8\u6B3E\u91D1\u989D"},null,8,["modelValue"])]),_:1})):A("v-if",!0),u(a,null,{default:n(()=>[V("div",L,[u(f,{type:"primary",onClick:N},{default:n(()=>[O("\u4FDD\u5B58")]),_:1})])]),_:1})]),_:1},8,["model","rules"]),u(U,{ref_key:"chooseModalRef",ref:_,onChoose:g},null,512)])}}});var K=R(G,[["__file","C:/Users/89793/Desktop/projects/settle-vue3/src/views/supply/purchPay/component/choose-form.vue"]]);export{K as default};
