var z=Object.defineProperty,G=Object.defineProperties;var K=Object.getOwnPropertyDescriptors;var M=Object.getOwnPropertySymbols;var $=Object.prototype.hasOwnProperty,J=Object.prototype.propertyIsEnumerable;var O=(e,t,a)=>t in e?z(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,I=(e,t)=>{for(var a in t||(t={}))$.call(t,a)&&O(e,a,t[a]);if(M)for(var a of M(t))J.call(t,a)&&O(e,a,t[a]);return e},v=(e,t)=>G(e,K(t));var E=(e,t,a)=>new Promise((g,h)=>{var b=s=>{try{o(a.next(s))}catch(_){h(_)}},k=s=>{try{o(a.throw(s))}catch(_){h(_)}},o=s=>s.done?g(s.value):Promise.resolve(s.value).then(b,k);o((a=a.apply(e,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 x,w as n,e as f,u as d,k as w,G as P,d as S,i as l,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 at}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 et={key:0},ot={key:1},ht=Object.assign({name:"ycqw"},{__name:"index",setup(e){const{t}=Q(),a=at,{listData:g,loading:h,showLoading:b,hideLoading:k,paginationState:o,resetPagination:s,searchFormData:_}=R();U(),C();function C(){return E(this,null,function*(){try{b();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("ycqw")},_.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 q({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"),B=u("a-table"),F=u("a-card"),N=u("a-col"),T=u("a-row");return c(),x(T,{gutter:8,wrap:!1},{default:n(()=>[f(N,{flex:"auto"},{default:n(()=>[f(F,{type:"flex"},{default:n(()=>[f(B,{columns:d(a),"data-source":d(g),bordered:"true",loading:d(h),pagination:d(o),scroll:{x:1e3},onChange:q},{bodyCell:n(({column:y,record:p})=>[y.dataIndex==="createdAt"?(c(),w("span",et,P(d(S)(p.createdAt).format("YYYY-MM-DD HH:mm")),1)):l("",!0),y.dataIndex==="expireAt"?(c(),w("span",ot,P(d(S)(p.expireAt).format("YYYY-MM-DD HH:mm")),1)):l("",!0),y.dataIndex==="status"?(c(),w(V,{key:2},[p.status==="success"?(c(),x(m,{key:0,color:"green"},{default:n(()=>[H("已核销")]),_:1})):l("",!0),p.status==="checked"?(c(),x(m,{key:1},{default:n(()=>[H("待核销")]),_:1})):l("",!0)],64)):l("",!0),y.key==="action"?(c(),w(V,{key:3},[p.status==="checked"?(c(),x(D,{key:0,onClick:nt=>j(p)},{default:n(()=>[f(Y,null,{title:n(()=>[H("核销")]),default:n(()=>[f(d(W))]),_:1})]),_:2},1032,["onClick"])):l("",!0)],64)):l("",!0)]),_:1},8,["columns","data-source","loading","pagination"])]),_:1})]),_:1})]),_:1})}}});export{ht as default};
