Commit 802bd451 by 张立顺

fix 功能开发

1 parent 2868d746
......@@ -382,10 +382,16 @@ export function get4sAndServiceMerchantListApi(data) {
}
/**
*
* 获取车品牌列表
*/
export function getCarBrandList (data = {}) {
data.method = 'dj.api.smartcarlife.common.car.brand.list'
export function getCarBrandList(data = {}) {
data.method = "dj.api.smartcarlife.common.car.brand.list"
return request(data, RequestMethods.POST)
}
/**
* 获取支付渠道列表
*/
export function paymentChannelList(data = {}) {
data.method = "dj.api.smartcarlife.paymentChannel.list"
return request(data, RequestMethods.POST)
}
<!-- 分账测试渠道 -->
<template>
<d2-dialog title="选择分账测试渠道" :is-visible="verificationCodeVisible" class="verificationCode" width="750px"
btn-ok-label="申请虚拟对公账户" @closeDialog="handleClose" @confirmDialog="handleConfirm">
<!-- <div class="box" v-for="(item, index) in accountValidMerchants" :key="index"> -->
<el-radio-group v-model="paymentChannelId" class="radio-group">
<el-radio :label="item.paymentChannelId" v-for="(item, index) in divisionRuleTests" :key="index">{{
item.paymentChannelName }}</el-radio>
</el-radio-group>
<!-- </div> -->
</d2-dialog>
</template>
<script>
// import { sendSms, getAdminInfo } from '@api/merchant'
import { mapActions } from 'vuex'
export default {
name: 'ChannelSelectDialog',
props: {
visible: {
// 弹窗是否展示
type: Boolean,
default: false
},
accountValidMerchants: {
type: Array,
default: () => []
},
divisionRuleTests: {
type: Array,
default: () => []
}
},
computed: {
verificationCodeVisible: {
// return this.
get() {
return this.visible
},
set(val) {
this.$emit('update:visible', false)
}
},
paymentChannelObj() {
return this.divisionRuleTests.find(item => item.paymentChannelId === this.paymentChannelId)
}
},
data() {
return {
paymentChannelId: ''
}
},
mounted() {
},
methods: {
...mapActions({
close: 'd2admin/page/close'
}),
handleClose() {
// this.$emit('dialogClose')
// this.$update
this.verificationCodeVisible = false
},
// handleApply() {
// },
// 选择并确认
handleConfirm() {
if (!this.paymentChannelId) {
return this.$message.error('请选择渠道');
}
this.$emit('handleConfirm', this.paymentChannelObj)
this.handleClose()
// this.$router.push({ name: 'accountList_new' })
// this.close({ tagName: '/merchantDetail' })
}
}
}
</script>
<style scoped lang="scss">
.container {
padding: 16px 44px;
color: #333333;
background: #f6f8fa;
}
.channel {
color: #333333;
font-size: 16px;
}
.info {
color: #666666;
font-size: 14px;
}
</style>
......@@ -777,6 +777,8 @@
:visible.sync="tipsDialogVisible" />
<financialCalculationDialog v-if="financialCalculationVisible" v-on="$listeners"
:financial-calculation-obj="financialCalculationObj" :visible.sync="financialCalculationVisible" />
<channelSelectDialog v-if="channelSelectDialogVisible" v-on="$listeners" :divisionRuleTests="divisionRuleTests"
@handleConfirm="channelConfirm" :visible.sync="channelSelectDialogVisible" />
</div>
</template>
......@@ -799,13 +801,15 @@ import {
goodsSourceList
} from "@/common/constant/merchant"
import tipsDialog from "./tipsDialog"
import financialCalculationDialog from "./financialCalculationDialog.vue"
import financialCalculationDialog from "./financialCalculationDialog"
import channelSelectDialog from "./channelSelectDialog"
export default {
name: "ClassificationCpt",
components: {
tableAccount,
tipsDialog,
financialCalculationDialog
financialCalculationDialog,
channelSelectDialog
},
props: {
goodsTypeGroupRules: {
......@@ -960,6 +964,7 @@ export default {
}
}
return {
divisionRuleTests: [],
financialCalculationVisible: false,
tipsDialogVisible: false,
accountValidMerchants: [],
......@@ -1562,20 +1567,36 @@ export default {
divisionRuleTestGet({
goodsTypeGroupDivisionId: this.goodsTypeGroupDivisionId
}).then((result) => {
const { subProgress, accountValidMerchants } = result
// 没有虚拟对公账户
if (subProgress == 32) {
// const { notInForceAccountMerchantMap, divisionRuleTestMap } = result
const { notInForceAccountMerchants, divisionRuleTests } = result
// 如果有没有管理的虚拟对公账户
if (notInForceAccountMerchants) {
this.tipsDialogVisible = true
this.accountValidMerchants = accountValidMerchants
this.accountValidMerchants = notInForceAccountMerchants
}
console.log([34, 35, 36, 31].includes(subProgress))
if ([34, 35, 36, 31].includes(subProgress)) {
// const { subProgress, accountValidMerchants } = result
// 没有虚拟对公账户
// if (subProgress == 32) {
// this.tipsDialogVisible = true
// this.accountValidMerchants = accountValidMerchants
// }
// console.log([34, 35, 36, 31].includes(subProgress))
// [34, 35, 36, 31].includes(subProgress)
// 需要做分账测算
if (divisionRuleTests) {
this.financialCalculationVisible = true
this.financialCalculationObj = result
}
console.log("result", result)
})
},
channelConfirm(result) {
// if (divisionRuleTests) {
this.financialCalculationVisible = true
this.financialCalculationObj = result
// }
},
ruleTest() {
this.$emit("rulesTest")
},
......
......@@ -69,11 +69,6 @@
<!-- v-if="financialCalculationObj.orderCode" -->
<div class="txt-box">
<div id="qrcodeDiv" class="qrImg" />
<!-- <vue-qr class="middle"
:margin="0"
width="134"
height="134"
:text="financialCalculationObj.orderCode" /> -->
</div>
</div>
<div class="step-desc-box">
......@@ -112,88 +107,6 @@
</el-button> -->
</p>
</el-form-item>
<!-- </template> -->
<!-- <el-form-item v-if="Object.values(needJudgeMerchantList).includes(3)">
<p class="one-line-ellipsis"
:title="merchantInfo.realityDivisionMerchant ? merchantInfo.realityDivisionMerchant.merchantName : ''">
<img class="point"
src="./images/point.png">{{ merchantInfo.realityDivisionMerchant ? merchantInfo.realityDivisionMerchant.merchantName : '' }}
</p>
<p class="flex">
<el-input :disabled="merchantInfo.divisionStatus !== 3"
:size="size"
v-model="moneyForm.realityShopDivisionMoney"
placeholder="导流方收款金额"
@input="handlePartnerDivisionMoney($event,'realityShopDivisionMoney')" />
<el-button :size="size"
:disabled="merchantInfo.divisionStatus !== 3"
type="primary"
@click="handleSave">
确认
</el-button>
</p>
</el-form-item>
<el-form-item v-if="Object.values(needJudgeMerchantList).includes(2)">
<p class="one-line-ellipsis"
:title="merchantInfo.singlePartnerMerchant ? merchantInfo.singlePartnerMerchant.merchantName : ''">
<img class="point"
src="./images/point.png">{{ merchantInfo.singlePartnerMerchant ? merchantInfo.singlePartnerMerchant.merchantName : '' }}
</p>
<p class="flex">
<el-input :size="size"
:disabled="merchantInfo.divisionStatus !== 3"
v-model="moneyForm.singlePartnerDivisionMoney"
placeholder="服务商收款金额"
@input="handlePartnerDivisionMoney($event,'singlePartnerDivisionMoney')" />
<el-button :size="size"
:disabled="merchantInfo.divisionStatus !== 3"
type="primary"
@click="handleSave">
确认
</el-button>
</p>
</el-form-item>
<el-form-item v-if="Object.values(needJudgeMerchantList).includes(4)">
<p class="one-line-ellipsis"
:title="merchantInfo.installCostPartnerMerchant ? merchantInfo.installCostPartnerMerchant.merchantName : ''">
<img class="point"
src="./images/point.png">{{ merchantInfo.installCostPartnerMerchant ? merchantInfo.installCostPartnerMerchant.merchantName : '' }}
</p>
<p class="flex">
<el-input :size="size"
:disabled="merchantInfo.divisionStatus !== 3"
v-model="moneyForm.installCostMerchantDivisionMoney"
placeholder="安装费服务商收款金额"
@input="handlePartnerDivisionMoney($event,'installCostMerchantDivisionMoney')" />
<el-button :size="size"
:disabled="merchantInfo.divisionStatus !== 3"
type="primary"
@click="handleSave">
确认
</el-button>
</p>
</el-form-item>
<el-form-item v-if="Object.values(needJudgeMerchantList).includes(5)">
<p class="one-line-ellipsis"
:title="merchantInfo.marketingCostPartnerMerchant ? merchantInfo.marketingCostPartnerMerchant.merchantName : ''">
<img class="point"
src="./images/point.png">{{ merchantInfo.marketingCostPartnerMerchant ? merchantInfo.marketingCostPartnerMerchant.merchantName : '' }}
</p>
<p class="flex">
<el-input :size="size"
:disabled="merchantInfo.divisionStatus !== 3"
v-model="moneyForm.marketingCostMerchantDivisionMoney"
placeholder="营销费服务商收款金额"
@input="handlePartnerDivisionMoney($event,'marketingCostMerchantDivisionMoney')" />
<el-button :size="size"
:disabled="merchantInfo.divisionStatus !== 3"
type="primary"
@click="handleSave">
确认
</el-button>
</p>
</el-form-item> -->
</el-form>
</div>
</div>
......
<!-- 财务分账测试 -->
<template>
<!-- btn-ok-label="全部下载" -->
<d2-dialog title="提示"
:is-visible="verificationCodeVisible"
class="verificationCode"
width="750px"
btn-ok-label="申请虚拟对公账户"
@closeDialog="handleClose"
@confirmDialog="handleConfirm">
<d2-dialog title="提示" :is-visible="verificationCodeVisible" class="verificationCode" width="750px"
btn-ok-label="申请虚拟对公账户" @closeDialog="handleClose" @confirmDialog="handleConfirm">
<!-- <div>55</div> -->
<p>分账对象未开通虚拟对公账户,请继续前往申请开通:</p>
<div class="container">
<p v-for="(item,index) in accountValidMerchants"
:key="index">
<span class="label">名称: {{ item.merchantName }} </span>
</p>
<div class="box" v-for="(item, index) in accountValidMerchants" :key="index">
<p class="channel">渠道: {{ item.paymentChannelName }}分账对象未开通虚拟对公账户,请继续前往申请开通:</p>
<div class="info" v-if="item.shopMerchants.length">
流量方: <span v-for="(child, childIndex) in item.shopMerchants" :key='childIndex'>{{ child.merchantName }}</span>
</div>
<div class="info" v-if="item.partners.length">
服务商: <span v-for="(child, childIndex) in item.partners" :key='childIndex'>{{ child.merchantName }}</span>
</div>
<div class="info" v-if="item.platformMerchants.length">
平台方: <span v-for="(child, childIndex) in item.platformMerchants" :key='childIndex'>{{ child.merchantName
}}</span>
</div>
</div>
<!-- <div class="box" v-for="(item, index) in accountValidMerchants" :key="index">
<p class="channel">渠道: {{ item.paymentChannelName }}分账对象未开通虚拟对公账户,请继续前往申请开通:</p>
<div class="info" v-if="item.shopMerchants.length">
流量方: <span v-for="(child, childIndex) in item.shopMerchants" :key='childIndex'>{{ child.merchantName }}</span>
</div>
<div class="info" v-if="item.partners.length">
服务商: <span v-for="(child, childIndex) in item.partners" :key='childIndex'>{{ child.merchantName }}</span>
</div>
<div class="info" v-if="item.platformMerchants.length">
平台方: <span v-for="(child, childIndex) in item.platformMerchants" :key='childIndex'>{{ child.merchantName
}}</span>
</div>
</div> -->
</d2-dialog>
</template>
......@@ -82,4 +96,14 @@ export default {
color: #333333;
background: #f6f8fa;
}
.channel {
color: #333333;
font-size: 16px;
}
.info {
color: #666666;
font-size: 14px;
}
</style>
<template>
<d2-dialog title="收款二维码" :is-visible="qRcodeVisible" class="qRcodeDailog" width="750px" btn-ok-label="全部下载"
@closeDialog="handleClose" @confirmDialog="handleAddConfirm">
@closeDialog="handleClose" @confirmDialog="handleAddConfirm">
<div class="channelBox">
<span>支付渠道: </span>
<el-select v-model="paymentChannelId" placeholder="请选择" class="elSelect">
<el-option v-for="item in paymentChannelList" :key="item.paymentChannelId" :label="item.paymentChannelName"
:value="item.paymentChannelId">
</el-option>
</el-select>
<el-button type="primary" @click="savaAll">重新生成</el-button>
</div>
<div class="qrcon">
<div class="wxcon">
<div class="codeDiv" id="wxview">
......@@ -13,7 +22,7 @@
<div class="merchantNameDiv">{{ info.yqMerchantName }}</div>
</div>
<el-button style="marginTop:20px" type="primary "
@click="takeScreenshot('wxview', `${info.yqMerchantName}微信支付收款码`)">下载</el-button>
@click="takeScreenshot('wxview', `${info.yqMerchantName}微信支付收款码`)">下载</el-button>
</div>
<div class="alicon">
<div class="codeDiv" id="aliview">
......@@ -30,7 +39,7 @@
<div class="merchantNameDiv">{{ info.yqMerchantName }}</div>
</div>
<el-button style="marginTop:20px" type="primary "
@click="takeScreenshot('aliview', `${info.yqMerchantName}支付宝支付收款码`)">下载
@click="takeScreenshot('aliview', `${info.yqMerchantName}支付宝支付收款码`)">下载
</el-button>
</div>
</div>
......@@ -39,8 +48,8 @@
</template>
<script>
// alipayQrcode
import { createWeappQrcode } from '@api/serviceManage'
import { paymentChannelList } from "@api/merchant"
import { baseConfig } from '@/main'
import html2canvas from 'html2canvas'
import QRCode from "qrcodejs2"
......@@ -48,6 +57,8 @@ export default {
name: 'QRcodeDialog',
data() {
return {
paymentChannelList: [],
paymentChannelId: '8881A96B22B84A348263EE4F314A2A23',
infoForm: {
merchantType: '',
merchant: [],
......@@ -61,7 +72,8 @@ export default {
},
qrCodeURL: '',
aliqrCodeURL: '',
defaultImg: require('./images/defaultImg.png')
defaultImg: require('./images/defaultImg.png'),
qrcode: ''
}
},
......@@ -84,11 +96,24 @@ export default {
components: {},
mounted() {
this.initPaymentChannelList()
this.createQrcodeImage()
this.alipayQrcode()
},
methods: {
savaAll() {
this.createQrcodeImage()
this.alipayQrcode()
// this.takeScreenshot('wxview', `${this.info.yqMerchantName}微信支付收款码`)
// this.takeScreenshot('aliview', `${this.info.yqMerchantName}支付宝支付收款码`)
},
initPaymentChannelList() {
paymentChannelList().then((res) => {
this.paymentChannelList = res
})
},
/**
* @description: 图片转base64
* @param {String} url 需要转换的图片原链接(http://....jpg)
......@@ -117,11 +142,10 @@ export default {
createQrcodeImage() {
const oParams = {}
oParams.channelType = 1
oParams.appId = 'wx06d1198e751435d1'
// oParams.appId = 'wx902f0b9c4b2c669d'
oParams.appId = this.paymentChannelId == '8881A96B22B84A348263EE4F314A2A23' ? 'wx06d1198e751435d1' : 'wx3d2ee7f8bda398cc'
oParams.qrcodeType = 'QR_WXA_UNLIMIT'
oParams.path = 'packagesPayment/pages/QRPayment/QRPayment'
oParams.scene = `merchantId=${this.info.yqMerchantId}&merchantName=${this.info.yqMerchantName}`
oParams.scene = `merchantId=${this.info.yqMerchantId}&merchantName=${this.info.yqMerchantName}&paymentChannelId=${this.paymentChannelId}`
// oParams.appId = 'wx902f0b9c4b2c669d'
// oParams.appId = 'wx570d9331f9ace0bd'
// oParams.qrcodeType = 'QR_WXA_UNLIMIT'
......@@ -161,9 +185,6 @@ export default {
// 下载保存图片
takeScreenshot(eleId, name) {
// const opts = {
// useCORS: true
// }
const that = this
html2canvas(document.getElementById(eleId), {
backgroundColor: null,
......@@ -211,18 +232,23 @@ export default {
// 生成支付宝中间二维码
alipayQrcode() {
// const that = this
const shareUrl = `${baseConfig.alipayPath}?merchantId=${this.info.yqMerchantId}&merchantName=${this.info.yqMerchantName}`
// pay 支付渠道
const shareUrl = `${baseConfig.alipayPath}?merchantId=${this.info.yqMerchantId}&merchantName=${this.info.yqMerchantName}&pay=${this.paymentChannelId}`
console.log(baseConfig.alipayPath)
console.log(shareUrl)
setTimeout(() => {
console.log(document.getElementById('qrcodeDiv'))
const qrcode = new QRCode("qrcodeDiv", {
text: shareUrl,
width: 150, // 图像宽度
height: 150 // 图像高度
})
qrcode.clear() // 清除二维码
qrcode.makeCode(shareUrl) // 生成另一个新的二维码
if (this.qrcode) {
this.qrcode.clear() // 清除二维码
} else {
this.qrcode = new QRCode("qrcodeDiv", {
text: shareUrl,
width: 150, // 图像宽度
height: 150 // 图像高度
})
}
// qrcode.clear() // 清除二维码
this.qrcode.makeCode(shareUrl) // 生成另一个新的二维码
this.aliqrCodeURL = qrcode
}, 500)
// this.$nextTick(() => {
......@@ -269,7 +295,7 @@ export default {
}
}
</script>
<style scoped>
<style scoped lang="scss">
.qrcon {
display: flex;
}
......@@ -345,4 +371,12 @@ export default {
/* 自定义行数 */
-webkit-line-clamp: 2;
}
.channelBox {
margin: auto;
.elSelect {
margin: 0 10px 10px;
}
}
</style>
......@@ -18,33 +18,24 @@
<auth-button category="Button" />
</d2-table-header>
<d2-table ref="serviceStoreTable" :search-form="searchForm" :table-params="tableParams" :get-list-api="getListApi"
:before-search-fn="beforeSearchFn">
:before-search-fn="beforeSearchFn">
<auth-button slot="auth-button" slot-scope="scope" :data="scope.scope">
</auth-button>
</d2-table>
<qrcode-dialog :q-rcode-visible="qRcodeVisible" :info="recordInfo" v-if="qRcodeVisible"
@dialogClose="dialogClose" />
@dialogClose="dialogClose" />
</div>
<wxQRcodeDialog :q-rcode-visible.sync="QRcodeDialog" v-if="QRcodeDialog" :merchant-info="recordInfo" />
<scene-entry-dialog :scene-entry-visible="sceneEntryVisible" :info="recordInfo" v-if="sceneEntryVisible"
@dialogClose="sceneDialogClose" />
@dialogClose="sceneDialogClose" />
</d2-container>
</template>
<script>
import { Util, deepClone } from '@/common/util'
// import _ from 'lodash'
import {
// getList,
// getMerchantList,
// addParentMerchant,
// deleteParentMerchant,
getYqMerchantConfig
} from '@api/serviceManage'
import { getYqMerchantConfig } from '@api/serviceManage'
import { mapActions } from 'vuex'
import { BaseData, manageTypeList } from '@/common/constants.js'
// import { sendSms, getAdminInfo } from '@api/merchant'
// import { getParkStore } from '@api/editCustomer'
import qrcodeDialog from './qRcodeDialog'
import wxQRcodeDialog from './wxQRcodeDialog'
import sceneEntryDialog from './sceneEntryDialog'
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!