import{a as E,b as N}from"./status.fad06285.js";import{q as A,a2 as v,r as p,o as c,n as b,p as x,t as e,H as o,S as a,O as _,v as n,P as C,K as S,I as L,aM as O}from"./index.d8ce26ef.js";const V={flex:"","justify-between":"","w-full":"","mb-1":""},T={key:0},q=a("\u6DFB\u52A0\u91C7\u8D2D\u5355"),M=a("\u5220\u9664"),P={key:0,flex:"","gap-1":"","mt-2":""},$=a("\u4FDD\u5B58"),H=A({__name:"basic-purchase",props:{purchaseOrderList:null,readonly:{type:Boolean},supplierNo:null,companyNo:null},emits:["addBtnClick","delBtnClick","crateBtnClick","changeSupplieList"],setup(B,{emit:f}){const h=B,g=[{value:"1",label:"\u5E93\u5B58"},{value:"2",label:"\u975E\u5E93\u5B58"},{value:"3",label:"\u54A8\u8BE2"}],w=v(()=>!h.readonly),y=v(()=>h.purchaseOrderList.length),k=r=>f("delBtnClick",r);function D(){const{supplierNo:r,companyNo:i}=h;if(!r||!i)return O.warning("\u8BF7\u9009\u62E9\u4F9B\u5E94\u5546\u548C\u4E1A\u52A1\u516C\u53F8");f("addBtnClick")}return(r,i)=>{const d=p("el-tag"),m=p("el-button"),t=p("el-table-column"),F=p("el-table");return c(),b(L,null,[x("div",V,[e(d,{type:"warning"},{default:o(()=>[a("\u5171\u8BA1:"+_(n(y))+"\u4E2A\u8BA2\u5355",1)]),_:1}),n(w)?(c(),b("div",T,[e(m,{type:"primary",onClick:D},{default:o(()=>[q]),_:1})])):C("",!0)]),e(F,{ref:"tableRef","row-key":"id",size:"small",data:B.purchaseOrderList,"max-height":"400"},{default:o(()=>[e(t,{label:"\u91C7\u8D2D\u5355\u7F16\u53F7",prop:"sequenceNo",width:"150"}),e(t,{label:"\u91C7\u8D2D\u5355\u4FE1\u606F"},{default:o(()=>[e(t,{label:"\u4F9B\u8D27\u5546",prop:"supplierName",width:"160","show-overflow-tooltip":""}),e(t,{label:"\u53D1\u8D27\u72B6\u6001",prop:"sendStatus",width:"90","show-overflow-tooltip":""},{default:o(({row:u})=>[e(d,null,{default:o(()=>{var l;return[a(_((l=n(E).find(s=>s.value===u.sendStatus))==null?void 0:l.label),1)]}),_:2},1024)]),_:1}),e(t,{label:"\u4E1A\u52A1\u516C\u53F8",prop:"companyName",width:"180","show-overflow-tooltip":""}),e(t,{label:"\u8BA2\u5355\u6765\u6E90",prop:"cgdSource",width:"100","show-overflow-tooltip":""},{default:o(({row:u})=>[e(d,null,{default:o(()=>{var l;return[a(_((l=n(N).find(s=>s.value===u.cgdSource))==null?void 0:l.label),1)]}),_:2},1024)]),_:1}),e(t,{label:"\u603B\u8D27\u6B3E",prop:"totalPrice",width:"80","show-overflow-tooltip":""})]),_:1}),e(t,{label:"\u5546\u54C1\u4FE1\u606F"},{default:o(()=>[e(t,{label:"\u5546\u54C1\u7F16\u53F7",prop:"goodNo",width:"140","show-overflow-tooltip":""}),e(t,{label:"\u5546\u54C1\u540D\u79F0",prop:"goodName",width:"180","show-overflow-tooltip":""}),e(t,{label:"\u5546\u54C1\u6765\u6E90",prop:"cgdType",width:"90","show-overflow-tooltip":""},{default:o(({row:u})=>[e(d,null,{default:o(()=>{var l;return[a(_((l=g.find(s=>s.value===String(u.cgdType)))==null?void 0:l.label),1)]}),_:2},1024)]),_:1}),e(t,{label:"\u5546\u54C1\u6570\u91CF",prop:"goodNum",width:"90","show-overflow-tooltip":""})]),_:1}),e(t,{label:"\u91C7\u8D2D\u5458",prop:"ownerName",width:"75","show-overflow-tooltip":""}),n(w)?(c(),S(t,{key:0,label:"\u64CD\u4F5C",fixed:"right"},{default:o(({row:u})=>[e(m,{link:"",type:"primary",onClick:l=>k(u)},{default:o(()=>[M]),_:2},1032,["onClick"])]),_:1})):C("",!0)]),_:1},8,["data"]),n(w)?(c(),b("div",P,[e(m,{type:"primary",onClick:i[0]||(i[0]=u=>f("crateBtnClick"))},{default:o(()=>[$]),_:1})])):C("",!0)],64)}}});export{H as default};
