细节 汇至付

master
fanfan 4 months ago
parent 219bb96fdd
commit c3912280d9
  1. 1078
      src/views/goods/distributionPrice/Index.vue
  2. 1074
      src/views/goods/memberPrice/Index.vue
  3. 276
      src/views/setting/payment/template/Update.vue

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -2,13 +2,7 @@
<a-card :bordered="false"> <a-card :bordered="false">
<div class="card-title">{{ $route.meta.title }}</div> <div class="card-title">{{ $route.meta.title }}</div>
<a-spin :spinning="isLoading"> <a-spin :spinning="isLoading">
<a-form-model <a-form-model ref="myForm" class="my-form" :model="record" :label-col="labelCol" :wrapperCol="wrapperCol">
ref="myForm"
class="my-form"
:model="record"
:label-col="labelCol"
:wrapperCol="wrapperCol"
>
<a-form-model-item <a-form-model-item
label="支付模板名称" label="支付模板名称"
prop="name" prop="name"
@ -33,11 +27,7 @@
<small>数字越小越靠前</small> <small>数字越小越靠前</small>
</div> </div>
</a-form-model-item> </a-form-model-item>
<a-form-model-item <a-form-model-item label="支付方式" prop="method" :rules="[{ required: true, message: '请选择支付方式' }]">
label="支付方式"
prop="method"
:rules="[{ required: true, message: '请选择支付方式' }]"
>
<a-radio-group v-model="record.method" disabled> <a-radio-group v-model="record.method" disabled>
<a-radio :value="PaymentMethodEnum.WECHAT.value">{{ PaymentMethodEnum.WECHAT.name }}</a-radio> <a-radio :value="PaymentMethodEnum.WECHAT.value">{{ PaymentMethodEnum.WECHAT.name }}</a-radio>
<a-radio :value="PaymentMethodEnum.ALIPAY.value">{{ PaymentMethodEnum.ALIPAY.name }}</a-radio> <a-radio :value="PaymentMethodEnum.ALIPAY.value">{{ PaymentMethodEnum.ALIPAY.name }}</a-radio>
@ -50,10 +40,7 @@
</p> </p>
<p v-if="record.method === PaymentMethodEnum.ALIPAY.value" class="extra"> <p v-if="record.method === PaymentMethodEnum.ALIPAY.value" class="extra">
支付宝开发者平台 支付宝开发者平台
<a <a href="https://open.alipay.com/dev/workspace" target="_blank">https://open.alipay.com/dev/workspace</a>
href="https://open.alipay.com/dev/workspace"
target="_blank"
>https://open.alipay.com/dev/workspace</a>
</p> </p>
</div> </div>
</a-form-model-item> </a-form-model-item>
@ -88,10 +75,7 @@
</a-radio-group> </a-radio-group>
</a-form-model-item> </a-form-model-item>
<div <div v-if="record.config.wechat.mchType === 'normal'" :mchType="record.config.wechat.mchType">
v-if="record.config.wechat.mchType === 'normal'"
:mchType="record.config.wechat.mchType"
>
<a-form-model-item <a-form-model-item
label="应用ID (AppID)" label="应用ID (AppID)"
prop="config.wechat.normal.appId" prop="config.wechat.normal.appId"
@ -99,7 +83,9 @@
> >
<a-input v-model="record.config.wechat.normal.appId" autocomplete="off" /> <a-input v-model="record.config.wechat.normal.appId" autocomplete="off" />
<div class="form-item-help"> <div class="form-item-help">
<small>微信小程序或者微信公众号的APPID需要在哪个客户端支付就填写哪个APP支付需要填写开放平台的应用APPID</small> <small
>微信小程序或者微信公众号的APPID需要在哪个客户端支付就填写哪个APP支付需要填写开放平台的应用APPID</small
>
</div> </div>
</a-form-model-item> </a-form-model-item>
@ -119,11 +105,7 @@
prop="config.wechat.normal.apiKey" prop="config.wechat.normal.apiKey"
:rules="[{ required: true, message: '请填写支付密钥 (APIKEY)' }]" :rules="[{ required: true, message: '请填写支付密钥 (APIKEY)' }]"
> >
<a-input <a-input type="password" v-model="record.config.wechat.normal.apiKey" autocomplete="off" />
type="password"
v-model="record.config.wechat.normal.apiKey"
autocomplete="off"
/>
<div class="form-item-help"> <div class="form-item-help">
<small>"微信支付商户平台"" - "账户中心" - "API安全" - "设置API密钥"</small> <small>"微信支付商户平台"" - "账户中心" - "API安全" - "设置API密钥"</small>
</div> </div>
@ -160,10 +142,7 @@
</a-form-model-item> </a-form-model-item>
</div> </div>
<div <div v-if="record.config.wechat.mchType === 'provider'" :mchType="record.config.wechat.mchType">
v-if="record.config.wechat.mchType === 'provider'"
:mchType="record.config.wechat.mchType"
>
<a-form-model-item <a-form-model-item
label="服务商应用ID (AppID)" label="服务商应用ID (AppID)"
prop="config.wechat.provider.spAppId" prop="config.wechat.provider.spAppId"
@ -191,11 +170,7 @@
prop="config.wechat.provider.spApiKey" prop="config.wechat.provider.spApiKey"
:rules="[{ required: true, message: '请填写服务商密钥 (APIKEY)' }]" :rules="[{ required: true, message: '请填写服务商密钥 (APIKEY)' }]"
> >
<a-input <a-input type="password" v-model="record.config.wechat.provider.spApiKey" autocomplete="off" />
type="password"
v-model="record.config.wechat.provider.spApiKey"
autocomplete="off"
/>
<div class="form-item-help"> <div class="form-item-help">
<small>"微信支付商户平台"" - "账户中心" - "API安全" - "设置API密钥"</small> <small>"微信支付商户平台"" - "账户中心" - "API安全" - "设置API密钥"</small>
</div> </div>
@ -208,7 +183,9 @@
> >
<a-input v-model="record.config.wechat.provider.subAppId" autocomplete="off" /> <a-input v-model="record.config.wechat.provider.subAppId" autocomplete="off" />
<div class="form-item-help"> <div class="form-item-help">
<small>微信小程序或者微信公众号的APPID需要在哪个客户端支付就填写哪个APP支付需要填写开放平台的应用APPID</small> <small
>微信小程序或者微信公众号的APPID需要在哪个客户端支付就填写哪个APP支付需要填写开放平台的应用APPID</small
>
</div> </div>
</a-form-model-item> </a-form-model-item>
@ -313,7 +290,7 @@
</a-form-model-item> </a-form-model-item>
</div> </div>
<div v-if="record.config.alipay.signMode ===10" :method="record.method"> <div v-if="record.config.alipay.signMode === 10" :method="record.method">
<a-form-model-item <a-form-model-item
label="应用公钥证书" label="应用公钥证书"
prop="config.alipay.appCertPublicKey" prop="config.alipay.appCertPublicKey"
@ -375,7 +352,7 @@
</div> </div>
</a-form-model-item> </a-form-model-item>
</div> </div>
<!-- 汇付支付 --> <!-- 汇付支付 -->
<div v-if="record.method === PaymentMethodEnum.HUIFU.value" :method="record.method"> <div v-if="record.method === PaymentMethodEnum.HUIFU.value" :method="record.method">
<a-form-model-item <a-form-model-item
label="商户号类型" label="商户号类型"
@ -384,16 +361,28 @@
> >
<a-radio-group v-model="record.config.huifu.mchType" @change="clearValidate()"> <a-radio-group v-model="record.config.huifu.mchType" @change="clearValidate()">
<a-radio value="normal">普通商户</a-radio> <a-radio value="normal">普通商户</a-radio>
<a-radio value="provider">子商户 (服务商模式)</a-radio> <!-- <a-radio value="provider">子商户 (服务商模式)</a-radio> -->
</a-radio-group> </a-radio-group>
</a-form-model-item> </a-form-model-item>
<div v-if="record.config.huifu.mchType === 'normal'" :mchType="record.config.huifu.mchType"> <div v-if="record.config.huifu.mchType === 'normal'" :mchType="record.config.huifu.mchType">
<a-form-model-item <a-form-model-item
label="汇付商户号" label="APPID"
prop="config.huifu.normal.sysId" prop="config.huifu.normal.appid"
:rules="[{ required: true, message: '请填写汇付商户号' }]" :rules="[{ required: true, message: '请填写APPID' }]"
>
<a-input v-model="record.config.huifu.normal.appid" autocomplete="off" />
<div class="form-item-help">
<small
>微信小程序或者微信公众号的APPID需要在哪个客户端支付就填写哪个APP支付需要填写开放平台的应用APPID</small
>
</div>
</a-form-model-item>
<a-form-model-item
label="APPKEY"
prop="config.huifu.normal.appkey"
:rules="[{ required: true, message: '请填写APPKEY' }]"
> >
<a-input v-model="record.config.huifu.normal.sysId" autocomplete="off" /> <a-input v-model="record.config.huifu.normal.appkey" autocomplete="off" />
<div class="form-item-help"> <div class="form-item-help">
<small <small
>微信小程序或者微信公众号的APPID需要在哪个客户端支付就填写哪个APP支付需要填写开放平台的应用APPID</small >微信小程序或者微信公众号的APPID需要在哪个客户端支付就填写哪个APP支付需要填写开放平台的应用APPID</small
@ -402,36 +391,39 @@
</a-form-model-item> </a-form-model-item>
<a-form-model-item <a-form-model-item
label="产品编号" label="商户编号"
prop="config.huifu.normal.productId" prop="config.huifu.normal.mid"
:rules="[{ required: true, message: '请填写产品编号' }]" :rules="[{ required: true, message: '请填写商户编号' }]"
> >
<a-input v-model="record.config.huifu.normal.productId" autocomplete="off" /> <a-input v-model="record.config.huifu.normal.mid" autocomplete="off" />
</a-form-model-item> </a-form-model-item>
<a-form-model-item <a-form-model-item
label="商户私钥" label="终端号"
prop="config.huifu.normal.rsaMerchPrivateKey" prop="config.huifu.normal.tid"
:rules="[{ required: true, message: '请填写商户私钥' }]" :rules="[{ required: true, message: '请填终端号' }]"
> >
<a-textarea <a-input v-model="record.config.huifu.normal.tid" autocomplete="off" />
v-model="record.config.huifu.normal.rsaMerchPrivateKey"
:autoSize="{ minRows: 4, maxRows: 6 }"
autocomplete="off"
/>
<div class="form-item-help">
<small>"微信支付商户平台"" - "账户中心" - "API安全" - "设置API密钥"</small>
</div>
</a-form-model-item> </a-form-model-item>
<a-form-model-item <a-form-model-item
label="汇付公钥" label="来源编号"
prop="config.huifu.normal.rsaHuifuPublicKey" prop="config.huifu.normal.msgSrcId"
:rules="[{ required: true, message: '请填写汇付公钥' }]" :rules="[{ required: true, message: '请填来源编号' }]"
> >
<a-textarea <a-input v-model="record.config.huifu.normal.msgSrcId" autocomplete="off" />
v-model="record.config.huifu.normal.rsaHuifuPublicKey" </a-form-model-item>
:autoSize="{ minRows: 4, maxRows: 6 }" <a-form-model-item
autocomplete="off" label="消息来源"
/> prop="config.huifu.normal.msgSrc"
:rules="[{ required: true, message: '请填消息来源' }]"
>
<a-input v-model="record.config.huifu.normal.msgSrc" autocomplete="off" />
</a-form-model-item>
<a-form-model-item
label="密钥(网付)"
prop="config.huifu.normal.md5Secret"
:rules="[{ required: true, message: '请填写支付密钥(网付)' }]"
>
<a-input type="password" v-model="record.config.huifu.normal.md5Secret" autocomplete="off" />
<div class="form-item-help"> <div class="form-item-help">
<small>"微信支付商户平台"" - "账户中心" - "API安全" - "设置API密钥"</small> <small>"微信支付商户平台"" - "账户中心" - "API安全" - "设置API密钥"</small>
</div> </div>
@ -440,57 +432,71 @@
<div v-if="record.config.huifu.mchType === 'provider'" :mchType="record.config.huifu.mchType"> <div v-if="record.config.huifu.mchType === 'provider'" :mchType="record.config.huifu.mchType">
<a-form-model-item <a-form-model-item
label="汇付商户号" label="APPID"
prop="config.huifu.provider.spSysId" prop="config.huifu.provider.spAppid"
:rules="[{ required: true, message: '请填写汇付商户号' }]" :rules="[{ required: true, message: '请填写APPID' }]"
> >
<a-input v-model="record.config.huifu.provider.spAppId" autocomplete="off" /> <a-input v-model="record.config.huifu.provider.spAppid" autocomplete="off" />
<div class="form-item-help"> <div class="form-item-help">
<small>请填写微信支付服务商的AppID</small> <small>请填写微信支付服务商的AppID</small>
</div> </div>
</a-form-model-item> </a-form-model-item>
<a-form-model-item <a-form-model-item
label="产品编号" label="APPKEY"
prop="config.huifu.provider.spProductId" prop="config.huifu.provider.syAppkey"
:rules="[{ required: true, message: '请填写产品编号' }]" :rules="[{ required: true, message: '请填写APPKEY' }]"
> >
<a-input v-model="record.config.huifu.provider.spProductId" autocomplete="off" /> <a-input v-model="record.config.huifu.provider.syAppkey" autocomplete="off" />
<div class="form-item-help"> <div class="form-item-help">
<small>微信支付服务商的商户号纯数字格式例如1600000109</small> <small>请填写微信支付服务商的AppID</small>
</div> </div>
</a-form-model-item> </a-form-model-item>
<a-form-model-item <a-form-model-item
label="商户私钥" label="商户编号"
prop="config.huifu.provider.spRsaMerchPrivateKey" prop="config.huifu.provider.syMid"
:rules="[{ required: true, message: '请填写商户私钥' }]" :rules="[{ required: true, message: '请填写商户编号' }]"
> >
<a-textarea <a-input v-model="record.config.huifu.provider.syMid" autocomplete="off" />
v-model="record.config.huifu.provider.spRsaMerchPrivateKey" <!-- <div class="form-item-help">
:autoSize="{ minRows: 4, maxRows: 6 }" <small>微信支付服务商的商户号纯数字格式例如1600000109</small>
autocomplete="off" </div> -->
/>
<div class="form-item-help">
<small>"微信支付商户平台"" - "账户中心" - "API安全" - "设置API密钥"</small>
</div>
</a-form-model-item> </a-form-model-item>
<a-form-model-item <a-form-model-item
label="汇付公钥" label="终端号"
prop="config.huifu.provider.spRsaHuifuPublicKey" prop="config.huifu.provider.syTid"
:rules="[{ required: true, message: '请填写汇付公钥' }]" :rules="[{ required: true, message: '请填写终端号' }]"
> >
<a-textarea <a-input v-model="record.config.huifu.provider.syTid" autocomplete="off" />
v-model="record.config.huifu.provider.spRsaHuifuPublicKey" </a-form-model-item>
:autoSize="{ minRows: 4, maxRows: 6 }" <a-form-model-item
autocomplete="off" label="来源编号"
/> prop="config.huifu.provider.syMsgSrcId"
:rules="[{ required: true, message: '请填写来源编号' }]"
>
<a-input v-model="record.config.huifu.provider.syMsgSrcId" autocomplete="off" />
</a-form-model-item>
<a-form-model-item
label="消息来源"
prop="config.huifu.provider.syMsgSrc"
:rules="[{ required: true, message: '请填写终端号' }]"
>
<a-input v-model="record.config.huifu.provider.syMsgSrc" autocomplete="off" />
<!-- <div class="form-item-help">
<small>微信支付服务商的商户号纯数字格式例如1600000109</small>
</div> -->
</a-form-model-item>
<a-form-model-item
label="密钥(网付)"
prop="config.huifu.provider.syMd5Secret"
:rules="[{ required: true, message: '请填写支付密钥(网付)' }]"
>
<a-input type="password" v-model="record.config.huifu.normal.syMd5Secret" autocomplete="off" />
<div class="form-item-help"> <div class="form-item-help">
<small>"微信支付商户平台"" - "账户中心" - "API安全" - "设置API密钥"</small> <small>"微信支付商户平台"" - "账户中心" - "API安全" - "设置API密钥"</small>
</div> </div>
</a-form-model-item> </a-form-model-item>
<a-form-model-item <!-- <a-form-model-item
label="子商户私钥" label="子商户私钥"
prop="config.huifu.provider.subAppId" prop="config.huifu.provider.subAppId"
:rules="[{ required: true, message: '请填写子商户应用ID (AppID)' }]" :rules="[{ required: true, message: '请填写子商户应用ID (AppID)' }]"
@ -519,7 +525,7 @@
<div class="form-item-help"> <div class="form-item-help">
<small>微信支付的商户号纯数字格式例如1600000109</small> <small>微信支付的商户号纯数字格式例如1600000109</small>
</div> </div>
</a-form-model-item> </a-form-model-item> -->
</div> </div>
</div> </div>
<a-form-model-item :wrapperCol="{ offset: labelCol.span }"> <a-form-model-item :wrapperCol="{ offset: labelCol.span }">
@ -562,8 +568,8 @@ const defaultData = {
subAppId: '', subAppId: '',
subMchId: '', subMchId: '',
spApiclientCert: '', spApiclientCert: '',
spApiclientKey: '' spApiclientKey: '',
} },
}, },
[PaymentMethodEnum.ALIPAY.value]: { [PaymentMethodEnum.ALIPAY.value]: {
appId: '', appId: '',
@ -573,23 +579,29 @@ const defaultData = {
appCertPublicKey: '', appCertPublicKey: '',
alipayCertPublicKey: '', alipayCertPublicKey: '',
alipayRootCert: '', alipayRootCert: '',
merchantPrivateKey: '' merchantPrivateKey: '',
}, },
[PaymentMethodEnum.HUIFU.value]: { [PaymentMethodEnum.HUIFU.value]: {
// normal provider // normal provider
mchType: 'normal', mchType: 'normal',
normal: { normal: {
sysId: '', sysId: '',
productId: '', appkey: '',
rsaMerchPrivateKey: '', mid: '',
rsaHuifuPublicKey: '', tid: '',
msgSrcId: '',
msgSrc: '',
md5Secret: '',
}, },
provider: { provider: {
sysId: '', sysId: '',
productId: '', syAppkey: '',
rsaMerchPrivateKey: '', syMid: '',
rsaHuifuPublicKey: '', syTid: '',
// spSysId: '', syMsgSrcId: '',
syMsgSrc: '',
syMd5Secret: '',
// spAppid: '',
// spProductId: '', // spProductId: '',
// spRsaMerchPrivateKey: '', // spRsaMerchPrivateKey: '',
// spRsaHuifuPublicKey: '', // spRsaHuifuPublicKey: '',
@ -597,14 +609,14 @@ const defaultData = {
// spApiclientKey: '', // spApiclientKey: '',
}, },
}, },
} },
} }
export default { export default {
components: { components: {
InputFile InputFile,
}, },
data () { data() {
return { return {
// //
isLoading: false, isLoading: false,
@ -635,48 +647,47 @@ export default {
'$route.query.templateId': { '$route.query.templateId': {
// //
immediate: true, immediate: true,
handler (val) { handler(val) {
// ID // ID
this.templateId = val this.templateId = val
// //
this.getDetail() this.getDetail()
} },
} },
}, },
created () { }, created() {},
methods: { methods: {
// //
getDetail () { getDetail() {
this.isLoading = true this.isLoading = true
Api.detail(this.templateId) Api.detail(this.templateId)
.then(result => { .then((result) => {
// //
this.record = { ...defaultData, ...result.data.detail } this.record = { ...defaultData, ...result.data.detail }
}) })
.finally(() => this.isLoading = false) .finally(() => (this.isLoading = false))
}, },
// //
clearValidate () { clearValidate() {
this.$refs.myForm.clearValidate() this.$refs.myForm.clearValidate()
}, },
// //
handleSubmit (e) { handleSubmit(e) {
e.preventDefault() e.preventDefault()
this.$refs.myForm.validate(valid => { this.$refs.myForm.validate((valid) => {
if (valid) { if (valid) {
this.onSubmitForm() this.onSubmitForm()
} else { } else {
console.log('validate error') console.log('validate error')
return false return false
} }
}); })
}, },
// uploadFiles // uploadFiles
onChangeInputFile (name, args, key) { onChangeInputFile(name, args, key) {
const { uploadFiles } = this const { uploadFiles } = this
if (args[1] !== null) { if (args[1] !== null) {
uploadFiles[key] = args[1] uploadFiles[key] = args[1]
@ -684,12 +695,12 @@ export default {
}, },
// //
onSubmitForm () { onSubmitForm() {
this.isLoading = true this.isLoading = true
this.isBtnLoading = true this.isBtnLoading = true
const formData = this.buildFormData() const formData = this.buildFormData()
Api.edit(formData) Api.edit(formData)
.then(result => { .then((result) => {
// //
this.$message.success(result.message, 1.5) this.$message.success(result.message, 1.5)
// //
@ -697,12 +708,12 @@ export default {
this.$router.push('./index') this.$router.push('./index')
}, 1500) }, 1500)
}) })
.catch(() => this.isBtnLoading = false) .catch(() => (this.isBtnLoading = false))
.finally(() => this.isLoading = false) .finally(() => (this.isLoading = false))
}, },
// FormData // FormData
buildFormData () { buildFormData() {
const { record, uploadFiles, templateId } = this const { record, uploadFiles, templateId } = this
const formData = new FormData() const formData = new FormData()
formData.append('templateId', templateId) formData.append('templateId', templateId)
@ -717,9 +728,8 @@ export default {
} }
} }
return formData return formData
} },
},
}
} }
</script> </script>

Loading…
Cancel
Save