|
|
@ -507,43 +507,93 @@ |
|
|
|
/> |
|
|
|
</div> |
|
|
|
|
|
|
|
<el-form |
|
|
|
ref="ruleForm" |
|
|
|
:model="ruleForm" |
|
|
|
:rules="rules" |
|
|
|
label-width="100px" |
|
|
|
> |
|
|
|
<el-form-item |
|
|
|
label="账号" |
|
|
|
prop="businessPhone" |
|
|
|
<div v-if="wxaliPayOpen" style="display: flex;flex-direction: column"> |
|
|
|
<el-checkbox |
|
|
|
style="margin-bottom: 20px" |
|
|
|
v-model="wxPayCanConfig" |
|
|
|
:disabled="disabled" |
|
|
|
> |
|
|
|
<el-input |
|
|
|
v-if="businessPhoneShow" |
|
|
|
:value="hidden(ruleForm.businessPhone, 3, 4)" |
|
|
|
:disabled="disabled" |
|
|
|
maxlength="20" |
|
|
|
@focus="focusbusinessPhoneInput" |
|
|
|
/> |
|
|
|
<el-input |
|
|
|
v-else |
|
|
|
ref="businessPhoneCls" |
|
|
|
v-model="ruleForm.businessPhone" |
|
|
|
:disabled="disabled" |
|
|
|
maxlength="20" |
|
|
|
/> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item |
|
|
|
label="密码" |
|
|
|
prop="businessPassword" |
|
|
|
微信商户配置 |
|
|
|
</el-checkbox> |
|
|
|
|
|
|
|
<el-form |
|
|
|
v-if="wxPayCanConfig" |
|
|
|
ref="wxPayForm" |
|
|
|
:model="wxPayForm" |
|
|
|
:rules="wxPayRules" |
|
|
|
label-width="115px" |
|
|
|
> |
|
|
|
<el-input |
|
|
|
v-model="ruleForm.businessPassword" |
|
|
|
type="password" |
|
|
|
:disabled="disabled" |
|
|
|
maxlength="16" |
|
|
|
/> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
<el-form-item label="小程序appid" prop="appId"> |
|
|
|
<el-input |
|
|
|
v-model="wxPayForm.appId" placeholder="请输入支付小程序appid" :disabled="disabled"/> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="App端的appid" prop="appAppId"> |
|
|
|
<el-input |
|
|
|
v-model="wxPayForm.appAppId" placeholder="请输入支付APP端的appid" :disabled="disabled"/> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="商户号" prop="mchId"> |
|
|
|
<el-input |
|
|
|
v-model="wxPayForm.mchId" placeholder="请输入商户号" :disabled="disabled"/> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="商户秘钥" prop="mchKey"> |
|
|
|
<el-input |
|
|
|
v-model="wxPayForm.mchKey" placeholder="请输入商户秘钥" :disabled="disabled"/> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="私钥" prop="secret"> |
|
|
|
<el-input |
|
|
|
v-model="wxPayForm.secret" placeholder="请输入私钥" :disabled="disabled"/> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="证书路径" prop="certUrl"> |
|
|
|
<el-input |
|
|
|
v-model="wxPayForm.certUrl" placeholder="请输入证书路径" :disabled="disabled"/> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
|
|
|
|
<el-button v-if="wxPayCanConfig" style="width: 200px;align-self: center" type="primary" size="small" @click="handleWxPay">提 交</el-button> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div v-if="wxaliPayOpen" style="display: flex;flex-direction: column;margin-top: 15px"> |
|
|
|
|
|
|
|
<el-checkbox |
|
|
|
style="margin-bottom: 20px" |
|
|
|
v-model="aliPayCanConfig" |
|
|
|
:disabled="disabled" |
|
|
|
> |
|
|
|
支付宝商户配置 |
|
|
|
</el-checkbox> |
|
|
|
|
|
|
|
<el-form |
|
|
|
v-if="aliPayCanConfig" |
|
|
|
ref="aliPayForm" |
|
|
|
:model="aliPayForm" |
|
|
|
:rules="aliPayRules" |
|
|
|
label-width="115px" |
|
|
|
> |
|
|
|
<el-form-item label="应用appid" prop="appId"> |
|
|
|
<el-input |
|
|
|
v-model="aliPayForm.appId" placeholder="请输入应用appid" :disabled="disabled"/> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="应用私钥" prop="privateKey"> |
|
|
|
<el-input |
|
|
|
v-model="aliPayForm.privateKey" placeholder="请输入应用私钥" :disabled="disabled"/> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="支付宝公钥" prop="publicKey"> |
|
|
|
<el-input |
|
|
|
v-model="aliPayForm.publicKey" placeholder="请输入支付宝公钥" :disabled="disabled"/> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="内容解密key" prop="decryKey"> |
|
|
|
<el-input |
|
|
|
v-model="aliPayForm.decryKey" placeholder="请输入接口内容解密key" :disabled="disabled"/> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="网关地址" prop="gatewayUrl"> |
|
|
|
<el-input |
|
|
|
v-model="aliPayForm.gatewayUrl" placeholder="请输入请求网关地址" :disabled="disabled"/> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
|
|
|
|
<el-button v-if="aliPayCanConfig" style="width: 200px;align-self: center" type="primary" size="small" @click="handleAliPay">提 交</el-button> |
|
|
|
</div> |
|
|
|
|
|
|
|
</el-tab-pane> |
|
|
|
</el-tabs> |
|
|
|
</div> |
|
|
@ -662,7 +712,7 @@ import { |
|
|
|
hnapaySave, |
|
|
|
uploadCertInfo, |
|
|
|
getHnaPayInfo, |
|
|
|
changeBusinessPayMode |
|
|
|
changeBusinessPayMode, wxPaySave, aliPaySave, wxPayUpdate, aliPayUpdate, getWxPayInfo, getAliPayInfo |
|
|
|
} from '@/api/business' |
|
|
|
import SharesettingDialog from '../../../components/Sharesetting'; |
|
|
|
import DomainSettingDialog from '../../../components/DomainSetting'; |
|
|
@ -711,6 +761,24 @@ export default { |
|
|
|
bankBranch: '', //开户支行 |
|
|
|
contactPhone: '' //负责人电话 |
|
|
|
}, |
|
|
|
|
|
|
|
wxPayForm: { |
|
|
|
appId: '', // 支付小程序appid |
|
|
|
appAppId: '', // 支付APP端的appid |
|
|
|
mchId: '', // 商户号 |
|
|
|
mchKey: '', // 商户秘钥 |
|
|
|
secret: '', // 私钥 |
|
|
|
certUrl: '', // 证书路径 |
|
|
|
}, |
|
|
|
|
|
|
|
aliPayForm: { |
|
|
|
appId: '', // 应用appid |
|
|
|
privateKey: '', // 应用私钥 |
|
|
|
publicKey: '', // 支付宝公钥 |
|
|
|
decryKey: '', //内容解密key |
|
|
|
gatewayUrl: '', // 请求网关地址 |
|
|
|
}, |
|
|
|
|
|
|
|
isForever: false, |
|
|
|
validDateDisable: false, |
|
|
|
|
|
|
@ -744,6 +812,36 @@ export default { |
|
|
|
], |
|
|
|
}, |
|
|
|
|
|
|
|
wxPayRules: { |
|
|
|
appId: [ |
|
|
|
{ required: true, message: '支付小程序appid不能为空', trigger: 'blur' } |
|
|
|
], |
|
|
|
appAppId: [ |
|
|
|
{ required: true, message: '支付APP端的appid不能为空', trigger: 'blur' } |
|
|
|
], |
|
|
|
mchId: [ |
|
|
|
{ required: true, message: '商户号不能为空', trigger: 'blur' } |
|
|
|
], |
|
|
|
mchKey: [ |
|
|
|
{ required: true, message: '商户秘钥不能为空', trigger: 'blur' } |
|
|
|
], |
|
|
|
secret: [ |
|
|
|
{ required: true, message: '私钥不能为空', trigger: 'blur' } |
|
|
|
], |
|
|
|
}, |
|
|
|
|
|
|
|
aliPayRules: { |
|
|
|
appId: [ |
|
|
|
{ required: true, message: '应用appid不能为空', trigger: 'blur' } |
|
|
|
], |
|
|
|
privateKey: [ |
|
|
|
{ required: true, message: '应用私钥不能为空', trigger: 'blur' } |
|
|
|
], |
|
|
|
publicKey: [ |
|
|
|
{ required: true, message: '支付宝公钥不能为空', trigger: 'blur' } |
|
|
|
], |
|
|
|
}, |
|
|
|
|
|
|
|
showPhone: false, |
|
|
|
showAddress: false, |
|
|
|
userPhone: '', |
|
|
@ -875,6 +973,10 @@ export default { |
|
|
|
isWxaliPayOpenLoading: false, |
|
|
|
//商家支付模式 |
|
|
|
businessPayMode: '0', |
|
|
|
aliPayCanConfig: false, |
|
|
|
wxPayCanConfig: true, |
|
|
|
wxPayHasSave: false, |
|
|
|
aliPayHasSave: false, |
|
|
|
} |
|
|
|
}, |
|
|
|
// 监听属性 类似于data概念 |
|
|
@ -1077,6 +1179,10 @@ export default { |
|
|
|
contactPhone: '' //负责人电话 |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
this.getWxPayInfo() |
|
|
|
this.getAliPayInfo() |
|
|
|
|
|
|
|
this.showPhone = false |
|
|
|
this.personPhone = '' |
|
|
|
this.userState = 1 |
|
|
@ -1436,6 +1542,33 @@ export default { |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
getWxPayInfo(){ |
|
|
|
let _this = this; |
|
|
|
getWxPayInfo(this.currentBusinessId).then(res => { |
|
|
|
console.log(res) |
|
|
|
if (res.code === '') { |
|
|
|
_this.wxPayForm = res.data |
|
|
|
if (_this.wxPayForm.id){ |
|
|
|
console.log('getWxPayInfo-->', _this.wxPayForm) |
|
|
|
_this.wxPayHasSave = true |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
getAliPayInfo(){ |
|
|
|
let _this = this; |
|
|
|
getAliPayInfo(this.currentBusinessId).then(res => { |
|
|
|
console.log(res) |
|
|
|
if (res.code === '') { |
|
|
|
_this.aliPayForm = res.data |
|
|
|
if (_this.aliPayForm.id){ |
|
|
|
_this.aliPayHasSave = true |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
async hnapayOpenChange(newVal){ |
|
|
|
this.isHnaPayOpenLoading = true; |
|
|
|
this.lastHnaPayOpen = !newVal; |
|
|
@ -1469,7 +1602,113 @@ export default { |
|
|
|
}else { |
|
|
|
this.wxaliPayOpen = this.lastWxaliPayOpen; |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
handleWxPay() { |
|
|
|
if (this.wxPayCanConfig) { |
|
|
|
if (this.wxPayHasSave){ |
|
|
|
this.handleWxPayUpdate() |
|
|
|
}else { |
|
|
|
this.handleWxPaySave() |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
handleAliPay() { |
|
|
|
if (this.aliPayCanConfig){ |
|
|
|
if (this.aliPayHasSave){ |
|
|
|
this.handleAliPayUpdate() |
|
|
|
}else { |
|
|
|
this.handleAliPaySave() |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
handleWxPaySave() { |
|
|
|
let _this = this; |
|
|
|
this.$refs['wxPayForm'].validate((valid) => { |
|
|
|
if (valid) { |
|
|
|
let param = { |
|
|
|
businessId: this.currentBusinessId, |
|
|
|
appId: this.wxPayForm.appId, |
|
|
|
appAppId: this.wxPayForm.appAppId, |
|
|
|
mchId: this.wxPayForm.mchId, |
|
|
|
certUrl: this.wxPayForm.certUrl, |
|
|
|
mchKey: this.wxPayForm.mchKey, |
|
|
|
secret: this.wxPayForm.secret |
|
|
|
} |
|
|
|
wxPaySave(param).then(res => { |
|
|
|
console.log(res) |
|
|
|
if (res.code === '') { |
|
|
|
_this.wxPayHasSave = true |
|
|
|
this.$message({ |
|
|
|
message: '提交成功', |
|
|
|
type: 'success' |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
handleWxPayUpdate() { |
|
|
|
this.$refs['wxPayForm'].validate((valid) => { |
|
|
|
if (valid) { |
|
|
|
wxPayUpdate(this.wxPayForm).then(res => { |
|
|
|
console.log(res) |
|
|
|
if (res.code === '') { |
|
|
|
this.$message({ |
|
|
|
message: '修改成功', |
|
|
|
type: 'success' |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
handleAliPaySave() { |
|
|
|
let _this = this; |
|
|
|
this.$refs['aliPayForm'].validate((valid) => { |
|
|
|
if (valid) { |
|
|
|
let param = { |
|
|
|
businessId: this.currentBusinessId, |
|
|
|
appId: this.aliPayForm.appId, |
|
|
|
privateKey: this.aliPayForm.privateKey, |
|
|
|
publicKey: this.aliPayForm.publicKey, |
|
|
|
decryKey: this.aliPayForm.decryKey, |
|
|
|
gatewayUrl: this.aliPayForm.gatewayUrl, |
|
|
|
} |
|
|
|
aliPaySave(param).then(res => { |
|
|
|
console.log(res) |
|
|
|
if (res.code === '') { |
|
|
|
_this.aliPayHasSave = true |
|
|
|
this.$message({ |
|
|
|
message: '提交成功', |
|
|
|
type: 'success' |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
handleAliPayUpdate() { |
|
|
|
this.$refs['aliPayForm'].validate((valid) => { |
|
|
|
if (valid) { |
|
|
|
aliPayUpdate(this.aliPayForm).then(res => { |
|
|
|
console.log(res) |
|
|
|
if (res.code === '') { |
|
|
|
this.$message({ |
|
|
|
message: '修改成功', |
|
|
|
type: 'success' |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
</script> |
|
|
|