|
|
|
@ -2,7 +2,7 @@
|
|
|
|
|
* @Author: ch
|
|
|
|
|
* @Date: 2022-07-04 16:42:21
|
|
|
|
|
* @LastEditors: ch
|
|
|
|
|
* @LastEditTime: 2022-07-07 15:50:18
|
|
|
|
|
* @LastEditTime: 2022-07-07 16:30:11
|
|
|
|
|
* @Description: file content
|
|
|
|
|
-->
|
|
|
|
|
<template>
|
|
|
|
@ -62,16 +62,21 @@
|
|
|
|
|
const aliFormEl = ref();
|
|
|
|
|
const wxFormEl = ref();
|
|
|
|
|
|
|
|
|
|
const init = () => {
|
|
|
|
|
store.dispatch('merchant/getMerchantPlatform');
|
|
|
|
|
onActivated(() => {
|
|
|
|
|
handlelLoadData();
|
|
|
|
|
});
|
|
|
|
|
formEl.value.resetFields();
|
|
|
|
|
wxFormEl.value && wxFormEl.value.resetFields();
|
|
|
|
|
aliFormEl.value && aliFormEl.value.resetFields();
|
|
|
|
|
let id = route.params.id;
|
|
|
|
|
if (id && form.id !== id) {
|
|
|
|
|
handlelLoadDetail();
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
onActivated(init);
|
|
|
|
|
/**
|
|
|
|
|
* 如果是编辑需要加载初始数据加载
|
|
|
|
|
*/
|
|
|
|
|
const handlelLoadData = async () => {
|
|
|
|
|
let id = route.params.id;
|
|
|
|
|
if (id && form.id !== id) {
|
|
|
|
|
const handlelLoadDetail = async () => {
|
|
|
|
|
let res = await store.dispatch('merchant/detail', id);
|
|
|
|
|
if (res.mchCode === 'alipay') {
|
|
|
|
|
const publicKey = res.aliMchData.publicKey;
|
|
|
|
@ -89,7 +94,6 @@
|
|
|
|
|
delete res.wxMchData.serialNo;
|
|
|
|
|
}
|
|
|
|
|
Object.assign(form, res);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
const handleSave = async () => {
|
|
|
|
|
let validate = false;
|
|
|
|
@ -108,10 +112,6 @@
|
|
|
|
|
.catch(() => {});
|
|
|
|
|
};
|
|
|
|
|
const handleCancel = () => {
|
|
|
|
|
Object.assign(form, defaultForm);
|
|
|
|
|
wxFormEl.value && wxFormEl.value.resetFields();
|
|
|
|
|
aliFormEl.value && aliFormEl.value.resetFields();
|
|
|
|
|
formEl.value.resetFields();
|
|
|
|
|
router.push({ name: 'PayMerchant' });
|
|
|
|
|
};
|
|
|
|
|
</script>
|
|
|
|
|