|
@@ -17,7 +17,7 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="me-head-right">
|
|
|
- <div class="u-follow" @click="setFollow">
|
|
|
+ <div class="u-follow" @click="setClickClaim">
|
|
|
<span :class="{ icon_claim_yes: follow.followed, icon_claim_no: !follow.followed }"></span>
|
|
|
<span class="follow_text">{{ follow.followed ? '取消认领' : '认领' }}</span>
|
|
|
</div>
|
|
@@ -92,7 +92,7 @@ export default {
|
|
|
},
|
|
|
created () {
|
|
|
this.mid = this.$route.params.mid
|
|
|
- this.setFollow('init')
|
|
|
+ this.setFollow()
|
|
|
this.getMedicalInst()
|
|
|
},
|
|
|
computed: {
|
|
@@ -101,14 +101,14 @@ export default {
|
|
|
}),
|
|
|
setBusstype () {
|
|
|
switch (this.info.business_type) {
|
|
|
- case 0:
|
|
|
- return '公立'
|
|
|
case 1:
|
|
|
- return '民营'
|
|
|
+ return '公立'
|
|
|
case 2:
|
|
|
- return '其他'
|
|
|
+ return '民营'
|
|
|
+ case 3:
|
|
|
+ return '其它'
|
|
|
default:
|
|
|
- return '其他'
|
|
|
+ return '其它'
|
|
|
}
|
|
|
},
|
|
|
getCompany () {
|
|
@@ -136,7 +136,7 @@ export default {
|
|
|
this.infoloading = false
|
|
|
})
|
|
|
},
|
|
|
- setFollow (str) {
|
|
|
+ setFollow () {
|
|
|
this.follow.loading = true
|
|
|
const param = {
|
|
|
company_id: this.mid,
|
|
@@ -145,19 +145,18 @@ export default {
|
|
|
// 查询是否认领
|
|
|
isClaimed(param).then(res => {
|
|
|
if (res.error_code === 0) {
|
|
|
- if (str === 'init') {
|
|
|
- this.follow.followed = res.data.status
|
|
|
- } else {
|
|
|
- if (res.data.status) {
|
|
|
- this.setCancelClaim()
|
|
|
- } else {
|
|
|
- this.setOptionClaim()
|
|
|
- }
|
|
|
- }
|
|
|
+ this.follow.followed = res.data.status
|
|
|
this.follow.loading = false
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
+ setClickClaim () {
|
|
|
+ if (this.follow.followed) {
|
|
|
+ this.setCancelClaim()
|
|
|
+ } else {
|
|
|
+ this.setOptionClaim()
|
|
|
+ }
|
|
|
+ },
|
|
|
// 认领
|
|
|
setOptionClaim () {
|
|
|
const param = {
|
|
@@ -165,7 +164,10 @@ export default {
|
|
|
ent_id: this.mid
|
|
|
}
|
|
|
setClaim(param).then(res => {
|
|
|
- if (res.error_code === 0) {
|
|
|
+ if (!(res && res.error_code === 0 && res.error_msg === '')) {
|
|
|
+ this.follow.followed = false
|
|
|
+ this.$toast(res.error_msg)
|
|
|
+ } else if (res.error_code === 0) {
|
|
|
this.follow.followed = true
|
|
|
this.$toast('认领成功')
|
|
|
} else if (res.error_code === 1013) {
|
|
@@ -183,7 +185,10 @@ export default {
|
|
|
ent_id: this.mid
|
|
|
}
|
|
|
institutionUnclaimed(param).then(res => {
|
|
|
- if (res.error_code === 0) {
|
|
|
+ if (!(res && res.error_code === 0 && res.error_msg === '')) {
|
|
|
+ this.follow.followed = true
|
|
|
+ this.$toast(res.error_msg)
|
|
|
+ } else if (res.error_code === 0) {
|
|
|
this.follow.followed = false
|
|
|
this.$toast('取消认领成功')
|
|
|
} else {
|