Browse Source

Merge branch 'calender-1105' of gitea.intra.yunpaper.com:zhangqi/acupuncture_admin into calender-1105

pull/15/head
zq 4 weeks ago
parent
commit
209af06194
  1. 19
      package-lock.json
  2. 497
      src/components/SetAliPay.vue
  3. 41
      src/components/addPay.vue
  4. 26
      src/router/index.js
  5. 60
      src/views/HomeView.vue
  6. 64
      src/views/HosInformation.vue
  7. 194
      src/views/paymentMethod.vue
  8. 439
      src/views/setPaymentForm.vue
  9. 15
      src/views/weChatPayment.vue

19
package-lock.json

@ -94,6 +94,7 @@
"resolved": "https://registry.npmmirror.com/@babel/core/-/core-7.26.10.tgz",
"integrity": "sha512-vMqyb7XCDMPvJFFOaT9kxtiRh42GwlZEg1/uIgtZshS5a/8OaduUfCi7kynKgc3Tw/6Uo2D+db9qBttghhmxwQ==",
"dev": true,
"peer": true,
"dependencies": {
"@ampproject/remapping": "^2.2.0",
"@babel/code-frame": "^7.26.2",
@ -2816,6 +2817,7 @@
"resolved": "https://registry.npmmirror.com/@vue/cli-service/-/cli-service-5.0.8.tgz",
"integrity": "sha512-nV7tYQLe7YsTtzFrfOMIHc5N2hp5lHG2rpYr0aNja9rNljdgcPZLyQRb2YRivTHqTv7lI962UXFURcpStHgyFw==",
"dev": true,
"peer": true,
"dependencies": {
"@babel/helper-compilation-targets": "^7.12.16",
"@soda/friendly-errors-webpack-plugin": "^1.8.0",
@ -3313,6 +3315,7 @@
"resolved": "https://registry.npmmirror.com/acorn/-/acorn-8.14.1.tgz",
"integrity": "sha512-OvQ/2pUDKmgfCg++xsTX1wGxfTaszcHVcTctW4UJB4hibJx2HXxxO5UmVgyjMa+ZDsiaf5wWLXYpRWMmBI0QHg==",
"dev": true,
"peer": true,
"bin": {
"acorn": "bin/acorn"
},
@ -3355,6 +3358,7 @@
"resolved": "https://registry.npmmirror.com/ajv/-/ajv-6.12.6.tgz",
"integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==",
"dev": true,
"peer": true,
"dependencies": {
"fast-deep-equal": "^3.1.1",
"fast-json-stable-stringify": "^2.0.0",
@ -3642,6 +3646,7 @@
"resolved": "https://registry.npmmirror.com/ajv/-/ajv-8.17.1.tgz",
"integrity": "sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==",
"dev": true,
"peer": true,
"dependencies": {
"fast-deep-equal": "^3.1.3",
"fast-uri": "^3.0.1",
@ -4032,6 +4037,7 @@
"url": "https://github.com/sponsors/ai"
}
],
"peer": true,
"dependencies": {
"caniuse-lite": "^1.0.30001688",
"electron-to-chromium": "^1.5.73",
@ -4759,6 +4765,7 @@
"resolved": "https://registry.npmmirror.com/ajv/-/ajv-8.17.1.tgz",
"integrity": "sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==",
"dev": true,
"peer": true,
"dependencies": {
"fast-deep-equal": "^3.1.3",
"fast-uri": "^3.0.1",
@ -5597,6 +5604,7 @@
"integrity": "sha512-VHZ8gX+EDfz+97jGcgyGCyRia/dPOd6Xh9yPv8Bl1+SoaIwD+a/vlrOmGRUyOYu7MwUhc7CxqeaDZU13S4+EpA==",
"deprecated": "This version is no longer supported. Please see https://eslint.org/version-support for other options.",
"dev": true,
"peer": true,
"dependencies": {
"@babel/code-frame": "7.12.11",
"@eslint/eslintrc": "^0.4.3",
@ -5784,6 +5792,7 @@
"resolved": "https://registry.npmmirror.com/ajv/-/ajv-8.17.1.tgz",
"integrity": "sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==",
"dev": true,
"peer": true,
"dependencies": {
"fast-deep-equal": "^3.1.3",
"fast-uri": "^3.0.1",
@ -7997,6 +8006,7 @@
"resolved": "https://registry.npmmirror.com/ajv/-/ajv-8.17.1.tgz",
"integrity": "sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==",
"dev": true,
"peer": true,
"dependencies": {
"fast-deep-equal": "^3.1.3",
"fast-uri": "^3.0.1",
@ -8728,6 +8738,7 @@
"url": "https://github.com/sponsors/ai"
}
],
"peer": true,
"dependencies": {
"nanoid": "^3.3.8",
"picocolors": "^1.1.1",
@ -10775,6 +10786,7 @@
"resolved": "https://registry.npmmirror.com/ajv/-/ajv-8.17.1.tgz",
"integrity": "sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==",
"dev": true,
"peer": true,
"dependencies": {
"fast-deep-equal": "^3.1.3",
"fast-uri": "^3.0.1",
@ -11144,6 +11156,7 @@
"resolved": "https://registry.npmmirror.com/vue/-/vue-2.7.16.tgz",
"integrity": "sha512-4gCtFXaAA3zYZdTp5s4Hl2sozuySsgz4jy1EnpBHNfpMa9dK1ZCG7viqBPCwXtmgc8nHqUsAu3G4gtmXkkY3Sw==",
"deprecated": "Vue 2 has reached EOL and is no longer actively maintained. See https://v2.vuejs.org/eol/ for more details.",
"peer": true,
"dependencies": {
"@vue/compiler-sfc": "2.7.16",
"csstype": "^3.1.0"
@ -11379,6 +11392,7 @@
"resolved": "https://registry.npmmirror.com/vue-template-compiler/-/vue-template-compiler-2.7.16.tgz",
"integrity": "sha512-AYbUWAJHLGGQM7+cNTELw+KsOG9nl2CnSv467WobS5Cv9uk3wFcnr1Etsz2sEIHEZvw1U+o9mRlEO6QbZvUPGQ==",
"dev": true,
"peer": true,
"dependencies": {
"de-indent": "^1.0.2",
"he": "^1.2.0"
@ -11440,6 +11454,7 @@
"resolved": "https://registry.npmmirror.com/webpack/-/webpack-5.99.5.tgz",
"integrity": "sha512-q+vHBa6H9qwBLUlHL4Y7L0L1/LlyBKZtS9FHNCQmtayxjI5RKC9yD8gpvLeqGv5lCQp1Re04yi0MF40pf30Pvg==",
"dev": true,
"peer": true,
"dependencies": {
"@types/eslint-scope": "^3.7.7",
"@types/estree": "^1.0.6",
@ -11570,6 +11585,7 @@
"resolved": "https://registry.npmmirror.com/ajv/-/ajv-8.17.1.tgz",
"integrity": "sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==",
"dev": true,
"peer": true,
"dependencies": {
"fast-deep-equal": "^3.1.3",
"fast-uri": "^3.0.1",
@ -11682,6 +11698,7 @@
"resolved": "https://registry.npmmirror.com/ajv/-/ajv-8.17.1.tgz",
"integrity": "sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==",
"dev": true,
"peer": true,
"dependencies": {
"fast-deep-equal": "^3.1.3",
"fast-uri": "^3.0.1",
@ -11770,6 +11787,7 @@
"resolved": "https://registry.npmmirror.com/webpack-sources/-/webpack-sources-3.2.3.tgz",
"integrity": "sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w==",
"dev": true,
"peer": true,
"engines": {
"node": ">=10.13.0"
}
@ -11785,6 +11803,7 @@
"resolved": "https://registry.npmmirror.com/ajv/-/ajv-8.17.1.tgz",
"integrity": "sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==",
"dev": true,
"peer": true,
"dependencies": {
"fast-deep-equal": "^3.1.3",
"fast-uri": "^3.0.1",

497
src/components/SetAliPay.vue

@ -0,0 +1,497 @@
<template>
<div class="config-offline-wrap">
<el-form>
<GuipDialog :dialogVisible="addPayDialogVisible" :title="addPayTitle" :show-close-button="false"
:show-cancel-button="showCancelButton" @confirm="addPayment" @cancel="handleCancel"
@close="handleClose" @dialogVisibleChange="dialogVisibleChange" :confirmText="addPayconfirmText" width="599px">
<!-- 自定义内容 -->
<div>
<!-- 淘宝 -->
<div class="taobaopay" v-if="addPayType==payTypeTaoBao">
<div class="beforeNotice">
<h4 class="flex"> <img src="@/assets/site/siteSemInfo_Icon.svg" alt=""> 前期准备事项</h4>
<p class="mt12 flex">
请确保使用要添加的淘宝主账号登录并授权
</p>
<p class="mt10 flex">
如未购买快乐帮手服务或已过期会跳转到购买服务页面
</p>
</div>
</div>
<!-- 微信 -->
<div class="weixinpay" v-if="addPayType==payTypeWeixin">
<div class="beforeNotice">
<h4 class="flex"> <img src="@/assets/site/siteSemInfo_Icon.svg" alt=""> 前期准备事项</h4>
<p class="mt12">1.申请公司微信支付<a href="https://zhic.yuque.com/staff-chwecz/xhk8nt/ggkqm3" target="_blank"><img src="@/assets/site/form_qua_ic.svg" alt="">常见问题</a> </p>
<p class="mt12 flex">
2.前往<a href="https://pay.weixin.qq.com/"
class="flex" target="_blank">
<img src="@/assets/site/form_linkActive.svg" alt="">微信商户平台</a>
</p>
<p> 在产品中心开通Native支付如需使用微信版开通JSAPI支付</p>
</div>
<el-form>
<GuipFormItem column="column" class="mb24" label="1. 公司简称">
<span class="desc" slot="formRight">请输入公司简称便于您区分账号所属公司</span>
<GuipInput slot="formDom" ref="GuipInput" column="column" v-model="company_short_name" prop="company_short_name" placeholder="6字以内">
</GuipInput>
</GuipFormItem>
<GuipFormItem column="column" class="mb24" label="2. 支付商户号(mch_id)">
<span class="desc" slot="formRight"><a href='https://pay.weixin.qq.com/' target='_blank'>微信支付平台</a>账户中心商户信息微信支付商户号</span>
<GuipInput slot="formDom" ref="GuipInput" column="column" v-model="mch_id" prop="mch_id" placeholder="请输入商户号">
</GuipInput>
</GuipFormItem>
<GuipFormItem column="column" class="mb24" label="3. 微信支付秘钥">
<span class="desc" slot="formRight"><a href='https://pay.weixin.qq.com/' target='_blank'>微信支付平台</a>账号中心账户设置API安全APIv2密钥<p class="mt10">注意支付密钥不能设置为纯数字</p></span>
<GuipInput slot="formDom" ref="GuipInput" column="column" v-model="apiv2" prop="apiv2" placeholder="请输入微信支付秘钥">
</GuipInput>
</GuipFormItem>
<GuipFormItem column="column" class="mb24" label="4. 公众号APPID">
<span class="desc" slot="formRight"><a href='https://mp.weixin.qq.com/' target='_blank'>公众平台</a>设置与开发基本配置公众号开发信息开发者IDAPPID</span>
<GuipInput slot="formDom" ref="GuipInput" column="column" v-model="appid" prop="appid" placeholder="请输入公众号APPID">
</GuipInput>
</GuipFormItem>
</el-form>
</div>
<!-- 支付宝 -->
<div class="alipay" v-if="addPayType==payTypeAlipay">
<el-tabs v-model="isPayPublic" @tab-click="handleClick">
<!-- <el-tab-pane label="我有公司,使用本公司支付宝" name="0"> -->
<el-form ref="alipayForm" :model="alipayInfo" :rules="alipayRules">
<GuipFormItem column="column" class="mb24" label="1. 公司简称">
<span class="desc" slot="formRight">请输入公司简称便于您区分账号所属公司</span>
<GuipInput slot="formDom" ref="GuipInput" column="column" :maxlength="0" v-model="alipayInfo.company_short_name" prop="company_short_name" placeholder="6字以内"></GuipInput>
</GuipFormItem>
<GuipFormItem column="column" class="mb24" label="2. 公司支付宝账号">
<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>
<GuipInput slot="formDom" ref="GuipInput" column="column" v-model="alipayInfo.appid" prop="appid" placeholder="请输入公司支付宝账号"></GuipInput>
</GuipFormItem>
</el-form>
<!-- </el-tab-pane> -->
<!-- <el-tab-pane label="我无公司,申请平台代收款" name="1" v-if="isExistSelfSupplys===false">
<div class="beforeNotice">
<h4 class="flex"> <img src="@/assets/site/siteSemInfo_Icon.svg" alt=""> 须知</h4>
<p class="mt12">使用平台支付宝支付平台收取5%的服务费</p>
<p class="mt12 flex">使用平台支付宝支付真实姓名必须和支付宝账号实名认证姓名统一</p>
</div>
<el-form>
<GuipFormItem column="column" class="mb24" label="1. 收款人姓名">
<span class="desc" slot="formRight">请输入支付宝绑定的银行卡的持卡人姓名</span>
<GuipInput slot="formDom" ref="GuipInput" column="column" v-model="receive_payment_name" prop="company_short_name" placeholder="6字以内"></GuipInput>
</GuipFormItem>
<GuipFormItem column="column" class="mb24" label="2. 收款支付宝账号">
<span class="desc" slot="formRight">请输入有效账号</span>
<GuipInput slot="formDom" ref="GuipInput" column="column" v-model="receive_payment_account" prop="mch_id" placeholder="请输入有效收款支付宝账号"></GuipInput>
</GuipFormItem>
</el-form>
</el-tab-pane> -->
</el-tabs>
</div>
<!-- 拼多多 -->
<div class="pddpay" v-if="addPayType==payTypePdd">
<div class="beforeNotice">
<h4 class="flex"> <img src="@/assets/site/siteSemInfo_Icon.svg" alt=""> 前期准备事项</h4>
<p class="mt12 flex">主账号登录并授权<a :href="pddAuthUrl" class="flex" target="_blank"><img src="@/assets/site/form_linkActive.svg" alt="">去授权</a></p>
<p class="mt12 flex gray">如未购买快乐帮手服务或已过期会跳转到购买服务页面</p>
<p class="mt5 flex gray">授权成功后会进入快乐帮手烽火台复制右上角名称填入下方保存</p>
</div>
<el-form>
<GuipFormItem column="column" class="mb24" label="账号名称">
<!-- <span class="desc" slot="formRight">账号名称</span> -->
<GuipInput slot="formDom" ref="GuipInput" column="column" v-model="pdd_shop_name" prop="company_short_name" placeholder="请输入账号名称"></GuipInput>
</GuipFormItem>
</el-form>
</div>
</div>
</GuipDialog>
</el-form>
</div>
</template>
<script>
import GuipInput from '@/components/GuipInput.vue';
import GuipFormItem from '@/components/GuipFormItem.vue';
import GuipDialog from '@/components/GuipDialog.vue';
//
const PAY_TYPE_TAOBAO = 0; //
const PAY_TYPE_WEIXIN = 2; //
const PAY_TYPE_ALIPAY = 3; //
const PAY_TYPE_JINGDONG = 4; //
const PAY_TYPE_PDD = 11; //
export default {
//
name: 'addPay',
props: {
//
payType: {
type: [String, Number],
default: '-1',
// validator: value => ['success', 'warning', 'error', 'info'].includes(value)
},
//
visible: {
type: Boolean,
default: false
},
// url
taobaoAuthUrl: {
type: String,
default: ''
},
// url
pddAuthUrl: {
type: String,
default: ''
},
// url
jdAuthUrl: {
type: String,
default: ''
},
//
isExistSelfSupplys: {
type: Boolean,
default: false
},
depart_id:{
type: String,
default: ''
},
doctor_id:{
type: String,
default: ''
},
checkAliPay:{
type: Object,
}
},
components: {
GuipInput,
GuipFormItem,
GuipDialog,
},
data() {
return {
//
payTypeTaoBao: PAY_TYPE_TAOBAO,
payTypeWeixin: PAY_TYPE_WEIXIN,
payTypeAlipay: PAY_TYPE_ALIPAY,
payTypeJingdong: PAY_TYPE_JINGDONG,
payTypePdd: PAY_TYPE_PDD,
paytypeDesc: {
payTypeTaoBao: '淘宝/天猫店铺',
payTypeWeixin: '微信收款',
payTypeAlipay: '支付宝收款',
payTypeJingdong: '京东店铺',
payTypePdd: '拼多多店铺'
},
//
addPayType: 3,
//
addPayDialogVisible: false,
//
showCancelButton: true,
//
showCloseButton: true,
//
addPayTitle: '',
//
addPayconfirmText: '确定',
//
company_short_name: '',
//
mch_id: '',
//
apiv2: '',
// APPID
appid: '',
//
// alipay_account: '',
//
receive_payment_account: '',
//
receive_payment_name: '',
// 0 1
isPayPublic: '1',
//
pdd_shop_name: '',
alipayInfo:{
company_short_name: '',
appid:''
},
alipayRules:{
company_short_name: [
{ required: true, message: '请输入公司简称', trigger: 'blur' }
],
appid: [
{ required: true, message: '请输入支付宝账号', trigger: 'blur' }
],
}
// localSiteInfo: { ...this.siteInfo }
}
},
computed: {
// ...mapState(['pageTitle']) // VuexshowSidebar
},
mounted() {
// store.commit('SET_PAGETITLE', '广');
},
methods: {
updateDialogByPayType() {
if (this.addPayType > -1) {
//
let typeDesc = '';
// addPayType
for (let key in this.paytypeDesc) {
if (this[key] === this.addPayType) {
typeDesc = this.paytypeDesc[key];
break;
}
}
this.addPayTitle = '添加' + typeDesc;
//
if (this.addPayType === this.payTypeTaoBao || this.addPayType === this.payTypeJingdong) {
this.addPayconfirmText = '去授权';
} else {
this.addPayconfirmText = '确定';
}
}
},
resetForm() {
//
this.company_short_name = '';
this.mch_id = '';
this.apiv2 = '';
this.appid = '';
this.receive_payment_account = '';
this.receive_payment_name = '';
this.pdd_shop_name = '';
this.isPayPublic = '1'; //
},
// ---start
showAddPaymentMethodDialog(type, type_desc) {
console.log(type, 'type');
this.addPayDialogVisible = true;
this.addPayTitle = '添加' + type_desc;
this.addPayType = type;
if (type == PAY_TYPE_TAOBAO || type == PAY_TYPE_JINGDONG) {
this.addPayconfirmText = '去授权';
}
},
//
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,
mch_id: this.mch_id,
apiv2: this.apiv2,
appid: this.appid
}).then(response => {
this.$nextTick(() => {
if (response.status) {
this.init(response.data);
this.$Message.success(response.info);
} else {
this.$Message.error(response.info);
}
})
}).catch(error => {
console.error(error, 'error')
})
} else if (this.addPayType == PAY_TYPE_ALIPAY) { //
let falseFlag = false;
// console.log(this.doctor_id,this.depart_id,'depart_id');
this.$refs.alipayForm.validate((valid) => {
console.log(valid,'valid===');
if (valid) {
falseFlag = true;
this.$http('POST', '/api/admin/set_pay_method', {
doctor_id:this.doctor_id,
depart_id:this.depart_id,
type:this.payTypeAlipay,
company_short_name: this.alipayInfo.company_short_name,
appid: this.alipayInfo.appid,
// pay_id:1
// is_pay_public: this.isPayPublic,
}).then(response => {
if (response.code == 0) {
if (!response.data.auth_url) {
this.$Message.success(response.msg);
} else {
window.open(response.data.auth_url, '_blank');
}
} else {
this.$Message.error(response.msg);
}
}).catch(error => {
console.error(error, 'error')
})
} else {
return false;
}
});
if (!falseFlag) return;
} else if (this.addPayType == PAY_TYPE_PDD) {
this.$http('POST', '/agentnew/ajax_add_pddpay', {
shop_name: this.pdd_shop_name,
}).then(response => {
this.$nextTick(() => {
if (response.status) {
this.init(response.data);
this.$Message.success(response.info);
} else {
this.$Message.error(response.info);
}
})
}).catch(error => {
console.error(error, 'error')
})
} else if (this.addPayType == PAY_TYPE_JINGDONG) {
window.open(this.jdAuthUrl, '_blank');
}
console.log('addPayment===走到这里了');
this.init();
},
//
handleCancel() {
this.init();
},
//
handleClose() {
this.init();
},
dialogVisibleChange(data) {
console.log(data, 'data098908090');
},
handleClick(tab, event) {
console.log(tab, event);
},
init(payid) {
this.addPayDialogVisible = false;
this.$emit('update:visible', false);
this.resetForm(); //
if(payid){
this.$http('POST', '/agentnew/ajax_get_payinfo', {
payid: payid,
}).then(response => {
this.$nextTick(() => {
if (response.status) {
this.$emit('update:data', response.data);
}
})
}).catch(error => {
console.error(error, 'error')
})
}
},
},
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');
}
}
}
}
</script>
<style scoped lang="scss">
.beforeNotice {
h4 {
margin: 0;
gap: 8px;
}
margin-bottom: 18px;
text-align: left;
box-sizing: border-box;
padding: 20px 14px;
border-radius: 4px;
/* middle/middle_blue_1 */
background: #F2F7FF;
/* middle/middle_blue_3 */
border: 1px solid #BFDAFF;
div {
margin-top: 2px;
padding-left: 23px;
p {
color: #8A9099;
}
}
p {
color: #1E2226;
i {
font-style: normal;
}
&:last-child {
display: flex;
align-items: stretch;
b {
font-weight: normal;
color: #8A9099;
display: inline-flex;
img {
margin-left: 4px;
}
}
}
}
a {
text-decoration: none;
color: #006AFF;
margin-right: 10px;
img {
margin-left: 5px;
margin-right: 5px;
}
}
}
.guide{
display: flex;
align-items: center;
gap: 6px;
color: #8A9099 !important;
font-size: 12px;
}
a {
color: #006AFF;
text-decoration: none;
}
</style>

41
src/components/addPay.vue

@ -16,7 +16,7 @@
<p class="mt10 flex">
如未购买快乐帮手服务或已过期会跳转到购买服务页面
</p>
</div>
</div>
</div>
<!-- 微信 -->
@ -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');
}
}
}
}

26
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: '编辑医院' // 手动指定父级
}
},
]

60
src/views/HomeView.vue

@ -83,11 +83,13 @@
<el-table-column label="操作" fixed="right" min-width="120px">
<template slot-scope="scope">
<div class="flex">
<el-button type="text" @click="handleClick(scope.row)">编辑</el-button>
<el-button type="text" @click="handleClick(scope.row)">编辑{{item.doctor_id}}</el-button>
</div>
</template>
</el-table-column>
</GuipTable>
<PaymentMethod :list="payList[item.id] ? payList[item.id] : []" @updatePayStatus="updatePayStatus" :depart_id="item.id" :doctor_id="item.id"/>
</div>
</el-form>
</div>
@ -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({

64
src/views/HosInformation.vue

@ -176,8 +176,8 @@
<p>需在微信商户平台-产品中心开通Native支付</p>
</div>
<div class="right">
<GuipButton type="primary" size="medium" @click="goToWxPay">
前往绑定</GuipButton>
<GuipButton type="primary" size="medium" @click="goToAddPay(payTypeWeixin)">
前往添加</GuipButton>
</div>
</div>
</template>
@ -223,8 +223,8 @@
<p>需在支付宝商户平台-产品中心开通Native支付</p>
</div>
<div class="right">
<GuipButton type="primary" size="medium" @click="goBindPay(payTypeAlipay)">
前往绑定</GuipButton>
<GuipButton type="primary" size="medium" @click="goToAddPay(payTypeAlipay)">
前往添加</GuipButton>
</div>
</div>
</template>
@ -735,9 +735,8 @@
</el-form>
</GuipDialog>
<addPay :payType="addPayType" :visible="isShowAddPay" @update:visible="handleEvent"
@update:data="handleUpdateEvent" :isExistSelfSupplys="isExistSelfSupplys" :doctor_id="doctor_id"
:depart_id="depart_id"></addPay>
<SetAliPay payType="3" :visible="isShowAddAliPay" @update:visible="handleEvent" @update:data="handleUpdateEvent"
:isExistSelfSupplys="isExistSelfSupplys" :doctor_id="doctor_id" :depart_id="depart_id" :checkAliPay="checkAliPay"></SetAliPay>
</div>
</template>
<script>
@ -756,7 +755,8 @@ import GuipTable from '@/components/GuipTable.vue';
import GuipDialog from '@/components/GuipDialog.vue';
//import GuipSelectFilter from '@/components/GuipSelectFilter.vue';
import CustomDropdown from '@/components/CustomDropdown.vue';
import addPay from '@/components/addPay.vue';
import SetAliPay from '@/components/SetAliPay.vue';
import { mapState } from 'vuex';
import { Object } from 'core-js';
// const cityOptions = ['', '', '广', ''];
@ -767,7 +767,6 @@ export default {
//
name: '',
props: [''],
components: {
CustomDropdown,
GuipFormItem,
@ -780,8 +779,8 @@ export default {
GuipSelect,
GuipTextarea,
GroupFormBtns,
addPay,
PromptText
SetAliPay,
PromptText,
},
data() {
return {
@ -846,7 +845,7 @@ export default {
houseCallSettingForm: {
worktimes: null,
display_work_days: 0,//
worktime_no_fixed: 0,//
worktime_no_fixed: 0,//
planDays: 30,
},
options_province: [],
@ -938,6 +937,8 @@ export default {
payTypeAlipay: PAY_TYPE_ALIPAY,
selectWxpay: null,
selectAlipay: null,
isShowAddAliPay:false,
checkAliPay:null,
onLinePay: null,
addPayType: -1,
isShowAddPay: false,
@ -1212,6 +1213,21 @@ export default {
// console.log(selectedNames, 'getSelectedNames--selectedNames');
return selectedNames.join('、') || '休息';
},
handleEvent(data) {
this.isShowAddAliPay = data;
},
handleUpdateEvent(data){
this.bindAlipayId = data.payid;
this.selectAlipay = data;
},
goToAddPay(pay_type){
if(pay_type == this.payTypeWeixin) {
this.$router.push(`/setPaymentForm?doctor_id=${this.doctor_id}&depart_id=${this.depart_id}`);
return
}
this.isShowAddAliPay = true;
},
toggleAfternoonDropdown() {
// console.log('----09999', this.afternoonSelectedHospitals);
if (this.isAfternoonDropdownOpen) {
@ -2816,12 +2832,6 @@ export default {
return this.hospitalColorMap[hid] || '#CCCCCC';
},
// goToWxPay(){
// this.$router.push(`/weChatPayment?doctor_id=${this.doctor_id}&depart_id=${this.depart_id}`);
// },
goToAddPay() {
this.$router.push(`/paymentMethod?doctor_id=${this.doctor_id}&depart_id=${this.depart_id}`);
},
showDialog(type) {
if (type == 'register') {
this.registrationVisible = true;
@ -2837,7 +2847,7 @@ export default {
if (
response.data &&
response.data[this.payTypeWeixin]
&& response.data[this.payTypeWeixin].length > 0
&&response.data[this.payTypeWeixin].length > 0
) {
this.wxpayList = response.data[this.payTypeWeixin]
this.selectWxpay = this.wxpayList.filter(item => item.is_bind)[0];
@ -2922,7 +2932,6 @@ export default {
this.selectAlipay = item;
this.bindPayMethod(item.id)
},
async bindPayMethod(id) {
await this.$http('POST', '/api/admin/bind_pay_method', {
pay_id: id,
@ -2932,7 +2941,6 @@ export default {
const { code } = response;
if (code == 0) {
this.$Message.success(response.msg || '绑定成功');
} else {
this.$Message.error(response.msg || '绑定失败');
}
@ -2946,16 +2954,6 @@ export default {
this.addPayType = type;
this.isShowAddPay = true;
},
handleUpdateEvent(data) {
if (data.type == this.payTypeWeixin) {
this.bindWxpayId = data.payid
this.selectWxpay = data
}
if (data.type == this.payTypeAlipay) {
this.bindAlipayId = data.payid
this.selectAlipay = data
}
},
handleregisterCancel() {
console.log('取消');
this.freeRegVisible = false;
@ -3020,10 +3018,6 @@ export default {
})
}
},
handleEvent(data) {
this.isShowAddPay = data
},
handleSearch() {
if (this.hospitalSearchFlag) return
this.hospitalSearchFlag = true

194
src/views/paymentMethod.vue

@ -0,0 +1,194 @@
<template>
<div :class="[list && list.length > 0 ?'mt32':'pagePadding']">
<div :class="[list && list.length > 0 ? '' : 'flex-common']">
<div class="pageheader flex-between mb32">
<p class="littleTitle ">收款方式</p>
<div class="button-group flex">
<GuipButton @click="goToWxPay" type="system" :btnstyle="{ width: '130px', height: '33px' }">增加微信收款</GuipButton>
<GuipButton @click="goBindPay" type="system" :btnstyle="{ width: '130px', height: '33px' }">增加支付宝收款</GuipButton>
</div>
</div>
<el-form>
<GuipTable :tableData="payList" :loading="tableLoading">
<el-table-column prop="type" fixed="left" label="类型" width="140">
<template slot-scope="scope">
<div class="flex gap10">
<img v-show="scope.row.type == 2" class="pay_type_img" src="@/assets/weixin.svg" alt="">
<img v-show="scope.row.type == 3" class="pay_type_img" src="@/assets/zhifubao.svg" alt="">
{{ scope.row.type_desc }}
</div>
</template>
</el-table-column>
<el-table-column prop="company_short_name" label="公司简称" min-width="160px"></el-table-column>
<el-table-column prop="appid" label="账号" min-width="288px"></el-table-column>
<el-table-column prop="expires_time_desc" label="有效期" min-width="260px"></el-table-column>
<el-table-column prop="status" label="上传证书" min-width="258px">
<template slot-scope="scope">
<div :class="'flex'+(scope.row.have_cert?'':' error')" v-if="scope.row.type == 2">
{{ scope.row.have_cert ? '已上传' : '未上传' }}
</div>
</template>
</el-table-column>
<el-table-column prop="status" label="启用状态" min-width="130px">
<template slot-scope="scope">
<div class="flex">
<GuipSwitch v-model="scope.row.status" active-value="1" inactive-value="0"
@change="updatePayStatus(scope.row)"></GuipSwitch>
</div>
</template>
</el-table-column>
<el-table-column label="操作" min-width="130px" fixed="right">
<template slot-scope="scope">
<div class="flex">
<el-button @click="paySetting(scope.row, scope.row.type)" type="text">修改</el-button>
</div>
</template>
</el-table-column>
</GuipTable>
</el-form>
<addPay :payType="addPayType" :visible="isShowAddPay" @update:visible="handleEvent" @update:data="handleUpdateEvent"
:isExistSelfSupplys="isExistSelfSupplys" :doctor_id="doctor_id" :depart_id="depart_id" :checkAliPay="checkAliPay"></addPay>
</div>
</div>
</template>
<script>
import GuipTable from '@/components/GuipTable.vue';
import GuipSwitch from '@/components/GuipSwitch.vue';
import GuipButton from '@/components/GuipButton.vue';
import addPay from '@/components/addPay.vue';
const PAY_TYPE_TAOBAO = 0; //
const PAY_TYPE_WEIXIN = 2; //
const PAY_TYPE_ALIPAY = 3; //
const PAY_TYPE_JINGDONG = 4; //
const PAY_TYPE_PDD = 11; //
export default {
props:['doctor_id','depart_id','list'],
data() {
return {
//
payTypeTaoBao: PAY_TYPE_TAOBAO,
payTypeWeixin: PAY_TYPE_WEIXIN,
payTypeAlipay: PAY_TYPE_ALIPAY,
payTypeJingdong: PAY_TYPE_JINGDONG,
payTypePdd: PAY_TYPE_PDD,
payList: [
// {
// company_short_name:'',
// type:2,
// appid:'29384923',
// mch_id:'98329032wer',
// pkey:'6634452qwjbj'
// },
// {
// company_short_name:'',
// type:3,
// appid:'0948032849023'
// },
],
tableLoading: true,
doctorId:'',
departId:'',
isShowAddPay: false,
addPayType: -1,
isExistSelfSupplys: false,
checkAliPay:null
};
},
components: {
GuipTable,
GuipSwitch,
GuipButton,
addPay,
},
watch:{
list: {
deep: true,
handler(newVal) {
console.log(newVal,'newVal=====');
this.payList = [...newVal];
this.tableLoading = false;
}
}
},
created(){
const {doctor_id,depart_id } = this.$route.query;
if(depart_id && doctor_id){
this.departId =depart_id;
this.doctorId =doctor_id;
}
console.log(this.doctor_id,'=doctor_id===');
},
mounted() {
if(this.doctor_id){
this.getBindpayList()
}
},
methods: {
async getBindpayList() {
await this.$http('POST', '/api/admin/get_pay_list', {
doctor_id: this.doctor_id,
depart_id: this.depart_id
}).then(response => {
this.payList = response.data;
}).catch(error => {
console.error(error, 'error')
})
},
handleEvent(data) {
this.isShowAddPay = data;
},
handleUpdateEvent(data){
if (data.type == this.payTypeWeixin) {
this.bindWxpayId = data.payid;
this.selectWxpay = data;
}
if (data.type == this.payTypeAlipay) {
this.bindAlipayId = data.payid;
this.selectAlipay = data;
}
},
paySetting(row, payType) {
if(payType == 3){
this.checkAliPay = {...row}
this.goBindPay()
}else{
this.goToWxPay(this.doctor_id,row.id)
}
},
updatePayStatus(row) {
this.$emit('updatePayStatus', row)
},
goToWxPay(doctor_id, pay_id){
if(!doctor_id) doctor_id = this.doctor_id;
var urlpath = `/setPaymentForm?doctor_id=${doctor_id}`;
if(pay_id) urlpath += `&pay_id=${pay_id}`;
this.$router.push(urlpath);
},
goBindPay() {
this.addPayType = this.payTypeAlipay;
this.isShowAddPay = true;
},
},
};
</script>
<style lang="scss" scoped>
.pay_type_img{
width: 16px;
height: 16px;
}
.error{
color: #FD3B3B;
}
.pageheader{
}
</style>

439
src/views/setPaymentForm.vue

@ -0,0 +1,439 @@
<template>
<div class="site-setting-wrap pagePadding">
<div class="siteMessage flex-common" id="siteMessage1">
<p class="littleTitle mb32">微信收款</p>
<div class="weixinpay">
<div class="beforeNotice">
<h4 class="flex"> <img src="@/assets/site/siteSemInfo_Icon.svg" alt=""> 前期准备事项</h4>
<div class="flex-between">
<p class="mt12 flex">1.申请公司微信支付<a class="guide" href="https://zhic.yuque.com/staff-chwecz/xhk8nt/ggkqm3"
target="_blank"><img src="@/assets/site/form_qua_ic.svg" alt="">指南</a> </p>
<span class=" flex">
<a href="https://pay.weixin.qq.com/" class="flex" target="_blank">
<img src="@/assets/site/form_linkActive.svg" alt="">微信商户平台</a>
</span>
</div>
<p class="mt12">2.登录微信商户平台在产品中心开通Native支付如需使用微信版开通JSAPI支付</p>
</div>
<el-form ref="wxform" :model="formData1" :rules="rules">
<div class="flex-wrap">
<div class="flex-left">
<GuipFormItem column="column" class="mb24" label="公司简称" :required="true">
<span class="desc" slot="formRight">请输入公司简称便于您区分账号所属公司</span>
<GuipInput slot="formDom" ref="GuipInput" column="column" v-model="formData1.company_short_name"
prop="company_short_name" placeholder="请输入">
</GuipInput>
</GuipFormItem>
<GuipFormItem column="column" class="mb24" label="微信支付商户号" :required="true">
<span class="desc" slot="formRight">
<a href='https://pay.weixin.qq.com/' class="guide"
target='_blank'><img src="@/assets/site/form_qua_ic.svg" alt="">指南</a>
</span>
<GuipInput slot="formDom" ref="GuipInput" column="column" v-model="formData1.mch_id" prop="mch_id"
placeholder="请输入">
</GuipInput>
</GuipFormItem>
</div>
<div class="flex-line"></div>
<div class="flex-right">
<GuipFormItem column="column" class="mb24" label="微信支付秘钥" :required="true">
<span class="desc" slot="formRight"><a href='https://pay.weixin.qq.com/' class="guide"
target='_blank'><img src="@/assets/site/form_qua_ic.svg" alt="">指南</a>
</span>
<GuipInput slot="formDom" ref="GuipInput" column="column" v-model="formData1.pkey" prop="pkey"
placeholder="不能设为纯数字">
</GuipInput>
</GuipFormItem>
<GuipFormItem column="column" class="mb24" label="公众号APPID" :required="true">
<span class="desc" slot="formRight"><a href='https://mp.weixin.qq.com/' class="guide"
target='_blank'><img src="@/assets/site/form_qua_ic.svg" alt="">指南</a></span>
<GuipInput slot="formDom" ref="GuipInput" column="column" v-model="formData1.appid" prop="appid"
placeholder="不能设为纯数字">
</GuipInput>
</GuipFormItem>
</div>
</div>
</el-form>
</div>
</div>
<div class="siteMessage flex-common mt12" id="siteMessage2">
<h3 class="mb12">管理证书</h3>
<div class="beforeNotice">
<span class="flex"> <img src="@/assets/site/siteSemInfo_Icon.svg" alt="" style="margin-right: 5px;">
API证书获取
<a href="https://pay.weixin.qq.com/" class="flex" target="_blank"><img style="margin-right: 5px;"
src="@/assets/site/form_linkActive.svg" alt="">微信商户平台</a>账户中心账户设置API安全
</span>
</div>
<el-form>
<div class="flex-wrap">
<div class="flex-left">
<div class="uploadwrap">
<label class="flex upload-title gap8">上传 apiclient_cert.pem 证书<img class="ml-4"
src="@/assets/require.svg" /></label>
<el-upload class="upload-demo" :file-list="fileList" :on-change="handleAvatarChange" :on-remove="handRemove" action="#" :multiple="false"
:limit="Number(1)" ref="avatorUpload" :auto-upload="false">
<GuipButton class="upload-button" slot="trigger" type="ignore"
:btnstyle="{ width: '118px' }">
<i class="bgImg"></i>{{formData1.hava_apiclient_cert?'重新上传':'选择文件'}}
</GuipButton>
</el-upload>
<!-- <p class="uploaded" v-if="formData.apiclient_cert">已上传</p> -->
<!-- <p :class="['normalUpload', noFileFlag ?'notuploaded' :'']" v-if="!('apiclient_cert' in payInfo)">未上传任何文件</p> -->
</div>
</div>
<div class="flex-line"></div>
<div class="flex-right">
<div class="uploadwrap">
<label class="flex upload-title gap8">上传 apiclient_key.pem 证书<img class="ml-4"
src="@/assets/require.svg" /></label>
<el-upload class="upload-demo" :file-list="fileList1" :on-change="handleAvatarChange1" :on-remove="handRemove1" action="#" :multiple="false"
:limit="Number(1)" ref="avatorUpload" :auto-upload="false">
<GuipButton class="upload-button" slot="trigger" type="ignore"
:btnstyle="{ width: '118px' }">
<i class="bgImg"></i>{{formData1.hava_apiclient_key?'重新上传':'选择文件'}}
</GuipButton>
</el-upload>
<!-- <p class="uploaded" v-if="formData.apiclient_key">已上传</p> -->
<!-- <p :class="['normalUpload', noFileFlag1 ?'notuploaded' :'']" v-if="!('apiclient_key' in payInfo)">未上传任何文件</p> -->
</div>
</div>
</div>
</el-form>
</div>
<div class="save-button">
<GuipButton type="primary" ref="saveRef" :btnstyle="saveBtnStyleObj" @click="saveConfirm">完成设置</GuipButton>
</div>
</div>
</template>
<script>
import GuipInput from '@/components/GuipInput.vue';
import GuipButton from '@/components/GuipButton.vue';
import GuipFormItem from '@/components/GuipFormItem.vue';
const PAY_TYPE_WEIXIN = 2; //
const PAY_TYPE_ALIPAY = 3; //
export default {
//
name: 'addPay',
props: {},
components: {
GuipInput,
GuipButton,
GuipFormItem,
},
data() {
const notPureNumberRule = (rule, value, callback) => {
if (!value) {
callback(new Error('该字段为必填项'));
} else if (/^\d+$/.test(value)) {
callback(new Error('不能设为纯数字'));
} else {
callback();
}
};
return {
formData1:{
//
company_short_name: '',
//
mch_id: '',
//
pkey: '',
// APPID
appid: '',
},
rules: {
company_short_name: [
{ required: true, message: '请输入公司简称', trigger: 'blur' }
],
appid: [
{ required: true, message: '请输入公众号APPID', trigger: 'blur' },
// { validator: notPureNumberRule, trigger: 'blur' }
],
mch_id: [
{ required: true, message: '请输入微信支付商户号', trigger: 'blur' },
{
pattern: /^\d+$/,
message: '商户号必须为纯数字',
trigger: 'blur'
}
],
pkey: [
{ required: true, message: '请输入微信支付秘钥', trigger: 'blur' },
{ validator: notPureNumberRule, trigger: 'blur' }
],
},
formData: new FormData(),
payInfo:{},
saveBtnStyleObj: {
width: '144px',
height: '46px',
borderRadius: '4px',
background: '#006AFF',
},
fileList: [],
fileList1: [],
noFileFlag: false,
noFileFlag1: false,
payTypeWeixin: PAY_TYPE_WEIXIN,
payTypeAlipay: PAY_TYPE_ALIPAY,
pay_id:false,
}
},
created() {
//
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)
if(this.$route.query.pay_id) this.pay_id = this.$route.query.pay_id
},
mounted() {
this.initData()
},
methods: {
initData() {
if(!this.$route.query.pay_id) return
this.$http('POST', '/api/admin/get_pay_method', this.formData).then(response => {
if(response.code == 0){
var rdata = response.data
this.formData1.company_short_name = rdata.company_short_name
this.formData1.mch_id = rdata.mch_id
this.formData1.pkey = rdata.token
this.formData1.appid = rdata.appid
if(rdata.hava_apiclient_cert) this.formData1.hava_apiclient_cert = rdata.hava_apiclient_cert
if(rdata.hava_apiclient_key) this.formData1.hava_apiclient_key = rdata.hava_apiclient_key
return
}
this.$message.error(response.msg);
}).catch(error => {
console.error(error, 'error')
})
},
handRemove() {
this.formData.delete('apiclient_cert');
this.payInfo.delete('apiclient_cert');
this.noFileFlag = true;
},
handRemove1() {
this.formData.delete('apiclient_key');
this.payInfo.delete('apiclient_key');
this.noFileFlag1 = true;
},
handleAvatarChange(file, fileList) {
console.log(file, fileList, 'file')
let fileObj = file.raw
this.noFileFlag = false;
this.payInfo.apiclient_cert = fileObj;
this.formData.set('apiclient_cert', fileObj)
},
handleAvatarChange1(file, fileList) {
console.log(file, fileList, 'file')
let fileObj = file.raw;
this.noFileFlag1 = false;
this.payInfo.apiclient_key = fileObj;
this.formData.set('apiclient_key', fileObj)
},
saveConfirm() {
// -
// for (let [key, value] of this.formData.entries()) {
// console.log(' (Key):', key);
// console.log(' (Value):', value);
// }
if(!this.formData.has('apiclient_key') && !this.pay_id){
this.noFileFlag1 = true;
if( !this.formData.has('apiclient_cert')){
this.noFileFlag = true;
this.$positionMessage({
type: 'error',
message: '请先上传证书',
target: this.$refs['saveRef'], // DOM
position: 'top'
})
return false;
}
this.$positionMessage({
type: 'error',
message: '请先上传证书',
target: this.$refs['saveRef'], // DOM
position: 'top'
})
return false;
}
this.$refs.wxform.validate((valid) => {
console.log(valid, 'valid');
if (valid) {
for (let key in this.formData1) {
this.formData.set(key, this.formData1[key])
}
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
const that = this;
this.$http('POST', '/api/admin/set_pay_method', this.formData).then(response => {
if(response.code == 0){
that.$message.success('保存成功');
this.$router.go(-1);
return true;
}
that.$message.error(response.msg);
}).catch(error => {
console.error(error, 'error')
})
} else {
return false;
}
})
},
}
}
</script>
<style scoped lang="scss">
.guide{
display: flex;
align-items: center;
gap: 6px;
color: #8A9099 !important;
font-size: 12px;
}
.site-setting-wrap{
height: calc(100% - 80px);
overflow-y: auto;
}
.notuploaded,.uploaded,.normalUpload{
margin-top: 8px;
font-size: 12px;
color: #606266;
}
.normalUpload{
color:#606266;
}
.notuploaded{
color: #FD3B3B;
}
.save-button {
position: fixed;
left: 0;
bottom: 0;
width: 100%;
background: #fff;
box-shadow: 0 4px 16px 0 rgba(17, 55, 143, 0.12);
display: flex;
align-items: center;
justify-content: center;
padding: 16px 0;
z-index: 9;
}
.uploadwrap {
text-align: left;
}
.upload-title {
font-size: 14px;
font-weight: normal;
line-height: normal;
letter-spacing: 0.08em;
color: #23242B;
}
.upload-button {
border-radius: 4px;
background: #F2F3F5;
box-sizing: border-box;
border: 1px solid #BABDC2;
.bgImg {
width: 20px;
height: 16px;
margin-right: 6px;
background-image: url(@/assets/site/uploadIcon.svg);
}
&:hover {
.bgImg {
background-image: url(@/assets/site/uploadIcon_light.svg);
}
}
}
.upload-demo {
margin-top: 12px;
}
.beforeNotice {
h4 {
margin: 0;
gap: 8px;
}
margin-bottom: 18px;
text-align: left;
box-sizing: border-box;
padding: 20px 14px;
border-radius: 4px;
/* middle/middle_blue_1 */
background: #F2F7FF;
/* middle/middle_blue_3 */
border: 1px solid #BFDAFF;
div {
// margin-top: 2px;
// padding-left: 23px;
p {
// color: #8A9099;
}
}
p {
color: #1E2226;
i {
font-style: normal;
}
&:last-child {
display: flex;
align-items: stretch;
b {
font-weight: normal;
color: #8A9099;
display: inline-flex;
img {
margin-left: 4px;
}
}
}
}
a {
text-decoration: none;
color: #006AFF;
margin-right: 10px;
img {
margin-left: 5px;
margin-right: 5px;
}
}
}
a {
color: #006AFF;
text-decoration: none;
}
</style>

15
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){

Loading…
Cancel
Save