Browse Source

增加收款管理页面

paymentMethod-11-10
zq 1 month ago
parent
commit
dee4ddcd6a
  1. 15
      src/components/addPay.vue
  2. 17
      src/router/index.js
  3. 21
      src/views/HomeView.vue
  4. 43
      src/views/HosInformation.vue
  5. 209
      src/views/paymentMethod.vue

15
src/components/addPay.vue

@ -145,7 +145,7 @@ export default {
// url
pddAuthUrl: {
type: String,
default: ''
default: ''
},
// url
jdAuthUrl: {
@ -165,6 +165,9 @@ export default {
type: String,
default: ''
},
checkAliPay:{
type: Object,
}
},
components: {
@ -234,7 +237,6 @@ export default {
{ required: true, message: '请输入支付宝账号', trigger: 'blur' }
],
}
// localSiteInfo: { ...this.siteInfo }
}
},
@ -399,7 +401,8 @@ export default {
})
}
},
},watch: {
},
watch: {
visible(newVal) {
this.addPayDialogVisible = newVal;
},
@ -408,6 +411,12 @@ export default {
this.updateDialogByPayType();
this.resetForm(); //
},
checkAliPay(newVal){
if(newVal){
this.alipayInfo = {...newVal}
console.log(this.alipayInfo,'newVal=====newVal');
}
}
}
}

17
src/router/index.js

@ -78,16 +78,13 @@ 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 // 首页不显示面包屑
}
},
]

21
src/views/HomeView.vue

@ -88,6 +88,9 @@
</template>
</el-table-column>
</GuipTable>
<PaymentMethod :list="payList"/>
</div>
</el-form>
</div>
@ -102,6 +105,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 +142,8 @@ export default {
isIndeterminate: false,
doctorList: false,
allChecked: false,
pageShow:false
pageShow:false,
payList:[]
}
},
components: {
@ -148,6 +153,8 @@ export default {
GuipButton,
GuipSwitch,
GuipTable,
PaymentMethod
// CustomDropdown
},
created() {
@ -163,6 +170,7 @@ export default {
store.commit('SET_CUSTOMIZE', false);
store.commit('SET_SLIDER_MENU', 'menuData');
this.getInitData()
this.getBindpayList()
},
computed: {
...mapState(['menuData']) // VuexshowSidebar
@ -189,6 +197,17 @@ export default {
console.error(error, 'error')
})
},
async getBindpayList() {
await this.$http('POST', '/api/admin/get_pay_list', {
doctor_id: 3,
depart_id: 4
}).then(response => {
this.payList.push(...response.data[2],...response.data[3])
console.log(this.payList,response,'this.payList====00000');
}).catch(error => {
console.error(error, 'error')
})
},
inputBlur(val) {
console.log(val, '');
this.getInitData()

43
src/views/HosInformation.vue

@ -184,8 +184,8 @@
<p>需在微信商户平台-产品中心开通Native支付</p>
</div>
<div class="right">
<GuipButton type="primary" size="medium" @click="goToWxPay">
前往绑定</GuipButton>
<GuipButton type="primary" size="medium" @click="goToAddPay">
前往添加</GuipButton>
</div>
</div>
</template>
@ -231,8 +231,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>
@ -496,8 +496,7 @@
</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>
</div>
</template>
<script>
@ -514,7 +513,6 @@ 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 { mapState } from 'vuex';
import { Object } from 'core-js';
const PAY_TYPE_WEIXIN = 2; //
@ -523,7 +521,6 @@ export default {
//
name: '',
props: [''],
components: {
CustomDropdown,
GuipFormItem,
@ -536,7 +533,6 @@ export default {
GuipSelect,
GuipTextarea,
GroupFormBtns,
addPay,
},
data() {
return {
@ -685,9 +681,6 @@ export default {
selectWxpay:null,
selectAlipay: null,
onLinePay:null,
addPayType: -1,
isShowAddPay: false,
isExistSelfSupplys: false,
payinfo: [],
registerMoney:'',//
registerDays:5,
@ -744,8 +737,11 @@ export default {
...mapState(['hosMenuData']) // VuexshowSidebar
},
methods: {
goToWxPay(){
this.$router.push(`/weChatPayment?doctor_id=${this.doctor_id}&depart_id=${this.depart_id}`);
// 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') {
@ -867,20 +863,7 @@ export default {
console.error(error, 'error')
})
},
goBindPay(type) {
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;
@ -945,9 +928,7 @@ export default {
})
}
},
handleEvent(data) {
this.isShowAddPay = data
},
handleSearch() {
if (this.hospitalSearchFlag) return
this.hospitalSearchFlag = true

209
src/views/paymentMethod.vue

@ -0,0 +1,209 @@
<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" label="有效期" min-width="260px"></el-table-column>
<el-table-column prop="status" label="证书状态" min-width="258px">
<template slot-scope="scope">
<div class="flex error">
{{ scope.row.status_desc }}
</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(row.doctor_id,row.depart_id)
}
},
updatePayStatus(row) {
console.log(row);
// var payid = row.payid
// this.$http('POST', '/agentnew/ajax_update_pay_status', {
// payid: row.payid,
// status: row.status,
// doctor_id: this.doctor_id,
// depart_id: this.depart_id
// }).then(response => {
// this.$nextTick(() => {
// if (response.status) {
// this.$Message.success(response.info);
// this.closePayTipDialogVisible = false;
// this.getPayList()
// } else {
// this.$Message.error(response.info);
// }
// })
// }).catch(error => {
// console.error(error, 'error')
// })
},
goToWxPay(doctor_id,depart_id){
this.$router.push(`/weChatPayment?doctor_id=${doctor_id}&depart_id=${depart_id}`);
},
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>
Loading…
Cancel
Save