import{p as B,r as d,f as I,u as S,A as T,t as k,g as f,j as s,aq as L,P as z,d as u,v as A}from"./index-CKIL6d0V.js";import{M as g,W as j}from"./ConsultantsWuman-xRHtPEIs.js";import{P as v}from"./index-V9Oy4lBT.js";import{R as N}from"./DeleteOutlined-BHDTCKcb.js";const F=B.div`
  width: 100%;
  height: 100%;
  padding-bottom: 5px;
  overflow: auto;
  .topPointBar {
    height: 40px;
    margin-bottom: 15px;
    display: flex;
    background-color: ${t=>t.theme.colorBgContainer};
    .leftBack {
      width: 40px;
      height: 40px;
      font-size: 20px;
      font-weight: 600;
      display: flex;
      justify-content: center;
      align-items: center;
    }
    .centerTitle {
      flex: 1;
      display: flex;
      justify-content: center;
      align-items: center;
      font-size: 14px;
      font-weight: 600;
    }
  }
  .cardList {
    border-radius: 10px;
    .card {
      height: 100px;
      border-radius: 10px;
      margin-bottom: 15px;
      display: flex;
      background-color: ${t=>t.theme.colorBgContainer};
      box-shadow: ${t=>t.theme.boxShadowCard};
      .leftImg {
        width: 80px;
        height: 100px;
        display: flex;
        justify-content: center;
        align-items: center;
        img {
          width: 60px;
          height: 60px;
          border-radius: 10px;
          overflow: hidden;
          background-color: ${t=>t.theme.colorBorder};
        }
      }
      .rightCounse {
        flex: 1;
        overflow: hidden;
        font-size: 12px;
        padding-top: 10px;
        position: relative;
        .common {
          height: 30px;
          line-height: 30px;
        }
        .topName {
          font-size: 14px;
        }
        .fixedStatus {
          position: absolute;
          height: 30px;
          line-height: 30px;
          padding: 0 10px;
          border-radius: 15px;
          top: 50%;
          right: 15%;
          opacity: 1;
          transform: translateY(-50%) rotate(45deg);
          border-width: 1px;
          border-style: dashed;

        }
        .remark {
          padding-right: 10px;
          white-space: nowrap;
          text-overflow: ellipsis;
          overflow: hidden;
        }
        .cancel {
          top: 50%;
          right: 20px;
          font-size: 18px;
          transform: translateY(-50%);
          color: #FFA500;
          position: absolute;
        }

      }
    }
  }
`,M=d.memo(()=>{const{userInfo:t}=I(e=>e),y=S(),{message:c}=T.useApp(),{token:w}=k.useToken(),[i,C]=d.useState(5),[_,o]=d.useState(!1),[n,m]=d.useState([]);d.useEffect(()=>{f("/api/PsyCounse/GetListOrdermanage",{person_id:t.id,pageIndex:1,pageSize:9999}).then(e=>{e.code===200&&m(e.data.items)})},[t]);const p=e=>{const a=[{id:e.id,person_id:t.id,status:4}];A("/api/PsyCounse/AddOrUpdate_order",a).then(h=>{h.code===200&&(c.success(h.msg),f("/api/PsyCounse/GetListOrdermanage",{person_id:t.id,pageIndex:1,pageSize:9999}).then(l=>{l.code===200?m(l.data.items):c.warning(l.msg)}))}),console.log("取消预约",a)},r=(e,a=!1)=>{switch(e){case 0:return a?"#FFA500":" 已预约";case 1:return a?"#fba0b1":" 等待面询";case 2:return a?"#FF0000":" 拒绝";case 3:return a?"#bebf84":" 面询完成";case 4:return a?"#608ca7":" 取消面询";case 5:return a?"#99badf":" 全部预约";default:return a?"#ff0000":" 异 常"}},b=e=>{C(e),o(!1)},x=[{key:1,label:"等待面询"},{key:3,label:"面询完成"},{key:4,label:"取消面询"},{key:5,label:"全部预约"}],P=s.jsx("div",{className:"filterList",children:x.map(e=>s.jsx("p",{style:{padding:"5px",fontSize:"12px"},onClick:()=>b(e.key),children:e.label},e.key))});return s.jsxs(F,{theme:w,children:[s.jsxs("div",{className:"topPointBar",children:[s.jsx("div",{className:"leftBack",onClick:()=>y("/layout/psy_counsel_manage"),children:s.jsx(L,{})}),s.jsxs("div",{className:"centerTitle",children:["我的预约:  ",s.jsx("span",{children:s.jsx(z,{placement:"bottom",content:P,trigger:"click",open:_,destroyTooltipOnHide:!0,children:s.jsx("span",{style:{color:r(i,!0)},onClick:()=>o(!0),children:x.filter(e=>e.key===i)[0].label})})})]}),s.jsx("div",{className:"leftBack"})]}),s.jsxs("div",{className:"cardList",children:[i!==5&&n&&n.filter(e=>e.status===i).map(e=>s.jsxs("div",{className:"card",children:[s.jsx("div",{className:"leftImg",children:s.jsx("div",{className:"imgbg",children:e.psex===1?s.jsx("img",{className:"img",src:g,alt:""}):s.jsx("img",{className:"img",src:j,alt:""})})}),s.jsxs("div",{className:"rightCounse",children:[s.jsx("div",{className:"common topName",children:e.cname}),s.jsxs("div",{className:"common dateAndTime",children:[e.order_date,"   ",u(e.order_date).format("dddd"),"  ",e.order_time]}),s.jsxs("div",{className:"common remark",children:["留言:   ",e.remark]}),s.jsx("div",{className:"fixedStatus",style:{color:r(e.status,!0),borderColor:r(e.status,!0)},children:r(e.status,!1)}),s.jsx("div",{className:"cancel",children:s.jsx(v,{placement:"left",title:"是否取消预约",onConfirm:()=>p(e),okText:"确定",cancelText:"取消",cancelButtonProps:{className:"ysh_antd_btn"},okButtonProps:{className:"ysh_antd_btn"},children:e.status===0&&s.jsx(N,{})})})]})]},e.id)),i===5&&n&&n.map(e=>s.jsxs("div",{className:"card",children:[s.jsx("div",{className:"leftImg",children:s.jsx("div",{className:"imgbg",children:e.psex===1?s.jsx("img",{className:"img",src:g,alt:""}):s.jsx("img",{className:"img",src:j,alt:""})})}),s.jsxs("div",{className:"rightCounse",children:[s.jsx("div",{className:"common topName",children:e.cname}),s.jsxs("div",{className:"common dateAndTime",children:[e.order_date,"   ",u(e.order_date).format("dddd"),"  ",e.order_time]}),s.jsxs("div",{className:"common remark",children:["留言:   ",e.remark]}),s.jsx("div",{className:"fixedStatus",style:{color:r(e.status,!0),borderColor:r(e.status,!0)},children:r(e.status,!1)}),s.jsx("div",{className:"cancel",children:s.jsx(v,{placement:"left",title:"是否取消预约",onConfirm:()=>p(e),okText:"确定",cancelText:"取消",children:e.status===0&&s.jsx(N,{})})})]})]},e.id))]})]})});M.displayName="MyBooking";export{M as default};
