var q=Object.defineProperty,G=Object.defineProperties;var K=Object.getOwnPropertyDescriptors;var M=Object.getOwnPropertySymbols;var $=Object.prototype.hasOwnProperty,J=Object.prototype.propertyIsEnumerable;var O=(a,t,e)=>t in a?q(a,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):a[t]=e,I=(a,t)=>{for(var e in t||(t={}))$.call(t,e)&&O(a,e,t[e]);if(M)for(var e of M(t))J.call(t,e)&&O(a,e,t[e]);return a},v=(a,t)=>G(a,K(t));var E=(a,t,e)=>new Promise((g,h)=>{var w=s=>{try{o(e.next(s))}catch(_){h(_)}},k=s=>{try{o(e.throw(s))}catch(_){h(_)}},o=s=>s.done?g(s.value):Promise.resolve(s.value).then(w,k);o((e=e.apply(a,t)).next())});import{u as Q,f as A,g as L}from"./index-2a45336b.js";import{u as R}from"./usePagination-7442a465.js";import{a as U,b as u,o as c,c as y,w as n,e as f,u as l,k as b,G as P,d as S,i as d,F as V,E as H,aK as W,a5 as X,aa as Z}from"./ant-design-vue-710243d9.js";import{e as tt}from"./useEnum-4e87ed86.js";import{c as et}from"./commonColumns-abede3be.js";import"./tinymce-3184e0f1.js";import"./echarts-ca5d9323.js";import"./cropper-47c8e461.js";import"./lodash-es-7cb071db.js";import"./qrcode-bec2257a.js";import"./jschardet-bd496279.js";const at={key:0},ot={key:1},ht=Object.assign({name:"hotel"},{__name:"index",setup(a){const{t}=Q(),e=et,{listData:g,loading:h,showLoading:w,hideLoading:k,paginationState:o,resetPagination:s,searchFormData:_}=R();U(),C();function C(){return E(this,null,function*(){try{w();const{pageSize:r,current:i}=o,{success:m,data:Y,total:D}=yield A.productOrder.getProjectList(I({pageSize:r,current:i,channel:"product",productId:tt.getValue("hotel")},_.value)).catch(()=>{throw new Error});k(),L("http.code.success")===m&&(g.value=Y,o.total=D)}catch(r){k()}})}const j=r=>{X.confirm({title:"即将核销是否继续",content:t("button.confirm"),okText:t("button.confirm"),onOk:()=>E(this,null,function*(){const i=v(I({},r),{status:"success"}),{success:m}=yield A.productOrder.updateItem(i.id,i).catch(()=>{});L("http.code.success")===m&&(Z.success("核销成功"),yield C())})})};function B({current:r,pageSize:i}){o.current=r,o.pageSize=i,C()}return(r,i)=>{const m=u("a-tag"),Y=u("a-tooltip"),D=u("x-action-button"),F=u("a-table"),N=u("a-card"),T=u("a-col"),z=u("a-row");return c(),y(z,{gutter:8,wrap:!1},{default:n(()=>[f(T,{flex:"auto"},{default:n(()=>[f(N,{type:"flex"},{default:n(()=>[f(F,{columns:l(e),"data-source":l(g),bordered:"true",loading:l(h),pagination:l(o),scroll:{x:1e3},onChange:B},{bodyCell:n(({column:x,record:p})=>[x.dataIndex==="createdAt"?(c(),b("span",at,P(l(S)(p.createdAt).format("YYYY-MM-DD HH:mm")),1)):d("",!0),x.dataIndex==="expireAt"?(c(),b("span",ot,P(l(S)(p.expireAt).format("YYYY-MM-DD HH:mm")),1)):d("",!0),x.dataIndex==="status"?(c(),b(V,{key:2},[p.status==="success"?(c(),y(m,{key:0,color:"green"},{default:n(()=>[H("已核销")]),_:1})):d("",!0),p.status==="checked"?(c(),y(m,{key:1},{default:n(()=>[H("待核销")]),_:1})):d("",!0)],64)):d("",!0),x.key==="action"?(c(),b(V,{key:3},[p.status==="checked"?(c(),y(D,{key:0,onClick:nt=>j(p)},{default:n(()=>[f(Y,null,{title:n(()=>[H("核销")]),default:n(()=>[f(l(W))]),_:1})]),_:2},1032,["onClick"])):d("",!0)],64)):d("",!0)]),_:1},8,["columns","data-source","loading","pagination"])]),_:1})]),_:1})]),_:1})}}});export{ht as default};
