123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- import { querySingle, patientUpdate } from "../patient-detail/service";
- import { createSubscribe } from "applet-page-component";
- import history from "../../utils/history";
- Component(
- createSubscribe({
- async onShow() {
- await this.querySingle();
- },
- })({
- props: {},
- data: {
- patient: {
- balance: 0,
- id: "",
- name: "",
- age: "",
- sex: "",
- phoneNumber: "",
- birthDay: "",
- idCardNo: "",
- relationShip: "",
- bindCardNum: "",
- medicCards: [],
- },
- },
- didMount() {
- this.querySingle();
- },
- didUnmount() {},
- methods: {
- querySingle() {
- const {
- query = {
- id: "",
- },
- } = this.$page.data;
- my.showLoading();
- querySingle({
- id: query.id,
- }).then((data) => {
- this.setData({
- patient: data,
- });
- my.hideLoading();
- });
- },
- // 修改关系
- onChange(e) {
- this.setData({
- "patient.relationShip": e.name,
- });
- },
- onChangePhone() {
- history.push({
- query: {
- id: this.data.patient.id,
- relationShip: this.data.patient.relationShip,
- },
- title: "修改手机号",
- pageType: "patient-detail-phone",
- });
- },
- onSubmit() {
- patientUpdate({
- id: this.data.patient.id,
- name: this.data.patient.name,
- relationShip: this.data.patient.relationShip,
- }).then(my.navigateBack);
- },
- },
- })
- );
|