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