Browse Source

管理员后台挂号费缴费相关

master
longchao 4 weeks ago
parent
commit
ba06684c5d
  1. 7
      src/components/GuipSwitch.vue
  2. 2
      src/components/paymentMethod.vue
  3. 6
      src/views/HomeView.vue
  4. 146
      src/views/HosInformation.vue
  5. 2
      src/views/Register.vue
  6. 2
      src/views/elementGroups.vue

7
src/components/GuipSwitch.vue

@ -3,8 +3,7 @@
<div class="switchWrap">
<span :class="['switchDesc', { 'fl': float == 'left' }, { 'fr': float == 'right' }]"
v-if="activeText || inactiveText">
{{ internalValue === activeValue ? activeText : inactiveText
}}</span>
{{ internalValue === activeValue ? activeText : inactiveText}}</span>
<el-switch v-model="internalValue" :active-color="activeColor" :inactive-color="inactiveColor"
v-bind="$attrs" :disabled="disabled" :active-value="activeValue" :inactive-value="inactiveValue"
@ -16,13 +15,14 @@
<template #inactive-icon>
</template>
</el-switch>
</div>
</el-form-item>
</template>
<script>
export default {
name: 'GuipSwitchå',
name: 'GuipSwitch',
inheritAttrs: false,
props: {
// modelValue: { type: [Boolean, String, Number], default: undefined },
@ -85,6 +85,7 @@ export default {
watch: {
value(newVal) {
this.internalValue = newVal
console.log(this.internalValue, 88888)
},
// modelValue(newVal) {
// this.internalValue = newVal

2
src/components/paymentMethod.vue

@ -14,7 +14,7 @@
<p>{{ item.num }}</p>
</dd>
</dl>
<GuipSwitch :modelValue="item.flag" activeText="开启" inactiveText="关闭" @change="onSwitchChange">
<GuipSwitch :value="item.flag" activeText="开启" inactiveText="关闭" @change="onSwitchChange">
</GuipSwitch>
</div>
</div>

6
src/views/HomeView.vue

@ -31,8 +31,8 @@
<el-avatar :src="item.avator" v-if="item.avator"></el-avatar>
<span class="name">{{ item.name }}</span>
<span>{{ item.phone }}</span>
<GuipSwitch :modelValue="Boolean(Number(item.status))" @change="onSwitchChange(item, index)">
</GuipSwitch>
<GuipSwitch :value="Boolean(Number(item.status))" @change="onSwitchChange(item, index)" :active-value="true" :inactive-value="false"></GuipSwitch>
<GuipButton type="text" @click="editDoctor(item, index)">编辑</GuipButton>
</div>
<div class="right">
@ -77,7 +77,7 @@
<el-table-column prop="create" label="时间" min-width="250"> </el-table-column>
<el-table-column prop="stock" fixed="right" min-width="110">
<template slot-scope="scope">
<GuipSwitch :modelValue="scope.row.status" active-value="1" inactive-value="0" @change="onSwitchChange1(scope.row)"></GuipSwitch>
<GuipSwitch :value="scope.row.status" active-value="1" inactive-value="0" @change="onSwitchChange1(scope.row)"></GuipSwitch>
</template>
</el-table-column>
<el-table-column label="操作" fixed="right" min-width="120px">

146
src/views/HosInformation.vue

@ -55,7 +55,7 @@
<GuipFormItem column="column" class="mb24" v-if="departIsFixed != -1">
<div slot="formLeft" class="form-top-icon">医保定点</div>
<div class="flex" slot="formDom" style="padding: 9px 0px;">
<GuipSwitch :model-value="departIsFixed" @change="onSwitchChange" activeText="医保定点"
<GuipSwitch :value="departIsFixed" @change="onSwitchChange" activeText="医保定点"
inactiveText="非医保定点" :active-value="true" :inactive-value="false">
</GuipSwitch>
</div>
@ -153,8 +153,7 @@
<el-form>
<div class="mb32 flex gap12">
<span class="littleTitle">线上收款</span>
<GuipSwitch v-model="onLinePay" :active-value="1" :inactive-value="0" @change="onLineChange">
</GuipSwitch>
<GuipSwitch :value="onLinePay" :active-value="1" :inactive-value="0" @change="onLineChange"></GuipSwitch>
<span v-if="!onLinePay" class="tipInfo">未绑定微信收款方式无法开启线上收款</span>
<span v-if="!onLinePay == 1"> {{ onLinePay == 1 ? '开启' : '' }}</span>
</div>
@ -260,10 +259,8 @@
<el-form>
<div class="mb32 flex gap12">
<span class="littleTitle">收挂号费</span>
<GuipSwitch v-model="onRegister" :active-value="1" :inactive-value="2" @change="onLineChange">
</GuipSwitch>
<span> {{ onRegister == 1 ? '' : '关闭' }}</span>
<span v-if="onRegister == 1" class="desc">开启患者在小程序预约时需缴纳挂号费</span>
<GuipSwitch :value="hasVisitFee" :active-value="1" :inactive-value="0" @change="onVisitFeeChange"></GuipSwitch>
<span class="desc">患者在小程序预约时{{hasVisitFee == 1?'':'不'}}需缴纳挂号费</span>
</div>
<div class="bidwrap-item">
<div class="biditemMast mb12 flex-between">
@ -273,7 +270,7 @@
<p class="desc" v-if="registerMoney">{{registerMoney}}/</p>
</div>
</div>
<div class="flex" v-if="payinfo.apiv3">
<div class="flex" v-if="registerMoney">
<span :class="'yesSet'">已设置</span>
<GuipButton type="system" :btnstyle="{ width: '126px', height: '38px' }"
@click="showDialog('register')">修改</GuipButton>
@ -289,10 +286,10 @@
<div class="bidwrap-item-top flex">
<div class="top-right column">
<p>免挂号费规则</p>
<p class="desc">患者5天内再次就诊患者有剩余治疗项目免收挂号费</p>
<p class="desc" v-if="againVisitFreeDays && hasAgainVisitFreeDays">患者{{againVisitFreeDays}}天内再次就诊患者有剩余治疗项目免收挂号费</p>
</div>
</div>
<div class="flex" v-if="payinfo.apiv3">
<div class="flex" v-if="hasFreeRegisterRule">
<span :class="'yesSet'">已设置</span>
<GuipButton type="system" :btnstyle="{ width: '126px', height: '38px' }"
@click="showDialog('registerRule')">修改</GuipButton>
@ -377,7 +374,7 @@
<el-table-column prop="need_countdown" label="倒计时弹窗开关" min-width="125">
<template slot-scope="scope">
<GuipSwitch :modelValue="scope.row.need_countdown" active-value="1" inactive-value="0"
<GuipSwitch :value="scope.row.need_countdown" active-value="1" inactive-value="0"
@change="onSwitchChange3(scope.row)">
</GuipSwitch>
</template>
@ -385,7 +382,7 @@
<el-table-column prop="status" label="状态" min-width="125">
<template slot-scope="scope">
<GuipSwitch :modelValue="scope.row.status" active-value="1" inactive-value="0"
<GuipSwitch :value="scope.row.status" active-value="1" inactive-value="0"
@change="onSwitchChange1(scope.row)">
</GuipSwitch>
</template>
@ -440,7 +437,7 @@
<el-table-column prop="create_time" label="添加时间" min-width="225"></el-table-column>
<el-table-column prop="status" label="状态" min-width="125">
<template slot-scope="scope">
<GuipSwitch :modelValue="scope.row.status" active-value="1" inactive-value="0"
<GuipSwitch :value="scope.row.status" active-value="1" inactive-value="0"
@change="onSwitchChange2(scope.row)">
</GuipSwitch>
</template>
@ -461,30 +458,28 @@
</div>
<GuipDialog :dialogVisible="registrationVisible" title="设置挂号费金额" :show-close-button="false" width="599px"
:show-cancel-button="true" @confirm="handleRegisterConfirm('registerMoney')" @cancel="handleregisterCancel" >
:show-cancel-button="true" @confirm="handleRegisterConfirm('registerMoney')" @cancel="handleregisterCancel" ref="visitFee">
<el-form>
<GuipInput v-model="registerMoney" type="number"
placeholder="请输入" unit="元/人"></GuipInput>
<GuipInput v-model="registerMoney" placeholder="请输入" unit="元/人"></GuipInput>
</el-form>
</GuipDialog>
<!-- freeRegVisible -->
<GuipDialog :dialogVisible="freeRegVisible" title="免挂号费规则" :show-close-button="false" width="599px"
:show-cancel-button="true" @confirm="handleRegisterConfirm('freeRegVisible')" @cancel="handleregisterCancel" >
<p class="freeDesc">若勾选多个规则满足其一即免挂号费</p>
<el-form class="freeWrap">
<div class="flex gap8 mb24 mt24">
<el-checkbox v-model="checked1"></el-checkbox>
患者
<GuipInput v-model="registerDays" type="number" width="92px"
placeholder="请输入"></GuipInput>天内再次就诊免挂号费
<el-checkbox v-model="hasAgainVisitFreeDays" :true-label="1" :false-label="0"></el-checkbox>
患者{{hasAgainVisitFreeDays}}
<GuipInput v-model="againVisitFreeDays" type="number" width="92px" placeholder="请输入"></GuipInput>天内再次就诊免挂号费
</div>
<p class="flex gap8">
<el-checkbox v-model="checked2"></el-checkbox>
<el-checkbox v-model="hasRemainVisitFree" :true-label="1" :false-label="0"></el-checkbox>
患者有剩余治疗项目免挂号费
</p>
</el-form>
</GuipDialog>
<GuipDialog :dialogVisible="dialogVisible" :title="dialogTitle" :show-close-button="true" width="762"
:show-cancel-button="true" @confirm="handleConfirm" @cancel="handleCancel" @close="handleClose"
@dialogVisibleChange="dialogVisibleChange">
@ -709,16 +704,20 @@ export default {
selectWxpay:null,
selectAlipay: null,
onLinePay:null,
onRegister:1,
addPayType: -1,
isShowAddPay: false,
isExistSelfSupplys: false,
payinfo: [],
registerMoney:'',//
registerDays:5,
freeRegVisible:true,
freeRegVisible:false,
registrationVisible:false,
hasVisitFee:null,
paySwitch:null,
hasFreeRegisterRule:false,
hasAgainVisitFreeDays:0,
againVisitFreeDays:0,
hasRemainVisitFree:0,
}
},
created() {
@ -774,15 +773,39 @@ export default {
this.freeRegVisible = true;
}
},
onLineChange() {
if(this.selectWxpay){
async onVisitFeeChange(e) {
this.hasVisitFee = e
await this.$http('POST', '/api/admin/set_has_visit_fee', {
has_visit_fee: this.hasVisitFee,
doctor_id: this.doctor_id,
depart_id: this.depart_id
}).then(response => {
const { code } = response
const msg = this.hasVisitFee === 1 ? '已开启' : '已关闭'
const type = code === 0 ? 'success' : 'error';
this.$positionMessage({
type: type,
message: msg+'收挂号费',
target: this.$refs['wxPayRef'],
position: 'bottom'
})
}).catch(error => {
console.error(error, 'error')
})
},
onLineChange(e) {
this.onLinePay
this.onLinePay = e
if(!this.selectWxpay){
this.$positionMessage({
type: 'error',
message: '未绑定',
target: this.$refs['wxPayRef'], // DOM
message: '请先绑定微信支付',
target: this.$refs['wxPayRef'],
position: 'bottom'
})
}
console.log(this.onLinePay, '====-0000');
},
//
@ -859,30 +882,61 @@ export default {
this.registrationVisible = false;
},
handleRegisterConfirm(type){
// freeRegVisible
const params = {
uid: this.$route.query.uid,
}
var params = {}
params.doctor_id = this.doctor_id
params.depart_id = this.depart_id
if(type == 'freeRegVisible'){
params.registerMoney = this.registerMoney.trim()
this.$http('POST', '/agentnew/ajax_get_pay_list', {
params.has_again_visit_free_days = parseInt(this.hasAgainVisitFreeDays) ? 1 : 0
params.again_visit_free_days = parseInt(this.againVisitFreeDays)
if(params.again_visit_free_days < 0){
this.$positionMessage({
type: 'error',
message: '请输入正确的天数',
target: '#siteMessage7',
})
return;
}
params.has_remain_visit_free = parseInt(this.hasRemainVisitFree) ? 1 : 0
this.$http('POST', '/api/admin/set_visit_free_rules', {
...params
}).then(response => {
this.$nextTick(() => {
console.log(response);
this.registrationVisible = false;
this.freeRegVisible = false;
})
}).catch(error => {
console.error(error, 'error')
})
}else{
// params.checked1 = 1;
// params.checked1 = 1;
this.$http('POST', '/agentnew/ajax_get_pay_list', {
params.price = parseInt(this.registerMoney)
if(!params.price || params.price <= 0) {
this.$positionMessage({
type: 'error',
message: '请输入正确的金额',
target: '#siteMessage7',
position: 'top',
})
return;
}
this.$http('POST', '/api/admin/set_visit_price', {
...params
}).then(response => {
this.$nextTick(() => {
console.log(response);
if(response.code !== 0) {
this.$positionMessage({
type: 'error',
message: response.msg,
target: '#siteMessage7',
})
}else{
this.$positionMessage({
type: 'success',
message: '设置成功',
target: '#siteMessage7',
})
}
this.registrationVisible = false;
})
}).catch(error => {
@ -982,6 +1036,15 @@ export default {
}
this.departType = (response.data.type || response.data.type === 0 || response.data.type === "0") ? [Number(response.data.type)] : []
this.departIsFixed = response.data.is_fixed == "1" ? true : false
this.paySwitch = response.data.pay_switch
this.hasVisitFee = response.data.has_visit_fee
this.registerMoney = response.data.visit_price
this.hasAgainVisitFreeDays = response.data.has_again_visit_free_days
this.againVisitFreeDays = response.data.again_visit_free_days
this.hasRemainVisitFree = response.data.has_remain_visit_free
if((this.hasAgainVisitFreeDays && this.againVisitFreeDays) || this.hasRemainVisitFree) this.hasFreeRegisterRule = true
this.getAreaData(this.form.province)
}).catch(error => {
console.error(error, 'error')
@ -1320,7 +1383,6 @@ export default {
})
},
ChangeTime(type) {
console.log(this.form.morning_worktime, type, '===');
},
btnClick() {

2
src/views/Register.vue

@ -456,7 +456,7 @@
</el-table-column>
<el-table-column prop="stock" fixed="right" label="上首页" min-width="160">
<template slot-scope="scope">
<GuipSwitch :modelValue="scope.row.homeFlag" @change="onSwitchChange(scope.row)">
<GuipSwitch :value="scope.row.homeFlag" @change="onSwitchChange(scope.row)">
</GuipSwitch>
</template>
</el-table-column>

2
src/views/elementGroups.vue

@ -269,7 +269,7 @@
<div class="ele-item">
<label for="">开关L</label>
<GuipSwitch :modelValue="switchValue" activeText="开启" inactiveText="关闭" @change="onSwitchChange">
<GuipSwitch :value="switchValue" activeText="开启" inactiveText="关闭" @change="onSwitchChange">
</GuipSwitch>
</div>
<el-button type="primary" @click="submitForm">Submit</el-button>

Loading…
Cancel
Save