diff --git a/src/pages/patient/detail.vue b/src/pages/patient/detail.vue index 03dbc04..e2fc363 100644 --- a/src/pages/patient/detail.vue +++ b/src/pages/patient/detail.vue @@ -64,7 +64,9 @@ />
- + + +
{ + if (result.confirm) { + this.delete(this.info.id) + } + } + }) + }, + delete(id) { + uni.showLoading() + this.$ajax.delete(`/admin-api/patient/${id}`).then(res => { + if (res.status == 0) { + uni.showToast({ + title: '删除成功', + icon: 'success' + }) + setTimeout(() => { + uni.navigateBack() + }, 1000) + } + }) + } } } @@ -227,6 +260,8 @@ export default { } .btn { padding: 0 10px; + } + .btn .u-button { margin-top: 20px; } diff --git a/src/pages/patient/index.vue b/src/pages/patient/index.vue index 190217f..5b9e171 100644 --- a/src/pages/patient/index.vue +++ b/src/pages/patient/index.vue @@ -13,15 +13,19 @@ + + + + { + if (result.confirm) { + this.delete(item.id) + } + } + }) + } + }, delete(id) { uni.showLoading() this.$ajax.delete(`/admin-api/patient/${id}`).then(res => { diff --git a/src/pages/record/detail.vue b/src/pages/record/detail.vue index c812b2c..3791720 100644 --- a/src/pages/record/detail.vue +++ b/src/pages/record/detail.vue @@ -87,6 +87,9 @@ :value="info.created_at" /> +
+ +
{ + if (result.confirm) { + this.handleDelete(this.id) + } + } + }) + }, + handleDelete(id) { + uni.showLoading() + this.$ajax.delete(`/admin-api/record/${id}`).then(res => { + if (res.status == 0) { + uni.showToast({ + title: '删除成功', + icon: 'success' + }) + setTimeout(() => { + uni.navigateBack() + }, 1000) + } + }) + } } } - - \ No newline at end of file diff --git a/src/pages/record/form.vue b/src/pages/record/form.vue index 6912649..a4f0e0c 100644 --- a/src/pages/record/form.vue +++ b/src/pages/record/form.vue @@ -211,9 +211,12 @@ export default { this.$ajax.get('/admin-api/category', {_action: 'getData'}).then(res => { if (res.status == 0) { this.typeList = res.data.items - const type_id = uni.getStorageSync('medical_record_treat_type_id'); + let type_id = e.type_id + if (!type_id) { + type_id = uni.getStorageSync('medical_record_treat_type_id') + } if (type_id) { - this.form.type_id = type_id + this.form.type_id = parseInt(type_id) this.typeChange(type_id) } } diff --git a/src/pages/record/index.vue b/src/pages/record/index.vue index d6ce05e..a31bbc3 100644 --- a/src/pages/record/index.vue +++ b/src/pages/record/index.vue @@ -1,6 +1,9 @@