var q=Object.defineProperty,G=Object.defineProperties;var K=Object.getOwnPropertyDescriptors;var H=Object.getOwnPropertySymbols;var $=Object.prototype.hasOwnProperty,J=Object.prototype.propertyIsEnumerable;var M=(e,t,a)=>t in e?q(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)&&M(e,a,t[a]);if(H)for(var a of H(t))J.call(t,a)&&M(e,a,t[a]);return e},O=(e,t)=>G(e,K(t));var j=(e,t,a)=>new Promise((g,h)=>{var w=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(w,k);o((a=a.apply(e,t)).next())});import{u as Q,f as v,g as A}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 b,G as L,d as P,i as l,F as S,E,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:"ycjd"},{__name:"index",setup(e){const{t}=Q(),a=at,{listData:g,loading:h,showLoading:w,hideLoading:k,paginationState:o,resetPagination:s,searchFormData:_}=R();U(),C();function C(){return j(this,null,function*(){try{w();const{pageSize:r,current:i}=o,{success:m,data:Y,total:D}=yield v.productOrder.getProjectList(I({pageSize:r,current:i,channel:"product",productId:tt.getValue("ycjd")},_.value)).catch(()=>{throw new Error});k(),A("http.code.success")===m&&(g.value=Y,o.total=D)}catch(r){k()}})}const V=r=>{X.confirm({title:"即将核销是否继续",content:t("button.confirm"),okText:t("button.confirm"),onOk:()=>j(this,null,function*(){const i=O(I({},r),{status:"success"}),{success:m}=yield v.productOrder.updateItem(i.id,i).catch(()=>{});A("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(),x(z,{gutter:8,wrap:!1},{default:n(()=>[f(T,{flex:"auto"},{default:n(()=>[f(N,{type:"flex"},{default:n(()=>[f(F,{columns:d(a),"data-source":d(g),bordered:"true",loading:d(h),pagination:d(o),scroll:{x:1e3},onChange:B},{bodyCell:n(({column:y,record:p})=>[y.dataIndex==="createdAt"?(c(),b("span",et,L(d(P)(p.createdAt).format("YYYY-MM-DD HH:mm")),1)):l("",!0),y.dataIndex==="expireAt"?(c(),b("span",ot,L(d(P)(p.expireAt).format("YYYY-MM-DD HH:mm")),1)):l("",!0),y.dataIndex==="status"?(c(),b(S,{key:2},[p.status==="success"?(c(),x(m,{key:0,color:"green"},{default:n(()=>[E("已核销")]),_:1})):l("",!0),p.status==="checked"?(c(),x(m,{key:1},{default:n(()=>[E("待核销")]),_:1})):l("",!0)],64)):l("",!0),y.key==="action"?(c(),b(S,{key:3},[p.status==="checked"?(c(),x(D,{key:0,onClick:nt=>V(p)},{default:n(()=>[f(Y,null,{title:n(()=>[E("核销")]),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};
