|
|
@ -115,6 +115,8 @@ |
|
|
import GuipInput from '@/components/GuipInput.vue'; |
|
|
import GuipInput from '@/components/GuipInput.vue'; |
|
|
import GuipButton from '@/components/GuipButton.vue'; |
|
|
import GuipButton from '@/components/GuipButton.vue'; |
|
|
import GuipFormItem from '@/components/GuipFormItem.vue'; |
|
|
import GuipFormItem from '@/components/GuipFormItem.vue'; |
|
|
|
|
|
const PAY_TYPE_WEIXIN = 2; // 微信 |
|
|
|
|
|
const PAY_TYPE_ALIPAY = 3; // 支付宝 |
|
|
export default { |
|
|
export default { |
|
|
// 站点设置 |
|
|
// 站点设置 |
|
|
name: 'addPay', |
|
|
name: 'addPay', |
|
|
@ -154,7 +156,12 @@ export default { |
|
|
{ validator: notPureNumberRule, trigger: 'blur' } |
|
|
{ validator: notPureNumberRule, trigger: 'blur' } |
|
|
], |
|
|
], |
|
|
mch_id: [ |
|
|
mch_id: [ |
|
|
{ required: true, message: '请输入微信支付商户号', trigger: 'blur' } |
|
|
{ required: true, message: '请输入微信支付商户号', trigger: 'blur' }, |
|
|
|
|
|
{ |
|
|
|
|
|
pattern: /^\d+$/, |
|
|
|
|
|
message: '商户号必须为纯数字', |
|
|
|
|
|
trigger: 'blur' |
|
|
|
|
|
} |
|
|
], |
|
|
], |
|
|
pkey: [ |
|
|
pkey: [ |
|
|
{ required: true, message: '请输入微信支付秘钥', trigger: 'blur' }, |
|
|
{ required: true, message: '请输入微信支付秘钥', trigger: 'blur' }, |
|
|
@ -173,10 +180,14 @@ export default { |
|
|
fileList1: [], |
|
|
fileList1: [], |
|
|
noFileFlag: false, |
|
|
noFileFlag: false, |
|
|
noFileFlag1: false, |
|
|
noFileFlag1: false, |
|
|
|
|
|
payTypeWeixin: PAY_TYPE_WEIXIN, |
|
|
|
|
|
payTypeAlipay: PAY_TYPE_ALIPAY, |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
created() { |
|
|
created() { |
|
|
// 初始化 |
|
|
// 初始化 |
|
|
|
|
|
this.formData.set('doctor_id', this.$route.query.doctor_id) |
|
|
|
|
|
this.formData.set('depart_id', this.$route.query.depart_id) |
|
|
this.getPayment(); |
|
|
this.getPayment(); |
|
|
console.log('apiclient_cert' in this.payInfo,'apiclient_key'); |
|
|
console.log('apiclient_cert' in this.payInfo,'apiclient_key'); |
|
|
}, |
|
|
}, |
|
|
@ -212,6 +223,7 @@ export default { |
|
|
this.noFileFlag = false; |
|
|
this.noFileFlag = false; |
|
|
this.payInfo.apiclient_cert = fileObj; |
|
|
this.payInfo.apiclient_cert = fileObj; |
|
|
this.formData.set('apiclient_cert', fileObj) |
|
|
this.formData.set('apiclient_cert', fileObj) |
|
|
|
|
|
// this.uoload_apipem() |
|
|
}, |
|
|
}, |
|
|
handleAvatarChange1(file, fileList) { |
|
|
handleAvatarChange1(file, fileList) { |
|
|
console.log(file, fileList, 'file') |
|
|
console.log(file, fileList, 'file') |
|
|
@ -220,62 +232,81 @@ export default { |
|
|
this.payInfo.apiclient_key = fileObj; |
|
|
this.payInfo.apiclient_key = fileObj; |
|
|
this.formData.set('apiclient_key', fileObj) |
|
|
this.formData.set('apiclient_key', fileObj) |
|
|
}, |
|
|
}, |
|
|
|
|
|
// 文件上传 |
|
|
|
|
|
// uoload_apipem(){ |
|
|
|
|
|
// // pay_id ??? |
|
|
|
|
|
|
|
|
|
|
|
// // const formData = new FormData(); |
|
|
|
|
|
// // formData.set('doctor_id', this.$route.query.doctor_id) |
|
|
|
|
|
// // formData.set('depart_id', this.$route.query.depart_id) |
|
|
|
|
|
// // formData.set('apiclient_cert',this.formData.apiclient_cert) |
|
|
|
|
|
|
|
|
|
|
|
// this.$http('POST', '/api/admin/upload_wx_api_cert', this.formData).then(response => { |
|
|
|
|
|
// if(response.code == 0){ |
|
|
|
|
|
// this.$message.success('上传成功'); |
|
|
|
|
|
// return true; |
|
|
|
|
|
// } |
|
|
|
|
|
// this.$message.error(response.msg); |
|
|
|
|
|
// }).catch(error => { |
|
|
|
|
|
// console.error(error, 'error') |
|
|
|
|
|
// }) |
|
|
|
|
|
// }, |
|
|
|
|
|
|
|
|
saveConfirm() { |
|
|
saveConfirm() { |
|
|
// 查看有多少参数 |
|
|
// pay_id ??? |
|
|
|
|
|
// 测试-查看有多少参数 |
|
|
// for (let [key, value] of this.formData.entries()) { |
|
|
// for (let [key, value] of this.formData.entries()) { |
|
|
// console.log('键 (Key):', key); |
|
|
// console.log('键 (Key):', key); |
|
|
// console.log('值 (Value):', value); |
|
|
// console.log('值 (Value):', value); |
|
|
// } |
|
|
// } |
|
|
if(!this.formData.has('apiclient_key') ){ |
|
|
// if(!this.formData.has('apiclient_key') ){ |
|
|
this.noFileFlag1 = true; |
|
|
// this.noFileFlag1 = true; |
|
|
if( !this.formData.has('apiclient_cert')){ |
|
|
// if( !this.formData.has('apiclient_cert')){ |
|
|
this.noFileFlag = true; |
|
|
// this.noFileFlag = true; |
|
|
this.$positionMessage({ |
|
|
// this.$positionMessage({ |
|
|
type: 'error', |
|
|
// type: 'error', |
|
|
message: '请先上传证书', |
|
|
// message: '请先上传证书', |
|
|
target: this.$refs['saveRef'], // 可以是DOM元素或选择器 |
|
|
// target: this.$refs['saveRef'], // 可以是DOM元素或选择器 |
|
|
position: 'top' |
|
|
// position: 'top' |
|
|
}) |
|
|
// }) |
|
|
return false; |
|
|
// return false; |
|
|
} |
|
|
// } |
|
|
this.$positionMessage({ |
|
|
// this.$positionMessage({ |
|
|
type: 'error', |
|
|
// type: 'error', |
|
|
message: '请先上传证书', |
|
|
// message: '请先上传证书', |
|
|
target: this.$refs['saveRef'], // 可以是DOM元素或选择器 |
|
|
// target: this.$refs['saveRef'], // 可以是DOM元素或选择器 |
|
|
position: 'top' |
|
|
// position: 'top' |
|
|
}) |
|
|
// }) |
|
|
return false; |
|
|
// return false; |
|
|
} |
|
|
// } |
|
|
|
|
|
|
|
|
this.$refs.wxform.validate((valid) => { |
|
|
this.$refs.wxform.validate((valid) => { |
|
|
console.log(valid, 'valid'); |
|
|
console.log(valid, 'valid'); |
|
|
if (valid) { |
|
|
// if (valid) { |
|
|
for (let key in this.formData1) { |
|
|
// for (let key in this.formData1) { |
|
|
this.formData.set(key, this.formData1[key]) |
|
|
// this.formData.set(key, this.formData1[key]) |
|
|
} |
|
|
// } |
|
|
this.formData.set('doctor_id', this.$route.query.doctor_id) |
|
|
// this.formData.set('doctor_id', this.$route.query.doctor_id) |
|
|
this.formData.set('depart_id', this.$route.query.depart_id) |
|
|
// this.formData.set('depart_id', this.$route.query.depart_id) |
|
|
this.formData.set('type','2') |
|
|
// this.formData.set('type',this.payTypeWeixin)//这个参数 待定 2 微信支付 \ 3 支付宝 |
|
|
const that = this |
|
|
// this.formData.set('is_pay_public','0') |
|
|
this.$http('POST', '/api/admin/set_pay_method', this.formData).then(response => { |
|
|
// const that = this; |
|
|
if(response.status){ |
|
|
// this.$http('POST', '/api/admin/set_pay_method', this.formData).then(response => { |
|
|
that.$message.success('保存成功'); |
|
|
// if(response.code == 0){ |
|
|
// that.payList = response.data.paylist |
|
|
// that.$message.success('保存成功'); |
|
|
// that.$emit('saveEvent', that.payList) |
|
|
// // that.payList = response.data.paylist |
|
|
this.$router.go(-1); |
|
|
// // that.$emit('saveEvent', that.payList) |
|
|
return true; |
|
|
// this.$router.go(-1); |
|
|
} |
|
|
// return true; |
|
|
that.$message.error(response.info); |
|
|
// } |
|
|
}).catch(error => { |
|
|
// that.$message.error(response.msg); |
|
|
console.error(error, 'error') |
|
|
// }).catch(error => { |
|
|
}) |
|
|
// console.error(error, 'error') |
|
|
} else { |
|
|
// }) |
|
|
return false; |
|
|
// } else { |
|
|
} |
|
|
// return false; |
|
|
|
|
|
// } |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|