import{_ as W,d as X,x as p,p as Z,ah as K,bU as q,r as s,aD as Q,H as M,m as a,o as n,c as h,l as u,D as l,G as m,a as B,h as b,M as y,F as Y,E as ee,bJ as te,L as ae,aZ as g}from"./index.js";import{o as le,a as oe,S as ue}from"./sales-modal.d458cf.js";import{I as se}from"./global.9ad647c8.js";import ne from"./index.9778ee.js";import{h as re,a as de}from"./index.56c49c99.js";import{F as ie}from"./index.5eb8c54a.js";import"./date-range.019e953f.js";const ce={class:"flex flex-col"},pe=b("div",{class:"flex"},[b("span",{style:{color:"#f56c6c"}},"*"),b("div",{style:{"margin-left":"3px","font-weight":"600"}},"\u5173\u8054\u8BA2\u5355")],-1),me={class:"flex flex-col w-full"},fe={class:"flex w-full justify-end mb-[10px]"},ve={key:0,flex:"","justify-end":"","mt-3":""},_e=X({__name:"index",props:{readonly:{type:Boolean,required:!1}},emits:["create-btn-click"],setup(T,{emit:ye}){const U=T,k=p(!1),P=Z(),E=K(()=>!U.readonly),d=p([]),f=p({tradNo:"",orderArr:[]}),N=p(!1),x=q({success(){N.value?(g.success("\u65B0\u5EFA\u6210\u529F"),f.value={tradNo:"",orderArr:[]},d.value=[],r.value={},i.data=null):(g.success("\u65B0\u5EFA\u6210\u529F"),P.push("/InvoiceSales/capitalPool"))}}),j={tradNo:[{required:!0,message:"\u8BF7\u9009\u62E9\u8D44\u91D1",trigger:"change"}],orderArr:[{required:!0,message:"\u8BF7\u9009\u62E9\u5173\u8054\u8BA2\u5355"}]},i=q({initialData:null}),r=p({}),C=p(null);function L(o){o.forEach(e=>{const{sequenceNo:v,wpay_fee:c}=e;r.value[v]||(r.value[v]=c,d.value.push(e))})}function A(o){N.value=o;const e=[];if(Object.keys(r.value).forEach(_=>e.push({sequenceNo:_,trad_fee:r.value[_]})),e.length===0)return g.error("\u8BF7\u6DFB\u52A0\u5173\u8054\u8BA2\u5355");const c={tradNo:f.value.tradNo,orderArr:e};x.run(re(c))}function R(o){delete r.value[o],d.value=d.value.filter(e=>e.sequenceNo!==o)}function $(o={}){i.run(de({tradNo:o.tradNo})),f.value.tradNo=o.tradNo,d.value=[]}return(o,e)=>{const v=s("ElInput"),c=s("ElFormItem"),_=s("el-button"),z=s("el-input"),O=s("el-tag"),I=s("el-table-column"),G=s("el-table"),H=s("ElForm"),w=s("ElButton"),S=Q("loading");return M((n(),h("div",ce,[u(H,{model:f.value,rules:j},{default:l(()=>[M((n(),m(c,{label:"\u8D44\u91D1\u7F16\u53F7",prop:"tradNo"},{default:l(()=>[u(v,{class:"mb-[10px]",modelValue:f.value.tradNo,onClick:e[0]||(e[0]=t=>k.value=!0),placeholder:"\u8D44\u91D1\u7F16\u53F7"},null,8,["modelValue"]),a(i).data?(n(),m(ie,{key:0,tradeInfo:a(i).data},null,8,["tradeInfo"])):B("v-if",!0)]),_:1})),[[S,a(i).loading]]),u(c,null,{label:l(()=>[pe]),default:l(()=>[b("div",me,[b("div",fe,[a(E)?(n(),m(_,{key:0,style:{width:"40px"},type:"primary",size:"small",onClick:e[1]||(e[1]=()=>C.value.onDisplay(a(d.value)))},{default:l(()=>[y(" \u6DFB\u52A0 ")]),_:1})):B("v-if",!0)]),u(G,{data:d.value,size:"small",border:"",prop:"orderArr"},{default:l(()=>[(n(!0),h(Y,null,ee(a(le),(t,V)=>(n(),m(I,{key:V,label:t.label,prop:t.prop,width:t.width,"show-overflow-tooltip":""},{default:l(({row:F})=>[t.label==="\u6B64\u6B21\u8BA4\u9886"?(n(),m(z,te({key:0,size:"small",placeholder:"\u6B64\u6B21\u8BA4\u9886\u91D1\u989D",modelValue:r.value[F.sequenceNo],"onUpdate:modelValue":D=>r.value[F.sequenceNo]=D},a(se)),null,16,["modelValue","onUpdate:modelValue"])):t.prop==="status"?(n(),m(O,{key:1},{default:l(()=>{var D;return[y(ae((D=a(oe).find(J=>String(F.status)===J.value))==null?void 0:D.label),1)]}),_:2},1024)):B("v-if",!0)]),_:2},1032,["label","prop","width"]))),128)),u(I,{label:"\u64CD\u4F5C",fixed:"right"},{default:l(({row:t})=>[u(_,{type:"danger",link:"",onClick:V=>R(t.sequenceNo)},{default:l(()=>[y(" \u5220\u9664 ")]),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"])])]),_:1})]),_:1},8,["model"]),a(E)?(n(),h("div",ve,[u(w,{onClick:e[2]||(e[2]=t=>A(!1))},{default:l(()=>[y(" \u4FDD\u5B58\u5E76\u8FD4\u56DE ")]),_:1}),u(w,{type:"primary",onClick:e[3]||(e[3]=t=>A(!0))},{default:l(()=>[y(" \u4EC5\u4FDD\u5B58 ")]),_:1})])):B("v-if",!0),u(ue,{isCommon:a(i).data&&a(i).data.trade_type=="1",ref_key:"saleModalRef",ref:C,onSaveClickButton:L},null,8,["isCommon"]),u(ne,{visible:k.value,"onUpdate:visible":e[4]||(e[4]=t=>k.value=t),onSubmit:$},null,8,["visible"])])),[[S,a(x).loading]])}}});var Ee=W(_e,[["__file","C:/Users/89793/Desktop/projects/settle-vue3/src/views/InvoiceSales/capitalPool/base-form/index.vue"]]);export{Ee as default};
