import{g as I}from"./configs.ac3e0c04.js";import{u as J}from"./use-response-handle.f995d678.js";import{e as K}from"./index.5188fe49.js";import{b as B}from"./status.8b8d6c88.js";import{q as $,B as r,a4 as A,r as n,as as G,o as w,K as y,H as a,p as m,t as e,n as M,J as Q,v as d,I as W,L as X,bl as Y,S as c,O as V,D as Z}from"./index.7a111e62.js";const ee={flex:"","justify-between":""},oe={flex:"","mb-2":"","gap-2":""},le={flex:"","mb-2":"","w-400px":"","gap-2":""},te=c("\u641C\u7D22"),ae=c("\u91CD\u7F6E"),ue={flex:"","justify-between":"","mt-2":""},ne=c("\u4FDD\u5B58"),se=c("\u53D6\u6D88"),fe=$({__name:"add-order-modal",props:{supplierNo:null,companyNo:null},emits:["saveBtnClick"],setup(x,{expose:z,emit:E}){const P=x,f=r(!1),b=r(!1),T=J(),i=r({}),N=r(null),D=r([]),S=r([]),u=A({pageSize:10,currentPage:1,total:0});async function v(){b.value=!0;const{currentPage:s,pageSize:l}=u,{supplierNo:h,companyNo:C}=P,{code:p,data:g,message:t}=await K({...d(i),supplierNo:h,companyNo:C,page:s,size:l});T({code:p,message:t,handler:()=>{S.value=g.list,u.total=g.count}}),b.value=!1}function R(){u.currentPage=1,i.value={},v()}function U(s){D.value=s}function q(){f.value=!1,E("saveBtnClick",d(D))}function H(s){f.value=!0,D.value=s,Z(()=>s.forEach(l=>N.value.toggleRowSelection(l,!0)))}return z({onDisplay:H}),(s,l)=>{const h=n("el-option"),C=n("el-select"),p=n("el-button"),g=n("el-input"),t=n("el-table-column"),k=n("el-tag"),L=n("ElPagination"),j=n("el-dialog"),O=G("loading");return w(),y(j,{modelValue:f.value,"onUpdate:modelValue":l[5]||(l[5]=o=>f.value=o),title:"\u9009\u62E9\u91C7\u8D2D\u5546\u54C1",center:"","destroy-on-close":"",onOpen:v},{default:a(()=>[m("div",ee,[m("div",oe,[m("div",le,[e(C,{placeholder:"\u53D1\u8D27\u72B6\u6001",modelValue:i.value.sendStatus,"onUpdate:modelValue":l[0]||(l[0]=o=>i.value.sendStatus=o),cleable:""},{default:a(()=>[(w(!0),M(W,null,Q(d(B),o=>(w(),y(h,{key:o.value,label:o.label,value:o.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"]),e(g,{placeholder:"\u91C7\u8D2D\u5355\u7F16\u53F7",modelValue:i.value.sequenceNo,"onUpdate:modelValue":l[1]||(l[1]=o=>i.value.sequenceNo=o)},{append:a(()=>[e(p,{onClick:v},{default:a(()=>[te]),_:1})]),_:1},8,["modelValue"])])]),e(p,{onClick:R},{default:a(()=>[ae]),_:1})]),X((w(),y(d(Y),{ref_key:"tableRef",ref:N,"row-key":"id",size:"small",data:S.value,onSelectionChange:U},{default:a(()=>[e(t,{type:"selection",width:"55","reserve-selection":""}),e(t,{label:"\u91C7\u8D2D\u5355\u7F16\u53F7",prop:"sequenceNo",width:"180"}),e(t,{label:"\u91C7\u8D2D\u5355\u4FE1\u606F"},{default:a(()=>[e(t,{label:"\u4F9B\u8D27\u5546",prop:"supplierName",width:"160","show-overflow-tooltip":""}),e(t,{label:"\u91C7\u8D2D\u5458",prop:"ownerName",width:"80","show-overflow-tooltip":""}),e(t,{label:"\u53D1\u8D27\u72B6\u6001",prop:"sendStatus",width:"90","show-overflow-tooltip":""},{default:a(({row:o})=>[e(k,null,{default:a(()=>{var _;return[c(V((_=d(B).find(F=>F.value===o.sendStatus))==null?void 0:_.label),1)]}),_:2},1024)]),_:1}),e(t,{label:"\u5F00\u7968\u7F16\u53F7",width:"90"}),e(t,{label:"\u5F00\u7968\u516C\u53F8",prop:"companyName",width:"140","show-overflow-tooltip":""})]),_:1}),e(t,{label:"\u5546\u54C1\u4FE1\u606F"},{default:a(()=>[e(t,{label:"\u5546\u54C1\u540D\u79F0",prop:"goodName",width:"140","show-overflow-tooltip":""}),e(t,{label:"\u5546\u54C1\u7C7B\u578B",prop:"goodType",width:"90","show-overflow-tooltip":""},{default:a(({row:o})=>[e(k,null,{default:a(()=>{var _;return[c(V((_=d(I).find(F=>F.value===o.goodType))==null?void 0:_.label),1)]}),_:2},1024)]),_:1}),e(t,{label:"\u5546\u54C1\u6570\u91CF",prop:"goodNum",width:"90","show-overflow-tooltip":""})]),_:1})]),_:1},8,["data"])),[[O,b.value]]),m("div",ue,[e(L,{"current-page":u.currentPage,"onUpdate:current-page":l[2]||(l[2]=o=>u.currentPage=o),"page-size":u.pageSize,"onUpdate:page-size":l[3]||(l[3]=o=>u.pageSize=o),total:u.total,"page-sizes":[10,15,20],onCurrentChange:v},null,8,["current-page","page-size","total"]),m("div",null,[e(p,{type:"primary",onClick:q},{default:a(()=>[ne]),_:1}),e(p,{onClick:l[4]||(l[4]=o=>f.value=!1)},{default:a(()=>[se]),_:1})])])]),_:1},8,["modelValue"])}}});export{fe as default};
