Browse Source

接收收款设置列表参数、商户号数字校验

pull/10/head
zq 2 weeks ago
parent
commit
1237eb0fcb
  1. 54
      src/views/HosInformation.vue
  2. 125
      src/views/weChatPayment.vue

54
src/views/HosInformation.vue

@ -737,7 +737,6 @@ export default {
this.fetchPackData()
this.fetchProjectData()
this.geHosAdress()
this.getPayList()
} else {
await this.getAreaData()
}
@ -806,34 +805,7 @@ export default {
}
},
//
getPayList() {
this.$http('POST', '/agentnew/ajax_get_pay_list', {
doctor_id: this.doctor_id,
depart_id:this.depart_id
}).then(response => {
this.$nextTick(() => {
if (
response.data &&
response.data.paylist &&
response.data.paylist[this.payTypeWeixin] &&
response.data.paylist[this.payTypeWeixin].length > 0
) {
this.wxpayList = response.data.paylist[this.payTypeWeixin]
}
if (
response.data &&
response.data.paylist &&
response.data.paylist[this.payTypeAlipay] &&
response.data.paylist[this.payTypeAlipay].length > 0
) {
this.alipayList = response.data.paylist[this.payTypeAlipay]
}
})
}).catch(error => {
console.error(error, 'error')
})
},
changeSelectWeixin(item) {
console.log(item, 'item')
if(this.bindWxpayId === item.payid){
@ -1035,6 +1007,30 @@ export default {
this.hasVisitFee = response.data.has_visit_fee
this.registerMoney = response.data.visit_price
// 1.2
// if (
// response.data &&
// response.data.paylist &&
// response.data.paylist[this.payTypeWeixin] &&
// response.data.paylist[this.payTypeWeixin].length > 0
// ) {
// this.wxpayList = response.data.paylist[this.payTypeWeixin]
// }
// if (
// response.data &&
// response.data.paylist &&
// response.data.paylist[this.payTypeAlipay] &&
// response.data.paylist[this.payTypeAlipay].length > 0
// ) {
// this.alipayList = response.data.paylist[this.payTypeAlipay]
// }
// 2.
// this.wxpayList = response.data.wxpay_list;//
// this.alipayList = response.data.alipayList;//
// this.selectWxpay = response.data.site_pays[this.payTypeWeixin];//
// this.selectAlipay = response.data.site_pays[this.payTypeAlipay];//
this.hasAgainVisitFreeDays = response.data.has_again_visit_free_days
this.againVisitFreeDays = response.data.again_visit_free_days
this.hasRemainVisitFree = response.data.has_remain_visit_free

125
src/views/weChatPayment.vue

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

Loading…
Cancel
Save