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