1
0
Fork 0
master
panliang 2023-10-08 15:26:07 +08:00
parent 94cd31bf51
commit 4dfe604309
4 changed files with 151 additions and 38 deletions

View File

@ -1,5 +1,12 @@
<template> <template>
<view class="page"> <view class="page">
<view class="info">
<u-cell :title="info.name">
<view slot="icon">
<u-avatar :src="info.avatar" />
</view>
</u-cell>
</view>
<view class="btns"> <view class="btns">
<u-empty v-if="list.length == 0" mode="list" text="请先在后台添加分类" /> <u-empty v-if="list.length == 0" mode="list" text="请先在后台添加分类" />
<view class="btn" v-for="item in list" :key="item.id"> <view class="btn" v-for="item in list" :key="item.id">
@ -11,6 +18,9 @@
/> />
</view> </view>
</view> </view>
<view class="footer">
<u-button text="退出登录" type="error" @click="logout" />
</view>
</view> </view>
</template> </template>
@ -18,39 +28,73 @@
export default { export default {
data() { data() {
return { return {
info: {},
list: [] list: []
} }
}, },
onLoad() { onLoad() {
const params = {_action: 'getData'} this.init()
this.$ajax.get('/admin-api/category', {
params,
custom: { loading: true }
}).then(res => {
if (res.status == 0) {
this.list = res.data.items
}
})
}, },
methods: { methods: {
init() {
this.$ajax.get('/admin-api/category', {
params: {_action: 'getData'},
custom: { loading: true }
}).then(res => {
if (res.status == 0) {
this.list = res.data.items
}
})
this.$ajax.get('/admin-api/current-user').then(res => {
if (res.status == 0) {
this.info = res.data
}
})
},
itemClick(e) { itemClick(e) {
uni.setStorageSync('medical_record_treat_type_id', e) uni.setStorageSync('medical_record_treat_type_id', e)
uni.navigateTo({ uni.navigateTo({
url: '/pages/patient/index' url: '/pages/patient/index'
}) })
},
logout() {
uni.showModal({
title: '退出登录',
content: '是否确定?',
success: (e) => {
if (e.confirm) {
this.$ajax.get('/admin-api/logout').then(res => {
if (res.status == 0) {
uni.removeStorageSync('medical_record_auth_token')
uni.reLaunch({ url: '/pages/login/login' })
}
})
}
}
})
} }
} }
} }
</script> </script>
<style scoped> <style scoped>
.page {
padding: 0 10px;
}
.info {
margin-top: 100rpx;
background: white;
}
.btns { .btns {
margin-top: 400rpx; margin-top: 300rpx;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
} }
.btns .btn { .btns .btn {
width: 90%; width: 100%;
margin-top: 20px; margin-top: 20px;
} }
.footer {
margin-top: 100rpx;
}
</style> </style>

View File

@ -15,13 +15,13 @@
rightIcon="edit-pen" rightIcon="edit-pen"
@click="toggleGender" @click="toggleGender"
/> />
<u-cell <u-cell isLink rightIcon="edit-pen">
title="联系方式" <view slot="icon" @click="handleCall(info.phone)">
:value="info.phone" <u-icon name="phone" />
isLink </view>
rightIcon="edit-pen" <view slot="title" @click="handleCall(info.phone)"></view>
@click="openModal('联系方式', 'phone')" <view slot="value" @click="openModal('联系方式', 'phone')">{{ info.phone }}</view>
/> </u-cell>
<u-cell <u-cell
title="地址" title="地址"
:value="info.address" :value="info.address"
@ -49,7 +49,21 @@
:value="info.doctor?info.doctor.name : ''" :value="info.doctor?info.doctor.name : ''"
isLink isLink
rightIcon="edit-pen" rightIcon="edit-pen"
@click="opendDoctor" @click="opendDoctor('doctor')"
/>
<u-cell
title="邀请人"
:value="info.inviter?info.inviter.name : ''"
isLink
rightIcon="edit-pen"
@click="opendDoctor('inviter')"
/>
<u-cell
title="业务员"
:value="info.saler?info.saler.name : ''"
isLink
rightIcon="edit-pen"
@click="opendDoctor('saler')"
/> />
<u-cell <u-cell
title="病情描述" title="病情描述"
@ -142,6 +156,9 @@ export default {
value: (new Date).getTime(), value: (new Date).getTime(),
minDate: (new Date('1900/1/1')).getTime() minDate: (new Date('1900/1/1')).getTime()
}, },
adminUser: {
key: ''
}
} }
}, },
onLoad(e) { onLoad(e) {
@ -238,17 +255,22 @@ export default {
} }
}) })
}, },
opendDoctor() { opendDoctor(key) {
this.adminUser.key = key
this.$refs['select-admin-user'].open() this.$refs['select-admin-user'].open()
}, },
closeDoctor() { closeDoctor() {
this.$refs['select-admin-user'].close() this.$refs['select-admin-user'].close()
}, },
selectDoctor(e) { selectDoctor(e) {
this.update({ doctor_id: e.id }).then(res => { const key = this.adminUser.key
const params = {}
params[`${key}_id`] = e.id
this.update(params).then(res => {
if (res.status == 0) { if (res.status == 0) {
this.info.doctor_id = e.id this.info[`${key}_id`] = e.id
this.info.doctor.name = e.name this.info[key].id = e.id
this.info[key].name = e.name
} }
}) })
this.closeDoctor() this.closeDoctor()
@ -295,6 +317,13 @@ export default {
}, 1000) }, 1000)
} }
}) })
},
handleCall(phone) {
console.log(phone)
window.open(`tel:${phone}`, '_blank')
// uni.makePhoneCall({
// phoneNumber: phone
// });
} }
} }
} }

View File

@ -30,13 +30,27 @@
<u-icon name="arrow-right" /> <u-icon name="arrow-right" />
</view> </view>
</u-form-item> </u-form-item>
<u-form-item prop="doctor_id" label="坐诊医生" @click="opendDoctor"> <u-form-item prop="doctor_id" label="坐诊医生" @click="opendDoctor('doctor')">
<view class="input-text"> <view class="input-text">
<text v-if="form.doctor_id">{{ doctor.text }}</text> <text v-if="form.doctor_id">{{ adminUser.doctor.text }}</text>
<text v-else class="input-placeholder">请选择坐诊医生</text> <text v-else class="input-placeholder">请选择坐诊医生</text>
<u-icon name="arrow-right" /> <u-icon name="arrow-right" />
</view> </view>
</u-form-item> </u-form-item>
<u-form-item prop="inviter_id" label="推荐人" @click="opendDoctor('inviter')">
<view class="input-text">
<text v-if="form.inviter_id">{{ adminUser.inviter.text }}</text>
<text v-else class="input-placeholder">请选择推荐人</text>
<u-icon name="arrow-right" />
</view>
</u-form-item>
<u-form-item prop="saler_id" label="业务员" @click="opendDoctor('saler')">
<view class="input-text">
<text v-if="form.saler_id">{{ adminUser.saler.text }}</text>
<text v-else class="input-placeholder">请选择业务员</text>
<u-icon name="arrow-right" />
</view>
</u-form-item>
<u-form-item label="病情描述" prop="illness" @click="openEditor"> <u-form-item label="病情描述" prop="illness" @click="openEditor">
<view class="input-text"> <view class="input-text">
<!-- <rich-text v-if="form.illness" :nodes="form.illness" /> --> <!-- <rich-text v-if="form.illness" :nodes="form.illness" /> -->
@ -93,6 +107,8 @@ export default {
address: '', address: '',
treat_at: '', treat_at: '',
doctor_id: '', doctor_id: '',
inviter_id: '',
saler_id: '',
illness: '', illness: '',
images: [] images: []
}, },
@ -112,9 +128,20 @@ export default {
value: (new Date).getTime(), value: (new Date).getTime(),
minDate: (new Date('1900/1/1')).getTime() minDate: (new Date('1900/1/1')).getTime()
}, },
doctor: { adminUser: {
text: '', key: '',
value: '', doctor: {
text: '',
value: '',
},
inviter: {
text: '',
value: '',
},
saler: {
text: '',
value: '',
},
} }
} }
}, },
@ -174,15 +201,17 @@ export default {
this.form[this.datePicker.name] = uni.$u.timeFormat(e.value, 'yyyy-mm-dd') this.form[this.datePicker.name] = uni.$u.timeFormat(e.value, 'yyyy-mm-dd')
this.toggleBirthday() this.toggleBirthday()
}, },
opendDoctor() { opendDoctor(key) {
this.adminUser.key = key
this.$refs['select-admin-user'].open() this.$refs['select-admin-user'].open()
}, },
closeDoctor() { closeDoctor() {
this.$refs['select-admin-user'].close() this.$refs['select-admin-user'].close()
}, },
selectDoctor(e) { selectDoctor(e) {
this.form.doctor_id = e.id const key = this.adminUser.key
this.doctor = { this.form[`${key}_id`] = e.id
this.adminUser[key] = {
value: e.id, value: e.id,
text: e.name text: e.name
} }

View File

@ -19,13 +19,6 @@
rightIcon="edit-pen" rightIcon="edit-pen"
@click="toggleDatePicker('treat_at')" @click="toggleDatePicker('treat_at')"
/> />
<u-cell
title="就诊医生"
:value="adminUser.doctor_name"
isLink
rightIcon="edit-pen"
@click="opendAdminUser('doctor')"
/>
<u-cell <u-cell
title="划线价" title="划线价"
:value="info.origin_price" :value="info.origin_price"
@ -47,6 +40,24 @@
rightIcon="edit-pen" rightIcon="edit-pen"
@click="toggleOrderStatus" @click="toggleOrderStatus"
/> />
<u-cell
title="就诊医生"
:value="adminUser.doctor_name"
:label="`提成金额: ${info.doctor_money}`"
isLink
rightIcon="edit-pen"
@click="opendAdminUser('doctor')"
/>
<u-cell
title="邀请人"
:value="info.inviter ? info.inviter.name : ''"
:label="`提成金额: ${info.inviter_money}`"
/>
<u-cell
title="业务员"
:value="info.saler ? info.saler.name : ''"
:label="`提成金额: ${info.saler_money}`"
/>
<u-cell <u-cell
title="诊疗情况" title="诊疗情况"
isLink isLink