import{o as q,b as O}from"./configs.18c1cc57.js";import T from"./sales-modal.403e2c7e.js";import{I as j}from"./global.9ad647c8.js";import{q as I,B as f,a2 as L,r as c,o,n as y,p as C,v as s,K as p,H as l,P as v,t as d,I as P,J as U,S as _,aM as w,aY as z,O as H}from"./index.d8ce26ef.js";import"./index.38f67443.js";import"./use-response-handle.e6cae34f.js";import"./status.fad06285.js";const R={flex:"","justify-between":"","items-center":""},$=C("h1",{"my-4":""},"\u5173\u8054\u8BA2\u5355:",-1),G=_("\u6DFB\u52A0"),J=_("\u5220\u9664"),K={key:0,flex:"","justify-end":"","mt-3":""},W=_("\u4FDD\u5B58"),oe=I({__name:"related-order",props:{readonly:{type:Boolean}},emits:["create-btn-click"],setup(D,{emit:N}){const g=D,r=f([]),k=L(()=>!g.readonly),n=f({}),B=f(null);function A(e){r.value=e,e.forEach(({sequenceNo:a,wpay_fee:t})=>n.value[a]=t)}function V(){const e=[];if(Object.keys(n.value).forEach(t=>e.push({sequenceNo:t,trad_fee:n.value[t]})),!e.length)return w.error("\u8BF7\u6DFB\u52A0\u5173\u8054\u8BA2\u5355");N("create-btn-click",e)}function x(e){delete n.value[e],r.value=r.value.filter(a=>a.sequenceNo!==e)}return(e,a)=>{const t=c("el-button"),F=c("el-input"),E=c("el-tag"),b=c("el-table-column"),M=c("el-table");return o(),y("div",null,[C("div",R,[$,s(k)?(o(),p(t,{key:0,type:"primary",onClick:a[0]||(a[0]=()=>B.value.onDisplay(s(r.value)))},{default:l(()=>[G]),_:1})):v("",!0)]),d(M,{data:r.value,size:"small"},{default:l(()=>[(o(!0),y(P,null,U(s(q),(u,h)=>(o(),p(b,{key:h,label:u.label,prop:u.prop,"show-overflow-tooltip":""},{default:l(({row:m})=>[u.label==="\u6B64\u6B21\u8BA4\u9886"?(o(),p(F,z({key:0,size:"small",placeholder:"\u6B64\u6B21\u8BA4\u9886\u91D1\u989D",modelValue:n.value[m.sequenceNo],"onUpdate:modelValue":i=>n.value[m.sequenceNo]=i},s(j)),null,16,["modelValue","onUpdate:modelValue"])):u.prop==="status"?(o(),p(E,{key:1},{default:l(()=>{var i;return[_(H((i=s(O).find(S=>m.status===S.value))==null?void 0:i.label),1)]}),_:2},1024)):v("",!0)]),_:2},1032,["label","prop"]))),128)),d(b,{label:"\u64CD\u4F5C"},{default:l(({row:u})=>[d(t,{type:"danger",link:"",onClick:h=>x(u.sequenceNo)},{default:l(()=>[J]),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"]),s(k)?(o(),y("div",K,[d(t,{type:"primary",onClick:V},{default:l(()=>[W]),_:1})])):v("",!0),d(T,{ref_key:"saleModalRef",ref:B,onSaveClickButton:A},null,512)])}}});export{oe as default};
