"use strict";var t=require("../common/vendor.js"),e=require("../api/patient.js");require("../common/request.js");const i={data:()=>({patient:[]}),onLoad(){this.getPatientList(),t.index.$on("refreshPatient",(()=>{this.getPatientList()}))},methods:{selectPatient(e){t.index.$emit("refreshOrderPatient",e),t.index.navigateBack({delta:1})},editPatient(e){t.index.navigateTo({url:"./addEditPatient?type=edit&patientId="+e.patientId})},delPatient(i){t.index.showModal({title:"提示",content:"确认删除吗?",showCancel:!0,cancelText:"取消",confirmText:"确定",success:n=>{if(n.confirm){var a={patientId:i.patientId};e.delPatient(a).then((e=>{200==e.code?(t.index.showToast({icon:"success",title:"操作成功"}),this.getPatientList()):t.index.showToast({icon:"none",title:"请求失败"})}),(t=>{}))}}})},getPatientList(){e.getPatientList().then((e=>{t.index.hideLoading(),200==e.code?this.patient=e.data:t.index.showToast({icon:"none",title:"请求失败"})}),(t=>{}))},addPatient(){t.index.navigateTo({url:"./addEditPatient?type=add"})}}};var n=t._export_sfc(i,[["render",function(e,i,n,a,d,s){return t.e({a:t.f(d.patient,((i,n,a)=>t.e({a:t.t(i.patientName),b:1==i.sex},(i.sex,{}),{c:2==i.sex},(i.sex,{}),{d:t.t(e.$getAge(i.birthday)),e:t.t(e.$parseIdCard(i.idCard)),f:t.o((t=>s.delPatient(i))),g:t.o((t=>s.editPatient(i))),h:n,i:t.o((t=>s.selectPatient(i)),n)}))),b:0==d.patient.length},0==d.patient.length?{c:t.o((t=>s.getPatientList()))}:{},{d:t.o(((...t)=>s.addPatient&&s.addPatient(...t)))})}]]);wx.createPage(n);
