diff --git a/src/components/SetAliPay.vue b/src/components/SetAliPay.vue new file mode 100644 index 0000000..1f21255 --- /dev/null +++ b/src/components/SetAliPay.vue @@ -0,0 +1,497 @@ + + + \ No newline at end of file diff --git a/src/components/addPay.vue b/src/components/addPay.vue index d04ea1b..58bb022 100644 --- a/src/components/addPay.vue +++ b/src/components/addPay.vue @@ -16,7 +16,7 @@

如未购买"快乐帮手"服务或已过期,会跳转到购买服务页面

- + @@ -165,6 +165,9 @@ export default { type: String, default: '' }, + checkAliPay:{ + type: Object, + } }, components: { @@ -180,7 +183,7 @@ export default { payTypeAlipay: PAY_TYPE_ALIPAY, payTypeJingdong: PAY_TYPE_JINGDONG, payTypePdd: PAY_TYPE_PDD, - + paytypeDesc: { payTypeTaoBao: '淘宝/天猫店铺', payTypeWeixin: '微信收款', @@ -195,15 +198,15 @@ export default { // 添加收款方式弹框 addPayDialogVisible: false, // 控制是否显示取消按钮 - showCancelButton: true, + showCancelButton: true, // 控制是否显示关闭按钮 - showCloseButton: true, + showCloseButton: true, // 添加收款方式弹框标题 addPayTitle: '', - + // 添加收款方式确认按钮文本 addPayconfirmText: '确定', - + // 公司简称 company_short_name: '', // 商户号 @@ -234,7 +237,6 @@ export default { { required: true, message: '请输入支付宝账号', trigger: 'blur' } ], } - // localSiteInfo: { ...this.siteInfo } } }, @@ -290,7 +292,7 @@ export default { addPayment() { if (this.addPayType == PAY_TYPE_TAOBAO) { window.open(this.taobaoAuthUrl, '_blank'); - + } else if (this.addPayType == PAY_TYPE_WEIXIN) { this.$http('POST', '/agentnew/ajax_add_weixinpay', { company_short_name: this.company_short_name, @@ -302,7 +304,7 @@ export default { if (response.status) { this.init(response.data); this.$Message.success(response.info); - + } else { this.$Message.error(response.info); } @@ -330,7 +332,7 @@ export default { if (response.code == 0) { if (!response.data.auth_url) { this.$Message.success(response.msg); - } else { + } else { window.open(response.data.auth_url, '_blank'); } } else { @@ -344,8 +346,8 @@ export default { } }); if (!falseFlag) return; - - } else if (this.addPayType == PAY_TYPE_PDD) { + + } else if (this.addPayType == PAY_TYPE_PDD) { this.$http('POST', '/agentnew/ajax_add_pddpay', { shop_name: this.pdd_shop_name, }).then(response => { @@ -360,7 +362,7 @@ export default { }).catch(error => { console.error(error, 'error') }) - } else if (this.addPayType == PAY_TYPE_JINGDONG) { + } else if (this.addPayType == PAY_TYPE_JINGDONG) { window.open(this.jdAuthUrl, '_blank'); } console.log('addPayment===走到这里了'); @@ -399,15 +401,22 @@ export default { }) } }, - },watch: { - visible(newVal) { - this.addPayDialogVisible = newVal; + }, + watch: { + visible(newVal) { + this.addPayDialogVisible = newVal; }, payType(newVal) { this.addPayType = newVal; this.updateDialogByPayType(); this.resetForm(); // 切换支付方式时重置表单 }, + checkAliPay(newVal){ + if(newVal){ + this.alipayInfo = {...newVal} + console.log(this.alipayInfo,'newVal=====newVal'); + } + } } } diff --git a/src/router/index.js b/src/router/index.js index e6161f5..cf728e4 100755 --- a/src/router/index.js +++ b/src/router/index.js @@ -78,16 +78,22 @@ const routes = [ } }, { - path: '/super/ranking', - component: () => import( /* webpackChunkName: "Ranking" */ '../views/super/Ranking/Ranking.vue'), - children: [ - { - path: 'checkProfit', - name: '产品毛利润排行', - component: () => import( /* webpackChunkName: "Ranking" */ '../views/super/Ranking/RankBatchList.vue'), - props: {pageTitle:'产品 - 毛利润排行', rank_type: 1, type: 'check_type'} - }, - ] + path: '/paymentMethod', + component: () => import( /* webpackChunkName: "paymentMethod" */ '../views/paymentMethod.vue'), + name: '收款方式', + meta: { + title: '收款管理', + hideBreadcrumb: true // 首页不显示面包屑 + } + }, + { + path: '/setPaymentForm', + name: '收款设置', + component: () => import('../views/setPaymentForm.vue'), + meta: { + title: '收款设置', + breadcrumbParent: '编辑医院' // 手动指定父级 + } }, ] diff --git a/src/views/HomeView.vue b/src/views/HomeView.vue index 8d9eebe..021f2d3 100644 --- a/src/views/HomeView.vue +++ b/src/views/HomeView.vue @@ -83,11 +83,13 @@ + + @@ -102,6 +104,7 @@ import GuipButton from '@/components/GuipButton.vue'; import GuipSwitch from '@/components/GuipSwitch.vue'; import GuipInput from '@/components/GuipInput.vue'; import { mapState } from 'vuex'; +import PaymentMethod from '@/views/paymentMethod.vue'; export default { data() { @@ -138,7 +141,9 @@ export default { isIndeterminate: false, doctorList: false, allChecked: false, - pageShow:false + pageShow:false, + doctorIds:[], + payList:[] } }, components: { @@ -148,6 +153,8 @@ export default { GuipButton, GuipSwitch, GuipTable, + PaymentMethod + // CustomDropdown }, created() { @@ -169,8 +176,8 @@ export default { }, 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) { @@ -182,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 } @@ -189,6 +204,17 @@ export default { console.error(error, 'error') }) }, + async getBindpayList(doctorIds) { + var payList = new Object(); + await this.$http('POST', '/api/admin/get_doctors_pay_list', { + doctor_ids: JSON.stringify(doctorIds) + }).then(response => { + payList = response.data; + this.payList = payList + }).catch(error => { + console.error(error, 'error') + }) + }, inputBlur(val) { console.log(val, ''); this.getInitData() @@ -340,20 +366,26 @@ export default { this.$message.error('操作失败'); }) }, + updatePayStatus(item) { + this.$http('POST', '/api/admin/update_pay_method_status', { + doctor_id:item.doctor_id, + pay_id:item.id, + status:item.status == '1' ? 1 : 0 + }).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: '医生信息', }) - // this.$router.push({ - // name: '医生信息', - // // query: { - // // doctorId: 123, - // // from: 'home' - // // } - // }) - - // 生成的URL:/doctorInformation?doctorId=123&from=home - }, addHospital(item) { this.$router.push({ diff --git a/src/views/HosInformation.vue b/src/views/HosInformation.vue index c3c639a..dfb4c44 100644 --- a/src/views/HosInformation.vue +++ b/src/views/HosInformation.vue @@ -184,8 +184,8 @@

需在微信商户平台-产品中心开通Native支付

- - 前往绑定 + + 前往添加
@@ -231,8 +231,8 @@

需在支付宝商户平台-产品中心开通Native支付

- - 前往绑定 + + 前往添加
@@ -496,8 +496,8 @@ - + + \ No newline at end of file diff --git a/src/views/setPaymentForm.vue b/src/views/setPaymentForm.vue new file mode 100644 index 0000000..b44c149 --- /dev/null +++ b/src/views/setPaymentForm.vue @@ -0,0 +1,439 @@ + + + + + \ No newline at end of file diff --git a/src/views/weChatPayment.vue b/src/views/weChatPayment.vue index 7c92312..4df96ce 100644 --- a/src/views/weChatPayment.vue +++ b/src/views/weChatPayment.vue @@ -157,10 +157,10 @@ export default { ], mch_id: [ { required: true, message: '请输入微信支付商户号', trigger: 'blur' }, - { - pattern: /^\d+$/, - message: '商户号必须为纯数字', - trigger: 'blur' + { + pattern: /^\d+$/, + message: '商户号必须为纯数字', + trigger: 'blur' } ], pkey: [ @@ -188,6 +188,7 @@ export default { // 初始化 this.formData.set('doctor_id', this.$route.query.doctor_id) this.formData.set('depart_id', this.$route.query.depart_id) + this.formData.set('pay_id', this.$route.query.pay_id) console.log('apiclient_cert' in this.payInfo,'apiclient_key'); }, methods: { @@ -215,7 +216,7 @@ export default { this.payInfo.apiclient_key = fileObj; this.formData.set('apiclient_key', fileObj) }, - + saveConfirm() { // 测试-查看有多少参数 // for (let [key, value] of this.formData.entries()) { @@ -242,7 +243,7 @@ export default { }) return false; } - + this.$refs.wxform.validate((valid) => { console.log(valid, 'valid'); if (valid) { @@ -251,7 +252,7 @@ export default { } this.formData.set('doctor_id', this.$route.query.doctor_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 支付宝 const that = this; this.$http('POST', '/api/admin/set_pay_method', this.formData).then(response => { if(response.code == 0){