123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- import { querySingle, patientUpdate } from '../patient-detail/service';
- import history from '../../utils/history';
- Component({
- props: {},
- data: {
- patient: {
- balance: 0,
- id: '',
- name: '',
- age: '',
- sex: '',
- phoneNumber: '',
- birthDay: '',
- idCardNo: '',
- relationShip: '',
- bindCardNum: '',
- medicCards: []
- }
- },
- didMount() {
- this.querySingle();
- },
- 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
- },
- 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);
- }
- }
- });
|