Browse Source

增加获取绑定列表接收、修改绑定收款设置接口

zq-1011-paymentSetting
zq 1 week ago
parent
commit
f99e43913d
  1. 35
      src/components/addPay.vue
  2. 142
      src/views/HosInformation.vue
  3. 33
      src/views/weChatPayment.vue

35
src/components/addPay.vue

@ -67,7 +67,7 @@
<GuipFormItem column="column" class="mb24" label="2. 公司支付宝账号"> <GuipFormItem column="column" class="mb24" label="2. 公司支付宝账号">
<span class="desc flex gap12" slot="formRight">仅支持已签约 当面付 功能的公司支付宝 <a href='https://pay.weixin.qq.com/' class="guide" <span class="desc flex gap12" slot="formRight">仅支持已签约 当面付 功能的公司支付宝 <a href='https://pay.weixin.qq.com/' class="guide"
target='_blank'><img src="@/assets/site/form_qua_ic.svg" alt="">指南</a></span> target='_blank'><img src="@/assets/site/form_qua_ic.svg" alt="">指南</a></span>
<GuipInput slot="formDom" ref="GuipInput" column="column" v-model="alipayInfo.alipay_account" prop="alipay_account" placeholder="请输入公司支付宝账号"></GuipInput> <GuipInput slot="formDom" ref="GuipInput" column="column" v-model="alipayInfo.appid" prop="appid" placeholder="请输入公司支付宝账号"></GuipInput>
</GuipFormItem> </GuipFormItem>
</el-form> </el-form>
<!-- </el-tab-pane> --> <!-- </el-tab-pane> -->
@ -157,6 +157,15 @@ export default {
type: Boolean, type: Boolean,
default: false default: false
}, },
depart_id:{
type: String,
default: ''
},
doctor_id:{
type: String,
default: ''
},
}, },
components: { components: {
GuipInput, GuipInput,
@ -204,7 +213,7 @@ export default {
// APPID // APPID
appid: '', appid: '',
// //
alipay_account: '', // alipay_account: '',
// //
receive_payment_account: '', receive_payment_account: '',
// //
@ -215,14 +224,14 @@ export default {
pdd_shop_name: '', pdd_shop_name: '',
alipayInfo:{ alipayInfo:{
company_short_name: '', company_short_name: '',
alipay_account:'' appid:''
}, },
alipayRules:{ alipayRules:{
company_short_name: [ company_short_name: [
{ required: true, message: '请输入公司简称', trigger: 'blur' } { required: true, message: '请输入公司简称', trigger: 'blur' }
], ],
alipay_account: [ appid: [
{ required: true, message: '请输入公众号APPID', trigger: 'blur' } { required: true, message: '请输入支付宝账号', trigger: 'blur' }
], ],
} }
@ -262,7 +271,6 @@ export default {
this.mch_id = ''; this.mch_id = '';
this.apiv2 = ''; this.apiv2 = '';
this.appid = ''; this.appid = '';
this.alipay_account = '';
this.receive_payment_account = ''; this.receive_payment_account = '';
this.receive_payment_name = ''; this.receive_payment_name = '';
this.pdd_shop_name = ''; this.pdd_shop_name = '';
@ -305,16 +313,19 @@ export default {
} else if (this.addPayType == PAY_TYPE_ALIPAY) { // } else if (this.addPayType == PAY_TYPE_ALIPAY) { //
let falseFlag = false; let falseFlag = false;
// console.log(this.doctor_id,this.depart_id,'depart_id');
this.$refs.alipayForm.validate((valid) => { this.$refs.alipayForm.validate((valid) => {
console.log(valid,'valid==='); console.log(valid,'valid===');
if (valid) { if (valid) {
falseFlag = true; falseFlag = true;
this.$http('POST', '/agentnew/ajax_add_alipay', { this.$http('POST', '/api/admin/set_pay_method', {
company_short_name: this.alipayRules.company_short_name, doctor_id:this.doctor_id,
alipay_account: this.alipayRules.alipay_account, depart_id:this.depart_id,
is_pay_public: this.isPayPublic, type:this.payTypeAlipay,
// receive_payment_account: this.receive_payment_account, company_short_name: this.alipayInfo.company_short_name,
// receive_payment_name: this.receive_payment_name appid: this.alipayInfo.appid,
pay_id:1
// is_pay_public: this.isPayPublic,
}).then(response => { }).then(response => {
this.$nextTick(() => { this.$nextTick(() => {
if (response.status) { if (response.status) {

142
src/views/HosInformation.vue

@ -153,7 +153,7 @@
<el-form> <el-form>
<div class="mb32 flex gap12"> <div class="mb32 flex gap12">
<span class="littleTitle">线上收款</span> <span class="littleTitle">线上收款</span>
<GuipSwitch :value="onLinePay" :active-value="1" :inactive-value="0" :disabled="!selectWxpay?.short_name" @change="onLineChange"></GuipSwitch> <GuipSwitch :value="onLinePay" ref="hasOnlinePayRef" :active-value="1" :inactive-value="0" :disabled="selectWxpay?.short_name" @change="onLineChange"></GuipSwitch>
<span v-if="!onLinePay" class="tipInfo">未绑定微信收款方式无法开启线上收款</span> <span v-if="!onLinePay" class="tipInfo">未绑定微信收款方式无法开启线上收款</span>
<span v-if="!onLinePay == 1"> {{ onLinePay == 1 ? '开启' : '' }}</span> <span v-if="!onLinePay == 1"> {{ onLinePay == 1 ? '开启' : '' }}</span>
</div> </div>
@ -170,8 +170,8 @@
:options_null="!wxpayList.length" displayKey="name" valueKey="payid" :options_null="!wxpayList.length" displayKey="name" valueKey="payid"
@change="changeSelectWeixin"> @change="changeSelectWeixin">
<template #trigger> <template #trigger>
<span v-if="selectWxpay && (selectWxpay.short_name || selectWxpay.account)">{{ <span v-if="selectWxpay && (selectWxpay.company_short_name || selectWxpay.appid)">{{
selectWxpay.short_name }} {{ selectWxpay.account }}</span> selectWxpay.company_short_name }} {{ selectWxpay.appid }}</span>
<span v-else-if="wxpayList.length === 0">暂无收款账号稍后配置</span> <span v-else-if="wxpayList.length === 0">暂无收款账号稍后配置</span>
<span v-else>未绑定微信收款</span> <span v-else>未绑定微信收款</span>
</template> </template>
@ -192,12 +192,12 @@
<template #item="{ item }"> <template #item="{ item }">
<div class="flex-between"> <div class="flex-between">
<div class="left"> <div class="left">
<p class="one">{{ item.short_name }}</p> <p class="one">{{ item.company_short_name }}</p>
<p>{{ item.account }}</p> <p>{{ item.appid }}</p>
</div> </div>
<div class="right"> <div class="right">
<img v-if="selectWxpay && selectWxpay.payid == item.payid" <!-- <img v-if="selectWxpay && selectWxpay.payid == item.payid"
src="@/assets/drop-selected.svg" alt=""> src="@/assets/drop-selected.svg" alt=""> -->
</div> </div>
</div> </div>
</template> </template>
@ -218,8 +218,8 @@
<CustomDropdown slot="formDom" width="100%" :options="alipayList" <CustomDropdown slot="formDom" width="100%" :options="alipayList"
:options_null="!alipayList.length" @change="changeSelectAlipay"> :options_null="!alipayList.length" @change="changeSelectAlipay">
<template #trigger> <template #trigger>
<span v-if="selectAlipay && (selectAlipay.short_name || selectAlipay.account)">{{ <span v-if="selectAlipay && (selectAlipay.company_short_name || selectAlipay.appid)">{{
selectAlipay.short_name }} {{ selectAlipay.account }}</span> selectAlipay.company_short_name }} {{ selectAlipay.appid }}</span>
<span v-else-if="alipayList.length === 0">非必须绑定项</span> <span v-else-if="alipayList.length === 0">非必须绑定项</span>
<span v-else>未绑定支付宝收款</span> <span v-else>未绑定支付宝收款</span>
</template> </template>
@ -240,8 +240,8 @@
<template #item="{ item }"> <template #item="{ item }">
<div class="flex-between"> <div class="flex-between">
<div class="left"> <div class="left">
<p class="one">{{ item.short_name }}</p> <p class="one">{{ item.company_short_name }}</p>
<p>{{ item.account }}</p> <p>{{ item.appid }}</p>
</div> </div>
<div class="right"> <div class="right">
<img v-if="selectAlipay && selectAlipay.payid == item.payid" <img v-if="selectAlipay && selectAlipay.payid == item.payid"
@ -497,7 +497,7 @@
</GuipDialog> </GuipDialog>
<addPay :payType="addPayType" :visible="isShowAddPay" @update:visible="handleEvent" @update:data="handleUpdateEvent" <addPay :payType="addPayType" :visible="isShowAddPay" @update:visible="handleEvent" @update:data="handleUpdateEvent"
:isExistSelfSupplys="isExistSelfSupplys"></addPay> :isExistSelfSupplys="isExistSelfSupplys" :doctor_id="doctor_id" :depart_id="depart_id"></addPay>
</div> </div>
</template> </template>
<script> <script>
@ -737,6 +737,7 @@ export default {
this.fetchPackData() this.fetchPackData()
this.fetchProjectData() this.fetchProjectData()
this.geHosAdress() this.geHosAdress()
this.getBindpayList()
} else { } else {
await this.getAreaData() await this.getAreaData()
} }
@ -773,6 +774,55 @@ export default {
this.freeRegVisible = true; this.freeRegVisible = true;
} }
}, },
async getBindpayList() {
await this.$http('POST', '/api/admin/get_bind_pay_list', {
doctor_id: this.doctor_id,
depart_id: this.depart_id
}).then(response => {
// 1.2
if (
response.data &&
response.data &&
response.data[this.payTypeWeixin]
// &&response.data[this.payTypeWeixin].length > 0
) {
this.wxpayList = Array(response.data[this.payTypeWeixin])
}
if (
response.data &&
response.data &&
response.data[this.payTypeAlipay]
// &&response.data[this.payTypeAlipay].length > 0
) {
this.alipayList = Array(response.data[this.payTypeAlipay])
}
console.log( this.wxpayList, this.alipayList,'===');
}).catch(error => {
console.error(error, 'error')
})
},
async onLineChange(e) {
this.onLinePay = e;
await this.$http('POST', '/api/admin/set_pay_switch', {
doctor_id: this.doctor_id,
depart_id: this.depart_id,
pay_switch:this.onLinePay
}).then(response => {
console.log(response,'===');
const { code } = response
const msg = this.onLinePay === 1 ? '已开启' : '已关闭'
const type = code === 0 ? 'success' : 'error';
this.$positionMessage({
type: type,
message: msg+'线上收款',
target: this.$refs['hasOnlinePayRef'],
position: 'top'
})
}).catch(error => {
this.onLinePay = 0;
console.error(error, 'error')
})
},
async onVisitFeeChange(e) { async onVisitFeeChange(e) {
this.hasVisitFee = e this.hasVisitFee = e
await this.$http('POST', '/api/admin/set_has_visit_fee', { await this.$http('POST', '/api/admin/set_has_visit_fee', {
@ -793,44 +843,24 @@ export default {
console.error(error, 'error') console.error(error, 'error')
}) })
}, },
onLineChange(e) {
this.onLinePay = e
if(!this.selectWxpay){
this.$positionMessage({
type: 'error',
message: '请先绑定微信支付',
target: this.$refs['wxPayRef'],
position: 'bottom'
})
}
},
changeSelectWeixin(item) { changeSelectWeixin(item) {
console.log(item, 'item') console.log(item, 'item')
if(this.bindWxpayId === item.payid){ // if(this.bindWxpayId === item.payid){
this.bindWxpayId = 0 // this.bindWxpayId = 0
this.selectWxpay = null // this.selectWxpay = null
return true // return true
} // }
this.bindWxpayId = item.payid; // this.bindWxpayId = item.payid;
this.selectWxpay = item; this.selectWxpay = item;
this.$positionMessage({
type: 'success',
message: '绑定成功,开启线上收款',
target: this.$refs['wxPayRef'], // DOM
position: 'bottom'
})
}, },
changeSelectAlipay(item) { changeSelectAlipay(item) {
if(this.bindAlipayId === item.payid){ // if(this.bindAlipayId === item.payid){
this.bindAlipayId = 0 // this.bindAlipayId = 0
this.selectAlipay = null // this.selectAlipay = null
return true // return true
} // }
this.bindAlipayId = item.payid; // this.bindAlipayId = item.payid;
this.selectAlipay = item; this.selectAlipay = item;
}, },
goBindPay(type) { goBindPay(type) {
@ -1007,30 +1037,6 @@ export default {
this.hasVisitFee = response.data.has_visit_fee this.hasVisitFee = response.data.has_visit_fee
this.registerMoney = response.data.visit_price this.registerMoney = response.data.visit_price
// 1.2
// if (
// response.data &&
// response.data.paylist &&
// response.data.paylist[this.payTypeWeixin] &&
// response.data.paylist[this.payTypeWeixin].length > 0
// ) {
// this.wxpayList = response.data.paylist[this.payTypeWeixin]
// }
// if (
// response.data &&
// response.data.paylist &&
// response.data.paylist[this.payTypeAlipay] &&
// response.data.paylist[this.payTypeAlipay].length > 0
// ) {
// this.alipayList = response.data.paylist[this.payTypeAlipay]
// }
// 2.
// this.wxpayList = response.data.wxpay_list;//
// this.alipayList = response.data.alipayList;//
// this.selectWxpay = response.data.site_pays[this.payTypeWeixin];//
// this.selectAlipay = response.data.site_pays[this.payTypeAlipay];//
this.hasAgainVisitFreeDays = response.data.has_again_visit_free_days this.hasAgainVisitFreeDays = response.data.has_again_visit_free_days
this.againVisitFreeDays = response.data.again_visit_free_days this.againVisitFreeDays = response.data.again_visit_free_days
this.hasRemainVisitFree = response.data.has_remain_visit_free this.hasRemainVisitFree = response.data.has_remain_visit_free

33
src/views/weChatPayment.vue

@ -139,13 +139,13 @@ export default {
return { return {
formData1:{ formData1:{
// //
company_short_name: '', company_short_name: '城市1',
// //
mch_id: '', mch_id: '88888888',
// //
pkey: '', pkey: '88888qwerty',
// APPID // APPID
appid: '', appid: '13120474832',
}, },
rules: { rules: {
company_short_name: [ company_short_name: [
@ -153,7 +153,7 @@ export default {
], ],
appid: [ appid: [
{ required: true, message: '请输入公众号APPID', trigger: 'blur' }, { required: true, message: '请输入公众号APPID', trigger: 'blur' },
{ validator: notPureNumberRule, trigger: 'blur' } // { validator: notPureNumberRule, trigger: 'blur' }
], ],
mch_id: [ mch_id: [
{ required: true, message: '请输入微信支付商户号', trigger: 'blur' }, { required: true, message: '请输入微信支付商户号', trigger: 'blur' },
@ -207,7 +207,6 @@ export default {
this.noFileFlag = false; this.noFileFlag = false;
this.payInfo.apiclient_cert = fileObj; this.payInfo.apiclient_cert = fileObj;
this.formData.set('apiclient_cert', fileObj) this.formData.set('apiclient_cert', fileObj)
// this.uoload_apipem()
}, },
handleAvatarChange1(file, fileList) { handleAvatarChange1(file, fileList) {
console.log(file, fileList, 'file') console.log(file, fileList, 'file')
@ -216,28 +215,8 @@ export default {
this.payInfo.apiclient_key = fileObj; this.payInfo.apiclient_key = fileObj;
this.formData.set('apiclient_key', fileObj) this.formData.set('apiclient_key', fileObj)
}, },
//
// uoload_apipem(){
// // pay_id
// // const formData = new FormData();
// // formData.set('doctor_id', this.$route.query.doctor_id)
// // formData.set('depart_id', this.$route.query.depart_id)
// // formData.set('apiclient_cert',this.formData.apiclient_cert)
// this.$http('POST', '/api/admin/upload_wx_api_cert', this.formData).then(response => {
// if(response.code == 0){
// this.$message.success('');
// return true;
// }
// this.$message.error(response.msg);
// }).catch(error => {
// console.error(error, 'error')
// })
// },
saveConfirm() { saveConfirm() {
// pay_id
// - // -
// for (let [key, value] of this.formData.entries()) { // for (let [key, value] of this.formData.entries()) {
// console.log(' (Key):', key); // console.log(' (Key):', key);
@ -273,7 +252,7 @@ export default {
this.formData.set('doctor_id', this.$route.query.doctor_id) this.formData.set('doctor_id', this.$route.query.doctor_id)
this.formData.set('depart_id', this.$route.query.depart_id) this.formData.set('depart_id', this.$route.query.depart_id)
this.formData.set('type',this.payTypeWeixin)// 2 \ 3 this.formData.set('type',this.payTypeWeixin)// 2 \ 3
this.formData.set('is_pay_public','0') this.formData.set('pay_id','1')
const that = this; const that = this;
this.$http('POST', '/api/admin/set_pay_method', this.formData).then(response => { this.$http('POST', '/api/admin/set_pay_method', this.formData).then(response => {
if(response.code == 0){ if(response.code == 0){

Loading…
Cancel
Save