add-order-modal.4e4421bc.js 3.6 KB

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