import{e as L}from"./index.b38c0e7a.js";import{r as R}from"./responseHandle.f073653a.js";import{q as V,A as M,B as a,a4 as T,r as f,as as H,o as v,n as C,t as d,H as y,v as n,L as O,S as $,aM as F}from"./index.d8ce26ef.js";import{useColumns as I}from"./columns.1ca7940c.js";import{u as U,_ as j}from"./use-page-search.665e4825.js";import"./status.fad06285.js";import"./basic-form.147ada95.js";import"./global.9ad647c8.js";import"./hooks.3def80f5.js";const G={colLayout:{span:8},formItems:[{field:"order_timer",type:"date_picker",otherOptions:{type:"daterange",startPlaceholder:"\u4E0B\u5355\u8D77\u59CB\u65F6\u95F4",endPlaceholder:"\u4E0B\u5355\u7ED3\u675F\u65F6\u95F4"}},{field:"sequenceNo",type:"input",placeholder:"\u9500\u552E\u8BA2\u5355\u7F16\u53F7"},{field:"sequenceNo",type:"input",placeholder:"\u9500\u552E\u8BA2\u5355\u7F16\u53F7"},{field:"customer",type:"input",placeholder:"\u5BA2\u6237\u540D\u79F0"}]},J=$("\u4FDD\u5B58"),ue=V({__name:"order-dialog",emits:["reload","save-btn-click"],setup(K,{expose:B,emit:k}){const{columns:E}=I(),{logout:b}=M(),s=a(!1),p=a(!1),g=a([]),S=a(),h=a([]),r=T({total:0,pageSize:15,currentPage:1,background:!0});let m={};const c=a({...{page:1,size:10,start:"",end:"",total_min:"",total_max:"",inv_status:"1",pay_status:"",sequenceNo:"",customerNo:"",customer:"",platName:"",status:"0"}}),_=a(""),{handleSearchClick:N,handleResetClick:A}=U(e=>(m=e,i(),{result:{},deleteProps:[]}),()=>{m={},i()}),D=e=>{c.value.page=e,i()};async function w(e){s.value=!0,_.value=e,await i()}function P(e){h.value=e}async function i(){p.value=!0;const{code:e,data:t,message:o}=await L({cat_status:"1",pay_status:"0",inv_status:"0",companyNo:_.value,...c.value,...m});R({code:e,message:o,logout:b,handler:()=>{const{list:u,count:l}=t!=null?t:{};g.value=u!=null?u:[],r.total=l!=null?l:0,r.pageSize=c.value.size,r.currentPage=c.value.page}}),p.value=!1}function x(){const e=n(h);if(e.length===0)return F.error("\u81F3\u5C11\u9009\u62E9\u4E00\u4E2A\u9500\u552E\u8BA2\u5355\uFF01");const t=e.filter(o=>o.goodNum==="0"||o.winv_fee==="0.00");if(t.length!==0)return F.error(`\u9500\u552E\u5355 ${t[0].SequenceNo} \u5F00\u7968\u91D1\u989D\u6216\u6570\u91CF\u4E3A\u7A7A`);k("save-btn-click",e),s.value=!1}return B({show:w}),(e,t)=>{const o=f("PureTable"),u=f("el-button"),l=f("el-dialog"),q=H("loading");return v(),C("div",null,[d(l,{modelValue:s.value,"onUpdate:modelValue":t[0]||(t[0]=z=>s.value=z),"close-on-press-escape":!1,center:"","append-to-body":"","destroy-on-close":"",top:"5vh",title:"\u6DFB\u52A0\u9500\u552E\u8BA2\u5355",width:"1040px"},{default:y(()=>[d(n(j),{onResetBtnClick:n(A),onSearchBtnClick:n(N),"form-config":n(G)},null,8,["onResetBtnClick","onSearchBtnClick","form-config"]),O((v(),C("div",null,[d(o,{ref_key:"tableRef",ref:S,border:"",align:"left","row-key":"id","table-layout":"auto",size:"small",data:g.value,columns:n(E),pagination:r,paginationSmall:!0,"header-cell-style":{background:"#fafafa",color:"#606266"},onSelectionChange:P,onCurrentChange:D},null,8,["data","columns","pagination"])])),[[q,p.value]]),d(u,{type:"primary",onClick:x},{default:y(()=>[J]),_:1})]),_:1},8,["modelValue"])])}}});export{ue as default};
