Browse Source

收款列表

pull/59/head
rainbro 6 days ago
parent
commit
ca8c8c64cd
  1. 126
      src/views/agent/payList.vue

126
src/views/agent/payList.vue

@ -20,7 +20,7 @@
<div>
<div class="flex-common table-wrap">
<el-form>
<GuipTable :border="true" :tableData="payList[3]" :loading="tableLoading">
<GuipTable :border="true" :tableData="payList[payTypeAlipay]" :loading="tableLoading">
<el-table-column prop="short_name" fixed="left" label="公司简称"></el-table-column>
<el-table-column prop="account" label="账号"></el-table-column>
<el-table-column prop="expires_time" label="有效期" min-width="30px"></el-table-column>
@ -64,7 +64,7 @@
<div>
<div class="flex-common table-wrap">
<el-form>
<GuipTable :border="true" :tableData="payList[2]" :loading="tableLoading">
<GuipTable :border="true" :tableData="payList[payTypeWeixin]" :loading="tableLoading">
<el-table-column prop="short_name" fixed="left" label="公司简称"></el-table-column>
<el-table-column prop="account" label="账号"></el-table-column>
<el-table-column prop="expires_time" label="有效期" min-width="30px"></el-table-column>
@ -108,7 +108,7 @@
<div>
<div class="flex-common table-wrap">
<el-form>
<GuipTable :border="true" :tableData="payList[0]" :loading="tableLoading">
<GuipTable :border="true" :tableData="payList[payTypeTaoBao]" :loading="tableLoading">
<el-table-column prop="short_name" fixed="left" label="公司简称"></el-table-column>
<el-table-column prop="account" label="账号"></el-table-column>
<el-table-column prop="expires_time" label="有效期" min-width="50px">
@ -150,7 +150,7 @@
<div>
<div class="flex-common table-wrap">
<el-form>
<GuipTable :border="true" :tableData="payList[11]" :loading="tableLoading">
<GuipTable :border="true" :tableData="payList[payTypePdd]" :loading="tableLoading">
<el-table-column prop="short_name" fixed="left" label="公司简称"></el-table-column>
<el-table-column prop="account" label="账号"></el-table-column>
<el-table-column prop="expires_time" label="有效期" min-width="50px">
@ -191,7 +191,7 @@
<div>
<div class="flex-common table-wrap">
<el-form>
<GuipTable :border="true" :tableData="payList[4]" :loading="tableLoading">
<GuipTable :border="true" :tableData="payList[payTypeJingdong]" :loading="tableLoading">
<el-table-column prop="short_name" fixed="left" label="公司简称"></el-table-column>
<el-table-column prop="account" label="账号"></el-table-column>
<el-table-column prop="expires_time" label="有效期" min-width="50px">
@ -228,7 +228,7 @@
<!-- 自定义内容 -->
<div>
<!-- 淘宝 -->
<div class="taobaopay" v-if="addPayType==0">
<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">
@ -240,7 +240,7 @@
</div>
</div>
<!-- 微信 -->
<div class="weixinpay" v-else-if="addPayType==2">
<div class="weixinpay" v-else-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>
@ -275,7 +275,7 @@
</el-form>
</div>
<!-- 支付宝 -->
<div class="alipay" v-if="addPayType==3">
<div class="alipay" v-if="addPayType==payTypeAlipay">
<el-tabs v-model="isPayPublic" @tab-click="handleClick">
<el-tab-pane label="我有公司,使用本公司支付宝" name="0">
<el-form>
@ -309,7 +309,7 @@
</el-tabs>
</div>
<!-- 拼多多 -->
<div class="alipay" v-if="addPayType==11">
<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>
@ -323,6 +323,14 @@
</GuipFormItem>
</el-form>
</div>
<!-- 京东 -->
<div class="jdpay" v-if="addPayType==payTypeJingdong">
<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>
</GuipDialog>
</div>
@ -331,61 +339,80 @@
import GuipButton from '@/components/GuipButton.vue';
import GuipFormItem from '@/components/GuipFormItem.vue';
import GuipInput from '@/components/GuipInput.vue';
// import GuipRadio from '@/components/GuipRadio.vue';
// import GuipSelect from '@/components/GuipSelect.vue';
import GuipSwitch from '@/components/GuipSwitch.vue';
import GuipDialog from '@/components/GuipDialog.vue';
// import PaymentMethod from '@/components/paymentMethod.vue';
// import DomainModal from '@/components/domainModal.vue';
// import CustomDropdown from '@/components/CustomDropdown.vue';
// import SvgIcon from '@/components/SvgIcon.vue';
import GuipTable from '@/components/GuipTable.vue';
// import GuipToolTip from '@/components/GuipToolTip.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 {
components: {
GuipButton,
GuipFormItem,
GuipInput,
// GuipRadio,
// GuipSelect,
// SvgIcon,
GuipSwitch,
GuipDialog,
// PaymentMethod,
// DomainModal,
// CustomDropdown,
GuipTable,
// GuipToolTip
},
data() {
return {
//
payTypeTaoBao: PAY_TYPE_TAOBAO,
payTypeWeixin: PAY_TYPE_WEIXIN,
payTypeAlipay: PAY_TYPE_ALIPAY,
payTypeJingdong: PAY_TYPE_JINGDONG,
payTypePdd: PAY_TYPE_PDD,
// AUTH
token: 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE3NTAwNTM3MjQsIm5iZiI6MTc1MDA1MzcyNCwiZXhwIjoxNzUyNjQ1NzI0LCJ1c2VyIjoic3VidXNlciIsImxvZ2luX3R5cGUiOjAsImFpZCI6IjEifQ.xyIqBLelB-k6jCifgRevBJTyg_Qrm6m1e4OcHhOpepU',
//
addablePays: [],
//
payList: [],
//
tableLoading: false,
//
addPayDialogVisible: false,
showCancelButton: true, //
showCloseButton: true, //
//
showCancelButton: true,
//
showCloseButton: true,
//
addPayTitle: '',
//
addPayType: '',
//
addPayconfirmText: '确定',
// url
taobaoAuthUrl: '',
//
company_short_name: '',
//
mch_id: '',
//
apiv2: '',
// APPID
appid: '',
//
alipay_account: '',
//
isExistSelfSupplys: false,
//
receive_payment_account: '',
//
receive_payment_name: '',
// 0 1
isPayPublic: '0',
// url
pddAuthUrl: '',
//
pdd_shop_name: '',
// url
jdAuthUrl: '',
}
},
computed: {
@ -408,9 +435,22 @@ export default {
this.tableLoading = false
this.$nextTick(() => {
this.addablePays = response.data
this.taobaoAuthUrl = response.data[0].authurl
this.isExistSelfSupplys = response.data[3].is_exist_self_supplys
this.pddAuthUrl = response.data[11].authurl
if(response.data[PAY_TYPE_TAOBAO]) {
this.taobaoAuthUrl = response.data[PAY_TYPE_TAOBAO].authurl
}
if (response.data[PAY_TYPE_ALIPAY]) {
this.isExistSelfSupplys = response.data[PAY_TYPE_ALIPAY].is_exist_self_supplys
}
if (response.data[PAY_TYPE_PDD]) {
this.pddAuthUrl = response.data[PAY_TYPE_PDD].authurl
}
if (response.data[PAY_TYPE_JINGDONG]) {
this.jdAuthUrl = response.data[PAY_TYPE_JINGDONG].authurl
}
})
}).catch(error => {
console.error(error, 'error')
@ -483,16 +523,16 @@ export default {
this.addPayDialogVisible = true;
this.addPayTitle = '添加' + type_desc;
this.addPayType = type;
if (type == 0) {
if (type == PAY_TYPE_TAOBAO || type == PAY_TYPE_JINGDONG) {
this.addPayconfirmText = '去授权';
}
},
//
addPayment() {
if (this.addPayType == 0) {
if (this.addPayType == PAY_TYPE_TAOBAO) {
window.open(this.taobaoAuthUrl, '_blank');
} else if (this.addPayType == 2) {
} 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,
@ -515,7 +555,7 @@ export default {
console.error(error, 'error')
})
} else if (this.addPayType == 3) {
} else if (this.addPayType == PAY_TYPE_ALIPAY) {
this.$http('POST', '/agentnew/ajax_add_alipay', {
company_short_name: this.company_short_name,
alipay_account: this.alipay_account,
@ -545,7 +585,7 @@ export default {
}).catch(error => {
console.error(error, 'error')
})
} else if (this.addPayType == 11) {
} else if (this.addPayType == PAY_TYPE_PDD) {
this.$http('POST', '/agentnew/ajax_add_pddpay', {
shop_name: this.pdd_shop_name,
}, {
@ -555,14 +595,9 @@ export default {
}).then(response => {
this.$nextTick(() => {
if (response.status) {
if (this.isPayPublic == 1) {
this.$Message.success(response.info);
this.getPayList();
this.receive_payment_account = ''
this.receive_payment_name = ''
} else {
window.open(response.data.authurl, '_blank');
}
this.$Message.success(response.info);
this.getPayList();
this.pdd_shop_name = ''
} else {
this.$Message.error(response.info);
@ -571,6 +606,8 @@ export default {
}).catch(error => {
console.error(error, 'error')
})
} else if (this.addPayType == PAY_TYPE_JINGDONG) {
window.open(this.jdAuthUrl, '_blank');
}
this.addPayDialogVisible = false;
@ -581,7 +618,6 @@ export default {
},
//
handleClose() {
this.$message.info('弹框已关闭');
this.addPayDialogVisible = false;
},
dialogVisibleChange(data) {

Loading…
Cancel
Save