diff --git a/src/views/HomeView.vue b/src/views/HomeView.vue index bfb231a..7fc98b0 100644 --- a/src/views/HomeView.vue +++ b/src/views/HomeView.vue @@ -88,8 +88,7 @@ - - + @@ -143,6 +142,7 @@ export default { doctorList: false, allChecked: false, pageShow:false, + doctorIds:[], payList:[] } }, @@ -170,15 +170,14 @@ export default { store.commit('SET_CUSTOMIZE', false); store.commit('SET_SLIDER_MENU', 'menuData'); this.getInitData() - this.getBindpayList() }, computed: { ...mapState(['menuData']) // 从Vuex映射showSidebar状态到组件的计算属性中 }, methods: { // 初始化请求 - getInitData() { - this.$http('POST', '/api/admin/doctor_depart_list', { + async getInitData() { + await this.$http('POST', '/api/admin/doctor_depart_list', { name: this.doctorName }).then(response => { if (response.code == 0) { @@ -190,6 +189,14 @@ export default { } }) this.doctorList = list + var doctorIds = [] + for (let index = 0; index < list.length; index++) { + var element = list[index]; + doctorIds.push(element.id); + } + this.doctorIds = doctorIds; + this.getBindpayList(doctorIds) + this.calculateTotalNum() this.pageShow = true } @@ -197,13 +204,13 @@ export default { console.error(error, 'error') }) }, - async getBindpayList() { - await this.$http('POST', '/api/admin/get_pay_list', { - doctor_id: 3, - depart_id: 4 + async getBindpayList(doctorIds) { + var payList = new Object(); + await this.$http('POST', '/api/admin/get_doctors_pay_list', { + doctor_ids: JSON.stringify(doctorIds) }).then(response => { - this.payList.push(...response.data[2],...response.data[3]) - console.log(this.payList,response,'this.payList====00000'); + payList = response.data; + this.payList = payList }).catch(error => { console.error(error, 'error') }) @@ -359,6 +366,25 @@ export default { this.$message.error('操作失败'); }) }, + onSwitchPaymethods(item, index) { + item.status = item.status == 0 ? 1 : 0; + console.log(index, item, '===='); + this.$set(this.doctorList, item) + + this.$http('POST', '/api/admin/set_doctor_status', { + doctor_id:item.id, + status:item.status + }).then(response => { + if (response.code == 0) { + this.$message.success(response.msg); + }else{ + this.$message.error(response.msg); + } + }).catch(error => { + console.error(error, 'error') + this.$message.error('操作失败'); + }) + }, addDoctor() { this.$router.push({ name: '医生信息', diff --git a/src/views/paymentMethod.vue b/src/views/paymentMethod.vue index 8b5769f..ef333e8 100644 --- a/src/views/paymentMethod.vue +++ b/src/views/paymentMethod.vue @@ -22,10 +22,10 @@ - + @@ -104,12 +104,12 @@ export default { }, watch:{ - + list: { deep: true, handler(newVal) { console.log(newVal,'newVal====='); - this.payList = [...newVal]; + this.payList = [...newVal]; this.tableLoading = false; } @@ -122,9 +122,9 @@ export default { this.doctorId =doctor_id; } console.log(this.doctor_id,'=doctor_id==='); - + }, - mounted() { + mounted() { if(this.doctor_id){ this.getBindpayList() } @@ -192,7 +192,7 @@ export default { }, }, - + };