import{_ as k,d as A,n as l,aa as P,r as m,o as D,c as I,h as u,y as n,i as p,A as V,a as w,e as x,H as O,cd as b,cm as M,f5 as T}from"./index.js";import{R as j}from"./index.6004c99e.js";import q from"./choose-modal.fe5169.js";import"./orderRecord.92bbc10f.js";import"./porder.827c74bc.js";const H={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"}]},L={"w-full":""},U={class:"flex w-full justify-end"},S=A({__name:"choose-form",emits:["create"],setup(Y,{emit:B}){const C=B,d=l(null),_=l(null),v=l(null),o=l({payNo:"",pay_fee:""}),y=l(!1),h=l(!1),t=P(()=>y.value||h.value),N=()=>_.value.onDisplay();function g(){var E;const c=(E=v.value)==null?void 0:E.getOpenInvInfo(),{data:e={},orderArr:a=[]}=c,{payNo:r}=e,i=a.map(({currentTotal:f,sequenceNo:R})=>({rela_fee:f,sequenceNo:R}));if(i.length===0&&!t.value){M.warning("\u81F3\u5C11\u9009\u62E9\u4E00\u6761\u91C7\u8D2D\u5355");return}let s={};t.value?s={payNo:o.value.payNo,pay_fee:o.value.pay_fee}:s={cgdNos:i,payNo:r},d.value.validate(f=>f&&C("create",s,t.value))}function F(c={}){const{payNo:e,is_comon:a}=c,r=e.slice(3,9);y.value=Number(r)<Number(T),h.value=a=="1",o.value.payNo=e}return(c,e)=>{const a=m("ElFormItem"),r=m("ElInput"),i=m("ElButton");return D(),I("div",L,[u(p(b),{ref_key:"formRef",ref:d,model:o.value,rules:p(H)},{default:n(()=>[u(a,{label:"\u8BA2\u5355\u5BF9\u8D26",prop:"payNo"},{default:n(()=>[u(p(j),{ref_key:"reconciliationRef",ref:v,isPurchPay:"",id:o.value.payNo,readonly:!!o.value.payNo,cover:!0,onChoose:N,isChoosePurchaseOrder:!t.value},null,8,["id","readonly","isChoosePurchaseOrder"])]),_:1}),t.value?(D(),V(a,{key:0,label:"\u4ED8\u6B3E\u91D1\u989D",prop:"pay_fee"},{default:n(()=>[u(r,{modelValue:o.value.pay_fee,"onUpdate:modelValue":e[0]||(e[0]=s=>o.value.pay_fee=s),placeholder:"\u8BF7\u8F93\u5165\u4ED8\u6B3E\u91D1\u989D"},null,8,["modelValue"])]),_:1})):w("v-if",!0),u(a,null,{default:n(()=>[x("div",U,[u(i,{type:"primary",onClick:g},{default:n(()=>e[1]||(e[1]=[O("\u4FDD\u5B58")])),_:1})])]),_:1})]),_:1},8,["model","rules"]),u(q,{ref_key:"chooseModalRef",ref:_,onChoose:F},null,512)])}}});var W=k(S,[["__file","D:/work/jiesuan/settle-vue3/src/views/supply/purchPay/component/choose-form.vue"]]);export{W as default};
